fix type
This commit is contained in:
parent
990be44d98
commit
4dcff123df
|
|
@ -174,6 +174,7 @@ export const packedPageSchema = {
|
||||||
font: {
|
font: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
|
enum: ['serif', 'sans-serif'],
|
||||||
},
|
},
|
||||||
script: {
|
script: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, provide, watch, ref } from 'vue';
|
import { computed, provide, watch, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { genId } from '@/utility/id.js';
|
|
||||||
import { url } from '@@/js/config.js';
|
import { url } from '@@/js/config.js';
|
||||||
import XBlocks from './page-editor.blocks.vue';
|
import XBlocks from './page-editor.blocks.vue';
|
||||||
|
import { genId } from '@/utility/id.js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkSelect from '@/components/MkSelect.vue';
|
import MkSelect from '@/components/MkSelect.vue';
|
||||||
import MkSwitch from '@/components/MkSwitch.vue';
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
|
|
@ -216,7 +216,37 @@ async function add() {
|
||||||
if (canceled || type == null) return;
|
if (canceled || type == null) return;
|
||||||
|
|
||||||
const id = genId();
|
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) {
|
function setEyeCatchingImage(img: Event) {
|
||||||
|
|
|
||||||
|
|
@ -4900,7 +4900,8 @@ export type components = {
|
||||||
summary: string | null;
|
summary: string | null;
|
||||||
hideTitleWhenPinned: boolean;
|
hideTitleWhenPinned: boolean;
|
||||||
alignCenter: boolean;
|
alignCenter: boolean;
|
||||||
font: string;
|
/** @enum {string} */
|
||||||
|
font: 'serif' | 'sans-serif';
|
||||||
script: string;
|
script: string;
|
||||||
eyeCatchingImageId: string | null;
|
eyeCatchingImageId: string | null;
|
||||||
eyeCatchingImage: components['schemas']['DriveFile'] | null;
|
eyeCatchingImage: components['schemas']['DriveFile'] | null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue