@charisol/plexo-sdk 1.0.46 → 1.1.2
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 +4982 -4911
- package/dist/playground.d.ts +1 -1
- package/dist/store.d.ts +6 -0
- package/dist/utilities/playground.interfaces.d.ts +46 -0
- package/dist/utilities/useApiKeyValidation.d.ts +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,6 +164,9 @@ export default function EditorPage() {
|
|
|
164
164
|
| `unsplashKey` | `string` | — | Unsplash API key for stock images |
|
|
165
165
|
| `pexelsKey` | `string` | — | Pexels API key for stock images |
|
|
166
166
|
| `pixabayKey` | `string` | — | Pixabay API key for stock images |
|
|
167
|
+
| `readOnly` | `boolean` | `false` | Forces the canvas into read-only preview (no drag-and-drop, no property panels, no Save button) regardless of the built-in Preview/Edit toggle. For host apps enforcing their own permission model (e.g. a viewer/commenter collaborator role). `onRequestComment` still fires while `readOnly` is on. |
|
|
168
|
+
| `commentMode` | `boolean` | `false` | When on, clicking any row/column/element calls `onRequestComment` with that node's id/type instead of selecting it for editing — the building block for a Figma-style "click to pin a comment" host feature. |
|
|
169
|
+
| `onRequestComment` | `(target: CommentTarget) => void` | — | Fired on canvas click while `commentMode` is on. `CommentTarget` is `{ nodeId, nodeType: 'row' \| 'column' \| 'element', clientX, clientY }`. |
|
|
167
170
|
|
|
168
171
|
---
|
|
169
172
|
|
|
@@ -218,6 +221,8 @@ const json = builderRef.current.getJson();
|
|
|
218
221
|
|--------|-----------|-------------|
|
|
219
222
|
| `exportDesign` | `(target: 'email' \| 'landing_page') => Promise<{ json: TemplateJSON; html: string }>` | Compile & export the current design |
|
|
220
223
|
| `getJson` | `() => TemplateJSON` | Get the raw design JSON snapshot |
|
|
224
|
+
| `getNodeRect` | `(nodeId: string) => DOMRect \| null` | On-screen bounding rect of a row/column/element by its JSON id, or `null` if not currently rendered. Re-call on scroll/resize/device-view-change. Useful for positioning host UI (e.g. a comment pin) over a specific canvas node. |
|
|
225
|
+
| `getCanvasContainerRect` | `() => DOMRect \| null` | On-screen bounding rect of the canvas viewport itself. |
|
|
221
226
|
|
|
222
227
|
---
|
|
223
228
|
|
|
@@ -260,6 +265,10 @@ const PlexoBuilder = lazy(() =>
|
|
|
260
265
|
|
|
261
266
|
## Changelog
|
|
262
267
|
|
|
268
|
+
### 1.1.0
|
|
269
|
+
- New `readOnly`, `commentMode`, and `onRequestComment` props, plus `getNodeRect`/`getCanvasContainerRect` on the `PlexoBuilderRef` — lets a host build Figma-style anchored comments on top of the canvas (click a node while `commentMode` is on to get its id/type/coordinates, position an overlay via `getNodeRect`, enforce a read-only collaborator role via `readOnly`) without needing to know the canvas's internal DOM structure. Fully backwards compatible — no existing prop or ref method changed.
|
|
270
|
+
- Every row/column/element wrapper now carries a `data-plexo-node-type="row"|"column"|"element"` attribute alongside its existing `id` (already the node's stable JSON id).
|
|
271
|
+
|
|
263
272
|
### Unreleased
|
|
264
273
|
- **Breaking:** Removed the `aiApiKey` prop. AI generation now runs server-side — your provider key is configured once against your Plexo account (encrypted at rest) instead of being passed to the browser on every render.
|
|
265
274
|
- **Breaking:** `TemplateJSON.body.aiConfig` no longer accepts `apiKey`/`provider` — only `useAi`/`tier` remain, for the same reason (a template's JSON is loaded client-side, so it can't hold a secret safely).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
export { PlexoBuilder } from './playground';
|
|
3
|
-
export type { PlexoBuilderProps, PlexoBuilderRef, PlexoTargetType, MergeTag } from './playground';
|
|
3
|
+
export type { PlexoBuilderProps, PlexoBuilderRef, PlexoTargetType, MergeTag, CommentTarget } from './playground';
|
|
4
4
|
export { compileToHTML, compileToPlainText, compileToHTMLWithStrataAuto, injectStrataBundle } from './utilities/compiler';
|
|
5
5
|
export { parseJsonToTargetFormat } from './utilities/compilerClient';
|
|
6
6
|
export { createTokenMapping, applyTokensToElement, getTokensByCategory, generateTokenCSS, resolveTokenValue, createTokenSwatch, } from './utilities/strataTokenMapping';
|