You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.0 KiB
28 lines
1.0 KiB
<script lang="ts">
|
|
import { setContext } from 'svelte'
|
|
import { createCatalogEditorStore } from '@/vcen-edit/stores/catalog-editor.svelte.js'
|
|
import type { CatalogEditorStore } from '@/vcen-edit/stores/catalog-editor.svelte.js'
|
|
import type { Cat } from '@/vcen/lib'
|
|
import { createEditorGlob } from '@/vcen-edit/lib/editor-glob.svelte.ts'
|
|
import type { EditorGlob } from '@/vcen-edit/lib/editor-glob.svelte.ts'
|
|
import { logr } from '@/vcen-edit/lib/logr.ts'
|
|
import CatalogLayout from '../layouts/CatalogLayout.svelte'
|
|
|
|
let { cat, onsave, oncancel }: {
|
|
cat: Cat
|
|
onsave?: (cat: Cat) => void
|
|
oncancel?: () => void
|
|
} = $props()
|
|
|
|
const editor = createCatalogEditorStore(cat)
|
|
setContext<CatalogEditorStore>('catalog-editor', editor)
|
|
|
|
const glob = createEditorGlob(cat.langs)
|
|
setContext<EditorGlob>('editor-glob', glob)
|
|
|
|
logr.debug('CatalogEditor', { es: 'Editor inicializado' }, { catId: cat.id, name: cat.name })
|
|
</script>
|
|
|
|
<CatalogLayout {onsave} {oncancel} />
|
|
|