@parhelia/core 0.4.12818 → 0.4.12871
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/components/emoji/EmojiPicker.d.ts +18 -0
- package/dist/components/emoji/EmojiPicker.js +102 -0
- package/dist/components/emoji/EmojiPicker.js.map +1 -0
- package/dist/components/emoji/EmojiText.d.ts +19 -0
- package/dist/components/emoji/EmojiText.js +30 -0
- package/dist/components/emoji/EmojiText.js.map +1 -0
- package/dist/components/emoji/emojiData.generated.d.ts +2 -0
- package/dist/components/emoji/emojiData.generated.js +1878 -0
- package/dist/components/emoji/emojiData.generated.js.map +1 -0
- package/dist/components/emoji/emojiIndex.d.ts +46 -0
- package/dist/components/emoji/emojiIndex.js +173 -0
- package/dist/components/emoji/emojiIndex.js.map +1 -0
- package/dist/components/emoji/emoticons.d.ts +21 -0
- package/dist/components/emoji/emoticons.js +167 -0
- package/dist/components/emoji/emoticons.js.map +1 -0
- package/dist/components/emoji/textareaInsert.d.ts +19 -0
- package/dist/components/emoji/textareaInsert.js +29 -0
- package/dist/components/emoji/textareaInsert.js.map +1 -0
- package/dist/components/emoji/twemoji.d.ts +30 -0
- package/dist/components/emoji/twemoji.js +84 -0
- package/dist/components/emoji/twemoji.js.map +1 -0
- package/dist/components/ui/alert.d.ts +6 -1
- package/dist/components/ui/alert.js +12 -3
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +25 -0
- package/dist/components/ui/context-menu.js +54 -36
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/copy-button.d.ts +3 -1
- package/dist/components/ui/copy-button.js +13 -2
- package/dist/components/ui/copy-button.js.map +1 -1
- package/dist/components/ui/mention-textarea.d.ts +8 -0
- package/dist/components/ui/mention-textarea.js +98 -46
- package/dist/components/ui/mention-textarea.js.map +1 -1
- package/dist/components/ui/paste-button.js +11 -1
- package/dist/components/ui/paste-button.js.map +1 -1
- package/dist/config/config.js +46 -4
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +2 -0
- package/dist/config/types.js.map +1 -1
- package/dist/editor/ConcurrentUserLimitDialog.js +5 -2
- package/dist/editor/ConcurrentUserLimitDialog.js.map +1 -1
- package/dist/editor/ContentTree.js +7 -2
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/ContextMenu.js +11 -36
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/EditorWarning.js +8 -4
- package/dist/editor/EditorWarning.js.map +1 -1
- package/dist/editor/FieldList.js +1 -1
- package/dist/editor/FieldList.js.map +1 -1
- package/dist/editor/FieldListField.js +18 -13
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/FieldListFieldWithFallbacks.js +1 -1
- package/dist/editor/GlobalMenuBar.js +2 -1
- package/dist/editor/GlobalMenuBar.js.map +1 -1
- package/dist/editor/ImageEditor.js +3 -1
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/MainLayout.js +1 -1
- package/dist/editor/MainLayout.js.map +1 -1
- package/dist/editor/MigrationsView.js +3 -2
- package/dist/editor/MigrationsView.js.map +1 -1
- package/dist/editor/MobileLayout.js +43 -20
- package/dist/editor/MobileLayout.js.map +1 -1
- package/dist/editor/PictureEditor.js +4 -2
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/QuickItemSwitcher.js +4 -2
- package/dist/editor/QuickItemSwitcher.js.map +1 -1
- package/dist/editor/agent-changes/agentChangeTargets.js +6 -0
- package/dist/editor/agent-changes/agentChangeTargets.js.map +1 -1
- package/dist/editor/agent-changes/agentChangeTextHighlight.d.ts +48 -4
- package/dist/editor/agent-changes/agentChangeTextHighlight.js +67 -9
- package/dist/editor/agent-changes/agentChangeTextHighlight.js.map +1 -1
- package/dist/editor/ai/AgentStatusBadge.js +11 -9
- package/dist/editor/ai/AgentStatusBadge.js.map +1 -1
- package/dist/editor/ai/Agents.js +2 -2
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/HeartbeatDiagnosticsPanel.js +1 -1
- package/dist/editor/ai/InlineAiDialog.js +11 -8
- package/dist/editor/ai/InlineAiDialog.js.map +1 -1
- package/dist/editor/ai/InlineAiTrigger.js +18 -14
- package/dist/editor/ai/InlineAiTrigger.js.map +1 -1
- package/dist/editor/ai/agentActivitySummary.js +5 -0
- package/dist/editor/ai/agentActivitySummary.js.map +1 -1
- package/dist/editor/ai/agentDiagnostics.d.ts +1 -1
- package/dist/editor/ai/agentDiagnostics.js +8 -0
- package/dist/editor/ai/agentDiagnostics.js.map +1 -1
- package/dist/editor/ai/agentMessageConversion.js +1 -0
- package/dist/editor/ai/agentMessageConversion.js.map +1 -1
- package/dist/editor/ai/agentMessageMarkdown.js +4 -4
- package/dist/editor/ai/agentMessageMarkdown.js.map +1 -1
- package/dist/editor/ai/dialogs/capturePageScreenshot.d.ts +4 -1
- package/dist/editor/ai/dialogs/capturePageScreenshot.js +214 -44
- package/dist/editor/ai/dialogs/capturePageScreenshot.js.map +1 -1
- package/dist/editor/ai/dialogs/captureShared.d.ts +8 -1
- package/dist/editor/ai/dialogs/captureShared.js +4 -1
- package/dist/editor/ai/dialogs/captureShared.js.map +1 -1
- package/dist/editor/ai/dialogs/offscreenPageCapture.js +1 -1
- package/dist/editor/ai/dialogs/offscreenPageCapture.js.map +1 -1
- package/dist/editor/ai/prepareInlineAiTextSelection.d.ts +2 -1
- package/dist/editor/ai/prepareInlineAiTextSelection.js +1 -2
- package/dist/editor/ai/prepareInlineAiTextSelection.js.map +1 -1
- package/dist/editor/ai/terminal/agentCost.d.ts +2 -0
- package/dist/editor/ai/terminal/agentCost.js +1 -0
- package/dist/editor/ai/terminal/agentCost.js.map +1 -1
- package/dist/editor/ai/terminal/agentSessionLiveTotals.js +3 -0
- package/dist/editor/ai/terminal/agentSessionLiveTotals.js.map +1 -1
- package/dist/editor/ai/terminal/agentSessionSelectors.d.ts +5 -2
- package/dist/editor/ai/terminal/agentSessionSelectors.js +5 -2
- package/dist/editor/ai/terminal/agentSessionSelectors.js.map +1 -1
- package/dist/editor/ai/terminal/agentSessionSnapshot.d.ts +15 -0
- package/dist/editor/ai/terminal/agentSessionSnapshot.js +103 -3
- package/dist/editor/ai/terminal/agentSessionSnapshot.js.map +1 -1
- package/dist/editor/ai/terminal/agentSessionState.js +13 -2
- package/dist/editor/ai/terminal/agentSessionState.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentActivityOverviewPanel.js +7 -7
- package/dist/editor/ai/terminal/components/AgentActivityOverviewPanel.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentBanners.js +2 -2
- package/dist/editor/ai/terminal/components/AgentBanners.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentCostDisplay.d.ts +2 -0
- package/dist/editor/ai/terminal/components/AgentCostDisplay.js +2 -1
- package/dist/editor/ai/terminal/components/AgentCostDisplay.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.js +1 -1
- package/dist/editor/ai/terminal/components/AgentFullPromptControls.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentModeSelector.js +7 -3
- package/dist/editor/ai/terminal/components/AgentModeSelector.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptActionButtons.js +3 -3
- package/dist/editor/ai/terminal/components/AgentPromptActionButtons.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptInputArea.js +2 -2
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js +1 -1
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentReadOnlyNotice.js +1 -1
- package/dist/editor/ai/terminal/components/AgentReadOnlyNotice.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentSkillSettingsSection.js +2 -2
- package/dist/editor/ai/terminal/components/AgentSkillSettingsSection.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.js +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.d.ts +5 -2
- package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js +43 -4
- package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.js +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.js.map +1 -1
- package/dist/editor/ai/terminal/components/AiResponseMessage.js +40 -22
- package/dist/editor/ai/terminal/components/AiResponseMessage.js.map +1 -1
- package/dist/editor/ai/terminal/components/ApprovalCard.d.ts +3 -1
- package/dist/editor/ai/terminal/components/ApprovalCard.js +8 -16
- package/dist/editor/ai/terminal/components/ApprovalCard.js.map +1 -1
- package/dist/editor/ai/terminal/components/ContextInfoBar.js +1 -1
- package/dist/editor/ai/terminal/components/ContextInfoBar.js.map +1 -1
- package/dist/editor/ai/terminal/components/CreateItemToolCallContent.js +1 -1
- package/dist/editor/ai/terminal/components/CreateItemToolCallContent.js.map +1 -1
- package/dist/editor/ai/terminal/components/EditFieldToolCallContent.d.ts +7 -4
- package/dist/editor/ai/terminal/components/EditFieldToolCallContent.js +57 -32
- package/dist/editor/ai/terminal/components/EditFieldToolCallContent.js.map +1 -1
- package/dist/editor/ai/terminal/components/ResponseTurnDuration.js +1 -2
- package/dist/editor/ai/terminal/components/ResponseTurnDuration.js.map +1 -1
- package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.d.ts +6 -0
- package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.js +61 -0
- package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.js.map +1 -0
- package/dist/editor/ai/terminal/components/ToolCallDisplay.d.ts +5 -0
- package/dist/editor/ai/terminal/components/ToolCallDisplay.js +19 -8
- package/dist/editor/ai/terminal/components/ToolCallDisplay.js.map +1 -1
- package/dist/editor/ai/terminal/components/UserMessage.js +4 -2
- package/dist/editor/ai/terminal/components/UserMessage.js.map +1 -1
- package/dist/editor/ai/terminal/components/ValueDiff.js +1 -1
- package/dist/editor/ai/terminal/components/ValueDiff.js.map +1 -1
- package/dist/editor/ai/terminal/components/toolCallContentRenderers.js +7 -4
- package/dist/editor/ai/terminal/components/toolCallContentRenderers.js.map +1 -1
- package/dist/editor/ai/terminal/components/useApprovalActions.js +1 -1
- package/dist/editor/ai/terminal/components/useApprovalActions.js.map +1 -1
- package/dist/editor/ai/terminal/toolCallDiagnostics.d.ts +34 -0
- package/dist/editor/ai/terminal/toolCallDiagnostics.js +218 -0
- package/dist/editor/ai/terminal/toolCallDiagnostics.js.map +1 -0
- package/dist/editor/ai/terminal/types.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentEditorContext.js +16 -4
- package/dist/editor/ai/terminal/useAgentEditorContext.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentLoadPipeline.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentLoadPipeline.js +2 -1
- package/dist/editor/ai/terminal/useAgentLoadPipeline.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentLoader.d.ts +2 -0
- package/dist/editor/ai/terminal/useAgentLoader.js +17 -2
- package/dist/editor/ai/terminal/useAgentLoader.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentModeState.d.ts +5 -1
- package/dist/editor/ai/terminal/useAgentModeState.js +11 -3
- package/dist/editor/ai/terminal/useAgentModeState.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentOperationHistoryLoader.js +5 -1
- package/dist/editor/ai/terminal/useAgentOperationHistoryLoader.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentOperationSocketHandler.js +33 -1
- package/dist/editor/ai/terminal/useAgentOperationSocketHandler.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.js +5 -1
- package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentRunRefs.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentRunRefs.js +3 -0
- package/dist/editor/ai/terminal/useAgentRunRefs.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentServerReconciler.js +11 -0
- package/dist/editor/ai/terminal/useAgentServerReconciler.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentSessionSync.d.ts +6 -0
- package/dist/editor/ai/terminal/useAgentSessionSync.js +27 -3
- package/dist/editor/ai/terminal/useAgentSessionSync.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentSettingsData.d.ts +1 -1
- package/dist/editor/ai/terminal/useAgentSettingsPanel.js +7 -6
- package/dist/editor/ai/terminal/useAgentSettingsPanel.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentSettingsSelectOptions.js +14 -2
- package/dist/editor/ai/terminal/useAgentSettingsSelectOptions.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentStatusBarContent.js +11 -4
- package/dist/editor/ai/terminal/useAgentStatusBarContent.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentStreamPipeline.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentStreamPipeline.js +2 -1
- package/dist/editor/ai/terminal/useAgentStreamPipeline.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.d.ts +1 -0
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.js +17 -4
- package/dist/editor/ai/terminal/useAgentSubmitHandlers.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentTerminalController.js +7 -1
- package/dist/editor/ai/terminal/useAgentTerminalController.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentToolCallHandler.js +1 -0
- package/dist/editor/ai/terminal/useAgentToolCallHandler.js.map +1 -1
- package/dist/editor/ai/types.d.ts +4 -0
- package/dist/editor/ai-image-editor/AiImageEditorDialog.d.ts +33 -0
- package/dist/editor/ai-image-editor/AiImageEditorDialog.js +372 -127
- package/dist/editor/ai-image-editor/AiImageEditorDialog.js.map +1 -1
- package/dist/editor/ai-image-editor/AiImageResultOverlay.js +4 -2
- package/dist/editor/ai-image-editor/AiImageResultOverlay.js.map +1 -1
- package/dist/editor/bridge/BridgeClient.js +11 -0
- package/dist/editor/bridge/BridgeClient.js.map +1 -1
- package/dist/editor/bridge/protocol.d.ts +61 -0
- package/dist/editor/bridge/protocol.js +3 -0
- package/dist/editor/bridge/protocol.js.map +1 -1
- package/dist/editor/client/EditorShell.js +335 -125
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/SessionExpiredOverlay.js +9 -2
- package/dist/editor/client/SessionExpiredOverlay.js.map +1 -1
- package/dist/editor/client/clipboardStorage.d.ts +10 -0
- package/dist/editor/client/clipboardStorage.js +57 -0
- package/dist/editor/client/clipboardStorage.js.map +1 -0
- package/dist/editor/client/editContext.d.ts +92 -11
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/editHistoryReconciliation.d.ts +2 -1
- package/dist/editor/client/editHistoryReconciliation.js +5 -2
- package/dist/editor/client/editHistoryReconciliation.js.map +1 -1
- package/dist/editor/client/hooks/useRepositoryItemRefresh.d.ts +4 -0
- package/dist/editor/client/hooks/useRepositoryItemRefresh.js +62 -0
- package/dist/editor/client/hooks/useRepositoryItemRefresh.js.map +1 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.d.ts +6 -0
- package/dist/editor/client/hooks/useSocketMessageHandler.js +69 -4
- package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
- package/dist/editor/client/itemsRepository.d.ts +10 -2
- package/dist/editor/client/itemsRepository.js +224 -43
- package/dist/editor/client/itemsRepository.js.map +1 -1
- package/dist/editor/client/liveEditState.d.ts +16 -0
- package/dist/editor/client/liveEditState.js +25 -0
- package/dist/editor/client/liveEditState.js.map +1 -0
- package/dist/editor/client/liveSessionState.d.ts +6 -0
- package/dist/editor/client/liveSessionState.js +20 -0
- package/dist/editor/client/liveSessionState.js.map +1 -0
- package/dist/editor/client/operations.d.ts +13 -2
- package/dist/editor/client/operations.js +134 -31
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +74 -7
- package/dist/editor/client/pageModelBuilder.js.map +1 -1
- package/dist/editor/client/ui/EditorChrome.d.ts +2 -2
- package/dist/editor/client/ui/EditorChrome.js +12 -8
- package/dist/editor/client/ui/EditorChrome.js.map +1 -1
- package/dist/editor/client/ui/FullscreenControls.d.ts +3 -5
- package/dist/editor/client/ui/FullscreenControls.js +2 -2
- package/dist/editor/client/ui/FullscreenControls.js.map +1 -1
- package/dist/editor/client/valueStore.d.ts +22 -0
- package/dist/editor/client/valueStore.js +29 -0
- package/dist/editor/client/valueStore.js.map +1 -0
- package/dist/editor/commands/commands.d.ts +6 -0
- package/dist/editor/commands/commands.js.map +1 -1
- package/dist/editor/commands/componentClipboardCommands.d.ts +35 -0
- package/dist/editor/commands/componentClipboardCommands.js +271 -0
- package/dist/editor/commands/componentClipboardCommands.js.map +1 -0
- package/dist/editor/commands/componentCommands.js +80 -19
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/commands/componentMenuGroups.d.ts +2 -0
- package/dist/editor/commands/componentMenuGroups.js +43 -0
- package/dist/editor/commands/componentMenuGroups.js.map +1 -0
- package/dist/editor/commands/itemCommands.d.ts +9 -0
- package/dist/editor/commands/itemCommands.js +76 -9
- package/dist/editor/commands/itemCommands.js.map +1 -1
- package/dist/editor/component-conversion/ComponentTypePickerDialog.d.ts +12 -0
- package/dist/editor/component-conversion/ComponentTypePickerDialog.js +40 -0
- package/dist/editor/component-conversion/ComponentTypePickerDialog.js.map +1 -0
- package/dist/editor/component-conversion/ConversionAiDebugButton.d.ts +17 -0
- package/dist/editor/component-conversion/ConversionAiDebugButton.js +80 -0
- package/dist/editor/component-conversion/ConversionAiDebugButton.js.map +1 -0
- package/dist/editor/component-conversion/ConvertComponentDialog.d.ts +28 -0
- package/dist/editor/component-conversion/ConvertComponentDialog.js +633 -0
- package/dist/editor/component-conversion/ConvertComponentDialog.js.map +1 -0
- package/dist/editor/component-conversion/conversionModel.d.ts +109 -0
- package/dist/editor/component-conversion/conversionModel.js +519 -0
- package/dist/editor/component-conversion/conversionModel.js.map +1 -0
- package/dist/editor/component-conversion/conversionService.d.ts +12 -0
- package/dist/editor/component-conversion/conversionService.js +16 -0
- package/dist/editor/component-conversion/conversionService.js.map +1 -0
- package/dist/editor/component-conversion/conversionTypes.d.ts +214 -0
- package/dist/editor/component-conversion/conversionTypes.js +2 -0
- package/dist/editor/component-conversion/conversionTypes.js.map +1 -0
- package/dist/editor/component-conversion/convertComponentsCommand.d.ts +25 -0
- package/dist/editor/component-conversion/convertComponentsCommand.js +196 -0
- package/dist/editor/component-conversion/convertComponentsCommand.js.map +1 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +4 -4
- package/dist/editor/editor-warnings/ValidationErrors.js.map +1 -1
- package/dist/editor/field-types/AttachmentEditor.js +4 -3
- package/dist/editor/field-types/AttachmentEditor.js.map +1 -1
- package/dist/editor/field-types/DateFieldEditor.js +2 -1
- package/dist/editor/field-types/DateFieldEditor.js.map +1 -1
- package/dist/editor/field-types/DateTimeFieldEditor.js +2 -1
- package/dist/editor/field-types/DateTimeFieldEditor.js.map +1 -1
- package/dist/editor/field-types/DropLinkEditor.js +3 -1
- package/dist/editor/field-types/DropLinkEditor.js.map +1 -1
- package/dist/editor/field-types/DropListEditor.js +3 -1
- package/dist/editor/field-types/DropListEditor.js.map +1 -1
- package/dist/editor/field-types/FieldHistoryBoundary.js +28 -7
- package/dist/editor/field-types/FieldHistoryBoundary.js.map +1 -1
- package/dist/editor/field-types/ImageFieldEditor.js +3 -1
- package/dist/editor/field-types/ImageFieldEditor.js.map +1 -1
- package/dist/editor/field-types/InternalLinkFieldEditor.js +2 -1
- package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -1
- package/dist/editor/field-types/LinkFieldEditor.js +2 -1
- package/dist/editor/field-types/LinkFieldEditor.js.map +1 -1
- package/dist/editor/field-types/MultiLineText.js +68 -22
- package/dist/editor/field-types/MultiLineText.js.map +1 -1
- package/dist/editor/field-types/NameValueListEditor.js +3 -1
- package/dist/editor/field-types/NameValueListEditor.js.map +1 -1
- package/dist/editor/field-types/PictureFieldEditor.js +4 -2
- package/dist/editor/field-types/PictureFieldEditor.js.map +1 -1
- package/dist/editor/field-types/RawEditor.js +7 -4
- package/dist/editor/field-types/RawEditor.js.map +1 -1
- package/dist/editor/field-types/RichTextEditor.d.ts +1 -2
- package/dist/editor/field-types/RichTextEditor.js +5 -26
- package/dist/editor/field-types/RichTextEditor.js.map +1 -1
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +1 -2
- package/dist/editor/field-types/RichTextEditorComponent.js +121 -26
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -1
- package/dist/editor/field-types/SingleLineText.js +68 -22
- package/dist/editor/field-types/SingleLineText.js.map +1 -1
- package/dist/editor/field-types/TreeListEditor.js +4 -2
- package/dist/editor/field-types/TreeListEditor.js.map +1 -1
- package/dist/editor/field-types/fieldStyles.d.ts +21 -0
- package/dist/editor/field-types/fieldStyles.js +22 -0
- package/dist/editor/field-types/fieldStyles.js.map +1 -0
- package/dist/editor/field-types/richtext/bridgeRichTextProfile.d.ts +15 -1
- package/dist/editor/field-types/richtext/bridgeRichTextProfile.js +27 -0
- package/dist/editor/field-types/richtext/bridgeRichTextProfile.js.map +1 -1
- package/dist/editor/field-types/richtext/components/EditorDropdown.css +14 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.d.ts +3 -1
- package/dist/editor/field-types/richtext/components/EditorDropdown.js +33 -8
- package/dist/editor/field-types/richtext/components/EditorDropdown.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.css +23 -54
- package/dist/editor/field-types/richtext/components/ReactSlate.d.ts +10 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.js +373 -174
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js +1 -1
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ToolbarButton.js +13 -5
- package/dist/editor/field-types/richtext/components/ToolbarButton.js.map +1 -1
- package/dist/editor/field-types/richtext/config/pluginFactory.d.ts +2 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.js +2 -1
- package/dist/editor/field-types/richtext/config/pluginFactory.js.map +1 -1
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js +1 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js.map +1 -1
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.d.ts +0 -2
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js +2 -5
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js.map +1 -1
- package/dist/editor/field-types/richtext/types.d.ts +47 -2
- package/dist/editor/field-types/richtext/types.js +19 -0
- package/dist/editor/field-types/richtext/types.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/changeHighlight.d.ts +14 -0
- package/dist/editor/field-types/richtext/utils/changeHighlight.js +12 -1
- package/dist/editor/field-types/richtext/utils/changeHighlight.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/conversion.js +108 -32
- package/dist/editor/field-types/richtext/utils/conversion.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/cssClasses.d.ts +27 -0
- package/dist/editor/field-types/richtext/utils/cssClasses.js +98 -0
- package/dist/editor/field-types/richtext/utils/cssClasses.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/plugins.d.ts +40 -1
- package/dist/editor/field-types/richtext/utils/plugins.js +178 -4
- package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/profileMapper.d.ts +17 -1
- package/dist/editor/field-types/richtext/utils/profileMapper.js +153 -55
- package/dist/editor/field-types/richtext/utils/profileMapper.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/spellCheckText.d.ts +31 -0
- package/dist/editor/field-types/richtext/utils/spellCheckText.js +82 -0
- package/dist/editor/field-types/richtext/utils/spellCheckText.js.map +1 -0
- package/dist/editor/field-types/useFocusedFieldInput.d.ts +13 -0
- package/dist/editor/field-types/useFocusedFieldInput.js +50 -0
- package/dist/editor/field-types/useFocusedFieldInput.js.map +1 -0
- package/dist/editor/field-types/useFormFieldCaretPresence.js +9 -1
- package/dist/editor/field-types/useFormFieldCaretPresence.js.map +1 -1
- package/dist/editor/field-types/useFormFieldSelectionRange.d.ts +20 -13
- package/dist/editor/field-types/useFormFieldSelectionRange.js +40 -14
- package/dist/editor/field-types/useFormFieldSelectionRange.js.map +1 -1
- package/dist/editor/find-replace/FindReplacePanel.d.ts +11 -0
- package/dist/editor/find-replace/FindReplacePanel.js +311 -0
- package/dist/editor/find-replace/FindReplacePanel.js.map +1 -0
- package/dist/editor/find-replace/findReplaceCommand.d.ts +8 -0
- package/dist/editor/find-replace/findReplaceCommand.js +25 -0
- package/dist/editor/find-replace/findReplaceCommand.js.map +1 -0
- package/dist/editor/find-replace/findReplaceMatches.d.ts +42 -0
- package/dist/editor/find-replace/findReplaceMatches.js +66 -0
- package/dist/editor/find-replace/findReplaceMatches.js.map +1 -0
- package/dist/editor/find-replace/findReplaceStore.d.ts +30 -0
- package/dist/editor/find-replace/findReplaceStore.js +61 -0
- package/dist/editor/find-replace/findReplaceStore.js.map +1 -0
- package/dist/editor/find-replace/findReplaceTargets.d.ts +51 -0
- package/dist/editor/find-replace/findReplaceTargets.js +110 -0
- package/dist/editor/find-replace/findReplaceTargets.js.map +1 -0
- package/dist/editor/find-replace/findReplaceText.d.ts +50 -0
- package/dist/editor/find-replace/findReplaceText.js +189 -0
- package/dist/editor/find-replace/findReplaceText.js.map +1 -0
- package/dist/editor/itemContextMenuGroups.js +10 -1
- package/dist/editor/itemContextMenuGroups.js.map +1 -1
- package/dist/editor/media-selector/AiImageSearch.js +1 -163
- package/dist/editor/media-selector/AiImageSearch.js.map +1 -1
- package/dist/editor/media-selector/MediaDetailsView.d.ts +14 -0
- package/dist/editor/media-selector/MediaDetailsView.js +152 -0
- package/dist/editor/media-selector/MediaDetailsView.js.map +1 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js +326 -106
- package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -1
- package/dist/editor/media-selector/TreeSelector.js +40 -2
- package/dist/editor/media-selector/TreeSelector.js.map +1 -1
- package/dist/editor/media-selector/UploadZone.js +1 -1
- package/dist/editor/media-selector/UploadZone.js.map +1 -1
- package/dist/editor/media-selector/useMediaFolderDrag.d.ts +26 -0
- package/dist/editor/media-selector/useMediaFolderDrag.js +153 -0
- package/dist/editor/media-selector/useMediaFolderDrag.js.map +1 -0
- package/dist/editor/menubar/ActiveUsers.js +6 -4
- package/dist/editor/menubar/ActiveUsers.js.map +1 -1
- package/dist/editor/menubar/PageSelector.js +21 -22
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/menubar/ToolbarFactory.js +16 -2
- package/dist/editor/menubar/ToolbarFactory.js.map +1 -1
- package/dist/editor/menubar/VersionPreviewCard.js +4 -2
- package/dist/editor/menubar/VersionPreviewCard.js.map +1 -1
- package/dist/editor/menubar/VersionSelector.js +2 -2
- package/dist/editor/menubar/VersionSelector.js.map +1 -1
- package/dist/editor/menubar/WorkflowButton.js +10 -10
- package/dist/editor/menubar/WorkflowButton.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.d.ts +13 -0
- package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.js +88 -0
- package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.d.ts +3 -4
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js +15 -13
- package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/EditControls.d.ts +9 -0
- package/dist/editor/menubar/toolbar-sections/EditControls.js +24 -1
- package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/FindReplaceControls.d.ts +6 -0
- package/dist/editor/menubar/toolbar-sections/FindReplaceControls.js +31 -0
- package/dist/editor/menubar/toolbar-sections/FindReplaceControls.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/FullscreenControl.js +3 -2
- package/dist/editor/menubar/toolbar-sections/FullscreenControl.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/InsertControls.js +4 -2
- package/dist/editor/menubar/toolbar-sections/InsertControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/LayoutModeControls.js +3 -2
- package/dist/editor/menubar/toolbar-sections/LayoutModeControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.js +2 -2
- package/dist/editor/menubar/toolbar-sections/ReviewCommands.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.d.ts +5 -0
- package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.js +16 -0
- package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.js.map +1 -0
- package/dist/editor/menubar/toolbar-sections/UndoRedoControls.js +2 -2
- package/dist/editor/menubar/toolbar-sections/UndoRedoControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +7 -7
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ViewportControls.d.ts +3 -4
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js +19 -31
- package/dist/editor/menubar/toolbar-sections/ViewportControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/index.d.ts +2 -1
- package/dist/editor/menubar/toolbar-sections/index.js +2 -1
- package/dist/editor/menubar/toolbar-sections/index.js.map +1 -1
- package/dist/editor/mobileBottomPanel.d.ts +40 -0
- package/dist/editor/mobileBottomPanel.js +63 -0
- package/dist/editor/mobileBottomPanel.js.map +1 -0
- package/dist/editor/notifications/useNotifications.js +12 -17
- package/dist/editor/notifications/useNotifications.js.map +1 -1
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.d.ts +3 -6
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js +8 -6
- package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.d.ts +5 -1
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js +60 -10
- package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.d.ts +6 -0
- package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.js +100 -0
- package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.js.map +1 -0
- package/dist/editor/page-editor-chrome/BridgeToolbarDropdown.d.ts +16 -0
- package/dist/editor/page-editor-chrome/BridgeToolbarDropdown.js +23 -0
- package/dist/editor/page-editor-chrome/BridgeToolbarDropdown.js.map +1 -0
- package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.d.ts +9 -0
- package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.js +32 -0
- package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -1
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +195 -388
- package/dist/editor/page-editor-chrome/CommentHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.d.ts +14 -0
- package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.js +110 -0
- package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.js.map +1 -0
- package/dist/editor/page-editor-chrome/ConversionIndicators.d.ts +8 -0
- package/dist/editor/page-editor-chrome/ConversionIndicators.js +75 -0
- package/dist/editor/page-editor-chrome/ConversionIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.d.ts +9 -13
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js +25 -20
- package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.js +21 -17
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.d.ts +1 -1
- package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.js +9 -6
- package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.js.map +1 -1
- package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.d.ts +15 -0
- package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.js +31 -0
- package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +1 -1
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +14 -7
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +10 -6
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/FindReplaceHighlightings.d.ts +11 -0
- package/dist/editor/page-editor-chrome/FindReplaceHighlightings.js +120 -0
- package/dist/editor/page-editor-chrome/FindReplaceHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js +13 -11
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +1 -1
- package/dist/editor/page-editor-chrome/FrameMenus.js +7 -5
- package/dist/editor/page-editor-chrome/FrameMenus.js.map +1 -1
- package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.d.ts +2 -2
- package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.js +20 -39
- package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.js.map +1 -1
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -1
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +27 -21
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/NoLayout.js +5 -3
- package/dist/editor/page-editor-chrome/NoLayout.js.map +1 -1
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +1 -1
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +30 -23
- package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -1
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -1
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +24 -21
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +10 -4
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +11 -10
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -1
- package/dist/editor/page-editor-chrome/SpellCheckHighlightings.d.ts +12 -0
- package/dist/editor/page-editor-chrome/SpellCheckHighlightings.js +197 -0
- package/dist/editor/page-editor-chrome/SpellCheckHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.d.ts +1 -1
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +226 -381
- package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/ValidationRulerMarks.d.ts +11 -0
- package/dist/editor/page-editor-chrome/ValidationRulerMarks.js +56 -0
- package/dist/editor/page-editor-chrome/ValidationRulerMarks.js.map +1 -0
- package/dist/editor/page-editor-chrome/VersionDiffHighlightings.d.ts +1 -1
- package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js +11 -8
- package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js.map +1 -1
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.d.ts +15 -2
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js +70 -9
- package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js.map +1 -1
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.d.ts +44 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.js +89 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.d.ts +17 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.js +53 -0
- package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/geometry.d.ts +15 -0
- package/dist/editor/page-editor-chrome/overlay/geometry.js +40 -0
- package/dist/editor/page-editor-chrome/overlay/geometry.js.map +1 -1
- package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.d.ts +11 -0
- package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.js +84 -0
- package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.d.ts +34 -0
- package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.js +229 -0
- package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.d.ts +9 -0
- package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.js +34 -0
- package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.js.map +1 -0
- package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.d.ts +49 -0
- package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.js +241 -0
- package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.js.map +1 -0
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.d.ts +7 -0
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js +63 -5
- package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js.map +1 -1
- package/dist/editor/page-editor-chrome/useBridgeRichTextFieldOptions.d.ts +12 -0
- package/dist/editor/page-editor-chrome/useBridgeRichTextFieldOptions.js +79 -0
- package/dist/editor/page-editor-chrome/useBridgeRichTextFieldOptions.js.map +1 -0
- package/dist/editor/page-editor-chrome/useComponentDragHandle.js +1 -1
- package/dist/editor/page-editor-chrome/useComponentDragHandle.js.map +1 -1
- package/dist/editor/page-editor-chrome/useDragInsertionGesture.js +1 -1
- package/dist/editor/page-editor-chrome/useDragInsertionGesture.js.map +1 -1
- package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.d.ts +1 -1
- package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.js +4 -2
- package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.js.map +1 -1
- package/dist/editor/page-viewer/CanvasOverviewRuler.d.ts +11 -0
- package/dist/editor/page-viewer/CanvasOverviewRuler.js +65 -0
- package/dist/editor/page-viewer/CanvasOverviewRuler.js.map +1 -0
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +1 -1
- package/dist/editor/page-viewer/DeviceToolbar.js +8 -3
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -1
- package/dist/editor/page-viewer/DynamicRenderingsBar.d.ts +23 -0
- package/dist/editor/page-viewer/DynamicRenderingsBar.js +28 -0
- package/dist/editor/page-viewer/DynamicRenderingsBar.js.map +1 -0
- package/dist/editor/page-viewer/DynamicRenderingsStrip.d.ts +18 -0
- package/dist/editor/page-viewer/DynamicRenderingsStrip.js +29 -0
- package/dist/editor/page-viewer/DynamicRenderingsStrip.js.map +1 -0
- package/dist/editor/page-viewer/EditorForm.js +29 -24
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/page-viewer/FeedbackMargin.d.ts +57 -0
- package/dist/editor/page-viewer/FeedbackMargin.js +378 -0
- package/dist/editor/page-viewer/FeedbackMargin.js.map +1 -0
- package/dist/editor/page-viewer/FeedbackMarginController.d.ts +76 -0
- package/dist/editor/page-viewer/FeedbackMarginController.js +241 -0
- package/dist/editor/page-viewer/FeedbackMarginController.js.map +1 -0
- package/dist/editor/page-viewer/FeedbackMarginMarker.d.ts +16 -0
- package/dist/editor/page-viewer/FeedbackMarginMarker.js +24 -0
- package/dist/editor/page-viewer/FeedbackMarginMarker.js.map +1 -0
- package/dist/editor/page-viewer/FeedbackMarginResizeHandle.d.ts +23 -0
- package/dist/editor/page-viewer/FeedbackMarginResizeHandle.js +105 -0
- package/dist/editor/page-viewer/FeedbackMarginResizeHandle.js.map +1 -0
- package/dist/editor/page-viewer/InteractivePreviewBar.d.ts +24 -0
- package/dist/editor/page-viewer/InteractivePreviewBar.js +31 -0
- package/dist/editor/page-viewer/InteractivePreviewBar.js.map +1 -0
- package/dist/editor/page-viewer/MiniMap.d.ts +15 -5
- package/dist/editor/page-viewer/MiniMap.js +175 -67
- package/dist/editor/page-viewer/MiniMap.js.map +1 -1
- package/dist/editor/page-viewer/MinimapDropTargets.d.ts +1 -1
- package/dist/editor/page-viewer/MinimapDropTargets.js +9 -7
- package/dist/editor/page-viewer/MinimapDropTargets.js.map +1 -1
- package/dist/editor/page-viewer/MobileCommentsPanel.d.ts +16 -0
- package/dist/editor/page-viewer/MobileCommentsPanel.js +112 -0
- package/dist/editor/page-viewer/MobileCommentsPanel.js.map +1 -0
- package/dist/editor/page-viewer/PageViewer.js +22 -67
- package/dist/editor/page-viewer/PageViewer.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +1 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +631 -229
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/RenderingAiCheck.d.ts +18 -0
- package/dist/editor/page-viewer/RenderingAiCheck.js +45 -0
- package/dist/editor/page-viewer/RenderingAiCheck.js.map +1 -0
- package/dist/editor/page-viewer/RenderingApprovalDialog.d.ts +32 -0
- package/dist/editor/page-viewer/RenderingApprovalDialog.js +191 -0
- package/dist/editor/page-viewer/RenderingApprovalDialog.js.map +1 -0
- package/dist/editor/page-viewer/SealedClientCodePreview.d.ts +17 -0
- package/dist/editor/page-viewer/SealedClientCodePreview.js +38 -0
- package/dist/editor/page-viewer/SealedClientCodePreview.js.map +1 -0
- package/dist/editor/page-viewer/bridgeFieldPatch.d.ts +9 -0
- package/dist/editor/page-viewer/bridgeFieldPatch.js +21 -0
- package/dist/editor/page-viewer/bridgeFieldPatch.js.map +1 -1
- package/dist/editor/page-viewer/bridgeInlineEditSession.js +8 -0
- package/dist/editor/page-viewer/bridgeInlineEditSession.js.map +1 -1
- package/dist/editor/page-viewer/bridgeKeyboardShortcuts.d.ts +6 -0
- package/dist/editor/page-viewer/bridgeKeyboardShortcuts.js +19 -1
- package/dist/editor/page-viewer/bridgeKeyboardShortcuts.js.map +1 -1
- package/dist/editor/page-viewer/canvasFrameNavigation.d.ts +18 -0
- package/dist/editor/page-viewer/canvasFrameNavigation.js +36 -0
- package/dist/editor/page-viewer/canvasFrameNavigation.js.map +1 -0
- package/dist/editor/page-viewer/canvasLoadSettling.d.ts +42 -0
- package/dist/editor/page-viewer/canvasLoadSettling.js +46 -0
- package/dist/editor/page-viewer/canvasLoadSettling.js.map +1 -0
- package/dist/editor/page-viewer/canvasScrollHandoff.d.ts +34 -0
- package/dist/editor/page-viewer/canvasScrollHandoff.js +55 -0
- package/dist/editor/page-viewer/canvasScrollHandoff.js.map +1 -0
- package/dist/editor/page-viewer/feedbackMarginLayout.d.ts +119 -0
- package/dist/editor/page-viewer/feedbackMarginLayout.js +155 -0
- package/dist/editor/page-viewer/feedbackMarginLayout.js.map +1 -0
- package/dist/editor/page-viewer/feedbackMarginSources.d.ts +36 -0
- package/dist/editor/page-viewer/feedbackMarginSources.js +196 -0
- package/dist/editor/page-viewer/feedbackMarginSources.js.map +1 -0
- package/dist/editor/page-viewer/feedbackMarginWidth.d.ts +43 -0
- package/dist/editor/page-viewer/feedbackMarginWidth.js +107 -0
- package/dist/editor/page-viewer/feedbackMarginWidth.js.map +1 -0
- package/dist/editor/page-viewer/interactivePreview.d.ts +168 -0
- package/dist/editor/page-viewer/interactivePreview.js +344 -0
- package/dist/editor/page-viewer/interactivePreview.js.map +1 -0
- package/dist/editor/page-viewer/minimapViewport.d.ts +2 -0
- package/dist/editor/page-viewer/minimapViewport.js +34 -0
- package/dist/editor/page-viewer/minimapViewport.js.map +1 -0
- package/dist/editor/page-viewer/openPageItems.d.ts +29 -0
- package/dist/editor/page-viewer/openPageItems.js +73 -0
- package/dist/editor/page-viewer/openPageItems.js.map +1 -0
- package/dist/editor/page-viewer/overviewRuler.d.ts +128 -0
- package/dist/editor/page-viewer/overviewRuler.js +226 -0
- package/dist/editor/page-viewer/overviewRuler.js.map +1 -0
- package/dist/editor/page-viewer/pageViewContext.d.ts +99 -37
- package/dist/editor/page-viewer/pageViewContext.js +207 -238
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -1
- package/dist/editor/page-viewer/renderingApproval.d.ts +59 -0
- package/dist/editor/page-viewer/renderingApproval.js +186 -0
- package/dist/editor/page-viewer/renderingApproval.js.map +1 -0
- package/dist/editor/page-viewer/renderingChanges.d.ts +29 -0
- package/dist/editor/page-viewer/renderingChanges.js +40 -0
- package/dist/editor/page-viewer/renderingChanges.js.map +1 -0
- package/dist/editor/page-viewer/scrollIntoViewTextRanges.d.ts +23 -0
- package/dist/editor/page-viewer/scrollIntoViewTextRanges.js +26 -0
- package/dist/editor/page-viewer/scrollIntoViewTextRanges.js.map +1 -0
- package/dist/editor/page-viewer/useInteractivePreview.d.ts +77 -0
- package/dist/editor/page-viewer/useInteractivePreview.js +210 -0
- package/dist/editor/page-viewer/useInteractivePreview.js.map +1 -0
- package/dist/editor/pageModel.d.ts +12 -0
- package/dist/editor/personalization/ConditionTreeEditor.js +1 -1
- package/dist/editor/personalization/ConditionTreeEditor.js.map +1 -1
- package/dist/editor/personalization/PersonalizationPanel.js +1 -1
- package/dist/editor/personalization/PersonalizationPanel.js.map +1 -1
- package/dist/editor/reviews/CollapsibleText.d.ts +13 -0
- package/dist/editor/reviews/CollapsibleText.js +41 -0
- package/dist/editor/reviews/CollapsibleText.js.map +1 -0
- package/dist/editor/reviews/Comment.d.ts +10 -1
- package/dist/editor/reviews/Comment.js +47 -26
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/reviews/CommentDisplayPopover.js +29 -25
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/CommentEditor.d.ts +25 -1
- package/dist/editor/reviews/CommentEditor.js +158 -47
- package/dist/editor/reviews/CommentEditor.js.map +1 -1
- package/dist/editor/reviews/CommentImageAttachments.d.ts +12 -0
- package/dist/editor/reviews/CommentImageAttachments.js +19 -0
- package/dist/editor/reviews/CommentImageAttachments.js.map +1 -0
- package/dist/editor/reviews/CommentPopover.d.ts +0 -4
- package/dist/editor/reviews/CommentPopover.js +4 -8
- package/dist/editor/reviews/CommentPopover.js.map +1 -1
- package/dist/editor/reviews/CommentQuote.d.ts +10 -1
- package/dist/editor/reviews/CommentQuote.js +15 -10
- package/dist/editor/reviews/CommentQuote.js.map +1 -1
- package/dist/editor/reviews/CommentTargetOutline.d.ts +13 -0
- package/dist/editor/reviews/CommentTargetOutline.js +21 -0
- package/dist/editor/reviews/CommentTargetOutline.js.map +1 -0
- package/dist/editor/reviews/CommentTargetPickerDomLayer.d.ts +7 -0
- package/dist/editor/reviews/CommentTargetPickerDomLayer.js +117 -0
- package/dist/editor/reviews/CommentTargetPickerDomLayer.js.map +1 -0
- package/dist/editor/reviews/CommentThreadAgentLink.d.ts +6 -1
- package/dist/editor/reviews/CommentThreadAgentLink.js +4 -4
- package/dist/editor/reviews/CommentThreadAgentLink.js.map +1 -1
- package/dist/editor/reviews/CommentThreadCard.d.ts +34 -0
- package/dist/editor/reviews/CommentThreadCard.js +156 -0
- package/dist/editor/reviews/CommentThreadCard.js.map +1 -0
- package/dist/editor/reviews/CommentView.d.ts +7 -1
- package/dist/editor/reviews/CommentView.js +24 -6
- package/dist/editor/reviews/CommentView.js.map +1 -1
- package/dist/editor/reviews/Comments.js +5 -14
- package/dist/editor/reviews/Comments.js.map +1 -1
- package/dist/editor/reviews/CreateReviewDialog.js +36 -9
- package/dist/editor/reviews/CreateReviewDialog.js.map +1 -1
- package/dist/editor/reviews/EditReviewSettingsDialog.js +1 -1
- package/dist/editor/reviews/EditReviewSettingsDialog.js.map +1 -1
- package/dist/editor/reviews/FeedbackCard.d.ts +16 -1
- package/dist/editor/reviews/FeedbackCard.js +14 -3
- package/dist/editor/reviews/FeedbackCard.js.map +1 -1
- package/dist/editor/reviews/FeedbackFilters.d.ts +9 -5
- package/dist/editor/reviews/FeedbackFilters.js +15 -36
- package/dist/editor/reviews/FeedbackFilters.js.map +1 -1
- package/dist/editor/reviews/FeedbackModeIntro.d.ts +7 -1
- package/dist/editor/reviews/FeedbackModeIntro.js +11 -6
- package/dist/editor/reviews/FeedbackModeIntro.js.map +1 -1
- package/dist/editor/reviews/MentionText.d.ts +2 -1
- package/dist/editor/reviews/MentionText.js +5 -3
- package/dist/editor/reviews/MentionText.js.map +1 -1
- package/dist/editor/reviews/MultiReviewManager.js +18 -3
- package/dist/editor/reviews/MultiReviewManager.js.map +1 -1
- package/dist/editor/reviews/ReviewItemsPanel.js +4 -0
- package/dist/editor/reviews/ReviewItemsPanel.js.map +1 -1
- package/dist/editor/reviews/SuggestedEdit.d.ts +10 -1
- package/dist/editor/reviews/SuggestedEdit.js +77 -10
- package/dist/editor/reviews/SuggestedEdit.js.map +1 -1
- package/dist/editor/reviews/SuggestionCommentThread.d.ts +5 -1
- package/dist/editor/reviews/SuggestionCommentThread.js +48 -17
- package/dist/editor/reviews/SuggestionCommentThread.js.map +1 -1
- package/dist/editor/reviews/SuggestionThreadCard.d.ts +19 -0
- package/dist/editor/reviews/SuggestionThreadCard.js +25 -0
- package/dist/editor/reviews/SuggestionThreadCard.js.map +1 -0
- package/dist/editor/reviews/addCommentOnTarget.d.ts +22 -0
- package/dist/editor/reviews/addCommentOnTarget.js +32 -0
- package/dist/editor/reviews/addCommentOnTarget.js.map +1 -0
- package/dist/editor/reviews/applySuggestedEditActions.js +7 -1
- package/dist/editor/reviews/applySuggestedEditActions.js.map +1 -1
- package/dist/editor/reviews/balloonLayout.d.ts +51 -0
- package/dist/editor/reviews/balloonLayout.js +101 -0
- package/dist/editor/reviews/balloonLayout.js.map +1 -0
- package/dist/editor/reviews/commentAgentAttachments.d.ts +5 -0
- package/dist/editor/reviews/commentAgentAttachments.js +51 -0
- package/dist/editor/reviews/commentAgentAttachments.js.map +1 -0
- package/dist/editor/reviews/commentAi.d.ts +4 -2
- package/dist/editor/reviews/commentAi.js +19 -12
- package/dist/editor/reviews/commentAi.js.map +1 -1
- package/dist/editor/reviews/commentImages.d.ts +1 -2
- package/dist/editor/reviews/commentImages.js +1 -37
- package/dist/editor/reviews/commentImages.js.map +1 -1
- package/dist/editor/reviews/commentTargetPicker.d.ts +114 -0
- package/dist/editor/reviews/commentTargetPicker.js +153 -0
- package/dist/editor/reviews/commentTargetPicker.js.map +1 -0
- package/dist/editor/reviews/feedbackAvatar.js +2 -1
- package/dist/editor/reviews/feedbackAvatar.js.map +1 -1
- package/dist/editor/reviews/feedbackBalloonDate.d.ts +8 -0
- package/dist/editor/reviews/feedbackBalloonDate.js +22 -0
- package/dist/editor/reviews/feedbackBalloonDate.js.map +1 -0
- package/dist/editor/reviews/feedbackDrafts.d.ts +49 -0
- package/dist/editor/reviews/feedbackDrafts.js +74 -0
- package/dist/editor/reviews/feedbackDrafts.js.map +1 -0
- package/dist/editor/reviews/feedbackHoverState.d.ts +18 -0
- package/dist/editor/reviews/feedbackHoverState.js +35 -0
- package/dist/editor/reviews/feedbackHoverState.js.map +1 -0
- package/dist/editor/reviews/feedbackPersonFilter.d.ts +3 -0
- package/dist/editor/reviews/feedbackPersonFilter.js +32 -0
- package/dist/editor/reviews/feedbackPersonFilter.js.map +1 -0
- package/dist/editor/reviews/feedbackSelection.js +7 -3
- package/dist/editor/reviews/feedbackSelection.js.map +1 -1
- package/dist/editor/reviews/feedbackThreadSelection.d.ts +10 -0
- package/dist/editor/reviews/feedbackThreadSelection.js +31 -0
- package/dist/editor/reviews/feedbackThreadSelection.js.map +1 -0
- package/dist/editor/reviews/feedbackThreads.d.ts +50 -0
- package/dist/editor/reviews/feedbackThreads.js +135 -0
- package/dist/editor/reviews/feedbackThreads.js.map +1 -0
- package/dist/editor/reviews/feedbackWheelForwarding.d.ts +34 -0
- package/dist/editor/reviews/feedbackWheelForwarding.js +108 -0
- package/dist/editor/reviews/feedbackWheelForwarding.js.map +1 -0
- package/dist/editor/reviews/openCommentsFeedback.d.ts +1 -1
- package/dist/editor/reviews/openCommentsFeedback.js +2 -1
- package/dist/editor/reviews/openCommentsFeedback.js.map +1 -1
- package/dist/editor/reviews/pendingReviewSelection.d.ts +13 -0
- package/dist/editor/reviews/pendingReviewSelection.js +29 -0
- package/dist/editor/reviews/pendingReviewSelection.js.map +1 -0
- package/dist/editor/reviews/requestReview.d.ts +27 -0
- package/dist/editor/reviews/requestReview.js +36 -0
- package/dist/editor/reviews/requestReview.js.map +1 -0
- package/dist/editor/reviews/reviewUrlScope.d.ts +23 -0
- package/dist/editor/reviews/reviewUrlScope.js +86 -0
- package/dist/editor/reviews/reviewUrlScope.js.map +1 -0
- package/dist/editor/reviews/scrollWithin.d.ts +29 -0
- package/dist/editor/reviews/scrollWithin.js +87 -0
- package/dist/editor/reviews/scrollWithin.js.map +1 -0
- package/dist/editor/reviews/subtreeFeedback.d.ts +57 -0
- package/dist/editor/reviews/subtreeFeedback.js +137 -0
- package/dist/editor/reviews/subtreeFeedback.js.map +1 -0
- package/dist/editor/reviews/useCommentImagePaste.d.ts +49 -14
- package/dist/editor/reviews/useCommentImagePaste.js +165 -62
- package/dist/editor/reviews/useCommentImagePaste.js.map +1 -1
- package/dist/editor/reviews/useFeedbackThreads.d.ts +35 -0
- package/dist/editor/reviews/useFeedbackThreads.js +137 -0
- package/dist/editor/reviews/useFeedbackThreads.js.map +1 -0
- package/dist/editor/reviews/useMeasuredHeights.d.ts +25 -0
- package/dist/editor/reviews/useMeasuredHeights.js +176 -0
- package/dist/editor/reviews/useMeasuredHeights.js.map +1 -0
- package/dist/editor/reviews/usePendingFeedbackFocus.d.ts +7 -0
- package/dist/editor/reviews/usePendingFeedbackFocus.js +42 -0
- package/dist/editor/reviews/usePendingFeedbackFocus.js.map +1 -0
- package/dist/editor/services/agentService.d.ts +101 -5
- package/dist/editor/services/agentService.js +16 -0
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/agentStatus.d.ts +1 -0
- package/dist/editor/services/agentStatus.js +14 -0
- package/dist/editor/services/agentStatus.js.map +1 -1
- package/dist/editor/services/aiService.d.ts +2 -0
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/contentService.d.ts +11 -1
- package/dist/editor/services/contentService.js +2 -1
- package/dist/editor/services/contentService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +2 -0
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/services/indexService.d.ts +1 -0
- package/dist/editor/services/indexService.js +4 -0
- package/dist/editor/services/indexService.js.map +1 -1
- package/dist/editor/services/mcpAccessService.d.ts +93 -0
- package/dist/editor/services/mcpAccessService.js +41 -0
- package/dist/editor/services/mcpAccessService.js.map +1 -0
- package/dist/editor/services/previewTokenService.d.ts +14 -0
- package/dist/editor/services/previewTokenService.js +34 -0
- package/dist/editor/services/previewTokenService.js.map +1 -0
- package/dist/editor/services/renderingsService.d.ts +117 -0
- package/dist/editor/services/renderingsService.js +245 -0
- package/dist/editor/services/renderingsService.js.map +1 -0
- package/dist/editor/services/reviewsService.d.ts +6 -1
- package/dist/editor/services/reviewsService.js +14 -6
- package/dist/editor/services/reviewsService.js.map +1 -1
- package/dist/editor/services/serviceHelper.d.ts +17 -1
- package/dist/editor/services/serviceHelper.js +67 -12
- package/dist/editor/services/serviceHelper.js.map +1 -1
- package/dist/editor/services/spellCheckService.d.ts +13 -0
- package/dist/editor/services/spellCheckService.js +33 -0
- package/dist/editor/services/spellCheckService.js.map +1 -0
- package/dist/editor/services/suggestedEditsService.d.ts +1 -0
- package/dist/editor/services/suggestedEditsService.js +7 -0
- package/dist/editor/services/suggestedEditsService.js.map +1 -1
- package/dist/editor/settings/MigrationJournalCard.js +2 -2
- package/dist/editor/settings/MigrationJournalCard.js.map +1 -1
- package/dist/editor/settings/StatusSummary.js +5 -2
- package/dist/editor/settings/StatusSummary.js.map +1 -1
- package/dist/editor/settings/index/CollectionWarningsDisplay.js +1 -1
- package/dist/editor/settings/index/CollectionWarningsDisplay.js.map +1 -1
- package/dist/editor/settings/index/IndexGenerationsSection.d.ts +4 -5
- package/dist/editor/settings/index/IndexGenerationsSection.js +83 -33
- package/dist/editor/settings/index/IndexGenerationsSection.js.map +1 -1
- package/dist/editor/settings/index/RecentBatchesList.js +2 -1
- package/dist/editor/settings/index/RecentBatchesList.js.map +1 -1
- package/dist/editor/settings/panels/AgentProfileConfigPanel.js +1 -1
- package/dist/editor/settings/panels/AgentProfileConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/AgentToolsPanel.js +1 -1
- package/dist/editor/settings/panels/AgentToolsPanel.js.map +1 -1
- package/dist/editor/settings/panels/JavaScriptToolAgentPanel.js +1 -1
- package/dist/editor/settings/panels/JavaScriptToolAgentPanel.js.map +1 -1
- package/dist/editor/settings/panels/McpAccessPanel.d.ts +7 -0
- package/dist/editor/settings/panels/McpAccessPanel.js +96 -0
- package/dist/editor/settings/panels/McpAccessPanel.js.map +1 -0
- package/dist/editor/settings/panels/McpAccessSettingsView.d.ts +8 -0
- package/dist/editor/settings/panels/McpAccessSettingsView.js +221 -0
- package/dist/editor/settings/panels/McpAccessSettingsView.js.map +1 -0
- package/dist/editor/settings/panels/ModelConfigPanel.js +1 -0
- package/dist/editor/settings/panels/ModelConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/ModelsPanel.js +60 -6
- package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
- package/dist/editor/settings/panels/PersistentLogsPanel.js +2 -1
- package/dist/editor/settings/panels/PersistentLogsPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js +1 -1
- package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js.map +1 -1
- package/dist/editor/settings/panels/ProvidersPanel.js +2 -1
- package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
- package/dist/editor/settings/panels/SearchConfigPanel.js +6 -5
- package/dist/editor/settings/panels/SearchConfigPanel.js.map +1 -1
- package/dist/editor/settings/panels/SpellCheckPanel.d.ts +8 -0
- package/dist/editor/settings/panels/SpellCheckPanel.js +253 -0
- package/dist/editor/settings/panels/SpellCheckPanel.js.map +1 -0
- package/dist/editor/settings/panels/StatusPanel.js +5 -6
- package/dist/editor/settings/panels/StatusPanel.js.map +1 -1
- package/dist/editor/settings/panels/UserPreferencesPanel.js +5 -2
- package/dist/editor/settings/panels/UserPreferencesPanel.js.map +1 -1
- package/dist/editor/settings/panels/index.d.ts +2 -0
- package/dist/editor/settings/panels/index.js +2 -0
- package/dist/editor/settings/panels/index.js.map +1 -1
- package/dist/editor/sidebar/ComponentPalette.js +7 -3
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -1
- package/dist/editor/sidebar/ComponentTree.js +37 -58
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/DictionaryEditor.js +2 -1
- package/dist/editor/sidebar/DictionaryEditor.js.map +1 -1
- package/dist/editor/sidebar/EditHistory.js +5 -4
- package/dist/editor/sidebar/EditHistory.js.map +1 -1
- package/dist/editor/sidebar/FeedbackSidebar.d.ts +7 -0
- package/dist/editor/sidebar/FeedbackSidebar.js +300 -0
- package/dist/editor/sidebar/FeedbackSidebar.js.map +1 -0
- package/dist/editor/sidebar/OperationDetailsContent.js +50 -0
- package/dist/editor/sidebar/OperationDetailsContent.js.map +1 -1
- package/dist/editor/sidebar/OperationItem.js +4 -1
- package/dist/editor/sidebar/OperationItem.js.map +1 -1
- package/dist/editor/sidebar/Sessions.js +3 -1
- package/dist/editor/sidebar/Sessions.js.map +1 -1
- package/dist/editor/sidebar/Validation.js +1 -1
- package/dist/editor/sidebar/Validation.js.map +1 -1
- package/dist/editor/sidebar/Workbox.js +3 -108
- package/dist/editor/sidebar/Workbox.js.map +1 -1
- package/dist/editor/sidebar/liveComponentThumbnails.d.ts +7 -3
- package/dist/editor/sidebar/liveComponentThumbnails.js +26 -16
- package/dist/editor/sidebar/liveComponentThumbnails.js.map +1 -1
- package/dist/editor/spellcheck/canvasSpellCheckContextMenu.d.ts +30 -0
- package/dist/editor/spellcheck/canvasSpellCheckContextMenu.js +69 -0
- package/dist/editor/spellcheck/canvasSpellCheckContextMenu.js.map +1 -0
- package/dist/editor/spellcheck/htmlSpellDocument.d.ts +60 -0
- package/dist/editor/spellcheck/htmlSpellDocument.js +181 -0
- package/dist/editor/spellcheck/htmlSpellDocument.js.map +1 -0
- package/dist/editor/spellcheck/htmlSpellTokenizer.d.ts +45 -0
- package/dist/editor/spellcheck/htmlSpellTokenizer.js +277 -0
- package/dist/editor/spellcheck/htmlSpellTokenizer.js.map +1 -0
- package/dist/editor/spellcheck/replacementGuard.d.ts +27 -0
- package/dist/editor/spellcheck/replacementGuard.js +29 -0
- package/dist/editor/spellcheck/replacementGuard.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckCanvasStore.d.ts +17 -0
- package/dist/editor/spellcheck/spellCheckCanvasStore.js +37 -0
- package/dist/editor/spellcheck/spellCheckCanvasStore.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckCanvasTargets.d.ts +71 -0
- package/dist/editor/spellcheck/spellCheckCanvasTargets.js +126 -0
- package/dist/editor/spellcheck/spellCheckCanvasTargets.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckClient.d.ts +66 -0
- package/dist/editor/spellcheck/spellCheckClient.js +0 -0
- package/dist/editor/spellcheck/spellCheckClient.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckContextMenu.d.ts +52 -0
- package/dist/editor/spellcheck/spellCheckContextMenu.js +120 -0
- package/dist/editor/spellcheck/spellCheckContextMenu.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckReplace.d.ts +8 -0
- package/dist/editor/spellcheck/spellCheckReplace.js +20 -0
- package/dist/editor/spellcheck/spellCheckReplace.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckStyles.d.ts +11 -0
- package/dist/editor/spellcheck/spellCheckStyles.js +12 -0
- package/dist/editor/spellcheck/spellCheckStyles.js.map +1 -0
- package/dist/editor/spellcheck/spellCheckTypes.d.ts +94 -0
- package/dist/editor/spellcheck/spellCheckTypes.js +2 -0
- package/dist/editor/spellcheck/spellCheckTypes.js.map +1 -0
- package/dist/editor/spellcheck/textMarkHitTest.d.ts +14 -0
- package/dist/editor/spellcheck/textMarkHitTest.js +39 -0
- package/dist/editor/spellcheck/textMarkHitTest.js.map +1 -0
- package/dist/editor/spellcheck/useSpellCheck.d.ts +16 -0
- package/dist/editor/spellcheck/useSpellCheck.js +57 -0
- package/dist/editor/spellcheck/useSpellCheck.js.map +1 -0
- package/dist/editor/ui/DynamicRenderingsPublishWarning.d.ts +14 -0
- package/dist/editor/ui/DynamicRenderingsPublishWarning.js +40 -0
- package/dist/editor/ui/DynamicRenderingsPublishWarning.js.map +1 -0
- package/dist/editor/ui/ItemNameDialogNew.js +11 -2
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
- package/dist/editor/ui/ItemSearch.d.ts +2 -0
- package/dist/editor/ui/ItemSearch.js +2 -2
- package/dist/editor/ui/ItemSearch.js.map +1 -1
- package/dist/editor/ui/ParheliaMark.d.ts +15 -0
- package/dist/editor/ui/ParheliaMark.js +12 -0
- package/dist/editor/ui/ParheliaMark.js.map +1 -0
- package/dist/editor/ui/PublishDialog.d.ts +2 -0
- package/dist/editor/ui/PublishDialog.js +4 -1
- package/dist/editor/ui/PublishDialog.js.map +1 -1
- package/dist/editor/ui/PublishItemDialog.js +3 -2
- package/dist/editor/ui/PublishItemDialog.js.map +1 -1
- package/dist/editor/ui/PublishReadinessSummary.js +1 -1
- package/dist/editor/ui/PublishReadinessSummary.js.map +1 -1
- package/dist/editor/ui/PublishRestrictionsDialog.d.ts +33 -0
- package/dist/editor/ui/PublishRestrictionsDialog.js +208 -38
- package/dist/editor/ui/PublishRestrictionsDialog.js.map +1 -1
- package/dist/editor/ui/RootItemPicker.d.ts +18 -0
- package/dist/editor/ui/RootItemPicker.js +112 -0
- package/dist/editor/ui/RootItemPicker.js.map +1 -0
- package/dist/editor/ui/WorkboxItemsTable.js +1 -1
- package/dist/editor/ui/WorkboxItemsTable.js.map +1 -1
- package/dist/editor/undoEligibility.d.ts +2 -0
- package/dist/editor/undoEligibility.js +8 -0
- package/dist/editor/undoEligibility.js.map +1 -0
- package/dist/editor/utils/dataTransferImages.d.ts +7 -0
- package/dist/editor/utils/dataTransferImages.js +43 -0
- package/dist/editor/utils/dataTransferImages.js.map +1 -0
- package/dist/editor/utils/itemConverters.js +9 -0
- package/dist/editor/utils/itemConverters.js.map +1 -1
- package/dist/editor/utils/keyboardNavigation.js +54 -4
- package/dist/editor/utils/keyboardNavigation.js.map +1 -1
- package/dist/editor/utils.d.ts +4 -4
- package/dist/editor/utils.js +9 -8
- package/dist/editor/utils.js.map +1 -1
- package/dist/editor/validation/navigateToValidationIssue.d.ts +2 -2
- package/dist/editor/validation/navigateToValidationIssue.js +1 -1
- package/dist/editor/validation/navigateToValidationIssue.js.map +1 -1
- package/dist/editor/validation/validationRulerIssues.d.ts +17 -0
- package/dist/editor/validation/validationRulerIssues.js +44 -0
- package/dist/editor/validation/validationRulerIssues.js.map +1 -0
- package/dist/editor/views/CompareView.js +3 -4
- package/dist/editor/views/CompareView.js.map +1 -1
- package/dist/editor/views/EditorSlot.js +10 -4
- package/dist/editor/views/EditorSlot.js.map +1 -1
- package/dist/editor/views/ItemEditor.d.ts +3 -1
- package/dist/editor/views/ItemEditor.js +43 -38
- package/dist/editor/views/ItemEditor.js.map +1 -1
- package/dist/editor/views/ItemEditorPane.js +3 -3
- package/dist/editor/views/ItemEditorPane.js.map +1 -1
- package/dist/editor/views/SingleEditView.js +10 -32
- package/dist/editor/views/SingleEditView.js.map +1 -1
- package/dist/editor/views/editorSlotContext.js +62 -90
- package/dist/editor/views/editorSlotContext.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +7 -0
- package/dist/lib/utils.js.map +1 -1
- package/dist/licensing/FeatureGate.js +1 -1
- package/dist/licensing/FeatureGate.js.map +1 -1
- package/dist/licensing/LicenseContext.js +31 -17
- package/dist/licensing/LicenseContext.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/setup/services/setupWizardService.d.ts +6 -2
- package/dist/setup/services/setupWizardService.js +10 -0
- package/dist/setup/services/setupWizardService.js.map +1 -1
- package/dist/setup/wizard/steps/AddModelDialog.js +1 -0
- package/dist/setup/wizard/steps/AddModelDialog.js.map +1 -1
- package/dist/setup/wizard/steps/ImportModelDialog.js +2 -1
- package/dist/setup/wizard/steps/ImportModelDialog.js.map +1 -1
- package/dist/splash-screen/ModernSplashScreen.js +8 -6
- package/dist/splash-screen/ModernSplashScreen.js.map +1 -1
- package/dist/splash-screen/RecentPages.js +8 -5
- package/dist/splash-screen/RecentPages.js.map +1 -1
- package/dist/task-board/TaskBoardWorkspace.js +218 -35
- package/dist/task-board/TaskBoardWorkspace.js.map +1 -1
- package/dist/task-board/components/AttentionPromptDialog.d.ts +13 -0
- package/dist/task-board/components/AttentionPromptDialog.js +45 -0
- package/dist/task-board/components/AttentionPromptDialog.js.map +1 -0
- package/dist/task-board/components/GoalDataView.d.ts +22 -1
- package/dist/task-board/components/GoalDataView.js +63 -17
- package/dist/task-board/components/GoalDataView.js.map +1 -1
- package/dist/task-board/components/GoalFindingsTable.d.ts +43 -0
- package/dist/task-board/components/GoalFindingsTable.js +160 -0
- package/dist/task-board/components/GoalFindingsTable.js.map +1 -0
- package/dist/task-board/components/GoalsMatrix.js +33 -6
- package/dist/task-board/components/GoalsMatrix.js.map +1 -1
- package/dist/task-board/components/IssuePanel.d.ts +31 -0
- package/dist/task-board/components/IssuePanel.js +268 -0
- package/dist/task-board/components/IssuePanel.js.map +1 -0
- package/dist/task-board/components/ProjectBudgetBanner.js +1 -1
- package/dist/task-board/components/ProjectBudgetBanner.js.map +1 -1
- package/dist/task-board/components/ProjectGoalsPanel.js +66 -13
- package/dist/task-board/components/ProjectGoalsPanel.js.map +1 -1
- package/dist/task-board/components/SubgoalFindings.d.ts +40 -0
- package/dist/task-board/components/SubgoalFindings.js +88 -0
- package/dist/task-board/components/SubgoalFindings.js.map +1 -0
- package/dist/task-board/components/TaskAgentPanel.d.ts +2 -0
- package/dist/task-board/components/TaskAgentPanel.js +5 -4
- package/dist/task-board/components/TaskAgentPanel.js.map +1 -1
- package/dist/task-board/components/TaskDetailPanel.js +22 -16
- package/dist/task-board/components/TaskDetailPanel.js.map +1 -1
- package/dist/task-board/components/WizardCommunicationCards.js +1 -1
- package/dist/task-board/components/WizardCommunicationCards.js.map +1 -1
- package/dist/task-board/components/WizardCommunicationCenter.d.ts +2 -0
- package/dist/task-board/components/WizardCommunicationCenter.js +5 -3
- package/dist/task-board/components/WizardCommunicationCenter.js.map +1 -1
- package/dist/task-board/components/WizardCommunicationShared.js +2 -1
- package/dist/task-board/components/WizardCommunicationShared.js.map +1 -1
- package/dist/task-board/components/WizardTask.d.ts +2 -0
- package/dist/task-board/components/WizardTask.js +2 -2
- package/dist/task-board/components/WizardTask.js.map +1 -1
- package/dist/task-board/components/WizardTaskDetailsPanel.d.ts +4 -0
- package/dist/task-board/components/WizardTaskDetailsPanel.js +16 -3
- package/dist/task-board/components/WizardTaskDetailsPanel.js.map +1 -1
- package/dist/task-board/services/issueService.d.ts +193 -0
- package/dist/task-board/services/issueService.js +97 -0
- package/dist/task-board/services/issueService.js.map +1 -0
- package/dist/task-board/services/taskService.d.ts +1 -2
- package/dist/task-board/services/taskService.js +0 -3
- package/dist/task-board/services/taskService.js.map +1 -1
- package/dist/task-board/taskBlockers.d.ts +10 -0
- package/dist/task-board/taskBlockers.js +66 -0
- package/dist/task-board/taskBlockers.js.map +1 -0
- package/dist/task-board/types.d.ts +24 -7
- package/dist/task-board/utils/projectDashboardModel.js +14 -0
- package/dist/task-board/utils/projectDashboardModel.js.map +1 -1
- package/dist/task-board/views/DependencyGraphView.d.ts +22 -0
- package/dist/task-board/views/DependencyGraphView.js +111 -14
- package/dist/task-board/views/DependencyGraphView.js.map +1 -1
- package/dist/task-board/views/KanbanView.js +8 -10
- package/dist/task-board/views/KanbanView.js.map +1 -1
- package/dist/task-board/views/ProjectDashboardView.js +5 -13
- package/dist/task-board/views/ProjectDashboardView.js.map +1 -1
- package/dist/tour/Tour.js +4 -1
- package/dist/tour/Tour.js.map +1 -1
- package/dist/tour/sandbox-tour-copy.d.ts +8 -0
- package/dist/tour/sandbox-tour-copy.js +8 -0
- package/dist/tour/sandbox-tour-copy.js.map +1 -1
- package/dist/tour/sandbox-tour.d.ts +3 -0
- package/dist/tour/sandbox-tour.js +107 -3
- package/dist/tour/sandbox-tour.js.map +1 -1
- package/dist/types.d.ts +85 -1
- package/package.json +6 -2
- package/styles.css +74 -3
- package/dist/editor/page-editor-chrome/bridgeLinkValue.d.ts +0 -10
- package/dist/editor/page-editor-chrome/bridgeLinkValue.js +0 -55
- package/dist/editor/page-editor-chrome/bridgeLinkValue.js.map +0 -1
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore, } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { MiniMap } from "./MiniMap";
|
|
4
|
+
import { FEEDBACK_MARGIN_MIN_WIDTH, FEEDBACK_MARGIN_RAIL_WIDTH, FeedbackMargin, } from "./FeedbackMargin";
|
|
5
|
+
import { getFeedbackMarginRoom, resolveFeedbackMarginSize, shouldShowFeedbackMargin, } from "./feedbackMarginLayout";
|
|
6
|
+
import { useFeedbackMarginCollapsed, useFeedbackMarginPreferredWidth, } from "./feedbackMarginWidth";
|
|
7
|
+
import { handleCanvasPickInteraction, isCanvasPickSelection, markPickedSelection, releasePickedSelection, stopCommentTargetPicking, useCommentTargetPicking, } from "../reviews/commentTargetPicker";
|
|
8
|
+
import { shouldOpenMobileFormOnCanvasTap } from "../mobileBottomPanel";
|
|
9
|
+
import { navigateCanvasFrame } from "./canvasFrameNavigation";
|
|
10
|
+
import { isCanvasLoadSettling, resolveDeferredCanvasRefresh, } from "./canvasLoadSettling";
|
|
11
|
+
import { getCanvasScrollHandoffKey, stashCanvasScrollHandoff, takeCanvasScrollHandoff, } from "./canvasScrollHandoff";
|
|
4
12
|
import { resolveMiniMapVisibility, } from "./minimapVisibility";
|
|
5
13
|
import { useCanvasSelection, useEditContext, useEditContextRef, useFieldsEditContext, useFieldsEditContextRef, } from "../client/editContext";
|
|
6
14
|
import { useSlotContext } from "../views/editorSlotContext";
|
|
15
|
+
import { getScrollIntoViewTextRangeKey, getScrollIntoViewTextRangeQuery, SCROLL_INTO_VIEW_BRIDGE_SOURCE, } from "./scrollIntoViewTextRanges";
|
|
7
16
|
import { useDebouncedCallback, useThrottledCallback } from "use-debounce";
|
|
8
17
|
import { PageEditorChrome } from "../page-editor-chrome/PageEditorChrome";
|
|
18
|
+
import { BridgePasteCleanupOverlay } from "../page-editor-chrome/BridgePasteCleanupOverlay";
|
|
9
19
|
import { useBridgeInlineEditing, } from "../page-editor-chrome/useBridgeInlineEditing";
|
|
10
20
|
import { createBridgeInlineEditSessionCoordinator, } from "./bridgeInlineEditSession";
|
|
11
21
|
import { getInlineAiAnchorFromBridgeToolbar, getVisibleBridgeToolbarRect, waitForVisibleBridgeToolbarRect, } from "../page-editor-chrome/bridgeInlineFormatToolbarLayout";
|
|
12
22
|
import { IFRAME_OVERLAY_BRIDGE_DRAG_GESTURE_EVENT, IFRAME_OVERLAY_BRIDGE_GEOMETRY_EVENT, IFRAME_OVERLAY_BRIDGE_SCROLL_EVENT, IframeOverlayProvider, } from "../page-editor-chrome/overlay/IframeOverlayProvider";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
23
|
+
import { createOverviewRulerStore, OverviewRulerContext, } from "./overviewRuler";
|
|
24
|
+
import { CanvasOverviewRuler } from "./CanvasOverviewRuler";
|
|
25
|
+
import { getBridgeGeometryDocumentSize, getBridgeGeometryScrollScale, getBridgeOverlayGeometryDetail, projectBridgeGeometryToScroll, } from "../page-editor-chrome/overlay/geometry";
|
|
26
|
+
import { CANVAS_REFRESH_COMPLETED_EVENT, usePageViewState, } from "./pageViewContext";
|
|
15
27
|
import uuid from "react-uuid";
|
|
16
28
|
import { cn } from "../../lib/utils";
|
|
17
29
|
import { normalizeMarkerId } from "../utils";
|
|
@@ -25,7 +37,12 @@ import { FieldActionsOverlay, } from "../FieldActionsOverlay";
|
|
|
25
37
|
import { alignLoopbackHostToEditor, alignXmCloudManagedEditingHostToEditor, applyParheliaRenderContext, crossesPreviewRenderBoundary, getEditorQueryParam, } from "./renderUrl";
|
|
26
38
|
import { NoLayout } from "../page-editor-chrome/NoLayout";
|
|
27
39
|
import { Spinner } from "../ui/Spinner";
|
|
40
|
+
import { buildCanvasSpellCheckMenuItems } from "../spellcheck/canvasSpellCheckContextMenu";
|
|
28
41
|
import { DeviceToolbar } from "./DeviceToolbar";
|
|
42
|
+
import { DynamicRenderingsStrip } from "./DynamicRenderingsStrip";
|
|
43
|
+
import { readCanvasRenderings } from "./interactivePreview";
|
|
44
|
+
import { recordPageRenderingIds } from "./renderingApproval";
|
|
45
|
+
import { useInteractivePreview } from "./useInteractivePreview";
|
|
29
46
|
import { isPreviewEditAttemptInteraction, showPreviewEditAttemptToast, } from "./previewEditAttempt";
|
|
30
47
|
import { FullscreenControls } from "../client/ui/FullscreenControls";
|
|
31
48
|
import { PageSelector } from "../menubar/PageSelector";
|
|
@@ -51,14 +68,13 @@ import { downloadLink } from "../bridge/linkDownload";
|
|
|
51
68
|
const ZOOM_MIN = 0.25;
|
|
52
69
|
const ZOOM_MAX = 2;
|
|
53
70
|
const ZOOM_STEP = 0.25;
|
|
54
|
-
const ZOOM_TRANSITION_MS = 300;
|
|
71
|
+
export const ZOOM_TRANSITION_MS = 300;
|
|
55
72
|
// useSyncExternalStore fallbacks for frames rendered without a slot context.
|
|
56
73
|
const subscribeToNothing = () => () => { };
|
|
57
74
|
const getUndefined = () => undefined;
|
|
58
75
|
const BRIDGE_INLINE_EDIT_RELEASE_EVENT = "parhelia:bridge-inline-edit-release";
|
|
59
76
|
const INLINE_AI_CLOSE_EVENT = "inline-ai-close";
|
|
60
77
|
const BRIDGE_INLINE_LINK_OPEN_EVENT = "bridge-inline-link-open";
|
|
61
|
-
const SCROLL_INTO_VIEW_BRIDGE_SOURCE = "scroll-into-view";
|
|
62
78
|
// How long a requested canvas refresh may suppress viewport reactions
|
|
63
79
|
// (selection auto-scroll, scrollIntoView) before it is presumed lost.
|
|
64
80
|
const CANVAS_REFRESH_IN_FLIGHT_MAX_MS = 15000;
|
|
@@ -119,37 +135,10 @@ function dispatchBridgeOverlayScroll(iframe, scroll, scrollScale = 1) {
|
|
|
119
135
|
},
|
|
120
136
|
}));
|
|
121
137
|
}
|
|
122
|
-
function getBridgeGeometryScrollScale(geometry) {
|
|
123
|
-
return typeof geometry?.scrollScale === "number" &&
|
|
124
|
-
Number.isFinite(geometry.scrollScale) &&
|
|
125
|
-
geometry.scrollScale > 0
|
|
126
|
-
? geometry.scrollScale
|
|
127
|
-
: 1;
|
|
128
|
-
}
|
|
129
138
|
function dispatchBridgeOverlayGeometry(iframe, geometry, scrollOverride) {
|
|
130
|
-
const
|
|
131
|
-
const scrollScale = getBridgeGeometryScrollScale(geometry);
|
|
132
|
-
const scroll = scrollOverride ?? geometry?.scroll;
|
|
133
|
-
const detail = {
|
|
134
|
-
scrollLeft: (scroll?.x ?? 0) * scrollScale,
|
|
135
|
-
scrollTop: (scroll?.y ?? 0) * scrollScale,
|
|
136
|
-
viewportWidth: geometry?.viewport.width,
|
|
137
|
-
viewportHeight: geometry?.viewport.height,
|
|
138
|
-
scrollWidth: documentSize?.width,
|
|
139
|
-
scrollHeight: documentSize?.height,
|
|
140
|
-
};
|
|
139
|
+
const detail = getBridgeOverlayGeometryDetail(geometry, scrollOverride);
|
|
141
140
|
iframe?.dispatchEvent(new CustomEvent(IFRAME_OVERLAY_BRIDGE_GEOMETRY_EVENT, { detail }));
|
|
142
141
|
}
|
|
143
|
-
function getBridgeGeometryDocumentSize(geometry) {
|
|
144
|
-
if (!geometry)
|
|
145
|
-
return undefined;
|
|
146
|
-
const rectScale = geometry.rectScale ?? 1;
|
|
147
|
-
const scrollScale = getBridgeGeometryScrollScale(geometry);
|
|
148
|
-
return {
|
|
149
|
-
width: Math.max(geometry.viewport.width, ...geometry.targets.map((target) => target.rect.right * rectScale + geometry.scroll.x * scrollScale)),
|
|
150
|
-
height: Math.max(geometry.viewport.height, ...geometry.targets.map((target) => target.rect.bottom * rectScale + geometry.scroll.y * scrollScale)),
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
142
|
function bridgeKeysMatch(left, right) {
|
|
154
143
|
const normalizedLeft = normalizeMarkerId(left);
|
|
155
144
|
const normalizedRight = normalizeMarkerId(right);
|
|
@@ -266,7 +255,9 @@ function findScrollIntoViewDocumentBounds(geometry, target, options = {}) {
|
|
|
266
255
|
? findBridgeComponentDocumentBounds(geometry, target.fallbackComponentId)
|
|
267
256
|
: undefined));
|
|
268
257
|
}
|
|
269
|
-
|
|
258
|
+
// The scroll measures the target under its own keys (see
|
|
259
|
+
// `getScrollIntoViewTextRangeKey`), never an overlay's.
|
|
260
|
+
const textRangeBounds = findBridgeTextRangeDocumentBounds(geometry, getScrollIntoViewTextRangeKey(target.key));
|
|
270
261
|
if (textRangeBounds || !options.includeTextRangeFallback) {
|
|
271
262
|
return textRangeBounds;
|
|
272
263
|
}
|
|
@@ -310,8 +301,8 @@ function getScrollIntoViewSignature(target) {
|
|
|
310
301
|
].join("|");
|
|
311
302
|
}
|
|
312
303
|
function requestScrollTargetGeometry(pageViewContext, target) {
|
|
313
|
-
const textRanges = target
|
|
314
|
-
if (!textRanges
|
|
304
|
+
const textRanges = getScrollIntoViewTextRangeQuery(target);
|
|
305
|
+
if (!textRanges.length)
|
|
315
306
|
return false;
|
|
316
307
|
return (pageViewContext.requestBridgeGeometry?.({
|
|
317
308
|
source: SCROLL_INTO_VIEW_BRIDGE_SOURCE,
|
|
@@ -329,7 +320,7 @@ function getFocusedFieldScrollKey(field) {
|
|
|
329
320
|
].join("|");
|
|
330
321
|
}
|
|
331
322
|
function scrollBridgeBoundsIntoView(pageViewContext, bounds, currentScroll) {
|
|
332
|
-
const geometry = pageViewContext.bridgeGeometry;
|
|
323
|
+
const geometry = pageViewContext.getState().bridgeGeometry;
|
|
333
324
|
if (!geometry)
|
|
334
325
|
return false;
|
|
335
326
|
const scrollScale = getBridgeGeometryScrollScale(geometry);
|
|
@@ -392,6 +383,10 @@ function restoreIframeWindowScroll(iframe, targetScroll, options = {}) {
|
|
|
392
383
|
}
|
|
393
384
|
};
|
|
394
385
|
const apply = () => {
|
|
386
|
+
if (options.isCurrent?.() === false) {
|
|
387
|
+
completed = true;
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
395
390
|
try {
|
|
396
391
|
attempts += 1;
|
|
397
392
|
win.scrollTo(targetScroll.x, targetScroll.y);
|
|
@@ -584,12 +579,27 @@ function getBridgeSelectionMetadataString(selection, key) {
|
|
|
584
579
|
}
|
|
585
580
|
export function PageViewerFrame(props) {
|
|
586
581
|
const editContext = useEditContext();
|
|
587
|
-
useViewportChangeSignal();
|
|
588
582
|
if (!editContext || !props.pageViewContext)
|
|
589
583
|
return null;
|
|
590
584
|
return (_jsx(PageViewerFrameContent, { ...props, editContext: editContext, pageViewContext: props.pageViewContext }));
|
|
591
585
|
}
|
|
592
586
|
function PageViewerFrameContent({ compareView, pageViewContext, editContext, className, slotCloseButton, }) {
|
|
587
|
+
// The page view state this frame renders from. Handlers and effects that run
|
|
588
|
+
// later read the current state (`getState()`) instead.
|
|
589
|
+
// Which page to load and from where: the canvas load effect depends on these
|
|
590
|
+
// values and runs whenever one changes.
|
|
591
|
+
const pageItemDescriptor = usePageViewState(pageViewContext, (state) => state.pageItemDescriptor);
|
|
592
|
+
const editUrl = usePageViewState(pageViewContext, (state) => state.editUrl);
|
|
593
|
+
const previewUrl = usePageViewState(pageViewContext, (state) => state.previewUrl);
|
|
594
|
+
const siteName = usePageViewState(pageViewContext, (state) => state.site?.name);
|
|
595
|
+
const page = usePageViewState(pageViewContext, (state) => state.page);
|
|
596
|
+
const zoom = usePageViewState(pageViewContext, (state) => state.zoom);
|
|
597
|
+
const device = usePageViewState(pageViewContext, (state) => state.device);
|
|
598
|
+
const deviceWidth = usePageViewState(pageViewContext, (state) => state.deviceWidth);
|
|
599
|
+
const deviceHeight = usePageViewState(pageViewContext, (state) => state.deviceHeight);
|
|
600
|
+
const fullscreen = usePageViewState(pageViewContext, (state) => state.fullscreen);
|
|
601
|
+
const bridgeReady = usePageViewState(pageViewContext, (state) => state.bridgeReady);
|
|
602
|
+
const bridgeStructure = usePageViewState(pageViewContext, (state) => state.bridgeStructure);
|
|
593
603
|
const fieldsContext = useFieldsEditContext();
|
|
594
604
|
const slotContext = useSlotContext();
|
|
595
605
|
const canvasSelection = useCanvasSelection();
|
|
@@ -598,13 +608,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
598
608
|
useEffect(() => {
|
|
599
609
|
pageViewContextRef.current = pageViewContext;
|
|
600
610
|
}, [pageViewContext]);
|
|
601
|
-
const latestBridgeSelectionRef = useRef(pageViewContext.bridgeSelection);
|
|
602
|
-
// Bridge events are ordered, but the context setter commits asynchronously.
|
|
603
|
-
// A layout synchronization cannot run later and clobber a newer event-time
|
|
604
|
-
// ref the way a pending passive effect could.
|
|
605
|
-
useLayoutEffect(() => {
|
|
606
|
-
latestBridgeSelectionRef.current = pageViewContext.bridgeSelection;
|
|
607
|
-
}, [pageViewContext.bridgeSelection]);
|
|
608
611
|
const editContextRef = useEditContextRef();
|
|
609
612
|
const fieldsContextRef = useFieldsEditContextRef();
|
|
610
613
|
const iframeRef = useRef(null);
|
|
@@ -633,6 +636,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
633
636
|
};
|
|
634
637
|
}, []);
|
|
635
638
|
const [isBridgeInlineEditing, setIsBridgeInlineEditing] = useState(false);
|
|
639
|
+
const pickingCommentTarget = useCommentTargetPicking();
|
|
636
640
|
const bridgeInlineEditSessionRef = useRef(null);
|
|
637
641
|
if (!bridgeInlineEditSessionRef.current) {
|
|
638
642
|
bridgeInlineEditSessionRef.current =
|
|
@@ -657,7 +661,15 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
657
661
|
const directOverlayScrollSyncRef = useRef(false);
|
|
658
662
|
const lastBridgeHoverInteractionRef = useRef(undefined);
|
|
659
663
|
const [bridgeInteraction, setBridgeInteraction] = useState(undefined);
|
|
664
|
+
const [pasteCleanupMenu, setPasteCleanupMenu] = useState();
|
|
665
|
+
const sendPasteCleanupCommand = useCallback((payload) => {
|
|
666
|
+
bridgeClientRef.current?.sendCommand("pasteCleanup", payload);
|
|
667
|
+
}, []);
|
|
660
668
|
const pendingRefreshScrollRef = useRef(undefined);
|
|
669
|
+
// Selected component handed over by a frame that unmounted for a layout
|
|
670
|
+
// switch; once geometry arrives it is put back at its previous distance
|
|
671
|
+
// from the canvas top (see canvasScrollHandoff).
|
|
672
|
+
const pendingScrollAnchorRef = useRef(undefined);
|
|
661
673
|
// #fragment carried by a canvas link navigation (preview click / alt+click).
|
|
662
674
|
// Applied to the next iframe src load so the browser lands the canvas on the
|
|
663
675
|
// linked section instead of the page top.
|
|
@@ -721,11 +733,18 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
721
733
|
// bridge is delivering that newer target. Restoring the stale capture
|
|
722
734
|
// would fight it (restoreIframeWindowScroll re-asserts for ~150
|
|
723
735
|
// frames and cancels in-flight smooth scrolls).
|
|
736
|
+
logFieldValueDiagnostic("canvas-load", `scroll restore ctx=${pageViewContextRef.current?.debugId} dropped y=${targetScroll.y}: newer scroll command`);
|
|
724
737
|
clearPendingTarget();
|
|
725
738
|
return;
|
|
726
739
|
}
|
|
727
|
-
const
|
|
728
|
-
|
|
740
|
+
const iframeScroll = getIframeWindowScroll(iframe);
|
|
741
|
+
if (!iframeScroll && !bridgeClientRef.current?.isReady()) {
|
|
742
|
+
// A cross-origin host can only be scrolled through the bridge, and the
|
|
743
|
+
// iframe load event fires before its handshake. Keep the target for
|
|
744
|
+
// the bridge's ready event instead of dropping it here.
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
const currentScroll = iframeScroll ?? observedScroll ?? { x: 0, y: 0 };
|
|
729
748
|
const deltaX = targetScroll.x - currentScroll.x;
|
|
730
749
|
const deltaY = targetScroll.y - currentScroll.y;
|
|
731
750
|
// Already at the target: re-asserting the position would be a no-op
|
|
@@ -735,10 +754,14 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
735
754
|
clearPendingTarget();
|
|
736
755
|
return;
|
|
737
756
|
}
|
|
757
|
+
logFieldValueDiagnostic("canvas-load", `scroll restore ctx=${pageViewContextRef.current?.debugId} y=${currentScroll.y}->${targetScroll.y} from=${iframeScroll ? "window" : "bridge"}`);
|
|
738
758
|
const restoreStarted = restoreIframeWindowScroll(iframe, targetScroll, {
|
|
739
759
|
maxAttempts: 150,
|
|
740
760
|
onSettled: clearPendingTarget,
|
|
741
761
|
onExpired: clearPendingTarget,
|
|
762
|
+
// A newer target (or a cleared one) owns the viewport now; re-asserting
|
|
763
|
+
// this one for the rest of the ~150 frames would fight it.
|
|
764
|
+
isCurrent: () => pendingRefreshScrollRef.current === targetScroll,
|
|
742
765
|
});
|
|
743
766
|
if (!restoreStarted) {
|
|
744
767
|
clearPendingTarget();
|
|
@@ -769,7 +792,19 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
769
792
|
requestedTextRangeGeometry: false,
|
|
770
793
|
});
|
|
771
794
|
const [showSpinner, setShowSpinner] = useState(false);
|
|
795
|
+
// Collects the canvas highlightings' marks for the overview ruler.
|
|
796
|
+
const [overviewRulerStore] = useState(createOverviewRulerStore);
|
|
772
797
|
const [iframeSrc, setIframeSrc] = useState();
|
|
798
|
+
// Mirrors iframeSrc for the render effect, which must read the last
|
|
799
|
+
// requested canvas URL without re-running on it. The iframe's `src`
|
|
800
|
+
// attribute no longer tracks it: later loads go through location.replace()
|
|
801
|
+
// (see navigateCanvasFrame), so the attribute keeps the first URL.
|
|
802
|
+
const requestedIframeSrcRef = useRef(undefined);
|
|
803
|
+
// The full iframe load that has been requested but whose bridge has not
|
|
804
|
+
// connected yet. The render effect consults it so a pre-bridge re-run for the
|
|
805
|
+
// same URL waits for this load instead of issuing a second one (see
|
|
806
|
+
// canvasLoadSettling.ts). Cleared once the bridge reports ready.
|
|
807
|
+
const inFlightCanvasLoadRef = useRef(null);
|
|
773
808
|
const [loadedIframeSrc, setLoadedIframeSrc] = useState();
|
|
774
809
|
const [scroll, setScroll] = useState(0);
|
|
775
810
|
const [showMiniMap, setShowMiniMap] = useState(false);
|
|
@@ -788,6 +823,13 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
788
823
|
iframeRef.current = node;
|
|
789
824
|
setIframeElement(node);
|
|
790
825
|
}, []);
|
|
826
|
+
// Apply the requested canvas URL to the frame. Runs again for a remounted
|
|
827
|
+
// iframe element so a fresh frame picks up the current URL.
|
|
828
|
+
useEffect(() => {
|
|
829
|
+
if (!iframeElement || !iframeSrc)
|
|
830
|
+
return;
|
|
831
|
+
navigateCanvasFrame(iframeElement, iframeSrc);
|
|
832
|
+
}, [iframeElement, iframeSrc]);
|
|
791
833
|
// Clear preSelectedAction when overlay is closed
|
|
792
834
|
useEffect(() => {
|
|
793
835
|
if (editContext?.currentOverlay !==
|
|
@@ -795,8 +837,47 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
795
837
|
setPreSelectedAction(undefined);
|
|
796
838
|
}
|
|
797
839
|
}, [editContext?.currentOverlay, contextMenuField?.fieldId]);
|
|
798
|
-
const zoom = pageViewContext.zoom;
|
|
799
840
|
const [currentItemDescriptor, setCurrentItemDescriptor] = useState(undefined);
|
|
841
|
+
// The iframe, and with it the scroll position, goes away with this frame.
|
|
842
|
+
// A layout switch (fullscreen on/off) mounts a new frame for the same page
|
|
843
|
+
// right away; hand it the scroll so the page does not jump back to the top.
|
|
844
|
+
const loadedItemDescriptorRef = useRef(undefined);
|
|
845
|
+
useLayoutEffect(() => {
|
|
846
|
+
loadedItemDescriptorRef.current = currentItemDescriptor;
|
|
847
|
+
}, [currentItemDescriptor]);
|
|
848
|
+
useLayoutEffect(() => () => {
|
|
849
|
+
const loadedItemDescriptor = loadedItemDescriptorRef.current;
|
|
850
|
+
const unmountingContextId = pageViewContextRef.current?.debugId;
|
|
851
|
+
if (!loadedItemDescriptor) {
|
|
852
|
+
logFieldValueDiagnostic("canvas-load", `frame unmount ctx=${unmountingContextId} no handoff: no page loaded`);
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
// Layout cleanups run before React detaches the iframe, so the live
|
|
856
|
+
// window scroll is still readable for same-origin hosts.
|
|
857
|
+
const windowScroll = getIframeWindowScroll(iframeRef.current);
|
|
858
|
+
const scroll = windowScroll ?? latestBridgeScrollRef.current;
|
|
859
|
+
if (!scroll) {
|
|
860
|
+
logFieldValueDiagnostic("canvas-load", `frame unmount ctx=${unmountingContextId} no handoff: no scroll known`);
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
let anchor;
|
|
864
|
+
const geometry = pageViewContextRef.current?.getState().bridgeGeometry;
|
|
865
|
+
const selection = editContextRef.current?.getSelection() ?? [];
|
|
866
|
+
const selectedComponentId = selection[selection.length - 1];
|
|
867
|
+
const bounds = selectedComponentId
|
|
868
|
+
? findBridgeComponentDocumentBounds(geometry, selectedComponentId)
|
|
869
|
+
: undefined;
|
|
870
|
+
if (geometry && selectedComponentId && bounds) {
|
|
871
|
+
const viewportTop = bounds.y - scroll.y * getBridgeGeometryScrollScale(geometry);
|
|
872
|
+
// Only a component the user can see anchors the view.
|
|
873
|
+
if (viewportTop < geometry.viewport.height &&
|
|
874
|
+
viewportTop + bounds.height > 0) {
|
|
875
|
+
anchor = { componentId: selectedComponentId, viewportTop };
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
logFieldValueDiagnostic("canvas-load", `frame unmount ctx=${unmountingContextId} handoff y=${scroll.y} from=${windowScroll ? "window" : "bridge"} anchor=${anchor?.componentId ?? "none"}`);
|
|
879
|
+
stashCanvasScrollHandoff(getCanvasScrollHandoffKey(loadedItemDescriptor), { scroll, anchor });
|
|
880
|
+
}, []);
|
|
800
881
|
// Field action handlers for the overlay
|
|
801
882
|
const handleActionClick = async (action, event) => {
|
|
802
883
|
if (contextMenuField) {
|
|
@@ -810,7 +891,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
810
891
|
};
|
|
811
892
|
// Note: handleParameterizedActionFromContextMenu is now created inline in handleContextMenu
|
|
812
893
|
// to avoid React state timing issues with contextMenuPosition
|
|
813
|
-
const pageItemDescriptor = pageViewContext.pageItemDescriptor;
|
|
814
894
|
const shouldTrackMinimapScroll = useCallback(() => {
|
|
815
895
|
const editor = editContextRef.current;
|
|
816
896
|
return !!(showMiniMap &&
|
|
@@ -822,9 +902,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
822
902
|
if (!shouldTrackMinimapScroll())
|
|
823
903
|
return;
|
|
824
904
|
setScroll(e);
|
|
825
|
-
|
|
826
|
-
pageViewContextRef.current?.setScroll(e);
|
|
827
|
-
}, [compareView, shouldTrackMinimapScroll]);
|
|
905
|
+
}, [shouldTrackMinimapScroll]);
|
|
828
906
|
const scrollHandler = useThrottledCallback(updateScrollPosition, 100);
|
|
829
907
|
const scrollHandlerRef = useRef(scrollHandler);
|
|
830
908
|
useEffect(() => {
|
|
@@ -840,14 +918,13 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
840
918
|
}, []);
|
|
841
919
|
const projectCurrentBridgeGeometryToScroll = useCallback((scroll) => {
|
|
842
920
|
const activeContext = pageViewContextRef.current;
|
|
843
|
-
const currentGeometry = activeContext?.bridgeGeometry;
|
|
921
|
+
const currentGeometry = activeContext?.getState().bridgeGeometry;
|
|
844
922
|
const projectedGeometry = projectBridgeGeometryToScroll(currentGeometry, scroll);
|
|
845
923
|
if (!activeContext ||
|
|
846
924
|
!projectedGeometry ||
|
|
847
925
|
projectedGeometry === currentGeometry) {
|
|
848
926
|
return;
|
|
849
927
|
}
|
|
850
|
-
activeContext.bridgeGeometry = projectedGeometry;
|
|
851
928
|
activeContext.setBridgeGeometry(projectedGeometry);
|
|
852
929
|
scheduleBridgeGeometryRevision();
|
|
853
930
|
}, [scheduleBridgeGeometryRevision]);
|
|
@@ -959,11 +1036,13 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
959
1036
|
});
|
|
960
1037
|
if (!previewScope.onlySuggestionId)
|
|
961
1038
|
return;
|
|
962
|
-
const structureField = pageViewContextRef.current
|
|
1039
|
+
const structureField = pageViewContextRef.current
|
|
1040
|
+
?.getState()
|
|
1041
|
+
.bridgeStructure?.fields.find((candidate) => candidate.elementKey === elementKey);
|
|
963
1042
|
if (!structureField)
|
|
964
1043
|
return;
|
|
965
|
-
const fallbackItem = pageViewContextRef.current?.pageItemDescriptor ??
|
|
966
|
-
pageViewContextRef.current?.page?.item?.descriptor;
|
|
1044
|
+
const fallbackItem = pageViewContextRef.current?.getState().pageItemDescriptor ??
|
|
1045
|
+
pageViewContextRef.current?.getState().page?.item?.descriptor;
|
|
967
1046
|
const bridgeItem = structureField.item;
|
|
968
1047
|
const itemDescriptor = {
|
|
969
1048
|
id: bridgeItem?.id ?? fallbackItem?.id,
|
|
@@ -986,9 +1065,9 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
986
1065
|
itemId: itemDescriptor.id,
|
|
987
1066
|
language: itemDescriptor.language,
|
|
988
1067
|
version: itemDescriptor.version,
|
|
989
|
-
pageItemId: pageViewContextRef.current?.pageItemDescriptor?.id,
|
|
990
|
-
pageItemLanguage: pageViewContextRef.current?.pageItemDescriptor?.language,
|
|
991
|
-
pageItemVersion: pageViewContextRef.current?.pageItemDescriptor?.version,
|
|
1068
|
+
pageItemId: pageViewContextRef.current?.getState().pageItemDescriptor?.id,
|
|
1069
|
+
pageItemLanguage: pageViewContextRef.current?.getState().pageItemDescriptor?.language,
|
|
1070
|
+
pageItemVersion: pageViewContextRef.current?.getState().pageItemDescriptor?.version,
|
|
992
1071
|
};
|
|
993
1072
|
if (!previewScopeCoversField(previewScope, editor.suggestedEdits, suggestionField)) {
|
|
994
1073
|
return;
|
|
@@ -1188,16 +1267,17 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1188
1267
|
repositoryValue,
|
|
1189
1268
|
modifiedFields: preferRepositoryValue
|
|
1190
1269
|
? undefined
|
|
1191
|
-
:
|
|
1270
|
+
: (slotContext?.fieldModificationStore.getAllFields() ??
|
|
1271
|
+
fieldsContext?.modifiedFields),
|
|
1192
1272
|
suggestedEdits: editContext.suggestedEdits,
|
|
1193
1273
|
field: {
|
|
1194
1274
|
fieldId: field.id || structureField.fieldId,
|
|
1195
1275
|
itemId: itemDescriptor.id,
|
|
1196
1276
|
language: itemDescriptor.language,
|
|
1197
1277
|
version: itemDescriptor.version,
|
|
1198
|
-
pageItemId:
|
|
1199
|
-
pageItemLanguage:
|
|
1200
|
-
pageItemVersion:
|
|
1278
|
+
pageItemId: pageItemDescriptor?.id,
|
|
1279
|
+
pageItemLanguage: pageItemDescriptor?.language,
|
|
1280
|
+
pageItemVersion: pageItemDescriptor?.version,
|
|
1201
1281
|
},
|
|
1202
1282
|
mode: previewScope.mode,
|
|
1203
1283
|
onlySuggestionId: previewScope.onlySuggestionId,
|
|
@@ -1217,7 +1297,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1217
1297
|
editContext.suggestedEdits,
|
|
1218
1298
|
editContext.suggestionVariantSelection,
|
|
1219
1299
|
fieldsContext?.modifiedFields,
|
|
1220
|
-
|
|
1300
|
+
slotContext?.fieldModificationStore,
|
|
1301
|
+
pageItemDescriptor,
|
|
1221
1302
|
]);
|
|
1222
1303
|
const buildBridgeFieldPatch = useCallback(({ field, structureField, itemDescriptor, preferRepositoryValue, replaceActiveInlineEdit, }) => {
|
|
1223
1304
|
const display = getBridgePatchDisplayValue({
|
|
@@ -1263,8 +1344,24 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1263
1344
|
});
|
|
1264
1345
|
lastSentBridgeCaretRef.current = "clear";
|
|
1265
1346
|
}, [editContextRef]);
|
|
1347
|
+
// A DOM selection survives moving focus out of an iframe. Its caret draft
|
|
1348
|
+
// does not: leaving it published would override subsequent saved form edits
|
|
1349
|
+
// in every other session, even after the canvas itself has refreshed.
|
|
1350
|
+
useEffect(() => {
|
|
1351
|
+
const handleFocusIn = () => {
|
|
1352
|
+
if (document.activeElement !== iframeRef.current) {
|
|
1353
|
+
clearBridgeRemoteCaretPosition();
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
document.addEventListener("focusin", handleFocusIn);
|
|
1357
|
+
return () => document.removeEventListener("focusin", handleFocusIn);
|
|
1358
|
+
}, [clearBridgeRemoteCaretPosition]);
|
|
1266
1359
|
const sendBridgeRemoteCaretPosition = useCallback((selection) => {
|
|
1267
1360
|
const editor = editContextRef.current;
|
|
1361
|
+
// A delayed selection event from the canvas must not republish its draft
|
|
1362
|
+
// after the form has taken focus (or clear the form's newer presence).
|
|
1363
|
+
if (document.activeElement !== iframeRef.current)
|
|
1364
|
+
return;
|
|
1268
1365
|
const activeField = selection.activeField;
|
|
1269
1366
|
const offset = selection.startOffset ?? selection.endOffset;
|
|
1270
1367
|
if (!editor ||
|
|
@@ -1276,8 +1373,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1276
1373
|
return;
|
|
1277
1374
|
}
|
|
1278
1375
|
const sourceItem = activeField.item ??
|
|
1279
|
-
pageViewContextRef.current?.page?.item ??
|
|
1280
|
-
pageViewContextRef.current?.pageItemDescriptor;
|
|
1376
|
+
pageViewContextRef.current?.getState().page?.item ??
|
|
1377
|
+
pageViewContextRef.current?.getState().pageItemDescriptor;
|
|
1281
1378
|
const version = typeof sourceItem?.version === "number" &&
|
|
1282
1379
|
Number.isFinite(sourceItem.version)
|
|
1283
1380
|
? sourceItem.version
|
|
@@ -1309,30 +1406,34 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1309
1406
|
});
|
|
1310
1407
|
lastSentBridgeCaretRef.current = nextKey;
|
|
1311
1408
|
}, [clearBridgeRemoteCaretPosition, editContextRef, pageViewContextRef]);
|
|
1409
|
+
// Subscribed, not rendered: carets move on every keystroke of every session.
|
|
1410
|
+
const remoteCaretsStore = editContext.remoteCaretsStore;
|
|
1312
1411
|
useEffect(() => {
|
|
1313
|
-
|
|
1314
|
-
const structureFields = pageViewContext.bridgeStructure?.fields ?? [];
|
|
1315
|
-
if (!bridge || structureFields.length === 0)
|
|
1412
|
+
if (!remoteCaretsStore)
|
|
1316
1413
|
return;
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
structureFields
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1414
|
+
const syncRemoteFieldDrafts = () => {
|
|
1415
|
+
const bridge = bridgeClientRef.current;
|
|
1416
|
+
const structureFields = bridgeStructure?.fields ?? [];
|
|
1417
|
+
if (!bridge || structureFields.length === 0)
|
|
1418
|
+
return;
|
|
1419
|
+
const patches = buildRemoteCaretFieldPatches({
|
|
1420
|
+
remoteCarets: remoteCaretsStore.get(),
|
|
1421
|
+
structureFields,
|
|
1422
|
+
activeInlineEdit: activeBridgeInlineEditRef.current,
|
|
1423
|
+
});
|
|
1424
|
+
// Keep the host informed about the complete live-draft set. Unlike an
|
|
1425
|
+
// ordinary field patch, this state survives host-app/React renders: the
|
|
1426
|
+
// bridge reapplies these values in its mutation observer before other
|
|
1427
|
+
// observers can see stale server markup.
|
|
1428
|
+
bridge.sendCommand("syncRemoteFieldDrafts", { drafts: patches });
|
|
1429
|
+
for (const patch of patches) {
|
|
1430
|
+
const structureField = structureFields.find((field) => field.elementKey === patch.elementKey);
|
|
1431
|
+
sendBridgeFieldPatch(bridge, patch, structureField?.textContent);
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
syncRemoteFieldDrafts();
|
|
1435
|
+
return remoteCaretsStore.subscribe(syncRemoteFieldDrafts);
|
|
1436
|
+
}, [remoteCaretsStore, bridgeStructure, sendBridgeFieldPatch]);
|
|
1336
1437
|
const handleBridgeSelection = useCallback((selection, iframe) => {
|
|
1337
1438
|
const editor = editContextRef.current;
|
|
1338
1439
|
if (!editor)
|
|
@@ -1360,8 +1461,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1360
1461
|
}
|
|
1361
1462
|
clearBridgeRemoteCaretPosition();
|
|
1362
1463
|
const item = selection.activeField.item ??
|
|
1363
|
-
pageViewContextRef.current?.page?.item ??
|
|
1364
|
-
pageViewContextRef.current?.pageItemDescriptor;
|
|
1464
|
+
pageViewContextRef.current?.getState().page?.item ??
|
|
1465
|
+
pageViewContextRef.current?.getState().pageItemDescriptor;
|
|
1365
1466
|
if (!item?.id) {
|
|
1366
1467
|
editor.setSelectedRange(undefined);
|
|
1367
1468
|
return;
|
|
@@ -1402,7 +1503,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1402
1503
|
editor.setSelectedRange(nextRange);
|
|
1403
1504
|
}, [clearBridgeRemoteCaretPosition, sendBridgeRemoteCaretPosition]);
|
|
1404
1505
|
const resolveBridgeFieldDescriptor = useCallback(async (interaction) => {
|
|
1405
|
-
const pageView = pageViewContextRef.current;
|
|
1506
|
+
const pageView = pageViewContextRef.current?.getState();
|
|
1406
1507
|
const selectedRange = editContextRef.current?.selectedRange;
|
|
1407
1508
|
const selectedRangeElementKey = selectedRange?.elementKey;
|
|
1408
1509
|
const selectedRangeMatchesInteraction = !!((interaction.kind === "contextMenu" ||
|
|
@@ -1528,7 +1629,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1528
1629
|
clearBridgeTextCompletion();
|
|
1529
1630
|
return;
|
|
1530
1631
|
}
|
|
1531
|
-
const bridgeSelection =
|
|
1632
|
+
const bridgeSelection = pageViewContextRef.current?.getState().bridgeSelection;
|
|
1532
1633
|
const selectionMatches = bridgeSelectionMatchesInteraction(bridgeSelection, interaction);
|
|
1533
1634
|
const activeField = selectionMatches
|
|
1534
1635
|
? bridgeSelection?.activeField
|
|
@@ -1672,6 +1773,9 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1672
1773
|
sendTextCompletionCommand,
|
|
1673
1774
|
]);
|
|
1674
1775
|
const handleBridgeInteraction = useCallback(async (interaction, iframe) => {
|
|
1776
|
+
if (interaction.kind === "click" && interaction.fieldId) {
|
|
1777
|
+
logFieldValueDiagnostic("bridge-inline", `interaction click field=${interaction.fieldId} element=${interaction.elementKey ?? "none"} component=${interaction.componentId ?? "none"}`);
|
|
1778
|
+
}
|
|
1675
1779
|
if (interaction.kind === "wheel") {
|
|
1676
1780
|
if (!interaction.ctrlKey && !interaction.metaKey)
|
|
1677
1781
|
return;
|
|
@@ -1718,11 +1822,11 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1718
1822
|
if (bridgeTextCompletionRef.current && interaction.fieldId) {
|
|
1719
1823
|
clearBridgeTextCompletion();
|
|
1720
1824
|
}
|
|
1721
|
-
// Ctrl+Z / Ctrl+Y
|
|
1722
|
-
// the
|
|
1723
|
-
// preventDefaults the keystroke and forwards it here;
|
|
1724
|
-
// useGlobalEditorKeyDown listens, so the keyboard and
|
|
1725
|
-
// application undo stack.
|
|
1825
|
+
// Ctrl+Z / Ctrl+Y (and Ctrl+H for find and replace) pressed inside the canvas
|
|
1826
|
+
// iframe never reach the host window, so the commands that bind those keys could
|
|
1827
|
+
// not fire. The bridge already preventDefaults the keystroke and forwards it here;
|
|
1828
|
+
// replay it on `window`, where useGlobalEditorKeyDown listens, so the keyboard and
|
|
1829
|
+
// the toolbar drive the same application undo stack.
|
|
1726
1830
|
const undoRedoKeyboardEvent = createKeyboardEventFromBridgeInteraction(interaction);
|
|
1727
1831
|
if (undoRedoKeyboardEvent) {
|
|
1728
1832
|
// The application operation will deliberately replace the focused
|
|
@@ -1736,10 +1840,10 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1736
1840
|
const editor = editContextRef.current;
|
|
1737
1841
|
let linkRange = editor?.selectedRange;
|
|
1738
1842
|
if (!isBridgeLinkShortcutRange(linkRange, interaction)) {
|
|
1739
|
-
const bridgeSelection =
|
|
1843
|
+
const bridgeSelection = pageViewContextRef.current?.getState().bridgeSelection;
|
|
1740
1844
|
const item = bridgeSelection?.activeField?.item ??
|
|
1741
|
-
pageViewContextRef.current?.page?.item ??
|
|
1742
|
-
pageViewContextRef.current?.pageItemDescriptor;
|
|
1845
|
+
pageViewContextRef.current?.getState().page?.item ??
|
|
1846
|
+
pageViewContextRef.current?.getState().pageItemDescriptor;
|
|
1743
1847
|
if (bridgeSelection &&
|
|
1744
1848
|
!bridgeSelection.collapsed &&
|
|
1745
1849
|
bridgeSelection.text?.trim() &&
|
|
@@ -1807,16 +1911,16 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1807
1911
|
const editor = editContextRef.current;
|
|
1808
1912
|
const field = await resolveBridgeFieldDescriptor(interaction);
|
|
1809
1913
|
if (editor && field) {
|
|
1810
|
-
await
|
|
1914
|
+
await fieldsContextRef.current?.setFocusedField(field, editor.mode !== "suggestions");
|
|
1811
1915
|
}
|
|
1812
1916
|
const iframeRect = iframe.getBoundingClientRect();
|
|
1813
|
-
const bridgeSelection =
|
|
1917
|
+
const bridgeSelection = pageViewContextRef.current?.getState().bridgeSelection;
|
|
1814
1918
|
const commandRange = resolveBridgeInlineAiSelectionRange({
|
|
1815
1919
|
interaction,
|
|
1816
1920
|
bridgeSelection,
|
|
1817
1921
|
iframeRect,
|
|
1818
|
-
fallbackItem: pageViewContextRef.current?.page?.item ??
|
|
1819
|
-
pageViewContextRef.current?.pageItemDescriptor,
|
|
1922
|
+
fallbackItem: pageViewContextRef.current?.getState().page?.item ??
|
|
1923
|
+
pageViewContextRef.current?.getState().pageItemDescriptor,
|
|
1820
1924
|
});
|
|
1821
1925
|
const fallbackCaretRect = !interaction.selectionRect &&
|
|
1822
1926
|
!interaction.caretRect &&
|
|
@@ -1940,8 +2044,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1940
2044
|
structuredFieldValue,
|
|
1941
2045
|
anchorIndex: interaction.link.anchorIndex,
|
|
1942
2046
|
});
|
|
1943
|
-
const sourceItem = pageViewContextRef.current?.page?.item ??
|
|
1944
|
-
pageViewContextRef.current?.pageItemDescriptor ??
|
|
2047
|
+
const sourceItem = pageViewContextRef.current?.getState().page?.item ??
|
|
2048
|
+
pageViewContextRef.current?.getState().pageItemDescriptor ??
|
|
1945
2049
|
interaction.item;
|
|
1946
2050
|
if (!targetItemId &&
|
|
1947
2051
|
canvasLinkHash &&
|
|
@@ -1952,7 +2056,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
1952
2056
|
if (!targetItemId && sourceItem) {
|
|
1953
2057
|
const linkPath = extractInternalLinkPath(interaction.link.href, window.location.href);
|
|
1954
2058
|
if (linkPath) {
|
|
1955
|
-
const resolvedPage = await resolvePageAndSiteByPath(linkPath, sourceItem.language ?? "en", pageViewContextRef.current?.site?.name);
|
|
2059
|
+
const resolvedPage = await resolvePageAndSiteByPath(linkPath, sourceItem.language ?? "en", pageViewContextRef.current?.getState().site?.name);
|
|
1956
2060
|
targetItemId = resolvedPage?.pageItem.id;
|
|
1957
2061
|
}
|
|
1958
2062
|
}
|
|
@@ -2012,7 +2116,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2012
2116
|
!interaction.fieldId &&
|
|
2013
2117
|
interaction.clientX !== undefined &&
|
|
2014
2118
|
interaction.clientY !== undefined) {
|
|
2015
|
-
const fieldTarget = findBridgeFieldTargetAtPoint(pageViewContextRef.current?.bridgeGeometry, interaction.clientX, interaction.clientY);
|
|
2119
|
+
const fieldTarget = findBridgeFieldTargetAtPoint(pageViewContextRef.current?.getState().bridgeGeometry, interaction.clientX, interaction.clientY);
|
|
2016
2120
|
if (fieldTarget?.fieldId) {
|
|
2017
2121
|
effectiveInteraction = {
|
|
2018
2122
|
...interaction,
|
|
@@ -2021,7 +2125,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2021
2125
|
};
|
|
2022
2126
|
}
|
|
2023
2127
|
}
|
|
2024
|
-
const componentId = resolveBridgeComponentId(effectiveInteraction.componentId, pageViewContextRef.current?.page);
|
|
2128
|
+
const componentId = resolveBridgeComponentId(effectiveInteraction.componentId, pageViewContextRef.current?.getState().page);
|
|
2025
2129
|
const isEditableFieldClick = !!(effectiveInteraction.kind === "click" &&
|
|
2026
2130
|
effectiveInteraction.fieldId &&
|
|
2027
2131
|
effectiveInteraction.elementKey &&
|
|
@@ -2089,7 +2193,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2089
2193
|
const currentSelection = editor.getSelection();
|
|
2090
2194
|
if (interaction.kind === "contextMenu") {
|
|
2091
2195
|
if (pageViewContextRef.current) {
|
|
2092
|
-
pageViewContextRef.current.
|
|
2196
|
+
pageViewContextRef.current.setBridgeInteraction(effectiveInteraction);
|
|
2093
2197
|
}
|
|
2094
2198
|
const selectedIds = currentSelection.includes(componentId)
|
|
2095
2199
|
? currentSelection
|
|
@@ -2097,7 +2201,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2097
2201
|
if (!currentSelection.includes(componentId)) {
|
|
2098
2202
|
selectFromBridgeInteraction(selectedIds);
|
|
2099
2203
|
}
|
|
2100
|
-
const page = pageViewContextRef.current?.page;
|
|
2204
|
+
const page = pageViewContextRef.current?.getState().page;
|
|
2101
2205
|
if (!page)
|
|
2102
2206
|
return;
|
|
2103
2207
|
const selectedComponents = selectedIds
|
|
@@ -2173,6 +2277,23 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2173
2277
|
}, 100);
|
|
2174
2278
|
};
|
|
2175
2279
|
items = await buildComponentContextMenuItems(selectedComponents, editor, field, fieldButtons, handleParameterizedActionWithPosition);
|
|
2280
|
+
// Right-click on an underlined misspelling: suggestions come first.
|
|
2281
|
+
const spellItems = await buildCanvasSpellCheckMenuItems({
|
|
2282
|
+
editor,
|
|
2283
|
+
geometry: pageViewContextRef.current?.getState().bridgeGeometry,
|
|
2284
|
+
clientX: interaction.clientX,
|
|
2285
|
+
clientY: interaction.clientY,
|
|
2286
|
+
enabled: !editor.readonly &&
|
|
2287
|
+
editor.mode === "edit" &&
|
|
2288
|
+
editor.userInfo?.preferences?.spellCheckEnabled !== false,
|
|
2289
|
+
});
|
|
2290
|
+
if (spellItems.length > 0) {
|
|
2291
|
+
items = [
|
|
2292
|
+
...spellItems,
|
|
2293
|
+
{ id: "spellcheck-section-separator", separator: true },
|
|
2294
|
+
...items,
|
|
2295
|
+
];
|
|
2296
|
+
}
|
|
2176
2297
|
}
|
|
2177
2298
|
catch (error) {
|
|
2178
2299
|
console.error("Failed to build component context menu:", error);
|
|
@@ -2196,7 +2317,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2196
2317
|
return;
|
|
2197
2318
|
}
|
|
2198
2319
|
if (interaction.shiftKey && currentSelection.length > 0) {
|
|
2199
|
-
const orderedIds = getOrderedBridgeComponentIds(pageViewContextRef.current?.bridgeGeometry, pageViewContextRef.current?.page);
|
|
2320
|
+
const orderedIds = getOrderedBridgeComponentIds(pageViewContextRef.current?.getState().bridgeGeometry, pageViewContextRef.current?.getState().page);
|
|
2200
2321
|
const anchorId = currentSelection[currentSelection.length - 1];
|
|
2201
2322
|
const anchorIndex = orderedIds.findIndex((id) => bridgeIdsMatch(id, anchorId));
|
|
2202
2323
|
const targetIndex = orderedIds.findIndex((id) => bridgeIdsMatch(id, componentId));
|
|
@@ -2232,6 +2353,18 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2232
2353
|
return;
|
|
2233
2354
|
}
|
|
2234
2355
|
selectFromBridgeInteraction([componentId]);
|
|
2356
|
+
// On a phone the tap also opens the edit form when the component is
|
|
2357
|
+
// already selected: the selection-driven auto-open in the shell only
|
|
2358
|
+
// reacts to changes, and the comments panel may be covering the form.
|
|
2359
|
+
if (interaction.kind === "click" &&
|
|
2360
|
+
shouldOpenMobileFormOnCanvasTap({
|
|
2361
|
+
isMobile: editor.isMobile,
|
|
2362
|
+
workspaceId: editor.workspaceId,
|
|
2363
|
+
mode: editor.mode,
|
|
2364
|
+
hasTarget: true,
|
|
2365
|
+
})) {
|
|
2366
|
+
editor.setMobileEditorPanelOpen(true);
|
|
2367
|
+
}
|
|
2235
2368
|
if (isEditableFieldClick) {
|
|
2236
2369
|
clearSelectedRangeForEditableClick();
|
|
2237
2370
|
beginTrackedBridgeInlineEditAfterSelection(effectiveInteraction);
|
|
@@ -2266,7 +2399,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2266
2399
|
const active = activeBridgePointerDragRef.current;
|
|
2267
2400
|
if (!active || event.pointerId !== active.pointerId)
|
|
2268
2401
|
return;
|
|
2269
|
-
const projected = projectParentPointerToHost(event.clientX, event.clientY, iframe.getBoundingClientRect(), pageViewContextRef.current?.bridgeGeometry?.viewport);
|
|
2402
|
+
const projected = projectParentPointerToHost(event.clientX, event.clientY, iframe.getBoundingClientRect(), pageViewContextRef.current?.getState().bridgeGeometry?.viewport);
|
|
2270
2403
|
if (!projected.inside)
|
|
2271
2404
|
return;
|
|
2272
2405
|
active.clientX = projected.clientX;
|
|
@@ -2285,7 +2418,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2285
2418
|
if (!active)
|
|
2286
2419
|
return;
|
|
2287
2420
|
const rect = iframe.getBoundingClientRect();
|
|
2288
|
-
const payload = resolveParentBridgePointerRelease(active, event, rect, pageViewContextRef.current?.bridgeGeometry?.viewport);
|
|
2421
|
+
const payload = resolveParentBridgePointerRelease(active, event, rect, pageViewContextRef.current?.getState().bridgeGeometry?.viewport);
|
|
2289
2422
|
if (!payload)
|
|
2290
2423
|
return;
|
|
2291
2424
|
// Clear before dispatching and before asking the host to clean up. Any
|
|
@@ -2342,7 +2475,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2342
2475
|
lastY = scroll.y;
|
|
2343
2476
|
latestBridgeScrollRef.current = scroll;
|
|
2344
2477
|
projectCurrentBridgeGeometryToScroll(scroll);
|
|
2345
|
-
dispatchBridgeOverlayScroll(iframe, scroll, getBridgeGeometryScrollScale(pageViewContextRef.current?.bridgeGeometry));
|
|
2478
|
+
dispatchBridgeOverlayScroll(iframe, scroll, getBridgeGeometryScrollScale(pageViewContextRef.current?.getState().bridgeGeometry));
|
|
2346
2479
|
};
|
|
2347
2480
|
iframeDocument.addEventListener("scroll", handleScroll, {
|
|
2348
2481
|
capture: true,
|
|
@@ -2375,8 +2508,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2375
2508
|
return;
|
|
2376
2509
|
}
|
|
2377
2510
|
const allowedHostOrigins = [
|
|
2378
|
-
getUrlOrigin(
|
|
2379
|
-
getUrlOrigin(
|
|
2511
|
+
getUrlOrigin(editUrl),
|
|
2512
|
+
getUrlOrigin(previewUrl),
|
|
2380
2513
|
].filter((origin) => Boolean(origin));
|
|
2381
2514
|
// The iframe can finish loading before the page-view URLs have propagated
|
|
2382
2515
|
// into context, and a same-origin host can normalize its live URL after the
|
|
@@ -2390,6 +2523,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2390
2523
|
editorOrigin: window.location.origin,
|
|
2391
2524
|
allowedHostOrigins,
|
|
2392
2525
|
onReadyChange: (ready) => {
|
|
2526
|
+
if (ready)
|
|
2527
|
+
inFlightCanvasLoadRef.current = null;
|
|
2393
2528
|
pageViewContext.setBridgeReady(ready);
|
|
2394
2529
|
if (!ready)
|
|
2395
2530
|
pageViewContext.setIframeSupportsRefresh(false);
|
|
@@ -2424,6 +2559,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2424
2559
|
selectedComponentIds: editContextRef.current?.getSelection() ?? [],
|
|
2425
2560
|
featureFlags: {
|
|
2426
2561
|
crossOriginBridge: true,
|
|
2562
|
+
pasteCleanupOverlay: true,
|
|
2427
2563
|
// Lets the host emit its own perf logs + interaction perf
|
|
2428
2564
|
// timestamps without needing a flag in the iframe's origin.
|
|
2429
2565
|
perfTrace: isPerfTraceEnabled(),
|
|
@@ -2432,7 +2568,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2432
2568
|
acknowledgedCapabilities: bridge.getAcknowledgedCapabilities(),
|
|
2433
2569
|
});
|
|
2434
2570
|
bridge.sendCommand("setZoom", {
|
|
2435
|
-
zoom: pageViewContextRef.current?.zoom ?? 1,
|
|
2571
|
+
zoom: pageViewContextRef.current?.getState().zoom ?? 1,
|
|
2436
2572
|
});
|
|
2437
2573
|
// Ready confirms the bridge transport, not that its initial
|
|
2438
2574
|
// mutation-driven geometry snapshot reached the editor. Query the
|
|
@@ -2446,8 +2582,12 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2446
2582
|
bridge.sendCommand("queryGeometry", {
|
|
2447
2583
|
textRanges: Array.from(bridgeTextRangeSourcesRef.current.values()).flat(),
|
|
2448
2584
|
});
|
|
2449
|
-
|
|
2450
|
-
|
|
2585
|
+
// With a handed-over anchor, the first geometry decides the
|
|
2586
|
+
// target (see the anchor effect); a relative scrollBy sent now
|
|
2587
|
+
// would add up with the anchor's on cross-origin hosts.
|
|
2588
|
+
if (pendingRefreshScrollRef.current &&
|
|
2589
|
+
!pendingScrollAnchorRef.current) {
|
|
2590
|
+
restorePendingRefreshScroll(iframe, pendingRefreshScrollRef.current, event.payload.scroll);
|
|
2451
2591
|
}
|
|
2452
2592
|
break;
|
|
2453
2593
|
case "structureUpdated":
|
|
@@ -2477,7 +2617,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2477
2617
|
pageViewContext.setPageSkeleton(event.payload.pageSkeleton);
|
|
2478
2618
|
break;
|
|
2479
2619
|
case "resizeChanged": {
|
|
2480
|
-
const currentGeometry = pageViewContext.bridgeGeometry;
|
|
2620
|
+
const currentGeometry = pageViewContext.getState().bridgeGeometry;
|
|
2481
2621
|
const viewportChanged = !currentGeometry ||
|
|
2482
2622
|
currentGeometry.viewport.width !== event.payload.viewport.width ||
|
|
2483
2623
|
currentGeometry.viewport.height !==
|
|
@@ -2492,7 +2632,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2492
2632
|
// example, when the minimap narrows the canvas). Remove that stale
|
|
2493
2633
|
// snapshot immediately and request its replacement now, preserving
|
|
2494
2634
|
// every overlay's registered text-range query.
|
|
2495
|
-
pageViewContext.bridgeGeometry = undefined;
|
|
2496
2635
|
pageViewContext.setBridgeGeometry(undefined);
|
|
2497
2636
|
scheduleBridgeGeometryRevision();
|
|
2498
2637
|
bridge.sendCommand("queryGeometry", {
|
|
@@ -2516,7 +2655,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2516
2655
|
: undefined) ?? event.payload.geometry.scroll;
|
|
2517
2656
|
const geometry = projectBridgeGeometryToScroll(event.payload.geometry, liveScroll) ?? event.payload.geometry;
|
|
2518
2657
|
latestBridgeScrollRef.current = geometry.scroll;
|
|
2519
|
-
pageViewContext.bridgeGeometry = geometry;
|
|
2520
2658
|
pageViewContext.setBridgeGeometry(geometry);
|
|
2521
2659
|
scheduleBridgeGeometryRevision();
|
|
2522
2660
|
dispatchBridgeOverlayScroll(iframe, geometry.scroll, getBridgeGeometryScrollScale(geometry));
|
|
@@ -2527,10 +2665,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2527
2665
|
break;
|
|
2528
2666
|
}
|
|
2529
2667
|
case "domUpdated":
|
|
2530
|
-
pageViewContext.bridgeDom = event.payload;
|
|
2531
2668
|
pageViewContext.setBridgeDom(event.payload);
|
|
2532
2669
|
scheduleBridgeDomRevision();
|
|
2533
|
-
window.dispatchEvent(new CustomEvent(BRIDGE_DOM_UPDATED_EVENT));
|
|
2534
2670
|
break;
|
|
2535
2671
|
case "refreshStarted":
|
|
2536
2672
|
hostAppRefreshSawStructureUpdateRef.current = false;
|
|
@@ -2573,7 +2709,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2573
2709
|
: undefined) ?? event.payload.geometry.scroll;
|
|
2574
2710
|
const geometry = projectBridgeGeometryToScroll(event.payload.geometry, liveScroll) ?? event.payload.geometry;
|
|
2575
2711
|
latestBridgeScrollRef.current = geometry.scroll;
|
|
2576
|
-
pageViewContext.bridgeGeometry = geometry;
|
|
2577
2712
|
pageViewContext.setBridgeGeometry(geometry);
|
|
2578
2713
|
scheduleBridgeGeometryRevision();
|
|
2579
2714
|
dispatchBridgeOverlayScroll(iframe, geometry.scroll, getBridgeGeometryScrollScale(geometry));
|
|
@@ -2590,6 +2725,9 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2590
2725
|
// The host already replayed a scroll issued during the refresh
|
|
2591
2726
|
// (e.g. a minimap navigation) — restoring the pre-refresh
|
|
2592
2727
|
// position now would clobber that newer intent.
|
|
2728
|
+
if (pendingRefreshScrollRef.current) {
|
|
2729
|
+
logFieldValueDiagnostic("canvas-load", `scroll restore ctx=${pageViewContext.debugId} dropped y=${pendingRefreshScrollRef.current.y}: host replayed a newer scroll`);
|
|
2730
|
+
}
|
|
2593
2731
|
pendingRefreshScrollRef.current = undefined;
|
|
2594
2732
|
}
|
|
2595
2733
|
else if (pendingRefreshScrollRef.current) {
|
|
@@ -2619,10 +2757,24 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2619
2757
|
}
|
|
2620
2758
|
setShowSpinner(false);
|
|
2621
2759
|
break;
|
|
2760
|
+
case "pasteCleanupChanged":
|
|
2761
|
+
setPasteCleanupMenu(event.payload.menu);
|
|
2762
|
+
break;
|
|
2622
2763
|
case "selectionChanged":
|
|
2623
|
-
latestBridgeSelectionRef.current = event.payload.selection;
|
|
2624
2764
|
pageViewContext.setBridgeSelection(event.payload.selection);
|
|
2625
2765
|
handleBridgeSelection(event.payload.selection, iframe);
|
|
2766
|
+
// Comment target picking: a passage selected on the canvas is
|
|
2767
|
+
// the target once the pointer is released. The composer reads
|
|
2768
|
+
// the selection from the edit context, which the call above
|
|
2769
|
+
// updates with the next render. The formatting menu stays away
|
|
2770
|
+
// from a passage picked this way until the selection changes.
|
|
2771
|
+
releasePickedSelection(event.payload.selection);
|
|
2772
|
+
if (!compareView &&
|
|
2773
|
+
isCanvasPickSelection(event.payload.selection)) {
|
|
2774
|
+
markPickedSelection(event.payload.selection);
|
|
2775
|
+
stopCommentTargetPicking();
|
|
2776
|
+
window.requestAnimationFrame(() => window.requestAnimationFrame(() => editContextRef.current?.addComment()));
|
|
2777
|
+
}
|
|
2626
2778
|
break;
|
|
2627
2779
|
case "fieldValueChanged":
|
|
2628
2780
|
handleBridgeFieldValueChanged(event.payload);
|
|
@@ -2663,6 +2815,12 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2663
2815
|
transportMs: Date.now() - event.timestamp,
|
|
2664
2816
|
}, eventAt ?? event.timestamp);
|
|
2665
2817
|
}
|
|
2818
|
+
// While picking a comment target, clicks, Escape and the context
|
|
2819
|
+
// menu belong to the picker, not to selection or inline editing.
|
|
2820
|
+
if (!compareView &&
|
|
2821
|
+
handleCanvasPickInteraction(event.payload, editContextRef.current, pageViewContextRef.current?.getState().pageItemDescriptor)) {
|
|
2822
|
+
break;
|
|
2823
|
+
}
|
|
2666
2824
|
setBridgeInteraction(event.payload);
|
|
2667
2825
|
pageViewContext.setBridgeInteraction(event.payload);
|
|
2668
2826
|
void handleBridgeInteraction(event.payload, iframe);
|
|
@@ -2712,7 +2870,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2712
2870
|
// late echo of a scroll the overlay already applied; re-dispatching
|
|
2713
2871
|
// it would briefly drag the overlay back to a stale position.
|
|
2714
2872
|
if (!directOverlayScrollSyncRef.current) {
|
|
2715
|
-
dispatchBridgeOverlayScroll(iframe, event.payload.scroll, getBridgeGeometryScrollScale(pageViewContextRef.current?.bridgeGeometry));
|
|
2873
|
+
dispatchBridgeOverlayScroll(iframe, event.payload.scroll, getBridgeGeometryScrollScale(pageViewContextRef.current?.getState().bridgeGeometry));
|
|
2716
2874
|
}
|
|
2717
2875
|
if (shouldTrackMinimapScroll()) {
|
|
2718
2876
|
scrollHandlerRef.current(event.payload.scroll.y);
|
|
@@ -2724,6 +2882,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2724
2882
|
}
|
|
2725
2883
|
},
|
|
2726
2884
|
});
|
|
2885
|
+
setPasteCleanupMenu(undefined);
|
|
2727
2886
|
bridgeClientRef.current = client;
|
|
2728
2887
|
pageViewContext.setBridgeReady(false);
|
|
2729
2888
|
client.connect();
|
|
@@ -2751,8 +2910,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2751
2910
|
clearActiveBridgeInlineEdit,
|
|
2752
2911
|
bridgeInlineEditSession,
|
|
2753
2912
|
reconcileActiveBridgeInlineEdit,
|
|
2754
|
-
|
|
2755
|
-
|
|
2913
|
+
editUrl,
|
|
2914
|
+
previewUrl,
|
|
2756
2915
|
scheduleBridgeDomRevision,
|
|
2757
2916
|
scheduleBridgeGeometryRevision,
|
|
2758
2917
|
shouldTrackMinimapScroll,
|
|
@@ -2768,7 +2927,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2768
2927
|
if (fieldChanges.length === 0)
|
|
2769
2928
|
return;
|
|
2770
2929
|
const bridge = bridgeClientRef.current;
|
|
2771
|
-
const structure = pageViewContextRef.current?.bridgeStructure;
|
|
2930
|
+
const structure = pageViewContextRef.current?.getState().bridgeStructure;
|
|
2772
2931
|
if (!bridge || !structure?.fields.length)
|
|
2773
2932
|
return;
|
|
2774
2933
|
const processResolvedField = (change, changedFieldId, field) => {
|
|
@@ -2776,8 +2935,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2776
2935
|
return;
|
|
2777
2936
|
const patchedElementKeys = new Set();
|
|
2778
2937
|
const patches = [];
|
|
2779
|
-
const pageItemDescriptor = pageViewContextRef.current?.pageItemDescriptor ??
|
|
2780
|
-
pageViewContextRef.current?.page?.item?.descriptor;
|
|
2938
|
+
const pageItemDescriptor = pageViewContextRef.current?.getState().pageItemDescriptor ??
|
|
2939
|
+
pageViewContextRef.current?.getState().page?.item?.descriptor;
|
|
2781
2940
|
for (const structureField of structure.fields) {
|
|
2782
2941
|
if (!structureField.elementKey)
|
|
2783
2942
|
continue;
|
|
@@ -2816,7 +2975,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2816
2975
|
// stale mid-typing — applying it would roll the canvas text back
|
|
2817
2976
|
// and make the remote caret jump against the shorter text.
|
|
2818
2977
|
if (hasRemoteCaretDraftForField({
|
|
2819
|
-
remoteCarets: editContextRef.current?.
|
|
2978
|
+
remoteCarets: editContextRef.current?.remoteCaretsStore?.get(),
|
|
2820
2979
|
fieldId: structureField.fieldId,
|
|
2821
2980
|
item: structureField.item,
|
|
2822
2981
|
})) {
|
|
@@ -2844,8 +3003,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2844
3003
|
};
|
|
2845
3004
|
const asyncFieldChanges = [];
|
|
2846
3005
|
for (const change of fieldChanges) {
|
|
2847
|
-
const pageItemDescriptor = pageViewContextRef.current?.pageItemDescriptor ??
|
|
2848
|
-
pageViewContextRef.current?.page?.item?.descriptor;
|
|
3006
|
+
const pageItemDescriptor = pageViewContextRef.current?.getState().pageItemDescriptor ??
|
|
3007
|
+
pageViewContextRef.current?.getState().page?.item?.descriptor;
|
|
2849
3008
|
if (!bridgeStructureTargetsChangedItem(structure.fields, change.item, pageItemDescriptor)) {
|
|
2850
3009
|
continue;
|
|
2851
3010
|
}
|
|
@@ -2908,8 +3067,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2908
3067
|
]);
|
|
2909
3068
|
useEffect(() => {
|
|
2910
3069
|
const bridge = bridgeClientRef.current;
|
|
2911
|
-
const structure =
|
|
2912
|
-
if (!
|
|
3070
|
+
const structure = bridgeStructure;
|
|
3071
|
+
if (!bridgeReady || !bridge || !structure?.fields.length) {
|
|
2913
3072
|
return;
|
|
2914
3073
|
}
|
|
2915
3074
|
let disposed = false;
|
|
@@ -2922,8 +3081,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2922
3081
|
continue;
|
|
2923
3082
|
if (patchedElementKeys.has(structureField.elementKey))
|
|
2924
3083
|
continue;
|
|
2925
|
-
const fallbackItem = pageViewContextRef.current?.pageItemDescriptor ??
|
|
2926
|
-
pageViewContextRef.current?.page?.item?.descriptor;
|
|
3084
|
+
const fallbackItem = pageViewContextRef.current?.getState().pageItemDescriptor ??
|
|
3085
|
+
pageViewContextRef.current?.getState().page?.item?.descriptor;
|
|
2927
3086
|
const bridgeItem = structureField.item;
|
|
2928
3087
|
const itemDescriptor = {
|
|
2929
3088
|
id: bridgeItem?.id ?? fallbackItem?.id,
|
|
@@ -2948,9 +3107,9 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2948
3107
|
itemId: itemDescriptor.id,
|
|
2949
3108
|
language: itemDescriptor.language,
|
|
2950
3109
|
version: itemDescriptor.version,
|
|
2951
|
-
pageItemId: pageViewContextRef.current?.pageItemDescriptor?.id,
|
|
2952
|
-
pageItemLanguage: pageViewContextRef.current?.pageItemDescriptor?.language,
|
|
2953
|
-
pageItemVersion: pageViewContextRef.current?.pageItemDescriptor?.version,
|
|
3110
|
+
pageItemId: pageViewContextRef.current?.getState().pageItemDescriptor?.id,
|
|
3111
|
+
pageItemLanguage: pageViewContextRef.current?.getState().pageItemDescriptor?.language,
|
|
3112
|
+
pageItemVersion: pageViewContextRef.current?.getState().pageItemDescriptor?.version,
|
|
2954
3113
|
};
|
|
2955
3114
|
// Suggestions mode previews every field with pending suggestions. A
|
|
2956
3115
|
// selected suggestion card outside that mode previews only its own
|
|
@@ -2961,7 +3120,12 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
2961
3120
|
showSelectedOnPage: editContext.showSelectedSuggestionOnPage,
|
|
2962
3121
|
}), editContext.suggestedEdits, suggestionField);
|
|
2963
3122
|
const dirtyModifiedField = findModifiedBridgeField({
|
|
2964
|
-
|
|
3123
|
+
// Global React snapshots are intentionally deferred by the store.
|
|
3124
|
+
// An undo refresh can finish before that notification: consult the
|
|
3125
|
+
// live store so a formerly dirty value is not patched over the
|
|
3126
|
+
// authoritative server HTML during this window.
|
|
3127
|
+
modifiedFields: slotContext?.fieldModificationStore.getAllFields() ??
|
|
3128
|
+
fieldsContext?.modifiedFields,
|
|
2965
3129
|
structureField,
|
|
2966
3130
|
field,
|
|
2967
3131
|
itemDescriptor: itemDescriptor,
|
|
@@ -3007,9 +3171,10 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3007
3171
|
editContext.showSelectedSuggestionOnPage,
|
|
3008
3172
|
editContext.suggestedEdits,
|
|
3009
3173
|
fieldsContext?.modifiedFields,
|
|
3174
|
+
slotContext?.fieldModificationStore,
|
|
3010
3175
|
bridgeDomRevision,
|
|
3011
|
-
|
|
3012
|
-
|
|
3176
|
+
bridgeReady,
|
|
3177
|
+
bridgeStructure,
|
|
3013
3178
|
sendBridgeFieldPatch,
|
|
3014
3179
|
]);
|
|
3015
3180
|
useEffect(() => {
|
|
@@ -3051,6 +3216,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3051
3216
|
return (bridgeClientRef.current?.sendCommand("applyRichTextCommand", payload) ??
|
|
3052
3217
|
false);
|
|
3053
3218
|
};
|
|
3219
|
+
const requestBridgeRichTextFieldOptions = (payload) => bridgeClientRef.current?.sendCommand("setRichTextFieldOptions", payload) ??
|
|
3220
|
+
false;
|
|
3054
3221
|
const requestBridgePreviewGap = (payload) => {
|
|
3055
3222
|
return (bridgeClientRef.current?.sendCommand("previewGap", payload) ?? false);
|
|
3056
3223
|
};
|
|
@@ -3085,6 +3252,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3085
3252
|
pageViewContext.requestBridgeScrollBy = requestBridgeScrollBy;
|
|
3086
3253
|
pageViewContext.requestBridgeFieldPatch = sendApplyFieldPatchCommand;
|
|
3087
3254
|
pageViewContext.requestBridgeRichTextCommand = requestBridgeRichTextCommand;
|
|
3255
|
+
pageViewContext.requestBridgeRichTextFieldOptions =
|
|
3256
|
+
requestBridgeRichTextFieldOptions;
|
|
3088
3257
|
pageViewContext.requestBridgePreviewGap = requestBridgePreviewGap;
|
|
3089
3258
|
pageViewContext.requestBridgeCaptureSnapshot = requestBridgeCaptureSnapshot;
|
|
3090
3259
|
pageViewContext.requestBridgeComponentSnapshot =
|
|
@@ -3092,7 +3261,9 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3092
3261
|
pageViewContext.requestBridgePageSnapshot = requestBridgePageSnapshot;
|
|
3093
3262
|
pageViewContext.requestBridgeCancelPointerDrag =
|
|
3094
3263
|
requestBridgeCancelPointerDrag;
|
|
3264
|
+
pageViewContext.setCanvasAttached(true);
|
|
3095
3265
|
return () => {
|
|
3266
|
+
pageViewContext.setCanvasAttached(false);
|
|
3096
3267
|
if (pageViewContext.requestBridgeGeometry === requestBridgeGeometry) {
|
|
3097
3268
|
pageViewContext.requestBridgeGeometry = undefined;
|
|
3098
3269
|
}
|
|
@@ -3124,6 +3295,10 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3124
3295
|
requestBridgeRichTextCommand) {
|
|
3125
3296
|
pageViewContext.requestBridgeRichTextCommand = undefined;
|
|
3126
3297
|
}
|
|
3298
|
+
if (pageViewContext.requestBridgeRichTextFieldOptions ===
|
|
3299
|
+
requestBridgeRichTextFieldOptions) {
|
|
3300
|
+
pageViewContext.requestBridgeRichTextFieldOptions = undefined;
|
|
3301
|
+
}
|
|
3127
3302
|
};
|
|
3128
3303
|
}, [pageViewContext, sendApplyFieldPatchCommand]);
|
|
3129
3304
|
useEffect(() => {
|
|
@@ -3147,8 +3322,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3147
3322
|
if (!iframeRef.current)
|
|
3148
3323
|
return;
|
|
3149
3324
|
const iframe = iframeRef.current;
|
|
3150
|
-
const bridgeGeometry = pageViewContextRef.current?.bridgeGeometry;
|
|
3151
|
-
const bridgeDom = pageViewContextRef.current?.bridgeDom;
|
|
3325
|
+
const bridgeGeometry = pageViewContextRef.current?.getState().bridgeGeometry;
|
|
3326
|
+
const bridgeDom = pageViewContextRef.current?.getState().bridgeDom;
|
|
3152
3327
|
const contentHeight = bridgeDom?.scrollHeight ??
|
|
3153
3328
|
getBridgeGeometryDocumentSize(bridgeGeometry)?.height;
|
|
3154
3329
|
const contentWidth = bridgeDom?.viewport.width ?? bridgeGeometry?.viewport.width;
|
|
@@ -3196,18 +3371,38 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3196
3371
|
? pickVersionAtDate(editContext.itemVersions, editContext.previewDate)
|
|
3197
3372
|
?.version
|
|
3198
3373
|
: undefined;
|
|
3374
|
+
// The page's dynamic renderings, read from the preview canvas, for the strip
|
|
3375
|
+
// that lists them for review and approval (never in compare panes). Client
|
|
3376
|
+
// code that is not approved runs only in the review dialog's sealed frame;
|
|
3377
|
+
// the canvas itself always stays the canvas.
|
|
3378
|
+
const interactivePreviewPage = pageItemDescriptor
|
|
3379
|
+
? {
|
|
3380
|
+
id: pageItemDescriptor.id,
|
|
3381
|
+
language: pageItemDescriptor.language,
|
|
3382
|
+
version: previewDateVersion ?? pageItemDescriptor.version,
|
|
3383
|
+
}
|
|
3384
|
+
: undefined;
|
|
3385
|
+
const interactivePreview = useInteractivePreview({
|
|
3386
|
+
mode: compareView ? undefined : editContext.mode,
|
|
3387
|
+
page: interactivePreviewPage,
|
|
3388
|
+
});
|
|
3389
|
+
const { setHint: setCanvasRenderings } = interactivePreview;
|
|
3390
|
+
// The latest preview canvas URL (without its edit_rev nonce); the review
|
|
3391
|
+
// dialog's sealed frame loads the page with its query.
|
|
3392
|
+
const previewCanvasUrlRef = useRef(undefined);
|
|
3393
|
+
const getPreviewCanvasUrl = useCallback(() => previewCanvasUrlRef.current, []);
|
|
3199
3394
|
useEffect(() => {
|
|
3200
|
-
if (!pageItemDescriptor ||
|
|
3201
|
-
!
|
|
3202
|
-
|
|
3395
|
+
if (!pageItemDescriptor || !editUrl || !previewUrl) {
|
|
3396
|
+
if (!requestedIframeSrcRef.current) {
|
|
3397
|
+
logFieldValueDiagnostic("canvas-load", `frame waiting ctx=${pageViewContext.debugId} compare=${!!compareView} descriptor=${pageItemDescriptor ? `${pageItemDescriptor.id}/v${pageItemDescriptor.version}` : "none"} editUrl=${editUrl ? "yes" : "no"} previewUrl=${previewUrl ? "yes" : "no"}`);
|
|
3398
|
+
}
|
|
3203
3399
|
return;
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
: pageViewContext.editUrl;
|
|
3400
|
+
}
|
|
3401
|
+
const urlPath = editContext.mode === "preview" ? previewUrl : editUrl;
|
|
3207
3402
|
const renderUrl = new URL(urlPath, window.location.origin);
|
|
3208
3403
|
alignLoopbackHostToEditor(renderUrl);
|
|
3209
3404
|
alignXmCloudManagedEditingHostToEditor(renderUrl);
|
|
3210
|
-
applyParheliaRenderContext(renderUrl, pageItemDescriptor, getEditorQueryParam("site") ||
|
|
3405
|
+
applyParheliaRenderContext(renderUrl, pageItemDescriptor, getEditorQueryParam("site") || siteName);
|
|
3211
3406
|
const editRev = uuid();
|
|
3212
3407
|
renderUrl.searchParams.set("edit_rev", editRev);
|
|
3213
3408
|
if (editContext.mode !== "preview" && editContext.sessionId) {
|
|
@@ -3245,7 +3440,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3245
3440
|
}
|
|
3246
3441
|
// Detect if the version in the URL changed - this requires a full reload, not just requestRefresh
|
|
3247
3442
|
// because Next.js router.replace may not properly refetch server data for version changes.
|
|
3248
|
-
const currentIframeUrl = iframeRef.current?.src;
|
|
3443
|
+
const currentIframeUrl = requestedIframeSrcRef.current ?? iframeRef.current?.src;
|
|
3249
3444
|
const currentIframeOrigin = getUrlOrigin(currentIframeUrl);
|
|
3250
3445
|
const renderUrlIsCrossOrigin = renderUrl.origin !== window.location.origin;
|
|
3251
3446
|
const iframeOriginChanged = !!(currentIframeOrigin && currentIframeOrigin !== renderUrl.origin);
|
|
@@ -3266,6 +3461,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3266
3461
|
const initialLoad = currentItemDescriptor?.id !== pageItemDescriptor.id ||
|
|
3267
3462
|
currentItemDescriptor?.language !== pageItemDescriptor.language ||
|
|
3268
3463
|
currentItemDescriptor?.version !== pageItemDescriptor.version;
|
|
3464
|
+
const scrollHandoffKey = getCanvasScrollHandoffKey(pageItemDescriptor);
|
|
3269
3465
|
// A user-requested hard refresh: skip the incremental path entirely. It is
|
|
3270
3466
|
// the escape hatch for the case where the bridge patch is what produced the
|
|
3271
3467
|
// wrong DOM, so routing it through the bridge again would repeat the fault.
|
|
@@ -3279,6 +3475,9 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3279
3475
|
const modeChanged = previousRenderMode !== editContext.mode;
|
|
3280
3476
|
const previewRenderBoundaryChanged = crossesPreviewRenderBoundary(previousRenderMode, editContext.mode);
|
|
3281
3477
|
lastRenderModeRef.current = editContext.mode;
|
|
3478
|
+
if (editContext.mode === "preview") {
|
|
3479
|
+
previewCanvasUrlRef.current = signatureUrl.toString();
|
|
3480
|
+
}
|
|
3282
3481
|
const shouldUseIframeSrcReload = initialLoad ||
|
|
3283
3482
|
iframeOriginChanged ||
|
|
3284
3483
|
fullReloadRequested ||
|
|
@@ -3288,7 +3487,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3288
3487
|
// mode change. Mode is delivered by setEditorMode and cannot change the
|
|
3289
3488
|
// server-rendered URL/revision; reloading during a transient bridge
|
|
3290
3489
|
// disconnect would needlessly reset iframe scroll. Before the first bridge
|
|
3291
|
-
// connection, identical non-mode re-runs still use the recovery path
|
|
3490
|
+
// connection, identical non-mode re-runs still use the recovery path -
|
|
3491
|
+
// deferred while the load they duplicate is settling (see below).
|
|
3292
3492
|
if (!shouldUseIframeSrcReload &&
|
|
3293
3493
|
!versionChanged &&
|
|
3294
3494
|
lastRenderSignatureRef.current === renderSignature &&
|
|
@@ -3304,12 +3504,29 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3304
3504
|
// its own landing position. Restoring the previous page's scroll on
|
|
3305
3505
|
// ready would yank the canvas off that spot.
|
|
3306
3506
|
pendingRefreshScrollRef.current = undefined;
|
|
3507
|
+
pendingScrollAnchorRef.current = undefined;
|
|
3307
3508
|
}
|
|
3308
3509
|
else if (!pendingRefreshScrollRef.current) {
|
|
3510
|
+
// This frame's first load continues where a frame that just unmounted
|
|
3511
|
+
// for the same page (layout switch) left off.
|
|
3512
|
+
const handoff = currentItemDescriptor === undefined
|
|
3513
|
+
? takeCanvasScrollHandoff(scrollHandoffKey)
|
|
3514
|
+
: undefined;
|
|
3515
|
+
if (handoff) {
|
|
3516
|
+
// The page view context outlives the frame: its geometry still
|
|
3517
|
+
// describes the previous layout, and must not position the anchor
|
|
3518
|
+
// (or be projected onto this document's first scroll).
|
|
3519
|
+
pageViewContext.setBridgeGeometry(undefined);
|
|
3520
|
+
}
|
|
3521
|
+
pendingScrollAnchorRef.current = handoff?.anchor;
|
|
3309
3522
|
pendingRefreshScrollRef.current =
|
|
3310
|
-
|
|
3523
|
+
handoff?.scroll ??
|
|
3524
|
+
getIframeWindowScroll(iframeRef.current) ??
|
|
3311
3525
|
latestBridgeScrollRef.current;
|
|
3312
3526
|
pendingRefreshScrollCapturedAtRef.current = Date.now();
|
|
3527
|
+
if (currentItemDescriptor === undefined) {
|
|
3528
|
+
logFieldValueDiagnostic("canvas-load", `frame handoff ctx=${pageViewContext.debugId} taken=${handoff ? `y=${handoff.scroll.y}` : "none"} target=${pendingRefreshScrollRef.current ? `y=${pendingRefreshScrollRef.current.y}` : "none"}`);
|
|
3529
|
+
}
|
|
3313
3530
|
}
|
|
3314
3531
|
canvasRefreshInFlightSinceRef.current = Date.now();
|
|
3315
3532
|
awaitingHostAppRefreshRenderRef.current = false;
|
|
@@ -3324,6 +3541,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3324
3541
|
: fullReloadRequested
|
|
3325
3542
|
? "Hard refresh requested - setting iframe src"
|
|
3326
3543
|
: "Reloading iframe src");
|
|
3544
|
+
logFieldValueDiagnostic("canvas-load", `frame load ctx=${pageViewContext.debugId} compare=${!!compareView} page=${pageItemDescriptor?.id}/v${pageItemDescriptor?.version} initial=${initialLoad}`);
|
|
3327
3545
|
setLoadedIframeSrc(undefined);
|
|
3328
3546
|
// A canvas link navigation may carry a #anchor; the browser scrolls the
|
|
3329
3547
|
// freshly loaded document to it natively.
|
|
@@ -3331,6 +3549,12 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3331
3549
|
renderUrl.hash = pendingCanvasAnchorRef.current;
|
|
3332
3550
|
pendingCanvasAnchorRef.current = undefined;
|
|
3333
3551
|
}
|
|
3552
|
+
requestedIframeSrcRef.current = renderUrl.toString();
|
|
3553
|
+
inFlightCanvasLoadRef.current = {
|
|
3554
|
+
signatureUrl: signatureUrl.toString(),
|
|
3555
|
+
requestedSrc: renderUrl.toString(),
|
|
3556
|
+
startedAt: Date.now(),
|
|
3557
|
+
};
|
|
3334
3558
|
setIframeSrc(renderUrl.toString());
|
|
3335
3559
|
}
|
|
3336
3560
|
function runBridgeRefresh() {
|
|
@@ -3371,11 +3595,52 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3371
3595
|
}
|
|
3372
3596
|
else {
|
|
3373
3597
|
const retryDelayMs = 150;
|
|
3374
|
-
const
|
|
3375
|
-
|
|
3376
|
-
|
|
3598
|
+
const signatureUrlString = signatureUrl.toString();
|
|
3599
|
+
// No bridge yet. When the full load for this same URL is still
|
|
3600
|
+
// settling - the usual page open: the revision arrives or a dependency
|
|
3601
|
+
// changes identity right after src was set, before the bridge
|
|
3602
|
+
// handshake - the recovery path would issue a second full load that
|
|
3603
|
+
// differs only by its edit_rev nonce. Poll until that load settles
|
|
3604
|
+
// instead: a ready bridge either already covers this signature or
|
|
3605
|
+
// applies it incrementally, and a load that never yields a bridge
|
|
3606
|
+
// still gets the recovery reload. Outside that window the single
|
|
3607
|
+
// retry keeps the pre-bridge recovery behaviour unchanged.
|
|
3608
|
+
const deferToInFlightLoad = isCanvasLoadSettling(inFlightCanvasLoadRef.current, signatureUrlString, Date.now());
|
|
3609
|
+
if (deferToInFlightLoad) {
|
|
3610
|
+
console.log("Deferring canvas refresh - initial load in flight");
|
|
3611
|
+
}
|
|
3612
|
+
let retryTimer;
|
|
3613
|
+
const retry = () => {
|
|
3614
|
+
retryTimer = undefined;
|
|
3615
|
+
if (!deferToInFlightLoad) {
|
|
3616
|
+
runBridgeRefresh();
|
|
3617
|
+
return;
|
|
3618
|
+
}
|
|
3619
|
+
const decision = resolveDeferredCanvasRefresh({
|
|
3620
|
+
bridgeSupportsRefresh: !!bridgeClientRef.current?.supportsCapability("refresh"),
|
|
3621
|
+
renderSignature,
|
|
3622
|
+
lastAppliedSignature: lastRenderSignatureRef.current,
|
|
3623
|
+
load: inFlightCanvasLoadRef.current,
|
|
3624
|
+
signatureUrl: signatureUrlString,
|
|
3625
|
+
now: Date.now(),
|
|
3626
|
+
});
|
|
3627
|
+
if (decision === "wait") {
|
|
3628
|
+
retryTimer = setTimeout(retry, retryDelayMs);
|
|
3629
|
+
}
|
|
3630
|
+
else if (decision === "bridge-refresh") {
|
|
3631
|
+
runBridgeRefresh();
|
|
3632
|
+
}
|
|
3633
|
+
else if (decision === "reload") {
|
|
3634
|
+
runFallbackRefresh();
|
|
3635
|
+
}
|
|
3636
|
+
// "skip": the settled load already rendered this signature.
|
|
3637
|
+
};
|
|
3638
|
+
retryTimer = setTimeout(retry, retryDelayMs);
|
|
3377
3639
|
setCurrentItemDescriptor(pageItemDescriptor);
|
|
3378
|
-
return () =>
|
|
3640
|
+
return () => {
|
|
3641
|
+
if (retryTimer !== undefined)
|
|
3642
|
+
clearTimeout(retryTimer);
|
|
3643
|
+
};
|
|
3379
3644
|
}
|
|
3380
3645
|
}
|
|
3381
3646
|
else {
|
|
@@ -3387,16 +3652,42 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3387
3652
|
editContext.revision,
|
|
3388
3653
|
editContext.fullReloadToken,
|
|
3389
3654
|
pageItemDescriptor,
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3655
|
+
editUrl,
|
|
3656
|
+
previewUrl,
|
|
3657
|
+
siteName,
|
|
3658
|
+
fullscreen,
|
|
3394
3659
|
editContext.mode,
|
|
3395
3660
|
editContext.previewDate,
|
|
3396
3661
|
previewDateVersion,
|
|
3397
3662
|
editContext.sessionId,
|
|
3398
3663
|
editContext.layoutMode,
|
|
3399
3664
|
]);
|
|
3665
|
+
// The rendering host wraps every dynamic rendering in the canvas document
|
|
3666
|
+
// (same-origin) and, in preview mode, lists those with client code in a
|
|
3667
|
+
// hint. Read them once the canvas has loaded, and again when the host
|
|
3668
|
+
// reports DOM changes. Declared after the render effect: a load that effect
|
|
3669
|
+
// has just requested means the document is outdated. The primary canvas also
|
|
3670
|
+
// records them, in edit mode too, for the publish dialog's approval warning.
|
|
3671
|
+
useEffect(() => {
|
|
3672
|
+
if (!iframeElement ||
|
|
3673
|
+
!loadedIframeSrc ||
|
|
3674
|
+
requestedIframeSrcRef.current !== loadedIframeSrc) {
|
|
3675
|
+
return;
|
|
3676
|
+
}
|
|
3677
|
+
const renderings = readCanvasRenderings(iframeElement);
|
|
3678
|
+
setCanvasRenderings(renderings);
|
|
3679
|
+
if (!compareView && pageItemDescriptor) {
|
|
3680
|
+
recordPageRenderingIds(pageItemDescriptor, renderings.renderingIds);
|
|
3681
|
+
}
|
|
3682
|
+
}, [
|
|
3683
|
+
bridgeDomRevision,
|
|
3684
|
+
compareView,
|
|
3685
|
+
editContext.mode,
|
|
3686
|
+
iframeElement,
|
|
3687
|
+
loadedIframeSrc,
|
|
3688
|
+
pageItemDescriptor,
|
|
3689
|
+
setCanvasRenderings,
|
|
3690
|
+
]);
|
|
3400
3691
|
useEffect(() => {
|
|
3401
3692
|
if (fieldsContext?.focusedField) {
|
|
3402
3693
|
const focusedField = fieldsContext.focusedField;
|
|
@@ -3429,7 +3720,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3429
3720
|
focusedField.item.id !== currentSelection[0])
|
|
3430
3721
|
return;
|
|
3431
3722
|
lastScrolledFocusedFieldKeyRef.current = focusedFieldKey;
|
|
3432
|
-
const bounds = findBridgeFieldDocumentBounds(pageViewContextRef.current?.bridgeGeometry, focusedField);
|
|
3723
|
+
const bounds = findBridgeFieldDocumentBounds(pageViewContextRef.current?.getState().bridgeGeometry, focusedField);
|
|
3433
3724
|
const activePageViewContext = pageViewContextRef.current;
|
|
3434
3725
|
if (bounds && activePageViewContext) {
|
|
3435
3726
|
scrollBridgeBoundsIntoView(activePageViewContext, bounds, latestBridgeScrollRef.current);
|
|
@@ -3487,15 +3778,33 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3487
3778
|
if (isCanvasRefreshInFlight())
|
|
3488
3779
|
return;
|
|
3489
3780
|
if (!fieldsContext?.focusedField && canvasSelection.length > 0) {
|
|
3490
|
-
const lastSelectedComponent = getComponentById(canvasSelection[canvasSelection.length - 1], pageViewContextRef.current.page);
|
|
3781
|
+
const lastSelectedComponent = getComponentById(canvasSelection[canvasSelection.length - 1], pageViewContextRef.current.getState().page);
|
|
3491
3782
|
if (lastSelectedComponent) {
|
|
3492
3783
|
editContext.setScrollIntoView(lastSelectedComponent.id);
|
|
3493
3784
|
}
|
|
3494
3785
|
}
|
|
3495
3786
|
}, [canvasSelection, fieldsContext?.focusedField, isCanvasRefreshInFlight]);
|
|
3496
3787
|
useEffect(() => {
|
|
3497
|
-
|
|
3788
|
+
// The scroll's text-range query lives only while its request is pending:
|
|
3789
|
+
// once the request is resolved, replaced by a target of another kind or
|
|
3790
|
+
// withdrawn by whoever set it, the range must not stay in the union and
|
|
3791
|
+
// be measured on every geometry, and a later request for the same target
|
|
3792
|
+
// must query afresh.
|
|
3793
|
+
const endScrollIntoViewRequest = () => {
|
|
3794
|
+
const requestState = scrollIntoViewRequestRef.current;
|
|
3795
|
+
requestState.signature = "";
|
|
3796
|
+
requestState.requestedTextRangeGeometry = false;
|
|
3797
|
+
if (bridgeTextRangeSourcesRef.current.has(SCROLL_INTO_VIEW_BRIDGE_SOURCE)) {
|
|
3798
|
+
pageViewContextRef.current?.requestBridgeGeometry?.({
|
|
3799
|
+
source: SCROLL_INTO_VIEW_BRIDGE_SOURCE,
|
|
3800
|
+
textRanges: [],
|
|
3801
|
+
});
|
|
3802
|
+
}
|
|
3803
|
+
};
|
|
3804
|
+
if (!editContext.scrollIntoView) {
|
|
3805
|
+
endScrollIntoViewRequest();
|
|
3498
3806
|
return;
|
|
3807
|
+
}
|
|
3499
3808
|
const activePageViewContext = pageViewContextRef.current;
|
|
3500
3809
|
if (!activePageViewContext)
|
|
3501
3810
|
return;
|
|
@@ -3524,26 +3833,54 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3524
3833
|
return;
|
|
3525
3834
|
}
|
|
3526
3835
|
}
|
|
3527
|
-
const
|
|
3836
|
+
const bridgeGeometry = activePageViewContext.getState().bridgeGeometry;
|
|
3837
|
+
const exactBounds = findScrollIntoViewDocumentBounds(bridgeGeometry, scrollTarget, { includeTextRangeFallback: false });
|
|
3528
3838
|
let bounds = exactBounds;
|
|
3529
|
-
bounds ??= findScrollIntoViewDocumentBounds(
|
|
3839
|
+
bounds ??= findScrollIntoViewDocumentBounds(bridgeGeometry, scrollTarget, {
|
|
3840
|
+
includeTextRangeFallback: true,
|
|
3841
|
+
});
|
|
3530
3842
|
if (bounds) {
|
|
3531
3843
|
scrollBridgeBoundsIntoView(activePageViewContext, bounds, latestBridgeScrollRef.current);
|
|
3532
3844
|
}
|
|
3533
|
-
|
|
3534
|
-
activePageViewContext.requestBridgeGeometry?.({
|
|
3535
|
-
source: SCROLL_INTO_VIEW_BRIDGE_SOURCE,
|
|
3536
|
-
textRanges: [],
|
|
3537
|
-
});
|
|
3538
|
-
}
|
|
3539
|
-
requestState.signature = "";
|
|
3540
|
-
requestState.requestedTextRangeGeometry = false;
|
|
3845
|
+
endScrollIntoViewRequest();
|
|
3541
3846
|
editContext.setScrollIntoView(undefined);
|
|
3542
3847
|
}, [
|
|
3543
3848
|
editContext.scrollIntoView,
|
|
3544
|
-
|
|
3545
|
-
|
|
3849
|
+
page,
|
|
3850
|
+
// Runs again for each geometry the bridge reports (read above).
|
|
3851
|
+
bridgeGeometryRevision,
|
|
3852
|
+
isCanvasRefreshInFlight,
|
|
3853
|
+
]);
|
|
3854
|
+
// A layout switch changes the canvas width, so the page reflows and the
|
|
3855
|
+
// handed-over pixel offset alone no longer shows the same content. The first
|
|
3856
|
+
// geometry of the new document puts the selected component back at its
|
|
3857
|
+
// previous distance from the canvas top; without it (component not
|
|
3858
|
+
// rendered), the plain offset is restored.
|
|
3859
|
+
useEffect(() => {
|
|
3860
|
+
const anchor = pendingScrollAnchorRef.current;
|
|
3861
|
+
const geometry = pageViewContext.getState().bridgeGeometry;
|
|
3862
|
+
if (!anchor || !geometry || isCanvasRefreshInFlight())
|
|
3863
|
+
return;
|
|
3864
|
+
pendingScrollAnchorRef.current = undefined;
|
|
3865
|
+
const bounds = findBridgeComponentDocumentBounds(geometry, anchor.componentId);
|
|
3866
|
+
const targetScroll = bounds
|
|
3867
|
+
? {
|
|
3868
|
+
x: geometry.scroll.x,
|
|
3869
|
+
y: Math.max(0, (bounds.y - anchor.viewportTop) /
|
|
3870
|
+
getBridgeGeometryScrollScale(geometry)),
|
|
3871
|
+
}
|
|
3872
|
+
: pendingRefreshScrollRef.current;
|
|
3873
|
+
logFieldValueDiagnostic("canvas-load", `scroll anchor ctx=${pageViewContext.debugId} component=${anchor.componentId} top=${Math.round(anchor.viewportTop)} bounds=${bounds ? Math.round(bounds.y) : "none"} target=${targetScroll ? `y=${Math.round(targetScroll.y)}` : "none"}`);
|
|
3874
|
+
if (!targetScroll)
|
|
3875
|
+
return;
|
|
3876
|
+
pendingRefreshScrollRef.current = targetScroll;
|
|
3877
|
+
pendingRefreshScrollCapturedAtRef.current = Date.now();
|
|
3878
|
+
restorePendingRefreshScroll(iframeRef.current, targetScroll, geometry.scroll);
|
|
3879
|
+
}, [
|
|
3880
|
+
// Runs again for each geometry the bridge reports (read above).
|
|
3881
|
+
bridgeGeometryRevision,
|
|
3546
3882
|
isCanvasRefreshInFlight,
|
|
3883
|
+
restorePendingRefreshScroll,
|
|
3547
3884
|
]);
|
|
3548
3885
|
useEffect(() => {
|
|
3549
3886
|
const handleMessage = (message) => {
|
|
@@ -3567,7 +3904,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3567
3904
|
return;
|
|
3568
3905
|
const handleLoad = () => {
|
|
3569
3906
|
setShowSpinner(false);
|
|
3570
|
-
applyIframeZoom(iframe, pageViewContextRef.current?.zoom ?? 1, "PageViewerFrame.tsx:handleLoad-zoom");
|
|
3907
|
+
applyIframeZoom(iframe, pageViewContextRef.current?.getState().zoom ?? 1, "PageViewerFrame.tsx:handleLoad-zoom");
|
|
3571
3908
|
};
|
|
3572
3909
|
iframe.addEventListener("load", handleLoad);
|
|
3573
3910
|
return () => {
|
|
@@ -3637,8 +3974,15 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3637
3974
|
mode: editContext.mode,
|
|
3638
3975
|
readOnly: editContext.readonly,
|
|
3639
3976
|
suggestionsCursorActive: !isBridgeInlineEditing && editContext.mode === "suggestions",
|
|
3977
|
+
commentPickerActive: pickingCommentTarget && !compareView,
|
|
3640
3978
|
});
|
|
3641
|
-
}, [
|
|
3979
|
+
}, [
|
|
3980
|
+
editContext.mode,
|
|
3981
|
+
editContext.readonly,
|
|
3982
|
+
isBridgeInlineEditing,
|
|
3983
|
+
pickingCommentTarget,
|
|
3984
|
+
compareView,
|
|
3985
|
+
]);
|
|
3642
3986
|
useEffect(() => {
|
|
3643
3987
|
const previousMode = previousBridgeInlineEditModeRef.current;
|
|
3644
3988
|
previousBridgeInlineEditModeRef.current = editContext.mode;
|
|
@@ -3672,7 +4016,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3672
4016
|
};
|
|
3673
4017
|
}, [zoom]);
|
|
3674
4018
|
useEffect(() => {
|
|
3675
|
-
if (!
|
|
4019
|
+
if (!bridgeReady ||
|
|
3676
4020
|
(!editContext.dragObject &&
|
|
3677
4021
|
!editContext.selectedForInsertion &&
|
|
3678
4022
|
!editContext.insertMode)) {
|
|
@@ -3686,33 +4030,22 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3686
4030
|
editContext.dragObject,
|
|
3687
4031
|
editContext.insertMode,
|
|
3688
4032
|
editContext.selectedForInsertion,
|
|
3689
|
-
|
|
4033
|
+
bridgeReady,
|
|
3690
4034
|
]);
|
|
4035
|
+
// A device or size change reflows the page: tell the bridge the zoom again
|
|
4036
|
+
// and measure once the transition settled.
|
|
3691
4037
|
useEffect(() => {
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
bridgeClientRef.current?.sendCommand("
|
|
3697
|
-
|
|
3698
|
-
});
|
|
3699
|
-
if (geometryTimer != null) {
|
|
3700
|
-
window.clearTimeout(geometryTimer);
|
|
3701
|
-
}
|
|
3702
|
-
geometryTimer = window.setTimeout(() => {
|
|
3703
|
-
geometryTimer = null;
|
|
3704
|
-
bridgeClientRef.current?.sendCommand("queryGeometry", {});
|
|
3705
|
-
}, ZOOM_TRANSITION_MS + 75);
|
|
3706
|
-
};
|
|
3707
|
-
window.addEventListener(DEVICE_CHANGE_EVENT, sendViewportStateToBridge);
|
|
4038
|
+
bridgeClientRef.current?.sendCommand("setZoom", {
|
|
4039
|
+
zoom: pageViewContext.getState().zoom,
|
|
4040
|
+
});
|
|
4041
|
+
const geometryTimer = window.setTimeout(() => {
|
|
4042
|
+
bridgeClientRef.current?.sendCommand("queryGeometry", {});
|
|
4043
|
+
}, ZOOM_TRANSITION_MS + 75);
|
|
3708
4044
|
return () => {
|
|
3709
|
-
|
|
3710
|
-
window.clearTimeout(geometryTimer);
|
|
3711
|
-
}
|
|
3712
|
-
window.removeEventListener(DEVICE_CHANGE_EVENT, sendViewportStateToBridge);
|
|
4045
|
+
window.clearTimeout(geometryTimer);
|
|
3713
4046
|
};
|
|
3714
|
-
}, [
|
|
3715
|
-
const shouldRenderMiniMap = !
|
|
4047
|
+
}, [pageViewContext, device, deviceWidth, deviceHeight]);
|
|
4048
|
+
const shouldRenderMiniMap = !fullscreen &&
|
|
3716
4049
|
showMiniMap &&
|
|
3717
4050
|
editContext.showMinimap &&
|
|
3718
4051
|
!editContext.isMobile &&
|
|
@@ -3730,6 +4063,58 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3730
4063
|
const miniMapColumnWidth = editContext.configuration.outline.width || 100;
|
|
3731
4064
|
const reportCompareFrameWidth = slotContext?.reportCompareFrameWidth;
|
|
3732
4065
|
const miniMapReservedWidth = shouldRenderMiniMap ? miniMapColumnWidth : 0;
|
|
4066
|
+
// The pane's content width decides how wide the comment margin is beside
|
|
4067
|
+
// the canvas. The pane is the splitter panel around this frame, so resizing
|
|
4068
|
+
// the margin inside it does not change the measurement (no flapping).
|
|
4069
|
+
const [frameContainerWidth, setFrameContainerWidth] = useState();
|
|
4070
|
+
useLayoutEffect(() => {
|
|
4071
|
+
const container = frameContainerRef.current;
|
|
4072
|
+
if (!container || typeof ResizeObserver === "undefined")
|
|
4073
|
+
return;
|
|
4074
|
+
const measure = () => {
|
|
4075
|
+
const style = window.getComputedStyle(container);
|
|
4076
|
+
const padding = (parseFloat(style.paddingLeft) || 0) +
|
|
4077
|
+
(parseFloat(style.paddingRight) || 0);
|
|
4078
|
+
const width = container.clientWidth - padding;
|
|
4079
|
+
setFrameContainerWidth((previous) => previous === width ? previous : width);
|
|
4080
|
+
};
|
|
4081
|
+
measure();
|
|
4082
|
+
const observer = new ResizeObserver(measure);
|
|
4083
|
+
observer.observe(container);
|
|
4084
|
+
return () => observer.disconnect();
|
|
4085
|
+
}, []);
|
|
4086
|
+
// The comment margin sits beside the canvas of the primary pane. Compare
|
|
4087
|
+
// panes share one iframe width, so its column counts against the width
|
|
4088
|
+
// this pane reports exactly like the minimap column does.
|
|
4089
|
+
const shouldRenderFeedbackMargin = shouldShowFeedbackMargin({
|
|
4090
|
+
showComments: !!editContext.showComments,
|
|
4091
|
+
compareView,
|
|
4092
|
+
isMobile: !!editContext.isMobile,
|
|
4093
|
+
fullscreen: !!fullscreen,
|
|
4094
|
+
slotActive: slotContext?.isActive ?? true,
|
|
4095
|
+
hasLayout: !!page?.item?.hasLayout,
|
|
4096
|
+
});
|
|
4097
|
+
// Takes the width the user dragged it to (or the rail they dragged it into)
|
|
4098
|
+
// where the pane has room for it; narrows first, then collapses into a
|
|
4099
|
+
// rail; never hidden for lack of room.
|
|
4100
|
+
const feedbackMarginPreferredWidth = useFeedbackMarginPreferredWidth();
|
|
4101
|
+
const feedbackMarginCollapsed = useFeedbackMarginCollapsed();
|
|
4102
|
+
const feedbackMarginRoom = getFeedbackMarginRoom({
|
|
4103
|
+
paneWidth: frameContainerWidth,
|
|
4104
|
+
reservedWidth: miniMapReservedWidth,
|
|
4105
|
+
});
|
|
4106
|
+
const feedbackMarginSize = resolveFeedbackMarginSize({
|
|
4107
|
+
paneWidth: frameContainerWidth,
|
|
4108
|
+
reservedWidth: miniMapReservedWidth,
|
|
4109
|
+
maxWidth: feedbackMarginPreferredWidth,
|
|
4110
|
+
minWidth: FEEDBACK_MARGIN_MIN_WIDTH,
|
|
4111
|
+
railWidth: FEEDBACK_MARGIN_RAIL_WIDTH,
|
|
4112
|
+
collapsed: feedbackMarginCollapsed,
|
|
4113
|
+
});
|
|
4114
|
+
const feedbackMarginReservedWidth = shouldRenderFeedbackMargin
|
|
4115
|
+
? feedbackMarginSize.width
|
|
4116
|
+
: 0;
|
|
4117
|
+
const overlayInvalidationKey = `${zoom}:${bridgeGeometryRevision}:${feedbackMarginReservedWidth}`;
|
|
3733
4118
|
useLayoutEffect(() => {
|
|
3734
4119
|
if (!inCompareMode || !reportCompareFrameWidth)
|
|
3735
4120
|
return;
|
|
@@ -3740,7 +4125,10 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3740
4125
|
const style = window.getComputedStyle(container);
|
|
3741
4126
|
const padding = (parseFloat(style.paddingLeft) || 0) +
|
|
3742
4127
|
(parseFloat(style.paddingRight) || 0);
|
|
3743
|
-
const available = container.clientWidth -
|
|
4128
|
+
const available = container.clientWidth -
|
|
4129
|
+
padding -
|
|
4130
|
+
miniMapReservedWidth -
|
|
4131
|
+
feedbackMarginReservedWidth;
|
|
3744
4132
|
reportCompareFrameWidth(compareFrameView, available > 0 ? available : undefined);
|
|
3745
4133
|
};
|
|
3746
4134
|
report();
|
|
@@ -3752,6 +4140,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3752
4140
|
reportCompareFrameWidth,
|
|
3753
4141
|
compareFrameView,
|
|
3754
4142
|
miniMapReservedWidth,
|
|
4143
|
+
feedbackMarginReservedWidth,
|
|
3755
4144
|
]);
|
|
3756
4145
|
// Withdraw this pane's report only on unmount, so a minimap toggle or a
|
|
3757
4146
|
// resize does not briefly drop the other pane back to full width.
|
|
@@ -3759,34 +4148,42 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3759
4148
|
return () => reportCompareFrameWidth?.(compareFrameView, undefined);
|
|
3760
4149
|
}, [reportCompareFrameWidth, compareFrameView]);
|
|
3761
4150
|
const sharedCompareFrameWidth = useSyncExternalStore(slotContext?.subscribeCompareFrameWidth ?? subscribeToNothing, slotContext?.getCompareFrameWidth ?? getUndefined, getUndefined);
|
|
3762
|
-
if (
|
|
4151
|
+
if (page?.item && !page.item.hasLayout) {
|
|
3763
4152
|
return _jsx(NoLayout, {});
|
|
3764
4153
|
}
|
|
3765
|
-
const isResponsiveDevice =
|
|
3766
|
-
|
|
3767
|
-
const deviceHeight = pageViewContext.device === "desktop" || !pageViewContext.deviceHeight
|
|
3768
|
-
? "100%"
|
|
3769
|
-
: pageViewContext.deviceHeight || 640;
|
|
4154
|
+
const isResponsiveDevice = device === "desktop" || device === "Responsive";
|
|
4155
|
+
const frameHeight = device === "desktop" || !deviceHeight ? "100%" : deviceHeight || 640;
|
|
3770
4156
|
const compareFrameWidth = inCompareMode ? sharedCompareFrameWidth : undefined;
|
|
3771
|
-
const
|
|
4157
|
+
const frameWidth = isResponsiveDevice
|
|
3772
4158
|
? compareFrameWidth !== undefined
|
|
3773
|
-
? compareFrameWidth +
|
|
4159
|
+
? compareFrameWidth +
|
|
4160
|
+
miniMapReservedWidth +
|
|
4161
|
+
feedbackMarginReservedWidth +
|
|
4162
|
+
"px"
|
|
3774
4163
|
: "100%"
|
|
3775
4164
|
: inCompareMode
|
|
3776
|
-
? (
|
|
3777
|
-
|
|
4165
|
+
? (deviceWidth || 640) +
|
|
4166
|
+
miniMapReservedWidth +
|
|
4167
|
+
feedbackMarginReservedWidth +
|
|
4168
|
+
"px"
|
|
4169
|
+
: (deviceWidth || 640) +
|
|
3778
4170
|
editContext.configuration.outline.width +
|
|
4171
|
+
feedbackMarginReservedWidth +
|
|
3779
4172
|
"px";
|
|
3780
4173
|
const showSuggestionsCursor = !isBridgeInlineEditing && editContext.mode === "suggestions";
|
|
3781
|
-
|
|
3782
|
-
|
|
4174
|
+
const showDynamicRenderingsStrip = !compareView &&
|
|
4175
|
+
editContext.mode === "preview" &&
|
|
4176
|
+
interactivePreview.renderingIds.length > 0;
|
|
4177
|
+
return (_jsxs("div", { ref: frameContainerRef, className: cn("relative flex h-full w-full flex-col items-center select-none", className, editContext.showAgentsPanel && !editContext.currentWizardId && "pr-0"), children: [!fullscreen && _jsx(EditorWarnings, { item: page?.item }), slotCloseButton && (_jsx("div", { className: "absolute top-3 right-3 z-50", children: slotCloseButton })), fullscreen && (_jsxs("div", { className: "border-neutral-grey-15 relative z-40 grid h-11 w-full shrink-0 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center border-b bg-white px-3 shadow-sm", "data-testid": "fullscreen-page-title-bar", children: [_jsx("div", { className: "w-full min-w-0 pr-3 text-left", children: _jsx(PageSelector, { itemDescriptor: page?.item, variant: "fullscreen" }) }), _jsx("div", { className: "justify-self-center", children: _jsx(FullscreenControls, { pageViewContext: pageViewContext, canExit: !editContext.configuration.forceFullscreen, onExit: () => editContext.setFullscreen(false) }) }), _jsx("div", { "aria-hidden": "true" })] })), showDynamicRenderingsStrip && (_jsx(DynamicRenderingsStrip, { page: interactivePreviewPage, renderingIds: interactivePreview.renderingIds, getCanvasUrl: getPreviewCanvasUrl })), 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: {
|
|
4178
|
+
width: frameWidth,
|
|
3783
4179
|
}, children: [_jsxs("div", { className: "relative h-full w-full overflow-visible", onMouseLeave: () => {
|
|
3784
|
-
if (pageViewContext.bridgeInteraction?.kind === "hover") {
|
|
4180
|
+
if (pageViewContext.getState().bridgeInteraction?.kind === "hover") {
|
|
4181
|
+
setPasteCleanupMenu(undefined);
|
|
3785
4182
|
setBridgeInteraction(undefined);
|
|
3786
4183
|
pageViewContext.setBridgeInteraction(undefined);
|
|
3787
4184
|
}
|
|
3788
4185
|
}, children: [_jsx("iframe", { ref: bindIframeRef, className: "page-iframe h-full w-full bg-white transition-[height] duration-300 ease-in-out motion-reduce:transition-none", style: {
|
|
3789
|
-
height:
|
|
4186
|
+
height: frameHeight,
|
|
3790
4187
|
// The iframe element exists before its document has loaded. Keep
|
|
3791
4188
|
// that blank document out of both the UI and accessibility tree;
|
|
3792
4189
|
// consumers can treat a visible canvas as a rendered canvas.
|
|
@@ -3794,7 +4191,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3794
4191
|
cursor: showSuggestionsCursor
|
|
3795
4192
|
? SUGGESTIONS_CURSOR_VALUE
|
|
3796
4193
|
: undefined,
|
|
3797
|
-
},
|
|
4194
|
+
}, "data-testid": "pageEditoriframe", onLoad: () => {
|
|
3798
4195
|
const iframe = iframeRef.current;
|
|
3799
4196
|
if (iframeSrc && iframe) {
|
|
3800
4197
|
parentBridgeInjectionRef.current?.dispose();
|
|
@@ -3807,13 +4204,18 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3807
4204
|
latestParentBridgeInjectionRef.current =
|
|
3808
4205
|
parentBridgeInjectionRef.current.attempt;
|
|
3809
4206
|
}
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
4207
|
+
if (iframeSrc) {
|
|
4208
|
+
const inFlightLoad = inFlightCanvasLoadRef.current;
|
|
4209
|
+
if (inFlightLoad &&
|
|
4210
|
+
inFlightLoad.requestedSrc === iframeSrc &&
|
|
4211
|
+
inFlightLoad.loadedAt === undefined) {
|
|
4212
|
+
inFlightLoad.loadedAt = Date.now();
|
|
4213
|
+
}
|
|
4214
|
+
setLoadedIframeSrc(iframeSrc);
|
|
3813
4215
|
}
|
|
3814
4216
|
const sendZoomToBridge = () => {
|
|
3815
4217
|
bridgeClientRef.current?.sendCommand("setZoom", {
|
|
3816
|
-
zoom: pageViewContextRef.current?.zoom ?? zoom,
|
|
4218
|
+
zoom: pageViewContextRef.current?.getState().zoom ?? zoom,
|
|
3817
4219
|
});
|
|
3818
4220
|
};
|
|
3819
4221
|
sendZoomToBridge();
|
|
@@ -3827,6 +4229,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
|
|
|
3827
4229
|
}
|
|
3828
4230
|
completeCanvasRefresh();
|
|
3829
4231
|
}
|
|
3830
|
-
} }), iframeElement && (
|
|
4232
|
+
} }, "canvas"), _jsxs(OverviewRulerContext.Provider, { value: overviewRulerStore, children: [iframeElement && (_jsxs(IframeOverlayProvider, { iframe: iframeElement, mode: "scrolling", scrollScale: 1, visualScale: 1, invalidationKey: overlayInvalidationKey, deferredInvalidationMs: ZOOM_TRANSITION_MS + 50, bleed: { top: 2, right: 150, bottom: 2, left: 2 }, children: [_jsx(PageEditorChrome, { iframe: iframeElement, compareView: compareView, pageViewContext: pageViewContext, bridgeInteraction: bridgeInteraction, onBridgeRichTextCommand: sendApplyRichTextCommand }), pasteCleanupMenu && editContext.mode !== "preview" && (_jsx(BridgePasteCleanupOverlay, { iframe: iframeElement, menu: pasteCleanupMenu, onCommand: sendPasteCleanupCommand }))] })), _jsx(CanvasOverviewRuler, { height: frameHeight })] }), deviceHeight && device && (_jsx("div", { className: "bg-neutral-grey-5 relative z-40 h-full w-full" }))] }), shouldRenderFeedbackMargin && (_jsx(FeedbackMargin, { iframe: iframeElement, pageViewContext: pageViewContext, height: frameHeight, size: feedbackMarginSize, maxResizeWidth: feedbackMarginRoom, invalidationKey: overlayInvalidationKey, deferredInvalidationMs: ZOOM_TRANSITION_MS + 50 })), shouldRenderMiniMap && (_jsx(MiniMap, { compareView: compareView, scroll: scroll, mainViewIframeRef: iframeRef, pageViewContext: pageViewContext })), showSpinner && (_jsxs(_Fragment, { children: [_jsx("div", { className: "bg-neutral-grey-5/50 absolute top-0 left-0 h-full w-full" }), _jsx("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: _jsx(Spinner, {}) })] }))] }), _jsx(FieldActionsOverlay, { ref: fieldActionsOverlay, generatorButtons: contextMenuFieldButtons, onActionClick: handleActionClick, onParameterizedActionExecute: handleParameterizedActionExecute, currentOverlay: editContext?.currentOverlay, fieldId: contextMenuField?.fieldId || "", setCurrentOverlay: editContext?.setCurrentOverlay || (() => { }), preSelectedAction: preSelectedAction })] }));
|
|
3831
4233
|
}
|
|
3832
4234
|
//# sourceMappingURL=PageViewerFrame.js.map
|