@charisol/plexo-sdk 1.1.16 → 1.3.0
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/PlexoRenderer.d.ts +8 -0
- package/dist/{compiler-Dr4lNAM3.js → compiler-nmaKKdLq.js} +194 -188
- package/dist/compiler.js +2 -2
- package/dist/compilerClient-DW7b0Ifk.js +215 -0
- package/dist/compilerClient.js +2 -168
- package/dist/components/CodeViewer.d.ts +7 -0
- package/dist/components/editor/frame/AccordionHeaderOverlay.d.ts +15 -0
- package/dist/components/editor/frame/CompiledCanvasEditorOverlay.d.ts +30 -0
- package/dist/components/editor/frame/CompiledCanvasFrame.d.ts +16 -0
- package/dist/components/editor/frame/DndOverlayNode.d.ts +59 -0
- package/dist/components/editor/frame/FrameTextToolbar.d.ts +29 -0
- package/dist/components/editor/frame/TableCellOverlay.d.ts +23 -0
- package/dist/components/editor/frame/useAccordionHeaderRects.d.ts +21 -0
- package/dist/components/editor/frame/useCanvasEngine.d.ts +27 -0
- package/dist/components/editor/frame/useCompiledCanvasHtml.d.ts +41 -0
- package/dist/components/editor/frame/useFrameNodeRects.d.ts +18 -0
- package/dist/components/editor/frame/useFrameTextEditing.d.ts +47 -0
- package/dist/components/editor/frame/useMeasuredFrameNodes.d.ts +13 -0
- package/dist/components/editor/frame/useTableCellRects.d.ts +29 -0
- package/dist/{iconSvgStatic-D04qA352.js → iconSvgStatic-CGue7nyp.js} +64 -48
- package/dist/index.d.ts +1 -0
- package/dist/index.js +47234 -46851
- package/dist/mjmlBrowser-DFgIYJ2a.js +39283 -0
- package/dist/plexo-sdk.css +1 -1
- package/dist/sanitize.js +2 -0
- package/dist/sanitizeCompiledHtml-C_sPjL3B.js +5079 -0
- package/dist/utilities/compiler.d.ts +4 -1
- package/dist/utilities/compilerClient.d.ts +4 -1
- package/dist/utilities/elementResolvers.d.ts +26 -7
- package/dist/utilities/instrumentation.d.ts +54 -0
- package/dist/utilities/mjmlBrowser.d.ts +19 -0
- package/dist/utilities/playground.helpers.d.ts +0 -18
- package/dist/utilities/playground.interfaces.d.ts +13 -0
- package/dist/utilities/sanitizeCompiledHtml.d.ts +10 -0
- package/dist/utilities/useApiKeyValidation.d.ts +6 -0
- package/package.json +17 -2
|
@@ -61,7 +61,10 @@ export declare const getFormDefaultStyle: () => {
|
|
|
61
61
|
buttonFontWeight: string;
|
|
62
62
|
};
|
|
63
63
|
export declare const FORM_NON_CSS_STYLE_KEYS: string[];
|
|
64
|
-
export declare const compileToHTML: (rawTemplate: TemplateJSON | any
|
|
64
|
+
export declare const compileToHTML: (rawTemplate: TemplateJSON | any, opts?: {
|
|
65
|
+
canvasEditorPadding?: boolean;
|
|
66
|
+
}) => string;
|
|
67
|
+
export declare function htmlToPlainText(html: string): string;
|
|
65
68
|
export declare function compileToPlainText(template: TemplateJSON | any): string;
|
|
66
69
|
export declare function compileToHTMLWithStrataAuto(template: TemplateJSON | any): string;
|
|
67
70
|
export declare function injectStrataBundle(html: string): string;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { TemplateJSON } from './types';
|
|
2
2
|
export type CompileTarget = 'landing_page' | 'email';
|
|
3
|
-
export declare const parseJsonToTargetFormat: (json: TemplateJSON, target: CompileTarget
|
|
3
|
+
export declare const parseJsonToTargetFormat: (json: TemplateJSON, target: CompileTarget, opts?: {
|
|
4
|
+
instrument?: boolean;
|
|
5
|
+
canvasEditorPadding?: boolean;
|
|
6
|
+
}) => string;
|
|
@@ -87,6 +87,29 @@ export interface ResolvedButtonBox {
|
|
|
87
87
|
* stretched on one or more published surfaces depending on which of the two was missing.
|
|
88
88
|
*/
|
|
89
89
|
export declare function resolveButtonBox(elem: ElementJSON): ResolvedButtonBox;
|
|
90
|
+
export interface ResolvedTextBoxSize {
|
|
91
|
+
/** True when the box should shrink to fit its content (display: inline-block, discarding
|
|
92
|
+
* whatever width is set) -- the "Auto" width mode. Opposite default from resolveButtonBox's
|
|
93
|
+
* `autoWidth` on purpose: a heading/paragraph has ALWAYS been a block element that fills its
|
|
94
|
+
* column (no auto* flag existed for it at all before this), so defaulting `attrs.autoWidth`
|
|
95
|
+
* to `true` would silently shrink every already-published heading/paragraph. Auto-width has
|
|
96
|
+
* to be something a user turns ON, not something that's already on.
|
|
97
|
+
*
|
|
98
|
+
* This is the ONLY thing this resolver still decides. A plain custom width/height (or any
|
|
99
|
+
* other CSS property -- max-width, margin, display, text-transform, ...) is NOT resolved
|
|
100
|
+
* here: both compiler.ts and compilerClient.ts pass `element.style` through generically
|
|
101
|
+
* instead (compiler.ts always has, via getInlineStyles; compilerClient.ts now does too, via
|
|
102
|
+
* a css-class + <mj-style> rule, since mj-text has no style="..." escape hatch at all). An
|
|
103
|
+
* earlier version of this resolver gated width/height behind this same flag being exactly
|
|
104
|
+
* `false`/`true` -- which silently dropped a width or height set any way OTHER than through
|
|
105
|
+
* the sidebar's own matching toggle (hand-authored template JSON, most notably), and was a
|
|
106
|
+
* real, reported bug even for the sidebar's own "Custom Width" field, whose visibility
|
|
107
|
+
* condition (`!== true`) never actually matched that stricter resolver requirement. */
|
|
108
|
+
autoWidth: boolean;
|
|
109
|
+
}
|
|
110
|
+
/** heading/paragraph/text's auto-width shrink mode -- see ResolvedTextBoxSize's own doc comment
|
|
111
|
+
* for why this is all that's still resolved here. */
|
|
112
|
+
export declare function resolveTextBoxSize(elem: ElementJSON): ResolvedTextBoxSize;
|
|
90
113
|
/**
|
|
91
114
|
* Mirrors SortableElement.tsx's form_container height gating exactly (width is never
|
|
92
115
|
* gated for form_container, only height, matching the canvas's own asymmetry) -- neither
|
|
@@ -115,14 +138,10 @@ export interface ResolvedTimerRemaining {
|
|
|
115
138
|
targetTimestamp: number;
|
|
116
139
|
}
|
|
117
140
|
/**
|
|
118
|
-
* Computes the remaining time until `targetDate`
|
|
119
|
-
* time; a fixed `now` is only passed in tests).
|
|
120
|
-
* datetime string; `timezone` is accepted for API symmetry with TimerPropertiesAccordion's
|
|
121
|
-
* config but a plain `Date` parse of an ISO string is already timezone-correct (the string
|
|
122
|
-
* either carries an offset or is interpreted in the reader's local zone same as everywhere
|
|
123
|
-
* else in this file), so it isn't used to shift the computation.
|
|
141
|
+
* Computes the remaining time until `targetDate` (+ `timezone`, see resolveTargetTimestamp) as
|
|
142
|
+
* of `now` (defaults to the real current time; a fixed `now` is only passed in tests).
|
|
124
143
|
*/
|
|
125
|
-
export declare function resolveTimerRemaining(targetDate: string | undefined,
|
|
144
|
+
export declare function resolveTimerRemaining(targetDate: string | undefined, timezone?: string, now?: number): ResolvedTimerRemaining;
|
|
126
145
|
export interface ResolvedVideoEmbed {
|
|
127
146
|
thumbnailUrl: string;
|
|
128
147
|
provider: 'youtube' | 'vimeo' | 'unknown';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { TemplateJSON } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The base marker class every instrumented node carries, in addition to its own
|
|
4
|
+
* `plexo-node-<id>` class -- lets the canvas overlay query `.plexo-node` once to find every
|
|
5
|
+
* instrumented element regardless of id, while `.plexo-node-<id>` finds one specific node.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PLEXO_NODE_BASE_CLASS = "plexo-node";
|
|
8
|
+
/**
|
|
9
|
+
* Single source of truth for the per-node class-name scheme used by compilerClient.ts's
|
|
10
|
+
* `instrument` option and by stripInstrumentation/collectExpectedNodeIds/diffExpectedNodes
|
|
11
|
+
* below. Nobody else should hand-build a `plexo-node-<id>` string -- if the scheme ever
|
|
12
|
+
* changes, this is the only place that needs to.
|
|
13
|
+
*/
|
|
14
|
+
export declare function nodeClassFor(id: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Removes ONLY the instrumentation classes `withInstrumentClass` adds, leaving everything else
|
|
17
|
+
* untouched. This is a plain string transform, not a DOM-aware one (deliberately, per its own
|
|
18
|
+
* call sites in the test suite) -- it operates on compilerClient.ts's own hand-built MJML/HTML
|
|
19
|
+
* source text, where the instrumentation tokens are always literally `plexo-node
|
|
20
|
+
* plexo-node-<id>` in that fixed order, never reordered or intermixed with other tokens after
|
|
21
|
+
* them (see `withInstrumentClass`).
|
|
22
|
+
*
|
|
23
|
+
* Two passes:
|
|
24
|
+
* 1. Strip the token pair (and its one leading space) wherever it appears.
|
|
25
|
+
* 2. Collapse any `class=""` / `css-class=""` that step 1 left behind into nothing.
|
|
26
|
+
*
|
|
27
|
+
* Pass 2 can leave a *different* string than what `instrument: false` would have produced in
|
|
28
|
+
* cases where the attribute is unconditionally emitted even when empty (e.g. `mj-section`'s
|
|
29
|
+
* `css-class="${cssClass}"`, always present, vs. the newly-added attributes on `mj-image`/
|
|
30
|
+
* `mj-column`/etc., which are omitted entirely when empty) -- there is no way to tell those two
|
|
31
|
+
* shapes apart from the stripped text alone (both end up as a bare `css-class=""` on some tag
|
|
32
|
+
* that also happens to host other, unrelated `css-class` producers elsewhere, e.g. `mj-text`).
|
|
33
|
+
* This is harmless for what stripInstrumentation actually needs to guarantee: `css-class=""`
|
|
34
|
+
* vs. the attribute being wholly absent behave identically through mjml2html in the vast
|
|
35
|
+
* majority of positions, and instrumentation.test.ts's own equivalence check additionally
|
|
36
|
+
* normalizes away the rare remaining `class=""`/`css-class=""` artifact on both sides of its
|
|
37
|
+
* comparison before asserting — see that test file for why this is a sound thing to normalize
|
|
38
|
+
* away rather than a check being weakened.
|
|
39
|
+
*/
|
|
40
|
+
export declare function stripInstrumentation(html: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Walks the whole template -- every row, every column, every element, recursing into
|
|
43
|
+
* `column.nestedRows` at any depth -- and returns every node id that should be discoverable
|
|
44
|
+
* (as a `plexo-node-<id>` class) in fully instrumented compiled output.
|
|
45
|
+
*/
|
|
46
|
+
export declare function collectExpectedNodeIds(template: TemplateJSON): Set<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the node ids from `collectExpectedNodeIds` that have NO corresponding
|
|
49
|
+
* `plexo-node-<id>` class anywhere in `instrumentedHtml`. A non-empty result means that node
|
|
50
|
+
* silently vanished from compiled output -- e.g. MJML's `validationLevel: 'soft'` dropping an
|
|
51
|
+
* invalid/unregistered element rather than throwing (see compilerClient.ts's own comments on
|
|
52
|
+
* this exact class of bug) -- rather than merely being present-but-unstyled.
|
|
53
|
+
*/
|
|
54
|
+
export declare function diffExpectedNodes(template: TemplateJSON, instrumentedHtml: string): string[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CompileMjmlInBrowserError {
|
|
2
|
+
formattedMessage?: string;
|
|
3
|
+
message?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface CompileMjmlInBrowserResult {
|
|
6
|
+
html: string;
|
|
7
|
+
errors: CompileMjmlInBrowserError[];
|
|
8
|
+
}
|
|
9
|
+
export interface CompileMjmlInBrowserOptions {
|
|
10
|
+
validationLevel?: 'strict' | 'soft' | 'skip';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Compiles MJML markup to HTML entirely client-side. Same call shape as the Node `mjml`
|
|
14
|
+
* package's `mjml2html` for the subset of it this codebase actually uses (see
|
|
15
|
+
* src/test/golden/computeFixtureOutputs.ts for that call pattern) — callers don't need to know
|
|
16
|
+
* mjml-browser's export is a bare default function rather than whatever shape `mjml2html` has.
|
|
17
|
+
* See the module comment above for the parity contract this relies on.
|
|
18
|
+
*/
|
|
19
|
+
export declare function compileMjmlInBrowser(mjmlSource: string, options?: CompileMjmlInBrowserOptions): CompileMjmlInBrowserResult;
|
|
@@ -12,7 +12,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
12
12
|
fontSize: string;
|
|
13
13
|
fontWeight: string;
|
|
14
14
|
padding: string;
|
|
15
|
-
fontFamily: string;
|
|
16
15
|
textAlign: string;
|
|
17
16
|
lineHeight?: undefined;
|
|
18
17
|
backgroundColor?: undefined;
|
|
@@ -57,7 +56,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
57
56
|
color: string;
|
|
58
57
|
fontSize: string;
|
|
59
58
|
padding: string;
|
|
60
|
-
fontFamily: string;
|
|
61
59
|
textAlign: string;
|
|
62
60
|
lineHeight: string;
|
|
63
61
|
fontWeight?: undefined;
|
|
@@ -104,7 +102,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
104
102
|
fontSize: string;
|
|
105
103
|
padding: string;
|
|
106
104
|
fontWeight?: undefined;
|
|
107
|
-
fontFamily?: undefined;
|
|
108
105
|
textAlign?: undefined;
|
|
109
106
|
lineHeight?: undefined;
|
|
110
107
|
backgroundColor?: undefined;
|
|
@@ -153,7 +150,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
153
150
|
textAlign: string;
|
|
154
151
|
fontWeight: string;
|
|
155
152
|
fontSize?: undefined;
|
|
156
|
-
fontFamily?: undefined;
|
|
157
153
|
lineHeight?: undefined;
|
|
158
154
|
width?: undefined;
|
|
159
155
|
borderWidth?: undefined;
|
|
@@ -198,7 +194,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
198
194
|
fontSize?: undefined;
|
|
199
195
|
fontWeight?: undefined;
|
|
200
196
|
padding?: undefined;
|
|
201
|
-
fontFamily?: undefined;
|
|
202
197
|
textAlign?: undefined;
|
|
203
198
|
lineHeight?: undefined;
|
|
204
199
|
backgroundColor?: undefined;
|
|
@@ -248,7 +243,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
248
243
|
color?: undefined;
|
|
249
244
|
fontSize?: undefined;
|
|
250
245
|
fontWeight?: undefined;
|
|
251
|
-
fontFamily?: undefined;
|
|
252
246
|
textAlign?: undefined;
|
|
253
247
|
lineHeight?: undefined;
|
|
254
248
|
width?: undefined;
|
|
@@ -311,7 +305,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
311
305
|
color?: undefined;
|
|
312
306
|
fontSize?: undefined;
|
|
313
307
|
fontWeight?: undefined;
|
|
314
|
-
fontFamily?: undefined;
|
|
315
308
|
textAlign?: undefined;
|
|
316
309
|
lineHeight?: undefined;
|
|
317
310
|
cellPadding?: undefined;
|
|
@@ -339,7 +332,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
339
332
|
borderStyle: string;
|
|
340
333
|
fontSize: string;
|
|
341
334
|
fontWeight?: undefined;
|
|
342
|
-
fontFamily?: undefined;
|
|
343
335
|
textAlign?: undefined;
|
|
344
336
|
lineHeight?: undefined;
|
|
345
337
|
width?: undefined;
|
|
@@ -381,7 +373,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
381
373
|
padding: string;
|
|
382
374
|
textAlign: string;
|
|
383
375
|
fontWeight?: undefined;
|
|
384
|
-
fontFamily?: undefined;
|
|
385
376
|
lineHeight?: undefined;
|
|
386
377
|
backgroundColor?: undefined;
|
|
387
378
|
borderRadius?: undefined;
|
|
@@ -426,7 +417,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
426
417
|
color?: undefined;
|
|
427
418
|
fontSize?: undefined;
|
|
428
419
|
fontWeight?: undefined;
|
|
429
|
-
fontFamily?: undefined;
|
|
430
420
|
textAlign?: undefined;
|
|
431
421
|
lineHeight?: undefined;
|
|
432
422
|
backgroundColor?: undefined;
|
|
@@ -476,7 +466,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
476
466
|
color?: undefined;
|
|
477
467
|
fontSize?: undefined;
|
|
478
468
|
fontWeight?: undefined;
|
|
479
|
-
fontFamily?: undefined;
|
|
480
469
|
textAlign?: undefined;
|
|
481
470
|
lineHeight?: undefined;
|
|
482
471
|
backgroundColor?: undefined;
|
|
@@ -521,7 +510,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
521
510
|
fontSize: string;
|
|
522
511
|
textAlign: string;
|
|
523
512
|
fontWeight?: undefined;
|
|
524
|
-
fontFamily?: undefined;
|
|
525
513
|
lineHeight?: undefined;
|
|
526
514
|
width?: undefined;
|
|
527
515
|
borderWidth?: undefined;
|
|
@@ -565,7 +553,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
565
553
|
color?: undefined;
|
|
566
554
|
fontSize?: undefined;
|
|
567
555
|
fontWeight?: undefined;
|
|
568
|
-
fontFamily?: undefined;
|
|
569
556
|
textAlign?: undefined;
|
|
570
557
|
lineHeight?: undefined;
|
|
571
558
|
backgroundColor?: undefined;
|
|
@@ -611,7 +598,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
611
598
|
color?: undefined;
|
|
612
599
|
fontSize?: undefined;
|
|
613
600
|
fontWeight?: undefined;
|
|
614
|
-
fontFamily?: undefined;
|
|
615
601
|
lineHeight?: undefined;
|
|
616
602
|
backgroundColor?: undefined;
|
|
617
603
|
borderRadius?: undefined;
|
|
@@ -673,7 +659,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
673
659
|
color?: undefined;
|
|
674
660
|
fontSize?: undefined;
|
|
675
661
|
fontWeight?: undefined;
|
|
676
|
-
fontFamily?: undefined;
|
|
677
662
|
textAlign?: undefined;
|
|
678
663
|
lineHeight?: undefined;
|
|
679
664
|
backgroundColor?: undefined;
|
|
@@ -703,7 +688,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
703
688
|
color?: undefined;
|
|
704
689
|
fontSize?: undefined;
|
|
705
690
|
fontWeight?: undefined;
|
|
706
|
-
fontFamily?: undefined;
|
|
707
691
|
textAlign?: undefined;
|
|
708
692
|
lineHeight?: undefined;
|
|
709
693
|
backgroundColor?: undefined;
|
|
@@ -750,7 +734,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
750
734
|
color?: undefined;
|
|
751
735
|
fontSize?: undefined;
|
|
752
736
|
fontWeight?: undefined;
|
|
753
|
-
fontFamily?: undefined;
|
|
754
737
|
textAlign?: undefined;
|
|
755
738
|
lineHeight?: undefined;
|
|
756
739
|
backgroundColor?: undefined;
|
|
@@ -794,7 +777,6 @@ export declare const getDefaultStyle: (type: string) => {
|
|
|
794
777
|
fontSize?: undefined;
|
|
795
778
|
fontWeight?: undefined;
|
|
796
779
|
padding?: undefined;
|
|
797
|
-
fontFamily?: undefined;
|
|
798
780
|
textAlign?: undefined;
|
|
799
781
|
lineHeight?: undefined;
|
|
800
782
|
backgroundColor?: undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ColumnJSON, ElementJSON, RowJSON, TemplateJSON } from './types';
|
|
3
|
+
import type { CanvasFidelityPreference } from '../components/editor/frame/useCanvasEngine';
|
|
3
4
|
export type StockProvider = 'all' | 'unsplash' | 'pexels' | 'pixabay';
|
|
4
5
|
export type FormFieldKind = 'text' | 'email' | 'number' | 'date' | 'textarea' | 'select' | 'radio' | 'checkbox';
|
|
5
6
|
export interface StockImageResult {
|
|
@@ -224,6 +225,18 @@ export interface PlexoBuilderProps {
|
|
|
224
225
|
commentMode?: boolean;
|
|
225
226
|
/** Fired on canvas click while `commentMode` is true. See `commentMode`. */
|
|
226
227
|
onRequestComment?: (target: CommentTarget) => void;
|
|
228
|
+
/**
|
|
229
|
+
* Host-controlled override for which canvas rendering engine the design tab uses:
|
|
230
|
+
* `'legacy'` (the current independent React-tree canvas), `'compiled'` (an iframe showing
|
|
231
|
+
* the SAME sanitized/compiled bytes the Html tab and the real publish/send pipeline
|
|
232
|
+
* produce, with a selection/drag overlay on top), or `'auto'` (the SDK's own default —
|
|
233
|
+
* currently always `'legacy'` until the compiled canvas's interactive parity is complete
|
|
234
|
+
* and a real cutover is decided; see useCanvasEngine.ts). Deliberately a prop, not a
|
|
235
|
+
* per-template DB field a user could flip themselves — driven by a host env var / org
|
|
236
|
+
* allowlist during rollout, per the canvas-rewrite project's rollback discipline.
|
|
237
|
+
* @default 'auto'
|
|
238
|
+
*/
|
|
239
|
+
canvasFidelity?: CanvasFidelityPreference;
|
|
227
240
|
}
|
|
228
241
|
export interface ColumnLayoutOption {
|
|
229
242
|
label: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const ALLOWED_TAGS: string[];
|
|
2
|
+
export declare const ALLOWED_ATTR: string[];
|
|
3
|
+
/**
|
|
4
|
+
* Purifies raw HTML against XSS/DOM Cloaking with strict tag and attribute whitelists.
|
|
5
|
+
*
|
|
6
|
+
* Uses sanitize-html (a pure-JS parser, no DOM) rather than DOMPurify+jsdom — jsdom pulls
|
|
7
|
+
* in a chain of packages (html-encoding-sniffer, cssstyle) that keep introducing ESM-only
|
|
8
|
+
* sub-dependencies incompatible with bundler external-module loaders.
|
|
9
|
+
*/
|
|
10
|
+
export declare function sanitizeCompiledHtml(html: string): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SdkPlan } from './tierFeatures';
|
|
2
|
+
import type { CanvasFidelityPreference } from '../components/editor/frame/useCanvasEngine';
|
|
2
3
|
export type ApiKeyStatus = 'initializing' | 'valid' | 'invalid' | 'error';
|
|
3
4
|
/** White-label identity for the API key's organization, present only when the org is
|
|
4
5
|
* entitled (Pro/Ultra owner plan) and has actually configured branding — see
|
|
@@ -16,6 +17,11 @@ export interface ApiKeyValidationResult {
|
|
|
16
17
|
aiTier: string;
|
|
17
18
|
/** Ultra-gated, server-resolved: host allows embedded builders to publish/AI under this account with no domain limit. */
|
|
18
19
|
manageLandingPagePublishing: boolean;
|
|
20
|
+
/** Server-resolved canvas rendering engine for this account (plexo-web's canary rollout
|
|
21
|
+
* allowlist, see /api/v1/validate-key) -- undefined against an older plexo-web deployment
|
|
22
|
+
* that doesn't return the field yet, in which case PlexoBuilder falls back to its own
|
|
23
|
+
* `canvasFidelity` prop. */
|
|
24
|
+
canvasFidelity?: CanvasFidelityPreference;
|
|
19
25
|
branding?: OrgBranding;
|
|
20
26
|
error: string | null;
|
|
21
27
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charisol/plexo-sdk",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"description": "Plexo visual email and landing page builder SDK — drag-and-drop template editor with AI integration.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"email-builder",
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
"import": "./dist/compilerClient.js",
|
|
37
37
|
"require": "./dist/compilerClient.js"
|
|
38
38
|
},
|
|
39
|
+
"./sanitize": {
|
|
40
|
+
"types": "./dist/utilities/sanitizeCompiledHtml.d.ts",
|
|
41
|
+
"import": "./dist/sanitize.js",
|
|
42
|
+
"require": "./dist/sanitize.js"
|
|
43
|
+
},
|
|
39
44
|
"./dist/*": "./dist/*"
|
|
40
45
|
},
|
|
41
46
|
"files": [
|
|
@@ -43,12 +48,16 @@
|
|
|
43
48
|
"compiler.js",
|
|
44
49
|
"compiler.d.ts",
|
|
45
50
|
"compilerClient.js",
|
|
46
|
-
"compilerClient.d.ts"
|
|
51
|
+
"compilerClient.d.ts",
|
|
52
|
+
"sanitize.js",
|
|
53
|
+
"sanitize.d.ts"
|
|
47
54
|
],
|
|
48
55
|
"scripts": {
|
|
49
56
|
"dev": "vite",
|
|
50
57
|
"test": "vitest run",
|
|
58
|
+
"test:update-goldens": "UPDATE_GOLDENS=1 vitest run src/test/golden/goldenSnapshot.test.ts",
|
|
51
59
|
"build": "vite build && tsc -p tsconfig.lib.json",
|
|
60
|
+
"typecheck": "tsc -p tsconfig.app.json && tsc -p tsconfig.test.json",
|
|
52
61
|
"lint": "oxlint",
|
|
53
62
|
"preview": "vite preview",
|
|
54
63
|
"generate:social-icon-pngs": "tsx scripts/generate-social-icon-pngs.ts"
|
|
@@ -60,8 +69,10 @@
|
|
|
60
69
|
"isomorphic-dompurify": "^3.19.0",
|
|
61
70
|
"lucide-react": "^1.25.0",
|
|
62
71
|
"lucide-static": "^1.25.0",
|
|
72
|
+
"mjml-browser": "4.18.0",
|
|
63
73
|
"react": "^19.2.7",
|
|
64
74
|
"react-dom": "^19.2.7",
|
|
75
|
+
"sanitize-html": "^2.17.7",
|
|
65
76
|
"zod": "^4.4.3",
|
|
66
77
|
"zustand": "^5.0.14"
|
|
67
78
|
},
|
|
@@ -71,10 +82,14 @@
|
|
|
71
82
|
"@types/node": "^24.13.2",
|
|
72
83
|
"@types/react": "^19.2.17",
|
|
73
84
|
"@types/react-dom": "^19.2.3",
|
|
85
|
+
"@types/sanitize-html": "^2.16.1",
|
|
74
86
|
"@vitejs/plugin-react": "^6.0.3",
|
|
75
87
|
"autoprefixer": "^10.5.4",
|
|
76
88
|
"happy-dom": "^20.11.1",
|
|
89
|
+
"mjml": "4.18.0",
|
|
77
90
|
"oxlint": "^1.71.0",
|
|
91
|
+
"pixelmatch": "^7.2.0",
|
|
92
|
+
"pngjs": "^7.0.0",
|
|
78
93
|
"postcss": "^8.5.19",
|
|
79
94
|
"postcss-prefix-selector": "^2.1.1",
|
|
80
95
|
"sharp": "^0.34.5",
|