@charisol/plexo-sdk 2.0.11 → 2.0.12

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.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { type AuditDecisions, type AuditReport } from '../../design';
3
3
  /** Nothing to tidy: say so, kindly. */
4
4
  export declare const TidyEmpty: React.FC;
5
- /** The card that offers the clean-up. */
5
+ /** The card that offers the clean-up. Once the values that matter are in the brand it says so (one-offs stay quietly available). */
6
6
  export declare const TidyCard: React.FC<{
7
7
  report: AuditReport;
8
8
  onOpen: () => void;
@@ -76,3 +76,17 @@ export declare function applyAuditFixes(pages: PageDefinition[], ds: DesignSyste
76
76
  pages: PageDefinition[];
77
77
  designSystem: DesignSystem;
78
78
  };
79
+ /**
80
+ * Hooks the page up to the brand wherever a colour or font is written out in full but is exactly a value the brand already
81
+ * holds (a template that wrote "#1C1B19" where the brand's own dark is "#1C1B19"). Nothing looks different, but from then on
82
+ * a quick look or a colour change moves those places too instead of leaving them behind. Returns the same pages when there
83
+ * was nothing to hook up.
84
+ */
85
+ export declare function linkExactValues(pages: PageDefinition[], ds: DesignSystem): PageDefinition[];
86
+ /**
87
+ * A template's own accent colours (its greens, golds, blues…) are written out in full, so a quick look would leave them
88
+ * untouched. This ties the page's two most used accent hues to the brand's Main and Accent colours (lighter and darker shades
89
+ * of the same hue follow Main's lighter and darker shades), so choosing a look really recolours the page. Greys, blacks,
90
+ * whites, photos and any third hue are left alone. Returns the same pages when there is nothing to tie.
91
+ */
92
+ export declare function linkAccentsToBrand(pages: PageDefinition[], ds: DesignSystem): PageDefinition[];
@@ -11,4 +11,4 @@ export { TEXT_STYLES, TEXT_STYLE_IDS, isTextStyle, textStyleDef, textStyleVars,
11
11
  export { designSystemVars, plexoVars, frameVars, designSystemCss, fontsNeeded } from './css';
12
12
  export { componentStyle, componentVariants } from './components';
13
13
  export { lintDesignSystem, repairDesignSystem, type DesignSystemIssue, type IssueKind } from './lint';
14
- export { auditDesign, applyAuditFixes, describeAudit, suggestedDecisions, friendlyTokenName, colorDistance, AUDIT_KINDS, AUDIT_KIND_LABELS, type AuditKind, type AuditAction, type AuditFinding, type AuditReport, type AuditOptions, type AuditDecisions, type AuditMatch, type Closeness } from './audit';
14
+ export { auditDesign, applyAuditFixes, linkExactValues, linkAccentsToBrand, describeAudit, suggestedDecisions, friendlyTokenName, colorDistance, AUDIT_KINDS, AUDIT_KIND_LABELS, type AuditKind, type AuditAction, type AuditFinding, type AuditReport, type AuditOptions, type AuditDecisions, type AuditMatch, type Closeness } from './audit';
@@ -1,4 +1,4 @@
1
- import { $ as e, A as t, C as n, Ct as r, Dt as i, E as a, Et as o, N as s, Ot as c, P as l, St as u, Tt as d, _ as f, a as p, at as m, c as h, d as g, et as _, f as v, g as y, gn as b, h as x, i as S, it as C, j as w, kt as T, l as E, m as D, n as O, nt as ee, o as k, on as A, ot as j, p as M, r as N, rt as P, s as F, sn as I, st as L, t as R, tt as z, u as B, v as V, vn as H, wt as U, xn as W, yn as G } from "./v1-IIzUA4pk.js";
1
+ import { A as e, At as t, C as n, Cn as r, Dt as i, E as a, Et as o, N as s, Ot as c, P as l, Tt as u, _ as d, a as f, at as p, bn as m, c as h, cn as g, ct as _, d as v, f as y, g as b, h as x, i as S, it as C, j as w, jt as T, kt as E, l as D, ln as O, lt as ee, m as k, n as A, nt as j, o as M, ot as N, p as P, r as F, rt as I, s as L, st as R, t as z, tt as B, u as V, v as H, vn as U, wt as W, xn as G } from "./v1-CvwbXOzF.js";
2
2
  import { n as K, t as q } from "./lint-BWdiaRwp.js";
3
3
  //#region src/v2/compile/react.ts
4
4
  var J = /^[A-Z][A-Za-z0-9]*$/, Y = (e) => JSON.stringify(e);
@@ -6,7 +6,7 @@ function X(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 = I(n);
9
+ let e = O(n);
10
10
  r === !0 ? t += ` ${e}` : typeof r == "number" ? t += ` ${e}={${r}}` : t += ` ${e}={${Y(String(r))}}`;
11
11
  }
12
12
  return e.style && (t += ` style={${JSON.stringify(e.style)}}`), t;
@@ -15,7 +15,7 @@ function Z(e, t) {
15
15
  let n = " ".repeat(t);
16
16
  if (typeof e == "string") return `${n}{${Y(e)}}`;
17
17
  let r = X(e);
18
- return A.has(e.tag) || !e.children?.length ? `${n}<${e.tag}${r} />` : `${n}<${e.tag}${r}>\n${e.children.map((e) => Z(e, t + 1)).join("\n")}\n${n}</${e.tag}>`;
18
+ return g.has(e.tag) || !e.children?.length ? `${n}<${e.tag}${r} />` : `${n}<${e.tag}${r}>\n${e.children.map((e) => Z(e, t + 1)).join("\n")}\n${n}</${e.tag}>`;
19
19
  }
20
20
  function Q(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 Q(e) {
23
23
  }
24
24
  function $(e, t) {
25
25
  if (!J.test(t.componentName)) throw Error(`"${t.componentName}" isn't a valid component name — use PascalCase letters and numbers.`);
26
- let n = V(e, t), r = t.runtime !== "none" && n.usesRuntime, i = n.fontLinks, a = "`" + n.css.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${") + "`";
26
+ let n = H(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 ? Z(n.tree, 3).replace("<div", "<div ref={root}") : Z(n.tree, 3)}
44
44
  };
45
45
  }
46
46
  //#endregion
47
- export { D as EMAIL_WIDTH, H as FRAME_WIDTH, t as MAX_CUSTOM_JS, S as MAX_DEPTH, p as MAX_NODES, G as MEDIA_QUERY, r as PAGE_TEMPLATES, e as SOL_SYSTEM_PROMPT, R as V1_DYNAMIC_EQUIVALENTS, O as V2_DYNAMIC_READY, ee as applyCommands, g as blankEmailPages, m as blankPages, U as buildPageFromTemplate, d as buildTemplateSections, u as catalogSchema, M as compilePageToEmail, y as compilePageToHtml, $ as compilePageToReact, Q as componentNameFor, b as computePlacements, E as convertLegacyDesign, N as convertV1Design, W as createDefaultDesignSystem, _ as describeCommand, j as describeDesign, L as describeSection, x as emailIssues, o as getPageTemplate, B as isLegacyDesign, i as isPageEmpty, q as lintDesignSystem, c as listPageTemplates, k as parsePages, z as parseSolReply, a as parseVideoUrl, w as prepareCustomJs, f as printHtml, K as repairDesignSystem, n as resolveFormDestination, F as sanitizeCss, h as sanitizeV2Html, P as setPageTemplateResolver, C as solCommandSchema, v as starterEmailPages, T as templateSeed, s as validHtmlId };
47
+ export { k as EMAIL_WIDTH, m as FRAME_WIDTH, e as MAX_CUSTOM_JS, S as MAX_DEPTH, f as MAX_NODES, G as MEDIA_QUERY, u as PAGE_TEMPLATES, B as SOL_SYSTEM_PROMPT, z as V1_DYNAMIC_EQUIVALENTS, A as V2_DYNAMIC_READY, C as applyCommands, v as blankEmailPages, R as blankPages, o as buildPageFromTemplate, i as buildTemplateSections, W as catalogSchema, P as compilePageToEmail, b as compilePageToHtml, $ as compilePageToReact, Q as componentNameFor, U as computePlacements, D as convertLegacyDesign, F as convertV1Design, r as createDefaultDesignSystem, j as describeCommand, _ as describeDesign, ee as describeSection, x as emailIssues, c as getPageTemplate, V as isLegacyDesign, E as isPageEmpty, q as lintDesignSystem, t as listPageTemplates, M as parsePages, I as parseSolReply, a as parseVideoUrl, w as prepareCustomJs, d as printHtml, K as repairDesignSystem, n as resolveFormDestination, L as sanitizeCss, h as sanitizeV2Html, p as setPageTemplateResolver, N as solCommandSchema, y as starterEmailPages, T as templateSeed, s as validHtmlId };