uncial 0.0.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -15
- package/dist/core/attributes.d.ts +21 -3
- package/dist/core/attributes.js +86 -15
- package/dist/core/defineBlock.js +26 -12
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.js +2 -1
- package/dist/core/issues.d.ts +7 -0
- package/dist/core/issues.js +9 -0
- package/dist/core/meta.js +2 -7
- package/dist/core/migrations.d.ts +30 -0
- package/dist/core/migrations.js +50 -0
- package/dist/core/normalize.d.ts +12 -1
- package/dist/core/normalize.js +123 -22
- package/dist/core/registry.d.ts +7 -0
- package/dist/core/registry.js +35 -4
- package/dist/core/runtime.d.ts +7 -0
- package/dist/core/types.d.ts +31 -3
- package/dist/core/validate.js +27 -7
- package/dist/editor/AttributeFieldControl.svelte +155 -7
- package/dist/editor/AttributeFieldControl.svelte.d.ts +1 -0
- package/dist/editor/BlockAttributesPanel.svelte +76 -44
- package/dist/editor/BlockAttributesPanel.svelte.d.ts +9 -1
- package/dist/editor/Editor.svelte +149 -27
- package/dist/editor/Editor.svelte.d.ts +37 -0
- package/dist/editor/RichTextAttributeEditor.svelte +75 -145
- package/dist/editor/RichTextAttributeEditor.svelte.d.ts +2 -1
- package/dist/editor/Toolbar.svelte +2 -3
- package/dist/editor/attributeTargets.d.ts +23 -0
- package/dist/editor/attributeTargets.js +21 -0
- package/dist/editor/attributesController.d.ts +12 -0
- package/dist/editor/attributesController.js +142 -230
- package/dist/editor/bindEditor.d.ts +7 -0
- package/dist/editor/bindEditor.js +141 -27
- package/dist/editor/chooseAttribute.d.ts +26 -0
- package/dist/editor/chooseAttribute.js +10 -0
- package/dist/editor/containerChildOps.d.ts +33 -0
- package/dist/editor/containerChildOps.js +115 -0
- package/dist/editor/dropdownDismiss.d.ts +18 -0
- package/dist/editor/dropdownDismiss.js +46 -0
- package/dist/editor/dropdownFloat.d.ts +16 -0
- package/dist/editor/dropdownFloat.js +127 -0
- package/dist/editor/index.d.ts +3 -1
- package/dist/editor/index.js +2 -1
- package/dist/editor/linkController.d.ts +19 -0
- package/dist/editor/linkController.js +72 -0
- package/dist/editor/toolbarFeatures.d.ts +12 -0
- package/dist/editor/toolbarFeatures.js +36 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/render/Renderer.svelte +1 -1
- package/dist/render/RichContent.svelte +12 -4
- package/dist/render/RichContent.svelte.d.ts +2 -0
- package/dist/render/RichNode.svelte +80 -10
- package/dist/render/RichNode.svelte.d.ts +2 -0
- package/dist/render/Tab.svelte +27 -0
- package/dist/render/Tab.svelte.d.ts +10 -0
- package/dist/render/Tabs.svelte +57 -0
- package/dist/render/Tabs.svelte.d.ts +10 -0
- package/dist/render/index.d.ts +3 -0
- package/dist/render/index.js +6 -0
- package/dist/render/sanitize.d.ts +6 -0
- package/dist/render/sanitize.js +20 -1
- package/dist/render/tabSelection.svelte.d.ts +8 -0
- package/dist/render/tabSelection.svelte.js +40 -0
- package/dist/runtime/reactiveProps.svelte.d.ts +16 -0
- package/dist/runtime/reactiveProps.svelte.js +16 -0
- package/dist/runtime/svelte.d.ts +2 -1
- package/dist/runtime/svelte.js +26 -6
- package/dist/shared/EditorBlockFixture.svelte +24 -0
- package/dist/shared/EditorBlockFixture.svelte.d.ts +9 -0
- package/dist/shared/content.js +2 -1
- package/dist/shared/documentIdentity.d.ts +6 -0
- package/dist/shared/documentIdentity.js +64 -0
- package/dist/shared/guards.d.ts +13 -0
- package/dist/shared/guards.js +16 -0
- package/dist/shared/richText.js +20 -4
- package/dist/shared/runtimeId.d.ts +8 -0
- package/dist/shared/runtimeId.js +8 -0
- package/dist/shared/syntaxHighlight.d.ts +14 -0
- package/dist/shared/syntaxHighlight.js +36 -3
- package/dist/shared/tiptap.js +140 -27
- package/dist/styles/base.css +177 -0
- package/dist/styles/prose.css +26 -0
- package/dist/styles/tokens.css +53 -69
- package/dist/tabs.d.ts +6 -0
- package/dist/tabs.js +36 -0
- package/dist/web-components/UncialEditor.svelte +23 -7
- package/dist/web-components/UncialEditor.svelte.d.ts +7 -2
- package/dist/web-components/index.d.ts +45 -10
- package/dist/web-components/index.js +98 -36
- package/dist/web-components/reactiveProps.svelte.d.ts +10 -0
- package/dist/web-components/reactiveProps.svelte.js +13 -0
- package/package.json +134 -133
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Editor } from '@tiptap/core';
|
|
3
|
+
import type { Component } from 'svelte';
|
|
4
|
+
import { createSubscriber } from 'svelte/reactivity';
|
|
3
5
|
import CodeIcon from 'phosphor-svelte/lib/CodeIcon';
|
|
4
6
|
import CodeBlockIcon from 'phosphor-svelte/lib/CodeBlockIcon';
|
|
5
7
|
import ListBulletsIcon from 'phosphor-svelte/lib/ListBulletsIcon';
|
|
@@ -14,7 +16,8 @@
|
|
|
14
16
|
import type { PMDoc } from '../shared/document.js';
|
|
15
17
|
import { coerceRichTextDocument, resolveRichTextFeatures } from '../shared/richText.js';
|
|
16
18
|
import { createRichTextExtensions } from '../shared/tiptap.js';
|
|
17
|
-
import type { RichTextFeatureSelection } from '../core/types.js';
|
|
19
|
+
import type { RichTextFeature, RichTextFeatureSelection } from '../core/types.js';
|
|
20
|
+
import { richTextAttributeToolbarFeatures, type ToolbarFeature } from './toolbarFeatures.js';
|
|
18
21
|
|
|
19
22
|
interface Props {
|
|
20
23
|
value?: unknown;
|
|
@@ -35,17 +38,43 @@
|
|
|
35
38
|
let lastJson = '';
|
|
36
39
|
|
|
37
40
|
const resolvedFeatures = $derived(resolveRichTextFeatures(features));
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
const visibleFeatures = $derived(
|
|
42
|
+
richTextAttributeToolbarFeatures.filter((feature) =>
|
|
43
|
+
resolvedFeatures.has(feature.id as RichTextFeature)
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const getEditorStateVersion = $derived.by(() => {
|
|
48
|
+
if (!editor) return () => 0;
|
|
49
|
+
const activeEditor = editor;
|
|
50
|
+
|
|
51
|
+
let version = 0;
|
|
52
|
+
const subscribe = createSubscriber((update) => {
|
|
53
|
+
const refreshToolbarState = () => {
|
|
54
|
+
version += 1;
|
|
55
|
+
update();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
activeEditor.on('transaction', refreshToolbarState);
|
|
59
|
+
activeEditor.on('selectionUpdate', refreshToolbarState);
|
|
60
|
+
activeEditor.on('update', refreshToolbarState);
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
activeEditor.off('transaction', refreshToolbarState);
|
|
64
|
+
activeEditor.off('selectionUpdate', refreshToolbarState);
|
|
65
|
+
activeEditor.off('update', refreshToolbarState);
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return () => {
|
|
70
|
+
subscribe();
|
|
71
|
+
return version;
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
const toolbarContext = $derived.by(() => {
|
|
75
|
+
getEditorStateVersion();
|
|
76
|
+
return editor ? { editor } : null;
|
|
77
|
+
});
|
|
49
78
|
|
|
50
79
|
function emitChange(nextEditor: Editor): void {
|
|
51
80
|
const json = nextEditor.getJSON() as PMDoc;
|
|
@@ -53,8 +82,26 @@
|
|
|
53
82
|
onChange(json);
|
|
54
83
|
}
|
|
55
84
|
|
|
56
|
-
function
|
|
57
|
-
|
|
85
|
+
function runFeature(feature: ToolbarFeature): void {
|
|
86
|
+
if (!editor) return;
|
|
87
|
+
feature.run({ editor });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function iconFor(featureId: string): Component<Record<string, unknown>> | null {
|
|
91
|
+
return (
|
|
92
|
+
{
|
|
93
|
+
bold: TextBIcon,
|
|
94
|
+
italic: TextItalicIcon,
|
|
95
|
+
strike: TextStrikethroughIcon,
|
|
96
|
+
code: CodeIcon,
|
|
97
|
+
heading: TextHThreeIcon,
|
|
98
|
+
bulletList: ListBulletsIcon,
|
|
99
|
+
orderedList: ListNumbersIcon,
|
|
100
|
+
blockquote: QuotesIcon,
|
|
101
|
+
codeBlock: CodeBlockIcon,
|
|
102
|
+
horizontalRule: MinusIcon
|
|
103
|
+
}[featureId] ?? null
|
|
104
|
+
);
|
|
58
105
|
}
|
|
59
106
|
|
|
60
107
|
const iconSize = 14;
|
|
@@ -99,144 +146,27 @@
|
|
|
99
146
|
|
|
100
147
|
<div class="uncial-richtext-wrapper">
|
|
101
148
|
<div class="uncial-richtext-toolbar">
|
|
102
|
-
{#
|
|
149
|
+
{#each visibleFeatures as feature (feature.id)}
|
|
150
|
+
{@const context = toolbarContext}
|
|
151
|
+
{@const Icon = iconFor(feature.id)}
|
|
152
|
+
{@const active = context ? (feature.isActive?.(context) ?? false) : false}
|
|
103
153
|
<button
|
|
104
154
|
type="button"
|
|
105
155
|
class={[
|
|
106
156
|
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
107
|
-
|
|
157
|
+
active ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
108
158
|
]}
|
|
109
|
-
aria-label=
|
|
110
|
-
data-tip=
|
|
111
|
-
onclick={() =>
|
|
112
|
-
>
|
|
113
|
-
<TextBIcon size={iconSize} weight="bold" />
|
|
114
|
-
</button>
|
|
115
|
-
{/if}
|
|
116
|
-
{#if canItalic}
|
|
117
|
-
<button
|
|
118
|
-
type="button"
|
|
119
|
-
class={[
|
|
120
|
-
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
121
|
-
activeEditor?.isActive('italic') ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
122
|
-
]}
|
|
123
|
-
aria-label="Italic"
|
|
124
|
-
data-tip="Italic"
|
|
125
|
-
onclick={() => runCommand(() => editor?.chain().focus().toggleItalic().run() ?? false)}
|
|
126
|
-
>
|
|
127
|
-
<TextItalicIcon size={iconSize} weight="bold" />
|
|
128
|
-
</button>
|
|
129
|
-
{/if}
|
|
130
|
-
{#if canStrike}
|
|
131
|
-
<button
|
|
132
|
-
type="button"
|
|
133
|
-
class={[
|
|
134
|
-
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
135
|
-
activeEditor?.isActive('strike') ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
136
|
-
]}
|
|
137
|
-
aria-label="Strikethrough"
|
|
138
|
-
data-tip="Strikethrough"
|
|
139
|
-
onclick={() => runCommand(() => editor?.chain().focus().toggleStrike().run() ?? false)}
|
|
140
|
-
>
|
|
141
|
-
<TextStrikethroughIcon size={iconSize} weight="bold" />
|
|
142
|
-
</button>
|
|
143
|
-
{/if}
|
|
144
|
-
{#if canCode}
|
|
145
|
-
<button
|
|
146
|
-
type="button"
|
|
147
|
-
class={[
|
|
148
|
-
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
149
|
-
activeEditor?.isActive('code') ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
150
|
-
]}
|
|
151
|
-
aria-label="Inline code"
|
|
152
|
-
data-tip="Inline code"
|
|
153
|
-
onclick={() => runCommand(() => editor?.chain().focus().toggleCode().run() ?? false)}
|
|
154
|
-
>
|
|
155
|
-
<CodeIcon size={iconSize} weight="bold" />
|
|
156
|
-
</button>
|
|
157
|
-
{/if}
|
|
158
|
-
{#if canHeading}
|
|
159
|
-
<button
|
|
160
|
-
type="button"
|
|
161
|
-
class={[
|
|
162
|
-
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
163
|
-
activeEditor?.isActive('heading') ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
164
|
-
]}
|
|
165
|
-
aria-label="Heading"
|
|
166
|
-
data-tip="Heading"
|
|
167
|
-
onclick={() =>
|
|
168
|
-
runCommand(() => editor?.chain().focus().toggleHeading({ level: 3 }).run() ?? false)}
|
|
169
|
-
>
|
|
170
|
-
<TextHThreeIcon size={iconSize} weight="bold" />
|
|
171
|
-
</button>
|
|
172
|
-
{/if}
|
|
173
|
-
{#if canBulletList}
|
|
174
|
-
<button
|
|
175
|
-
type="button"
|
|
176
|
-
class={[
|
|
177
|
-
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
178
|
-
activeEditor?.isActive('bulletList') ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
179
|
-
]}
|
|
180
|
-
aria-label="Bullet list"
|
|
181
|
-
data-tip="Bullet list"
|
|
182
|
-
onclick={() => runCommand(() => editor?.chain().focus().toggleBulletList().run() ?? false)}
|
|
183
|
-
>
|
|
184
|
-
<ListBulletsIcon size={iconSize} weight="bold" />
|
|
185
|
-
</button>
|
|
186
|
-
{/if}
|
|
187
|
-
{#if canOrderedList}
|
|
188
|
-
<button
|
|
189
|
-
type="button"
|
|
190
|
-
class={[
|
|
191
|
-
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
192
|
-
activeEditor?.isActive('orderedList') ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
193
|
-
]}
|
|
194
|
-
aria-label="Ordered list"
|
|
195
|
-
data-tip="Ordered list"
|
|
196
|
-
onclick={() => runCommand(() => editor?.chain().focus().toggleOrderedList().run() ?? false)}
|
|
197
|
-
>
|
|
198
|
-
<ListNumbersIcon size={iconSize} weight="bold" />
|
|
199
|
-
</button>
|
|
200
|
-
{/if}
|
|
201
|
-
{#if canBlockquote}
|
|
202
|
-
<button
|
|
203
|
-
type="button"
|
|
204
|
-
class={[
|
|
205
|
-
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
206
|
-
activeEditor?.isActive('blockquote') ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
207
|
-
]}
|
|
208
|
-
aria-label="Blockquote"
|
|
209
|
-
data-tip="Blockquote"
|
|
210
|
-
onclick={() => runCommand(() => editor?.chain().focus().toggleBlockquote().run() ?? false)}
|
|
211
|
-
>
|
|
212
|
-
<QuotesIcon size={iconSize} weight="bold" />
|
|
213
|
-
</button>
|
|
214
|
-
{/if}
|
|
215
|
-
{#if canCodeBlock}
|
|
216
|
-
<button
|
|
217
|
-
type="button"
|
|
218
|
-
class={[
|
|
219
|
-
'uncial-btn uncial-btn--square uncial-btn--xs uncial-tooltip',
|
|
220
|
-
activeEditor?.isActive('codeBlock') ? 'uncial-btn--active' : 'uncial-btn--ghost'
|
|
221
|
-
]}
|
|
222
|
-
aria-label="Code block"
|
|
223
|
-
data-tip="Code block"
|
|
224
|
-
onclick={() => runCommand(() => editor?.chain().focus().toggleCodeBlock().run() ?? false)}
|
|
225
|
-
>
|
|
226
|
-
<CodeBlockIcon size={iconSize} weight="bold" />
|
|
227
|
-
</button>
|
|
228
|
-
{/if}
|
|
229
|
-
{#if canHorizontalRule}
|
|
230
|
-
<button
|
|
231
|
-
type="button"
|
|
232
|
-
class="uncial-btn uncial-btn--ghost uncial-btn--square uncial-btn--xs uncial-tooltip"
|
|
233
|
-
aria-label="Horizontal rule"
|
|
234
|
-
data-tip="Horizontal rule"
|
|
235
|
-
onclick={() => runCommand(() => editor?.chain().focus().setHorizontalRule().run() ?? false)}
|
|
159
|
+
aria-label={feature.label}
|
|
160
|
+
data-tip={feature.tooltip ?? feature.label}
|
|
161
|
+
onclick={() => runFeature(feature)}
|
|
236
162
|
>
|
|
237
|
-
|
|
163
|
+
{#if Icon}
|
|
164
|
+
<Icon size={iconSize} weight="bold" />
|
|
165
|
+
{:else}
|
|
166
|
+
{feature.label}
|
|
167
|
+
{/if}
|
|
238
168
|
</button>
|
|
239
|
-
{/
|
|
169
|
+
{/each}
|
|
240
170
|
</div>
|
|
241
171
|
<div bind:this={element}></div>
|
|
242
172
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
1
2
|
import type { PMDoc } from '../shared/document.js';
|
|
2
3
|
import type { RichTextFeatureSelection } from '../core/types.js';
|
|
3
4
|
interface Props {
|
|
@@ -6,6 +7,6 @@ interface Props {
|
|
|
6
7
|
placeholder?: string;
|
|
7
8
|
onChange: (value: PMDoc) => void;
|
|
8
9
|
}
|
|
9
|
-
declare const RichTextAttributeEditor:
|
|
10
|
+
declare const RichTextAttributeEditor: Component<Props, {}, "">;
|
|
10
11
|
type RichTextAttributeEditor = ReturnType<typeof RichTextAttributeEditor>;
|
|
11
12
|
export default RichTextAttributeEditor;
|
|
@@ -90,9 +90,8 @@
|
|
|
90
90
|
|
|
91
91
|
function runFeature(feature: ToolbarFeature): void {
|
|
92
92
|
if (feature.id === 'link' && onEditLink) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
93
|
+
// Only open the link panel; the link mark is applied when the panel
|
|
94
|
+
// commits, so cancelling never leaves a dangling placeholder link.
|
|
96
95
|
onEditLink();
|
|
97
96
|
return;
|
|
98
97
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BlockRegistry } from '../core/types.js';
|
|
2
|
+
import type { AttributeDefinition } from '../core/attributes.js';
|
|
3
|
+
/** A block type's attribute metadata; `content` (when present) marks a container. */
|
|
4
|
+
export type AttributeTarget = AttributeDefinition & {
|
|
5
|
+
content?: unknown;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Resolves attribute metadata for a block type, treating the built-in code block
|
|
9
|
+
* as a *virtual* registry entry. The code block carries editable attributes
|
|
10
|
+
* (its language) but is deliberately NOT part of `registry.blocks`, so it never
|
|
11
|
+
* leaks into block-insertion menus. Routing every `has`/`get`/`defaultAttrs`
|
|
12
|
+
* lookup through here keeps the `codeBlock` special case in one place instead of
|
|
13
|
+
* scattering `if (id === CODE_BLOCK_ID)` branches across the controller.
|
|
14
|
+
*/
|
|
15
|
+
export interface AttributeTargets {
|
|
16
|
+
/** True for any type that carries editable attributes (a registry block or the code block). */
|
|
17
|
+
has(typeName: string): boolean;
|
|
18
|
+
/** The attribute definition for a type, or null if it has none. */
|
|
19
|
+
get(id: string): AttributeTarget | null;
|
|
20
|
+
/** Default attribute values used to seed an insert-mode draft for a type. */
|
|
21
|
+
defaultAttrs(id: string): Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export declare function createAttributeTargets(registry: BlockRegistry | null): AttributeTargets;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getBlockDefaultAttrs } from '../shared/tiptap.js';
|
|
2
|
+
import { CODE_BLOCK_ID, codeBlockAttributeTarget } from '../shared/codeBlockAttributes.js';
|
|
3
|
+
export function createAttributeTargets(registry) {
|
|
4
|
+
return {
|
|
5
|
+
has(typeName) {
|
|
6
|
+
return typeName === CODE_BLOCK_ID || Boolean(registry?.has(typeName));
|
|
7
|
+
},
|
|
8
|
+
get(id) {
|
|
9
|
+
if (id === CODE_BLOCK_ID)
|
|
10
|
+
return codeBlockAttributeTarget;
|
|
11
|
+
return registry?.get(id) ?? null;
|
|
12
|
+
},
|
|
13
|
+
defaultAttrs(id) {
|
|
14
|
+
// The code block's language defaults are seeded from an empty draft.
|
|
15
|
+
if (id === CODE_BLOCK_ID)
|
|
16
|
+
return {};
|
|
17
|
+
const block = registry?.get(id);
|
|
18
|
+
return block ? getBlockDefaultAttrs(block) : {};
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -24,6 +24,11 @@ export interface ContainerChildInfo {
|
|
|
24
24
|
blockId: string;
|
|
25
25
|
label: string;
|
|
26
26
|
summary: string;
|
|
27
|
+
/**
|
|
28
|
+
* Absolute document position of the child node, so the panel can select it
|
|
29
|
+
* with `openAttributesAt` without re-walking the document.
|
|
30
|
+
*/
|
|
31
|
+
pos: number;
|
|
27
32
|
}
|
|
28
33
|
export interface BlockAttributesState {
|
|
29
34
|
open: boolean;
|
|
@@ -61,4 +66,11 @@ export interface BlockAttributesController extends Readable<BlockAttributesState
|
|
|
61
66
|
removeActiveBlock(): boolean;
|
|
62
67
|
removeContainerChild(index: number): boolean;
|
|
63
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* The single source of truth for a fresh controller state snapshot. Every
|
|
71
|
+
* consumer that needs an initial `BlockAttributesState` (the controller store,
|
|
72
|
+
* `bindEditor`, and the Svelte panels) imports this factory rather than
|
|
73
|
+
* duplicating the literal, so the shape can never drift between them.
|
|
74
|
+
*/
|
|
75
|
+
export declare function createInitialState(): BlockAttributesState;
|
|
64
76
|
export declare function createBlockAttributesController(): BlockAttributesController;
|