@parhelia/core 0.3.12771 → 0.3.12788

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.
Files changed (574) hide show
  1. package/dist/agents-view/AgentCard.js +1 -5
  2. package/dist/agents-view/AgentCard.js.map +1 -1
  3. package/dist/agents-view/AgentsView.js +1 -1
  4. package/dist/agents-view/AgentsView.js.map +1 -1
  5. package/dist/components/ActionButton.d.ts +7 -0
  6. package/dist/components/ActionButton.js +2 -2
  7. package/dist/components/ActionButton.js.map +1 -1
  8. package/dist/components/MarkdownDisplay.js +1 -1
  9. package/dist/components/ui/CardConnector.js +1 -1
  10. package/dist/components/ui/LanguageSelectionGrid.js +1 -1
  11. package/dist/components/ui/LanguageSelector.js +3 -3
  12. package/dist/components/ui/LanguageSelector.js.map +1 -1
  13. package/dist/components/ui/PlaceholderItemSelector.js +1 -1
  14. package/dist/components/ui/alert.d.ts +1 -1
  15. package/dist/components/ui/button.d.ts +2 -2
  16. package/dist/components/ui/card.js +1 -1
  17. package/dist/components/ui/close-button.d.ts +1 -1
  18. package/dist/components/ui/context-menu.js +1 -1
  19. package/dist/components/ui/copy-button.js +1 -1
  20. package/dist/components/ui/delete-button.d.ts +1 -1
  21. package/dist/components/ui/paste-button.js +1 -1
  22. package/dist/components/ui/popover.d.ts +1 -0
  23. package/dist/components/ui/popover.js +16 -7
  24. package/dist/components/ui/popover.js.map +1 -1
  25. package/dist/components/ui/sonner.js +1 -1
  26. package/dist/components/ui/upload-button.js +1 -1
  27. package/dist/config/config.js +18 -4
  28. package/dist/config/config.js.map +1 -1
  29. package/dist/editor/ConcurrentUserLimitDialog.js +1 -1
  30. package/dist/editor/ContentTree.d.ts +12 -1
  31. package/dist/editor/ContentTree.js +20 -3
  32. package/dist/editor/ContentTree.js.map +1 -1
  33. package/dist/editor/FieldActionsOverlay.js.map +1 -1
  34. package/dist/editor/FieldHistory.d.ts +15 -1
  35. package/dist/editor/FieldHistory.js +85 -52
  36. package/dist/editor/FieldHistory.js.map +1 -1
  37. package/dist/editor/FieldList.js +5 -2
  38. package/dist/editor/FieldList.js.map +1 -1
  39. package/dist/editor/FieldListField.js +7 -2
  40. package/dist/editor/FieldListField.js.map +1 -1
  41. package/dist/editor/FieldListFieldWithFallbacks.js +1 -1
  42. package/dist/editor/GlobalMenuBar.js +1 -1
  43. package/dist/editor/ItemInfo.js +2 -2
  44. package/dist/editor/ItemInfo.js.map +1 -1
  45. package/dist/editor/LinkEditorDialog.js +1 -1
  46. package/dist/editor/MigrationsView.js +1 -1
  47. package/dist/editor/PictureCropper.js +1 -1
  48. package/dist/editor/PictureCropper.js.map +1 -1
  49. package/dist/editor/SetupWizard.js.map +1 -1
  50. package/dist/editor/WorkspaceTitleSwitcher.js +1 -1
  51. package/dist/editor/ai/AgentImageCopyButton.d.ts +6 -0
  52. package/dist/editor/ai/AgentImageCopyButton.js +93 -0
  53. package/dist/editor/ai/AgentImageCopyButton.js.map +1 -0
  54. package/dist/editor/ai/AgentSharingSection.js +1 -1
  55. package/dist/editor/ai/Agents.d.ts +2 -2
  56. package/dist/editor/ai/Agents.js +2 -10
  57. package/dist/editor/ai/Agents.js.map +1 -1
  58. package/dist/editor/ai/GuidanceOverlay.js +1 -1
  59. package/dist/editor/ai/GuidanceOverlay.js.map +1 -1
  60. package/dist/editor/ai/InlineAiDialog.js +1 -1
  61. package/dist/editor/ai/InlineAiDialog.js.map +1 -1
  62. package/dist/editor/ai/InlineAiTrigger.js +1 -1
  63. package/dist/editor/ai/MediaImage.js +2 -1
  64. package/dist/editor/ai/MediaImage.js.map +1 -1
  65. package/dist/editor/ai/agentActivitySummary.js.map +1 -1
  66. package/dist/editor/ai/agentMessageHelpers.js.map +1 -1
  67. package/dist/editor/ai/dialogs/AgentDialogHandler.js +103 -6
  68. package/dist/editor/ai/dialogs/AgentDialogHandler.js.map +1 -1
  69. package/dist/editor/ai/dialogs/QuestionnaireInline.js +1 -1
  70. package/dist/editor/ai/dialogs/agentDialogTypes.d.ts +21 -0
  71. package/dist/editor/ai/dialogs/agentDialogTypes.js +3 -1
  72. package/dist/editor/ai/dialogs/agentDialogTypes.js.map +1 -1
  73. package/dist/editor/ai/dialogs/offscreenPageCapture.d.ts +14 -1
  74. package/dist/editor/ai/dialogs/offscreenPageCapture.js +95 -27
  75. package/dist/editor/ai/dialogs/offscreenPageCapture.js.map +1 -1
  76. package/dist/editor/ai/terminal/agentCost.d.ts +1 -0
  77. package/dist/editor/ai/terminal/agentCost.js +10 -3
  78. package/dist/editor/ai/terminal/agentCost.js.map +1 -1
  79. package/dist/editor/ai/terminal/agentSessionSelectors.js.map +1 -1
  80. package/dist/editor/ai/terminal/agentSessionState.js +4 -1
  81. package/dist/editor/ai/terminal/agentSessionState.js.map +1 -1
  82. package/dist/editor/ai/terminal/components/AgentCostDisplay.d.ts +1 -1
  83. package/dist/editor/ai/terminal/components/AgentCostDisplay.js +3 -3
  84. package/dist/editor/ai/terminal/components/AgentCostDisplay.js.map +1 -1
  85. package/dist/editor/ai/terminal/components/AgentDocumentList.js +2 -2
  86. package/dist/editor/ai/terminal/components/AgentDocumentList.js.map +1 -1
  87. package/dist/editor/ai/terminal/components/AgentFullPromptControls.js +1 -1
  88. package/dist/editor/ai/terminal/components/AgentMemoryPanel.d.ts +22 -5
  89. package/dist/editor/ai/terminal/components/AgentMemoryPanel.js +102 -19
  90. package/dist/editor/ai/terminal/components/AgentMemoryPanel.js.map +1 -1
  91. package/dist/editor/ai/terminal/components/AgentProfileModelSettingsSection.js +1 -1
  92. package/dist/editor/ai/terminal/components/AgentProfileSwitcher.js +1 -1
  93. package/dist/editor/ai/terminal/components/AgentPromptInputArea.js +8 -3
  94. package/dist/editor/ai/terminal/components/AgentPromptInputArea.js.map +1 -1
  95. package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js +46 -6
  96. package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js.map +1 -1
  97. package/dist/editor/ai/terminal/components/AgentRunStatusBanners.js +1 -1
  98. package/dist/editor/ai/terminal/components/AgentSettingsContent.js +1 -1
  99. package/dist/editor/ai/terminal/components/AgentTerminalContextChrome.d.ts +1 -0
  100. package/dist/editor/ai/terminal/components/AgentTerminalContextChrome.js.map +1 -1
  101. package/dist/editor/ai/terminal/components/AgentTerminalContextPanels.js +1 -1
  102. package/dist/editor/ai/terminal/components/AgentTerminalContextPanels.js.map +1 -1
  103. package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.js +1 -1
  104. package/dist/editor/ai/terminal/components/AgentTerminalMessageGroups.js +1 -1
  105. package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js +1 -1
  106. package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js.map +1 -1
  107. package/dist/editor/ai/terminal/components/AgentTerminalView.d.ts +1 -1
  108. package/dist/editor/ai/terminal/components/AgentTerminalView.js +1 -1
  109. package/dist/editor/ai/terminal/components/AiResponseMessage.js +1 -1
  110. package/dist/editor/ai/terminal/components/AiResponseMessage.js.map +1 -1
  111. package/dist/editor/ai/terminal/components/ContextInfoBar.d.ts +2 -1
  112. package/dist/editor/ai/terminal/components/ContextInfoBar.js +2 -2
  113. package/dist/editor/ai/terminal/components/ContextInfoBar.js.map +1 -1
  114. package/dist/editor/ai/terminal/components/EditOperationsPanel.js +1 -1
  115. package/dist/editor/ai/terminal/components/QuestionnaireRecap.d.ts +2 -2
  116. package/dist/editor/ai/terminal/components/ToolCallDisplay.js +3 -2
  117. package/dist/editor/ai/terminal/components/ToolCallDisplay.js.map +1 -1
  118. package/dist/editor/ai/terminal/components/UserMessage.js +1 -1
  119. package/dist/editor/ai/terminal/useAgentContextDisplayNames.d.ts +2 -0
  120. package/dist/editor/ai/terminal/useAgentContextDisplayNames.js +73 -29
  121. package/dist/editor/ai/terminal/useAgentContextDisplayNames.js.map +1 -1
  122. package/dist/editor/ai/terminal/useAgentEditorContextPipeline.d.ts +1 -0
  123. package/dist/editor/ai/terminal/useAgentInlineDialogPipeline.d.ts +1 -1
  124. package/dist/editor/ai/terminal/useAgentLoader.js +5 -2
  125. package/dist/editor/ai/terminal/useAgentLoader.js.map +1 -1
  126. package/dist/editor/ai/terminal/useAgentPromptComposerSurface.d.ts +2 -2
  127. package/dist/editor/ai/terminal/useAgentPromptQueueSocketHandler.d.ts +2 -0
  128. package/dist/editor/ai/terminal/useAgentPromptQueueSocketHandler.js +5 -3
  129. package/dist/editor/ai/terminal/useAgentPromptQueueSocketHandler.js.map +1 -1
  130. package/dist/editor/ai/terminal/useAgentRunMessagePipeline.d.ts +4 -4
  131. package/dist/editor/ai/terminal/useAgentRunStatusSocketHandler.js +3 -0
  132. package/dist/editor/ai/terminal/useAgentRunStatusSocketHandler.js.map +1 -1
  133. package/dist/editor/ai/terminal/useAgentSettingsPanel.d.ts +31 -31
  134. package/dist/editor/ai/terminal/useAgentSettleCompletedRun.js.map +1 -1
  135. package/dist/editor/ai/terminal/useAgentStopCommand.js +4 -0
  136. package/dist/editor/ai/terminal/useAgentStopCommand.js.map +1 -1
  137. package/dist/editor/ai/terminal/useAgentStreamPipeline.js +1 -0
  138. package/dist/editor/ai/terminal/useAgentStreamPipeline.js.map +1 -1
  139. package/dist/editor/ai/terminal/useAgentTerminalChrome.d.ts +1 -0
  140. package/dist/editor/ai/terminal/useAgentTerminalChrome.js +2 -2
  141. package/dist/editor/ai/terminal/useAgentTerminalChrome.js.map +1 -1
  142. package/dist/editor/ai/terminal/useAgentTerminalController.js +3 -1
  143. package/dist/editor/ai/terminal/useAgentTerminalController.js.map +1 -1
  144. package/dist/editor/ai/useAgentPanes.js.map +1 -1
  145. package/dist/editor/ai/useAgentStatus.js.map +1 -1
  146. package/dist/editor/ai/useInlineAiPosition.js.map +1 -1
  147. package/dist/editor/ai-image-editor/AiImageEditorDialog.js +42 -23
  148. package/dist/editor/ai-image-editor/AiImageEditorDialog.js.map +1 -1
  149. package/dist/editor/bridge/BridgeClient.js +6 -6
  150. package/dist/editor/bridge/BridgeClient.js.map +1 -1
  151. package/dist/editor/bridge/protocol.d.ts +26 -0
  152. package/dist/editor/bridge/protocol.js +1 -1
  153. package/dist/editor/bridge/protocol.js.map +1 -1
  154. package/dist/editor/client/AboutDialog.js +1 -1
  155. package/dist/editor/client/EditorShell.js +125 -90
  156. package/dist/editor/client/EditorShell.js.map +1 -1
  157. package/dist/editor/client/SessionExpiredOverlay.js +1 -1
  158. package/dist/editor/client/SessionExpiredOverlay.js.map +1 -1
  159. package/dist/editor/client/editContext.d.ts +26 -3
  160. package/dist/editor/client/editContext.js.map +1 -1
  161. package/dist/editor/client/fieldModificationStore.js +0 -21
  162. package/dist/editor/client/fieldModificationStore.js.map +1 -1
  163. package/dist/editor/client/hooks/useClientInfoRegistration.d.ts +13 -0
  164. package/dist/editor/client/hooks/useClientInfoRegistration.js +38 -0
  165. package/dist/editor/client/hooks/useClientInfoRegistration.js.map +1 -0
  166. package/dist/editor/client/itemsRepository.js +1 -34
  167. package/dist/editor/client/itemsRepository.js.map +1 -1
  168. package/dist/editor/client/operations.d.ts +4 -2
  169. package/dist/editor/client/operations.js +89 -65
  170. package/dist/editor/client/operations.js.map +1 -1
  171. package/dist/editor/client/pageModelBuilder.js +7 -1
  172. package/dist/editor/client/pageModelBuilder.js.map +1 -1
  173. package/dist/editor/client/ui/EditorChrome.d.ts +1 -0
  174. package/dist/editor/client/ui/EditorChrome.js +7 -2
  175. package/dist/editor/client/ui/EditorChrome.js.map +1 -1
  176. package/dist/editor/client/ui/FullscreenControls.d.ts +3 -0
  177. package/dist/editor/client/ui/FullscreenControls.js +7 -12
  178. package/dist/editor/client/ui/FullscreenControls.js.map +1 -1
  179. package/dist/editor/client/undoTargetResolution.d.ts +28 -0
  180. package/dist/editor/client/undoTargetResolution.js +69 -0
  181. package/dist/editor/client/undoTargetResolution.js.map +1 -0
  182. package/dist/editor/commands/componentCommands.js +2 -2
  183. package/dist/editor/commands/componentCommands.js.map +1 -1
  184. package/dist/editor/commands/customCommandConverter.js.map +1 -1
  185. package/dist/editor/commands/itemCommands.js +19 -2
  186. package/dist/editor/commands/itemCommands.js.map +1 -1
  187. package/dist/editor/componentTreeHelper.js +13 -7
  188. package/dist/editor/componentTreeHelper.js.map +1 -1
  189. package/dist/editor/content-tree/IndicatorSettings.js +1 -1
  190. package/dist/editor/content-tree/TreeOptions.js +1 -1
  191. package/dist/editor/context-menu/InsertMenu.js +1 -1
  192. package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +1 -1
  193. package/dist/editor/field-types/AttachmentEditor.js +7 -0
  194. package/dist/editor/field-types/AttachmentEditor.js.map +1 -1
  195. package/dist/editor/field-types/LinkFieldEditor.js +1 -1
  196. package/dist/editor/field-types/PictureFieldEditor.js +21 -21
  197. package/dist/editor/field-types/PictureFieldEditor.js.map +1 -1
  198. package/dist/editor/field-types/RichTextEditor.js +1 -1
  199. package/dist/editor/field-types/RichTextEditorComponent.js +6 -0
  200. package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -1
  201. package/dist/editor/field-types/SingleLineText.js +0 -34
  202. package/dist/editor/field-types/SingleLineText.js.map +1 -1
  203. package/dist/editor/field-types/richtext/bridgeRichTextProfile.d.ts +1 -1
  204. package/dist/editor/field-types/richtext/components/EditorDropdown.js +1 -1
  205. package/dist/editor/field-types/richtext/components/ReactSlate.js +1 -1
  206. package/dist/editor/field-types/richtext/components/SimpleDropdown.js +1 -1
  207. package/dist/editor/field-types/richtext/components/SimpleToolbar.js +1 -1
  208. package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js.map +1 -1
  209. package/dist/editor/field-types/richtext/utils/conversion.js +2 -4
  210. package/dist/editor/field-types/richtext/utils/conversion.js.map +1 -1
  211. package/dist/editor/field-types/richtext/utils/plugins.d.ts +1 -0
  212. package/dist/editor/field-types/richtext/utils/plugins.js +12 -0
  213. package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -1
  214. package/dist/editor/field-types/richtext/utils/profileMapper.js.map +1 -1
  215. package/dist/editor/field-types/useFormFieldCaretPresence.js.map +1 -1
  216. package/dist/editor/fieldValueDiagnostics.js.map +1 -1
  217. package/dist/editor/insertOptionCompatibility.d.ts +7 -0
  218. package/dist/editor/insertOptionCompatibility.js +15 -0
  219. package/dist/editor/insertOptionCompatibility.js.map +1 -0
  220. package/dist/editor/media-selector/MediaFolderBrowser.js +26 -4
  221. package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -1
  222. package/dist/editor/media-selector/Preview.js +6 -11
  223. package/dist/editor/media-selector/Preview.js.map +1 -1
  224. package/dist/editor/media-selector/Thumbnails.js +31 -3
  225. package/dist/editor/media-selector/Thumbnails.js.map +1 -1
  226. package/dist/editor/media-selector/TreeSelector.js +53 -6
  227. package/dist/editor/media-selector/TreeSelector.js.map +1 -1
  228. package/dist/editor/media-selector/UploadZone.d.ts +1 -2
  229. package/dist/editor/media-selector/UploadZone.js +3 -4
  230. package/dist/editor/media-selector/UploadZone.js.map +1 -1
  231. package/dist/editor/media-selector/mediaItemDrag.d.ts +28 -0
  232. package/dist/editor/media-selector/mediaItemDrag.js +42 -0
  233. package/dist/editor/media-selector/mediaItemDrag.js.map +1 -0
  234. package/dist/editor/menubar/ActiveUsers.js +6 -3
  235. package/dist/editor/menubar/ActiveUsers.js.map +1 -1
  236. package/dist/editor/menubar/GenericToolbar.js +1 -1
  237. package/dist/editor/menubar/GenericToolbar.js.map +1 -1
  238. package/dist/editor/menubar/ItemActionsMenu.js +1 -1
  239. package/dist/editor/menubar/ItemLanguageVersion.js +1 -1
  240. package/dist/editor/menubar/ItemLanguageVersion.js.map +1 -1
  241. package/dist/editor/menubar/OperationsIndicator.js +1 -1
  242. package/dist/editor/menubar/PageSelector.d.ts +2 -1
  243. package/dist/editor/menubar/PageSelector.js +14 -4
  244. package/dist/editor/menubar/PageSelector.js.map +1 -1
  245. package/dist/editor/menubar/VersionPreviewCard.js +1 -1
  246. package/dist/editor/menubar/VersionSelector.js +1 -1
  247. package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js +1 -1
  248. package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.d.ts +3 -1
  249. package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js +6 -7
  250. package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js.map +1 -1
  251. package/dist/editor/menubar/toolbar-sections/EditControls.js +5 -5
  252. package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -1
  253. package/dist/editor/menubar/toolbar-sections/InsertControls.js +1 -1
  254. package/dist/editor/menubar/toolbar-sections/InsertControls.js.map +1 -1
  255. package/dist/editor/menubar/toolbar-sections/ManualBrowser.js +14 -4
  256. package/dist/editor/menubar/toolbar-sections/ManualBrowser.js.map +1 -1
  257. package/dist/editor/menubar/toolbar-sections/PreviewModeControl.d.ts +1 -0
  258. package/dist/editor/menubar/toolbar-sections/PreviewModeControl.js +14 -0
  259. package/dist/editor/menubar/toolbar-sections/PreviewModeControl.js.map +1 -0
  260. package/dist/editor/menubar/toolbar-sections/RefreshPageControl.d.ts +7 -0
  261. package/dist/editor/menubar/toolbar-sections/RefreshPageControl.js +44 -0
  262. package/dist/editor/menubar/toolbar-sections/RefreshPageControl.js.map +1 -0
  263. package/dist/editor/menubar/toolbar-sections/ReviewCommands.js +1 -1
  264. package/dist/editor/menubar/toolbar-sections/UtilityControls.js +1 -1
  265. package/dist/editor/menubar/toolbar-sections/ViewportControls.d.ts +7 -0
  266. package/dist/editor/menubar/toolbar-sections/ViewportControls.js +16 -8
  267. package/dist/editor/menubar/toolbar-sections/ViewportControls.js.map +1 -1
  268. package/dist/editor/menubar/toolbar-sections/index.d.ts +1 -0
  269. package/dist/editor/menubar/toolbar-sections/index.js +1 -0
  270. package/dist/editor/menubar/toolbar-sections/index.js.map +1 -1
  271. package/dist/editor/notifications/NotificationCenter.js +1 -1
  272. package/dist/editor/notifications/WatchButton.js +1 -1
  273. package/dist/editor/notifications/notificationListState.d.ts +1 -1
  274. package/dist/editor/notifications/notificationRoutes.js.map +1 -1
  275. package/dist/editor/notifications/useNotifications.d.ts +1 -1
  276. package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js +6 -3
  277. package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js.map +1 -1
  278. package/dist/editor/page-editor-chrome/CommentHighlightings.js +1 -1
  279. package/dist/editor/page-editor-chrome/DragInsertionOverlay.js +51 -23
  280. package/dist/editor/page-editor-chrome/DragInsertionOverlay.js.map +1 -1
  281. package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.js +1 -1
  282. package/dist/editor/page-editor-chrome/FeedbackHighlightBadge.js.map +1 -1
  283. package/dist/editor/page-editor-chrome/FieldActionIndicators.js +1 -1
  284. package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +1 -1
  285. package/dist/editor/page-editor-chrome/FrameMenu.js +1 -1
  286. package/dist/editor/page-editor-chrome/FrameMenus.js +1 -1
  287. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.d.ts +58 -0
  288. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.js +709 -0
  289. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.js.map +1 -0
  290. package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +12 -2
  291. package/dist/editor/page-editor-chrome/LockedFieldIndicator.js.map +1 -1
  292. package/dist/editor/page-editor-chrome/PageEditorChrome.js +7 -2
  293. package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -1
  294. package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +57 -10
  295. package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -1
  296. package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +1 -8
  297. package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
  298. package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +1 -0
  299. package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +10 -3
  300. package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -1
  301. package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +5 -2
  302. package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -1
  303. package/dist/editor/page-editor-chrome/SuggestionVariantSwitcher.js +7 -2
  304. package/dist/editor/page-editor-chrome/SuggestionVariantSwitcher.js.map +1 -1
  305. package/dist/editor/page-editor-chrome/VersionDiffHighlightings.d.ts +5 -2
  306. package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js +153 -51
  307. package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js.map +1 -1
  308. package/dist/editor/page-editor-chrome/componentDragObject.d.ts +5 -4
  309. package/dist/editor/page-editor-chrome/componentDragObject.js +8 -8
  310. package/dist/editor/page-editor-chrome/componentDragObject.js.map +1 -1
  311. package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js.map +1 -1
  312. package/dist/editor/page-editor-chrome/overlay/geometry.d.ts +7 -0
  313. package/dist/editor/page-editor-chrome/overlay/geometry.js +35 -17
  314. package/dist/editor/page-editor-chrome/overlay/geometry.js.map +1 -1
  315. package/dist/editor/page-editor-chrome/overlay/placeholderZones.js +4 -9
  316. package/dist/editor/page-editor-chrome/overlay/placeholderZones.js.map +1 -1
  317. package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js +18 -70
  318. package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js.map +1 -1
  319. package/dist/editor/page-viewer/MiniMap.js +1 -1
  320. package/dist/editor/page-viewer/MiniMap.js.map +1 -1
  321. package/dist/editor/page-viewer/MinimapDropTargets.js +1 -1
  322. package/dist/editor/page-viewer/PageViewer.js +5 -3
  323. package/dist/editor/page-viewer/PageViewer.js.map +1 -1
  324. package/dist/editor/page-viewer/PageViewerFrame.js +256 -125
  325. package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
  326. package/dist/editor/page-viewer/bridgeFieldPatch.js +0 -45
  327. package/dist/editor/page-viewer/bridgeFieldPatch.js.map +1 -1
  328. package/dist/editor/page-viewer/bridgeKeyboardShortcuts.d.ts +12 -0
  329. package/dist/editor/page-viewer/bridgeKeyboardShortcuts.js +27 -0
  330. package/dist/editor/page-viewer/bridgeKeyboardShortcuts.js.map +1 -1
  331. package/dist/editor/page-viewer/fullscreenPagePath.d.ts +1 -0
  332. package/dist/editor/page-viewer/fullscreenPagePath.js +11 -0
  333. package/dist/editor/page-viewer/fullscreenPagePath.js.map +1 -0
  334. package/dist/editor/page-viewer/internalLinkNavigation.d.ts +9 -0
  335. package/dist/editor/page-viewer/internalLinkNavigation.js +104 -0
  336. package/dist/editor/page-viewer/internalLinkNavigation.js.map +1 -0
  337. package/dist/editor/page-viewer/pageViewContext.d.ts +3 -1
  338. package/dist/editor/page-viewer/pageViewContext.js +14 -10
  339. package/dist/editor/page-viewer/pageViewContext.js.map +1 -1
  340. package/dist/editor/page-viewer/parentBridgeInjection.d.ts +6 -1
  341. package/dist/editor/page-viewer/parentBridgeInjection.js +117 -24
  342. package/dist/editor/page-viewer/parentBridgeInjection.js.map +1 -1
  343. package/dist/editor/page-viewer/renderUrl.d.ts +1 -1
  344. package/dist/editor/personalization/ConditionTreeEditor.js +1 -1
  345. package/dist/editor/personalization/ConditionTreeEditor.js.map +1 -1
  346. package/dist/editor/personalization/PersonalizationPanel.js +1 -1
  347. package/dist/editor/personalization/TreeItemPicker.js +7 -1
  348. package/dist/editor/personalization/TreeItemPicker.js.map +1 -1
  349. package/dist/editor/personalization/utils.js.map +1 -1
  350. package/dist/editor/reviews/CommentEditor.js +1 -1
  351. package/dist/editor/reviews/CommentEditor.js.map +1 -1
  352. package/dist/editor/reviews/CommentView.js +1 -1
  353. package/dist/editor/reviews/Comments.js +5 -20
  354. package/dist/editor/reviews/Comments.js.map +1 -1
  355. package/dist/editor/reviews/CreateReviewDialog.js +1 -1
  356. package/dist/editor/reviews/DecisionsMatrix.js +1 -1
  357. package/dist/editor/reviews/EditReviewSettingsDialog.js +1 -1
  358. package/dist/editor/reviews/FeedbackFilters.d.ts +16 -0
  359. package/dist/editor/reviews/FeedbackFilters.js +45 -0
  360. package/dist/editor/reviews/FeedbackFilters.js.map +1 -0
  361. package/dist/editor/reviews/FeedbackModeIntro.js +2 -2
  362. package/dist/editor/reviews/FeedbackModeIntro.js.map +1 -1
  363. package/dist/editor/reviews/MentionText.js +1 -1
  364. package/dist/editor/reviews/ReviewCard.js +1 -1
  365. package/dist/editor/reviews/ReviewDetail.js +5 -1
  366. package/dist/editor/reviews/ReviewDetail.js.map +1 -1
  367. package/dist/editor/reviews/ReviewItemsPanel.js +74 -11
  368. package/dist/editor/reviews/ReviewItemsPanel.js.map +1 -1
  369. package/dist/editor/reviews/SecretPhraseInput.js +1 -1
  370. package/dist/editor/reviews/suggestedEditState.js.map +1 -1
  371. package/dist/editor/reviews/useMultiReview.js +45 -17
  372. package/dist/editor/reviews/useMultiReview.js.map +1 -1
  373. package/dist/editor/reviews/useReviews.js +24 -5
  374. package/dist/editor/reviews/useReviews.js.map +1 -1
  375. package/dist/editor/services/agentService.d.ts +91 -10
  376. package/dist/editor/services/agentService.js +100 -27
  377. package/dist/editor/services/agentService.js.map +1 -1
  378. package/dist/editor/services/aiService.js.map +1 -1
  379. package/dist/editor/services/contentService.d.ts +3 -1
  380. package/dist/editor/services/contentService.js +8 -0
  381. package/dist/editor/services/contentService.js.map +1 -1
  382. package/dist/editor/services/contextService.js.map +1 -1
  383. package/dist/editor/services/editService.js.map +1 -1
  384. package/dist/editor/services/favouritesService.d.ts +0 -7
  385. package/dist/editor/services/favouritesService.js +0 -7
  386. package/dist/editor/services/favouritesService.js.map +1 -1
  387. package/dist/editor/services/indexService.d.ts +3 -1
  388. package/dist/editor/services/indexService.js +8 -0
  389. package/dist/editor/services/indexService.js.map +1 -1
  390. package/dist/editor/services/localStorageService.js.map +1 -1
  391. package/dist/editor/services/reviewsService.js.map +1 -1
  392. package/dist/editor/services/serviceHelper.d.ts +3 -0
  393. package/dist/editor/services/serviceHelper.js +51 -1
  394. package/dist/editor/services/serviceHelper.js.map +1 -1
  395. package/dist/editor/services/suggestedEditsService.js.map +1 -1
  396. package/dist/editor/services/systemService.d.ts +10 -0
  397. package/dist/editor/services/systemService.js +3 -0
  398. package/dist/editor/services/systemService.js.map +1 -1
  399. package/dist/editor/services/textCompletionService.js +5 -0
  400. package/dist/editor/services/textCompletionService.js.map +1 -1
  401. package/dist/editor/settings/About.js +2 -4
  402. package/dist/editor/settings/About.js.map +1 -1
  403. package/dist/editor/settings/IndexOverview.js +3 -2
  404. package/dist/editor/settings/IndexOverview.js.map +1 -1
  405. package/dist/editor/settings/SettingsBreadcrumb.js +1 -1
  406. package/dist/editor/settings/SettingsView.js +1 -1
  407. package/dist/editor/settings/StatusSummary.js +1 -1
  408. package/dist/editor/settings/index/IndexGenerationsSection.d.ts +8 -0
  409. package/dist/editor/settings/index/IndexGenerationsSection.js +93 -0
  410. package/dist/editor/settings/index/IndexGenerationsSection.js.map +1 -0
  411. package/dist/editor/settings/panels/AgentProfileConfigPanel.js +1 -1
  412. package/dist/editor/settings/panels/AgentsPanel.js +1 -1
  413. package/dist/editor/settings/panels/CreateAgentProfileDialog.js +1 -1
  414. package/dist/editor/settings/panels/CreateJavaScriptToolDialog.js +1 -1
  415. package/dist/editor/settings/panels/CreateMcpServerDialog.js +1 -1
  416. package/dist/editor/settings/panels/JavaScriptToolsPanel.js +1 -1
  417. package/dist/editor/settings/panels/MemoriesPanel.d.ts +16 -0
  418. package/dist/editor/settings/panels/MemoriesPanel.js +291 -0
  419. package/dist/editor/settings/panels/MemoriesPanel.js.map +1 -0
  420. package/dist/editor/settings/panels/MemoryEntryDialog.d.ts +45 -0
  421. package/dist/editor/settings/panels/MemoryEntryDialog.js +167 -0
  422. package/dist/editor/settings/panels/MemoryEntryDialog.js.map +1 -0
  423. package/dist/editor/settings/panels/ModelsPanel.js +1 -1
  424. package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
  425. package/dist/editor/settings/panels/NotificationSubscriptionsPanel.js +1 -1
  426. package/dist/editor/settings/panels/NotificationSubscriptionsPanel.js.map +1 -1
  427. package/dist/editor/settings/panels/ProjectTemplatesPanel.js +1 -1
  428. package/dist/editor/settings/panels/ProjectTemplatesPanel.js.map +1 -1
  429. package/dist/editor/settings/panels/ProvidersPanel.js +1 -1
  430. package/dist/editor/settings/panels/RenderingHostsPanel.d.ts +2 -0
  431. package/dist/editor/settings/panels/RenderingHostsPanel.js +63 -0
  432. package/dist/editor/settings/panels/RenderingHostsPanel.js.map +1 -0
  433. package/dist/editor/settings/panels/SearchConfigPanel.js +6 -4
  434. package/dist/editor/settings/panels/SearchConfigPanel.js.map +1 -1
  435. package/dist/editor/settings/panels/StatusPanel.js +1 -1
  436. package/dist/editor/settings/panels/index.d.ts +2 -0
  437. package/dist/editor/settings/panels/index.js +2 -0
  438. package/dist/editor/settings/panels/index.js.map +1 -1
  439. package/dist/editor/setup-wizard/steps/CompleteStep.js +1 -1
  440. package/dist/editor/setup-wizard/steps/CreateSettingsStep.js +1 -1
  441. package/dist/editor/setup-wizard/steps/LicenseActivationStep.js +1 -1
  442. package/dist/editor/setup-wizard/steps/LicenseEmailStep.js +1 -1
  443. package/dist/editor/setup-wizard/steps/ModelSelectionStep.js +1 -1
  444. package/dist/editor/setup-wizard/steps/ProviderStep.js +1 -1
  445. package/dist/editor/sidebar/ComponentPalette.js +4 -4
  446. package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
  447. package/dist/editor/sidebar/ComponentTree.js +206 -113
  448. package/dist/editor/sidebar/ComponentTree.js.map +1 -1
  449. package/dist/editor/sidebar/ContentTreePanel.d.ts +2 -2
  450. package/dist/editor/sidebar/DictionaryEditor.js +1 -1
  451. package/dist/editor/sidebar/EditHistory.js +1 -1
  452. package/dist/editor/sidebar/Favorites.js.map +1 -1
  453. package/dist/editor/sidebar/NavigationPanelItem.js +1 -1
  454. package/dist/editor/sidebar/OperationItem.js +1 -1
  455. package/dist/editor/sidebar/Sessions.js +20 -9
  456. package/dist/editor/sidebar/Sessions.js.map +1 -1
  457. package/dist/editor/sidebar/Workbox.d.ts +8 -0
  458. package/dist/editor/sidebar/Workbox.js +94 -12
  459. package/dist/editor/sidebar/Workbox.js.map +1 -1
  460. package/dist/editor/sidebar/WorkboxFilters.d.ts +11 -0
  461. package/dist/editor/sidebar/WorkboxFilters.js +61 -0
  462. package/dist/editor/sidebar/WorkboxFilters.js.map +1 -0
  463. package/dist/editor/sidebar/WorkspaceRail.js +1 -1
  464. package/dist/editor/sidebar/useSharedComponentPublishState.js.map +1 -1
  465. package/dist/editor/template-wizard/TemplateBuilderDialog.js +1 -1
  466. package/dist/editor/template-wizard/TemplateStructureInlineEditor.js +1 -1
  467. package/dist/editor/tree-indicators/GutterColumns.js +1 -1
  468. package/dist/editor/tree-indicators/GutterContext.js +2 -2
  469. package/dist/editor/tree-indicators/GutterContext.js.map +1 -1
  470. package/dist/editor/ui/DragPreview.js.map +1 -1
  471. package/dist/editor/ui/ItemCollectionEditor.js +1 -1
  472. package/dist/editor/ui/ItemNameDialogNew.d.ts +11 -0
  473. package/dist/editor/ui/ItemNameDialogNew.js +12 -7
  474. package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
  475. package/dist/editor/ui/ItemSearch.js +1 -1
  476. package/dist/editor/ui/PerfectTree.d.ts +5 -1
  477. package/dist/editor/ui/PerfectTree.js +7 -5
  478. package/dist/editor/ui/PerfectTree.js.map +1 -1
  479. package/dist/editor/ui/PublishDialog.js +1 -1
  480. package/dist/editor/ui/PublishItemDialog.js +1 -1
  481. package/dist/editor/ui/PublishRestrictionsDialog.js +2 -2
  482. package/dist/editor/ui/PublishRestrictionsDialog.js.map +1 -1
  483. package/dist/editor/ui/RemoveComponentsConfirmMessage.js +1 -1
  484. package/dist/editor/ui/SimpleIconButton.d.ts +1 -1
  485. package/dist/editor/ui/SimpleTable.d.ts +5 -1
  486. package/dist/editor/ui/SimpleTable.js +5 -1
  487. package/dist/editor/ui/SimpleTable.js.map +1 -1
  488. package/dist/editor/ui/Spinner.js +1 -1
  489. package/dist/editor/ui/Spinner.js.map +1 -1
  490. package/dist/editor/ui/WorkboxItemsTable.js +49 -20
  491. package/dist/editor/ui/WorkboxItemsTable.js.map +1 -1
  492. package/dist/editor/utils/selectionContext.js.map +1 -1
  493. package/dist/editor/utils/sitecoreDate.js +8 -2
  494. package/dist/editor/utils/sitecoreDate.js.map +1 -1
  495. package/dist/editor/version-diff/versionDiffGeometryKeys.d.ts +10 -0
  496. package/dist/editor/version-diff/versionDiffGeometryKeys.js +16 -0
  497. package/dist/editor/version-diff/versionDiffGeometryKeys.js.map +1 -0
  498. package/dist/editor/version-diff/versionDiffHighlightStyles.d.ts +6 -0
  499. package/dist/editor/version-diff/versionDiffHighlightStyles.js +6 -0
  500. package/dist/editor/version-diff/versionDiffHighlightStyles.js.map +1 -1
  501. package/dist/editor/version-diff/versionDiffTargets.d.ts +40 -1
  502. package/dist/editor/version-diff/versionDiffTargets.js +176 -15
  503. package/dist/editor/version-diff/versionDiffTargets.js.map +1 -1
  504. package/dist/editor/views/ItemEditor.js +1 -1
  505. package/dist/editor/views/ItemEditorPane.js +1 -1
  506. package/dist/editor/views/ItemEditorPane.js.map +1 -1
  507. package/dist/editor/views/SingleEditView.js +1 -1
  508. package/dist/lib/pointerDrag.js.map +1 -1
  509. package/dist/lib/safelist.js +1 -1
  510. package/dist/licensing/FeatureGate.d.ts +1 -1
  511. package/dist/licensing/LicenseContext.js.map +1 -1
  512. package/dist/licensing/LicenseOverlay.js +1 -1
  513. package/dist/logging/consolePrefix.js.map +1 -1
  514. package/dist/revision.d.ts +2 -2
  515. package/dist/revision.js +2 -2
  516. package/dist/revision.js.map +1 -1
  517. package/dist/setup/services/setupWizardService.d.ts +3 -56
  518. package/dist/setup/services/setupWizardService.js +0 -43
  519. package/dist/setup/services/setupWizardService.js.map +1 -1
  520. package/dist/setup/wizard/steps/ImportModelDialog.js +1 -1
  521. package/dist/splash-screen/NewPage.js +1 -1
  522. package/dist/splash-screen/RecentPages.js +1 -1
  523. package/dist/task-board/TaskBoardWorkspace.js +5 -0
  524. package/dist/task-board/TaskBoardWorkspace.js.map +1 -1
  525. package/dist/task-board/components/ItemCollectionEditorDialog.js +1 -1
  526. package/dist/task-board/components/ProjectDashboard.js +1 -1
  527. package/dist/task-board/components/ProjectGoalsPanel.js +1 -1
  528. package/dist/task-board/components/ProjectSettingsDialog.js +1 -1
  529. package/dist/task-board/components/TaskBoardBreadcrumb.js +1 -1
  530. package/dist/task-board/components/TaskBoardProjectListSidebar.js +1 -1
  531. package/dist/task-board/components/TaskBoardProjectListSidebar.js.map +1 -1
  532. package/dist/task-board/components/TaskBoardTitlebar.js +1 -1
  533. package/dist/task-board/components/TaskDetailPanel.js +1 -1
  534. package/dist/task-board/components/TaskReviewActions.js +1 -1
  535. package/dist/task-board/components/TaskRow.js +1 -1
  536. package/dist/task-board/components/TaskboardPersistentLogPanel.js +1 -1
  537. package/dist/task-board/components/WizardCommunicationCenter.js +1 -1
  538. package/dist/task-board/components/WizardTask.js +1 -1
  539. package/dist/task-board/components/WizardTaskDetailsPanel.js +1 -1
  540. package/dist/task-board/services/goalService.d.ts +1 -14
  541. package/dist/task-board/services/goalService.js +0 -10
  542. package/dist/task-board/services/goalService.js.map +1 -1
  543. package/dist/task-board/services/taskService.d.ts +0 -11
  544. package/dist/task-board/services/taskService.js +0 -3
  545. package/dist/task-board/services/taskService.js.map +1 -1
  546. package/dist/task-board/views/DependencyGraphView.d.ts +13 -0
  547. package/dist/task-board/views/DependencyGraphView.js +62 -11
  548. package/dist/task-board/views/DependencyGraphView.js.map +1 -1
  549. package/dist/task-board/views/ListView.js +1 -1
  550. package/dist/tour/Tour.js +1 -1
  551. package/dist/tour/Tour.js.map +1 -1
  552. package/dist/tour/default-tour.js +1 -1
  553. package/dist/tour/preview-tour.js +1 -1
  554. package/dist/types.d.ts +33 -9
  555. package/package.json +5 -4
  556. package/styles.css +4 -4
  557. package/dist/editor/ai/terminal/components/AgentEditHistoryButton.d.ts +0 -5
  558. package/dist/editor/ai/terminal/components/AgentEditHistoryButton.js +0 -12
  559. package/dist/editor/ai/terminal/components/AgentEditHistoryButton.js.map +0 -1
  560. package/dist/editor/ai/terminal/components/AgentThinkingDots.d.ts +0 -5
  561. package/dist/editor/ai/terminal/components/AgentThinkingDots.js +0 -9
  562. package/dist/editor/ai/terminal/components/AgentThinkingDots.js.map +0 -1
  563. package/dist/editor/reviews/CommentsAndFeedback.d.ts +0 -8
  564. package/dist/editor/reviews/CommentsAndFeedback.js +0 -17
  565. package/dist/editor/reviews/CommentsAndFeedback.js.map +0 -1
  566. package/dist/editor/reviews/CreateReviewDetailsStep.d.ts +0 -53
  567. package/dist/editor/reviews/CreateReviewDetailsStep.js +0 -77
  568. package/dist/editor/reviews/CreateReviewDetailsStep.js.map +0 -1
  569. package/dist/splash-screen/ParheliaAssistantChat.d.ts +0 -8
  570. package/dist/splash-screen/ParheliaAssistantChat.js +0 -507
  571. package/dist/splash-screen/ParheliaAssistantChat.js.map +0 -1
  572. package/dist/splash-screen/SplashScreenAgentContext.d.ts +0 -28
  573. package/dist/splash-screen/SplashScreenAgentContext.js +0 -51
  574. package/dist/splash-screen/SplashScreenAgentContext.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useLayoutEffect, useRef, useState, } from "react";
