@charisol/plexo-sdk 2.0.17 → 2.0.19

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.
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { type DocumentNode } from '../../types/editor';
3
3
  interface ContextualToolbarProps {
4
+ /** Sit inside the top of the element instead of above it (when above would cover the section that is there). */
5
+ inside?: boolean;
4
6
  node: DocumentNode;
5
7
  }
6
8
  export declare const ContextualToolbar: React.FC<ContextualToolbarProps>;
@@ -1,6 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { DocumentNode } from '../../types/editor';
3
- /** The small bar above a selected ready-made section: what it is, and the things people do to a whole section. */
3
+ /**
4
+ * The small bar over a selected ready-made section: what it is, and the things people do to a whole section. It sits above the section,
5
+ * except when there is another section right above (a slim header, say), where it would cover that one: then it sits inside the top of this one.
6
+ */
4
7
  export declare const SectionToolbar: React.FC<{
5
8
  section: DocumentNode;
9
+ inside?: boolean;
6
10
  }>;
@@ -0,0 +1,7 @@
1
+ import type { PageDefinition } from '../types/editor';
2
+ /**
3
+ * Pages saved by an earlier version could hold a ready-made section that went from the empty canvas back onto the page still carrying its
4
+ * canvas position, which pulled it out of the page's flow (it showed in the layers but not on the page). This puts such a section back in
5
+ * the flow. Returns the same page when nothing needed fixing, so it is free to call on every load.
6
+ */
7
+ export declare function healPage(page: PageDefinition): PageDefinition;
@@ -77,3 +77,11 @@ export declare function replaceNodeById(root: DocumentNode, id: string, next: Do
77
77
  * Returns the new tree (the same one if nothing changes).
78
78
  */
79
79
  export declare function setHeadingLevel(root: DocumentNode, nodeId: string, level: number): DocumentNode;
80
+ /** True when a ready-made section carries a canvas position (x/y, absolute) as a tweak of itself. */
81
+ export declare const hasCanvasPosition: (section: DocumentNode) => boolean;
82
+ /**
83
+ * A ready-made section back in the page's flow: the position it was given on the canvas (kept as a tweak of the section so it
84
+ * survives editing there) is forgotten, and it is rebuilt full width. Without this the next change to the section would put it back
85
+ * where the canvas had it, out of the flow, and it would seem to vanish from the page.
86
+ */
87
+ export declare function releaseSectionToFlow(section: DocumentNode): DocumentNode;
@@ -1,4 +1,4 @@
1
- import { A as e, An as t, At as n, C as r, Cn as i, Dn as a, Dt as o, E as ee, En as te, Mt as s, N as c, Nn as l, Nt as u, On as d, Ot as f, P as p, Pt as m, _ as h, a as g, at as _, c as v, ct as y, d as b, dn as x, f as S, fn as C, g as w, h as T, i as E, it as D, j as O, jn as k, jt as A, kn as ne, kt as j, l as M, lt as N, m as P, n as F, nt as I, o as L, ot as R, p as z, r as B, rt as V, s as H, st as U, t as W, u as G, ut as K, v as q, wn as J, xn as Y } from "./v1-BVrQQ-IP.js";
1
+ import { A as e, An as t, At as n, C as r, Dn as i, Dt as a, E as o, En as ee, In as te, Mn as s, Mt as c, N as l, Nn as u, Nt as d, Ot as f, P as p, Pn as m, Pt as h, _ as g, a as _, at as v, c as y, ct as b, d as x, f as S, g as C, h as w, hn as T, i as E, it as D, j as O, jn as k, jt as A, kn as ne, kt as j, l as M, lt as N, m as P, mn as F, n as I, nt as L, o as R, ot as z, p as B, r as V, rt as H, s as U, st as W, t as G, u as K, ut as q, v as J, wn as Y } from "./v1-DDI8uqDD.js";
2
2
  import { n as X, t as Z } from "./lint-CV3DmM0X.js";
3
3
  //#region src/v2/compile/react.ts
4
4
  var re = /^[A-Z][A-Za-z0-9]*$/, Q = (e) => JSON.stringify(e);
@@ -6,7 +6,7 @@ function ie(e) {
6
6
  let t = "";
7
7
  for (let [n, r] of Object.entries(e.attrs ?? {})) {
8
8
  if (r === void 0 || r === !1) continue;
9
- let e = C(n);
9
+ let e = T(n);
10
10
  r === !0 ? t += ` ${e}` : typeof r == "number" ? t += ` ${e}={${r}}` : t += ` ${e}={${Q(String(r))}}`;
11
11
  }
12
12
  return e.style && (t += ` style={${JSON.stringify(e.style)}}`), t;
@@ -15,7 +15,7 @@ function $(e, t) {
15
15
  let n = " ".repeat(t);
16
16
  if (typeof e == "string") return `${n}{${Q(e)}}`;
17
17
  let r = ie(e);
18
- return x.has(e.tag) || !e.children?.length ? `${n}<${e.tag}${r} />` : `${n}<${e.tag}${r}>\n${e.children.map((e) => $(e, t + 1)).join("\n")}\n${n}</${e.tag}>`;
18
+ return F.has(e.tag) || !e.children?.length ? `${n}<${e.tag}${r} />` : `${n}<${e.tag}${r}>\n${e.children.map((e) => $(e, t + 1)).join("\n")}\n${n}</${e.tag}>`;
19
19
  }
20
20
  function ae(e) {
21
21
  let t = e.replace(/[^A-Za-z0-9]+/g, " ").trim().split(" ").filter(Boolean).map((e) => e[0].toUpperCase() + e.slice(1)).join("");
@@ -23,7 +23,7 @@ function ae(e) {
23
23
  }
24
24
  function oe(e, t) {
25
25
  if (!re.test(t.componentName)) throw Error(`"${t.componentName}" isn't a valid component name — use PascalCase letters and numbers.`);
26
- let n = q(e, t), r = t.runtime !== "none" && n.usesRuntime, i = n.fontLinks, a = "`" + n.css.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${") + "`";
26
+ let n = J(e, t), r = t.runtime !== "none" && n.usesRuntime, i = n.fontLinks, a = "`" + n.css.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${") + "`";
27
27
  return {
28
28
  code: `// Generated by Plexo from a visual design. Edit it visually in the app editor's Design view
29
29
  // (which regenerates this file), or turn it into regular code by editing here.
@@ -44,4 +44,4 @@ ${r ? $(n.tree, 3).replace("<div", "<div ref={root}") : $(n.tree, 3)}
44
44
  };
45
45
  }
46
46
  //#endregion
47
- export { P as EMAIL_WIDTH, t as FRAME_WIDTH, e as MAX_CUSTOM_JS, E as MAX_DEPTH, g as MAX_NODES, k as MEDIA_QUERY, f as PAGE_TEMPLATES, I as SOL_SYSTEM_PROMPT, W as V1_DYNAMIC_EQUIVALENTS, F as V2_DYNAMIC_READY, i as WORKSPACE_ID, _ as applyCommands, b as blankEmailPages, y as blankPages, j as buildPageFromTemplate, n as buildTemplateSections, o as catalogSchema, z as compilePageToEmail, w as compilePageToHtml, oe as compilePageToReact, ae as componentNameFor, Y as computePlacements, M as convertLegacyDesign, B as convertV1Design, l as createDefaultDesignSystem, V as describeCommand, N as describeDesign, K as describeSection, T as emailIssues, J as ensureWorkspace, A as getPageTemplate, G as isLegacyDesign, s as isPageEmpty, te as isWorkspaceNode, Z as lintDesignSystem, u as listPageTemplates, a as pageChildren, L as parsePages, D as parseSolReply, ee as parseVideoUrl, O as prepareCustomJs, h as printHtml, X as repairDesignSystem, r as resolveFormDestination, H as sanitizeCss, v as sanitizeV2Html, R as setPageTemplateResolver, U as solCommandSchema, S as starterEmailPages, d as stripWorkspace, m as templateSeed, c as validHtmlId, ne as workspaceOf };
47
+ export { P as EMAIL_WIDTH, u as FRAME_WIDTH, e as MAX_CUSTOM_JS, E as MAX_DEPTH, _ as MAX_NODES, m as MEDIA_QUERY, f as PAGE_TEMPLATES, L as SOL_SYSTEM_PROMPT, G as V1_DYNAMIC_EQUIVALENTS, I as V2_DYNAMIC_READY, ee as WORKSPACE_ID, v as applyCommands, x as blankEmailPages, b as blankPages, j as buildPageFromTemplate, n as buildTemplateSections, a as catalogSchema, B as compilePageToEmail, C as compilePageToHtml, oe as compilePageToReact, ae as componentNameFor, Y as computePlacements, M as convertLegacyDesign, V as convertV1Design, te as createDefaultDesignSystem, H as describeCommand, N as describeDesign, q as describeSection, w as emailIssues, i as ensureWorkspace, A as getPageTemplate, K as isLegacyDesign, c as isPageEmpty, ne as isWorkspaceNode, Z as lintDesignSystem, d as listPageTemplates, t as pageChildren, R as parsePages, D as parseSolReply, o as parseVideoUrl, O as prepareCustomJs, g as printHtml, X as repairDesignSystem, r as resolveFormDestination, U as sanitizeCss, y as sanitizeV2Html, z as setPageTemplateResolver, W as solCommandSchema, S as starterEmailPages, k as stripWorkspace, h as templateSeed, l as validHtmlId, s as workspaceOf };