@perkyzz/emvb 0.8.0 → 1.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 +3 -3
- package/package.json +4 -4
- package/src/admin/agents-api.ts +45 -0
- package/src/admin/editor/A11yCopilot.tsx +1 -1
- package/src/admin/editor/Editor.tsx +325 -239
- package/src/admin/editor/FieldPreview.tsx +164 -0
- package/src/admin/editor/Timeline.tsx +2 -1
- package/src/admin/editor/TopBar.tsx +36 -3
- package/src/admin/editor/canvas/CanvasFrame.tsx +2 -2
- package/src/admin/editor/canvas/DeviceBar.tsx +17 -9
- package/src/admin/editor/canvas/canvas-scale.ts +2 -2
- package/src/admin/editor/canvas/use-canvas-session.ts +2 -2
- package/src/admin/editor/co-design.ts +190 -0
- package/src/admin/editor/dnd/new-element.ts +26 -4
- package/src/admin/editor/editor-chrome.tsx +3 -3
- package/src/admin/editor/editor-commands.ts +8 -3
- package/src/admin/editor/editor-css.ts +3 -0
- package/src/admin/editor/element-chrome.ts +3 -1
- package/src/admin/editor/extension-manifests.ts +20 -0
- package/src/admin/editor/extensions/ExtensionPanels.tsx +26 -0
- package/src/admin/editor/extensions-context.tsx +27 -0
- package/src/admin/editor/feature-css.ts +17 -0
- package/src/admin/editor/host.ts +6 -0
- package/src/admin/editor/palette-items.ts +2 -2
- package/src/admin/editor/panels/AddPanel.tsx +31 -1
- package/src/admin/editor/panels/AgentRequestBox.tsx +116 -0
- package/src/admin/editor/panels/ClassesSection.tsx +9 -6
- package/src/admin/editor/panels/CoDesignPanel.tsx +170 -0
- package/src/admin/editor/panels/ColorControl.tsx +2 -2
- package/src/admin/editor/panels/ElementPanel.tsx +53 -15
- package/src/admin/editor/panels/LanguagesSection.tsx +152 -0
- package/src/admin/editor/panels/LayersPanel.tsx +10 -6
- package/src/admin/editor/panels/LeftPanel.tsx +33 -5
- package/src/admin/editor/panels/PageSettings.tsx +4 -0
- package/src/admin/editor/panels/SettingsPanel.tsx +21 -2
- package/src/admin/editor/panels/SiteStylesDrawer.tsx +7 -7
- package/src/admin/editor/panels/settings/BackgroundControls.tsx +76 -20
- package/src/admin/editor/panels/settings/BackgroundFill.tsx +8 -6
- package/src/admin/editor/panels/settings/BoxControl.tsx +5 -5
- package/src/admin/editor/panels/settings/EffectsControls.tsx +104 -9
- package/src/admin/editor/panels/settings/FieldControl.tsx +9 -3
- package/src/admin/editor/panels/settings/IconControls.tsx +14 -11
- package/src/admin/editor/panels/settings/LengthRow.tsx +27 -16
- package/src/admin/editor/panels/settings/LoopControl.tsx +269 -0
- package/src/admin/editor/panels/settings/LoopItemBindControl.tsx +1 -1
- package/src/admin/editor/panels/settings/MediaPicker.tsx +5 -5
- package/src/admin/editor/panels/settings/MotionControl.tsx +12 -11
- package/src/admin/editor/panels/settings/QueryStyleRows.tsx +7 -4
- package/src/admin/editor/panels/settings/StyleRow.tsx +113 -13
- package/src/admin/editor/panels/settings/TextMarksControl.tsx +247 -0
- package/src/admin/editor/panels/settings/VariableBinding.tsx +2 -2
- package/src/admin/editor/panels/settings/background-mode.ts +14 -11
- package/src/admin/editor/panels/settings/box-link-name.ts +1 -1
- package/src/admin/editor/panels/settings/box-sides.ts +22 -14
- package/src/admin/editor/panels/settings/heading-warning.ts +5 -1
- package/src/admin/editor/panels/settings/length-units.ts +55 -2
- package/src/admin/editor/panels/settings/query-style.ts +3 -3
- package/src/admin/editor/panels/settings/style-sections.ts +51 -10
- package/src/admin/editor/panels/style-target.ts +9 -7
- package/src/admin/editor/presence.ts +60 -0
- package/src/admin/editor/store.ts +6 -2
- package/src/admin/editor/useCoDesign.ts +177 -0
- package/src/admin/editor/useEditorCommands.ts +4 -4
- package/src/admin/editor/useExtensions.ts +45 -0
- package/src/admin/editor/useNodeActions.ts +15 -6
- package/src/admin/editor/useProposals.ts +81 -0
- package/src/admin/index.tsx +5 -1
- package/src/admin/languages-api.ts +61 -0
- package/src/admin/media-api.ts +27 -0
- package/src/admin/pages/AgentSetup.tsx +148 -0
- package/src/admin/pages/AgentsPage.tsx +11 -28
- package/src/admin/pages/CollectionsPage.tsx +215 -0
- package/src/admin/pages/CreateDialog.tsx +15 -0
- package/src/admin/pages/ImportButton.tsx +18 -0
- package/src/admin/pages/ImportElementorDialog.tsx +669 -0
- package/src/admin/pages/ImportPageLinks.tsx +86 -0
- package/src/admin/pages/PageList.tsx +15 -1
- package/src/admin/pages/ThemePartList.tsx +15 -1
- package/src/admin/pages/section-head.tsx +27 -0
- package/src/admin/proposals-api.ts +91 -0
- package/src/admin/setup/host-collections.ts +100 -0
- package/src/admin/ui.ts +39 -2
- package/src/admin/widgets/CanvasField.tsx +202 -0
- package/src/admin/widgets/convert-body.ts +54 -0
- package/src/admin/widgets/field-fetcher.ts +79 -0
- package/src/astro/content-port.ts +14 -1
- package/src/astro/index.ts +2 -0
- package/src/astro/page-count.ts +77 -0
- package/src/astro/resolve-theme.ts +58 -3
- package/src/astro/resolve.ts +128 -5
- package/src/astro/responsive-images.ts +99 -0
- package/src/constants.ts +1 -1
- package/src/core/a11y/audit.ts +44 -14
- package/src/core/arrange.ts +5 -1
- package/src/core/bounded-array.ts +31 -0
- package/src/core/canvas-collections.ts +20 -0
- package/src/core/clipboard.ts +9 -0
- package/src/core/contract.ts +285 -0
- package/src/core/css/generate.ts +89 -20
- package/src/core/css/trace.ts +18 -9
- package/src/core/css-keywords.ts +51 -1
- package/src/core/design/cascade.ts +12 -9
- package/src/core/design/classes.ts +4 -5
- package/src/core/design/devices.ts +13 -13
- package/src/core/design/states.ts +5 -3
- package/src/core/design/transfer.ts +5 -0
- package/src/core/design/variables.ts +17 -4
- package/src/core/elements/dynamic-elements.ts +19 -4
- package/src/core/elements/index.ts +73 -9
- package/src/core/extensions/define.ts +13 -0
- package/src/core/extensions/index.ts +41 -0
- package/src/core/extensions/namespace.ts +82 -0
- package/src/core/extensions/normalize.ts +141 -0
- package/src/core/extensions/placeholder.ts +41 -0
- package/src/core/extensions/registry.ts +94 -0
- package/src/core/extensions/render-ext.ts +118 -0
- package/src/core/extensions/safe-nodes.ts +93 -0
- package/src/core/extensions/schema.ts +112 -0
- package/src/core/extensions/types.ts +159 -0
- package/src/core/forms/binding.ts +1 -1
- package/src/core/history/diff.ts +1 -1
- package/src/core/import/elementor/atomic.ts +1595 -0
- package/src/core/import/elementor/classes.ts +127 -0
- package/src/core/import/elementor/context.ts +429 -0
- package/src/core/import/elementor/counter-steps.ts +72 -0
- package/src/core/import/elementor/css.ts +445 -0
- package/src/core/import/elementor/html.ts +500 -0
- package/src/core/import/elementor/index.ts +949 -0
- package/src/core/import/elementor/inline-marks.ts +81 -0
- package/src/core/import/elementor/snapshots.ts +48 -0
- package/src/core/import/elementor/style.ts +409 -0
- package/src/core/import/elementor/values.ts +241 -0
- package/src/core/import/elementor/widgets.ts +1897 -0
- package/src/core/index.ts +84 -0
- package/src/core/json-schema.ts +107 -0
- package/src/core/limits.ts +19 -0
- package/src/core/migrate/index.ts +6 -1
- package/src/core/migrate/v18.ts +222 -0
- package/src/core/perf/meter.ts +5 -5
- package/src/core/portable-text.ts +127 -0
- package/src/core/proposals-safety.ts +102 -0
- package/src/core/proposals.ts +357 -0
- package/src/core/recipes/index.ts +2 -2
- package/src/core/render/extras.ts +3 -3
- package/src/core/render/index.ts +140 -20
- package/src/core/render/loop.ts +1 -1
- package/src/core/render/pagination.ts +20 -1
- package/src/core/render/section.ts +4 -4
- package/src/core/render/vnode.ts +1 -1
- package/src/core/sanitize/css.ts +125 -10
- package/src/core/sanitize/motion.ts +116 -0
- package/src/core/saved-sections.ts +6 -0
- package/src/core/schema/descriptors.ts +3 -1
- package/src/core/schema/design.ts +2 -1
- package/src/core/schema/layout.ts +87 -14
- package/src/core/schema/style.ts +251 -114
- package/src/core/text-marks.ts +227 -0
- package/src/core/theme/dynamic.ts +9 -4
- package/src/core/theme/float.ts +1 -0
- package/src/core/theme/pagination.ts +9 -0
- package/src/core/theme/popup-rules.ts +17 -1
- package/src/core/translatable.ts +34 -0
- package/src/core/validate.ts +13 -1
- package/src/index.ts +35 -1
- package/src/mcp/errors.ts +3 -1
- package/src/mcp/ports.ts +67 -0
- package/src/mcp/prompts.ts +1 -11
- package/src/mcp/proposals.ts +281 -0
- package/src/mcp/read.ts +10 -9
- package/src/mcp/tools.ts +71 -3
- package/src/mcp/write.ts +66 -11
- package/src/server/agent-settings.ts +21 -2
- package/src/server/hooks.ts +81 -0
- package/src/server/mcp-routes.ts +15 -0
- package/src/server/plugin.ts +53 -5
- package/src/server/presence.ts +78 -0
- package/src/server/proposals.ts +261 -0
- package/src/server/requests.ts +196 -0
- package/src/server/tools-served.ts +45 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { LIST_MARKERS } from "../css-keywords.ts";
|
|
2
3
|
import { MAX_TEXT_LENGTH } from "../limits.ts";
|
|
3
4
|
import { ImageEdit } from "../image-edit/schema.ts";
|
|
4
|
-
import { DeviceStyles, HiddenOn, Length, StyleProps, StyleStates } from "./style.ts";
|
|
5
|
+
import { ColorValue, DeviceStyles, HiddenOn, Length, StyleProps, StyleStates } from "./style.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* 16 since W-481 (D-061): an optional editor-only `edit` record on images (image editor).
|
|
@@ -15,9 +16,19 @@ import { DeviceStyles, HiddenOn, Length, StyleProps, StyleStates } from "./style
|
|
|
15
16
|
* Loop's Empty state element. Every other value is unchanged.
|
|
16
17
|
* 12 since W-160: gradient type, stop locations, and up to 10 stops. v11 gradients
|
|
17
18
|
* (`{ angle, from, to }`) become a linear gradient on read.
|
|
19
|
+
* 18 since W-925 (D-065, contract 1.0): the Section reference node is `part-ref`, a node's
|
|
20
|
+
* editor name is `editorLabel`, a Loop's template part is `partId`, and the four motion style
|
|
21
|
+
* keys sit under one `motion` record. Older documents are rewritten on read.
|
|
18
22
|
* 11 since W-156 and W-157 (D-045): the layout Section element and an editor-only node label.
|
|
19
23
|
*/
|
|
20
|
-
export const LAYOUT_SCHEMA_VERSION =
|
|
24
|
+
export const LAYOUT_SCHEMA_VERSION = 18;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The frozen document contract (W-925, D-065). Within 1.x a new optional key may appear
|
|
28
|
+
* without a schemaVersion bump, and readers keep keys they do not know; a rename or a removal
|
|
29
|
+
* needs 2.0. `schemaVersion` stays a plain number for the migration chain.
|
|
30
|
+
*/
|
|
31
|
+
export const CONTRACT_VERSION = "1.0";
|
|
21
32
|
|
|
22
33
|
export const NodeId = z
|
|
23
34
|
.string()
|
|
@@ -163,7 +174,8 @@ const sharedNodeFields = {
|
|
|
163
174
|
classes: ClassIds.optional(),
|
|
164
175
|
htmlId: HtmlId.optional(),
|
|
165
176
|
attributes: HtmlAttributes.optional(),
|
|
166
|
-
label
|
|
177
|
+
/** The name shown in the editor's Navigator (was `label` before schema 18). Never rendered. */
|
|
178
|
+
editorLabel: NodeLabel.optional(),
|
|
167
179
|
bind: Bindings.optional(),
|
|
168
180
|
variant: Variant.optional(),
|
|
169
181
|
audience: Audience.optional(),
|
|
@@ -202,6 +214,26 @@ const parentNode = <T extends string, P extends z.ZodType>(type: T, props: P) =>
|
|
|
202
214
|
},
|
|
203
215
|
});
|
|
204
216
|
|
|
217
|
+
/** W-950: at most this many formatted ranges in one Heading or Text. */
|
|
218
|
+
export const MAX_TEXT_MARKS = 100;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* W-950: formatting on part of a Heading's or Text's words: characters `start` to `end` (end not
|
|
222
|
+
* included) are bold, italic, in a colour and/or a link. The text stays plain; ranges past its
|
|
223
|
+
* end are clipped when the page is drawn, so changing the text never makes a page invalid.
|
|
224
|
+
*/
|
|
225
|
+
export const TextMark = z.strictObject({
|
|
226
|
+
start: z.number().int().min(0).max(MAX_TEXT_LENGTH),
|
|
227
|
+
end: z.number().int().min(1).max(MAX_TEXT_LENGTH),
|
|
228
|
+
bold: z.literal(true).optional(),
|
|
229
|
+
italic: z.literal(true).optional(),
|
|
230
|
+
color: ColorValue.optional(),
|
|
231
|
+
href: z.string().min(1).max(2000).optional(),
|
|
232
|
+
newTab: z.literal(true).optional(),
|
|
233
|
+
});
|
|
234
|
+
export type TextMark = z.infer<typeof TextMark>;
|
|
235
|
+
const TextMarks = z.array(TextMark).max(MAX_TEXT_MARKS);
|
|
236
|
+
|
|
205
237
|
export const HeadingNode = leafNode(
|
|
206
238
|
"heading",
|
|
207
239
|
z.strictObject({
|
|
@@ -210,6 +242,8 @@ export const HeadingNode = leafNode(
|
|
|
210
242
|
/** Optional link around the text (W-141), like Elementor's Heading link. */
|
|
211
243
|
href: z.string().max(2000).optional(),
|
|
212
244
|
newTab: z.boolean().optional(),
|
|
245
|
+
/** W-950: bold, italic, colour and links on part of the text (links only when unlinked). */
|
|
246
|
+
marks: TextMarks.optional(),
|
|
213
247
|
}),
|
|
214
248
|
);
|
|
215
249
|
|
|
@@ -227,6 +261,8 @@ export const TextNode = leafNode(
|
|
|
227
261
|
z.strictObject({
|
|
228
262
|
text: z.string().max(MAX_TEXT_LENGTH),
|
|
229
263
|
tag: z.enum(TEXT_TAGS).optional(),
|
|
264
|
+
/** W-950: bold, italic, colour and links on part of the text. */
|
|
265
|
+
marks: TextMarks.optional(),
|
|
230
266
|
}),
|
|
231
267
|
);
|
|
232
268
|
|
|
@@ -265,6 +301,10 @@ export const ListNode = leafNode(
|
|
|
265
301
|
"list",
|
|
266
302
|
z.strictObject({
|
|
267
303
|
ordered: z.boolean().optional(),
|
|
304
|
+
/** W-952: the marker style; a number style or `steps` makes the list numbered. */
|
|
305
|
+
marker: z.enum(LIST_MARKERS).optional(),
|
|
306
|
+
/** W-952: the first number of a numbered list. */
|
|
307
|
+
start: z.number().int().min(1).max(9999).optional(),
|
|
268
308
|
items: z.array(z.string().max(MAX_TEXT_LENGTH)).max(200),
|
|
269
309
|
}),
|
|
270
310
|
);
|
|
@@ -560,7 +600,7 @@ export const PostLinkNode = leafNode(
|
|
|
560
600
|
|
|
561
601
|
/**
|
|
562
602
|
* Repeats its item template for each post in ThemeDynamicData.posts.
|
|
563
|
-
* When `
|
|
603
|
+
* When `partId` is set, the host supplies that Loop Item layout in loopTemplates;
|
|
564
604
|
* otherwise children are the inline item template.
|
|
565
605
|
*/
|
|
566
606
|
/** How a Loop lays out its items (W-308): one design, shown as a list, a grid or cards. */
|
|
@@ -584,7 +624,7 @@ export const LOOP_ORDERS = ["newest", "oldest", "title"] as const;
|
|
|
584
624
|
export const LoopNode = parentNode(
|
|
585
625
|
"loop",
|
|
586
626
|
z.strictObject({
|
|
587
|
-
|
|
627
|
+
partId: z.string().max(128).optional(),
|
|
588
628
|
/** Posts per archive page, 1–50 (W-221). Unset = 20. */
|
|
589
629
|
perPage: z.number().int().min(1).max(50).optional(),
|
|
590
630
|
/**
|
|
@@ -645,6 +685,11 @@ export const PaginationNode = leafNode(
|
|
|
645
685
|
showCount: z.boolean().optional(),
|
|
646
686
|
/** The count's text; `{page}` and `{total}` are filled in. Unset = "Page {page} of {total}". */
|
|
647
687
|
countText: z.string().max(60).optional(),
|
|
688
|
+
/** W-916: a link to the last page, shown when the host knows the total. */
|
|
689
|
+
showLast: z.boolean().optional(),
|
|
690
|
+
lastText: z.string().max(40).optional(),
|
|
691
|
+
/** The Last link's name when its text is only an arrow. Unset = "Last page". */
|
|
692
|
+
lastLabel: z.string().max(60).optional(),
|
|
648
693
|
/**
|
|
649
694
|
* The page title of archive page 2 onward (W-529); `{title}` and `{page}` are filled in.
|
|
650
695
|
* Unset = "{title} – page {page}". Hosts read it with `archivePageTitle`.
|
|
@@ -666,7 +711,7 @@ export const PaginationNode = leafNode(
|
|
|
666
711
|
* `sectionTemplates` and the part's children render in place of `children`.
|
|
667
712
|
*/
|
|
668
713
|
export const SectionNode = parentNode(
|
|
669
|
-
"
|
|
714
|
+
"part-ref",
|
|
670
715
|
z.strictObject({
|
|
671
716
|
partId: z.string().max(128).optional(),
|
|
672
717
|
}),
|
|
@@ -703,7 +748,7 @@ export const KNOWN_ELEMENT_TYPES = [
|
|
|
703
748
|
"loop",
|
|
704
749
|
"loop-empty",
|
|
705
750
|
"pagination",
|
|
706
|
-
"
|
|
751
|
+
"part-ref",
|
|
707
752
|
"div-block",
|
|
708
753
|
"flexbox",
|
|
709
754
|
"grid",
|
|
@@ -716,6 +761,7 @@ export const KNOWN_ELEMENT_TYPES = [
|
|
|
716
761
|
"menu-item",
|
|
717
762
|
"layout-section",
|
|
718
763
|
"toc",
|
|
764
|
+
"language-switcher",
|
|
719
765
|
] as const;
|
|
720
766
|
|
|
721
767
|
/** Headings on this page, as a list of links. No script (W-345). */
|
|
@@ -726,6 +772,17 @@ export const TocNode = leafNode(
|
|
|
726
772
|
}),
|
|
727
773
|
);
|
|
728
774
|
|
|
775
|
+
/**
|
|
776
|
+
* W-937: links to this page in its other published languages (EmDash translations), each with
|
|
777
|
+
* hreflang. `label` names the navigation for screen readers. The host fills the links.
|
|
778
|
+
*/
|
|
779
|
+
export const LanguageSwitcherNode = leafNode(
|
|
780
|
+
"language-switcher",
|
|
781
|
+
z.strictObject({
|
|
782
|
+
label: z.string().max(80).optional(),
|
|
783
|
+
}),
|
|
784
|
+
);
|
|
785
|
+
|
|
729
786
|
const knownTypeSet = new Set<string>(KNOWN_ELEMENT_TYPES);
|
|
730
787
|
|
|
731
788
|
/**
|
|
@@ -737,7 +794,8 @@ const UnknownNodeSchema = z.strictObject({
|
|
|
737
794
|
type: z
|
|
738
795
|
.string()
|
|
739
796
|
.min(1)
|
|
740
|
-
.
|
|
797
|
+
// W-927: extension types are ext:<pkg>/<name>; 128 fits the longest allowed id.
|
|
798
|
+
.max(128)
|
|
741
799
|
.refine((value) => !knownTypeSet.has(value), "Unknown element type"),
|
|
742
800
|
props: z.record(z.string(), z.unknown()),
|
|
743
801
|
...sharedNodeFields,
|
|
@@ -757,6 +815,7 @@ const KnownLayoutNode = z.discriminatedUnion("type", [
|
|
|
757
815
|
TabPanelNode,
|
|
758
816
|
HeadingNode,
|
|
759
817
|
TocNode,
|
|
818
|
+
LanguageSwitcherNode,
|
|
760
819
|
SpacerNode,
|
|
761
820
|
DividerNode,
|
|
762
821
|
TextNode,
|
|
@@ -796,6 +855,7 @@ export const KNOWN_NODE_SCHEMAS = KnownLayoutNode.options;
|
|
|
796
855
|
|
|
797
856
|
export type HeadingNode = z.infer<typeof HeadingNode>;
|
|
798
857
|
export type TocNode = z.infer<typeof TocNode>;
|
|
858
|
+
export type LanguageSwitcherNode = z.infer<typeof LanguageSwitcherNode>;
|
|
799
859
|
export type SpacerNode = z.infer<typeof SpacerNode>;
|
|
800
860
|
export type DividerNode = z.infer<typeof DividerNode>;
|
|
801
861
|
export type TextNode = z.infer<typeof TextNode>;
|
|
@@ -850,7 +910,7 @@ type NodeEnvelope = {
|
|
|
850
910
|
classes?: ClassesOf;
|
|
851
911
|
htmlId?: HtmlIdOf;
|
|
852
912
|
attributes?: HtmlAttributeOf[];
|
|
853
|
-
|
|
913
|
+
editorLabel?: string;
|
|
854
914
|
} & NodeExtras;
|
|
855
915
|
|
|
856
916
|
/** Manual recursive types so UnknownNode does not poison `z.infer` of the tree. */
|
|
@@ -932,7 +992,7 @@ export type FormNode = NodeEnvelope & {
|
|
|
932
992
|
export type LoopNode = NodeEnvelope & {
|
|
933
993
|
type: "loop";
|
|
934
994
|
props: {
|
|
935
|
-
|
|
995
|
+
partId?: string;
|
|
936
996
|
perPage?: number;
|
|
937
997
|
collection?: string;
|
|
938
998
|
limit?: number;
|
|
@@ -950,7 +1010,7 @@ export type LoopEmptyNode = NodeEnvelope & {
|
|
|
950
1010
|
};
|
|
951
1011
|
|
|
952
1012
|
export type SectionNode = NodeEnvelope & {
|
|
953
|
-
type: "
|
|
1013
|
+
type: "part-ref";
|
|
954
1014
|
props: { partId?: string };
|
|
955
1015
|
children: LayoutNode[];
|
|
956
1016
|
};
|
|
@@ -994,6 +1054,7 @@ export type LayoutNode =
|
|
|
994
1054
|
| SectionNode
|
|
995
1055
|
| HeadingNode
|
|
996
1056
|
| TocNode
|
|
1057
|
+
| LanguageSwitcherNode
|
|
997
1058
|
| SpacerNode
|
|
998
1059
|
| DividerNode
|
|
999
1060
|
| TextNode
|
|
@@ -1076,7 +1137,19 @@ export const isFormNode = (node: LayoutNode): node is FormNode => node.type ===
|
|
|
1076
1137
|
|
|
1077
1138
|
export const isLoopNode = (node: LayoutNode): node is LoopNode => node.type === "loop";
|
|
1078
1139
|
|
|
1079
|
-
|
|
1140
|
+
/**
|
|
1141
|
+
* The class name an element type renders with (`emvb-<name>`). A Section reference became
|
|
1142
|
+
* `part-ref` in schema 18 (W-925) but keeps its public class `emvb-section`, so site CSS and
|
|
1143
|
+
* the rendered output are unchanged.
|
|
1144
|
+
*/
|
|
1145
|
+
export const cssTypeName = (type: string): string => {
|
|
1146
|
+
if (type === "part-ref") return "section";
|
|
1147
|
+
// W-927: every extension element shares the emvb-ext class (type holds : and /).
|
|
1148
|
+
if (type.startsWith("ext:")) return "ext";
|
|
1149
|
+
return type;
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
export const isSectionNode = (node: LayoutNode): node is SectionNode => node.type === "part-ref";
|
|
1080
1153
|
|
|
1081
1154
|
export const isDivBlockNode = (node: LayoutNode): node is DivBlockNode => node.type === "div-block";
|
|
1082
1155
|
|
|
@@ -1107,7 +1180,7 @@ export const isLayoutParentNode = (
|
|
|
1107
1180
|
node.type === "flexbox" ||
|
|
1108
1181
|
node.type === "grid" ||
|
|
1109
1182
|
node.type === "tab-panel" ||
|
|
1110
|
-
node.type === "
|
|
1183
|
+
node.type === "part-ref" ||
|
|
1111
1184
|
node.type === "loop-empty" ||
|
|
1112
1185
|
node.type === "accordion-item" ||
|
|
1113
1186
|
node.type === "menu-item";
|
|
@@ -1139,7 +1212,7 @@ export const isParentNode = (
|
|
|
1139
1212
|
node.type === "form" ||
|
|
1140
1213
|
node.type === "loop" ||
|
|
1141
1214
|
node.type === "loop-empty" ||
|
|
1142
|
-
node.type === "
|
|
1215
|
+
node.type === "part-ref" ||
|
|
1143
1216
|
node.type === "tabs" ||
|
|
1144
1217
|
node.type === "tab-panel" ||
|
|
1145
1218
|
node.type === "accordion" ||
|