-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- セットアップエディタのリワークを開始
- Loading branch information
Showing
9 changed files
with
262 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<script lang="ts" setup> | ||
import { twMerge } from 'tailwind-merge'; | ||
const emit = defineEmits(['publish']); | ||
const title = defineModel<string>('title', { default: '' }); | ||
const description = defineModel<string>('description', { default: '' }); | ||
const tags = defineModel<string[]>('tags', { default: [] }); | ||
const coAuthors = defineModel< | ||
{ | ||
id: string; | ||
name: string; | ||
avatar: string; | ||
note: string; | ||
}[] | ||
>('coAuthors', { default: [] }); | ||
const image = defineModel<File | null>('image', { default: null }); | ||
const publishing = defineModel<boolean>('publishing', { default: false }); | ||
const { class: propClass } = defineProps<{ class?: string | string[] }>(); | ||
const router = useRouter(); | ||
</script> | ||
|
||
<template> | ||
<div | ||
:class=" | ||
twMerge( | ||
'relative rounded-lg', | ||
'flex flex-col', | ||
'ring-2 ring-zinc-200 dark:ring-zinc-700', | ||
'bg-zinc-100 dark:bg-zinc-800', | ||
propClass | ||
) | ||
" | ||
> | ||
<div class="sticky top-0 left-0 right-0 p-5 flex gap-1 bg-zinc-800"> | ||
<Button | ||
:label="!publishing ? '公開' : '処理中'" | ||
:icon=" | ||
!publishing ? 'lucide:upload' : 'i-svg-spinners-ring-resize' | ||
" | ||
:icon-size="18" | ||
variant="flat" | ||
class="grow rounded-full px-4 whitespace-nowrap hover:bg-zinc-700 hover:text-zinc-200 dark:text-zinc-900 dark:bg-zinc-300 hover:dark:text-zinc-100" | ||
@click="emit('publish')" | ||
> | ||
</Button> | ||
|
||
<Button | ||
tooltip="破棄" | ||
icon="lucide:trash" | ||
:icon-size="18" | ||
variant="flat" | ||
class="rounded-full" | ||
@click="router.back()" | ||
/> | ||
</div> | ||
|
||
<div class="p-5 pt-2 flex flex-col gap-8"> | ||
<div class="w-full flex flex-col items-start gap-3"> | ||
<div class="w-full flex gap-2 items-center justify-between"> | ||
<UiTitle label="タイトル" icon="lucide:text" /> | ||
<UiCount | ||
v-if="title.length" | ||
:count="title.length" | ||
:max="setupLimits().title" | ||
/> | ||
</div> | ||
<UiTextarea | ||
v-model="title" | ||
placeholder="セットアップ名" | ||
class="w-full" | ||
/> | ||
</div> | ||
|
||
<div class="w-full flex flex-col items-start gap-3"> | ||
<div class="w-full flex gap-2 items-center justify-between"> | ||
<UiTitle label="画像" icon="lucide:image" /> | ||
<PopupUploadImage> | ||
<button | ||
type="button" | ||
class="cursor-pointer flex items-center gap-1" | ||
> | ||
<Icon | ||
name="lucide:info" | ||
class="text-indigo-400 dark:text-indigo-300" | ||
/> | ||
<span | ||
class="text-xs font-medium text-zinc-600 dark:text-zinc-300" | ||
> | ||
画像の添付について | ||
</span> | ||
</button> | ||
</PopupUploadImage> | ||
</div> | ||
<EditImage ref="editImage" v-model="image" /> | ||
</div> | ||
|
||
<div class="w-full flex flex-col items-start gap-3"> | ||
<div class="w-full flex gap-2 items-center justify-between"> | ||
<UiTitle label="説明" icon="lucide:text" /> | ||
<UiCount | ||
v-if="description.length" | ||
:count="description.length" | ||
:max="setupLimits().description" | ||
/> | ||
</div> | ||
<UiTextarea | ||
v-model="description" | ||
placeholder="説明" | ||
class="w-full" | ||
/> | ||
</div> | ||
|
||
<div class="w-full flex flex-col items-start gap-3"> | ||
<div class="w-full flex gap-2 items-center justify-between"> | ||
<UiTitle label="タグ" icon="lucide:tags" /> | ||
<UiCount | ||
v-if="tags.length" | ||
:count="tags.length" | ||
:max="setupLimits().tags" | ||
/> | ||
</div> | ||
<EditTags v-model="tags" /> | ||
</div> | ||
|
||
<div class="w-full flex flex-col items-start gap-3"> | ||
<div class="w-full flex gap-2 items-center justify-between"> | ||
<UiTitle label="共同作者" icon="lucide:users-round" /> | ||
<UiCount | ||
v-if="coAuthors.length" | ||
:count="coAuthors.length" | ||
:max="setupLimits().coAuthors" | ||
/> | ||
</div> | ||
<EditCoAuthor v-model="coAuthors" /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.