3
3
  import { BRIDGE_DOM_UPDATED_EVENT, MiniMap } from "./MiniMap";
4
4
  import { resolveMiniMapVisibility, } from "./minimapVisibility";
@@ -27,6 +27,7 @@ import { NoLayout } from "../page-editor-chrome/NoLayout";
27
27
  import { Spinner } from "../ui/Spinner";
28
28
  import { DeviceToolbar } from "./DeviceToolbar";
29
29
  import { FullscreenControls } from "../client/ui/FullscreenControls";
30
+ import { PageSelector } from "../menubar/PageSelector";
30
31
  import { toSitecoreDate } from "../utils/sitecoreDate";
31
32
  import { pickVersionAtDate } from "../utils/versionAtDate";
32
33
  import { BridgeClient } from "../bridge/BridgeClient";
@@ -34,10 +35,12 @@ import { beginPerfTrace, isPerfTraceActive, isPerfTraceEnabled, perfTraceStep, }
34
35
  import { getPendingFieldSuggestions, getSuggestionSelectionKey, getSuggestionDisplayValue, } from "../reviews/suggestionDisplayValue";
35
36
  import { buildBridgeFieldPatchPayload, buildBridgeFieldPatchSignature, buildRemoteCaretFieldPatches, getBridgeFieldPatchValue, hasRemoteCaretDraftForField, isBridgePatchableTextField, isSuggestionPreviewPatchSignature, } from "./bridgeFieldPatch";
