@bendyline/squisq-editor-react 1.3.0 → 1.5.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/dist/DocumentSettingsDialog.d.ts +26 -0
- package/dist/DocumentSettingsDialog.d.ts.map +1 -0
- package/dist/DocumentSettingsDialog.js +115 -0
- package/dist/DocumentSettingsDialog.js.map +1 -0
- package/dist/EditorContext.d.ts +248 -4
- package/dist/EditorContext.d.ts.map +1 -1
- package/dist/EditorContext.js +248 -10
- package/dist/EditorContext.js.map +1 -1
- package/dist/EditorShell.d.ts +184 -4
- package/dist/EditorShell.d.ts.map +1 -1
- package/dist/EditorShell.js +184 -12
- package/dist/EditorShell.js.map +1 -1
- package/dist/EmojiPicker.d.ts +50 -0
- package/dist/EmojiPicker.d.ts.map +1 -0
- package/dist/EmojiPicker.js +182 -0
- package/dist/EmojiPicker.js.map +1 -0
- package/dist/ImageEditor.d.ts +68 -0
- package/dist/ImageEditor.d.ts.map +1 -0
- package/dist/ImageEditor.js +166 -0
- package/dist/ImageEditor.js.map +1 -0
- package/dist/ImageNodeView.d.ts +13 -1
- package/dist/ImageNodeView.d.ts.map +1 -1
- package/dist/ImageNodeView.js +172 -19
- package/dist/ImageNodeView.js.map +1 -1
- package/dist/ImageViewer.d.ts +26 -0
- package/dist/ImageViewer.d.ts.map +1 -0
- package/dist/ImageViewer.js +119 -0
- package/dist/ImageViewer.js.map +1 -0
- package/dist/InlineIcon.d.ts +17 -0
- package/dist/InlineIcon.d.ts.map +1 -0
- package/dist/InlineIcon.js +72 -0
- package/dist/InlineIcon.js.map +1 -0
- package/dist/InlinePreviewGutter.d.ts +52 -0
- package/dist/InlinePreviewGutter.d.ts.map +1 -0
- package/dist/InlinePreviewGutter.js +397 -0
- package/dist/InlinePreviewGutter.js.map +1 -0
- package/dist/LinkDialog.d.ts +43 -0
- package/dist/LinkDialog.d.ts.map +1 -0
- package/dist/LinkDialog.js +102 -0
- package/dist/LinkDialog.js.map +1 -0
- package/dist/MediaBin.d.ts +12 -1
- package/dist/MediaBin.d.ts.map +1 -1
- package/dist/MediaBin.js +13 -3
- package/dist/MediaBin.js.map +1 -1
- package/dist/MentionExtension.js +10 -7
- package/dist/MentionExtension.js.map +1 -1
- package/dist/OutlinePanel.d.ts +17 -0
- package/dist/OutlinePanel.d.ts.map +1 -0
- package/dist/OutlinePanel.js +167 -0
- package/dist/OutlinePanel.js.map +1 -0
- package/dist/PlainHtmlPreview.d.ts +50 -0
- package/dist/PlainHtmlPreview.d.ts.map +1 -0
- package/dist/PlainHtmlPreview.js +155 -0
- package/dist/PlainHtmlPreview.js.map +1 -0
- package/dist/PreviewControls.d.ts +15 -1
- package/dist/PreviewControls.d.ts.map +1 -1
- package/dist/PreviewControls.js +75 -18
- package/dist/PreviewControls.js.map +1 -1
- package/dist/PreviewPanel.d.ts +11 -10
- package/dist/PreviewPanel.d.ts.map +1 -1
- package/dist/PreviewPanel.js +20 -17
- package/dist/PreviewPanel.js.map +1 -1
- package/dist/RawEditor.d.ts.map +1 -1
- package/dist/RawEditor.js +198 -4
- package/dist/RawEditor.js.map +1 -1
- package/dist/RecorderEntry.d.ts +24 -0
- package/dist/RecorderEntry.d.ts.map +1 -0
- package/dist/RecorderEntry.js +139 -0
- package/dist/RecorderEntry.js.map +1 -0
- package/dist/TemplateAnnotation.d.ts.map +1 -1
- package/dist/TemplateAnnotation.js +32 -6
- package/dist/TemplateAnnotation.js.map +1 -1
- package/dist/TemplatePicker.d.ts +53 -0
- package/dist/TemplatePicker.d.ts.map +1 -0
- package/dist/TemplatePicker.js +388 -0
- package/dist/TemplatePicker.js.map +1 -0
- package/dist/ThemeCustomizerPanel.d.ts +32 -0
- package/dist/ThemeCustomizerPanel.d.ts.map +1 -0
- package/dist/ThemeCustomizerPanel.js +256 -0
- package/dist/ThemeCustomizerPanel.js.map +1 -0
- package/dist/ThemePicker.d.ts +33 -0
- package/dist/ThemePicker.d.ts.map +1 -0
- package/dist/ThemePicker.js +148 -0
- package/dist/ThemePicker.js.map +1 -0
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar.js +508 -33
- package/dist/Toolbar.js.map +1 -1
- package/dist/VersionHistoryPanel.d.ts +14 -0
- package/dist/VersionHistoryPanel.d.ts.map +1 -0
- package/dist/VersionHistoryPanel.js +147 -0
- package/dist/VersionHistoryPanel.js.map +1 -0
- package/dist/ViewMenuPanel.d.ts +13 -0
- package/dist/ViewMenuPanel.d.ts.map +1 -0
- package/dist/ViewMenuPanel.js +58 -0
- package/dist/ViewMenuPanel.js.map +1 -0
- package/dist/WysiwygEditor.d.ts.map +1 -1
- package/dist/WysiwygEditor.js +198 -9
- package/dist/WysiwygEditor.js.map +1 -1
- package/dist/__tests__/detectMarkdown.test.js +0 -14
- package/dist/__tests__/detectMarkdown.test.js.map +1 -1
- package/dist/__tests__/documentSettingsDialog.test.d.ts +2 -0
- package/dist/__tests__/documentSettingsDialog.test.d.ts.map +1 -0
- package/dist/__tests__/documentSettingsDialog.test.js +132 -0
- package/dist/__tests__/documentSettingsDialog.test.js.map +1 -0
- package/dist/__tests__/emojiPicker.test.d.ts +2 -0
- package/dist/__tests__/emojiPicker.test.d.ts.map +1 -0
- package/dist/__tests__/emojiPicker.test.js +111 -0
- package/dist/__tests__/emojiPicker.test.js.map +1 -0
- package/dist/__tests__/fileKind.test.js +13 -0
- package/dist/__tests__/fileKind.test.js.map +1 -1
- package/dist/__tests__/imageEditAffordance.test.d.ts +2 -0
- package/dist/__tests__/imageEditAffordance.test.d.ts.map +1 -0
- package/dist/__tests__/imageEditAffordance.test.js +188 -0
- package/dist/__tests__/imageEditAffordance.test.js.map +1 -0
- package/dist/__tests__/imageEditorShell.test.d.ts +2 -0
- package/dist/__tests__/imageEditorShell.test.d.ts.map +1 -0
- package/dist/__tests__/imageEditorShell.test.js +52 -0
- package/dist/__tests__/imageEditorShell.test.js.map +1 -0
- package/dist/__tests__/imageEditorState.test.d.ts +3 -0
- package/dist/__tests__/imageEditorState.test.d.ts.map +1 -0
- package/dist/__tests__/imageEditorState.test.js +148 -0
- package/dist/__tests__/imageEditorState.test.js.map +1 -0
- package/dist/__tests__/inlinePreviewGutter.test.d.ts +2 -0
- package/dist/__tests__/inlinePreviewGutter.test.d.ts.map +1 -0
- package/dist/__tests__/inlinePreviewGutter.test.js +51 -0
- package/dist/__tests__/inlinePreviewGutter.test.js.map +1 -0
- package/dist/__tests__/inlinePreviewGutterAllBlocks.test.d.ts +2 -0
- package/dist/__tests__/inlinePreviewGutterAllBlocks.test.d.ts.map +1 -0
- package/dist/__tests__/inlinePreviewGutterAllBlocks.test.js +63 -0
- package/dist/__tests__/inlinePreviewGutterAllBlocks.test.js.map +1 -0
- package/dist/__tests__/jsonEditor.test.d.ts +2 -0
- package/dist/__tests__/jsonEditor.test.d.ts.map +1 -0
- package/dist/__tests__/jsonEditor.test.js +134 -0
- package/dist/__tests__/jsonEditor.test.js.map +1 -0
- package/dist/__tests__/layersPanel.test.d.ts +2 -0
- package/dist/__tests__/layersPanel.test.d.ts.map +1 -0
- package/dist/__tests__/layersPanel.test.js +84 -0
- package/dist/__tests__/layersPanel.test.js.map +1 -0
- package/dist/__tests__/linkDialogDocPicker.test.d.ts +7 -0
- package/dist/__tests__/linkDialogDocPicker.test.d.ts.map +1 -0
- package/dist/__tests__/linkDialogDocPicker.test.js +75 -0
- package/dist/__tests__/linkDialogDocPicker.test.js.map +1 -0
- package/dist/__tests__/mediaAttachmentFlow.test.d.ts +2 -0
- package/dist/__tests__/mediaAttachmentFlow.test.d.ts.map +1 -0
- package/dist/__tests__/mediaAttachmentFlow.test.js +99 -0
- package/dist/__tests__/mediaAttachmentFlow.test.js.map +1 -0
- package/dist/__tests__/outlinePanel.test.d.ts +2 -0
- package/dist/__tests__/outlinePanel.test.d.ts.map +1 -0
- package/dist/__tests__/outlinePanel.test.js +68 -0
- package/dist/__tests__/outlinePanel.test.js.map +1 -0
- package/dist/__tests__/plainHtmlPreview.test.d.ts +2 -0
- package/dist/__tests__/plainHtmlPreview.test.d.ts.map +1 -0
- package/dist/__tests__/plainHtmlPreview.test.js +87 -0
- package/dist/__tests__/plainHtmlPreview.test.js.map +1 -0
- package/dist/__tests__/propertiesPanel.test.d.ts +2 -0
- package/dist/__tests__/propertiesPanel.test.d.ts.map +1 -0
- package/dist/__tests__/propertiesPanel.test.js +64 -0
- package/dist/__tests__/propertiesPanel.test.js.map +1 -0
- package/dist/__tests__/recorderFormats.test.d.ts +2 -0
- package/dist/__tests__/recorderFormats.test.d.ts.map +1 -0
- package/dist/__tests__/recorderFormats.test.js +121 -0
- package/dist/__tests__/recorderFormats.test.js.map +1 -0
- package/dist/__tests__/recorderTimingJson.test.d.ts +2 -0
- package/dist/__tests__/recorderTimingJson.test.d.ts.map +1 -0
- package/dist/__tests__/recorderTimingJson.test.js +37 -0
- package/dist/__tests__/recorderTimingJson.test.js.map +1 -0
- package/dist/__tests__/templateAnnotationRoundTrip.test.d.ts +2 -0
- package/dist/__tests__/templateAnnotationRoundTrip.test.d.ts.map +1 -0
- package/dist/__tests__/templateAnnotationRoundTrip.test.js +31 -0
- package/dist/__tests__/templateAnnotationRoundTrip.test.js.map +1 -0
- package/dist/__tests__/tiptapBridge.test.js +26 -0
- package/dist/__tests__/tiptapBridge.test.js.map +1 -1
- package/dist/__tests__/tiptapImageRoundTrip.test.d.ts +2 -0
- package/dist/__tests__/tiptapImageRoundTrip.test.d.ts.map +1 -0
- package/dist/__tests__/tiptapImageRoundTrip.test.js +68 -0
- package/dist/__tests__/tiptapImageRoundTrip.test.js.map +1 -0
- package/dist/__tests__/useImageEditor.test.d.ts +2 -0
- package/dist/__tests__/useImageEditor.test.d.ts.map +1 -0
- package/dist/__tests__/useImageEditor.test.js +131 -0
- package/dist/__tests__/useImageEditor.test.js.map +1 -0
- package/dist/__tests__/useMediaRecorder.test.d.ts +2 -0
- package/dist/__tests__/useMediaRecorder.test.d.ts.map +1 -0
- package/dist/__tests__/useMediaRecorder.test.js +153 -0
- package/dist/__tests__/useMediaRecorder.test.js.map +1 -0
- package/dist/__tests__/versionHistory.test.d.ts +2 -0
- package/dist/__tests__/versionHistory.test.d.ts.map +1 -0
- package/dist/__tests__/versionHistory.test.js +124 -0
- package/dist/__tests__/versionHistory.test.js.map +1 -0
- package/dist/blockSlice.d.ts +24 -0
- package/dist/blockSlice.d.ts.map +1 -0
- package/dist/blockSlice.js +63 -0
- package/dist/blockSlice.js.map +1 -0
- package/dist/buildPreviewDoc.d.ts.map +1 -1
- package/dist/buildPreviewDoc.js +52 -2
- package/dist/buildPreviewDoc.js.map +1 -1
- package/dist/emojiData.d.ts +81 -0
- package/dist/emojiData.d.ts.map +1 -0
- package/dist/emojiData.js +1283 -0
- package/dist/emojiData.js.map +1 -0
- package/dist/fileKind.d.ts +6 -2
- package/dist/fileKind.d.ts.map +1 -1
- package/dist/fileKind.js +25 -4
- package/dist/fileKind.js.map +1 -1
- package/dist/hooks/useFileDrop.d.ts.map +1 -1
- package/dist/hooks/useFileDrop.js +40 -4
- package/dist/hooks/useFileDrop.js.map +1 -1
- package/dist/imageEditor/CanvasSurface.d.ts +31 -0
- package/dist/imageEditor/CanvasSurface.d.ts.map +1 -0
- package/dist/imageEditor/CanvasSurface.js +264 -0
- package/dist/imageEditor/CanvasSurface.js.map +1 -0
- package/dist/imageEditor/ImageVersionHistoryDropdown.d.ts +39 -0
- package/dist/imageEditor/ImageVersionHistoryDropdown.d.ts.map +1 -0
- package/dist/imageEditor/ImageVersionHistoryDropdown.js +283 -0
- package/dist/imageEditor/ImageVersionHistoryDropdown.js.map +1 -0
- package/dist/imageEditor/LayersPanel.d.ts +14 -0
- package/dist/imageEditor/LayersPanel.d.ts.map +1 -0
- package/dist/imageEditor/LayersPanel.js +43 -0
- package/dist/imageEditor/LayersPanel.js.map +1 -0
- package/dist/imageEditor/PropertiesPanel.d.ts +14 -0
- package/dist/imageEditor/PropertiesPanel.d.ts.map +1 -0
- package/dist/imageEditor/PropertiesPanel.js +97 -0
- package/dist/imageEditor/PropertiesPanel.js.map +1 -0
- package/dist/imageEditor/Toolbar.d.ts +30 -0
- package/dist/imageEditor/Toolbar.d.ts.map +1 -0
- package/dist/imageEditor/Toolbar.js +108 -0
- package/dist/imageEditor/Toolbar.js.map +1 -0
- package/dist/imageEditor/icons.d.ts +24 -0
- package/dist/imageEditor/icons.d.ts.map +1 -0
- package/dist/imageEditor/icons.js +45 -0
- package/dist/imageEditor/icons.js.map +1 -0
- package/dist/imageEditor/layers/EditorImageLayer.d.ts +16 -0
- package/dist/imageEditor/layers/EditorImageLayer.d.ts.map +1 -0
- package/dist/imageEditor/layers/EditorImageLayer.js +37 -0
- package/dist/imageEditor/layers/EditorImageLayer.js.map +1 -0
- package/dist/imageEditor/layers/EditorShapeLayer.d.ts +15 -0
- package/dist/imageEditor/layers/EditorShapeLayer.d.ts.map +1 -0
- package/dist/imageEditor/layers/EditorShapeLayer.js +20 -0
- package/dist/imageEditor/layers/EditorShapeLayer.js.map +1 -0
- package/dist/imageEditor/layers/EditorTextLayer.d.ts +18 -0
- package/dist/imageEditor/layers/EditorTextLayer.d.ts.map +1 -0
- package/dist/imageEditor/layers/EditorTextLayer.js +13 -0
- package/dist/imageEditor/layers/EditorTextLayer.js.map +1 -0
- package/dist/imageEditor/layers/SelectionHandles.d.ts +17 -0
- package/dist/imageEditor/layers/SelectionHandles.d.ts.map +1 -0
- package/dist/imageEditor/layers/SelectionHandles.js +19 -0
- package/dist/imageEditor/layers/SelectionHandles.js.map +1 -0
- package/dist/imageEditor/state.d.ts +76 -0
- package/dist/imageEditor/state.d.ts.map +1 -0
- package/dist/imageEditor/state.js +87 -0
- package/dist/imageEditor/state.js.map +1 -0
- package/dist/imageEditor/useImageEditor.d.ts +53 -0
- package/dist/imageEditor/useImageEditor.d.ts.map +1 -0
- package/dist/imageEditor/useImageEditor.js +244 -0
- package/dist/imageEditor/useImageEditor.js.map +1 -0
- package/dist/imageEditor/useImageEditorTokens.d.ts +16 -0
- package/dist/imageEditor/useImageEditorTokens.d.ts.map +1 -0
- package/dist/imageEditor/useImageEditorTokens.js +45 -0
- package/dist/imageEditor/useImageEditorTokens.js.map +1 -0
- package/dist/index.d.ts +48 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -1
- package/dist/jsonEditor/EmbeddedRichTextField.d.ts +15 -0
- package/dist/jsonEditor/EmbeddedRichTextField.d.ts.map +1 -0
- package/dist/jsonEditor/EmbeddedRichTextField.js +74 -0
- package/dist/jsonEditor/EmbeddedRichTextField.js.map +1 -0
- package/dist/jsonEditor/JsonEditor.d.ts +36 -0
- package/dist/jsonEditor/JsonEditor.d.ts.map +1 -0
- package/dist/jsonEditor/JsonEditor.js +15 -0
- package/dist/jsonEditor/JsonEditor.js.map +1 -0
- package/dist/jsonEditor/JsonEditorContext.d.ts +28 -0
- package/dist/jsonEditor/JsonEditorContext.d.ts.map +1 -0
- package/dist/jsonEditor/JsonEditorContext.js +41 -0
- package/dist/jsonEditor/JsonEditorContext.js.map +1 -0
- package/dist/jsonEditor/RenderNode.d.ts +16 -0
- package/dist/jsonEditor/RenderNode.d.ts.map +1 -0
- package/dist/jsonEditor/RenderNode.js +32 -0
- package/dist/jsonEditor/RenderNode.js.map +1 -0
- package/dist/jsonEditor/editors.d.ts +36 -0
- package/dist/jsonEditor/editors.d.ts.map +1 -0
- package/dist/jsonEditor/editors.js +347 -0
- package/dist/jsonEditor/editors.js.map +1 -0
- package/dist/jsonEditor/index.d.ts +3 -0
- package/dist/jsonEditor/index.d.ts.map +1 -0
- package/dist/jsonEditor/index.js +2 -0
- package/dist/jsonEditor/index.js.map +1 -0
- package/dist/jsonEditor/useJsonEditorTokens.d.ts +13 -0
- package/dist/jsonEditor/useJsonEditorTokens.d.ts.map +1 -0
- package/dist/jsonEditor/useJsonEditorTokens.js +38 -0
- package/dist/jsonEditor/useJsonEditorTokens.js.map +1 -0
- package/dist/recorder/RecorderButton.d.ts +31 -0
- package/dist/recorder/RecorderButton.d.ts.map +1 -0
- package/dist/recorder/RecorderButton.js +24 -0
- package/dist/recorder/RecorderButton.js.map +1 -0
- package/dist/recorder/RecorderModal.d.ts +59 -0
- package/dist/recorder/RecorderModal.d.ts.map +1 -0
- package/dist/recorder/RecorderModal.js +333 -0
- package/dist/recorder/RecorderModal.js.map +1 -0
- package/dist/recorder/RecorderPanel.d.ts +25 -0
- package/dist/recorder/RecorderPanel.d.ts.map +1 -0
- package/dist/recorder/RecorderPanel.js +30 -0
- package/dist/recorder/RecorderPanel.js.map +1 -0
- package/dist/recorder/formats.d.ts +51 -0
- package/dist/recorder/formats.d.ts.map +1 -0
- package/dist/recorder/formats.js +144 -0
- package/dist/recorder/formats.js.map +1 -0
- package/dist/recorder/hooks/useMediaRecorder.d.ts +90 -0
- package/dist/recorder/hooks/useMediaRecorder.d.ts.map +1 -0
- package/dist/recorder/hooks/useMediaRecorder.js +277 -0
- package/dist/recorder/hooks/useMediaRecorder.js.map +1 -0
- package/dist/recorder/hooks/useStreamPreview.d.ts +22 -0
- package/dist/recorder/hooks/useStreamPreview.d.ts.map +1 -0
- package/dist/recorder/hooks/useStreamPreview.js +44 -0
- package/dist/recorder/hooks/useStreamPreview.js.map +1 -0
- package/dist/recorder/sources/cameraStream.d.ts +22 -0
- package/dist/recorder/sources/cameraStream.d.ts.map +1 -0
- package/dist/recorder/sources/cameraStream.js +24 -0
- package/dist/recorder/sources/cameraStream.js.map +1 -0
- package/dist/recorder/sources/micStream.d.ts +15 -0
- package/dist/recorder/sources/micStream.d.ts.map +1 -0
- package/dist/recorder/sources/micStream.js +24 -0
- package/dist/recorder/sources/micStream.js.map +1 -0
- package/dist/recorder/sources/screenStream.d.ts +53 -0
- package/dist/recorder/sources/screenStream.d.ts.map +1 -0
- package/dist/recorder/sources/screenStream.js +114 -0
- package/dist/recorder/sources/screenStream.js.map +1 -0
- package/dist/recorder/timingJson.d.ts +51 -0
- package/dist/recorder/timingJson.d.ts.map +1 -0
- package/dist/recorder/timingJson.js +42 -0
- package/dist/recorder/timingJson.js.map +1 -0
- package/dist/tiptap/TiptapAudio.d.ts +26 -0
- package/dist/tiptap/TiptapAudio.d.ts.map +1 -0
- package/dist/tiptap/TiptapAudio.js +58 -0
- package/dist/tiptap/TiptapAudio.js.map +1 -0
- package/dist/tiptap/TiptapVideo.d.ts +30 -0
- package/dist/tiptap/TiptapVideo.d.ts.map +1 -0
- package/dist/tiptap/TiptapVideo.js +66 -0
- package/dist/tiptap/TiptapVideo.js.map +1 -0
- package/dist/tiptap/useResolvedMediaSrc.d.ts +2 -0
- package/dist/tiptap/useResolvedMediaSrc.d.ts.map +1 -0
- package/dist/tiptap/useResolvedMediaSrc.js +42 -0
- package/dist/tiptap/useResolvedMediaSrc.js.map +1 -0
- package/dist/tiptapBridge.d.ts.map +1 -1
- package/dist/tiptapBridge.js +210 -16
- package/dist/tiptapBridge.js.map +1 -1
- package/dist/useHeadingLayout.d.ts +54 -0
- package/dist/useHeadingLayout.d.ts.map +1 -0
- package/dist/useHeadingLayout.js +260 -0
- package/dist/useHeadingLayout.js.map +1 -0
- package/dist/utils/collectInlineFontAwesomeCss.d.ts +21 -0
- package/dist/utils/collectInlineFontAwesomeCss.d.ts.map +1 -0
- package/dist/utils/collectInlineFontAwesomeCss.js +68 -0
- package/dist/utils/collectInlineFontAwesomeCss.js.map +1 -0
- package/dist/utils/dropUtils.d.ts +21 -2
- package/dist/utils/dropUtils.d.ts.map +1 -1
- package/dist/utils/dropUtils.js +43 -4
- package/dist/utils/dropUtils.js.map +1 -1
- package/dist/utils/normalizeMalformedAssetUrl.d.ts +15 -0
- package/dist/utils/normalizeMalformedAssetUrl.d.ts.map +1 -0
- package/dist/utils/normalizeMalformedAssetUrl.js +27 -0
- package/dist/utils/normalizeMalformedAssetUrl.js.map +1 -0
- package/package.json +8 -5
- package/src/DocumentSettingsDialog.tsx +266 -0
- package/src/EditorContext.tsx +534 -10
- package/src/EditorShell.tsx +691 -63
- package/src/EmojiPicker.tsx +332 -0
- package/src/ImageEditor.tsx +327 -0
- package/src/ImageNodeView.tsx +222 -21
- package/src/ImageViewer.tsx +221 -0
- package/src/InlineIcon.ts +84 -0
- package/src/InlinePreviewGutter.tsx +582 -0
- package/src/LinkDialog.tsx +276 -0
- package/src/MediaBin.tsx +22 -3
- package/src/MentionExtension.tsx +10 -7
- package/src/OutlinePanel.tsx +295 -0
- package/src/PlainHtmlPreview.tsx +211 -0
- package/src/PreviewControls.tsx +130 -24
- package/src/PreviewPanel.tsx +38 -21
- package/src/RawEditor.tsx +215 -4
- package/src/RecorderEntry.tsx +164 -0
- package/src/TemplateAnnotation.ts +32 -6
- package/src/TemplatePicker.tsx +818 -0
- package/src/ThemeCustomizerPanel.tsx +595 -0
- package/src/ThemePicker.tsx +319 -0
- package/src/Toolbar.tsx +708 -111
- package/src/VersionHistoryPanel.tsx +329 -0
- package/src/ViewMenuPanel.tsx +188 -0
- package/src/WysiwygEditor.tsx +229 -9
- package/src/__tests__/detectMarkdown.test.ts +0 -15
- package/src/__tests__/documentSettingsDialog.test.tsx +147 -0
- package/src/__tests__/emojiPicker.test.tsx +133 -0
- package/src/__tests__/fileKind.test.ts +16 -0
- package/src/__tests__/imageEditAffordance.test.tsx +268 -0
- package/src/__tests__/imageEditorShell.test.tsx +57 -0
- package/src/__tests__/imageEditorState.test.ts +171 -0
- package/src/__tests__/inlinePreviewGutter.test.tsx +62 -0
- package/src/__tests__/inlinePreviewGutterAllBlocks.test.tsx +103 -0
- package/src/__tests__/jsonEditor.test.tsx +168 -0
- package/src/__tests__/layersPanel.test.tsx +97 -0
- package/src/__tests__/linkDialogDocPicker.test.tsx +137 -0
- package/src/__tests__/mediaAttachmentFlow.test.ts +110 -0
- package/src/__tests__/outlinePanel.test.tsx +79 -0
- package/src/__tests__/plainHtmlPreview.test.tsx +107 -0
- package/src/__tests__/propertiesPanel.test.tsx +69 -0
- package/src/__tests__/recorderFormats.test.ts +146 -0
- package/src/__tests__/recorderTimingJson.test.ts +41 -0
- package/src/__tests__/templateAnnotationRoundTrip.test.ts +34 -0
- package/src/__tests__/tiptapBridge.test.ts +29 -0
- package/src/__tests__/tiptapImageRoundTrip.test.ts +73 -0
- package/src/__tests__/useImageEditor.test.tsx +159 -0
- package/src/__tests__/useMediaRecorder.test.ts +186 -0
- package/src/__tests__/versionHistory.test.tsx +197 -0
- package/src/blockSlice.ts +75 -0
- package/src/buildPreviewDoc.ts +61 -6
- package/src/emojiData.ts +1337 -0
- package/src/fileKind.ts +30 -6
- package/src/hooks/useFileDrop.ts +40 -4
- package/src/imageEditor/CanvasSurface.tsx +402 -0
- package/src/imageEditor/ImageVersionHistoryDropdown.tsx +396 -0
- package/src/imageEditor/LayersPanel.tsx +143 -0
- package/src/imageEditor/PropertiesPanel.tsx +428 -0
- package/src/imageEditor/Toolbar.tsx +242 -0
- package/src/imageEditor/icons.tsx +144 -0
- package/src/imageEditor/image-editor.css +450 -0
- package/src/imageEditor/layers/EditorImageLayer.tsx +45 -0
- package/src/imageEditor/layers/EditorShapeLayer.tsx +62 -0
- package/src/imageEditor/layers/EditorTextLayer.tsx +45 -0
- package/src/imageEditor/layers/SelectionHandles.tsx +86 -0
- package/src/imageEditor/state.ts +153 -0
- package/src/imageEditor/useImageEditor.ts +328 -0
- package/src/imageEditor/useImageEditorTokens.ts +70 -0
- package/src/index.ts +82 -0
- package/src/jsonEditor/EmbeddedRichTextField.tsx +81 -0
- package/src/jsonEditor/JsonEditor.tsx +81 -0
- package/src/jsonEditor/JsonEditorContext.tsx +75 -0
- package/src/jsonEditor/RenderNode.tsx +66 -0
- package/src/jsonEditor/editors.tsx +678 -0
- package/src/jsonEditor/index.ts +2 -0
- package/src/jsonEditor/json-editor.css +463 -0
- package/src/jsonEditor/useJsonEditorTokens.ts +63 -0
- package/src/recorder/RecorderButton.tsx +72 -0
- package/src/recorder/RecorderModal.tsx +596 -0
- package/src/recorder/RecorderPanel.tsx +93 -0
- package/src/recorder/formats.ts +159 -0
- package/src/recorder/hooks/useMediaRecorder.ts +378 -0
- package/src/recorder/hooks/useStreamPreview.ts +47 -0
- package/src/recorder/sources/cameraStream.ts +32 -0
- package/src/recorder/sources/micStream.ts +25 -0
- package/src/recorder/sources/screenStream.ts +162 -0
- package/src/recorder/timingJson.ts +66 -0
- package/src/styles/editor.css +2490 -51
- package/src/styles/image-edit-affordance.css +201 -0
- package/src/styles/index.css +10 -0
- package/src/tiptap/TiptapAudio.tsx +86 -0
- package/src/tiptap/TiptapVideo.tsx +119 -0
- package/src/tiptap/useResolvedMediaSrc.ts +47 -0
- package/src/tiptapBridge.ts +227 -22
- package/src/useHeadingLayout.ts +294 -0
- package/src/utils/collectInlineFontAwesomeCss.ts +69 -0
- package/src/utils/dropUtils.ts +54 -6
- package/src/utils/normalizeMalformedAssetUrl.ts +22 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hook that bundles the image-editor reducer with sidecar
|
|
3
|
+
* persistence, versioning, and an object-URL cache for asset bytes.
|
|
4
|
+
*
|
|
5
|
+
* Hosts pass an already-scoped {@link ContentContainer} (typically built
|
|
6
|
+
* with `scopeContainer(parent, basename + '_files')`); the hook never
|
|
7
|
+
* looks above that root.
|
|
8
|
+
*/
|
|
9
|
+
import type { ContentContainer } from '@bendyline/squisq/storage';
|
|
10
|
+
import { ImageEditVersionManager } from '@bendyline/squisq/imageEdit';
|
|
11
|
+
import { type ImageEditorAction, type ImageEditorState } from './state.js';
|
|
12
|
+
export interface UseImageEditorOptions {
|
|
13
|
+
/** Sidecar container for the image being edited. */
|
|
14
|
+
container: ContentContainer;
|
|
15
|
+
/**
|
|
16
|
+
* Initial source image URL — used to seed layer 0 when the sidecar has
|
|
17
|
+
* no `state.json` yet. Bytes are fetched and copied into
|
|
18
|
+
* `assets/source.<ext>` so the doc is portable.
|
|
19
|
+
*/
|
|
20
|
+
initialSrc?: string;
|
|
21
|
+
/** Override the state filename. Defaults to `state.json`. */
|
|
22
|
+
stateFilename?: string;
|
|
23
|
+
/** Enable version history. Default: `false`. */
|
|
24
|
+
allowVersioning?: boolean;
|
|
25
|
+
/** Auto-save idle delay (ms). `0` disables. Default: `5000`. */
|
|
26
|
+
versioningAutoSaveIdleMs?: number;
|
|
27
|
+
/** Debounced write delay for state.json (ms). Default: `500`. */
|
|
28
|
+
persistDebounceMs?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface UseImageEditorReturn {
|
|
31
|
+
/** Current reducer state (or `null` while still loading the initial doc). */
|
|
32
|
+
state: ImageEditorState | null;
|
|
33
|
+
/** Dispatch a reducer action. No-op while loading. */
|
|
34
|
+
dispatch: (action: ImageEditorAction) => void;
|
|
35
|
+
/** Manually trigger a synchronous write of `state.json`. */
|
|
36
|
+
flush: () => Promise<void>;
|
|
37
|
+
/** Resolve an asset path inside the sidecar to a blob URL (cached). */
|
|
38
|
+
resolveAssetUrl: (path: string) => Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Write a new asset (raster image) into `assets/` and return the
|
|
41
|
+
* sidecar-relative path. The caller is then expected to push a layer
|
|
42
|
+
* referencing that path.
|
|
43
|
+
*/
|
|
44
|
+
uploadAsset: (file: Blob, suggestedName?: string) => Promise<string>;
|
|
45
|
+
/** Versioning handle. `null` when `allowVersioning` is false or no container. */
|
|
46
|
+
versioning: ImageEditVersionManager | null;
|
|
47
|
+
/** True after the initial load completes (either an existing doc or seeded). */
|
|
48
|
+
ready: boolean;
|
|
49
|
+
/** Last load / persistence error, if any. */
|
|
50
|
+
error: Error | null;
|
|
51
|
+
}
|
|
52
|
+
export declare function useImageEditor(options: UseImageEditorOptions): UseImageEditorReturn;
|
|
53
|
+
//# sourceMappingURL=useImageEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImageEditor.d.ts","sourceRoot":"","sources":["../../src/imageEditor/useImageEditor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,E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|
|
3
|
+
* persistence, versioning, and an object-URL cache for asset bytes.
|
|
4
|
+
*
|
|
5
|
+
* Hosts pass an already-scoped {@link ContentContainer} (typically built
|
|
6
|
+
* with `scopeContainer(parent, basename + '_files')`); the hook never
|
|
7
|
+
* looks above that root.
|
|
8
|
+
*/
|
|
9
|
+
import { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react';
|
|
10
|
+
import { IMAGE_EDIT_ASSETS_PREFIX, IMAGE_EDIT_STATE_FILENAME, ImageEditVersionManager, createEmptyImageEditDoc, readImageEditDoc, writeImageEditDoc, } from '@bendyline/squisq/imageEdit';
|
|
11
|
+
import { imageEditorReducer, initialImageEditorState, } from './state.js';
|
|
12
|
+
export function useImageEditor(options) {
|
|
13
|
+
const { container, initialSrc, stateFilename = IMAGE_EDIT_STATE_FILENAME, allowVersioning = false, versioningAutoSaveIdleMs = 5000, persistDebounceMs = 500, } = options;
|
|
14
|
+
const [state, dispatch] = useReducer((s, a) => {
|
|
15
|
+
if (s === null)
|
|
16
|
+
return a.type === 'load' ? initialImageEditorState(a.doc) : null;
|
|
17
|
+
return imageEditorReducer(s, a);
|
|
18
|
+
}, null);
|
|
19
|
+
const [ready, setReady] = useState(false);
|
|
20
|
+
const [error, setError] = useState(null);
|
|
21
|
+
// Set to true inside the initial-load effect when we just seeded the
|
|
22
|
+
// sidecar (no prior `state.json`). The versioning effect below reads
|
|
23
|
+
// this flag to write an "original" snapshot once the manager exists.
|
|
24
|
+
const seededOnLoadRef = useRef(false);
|
|
25
|
+
// ── Initial load (or seed from initialSrc) ────────────────────────────
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
let cancelled = false;
|
|
28
|
+
setReady(false);
|
|
29
|
+
setError(null);
|
|
30
|
+
(async () => {
|
|
31
|
+
try {
|
|
32
|
+
const existing = await readImageEditDoc(container, stateFilename);
|
|
33
|
+
if (cancelled)
|
|
34
|
+
return;
|
|
35
|
+
if (existing) {
|
|
36
|
+
dispatch({ type: 'load', doc: existing });
|
|
37
|
+
setReady(true);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// No existing state — seed.
|
|
41
|
+
const seeded = await seedFromSource(container, initialSrc);
|
|
42
|
+
if (cancelled)
|
|
43
|
+
return;
|
|
44
|
+
await writeImageEditDoc(container, seeded, stateFilename);
|
|
45
|
+
dispatch({ type: 'load', doc: seeded });
|
|
46
|
+
setReady(true);
|
|
47
|
+
// Capture an initial snapshot of the freshly-seeded state so the
|
|
48
|
+
// version history always has an "original" entry the user can
|
|
49
|
+
// revert to after their first edit.
|
|
50
|
+
seededOnLoadRef.current = true;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
if (cancelled)
|
|
54
|
+
return;
|
|
55
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
56
|
+
setReady(true);
|
|
57
|
+
}
|
|
58
|
+
})();
|
|
59
|
+
return () => {
|
|
60
|
+
cancelled = true;
|
|
61
|
+
};
|
|
62
|
+
}, [container, stateFilename, initialSrc]);
|
|
63
|
+
// ── Debounced persistence of state.json ────────────────────────────────
|
|
64
|
+
const persistTimerRef = useRef(null);
|
|
65
|
+
const docRef = useRef(null);
|
|
66
|
+
docRef.current = state?.doc ?? null;
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!state?.dirty)
|
|
69
|
+
return;
|
|
70
|
+
if (persistTimerRef.current)
|
|
71
|
+
clearTimeout(persistTimerRef.current);
|
|
72
|
+
persistTimerRef.current = setTimeout(() => {
|
|
73
|
+
const doc = docRef.current;
|
|
74
|
+
if (!doc)
|
|
75
|
+
return;
|
|
76
|
+
writeImageEditDoc(container, doc, stateFilename)
|
|
77
|
+
.then(() => dispatch({ type: 'mark-clean' }))
|
|
78
|
+
.catch((err) => {
|
|
79
|
+
console.warn('[squisq-editor] image-edit state persist failed:', err instanceof Error ? err.message : err);
|
|
80
|
+
});
|
|
81
|
+
}, persistDebounceMs);
|
|
82
|
+
return () => {
|
|
83
|
+
if (persistTimerRef.current)
|
|
84
|
+
clearTimeout(persistTimerRef.current);
|
|
85
|
+
};
|
|
86
|
+
}, [state?.dirty, state?.doc, container, stateFilename, persistDebounceMs]);
|
|
87
|
+
const flush = useCallback(async () => {
|
|
88
|
+
const doc = docRef.current;
|
|
89
|
+
if (!doc)
|
|
90
|
+
return;
|
|
91
|
+
if (persistTimerRef.current) {
|
|
92
|
+
clearTimeout(persistTimerRef.current);
|
|
93
|
+
persistTimerRef.current = null;
|
|
94
|
+
}
|
|
95
|
+
await writeImageEditDoc(container, doc, stateFilename);
|
|
96
|
+
dispatch({ type: 'mark-clean' });
|
|
97
|
+
}, [container, stateFilename]);
|
|
98
|
+
// ── Versioning ─────────────────────────────────────────────────────────
|
|
99
|
+
const versioning = useMemo(() => (allowVersioning ? new ImageEditVersionManager(container, { stateFilename }) : null), [allowVersioning, container, stateFilename]);
|
|
100
|
+
// Drop the "original" snapshot once versioning is wired and we just
|
|
101
|
+
// seeded a fresh sidecar. Guarded by `seededOnLoadRef` so we never
|
|
102
|
+
// duplicate-snapshot on subsequent renders. Uses `force: true` so the
|
|
103
|
+
// initial entry always lands even though no diff has occurred yet.
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (!versioning)
|
|
106
|
+
return;
|
|
107
|
+
if (!ready)
|
|
108
|
+
return;
|
|
109
|
+
if (!seededOnLoadRef.current)
|
|
110
|
+
return;
|
|
111
|
+
seededOnLoadRef.current = false;
|
|
112
|
+
versioning.saveVersion({ force: true }).catch((err) => {
|
|
113
|
+
console.warn('[squisq-editor] image-edit initial snapshot failed:', err instanceof Error ? err.message : err);
|
|
114
|
+
});
|
|
115
|
+
}, [versioning, ready]);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (!versioning)
|
|
118
|
+
return;
|
|
119
|
+
if (versioningAutoSaveIdleMs <= 0)
|
|
120
|
+
return;
|
|
121
|
+
if (!state?.doc)
|
|
122
|
+
return;
|
|
123
|
+
const timer = setTimeout(() => {
|
|
124
|
+
versioning.saveVersion({ doc: docRef.current ?? undefined }).catch((err) => {
|
|
125
|
+
console.warn('[squisq-editor] image-edit auto-save version failed:', err instanceof Error ? err.message : err);
|
|
126
|
+
});
|
|
127
|
+
}, versioningAutoSaveIdleMs);
|
|
128
|
+
return () => clearTimeout(timer);
|
|
129
|
+
}, [versioning, versioningAutoSaveIdleMs, state?.doc]);
|
|
130
|
+
// ── Asset URL cache ────────────────────────────────────────────────────
|
|
131
|
+
const urlCacheRef = useRef(new Map());
|
|
132
|
+
const resolveAssetUrl = useCallback(async (path) => {
|
|
133
|
+
const cache = urlCacheRef.current;
|
|
134
|
+
const cached = cache.get(path);
|
|
135
|
+
if (cached)
|
|
136
|
+
return cached;
|
|
137
|
+
const data = await container.readFile(path);
|
|
138
|
+
if (!data)
|
|
139
|
+
throw new Error(`useImageEditor: missing asset "${path}"`);
|
|
140
|
+
const list = await container.listFiles(path);
|
|
141
|
+
const mime = list.find((e) => e.path === path)?.mimeType ?? 'application/octet-stream';
|
|
142
|
+
const url = URL.createObjectURL(new Blob([data], { type: mime }));
|
|
143
|
+
cache.set(path, url);
|
|
144
|
+
return url;
|
|
145
|
+
}, [container]);
|
|
146
|
+
// Revoke all cached object URLs on unmount / container swap
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
const cache = urlCacheRef.current;
|
|
149
|
+
return () => {
|
|
150
|
+
for (const url of cache.values())
|
|
151
|
+
URL.revokeObjectURL(url);
|
|
152
|
+
cache.clear();
|
|
153
|
+
};
|
|
154
|
+
}, [container]);
|
|
155
|
+
const uploadAsset = useCallback(async (file, suggestedName) => {
|
|
156
|
+
const ext = guessExtensionFromMime(file.type) ?? extensionFromName(suggestedName) ?? 'bin';
|
|
157
|
+
const id = randomId();
|
|
158
|
+
const path = `${IMAGE_EDIT_ASSETS_PREFIX}${id}.${ext}`;
|
|
159
|
+
const buf = await file.arrayBuffer();
|
|
160
|
+
await container.writeFile(path, buf, file.type || undefined);
|
|
161
|
+
return path;
|
|
162
|
+
}, [container]);
|
|
163
|
+
return {
|
|
164
|
+
state,
|
|
165
|
+
dispatch,
|
|
166
|
+
flush,
|
|
167
|
+
resolveAssetUrl,
|
|
168
|
+
uploadAsset,
|
|
169
|
+
versioning,
|
|
170
|
+
ready,
|
|
171
|
+
error,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
// ============================================
|
|
175
|
+
// Helpers
|
|
176
|
+
// ============================================
|
|
177
|
+
async function seedFromSource(container, initialSrc) {
|
|
178
|
+
if (!initialSrc) {
|
|
179
|
+
return createEmptyImageEditDoc(800, 600);
|
|
180
|
+
}
|
|
181
|
+
// Fetch the source bytes (works for blob:, data:, http(s):, and same-origin
|
|
182
|
+
// relative URLs).
|
|
183
|
+
const resp = await fetch(initialSrc);
|
|
184
|
+
if (!resp.ok)
|
|
185
|
+
throw new Error(`useImageEditor: failed to fetch initialSrc (${resp.status})`);
|
|
186
|
+
const blob = await resp.blob();
|
|
187
|
+
const ext = guessExtensionFromMime(blob.type) ?? 'png';
|
|
188
|
+
const assetPath = `${IMAGE_EDIT_ASSETS_PREFIX}source.${ext}`;
|
|
189
|
+
await container.writeFile(assetPath, await blob.arrayBuffer(), blob.type || undefined);
|
|
190
|
+
// Probe natural dimensions by loading into an Image.
|
|
191
|
+
const dims = await probeImageDimensions(initialSrc);
|
|
192
|
+
const w = dims?.width ?? 800;
|
|
193
|
+
const h = dims?.height ?? 600;
|
|
194
|
+
const layer = {
|
|
195
|
+
id: 'base',
|
|
196
|
+
type: 'image',
|
|
197
|
+
name: 'Background',
|
|
198
|
+
position: { x: 0, y: 0, width: w, height: h },
|
|
199
|
+
content: { src: assetPath, alt: '', fit: 'fill' },
|
|
200
|
+
};
|
|
201
|
+
return {
|
|
202
|
+
version: 1,
|
|
203
|
+
canvas: { width: w, height: h, background: 'transparent' },
|
|
204
|
+
layers: [layer],
|
|
205
|
+
meta: {
|
|
206
|
+
sourcePath: assetPath,
|
|
207
|
+
createdAt: new Date().toISOString(),
|
|
208
|
+
updatedAt: new Date().toISOString(),
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function probeImageDimensions(src) {
|
|
213
|
+
return new Promise((resolve) => {
|
|
214
|
+
const img = new Image();
|
|
215
|
+
img.onload = () => resolve({ width: img.naturalWidth, height: img.naturalHeight });
|
|
216
|
+
img.onerror = () => resolve(null);
|
|
217
|
+
img.src = src;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function guessExtensionFromMime(mime) {
|
|
221
|
+
if (!mime)
|
|
222
|
+
return null;
|
|
223
|
+
if (mime.includes('png'))
|
|
224
|
+
return 'png';
|
|
225
|
+
if (mime.includes('jpeg') || mime.includes('jpg'))
|
|
226
|
+
return 'jpg';
|
|
227
|
+
if (mime.includes('webp'))
|
|
228
|
+
return 'webp';
|
|
229
|
+
if (mime.includes('gif'))
|
|
230
|
+
return 'gif';
|
|
231
|
+
if (mime.includes('svg'))
|
|
232
|
+
return 'svg';
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
function extensionFromName(name) {
|
|
236
|
+
if (!name)
|
|
237
|
+
return null;
|
|
238
|
+
const dot = name.lastIndexOf('.');
|
|
239
|
+
return dot >= 0 ? name.slice(dot + 1).toLowerCase() : null;
|
|
240
|
+
}
|
|
241
|
+
function randomId() {
|
|
242
|
+
return Math.random().toString(36).slice(2, 10);
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=useImageEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImageEditor.js","sourceRoot":"","sources":["../../src/imageEditor/useImageEditor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtF,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,6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AI,CAAC;AACd,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAwB;IACjD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC;AAED,SAAS,QAAQ;IACf,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derive `--squisq-image-editor-*` CSS custom properties from a Theme +
|
|
3
|
+
* SurfaceScheme, mirroring `useJsonViewTokens` in squisq-react. Lets the
|
|
4
|
+
* ImageEditor re-theme consistently with the rest of Squisq (light/dark
|
|
5
|
+
* surface, theme palette, font family overrides).
|
|
6
|
+
*/
|
|
7
|
+
import { type CSSProperties } from 'react';
|
|
8
|
+
import { type SurfaceScheme, type Theme } from '@bendyline/squisq/schemas';
|
|
9
|
+
export interface ImageEditorTokens {
|
|
10
|
+
/** Inline style object to spread onto the root `.squisq-image-editor`. */
|
|
11
|
+
style: CSSProperties;
|
|
12
|
+
/** The effective theme (after surface application). */
|
|
13
|
+
theme: Theme;
|
|
14
|
+
}
|
|
15
|
+
export declare function useImageEditorTokens(theme: Theme | undefined, surface: SurfaceScheme | 'auto' | undefined): ImageEditorTokens;
|
|
16
|
+
//# sourceMappingURL=useImageEditorTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImageEditorTokens.d.ts","sourceRoot":"","sources":["../../src/imageEditor/useImageEditorTokens.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,KAAK,EACX,MAAM,2BAA2B,CAAC;AAInC,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,KAAK,EAAE,aAAa,CAAC;IACrB,uDAAuD;IACvD,KAAK,EAAE,KAAK,CAAC;CACd;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,GAAG,SAAS,EACxB,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,GAC1C,iBAAiB,CA0CnB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derive `--squisq-image-editor-*` CSS custom properties from a Theme +
|
|
3
|
+
* SurfaceScheme, mirroring `useJsonViewTokens` in squisq-react. Lets the
|
|
4
|
+
* ImageEditor re-theme consistently with the rest of Squisq (light/dark
|
|
5
|
+
* surface, theme palette, font family overrides).
|
|
6
|
+
*/
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
import { applySurface, resolveFontFamily, } from '@bendyline/squisq/schemas';
|
|
9
|
+
import { DEFAULT_THEME } from '@bendyline/squisq/doc';
|
|
10
|
+
import { useAutoSurface } from '@bendyline/squisq-react';
|
|
11
|
+
export function useImageEditorTokens(theme, surface) {
|
|
12
|
+
const auto = useAutoSurface(surface === 'auto');
|
|
13
|
+
const effectiveSurface = surface === 'auto' ? auto : (surface ?? undefined);
|
|
14
|
+
return useMemo(() => {
|
|
15
|
+
const baseTheme = theme ?? DEFAULT_THEME;
|
|
16
|
+
const finalTheme = effectiveSurface ? applySurface(baseTheme, effectiveSurface) : baseTheme;
|
|
17
|
+
const bg = finalTheme.colors.background;
|
|
18
|
+
const text = finalTheme.colors.text;
|
|
19
|
+
const muted = finalTheme.colors.textMuted;
|
|
20
|
+
const accent = finalTheme.colors.primary;
|
|
21
|
+
// Panel / control surfaces are derived by mixing toward the opposite
|
|
22
|
+
// pole (text color), so the same recipe works for both light and dark
|
|
23
|
+
// surfaces without conditional branches.
|
|
24
|
+
const panelBg = `color-mix(in srgb, ${bg} 92%, ${text} 8%)`;
|
|
25
|
+
const panelBorder = `color-mix(in srgb, ${bg} 80%, ${text} 20%)`;
|
|
26
|
+
const controlBg = `color-mix(in srgb, ${bg} 86%, ${text} 14%)`;
|
|
27
|
+
const controlBorder = `color-mix(in srgb, ${bg} 72%, ${text} 28%)`;
|
|
28
|
+
const workspaceBg = `color-mix(in srgb, ${bg} 95%, ${text} 5%)`;
|
|
29
|
+
const bodyFont = resolveFontFamily(finalTheme.typography.bodyFont, 'system-ui, -apple-system, sans-serif');
|
|
30
|
+
const style = {
|
|
31
|
+
['--squisq-image-editor-bg']: bg,
|
|
32
|
+
['--squisq-image-editor-panel-bg']: panelBg,
|
|
33
|
+
['--squisq-image-editor-panel-border']: panelBorder,
|
|
34
|
+
['--squisq-image-editor-text']: text,
|
|
35
|
+
['--squisq-image-editor-text-muted']: muted,
|
|
36
|
+
['--squisq-image-editor-accent']: accent,
|
|
37
|
+
['--squisq-image-editor-control-bg']: controlBg,
|
|
38
|
+
['--squisq-image-editor-control-border']: controlBorder,
|
|
39
|
+
['--squisq-image-editor-workspace-bg']: workspaceBg,
|
|
40
|
+
['--squisq-image-editor-body-font']: bodyFont,
|
|
41
|
+
};
|
|
42
|
+
return { style, theme: finalTheme };
|
|
43
|
+
}, [theme, effectiveSurface]);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=useImageEditorTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImageEditorTokens.js","sourceRoot":"","sources":["../../src/imageEditor/useImageEditorTokens.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAsB,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,iBAAiB,GAGlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,u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GAAkB;YAC3B,CAAC,0BAAoC,CAAC,EAAE,EAAE;YAC1C,CAAC,gCAA0C,CAAC,EAAE,OAAO;YACrD,CAAC,oCAA8C,CAAC,EAAE,WAAW;YAC7D,CAAC,4BAAsC,CAAC,EAAE,IAAI;YAC9C,CAAC,kCAA4C,CAAC,EAAE,KAAK;YACrD,CAAC,8BAAwC,CAAC,EAAE,MAAM;YAClD,CAAC,kCAA4C,CAAC,EAAE,SAAS;YACzD,CAAC,sCAAgD,CAAC,EAAE,aAAa;YACjE,CAAC,oCAA8C,CAAC,EAAE,WAAW;YAC7D,CAAC,iCAA2C,CAAC,EAAE,QAAQ;SACxD,CAAC;QAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IACtC,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,21 +19,42 @@
|
|
|
19
19
|
export { EditorShell } from './EditorShell.js';
|
|
20
20
|
export type { EditorShellProps, EditorTheme } from './EditorShell.js';
|
|
21
21
|
export { EditorProvider, useEditorContext } from './EditorContext.js';
|
|
22
|
-
export type { EditorView, EditorMode, EditorState, EditorActions, EditorContextValue, EditorProviderProps, ImageDisplayMode, MentionCandidate, MentionProvider, } from './EditorContext.js';
|
|
22
|
+
export type { EditorView, EditorMode, EditorState, EditorActions, EditorContextValue, EditorProviderProps, ImageDisplayMode, MentionCandidate, MentionProvider, DocumentLinkCandidate, DocumentLinkProvider, ViewPreferences, ThemeInheritance, } from './EditorContext.js';
|
|
23
23
|
export { resolveFileKind, detectLanguageFromFileName } from './fileKind.js';
|
|
24
24
|
export type { FileKind } from './fileKind.js';
|
|
25
|
+
export { ImageViewer } from './ImageViewer.js';
|
|
26
|
+
export type { ImageViewerProps } from './ImageViewer.js';
|
|
25
27
|
export { RawEditor } from './RawEditor.js';
|
|
26
28
|
export type { RawEditorProps } from './RawEditor.js';
|
|
27
29
|
export { WysiwygEditor } from './WysiwygEditor.js';
|
|
28
30
|
export type { WysiwygEditorProps } from './WysiwygEditor.js';
|
|
29
31
|
export { PreviewPanel } from './PreviewPanel.js';
|
|
30
32
|
export type { PreviewPanelProps } from './PreviewPanel.js';
|
|
33
|
+
export { PlainHtmlPreview } from './PlainHtmlPreview.js';
|
|
34
|
+
export type { PlainHtmlPreviewProps } from './PlainHtmlPreview.js';
|
|
35
|
+
export { EmojiPicker } from './EmojiPicker.js';
|
|
36
|
+
export type { EmojiPickerProps } from './EmojiPicker.js';
|
|
37
|
+
export { DocumentSettingsDialog } from './DocumentSettingsDialog.js';
|
|
38
|
+
export type { DocumentSettingsDialogProps } from './DocumentSettingsDialog.js';
|
|
39
|
+
export { ThemePicker } from './ThemePicker.js';
|
|
40
|
+
export type { ThemePickerProps } from './ThemePicker.js';
|
|
41
|
+
export { EMOJI_CATEGORIES, ALL_EMOJIS, searchEmojis } from './emojiData.js';
|
|
42
|
+
export type { EmojiEntry, EmojiCategory } from './emojiData.js';
|
|
31
43
|
export { PreviewSettingsProvider, PreviewToolbarControls, usePreviewSettings, } from './PreviewControls.js';
|
|
32
44
|
export type { PreviewSettings } from './PreviewControls.js';
|
|
33
45
|
export { ViewSwitcher } from './ViewSwitcher.js';
|
|
34
46
|
export type { ViewSwitcherProps } from './ViewSwitcher.js';
|
|
35
47
|
export { Toolbar } from './Toolbar.js';
|
|
36
48
|
export type { ToolbarProps } from './Toolbar.js';
|
|
49
|
+
export { VersionHistoryPanel } from './VersionHistoryPanel.js';
|
|
50
|
+
export { ViewMenuPanel } from './ViewMenuPanel.js';
|
|
51
|
+
export { OutlinePanel } from './OutlinePanel.js';
|
|
52
|
+
export type { OutlinePanelProps } from './OutlinePanel.js';
|
|
53
|
+
export { ThemeCustomizerPanel } from './ThemeCustomizerPanel.js';
|
|
54
|
+
export type { ThemeCustomizerPanelProps } from './ThemeCustomizerPanel.js';
|
|
55
|
+
export { TemplatePicker, templateLabel } from './TemplatePicker.js';
|
|
56
|
+
export { InlinePreviewGutter } from './InlinePreviewGutter.js';
|
|
57
|
+
export type { InlinePreviewGutterProps } from './InlinePreviewGutter.js';
|
|
37
58
|
export { MediaBin } from './MediaBin.js';
|
|
38
59
|
export type { MediaBinProps } from './MediaBin.js';
|
|
39
60
|
export { StatusBar } from './StatusBar.js';
|
|
@@ -47,4 +68,30 @@ export { partitionFiles, processMediaFiles, processTextFile, processTextFiles, }
|
|
|
47
68
|
export { markdownToTiptap, tiptapToMarkdown } from './tiptapBridge.js';
|
|
48
69
|
export { buildPreviewDoc } from './buildPreviewDoc.js';
|
|
49
70
|
export { HeadingWithTemplate } from './TemplateAnnotation.js';
|
|
71
|
+
export { JsonEditor } from './jsonEditor/index.js';
|
|
72
|
+
export type { JsonEditorProps } from './jsonEditor/index.js';
|
|
73
|
+
export { RecorderModal } from './recorder/RecorderModal.js';
|
|
74
|
+
export type { RecorderModalProps, RecorderSaveResult } from './recorder/RecorderModal.js';
|
|
75
|
+
export { RecorderButton } from './recorder/RecorderButton.js';
|
|
76
|
+
export type { RecorderButtonProps } from './recorder/RecorderButton.js';
|
|
77
|
+
export { RecorderPanel } from './recorder/RecorderPanel.js';
|
|
78
|
+
export type { RecorderPanelProps } from './recorder/RecorderPanel.js';
|
|
79
|
+
export { useMediaRecorder, getCaptureKind } from './recorder/hooks/useMediaRecorder.js';
|
|
80
|
+
export type { UseMediaRecorderOptions, UseMediaRecorderResult, RecorderSource, RecorderState, } from './recorder/hooks/useMediaRecorder.js';
|
|
81
|
+
export { useStreamPreview } from './recorder/hooks/useStreamPreview.js';
|
|
82
|
+
export { requestMicStream } from './recorder/sources/micStream.js';
|
|
83
|
+
export { requestCameraStream } from './recorder/sources/cameraStream.js';
|
|
84
|
+
export type { CameraStreamOptions } from './recorder/sources/cameraStream.js';
|
|
85
|
+
export { requestScreenStream } from './recorder/sources/screenStream.js';
|
|
86
|
+
export type { ScreenStreamOptions, ScreenStreamHandle } from './recorder/sources/screenStream.js';
|
|
87
|
+
export { resolveFormat, supportsMediaRecorder, supportsUserMedia, supportsDisplayMedia, buildFilename, } from './recorder/formats.js';
|
|
88
|
+
export type { CaptureKind, ResolvedFormat } from './recorder/formats.js';
|
|
89
|
+
export { buildTimingJson, encodeTimingJson, timingPathFor } from './recorder/timingJson.js';
|
|
90
|
+
export type { TimingJson, RecordedBookmark } from './recorder/timingJson.js';
|
|
91
|
+
export { ImageEditor } from './ImageEditor.js';
|
|
92
|
+
export type { ImageEditorProps } from './ImageEditor.js';
|
|
93
|
+
export { useImageEditor } from './imageEditor/useImageEditor.js';
|
|
94
|
+
export type { UseImageEditorOptions, UseImageEditorReturn } from './imageEditor/useImageEditor.js';
|
|
95
|
+
export { imageEditorReducer, initialImageEditorState } from './imageEditor/state.js';
|
|
96
|
+
export type { ImageEditorState, ImageEditorAction, ImageEditorTool, CanvasRect, } from './imageEditor/state.js';
|
|
50
97
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtE,YAAY,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,WAA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,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAClG,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC5F,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI7E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACrF,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,GACX,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23,14 +23,28 @@ export { EditorProvider, useEditorContext } from './EditorContext.js';
|
|
|
23
23
|
// File-kind detection — useful for hosts that want to pre-decide chrome
|
|
24
24
|
// around the editor based on whether a file is markdown or code.
|
|
25
25
|
export { resolveFileKind, detectLanguageFromFileName } from './fileKind.js';
|
|
26
|
+
// Image viewer — exported standalone so hosts can use it without the
|
|
27
|
+
// full EditorShell when they already have their own chrome.
|
|
28
|
+
export { ImageViewer } from './ImageViewer.js';
|
|
26
29
|
// Individual editors (for custom layouts)
|
|
27
30
|
export { RawEditor } from './RawEditor.js';
|
|
28
31
|
export { WysiwygEditor } from './WysiwygEditor.js';
|
|
29
32
|
export { PreviewPanel } from './PreviewPanel.js';
|
|
33
|
+
export { PlainHtmlPreview } from './PlainHtmlPreview.js';
|
|
34
|
+
export { EmojiPicker } from './EmojiPicker.js';
|
|
35
|
+
export { DocumentSettingsDialog } from './DocumentSettingsDialog.js';
|
|
36
|
+
export { ThemePicker } from './ThemePicker.js';
|
|
37
|
+
export { EMOJI_CATEGORIES, ALL_EMOJIS, searchEmojis } from './emojiData.js';
|
|
30
38
|
export { PreviewSettingsProvider, PreviewToolbarControls, usePreviewSettings, } from './PreviewControls.js';
|
|
31
39
|
// Chrome (for custom layouts)
|
|
32
40
|
export { ViewSwitcher } from './ViewSwitcher.js';
|
|
33
41
|
export { Toolbar } from './Toolbar.js';
|
|
42
|
+
export { VersionHistoryPanel } from './VersionHistoryPanel.js';
|
|
43
|
+
export { ViewMenuPanel } from './ViewMenuPanel.js';
|
|
44
|
+
export { OutlinePanel } from './OutlinePanel.js';
|
|
45
|
+
export { ThemeCustomizerPanel } from './ThemeCustomizerPanel.js';
|
|
46
|
+
export { TemplatePicker, templateLabel } from './TemplatePicker.js';
|
|
47
|
+
export { InlinePreviewGutter } from './InlinePreviewGutter.js';
|
|
34
48
|
export { MediaBin } from './MediaBin.js';
|
|
35
49
|
export { StatusBar } from './StatusBar.js';
|
|
36
50
|
export { TooltipLayer } from './Tooltip.js';
|
|
@@ -44,4 +58,26 @@ export { markdownToTiptap, tiptapToMarkdown } from './tiptapBridge.js';
|
|
|
44
58
|
export { buildPreviewDoc } from './buildPreviewDoc.js';
|
|
45
59
|
// Tiptap extension: Heading with template annotation support
|
|
46
60
|
export { HeadingWithTemplate } from './TemplateAnnotation.js';
|
|
61
|
+
// JSON Form — editable component
|
|
62
|
+
export { JsonEditor } from './jsonEditor/index.js';
|
|
63
|
+
// Recorder — browser-based audio/camera/screen capture. Components and
|
|
64
|
+
// hooks for capturing media via `MediaRecorder` and persisting the
|
|
65
|
+
// resulting blob into a `ContentContainer` through the host's
|
|
66
|
+
// `MediaProvider`. Previously published as `@bendyline/squisq-recorder-react`;
|
|
67
|
+
// folded into editor-react so it ships with the editor it's wired into.
|
|
68
|
+
export { RecorderModal } from './recorder/RecorderModal.js';
|
|
69
|
+
export { RecorderButton } from './recorder/RecorderButton.js';
|
|
70
|
+
export { RecorderPanel } from './recorder/RecorderPanel.js';
|
|
71
|
+
export { useMediaRecorder, getCaptureKind } from './recorder/hooks/useMediaRecorder.js';
|
|
72
|
+
export { useStreamPreview } from './recorder/hooks/useStreamPreview.js';
|
|
73
|
+
export { requestMicStream } from './recorder/sources/micStream.js';
|
|
74
|
+
export { requestCameraStream } from './recorder/sources/cameraStream.js';
|
|
75
|
+
export { requestScreenStream } from './recorder/sources/screenStream.js';
|
|
76
|
+
export { resolveFormat, supportsMediaRecorder, supportsUserMedia, supportsDisplayMedia, buildFilename, } from './recorder/formats.js';
|
|
77
|
+
export { buildTimingJson, encodeTimingJson, timingPathFor } from './recorder/timingJson.js';
|
|
78
|
+
// Image editor — layered, sidecar-persisted raster authoring surface.
|
|
79
|
+
// Pairs with `ImageViewer` and the `<basename>_files/` sidecar convention.
|
|
80
|
+
export { ImageEditor } from './ImageEditor.js';
|
|
81
|
+
export { useImageEditor } from './imageEditor/useImageEditor.js';
|
|
82
|
+
export { imageEditorReducer, initialImageEditorState } from './imageEditor/state.js';
|
|
47
83
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,UAAU;AACV,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBA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AiC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG5F,sEAAsE;AACtE,2EAA2E;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone Tiptap-backed rich text field for use inside `<JsonEditor>`.
|
|
3
|
+
* Doesn't share `EditorContext` with the document editor — value is a
|
|
4
|
+
* controlled markdown string. Reuses `markdownToTiptap` /
|
|
5
|
+
* `tiptapToMarkdown` so fidelity matches the WysiwygEditor.
|
|
6
|
+
*/
|
|
7
|
+
export interface EmbeddedRichTextFieldProps {
|
|
8
|
+
value: string;
|
|
9
|
+
onChange: (next: string) => void;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function EmbeddedRichTextField(props: EmbeddedRichTextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=EmbeddedRichTextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbeddedRichTextField.d.ts","sourceRoot":"","sources":["../../src/jsonEditor/EmbeddedRichTextField.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAqDtE"}
|