@instructure/platform-block-content-editor 1.0.0 → 1.1.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.
Files changed (192) hide show
  1. package/README.md +187 -0
  2. package/dist/contexts/AIActionContext.d.ts +38 -0
  3. package/dist/contexts/AIActionContext.d.ts.map +1 -0
  4. package/dist/contexts/BlockEditorApiContext.d.ts +78 -0
  5. package/dist/contexts/BlockEditorApiContext.d.ts.map +1 -1
  6. package/dist/contexts/RichTextEditorContext.d.ts +28 -0
  7. package/dist/contexts/RichTextEditorContext.d.ts.map +1 -0
  8. package/dist/editor/BlockContentEditor.d.ts +40 -0
  9. package/dist/editor/BlockContentEditor.d.ts.map +1 -0
  10. package/dist/editor/ai/BlockAIMenu.d.ts +17 -0
  11. package/dist/editor/ai/BlockAIMenu.d.ts.map +1 -0
  12. package/dist/editor/ai/BlockAIMenuContent.d.ts +17 -0
  13. package/dist/editor/ai/BlockAIMenuContent.d.ts.map +1 -0
  14. package/dist/editor/ai/PreviewBlockModal.d.ts +29 -0
  15. package/dist/editor/ai/PreviewBlockModal.d.ts.map +1 -0
  16. package/dist/editor/ai/aiMenuStyles.d.ts +23 -0
  17. package/dist/editor/ai/aiMenuStyles.d.ts.map +1 -0
  18. package/dist/editor/ai/aiTranslations.d.ts +79 -0
  19. package/dist/editor/ai/aiTranslations.d.ts.map +1 -0
  20. package/dist/editor/ai/aiTypes.d.ts +13 -0
  21. package/dist/editor/ai/aiTypes.d.ts.map +1 -0
  22. package/dist/editor/ai/constants.d.ts +8 -0
  23. package/dist/editor/ai/constants.d.ts.map +1 -0
  24. package/dist/editor/ai/index.d.ts +7 -0
  25. package/dist/editor/ai/index.d.ts.map +1 -0
  26. package/dist/editor/ai/useBlockAIPopover.d.ts +30 -0
  27. package/dist/editor/ai/useBlockAIPopover.d.ts.map +1 -0
  28. package/dist/editor/ai/useGenerateAltText.d.ts +11 -0
  29. package/dist/editor/ai/useGenerateAltText.d.ts.map +1 -0
  30. package/dist/editor/canvas/DesignerArea.d.ts +38 -0
  31. package/dist/editor/canvas/DesignerArea.d.ts.map +1 -0
  32. package/dist/editor/canvas/DesignerCanvas.d.ts +35 -0
  33. package/dist/editor/canvas/DesignerCanvas.d.ts.map +1 -0
  34. package/dist/editor/canvas/DropGridOverlay.d.ts +24 -0
  35. package/dist/editor/canvas/DropGridOverlay.d.ts.map +1 -0
  36. package/dist/editor/canvas/GridDndContext.d.ts +11 -0
  37. package/dist/editor/canvas/GridDndContext.d.ts.map +1 -0
  38. package/dist/editor/canvas/GridDndProvider.d.ts +17 -0
  39. package/dist/editor/canvas/GridDndProvider.d.ts.map +1 -0
  40. package/dist/editor/canvas/GridItemChild.d.ts +44 -0
  41. package/dist/editor/canvas/GridItemChild.d.ts.map +1 -0
  42. package/dist/editor/canvas/GridItemContainer.d.ts +49 -0
  43. package/dist/editor/canvas/GridItemContainer.d.ts.map +1 -0
  44. package/dist/editor/canvas/GridViewer.d.ts +114 -0
  45. package/dist/editor/canvas/GridViewer.d.ts.map +1 -0
  46. package/dist/editor/canvas/TwoColumnDesigner.d.ts +34 -0
  47. package/dist/editor/canvas/TwoColumnDesigner.d.ts.map +1 -0
  48. package/dist/editor/canvas/canvasStyles.d.ts +36 -0
  49. package/dist/editor/canvas/canvasStyles.d.ts.map +1 -0
  50. package/dist/editor/canvas/canvasTranslations.d.ts +64 -0
  51. package/dist/editor/canvas/canvasTranslations.d.ts.map +1 -0
  52. package/dist/editor/canvas/index.d.ts +5 -0
  53. package/dist/editor/canvas/index.d.ts.map +1 -0
  54. package/dist/editor/document/constants.d.ts +23 -0
  55. package/dist/editor/document/constants.d.ts.map +1 -0
  56. package/dist/editor/document/designerItemAction.d.ts +16 -0
  57. package/dist/editor/document/designerItemAction.d.ts.map +1 -0
  58. package/dist/editor/document/utils.d.ts +172 -0
  59. package/dist/editor/document/utils.d.ts.map +1 -0
  60. package/dist/editor/document/utils.test.d.ts +2 -0
  61. package/dist/editor/document/utils.test.d.ts.map +1 -0
  62. package/dist/editor/history/types.d.ts +25 -0
  63. package/dist/editor/history/types.d.ts.map +1 -0
  64. package/dist/editor/history/undoRedoManager.d.ts +3 -0
  65. package/dist/editor/history/undoRedoManager.d.ts.map +1 -0
  66. package/dist/editor/history/undoRedoManager.test.d.ts +2 -0
  67. package/dist/editor/history/undoRedoManager.test.d.ts.map +1 -0
  68. package/dist/editor/history/useUndoRedo.d.ts +11 -0
  69. package/dist/editor/history/useUndoRedo.d.ts.map +1 -0
  70. package/dist/editor/history/useUndoRedo.test.d.ts +2 -0
  71. package/dist/editor/history/useUndoRedo.test.d.ts.map +1 -0
  72. package/dist/editor/index.d.ts +16 -0
  73. package/dist/editor/index.d.ts.map +1 -0
  74. package/dist/editor/preview/PreviewArea.d.ts +31 -0
  75. package/dist/editor/preview/PreviewArea.d.ts.map +1 -0
  76. package/dist/editor/preview/constants.d.ts +9 -0
  77. package/dist/editor/preview/constants.d.ts.map +1 -0
  78. package/dist/editor/preview/index.d.ts +4 -0
  79. package/dist/editor/preview/index.d.ts.map +1 -0
  80. package/dist/editor/preview/previewStyles.d.ts +20 -0
  81. package/dist/editor/preview/previewStyles.d.ts.map +1 -0
  82. package/dist/editor/preview/previewTranslations.d.ts +18 -0
  83. package/dist/editor/preview/previewTranslations.d.ts.map +1 -0
  84. package/dist/editor/sidebar/DesignerNav.d.ts +28 -0
  85. package/dist/editor/sidebar/DesignerNav.d.ts.map +1 -0
  86. package/dist/editor/sidebar/form/ComponentEditorForm.d.ts +12 -0
  87. package/dist/editor/sidebar/form/ComponentEditorForm.d.ts.map +1 -0
  88. package/dist/editor/sidebar/form/FormFieldWrapper.d.ts +13 -0
  89. package/dist/editor/sidebar/form/FormFieldWrapper.d.ts.map +1 -0
  90. package/dist/editor/sidebar/form/fieldRendererUtils.d.ts +24 -0
  91. package/dist/editor/sidebar/form/fieldRendererUtils.d.ts.map +1 -0
  92. package/dist/editor/sidebar/form/fieldRenderers.d.ts +6 -0
  93. package/dist/editor/sidebar/form/fieldRenderers.d.ts.map +1 -0
  94. package/dist/editor/sidebar/form/formTranslations.d.ts +92 -0
  95. package/dist/editor/sidebar/form/formTranslations.d.ts.map +1 -0
  96. package/dist/editor/sidebar/form/formUtils.d.ts +7 -0
  97. package/dist/editor/sidebar/form/formUtils.d.ts.map +1 -0
  98. package/dist/editor/sidebar/form/index.d.ts +7 -0
  99. package/dist/editor/sidebar/form/index.d.ts.map +1 -0
  100. package/dist/editor/sidebar/form/knowledgeCheckEditor.d.ts +10 -0
  101. package/dist/editor/sidebar/form/knowledgeCheckEditor.d.ts.map +1 -0
  102. package/dist/editor/sidebar/form/renderers/AltTextFieldRenderer.d.ts +4 -0
  103. package/dist/editor/sidebar/form/renderers/AltTextFieldRenderer.d.ts.map +1 -0
  104. package/dist/editor/sidebar/form/renderers/AnswerArrayFieldRenderer.d.ts +4 -0
  105. package/dist/editor/sidebar/form/renderers/AnswerArrayFieldRenderer.d.ts.map +1 -0
  106. package/dist/editor/sidebar/form/renderers/ObjectArrayFieldRenderer.d.ts +4 -0
  107. package/dist/editor/sidebar/form/renderers/ObjectArrayFieldRenderer.d.ts.map +1 -0
  108. package/dist/editor/sidebar/form/uploaders/FileUploader.d.ts +24 -0
  109. package/dist/editor/sidebar/form/uploaders/FileUploader.d.ts.map +1 -0
  110. package/dist/editor/sidebar/form/uploaders/ImageUploader.d.ts +8 -0
  111. package/dist/editor/sidebar/form/uploaders/ImageUploader.d.ts.map +1 -0
  112. package/dist/editor/sidebar/form/uploaders/VideoUploader.d.ts +8 -0
  113. package/dist/editor/sidebar/form/uploaders/VideoUploader.d.ts.map +1 -0
  114. package/dist/editor/sidebar/panel/DesignerSideBar.d.ts +18 -0
  115. package/dist/editor/sidebar/panel/DesignerSideBar.d.ts.map +1 -0
  116. package/dist/editor/sidebar/panel/MobileToolOverlay.d.ts +13 -0
  117. package/dist/editor/sidebar/panel/MobileToolOverlay.d.ts.map +1 -0
  118. package/dist/editor/sidebar/panel/MobileToolbar.d.ts +10 -0
  119. package/dist/editor/sidebar/panel/MobileToolbar.d.ts.map +1 -0
  120. package/dist/editor/sidebar/panel/ToolBody.d.ts +11 -0
  121. package/dist/editor/sidebar/panel/ToolBody.d.ts.map +1 -0
  122. package/dist/editor/sidebar/panel/ToolContentContainer.d.ts +27 -0
  123. package/dist/editor/sidebar/panel/ToolContentContainer.d.ts.map +1 -0
  124. package/dist/editor/sidebar/panel/ToolHeader.d.ts +24 -0
  125. package/dist/editor/sidebar/panel/ToolHeader.d.ts.map +1 -0
  126. package/dist/editor/sidebar/panel/ToolHeaderActionsContext.d.ts +8 -0
  127. package/dist/editor/sidebar/panel/ToolHeaderActionsContext.d.ts.map +1 -0
  128. package/dist/editor/sidebar/panel/ToolIconButtons.d.ts +19 -0
  129. package/dist/editor/sidebar/panel/ToolIconButtons.d.ts.map +1 -0
  130. package/dist/editor/sidebar/panel/ToolWrapper.d.ts +16 -0
  131. package/dist/editor/sidebar/panel/ToolWrapper.d.ts.map +1 -0
  132. package/dist/editor/sidebar/panel/constants.d.ts +23 -0
  133. package/dist/editor/sidebar/panel/constants.d.ts.map +1 -0
  134. package/dist/editor/sidebar/panel/index.d.ts +5 -0
  135. package/dist/editor/sidebar/panel/index.d.ts.map +1 -0
  136. package/dist/editor/sidebar/panel/panelStyles.d.ts +29 -0
  137. package/dist/editor/sidebar/panel/panelStyles.d.ts.map +1 -0
  138. package/dist/editor/sidebar/panel/types.d.ts +80 -0
  139. package/dist/editor/sidebar/panel/types.d.ts.map +1 -0
  140. package/dist/editor/sidebar/panel/useFocusReturn.d.ts +8 -0
  141. package/dist/editor/sidebar/panel/useFocusReturn.d.ts.map +1 -0
  142. package/dist/editor/sidebar/sidebarTranslations.d.ts +53 -0
  143. package/dist/editor/sidebar/sidebarTranslations.d.ts.map +1 -0
  144. package/dist/editor/sidebar/tray/BlockTray.d.ts +30 -0
  145. package/dist/editor/sidebar/tray/BlockTray.d.ts.map +1 -0
  146. package/dist/editor/sidebar/tray/ComponentsTray.d.ts +4 -0
  147. package/dist/editor/sidebar/tray/ComponentsTray.d.ts.map +1 -0
  148. package/dist/editor/sidebar/tray/InteractiveTray.d.ts +4 -0
  149. package/dist/editor/sidebar/tray/InteractiveTray.d.ts.map +1 -0
  150. package/dist/editor/sidebar/tray/LayoutTray.d.ts +4 -0
  151. package/dist/editor/sidebar/tray/LayoutTray.d.ts.map +1 -0
  152. package/dist/editor/sidebar/tray/SharedTrayComponents.d.ts +64 -0
  153. package/dist/editor/sidebar/tray/SharedTrayComponents.d.ts.map +1 -0
  154. package/dist/editor/sidebar/tray/TemplatesPanel.d.ts +4 -0
  155. package/dist/editor/sidebar/tray/TemplatesPanel.d.ts.map +1 -0
  156. package/dist/editor/sidebar/tray/TrayDragLayer.d.ts +14 -0
  157. package/dist/editor/sidebar/tray/TrayDragLayer.d.ts.map +1 -0
  158. package/dist/editor/sidebar/tray/blockDefinitions.d.ts +11 -0
  159. package/dist/editor/sidebar/tray/blockDefinitions.d.ts.map +1 -0
  160. package/dist/editor/sidebar/tray/index.d.ts +9 -0
  161. package/dist/editor/sidebar/tray/index.d.ts.map +1 -0
  162. package/dist/editor/sidebar/tray/trayStyles.d.ts +20 -0
  163. package/dist/editor/sidebar/tray/trayStyles.d.ts.map +1 -0
  164. package/dist/editor/sidebar/useDesignerSelectionFocus.d.ts +51 -0
  165. package/dist/editor/sidebar/useDesignerSelectionFocus.d.ts.map +1 -0
  166. package/dist/editor/state/applyTemplatePatch.d.ts +46 -0
  167. package/dist/editor/state/applyTemplatePatch.d.ts.map +1 -0
  168. package/dist/editor/state/applyTemplatePatch.test.d.ts +2 -0
  169. package/dist/editor/state/applyTemplatePatch.test.d.ts.map +1 -0
  170. package/dist/editor/state/useBlockEditorState.d.ts +57 -0
  171. package/dist/editor/state/useBlockEditorState.d.ts.map +1 -0
  172. package/dist/editor/state/useBlockEditorState.test.d.ts +2 -0
  173. package/dist/editor/state/useBlockEditorState.test.d.ts.map +1 -0
  174. package/dist/editor/validation/templateDataValidator.d.ts +48 -0
  175. package/dist/editor/validation/templateDataValidator.d.ts.map +1 -0
  176. package/dist/editor/validation/templateDataValidator.test.d.ts +2 -0
  177. package/dist/editor/validation/templateDataValidator.test.d.ts.map +1 -0
  178. package/dist/index.d.ts +4 -1
  179. package/dist/index.d.ts.map +1 -1
  180. package/dist/index.js +14282 -1869
  181. package/dist/registry/blockRegistry.d.ts +8 -0
  182. package/dist/registry/blockRegistry.d.ts.map +1 -1
  183. package/dist/registry/defineBlock.d.ts +5 -0
  184. package/dist/registry/defineBlock.d.ts.map +1 -1
  185. package/dist/schema/index.d.ts +1 -1
  186. package/dist/schema/index.d.ts.map +1 -1
  187. package/dist/schema/zodExtensions.d.ts +2 -0
  188. package/dist/schema/zodExtensions.d.ts.map +1 -1
  189. package/dist/utils/useMediaQuery.d.ts +7 -0
  190. package/dist/utils/useMediaQuery.d.ts.map +1 -0
  191. package/locales/en.json +126 -1
  192. package/package.json +34 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/constants.ts"],"names":[],"mappings":"AAkBA,iEAAiE;AACjE,eAAO,MAAM,mBAAmB;;;;CAItB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ export { BlockAIMenu, type BlockAIMenuProps } from './BlockAIMenu';