36
37
  import { bridgeSelectionMatchesInteraction, resolveBridgeTextCompletionInput, } from "./bridgeTextCompletion";
37
- import { logFieldValueDiagnostic, summarizeField, summarizeFieldDescriptor, summarizeFieldValue, } from "../fieldValueDiagnostics";
38
- import { createKeyboardEventFromBridgeInteraction } from "./bridgeKeyboardShortcuts";
38
+ import { logFieldValueDiagnostic, summarizeFieldDescriptor, summarizeFieldValue, } from "../fieldValueDiagnostics";
39
+ import { createKeyboardEventFromBridgeInteraction, getBridgeFieldHistoryStepDirection, INLINE_FIELD_HISTORY_STEP_EVENT, } from "./bridgeKeyboardShortcuts";
39
40
  import { formatParentBridgeInjectionDiagnostic, injectParheliaBridgeFromParent, } from "./parentBridgeInjection";
40
41
  import { getTextCompletion, normalizeTextCompletion, } from "../services/textCompletionService";
42
+ import { resolvePageAndSiteByPath } from "../services/contentService";
43
+ import { extractInternalLinkPath, extractInternalLinkTargetItemId, shouldOpenInternalLinkInNewSlot, } from "./internalLinkNavigation";
41
44
  const ZOOM_MIN = 0.25;
