@perkyzz/emvb 0.6.0 → 0.8.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 +2 -2
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/package.json +7 -7
- package/src/admin/access/RequireEditor.tsx +7 -7
- package/src/admin/access/role.ts +5 -2
- package/src/admin/content-api.ts +10 -3
- package/src/admin/content-item.ts +1 -1
- package/src/admin/editor/A11yCopilot.tsx +104 -56
- package/src/admin/editor/CommandPalette.tsx +29 -13
- package/src/admin/editor/DialogCloseButton.tsx +16 -0
- package/src/admin/editor/Editor.tsx +115 -20
- package/src/admin/editor/EditorToasts.tsx +26 -0
- package/src/admin/editor/PerfMeter.tsx +92 -73
- package/src/admin/editor/SavedSectionDialogs.tsx +169 -0
- package/src/admin/editor/ShareLink.tsx +102 -72
- package/src/admin/editor/ShortcutsDialog.tsx +37 -18
- package/src/admin/editor/Timeline.tsx +250 -160
- package/src/admin/editor/TopBar.tsx +71 -14
- package/src/admin/editor/canvas/CanvasFrame.tsx +10 -1
- package/src/admin/editor/canvas/CanvasTextEdit.tsx +8 -2
- package/src/admin/editor/canvas/drop-line.ts +11 -3
- package/src/admin/editor/canvas/frame-focus-ring.ts +37 -0
- package/src/admin/editor/canvas/use-canvas-dnd.ts +32 -3
- package/src/admin/editor/canvas/vnode-react.tsx +7 -0
- package/src/admin/editor/collection-previews.ts +10 -0
- package/src/admin/editor/dialogs.tsx +41 -28
- package/src/admin/editor/dnd/drop-target.ts +26 -1
- package/src/admin/editor/edited-noun.ts +15 -0
- package/src/admin/editor/editor-chrome.tsx +43 -7
- package/src/admin/editor/editor-commands.ts +17 -2
- package/src/admin/editor/editor-css.ts +75 -24
- package/src/admin/editor/element-chrome.ts +21 -11
- package/src/admin/editor/feature-css.ts +56 -14
- package/src/admin/editor/focus-when-lost.ts +23 -0
- package/src/admin/editor/icons/IconLibraryDialog.tsx +54 -18
- package/src/admin/editor/icons/library.ts +1 -1
- package/src/admin/editor/icons/use-icon-library.ts +5 -2
- package/src/admin/editor/ime.ts +29 -0
- package/src/admin/editor/palette-items.ts +27 -3
- package/src/admin/editor/panels/AddPanel.tsx +44 -11
- package/src/admin/editor/panels/ClassesSection.tsx +18 -7
- package/src/admin/editor/panels/ColorControl.tsx +130 -23
- package/src/admin/editor/panels/ConditionsEditor.tsx +52 -26
- package/src/admin/editor/panels/ElementPanel.tsx +134 -24
- package/src/admin/editor/panels/LayersPanel.tsx +61 -20
- package/src/admin/editor/panels/LeftPanel.tsx +9 -1
- package/src/admin/editor/panels/PageSettings.tsx +66 -35
- package/src/admin/editor/panels/SavedSectionsGroup.tsx +246 -0
- package/src/admin/editor/panels/SiteStylesDrawer.tsx +224 -42
- package/src/admin/editor/panels/TokenScales.tsx +88 -48
- package/src/admin/editor/panels/TriggerSettings.tsx +50 -12
- package/src/admin/editor/panels/TriggersEditor.tsx +3 -2
- package/src/admin/editor/panels/VariableSection.tsx +48 -18
- package/src/admin/editor/panels/color-space.ts +23 -29
- package/src/admin/editor/panels/settings/AdvancedFields.tsx +12 -2
- package/src/admin/editor/panels/settings/AudienceEditor.tsx +87 -74
- package/src/admin/editor/panels/settings/BackgroundControls.tsx +55 -11
- package/src/admin/editor/panels/settings/BackgroundFill.tsx +3 -2
- package/src/admin/editor/panels/settings/BindingsEditor.tsx +15 -18
- package/src/admin/editor/panels/settings/BoxControl.tsx +2 -1
- package/src/admin/editor/panels/settings/ClassChip.tsx +21 -9
- package/src/admin/editor/panels/settings/ClassChipInput.tsx +24 -16
- package/src/admin/editor/panels/settings/DraftTextField.tsx +41 -3
- package/src/admin/editor/panels/settings/EffectsControls.tsx +38 -14
- package/src/admin/editor/panels/settings/FieldBindControl.tsx +46 -28
- package/src/admin/editor/panels/settings/FieldControl.tsx +20 -8
- package/src/admin/editor/panels/settings/FormBindControl.tsx +2 -2
- package/src/admin/editor/panels/settings/HintedSwitch.tsx +33 -0
- package/src/admin/editor/panels/settings/IconControls.tsx +33 -13
- package/src/admin/editor/panels/settings/IconPicker.tsx +2 -0
- package/src/admin/editor/panels/settings/ImageSourcesField.tsx +3 -1
- package/src/admin/editor/panels/settings/ItemList.tsx +15 -2
- package/src/admin/editor/panels/settings/LengthRow.tsx +8 -6
- package/src/admin/editor/panels/settings/LoopItemBindControl.tsx +1 -1
- package/src/admin/editor/panels/settings/MediaPicker.tsx +127 -23
- package/src/admin/editor/panels/settings/MotionControl.tsx +28 -15
- package/src/admin/editor/panels/settings/NumberRow.tsx +9 -3
- package/src/admin/editor/panels/settings/PanelSelect.tsx +50 -0
- package/src/admin/editor/panels/settings/QueryStyleRows.tsx +25 -18
- package/src/admin/editor/panels/settings/RequiredFieldsNotice.tsx +66 -1
- package/src/admin/editor/panels/settings/StyleRow.tsx +10 -3
- package/src/admin/editor/panels/settings/StyleSources.tsx +4 -1
- package/src/admin/editor/panels/settings/VariantEditor.tsx +10 -1
- package/src/admin/editor/panels/settings/box-link-name.ts +6 -2
- package/src/admin/editor/panels/settings/class-suggest.ts +7 -7
- package/src/admin/editor/panels/settings/query-style.ts +38 -9
- package/src/admin/editor/panels/settings/svg-images.ts +13 -0
- package/src/admin/editor/panels/site-list.tsx +20 -6
- package/src/admin/editor/panels/variable-values.ts +11 -4
- package/src/admin/editor/restore-deleted.ts +21 -2
- package/src/admin/editor/section-templates.ts +81 -12
- package/src/admin/editor/shortcuts.ts +31 -2
- package/src/admin/editor/store.ts +7 -0
- package/src/admin/editor/useEditorCommands.ts +61 -15
- package/src/admin/editor/useEditorData.ts +4 -2
- package/src/admin/editor/useEditorShortcuts.ts +17 -7
- package/src/admin/editor/useNodeActions.ts +61 -6
- package/src/admin/editor/useSave.ts +22 -7
- package/src/admin/editor/useSavedSections.ts +197 -0
- package/src/admin/forms-api.ts +2 -0
- package/src/admin/image-editor/Canvas.tsx +61 -17
- package/src/admin/image-editor/CurvesPanel.tsx +2 -1
- package/src/admin/image-editor/ExportDialog.tsx +48 -18
- package/src/admin/image-editor/ImageEditorDialog.tsx +179 -8
- package/src/admin/image-editor/MetadataPanel.tsx +15 -4
- package/src/admin/image-editor/crop-geometry.ts +3 -2
- package/src/admin/image-editor/image-editor-css.ts +15 -10
- package/src/admin/image-editor/load.ts +9 -2
- package/src/admin/image-editor/parts.tsx +69 -19
- package/src/admin/image-editor/save.ts +54 -8
- package/src/admin/media-api.ts +2 -1
- package/src/admin/pages/AgentsPage.tsx +138 -27
- package/src/admin/pages/CreateDialog.tsx +97 -30
- package/src/admin/pages/NewPageDialog.tsx +21 -3
- package/src/admin/pages/NewThemePartDialog.tsx +11 -3
- package/src/admin/pages/PageList.tsx +14 -6
- package/src/admin/pages/SetupShell.tsx +28 -12
- package/src/admin/pages/ThemePartList.tsx +59 -11
- package/src/admin/pages/list-kit.tsx +106 -24
- package/src/admin/saved-sections-api.ts +51 -0
- package/src/admin/search.ts +15 -0
- package/src/admin/setup/useSetupStatus.ts +1 -1
- package/src/admin/theme-api.ts +16 -5
- package/src/admin/ui.ts +82 -22
- package/src/astro/floats/runtime.ts +21 -0
- package/src/astro/menu/runtime.ts +34 -1
- package/src/astro/popups/runtime.ts +41 -9
- package/src/astro/render.ts +3 -0
- package/src/astro/resolve-theme.ts +53 -11
- package/src/astro/resolve.ts +9 -1
- package/src/astro/tabs/runtime.ts +12 -0
- package/src/astro/theme-posts.ts +2 -2
- package/src/astro/visitor.ts +2 -0
- package/src/constants.ts +1 -1
- package/src/core/a11y/audit.ts +196 -24
- package/src/core/arrange.ts +48 -12
- package/src/core/audience/rules.ts +5 -1
- package/src/core/audience/variants.ts +29 -3
- package/src/core/clipboard.ts +7 -0
- package/src/core/css/generate.ts +31 -6
- package/src/core/css/print.ts +5 -0
- package/src/core/data/bindings.ts +8 -1
- package/src/core/design/classes.ts +39 -16
- package/src/core/design/devices.ts +7 -13
- package/src/core/design/diff.ts +6 -0
- package/src/core/design/merge.ts +90 -2
- package/src/core/design/states.ts +7 -13
- package/src/core/design/tokens.ts +16 -2
- package/src/core/design/transfer.ts +33 -6
- package/src/core/design/variables.ts +30 -9
- package/src/core/elements/dynamic-elements.ts +53 -14
- package/src/core/elements/form-elements.ts +55 -16
- package/src/core/elements/index.ts +84 -39
- package/src/core/elements/menu.ts +40 -19
- package/src/core/elements/select-prompt.ts +3 -0
- package/src/core/elements/svg-ids.ts +39 -0
- package/src/core/forms/binding.ts +57 -16
- package/src/core/forms/definition.ts +72 -0
- package/src/core/history/diff.ts +18 -1
- package/src/core/icons/animation-runs.ts +11 -0
- package/src/core/icons/catalog.ts +3 -2
- package/src/core/image-edit/schema.ts +11 -1
- package/src/core/image-edit/summary.ts +6 -3
- package/src/core/index.ts +35 -1
- package/src/core/limits.ts +12 -1
- package/src/core/migrate/index.ts +3 -0
- package/src/core/perf/meter.ts +42 -7
- package/src/core/recipes/index.ts +5 -4
- package/src/core/render/context.ts +8 -0
- package/src/core/render/dynamic-post.ts +69 -12
- package/src/core/render/extras.ts +77 -4
- package/src/core/render/form.ts +140 -6
- package/src/core/render/index.ts +156 -20
- package/src/core/render/loop.ts +44 -8
- package/src/core/render/pagination.ts +18 -4
- package/src/core/render/section.ts +27 -0
- package/src/core/render/tabs.ts +12 -3
- package/src/core/render/vnode.ts +1 -1
- package/src/core/sanitize/css.ts +29 -8
- package/src/core/sanitize/embed-url.ts +42 -5
- package/src/core/sanitize/url.ts +2 -1
- package/src/core/saved-sections.ts +318 -0
- package/src/core/schema/design.ts +1 -1
- package/src/core/schema/layout.ts +16 -7
- package/src/core/schema/style.ts +4 -2
- package/src/core/stats.ts +2 -1
- package/src/core/theme/conditions.ts +3 -1
- package/src/core/theme/dynamic.ts +36 -5
- package/src/core/theme/float.ts +12 -2
- package/src/core/theme/pagination.ts +50 -29
- package/src/core/theme/part-types.ts +4 -4
- package/src/core/theme/popup-markup.ts +23 -5
- package/src/core/theme/popup-rules.ts +1 -0
- package/src/core/theme/triggers.ts +3 -2
- package/src/core/tree-ops.ts +27 -0
- package/src/mcp/ports.ts +22 -1
- package/src/mcp/rate-limit.ts +2 -1
- package/src/mcp/read.ts +15 -3
- package/src/mcp/refs.ts +18 -0
- package/src/mcp/sections.ts +183 -0
- package/src/mcp/tools.ts +44 -0
- package/src/mcp/write.ts +178 -14
- package/src/server/agent-settings.ts +1 -1
- package/src/server/hooks.ts +5 -3
- package/src/server/icon-routes.ts +30 -9
- package/src/server/mcp-routes.ts +8 -1
- package/src/server/plugin.ts +14 -0
- package/src/server/saved-sections.ts +163 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { createKumoToastManager } from "@cloudflare/kumo";
|
|
3
|
+
import { ArrowSquareOutIcon } from "@phosphor-icons/react";
|
|
3
4
|
import {
|
|
4
5
|
DEVICE_PREVIEW_PX,
|
|
5
6
|
mergeDesign,
|
|
@@ -121,7 +122,14 @@ export function useEditorCommands({
|
|
|
121
122
|
]
|
|
122
123
|
: []),
|
|
123
124
|
{
|
|
124
|
-
|
|
125
|
+
// UX-082: an icon, not "↗" read aloud as an arrow; the new tab is said in words.
|
|
126
|
+
children: React.createElement(
|
|
127
|
+
React.Fragment,
|
|
128
|
+
null,
|
|
129
|
+
"View page",
|
|
130
|
+
React.createElement(ArrowSquareOutIcon, { "aria-hidden": true, size: 14 }),
|
|
131
|
+
React.createElement("span", { className: "emvb-sr-only" }, " (opens in a new tab)"),
|
|
132
|
+
),
|
|
125
133
|
variant: "secondary",
|
|
126
134
|
onClick: () => window.open(path, "_blank", "noopener"),
|
|
127
135
|
},
|
|
@@ -145,14 +153,24 @@ export function useEditorCommands({
|
|
|
145
153
|
|
|
146
154
|
// W-325: design saves run one at a time, each against the newest revision, like page saves.
|
|
147
155
|
// Two quick edits used to both send the revision the editor started with, so the second one
|
|
148
|
-
// was refused with a 409 by the first. `written` remembers the revision
|
|
149
|
-
// the store catches up (the ref updates on the next render).
|
|
156
|
+
// was refused with a 409 by the first. `written` remembers the revision the last save produced
|
|
157
|
+
// until the store catches up (the ref updates on the next render).
|
|
150
158
|
const designQueue = React.useRef<Promise<unknown>>(Promise.resolve());
|
|
151
|
-
|
|
159
|
+
// W-536: every revision this tab's run of saves went through, not just the last one. The store
|
|
160
|
+
// can render an older one of them mid-run (save 1's revision while save 2 is out), which used
|
|
161
|
+
// to send that stale revision with save 3 and get a 409.
|
|
162
|
+
const written = React.useRef<{ chain: Set<string | null>; to: string } | null>(null);
|
|
152
163
|
const baseRevision = () => {
|
|
153
164
|
const current = latest.current.designRevision;
|
|
154
165
|
const last = written.current;
|
|
155
|
-
return last && last.
|
|
166
|
+
return last && last.chain.has(current) ? last.to : current;
|
|
167
|
+
};
|
|
168
|
+
const wrote = (sent: string | null, revision: string) => {
|
|
169
|
+
const chain = written.current?.chain.has(sent) ? written.current.chain : new Set([sent]);
|
|
170
|
+
// What the store shows now is behind this save too.
|
|
171
|
+
chain.add(latest.current.designRevision);
|
|
172
|
+
chain.add(revision);
|
|
173
|
+
written.current = { chain, to: revision };
|
|
156
174
|
};
|
|
157
175
|
const queueDesign = <T>(task: () => Promise<T>): Promise<T> => {
|
|
158
176
|
const run = designQueue.current.then(task, task);
|
|
@@ -160,24 +178,48 @@ export function useEditorCommands({
|
|
|
160
178
|
return run;
|
|
161
179
|
};
|
|
162
180
|
|
|
163
|
-
|
|
181
|
+
// W-536: the newest edit, shown at once. Each edit is built from the `design` the panels render,
|
|
182
|
+
// which used to change only after the save came back, so a second quick edit to the same
|
|
183
|
+
// class (Opacity, then Add shadow) was built without the first and saved over it.
|
|
184
|
+
const shownDesign = React.useRef<DesignSystem | null>(null);
|
|
185
|
+
const changeDesign = (next: DesignSystem) => {
|
|
186
|
+
const base = latest.current.design;
|
|
187
|
+
shownDesign.current = next;
|
|
188
|
+
dispatch({ type: "preview-design", design: next });
|
|
189
|
+
return queueDesign(() => saveDesignNow(next, base));
|
|
190
|
+
};
|
|
164
191
|
|
|
165
|
-
const saveDesignNow = async (next: DesignSystem) => {
|
|
192
|
+
const saveDesignNow = async (next: DesignSystem, base: DesignSystem) => {
|
|
166
193
|
try {
|
|
167
|
-
const
|
|
168
|
-
const revision = await saveDesign(fetcher, next,
|
|
169
|
-
|
|
170
|
-
|
|
194
|
+
const sent = baseRevision();
|
|
195
|
+
const revision = await saveDesign(fetcher, next, sent);
|
|
196
|
+
wrote(sent, revision);
|
|
197
|
+
// A newer edit waiting in the queue stays on screen; its own save follows.
|
|
198
|
+
dispatch({ type: "set-design", design: shownDesign.current ?? next, revision });
|
|
199
|
+
if (shownDesign.current === next) shownDesign.current = null;
|
|
171
200
|
} catch (error) {
|
|
172
201
|
written.current = null;
|
|
202
|
+
// A newer edit already on screen was built on this one, so it stays shown (W-536).
|
|
203
|
+
const newer =
|
|
204
|
+
shownDesign.current !== null && shownDesign.current !== next ? shownDesign.current : null;
|
|
205
|
+
const settled = () => {
|
|
206
|
+
if (!newer) shownDesign.current = null;
|
|
207
|
+
};
|
|
208
|
+
// Take back an edit that didn't save, unless a newer one is already on screen.
|
|
209
|
+
const takeBack = () => {
|
|
210
|
+
if (shownDesign.current !== next) return;
|
|
211
|
+
shownDesign.current = null;
|
|
212
|
+
dispatch({ type: "preview-design", design: base });
|
|
213
|
+
};
|
|
173
214
|
if (error instanceof ApiError && error.status === 409) {
|
|
174
215
|
// W-333: replay this tab's edit onto the styles saved elsewhere when those keys
|
|
175
216
|
// were not also changed there. A real clash still loads the server copy (W-212).
|
|
176
217
|
try {
|
|
177
218
|
const fresh = await loadDesign(fetcher);
|
|
178
|
-
const merged = mergeDesign(
|
|
219
|
+
const merged = mergeDesign(base, next, fresh.design);
|
|
179
220
|
const names = merged.conflicts.map((conflict) => conflict.name).join(", ");
|
|
180
221
|
if (merged.conflicts.length > 0) {
|
|
222
|
+
shownDesign.current = null;
|
|
181
223
|
dispatch({ type: "load-design", ...fresh });
|
|
182
224
|
throw new Error(
|
|
183
225
|
`Site styles were changed in another tab or window (${names}). The latest styles are loaded now: make your change again.`,
|
|
@@ -186,12 +228,14 @@ export function useEditorCommands({
|
|
|
186
228
|
}
|
|
187
229
|
const unchanged = JSON.stringify(merged.design) === JSON.stringify(fresh.design);
|
|
188
230
|
if (unchanged) {
|
|
189
|
-
dispatch({ type: "load-design", ...fresh });
|
|
231
|
+
dispatch({ type: "load-design", ...fresh, ...(newer ? { design: newer } : {}) });
|
|
232
|
+
settled();
|
|
190
233
|
return;
|
|
191
234
|
}
|
|
192
235
|
const revision = await saveDesign(fetcher, merged.design, fresh.revision);
|
|
193
|
-
|
|
194
|
-
dispatch({ type: "set-design", design: merged.design, revision });
|
|
236
|
+
wrote(fresh.revision, revision);
|
|
237
|
+
dispatch({ type: "set-design", design: newer ?? merged.design, revision });
|
|
238
|
+
settled();
|
|
195
239
|
return;
|
|
196
240
|
} catch (retry) {
|
|
197
241
|
if (
|
|
@@ -200,12 +244,14 @@ export function useEditorCommands({
|
|
|
200
244
|
) {
|
|
201
245
|
throw retry;
|
|
202
246
|
}
|
|
247
|
+
takeBack();
|
|
203
248
|
throw new Error(
|
|
204
249
|
"Site styles were changed somewhere else. Reload the editor and try again.",
|
|
205
250
|
{ cause: retry },
|
|
206
251
|
);
|
|
207
252
|
}
|
|
208
253
|
}
|
|
254
|
+
takeBack();
|
|
209
255
|
throw new Error(
|
|
210
256
|
error instanceof ApiError
|
|
211
257
|
? `Couldn't save site styles. ${error.message}`
|
|
@@ -54,7 +54,7 @@ export type EditorData =
|
|
|
54
54
|
| { state: "loading" }
|
|
55
55
|
| { state: "ready"; entry: EditorEntry; design: LoadedDesign }
|
|
56
56
|
| { state: "not-found" | "forbidden" }
|
|
57
|
-
| { state: "error"; message: string };
|
|
57
|
+
| { state: "error"; message: string; retry: () => void };
|
|
58
58
|
|
|
59
59
|
const UNREADABLE = "This page's layout can't be read.";
|
|
60
60
|
|
|
@@ -173,6 +173,7 @@ export function useEditorData(
|
|
|
173
173
|
collection: string = PAGES_COLLECTION,
|
|
174
174
|
): EditorData {
|
|
175
175
|
const [data, setData] = React.useState<EditorData>({ state: "loading" });
|
|
176
|
+
const [attempt, setAttempt] = React.useState(0);
|
|
176
177
|
React.useEffect(() => {
|
|
177
178
|
let active = true;
|
|
178
179
|
setData({ state: "loading" });
|
|
@@ -187,6 +188,7 @@ export function useEditorData(
|
|
|
187
188
|
setData({
|
|
188
189
|
state: "error",
|
|
189
190
|
message: error instanceof Error ? error.message : String(error),
|
|
191
|
+
retry: () => setAttempt((n) => n + 1),
|
|
190
192
|
});
|
|
191
193
|
}
|
|
192
194
|
},
|
|
@@ -194,6 +196,6 @@ export function useEditorData(
|
|
|
194
196
|
return () => {
|
|
195
197
|
active = false;
|
|
196
198
|
};
|
|
197
|
-
}, [fetcher, entryId, collection]);
|
|
199
|
+
}, [fetcher, entryId, collection, attempt]);
|
|
198
200
|
return data;
|
|
199
201
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "../../core/index.ts";
|
|
14
14
|
import { runCommand, type CommandRunners } from "./editor-commands.ts";
|
|
15
15
|
import type { EditorState, HistoryAction } from "./store.ts";
|
|
16
|
-
import { inDialog, isPaletteShortcut } from "./shortcuts.ts";
|
|
16
|
+
import { inDialog, isPaletteShortcut, shortcutKey } from "./shortcuts.ts";
|
|
17
17
|
|
|
18
18
|
const isTextField = (target: EventTarget | null) => {
|
|
19
19
|
const element = target as HTMLElement | null;
|
|
@@ -127,18 +127,29 @@ export function useEditorShortcuts({
|
|
|
127
127
|
handlers.current.palette?.();
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
if ((event.ctrlKey || event.metaKey) && event
|
|
130
|
+
if ((event.ctrlKey || event.metaKey) && shortcutKey(event) === "s") {
|
|
131
131
|
event.preventDefault();
|
|
132
132
|
runCommand(runners(), "save", null);
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
+
// W-622: holding Delete, Ctrl+D or Ctrl+V auto-repeats; each repeat acted on the next selected
|
|
136
|
+
// element, so a long press emptied whole sections. They act once per press.
|
|
137
|
+
const destructive =
|
|
138
|
+
event.key === "Delete" ||
|
|
139
|
+
event.key === "Backspace" ||
|
|
140
|
+
((event.ctrlKey || event.metaKey) && ["d", "v"].includes(shortcutKey(event)));
|
|
141
|
+
if (event.repeat && destructive) {
|
|
142
|
+
// A held Backspace in a text field still deletes text as usual.
|
|
143
|
+
if (!isTextField(event.target) && !inDialog(event.target)) event.preventDefault();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
135
146
|
if (isTextField(event.target) || inDialog(event.target)) return;
|
|
136
|
-
if ((event.ctrlKey || event.metaKey) && !event.altKey && event
|
|
147
|
+
if ((event.ctrlKey || event.metaKey) && !event.altKey && shortcutKey(event) === "z") {
|
|
137
148
|
event.preventDefault();
|
|
138
149
|
runCommand(runners(), event.shiftKey ? "redo" : "undo", null);
|
|
139
150
|
return;
|
|
140
151
|
}
|
|
141
|
-
if ((event.ctrlKey || event.metaKey) && !event.altKey && event
|
|
152
|
+
if ((event.ctrlKey || event.metaKey) && !event.altKey && shortcutKey(event) === "y") {
|
|
142
153
|
event.preventDefault();
|
|
143
154
|
runCommand(runners(), "redo", null);
|
|
144
155
|
return;
|
|
@@ -146,13 +157,12 @@ export function useEditorShortcuts({
|
|
|
146
157
|
if (!onCanvasOrLayers(event.target)) return;
|
|
147
158
|
const layout = latest.current.page.layout;
|
|
148
159
|
const selected = latest.current.selectedId;
|
|
149
|
-
if ((event.ctrlKey || event.metaKey) && event
|
|
160
|
+
if ((event.ctrlKey || event.metaKey) && shortcutKey(event) === "d" && selected) {
|
|
150
161
|
event.preventDefault();
|
|
151
162
|
runCommand(runners(), "duplicate", selected);
|
|
152
163
|
return;
|
|
153
164
|
}
|
|
154
|
-
const clipKey =
|
|
155
|
-
(event.ctrlKey || event.metaKey) && !event.altKey ? event.key.toLowerCase() : "";
|
|
165
|
+
const clipKey = (event.ctrlKey || event.metaKey) && !event.altKey ? shortcutKey(event) : "";
|
|
156
166
|
if (clipKey === "c" && !event.shiftKey && selected && !hasTextSelection(event.target)) {
|
|
157
167
|
event.preventDefault();
|
|
158
168
|
runCommand(runners(), "copy", selected);
|
|
@@ -9,8 +9,13 @@ import {
|
|
|
9
9
|
type WrapType,
|
|
10
10
|
ELEMENT_DESCRIPTORS,
|
|
11
11
|
findNode,
|
|
12
|
+
LAYOUT_SCHEMA_VERSION,
|
|
12
13
|
moveDown,
|
|
14
|
+
moveIn,
|
|
15
|
+
moveOut,
|
|
16
|
+
newNodeId,
|
|
13
17
|
moveUp,
|
|
18
|
+
parentOf,
|
|
14
19
|
recipeNode,
|
|
15
20
|
withFreshIds,
|
|
16
21
|
subtreeSize,
|
|
@@ -24,9 +29,40 @@ import { ELEMENT_NAMES } from "./element-chrome.ts";
|
|
|
24
29
|
import type { ItemActions } from "./panels/settings/ItemList.tsx";
|
|
25
30
|
import type { EditorAction, EditorState } from "./store.ts";
|
|
26
31
|
|
|
32
|
+
const MOVES = new Set<unknown>([moveUp, moveDown, moveIn, moveOut]);
|
|
33
|
+
|
|
34
|
+
/** "Moved. Heading is 2 of 3 in Container." for the screen reader after an Alt+arrow move. */
|
|
35
|
+
function movedTo(layout: Layout, id: string): string {
|
|
36
|
+
const node = findNode(layout, id);
|
|
37
|
+
const parentId = parentOf(layout, id);
|
|
38
|
+
const parent = parentId ? findNode(layout, parentId) : undefined;
|
|
39
|
+
const siblings: LayoutNode[] =
|
|
40
|
+
parent && "children" in parent && Array.isArray(parent.children) ? parent.children : [];
|
|
41
|
+
const index = siblings.findIndex((child) => child.id === id);
|
|
42
|
+
const name = ELEMENT_NAMES[node?.type ?? "container"] ?? "Element";
|
|
43
|
+
const where = ELEMENT_NAMES[parent?.type ?? "container"] ?? "its container";
|
|
44
|
+
return `Moved. ${name} is ${index + 1} of ${siblings.length} in ${where}.`;
|
|
45
|
+
}
|
|
46
|
+
|
|
27
47
|
const RESTORE_TIMEOUT_MS = 6000;
|
|
28
48
|
const NOTICE_TIMEOUT_MS = 4000;
|
|
29
49
|
|
|
50
|
+
/**
|
|
51
|
+
* UX-070: when an action removes the focused control (a deleted row, a closing toast), move focus
|
|
52
|
+
* to the selected layer, the Layers tree, or the canvas, instead of leaving it on the page body.
|
|
53
|
+
*/
|
|
54
|
+
function keepFocusInLayers(force = false) {
|
|
55
|
+
requestAnimationFrame(() => {
|
|
56
|
+
const active = document.activeElement;
|
|
57
|
+
if (!force && active && active !== document.body && active.isConnected) return;
|
|
58
|
+
(
|
|
59
|
+
document.querySelector<HTMLElement>('.emvb-layer-select[aria-current="true"]') ??
|
|
60
|
+
document.querySelector<HTMLElement>('[data-emvb-editor] [role="tree"]') ??
|
|
61
|
+
document.querySelector<HTMLElement>("iframe[data-emvb-canvas]")
|
|
62
|
+
)?.focus({ preventScroll: true });
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
30
66
|
/** Node actions on the layout tree: delete (with restore toast), duplicate, and add from the panel. */
|
|
31
67
|
export function useNodeActions({
|
|
32
68
|
state,
|
|
@@ -52,11 +88,18 @@ export function useNodeActions({
|
|
|
52
88
|
const canMove = canDelete;
|
|
53
89
|
|
|
54
90
|
const finishDelete = (id: string) => {
|
|
91
|
+
// UX-062: the toast names what went, as the confirm button does ("Delete 3 elements").
|
|
92
|
+
const layout = latest.current.page.layout;
|
|
93
|
+
const count = layout ? subtreeSize(layout, id) : 1;
|
|
94
|
+
const name = ELEMENT_NAMES[(layout && findNode(layout, id)?.type) || "container"] ?? "Element";
|
|
95
|
+
const title = count > 1 ? `${count} elements deleted` : `${name} deleted`;
|
|
55
96
|
dispatch({ type: "delete-node", id });
|
|
97
|
+
// UX-070: the deleted row or canvas element took focus with it; keep the keyboard in Layers.
|
|
98
|
+
keepFocusInLayers();
|
|
56
99
|
setDeleteAsk(null);
|
|
57
100
|
if (lastToast.current) toasts.close(lastToast.current);
|
|
58
101
|
const toastId: string = toasts.add({
|
|
59
|
-
title
|
|
102
|
+
title,
|
|
60
103
|
timeout: RESTORE_TIMEOUT_MS,
|
|
61
104
|
actions: [
|
|
62
105
|
{
|
|
@@ -65,6 +108,8 @@ export function useNodeActions({
|
|
|
65
108
|
onClick: () => {
|
|
66
109
|
dispatch({ type: "restore" });
|
|
67
110
|
toasts.close(toastId);
|
|
111
|
+
// The toast is closing with focus in it; the restored element's row takes it.
|
|
112
|
+
keepFocusInLayers(true);
|
|
68
113
|
},
|
|
69
114
|
},
|
|
70
115
|
],
|
|
@@ -99,6 +144,8 @@ export function useNodeActions({
|
|
|
99
144
|
return;
|
|
100
145
|
}
|
|
101
146
|
dispatch({ type: "apply-arranged", layout: result.layout, selected: result.selected });
|
|
147
|
+
// W-770: a keyboard move only announced refusals; say where the element landed.
|
|
148
|
+
if (MOVES.has(run)) announce(movedTo(result.layout, id));
|
|
102
149
|
if (result.note) {
|
|
103
150
|
announce(`Duplicated. ${result.note}`);
|
|
104
151
|
if (lastToast.current) toasts.close(lastToast.current);
|
|
@@ -176,11 +223,14 @@ export function useNodeActions({
|
|
|
176
223
|
};
|
|
177
224
|
|
|
178
225
|
const addFromPanel = (type: ElementType) => {
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
181
|
-
|
|
226
|
+
const current = latest.current.page.layout;
|
|
227
|
+
if (!current && type === "container") {
|
|
228
|
+
dispatch({ type: "add-root-container" });
|
|
182
229
|
return;
|
|
183
230
|
}
|
|
231
|
+
// UX-094: an empty page (one made outside EmVB has no layout) gets its container first, so
|
|
232
|
+
// a click or palette insert lands instead of doing nothing.
|
|
233
|
+
const layout = current ?? startingLayout();
|
|
184
234
|
const node = newElement(type);
|
|
185
235
|
if (!node) return;
|
|
186
236
|
place(layout, node, ELEMENT_DESCRIPTORS.find((d) => d.type === type)?.name ?? type);
|
|
@@ -188,8 +238,7 @@ export function useNodeActions({
|
|
|
188
238
|
|
|
189
239
|
/** A section recipe built from the site's styles (W-320). */
|
|
190
240
|
const addRecipe = (id: string) => {
|
|
191
|
-
const layout = latest.current.page.layout;
|
|
192
|
-
if (!layout) return;
|
|
241
|
+
const layout = latest.current.page.layout ?? startingLayout();
|
|
193
242
|
const node = recipeNode(id, latest.current.design, layout);
|
|
194
243
|
if (!node) return;
|
|
195
244
|
place(layout, withFreshIds(layout, node), `${node.label ?? "Section"} section`, true);
|
|
@@ -210,3 +259,9 @@ export function useNodeActions({
|
|
|
210
259
|
items,
|
|
211
260
|
};
|
|
212
261
|
}
|
|
262
|
+
|
|
263
|
+
/** One empty container, the start of a page that has no layout yet (UX-094). */
|
|
264
|
+
const startingLayout = (): Layout => ({
|
|
265
|
+
schemaVersion: LAYOUT_SCHEMA_VERSION,
|
|
266
|
+
root: { id: newNodeId(), type: "container", props: {}, children: [] },
|
|
267
|
+
});
|
|
@@ -65,7 +65,12 @@ export function saveFailure(
|
|
|
65
65
|
if (error.status === 400 || error.status === 422) {
|
|
66
66
|
const path = /\broot(?:\.children\[\d+\])*/.exec(error.message)?.[0];
|
|
67
67
|
const id = path && page.layout ? nodeIdAtPath(page.layout, path) : null;
|
|
68
|
-
|
|
68
|
+
// UX-095: with no element to highlight, "fix the highlighted setting" pointed at nothing.
|
|
69
|
+
if (!id) {
|
|
70
|
+
const message = `Couldn't save. ${error.message}`;
|
|
71
|
+
return { status: { kind: "error", message, retry: false }, rejection: error.message };
|
|
72
|
+
}
|
|
73
|
+
return { status: fixAndSave, rejection: error.message, select: id };
|
|
69
74
|
}
|
|
70
75
|
return { status: { kind: "error", message: `Couldn't save. ${error.message}`, retry: false } };
|
|
71
76
|
}
|
|
@@ -189,14 +194,24 @@ export function useSave(
|
|
|
189
194
|
}, [start]);
|
|
190
195
|
|
|
191
196
|
/** Conflict → Overwrite: take the stored revision and save over it. */
|
|
197
|
+
// W-836: the overwrite counts as the save in flight, so a save asked for meanwhile (Save draft,
|
|
198
|
+
// Ctrl+S, autosave) waits for it and uses its new revision instead of the stale one, which
|
|
199
|
+
// reopened the conflict right after a successful overwrite.
|
|
192
200
|
const overwrite = React.useCallback(async () => {
|
|
193
201
|
setConflict(false);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
202
|
+
const run: Promise<string | null> = (async () => {
|
|
203
|
+
try {
|
|
204
|
+
const stored = await loadEntry(fetcher, latest.current.id, collection);
|
|
205
|
+
return await write(stored.rev);
|
|
206
|
+
} catch {
|
|
207
|
+
setStatus({ kind: "error", message: OFFLINE, retry: true });
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
})().finally(() => {
|
|
211
|
+
if (inFlight.current === run) inFlight.current = null;
|
|
212
|
+
});
|
|
213
|
+
inFlight.current = run;
|
|
214
|
+
await run;
|
|
200
215
|
}, [fetcher, write, collection]);
|
|
201
216
|
|
|
202
217
|
const publish = React.useCallback(async (): Promise<boolean> => {
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { createKumoToastManager } from "@cloudflare/kumo";
|
|
3
|
+
import {
|
|
4
|
+
classMergeNotice,
|
|
5
|
+
droppedNotice,
|
|
6
|
+
insertSavedSection,
|
|
7
|
+
LAYOUT_SCHEMA_VERSION,
|
|
8
|
+
newNodeId,
|
|
9
|
+
pageSlug,
|
|
10
|
+
snapshotSection,
|
|
11
|
+
syncedPartLayout,
|
|
12
|
+
wrapInThemeSection,
|
|
13
|
+
type DesignSystem,
|
|
14
|
+
type Layout,
|
|
15
|
+
} from "../../core/index.ts";
|
|
16
|
+
import type { Fetcher } from "../api.ts";
|
|
17
|
+
import {
|
|
18
|
+
deleteSavedSection,
|
|
19
|
+
getSavedSection,
|
|
20
|
+
listSavedSections,
|
|
21
|
+
renameSavedSection,
|
|
22
|
+
saveSavedSection,
|
|
23
|
+
type SavedSectionSummary,
|
|
24
|
+
} from "../saved-sections-api.ts";
|
|
25
|
+
import { createThemePart } from "../theme-api.ts";
|
|
26
|
+
import type { EditorAction, EditorState } from "./store.ts";
|
|
27
|
+
|
|
28
|
+
export type SaveMode = "copy" | "synced";
|
|
29
|
+
|
|
30
|
+
/** What the Add panel, the palette and the Save as section dialog use (W-876). */
|
|
31
|
+
export type SavedSectionActions = {
|
|
32
|
+
list: SavedSectionSummary[];
|
|
33
|
+
/** Null until the first list arrives; a message when it couldn't be read. */
|
|
34
|
+
loadError: string | null;
|
|
35
|
+
loaded: boolean;
|
|
36
|
+
refresh: () => void;
|
|
37
|
+
/** Resolves to null when saved, or the reason it wasn't. */
|
|
38
|
+
save: (nodeId: string, name: string, mode: SaveMode) => Promise<string | null>;
|
|
39
|
+
insert: (id: string) => Promise<void>;
|
|
40
|
+
rename: (id: string, name: string) => Promise<string | null>;
|
|
41
|
+
remove: (id: string) => Promise<string | null>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const NOTICE_MS = 5000;
|
|
45
|
+
const messageOf = (error: unknown, fallback: string) =>
|
|
46
|
+
error instanceof Error && error.message ? error.message : fallback;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Saved sections in the editor (W-876, D-060). Copies go to `emvb_saved_sections`; Synced makes a
|
|
50
|
+
* Section theme part (W-098) from the element and puts the element inside a Theme section that
|
|
51
|
+
* embeds it. Inserting brings the section's classes into Site styles first, never overwriting one.
|
|
52
|
+
*/
|
|
53
|
+
export function useSavedSections({
|
|
54
|
+
fetcher,
|
|
55
|
+
latest,
|
|
56
|
+
dispatch,
|
|
57
|
+
changeDesign,
|
|
58
|
+
announce,
|
|
59
|
+
toasts,
|
|
60
|
+
}: {
|
|
61
|
+
fetcher: Fetcher;
|
|
62
|
+
latest: React.RefObject<EditorState>;
|
|
63
|
+
dispatch: React.Dispatch<EditorAction>;
|
|
64
|
+
changeDesign: (next: DesignSystem) => Promise<unknown>;
|
|
65
|
+
announce: (message: string) => void;
|
|
66
|
+
toasts: ReturnType<typeof createKumoToastManager>;
|
|
67
|
+
}): SavedSectionActions {
|
|
68
|
+
const [list, setList] = React.useState<SavedSectionSummary[]>([]);
|
|
69
|
+
const [loaded, setLoaded] = React.useState(false);
|
|
70
|
+
const [loadError, setLoadError] = React.useState<string | null>(null);
|
|
71
|
+
const tell = React.useCallback(
|
|
72
|
+
(title: string, description?: string) => {
|
|
73
|
+
announce(description ? `${title}. ${description}` : title);
|
|
74
|
+
toasts.add({ title, ...(description ? { description } : {}), timeout: NOTICE_MS });
|
|
75
|
+
},
|
|
76
|
+
[announce, toasts],
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const refresh = React.useCallback(() => {
|
|
80
|
+
listSavedSections(fetcher).then(
|
|
81
|
+
(items) => {
|
|
82
|
+
setList(items);
|
|
83
|
+
setLoadError(null);
|
|
84
|
+
setLoaded(true);
|
|
85
|
+
},
|
|
86
|
+
(error: unknown) => {
|
|
87
|
+
setLoadError(messageOf(error, "Couldn't load My sections."));
|
|
88
|
+
setLoaded(true);
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
}, [fetcher]);
|
|
92
|
+
React.useEffect(refresh, [refresh]);
|
|
93
|
+
|
|
94
|
+
const saveCopy = async (layout: Layout, nodeId: string, name: string) => {
|
|
95
|
+
const snap = snapshotSection(
|
|
96
|
+
layout,
|
|
97
|
+
nodeId,
|
|
98
|
+
latest.current.design,
|
|
99
|
+
name,
|
|
100
|
+
new Date().toISOString(),
|
|
101
|
+
);
|
|
102
|
+
if (!snap.ok) return snap.reason;
|
|
103
|
+
await saveSavedSection(fetcher, snap.record);
|
|
104
|
+
refresh();
|
|
105
|
+
tell(`Saved "${snap.record.name}" to My sections`);
|
|
106
|
+
return null;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const saveSynced = async (layout: Layout, nodeId: string, name: string) => {
|
|
110
|
+
const partLayout = syncedPartLayout(layout, nodeId);
|
|
111
|
+
const title = name.trim();
|
|
112
|
+
if (!title) return "Give the section a name.";
|
|
113
|
+
if (!partLayout) return "Choose an element inside the page.";
|
|
114
|
+
// Try the wrap first: a refused one (a tab panel, a menu item) used to leave a stray part (W-880).
|
|
115
|
+
const fits = wrapInThemeSection(layout, nodeId, "check");
|
|
116
|
+
if (!fits.ok) return fits.reason;
|
|
117
|
+
// The slug only tells theme parts apart; a short random tail keeps two "Hero"s apart.
|
|
118
|
+
const slug = `${pageSlug(`section-${title}`).slice(0, 60)}-${newNodeId().slice(0, 4)}`;
|
|
119
|
+
const partId = await createThemePart(fetcher, {
|
|
120
|
+
title,
|
|
121
|
+
slug,
|
|
122
|
+
partType: "section",
|
|
123
|
+
layout: partLayout,
|
|
124
|
+
});
|
|
125
|
+
const now = latest.current.page.layout;
|
|
126
|
+
const wrapped = now ? wrapInThemeSection(now, nodeId, partId) : null;
|
|
127
|
+
if (!wrapped?.ok) {
|
|
128
|
+
return `The theme section "${title}" was made, but this element couldn't be linked to it. ${wrapped?.reason ?? ""}`.trim();
|
|
129
|
+
}
|
|
130
|
+
dispatch({ type: "apply-arranged", layout: wrapped.layout, selected: wrapped.selected });
|
|
131
|
+
tell(
|
|
132
|
+
`Made the synced section "${title}"`,
|
|
133
|
+
"Edit it in Theme Builder; publish it there to use it on the site.",
|
|
134
|
+
);
|
|
135
|
+
return null;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const save: SavedSectionActions["save"] = async (nodeId, name, mode) => {
|
|
139
|
+
const layout = latest.current.page.layout;
|
|
140
|
+
if (!layout) return "This page has no elements yet.";
|
|
141
|
+
try {
|
|
142
|
+
return await (mode === "synced" ? saveSynced : saveCopy)(layout, nodeId, name);
|
|
143
|
+
} catch (error) {
|
|
144
|
+
return messageOf(error, "Couldn't save the section.");
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const insert: SavedSectionActions["insert"] = async (id) => {
|
|
149
|
+
try {
|
|
150
|
+
const section = await getSavedSection(fetcher, id);
|
|
151
|
+
const state = latest.current;
|
|
152
|
+
const layout = state.page.layout ?? {
|
|
153
|
+
schemaVersion: LAYOUT_SCHEMA_VERSION,
|
|
154
|
+
root: { id: newNodeId(), type: "container" as const, props: {}, children: [] },
|
|
155
|
+
};
|
|
156
|
+
const result = insertSavedSection(section, layout, state.design, state.selectedId);
|
|
157
|
+
if (!result.ok) {
|
|
158
|
+
tell(result.reason);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const classes = classMergeNotice(result.merge);
|
|
162
|
+
// Classes first: an inserted copy never points at a class Site styles failed to save.
|
|
163
|
+
if (classes) await changeDesign(result.design);
|
|
164
|
+
dispatch({ type: "apply-arranged", layout: result.layout, selected: result.selected });
|
|
165
|
+
const left = droppedNotice(result.dropped);
|
|
166
|
+
const extra = [classes, left].filter(Boolean).join(" ");
|
|
167
|
+
if (extra) tell(`Inserted "${section.name}"`, extra);
|
|
168
|
+
else announce(`Inserted "${section.name}"`);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
tell(messageOf(error, "Couldn't insert the section."));
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const rename: SavedSectionActions["rename"] = async (id, name) => {
|
|
175
|
+
try {
|
|
176
|
+
const item = await renameSavedSection(fetcher, id, name);
|
|
177
|
+
setList((items) => items.map((entry) => (entry.id === id ? item : entry)));
|
|
178
|
+
announce(`Renamed to "${item.name}"`);
|
|
179
|
+
return null;
|
|
180
|
+
} catch (error) {
|
|
181
|
+
return messageOf(error, "Couldn't rename the section.");
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
const remove: SavedSectionActions["remove"] = async (id) => {
|
|
186
|
+
try {
|
|
187
|
+
await deleteSavedSection(fetcher, id);
|
|
188
|
+
setList((items) => items.filter((entry) => entry.id !== id));
|
|
189
|
+
announce("Section deleted. Pages that use a copy keep it.");
|
|
190
|
+
return null;
|
|
191
|
+
} catch (error) {
|
|
192
|
+
return messageOf(error, "Couldn't delete the section.");
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
return { list, loaded, loadError, refresh, save, insert, rename, remove };
|
|
197
|
+
}
|
package/src/admin/forms-api.ts
CHANGED
|
@@ -66,6 +66,8 @@ export type DefinitionField = {
|
|
|
66
66
|
type: string;
|
|
67
67
|
label: string;
|
|
68
68
|
required: boolean;
|
|
69
|
+
options?: ReadonlyArray<{ label: string; value: string }>;
|
|
70
|
+
validation?: { minLength?: number; maxLength?: number; min?: number; max?: number };
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
export async function loadFormFields(
|