@charisol/plexo-sdk 1.4.42 → 2.0.1
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 +72 -0
- package/dist/InlineColorPicker-8ewm1Asx.js +2912 -0
- package/dist/client-DlVJt_6V.js +339 -0
- package/dist/colorUtils-ohNG3v1i.js +222 -0
- package/dist/columnOrder-f5-VOg2T.js +11 -0
- package/dist/{compiler-BvseEhDC.js → compiler-Dhpsq71h.js} +121 -120
- package/dist/compiler.js +1 -1
- package/dist/{compilerClient-BIrZIgfG.js → compilerClient-BC4TGAr9.js} +93 -92
- package/dist/compilerClient.js +1 -1
- package/dist/{iconSvgStatic-CGue7nyp.js → iconSvgStatic-Lnpg27U9.js} +66 -75
- package/dist/index.js +14042 -15423
- package/dist/legacy-71dHsiAM.js +16088 -0
- package/dist/lint-D-2x-Yeb.js +225 -0
- package/dist/{mjmlBrowser-DWk0mRD6.js → mjmlBrowser-wlHcAT8n.js} +2 -2
- package/dist/plexo-sdk.css +1 -1
- package/dist/rolldown-runtime-B1bRi_D7.js +27 -0
- package/dist/sanitize.js +1 -1
- package/dist/{sanitizeCompiledHtml-CNjUXlMK.js → sanitizeCompiledHtml-GgGsetm3.js} +673 -698
- package/dist/{zoom-in-DL4pfiLG.js → schemas-Bq5o5MfF.js} +916 -2120
- package/dist/utilities/colorUtils.d.ts +35 -0
- package/dist/utilities/playground.interfaces.d.ts +19 -1
- package/dist/v2/V2Editor.d.ts +25 -0
- package/dist/v2/compile/build.d.ts +38 -0
- package/dist/v2/compile/html.d.ts +18 -0
- package/dist/v2/compile/index.d.ts +28 -15
- package/dist/v2/compile/react.d.ts +17 -0
- package/dist/v2/compile/schema.d.ts +16 -0
- package/dist/v2/components/canvas/AlignmentGuidesOverlay.d.ts +7 -0
- package/dist/v2/components/canvas/CanvasArea.d.ts +2 -0
- package/dist/v2/components/canvas/CanvasControls.d.ts +2 -0
- package/dist/v2/components/canvas/ContextualToolbar.d.ts +7 -0
- package/dist/v2/components/canvas/DropIndicator.d.ts +6 -0
- package/dist/v2/components/canvas/IrView.d.ts +12 -0
- package/dist/v2/components/canvas/NodeRenderer.d.ts +12 -0
- package/dist/v2/components/canvas/PageFrame.d.ts +9 -0
- package/dist/v2/components/canvas/ResizeHandles.d.ts +8 -0
- package/dist/v2/components/canvas/SectionToolbar.d.ts +6 -0
- package/dist/v2/components/canvas/SpacingOverlay.d.ts +7 -0
- package/dist/v2/components/design/AutoUpdateWatcher.d.ts +7 -0
- package/dist/v2/components/design/DesignSystemPanel.d.ts +7 -0
- package/dist/v2/components/design/ReviewView.d.ts +7 -0
- package/dist/v2/components/design/StrataCard.d.ts +8 -0
- package/dist/v2/components/design/TidyView.d.ts +15 -0
- package/dist/v2/components/design/bits.d.ts +20 -0
- package/dist/v2/components/design/useStrataSync.d.ts +51 -0
- package/dist/v2/components/layout/ContextMenu.d.ts +2 -0
- package/dist/v2/components/layout/EditorShell.d.ts +2 -0
- package/dist/v2/components/layout/LeftToolRail.d.ts +2 -0
- package/dist/v2/components/layout/PreviewOverlay.d.ts +6 -0
- package/dist/v2/components/layout/TopToolbar.d.ts +2 -0
- package/dist/v2/components/modals/SettingsModal.d.ts +7 -0
- package/dist/v2/components/modals/ShortcutsModal.d.ts +7 -0
- package/dist/v2/components/properties/ColorField.d.ts +14 -0
- package/dist/v2/components/properties/ElementSettings.d.ts +39 -0
- package/dist/v2/components/properties/LinkField.d.ts +26 -0
- package/dist/v2/components/properties/PageInspector.d.ts +2 -0
- package/dist/v2/components/properties/PropertiesPanel.d.ts +2 -0
- package/dist/v2/components/properties/SectionSettings.d.ts +6 -0
- package/dist/v2/components/properties/sections/ConstraintsSection.d.ts +7 -0
- package/dist/v2/components/properties/sections/LayoutDiagnostics.d.ts +7 -0
- package/dist/v2/components/sections/BlockInspector.d.ts +9 -0
- package/dist/v2/components/sections/FieldForm.d.ts +14 -0
- package/dist/v2/components/sections/ManagedChildNotice.d.ts +7 -0
- package/dist/v2/components/sections/SectionThumb.d.ts +11 -0
- package/dist/v2/components/sidebar/FlyoutDrawer.d.ts +2 -0
- package/dist/v2/components/sidebar/InsertPanel.d.ts +2 -0
- package/dist/v2/components/sidebar/LayersPanel.d.ts +2 -0
- package/dist/v2/components/sidebar/LibraryPanel.d.ts +3 -0
- package/dist/v2/components/sidebar/PagesPanel.d.ts +2 -0
- package/dist/v2/components/sidebar/SectionsPanel.d.ts +6 -0
- package/dist/v2/components/sidebar/SolPanel.d.ts +3 -0
- package/dist/v2/components/sidebar/TemplateChooser.d.ts +13 -0
- package/dist/v2/context/BlockContext.d.ts +7 -0
- package/dist/v2/context/EditorContext.d.ts +213 -0
- package/dist/v2/context/FrameContext.d.ts +3 -0
- package/dist/v2/context/ParentLayoutContext.d.ts +10 -0
- package/dist/v2/context/PlacementContext.d.ts +4 -0
- package/dist/v2/data/blankPage.d.ts +3 -0
- package/dist/v2/data/insertableComponents.d.ts +17 -0
- package/dist/v2/data/samplePageData.d.ts +3 -0
- package/dist/v2/design/audit.d.ts +78 -0
- package/dist/v2/design/baseline.d.ts +3 -0
- package/dist/v2/design/baselineData.d.ts +3 -0
- package/dist/v2/design/components.d.ts +9 -0
- package/dist/v2/design/css.d.ts +16 -0
- package/dist/v2/design/fonts.d.ts +10 -0
- package/dist/v2/design/index.d.ts +11 -0
- package/dist/v2/design/lint.d.ts +22 -0
- package/dist/v2/design/shades.d.ts +15 -0
- package/dist/v2/design/textStyles.d.ts +29 -0
- package/dist/v2/design/themes.d.ts +35 -0
- package/dist/v2/design/tokens.d.ts +24 -0
- package/dist/v2/design/types.d.ts +81 -0
- package/dist/v2/host/HostContext.d.ts +176 -0
- package/dist/v2/host/SolMark.d.ts +8 -0
- package/dist/v2/index.d.ts +19 -11
- package/dist/v2/migrate/legacy.d.ts +26 -0
- package/dist/v2/render/adapt.d.ts +12 -0
- package/dist/v2/render/anchors.d.ts +7 -0
- package/dist/v2/render/elementCss.d.ts +7 -0
- package/dist/v2/render/elementProps.d.ts +92 -0
- package/dist/v2/render/elements.d.ts +32 -0
- package/dist/v2/render/formAction.d.ts +33 -0
- package/dist/v2/render/frames.d.ts +10 -0
- package/dist/v2/render/iconSet.d.ts +5 -0
- package/dist/v2/render/ir.d.ts +20 -0
- package/dist/v2/render/nodeStyle.d.ts +24 -0
- package/dist/v2/render/placement.d.ts +12 -0
- package/dist/v2/render/resolve.d.ts +3 -0
- package/dist/v2/render/runtime.d.ts +18 -0
- package/dist/v2/render/sanitize.d.ts +15 -0
- package/dist/v2/render/socialIcons.d.ts +83 -0
- package/dist/v2/sections/catalog/about.d.ts +2 -0
- package/dist/v2/sections/catalog/announcement.d.ts +2 -0
- package/dist/v2/sections/catalog/contact.d.ts +2 -0
- package/dist/v2/sections/catalog/cta.d.ts +2 -0
- package/dist/v2/sections/catalog/faq.d.ts +2 -0
- package/dist/v2/sections/catalog/features.d.ts +2 -0
- package/dist/v2/sections/catalog/footer.d.ts +5 -0
- package/dist/v2/sections/catalog/gallery.d.ts +2 -0
- package/dist/v2/sections/catalog/header.d.ts +2 -0
- package/dist/v2/sections/catalog/hero.d.ts +2 -0
- package/dist/v2/sections/catalog/logos.d.ts +2 -0
- package/dist/v2/sections/catalog/pricing.d.ts +2 -0
- package/dist/v2/sections/catalog/stats.d.ts +2 -0
- package/dist/v2/sections/catalog/steps.d.ts +2 -0
- package/dist/v2/sections/catalog/team.d.ts +2 -0
- package/dist/v2/sections/catalog/testimonials.d.ts +2 -0
- package/dist/v2/sections/catalog/video.d.ts +2 -0
- package/dist/v2/sections/kit.d.ts +64 -0
- package/dist/v2/sections/materialize.d.ts +72 -0
- package/dist/v2/sections/pageTemplates.d.ts +52 -0
- package/dist/v2/sections/registry.d.ts +5 -0
- package/dist/v2/sections/types.d.ts +103 -0
- package/dist/v2/sol/catalogSchema.d.ts +43 -0
- package/dist/v2/sol/commands.d.ts +21 -0
- package/dist/v2/sol/describe.d.ts +32 -0
- package/dist/v2/sol/index.d.ts +7 -0
- package/dist/v2/sol/parse.d.ts +10 -0
- package/dist/v2/sol/prompt.d.ts +5 -0
- package/dist/v2/sol/schema.d.ts +177 -0
- package/dist/v2/sol/summarize.d.ts +4 -0
- package/dist/v2/strata/autoUpdate.d.ts +37 -0
- package/dist/v2/strata/client.d.ts +38 -0
- package/dist/v2/strata/index.d.ts +8 -0
- package/dist/v2/strata/merge.d.ts +27 -0
- package/dist/v2/strata/types.d.ts +115 -0
- package/dist/v2/types/editor.d.ts +175 -0
- package/dist/v2/utils/css.d.ts +3 -0
- package/dist/v2/utils/id.d.ts +3 -0
- package/dist/v2-compile.js +138 -7
- package/dist/v2-strata.js +2 -0
- package/dist/v2.js +10993 -8186
- package/package.json +6 -1
- package/dist/toReact-BBzjWoFG.js +0 -595
- package/dist/v2/ai/commands.d.ts +0 -616
- package/dist/v2/ai/dispatch.d.ts +0 -24
- package/dist/v2/ai/nodeSchema.d.ts +0 -196
- package/dist/v2/brand/BrandColorSwatches.d.ts +0 -4
- package/dist/v2/brand/BrandPanel.d.ts +0 -4
- package/dist/v2/brand/ChangeSetGallery.d.ts +0 -10
- package/dist/v2/brand/StyleSetEditor.d.ts +0 -22
- package/dist/v2/canvas/CatalogDragContext.d.ts +0 -27
- package/dist/v2/canvas/ContextMenuContext.d.ts +0 -16
- package/dist/v2/canvas/DeviceModeContext.d.ts +0 -20
- package/dist/v2/canvas/DragEngineContext.d.ts +0 -13
- package/dist/v2/canvas/LayoutGuideContext.d.ts +0 -22
- package/dist/v2/canvas/PreviewModeContext.d.ts +0 -15
- package/dist/v2/canvas/SidebarContext.d.ts +0 -21
- package/dist/v2/canvas/StylePainterContext.d.ts +0 -19
- package/dist/v2/canvas/WorkspaceThemeContext.d.ts +0 -19
- package/dist/v2/canvas/aiTextTransforms.d.ts +0 -24
- package/dist/v2/canvas/animationPresets.d.ts +0 -12
- package/dist/v2/canvas/constants.d.ts +0 -6
- package/dist/v2/canvas/layoutRoles.d.ts +0 -12
- package/dist/v2/canvas/modelRect.d.ts +0 -4
- package/dist/v2/canvas/rectMath.d.ts +0 -34
- package/dist/v2/canvas/reorderMath.d.ts +0 -8
- package/dist/v2/canvas/resizeMath.d.ts +0 -16
- package/dist/v2/canvas/resolveBoxStyle.d.ts +0 -12
- package/dist/v2/canvas/resolveTargetSection.d.ts +0 -10
- package/dist/v2/canvas/sectionDividerShapes.d.ts +0 -12
- package/dist/v2/canvas/snapping.d.ts +0 -28
- package/dist/v2/canvas/useAlignNode.d.ts +0 -10
- package/dist/v2/canvas/useClipboardKeyBinding.d.ts +0 -7
- package/dist/v2/canvas/useDeleteKeyBinding.d.ts +0 -3
- package/dist/v2/canvas/useDragEngine.d.ts +0 -44
- package/dist/v2/canvas/useDraggableNode.d.ts +0 -30
- package/dist/v2/canvas/useInlineTextEdit.d.ts +0 -29
- package/dist/v2/canvas/usePointerEngine.d.ts +0 -22
- package/dist/v2/canvas/useResizeHandle.d.ts +0 -12
- package/dist/v2/canvas/useResolvedTextStyles.d.ts +0 -13
- package/dist/v2/canvas/useSelectionRects.d.ts +0 -13
- package/dist/v2/canvas/useUndoRedoKeyBinding.d.ts +0 -8
- package/dist/v2/catalog/elementCatalog.d.ts +0 -31
- package/dist/v2/catalog/imagePreset.d.ts +0 -7
- package/dist/v2/compile/toReact.d.ts +0 -32
- package/dist/v2/components/AdornmentLayer.d.ts +0 -20
- package/dist/v2/components/AskSolPanel.d.ts +0 -25
- package/dist/v2/components/CatalogDragGhost.d.ts +0 -6
- package/dist/v2/components/CellBoundary.d.ts +0 -14
- package/dist/v2/components/CenterCanvas.d.ts +0 -3
- package/dist/v2/components/ContentTabPanel.d.ts +0 -12
- package/dist/v2/components/ContextMenu.d.ts +0 -5
- package/dist/v2/components/ContextualToolbar.d.ts +0 -25
- package/dist/v2/components/ImagesTabPanel.d.ts +0 -15
- package/dist/v2/components/LayoutGuidePanel.d.ts +0 -10
- package/dist/v2/components/ManageLayersPanel.d.ts +0 -13
- package/dist/v2/components/NodeRenderer.d.ts +0 -8
- package/dist/v2/components/PreviewOverlay.d.ts +0 -11
- package/dist/v2/components/ResizeHandle.d.ts +0 -6
- package/dist/v2/components/RightRail.d.ts +0 -13
- package/dist/v2/components/SectionDividerOverlay.d.ts +0 -8
- package/dist/v2/components/SectionEdgeAddZone.d.ts +0 -17
- package/dist/v2/components/SectionGridOverlay.d.ts +0 -10
- package/dist/v2/components/SectionNamePill.d.ts +0 -6
- package/dist/v2/components/SectionNode.d.ts +0 -5
- package/dist/v2/components/SectionSideRail.d.ts +0 -17
- package/dist/v2/components/SelectionToolbar.d.ts +0 -11
- package/dist/v2/components/StylePainterToast.d.ts +0 -5
- package/dist/v2/components/V2Canvas.d.ts +0 -59
- package/dist/v2/components/nodes/ButtonNode.d.ts +0 -4
- package/dist/v2/components/nodes/ContainerNode.d.ts +0 -11
- package/dist/v2/components/nodes/EmbedNode.d.ts +0 -4
- package/dist/v2/components/nodes/ImageNode.d.ts +0 -4
- package/dist/v2/components/nodes/InputNode.d.ts +0 -4
- package/dist/v2/components/nodes/MenuNode.d.ts +0 -18
- package/dist/v2/components/nodes/TextNode.d.ts +0 -4
- package/dist/v2/inspector/AiQuickEditPanel.d.ts +0 -12
- package/dist/v2/inspector/AnimationPanel.d.ts +0 -11
- package/dist/v2/inspector/DesignAccordions.d.ts +0 -7
- package/dist/v2/inspector/FieldRenderer.d.ts +0 -9
- package/dist/v2/inspector/IconPopoverButton.d.ts +0 -9
- package/dist/v2/inspector/MenuIconPanel.d.ts +0 -7
- package/dist/v2/inspector/MenuManagePanel.d.ts +0 -8
- package/dist/v2/inspector/Popover.d.ts +0 -21
- package/dist/v2/inspector/SectionDividerPanel.d.ts +0 -9
- package/dist/v2/inspector/fieldStyles.d.ts +0 -15
- package/dist/v2/inspector/fields/ColorField.d.ts +0 -7
- package/dist/v2/inspector/fields/NumberField.d.ts +0 -7
- package/dist/v2/inspector/fields/SelectField.d.ts +0 -7
- package/dist/v2/inspector/fields/TextField.d.ts +0 -7
- package/dist/v2/inspector/fields/TextStyleField.d.ts +0 -11
- package/dist/v2/inspector/fields/TextareaField.d.ts +0 -7
- package/dist/v2/inspector/schema.d.ts +0 -25
- package/dist/v2/inspector/useFieldCommit.d.ts +0 -12
- package/dist/v2/store/brandDefaults.d.ts +0 -4
- package/dist/v2/store/brandTypes.d.ts +0 -40
- package/dist/v2/store/cloneSubtree.d.ts +0 -12
- package/dist/v2/store/createBrandStore.d.ts +0 -2
- package/dist/v2/store/createCanvasStore.d.ts +0 -2
- package/dist/v2/store/seed.d.ts +0 -17
- package/dist/v2/store/types.d.ts +0 -163
- package/dist/v2/ui/theme.d.ts +0 -85
package/dist/v2-compile.js
CHANGED
|
@@ -1,9 +1,140 @@
|
|
|
1
|
-
import { c as e,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { c as e, d as t, f as n, i as r, l as i, o as a, p as o, r as s, t as c, u as l } from "./schemas-Bq5o5MfF.js";
|
|
2
|
+
import { B as u, F as d, Gt as f, H as ee, Ht as te, I as p, L as m, P as h, R as g, V as _, Wt as v, a as y, b, ct as x, dt as S, f as C, ft as w, g as T, i as E, l as D, lt as O, n as k, o as A, ot as j, pt as M, qt as ne, r as N, st as P, t as F, ut as I, y as L, z as R } from "./legacy-71dHsiAM.js";
|
|
3
|
+
import { n as z, t as B } from "./lint-D-2x-Yeb.js";
|
|
4
|
+
//#region src/v2/compile/react.ts
|
|
5
|
+
var V = /^[A-Z][A-Za-z0-9]*$/, H = (e) => JSON.stringify(e);
|
|
6
|
+
function U(e) {
|
|
7
|
+
let t = "";
|
|
8
|
+
for (let [n, r] of Object.entries(e.attrs ?? {})) {
|
|
9
|
+
if (r === void 0 || r === !1) continue;
|
|
10
|
+
let e = b(n);
|
|
11
|
+
r === !0 ? t += ` ${e}` : typeof r == "number" ? t += ` ${e}={${r}}` : t += ` ${e}={${H(String(r))}}`;
|
|
12
|
+
}
|
|
13
|
+
return e.style && (t += ` style={${JSON.stringify(e.style)}}`), t;
|
|
14
|
+
}
|
|
15
|
+
function W(e, t) {
|
|
16
|
+
let n = " ".repeat(t);
|
|
17
|
+
if (typeof e == "string") return `${n}{${H(e)}}`;
|
|
18
|
+
let r = U(e);
|
|
19
|
+
return L.has(e.tag) || !e.children?.length ? `${n}<${e.tag}${r} />` : `${n}<${e.tag}${r}>\n${e.children.map((e) => W(e, t + 1)).join("\n")}\n${n}</${e.tag}>`;
|
|
20
|
+
}
|
|
21
|
+
function G(e) {
|
|
22
|
+
let t = e.replace(/[^A-Za-z0-9]+/g, " ").trim().split(" ").filter(Boolean).map((e) => e[0].toUpperCase() + e.slice(1)).join("");
|
|
23
|
+
return /^[A-Z]/.test(t) ? t : `Design${t}`;
|
|
24
|
+
}
|
|
25
|
+
function K(e, t) {
|
|
26
|
+
if (!V.test(t.componentName)) throw Error(`"${t.componentName}" isn't a valid component name — use PascalCase letters and numbers.`);
|
|
27
|
+
let n = y(e, t), r = t.runtime !== "none" && n.usesRuntime, i = A(n.fonts), a = "`" + n.css.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${") + "`";
|
|
28
|
+
return {
|
|
29
|
+
code: `// Generated by Plexo from a visual design. Edit it visually in the app editor's Design view
|
|
30
|
+
// (which regenerates this file), or turn it into regular code by editing here.
|
|
31
|
+
${r ? "// @ts-nocheck — the small runtime below is plain JavaScript.\nimport { useEffect, useRef } from \"react\";" : "import type { ReactElement } from \"react\";"}
|
|
32
|
+
|
|
33
|
+
const CSS = ${a};
|
|
34
|
+
${i ? `const FONTS = ${H(i)};\n` : ""}${r ? `\n/** Carousel autoplay, the live timer and in-page form sending. */\nconst plexoInit = ${T};\n` : ""}
|
|
35
|
+
export default function ${t.componentName}()${r ? "" : ": ReactElement"} {
|
|
36
|
+
${r ? " const root = useRef<HTMLDivElement>(null);\n useEffect(() => (root.current ? plexoInit(root.current) : undefined), []);\n" : ""} return (
|
|
37
|
+
<>
|
|
38
|
+
${i ? " <link rel=\"stylesheet\" href={FONTS} />\n" : ""} <style>{CSS}</style>
|
|
39
|
+
${r ? W(n.tree, 3).replace("<div", "<div ref={root}") : W(n.tree, 3)}
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
`,
|
|
44
|
+
warnings: n.warnings
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/v2/compile/schema.ts
|
|
49
|
+
var q = 5e3, J = 40, Y = [
|
|
50
|
+
"page",
|
|
51
|
+
"section",
|
|
52
|
+
"container",
|
|
53
|
+
"columns",
|
|
54
|
+
"column",
|
|
55
|
+
"heading",
|
|
56
|
+
"paragraph",
|
|
57
|
+
"button",
|
|
58
|
+
"image",
|
|
59
|
+
"badge",
|
|
60
|
+
"divider",
|
|
61
|
+
"spacer",
|
|
62
|
+
"card",
|
|
63
|
+
"icon",
|
|
64
|
+
"carousel",
|
|
65
|
+
"video",
|
|
66
|
+
"social",
|
|
67
|
+
"menu",
|
|
68
|
+
"html",
|
|
69
|
+
"table",
|
|
70
|
+
"timer",
|
|
71
|
+
"form",
|
|
72
|
+
"accordion"
|
|
73
|
+
], X = n([
|
|
74
|
+
t().max(2e3),
|
|
75
|
+
e(),
|
|
76
|
+
r()
|
|
77
|
+
]), Z = l(t(), X.optional()), Q = a(() => i({
|
|
78
|
+
id: t().min(1).max(200),
|
|
79
|
+
type: c(Y),
|
|
80
|
+
name: t().max(300),
|
|
81
|
+
content: t().max(1e5).optional(),
|
|
82
|
+
props: l(t(), o()).optional(),
|
|
83
|
+
styles: Z,
|
|
84
|
+
responsive: i({
|
|
85
|
+
tablet: Z.optional(),
|
|
86
|
+
mobile: Z.optional()
|
|
87
|
+
}).optional(),
|
|
88
|
+
responsiveVisibility: i({
|
|
89
|
+
hideOnDesktop: r().optional(),
|
|
90
|
+
hideOnTablet: r().optional(),
|
|
91
|
+
hideOnMobile: r().optional()
|
|
92
|
+
}).optional(),
|
|
93
|
+
children: s(Q).optional(),
|
|
94
|
+
locked: r().optional(),
|
|
95
|
+
hidden: r().optional()
|
|
96
|
+
})), re = i({
|
|
97
|
+
id: t().min(1).max(200),
|
|
98
|
+
name: t().max(300),
|
|
99
|
+
slug: t().max(300),
|
|
100
|
+
isHome: r().optional(),
|
|
101
|
+
rootNode: Q
|
|
102
|
+
});
|
|
103
|
+
function $(e, t, n) {
|
|
104
|
+
if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${q} elements).`;
|
|
105
|
+
if (t > 40) return "This design is nested too deeply.";
|
|
106
|
+
if (n.ids.has(e.id)) return `Two elements share the same id ("${e.id}"). Each element needs its own.`;
|
|
107
|
+
n.ids.add(e.id);
|
|
108
|
+
for (let r of e.children ?? []) {
|
|
109
|
+
let e = $(r, t + 1, n);
|
|
110
|
+
if (e) return e;
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
function ie(e) {
|
|
115
|
+
let t = s(re).min(1, "A design needs at least one page.").safeParse(e);
|
|
116
|
+
if (!t.success) {
|
|
117
|
+
let e = t.error.issues[0], n = e.path.length ? ` (at ${e.path.filter((e) => typeof e == "string" && e !== "children" && e !== "rootNode").join(" › ") || "the design"})` : "";
|
|
118
|
+
return {
|
|
119
|
+
ok: !1,
|
|
120
|
+
error: `This design can't be opened: ${e.message}${n}.`
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
let n = t.data;
|
|
124
|
+
for (let e of n) {
|
|
125
|
+
let t = $(e.rootNode, 0, {
|
|
126
|
+
n: 0,
|
|
127
|
+
ids: /* @__PURE__ */ new Set()
|
|
128
|
+
});
|
|
129
|
+
if (t) return {
|
|
130
|
+
ok: !1,
|
|
131
|
+
error: t
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
ok: !0,
|
|
136
|
+
pages: n
|
|
137
|
+
};
|
|
7
138
|
}
|
|
8
139
|
//#endregion
|
|
9
|
-
export {
|
|
140
|
+
export { v as FRAME_WIDTH, J as MAX_DEPTH, q as MAX_NODES, f as MEDIA_QUERY, P as PAGE_TEMPLATES, h as SOL_SYSTEM_PROMPT, m as applyCommands, u as blankPages, x as buildPageFromTemplate, O as buildTemplateSections, j as catalogSchema, N as compilePageToHtml, K as compilePageToReact, G as componentNameFor, te as computePlacements, F as convertLegacyDesign, ne as createDefaultDesignSystem, d as describeCommand, _ as describeDesign, ee as describeSection, I as getPageTemplate, k as isLegacyDesign, S as isPageEmpty, B as lintDesignSystem, w as listPageTemplates, ie as parsePages, p as parseSolReply, C as parseVideoUrl, E as printHtml, z as repairDesignSystem, D as resolveFormDestination, g as setPageTemplateResolver, R as solCommandSchema, M as templateSeed };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./client-DlVJt_6V.js";
|
|
2
|
+
export { l as StrataError, c as applySync, t as baseOf, a as componentFromStrata, s as createStrataClient, i as hasAnything, o as planAutoUpdate, u as planSync, r as projectFromStrata, n as summarize, e as tokenFromStrata };
|