@charisol/plexo-sdk 2.0.27 → 2.0.29

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.
Files changed (47) hide show
  1. package/README.md +301 -0
  2. package/dist/{InlineColorPicker-BYcOgLVc.js → InlineColorPicker-XesBzRsU.js} +362 -114
  3. package/dist/{v1-Dm9rxrfa.js → blank-BEl6CY5C.js} +4657 -10897
  4. package/dist/brandGuide-Dd4fqVjS.js +33 -0
  5. package/dist/{client-DUSU8g5z.js → client-CWui0-3q.js} +1 -1
  6. package/dist/codeEditor-Cux0ud2j.js +205 -0
  7. package/dist/files-Df6FY0HK.js +2182 -0
  8. package/dist/id-CR6Y8qD6.js +8 -0
  9. package/dist/index.js +12786 -13034
  10. package/dist/{brandGuide-DgoZ7spo.js → lint-CV3DmM0X.js} +78 -109
  11. package/dist/pdfImport-BOev0Pc1.js +262 -0
  12. package/dist/plexo-sdk.css +1 -1
  13. package/dist/v1-Cn7SGvZk.js +6253 -0
  14. package/dist/v2/CanvasEditor.d.ts +25 -0
  15. package/dist/v2/V2Editor.d.ts +15 -20
  16. package/dist/v2/compile/build.d.ts +5 -0
  17. package/dist/v2/components/properties/PropertiesPanel.d.ts +1 -0
  18. package/dist/v2/files/aiPicture.d.ts +85 -0
  19. package/dist/v2/files/build.d.ts +49 -0
  20. package/dist/v2/files/capture.d.ts +52 -0
  21. package/dist/v2/files/convert.d.ts +24 -0
  22. package/dist/v2/files/docx.d.ts +1 -0
  23. package/dist/v2/files/engine.d.ts +2 -0
  24. package/dist/v2/files/export.d.ts +97 -0
  25. package/dist/v2/files/import.d.ts +34 -0
  26. package/dist/v2/files/index.d.ts +16 -0
  27. package/dist/v2/files/pdf.d.ts +15 -0
  28. package/dist/v2/files/pdfImport.d.ts +28 -0
  29. package/dist/v2/files/sheet.d.ts +16 -0
  30. package/dist/v2/files/text.d.ts +8 -0
  31. package/dist/v2/files/types.d.ts +96 -0
  32. package/dist/v2/files/ui/ExportDock.d.ts +11 -0
  33. package/dist/v2/files/ui/ExportMenu.d.ts +5 -0
  34. package/dist/v2/files/ui/ExportPanel.d.ts +17 -0
  35. package/dist/v2/files/ui/FileEditor.d.ts +14 -0
  36. package/dist/v2/files/ui/HtmlWorkbench.d.ts +15 -0
  37. package/dist/v2/files/ui/codeEditor.d.ts +12 -0
  38. package/dist/v2/files/ui/editors.d.ts +28 -0
  39. package/dist/v2/files/vector.d.ts +19 -0
  40. package/dist/v2/files/zip.d.ts +10 -0
  41. package/dist/v2/host/HostContext.d.ts +6 -3
  42. package/dist/v2/index.d.ts +5 -1
  43. package/dist/v2-compile.js +17 -16
  44. package/dist/v2-files.js +3 -0
  45. package/dist/v2-strata.js +2 -2
  46. package/dist/v2.js +5805 -4038
  47. package/package.json +18 -3