42
45
  const ZOOM_MAX = 2;
43
46
  const ZOOM_STEP = 0.25;
@@ -186,12 +189,10 @@ function bridgeHoverInteractionsEqual(left, right) {
186
189
  function findBridgeFieldDocumentBounds(geometry, descriptor) {
187
190
  if (!geometry)
188
191
  return undefined;
189
- const target = geometry.targets.find((candidate) => {
190
- if (candidate.kind !== "field")
191
- return false;
192
- return (bridgeKeysMatch(candidate.fieldId, descriptor.fieldId) &&
193
- bridgeItemMatches(candidate.item, descriptor.item));
194
- });
192
+ const matchingTargets = geometry.targets.filter((candidate) => candidate.kind === "field" &&
193
+ bridgeKeysMatch(candidate.fieldId, descriptor.fieldId) &&
194
+ bridgeItemMatches(candidate.item, descriptor.item));
195
+ const target = matchingTargets.find((candidate) => candidate.rect.width > 0 || candidate.rect.height > 0) ?? matchingTargets[0];
195
196
  return target?.rect
196
197
  ? bridgeTargetToDocumentBounds(geometry, target)
197
198
  : undefined;
@@ -307,6 +308,16 @@ function requestScrollTargetGeometry(pageViewContext, target) {
307
308
  textRanges,
308
309
  }) ?? false);
