@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.
- package/dist/{v1-IIzUA4pk.js → v1-CvwbXOzF.js} +502 -424
- package/dist/v2/components/design/TidyView.d.ts +1 -1
- package/dist/v2/design/audit.d.ts +14 -0
- package/dist/v2/design/index.d.ts +1 -1
- package/dist/v2-compile.js +5 -5
- package/dist/v2.js +3357 -3321
- package/package.json +1 -1
|
@@ -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';
|
package/dist/v2-compile.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 =
|
|
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
|
|
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 =
|
|
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 {
|
|
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 };
|