@@ -0,0 +1,33 @@
1
+ import { p as e } from "./lint-CV3DmM0X.js";
2
+ //#region src/v2/strata/brandGuide.ts
3
+ var t = (e) => e.replace(/^--/, ""), n = (e) => [...e].sort((e, t) => e.key.localeCompare(t.key, void 0, { numeric: !0 }));
4
+ function r(t) {
5
+ return `:root {\n${t.tokens.map((t) => ` ${t.key}: ${e(t)};`).join("\n")}\n}\n`;
6
+ }
7
+ function i(e) {
8
+ return `// ${e.name ?? "Brand"} — generated from the design system. Each variable reads its CSS custom property.\n${e.tokens.map((e) => `$${t(e.key)}: var(${e.key});`).join("\n")}\n`;
9
+ }
10
+ var a = (t) => `- ${t.key}: ${e(t)}`, o = (e, t) => n(e.tokens.filter((e) => e.layer !== "component" && t(e))), s = 30, c = (e, t) => {
11
+ if (!t.length) return "";
12
+ let n = t.slice(0, s).map(a);
13
+ return t.length > s && n.push(`- …and ${t.length - s} more`), `## ${e}\n${n.join("\n")}\n\n`;
14
+ };
15
+ function l(e) {
16
+ let t = (t) => o(e, (e) => e.key.startsWith(t));
17
+ return [
18
+ `# ${e.name ?? "Brand"} guidelines${e.strata?.projectName ? ` (from Strata: ${e.strata.projectName})` : ""}\n\n`,
19
+ "Rules\n- Never write a colour, font, size, spacing or corner value by hand. Use the variable below, as var(--name).\n- Brand colours: use the action and text colours for buttons and copy, the background colours for sections, the state colours for success, warning and error.\n- If something you need isn't below, pick the nearest variable. Don't invent a hex colour.\n- Headings use var(--font-family-heading), body text var(--font-family-body).\n- Spacing comes from the --space-* scale and corners from --radius-*.\n\n",
20
+ c("Brand colours", t("--color-brand-")),
21
+ c("Meaning colours (use these in layouts)", o(e, (e) => e.type === "color" && /^--color-(action|bg|text|border|state)-/.test(e.key))),
22
+ c("Neutral greys", t("--color-neutral-")),
23
+ c("Fonts", o(e, (e) => e.type === "font family" && !e.key.startsWith("--semantic-"))),
24
+ c("Text sizes", t("--font-size-")),
25
+ c("Font weights", o(e, (e) => e.type === "font weight" && !e.key.startsWith("--semantic-"))),
26
+ c("Spacing", t("--space-")),
27
+ c("Corners", t("--radius-")),
28
+ c("Shadows", o(e, (e) => e.type === "shadow" && !e.key.startsWith("--semantic-"))),
29
+ e.components.length ? `## Components\n${[...new Set(e.components.map((e) => e.name))].join(", ")}. Their looks come from the variables above.\n` : ""
30
+ ].join("").trim() + "\n";
31
+ }
32
+ //#endregion
33
+ export { l as n, i as r, r as t };
@@ -1,4 +1,4 @@
1
- import { a as e, g as t } from "./brandGuide-DgoZ7spo.js";
1
+ import { n as e, p as t } from "./lint-CV3DmM0X.js";
2
2
  //#region src/v2/strata/merge.ts
