@bendyline/squisq-editor-react 1.4.0 → 1.5.1
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 +173 -4
- package/dist/EditorShell.d.ts.map +1 -1
- package/dist/EditorShell.js +110 -10
- 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/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__/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 +13 -0
- package/dist/__tests__/tiptapBridge.test.js.map +1 -1
- 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 +171 -14
- 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 +571 -55
- 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/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__/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 +15 -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 +188 -20
- 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,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DocumentSettingsDialog
|
|
3
|
+
*
|
|
4
|
+
* Modal editor for the frontmatter values that Squisq currently
|
|
5
|
+
* understands: document title plus the persisted preview keys
|
|
6
|
+
* (`squisq-theme`, `squisq-transform`, `squisq-captions`). Writes back
|
|
7
|
+
* to the same `setFrontmatterValues` channel that `PreviewControls`
|
|
8
|
+
* uses, so any change made here is reflected in the play-mode controls
|
|
9
|
+
* (and vice versa).
|
|
10
|
+
*
|
|
11
|
+
* Title behavior: the placeholder shows the title that
|
|
12
|
+
* `inferDocumentTitle()` would derive from frontmatter or headings.
|
|
13
|
+
* When the user-entered title is empty or equal to the inferred title,
|
|
14
|
+
* the `title:` key is removed from frontmatter — there's no point
|
|
15
|
+
* storing a redundant value.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
+
import {
|
|
20
|
+
inferDocumentTitle,
|
|
21
|
+
parseMarkdown,
|
|
22
|
+
setFrontmatterValues,
|
|
23
|
+
} from '@bendyline/squisq/markdown';
|
|
24
|
+
import { getTransformStyleSummaries } from '@bendyline/squisq/transform';
|
|
25
|
+
import { ThemePicker } from './ThemePicker';
|
|
26
|
+
|
|
27
|
+
// ── Frontmatter key constants ─────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
/** Mirror of `FM_KEYS` in PreviewControls.tsx. Canonical names are the
|
|
30
|
+
* ones we write; legacy aliases are still read so older docs work. */
|
|
31
|
+
const FM = {
|
|
32
|
+
theme: { canonical: 'squisq-theme', legacy: 'theme' },
|
|
33
|
+
transform: { canonical: 'squisq-transform', legacy: 'transform-style' },
|
|
34
|
+
captions: { canonical: 'squisq-captions', legacy: 'caption-style' },
|
|
35
|
+
} as const;
|
|
36
|
+
|
|
37
|
+
function readFm(
|
|
38
|
+
fm: Record<string, unknown> | undefined,
|
|
39
|
+
canonical: string,
|
|
40
|
+
legacy: string,
|
|
41
|
+
): string {
|
|
42
|
+
if (!fm) return '';
|
|
43
|
+
const v = Object.prototype.hasOwnProperty.call(fm, canonical) ? fm[canonical] : fm[legacy];
|
|
44
|
+
return typeof v === 'string' ? v : '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const CAPTION_OPTIONS: readonly { key: string; label: string }[] = [
|
|
48
|
+
{ key: '', label: 'Default (Standard)' },
|
|
49
|
+
{ key: 'standard', label: 'Standard' },
|
|
50
|
+
{ key: 'social', label: 'Social' },
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
// ── Props ─────────────────────────────────────────────────────────
|
|
54
|
+
|
|
55
|
+
export interface DocumentSettingsDialogProps {
|
|
56
|
+
/** Current markdown source string (frontmatter + body). */
|
|
57
|
+
markdownSource: string;
|
|
58
|
+
/** Called with the rewritten source after the user clicks Save. */
|
|
59
|
+
onSave: (nextSource: string) => void;
|
|
60
|
+
/** Called when the dialog is dismissed (Cancel, Escape, backdrop click). */
|
|
61
|
+
onClose: () => void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ── Component ─────────────────────────────────────────────────────
|
|
65
|
+
|
|
66
|
+
export function DocumentSettingsDialog({
|
|
67
|
+
markdownSource,
|
|
68
|
+
onSave,
|
|
69
|
+
onClose,
|
|
70
|
+
}: DocumentSettingsDialogProps) {
|
|
71
|
+
// Parse once at open; further edits flow through local form state and
|
|
72
|
+
// are committed in a single `setFrontmatterValues` call on Save.
|
|
73
|
+
const parsed = useMemo(() => parseMarkdown(markdownSource), [markdownSource]);
|
|
74
|
+
const frontmatter = parsed.frontmatter;
|
|
75
|
+
const inferredTitle = useMemo(() => inferDocumentTitle(parsed), [parsed]);
|
|
76
|
+
|
|
77
|
+
const currentTitle = typeof frontmatter?.title === 'string' ? (frontmatter.title as string) : '';
|
|
78
|
+
const currentTheme = readFm(frontmatter, FM.theme.canonical, FM.theme.legacy);
|
|
79
|
+
const currentTransform = readFm(frontmatter, FM.transform.canonical, FM.transform.legacy);
|
|
80
|
+
const currentCaptions = readFm(frontmatter, FM.captions.canonical, FM.captions.legacy);
|
|
81
|
+
|
|
82
|
+
const [title, setTitle] = useState(currentTitle);
|
|
83
|
+
const [theme, setTheme] = useState(currentTheme);
|
|
84
|
+
const [transform, setTransform] = useState(currentTransform);
|
|
85
|
+
const [captions, setCaptions] = useState(currentCaptions);
|
|
86
|
+
|
|
87
|
+
const titleRef = useRef<HTMLInputElement>(null);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
titleRef.current?.focus();
|
|
90
|
+
titleRef.current?.select();
|
|
91
|
+
}, []);
|
|
92
|
+
|
|
93
|
+
// Esc closes; click on backdrop closes (but not on dialog itself).
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
const onKey = (e: KeyboardEvent) => {
|
|
96
|
+
if (e.key === 'Escape') onClose();
|
|
97
|
+
};
|
|
98
|
+
document.addEventListener('keydown', onKey);
|
|
99
|
+
return () => document.removeEventListener('keydown', onKey);
|
|
100
|
+
}, [onClose]);
|
|
101
|
+
|
|
102
|
+
const handleBackdrop = useCallback(
|
|
103
|
+
(e: React.MouseEvent<HTMLDivElement>) => {
|
|
104
|
+
if (e.target === e.currentTarget) onClose();
|
|
105
|
+
},
|
|
106
|
+
[onClose],
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
// Dropdown options — built once per render; cheap.
|
|
110
|
+
const transformOptions = useMemo(
|
|
111
|
+
() => [
|
|
112
|
+
{ key: '', label: 'None' },
|
|
113
|
+
...getTransformStyleSummaries().map((s) => ({ key: s.id, label: s.name })),
|
|
114
|
+
],
|
|
115
|
+
[],
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
const handleSave = useCallback(
|
|
119
|
+
(e: React.FormEvent) => {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
|
|
122
|
+
const trimmedTitle = title.trim();
|
|
123
|
+
const titleMatchesInferred = !!inferredTitle && trimmedTitle === inferredTitle;
|
|
124
|
+
// Empty input OR matches the value we'd infer otherwise → no
|
|
125
|
+
// explicit title needed in frontmatter.
|
|
126
|
+
const nextTitle = !trimmedTitle || titleMatchesInferred ? null : trimmedTitle;
|
|
127
|
+
|
|
128
|
+
const updates: Record<string, string | null> = {
|
|
129
|
+
title: nextTitle,
|
|
130
|
+
[FM.theme.canonical]: theme || null,
|
|
131
|
+
// Legacy `theme` key would shadow our canonical one — clear it
|
|
132
|
+
// when the user changes the theme so the canonical write wins.
|
|
133
|
+
...(currentTheme && theme !== currentTheme ? { [FM.theme.legacy]: null } : {}),
|
|
134
|
+
[FM.transform.canonical]: transform || null,
|
|
135
|
+
...(currentTransform && transform !== currentTransform
|
|
136
|
+
? { [FM.transform.legacy]: null }
|
|
137
|
+
: {}),
|
|
138
|
+
[FM.captions.canonical]: captions || null,
|
|
139
|
+
...(currentCaptions && captions !== currentCaptions ? { [FM.captions.legacy]: null } : {}),
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const nextSource = setFrontmatterValues(markdownSource, updates);
|
|
143
|
+
onSave(nextSource);
|
|
144
|
+
},
|
|
145
|
+
[
|
|
146
|
+
title,
|
|
147
|
+
theme,
|
|
148
|
+
transform,
|
|
149
|
+
captions,
|
|
150
|
+
inferredTitle,
|
|
151
|
+
markdownSource,
|
|
152
|
+
currentTheme,
|
|
153
|
+
currentTransform,
|
|
154
|
+
currentCaptions,
|
|
155
|
+
onSave,
|
|
156
|
+
],
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<div className="squisq-doc-settings-overlay" onMouseDown={handleBackdrop}>
|
|
161
|
+
<form className="squisq-doc-settings-dialog" onSubmit={handleSave}>
|
|
162
|
+
<div className="squisq-doc-settings-header">
|
|
163
|
+
<h2 className="squisq-doc-settings-title">Document settings</h2>
|
|
164
|
+
<button
|
|
165
|
+
type="button"
|
|
166
|
+
className="squisq-doc-settings-close"
|
|
167
|
+
onClick={onClose}
|
|
168
|
+
aria-label="Close"
|
|
169
|
+
>
|
|
170
|
+
×
|
|
171
|
+
</button>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div className="squisq-doc-settings-body">
|
|
175
|
+
<div className="squisq-doc-settings-field">
|
|
176
|
+
<label className="squisq-doc-settings-label" htmlFor="squisq-doc-settings-title">
|
|
177
|
+
Title
|
|
178
|
+
</label>
|
|
179
|
+
<input
|
|
180
|
+
ref={titleRef}
|
|
181
|
+
id="squisq-doc-settings-title"
|
|
182
|
+
type="text"
|
|
183
|
+
className="squisq-doc-settings-input"
|
|
184
|
+
value={title}
|
|
185
|
+
onChange={(e) => setTitle(e.target.value)}
|
|
186
|
+
placeholder={inferredTitle ?? 'Document title'}
|
|
187
|
+
spellCheck
|
|
188
|
+
/>
|
|
189
|
+
{inferredTitle ? (
|
|
190
|
+
<span className="squisq-doc-settings-hint">
|
|
191
|
+
Defaults to <strong>{inferredTitle}</strong> — leave blank to use it.
|
|
192
|
+
</span>
|
|
193
|
+
) : (
|
|
194
|
+
<span className="squisq-doc-settings-hint">
|
|
195
|
+
No title heading found — set one here or add an H1 to the document.
|
|
196
|
+
</span>
|
|
197
|
+
)}
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<div className="squisq-doc-settings-field">
|
|
201
|
+
<span className="squisq-doc-settings-label">Theme</span>
|
|
202
|
+
<ThemePicker
|
|
203
|
+
value={theme}
|
|
204
|
+
onChange={setTheme}
|
|
205
|
+
includeDefault
|
|
206
|
+
variant="full"
|
|
207
|
+
ariaLabel="Theme"
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div className="squisq-doc-settings-field">
|
|
212
|
+
<label className="squisq-doc-settings-label" htmlFor="squisq-doc-settings-transform">
|
|
213
|
+
Transform
|
|
214
|
+
</label>
|
|
215
|
+
<select
|
|
216
|
+
id="squisq-doc-settings-transform"
|
|
217
|
+
className="squisq-doc-settings-input"
|
|
218
|
+
value={transform}
|
|
219
|
+
onChange={(e) => setTransform(e.target.value)}
|
|
220
|
+
>
|
|
221
|
+
{transformOptions.map((o) => (
|
|
222
|
+
<option key={o.key} value={o.key}>
|
|
223
|
+
{o.label}
|
|
224
|
+
</option>
|
|
225
|
+
))}
|
|
226
|
+
</select>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<div className="squisq-doc-settings-field">
|
|
230
|
+
<label className="squisq-doc-settings-label" htmlFor="squisq-doc-settings-captions">
|
|
231
|
+
Captions
|
|
232
|
+
</label>
|
|
233
|
+
<select
|
|
234
|
+
id="squisq-doc-settings-captions"
|
|
235
|
+
className="squisq-doc-settings-input"
|
|
236
|
+
value={captions}
|
|
237
|
+
onChange={(e) => setCaptions(e.target.value)}
|
|
238
|
+
>
|
|
239
|
+
{CAPTION_OPTIONS.map((o) => (
|
|
240
|
+
<option key={o.key} value={o.key}>
|
|
241
|
+
{o.label}
|
|
242
|
+
</option>
|
|
243
|
+
))}
|
|
244
|
+
</select>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<div className="squisq-doc-settings-footer">
|
|
249
|
+
<button
|
|
250
|
+
type="button"
|
|
251
|
+
className="squisq-doc-settings-btn squisq-doc-settings-btn--secondary"
|
|
252
|
+
onClick={onClose}
|
|
253
|
+
>
|
|
254
|
+
Cancel
|
|
255
|
+
</button>
|
|
256
|
+
<button
|
|
257
|
+
type="submit"
|
|
258
|
+
className="squisq-doc-settings-btn squisq-doc-settings-btn--primary"
|
|
259
|
+
>
|
|
260
|
+
Save
|
|
261
|
+
</button>
|
|
262
|
+
</div>
|
|
263
|
+
</form>
|
|
264
|
+
</div>
|
|
265
|
+
);
|
|
266
|
+
}
|