2
+ export { PreviewBlockModal, type PreviewBlockModalProps } from './PreviewBlockModal';
3
+ export { useGenerateAltText } from './useGenerateAltText';
4
+ export { PREVIEW_BLOCK_VIEWS, type PreviewBlockView } from './constants';
5
+ export { type DesignerAITranslations, DesignerAIEnglish } from './aiTranslations';
6
+ export type { AIInlineTemplateContentPayload } from './aiTypes';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,EAAE,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACxE,OAAO,EAAE,KAAK,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACjF,YAAY,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAA"}
@@ -0,0 +1,30 @@
1
+ interface UseBlockAIPopoverProps {
2
+ componentType: string;
3
+ componentData: Record<string, unknown>;
4
+ componentId?: string;
5
+ onApply: (newProps: Record<string, unknown>) => void;
6
+ onClose: () => void;
7
+ }
8
+ /**
9
+ * The shared brain behind the block-level AI menu: prompt/thinking/preview state, aborting, and
10
+ * the AI-action call plus its response extraction. Host-agnostic — it reads the injected
11
+ * `useAIAction()` seam (the host closes over course/chat context) and preserves the abort signal
12
+ * for `handleStop`. If no seam is provided it is inert.
13
+ */
14
+ export declare const useBlockAIPopover: ({ componentType, componentData, componentId, onApply, onClose, }: UseBlockAIPopoverProps) => {
15
+ prompt: string;
16
+ setPrompt: import('react').Dispatch<import('react').SetStateAction<string>>;
17
+ isThinking: boolean;
18
+ error: string | null;
19
+ clearError: () => void;
20
+ previewFirst: boolean;
21
+ setPreviewFirst: import('react').Dispatch<import('react').SetStateAction<boolean>>;
22
+ pendingProps: Record<string, unknown> | null;
23
+ handleSend: (instruction?: string) => Promise<void>;
24
+ handleStop: () => void;
25
+ handleRegenerate: (refinementText: string) => Promise<void>;
26
+ handleApply: () => void;
27
+ handleCancelPreview: () => void;
28
+ };
29
+ export {};
30
+ //# sourceMappingURL=useBlockAIPopover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBlockAIPopover.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/useBlockAIPopover.ts"],"names":[],"mappings":"AAyBA,UAAU,sBAAsB;IAC9B,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACpD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,kEAM/B,sBAAsB;;;;;;;;;+BAoDiB,MAAM;;uCAwBE,MAAM;;;CAgDvD,CAAA"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generates image alt text via the injected AI-action seam: reads a `File`/`Blob` to base64 and
3
+ * sends the `generate_alt_text` tool, returning the `alt_text` string. Reports failure through
4
+ * `error` rather than throwing. Inert (returns null) when no seam is provided.
5
+ */
6
+ export declare function useGenerateAltText(): {
7
+ isLoading: boolean;
8
+ error: string | null;
9
+ generateAltText: (file: File | Blob) => Promise<string | null>;
10
+ };
11
+ //# sourceMappingURL=useGenerateAltText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGenerateAltText.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/useGenerateAltText.ts"],"names":[],"mappings":"AAmDA;;;;GAIG;AACH,wBAAgB,kBAAkB;;;4BAMK,IAAI,GAAG,IAAI,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;EAyC1E"}
@@ -0,0 +1,38 @@
1
+ import { RefObject } from 'react';
2
+ import { BlockRegistry, LayoutNode, TemplateData } from '../../registry';
3
+ import { TrayDropTarget, TreePath } from '../document/utils';
4
+ export interface DesignerAreaProps {
5
+ /** The layout tree to author. */
6
+ templateLayout: LayoutNode[];
7
+ /** Content props keyed by node id. */
8
+ templateData: TemplateData;
9
+ /** The registry the document's blocks resolve against. */
10
+ componentRegistry: BlockRegistry;
11
+ /** The engine's selected component id (drives the selection chrome). */
12
+ selectedComponentId: string | null;
13
+ /** Commit a new layout (e.g. `useBlockEditorState().changeLayout`). */
14
+ onLayoutChange: (layout: LayoutNode[]) => void;
15
+ /** A block was selected on the canvas. */
16
+ onSelectComponent: (id: string | undefined, path: TreePath) => void;
17
+ /** Add a block from a tray drop (e.g. `useBlockEditorState().addComponent`). */
18
+ onAddComponent?: (componentType: string, dropTarget?: TrayDropTarget, propsOverride?: Record<string, unknown>) => void;
19
+ /** Delete a block (e.g. `useBlockEditorState().deleteComponent`). */
20
+ onDeleteNode?: (nodeId: string) => void;
21
+ /** Duplicate a block (e.g. `useBlockEditorState().duplicateComponent`). */
22
+ onDuplicateNode?: (nodeId: string) => void;
23
+ /** Apply AI-generated props to a block. Accepted now; wired in a later step. */
24
+ onAIApply?: (nodeId: string, newProps: Record<string, unknown>) => void;
25
+ /** Optional external ref to the canvas content element, so an orchestrator can wire the
26
+ * canvas↔panel selection-focus coordination (`useDesignerSelectionFocus`). */
27
+ canvasRef?: RefObject<HTMLDivElement>;
28
+ }
29
+ /**
30
+ * The drag-and-drop authoring surface, self-contained with its own DnD context. Renders a
31
+ * document from the engine and commits edits back through the callbacks the orchestrator
32
+ * supplies (it holds no editor state itself, so the canvas and the settings form stay
33
+ * independent). This is the standalone convenience: `GridDndProvider` + `DesignerCanvas`. A
34
+ * host that wants tray drag sources to reach the canvas across a shared context composes
35
+ * `GridDndProvider` around both the sidebar and a bare `DesignerCanvas` instead.
36
+ */
37
+ export declare function DesignerArea({ templateLayout, templateData, componentRegistry, selectedComponentId, onLayoutChange, onSelectComponent, onAddComponent, onDeleteNode, onDuplicateNode, onAIApply, canvasRef: externalCanvasRef, }: DesignerAreaProps): import("react/jsx-runtime").JSX.Element;
38
+ //# sourceMappingURL=DesignerArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DesignerArea.d.ts","sourceRoot":"","sources":["../../../src/edit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OG;AACH,wBAAgB,YAAY,CAAC,EAC3B,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,SAAS,EACT,SAAS,EAAE,iBAAiB,GAC7B,EAAE,iBAAiB,2CA2BnB"}
@@ -0,0 +1,35 @@
1
+ import { RefObject } from 'react';
2
+ import { BlockRegistry, LayoutNode, TemplateData } from '../../registry';
3
+ import { TreePath } from '../document/utils';
4
+ export interface DesignerCanvasProps {
5
+ /** The layout tree to author. */
6
+ templateLayout: LayoutNode[];
7
+ /** Content props keyed by node id. */
8
+ templateData: TemplateData;
9
+ /** The registry the document's blocks resolve against. */
10
+ componentRegistry: BlockRegistry;
11
+ /** The engine's selected component id (drives the selection chrome). */
12
+ selectedComponentId: string | null;
13
+ /** Commit a new layout (e.g. `useBlockEditorState().changeLayout`). */
14
+ onLayoutChange: (layout: LayoutNode[]) => void;
15
+ /** A block was selected on the canvas. */
16
+ onSelectComponent: (id: string | undefined, path: TreePath) => void;
17
+ /** Delete a block (e.g. `useBlockEditorState().deleteComponent`). */
18
+ onDeleteNode?: (nodeId: string) => void;
19
+ /** Duplicate a block (e.g. `useBlockEditorState().duplicateComponent`). */
20
+ onDuplicateNode?: (nodeId: string) => void;
21
+ /** Apply AI-generated props to a block. */
22
+ onAIApply?: (nodeId: string, newProps: Record<string, unknown>) => void;
23
+ /** Optional external ref to the canvas content element, so an orchestrator can wire the
24
+ * canvas↔panel selection-focus coordination (`useDesignerSelectionFocus`). */
25
+ canvasRef?: RefObject<HTMLDivElement>;
26
+ }
27
+ /**
28
+ * The authoring canvas *without* its own DnD context. It reads DnD state from an ambient
29
+ * `GridDndProvider`, so it must render inside one — `DesignerArea` supplies its own, and an
30
+ * orchestrator that shares one context across canvas + sidebar hoists the provider above both
31
+ * and renders this. Turns on `DesignerModeContext` for the blocks it renders (its one owned
32
+ * piece of context); brand color, block data and translations come from the host's providers.
33
+ */
34
+ export declare function DesignerCanvas({ templateLayout, templateData, componentRegistry, selectedComponentId, onLayoutChange, onSelectComponent, onDeleteNode, onDuplicateNode, onAIApply, canvasRef: externalCanvasRef, }: DesignerCanvasProps): import("react/jsx-runtime").JSX.Element;
35
+ //# sourceMappingURL=DesignerCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DesignerCanvas.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/DesignerCanvas.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAIjD,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,cAAc,EAAE,UAAU,EAAE,CAAA;IAC5B,sCAAsC;IACtC,YAAY,EAAE,YAAY,CAAA;IAC1B,0DAA0D;IAC1D,iBAAiB,EAAE,aAAa,CAAA;IAChC,wEAAwE;IACxE,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,uEAAuE;IACvE,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI,CAAA;IAC9C,0CAA0C;IAC1C,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IACnE,qEAAqE;IACrE,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,2EAA2E;IAC3E,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,2CAA2C;IAC3C,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACvE;kFAC8E;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAA;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAC7B,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,SAAS,EACT,SAAS,EAAE,iBAAiB,GAC7B,EAAE,mBAAmB,2CAqBrB"}
@@ -0,0 +1,24 @@
1
+ import { ReactElement } from 'react';
2
+ import { LayoutNode } from '../../registry';
3
+ export interface GridCell {
4
+ column: number;
5
+ row: number;
6
+ }
7
+ export interface OccupiedCell extends GridCell {
8
+ columnSpan: number;
9
+ rowSpan: number;
10
+ }
11
+ export interface DesignerGridOverlayProps {
12
+ /** Number of columns in the grid. */
13
+ columns: number;
14
+ /** Number of rows to show (defaults to 10). */
15
+ rows?: number;
16
+ /** Layout used to determine which cells are occupied. */
17
+ templateLayout: LayoutNode[];
18
+ /** Whether to show the overlay (typically during a drag). */
19
+ visible: boolean;
20
+ }
21
+ /** Shows droppable cells for every empty grid position during a drag. */
22
+ export declare const DesignerGridOverlay: ({ columns, rows, templateLayout, visible, }: DesignerGridOverlayProps) => ReactElement[] | null;
23
+ export default DesignerGridOverlay;
24
+ //# sourceMappingURL=DropGridOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropGridOverlay.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/DropGridOverlay.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGnE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB;AAoCD,MAAM,WAAW,wBAAwB;IACvC,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,cAAc,EAAE,UAAU,EAAE,CAAA;IAC5B,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,GAAI,6CAKjC,wBAAwB,KAAG,YAAY,EAAE,GAAG,IA+B9C,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { SortableInsertTarget } from '../document/utils';
2
+ /** DnD state shared from the provider down to the canvas without prop drilling. */
3
+ export interface GridDndContextValue {
4
+ activeId: string | null;
5
+ isSortingContainer: boolean;
6
+ numRows: number;
7
+ trayInsertTarget: SortableInsertTarget | null;
8
+ }
9
+ export declare const GridDndContext: import('react').Context<GridDndContextValue | null>;
10
+ export declare function useGridDndContext(): GridDndContextValue;
11
+ //# sourceMappingURL=GridDndContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridDndContext.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/GridDndContext.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,oBAAoB,GAAG,IAAI,CAAA;CAC9C;AAED,eAAO,MAAM,cAAc,qDAAkD,CAAA;AAE7E,wBAAgB,iBAAiB,IAAI,mBAAmB,CAMvD"}
@@ -0,0 +1,17 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ import { BlockRegistry, LayoutNode, TemplateData } from '../../registry';
3
+ import { TrayDropTarget } from '../document/utils';
4
+ export interface GridDndProviderProps {
5
+ templateLayout: LayoutNode[];
6
+ templateData: TemplateData;
7
+ componentRegistry: BlockRegistry;
8
+ onLayoutChange: (layout: LayoutNode[]) => void;
9
+ /** Optional callback for handling tray component drops. */
10
+ onAddFromTray?: (componentType: string, dropTarget?: TrayDropTarget, propsOverride?: Record<string, unknown>) => void;
11
+ /** The canvas content element, used to cancel drops that leave the canvas. */
12
+ canvasRef?: RefObject<HTMLElement | null>;
13
+ children: ReactNode;
14
+ }
15
+ /** The single `DndContext` for the designer, wiring `useGridDnd` in and rendering the overlays. */
16
+ export declare function GridDndProvider({ templateLayout, templateData, componentRegistry, onLayoutChange, onAddFromTray, canvasRef, children, }: GridDndProviderProps): import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=GridDndProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridDndProvider.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/GridDndProvider.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAKvD,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,UAAU,EAAE,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;IAC1B,iBAAiB,EAAE,aAAa,CAAA;IAChC,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI,CAAA;IAC9C,2DAA2D;IAC3D,aAAa,CAAC,EAAE,CACd,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,cAAc,EAC3B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACpC,IAAI,CAAA;IACT,8EAA8E;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACzC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,SAAS,EACT,QAAQ,GACT,EAAE,oBAAoB,2CAmDtB"}
@@ -0,0 +1,44 @@
1
+ import { ReactNode } from 'react';
2
+ import { BlockRegistry } from '../../registry';
3
+ import { DesignerItemAction } from '../document/designerItemAction';
4
+ export interface DesignerItemUIProps {
5
+ children: ReactNode;
6
+ componentType: string;
7
+ /** Human-readable label for the component-type chip. */
8
+ componentTypeLabel?: string;
9
+ /** Component instance id, applied as `data-designer-item-id` for focus management. */
10
+ componentId?: string;
11
+ /** Whether this item is the engine's selected component (drives `data-selected`). */
12
+ isSelected?: boolean;
13
+ /** Whether any drag is active (hides the toolbar globally during a drag). */
14
+ isAnyDragActive?: boolean;
15
+ dragDisabled?: boolean;
16
+ onEditClick: (e: {
17
+ stopPropagation: () => void;
18
+ }) => void;
19
+ onDuplicateClick: (e: {
20
+ stopPropagation: () => void;
21
+ }) => void;
22
+ /** Current component data, passed to the AI menu as the "before" content. */
23
+ componentData?: Record<string, unknown>;
24
+ /** Callback when AI applies new props to this block. */
25
+ onAIApply?: (newProps: Record<string, unknown>) => void;
26
+ /** Composed by the host — passed to the AI menu to render the before/after preview + resolve. */
27
+ componentRegistry?: BlockRegistry;
28
+ /** Callback when delete is confirmed via the popover. */
29
+ onDeleteConfirm?: () => void;
30
+ /** Ref and props for the drag handle (from `useSortable`). */
31
+ dragHandleProps?: Record<string, unknown>;
32
+ /**
33
+ * Toolbar actions to hide for this item. Lets a host tailor the toolbar to the block —
34
+ * e.g. a data-driven widget hides "edit", "ai" and "duplicate", leaving move and delete.
35
+ */
36
+ hiddenActions?: DesignerItemAction[];
37
+ /** Host permission to edit content — gates move / duplicate / the edit overlay. */
38
+ canEditContent?: boolean;
39
+ /** Host permission to delete content — gates the delete action. */
40
+ canDeleteContent?: boolean;
41
+ }
42
+ export declare const DesignerItemUI: import('react').ForwardRefExoticComponent<DesignerItemUIProps & import('react').RefAttributes<HTMLDivElement>>;
43
+ export default DesignerItemUI;
44
+ //# sourceMappingURL=GridItemChild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridItemChild.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/GridItemChild.tsx"],"names":[],"mappings":"AAmCA,OAAO,EAAc,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAA;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAInE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,SAAS,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qFAAqF;IACrF,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,WAAW,EAAE,CAAC,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,IAAI,CAAA;IACzD,gBAAgB,EAAE,CAAC,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,IAAI,CAAA;IAC9D,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,wDAAwD;IACxD,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACvD,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,aAAa,CAAA;IACjC,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,8DAA8D;IAC9D,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAA;IACpC,mFAAmF;IACnF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,cAAc,gHA2L1B,CAAA;AAID,eAAe,cAAc,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { ReactNode } from 'react';
2
+ import { BlockRegistry, LayoutNode } from '../../registry';
3
+ import { TreePath } from '../document/utils';
4
+ import { DesignerItemAction } from '../document/designerItemAction';
5
+ export interface DesignerItemProps {
6
+ /** The layout node this item represents. */
7
+ node: LayoutNode;
8
+ /** Path to this node in the tree. */
9
+ path: TreePath;
10
+ /** Depth in the tree (0 = root). */
11
+ depth: number;
12
+ /** Callback when the item is selected. */
13
+ onSelect: (id: string | undefined, path: TreePath) => void;
14
+ /** The rendered block. */
15
+ children: ReactNode;
16
+ /** Already-translated label for the component-type chip (from the registry entry). */
17
+ componentTypeLabel?: string;
18
+ /** Whether this item is the engine's selected component. */
19
+ isSelected?: boolean;
20
+ /** Whether drag/drop is disabled. */
21
+ disabled?: boolean;
22
+ /** Whether any drag is active (hides toolbars globally). */
23
+ isAnyDragActive?: boolean;
24
+ /** The currently dragged item id (used to hide the item in disabled mode). */
25
+ activeId?: string | null;
26
+ /** Show a dashed placeholder above this item for an incoming tray drop. */
27
+ showTrayGapAbove?: boolean;
28
+ /** Height of the placeholder box shown above this item. */
29
+ trayGapHeight?: number;
30
+ /** Callback to delete this node from the layout. */
31
+ onDeleteNode?: (nodeId: string) => void;
32
+ /** Callback to duplicate this node. */
33
+ onDuplicateNode?: (nodeId: string) => void;
34
+ /** Current component data, passed through to the (later) AI popover. */
35
+ componentData?: Record<string, unknown>;
36
+ /** Callback when AI applies new props to this node. */
37
+ onAIApply?: (nodeId: string, newProps: Record<string, unknown>) => void;
38
+ /** Composed by the host — passed to the block's AI menu to render the before/after preview. */
39
+ componentRegistry?: BlockRegistry;
40
+ /** Toolbar actions to hide for this item. */
41
+ hiddenActions?: DesignerItemAction[];
42
+ /** Host permission to edit content. */
43
+ canEditContent?: boolean;
44
+ /** Host permission to delete content. */
45
+ canDeleteContent?: boolean;
46
+ }
47
+ export declare const DesignerItem: ({ node, path, depth, onSelect, children, componentTypeLabel, isSelected, disabled, isAnyDragActive, activeId, showTrayGapAbove, trayGapHeight, onDeleteNode, onDuplicateNode, componentData, onAIApply, componentRegistry, hiddenActions, canEditContent, canDeleteContent, }: DesignerItemProps) => import("react/jsx-runtime").JSX.Element;
48
+ export default DesignerItem;
49
+ //# sourceMappingURL=GridItemContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridItemContainer.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/GridItemContainer.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAsB,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAA;AACxF,OAAO,KAAK,EAAE,aAAa,EAAqB,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAIxE,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,IAAI,EAAE,UAAU,CAAA;IAChB,qCAAqC;IACrC,IAAI,EAAE,QAAQ,CAAA;IACd,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,0CAA0C;IAC1C,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IAC1D,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAA;IACnB,sFAAsF;IACtF,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oDAAoD;IACpD,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,uCAAuC;IACvC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,uDAAuD;IACvD,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACvE,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,aAAa,CAAA;IACjC,6CAA6C;IAC7C,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAA;IACpC,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,YAAY,GAAI,+QAqB1B,iBAAiB,4CAgHnB,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,114 @@
1
+ import { Announcements, CollisionDetection, DragEndEvent, DragMoveEvent, DragOverEvent, DragStartEvent, useSensors } from '@dnd-kit/core';
2
+ import { SortingStrategy } from '@dnd-kit/sortable';
3
+ import { RefObject } from 'react';
4
+ import { BlockRegistry, LayoutNode, TemplateData } from '../../registry';
5
+ import { SortableInsertTarget, TrayDropTarget, TreePath } from '../document/utils';
6
+ export declare const DEFAULT_BLOCK_HEIGHT = 60;
7
+ export declare const gridSortingStrategy: SortingStrategy;
8
+ /**
9
+ * Sorting strategy for a tray item being inserted (not yet in the tree). Unlike
10
+ * `gridSortingStrategy` — which relocates an existing item — there's no slot being vacated,
11
+ * so every real item at or after `insertIndex` shifts down one slot to open room.
12
+ */
13
+ export declare function makeTrayInsertStrategy(insertIndex: number, shiftHeight: number): SortingStrategy;
14
+ export interface GridViewerProps {
15
+ /** The layout tree to render. */
16
+ templateLayout: LayoutNode[];
17
+ /** Content props keyed by node id. */
18
+ templateData: TemplateData;
19
+ /** The registry blocks resolve against. */
20
+ componentRegistry: BlockRegistry;
21
+ /** The engine's selected component id (drives the selection chrome). */
22
+ selectedComponentId: string | null;
23
+ /** Callback when the layout changes. */
24
+ onLayoutChange: (layout: LayoutNode[]) => void;
25
+ /** Callback when a component is selected. */
26
+ onSelectComponent: (id: string | undefined, path: TreePath) => void;
27
+ /** Current depth in the tree (for nested calls). */
28
+ depth?: number;
29
+ /** Current path in the tree (for nested calls). */
30
+ currentPath?: TreePath;
31
+ /** Parent node (for determining sorting strategy). */
32
+ parentNode?: LayoutNode | null;
33
+ /** Whether DnD is disabled. */
34
+ disabled?: boolean;
35
+ /** Maximum nesting depth. */
36
+ maxDepth?: number;
37
+ /** Active dragging id (from the wrapper). */
38
+ activeId?: string | null;
39
+ /** Whether a container is being sorted (disables child items). */
40
+ isSortingContainer?: boolean;
41
+ /** Live insertion indicator for a tray item dragged over a block. */
42
+ trayInsertTarget?: SortableInsertTarget | null;
43
+ /** Callback when a node should be deleted. */
44
+ onDeleteNode?: (nodeId: string) => void;
45
+ /** Callback when a node should be duplicated. */
46
+ onDuplicateNode?: (nodeId: string) => void;
47
+ /** Callback when AI applies new props to a block. Threaded now, wired in a later step. */
48
+ onAIApply?: (nodeId: string, newProps: Record<string, unknown>) => void;
49
+ }
50
+ /** Props every recursive `RenderNode` receives, shared with `TwoColumnDesigner`. */
51
+ export interface RenderNodeProps {
52
+ onSelectComponent: (id: string | undefined, path: TreePath) => void;
53
+ onLayoutChange: (layout: LayoutNode[]) => void;
54
+ onDeleteNode?: (nodeId: string) => void;
55
+ onDuplicateNode?: (nodeId: string) => void;
56
+ onAIApply?: (nodeId: string, newProps: Record<string, unknown>) => void;
57
+ node: LayoutNode;
58
+ index: number;
59
+ templateData: TemplateData;
60
+ componentRegistry: BlockRegistry;
61
+ selectedComponentId: string | null;
62
+ currentPath: TreePath;
63
+ depth: number;
64
+ disabled: boolean;
65
+ maxDepth: number;
66
+ activeId: string | null;
67
+ isSortingContainer?: boolean;
68
+ trayInsertTarget?: SortableInsertTarget | null;
69
+ }
70
+ export declare const GridViewer: ({ templateLayout, templateData, componentRegistry, selectedComponentId, onSelectComponent, onLayoutChange, onDeleteNode, onDuplicateNode, onAIApply, depth, currentPath, parentNode: _parentNode, disabled, maxDepth, activeId, isSortingContainer, trayInsertTarget, }: GridViewerProps) => import("react/jsx-runtime").JSX.Element;
71
+ interface UseGridDndProps {
72
+ templateLayout: LayoutNode[];
73
+ componentRegistry: BlockRegistry;
74
+ onLayoutChange: (layout: LayoutNode[]) => void;
75
+ /** Optional callback for handling tray component drops. */
76
+ onAddFromTray?: (componentType: string, dropTarget?: TrayDropTarget, propsOverride?: Record<string, unknown>) => void;
77
+ /**
78
+ * The canvas content element. Used to detect when a drag has left the canvas (e.g.
79
+ * dragged back over the tray) so the drop can be cancelled rather than snapping onto the
80
+ * closest block.
81
+ */
82
+ canvasRef?: RefObject<HTMLElement | null>;
83
+ }
84
+ export interface UseGridDndReturn {
85
+ activeId: string | null;
86
+ activeNode: LayoutNode | null;
87
+ isSortingContainer: boolean;
88
+ sensors: ReturnType<typeof useSensors>;
89
+ announcements: Announcements;
90
+ screenReaderInstructions: {
91
+ draggable: string;
92
+ };
93
+ collisionDetection: CollisionDetection;
94
+ handleDragStart: (event: DragStartEvent) => void;
95
+ handleDragMove: (event: DragMoveEvent) => void;
96
+ handleDragOver: (event: DragOverEvent) => void;
97
+ handleDragEnd: (event: DragEndEvent) => void;
98
+ handleDragCancel: () => void;
99
+ numRows: number;
100
+ trayInsertTarget: SortableInsertTarget | null;
101
+ }
102
+ export declare function useGridDnd({ templateLayout, componentRegistry, onLayoutChange, onAddFromTray, canvasRef, }: UseGridDndProps): UseGridDndReturn;
103
+ export interface GridViewerCanvasProps extends Omit<GridViewerProps, 'activeId' | 'isSortingContainer' | 'trayInsertTarget' | 'depth' | 'currentPath' | 'parentNode'> {
104
+ }
105
+ export declare const GridViewerCanvas: ({ templateLayout, templateData, componentRegistry, selectedComponentId, onLayoutChange, onSelectComponent, onDeleteNode, onDuplicateNode, onAIApply, }: GridViewerCanvasProps) => import("react/jsx-runtime").JSX.Element;
106
+ export interface GridDragOverlayProps {
107
+ activeId: string | null;
108
+ activeNode: LayoutNode | null;
109
+ templateData: TemplateData;
110
+ componentRegistry: BlockRegistry;
111
+ }
112
+ export declare const GridDragOverlay: ({ activeId, activeNode, templateData, componentRegistry, }: GridDragOverlayProps) => import("react/jsx-runtime").JSX.Element;
113
+ export {};
114
+ //# sourceMappingURL=GridViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridViewer.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/GridViewer.tsx"],"names":[],"mappings":"AAkBA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAElB,KAAK,cAAc,EASnB,UAAU,EACX,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AACd,OAAO,EACL,KAAK,aAAa,EAGlB,KAA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E,eAAe,GAAG,gBAAgB,CA6jBpC;AAMD,MAAM,WAAW,qBACf,SAAQ,IAAI,CACV,eAAe,EACf,UAAU,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,OAAO,GAAG,aAAa,GAAG,YAAY,CAChG;CAAG;AAEN,eAAO,MAAM,gBAAgB,GAAI,wJAU9B,qBAAqB,4CA+BvB,CAAA;AAMD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;IAC7B,YAAY,EAAE,YAAY,CAAA;IAC1B,iBAAiB,EAAE,aAAa,CAAA;CACjC;AAED,eAAO,MAAM,eAAe,GAAI,4DAK7B,oBAAoB,4CAsDtB,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { LayoutNode } from '../../registry';
2
+ import { SortableInsertTarget, TreePath } from '../document/utils';
3
+ import { RenderNodeProps } from './GridViewer';
4
+ export interface TwoColumnDesignerProps {
5
+ /** The TwoColumn node itself. */
6
+ node: LayoutNode;
7
+ /** Children of the TwoColumn node (`node.children`). */
8
+ columnChildren: LayoutNode[];
9
+ /** Content props keyed by node id. */
10
+ templateData: import('../../registry').TemplateData;
11
+ /** The registry the children resolve against. */
12
+ componentRegistry: import('../../registry').BlockRegistry;
13
+ /** The engine's selected component id (drives the selection chrome). */
14
+ selectedComponentId: string | null;
15
+ onSelectComponent: (id: string | undefined, path: TreePath) => void;
16
+ onLayoutChange: (layout: LayoutNode[]) => void;
17
+ onDeleteNode?: (nodeId: string) => void;
18
+ onDuplicateNode?: (nodeId: string) => void;
19
+ onAIApply?: (nodeId: string, newProps: Record<string, unknown>) => void;
20
+ depth: number;
21
+ /** Path to the children array. */
22
+ currentPath: TreePath;
23
+ disabled: boolean;
24
+ maxDepth: number;
25
+ activeId: string | null;
26
+ isSortingContainer?: boolean;
27
+ /** Live insertion indicator for a tray item dragged over a block. */
28
+ trayInsertTarget?: SortableInsertTarget | null;
29
+ /** The `RenderNode` from GridViewer, passed in to avoid a circular import. */
30
+ renderNode: React.ComponentType<RenderNodeProps>;
31
+ }
32
+ export declare const TwoColumnDesigner: ({ node, columnChildren: templateChildren, templateData, componentRegistry, selectedComponentId, onSelectComponent, onLayoutChange, onDeleteNode, onDuplicateNode, onAIApply, depth, currentPath, disabled, maxDepth, activeId, isSortingContainer, trayInsertTarget, renderNode: RenderNodeComponent, }: TwoColumnDesignerProps) => import("react/jsx-runtime").JSX.Element;
33
+ export default TwoColumnDesigner;
34
+ //# sourceMappingURL=TwoColumnDesigner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TwoColumnDesigner.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/TwoColumnDesigner.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,sBAAsB;IACrC,iCAAiC;IACjC,IAAI,EAAE,UAAU,CAAA;IAChB,wDAAwD;IACxD,cAAc,EAAE,UAAU,EAAE,CAAA;IAC5B,sCAAsC;IACtC,YAAY,EAAE,OAAO,gBAAgB,EAAE,YAAY,CAAA;IACnD,iDAAiD;IACjD,iBAAiB,EAAE,OAAO,gBAAgB,EAAE,aAAa,CAAA;IACzD,wEAAwE;IACxE,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IACnE,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI,CAAA;IAC9C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACvE,KAAK,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,WAAW,EAAE,QAAQ,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAA;IAC9C,8EAA8E;IAC9E,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAA;CACjD;AA0BD,eAAO,MAAM,iBAAiB,GAAI,ySAmB/B,sBAAsB,4CAyIxB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The designer canvas' chrome CSS: the grid container, the per-item selection border and
3
+ * floating toolbar, the drag placeholders, the drop cells, and the two-column zones. None
4
+ * of it is expressible in InstUI props — it needs `:has()`, `:focus-within`, pseudo
5
+ * elements and grid positioning — so it is injected once as a global stylesheet keyed by
6
+ * stable class names, the same way the blocks ship CSS InstUI can't express. Sourced from
7
+ * the InstUI theme via `useTheme()`; per-node grid positions are applied inline where they
8
+ * vary at runtime.
9
+ */
10
+ export declare const CANVAS_CLASS: {
11
+ readonly canvasSurface: "bce-designer-canvas-surface";
12
+ readonly canvas: "bce-designer-canvas";
13
+ readonly canvasMultiColumn: "bce-designer-canvas--multi";
14
+ readonly itemContainer: "bce-designer-item-container";
15
+ readonly itemContainerDragging: "bce-designer-item-container--dragging";
16
+ readonly itemContainerTrayGap: "bce-designer-item-container--tray-gap";
17
+ readonly item: "bce-designer-item";
18
+ readonly itemPopoverOpen: "bce-designer-item--popover-open";
19
+ readonly toolbar: "bce-designer-toolbar";
20
+ readonly toolbarGroup: "bce-designer-toolbar-group";
21
+ readonly chip: "bce-designer-chip";
22
+ readonly overlay: "bce-designer-overlay";
23
+ readonly content: "bce-designer-content";
24
+ readonly dragOverlay: "bce-designer-drag-overlay";
25
+ readonly gridCell: "bce-designer-grid-cell";
26
+ readonly gridCellOver: "bce-designer-grid-cell--over";
27
+ readonly twoColumns: "bce-twocol-columns";
28
+ readonly twoColumnZone: "bce-twocol-zone";
29
+ readonly twoColumnZoneOver: "bce-twocol-zone--over";
30
+ readonly twoColumnEmpty: "bce-twocol-empty";
31
+ };
32
+ /** CSS custom property carrying a per-item tray-gap placeholder height. */
33
+ export declare const TRAY_GAP_HEIGHT_VAR = "--bce-tray-gap-height";
34
+ /** Mounts the canvas chrome stylesheet once, under the designer. */
35
+ export declare function CanvasChromeStyles(): import("react/jsx-runtime").JSX.Element;
36
+ //# sourceMappingURL=canvasStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvasStyles.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/canvasStyles.tsx"],"names":[],"mappings":"AAsBA;;;;;;;;GAQG;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;CAqBf,CAAA;AAEV,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,0BAA0B,CAAA;AAoB1D,oEAAoE;AACpE,wBAAgB,kBAAkB,4CAoPjC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Strings the package owns for the designer chrome — the drag-and-drop canvas that is
3
+ * not part of any one block. Consumed via `useBlockTranslations(DesignerChromeEnglish)`,
4
+ * the same mechanism blocks use; there is deliberately no second translation context.
5
+ * The host overrides by placing a `BlockTranslationsProvider` above the designer;
6
+ * anything it omits falls back to the English below.
7
+ *
8
+ * `%{name}` markers are interpolated by `translate('<key>', { … })`.
9
+ */
10
+ export interface DesignerChromeTranslations {
11
+ /** Fallback name for a block whose type has no registered label, in a11y announcements. */
12
+ item: string;
13
+ /** Screen-reader announcement when a component is picked up for keyboard drag. */
14
+ pickedUp: string;
15
+ /** Screen-reader announcement while dragging over nothing droppable. */
16
+ notOverDropArea: string;
17
+ /** Lowercase column name, interpolated mid-sentence into a drag announcement. */
18
+ leftColumn: string;
19
+ /** Lowercase column name, interpolated mid-sentence into a drag announcement. */
20
+ rightColumn: string;
21
+ /** Screen-reader announcement while dragging over a TwoColumn column. */
22
+ isOverColumn: string;
23
+ /** Screen-reader announcement while dragging over another block. */
24
+ isOver: string;
25
+ /** Screen-reader announcement when a component is dropped. */
26
+ wasDropped: string;
27
+ /** Screen-reader announcement when a component is dropped into a TwoColumn column. */
28
+ wasDroppedIntoColumn: string;
29
+ /** Screen-reader announcement when a keyboard drag is cancelled. */
30
+ dragCancelled: string;
31
+ /** Screen-reader instructions attached to every draggable component. */
32
+ dragInstructions: string;
33
+ /** Toolbar `aria-label` for a component's floating action bar. */
34
+ componentActions: string;
35
+ /** Drag-handle screen-reader label. */
36
+ dragToReorder: string;
37
+ /** Drag-handle tooltip. */
38
+ dragAndDrop: string;
39
+ /** Duplicate button screen-reader label. */
40
+ duplicateComponent: string;
41
+ /** Duplicate button tooltip. */
42
+ duplicate: string;
43
+ /** Delete button screen-reader label. */
44
+ deleteComponent: string;
45
+ /** Delete button tooltip and confirm action. */
46
+ delete: string;
47
+ /** Delete confirmation prompt. */
48
+ deleteConfirmation: string;
49
+ /** Cancel button in the delete confirmation. */
50
+ cancel: string;
51
+ /** Component overlay `aria-label` opening the settings for a block. */
52
+ editComponent: string;
53
+ /** `aria-label` for the group wrapping a block on the canvas. */
54
+ componentGroup: string;
55
+ /** `aria-label` for the left drop zone of a TwoColumn block. */
56
+ leftColumnLabel: string;
57
+ /** `aria-label` for the right drop zone of a TwoColumn block. */
58
+ rightColumnLabel: string;
59
+ /** Empty-column placeholder in a TwoColumn block. */
60
+ dropBlocksHere: string;
61
+ }
62
+ /** English bundled with this package — also the source for `locales/en.json`. */
63
+ export declare const DesignerChromeEnglish: DesignerChromeTranslations;
64
+ //# sourceMappingURL=canvasTranslations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvasTranslations.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/canvasTranslations.ts"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAA;IACZ,kFAAkF;IAClF,QAAQ,EAAE,MAAM,CAAA;IAChB,wEAAwE;IACxE,eAAe,EAAE,MAAM,CAAA;IACvB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAA;IACrB,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,CAAA;IACxB,kEAAkE;IAClE,gBAAgB,EAAE,MAAM,CAAA;IACxB,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,4CAA4C;IAC5C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,yCAAyC;IACzC,eAAe,EAAE,MAAM,CAAA;IACvB,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAA;IACd,kCAAkC;IAClC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,aAAa,EAAE,MAAM,CAAA;IACrB,iEAAiE;IACjE,cAAc,EAAE,MAAM,CAAA;IACtB,gEAAgE;IAChE,eAAe,EAAE,MAAM,CAAA;IACvB,iEAAiE;IACjE,gBAAgB,EAAE,MAAM,CAAA;IACxB,qDAAqD;IACrD,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,EAAE,0BA2BnC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { DesignerArea, type DesignerAreaProps } from './DesignerArea';
2
+ export { DesignerCanvas, type DesignerCanvasProps } from './DesignerCanvas';
3
+ export { GridDndProvider, type GridDndProviderProps } from './GridDndProvider';
4
+ export { type DesignerChromeTranslations, DesignerChromeEnglish, } from './canvasTranslations';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/canvas/index.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,EACL,KAAK,0BAA0B,EAC/B,qBAAqB,GACtB,MAAM,sBAAsB,CAAA"}