feat: localizable dialog title for enter section title (#14401)

* feat: localizable dialog title for enter section title

* refactor: define `getPageBlockList` in separated file and import instead of provide/inject
This commit is contained in:
anatawa12
2024-08-16 21:47:44 +09:00
committed by GitHub
parent 6db3c50e32
commit 748a7e8f6a
5 changed files with 23 additions and 13 deletions

View File

@@ -77,6 +77,7 @@ import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { $i } from '@/account.js';
import { mainRouter } from '@/router/main.js';
import { getPageBlockList } from '@/pages/page-editor/common.js';
const props = defineProps<{
initPageId?: string;
@@ -101,7 +102,6 @@ const alignCenter = ref(false);
const hideTitleWhenPinned = ref(false);
provide('readonly', readonly.value);
provide('getPageBlockList', getPageBlockList);
watch(eyeCatchingImageId, async () => {
if (eyeCatchingImageId.value == null) {
@@ -216,15 +216,6 @@ async function add() {
content.value.push({ id, type });
}
function getPageBlockList() {
return [
{ value: 'section', text: i18n.ts._pages.blocks.section },
{ value: 'text', text: i18n.ts._pages.blocks.text },
{ value: 'image', text: i18n.ts._pages.blocks.image },
{ value: 'note', text: i18n.ts._pages.blocks.note },
];
}
function setEyeCatchingImage(img) {
selectFile(img.currentTarget ?? img.target, null).then(file => {
eyeCatchingImageId.value = file.id;