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