@nuasite/cms 0.9.2 → 0.10.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/README.md +21 -0
- package/dist/editor.js +6526 -6262
- package/package.json +1 -1
- package/src/editor/components/fields.tsx +48 -0
- package/src/editor/components/selection-highlight.tsx +200 -0
- package/src/editor/components/seo-editor.tsx +114 -17
- package/src/editor/components/toolbar.tsx +15 -0
- package/src/editor/hooks/useBlockEditorHandlers.ts +8 -1
- package/src/editor/hooks/useElementDetection.ts +26 -3
- package/src/editor/index.tsx +25 -2
- package/src/index.ts +2 -0
- package/src/seo-processor.ts +12 -0
- package/src/types.ts +16 -0
package/README.md
CHANGED
|
@@ -307,6 +307,27 @@ Sent when the user hovers or clicks a CMS element. Contains full element metadat
|
|
|
307
307
|
|
|
308
308
|
Sent when no element is hovered. No additional data.
|
|
309
309
|
|
|
310
|
+
### Inbound Messages (Parent → Iframe)
|
|
311
|
+
|
|
312
|
+
The parent window can send commands to the editor iframe using `postMessage`:
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
const iframe = document.querySelector('iframe')
|
|
316
|
+
|
|
317
|
+
// Deselect the currently selected component
|
|
318
|
+
iframe.contentWindow.postMessage({ type: 'cms-deselect-element' }, '*')
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
All inbound message types are exported as TypeScript interfaces:
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
import type { CmsDeselectElementMessage, CmsInboundMessage } from '@nuasite/cms'
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
#### `cms-deselect-element`
|
|
328
|
+
|
|
329
|
+
Deselects the currently selected component and closes the block editor. No additional data required.
|
|
330
|
+
|
|
310
331
|
## Exports
|
|
311
332
|
|
|
312
333
|
```typescript
|