@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,319 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ThemePicker
|
|
3
|
+
*
|
|
4
|
+
* Custom theme dropdown that replaces a plain `<select>` with a popover
|
|
5
|
+
* showing each theme as a card: the theme name rendered in the theme's
|
|
6
|
+
* own background / foreground / title font, plus three color swatches
|
|
7
|
+
* (primary, secondary, highlight). Used by both the play-mode preview
|
|
8
|
+
* toolbar and the Document Settings dialog so authors see a
|
|
9
|
+
* preview-on-hover style listing rather than a wall of names.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
|
+
import { createPortal } from 'react-dom';
|
|
14
|
+
import {
|
|
15
|
+
getThemeSummaries,
|
|
16
|
+
resolveTheme,
|
|
17
|
+
resolveFontFamily,
|
|
18
|
+
FONT_FALLBACKS,
|
|
19
|
+
} from '@bendyline/squisq/schemas';
|
|
20
|
+
import type { Theme } from '@bendyline/squisq/schemas';
|
|
21
|
+
|
|
22
|
+
// ── Props ─────────────────────────────────────────────────────────
|
|
23
|
+
|
|
24
|
+
export interface ThemePickerProps {
|
|
25
|
+
/** Currently selected theme id. Empty string represents "default". */
|
|
26
|
+
value: string;
|
|
27
|
+
/** Called with the new theme id. The empty string is emitted when the
|
|
28
|
+
* user picks the "Default" option (only available with
|
|
29
|
+
* `includeDefault`). */
|
|
30
|
+
onChange: (id: string) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Show a "Default" entry at the top of the popover that emits an empty
|
|
33
|
+
* string. Used by the Document Settings dialog so the user can choose
|
|
34
|
+
* "no explicit theme" (frontmatter omits the key entirely).
|
|
35
|
+
*/
|
|
36
|
+
includeDefault?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* `'compact'` (default) renders a small toolbar trigger; `'full'`
|
|
39
|
+
* stretches to fill the parent and is sized for dialog layouts.
|
|
40
|
+
*/
|
|
41
|
+
variant?: 'compact' | 'full';
|
|
42
|
+
/** Accessible label, e.g. "Theme". */
|
|
43
|
+
ariaLabel?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ── Helpers ───────────────────────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
const SUMMARIES = getThemeSummaries();
|
|
49
|
+
|
|
50
|
+
interface ThemeEntry {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
theme: Theme;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const THEME_ENTRIES: ThemeEntry[] = SUMMARIES.map((s) => ({
|
|
58
|
+
id: s.id,
|
|
59
|
+
name: s.name,
|
|
60
|
+
description: s.description,
|
|
61
|
+
theme: resolveTheme(s.id),
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
function entryById(id: string): ThemeEntry | undefined {
|
|
65
|
+
return THEME_ENTRIES.find((e) => e.id === id);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function previewFont(theme: Theme): string {
|
|
69
|
+
return resolveFontFamily(theme.typography.titleFont, FONT_FALLBACKS.sans);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ── Trigger button ────────────────────────────────────────────────
|
|
73
|
+
|
|
74
|
+
function ThemeNameChip({
|
|
75
|
+
theme,
|
|
76
|
+
label,
|
|
77
|
+
className,
|
|
78
|
+
}: {
|
|
79
|
+
theme: Theme;
|
|
80
|
+
label: string;
|
|
81
|
+
className?: string;
|
|
82
|
+
}) {
|
|
83
|
+
return (
|
|
84
|
+
<span
|
|
85
|
+
className={`squisq-theme-picker-name-chip${className ? ` ${className}` : ''}`}
|
|
86
|
+
style={{
|
|
87
|
+
background: theme.colors.background,
|
|
88
|
+
color: theme.colors.text,
|
|
89
|
+
fontFamily: previewFont(theme),
|
|
90
|
+
borderColor: theme.colors.backgroundLight,
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
{label}
|
|
94
|
+
</span>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function Swatches({ theme }: { theme: Theme }) {
|
|
99
|
+
return (
|
|
100
|
+
<span className="squisq-theme-picker-swatches" aria-hidden="true">
|
|
101
|
+
<span className="squisq-theme-picker-swatch" style={{ background: theme.colors.primary }} />
|
|
102
|
+
<span className="squisq-theme-picker-swatch" style={{ background: theme.colors.secondary }} />
|
|
103
|
+
<span className="squisq-theme-picker-swatch" style={{ background: theme.colors.highlight }} />
|
|
104
|
+
</span>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ── Component ─────────────────────────────────────────────────────
|
|
109
|
+
|
|
110
|
+
export function ThemePicker({
|
|
111
|
+
value,
|
|
112
|
+
onChange,
|
|
113
|
+
includeDefault,
|
|
114
|
+
variant = 'compact',
|
|
115
|
+
ariaLabel = 'Theme',
|
|
116
|
+
}: ThemePickerProps) {
|
|
117
|
+
const [open, setOpen] = useState(false);
|
|
118
|
+
const [popoverStyle, setPopoverStyle] = useState<React.CSSProperties>({});
|
|
119
|
+
const triggerRef = useRef<HTMLButtonElement>(null);
|
|
120
|
+
|
|
121
|
+
const selectedEntry = useMemo<ThemeEntry | null>(() => {
|
|
122
|
+
if (!value) return null;
|
|
123
|
+
return entryById(value) ?? null;
|
|
124
|
+
}, [value]);
|
|
125
|
+
|
|
126
|
+
// The trigger always wants *something* to preview. When `includeDefault`
|
|
127
|
+
// is on and the value is empty, we treat the selection as the implicit
|
|
128
|
+
// "Default" — the chip uses plain OS styling (white bg, dark text,
|
|
129
|
+
// italic) rather than the standard theme's actual dark-navy palette.
|
|
130
|
+
const isDefault = !selectedEntry && includeDefault === true;
|
|
131
|
+
const previewEntry = selectedEntry ?? entryById('standard') ?? THEME_ENTRIES[0];
|
|
132
|
+
const triggerLabel = selectedEntry
|
|
133
|
+
? selectedEntry.name
|
|
134
|
+
: includeDefault
|
|
135
|
+
? 'Default'
|
|
136
|
+
: (previewEntry?.name ?? 'Theme');
|
|
137
|
+
|
|
138
|
+
const updatePosition = useCallback(() => {
|
|
139
|
+
if (!triggerRef.current) return;
|
|
140
|
+
const rect = triggerRef.current.getBoundingClientRect();
|
|
141
|
+
const margin = 8;
|
|
142
|
+
const gap = 4;
|
|
143
|
+
const vw = window.innerWidth;
|
|
144
|
+
const vh = window.innerHeight;
|
|
145
|
+
const popoverWidth = Math.max(280, rect.width);
|
|
146
|
+
const maxLeft = Math.max(margin, vw - popoverWidth - margin);
|
|
147
|
+
const left = Math.min(Math.max(margin, rect.left), maxLeft);
|
|
148
|
+
|
|
149
|
+
// Measure the rendered popover so we know whether it fits below the
|
|
150
|
+
// trigger as-is. On the first open it doesn't exist yet — we'll
|
|
151
|
+
// re-run after mount via the requestAnimationFrame in the open
|
|
152
|
+
// effect, so estimate generously for paint #1.
|
|
153
|
+
const popoverEl = document.getElementById('squisq-theme-picker-popover');
|
|
154
|
+
const measured = popoverEl?.scrollHeight ?? 520;
|
|
155
|
+
const spaceBelow = vh - rect.bottom - margin - gap;
|
|
156
|
+
const spaceAbove = rect.top - margin - gap;
|
|
157
|
+
|
|
158
|
+
// Prefer below when it fits; flip above when below is too tight AND
|
|
159
|
+
// above has more room. Either way, clamp maxHeight to the available
|
|
160
|
+
// space so the internal scroll handles oversized lists.
|
|
161
|
+
let top: number;
|
|
162
|
+
let maxHeight: number;
|
|
163
|
+
if (measured <= spaceBelow || spaceBelow >= spaceAbove) {
|
|
164
|
+
top = rect.bottom + gap;
|
|
165
|
+
maxHeight = spaceBelow;
|
|
166
|
+
} else {
|
|
167
|
+
maxHeight = Math.min(measured, spaceAbove);
|
|
168
|
+
top = rect.top - gap - maxHeight;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
setPopoverStyle({
|
|
172
|
+
position: 'fixed',
|
|
173
|
+
top,
|
|
174
|
+
left,
|
|
175
|
+
width: popoverWidth,
|
|
176
|
+
maxHeight,
|
|
177
|
+
overflowY: 'auto',
|
|
178
|
+
zIndex: 9999,
|
|
179
|
+
});
|
|
180
|
+
}, []);
|
|
181
|
+
|
|
182
|
+
const handleToggle = () => {
|
|
183
|
+
if (!open) updatePosition();
|
|
184
|
+
setOpen((v) => !v);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// Close on outside click / Esc; reposition on scroll/resize while open.
|
|
188
|
+
useEffect(() => {
|
|
189
|
+
if (!open) return;
|
|
190
|
+
const onDown = (e: MouseEvent) => {
|
|
191
|
+
const target = e.target as Node;
|
|
192
|
+
if (triggerRef.current?.contains(target)) return;
|
|
193
|
+
const popoverEl = document.getElementById('squisq-theme-picker-popover');
|
|
194
|
+
if (popoverEl?.contains(target)) return;
|
|
195
|
+
setOpen(false);
|
|
196
|
+
};
|
|
197
|
+
const onKey = (e: KeyboardEvent) => {
|
|
198
|
+
if (e.key === 'Escape') setOpen(false);
|
|
199
|
+
};
|
|
200
|
+
const onReposition = () => updatePosition();
|
|
201
|
+
document.addEventListener('mousedown', onDown);
|
|
202
|
+
document.addEventListener('keydown', onKey);
|
|
203
|
+
window.addEventListener('scroll', onReposition, true);
|
|
204
|
+
window.addEventListener('resize', onReposition);
|
|
205
|
+
requestAnimationFrame(updatePosition);
|
|
206
|
+
return () => {
|
|
207
|
+
document.removeEventListener('mousedown', onDown);
|
|
208
|
+
document.removeEventListener('keydown', onKey);
|
|
209
|
+
window.removeEventListener('scroll', onReposition, true);
|
|
210
|
+
window.removeEventListener('resize', onReposition);
|
|
211
|
+
};
|
|
212
|
+
}, [open, updatePosition]);
|
|
213
|
+
|
|
214
|
+
const handleSelect = (id: string) => {
|
|
215
|
+
onChange(id);
|
|
216
|
+
setOpen(false);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const popover = open
|
|
220
|
+
? createPortal(
|
|
221
|
+
<div
|
|
222
|
+
id="squisq-theme-picker-popover"
|
|
223
|
+
className="squisq-theme-picker-popover"
|
|
224
|
+
role="listbox"
|
|
225
|
+
aria-label={ariaLabel}
|
|
226
|
+
style={popoverStyle}
|
|
227
|
+
>
|
|
228
|
+
{includeDefault && (
|
|
229
|
+
<button
|
|
230
|
+
type="button"
|
|
231
|
+
role="option"
|
|
232
|
+
aria-selected={value === ''}
|
|
233
|
+
aria-label="Default"
|
|
234
|
+
className={`squisq-theme-picker-row${value === '' ? ' squisq-theme-picker-row--selected' : ''}`}
|
|
235
|
+
onClick={() => handleSelect('')}
|
|
236
|
+
>
|
|
237
|
+
<ThemeNameChip
|
|
238
|
+
theme={resolveTheme('standard')}
|
|
239
|
+
label="Default"
|
|
240
|
+
className="squisq-theme-picker-name-chip--default"
|
|
241
|
+
/>
|
|
242
|
+
<span className="squisq-theme-picker-row-meta">
|
|
243
|
+
<span className="squisq-theme-picker-row-name">No explicit theme</span>
|
|
244
|
+
<span className="squisq-theme-picker-row-desc">
|
|
245
|
+
Uses the document's default styling.
|
|
246
|
+
</span>
|
|
247
|
+
</span>
|
|
248
|
+
</button>
|
|
249
|
+
)}
|
|
250
|
+
{THEME_ENTRIES.map((entry) => (
|
|
251
|
+
<button
|
|
252
|
+
key={entry.id}
|
|
253
|
+
type="button"
|
|
254
|
+
role="option"
|
|
255
|
+
aria-selected={value === entry.id}
|
|
256
|
+
aria-label={entry.name}
|
|
257
|
+
className={`squisq-theme-picker-row${value === entry.id ? ' squisq-theme-picker-row--selected' : ''}`}
|
|
258
|
+
onClick={() => handleSelect(entry.id)}
|
|
259
|
+
title={entry.description ?? entry.name}
|
|
260
|
+
>
|
|
261
|
+
<ThemeNameChip theme={entry.theme} label={entry.name} />
|
|
262
|
+
<span className="squisq-theme-picker-row-meta">
|
|
263
|
+
<Swatches theme={entry.theme} />
|
|
264
|
+
{entry.description && (
|
|
265
|
+
<span className="squisq-theme-picker-row-desc">{entry.description}</span>
|
|
266
|
+
)}
|
|
267
|
+
</span>
|
|
268
|
+
</button>
|
|
269
|
+
))}
|
|
270
|
+
</div>,
|
|
271
|
+
document.body,
|
|
272
|
+
)
|
|
273
|
+
: null;
|
|
274
|
+
|
|
275
|
+
return (
|
|
276
|
+
<>
|
|
277
|
+
<button
|
|
278
|
+
ref={triggerRef}
|
|
279
|
+
type="button"
|
|
280
|
+
className={`squisq-theme-picker-trigger squisq-theme-picker-trigger--${variant}${
|
|
281
|
+
open ? ' squisq-theme-picker-trigger--open' : ''
|
|
282
|
+
}`}
|
|
283
|
+
onClick={handleToggle}
|
|
284
|
+
aria-haspopup="listbox"
|
|
285
|
+
aria-expanded={open}
|
|
286
|
+
aria-label={ariaLabel}
|
|
287
|
+
>
|
|
288
|
+
{previewEntry && (
|
|
289
|
+
<ThemeNameChip
|
|
290
|
+
theme={previewEntry.theme}
|
|
291
|
+
label={triggerLabel}
|
|
292
|
+
className={`squisq-theme-picker-name-chip--trigger${
|
|
293
|
+
isDefault ? ' squisq-theme-picker-name-chip--default' : ''
|
|
294
|
+
}`}
|
|
295
|
+
/>
|
|
296
|
+
)}
|
|
297
|
+
{previewEntry && variant === 'full' && !isDefault && (
|
|
298
|
+
<Swatches theme={previewEntry.theme} />
|
|
299
|
+
)}
|
|
300
|
+
<svg
|
|
301
|
+
className="squisq-theme-picker-caret"
|
|
302
|
+
width="10"
|
|
303
|
+
height="10"
|
|
304
|
+
viewBox="0 0 10 10"
|
|
305
|
+
aria-hidden="true"
|
|
306
|
+
>
|
|
307
|
+
<path
|
|
308
|
+
d="M2 3.5l3 3 3-3"
|
|
309
|
+
stroke="currentColor"
|
|
310
|
+
strokeWidth="1.5"
|
|
311
|
+
strokeLinecap="round"
|
|
312
|
+
fill="none"
|
|
313
|
+
/>
|
|
314
|
+
</svg>
|
|
315
|
+
</button>
|
|
316
|
+
{popover}
|
|
317
|
+
</>
|
|
318
|
+
);
|
|
319
|
+
}
|