309
310
  }
311
+ function getFocusedFieldScrollKey(field) {
312
+ const item = field.item;
313
+ return [
314
+ item.database || "",
315
+ item.id,
316
+ item.language,
317
+ item.version,
318
+ field.fieldId,
319
+ ].join("|");
320
+ }
310
321
  function scrollBridgeBoundsIntoView(pageViewContext, bounds, currentScroll) {
311
322
  const geometry = pageViewContext.bridgeGeometry;
312
323
  if (!geometry)
@@ -619,6 +630,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
619
630
  const bridgePatchSignatureRef = useRef(new Map());
620
631
  const bridgeTextRangeSourcesRef = useRef(new Map());
621
632
  const activeBridgeInlineEditRef = useRef(null);
633
+ const discardActiveFieldDraftOnNextRefreshRef = useRef(false);
622
634
  const [isBridgeInlineEditing, setIsBridgeInlineEditing] = useState(false);
623
635
  const bridgeInlineEditSessionRef = useRef(null);
624
636
  if (!bridgeInlineEditSessionRef.current) {
@@ -644,6 +656,10 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
644
656
  const lastBridgeHoverInteractionRef = useRef(undefined);
645
657
  const [bridgeInteraction, setBridgeInteraction] = useState(undefined);
646
658
  const pendingRefreshScrollRef = useRef(undefined);
659
+ // #fragment carried by a canvas link navigation (preview click / alt+click).
660
+ // Applied to the next iframe src load so the browser lands the canvas on the
661
+ // linked section instead of the page top.
662
+ const pendingCanvasAnchorRef = useRef(undefined);
647
663
  // When the pending refresh scroll was captured, and when the last explicit
648
664
  // scrollBy command (minimap click/wheel) was issued. A capture is only safe
649
665
  // to restore while no explicit command is newer than it: the capture
@@ -660,6 +676,10 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
660
676
  // needless refresh would drop scroll position and inline-edit state.
661
677
  const lastRenderSignatureRef = useRef(undefined);
662
678
  const lastRenderModeRef = useRef(editContext.mode);
679
+ // Last fullReloadToken this frame acted on. Each frame tracks it separately so
680
+ // a hard refresh reloads every open editor slot, not just the first to react.
681
+ // undefined until the first render pass, so mounting never counts as a request.
682
+ const lastFullReloadTokenRef = useRef(undefined);
663
683
  // Set when a canvas refresh (bridge patch or full reload) has been requested
664
684
  // and its result has not landed yet. While in flight, bridgeGeometry still
665
685
  // describes the PRE-refresh DOM — a moved component is still measured at its
@@ -738,6 +758,10 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
738
758
  // change. Without this guard that blur re-render would scroll the just
739
759
  // clicked component into view after the suppress flag was already consumed.
740
760
  const lastScrolledSelectionKeyRef = useRef("");
761
+ // Field descriptors are cloned whenever the edit form is clicked. Track the
762
+ // stable field identity so repeated clicks inside the already-focused field
763
+ // do not keep re-centering it in the iframe.
764
+ const lastScrolledFocusedFieldKeyRef = useRef(undefined);
741
765
  const scrollIntoViewRequestRef = useRef({
742
766
  signature: "",
743
767
  requestedTextRangeGeometry: false,
@@ -849,10 +873,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
849
873
  const sendBeginInlineEdit = useCallback((payload) => {
850
874
  const sent = bridgeClientRef.current?.sendCommand("beginInlineEdit", payload) ??
851
875
  false;
852
- logFieldValueDiagnostic("bridge-frame", "beginInlineEdit command", {
853
- sent,
854
- payload,
855
- });
856
876
  return sent;
857
877
  }, []);
858
878
  const sendCancelInlineEdit = useCallback((payload) => {
@@ -923,18 +943,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
923
943
  sendApplyFieldPatch: sendApplyFieldPatchCommand,
924
944
  });
925
945
  const beginTrackedBridgeInlineEdit = useCallback(async (interaction) => {
926
- logFieldValueDiagnostic("bridge-frame", "begin tracked inline edit", {
927
- previousActiveInlineEdit: activeBridgeInlineEditRef.current,
928
- interaction: {
929
- kind: interaction.kind,
930
- elementKey: interaction.elementKey,
931
- fieldId: interaction.fieldId,
932
- item: interaction.item,
933
- selectedText: summarizeFieldValue(interaction.selectedText),
934
- selectionStartOffset: interaction.selectionStartOffset,
935
- selectionEndOffset: interaction.selectionEndOffset,
936
- },
937
- });
938
946
  if (!interaction.elementKey || !interaction.fieldId)
939
947
  return false;
940
948
  const interactionItem = interaction.item?.id &&
@@ -956,10 +964,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
956
964
  item: interactionItem,
957
965
  modeAtStart: editContextRef.current?.mode ?? editContext.mode,
958
966
  }, ({ isCurrent, sessionId }) => beginBridgeInlineEdit(interaction, { isCurrent, sessionId }));
959
- logFieldValueDiagnostic("bridge-frame", "tracked inline edit result", {
960
- started,
961
- nextActiveInlineEdit: activeBridgeInlineEditRef.current,
962
- });
963
967
  return started;
964
968
  }, [
965
969
  beginBridgeInlineEdit,
@@ -968,9 +972,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
968
972
  editContextRef,
969
973
  ]);
970
974
  const endTrackedBridgeFieldFocus = useCallback(() => {
971
- logFieldValueDiagnostic("bridge-frame", "ending tracked field focus", {
972
- activeInlineEdit: activeBridgeInlineEditRef.current,
973
- });
974
975
  clearActiveBridgeInlineEdit();
975
976
  endBridgeFieldFocus();
976
977
  }, [clearActiveBridgeInlineEdit, endBridgeFieldFocus]);
@@ -1060,26 +1061,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
1060
1061
  ? "suggestion-preview"
1061
1062
  : "real",
1062
1063
  };
1063
- logFieldValueDiagnostic("bridge-patch", "display value resolved", {
1064
- showSuggestions,
1065
- preferRepositoryValue,
1066
- field: summarizeField(field),
1067
- structureField: {
1068
- elementKey: structureField.elementKey,
1069
- fieldId: structureField.fieldId,
1070
- item: structureField.item,
1071
- textContent: summarizeFieldValue(structureField.textContent),
1072
- isRichText: structureField.isRichText,
1073
- },
1074
- itemDescriptor,
1075
- repositoryValue: summarizeFieldValue(repositoryValue),
1076
- result: {
1077
- ...result,
1078
- value: summarizeFieldValue(result.value),
1079
- },
1080
- modifiedFieldCount: fieldsContext?.modifiedFields?.length,
1081
- suggestedEditCount: editContext.suggestedEdits?.length,
1082
- });
1083
1064
  return result;
1084
1065
  }, [
1085
1066
  editContext.mode,
@@ -1112,26 +1093,9 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
1112
1093
  const signature = buildBridgeFieldPatchSignature(patch, observedTextContent);
1113
1094
  const previousSignature = bridgePatchSignatureRef.current.get(cacheKey);
1114
1095
  if (previousSignature === signature) {
1115
- logFieldValueDiagnostic("bridge-patch", "skipped duplicate send", {
1116
- cacheKey,
1117
- patch: {
1118
- ...patch,
1119
- value: summarizeFieldValue(patch.value),
1120
- },
1121
- observedTextContent: summarizeFieldValue(observedTextContent),
1122
- });
1123
1096
  return false;
1124
1097
  }
1125
1098
  bridgePatchSignatureRef.current.set(cacheKey, signature);
1126
- logFieldValueDiagnostic("bridge-patch", "sending patch", {
1127
- cacheKey,
1128
- patch: {
1129
- ...patch,
1130
- value: summarizeFieldValue(patch.value),
1131
- },
1132
- observedTextContent: summarizeFieldValue(observedTextContent),
1133
- previousSignature,
1134
- });
1135
1099
  bridge.sendCommand("applyFieldPatch", patch);
1136
1100
  return true;
1137
1101
  }, []);