3
3
  function n(e) {
4
4
  return Array.isArray(e) ? `[${e.map(n).join(",")}]` : e && typeof e == "object" ? `{${Object.keys(e).sort().map((t) => `${JSON.stringify(t)}:${n(e[t])}`).join(",")}}` : JSON.stringify(e);
@@ -0,0 +1,205 @@
1
+ import { EditorState as e } from "@codemirror/state";
2
+ import { EditorView as t, drawSelection as n, highlightActiveLine as r, highlightActiveLineGutter as i, keymap as a, lineNumbers as o, placeholder as s } from "@codemirror/view";
3
+ import { defaultKeymap as c, history as l, historyKeymap as u, indentWithTab as d } from "@codemirror/commands";
4
+ import { html as f } from "@codemirror/lang-html";
5
+ import { HighlightStyle as p, bracketMatching as m, foldGutter as h, foldKeymap as g, indentOnInput as _, syntaxHighlighting as v } from "@codemirror/language";
6
+ import { autocompletion as y, closeBrackets as b, closeBracketsKeymap as x, completionKeymap as S } from "@codemirror/autocomplete";
7
+ import { highlightSelectionMatches as C, searchKeymap as w } from "@codemirror/search";
8
+ import { tags as T } from "@lezer/highlight";
9
+ //#region src/v2/files/ui/codeEditor.ts
10
+ var E = p.define([
11
+ {
12
+ tag: [T.tagName, T.standard(T.tagName)],
13
+ color: "#60a5fa"
14
+ },
15
+ {
16
+ tag: [T.angleBracket, T.bracket],
17
+ color: "#94a3b8"
18
+ },
19
+ {
20
+ tag: T.attributeName,
21
+ color: "#fbbf24"
22
+ },
23
+ {
24
+ tag: [T.attributeValue, T.string],
25
+ color: "#34d399"
26
+ },
27
+ {
28
+ tag: [T.comment, T.docComment],
29
+ color: "#94a3b8",
30
+ fontStyle: "italic"
31
+ },
32
+ {
33
+ tag: [
34
+ T.keyword,
35
+ T.operatorKeyword,
36
+ T.controlKeyword
37
+ ],
38
+ color: "#c084fc"
39
+ },
40
+ {
41
+ tag: [
42
+ T.number,
43
+ T.bool,
44
+ T.null,
45
+ T.atom
46
+ ],
47
+ color: "#fb923c"
48
+ },
49
+ {
50
+ tag: [T.propertyName, T.definition(T.propertyName)],
51
+ color: "#38bdf8"
52
+ },
53
+ {
54
+ tag: [T.className, T.typeName],
55
+ color: "#f472b6"
56
+ },
57
+ {
58
+ tag: [T.function(T.variableName), T.function(T.propertyName)],
59
+ color: "#facc15"
60
+ },
61
+ {
62
+ tag: [T.variableName, T.name],
63
+ color: "inherit"
64
+ },
65
+ {
66
+ tag: [
67
+ T.operator,
68
+ T.punctuation,
69
+ T.separator
70
+ ],
71
+ color: "#94a3b8"
72
+ },
73
+ {
74
+ tag: T.invalid,
75
+ color: "#f87171",
76
+ textDecoration: "underline wavy"
77
+ },
78
+ {
79
+ tag: T.meta,
80
+ color: "#94a3b8"
81
+ },
82
+ {
83
+ tag: T.heading,
84
+ fontWeight: "700"
85
+ }
86
+ ]), D = t.theme({
87
+ "&": {
88
+ height: "100%",
89
+ backgroundColor: "var(--px-canvas)",
90
+ color: "var(--px-text)",
91
+ fontSize: "13px"
92
+ },
93
+ "&.cm-focused": { outline: "none" },
94
+ ".cm-scroller": {
95
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
96
+ lineHeight: "1.65",
97
+ overflow: "auto"
98
+ },
99
+ ".cm-content": {
100
+ caretColor: "var(--px-accent)",
101
+ padding: "8px 0"
102
+ },
103
+ ".cm-cursor": { borderLeftColor: "var(--px-accent)" },
104
+ ".cm-gutters": {
105
+ backgroundColor: "var(--px-surface)",
106
+ color: "var(--px-faint)",
107
+ border: "none",
108
+ borderRight: "1px solid var(--px-line)"
109
+ },
110
+ ".cm-activeLine": { backgroundColor: "rgba(127,127,127,0.09)" },
111
+ ".cm-activeLineGutter": {
112
+ backgroundColor: "rgba(127,127,127,0.14)",
113
+ color: "var(--px-text)"
114
+ },
115
+ "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection": { backgroundColor: "rgba(96,165,250,0.30)" },
116
+ ".cm-matchingBracket": {
117
+ backgroundColor: "rgba(96,165,250,0.25)",
118
+ outline: "1px solid rgba(96,165,250,0.6)"
119
+ },
120
+ ".cm-selectionMatch": { backgroundColor: "rgba(250,204,21,0.18)" },
121
+ ".cm-tooltip": {
122
+ backgroundColor: "var(--px-surface)",
123
+ color: "var(--px-text)",
124
+ border: "1px solid var(--px-line2)",
125
+ borderRadius: "8px"
126
+ },
127
+ ".cm-tooltip-autocomplete ul li[aria-selected]": {
128
+ backgroundColor: "var(--px-accent)",
129
+ color: "var(--px-onaccent)"
130
+ },
131
+ ".cm-panels": {
132
+ backgroundColor: "var(--px-surface)",
133
+ color: "var(--px-text)",
134
+ borderColor: "var(--px-line)"
135
+ },
136
+ ".cm-foldPlaceholder": {
137
+ backgroundColor: "var(--px-raised)",
138
+ border: "none",
139
+ color: "var(--px-muted)"
140
+ }
141
+ });
142
+ function O(p, T, O) {
143
+ let k = !1, A = [
144
+ o(),
145
+ i(),
146
+ h(),
147
+ l(),
148
+ n(),
149
+ _(),
150
+ m(),
151
+ b(),
152
+ y(),
153
+ r(),
154
+ C(),
155
+ f({
156
+ autoCloseTags: !0,
157
+ matchClosingTags: !0,
158
+ selfClosingTags: !0
159
+ }),
160
+ v(E),
161
+ D,
162
+ t.lineWrapping,
163
+ e.tabSize.of(2),
164
+ a.of([
165
+ ...x,
166
+ ...c,
167
+ ...w,
168
+ ...u,
169
+ ...g,
170
+ ...S,
171
+ d
172
+ ]),
173
+ t.updateListener.of((e) => {
174
+ e.docChanged && !k && O.onChange?.(e.state.doc.toString());
175
+ }),
176
+ t.contentAttributes.of({
177
+ "aria-label": "HTML code",
178
+ spellcheck: "false",
179
+ autocapitalize: "off",
180
+ autocorrect: "off"
181
+ })
182
+ ];
183
+ O.readOnly && A.push(e.readOnly.of(!0), t.editable.of(!1)), O.placeholder && A.push(s(O.placeholder));
184
+ let j = new t({
185
+ parent: p,
186
+ state: e.create({
187
+ doc: T,
188
+ extensions: A
189
+ })
190
+ });
191
+ return {
192
+ setValue(e) {
193
+ e !== j.state.doc.toString() && (k = !0, j.dispatch({ changes: {
194
+ from: 0,
195
+ to: j.state.doc.length,
196
+ insert: e
197
+ } }), k = !1);
198
+ },
199
+ getValue: () => j.state.doc.toString(),
200
+ focus: () => j.focus(),
201
+ destroy: () => j.destroy()
202
+ };
203
+ }
204
+ //#endregion
205
+ export { O as mountHtmlEditor };