@charisol/plexo-sdk 1.4.2 → 1.4.4
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/{compilerClient-iBNHz76w.js → compilerClient-BwRHkl-b.js} +35 -1
- package/dist/compilerClient.js +1 -1
- package/dist/components/editor/dnd/DragOverContext.d.ts +4 -2
- package/dist/components/editor/frame/CompiledCanvasFrame.d.ts +7 -0
- package/dist/components/editor/frame/DndOverlayNode.d.ts +5 -3
- package/dist/components/editor/frame/useFrameNodeRects.d.ts +4 -0
- package/dist/components/editor/frame/useFrameTextEditing.d.ts +7 -0
- package/dist/index.js +14480 -14172
- package/dist/plexo-sdk.css +1 -1
- package/dist/store.d.ts +6 -0
- package/dist/utilities/dndCollision.d.ts +27 -0
- package/package.json +2 -1
|
@@ -105,7 +105,7 @@ var _ = "https://cdn.jsdelivr.net/npm/@charisol/plexo-sdk@latest/dist/social-ico
|
|
|
105
105
|
let t = `<img src="${`${_}/${a[e.provider] ? e.provider : "fallback"}.png`}" alt="" width="${parseInt(e.size, 10) || 36}" style="display:block;width:60%;height:60%;border:0;" />`;
|
|
106
106
|
return `<a href="${y(e.url)}" style="display:inline-flex;align-items:center;justify-content:center;width:${y(e.size)};height:${y(e.size)};background-color:${y(e.backgroundColor)};border-radius:${l(e.iconType)};text-decoration:none;">${t}</a>`;
|
|
107
107
|
}).join(""), d = `display:flex;flex-wrap:wrap;justify-content:${r};gap:${y(String(o))};padding:${y(s)};${c ? `margin:${y(c)};` : ""}`;
|
|
108
|
-
return `<mj-raw><div${w(i.id, f)} style="${d}">${u}</div></mj-raw>`;
|
|
108
|
+
return `<mj-raw><tr><td style="font-size:16px;"><div${w(i.id, f)} style="${d}">${u}</div></td></tr></mj-raw>`;
|
|
109
109
|
}
|
|
110
110
|
if (i.type === "menu") {
|
|
111
111
|
let t = e(i);
|
|
@@ -175,6 +175,40 @@ var _ = "https://cdn.jsdelivr.net/npm/@charisol/plexo-sdk@latest/dist/social-ico
|
|
|
175
175
|
case "button": return `${j}<a${h}${k} href="${y(p.href || "#")}" style="${m}">${y(p.text || "Button")}</a>`;
|
|
176
176
|
case "image": return `${j}<img${h}${k} src="${y(p.src || "")}" alt="${y(p.alt || "")}" style="${m}" />`;
|
|
177
177
|
case "html": return `${j}<div${h}${k} style="${m}">${String(p.htmlContent || "")}</div>`;
|
|
178
|
+
case "social": {
|
|
179
|
+
let e = i.style || {}, n = t(i), r = e.textAlign === "center" ? "center" : e.textAlign === "right" ? "flex-end" : "flex-start";
|
|
180
|
+
return `${j}<div${h}${k} style="${b({
|
|
181
|
+
padding: e.padding,
|
|
182
|
+
margin: e.margin,
|
|
183
|
+
display: "flex",
|
|
184
|
+
flexWrap: "wrap",
|
|
185
|
+
gap: e.iconSpacing || "8px",
|
|
186
|
+
justifyContent: r
|
|
187
|
+
})}">${n.map((e) => {
|
|
188
|
+
let t = `${_}/${a[e.provider] ? e.provider : "fallback"}.png`, n = b({
|
|
189
|
+
width: e.size,
|
|
190
|
+
height: e.size,
|
|
191
|
+
padding: "8px",
|
|
192
|
+
borderRadius: e.iconType === "square" ? "14px" : "9999px",
|
|
193
|
+
backgroundColor: e.backgroundColor,
|
|
194
|
+
display: "inline-flex",
|
|
195
|
+
alignItems: "center",
|
|
196
|
+
justifyContent: "center",
|
|
197
|
+
overflow: "hidden"
|
|
198
|
+
}), r = `<img src="${y(t)}" alt="" width="${parseInt(e.size, 10) || 36}" style="display:block;width:60%;height:60%;border:0;" />`;
|
|
199
|
+
return `<a href="${y(e.url)}" style="${n}text-decoration:none;">${r}</a>`;
|
|
200
|
+
}).join("")}</div>`;
|
|
201
|
+
}
|
|
202
|
+
case "menu": {
|
|
203
|
+
let t = i.style || {}, n = e(i), r = t.textAlign === "center" ? "center" : t.textAlign === "right" ? "flex-end" : "flex-start";
|
|
204
|
+
return `${j}<div${h}${k} style="${b({
|
|
205
|
+
...t,
|
|
206
|
+
display: "flex",
|
|
207
|
+
flexWrap: "wrap",
|
|
208
|
+
gap: "16px",
|
|
209
|
+
justifyContent: r
|
|
210
|
+
})}">${n.map((e) => `<a href="${y(e.href)}" style="text-decoration:none;color:inherit;font-weight:${y(String(t.fontWeight || 600))};">${y(e.label)}</a>`).join("")}</div>`;
|
|
211
|
+
}
|
|
178
212
|
case "blog_title":
|
|
179
213
|
case "blog_content":
|
|
180
214
|
case "blog_featured_image":
|
package/dist/compilerClient.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./compilerClient-
|
|
1
|
+
import { t as e } from "./compilerClient-BwRHkl-b.js";
|
|
2
2
|
export { e as parseJsonToTargetFormat };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
/** Which edge of the currently-hovered sortable item the dragged item would land on
|
|
2
|
-
|
|
1
|
+
/** Which edge of the currently-hovered sortable item the dragged item would land on --
|
|
2
|
+
* top/bottom for vertically-stacked items (rows, elements), left/right for columns, which
|
|
3
|
+
* sit side by side instead. */
|
|
4
|
+
export type DropEdge = 'top' | 'bottom' | 'left' | 'right' | null;
|
|
3
5
|
export interface DragOverInfo {
|
|
4
6
|
overId: string | null;
|
|
5
7
|
edge: DropEdge;
|
|
@@ -9,6 +9,13 @@ export interface CompiledCanvasFrameProps {
|
|
|
9
9
|
* point for a future overlay layer to start querying/measuring nodes. Receives null on
|
|
10
10
|
* unmount/cleanup so callers can safely drop any references they held. */
|
|
11
11
|
onDocumentReady?: (doc: Document | null, win: Window | null) => void;
|
|
12
|
+
/** Node ids (data-plexo-id / plexo-node-<id>) that must never be touched by a morph, however
|
|
13
|
+
* much their compiled markup has changed -- the one node actively being edited (see
|
|
14
|
+
* useFrameTextEditing), so an UNRELATED edit elsewhere in the template (a totally different
|
|
15
|
+
* row's background color, say) can't silently reset the live contentEditable state,
|
|
16
|
+
* selection, or in-progress uncommitted typing on this one out from under the user. Every
|
|
17
|
+
* other node updates normally regardless. */
|
|
18
|
+
protectedNodeIds?: string[];
|
|
12
19
|
className?: string;
|
|
13
20
|
style?: React.CSSProperties;
|
|
14
21
|
title?: string;
|
|
@@ -24,6 +24,10 @@ export interface EmptyColumnQuickInsert {
|
|
|
24
24
|
export interface DndOverlayNodeProps {
|
|
25
25
|
nodeRect: FrameNodeRect;
|
|
26
26
|
data: DndOverlayNodeData;
|
|
27
|
+
/** Nesting depth (0 = top-level row and its own direct columns/elements, +1 for each level
|
|
28
|
+
* of nested row) -- see overlayNodeStyle's own zIndex comment for why this has to factor
|
|
29
|
+
* into stacking order, not just `kind` alone. */
|
|
30
|
+
depth: number;
|
|
27
31
|
isSelected: boolean;
|
|
28
32
|
isHovered: boolean;
|
|
29
33
|
disabled: boolean;
|
|
@@ -52,8 +56,6 @@ export interface DndOverlayNodeProps {
|
|
|
52
56
|
* legacy canvas (see PlexoBuilder's `handleDragStart`/`handleDragOver`/`handleDragEnd`, which
|
|
53
57
|
* dispatch purely on `active.data.current`/`over.data.current` and never touch the DOM — so an
|
|
54
58
|
* overlay-registered draggable/droppable using the same `id`/`data` shape is handled identically,
|
|
55
|
-
* with zero changes to that logic).
|
|
56
|
-
* `data.type` — calling both `useDroppable` and `useSortable` (which itself registers a
|
|
57
|
-
* droppable) for the same id would double-register that id in dnd-kit's droppable registry.
|
|
59
|
+
* with zero changes to that logic).
|
|
58
60
|
*/
|
|
59
61
|
export declare const DndOverlayNode: React.FC<DndOverlayNodeProps>;
|
|
@@ -9,6 +9,10 @@ export interface FrameNodeRect {
|
|
|
9
9
|
rect: DOMRect;
|
|
10
10
|
el: HTMLElement;
|
|
11
11
|
}
|
|
12
|
+
/** Exported for CompiledCanvasFrame's own morph-time use (protecting the actively-edited node
|
|
13
|
+
* from being touched by an unrelated recompile) -- same identity mechanism, no reason to
|
|
14
|
+
* duplicate the two-selector matching logic a second time. */
|
|
15
|
+
export declare function extractNodeId(el: Element): string | null;
|
|
12
16
|
/**
|
|
13
17
|
* Tracks the on-screen (iframe-local) position of every identifiable row/column/element node
|
|
14
18
|
* in a compiled-canvas-frame's document, re-measuring whenever the document's layout could
|
|
@@ -40,6 +40,13 @@ export interface FrameTextEditingApi {
|
|
|
40
40
|
* into the parent document blurs the iframe's active element, so the selection has to be
|
|
41
41
|
* explicitly restored immediately before every formatting command, not just read live. */
|
|
42
42
|
restoreSelection: () => void;
|
|
43
|
+
/** True from the moment a mousedown starts inside the node being edited until the next
|
|
44
|
+
* mouseup anywhere -- i.e. "a drag-to-select gesture is in progress". Callers should AND
|
|
45
|
+
* this into every overlay layer's own `disabled` prop for as long as it's true (see this
|
|
46
|
+
* flag's own effect below for why: without it, dragging a selection past the edited node's
|
|
47
|
+
* own bounds hands every further mousemove to whatever overlay hit-box the cursor is now
|
|
48
|
+
* over instead of the iframe, silently freezing the selection). */
|
|
49
|
+
isDragSelecting: boolean;
|
|
43
50
|
}
|
|
44
51
|
/**
|
|
45
52
|
* Owns the compiled canvas's in-frame text editing lifecycle: turning a node's real DOM
|