@instructure/platform-block-content-editor 0.3.1 → 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.
- package/README.md +187 -0
- package/dist/components/MediaPlaceholder/MediaPlaceholder.d.ts.map +1 -1
- package/dist/components/RichText/RichText.d.ts +20 -0
- package/dist/components/RichText/RichText.d.ts.map +1 -0
- package/dist/components/RichText/index.d.ts +2 -0
- package/dist/components/RichText/index.d.ts.map +1 -0
- package/dist/components/blocks/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/blocks/Accordion/accordionTranslations.d.ts +15 -0
- package/dist/components/blocks/Accordion/accordionTranslations.d.ts.map +1 -0
- package/dist/components/blocks/Accordion/createAccordionBlock.d.ts +22 -0
- package/dist/components/blocks/Accordion/createAccordionBlock.d.ts.map +1 -0
- package/dist/components/blocks/Accordion/index.d.ts +2 -0
- package/dist/components/blocks/Accordion/index.d.ts.map +1 -1
- package/dist/components/blocks/Banner/Banner.d.ts.map +1 -1
- package/dist/components/blocks/Banner/bannerPropsSchema.d.ts +0 -2
- package/dist/components/blocks/Banner/bannerPropsSchema.d.ts.map +1 -1
- package/dist/components/blocks/Banner/bannerTranslations.d.ts +13 -0
- package/dist/components/blocks/Banner/bannerTranslations.d.ts.map +1 -0
- package/dist/components/blocks/Banner/createBannerBlock.d.ts +14 -0
- package/dist/components/blocks/Banner/createBannerBlock.d.ts.map +1 -0
- package/dist/components/blocks/Banner/getBannerViewProps.d.ts +2 -3
- package/dist/components/blocks/Banner/getBannerViewProps.d.ts.map +1 -1
- package/dist/components/blocks/Banner/index.d.ts +2 -0
- package/dist/components/blocks/Banner/index.d.ts.map +1 -1
- package/dist/components/blocks/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/components/blocks/CodeBlock/codeBlockPropsSchema.d.ts +2 -2
- package/dist/components/blocks/CodeBlock/codeBlockTranslations.d.ts +11 -0
- package/dist/components/blocks/CodeBlock/codeBlockTranslations.d.ts.map +1 -0
- package/dist/components/blocks/CodeBlock/createCodeBlock.d.ts +12 -0
- package/dist/components/blocks/CodeBlock/createCodeBlock.d.ts.map +1 -0
- package/dist/components/blocks/CodeBlock/index.d.ts +2 -0
- package/dist/components/blocks/CodeBlock/index.d.ts.map +1 -1
- package/dist/components/blocks/FlashCards/FlashCard.d.ts +21 -0
- package/dist/components/blocks/FlashCards/FlashCard.d.ts.map +1 -0
- package/dist/components/blocks/FlashCards/FlashCards.d.ts +4 -0
- package/dist/components/blocks/FlashCards/FlashCards.d.ts.map +1 -0
- package/dist/components/blocks/FlashCards/createFlashCardsBlock.d.ts +15 -0
- package/dist/components/blocks/FlashCards/createFlashCardsBlock.d.ts.map +1 -0
- package/dist/components/blocks/FlashCards/flashCardsPropsSchema.d.ts +60 -0
- package/dist/components/blocks/FlashCards/flashCardsPropsSchema.d.ts.map +1 -0
- package/dist/components/blocks/FlashCards/flashCardsStyles.d.ts +43 -0
- package/dist/components/blocks/FlashCards/flashCardsStyles.d.ts.map +1 -0
- package/dist/components/blocks/FlashCards/flashCardsTranslations.d.ts +34 -0
- package/dist/components/blocks/FlashCards/flashCardsTranslations.d.ts.map +1 -0
- package/dist/components/blocks/FlashCards/getFlashCardsViewProps.d.ts +23 -0
- package/dist/components/blocks/FlashCards/getFlashCardsViewProps.d.ts.map +1 -0
- package/dist/components/blocks/FlashCards/index.d.ts +5 -0
- package/dist/components/blocks/FlashCards/index.d.ts.map +1 -0
- package/dist/components/blocks/ImageBlock/ImageBlock.d.ts.map +1 -1
- package/dist/components/blocks/ImageBlock/createImageBlock.d.ts +15 -0
- package/dist/components/blocks/ImageBlock/createImageBlock.d.ts.map +1 -0
- package/dist/components/blocks/ImageBlock/getImageBlockViewProps.d.ts +3 -1
- package/dist/components/blocks/ImageBlock/getImageBlockViewProps.d.ts.map +1 -1
- package/dist/components/blocks/ImageBlock/imageBlockTranslations.d.ts +15 -0
- package/dist/components/blocks/ImageBlock/imageBlockTranslations.d.ts.map +1 -0
- package/dist/components/blocks/ImageBlock/index.d.ts +2 -0
- package/dist/components/blocks/ImageBlock/index.d.ts.map +1 -1
- package/dist/components/blocks/KnowledgeCheck/AnswerCard.d.ts +19 -0
- package/dist/components/blocks/KnowledgeCheck/AnswerCard.d.ts.map +1 -0
- package/dist/components/blocks/KnowledgeCheck/KnowledgeCheck.d.ts +4 -0
- package/dist/components/blocks/KnowledgeCheck/KnowledgeCheck.d.ts.map +1 -0
- package/dist/components/blocks/KnowledgeCheck/createKnowledgeCheckBlock.d.ts +18 -0
- package/dist/components/blocks/KnowledgeCheck/createKnowledgeCheckBlock.d.ts.map +1 -0
- package/dist/components/blocks/KnowledgeCheck/getKnowledgeCheckViewProps.d.ts +34 -0
- package/dist/components/blocks/KnowledgeCheck/getKnowledgeCheckViewProps.d.ts.map +1 -0
- package/dist/components/blocks/KnowledgeCheck/index.d.ts +5 -0
- package/dist/components/blocks/KnowledgeCheck/index.d.ts.map +1 -0
- package/dist/components/blocks/KnowledgeCheck/knowledgeCheckPropsSchema.d.ts +87 -0
- package/dist/components/blocks/KnowledgeCheck/knowledgeCheckPropsSchema.d.ts.map +1 -0
- package/dist/components/blocks/KnowledgeCheck/knowledgeCheckTranslations.d.ts +35 -0
- package/dist/components/blocks/KnowledgeCheck/knowledgeCheckTranslations.d.ts.map +1 -0
- package/dist/components/blocks/LayoutContainer/LayoutContainer.d.ts +3 -0
- package/dist/components/blocks/LayoutContainer/LayoutContainer.d.ts.map +1 -0
- package/dist/components/blocks/LayoutContainer/createLayoutContainerBlock.d.ts +22 -0
- package/dist/components/blocks/LayoutContainer/createLayoutContainerBlock.d.ts.map +1 -0
- package/dist/components/blocks/LayoutContainer/getLayoutContainerViewProps.d.ts +32 -0
- package/dist/components/blocks/LayoutContainer/getLayoutContainerViewProps.d.ts.map +1 -0
- package/dist/components/blocks/LayoutContainer/index.d.ts +5 -0
- package/dist/components/blocks/LayoutContainer/index.d.ts.map +1 -0
- package/dist/components/blocks/LayoutContainer/layoutContainerPropsSchema.d.ts +118 -0
- package/dist/components/blocks/LayoutContainer/layoutContainerPropsSchema.d.ts.map +1 -0
- package/dist/components/blocks/MixAndMatch/MatchCard.d.ts +21 -0
- package/dist/components/blocks/MixAndMatch/MatchCard.d.ts.map +1 -0
- package/dist/components/blocks/MixAndMatch/MixAndMatch.d.ts +4 -0
- package/dist/components/blocks/MixAndMatch/MixAndMatch.d.ts.map +1 -0
- package/dist/components/blocks/MixAndMatch/createMixAndMatchBlock.d.ts +15 -0
- package/dist/components/blocks/MixAndMatch/createMixAndMatchBlock.d.ts.map +1 -0
- package/dist/components/blocks/MixAndMatch/getMixAndMatchViewProps.d.ts +43 -0
- package/dist/components/blocks/MixAndMatch/getMixAndMatchViewProps.d.ts.map +1 -0
- package/dist/components/blocks/MixAndMatch/index.d.ts +5 -0
- package/dist/components/blocks/MixAndMatch/index.d.ts.map +1 -0
- package/dist/components/blocks/MixAndMatch/mixAndMatchPropsSchema.d.ts +74 -0
- package/dist/components/blocks/MixAndMatch/mixAndMatchPropsSchema.d.ts.map +1 -0
- package/dist/components/blocks/MixAndMatch/mixAndMatchStyles.d.ts +21 -0
- package/dist/components/blocks/MixAndMatch/mixAndMatchStyles.d.ts.map +1 -0
- package/dist/components/blocks/MixAndMatch/mixAndMatchTranslations.d.ts +37 -0
- package/dist/components/blocks/MixAndMatch/mixAndMatchTranslations.d.ts.map +1 -0
- package/dist/components/blocks/Quote/Quote.d.ts.map +1 -1
- package/dist/components/blocks/Quote/createQuoteBlock.d.ts +12 -0
- package/dist/components/blocks/Quote/createQuoteBlock.d.ts.map +1 -0
- package/dist/components/blocks/Quote/index.d.ts +2 -0
- package/dist/components/blocks/Quote/index.d.ts.map +1 -1
- package/dist/components/blocks/Quote/quoteTranslations.d.ts +13 -0
- package/dist/components/blocks/Quote/quoteTranslations.d.ts.map +1 -0
- package/dist/components/blocks/TabsBlock/TabsBlock.d.ts +4 -0
- package/dist/components/blocks/TabsBlock/TabsBlock.d.ts.map +1 -0
- package/dist/components/blocks/TabsBlock/createTabsBlock.d.ts +25 -0
- package/dist/components/blocks/TabsBlock/createTabsBlock.d.ts.map +1 -0
- package/dist/components/blocks/TabsBlock/getTabsBlockViewProps.d.ts +55 -0
- package/dist/components/blocks/TabsBlock/getTabsBlockViewProps.d.ts.map +1 -0
- package/dist/components/blocks/TabsBlock/index.d.ts +6 -0
- package/dist/components/blocks/TabsBlock/index.d.ts.map +1 -0
- package/dist/components/blocks/TabsBlock/tabsBlockPropsSchema.d.ts +127 -0
- package/dist/components/blocks/TabsBlock/tabsBlockPropsSchema.d.ts.map +1 -0
- package/dist/components/blocks/TabsBlock/tabsBlockTranslations.d.ts +13 -0
- package/dist/components/blocks/TabsBlock/tabsBlockTranslations.d.ts.map +1 -0
- package/dist/components/blocks/TabsBlock/useRovingTabIndex.d.ts +20 -0
- package/dist/components/blocks/TabsBlock/useRovingTabIndex.d.ts.map +1 -0
- package/dist/components/blocks/Text/Text.d.ts.map +1 -1
- package/dist/components/blocks/Text/createTextBlock.d.ts +12 -0
- package/dist/components/blocks/Text/createTextBlock.d.ts.map +1 -0
- package/dist/components/blocks/Text/index.d.ts +2 -0
- package/dist/components/blocks/Text/index.d.ts.map +1 -1
- package/dist/components/blocks/Text/textPropsSchema.d.ts +3 -3
- package/dist/components/blocks/Text/textTranslations.d.ts +11 -0
- package/dist/components/blocks/Text/textTranslations.d.ts.map +1 -0
- package/dist/components/blocks/TwoColumn/TwoColumn.d.ts +3 -0
- package/dist/components/blocks/TwoColumn/TwoColumn.d.ts.map +1 -0
- package/dist/components/blocks/TwoColumn/createTwoColumnBlock.d.ts +14 -0
- package/dist/components/blocks/TwoColumn/createTwoColumnBlock.d.ts.map +1 -0
- package/dist/components/blocks/TwoColumn/getTwoColumnViewProps.d.ts +17 -0
- package/dist/components/blocks/TwoColumn/getTwoColumnViewProps.d.ts.map +1 -0
- package/dist/components/blocks/TwoColumn/index.d.ts +5 -0
- package/dist/components/blocks/TwoColumn/index.d.ts.map +1 -0
- package/dist/components/blocks/TwoColumn/twoColumnPropsSchema.d.ts +60 -0
- package/dist/components/blocks/TwoColumn/twoColumnPropsSchema.d.ts.map +1 -0
- package/dist/components/blocks/TwoColumn/twoColumnStyles.d.ts +13 -0
- package/dist/components/blocks/TwoColumn/twoColumnStyles.d.ts.map +1 -0
- package/dist/components/blocks/VideoBlock/VideoBlock.d.ts.map +1 -1
- package/dist/components/blocks/VideoBlock/createVideoBlock.d.ts +15 -0
- package/dist/components/blocks/VideoBlock/createVideoBlock.d.ts.map +1 -0
- package/dist/components/blocks/VideoBlock/index.d.ts +3 -1
- package/dist/components/blocks/VideoBlock/index.d.ts.map +1 -1
- package/dist/components/blocks/VideoBlock/videoBlockTranslations.d.ts +23 -0
- package/dist/components/blocks/VideoBlock/videoBlockTranslations.d.ts.map +1 -0
- package/dist/components/blocks/WidgetBlock/WidgetBlock.d.ts +8 -0
- package/dist/components/blocks/WidgetBlock/WidgetBlock.d.ts.map +1 -0
- package/dist/components/blocks/WidgetBlock/WidgetErrorBoundary.d.ts +36 -0
- package/dist/components/blocks/WidgetBlock/WidgetErrorBoundary.d.ts.map +1 -0
- package/dist/components/blocks/WidgetBlock/createWidgetBlock.d.ts +14 -0
- package/dist/components/blocks/WidgetBlock/createWidgetBlock.d.ts.map +1 -0
- package/dist/components/blocks/WidgetBlock/index.d.ts +5 -0
- package/dist/components/blocks/WidgetBlock/index.d.ts.map +1 -0
- package/dist/components/blocks/WidgetBlock/widgetBlockPropsSchema.d.ts +26 -0
- package/dist/components/blocks/WidgetBlock/widgetBlockPropsSchema.d.ts.map +1 -0
- package/dist/components/blocks/WidgetBlock/widgetBlockTranslations.d.ts +18 -0
- package/dist/components/blocks/WidgetBlock/widgetBlockTranslations.d.ts.map +1 -0
- package/dist/components/blocks/commonSchemas.d.ts +13 -0
- package/dist/components/blocks/commonSchemas.d.ts.map +1 -1
- package/dist/components/blocks/commonViewProps.d.ts +23 -1
- package/dist/components/blocks/commonViewProps.d.ts.map +1 -1
- package/dist/components/blocks/richTextTableStyles.d.ts +10 -0
- package/dist/components/blocks/richTextTableStyles.d.ts.map +1 -0
- package/dist/contexts/AIActionContext.d.ts +38 -0
- package/dist/contexts/AIActionContext.d.ts.map +1 -0
- package/dist/contexts/BlockEditorApiContext.d.ts +139 -4
- package/dist/contexts/BlockEditorApiContext.d.ts.map +1 -1
- package/dist/contexts/BlockTranslationsContext.d.ts +47 -0
- package/dist/contexts/BlockTranslationsContext.d.ts.map +1 -0
- package/dist/contexts/RichTextEditorContext.d.ts +28 -0
- package/dist/contexts/RichTextEditorContext.d.ts.map +1 -0
- package/dist/contexts/RichTextRendererContext.d.ts +21 -0
- package/dist/contexts/RichTextRendererContext.d.ts.map +1 -0
- package/dist/editor/BlockContentEditor.d.ts +40 -0
- package/dist/editor/BlockContentEditor.d.ts.map +1 -0
- package/dist/editor/ai/BlockAIMenu.d.ts +17 -0
- package/dist/editor/ai/BlockAIMenu.d.ts.map +1 -0
- package/dist/editor/ai/BlockAIMenuContent.d.ts +17 -0
- package/dist/editor/ai/BlockAIMenuContent.d.ts.map +1 -0
- package/dist/editor/ai/PreviewBlockModal.d.ts +29 -0
- package/dist/editor/ai/PreviewBlockModal.d.ts.map +1 -0
- package/dist/editor/ai/aiMenuStyles.d.ts +23 -0
- package/dist/editor/ai/aiMenuStyles.d.ts.map +1 -0
- package/dist/editor/ai/aiTranslations.d.ts +79 -0
- package/dist/editor/ai/aiTranslations.d.ts.map +1 -0
- package/dist/editor/ai/aiTypes.d.ts +13 -0
- package/dist/editor/ai/aiTypes.d.ts.map +1 -0
- package/dist/editor/ai/constants.d.ts +8 -0
- package/dist/editor/ai/constants.d.ts.map +1 -0
- package/dist/editor/ai/index.d.ts +7 -0
- package/dist/editor/ai/index.d.ts.map +1 -0
- package/dist/editor/ai/useBlockAIPopover.d.ts +30 -0
- package/dist/editor/ai/useBlockAIPopover.d.ts.map +1 -0
- package/dist/editor/ai/useGenerateAltText.d.ts +11 -0
- package/dist/editor/ai/useGenerateAltText.d.ts.map +1 -0
- package/dist/editor/canvas/DesignerArea.d.ts +38 -0
- package/dist/editor/canvas/DesignerArea.d.ts.map +1 -0
- package/dist/editor/canvas/DesignerCanvas.d.ts +35 -0
- package/dist/editor/canvas/DesignerCanvas.d.ts.map +1 -0
- package/dist/editor/canvas/DropGridOverlay.d.ts +24 -0
- package/dist/editor/canvas/DropGridOverlay.d.ts.map +1 -0
- package/dist/editor/canvas/GridDndContext.d.ts +11 -0
- package/dist/editor/canvas/GridDndContext.d.ts.map +1 -0
- package/dist/editor/canvas/GridDndProvider.d.ts +17 -0
- package/dist/editor/canvas/GridDndProvider.d.ts.map +1 -0
- package/dist/editor/canvas/GridItemChild.d.ts +44 -0
- package/dist/editor/canvas/GridItemChild.d.ts.map +1 -0
- package/dist/editor/canvas/GridItemContainer.d.ts +49 -0
- package/dist/editor/canvas/GridItemContainer.d.ts.map +1 -0
- package/dist/editor/canvas/GridViewer.d.ts +114 -0
- package/dist/editor/canvas/GridViewer.d.ts.map +1 -0
- package/dist/editor/canvas/TwoColumnDesigner.d.ts +34 -0
- package/dist/editor/canvas/TwoColumnDesigner.d.ts.map +1 -0
- package/dist/editor/canvas/canvasStyles.d.ts +36 -0
- package/dist/editor/canvas/canvasStyles.d.ts.map +1 -0
- package/dist/editor/canvas/canvasTranslations.d.ts +64 -0
- package/dist/editor/canvas/canvasTranslations.d.ts.map +1 -0
- package/dist/editor/canvas/index.d.ts +5 -0
- package/dist/editor/canvas/index.d.ts.map +1 -0
- package/dist/editor/document/constants.d.ts +23 -0
- package/dist/editor/document/constants.d.ts.map +1 -0
- package/dist/editor/document/designerItemAction.d.ts +16 -0
- package/dist/editor/document/designerItemAction.d.ts.map +1 -0
- package/dist/editor/document/utils.d.ts +172 -0
- package/dist/editor/document/utils.d.ts.map +1 -0
- package/dist/editor/document/utils.test.d.ts +2 -0
- package/dist/editor/document/utils.test.d.ts.map +1 -0
- package/dist/editor/history/types.d.ts +25 -0
- package/dist/editor/history/types.d.ts.map +1 -0
- package/dist/editor/history/undoRedoManager.d.ts +3 -0
- package/dist/editor/history/undoRedoManager.d.ts.map +1 -0
- package/dist/editor/history/undoRedoManager.test.d.ts +2 -0
- package/dist/editor/history/undoRedoManager.test.d.ts.map +1 -0
- package/dist/editor/history/useUndoRedo.d.ts +11 -0
- package/dist/editor/history/useUndoRedo.d.ts.map +1 -0
- package/dist/editor/history/useUndoRedo.test.d.ts +2 -0
- package/dist/editor/history/useUndoRedo.test.d.ts.map +1 -0
- package/dist/editor/index.d.ts +16 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/preview/PreviewArea.d.ts +31 -0
- package/dist/editor/preview/PreviewArea.d.ts.map +1 -0
- package/dist/editor/preview/constants.d.ts +9 -0
- package/dist/editor/preview/constants.d.ts.map +1 -0
- package/dist/editor/preview/index.d.ts +4 -0
- package/dist/editor/preview/index.d.ts.map +1 -0
- package/dist/editor/preview/previewStyles.d.ts +20 -0
- package/dist/editor/preview/previewStyles.d.ts.map +1 -0
- package/dist/editor/preview/previewTranslations.d.ts +18 -0
- package/dist/editor/preview/previewTranslations.d.ts.map +1 -0
- package/dist/editor/sidebar/DesignerNav.d.ts +28 -0
- package/dist/editor/sidebar/DesignerNav.d.ts.map +1 -0
- package/dist/editor/sidebar/form/ComponentEditorForm.d.ts +12 -0
- package/dist/editor/sidebar/form/ComponentEditorForm.d.ts.map +1 -0
- package/dist/editor/sidebar/form/FormFieldWrapper.d.ts +13 -0
- package/dist/editor/sidebar/form/FormFieldWrapper.d.ts.map +1 -0
- package/dist/editor/sidebar/form/fieldRendererUtils.d.ts +24 -0
- package/dist/editor/sidebar/form/fieldRendererUtils.d.ts.map +1 -0
- package/dist/editor/sidebar/form/fieldRenderers.d.ts +6 -0
- package/dist/editor/sidebar/form/fieldRenderers.d.ts.map +1 -0
- package/dist/editor/sidebar/form/formTranslations.d.ts +92 -0
- package/dist/editor/sidebar/form/formTranslations.d.ts.map +1 -0
- package/dist/editor/sidebar/form/formUtils.d.ts +7 -0
- package/dist/editor/sidebar/form/formUtils.d.ts.map +1 -0
- package/dist/editor/sidebar/form/index.d.ts +7 -0
- package/dist/editor/sidebar/form/index.d.ts.map +1 -0
- package/dist/editor/sidebar/form/knowledgeCheckEditor.d.ts +10 -0
- package/dist/editor/sidebar/form/knowledgeCheckEditor.d.ts.map +1 -0
- package/dist/editor/sidebar/form/renderers/AltTextFieldRenderer.d.ts +4 -0
- package/dist/editor/sidebar/form/renderers/AltTextFieldRenderer.d.ts.map +1 -0
- package/dist/editor/sidebar/form/renderers/AnswerArrayFieldRenderer.d.ts +4 -0
- package/dist/editor/sidebar/form/renderers/AnswerArrayFieldRenderer.d.ts.map +1 -0
- package/dist/editor/sidebar/form/renderers/ObjectArrayFieldRenderer.d.ts +4 -0
- package/dist/editor/sidebar/form/renderers/ObjectArrayFieldRenderer.d.ts.map +1 -0
- package/dist/editor/sidebar/form/uploaders/FileUploader.d.ts +24 -0
- package/dist/editor/sidebar/form/uploaders/FileUploader.d.ts.map +1 -0
- package/dist/editor/sidebar/form/uploaders/ImageUploader.d.ts +8 -0
- package/dist/editor/sidebar/form/uploaders/ImageUploader.d.ts.map +1 -0
- package/dist/editor/sidebar/form/uploaders/VideoUploader.d.ts +8 -0
- package/dist/editor/sidebar/form/uploaders/VideoUploader.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/DesignerSideBar.d.ts +18 -0
- package/dist/editor/sidebar/panel/DesignerSideBar.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/MobileToolOverlay.d.ts +13 -0
- package/dist/editor/sidebar/panel/MobileToolOverlay.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/MobileToolbar.d.ts +10 -0
- package/dist/editor/sidebar/panel/MobileToolbar.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/ToolBody.d.ts +11 -0
- package/dist/editor/sidebar/panel/ToolBody.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/ToolContentContainer.d.ts +27 -0
- package/dist/editor/sidebar/panel/ToolContentContainer.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/ToolHeader.d.ts +24 -0
- package/dist/editor/sidebar/panel/ToolHeader.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/ToolHeaderActionsContext.d.ts +8 -0
- package/dist/editor/sidebar/panel/ToolHeaderActionsContext.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/ToolIconButtons.d.ts +19 -0
- package/dist/editor/sidebar/panel/ToolIconButtons.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/ToolWrapper.d.ts +16 -0
- package/dist/editor/sidebar/panel/ToolWrapper.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/constants.d.ts +23 -0
- package/dist/editor/sidebar/panel/constants.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/index.d.ts +5 -0
- package/dist/editor/sidebar/panel/index.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/panelStyles.d.ts +29 -0
- package/dist/editor/sidebar/panel/panelStyles.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/types.d.ts +80 -0
- package/dist/editor/sidebar/panel/types.d.ts.map +1 -0
- package/dist/editor/sidebar/panel/useFocusReturn.d.ts +8 -0
- package/dist/editor/sidebar/panel/useFocusReturn.d.ts.map +1 -0
- package/dist/editor/sidebar/sidebarTranslations.d.ts +53 -0
- package/dist/editor/sidebar/sidebarTranslations.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/BlockTray.d.ts +30 -0
- package/dist/editor/sidebar/tray/BlockTray.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/ComponentsTray.d.ts +4 -0
- package/dist/editor/sidebar/tray/ComponentsTray.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/InteractiveTray.d.ts +4 -0
- package/dist/editor/sidebar/tray/InteractiveTray.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/LayoutTray.d.ts +4 -0
- package/dist/editor/sidebar/tray/LayoutTray.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/SharedTrayComponents.d.ts +64 -0
- package/dist/editor/sidebar/tray/SharedTrayComponents.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/TemplatesPanel.d.ts +4 -0
- package/dist/editor/sidebar/tray/TemplatesPanel.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/TrayDragLayer.d.ts +14 -0
- package/dist/editor/sidebar/tray/TrayDragLayer.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/blockDefinitions.d.ts +11 -0
- package/dist/editor/sidebar/tray/blockDefinitions.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/index.d.ts +9 -0
- package/dist/editor/sidebar/tray/index.d.ts.map +1 -0
- package/dist/editor/sidebar/tray/trayStyles.d.ts +20 -0
- package/dist/editor/sidebar/tray/trayStyles.d.ts.map +1 -0
- package/dist/editor/sidebar/useDesignerSelectionFocus.d.ts +51 -0
- package/dist/editor/sidebar/useDesignerSelectionFocus.d.ts.map +1 -0
- package/dist/editor/state/applyTemplatePatch.d.ts +46 -0
- package/dist/editor/state/applyTemplatePatch.d.ts.map +1 -0
- package/dist/editor/state/applyTemplatePatch.test.d.ts +2 -0
- package/dist/editor/state/applyTemplatePatch.test.d.ts.map +1 -0
- package/dist/editor/state/useBlockEditorState.d.ts +57 -0
- package/dist/editor/state/useBlockEditorState.d.ts.map +1 -0
- package/dist/editor/state/useBlockEditorState.test.d.ts +2 -0
- package/dist/editor/state/useBlockEditorState.test.d.ts.map +1 -0
- package/dist/editor/validation/templateDataValidator.d.ts +48 -0
- package/dist/editor/validation/templateDataValidator.d.ts.map +1 -0
- package/dist/editor/validation/templateDataValidator.test.d.ts +2 -0
- package/dist/editor/validation/templateDataValidator.test.d.ts.map +1 -0
- package/dist/index.d.ts +16 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15561 -767
- package/dist/registry/blockCatalogue.d.ts +108 -0
- package/dist/registry/blockCatalogue.d.ts.map +1 -0
- package/dist/registry/blockRegistry.d.ts +75 -0
- package/dist/registry/blockRegistry.d.ts.map +1 -0
- package/dist/registry/defineBlock.d.ts +60 -0
- package/dist/registry/defineBlock.d.ts.map +1 -0
- package/dist/registry/getMergedProps.d.ts +18 -0
- package/dist/registry/getMergedProps.d.ts.map +1 -0
- package/dist/registry/index.d.ts +7 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/registryTypes.test.d.ts +1 -0
- package/dist/registry/registryTypes.test.d.ts.map +1 -0
- package/dist/registry/resolveBlockEntry.d.ts +16 -0
- package/dist/registry/resolveBlockEntry.d.ts.map +1 -0
- package/dist/registry/templateTypes.d.ts +61 -0
- package/dist/registry/templateTypes.d.ts.map +1 -0
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/zodExtensions.d.ts +17 -0
- package/dist/schema/zodExtensions.d.ts.map +1 -1
- package/dist/utils/shuffleCards.d.ts +6 -0
- package/dist/utils/shuffleCards.d.ts.map +1 -0
- package/dist/utils/useMediaQuery.d.ts +7 -0
- package/dist/utils/useMediaQuery.d.ts.map +1 -0
- package/dist/utils/useMotionEnabled.d.ts +11 -0
- package/dist/utils/useMotionEnabled.d.ts.map +1 -0
- package/dist/viewer/Viewer.d.ts +27 -0
- package/dist/viewer/Viewer.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +2 -0
- package/dist/viewer/index.d.ts.map +1 -0
- package/locales/en.json +169 -1
- package/package.json +72 -24
- package/dist/contexts/TranslationsContext.d.ts +0 -70
- package/dist/contexts/TranslationsContext.d.ts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* A resolved image asset. `url` is the direct, displayable file URL (rendered
|
|
3
4
|
* in `<img>`); `undefined` while loading or on error.
|
|
@@ -25,8 +26,111 @@ export interface ResolvedVideo {
|
|
|
25
26
|
isProcessing?: boolean;
|
|
26
27
|
isError: boolean;
|
|
27
28
|
}
|
|
29
|
+
/** The props `WidgetBlock` renders a host widget with. */
|
|
30
|
+
export interface WidgetComponentProps {
|
|
31
|
+
/**
|
|
32
|
+
* The identifier the block stored, handed back so one parameterised host component
|
|
33
|
+
* can serve several widget names. Without it such a host would have to wrap the
|
|
34
|
+
* component per name, and the natural wrapper is the fresh arrow the stability rule
|
|
35
|
+
* below forbids. Optional so a host whose widgets take no props stays assignable;
|
|
36
|
+
* the block always passes it. A *change* of name remounts the widget rather than
|
|
37
|
+
* updating it in place — a different name is a different widget — so such a
|
|
38
|
+
* component reads this once and never has to transition between widgets.
|
|
39
|
+
*/
|
|
40
|
+
widgetType?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A resolved widget. `Component` is the host's own component for the requested
|
|
44
|
+
* widget; `undefined` while loading or when the host does not recognise the
|
|
45
|
+
* identifier.
|
|
46
|
+
*
|
|
47
|
+
* `Component` must be a **stable reference** for a given `widgetType` — resolve it
|
|
48
|
+
* from a module-level map, not an arrow function built inside the hook. React
|
|
49
|
+
* remounts on component identity, so a fresh reference each render throws away
|
|
50
|
+
* whatever state the widget holds, on every render of the block.
|
|
51
|
+
*
|
|
52
|
+
* A widget that throws while rendering — or a `useWidget` that throws, which runs inside
|
|
53
|
+
* the same boundary — is contained to its own block, which shows the error placeholder
|
|
54
|
+
* in its place. That guard exists because the alternative is the
|
|
55
|
+
* whole page unmounting, not because the package can handle the failure: it catches
|
|
56
|
+
* only the widget and reports nowhere, so a host that wants widget failures in its
|
|
57
|
+
* telemetry keeps its own error boundary above the provider.
|
|
58
|
+
*/
|
|
59
|
+
export interface ResolvedWidget {
|
|
60
|
+
Component?: ComponentType<WidgetComponentProps>;
|
|
61
|
+
isLoading: boolean;
|
|
62
|
+
isError: boolean;
|
|
63
|
+
}
|
|
28
64
|
export type UseImageUrl = (assetId: string) => ResolvedImage;
|
|
29
65
|
export type UseVideoUrl = (assetId: string) => ResolvedVideo;
|
|
66
|
+
/**
|
|
67
|
+
* `widgetType` is an opaque host identifier, like an `assetId`: the package never
|
|
68
|
+
* owns the vocabulary of widget names, so an unrecognised one is an error result,
|
|
69
|
+
* not an invalid value.
|
|
70
|
+
*/
|
|
71
|
+
export type UseWidget = (widgetType: string) => ResolvedWidget;
|
|
72
|
+
/**
|
|
73
|
+
* A resolved uploaded file, as the settings-form uploaders need it for their *preview*
|
|
74
|
+
* (not the block's rendered/embed URL — that's `useImageUrl`/`useVideoUrl`). `url` is the
|
|
75
|
+
* displayable file URL; `displayName` labels the preview. For a video still processing,
|
|
76
|
+
* `mediaEntryId` may be absent and `isProcessing` true. `undefined`/false flags with a
|
|
77
|
+
* populated `url` means "ready".
|
|
78
|
+
*/
|
|
79
|
+
export interface ResolvedUploadedFile {
|
|
80
|
+
url?: string;
|
|
81
|
+
displayName?: string;
|
|
82
|
+
mediaEntryId?: string;
|
|
83
|
+
isLoading: boolean;
|
|
84
|
+
isProcessing?: boolean;
|
|
85
|
+
isError: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** Resolve an `asset_id` to its uploaded-file preview data. `''` = nothing to resolve. */
|
|
88
|
+
export type UseUploadedFile = (assetId: string) => ResolvedUploadedFile;
|
|
89
|
+
/** Arguments the uploader hands the host's create-file mutation. */
|
|
90
|
+
export interface CreateFileArgs {
|
|
91
|
+
file: File;
|
|
92
|
+
displayName?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The host's file-upload mutation. The package passes only `{ file, displayName }` and
|
|
96
|
+
* stores the returned `id` as the block's `asset_id`; all host scoping (course/account,
|
|
97
|
+
* folder resolution, entity type) lives inside the host's implementation. `upload` rejects
|
|
98
|
+
* on failure — the uploader catches and surfaces an error message.
|
|
99
|
+
*/
|
|
100
|
+
export interface CreateFileHandle {
|
|
101
|
+
upload: (args: CreateFileArgs) => Promise<{
|
|
102
|
+
id: string;
|
|
103
|
+
}>;
|
|
104
|
+
isUploading: boolean;
|
|
105
|
+
error?: unknown;
|
|
106
|
+
}
|
|
107
|
+
export type UseCreateFile = () => CreateFileHandle;
|
|
108
|
+
/** Arguments the host's delete-file mutation takes — a single stored asset id. */
|
|
109
|
+
export interface DeleteFileArgs {
|
|
110
|
+
fileId: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The host's file-delete mutation, for cleaning up an asset a block no longer references.
|
|
114
|
+
* Unprovided, deletion is a silent no-op (cleanup is best-effort), rather than an error.
|
|
115
|
+
*/
|
|
116
|
+
export interface DeleteFileHandle {
|
|
117
|
+
deleteFile: (args: DeleteFileArgs) => Promise<void>;
|
|
118
|
+
}
|
|
119
|
+
export type UseDeleteFile = () => DeleteFileHandle;
|
|
120
|
+
/** Arguments the host's asset-bytes fetch takes — a single stored asset id. */
|
|
121
|
+
export interface FetchAssetArgs {
|
|
122
|
+
assetId: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The host's asset-bytes fetch: reads a stored `asset_id` back to a `Blob` on the host's own
|
|
126
|
+
* transport (credentials/CSRF/telemetry), so the package never fetches host content directly. The
|
|
127
|
+
* alt-text generator uses it to obtain the image bytes it sends to the AI. `fetchAsset` rejects on
|
|
128
|
+
* failure — the caller catches and surfaces an error message.
|
|
129
|
+
*/
|
|
130
|
+
export interface FetchAssetHandle {
|
|
131
|
+
fetchAsset: (args: FetchAssetArgs) => Promise<Blob>;
|
|
132
|
+
}
|
|
133
|
+
export type UseFetchAsset = () => FetchAssetHandle;
|
|
30
134
|
/**
|
|
31
135
|
* The host-injected data hooks the blocks call to resolve an opaque `asset_id`
|
|
32
136
|
* to the URL they render. The host owns the fetch (e.g. Canvas Files API via
|
|
@@ -44,15 +148,36 @@ export type UseVideoUrl = (assetId: string) => ResolvedVideo;
|
|
|
44
148
|
* stable value).
|
|
45
149
|
*
|
|
46
150
|
* Calling unconditionally also means an unconfigured block passes an empty
|
|
47
|
-
* `assetId`,
|
|
48
|
-
*
|
|
49
|
-
* `
|
|
50
|
-
*
|
|
151
|
+
* identifier — `assetId`, or `widgetType` for `useWidget` — so a hook must treat
|
|
152
|
+
* `''` as "nothing to resolve": don't fetch, and report neither loading nor error
|
|
153
|
+
* (`{isLoading: false, isError: false}` with no `url`/`Component` — with
|
|
154
|
+
* react-query, `enabled: !!assetId`). The block ignores that result: an
|
|
155
|
+
* unconfigured block renders the authoring placeholder inside the editor canvas
|
|
51
156
|
* and nothing outside it, so a hook that fetches for `''` only wastes a request.
|
|
157
|
+
*
|
|
158
|
+
* For any other identifier, though, a result that reports neither loading nor
|
|
159
|
+
* anything resolved reads as a failure: the blocks show the error placeholder. A hook
|
|
160
|
+
* that can sit idle for a real identifier (a query not yet enabled, say) must report
|
|
161
|
+
* `isLoading: true` until it settles, or the block flashes an error it will replace.
|
|
162
|
+
*
|
|
163
|
+
* A hook **reports** failure rather than raising it: `isError`, never a throw and never
|
|
164
|
+
* a suspend. `WidgetBlock` happens to run its hook inside its own error boundary, so a
|
|
165
|
+
* throw there degrades to the error placeholder instead of the page, but the other
|
|
166
|
+
* blocks have no such guard, and nothing here provides the `Suspense` a suspending hook
|
|
167
|
+
* needs (a react-query resolver wants `throwOnError: false` and a plain `useQuery`).
|
|
52
168
|
*/
|
|
53
169
|
export interface BlockEditorApi {
|
|
54
170
|
useImageUrl?: UseImageUrl;
|
|
55
171
|
useVideoUrl?: UseVideoUrl;
|
|
172
|
+
useWidget?: UseWidget;
|
|
173
|
+
/** Resolve a stored `asset_id` to preview data for the settings-form uploaders. */
|
|
174
|
+
useUploadedFile?: UseUploadedFile;
|
|
175
|
+
/** The host's file-upload mutation, driving the settings-form uploaders. */
|
|
176
|
+
useCreateFile?: UseCreateFile;
|
|
177
|
+
/** The host's file-delete mutation, for cleaning up orphaned uploads. */
|
|
178
|
+
useDeleteFile?: UseDeleteFile;
|
|
179
|
+
/** The host's asset-bytes fetch, reading a stored `asset_id` to a `Blob` for the alt-text AI. */
|
|
180
|
+
useFetchAsset?: UseFetchAsset;
|
|
56
181
|
}
|
|
57
182
|
export declare const BlockEditorApiContext: import('react').Context<BlockEditorApi>;
|
|
58
183
|
export declare const BlockEditorApiProvider: import('react').Provider<BlockEditorApi>;
|
|
@@ -60,4 +185,14 @@ export declare const BlockEditorApiProvider: import('react').Provider<BlockEdito
|
|
|
60
185
|
export declare const useImageUrl: (assetId: string) => ResolvedImage;
|
|
61
186
|
/** Resolve a video asset id via the host-provided `useVideoUrl` hook. */
|
|
62
187
|
export declare const useVideoUrl: (assetId: string) => ResolvedVideo;
|
|
188
|
+
/** Resolve a widget identifier to the host's component via the `useWidget` hook. */
|
|
189
|
+
export declare const useWidget: (widgetType: string) => ResolvedWidget;
|
|
190
|
+
/** Resolve an uploaded file's preview data via the host-provided `useUploadedFile` hook. */
|
|
191
|
+
export declare const useUploadedFile: (assetId: string) => ResolvedUploadedFile;
|
|
192
|
+
/** Obtain the host's file-upload mutation via the `useCreateFile` hook. */
|
|
193
|
+
export declare const useCreateFile: () => CreateFileHandle;
|
|
194
|
+
/** Obtain the host's file-delete mutation via the `useDeleteFile` hook. */
|
|
195
|
+
export declare const useDeleteFile: () => DeleteFileHandle;
|
|
196
|
+
/** Obtain the host's asset-bytes fetch via the `useFetchAsset` hook. */
|
|
197
|
+
export declare const useFetchAsset: () => FetchAssetHandle;
|
|
63
198
|
//# sourceMappingURL=BlockEditorApiContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockEditorApiContext.d.ts","sourceRoot":"","sources":["../../src/contexts/BlockEditorApiContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BlockEditorApiContext.d.ts","sourceRoot":"","sources":["../../src/contexts/BlockEditorApiContext.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,aAAa,EAA6B,MAAM,OAAO,CAAA;AAErE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAA;IAC/C,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,CAAA;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,CAAA;AAC5D;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,cAAc,CAAA;AAE9D;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,0FAA0F;AAC1F,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,oBAAoB,CAAA;AAEvE,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAA;IACV,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACzD,WAAW,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAA;AAElD,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACpD;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAA;AAElD,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACpD;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,mFAAmF;IACnF,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,4EAA4E;IAC5E,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,yEAAyE;IACzE,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,iGAAiG;IACjG,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAmBD,eAAO,MAAM,qBAAqB,yCAAoC,CAAA;AAEtE,eAAO,MAAM,sBAAsB,0CAAiC,CAAA;AAEpE,0EAA0E;AAC1E,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,aAG7C,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,aAG7C,CAAA;AAED,oFAAoF;AACpF,eAAO,MAAM,SAAS,GAAI,YAAY,MAAM,KAAG,cAG9C,CAAA;AAED,4FAA4F;AAC5F,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,KAAG,oBAGjD,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,aAAa,QAAO,gBAGhC,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,aAAa,QAAO,gBAGhC,CAAA;AAED,wEAAwE;AACxE,eAAO,MAAM,aAAa,QAAO,gBAGhC,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Strings for one block, supplied by the host when it registers that block
|
|
4
|
+
* (`create<Name>Block({ translations })`). Scoping them this way is what lets a host
|
|
5
|
+
* translate only the blocks it actually uses — an unregistered block never asks for
|
|
6
|
+
* anything.
|
|
7
|
+
*/
|
|
8
|
+
export type BlockTranslationValues = Record<string, string>;
|
|
9
|
+
export interface BlockTranslationsProviderProps<T> {
|
|
10
|
+
value: T;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Wraps a single block. Placed by `create<Name>Block`, not by the renderer, so every
|
|
15
|
+
* consumer — this package's viewer, a host's designer, or a bare `<Text />` — behaves the
|
|
16
|
+
* same.
|
|
17
|
+
*/
|
|
18
|
+
export declare function BlockTranslationsProvider<T extends AllStringValues<T>>({ value, children, }: BlockTranslationsProviderProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* "Every property is a string", expressed so that an `interface` satisfies it.
|
|
21
|
+
* `Record<string, string>` would not: an interface gets no implicit index signature, so
|
|
22
|
+
* every block's `<Name>Translations` — and every host block's — would be rejected.
|
|
23
|
+
*/
|
|
24
|
+
export type AllStringValues<T> = {
|
|
25
|
+
[K in keyof T]: string;
|
|
26
|
+
};
|
|
27
|
+
export interface BlockTranslations<T> {
|
|
28
|
+
/** Fully resolved strings — every key present, whatever the host supplied. */
|
|
29
|
+
translations: T;
|
|
30
|
+
/** Resolve a key and substitute its `%{…}` placeholders. */
|
|
31
|
+
translate: (key: keyof T & string, vars?: Record<string, unknown>) => string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolves a block's strings: the English bundled with this package, overridden by
|
|
35
|
+
* whatever a `BlockTranslationsProvider` above supplies — which in practice is what the
|
|
36
|
+
* host passed to `create<Name>Block({ translations })`.
|
|
37
|
+
*
|
|
38
|
+
* The English fallback means a bare `<Text />` renders with no provider at all, so tests,
|
|
39
|
+
* stories and direct use need no setup, and a host that forgets a key degrades to English
|
|
40
|
+
* rather than showing a raw key.
|
|
41
|
+
*
|
|
42
|
+
* Nothing else is needed for strings the *package* owns outside any block (designer
|
|
43
|
+
* chrome, say): give them their own slice and call this hook with it. There is
|
|
44
|
+
* deliberately no separate "base translations" provider — this one already generalises.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useBlockTranslations<T extends AllStringValues<T>>(fallback: T): BlockTranslations<T>;
|
|
47
|
+
//# sourceMappingURL=BlockTranslationsContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockTranslationsContext.d.ts","sourceRoot":"","sources":["../../src/contexts/BlockTranslationsContext.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAA;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAI3D,MAAM,WAAW,8BAA8B,CAAC,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAA;IACR,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,EACtE,KAAK,EACL,QAAQ,GACT,EAAE,8BAA8B,CAAC,CAAC,CAAC,2CAMnC;AAcD;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;CAAE,CAAA;AAE3D,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,8EAA8E;IAC9E,YAAY,EAAE,CAAC,CAAA;IACf,4DAA4D;IAC5D,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAA;CAC7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAC/D,QAAQ,EAAE,CAAC,GACV,iBAAiB,CAAC,CAAC,CAAC,CAoBtB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The props the settings form hands a host-injected rich-text *editor* — the write-path
|
|
4
|
+
* twin of `RichTextRendererContext`'s read-path renderer. The contract is deliberately
|
|
5
|
+
* host-agnostic: host-specific wiring (Canvas course/context, RCE plugin config, JWT) is
|
|
6
|
+
* closed over by the host inside its own component, never passed across this seam.
|
|
7
|
+
*/
|
|
8
|
+
export interface RichTextEditorProps {
|
|
9
|
+
/** Current HTML value. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Called with the new HTML whenever the editor's content changes. */
|
|
12
|
+
onChange: (html: string) => void;
|
|
13
|
+
/** Accessible label for the editor's textarea. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Stable id for the editor's textarea, derived from the field name. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Optional editor height (CSS length), e.g. `"400px"`. */
|
|
18
|
+
height?: string;
|
|
19
|
+
}
|
|
20
|
+
export type RichTextEditorComponent = ComponentType<RichTextEditorProps>;
|
|
21
|
+
/**
|
|
22
|
+
* The host's rich-text editor, or `undefined` when none is provided — in which case the
|
|
23
|
+
* settings form falls back to a plain `TextArea`. A host (e.g. Canvas) injects its own RCE
|
|
24
|
+
* here; stories, tests and hosts without an editor leave it `undefined`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const RichTextEditorContext: import('react').Context<RichTextEditorComponent | undefined>;
|
|
27
|
+
export declare const useRichTextEditor: () => RichTextEditorComponent | undefined;
|
|
28
|
+
//# sourceMappingURL=RichTextEditorContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextEditorContext.d.ts","sourceRoot":"","sources":["../../src/contexts/RichTextEditorContext.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,aAAa,EAA6B,MAAM,OAAO,CAAA;AAErE;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,sEAAsE;IACtE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAA;IACV,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAA;AAExE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,8DAAgE,CAAA;AAElG,eAAO,MAAM,iBAAiB,QAAO,uBAAuB,GAAG,SAC5B,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a rich-text HTML string into React nodes. A host injects one to run
|
|
4
|
+
* RCE-authored content through its own pipeline (e.g. Canvas file-link
|
|
5
|
+
* rewriting, inline file previews, media enhancement, MathJax) instead of the
|
|
6
|
+
* blocks' plain sanitized-HTML fallback.
|
|
7
|
+
*
|
|
8
|
+
* SECURITY: the renderer receives the **raw, unsanitized** HTML — the blocks do
|
|
9
|
+
* not sanitize on this path. A host that injects a renderer owns sanitization
|
|
10
|
+
* and MUST sanitize the html itself, or it opens an XSS hole.
|
|
11
|
+
*/
|
|
12
|
+
export type RichTextRenderer = (html: string) => ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The host's rich-text renderer, or `undefined` when none is provided — in which
|
|
15
|
+
* case the blocks fall back to `sanitizeHtml` + `dangerouslySetInnerHTML`. The
|
|
16
|
+
* host (e.g. a learner page) provides the value; consumers that don't need a
|
|
17
|
+
* custom pipeline (storybook, the designer, a bare render) leave it `undefined`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const RichTextRendererContext: import('react').Context<RichTextRenderer | undefined>;
|
|
20
|
+
export declare const useRichTextRenderer: () => RichTextRenderer | undefined;
|
|
21
|
+
//# sourceMappingURL=RichTextRendererContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextRendererContext.d.ts","sourceRoot":"","sources":["../../src/contexts/RichTextRendererContext.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAEjE;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,uDAAyD,CAAA;AAE7F,eAAO,MAAM,mBAAmB,QAAO,gBAAgB,GAAG,SACrB,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BlockRegistry } from '../registry';
|
|
2
|
+
import { Tool } from './sidebar/panel/types';
|
|
3
|
+
import { UseBlockEditorStateReturn } from './state/useBlockEditorState';
|
|
4
|
+
/** The trays the package ships. A host appends its own tools (widget tray, AI assistant). */
|
|
5
|
+
export declare const BUILT_IN_TOOL_IDS: readonly ["components", "interactive", "layout", "templates"];
|
|
6
|
+
export type BuiltInToolId = (typeof BUILT_IN_TOOL_IDS)[number];
|
|
7
|
+
export interface BlockContentEditorProps<HostToolId extends string = never> {
|
|
8
|
+
/** The host-owned editor state (from `useBlockEditorState`). The host keeps save / undo /
|
|
9
|
+
* dirty / DB↔package conversion; this component only composes the authoring UI over it. */
|
|
10
|
+
engine: UseBlockEditorStateReturn;
|
|
11
|
+
/** The registry the document's blocks resolve against (same one passed to `useBlockEditorState`). */
|
|
12
|
+
registry: BlockRegistry;
|
|
13
|
+
/** Host tools appended after the built-in trays — the host-tool slot (a widget tray, the
|
|
14
|
+
* IgniteAI Assistant). Block-level AI is gated on the `AIAction` seam, not on a tool. */
|
|
15
|
+
tools?: Tool<HostToolId>[];
|
|
16
|
+
/** Which built-in trays to render, as a subset of `BUILT_IN_TOOL_IDS`; defaults to all four.
|
|
17
|
+
* Rendered in the canonical order regardless of the order given (e.g. a dashboard passes
|
|
18
|
+
* `['components', 'layout']`). */
|
|
19
|
+
builtInToolIds?: BuiltInToolId[];
|
|
20
|
+
/** The tool open on first render. Defaults to the first rendered built-in tray (`components`
|
|
21
|
+
* unless excluded), then the first host tool. */
|
|
22
|
+
initialToolId?: BuiltInToolId | HostToolId;
|
|
23
|
+
/** Panel height; forwarded to `DesignerSideBar` (defaults to `100%`). */
|
|
24
|
+
height?: number | string;
|
|
25
|
+
/** Shows the sidebar's rail collapse/expand toggle once a tool has been opened. */
|
|
26
|
+
hasExpandPanelButton?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The authoring editor: the tool-panel sidebar over the drag-and-drop canvas, wired to the
|
|
30
|
+
* host's state engine. It is one convenient composition of the package's primitives — a host
|
|
31
|
+
* that needs a different arrangement (the sidebar in a modal, a custom layout) composes
|
|
32
|
+
* `GridDndProvider` + `DesignerSideBar` + `DesignerCanvas` itself; nothing here is required.
|
|
33
|
+
*
|
|
34
|
+
* It holds only the panel's view/tool UI state; the document, selection, and history live in
|
|
35
|
+
* the `engine` the host owns. One shared `GridDndProvider` wraps both surfaces so tray drag
|
|
36
|
+
* sources reach the canvas droppables. It is authoring-only — the student preview
|
|
37
|
+
* (`PreviewArea`) is a separate export the host presents however it wants.
|
|
38
|
+
*/
|
|
39
|
+
export declare function BlockContentEditor<HostToolId extends string = never>({ engine, registry, tools: hostTools, builtInToolIds, initialToolId, height, hasExpandPanelButton, }: BlockContentEditorProps<HostToolId>): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=BlockContentEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockContentEditor.d.ts","sourceRoot":"","sources":["../../src/editor/BlockContentEditor.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,aAAa,CAAA;AAOnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAQjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,+DAAgE,CAAA;AAC9F,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAmC9D,MAAM,WAAW,uBAAuB,CAAC,UAAU,SAAS,MAAM,GAAG,KAAK;IACxE;+FAC2F;IAC3F,MAAM,EAAE,yBAAyB,CAAA;IACjC,qGAAqG;IACrG,QAAQ,EAAE,aAAa,CAAA;IACvB;6FACyF;IACzF,KAAK,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,CAAA;IAC1B;;sCAEkC;IAClC,cAAc,CAAC,EAAE,aAAa,EAAE,CAAA;IAChC;qDACiD;IACjD,aAAa,CAAC,EAAE,aAAa,GAAG,UAAU,CAAA;IAC1C,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,mFAAmF;IACnF,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,SAAS,MAAM,GAAG,KAAK,EAAE,EACpE,MAAM,EACN,QAAQ,EACR,KAAK,EAAE,SAAS,EAChB,cAAuC,EACvC,aAAa,EACb,MAAM,EACN,oBAAoB,GACrB,EAAE,uBAAuB,CAAC,UAAU,CAAC,2CA0NrC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BlockRegistry } from '../../registry';
|
|
2
|
+
export interface BlockAIMenuProps {
|
|
3
|
+
componentType: string;
|
|
4
|
+
componentData: Record<string, unknown>;
|
|
5
|
+
/** Component instance ID, used to pick the edited entry from the AI's response. */
|
|
6
|
+
componentId?: string;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
onOpen: () => void;
|
|
9
|
+
onApply: (newProps: Record<string, unknown>) => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/** Composed by the host — needed to render the before/after preview and to resolve the block. */
|
|
12
|
+
componentRegistry: BlockRegistry;
|
|
13
|
+
/** Fires when the menu popover OR the preview modal is open, so the canvas can hold selection. */
|
|
14
|
+
onActiveChange?: (active: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const BlockAIMenu: ({ componentType, componentData, componentId, isOpen, onOpen, onApply, onClose, componentRegistry, onActiveChange, }: BlockAIMenuProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
//# sourceMappingURL=BlockAIMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockAIMenu.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/BlockAIMenu.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAA;AAQ7E,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACpD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,iGAAiG;IACjG,iBAAiB,EAAE,aAAa,CAAA;IAChC,kGAAkG;IAClG,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3C;AAED,eAAO,MAAM,WAAW,GAAI,qHAUzB,gBAAgB,mDAkIlB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type MenuView = 'root' | 'prompt' | 'change-tone' | 'change-length' | 'change-reading-level';
|
|
2
|
+
export interface BlockAIMenuContentProps {
|
|
3
|
+
view: MenuView;
|
|
4
|
+
onSetView: (view: MenuView) => void;
|
|
5
|
+
onQuickAction: (instruction: string) => void;
|
|
6
|
+
activeInstruction?: string | null;
|
|
7
|
+
prompt: string;
|
|
8
|
+
onPromptChange: (value: string) => void;
|
|
9
|
+
isThinking: boolean;
|
|
10
|
+
error?: string | null;
|
|
11
|
+
previewFirst: boolean;
|
|
12
|
+
onPreviewFirstChange: (value: boolean) => void;
|
|
13
|
+
onSend: () => void;
|
|
14
|
+
onStop: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const BlockAIMenuContent: ({ view, onSetView, onQuickAction, activeInstruction, prompt, onPromptChange, isThinking, error, previewFirst, onPreviewFirstChange, onSend, onStop, }: BlockAIMenuContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=BlockAIMenuContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockAIMenuContent.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/BlockAIMenuContent.tsx"],"names":[],"mappings":"AAsCA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,sBAAsB,CAAA;AAkDnG,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IACnC,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEjC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,eAAO,MAAM,kBAAkB,GAAI,uJAahC,uBAAuB,4CAyLzB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BlockRegistry, LayoutNode, TemplateData, UnresolvedBlock } from '../../registry';
|
|
2
|
+
export interface PreviewBlockModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onReplace: () => void;
|
|
6
|
+
onRegenerate: (refinementText: string) => void;
|
|
7
|
+
isRegenerating?: boolean;
|
|
8
|
+
/** FOUND-62: the refinement/regenerate field is hidden by default. */
|
|
9
|
+
showRefinement?: boolean;
|
|
10
|
+
beforeLayout: LayoutNode[];
|
|
11
|
+
beforeData?: TemplateData;
|
|
12
|
+
afterLayout: LayoutNode[];
|
|
13
|
+
afterData?: TemplateData;
|
|
14
|
+
/** Composed by the host — same contract as `Viewer`; renders both diff panels. */
|
|
15
|
+
componentRegistry: BlockRegistry;
|
|
16
|
+
/** Forwarded to both `Viewer`s. */
|
|
17
|
+
onUnresolvedBlock?: (block: UnresolvedBlock) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A fullscreen before/after diff of an AI-proposed block change: the current block ("Before")
|
|
21
|
+
* beside the AI's version ("After"), a Both/After/Before switch, an optional refinement field,
|
|
22
|
+
* and Cancel / Accept-and-replace. The two panels are the read-path `Viewer` run with designer
|
|
23
|
+
* mode off (so blocks show their student state), reached through the modal portal — brand color,
|
|
24
|
+
* translations and host data hooks come from the host's providers above, as everywhere else. The
|
|
25
|
+
* source's IgniteAI gradient is dropped for a neutral, themeable surface; the AI accent is the
|
|
26
|
+
* colored icon in the header.
|
|
27
|
+
*/
|
|
28
|
+
export declare const PreviewBlockModal: ({ open, onClose, onReplace, onRegenerate, isRegenerating, showRefinement, beforeLayout, beforeData, afterLayout, afterData, componentRegistry, onUnresolvedBlock, }: PreviewBlockModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=PreviewBlockModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewBlockModal.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/PreviewBlockModal.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAS9F,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,YAAY,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sEAAsE;IACtE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,EAAE,UAAU,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,YAAY,CAAA;IACzB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,kFAAkF;IAClF,iBAAiB,EAAE,aAAa,CAAA;IAChC,mCAAmC;IACnC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;CACrD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,qKAa/B,sBAAsB,4CA4KxB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The block-level AI menu's chrome CSS: the popover card, its interactive menu-item rows
|
|
3
|
+
* (hover/focus/disabled) and the free-text prompt row. None of it is expressible in InstUI
|
|
4
|
+
* props — it needs `:hover`/`:focus-visible`/`:disabled` states and a borderless input — so it
|
|
5
|
+
* is injected once as a global stylesheet keyed by stable class names, the same way the canvas
|
|
6
|
+
* and preview chrome are. The source's `theme.gradients.igniteAI` branding is neutralized to
|
|
7
|
+
* plain InstUI surface tokens; the AI accent lives in the colored AI icon on the trigger.
|
|
8
|
+
*/
|
|
9
|
+
export declare const AI_CLASS: {
|
|
10
|
+
readonly root: "bce-ai-menu-root";
|
|
11
|
+
readonly card: "bce-ai-menu-card";
|
|
12
|
+
readonly list: "bce-ai-menu-list";
|
|
13
|
+
readonly item: "bce-ai-menu-item";
|
|
14
|
+
readonly itemLabel: "bce-ai-menu-item-label";
|
|
15
|
+
readonly subHeader: "bce-ai-menu-subheader";
|
|
16
|
+
readonly input: "bce-ai-menu-input";
|
|
17
|
+
readonly footer: "bce-ai-menu-footer";
|
|
18
|
+
readonly thinkingBody: "bce-ai-menu-thinking";
|
|
19
|
+
readonly thinkingStatus: "bce-ai-menu-thinking-status";
|
|
20
|
+
};
|
|
21
|
+
/** Mounts the AI menu chrome stylesheet once, under the menu popover. */
|
|
22
|
+
export declare function AIMenuStyles(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=aiMenuStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiMenuStyles.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/aiMenuStyles.tsx"],"names":[],"mappings":"AAoBA;;;;;;;GAOG;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;CAWX,CAAA;AAmBV,yEAAyE;AACzE,wBAAgB,YAAY,4CA+G3B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strings the package owns for the block-level AI chrome — the per-block AI menu, the
|
|
3
|
+
* before/after preview, and the "Generate alt text" affordance. Consumed via
|
|
4
|
+
* `useBlockTranslations(DesignerAIEnglish)`, the same mechanism blocks use; there is
|
|
5
|
+
* deliberately no second translation context. The host overrides by placing a
|
|
6
|
+
* `BlockTranslationsProvider` above the editor; anything it omits falls back to the English
|
|
7
|
+
* below. Bundled English is intentionally product-neutral ("AI", not a brand name) — a host
|
|
8
|
+
* brands it through its own translations.
|
|
9
|
+
*
|
|
10
|
+
* Only the visible labels/chrome live here. The *instruction* strings the menu sends to the AI
|
|
11
|
+
* (e.g. "Make the tone more formal") are model prompts, not UI copy, so they stay as literals in
|
|
12
|
+
* `BlockAIMenuContent` and are not translated.
|
|
13
|
+
*/
|
|
14
|
+
export interface DesignerAITranslations {
|
|
15
|
+
/** Accessible label for the AI menu trigger on a block. `%{componentType}` is the block name. */
|
|
16
|
+
aiAssistFor: string;
|
|
17
|
+
/** Tooltip on the AI menu trigger. */
|
|
18
|
+
aiActions: string;
|
|
19
|
+
/** Back link from a submenu to the root menu. */
|
|
20
|
+
backToMenu: string;
|
|
21
|
+
/** Root action + prompt-view header: open a free-text regenerate prompt. */
|
|
22
|
+
regenerateWithPrompt: string;
|
|
23
|
+
/** Root action: open the tone submenu. */
|
|
24
|
+
changeTone: string;
|
|
25
|
+
/** Root action: open the length submenu. */
|
|
26
|
+
changeLength: string;
|
|
27
|
+
/** Root action: open the reading-level submenu. */
|
|
28
|
+
changeReadingLevel: string;
|
|
29
|
+
/** Tone submenu item labels. */
|
|
30
|
+
toneMoreFormal: string;
|
|
31
|
+
toneMoreFun: string;
|
|
32
|
+
toneMoreCasual: string;
|
|
33
|
+
toneMoreTechnical: string;
|
|
34
|
+
/** Length submenu item labels. */
|
|
35
|
+
lengthShorter: string;
|
|
36
|
+
lengthLonger: string;
|
|
37
|
+
/** Reading-level submenu item labels. */
|
|
38
|
+
readingBeginning: string;
|
|
39
|
+
readingNovice: string;
|
|
40
|
+
readingIntermediate: string;
|
|
41
|
+
readingAdvanced: string;
|
|
42
|
+
/** Prompt input label/placeholder. */
|
|
43
|
+
promptPlaceholder: string;
|
|
44
|
+
/** Toggle: show the before/after preview before applying. */
|
|
45
|
+
previewFirst: string;
|
|
46
|
+
/** Send the prompt. */
|
|
47
|
+
send: string;
|
|
48
|
+
/** In-flight status while the AI generates. */
|
|
49
|
+
thinking: string;
|
|
50
|
+
/** Stop an in-flight generation. */
|
|
51
|
+
stop: string;
|
|
52
|
+
/** Error shown in the AI menu when a generation fails or returns nothing usable. */
|
|
53
|
+
generationFailed: string;
|
|
54
|
+
/** Preview modal title. */
|
|
55
|
+
previewBlock: string;
|
|
56
|
+
/** Accessible group label for the Both/After/Before comparison switch. */
|
|
57
|
+
compareLabel: string;
|
|
58
|
+
/** Comparison switch options + panel headings. */
|
|
59
|
+
both: string;
|
|
60
|
+
before: string;
|
|
61
|
+
after: string;
|
|
62
|
+
/** Preview modal buttons. */
|
|
63
|
+
previewCancel: string;
|
|
64
|
+
acceptAndReplace: string;
|
|
65
|
+
/** Refinement field label/placeholder + its buttons (field hidden by default). */
|
|
66
|
+
refinementPlaceholder: string;
|
|
67
|
+
regenerate: string;
|
|
68
|
+
regenerating: string;
|
|
69
|
+
/** "Generate alt text" affordance on the alt-text field. */
|
|
70
|
+
generateAltText: string;
|
|
71
|
+
generating: string;
|
|
72
|
+
/** Errors surfaced by the alt-text affordance. */
|
|
73
|
+
failedToLoadImage: string;
|
|
74
|
+
failedToGenerate: string;
|
|
75
|
+
noDescription: string;
|
|
76
|
+
}
|
|
77
|
+
/** English bundled with this package — also the source for `locales/en.json`. */
|
|
78
|
+
export declare const DesignerAIEnglish: DesignerAITranslations;
|
|
79
|
+
//# sourceMappingURL=aiTranslations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiTranslations.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/aiTranslations.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,sBAAsB;IACrC,iGAAiG;IACjG,WAAW,EAAE,MAAM,CAAA;IACnB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,oBAAoB,EAAE,MAAM,CAAA;IAC5B,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,mDAAmD;IACnD,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,kCAAkC;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,eAAe,EAAE,MAAM,CAAA;IACvB,sCAAsC;IACtC,iBAAiB,EAAE,MAAM,CAAA;IACzB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAA;IACpB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,CAAA;IACxB,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,kFAAkF;IAClF,qBAAqB,EAAE,MAAM,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,sBAuC/B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `inline_manipulate_template_content` tool's response payload, as it comes back over the
|
|
3
|
+
* wire from the AI. Deliberately the agent's **array** shape (`{ id, props }[]`), NOT the engine's
|
|
4
|
+
* flat `TemplateData` Record: the hook reads it with `.find(e => e.id === componentId)` to pick the
|
|
5
|
+
* edited block, so it must stay an array — converting it to a Record would break that lookup.
|
|
6
|
+
*/
|
|
7
|
+
export interface AIInlineTemplateContentPayload {
|
|
8
|
+
templateData: {
|
|
9
|
+
id: string;
|
|
10
|
+
props: Record<string, unknown>;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=aiTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiTypes.d.ts","sourceRoot":"","sources":["../../../src/editor/ai/aiTypes.ts"],"names":[],"mappings":"AAkBA;;;;;GAKG;AACH,MAAM,WAAW,8BAA8B;IAC7C,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,CAAA;CAC/D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The three panes of the before/after AI preview comparison. */
|
|
2
|
+
export declare const PREVIEW_BLOCK_VIEWS: {
|
|
3
|
+
readonly BOTH: "both";
|
|
4
|
+
readonly AFTER: "after";
|
|
5
|
+
readonly BEFORE: "before";
|
|
6
|
+
};
|
|
7
|
+
export type PreviewBlockView = (typeof PREVIEW_BLOCK_VIEWS)[keyof typeof PREVIEW_BLOCK_VIEWS];
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -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
|