@parhelia/core 0.1.12882 → 0.1.12883
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/AgentsSidebar.js +1 -1
- package/dist/agents-view/AgentsSidebar.js.map +1 -1
- package/dist/agents-view/AgentsTitlebar.d.ts +1 -1
- package/dist/agents-view/AgentsTitlebar.js +3 -6
- package/dist/agents-view/AgentsTitlebar.js.map +1 -1
- package/dist/agents-view/AgentsView.d.ts +2 -2
- package/dist/agents-view/AgentsView.js +2 -2
- package/dist/agents-view/AgentsView.js.map +1 -1
- package/dist/agents-view/AgentsWorkspaceView.js +1 -12
- package/dist/agents-view/AgentsWorkspaceView.js.map +1 -1
- package/dist/agents-view/CreateAgentView.d.ts +1 -1
- package/dist/agents-view/CreateAgentView.js +1 -1
- package/dist/agents-view/DateAgentsGroup.js +12 -1
- package/dist/agents-view/DateAgentsGroup.js.map +1 -1
- package/dist/agents-view/ProfileAgentsGroup.js +16 -4
- package/dist/agents-view/ProfileAgentsGroup.js.map +1 -1
- package/dist/components/ui/card.d.ts +3 -1
- package/dist/components/ui/card.js +2 -2
- 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/context-menu.d.ts +2 -1
- package/dist/components/ui/context-menu.js +6 -3
- package/dist/components/ui/context-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/select.js +1 -1
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/config/config.js +91 -12
- package/dist/config/config.js.map +1 -1
- package/dist/editor/ContextMenu.d.ts +1 -0
- package/dist/editor/ContextMenu.js +4 -4
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/FieldActionsOverlay.d.ts +0 -1
- package/dist/editor/FieldActionsOverlay.js +1 -45
- package/dist/editor/FieldActionsOverlay.js.map +1 -1
- package/dist/editor/FieldHistory.d.ts +2 -1
- package/dist/editor/FieldHistory.js +13 -12
- package/dist/editor/FieldHistory.js.map +1 -1
- package/dist/editor/FieldListField.d.ts +1 -1
- package/dist/editor/FieldListField.js +24 -36
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/ImageEditor.d.ts +6 -1
- package/dist/editor/ImageEditor.js +19 -3
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/LinkEditorDialog.d.ts +9 -2
- package/dist/editor/LinkEditorDialog.js +174 -70
- package/dist/editor/LinkEditorDialog.js.map +1 -1
- package/dist/editor/MainLayout.js +49 -6
- package/dist/editor/MainLayout.js.map +1 -1
- package/dist/editor/MobileLayout.js +33 -1
- package/dist/editor/MobileLayout.js.map +1 -1
- package/dist/editor/PictureCropper.js +45 -28
- package/dist/editor/PictureCropper.js.map +1 -1
- package/dist/editor/PictureEditor.d.ts +2 -1
- package/dist/editor/PictureEditor.js +5 -14
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/ai/AgentProfileSelector.js +7 -7
- package/dist/editor/ai/AgentProfileSelector.js.map +1 -1
- package/dist/editor/ai/Agents.js +20 -6
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/GuidanceOverlay.js +1 -11
- package/dist/editor/ai/GuidanceOverlay.js.map +1 -1
- package/dist/editor/ai/InlineAiDialog.d.ts +1 -0
- package/dist/editor/ai/InlineAiDialog.js +254 -202
- 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 +158 -31
- package/dist/editor/ai/InlineAiTrigger.js.map +1 -1
- package/dist/editor/ai/dialogs/capturePageDom.js +66 -36
- package/dist/editor/ai/dialogs/capturePageDom.js.map +1 -1
- package/dist/editor/ai/dialogs/capturePageScreenshot.js +281 -162
- package/dist/editor/ai/dialogs/capturePageScreenshot.js.map +1 -1
- 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/agentSessionState.d.ts +3 -0
- package/dist/editor/ai/terminal/agentSessionState.js +3 -1
- package/dist/editor/ai/terminal/agentSessionState.js.map +1 -1
- package/dist/editor/ai/terminal/agentStartRequest.d.ts +2 -1
- package/dist/editor/ai/terminal/agentStartRequest.js +2 -1
- package/dist/editor/ai/terminal/agentStartRequest.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentCostDisplay.js +1 -1
- package/dist/editor/ai/terminal/components/AgentCostDisplay.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentDocumentList.d.ts +7 -0
- package/dist/editor/ai/terminal/components/AgentDocumentList.js +55 -13
- package/dist/editor/ai/terminal/components/AgentDocumentList.js.map +1 -1
- 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 +3 -1
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.js +22 -14
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentModeSelector.js +4 -4
- package/dist/editor/ai/terminal/components/AgentModeSelector.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptActionButtons.js +4 -4
- package/dist/editor/ai/terminal/components/AgentPromptActionButtons.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptComposer.js +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptComposer.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptInputArea.d.ts +2 -1
- package/dist/editor/ai/terminal/components/AgentPromptInputArea.js +8 -11
- package/dist/editor/ai/terminal/components/AgentPromptInputArea.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.d.ts +1 -4
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js +31 -14
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentSettingsPopover.js +1 -1
- package/dist/editor/ai/terminal/components/AgentSettingsPopover.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.d.ts +2 -1
- package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.js +2 -4
- package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalMessageGroups.js +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalMessageGroups.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalView.js +13 -2
- package/dist/editor/ai/terminal/components/AgentTerminalView.js.map +1 -1
- package/dist/editor/ai/terminal/components/AiResponseMessage.js +11 -9
- package/dist/editor/ai/terminal/components/AiResponseMessage.js.map +1 -1
- package/dist/editor/ai/terminal/components/ContextInfoBar.js +22 -2
- package/dist/editor/ai/terminal/components/ContextInfoBar.js.map +1 -1
- package/dist/editor/ai/terminal/components/QueuedPromptsPanel.js +37 -26
- package/dist/editor/ai/terminal/components/QueuedPromptsPanel.js.map +1 -1
- package/dist/editor/ai/terminal/components/ToolCallDisplay.js +3 -1
- package/dist/editor/ai/terminal/components/ToolCallDisplay.js.map +1 -1
- package/dist/editor/ai/terminal/components/UserMessage.d.ts +2 -1
- package/dist/editor/ai/terminal/components/UserMessage.js +144 -8
- package/dist/editor/ai/terminal/components/UserMessage.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentPromptComposerHandlers.js +1 -1
- package/dist/editor/ai/terminal/useAgentPromptComposerHandlers.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentSessionSync.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.d.ts +3 -1
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.js +9 -3
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentTerminalController.js +7 -0
- package/dist/editor/ai/terminal/useAgentTerminalController.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentTerminalUiState.js +1 -1
- package/dist/editor/ai/terminal/useAgentTerminalUiState.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentUserMessageSocketHandler.js +3 -1
- package/dist/editor/ai/terminal/useAgentUserMessageSocketHandler.js.map +1 -1
- package/dist/editor/ai/useActiveAgentConversation.d.ts +3 -0
- package/dist/editor/ai/useActiveAgentConversation.js +32 -0
- package/dist/editor/ai/useActiveAgentConversation.js.map +1 -0
- package/dist/editor/ai/useInlineAiPosition.d.ts +10 -2
- package/dist/editor/ai/useInlineAiPosition.js +32 -71
- package/dist/editor/ai/useInlineAiPosition.js.map +1 -1
- package/dist/editor/ai-image-editor/AiImageResultOverlay.js +30 -62
- package/dist/editor/ai-image-editor/AiImageResultOverlay.js.map +1 -1
- package/dist/editor/bridge/BridgeClient.d.ts +80 -0
- package/dist/editor/bridge/BridgeClient.js +417 -0
- package/dist/editor/bridge/BridgeClient.js.map +1 -0
- package/dist/editor/client/EditorShell.d.ts +5 -1
- package/dist/editor/client/EditorShell.js +295 -127
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +58 -5
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/fieldModificationStore.d.ts +1 -0
- package/dist/editor/client/fieldModificationStore.js +7 -2
- package/dist/editor/client/fieldModificationStore.js.map +1 -1
- package/dist/editor/client/hooks/useSocketMessageHandler.js +14 -17
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
- package/dist/editor/client/itemsRepository.d.ts +2 -0
- package/dist/editor/client/itemsRepository.js +18 -9
- package/dist/editor/client/itemsRepository.js.map +1 -1
- package/dist/editor/client/operations.d.ts +1 -1
- package/dist/editor/client/operations.js +67 -21
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/client/pageModelBuilder.js +24 -7
- package/dist/editor/client/pageModelBuilder.js.map +1 -1
- package/dist/editor/client/ui/EditorChrome.js +1 -1
- package/dist/editor/client/ui/EditorChrome.js.map +1 -1
- package/dist/editor/commands/componentCommands.d.ts +3 -1
- package/dist/editor/commands/componentCommands.js +8 -3
- package/dist/editor/commands/componentCommands.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 +1 -1
- 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 +1 -1
- 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 +11 -4
- package/dist/editor/field-types/MultiLineText.js.map +1 -1
- package/dist/editor/field-types/NameValueListEditor.js +1 -1
- package/dist/editor/field-types/NameValueListEditor.js.map +1 -1
- package/dist/editor/field-types/PictureFieldEditor.js +2 -2
- 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/RichTextEditorComponent.js +170 -77
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -1
- package/dist/editor/field-types/SingleLineText.js +10 -3
- package/dist/editor/field-types/SingleLineText.js.map +1 -1
- package/dist/editor/field-types/TreeListEditor.js +1 -1
- 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/ReactSlate.css +44 -6
- package/dist/editor/field-types/richtext/components/ReactSlate.js +191 -36
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.css +5 -2
- 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/contextMenuFactory.d.ts +2 -15
- package/dist/editor/field-types/richtext/contextMenuFactory.js +4 -435
- package/dist/editor/field-types/richtext/contextMenuFactory.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.js +23 -2
- package/dist/editor/field-types/richtext/utils/conversion.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/fieldTypes.d.ts +2 -0
- package/dist/editor/media-selector/TreeSelector.js +15 -15
- package/dist/editor/media-selector/TreeSelector.js.map +1 -1
- package/dist/editor/menubar/PageSelector.js +8 -2
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/menubar/VersionPreviewCard.js +4 -249
- package/dist/editor/menubar/VersionPreviewCard.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/EditControls.js +2 -2
- package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js +310 -187
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +3 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js +1 -1
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.d.ts +8 -0
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js +407 -0
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +5 -2
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +340 -215
- package/dist/editor/page-editor-chrome/CommentHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/FeedbackHighlightBadge.d.ts +5 -1
- package/dist/editor/page-editor-chrome/FeedbackHighlightBadge.js +11 -4
- package/dist/editor/page-editor-chrome/FeedbackHighlightBadge.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +21 -13
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +23 -29
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js +110 -19
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +3 -2
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +148 -45
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +2 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +25 -21
- package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -1
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +163 -128
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +6 -3
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +1 -2
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +83 -146
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -1
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.d.ts +5 -2
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +144 -63
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/VersionDiffHighlightings.d.ts +1 -2
- package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js +101 -30
- 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 +89 -0
- package/dist/editor/page-editor-chrome/bridgeInlineFormatToolbarLayout.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.d.ts +10 -1
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js +105 -122
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js.map +1 -1
- package/dist/editor/page-editor-chrome/overlay/geometry.d.ts +11 -4
- package/dist/editor/page-editor-chrome/overlay/geometry.js +139 -36
- package/dist/editor/page-editor-chrome/overlay/geometry.js.map +1 -1
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.d.ts +26 -0
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js +228 -0
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js.map +1 -0
- package/dist/editor/page-viewer/EditorForm.js +17 -1
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/page-viewer/MiniMap.d.ts +2 -2
- package/dist/editor/page-viewer/MiniMap.js +176 -364
- package/dist/editor/page-viewer/MiniMap.js.map +1 -1
- package/dist/editor/page-viewer/PageViewer.js +63 -17
- package/dist/editor/page-viewer/PageViewer.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +0 -5
- package/dist/editor/page-viewer/PageViewerFrame.js +1685 -1512
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/bridgeFieldPatch.d.ts +20 -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/pageViewContext.d.ts +32 -0
- package/dist/editor/page-viewer/pageViewContext.js +37 -6
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -1
- package/dist/editor/reviews/Comment.d.ts +2 -1
- package/dist/editor/reviews/Comment.js +10 -5
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/reviews/CommentDisplayPopover.js +2 -1
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/CommentEditor.d.ts +1 -0
- package/dist/editor/reviews/CommentEditor.js +3 -2
- package/dist/editor/reviews/CommentEditor.js.map +1 -1
- package/dist/editor/reviews/CommentPopover.js +69 -10
- package/dist/editor/reviews/CommentPopover.js.map +1 -1
- package/dist/editor/reviews/CommentView.js +24 -4
- package/dist/editor/reviews/CommentView.js.map +1 -1
- package/dist/editor/reviews/Comments.d.ts +0 -2
- package/dist/editor/reviews/Comments.js +31 -31
- package/dist/editor/reviews/Comments.js.map +1 -1
- package/dist/editor/reviews/FeedbackCard.d.ts +4 -2
- package/dist/editor/reviews/FeedbackCard.js +8 -10
- package/dist/editor/reviews/FeedbackCard.js.map +1 -1
- package/dist/editor/reviews/SuggestedEdit.js +4 -6
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -1
- package/dist/editor/reviews/SuggestionCommentThread.js +3 -3
- package/dist/editor/reviews/SuggestionCommentThread.js.map +1 -1
- package/dist/editor/reviews/SuggestionDisplayPopover.js +3 -2
- 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/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/feedbackSelection.js +32 -4
- package/dist/editor/reviews/feedbackSelection.js.map +1 -1
- package/dist/editor/reviews/suggestedEditState.d.ts +12 -0
- package/dist/editor/reviews/suggestedEditState.js +90 -0
- package/dist/editor/reviews/suggestedEditState.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/services/agentService.d.ts +15 -0
- package/dist/editor/services/agentService.js +11 -1
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/reviewsService.d.ts +2 -2
- package/dist/editor/services/reviewsService.js.map +1 -1
- package/dist/editor/settings/SettingsView.js +2 -2
- package/dist/editor/settings/SettingsView.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplatesPanel.js +1 -1
- package/dist/editor/settings/panels/ProjectTemplatesPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.js +2 -3
- package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
- package/dist/editor/sidebar/MorePanelsButton.js +1 -1
- package/dist/editor/sidebar/MorePanelsButton.js.map +1 -1
- package/dist/editor/sidebar/Validation.js +4 -1
- package/dist/editor/sidebar/Validation.js.map +1 -1
- package/dist/editor/sidebar/Workbox.js +1 -1
- package/dist/editor/sidebar/Workbox.js.map +1 -1
- package/dist/editor/template-wizard/TemplateStructureInlineEditor.js +1 -1
- package/dist/editor/template-wizard/TemplateStructureInlineEditor.js.map +1 -1
- package/dist/editor/ui/IconSelectorDialog.js +1 -1
- package/dist/editor/ui/IconSelectorDialog.js.map +1 -1
- package/dist/editor/ui/SimpleIconButton.d.ts +2 -2
- package/dist/editor/ui/SimpleIconButton.js +7 -1
- package/dist/editor/ui/SimpleIconButton.js.map +1 -1
- package/dist/editor/ui/Splitter.d.ts +1 -0
- package/dist/editor/ui/Splitter.js +12 -2
- package/dist/editor/ui/Splitter.js.map +1 -1
- 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/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.d.ts +1 -17
- package/dist/editor/utils.js +0 -143
- package/dist/editor/utils.js.map +1 -1
- package/dist/editor/version-diff/versionDiffTargets.d.ts +3 -8
- package/dist/editor/version-diff/versionDiffTargets.js +37 -94
- package/dist/editor/version-diff/versionDiffTargets.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/splash-screen/ModernSplashScreen.js +11 -3
- package/dist/splash-screen/ModernSplashScreen.js.map +1 -1
- package/dist/splash-screen/NewPage.js +7 -5
- package/dist/splash-screen/NewPage.js.map +1 -1
- package/dist/splash-screen/OpenPage.js +5 -3
- package/dist/splash-screen/OpenPage.js.map +1 -1
- package/dist/splash-screen/RecentPages.js +3 -3
- package/dist/splash-screen/RecentPages.js.map +1 -1
- package/dist/task-board/components/TaskDetailPanel.js +2 -1
- package/dist/task-board/components/TaskDetailPanel.js.map +1 -1
- package/dist/task-board/views/DependencyGraphView.d.ts +42 -1
- package/dist/task-board/views/DependencyGraphView.js +94 -0
- package/dist/task-board/views/DependencyGraphView.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +2 -1
- package/styles.css +96 -0
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +0 -7
- package/dist/editor/page-editor-chrome/InlineEditor.js +0 -1719
- package/dist/editor/page-editor-chrome/InlineEditor.js.map +0 -1
- package/dist/editor/page-editor-chrome/overlay/iframeAccess.d.ts +0 -2
- package/dist/editor/page-editor-chrome/overlay/iframeAccess.js +0 -21
- package/dist/editor/page-editor-chrome/overlay/iframeAccess.js.map +0 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.d.ts +0 -7
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +0 -758
- 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 -796
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useEditContext } from "../client/editContext";
|
|
4
4
|
import { PlaceholderDropZones } from "../page-editor-chrome/PlaceholderDropZones";
|
|
5
5
|
import { FieldEditedIndicators } from "../page-editor-chrome/FieldEditedIndicators";
|
|
@@ -7,55 +7,54 @@ import { CommentHighlightings } from "../page-editor-chrome/CommentHighlightings
|
|
|
7
7
|
import { SuggestionHighlightings } from "../page-editor-chrome/SuggestionHighlightings";
|
|
8
8
|
import { VersionDiffHighlightings } from "../page-editor-chrome/VersionDiffHighlightings";
|
|
9
9
|
import { IframeOverlayProvider } from "../page-editor-chrome/overlay/IframeOverlayProvider";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return null;
|
|
13
|
-
try {
|
|
14
|
-
return iframe.contentDocument || iframe.contentWindow?.document || null;
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function isElementNode(node) {
|
|
21
|
-
return node?.nodeType === 1;
|
|
22
|
-
}
|
|
23
|
-
export function MiniMap({ compareView, deviceHeight, scroll, mainViewIframeRef, pageViewContext, }) {
|
|
10
|
+
export const BRIDGE_DOM_UPDATED_EVENT = "parhelia:bridge-dom-updated";
|
|
11
|
+
export function MiniMap({ compareView, scroll, pageViewContext, }) {
|
|
24
12
|
const editContext = useEditContext();
|
|
25
13
|
const [scale, setScale] = useState(1);
|
|
26
14
|
const minimapRef = useRef(null);
|
|
27
15
|
const scaleContainerRef = useRef(null);
|
|
28
16
|
const iframeRef = useRef(null);
|
|
29
17
|
const [minimapReady, setMinimapReady] = useState(false);
|
|
30
|
-
const [
|
|
31
|
-
const observerRef = useRef(null);
|
|
32
|
-
const resizeObserverRef = useRef(null);
|
|
33
|
-
const assetLoadHandlerRef = useRef(null);
|
|
18
|
+
const [bridgeDomRevision, setBridgeDomRevision] = useState(0);
|
|
34
19
|
const minimapContainerRef = useRef(null);
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
const viewport = pageViewContext.viewport;
|
|
21
|
+
const bridgeDom = pageViewContext.bridgeDom;
|
|
22
|
+
const bridgeMetrics = bridgeDom
|
|
23
|
+
? getBridgeMinimapMetrics(bridgeDom, viewport)
|
|
24
|
+
: null;
|
|
25
|
+
const isBridgeMinimap = !!bridgeDom && !!bridgeMetrics;
|
|
26
|
+
const bridgeMinimapHtml = useMemo(() => bridgeDom
|
|
27
|
+
? createBridgeMinimapHtml(bridgeDom.html, pageViewContext.bridgeGeometry, bridgeDom.viewport.width || viewport.width)
|
|
28
|
+
: undefined, [
|
|
29
|
+
bridgeDom,
|
|
30
|
+
bridgeDomRevision,
|
|
31
|
+
pageViewContext.bridgeGeometry,
|
|
32
|
+
viewport.width,
|
|
33
|
+
]);
|
|
34
|
+
const getDocumentMetrics = useCallback(() => {
|
|
35
|
+
return getBridgeMinimapMetrics(pageViewContext.bridgeDom, viewport, scroll);
|
|
36
|
+
}, [bridgeDomRevision, pageViewContext.bridgeDom, scroll, viewport]);
|
|
37
|
+
const minimapMetrics = getDocumentMetrics();
|
|
39
38
|
const calcAndUpdateScale = () => {
|
|
40
|
-
const viewport = pageViewContext.viewport;
|
|
41
39
|
const minimapHeight = minimapContainerRef.current?.clientHeight;
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
40
|
+
const metrics = getDocumentMetrics();
|
|
41
|
+
if (!metrics)
|
|
44
42
|
return;
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const scaleY = Math.max(deviceHeight || 0, minimapHeight || viewport.height) /
|
|
48
|
-
scrollContainer.scrollHeight;
|
|
43
|
+
const scaleX = (editContext?.configuration.outline.width || 100) / metrics.viewportWidth;
|
|
44
|
+
const scaleY = (minimapHeight || metrics.viewportHeight) / metrics.documentHeight;
|
|
49
45
|
const newScale = Math.min(scaleX, scaleY, 1);
|
|
50
46
|
updateScale(newScale);
|
|
51
47
|
setScale(newScale);
|
|
52
|
-
syncDimensions();
|
|
53
48
|
return newScale;
|
|
54
49
|
};
|
|
55
50
|
// Prevent scale/width feedback loop by tracking previous values
|
|
56
51
|
const prevScaleRef = useRef(scale);
|
|
57
52
|
const prevWidthRef = useRef(0);
|
|
58
|
-
const currentWidth = Math.max(30, scale *
|
|
53
|
+
const currentWidth = Math.max(30, scale *
|
|
54
|
+
(minimapMetrics?.viewportWidth ||
|
|
55
|
+
bridgeMetrics?.viewportWidth ||
|
|
56
|
+
pageViewContext.viewport.width ||
|
|
57
|
+
0));
|
|
59
58
|
// Only update if change is significant (>1px) to avoid minor oscillations
|
|
60
59
|
let miniMapWidth;
|
|
61
60
|
if (prevWidthRef.current < currentWidth ||
|
|
@@ -68,333 +67,60 @@ export function MiniMap({ compareView, deviceHeight, scroll, mainViewIframeRef,
|
|
|
68
67
|
else {
|
|
69
68
|
miniMapWidth = prevWidthRef.current;
|
|
70
69
|
}
|
|
71
|
-
function getNodePath(node) {
|
|
72
|
-
const path = [];
|
|
73
|
-
let current = node;
|
|
74
|
-
if (node?.tagName === "HTML")
|
|
75
|
-
return null;
|
|
76
|
-
while (current &&
|
|
77
|
-
current !== current.ownerDocument?.documentElement &&
|
|
78
|
-
current.parentNode) {
|
|
79
|
-
const index = Array.prototype.indexOf.call(current.parentNode.childNodes, current);
|
|
80
|
-
path.unshift(index);
|
|
81
|
-
current = current.parentNode;
|
|
82
|
-
}
|
|
83
|
-
return path;
|
|
84
|
-
}
|
|
85
|
-
function findCorrespondingNode(node) {
|
|
86
|
-
const path = getNodePath(node);
|
|
87
|
-
if (!path)
|
|
88
|
-
return null;
|
|
89
|
-
const minimapDoc = getAccessibleIframeDocument(iframeRef.current);
|
|
90
|
-
if (!minimapDoc)
|
|
91
|
-
return null;
|
|
92
|
-
let correspondingNode = minimapDoc.documentElement;
|
|
93
|
-
let originalNode = getAccessibleIframeDocument(mainViewIframeRef.current)?.documentElement;
|
|
94
|
-
for (const index of path) {
|
|
95
|
-
if (!originalNode || !correspondingNode)
|
|
96
|
-
return null;
|
|
97
|
-
if (originalNode.childNodes.length !== correspondingNode.childNodes.length)
|
|
98
|
-
return null;
|
|
99
|
-
originalNode = originalNode.childNodes[index] ?? null;
|
|
100
|
-
correspondingNode = correspondingNode.childNodes[index] ?? null;
|
|
101
|
-
}
|
|
102
|
-
return isElementNode(correspondingNode) ? correspondingNode : null;
|
|
103
|
-
}
|
|
104
|
-
function updateCorrespondingNode(node) {
|
|
105
|
-
const path = getNodePath(node);
|
|
106
|
-
if (!path)
|
|
107
|
-
return;
|
|
108
|
-
const minimapDoc = getAccessibleIframeDocument(iframeRef.current);
|
|
109
|
-
if (!minimapDoc)
|
|
110
|
-
return;
|
|
111
|
-
let correspondingNode = minimapDoc.documentElement;
|
|
112
|
-
let originalNode = getAccessibleIframeDocument(mainViewIframeRef.current)?.documentElement;
|
|
113
|
-
for (const index of path) {
|
|
114
|
-
if (originalNode && correspondingNode) {
|
|
115
|
-
if (originalNode.childNodes.length !== correspondingNode.childNodes.length) {
|
|
116
|
-
// When the mismatch is at the document root (HTML), only sync the
|
|
117
|
-
// body element instead of replacing the entire innerHTML. Replacing
|
|
118
|
-
// HTML.innerHTML causes a visible flash and can create a duplicate
|
|
119
|
-
// HEAD element in the minimap iframe.
|
|
120
|
-
if (isElementNode(originalNode) && originalNode.tagName === "HTML") {
|
|
121
|
-
const srcBody = originalNode.ownerDocument?.body;
|
|
122
|
-
const dstBody = correspondingNode.ownerDocument?.body;
|
|
123
|
-
if (srcBody && dstBody) {
|
|
124
|
-
dstBody.innerHTML = srcBody.innerHTML;
|
|
125
|
-
}
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (!isElementNode(originalNode) ||
|
|
129
|
-
!isElementNode(correspondingNode)) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
correspondingNode.innerHTML = originalNode.innerHTML;
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (originalNode) {
|
|
137
|
-
originalNode = originalNode.childNodes[index] ?? null;
|
|
138
|
-
}
|
|
139
|
-
if (correspondingNode) {
|
|
140
|
-
correspondingNode = correspondingNode.childNodes[index] ?? null;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (isElementNode(correspondingNode) && isElementNode(originalNode)) {
|
|
144
|
-
if (originalNode.tagName === "HEAD") {
|
|
145
|
-
correspondingNode.innerHTML = originalNode.innerHTML;
|
|
146
|
-
}
|
|
147
|
-
else if (correspondingNode.parentNode?.nodeType === Node.DOCUMENT_NODE) {
|
|
148
|
-
correspondingNode.innerHTML = originalNode.innerHTML;
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
correspondingNode.outerHTML = originalNode.outerHTML;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
const handleLoad = () => {
|
|
156
|
-
const sourceDoc = getAccessibleIframeDocument(mainViewIframeRef.current);
|
|
157
|
-
if (!sourceDoc)
|
|
158
|
-
return;
|
|
159
|
-
if (!iframeRef.current || !mainViewIframeRef.current)
|
|
160
|
-
return;
|
|
161
|
-
observerRef.current?.disconnect();
|
|
162
|
-
resizeObserverRef.current?.disconnect();
|
|
163
|
-
if (assetLoadHandlerRef.current) {
|
|
164
|
-
sourceDoc.removeEventListener("load", assetLoadHandlerRef.current, true);
|
|
165
|
-
assetLoadHandlerRef.current = null;
|
|
166
|
-
}
|
|
167
|
-
mirrorIframeContent(mainViewIframeRef.current, iframeRef.current);
|
|
168
|
-
const observer = new MutationObserver((mutationsList) => {
|
|
169
|
-
const minimapDoc = getAccessibleIframeDocument(iframeRef.current);
|
|
170
|
-
if (!minimapDoc)
|
|
171
|
-
return;
|
|
172
|
-
// Sync attribute mutations lightweight — copy only the changed attribute
|
|
173
|
-
const attributeMutations = mutationsList.filter((x) => x.type === "attributes" && x.attributeName && x.target.parentElement);
|
|
174
|
-
for (const mutation of attributeMutations) {
|
|
175
|
-
const target = mutation.target;
|
|
176
|
-
if (!isElementNode(target) || target.tagName === "HTML")
|
|
177
|
-
continue;
|
|
178
|
-
const correspondingNode = findCorrespondingNode(target);
|
|
179
|
-
if (!correspondingNode) {
|
|
180
|
-
updateCorrespondingNode(target.parentElement ?? target);
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
const attrName = mutation.attributeName;
|
|
184
|
-
const value = target.getAttribute(attrName);
|
|
185
|
-
if (value !== null) {
|
|
186
|
-
correspondingNode.setAttribute(attrName, value);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
correspondingNode.removeAttribute(attrName);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
// Structural mutations (childList / characterData) need full DOM sync
|
|
193
|
-
const structuralMutations = mutationsList.filter((x) => x.type === "childList" || x.type === "characterData");
|
|
194
|
-
if (structuralMutations.length === 0)
|
|
195
|
-
return;
|
|
196
|
-
const targetNodes = structuralMutations
|
|
197
|
-
.filter((x) => x.type === "childList" && x.target.parentElement)
|
|
198
|
-
.map((m) => m.target)
|
|
199
|
-
.concat(structuralMutations
|
|
200
|
-
.filter((x) => x.type === "characterData")
|
|
201
|
-
.map((m) => m.target.parentElement));
|
|
202
|
-
const distinctTargetNodes = Array.from(new Set(targetNodes));
|
|
203
|
-
const nodesToRemove = new Set();
|
|
204
|
-
for (let i = 0; i < distinctTargetNodes.length; i++) {
|
|
205
|
-
for (let j = 0; j < distinctTargetNodes.length; j++) {
|
|
206
|
-
if (i !== j) {
|
|
207
|
-
if (distinctTargetNodes[i]?.contains(distinctTargetNodes[j])) {
|
|
208
|
-
nodesToRemove.add(distinctTargetNodes[j]);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
const filteredNodes = distinctTargetNodes.filter((node) => !nodesToRemove.has(node));
|
|
214
|
-
filteredNodes.forEach((targetNode) => {
|
|
215
|
-
if (isElementNode(targetNode)) {
|
|
216
|
-
updateCorrespondingNode(targetNode);
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
// Re-bake dimensions in the same tick as the structural sync so the
|
|
220
|
-
// source/destination tree pairing stays consistent — MutationObserver
|
|
221
|
-
// callbacks are microtasks, no other JS can run between the two.
|
|
222
|
-
syncDimensions();
|
|
223
|
-
setRefreshScale((x) => x + 1);
|
|
224
|
-
});
|
|
225
|
-
observer.observe(sourceDoc, {
|
|
226
|
-
childList: true, // observe direct children changes
|
|
227
|
-
subtree: true, // observe all descendants changes
|
|
228
|
-
characterData: true, // observe text changes
|
|
229
|
-
attributes: true, // observe attribute changes (like style or class)
|
|
230
|
-
});
|
|
231
|
-
// Catch async layout changes that don't trigger the MutationObserver:
|
|
232
|
-
// image/video metadata loading, web font swap-in, CSS animations
|
|
233
|
-
// settling, and iframe-size changes from device-mode toggles.
|
|
234
|
-
const ro = new ResizeObserver(() => {
|
|
235
|
-
syncDimensions();
|
|
236
|
-
setRefreshScale((x) => x + 1);
|
|
237
|
-
});
|
|
238
|
-
ro.observe(sourceDoc.documentElement);
|
|
239
|
-
if (mainViewIframeRef.current) {
|
|
240
|
-
ro.observe(mainViewIframeRef.current);
|
|
241
|
-
}
|
|
242
|
-
if (minimapContainerRef.current) {
|
|
243
|
-
ro.observe(minimapContainerRef.current);
|
|
244
|
-
}
|
|
245
|
-
resizeObserverRef.current = ro;
|
|
246
|
-
const onAssetLoad = () => {
|
|
247
|
-
syncDimensions();
|
|
248
|
-
};
|
|
249
|
-
// <img>/<video>/<iframe> 'load' events don't bubble — capture phase
|
|
250
|
-
// catches them at the document root.
|
|
251
|
-
sourceDoc.addEventListener("load", onAssetLoad, true);
|
|
252
|
-
assetLoadHandlerRef.current = onAssetLoad;
|
|
253
|
-
setMinimapReady(true);
|
|
254
|
-
observerRef.current = observer;
|
|
255
|
-
};
|
|
256
70
|
useEffect(() => {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
71
|
+
setMinimapReady(isBridgeMinimap);
|
|
72
|
+
}, [isBridgeMinimap]);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const handleBridgeDomUpdated = () => {
|
|
75
|
+
setBridgeDomRevision((revision) => revision + 1);
|
|
76
|
+
};
|
|
77
|
+
window.addEventListener(BRIDGE_DOM_UPDATED_EVENT, handleBridgeDomUpdated);
|
|
262
78
|
return () => {
|
|
263
|
-
|
|
264
|
-
observerRef.current = null;
|
|
265
|
-
resizeObserverRef.current?.disconnect();
|
|
266
|
-
resizeObserverRef.current = null;
|
|
267
|
-
const sourceDoc = getAccessibleIframeDocument(mainViewIframeRef.current);
|
|
268
|
-
if (sourceDoc && assetLoadHandlerRef.current) {
|
|
269
|
-
sourceDoc.removeEventListener("load", assetLoadHandlerRef.current, true);
|
|
270
|
-
}
|
|
271
|
-
assetLoadHandlerRef.current = null;
|
|
272
|
-
mainViewIframeRef?.current?.removeEventListener("load", handleLoad);
|
|
79
|
+
window.removeEventListener(BRIDGE_DOM_UPDATED_EVENT, handleBridgeDomUpdated);
|
|
273
80
|
};
|
|
274
|
-
}, [
|
|
81
|
+
}, []);
|
|
275
82
|
useEffect(() => {
|
|
276
83
|
calcAndUpdateScale();
|
|
277
84
|
}, [
|
|
278
|
-
|
|
279
|
-
mainViewIframeRef,
|
|
280
|
-
//pageViewContext?.windowSize,
|
|
85
|
+
isBridgeMinimap,
|
|
281
86
|
pageViewContext?.zoom,
|
|
282
87
|
pageViewContext.viewport,
|
|
283
88
|
pageViewContext.deviceHeight,
|
|
284
89
|
pageViewContext.deviceWidth,
|
|
90
|
+
pageViewContext.bridgeDom,
|
|
91
|
+
bridgeDomRevision,
|
|
285
92
|
]);
|
|
286
93
|
const scrollDocumentTo = (y) => {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const scrollContainer = getScrollContainer();
|
|
290
|
-
if (!scrollContainer)
|
|
94
|
+
const metrics = getDocumentMetrics();
|
|
95
|
+
if (!metrics)
|
|
291
96
|
return;
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
97
|
+
const maxScrollTop = Math.max(0, metrics.documentHeight - metrics.viewportHeight);
|
|
98
|
+
const targetY = Math.min(maxScrollTop, Math.max(0, y));
|
|
99
|
+
const currentY = pageViewContext.bridgeGeometry?.scroll.y ??
|
|
100
|
+
scroll ??
|
|
101
|
+
pageViewContext.bridgeDom?.scroll.y ??
|
|
102
|
+
metrics.scrollTop;
|
|
103
|
+
pageViewContext.requestBridgeScrollBy?.({
|
|
104
|
+
y: targetY - currentY,
|
|
105
|
+
behavior: "smooth",
|
|
106
|
+
});
|
|
299
107
|
};
|
|
300
|
-
const scrollHeight = getScrollContainer()?.scrollHeight;
|
|
301
|
-
const scrollTop = scroll;
|
|
302
|
-
const viewport = pageViewContext.viewport;
|
|
303
|
-
function mirrorIframeContent(sourceIframe, targetIframe) {
|
|
304
|
-
const sourceDoc = getAccessibleIframeDocument(sourceIframe);
|
|
305
|
-
const targetDoc = getAccessibleIframeDocument(targetIframe);
|
|
306
|
-
// Check that both documents AND their documentElements exist
|
|
307
|
-
if (sourceDoc?.documentElement && targetDoc?.documentElement) {
|
|
308
|
-
const sourceHtml = sourceDoc.documentElement.innerHTML;
|
|
309
|
-
targetDoc.documentElement.innerHTML = sourceHtml;
|
|
310
|
-
targetDoc.documentElement.style.overflow = "hidden";
|
|
311
|
-
const targetHead = targetDoc.documentElement.querySelector("head");
|
|
312
|
-
// Inject CSS to constrain media elements in minimap. Width/height for
|
|
313
|
-
// <video> are now baked by syncDimensions() so we no longer need the
|
|
314
|
-
// viewport-unit (`max-height: 100vh`) hack that misresolved against the
|
|
315
|
-
// tall minimap iframe.
|
|
316
|
-
let style = targetHead?.querySelector("style[data-minimap-constraints]");
|
|
317
|
-
if (!style && targetHead) {
|
|
318
|
-
style = targetDoc.createElement("style");
|
|
319
|
-
style.setAttribute("data-minimap-constraints", "true");
|
|
320
|
-
style.textContent = `
|
|
321
|
-
video, img, picture, iframe {
|
|
322
|
-
max-width: 100% !important;
|
|
323
|
-
height: auto !important;
|
|
324
|
-
}
|
|
325
|
-
`;
|
|
326
|
-
targetHead.appendChild(style);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
syncDimensions();
|
|
330
|
-
setRefreshScale((x) => x + 1);
|
|
331
|
-
}
|
|
332
|
-
// Bake the main iframe's resolved layout (width/height per element, plus
|
|
333
|
-
// top/left for absolute/fixed elements) into the minimap clone as inline
|
|
334
|
-
// !important px styles. This neutralizes vh/vw drift between the two
|
|
335
|
-
// iframes (their layout viewports differ — main = deviceHeight, minimap =
|
|
336
|
-
// scrollHeight) and any other unit/calc/percentage that would resolve
|
|
337
|
-
// differently inside the minimap document.
|
|
338
|
-
function syncDimensions() {
|
|
339
|
-
const sourceDoc = getAccessibleIframeDocument(mainViewIframeRef.current);
|
|
340
|
-
const targetDoc = getAccessibleIframeDocument(iframeRef.current);
|
|
341
|
-
if (!sourceDoc?.body || !targetDoc?.body)
|
|
342
|
-
return;
|
|
343
|
-
const srcView = sourceDoc.defaultView;
|
|
344
|
-
if (!srcView)
|
|
345
|
-
return;
|
|
346
|
-
walkDimensions(sourceDoc.body, targetDoc.body, srcView);
|
|
347
|
-
}
|
|
348
|
-
function walkDimensions(src, dst, srcView) {
|
|
349
|
-
// We can't use `instanceof HTMLElement` here because src/dst live in
|
|
350
|
-
// different window realms (main iframe / minimap iframe) than this
|
|
351
|
-
// component, so each realm has its own HTMLElement constructor and the
|
|
352
|
-
// check would always be false. Use duck typing instead.
|
|
353
|
-
const srcEl = src;
|
|
354
|
-
const dstEl = dst;
|
|
355
|
-
const dstStyle = dstEl.style;
|
|
356
|
-
if (dstStyle && typeof srcEl.getBoundingClientRect === "function") {
|
|
357
|
-
const rect = srcEl.getBoundingClientRect();
|
|
358
|
-
if (rect.width > 0 || rect.height > 0) {
|
|
359
|
-
dstStyle.setProperty("width", `${rect.width}px`, "important");
|
|
360
|
-
dstStyle.setProperty("height", `${rect.height}px`, "important");
|
|
361
|
-
}
|
|
362
|
-
const cs = srcView.getComputedStyle(srcEl);
|
|
363
|
-
if (cs.position === "absolute" || cs.position === "fixed") {
|
|
364
|
-
const offsetParent = srcEl.offsetParent;
|
|
365
|
-
const parentRect = offsetParent?.getBoundingClientRect();
|
|
366
|
-
if (parentRect) {
|
|
367
|
-
dstStyle.setProperty("left", `${rect.left - parentRect.left}px`, "important");
|
|
368
|
-
dstStyle.setProperty("top", `${rect.top - parentRect.top}px`, "important");
|
|
369
|
-
dstStyle.removeProperty("right");
|
|
370
|
-
dstStyle.removeProperty("bottom");
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
// Walk children in lock-step. Bail at any divergent subtree — the
|
|
375
|
-
// MutationObserver path keeps structures aligned, so this is purely
|
|
376
|
-
// defensive.
|
|
377
|
-
const sChildren = src.children;
|
|
378
|
-
const dChildren = dst.children;
|
|
379
|
-
const len = Math.min(sChildren.length, dChildren.length);
|
|
380
|
-
for (let i = 0; i < len; i++) {
|
|
381
|
-
walkDimensions(sChildren[i], dChildren[i], srcView);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
108
|
const updateScale = (scale) => {
|
|
385
|
-
|
|
386
|
-
if (!iframeRef.current || !scaleContainerRef.current)
|
|
109
|
+
if (!scaleContainerRef.current)
|
|
387
110
|
return;
|
|
388
|
-
|
|
111
|
+
const metrics = getDocumentMetrics();
|
|
112
|
+
if (!metrics)
|
|
389
113
|
return;
|
|
390
114
|
scaleContainerRef.current.style.transform = `scale(${scale})`;
|
|
391
115
|
scaleContainerRef.current.style.transformOrigin = "0 0";
|
|
392
|
-
iframeRef.current
|
|
393
|
-
|
|
116
|
+
if (iframeRef.current) {
|
|
117
|
+
iframeRef.current.style.width = `${metrics?.viewportWidth ?? 0}px`;
|
|
118
|
+
iframeRef.current.style.height = `${metrics?.documentHeight ?? 0}px`;
|
|
119
|
+
}
|
|
394
120
|
};
|
|
395
121
|
const handleClick = (e) => {
|
|
396
|
-
const
|
|
397
|
-
if (!
|
|
122
|
+
const metrics = getDocumentMetrics();
|
|
123
|
+
if (!metrics)
|
|
398
124
|
return;
|
|
399
125
|
// Check if click was on an actual control. Passive minimap overlays also
|
|
400
126
|
// use pointer-events-auto so they can display hover affordances, but they
|
|
@@ -412,33 +138,22 @@ export function MiniMap({ compareView, deviceHeight, scroll, mainViewIframeRef,
|
|
|
412
138
|
const clickReferenceRect = iframeRect && iframeRect.height > 0 ? iframeRect : containerRect;
|
|
413
139
|
const absY = e.clientY - clickReferenceRect.top;
|
|
414
140
|
const clickRatio = Math.min(1, Math.max(0, absY / clickReferenceRect.height));
|
|
415
|
-
const
|
|
416
|
-
mainViewIframeRef.current?.clientHeight;
|
|
417
|
-
const currentViewportHeight = visibleIframeHeight ||
|
|
418
|
-
scrollContainer.ownerDocument?.defaultView?.innerHeight ||
|
|
419
|
-
scrollContainer.clientHeight ||
|
|
420
|
-
viewport.height;
|
|
421
|
-
const maxScrollTop = Math.max(0, scrollContainer.scrollHeight - currentViewportHeight);
|
|
141
|
+
const maxScrollTop = Math.max(0, metrics.documentHeight - metrics.viewportHeight);
|
|
422
142
|
e.stopPropagation();
|
|
423
143
|
scrollDocumentTo(clickRatio * maxScrollTop);
|
|
424
144
|
};
|
|
425
145
|
const handleScroll = useCallback((e) => {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
scrollContainer.scrollBy({
|
|
430
|
-
behavior: "instant",
|
|
431
|
-
left: 0,
|
|
432
|
-
top: e.deltaY,
|
|
433
|
-
});
|
|
434
|
-
getAccessibleIframeDocument(mainViewIframeRef.current)?.documentElement?.scrollBy({
|
|
146
|
+
pageViewContext.requestBridgeScrollBy?.({
|
|
147
|
+
x: 0,
|
|
148
|
+
y: e.deltaY,
|
|
435
149
|
behavior: "instant",
|
|
436
|
-
left: 0,
|
|
437
|
-
top: e.deltaY,
|
|
438
150
|
});
|
|
439
151
|
e.stopPropagation();
|
|
440
|
-
}, [
|
|
441
|
-
|
|
152
|
+
}, [pageViewContext]);
|
|
153
|
+
const viewportHighlight = minimapMetrics
|
|
154
|
+
? getMinimapViewportHighlight(minimapMetrics, scale)
|
|
155
|
+
: null;
|
|
156
|
+
if (!editContext || !isBridgeMinimap) {
|
|
442
157
|
return null;
|
|
443
158
|
}
|
|
444
159
|
return (_jsxs("div", { "data-testid": "minimap-container", className: "relative cursor-pointer overflow-hidden bg-white", ref: minimapContainerRef, onClickCapture: handleClick, onWheelCapture: handleScroll, style: {
|
|
@@ -447,11 +162,108 @@ export function MiniMap({ compareView, deviceHeight, scroll, mainViewIframeRef,
|
|
|
447
162
|
boxShadow: "5px 0 5px -5px var(--color-neutral-grey-100)",
|
|
448
163
|
}, children: [_jsx("div", { className: "bg-opacity-50 absolute inset-0 overflow-hidden select-none", style: {
|
|
449
164
|
boxShadow: "var(--color-neutral-grey-15) -10px 1px 13px -10px",
|
|
450
|
-
}, children: _jsx("div", { ref: minimapRef, onDragOverCapture: handleClick, className: "h-full w-full", children: _jsx("div", { ref: scaleContainerRef, children: _jsx("iframe", { className: "pointer-events-none", ref: iframeRef,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
165
|
+
}, children: _jsx("div", { ref: minimapRef, onDragOverCapture: handleClick, className: "h-full w-full", children: _jsx("div", { ref: scaleContainerRef, children: _jsx("iframe", { className: "pointer-events-none", ref: iframeRef, sandbox: "", srcDoc: bridgeMinimapHtml, style: {
|
|
166
|
+
border: 0,
|
|
167
|
+
display: "block",
|
|
168
|
+
height: `${minimapMetrics?.documentHeight ?? 0}px`,
|
|
169
|
+
visibility: minimapReady ? "visible" : "hidden",
|
|
170
|
+
width: `${minimapMetrics?.viewportWidth ?? 0}px`,
|
|
171
|
+
} }) }) }) }), _jsx("div", { "aria-hidden": "true", className: "absolute inset-0" }), viewportHighlight && minimapReady && (_jsx("div", { "data-testid": "minimap-viewport-highlight", className: "bg-neutral-grey-10 pointer-events-none absolute w-full opacity-60 hover:opacity-65", style: {
|
|
172
|
+
top: viewportHighlight.top + "px",
|
|
173
|
+
height: viewportHighlight.height + "px",
|
|
174
|
+
} })), iframeRef.current && (_jsxs(IframeOverlayProvider, { iframe: iframeRef.current, mode: "static", scrollScale: 1, visualScale: scale, children: [editContext.mode === "edit" && (_jsx(PlaceholderDropZones, { size: "small", pageViewContext: pageViewContext })), _jsx(FieldEditedIndicators, { pageViewContext: pageViewContext }), editContext.showComments && (_jsx(CommentHighlightings, { pageViewContext: pageViewContext, variant: "minimap" })), editContext.showSuggestedEdits && (_jsx(SuggestionHighlightings, { pageViewContext: pageViewContext, variant: "minimap" })), editContext.showVersionDiffHighlighting && !compareView && (_jsx(VersionDiffHighlightings, { pageViewContext: pageViewContext, variant: "minimap" }))] }))] }));
|
|
175
|
+
}
|
|
176
|
+
function getBridgeMinimapMetrics(snapshot, fallbackViewport, scrollOverride) {
|
|
177
|
+
if (!snapshot)
|
|
178
|
+
return null;
|
|
179
|
+
const viewportWidth = snapshot.viewport.width || fallbackViewport.width || 0;
|
|
180
|
+
const viewportHeight = snapshot.viewport.height || fallbackViewport.height || 0;
|
|
181
|
+
const scrollTop = Math.max(0, scrollOverride ?? snapshot.scroll?.y ?? 0);
|
|
182
|
+
const documentHeight = Math.max(viewportHeight, scrollTop + viewportHeight, snapshot.scrollHeight || 0);
|
|
183
|
+
if (!viewportWidth || !documentHeight)
|
|
184
|
+
return null;
|
|
185
|
+
return {
|
|
186
|
+
viewportWidth,
|
|
187
|
+
viewportHeight,
|
|
188
|
+
documentHeight,
|
|
189
|
+
scrollTop,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function getMinimapViewportHighlight(metrics, scale) {
|
|
193
|
+
const scaledDocumentHeight = metrics.documentHeight * scale;
|
|
194
|
+
const viewportHeight = Math.min(metrics.viewportHeight, metrics.documentHeight);
|
|
195
|
+
const maxScrollTop = Math.max(0, metrics.documentHeight - viewportHeight);
|
|
196
|
+
const top = Math.min(maxScrollTop, Math.max(0, metrics.scrollTop)) * scale;
|
|
197
|
+
const height = Math.min(viewportHeight * scale, Math.max(0, scaledDocumentHeight - top));
|
|
198
|
+
return { top, height };
|
|
199
|
+
}
|
|
200
|
+
function createBridgeMinimapHtml(html, geometry, viewportWidth) {
|
|
201
|
+
if (typeof DOMParser === "undefined")
|
|
202
|
+
return html;
|
|
203
|
+
try {
|
|
204
|
+
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
205
|
+
constrainBridgeMinimapWidth(doc, viewportWidth);
|
|
206
|
+
if (geometry) {
|
|
207
|
+
bakeBridgeGeometryDimensions(doc, geometry);
|
|
208
|
+
}
|
|
209
|
+
return `<!DOCTYPE html>${doc.documentElement.outerHTML}`;
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
return html;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function constrainBridgeMinimapWidth(doc, viewportWidth) {
|
|
216
|
+
if (!viewportWidth || viewportWidth <= 0)
|
|
217
|
+
return;
|
|
218
|
+
[doc.documentElement, doc.body].forEach((element) => {
|
|
219
|
+
if (!element)
|
|
220
|
+
return;
|
|
221
|
+
element.style.setProperty("box-sizing", "border-box", "important");
|
|
222
|
+
element.style.setProperty("width", `${viewportWidth}px`, "important");
|
|
223
|
+
element.style.setProperty("max-width", `${viewportWidth}px`, "important");
|
|
224
|
+
element.style.setProperty("overflow-x", "hidden", "important");
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function bakeBridgeGeometryDimensions(doc, geometry) {
|
|
228
|
+
const keyedElements = Array.from(doc.querySelectorAll("[data-parhelia-element-key]"));
|
|
229
|
+
const componentElements = Array.from(doc.querySelectorAll("[data-component-id], [data-component-start], [data-renderingid], [data-rendering-id]"));
|
|
230
|
+
const fieldElements = Array.from(doc.querySelectorAll("[data-fieldid]"));
|
|
231
|
+
geometry.targets.forEach((target) => {
|
|
232
|
+
if (!target.rect || (target.rect.width <= 0 && target.rect.height <= 0)) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
let element;
|
|
236
|
+
if (target.elementKey) {
|
|
237
|
+
const elementKey = normalizeBridgeKey(target.elementKey);
|
|
238
|
+
element = keyedElements.find((candidate) => normalizeBridgeKey(candidate.getAttribute("data-parhelia-element-key")) === elementKey);
|
|
239
|
+
}
|
|
240
|
+
if (!element && target.kind === "component") {
|
|
241
|
+
const componentKey = normalizeBridgeKey(target.componentId || target.key);
|
|
242
|
+
element = componentElements.find((candidate) => normalizeBridgeKey(candidate.getAttribute("data-component-id") ||
|
|
243
|
+
candidate.getAttribute("data-component-start") ||
|
|
244
|
+
candidate.getAttribute("data-renderingid") ||
|
|
245
|
+
candidate.getAttribute("data-rendering-id")) === componentKey);
|
|
246
|
+
}
|
|
247
|
+
else if (target.kind === "field") {
|
|
248
|
+
const fieldKey = normalizeBridgeKey(target.fieldId || target.key);
|
|
249
|
+
element = fieldElements.find((candidate) => normalizeBridgeKey(candidate.getAttribute("data-fieldid")) ===
|
|
250
|
+
fieldKey);
|
|
251
|
+
}
|
|
252
|
+
if (!element)
|
|
253
|
+
return;
|
|
254
|
+
if (target.kind === "field" || target.kind === "textRange")
|
|
255
|
+
return;
|
|
256
|
+
if (target.rect.width > 0) {
|
|
257
|
+
element.style.setProperty("width", `${target.rect.width}px`, "important");
|
|
258
|
+
element.style.setProperty("min-width", `${target.rect.width}px`, "important");
|
|
259
|
+
}
|
|
260
|
+
if (target.rect.height > 0) {
|
|
261
|
+
element.style.setProperty("height", `${target.rect.height}px`, "important");
|
|
262
|
+
element.style.setProperty("min-height", `${target.rect.height}px`, "important");
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
function normalizeBridgeKey(value) {
|
|
267
|
+
return (value || "").replace(/[{}-]/g, "").toLowerCase();
|
|
456
268
|
}
|
|
457
269
|
//# sourceMappingURL=MiniMap.js.map
|