@charisol/plexo-sdk 1.0.46 → 1.1.1
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/README.md +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3434 -3404
- package/dist/playground.d.ts +1 -1
- package/dist/utilities/playground.interfaces.d.ts +38 -0
- package/package.json +1 -1
package/dist/playground.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PlexoBuilderProps, PlexoBuilderRef } from './utilities/playground.interfaces';
|
|
3
|
-
export type { PlexoBuilderProps, PlexoBuilderRef, PlexoTargetType, MergeTag } from './utilities/playground.interfaces';
|
|
3
|
+
export type { PlexoBuilderProps, PlexoBuilderRef, PlexoTargetType, MergeTag, CommentTarget } from './utilities/playground.interfaces';
|
|
4
4
|
export declare const PlexoBuilder: React.ForwardRefExoticComponent<PlexoBuilderProps & React.RefAttributes<PlexoBuilderRef>>;
|
|
5
5
|
export declare const Playground: React.FC;
|
|
@@ -67,6 +67,24 @@ export interface PlexoBuilderRef {
|
|
|
67
67
|
html: string;
|
|
68
68
|
}>;
|
|
69
69
|
getJson: () => TemplateJSON;
|
|
70
|
+
/**
|
|
71
|
+
* On-screen bounding rect of a row/column/element by its stable JSON id (every
|
|
72
|
+
* RowJSON/ColumnJSON/ElementJSON node carries one), or null if that id isn't currently
|
|
73
|
+
* rendered (e.g. scrolled out via a collapsed accordion, or belongs to a different
|
|
74
|
+
* device view). Intended for a host to position its own UI (e.g. a comment pin) over a
|
|
75
|
+
* specific canvas node — re-call on scroll/resize/device-view-change to stay accurate,
|
|
76
|
+
* since layout can shift without the id itself changing.
|
|
77
|
+
*/
|
|
78
|
+
getNodeRect: (nodeId: string) => DOMRect | null;
|
|
79
|
+
/** On-screen bounding rect of the canvas viewport itself, for positioning host UI relative to the whole canvas rather than one node. */
|
|
80
|
+
getCanvasContainerRect: () => DOMRect | null;
|
|
81
|
+
}
|
|
82
|
+
/** Target passed to `onRequestComment` — see `PlexoBuilderProps.commentMode`. */
|
|
83
|
+
export interface CommentTarget {
|
|
84
|
+
nodeId: string;
|
|
85
|
+
nodeType: 'row' | 'column' | 'element';
|
|
86
|
+
clientX: number;
|
|
87
|
+
clientY: number;
|
|
70
88
|
}
|
|
71
89
|
/**
|
|
72
90
|
* A merge tag that hosts can register so it appears in the sidebar's Merge Tags tab.
|
|
@@ -177,6 +195,26 @@ export interface PlexoBuilderProps {
|
|
|
177
195
|
* ]}
|
|
178
196
|
*/
|
|
179
197
|
mergeTags?: MergeTag[];
|
|
198
|
+
/**
|
|
199
|
+
* Forces the canvas into its read-only preview state (drag-and-drop, property panels,
|
|
200
|
+
* and the Save button are all unavailable) regardless of the built-in Preview/Edit
|
|
201
|
+
* toggle. Intended for host apps enforcing their own permission model (e.g. a
|
|
202
|
+
* "Viewer"/"Commenter" collaborator role) — the canvas still renders and still fires
|
|
203
|
+
* `onRequestComment` when `commentMode` is on, so read-only users can still comment.
|
|
204
|
+
* @default false
|
|
205
|
+
*/
|
|
206
|
+
readOnly?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* When true, clicking any row/column/element on the canvas calls `onRequestComment`
|
|
209
|
+
* with that node's id/type and the click's viewport coordinates, instead of the normal
|
|
210
|
+
* select-to-edit behavior. Lets a host build a Figma-style "click to pin a comment"
|
|
211
|
+
* mode on top of the canvas without needing to know its internal DOM structure beyond
|
|
212
|
+
* the node id it already gets back from `onRequestComment`/`getNodeRect`.
|
|
213
|
+
* @default false
|
|
214
|
+
*/
|
|
215
|
+
commentMode?: boolean;
|
|
216
|
+
/** Fired on canvas click while `commentMode` is true. See `commentMode`. */
|
|
217
|
+
onRequestComment?: (target: CommentTarget) => void;
|
|
180
218
|
}
|
|
181
219
|
export interface ColumnLayoutOption {
|
|
182
220
|
label: string;
|
package/package.json
CHANGED