diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-11-07 12:53:28 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-11-07 12:53:28 +0900 |
| commit | 4dcff123dffb5cbae81b5daec51706b93d4a9957 (patch) | |
| tree | edd2faaaa0fe8e600fd87c4c53a60f3857293c7e /packages | |
| parent | fix type (diff) | |
| download | misskey-4dcff123dffb5cbae81b5daec51706b93d4a9957.tar.gz misskey-4dcff123dffb5cbae81b5daec51706b93d4a9957.tar.bz2 misskey-4dcff123dffb5cbae81b5daec51706b93d4a9957.zip | |
fix type
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/backend/src/models/json-schema/page.ts | 1 | ||||
| -rw-r--r-- | packages/frontend/src/pages/page-editor/page-editor.vue | 34 | ||||
| -rw-r--r-- | packages/misskey-js/src/autogen/types.ts | 3 |
3 files changed, 35 insertions, 3 deletions
diff --git a/packages/backend/src/models/json-schema/page.ts b/packages/backend/src/models/json-schema/page.ts index 748d6f1245..8f6d5c675d 100644 --- a/packages/backend/src/models/json-schema/page.ts +++ b/packages/backend/src/models/json-schema/page.ts @@ -174,6 +174,7 @@ export const packedPageSchema = { font: { type: 'string', optional: false, nullable: false, + enum: ['serif', 'sans-serif'], }, script: { type: 'string', diff --git a/packages/frontend/src/pages/page-editor/page-editor.vue b/packages/frontend/src/pages/page-editor/page-editor.vue index 3dd83b25c5..c446386a1c 100644 --- a/packages/frontend/src/pages/page-editor/page-editor.vue +++ b/packages/frontend/src/pages/page-editor/page-editor.vue @@ -60,9 +60,9 @@ SPDX-License-Identifier: AGPL-3.0-only <script lang="ts" setup> import { computed, provide, watch, ref } from 'vue'; import * as Misskey from 'misskey-js'; -import { genId } from '@/utility/id.js'; import { url } from '@@/js/config.js'; import XBlocks from './page-editor.blocks.vue'; +import { genId } from '@/utility/id.js'; import MkButton from '@/components/MkButton.vue'; import MkSelect from '@/components/MkSelect.vue'; import MkSwitch from '@/components/MkSwitch.vue'; @@ -216,7 +216,37 @@ async function add() { if (canceled || type == null) return; const id = genId(); - content.value.push({ id, type }); + if (type === 'text') { + content.value.push({ + id, + type, + text: '', + }); + return; + } else if (type === 'section') { + content.value.push({ + id, + type, + title: '', + children: [], + }); + return; + } else if (type === 'image') { + content.value.push({ + id, + type, + fileId: null, + }); + return; + } else if (type === 'note') { + content.value.push({ + id, + type, + detailed: false, + note: null, + }); + return; + } } function setEyeCatchingImage(img: Event) { diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 4867854b20..f67ad76fc9 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -4900,7 +4900,8 @@ export type components = { summary: string | null; hideTitleWhenPinned: boolean; alignCenter: boolean; - font: string; + /** @enum {string} */ + font: 'serif' | 'sans-serif'; script: string; eyeCatchingImageId: string | null; eyeCatchingImage: components['schemas']['DriveFile'] | null; |