@parhelia/core 0.1.12902 → 0.1.12904
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents-view/AgentCard.d.ts +4 -8
- package/dist/agents-view/AgentCard.js +175 -80
- package/dist/agents-view/AgentCard.js.map +1 -1
- package/dist/agents-view/AgentsInbox.d.ts +26 -0
- package/dist/agents-view/AgentsInbox.js +31 -0
- package/dist/agents-view/AgentsInbox.js.map +1 -0
- package/dist/agents-view/AgentsSidebar.d.ts +11 -4
- package/dist/agents-view/AgentsSidebar.js +14 -10
- package/dist/agents-view/AgentsSidebar.js.map +1 -1
- package/dist/agents-view/AgentsTitlebar.d.ts +3 -2
- package/dist/agents-view/AgentsTitlebar.js +7 -6
- package/dist/agents-view/AgentsTitlebar.js.map +1 -1
- package/dist/agents-view/AgentsView.d.ts +7 -27
- package/dist/agents-view/AgentsView.js +294 -126
- package/dist/agents-view/AgentsView.js.map +1 -1
- package/dist/agents-view/AgentsWorkspaceView.d.ts +1 -1
- package/dist/agents-view/AgentsWorkspaceView.js +102 -111
- package/dist/agents-view/AgentsWorkspaceView.js.map +1 -1
- package/dist/agents-view/CreateAgentView.d.ts +1 -1
- package/dist/agents-view/CreateAgentView.js +2 -2
- package/dist/agents-view/CreateAgentView.js.map +1 -1
- package/dist/agents-view/ProfileAgentsGroup.d.ts +4 -4
- package/dist/agents-view/ProfileAgentsGroup.js +10 -22
- package/dist/agents-view/ProfileAgentsGroup.js.map +1 -1
- 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/MarkdownDisplay.js +16 -29
- package/dist/components/MarkdownDisplay.js.map +1 -1
- package/dist/components/PageHeader.d.ts +1 -5
- package/dist/components/PageHeader.js +3 -3
- package/dist/components/PageHeader.js.map +1 -1
- package/dist/components/index.d.ts +2 -4
- package/dist/components/index.js +1 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/ui/LanguageSelector.d.ts +1 -6
- package/dist/components/ui/LanguageSelector.js +6 -10
- package/dist/components/ui/LanguageSelector.js.map +1 -1
- package/dist/components/ui/PlaceholderInput.d.ts +8 -0
- package/dist/components/ui/PlaceholderInput.js +43 -2
- package/dist/components/ui/PlaceholderInput.js.map +1 -1
- package/dist/components/ui/PlaceholderInputTypes.d.ts +1 -1
- package/dist/components/ui/PlaceholderInputTypes.js +1 -1
- package/dist/components/ui/PlaceholderInputTypes.js.map +1 -1
- package/dist/components/ui/PlaceholderItemSelector.js +3 -3
- package/dist/components/ui/PlaceholderItemSelector.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog.js +8 -8
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +2 -3
- package/dist/components/ui/alert.js +4 -9
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/badge.d.ts +3 -8
- package/dist/components/ui/badge.js +8 -18
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +1 -1
- package/dist/components/ui/breadcrumb.js +5 -5
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button.d.ts +4 -9
- package/dist/components/ui/button.js +14 -20
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/card.d.ts +1 -4
- package/dist/components/ui/card.js +4 -4
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/command.d.ts +1 -2
- package/dist/components/ui/command.js +4 -8
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +1 -15
- package/dist/components/ui/context-menu.js +65 -72
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/copy-button.js +3 -4
- package/dist/components/ui/copy-button.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/dialog.js +5 -6
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js +5 -5
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/input.js +2 -2
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js +1 -1
- 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.js +2 -2
- package/dist/components/ui/paste-button.js.map +1 -1
- package/dist/components/ui/popover.js +4 -22
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.js +2 -2
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/select.js +4 -3
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sonner.js +2 -28
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/styled-dialog-title.js +2 -2
- package/dist/components/ui/styled-dialog-title.js.map +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/tabs.js +3 -3
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/config/config.js +68 -232
- package/dist/config/config.js.map +1 -1
- package/dist/config/notificationRoutes.js +10 -111
- package/dist/config/notificationRoutes.js.map +1 -1
- package/dist/config/types/index.d.ts +2 -0
- package/dist/config/types/index.js +4 -0
- package/dist/config/types/index.js.map +1 -0
- package/dist/config/types/sidebar.d.ts +0 -4
- package/dist/config/types/workspace.d.ts +2 -13
- package/dist/config/types.d.ts +3 -17
- package/dist/config/types.js.map +1 -1
- package/dist/editor/AdminRequiredView.js +2 -4
- package/dist/editor/AdminRequiredView.js.map +1 -1
- package/dist/editor/AspectRatioSelector.js +5 -5
- package/dist/editor/AspectRatioSelector.js.map +1 -1
- package/dist/editor/ConcurrentUserLimitDialog.js +4 -11
- package/dist/editor/ConcurrentUserLimitDialog.js.map +1 -1
- package/dist/editor/ConfirmationDialog.js +2 -4
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/ContentTree.d.ts +1 -19
- package/dist/editor/ContentTree.js +27 -95
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/ContextMenu.d.ts +0 -1
- package/dist/editor/ContextMenu.js +11 -9
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/DeleteItemsWarning.js +2 -2
- package/dist/editor/DeleteItemsWarning.js.map +1 -1
- package/dist/editor/Editor.d.ts +1 -1
- package/dist/editor/Editor.js +9 -29
- package/dist/editor/Editor.js.map +1 -1
- package/dist/editor/EditorWarning.js +4 -4
- package/dist/editor/EditorWarning.js.map +1 -1
- package/dist/editor/FieldActionsOverlay.d.ts +1 -0
- package/dist/editor/FieldActionsOverlay.js +25 -8
- package/dist/editor/FieldActionsOverlay.js.map +1 -1
- package/dist/editor/FieldEditorPopup.js +2 -2
- package/dist/editor/FieldEditorPopup.js.map +1 -1
- package/dist/editor/FieldHistory.d.ts +1 -2
- package/dist/editor/FieldHistory.js +15 -23
- package/dist/editor/FieldHistory.js.map +1 -1
- package/dist/editor/FieldList.js +2 -2
- package/dist/editor/FieldList.js.map +1 -1
- package/dist/editor/FieldListField.d.ts +1 -1
- package/dist/editor/FieldListField.js +54 -59
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/FieldListFieldWithFallbacks.js +3 -4
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -1
- 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/GlobalMenuBar.js +19 -28
- package/dist/editor/GlobalMenuBar.js.map +1 -1
- package/dist/editor/ImageEditButton.js +3 -3
- package/dist/editor/ImageEditButton.js.map +1 -1
- package/dist/editor/ImageEditor.d.ts +1 -6
- package/dist/editor/ImageEditor.js +4 -21
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/ItemInfo.js +7 -10
- package/dist/editor/ItemInfo.js.map +1 -1
- package/dist/editor/LinkEditorDialog.d.ts +2 -9
- package/dist/editor/LinkEditorDialog.js +60 -183
- package/dist/editor/LinkEditorDialog.js.map +1 -1
- package/dist/editor/MainLayout.js +16 -121
- package/dist/editor/MainLayout.js.map +1 -1
- package/dist/editor/MigrationsView.js +35 -16
- package/dist/editor/MigrationsView.js.map +1 -1
- package/dist/editor/MobileLayout.js +3 -35
- package/dist/editor/MobileLayout.js.map +1 -1
- 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.js +36 -58
- package/dist/editor/PictureCropper.js.map +1 -1
- package/dist/editor/PictureEditor.d.ts +1 -2
- package/dist/editor/PictureEditor.js +19 -17
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +198 -0
- package/dist/editor/PictureEditorDialog.js.map +1 -0
- package/dist/editor/QuickItemSwitcher.js +9 -9
- package/dist/editor/QuickItemSwitcher.js.map +1 -1
- package/dist/editor/SetupLoadingScreen.d.ts +5 -0
- package/dist/editor/SetupLoadingScreen.js +11 -0
- package/dist/editor/SetupLoadingScreen.js.map +1 -0
- package/dist/editor/SetupWizard.js +4 -6
- package/dist/editor/SetupWizard.js.map +1 -1
- package/dist/editor/Titlebar.d.ts +1 -1
- package/dist/editor/Titlebar.js +2 -2
- package/dist/editor/Titlebar.js.map +1 -1
- package/dist/editor/ai/AgentBanners.js +16 -0
- package/dist/editor/ai/AgentBanners.js.map +1 -0
- package/dist/editor/ai/AgentCostDisplay.js +116 -0
- package/dist/editor/ai/AgentCostDisplay.js.map +1 -0
- package/dist/editor/ai/AgentDocumentList.d.ts +12 -0
- package/dist/editor/ai/AgentDocumentList.js +335 -0
- package/dist/editor/ai/AgentDocumentList.js.map +1 -0
- package/dist/editor/ai/AgentGreeting.d.ts +8 -0
- package/dist/editor/ai/AgentGreeting.js +14 -0
- package/dist/editor/ai/AgentGreeting.js.map +1 -0
- package/dist/editor/ai/AgentInlineDialogContent.js +2 -2
- package/dist/editor/ai/AgentInlineDialogContent.js.map +1 -1
- package/dist/editor/ai/AgentPanesGrid.js +7 -8
- package/dist/editor/ai/AgentPanesGrid.js.map +1 -1
- package/dist/editor/ai/AgentProfileSelector.d.ts +0 -1
- package/dist/editor/ai/AgentProfileSelector.js +9 -11
- package/dist/editor/ai/AgentProfileSelector.js.map +1 -1
- package/dist/editor/ai/AgentSharingSection.js +9 -22
- package/dist/editor/ai/AgentSharingSection.js.map +1 -1
- package/dist/editor/ai/AgentStatusBadge.js +21 -13
- package/dist/editor/ai/AgentStatusBadge.js.map +1 -1
- package/dist/editor/ai/AgentTerminal.d.ts +38 -2
- package/dist/editor/ai/AgentTerminal.js +6503 -6
- package/dist/editor/ai/AgentTerminal.js.map +1 -1
- package/dist/editor/ai/AgentTerminalStatusBar.d.ts +72 -0
- package/dist/editor/ai/AgentTerminalStatusBar.js +888 -0
- package/dist/editor/ai/AgentTerminalStatusBar.js.map +1 -0
- package/dist/editor/ai/Agents.js +397 -262
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/AiResponseMessage.d.ts +33 -0
- package/dist/editor/ai/AiResponseMessage.js +1239 -0
- package/dist/editor/ai/AiResponseMessage.js.map +1 -0
- package/dist/editor/ai/ContentInspectorPopover.js +19 -24
- package/dist/editor/ai/ContentInspectorPopover.js.map +1 -1
- package/dist/editor/ai/ContextInfoBar.d.ts +14 -0
- package/dist/editor/ai/ContextInfoBar.js +653 -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/EditOperationsPanel.d.ts +7 -0
- package/dist/editor/ai/EditOperationsPanel.js +91 -0
- package/dist/editor/ai/EditOperationsPanel.js.map +1 -0
- package/dist/editor/ai/GuidanceOverlay.js +19 -12
- package/dist/editor/ai/GuidanceOverlay.js.map +1 -1
- package/dist/editor/ai/HeartbeatDiagnosticsPanel.d.ts +2 -2
- package/dist/editor/ai/HeartbeatDiagnosticsPanel.js +31 -55
- package/dist/editor/ai/HeartbeatDiagnosticsPanel.js.map +1 -1
- package/dist/editor/ai/HeartbeatMessage.d.ts +4 -0
- package/dist/editor/ai/HeartbeatMessage.js +7 -0
- package/dist/editor/ai/HeartbeatMessage.js.map +1 -0
- package/dist/editor/ai/InitialThinkingSplash.d.ts +3 -0
- package/dist/editor/ai/InitialThinkingSplash.js +9 -0
- package/dist/editor/ai/InitialThinkingSplash.js.map +1 -0
- package/dist/editor/ai/InlineAiDialog.d.ts +0 -6
- package/dist/editor/ai/InlineAiDialog.js +277 -411
- package/dist/editor/ai/InlineAiDialog.js.map +1 -1
- package/dist/editor/ai/InlineAiTrigger.js +37 -242
- package/dist/editor/ai/InlineAiTrigger.js.map +1 -1
- package/dist/editor/ai/MediaImage.js +5 -5
- package/dist/editor/ai/MediaImage.js.map +1 -1
- package/dist/editor/ai/QueuedPromptsPanel.d.ts +4 -0
- package/dist/editor/ai/QueuedPromptsPanel.js +37 -0
- package/dist/editor/ai/QueuedPromptsPanel.js.map +1 -0
- package/dist/editor/ai/SpawnedAgentsPanel.d.ts +6 -0
- package/dist/editor/ai/SpawnedAgentsPanel.js +101 -0
- package/dist/editor/ai/SpawnedAgentsPanel.js.map +1 -0
- package/dist/editor/ai/TimeWithTooltip.js +4 -2
- package/dist/editor/ai/TimeWithTooltip.js.map +1 -1
- package/dist/editor/ai/TodoListPanel.d.ts +5 -0
- package/dist/editor/ai/TodoListPanel.js +113 -0
- package/dist/editor/ai/TodoListPanel.js.map +1 -0
- package/dist/editor/ai/ToolCallDisplay.js +865 -0
- package/dist/editor/ai/ToolCallDisplay.js.map +1 -0
- package/dist/editor/ai/UserMessage.d.ts +4 -0
- package/dist/editor/ai/UserMessage.js +42 -0
- package/dist/editor/ai/UserMessage.js.map +1 -0
- package/dist/editor/ai/agentDiagnostics.d.ts +0 -26
- package/dist/editor/ai/agentDiagnostics.js +1 -41
- package/dist/editor/ai/agentDiagnostics.js.map +1 -1
- package/dist/editor/ai/agentDiagnostics.test.js +181 -0
- package/dist/editor/ai/agentDiagnostics.test.js.map +1 -0
- package/dist/editor/ai/agentDialogRegistry.js.map +1 -1
- package/dist/editor/ai/agentMessageHelpers.js.map +1 -1
- package/dist/editor/ai/agentMessageMarkdown.js +10 -10
- package/dist/editor/ai/agentMessageMarkdown.js.map +1 -1
- package/dist/editor/ai/agentTodoExtraction.d.ts +1 -7
- package/dist/editor/ai/agentTodoExtraction.js +0 -33
- package/dist/editor/ai/agentTodoExtraction.js.map +1 -1
- package/dist/editor/ai/agentWatchdogStatusRegistry.d.ts +0 -1
- package/dist/editor/ai/agentWatchdogStatusRegistry.js.map +1 -1
- package/dist/editor/ai/dialogs/AgentDialogHandler.js +4 -2
- package/dist/editor/ai/dialogs/AgentDialogHandler.js.map +1 -1
- package/dist/editor/ai/dialogs/ComponentTypeSelectorInline.js +12 -13
- package/dist/editor/ai/dialogs/ComponentTypeSelectorInline.js.map +1 -1
- package/dist/editor/ai/dialogs/QuestionnaireInline.js +84 -58
- package/dist/editor/ai/dialogs/QuestionnaireInline.js.map +1 -1
- package/dist/editor/ai/dialogs/browserBoundCapture.js +2 -1
- package/dist/editor/ai/dialogs/browserBoundCapture.js.map +1 -1
- package/dist/editor/ai/dialogs/capturePageDom.js +35 -66
- package/dist/editor/ai/dialogs/capturePageDom.js.map +1 -1
- package/dist/editor/ai/dialogs/capturePageScreenshot.js +157 -281
- package/dist/editor/ai/dialogs/capturePageScreenshot.js.map +1 -1
- package/dist/editor/ai/types.d.ts +1 -1
- package/dist/editor/ai/useAgentPanes.js +2 -8
- package/dist/editor/ai/useAgentPanes.js.map +1 -1
- package/dist/editor/ai/useAgentPanes.test.d.ts +1 -0
- package/dist/editor/ai/useAgentPanes.test.js +198 -0
- package/dist/editor/ai/useAgentPanes.test.js.map +1 -0
- package/dist/editor/ai/useAgentStatus.js +1 -3
- package/dist/editor/ai/useAgentStatus.js.map +1 -1
- package/dist/editor/ai/useInlineAiPosition.d.ts +2 -10
- package/dist/editor/ai/useInlineAiPosition.js +86 -69
- package/dist/editor/ai/useInlineAiPosition.js.map +1 -1
- package/dist/editor/ai-image-editor/AiImageEditorDialog.js +17 -37
- package/dist/editor/ai-image-editor/AiImageEditorDialog.js.map +1 -1
- package/dist/editor/ai-image-editor/AiImageResultOverlay.js +64 -32
- package/dist/editor/ai-image-editor/AiImageResultOverlay.js.map +1 -1
- package/dist/editor/client/AboutDialog.js +6 -18
- package/dist/editor/client/AboutDialog.js.map +1 -1
- package/dist/editor/client/EditorShell.d.ts +2 -9
- package/dist/editor/client/EditorShell.js +252 -727
- package/dist/editor/client/EditorShell.js.map +1 -1
- 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/OperationDialogContent.js +3 -3
- package/dist/editor/client/OperationDialogContent.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +11 -108
- package/dist/editor/client/editContext.js +7 -3
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/fieldModificationStore.d.ts +2 -6
- package/dist/editor/client/fieldModificationStore.js +23 -38
- package/dist/editor/client/fieldModificationStore.js.map +1 -1
- package/dist/editor/client/helpers.js +3 -3
- package/dist/editor/client/helpers.js.map +1 -1
- package/dist/editor/client/hooks/useEditorWebSocket.d.ts +0 -3
- package/dist/editor/client/hooks/useEditorWebSocket.js +18 -224
- package/dist/editor/client/hooks/useEditorWebSocket.js.map +1 -1
- package/dist/editor/client/hooks/useMediaSelector.js.map +1 -1
- package/dist/editor/client/hooks/useSocketMessageHandler.d.ts +0 -4
- package/dist/editor/client/hooks/useSocketMessageHandler.js +86 -127
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
- package/dist/editor/client/hooks/useWorkbox.d.ts +0 -2
- package/dist/editor/client/hooks/useWorkbox.js +33 -76
- package/dist/editor/client/hooks/useWorkbox.js.map +1 -1
- package/dist/editor/client/itemsRepository.d.ts +5 -10
- package/dist/editor/client/itemsRepository.js +46 -48
- package/dist/editor/client/itemsRepository.js.map +1 -1
- package/dist/editor/client/operations.d.ts +3 -16
- package/dist/editor/client/operations.js +108 -306
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/client/pageModelBuilder.d.ts +0 -2
- package/dist/editor/client/pageModelBuilder.js +20 -89
- package/dist/editor/client/pageModelBuilder.js.map +1 -1
- package/dist/editor/client/ui/DevModeIndicator.js +1 -1
- package/dist/editor/client/ui/DevModeIndicator.js.map +1 -1
- package/dist/editor/client/ui/EditorChrome.js +4 -11
- package/dist/editor/client/ui/EditorChrome.js.map +1 -1
- package/dist/editor/client/ui/FullscreenControls.js +5 -5
- package/dist/editor/client/ui/FullscreenControls.js.map +1 -1
- package/dist/editor/client/waitForEditOperationTerminal.d.ts +0 -1
- package/dist/editor/client/waitForEditOperationTerminal.js +1 -1
- package/dist/editor/client/waitForEditOperationTerminal.js.map +1 -1
- package/dist/editor/commands/agentCommands.js +1 -1
- package/dist/editor/commands/agentCommands.js.map +1 -1
- package/dist/editor/commands/commands.js.map +1 -1
- package/dist/editor/commands/componentCommands.d.ts +3 -13
- package/dist/editor/commands/componentCommands.js +7 -77
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/commands/createVersionCommand.js +2 -6
- package/dist/editor/commands/createVersionCommand.js.map +1 -1
- package/dist/editor/commands/customCommandConverter.js +8 -10
- package/dist/editor/commands/customCommandConverter.js.map +1 -1
- package/dist/editor/commands/handlers/agentHandler.js.map +1 -1
- package/dist/editor/commands/handlers/uiActionHandlers.d.ts +0 -1
- package/dist/editor/commands/handlers/uiActionHandlers.js +3 -30
- package/dist/editor/commands/handlers/uiActionHandlers.js.map +1 -1
- package/dist/editor/commands/itemCommands.js +27 -24
- package/dist/editor/commands/itemCommands.js.map +1 -1
- package/dist/editor/commands/keyboardCommands.d.ts +0 -6
- package/dist/editor/commands/keyboardCommands.js +2 -78
- package/dist/editor/commands/keyboardCommands.js.map +1 -1
- 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/templateBuilderCommands.js.map +1 -1
- package/dist/editor/commands/undo.js +6 -10
- package/dist/editor/commands/undo.js.map +1 -1
- package/dist/editor/content-tree/IndicatorSettings.js +4 -5
- package/dist/editor/content-tree/IndicatorSettings.js.map +1 -1
- package/dist/editor/content-tree/TreeOptions.js +1 -1
- package/dist/editor/content-tree/TreeSettingsMenu.js +3 -7
- package/dist/editor/content-tree/TreeSettingsMenu.js.map +1 -1
- package/dist/editor/content-tree/index.d.ts +3 -0
- package/dist/editor/content-tree/index.js +4 -0
- package/dist/editor/content-tree/index.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.js +9 -9
- package/dist/editor/context-menu/InsertMenu.js.map +1 -1
- package/dist/editor/editor-warnings/FinalWorkflowStateReadOnly.js +0 -5
- package/dist/editor/editor-warnings/FinalWorkflowStateReadOnly.js.map +1 -1
- package/dist/editor/editor-warnings/ItemLocked.js +3 -6
- package/dist/editor/editor-warnings/ItemLocked.js.map +1 -1
- package/dist/editor/field-types/AttachmentEditor.js +3 -3
- package/dist/editor/field-types/AttachmentEditor.js.map +1 -1
- package/dist/editor/field-types/CheckboxEditor.js +1 -3
- package/dist/editor/field-types/CheckboxEditor.js.map +1 -1
- package/dist/editor/field-types/DateFieldEditor.js +1 -1
- package/dist/editor/field-types/DateFieldEditor.js.map +1 -1
- package/dist/editor/field-types/DateTimeFieldEditor.js +1 -1
- package/dist/editor/field-types/DateTimeFieldEditor.js.map +1 -1
- package/dist/editor/field-types/DropLinkEditor.js +16 -31
- package/dist/editor/field-types/DropLinkEditor.js.map +1 -1
- package/dist/editor/field-types/DropListEditor.js +1 -1
- package/dist/editor/field-types/DropListEditor.js.map +1 -1
- package/dist/editor/field-types/ImageFieldEditor.js +1 -1
- package/dist/editor/field-types/ImageFieldEditor.js.map +1 -1
- package/dist/editor/field-types/InternalLinkFieldEditor.js +9 -18
- package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -1
- package/dist/editor/field-types/LinkFieldEditor.js +3 -15
- package/dist/editor/field-types/LinkFieldEditor.js.map +1 -1
- package/dist/editor/field-types/MultiLineText.js +9 -35
- package/dist/editor/field-types/MultiLineText.js.map +1 -1
- package/dist/editor/field-types/NameValueListEditor.js +3 -7
- package/dist/editor/field-types/NameValueListEditor.js.map +1 -1
- package/dist/editor/field-types/PictureFieldEditor.js +13 -19
- package/dist/editor/field-types/PictureFieldEditor.js.map +1 -1
- package/dist/editor/field-types/RawEditor.js +2 -9
- package/dist/editor/field-types/RawEditor.js.map +1 -1
- package/dist/editor/field-types/RichTextEditor.js +10 -31
- package/dist/editor/field-types/RichTextEditor.js.map +1 -1
- package/dist/editor/field-types/RichTextEditorComponent.js +81 -194
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -1
- package/dist/editor/field-types/SingleLineText.js +5 -31
- package/dist/editor/field-types/SingleLineText.js.map +1 -1
- package/dist/editor/field-types/TreeListEditor.js +9 -72
- package/dist/editor/field-types/TreeListEditor.js.map +1 -1
- package/dist/editor/field-types/richtext/components/EditorDropdown.css +6 -7
- package/dist/editor/field-types/richtext/components/EditorDropdown.d.ts +5 -5
- package/dist/editor/field-types/richtext/components/EditorDropdown.js +20 -21
- package/dist/editor/field-types/richtext/components/EditorDropdown.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.css +31 -108
- package/dist/editor/field-types/richtext/components/ReactSlate.js +50 -240
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleDropdown.js +6 -11
- package/dist/editor/field-types/richtext/components/SimpleDropdown.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.css +16 -32
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js +2 -26
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleToolbar.js +4 -5
- package/dist/editor/field-types/richtext/components/SimpleToolbar.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleToolbarButton.js +2 -4
- package/dist/editor/field-types/richtext/components/SimpleToolbarButton.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ToolbarButton.js +3 -3
- package/dist/editor/field-types/richtext/components/ToolbarButton.js.map +1 -1
- package/dist/editor/field-types/richtext/config/pluginFactory.d.ts +1 -1
- package/dist/editor/field-types/richtext/config/pluginFactory.js +1 -1
- package/dist/editor/field-types/richtext/config/pluginFactory.js.map +1 -1
- package/dist/editor/field-types/richtext/contextMenuFactory.d.ts +14 -2
- package/dist/editor/field-types/richtext/contextMenuFactory.js +379 -4
- package/dist/editor/field-types/richtext/contextMenuFactory.js.map +1 -1
- package/dist/editor/field-types/richtext/hooks/useProfileCache.d.ts +1 -1
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js +19 -19
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js.map +1 -1
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.d.ts +2 -5
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js +13 -41
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js.map +1 -1
- package/dist/editor/field-types/richtext/types.d.ts +0 -2
- package/dist/editor/field-types/richtext/types.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/conversion.d.ts +2 -2
- package/dist/editor/field-types/richtext/utils/conversion.js +214 -298
- package/dist/editor/field-types/richtext/utils/conversion.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/plugins.js +69 -96
- package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/profileMapper.d.ts +1 -1
- package/dist/editor/field-types/richtext/utils/profileMapper.js +171 -186
- package/dist/editor/field-types/richtext/utils/profileMapper.js.map +1 -1
- package/dist/editor/field-types/textContextMenuFactory.js +1 -1
- package/dist/editor/field-types/textContextMenuFactory.js.map +1 -1
- package/dist/editor/fieldTypes.d.ts +0 -2
- package/dist/editor/hooks/useNavigationPanelLogic.d.ts +3 -3
- package/dist/editor/hooks/useNavigationPanelLogic.js +5 -5
- package/dist/editor/hooks/useNavigationPanelLogic.js.map +1 -1
- package/dist/editor/hooks/useParheliaSettings.js +7 -8
- package/dist/editor/hooks/useParheliaSettings.js.map +1 -1
- package/dist/editor/insertMenuItems.d.ts +0 -11
- package/dist/editor/insertMenuItems.js +1 -10
- package/dist/editor/insertMenuItems.js.map +1 -1
- package/dist/editor/manualActionEvents.js +1 -3
- package/dist/editor/manualActionEvents.js.map +1 -1
- package/dist/editor/media-selector/AiImageSearchPrompt.js +3 -3
- package/dist/editor/media-selector/MediaFolderBrowser.d.ts +1 -2
- package/dist/editor/media-selector/MediaFolderBrowser.js +30 -189
- package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -1
- package/dist/editor/media-selector/MediaSelector.js +2 -4
- package/dist/editor/media-selector/MediaSelector.js.map +1 -1
- package/dist/editor/media-selector/Preview.js +5 -9
- package/dist/editor/media-selector/Preview.js.map +1 -1
- package/dist/editor/media-selector/Thumbnails.js +3 -3
- package/dist/editor/media-selector/Thumbnails.js.map +1 -1
- package/dist/editor/media-selector/TreeSelector.js +27 -33
- package/dist/editor/media-selector/TreeSelector.js.map +1 -1
- package/dist/editor/media-selector/UploadZone.d.ts +1 -2
- package/dist/editor/media-selector/UploadZone.js +10 -22
- package/dist/editor/media-selector/UploadZone.js.map +1 -1
- package/dist/editor/menubar/ActiveUsers.js +36 -32
- package/dist/editor/menubar/ActiveUsers.js.map +1 -1
- 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.js +30 -51
- package/dist/editor/menubar/FavoritesControls.js.map +1 -1
- package/dist/editor/menubar/GenericToolbar.js +1 -2
- package/dist/editor/menubar/GenericToolbar.js.map +1 -1
- package/dist/editor/menubar/ItemActionsMenu.js +1 -1
- package/dist/editor/menubar/ItemActionsMenu.js.map +1 -1
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -4
- package/dist/editor/menubar/ItemLanguageVersion.js +18 -17
- package/dist/editor/menubar/ItemLanguageVersion.js.map +1 -1
- package/dist/editor/menubar/ItemToolbar.d.ts +1 -0
- package/dist/editor/menubar/ItemToolbar.js +12 -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.js +5 -11
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/menubar/PreviewDatePicker.js +21 -40
- package/dist/editor/menubar/PreviewDatePicker.js.map +1 -1
- package/dist/editor/menubar/Separator.d.ts +1 -2
- package/dist/editor/menubar/Separator.js +2 -2
- package/dist/editor/menubar/Separator.js.map +1 -1
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +27 -0
- package/dist/editor/menubar/SiteInfo.js.map +1 -0
- package/dist/editor/menubar/ToolbarFactory.js +19 -30
- package/dist/editor/menubar/ToolbarFactory.js.map +1 -1
- package/dist/editor/menubar/User.js +7 -2
- package/dist/editor/menubar/User.js.map +1 -1
- package/dist/editor/menubar/UserMenu.d.ts +5 -0
- package/dist/editor/menubar/UserMenu.js +33 -0
- package/dist/editor/menubar/UserMenu.js.map +1 -0
- package/dist/editor/menubar/VersionPreviewCard.js +231 -11
- package/dist/editor/menubar/VersionPreviewCard.js.map +1 -1
- package/dist/editor/menubar/VersionSelector.d.ts +2 -4
- package/dist/editor/menubar/VersionSelector.js +24 -70
- package/dist/editor/menubar/VersionSelector.js.map +1 -1
- package/dist/editor/menubar/WorkflowButton.js +28 -23
- package/dist/editor/menubar/WorkflowButton.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/CompareControls.js +1 -3
- package/dist/editor/menubar/toolbar-sections/CompareControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js +1 -1
- package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/EditControls.d.ts +2 -4
- package/dist/editor/menubar/toolbar-sections/EditControls.js +11 -82
- package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/InsertControls.js +1 -1
- package/dist/editor/menubar/toolbar-sections/InsertControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.d.ts +0 -22
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js +161 -935
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.js +1 -2
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UndoRedoControls.js +6 -10
- package/dist/editor/menubar/toolbar-sections/UndoRedoControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.d.ts +1 -3
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +4 -14
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ViewportControls.d.ts +0 -1
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js +38 -100
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/index.d.ts +2 -4
- package/dist/editor/menubar/toolbar-sections/index.js +2 -4
- package/dist/editor/menubar/toolbar-sections/index.js.map +1 -1
- package/dist/editor/notifications/NotificationCenter.d.ts +1 -4
- package/dist/editor/notifications/NotificationCenter.js +30 -41
- package/dist/editor/notifications/NotificationCenter.js.map +1 -1
- package/dist/editor/notifications/NotificationItem.js +15 -100
- package/dist/editor/notifications/NotificationItem.js.map +1 -1
- package/dist/editor/notifications/WatchButton.d.ts +4 -5
- package/dist/editor/notifications/WatchButton.js +61 -105
- package/dist/editor/notifications/WatchButton.js.map +1 -1
- package/dist/editor/notifications/notificationListState.js +1 -4
- package/dist/editor/notifications/notificationListState.js.map +1 -1
- package/dist/editor/notifications/notificationRoutes.js.map +1 -1
- package/dist/editor/notifications/useNotificationSubscriptions.d.ts +0 -8
- package/dist/editor/notifications/useNotificationSubscriptions.js +1 -25
- package/dist/editor/notifications/useNotificationSubscriptions.js.map +1 -1
- package/dist/editor/notifications/useNotifications.js +22 -58
- package/dist/editor/notifications/useNotifications.js.map +1 -1
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +316 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -6
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +11 -497
- package/dist/editor/page-editor-chrome/CommentHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +68 -30
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +3 -1
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +101 -38
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +3 -1
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +2 -2
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +4 -7
- package/dist/editor/page-editor-chrome/FrameMenu.js +228 -180
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +1 -1
- package/dist/editor/page-editor-chrome/FrameMenus.js +18 -67
- package/dist/editor/page-editor-chrome/FrameMenus.js.map +1 -1
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +832 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js.map +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +2 -3
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +20 -191
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/NoLayout.js +1 -1
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +2 -6
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +51 -73
- package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -1
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +147 -167
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +3 -34
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +65 -175
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -13
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +305 -120
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -1
- 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 -6
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +12 -304
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/VersionDiffHighlightings.d.ts +3 -1
- package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js +123 -160
- package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.d.ts +7 -0
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +728 -0
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +2 -2
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -1
- package/dist/editor/page-viewer/EditorForm.js +24 -55
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/page-viewer/EditorFormHintPopover.d.ts +2 -2
- package/dist/editor/page-viewer/EditorFormHintPopover.js +4 -4
- package/dist/editor/page-viewer/EditorFormHintPopover.js.map +1 -1
- package/dist/editor/page-viewer/MiniMap.d.ts +2 -29
- package/dist/editor/page-viewer/MiniMap.js +340 -375
- package/dist/editor/page-viewer/MiniMap.js.map +1 -1
- package/dist/editor/page-viewer/PageViewer.d.ts +2 -4
- package/dist/editor/page-viewer/PageViewer.js +21 -202
- package/dist/editor/page-viewer/PageViewer.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +7 -4
- package/dist/editor/page-viewer/PageViewerFrame.js +1270 -2255
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/RenderingParametersSection.js +7 -13
- package/dist/editor/page-viewer/RenderingParametersSection.js.map +1 -1
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.d.ts +3 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js +423 -0
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js.map +1 -0
- package/dist/editor/page-viewer/pageViewContext.d.ts +0 -35
- package/dist/editor/page-viewer/pageViewContext.js +3 -40
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -1
- package/dist/editor/pageModel.d.ts +0 -4
- package/dist/editor/pageModel.js +1 -12
- package/dist/editor/pageModel.js.map +1 -1
- package/dist/editor/personalization/ActionList.js +2 -2
- package/dist/editor/personalization/ActionList.js.map +1 -1
- package/dist/editor/personalization/ConditionTreeEditor.js +9 -9
- package/dist/editor/personalization/ConditionTreeEditor.js.map +1 -1
- package/dist/editor/personalization/PersonalizationPanel.d.ts +1 -3
- package/dist/editor/personalization/PersonalizationPanel.js +18 -39
- package/dist/editor/personalization/PersonalizationPanel.js.map +1 -1
- package/dist/editor/personalization/RuleElementPicker.js +4 -5
- package/dist/editor/personalization/RuleElementPicker.js.map +1 -1
- package/dist/editor/personalization/RuleList.js +10 -13
- package/dist/editor/personalization/RuleList.js.map +1 -1
- package/dist/editor/personalization/RuleParameterInput.js +7 -10
- package/dist/editor/personalization/RuleParameterInput.js.map +1 -1
- package/dist/editor/personalization/TreeItemPicker.js +6 -4
- package/dist/editor/personalization/TreeItemPicker.js.map +1 -1
- package/dist/editor/personalization/utils.js.map +1 -1
- 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/registry/SidebarRegistry.d.ts +96 -0
- package/dist/editor/registry/SidebarRegistry.js +166 -0
- package/dist/editor/registry/SidebarRegistry.js.map +1 -0
- package/dist/editor/registry/WorkspaceRegistry.d.ts +71 -0
- package/dist/editor/registry/WorkspaceRegistry.js +112 -0
- package/dist/editor/registry/WorkspaceRegistry.js.map +1 -0
- package/dist/editor/registry/index.d.ts +2 -0
- package/dist/editor/registry/index.js +4 -0
- package/dist/editor/registry/index.js.map +1 -0
- package/dist/editor/reviews/Comment.d.ts +1 -6
- package/dist/editor/reviews/Comment.js +103 -64
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/reviews/CommentDisplayPopover.js +78 -244
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/CommentEditor.d.ts +2 -7
- package/dist/editor/reviews/CommentEditor.js +8 -45
- package/dist/editor/reviews/CommentEditor.js.map +1 -1
- package/dist/editor/reviews/CommentPopover.d.ts +0 -4
- package/dist/editor/reviews/CommentPopover.js +15 -92
- package/dist/editor/reviews/CommentPopover.js.map +1 -1
- package/dist/editor/reviews/CommentView.d.ts +1 -4
- package/dist/editor/reviews/CommentView.js +38 -60
- package/dist/editor/reviews/CommentView.js.map +1 -1
- package/dist/editor/reviews/Comments.d.ts +2 -0
- package/dist/editor/reviews/Comments.js +51 -269
- package/dist/editor/reviews/Comments.js.map +1 -1
- package/dist/editor/reviews/CommentsAndFeedback.d.ts +8 -2
- package/dist/editor/reviews/CommentsAndFeedback.js +43 -10
- package/dist/editor/reviews/CommentsAndFeedback.js.map +1 -1
- package/dist/editor/reviews/CreateReviewConfirmStep.js +2 -2
- package/dist/editor/reviews/CreateReviewConfirmStep.js.map +1 -1
- package/dist/editor/reviews/CreateReviewDetailsStep.js +9 -9
- package/dist/editor/reviews/CreateReviewDetailsStep.js.map +1 -1
- package/dist/editor/reviews/CreateReviewDialog.js +1 -1
- package/dist/editor/reviews/CreateReviewDialog.js.map +1 -1
- package/dist/editor/reviews/CreateReviewSuccessStep.js +2 -2
- package/dist/editor/reviews/CreateReviewSuccessStep.js.map +1 -1
- package/dist/editor/reviews/DecisionsMatrix.js +26 -34
- package/dist/editor/reviews/DecisionsMatrix.js.map +1 -1
- package/dist/editor/reviews/DiffView.js +6 -6
- package/dist/editor/reviews/DiffView.js.map +1 -1
- package/dist/editor/reviews/EditReviewSettingsDialog.js +54 -68
- package/dist/editor/reviews/EditReviewSettingsDialog.js.map +1 -1
- package/dist/editor/reviews/ItemTreeSelector.js +1 -1
- package/dist/editor/reviews/ItemTreeSelector.js.map +1 -1
- package/dist/editor/reviews/LatestFeedback.js +49 -26
- package/dist/editor/reviews/LatestFeedback.js.map +1 -1
- package/dist/editor/reviews/PagesPanel.d.ts +21 -0
- package/dist/editor/reviews/PagesPanel.js +140 -0
- package/dist/editor/reviews/PagesPanel.js.map +1 -0
- package/dist/editor/reviews/PreconfiguredReviewerSelector.js +1 -1
- package/dist/editor/reviews/PreconfiguredReviewerSelector.js.map +1 -1
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +9 -0
- package/dist/editor/reviews/PreviewInfo.js.map +1 -0
- package/dist/editor/reviews/ReviewCard.js +11 -12
- package/dist/editor/reviews/ReviewCard.js.map +1 -1
- package/dist/editor/reviews/ReviewDetail.js +5 -5
- package/dist/editor/reviews/ReviewDetail.js.map +1 -1
- package/dist/editor/reviews/ReviewersPanel.js +19 -33
- package/dist/editor/reviews/ReviewersPanel.js.map +1 -1
- package/dist/editor/reviews/ReviewsList.js +3 -4
- package/dist/editor/reviews/ReviewsList.js.map +1 -1
- package/dist/editor/reviews/SuggestedEdit.d.ts +1 -4
- package/dist/editor/reviews/SuggestedEdit.js +61 -101
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -1
- package/dist/editor/reviews/SuggestionDisplayPopover.js +47 -45
- package/dist/editor/reviews/SuggestionDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/commentAi.js +27 -96
- package/dist/editor/reviews/commentAi.js.map +1 -1
- package/dist/editor/reviews/reviewCommands.js +2 -2
- package/dist/editor/reviews/reviewCommands.js.map +1 -1
- package/dist/editor/reviews/useMultiReview.js +4 -5
- package/dist/editor/reviews/useMultiReview.js.map +1 -1
- package/dist/editor/services/agentDialogService.test.d.ts +1 -0
- package/dist/editor/services/agentDialogService.test.js +56 -0
- package/dist/editor/services/agentDialogService.test.js.map +1 -0
- package/dist/editor/services/agentService.d.ts +3 -59
- package/dist/editor/services/agentService.js +12 -82
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/agentStatus.js +1 -1
- package/dist/editor/services/agentStatus.js.map +1 -1
- package/dist/editor/services/agentSubscriptionRegistry.js +13 -12
- package/dist/editor/services/agentSubscriptionRegistry.js.map +1 -1
- package/dist/editor/services/agentSubscriptionRegistry.test.d.ts +1 -0
- package/dist/editor/services/agentSubscriptionRegistry.test.js +104 -0
- package/dist/editor/services/agentSubscriptionRegistry.test.js.map +1 -0
- package/dist/editor/services/aiService.d.ts +38 -8
- package/dist/editor/services/aiService.js +64 -7
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/contentService.d.ts +1 -6
- package/dist/editor/services/contentService.js +20 -7
- package/dist/editor/services/contentService.js.map +1 -1
- package/dist/editor/services/contextService.js.map +1 -1
- package/dist/editor/services/customCommandsService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +0 -4
- package/dist/editor/services/editService.js +3 -5
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/services/indexService.js.map +1 -1
- package/dist/editor/services/indicatorService.js.map +1 -1
- package/dist/editor/services/localStorageService.js +3 -3
- package/dist/editor/services/localStorageService.js.map +1 -1
- package/dist/editor/services/notificationService.d.ts +0 -4
- package/dist/editor/services/notificationService.js +1 -5
- package/dist/editor/services/notificationService.js.map +1 -1
- package/dist/editor/services/personalizationService.js.map +1 -1
- package/dist/editor/services/reviewsService.d.ts +3 -6
- package/dist/editor/services/reviewsService.js +2 -10
- package/dist/editor/services/reviewsService.js.map +1 -1
- package/dist/editor/services/serviceHelper.d.ts +0 -8
- package/dist/editor/services/serviceHelper.js +0 -59
- package/dist/editor/services/serviceHelper.js.map +1 -1
- package/dist/editor/services/suggestedEditsService.js.map +1 -1
- package/dist/editor/services/systemService.d.ts +0 -49
- package/dist/editor/services/systemService.js +0 -32
- package/dist/editor/services/systemService.js.map +1 -1
- package/dist/editor/services/templateBuilderService.js +6 -5
- package/dist/editor/services/templateBuilderService.js.map +1 -1
- package/dist/editor/services-server/api.d.ts +18 -0
- package/dist/editor/services-server/api.js +116 -0
- package/dist/editor/services-server/api.js.map +1 -0
- package/dist/editor/settings/About.js +32 -219
- package/dist/editor/settings/About.js.map +1 -1
- package/dist/editor/settings/IndexOverview.js +9 -10
- package/dist/editor/settings/IndexOverview.js.map +1 -1
- package/dist/editor/settings/Info.d.ts +1 -0
- package/dist/editor/settings/Info.js +11 -0
- package/dist/editor/settings/Info.js.map +1 -0
- package/dist/editor/settings/QuotaInfo.js +69 -90
- package/dist/editor/settings/QuotaInfo.js.map +1 -1
- package/dist/editor/settings/QuotaUserPicker.js +55 -15
- package/dist/editor/settings/QuotaUserPicker.js.map +1 -1
- package/dist/editor/settings/SettingsBreadcrumb.d.ts +6 -3
- package/dist/editor/settings/SettingsBreadcrumb.js +2 -18
- package/dist/editor/settings/SettingsBreadcrumb.js.map +1 -1
- package/dist/editor/settings/SettingsHeaderActionsContext.d.ts +3 -9
- package/dist/editor/settings/SettingsHeaderActionsContext.js +6 -6
- package/dist/editor/settings/SettingsHeaderActionsContext.js.map +1 -1
- package/dist/editor/settings/SettingsView.js +28 -25
- package/dist/editor/settings/SettingsView.js.map +1 -1
- package/dist/editor/settings/Status.d.ts +1 -0
- package/dist/editor/settings/Status.js +89 -0
- package/dist/editor/settings/Status.js.map +1 -0
- package/dist/editor/settings/StatusSummary.js +27 -17
- package/dist/editor/settings/StatusSummary.js.map +1 -1
- package/dist/editor/settings/WebSocketMessages.d.ts +1 -0
- package/dist/editor/settings/WebSocketMessages.js +74 -0
- package/dist/editor/settings/WebSocketMessages.js.map +1 -0
- package/dist/editor/settings/index/AdvancedSettings.d.ts +1 -1
- package/dist/editor/settings/index/AdvancedSettings.js +11 -13
- package/dist/editor/settings/index/AdvancedSettings.js.map +1 -1
- package/dist/editor/settings/index/CollectionWarningsDisplay.js +1 -1
- package/dist/editor/settings/index/CollectionWarningsDisplay.js.map +1 -1
- package/dist/editor/settings/index/EmbeddingProviderInfo.js +5 -7
- package/dist/editor/settings/index/EmbeddingProviderInfo.js.map +1 -1
- package/dist/editor/settings/index/IndexStatusCards.js +2 -3
- package/dist/editor/settings/index/IndexStatusCards.js.map +1 -1
- package/dist/editor/settings/index/LatestEmbeddingsList.js +1 -3
- package/dist/editor/settings/index/LatestEmbeddingsList.js.map +1 -1
- package/dist/editor/settings/index/QueueErrorsDisplay.js +1 -1
- package/dist/editor/settings/index/QueueErrorsDisplay.js.map +1 -1
- package/dist/editor/settings/index/RebuildIndexSection.js +22 -24
- package/dist/editor/settings/index/RebuildIndexSection.js.map +1 -1
- package/dist/editor/settings/index/RecentBatchesList.js +18 -20
- package/dist/editor/settings/index/RecentBatchesList.js.map +1 -1
- package/dist/editor/settings/index/types.d.ts +2 -0
- package/dist/editor/settings/index/useIndexStatus.js +2 -10
- package/dist/editor/settings/index/useIndexStatus.js.map +1 -1
- package/dist/editor/settings/index/utils.js +16 -16
- package/dist/editor/settings/index/utils.js.map +1 -1
- package/dist/editor/settings/panels/AgentProfileConfigPanel.d.ts +1 -2
- package/dist/editor/settings/panels/AgentProfileConfigPanel.js +3 -7
- package/dist/editor/settings/panels/AgentProfileConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/AgentProfileEditorPanel.d.ts +0 -1
- package/dist/editor/settings/panels/AgentProfileEditorPanel.js +1 -1
- package/dist/editor/settings/panels/AgentProfileEditorPanel.js.map +1 -1
- package/dist/editor/settings/panels/AgentsPanel.js +8 -30
- package/dist/editor/settings/panels/AgentsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ClusterInstancesPanel.js +54 -49
- package/dist/editor/settings/panels/ClusterInstancesPanel.js.map +1 -1
- package/dist/editor/settings/panels/CreateAgentProfileDialog.js +2 -2
- package/dist/editor/settings/panels/CreateAgentProfileDialog.js.map +1 -1
- package/dist/editor/settings/panels/CreateJavaScriptToolDialog.js +3 -3
- package/dist/editor/settings/panels/CreateJavaScriptToolDialog.js.map +1 -1
- package/dist/editor/settings/panels/GroupedFieldConfigPanel.js +5 -7
- package/dist/editor/settings/panels/GroupedFieldConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/ItemConfigPanel.js +3 -4
- package/dist/editor/settings/panels/ItemConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/JavaScriptToolAgentPanel.js +2 -4
- package/dist/editor/settings/panels/JavaScriptToolAgentPanel.js.map +1 -1
- package/dist/editor/settings/panels/JavaScriptToolConfigPanel.js +1 -1
- package/dist/editor/settings/panels/JavaScriptToolConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/JavaScriptToolsPanel.js +13 -27
- package/dist/editor/settings/panels/JavaScriptToolsPanel.js.map +1 -1
- package/dist/editor/settings/panels/McpToolsPanel.js +16 -36
- package/dist/editor/settings/panels/McpToolsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ModelConfigPanel.js +1 -1
- package/dist/editor/settings/panels/ModelConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/ModelsPanel.js +38 -107
- package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
- package/dist/editor/settings/panels/PersistentLogsPanel.js +14 -25
- package/dist/editor/settings/panels/PersistentLogsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplateAgentPanel.d.ts +1 -2
- package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js +3 -6
- package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplateSelector.js +42 -9
- package/dist/editor/settings/panels/ProjectTemplateSelector.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplatesPanel.js +90 -119
- package/dist/editor/settings/panels/ProjectTemplatesPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProviderIcon.js +8 -8
- package/dist/editor/settings/panels/ProviderIcon.js.map +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.js +35 -55
- package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
- package/dist/editor/settings/panels/SearchConfigPanel.js +11 -13
- package/dist/editor/settings/panels/SearchConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/SettingsPanel.js +2 -3
- package/dist/editor/settings/panels/SettingsPanel.js.map +1 -1
- package/dist/editor/settings/panels/StatusPanel.js +14 -39
- package/dist/editor/settings/panels/StatusPanel.js.map +1 -1
- package/dist/editor/settings/panels/index.d.ts +0 -5
- package/dist/editor/settings/panels/index.js +0 -5
- package/dist/editor/settings/panels/index.js.map +1 -1
- package/dist/editor/settings/panels/useSidebarEditor.d.ts +15 -0
- package/dist/editor/settings/panels/useSidebarEditor.js +24 -0
- package/dist/editor/settings/panels/useSidebarEditor.js.map +1 -0
- package/dist/editor/settings/status/coreStatusChecks.js +7 -118
- package/dist/editor/settings/status/coreStatusChecks.js.map +1 -1
- package/dist/editor/settings/status/useStartupChecks.js +1 -1
- package/dist/editor/settings/status/useStartupChecks.js.map +1 -1
- package/dist/editor/setup-wizard/steps/CompleteStep.js +3 -6
- package/dist/editor/setup-wizard/steps/CompleteStep.js.map +1 -1
- package/dist/editor/setup-wizard/steps/CreateSettingsStep.d.ts +1 -1
- package/dist/editor/setup-wizard/steps/CreateSettingsStep.js +3 -3
- package/dist/editor/setup-wizard/steps/CreateSettingsStep.js.map +1 -1
- package/dist/editor/setup-wizard/steps/LicenseActivationStep.js +8 -12
- package/dist/editor/setup-wizard/steps/LicenseActivationStep.js.map +1 -1
- package/dist/editor/setup-wizard/steps/LicenseEmailStep.js +3 -3
- package/dist/editor/setup-wizard/steps/LicenseEmailStep.js.map +1 -1
- package/dist/editor/setup-wizard/steps/ModelSelectionStep.js +20 -21
- package/dist/editor/setup-wizard/steps/ModelSelectionStep.js.map +1 -1
- package/dist/editor/setup-wizard/steps/ProviderStep.js +15 -25
- package/dist/editor/setup-wizard/steps/ProviderStep.js.map +1 -1
- package/dist/editor/setup-wizard/steps/WelcomeStep.js +1 -1
- package/dist/editor/setup-wizard/steps/WelcomeStep.js.map +1 -1
- package/dist/editor/sidebar/Completions.js +1 -1
- package/dist/editor/sidebar/Completions.js.map +1 -1
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -1
- package/dist/editor/sidebar/ComponentPalette.js +26 -61
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +40 -214
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/DictionaryEditor.js +1 -1
- package/dist/editor/sidebar/DictionaryEditor.js.map +1 -1
- 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.js +4 -17
- package/dist/editor/sidebar/EditHistory.js.map +1 -1
- package/dist/editor/sidebar/Favorites.d.ts +1 -5
- package/dist/editor/sidebar/Favorites.js +57 -41
- package/dist/editor/sidebar/Favorites.js.map +1 -1
- package/dist/editor/sidebar/Insert.js +1 -1
- package/dist/editor/sidebar/LabelButton.d.ts +5 -0
- package/dist/editor/sidebar/LabelButton.js +12 -0
- package/dist/editor/sidebar/LabelButton.js.map +1 -0
- package/dist/editor/sidebar/MainContentTree.js +2 -5
- package/dist/editor/sidebar/MainContentTree.js.map +1 -1
- package/dist/editor/sidebar/MobileWorkspacePopover.d.ts +2 -2
- package/dist/editor/sidebar/MobileWorkspacePopover.js +3 -3
- package/dist/editor/sidebar/MobileWorkspacePopover.js.map +1 -1
- package/dist/editor/sidebar/MorePanelsButton.js +2 -2
- package/dist/editor/sidebar/MorePanelsButton.js.map +1 -1
- package/dist/editor/sidebar/NavigationPanelItem.js +5 -6
- package/dist/editor/sidebar/NavigationPanelItem.js.map +1 -1
- package/dist/editor/sidebar/NavigationPanelMenuItem.js +2 -2
- package/dist/editor/sidebar/NavigationPanelMenuItem.js.map +1 -1
- package/dist/editor/sidebar/OperationItem.js +25 -111
- package/dist/editor/sidebar/OperationItem.js.map +1 -1
- 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/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +11 -0
- package/dist/editor/sidebar/Sidebar.js.map +1 -0
- package/dist/editor/sidebar/SidebarPanel.js +15 -21
- package/dist/editor/sidebar/SidebarPanel.js.map +1 -1
- package/dist/editor/sidebar/SidebarStack.js +0 -2
- package/dist/editor/sidebar/SidebarStack.js.map +1 -1
- package/dist/editor/sidebar/TimelineView.js +3 -3
- package/dist/editor/sidebar/TimelineView.js.map +1 -1
- package/dist/editor/sidebar/Validation.js +3 -6
- package/dist/editor/sidebar/Validation.js.map +1 -1
- package/dist/editor/sidebar/Workbox.js +77 -36
- package/dist/editor/sidebar/Workbox.js.map +1 -1
- package/dist/editor/sidebar/WorkspaceButton.d.ts +1 -3
- package/dist/editor/sidebar/WorkspaceButton.js +8 -16
- package/dist/editor/sidebar/WorkspaceButton.js.map +1 -1
- package/dist/editor/sidebar/WorkspaceRail.js +25 -30
- package/dist/editor/sidebar/WorkspaceRail.js.map +1 -1
- package/dist/editor/sidebar/WorkspaceRailMobile.js +14 -5
- package/dist/editor/sidebar/WorkspaceRailMobile.js.map +1 -1
- package/dist/editor/template-wizard/TemplateBuilderDialog.js +1 -1
- package/dist/editor/template-wizard/TemplateBuilderDialog.js.map +1 -1
- package/dist/editor/template-wizard/TemplateStructureInlineEditor.js +97 -164
- package/dist/editor/template-wizard/TemplateStructureInlineEditor.js.map +1 -1
- package/dist/editor/tree-indicators/GutterColumns.js +22 -13
- package/dist/editor/tree-indicators/GutterColumns.js.map +1 -1
- package/dist/editor/tree-indicators/GutterContext.js +1 -5
- package/dist/editor/tree-indicators/GutterContext.js.map +1 -1
- package/dist/editor/ui/CenteredMessage.js +1 -1
- package/dist/editor/ui/CenteredMessage.js.map +1 -1
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js +3 -3
- package/dist/editor/ui/CopyMoveTargetSelectorDialog.js.map +1 -1
- package/dist/editor/ui/DialogButtons.d.ts +1 -3
- package/dist/editor/ui/DialogButtons.js +2 -3
- package/dist/editor/ui/DialogButtons.js.map +1 -1
- package/dist/editor/ui/DragPreview.d.ts +0 -7
- package/dist/editor/ui/DragPreview.js +10 -107
- package/dist/editor/ui/DragPreview.js.map +1 -1
- package/dist/editor/ui/ExportItemsDialog.js +1 -1
- package/dist/editor/ui/ExportItemsDialog.js.map +1 -1
- package/dist/editor/ui/HomeButton.js +1 -1
- package/dist/editor/ui/HomeButton.js.map +1 -1
- package/dist/editor/ui/IconSelectorDialog.js +8 -8
- package/dist/editor/ui/IconSelectorDialog.js.map +1 -1
- package/dist/editor/ui/Icons.d.ts +1 -1
- package/dist/editor/ui/Icons.js +10 -10
- package/dist/editor/ui/Icons.js.map +1 -1
- package/dist/editor/ui/ImportItemsDialog.js +1 -1
- package/dist/editor/ui/ImportItemsDialog.js.map +1 -1
- package/dist/editor/ui/ItemCollectionEditor.d.ts +3 -27
- package/dist/editor/ui/ItemCollectionEditor.js +10 -54
- package/dist/editor/ui/ItemCollectionEditor.js.map +1 -1
- package/dist/editor/ui/ItemList.js +1 -1
- package/dist/editor/ui/ItemList.js.map +1 -1
- package/dist/editor/ui/ItemNameDialogNew.js +1 -1
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
- package/dist/editor/ui/ItemSearch.d.ts +0 -1
- package/dist/editor/ui/ItemSearch.js +4 -4
- package/dist/editor/ui/ItemSearch.js.map +1 -1
- package/dist/editor/ui/PerfectTree.d.ts +1 -24
- package/dist/editor/ui/PerfectTree.js +19 -39
- package/dist/editor/ui/PerfectTree.js.map +1 -1
- package/dist/editor/ui/PublishItemDialog.d.ts +1 -1
- package/dist/editor/ui/PublishItemDialog.js +75 -40
- package/dist/editor/ui/PublishItemDialog.js.map +1 -1
- package/dist/editor/ui/PublishRestrictionsDialog.js +64 -70
- package/dist/editor/ui/PublishRestrictionsDialog.js.map +1 -1
- package/dist/editor/ui/Section.js +5 -5
- package/dist/editor/ui/Section.js.map +1 -1
- package/dist/editor/ui/SharedFolderSelectorDialog.js +1 -1
- package/dist/editor/ui/SharedFolderSelectorDialog.js.map +1 -1
- package/dist/editor/ui/SimpleIconButton.d.ts +2 -9
- package/dist/editor/ui/SimpleIconButton.js +5 -20
- package/dist/editor/ui/SimpleIconButton.js.map +1 -1
- package/dist/editor/ui/SimpleMenu.js +6 -7
- package/dist/editor/ui/SimpleMenu.js.map +1 -1
- package/dist/editor/ui/SimpleTable.js +1 -1
- package/dist/editor/ui/SimpleTable.js.map +1 -1
- package/dist/editor/ui/SimpleTabs.d.ts +2 -6
- package/dist/editor/ui/SimpleTabs.js +19 -54
- package/dist/editor/ui/SimpleTabs.js.map +1 -1
- package/dist/editor/ui/SimpleToolbar.js +1 -1
- package/dist/editor/ui/SimpleToolbar.js.map +1 -1
- package/dist/editor/ui/Spinner.d.ts +1 -14
- package/dist/editor/ui/Spinner.js.map +1 -1
- package/dist/editor/ui/Splitter.d.ts +0 -2
- package/dist/editor/ui/Splitter.js +15 -147
- package/dist/editor/ui/Splitter.js.map +1 -1
- package/dist/editor/ui/TemplateSelectorDialog.js +5 -5
- package/dist/editor/ui/TemplateSelectorDialog.js.map +1 -1
- 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/ui/TreeListSelector.js +1 -1
- package/dist/editor/ui/TreeListSelector.js.map +1 -1
- package/dist/editor/utils/jsonCleaner.js +10 -10
- package/dist/editor/utils/jsonCleaner.js.map +1 -1
- package/dist/editor/utils/keyboardNavigation.js +1 -2
- package/dist/editor/utils/keyboardNavigation.js.map +1 -1
- package/dist/editor/utils/selectionContext.js.map +1 -1
- 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/versionAtDate.js.map +1 -1
- package/dist/editor/utils.d.ts +17 -7
- package/dist/editor/utils.js +145 -35
- package/dist/editor/utils.js.map +1 -1
- package/dist/editor/version-diff/versionDiffHighlightStyles.d.ts +6 -6
- package/dist/editor/version-diff/versionDiffHighlightStyles.js +6 -6
- package/dist/editor/version-diff/versionDiffHighlightStyles.js.map +1 -1
- package/dist/editor/version-diff/versionDiffTargets.d.ts +8 -3
- package/dist/editor/version-diff/versionDiffTargets.js +96 -38
- package/dist/editor/version-diff/versionDiffTargets.js.map +1 -1
- package/dist/editor/views/CompareView.js +3 -3
- package/dist/editor/views/CompareView.js.map +1 -1
- package/dist/editor/views/EditView.js +1 -1
- package/dist/editor/views/EditView.js.map +1 -1
- package/dist/editor/views/EditorSlot.js +6 -7
- package/dist/editor/views/EditorSlot.js.map +1 -1
- package/dist/editor/views/ItemEditor.js +2 -2
- package/dist/editor/views/ItemEditor.js.map +1 -1
- package/dist/editor/views/MediaFolderEditView.js +2 -2
- package/dist/editor/views/MediaFolderEditView.js.map +1 -1
- package/dist/editor/views/ParheliaView.d.ts +5 -0
- package/dist/editor/views/ParheliaView.js +181 -0
- package/dist/editor/views/ParheliaView.js.map +1 -0
- package/dist/editor/views/SingleEditView.js +6 -15
- package/dist/editor/views/SingleEditView.js.map +1 -1
- package/dist/editor/views/editorSlotContext.d.ts +0 -2
- package/dist/editor/views/editorSlotContext.js +1 -10
- package/dist/editor/views/editorSlotContext.js.map +1 -1
- package/dist/index.d.ts +6 -39
- package/dist/index.js +3 -23
- package/dist/index.js.map +1 -1
- package/dist/lib/safelist.js +1 -1
- package/dist/lib/safelist.js.map +1 -1
- package/dist/lib/sanitize.js +11 -79
- package/dist/lib/sanitize.js.map +1 -1
- package/dist/licensing/EmailEntry.js +1 -2
- package/dist/licensing/EmailEntry.js.map +1 -1
- package/dist/licensing/FeatureGate.js +6 -6
- package/dist/licensing/FeatureGate.js.map +1 -1
- package/dist/licensing/LicenseActivationForm.js +1 -2
- package/dist/licensing/LicenseActivationForm.js.map +1 -1
- package/dist/licensing/LicenseCodeEntry.js +3 -7
- package/dist/licensing/LicenseCodeEntry.js.map +1 -1
- package/dist/licensing/LicenseContext.js +4 -3
- package/dist/licensing/LicenseContext.js.map +1 -1
- package/dist/licensing/LicenseOverlay.js +1 -3
- package/dist/licensing/LicenseOverlay.js.map +1 -1
- package/dist/licensing/licenseService.js +3 -4
- package/dist/licensing/licenseService.js.map +1 -1
- package/dist/licensing/types.d.ts +1 -1
- package/dist/licensing/types.js +1 -3
- package/dist/licensing/types.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/setup/services/setupWizardService.d.ts +0 -10
- package/dist/setup/services/setupWizardService.js +13 -35
- package/dist/setup/services/setupWizardService.js.map +1 -1
- package/dist/setup/utils/modelPricing.d.ts +7 -0
- package/dist/setup/utils/modelPricing.js +106 -0
- package/dist/setup/utils/modelPricing.js.map +1 -0
- package/dist/setup/wizard/steps/AddModelDialog.js +8 -8
- package/dist/setup/wizard/steps/AddModelDialog.js.map +1 -1
- package/dist/setup/wizard/steps/ImportModelDialog.js +17 -19
- package/dist/setup/wizard/steps/ImportModelDialog.js.map +1 -1
- package/dist/splash-screen/DialogWrappers.js +2 -2
- package/dist/splash-screen/DialogWrappers.js.map +1 -1
- package/dist/splash-screen/ModernSplashScreen.d.ts +0 -7
- package/dist/splash-screen/ModernSplashScreen.js +62 -570
- package/dist/splash-screen/ModernSplashScreen.js.map +1 -1
- package/dist/splash-screen/NewPage.js +17 -41
- package/dist/splash-screen/NewPage.js.map +1 -1
- package/dist/splash-screen/OpenPage.js +21 -17
- package/dist/splash-screen/OpenPage.js.map +1 -1
- package/dist/splash-screen/ParheliaAssistantChat.js +12 -13
- package/dist/splash-screen/ParheliaAssistantChat.js.map +1 -1
- package/dist/splash-screen/ParheliaLogo.d.ts +4 -0
- package/dist/splash-screen/ParheliaLogo.js +134 -0
- package/dist/splash-screen/ParheliaLogo.js.map +1 -0
- package/dist/splash-screen/RecentPages.d.ts +1 -4
- package/dist/splash-screen/RecentPages.js +26 -29
- package/dist/splash-screen/RecentPages.js.map +1 -1
- 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/task-board/TaskBoardWorkspace.js +196 -402
- package/dist/task-board/TaskBoardWorkspace.js.map +1 -1
- package/dist/task-board/components/AddDependencyDialog.js +2 -5
- package/dist/task-board/components/AddDependencyDialog.js.map +1 -1
- package/dist/task-board/components/CommentsList.js +9 -22
- package/dist/task-board/components/CommentsList.js.map +1 -1
- package/dist/task-board/components/CreateProjectDialog.js +10 -10
- package/dist/task-board/components/CreateProjectDialog.js.map +1 -1
- package/dist/task-board/components/CreateTaskDialog.js +8 -13
- package/dist/task-board/components/CreateTaskDialog.js.map +1 -1
- package/dist/task-board/components/ItemCollectionEditorDialog.js +1 -1
- package/dist/task-board/components/ItemCollectionEditorDialog.js.map +1 -1
- package/dist/task-board/components/ItemCollectionPicker.js +3 -3
- package/dist/task-board/components/ItemCollectionPicker.js.map +1 -1
- package/dist/task-board/components/ProjectAgentsPanel.d.ts +4 -0
- package/dist/task-board/components/ProjectAgentsPanel.js +156 -0
- package/dist/task-board/components/ProjectAgentsPanel.js.map +1 -0
- package/dist/task-board/components/ProjectDashboard.d.ts +21 -21
- package/dist/task-board/components/ProjectDashboard.js +127 -217
- package/dist/task-board/components/ProjectDashboard.js.map +1 -1
- package/dist/task-board/components/ProjectExecutionUserPicker.js +61 -15
- package/dist/task-board/components/ProjectExecutionUserPicker.js.map +1 -1
- package/dist/task-board/components/ProjectListContent.d.ts +0 -1
- package/dist/task-board/components/ProjectListContent.js +10 -12
- package/dist/task-board/components/ProjectListContent.js.map +1 -1
- package/dist/task-board/components/ProjectOverviewContent.js +84 -15
- package/dist/task-board/components/ProjectOverviewContent.js.map +1 -1
- package/dist/task-board/components/ProjectPropertiesPanel.d.ts +0 -2
- package/dist/task-board/components/ProjectPropertiesPanel.js +13 -17
- package/dist/task-board/components/ProjectPropertiesPanel.js.map +1 -1
- package/dist/task-board/components/ProjectSelector.d.ts +20 -0
- package/dist/task-board/components/ProjectSelector.js +10 -0
- package/dist/task-board/components/ProjectSelector.js.map +1 -0
- package/dist/task-board/components/ProjectSettingsDialog.d.ts +0 -18
- package/dist/task-board/components/ProjectSettingsDialog.js +48 -66
- package/dist/task-board/components/ProjectSettingsDialog.js.map +1 -1
- package/dist/task-board/components/TaskAgentPanel.d.ts +0 -4
- package/dist/task-board/components/TaskAgentPanel.js +8 -23
- package/dist/task-board/components/TaskAgentPanel.js.map +1 -1
- package/dist/task-board/components/TaskAssigneePicker.js +7 -18
- package/dist/task-board/components/TaskAssigneePicker.js.map +1 -1
- package/dist/task-board/components/TaskAttachmentsSection.d.ts +0 -1
- package/dist/task-board/components/TaskAttachmentsSection.js +41 -19
- package/dist/task-board/components/TaskAttachmentsSection.js.map +1 -1
- package/dist/task-board/components/TaskBoardMyTasksSidebar.js +29 -26
- package/dist/task-board/components/TaskBoardMyTasksSidebar.js.map +1 -1
- package/dist/task-board/components/TaskBoardProjectListSidebar.js +14 -70
- package/dist/task-board/components/TaskBoardProjectListSidebar.js.map +1 -1
- package/dist/task-board/components/TaskBoardTitlebar.js +13 -8
- package/dist/task-board/components/TaskBoardTitlebar.js.map +1 -1
- package/dist/task-board/components/TaskCard.js +10 -29
- package/dist/task-board/components/TaskCard.js.map +1 -1
- package/dist/task-board/components/TaskDetailDialog.d.ts +12 -0
- package/dist/task-board/components/TaskDetailDialog.js +8 -0
- package/dist/task-board/components/TaskDetailDialog.js.map +1 -0
- package/dist/task-board/components/TaskDetailPanel.d.ts +0 -1
- package/dist/task-board/components/TaskDetailPanel.js +32 -45
- package/dist/task-board/components/TaskDetailPanel.js.map +1 -1
- package/dist/task-board/components/TaskReviewActions.d.ts +0 -1
- package/dist/task-board/components/TaskReviewActions.js +4 -7
- package/dist/task-board/components/TaskReviewActions.js.map +1 -1
- package/dist/task-board/components/TaskRow.js +18 -17
- package/dist/task-board/components/TaskRow.js.map +1 -1
- package/dist/task-board/components/TaskboardPersistentLogPanel.js +10 -17
- package/dist/task-board/components/TaskboardPersistentLogPanel.js.map +1 -1
- package/dist/task-board/components/WizardCommunicationCards.js +5 -7
- package/dist/task-board/components/WizardCommunicationCards.js.map +1 -1
- package/dist/task-board/components/WizardCommunicationCenter.d.ts +1 -7
- package/dist/task-board/components/WizardCommunicationCenter.js +7 -14
- package/dist/task-board/components/WizardCommunicationCenter.js.map +1 -1
- package/dist/task-board/components/WizardCommunicationShared.js +22 -22
- package/dist/task-board/components/WizardCommunicationShared.js.map +1 -1
- package/dist/task-board/components/WizardTask.d.ts +1 -5
- package/dist/task-board/components/WizardTask.js +31 -14
- package/dist/task-board/components/WizardTask.js.map +1 -1
- package/dist/task-board/components/WizardTaskDetailsPanel.d.ts +2 -10
- package/dist/task-board/components/WizardTaskDetailsPanel.js +11 -57
- package/dist/task-board/components/WizardTaskDetailsPanel.js.map +1 -1
- package/dist/task-board/index.d.ts +15 -0
- package/dist/task-board/index.js +18 -0
- package/dist/task-board/index.js.map +1 -0
- package/dist/task-board/persistentLogCopy.js +1 -3
- package/dist/task-board/persistentLogCopy.js.map +1 -1
- package/dist/task-board/persistentLogLabels.js.map +1 -1
- package/dist/task-board/services/taskService.d.ts +0 -7
- package/dist/task-board/services/taskService.js +2 -8
- package/dist/task-board/services/taskService.js.map +1 -1
- package/dist/task-board/taskAgentConfig.js +2 -6
- package/dist/task-board/taskAgentConfig.js.map +1 -1
- package/dist/task-board/taskAgentLink.js +3 -1
- package/dist/task-board/taskAgentLink.js.map +1 -1
- package/dist/task-board/taskBoardNavStore.d.ts +2 -4
- package/dist/task-board/taskBoardNavStore.js +2 -45
- package/dist/task-board/taskBoardNavStore.js.map +1 -1
- package/dist/task-board/taskExecutionRecords.js.map +1 -1
- package/dist/task-board/taskExecutionStatus.js +19 -14
- package/dist/task-board/taskExecutionStatus.js.map +1 -1
- package/dist/task-board/taskStatus.js +2 -2
- package/dist/task-board/taskStatus.js.map +1 -1
- package/dist/task-board/useTaskBoardAgentPanelState.js +3 -1
- package/dist/task-board/useTaskBoardAgentPanelState.js.map +1 -1
- package/dist/task-board/utils/projectHierarchy.js.map +1 -1
- package/dist/task-board/utils/taskDependencyOrdering.js +1 -2
- package/dist/task-board/utils/taskDependencyOrdering.js.map +1 -1
- package/dist/task-board/views/DependencyGraphView.d.ts +1 -42
- package/dist/task-board/views/DependencyGraphView.js +74 -239
- package/dist/task-board/views/DependencyGraphView.js.map +1 -1
- package/dist/task-board/views/KanbanView.js +49 -312
- package/dist/task-board/views/KanbanView.js.map +1 -1
- package/dist/task-board/views/ListView.js +5 -6
- package/dist/task-board/views/ListView.js.map +1 -1
- package/dist/task-board/views/PlanningView.d.ts +7 -0
- package/dist/task-board/views/PlanningView.js +112 -0
- package/dist/task-board/views/PlanningView.js.map +1 -0
- package/dist/task-board/views/WizardView.d.ts +0 -2
- package/dist/task-board/views/WizardView.js +29 -36
- package/dist/task-board/views/WizardView.js.map +1 -1
- package/dist/test/setup.d.ts +0 -0
- package/dist/test/setup.js +37 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/tour/Tour.js +7 -7
- package/dist/tour/Tour.js.map +1 -1
- package/dist/tour/default-tour.js +17 -169
- package/dist/tour/default-tour.js.map +1 -1
- package/dist/tour/preview-tour.js +1 -1
- package/dist/tour/preview-tour.js.map +1 -1
- package/dist/types.d.ts +1 -16
- package/package.json +1 -13
- package/styles.css +843 -320
- package/dist/agents-view/AgentGalleryCard.d.ts +0 -12
- package/dist/agents-view/AgentGalleryCard.js +0 -12
- package/dist/agents-view/AgentGalleryCard.js.map +0 -1
- package/dist/agents-view/AgentGalleryView.d.ts +0 -18
- package/dist/agents-view/AgentGalleryView.js +0 -88
- package/dist/agents-view/AgentGalleryView.js.map +0 -1
- package/dist/agents-view/AgentProfileIcon.d.ts +0 -9
- package/dist/agents-view/AgentProfileIcon.js +0 -32
- package/dist/agents-view/AgentProfileIcon.js.map +0 -1
- package/dist/agents-view/DateAgentsGroup.d.ts +0 -17
- package/dist/agents-view/DateAgentsGroup.js +0 -19
- package/dist/agents-view/DateAgentsGroup.js.map +0 -1
- package/dist/agents-view/RenameAgentDialog.d.ts +0 -12
- package/dist/agents-view/RenameAgentDialog.js +0 -40
- package/dist/agents-view/RenameAgentDialog.js.map +0 -1
- package/dist/agents-view/agentsNavStore.d.ts +0 -8
- package/dist/agents-view/agentsNavStore.js +0 -24
- package/dist/agents-view/agentsNavStore.js.map +0 -1
- package/dist/components/SearchInput.d.ts +0 -28
- package/dist/components/SearchInput.js +0 -38
- package/dist/components/SearchInput.js.map +0 -1
- package/dist/components/ui/LanguageSelectionGrid.d.ts +0 -27
- package/dist/components/ui/LanguageSelectionGrid.js +0 -41
- package/dist/components/ui/LanguageSelectionGrid.js.map +0 -1
- package/dist/components/ui/PlaceholderInputParser.d.ts +0 -9
- package/dist/components/ui/PlaceholderInputParser.js +0 -98
- package/dist/components/ui/PlaceholderInputParser.js.map +0 -1
- package/dist/components/ui/UserPicker.d.ts +0 -34
- package/dist/components/ui/UserPicker.js +0 -73
- package/dist/components/ui/UserPicker.js.map +0 -1
- package/dist/components/ui/accordion.d.ts +0 -7
- package/dist/components/ui/accordion.js +0 -17
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/avatar.d.ts +0 -30
- package/dist/components/ui/avatar.js +0 -46
- package/dist/components/ui/avatar.js.map +0 -1
- package/dist/components/ui/close-button.d.ts +0 -13
- package/dist/components/ui/close-button.js +0 -29
- package/dist/components/ui/close-button.js.map +0 -1
- package/dist/components/ui/close-icon.d.ts +0 -7
- package/dist/components/ui/close-icon.js +0 -14
- package/dist/components/ui/close-icon.js.map +0 -1
- package/dist/components/ui/delete-button.d.ts +0 -13
- package/dist/components/ui/delete-button.js +0 -36
- package/dist/components/ui/delete-button.js.map +0 -1
- package/dist/components/ui/delete-icon.d.ts +0 -7
- package/dist/components/ui/delete-icon.js +0 -14
- package/dist/components/ui/delete-icon.js.map +0 -1
- package/dist/components/ui/mention-textarea.d.ts +0 -10
- package/dist/components/ui/mention-textarea.js +0 -180
- package/dist/components/ui/mention-textarea.js.map +0 -1
- package/dist/components/ui/multi-switch-button.d.ts +0 -22
- package/dist/components/ui/multi-switch-button.js +0 -12
- package/dist/components/ui/multi-switch-button.js.map +0 -1
- package/dist/editor/EditorLoadingOverlay.d.ts +0 -1
- package/dist/editor/EditorLoadingOverlay.js +0 -7
- package/dist/editor/EditorLoadingOverlay.js.map +0 -1
- package/dist/editor/WorkspaceTitleSwitcher.d.ts +0 -5
- package/dist/editor/WorkspaceTitleSwitcher.js +0 -67
- package/dist/editor/WorkspaceTitleSwitcher.js.map +0 -1
- package/dist/editor/ai/InlineAiTextEditTooltip.d.ts +0 -8
- package/dist/editor/ai/InlineAiTextEditTooltip.js +0 -10
- package/dist/editor/ai/InlineAiTextEditTooltip.js.map +0 -1
- package/dist/editor/ai/agentActivitySummary.d.ts +0 -108
- package/dist/editor/ai/agentActivitySummary.js +0 -390
- package/dist/editor/ai/agentActivitySummary.js.map +0 -1
- package/dist/editor/ai/inlineAiTextEditLabels.d.ts +0 -2
- package/dist/editor/ai/inlineAiTextEditLabels.js +0 -8
- package/dist/editor/ai/inlineAiTextEditLabels.js.map +0 -1
- package/dist/editor/ai/prepareInlineAiTextSelection.d.ts +0 -5
- package/dist/editor/ai/prepareInlineAiTextSelection.js +0 -86
- package/dist/editor/ai/prepareInlineAiTextSelection.js.map +0 -1
- package/dist/editor/ai/terminal/agentContextMerge.d.ts +0 -14
- package/dist/editor/ai/terminal/agentContextMerge.js +0 -105
- package/dist/editor/ai/terminal/agentContextMerge.js.map +0 -1
- package/dist/editor/ai/terminal/agentOptimisticMessage.d.ts +0 -1
- package/dist/editor/ai/terminal/agentOptimisticMessage.js +0 -4
- package/dist/editor/ai/terminal/agentOptimisticMessage.js.map +0 -1
- package/dist/editor/ai/terminal/agentPromptPlaceholders.d.ts +0 -5
- package/dist/editor/ai/terminal/agentPromptPlaceholders.js +0 -8
- package/dist/editor/ai/terminal/agentPromptPlaceholders.js.map +0 -1
- package/dist/editor/ai/terminal/agentQuestionnaireRecap.d.ts +0 -82
- package/dist/editor/ai/terminal/agentQuestionnaireRecap.js +0 -277
- package/dist/editor/ai/terminal/agentQuestionnaireRecap.js.map +0 -1
- package/dist/editor/ai/terminal/agentQuestionnaireTranscriptRecovery.d.ts +0 -13
- package/dist/editor/ai/terminal/agentQuestionnaireTranscriptRecovery.js +0 -87
- package/dist/editor/ai/terminal/agentQuestionnaireTranscriptRecovery.js.map +0 -1
- package/dist/editor/ai/terminal/agentSessionCostLimit.d.ts +0 -7
- package/dist/editor/ai/terminal/agentSessionCostLimit.js +0 -27
- package/dist/editor/ai/terminal/agentSessionCostLimit.js.map +0 -1
- package/dist/editor/ai/terminal/agentSessionLiveTotals.d.ts +0 -11
- package/dist/editor/ai/terminal/agentSessionLiveTotals.js +0 -127
- package/dist/editor/ai/terminal/agentSessionLiveTotals.js.map +0 -1
- package/dist/editor/ai/terminal/agentSessionMetadata.d.ts +0 -2
- package/dist/editor/ai/terminal/agentSessionMetadata.js +0 -24
- package/dist/editor/ai/terminal/agentSessionMetadata.js.map +0 -1
- package/dist/editor/ai/terminal/agentSessionSelectors.d.ts +0 -65
- package/dist/editor/ai/terminal/agentSessionSelectors.js +0 -232
- package/dist/editor/ai/terminal/agentSessionSelectors.js.map +0 -1
- package/dist/editor/ai/terminal/agentSessionSnapshot.d.ts +0 -16
- package/dist/editor/ai/terminal/agentSessionSnapshot.js +0 -77
- package/dist/editor/ai/terminal/agentSessionSnapshot.js.map +0 -1
- package/dist/editor/ai/terminal/agentSessionState.d.ts +0 -134
- package/dist/editor/ai/terminal/agentSessionState.js +0 -770
- package/dist/editor/ai/terminal/agentSessionState.js.map +0 -1
- package/dist/editor/ai/terminal/agentStartRequest.d.ts +0 -15
- package/dist/editor/ai/terminal/agentStartRequest.js +0 -25
- package/dist/editor/ai/terminal/agentStartRequest.js.map +0 -1
- package/dist/editor/ai/terminal/agentSubmitErrors.d.ts +0 -1
- package/dist/editor/ai/terminal/agentSubmitErrors.js +0 -9
- package/dist/editor/ai/terminal/agentSubmitErrors.js.map +0 -1
- package/dist/editor/ai/terminal/components/ActivitySummaryCell.d.ts +0 -21
- package/dist/editor/ai/terminal/components/ActivitySummaryCell.js +0 -133
- package/dist/editor/ai/terminal/components/ActivitySummaryCell.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentActivityOverviewPanel.d.ts +0 -7
- package/dist/editor/ai/terminal/components/AgentActivityOverviewPanel.js +0 -145
- package/dist/editor/ai/terminal/components/AgentActivityOverviewPanel.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentBanners.js +0 -16
- package/dist/editor/ai/terminal/components/AgentBanners.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentBrowserClaimBanner.d.ts +0 -10
- package/dist/editor/ai/terminal/components/AgentBrowserClaimBanner.js +0 -24
- package/dist/editor/ai/terminal/components/AgentBrowserClaimBanner.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentCostDisplay.js +0 -116
- package/dist/editor/ai/terminal/components/AgentCostDisplay.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentDocumentList.d.ts +0 -32
- package/dist/editor/ai/terminal/components/AgentDocumentList.js +0 -404
- package/dist/editor/ai/terminal/components/AgentDocumentList.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentEditHistoryButton.d.ts +0 -5
- package/dist/editor/ai/terminal/components/AgentEditHistoryButton.js +0 -12
- package/dist/editor/ai/terminal/components/AgentEditHistoryButton.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.d.ts +0 -39
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.js +0 -42
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentGreeting.d.ts +0 -8
- package/dist/editor/ai/terminal/components/AgentGreeting.js +0 -14
- package/dist/editor/ai/terminal/components/AgentGreeting.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentLoadingContent.d.ts +0 -1
- package/dist/editor/ai/terminal/components/AgentLoadingContent.js +0 -6
- package/dist/editor/ai/terminal/components/AgentLoadingContent.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentMobileStatusPopover.d.ts +0 -7
- package/dist/editor/ai/terminal/components/AgentMobileStatusPopover.js +0 -8
- package/dist/editor/ai/terminal/components/AgentMobileStatusPopover.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentModeSelector.d.ts +0 -8
- package/dist/editor/ai/terminal/components/AgentModeSelector.js +0 -90
- package/dist/editor/ai/terminal/components/AgentModeSelector.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentParentLink.d.ts +0 -6
- package/dist/editor/ai/terminal/components/AgentParentLink.js +0 -9
- package/dist/editor/ai/terminal/components/AgentParentLink.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentPredefinedPromptsButton.d.ts +0 -8
- package/dist/editor/ai/terminal/components/AgentPredefinedPromptsButton.js +0 -10
- package/dist/editor/ai/terminal/components/AgentPredefinedPromptsButton.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentProfileModelSettingsSection.d.ts +0 -16
- package/dist/editor/ai/terminal/components/AgentProfileModelSettingsSection.js +0 -15
- package/dist/editor/ai/terminal/components/AgentProfileModelSettingsSection.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentProjectProgress.d.ts +0 -12
- package/dist/editor/ai/terminal/components/AgentProjectProgress.js +0 -207
- package/dist/editor/ai/terminal/components/AgentProjectProgress.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentPromptActionButtons.d.ts +0 -14
- package/dist/editor/ai/terminal/components/AgentPromptActionButtons.js +0 -17
- package/dist/editor/ai/terminal/components/AgentPromptActionButtons.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentPromptComposer.d.ts +0 -8
- package/dist/editor/ai/terminal/components/AgentPromptComposer.js +0 -10
- package/dist/editor/ai/terminal/components/AgentPromptComposer.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentPromptInputArea.d.ts +0 -39
- package/dist/editor/ai/terminal/components/AgentPromptInputArea.js +0 -27
- package/dist/editor/ai/terminal/components/AgentPromptInputArea.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.d.ts +0 -16
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js +0 -93
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentReadOnlyNotice.d.ts +0 -5
- package/dist/editor/ai/terminal/components/AgentReadOnlyNotice.js +0 -7
- package/dist/editor/ai/terminal/components/AgentReadOnlyNotice.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentRunStatusBanners.d.ts +0 -8
- package/dist/editor/ai/terminal/components/AgentRunStatusBanners.js +0 -32
- package/dist/editor/ai/terminal/components/AgentRunStatusBanners.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentSettingsContent.d.ts +0 -53
- package/dist/editor/ai/terminal/components/AgentSettingsContent.js +0 -9
- package/dist/editor/ai/terminal/components/AgentSettingsContent.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentSettingsPopover.d.ts +0 -7
- package/dist/editor/ai/terminal/components/AgentSettingsPopover.js +0 -14
- package/dist/editor/ai/terminal/components/AgentSettingsPopover.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentSettingsSections.d.ts +0 -43
- package/dist/editor/ai/terminal/components/AgentSettingsSections.js +0 -33
- package/dist/editor/ai/terminal/components/AgentSettingsSections.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentSkillSettingsSection.d.ts +0 -21
- package/dist/editor/ai/terminal/components/AgentSkillSettingsSection.js +0 -48
- package/dist/editor/ai/terminal/components/AgentSkillSettingsSection.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentSummaryAssistantResponse.d.ts +0 -28
- package/dist/editor/ai/terminal/components/AgentSummaryAssistantResponse.js +0 -10
- package/dist/editor/ai/terminal/components/AgentSummaryAssistantResponse.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentSummaryErrorNotice.d.ts +0 -6
- package/dist/editor/ai/terminal/components/AgentSummaryErrorNotice.js +0 -10
- package/dist/editor/ai/terminal/components/AgentSummaryErrorNotice.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentSummaryPlaceholder.d.ts +0 -10
- package/dist/editor/ai/terminal/components/AgentSummaryPlaceholder.js +0 -13
- package/dist/editor/ai/terminal/components/AgentSummaryPlaceholder.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentSummaryPromptActions.d.ts +0 -12
- package/dist/editor/ai/terminal/components/AgentSummaryPromptActions.js +0 -21
- package/dist/editor/ai/terminal/components/AgentSummaryPromptActions.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalContextChrome.d.ts +0 -24
- package/dist/editor/ai/terminal/components/AgentTerminalContextChrome.js +0 -13
- package/dist/editor/ai/terminal/components/AgentTerminalContextChrome.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalContextPanels.d.ts +0 -23
- package/dist/editor/ai/terminal/components/AgentTerminalContextPanels.js +0 -66
- package/dist/editor/ai/terminal/components/AgentTerminalContextPanels.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalDialogHost.d.ts +0 -13
- package/dist/editor/ai/terminal/components/AgentTerminalDialogHost.js +0 -10
- package/dist/editor/ai/terminal/components/AgentTerminalDialogHost.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.d.ts +0 -24
- package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.js +0 -24
- package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalFullPromptControls.d.ts +0 -5
- package/dist/editor/ai/terminal/components/AgentTerminalFullPromptControls.js +0 -7
- package/dist/editor/ai/terminal/components/AgentTerminalFullPromptControls.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalFullUpperContent.d.ts +0 -57
- package/dist/editor/ai/terminal/components/AgentTerminalFullUpperContent.js +0 -98
- package/dist/editor/ai/terminal/components/AgentTerminalFullUpperContent.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalMessageGroups.d.ts +0 -20
- package/dist/editor/ai/terminal/components/AgentTerminalMessageGroups.js +0 -44
- package/dist/editor/ai/terminal/components/AgentTerminalMessageGroups.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.d.ts +0 -81
- package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js +0 -910
- package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.d.ts +0 -45
- package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.js +0 -18
- package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentTerminalView.d.ts +0 -18
- package/dist/editor/ai/terminal/components/AgentTerminalView.js +0 -41
- package/dist/editor/ai/terminal/components/AgentTerminalView.js.map +0 -1
- package/dist/editor/ai/terminal/components/AgentThinkingDots.d.ts +0 -5
- package/dist/editor/ai/terminal/components/AgentThinkingDots.js +0 -9
- package/dist/editor/ai/terminal/components/AgentThinkingDots.js.map +0 -1
- package/dist/editor/ai/terminal/components/AiResponseMessage.d.ts +0 -35
- package/dist/editor/ai/terminal/components/AiResponseMessage.js +0 -1520
- package/dist/editor/ai/terminal/components/AiResponseMessage.js.map +0 -1
- package/dist/editor/ai/terminal/components/ContextInfoBar.d.ts +0 -17
- package/dist/editor/ai/terminal/components/ContextInfoBar.js +0 -588
- package/dist/editor/ai/terminal/components/ContextInfoBar.js.map +0 -1
- package/dist/editor/ai/terminal/components/EditOperationsPanel.d.ts +0 -9
- package/dist/editor/ai/terminal/components/EditOperationsPanel.js +0 -102
- package/dist/editor/ai/terminal/components/EditOperationsPanel.js.map +0 -1
- package/dist/editor/ai/terminal/components/HeartbeatMessage.d.ts +0 -4
- package/dist/editor/ai/terminal/components/HeartbeatMessage.js +0 -7
- package/dist/editor/ai/terminal/components/HeartbeatMessage.js.map +0 -1
- package/dist/editor/ai/terminal/components/InitialThinkingSplash.d.ts +0 -1
- package/dist/editor/ai/terminal/components/InitialThinkingSplash.js +0 -5
- package/dist/editor/ai/terminal/components/InitialThinkingSplash.js.map +0 -1
- package/dist/editor/ai/terminal/components/QuestionnaireRecap.d.ts +0 -9
- package/dist/editor/ai/terminal/components/QuestionnaireRecap.js +0 -56
- package/dist/editor/ai/terminal/components/QuestionnaireRecap.js.map +0 -1
- package/dist/editor/ai/terminal/components/QueuedPromptsPanel.d.ts +0 -8
- package/dist/editor/ai/terminal/components/QueuedPromptsPanel.js +0 -49
- package/dist/editor/ai/terminal/components/QueuedPromptsPanel.js.map +0 -1
- package/dist/editor/ai/terminal/components/SpawnedAgentsPanel.d.ts +0 -7
- package/dist/editor/ai/terminal/components/SpawnedAgentsPanel.js +0 -105
- package/dist/editor/ai/terminal/components/SpawnedAgentsPanel.js.map +0 -1
- package/dist/editor/ai/terminal/components/TodoListPanel.d.ts +0 -6
- package/dist/editor/ai/terminal/components/TodoListPanel.js +0 -117
- package/dist/editor/ai/terminal/components/TodoListPanel.js.map +0 -1
- package/dist/editor/ai/terminal/components/ToolCallDisplay.js +0 -842
- package/dist/editor/ai/terminal/components/ToolCallDisplay.js.map +0 -1
- package/dist/editor/ai/terminal/components/UserMessage.d.ts +0 -6
- package/dist/editor/ai/terminal/components/UserMessage.js +0 -197
- package/dist/editor/ai/terminal/components/UserMessage.js.map +0 -1
- package/dist/editor/ai/terminal/contextBreakdown.d.ts +0 -17
- package/dist/editor/ai/terminal/contextBreakdown.js +0 -58
- package/dist/editor/ai/terminal/contextBreakdown.js.map +0 -1
- package/dist/editor/ai/terminal/types.d.ts +0 -138
- package/dist/editor/ai/terminal/types.js +0 -2
- package/dist/editor/ai/terminal/types.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentActiveStreaming.d.ts +0 -6
- package/dist/editor/ai/terminal/useAgentActiveStreaming.js +0 -9
- package/dist/editor/ai/terminal/useAgentActiveStreaming.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentAssignedSkillsSync.d.ts +0 -5
- package/dist/editor/ai/terminal/useAgentAssignedSkillsSync.js +0 -19
- package/dist/editor/ai/terminal/useAgentAssignedSkillsSync.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentAutoStartOnCreate.d.ts +0 -29
- package/dist/editor/ai/terminal/useAgentAutoStartOnCreate.js +0 -68
- package/dist/editor/ai/terminal/useAgentAutoStartOnCreate.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentBrowserCapture.d.ts +0 -24
- package/dist/editor/ai/terminal/useAgentBrowserCapture.js +0 -147
- package/dist/editor/ai/terminal/useAgentBrowserCapture.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentBrowserCapturePanel.d.ts +0 -29
- package/dist/editor/ai/terminal/useAgentBrowserCapturePanel.js +0 -36
- package/dist/editor/ai/terminal/useAgentBrowserCapturePanel.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentBrowserCaptureUi.d.ts +0 -18
- package/dist/editor/ai/terminal/useAgentBrowserCaptureUi.js +0 -36
- package/dist/editor/ai/terminal/useAgentBrowserCaptureUi.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentContentChunkHandler.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentContentChunkHandler.js +0 -96
- package/dist/editor/ai/terminal/useAgentContentChunkHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentContextDisplayNames.d.ts +0 -9
- package/dist/editor/ai/terminal/useAgentContextDisplayNames.js +0 -98
- package/dist/editor/ai/terminal/useAgentContextDisplayNames.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentContextUpdateHandler.d.ts +0 -7
- package/dist/editor/ai/terminal/useAgentContextUpdateHandler.js +0 -29
- package/dist/editor/ai/terminal/useAgentContextUpdateHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentCostLimitActions.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentCostLimitActions.js +0 -41
- package/dist/editor/ai/terminal/useAgentCostLimitActions.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentCostLimitWatcher.d.ts +0 -11
- package/dist/editor/ai/terminal/useAgentCostLimitWatcher.js +0 -58
- package/dist/editor/ai/terminal/useAgentCostLimitWatcher.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentDraftInitializer.d.ts +0 -25
- package/dist/editor/ai/terminal/useAgentDraftInitializer.js +0 -121
- package/dist/editor/ai/terminal/useAgentDraftInitializer.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentEditorContext.d.ts +0 -16
- package/dist/editor/ai/terminal/useAgentEditorContext.js +0 -135
- package/dist/editor/ai/terminal/useAgentEditorContext.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentEditorContextPipeline.d.ts +0 -19
- package/dist/editor/ai/terminal/useAgentEditorContextPipeline.js +0 -16
- package/dist/editor/ai/terminal/useAgentEditorContextPipeline.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentEffectiveModelName.d.ts +0 -7
- package/dist/editor/ai/terminal/useAgentEffectiveModelName.js +0 -10
- package/dist/editor/ai/terminal/useAgentEffectiveModelName.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentHeartbeatMessages.d.ts +0 -16
- package/dist/editor/ai/terminal/useAgentHeartbeatMessages.js +0 -55
- package/dist/editor/ai/terminal/useAgentHeartbeatMessages.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentInfoSocketHandler.d.ts +0 -12
- package/dist/editor/ai/terminal/useAgentInfoSocketHandler.js +0 -55
- package/dist/editor/ai/terminal/useAgentInfoSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentInitialMetadataMerge.d.ts +0 -6
- package/dist/editor/ai/terminal/useAgentInitialMetadataMerge.js +0 -18
- package/dist/editor/ai/terminal/useAgentInitialMetadataMerge.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentInitialPrompt.d.ts +0 -16
- package/dist/editor/ai/terminal/useAgentInitialPrompt.js +0 -48
- package/dist/editor/ai/terminal/useAgentInitialPrompt.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentInlineDialogEvents.d.ts +0 -23
- package/dist/editor/ai/terminal/useAgentInlineDialogEvents.js +0 -196
- package/dist/editor/ai/terminal/useAgentInlineDialogEvents.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentInlineDialogPipeline.d.ts +0 -23
- package/dist/editor/ai/terminal/useAgentInlineDialogPipeline.js +0 -28
- package/dist/editor/ai/terminal/useAgentInlineDialogPipeline.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentInlineDialogState.d.ts +0 -22
- package/dist/editor/ai/terminal/useAgentInlineDialogState.js +0 -78
- package/dist/editor/ai/terminal/useAgentInlineDialogState.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentLoadErrorHandler.d.ts +0 -11
- package/dist/editor/ai/terminal/useAgentLoadErrorHandler.js +0 -24
- package/dist/editor/ai/terminal/useAgentLoadErrorHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentLoadLifecycle.d.ts +0 -7
- package/dist/editor/ai/terminal/useAgentLoadLifecycle.js +0 -21
- package/dist/editor/ai/terminal/useAgentLoadLifecycle.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentLoadPipeline.d.ts +0 -39
- package/dist/editor/ai/terminal/useAgentLoadPipeline.js +0 -73
- package/dist/editor/ai/terminal/useAgentLoadPipeline.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentLoadedRunStateSync.d.ts +0 -13
- package/dist/editor/ai/terminal/useAgentLoadedRunStateSync.js +0 -31
- package/dist/editor/ai/terminal/useAgentLoadedRunStateSync.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentLoader.d.ts +0 -27
- package/dist/editor/ai/terminal/useAgentLoader.js +0 -77
- package/dist/editor/ai/terminal/useAgentLoader.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentMessageCompletionNotifier.d.ts +0 -6
- package/dist/editor/ai/terminal/useAgentMessageCompletionNotifier.js +0 -23
- package/dist/editor/ai/terminal/useAgentMessageCompletionNotifier.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentModeState.d.ts +0 -13
- package/dist/editor/ai/terminal/useAgentModeState.js +0 -52
- package/dist/editor/ai/terminal/useAgentModeState.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentOperationHistoryLoader.d.ts +0 -8
- package/dist/editor/ai/terminal/useAgentOperationHistoryLoader.js +0 -26
- package/dist/editor/ai/terminal/useAgentOperationHistoryLoader.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentOperationSocketHandler.d.ts +0 -6
- package/dist/editor/ai/terminal/useAgentOperationSocketHandler.js +0 -19
- package/dist/editor/ai/terminal/useAgentOperationSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentPendingApprovals.d.ts +0 -6
- package/dist/editor/ai/terminal/useAgentPendingApprovals.js +0 -35
- package/dist/editor/ai/terminal/useAgentPendingApprovals.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentPendingDialogRecovery.d.ts +0 -18
- package/dist/editor/ai/terminal/useAgentPendingDialogRecovery.js +0 -115
- package/dist/editor/ai/terminal/useAgentPendingDialogRecovery.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentPendingInitialPrompt.d.ts +0 -19
- package/dist/editor/ai/terminal/useAgentPendingInitialPrompt.js +0 -60
- package/dist/editor/ai/terminal/useAgentPendingInitialPrompt.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentProfileSelection.d.ts +0 -17
- package/dist/editor/ai/terminal/useAgentProfileSelection.js +0 -61
- package/dist/editor/ai/terminal/useAgentProfileSelection.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentPromptComposerHandlers.d.ts +0 -37
- package/dist/editor/ai/terminal/useAgentPromptComposerHandlers.js +0 -206
- package/dist/editor/ai/terminal/useAgentPromptComposerHandlers.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentPromptComposerProps.d.ts +0 -26
- package/dist/editor/ai/terminal/useAgentPromptComposerProps.js +0 -51
- package/dist/editor/ai/terminal/useAgentPromptComposerProps.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentPromptComposerSurface.d.ts +0 -27
- package/dist/editor/ai/terminal/useAgentPromptComposerSurface.js +0 -29
- package/dist/editor/ai/terminal/useAgentPromptComposerSurface.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentPromptDraft.d.ts +0 -11
- package/dist/editor/ai/terminal/useAgentPromptDraft.js +0 -39
- package/dist/editor/ai/terminal/useAgentPromptDraft.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentPromptQueueSocketHandler.d.ts +0 -6
- package/dist/editor/ai/terminal/useAgentPromptQueueSocketHandler.js +0 -22
- package/dist/editor/ai/terminal/useAgentPromptQueueSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentQuestionnaireDialogRecovery.d.ts +0 -12
- package/dist/editor/ai/terminal/useAgentQuestionnaireDialogRecovery.js +0 -49
- package/dist/editor/ai/terminal/useAgentQuestionnaireDialogRecovery.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentQueuedPromptReset.d.ts +0 -5
- package/dist/editor/ai/terminal/useAgentQueuedPromptReset.js +0 -10
- package/dist/editor/ai/terminal/useAgentQueuedPromptReset.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentQuickActions.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentQuickActions.js +0 -109
- package/dist/editor/ai/terminal/useAgentQuickActions.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunCompletionSocketHandler.d.ts +0 -22
- package/dist/editor/ai/terminal/useAgentRunCompletionSocketHandler.js +0 -67
- package/dist/editor/ai/terminal/useAgentRunCompletionSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunDeltaRouter.d.ts +0 -18
- package/dist/editor/ai/terminal/useAgentRunDeltaRouter.js +0 -53
- package/dist/editor/ai/terminal/useAgentRunDeltaRouter.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.d.ts +0 -24
- package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.js +0 -66
- package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunDiagnostics.d.ts +0 -22
- package/dist/editor/ai/terminal/useAgentRunDiagnostics.js +0 -70
- package/dist/editor/ai/terminal/useAgentRunDiagnostics.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunMessagePipeline.d.ts +0 -42
- package/dist/editor/ai/terminal/useAgentRunMessagePipeline.js +0 -39
- package/dist/editor/ai/terminal/useAgentRunMessagePipeline.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunRefs.d.ts +0 -17
- package/dist/editor/ai/terminal/useAgentRunRefs.js +0 -44
- package/dist/editor/ai/terminal/useAgentRunRefs.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunResyncSocketHandler.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentRunResyncSocketHandler.js +0 -118
- package/dist/editor/ai/terminal/useAgentRunResyncSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunSequenceGuard.d.ts +0 -11
- package/dist/editor/ai/terminal/useAgentRunSequenceGuard.js +0 -22
- package/dist/editor/ai/terminal/useAgentRunSequenceGuard.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunStartSocketHandler.d.ts +0 -25
- package/dist/editor/ai/terminal/useAgentRunStartSocketHandler.js +0 -74
- package/dist/editor/ai/terminal/useAgentRunStartSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRunStatusSocketHandler.d.ts +0 -38
- package/dist/editor/ai/terminal/useAgentRunStatusSocketHandler.js +0 -365
- package/dist/editor/ai/terminal/useAgentRunStatusSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentRuntimeStatus.d.ts +0 -11
- package/dist/editor/ai/terminal/useAgentRuntimeStatus.js +0 -9
- package/dist/editor/ai/terminal/useAgentRuntimeStatus.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentServerReconciler.d.ts +0 -5
- package/dist/editor/ai/terminal/useAgentServerReconciler.js +0 -22
- package/dist/editor/ai/terminal/useAgentServerReconciler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSession.d.ts +0 -51
- package/dist/editor/ai/terminal/useAgentSession.js +0 -186
- package/dist/editor/ai/terminal/useAgentSession.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSessionCommandBindings.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentSessionCommandBindings.js +0 -30
- package/dist/editor/ai/terminal/useAgentSessionCommandBindings.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSessionErrorBridge.d.ts +0 -10
- package/dist/editor/ai/terminal/useAgentSessionErrorBridge.js +0 -14
- package/dist/editor/ai/terminal/useAgentSessionErrorBridge.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSessionFacade.d.ts +0 -51
- package/dist/editor/ai/terminal/useAgentSessionFacade.js +0 -130
- package/dist/editor/ai/terminal/useAgentSessionFacade.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSessionSocketSource.d.ts +0 -8
- package/dist/editor/ai/terminal/useAgentSessionSocketSource.js +0 -17
- package/dist/editor/ai/terminal/useAgentSessionSocketSource.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSessionSync.d.ts +0 -107
- package/dist/editor/ai/terminal/useAgentSessionSync.js +0 -192
- package/dist/editor/ai/terminal/useAgentSessionSync.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSettingsCommands.d.ts +0 -49
- package/dist/editor/ai/terminal/useAgentSettingsCommands.js +0 -210
- package/dist/editor/ai/terminal/useAgentSettingsCommands.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSettingsData.d.ts +0 -46
- package/dist/editor/ai/terminal/useAgentSettingsData.js +0 -380
- package/dist/editor/ai/terminal/useAgentSettingsData.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSettingsNavigation.d.ts +0 -10
- package/dist/editor/ai/terminal/useAgentSettingsNavigation.js +0 -33
- package/dist/editor/ai/terminal/useAgentSettingsNavigation.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSettingsPanel.d.ts +0 -87
- package/dist/editor/ai/terminal/useAgentSettingsPanel.js +0 -92
- package/dist/editor/ai/terminal/useAgentSettingsPanel.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSettingsSelectOptions.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentSettingsSelectOptions.js +0 -45
- package/dist/editor/ai/terminal/useAgentSettingsSelectOptions.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSettleCompletedRun.d.ts +0 -35
- package/dist/editor/ai/terminal/useAgentSettleCompletedRun.js +0 -51
- package/dist/editor/ai/terminal/useAgentSettleCompletedRun.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSkillActions.d.ts +0 -33
- package/dist/editor/ai/terminal/useAgentSkillActions.js +0 -210
- package/dist/editor/ai/terminal/useAgentSkillActions.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSocketMessageRouter.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentSocketMessageRouter.js +0 -52
- package/dist/editor/ai/terminal/useAgentSocketMessageRouter.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentStatusBarContent.d.ts +0 -36
- package/dist/editor/ai/terminal/useAgentStatusBarContent.js +0 -70
- package/dist/editor/ai/terminal/useAgentStatusBarContent.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentStopCommand.d.ts +0 -28
- package/dist/editor/ai/terminal/useAgentStopCommand.js +0 -55
- package/dist/editor/ai/terminal/useAgentStopCommand.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentStopGuardState.d.ts +0 -7
- package/dist/editor/ai/terminal/useAgentStopGuardState.js +0 -40
- package/dist/editor/ai/terminal/useAgentStopGuardState.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentStreamMessageFactory.d.ts +0 -5
- package/dist/editor/ai/terminal/useAgentStreamMessageFactory.js +0 -31
- package/dist/editor/ai/terminal/useAgentStreamMessageFactory.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentStreamPipeline.d.ts +0 -66
- package/dist/editor/ai/terminal/useAgentStreamPipeline.js +0 -165
- package/dist/editor/ai/terminal/useAgentStreamPipeline.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentStreamSubscription.d.ts +0 -27
- package/dist/editor/ai/terminal/useAgentStreamSubscription.js +0 -70
- package/dist/editor/ai/terminal/useAgentStreamSubscription.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentStreamWatchdog.d.ts +0 -38
- package/dist/editor/ai/terminal/useAgentStreamWatchdog.js +0 -228
- package/dist/editor/ai/terminal/useAgentStreamWatchdog.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSubmitContextBuilder.d.ts +0 -14
- package/dist/editor/ai/terminal/useAgentSubmitContextBuilder.js +0 -85
- package/dist/editor/ai/terminal/useAgentSubmitContextBuilder.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.d.ts +0 -55
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.js +0 -396
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSubmitLifecycle.d.ts +0 -31
- package/dist/editor/ai/terminal/useAgentSubmitLifecycle.js +0 -45
- package/dist/editor/ai/terminal/useAgentSubmitLifecycle.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSubmitResponseHandler.d.ts +0 -20
- package/dist/editor/ai/terminal/useAgentSubmitResponseHandler.js +0 -57
- package/dist/editor/ai/terminal/useAgentSubmitResponseHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentSummaryQuestionnaireScroll.d.ts +0 -5
- package/dist/editor/ai/terminal/useAgentSummaryQuestionnaireScroll.js +0 -32
- package/dist/editor/ai/terminal/useAgentSummaryQuestionnaireScroll.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalActions.d.ts +0 -23
- package/dist/editor/ai/terminal/useAgentTerminalActions.js +0 -54
- package/dist/editor/ai/terminal/useAgentTerminalActions.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalBackgroundEvents.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentTerminalBackgroundEvents.js +0 -16
- package/dist/editor/ai/terminal/useAgentTerminalBackgroundEvents.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalChrome.d.ts +0 -30
- package/dist/editor/ai/terminal/useAgentTerminalChrome.js +0 -12
- package/dist/editor/ai/terminal/useAgentTerminalChrome.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalController.d.ts +0 -2
- package/dist/editor/ai/terminal/useAgentTerminalController.js +0 -868
- package/dist/editor/ai/terminal/useAgentTerminalController.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalControls.d.ts +0 -19
- package/dist/editor/ai/terminal/useAgentTerminalControls.js +0 -21
- package/dist/editor/ai/terminal/useAgentTerminalControls.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalElementRefs.d.ts +0 -14
- package/dist/editor/ai/terminal/useAgentTerminalElementRefs.js +0 -17
- package/dist/editor/ai/terminal/useAgentTerminalElementRefs.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalNotices.d.ts +0 -10
- package/dist/editor/ai/terminal/useAgentTerminalNotices.js +0 -11
- package/dist/editor/ai/terminal/useAgentTerminalNotices.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalReadyEvents.d.ts +0 -7
- package/dist/editor/ai/terminal/useAgentTerminalReadyEvents.js +0 -29
- package/dist/editor/ai/terminal/useAgentTerminalReadyEvents.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalScroll.d.ts +0 -15
- package/dist/editor/ai/terminal/useAgentTerminalScroll.js +0 -63
- package/dist/editor/ai/terminal/useAgentTerminalScroll.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalUiState.d.ts +0 -27
- package/dist/editor/ai/terminal/useAgentTerminalUiState.js +0 -43
- package/dist/editor/ai/terminal/useAgentTerminalUiState.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalViewProps.d.ts +0 -19
- package/dist/editor/ai/terminal/useAgentTerminalViewProps.js +0 -22
- package/dist/editor/ai/terminal/useAgentTerminalViewProps.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTerminalViewState.d.ts +0 -32
- package/dist/editor/ai/terminal/useAgentTerminalViewState.js +0 -44
- package/dist/editor/ai/terminal/useAgentTerminalViewState.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentTextareaDropHandlers.d.ts +0 -25
- package/dist/editor/ai/terminal/useAgentTextareaDropHandlers.js +0 -187
- package/dist/editor/ai/terminal/useAgentTextareaDropHandlers.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentToolApprovalResolvedEvents.d.ts +0 -14
- package/dist/editor/ai/terminal/useAgentToolApprovalResolvedEvents.js +0 -65
- package/dist/editor/ai/terminal/useAgentToolApprovalResolvedEvents.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentToolApprovalSupersede.d.ts +0 -8
- package/dist/editor/ai/terminal/useAgentToolApprovalSupersede.js +0 -53
- package/dist/editor/ai/terminal/useAgentToolApprovalSupersede.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentToolCallHandler.d.ts +0 -12
- package/dist/editor/ai/terminal/useAgentToolCallHandler.js +0 -84
- package/dist/editor/ai/terminal/useAgentToolCallHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentToolResultHandler.d.ts +0 -12
- package/dist/editor/ai/terminal/useAgentToolResultHandler.js +0 -110
- package/dist/editor/ai/terminal/useAgentToolResultHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentToolUiEvents.d.ts +0 -5
- package/dist/editor/ai/terminal/useAgentToolUiEvents.js +0 -24
- package/dist/editor/ai/terminal/useAgentToolUiEvents.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentUserMessageSocketHandler.d.ts +0 -9
- package/dist/editor/ai/terminal/useAgentUserMessageSocketHandler.js +0 -42
- package/dist/editor/ai/terminal/useAgentUserMessageSocketHandler.js.map +0 -1
- package/dist/editor/ai/terminal/useAgentVoiceInput.d.ts +0 -16
- package/dist/editor/ai/terminal/useAgentVoiceInput.js +0 -231
- package/dist/editor/ai/terminal/useAgentVoiceInput.js.map +0 -1
- package/dist/editor/ai/terminal/useSuppressedQueuedPrompts.d.ts +0 -6
- package/dist/editor/ai/terminal/useSuppressedQueuedPrompts.js +0 -57
- package/dist/editor/ai/terminal/useSuppressedQueuedPrompts.js.map +0 -1
- package/dist/editor/ai/useActiveAgentConversation.d.ts +0 -5
- package/dist/editor/ai/useActiveAgentConversation.js +0 -52
- package/dist/editor/ai/useActiveAgentConversation.js.map +0 -1
- package/dist/editor/bridge/BridgeClient.d.ts +0 -73
- package/dist/editor/bridge/BridgeClient.js +0 -415
- package/dist/editor/bridge/BridgeClient.js.map +0 -1
- package/dist/editor/bridge/protocol.d.ts +0 -564
- package/dist/editor/bridge/protocol.js +0 -200
- package/dist/editor/bridge/protocol.js.map +0 -1
- package/dist/editor/client/SessionExpiredOverlay.d.ts +0 -1
- package/dist/editor/client/SessionExpiredOverlay.js +0 -25
- package/dist/editor/client/SessionExpiredOverlay.js.map +0 -1
- package/dist/editor/client/hooks/feedbackSocketState.d.ts +0 -6
- package/dist/editor/client/hooks/feedbackSocketState.js +0 -16
- package/dist/editor/client/hooks/feedbackSocketState.js.map +0 -1
- package/dist/editor/client/hooks/useReducedMotion.d.ts +0 -8
- package/dist/editor/client/hooks/useReducedMotion.js +0 -12
- package/dist/editor/client/hooks/useReducedMotion.js.map +0 -1
- package/dist/editor/client/hooks/workboxDescriptors.d.ts +0 -6
- package/dist/editor/client/hooks/workboxDescriptors.js +0 -49
- package/dist/editor/client/hooks/workboxDescriptors.js.map +0 -1
- package/dist/editor/client/manualShowMeFocus.d.ts +0 -17
- package/dist/editor/client/manualShowMeFocus.js +0 -32
- package/dist/editor/client/manualShowMeFocus.js.map +0 -1
- package/dist/editor/client/operationToasts.d.ts +0 -2
- package/dist/editor/client/operationToasts.js +0 -35
- package/dist/editor/client/operationToasts.js.map +0 -1
- package/dist/editor/client/realtime/realtimeTransport.d.ts +0 -56
- package/dist/editor/client/realtime/realtimeTransport.js +0 -197
- package/dist/editor/client/realtime/realtimeTransport.js.map +0 -1
- package/dist/editor/commands/placeholderCommands.d.ts +0 -17
- package/dist/editor/commands/placeholderCommands.js +0 -37
- package/dist/editor/commands/placeholderCommands.js.map +0 -1
- package/dist/editor/commands/reorderComponent.d.ts +0 -20
- package/dist/editor/commands/reorderComponent.js +0 -40
- package/dist/editor/commands/reorderComponent.js.map +0 -1
- package/dist/editor/componentFrameColors.d.ts +0 -11
- package/dist/editor/componentFrameColors.js +0 -47
- package/dist/editor/componentFrameColors.js.map +0 -1
- package/dist/editor/field-types/richtext/bridgeRichTextProfile.d.ts +0 -21
- package/dist/editor/field-types/richtext/bridgeRichTextProfile.js +0 -96
- package/dist/editor/field-types/richtext/bridgeRichTextProfile.js.map +0 -1
- package/dist/editor/field-types/richtext/richTextToolbarIcons.d.ts +0 -7
- package/dist/editor/field-types/richtext/richTextToolbarIcons.js +0 -49
- package/dist/editor/field-types/richtext/richTextToolbarIcons.js.map +0 -1
- package/dist/editor/field-types/useFormFieldCaretPresence.d.ts +0 -13
- package/dist/editor/field-types/useFormFieldCaretPresence.js +0 -92
- package/dist/editor/field-types/useFormFieldCaretPresence.js.map +0 -1
- package/dist/editor/field-types/useTextCompletion.d.ts +0 -20
- package/dist/editor/field-types/useTextCompletion.js +0 -166
- package/dist/editor/field-types/useTextCompletion.js.map +0 -1
- package/dist/editor/menubar/OpenInNewTabButton.d.ts +0 -15
- package/dist/editor/menubar/OpenInNewTabButton.js +0 -42
- package/dist/editor/menubar/OpenInNewTabButton.js.map +0 -1
- package/dist/editor/menubar/OperationsIndicator.d.ts +0 -7
- package/dist/editor/menubar/OperationsIndicator.js +0 -87
- package/dist/editor/menubar/OperationsIndicator.js.map +0 -1
- package/dist/editor/menubar/toolbar-sections/ContentTreeToggle.d.ts +0 -1
- package/dist/editor/menubar/toolbar-sections/ContentTreeToggle.js +0 -13
- package/dist/editor/menubar/toolbar-sections/ContentTreeToggle.js.map +0 -1
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.d.ts +0 -7
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js +0 -132
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js.map +0 -1
- package/dist/editor/menubar/toolbar-sections/FullscreenControl.d.ts +0 -1
- package/dist/editor/menubar/toolbar-sections/FullscreenControl.js +0 -15
- package/dist/editor/menubar/toolbar-sections/FullscreenControl.js.map +0 -1
- package/dist/editor/notifications/watchEventOptions.d.ts +0 -13
- package/dist/editor/notifications/watchEventOptions.js +0 -113
- package/dist/editor/notifications/watchEventOptions.js.map +0 -1
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.d.ts +0 -8
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js +0 -526
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js.map +0 -1
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.d.ts +0 -36
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.js +0 -879
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.js.map +0 -1
- package/dist/editor/page-editor-chrome/FeedbackHighlightBadge.d.ts +0 -22
- package/dist/editor/page-editor-chrome/FeedbackHighlightBadge.js +0 -40
- package/dist/editor/page-editor-chrome/FeedbackHighlightBadge.js.map +0 -1
- package/dist/editor/page-editor-chrome/InsertComponentMenu.d.ts +0 -26
- package/dist/editor/page-editor-chrome/InsertComponentMenu.js +0 -35
- package/dist/editor/page-editor-chrome/InsertComponentMenu.js.map +0 -1
- package/dist/editor/page-editor-chrome/bridgeInlineFormatToolbarLayout.d.ts +0 -24
- package/dist/editor/page-editor-chrome/bridgeInlineFormatToolbarLayout.js +0 -90
- package/dist/editor/page-editor-chrome/bridgeInlineFormatToolbarLayout.js.map +0 -1
- package/dist/editor/page-editor-chrome/componentDragObject.d.ts +0 -10
- package/dist/editor/page-editor-chrome/componentDragObject.js +0 -22
- package/dist/editor/page-editor-chrome/componentDragObject.js.map +0 -1
- package/dist/editor/page-editor-chrome/insertTargetLabel.d.ts +0 -6
- package/dist/editor/page-editor-chrome/insertTargetLabel.js +0 -21
- package/dist/editor/page-editor-chrome/insertTargetLabel.js.map +0 -1
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.d.ts +0 -62
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js +0 -306
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js.map +0 -1
- package/dist/editor/page-editor-chrome/overlay/InsertionLine.d.ts +0 -44
- package/dist/editor/page-editor-chrome/overlay/InsertionLine.js +0 -160
- package/dist/editor/page-editor-chrome/overlay/InsertionLine.js.map +0 -1
- package/dist/editor/page-editor-chrome/overlay/geometry.d.ts +0 -83
- package/dist/editor/page-editor-chrome/overlay/geometry.js +0 -349
- package/dist/editor/page-editor-chrome/overlay/geometry.js.map +0 -1
- package/dist/editor/page-editor-chrome/overlay/placeholderZones.d.ts +0 -66
- package/dist/editor/page-editor-chrome/overlay/placeholderZones.js +0 -274
- package/dist/editor/page-editor-chrome/overlay/placeholderZones.js.map +0 -1
- package/dist/editor/page-editor-chrome/overlay/useOverlayMeasurement.d.ts +0 -10
- package/dist/editor/page-editor-chrome/overlay/useOverlayMeasurement.js +0 -28
- package/dist/editor/page-editor-chrome/overlay/useOverlayMeasurement.js.map +0 -1
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.d.ts +0 -29
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js +0 -334
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js.map +0 -1
- package/dist/editor/page-editor-chrome/useComponentDragHandle.d.ts +0 -23
- package/dist/editor/page-editor-chrome/useComponentDragHandle.js +0 -41
- package/dist/editor/page-editor-chrome/useComponentDragHandle.js.map +0 -1
- package/dist/editor/page-editor-chrome/useDragInsertionGesture.d.ts +0 -23
- package/dist/editor/page-editor-chrome/useDragInsertionGesture.js +0 -207
- package/dist/editor/page-editor-chrome/useDragInsertionGesture.js.map +0 -1
- package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.d.ts +0 -2
- package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.js +0 -18
- package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.js.map +0 -1
- package/dist/editor/page-viewer/MinimapDropTargets.d.ts +0 -13
- package/dist/editor/page-viewer/MinimapDropTargets.js +0 -140
- package/dist/editor/page-viewer/MinimapDropTargets.js.map +0 -1
- package/dist/editor/page-viewer/bridgeFieldPatch.d.ts +0 -19
- package/dist/editor/page-viewer/bridgeFieldPatch.js +0 -33
- package/dist/editor/page-viewer/bridgeFieldPatch.js.map +0 -1
- package/dist/editor/reviews/FeedbackCard.d.ts +0 -23
- package/dist/editor/reviews/FeedbackCard.js +0 -32
- package/dist/editor/reviews/FeedbackCard.js.map +0 -1
- package/dist/editor/reviews/FeedbackModeIntro.d.ts +0 -15
- package/dist/editor/reviews/FeedbackModeIntro.js +0 -22
- package/dist/editor/reviews/FeedbackModeIntro.js.map +0 -1
- package/dist/editor/reviews/MentionText.d.ts +0 -3
- package/dist/editor/reviews/MentionText.js +0 -139
- package/dist/editor/reviews/MentionText.js.map +0 -1
- package/dist/editor/reviews/SuggestionCommentThread.d.ts +0 -14
- package/dist/editor/reviews/SuggestionCommentThread.js +0 -151
- package/dist/editor/reviews/SuggestionCommentThread.js.map +0 -1
- package/dist/editor/reviews/commentTransientSelection.d.ts +0 -23
- package/dist/editor/reviews/commentTransientSelection.js +0 -7
- package/dist/editor/reviews/commentTransientSelection.js.map +0 -1
- package/dist/editor/reviews/feedbackAvatar.d.ts +0 -14
- package/dist/editor/reviews/feedbackAvatar.js +0 -86
- package/dist/editor/reviews/feedbackAvatar.js.map +0 -1
- package/dist/editor/reviews/feedbackCommentRules.d.ts +0 -3
- package/dist/editor/reviews/feedbackCommentRules.js +0 -15
- package/dist/editor/reviews/feedbackCommentRules.js.map +0 -1
- package/dist/editor/reviews/feedbackOrdering.d.ts +0 -5
- package/dist/editor/reviews/feedbackOrdering.js +0 -27
- package/dist/editor/reviews/feedbackOrdering.js.map +0 -1
- package/dist/editor/reviews/feedbackScrollTarget.d.ts +0 -19
- package/dist/editor/reviews/feedbackScrollTarget.js +0 -171
- package/dist/editor/reviews/feedbackScrollTarget.js.map +0 -1
- package/dist/editor/reviews/feedbackSelection.d.ts +0 -3
- package/dist/editor/reviews/feedbackSelection.js +0 -65
- package/dist/editor/reviews/feedbackSelection.js.map +0 -1
- package/dist/editor/reviews/feedbackSidebarText.d.ts +0 -2
- package/dist/editor/reviews/feedbackSidebarText.js +0 -3
- package/dist/editor/reviews/feedbackSidebarText.js.map +0 -1
- package/dist/editor/reviews/latestFeedbackData.d.ts +0 -11
- package/dist/editor/reviews/latestFeedbackData.js +0 -40
- package/dist/editor/reviews/latestFeedbackData.js.map +0 -1
- package/dist/editor/reviews/openCommentsFeedback.d.ts +0 -35
- package/dist/editor/reviews/openCommentsFeedback.js +0 -89
- package/dist/editor/reviews/openCommentsFeedback.js.map +0 -1
- package/dist/editor/reviews/suggestedEditState.d.ts +0 -14
- package/dist/editor/reviews/suggestedEditState.js +0 -110
- package/dist/editor/reviews/suggestedEditState.js.map +0 -1
- package/dist/editor/reviews/suggestionContentChange.d.ts +0 -2
- package/dist/editor/reviews/suggestionContentChange.js +0 -29
- package/dist/editor/reviews/suggestionContentChange.js.map +0 -1
- package/dist/editor/reviews/suggestionDisplayValue.d.ts +0 -43
- package/dist/editor/reviews/suggestionDisplayValue.js +0 -93
- package/dist/editor/reviews/suggestionDisplayValue.js.map +0 -1
- package/dist/editor/services/manualService.d.ts +0 -31
- package/dist/editor/services/manualService.js +0 -77
- package/dist/editor/services/manualService.js.map +0 -1
- package/dist/editor/services/userResolution.d.ts +0 -18
- package/dist/editor/services/userResolution.js +0 -86
- package/dist/editor/services/userResolution.js.map +0 -1
- package/dist/editor/services/userService.d.ts +0 -14
- package/dist/editor/services/userService.js +0 -39
- package/dist/editor/services/userService.js.map +0 -1
- package/dist/editor/settings/SettingsCard.d.ts +0 -4
- package/dist/editor/settings/SettingsCard.js +0 -7
- package/dist/editor/settings/SettingsCard.js.map +0 -1
- package/dist/editor/settings/SettingsPanelLayout.d.ts +0 -28
- package/dist/editor/settings/SettingsPanelLayout.js +0 -24
- package/dist/editor/settings/SettingsPanelLayout.js.map +0 -1
- package/dist/editor/settings/panels/AgentToolsPanel.d.ts +0 -2
- package/dist/editor/settings/panels/AgentToolsPanel.js +0 -178
- package/dist/editor/settings/panels/AgentToolsPanel.js.map +0 -1
- package/dist/editor/settings/panels/CreateMcpServerDialog.d.ts +0 -7
- package/dist/editor/settings/panels/CreateMcpServerDialog.js +0 -79
- package/dist/editor/settings/panels/CreateMcpServerDialog.js.map +0 -1
- package/dist/editor/settings/panels/FieldTypeSerializersPanel.d.ts +0 -2
- package/dist/editor/settings/panels/FieldTypeSerializersPanel.js +0 -52
- package/dist/editor/settings/panels/FieldTypeSerializersPanel.js.map +0 -1
- package/dist/editor/settings/panels/NotificationSubscriptionsPanel.d.ts +0 -2
- package/dist/editor/settings/panels/NotificationSubscriptionsPanel.js +0 -156
- package/dist/editor/settings/panels/NotificationSubscriptionsPanel.js.map +0 -1
- package/dist/editor/settings/panels/ProjectTemplateSelectorList.d.ts +0 -13
- package/dist/editor/settings/panels/ProjectTemplateSelectorList.js +0 -43
- package/dist/editor/settings/panels/ProjectTemplateSelectorList.js.map +0 -1
- package/dist/editor/settings/panels/SystemSettingsPanel.d.ts +0 -2
- package/dist/editor/settings/panels/SystemSettingsPanel.js +0 -69
- package/dist/editor/settings/panels/SystemSettingsPanel.js.map +0 -1
- package/dist/editor/settings/panels/UserPreferencesPanel.d.ts +0 -2
- package/dist/editor/settings/panels/UserPreferencesPanel.js +0 -66
- package/dist/editor/settings/panels/UserPreferencesPanel.js.map +0 -1
- package/dist/editor/sidebar/ContentTreePanel.d.ts +0 -3
- package/dist/editor/sidebar/ContentTreePanel.js +0 -14
- package/dist/editor/sidebar/ContentTreePanel.js.map +0 -1
- package/dist/editor/sidebar/contentTreeConstants.d.ts +0 -2
- package/dist/editor/sidebar/contentTreeConstants.js +0 -3
- package/dist/editor/sidebar/contentTreeConstants.js.map +0 -1
- package/dist/editor/ui/HomeListRow.d.ts +0 -11
- package/dist/editor/ui/HomeListRow.js +0 -11
- package/dist/editor/ui/HomeListRow.js.map +0 -1
- package/dist/editor/ui/LoadingState.d.ts +0 -11
- package/dist/editor/ui/LoadingState.js +0 -27
- package/dist/editor/ui/LoadingState.js.map +0 -1
- package/dist/editor/ui/PublishDialog.d.ts +0 -11
- package/dist/editor/ui/PublishDialog.js +0 -101
- package/dist/editor/ui/PublishDialog.js.map +0 -1
- package/dist/editor/ui/WorkboxItemsTable.d.ts +0 -15
- package/dist/editor/ui/WorkboxItemsTable.js +0 -142
- package/dist/editor/ui/WorkboxItemsTable.js.map +0 -1
- package/dist/editor/ui/animationSettle.d.ts +0 -32
- package/dist/editor/ui/animationSettle.js +0 -85
- package/dist/editor/ui/animationSettle.js.map +0 -1
- package/dist/editor/ui/splitterResizeEvent.d.ts +0 -9
- package/dist/editor/ui/splitterResizeEvent.js +0 -13
- package/dist/editor/ui/splitterResizeEvent.js.map +0 -1
- package/dist/editor/utils/dedupeInflight.d.ts +0 -1
- package/dist/editor/utils/dedupeInflight.js +0 -13
- package/dist/editor/utils/dedupeInflight.js.map +0 -1
- package/dist/editor/utils/expandSelectionAtCaret.d.ts +0 -15
- package/dist/editor/utils/expandSelectionAtCaret.js +0 -183
- package/dist/editor/utils/expandSelectionAtCaret.js.map +0 -1
- package/dist/editor/views/ItemEditorPane.d.ts +0 -11
- package/dist/editor/views/ItemEditorPane.js +0 -19
- package/dist/editor/views/ItemEditorPane.js.map +0 -1
- package/dist/editor/workflowFields.d.ts +0 -1
- package/dist/editor/workflowFields.js +0 -16
- package/dist/editor/workflowFields.js.map +0 -1
- package/dist/lib/pointerDrag.d.ts +0 -20
- package/dist/lib/pointerDrag.js +0 -57
- package/dist/lib/pointerDrag.js.map +0 -1
- package/dist/logging/consolePrefix.d.ts +0 -2
- package/dist/logging/consolePrefix.js +0 -49
- package/dist/logging/consolePrefix.js.map +0 -1
- package/dist/logging/index.d.ts +0 -1
- package/dist/logging/index.js +0 -2
- package/dist/logging/index.js.map +0 -1
- package/dist/logging/install-browser-console.js +0 -3
- package/dist/logging/install-browser-console.js.map +0 -1
- package/dist/task-board/components/FinishedProjectCard.d.ts +0 -5
- package/dist/task-board/components/FinishedProjectCard.js +0 -8
- package/dist/task-board/components/FinishedProjectCard.js.map +0 -1
- package/dist/task-board/components/TaskAssigneeBadge.d.ts +0 -16
- package/dist/task-board/components/TaskAssigneeBadge.js +0 -21
- package/dist/task-board/components/TaskAssigneeBadge.js.map +0 -1
- package/dist/task-board/components/TaskAttachmentDropZone.d.ts +0 -11
- package/dist/task-board/components/TaskAttachmentDropZone.js +0 -100
- package/dist/task-board/components/TaskAttachmentDropZone.js.map +0 -1
- package/dist/task-board/components/TaskBoardBreadcrumb.d.ts +0 -17
- package/dist/task-board/components/TaskBoardBreadcrumb.js +0 -14
- package/dist/task-board/components/TaskBoardBreadcrumb.js.map +0 -1
- package/dist/task-board/components/TaskBoardFilterBox.d.ts +0 -4
- package/dist/task-board/components/TaskBoardFilterBox.js +0 -7
- package/dist/task-board/components/TaskBoardFilterBox.js.map +0 -1
- package/dist/task-board/components/TaskBoardHomeView.d.ts +0 -7
- package/dist/task-board/components/TaskBoardHomeView.js +0 -21
- package/dist/task-board/components/TaskBoardHomeView.js.map +0 -1
- package/dist/task-board/components/TaskBoardProjectSelector.d.ts +0 -8
- package/dist/task-board/components/TaskBoardProjectSelector.js +0 -20
- package/dist/task-board/components/TaskBoardProjectSelector.js.map +0 -1
- package/dist/task-board/taskPriority.d.ts +0 -4
- package/dist/task-board/taskPriority.js +0 -19
- package/dist/task-board/taskPriority.js.map +0 -1
- /package/dist/editor/ai/{terminal/components/AgentBanners.d.ts → AgentBanners.d.ts} +0 -0
- /package/dist/editor/ai/{terminal/components/AgentCostDisplay.d.ts → AgentCostDisplay.d.ts} +0 -0
- /package/dist/editor/ai/{terminal/components/ToolCallDisplay.d.ts → ToolCallDisplay.d.ts} +0 -0
- /package/dist/{logging/install-browser-console.d.ts → editor/ai/agentDiagnostics.test.d.ts} +0 -0
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { MiniMap } from "./MiniMap";
|
|
4
4
|
import { useEditContext, useEditContextRef, useFieldsEditContext, useFieldsEditContextRef, } from "../client/editContext";
|
|
5
|
-
import { useSlotContext } from "../views/editorSlotContext";
|
|
6
5
|
import { useDebouncedCallback, useThrottledCallback } from "use-debounce";
|
|
7
6
|
import { PageEditorChrome } from "../page-editor-chrome/PageEditorChrome";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { IFRAME_OVERLAY_BRIDGE_DRAG_GESTURE_EVENT, IFRAME_OVERLAY_BRIDGE_GEOMETRY_EVENT, IFRAME_OVERLAY_BRIDGE_SCROLL_EVENT, IframeOverlayProvider, } from "../page-editor-chrome/overlay/IframeOverlayProvider";
|
|
11
|
-
import { DEVICE_CHANGE_EVENT, useViewportChangeSignal, } from "./pageViewContext";
|
|
7
|
+
import { useViewportChangeSignal } from "./pageViewContext";
|
|
8
|
+
import morphdom from "morphdom";
|
|
12
9
|
import uuid from "react-uuid";
|
|
13
10
|
import { cn } from "../../lib/utils";
|
|
14
|
-
import {
|
|
11
|
+
import { findComponentRect, findFieldElement, findNearestEditableComponentId, findParentWithAttribute, getAbsolutePosition, getFieldDescriptorFromElement, findClosestFieldElement, extractItemIdFromItemUri, } from "../utils";
|
|
12
|
+
import { extractDOMSelectionContext } from "../utils/selectionContext";
|
|
15
13
|
import { cleanId } from "../utils/id-helper";
|
|
16
|
-
import { getComponentById } from "../componentTreeHelper";
|
|
14
|
+
import { getAllComponentInstances, getComponentById, } from "../componentTreeHelper";
|
|
17
15
|
import { buildComponentContextMenuItems } from "../ContextMenu";
|
|
18
16
|
import { loadFieldButtons } from "../services/editService";
|
|
19
17
|
import { usePathname } from "../client/navigation";
|
|
@@ -22,625 +20,34 @@ import { FieldActionsOverlay, } from "../FieldActionsOverlay";
|
|
|
22
20
|
import { NoLayout } from "../page-editor-chrome/NoLayout";
|
|
23
21
|
import { Spinner } from "../ui/Spinner";
|
|
24
22
|
import { DeviceToolbar } from "./DeviceToolbar";
|
|
25
|
-
import {
|
|
23
|
+
import { buildPageModelSkeleton } from "./pageModelSkeletonBuilder";
|
|
26
24
|
import { toSitecoreDate } from "../utils/sitecoreDate";
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
import { buildBridgeFieldPatchPayload, getBridgeFieldPatchValue, } from "./bridgeFieldPatch";
|
|
30
|
-
const ZOOM_MIN = 0.25;
|
|
31
|
-
const ZOOM_MAX = 2;
|
|
32
|
-
const ZOOM_STEP = 0.25;
|
|
33
|
-
const ZOOM_TRANSITION_MS = 300;
|
|
34
|
-
const BRIDGE_INLINE_EDIT_RELEASE_EVENT = "parhelia:bridge-inline-edit-release";
|
|
35
|
-
const INLINE_AI_CLOSE_EVENT = "inline-ai-close";
|
|
36
|
-
const BRIDGE_INLINE_LINK_OPEN_EVENT = "bridge-inline-link-open";
|
|
37
|
-
const SCROLL_INTO_VIEW_BRIDGE_SOURCE = "scroll-into-view";
|
|
38
|
-
// Suggestions-mode cursor: a text I-beam (the click insertion point) badged with
|
|
39
|
-
// the lucide PenLine icon from the "Suggestions mode" toolbar button. A white
|
|
40
|
-
// halo keeps it visible on any page background; the hotspot is the I-beam centre.
|
|
41
|
-
const SUGGESTIONS_CURSOR_PEN_PATHS = '<path d="M12 20h9"/>' +
|
|
42
|
-
'<path d="M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z"/>';
|
|
43
|
-
const SUGGESTIONS_CURSOR_BEAM_PATHS = '<path d="M5 5.5V22.5"/><path d="M2.5 5.5H7.5"/><path d="M2.5 22.5H7.5"/>';
|
|
44
|
-
const SUGGESTIONS_CURSOR_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none" stroke-linecap="round" stroke-linejoin="round">' +
|
|
45
|
-
// White halo, drawn first so the dark ink sits on top of it.
|
|
46
|
-
'<g stroke="#ffffff">' +
|
|
47
|
-
'<g stroke-width="4">' +
|
|
48
|
-
SUGGESTIONS_CURSOR_BEAM_PATHS +
|
|
49
|
-
"</g>" +
|
|
50
|
-
'<g transform="translate(11 -1.5) scale(0.7)" stroke-width="5">' +
|
|
51
|
-
SUGGESTIONS_CURSOR_PEN_PATHS +
|
|
52
|
-
"</g>" +
|
|
53
|
-
"</g>" +
|
|
54
|
-
// Dark ink: the I-beam (text insertion point) plus the pen badge.
|
|
55
|
-
'<g stroke="#121212">' +
|
|
56
|
-
'<g stroke-width="2">' +
|
|
57
|
-
SUGGESTIONS_CURSOR_BEAM_PATHS +
|
|
58
|
-
"</g>" +
|
|
59
|
-
'<g transform="translate(11 -1.5) scale(0.7)" stroke-width="2.6">' +
|
|
60
|
-
SUGGESTIONS_CURSOR_PEN_PATHS +
|
|
61
|
-
"</g>" +
|
|
62
|
-
"</g>" +
|
|
63
|
-
"</svg>";
|
|
64
|
-
const SUGGESTIONS_CURSOR_IMAGE = "data:image/svg+xml," + encodeURIComponent(SUGGESTIONS_CURSOR_SVG);
|
|
65
|
-
const SUGGESTIONS_CURSOR_VALUE = `url("${SUGGESTIONS_CURSOR_IMAGE}") 5 14, default`;
|
|
66
|
-
function getSelectedRangeInlineEditInteraction(range) {
|
|
67
|
-
if (!range?.text?.trim() || !range.elementKey || !range.fieldId) {
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
const item = range.itemId && range.language && typeof range.version === "number"
|
|
71
|
-
? {
|
|
72
|
-
id: range.itemId,
|
|
73
|
-
language: range.language,
|
|
74
|
-
version: range.version,
|
|
75
|
-
}
|
|
76
|
-
: undefined;
|
|
77
|
-
return {
|
|
78
|
-
kind: "click",
|
|
79
|
-
elementKey: range.elementKey,
|
|
80
|
-
fieldId: range.fieldId,
|
|
81
|
-
item,
|
|
82
|
-
selectedText: range.text,
|
|
83
|
-
selectionStartOffset: range.startOffset,
|
|
84
|
-
selectionEndOffset: range.endOffset,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function dispatchBridgeOverlayScroll(iframe, scroll, scrollScale = 1) {
|
|
88
|
-
iframe?.dispatchEvent(new CustomEvent(IFRAME_OVERLAY_BRIDGE_SCROLL_EVENT, {
|
|
89
|
-
detail: {
|
|
90
|
-
scrollLeft: scroll.x * scrollScale,
|
|
91
|
-
scrollTop: scroll.y * scrollScale,
|
|
92
|
-
},
|
|
93
|
-
}));
|
|
94
|
-
}
|
|
95
|
-
function getBridgeGeometryScrollScale(geometry) {
|
|
96
|
-
return typeof geometry?.scrollScale === "number" &&
|
|
97
|
-
Number.isFinite(geometry.scrollScale) &&
|
|
98
|
-
geometry.scrollScale > 0
|
|
99
|
-
? geometry.scrollScale
|
|
100
|
-
: 1;
|
|
101
|
-
}
|
|
102
|
-
function dispatchBridgeOverlayGeometry(iframe, geometry, scrollOverride) {
|
|
103
|
-
const documentSize = getBridgeGeometryDocumentSize(geometry);
|
|
104
|
-
const scrollScale = getBridgeGeometryScrollScale(geometry);
|
|
105
|
-
const scroll = scrollOverride ?? geometry?.scroll;
|
|
106
|
-
const detail = {
|
|
107
|
-
scrollLeft: (scroll?.x ?? 0) * scrollScale,
|
|
108
|
-
scrollTop: (scroll?.y ?? 0) * scrollScale,
|
|
109
|
-
viewportWidth: geometry?.viewport.width,
|
|
110
|
-
viewportHeight: geometry?.viewport.height,
|
|
111
|
-
scrollWidth: documentSize?.width,
|
|
112
|
-
scrollHeight: documentSize?.height,
|
|
113
|
-
};
|
|
114
|
-
iframe?.dispatchEvent(new CustomEvent(IFRAME_OVERLAY_BRIDGE_GEOMETRY_EVENT, { detail }));
|
|
115
|
-
}
|
|
116
|
-
function getBridgeGeometryDocumentSize(geometry) {
|
|
117
|
-
if (!geometry)
|
|
118
|
-
return undefined;
|
|
119
|
-
const rectScale = geometry.rectScale ?? 1;
|
|
120
|
-
const scrollScale = getBridgeGeometryScrollScale(geometry);
|
|
121
|
-
return {
|
|
122
|
-
width: Math.max(geometry.viewport.width, ...geometry.targets.map((target) => target.rect.right * rectScale + geometry.scroll.x * scrollScale)),
|
|
123
|
-
height: Math.max(geometry.viewport.height, ...geometry.targets.map((target) => target.rect.bottom * rectScale + geometry.scroll.y * scrollScale)),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function bridgeKeysMatch(left, right) {
|
|
127
|
-
const normalizedLeft = normalizeMarkerId(left);
|
|
128
|
-
const normalizedRight = normalizeMarkerId(right);
|
|
129
|
-
return (!!normalizedLeft && !!normalizedRight && normalizedLeft === normalizedRight);
|
|
130
|
-
}
|
|
131
|
-
function bridgeItemMatches(item, descriptor) {
|
|
132
|
-
if (!item)
|
|
133
|
-
return false;
|
|
134
|
-
if (!bridgeKeysMatch(item.id, descriptor.id))
|
|
135
|
-
return false;
|
|
136
|
-
if (item.language &&
|
|
137
|
-
descriptor.language &&
|
|
138
|
-
item.language !== descriptor.language) {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
if (item.version !== undefined &&
|
|
142
|
-
descriptor.version !== undefined &&
|
|
143
|
-
item.version !== descriptor.version) {
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
function bridgeTargetToDocumentBounds(geometry, target) {
|
|
149
|
-
const rectScale = geometry.rectScale ?? 1;
|
|
150
|
-
const scrollScale = getBridgeGeometryScrollScale(geometry);
|
|
151
|
-
return {
|
|
152
|
-
x: target.rect.left * rectScale + geometry.scroll.x * scrollScale,
|
|
153
|
-
y: target.rect.top * rectScale + geometry.scroll.y * scrollScale,
|
|
154
|
-
width: target.rect.width * rectScale,
|
|
155
|
-
height: target.rect.height * rectScale,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
function findBridgeFieldDocumentBounds(geometry, descriptor) {
|
|
159
|
-
if (!geometry)
|
|
160
|
-
return undefined;
|
|
161
|
-
const target = geometry.targets.find((candidate) => {
|
|
162
|
-
if (candidate.kind !== "field")
|
|
163
|
-
return false;
|
|
164
|
-
return (bridgeKeysMatch(candidate.fieldId, descriptor.fieldId) &&
|
|
165
|
-
bridgeItemMatches(candidate.item, descriptor.item));
|
|
166
|
-
});
|
|
167
|
-
return target?.rect
|
|
168
|
-
? bridgeTargetToDocumentBounds(geometry, target)
|
|
169
|
-
: undefined;
|
|
170
|
-
}
|
|
171
|
-
function findBridgeTextRangeDocumentBounds(geometry, key) {
|
|
172
|
-
if (!geometry || !key)
|
|
173
|
-
return undefined;
|
|
174
|
-
const bounds = geometry.targets
|
|
175
|
-
.filter((candidate) => candidate.kind === "textRange" &&
|
|
176
|
-
candidate.key === key &&
|
|
177
|
-
(candidate.rect.width > 0 || candidate.rect.height > 0))
|
|
178
|
-
.map((target) => bridgeTargetToDocumentBounds(geometry, target));
|
|
179
|
-
return unionDocumentBounds(bounds);
|
|
180
|
-
}
|
|
181
|
-
function findBridgeComponentDocumentBounds(geometry, componentId) {
|
|
182
|
-
if (!geometry)
|
|
183
|
-
return undefined;
|
|
184
|
-
const target = geometry.targets.find((candidate) => {
|
|
185
|
-
if (candidate.kind !== "component")
|
|
186
|
-
return false;
|
|
187
|
-
return (bridgeKeysMatch(candidate.componentId, componentId) ||
|
|
188
|
-
bridgeKeysMatch(candidate.key, componentId));
|
|
189
|
-
});
|
|
190
|
-
return target?.rect
|
|
191
|
-
? bridgeTargetToDocumentBounds(geometry, target)
|
|
192
|
-
: undefined;
|
|
193
|
-
}
|
|
194
|
-
function unionDocumentBounds(bounds) {
|
|
195
|
-
if (bounds.length === 0)
|
|
196
|
-
return undefined;
|
|
197
|
-
let left = Number.POSITIVE_INFINITY;
|
|
198
|
-
let top = Number.POSITIVE_INFINITY;
|
|
199
|
-
let right = Number.NEGATIVE_INFINITY;
|
|
200
|
-
let bottom = Number.NEGATIVE_INFINITY;
|
|
201
|
-
bounds.forEach((rect) => {
|
|
202
|
-
left = Math.min(left, rect.x);
|
|
203
|
-
top = Math.min(top, rect.y);
|
|
204
|
-
right = Math.max(right, rect.x + rect.width);
|
|
205
|
-
bottom = Math.max(bottom, rect.y + rect.height);
|
|
206
|
-
});
|
|
207
|
-
if (!Number.isFinite(left) || !Number.isFinite(top))
|
|
208
|
-
return undefined;
|
|
209
|
-
return {
|
|
210
|
-
x: left,
|
|
211
|
-
y: top,
|
|
212
|
-
width: Math.max(0, right - left),
|
|
213
|
-
height: Math.max(0, bottom - top),
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
function findScrollIntoViewDocumentBounds(geometry, target, options = {}) {
|
|
217
|
-
if (typeof target === "string") {
|
|
218
|
-
return findBridgeComponentDocumentBounds(geometry, target);
|
|
219
|
-
}
|
|
220
|
-
if (target.kind === "component") {
|
|
221
|
-
return findBridgeComponentDocumentBounds(geometry, target.componentId);
|
|
222
|
-
}
|
|
223
|
-
if (target.kind === "field") {
|
|
224
|
-
return (findBridgeFieldDocumentBounds(geometry, target.field) ??
|
|
225
|
-
(target.fallbackComponentId
|
|
226
|
-
? findBridgeComponentDocumentBounds(geometry, target.fallbackComponentId)
|
|
227
|
-
: undefined));
|
|
228
|
-
}
|
|
229
|
-
const textRangeBounds = findBridgeTextRangeDocumentBounds(geometry, target.key);
|
|
230
|
-
if (textRangeBounds || !options.includeTextRangeFallback) {
|
|
231
|
-
return textRangeBounds;
|
|
232
|
-
}
|
|
233
|
-
return ((target.fallbackField
|
|
234
|
-
? findBridgeFieldDocumentBounds(geometry, target.fallbackField)
|
|
235
|
-
: undefined) ??
|
|
236
|
-
(target.fallbackComponentId
|
|
237
|
-
? findBridgeComponentDocumentBounds(geometry, target.fallbackComponentId)
|
|
238
|
-
: undefined));
|
|
239
|
-
}
|
|
240
|
-
function isTextRangeScrollTarget(target) {
|
|
241
|
-
return typeof target !== "string" && target.kind === "textRange";
|
|
242
|
-
}
|
|
243
|
-
function getScrollIntoViewSignature(target) {
|
|
244
|
-
if (typeof target === "string")
|
|
245
|
-
return `component:${target}`;
|
|
246
|
-
if (target.kind === "component")
|
|
247
|
-
return `component:${target.componentId}`;
|
|
248
|
-
if (target.kind === "field") {
|
|
249
|
-
return [
|
|
250
|
-
"field",
|
|
251
|
-
target.field.fieldId,
|
|
252
|
-
target.field.item.id,
|
|
253
|
-
target.field.item.language,
|
|
254
|
-
target.field.item.version,
|
|
255
|
-
].join(":");
|
|
256
|
-
}
|
|
257
|
-
return [
|
|
258
|
-
"textRange",
|
|
259
|
-
target.key,
|
|
260
|
-
...(target.textRanges || []).map((range) => [
|
|
261
|
-
range.key,
|
|
262
|
-
range.elementKey,
|
|
263
|
-
range.fieldId,
|
|
264
|
-
range.item?.id,
|
|
265
|
-
range.item?.language,
|
|
266
|
-
range.item?.version,
|
|
267
|
-
range.start,
|
|
268
|
-
range.end,
|
|
269
|
-
].join(":")),
|
|
270
|
-
].join("|");
|
|
271
|
-
}
|
|
272
|
-
function requestScrollTargetGeometry(pageViewContext, target) {
|
|
273
|
-
const textRanges = target.textRanges?.filter((range) => !!range);
|
|
274
|
-
if (!textRanges?.length)
|
|
275
|
-
return false;
|
|
276
|
-
return (pageViewContext.requestBridgeGeometry?.({
|
|
277
|
-
source: SCROLL_INTO_VIEW_BRIDGE_SOURCE,
|
|
278
|
-
textRanges,
|
|
279
|
-
}) ?? false);
|
|
280
|
-
}
|
|
281
|
-
function scrollBridgeBoundsIntoView(pageViewContext, bounds, currentScroll) {
|
|
282
|
-
const geometry = pageViewContext.bridgeGeometry;
|
|
283
|
-
if (!geometry)
|
|
284
|
-
return false;
|
|
285
|
-
const scrollScale = getBridgeGeometryScrollScale(geometry);
|
|
286
|
-
const currentScrollY = (currentScroll?.y ?? geometry.scroll.y) * scrollScale;
|
|
287
|
-
const viewportHeight = geometry.viewport.height;
|
|
288
|
-
const isInViewport = bounds.y + bounds.height > currentScrollY &&
|
|
289
|
-
bounds.y < currentScrollY + viewportHeight;
|
|
290
|
-
if (isInViewport)
|
|
291
|
-
return false;
|
|
292
|
-
const targetScrollY = bounds.y - viewportHeight / 2 + Math.max(bounds.height, 1) / 2;
|
|
293
|
-
return (pageViewContext.requestBridgeScrollBy?.({
|
|
294
|
-
y: targetScrollY - currentScrollY,
|
|
295
|
-
behavior: "smooth",
|
|
296
|
-
}) ?? false);
|
|
297
|
-
}
|
|
298
|
-
function getAccessibleIframeDocument(iframe) {
|
|
299
|
-
try {
|
|
300
|
-
return iframe?.contentDocument ?? null;
|
|
301
|
-
}
|
|
302
|
-
catch {
|
|
303
|
-
// Cross-origin hosts expose a WindowProxy whose document access throws.
|
|
304
|
-
return null;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
function getIframeWindowScroll(iframe) {
|
|
308
|
-
try {
|
|
309
|
-
const win = iframe?.contentWindow;
|
|
310
|
-
const doc = win?.document;
|
|
311
|
-
if (!win || !doc)
|
|
312
|
-
return undefined;
|
|
313
|
-
const scrollingElement = doc.scrollingElement;
|
|
314
|
-
return {
|
|
315
|
-
x: Math.max(win.scrollX || 0, scrollingElement?.scrollLeft || 0, doc.documentElement?.scrollLeft || 0, doc.body?.scrollLeft || 0),
|
|
316
|
-
y: Math.max(win.scrollY || 0, scrollingElement?.scrollTop || 0, doc.documentElement?.scrollTop || 0, doc.body?.scrollTop || 0),
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
catch {
|
|
320
|
-
return undefined;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function restoreIframeWindowScroll(iframe, targetScroll) {
|
|
324
|
-
if (!targetScroll)
|
|
325
|
-
return false;
|
|
326
|
-
try {
|
|
327
|
-
const win = iframe?.contentWindow;
|
|
328
|
-
if (!win)
|
|
329
|
-
return false;
|
|
330
|
-
let attempts = 0;
|
|
331
|
-
const apply = () => {
|
|
332
|
-
try {
|
|
333
|
-
attempts += 1;
|
|
334
|
-
win.scrollTo(targetScroll.x, targetScroll.y);
|
|
335
|
-
const settled = Math.abs((win.scrollX || 0) - targetScroll.x) <= 1 &&
|
|
336
|
-
Math.abs((win.scrollY || 0) - targetScroll.y) <= 1;
|
|
337
|
-
if (!settled && attempts < 8) {
|
|
338
|
-
window.requestAnimationFrame(apply);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
catch {
|
|
342
|
-
// Cross-origin preview frames expose a WindowProxy, but reading named
|
|
343
|
-
// properties such as scrollTo/scrollX can throw. In that case the
|
|
344
|
-
// bridge-side scroll restoration is responsible for preserving scroll.
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
window.requestAnimationFrame(apply);
|
|
348
|
-
return true;
|
|
349
|
-
}
|
|
350
|
-
catch {
|
|
351
|
-
return false;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function applyIframeZoom(_iframe, _zoom, _location) {
|
|
355
|
-
// Zoom is applied inside the page host through the bridge setZoom command.
|
|
356
|
-
}
|
|
357
|
-
function clampEditorZoom(value) {
|
|
358
|
-
return Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, value));
|
|
359
|
-
}
|
|
360
|
-
function isLoopbackHost(hostname) {
|
|
361
|
-
return hostname === "localhost" || hostname === "127.0.0.1";
|
|
362
|
-
}
|
|
363
|
-
function alignLoopbackHostToEditor(url) {
|
|
364
|
-
if (isLoopbackHost(window.location.hostname) &&
|
|
365
|
-
isLoopbackHost(url.hostname)) {
|
|
366
|
-
// Sitecore auth cookies are host-scoped, so localhost and 127.0.0.1 are
|
|
367
|
-
// different origins even when they point at the same machine.
|
|
368
|
-
url.hostname = window.location.hostname;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
function isXmCloudManagedEditingHost(url) {
|
|
372
|
-
return url.hostname.endsWith("-eh.sitecorecloud.io");
|
|
373
|
-
}
|
|
374
|
-
function alignXmCloudManagedEditingHostToEditor(url) {
|
|
375
|
-
if (window.location.hostname.endsWith(".sitecorecloud.io") &&
|
|
376
|
-
isXmCloudManagedEditingHost(url)) {
|
|
377
|
-
url.protocol = window.location.protocol;
|
|
378
|
-
url.hostname = window.location.hostname;
|
|
379
|
-
url.port = window.location.port;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
function getUrlOrigin(url) {
|
|
383
|
-
if (!url)
|
|
384
|
-
return undefined;
|
|
385
|
-
try {
|
|
386
|
-
const parsedUrl = new URL(url, window.location.href);
|
|
387
|
-
alignLoopbackHostToEditor(parsedUrl);
|
|
388
|
-
alignXmCloudManagedEditingHostToEditor(parsedUrl);
|
|
389
|
-
return parsedUrl.origin;
|
|
390
|
-
}
|
|
391
|
-
catch {
|
|
392
|
-
return undefined;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
function getEditorQueryParam(name) {
|
|
396
|
-
try {
|
|
397
|
-
return new URLSearchParams(window.location.search).get(name) || undefined;
|
|
398
|
-
}
|
|
399
|
-
catch {
|
|
400
|
-
return undefined;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
function inferRoutePathFromSitecoreItemPath(itemPath) {
|
|
404
|
-
const segments = (itemPath || "")
|
|
405
|
-
.split("/")
|
|
406
|
-
.map((segment) => segment.trim())
|
|
407
|
-
.filter(Boolean);
|
|
408
|
-
const homeIndex = segments
|
|
409
|
-
.map((segment) => segment.toLowerCase())
|
|
410
|
-
.lastIndexOf("home");
|
|
411
|
-
if (homeIndex < 0)
|
|
412
|
-
return undefined;
|
|
413
|
-
const routeSegments = segments.slice(homeIndex + 1);
|
|
414
|
-
if (routeSegments.length === 0)
|
|
415
|
-
return "/";
|
|
416
|
-
return `/${routeSegments.map(encodeURIComponent).join("/")}`;
|
|
417
|
-
}
|
|
418
|
-
function isRootRenderPath(pathname) {
|
|
419
|
-
return !pathname || pathname === "/";
|
|
420
|
-
}
|
|
421
|
-
function applyParheliaRenderContext(renderUrl, pageItemDescriptor, siteName) {
|
|
422
|
-
if (siteName) {
|
|
423
|
-
if (!renderUrl.searchParams.has("site")) {
|
|
424
|
-
renderUrl.searchParams.set("site", siteName);
|
|
425
|
-
}
|
|
426
|
-
// Same-origin Sitecore fallback URLs use sc_site for site resolution and can
|
|
427
|
-
// canonical-redirect to the public site host before the editor iframe loads.
|
|
428
|
-
if (renderUrl.origin !== window.location.origin &&
|
|
429
|
-
!renderUrl.searchParams.has("sc_site")) {
|
|
430
|
-
renderUrl.searchParams.set("sc_site", siteName);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
if (!renderUrl.searchParams.has("sc_itemid")) {
|
|
434
|
-
renderUrl.searchParams.set("sc_itemid", pageItemDescriptor.id);
|
|
435
|
-
}
|
|
436
|
-
if (!renderUrl.searchParams.has("sc_lang")) {
|
|
437
|
-
renderUrl.searchParams.set("sc_lang", pageItemDescriptor.language);
|
|
438
|
-
}
|
|
439
|
-
if (!renderUrl.searchParams.has("sc_version")) {
|
|
440
|
-
renderUrl.searchParams.set("sc_version", String(pageItemDescriptor.version));
|
|
441
|
-
}
|
|
442
|
-
const routePath = inferRoutePathFromSitecoreItemPath(pageItemDescriptor.path);
|
|
443
|
-
if (!routePath || !isRootRenderPath(renderUrl.pathname))
|
|
444
|
-
return;
|
|
445
|
-
renderUrl.pathname = routePath;
|
|
446
|
-
if (!renderUrl.searchParams.has("route")) {
|
|
447
|
-
renderUrl.searchParams.set("route", routePath);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
function resolveBridgeComponentId(rawId, page) {
|
|
451
|
-
if (!rawId)
|
|
452
|
-
return undefined;
|
|
453
|
-
if (!page?.rootComponent)
|
|
454
|
-
return rawId;
|
|
455
|
-
const normalizedId = cleanId(rawId);
|
|
456
|
-
if (!normalizedId)
|
|
457
|
-
return undefined;
|
|
458
|
-
let exactMatch;
|
|
459
|
-
let datasourceMatch;
|
|
460
|
-
const visit = (component) => {
|
|
461
|
-
if (!exactMatch && cleanId(component.id) === normalizedId) {
|
|
462
|
-
exactMatch = component;
|
|
463
|
-
}
|
|
464
|
-
if (!datasourceMatch &&
|
|
465
|
-
cleanId(component.datasourceItem?.id) === normalizedId) {
|
|
466
|
-
datasourceMatch = component;
|
|
467
|
-
}
|
|
468
|
-
for (const placeholder of component.placeholders || []) {
|
|
469
|
-
for (const child of placeholder.components || []) {
|
|
470
|
-
visit(child);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
visit(page.rootComponent);
|
|
475
|
-
return exactMatch?.id ?? datasourceMatch?.id ?? rawId;
|
|
476
|
-
}
|
|
477
|
-
function getOrderedBridgeComponentIds(geometry, page) {
|
|
478
|
-
const orderedIds = [];
|
|
479
|
-
for (const target of geometry?.targets ?? []) {
|
|
480
|
-
if (target.kind !== "component")
|
|
481
|
-
continue;
|
|
482
|
-
const componentId = resolveBridgeComponentId(target.componentId, page);
|
|
483
|
-
if (!componentId)
|
|
484
|
-
continue;
|
|
485
|
-
if (orderedIds.some((id) => bridgeIdsMatch(id, componentId)))
|
|
486
|
-
continue;
|
|
487
|
-
orderedIds.push(componentId);
|
|
488
|
-
}
|
|
489
|
-
return orderedIds;
|
|
490
|
-
}
|
|
491
|
-
function bridgeIdsMatch(left, right) {
|
|
492
|
-
const normalizedLeft = normalizeMarkerId(left);
|
|
493
|
-
const normalizedRight = normalizeMarkerId(right);
|
|
494
|
-
return (!!normalizedLeft && !!normalizedRight && normalizedLeft === normalizedRight);
|
|
495
|
-
}
|
|
496
|
-
function bridgeComponentSelectionsMatch(left, right) {
|
|
497
|
-
if ((left?.length ?? 0) !== (right?.length ?? 0))
|
|
498
|
-
return false;
|
|
499
|
-
return (left ?? []).every((leftId, index) => bridgeIdsMatch(leftId, right?.[index]));
|
|
500
|
-
}
|
|
501
|
-
function bridgeDescriptorMatchesItem(bridgeItem, item) {
|
|
502
|
-
if (!bridgeItem?.id)
|
|
503
|
-
return true;
|
|
504
|
-
if (!bridgeIdsMatch(bridgeItem.id, item.id))
|
|
505
|
-
return false;
|
|
506
|
-
if (bridgeItem.language &&
|
|
507
|
-
item.language &&
|
|
508
|
-
bridgeItem.language.toLowerCase() !== item.language.toLowerCase()) {
|
|
509
|
-
return false;
|
|
510
|
-
}
|
|
511
|
-
if (typeof bridgeItem.version === "number" &&
|
|
512
|
-
Number.isFinite(bridgeItem.version) &&
|
|
513
|
-
typeof item.version === "number" &&
|
|
514
|
-
Number.isFinite(item.version) &&
|
|
515
|
-
bridgeItem.version !== item.version) {
|
|
516
|
-
return false;
|
|
517
|
-
}
|
|
518
|
-
return true;
|
|
519
|
-
}
|
|
520
|
-
function fieldIdentifierMatches(field, fieldId) {
|
|
521
|
-
return (bridgeIdsMatch(field.id, fieldId) ||
|
|
522
|
-
bridgeIdsMatch(field.name, fieldId) ||
|
|
523
|
-
bridgeIdsMatch(field.displayName, fieldId));
|
|
524
|
-
}
|
|
525
|
-
function bridgeFieldMatchesChangedField(bridgeFieldId, changedFieldId, field) {
|
|
526
|
-
return (bridgeIdsMatch(bridgeFieldId, changedFieldId) ||
|
|
527
|
-
bridgeIdsMatch(bridgeFieldId, field.id) ||
|
|
528
|
-
bridgeIdsMatch(bridgeFieldId, field.name) ||
|
|
529
|
-
bridgeIdsMatch(bridgeFieldId, field.displayName));
|
|
530
|
-
}
|
|
531
|
-
function findModifiedBridgeField({ modifiedFields, structureField, field, itemDescriptor, dirtyOnly, }) {
|
|
532
|
-
return modifiedFields?.find((candidate) => {
|
|
533
|
-
if (dirtyOnly && !candidate.isDirty)
|
|
534
|
-
return false;
|
|
535
|
-
if (!bridgeDescriptorMatchesItem(candidate.item, itemDescriptor)) {
|
|
536
|
-
return false;
|
|
537
|
-
}
|
|
538
|
-
return (bridgeIdsMatch(candidate.fieldId, structureField.fieldId) ||
|
|
539
|
-
fieldIdentifierMatches(field, candidate.fieldId));
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
function findBridgeFieldTargetAtPoint(geometry, clientX, clientY) {
|
|
543
|
-
if (!geometry || typeof clientX !== "number" || typeof clientY !== "number") {
|
|
544
|
-
return undefined;
|
|
545
|
-
}
|
|
546
|
-
return geometry.targets
|
|
547
|
-
.filter((target) => {
|
|
548
|
-
if (target.kind !== "field")
|
|
549
|
-
return false;
|
|
550
|
-
const rect = target.rect;
|
|
551
|
-
return (clientX >= rect.left &&
|
|
552
|
-
clientX <= rect.right &&
|
|
553
|
-
clientY >= rect.top &&
|
|
554
|
-
clientY <= rect.bottom);
|
|
555
|
-
})
|
|
556
|
-
.sort((left, right) => left.rect.width * left.rect.height -
|
|
557
|
-
right.rect.width * right.rect.height)[0];
|
|
558
|
-
}
|
|
559
|
-
function isBridgeInlineAiShortcut(interaction) {
|
|
560
|
-
const keyboardInteraction = interaction;
|
|
561
|
-
return !!((keyboardInteraction.ctrlKey || keyboardInteraction.metaKey) &&
|
|
562
|
-
(keyboardInteraction.key === "." ||
|
|
563
|
-
keyboardInteraction.key === "Period" ||
|
|
564
|
-
keyboardInteraction.key === "Decimal" ||
|
|
565
|
-
keyboardInteraction.code === "Period" ||
|
|
566
|
-
keyboardInteraction.code === "NumpadDecimal"));
|
|
567
|
-
}
|
|
568
|
-
function isBridgeLinkShortcut(interaction) {
|
|
569
|
-
const keyboardInteraction = interaction;
|
|
570
|
-
return !!((keyboardInteraction.ctrlKey || keyboardInteraction.metaKey) &&
|
|
571
|
-
!keyboardInteraction.shiftKey &&
|
|
572
|
-
!keyboardInteraction.altKey &&
|
|
573
|
-
(keyboardInteraction.key?.toLowerCase() === "k" ||
|
|
574
|
-
keyboardInteraction.code === "KeyK"));
|
|
575
|
-
}
|
|
576
|
-
function isBridgeLinkShortcutRange(range, interaction) {
|
|
577
|
-
return !!(range?.text?.trim() &&
|
|
578
|
-
range.isRichText &&
|
|
579
|
-
range.elementKey &&
|
|
580
|
-
((interaction.elementKey && range.elementKey === interaction.elementKey) ||
|
|
581
|
-
bridgeIdsMatch(range.fieldId, interaction.fieldId)));
|
|
582
|
-
}
|
|
583
|
-
export function PageViewerFrame(props) {
|
|
25
|
+
const EDITOR_CSS_STYLE_ID = "parhelia-editor-css";
|
|
26
|
+
export function PageViewerFrame({ compareView, pageViewContext, className, slotCloseButton, }) {
|
|
584
27
|
const editContext = useEditContext();
|
|
585
|
-
useViewportChangeSignal();
|
|
586
|
-
if (!editContext || !props.pageViewContext)
|
|
587
|
-
return null;
|
|
588
|
-
return (_jsx(PageViewerFrameContent, { ...props, editContext: editContext, pageViewContext: props.pageViewContext }));
|
|
589
|
-
}
|
|
590
|
-
function PageViewerFrameContent({ compareView, pageViewContext, editContext, className, slotCloseButton, }) {
|
|
591
28
|
const fieldsContext = useFieldsEditContext();
|
|
592
|
-
|
|
29
|
+
useViewportChangeSignal();
|
|
593
30
|
const pathname = usePathname();
|
|
594
31
|
const pageViewContextRef = useRef(undefined);
|
|
32
|
+
if (!editContext || !pageViewContext)
|
|
33
|
+
return null;
|
|
595
34
|
useEffect(() => {
|
|
596
35
|
pageViewContextRef.current = pageViewContext;
|
|
597
36
|
}, [pageViewContext]);
|
|
598
37
|
const editContextRef = useEditContextRef();
|
|
599
38
|
const fieldsContextRef = useFieldsEditContextRef();
|
|
600
39
|
const iframeRef = useRef(null);
|
|
601
|
-
const
|
|
602
|
-
const
|
|
603
|
-
const
|
|
604
|
-
const bridgeTextRangeSourcesRef = useRef(new Map());
|
|
605
|
-
const activeBridgeInlineEditRef = useRef(null);
|
|
606
|
-
const previousBridgeInlineEditModeRef = useRef(editContext.mode);
|
|
607
|
-
const latestBridgeScrollRef = useRef(undefined);
|
|
608
|
-
const directOverlayScrollSyncRef = useRef(false);
|
|
609
|
-
const pendingRefreshScrollRef = useRef(undefined);
|
|
610
|
-
const suppressNextSelectionScrollRef = useRef(false);
|
|
611
|
-
// Timestamp (ms) until which selection auto-scroll is suppressed. Held open for
|
|
612
|
-
// the whole drag and a short window after, so the drop's re-selection doesn't
|
|
613
|
-
// jump the page (see the dragObject transition effect that drives it).
|
|
614
|
-
const suppressSelectionScrollUntilRef = useRef(0);
|
|
615
|
-
// Tracks the selection we last evaluated for auto-scroll. The selection
|
|
616
|
-
// effect also depends on focusedField, so it re-runs when a field blurs
|
|
617
|
-
// (focusedField -> undefined) even though the selection itself did not
|
|
618
|
-
// change. Without this guard that blur re-render would scroll the just
|
|
619
|
-
// clicked component into view after the suppress flag was already consumed.
|
|
620
|
-
const lastScrolledSelectionKeyRef = useRef("");
|
|
621
|
-
const scrollIntoViewRequestRef = useRef({
|
|
622
|
-
signature: "",
|
|
623
|
-
requestedTextRangeGeometry: false,
|
|
624
|
-
});
|
|
40
|
+
const currentLoadRef = useRef(null);
|
|
41
|
+
const rebindIframeInteractionsRef = useRef(null);
|
|
42
|
+
const prevModeRef = useRef(editContext.mode);
|
|
625
43
|
const [showSpinner, setShowSpinner] = useState(false);
|
|
626
|
-
const [iframeSrc, setIframeSrc] = useState();
|
|
627
|
-
const [loadedIframeSrc, setLoadedIframeSrc] = useState();
|
|
628
44
|
const [scroll, setScroll] = useState(0);
|
|
629
45
|
const [showMiniMap, setShowMiniMap] = useState(false);
|
|
630
|
-
const [bridgeGeometryRevision, setBridgeGeometryRevision] = useState(0);
|
|
631
|
-
const [bridgeDomRevision, setBridgeDomRevision] = useState(0);
|
|
632
|
-
const bridgeGeometryRevisionRafRef = useRef(null);
|
|
633
|
-
const bridgeDomRevisionRafRef = useRef(null);
|
|
634
46
|
const fieldActionsOverlay = useRef(null);
|
|
635
|
-
const lastSentBridgeCaretRef = useRef(null);
|
|
636
47
|
const [contextMenuFieldButtons, setContextMenuFieldButtons] = useState([]);
|
|
637
48
|
const [contextMenuField, setContextMenuField] = useState();
|
|
638
49
|
const [contextMenuPosition, setContextMenuPosition] = useState();
|
|
639
50
|
const [preSelectedAction, setPreSelectedAction] = useState();
|
|
640
|
-
const bindIframeRef = useCallback((node) => {
|
|
641
|
-
iframeRef.current = node;
|
|
642
|
-
setIframeElement(node);
|
|
643
|
-
}, []);
|
|
644
51
|
// Clear preSelectedAction when overlay is closed
|
|
645
52
|
useEffect(() => {
|
|
646
53
|
if (editContext?.currentOverlay !==
|
|
@@ -649,6 +56,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
649
56
|
}
|
|
650
57
|
}, [editContext?.currentOverlay, contextMenuField?.fieldId]);
|
|
651
58
|
const zoom = pageViewContext.zoom;
|
|
59
|
+
const blockBlurEventRef = useRef(0);
|
|
652
60
|
const [currentItemDescriptor, setCurrentItemDescriptor] = useState(undefined);
|
|
653
61
|
// Field action handlers for the overlay
|
|
654
62
|
const handleActionClick = async (action, event) => {
|
|
@@ -664,683 +72,1028 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
664
72
|
// Note: handleParameterizedActionFromContextMenu is now created inline in handleContextMenu
|
|
665
73
|
// to avoid React state timing issues with contextMenuPosition
|
|
666
74
|
const pageItemDescriptor = pageViewContext.pageItemDescriptor;
|
|
667
|
-
|
|
668
|
-
const editor = editContextRef.current;
|
|
669
|
-
return !!(showMiniMap &&
|
|
670
|
-
editor?.showMinimap &&
|
|
671
|
-
!editor?.isMobile &&
|
|
672
|
-
editor?.parheliaSettings?.showMinimap !== false);
|
|
673
|
-
}, [showMiniMap]);
|
|
674
|
-
const updateScrollPosition = useCallback((e) => {
|
|
675
|
-
if (!shouldTrackMinimapScroll())
|
|
676
|
-
return;
|
|
677
|
-
setScroll(e);
|
|
678
|
-
if (!compareView)
|
|
679
|
-
pageViewContextRef.current?.setScroll(e);
|
|
680
|
-
}, [compareView, shouldTrackMinimapScroll]);
|
|
681
|
-
const scrollHandler = useThrottledCallback(updateScrollPosition, 100);
|
|
682
|
-
const scrollHandlerRef = useRef(scrollHandler);
|
|
75
|
+
// Update the context whenever the iframe ref changes
|
|
683
76
|
useEffect(() => {
|
|
684
|
-
|
|
685
|
-
}, [
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
77
|
+
pageViewContext.setEditorIframe(iframeRef.current);
|
|
78
|
+
}, [iframeRef.current, pageViewContext.setEditorIframe]);
|
|
79
|
+
const updateMiniMapVisibility = useDebouncedCallback(() => {
|
|
80
|
+
if (!iframeRef.current)
|
|
688
81
|
return;
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
});
|
|
693
|
-
}, []);
|
|
694
|
-
const scheduleBridgeDomRevision = useCallback(() => {
|
|
695
|
-
if (bridgeDomRevisionRafRef.current != null)
|
|
82
|
+
const iframe = iframeRef.current;
|
|
83
|
+
const doc = iframe.contentDocument;
|
|
84
|
+
if (!doc?.documentElement)
|
|
696
85
|
return;
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
86
|
+
const scrollContainer = doc.scrollingElement || doc.body;
|
|
87
|
+
if (!scrollContainer)
|
|
88
|
+
return;
|
|
89
|
+
const contentHeight = scrollContainer.scrollHeight;
|
|
90
|
+
const clientHeight = iframe.clientHeight;
|
|
91
|
+
const upperThreshold = clientHeight + 100; // show minimap if content exceeds this height
|
|
92
|
+
const lowerThreshold = clientHeight; // hide minimap if content falls below this
|
|
93
|
+
// Check if minimap is enabled in settings and user controls
|
|
94
|
+
const minimapEnabled = editContext.parheliaSettings?.showMinimap !== false &&
|
|
95
|
+
editContext.showMinimap;
|
|
96
|
+
if (showMiniMap) {
|
|
97
|
+
if (contentHeight <= lowerThreshold || !minimapEnabled) {
|
|
98
|
+
setShowMiniMap(false);
|
|
706
99
|
}
|
|
707
|
-
|
|
708
|
-
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (contentHeight > upperThreshold && minimapEnabled) {
|
|
103
|
+
setShowMiniMap(true);
|
|
709
104
|
}
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
return (bridgeClientRef.current?.sendCommand("beginInlineEdit", payload) ??
|
|
717
|
-
false);
|
|
718
|
-
}, []);
|
|
719
|
-
const sendCancelInlineEdit = useCallback((payload) => {
|
|
720
|
-
return (bridgeClientRef.current?.sendCommand("cancelInlineEdit", payload) ??
|
|
721
|
-
false);
|
|
722
|
-
}, []);
|
|
723
|
-
const sendApplyFieldPatchCommand = useCallback((payload) => {
|
|
724
|
-
return (bridgeClientRef.current?.sendCommand("applyFieldPatch", payload) ??
|
|
725
|
-
false);
|
|
726
|
-
}, []);
|
|
727
|
-
const sendApplyRichTextCommand = useCallback((payload) => {
|
|
728
|
-
return (bridgeClientRef.current?.sendCommand("applyRichTextCommand", payload) ??
|
|
729
|
-
false);
|
|
730
|
-
}, []);
|
|
731
|
-
const { beginInlineEdit: beginBridgeInlineEdit, clearInlineDedupe: clearBridgeInlineDedupe, endFieldFocus: endBridgeFieldFocus, handleFieldValueChanged: handleBridgeFieldValueChanged, handleInlineEditEnded: handleBridgeInlineEditEnded, } = useBridgeInlineEditing({
|
|
732
|
-
pageViewContextRef,
|
|
733
|
-
activeBridgeInlineEditRef,
|
|
734
|
-
blockIframeBlurUntil,
|
|
735
|
-
sendBeginInlineEdit,
|
|
736
|
-
sendCancelInlineEdit,
|
|
737
|
-
sendApplyFieldPatch: sendApplyFieldPatchCommand,
|
|
105
|
+
}
|
|
106
|
+
}, 100);
|
|
107
|
+
updateMiniMapVisibility();
|
|
108
|
+
const buildPageModelThrottled = useThrottledCallback(buildPageModelSkeleton, 200, {
|
|
109
|
+
leading: true,
|
|
110
|
+
trailing: true,
|
|
738
111
|
});
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
112
|
+
const requestPageModelBuild = (doc) => {
|
|
113
|
+
if (!doc)
|
|
114
|
+
return;
|
|
115
|
+
buildPageModelThrottled(doc, editContextRef, pageViewContextRef);
|
|
116
|
+
};
|
|
117
|
+
const [iframeSrc, setIframeSrc] = useState();
|
|
118
|
+
const editorCssGuardRef = useRef({ doc: null, observer: null, editMode: true });
|
|
119
|
+
const ensureEditorCssGuard = (doc, editMode) => {
|
|
120
|
+
if (!doc)
|
|
121
|
+
return;
|
|
122
|
+
// Keep latest mode so the observer can re-apply the right CSS after hydration/head updates.
|
|
123
|
+
editorCssGuardRef.current.editMode = editMode;
|
|
124
|
+
const needsNewObserver = editorCssGuardRef.current.doc !== doc;
|
|
125
|
+
if (needsNewObserver) {
|
|
126
|
+
try {
|
|
127
|
+
editorCssGuardRef.current.observer?.disconnect();
|
|
128
|
+
}
|
|
129
|
+
catch { }
|
|
130
|
+
editorCssGuardRef.current.doc = doc;
|
|
131
|
+
editorCssGuardRef.current.observer = null;
|
|
132
|
+
// Guard against frameworks (Next/Head managers) removing/replacing our injected <style>.
|
|
133
|
+
let isApplying = false;
|
|
134
|
+
const observer = new MutationObserver(() => {
|
|
135
|
+
const currentDoc = editorCssGuardRef.current.doc;
|
|
136
|
+
if (!currentDoc || currentDoc !== doc)
|
|
137
|
+
return;
|
|
138
|
+
if (isApplying)
|
|
139
|
+
return;
|
|
140
|
+
const head = currentDoc.head;
|
|
141
|
+
if (!head)
|
|
142
|
+
return;
|
|
143
|
+
const style = head.querySelector(`#${EDITOR_CSS_STYLE_ID}`);
|
|
144
|
+
if (style)
|
|
145
|
+
return;
|
|
146
|
+
try {
|
|
147
|
+
isApplying = true;
|
|
148
|
+
injectEditorCSS(currentDoc, editorCssGuardRef.current.editMode);
|
|
754
149
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
150
|
+
finally {
|
|
151
|
+
isApplying = false;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
// Observe <head> for style removals, and <html> for rare head replacements.
|
|
155
|
+
try {
|
|
156
|
+
if (doc.head)
|
|
157
|
+
observer.observe(doc.head, { childList: true });
|
|
158
|
+
if (doc.documentElement)
|
|
159
|
+
observer.observe(doc.documentElement, { childList: true });
|
|
160
|
+
}
|
|
161
|
+
catch { }
|
|
162
|
+
editorCssGuardRef.current.observer = observer;
|
|
762
163
|
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
}, [endBridgeFieldFocus]);
|
|
769
|
-
useEffect(() => {
|
|
770
|
-
const handleBridgeInlineEditRelease = (event) => {
|
|
771
|
-
const detail = event
|
|
772
|
-
.detail;
|
|
773
|
-
const field = detail?.field;
|
|
774
|
-
const activeEdit = activeBridgeInlineEditRef.current;
|
|
775
|
-
if (!field || !activeEdit)
|
|
776
|
-
return;
|
|
777
|
-
if (!bridgeKeysMatch(activeEdit.fieldId, field.fieldId))
|
|
778
|
-
return;
|
|
779
|
-
if (activeEdit.item && !bridgeItemMatches(activeEdit.item, field.item)) {
|
|
780
|
-
return;
|
|
164
|
+
// Apply now, and again shortly after to catch post-hydration head normalization.
|
|
165
|
+
injectEditorCSS(doc, editMode);
|
|
166
|
+
setTimeout(() => {
|
|
167
|
+
if (editorCssGuardRef.current.doc === doc) {
|
|
168
|
+
injectEditorCSS(doc, editorCssGuardRef.current.editMode);
|
|
781
169
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
170
|
+
}, 0);
|
|
171
|
+
};
|
|
172
|
+
// Disconnect the CSS guard on unmount.
|
|
173
|
+
useEffect(() => {
|
|
786
174
|
return () => {
|
|
787
|
-
|
|
175
|
+
try {
|
|
176
|
+
editorCssGuardRef.current.observer?.disconnect();
|
|
177
|
+
}
|
|
178
|
+
catch { }
|
|
179
|
+
editorCssGuardRef.current.observer = null;
|
|
180
|
+
editorCssGuardRef.current.doc = null;
|
|
788
181
|
};
|
|
789
182
|
}, []);
|
|
183
|
+
// If the editor mode flips (edit/preview), re-apply CSS and disable inline editing in the iframe.
|
|
790
184
|
useEffect(() => {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
void fieldsContextRef.current?.setFocusedField(undefined, false);
|
|
799
|
-
endBridgeFieldFocus();
|
|
800
|
-
},
|
|
801
|
-
clearInlineDedupe: () => {
|
|
802
|
-
clearBridgeInlineDedupe();
|
|
803
|
-
},
|
|
804
|
-
});
|
|
805
|
-
}, [
|
|
806
|
-
clearBridgeInlineDedupe,
|
|
807
|
-
editContext,
|
|
808
|
-
editContextRef,
|
|
809
|
-
endBridgeFieldFocus,
|
|
810
|
-
fieldsContextRef,
|
|
811
|
-
]);
|
|
812
|
-
const getBridgePatchDisplayValue = useCallback(({ field, structureField, itemDescriptor, preferRepositoryValue, }) => {
|
|
813
|
-
const showSuggestions = editContext.mode === "suggestions" || editContext.showSuggestedEdits;
|
|
814
|
-
const repositoryValue = getBridgeFieldPatchValue(field);
|
|
815
|
-
const display = getSuggestionDisplayValue({
|
|
816
|
-
repositoryValue,
|
|
817
|
-
modifiedFields: preferRepositoryValue
|
|
818
|
-
? undefined
|
|
819
|
-
: fieldsContext?.modifiedFields,
|
|
820
|
-
suggestedEdits: editContext.suggestedEdits,
|
|
821
|
-
field: {
|
|
822
|
-
fieldId: field.id || structureField.fieldId,
|
|
823
|
-
itemId: itemDescriptor.id,
|
|
824
|
-
language: itemDescriptor.language,
|
|
825
|
-
version: itemDescriptor.version,
|
|
826
|
-
pageItemId: pageViewContext.pageItemDescriptor?.id,
|
|
827
|
-
pageItemVersion: pageViewContext.pageItemDescriptor?.version,
|
|
828
|
-
},
|
|
829
|
-
mode: showSuggestions ? "suggestions" : "baseline",
|
|
830
|
-
});
|
|
831
|
-
return {
|
|
832
|
-
value: showSuggestions ? display.mergedValue : display.baselineValue,
|
|
833
|
-
source: showSuggestions && display.hasSuggestions
|
|
834
|
-
? "suggestion-preview"
|
|
835
|
-
: "real",
|
|
836
|
-
};
|
|
837
|
-
}, [
|
|
838
|
-
editContext.mode,
|
|
839
|
-
editContext.showSuggestedEdits,
|
|
840
|
-
editContext.suggestedEdits,
|
|
841
|
-
fieldsContext?.modifiedFields,
|
|
842
|
-
pageViewContext.pageItemDescriptor,
|
|
843
|
-
]);
|
|
844
|
-
const buildBridgeFieldPatch = useCallback(({ field, structureField, itemDescriptor, preferRepositoryValue, }) => {
|
|
845
|
-
const display = getBridgePatchDisplayValue({
|
|
846
|
-
field,
|
|
847
|
-
structureField,
|
|
848
|
-
itemDescriptor,
|
|
849
|
-
preferRepositoryValue,
|
|
850
|
-
});
|
|
851
|
-
const activeInlineEdit = activeBridgeInlineEditRef.current;
|
|
852
|
-
const patch = buildBridgeFieldPatchPayload({
|
|
853
|
-
field,
|
|
854
|
-
structureField,
|
|
855
|
-
display,
|
|
856
|
-
activeInlineEdit,
|
|
857
|
-
});
|
|
858
|
-
return patch;
|
|
859
|
-
}, [getBridgePatchDisplayValue]);
|
|
860
|
-
const clearBridgePatchSignatures = useCallback(() => {
|
|
861
|
-
bridgePatchSignatureRef.current.clear();
|
|
862
|
-
}, []);
|
|
863
|
-
const sendBridgeFieldPatch = useCallback((bridge, patch, observedTextContent) => {
|
|
864
|
-
const cacheKey = `${patch.elementKey}:${patch.fieldId}`;
|
|
865
|
-
const signature = JSON.stringify({
|
|
866
|
-
value: patch.value,
|
|
867
|
-
isRichText: !!patch.isRichText,
|
|
868
|
-
source: patch.source ?? "",
|
|
869
|
-
observedTextContent: observedTextContent ?? "",
|
|
870
|
-
});
|
|
871
|
-
if (bridgePatchSignatureRef.current.get(cacheKey) === signature) {
|
|
872
|
-
return false;
|
|
185
|
+
const doc = iframeRef.current?.contentDocument;
|
|
186
|
+
const isPreview = editContext.mode === "preview";
|
|
187
|
+
if (doc)
|
|
188
|
+
ensureEditorCssGuard(doc, !isPreview);
|
|
189
|
+
if (isPreview) {
|
|
190
|
+
editContextRef.current?.setSelectedRange(undefined);
|
|
191
|
+
fieldsContextRef.current?.setInlineEditingFieldElement(undefined);
|
|
873
192
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
const editor = editContextRef.current;
|
|
880
|
-
if (!editor || lastSentBridgeCaretRef.current === "clear")
|
|
881
|
-
return;
|
|
882
|
-
editor.sendSocketMessage({
|
|
883
|
-
type: "caret-position",
|
|
884
|
-
payload: { offset: null },
|
|
885
|
-
});
|
|
886
|
-
lastSentBridgeCaretRef.current = "clear";
|
|
887
|
-
}, [editContextRef]);
|
|
888
|
-
const sendBridgeRemoteCaretPosition = useCallback((selection) => {
|
|
889
|
-
const editor = editContextRef.current;
|
|
890
|
-
const activeField = selection.activeField;
|
|
891
|
-
const offset = selection.startOffset ?? selection.endOffset;
|
|
892
|
-
if (!editor ||
|
|
893
|
-
!activeField?.fieldId ||
|
|
894
|
-
!selection.collapsed ||
|
|
895
|
-
offset == null) {
|
|
896
|
-
clearBridgeRemoteCaretPosition();
|
|
193
|
+
}, [editContext.mode]);
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
if (!pageItemDescriptor ||
|
|
196
|
+
!pageViewContext.editUrl ||
|
|
197
|
+
!pageViewContext.previewUrl)
|
|
897
198
|
return;
|
|
199
|
+
const urlPath = editContext.mode === "preview"
|
|
200
|
+
? pageViewContext.previewUrl
|
|
201
|
+
: pageViewContext.editUrl;
|
|
202
|
+
const prevMode = prevModeRef.current;
|
|
203
|
+
prevModeRef.current = editContext.mode;
|
|
204
|
+
const modeOnlyChange = prevMode !== editContext.mode &&
|
|
205
|
+
prevMode !== "preview" &&
|
|
206
|
+
editContext.mode !== "preview";
|
|
207
|
+
const savedScrollY = iframeRef.current?.contentWindow?.scrollY ?? 0;
|
|
208
|
+
const renderUrl = new URL(urlPath, window.location.origin);
|
|
209
|
+
const editRev = uuid();
|
|
210
|
+
renderUrl.searchParams.set("edit_rev", editRev);
|
|
211
|
+
if (editContext.mode !== "preview" && editContext.sessionId) {
|
|
212
|
+
renderUrl.searchParams.set("parhelia_session", editContext.sessionId);
|
|
898
213
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
const version = typeof sourceItem?.version === "number" &&
|
|
903
|
-
Number.isFinite(sourceItem.version)
|
|
904
|
-
? sourceItem.version
|
|
905
|
-
: undefined;
|
|
906
|
-
if (!sourceItem?.id || !sourceItem.language || version === undefined) {
|
|
907
|
-
clearBridgeRemoteCaretPosition();
|
|
908
|
-
return;
|
|
214
|
+
if (editContext.mode === "preview" && editContext.previewDate) {
|
|
215
|
+
renderUrl.searchParams.delete("sc_version");
|
|
216
|
+
renderUrl.searchParams.set("sc_date", toSitecoreDate(editContext.previewDate));
|
|
909
217
|
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
return;
|
|
917
|
-
editor.sendSocketMessage({
|
|
918
|
-
type: "caret-position",
|
|
919
|
-
payload: {
|
|
920
|
-
fieldId: activeField.fieldId,
|
|
921
|
-
item,
|
|
922
|
-
offset,
|
|
923
|
-
},
|
|
924
|
-
});
|
|
925
|
-
lastSentBridgeCaretRef.current = nextKey;
|
|
926
|
-
}, [clearBridgeRemoteCaretPosition, editContextRef, pageViewContextRef]);
|
|
927
|
-
const handleBridgeSelection = useCallback((selection, iframe) => {
|
|
928
|
-
const editor = editContextRef.current;
|
|
929
|
-
if (!editor)
|
|
930
|
-
return;
|
|
931
|
-
const isInlineAiUiFocused = () => {
|
|
932
|
-
const activeEl = document.activeElement;
|
|
933
|
-
return !!(activeEl?.closest(".agent-inline-dialog") ||
|
|
934
|
-
activeEl?.closest(".agent-inline-trigger") ||
|
|
935
|
-
activeEl?.closest('[role="dialog"]'));
|
|
936
|
-
};
|
|
937
|
-
const isInlineAiUiPresent = () => !!document.querySelector(".agent-inline-dialog, .agent-inline-trigger");
|
|
938
|
-
const inlineAiUiFocused = isInlineAiUiFocused();
|
|
939
|
-
const inlineAiUiPresent = isInlineAiUiPresent();
|
|
940
|
-
if (selection.collapsed && (inlineAiUiFocused || inlineAiUiPresent)) {
|
|
941
|
-
return;
|
|
218
|
+
// Layout-mode marker. Only set when editing shared layout, paired with the
|
|
219
|
+
// `parhelia` editor marker so ParheliaSetLayoutRenderings ignores any unrelated
|
|
220
|
+
// requests that happen to carry parhelia_layout.
|
|
221
|
+
if (editContext.mode !== "preview" && editContext.layoutMode === "shared") {
|
|
222
|
+
renderUrl.searchParams.set("parhelia", "1");
|
|
223
|
+
renderUrl.searchParams.set("parhelia_layout", "shared");
|
|
942
224
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
!selection.activeField?.fieldId) {
|
|
946
|
-
sendBridgeRemoteCaretPosition(selection);
|
|
947
|
-
if (!inlineAiUiFocused && !inlineAiUiPresent) {
|
|
948
|
-
editor.setSelectedRange(undefined);
|
|
949
|
-
}
|
|
950
|
-
return;
|
|
225
|
+
else {
|
|
226
|
+
renderUrl.searchParams.delete("parhelia_layout");
|
|
951
227
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
228
|
+
// Detect if the version in the URL changed - this requires a full reload, not just requestRefresh
|
|
229
|
+
// because Next.js router.replace may not properly refetch server data for version changes.
|
|
230
|
+
const currentIframeUrl = iframeRef.current?.contentWindow?.location?.href;
|
|
231
|
+
const currentVersion = currentIframeUrl
|
|
232
|
+
? new URL(currentIframeUrl).searchParams.get("sc_version")
|
|
233
|
+
: null;
|
|
234
|
+
const newVersion = renderUrl.searchParams.get("sc_version");
|
|
235
|
+
const versionChanged = (currentVersion !== null || newVersion !== null) &&
|
|
236
|
+
currentVersion !== newVersion;
|
|
237
|
+
const initialLoad = currentItemDescriptor?.id !== pageItemDescriptor.id ||
|
|
238
|
+
currentItemDescriptor?.language !== pageItemDescriptor.language ||
|
|
239
|
+
currentItemDescriptor?.version !== pageItemDescriptor.version;
|
|
240
|
+
const shouldUseIframeSrcReload = initialLoad || pageViewContext.fullscreen;
|
|
241
|
+
const runIntegrationRefresh = (refreshFn, message) => {
|
|
242
|
+
console.log(message);
|
|
243
|
+
refreshFn(renderUrl.toString());
|
|
244
|
+
const doc = iframeRef.current?.contentDocument;
|
|
245
|
+
if (doc) {
|
|
246
|
+
requestPageModelBuild(doc);
|
|
247
|
+
}
|
|
248
|
+
// The integration refresh path may replace/normalize <head> during hydration,
|
|
249
|
+
// which can remove our injected style. Re-ensure a few times post-refresh.
|
|
250
|
+
const ensureLater = (delay) => {
|
|
251
|
+
setTimeout(() => {
|
|
252
|
+
const doc = iframeRef.current?.contentDocument;
|
|
253
|
+
if (doc)
|
|
254
|
+
ensureEditorCssGuard(doc, editContext.mode !== "preview");
|
|
255
|
+
rebindIframeInteractionsRef.current?.();
|
|
256
|
+
}, delay);
|
|
257
|
+
};
|
|
258
|
+
ensureLater(0);
|
|
259
|
+
ensureLater(100);
|
|
260
|
+
ensureLater(500);
|
|
261
|
+
ensureLater(1200);
|
|
262
|
+
if (modeOnlyChange && savedScrollY > 0) {
|
|
263
|
+
const restoreScroll = (delay) => {
|
|
264
|
+
setTimeout(() => {
|
|
265
|
+
const win = iframeRef.current?.contentWindow;
|
|
266
|
+
if (win && win.scrollY === 0) {
|
|
267
|
+
win.scrollTo(0, savedScrollY);
|
|
268
|
+
}
|
|
269
|
+
}, delay);
|
|
270
|
+
};
|
|
271
|
+
restoreScroll(50);
|
|
272
|
+
restoreScroll(200);
|
|
273
|
+
restoreScroll(500);
|
|
274
|
+
restoreScroll(1000);
|
|
275
|
+
restoreScroll(2000);
|
|
972
276
|
}
|
|
973
|
-
: undefined;
|
|
974
|
-
const nextRange = {
|
|
975
|
-
itemId: item.id,
|
|
976
|
-
fieldId: selection.activeField.fieldId,
|
|
977
|
-
elementKey: selection.activeField.elementKey,
|
|
978
|
-
isRichText: selection.activeField.isRichText,
|
|
979
|
-
language: item.language,
|
|
980
|
-
version: item.version,
|
|
981
|
-
startOffset: selection.startOffset ?? 0,
|
|
982
|
-
endOffset: selection.endOffset ?? selection.startOffset ?? 0,
|
|
983
|
-
text: selection.text,
|
|
984
|
-
contextBefore: typeof metadata.contextBefore === "string"
|
|
985
|
-
? metadata.contextBefore
|
|
986
|
-
: undefined,
|
|
987
|
-
contextAfter: typeof metadata.contextAfter === "string"
|
|
988
|
-
? metadata.contextAfter
|
|
989
|
-
: undefined,
|
|
990
|
-
formatting: selection.formatting,
|
|
991
|
-
clientRect: selectionRect,
|
|
992
277
|
};
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
selectedRangeElementKey === interaction.elementKey) ||
|
|
1006
|
-
bridgeIdsMatch(selectedRange.fieldId, interaction.fieldId) ||
|
|
1007
|
-
bridgeIdsMatch(selectedRange.itemId, interaction.item?.id)));
|
|
1008
|
-
const fieldId = selectedRangeMatchesInteraction
|
|
1009
|
-
? selectedRange?.fieldId
|
|
1010
|
-
: interaction.fieldId;
|
|
1011
|
-
if (!fieldId)
|
|
1012
|
-
return undefined;
|
|
1013
|
-
const targetElementKey = selectedRangeMatchesInteraction
|
|
1014
|
-
? selectedRangeElementKey
|
|
1015
|
-
: interaction.elementKey;
|
|
1016
|
-
const structureFields = pageView?.bridgeStructure?.fields ?? [];
|
|
1017
|
-
const structureField = structureFields.find((field) => bridgeIdsMatch(field.fieldId, fieldId)) ??
|
|
1018
|
-
structureFields.find((field) => targetElementKey && field.elementKey === targetElementKey);
|
|
1019
|
-
const fallbackItem = pageView?.page?.item ?? pageView?.pageItemDescriptor;
|
|
1020
|
-
const componentId = resolveBridgeComponentId(interaction.componentId ?? structureField?.componentId, pageView?.page);
|
|
1021
|
-
const component = componentId && pageView?.page
|
|
1022
|
-
? getComponentById(componentId, pageView.page)
|
|
1023
|
-
: undefined;
|
|
1024
|
-
const candidateItems = [];
|
|
1025
|
-
const selectedRangeItem = selectedRangeMatchesInteraction &&
|
|
1026
|
-
selectedRange?.itemId &&
|
|
1027
|
-
selectedRange.language &&
|
|
1028
|
-
typeof selectedRange.version === "number"
|
|
1029
|
-
? {
|
|
1030
|
-
id: selectedRange.itemId,
|
|
1031
|
-
language: selectedRange.language,
|
|
1032
|
-
version: selectedRange.version,
|
|
1033
|
-
database: fallbackItem?.database,
|
|
278
|
+
const runFallbackRefresh = () => {
|
|
279
|
+
setShowSpinner(true);
|
|
280
|
+
if (shouldUseIframeSrcReload) {
|
|
281
|
+
// For initial loads and fullscreen mode, prefer a full iframe src reload.
|
|
282
|
+
// The morphdom path can race with framework hydration and leave the frame blank.
|
|
283
|
+
console.log(initialLoad
|
|
284
|
+
? "Initial load - setting iframe src"
|
|
285
|
+
: "Fullscreen load - setting iframe src");
|
|
286
|
+
// Clear any stale load tracking to prevent handleLoad from incorrectly
|
|
287
|
+
// skipping spinner dismissal due to revision mismatch
|
|
288
|
+
currentLoadRef.current = null;
|
|
289
|
+
setIframeSrc(renderUrl.toString());
|
|
1034
290
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
item.language.toLowerCase() === language.toLowerCase() &&
|
|
1047
|
-
item.version === version)) {
|
|
1048
|
-
return;
|
|
291
|
+
else {
|
|
292
|
+
console.log("No integration - reloading frame via fetch");
|
|
293
|
+
// Abort any in-flight load before starting a new one
|
|
294
|
+
try {
|
|
295
|
+
currentLoadRef.current?.controller.abort();
|
|
296
|
+
}
|
|
297
|
+
catch { }
|
|
298
|
+
const controller = new AbortController();
|
|
299
|
+
const expectedRevision = editContext.revision ?? "";
|
|
300
|
+
currentLoadRef.current = { controller, revision: expectedRevision };
|
|
301
|
+
loadContent(renderUrl.toString(), initialLoad, expectedRevision, controller.signal);
|
|
1049
302
|
}
|
|
1050
|
-
candidateItems.push({
|
|
1051
|
-
id: itemId,
|
|
1052
|
-
language,
|
|
1053
|
-
version,
|
|
1054
|
-
name: source?.name ?? fallbackItem?.name,
|
|
1055
|
-
displayName: source?.displayName ?? fallbackItem?.displayName,
|
|
1056
|
-
path: source?.path ?? fallbackItem?.path,
|
|
1057
|
-
database: source?.database ?? fallbackItem?.database,
|
|
1058
|
-
});
|
|
1059
303
|
};
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
addCandidateItem(fallbackItem);
|
|
1066
|
-
for (const item of candidateItems) {
|
|
1067
|
-
const repositoryItem = await editContextRef.current?.itemsRepository.getItem(item);
|
|
1068
|
-
const repositoryField = repositoryItem?.fields.find((field) => fieldIdentifierMatches(field, fieldId));
|
|
1069
|
-
if (repositoryField) {
|
|
1070
|
-
return {
|
|
1071
|
-
fieldId: repositoryField.id,
|
|
1072
|
-
item,
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
304
|
+
// Use requestRefresh for normal refreshes, but force full reload for version changes.
|
|
305
|
+
// If requestRefresh is temporarily unavailable, wait briefly before falling back.
|
|
306
|
+
const integrationRefreshFn = iframeRef.current?.contentWindow?.requestRefresh;
|
|
307
|
+
if (!versionChanged && integrationRefreshFn) {
|
|
308
|
+
runIntegrationRefresh(integrationRefreshFn, "Integration - requesting refresh");
|
|
1075
309
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
310
|
+
else if (!versionChanged && !shouldUseIframeSrcReload) {
|
|
311
|
+
const retryDelayMs = 150;
|
|
312
|
+
const retryTimer = setTimeout(() => {
|
|
313
|
+
const retryIntegrationRefreshFn = iframeRef.current?.contentWindow?.requestRefresh;
|
|
314
|
+
if (retryIntegrationRefreshFn) {
|
|
315
|
+
runIntegrationRefresh(retryIntegrationRefreshFn, "Integration became available after brief wait - requesting refresh");
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
runFallbackRefresh();
|
|
319
|
+
}, retryDelayMs);
|
|
320
|
+
setCurrentItemDescriptor(pageItemDescriptor);
|
|
321
|
+
return () => clearTimeout(retryTimer);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
runFallbackRefresh();
|
|
325
|
+
}
|
|
326
|
+
setCurrentItemDescriptor(pageItemDescriptor);
|
|
327
|
+
}, [
|
|
328
|
+
pathname,
|
|
329
|
+
editContext.revision,
|
|
330
|
+
pageItemDescriptor,
|
|
331
|
+
pageViewContext.editUrl,
|
|
332
|
+
pageViewContext.previewUrl,
|
|
333
|
+
pageViewContext.fullscreen,
|
|
334
|
+
editContext.mode,
|
|
335
|
+
editContext.previewDate,
|
|
336
|
+
editContext.sessionId,
|
|
337
|
+
editContext.layoutMode,
|
|
338
|
+
]);
|
|
339
|
+
useEffect(() => {
|
|
340
|
+
if (fieldsContext?.focusedField) {
|
|
341
|
+
if (editContext.selection.length > 0 &&
|
|
342
|
+
fieldsContext.focusedField.item.id !== editContext.selection[0])
|
|
1089
343
|
return;
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
344
|
+
const fieldElement = findFieldElement(iframeRef.current, fieldsContext.focusedField);
|
|
345
|
+
if (fieldElement) {
|
|
346
|
+
const rect = getAbsolutePosition(fieldElement, iframeRef.current);
|
|
347
|
+
const scrollTop = iframeRef.current?.contentWindow?.scrollY || 0;
|
|
348
|
+
const iframeHeight = iframeRef.current?.getBoundingClientRect().height;
|
|
349
|
+
const isInViewport = rect.y + rect.height > scrollTop &&
|
|
350
|
+
rect.y < scrollTop + (iframeHeight || 0);
|
|
351
|
+
if (!isInViewport) {
|
|
352
|
+
iframeRef.current?.contentWindow?.scrollTo({
|
|
353
|
+
top: rect.y,
|
|
354
|
+
behavior: "smooth",
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
1095
358
|
}
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
};
|
|
359
|
+
}, [fieldsContext?.focusedField]);
|
|
360
|
+
useEffect(() => {
|
|
361
|
+
if (!fieldsContext?.focusedField && editContext.selection.length > 0) {
|
|
362
|
+
const lastSelectedComponent = getComponentById(editContext.selection[editContext.selection.length - 1], pageViewContextRef.current.page);
|
|
363
|
+
if (lastSelectedComponent) {
|
|
364
|
+
editContext.setScrollIntoView(lastSelectedComponent.id);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}, [editContext.selection, fieldsContext?.focusedField]);
|
|
368
|
+
const loadContent = async (href, initialLoad, expectedRevision, signal) => {
|
|
369
|
+
console.log("Loading content:", href);
|
|
370
|
+
const start = performance.now();
|
|
371
|
+
if (!href)
|
|
372
|
+
return;
|
|
373
|
+
try {
|
|
374
|
+
const content = await fetch(href, { signal });
|
|
375
|
+
// Detect redirect to login page (session expired)
|
|
376
|
+
if (content.redirected) {
|
|
377
|
+
const redirectUrl = content.url.toLowerCase();
|
|
378
|
+
if (redirectUrl.includes("/identity/login") ||
|
|
379
|
+
redirectUrl.includes("/sitecore/login") ||
|
|
380
|
+
redirectUrl.includes("returnurl=")) {
|
|
381
|
+
console.warn("Session expired - redirected to login page:", content.url);
|
|
382
|
+
setShowSpinner(false);
|
|
383
|
+
// Redirect the main window to the login page
|
|
384
|
+
window.location.href = content.url;
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
const text = await content.text();
|
|
389
|
+
console.log("Content loaded in " + (performance.now() - start) + " ms");
|
|
390
|
+
// Skip applying if this response is stale
|
|
391
|
+
if (expectedRevision !== (editContextRef.current?.revision ?? "")) {
|
|
392
|
+
console.log("Stale refresh skipped", {
|
|
393
|
+
expectedRevision,
|
|
394
|
+
current: editContextRef.current?.revision,
|
|
395
|
+
});
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
console.log("Content loaded in " + (performance.now() - start) + " ms");
|
|
399
|
+
const doc = iframeRef.current?.contentDocument;
|
|
400
|
+
if (doc) {
|
|
401
|
+
if (initialLoad) {
|
|
402
|
+
// Guard again just before applying
|
|
403
|
+
if (expectedRevision !== (editContextRef.current?.revision ?? "")) {
|
|
404
|
+
console.log("Stale initial load skipped", {
|
|
405
|
+
expectedRevision,
|
|
406
|
+
current: editContextRef.current?.revision,
|
|
407
|
+
});
|
|
408
|
+
return;
|
|
1147
409
|
}
|
|
410
|
+
doc.open();
|
|
411
|
+
doc.write(text);
|
|
412
|
+
doc.close();
|
|
1148
413
|
}
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
414
|
+
else {
|
|
415
|
+
const parser = new DOMParser();
|
|
416
|
+
const newDoc = parser.parseFromString(text, "text/html");
|
|
417
|
+
// Guard before morphing DOM to avoid applying stale content
|
|
418
|
+
if (expectedRevision !== (editContextRef.current?.revision ?? "")) {
|
|
419
|
+
console.log("Stale morphdom skipped", {
|
|
420
|
+
expectedRevision,
|
|
421
|
+
current: editContextRef.current?.revision,
|
|
422
|
+
});
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const morphTarget = doc.body && newDoc.body ? "body" : "documentElement";
|
|
426
|
+
if (morphTarget === "body") {
|
|
427
|
+
morphdom(doc.body, newDoc.body);
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
morphdom(doc.documentElement, newDoc.documentElement);
|
|
431
|
+
}
|
|
432
|
+
rebindIframeInteractionsRef.current?.();
|
|
433
|
+
if (iframeRef.current.contentWindow.XA) {
|
|
434
|
+
console.log("init XA");
|
|
435
|
+
iframeRef.current.contentWindow.XA.init();
|
|
436
|
+
}
|
|
437
|
+
setShowSpinner(false);
|
|
1155
438
|
}
|
|
439
|
+
ensureEditorCssGuard(doc, editContext.mode !== "preview");
|
|
440
|
+
setTimeout(() => {
|
|
441
|
+
injectSXAScripts(iframeRef.current);
|
|
442
|
+
}, 1000);
|
|
443
|
+
try {
|
|
444
|
+
requestPageModelBuild(doc);
|
|
445
|
+
}
|
|
446
|
+
catch (buildErr) { }
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
catch (err) {
|
|
450
|
+
if (err?.name === "AbortError") {
|
|
451
|
+
// Swallow aborts – a newer refresh superseded this one
|
|
1156
452
|
return;
|
|
1157
453
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
454
|
+
throw err;
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
useEffect(() => {
|
|
458
|
+
if (!editContext.scrollIntoView ||
|
|
459
|
+
!iframeRef.current?.contentDocument?.documentElement)
|
|
460
|
+
return;
|
|
461
|
+
const component = getComponentById(editContext.scrollIntoView, pageViewContextRef.current.page);
|
|
462
|
+
if (!component)
|
|
463
|
+
return;
|
|
464
|
+
const rect = findComponentRect(iframeRef.current, component, true);
|
|
465
|
+
if (!rect)
|
|
466
|
+
return;
|
|
467
|
+
// Check if element is already in viewport
|
|
468
|
+
const iframeHeight = iframeRef.current.getBoundingClientRect().height;
|
|
469
|
+
const scrollTop = iframeRef.current?.contentWindow?.scrollY || 0;
|
|
470
|
+
const elementTop = rect.rect.y;
|
|
471
|
+
const isInViewport = elementTop >= scrollTop && elementTop <= scrollTop + iframeHeight;
|
|
472
|
+
// If already in viewport, no need to scroll
|
|
473
|
+
if (isInViewport) {
|
|
474
|
+
editContext.setScrollIntoView(undefined);
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
const scrollPosition = rect.rect.y - iframeHeight / 2 + rect.rect.height / 2;
|
|
478
|
+
iframeRef.current?.contentWindow?.scrollTo({
|
|
479
|
+
top: scrollPosition,
|
|
480
|
+
behavior: "smooth",
|
|
481
|
+
});
|
|
482
|
+
editContext.setScrollIntoView(undefined);
|
|
483
|
+
}, [editContext.scrollIntoView, pageViewContext.page]);
|
|
484
|
+
useEffect(() => {
|
|
485
|
+
const handleMessage = (message) => {
|
|
486
|
+
if (message.origin !== window.location.origin)
|
|
487
|
+
return;
|
|
488
|
+
if (message.data.type === "editor-exitFullscreen") {
|
|
489
|
+
pageViewContext.setFullscreen(false);
|
|
490
|
+
}
|
|
491
|
+
if (message.data.type === "editor-timings") {
|
|
492
|
+
editContext.setTimings(message.data.timings);
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
window.addEventListener("message", handleMessage);
|
|
496
|
+
return () => {
|
|
497
|
+
window.removeEventListener("message", handleMessage);
|
|
498
|
+
};
|
|
499
|
+
}, []);
|
|
500
|
+
const selecionChangeHandler = useDebouncedCallback(() => {
|
|
501
|
+
const sel = iframeRef.current?.contentDocument?.getSelection();
|
|
502
|
+
const isInlineAiUiFocused = () => {
|
|
503
|
+
const activeEl = document.activeElement;
|
|
504
|
+
return !!(activeEl?.closest(".agent-inline-dialog") ||
|
|
505
|
+
activeEl?.closest(".agent-inline-trigger") ||
|
|
506
|
+
activeEl?.closest('[role="dialog"]'));
|
|
507
|
+
};
|
|
508
|
+
if (!sel || sel.rangeCount === 0) {
|
|
509
|
+
if (!isInlineAiUiFocused()) {
|
|
510
|
+
editContextRef.current?.setSelectedRange(undefined);
|
|
1203
511
|
}
|
|
1204
512
|
return;
|
|
1205
513
|
}
|
|
1206
|
-
|
|
514
|
+
// Preserve the last non-collapsed selection while the inline AI UI takes focus.
|
|
515
|
+
// This avoids losing context when users click the trigger or dialog.
|
|
516
|
+
if (sel.isCollapsed && isInlineAiUiFocused()) {
|
|
1207
517
|
return;
|
|
1208
518
|
}
|
|
1209
|
-
|
|
519
|
+
// Find the field element containing the selection/caret
|
|
520
|
+
const fieldElement = findClosestFieldElement(sel.anchorNode);
|
|
521
|
+
if (!fieldElement) {
|
|
522
|
+
if (!isInlineAiUiFocused()) {
|
|
523
|
+
editContextRef.current?.setSelectedRange(undefined);
|
|
524
|
+
}
|
|
1210
525
|
return;
|
|
1211
|
-
|
|
526
|
+
}
|
|
527
|
+
const fieldId = fieldElement.getAttribute("data-fieldid");
|
|
528
|
+
if (!fieldId)
|
|
1212
529
|
return;
|
|
1213
|
-
const
|
|
1214
|
-
if
|
|
530
|
+
const range = sel.getRangeAt(0);
|
|
531
|
+
// Guard: if layout components are hidden, do not set focus for fields of layout components
|
|
532
|
+
if (editContextRef.current?.showLayoutComponents === false &&
|
|
533
|
+
pageViewContextRef.current?.page) {
|
|
534
|
+
const ownerId = fieldElement.getAttribute("data-itemid") || "";
|
|
535
|
+
const owner = getComponentById(ownerId, pageViewContextRef.current.page);
|
|
536
|
+
if (owner?.layoutId)
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
// Compute the global offsets relative to the field element.
|
|
540
|
+
const globalStartOffset = getGlobalTextOffset(fieldElement, range.startContainer, range.startOffset);
|
|
541
|
+
const globalEndOffset = getGlobalTextOffset(fieldElement, range.endContainer, range.endOffset);
|
|
542
|
+
const selectedText = range.toString();
|
|
543
|
+
// Extract plain text context from the DOM
|
|
544
|
+
const { contextBefore, contextAfter } = extractDOMSelectionContext(fieldElement, globalStartOffset, globalEndOffset);
|
|
545
|
+
// Clone the range for the replaceText callback (ranges can become invalid after DOM changes)
|
|
546
|
+
const rangeClone = range.cloneRange();
|
|
547
|
+
const itemId = fieldElement.getAttribute("data-itemid") || "";
|
|
548
|
+
const language = fieldElement.getAttribute("data-language") || "";
|
|
549
|
+
const versionStr = fieldElement.getAttribute("data-version");
|
|
550
|
+
const version = versionStr ? parseInt(versionStr, 10) : 0;
|
|
551
|
+
editContextRef.current?.setSelectedRange({
|
|
552
|
+
itemId,
|
|
553
|
+
fieldId: fieldId,
|
|
554
|
+
language,
|
|
555
|
+
version,
|
|
556
|
+
startOffset: globalStartOffset,
|
|
557
|
+
endOffset: globalEndOffset,
|
|
558
|
+
text: selectedText,
|
|
559
|
+
contextBefore,
|
|
560
|
+
contextAfter,
|
|
561
|
+
// Create a callback that uses DOM Range API to replace text in contenteditable
|
|
562
|
+
replaceText: (newText) => {
|
|
563
|
+
try {
|
|
564
|
+
// Delete the selected content (no-op for collapsed ranges)
|
|
565
|
+
rangeClone.deleteContents();
|
|
566
|
+
// Insert the new text - use the correct document from the range containers
|
|
567
|
+
const doc = rangeClone.startContainer.ownerDocument || document;
|
|
568
|
+
const textNode = doc.createTextNode(newText);
|
|
569
|
+
rangeClone.insertNode(textNode);
|
|
570
|
+
// Collapse the range to the end of the inserted text
|
|
571
|
+
rangeClone.setStartAfter(textNode);
|
|
572
|
+
rangeClone.collapse(true);
|
|
573
|
+
// Update the selection
|
|
574
|
+
const iframeSel = iframeRef.current?.contentDocument?.getSelection();
|
|
575
|
+
if (iframeSel) {
|
|
576
|
+
iframeSel.removeAllRanges();
|
|
577
|
+
iframeSel.addRange(rangeClone);
|
|
578
|
+
}
|
|
579
|
+
// Explicitly save the field value since the MutationObserver may not be active
|
|
580
|
+
// when text is selected without entering inline edit mode
|
|
581
|
+
const isRichText = fieldElement?.getAttribute("data-is-richtext") === "true";
|
|
582
|
+
const valueToSave = isRichText
|
|
583
|
+
? fieldElement?.innerHTML
|
|
584
|
+
: fieldElement?.innerText;
|
|
585
|
+
if (fieldId &&
|
|
586
|
+
itemId &&
|
|
587
|
+
language &&
|
|
588
|
+
version &&
|
|
589
|
+
editContextRef.current) {
|
|
590
|
+
editContextRef.current.operations.editField({
|
|
591
|
+
field: {
|
|
592
|
+
fieldId,
|
|
593
|
+
fieldName: fieldElement?.getAttribute("data-fieldname") || undefined,
|
|
594
|
+
item: { id: itemId, language, version },
|
|
595
|
+
},
|
|
596
|
+
refresh: "none",
|
|
597
|
+
value: valueToSave,
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
catch (error) {
|
|
602
|
+
console.error("[PageViewerFrame] Failed to replace text:", error);
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
});
|
|
606
|
+
}, 300);
|
|
607
|
+
useEffect(() => {
|
|
608
|
+
const iframe = iframeRef.current;
|
|
609
|
+
if (!iframe)
|
|
1215
610
|
return;
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
611
|
+
let boundDocument = null;
|
|
612
|
+
let boundDocumentElement = null;
|
|
613
|
+
let boundScrollContainer = null;
|
|
614
|
+
let mutationObserver = null;
|
|
615
|
+
const handleIframeMouseDown = async (event) => {
|
|
616
|
+
const target = event.target;
|
|
617
|
+
const targetElement = target;
|
|
618
|
+
if (editContextRef.current?.isRefreshing && showSpinner)
|
|
619
|
+
return;
|
|
620
|
+
// Activate the editor slot this iframe belongs to
|
|
621
|
+
const slotElement = iframe?.closest("[data-editor-slot]");
|
|
622
|
+
const slotId = slotElement?.getAttribute("data-slotid");
|
|
623
|
+
if (slotId && editContextRef.current?.activeSlotId !== slotId) {
|
|
624
|
+
editContextRef.current?.setActiveSlot(slotId);
|
|
1219
625
|
}
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
626
|
+
// Skip selection changes on right-click (button 2) - let context menu handler deal with it
|
|
627
|
+
if (event.button === 2)
|
|
628
|
+
return;
|
|
629
|
+
const fieldElement = targetElement
|
|
630
|
+
? findParentWithAttribute(targetElement, "data-fieldid")
|
|
631
|
+
: null;
|
|
632
|
+
const pageForSelection = pageViewContextRef.current?.page;
|
|
633
|
+
const fieldDescriptor = fieldElement?.hasAttribute("data-itemid")
|
|
634
|
+
? getFieldDescriptorFromElement(fieldElement)
|
|
635
|
+
: undefined;
|
|
636
|
+
const componentIdFromField = fieldDescriptor && targetElement && pageForSelection
|
|
637
|
+
? resolveComponentIdForFieldTarget(fieldDescriptor, targetElement, pageForSelection)
|
|
638
|
+
: undefined;
|
|
639
|
+
const rawComponentId = componentIdFromField ??
|
|
640
|
+
(targetElement ? findNearestEditableComponentId(targetElement) : undefined);
|
|
641
|
+
let componentId = rawComponentId;
|
|
642
|
+
if (!componentIdFromField && componentId && pageForSelection) {
|
|
643
|
+
componentId = resolveComponentIdForTarget(componentId, targetElement, pageForSelection);
|
|
1234
644
|
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
645
|
+
// Layout components can still be selected even when showLayoutComponents is false
|
|
646
|
+
// They will be displayed in read-only mode
|
|
647
|
+
const currentOverlayName = editContextRef.current?.currentOverlay;
|
|
648
|
+
const isGeneratorOverlay = !!(currentOverlayName &&
|
|
649
|
+
typeof currentOverlayName === "string" &&
|
|
650
|
+
currentOverlayName.endsWith("_generators"));
|
|
651
|
+
// Don't close context-menu overlay on mousedown - let it handle its own closing
|
|
652
|
+
if (editContextRef.current?.currentOverlay &&
|
|
653
|
+
!isGeneratorOverlay &&
|
|
654
|
+
editContextRef.current.currentOverlay !== "context-menu")
|
|
655
|
+
editContextRef.current?.setCurrentOverlay(undefined);
|
|
656
|
+
if (componentId) {
|
|
657
|
+
const currentSelection = editContextRef.current?.selection || [];
|
|
658
|
+
if (event.shiftKey && currentSelection.length > 0) {
|
|
659
|
+
const page = pageViewContextRef.current?.page;
|
|
660
|
+
if (page) {
|
|
661
|
+
// Build ordered list of visible component ids by DOM order
|
|
662
|
+
const doc = iframeRef.current?.contentDocument;
|
|
663
|
+
const orderedIds = [];
|
|
664
|
+
if (doc) {
|
|
665
|
+
const all = Array.from(doc.querySelectorAll("[data-component-id]"));
|
|
666
|
+
for (const el of all) {
|
|
667
|
+
const id = el.getAttribute("data-component-id");
|
|
668
|
+
if (!id)
|
|
669
|
+
continue;
|
|
670
|
+
// Layout components are now selectable even when showLayoutComponents is false
|
|
671
|
+
orderedIds.push(id);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
const anchorId = currentSelection[currentSelection.length - 1];
|
|
675
|
+
const aIdx = orderedIds.indexOf(anchorId);
|
|
676
|
+
const bIdx = orderedIds.indexOf(componentId);
|
|
677
|
+
if (aIdx !== -1 && bIdx !== -1) {
|
|
678
|
+
const start = Math.min(aIdx, bIdx);
|
|
679
|
+
const end = Math.max(aIdx, bIdx);
|
|
680
|
+
const range = orderedIds.slice(start, end + 1);
|
|
681
|
+
if (event.ctrlKey) {
|
|
682
|
+
const union = new Set([...currentSelection, ...range]);
|
|
683
|
+
editContextRef.current?.select(Array.from(union));
|
|
684
|
+
}
|
|
685
|
+
else {
|
|
686
|
+
editContextRef.current?.select(range);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
else {
|
|
690
|
+
editContextRef.current?.select([componentId]);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
else {
|
|
694
|
+
editContextRef.current?.select([componentId]);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
else if (event.ctrlKey) {
|
|
698
|
+
// Toggle selection: add if not selected, remove if already selected
|
|
699
|
+
const idx = currentSelection.indexOf(componentId);
|
|
700
|
+
if (idx === -1) {
|
|
701
|
+
editContextRef.current?.select([...currentSelection, componentId]);
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
const newSelection = [...currentSelection];
|
|
705
|
+
newSelection.splice(idx, 1);
|
|
706
|
+
editContextRef.current?.select(newSelection);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
else {
|
|
710
|
+
// Regular click: always select just this component
|
|
711
|
+
editContextRef.current?.select([componentId]);
|
|
712
|
+
}
|
|
713
|
+
// if (mode !== "edit") {
|
|
714
|
+
//editContextRef.current?.setScrollIntoView(componentId);
|
|
715
|
+
//}
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
editContextRef.current?.select([]);
|
|
719
|
+
}
|
|
720
|
+
// Skip field focusing when using modifier keys for multi-selection
|
|
721
|
+
if (!event.ctrlKey &&
|
|
722
|
+
!event.shiftKey &&
|
|
723
|
+
((editContextRef.current?.mode === "edit" &&
|
|
724
|
+
pageViewContextRef.current?.page?.item.canWriteItem) ||
|
|
725
|
+
editContextRef.current?.mode === "suggestions")) {
|
|
726
|
+
if (fieldElement?.hasAttribute("data-itemid")) {
|
|
727
|
+
// Guard: if layout components are hidden, do not allow editing fields of layout components
|
|
728
|
+
if (editContextRef.current?.showLayoutComponents === false &&
|
|
729
|
+
pageViewContextRef.current?.page) {
|
|
730
|
+
const owningItemId = fieldElement.getAttribute("data-itemid") || "";
|
|
731
|
+
const ownerComponent = getComponentById(owningItemId, pageViewContextRef.current.page);
|
|
732
|
+
if (ownerComponent?.layoutId) {
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
blockBlurEventRef.current = Date.now() + 500;
|
|
737
|
+
const shouldRequestLock = editContextRef.current?.mode !== "suggestions";
|
|
738
|
+
const hasLock = (await fieldsContextRef.current?.setFocusedField(fieldDescriptor, shouldRequestLock)) ?? false;
|
|
739
|
+
if (hasLock &&
|
|
740
|
+
fieldsContextRef.current?.inlineEditingFieldElement !== fieldElement) {
|
|
741
|
+
fieldsContextRef.current?.setInlineEditingFieldElement(fieldElement);
|
|
742
|
+
// Don't prevent default - we want the browser's natural cursor positioning
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
// Clicked inside iframe but not on a field: clear focused field
|
|
747
|
+
fieldsContextRef.current?.setFocusedField(undefined, false);
|
|
748
|
+
fieldsContextRef.current?.setInlineEditingFieldElement(undefined);
|
|
749
|
+
// Release field locks when unfocusing field
|
|
750
|
+
if (editContextRef.current?.unlockField) {
|
|
751
|
+
editContextRef.current.unlockField(undefined);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
const clickEvent = new MouseEvent("click", {
|
|
756
|
+
view: window,
|
|
757
|
+
bubbles: true,
|
|
758
|
+
cancelable: true,
|
|
759
|
+
clientX: event.clientX,
|
|
760
|
+
clientY: event.clientY,
|
|
761
|
+
});
|
|
762
|
+
if (!isGeneratorOverlay) {
|
|
763
|
+
document.dispatchEvent(clickEvent);
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
const handleIframeScroll = () => {
|
|
767
|
+
const scrollTop = boundScrollContainer?.scrollTop || 0;
|
|
768
|
+
scrollHandler(scrollTop);
|
|
769
|
+
};
|
|
770
|
+
const handleIframeWindowScroll = () => {
|
|
771
|
+
const scrollTop = boundScrollContainer?.scrollTop || 0;
|
|
772
|
+
scrollHandler(scrollTop);
|
|
773
|
+
};
|
|
774
|
+
const handleIframeKeyDown = (event) => {
|
|
775
|
+
// Handle Ctrl+. keyboard shortcut to open AI text editor
|
|
776
|
+
// Forward this to the parent window since InlineAiTrigger listens there
|
|
777
|
+
const isCtrlPeriod = (event.ctrlKey || event.metaKey) && event.key === ".";
|
|
778
|
+
if (isCtrlPeriod) {
|
|
779
|
+
// Dispatch the inline-ai-open event on the parent window's document
|
|
780
|
+
// so InlineAiTrigger can catch it
|
|
781
|
+
const parentEvent = new CustomEvent("inline-ai-open", {
|
|
782
|
+
bubbles: true,
|
|
783
|
+
cancelable: true,
|
|
784
|
+
});
|
|
785
|
+
window.parent.document.dispatchEvent(parentEvent);
|
|
786
|
+
// Also prevent default to avoid any browser behavior
|
|
787
|
+
event.preventDefault();
|
|
788
|
+
event.stopPropagation();
|
|
1246
789
|
return;
|
|
1247
|
-
if (clearSelection) {
|
|
1248
|
-
editor.setSelectedRange(undefined);
|
|
1249
790
|
}
|
|
1250
|
-
|
|
791
|
+
editContextRef.current?.handleKeyDown(event);
|
|
792
|
+
};
|
|
793
|
+
const handleIframeBlur = () => {
|
|
794
|
+
// Block blur event if it was triggered by clicking on a field
|
|
795
|
+
if (blockBlurEventRef.current < Date.now()) {
|
|
796
|
+
// Only clear if the focus didn't move to the parent document (e.g. AI dialog)
|
|
797
|
+
// OR if we still have a selection range.
|
|
798
|
+
// We use a small timeout because document.activeElement might not be updated yet
|
|
799
|
+
setTimeout(() => {
|
|
800
|
+
const activeEl = document.activeElement;
|
|
801
|
+
const isDialog = activeEl?.closest(".agent-inline-dialog") ||
|
|
802
|
+
activeEl?.closest('[role="dialog"]');
|
|
803
|
+
const isTrigger = activeEl?.closest(".agent-inline-trigger");
|
|
804
|
+
// If focus moved to dialog/trigger (e.g. inline AI), don't force a blur boundary yet.
|
|
805
|
+
if (!isDialog && !isTrigger) {
|
|
806
|
+
// Always mark a field blur operation boundary so consecutive edits do not
|
|
807
|
+
// collapse into a single undo step when a selection range is still present.
|
|
808
|
+
editContextRef.current?.operations.onFieldBlur?.();
|
|
809
|
+
// Leaving the iframe ends inline editing even if we keep the
|
|
810
|
+
// selection metadata. Suggestions mode relies on this blur
|
|
811
|
+
// boundary so pending suggestions can be re-applied after focus
|
|
812
|
+
// moves to the surrounding editor UI.
|
|
813
|
+
fieldsContextRef.current?.setInlineEditingFieldElement(undefined);
|
|
814
|
+
}
|
|
815
|
+
}, 100);
|
|
816
|
+
}
|
|
817
|
+
else {
|
|
818
|
+
blockBlurEventRef.current = 0;
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
const detachListeners = () => {
|
|
822
|
+
if (!iframe || !boundDocument || !boundDocumentElement)
|
|
823
|
+
return;
|
|
824
|
+
boundDocumentElement.removeEventListener("mousedown", handleIframeMouseDown);
|
|
825
|
+
boundDocumentElement.removeEventListener("click", handleIframeClick);
|
|
826
|
+
iframe.contentWindow?.removeEventListener("contextmenu", handleContextMenu, true);
|
|
827
|
+
boundDocument.removeEventListener("selectionchange", selecionChangeHandler);
|
|
828
|
+
boundDocument.removeEventListener("keydown", handleIframeKeyDown);
|
|
829
|
+
boundDocumentElement.removeEventListener("blur", handleIframeBlur, true);
|
|
830
|
+
boundScrollContainer?.removeEventListener("scroll", handleIframeScroll);
|
|
831
|
+
iframe.contentWindow?.removeEventListener("scroll", handleIframeWindowScroll);
|
|
832
|
+
mutationObserver?.disconnect();
|
|
833
|
+
mutationObserver = null;
|
|
834
|
+
boundScrollContainer = null;
|
|
835
|
+
boundDocumentElement = null;
|
|
836
|
+
boundDocument = null;
|
|
1251
837
|
};
|
|
1252
|
-
const
|
|
1253
|
-
const
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
if (
|
|
1259
|
-
|
|
838
|
+
const attachListeners = () => {
|
|
839
|
+
const iframeDocument = iframe.contentDocument || iframe.contentWindow?.document;
|
|
840
|
+
const iframeDocumentElement = iframeDocument?.documentElement;
|
|
841
|
+
if (!iframeDocument || !iframeDocumentElement)
|
|
842
|
+
return;
|
|
843
|
+
// Skip if already bound to current root element.
|
|
844
|
+
if (boundDocument === iframeDocument &&
|
|
845
|
+
boundDocumentElement === iframeDocumentElement) {
|
|
1260
846
|
return;
|
|
1261
847
|
}
|
|
1262
|
-
|
|
848
|
+
detachListeners();
|
|
849
|
+
boundDocument = iframeDocument;
|
|
850
|
+
boundDocumentElement = iframeDocumentElement;
|
|
851
|
+
iframeDocumentElement.addEventListener("mousedown", handleIframeMouseDown);
|
|
852
|
+
iframeDocumentElement.addEventListener("click", handleIframeClick);
|
|
853
|
+
iframe.contentWindow?.addEventListener("contextmenu", handleContextMenu, true);
|
|
854
|
+
boundScrollContainer =
|
|
855
|
+
iframe.contentWindow?.document.scrollingElement ||
|
|
856
|
+
iframe.contentWindow?.document.body ||
|
|
857
|
+
null;
|
|
858
|
+
boundScrollContainer?.addEventListener("scroll", handleIframeScroll);
|
|
859
|
+
iframe.contentWindow?.addEventListener("scroll", handleIframeWindowScroll);
|
|
860
|
+
iframeDocument.addEventListener("selectionchange", selecionChangeHandler);
|
|
861
|
+
iframeDocument.addEventListener("keydown", handleIframeKeyDown);
|
|
862
|
+
iframeDocumentElement.addEventListener("blur", handleIframeBlur, true);
|
|
863
|
+
mutationObserver = new MutationObserver((records) => {
|
|
864
|
+
// Ignore all text field edits
|
|
865
|
+
if (records.some((x) => !(x &&
|
|
866
|
+
"getAttribute" in x.target &&
|
|
867
|
+
x.target.getAttribute("data-fieldid") &&
|
|
868
|
+
x.target.getAttribute("data-itemid")))) {
|
|
869
|
+
requestPageModelBuild(iframeDocument);
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
mutationObserver.observe(iframeDocument, {
|
|
873
|
+
childList: true, // observe direct children changes
|
|
874
|
+
subtree: true, // observe all descendants changes
|
|
875
|
+
characterData: false, // observe text changes
|
|
876
|
+
//attributes: true, // observe attribute changes (like style or class)
|
|
877
|
+
});
|
|
878
|
+
requestPageModelBuild(iframeDocument);
|
|
1263
879
|
};
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
}
|
|
1276
|
-
if (!componentId) {
|
|
1277
|
-
if (interaction.kind === "click")
|
|
1278
|
-
selectFromBridgeInteraction([]);
|
|
1279
|
-
if (isEditableFieldClick) {
|
|
1280
|
-
clearSelectedRangeForEditableClick();
|
|
1281
|
-
await beginTrackedBridgeInlineEdit(effectiveInteraction);
|
|
880
|
+
const parsePositiveInt = (value) => {
|
|
881
|
+
if (!value)
|
|
882
|
+
return undefined;
|
|
883
|
+
const parsed = parseInt(value, 10);
|
|
884
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
885
|
+
};
|
|
886
|
+
const resolveLinkedItemDescriptor = (anchor, clickedElement) => {
|
|
887
|
+
const href = anchor.getAttribute("href") || anchor.href;
|
|
888
|
+
let hrefUrl;
|
|
889
|
+
try {
|
|
890
|
+
hrefUrl = new URL(anchor.href, iframe.contentWindow?.location?.href || window.location.href);
|
|
1282
891
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
endTrackedBridgeFieldFocus();
|
|
892
|
+
catch {
|
|
893
|
+
return undefined;
|
|
1286
894
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
895
|
+
const attributeContainer = clickedElement?.closest("[data-itemid],[data-language],[data-version],[sc_item],[sc_itemid],[sc_lang]") || anchor;
|
|
896
|
+
// Parse Sitecore RTE format first: ~/link.aspx?_id=GUID&_z=z (target item, not the containing component)
|
|
897
|
+
let itemIdRaw;
|
|
898
|
+
if (href.includes("~/link.aspx?_id=") ||
|
|
899
|
+
href.includes("link.aspx?_id=")) {
|
|
900
|
+
const idFromUrl = hrefUrl.searchParams.get("_id");
|
|
901
|
+
if (idFromUrl) {
|
|
902
|
+
// Convert compact GUID (AD973E51E8454BD2B333859375FBBA24) to standard format with dashes
|
|
903
|
+
itemIdRaw = idFromUrl
|
|
904
|
+
.replace(/^(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})$/i, "$1-$2-$3-$4-$5")
|
|
905
|
+
.toLowerCase();
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
if (!itemIdRaw) {
|
|
909
|
+
itemIdRaw =
|
|
910
|
+
hrefUrl.searchParams.get("sc_itemid") ??
|
|
911
|
+
hrefUrl.searchParams.get("itemid") ??
|
|
912
|
+
anchor.getAttribute("data-itemid") ??
|
|
913
|
+
anchor.getAttribute("sc_itemid") ??
|
|
914
|
+
attributeContainer?.getAttribute("data-itemid") ??
|
|
915
|
+
attributeContainer?.getAttribute("sc_itemid") ??
|
|
916
|
+
(anchor.getAttribute("sc_item")
|
|
917
|
+
? extractItemIdFromItemUri(anchor.getAttribute("sc_item"))
|
|
918
|
+
: undefined) ??
|
|
919
|
+
(attributeContainer?.getAttribute("sc_item")
|
|
920
|
+
? extractItemIdFromItemUri(attributeContainer.getAttribute("sc_item"))
|
|
921
|
+
: undefined);
|
|
922
|
+
}
|
|
923
|
+
const itemId = cleanId(itemIdRaw);
|
|
924
|
+
if (!itemId)
|
|
925
|
+
return undefined;
|
|
926
|
+
const language = hrefUrl.searchParams.get("sc_lang") ??
|
|
927
|
+
hrefUrl.searchParams.get("lang") ??
|
|
928
|
+
hrefUrl.searchParams.get("language") ??
|
|
929
|
+
anchor.getAttribute("data-language") ??
|
|
930
|
+
anchor.getAttribute("sc_lang") ??
|
|
931
|
+
attributeContainer?.getAttribute("data-language") ??
|
|
932
|
+
attributeContainer?.getAttribute("sc_lang") ??
|
|
933
|
+
editContextRef.current?.currentItemDescriptor?.language ??
|
|
934
|
+
editContextRef.current?.item?.language;
|
|
935
|
+
if (!language)
|
|
936
|
+
return undefined;
|
|
937
|
+
const version = parsePositiveInt(hrefUrl.searchParams.get("sc_version")) ??
|
|
938
|
+
parsePositiveInt(hrefUrl.searchParams.get("version")) ??
|
|
939
|
+
parsePositiveInt(anchor.getAttribute("data-version")) ??
|
|
940
|
+
parsePositiveInt(attributeContainer?.getAttribute("data-version")) ??
|
|
941
|
+
editContextRef.current?.currentItemDescriptor?.version ??
|
|
942
|
+
editContextRef.current?.item?.version ??
|
|
943
|
+
0;
|
|
944
|
+
return {
|
|
945
|
+
id: itemId,
|
|
946
|
+
language,
|
|
947
|
+
version,
|
|
948
|
+
};
|
|
949
|
+
};
|
|
950
|
+
const handleIframeClick = async (event) => {
|
|
951
|
+
const target = event.target;
|
|
952
|
+
if (!target)
|
|
953
|
+
return;
|
|
954
|
+
const anchor = target.tagName.toLowerCase() === "a"
|
|
955
|
+
? target
|
|
956
|
+
: target.closest("a");
|
|
957
|
+
if (!anchor)
|
|
958
|
+
return;
|
|
959
|
+
const href = anchor.getAttribute("href") || anchor.href;
|
|
960
|
+
if (!href || href.startsWith("#") || href.startsWith("javascript:")) {
|
|
961
|
+
return;
|
|
1293
962
|
}
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
963
|
+
const mode = editContextRef.current?.mode;
|
|
964
|
+
const isPreviewOrSuggestions = mode === "preview" || mode === "suggestions";
|
|
965
|
+
if (isPreviewOrSuggestions) {
|
|
966
|
+
let hrefUrl;
|
|
967
|
+
try {
|
|
968
|
+
hrefUrl = new URL(anchor.href, iframe.contentWindow?.location?.href || window.location.href);
|
|
969
|
+
}
|
|
970
|
+
catch {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
const iframeOrigin = iframe.contentWindow?.location?.origin;
|
|
974
|
+
const isInternalLink = hrefUrl.origin === window.location.origin ||
|
|
975
|
+
(iframeOrigin ? hrefUrl.origin === iframeOrigin : false);
|
|
976
|
+
if (!isInternalLink) {
|
|
977
|
+
event.preventDefault();
|
|
978
|
+
event.stopPropagation();
|
|
979
|
+
window.open(hrefUrl.toString(), "_blank", "noopener,noreferrer");
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
if (isInternalLink) {
|
|
983
|
+
const linkedItem = resolveLinkedItemDescriptor(anchor, target);
|
|
984
|
+
if (linkedItem) {
|
|
985
|
+
event.preventDefault();
|
|
986
|
+
event.stopPropagation();
|
|
987
|
+
await editContextRef.current?.loadItem(linkedItem, {
|
|
988
|
+
openInNewSlot: event.altKey,
|
|
989
|
+
});
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
// If this link cannot be resolved to an item, allow browser behavior.
|
|
994
|
+
return;
|
|
1299
995
|
}
|
|
1300
|
-
|
|
1301
|
-
|
|
996
|
+
// In edit mode, keep navigation inside iframe disabled.
|
|
997
|
+
event.preventDefault();
|
|
998
|
+
};
|
|
999
|
+
const handleContextMenu = async (event) => {
|
|
1000
|
+
if (editContextRef.current?.isRefreshing && showSpinner)
|
|
1302
1001
|
return;
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1305
|
-
.filter((component) => !!component);
|
|
1306
|
-
if (selectedComponents.length === 0)
|
|
1002
|
+
const target = event.target;
|
|
1003
|
+
if (!target)
|
|
1307
1004
|
return;
|
|
1005
|
+
if (event.ctrlKey)
|
|
1006
|
+
return;
|
|
1007
|
+
event.preventDefault();
|
|
1008
|
+
event.stopPropagation();
|
|
1009
|
+
let componentId = findNearestEditableComponentId(target);
|
|
1010
|
+
const pageForContextMenu = pageViewContextRef.current?.page;
|
|
1011
|
+
if (componentId && pageForContextMenu) {
|
|
1012
|
+
componentId = resolveComponentIdForTarget(componentId, target, pageForContextMenu);
|
|
1013
|
+
}
|
|
1014
|
+
// Layout components can now be right-clicked even when showLayoutComponents is false
|
|
1015
|
+
// Context menu will show limited/read-only actions
|
|
1016
|
+
if (componentId) {
|
|
1017
|
+
// Only change selection if right-clicking on a component that's not in the current selection
|
|
1018
|
+
if (!editContextRef.current?.selection.includes(componentId)) {
|
|
1019
|
+
// Right-clicking on a component not in the selection - select just that component
|
|
1020
|
+
editContextRef.current.select([componentId]);
|
|
1021
|
+
}
|
|
1022
|
+
// else: right-clicking on a component already in the selection - keep current selection
|
|
1023
|
+
}
|
|
1024
|
+
const fieldElement = findParentWithAttribute(target, "data-fieldid");
|
|
1025
|
+
const selectedComponents = editContextRef.current?.selection
|
|
1026
|
+
.map((id) => getComponentById(id, pageViewContextRef.current.page))
|
|
1027
|
+
.filter((x) => x);
|
|
1028
|
+
// Context menu will now show for layout components even when showLayoutComponents is false
|
|
1029
|
+
// Commands will be appropriately filtered/disabled
|
|
1308
1030
|
const iframeRect = iframe.getBoundingClientRect();
|
|
1309
|
-
const clientX = iframeRect.x + (interaction.clientX ?? 0);
|
|
1310
|
-
const clientY = iframeRect.y + (interaction.clientY ?? 0);
|
|
1311
|
-
const menuPosition = { x: clientX, y: clientY };
|
|
1312
1031
|
const adjustedEvent = new MouseEvent("contextmenu", {
|
|
1313
1032
|
bubbles: true,
|
|
1314
1033
|
cancelable: true,
|
|
1315
|
-
shiftKey:
|
|
1316
|
-
altKey:
|
|
1317
|
-
ctrlKey:
|
|
1318
|
-
metaKey: interaction.metaKey,
|
|
1034
|
+
shiftKey: event.shiftKey,
|
|
1035
|
+
altKey: event.altKey,
|
|
1036
|
+
ctrlKey: event.ctrlKey,
|
|
1319
1037
|
view: window,
|
|
1320
|
-
clientX,
|
|
1321
|
-
clientY,
|
|
1322
|
-
button: 2,
|
|
1038
|
+
clientX: event.clientX + iframeRect.x,
|
|
1039
|
+
clientY: event.clientY + iframeRect.y,
|
|
1323
1040
|
});
|
|
1041
|
+
// Store the original context menu position for overlay positioning
|
|
1042
|
+
const menuPosition = {
|
|
1043
|
+
x: event.clientX + iframeRect.x,
|
|
1044
|
+
y: event.clientY + iframeRect.y,
|
|
1045
|
+
};
|
|
1324
1046
|
setContextMenuPosition(menuPosition);
|
|
1047
|
+
// Only show a spinner if work takes longer than 100ms
|
|
1325
1048
|
let loadingShown = false;
|
|
1326
|
-
const loadingTimer =
|
|
1049
|
+
const loadingTimer = setTimeout(() => {
|
|
1327
1050
|
loadingShown = true;
|
|
1328
|
-
|
|
1051
|
+
editContextRef.current?.showContextMenu(adjustedEvent, [
|
|
1329
1052
|
{
|
|
1330
1053
|
id: "loading",
|
|
1331
|
-
label: "Loading
|
|
1054
|
+
label: "Loading…",
|
|
1332
1055
|
disabled: true,
|
|
1333
1056
|
icon: _jsx(Spinner, { size: "sm", className: "mr-2" }),
|
|
1334
1057
|
},
|
|
1335
1058
|
]);
|
|
1336
1059
|
}, 100);
|
|
1337
|
-
const field =
|
|
1060
|
+
const field = fieldElement
|
|
1061
|
+
? getFieldDescriptorFromElement(fieldElement)
|
|
1062
|
+
: undefined;
|
|
1338
1063
|
const fieldButtons = field ? await loadFieldButtons(field) : [];
|
|
1339
|
-
|
|
1064
|
+
// Create a handler that has access to the current menu position
|
|
1065
|
+
const handleParameterizedActionWithPosition = (field, action, allFieldButtons, event) => {
|
|
1340
1066
|
setContextMenuField(field);
|
|
1341
1067
|
setContextMenuFieldButtons([action]);
|
|
1342
1068
|
setPreSelectedAction(action);
|
|
1343
|
-
|
|
1069
|
+
// Create a new MouseEvent with the captured position
|
|
1070
|
+
const syntheticEvent = new MouseEvent("click", {
|
|
1071
|
+
bubbles: true,
|
|
1072
|
+
cancelable: true,
|
|
1073
|
+
view: window,
|
|
1074
|
+
clientX: menuPosition.x,
|
|
1075
|
+
clientY: menuPosition.y,
|
|
1076
|
+
screenX: menuPosition.x,
|
|
1077
|
+
screenY: menuPosition.y,
|
|
1078
|
+
});
|
|
1079
|
+
// Add target property to the event for proper positioning
|
|
1080
|
+
Object.defineProperty(syntheticEvent, "target", {
|
|
1081
|
+
value: document.body,
|
|
1082
|
+
enumerable: true,
|
|
1083
|
+
});
|
|
1084
|
+
console.log("About to show overlay with position:", {
|
|
1085
|
+
menuPosition,
|
|
1086
|
+
syntheticEvent,
|
|
1087
|
+
preSelectedAction: action,
|
|
1088
|
+
});
|
|
1089
|
+
// Add a small delay to ensure context menu has closed
|
|
1090
|
+
setTimeout(() => {
|
|
1091
|
+
console.log("Showing overlay with position:", {
|
|
1092
|
+
menuPosition,
|
|
1093
|
+
syntheticEvent,
|
|
1094
|
+
preSelectedAction: action,
|
|
1095
|
+
});
|
|
1096
|
+
// Create a temporary element at the exact position for better positioning
|
|
1344
1097
|
const tempElement = document.createElement("div");
|
|
1345
1098
|
tempElement.style.position = "fixed";
|
|
1346
1099
|
tempElement.style.left = menuPosition.x + "px";
|
|
@@ -1350,6 +1103,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1350
1103
|
tempElement.style.visibility = "hidden";
|
|
1351
1104
|
tempElement.style.pointerEvents = "none";
|
|
1352
1105
|
document.body.appendChild(tempElement);
|
|
1106
|
+
// Create event targeting the positioned element
|
|
1353
1107
|
const positionedEvent = new MouseEvent("click", {
|
|
1354
1108
|
bubbles: true,
|
|
1355
1109
|
cancelable: true,
|
|
@@ -1362,1073 +1116,334 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1362
1116
|
enumerable: true,
|
|
1363
1117
|
});
|
|
1364
1118
|
fieldActionsOverlay.current?.show(positionedEvent, action);
|
|
1365
|
-
|
|
1366
|
-
|
|
1119
|
+
// Clean up the temporary element after overlay is shown
|
|
1120
|
+
setTimeout(() => {
|
|
1121
|
+
document.body.removeChild(tempElement);
|
|
1367
1122
|
}, 1000);
|
|
1368
1123
|
}, 100);
|
|
1369
1124
|
};
|
|
1370
|
-
const items = await buildComponentContextMenuItems(selectedComponents,
|
|
1371
|
-
|
|
1372
|
-
if (loadingShown)
|
|
1373
|
-
|
|
1125
|
+
const items = await buildComponentContextMenuItems(selectedComponents, editContextRef.current, field, fieldButtons, handleParameterizedActionWithPosition);
|
|
1126
|
+
clearTimeout(loadingTimer);
|
|
1127
|
+
if (loadingShown)
|
|
1128
|
+
editContextRef.current?.updateContextMenu(items);
|
|
1129
|
+
else
|
|
1130
|
+
editContextRef.current?.showContextMenu(adjustedEvent, items);
|
|
1131
|
+
};
|
|
1132
|
+
const handleLoad = () => {
|
|
1133
|
+
// Skip handling if this load does not correspond to the latest requested revision
|
|
1134
|
+
const expectedRevision = currentLoadRef.current?.revision ?? "";
|
|
1135
|
+
const currentRevision = editContextRef.current?.revision ?? "";
|
|
1136
|
+
if (expectedRevision && expectedRevision !== currentRevision) {
|
|
1137
|
+
console.log("Stale load skipped", {
|
|
1138
|
+
expectedRevision,
|
|
1139
|
+
currentRevision,
|
|
1140
|
+
});
|
|
1141
|
+
return;
|
|
1374
1142
|
}
|
|
1375
|
-
|
|
1376
|
-
|
|
1143
|
+
setShowSpinner(false);
|
|
1144
|
+
attachListeners();
|
|
1145
|
+
};
|
|
1146
|
+
rebindIframeInteractionsRef.current = attachListeners;
|
|
1147
|
+
if (iframe) {
|
|
1148
|
+
// If the iframe is already loaded, attach the listener immediately
|
|
1149
|
+
if (iframe.contentDocument?.readyState === "complete" ||
|
|
1150
|
+
iframe.contentDocument?.readyState === "interactive") {
|
|
1151
|
+
handleLoad();
|
|
1377
1152
|
}
|
|
1378
|
-
|
|
1153
|
+
iframe.addEventListener("load", handleLoad);
|
|
1379
1154
|
}
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
if (anchorIndex !== -1 && targetIndex !== -1) {
|
|
1386
|
-
const start = Math.min(anchorIndex, targetIndex);
|
|
1387
|
-
const end = Math.max(anchorIndex, targetIndex);
|
|
1388
|
-
const range = orderedIds.slice(start, end + 1);
|
|
1389
|
-
if (interaction.ctrlKey || interaction.metaKey) {
|
|
1390
|
-
const nextSelection = [...currentSelection];
|
|
1391
|
-
for (const id of range) {
|
|
1392
|
-
if (!nextSelection.some((selectedId) => bridgeIdsMatch(selectedId, id))) {
|
|
1393
|
-
nextSelection.push(id);
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
selectFromBridgeInteraction(nextSelection);
|
|
1397
|
-
}
|
|
1398
|
-
else {
|
|
1399
|
-
selectFromBridgeInteraction(range);
|
|
1400
|
-
}
|
|
1155
|
+
// Cleanup function
|
|
1156
|
+
return () => {
|
|
1157
|
+
rebindIframeInteractionsRef.current = null;
|
|
1158
|
+
if (iframe) {
|
|
1159
|
+
iframe.removeEventListener("load", handleLoad);
|
|
1401
1160
|
}
|
|
1402
|
-
|
|
1403
|
-
selectFromBridgeInteraction([componentId]);
|
|
1404
|
-
}
|
|
1405
|
-
return;
|
|
1406
|
-
}
|
|
1407
|
-
if (interaction.ctrlKey || interaction.metaKey) {
|
|
1408
|
-
if (currentSelection.includes(componentId)) {
|
|
1409
|
-
selectFromBridgeInteraction(currentSelection.filter((id) => id !== componentId));
|
|
1410
|
-
}
|
|
1411
|
-
else {
|
|
1412
|
-
selectFromBridgeInteraction([...currentSelection, componentId]);
|
|
1413
|
-
}
|
|
1414
|
-
return;
|
|
1415
|
-
}
|
|
1416
|
-
selectFromBridgeInteraction([componentId]);
|
|
1417
|
-
if (isEditableFieldClick) {
|
|
1418
|
-
clearSelectedRangeForEditableClick();
|
|
1419
|
-
await beginTrackedBridgeInlineEdit(effectiveInteraction);
|
|
1420
|
-
}
|
|
1421
|
-
else {
|
|
1422
|
-
closeInlineAiIfOpen();
|
|
1423
|
-
endTrackedBridgeFieldFocus();
|
|
1424
|
-
}
|
|
1425
|
-
}, [
|
|
1426
|
-
beginTrackedBridgeInlineEdit,
|
|
1427
|
-
endTrackedBridgeFieldFocus,
|
|
1428
|
-
resolveBridgeFieldDescriptor,
|
|
1429
|
-
]);
|
|
1430
|
-
// Update the context whenever the iframe ref changes
|
|
1431
|
-
useEffect(() => {
|
|
1432
|
-
pageViewContext.setEditorIframe(iframeElement);
|
|
1433
|
-
}, [iframeElement, pageViewContext.setEditorIframe]);
|
|
1434
|
-
// Same-origin fast path for overlay scroll tracking. The bridge's
|
|
1435
|
-
// scrollChanged postMessage is delivered as a task after the host's
|
|
1436
|
-
// rendering update, so overlays driven by it paint at least one frame
|
|
1437
|
-
// behind the page. When the host document is same-origin we can observe its
|
|
1438
|
-
// scroll directly and translate the overlay layer synchronously inside the
|
|
1439
|
-
// scroll event, which paints in the same frame. The bridge remains the only
|
|
1440
|
-
// channel for cross-origin hosts and for everything besides scroll.
|
|
1441
|
-
useEffect(() => {
|
|
1442
|
-
const iframe = iframeElement;
|
|
1443
|
-
if (!iframe)
|
|
1444
|
-
return;
|
|
1445
|
-
let detach;
|
|
1446
|
-
const attach = () => {
|
|
1447
|
-
detach?.();
|
|
1448
|
-
detach = undefined;
|
|
1449
|
-
directOverlayScrollSyncRef.current = false;
|
|
1450
|
-
const iframeDocument = getAccessibleIframeDocument(iframe);
|
|
1451
|
-
// The pre-load document is an accessible about:blank even when the
|
|
1452
|
-
// host that commits afterwards is cross-origin. Binding to it would
|
|
1453
|
-
// suppress the bridge path while the real host streams in, so wait for
|
|
1454
|
-
// the load rebind instead.
|
|
1455
|
-
if (!iframeDocument || iframeDocument.URL === "about:blank")
|
|
1456
|
-
return;
|
|
1457
|
-
let lastX = Number.NaN;
|
|
1458
|
-
let lastY = Number.NaN;
|
|
1459
|
-
const handleScroll = () => {
|
|
1460
|
-
const scroll = getIframeWindowScroll(iframe);
|
|
1461
|
-
if (!scroll || (scroll.x === lastX && scroll.y === lastY))
|
|
1462
|
-
return;
|
|
1463
|
-
lastX = scroll.x;
|
|
1464
|
-
lastY = scroll.y;
|
|
1465
|
-
dispatchBridgeOverlayScroll(iframe, scroll, getBridgeGeometryScrollScale(pageViewContextRef.current?.bridgeGeometry));
|
|
1466
|
-
};
|
|
1467
|
-
iframeDocument.addEventListener("scroll", handleScroll, {
|
|
1468
|
-
capture: true,
|
|
1469
|
-
passive: true,
|
|
1470
|
-
});
|
|
1471
|
-
directOverlayScrollSyncRef.current = true;
|
|
1472
|
-
detach = () => {
|
|
1473
|
-
directOverlayScrollSyncRef.current = false;
|
|
1474
|
-
iframeDocument.removeEventListener("scroll", handleScroll, {
|
|
1475
|
-
capture: true,
|
|
1476
|
-
});
|
|
1477
|
-
};
|
|
1478
|
-
};
|
|
1479
|
-
attach();
|
|
1480
|
-
// Each navigation creates a new host document, so rebind per load.
|
|
1481
|
-
iframe.addEventListener("load", attach);
|
|
1482
|
-
return () => {
|
|
1483
|
-
iframe.removeEventListener("load", attach);
|
|
1484
|
-
detach?.();
|
|
1485
|
-
directOverlayScrollSyncRef.current = false;
|
|
1486
|
-
};
|
|
1487
|
-
}, [iframeElement, loadedIframeSrc]);
|
|
1488
|
-
useEffect(() => {
|
|
1489
|
-
const iframe = iframeElement;
|
|
1490
|
-
if (!iframe)
|
|
1491
|
-
return;
|
|
1492
|
-
const currentIframeSrc = iframe.src;
|
|
1493
|
-
if (!iframeSrc ||
|
|
1494
|
-
!loadedIframeSrc ||
|
|
1495
|
-
loadedIframeSrc !== currentIframeSrc) {
|
|
1496
|
-
pageViewContext.setBridgeReady(false);
|
|
1497
|
-
pageViewContext.setIframeSupportsRefresh(false);
|
|
1498
|
-
return;
|
|
1499
|
-
}
|
|
1500
|
-
const allowedHostOrigins = [
|
|
1501
|
-
getUrlOrigin(pageViewContext.editUrl),
|
|
1502
|
-
getUrlOrigin(pageViewContext.previewUrl),
|
|
1503
|
-
].filter((origin) => Boolean(origin));
|
|
1504
|
-
if (allowedHostOrigins.length === 0) {
|
|
1505
|
-
pageViewContext.setBridgeReady(false);
|
|
1506
|
-
pageViewContext.setIframeSupportsRefresh(false);
|
|
1507
|
-
return;
|
|
1508
|
-
}
|
|
1509
|
-
let client;
|
|
1510
|
-
client = new BridgeClient({
|
|
1511
|
-
iframe,
|
|
1512
|
-
editorOrigin: window.location.origin,
|
|
1513
|
-
allowedHostOrigins,
|
|
1514
|
-
onReadyChange: (ready) => {
|
|
1515
|
-
pageViewContext.setBridgeReady(ready);
|
|
1516
|
-
if (!ready)
|
|
1517
|
-
pageViewContext.setIframeSupportsRefresh(false);
|
|
1518
|
-
},
|
|
1519
|
-
onError: (error) => {
|
|
1520
|
-
pageViewContext.setBridgeReady(false);
|
|
1521
|
-
pageViewContext.setIframeSupportsRefresh(false);
|
|
1522
|
-
console.error("[Parhelia bridge]", error.message);
|
|
1523
|
-
if (!compareView) {
|
|
1524
|
-
editContextRef.current?.showErrorToast({
|
|
1525
|
-
summary: "Editing host bridge unavailable",
|
|
1526
|
-
details: error.message,
|
|
1527
|
-
});
|
|
1528
|
-
}
|
|
1529
|
-
},
|
|
1530
|
-
onEvent: (event, bridge) => {
|
|
1531
|
-
switch (event.name) {
|
|
1532
|
-
case "ready":
|
|
1533
|
-
clearBridgePatchSignatures();
|
|
1534
|
-
pageViewContext.setIframeSupportsRefresh(bridge.supportsCapability("refresh"));
|
|
1535
|
-
bridge.sendCommand("init", {
|
|
1536
|
-
editorOrigin: window.location.origin,
|
|
1537
|
-
sessionId: editContextRef.current?.sessionId,
|
|
1538
|
-
mode: editContextRef.current?.mode ?? "edit",
|
|
1539
|
-
suggestionsCursorActive: editContextRef.current?.mode === "suggestions" ||
|
|
1540
|
-
!!editContextRef.current?.showSuggestedEdits,
|
|
1541
|
-
selectedComponentIds: editContextRef.current?.selection ?? [],
|
|
1542
|
-
featureFlags: {
|
|
1543
|
-
crossOriginBridge: true,
|
|
1544
|
-
},
|
|
1545
|
-
version: bridge.getDiagnostics().editorVersion,
|
|
1546
|
-
acknowledgedCapabilities: bridge.getAcknowledgedCapabilities(),
|
|
1547
|
-
});
|
|
1548
|
-
bridge.sendCommand("setZoom", {
|
|
1549
|
-
zoom: pageViewContextRef.current?.zoom ?? 1,
|
|
1550
|
-
});
|
|
1551
|
-
break;
|
|
1552
|
-
case "structureUpdated":
|
|
1553
|
-
pageViewContext.setBridgeStructure(event.payload.structure);
|
|
1554
|
-
break;
|
|
1555
|
-
case "pageSkeletonUpdated":
|
|
1556
|
-
pageViewContext.setPageSkeleton(event.payload.pageSkeleton);
|
|
1557
|
-
break;
|
|
1558
|
-
case "geometryUpdated": {
|
|
1559
|
-
latestBridgeScrollRef.current = event.payload.geometry.scroll;
|
|
1560
|
-
pageViewContext.bridgeGeometry = event.payload.geometry;
|
|
1561
|
-
pageViewContext.setBridgeGeometry(event.payload.geometry);
|
|
1562
|
-
scheduleBridgeGeometryRevision();
|
|
1563
|
-
// The snapshot's scroll can be a frame older than what the direct
|
|
1564
|
-
// same-origin listener already applied; prefer the live position.
|
|
1565
|
-
const overlayScroll = (directOverlayScrollSyncRef.current
|
|
1566
|
-
? getIframeWindowScroll(iframe)
|
|
1567
|
-
: undefined) ?? event.payload.geometry.scroll;
|
|
1568
|
-
dispatchBridgeOverlayScroll(iframe, overlayScroll, getBridgeGeometryScrollScale(event.payload.geometry));
|
|
1569
|
-
dispatchBridgeOverlayGeometry(iframe, event.payload.geometry, overlayScroll);
|
|
1570
|
-
if (shouldTrackMinimapScroll()) {
|
|
1571
|
-
scrollHandlerRef.current(event.payload.geometry.scroll.y);
|
|
1572
|
-
}
|
|
1573
|
-
break;
|
|
1574
|
-
}
|
|
1575
|
-
case "domUpdated":
|
|
1576
|
-
pageViewContext.bridgeDom = event.payload;
|
|
1577
|
-
pageViewContext.setBridgeDom(event.payload);
|
|
1578
|
-
scheduleBridgeDomRevision();
|
|
1579
|
-
window.dispatchEvent(new CustomEvent(BRIDGE_DOM_UPDATED_EVENT));
|
|
1580
|
-
break;
|
|
1581
|
-
case "refreshStarted":
|
|
1582
|
-
clearBridgePatchSignatures();
|
|
1583
|
-
activeBridgeInlineEditRef.current = null;
|
|
1584
|
-
break;
|
|
1585
|
-
case "refreshCompleted":
|
|
1586
|
-
// Runtime refresh replaces host DOM without a new bridge ready event.
|
|
1587
|
-
// Field patches sent during the refresh window may have been cached
|
|
1588
|
-
// against the previous DOM generation, so force the refreshed host to
|
|
1589
|
-
// receive the current repository values again.
|
|
1590
|
-
clearBridgePatchSignatures();
|
|
1591
|
-
if (event.payload.structure) {
|
|
1592
|
-
pageViewContext.setBridgeStructure(event.payload.structure);
|
|
1593
|
-
}
|
|
1594
|
-
if (event.payload.geometry) {
|
|
1595
|
-
latestBridgeScrollRef.current = event.payload.geometry.scroll;
|
|
1596
|
-
pageViewContext.bridgeGeometry = event.payload.geometry;
|
|
1597
|
-
pageViewContext.setBridgeGeometry(event.payload.geometry);
|
|
1598
|
-
scheduleBridgeGeometryRevision();
|
|
1599
|
-
const overlayScroll = (directOverlayScrollSyncRef.current
|
|
1600
|
-
? getIframeWindowScroll(iframe)
|
|
1601
|
-
: undefined) ?? event.payload.geometry.scroll;
|
|
1602
|
-
dispatchBridgeOverlayScroll(iframe, overlayScroll, getBridgeGeometryScrollScale(event.payload.geometry));
|
|
1603
|
-
dispatchBridgeOverlayGeometry(iframe, event.payload.geometry, overlayScroll);
|
|
1604
|
-
if (shouldTrackMinimapScroll()) {
|
|
1605
|
-
scrollHandlerRef.current(event.payload.geometry.scroll.y);
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
if (pendingRefreshScrollRef.current) {
|
|
1609
|
-
const targetScroll = pendingRefreshScrollRef.current;
|
|
1610
|
-
const observedScroll = event.payload.geometry?.scroll ?? {
|
|
1611
|
-
x: 0,
|
|
1612
|
-
y: 0,
|
|
1613
|
-
};
|
|
1614
|
-
const deltaX = targetScroll.x - observedScroll.x;
|
|
1615
|
-
const deltaY = targetScroll.y - observedScroll.y;
|
|
1616
|
-
pendingRefreshScrollRef.current = undefined;
|
|
1617
|
-
if (Math.abs(deltaX) > 1 || Math.abs(deltaY) > 1) {
|
|
1618
|
-
restoreIframeWindowScroll(iframe, targetScroll);
|
|
1619
|
-
bridgeClientRef.current?.sendCommand("scrollBy", {
|
|
1620
|
-
x: deltaX,
|
|
1621
|
-
y: deltaY,
|
|
1622
|
-
behavior: "instant",
|
|
1623
|
-
});
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
setShowSpinner(false);
|
|
1627
|
-
break;
|
|
1628
|
-
case "selectionChanged":
|
|
1629
|
-
pageViewContext.setBridgeSelection(event.payload.selection);
|
|
1630
|
-
handleBridgeSelection(event.payload.selection, iframe);
|
|
1631
|
-
break;
|
|
1632
|
-
case "fieldValueChanged":
|
|
1633
|
-
handleBridgeFieldValueChanged(event.payload);
|
|
1634
|
-
break;
|
|
1635
|
-
case "inlineEditEnded":
|
|
1636
|
-
handleBridgeInlineEditEnded(event.payload);
|
|
1637
|
-
activeBridgeInlineEditRef.current = null;
|
|
1638
|
-
break;
|
|
1639
|
-
case "interaction":
|
|
1640
|
-
pageViewContext.setBridgeInteraction(event.payload);
|
|
1641
|
-
void handleBridgeInteraction(event.payload, iframe);
|
|
1642
|
-
break;
|
|
1643
|
-
case "dragGestureStarted":
|
|
1644
|
-
iframe?.dispatchEvent(new CustomEvent(IFRAME_OVERLAY_BRIDGE_DRAG_GESTURE_EVENT, {
|
|
1645
|
-
detail: { phase: "start", ...event.payload },
|
|
1646
|
-
}));
|
|
1647
|
-
break;
|
|
1648
|
-
case "dragGestureMoved":
|
|
1649
|
-
iframe?.dispatchEvent(new CustomEvent(IFRAME_OVERLAY_BRIDGE_DRAG_GESTURE_EVENT, {
|
|
1650
|
-
detail: { phase: "move", ...event.payload },
|
|
1651
|
-
}));
|
|
1652
|
-
break;
|
|
1653
|
-
case "dragGestureEnded":
|
|
1654
|
-
iframe?.dispatchEvent(new CustomEvent(IFRAME_OVERLAY_BRIDGE_DRAG_GESTURE_EVENT, {
|
|
1655
|
-
detail: { phase: "end", ...event.payload },
|
|
1656
|
-
}));
|
|
1657
|
-
break;
|
|
1658
|
-
case "dragSnapshot":
|
|
1659
|
-
iframe?.dispatchEvent(new CustomEvent(IFRAME_OVERLAY_BRIDGE_DRAG_GESTURE_EVENT, {
|
|
1660
|
-
detail: { phase: "snapshot", ...event.payload },
|
|
1661
|
-
}));
|
|
1662
|
-
break;
|
|
1663
|
-
case "scrollChanged":
|
|
1664
|
-
latestBridgeScrollRef.current = event.payload.scroll;
|
|
1665
|
-
// With the direct same-origin listener active, this message is a
|
|
1666
|
-
// late echo of a scroll the overlay already applied; re-dispatching
|
|
1667
|
-
// it would briefly drag the overlay back to a stale position.
|
|
1668
|
-
if (!directOverlayScrollSyncRef.current) {
|
|
1669
|
-
dispatchBridgeOverlayScroll(iframe, event.payload.scroll, getBridgeGeometryScrollScale(pageViewContextRef.current?.bridgeGeometry));
|
|
1670
|
-
}
|
|
1671
|
-
if (shouldTrackMinimapScroll()) {
|
|
1672
|
-
scrollHandlerRef.current(event.payload.scroll.y);
|
|
1673
|
-
}
|
|
1674
|
-
break;
|
|
1675
|
-
case "renderError":
|
|
1676
|
-
console.warn("[Parhelia bridge] Host render error", event.payload);
|
|
1677
|
-
break;
|
|
1678
|
-
}
|
|
1679
|
-
},
|
|
1680
|
-
});
|
|
1681
|
-
bridgeClientRef.current = client;
|
|
1682
|
-
pageViewContext.setBridgeReady(false);
|
|
1683
|
-
client.connect();
|
|
1684
|
-
return () => {
|
|
1685
|
-
if (bridgeClientRef.current === client) {
|
|
1686
|
-
bridgeClientRef.current = null;
|
|
1687
|
-
}
|
|
1688
|
-
client.disconnect();
|
|
1689
|
-
clearBridgePatchSignatures();
|
|
1690
|
-
activeBridgeInlineEditRef.current = null;
|
|
1691
|
-
pageViewContext.setBridgeReady(false);
|
|
1692
|
-
pageViewContext.setIframeSupportsRefresh(false);
|
|
1693
|
-
};
|
|
1694
|
-
}, [
|
|
1695
|
-
iframeElement,
|
|
1696
|
-
iframeSrc,
|
|
1697
|
-
loadedIframeSrc,
|
|
1698
|
-
compareView,
|
|
1699
|
-
handleBridgeFieldValueChanged,
|
|
1700
|
-
handleBridgeInlineEditEnded,
|
|
1701
|
-
handleBridgeInteraction,
|
|
1702
|
-
handleBridgeSelection,
|
|
1703
|
-
clearBridgePatchSignatures,
|
|
1704
|
-
pageViewContext.editUrl,
|
|
1705
|
-
pageViewContext.previewUrl,
|
|
1706
|
-
scheduleBridgeDomRevision,
|
|
1707
|
-
scheduleBridgeGeometryRevision,
|
|
1708
|
-
shouldTrackMinimapScroll,
|
|
1709
|
-
]);
|
|
1710
|
-
useEffect(() => {
|
|
1711
|
-
const repository = editContext.itemsRepository;
|
|
1712
|
-
let disposed = false;
|
|
1713
|
-
const unsubscribe = repository.subscribeItemsChanged((changes) => {
|
|
1714
|
-
const fieldChanges = changes.filter((change) => change.action === "update" &&
|
|
1715
|
-
(change.changes.fields?.length ?? 0) > 0);
|
|
1716
|
-
if (fieldChanges.length === 0)
|
|
1717
|
-
return;
|
|
1718
|
-
const bridge = bridgeClientRef.current;
|
|
1719
|
-
const structure = pageViewContextRef.current?.bridgeStructure;
|
|
1720
|
-
if (!bridge || !structure?.fields.length)
|
|
1721
|
-
return;
|
|
1722
|
-
const processResolvedField = (change, changedFieldId, field) => {
|
|
1723
|
-
if (disposed)
|
|
1724
|
-
return;
|
|
1725
|
-
const patchedElementKeys = new Set();
|
|
1726
|
-
const patches = [];
|
|
1727
|
-
for (const structureField of structure.fields) {
|
|
1728
|
-
if (!structureField.elementKey)
|
|
1729
|
-
continue;
|
|
1730
|
-
if (patchedElementKeys.has(structureField.elementKey))
|
|
1731
|
-
continue;
|
|
1732
|
-
if (!bridgeDescriptorMatchesItem(structureField.item, change.item)) {
|
|
1733
|
-
continue;
|
|
1734
|
-
}
|
|
1735
|
-
if (!bridgeFieldMatchesChangedField(structureField.fieldId, changedFieldId, field)) {
|
|
1736
|
-
continue;
|
|
1737
|
-
}
|
|
1738
|
-
const patch = buildBridgeFieldPatch({
|
|
1739
|
-
field,
|
|
1740
|
-
structureField,
|
|
1741
|
-
itemDescriptor: change.item,
|
|
1742
|
-
preferRepositoryValue: change.source === "local-field-update",
|
|
1743
|
-
});
|
|
1744
|
-
if (!patch)
|
|
1745
|
-
continue;
|
|
1746
|
-
patchedElementKeys.add(structureField.elementKey);
|
|
1747
|
-
patches.push(patch);
|
|
1748
|
-
}
|
|
1749
|
-
for (const patch of patches) {
|
|
1750
|
-
if (disposed)
|
|
1751
|
-
return;
|
|
1752
|
-
const structureField = structure.fields.find((field) => field.elementKey === patch.elementKey &&
|
|
1753
|
-
field.fieldId === patch.fieldId);
|
|
1754
|
-
sendBridgeFieldPatch(bridge, patch, structureField?.textContent);
|
|
1755
|
-
}
|
|
1756
|
-
};
|
|
1757
|
-
const asyncFieldChanges = [];
|
|
1758
|
-
for (const change of fieldChanges) {
|
|
1759
|
-
const localFieldsById = new Map((change.changes.fieldValues ?? []).map((field) => [
|
|
1760
|
-
field.id.toLowerCase(),
|
|
1761
|
-
field,
|
|
1762
|
-
]));
|
|
1763
|
-
let needsAsyncLookup = false;
|
|
1764
|
-
for (const changedFieldId of change.changes.fields ?? []) {
|
|
1765
|
-
if (disposed)
|
|
1766
|
-
return;
|
|
1767
|
-
const localField = localFieldsById.get(changedFieldId.toLowerCase());
|
|
1768
|
-
if (!localField) {
|
|
1769
|
-
needsAsyncLookup = true;
|
|
1770
|
-
continue;
|
|
1771
|
-
}
|
|
1772
|
-
processResolvedField(change, changedFieldId, localField);
|
|
1773
|
-
}
|
|
1774
|
-
if (needsAsyncLookup) {
|
|
1775
|
-
asyncFieldChanges.push(change);
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1778
|
-
if (asyncFieldChanges.length === 0)
|
|
1779
|
-
return;
|
|
1780
|
-
void (async () => {
|
|
1781
|
-
for (const change of asyncFieldChanges) {
|
|
1782
|
-
if (disposed)
|
|
1783
|
-
return;
|
|
1784
|
-
const item = await repository.getItem(change.item);
|
|
1785
|
-
for (const changedFieldId of change.changes.fields ?? []) {
|
|
1786
|
-
if (disposed)
|
|
1787
|
-
return;
|
|
1788
|
-
const field = change.changes.fieldValues?.find((candidate) => fieldIdentifierMatches(candidate, changedFieldId)) ??
|
|
1789
|
-
item?.fields.find((candidate) => fieldIdentifierMatches(candidate, changedFieldId)) ??
|
|
1790
|
-
(await repository.getField({
|
|
1791
|
-
fieldId: changedFieldId,
|
|
1792
|
-
item: change.item,
|
|
1793
|
-
}));
|
|
1794
|
-
if (!field)
|
|
1795
|
-
continue;
|
|
1796
|
-
processResolvedField(change, changedFieldId, field);
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
})().catch((error) => {
|
|
1800
|
-
if (!disposed) {
|
|
1801
|
-
console.warn("[Parhelia bridge] Failed to patch host field", error);
|
|
1802
|
-
}
|
|
1803
|
-
});
|
|
1804
|
-
});
|
|
1805
|
-
return () => {
|
|
1806
|
-
disposed = true;
|
|
1807
|
-
unsubscribe();
|
|
1161
|
+
detachListeners();
|
|
1808
1162
|
};
|
|
1809
|
-
}, [
|
|
1810
|
-
buildBridgeFieldPatch,
|
|
1811
|
-
editContext.itemsRepository,
|
|
1812
|
-
sendBridgeFieldPatch,
|
|
1813
|
-
]);
|
|
1163
|
+
}, [iframeRef.current]);
|
|
1814
1164
|
useEffect(() => {
|
|
1815
|
-
|
|
1816
|
-
const structure = pageViewContext.bridgeStructure;
|
|
1817
|
-
if (!pageViewContext.bridgeReady || !bridge || !structure?.fields.length) {
|
|
1818
|
-
return;
|
|
1819
|
-
}
|
|
1820
|
-
let disposed = false;
|
|
1821
|
-
void (async () => {
|
|
1822
|
-
const patchedElementKeys = new Set();
|
|
1823
|
-
for (const structureField of structure.fields) {
|
|
1824
|
-
if (disposed)
|
|
1825
|
-
return;
|
|
1826
|
-
if (!structureField.elementKey)
|
|
1827
|
-
continue;
|
|
1828
|
-
if (patchedElementKeys.has(structureField.elementKey))
|
|
1829
|
-
continue;
|
|
1830
|
-
const fallbackItem = pageViewContextRef.current?.pageItemDescriptor ??
|
|
1831
|
-
pageViewContextRef.current?.page?.item?.descriptor;
|
|
1832
|
-
const bridgeItem = structureField.item;
|
|
1833
|
-
const itemDescriptor = {
|
|
1834
|
-
id: bridgeItem?.id ?? fallbackItem?.id,
|
|
1835
|
-
language: bridgeItem?.language ?? fallbackItem?.language,
|
|
1836
|
-
version: typeof bridgeItem?.version === "number"
|
|
1837
|
-
? bridgeItem.version
|
|
1838
|
-
: fallbackItem?.version,
|
|
1839
|
-
};
|
|
1840
|
-
if (!itemDescriptor.id ||
|
|
1841
|
-
!itemDescriptor.language ||
|
|
1842
|
-
typeof itemDescriptor.version !== "number") {
|
|
1843
|
-
continue;
|
|
1844
|
-
}
|
|
1845
|
-
const loadedItem = await editContext.itemsRepository.getItem(itemDescriptor);
|
|
1846
|
-
if (disposed || !loadedItem)
|
|
1847
|
-
continue;
|
|
1848
|
-
const field = loadedItem.fields.find((candidate) => fieldIdentifierMatches(candidate, structureField.fieldId));
|
|
1849
|
-
if (!field)
|
|
1850
|
-
continue;
|
|
1851
|
-
const showSuggestions = editContext.mode === "suggestions" || editContext.showSuggestedEdits;
|
|
1852
|
-
const dirtyModifiedField = findModifiedBridgeField({
|
|
1853
|
-
modifiedFields: fieldsContext?.modifiedFields,
|
|
1854
|
-
structureField,
|
|
1855
|
-
field,
|
|
1856
|
-
itemDescriptor: itemDescriptor,
|
|
1857
|
-
dirtyOnly: true,
|
|
1858
|
-
});
|
|
1859
|
-
if (!showSuggestions && !dirtyModifiedField) {
|
|
1860
|
-
continue;
|
|
1861
|
-
}
|
|
1862
|
-
const patch = buildBridgeFieldPatch({
|
|
1863
|
-
field,
|
|
1864
|
-
structureField,
|
|
1865
|
-
itemDescriptor: itemDescriptor,
|
|
1866
|
-
});
|
|
1867
|
-
if (!patch)
|
|
1868
|
-
continue;
|
|
1869
|
-
patchedElementKeys.add(structureField.elementKey);
|
|
1870
|
-
sendBridgeFieldPatch(bridge, patch, structureField.textContent);
|
|
1871
|
-
}
|
|
1872
|
-
})().catch((error) => {
|
|
1873
|
-
if (!disposed) {
|
|
1874
|
-
console.warn("[Parhelia bridge] Failed to patch host suggestion display", error);
|
|
1875
|
-
}
|
|
1876
|
-
});
|
|
1877
|
-
return () => {
|
|
1878
|
-
disposed = true;
|
|
1879
|
-
};
|
|
1880
|
-
}, [
|
|
1881
|
-
buildBridgeFieldPatch,
|
|
1882
|
-
editContext.itemsRepository,
|
|
1883
|
-
editContext.itemsRepository.revision,
|
|
1884
|
-
editContext.mode,
|
|
1885
|
-
editContext.showSuggestedEdits,
|
|
1886
|
-
editContext.suggestedEdits,
|
|
1887
|
-
fieldsContext?.modifiedFields,
|
|
1888
|
-
bridgeDomRevision,
|
|
1889
|
-
pageViewContext.bridgeReady,
|
|
1890
|
-
pageViewContext.bridgeStructure,
|
|
1891
|
-
sendBridgeFieldPatch,
|
|
1892
|
-
]);
|
|
1893
|
-
useEffect(() => {
|
|
1894
|
-
const requestBridgeGeometry = (payload) => {
|
|
1895
|
-
const bridge = bridgeClientRef.current;
|
|
1896
|
-
if (!bridge)
|
|
1897
|
-
return false;
|
|
1898
|
-
// The editing host only remembers the most recent queryGeometry payload.
|
|
1899
|
-
// Comments, suggestions, locks and version-diff each contribute text
|
|
1900
|
-
// ranges independently, so without merging they clobbered one another and
|
|
1901
|
-
// fought in an endless re-request loop (heavy highlight flicker). Keep the
|
|
1902
|
-
// latest ranges per `source` and always query with their union.
|
|
1903
|
-
if (payload && typeof payload.source === "string") {
|
|
1904
|
-
const { source, textRanges, ...rest } = payload;
|
|
1905
|
-
const sources = bridgeTextRangeSourcesRef.current;
|
|
1906
|
-
if (textRanges && textRanges.length > 0) {
|
|
1907
|
-
sources.set(source, textRanges);
|
|
1908
|
-
}
|
|
1909
|
-
else {
|
|
1910
|
-
sources.delete(source);
|
|
1911
|
-
}
|
|
1912
|
-
const mergedTextRanges = Array.from(sources.values()).flat();
|
|
1913
|
-
return (bridge.sendCommand("queryGeometry", {
|
|
1914
|
-
...rest,
|
|
1915
|
-
textRanges: mergedTextRanges,
|
|
1916
|
-
}) ?? false);
|
|
1917
|
-
}
|
|
1918
|
-
return bridge.sendCommand("queryGeometry", payload) ?? false;
|
|
1919
|
-
};
|
|
1920
|
-
pageViewContext.requestBridgeGeometry = requestBridgeGeometry;
|
|
1921
|
-
const requestBridgeScrollBy = (payload) => {
|
|
1922
|
-
return bridgeClientRef.current?.sendCommand("scrollBy", payload) ?? false;
|
|
1923
|
-
};
|
|
1924
|
-
const requestBridgeRichTextCommand = (payload) => {
|
|
1925
|
-
return (bridgeClientRef.current?.sendCommand("applyRichTextCommand", payload) ??
|
|
1926
|
-
false);
|
|
1927
|
-
};
|
|
1928
|
-
const requestBridgePreviewGap = (payload) => {
|
|
1929
|
-
return (bridgeClientRef.current?.sendCommand("previewGap", payload) ?? false);
|
|
1930
|
-
};
|
|
1931
|
-
const requestBridgeCaptureSnapshot = (payload) => {
|
|
1932
|
-
return (bridgeClientRef.current?.sendCommand("captureComponentSnapshot", payload) ?? false);
|
|
1933
|
-
};
|
|
1934
|
-
pageViewContext.requestBridgeScrollBy = requestBridgeScrollBy;
|
|
1935
|
-
pageViewContext.requestBridgeRichTextCommand = requestBridgeRichTextCommand;
|
|
1936
|
-
pageViewContext.requestBridgePreviewGap = requestBridgePreviewGap;
|
|
1937
|
-
pageViewContext.requestBridgeCaptureSnapshot = requestBridgeCaptureSnapshot;
|
|
1938
|
-
return () => {
|
|
1939
|
-
if (pageViewContext.requestBridgeGeometry === requestBridgeGeometry) {
|
|
1940
|
-
pageViewContext.requestBridgeGeometry = undefined;
|
|
1941
|
-
}
|
|
1942
|
-
if (pageViewContext.requestBridgeScrollBy === requestBridgeScrollBy) {
|
|
1943
|
-
pageViewContext.requestBridgeScrollBy = undefined;
|
|
1944
|
-
}
|
|
1945
|
-
if (pageViewContext.requestBridgePreviewGap === requestBridgePreviewGap) {
|
|
1946
|
-
pageViewContext.requestBridgePreviewGap = undefined;
|
|
1947
|
-
}
|
|
1948
|
-
if (pageViewContext.requestBridgeCaptureSnapshot ===
|
|
1949
|
-
requestBridgeCaptureSnapshot) {
|
|
1950
|
-
pageViewContext.requestBridgeCaptureSnapshot = undefined;
|
|
1951
|
-
}
|
|
1952
|
-
if (pageViewContext.requestBridgeRichTextCommand ===
|
|
1953
|
-
requestBridgeRichTextCommand) {
|
|
1954
|
-
pageViewContext.requestBridgeRichTextCommand = undefined;
|
|
1955
|
-
}
|
|
1956
|
-
};
|
|
1957
|
-
}, [pageViewContext]);
|
|
1958
|
-
useEffect(() => {
|
|
1959
|
-
const requestBridgeCaptureDom = (payload) => {
|
|
1960
|
-
const bridge = bridgeClientRef.current;
|
|
1961
|
-
if (!bridge) {
|
|
1962
|
-
return Promise.reject(new Error("The Parhelia bridge is not connected to the host."));
|
|
1963
|
-
}
|
|
1964
|
-
return bridge.requestCommand("captureDom", payload, "captureDomResult", {
|
|
1965
|
-
requestId: payload.requestId,
|
|
1966
|
-
});
|
|
1967
|
-
};
|
|
1968
|
-
pageViewContext.requestBridgeCaptureDom = requestBridgeCaptureDom;
|
|
1969
|
-
return () => {
|
|
1970
|
-
if (pageViewContext.requestBridgeCaptureDom === requestBridgeCaptureDom) {
|
|
1971
|
-
pageViewContext.requestBridgeCaptureDom = undefined;
|
|
1972
|
-
}
|
|
1973
|
-
};
|
|
1974
|
-
}, [pageViewContext]);
|
|
1975
|
-
const updateMiniMapVisibility = useDebouncedCallback(() => {
|
|
1976
|
-
if (!iframeRef.current)
|
|
1977
|
-
return;
|
|
1978
|
-
const iframe = iframeRef.current;
|
|
1979
|
-
const bridgeGeometry = pageViewContextRef.current?.bridgeGeometry;
|
|
1980
|
-
const bridgeDom = pageViewContextRef.current?.bridgeDom;
|
|
1981
|
-
const contentHeight = bridgeDom?.scrollHeight ??
|
|
1982
|
-
getBridgeGeometryDocumentSize(bridgeGeometry)?.height;
|
|
1983
|
-
const clientHeight = iframe.clientHeight;
|
|
1984
|
-
if (!contentHeight || !clientHeight)
|
|
1985
|
-
return;
|
|
1986
|
-
const upperThreshold = clientHeight + 100; // show minimap if content exceeds this height
|
|
1987
|
-
const lowerThreshold = clientHeight; // hide minimap if content falls below this
|
|
1988
|
-
// Check if minimap is enabled in settings and user controls
|
|
1989
|
-
const minimapEnabled = editContext.parheliaSettings?.showMinimap !== false &&
|
|
1990
|
-
editContext.showMinimap;
|
|
1991
|
-
if (showMiniMap) {
|
|
1992
|
-
if (contentHeight <= lowerThreshold || !minimapEnabled) {
|
|
1993
|
-
setShowMiniMap(false);
|
|
1994
|
-
}
|
|
1995
|
-
}
|
|
1996
|
-
else {
|
|
1997
|
-
if (contentHeight > upperThreshold && minimapEnabled) {
|
|
1998
|
-
setShowMiniMap(true);
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
}, 100);
|
|
2002
|
-
useEffect(() => {
|
|
2003
|
-
updateMiniMapVisibility();
|
|
2004
|
-
}, [
|
|
2005
|
-
bridgeDomRevision,
|
|
2006
|
-
bridgeGeometryRevision,
|
|
2007
|
-
editContext.parheliaSettings?.showMinimap,
|
|
2008
|
-
editContext.showMinimap,
|
|
2009
|
-
iframeElement,
|
|
2010
|
-
showMiniMap,
|
|
2011
|
-
updateMiniMapVisibility,
|
|
2012
|
-
]);
|
|
2013
|
-
// If the editor mode flips into preview, clear any active text selection state.
|
|
2014
|
-
useEffect(() => {
|
|
2015
|
-
const isPreview = editContext.mode === "preview";
|
|
2016
|
-
if (isPreview) {
|
|
2017
|
-
editContextRef.current?.setSelectedRange(undefined);
|
|
2018
|
-
}
|
|
2019
|
-
}, [editContext.mode]);
|
|
2020
|
-
useEffect(() => {
|
|
2021
|
-
if (!pageItemDescriptor ||
|
|
2022
|
-
!pageViewContext.editUrl ||
|
|
2023
|
-
!pageViewContext.previewUrl)
|
|
2024
|
-
return;
|
|
2025
|
-
const urlPath = editContext.mode === "preview"
|
|
2026
|
-
? pageViewContext.previewUrl
|
|
2027
|
-
: pageViewContext.editUrl;
|
|
2028
|
-
const renderUrl = new URL(urlPath, window.location.origin);
|
|
2029
|
-
alignLoopbackHostToEditor(renderUrl);
|
|
2030
|
-
alignXmCloudManagedEditingHostToEditor(renderUrl);
|
|
2031
|
-
applyParheliaRenderContext(renderUrl, pageItemDescriptor, getEditorQueryParam("site") || pageViewContext.site?.name);
|
|
2032
|
-
const editRev = uuid();
|
|
2033
|
-
renderUrl.searchParams.set("edit_rev", editRev);
|
|
2034
|
-
if (editContext.mode !== "preview" && editContext.sessionId) {
|
|
2035
|
-
renderUrl.searchParams.set("parhelia_session", editContext.sessionId);
|
|
2036
|
-
}
|
|
2037
|
-
if (editContext.mode === "preview" && editContext.previewDate) {
|
|
2038
|
-
renderUrl.searchParams.delete("sc_version");
|
|
2039
|
-
renderUrl.searchParams.set("sc_date", toSitecoreDate(editContext.previewDate));
|
|
2040
|
-
}
|
|
2041
|
-
// Layout-mode marker. Only set when editing shared layout, paired with the
|
|
2042
|
-
// `parhelia` editor marker so ParheliaSetLayoutRenderings ignores any unrelated
|
|
2043
|
-
// requests that happen to carry parhelia_layout.
|
|
2044
|
-
if (editContext.mode !== "preview" && editContext.layoutMode === "shared") {
|
|
2045
|
-
renderUrl.searchParams.set("parhelia", "1");
|
|
2046
|
-
renderUrl.searchParams.set("parhelia_layout", "shared");
|
|
2047
|
-
}
|
|
2048
|
-
else {
|
|
2049
|
-
renderUrl.searchParams.delete("parhelia_layout");
|
|
2050
|
-
}
|
|
2051
|
-
// Detect if the version in the URL changed - this requires a full reload, not just requestRefresh
|
|
2052
|
-
// because Next.js router.replace may not properly refetch server data for version changes.
|
|
2053
|
-
const currentIframeUrl = iframeRef.current?.src;
|
|
2054
|
-
const currentIframeOrigin = getUrlOrigin(currentIframeUrl);
|
|
2055
|
-
const renderUrlIsCrossOrigin = renderUrl.origin !== window.location.origin;
|
|
2056
|
-
const iframeOriginChanged = !!(currentIframeOrigin && currentIframeOrigin !== renderUrl.origin);
|
|
2057
|
-
const currentVersion = currentIframeUrl
|
|
2058
|
-
? new URL(currentIframeUrl).searchParams.get("sc_version")
|
|
2059
|
-
: null;
|
|
2060
|
-
const newVersion = renderUrl.searchParams.get("sc_version");
|
|
2061
|
-
const versionChanged = (currentVersion !== null || newVersion !== null) &&
|
|
2062
|
-
currentVersion !== newVersion;
|
|
2063
|
-
const initialLoad = currentItemDescriptor?.id !== pageItemDescriptor.id ||
|
|
2064
|
-
currentItemDescriptor?.language !== pageItemDescriptor.language ||
|
|
2065
|
-
currentItemDescriptor?.version !== pageItemDescriptor.version;
|
|
2066
|
-
const shouldUseIframeSrcReload = initialLoad || pageViewContext.fullscreen || iframeOriginChanged;
|
|
2067
|
-
function runFallbackRefresh() {
|
|
2068
|
-
pageViewContext.setIframeSupportsRefresh(false);
|
|
2069
|
-
pendingRefreshScrollRef.current ??=
|
|
2070
|
-
getIframeWindowScroll(iframeRef.current) ??
|
|
2071
|
-
latestBridgeScrollRef.current;
|
|
2072
|
-
setShowSpinner(true);
|
|
2073
|
-
console.log(initialLoad
|
|
2074
|
-
? "Initial load - setting iframe src"
|
|
2075
|
-
: renderUrlIsCrossOrigin
|
|
2076
|
-
? "Cross-origin load - setting iframe src"
|
|
2077
|
-
: iframeOriginChanged
|
|
2078
|
-
? "Iframe origin changed - setting iframe src"
|
|
2079
|
-
: "Reloading iframe src");
|
|
2080
|
-
setLoadedIframeSrc(undefined);
|
|
2081
|
-
setIframeSrc(renderUrl.toString());
|
|
2082
|
-
}
|
|
2083
|
-
function runBridgeRefresh() {
|
|
2084
|
-
pendingRefreshScrollRef.current =
|
|
2085
|
-
getIframeWindowScroll(iframeRef.current) ??
|
|
2086
|
-
latestBridgeScrollRef.current;
|
|
2087
|
-
const bridge = bridgeClientRef.current;
|
|
2088
|
-
if (!bridge?.supportsCapability("refresh")) {
|
|
2089
|
-
runFallbackRefresh();
|
|
2090
|
-
return;
|
|
2091
|
-
}
|
|
2092
|
-
console.log("Bridge - requesting iframe refresh");
|
|
2093
|
-
pageViewContext.setIframeSupportsRefresh(true);
|
|
2094
|
-
const accepted = bridge.sendCommand("refresh", {
|
|
2095
|
-
url: renderUrl.toString(),
|
|
2096
|
-
revision: editContext.revision,
|
|
2097
|
-
layoutKind: editContext.layoutMode,
|
|
2098
|
-
});
|
|
2099
|
-
if (!accepted) {
|
|
2100
|
-
pendingRefreshScrollRef.current = undefined;
|
|
2101
|
-
pageViewContext.setIframeSupportsRefresh(false);
|
|
2102
|
-
runFallbackRefresh();
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
if (!shouldUseIframeSrcReload && !versionChanged) {
|
|
2106
|
-
if (bridgeClientRef.current?.supportsCapability("refresh")) {
|
|
2107
|
-
runBridgeRefresh();
|
|
2108
|
-
}
|
|
2109
|
-
else {
|
|
2110
|
-
const retryDelayMs = 150;
|
|
2111
|
-
const retryTimer = setTimeout(() => {
|
|
2112
|
-
runBridgeRefresh();
|
|
2113
|
-
}, retryDelayMs);
|
|
2114
|
-
setCurrentItemDescriptor(pageItemDescriptor);
|
|
2115
|
-
return () => clearTimeout(retryTimer);
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
else {
|
|
2119
|
-
runFallbackRefresh();
|
|
2120
|
-
}
|
|
2121
|
-
setCurrentItemDescriptor(pageItemDescriptor);
|
|
2122
|
-
}, [
|
|
2123
|
-
pathname,
|
|
2124
|
-
editContext.revision,
|
|
2125
|
-
pageItemDescriptor,
|
|
2126
|
-
pageViewContext.editUrl,
|
|
2127
|
-
pageViewContext.previewUrl,
|
|
2128
|
-
pageViewContext.site?.name,
|
|
2129
|
-
pageViewContext.fullscreen,
|
|
2130
|
-
editContext.mode,
|
|
2131
|
-
editContext.previewDate,
|
|
2132
|
-
editContext.sessionId,
|
|
2133
|
-
editContext.layoutMode,
|
|
2134
|
-
]);
|
|
2135
|
-
useEffect(() => {
|
|
2136
|
-
if (fieldsContext?.focusedField) {
|
|
2137
|
-
if (editContext.selection.length > 0 &&
|
|
2138
|
-
fieldsContext.focusedField.item.id !== editContext.selection[0])
|
|
2139
|
-
return;
|
|
2140
|
-
const bounds = findBridgeFieldDocumentBounds(pageViewContextRef.current?.bridgeGeometry, fieldsContext.focusedField);
|
|
2141
|
-
const activePageViewContext = pageViewContextRef.current;
|
|
2142
|
-
if (bounds && activePageViewContext) {
|
|
2143
|
-
scrollBridgeBoundsIntoView(activePageViewContext, bounds, latestBridgeScrollRef.current);
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
}, [fieldsContext?.focusedField]);
|
|
2147
|
-
// Drive the selection-scroll suppression window from the drag lifecycle.
|
|
2148
|
-
// Declared BEFORE the selection-scroll effect so it runs first in the same
|
|
2149
|
-
// commit (when a drop changes both dragObject and selection at once).
|
|
2150
|
-
useEffect(() => {
|
|
2151
|
-
if (editContext.dragObject) {
|
|
2152
|
-
// Suppress for the whole drag.
|
|
2153
|
-
suppressSelectionScrollUntilRef.current = Number.MAX_SAFE_INTEGER;
|
|
2154
|
-
}
|
|
2155
|
-
else if (suppressSelectionScrollUntilRef.current === Number.MAX_SAFE_INTEGER) {
|
|
2156
|
-
// Drag just ended: keep suppressing briefly so the drop's re-selection
|
|
2157
|
-
// (often the target's parent) doesn't scroll the page toward stale
|
|
2158
|
-
// pre-move geometry.
|
|
2159
|
-
suppressSelectionScrollUntilRef.current = Date.now() + 500;
|
|
2160
|
-
}
|
|
2161
|
-
}, [editContext.dragObject]);
|
|
2162
|
-
useEffect(() => {
|
|
2163
|
-
const selectionKey = editContext.selection.join("|");
|
|
2164
|
-
const selectionChanged = selectionKey !== lastScrolledSelectionKeyRef.current;
|
|
2165
|
-
lastScrolledSelectionKeyRef.current = selectionKey;
|
|
2166
|
-
// The effect also re-runs when focusedField changes (e.g. a field blurs
|
|
2167
|
-
// after a click). Only the selection actually changing should drive an
|
|
2168
|
-
// auto-scroll; otherwise a blur re-render scrolls the just-clicked
|
|
2169
|
-
// component away.
|
|
2170
|
-
if (!selectionChanged)
|
|
2171
|
-
return;
|
|
2172
|
-
if (suppressNextSelectionScrollRef.current) {
|
|
2173
|
-
suppressNextSelectionScrollRef.current = false;
|
|
2174
|
-
return;
|
|
2175
|
-
}
|
|
2176
|
-
// Suppressed during a drag and briefly after it ends. The drag owns
|
|
2177
|
-
// scrolling, and the drop's re-selection must not jump the page away from
|
|
2178
|
-
// where the user dropped (toward stale pre-move geometry).
|
|
2179
|
-
if (Date.now() < suppressSelectionScrollUntilRef.current)
|
|
2180
|
-
return;
|
|
2181
|
-
if (!fieldsContext?.focusedField && editContext.selection.length > 0) {
|
|
2182
|
-
const lastSelectedComponent = getComponentById(editContext.selection[editContext.selection.length - 1], pageViewContextRef.current.page);
|
|
2183
|
-
if (lastSelectedComponent) {
|
|
2184
|
-
editContext.setScrollIntoView(lastSelectedComponent.id);
|
|
2185
|
-
}
|
|
2186
|
-
}
|
|
2187
|
-
}, [editContext.selection, fieldsContext?.focusedField]);
|
|
2188
|
-
useEffect(() => {
|
|
2189
|
-
if (!editContext.scrollIntoView)
|
|
2190
|
-
return;
|
|
2191
|
-
const activePageViewContext = pageViewContextRef.current;
|
|
2192
|
-
if (!activePageViewContext)
|
|
2193
|
-
return;
|
|
2194
|
-
const scrollTarget = editContext.scrollIntoView;
|
|
2195
|
-
const requestState = scrollIntoViewRequestRef.current;
|
|
2196
|
-
const signature = getScrollIntoViewSignature(scrollTarget);
|
|
2197
|
-
if (requestState.signature !== signature) {
|
|
2198
|
-
requestState.signature = signature;
|
|
2199
|
-
requestState.requestedTextRangeGeometry = false;
|
|
2200
|
-
}
|
|
2201
|
-
const exactBounds = findScrollIntoViewDocumentBounds(activePageViewContext.bridgeGeometry, scrollTarget, { includeTextRangeFallback: false });
|
|
2202
|
-
let bounds = exactBounds;
|
|
2203
|
-
if (!bounds &&
|
|
2204
|
-
isTextRangeScrollTarget(scrollTarget) &&
|
|
2205
|
-
!requestState.requestedTextRangeGeometry) {
|
|
2206
|
-
requestState.requestedTextRangeGeometry = true;
|
|
2207
|
-
if (requestScrollTargetGeometry(activePageViewContext, scrollTarget)) {
|
|
2208
|
-
return;
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
bounds ??= findScrollIntoViewDocumentBounds(activePageViewContext.bridgeGeometry, scrollTarget, { includeTextRangeFallback: true });
|
|
2212
|
-
if (bounds) {
|
|
2213
|
-
scrollBridgeBoundsIntoView(activePageViewContext, bounds, latestBridgeScrollRef.current);
|
|
2214
|
-
}
|
|
2215
|
-
if (isTextRangeScrollTarget(scrollTarget)) {
|
|
2216
|
-
activePageViewContext.requestBridgeGeometry?.({
|
|
2217
|
-
source: SCROLL_INTO_VIEW_BRIDGE_SOURCE,
|
|
2218
|
-
textRanges: [],
|
|
2219
|
-
});
|
|
2220
|
-
}
|
|
2221
|
-
requestState.signature = "";
|
|
2222
|
-
requestState.requestedTextRangeGeometry = false;
|
|
2223
|
-
editContext.setScrollIntoView(undefined);
|
|
2224
|
-
}, [
|
|
2225
|
-
editContext.scrollIntoView,
|
|
2226
|
-
pageViewContext.page,
|
|
2227
|
-
pageViewContext.bridgeGeometry,
|
|
2228
|
-
]);
|
|
2229
|
-
useEffect(() => {
|
|
2230
|
-
const handleMessage = (message) => {
|
|
2231
|
-
if (message.origin !== window.location.origin)
|
|
2232
|
-
return;
|
|
2233
|
-
if (message.data.type === "editor-exitFullscreen") {
|
|
2234
|
-
pageViewContext.setFullscreen(false);
|
|
2235
|
-
}
|
|
2236
|
-
if (message.data.type === "editor-timings") {
|
|
2237
|
-
editContext.setTimings(message.data.timings);
|
|
2238
|
-
}
|
|
2239
|
-
};
|
|
2240
|
-
window.addEventListener("message", handleMessage);
|
|
2241
|
-
return () => {
|
|
2242
|
-
window.removeEventListener("message", handleMessage);
|
|
2243
|
-
};
|
|
2244
|
-
}, []);
|
|
2245
|
-
useEffect(() => {
|
|
2246
|
-
const iframe = iframeRef.current;
|
|
2247
|
-
if (!iframe)
|
|
2248
|
-
return;
|
|
2249
|
-
const handleLoad = () => {
|
|
2250
|
-
setShowSpinner(false);
|
|
2251
|
-
applyIframeZoom(iframe, pageViewContextRef.current?.zoom ?? 1, "PageViewerFrame.tsx:handleLoad-zoom");
|
|
2252
|
-
};
|
|
2253
|
-
iframe.addEventListener("load", handleLoad);
|
|
2254
|
-
return () => {
|
|
2255
|
-
iframe.removeEventListener("load", handleLoad);
|
|
2256
|
-
};
|
|
2257
|
-
}, [iframeElement]);
|
|
2258
|
-
useEffect(() => {
|
|
2259
|
-
const iframe = iframeRef.current;
|
|
2260
|
-
if (!iframe || typeof ResizeObserver === "undefined")
|
|
2261
|
-
return;
|
|
2262
|
-
let lastWidth = iframe.clientWidth;
|
|
2263
|
-
let lastHeight = iframe.clientHeight;
|
|
2264
|
-
let geometryTimer = null;
|
|
2265
|
-
let trailingGeometryTimer = null;
|
|
2266
|
-
const requestGeometry = () => {
|
|
2267
|
-
geometryTimer = null;
|
|
2268
|
-
const nextWidth = iframe.clientWidth;
|
|
2269
|
-
const nextHeight = iframe.clientHeight;
|
|
2270
|
-
if (nextWidth === lastWidth && nextHeight === lastHeight)
|
|
2271
|
-
return;
|
|
2272
|
-
lastWidth = nextWidth;
|
|
2273
|
-
lastHeight = nextHeight;
|
|
2274
|
-
bridgeClientRef.current?.sendCommand("queryGeometry", {});
|
|
2275
|
-
};
|
|
2276
|
-
const scheduleGeometryRequest = () => {
|
|
2277
|
-
if (geometryTimer != null) {
|
|
2278
|
-
window.clearTimeout(geometryTimer);
|
|
2279
|
-
}
|
|
2280
|
-
if (trailingGeometryTimer != null) {
|
|
2281
|
-
window.clearTimeout(trailingGeometryTimer);
|
|
2282
|
-
}
|
|
2283
|
-
geometryTimer = window.setTimeout(requestGeometry, 50);
|
|
2284
|
-
trailingGeometryTimer = window.setTimeout(() => {
|
|
2285
|
-
trailingGeometryTimer = null;
|
|
2286
|
-
requestGeometry();
|
|
2287
|
-
}, ZOOM_TRANSITION_MS + 75);
|
|
2288
|
-
};
|
|
2289
|
-
const resizeObserver = new ResizeObserver(scheduleGeometryRequest);
|
|
2290
|
-
resizeObserver.observe(iframe);
|
|
2291
|
-
return () => {
|
|
2292
|
-
resizeObserver.disconnect();
|
|
2293
|
-
if (geometryTimer != null) {
|
|
2294
|
-
window.clearTimeout(geometryTimer);
|
|
2295
|
-
}
|
|
2296
|
-
if (trailingGeometryTimer != null) {
|
|
2297
|
-
window.clearTimeout(trailingGeometryTimer);
|
|
2298
|
-
}
|
|
2299
|
-
};
|
|
2300
|
-
}, [iframeElement]);
|
|
2301
|
-
useEffect(() => {
|
|
2302
|
-
bridgeClientRef.current?.sendCommand("setSelection", {
|
|
2303
|
-
componentIds: editContext.selection,
|
|
2304
|
-
});
|
|
1165
|
+
iframeRef.current?.contentWindow?.postMessage({ type: "componentsSelected", componentIds: editContext.selection }, window.location.origin);
|
|
2305
1166
|
}, [editContext.selection]);
|
|
1167
|
+
const updateScrollPosition = (e) => {
|
|
1168
|
+
setScroll(e);
|
|
1169
|
+
if (!compareView)
|
|
1170
|
+
pageViewContextRef.current?.setScroll(e);
|
|
1171
|
+
};
|
|
2306
1172
|
useEffect(() => {
|
|
2307
|
-
|
|
2308
|
-
bridge?.sendCommand("setPreviewMode", {
|
|
2309
|
-
enabled: editContext.mode === "preview",
|
|
2310
|
-
});
|
|
2311
|
-
bridge?.sendCommand("setEditorMode", {
|
|
2312
|
-
mode: editContext.mode,
|
|
2313
|
-
suggestionsCursorActive: editContext.mode === "suggestions" || editContext.showSuggestedEdits,
|
|
2314
|
-
});
|
|
2315
|
-
}, [editContext.mode, editContext.showSuggestedEdits]);
|
|
2316
|
-
useEffect(() => {
|
|
2317
|
-
const previousMode = previousBridgeInlineEditModeRef.current;
|
|
2318
|
-
previousBridgeInlineEditModeRef.current = editContext.mode;
|
|
2319
|
-
if (previousMode === editContext.mode ||
|
|
2320
|
-
editContext.mode !== "suggestions") {
|
|
1173
|
+
if (!iframeRef.current)
|
|
2321
1174
|
return;
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
if (!interaction)
|
|
1175
|
+
const body = iframeRef.current.contentWindow?.document.documentElement;
|
|
1176
|
+
if (!body)
|
|
2325
1177
|
return;
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
editContext.modeTransitionRevision,
|
|
2331
|
-
editContextRef,
|
|
2332
|
-
]);
|
|
2333
|
-
useEffect(() => {
|
|
2334
|
-
bridgeClientRef.current?.sendCommand("setLayoutKind", {
|
|
2335
|
-
layoutKind: editContext.layoutMode,
|
|
2336
|
-
});
|
|
2337
|
-
}, [editContext.layoutMode]);
|
|
2338
|
-
useEffect(() => {
|
|
2339
|
-
applyIframeZoom(iframeRef.current, zoom, "PageViewerFrame.tsx:zoom-doc");
|
|
2340
|
-
bridgeClientRef.current?.sendCommand("setZoom", { zoom });
|
|
2341
|
-
const geometryTimer = window.setTimeout(() => {
|
|
2342
|
-
bridgeClientRef.current?.sendCommand("queryGeometry", {});
|
|
2343
|
-
}, ZOOM_TRANSITION_MS + 75);
|
|
2344
|
-
return () => {
|
|
2345
|
-
window.clearTimeout(geometryTimer);
|
|
2346
|
-
};
|
|
2347
|
-
}, [zoom]);
|
|
2348
|
-
useEffect(() => {
|
|
2349
|
-
let geometryTimer = null;
|
|
2350
|
-
const sendViewportStateToBridge = (event) => {
|
|
2351
|
-
const detail = event.detail;
|
|
2352
|
-
const nextZoom = detail?.zoom ?? pageViewContextRef.current?.zoom ?? zoom;
|
|
2353
|
-
bridgeClientRef.current?.sendCommand("setZoom", {
|
|
2354
|
-
zoom: nextZoom,
|
|
2355
|
-
});
|
|
2356
|
-
if (geometryTimer != null) {
|
|
2357
|
-
window.clearTimeout(geometryTimer);
|
|
2358
|
-
}
|
|
2359
|
-
geometryTimer = window.setTimeout(() => {
|
|
2360
|
-
geometryTimer = null;
|
|
2361
|
-
bridgeClientRef.current?.sendCommand("queryGeometry", {});
|
|
2362
|
-
}, ZOOM_TRANSITION_MS + 75);
|
|
2363
|
-
};
|
|
2364
|
-
window.addEventListener(DEVICE_CHANGE_EVENT, sendViewportStateToBridge);
|
|
2365
|
-
return () => {
|
|
2366
|
-
if (geometryTimer != null) {
|
|
2367
|
-
window.clearTimeout(geometryTimer);
|
|
2368
|
-
}
|
|
2369
|
-
window.removeEventListener(DEVICE_CHANGE_EVENT, sendViewportStateToBridge);
|
|
2370
|
-
};
|
|
1178
|
+
body.style.transform = `scale(${zoom})`;
|
|
1179
|
+
body.style.transformOrigin = "top center";
|
|
1180
|
+
body.style.overflow = "auto";
|
|
1181
|
+
//body.style.height = `${body.scrollHeight / zoom}px`;
|
|
2371
1182
|
}, [zoom]);
|
|
1183
|
+
const scrollHandler = useThrottledCallback(updateScrollPosition, 100);
|
|
2372
1184
|
if (pageViewContext.page?.item && !pageViewContext.page?.item.hasLayout) {
|
|
2373
1185
|
return _jsx(NoLayout, {});
|
|
2374
1186
|
}
|
|
2375
|
-
const isResponsiveDevice = pageViewContext.device === "desktop" ||
|
|
2376
|
-
pageViewContext.device === "Responsive";
|
|
2377
1187
|
const deviceHeight = pageViewContext.device === "desktop" || !pageViewContext.deviceHeight
|
|
2378
1188
|
? "100%"
|
|
2379
1189
|
: pageViewContext.deviceHeight || 640;
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
if (pageViewContext.bridgeInteraction?.kind === "hover") {
|
|
2392
|
-
pageViewContext.setBridgeInteraction(undefined);
|
|
2393
|
-
}
|
|
2394
|
-
}, children: [_jsx("iframe", { ref: bindIframeRef, className: "page-iframe h-full w-full bg-white transition-[height] duration-300 ease-in-out motion-reduce:transition-none", style: {
|
|
2395
|
-
height: deviceHeight,
|
|
2396
|
-
cursor: editContext.mode === "suggestions" ||
|
|
2397
|
-
editContext.showSuggestedEdits
|
|
2398
|
-
? SUGGESTIONS_CURSOR_VALUE
|
|
2399
|
-
: undefined,
|
|
2400
|
-
}, src: iframeSrc, "data-testid": "pageEditoriframe", onLoad: () => {
|
|
2401
|
-
const loadedSrc = iframeRef.current?.src;
|
|
2402
|
-
if (loadedSrc) {
|
|
2403
|
-
setLoadedIframeSrc(loadedSrc);
|
|
2404
|
-
}
|
|
2405
|
-
const sendZoomToBridge = () => {
|
|
2406
|
-
bridgeClientRef.current?.sendCommand("setZoom", {
|
|
2407
|
-
zoom: pageViewContextRef.current?.zoom ?? zoom,
|
|
2408
|
-
});
|
|
2409
|
-
};
|
|
2410
|
-
sendZoomToBridge();
|
|
2411
|
-
window.setTimeout(sendZoomToBridge, 100);
|
|
2412
|
-
window.setTimeout(sendZoomToBridge, 500);
|
|
2413
|
-
if (iframeSrc) {
|
|
1190
|
+
return (_jsxs("div", { className: cn("relative flex h-full w-full flex-col items-center select-none", className, editContext.showAgentsPanel && !editContext.currentWizardId && "pr-0"), children: [!pageViewContext.fullscreen && (_jsx(EditorWarnings, { item: pageViewContext.page?.item })), slotCloseButton && (_jsx("div", { className: "absolute top-3 right-3 z-50", children: slotCloseButton })), pageViewContext.device !== "desktop" && (_jsx(DeviceToolbar, { pageViewContext: pageViewContext, configuration: editContext.configuration })), _jsxs("div", { className: "relative flex flex-1 select-none", "data-testid": "page-viewer-viewport", style: {
|
|
1191
|
+
width: pageViewContext.device === "desktop" ||
|
|
1192
|
+
pageViewContext.device === "Responsive"
|
|
1193
|
+
? "100%"
|
|
1194
|
+
: (pageViewContext.deviceWidth || 640) +
|
|
1195
|
+
editContext.configuration.outline.width +
|
|
1196
|
+
"px",
|
|
1197
|
+
}, children: [_jsxs("div", { className: "relative h-full w-full overflow-hidden", children: [_jsx("iframe", { ref: iframeRef, className: "page-iframe h-full w-full bg-white", style: { height: deviceHeight }, src: iframeSrc, "data-testid": "pageEditoriframe", onLoad: () => {
|
|
1198
|
+
// Handle iframe load when using src attribute (initial load)
|
|
1199
|
+
const doc = iframeRef.current?.contentDocument;
|
|
1200
|
+
if (doc && iframeSrc) {
|
|
2414
1201
|
setShowSpinner(false);
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
const observedScroll = getIframeWindowScroll(iframeRef.current) ?? { x: 0, y: 0 };
|
|
2421
|
-
bridgeClientRef.current?.sendCommand("scrollBy", {
|
|
2422
|
-
x: targetScroll.x - observedScroll.x,
|
|
2423
|
-
y: targetScroll.y - observedScroll.y,
|
|
2424
|
-
behavior: "instant",
|
|
2425
|
-
});
|
|
2426
|
-
}
|
|
1202
|
+
ensureEditorCssGuard(doc, editContext.mode !== "preview");
|
|
1203
|
+
setTimeout(() => {
|
|
1204
|
+
injectSXAScripts(iframeRef.current);
|
|
1205
|
+
}, 1000);
|
|
1206
|
+
requestPageModelBuild(doc);
|
|
2427
1207
|
}
|
|
2428
|
-
} }),
|
|
1208
|
+
} }), iframeRef.current && (_jsx(PageEditorChrome, { iframe: iframeRef.current, compareView: compareView, pageViewContext: pageViewContext })), pageViewContext.deviceHeight && pageViewContext.device && (_jsx("div", { className: "bg-gray-4 relative z-40 h-full w-full" }))] }), !pageViewContext.fullscreen &&
|
|
2429
1209
|
showMiniMap &&
|
|
2430
1210
|
editContext.showMinimap &&
|
|
2431
1211
|
!editContext.isMobile &&
|
|
2432
|
-
editContext.parheliaSettings?.showMinimap !== false && (_jsx(MiniMap, { compareView: compareView, scroll: scroll, mainViewIframeRef: iframeRef, pageViewContext: pageViewContext
|
|
1212
|
+
editContext.parheliaSettings?.showMinimap !== false && (_jsx(MiniMap, { compareView: compareView, scroll: scroll, mainViewIframeRef: iframeRef, pageViewContext: pageViewContext, deviceHeight: pageViewContext.device === "Desktop"
|
|
1213
|
+
? undefined
|
|
1214
|
+
: pageViewContext.deviceHeight })), showSpinner && (_jsxs(_Fragment, { children: [_jsx("div", { className: "bg-gray-4/50 absolute top-0 left-0 h-full w-full" }), _jsx("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: _jsx(Spinner, {}) })] }))] }), _jsx(FieldActionsOverlay, { ref: fieldActionsOverlay, generatorButtons: contextMenuFieldButtons, onActionClick: handleActionClick, onParameterizedActionExecute: handleParameterizedActionExecute, currentOverlay: editContext?.currentOverlay, fieldId: contextMenuField?.fieldId || "", setCurrentOverlay: editContext?.setCurrentOverlay || (() => { }), preSelectedAction: preSelectedAction, iframe: iframeRef.current })] }));
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* In preview mode, disable editing in the iframe: set contentEditable=false on all
|
|
1218
|
+
* editable elements and blur the active element so the caret is removed and typing does nothing.
|
|
1219
|
+
*/
|
|
1220
|
+
function disableEditingInIframeDocument(doc) {
|
|
1221
|
+
if (!doc || !doc.body)
|
|
1222
|
+
return;
|
|
1223
|
+
const editable = doc.querySelectorAll("[contenteditable='true'], [contenteditable='']");
|
|
1224
|
+
editable.forEach((el) => {
|
|
1225
|
+
el.contentEditable = "false";
|
|
1226
|
+
});
|
|
1227
|
+
const active = doc.activeElement;
|
|
1228
|
+
if (active?.isContentEditable) {
|
|
1229
|
+
active.blur();
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
function injectEditorCSS(iframeDocument, editMode) {
|
|
1233
|
+
if (!iframeDocument)
|
|
1234
|
+
return;
|
|
1235
|
+
const styleId = EDITOR_CSS_STYLE_ID;
|
|
1236
|
+
// Remove existing style element if present to avoid duplicates
|
|
1237
|
+
const existingStyle = iframeDocument.getElementById(styleId);
|
|
1238
|
+
if (existingStyle) {
|
|
1239
|
+
existingStyle.remove();
|
|
1240
|
+
}
|
|
1241
|
+
const style = iframeDocument.createElement("style");
|
|
1242
|
+
style.id = styleId;
|
|
1243
|
+
style.textContent = editMode
|
|
1244
|
+
? `[contentEditable]:empty:before {
|
|
1245
|
+
content: attr(placeholder);
|
|
1246
|
+
opacity: 0.6;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
.scChromeData, code {
|
|
1250
|
+
display: none;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
[contenteditable] {
|
|
1254
|
+
outline: 0px solid transparent;
|
|
1255
|
+
}
|
|
1256
|
+
`
|
|
1257
|
+
: `
|
|
1258
|
+
[contenteditable] {
|
|
1259
|
+
outline: 0px solid transparent;
|
|
1260
|
+
}
|
|
1261
|
+
.scChromeData, code {
|
|
1262
|
+
display: none;
|
|
1263
|
+
}
|
|
1264
|
+
`;
|
|
1265
|
+
if (iframeDocument && iframeDocument.head) {
|
|
1266
|
+
iframeDocument.head.appendChild(style);
|
|
1267
|
+
}
|
|
1268
|
+
if (!editMode) {
|
|
1269
|
+
disableEditingInIframeDocument(iframeDocument);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
function resolveComponentIdForTarget(rawId, target, page) {
|
|
1273
|
+
const direct = getComponentById(rawId, page);
|
|
1274
|
+
const candidates = getAllComponentInstances(rawId, page);
|
|
1275
|
+
if (candidates.length === 0) {
|
|
1276
|
+
return direct?.id || rawId;
|
|
1277
|
+
}
|
|
1278
|
+
const containing = candidates.filter((component) => isTargetInsideComponent(target, component));
|
|
1279
|
+
if (containing.length === 0) {
|
|
1280
|
+
return direct?.id || candidates[0].id;
|
|
1281
|
+
}
|
|
1282
|
+
// Prefer the deepest/most specific matching component for nested SXA markup.
|
|
1283
|
+
containing.sort((a, b) => getElementDepth(b.firstDOMElement || null) -
|
|
1284
|
+
getElementDepth(a.firstDOMElement || null));
|
|
1285
|
+
return containing[0].id;
|
|
1286
|
+
}
|
|
1287
|
+
function resolveComponentIdForFieldTarget(field, target, page) {
|
|
1288
|
+
const matches = findComponentsRenderingField(field, page);
|
|
1289
|
+
const containingMatches = matches.filter((component) => isTargetInsideComponent(target, component));
|
|
1290
|
+
const rankedMatches = (containingMatches.length > 0
|
|
1291
|
+
? containingMatches
|
|
1292
|
+
: matches).sort((a, b) => getElementDepth(b.firstDOMElement || null) -
|
|
1293
|
+
getElementDepth(a.firstDOMElement || null));
|
|
1294
|
+
return rankedMatches[0]?.id;
|
|
1295
|
+
}
|
|
1296
|
+
function findComponentsRenderingField(field, page) {
|
|
1297
|
+
if (!page?.rootComponent)
|
|
1298
|
+
return [];
|
|
1299
|
+
const matches = [];
|
|
1300
|
+
const visit = (component) => {
|
|
1301
|
+
if (componentRendersField(component, field)) {
|
|
1302
|
+
matches.push(component);
|
|
1303
|
+
}
|
|
1304
|
+
for (const placeholder of component.placeholders || []) {
|
|
1305
|
+
for (const child of placeholder.components || []) {
|
|
1306
|
+
visit(child);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
visit(page.rootComponent);
|
|
1311
|
+
return matches;
|
|
1312
|
+
}
|
|
1313
|
+
function componentRendersField(component, field) {
|
|
1314
|
+
const renderedItems = [
|
|
1315
|
+
component.datasourceItem,
|
|
1316
|
+
...component.items.filter((item) => !component.datasourceItem ||
|
|
1317
|
+
!(item.id === component.datasourceItem.id &&
|
|
1318
|
+
item.language === component.datasourceItem.language &&
|
|
1319
|
+
item.version === component.datasourceItem.version)),
|
|
1320
|
+
].filter(Boolean);
|
|
1321
|
+
return renderedItems.some((item) => item.id === field.item.id &&
|
|
1322
|
+
item.language === field.item.language &&
|
|
1323
|
+
item.version === field.item.version &&
|
|
1324
|
+
item.renderedFieldIds.includes(field.fieldId));
|
|
1325
|
+
}
|
|
1326
|
+
function isTargetInsideComponent(target, component) {
|
|
1327
|
+
const start = component.firstDOMElement;
|
|
1328
|
+
const end = component.lastDOMElement || component.firstDOMElement;
|
|
1329
|
+
if (!start || !end)
|
|
1330
|
+
return false;
|
|
1331
|
+
if (start.contains(target) || end.contains(target))
|
|
1332
|
+
return true;
|
|
1333
|
+
const startPos = start.compareDocumentPosition(target);
|
|
1334
|
+
const endPos = end.compareDocumentPosition(target);
|
|
1335
|
+
const isAfterStart = !!(startPos & Node.DOCUMENT_POSITION_FOLLOWING) ||
|
|
1336
|
+
!!(startPos & Node.DOCUMENT_POSITION_CONTAINED_BY);
|
|
1337
|
+
const isBeforeEnd = !!(endPos & Node.DOCUMENT_POSITION_PRECEDING) ||
|
|
1338
|
+
!!(endPos & Node.DOCUMENT_POSITION_CONTAINED_BY);
|
|
1339
|
+
return isAfterStart && isBeforeEnd;
|
|
1340
|
+
}
|
|
1341
|
+
function getElementDepth(element) {
|
|
1342
|
+
let depth = 0;
|
|
1343
|
+
let current = element;
|
|
1344
|
+
while (current) {
|
|
1345
|
+
depth++;
|
|
1346
|
+
current = current.parentElement;
|
|
1347
|
+
}
|
|
1348
|
+
return depth;
|
|
1349
|
+
}
|
|
1350
|
+
function injectSXAScripts(iframe) {
|
|
1351
|
+
if (!iframe)
|
|
1352
|
+
return;
|
|
1353
|
+
const iframeDocument = iframe.contentDocument;
|
|
1354
|
+
const iframeWindow = iframe.contentWindow;
|
|
1355
|
+
if (!iframeDocument || !iframeWindow)
|
|
1356
|
+
return;
|
|
1357
|
+
iframeWindow.Sitecore = {
|
|
1358
|
+
PageModes: {
|
|
1359
|
+
HoverFrame: {
|
|
1360
|
+
extend: () => {
|
|
1361
|
+
// console.log("extend hoverframe");
|
|
1362
|
+
},
|
|
1363
|
+
},
|
|
1364
|
+
ChromeManager: {
|
|
1365
|
+
chromes: () => {
|
|
1366
|
+
// console.log("chromes");
|
|
1367
|
+
return [];
|
|
1368
|
+
},
|
|
1369
|
+
resetChromes: () => {
|
|
1370
|
+
// console.log("resetChromes");
|
|
1371
|
+
iframeWindow.XA.init();
|
|
1372
|
+
},
|
|
1373
|
+
chromesReseted: {
|
|
1374
|
+
observe: () => {
|
|
1375
|
+
// console.log("chromesReseted.observe");
|
|
1376
|
+
},
|
|
1377
|
+
},
|
|
1378
|
+
// Dummy selectionChanged with an _callbacks array
|
|
1379
|
+
selectionChanged: {
|
|
1380
|
+
_callbacks: [],
|
|
1381
|
+
// Optionally, you can add a method to trigger all callbacks if needed.
|
|
1382
|
+
trigger: function (...args) {
|
|
1383
|
+
this._callbacks.forEach((callback) => callback(...args));
|
|
1384
|
+
},
|
|
1385
|
+
},
|
|
1386
|
+
},
|
|
1387
|
+
ChromeControls: function () { },
|
|
1388
|
+
ChromeTypes: {
|
|
1389
|
+
PlaceholderSorting: function () { },
|
|
1390
|
+
Rendering: function () { },
|
|
1391
|
+
},
|
|
1392
|
+
},
|
|
1393
|
+
};
|
|
1394
|
+
// Option 1: Use main window's jQuery if available.
|
|
1395
|
+
if (iframeWindow.jQuery) {
|
|
1396
|
+
// Be cautious: if the iframe's document is different, it's better to load jQuery within the iframe.
|
|
1397
|
+
iframeWindow.$sc = iframeWindow.jQuery;
|
|
1398
|
+
}
|
|
1399
|
+
else {
|
|
1400
|
+
// Option 2: Dynamically load jQuery in the iframe.
|
|
1401
|
+
const jqueryScript = iframeDocument.createElement("script");
|
|
1402
|
+
jqueryScript.type = "text/javascript";
|
|
1403
|
+
jqueryScript.src = "https://code.jquery.com/jquery-3.6.0.min.js"; // Use the version you prefer.
|
|
1404
|
+
jqueryScript.integrity =
|
|
1405
|
+
"sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=";
|
|
1406
|
+
jqueryScript.crossOrigin = "anonymous";
|
|
1407
|
+
jqueryScript.onload = () => {
|
|
1408
|
+
// Once loaded, assign it to $sc using noConflict to avoid global collisions.
|
|
1409
|
+
iframeWindow.$sc = iframeWindow.jQuery.noConflict();
|
|
1410
|
+
// console.log("jQuery loaded in iframe and assigned to $sc");
|
|
1411
|
+
};
|
|
1412
|
+
(iframeDocument.head || iframeDocument.body).appendChild(jqueryScript);
|
|
1413
|
+
}
|
|
1414
|
+
// Add a dummy implementation for renderExpandCommand on the ChromeControls prototype.
|
|
1415
|
+
iframeWindow.Sitecore.PageModes.ChromeControls.prototype.renderExpandCommand =
|
|
1416
|
+
function () {
|
|
1417
|
+
console.log("renderExpandCommand called");
|
|
1418
|
+
// Return a dummy value if needed. For example, you might return a dummy HTML string.
|
|
1419
|
+
return "<div>Dummy Expand Command</div>";
|
|
1420
|
+
};
|
|
1421
|
+
iframeWindow.Sitecore.PageModes.ChromeTypes.PlaceholderSorting.prototype.insertSortingHandle =
|
|
1422
|
+
function () {
|
|
1423
|
+
console.log("insertSortingHandle called");
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Calculates the global offset of a given target node and its local offset,
|
|
1428
|
+
* relative to the container's complete text content.
|
|
1429
|
+
*
|
|
1430
|
+
* @param container - The container element that holds the text nodes.
|
|
1431
|
+
* @param targetNode - The text node where the selection starts or ends.
|
|
1432
|
+
* @param localOffset - The offset within the target text node.
|
|
1433
|
+
* @returns The computed global offset.
|
|
1434
|
+
*/
|
|
1435
|
+
function getGlobalTextOffset(container, targetNode, localOffset) {
|
|
1436
|
+
let globalOffset = 0;
|
|
1437
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT, null);
|
|
1438
|
+
while (walker.nextNode()) {
|
|
1439
|
+
const currentNode = walker.currentNode;
|
|
1440
|
+
// If we've reached the target node, add the local offset and return.
|
|
1441
|
+
if (currentNode === targetNode) {
|
|
1442
|
+
return globalOffset + localOffset;
|
|
1443
|
+
}
|
|
1444
|
+
// Otherwise, add the length of this text node.
|
|
1445
|
+
globalOffset += (currentNode.textContent || "").length;
|
|
1446
|
+
}
|
|
1447
|
+
return globalOffset;
|
|
2433
1448
|
}
|
|
2434
1449
|
//# sourceMappingURL=PageViewerFrame.js.map
|