@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,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline SVG line icons for the image editor chrome. Stroke-based,
|
|
3
|
+
* `currentColor`-driven so they pick up `--squisq-image-editor-text` etc.
|
|
4
|
+
* automatically. Sized via `font-size`/`em` so they scale with their
|
|
5
|
+
* button label. Kept inline (no sprite, no font) so the package has zero
|
|
6
|
+
* extra runtime cost and tree-shakes per-icon.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { SVGProps } from 'react';
|
|
10
|
+
|
|
11
|
+
type IconProps = Omit<SVGProps<SVGSVGElement>, 'children'>;
|
|
12
|
+
|
|
13
|
+
function Svg({ children, ...rest }: SVGProps<SVGSVGElement>) {
|
|
14
|
+
return (
|
|
15
|
+
<svg
|
|
16
|
+
width="1em"
|
|
17
|
+
height="1em"
|
|
18
|
+
viewBox="0 0 24 24"
|
|
19
|
+
fill="none"
|
|
20
|
+
stroke="currentColor"
|
|
21
|
+
strokeWidth={1.75}
|
|
22
|
+
strokeLinecap="round"
|
|
23
|
+
strokeLinejoin="round"
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
focusable="false"
|
|
26
|
+
{...rest}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</svg>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function EyeIcon(props: IconProps) {
|
|
34
|
+
return (
|
|
35
|
+
<Svg {...props}>
|
|
36
|
+
<path d="M2.5 12s3.5-6.5 9.5-6.5S21.5 12 21.5 12s-3.5 6.5-9.5 6.5S2.5 12 2.5 12Z" />
|
|
37
|
+
<circle cx="12" cy="12" r="2.75" />
|
|
38
|
+
</Svg>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function EyeOffIcon(props: IconProps) {
|
|
43
|
+
return (
|
|
44
|
+
<Svg {...props}>
|
|
45
|
+
<path d="M3.5 3.5l17 17" />
|
|
46
|
+
<path d="M9.5 5.7A10.6 10.6 0 0 1 12 5.5c6 0 9.5 6.5 9.5 6.5a17 17 0 0 1-3.2 4" />
|
|
47
|
+
<path d="M6.2 7.6A17 17 0 0 0 2.5 12s3.5 6.5 9.5 6.5a10.6 10.6 0 0 0 4.3-.9" />
|
|
48
|
+
<path d="M9.9 9.9a3 3 0 0 0 4.2 4.2" />
|
|
49
|
+
</Svg>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function LockIcon(props: IconProps) {
|
|
54
|
+
return (
|
|
55
|
+
<Svg {...props}>
|
|
56
|
+
<rect x="5" y="11" width="14" height="9" rx="1.5" />
|
|
57
|
+
<path d="M8 11V8a4 4 0 0 1 8 0v3" />
|
|
58
|
+
</Svg>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function UnlockIcon(props: IconProps) {
|
|
63
|
+
return (
|
|
64
|
+
<Svg {...props}>
|
|
65
|
+
<rect x="5" y="11" width="14" height="9" rx="1.5" />
|
|
66
|
+
<path d="M8 11V8a4 4 0 0 1 7.6-1.7" />
|
|
67
|
+
</Svg>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function ChevronUpIcon(props: IconProps) {
|
|
72
|
+
return (
|
|
73
|
+
<Svg {...props}>
|
|
74
|
+
<path d="M6 14l6-6 6 6" />
|
|
75
|
+
</Svg>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function ChevronDownIcon(props: IconProps) {
|
|
80
|
+
return (
|
|
81
|
+
<Svg {...props}>
|
|
82
|
+
<path d="M6 10l6 6 6-6" />
|
|
83
|
+
</Svg>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function CloseIcon(props: IconProps) {
|
|
88
|
+
return (
|
|
89
|
+
<Svg {...props}>
|
|
90
|
+
<path d="M6 6l12 12M18 6L6 18" />
|
|
91
|
+
</Svg>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function CursorIcon(props: IconProps) {
|
|
96
|
+
return (
|
|
97
|
+
<Svg {...props}>
|
|
98
|
+
<path d="M5 4l6.5 14.5 2.2-6 6-2.2L5 4Z" />
|
|
99
|
+
</Svg>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function TextIcon(props: IconProps) {
|
|
104
|
+
return (
|
|
105
|
+
<Svg {...props}>
|
|
106
|
+
<path d="M5 6h14M12 6v13M9 19h6" />
|
|
107
|
+
</Svg>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function ShapeIcon(props: IconProps) {
|
|
112
|
+
return (
|
|
113
|
+
<Svg {...props}>
|
|
114
|
+
<rect x="4" y="4" width="16" height="16" rx="2" />
|
|
115
|
+
</Svg>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function CropIcon(props: IconProps) {
|
|
120
|
+
return (
|
|
121
|
+
<Svg {...props}>
|
|
122
|
+
<path d="M7 2v15a1 1 0 0 0 1 1h15" />
|
|
123
|
+
<path d="M2 7h15a1 1 0 0 1 1 1v15" />
|
|
124
|
+
</Svg>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function PlusIcon(props: IconProps) {
|
|
129
|
+
return (
|
|
130
|
+
<Svg {...props}>
|
|
131
|
+
<path d="M12 5v14M5 12h14" />
|
|
132
|
+
</Svg>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function NoneIcon(props: IconProps) {
|
|
137
|
+
// Used for "no fill / transparent" affordance.
|
|
138
|
+
return (
|
|
139
|
+
<Svg {...props}>
|
|
140
|
+
<circle cx="12" cy="12" r="8" />
|
|
141
|
+
<path d="M6.3 6.3l11.4 11.4" />
|
|
142
|
+
</Svg>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image editor — layout and chrome for the `<ImageEditor>` component.
|
|
3
|
+
*
|
|
4
|
+
* Color tokens follow the same scoped-CSS-vars approach as the rest of
|
|
5
|
+
* the editor; defaults are tuned for the dark host the editor typically
|
|
6
|
+
* lives in but can be overridden by setting the listed `--squisq-image-editor-*`
|
|
7
|
+
* custom properties on the `.squisq-image-editor` root.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.squisq-image-editor {
|
|
11
|
+
--squisq-image-editor-bg: #14141a;
|
|
12
|
+
--squisq-image-editor-panel-bg: #1d1d23;
|
|
13
|
+
--squisq-image-editor-panel-border: #2a2a32;
|
|
14
|
+
--squisq-image-editor-text: #e6e6ea;
|
|
15
|
+
--squisq-image-editor-text-muted: #9999a3;
|
|
16
|
+
--squisq-image-editor-accent: #3399ff;
|
|
17
|
+
--squisq-image-editor-control-bg: #2a2a32;
|
|
18
|
+
--squisq-image-editor-control-border: #3a3a42;
|
|
19
|
+
--squisq-image-editor-workspace-bg: #1f1f24;
|
|
20
|
+
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
min-height: 400px;
|
|
26
|
+
background: var(--squisq-image-editor-bg);
|
|
27
|
+
color: var(--squisq-image-editor-text);
|
|
28
|
+
font-family: var(--squisq-image-editor-body-font, system-ui, -apple-system, sans-serif);
|
|
29
|
+
font-size: 13px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.squisq-image-editor-loading,
|
|
33
|
+
.squisq-image-editor-error {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
flex: 1 1 auto;
|
|
38
|
+
padding: 2rem;
|
|
39
|
+
color: var(--squisq-image-editor-text-muted);
|
|
40
|
+
}
|
|
41
|
+
.squisq-image-editor-error {
|
|
42
|
+
color: #ff6b6b;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* ── Toolbar ───────────────────────────────────────────────────────── */
|
|
46
|
+
.squisq-image-editor-toolbar {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 0.75rem;
|
|
50
|
+
padding: 0.4rem 0.75rem;
|
|
51
|
+
background: var(--squisq-image-editor-panel-bg);
|
|
52
|
+
border-bottom: 1px solid var(--squisq-image-editor-panel-border);
|
|
53
|
+
flex: 0 0 auto;
|
|
54
|
+
}
|
|
55
|
+
.squisq-image-editor-tool-group {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 0.25rem;
|
|
59
|
+
}
|
|
60
|
+
.squisq-image-editor-tool-group--right {
|
|
61
|
+
margin-left: auto;
|
|
62
|
+
}
|
|
63
|
+
.squisq-image-editor-tool-button {
|
|
64
|
+
background: var(--squisq-image-editor-control-bg);
|
|
65
|
+
color: inherit;
|
|
66
|
+
border: 1px solid var(--squisq-image-editor-control-border);
|
|
67
|
+
border-radius: 4px;
|
|
68
|
+
padding: 0.3rem 0.55rem;
|
|
69
|
+
font: inherit;
|
|
70
|
+
/* Unified text size for every button on the toolbar. Icon-only
|
|
71
|
+
buttons get a slightly larger glyph via the SVG rule below so the
|
|
72
|
+
icons remain legible without disrupting the text rhythm of
|
|
73
|
+
adjacent labeled buttons. */
|
|
74
|
+
font-size: 13px;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
line-height: 1;
|
|
77
|
+
min-width: 28px;
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
gap: 0.35rem;
|
|
82
|
+
}
|
|
83
|
+
.squisq-image-editor-tool-button svg {
|
|
84
|
+
font-size: 15px;
|
|
85
|
+
}
|
|
86
|
+
.squisq-image-editor-tool-button--with-label {
|
|
87
|
+
font-size: 13px;
|
|
88
|
+
}
|
|
89
|
+
.squisq-image-editor-tool-button--menu {
|
|
90
|
+
width: 100%;
|
|
91
|
+
justify-content: flex-start;
|
|
92
|
+
border: none;
|
|
93
|
+
background: transparent;
|
|
94
|
+
padding: 0.35rem 0.5rem;
|
|
95
|
+
}
|
|
96
|
+
.squisq-image-editor-tool-button--menu:hover {
|
|
97
|
+
background: color-mix(in srgb, var(--squisq-image-editor-control-bg) 70%, transparent);
|
|
98
|
+
}
|
|
99
|
+
.squisq-image-editor-tool-button:hover {
|
|
100
|
+
background: var(--squisq-image-editor-control-border);
|
|
101
|
+
}
|
|
102
|
+
.squisq-image-editor-tool-button.is-active,
|
|
103
|
+
.squisq-image-editor-tool-button[aria-checked='true'] {
|
|
104
|
+
background: var(--squisq-image-editor-accent);
|
|
105
|
+
border-color: var(--squisq-image-editor-accent);
|
|
106
|
+
color: #fff;
|
|
107
|
+
}
|
|
108
|
+
.squisq-image-editor-tool-button:disabled {
|
|
109
|
+
opacity: 0.4;
|
|
110
|
+
cursor: not-allowed;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* ── Body / layout ─────────────────────────────────────────────────── */
|
|
114
|
+
.squisq-image-editor-body {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex: 1 1 auto;
|
|
117
|
+
min-height: 0;
|
|
118
|
+
}
|
|
119
|
+
.squisq-image-editor-center {
|
|
120
|
+
flex: 1 1 auto;
|
|
121
|
+
min-width: 0;
|
|
122
|
+
display: flex;
|
|
123
|
+
}
|
|
124
|
+
.squisq-image-editor-side {
|
|
125
|
+
flex: 0 0 280px;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
border-left: 1px solid var(--squisq-image-editor-panel-border);
|
|
129
|
+
background: var(--squisq-image-editor-panel-bg);
|
|
130
|
+
overflow: auto;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* ── Canvas surface ────────────────────────────────────────────────── */
|
|
134
|
+
.squisq-image-editor-surface {
|
|
135
|
+
flex: 1 1 auto;
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
padding: 1rem;
|
|
140
|
+
overflow: auto;
|
|
141
|
+
background: var(--squisq-image-editor-workspace-bg);
|
|
142
|
+
}
|
|
143
|
+
.squisq-image-editor-canvas {
|
|
144
|
+
display: block;
|
|
145
|
+
max-width: 100%;
|
|
146
|
+
max-height: 100%;
|
|
147
|
+
background: transparent;
|
|
148
|
+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
|
|
149
|
+
user-select: none;
|
|
150
|
+
touch-action: none;
|
|
151
|
+
}
|
|
152
|
+
.squisq-image-editor-canvas--tool-text,
|
|
153
|
+
.squisq-image-editor-canvas--tool-shape {
|
|
154
|
+
cursor: crosshair;
|
|
155
|
+
}
|
|
156
|
+
.squisq-image-editor-canvas--tool-crop {
|
|
157
|
+
cursor: crosshair;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* ── Layers panel ──────────────────────────────────────────────────── */
|
|
161
|
+
.squisq-image-editor-panel-header {
|
|
162
|
+
padding: 0.5rem 0.75rem;
|
|
163
|
+
font-size: 11px;
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
text-transform: uppercase;
|
|
166
|
+
letter-spacing: 0.05em;
|
|
167
|
+
color: var(--squisq-image-editor-text-muted);
|
|
168
|
+
border-bottom: 1px solid var(--squisq-image-editor-panel-border);
|
|
169
|
+
}
|
|
170
|
+
.squisq-image-editor-layers {
|
|
171
|
+
border-bottom: 1px solid var(--squisq-image-editor-panel-border);
|
|
172
|
+
}
|
|
173
|
+
.squisq-image-editor-layer-list {
|
|
174
|
+
list-style: none;
|
|
175
|
+
margin: 0;
|
|
176
|
+
padding: 0.25rem 0;
|
|
177
|
+
max-height: 240px;
|
|
178
|
+
overflow: auto;
|
|
179
|
+
}
|
|
180
|
+
.squisq-image-editor-layer-empty {
|
|
181
|
+
padding: 0.5rem 0.75rem;
|
|
182
|
+
color: var(--squisq-image-editor-text-muted);
|
|
183
|
+
font-style: italic;
|
|
184
|
+
}
|
|
185
|
+
.squisq-image-editor-layer-item {
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
gap: 0.25rem;
|
|
189
|
+
padding: 0.2rem 0.5rem;
|
|
190
|
+
}
|
|
191
|
+
.squisq-image-editor-layer-item.is-selected {
|
|
192
|
+
background: rgba(51, 153, 255, 0.18);
|
|
193
|
+
}
|
|
194
|
+
.squisq-image-editor-layer-item.is-hidden {
|
|
195
|
+
opacity: 0.5;
|
|
196
|
+
}
|
|
197
|
+
.squisq-image-editor-layer-toggle {
|
|
198
|
+
background: transparent;
|
|
199
|
+
border: 1px solid transparent;
|
|
200
|
+
color: inherit;
|
|
201
|
+
padding: 2px 5px;
|
|
202
|
+
border-radius: 3px;
|
|
203
|
+
font: inherit;
|
|
204
|
+
font-size: 15px;
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
line-height: 1;
|
|
207
|
+
display: inline-flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
}
|
|
211
|
+
.squisq-image-editor-layer-toggle:hover:not(:disabled) {
|
|
212
|
+
background: var(--squisq-image-editor-control-bg);
|
|
213
|
+
}
|
|
214
|
+
.squisq-image-editor-layer-toggle:disabled {
|
|
215
|
+
opacity: 0.3;
|
|
216
|
+
cursor: not-allowed;
|
|
217
|
+
}
|
|
218
|
+
.squisq-image-editor-layer-name {
|
|
219
|
+
flex: 1 1 auto;
|
|
220
|
+
text-align: left;
|
|
221
|
+
background: transparent;
|
|
222
|
+
border: none;
|
|
223
|
+
color: inherit;
|
|
224
|
+
cursor: pointer;
|
|
225
|
+
font: inherit;
|
|
226
|
+
padding: 2px 4px;
|
|
227
|
+
display: flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
gap: 0.5rem;
|
|
230
|
+
overflow: hidden;
|
|
231
|
+
text-overflow: ellipsis;
|
|
232
|
+
white-space: nowrap;
|
|
233
|
+
}
|
|
234
|
+
.squisq-image-editor-layer-kind {
|
|
235
|
+
margin-left: auto;
|
|
236
|
+
font-size: 10px;
|
|
237
|
+
color: var(--squisq-image-editor-text-muted);
|
|
238
|
+
text-transform: uppercase;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* ── Properties panel ──────────────────────────────────────────────── */
|
|
242
|
+
.squisq-image-editor-properties {
|
|
243
|
+
flex: 1 1 auto;
|
|
244
|
+
}
|
|
245
|
+
.squisq-image-editor-properties-empty {
|
|
246
|
+
padding: 0.75rem;
|
|
247
|
+
color: var(--squisq-image-editor-text-muted);
|
|
248
|
+
font-style: italic;
|
|
249
|
+
}
|
|
250
|
+
.squisq-image-editor-fieldset {
|
|
251
|
+
border: none;
|
|
252
|
+
border-bottom: 1px solid var(--squisq-image-editor-panel-border);
|
|
253
|
+
margin: 0;
|
|
254
|
+
padding: 0.5rem 0.75rem 0.6rem;
|
|
255
|
+
}
|
|
256
|
+
.squisq-image-editor-fieldset legend {
|
|
257
|
+
padding: 0;
|
|
258
|
+
font-size: 11px;
|
|
259
|
+
font-weight: 600;
|
|
260
|
+
text-transform: uppercase;
|
|
261
|
+
letter-spacing: 0.04em;
|
|
262
|
+
color: var(--squisq-image-editor-text-muted);
|
|
263
|
+
margin-bottom: 0.4rem;
|
|
264
|
+
}
|
|
265
|
+
.squisq-image-editor-field {
|
|
266
|
+
display: grid;
|
|
267
|
+
grid-template-columns: 80px 1fr;
|
|
268
|
+
align-items: center;
|
|
269
|
+
gap: 0.5rem;
|
|
270
|
+
margin-bottom: 0.3rem;
|
|
271
|
+
font-size: 12px;
|
|
272
|
+
}
|
|
273
|
+
.squisq-image-editor-field--multiline {
|
|
274
|
+
grid-template-columns: 80px 1fr;
|
|
275
|
+
align-items: start;
|
|
276
|
+
}
|
|
277
|
+
.squisq-image-editor-field > span {
|
|
278
|
+
color: var(--squisq-image-editor-text-muted);
|
|
279
|
+
}
|
|
280
|
+
.squisq-image-editor-field input[type='number'],
|
|
281
|
+
.squisq-image-editor-field input[type='text'],
|
|
282
|
+
.squisq-image-editor-field select,
|
|
283
|
+
.squisq-image-editor-field textarea {
|
|
284
|
+
width: 100%;
|
|
285
|
+
background: var(--squisq-image-editor-control-bg);
|
|
286
|
+
border: 1px solid var(--squisq-image-editor-control-border);
|
|
287
|
+
color: inherit;
|
|
288
|
+
border-radius: 3px;
|
|
289
|
+
padding: 3px 5px;
|
|
290
|
+
font: inherit;
|
|
291
|
+
box-sizing: border-box;
|
|
292
|
+
}
|
|
293
|
+
.squisq-image-editor-field textarea {
|
|
294
|
+
resize: vertical;
|
|
295
|
+
min-height: 56px;
|
|
296
|
+
}
|
|
297
|
+
.squisq-image-editor-color-row {
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
gap: 0.25rem;
|
|
301
|
+
}
|
|
302
|
+
.squisq-image-editor-color-row input[type='color'] {
|
|
303
|
+
width: 28px;
|
|
304
|
+
height: 24px;
|
|
305
|
+
padding: 0;
|
|
306
|
+
border: 1px solid var(--squisq-image-editor-control-border);
|
|
307
|
+
border-radius: 3px;
|
|
308
|
+
background: transparent;
|
|
309
|
+
cursor: pointer;
|
|
310
|
+
flex: 0 0 auto;
|
|
311
|
+
}
|
|
312
|
+
.squisq-image-editor-color-row input[type='text'] {
|
|
313
|
+
flex: 1 1 auto;
|
|
314
|
+
font-family: ui-monospace, monospace;
|
|
315
|
+
font-size: 11px;
|
|
316
|
+
}
|
|
317
|
+
.squisq-image-editor-color-clear {
|
|
318
|
+
background: var(--squisq-image-editor-control-bg);
|
|
319
|
+
border: 1px solid var(--squisq-image-editor-control-border);
|
|
320
|
+
color: inherit;
|
|
321
|
+
border-radius: 3px;
|
|
322
|
+
padding: 2px 5px;
|
|
323
|
+
cursor: pointer;
|
|
324
|
+
font: inherit;
|
|
325
|
+
font-size: 14px;
|
|
326
|
+
display: inline-flex;
|
|
327
|
+
align-items: center;
|
|
328
|
+
justify-content: center;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* -- Version history dropdown --------------------------------------- */
|
|
332
|
+
.squisq-image-editor-version-dropdown {
|
|
333
|
+
position: relative;
|
|
334
|
+
display: inline-flex;
|
|
335
|
+
}
|
|
336
|
+
.squisq-image-editor-version-popover {
|
|
337
|
+
position: absolute;
|
|
338
|
+
top: calc(100% + 4px);
|
|
339
|
+
right: 0;
|
|
340
|
+
z-index: 10;
|
|
341
|
+
min-width: 420px;
|
|
342
|
+
max-width: 560px;
|
|
343
|
+
background: var(--squisq-image-editor-panel-bg);
|
|
344
|
+
border: 1px solid var(--squisq-image-editor-panel-border);
|
|
345
|
+
border-radius: 6px;
|
|
346
|
+
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
|
|
347
|
+
padding: 6px;
|
|
348
|
+
color: var(--squisq-image-editor-text);
|
|
349
|
+
}
|
|
350
|
+
.squisq-image-editor-version-popover__title {
|
|
351
|
+
font-size: 11px;
|
|
352
|
+
text-transform: uppercase;
|
|
353
|
+
letter-spacing: 0.05em;
|
|
354
|
+
color: var(--squisq-image-editor-text-muted);
|
|
355
|
+
padding: 4px 6px 6px;
|
|
356
|
+
}
|
|
357
|
+
.squisq-image-editor-version-popover__empty {
|
|
358
|
+
font-size: 12px;
|
|
359
|
+
color: var(--squisq-image-editor-text-muted);
|
|
360
|
+
padding: 8px 6px 10px;
|
|
361
|
+
}
|
|
362
|
+
.squisq-image-editor-version-popover__list {
|
|
363
|
+
list-style: none;
|
|
364
|
+
margin: 0;
|
|
365
|
+
padding: 0;
|
|
366
|
+
max-height: 280px;
|
|
367
|
+
overflow-y: auto;
|
|
368
|
+
}
|
|
369
|
+
.squisq-image-editor-version-popover__row {
|
|
370
|
+
display: flex;
|
|
371
|
+
align-items: center;
|
|
372
|
+
gap: 10px;
|
|
373
|
+
padding: 6px 4px;
|
|
374
|
+
border-radius: 4px;
|
|
375
|
+
min-width: 0;
|
|
376
|
+
}
|
|
377
|
+
.squisq-image-editor-version-popover__row:hover {
|
|
378
|
+
background: color-mix(in srgb, var(--squisq-image-editor-control-bg) 70%, transparent);
|
|
379
|
+
}
|
|
380
|
+
.squisq-image-editor-version-popover__thumb {
|
|
381
|
+
flex: 0 0 auto;
|
|
382
|
+
width: 56px;
|
|
383
|
+
height: 40px;
|
|
384
|
+
display: flex;
|
|
385
|
+
align-items: center;
|
|
386
|
+
justify-content: center;
|
|
387
|
+
background: color-mix(in srgb, var(--squisq-image-editor-bg) 50%, transparent);
|
|
388
|
+
border: 1px solid var(--squisq-image-editor-panel-border);
|
|
389
|
+
border-radius: 3px;
|
|
390
|
+
overflow: hidden;
|
|
391
|
+
}
|
|
392
|
+
.squisq-image-editor-version-popover__thumb-img {
|
|
393
|
+
max-width: 100%;
|
|
394
|
+
max-height: 100%;
|
|
395
|
+
object-fit: contain;
|
|
396
|
+
display: block;
|
|
397
|
+
}
|
|
398
|
+
.squisq-image-editor-version-popover__thumb-placeholder {
|
|
399
|
+
width: 100%;
|
|
400
|
+
height: 100%;
|
|
401
|
+
background: repeating-linear-gradient(
|
|
402
|
+
45deg,
|
|
403
|
+
transparent 0 4px,
|
|
404
|
+
color-mix(in srgb, var(--squisq-image-editor-text-muted) 25%, transparent) 4px 8px
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
.squisq-image-editor-version-popover__info {
|
|
408
|
+
flex: 1 1 auto;
|
|
409
|
+
min-width: 0;
|
|
410
|
+
display: flex;
|
|
411
|
+
flex-direction: column;
|
|
412
|
+
gap: 2px;
|
|
413
|
+
}
|
|
414
|
+
.squisq-image-editor-version-popover__when {
|
|
415
|
+
font-size: 12px;
|
|
416
|
+
font-variant-numeric: tabular-nums;
|
|
417
|
+
color: var(--squisq-image-editor-text);
|
|
418
|
+
white-space: nowrap;
|
|
419
|
+
overflow: hidden;
|
|
420
|
+
text-overflow: ellipsis;
|
|
421
|
+
display: flex;
|
|
422
|
+
align-items: center;
|
|
423
|
+
}
|
|
424
|
+
.squisq-image-editor-version-popover__summary {
|
|
425
|
+
font-size: 11px;
|
|
426
|
+
color: var(--squisq-image-editor-text-muted);
|
|
427
|
+
white-space: nowrap;
|
|
428
|
+
overflow: hidden;
|
|
429
|
+
text-overflow: ellipsis;
|
|
430
|
+
}
|
|
431
|
+
.squisq-image-editor-version-popover__row--current {
|
|
432
|
+
background: color-mix(in srgb, var(--squisq-image-editor-accent) 12%, transparent);
|
|
433
|
+
}
|
|
434
|
+
.squisq-image-editor-version-popover__row--current:hover {
|
|
435
|
+
background: color-mix(in srgb, var(--squisq-image-editor-accent) 18%, transparent);
|
|
436
|
+
}
|
|
437
|
+
.squisq-image-editor-version-popover__badge {
|
|
438
|
+
display: inline-block;
|
|
439
|
+
margin-right: 6px;
|
|
440
|
+
padding: 1px 6px;
|
|
441
|
+
font-size: 10px;
|
|
442
|
+
font-weight: 600;
|
|
443
|
+
text-transform: uppercase;
|
|
444
|
+
letter-spacing: 0.04em;
|
|
445
|
+
color: var(--squisq-image-editor-accent);
|
|
446
|
+
background: color-mix(in srgb, var(--squisq-image-editor-accent) 18%, transparent);
|
|
447
|
+
border: 1px solid color-mix(in srgb, var(--squisq-image-editor-accent) 40%, transparent);
|
|
448
|
+
border-radius: 3px;
|
|
449
|
+
vertical-align: 1px;
|
|
450
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG renderer for an `ImageEditLayer` of kind `image` inside the editor.
|
|
3
|
+
* Resolves the asset path to a blob URL via the host-supplied
|
|
4
|
+
* `resolveAssetUrl` (typically backed by the sidecar container).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { useEffect, useState } from 'react';
|
|
8
|
+
import type { ImageEditCanvas, ImageEditLayer } from '@bendyline/squisq/schemas';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
layer: ImageEditLayer & { type: 'image' };
|
|
12
|
+
canvas: ImageEditCanvas;
|
|
13
|
+
resolveAssetUrl: (path: string) => Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function EditorImageLayer({ layer, canvas, resolveAssetUrl }: Props) {
|
|
17
|
+
const [href, setHref] = useState<string | null>(null);
|
|
18
|
+
const src = layer.content.src;
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
let cancelled = false;
|
|
22
|
+
resolveAssetUrl(src)
|
|
23
|
+
.then((url) => {
|
|
24
|
+
if (!cancelled) setHref(url);
|
|
25
|
+
})
|
|
26
|
+
.catch(() => {
|
|
27
|
+
if (!cancelled) setHref(null);
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
cancelled = true;
|
|
31
|
+
};
|
|
32
|
+
}, [src, resolveAssetUrl]);
|
|
33
|
+
|
|
34
|
+
if (!href) return null;
|
|
35
|
+
|
|
36
|
+
const p = layer.position;
|
|
37
|
+
const x = typeof p.x === 'number' ? p.x : 0;
|
|
38
|
+
const y = typeof p.y === 'number' ? p.y : 0;
|
|
39
|
+
const width = typeof p.width === 'number' ? p.width : canvas.width;
|
|
40
|
+
const height = typeof p.height === 'number' ? p.height : canvas.height;
|
|
41
|
+
const fit = layer.content.fit ?? 'fill';
|
|
42
|
+
const par = fit === 'cover' ? 'xMidYMid slice' : fit === 'contain' ? 'xMidYMid meet' : 'none';
|
|
43
|
+
|
|
44
|
+
return <image href={href} x={x} y={y} width={width} height={height} preserveAspectRatio={par} />;
|
|
45
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG renderer for an `ImageEditLayer` of kind `shape` inside the editor.
|
|
3
|
+
* Mirrors `react/src/layers/ShapeLayer.tsx` minus the animation/anchor
|
|
4
|
+
* logic since the editor authors layers with numeric, top-left positions.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ImageEditCanvas, ImageEditLayer } from '@bendyline/squisq/schemas';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
layer: ImageEditLayer & { type: 'shape' };
|
|
11
|
+
canvas: ImageEditCanvas;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function EditorShapeLayer({ layer, canvas: _canvas }: Props) {
|
|
15
|
+
const p = layer.position;
|
|
16
|
+
const x = typeof p.x === 'number' ? p.x : 0;
|
|
17
|
+
const y = typeof p.y === 'number' ? p.y : 0;
|
|
18
|
+
const width = typeof p.width === 'number' ? p.width : 100;
|
|
19
|
+
const height = typeof p.height === 'number' ? p.height : 100;
|
|
20
|
+
const c = layer.content;
|
|
21
|
+
const fill = c.fill ?? 'none';
|
|
22
|
+
const stroke = c.stroke;
|
|
23
|
+
const strokeWidth = c.strokeWidth;
|
|
24
|
+
|
|
25
|
+
if (c.shape === 'rect') {
|
|
26
|
+
return (
|
|
27
|
+
<rect
|
|
28
|
+
x={x}
|
|
29
|
+
y={y}
|
|
30
|
+
width={width}
|
|
31
|
+
height={height}
|
|
32
|
+
rx={c.borderRadius}
|
|
33
|
+
ry={c.borderRadius}
|
|
34
|
+
fill={fill}
|
|
35
|
+
stroke={stroke}
|
|
36
|
+
strokeWidth={strokeWidth}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
if (c.shape === 'circle') {
|
|
41
|
+
return (
|
|
42
|
+
<circle
|
|
43
|
+
cx={x + width / 2}
|
|
44
|
+
cy={y + height / 2}
|
|
45
|
+
r={Math.min(width, height) / 2}
|
|
46
|
+
fill={fill}
|
|
47
|
+
stroke={stroke}
|
|
48
|
+
strokeWidth={strokeWidth}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return (
|
|
53
|
+
<line
|
|
54
|
+
x1={x}
|
|
55
|
+
y1={y}
|
|
56
|
+
x2={x + width}
|
|
57
|
+
y2={y + height}
|
|
58
|
+
stroke={stroke ?? '#000'}
|
|
59
|
+
strokeWidth={strokeWidth ?? 1}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}
|