@parhelia/core 0.1.12911 → 0.1.12917
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/AgentGalleryCard.js +1 -1
- package/dist/agents-view/AgentGalleryCard.js.map +1 -1
- package/dist/agents-view/AgentGalleryView.d.ts +1 -1
- package/dist/agents-view/AgentGalleryView.js +3 -2
- package/dist/agents-view/AgentGalleryView.js.map +1 -1
- package/dist/agents-view/AgentsView.js +1 -1
- package/dist/agents-view/AgentsView.js.map +1 -1
- package/dist/agents-view/AgentsWorkspaceView.js +15 -2
- package/dist/agents-view/AgentsWorkspaceView.js.map +1 -1
- package/dist/components/MarkdownViewerPopover.d.ts +73 -0
- package/dist/components/MarkdownViewerPopover.js +109 -0
- package/dist/components/MarkdownViewerPopover.js.map +1 -0
- package/dist/components/PageHeader.d.ts +11 -2
- package/dist/components/PageHeader.js +8 -3
- package/dist/components/PageHeader.js.map +1 -1
- package/dist/components/SearchInput.js +1 -1
- package/dist/components/ui/UserPicker.d.ts +5 -1
- package/dist/components/ui/UserPicker.js +17 -3
- package/dist/components/ui/UserPicker.js.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/delete-button.d.ts +1 -1
- package/dist/components/ui/delete-button.js +2 -2
- package/dist/components/ui/delete-button.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js +3 -3
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/select.d.ts +2 -0
- package/dist/components/ui/select.js +8 -6
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/textarea.js +1 -3
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/config/config.js +22 -2
- package/dist/config/config.js.map +1 -1
- package/dist/config/types/workspace.d.ts +6 -2
- package/dist/editor/ConfirmationDialog.d.ts +3 -0
- package/dist/editor/ConfirmationDialog.js +5 -1
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/ContentTree.d.ts +9 -2
- package/dist/editor/ContentTree.js +16 -4
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/ContextMenu.js +6 -2
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/EditorWarning.js +1 -1
- package/dist/editor/EditorWarning.js.map +1 -1
- package/dist/editor/FieldHistory.js +8 -5
- package/dist/editor/FieldHistory.js.map +1 -1
- package/dist/editor/FieldListField.js +4 -3
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/GlobalMenuBar.js +5 -2
- package/dist/editor/GlobalMenuBar.js.map +1 -1
- package/dist/editor/MobileLayout.js +4 -1
- package/dist/editor/MobileLayout.js.map +1 -1
- package/dist/editor/ScrollingContentTree.d.ts +2 -1
- package/dist/editor/ScrollingContentTree.js +2 -2
- package/dist/editor/ScrollingContentTree.js.map +1 -1
- package/dist/editor/Titlebar.d.ts +2 -1
- package/dist/editor/Titlebar.js +4 -9
- package/dist/editor/Titlebar.js.map +1 -1
- package/dist/editor/WorkspaceTitleSwitcher.d.ts +2 -1
- package/dist/editor/WorkspaceTitleSwitcher.js +4 -3
- package/dist/editor/WorkspaceTitleSwitcher.js.map +1 -1
- package/dist/editor/ai/AgentProfileSelector.js +3 -3
- package/dist/editor/ai/AgentProfileSelector.js.map +1 -1
- package/dist/editor/ai/Agents.js +15 -4
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/ContentInspectorPopover.js +2 -1
- package/dist/editor/ai/ContentInspectorPopover.js.map +1 -1
- package/dist/editor/ai/InlineAiTrigger.js +5 -1
- package/dist/editor/ai/InlineAiTrigger.js.map +1 -1
- package/dist/editor/ai/agentActivitySummary.js +17 -9
- package/dist/editor/ai/agentActivitySummary.js.map +1 -1
- package/dist/editor/ai/dialogs/capturePageScreenshot.d.ts +18 -1
- package/dist/editor/ai/dialogs/capturePageScreenshot.js +60 -13
- package/dist/editor/ai/dialogs/capturePageScreenshot.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentDocumentList.js +6 -3
- package/dist/editor/ai/terminal/components/AgentDocumentList.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.d.ts +2 -1
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.js +9 -6
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentModeSelector.js +8 -7
- package/dist/editor/ai/terminal/components/AgentModeSelector.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js +4 -1
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentSummaryPromptActions.d.ts +2 -1
- package/dist/editor/ai/terminal/components/AgentSummaryPromptActions.js +7 -2
- package/dist/editor/ai/terminal/components/AgentSummaryPromptActions.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.d.ts +2 -1
- package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.js +2 -2
- package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.js.map +1 -1
- package/dist/editor/ai/terminal/components/ContextInfoBar.js +35 -8
- package/dist/editor/ai/terminal/components/ContextInfoBar.js.map +1 -1
- package/dist/editor/ai/terminal/components/EditOperationsPanel.js +3 -3
- package/dist/editor/ai/terminal/components/EditOperationsPanel.js.map +1 -1
- package/dist/editor/ai/terminal/components/UserMessage.js +4 -4
- package/dist/editor/ai/terminal/components/UserMessage.js.map +1 -1
- package/dist/editor/ai/terminal/projectTemplateContext.d.ts +11 -0
- package/dist/editor/ai/terminal/projectTemplateContext.js +64 -0
- package/dist/editor/ai/terminal/projectTemplateContext.js.map +1 -0
- package/dist/editor/ai/terminal/useAgentLoadPipeline.js +1 -0
- package/dist/editor/ai/terminal/useAgentLoadPipeline.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentLoader.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentLoader.js +14 -2
- package/dist/editor/ai/terminal/useAgentLoader.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentSettingsData.js +1 -0
- package/dist/editor/ai/terminal/useAgentSettingsData.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.js +19 -1
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentTerminalController.js +4 -1
- package/dist/editor/ai/terminal/useAgentTerminalController.js.map +1 -1
- package/dist/editor/ai/useInlineAiPosition.d.ts +2 -1
- package/dist/editor/ai/useInlineAiPosition.js +10 -3
- package/dist/editor/ai/useInlineAiPosition.js.map +1 -1
- package/dist/editor/bridge/protocol.d.ts +35 -1
- package/dist/editor/bridge/protocol.js +4 -1
- package/dist/editor/bridge/protocol.js.map +1 -1
- package/dist/editor/client/EditorShell.js +47 -33
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +3 -4
- package/dist/editor/client/errorToast.d.ts +12 -0
- package/dist/editor/client/errorToast.js +67 -0
- package/dist/editor/client/errorToast.js.map +1 -0
- package/dist/editor/client/helpers.d.ts +2 -4
- package/dist/editor/client/helpers.js +3 -2
- package/dist/editor/client/helpers.js.map +1 -1
- package/dist/editor/client/hooks/useSocketMessageHandler.js +5 -3
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
- package/dist/editor/client/operations.d.ts +2 -4
- package/dist/editor/client/operations.js +11 -2
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/client/pageModelBuilder.d.ts +1 -0
- package/dist/editor/client/pageModelBuilder.js +9 -2
- package/dist/editor/client/pageModelBuilder.js.map +1 -1
- package/dist/editor/client/ui/FullscreenControls.d.ts +0 -1
- package/dist/editor/client/ui/FullscreenControls.js +4 -17
- package/dist/editor/client/ui/FullscreenControls.js.map +1 -1
- package/dist/editor/commands/componentCommands.d.ts +1 -0
- package/dist/editor/commands/componentCommands.js +139 -2
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/content-tree/TreeSettingsMenu.js +1 -1
- package/dist/editor/content-tree/TreeSettingsMenu.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/useTextCompletion.js +12 -43
- package/dist/editor/field-types/useTextCompletion.js.map +1 -1
- package/dist/editor/fieldTypeConfiguration.d.ts +2 -0
- package/dist/editor/fieldTypeConfiguration.js +7 -0
- package/dist/editor/fieldTypeConfiguration.js.map +1 -0
- package/dist/editor/menubar/PageSelector.js +8 -1
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.d.ts +7 -1
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js +22 -14
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js.map +1 -1
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js +7 -1
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.js +53 -19
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js +11 -3
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/InsertComponentMenu.js +1 -1
- package/dist/editor/page-editor-chrome/InsertComponentMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +4 -3
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/bridgeInlineFormatToolbarLayout.d.ts +2 -1
- package/dist/editor/page-editor-chrome/bridgeInlineFormatToolbarLayout.js +2 -0
- package/dist/editor/page-editor-chrome/bridgeInlineFormatToolbarLayout.js.map +1 -1
- package/dist/editor/page-editor-chrome/insertTargetLabel.d.ts +1 -0
- package/dist/editor/page-editor-chrome/insertTargetLabel.js +14 -1
- package/dist/editor/page-editor-chrome/insertTargetLabel.js.map +1 -1
- package/dist/editor/page-editor-chrome/overlay/placeholderZones.js +13 -3
- package/dist/editor/page-editor-chrome/overlay/placeholderZones.js.map +1 -1
- package/dist/editor/page-editor-chrome/useComponentDragHandle.js +11 -5
- package/dist/editor/page-editor-chrome/useComponentDragHandle.js.map +1 -1
- package/dist/editor/page-viewer/PageViewer.js +5 -4
- package/dist/editor/page-viewer/PageViewer.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +342 -5
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/RenderingParametersSection.js +1 -1
- package/dist/editor/page-viewer/RenderingParametersSection.js.map +1 -1
- package/dist/editor/page-viewer/bridgeFieldPatch.d.ts +3 -1
- package/dist/editor/page-viewer/bridgeFieldPatch.js +26 -2
- package/dist/editor/page-viewer/bridgeFieldPatch.js.map +1 -1
- package/dist/editor/page-viewer/pageViewContext.d.ts +4 -1
- package/dist/editor/page-viewer/pageViewContext.js +4 -1
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -1
- package/dist/editor/page-viewer/parentBridgeInjection.d.ts +23 -0
- package/dist/editor/page-viewer/parentBridgeInjection.js +251 -0
- package/dist/editor/page-viewer/parentBridgeInjection.js.map +1 -0
- package/dist/editor/page-viewer/renderUrl.js +4 -2
- package/dist/editor/page-viewer/renderUrl.js.map +1 -1
- package/dist/editor/pageModel.d.ts +1 -0
- package/dist/editor/reviews/DecisionsMatrix.js +1 -1
- package/dist/editor/reviews/DecisionsMatrix.js.map +1 -1
- package/dist/editor/reviews/MultiReviewManager.js +3 -22
- package/dist/editor/reviews/MultiReviewManager.js.map +1 -1
- package/dist/editor/reviews/openCommentsFeedback.js +2 -0
- package/dist/editor/reviews/openCommentsFeedback.js.map +1 -1
- package/dist/editor/services/agentService.js +6 -2
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +15 -0
- package/dist/editor/services/editService.js +3 -0
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/services/textCompletionService.d.ts +14 -0
- package/dist/editor/services/textCompletionService.js +45 -0
- package/dist/editor/services/textCompletionService.js.map +1 -0
- package/dist/editor/settings/About.js +40 -263
- package/dist/editor/settings/About.js.map +1 -1
- package/dist/editor/settings/SettingsBreadcrumb.js +8 -1
- package/dist/editor/settings/SettingsBreadcrumb.js.map +1 -1
- package/dist/editor/settings/SettingsHeaderActionsContext.d.ts +4 -0
- package/dist/editor/settings/SettingsHeaderActionsContext.js.map +1 -1
- package/dist/editor/settings/SettingsTitlebar.d.ts +1 -0
- package/dist/editor/settings/SettingsTitlebar.js +18 -0
- package/dist/editor/settings/SettingsTitlebar.js.map +1 -0
- package/dist/editor/settings/SettingsView.js +64 -18
- package/dist/editor/settings/SettingsView.js.map +1 -1
- package/dist/editor/settings/panels/AgentToolsPanel.js +3 -7
- package/dist/editor/settings/panels/AgentToolsPanel.js.map +1 -1
- package/dist/editor/settings/panels/AgentsPanel.js +2 -3
- package/dist/editor/settings/panels/AgentsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ClusterInstancesPanel.js +2 -3
- package/dist/editor/settings/panels/ClusterInstancesPanel.js.map +1 -1
- package/dist/editor/settings/panels/FieldTypeSerializersPanel.js +2 -4
- package/dist/editor/settings/panels/FieldTypeSerializersPanel.js.map +1 -1
- package/dist/editor/settings/panels/JavaScriptToolsPanel.js +2 -3
- package/dist/editor/settings/panels/JavaScriptToolsPanel.js.map +1 -1
- package/dist/editor/settings/panels/McpToolsPanel.js +3 -4
- package/dist/editor/settings/panels/McpToolsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ModelsPanel.js +4 -3
- package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplateAgentPanel.d.ts +8 -1
- package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js +75 -9
- package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplateSelectorList.js +1 -1
- package/dist/editor/settings/panels/ProjectTemplateSelectorList.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplatesPanel.js +516 -52
- package/dist/editor/settings/panels/ProjectTemplatesPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.js +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
- package/dist/editor/settings/settingsNavigationStore.d.ts +12 -0
- package/dist/editor/settings/settingsNavigationStore.js +32 -0
- package/dist/editor/settings/settingsNavigationStore.js.map +1 -0
- package/dist/editor/setup-wizard/steps/LicenseActivationStep.d.ts +3 -1
- package/dist/editor/setup-wizard/steps/LicenseActivationStep.js +9 -5
- 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 +6 -3
- package/dist/editor/setup-wizard/steps/LicenseEmailStep.js.map +1 -1
- package/dist/editor/setup-wizard/steps/ProviderStep.js +6 -2
- package/dist/editor/setup-wizard/steps/ProviderStep.js.map +1 -1
- package/dist/editor/sidebar/ComponentPalette.js +10 -4
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +12 -12
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/ContentTreePanel.js +1 -1
- package/dist/editor/sidebar/ContentTreePanel.js.map +1 -1
- package/dist/editor/sidebar/SidebarPanel.js +1 -1
- package/dist/editor/sidebar/SidebarPanel.js.map +1 -1
- package/dist/editor/sidebar/WorkspaceRailMobile.d.ts +0 -1
- package/dist/editor/sidebar/WorkspaceRailMobile.js +4 -16
- package/dist/editor/sidebar/WorkspaceRailMobile.js.map +1 -1
- package/dist/editor/ui/ComponentThumbnailDialog.d.ts +14 -0
- package/dist/editor/ui/ComponentThumbnailDialog.js +75 -0
- package/dist/editor/ui/ComponentThumbnailDialog.js.map +1 -0
- package/dist/editor/ui/ItemCollectionEditor.d.ts +6 -2
- package/dist/editor/ui/ItemCollectionEditor.js +163 -84
- package/dist/editor/ui/ItemCollectionEditor.js.map +1 -1
- package/dist/editor/ui/PerfectTree.d.ts +5 -1
- package/dist/editor/ui/PerfectTree.js +10 -6
- package/dist/editor/ui/PerfectTree.js.map +1 -1
- package/dist/editor/ui/PublishRestrictionsDialog.js +77 -9
- package/dist/editor/ui/PublishRestrictionsDialog.js.map +1 -1
- package/dist/editor/ui/SimpleIconButton.js +1 -1
- package/dist/editor/ui/Splitter.d.ts +3 -0
- package/dist/editor/ui/Splitter.js +30 -16
- package/dist/editor/ui/Splitter.js.map +1 -1
- package/dist/editor/ui/TreeListSelector.d.ts +6 -2
- package/dist/editor/ui/TreeListSelector.js +2 -2
- package/dist/editor/ui/TreeListSelector.js.map +1 -1
- package/dist/editor/utils/itemutils.js +2 -0
- package/dist/editor/utils/itemutils.js.map +1 -1
- package/dist/editor/views/ItemEditorPane.js +1 -1
- package/dist/editor/views/ItemEditorPane.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/task-board/TaskBoardWorkspace.js +73 -5
- package/dist/task-board/TaskBoardWorkspace.js.map +1 -1
- package/dist/task-board/components/CreateProjectDialog.d.ts +0 -1
- package/dist/task-board/components/CreateProjectDialog.js +1 -4
- package/dist/task-board/components/CreateProjectDialog.js.map +1 -1
- package/dist/task-board/components/GoalDialog.d.ts +9 -0
- package/dist/task-board/components/GoalDialog.js +149 -0
- package/dist/task-board/components/GoalDialog.js.map +1 -0
- package/dist/task-board/components/ProjectDashboard.d.ts +10 -0
- package/dist/task-board/components/ProjectDashboard.js +5 -4
- package/dist/task-board/components/ProjectDashboard.js.map +1 -1
- package/dist/task-board/components/ProjectGoalsPanel.d.ts +16 -0
- package/dist/task-board/components/ProjectGoalsPanel.js +310 -0
- package/dist/task-board/components/ProjectGoalsPanel.js.map +1 -0
- package/dist/task-board/components/ProjectPropertiesPanel.js +6 -4
- package/dist/task-board/components/ProjectPropertiesPanel.js.map +1 -1
- package/dist/task-board/components/TaskAssigneeBadge.d.ts +1 -1
- package/dist/task-board/components/TaskAssigneeBadge.js +1 -1
- package/dist/task-board/components/TaskAssigneeBadge.js.map +1 -1
- package/dist/task-board/components/TaskAssigneePicker.js +1 -1
- package/dist/task-board/components/TaskAssigneePicker.js.map +1 -1
- package/dist/task-board/components/TaskAttachmentDropZone.d.ts +1 -0
- package/dist/task-board/components/TaskAttachmentDropZone.js +5 -3
- package/dist/task-board/components/TaskAttachmentDropZone.js.map +1 -1
- package/dist/task-board/components/TaskAttachmentsSection.js +8 -1
- package/dist/task-board/components/TaskAttachmentsSection.js.map +1 -1
- package/dist/task-board/components/TaskRow.js +1 -1
- package/dist/task-board/components/TaskRow.js.map +1 -1
- package/dist/task-board/components/WizardCommunicationCenter.js +1 -10
- package/dist/task-board/components/WizardCommunicationCenter.js.map +1 -1
- package/dist/task-board/services/goalService.d.ts +65 -0
- package/dist/task-board/services/goalService.js +37 -0
- package/dist/task-board/services/goalService.js.map +1 -0
- package/dist/task-board/types.d.ts +68 -3
- package/dist/task-board/views/DependencyGraphView.js +121 -31
- package/dist/task-board/views/DependencyGraphView.js.map +1 -1
- package/package.json +2 -2
- package/dist/editor/sidebar/MobileWorkspacePopover.d.ts +0 -16
- package/dist/editor/sidebar/MobileWorkspacePopover.js +0 -35
- package/dist/editor/sidebar/MobileWorkspacePopover.js.map +0 -1
|
@@ -27,8 +27,10 @@ import { FullscreenControls } from "../client/ui/FullscreenControls";
|
|
|
27
27
|
import { toSitecoreDate } from "../utils/sitecoreDate";
|
|
28
28
|
import { BridgeClient } from "../bridge/BridgeClient";
|
|
29
29
|
import { getSuggestionDisplayValue } from "../reviews/suggestionDisplayValue";
|
|
30
|
-
import { buildBridgeFieldPatchPayload, getBridgeFieldPatchValue, } from "./bridgeFieldPatch";
|
|
30
|
+
import { buildBridgeFieldPatchPayload, getBridgeFieldPatchValue, isBridgePatchableTextField, } from "./bridgeFieldPatch";
|
|
31
31
|
import { createKeyboardEventFromBridgeInteraction } from "./bridgeKeyboardShortcuts";
|
|
32
|
+
import { formatParentBridgeInjectionDiagnostic, injectParheliaBridgeFromParent, } from "./parentBridgeInjection";
|
|
33
|
+
import { getTextCompletion, normalizeTextCompletion, } from "../services/textCompletionService";
|
|
32
34
|
const ZOOM_MIN = 0.25;
|
|
33
35
|
const ZOOM_MAX = 2;
|
|
34
36
|
const ZOOM_STEP = 0.25;
|
|
@@ -511,6 +513,29 @@ function isBridgeInlineAiShortcut(interaction) {
|
|
|
511
513
|
keyboardInteraction.code === "Period" ||
|
|
512
514
|
keyboardInteraction.code === "NumpadDecimal"));
|
|
513
515
|
}
|
|
516
|
+
function isBridgeTextCompletionRequestShortcut(interaction) {
|
|
517
|
+
const key = interaction.key?.toLowerCase();
|
|
518
|
+
return !!((interaction.ctrlKey || interaction.metaKey) &&
|
|
519
|
+
!interaction.shiftKey &&
|
|
520
|
+
!interaction.altKey &&
|
|
521
|
+
(interaction.code === "Space" ||
|
|
522
|
+
interaction.key === " " ||
|
|
523
|
+
key === "spacebar"));
|
|
524
|
+
}
|
|
525
|
+
function isBridgeTextCompletionApplyShortcut(interaction) {
|
|
526
|
+
return !!(!interaction.ctrlKey &&
|
|
527
|
+
!interaction.metaKey &&
|
|
528
|
+
!interaction.shiftKey &&
|
|
529
|
+
!interaction.altKey &&
|
|
530
|
+
(interaction.key === "Tab" || interaction.code === "Tab"));
|
|
531
|
+
}
|
|
532
|
+
function isBridgeTextCompletionDismissShortcut(interaction) {
|
|
533
|
+
return !!(!interaction.ctrlKey &&
|
|
534
|
+
!interaction.metaKey &&
|
|
535
|
+
(interaction.key === "Escape" ||
|
|
536
|
+
interaction.key === "Esc" ||
|
|
537
|
+
interaction.code === "Escape"));
|
|
538
|
+
}
|
|
514
539
|
function isBridgeLinkShortcut(interaction) {
|
|
515
540
|
const keyboardInteraction = interaction;
|
|
516
541
|
return !!((keyboardInteraction.ctrlKey || keyboardInteraction.metaKey) &&
|
|
@@ -526,6 +551,33 @@ function isBridgeLinkShortcutRange(range, interaction) {
|
|
|
526
551
|
((interaction.elementKey && range.elementKey === interaction.elementKey) ||
|
|
527
552
|
bridgeIdsMatch(range.fieldId, interaction.fieldId)));
|
|
528
553
|
}
|
|
554
|
+
function bridgeSelectionMatchesInteraction(selection, interaction) {
|
|
555
|
+
return !!(selection?.activeField &&
|
|
556
|
+
((interaction.elementKey &&
|
|
557
|
+
selection.activeField.elementKey === interaction.elementKey) ||
|
|
558
|
+
bridgeIdsMatch(selection.activeField.fieldId, interaction.fieldId)));
|
|
559
|
+
}
|
|
560
|
+
function getBridgeSelectionMetadataString(selection, key) {
|
|
561
|
+
const value = selection?.metadata?.[key];
|
|
562
|
+
return typeof value === "string" ? value : undefined;
|
|
563
|
+
}
|
|
564
|
+
function clampTextOffset(value, length) {
|
|
565
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
566
|
+
return length;
|
|
567
|
+
}
|
|
568
|
+
return Math.min(length, Math.max(0, value));
|
|
569
|
+
}
|
|
570
|
+
function getPlainTextFromBridgeValue(value) {
|
|
571
|
+
if (!/[<&]/.test(value))
|
|
572
|
+
return value;
|
|
573
|
+
try {
|
|
574
|
+
const parser = new DOMParser();
|
|
575
|
+
return parser.parseFromString(value, "text/html").body.textContent ?? "";
|
|
576
|
+
}
|
|
577
|
+
catch {
|
|
578
|
+
return value.replace(/<[^>]*>/g, "");
|
|
579
|
+
}
|
|
580
|
+
}
|
|
529
581
|
export function PageViewerFrame(props) {
|
|
530
582
|
const editContext = useEditContext();
|
|
531
583
|
useViewportChangeSignal();
|
|
@@ -546,9 +598,20 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
546
598
|
const iframeRef = useRef(null);
|
|
547
599
|
const [iframeElement, setIframeElement] = useState(null);
|
|
548
600
|
const bridgeClientRef = useRef(null);
|
|
601
|
+
const parentBridgeInjectionRef = useRef(null);
|
|
602
|
+
const latestParentBridgeInjectionRef = useRef(null);
|
|
603
|
+
useEffect(() => {
|
|
604
|
+
return () => {
|
|
605
|
+
parentBridgeInjectionRef.current?.dispose();
|
|
606
|
+
parentBridgeInjectionRef.current = null;
|
|
607
|
+
};
|
|
608
|
+
}, []);
|
|
549
609
|
const bridgePatchSignatureRef = useRef(new Map());
|
|
550
610
|
const bridgeTextRangeSourcesRef = useRef(new Map());
|
|
551
611
|
const activeBridgeInlineEditRef = useRef(null);
|
|
612
|
+
const bridgeTextCompletionRef = useRef(null);
|
|
613
|
+
const bridgeTextCompletionAbortRef = useRef(null);
|
|
614
|
+
const bridgeTextCompletionRequestIdRef = useRef(0);
|
|
552
615
|
const previousBridgeInlineEditModeRef = useRef(editContext.mode);
|
|
553
616
|
const latestBridgeScrollRef = useRef(undefined);
|
|
554
617
|
const directOverlayScrollSyncRef = useRef(false);
|
|
@@ -702,6 +765,40 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
702
765
|
return (bridgeClientRef.current?.sendCommand("applyRichTextCommand", payload) ??
|
|
703
766
|
false);
|
|
704
767
|
}, []);
|
|
768
|
+
const sendTextCompletionCommand = useCallback((payload) => {
|
|
769
|
+
return (bridgeClientRef.current?.sendCommand("textCompletion", payload) ?? false);
|
|
770
|
+
}, []);
|
|
771
|
+
const clearBridgeTextCompletion = useCallback(() => {
|
|
772
|
+
bridgeTextCompletionRequestIdRef.current += 1;
|
|
773
|
+
bridgeTextCompletionAbortRef.current?.abort();
|
|
774
|
+
bridgeTextCompletionAbortRef.current = null;
|
|
775
|
+
const current = bridgeTextCompletionRef.current;
|
|
776
|
+
bridgeTextCompletionRef.current = null;
|
|
777
|
+
if (!current)
|
|
778
|
+
return false;
|
|
779
|
+
return sendTextCompletionCommand({
|
|
780
|
+
...current,
|
|
781
|
+
action: "clear",
|
|
782
|
+
});
|
|
783
|
+
}, [sendTextCompletionCommand]);
|
|
784
|
+
const applyBridgeTextCompletion = useCallback(() => {
|
|
785
|
+
bridgeTextCompletionRequestIdRef.current += 1;
|
|
786
|
+
bridgeTextCompletionAbortRef.current?.abort();
|
|
787
|
+
bridgeTextCompletionAbortRef.current = null;
|
|
788
|
+
const current = bridgeTextCompletionRef.current;
|
|
789
|
+
bridgeTextCompletionRef.current = null;
|
|
790
|
+
if (!current)
|
|
791
|
+
return false;
|
|
792
|
+
return sendTextCompletionCommand({
|
|
793
|
+
...current,
|
|
794
|
+
action: "apply",
|
|
795
|
+
});
|
|
796
|
+
}, [sendTextCompletionCommand]);
|
|
797
|
+
useEffect(() => {
|
|
798
|
+
return () => {
|
|
799
|
+
bridgeTextCompletionAbortRef.current?.abort();
|
|
800
|
+
};
|
|
801
|
+
}, []);
|
|
705
802
|
const { beginInlineEdit: beginBridgeInlineEdit, clearInlineDedupe: clearBridgeInlineDedupe, endFieldFocus: endBridgeFieldFocus, handleFieldValueChanged: handleBridgeFieldValueChanged, handleInlineEditEnded: handleBridgeInlineEditEnded, } = useBridgeInlineEditing({
|
|
706
803
|
pageViewContextRef,
|
|
707
804
|
activeBridgeInlineEditRef,
|
|
@@ -1055,6 +1152,180 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1055
1152
|
item: fallbackDescriptorItem,
|
|
1056
1153
|
};
|
|
1057
1154
|
}, [editContextRef]);
|
|
1155
|
+
const requestBridgeTextCompletion = useCallback(async (interaction, force = false) => {
|
|
1156
|
+
const editor = editContextRef.current;
|
|
1157
|
+
if (!editor?.enableCompletions || editor.mode === "preview") {
|
|
1158
|
+
clearBridgeTextCompletion();
|
|
1159
|
+
return;
|
|
1160
|
+
}
|
|
1161
|
+
const fieldDescriptor = await resolveBridgeFieldDescriptor(interaction);
|
|
1162
|
+
if (!fieldDescriptor) {
|
|
1163
|
+
clearBridgeTextCompletion();
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
const field = await editor.itemsRepository.getField(fieldDescriptor);
|
|
1167
|
+
if (!field) {
|
|
1168
|
+
clearBridgeTextCompletion();
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
const bridgeSelection = pageViewContextRef.current?.bridgeSelection;
|
|
1172
|
+
const selectionMatches = bridgeSelectionMatchesInteraction(bridgeSelection, interaction);
|
|
1173
|
+
const activeField = selectionMatches
|
|
1174
|
+
? bridgeSelection?.activeField
|
|
1175
|
+
: undefined;
|
|
1176
|
+
const elementKey = interaction.elementKey ?? activeField?.elementKey;
|
|
1177
|
+
const hostFieldId = interaction.fieldId ?? activeField?.fieldId ?? fieldDescriptor.fieldId;
|
|
1178
|
+
const isRichText = !!(activeField?.isRichText || field.type.toLowerCase() === "rich text");
|
|
1179
|
+
if (!elementKey ||
|
|
1180
|
+
!hostFieldId ||
|
|
1181
|
+
!isBridgePatchableTextField(field, isRichText)) {
|
|
1182
|
+
clearBridgeTextCompletion();
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
const selectedText = selectionMatches && typeof bridgeSelection?.text === "string"
|
|
1186
|
+
? bridgeSelection.text
|
|
1187
|
+
: typeof interaction.selectedText === "string"
|
|
1188
|
+
? interaction.selectedText
|
|
1189
|
+
: "";
|
|
1190
|
+
const selectionStartOffset = selectionMatches && typeof bridgeSelection?.startOffset === "number"
|
|
1191
|
+
? bridgeSelection.startOffset
|
|
1192
|
+
: typeof interaction.selectionStartOffset === "number"
|
|
1193
|
+
? interaction.selectionStartOffset
|
|
1194
|
+
: undefined;
|
|
1195
|
+
const selectionEndOffset = selectionMatches && typeof bridgeSelection?.endOffset === "number"
|
|
1196
|
+
? bridgeSelection.endOffset
|
|
1197
|
+
: typeof interaction.selectionEndOffset === "number"
|
|
1198
|
+
? interaction.selectionEndOffset
|
|
1199
|
+
: undefined;
|
|
1200
|
+
const liveSelectionStartOffset = typeof interaction.selectionStartOffset === "number"
|
|
1201
|
+
? interaction.selectionStartOffset
|
|
1202
|
+
: undefined;
|
|
1203
|
+
const liveSelectionEndOffset = typeof interaction.selectionEndOffset === "number"
|
|
1204
|
+
? interaction.selectionEndOffset
|
|
1205
|
+
: undefined;
|
|
1206
|
+
const bridgeSelectionStartOffset = selectionMatches && typeof bridgeSelection?.startOffset === "number"
|
|
1207
|
+
? bridgeSelection?.startOffset
|
|
1208
|
+
: undefined;
|
|
1209
|
+
const bridgeSelectionEndOffset = selectionMatches && typeof bridgeSelection?.endOffset === "number"
|
|
1210
|
+
? bridgeSelection?.endOffset
|
|
1211
|
+
: undefined;
|
|
1212
|
+
const activeInlineEdit = activeBridgeInlineEditRef.current;
|
|
1213
|
+
const activeInlineEditMatches = !!(activeInlineEdit &&
|
|
1214
|
+
activeInlineEdit.elementKey === elementKey &&
|
|
1215
|
+
(bridgeIdsMatch(activeInlineEdit.fieldId, hostFieldId) ||
|
|
1216
|
+
bridgeIdsMatch(activeInlineEdit.fieldId, fieldDescriptor.fieldId)));
|
|
1217
|
+
const rawValue = activeInlineEditMatches && activeInlineEdit.value !== undefined
|
|
1218
|
+
? activeInlineEdit.value
|
|
1219
|
+
: getBridgeFieldPatchValue(field);
|
|
1220
|
+
let completionValue = rawValue;
|
|
1221
|
+
let completionSelectionStart = 0;
|
|
1222
|
+
let completionSelectionEnd = 0;
|
|
1223
|
+
if (isRichText) {
|
|
1224
|
+
const contextBefore = selectionMatches
|
|
1225
|
+
? getBridgeSelectionMetadataString(bridgeSelection, "contextBefore")
|
|
1226
|
+
: undefined;
|
|
1227
|
+
const contextAfter = selectionMatches
|
|
1228
|
+
? getBridgeSelectionMetadataString(bridgeSelection, "contextAfter")
|
|
1229
|
+
: undefined;
|
|
1230
|
+
const hasLiveInteractionOffsets = liveSelectionStartOffset !== undefined &&
|
|
1231
|
+
liveSelectionEndOffset !== undefined;
|
|
1232
|
+
const selectionSnapshotMatchesLiveOffsets = bridgeSelectionStartOffset === undefined ||
|
|
1233
|
+
bridgeSelectionEndOffset === undefined ||
|
|
1234
|
+
!hasLiveInteractionOffsets ||
|
|
1235
|
+
(bridgeSelectionStartOffset === liveSelectionStartOffset &&
|
|
1236
|
+
bridgeSelectionEndOffset === liveSelectionEndOffset);
|
|
1237
|
+
const metadataMatchesLiveOffsets = !selectionSnapshotMatchesLiveOffsets ||
|
|
1238
|
+
((contextBefore?.length ?? 0) === interaction.selectionStartOffset &&
|
|
1239
|
+
(contextBefore?.length ?? 0) + selectedText.length ===
|
|
1240
|
+
interaction.selectionEndOffset);
|
|
1241
|
+
if (metadataMatchesLiveOffsets &&
|
|
1242
|
+
(contextBefore !== undefined || contextAfter !== undefined)) {
|
|
1243
|
+
completionValue = `${contextBefore ?? ""}${selectedText}${contextAfter ?? ""}`;
|
|
1244
|
+
completionSelectionStart = contextBefore?.length ?? 0;
|
|
1245
|
+
completionSelectionEnd =
|
|
1246
|
+
completionSelectionStart + selectedText.length;
|
|
1247
|
+
}
|
|
1248
|
+
else {
|
|
1249
|
+
completionValue = getPlainTextFromBridgeValue(rawValue);
|
|
1250
|
+
completionSelectionStart = clampTextOffset(selectionStartOffset, completionValue.length);
|
|
1251
|
+
completionSelectionEnd = clampTextOffset(selectionEndOffset ?? selectionStartOffset, completionValue.length);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
else {
|
|
1255
|
+
completionSelectionStart = clampTextOffset(selectionStartOffset, completionValue.length);
|
|
1256
|
+
completionSelectionEnd = clampTextOffset(selectionEndOffset ?? selectionStartOffset, completionValue.length);
|
|
1257
|
+
}
|
|
1258
|
+
if (!force &&
|
|
1259
|
+
completionValue.slice(0, completionSelectionStart).trim().length < 3) {
|
|
1260
|
+
clearBridgeTextCompletion();
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
clearBridgeTextCompletion();
|
|
1264
|
+
const requestId = bridgeTextCompletionRequestIdRef.current + 1;
|
|
1265
|
+
bridgeTextCompletionRequestIdRef.current = requestId;
|
|
1266
|
+
const abortController = new AbortController();
|
|
1267
|
+
bridgeTextCompletionAbortRef.current = abortController;
|
|
1268
|
+
try {
|
|
1269
|
+
const completion = normalizeTextCompletion(await getTextCompletion({
|
|
1270
|
+
editContext: editor,
|
|
1271
|
+
field,
|
|
1272
|
+
value: completionValue,
|
|
1273
|
+
selectionStart: completionSelectionStart,
|
|
1274
|
+
selectionEnd: completionSelectionEnd,
|
|
1275
|
+
signal: abortController.signal,
|
|
1276
|
+
}));
|
|
1277
|
+
if (requestId !== bridgeTextCompletionRequestIdRef.current ||
|
|
1278
|
+
abortController.signal.aborted) {
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
bridgeTextCompletionAbortRef.current = null;
|
|
1282
|
+
if (!completion) {
|
|
1283
|
+
bridgeTextCompletionRef.current = null;
|
|
1284
|
+
sendTextCompletionCommand({
|
|
1285
|
+
action: "clear",
|
|
1286
|
+
elementKey,
|
|
1287
|
+
fieldId: hostFieldId,
|
|
1288
|
+
});
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
const commandPayload = {
|
|
1292
|
+
elementKey,
|
|
1293
|
+
fieldId: hostFieldId,
|
|
1294
|
+
completion,
|
|
1295
|
+
selectedText,
|
|
1296
|
+
selectionStartOffset: typeof selectionStartOffset === "number"
|
|
1297
|
+
? selectionStartOffset
|
|
1298
|
+
: completionSelectionStart,
|
|
1299
|
+
selectionEndOffset: typeof selectionEndOffset === "number"
|
|
1300
|
+
? selectionEndOffset
|
|
1301
|
+
: completionSelectionEnd,
|
|
1302
|
+
};
|
|
1303
|
+
bridgeTextCompletionRef.current = commandPayload;
|
|
1304
|
+
sendTextCompletionCommand({
|
|
1305
|
+
...commandPayload,
|
|
1306
|
+
action: "show",
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
catch (error) {
|
|
1310
|
+
if (!abortController.signal.aborted) {
|
|
1311
|
+
console.warn("Failed to get text completion", error);
|
|
1312
|
+
}
|
|
1313
|
+
if (requestId === bridgeTextCompletionRequestIdRef.current) {
|
|
1314
|
+
bridgeTextCompletionAbortRef.current = null;
|
|
1315
|
+
bridgeTextCompletionRef.current = null;
|
|
1316
|
+
sendTextCompletionCommand({
|
|
1317
|
+
action: "clear",
|
|
1318
|
+
elementKey,
|
|
1319
|
+
fieldId: hostFieldId,
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
}, [
|
|
1324
|
+
clearBridgeTextCompletion,
|
|
1325
|
+
editContextRef,
|
|
1326
|
+
resolveBridgeFieldDescriptor,
|
|
1327
|
+
sendTextCompletionCommand,
|
|
1328
|
+
]);
|
|
1058
1329
|
const handleBridgeInteraction = useCallback(async (interaction, iframe) => {
|
|
1059
1330
|
if (interaction.kind === "wheel") {
|
|
1060
1331
|
if (!interaction.ctrlKey && !interaction.metaKey)
|
|
@@ -1068,6 +1339,25 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1068
1339
|
return;
|
|
1069
1340
|
}
|
|
1070
1341
|
if (interaction.kind === "keydown") {
|
|
1342
|
+
if (isBridgeTextCompletionDismissShortcut(interaction)) {
|
|
1343
|
+
if (bridgeTextCompletionRef.current) {
|
|
1344
|
+
clearBridgeTextCompletion();
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
if (isBridgeTextCompletionApplyShortcut(interaction)) {
|
|
1349
|
+
if (bridgeTextCompletionRef.current) {
|
|
1350
|
+
applyBridgeTextCompletion();
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
if (isBridgeTextCompletionRequestShortcut(interaction)) {
|
|
1355
|
+
await requestBridgeTextCompletion(interaction, true);
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
if (bridgeTextCompletionRef.current && interaction.fieldId) {
|
|
1359
|
+
clearBridgeTextCompletion();
|
|
1360
|
+
}
|
|
1071
1361
|
if (isBridgeLinkShortcut(interaction)) {
|
|
1072
1362
|
const editor = editContextRef.current;
|
|
1073
1363
|
let linkRange = editor?.selectedRange;
|
|
@@ -1189,6 +1479,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1189
1479
|
return;
|
|
1190
1480
|
if (interaction.kind === "contextMenu" && interaction.ctrlKey)
|
|
1191
1481
|
return;
|
|
1482
|
+
clearBridgeTextCompletion();
|
|
1192
1483
|
const editor = editContextRef.current;
|
|
1193
1484
|
if (!editor)
|
|
1194
1485
|
return;
|
|
@@ -1402,8 +1693,11 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1402
1693
|
endTrackedBridgeFieldFocus();
|
|
1403
1694
|
}
|
|
1404
1695
|
}, [
|
|
1696
|
+
applyBridgeTextCompletion,
|
|
1405
1697
|
beginTrackedBridgeInlineEdit,
|
|
1698
|
+
clearBridgeTextCompletion,
|
|
1406
1699
|
endTrackedBridgeFieldFocus,
|
|
1700
|
+
requestBridgeTextCompletion,
|
|
1407
1701
|
resolveBridgeFieldDescriptor,
|
|
1408
1702
|
]);
|
|
1409
1703
|
// Update the context whenever the iframe ref changes
|
|
@@ -1498,11 +1792,15 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1498
1792
|
onError: (error) => {
|
|
1499
1793
|
pageViewContext.setBridgeReady(false);
|
|
1500
1794
|
pageViewContext.setIframeSupportsRefresh(false);
|
|
1501
|
-
|
|
1795
|
+
const parentInjectionDiagnostic = formatParentBridgeInjectionDiagnostic(latestParentBridgeInjectionRef.current);
|
|
1796
|
+
const details = parentInjectionDiagnostic
|
|
1797
|
+
? `${error.message}\n\nParent injection: ${parentInjectionDiagnostic}`
|
|
1798
|
+
: error.message;
|
|
1799
|
+
console.error("[Parhelia bridge]", error.message, latestParentBridgeInjectionRef.current);
|
|
1502
1800
|
if (!compareView) {
|
|
1503
1801
|
editContextRef.current?.showErrorToast({
|
|
1504
1802
|
summary: "Editing host bridge unavailable",
|
|
1505
|
-
details
|
|
1803
|
+
details,
|
|
1506
1804
|
});
|
|
1507
1805
|
}
|
|
1508
1806
|
},
|
|
@@ -1561,6 +1859,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1561
1859
|
window.dispatchEvent(new CustomEvent(BRIDGE_DOM_UPDATED_EVENT));
|
|
1562
1860
|
break;
|
|
1563
1861
|
case "refreshStarted":
|
|
1862
|
+
clearBridgeTextCompletion();
|
|
1564
1863
|
clearBridgePatchSignatures();
|
|
1565
1864
|
activeBridgeInlineEditRef.current = null;
|
|
1566
1865
|
break;
|
|
@@ -1672,6 +1971,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1672
1971
|
handleBridgeInlineEditEnded,
|
|
1673
1972
|
handleBridgeInteraction,
|
|
1674
1973
|
handleBridgeSelection,
|
|
1974
|
+
clearBridgeTextCompletion,
|
|
1675
1975
|
clearBridgePatchSignatures,
|
|
1676
1976
|
pageViewContext.editUrl,
|
|
1677
1977
|
pageViewContext.previewUrl,
|
|
@@ -1904,10 +2204,27 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1904
2204
|
const requestBridgeCaptureSnapshot = (payload) => {
|
|
1905
2205
|
return (bridgeClientRef.current?.sendCommand("captureComponentSnapshot", payload) ?? false);
|
|
1906
2206
|
};
|
|
2207
|
+
const requestBridgeComponentSnapshot = (payload) => {
|
|
2208
|
+
const bridge = bridgeClientRef.current;
|
|
2209
|
+
if (!bridge) {
|
|
2210
|
+
return Promise.reject(new Error("The Parhelia bridge is not connected to the host."));
|
|
2211
|
+
}
|
|
2212
|
+
return bridge.requestCommand("captureComponentSnapshot", payload, "componentSnapshotResult", {
|
|
2213
|
+
requestId: payload.requestId,
|
|
2214
|
+
timeoutMs: 15_000,
|
|
2215
|
+
});
|
|
2216
|
+
};
|
|
2217
|
+
const requestBridgeCancelPointerDrag = () => {
|
|
2218
|
+
return (bridgeClientRef.current?.sendCommand("cancelPointerDrag", {}) ?? false);
|
|
2219
|
+
};
|
|
1907
2220
|
pageViewContext.requestBridgeScrollBy = requestBridgeScrollBy;
|
|
1908
2221
|
pageViewContext.requestBridgeRichTextCommand = requestBridgeRichTextCommand;
|
|
1909
2222
|
pageViewContext.requestBridgePreviewGap = requestBridgePreviewGap;
|
|
1910
2223
|
pageViewContext.requestBridgeCaptureSnapshot = requestBridgeCaptureSnapshot;
|
|
2224
|
+
pageViewContext.requestBridgeComponentSnapshot =
|
|
2225
|
+
requestBridgeComponentSnapshot;
|
|
2226
|
+
pageViewContext.requestBridgeCancelPointerDrag =
|
|
2227
|
+
requestBridgeCancelPointerDrag;
|
|
1911
2228
|
return () => {
|
|
1912
2229
|
if (pageViewContext.requestBridgeGeometry === requestBridgeGeometry) {
|
|
1913
2230
|
pageViewContext.requestBridgeGeometry = undefined;
|
|
@@ -1922,6 +2239,14 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1922
2239
|
requestBridgeCaptureSnapshot) {
|
|
1923
2240
|
pageViewContext.requestBridgeCaptureSnapshot = undefined;
|
|
1924
2241
|
}
|
|
2242
|
+
if (pageViewContext.requestBridgeComponentSnapshot ===
|
|
2243
|
+
requestBridgeComponentSnapshot) {
|
|
2244
|
+
pageViewContext.requestBridgeComponentSnapshot = undefined;
|
|
2245
|
+
}
|
|
2246
|
+
if (pageViewContext.requestBridgeCancelPointerDrag ===
|
|
2247
|
+
requestBridgeCancelPointerDrag) {
|
|
2248
|
+
pageViewContext.requestBridgeCancelPointerDrag = undefined;
|
|
2249
|
+
}
|
|
1925
2250
|
if (pageViewContext.requestBridgeRichTextCommand ===
|
|
1926
2251
|
requestBridgeRichTextCommand) {
|
|
1927
2252
|
pageViewContext.requestBridgeRichTextCommand = undefined;
|
|
@@ -2358,7 +2683,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2358
2683
|
const fullscreenPageTitle = pageViewContext.page?.item?.displayName?.trim() ||
|
|
2359
2684
|
pageViewContext.page?.item?.name?.trim() ||
|
|
2360
2685
|
"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)
|
|
2686
|
+
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) }) })] })), 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
2687
|
width: deviceWidth,
|
|
2363
2688
|
}, children: [_jsxs("div", { className: "relative h-full w-full overflow-visible", onMouseLeave: () => {
|
|
2364
2689
|
if (pageViewContext.bridgeInteraction?.kind === "hover") {
|
|
@@ -2371,7 +2696,19 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2371
2696
|
? SUGGESTIONS_CURSOR_VALUE
|
|
2372
2697
|
: undefined,
|
|
2373
2698
|
}, src: iframeSrc, "data-testid": "pageEditoriframe", onLoad: () => {
|
|
2374
|
-
const
|
|
2699
|
+
const iframe = iframeRef.current;
|
|
2700
|
+
if (iframeSrc && iframe) {
|
|
2701
|
+
parentBridgeInjectionRef.current?.dispose();
|
|
2702
|
+
parentBridgeInjectionRef.current =
|
|
2703
|
+
injectParheliaBridgeFromParent(iframe, {
|
|
2704
|
+
onUpdate: (attempt) => {
|
|
2705
|
+
latestParentBridgeInjectionRef.current = attempt;
|
|
2706
|
+
},
|
|
2707
|
+
});
|
|
2708
|
+
latestParentBridgeInjectionRef.current =
|
|
2709
|
+
parentBridgeInjectionRef.current.attempt;
|
|
2710
|
+
}
|
|
2711
|
+
const loadedSrc = iframe?.src;
|
|
2375
2712
|
if (loadedSrc) {
|
|
2376
2713
|
setLoadedIframeSrc(loadedSrc);
|
|
2377
2714
|
}
|