feat(frontend): 画像を投稿前にプレビュー可能に (#15341)
* feat(client): 画像をプレビュー可能に * Update Changelog * SPDX * 消えてたのFix * Add storybook for MkImgPreviewDialog * backgroundのスタイル変更 Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> * Add MkImgPreviewDialog to storybook generator * Update packages/frontend/.storybook/generate.tsx --------- Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
@@ -22,20 +22,24 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</div>
|
||||
</template>
|
||||
</Sortable>
|
||||
<p :class="[$style.remain, {
|
||||
[$style.exceeded]: props.modelValue.length > 16,
|
||||
}]">{{ 16 - props.modelValue.length }}/16</p>
|
||||
<p
|
||||
:class="[$style.remain, {
|
||||
[$style.exceeded]: props.modelValue.length > 16,
|
||||
}]"
|
||||
>
|
||||
{{ 16 - props.modelValue.length }}/16
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent, inject } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import type { MenuItem } from '@/types/menu';
|
||||
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import type { MenuItem } from '@/types/menu.js';
|
||||
|
||||
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
|
||||
|
||||
@@ -168,6 +172,14 @@ function showFileMenu(file: Misskey.entities.DriveFile, ev: MouseEvent | Keyboar
|
||||
text: i18n.ts.cropImage,
|
||||
icon: 'ti ti-crop',
|
||||
action: () : void => { crop(file); },
|
||||
}, {
|
||||
text: i18n.ts.preview,
|
||||
icon: 'ti ti-photo-search',
|
||||
action: () => {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkImgPreviewDialog.vue')), {
|
||||
file: file,
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user