@parhelia/core 0.1.10745
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/LICENSE +8 -0
- package/README.md +34 -0
- package/dev.css +3 -0
- package/dist/agents-view/AgentCard.d.ts +12 -0
- package/dist/agents-view/AgentCard.js +30 -0
- package/dist/agents-view/AgentCard.js.map +1 -0
- package/dist/agents-view/AgentsView.d.ts +5 -0
- package/dist/agents-view/AgentsView.js +255 -0
- package/dist/agents-view/AgentsView.js.map +1 -0
- package/dist/agents-view/ProfileAgentsGroup.d.ts +17 -0
- package/dist/agents-view/ProfileAgentsGroup.js +13 -0
- package/dist/agents-view/ProfileAgentsGroup.js.map +1 -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 +17 -0
- package/dist/client-components/index.js +18 -0
- package/dist/client-components/index.js.map +1 -0
- package/dist/components/ActionButton.d.ts +14 -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/FilterInput.d.ts +22 -0
- package/dist/components/FilterInput.js +29 -0
- package/dist/components/FilterInput.js.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/ui/CardConnector.d.ts +4 -0
- package/dist/components/ui/CardConnector.js +6 -0
- package/dist/components/ui/CardConnector.js.map +1 -0
- package/dist/components/ui/LanguageSelector.d.ts +8 -0
- package/dist/components/ui/LanguageSelector.js +47 -0
- package/dist/components/ui/LanguageSelector.js.map +1 -0
- package/dist/components/ui/PlaceholderInput.d.ts +41 -0
- package/dist/components/ui/PlaceholderInput.js +160 -0
- package/dist/components/ui/PlaceholderInput.js.map +1 -0
- package/dist/components/ui/PlaceholderInputTypes.d.ts +41 -0
- package/dist/components/ui/PlaceholderInputTypes.js +48 -0
- package/dist/components/ui/PlaceholderInputTypes.js.map +1 -0
- package/dist/components/ui/PlaceholderItemSelector.d.ts +7 -0
- package/dist/components/ui/PlaceholderItemSelector.js +154 -0
- package/dist/components/ui/PlaceholderItemSelector.js.map +1 -0
- package/dist/components/ui/alert.d.ts +7 -0
- package/dist/components/ui/alert.js +21 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +23 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +33 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +7 -0
- package/dist/components/ui/calendar.js +58 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +19 -0
- package/dist/components/ui/card.js +78 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +10 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/command.js +35 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +53 -0
- package/dist/components/ui/context-menu.js +290 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/copy-button.d.ts +10 -0
- package/dist/components/ui/copy-button.js +61 -0
- package/dist/components/ui/copy-button.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/dialog.js +37 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/dropdown-menu.js +52 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +9 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +26 -0
- package/dist/components/ui/menubar.js +55 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/paste-button.d.ts +14 -0
- package/dist/components/ui/paste-button.js +114 -0
- package/dist/components/ui/paste-button.js.map +1 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +66 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +7 -0
- package/dist/components/ui/progress.js +9 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/select.d.ts +18 -0
- package/dist/components/ui/select.js +34 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/sonner.js +16 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/switch.js +9 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +17 -0
- package/dist/components/ui/tabs.js +27 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +11 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +18 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/upload-button.d.ts +15 -0
- package/dist/components/ui/upload-button.js +56 -0
- package/dist/components/ui/upload-button.js.map +1 -0
- package/dist/config/config.d.ts +24 -0
- package/dist/config/config.js +1087 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/types.d.ts +249 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/editor/AspectRatioSelector.d.ts +13 -0
- package/dist/editor/AspectRatioSelector.js +71 -0
- package/dist/editor/AspectRatioSelector.js.map +1 -0
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +41 -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 +39 -0
- package/dist/editor/ContentTree.js +586 -0
- package/dist/editor/ContentTree.js.map +1 -0
- package/dist/editor/ContextMenu.d.ts +15 -0
- package/dist/editor/ContextMenu.js +239 -0
- package/dist/editor/ContextMenu.js.map +1 -0
- package/dist/editor/Editor.d.ts +12 -0
- package/dist/editor/Editor.js +59 -0
- package/dist/editor/Editor.js.map +1 -0
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +12 -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/FieldActionsOverlay.d.ts +18 -0
- package/dist/editor/FieldActionsOverlay.js +201 -0
- package/dist/editor/FieldActionsOverlay.js.map +1 -0
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +23 -0
- package/dist/editor/FieldEditorPopup.js.map +1 -0
- package/dist/editor/FieldHistory.d.ts +7 -0
- package/dist/editor/FieldHistory.js +42 -0
- package/dist/editor/FieldHistory.js.map +1 -0
- package/dist/editor/FieldList.d.ts +19 -0
- package/dist/editor/FieldList.js +90 -0
- package/dist/editor/FieldList.js.map +1 -0
- package/dist/editor/FieldListField.d.ts +16 -0
- package/dist/editor/FieldListField.js +231 -0
- package/dist/editor/FieldListField.js.map +1 -0
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +11 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +120 -0
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -0
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +91 -0
- package/dist/editor/FloatingToolbar.js.map +1 -0
- package/dist/editor/ImageEditButton.d.ts +27 -0
- package/dist/editor/ImageEditButton.js +22 -0
- package/dist/editor/ImageEditButton.js.map +1 -0
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +76 -0
- package/dist/editor/ImageEditor.js.map +1 -0
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +36 -0
- package/dist/editor/ItemInfo.js.map +1 -0
- package/dist/editor/LinkEditorDialog.d.ts +18 -0
- package/dist/editor/LinkEditorDialog.js +101 -0
- package/dist/editor/LinkEditorDialog.js.map +1 -0
- package/dist/editor/MainLayout.d.ts +12 -0
- package/dist/editor/MainLayout.js +55 -0
- package/dist/editor/MainLayout.js.map +1 -0
- package/dist/editor/MobileLayout.d.ts +2 -0
- package/dist/editor/MobileLayout.js +34 -0
- package/dist/editor/MobileLayout.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 +722 -0
- package/dist/editor/PictureCropper.js.map +1 -0
- package/dist/editor/PictureEditor.d.ts +9 -0
- package/dist/editor/PictureEditor.js +180 -0
- package/dist/editor/PictureEditor.js.map +1 -0
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +195 -0
- package/dist/editor/PictureEditorDialog.js.map +1 -0
- package/dist/editor/QuickItemSwitcher.d.ts +9 -0
- package/dist/editor/QuickItemSwitcher.js +78 -0
- package/dist/editor/QuickItemSwitcher.js.map +1 -0
- package/dist/editor/ScrollingContentTree.d.ts +10 -0
- package/dist/editor/ScrollingContentTree.js +54 -0
- package/dist/editor/ScrollingContentTree.js.map +1 -0
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +46 -0
- package/dist/editor/Titlebar.js.map +1 -0
- package/dist/editor/ai/AgentCostDisplay.d.ts +32 -0
- package/dist/editor/ai/AgentCostDisplay.js +93 -0
- package/dist/editor/ai/AgentCostDisplay.js.map +1 -0
- package/dist/editor/ai/AgentHistory.d.ts +11 -0
- package/dist/editor/ai/AgentHistory.js +12 -0
- package/dist/editor/ai/AgentHistory.js.map +1 -0
- package/dist/editor/ai/AgentProfilesOverview.d.ts +9 -0
- package/dist/editor/ai/AgentProfilesOverview.js +16 -0
- package/dist/editor/ai/AgentProfilesOverview.js.map +1 -0
- package/dist/editor/ai/AgentStatusBadge.d.ts +26 -0
- package/dist/editor/ai/AgentStatusBadge.js +126 -0
- package/dist/editor/ai/AgentStatusBadge.js.map +1 -0
- package/dist/editor/ai/AgentTerminal.d.ts +14 -0
- package/dist/editor/ai/AgentTerminal.js +2634 -0
- package/dist/editor/ai/AgentTerminal.js.map +1 -0
- package/dist/editor/ai/Agents.d.ts +4 -0
- package/dist/editor/ai/Agents.js +813 -0
- package/dist/editor/ai/Agents.js.map +1 -0
- package/dist/editor/ai/AiResponseMessage.d.ts +18 -0
- package/dist/editor/ai/AiResponseMessage.js +684 -0
- package/dist/editor/ai/AiResponseMessage.js.map +1 -0
- package/dist/editor/ai/ContextInfoBar.d.ts +11 -0
- package/dist/editor/ai/ContextInfoBar.js +355 -0
- package/dist/editor/ai/ContextInfoBar.js.map +1 -0
- package/dist/editor/ai/DancingDots.d.ts +1 -0
- package/dist/editor/ai/DancingDots.js +6 -0
- package/dist/editor/ai/DancingDots.js.map +1 -0
- package/dist/editor/ai/MediaImage.d.ts +6 -0
- package/dist/editor/ai/MediaImage.js +38 -0
- package/dist/editor/ai/MediaImage.js.map +1 -0
- package/dist/editor/ai/ToolCallDisplay.d.ts +45 -0
- package/dist/editor/ai/ToolCallDisplay.js +292 -0
- package/dist/editor/ai/ToolCallDisplay.js.map +1 -0
- package/dist/editor/ai/aiPageModel.d.ts +24 -0
- package/dist/editor/ai/aiPageModel.js +97 -0
- package/dist/editor/ai/aiPageModel.js.map +1 -0
- package/dist/editor/ai/editorAiContext.d.ts +10 -0
- package/dist/editor/ai/editorAiContext.js +10 -0
- package/dist/editor/ai/editorAiContext.js.map +1 -0
- package/dist/editor/ai/types.d.ts +30 -0
- package/dist/editor/ai/types.js +2 -0
- package/dist/editor/ai/types.js.map +1 -0
- package/dist/editor/ai/useAgentStatus.d.ts +14 -0
- package/dist/editor/ai/useAgentStatus.js +203 -0
- package/dist/editor/ai/useAgentStatus.js.map +1 -0
- package/dist/editor/client/AboutDialog.d.ts +2 -0
- package/dist/editor/client/AboutDialog.js +23 -0
- package/dist/editor/client/AboutDialog.js.map +1 -0
- package/dist/editor/client/EditorShell.d.ts +37 -0
- package/dist/editor/client/EditorShell.js +2388 -0
- package/dist/editor/client/EditorShell.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 +260 -0
- package/dist/editor/client/editContext.js +29 -0
- package/dist/editor/client/editContext.js.map +1 -0
- package/dist/editor/client/fieldModificationStore.d.ts +25 -0
- package/dist/editor/client/fieldModificationStore.js +184 -0
- package/dist/editor/client/fieldModificationStore.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/hooks/useEditorUrlSync.d.ts +18 -0
- package/dist/editor/client/hooks/useEditorUrlSync.js +56 -0
- package/dist/editor/client/hooks/useEditorUrlSync.js.map +1 -0
- package/dist/editor/client/hooks/useEditorWebSocket.d.ts +11 -0
- package/dist/editor/client/hooks/useEditorWebSocket.js +86 -0
- package/dist/editor/client/hooks/useEditorWebSocket.js.map +1 -0
- package/dist/editor/client/hooks/useGlobalEditorKeyDown.d.ts +1 -0
- package/dist/editor/client/hooks/useGlobalEditorKeyDown.js +12 -0
- package/dist/editor/client/hooks/useGlobalEditorKeyDown.js.map +1 -0
- package/dist/editor/client/hooks/useMediaQuery.d.ts +1 -0
- package/dist/editor/client/hooks/useMediaQuery.js +19 -0
- package/dist/editor/client/hooks/useMediaQuery.js.map +1 -0
- package/dist/editor/client/hooks/useMediaSelector.d.ts +12 -0
- package/dist/editor/client/hooks/useMediaSelector.js +30 -0
- package/dist/editor/client/hooks/useMediaSelector.js.map +1 -0
- package/dist/editor/client/hooks/useQuota.d.ts +29 -0
- package/dist/editor/client/hooks/useQuota.js +53 -0
- package/dist/editor/client/hooks/useQuota.js.map +1 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.d.ts +35 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.js +234 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -0
- package/dist/editor/client/hooks/useWorkbox.d.ts +9 -0
- package/dist/editor/client/hooks/useWorkbox.js +52 -0
- package/dist/editor/client/hooks/useWorkbox.js.map +1 -0
- package/dist/editor/client/itemsRepository.d.ts +38 -0
- package/dist/editor/client/itemsRepository.js +468 -0
- package/dist/editor/client/itemsRepository.js.map +1 -0
- package/dist/editor/client/operations.d.ts +69 -0
- package/dist/editor/client/operations.js +627 -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 +155 -0
- package/dist/editor/client/pageModelBuilder.js.map +1 -0
- package/dist/editor/client/ui/EditorChrome.d.ts +12 -0
- package/dist/editor/client/ui/EditorChrome.js +30 -0
- package/dist/editor/client/ui/EditorChrome.js.map +1 -0
- package/dist/editor/client/ui/FullscreenControls.d.ts +7 -0
- package/dist/editor/client/ui/FullscreenControls.js +21 -0
- package/dist/editor/client/ui/FullscreenControls.js.map +1 -0
- package/dist/editor/commands/agentCommands.d.ts +9 -0
- package/dist/editor/commands/agentCommands.js +30 -0
- package/dist/editor/commands/agentCommands.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 +12 -0
- package/dist/editor/commands/componentCommands.js +378 -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 +29 -0
- package/dist/editor/commands/itemCommands.js +428 -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 +91 -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/componentTreeHelper.d.ts +18 -0
- package/dist/editor/componentTreeHelper.js +123 -0
- package/dist/editor/componentTreeHelper.js.map +1 -0
- package/dist/editor/context-menu/CopyMoveMenu.d.ts +7 -0
- package/dist/editor/context-menu/CopyMoveMenu.js +58 -0
- package/dist/editor/context-menu/CopyMoveMenu.js.map +1 -0
- package/dist/editor/context-menu/InsertMenu.d.ts +9 -0
- package/dist/editor/context-menu/InsertMenu.js +229 -0
- package/dist/editor/context-menu/InsertMenu.js.map +1 -0
- package/dist/editor/control-center/About.d.ts +1 -0
- package/dist/editor/control-center/About.js +8 -0
- package/dist/editor/control-center/About.js.map +1 -0
- package/dist/editor/control-center/AllAgentsPanel.d.ts +5 -0
- package/dist/editor/control-center/AllAgentsPanel.js +126 -0
- package/dist/editor/control-center/AllAgentsPanel.js.map +1 -0
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +66 -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 +323 -0
- package/dist/editor/control-center/IndexOverview.js.map +1 -0
- package/dist/editor/control-center/Info.d.ts +1 -0
- package/dist/editor/control-center/Info.js +10 -0
- package/dist/editor/control-center/Info.js.map +1 -0
- package/dist/editor/control-center/LatestFeedback.d.ts +1 -0
- package/dist/editor/control-center/LatestFeedback.js +136 -0
- package/dist/editor/control-center/LatestFeedback.js.map +1 -0
- package/dist/editor/control-center/QuotaInfo.d.ts +1 -0
- package/dist/editor/control-center/QuotaInfo.js +102 -0
- package/dist/editor/control-center/QuotaInfo.js.map +1 -0
- package/dist/editor/control-center/Setup.d.ts +1 -0
- package/dist/editor/control-center/Setup.js +18 -0
- package/dist/editor/control-center/Setup.js.map +1 -0
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +79 -0
- package/dist/editor/control-center/Status.js.map +1 -0
- package/dist/editor/control-center/WebSocketMessages.d.ts +1 -0
- package/dist/editor/control-center/WebSocketMessages.js +71 -0
- package/dist/editor/control-center/WebSocketMessages.js.map +1 -0
- package/dist/editor/control-center/parhelia-setup/Overview.d.ts +1 -0
- package/dist/editor/control-center/parhelia-setup/Overview.js +91 -0
- package/dist/editor/control-center/parhelia-setup/Overview.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/EmbeddingsModelSection.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/EmbeddingsModelSection.js +195 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/EmbeddingsModelSection.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/index.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/index.js +22 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/index.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/provider/ProviderSection.d.ts +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/provider/ProviderSection.js +233 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/provider/ProviderSection.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersList.d.ts +15 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js +14 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.d.ts +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js +94 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.d.ts +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.js +367 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/tools/GenerateToolsSection.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/types.d.ts +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/types.js +2 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/types.js.map +1 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/utils.d.ts +4 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/utils.js +25 -0
- package/dist/editor/control-center/setup-steps/AiSetupStep/utils.js.map +1 -0
- package/dist/editor/control-center/setup-steps/DbSetupStep.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/DbSetupStep.js +46 -0
- package/dist/editor/control-center/setup-steps/DbSetupStep.js.map +1 -0
- package/dist/editor/control-center/setup-steps/IndexSetupStep.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/IndexSetupStep.js +36 -0
- package/dist/editor/control-center/setup-steps/IndexSetupStep.js.map +1 -0
- package/dist/editor/control-center/setup-steps/SettingsSetupStep.d.ts +2 -0
- package/dist/editor/control-center/setup-steps/SettingsSetupStep.js +107 -0
- package/dist/editor/control-center/setup-steps/SettingsSetupStep.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 +14 -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 +28 -0
- package/dist/editor/editor-warnings/ValidationErrors.js.map +1 -0
- package/dist/editor/field-types/AttachmentEditor.d.ts +9 -0
- package/dist/editor/field-types/AttachmentEditor.js +73 -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/DateFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/DateFieldEditor.js +93 -0
- package/dist/editor/field-types/DateFieldEditor.js.map +1 -0
- package/dist/editor/field-types/DateTimeFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/DateTimeFieldEditor.js +151 -0
- package/dist/editor/field-types/DateTimeFieldEditor.js.map +1 -0
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +42 -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 +46 -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 +120 -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 +62 -0
- package/dist/editor/field-types/LinkFieldEditor.js.map +1 -0
- package/dist/editor/field-types/MultiLineText.d.ts +7 -0
- package/dist/editor/field-types/MultiLineText.js +48 -0
- package/dist/editor/field-types/MultiLineText.js.map +1 -0
- package/dist/editor/field-types/NameValueListEditor.d.ts +7 -0
- package/dist/editor/field-types/NameValueListEditor.js +101 -0
- package/dist/editor/field-types/NameValueListEditor.js.map +1 -0
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +58 -0
- package/dist/editor/field-types/PictureFieldEditor.js.map +1 -0
- package/dist/editor/field-types/RawEditor.d.ts +6 -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 +7 -0
- package/dist/editor/field-types/RichTextEditor.js +21 -0
- package/dist/editor/field-types/RichTextEditor.js.map +1 -0
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +8 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +74 -0
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -0
- package/dist/editor/field-types/SingleLineText.d.ts +7 -0
- package/dist/editor/field-types/SingleLineText.js +113 -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 +316 -0
- package/dist/editor/field-types/TreeListEditor.js.map +1 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.d.ts +11 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.js +83 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.js.map +1 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.d.ts +5 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.js +607 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -0
- package/dist/editor/field-types/richtext/components/SimpleDropdown.d.ts +18 -0
- package/dist/editor/field-types/richtext/components/SimpleDropdown.js +71 -0
- package/dist/editor/field-types/richtext/components/SimpleDropdown.js.map +1 -0
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js +359 -0
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js.map +1 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbar.d.ts +16 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbar.js +181 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbar.js.map +1 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbarButton.d.ts +9 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbarButton.js +14 -0
- package/dist/editor/field-types/richtext/components/SimpleToolbarButton.js.map +1 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.d.ts +3 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.js +6 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.js.map +1 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.d.ts +19 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.js +17 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.js.map +1 -0
- package/dist/editor/field-types/richtext/contextMenuFactory.d.ts +4 -0
- package/dist/editor/field-types/richtext/contextMenuFactory.js +201 -0
- package/dist/editor/field-types/richtext/contextMenuFactory.js.map +1 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.d.ts +68 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js +214 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js.map +1 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.d.ts +25 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js +64 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js.map +1 -0
- package/dist/editor/field-types/richtext/index.d.ts +6 -0
- package/dist/editor/field-types/richtext/index.js +7 -0
- package/dist/editor/field-types/richtext/index.js.map +1 -0
- package/dist/editor/field-types/richtext/types.d.ts +288 -0
- package/dist/editor/field-types/richtext/types.js +107 -0
- package/dist/editor/field-types/richtext/types.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/conversion.d.ts +7 -0
- package/dist/editor/field-types/richtext/utils/conversion.js +762 -0
- package/dist/editor/field-types/richtext/utils/conversion.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/plugins.d.ts +170 -0
- package/dist/editor/field-types/richtext/utils/plugins.js +490 -0
- package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.d.ts +38 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.js +386 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.d.ts +37 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.js +119 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.js.map +1 -0
- package/dist/editor/fieldTypes.d.ts +129 -0
- package/dist/editor/fieldTypes.js +2 -0
- package/dist/editor/fieldTypes.js.map +1 -0
- package/dist/editor/hooks/useEditorSettings.d.ts +17 -0
- package/dist/editor/hooks/useEditorSettings.js +61 -0
- package/dist/editor/hooks/useEditorSettings.js.map +1 -0
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +164 -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 +57 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js.map +1 -0
- package/dist/editor/media-selector/MediaFolderBrowser.d.ts +5 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js +182 -0
- package/dist/editor/media-selector/MediaFolderBrowser.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 +19 -0
- package/dist/editor/media-selector/Preview.js.map +1 -0
- package/dist/editor/media-selector/Thumbnails.d.ts +8 -0
- package/dist/editor/media-selector/Thumbnails.js +10 -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 +183 -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 +81 -0
- package/dist/editor/media-selector/UploadZone.js.map +1 -0
- package/dist/editor/media-selector/index.d.ts +8 -0
- package/dist/editor/media-selector/index.js +9 -0
- package/dist/editor/media-selector/index.js.map +1 -0
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +120 -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 +13 -0
- package/dist/editor/menubar/ApproveAndPublish.js.map +1 -0
- package/dist/editor/menubar/FavoritesControls.d.ts +8 -0
- package/dist/editor/menubar/FavoritesControls.js +124 -0
- package/dist/editor/menubar/FavoritesControls.js.map +1 -0
- package/dist/editor/menubar/GenericToolbar.d.ts +11 -0
- package/dist/editor/menubar/GenericToolbar.js +10 -0
- package/dist/editor/menubar/GenericToolbar.js.map +1 -0
- package/dist/editor/menubar/ItemActionsMenu.d.ts +3 -0
- package/dist/editor/menubar/ItemActionsMenu.js +23 -0
- package/dist/editor/menubar/ItemActionsMenu.js.map +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +54 -0
- package/dist/editor/menubar/ItemLanguageVersion.js.map +1 -0
- package/dist/editor/menubar/ItemToolbar.d.ts +1 -0
- package/dist/editor/menubar/ItemToolbar.js +11 -0
- package/dist/editor/menubar/ItemToolbar.js.map +1 -0
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +40 -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 +149 -0
- package/dist/editor/menubar/PageSelector.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/ToolbarFactory.d.ts +2 -0
- package/dist/editor/menubar/ToolbarFactory.js +55 -0
- package/dist/editor/menubar/ToolbarFactory.js.map +1 -0
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +18 -0
- package/dist/editor/menubar/User.js.map +1 -0
- package/dist/editor/menubar/VersionSelector.d.ts +10 -0
- package/dist/editor/menubar/VersionSelector.js +53 -0
- package/dist/editor/menubar/VersionSelector.js.map +1 -0
- package/dist/editor/menubar/WorkflowButton.d.ts +1 -0
- package/dist/editor/menubar/WorkflowButton.js +93 -0
- package/dist/editor/menubar/WorkflowButton.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/CompareControls.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/CompareControls.js +11 -0
- package/dist/editor/menubar/toolbar-sections/CompareControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/EditControls.d.ts +7 -0
- package/dist/editor/menubar/toolbar-sections/EditControls.js +15 -0
- package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/InsertControls.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/InsertControls.js +15 -0
- package/dist/editor/menubar/toolbar-sections/InsertControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.js +41 -0
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/UtilityControls.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +17 -0
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/ViewportControls.d.ts +1 -0
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js +21 -0
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/index.d.ts +6 -0
- package/dist/editor/menubar/toolbar-sections/index.js +7 -0
- package/dist/editor/menubar/toolbar-sections/index.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +270 -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 +35 -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 +26 -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 +14 -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 +346 -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 +704 -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 +64 -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 +152 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +18 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +122 -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 +289 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlighting.js +224 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlighting.js.map +1 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +16 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/useInlineAICompletion.d.ts +7 -0
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +699 -0
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -0
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +21 -0
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -0
- package/dist/editor/page-viewer/EditorForm.d.ts +8 -0
- package/dist/editor/page-viewer/EditorForm.js +257 -0
- package/dist/editor/page-viewer/EditorForm.js.map +1 -0
- package/dist/editor/page-viewer/EditorFormPopup.d.ts +11 -0
- package/dist/editor/page-viewer/EditorFormPopup.js +41 -0
- package/dist/editor/page-viewer/EditorFormPopup.js.map +1 -0
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +233 -0
- package/dist/editor/page-viewer/MiniMap.js.map +1 -0
- package/dist/editor/page-viewer/PageViewer.d.ts +10 -0
- package/dist/editor/page-viewer/PageViewer.js +67 -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 +857 -0
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.d.ts +3 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js +339 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js.map +1 -0
- package/dist/editor/page-viewer/pageViewContext.d.ts +40 -0
- package/dist/editor/page-viewer/pageViewContext.js +156 -0
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -0
- package/dist/editor/pageModel.d.ts +222 -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 +8 -0
- package/dist/editor/reviews/Comment.js +162 -0
- package/dist/editor/reviews/Comment.js.map +1 -0
- package/dist/editor/reviews/CommentDisplayPopover.d.ts +9 -0
- package/dist/editor/reviews/CommentDisplayPopover.js +104 -0
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -0
- package/dist/editor/reviews/CommentEditor.d.ts +20 -0
- package/dist/editor/reviews/CommentEditor.js +57 -0
- package/dist/editor/reviews/CommentEditor.js.map +1 -0
- package/dist/editor/reviews/CommentPopover.d.ts +22 -0
- package/dist/editor/reviews/CommentPopover.js +145 -0
- package/dist/editor/reviews/CommentPopover.js.map +1 -0
- package/dist/editor/reviews/CommentView.d.ts +21 -0
- package/dist/editor/reviews/CommentView.js +52 -0
- package/dist/editor/reviews/CommentView.js.map +1 -0
- package/dist/editor/reviews/Comments.d.ts +3 -0
- package/dist/editor/reviews/Comments.js +118 -0
- package/dist/editor/reviews/Comments.js.map +1 -0
- package/dist/editor/reviews/DiffView.d.ts +17 -0
- package/dist/editor/reviews/DiffView.js +57 -0
- package/dist/editor/reviews/DiffView.js.map +1 -0
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +12 -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 +186 -0
- package/dist/editor/reviews/Reviews.js.map +1 -0
- package/dist/editor/reviews/SuggestedEdit.d.ts +4 -0
- package/dist/editor/reviews/SuggestedEdit.js +200 -0
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -0
- package/dist/editor/reviews/SuggestionDisplayPopover.d.ts +9 -0
- package/dist/editor/reviews/SuggestionDisplayPopover.js +204 -0
- package/dist/editor/reviews/SuggestionDisplayPopover.js.map +1 -0
- package/dist/editor/reviews/commentAi.d.ts +7 -0
- package/dist/editor/reviews/commentAi.js +100 -0
- package/dist/editor/reviews/commentAi.js.map +1 -0
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +38 -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/agentService.d.ts +306 -0
- package/dist/editor/services/agentService.js +627 -0
- package/dist/editor/services/agentService.js.map +1 -0
- package/dist/editor/services/aiService.d.ts +106 -0
- package/dist/editor/services/aiService.js +294 -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 +79 -0
- package/dist/editor/services/contentService.js +119 -0
- package/dist/editor/services/contentService.js.map +1 -0
- package/dist/editor/services/contextService.d.ts +26 -0
- package/dist/editor/services/contextService.js +103 -0
- package/dist/editor/services/contextService.js.map +1 -0
- package/dist/editor/services/editService.d.ts +66 -0
- package/dist/editor/services/editService.js +325 -0
- package/dist/editor/services/editService.js.map +1 -0
- package/dist/editor/services/favouritesService.d.ts +33 -0
- package/dist/editor/services/favouritesService.js +22 -0
- package/dist/editor/services/favouritesService.js.map +1 -0
- package/dist/editor/services/indexService.d.ts +13 -0
- package/dist/editor/services/indexService.js +45 -0
- package/dist/editor/services/indexService.js.map +1 -0
- package/dist/editor/services/reviewsService.d.ts +18 -0
- package/dist/editor/services/reviewsService.js +60 -0
- package/dist/editor/services/reviewsService.js.map +1 -0
- package/dist/editor/services/searchService.d.ts +17 -0
- package/dist/editor/services/searchService.js +25 -0
- package/dist/editor/services/searchService.js.map +1 -0
- package/dist/editor/services/serviceHelper.d.ts +10 -0
- package/dist/editor/services/serviceHelper.js +118 -0
- package/dist/editor/services/serviceHelper.js.map +1 -0
- package/dist/editor/services/setupService.d.ts +21 -0
- package/dist/editor/services/setupService.js +10 -0
- package/dist/editor/services/setupService.js.map +1 -0
- package/dist/editor/services/suggestedEditsService.d.ts +18 -0
- package/dist/editor/services/suggestedEditsService.js +36 -0
- package/dist/editor/services/suggestedEditsService.js.map +1 -0
- package/dist/editor/services/systemService.d.ts +4 -0
- package/dist/editor/services/systemService.js +11 -0
- package/dist/editor/services/systemService.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/Completions.d.ts +1 -0
- package/dist/editor/sidebar/Completions.js +55 -0
- package/dist/editor/sidebar/Completions.js.map +1 -0
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +86 -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 +691 -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 +71 -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/Divider.d.ts +6 -0
- package/dist/editor/sidebar/Divider.js +6 -0
- package/dist/editor/sidebar/Divider.js.map +1 -0
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +78 -0
- package/dist/editor/sidebar/EditHistory.js.map +1 -0
- package/dist/editor/sidebar/GraphQL.d.ts +2 -0
- package/dist/editor/sidebar/GraphQL.js +234 -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/LeftToolbar.d.ts +1 -0
- package/dist/editor/sidebar/LeftToolbar.js +16 -0
- package/dist/editor/sidebar/LeftToolbar.js.map +1 -0
- package/dist/editor/sidebar/MainContentTree.d.ts +5 -0
- package/dist/editor/sidebar/MainContentTree.js +70 -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/SEOInfo.d.ts +1 -0
- package/dist/editor/sidebar/SEOInfo.js +158 -0
- package/dist/editor/sidebar/SEOInfo.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 +10 -0
- package/dist/editor/sidebar/SidebarView.js +40 -0
- package/dist/editor/sidebar/SidebarView.js.map +1 -0
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +51 -0
- package/dist/editor/sidebar/Validation.js.map +1 -0
- package/dist/editor/sidebar/ViewSelector.d.ts +4 -0
- package/dist/editor/sidebar/ViewSelector.js +191 -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 +79 -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/CopyMoveTargetSelectorDialog.d.ts +10 -0
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js +38 -0
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.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/DragPreview.d.ts +14 -0
- package/dist/editor/ui/DragPreview.js +33 -0
- package/dist/editor/ui/DragPreview.js.map +1 -0
- package/dist/editor/ui/Icons.d.ts +74 -0
- package/dist/editor/ui/Icons.js +106 -0
- package/dist/editor/ui/Icons.js.map +1 -0
- package/dist/editor/ui/ItemList.d.ts +16 -0
- package/dist/editor/ui/ItemList.js +19 -0
- package/dist/editor/ui/ItemList.js.map +1 -0
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +68 -0
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -0
- package/dist/editor/ui/ItemSearch.d.ts +25 -0
- package/dist/editor/ui/ItemSearch.js +92 -0
- package/dist/editor/ui/ItemSearch.js.map +1 -0
- package/dist/editor/ui/PerfectTree.d.ts +78 -0
- package/dist/editor/ui/PerfectTree.js +858 -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 +12 -0
- package/dist/editor/ui/Section.js.map +1 -0
- package/dist/editor/ui/SimpleIconButton.d.ts +14 -0
- package/dist/editor/ui/SimpleIconButton.js +15 -0
- package/dist/editor/ui/SimpleIconButton.js.map +1 -0
- package/dist/editor/ui/SimpleMenu.d.ts +6 -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 +15 -0
- package/dist/editor/ui/SimpleTabs.js +20 -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 +4 -0
- package/dist/editor/ui/Spinner.js +18 -0
- package/dist/editor/ui/Spinner.js.map +1 -0
- package/dist/editor/ui/Splitter.d.ts +22 -0
- package/dist/editor/ui/Splitter.js +443 -0
- package/dist/editor/ui/Splitter.js.map +1 -0
- package/dist/editor/ui/TemplateSelectorDialog.d.ts +8 -0
- package/dist/editor/ui/TemplateSelectorDialog.js +61 -0
- package/dist/editor/ui/TemplateSelectorDialog.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/itemConverters.d.ts +3 -0
- package/dist/editor/utils/itemConverters.js +53 -0
- package/dist/editor/utils/itemConverters.js.map +1 -0
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +24 -0
- package/dist/editor/utils/itemutils.js.map +1 -0
- package/dist/editor/utils/jsonCleaner.d.ts +8 -0
- package/dist/editor/utils/jsonCleaner.js +76 -0
- package/dist/editor/utils/jsonCleaner.js.map +1 -0
- package/dist/editor/utils/keyboardNavigation.d.ts +34 -0
- package/dist/editor/utils/keyboardNavigation.js +237 -0
- package/dist/editor/utils/keyboardNavigation.js.map +1 -0
- package/dist/editor/utils/urlUtils.d.ts +9 -0
- package/dist/editor/utils/urlUtils.js +25 -0
- package/dist/editor/utils/urlUtils.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 +65 -0
- package/dist/editor/utils.js +468 -0
- package/dist/editor/utils.js.map +1 -0
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +148 -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 +29 -0
- package/dist/editor/views/ItemEditor.js.map +1 -0
- package/dist/editor/views/MediaFolderEditView.d.ts +4 -0
- package/dist/editor/views/MediaFolderEditView.js +40 -0
- package/dist/editor/views/MediaFolderEditView.js.map +1 -0
- package/dist/editor/views/ParheliaView.d.ts +5 -0
- package/dist/editor/views/ParheliaView.js +136 -0
- package/dist/editor/views/ParheliaView.js.map +1 -0
- package/dist/editor/views/SingleEditView.d.ts +9 -0
- package/dist/editor/views/SingleEditView.js +33 -0
- package/dist/editor/views/SingleEditView.js.map +1 -0
- package/dist/images/bg-shape-black.webp +0 -0
- package/dist/images/wizard-bg.png +0 -0
- package/dist/images/wizard-tour.png +0 -0
- package/dist/images/wizard.png +0 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/safelist.d.ts +1 -0
- package/dist/lib/safelist.js +5 -0
- package/dist/lib/safelist.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/revision.d.ts +2 -0
- package/dist/revision.js +3 -0
- package/dist/revision.js.map +1 -0
- package/dist/splash-screen/ModernSplashScreen.d.ts +8 -0
- package/dist/splash-screen/ModernSplashScreen.js +92 -0
- package/dist/splash-screen/ModernSplashScreen.js.map +1 -0
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +145 -0
- package/dist/splash-screen/NewPage.js.map +1 -0
- package/dist/splash-screen/OpenPage.d.ts +1 -0
- package/dist/splash-screen/OpenPage.js +56 -0
- package/dist/splash-screen/OpenPage.js.map +1 -0
- package/dist/splash-screen/ParheliaAssistantChat.d.ts +8 -0
- package/dist/splash-screen/ParheliaAssistantChat.js +155 -0
- package/dist/splash-screen/ParheliaAssistantChat.js.map +1 -0
- package/dist/splash-screen/RecentAgents.d.ts +7 -0
- package/dist/splash-screen/RecentAgents.js +76 -0
- package/dist/splash-screen/RecentAgents.js.map +1 -0
- package/dist/splash-screen/RecentPages.d.ts +1 -0
- package/dist/splash-screen/RecentPages.js +47 -0
- package/dist/splash-screen/RecentPages.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/styles.css +5914 -0
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +426 -0
- package/dist/tour/Tour.js.map +1 -0
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +302 -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 +93 -0
- package/dist/tour/preview-tour.js.map +1 -0
- package/dist/types.d.ts +396 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/images/bg-shape-black.webp +0 -0
- package/images/wizard-bg.png +0 -0
- package/images/wizard-tour.png +0 -0
- package/images/wizard.png +0 -0
- package/package.json +93 -0
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
import { Element as SlateElement } from 'slate';
|
|
2
|
+
import { SLATE_MARKS, SLATE_BLOCKS } from '../types';
|
|
3
|
+
import { normalizeUrl } from '../../../utils/urlUtils';
|
|
4
|
+
// Elements that should be completely preserved as raw HTML
|
|
5
|
+
const PRESERVE_AS_RAW_ELEMENTS = new Set([
|
|
6
|
+
'table', 'tbody', 'thead', 'tfoot', 'tr', 'td', 'th',
|
|
7
|
+
'svg', 'canvas', 'iframe', 'object', 'embed',
|
|
8
|
+
'form', 'input', 'textarea', 'select', 'button',
|
|
9
|
+
'video', 'audio', 'source', 'track',
|
|
10
|
+
'script', 'style', 'noscript'
|
|
11
|
+
]);
|
|
12
|
+
// Shared utility: Get default block type from profile with strict typing
|
|
13
|
+
const getDefaultBlockType = (blocks) => {
|
|
14
|
+
return blocks.length > 0 && blocks[0] ? blocks[0] : 'paragraph';
|
|
15
|
+
};
|
|
16
|
+
// Shared utility: Unescape HTML entities
|
|
17
|
+
const unescapeHtmlEntities = (text) => {
|
|
18
|
+
return text
|
|
19
|
+
.replace(/</g, '<')
|
|
20
|
+
.replace(/>/g, '>')
|
|
21
|
+
.replace(/"/g, '"')
|
|
22
|
+
.replace(/'/g, "'")
|
|
23
|
+
.replace(/&/g, '&'); // This should be last to avoid double-unescaping
|
|
24
|
+
};
|
|
25
|
+
// Simplified preservation check
|
|
26
|
+
const shouldPreserveAsRaw = (element) => {
|
|
27
|
+
const tagName = element.tagName.toLowerCase();
|
|
28
|
+
// Check if it's in the preserve list
|
|
29
|
+
if (PRESERVE_AS_RAW_ELEMENTS.has(tagName)) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
// Check if this element contains any elements that should be preserved
|
|
33
|
+
const containsPreserveElements = element.querySelector(Array.from(PRESERVE_AS_RAW_ELEMENTS).join(','));
|
|
34
|
+
if (containsPreserveElements) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
// Check for complex styling that would be hard to preserve
|
|
38
|
+
const style = element.getAttribute('style') || '';
|
|
39
|
+
const hasComplexStyling = style.includes('background-color') ||
|
|
40
|
+
style.includes('font-family') ||
|
|
41
|
+
style.includes('font-size') ||
|
|
42
|
+
style.includes('color:');
|
|
43
|
+
return hasComplexStyling && element.children.length > 0;
|
|
44
|
+
};
|
|
45
|
+
// Shared utility: Process marks from element with strict typing
|
|
46
|
+
const getMarksFromElement = (element, configuredMarks) => {
|
|
47
|
+
const marks = {};
|
|
48
|
+
// Map common tag names (including execCommand outputs) to mark IDs
|
|
49
|
+
const TAG_TO_MARK = {
|
|
50
|
+
b: 'bold',
|
|
51
|
+
strong: 'bold',
|
|
52
|
+
i: 'italic',
|
|
53
|
+
em: 'italic',
|
|
54
|
+
u: 'underline',
|
|
55
|
+
s: 'strikethrough',
|
|
56
|
+
strike: 'strikethrough',
|
|
57
|
+
sub: 'subscript',
|
|
58
|
+
sup: 'superscript',
|
|
59
|
+
// span handled via class check below (e.g., extrabold)
|
|
60
|
+
};
|
|
61
|
+
// Check for HTML tag-based marks (supports both semantic and legacy tags)
|
|
62
|
+
const tagName = element.tagName.toLowerCase();
|
|
63
|
+
const mapped = TAG_TO_MARK[tagName];
|
|
64
|
+
if (mapped) {
|
|
65
|
+
marks[mapped] = true;
|
|
66
|
+
}
|
|
67
|
+
// Also support the original config lookup (e.g., for custom tags)
|
|
68
|
+
else {
|
|
69
|
+
const markConfig = configuredMarks.find(markId => {
|
|
70
|
+
const config = SLATE_MARKS[markId];
|
|
71
|
+
return config && config.htmlTag === tagName;
|
|
72
|
+
});
|
|
73
|
+
if (markConfig) {
|
|
74
|
+
marks[markConfig] = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Class-based detection (e.g., extrabold span)
|
|
78
|
+
if (element.classList?.contains('extrabold')) {
|
|
79
|
+
marks['extrabold'] = true;
|
|
80
|
+
}
|
|
81
|
+
// Check for inline style-based marks
|
|
82
|
+
const style = element.getAttribute('style');
|
|
83
|
+
if (style) {
|
|
84
|
+
if (style.includes('font-weight: bold') || style.includes('font-weight:bold')) {
|
|
85
|
+
marks['bold'] = true;
|
|
86
|
+
}
|
|
87
|
+
if (style.includes('font-style: italic') || style.includes('font-style:italic')) {
|
|
88
|
+
marks['italic'] = true;
|
|
89
|
+
}
|
|
90
|
+
if (style.includes('text-decoration: underline') || style.includes('text-decoration:underline')) {
|
|
91
|
+
marks['underline'] = true;
|
|
92
|
+
}
|
|
93
|
+
if (style.includes('text-decoration: line-through') || style.includes('text-decoration:line-through')) {
|
|
94
|
+
marks['strikethrough'] = true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return marks;
|
|
98
|
+
};
|
|
99
|
+
// Enhanced htmlToSlate with better error handling and strict typing
|
|
100
|
+
export const htmlToSlate = (html, profile) => {
|
|
101
|
+
try {
|
|
102
|
+
return htmlToSlateInternal(html, profile);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
console.warn("HTML to Slate conversion failed:", error);
|
|
106
|
+
const defaultBlockType = getDefaultBlockType(profile.blocks);
|
|
107
|
+
return [{ type: defaultBlockType, children: [{ text: '' }] }];
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
// Enhanced htmlToSlate with result type for better error handling
|
|
111
|
+
export const htmlToSlateWithResult = (html, profile) => {
|
|
112
|
+
try {
|
|
113
|
+
const data = htmlToSlateInternal(html, profile);
|
|
114
|
+
return { success: true, data };
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
const defaultBlockType = getDefaultBlockType(profile.blocks);
|
|
118
|
+
const fallback = [{ type: defaultBlockType, children: [{ text: '' }] }];
|
|
119
|
+
return {
|
|
120
|
+
success: false,
|
|
121
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
122
|
+
fallback
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const htmlToSlateInternal = (html, profile) => {
|
|
127
|
+
const defaultBlockType = getDefaultBlockType(profile.blocks);
|
|
128
|
+
// Treat common empty HTML representations as empty Slate content
|
|
129
|
+
if (!html || html === '<p><br></p>' || html === '<br>') {
|
|
130
|
+
return [{ type: defaultBlockType, children: [{ text: '' }] }];
|
|
131
|
+
}
|
|
132
|
+
const div = document.createElement('div');
|
|
133
|
+
div.innerHTML = html;
|
|
134
|
+
const nodes = [];
|
|
135
|
+
// Determine block type for element with strict typing
|
|
136
|
+
const getBlockTypeForElement = (element) => {
|
|
137
|
+
const tagName = element.tagName.toLowerCase();
|
|
138
|
+
// Check if we have a configured block for this element
|
|
139
|
+
const matchingBlockId = profile.blocks.find(blockId => {
|
|
140
|
+
const blockConfig = SLATE_BLOCKS[blockId];
|
|
141
|
+
return blockConfig && blockConfig.htmlTag === tagName;
|
|
142
|
+
});
|
|
143
|
+
return matchingBlockId || defaultBlockType;
|
|
144
|
+
};
|
|
145
|
+
// Process list elements
|
|
146
|
+
const processListElement = (element, currentIndent = 0) => {
|
|
147
|
+
const tagName = element.tagName.toLowerCase();
|
|
148
|
+
const listType = tagName === 'ul' ? 'unordered' : 'ordered';
|
|
149
|
+
Array.from(element.children).forEach(child => {
|
|
150
|
+
if (child.tagName.toLowerCase() === 'li') {
|
|
151
|
+
const liElement = child;
|
|
152
|
+
const style = liElement.getAttribute('style') || '';
|
|
153
|
+
const alignMatch = style.match(/text-align:\s*([^;]+)/);
|
|
154
|
+
const align = alignMatch ? alignMatch[1] : undefined;
|
|
155
|
+
// Process text content and inline elements (excluding nested lists)
|
|
156
|
+
const children = processNodeWithInlinesExcludingNestedLists(liElement, profile.marks);
|
|
157
|
+
nodes.push({
|
|
158
|
+
type: 'list-item',
|
|
159
|
+
listType: listType,
|
|
160
|
+
indent: currentIndent,
|
|
161
|
+
align,
|
|
162
|
+
children: children.length > 0 ? children : [{ text: '' }]
|
|
163
|
+
});
|
|
164
|
+
// Process nested lists separately
|
|
165
|
+
Array.from(liElement.children).forEach(childEl => {
|
|
166
|
+
const childTagName = childEl.tagName.toLowerCase();
|
|
167
|
+
if (childTagName === 'ul' || childTagName === 'ol') {
|
|
168
|
+
processListElement(childEl, currentIndent + 1);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
// Process inline elements and text, excluding nested lists - with strict typing
|
|
175
|
+
const processNodeWithInlinesExcludingNestedLists = (element, configuredMarks) => {
|
|
176
|
+
const results = [];
|
|
177
|
+
const currentElementMarks = getMarksFromElement(element, configuredMarks);
|
|
178
|
+
Array.from(element.childNodes).forEach(child => {
|
|
179
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
180
|
+
if (child.textContent) {
|
|
181
|
+
results.push({
|
|
182
|
+
text: child.textContent,
|
|
183
|
+
...currentElementMarks
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else if (child.nodeType === Node.ELEMENT_NODE) {
|
|
188
|
+
const childElement = child;
|
|
189
|
+
const tagName = childElement.tagName.toLowerCase();
|
|
190
|
+
// Skip nested lists - they're processed separately
|
|
191
|
+
if (tagName === 'ul' || tagName === 'ol') {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (tagName === 'br') {
|
|
195
|
+
// Handle inline br elements as line-break elements
|
|
196
|
+
results.push({
|
|
197
|
+
type: 'line-break',
|
|
198
|
+
children: [{ text: '' }]
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
else if (tagName === 'a') {
|
|
202
|
+
const href = childElement.getAttribute('href') || '';
|
|
203
|
+
const target = childElement.getAttribute('target') || '_self';
|
|
204
|
+
const isInternal = childElement.hasAttribute('data-internal') ||
|
|
205
|
+
href.includes('~/link.aspx?_id=') ||
|
|
206
|
+
href.includes('/sitecore/service/notfound.aspx?item=');
|
|
207
|
+
let itemId = childElement.getAttribute('data-item-id') || '';
|
|
208
|
+
let targetItemLongId = childElement.getAttribute('data-item-longid') || '';
|
|
209
|
+
let queryString = childElement.getAttribute('data-querystring') || '';
|
|
210
|
+
// Parse standard Sitecore RTE format: ~/link.aspx?_id=GUID&_z=z
|
|
211
|
+
if (href.includes('~/link.aspx?_id=') && !itemId) {
|
|
212
|
+
// Decode HTML entities (e.g., & to &) before parsing
|
|
213
|
+
const decodedHref = href.replace(/&/g, '&');
|
|
214
|
+
const queryString_raw = decodedHref.split('?')[1];
|
|
215
|
+
const urlParams = new URLSearchParams(queryString_raw);
|
|
216
|
+
const id = urlParams.get('_id');
|
|
217
|
+
if (id) {
|
|
218
|
+
// Convert GUID format back to standard format with dashes
|
|
219
|
+
itemId = id.replace(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/, '$1-$2-$3-$4-$5').toLowerCase();
|
|
220
|
+
targetItemLongId = itemId;
|
|
221
|
+
// Extract other query parameters (excluding _id and _z)
|
|
222
|
+
const otherParams = Array.from(urlParams.entries())
|
|
223
|
+
.filter(([key]) => key !== '_id' && key !== '_z')
|
|
224
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
225
|
+
.join('&');
|
|
226
|
+
queryString = otherParams;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Parse Sitecore error page format: /sitecore/service/notfound.aspx?item=core:{GUID}@en
|
|
230
|
+
if (href.includes('/sitecore/service/notfound.aspx?item=') && !itemId) {
|
|
231
|
+
const urlParams = new URLSearchParams(href.split('?')[1]);
|
|
232
|
+
const itemParam = urlParams.get('item');
|
|
233
|
+
if (itemParam) {
|
|
234
|
+
// Decode URL encoding
|
|
235
|
+
const decodedItem = decodeURIComponent(itemParam);
|
|
236
|
+
// Extract GUID from format like: core:{B84A7A3D-8ED4-4336-BE4F-94D3C38C9E9F}@en
|
|
237
|
+
const guidMatch = decodedItem.match(/\{([A-F0-9-]{36})\}/i);
|
|
238
|
+
if (guidMatch && guidMatch[1]) {
|
|
239
|
+
itemId = guidMatch[1].toLowerCase();
|
|
240
|
+
targetItemLongId = itemId;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const linkChildren = processNodeWithInlines(childElement, configuredMarks);
|
|
245
|
+
const linkElement = {
|
|
246
|
+
type: 'link',
|
|
247
|
+
url: href,
|
|
248
|
+
link: {
|
|
249
|
+
type: isInternal ? 'internal' : 'external',
|
|
250
|
+
url: href,
|
|
251
|
+
target,
|
|
252
|
+
itemId,
|
|
253
|
+
targetItemLongId,
|
|
254
|
+
queryString,
|
|
255
|
+
originalHref: (href.includes('~/link.aspx?_id=') && !href.includes('/sitecore/service/notfound.aspx')) ? href : undefined // Preserve original Sitecore href, but not error pages
|
|
256
|
+
},
|
|
257
|
+
children: linkChildren.length ? linkChildren : [{ text: childElement.textContent || 'Link' }]
|
|
258
|
+
};
|
|
259
|
+
results.push(linkElement);
|
|
260
|
+
}
|
|
261
|
+
else if (tagName === 'link') {
|
|
262
|
+
// Handle Sitecore XML link tags
|
|
263
|
+
const linktype = childElement.getAttribute('linktype') || '';
|
|
264
|
+
const itemId = childElement.getAttribute('id') || '';
|
|
265
|
+
const target = childElement.getAttribute('target') || '_self';
|
|
266
|
+
const queryString = childElement.getAttribute('querystring') || '';
|
|
267
|
+
const url = childElement.getAttribute('url') || '';
|
|
268
|
+
const linkChildren = processNodeWithInlines(childElement, configuredMarks);
|
|
269
|
+
results.push({
|
|
270
|
+
type: 'link',
|
|
271
|
+
url: linktype === 'internal' ? '' : url,
|
|
272
|
+
link: {
|
|
273
|
+
type: linktype === 'internal' ? 'internal' : 'external',
|
|
274
|
+
url: linktype === 'internal' ? '' : url,
|
|
275
|
+
target,
|
|
276
|
+
itemId: linktype === 'internal' ? itemId : '',
|
|
277
|
+
targetItemLongId: linktype === 'internal' ? itemId : '',
|
|
278
|
+
queryString
|
|
279
|
+
},
|
|
280
|
+
children: linkChildren.length ? linkChildren : [{ text: childElement.textContent || 'Link' }]
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
else if (shouldPreserveAsRaw(childElement)) {
|
|
284
|
+
// Preserve complex elements as raw HTML
|
|
285
|
+
results.push({
|
|
286
|
+
text: childElement.outerHTML,
|
|
287
|
+
isRawHtml: true
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
// Process as regular inline element with marks
|
|
292
|
+
const childMarks = getMarksFromElement(childElement, configuredMarks);
|
|
293
|
+
const combinedMarks = { ...currentElementMarks, ...childMarks };
|
|
294
|
+
const childContent = processNodeWithInlines(childElement, configuredMarks);
|
|
295
|
+
childContent.forEach(node => {
|
|
296
|
+
if ('text' in node) {
|
|
297
|
+
Object.assign(node, combinedMarks);
|
|
298
|
+
}
|
|
299
|
+
results.push(node);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
return results;
|
|
305
|
+
};
|
|
306
|
+
// Process inline elements and text - with strict typing
|
|
307
|
+
const processNodeWithInlines = (element, configuredMarks) => {
|
|
308
|
+
const results = [];
|
|
309
|
+
const currentElementMarks = getMarksFromElement(element, configuredMarks);
|
|
310
|
+
Array.from(element.childNodes).forEach(child => {
|
|
311
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
312
|
+
if (child.textContent) {
|
|
313
|
+
results.push({
|
|
314
|
+
text: child.textContent,
|
|
315
|
+
...currentElementMarks
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
else if (child.nodeType === Node.ELEMENT_NODE) {
|
|
320
|
+
const childElement = child;
|
|
321
|
+
const tagName = childElement.tagName.toLowerCase();
|
|
322
|
+
if (tagName === 'br') {
|
|
323
|
+
// Handle inline br elements as line-break elements
|
|
324
|
+
results.push({
|
|
325
|
+
type: 'line-break',
|
|
326
|
+
children: [{ text: '' }]
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
else if (tagName === 'a') {
|
|
330
|
+
const href = childElement.getAttribute('href') || '';
|
|
331
|
+
const target = childElement.getAttribute('target') || '_self';
|
|
332
|
+
const isInternal = childElement.hasAttribute('data-internal') ||
|
|
333
|
+
href.includes('~/link.aspx?_id=') ||
|
|
334
|
+
href.includes('/sitecore/service/notfound.aspx?item=');
|
|
335
|
+
let itemId = childElement.getAttribute('data-item-id') || '';
|
|
336
|
+
let targetItemLongId = childElement.getAttribute('data-item-longid') || '';
|
|
337
|
+
let queryString = childElement.getAttribute('data-querystring') || '';
|
|
338
|
+
// Parse standard Sitecore RTE format: ~/link.aspx?_id=GUID&_z=z
|
|
339
|
+
if (href.includes('~/link.aspx?_id=') && !itemId) {
|
|
340
|
+
// Decode HTML entities (e.g., & to &) before parsing
|
|
341
|
+
const decodedHref = href.replace(/&/g, '&');
|
|
342
|
+
const queryString_raw = decodedHref.split('?')[1];
|
|
343
|
+
const urlParams = new URLSearchParams(queryString_raw);
|
|
344
|
+
const id = urlParams.get('_id');
|
|
345
|
+
if (id) {
|
|
346
|
+
// Convert GUID format back to standard format with dashes
|
|
347
|
+
itemId = id.replace(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/, '$1-$2-$3-$4-$5').toLowerCase();
|
|
348
|
+
targetItemLongId = itemId;
|
|
349
|
+
// Extract other query parameters (excluding _id and _z)
|
|
350
|
+
const otherParams = Array.from(urlParams.entries())
|
|
351
|
+
.filter(([key]) => key !== '_id' && key !== '_z')
|
|
352
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
353
|
+
.join('&');
|
|
354
|
+
queryString = otherParams;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
// Parse Sitecore error page format: /sitecore/service/notfound.aspx?item=core:{GUID}@en
|
|
358
|
+
if (href.includes('/sitecore/service/notfound.aspx?item=') && !itemId) {
|
|
359
|
+
const urlParams = new URLSearchParams(href.split('?')[1]);
|
|
360
|
+
const itemParam = urlParams.get('item');
|
|
361
|
+
if (itemParam) {
|
|
362
|
+
// Decode URL encoding
|
|
363
|
+
const decodedItem = decodeURIComponent(itemParam);
|
|
364
|
+
// Extract GUID from format like: core:{B84A7A3D-8ED4-4336-BE4F-94D3C38C9E9F}@en
|
|
365
|
+
const guidMatch = decodedItem.match(/\{([A-F0-9-]{36})\}/i);
|
|
366
|
+
if (guidMatch && guidMatch[1]) {
|
|
367
|
+
itemId = guidMatch[1].toLowerCase();
|
|
368
|
+
targetItemLongId = itemId;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const linkChildren = processNodeWithInlines(childElement, configuredMarks);
|
|
373
|
+
const linkElement = {
|
|
374
|
+
type: 'link',
|
|
375
|
+
url: href,
|
|
376
|
+
link: {
|
|
377
|
+
type: isInternal ? 'internal' : 'external',
|
|
378
|
+
url: href,
|
|
379
|
+
target,
|
|
380
|
+
itemId,
|
|
381
|
+
targetItemLongId,
|
|
382
|
+
queryString,
|
|
383
|
+
originalHref: (href.includes('~/link.aspx?_id=') && !href.includes('/sitecore/service/notfound.aspx')) ? href : undefined // Preserve original Sitecore href, but not error pages
|
|
384
|
+
},
|
|
385
|
+
children: linkChildren.length ? linkChildren : [{ text: childElement.textContent || 'Link' }]
|
|
386
|
+
};
|
|
387
|
+
results.push(linkElement);
|
|
388
|
+
}
|
|
389
|
+
else if (tagName === 'link') {
|
|
390
|
+
// Handle Sitecore XML link tags
|
|
391
|
+
const linktype = childElement.getAttribute('linktype') || '';
|
|
392
|
+
const itemId = childElement.getAttribute('id') || '';
|
|
393
|
+
const target = childElement.getAttribute('target') || '_self';
|
|
394
|
+
const queryString = childElement.getAttribute('querystring') || '';
|
|
395
|
+
const url = childElement.getAttribute('url') || '';
|
|
396
|
+
const linkChildren = processNodeWithInlines(childElement, configuredMarks);
|
|
397
|
+
results.push({
|
|
398
|
+
type: 'link',
|
|
399
|
+
url: linktype === 'internal' ? '' : url,
|
|
400
|
+
link: {
|
|
401
|
+
type: linktype === 'internal' ? 'internal' : 'external',
|
|
402
|
+
url: linktype === 'internal' ? '' : url,
|
|
403
|
+
target,
|
|
404
|
+
itemId: linktype === 'internal' ? itemId : '',
|
|
405
|
+
targetItemLongId: linktype === 'internal' ? itemId : '',
|
|
406
|
+
queryString
|
|
407
|
+
},
|
|
408
|
+
children: linkChildren.length ? linkChildren : [{ text: childElement.textContent || 'Link' }]
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
else if (tagName === 'ul' || tagName === 'ol' || shouldPreserveAsRaw(childElement)) {
|
|
412
|
+
// Preserve nested lists and complex elements as raw HTML
|
|
413
|
+
results.push({
|
|
414
|
+
text: childElement.outerHTML,
|
|
415
|
+
isRawHtml: true
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
// Process as regular inline element with marks
|
|
420
|
+
const childMarks = getMarksFromElement(childElement, configuredMarks);
|
|
421
|
+
const combinedMarks = { ...currentElementMarks, ...childMarks };
|
|
422
|
+
const childContent = processNodeWithInlines(childElement, configuredMarks);
|
|
423
|
+
childContent.forEach(node => {
|
|
424
|
+
if ('text' in node) {
|
|
425
|
+
Object.assign(node, combinedMarks);
|
|
426
|
+
}
|
|
427
|
+
results.push(node);
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
return results;
|
|
433
|
+
};
|
|
434
|
+
// Process top-level nodes
|
|
435
|
+
// First, check if we have mixed content (text and br elements) that should be combined
|
|
436
|
+
const topLevelNodes = Array.from(div.childNodes);
|
|
437
|
+
const hasMixedContent = topLevelNodes.some(node => (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()) ||
|
|
438
|
+
(node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'br'));
|
|
439
|
+
if (hasMixedContent && topLevelNodes.length > 1) {
|
|
440
|
+
// Combine mixed text and br elements into a single element
|
|
441
|
+
const combinedChildren = [];
|
|
442
|
+
topLevelNodes.forEach(node => {
|
|
443
|
+
if (node.nodeType === Node.TEXT_NODE && node.textContent) {
|
|
444
|
+
combinedChildren.push({ text: node.textContent });
|
|
445
|
+
}
|
|
446
|
+
else if (node.nodeType === Node.ELEMENT_NODE) {
|
|
447
|
+
const element = node;
|
|
448
|
+
const tagName = element.tagName.toLowerCase();
|
|
449
|
+
if (tagName === 'br') {
|
|
450
|
+
// Handle inline br elements as line-break elements
|
|
451
|
+
combinedChildren.push({
|
|
452
|
+
type: 'line-break',
|
|
453
|
+
children: [{ text: '' }]
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
// Process other inline elements
|
|
458
|
+
const inlineChildren = processNodeWithInlines(element, profile.marks);
|
|
459
|
+
combinedChildren.push(...inlineChildren);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
if (combinedChildren.length > 0) {
|
|
464
|
+
nodes.push({
|
|
465
|
+
type: defaultBlockType,
|
|
466
|
+
children: combinedChildren
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
// Process normally for single elements or non-mixed content
|
|
472
|
+
Array.from(div.childNodes).forEach(node => {
|
|
473
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
474
|
+
const element = node;
|
|
475
|
+
const tagName = element.tagName.toLowerCase();
|
|
476
|
+
// Extract alignment if present
|
|
477
|
+
const style = element.getAttribute('style') || '';
|
|
478
|
+
const alignMatch = style.match(/text-align:\s*([^;]+)/);
|
|
479
|
+
const align = alignMatch ? alignMatch[1] : undefined;
|
|
480
|
+
if (tagName === 'br') {
|
|
481
|
+
// Handle standalone br elements as line-break elements
|
|
482
|
+
nodes.push({
|
|
483
|
+
type: 'line-break',
|
|
484
|
+
children: [{ text: '' }]
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
else if (tagName === 'hr') {
|
|
488
|
+
// Handle horizontal rule elements
|
|
489
|
+
nodes.push({
|
|
490
|
+
type: 'horizontal-rule',
|
|
491
|
+
children: [{ text: '' }]
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
else if (tagName === 'ul' || tagName === 'ol') {
|
|
495
|
+
processListElement(element);
|
|
496
|
+
}
|
|
497
|
+
else if (tagName === 'li') {
|
|
498
|
+
// Handle standalone li elements
|
|
499
|
+
const parentTagName = element.parentElement?.tagName.toLowerCase();
|
|
500
|
+
const listType = parentTagName === 'ul' ? 'unordered' : parentTagName === 'ol' ? 'ordered' : 'unordered';
|
|
501
|
+
const children = processNodeWithInlines(element, profile.marks);
|
|
502
|
+
nodes.push({
|
|
503
|
+
type: 'list-item',
|
|
504
|
+
listType: listType,
|
|
505
|
+
indent: 0,
|
|
506
|
+
align,
|
|
507
|
+
children: children.length > 0 ? children : [{ text: '' }]
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
else if (shouldPreserveAsRaw(element)) {
|
|
511
|
+
// Preserve complex elements as raw HTML
|
|
512
|
+
nodes.push({
|
|
513
|
+
type: defaultBlockType,
|
|
514
|
+
children: [{ text: element.outerHTML, isRawHtml: true }]
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
const children = processNodeWithInlines(element, profile.marks);
|
|
519
|
+
const blockType = getBlockTypeForElement(element);
|
|
520
|
+
nodes.push({
|
|
521
|
+
type: blockType,
|
|
522
|
+
align,
|
|
523
|
+
children: children.length > 0 ? children : [{ text: '' }]
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
else if (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()) {
|
|
528
|
+
nodes.push({
|
|
529
|
+
type: defaultBlockType,
|
|
530
|
+
children: [{ text: node.textContent }]
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
return nodes.length > 0 ? nodes : [{ type: defaultBlockType, children: [{ text: '' }] }];
|
|
536
|
+
};
|
|
537
|
+
// Enhanced formatTextWithMarks with strict typing
|
|
538
|
+
export const formatTextWithMarks = (child, configuredMarks) => {
|
|
539
|
+
// If this is raw HTML, return it as-is with unescaping
|
|
540
|
+
if (child.isRawHtml) {
|
|
541
|
+
return unescapeHtmlEntities(child.text);
|
|
542
|
+
}
|
|
543
|
+
let text = child.text;
|
|
544
|
+
// Line breaks are now handled as elements, not text nodes
|
|
545
|
+
// Apply marks using Slate's built-in mark system with strict typing
|
|
546
|
+
configuredMarks.forEach(markId => {
|
|
547
|
+
const markConfig = SLATE_MARKS[markId];
|
|
548
|
+
if (markConfig && child[markId]) {
|
|
549
|
+
text = markConfig.renderHtml(text);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
return text;
|
|
553
|
+
};
|
|
554
|
+
// Enhanced slateToHtml with better error handling
|
|
555
|
+
export const slateToHtml = (value, profile) => {
|
|
556
|
+
try {
|
|
557
|
+
return slateToHtmlInternal(value, profile);
|
|
558
|
+
}
|
|
559
|
+
catch (error) {
|
|
560
|
+
console.warn("Slate to HTML conversion failed:", error);
|
|
561
|
+
return '';
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
// Enhanced slateToHtml with result type for better error handling
|
|
565
|
+
export const slateToHtmlWithResult = (value, profile) => {
|
|
566
|
+
try {
|
|
567
|
+
const data = slateToHtmlInternal(value, profile);
|
|
568
|
+
return { success: true, data };
|
|
569
|
+
}
|
|
570
|
+
catch (error) {
|
|
571
|
+
return {
|
|
572
|
+
success: false,
|
|
573
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
574
|
+
fallback: ''
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
const slateToHtmlInternal = (value, profile) => {
|
|
579
|
+
let html = '';
|
|
580
|
+
let i = 0;
|
|
581
|
+
const defaultBlockType = getDefaultBlockType(profile.blocks);
|
|
582
|
+
// Build nested list HTML
|
|
583
|
+
const buildNestedListHtml = (startIndex, targetIndent = 0) => {
|
|
584
|
+
let listHtml = '';
|
|
585
|
+
let currentIndex = startIndex;
|
|
586
|
+
// Find first element at target level to determine list type
|
|
587
|
+
let firstListType = 'unordered';
|
|
588
|
+
while (currentIndex < value.length) {
|
|
589
|
+
const element = value[currentIndex];
|
|
590
|
+
if (element.type !== 'list-item')
|
|
591
|
+
break;
|
|
592
|
+
const elementIndent = element.indent || 0;
|
|
593
|
+
if (elementIndent === targetIndent) {
|
|
594
|
+
firstListType = element.listType || 'unordered';
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
597
|
+
else if (elementIndent < targetIndent) {
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
currentIndex++;
|
|
601
|
+
}
|
|
602
|
+
const listTag = firstListType === 'ordered' ? 'ol' : 'ul';
|
|
603
|
+
listHtml += `<${listTag}>`;
|
|
604
|
+
currentIndex = startIndex;
|
|
605
|
+
while (currentIndex < value.length) {
|
|
606
|
+
const element = value[currentIndex];
|
|
607
|
+
if (element.type !== 'list-item')
|
|
608
|
+
break;
|
|
609
|
+
const elementIndent = element.indent || 0;
|
|
610
|
+
const elementListType = element.listType || 'unordered';
|
|
611
|
+
if (elementIndent < targetIndent)
|
|
612
|
+
break;
|
|
613
|
+
if (elementIndent === targetIndent && elementListType === firstListType) {
|
|
614
|
+
const processedChildren = processChildrenWithInlines(element.children, profile.marks);
|
|
615
|
+
listHtml += `<li>${processedChildren}`;
|
|
616
|
+
// Check for nested lists
|
|
617
|
+
if (currentIndex + 1 < value.length) {
|
|
618
|
+
const nextElement = value[currentIndex + 1];
|
|
619
|
+
if (nextElement.type === 'list-item' && (nextElement.indent || 0) > elementIndent) {
|
|
620
|
+
const nestedResult = buildNestedListHtml(currentIndex + 1, elementIndent + 1);
|
|
621
|
+
listHtml += nestedResult.html;
|
|
622
|
+
currentIndex = nestedResult.nextIndex - 1;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
listHtml += `</li>`;
|
|
626
|
+
currentIndex++;
|
|
627
|
+
}
|
|
628
|
+
else if (elementIndent > targetIndent) {
|
|
629
|
+
const nestedResult = buildNestedListHtml(currentIndex, elementIndent);
|
|
630
|
+
listHtml += nestedResult.html;
|
|
631
|
+
currentIndex = nestedResult.nextIndex;
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
listHtml += `</${listTag}>`;
|
|
638
|
+
return { html: listHtml, nextIndex: currentIndex };
|
|
639
|
+
};
|
|
640
|
+
// Process children with inline elements - with strict typing
|
|
641
|
+
const processChildrenWithInlines = (children, configuredMarks) => {
|
|
642
|
+
let result = '';
|
|
643
|
+
children.forEach(child => {
|
|
644
|
+
if (SlateElement.isElement(child)) {
|
|
645
|
+
if (child.type === 'line-break') {
|
|
646
|
+
// Handle inline line break elements
|
|
647
|
+
result += '<br>';
|
|
648
|
+
}
|
|
649
|
+
else if (child.type === 'link') {
|
|
650
|
+
const linkElement = child;
|
|
651
|
+
const isInternal = linkElement.link?.type === 'internal';
|
|
652
|
+
const linkText = linkElement.children?.map((c) => {
|
|
653
|
+
if (SlateElement.isElement(c)) {
|
|
654
|
+
return processChildrenWithInlines(c.children, configuredMarks);
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
const textNode = c;
|
|
658
|
+
return textNode.isRawHtml ? unescapeHtmlEntities(textNode.text) : formatTextWithMarks(textNode, configuredMarks);
|
|
659
|
+
}
|
|
660
|
+
}).join('') || '';
|
|
661
|
+
if (isInternal) {
|
|
662
|
+
const itemId = linkElement.link?.itemId || '';
|
|
663
|
+
const target = linkElement.link?.target || '_self';
|
|
664
|
+
const queryString = linkElement.link?.queryString || '';
|
|
665
|
+
const originalHref = linkElement.link?.originalHref;
|
|
666
|
+
let href;
|
|
667
|
+
if (originalHref) {
|
|
668
|
+
// Use original Sitecore RTE href to preserve exact format
|
|
669
|
+
href = originalHref;
|
|
670
|
+
}
|
|
671
|
+
else {
|
|
672
|
+
// Generate standard Sitecore RTE format for new links
|
|
673
|
+
href = `~/link.aspx?_id=${itemId.replace(/-/g, '').toUpperCase()}&_z=z`;
|
|
674
|
+
if (queryString) {
|
|
675
|
+
href += `&${queryString}`;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
result += `<a href="${href}" target="${target}">${linkText}</a>`;
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
const rawUrl = linkElement.url || linkElement.link?.url || '#';
|
|
682
|
+
const url = normalizeUrl(rawUrl);
|
|
683
|
+
const target = linkElement.link?.target || '_self';
|
|
684
|
+
const queryString = linkElement.link?.queryString || '';
|
|
685
|
+
result += `<a href="${url}" target="${target}" data-querystring="${queryString}">${linkText}</a>`;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
// Handle other element types
|
|
690
|
+
result += processChildrenWithInlines(child.children, configuredMarks);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
else {
|
|
694
|
+
// Regular text node
|
|
695
|
+
const textNode = child;
|
|
696
|
+
result += textNode.isRawHtml ? unescapeHtmlEntities(textNode.text) : formatTextWithMarks(textNode, configuredMarks);
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
return result;
|
|
700
|
+
};
|
|
701
|
+
// Process all elements
|
|
702
|
+
while (i < value.length) {
|
|
703
|
+
const element = value[i];
|
|
704
|
+
// Handle list items
|
|
705
|
+
if (element.type === 'list-item') {
|
|
706
|
+
const listResult = buildNestedListHtml(i, element.indent || 0);
|
|
707
|
+
html += listResult.html;
|
|
708
|
+
i = listResult.nextIndex;
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
const alignStyle = element.align ? ` style="text-align: ${element.align};"` : '';
|
|
712
|
+
// Handle horizontal rule elements
|
|
713
|
+
if (element.type === 'horizontal-rule') {
|
|
714
|
+
html += '<hr>';
|
|
715
|
+
}
|
|
716
|
+
else if (element.type === 'line-break') {
|
|
717
|
+
html += '<br>';
|
|
718
|
+
}
|
|
719
|
+
else if (element.type === 'preserved-element') {
|
|
720
|
+
// Handle preserved elements by restoring their original HTML
|
|
721
|
+
const preservedElement = element;
|
|
722
|
+
html += preservedElement.originalHtml;
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
const blockConfig = SLATE_BLOCKS[element.type];
|
|
726
|
+
if (blockConfig && profile.blocks.includes(element.type) && element.children) {
|
|
727
|
+
const processedChildren = processChildrenWithInlines(element.children, profile.marks);
|
|
728
|
+
html += blockConfig.renderHtml(processedChildren, alignStyle);
|
|
729
|
+
}
|
|
730
|
+
else {
|
|
731
|
+
// Fallback for unknown types
|
|
732
|
+
const processedChildren = processChildrenWithInlines(element.children, profile.marks);
|
|
733
|
+
const defaultBlockConfig = SLATE_BLOCKS[defaultBlockType];
|
|
734
|
+
if (defaultBlockConfig) {
|
|
735
|
+
html += defaultBlockConfig.renderHtml(processedChildren, alignStyle);
|
|
736
|
+
}
|
|
737
|
+
else if (defaultBlockType === 'no-tag') {
|
|
738
|
+
html += processedChildren;
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
html += `<p${alignStyle}>${processedChildren}</p>`;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
i++;
|
|
746
|
+
}
|
|
747
|
+
// Handle empty content
|
|
748
|
+
if (!html) {
|
|
749
|
+
const defaultBlockConfig = SLATE_BLOCKS[defaultBlockType];
|
|
750
|
+
if (defaultBlockConfig) {
|
|
751
|
+
return defaultBlockConfig.renderHtml('<br>', '');
|
|
752
|
+
}
|
|
753
|
+
else if (defaultBlockType === 'no-tag') {
|
|
754
|
+
return '<br>';
|
|
755
|
+
}
|
|
756
|
+
else {
|
|
757
|
+
return '<p><br></p>';
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
return html;
|
|
761
|
+
};
|
|
762
|
+
//# sourceMappingURL=conversion.js.map
|