@alpaca-editor/core 1.0.0 → 1.0.3
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/build.css +3 -0
- package/components.json +21 -0
- package/dev.css +3 -0
- package/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +4 -0
- package/dist/client-components/api.js.map +1 -0
- package/dist/client-components/index.d.ts +16 -0
- package/dist/client-components/index.js +17 -0
- package/dist/client-components/index.js.map +1 -0
- package/dist/components/ActionButton.d.ts +12 -0
- package/dist/components/ActionButton.js +6 -0
- package/dist/components/ActionButton.js.map +1 -0
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +24 -0
- package/dist/components/Error.js.map +1 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +32 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +647 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/types.d.ts +223 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +29 -0
- package/dist/editor/ComponentInfo.js.map +1 -0
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +31 -0
- package/dist/editor/ConfirmationDialog.js.map +1 -0
- package/dist/editor/ContentTree.d.ts +35 -0
- package/dist/editor/ContentTree.js +404 -0
- package/dist/editor/ContentTree.js.map +1 -0
- package/dist/editor/ContextMenu.d.ts +13 -0
- package/dist/editor/ContextMenu.js +114 -0
- package/dist/editor/ContextMenu.js.map +1 -0
- package/dist/editor/Editor.d.ts +11 -0
- package/dist/editor/Editor.js +50 -0
- package/dist/editor/Editor.js.map +1 -0
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +11 -0
- package/dist/editor/EditorWarning.js.map +1 -0
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +19 -0
- package/dist/editor/EditorWarnings.js.map +1 -0
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +22 -0
- package/dist/editor/FieldEditorPopup.js.map +1 -0
- package/dist/editor/FieldHistory.d.ts +6 -0
- package/dist/editor/FieldHistory.js +38 -0
- package/dist/editor/FieldHistory.js.map +1 -0
- package/dist/editor/FieldList.d.ts +16 -0
- package/dist/editor/FieldList.js +58 -0
- package/dist/editor/FieldList.js.map +1 -0
- package/dist/editor/FieldListField.d.ts +14 -0
- package/dist/editor/FieldListField.js +161 -0
- package/dist/editor/FieldListField.js.map +1 -0
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +109 -0
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -0
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +90 -0
- package/dist/editor/FloatingToolbar.js.map +1 -0
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +53 -0
- package/dist/editor/ImageEditor.js.map +1 -0
- package/dist/editor/InsertMenu.d.ts +8 -0
- package/dist/editor/InsertMenu.js +158 -0
- package/dist/editor/InsertMenu.js.map +1 -0
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +28 -0
- package/dist/editor/ItemInfo.js.map +1 -0
- package/dist/editor/LinkEditorDialog.d.ts +15 -0
- package/dist/editor/LinkEditorDialog.js +84 -0
- package/dist/editor/LinkEditorDialog.js.map +1 -0
- package/dist/editor/MainLayout.d.ts +9 -0
- package/dist/editor/MainLayout.js +41 -0
- package/dist/editor/MainLayout.js.map +1 -0
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +7 -0
- package/dist/editor/NewEditorClient.js.map +1 -0
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +327 -0
- package/dist/editor/PictureCropper.js.map +1 -0
- package/dist/editor/PictureEditor.d.ts +8 -0
- package/dist/editor/PictureEditor.js +102 -0
- package/dist/editor/PictureEditor.js.map +1 -0
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +189 -0
- package/dist/editor/PictureEditorDialog.js.map +1 -0
- package/dist/editor/ScrollingContentTree.d.ts +6 -0
- package/dist/editor/ScrollingContentTree.js +25 -0
- package/dist/editor/ScrollingContentTree.js.map +1 -0
- package/dist/editor/Terminal.d.ts +14 -0
- package/dist/editor/Terminal.js +107 -0
- package/dist/editor/Terminal.js.map +1 -0
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +9 -0
- package/dist/editor/Titlebar.js.map +1 -0
- package/dist/editor/ai/AiPopup.d.ts +10 -0
- package/dist/editor/ai/AiPopup.js +23 -0
- package/dist/editor/ai/AiPopup.js.map +1 -0
- package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
- package/dist/editor/ai/AiResponseMessage.js +22 -0
- package/dist/editor/ai/AiResponseMessage.js.map +1 -0
- package/dist/editor/ai/AiTerminal.d.ts +34 -0
- package/dist/editor/ai/AiTerminal.js +236 -0
- package/dist/editor/ai/AiTerminal.js.map +1 -0
- package/dist/editor/ai/AiToolCall.d.ts +9 -0
- package/dist/editor/ai/AiToolCall.js +16 -0
- package/dist/editor/ai/AiToolCall.js.map +1 -0
- package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
- package/dist/editor/ai/EditorAiTerminal.js +7 -0
- package/dist/editor/ai/EditorAiTerminal.js.map +1 -0
- package/dist/editor/ai/editorAiContext.d.ts +11 -0
- package/dist/editor/ai/editorAiContext.js +12 -0
- package/dist/editor/ai/editorAiContext.js.map +1 -0
- package/dist/editor/client/DialogContext.d.ts +12 -0
- package/dist/editor/client/DialogContext.js +25 -0
- package/dist/editor/client/DialogContext.js.map +1 -0
- package/dist/editor/client/EditorClient.d.ts +26 -0
- package/dist/editor/client/EditorClient.js +1298 -0
- package/dist/editor/client/EditorClient.js.map +1 -0
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +25 -0
- package/dist/editor/client/GenericDialog.js.map +1 -0
- package/dist/editor/client/editContext.d.ts +199 -0
- package/dist/editor/client/editContext.js +20 -0
- package/dist/editor/client/editContext.js.map +1 -0
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +29 -0
- package/dist/editor/client/helpers.js.map +1 -0
- package/dist/editor/client/itemsRepository.d.ts +24 -0
- package/dist/editor/client/itemsRepository.js +253 -0
- package/dist/editor/client/itemsRepository.js.map +1 -0
- package/dist/editor/client/operations.d.ts +57 -0
- package/dist/editor/client/operations.js +393 -0
- package/dist/editor/client/operations.js.map +1 -0
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +127 -0
- package/dist/editor/client/pageModelBuilder.js.map +1 -0
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +2 -0
- package/dist/editor/commands/commands.js.map +1 -0
- package/dist/editor/commands/componentCommands.d.ts +13 -0
- package/dist/editor/commands/componentCommands.js +271 -0
- package/dist/editor/commands/componentCommands.js.map +1 -0
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +24 -0
- package/dist/editor/commands/createVersionCommand.js.map +1 -0
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +53 -0
- package/dist/editor/commands/deleteVersionCommand.js.map +1 -0
- package/dist/editor/commands/itemCommands.d.ts +17 -0
- package/dist/editor/commands/itemCommands.js +132 -0
- package/dist/editor/commands/itemCommands.js.map +1 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +89 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js.map +1 -0
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +29 -0
- package/dist/editor/commands/undo.js.map +1 -0
- package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesigner.js +56 -0
- package/dist/editor/component-designer/ComponentDesigner.js.map +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +7 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js.map +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +65 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js.map +1 -0
- package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
- package/dist/editor/component-designer/ComponentEditor.js +57 -0
- package/dist/editor/component-designer/ComponentEditor.js.map +1 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +11 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js.map +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +69 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js.map +1 -0
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +20 -0
- package/dist/editor/component-designer/ComponentsDropdown.js.map +1 -0
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +68 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js.map +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +23 -0
- package/dist/editor/component-designer/RenderingsDropdown.js.map +1 -0
- package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
- package/dist/editor/component-designer/TemplateEditor.js +142 -0
- package/dist/editor/component-designer/TemplateEditor.js.map +1 -0
- package/dist/editor/component-designer/aiContext.d.ts +5 -0
- package/dist/editor/component-designer/aiContext.js +16 -0
- package/dist/editor/component-designer/aiContext.js.map +1 -0
- package/dist/editor/componentTreeHelper.d.ts +16 -0
- package/dist/editor/componentTreeHelper.js +87 -0
- package/dist/editor/componentTreeHelper.js.map +1 -0
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +57 -0
- package/dist/editor/control-center/ControlCenterMenu.js.map +1 -0
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +25 -0
- package/dist/editor/control-center/IndexOverview.js.map +1 -0
- package/dist/editor/control-center/IndexSettings.d.ts +5 -0
- package/dist/editor/control-center/IndexSettings.js +104 -0
- package/dist/editor/control-center/IndexSettings.js.map +1 -0
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +5 -0
- package/dist/editor/control-center/Status.js.map +1 -0
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +38 -0
- package/dist/editor/editor-warnings/ItemLocked.js.map +1 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +14 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +14 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +12 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +25 -0
- package/dist/editor/editor-warnings/ValidationErrors.js.map +1 -0
- package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
- package/dist/editor/field-types/AttachmentEditor.js +5 -0
- package/dist/editor/field-types/AttachmentEditor.js.map +1 -0
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +30 -0
- package/dist/editor/field-types/CheckboxEditor.js.map +1 -0
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +49 -0
- package/dist/editor/field-types/DropLinkEditor.js.map +1 -0
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +56 -0
- package/dist/editor/field-types/DropListEditor.js.map +1 -0
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +34 -0
- package/dist/editor/field-types/ImageFieldEditor.js.map +1 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +59 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -0
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +56 -0
- package/dist/editor/field-types/LinkFieldEditor.js.map +1 -0
- package/dist/editor/field-types/MultiLineText.d.ts +6 -0
- package/dist/editor/field-types/MultiLineText.js +33 -0
- package/dist/editor/field-types/MultiLineText.js.map +1 -0
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +57 -0
- package/dist/editor/field-types/PictureFieldEditor.js.map +1 -0
- package/dist/editor/field-types/RawEditor.d.ts +5 -0
- package/dist/editor/field-types/RawEditor.js +31 -0
- package/dist/editor/field-types/RawEditor.js.map +1 -0
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +385 -0
- package/dist/editor/field-types/ReactQuill.js.map +1 -0
- package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/RichTextEditor.js +8 -0
- package/dist/editor/field-types/RichTextEditor.js.map +1 -0
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +70 -0
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -0
- package/dist/editor/field-types/SingleLineText.d.ts +6 -0
- package/dist/editor/field-types/SingleLineText.js +90 -0
- package/dist/editor/field-types/SingleLineText.js.map +1 -0
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +132 -0
- package/dist/editor/field-types/TreeListEditor.js.map +1 -0
- package/dist/editor/fieldTypes.d.ts +117 -0
- package/dist/editor/fieldTypes.js +2 -0
- package/dist/editor/fieldTypes.js.map +1 -0
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +105 -0
- package/dist/editor/media-selector/AiImageSearch.js.map +1 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +56 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js.map +1 -0
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +8 -0
- package/dist/editor/media-selector/MediaSelector.js.map +1 -0
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +7 -0
- package/dist/editor/media-selector/Preview.js.map +1 -0
- package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
- package/dist/editor/media-selector/Thumbnails.js +9 -0
- package/dist/editor/media-selector/Thumbnails.js.map +1 -0
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +165 -0
- package/dist/editor/media-selector/TreeSelector.js.map +1 -0
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +78 -0
- package/dist/editor/media-selector/UploadZone.js.map +1 -0
- package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
- package/dist/editor/menubar/ActionsMenu.js +31 -0
- package/dist/editor/menubar/ActionsMenu.js.map +1 -0
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +11 -0
- package/dist/editor/menubar/ActiveUsers.js.map +1 -0
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +11 -0
- package/dist/editor/menubar/ApproveAndPublish.js.map +1 -0
- package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
- package/dist/editor/menubar/BrowseHistory.js +12 -0
- package/dist/editor/menubar/BrowseHistory.js.map +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +34 -0
- package/dist/editor/menubar/ItemLanguageVersion.js.map +1 -0
- package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
- package/dist/editor/menubar/LanguageSelector.js +31 -0
- package/dist/editor/menubar/LanguageSelector.js.map +1 -0
- package/dist/editor/menubar/Menu.d.ts +1 -0
- package/dist/editor/menubar/Menu.js +63 -0
- package/dist/editor/menubar/Menu.js.map +1 -0
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +41 -0
- package/dist/editor/menubar/NavButtons.js.map +1 -0
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +48 -0
- package/dist/editor/menubar/PageSelector.js.map +1 -0
- package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
- package/dist/editor/menubar/PageViewerControls.js +35 -0
- package/dist/editor/menubar/PageViewerControls.js.map +1 -0
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +6 -0
- package/dist/editor/menubar/Separator.js.map +1 -0
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +24 -0
- package/dist/editor/menubar/SiteInfo.js.map +1 -0
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +16 -0
- package/dist/editor/menubar/User.js.map +1 -0
- package/dist/editor/menubar/VersionSelector.d.ts +9 -0
- package/dist/editor/menubar/VersionSelector.js +47 -0
- package/dist/editor/menubar/VersionSelector.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +212 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +15 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +25 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +13 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +25 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +13 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +176 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -0
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +22 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js.map +1 -0
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +99 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js.map +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +33 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +19 -0
- package/dist/editor/page-editor-chrome/NoLayout.js.map +1 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +63 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +107 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +80 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +145 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -0
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +19 -0
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -0
- package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
- package/dist/editor/page-viewer/EditorForm.js +128 -0
- package/dist/editor/page-viewer/EditorForm.js.map +1 -0
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +222 -0
- package/dist/editor/page-viewer/MiniMap.js.map +1 -0
- package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
- package/dist/editor/page-viewer/PageViewer.js +62 -0
- package/dist/editor/page-viewer/PageViewer.js.map +1 -0
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +690 -0
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -0
- package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
- package/dist/editor/page-viewer/pageViewContext.js +115 -0
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -0
- package/dist/editor/pageModel.d.ts +171 -0
- package/dist/editor/pageModel.js +2 -0
- package/dist/editor/pageModel.js.map +1 -0
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +25 -0
- package/dist/editor/picture-shared.js.map +1 -0
- package/dist/editor/reviews/Comment.d.ts +4 -0
- package/dist/editor/reviews/Comment.js +114 -0
- package/dist/editor/reviews/Comment.js.map +1 -0
- package/dist/editor/reviews/Comments.d.ts +1 -0
- package/dist/editor/reviews/Comments.js +22 -0
- package/dist/editor/reviews/Comments.js.map +1 -0
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +11 -0
- package/dist/editor/reviews/PreviewInfo.js.map +1 -0
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +160 -0
- package/dist/editor/reviews/Reviews.js.map +1 -0
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +42 -0
- package/dist/editor/reviews/reviewCommands.js.map +1 -0
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +43 -0
- package/dist/editor/reviews/useReviews.js.map +1 -0
- package/dist/editor/services/aiService.d.ts +34 -0
- package/dist/editor/services/aiService.js +95 -0
- package/dist/editor/services/aiService.js.map +1 -0
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +72 -0
- package/dist/editor/services/componentDesignerService.js.map +1 -0
- package/dist/editor/services/contentService.d.ts +34 -0
- package/dist/editor/services/contentService.js +92 -0
- package/dist/editor/services/contentService.js.map +1 -0
- package/dist/editor/services/editService.d.ts +34 -0
- package/dist/editor/services/editService.js +294 -0
- package/dist/editor/services/editService.js.map +1 -0
- package/dist/editor/services/indexService.d.ts +6 -0
- package/dist/editor/services/indexService.js +19 -0
- package/dist/editor/services/indexService.js.map +1 -0
- package/dist/editor/services/reviewsService.d.ts +12 -0
- package/dist/editor/services/reviewsService.js +32 -0
- package/dist/editor/services/reviewsService.js.map +1 -0
- package/dist/editor/services/serviceHelper.d.ts +9 -0
- package/dist/editor/services/serviceHelper.js +64 -0
- package/dist/editor/services/serviceHelper.js.map +1 -0
- package/dist/editor/services/systemService.d.ts +2 -0
- package/dist/editor/services/systemService.js +5 -0
- package/dist/editor/services/systemService.js.map +1 -0
- package/dist/editor/services/translationService.d.ts +11 -0
- package/dist/editor/services/translationService.js +11 -0
- package/dist/editor/services/translationService.js.map +1 -0
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +111 -0
- package/dist/editor/services-server/api.js.map +1 -0
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +53 -0
- package/dist/editor/services-server/graphQL.js.map +1 -0
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +53 -0
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -0
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +360 -0
- package/dist/editor/sidebar/ComponentTree.js.map +1 -0
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +58 -0
- package/dist/editor/sidebar/Debug.js.map +1 -0
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +158 -0
- package/dist/editor/sidebar/DictionaryEditor.js.map +1 -0
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +72 -0
- package/dist/editor/sidebar/EditHistory.js.map +1 -0
- package/dist/editor/sidebar/GraphQL.d.ts +1 -0
- package/dist/editor/sidebar/GraphQL.js +113 -0
- package/dist/editor/sidebar/GraphQL.js.map +1 -0
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +22 -0
- package/dist/editor/sidebar/Insert.js.map +1 -0
- package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
- package/dist/editor/sidebar/MainContentTree.js +49 -0
- package/dist/editor/sidebar/MainContentTree.js.map +1 -0
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +32 -0
- package/dist/editor/sidebar/Performance.js.map +1 -0
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +29 -0
- package/dist/editor/sidebar/Sessions.js.map +1 -0
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +13 -0
- package/dist/editor/sidebar/Sidebar.js.map +1 -0
- package/dist/editor/sidebar/SidebarView.d.ts +8 -0
- package/dist/editor/sidebar/SidebarView.js +74 -0
- package/dist/editor/sidebar/SidebarView.js.map +1 -0
- package/dist/editor/sidebar/Translations.d.ts +1 -0
- package/dist/editor/sidebar/Translations.js +158 -0
- package/dist/editor/sidebar/Translations.js.map +1 -0
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +50 -0
- package/dist/editor/sidebar/Validation.js.map +1 -0
- package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
- package/dist/editor/sidebar/ViewSelector.js +13 -0
- package/dist/editor/sidebar/ViewSelector.js.map +1 -0
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +78 -0
- package/dist/editor/sidebar/Workbox.js.map +1 -0
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +5 -0
- package/dist/editor/ui/CenteredMessage.js.map +1 -0
- package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
- package/dist/editor/ui/CopyToClipboardButton.js +15 -0
- package/dist/editor/ui/CopyToClipboardButton.js.map +1 -0
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +5 -0
- package/dist/editor/ui/DialogButtons.js.map +1 -0
- package/dist/editor/ui/Icons.d.ts +38 -0
- package/dist/editor/ui/Icons.js +56 -0
- package/dist/editor/ui/Icons.js.map +1 -0
- package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
- package/dist/editor/ui/ItemNameDialog.js +40 -0
- package/dist/editor/ui/ItemNameDialog.js.map +1 -0
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +56 -0
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -0
- package/dist/editor/ui/ItemSearch.d.ts +23 -0
- package/dist/editor/ui/ItemSearch.js +90 -0
- package/dist/editor/ui/ItemSearch.js.map +1 -0
- package/dist/editor/ui/PerfectTree.d.ts +60 -0
- package/dist/editor/ui/PerfectTree.js +187 -0
- package/dist/editor/ui/PerfectTree.js.map +1 -0
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +10 -0
- package/dist/editor/ui/Section.js.map +1 -0
- package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
- package/dist/editor/ui/SimpleIconButton.js +9 -0
- package/dist/editor/ui/SimpleIconButton.js.map +1 -0
- package/dist/editor/ui/SimpleMenu.d.ts +13 -0
- package/dist/editor/ui/SimpleMenu.js +7 -0
- package/dist/editor/ui/SimpleMenu.js.map +1 -0
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +9 -0
- package/dist/editor/ui/SimpleTable.js.map +1 -0
- package/dist/editor/ui/SimpleTabs.d.ts +12 -0
- package/dist/editor/ui/SimpleTabs.js +19 -0
- package/dist/editor/ui/SimpleTabs.js.map +1 -0
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +5 -0
- package/dist/editor/ui/SimpleToolbar.js.map +1 -0
- package/dist/editor/ui/Spinner.d.ts +3 -0
- package/dist/editor/ui/Spinner.js +5 -0
- package/dist/editor/ui/Spinner.js.map +1 -0
- package/dist/editor/ui/Splitter.d.ts +15 -0
- package/dist/editor/ui/Splitter.js +151 -0
- package/dist/editor/ui/Splitter.js.map +1 -0
- package/dist/editor/ui/StackedPanels.d.ts +5 -0
- package/dist/editor/ui/StackedPanels.js +67 -0
- package/dist/editor/ui/StackedPanels.js.map +1 -0
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +5 -0
- package/dist/editor/ui/Toolbar.js.map +1 -0
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +5 -0
- package/dist/editor/utils/id-helper.js.map +1 -0
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +43 -0
- package/dist/editor/utils/insertOptions.js.map +1 -0
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +22 -0
- package/dist/editor/utils/itemutils.js.map +1 -0
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +18 -0
- package/dist/editor/utils/useMemoDebug.js.map +1 -0
- package/dist/editor/utils.d.ts +44 -0
- package/dist/editor/utils.js +309 -0
- package/dist/editor/utils.js.map +1 -0
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +145 -0
- package/dist/editor/views/CompareView.js.map +1 -0
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +15 -0
- package/dist/editor/views/EditView.js.map +1 -0
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +22 -0
- package/dist/editor/views/ItemEditor.js.map +1 -0
- package/dist/editor/views/SingleEditView.d.ts +8 -0
- package/dist/editor/views/SingleEditView.js +23 -0
- package/dist/editor/views/SingleEditView.js.map +1 -0
- package/dist/images/bg-shape-black.webp +0 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/page-wizard/PageWizard.d.ts +70 -0
- package/dist/page-wizard/PageWizard.js +60 -0
- package/dist/page-wizard/PageWizard.js.map +1 -0
- package/dist/page-wizard/SelectWizard.d.ts +7 -0
- package/dist/page-wizard/SelectWizard.js +41 -0
- package/dist/page-wizard/SelectWizard.js.map +1 -0
- package/dist/page-wizard/WizardSteps.d.ts +8 -0
- package/dist/page-wizard/WizardSteps.js +69 -0
- package/dist/page-wizard/WizardSteps.js.map +1 -0
- package/dist/page-wizard/service.d.ts +15 -0
- package/dist/page-wizard/service.js +22 -0
- package/dist/page-wizard/service.js.map +1 -0
- package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
- package/dist/page-wizard/startPageWizardCommand.js +21 -0
- package/dist/page-wizard/startPageWizardCommand.js.map +1 -0
- package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/BuildPageStep.js +133 -0
- package/dist/page-wizard/steps/BuildPageStep.js.map +1 -0
- package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
- package/dist/page-wizard/steps/CollectStep.js +119 -0
- package/dist/page-wizard/steps/CollectStep.js.map +1 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +209 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js.map +1 -0
- package/dist/page-wizard/steps/Components.d.ts +9 -0
- package/dist/page-wizard/steps/Components.js +89 -0
- package/dist/page-wizard/steps/Components.js.map +1 -0
- package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
- package/dist/page-wizard/steps/CreatePage.js +140 -0
- package/dist/page-wizard/steps/CreatePage.js.map +1 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +228 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js.map +1 -0
- package/dist/page-wizard/steps/EditButton.d.ts +8 -0
- package/dist/page-wizard/steps/EditButton.js +5 -0
- package/dist/page-wizard/steps/EditButton.js.map +1 -0
- package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
- package/dist/page-wizard/steps/FieldEditor.js +28 -0
- package/dist/page-wizard/steps/FieldEditor.js.map +1 -0
- package/dist/page-wizard/steps/Generate.d.ts +5 -0
- package/dist/page-wizard/steps/Generate.js +10 -0
- package/dist/page-wizard/steps/Generate.js.map +1 -0
- package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
- package/dist/page-wizard/steps/ImagesStep.js +156 -0
- package/dist/page-wizard/steps/ImagesStep.js.map +1 -0
- package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/LayoutStep.js +118 -0
- package/dist/page-wizard/steps/LayoutStep.js.map +1 -0
- package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
- package/dist/page-wizard/steps/SelectStep.js +145 -0
- package/dist/page-wizard/steps/SelectStep.js.map +1 -0
- package/dist/page-wizard/steps/schema.d.ts +13 -0
- package/dist/page-wizard/steps/schema.js +137 -0
- package/dist/page-wizard/steps/schema.js.map +1 -0
- package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
- package/dist/page-wizard/steps/usePageCreator.js +192 -0
- package/dist/page-wizard/steps/usePageCreator.js.map +1 -0
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +129 -0
- package/dist/splash-screen/NewPage.js.map +1 -0
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +7 -0
- package/dist/splash-screen/SectionHeadline.js.map +1 -0
- package/dist/splash-screen/SplashScreen.d.ts +1 -0
- package/dist/splash-screen/SplashScreen.js +79 -0
- package/dist/splash-screen/SplashScreen.js.map +1 -0
- package/dist/styles.css +2739 -0
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +319 -0
- package/dist/tour/Tour.js.map +1 -0
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +229 -0
- package/dist/tour/default-tour.js.map +1 -0
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +91 -0
- package/dist/tour/preview-tour.js.map +1 -0
- package/dist/types.d.ts +259 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +12 -5
- package/src/components/ui/button.tsx +62 -0
- package/src/editor/Titlebar.tsx +2 -2
- package/src/editor/client/EditorClient.tsx +8 -9
- package/src/editor/menubar/ActionsMenu.tsx +1 -1
- package/src/editor/menubar/Menu.tsx +3 -3
- package/src/editor/menubar/VersionSelector.tsx +9 -10
- package/src/editor/page-editor-chrome/CommentHighlighting.tsx +8 -9
- package/src/editor/page-viewer/MiniMap.tsx +11 -11
- package/src/editor/reviews/Comment.tsx +38 -33
- package/src/editor/sidebar/ComponentTree.tsx +512 -512
- package/src/editor/sidebar/Insert.tsx +2 -2
- package/src/editor/sidebar/MainContentTree.tsx +1 -0
- package/src/editor/sidebar/Translations.tsx +12 -12
- package/src/editor/sidebar/ViewSelector.tsx +6 -7
- package/src/editor/ui/PerfectTree.tsx +2 -2
- package/src/editor/ui/SimpleTable.tsx +3 -6
- package/src/editor/utils.ts +32 -29
- package/src/index.ts +2 -0
- package/src/lib/utils.ts +6 -0
- package/src/splash-screen/SplashScreen.tsx +2 -2
- package/styles.css +124 -2
- package/tsconfig.build.json +23 -13
- package/tsconfig.json +3 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog } from "primereact/dialog";
|
|
3
|
+
import { useEditContext } from "./client/editContext";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Button } from "primereact/button";
|
|
6
|
+
import DialogButtons from "./ui/DialogButtons";
|
|
7
|
+
import { classNames } from "primereact/utils";
|
|
8
|
+
export function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
9
|
+
const [pictureValue, setPictureValue] = useState();
|
|
10
|
+
const [isValid, setIsValid] = useState(true);
|
|
11
|
+
const [rawValue, setRawValue] = useState();
|
|
12
|
+
const imageRef = useRef(null);
|
|
13
|
+
const [rect, setRect] = useState();
|
|
14
|
+
const rectRef = useRef(rect);
|
|
15
|
+
const movingRef = useRef(false);
|
|
16
|
+
const [startPos, setStartPos] = useState({
|
|
17
|
+
x: 0,
|
|
18
|
+
y: 0,
|
|
19
|
+
});
|
|
20
|
+
const offset = useRef({ x: 0, y: 0 });
|
|
21
|
+
const editContext = useEditContext();
|
|
22
|
+
const EDGE_THRESHOLD = 10; // pixels from edge to detect resize
|
|
23
|
+
const [resizeEdge, setResizeEdge] = useState(null);
|
|
24
|
+
const resizeEdgeRef = useRef(null);
|
|
25
|
+
const getResizeEdge = (pos, rect, bounds) => {
|
|
26
|
+
if (!rect || !bounds)
|
|
27
|
+
return null;
|
|
28
|
+
const x = pos.x * bounds.width;
|
|
29
|
+
const y = pos.y * bounds.height;
|
|
30
|
+
const rectX = rect.x * bounds.width;
|
|
31
|
+
const rectY = rect.y * bounds.height;
|
|
32
|
+
const rectWidth = rect.width * bounds.width;
|
|
33
|
+
const rectHeight = rect.height * bounds.height;
|
|
34
|
+
const isNearLeft = Math.abs(x - rectX) < EDGE_THRESHOLD;
|
|
35
|
+
const isNearRight = Math.abs(x - (rectX + rectWidth)) < EDGE_THRESHOLD;
|
|
36
|
+
const isNearTop = Math.abs(y - rectY) < EDGE_THRESHOLD;
|
|
37
|
+
const isNearBottom = Math.abs(y - (rectY + rectHeight)) < EDGE_THRESHOLD;
|
|
38
|
+
if (isNearLeft && isNearTop)
|
|
39
|
+
return "nw";
|
|
40
|
+
if (isNearRight && isNearTop)
|
|
41
|
+
return "ne";
|
|
42
|
+
if (isNearLeft && isNearBottom)
|
|
43
|
+
return "sw";
|
|
44
|
+
if (isNearRight && isNearBottom)
|
|
45
|
+
return "se";
|
|
46
|
+
if (isNearLeft)
|
|
47
|
+
return "w";
|
|
48
|
+
if (isNearRight)
|
|
49
|
+
return "e";
|
|
50
|
+
if (isNearTop)
|
|
51
|
+
return "n";
|
|
52
|
+
if (isNearBottom)
|
|
53
|
+
return "s";
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const deepCopy = JSON.parse(JSON.stringify(field.value));
|
|
58
|
+
setPictureValue(deepCopy);
|
|
59
|
+
const raw = field?.rawValue
|
|
60
|
+
? JSON.parse(field?.rawValue)
|
|
61
|
+
: { Variants: [] };
|
|
62
|
+
setRawValue(raw);
|
|
63
|
+
}, [field]);
|
|
64
|
+
const selectedVariant = pictureValue && pictureValue.variants
|
|
65
|
+
? pictureValue.variants?.find((x) => x.name == selectedVariantName)
|
|
66
|
+
: null;
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (selectedVariant?.region &&
|
|
69
|
+
(!selectedVariant.aspectRatioLock ||
|
|
70
|
+
Math.abs(selectedVariant.aspectRatioLock -
|
|
71
|
+
(selectedVariant.region.width * selectedVariant.width) /
|
|
72
|
+
(selectedVariant.region.height * selectedVariant.height)) < 0.1) &&
|
|
73
|
+
selectedVariant.region.width > 0 &&
|
|
74
|
+
selectedVariant.region.height > 0) {
|
|
75
|
+
setRect({
|
|
76
|
+
width: selectedVariant.region.width,
|
|
77
|
+
height: selectedVariant.region.height,
|
|
78
|
+
y: selectedVariant.region.y,
|
|
79
|
+
x: selectedVariant.region.x,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
setRect(undefined);
|
|
84
|
+
}
|
|
85
|
+
}, [selectedVariant]);
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (!rect)
|
|
88
|
+
return;
|
|
89
|
+
if ((selectedVariant?.minWidth && selectedVariant.minWidth > widthPx) ||
|
|
90
|
+
(selectedVariant?.minHeight && selectedVariant?.minHeight > heightPx)) {
|
|
91
|
+
setIsValid(false);
|
|
92
|
+
}
|
|
93
|
+
else
|
|
94
|
+
setIsValid(true);
|
|
95
|
+
rectRef.current = rect;
|
|
96
|
+
}, [rect]);
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!rawValue)
|
|
99
|
+
return;
|
|
100
|
+
if (!selectedVariantName)
|
|
101
|
+
return;
|
|
102
|
+
if (selectedVariant) {
|
|
103
|
+
let selected = rawValue.Variants?.find((x) => x.Name == selectedVariantName);
|
|
104
|
+
if (!selected) {
|
|
105
|
+
selected = {
|
|
106
|
+
Name: selectedVariantName,
|
|
107
|
+
MediaId: selectedVariant.mediaId,
|
|
108
|
+
};
|
|
109
|
+
rawValue.Variants?.push(selected);
|
|
110
|
+
}
|
|
111
|
+
if (selected) {
|
|
112
|
+
if (rect)
|
|
113
|
+
selected.Region = {
|
|
114
|
+
X: rect.x,
|
|
115
|
+
Y: rect.y,
|
|
116
|
+
Width: rect.width,
|
|
117
|
+
Height: rect.height,
|
|
118
|
+
};
|
|
119
|
+
else
|
|
120
|
+
selected.Region = undefined;
|
|
121
|
+
setRawValue(rawValue);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, [rect]);
|
|
125
|
+
const handleMouseMove = (ev) => {
|
|
126
|
+
if (!selectedVariant)
|
|
127
|
+
return null;
|
|
128
|
+
const bounds = imageRef.current?.getBoundingClientRect();
|
|
129
|
+
if (!bounds)
|
|
130
|
+
return;
|
|
131
|
+
const pos = {
|
|
132
|
+
x: (ev.clientX - bounds.left) / bounds.width,
|
|
133
|
+
y: (ev.clientY - bounds.top) / bounds.height,
|
|
134
|
+
};
|
|
135
|
+
// Update cursor on hover (when not dragging)
|
|
136
|
+
if (ev.buttons !== 1) {
|
|
137
|
+
const edge = getResizeEdge(pos, rect, bounds);
|
|
138
|
+
setResizeEdge(edge);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (ev.buttons === 1) {
|
|
142
|
+
if (!rectRef.current || !imageRef.current)
|
|
143
|
+
return;
|
|
144
|
+
const rect = rectRef.current;
|
|
145
|
+
const bounds = imageRef.current.getBoundingClientRect();
|
|
146
|
+
const deltaX = ev.clientX - startPos.x;
|
|
147
|
+
const deltaY = ev.clientY - startPos.y;
|
|
148
|
+
if (resizeEdgeRef.current) {
|
|
149
|
+
const pos = {
|
|
150
|
+
x: (ev.clientX - bounds.left) / bounds.width,
|
|
151
|
+
y: (ev.clientY - bounds.top) / bounds.height,
|
|
152
|
+
};
|
|
153
|
+
let newRect = { ...rect };
|
|
154
|
+
const aspectRatio = selectedVariant.aspectRatioLock;
|
|
155
|
+
const originalAspectRatio = selectedVariant.width / selectedVariant.height;
|
|
156
|
+
if (resizeEdgeRef.current.includes("w")) {
|
|
157
|
+
const newWidth = rect.width + rect.x - pos.x;
|
|
158
|
+
if (newWidth > 0) {
|
|
159
|
+
newRect.width = newWidth;
|
|
160
|
+
newRect.x = pos.x;
|
|
161
|
+
if (aspectRatio) {
|
|
162
|
+
newRect.height =
|
|
163
|
+
(newRect.width / aspectRatio) * originalAspectRatio;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (resizeEdgeRef.current.includes("e")) {
|
|
168
|
+
newRect.width = pos.x - rect.x;
|
|
169
|
+
if (aspectRatio) {
|
|
170
|
+
newRect.height =
|
|
171
|
+
(newRect.width / aspectRatio) * originalAspectRatio;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (resizeEdgeRef.current.includes("n")) {
|
|
175
|
+
const newHeight = rect.height + rect.y - pos.y;
|
|
176
|
+
if (newHeight > 0) {
|
|
177
|
+
newRect.height = newHeight;
|
|
178
|
+
newRect.y = pos.y;
|
|
179
|
+
if (aspectRatio) {
|
|
180
|
+
newRect.width =
|
|
181
|
+
(newRect.height * aspectRatio) / originalAspectRatio;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (resizeEdgeRef.current.includes("s")) {
|
|
186
|
+
newRect.height = pos.y - rect.y;
|
|
187
|
+
if (aspectRatio) {
|
|
188
|
+
newRect.width =
|
|
189
|
+
(newRect.height * aspectRatio) / originalAspectRatio;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// Constrain to bounds
|
|
193
|
+
if (newRect.x < 0)
|
|
194
|
+
newRect.x = 0;
|
|
195
|
+
if (newRect.y < 0)
|
|
196
|
+
newRect.y = 0;
|
|
197
|
+
if (newRect.x + newRect.width > 1)
|
|
198
|
+
newRect.width = 1 - newRect.x;
|
|
199
|
+
if (newRect.y + newRect.height > 1)
|
|
200
|
+
newRect.height = 1 - newRect.y;
|
|
201
|
+
setRect(newRect);
|
|
202
|
+
}
|
|
203
|
+
else if (movingRef.current) {
|
|
204
|
+
setRect({
|
|
205
|
+
...rect,
|
|
206
|
+
x: Math.max(0, Math.min(1 - rectRef.current.width, (ev.clientX - bounds.left) / bounds.width - offset.current.x)),
|
|
207
|
+
y: Math.max(0, Math.min(1 - rectRef.current.height, (ev.clientY - bounds.top) / bounds.height - offset.current.y)),
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
const originalAspectRatio = selectedVariant.width / selectedVariant.height;
|
|
212
|
+
const aspectRatio = selectedVariant.aspectRatioLock;
|
|
213
|
+
let width = (ev.clientX - bounds.left) / bounds.width - rect.x;
|
|
214
|
+
let height = (ev.clientY - bounds.top) / bounds.height - rect.y;
|
|
215
|
+
if (aspectRatio) {
|
|
216
|
+
if (Math.abs(deltaX) > Math.abs(deltaY)) {
|
|
217
|
+
height = (width / aspectRatio) * originalAspectRatio;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
width = (height * aspectRatio) / originalAspectRatio;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (width + rect.x > 1) {
|
|
224
|
+
width = 1 - rect.x;
|
|
225
|
+
if (aspectRatio)
|
|
226
|
+
height = (width / aspectRatio) * originalAspectRatio;
|
|
227
|
+
}
|
|
228
|
+
if (height + rect.y > 1) {
|
|
229
|
+
height = 1 - rect.y;
|
|
230
|
+
if (aspectRatio)
|
|
231
|
+
width = (height * aspectRatio) / originalAspectRatio;
|
|
232
|
+
}
|
|
233
|
+
const newRect = { ...rect, width, height };
|
|
234
|
+
setRect(newRect);
|
|
235
|
+
}
|
|
236
|
+
ev.preventDefault();
|
|
237
|
+
ev.stopPropagation();
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const handleMouseUp = () => {
|
|
241
|
+
if (!rectRef.current || !rectRef.current.width || !rectRef.current.height) {
|
|
242
|
+
setRect(undefined);
|
|
243
|
+
}
|
|
244
|
+
movingRef.current = false;
|
|
245
|
+
resizeEdgeRef.current = null;
|
|
246
|
+
setResizeEdge(null);
|
|
247
|
+
// window.removeEventListener("mousemove", handleMouseMove);
|
|
248
|
+
window.removeEventListener("mouseup", handleMouseUp);
|
|
249
|
+
};
|
|
250
|
+
const isInRect = (pos, rect) => {
|
|
251
|
+
if (!rect || !selectedVariant)
|
|
252
|
+
return false;
|
|
253
|
+
return (pos.x >= rect.x &&
|
|
254
|
+
pos.x <= rect.x + rect.width &&
|
|
255
|
+
pos.y >= rect.y &&
|
|
256
|
+
pos.y <= rect.y + rect.height);
|
|
257
|
+
};
|
|
258
|
+
const handleMouseDown = (ev) => {
|
|
259
|
+
ev.preventDefault();
|
|
260
|
+
ev.stopPropagation();
|
|
261
|
+
const bounds = ev.currentTarget.getBoundingClientRect();
|
|
262
|
+
const pos = {
|
|
263
|
+
x: (ev.clientX - bounds.left) / bounds.width,
|
|
264
|
+
y: (ev.clientY - bounds.top) / bounds.height,
|
|
265
|
+
};
|
|
266
|
+
const edge = getResizeEdge(pos, rect, bounds);
|
|
267
|
+
if (edge) {
|
|
268
|
+
resizeEdgeRef.current = edge;
|
|
269
|
+
setResizeEdge(edge);
|
|
270
|
+
}
|
|
271
|
+
else if (isInRect(pos, rect)) {
|
|
272
|
+
movingRef.current = true;
|
|
273
|
+
offset.current = {
|
|
274
|
+
x: pos.x - rect.x,
|
|
275
|
+
y: pos.y - rect.y,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
setRect({
|
|
280
|
+
x: (ev.clientX - bounds.left) / bounds.width,
|
|
281
|
+
y: (ev.clientY - bounds.top) / bounds.height,
|
|
282
|
+
width: 0,
|
|
283
|
+
height: 0,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
setStartPos({ x: ev.clientX, y: ev.clientY });
|
|
287
|
+
window.addEventListener("mouseup", handleMouseUp);
|
|
288
|
+
};
|
|
289
|
+
if (!selectedVariant)
|
|
290
|
+
return null;
|
|
291
|
+
const imageBounds = imageRef.current?.getBoundingClientRect();
|
|
292
|
+
const scale = imageBounds ? selectedVariant.width / imageBounds.width : 0;
|
|
293
|
+
const widthPx = rect ? Math.round(rect.width * selectedVariant.width) : 0;
|
|
294
|
+
const heightPx = rect ? Math.round(rect.height * selectedVariant.height) : 0;
|
|
295
|
+
return (_jsx(_Fragment, { children: _jsx(Dialog, { header: "Crop " + field.name + " - " + selectedVariantName, pt: { content: { style: { paddingLeft: "0" } } }, visible: true, style: { width: "75vw", height: "75vh" }, onHide: onClose, children: _jsxs("div", { className: "flex gap-1 flex-col justify h-full", children: [_jsxs("div", { className: "flex-1 flex gap-2", children: [_jsxs("div", { className: "w-56 text-sm p-4 bg-gray-100 flex flex-col gap-3", children: [_jsx(LabelAndValue, { label: "Variant:", value: selectedVariantName }), _jsx(LabelAndValue, { label: "Image Dimensions:", value: _jsxs(_Fragment, { children: [selectedVariant.width, " x ", selectedVariant.height] }) }), selectedVariant.aspectRatioLock && (_jsx(LabelAndValue, { label: "Required Aspect Ratio:", value: selectedVariant.aspectRatioLockText })), selectedVariant.minWidth && (_jsx(LabelAndValue, { label: "Minimum Width:", value: selectedVariant.minWidth })), selectedVariant.minHeight && (_jsx(LabelAndValue, { label: "Minimum Height:", value: selectedVariant.minHeight })), rect && (_jsxs(_Fragment, { children: [_jsx(LabelAndValue, { label: "Selection:", value: _jsxs(_Fragment, { children: [widthPx, " x ", heightPx] }) }), selectedVariant.minWidth &&
|
|
296
|
+
widthPx < selectedVariant.minWidth && (_jsx("div", { className: "text-red-500", children: "Minimum width not met!" })), selectedVariant.minHeight &&
|
|
297
|
+
heightPx < selectedVariant.minHeight && (_jsx("div", { className: "text-red-500", children: "Minimum height not met!" }))] }))] }), _jsx("div", { className: "flex-1 relative p-3", children: _jsx("div", { className: "absolute inset-0 top-3 select-none flex items-center justify-center", children: _jsxs("div", { ref: imageRef, className: "relative cursor-crosshair max-h-full", style: {
|
|
298
|
+
aspectRatio: `${selectedVariant.width}/${selectedVariant.height}`,
|
|
299
|
+
}, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, children: [_jsx("img", { className: "object-scale-down", src: selectedVariant.originalSrc ?? selectedVariant.src }), rect && (_jsx("div", { className: classNames("absolute bg-opacity-70 border text-xs cursor-move", isValid
|
|
300
|
+
? "bg-blue-200 border-blue-400 text-blue-500"
|
|
301
|
+
: "bg-red-200 border-red-400 text-red-500"), style: {
|
|
302
|
+
left: rect.x * 100 + "%",
|
|
303
|
+
top: rect.y * 100 + "%",
|
|
304
|
+
width: widthPx / scale + "px",
|
|
305
|
+
height: heightPx / scale + "px",
|
|
306
|
+
cursor: resizeEdge
|
|
307
|
+
? resizeEdge.length === 1
|
|
308
|
+
? `${resizeEdge}-resize`
|
|
309
|
+
: `${resizeEdge}-resize`
|
|
310
|
+
: "move",
|
|
311
|
+
}, children: widthPx / scale > 50 && (_jsxs("div", { className: "absolute bottom-1 right-2 text-nowrap", style: { textShadow: "white 1px 1px" }, children: [widthPx, " x ", heightPx] })) }))] }) }) })] }), _jsxs(DialogButtons, { children: [_jsx(Button, { onClick: () => setRect(undefined), children: "Reset" }), _jsx(Button, { size: "small", disabled: !isValid, onClick: () => {
|
|
312
|
+
if (pictureValue) {
|
|
313
|
+
if (field) {
|
|
314
|
+
editContext?.operations.editField({
|
|
315
|
+
field: field.descriptor,
|
|
316
|
+
rawValue: JSON.stringify(rawValue),
|
|
317
|
+
refresh: "immediate",
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
onClose();
|
|
322
|
+
}, children: "Ok" }), _jsx(Button, { onClick: onClose, size: "small", children: "Cancel" })] })] }) }) }));
|
|
323
|
+
}
|
|
324
|
+
function LabelAndValue({ label, value, }) {
|
|
325
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "font-bold", children: label }), _jsx("div", { children: value })] }));
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=PictureCropper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PictureCropper.js","sourceRoot":"","sources":["../../src/editor/PictureCropper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAa,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;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AAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,sBAAgB,EACzD,KAAC,MAAM,IACL,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,CAAC,OAAO,EAClB,OAAO,EAAE,GAAG,EAAE;oCACZ,IAAI,YAAY,EAAE,CAAC;wCACjB,IAAI,KAAK,EAAE,CAAC;4CACV,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC;gDAChC,KAAK,EAAE,KAAK,CAAC,UAAU;gDACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;gDAClC,OAAO,EAAE,WAAW;6CACrB,CAAC,CAAC;wCACL,CAAC;oCACH,CAAC;oCACD,OAAO,EAAE,CAAC;gCACZ,CAAC,mBAGM,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,OAAO,uBAE7B,IACK,IACZ,GACC,GACR,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,KAAK,EACL,KAAK,GAIN;IACC,OAAO,CACL,0BACE,cAAK,SAAS,EAAC,WAAW,YAAE,KAAK,GAAO,EACxC,wBAAM,KAAK,GAAO,IACd,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PictureField } from "./fieldTypes";
|
|
2
|
+
export declare function PictureEditor({ field, variantName, style, forwardScrollevents, isPageEditor, }: {
|
|
3
|
+
field: PictureField;
|
|
4
|
+
variantName: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
forwardScrollevents?: boolean;
|
|
7
|
+
isPageEditor?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useEditContext } from "./client/editContext";
|
|
4
|
+
import { PictureCropper } from "./PictureCropper";
|
|
5
|
+
export function PictureEditor({ field, variantName, style, forwardScrollevents, isPageEditor, }) {
|
|
6
|
+
const [showMenu, setShowMenu] = useState(false);
|
|
7
|
+
const [showCropper, setShowCropper] = useState(false);
|
|
8
|
+
const editContext = useEditContext();
|
|
9
|
+
const variant = field.value?.variants?.find((v) => v.name === variantName);
|
|
10
|
+
const raw = field?.rawValue && field?.rawValue[0] === "{"
|
|
11
|
+
? JSON.parse(field?.rawValue)
|
|
12
|
+
: { Variants: [] };
|
|
13
|
+
const rawVariant = raw.Variants?.find((x) => x.Name == variantName);
|
|
14
|
+
const reset = useCallback(() => {
|
|
15
|
+
raw.Variants = raw.Variants.filter((x) => x.Name !== variantName);
|
|
16
|
+
editContext.operations.editField({
|
|
17
|
+
field: field.descriptor,
|
|
18
|
+
rawValue: JSON.stringify(raw),
|
|
19
|
+
refresh: "immediate",
|
|
20
|
+
});
|
|
21
|
+
}, [field, variant]);
|
|
22
|
+
const imageSelected = useCallback(async (imageId) => {
|
|
23
|
+
const selected = raw.Variants?.find((x) => x.Name == variantName);
|
|
24
|
+
if (!selected) {
|
|
25
|
+
if (!raw.Variants)
|
|
26
|
+
raw.Variants = [];
|
|
27
|
+
raw.Variants.push({
|
|
28
|
+
Name: variantName,
|
|
29
|
+
MediaId: imageId,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
selected.MediaId = imageId;
|
|
34
|
+
}
|
|
35
|
+
editContext.operations.editField({
|
|
36
|
+
field: field.descriptor,
|
|
37
|
+
rawValue: JSON.stringify(raw),
|
|
38
|
+
refresh: "immediate",
|
|
39
|
+
});
|
|
40
|
+
}, [field, variant]);
|
|
41
|
+
const videoSelected = useCallback(async (videoId) => {
|
|
42
|
+
const selected = raw.Variants?.find((x) => x.Name == variantName);
|
|
43
|
+
if (!selected) {
|
|
44
|
+
if (!raw.Variants)
|
|
45
|
+
raw.Variants = [];
|
|
46
|
+
raw.Variants.push({
|
|
47
|
+
Name: variantName,
|
|
48
|
+
VideoId: videoId,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
selected.VideoId = videoId;
|
|
53
|
+
}
|
|
54
|
+
editContext.operations.editField({
|
|
55
|
+
field: field.descriptor,
|
|
56
|
+
rawValue: JSON.stringify(raw),
|
|
57
|
+
refresh: "immediate",
|
|
58
|
+
});
|
|
59
|
+
}, [field, variant]);
|
|
60
|
+
async function selectMedia(mode) {
|
|
61
|
+
const selectedImageId = await editContext?.selectMedia({
|
|
62
|
+
selectedIdPath: variant?.idPath || "",
|
|
63
|
+
mode: mode,
|
|
64
|
+
});
|
|
65
|
+
if (selectedImageId)
|
|
66
|
+
imageSelected(selectedImageId);
|
|
67
|
+
}
|
|
68
|
+
async function selectVideo() {
|
|
69
|
+
const selectedVideoId = await editContext?.selectMedia({
|
|
70
|
+
selectedIdPath: variant?.idPath || "",
|
|
71
|
+
mode: "video",
|
|
72
|
+
});
|
|
73
|
+
if (selectedVideoId)
|
|
74
|
+
videoSelected(selectedVideoId);
|
|
75
|
+
}
|
|
76
|
+
const notEmpty = variant?.mediaId;
|
|
77
|
+
return (_jsxs("div", { className: "absolute inset-0 flex items-center justify-center", onMouseEnter: () => setShowMenu(true), onMouseLeave: () => setShowMenu(false), onClick: () => {
|
|
78
|
+
if (!isPageEditor)
|
|
79
|
+
return;
|
|
80
|
+
const itemId = field.descriptor.item?.id;
|
|
81
|
+
if (itemId)
|
|
82
|
+
editContext?.select([itemId]);
|
|
83
|
+
}, onWheel: (e) => {
|
|
84
|
+
if (forwardScrollevents)
|
|
85
|
+
editContext?.pageView.editorIframeRef.current?.contentWindow?.document.documentElement?.scrollBy({
|
|
86
|
+
behavior: "instant",
|
|
87
|
+
left: 0,
|
|
88
|
+
top: e.deltaY,
|
|
89
|
+
});
|
|
90
|
+
editContext?.pageView.editorIframeRef.current?.contentWindow?.document.body?.scrollBy({
|
|
91
|
+
behavior: "instant",
|
|
92
|
+
left: 0,
|
|
93
|
+
top: e.deltaY,
|
|
94
|
+
});
|
|
95
|
+
}, style: style, "data-testid": "select-media", children: [showMenu && (_jsxs("div", { className: "p-3 grid grid-cols-2 gap-1.5 items-stretch justify-center text-sm min-w-48", children: [_jsx(Btn, { label: "Select", icon: "pi pi-image", onClick: () => selectMedia("images"), testId: "select-media-button", className: "min-w-[80px]" }), field.value?.allowVideos && (_jsx(Btn, { label: "Video", icon: "pi pi-video", onClick: () => selectVideo(), testId: "video-media-button", className: "min-w-[80px]" })), notEmpty && (_jsx(Btn, { label: "Crop", icon: "pi pi-expand", onClick: () => {
|
|
96
|
+
setShowCropper(true);
|
|
97
|
+
}, testId: "crop-media-button", className: "min-w-[80px]" })), rawVariant && (_jsx(Btn, { label: "Reset", icon: "pi pi-times", onClick: () => reset(), testId: "reset-media-button", className: "min-w-[80px]" }))] })), showCropper && (_jsx(PictureCropper, { field: field, onClose: () => setShowCropper(false), variantName: variantName }))] }));
|
|
98
|
+
}
|
|
99
|
+
function Btn({ label, icon, onClick, testId, className, }) {
|
|
100
|
+
return (_jsxs("button", { className: `btn bg-gray-500 text-white p-1.5 rounded-lg opacity-70 border hover:opacity-85 gap-1.5 flex items-center cursor-pointer ${className}`, onClick: onClick, "data-testid": testId, children: [_jsx("i", { className: icon }), " ", label] }));
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=PictureEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PictureEditor.js","sourceRoot":"","sources":["../../src/editor/PictureEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,KAAK,EACL,mBAAmB,EACnB,YAAY,GAOb;IACC,MAAM,CAAC,QAAQ,EAAE,WAAW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I,CACd,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EACpC,WAAW,EAAE,WAAW,GACxB,CACH,IACG,CACP,CAAC;AACJ,CAAC;AAED,SAAS,GAAG,CAAC,EACX,KAAK,EACL,IAAI,EACJ,OAAO,EACP,MAAM,EACN,SAAS,GAOV;IACC,OAAO,CACL,kBACE,SAAS,EAAE,2HAA2H,SAAS,EAAE,EACjJ,OAAO,EAAE,OAAO,iBACH,MAAM,aAEnB,YAAG,SAAS,EAAE,IAAI,GAAI,OAAE,KAAK,IACtB,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PictureField, PictureValue } from "./fieldTypes";
|
|
2
|
+
import { MediaPictureParams, PictureParams } from "./picture-shared";
|
|
3
|
+
export declare function PictureEditorDialog({ field, onCancel, onOk, params, }: {
|
|
4
|
+
field: PictureField;
|
|
5
|
+
onOk: (link: PictureValue) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
params?: PictureParams | MediaPictureParams;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|