@@ -1180,12 +1144,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
1180
1144
  });
1181
1145
  if (lastSentBridgeCaretRef.current === nextKey)
1182
1146
  return;
1183
- logFieldValueDiagnostic("bridge-caret", "sending position", {
1184
- fieldId: activeField.fieldId,
1185
- item,
1186
- offset,
1187
- value: summarizeFieldValue(activeField.value),
1188
- });
1189
1147
  editor.sendSocketMessage({
1190
1148
  type: "caret-position",
1191
1149
  payload: {
@@ -1592,6 +1550,20 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
1592
1550
  if (bridgeTextCompletionRef.current && interaction.fieldId) {
1593
1551
  clearBridgeTextCompletion();
1594
1552
  }
1553
+ // Ctrl+Z / Ctrl+Y pressed inside the canvas iframe never reach the host window, so
1554
+ // the undo/redo commands (which bind those keys) could not fire. The bridge already
1555
+ // preventDefaults the keystroke and forwards it here; replay it on `window`, where
1556
+ // useGlobalEditorKeyDown listens, so the keyboard and the toolbar drive the same
1557
+ // application undo stack.
1558
+ const undoRedoKeyboardEvent = createKeyboardEventFromBridgeInteraction(interaction);
1559
+ if (undoRedoKeyboardEvent) {
1560
+ // The application operation will deliberately replace the focused
1561
+ // field's value. Tell the next bridge refresh not to restore the
1562
+ // iframe's pre-operation caret/draft snapshot over that value.
1563
+ discardActiveFieldDraftOnNextRefreshRef.current = true;
1564
+ window.dispatchEvent(undoRedoKeyboardEvent);
1565
+ return;
1566
+ }
1595
1567
  if (isBridgeLinkShortcut(interaction)) {
1596
1568
  const editor = editContextRef.current;
1597
1569
  let linkRange = editor?.selectedRange;
@@ -1653,6 +1625,16 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
1653
1625
  }
1654
1626
  return;
1655
1627
  }
1628
+ const fieldHistoryStep = getBridgeFieldHistoryStepDirection(interaction);
1629
+ if (fieldHistoryStep) {
1630
+ // The pill lives in the chrome overlay, outside this frame's tree.
1631
+ document.dispatchEvent(new CustomEvent(INLINE_FIELD_HISTORY_STEP_EVENT, {
1632
+ bubbles: true,
1633
+ cancelable: true,
1634
+ detail: { direction: fieldHistoryStep },
1635
+ }));
1636
+ return;
1637
+ }
1656
1638
  if (isBridgeInlineAiShortcut(interaction)) {
1657
1639
  const editor = editContextRef.current;
1658
1640
  const field = await resolveBridgeFieldDescriptor(interaction);
@@ -1717,6 +1699,110 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
1717
1699
  const editor = editContextRef.current;
1718
1700
  if (!editor)
1719
1701
  return;
1702
+ // In preview mode the bridge suppresses the canvas's native link
1703
+ // navigation (the proxied iframe cannot follow root-relative hrefs), so
1704
+ // a plain click on an internal link navigates the editor to the linked
1705
+ // page instead — carrying any #anchor along.
1706
+ const isPreviewLinkClick = interaction.kind === "click" &&
1707
+ !interaction.altKey &&
1708
+ !!interaction.link?.internal &&
1709
+ editor.mode === "preview";
1710
+ if (interaction.kind === "click" &&
1711
+ (interaction.altKey || isPreviewLinkClick) &&
1712
+ interaction.link?.internal) {
1713
+ const canvasLinkHash = (() => {
1714
+ try {
1715
+ return (new URL(interaction.link.href, window.location.href).hash.slice(1) || undefined);
1716
+ }
1717
+ catch {
1718
+ return undefined;
1719
+ }
1720
+ })();
1721
+ let rawFieldValue;
1722
+ let structuredFieldValue;
1723
+ const linkFieldInteraction = interaction.link
1724
+ .fieldId
1725
+ ? {
1726
+ ...interaction,
1727
+ elementKey: interaction.link.elementKey ?? interaction.elementKey,
1728
+ fieldId: interaction.link.fieldId,
1729
+ item: interaction.link.item ?? interaction.item,
1730
+ }
1731
+ : interaction;
1732
+ if (linkFieldInteraction.fieldId) {
1733
+ const fieldDescriptor = await resolveBridgeFieldDescriptor(linkFieldInteraction);
1734
+ if (fieldDescriptor) {
1735
+ try {
1736
+ const field = await editor.itemsRepository.getField(fieldDescriptor);
1737
+ rawFieldValue = field?.rawValue;
1738
+ structuredFieldValue = field?.value;
1739
+ }
1740
+ catch {
1741
+ // Direct target metadata and Sitecore link.aspx URLs can still
1742
+ // resolve when repository hydration is unavailable.
1743
+ }
1744
+ }
1745
+ }
1746
+ let targetItemId = extractInternalLinkTargetItemId({
1747
+ href: interaction.link.href,
1748
+ targetItemId: interaction.link.targetItemId,
1749
+ rawFieldValue,
1750
+ structuredFieldValue,
1751
+ anchorIndex: interaction.link.anchorIndex,
1752
+ });
1753
+ const sourceItem = pageViewContextRef.current?.page?.item ??
1754
+ pageViewContextRef.current?.pageItemDescriptor ??
1755
+ interaction.item;
1756
+ if (!targetItemId && sourceItem) {
1757
+ const linkPath = extractInternalLinkPath(interaction.link.href, window.location.href);
1758
+ if (linkPath) {
1759
+ const resolvedPage = await resolvePageAndSiteByPath(linkPath, sourceItem.language ?? "en", pageViewContextRef.current?.site?.name);
1760
+ targetItemId = resolvedPage?.pageItem.id;
1761
+ }
1762
+ }
1763
+ if (!targetItemId) {
1764
+ editor.showToast("Could not resolve the linked page.");
1765
+ return;
1766
+ }
1767
+ // A link to a section of the page already on the canvas needs no
1768
+ // navigation — scroll the canvas to the anchor instead (a reload
1769
+ // would lose scroll state and flash the page).
1770
+ if (canvasLinkHash &&
1771
+ sourceItem?.id &&
1772
+ targetItemId.toLowerCase() === sourceItem.id.toLowerCase()) {
1773
+ bridgeClientRef.current?.sendCommand("scrollIntoView", {
1774
+ anchorId: canvasLinkHash,
1775
+ block: "start",
1776
+ });
1777
+ return;
1778
+ }
1779
+ // Consumed by the render-url effect on the iframe load that this
1780
+ // loadItem triggers; set before the await so the effect cannot run
1781
+ // first, cleared if the navigation fails.
1782
+ if (canvasLinkHash)
1783
+ pendingCanvasAnchorRef.current = canvasLinkHash;
1784
+ try {
1785
+ const linkedPage = await editor.loadItem({
1786
+ id: targetItemId,
1787
+ language: sourceItem?.language ?? "en",
1788
+ version: 0,
1789
+ database: sourceItem?.database,
1790
+ }, {
1791
+ openInNewSlot: isPreviewLinkClick
1792
+ ? false
1793
+ : shouldOpenInternalLinkInNewSlot(editor.fullscreen),
1794
+ });
1795
+ if (!linkedPage) {
1796
+ pendingCanvasAnchorRef.current = undefined;
1797
+ editor.showToast("The linked page could not be loaded.");
1798
+ }
1799
+ }
1800
+ catch {
1801
+ pendingCanvasAnchorRef.current = undefined;
1802
+ editor.showToast("The linked page could not be loaded.");
1803
+ }
1804
+ return;
1805
+ }
1720
1806
  const selectFromBridgeInteraction = (ids) => {
1721
1807
  const unchanged = bridgeComponentSelectionsMatch(editor.getSelection(), ids);
1722
1808
  if (!unchanged) {
@@ -2019,10 +2105,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2019
2105
  const iframe = iframeElement;
2020
2106
  if (!iframe)
2021
2107
  return;
2022
- const currentIframeSrc = iframe.src;
2023
- if (!iframeSrc ||
2024
- !loadedIframeSrc ||
2025
- loadedIframeSrc !== currentIframeSrc) {
2108
+ if (!iframeSrc || !loadedIframeSrc) {
2026
2109
  pageViewContext.setBridgeReady(false);
2027
2110
  pageViewContext.setIframeSupportsRefresh(false);
2028
2111
  return;
@@ -2031,11 +2114,12 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2031
2114
  getUrlOrigin(pageViewContext.editUrl),
2032
2115
  getUrlOrigin(pageViewContext.previewUrl),
2033
2116
  ].filter((origin) => Boolean(origin));
2034
- if (allowedHostOrigins.length === 0) {
2035
- pageViewContext.setBridgeReady(false);
2036
- pageViewContext.setIframeSupportsRefresh(false);
2037
- return;
2038
- }
2117
+ // The iframe can finish loading before the page-view URLs have propagated
2118
+ // into context, and a same-origin host can normalize its live URL after the
2119
+ // load event. Neither case should strand the bridge: BridgeClient always
2120
+ // verifies event.source against this iframe and derives a safe configured
2121
+ // origin from the iframe src when the context allowlist is temporarily
2122
+ // empty. The repeated hello handshake then survives late host startup.
2039
2123
  let client;
2040
2124
  client = new BridgeClient({
2041
2125
  iframe,
@@ -2046,14 +2130,14 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2046
2130
  if (!ready)
2047
2131
  pageViewContext.setIframeSupportsRefresh(false);
2048
2132
  },
2049
- onError: (error) => {
2133
+ onError: () => {
2050
2134
  pageViewContext.setBridgeReady(false);
2051
2135
  pageViewContext.setIframeSupportsRefresh(false);
2052
2136
  const parentInjectionDiagnostic = formatParentBridgeInjectionDiagnostic(latestParentBridgeInjectionRef.current);
2053
2137
  const details = parentInjectionDiagnostic
2054
- ? `${error.message}\n\nParent injection: ${parentInjectionDiagnostic}`
2055
- : error.message;
2056
- console.error("[Parhelia bridge]", error.message, latestParentBridgeInjectionRef.current);
2138
+ ? `The editing host bridge did not become ready.\n\nParent injection: ${parentInjectionDiagnostic}`
2139
+ : "The editing host bridge did not become ready.";
2140
+ console.error("[Parhelia bridge]", parentInjectionDiagnostic);
2057
2141
  if (!compareView) {
2058
2142
  editContextRef.current?.showErrorToast({
2059
2143
  summary: "Editing host bridge unavailable",
@@ -2086,6 +2170,11 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2086
2170
  bridge.sendCommand("setZoom", {
2087
2171
  zoom: pageViewContextRef.current?.zoom ?? 1,
2088
2172
  });
2173
+ // Ready confirms the bridge transport, not that its initial
2174
+ // mutation-driven geometry snapshot reached the editor. Query the
2175
+ // current DOM explicitly so editing chrome never depends on that
2176
+ // first unsolicited event surviving startup contention.
2177
+ bridge.sendCommand("queryGeometry", {});
2089
2178
  if (pendingRefreshScrollRef.current) {
2090
2179
  restorePendingRefreshScroll(iframe, pendingRefreshScrollRef.current);
2091
2180
  }
@@ -2241,38 +2330,15 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2241
2330
  handleBridgeSelection(event.payload.selection, iframe);
2242
2331
  break;
2243
2332
  case "fieldValueChanged":
2244
- logFieldValueDiagnostic("bridge-frame", "fieldValueChanged event", {
2245
- elementKey: event.payload.elementKey,
2246
- fieldId: event.payload.fieldId,
2247
- item: event.payload.item,
2248
- isRichText: event.payload.isRichText,
2249
- value: summarizeFieldValue(event.payload.value),
2250
- activeInlineEdit: activeBridgeInlineEditRef.current,
2251
- });
2252
2333
  handleBridgeFieldValueChanged(event.payload);
2253
2334
  break;
2254
2335
  case "inlineEditEnded":
2255
- logFieldValueDiagnostic("bridge-frame", "inlineEditEnded event", {
2256
- reason: event.payload.reason,
2257
- elementKey: event.payload.elementKey,
2258
- fieldId: event.payload.fieldId,
2259
- item: event.payload.item,
2260
- isRichText: event.payload.isRichText,
2261
- value: summarizeFieldValue(event.payload.value),
2262
- activeInlineEdit: activeBridgeInlineEditRef.current,
2263
- });
2264
2336
  const inlineEditEnd = bridgeInlineEditSession.end(event.payload);
2265
2337
  handleBridgeInlineEditEnded(event.payload, {
2266
2338
  recordSession: false,
2267
2339
  releaseFocus: inlineEditEnd.matched,
2268
2340
  endedModeAtStart: inlineEditEnd.endedState?.modeAtStart,
2269
2341
  });
2270
- logFieldValueDiagnostic("bridge-frame", inlineEditEnd.matched
2271
- ? "active inline edit cleared after end"
2272
- : "non-current inline edit end persisted", {
2273
- fieldId: event.payload.fieldId,
2274
- reason: event.payload.reason,
2275
- });
2276
2342
  break;
2277
2343
  case "interaction":
2278
2344
  if (event.payload.kind === "hover") {
@@ -2650,6 +2716,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2650
2716
  return (bridgeClientRef.current?.sendCommand("cancelPointerDrag", {}) ?? false);
2651
2717
  };
2652
2718
  pageViewContext.requestBridgeScrollBy = requestBridgeScrollBy;
2719
+ pageViewContext.requestBridgeFieldPatch = sendApplyFieldPatchCommand;
2653
2720
  pageViewContext.requestBridgeRichTextCommand = requestBridgeRichTextCommand;
2654
2721
  pageViewContext.requestBridgePreviewGap = requestBridgePreviewGap;
2655
2722
  pageViewContext.requestBridgeCaptureSnapshot = requestBridgeCaptureSnapshot;
@@ -2679,12 +2746,15 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2679
2746
  requestBridgeCancelPointerDrag) {
2680
2747
  pageViewContext.requestBridgeCancelPointerDrag = undefined;
2681
2748
  }
2749
+ if (pageViewContext.requestBridgeFieldPatch === sendApplyFieldPatchCommand) {
2750
+ pageViewContext.requestBridgeFieldPatch = undefined;
2751
+ }
2682
2752
  if (pageViewContext.requestBridgeRichTextCommand ===
2683
2753
  requestBridgeRichTextCommand) {
2684
2754
  pageViewContext.requestBridgeRichTextCommand = undefined;
2685
2755
  }
2686
2756
  };
2687
- }, [pageViewContext]);
2757
+ }, [pageViewContext, sendApplyFieldPatchCommand]);
2688
2758
  useEffect(() => {
2689
2759
  const requestBridgeCaptureDom = (payload) => {
2690
2760
  const bridge = bridgeClientRef.current;
@@ -2820,7 +2890,16 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2820
2890
  const initialLoad = currentItemDescriptor?.id !== pageItemDescriptor.id ||
2821
2891
  currentItemDescriptor?.language !== pageItemDescriptor.language ||
2822
2892
  currentItemDescriptor?.version !== pageItemDescriptor.version;
2823
- const shouldUseIframeSrcReload = initialLoad || pageViewContext.fullscreen || iframeOriginChanged;
2893
+ // A user-requested hard refresh: skip the incremental path entirely. It is
2894
+ // the escape hatch for the case where the bridge patch is what produced the
2895
+ // wrong DOM, so routing it through the bridge again would repeat the fault.
2896
+ const fullReloadRequested = lastFullReloadTokenRef.current !== undefined &&
2897
+ lastFullReloadTokenRef.current !== editContext.fullReloadToken;
2898
+ lastFullReloadTokenRef.current = editContext.fullReloadToken;
2899
+ const shouldUseIframeSrcReload = initialLoad ||
2900
+ pageViewContext.fullscreen ||
2901
+ iframeOriginChanged ||
2902
+ fullReloadRequested;
2824
2903
  const signatureUrl = new URL(renderUrl.toString());
2825
2904
  signatureUrl.searchParams.delete("edit_rev");
2826
2905
  const renderSignature = `${signatureUrl.toString()}|rev:${editContext.revision}`;
@@ -2842,7 +2921,13 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2842
2921
  function runFallbackRefresh() {
2843
2922
  lastRenderSignatureRef.current = renderSignature;
2844
2923
  pageViewContext.setIframeSupportsRefresh(false);
2845
- if (!pendingRefreshScrollRef.current) {
2924
+ if (pendingCanvasAnchorRef.current) {
2925
+ // An anchor navigation decides the landing position — restoring the
2926
+ // previous page's scroll on ready would yank the canvas off the
2927
+ // linked section.
2928
+ pendingRefreshScrollRef.current = undefined;
2929
+ }
2930
+ else if (!pendingRefreshScrollRef.current) {
2846
2931
  pendingRefreshScrollRef.current =
2847
2932
  getIframeWindowScroll(iframeRef.current) ??
2848
2933
  latestBridgeScrollRef.current;
@@ -2858,8 +2943,16 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2858
2943
  ? "Cross-origin load - setting iframe src"
2859
2944
  : iframeOriginChanged
2860
2945
  ? "Iframe origin changed - setting iframe src"
2861
- : "Reloading iframe src");
2946
+ : fullReloadRequested
2947
+ ? "Hard refresh requested - setting iframe src"
2948
+ : "Reloading iframe src");
2862
2949
  setLoadedIframeSrc(undefined);
2950
+ // A canvas link navigation may carry a #anchor; the browser scrolls the
2951
+ // freshly loaded document to it natively.
2952
+ if (pendingCanvasAnchorRef.current) {
2953
+ renderUrl.hash = pendingCanvasAnchorRef.current;
2954
+ pendingCanvasAnchorRef.current = undefined;
2955
+ }
2863
2956
  setIframeSrc(renderUrl.toString());
2864
2957
  }
2865
2958
  function runBridgeRefresh() {
@@ -2878,10 +2971,13 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2878
2971
  canvasRefreshInFlightSinceRef.current = Date.now();
2879
2972
  awaitingHostAppRefreshRenderRef.current = false;
2880
2973
  hostAppRefreshSawStructureUpdateRef.current = false;
2974
+ const discardActiveFieldDraft = discardActiveFieldDraftOnNextRefreshRef.current;
2975
+ discardActiveFieldDraftOnNextRefreshRef.current = false;
2881
2976
  const accepted = bridge.sendCommand("refresh", {
2882
2977
  url: renderUrl.toString(),
2883
2978
  revision: editContext.revision,
2884
2979
  layoutKind: editContext.layoutMode,
2980
+ discardActiveFieldDraft: discardActiveFieldDraft || undefined,
2885
2981
  });
2886
2982
  if (!accepted) {
2887
2983
  pendingRefreshScrollRef.current = undefined;
@@ -2911,6 +3007,7 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2911
3007
  }, [
2912
3008
  pathname,
2913
3009
  editContext.revision,
3010
+ editContext.fullReloadToken,
2914
3011
  pageItemDescriptor,
2915
3012
  pageViewContext.editUrl,
2916
3013
  pageViewContext.previewUrl,
@@ -2924,25 +3021,45 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
2924
3021
  ]);
2925
3022
  useEffect(() => {
2926
3023
  if (fieldsContext?.focusedField) {
3024
+ const focusedField = fieldsContext.focusedField;
3025
+ const focusedFieldKey = getFocusedFieldScrollKey(focusedField);
3026
+ // The post-operation auto-focus of a moved/added component arms this
3027
+ // suppression at its source: it carries no user intent to see the
3028
+ // field, and after a move the field still measures at its pre-move
3029
+ // rect (the drag origin) until the refreshed geometry lands — the
3030
+ // canvas refresh may not even have started yet, so the in-flight
3031
+ // check below cannot catch it. Deterministic — no time window to lose
3032
+ // against a slow operation. Consumed before the same-key return so an
3033
+ // armed flag never leaks to a later genuine focus; the key is recorded
3034
+ // so a re-run for the same field doesn't scroll either.
3035
+ if (editContext.consumeNextFocusedFieldAutoScrollSuppression?.()) {
3036
+ lastScrolledFocusedFieldKeyRef.current = focusedFieldKey;
3037
+ return;
3038
+ }
3039
+ if (lastScrolledFocusedFieldKeyRef.current === focusedFieldKey)
3040
+ return;
2927
3041
  // A refresh is being applied: the field's rect still describes the
2928
3042
  // pre-edit DOM (after a move, its old position — where the drag
2929
3043
  // started), so scrolling now would yank the canvas to a stale spot.
2930
- // This fires on the post-operation auto-focus of the moved/added
2931
- // component; a genuine user focus during a refresh loses one
2932
- // auto-scroll, which is the lesser evil.
3044
+ // A genuine user focus during a refresh loses one auto-scroll, which
3045
+ // is the lesser evil.
2933
3046
  if (isCanvasRefreshInFlight())
2934
3047
  return;
2935
3048
  // Event-time read: this effect is keyed on focusedField, not selection.
2936
3049
  const currentSelection = editContext.getSelection();
2937
3050
  if (currentSelection.length > 0 &&
2938
- fieldsContext.focusedField.item.id !== currentSelection[0])
3051
+ focusedField.item.id !== currentSelection[0])
2939
3052
  return;
2940
- const bounds = findBridgeFieldDocumentBounds(pageViewContextRef.current?.bridgeGeometry, fieldsContext.focusedField);
3053
+ lastScrolledFocusedFieldKeyRef.current = focusedFieldKey;
3054
+ const bounds = findBridgeFieldDocumentBounds(pageViewContextRef.current?.bridgeGeometry, focusedField);
2941
3055
  const activePageViewContext = pageViewContextRef.current;
2942
3056
  if (bounds && activePageViewContext) {
2943
3057
  scrollBridgeBoundsIntoView(activePageViewContext, bounds, latestBridgeScrollRef.current);
2944
3058
  }
2945
3059
  }
3060
+ else {
3061
+ lastScrolledFocusedFieldKeyRef.current = undefined;
3062
+ }
2946
3063
  }, [fieldsContext?.focusedField, isCanvasRefreshInFlight]);
2947
3064
  // Drive the selection-scroll suppression window from the drag lifecycle.
2948
3065
  // Declared BEFORE the selection-scroll effect so it runs first in the same
@@ -3172,6 +3289,23 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
3172
3289
  window.clearTimeout(geometryTimer);
3173
3290
  };
3174
3291
  }, [zoom]);
3292
+ useEffect(() => {
3293
+ if (!pageViewContext.bridgeReady ||
3294
+ (!editContext.dragObject &&
3295
+ !editContext.selectedForInsertion &&
3296
+ !editContext.insertMode)) {
3297
+ return;
3298
+ }
3299
+ // Insert mode needs a fresh structural measurement. In particular, the
3300
+ // host can become ready before its rendering framework has committed the
3301
+ // placeholder markers, leaving the startup snapshot structurally empty.
3302
+ bridgeClientRef.current?.sendCommand("queryGeometry", {});
3303
+ }, [
3304
+ editContext.dragObject,
3305
+ editContext.insertMode,
3306
+ editContext.selectedForInsertion,
3307
+ pageViewContext.bridgeReady,
3308
+ ]);
3175
3309
  useEffect(() => {
3176
3310
  let geometryTimer = null;
3177
3311
  const sendViewportStateToBridge = (event) => {
@@ -3214,11 +3348,8 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
3214
3348
  : (pageViewContext.deviceWidth || 640) +
3215
3349
  editContext.configuration.outline.width +
3216
3350
  "px";
3217
- const fullscreenPageTitle = pageViewContext.page?.item?.displayName?.trim() ||
3218
- pageViewContext.page?.item?.name?.trim() ||
3219
- "Page";
3220
3351
  const showSuggestionsCursor = !isBridgeInlineEditing && editContext.mode === "suggestions";
3221
- return (_jsxs("div", { className: cn("relative flex h-full w-full flex-col items-center select-none", className, editContext.showAgentsPanel && !editContext.currentWizardId && "pr-0"), children: [!pageViewContext.fullscreen && (_jsx(EditorWarnings, { item: pageViewContext.page?.item })), slotCloseButton && (_jsx("div", { className: "absolute top-3 right-3 z-50", children: slotCloseButton })), pageViewContext.fullscreen && (_jsxs("div", { className: "border-neutral-grey-15 relative z-40 flex h-11 w-full shrink-0 items-center justify-center border-b bg-white px-28 text-center shadow-sm", "data-testid": "fullscreen-page-title-bar", children: [_jsx("div", { className: "text-neutral-grey-100 max-w-full truncate text-sm font-medium", title: fullscreenPageTitle, "data-testid": "fullscreen-page-title", children: fullscreenPageTitle }), _jsx("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children: _jsx(FullscreenControls, { device: pageViewContext.device, setDevice: (device) => pageViewContext.setDevice(device), canExit: !editContext.configuration.forceFullscreen, onExit: () => editContext.setFullscreen(false) }) })] })), pageViewContext.device !== "desktop" && (_jsx(DeviceToolbar, { pageViewContext: pageViewContext, configuration: editContext.configuration })), _jsxs("div", { className: "relative flex min-h-0 flex-1 transition-[width] duration-300 ease-in-out select-none motion-reduce:transition-none", "data-testid": "page-viewer-viewport", style: {
3352
+ return (_jsxs("div", { className: cn("relative flex h-full w-full flex-col items-center select-none", className, editContext.showAgentsPanel && !editContext.currentWizardId && "pr-0"), children: [!pageViewContext.fullscreen && (_jsx(EditorWarnings, { item: pageViewContext.page?.item })), slotCloseButton && (_jsx("div", { className: "absolute top-3 right-3 z-50", children: slotCloseButton })), pageViewContext.fullscreen && (_jsxs("div", { className: "border-neutral-grey-15 relative z-40 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: pageViewContext.page?.item, variant: "fullscreen" }) }), _jsx("div", { className: "justify-self-center", children: _jsx(FullscreenControls, { device: pageViewContext.device, setDevice: (device) => pageViewContext.setDevice(device), zoom: pageViewContext.zoom, setZoom: pageViewContext.setZoom, canExit: !editContext.configuration.forceFullscreen, onExit: () => editContext.setFullscreen(false) }) }), _jsx("div", { "aria-hidden": "true" })] })), pageViewContext.device !== "desktop" && (_jsx(DeviceToolbar, { pageViewContext: pageViewContext, configuration: editContext.configuration })), _jsxs("div", { className: "relative flex min-h-0 flex-1 transition-[width] duration-300 ease-in-out select-none motion-reduce:transition-none", "data-testid": "page-viewer-viewport", style: {
3222
3353
  width: deviceWidth,
3223
3354
  }, children: [_jsxs("div", { className: "relative h-full w-full overflow-visible", onMouseLeave: () => {
3224
3355
  if (pageViewContext.bridgeInteraction?.kind === "hover") {
@@ -3263,6 +3394,6 @@ function PageViewerFrameContent({ compareView, pageViewContext, editContext, cla
3263
3394
  }
3264
3395
  completeCanvasRefresh();
3265
3396
  }
3266
- } }), iframeElement && (_jsx(IframeOverlayProvider, { iframe: iframeElement, mode: "scrolling", scrollScale: 1, visualScale: 1, invalidationKey: `${zoom}:${bridgeGeometryRevision}`, deferredInvalidationMs: ZOOM_TRANSITION_MS + 50, bleed: { top: 2, bottom: 2, left: 2 }, children: _jsx(PageEditorChrome, { iframe: iframeElement, compareView: compareView, pageViewContext: pageViewContext, bridgeInteraction: bridgeInteraction, onBridgeRichTextCommand: sendApplyRichTextCommand }) })), pageViewContext.deviceHeight && pageViewContext.device && (_jsx("div", { className: "bg-neutral-grey-5 relative z-40 h-full w-full" }))] }), 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 })] }));
3397
+ } }), iframeElement && (_jsx(IframeOverlayProvider, { iframe: iframeElement, mode: "scrolling", scrollScale: 1, visualScale: 1, invalidationKey: `${zoom}:${bridgeGeometryRevision}`, 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 }) })), pageViewContext.deviceHeight && pageViewContext.device && (_jsx("div", { className: "bg-neutral-grey-5 relative z-40 h-full w-full" }))] }), 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 })] }));
3267
3398
  }
3268
3399
  //# sourceMappingURL=PageViewerFrame.js.map