@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.
Files changed (1146) hide show
  1. package/dist/components/emoji/EmojiPicker.d.ts +18 -0
  2. package/dist/components/emoji/EmojiPicker.js +102 -0
  3. package/dist/components/emoji/EmojiPicker.js.map +1 -0
  4. package/dist/components/emoji/EmojiText.d.ts +19 -0
  5. package/dist/components/emoji/EmojiText.js +30 -0
  6. package/dist/components/emoji/EmojiText.js.map +1 -0
  7. package/dist/components/emoji/emojiData.generated.d.ts +2 -0
  8. package/dist/components/emoji/emojiData.generated.js +1878 -0
  9. package/dist/components/emoji/emojiData.generated.js.map +1 -0
  10. package/dist/components/emoji/emojiIndex.d.ts +46 -0
  11. package/dist/components/emoji/emojiIndex.js +173 -0
  12. package/dist/components/emoji/emojiIndex.js.map +1 -0
  13. package/dist/components/emoji/emoticons.d.ts +21 -0
  14. package/dist/components/emoji/emoticons.js +167 -0
  15. package/dist/components/emoji/emoticons.js.map +1 -0
  16. package/dist/components/emoji/textareaInsert.d.ts +19 -0
  17. package/dist/components/emoji/textareaInsert.js +29 -0
  18. package/dist/components/emoji/textareaInsert.js.map +1 -0
  19. package/dist/components/emoji/twemoji.d.ts +30 -0
  20. package/dist/components/emoji/twemoji.js +84 -0
  21. package/dist/components/emoji/twemoji.js.map +1 -0
  22. package/dist/components/ui/alert.d.ts +6 -1
  23. package/dist/components/ui/alert.js +12 -3
  24. package/dist/components/ui/alert.js.map +1 -1
  25. package/dist/components/ui/context-menu.d.ts +25 -0
  26. package/dist/components/ui/context-menu.js +54 -36
  27. package/dist/components/ui/context-menu.js.map +1 -1
  28. package/dist/components/ui/copy-button.d.ts +3 -1
  29. package/dist/components/ui/copy-button.js +13 -2
  30. package/dist/components/ui/copy-button.js.map +1 -1
  31. package/dist/components/ui/mention-textarea.d.ts +8 -0
  32. package/dist/components/ui/mention-textarea.js +98 -46
  33. package/dist/components/ui/mention-textarea.js.map +1 -1
  34. package/dist/components/ui/paste-button.js +11 -1
  35. package/dist/components/ui/paste-button.js.map +1 -1
  36. package/dist/config/config.js +46 -4
  37. package/dist/config/config.js.map +1 -1
  38. package/dist/config/types.d.ts +2 -0
  39. package/dist/config/types.js.map +1 -1
  40. package/dist/editor/ConcurrentUserLimitDialog.js +5 -2
  41. package/dist/editor/ConcurrentUserLimitDialog.js.map +1 -1
  42. package/dist/editor/ContentTree.js +7 -2
  43. package/dist/editor/ContentTree.js.map +1 -1
  44. package/dist/editor/ContextMenu.js +11 -36
  45. package/dist/editor/ContextMenu.js.map +1 -1
  46. package/dist/editor/EditorWarning.js +8 -4
  47. package/dist/editor/EditorWarning.js.map +1 -1
  48. package/dist/editor/FieldList.js +1 -1
  49. package/dist/editor/FieldList.js.map +1 -1
  50. package/dist/editor/FieldListField.js +18 -13
  51. package/dist/editor/FieldListField.js.map +1 -1
  52. package/dist/editor/FieldListFieldWithFallbacks.js +1 -1
  53. package/dist/editor/GlobalMenuBar.js +2 -1
  54. package/dist/editor/GlobalMenuBar.js.map +1 -1
  55. package/dist/editor/ImageEditor.js +3 -1
  56. package/dist/editor/ImageEditor.js.map +1 -1
  57. package/dist/editor/MainLayout.js +1 -1
  58. package/dist/editor/MainLayout.js.map +1 -1
  59. package/dist/editor/MigrationsView.js +3 -2
  60. package/dist/editor/MigrationsView.js.map +1 -1
  61. package/dist/editor/MobileLayout.js +43 -20
  62. package/dist/editor/MobileLayout.js.map +1 -1
  63. package/dist/editor/PictureEditor.js +4 -2
  64. package/dist/editor/PictureEditor.js.map +1 -1
  65. package/dist/editor/QuickItemSwitcher.js +4 -2
  66. package/dist/editor/QuickItemSwitcher.js.map +1 -1
  67. package/dist/editor/agent-changes/agentChangeTargets.js +6 -0
  68. package/dist/editor/agent-changes/agentChangeTargets.js.map +1 -1
  69. package/dist/editor/agent-changes/agentChangeTextHighlight.d.ts +48 -4
  70. package/dist/editor/agent-changes/agentChangeTextHighlight.js +67 -9
  71. package/dist/editor/agent-changes/agentChangeTextHighlight.js.map +1 -1
  72. package/dist/editor/ai/AgentStatusBadge.js +11 -9
  73. package/dist/editor/ai/AgentStatusBadge.js.map +1 -1
  74. package/dist/editor/ai/Agents.js +2 -2
  75. package/dist/editor/ai/Agents.js.map +1 -1
  76. package/dist/editor/ai/HeartbeatDiagnosticsPanel.js +1 -1
  77. package/dist/editor/ai/InlineAiDialog.js +11 -8
  78. package/dist/editor/ai/InlineAiDialog.js.map +1 -1
  79. package/dist/editor/ai/InlineAiTrigger.js +18 -14
  80. package/dist/editor/ai/InlineAiTrigger.js.map +1 -1
  81. package/dist/editor/ai/agentActivitySummary.js +5 -0
  82. package/dist/editor/ai/agentActivitySummary.js.map +1 -1
  83. package/dist/editor/ai/agentDiagnostics.d.ts +1 -1
  84. package/dist/editor/ai/agentDiagnostics.js +8 -0
  85. package/dist/editor/ai/agentDiagnostics.js.map +1 -1
  86. package/dist/editor/ai/agentMessageConversion.js +1 -0
  87. package/dist/editor/ai/agentMessageConversion.js.map +1 -1
  88. package/dist/editor/ai/agentMessageMarkdown.js +4 -4
  89. package/dist/editor/ai/agentMessageMarkdown.js.map +1 -1
  90. package/dist/editor/ai/dialogs/capturePageScreenshot.d.ts +4 -1
  91. package/dist/editor/ai/dialogs/capturePageScreenshot.js +214 -44
  92. package/dist/editor/ai/dialogs/capturePageScreenshot.js.map +1 -1
  93. package/dist/editor/ai/dialogs/captureShared.d.ts +8 -1
  94. package/dist/editor/ai/dialogs/captureShared.js +4 -1
  95. package/dist/editor/ai/dialogs/captureShared.js.map +1 -1
  96. package/dist/editor/ai/dialogs/offscreenPageCapture.js +1 -1
  97. package/dist/editor/ai/dialogs/offscreenPageCapture.js.map +1 -1
  98. package/dist/editor/ai/prepareInlineAiTextSelection.d.ts +2 -1
  99. package/dist/editor/ai/prepareInlineAiTextSelection.js +1 -2
  100. package/dist/editor/ai/prepareInlineAiTextSelection.js.map +1 -1
  101. package/dist/editor/ai/terminal/agentCost.d.ts +2 -0
  102. package/dist/editor/ai/terminal/agentCost.js +1 -0
  103. package/dist/editor/ai/terminal/agentCost.js.map +1 -1
  104. package/dist/editor/ai/terminal/agentSessionLiveTotals.js +3 -0
  105. package/dist/editor/ai/terminal/agentSessionLiveTotals.js.map +1 -1
  106. package/dist/editor/ai/terminal/agentSessionSelectors.d.ts +5 -2
  107. package/dist/editor/ai/terminal/agentSessionSelectors.js +5 -2
  108. package/dist/editor/ai/terminal/agentSessionSelectors.js.map +1 -1
  109. package/dist/editor/ai/terminal/agentSessionSnapshot.d.ts +15 -0
  110. package/dist/editor/ai/terminal/agentSessionSnapshot.js +103 -3
  111. package/dist/editor/ai/terminal/agentSessionSnapshot.js.map +1 -1
  112. package/dist/editor/ai/terminal/agentSessionState.js +13 -2
  113. package/dist/editor/ai/terminal/agentSessionState.js.map +1 -1
  114. package/dist/editor/ai/terminal/components/AgentActivityOverviewPanel.js +7 -7
  115. package/dist/editor/ai/terminal/components/AgentActivityOverviewPanel.js.map +1 -1
  116. package/dist/editor/ai/terminal/components/AgentBanners.js +2 -2
  117. package/dist/editor/ai/terminal/components/AgentBanners.js.map +1 -1
  118. package/dist/editor/ai/terminal/components/AgentCostDisplay.d.ts +2 -0
  119. package/dist/editor/ai/terminal/components/AgentCostDisplay.js +2 -1
  120. package/dist/editor/ai/terminal/components/AgentCostDisplay.js.map +1 -1
  121. package/dist/editor/ai/terminal/components/AgentFullPromptControls.js +1 -1
  122. package/dist/editor/ai/terminal/components/AgentFullPromptControls.js.map +1 -1
  123. package/dist/editor/ai/terminal/components/AgentModeSelector.js +7 -3
  124. package/dist/editor/ai/terminal/components/AgentModeSelector.js.map +1 -1
  125. package/dist/editor/ai/terminal/components/AgentPromptActionButtons.js +3 -3
  126. package/dist/editor/ai/terminal/components/AgentPromptActionButtons.js.map +1 -1
  127. package/dist/editor/ai/terminal/components/AgentPromptInputArea.js +2 -2
  128. package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js +1 -1
  129. package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js.map +1 -1
  130. package/dist/editor/ai/terminal/components/AgentReadOnlyNotice.js +1 -1
  131. package/dist/editor/ai/terminal/components/AgentReadOnlyNotice.js.map +1 -1
  132. package/dist/editor/ai/terminal/components/AgentSkillSettingsSection.js +2 -2
  133. package/dist/editor/ai/terminal/components/AgentSkillSettingsSection.js.map +1 -1
  134. package/dist/editor/ai/terminal/components/AgentTerminalFullLayout.js +1 -1
  135. package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.d.ts +5 -2
  136. package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js +43 -4
  137. package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js.map +1 -1
  138. package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.js +1 -1
  139. package/dist/editor/ai/terminal/components/AgentTerminalSummaryLayout.js.map +1 -1
  140. package/dist/editor/ai/terminal/components/AiResponseMessage.js +40 -22
  141. package/dist/editor/ai/terminal/components/AiResponseMessage.js.map +1 -1
  142. package/dist/editor/ai/terminal/components/ApprovalCard.d.ts +3 -1
  143. package/dist/editor/ai/terminal/components/ApprovalCard.js +8 -16
  144. package/dist/editor/ai/terminal/components/ApprovalCard.js.map +1 -1
  145. package/dist/editor/ai/terminal/components/ContextInfoBar.js +1 -1
  146. package/dist/editor/ai/terminal/components/ContextInfoBar.js.map +1 -1
  147. package/dist/editor/ai/terminal/components/CreateItemToolCallContent.js +1 -1
  148. package/dist/editor/ai/terminal/components/CreateItemToolCallContent.js.map +1 -1
  149. package/dist/editor/ai/terminal/components/EditFieldToolCallContent.d.ts +7 -4
  150. package/dist/editor/ai/terminal/components/EditFieldToolCallContent.js +57 -32
  151. package/dist/editor/ai/terminal/components/EditFieldToolCallContent.js.map +1 -1
  152. package/dist/editor/ai/terminal/components/ResponseTurnDuration.js +1 -2
  153. package/dist/editor/ai/terminal/components/ResponseTurnDuration.js.map +1 -1
  154. package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.d.ts +6 -0
  155. package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.js +61 -0
  156. package/dist/editor/ai/terminal/components/ToolCallDiagnosticsPanel.js.map +1 -0
  157. package/dist/editor/ai/terminal/components/ToolCallDisplay.d.ts +5 -0
  158. package/dist/editor/ai/terminal/components/ToolCallDisplay.js +19 -8
  159. package/dist/editor/ai/terminal/components/ToolCallDisplay.js.map +1 -1
  160. package/dist/editor/ai/terminal/components/UserMessage.js +4 -2
  161. package/dist/editor/ai/terminal/components/UserMessage.js.map +1 -1
  162. package/dist/editor/ai/terminal/components/ValueDiff.js +1 -1
  163. package/dist/editor/ai/terminal/components/ValueDiff.js.map +1 -1
  164. package/dist/editor/ai/terminal/components/toolCallContentRenderers.js +7 -4
  165. package/dist/editor/ai/terminal/components/toolCallContentRenderers.js.map +1 -1
  166. package/dist/editor/ai/terminal/components/useApprovalActions.js +1 -1
  167. package/dist/editor/ai/terminal/components/useApprovalActions.js.map +1 -1
  168. package/dist/editor/ai/terminal/toolCallDiagnostics.d.ts +34 -0
  169. package/dist/editor/ai/terminal/toolCallDiagnostics.js +218 -0
  170. package/dist/editor/ai/terminal/toolCallDiagnostics.js.map +1 -0
  171. package/dist/editor/ai/terminal/types.d.ts +1 -0
  172. package/dist/editor/ai/terminal/useAgentEditorContext.js +16 -4
  173. package/dist/editor/ai/terminal/useAgentEditorContext.js.map +1 -1
  174. package/dist/editor/ai/terminal/useAgentLoadPipeline.d.ts +1 -0
  175. package/dist/editor/ai/terminal/useAgentLoadPipeline.js +2 -1
  176. package/dist/editor/ai/terminal/useAgentLoadPipeline.js.map +1 -1
  177. package/dist/editor/ai/terminal/useAgentLoader.d.ts +2 -0
  178. package/dist/editor/ai/terminal/useAgentLoader.js +17 -2
  179. package/dist/editor/ai/terminal/useAgentLoader.js.map +1 -1
  180. package/dist/editor/ai/terminal/useAgentModeState.d.ts +5 -1
  181. package/dist/editor/ai/terminal/useAgentModeState.js +11 -3
  182. package/dist/editor/ai/terminal/useAgentModeState.js.map +1 -1
  183. package/dist/editor/ai/terminal/useAgentOperationHistoryLoader.js +5 -1
  184. package/dist/editor/ai/terminal/useAgentOperationHistoryLoader.js.map +1 -1
  185. package/dist/editor/ai/terminal/useAgentOperationSocketHandler.js +33 -1
  186. package/dist/editor/ai/terminal/useAgentOperationSocketHandler.js.map +1 -1
  187. package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.d.ts +1 -0
  188. package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.js +5 -1
  189. package/dist/editor/ai/terminal/useAgentRunDeltaSocketHandler.js.map +1 -1
  190. package/dist/editor/ai/terminal/useAgentRunRefs.d.ts +1 -0
  191. package/dist/editor/ai/terminal/useAgentRunRefs.js +3 -0
  192. package/dist/editor/ai/terminal/useAgentRunRefs.js.map +1 -1
  193. package/dist/editor/ai/terminal/useAgentServerReconciler.js +11 -0
  194. package/dist/editor/ai/terminal/useAgentServerReconciler.js.map +1 -1
  195. package/dist/editor/ai/terminal/useAgentSessionSync.d.ts +6 -0
  196. package/dist/editor/ai/terminal/useAgentSessionSync.js +27 -3
  197. package/dist/editor/ai/terminal/useAgentSessionSync.js.map +1 -1
  198. package/dist/editor/ai/terminal/useAgentSettingsData.d.ts +1 -1
  199. package/dist/editor/ai/terminal/useAgentSettingsPanel.js +7 -6
  200. package/dist/editor/ai/terminal/useAgentSettingsPanel.js.map +1 -1
  201. package/dist/editor/ai/terminal/useAgentSettingsSelectOptions.js +14 -2
  202. package/dist/editor/ai/terminal/useAgentSettingsSelectOptions.js.map +1 -1
  203. package/dist/editor/ai/terminal/useAgentStatusBarContent.js +11 -4
  204. package/dist/editor/ai/terminal/useAgentStatusBarContent.js.map +1 -1
  205. package/dist/editor/ai/terminal/useAgentStreamPipeline.d.ts +1 -0
  206. package/dist/editor/ai/terminal/useAgentStreamPipeline.js +2 -1
  207. package/dist/editor/ai/terminal/useAgentStreamPipeline.js.map +1 -1
  208. package/dist/editor/ai/terminal/useAgentSubmitHandlers.d.ts +1 -0
  209. package/dist/editor/ai/terminal/useAgentSubmitHandlers.js +17 -4
  210. package/dist/editor/ai/terminal/useAgentSubmitHandlers.js.map +1 -1
  211. package/dist/editor/ai/terminal/useAgentTerminalController.js +7 -1
  212. package/dist/editor/ai/terminal/useAgentTerminalController.js.map +1 -1
  213. package/dist/editor/ai/terminal/useAgentToolCallHandler.js +1 -0
  214. package/dist/editor/ai/terminal/useAgentToolCallHandler.js.map +1 -1
  215. package/dist/editor/ai/types.d.ts +4 -0
  216. package/dist/editor/ai-image-editor/AiImageEditorDialog.d.ts +33 -0
  217. package/dist/editor/ai-image-editor/AiImageEditorDialog.js +372 -127
  218. package/dist/editor/ai-image-editor/AiImageEditorDialog.js.map +1 -1
  219. package/dist/editor/ai-image-editor/AiImageResultOverlay.js +4 -2
  220. package/dist/editor/ai-image-editor/AiImageResultOverlay.js.map +1 -1
  221. package/dist/editor/bridge/BridgeClient.js +11 -0
  222. package/dist/editor/bridge/BridgeClient.js.map +1 -1
  223. package/dist/editor/bridge/protocol.d.ts +61 -0
  224. package/dist/editor/bridge/protocol.js +3 -0
  225. package/dist/editor/bridge/protocol.js.map +1 -1
  226. package/dist/editor/client/EditorShell.js +335 -125
  227. package/dist/editor/client/EditorShell.js.map +1 -1
  228. package/dist/editor/client/SessionExpiredOverlay.js +9 -2
  229. package/dist/editor/client/SessionExpiredOverlay.js.map +1 -1
  230. package/dist/editor/client/clipboardStorage.d.ts +10 -0
  231. package/dist/editor/client/clipboardStorage.js +57 -0
  232. package/dist/editor/client/clipboardStorage.js.map +1 -0
  233. package/dist/editor/client/editContext.d.ts +92 -11
  234. package/dist/editor/client/editContext.js.map +1 -1
  235. package/dist/editor/client/editHistoryReconciliation.d.ts +2 -1
  236. package/dist/editor/client/editHistoryReconciliation.js +5 -2
  237. package/dist/editor/client/editHistoryReconciliation.js.map +1 -1
  238. package/dist/editor/client/hooks/useRepositoryItemRefresh.d.ts +4 -0
  239. package/dist/editor/client/hooks/useRepositoryItemRefresh.js +62 -0
  240. package/dist/editor/client/hooks/useRepositoryItemRefresh.js.map +1 -0
  241. package/dist/editor/client/hooks/useSocketMessageHandler.d.ts +6 -0
  242. package/dist/editor/client/hooks/useSocketMessageHandler.js +69 -4
  243. package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
  244. package/dist/editor/client/itemsRepository.d.ts +10 -2
  245. package/dist/editor/client/itemsRepository.js +224 -43
  246. package/dist/editor/client/itemsRepository.js.map +1 -1
  247. package/dist/editor/client/liveEditState.d.ts +16 -0
  248. package/dist/editor/client/liveEditState.js +25 -0
  249. package/dist/editor/client/liveEditState.js.map +1 -0
  250. package/dist/editor/client/liveSessionState.d.ts +6 -0
  251. package/dist/editor/client/liveSessionState.js +20 -0
  252. package/dist/editor/client/liveSessionState.js.map +1 -0
  253. package/dist/editor/client/operations.d.ts +13 -2
  254. package/dist/editor/client/operations.js +134 -31
  255. package/dist/editor/client/operations.js.map +1 -1
  256. package/dist/editor/client/pageModelBuilder.d.ts +6 -0
  257. package/dist/editor/client/pageModelBuilder.js +74 -7
  258. package/dist/editor/client/pageModelBuilder.js.map +1 -1
  259. package/dist/editor/client/ui/EditorChrome.d.ts +2 -2
  260. package/dist/editor/client/ui/EditorChrome.js +12 -8
  261. package/dist/editor/client/ui/EditorChrome.js.map +1 -1
  262. package/dist/editor/client/ui/FullscreenControls.d.ts +3 -5
  263. package/dist/editor/client/ui/FullscreenControls.js +2 -2
  264. package/dist/editor/client/ui/FullscreenControls.js.map +1 -1
  265. package/dist/editor/client/valueStore.d.ts +22 -0
  266. package/dist/editor/client/valueStore.js +29 -0
  267. package/dist/editor/client/valueStore.js.map +1 -0
  268. package/dist/editor/commands/commands.d.ts +6 -0
  269. package/dist/editor/commands/commands.js.map +1 -1
  270. package/dist/editor/commands/componentClipboardCommands.d.ts +35 -0
  271. package/dist/editor/commands/componentClipboardCommands.js +271 -0
  272. package/dist/editor/commands/componentClipboardCommands.js.map +1 -0
  273. package/dist/editor/commands/componentCommands.js +80 -19
  274. package/dist/editor/commands/componentCommands.js.map +1 -1
  275. package/dist/editor/commands/componentMenuGroups.d.ts +2 -0
  276. package/dist/editor/commands/componentMenuGroups.js +43 -0
  277. package/dist/editor/commands/componentMenuGroups.js.map +1 -0
  278. package/dist/editor/commands/itemCommands.d.ts +9 -0
  279. package/dist/editor/commands/itemCommands.js +76 -9
  280. package/dist/editor/commands/itemCommands.js.map +1 -1
  281. package/dist/editor/component-conversion/ComponentTypePickerDialog.d.ts +12 -0
  282. package/dist/editor/component-conversion/ComponentTypePickerDialog.js +40 -0
  283. package/dist/editor/component-conversion/ComponentTypePickerDialog.js.map +1 -0
  284. package/dist/editor/component-conversion/ConversionAiDebugButton.d.ts +17 -0
  285. package/dist/editor/component-conversion/ConversionAiDebugButton.js +80 -0
  286. package/dist/editor/component-conversion/ConversionAiDebugButton.js.map +1 -0
  287. package/dist/editor/component-conversion/ConvertComponentDialog.d.ts +28 -0
  288. package/dist/editor/component-conversion/ConvertComponentDialog.js +633 -0
  289. package/dist/editor/component-conversion/ConvertComponentDialog.js.map +1 -0
  290. package/dist/editor/component-conversion/conversionModel.d.ts +109 -0
  291. package/dist/editor/component-conversion/conversionModel.js +519 -0
  292. package/dist/editor/component-conversion/conversionModel.js.map +1 -0
  293. package/dist/editor/component-conversion/conversionService.d.ts +12 -0
  294. package/dist/editor/component-conversion/conversionService.js +16 -0
  295. package/dist/editor/component-conversion/conversionService.js.map +1 -0
  296. package/dist/editor/component-conversion/conversionTypes.d.ts +214 -0
  297. package/dist/editor/component-conversion/conversionTypes.js +2 -0
  298. package/dist/editor/component-conversion/conversionTypes.js.map +1 -0
  299. package/dist/editor/component-conversion/convertComponentsCommand.d.ts +25 -0
  300. package/dist/editor/component-conversion/convertComponentsCommand.js +196 -0
  301. package/dist/editor/component-conversion/convertComponentsCommand.js.map +1 -0
  302. package/dist/editor/editor-warnings/ValidationErrors.js +4 -4
  303. package/dist/editor/editor-warnings/ValidationErrors.js.map +1 -1
  304. package/dist/editor/field-types/AttachmentEditor.js +4 -3
  305. package/dist/editor/field-types/AttachmentEditor.js.map +1 -1
  306. package/dist/editor/field-types/DateFieldEditor.js +2 -1
  307. package/dist/editor/field-types/DateFieldEditor.js.map +1 -1
  308. package/dist/editor/field-types/DateTimeFieldEditor.js +2 -1
  309. package/dist/editor/field-types/DateTimeFieldEditor.js.map +1 -1
  310. package/dist/editor/field-types/DropLinkEditor.js +3 -1
  311. package/dist/editor/field-types/DropLinkEditor.js.map +1 -1
  312. package/dist/editor/field-types/DropListEditor.js +3 -1
  313. package/dist/editor/field-types/DropListEditor.js.map +1 -1
  314. package/dist/editor/field-types/FieldHistoryBoundary.js +28 -7
  315. package/dist/editor/field-types/FieldHistoryBoundary.js.map +1 -1
  316. package/dist/editor/field-types/ImageFieldEditor.js +3 -1
  317. package/dist/editor/field-types/ImageFieldEditor.js.map +1 -1
  318. package/dist/editor/field-types/InternalLinkFieldEditor.js +2 -1
  319. package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -1
  320. package/dist/editor/field-types/LinkFieldEditor.js +2 -1
  321. package/dist/editor/field-types/LinkFieldEditor.js.map +1 -1
  322. package/dist/editor/field-types/MultiLineText.js +68 -22
  323. package/dist/editor/field-types/MultiLineText.js.map +1 -1
  324. package/dist/editor/field-types/NameValueListEditor.js +3 -1
  325. package/dist/editor/field-types/NameValueListEditor.js.map +1 -1
  326. package/dist/editor/field-types/PictureFieldEditor.js +4 -2
  327. package/dist/editor/field-types/PictureFieldEditor.js.map +1 -1
  328. package/dist/editor/field-types/RawEditor.js +7 -4
  329. package/dist/editor/field-types/RawEditor.js.map +1 -1
  330. package/dist/editor/field-types/RichTextEditor.d.ts +1 -2
  331. package/dist/editor/field-types/RichTextEditor.js +5 -26
  332. package/dist/editor/field-types/RichTextEditor.js.map +1 -1
  333. package/dist/editor/field-types/RichTextEditorComponent.d.ts +1 -2
  334. package/dist/editor/field-types/RichTextEditorComponent.js +121 -26
  335. package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -1
  336. package/dist/editor/field-types/SingleLineText.js +68 -22
  337. package/dist/editor/field-types/SingleLineText.js.map +1 -1
  338. package/dist/editor/field-types/TreeListEditor.js +4 -2
  339. package/dist/editor/field-types/TreeListEditor.js.map +1 -1
  340. package/dist/editor/field-types/fieldStyles.d.ts +21 -0
  341. package/dist/editor/field-types/fieldStyles.js +22 -0
  342. package/dist/editor/field-types/fieldStyles.js.map +1 -0
  343. package/dist/editor/field-types/richtext/bridgeRichTextProfile.d.ts +15 -1
  344. package/dist/editor/field-types/richtext/bridgeRichTextProfile.js +27 -0
  345. package/dist/editor/field-types/richtext/bridgeRichTextProfile.js.map +1 -1
  346. package/dist/editor/field-types/richtext/components/EditorDropdown.css +14 -0
  347. package/dist/editor/field-types/richtext/components/EditorDropdown.d.ts +3 -1
  348. package/dist/editor/field-types/richtext/components/EditorDropdown.js +33 -8
  349. package/dist/editor/field-types/richtext/components/EditorDropdown.js.map +1 -1
  350. package/dist/editor/field-types/richtext/components/ReactSlate.css +23 -54
  351. package/dist/editor/field-types/richtext/components/ReactSlate.d.ts +10 -1
  352. package/dist/editor/field-types/richtext/components/ReactSlate.js +373 -174
  353. package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
  354. package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js +1 -1
  355. package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js.map +1 -1
  356. package/dist/editor/field-types/richtext/components/ToolbarButton.js +13 -5
  357. package/dist/editor/field-types/richtext/components/ToolbarButton.js.map +1 -1
  358. package/dist/editor/field-types/richtext/config/pluginFactory.d.ts +2 -0
  359. package/dist/editor/field-types/richtext/config/pluginFactory.js +2 -1
  360. package/dist/editor/field-types/richtext/config/pluginFactory.js.map +1 -1
  361. package/dist/editor/field-types/richtext/hooks/useProfileCache.js +1 -0
  362. package/dist/editor/field-types/richtext/hooks/useProfileCache.js.map +1 -1
  363. package/dist/editor/field-types/richtext/hooks/useRichTextProfile.d.ts +0 -2
  364. package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js +2 -5
  365. package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js.map +1 -1
  366. package/dist/editor/field-types/richtext/types.d.ts +47 -2
  367. package/dist/editor/field-types/richtext/types.js +19 -0
  368. package/dist/editor/field-types/richtext/types.js.map +1 -1
  369. package/dist/editor/field-types/richtext/utils/changeHighlight.d.ts +14 -0
  370. package/dist/editor/field-types/richtext/utils/changeHighlight.js +12 -1
  371. package/dist/editor/field-types/richtext/utils/changeHighlight.js.map +1 -1
  372. package/dist/editor/field-types/richtext/utils/conversion.js +108 -32
  373. package/dist/editor/field-types/richtext/utils/conversion.js.map +1 -1
  374. package/dist/editor/field-types/richtext/utils/cssClasses.d.ts +27 -0
  375. package/dist/editor/field-types/richtext/utils/cssClasses.js +98 -0
  376. package/dist/editor/field-types/richtext/utils/cssClasses.js.map +1 -0
  377. package/dist/editor/field-types/richtext/utils/plugins.d.ts +40 -1
  378. package/dist/editor/field-types/richtext/utils/plugins.js +178 -4
  379. package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -1
  380. package/dist/editor/field-types/richtext/utils/profileMapper.d.ts +17 -1
  381. package/dist/editor/field-types/richtext/utils/profileMapper.js +153 -55
  382. package/dist/editor/field-types/richtext/utils/profileMapper.js.map +1 -1
  383. package/dist/editor/field-types/richtext/utils/spellCheckText.d.ts +31 -0
  384. package/dist/editor/field-types/richtext/utils/spellCheckText.js +82 -0
  385. package/dist/editor/field-types/richtext/utils/spellCheckText.js.map +1 -0
  386. package/dist/editor/field-types/useFocusedFieldInput.d.ts +13 -0
  387. package/dist/editor/field-types/useFocusedFieldInput.js +50 -0
  388. package/dist/editor/field-types/useFocusedFieldInput.js.map +1 -0
  389. package/dist/editor/field-types/useFormFieldCaretPresence.js +9 -1
  390. package/dist/editor/field-types/useFormFieldCaretPresence.js.map +1 -1
  391. package/dist/editor/field-types/useFormFieldSelectionRange.d.ts +20 -13
  392. package/dist/editor/field-types/useFormFieldSelectionRange.js +40 -14
  393. package/dist/editor/field-types/useFormFieldSelectionRange.js.map +1 -1
  394. package/dist/editor/find-replace/FindReplacePanel.d.ts +11 -0
  395. package/dist/editor/find-replace/FindReplacePanel.js +311 -0
  396. package/dist/editor/find-replace/FindReplacePanel.js.map +1 -0
  397. package/dist/editor/find-replace/findReplaceCommand.d.ts +8 -0
  398. package/dist/editor/find-replace/findReplaceCommand.js +25 -0
  399. package/dist/editor/find-replace/findReplaceCommand.js.map +1 -0
  400. package/dist/editor/find-replace/findReplaceMatches.d.ts +42 -0
  401. package/dist/editor/find-replace/findReplaceMatches.js +66 -0
  402. package/dist/editor/find-replace/findReplaceMatches.js.map +1 -0
  403. package/dist/editor/find-replace/findReplaceStore.d.ts +30 -0
  404. package/dist/editor/find-replace/findReplaceStore.js +61 -0
  405. package/dist/editor/find-replace/findReplaceStore.js.map +1 -0
  406. package/dist/editor/find-replace/findReplaceTargets.d.ts +51 -0
  407. package/dist/editor/find-replace/findReplaceTargets.js +110 -0
  408. package/dist/editor/find-replace/findReplaceTargets.js.map +1 -0
  409. package/dist/editor/find-replace/findReplaceText.d.ts +50 -0
  410. package/dist/editor/find-replace/findReplaceText.js +189 -0
  411. package/dist/editor/find-replace/findReplaceText.js.map +1 -0
  412. package/dist/editor/itemContextMenuGroups.js +10 -1
  413. package/dist/editor/itemContextMenuGroups.js.map +1 -1
  414. package/dist/editor/media-selector/AiImageSearch.js +1 -163
  415. package/dist/editor/media-selector/AiImageSearch.js.map +1 -1
  416. package/dist/editor/media-selector/MediaDetailsView.d.ts +14 -0
  417. package/dist/editor/media-selector/MediaDetailsView.js +152 -0
  418. package/dist/editor/media-selector/MediaDetailsView.js.map +1 -0
  419. package/dist/editor/media-selector/MediaFolderBrowser.js +326 -106
  420. package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -1
  421. package/dist/editor/media-selector/TreeSelector.js +40 -2
  422. package/dist/editor/media-selector/TreeSelector.js.map +1 -1
  423. package/dist/editor/media-selector/UploadZone.js +1 -1
  424. package/dist/editor/media-selector/UploadZone.js.map +1 -1
  425. package/dist/editor/media-selector/useMediaFolderDrag.d.ts +26 -0
  426. package/dist/editor/media-selector/useMediaFolderDrag.js +153 -0
  427. package/dist/editor/media-selector/useMediaFolderDrag.js.map +1 -0
  428. package/dist/editor/menubar/ActiveUsers.js +6 -4
  429. package/dist/editor/menubar/ActiveUsers.js.map +1 -1
  430. package/dist/editor/menubar/PageSelector.js +21 -22
  431. package/dist/editor/menubar/PageSelector.js.map +1 -1
  432. package/dist/editor/menubar/ToolbarFactory.js +16 -2
  433. package/dist/editor/menubar/ToolbarFactory.js.map +1 -1
  434. package/dist/editor/menubar/VersionPreviewCard.js +4 -2
  435. package/dist/editor/menubar/VersionPreviewCard.js.map +1 -1
  436. package/dist/editor/menubar/VersionSelector.js +2 -2
  437. package/dist/editor/menubar/VersionSelector.js.map +1 -1
  438. package/dist/editor/menubar/WorkflowButton.js +10 -10
  439. package/dist/editor/menubar/WorkflowButton.js.map +1 -1
  440. package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.d.ts +13 -0
  441. package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.js +88 -0
  442. package/dist/editor/menubar/toolbar-sections/CommentsToggleControl.js.map +1 -0
  443. package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.d.ts +3 -4
  444. package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js +15 -13
  445. package/dist/editor/menubar/toolbar-sections/DeviceSwitchToolbar.js.map +1 -1
  446. package/dist/editor/menubar/toolbar-sections/EditControls.d.ts +9 -0
  447. package/dist/editor/menubar/toolbar-sections/EditControls.js +24 -1
  448. package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -1
  449. package/dist/editor/menubar/toolbar-sections/FindReplaceControls.d.ts +6 -0
  450. package/dist/editor/menubar/toolbar-sections/FindReplaceControls.js +31 -0
  451. package/dist/editor/menubar/toolbar-sections/FindReplaceControls.js.map +1 -0
  452. package/dist/editor/menubar/toolbar-sections/FullscreenControl.js +3 -2
  453. package/dist/editor/menubar/toolbar-sections/FullscreenControl.js.map +1 -1
  454. package/dist/editor/menubar/toolbar-sections/InsertControls.js +4 -2
  455. package/dist/editor/menubar/toolbar-sections/InsertControls.js.map +1 -1
  456. package/dist/editor/menubar/toolbar-sections/LayoutModeControls.js +3 -2
  457. package/dist/editor/menubar/toolbar-sections/LayoutModeControls.js.map +1 -1
  458. package/dist/editor/menubar/toolbar-sections/ReviewCommands.js +2 -2
  459. package/dist/editor/menubar/toolbar-sections/ReviewCommands.js.map +1 -1
  460. package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.d.ts +5 -0
  461. package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.js +16 -0
  462. package/dist/editor/menubar/toolbar-sections/SpellCheckToggleControl.js.map +1 -0
  463. package/dist/editor/menubar/toolbar-sections/UndoRedoControls.js +2 -2
  464. package/dist/editor/menubar/toolbar-sections/UndoRedoControls.js.map +1 -1
  465. package/dist/editor/menubar/toolbar-sections/UtilityControls.js +7 -7
  466. package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
  467. package/dist/editor/menubar/toolbar-sections/ViewportControls.d.ts +3 -4
  468. package/dist/editor/menubar/toolbar-sections/ViewportControls.js +19 -31
  469. package/dist/editor/menubar/toolbar-sections/ViewportControls.js.map +1 -1
  470. package/dist/editor/menubar/toolbar-sections/index.d.ts +2 -1
  471. package/dist/editor/menubar/toolbar-sections/index.js +2 -1
  472. package/dist/editor/menubar/toolbar-sections/index.js.map +1 -1
  473. package/dist/editor/mobileBottomPanel.d.ts +40 -0
  474. package/dist/editor/mobileBottomPanel.js +63 -0
  475. package/dist/editor/mobileBottomPanel.js.map +1 -0
  476. package/dist/editor/notifications/useNotifications.js +12 -17
  477. package/dist/editor/notifications/useNotifications.js.map +1 -1
  478. package/dist/editor/page-editor-chrome/AgentChangeHighlightings.d.ts +3 -6
  479. package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js +8 -6
  480. package/dist/editor/page-editor-chrome/AgentChangeHighlightings.js.map +1 -1
  481. package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.d.ts +5 -1
  482. package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js +60 -10
  483. package/dist/editor/page-editor-chrome/BridgeInlineFormatOverlay.js.map +1 -1
  484. package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.d.ts +6 -0
  485. package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.js +100 -0
  486. package/dist/editor/page-editor-chrome/BridgePasteCleanupOverlay.js.map +1 -0
  487. package/dist/editor/page-editor-chrome/BridgeToolbarDropdown.d.ts +16 -0
  488. package/dist/editor/page-editor-chrome/BridgeToolbarDropdown.js +23 -0
  489. package/dist/editor/page-editor-chrome/BridgeToolbarDropdown.js.map +1 -0
  490. package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.d.ts +9 -0
  491. package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.js +32 -0
  492. package/dist/editor/page-editor-chrome/CanvasOverviewRulerBinding.js.map +1 -0
  493. package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -1
  494. package/dist/editor/page-editor-chrome/CommentHighlightings.js +195 -388
  495. package/dist/editor/page-editor-chrome/CommentHighlightings.js.map +1 -1
  496. package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.d.ts +14 -0
  497. package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.js +110 -0
  498. package/dist/editor/page-editor-chrome/CommentTargetPickerCanvasLayer.js.map +1 -0
  499. package/dist/editor/page-editor-chrome/ConversionIndicators.d.ts +8 -0
  500. package/dist/editor/page-editor-chrome/ConversionIndicators.js +75 -0
  501. package/dist/editor/page-editor-chrome/ConversionIndicators.js.map +1 -0
  502. package/dist/editor/page-editor-chrome/DiffHighlightOverlay.d.ts +9 -13
  503. package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js +25 -20
  504. package/dist/editor/page-editor-chrome/DiffHighlightOverlay.js.map +1 -1
  505. package/dist/editor/page-editor-chrome/DragInsertionOverlay.js +21 -17
  506. package/dist/editor/page-editor-chrome/DragInsertionOverlay.js.map +1 -1
  507. package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.d.ts +1 -1
  508. package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.js +9 -6
  509. package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.js.map +1 -1
  510. package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.d.ts +15 -0
  511. package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.js +31 -0
  512. package/dist/editor/page-editor-chrome/FeedbackLeaderCanvasSegment.js.map +1 -0
  513. package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +1 -1
  514. package/dist/editor/page-editor-chrome/FieldActionIndicator.js +14 -7
  515. package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -1
  516. package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +10 -6
  517. package/dist/editor/page-editor-chrome/FieldEditedIndicator.js.map +1 -1
  518. package/dist/editor/page-editor-chrome/FindReplaceHighlightings.d.ts +11 -0
  519. package/dist/editor/page-editor-chrome/FindReplaceHighlightings.js +120 -0
  520. package/dist/editor/page-editor-chrome/FindReplaceHighlightings.js.map +1 -0
  521. package/dist/editor/page-editor-chrome/FrameMenu.d.ts +1 -1
  522. package/dist/editor/page-editor-chrome/FrameMenu.js +13 -11
  523. package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
  524. package/dist/editor/page-editor-chrome/FrameMenus.d.ts +1 -1
  525. package/dist/editor/page-editor-chrome/FrameMenus.js +7 -5
  526. package/dist/editor/page-editor-chrome/FrameMenus.js.map +1 -1
  527. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.d.ts +2 -2
  528. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.js +20 -39
  529. package/dist/editor/page-editor-chrome/InlineFieldHistoryButton.js.map +1 -1
  530. package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -1
  531. package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +27 -21
  532. package/dist/editor/page-editor-chrome/LockedFieldIndicator.js.map +1 -1
  533. package/dist/editor/page-editor-chrome/NoLayout.js +5 -3
  534. package/dist/editor/page-editor-chrome/NoLayout.js.map +1 -1
  535. package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +1 -1
  536. package/dist/editor/page-editor-chrome/PageEditorChrome.js +30 -23
  537. package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -1
  538. package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -1
  539. package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +24 -21
  540. package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -1
  541. package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +10 -4
  542. package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
  543. package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +1 -1
  544. package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +11 -10
  545. package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -1
  546. package/dist/editor/page-editor-chrome/SpellCheckHighlightings.d.ts +12 -0
  547. package/dist/editor/page-editor-chrome/SpellCheckHighlightings.js +197 -0
  548. package/dist/editor/page-editor-chrome/SpellCheckHighlightings.js.map +1 -0
  549. package/dist/editor/page-editor-chrome/SuggestionHighlightings.d.ts +1 -1
  550. package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +226 -381
  551. package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -1
  552. package/dist/editor/page-editor-chrome/ValidationRulerMarks.d.ts +11 -0
  553. package/dist/editor/page-editor-chrome/ValidationRulerMarks.js +56 -0
  554. package/dist/editor/page-editor-chrome/ValidationRulerMarks.js.map +1 -0
  555. package/dist/editor/page-editor-chrome/VersionDiffHighlightings.d.ts +1 -1
  556. package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js +11 -8
  557. package/dist/editor/page-editor-chrome/VersionDiffHighlightings.js.map +1 -1
  558. package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.d.ts +15 -2
  559. package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js +70 -9
  560. package/dist/editor/page-editor-chrome/overlay/IframeOverlayProvider.js.map +1 -1
  561. package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.d.ts +44 -0
  562. package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.js +89 -0
  563. package/dist/editor/page-editor-chrome/overlay/feedbackAnchorMeasurements.js.map +1 -0
  564. package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.d.ts +17 -0
  565. package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.js +53 -0
  566. package/dist/editor/page-editor-chrome/overlay/feedbackAnchorStore.js.map +1 -0
  567. package/dist/editor/page-editor-chrome/overlay/geometry.d.ts +15 -0
  568. package/dist/editor/page-editor-chrome/overlay/geometry.js +40 -0
  569. package/dist/editor/page-editor-chrome/overlay/geometry.js.map +1 -1
  570. package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.d.ts +11 -0
  571. package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.js +84 -0
  572. package/dist/editor/page-editor-chrome/overlay/useBridgeTextRangeRequest.js.map +1 -0
  573. package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.d.ts +34 -0
  574. package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.js +229 -0
  575. package/dist/editor/page-editor-chrome/overlay/useCommentAnchorMeasurements.js.map +1 -0
  576. package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.d.ts +9 -0
  577. package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.js +34 -0
  578. package/dist/editor/page-editor-chrome/overlay/useOverlayViewportRight.js.map +1 -0
  579. package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.d.ts +49 -0
  580. package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.js +241 -0
  581. package/dist/editor/page-editor-chrome/overlay/useSuggestionAnchorMeasurements.js.map +1 -0
  582. package/dist/editor/page-editor-chrome/useBridgeInlineEditing.d.ts +7 -0
  583. package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js +63 -5
  584. package/dist/editor/page-editor-chrome/useBridgeInlineEditing.js.map +1 -1
  585. package/dist/editor/page-editor-chrome/useBridgeRichTextFieldOptions.d.ts +12 -0
  586. package/dist/editor/page-editor-chrome/useBridgeRichTextFieldOptions.js +79 -0
  587. package/dist/editor/page-editor-chrome/useBridgeRichTextFieldOptions.js.map +1 -0
  588. package/dist/editor/page-editor-chrome/useComponentDragHandle.js +1 -1
  589. package/dist/editor/page-editor-chrome/useComponentDragHandle.js.map +1 -1
  590. package/dist/editor/page-editor-chrome/useDragInsertionGesture.js +1 -1
  591. package/dist/editor/page-editor-chrome/useDragInsertionGesture.js.map +1 -1
  592. package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.d.ts +1 -1
  593. package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.js +4 -2
  594. package/dist/editor/page-editor-chrome/usePinnedHoveredComponentId.js.map +1 -1
  595. package/dist/editor/page-viewer/CanvasOverviewRuler.d.ts +11 -0
  596. package/dist/editor/page-viewer/CanvasOverviewRuler.js +65 -0
  597. package/dist/editor/page-viewer/CanvasOverviewRuler.js.map +1 -0
  598. package/dist/editor/page-viewer/DeviceToolbar.d.ts +1 -1
  599. package/dist/editor/page-viewer/DeviceToolbar.js +8 -3
  600. package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -1
  601. package/dist/editor/page-viewer/DynamicRenderingsBar.d.ts +23 -0
  602. package/dist/editor/page-viewer/DynamicRenderingsBar.js +28 -0
  603. package/dist/editor/page-viewer/DynamicRenderingsBar.js.map +1 -0
  604. package/dist/editor/page-viewer/DynamicRenderingsStrip.d.ts +18 -0
  605. package/dist/editor/page-viewer/DynamicRenderingsStrip.js +29 -0
  606. package/dist/editor/page-viewer/DynamicRenderingsStrip.js.map +1 -0
  607. package/dist/editor/page-viewer/EditorForm.js +29 -24
  608. package/dist/editor/page-viewer/EditorForm.js.map +1 -1
  609. package/dist/editor/page-viewer/FeedbackMargin.d.ts +57 -0
  610. package/dist/editor/page-viewer/FeedbackMargin.js +378 -0
  611. package/dist/editor/page-viewer/FeedbackMargin.js.map +1 -0
  612. package/dist/editor/page-viewer/FeedbackMarginController.d.ts +76 -0
  613. package/dist/editor/page-viewer/FeedbackMarginController.js +241 -0
  614. package/dist/editor/page-viewer/FeedbackMarginController.js.map +1 -0
  615. package/dist/editor/page-viewer/FeedbackMarginMarker.d.ts +16 -0
  616. package/dist/editor/page-viewer/FeedbackMarginMarker.js +24 -0
  617. package/dist/editor/page-viewer/FeedbackMarginMarker.js.map +1 -0
  618. package/dist/editor/page-viewer/FeedbackMarginResizeHandle.d.ts +23 -0
  619. package/dist/editor/page-viewer/FeedbackMarginResizeHandle.js +105 -0
  620. package/dist/editor/page-viewer/FeedbackMarginResizeHandle.js.map +1 -0
  621. package/dist/editor/page-viewer/InteractivePreviewBar.d.ts +24 -0
  622. package/dist/editor/page-viewer/InteractivePreviewBar.js +31 -0
  623. package/dist/editor/page-viewer/InteractivePreviewBar.js.map +1 -0
  624. package/dist/editor/page-viewer/MiniMap.d.ts +15 -5
  625. package/dist/editor/page-viewer/MiniMap.js +175 -67
  626. package/dist/editor/page-viewer/MiniMap.js.map +1 -1
  627. package/dist/editor/page-viewer/MinimapDropTargets.d.ts +1 -1
  628. package/dist/editor/page-viewer/MinimapDropTargets.js +9 -7
  629. package/dist/editor/page-viewer/MinimapDropTargets.js.map +1 -1
  630. package/dist/editor/page-viewer/MobileCommentsPanel.d.ts +16 -0
  631. package/dist/editor/page-viewer/MobileCommentsPanel.js +112 -0
  632. package/dist/editor/page-viewer/MobileCommentsPanel.js.map +1 -0
  633. package/dist/editor/page-viewer/PageViewer.js +22 -67
  634. package/dist/editor/page-viewer/PageViewer.js.map +1 -1
  635. package/dist/editor/page-viewer/PageViewerFrame.d.ts +1 -0
  636. package/dist/editor/page-viewer/PageViewerFrame.js +631 -229
  637. package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
  638. package/dist/editor/page-viewer/RenderingAiCheck.d.ts +18 -0
  639. package/dist/editor/page-viewer/RenderingAiCheck.js +45 -0
  640. package/dist/editor/page-viewer/RenderingAiCheck.js.map +1 -0
  641. package/dist/editor/page-viewer/RenderingApprovalDialog.d.ts +32 -0
  642. package/dist/editor/page-viewer/RenderingApprovalDialog.js +191 -0
  643. package/dist/editor/page-viewer/RenderingApprovalDialog.js.map +1 -0
  644. package/dist/editor/page-viewer/SealedClientCodePreview.d.ts +17 -0
  645. package/dist/editor/page-viewer/SealedClientCodePreview.js +38 -0
  646. package/dist/editor/page-viewer/SealedClientCodePreview.js.map +1 -0
  647. package/dist/editor/page-viewer/bridgeFieldPatch.d.ts +9 -0
  648. package/dist/editor/page-viewer/bridgeFieldPatch.js +21 -0
  649. package/dist/editor/page-viewer/bridgeFieldPatch.js.map +1 -1
  650. package/dist/editor/page-viewer/bridgeInlineEditSession.js +8 -0
  651. package/dist/editor/page-viewer/bridgeInlineEditSession.js.map +1 -1
  652. package/dist/editor/page-viewer/bridgeKeyboardShortcuts.d.ts +6 -0
  653. package/dist/editor/page-viewer/bridgeKeyboardShortcuts.js +19 -1
  654. package/dist/editor/page-viewer/bridgeKeyboardShortcuts.js.map +1 -1
  655. package/dist/editor/page-viewer/canvasFrameNavigation.d.ts +18 -0
  656. package/dist/editor/page-viewer/canvasFrameNavigation.js +36 -0
  657. package/dist/editor/page-viewer/canvasFrameNavigation.js.map +1 -0
  658. package/dist/editor/page-viewer/canvasLoadSettling.d.ts +42 -0
  659. package/dist/editor/page-viewer/canvasLoadSettling.js +46 -0
  660. package/dist/editor/page-viewer/canvasLoadSettling.js.map +1 -0
  661. package/dist/editor/page-viewer/canvasScrollHandoff.d.ts +34 -0
  662. package/dist/editor/page-viewer/canvasScrollHandoff.js +55 -0
  663. package/dist/editor/page-viewer/canvasScrollHandoff.js.map +1 -0
  664. package/dist/editor/page-viewer/feedbackMarginLayout.d.ts +119 -0
  665. package/dist/editor/page-viewer/feedbackMarginLayout.js +155 -0
  666. package/dist/editor/page-viewer/feedbackMarginLayout.js.map +1 -0
  667. package/dist/editor/page-viewer/feedbackMarginSources.d.ts +36 -0
  668. package/dist/editor/page-viewer/feedbackMarginSources.js +196 -0
  669. package/dist/editor/page-viewer/feedbackMarginSources.js.map +1 -0
  670. package/dist/editor/page-viewer/feedbackMarginWidth.d.ts +43 -0
  671. package/dist/editor/page-viewer/feedbackMarginWidth.js +107 -0
  672. package/dist/editor/page-viewer/feedbackMarginWidth.js.map +1 -0
  673. package/dist/editor/page-viewer/interactivePreview.d.ts +168 -0
  674. package/dist/editor/page-viewer/interactivePreview.js +344 -0
  675. package/dist/editor/page-viewer/interactivePreview.js.map +1 -0
  676. package/dist/editor/page-viewer/minimapViewport.d.ts +2 -0
  677. package/dist/editor/page-viewer/minimapViewport.js +34 -0
  678. package/dist/editor/page-viewer/minimapViewport.js.map +1 -0
  679. package/dist/editor/page-viewer/openPageItems.d.ts +29 -0
  680. package/dist/editor/page-viewer/openPageItems.js +73 -0
  681. package/dist/editor/page-viewer/openPageItems.js.map +1 -0
  682. package/dist/editor/page-viewer/overviewRuler.d.ts +128 -0
  683. package/dist/editor/page-viewer/overviewRuler.js +226 -0
  684. package/dist/editor/page-viewer/overviewRuler.js.map +1 -0
  685. package/dist/editor/page-viewer/pageViewContext.d.ts +99 -37
  686. package/dist/editor/page-viewer/pageViewContext.js +207 -238
  687. package/dist/editor/page-viewer/pageViewContext.js.map +1 -1
  688. package/dist/editor/page-viewer/renderingApproval.d.ts +59 -0
  689. package/dist/editor/page-viewer/renderingApproval.js +186 -0
  690. package/dist/editor/page-viewer/renderingApproval.js.map +1 -0
  691. package/dist/editor/page-viewer/renderingChanges.d.ts +29 -0
  692. package/dist/editor/page-viewer/renderingChanges.js +40 -0
  693. package/dist/editor/page-viewer/renderingChanges.js.map +1 -0
  694. package/dist/editor/page-viewer/scrollIntoViewTextRanges.d.ts +23 -0
  695. package/dist/editor/page-viewer/scrollIntoViewTextRanges.js +26 -0
  696. package/dist/editor/page-viewer/scrollIntoViewTextRanges.js.map +1 -0
  697. package/dist/editor/page-viewer/useInteractivePreview.d.ts +77 -0
  698. package/dist/editor/page-viewer/useInteractivePreview.js +210 -0
  699. package/dist/editor/page-viewer/useInteractivePreview.js.map +1 -0
  700. package/dist/editor/pageModel.d.ts +12 -0
  701. package/dist/editor/personalization/ConditionTreeEditor.js +1 -1
  702. package/dist/editor/personalization/ConditionTreeEditor.js.map +1 -1
  703. package/dist/editor/personalization/PersonalizationPanel.js +1 -1
  704. package/dist/editor/personalization/PersonalizationPanel.js.map +1 -1
  705. package/dist/editor/reviews/CollapsibleText.d.ts +13 -0
  706. package/dist/editor/reviews/CollapsibleText.js +41 -0
  707. package/dist/editor/reviews/CollapsibleText.js.map +1 -0
  708. package/dist/editor/reviews/Comment.d.ts +10 -1
  709. package/dist/editor/reviews/Comment.js +47 -26
  710. package/dist/editor/reviews/Comment.js.map +1 -1
  711. package/dist/editor/reviews/CommentDisplayPopover.js +29 -25
  712. package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
  713. package/dist/editor/reviews/CommentEditor.d.ts +25 -1
  714. package/dist/editor/reviews/CommentEditor.js +158 -47
  715. package/dist/editor/reviews/CommentEditor.js.map +1 -1
  716. package/dist/editor/reviews/CommentImageAttachments.d.ts +12 -0
  717. package/dist/editor/reviews/CommentImageAttachments.js +19 -0
  718. package/dist/editor/reviews/CommentImageAttachments.js.map +1 -0
  719. package/dist/editor/reviews/CommentPopover.d.ts +0 -4
  720. package/dist/editor/reviews/CommentPopover.js +4 -8
  721. package/dist/editor/reviews/CommentPopover.js.map +1 -1
  722. package/dist/editor/reviews/CommentQuote.d.ts +10 -1
  723. package/dist/editor/reviews/CommentQuote.js +15 -10
  724. package/dist/editor/reviews/CommentQuote.js.map +1 -1
  725. package/dist/editor/reviews/CommentTargetOutline.d.ts +13 -0
  726. package/dist/editor/reviews/CommentTargetOutline.js +21 -0
  727. package/dist/editor/reviews/CommentTargetOutline.js.map +1 -0
  728. package/dist/editor/reviews/CommentTargetPickerDomLayer.d.ts +7 -0
  729. package/dist/editor/reviews/CommentTargetPickerDomLayer.js +117 -0
  730. package/dist/editor/reviews/CommentTargetPickerDomLayer.js.map +1 -0
  731. package/dist/editor/reviews/CommentThreadAgentLink.d.ts +6 -1
  732. package/dist/editor/reviews/CommentThreadAgentLink.js +4 -4
  733. package/dist/editor/reviews/CommentThreadAgentLink.js.map +1 -1
  734. package/dist/editor/reviews/CommentThreadCard.d.ts +34 -0
  735. package/dist/editor/reviews/CommentThreadCard.js +156 -0
  736. package/dist/editor/reviews/CommentThreadCard.js.map +1 -0
  737. package/dist/editor/reviews/CommentView.d.ts +7 -1
  738. package/dist/editor/reviews/CommentView.js +24 -6
  739. package/dist/editor/reviews/CommentView.js.map +1 -1
  740. package/dist/editor/reviews/Comments.js +5 -14
  741. package/dist/editor/reviews/Comments.js.map +1 -1
  742. package/dist/editor/reviews/CreateReviewDialog.js +36 -9
  743. package/dist/editor/reviews/CreateReviewDialog.js.map +1 -1
  744. package/dist/editor/reviews/EditReviewSettingsDialog.js +1 -1
  745. package/dist/editor/reviews/EditReviewSettingsDialog.js.map +1 -1
  746. package/dist/editor/reviews/FeedbackCard.d.ts +16 -1
  747. package/dist/editor/reviews/FeedbackCard.js +14 -3
  748. package/dist/editor/reviews/FeedbackCard.js.map +1 -1
  749. package/dist/editor/reviews/FeedbackFilters.d.ts +9 -5
  750. package/dist/editor/reviews/FeedbackFilters.js +15 -36
  751. package/dist/editor/reviews/FeedbackFilters.js.map +1 -1
  752. package/dist/editor/reviews/FeedbackModeIntro.d.ts +7 -1
  753. package/dist/editor/reviews/FeedbackModeIntro.js +11 -6
  754. package/dist/editor/reviews/FeedbackModeIntro.js.map +1 -1
  755. package/dist/editor/reviews/MentionText.d.ts +2 -1
  756. package/dist/editor/reviews/MentionText.js +5 -3
  757. package/dist/editor/reviews/MentionText.js.map +1 -1
  758. package/dist/editor/reviews/MultiReviewManager.js +18 -3
  759. package/dist/editor/reviews/MultiReviewManager.js.map +1 -1
  760. package/dist/editor/reviews/ReviewItemsPanel.js +4 -0
  761. package/dist/editor/reviews/ReviewItemsPanel.js.map +1 -1
  762. package/dist/editor/reviews/SuggestedEdit.d.ts +10 -1
  763. package/dist/editor/reviews/SuggestedEdit.js +77 -10
  764. package/dist/editor/reviews/SuggestedEdit.js.map +1 -1
  765. package/dist/editor/reviews/SuggestionCommentThread.d.ts +5 -1
  766. package/dist/editor/reviews/SuggestionCommentThread.js +48 -17
  767. package/dist/editor/reviews/SuggestionCommentThread.js.map +1 -1
  768. package/dist/editor/reviews/SuggestionThreadCard.d.ts +19 -0
  769. package/dist/editor/reviews/SuggestionThreadCard.js +25 -0
  770. package/dist/editor/reviews/SuggestionThreadCard.js.map +1 -0
  771. package/dist/editor/reviews/addCommentOnTarget.d.ts +22 -0
  772. package/dist/editor/reviews/addCommentOnTarget.js +32 -0
  773. package/dist/editor/reviews/addCommentOnTarget.js.map +1 -0
  774. package/dist/editor/reviews/applySuggestedEditActions.js +7 -1
  775. package/dist/editor/reviews/applySuggestedEditActions.js.map +1 -1
  776. package/dist/editor/reviews/balloonLayout.d.ts +51 -0
  777. package/dist/editor/reviews/balloonLayout.js +101 -0
  778. package/dist/editor/reviews/balloonLayout.js.map +1 -0
  779. package/dist/editor/reviews/commentAgentAttachments.d.ts +5 -0
  780. package/dist/editor/reviews/commentAgentAttachments.js +51 -0
  781. package/dist/editor/reviews/commentAgentAttachments.js.map +1 -0
  782. package/dist/editor/reviews/commentAi.d.ts +4 -2
  783. package/dist/editor/reviews/commentAi.js +19 -12
  784. package/dist/editor/reviews/commentAi.js.map +1 -1
  785. package/dist/editor/reviews/commentImages.d.ts +1 -2
  786. package/dist/editor/reviews/commentImages.js +1 -37
  787. package/dist/editor/reviews/commentImages.js.map +1 -1
  788. package/dist/editor/reviews/commentTargetPicker.d.ts +114 -0
  789. package/dist/editor/reviews/commentTargetPicker.js +153 -0
  790. package/dist/editor/reviews/commentTargetPicker.js.map +1 -0
  791. package/dist/editor/reviews/feedbackAvatar.js +2 -1
  792. package/dist/editor/reviews/feedbackAvatar.js.map +1 -1
  793. package/dist/editor/reviews/feedbackBalloonDate.d.ts +8 -0
  794. package/dist/editor/reviews/feedbackBalloonDate.js +22 -0
  795. package/dist/editor/reviews/feedbackBalloonDate.js.map +1 -0
  796. package/dist/editor/reviews/feedbackDrafts.d.ts +49 -0
  797. package/dist/editor/reviews/feedbackDrafts.js +74 -0
  798. package/dist/editor/reviews/feedbackDrafts.js.map +1 -0
  799. package/dist/editor/reviews/feedbackHoverState.d.ts +18 -0
  800. package/dist/editor/reviews/feedbackHoverState.js +35 -0
  801. package/dist/editor/reviews/feedbackHoverState.js.map +1 -0
  802. package/dist/editor/reviews/feedbackPersonFilter.d.ts +3 -0
  803. package/dist/editor/reviews/feedbackPersonFilter.js +32 -0
  804. package/dist/editor/reviews/feedbackPersonFilter.js.map +1 -0
  805. package/dist/editor/reviews/feedbackSelection.js +7 -3
  806. package/dist/editor/reviews/feedbackSelection.js.map +1 -1
  807. package/dist/editor/reviews/feedbackThreadSelection.d.ts +10 -0
  808. package/dist/editor/reviews/feedbackThreadSelection.js +31 -0
  809. package/dist/editor/reviews/feedbackThreadSelection.js.map +1 -0
  810. package/dist/editor/reviews/feedbackThreads.d.ts +50 -0
  811. package/dist/editor/reviews/feedbackThreads.js +135 -0
  812. package/dist/editor/reviews/feedbackThreads.js.map +1 -0
  813. package/dist/editor/reviews/feedbackWheelForwarding.d.ts +34 -0
  814. package/dist/editor/reviews/feedbackWheelForwarding.js +108 -0
  815. package/dist/editor/reviews/feedbackWheelForwarding.js.map +1 -0
  816. package/dist/editor/reviews/openCommentsFeedback.d.ts +1 -1
  817. package/dist/editor/reviews/openCommentsFeedback.js +2 -1
  818. package/dist/editor/reviews/openCommentsFeedback.js.map +1 -1
  819. package/dist/editor/reviews/pendingReviewSelection.d.ts +13 -0
  820. package/dist/editor/reviews/pendingReviewSelection.js +29 -0
  821. package/dist/editor/reviews/pendingReviewSelection.js.map +1 -0
  822. package/dist/editor/reviews/requestReview.d.ts +27 -0
  823. package/dist/editor/reviews/requestReview.js +36 -0
  824. package/dist/editor/reviews/requestReview.js.map +1 -0
  825. package/dist/editor/reviews/reviewUrlScope.d.ts +23 -0
  826. package/dist/editor/reviews/reviewUrlScope.js +86 -0
  827. package/dist/editor/reviews/reviewUrlScope.js.map +1 -0
  828. package/dist/editor/reviews/scrollWithin.d.ts +29 -0
  829. package/dist/editor/reviews/scrollWithin.js +87 -0
  830. package/dist/editor/reviews/scrollWithin.js.map +1 -0
  831. package/dist/editor/reviews/subtreeFeedback.d.ts +57 -0
  832. package/dist/editor/reviews/subtreeFeedback.js +137 -0
  833. package/dist/editor/reviews/subtreeFeedback.js.map +1 -0
  834. package/dist/editor/reviews/useCommentImagePaste.d.ts +49 -14
  835. package/dist/editor/reviews/useCommentImagePaste.js +165 -62
  836. package/dist/editor/reviews/useCommentImagePaste.js.map +1 -1
  837. package/dist/editor/reviews/useFeedbackThreads.d.ts +35 -0
  838. package/dist/editor/reviews/useFeedbackThreads.js +137 -0
  839. package/dist/editor/reviews/useFeedbackThreads.js.map +1 -0
  840. package/dist/editor/reviews/useMeasuredHeights.d.ts +25 -0
  841. package/dist/editor/reviews/useMeasuredHeights.js +176 -0
  842. package/dist/editor/reviews/useMeasuredHeights.js.map +1 -0
  843. package/dist/editor/reviews/usePendingFeedbackFocus.d.ts +7 -0
  844. package/dist/editor/reviews/usePendingFeedbackFocus.js +42 -0
  845. package/dist/editor/reviews/usePendingFeedbackFocus.js.map +1 -0
  846. package/dist/editor/services/agentService.d.ts +101 -5
  847. package/dist/editor/services/agentService.js +16 -0
  848. package/dist/editor/services/agentService.js.map +1 -1
  849. package/dist/editor/services/agentStatus.d.ts +1 -0
  850. package/dist/editor/services/agentStatus.js +14 -0
  851. package/dist/editor/services/agentStatus.js.map +1 -1
  852. package/dist/editor/services/aiService.d.ts +2 -0
  853. package/dist/editor/services/aiService.js.map +1 -1
  854. package/dist/editor/services/contentService.d.ts +11 -1
  855. package/dist/editor/services/contentService.js +2 -1
  856. package/dist/editor/services/contentService.js.map +1 -1
  857. package/dist/editor/services/editService.d.ts +2 -0
  858. package/dist/editor/services/editService.js.map +1 -1
  859. package/dist/editor/services/indexService.d.ts +1 -0
  860. package/dist/editor/services/indexService.js +4 -0
  861. package/dist/editor/services/indexService.js.map +1 -1
  862. package/dist/editor/services/mcpAccessService.d.ts +93 -0
  863. package/dist/editor/services/mcpAccessService.js +41 -0
  864. package/dist/editor/services/mcpAccessService.js.map +1 -0
  865. package/dist/editor/services/previewTokenService.d.ts +14 -0
  866. package/dist/editor/services/previewTokenService.js +34 -0
  867. package/dist/editor/services/previewTokenService.js.map +1 -0
  868. package/dist/editor/services/renderingsService.d.ts +117 -0
  869. package/dist/editor/services/renderingsService.js +245 -0
  870. package/dist/editor/services/renderingsService.js.map +1 -0
  871. package/dist/editor/services/reviewsService.d.ts +6 -1
  872. package/dist/editor/services/reviewsService.js +14 -6
  873. package/dist/editor/services/reviewsService.js.map +1 -1
  874. package/dist/editor/services/serviceHelper.d.ts +17 -1
  875. package/dist/editor/services/serviceHelper.js +67 -12
  876. package/dist/editor/services/serviceHelper.js.map +1 -1
  877. package/dist/editor/services/spellCheckService.d.ts +13 -0
  878. package/dist/editor/services/spellCheckService.js +33 -0
  879. package/dist/editor/services/spellCheckService.js.map +1 -0
  880. package/dist/editor/services/suggestedEditsService.d.ts +1 -0
  881. package/dist/editor/services/suggestedEditsService.js +7 -0
  882. package/dist/editor/services/suggestedEditsService.js.map +1 -1
  883. package/dist/editor/settings/MigrationJournalCard.js +2 -2
  884. package/dist/editor/settings/MigrationJournalCard.js.map +1 -1
  885. package/dist/editor/settings/StatusSummary.js +5 -2
  886. package/dist/editor/settings/StatusSummary.js.map +1 -1
  887. package/dist/editor/settings/index/CollectionWarningsDisplay.js +1 -1
  888. package/dist/editor/settings/index/CollectionWarningsDisplay.js.map +1 -1
  889. package/dist/editor/settings/index/IndexGenerationsSection.d.ts +4 -5
  890. package/dist/editor/settings/index/IndexGenerationsSection.js +83 -33
  891. package/dist/editor/settings/index/IndexGenerationsSection.js.map +1 -1
  892. package/dist/editor/settings/index/RecentBatchesList.js +2 -1
  893. package/dist/editor/settings/index/RecentBatchesList.js.map +1 -1
  894. package/dist/editor/settings/panels/AgentProfileConfigPanel.js +1 -1
  895. package/dist/editor/settings/panels/AgentProfileConfigPanel.js.map +1 -1
  896. package/dist/editor/settings/panels/AgentToolsPanel.js +1 -1
  897. package/dist/editor/settings/panels/AgentToolsPanel.js.map +1 -1
  898. package/dist/editor/settings/panels/JavaScriptToolAgentPanel.js +1 -1
  899. package/dist/editor/settings/panels/JavaScriptToolAgentPanel.js.map +1 -1
  900. package/dist/editor/settings/panels/McpAccessPanel.d.ts +7 -0
  901. package/dist/editor/settings/panels/McpAccessPanel.js +96 -0
  902. package/dist/editor/settings/panels/McpAccessPanel.js.map +1 -0
  903. package/dist/editor/settings/panels/McpAccessSettingsView.d.ts +8 -0
  904. package/dist/editor/settings/panels/McpAccessSettingsView.js +221 -0
  905. package/dist/editor/settings/panels/McpAccessSettingsView.js.map +1 -0
  906. package/dist/editor/settings/panels/ModelConfigPanel.js +1 -0
  907. package/dist/editor/settings/panels/ModelConfigPanel.js.map +1 -1
  908. package/dist/editor/settings/panels/ModelsPanel.js +60 -6
  909. package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
  910. package/dist/editor/settings/panels/PersistentLogsPanel.js +2 -1
  911. package/dist/editor/settings/panels/PersistentLogsPanel.js.map +1 -1
  912. package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js +1 -1
  913. package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js.map +1 -1
  914. package/dist/editor/settings/panels/ProvidersPanel.js +2 -1
  915. package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
  916. package/dist/editor/settings/panels/SearchConfigPanel.js +6 -5
  917. package/dist/editor/settings/panels/SearchConfigPanel.js.map +1 -1
  918. package/dist/editor/settings/panels/SpellCheckPanel.d.ts +8 -0
  919. package/dist/editor/settings/panels/SpellCheckPanel.js +253 -0
  920. package/dist/editor/settings/panels/SpellCheckPanel.js.map +1 -0
  921. package/dist/editor/settings/panels/StatusPanel.js +5 -6
  922. package/dist/editor/settings/panels/StatusPanel.js.map +1 -1
  923. package/dist/editor/settings/panels/UserPreferencesPanel.js +5 -2
  924. package/dist/editor/settings/panels/UserPreferencesPanel.js.map +1 -1
  925. package/dist/editor/settings/panels/index.d.ts +2 -0
  926. package/dist/editor/settings/panels/index.js +2 -0
  927. package/dist/editor/settings/panels/index.js.map +1 -1
  928. package/dist/editor/sidebar/ComponentPalette.js +7 -3
  929. package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
  930. package/dist/editor/sidebar/ComponentTree.d.ts +1 -1
  931. package/dist/editor/sidebar/ComponentTree.js +37 -58
  932. package/dist/editor/sidebar/ComponentTree.js.map +1 -1
  933. package/dist/editor/sidebar/DictionaryEditor.js +2 -1
  934. package/dist/editor/sidebar/DictionaryEditor.js.map +1 -1
  935. package/dist/editor/sidebar/EditHistory.js +5 -4
  936. package/dist/editor/sidebar/EditHistory.js.map +1 -1
  937. package/dist/editor/sidebar/FeedbackSidebar.d.ts +7 -0
  938. package/dist/editor/sidebar/FeedbackSidebar.js +300 -0
  939. package/dist/editor/sidebar/FeedbackSidebar.js.map +1 -0
  940. package/dist/editor/sidebar/OperationDetailsContent.js +50 -0
  941. package/dist/editor/sidebar/OperationDetailsContent.js.map +1 -1
  942. package/dist/editor/sidebar/OperationItem.js +4 -1
  943. package/dist/editor/sidebar/OperationItem.js.map +1 -1
  944. package/dist/editor/sidebar/Sessions.js +3 -1
  945. package/dist/editor/sidebar/Sessions.js.map +1 -1
  946. package/dist/editor/sidebar/Validation.js +1 -1
  947. package/dist/editor/sidebar/Validation.js.map +1 -1
  948. package/dist/editor/sidebar/Workbox.js +3 -108
  949. package/dist/editor/sidebar/Workbox.js.map +1 -1
  950. package/dist/editor/sidebar/liveComponentThumbnails.d.ts +7 -3
  951. package/dist/editor/sidebar/liveComponentThumbnails.js +26 -16
  952. package/dist/editor/sidebar/liveComponentThumbnails.js.map +1 -1
  953. package/dist/editor/spellcheck/canvasSpellCheckContextMenu.d.ts +30 -0
  954. package/dist/editor/spellcheck/canvasSpellCheckContextMenu.js +69 -0
  955. package/dist/editor/spellcheck/canvasSpellCheckContextMenu.js.map +1 -0
  956. package/dist/editor/spellcheck/htmlSpellDocument.d.ts +60 -0
  957. package/dist/editor/spellcheck/htmlSpellDocument.js +181 -0
  958. package/dist/editor/spellcheck/htmlSpellDocument.js.map +1 -0
  959. package/dist/editor/spellcheck/htmlSpellTokenizer.d.ts +45 -0
  960. package/dist/editor/spellcheck/htmlSpellTokenizer.js +277 -0
  961. package/dist/editor/spellcheck/htmlSpellTokenizer.js.map +1 -0
  962. package/dist/editor/spellcheck/replacementGuard.d.ts +27 -0
  963. package/dist/editor/spellcheck/replacementGuard.js +29 -0
  964. package/dist/editor/spellcheck/replacementGuard.js.map +1 -0
  965. package/dist/editor/spellcheck/spellCheckCanvasStore.d.ts +17 -0
  966. package/dist/editor/spellcheck/spellCheckCanvasStore.js +37 -0
  967. package/dist/editor/spellcheck/spellCheckCanvasStore.js.map +1 -0
  968. package/dist/editor/spellcheck/spellCheckCanvasTargets.d.ts +71 -0
  969. package/dist/editor/spellcheck/spellCheckCanvasTargets.js +126 -0
  970. package/dist/editor/spellcheck/spellCheckCanvasTargets.js.map +1 -0
  971. package/dist/editor/spellcheck/spellCheckClient.d.ts +66 -0
  972. package/dist/editor/spellcheck/spellCheckClient.js +0 -0
  973. package/dist/editor/spellcheck/spellCheckClient.js.map +1 -0
  974. package/dist/editor/spellcheck/spellCheckContextMenu.d.ts +52 -0
  975. package/dist/editor/spellcheck/spellCheckContextMenu.js +120 -0
  976. package/dist/editor/spellcheck/spellCheckContextMenu.js.map +1 -0
  977. package/dist/editor/spellcheck/spellCheckReplace.d.ts +8 -0
  978. package/dist/editor/spellcheck/spellCheckReplace.js +20 -0
  979. package/dist/editor/spellcheck/spellCheckReplace.js.map +1 -0
  980. package/dist/editor/spellcheck/spellCheckStyles.d.ts +11 -0
  981. package/dist/editor/spellcheck/spellCheckStyles.js +12 -0
  982. package/dist/editor/spellcheck/spellCheckStyles.js.map +1 -0
  983. package/dist/editor/spellcheck/spellCheckTypes.d.ts +94 -0
  984. package/dist/editor/spellcheck/spellCheckTypes.js +2 -0
  985. package/dist/editor/spellcheck/spellCheckTypes.js.map +1 -0
  986. package/dist/editor/spellcheck/textMarkHitTest.d.ts +14 -0
  987. package/dist/editor/spellcheck/textMarkHitTest.js +39 -0
  988. package/dist/editor/spellcheck/textMarkHitTest.js.map +1 -0
  989. package/dist/editor/spellcheck/useSpellCheck.d.ts +16 -0
  990. package/dist/editor/spellcheck/useSpellCheck.js +57 -0
  991. package/dist/editor/spellcheck/useSpellCheck.js.map +1 -0
  992. package/dist/editor/ui/DynamicRenderingsPublishWarning.d.ts +14 -0
  993. package/dist/editor/ui/DynamicRenderingsPublishWarning.js +40 -0
  994. package/dist/editor/ui/DynamicRenderingsPublishWarning.js.map +1 -0
  995. package/dist/editor/ui/ItemNameDialogNew.js +11 -2
  996. package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
  997. package/dist/editor/ui/ItemSearch.d.ts +2 -0
  998. package/dist/editor/ui/ItemSearch.js +2 -2
  999. package/dist/editor/ui/ItemSearch.js.map +1 -1
  1000. package/dist/editor/ui/ParheliaMark.d.ts +15 -0
  1001. package/dist/editor/ui/ParheliaMark.js +12 -0
  1002. package/dist/editor/ui/ParheliaMark.js.map +1 -0
  1003. package/dist/editor/ui/PublishDialog.d.ts +2 -0
  1004. package/dist/editor/ui/PublishDialog.js +4 -1
  1005. package/dist/editor/ui/PublishDialog.js.map +1 -1
  1006. package/dist/editor/ui/PublishItemDialog.js +3 -2
  1007. package/dist/editor/ui/PublishItemDialog.js.map +1 -1
  1008. package/dist/editor/ui/PublishReadinessSummary.js +1 -1
  1009. package/dist/editor/ui/PublishReadinessSummary.js.map +1 -1
  1010. package/dist/editor/ui/PublishRestrictionsDialog.d.ts +33 -0
  1011. package/dist/editor/ui/PublishRestrictionsDialog.js +208 -38
  1012. package/dist/editor/ui/PublishRestrictionsDialog.js.map +1 -1
  1013. package/dist/editor/ui/RootItemPicker.d.ts +18 -0
  1014. package/dist/editor/ui/RootItemPicker.js +112 -0
  1015. package/dist/editor/ui/RootItemPicker.js.map +1 -0
  1016. package/dist/editor/ui/WorkboxItemsTable.js +1 -1
  1017. package/dist/editor/ui/WorkboxItemsTable.js.map +1 -1
  1018. package/dist/editor/undoEligibility.d.ts +2 -0
  1019. package/dist/editor/undoEligibility.js +8 -0
  1020. package/dist/editor/undoEligibility.js.map +1 -0
  1021. package/dist/editor/utils/dataTransferImages.d.ts +7 -0
  1022. package/dist/editor/utils/dataTransferImages.js +43 -0
  1023. package/dist/editor/utils/dataTransferImages.js.map +1 -0
  1024. package/dist/editor/utils/itemConverters.js +9 -0
  1025. package/dist/editor/utils/itemConverters.js.map +1 -1
  1026. package/dist/editor/utils/keyboardNavigation.js +54 -4
  1027. package/dist/editor/utils/keyboardNavigation.js.map +1 -1
  1028. package/dist/editor/utils.d.ts +4 -4
  1029. package/dist/editor/utils.js +9 -8
  1030. package/dist/editor/utils.js.map +1 -1
  1031. package/dist/editor/validation/navigateToValidationIssue.d.ts +2 -2
  1032. package/dist/editor/validation/navigateToValidationIssue.js +1 -1
  1033. package/dist/editor/validation/navigateToValidationIssue.js.map +1 -1
  1034. package/dist/editor/validation/validationRulerIssues.d.ts +17 -0
  1035. package/dist/editor/validation/validationRulerIssues.js +44 -0
  1036. package/dist/editor/validation/validationRulerIssues.js.map +1 -0
  1037. package/dist/editor/views/CompareView.js +3 -4
  1038. package/dist/editor/views/CompareView.js.map +1 -1
  1039. package/dist/editor/views/EditorSlot.js +10 -4
  1040. package/dist/editor/views/EditorSlot.js.map +1 -1
  1041. package/dist/editor/views/ItemEditor.d.ts +3 -1
  1042. package/dist/editor/views/ItemEditor.js +43 -38
  1043. package/dist/editor/views/ItemEditor.js.map +1 -1
  1044. package/dist/editor/views/ItemEditorPane.js +3 -3
  1045. package/dist/editor/views/ItemEditorPane.js.map +1 -1
  1046. package/dist/editor/views/SingleEditView.js +10 -32
  1047. package/dist/editor/views/SingleEditView.js.map +1 -1
  1048. package/dist/editor/views/editorSlotContext.js +62 -90
  1049. package/dist/editor/views/editorSlotContext.js.map +1 -1
  1050. package/dist/index.d.ts +11 -5
  1051. package/dist/index.js +9 -4
  1052. package/dist/index.js.map +1 -1
  1053. package/dist/lib/utils.d.ts +5 -0
  1054. package/dist/lib/utils.js +7 -0
  1055. package/dist/lib/utils.js.map +1 -1
  1056. package/dist/licensing/FeatureGate.js +1 -1
  1057. package/dist/licensing/FeatureGate.js.map +1 -1
  1058. package/dist/licensing/LicenseContext.js +31 -17
  1059. package/dist/licensing/LicenseContext.js.map +1 -1
  1060. package/dist/revision.d.ts +2 -2
  1061. package/dist/revision.js +2 -2
  1062. package/dist/setup/services/setupWizardService.d.ts +6 -2
  1063. package/dist/setup/services/setupWizardService.js +10 -0
  1064. package/dist/setup/services/setupWizardService.js.map +1 -1
  1065. package/dist/setup/wizard/steps/AddModelDialog.js +1 -0
  1066. package/dist/setup/wizard/steps/AddModelDialog.js.map +1 -1
  1067. package/dist/setup/wizard/steps/ImportModelDialog.js +2 -1
  1068. package/dist/setup/wizard/steps/ImportModelDialog.js.map +1 -1
  1069. package/dist/splash-screen/ModernSplashScreen.js +8 -6
  1070. package/dist/splash-screen/ModernSplashScreen.js.map +1 -1
  1071. package/dist/splash-screen/RecentPages.js +8 -5
  1072. package/dist/splash-screen/RecentPages.js.map +1 -1
  1073. package/dist/task-board/TaskBoardWorkspace.js +218 -35
  1074. package/dist/task-board/TaskBoardWorkspace.js.map +1 -1
  1075. package/dist/task-board/components/AttentionPromptDialog.d.ts +13 -0
  1076. package/dist/task-board/components/AttentionPromptDialog.js +45 -0
  1077. package/dist/task-board/components/AttentionPromptDialog.js.map +1 -0
  1078. package/dist/task-board/components/GoalDataView.d.ts +22 -1
  1079. package/dist/task-board/components/GoalDataView.js +63 -17
  1080. package/dist/task-board/components/GoalDataView.js.map +1 -1
  1081. package/dist/task-board/components/GoalFindingsTable.d.ts +43 -0
  1082. package/dist/task-board/components/GoalFindingsTable.js +160 -0
  1083. package/dist/task-board/components/GoalFindingsTable.js.map +1 -0
  1084. package/dist/task-board/components/GoalsMatrix.js +33 -6
  1085. package/dist/task-board/components/GoalsMatrix.js.map +1 -1
  1086. package/dist/task-board/components/IssuePanel.d.ts +31 -0
  1087. package/dist/task-board/components/IssuePanel.js +268 -0
  1088. package/dist/task-board/components/IssuePanel.js.map +1 -0
  1089. package/dist/task-board/components/ProjectBudgetBanner.js +1 -1
  1090. package/dist/task-board/components/ProjectBudgetBanner.js.map +1 -1
  1091. package/dist/task-board/components/ProjectGoalsPanel.js +66 -13
  1092. package/dist/task-board/components/ProjectGoalsPanel.js.map +1 -1
  1093. package/dist/task-board/components/SubgoalFindings.d.ts +40 -0
  1094. package/dist/task-board/components/SubgoalFindings.js +88 -0
  1095. package/dist/task-board/components/SubgoalFindings.js.map +1 -0
  1096. package/dist/task-board/components/TaskAgentPanel.d.ts +2 -0
  1097. package/dist/task-board/components/TaskAgentPanel.js +5 -4
  1098. package/dist/task-board/components/TaskAgentPanel.js.map +1 -1
  1099. package/dist/task-board/components/TaskDetailPanel.js +22 -16
  1100. package/dist/task-board/components/TaskDetailPanel.js.map +1 -1
  1101. package/dist/task-board/components/WizardCommunicationCards.js +1 -1
  1102. package/dist/task-board/components/WizardCommunicationCards.js.map +1 -1
  1103. package/dist/task-board/components/WizardCommunicationCenter.d.ts +2 -0
  1104. package/dist/task-board/components/WizardCommunicationCenter.js +5 -3
  1105. package/dist/task-board/components/WizardCommunicationCenter.js.map +1 -1
  1106. package/dist/task-board/components/WizardCommunicationShared.js +2 -1
  1107. package/dist/task-board/components/WizardCommunicationShared.js.map +1 -1
  1108. package/dist/task-board/components/WizardTask.d.ts +2 -0
  1109. package/dist/task-board/components/WizardTask.js +2 -2
  1110. package/dist/task-board/components/WizardTask.js.map +1 -1
  1111. package/dist/task-board/components/WizardTaskDetailsPanel.d.ts +4 -0
  1112. package/dist/task-board/components/WizardTaskDetailsPanel.js +16 -3
  1113. package/dist/task-board/components/WizardTaskDetailsPanel.js.map +1 -1
  1114. package/dist/task-board/services/issueService.d.ts +193 -0
  1115. package/dist/task-board/services/issueService.js +97 -0
  1116. package/dist/task-board/services/issueService.js.map +1 -0
  1117. package/dist/task-board/services/taskService.d.ts +1 -2
  1118. package/dist/task-board/services/taskService.js +0 -3
  1119. package/dist/task-board/services/taskService.js.map +1 -1
  1120. package/dist/task-board/taskBlockers.d.ts +10 -0
  1121. package/dist/task-board/taskBlockers.js +66 -0
  1122. package/dist/task-board/taskBlockers.js.map +1 -0
  1123. package/dist/task-board/types.d.ts +24 -7
  1124. package/dist/task-board/utils/projectDashboardModel.js +14 -0
  1125. package/dist/task-board/utils/projectDashboardModel.js.map +1 -1
  1126. package/dist/task-board/views/DependencyGraphView.d.ts +22 -0
  1127. package/dist/task-board/views/DependencyGraphView.js +111 -14
  1128. package/dist/task-board/views/DependencyGraphView.js.map +1 -1
  1129. package/dist/task-board/views/KanbanView.js +8 -10
  1130. package/dist/task-board/views/KanbanView.js.map +1 -1
  1131. package/dist/task-board/views/ProjectDashboardView.js +5 -13
  1132. package/dist/task-board/views/ProjectDashboardView.js.map +1 -1
  1133. package/dist/tour/Tour.js +4 -1
  1134. package/dist/tour/Tour.js.map +1 -1
  1135. package/dist/tour/sandbox-tour-copy.d.ts +8 -0
  1136. package/dist/tour/sandbox-tour-copy.js +8 -0
  1137. package/dist/tour/sandbox-tour-copy.js.map +1 -1
  1138. package/dist/tour/sandbox-tour.d.ts +3 -0
  1139. package/dist/tour/sandbox-tour.js +107 -3
  1140. package/dist/tour/sandbox-tour.js.map +1 -1
  1141. package/dist/types.d.ts +85 -1
  1142. package/package.json +6 -2
  1143. package/styles.css +74 -3
  1144. package/dist/editor/page-editor-chrome/bridgeLinkValue.d.ts +0 -10
  1145. package/dist/editor/page-editor-chrome/bridgeLinkValue.js +0 -55
  1146. 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 { BRIDGE_DOM_UPDATED_EVENT, MiniMap } from "./MiniMap";
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 { projectBridgeGeometryToScroll } from "../page-editor-chrome/overlay/geometry";
14
- import { CANVAS_REFRESH_COMPLETED_EVENT, DEVICE_CHANGE_EVENT, useViewportChangeSignal, } from "./pageViewContext";
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 documentSize = getBridgeGeometryDocumentSize(geometry);
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
- const textRangeBounds = findBridgeTextRangeDocumentBounds(geometry, target.key);
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.textRanges?.filter((range) => !!range);
314
- if (!textRanges?.length)
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 currentScroll = getIframeWindowScroll(iframe) ??
728
- observedScroll ?? { x: 0, y: 0 };
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
- if (!compareView)
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?.bridgeStructure?.fields.find((candidate) => candidate.elementKey === elementKey);
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
- : fieldsContext?.modifiedFields,
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: pageViewContext.pageItemDescriptor?.id,
1199
- pageItemLanguage: pageViewContext.pageItemDescriptor?.language,
1200
- pageItemVersion: pageViewContext.pageItemDescriptor?.version,
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
- pageViewContext.pageItemDescriptor,
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
- const bridge = bridgeClientRef.current;
1314
- const structureFields = pageViewContext.bridgeStructure?.fields ?? [];
1315
- if (!bridge || structureFields.length === 0)
1412
+ if (!remoteCaretsStore)
1316
1413
  return;
1317
- const patches = buildRemoteCaretFieldPatches({
1318
- remoteCarets: editContext.remoteCarets,
1319
- structureFields,
1320
- activeInlineEdit: activeBridgeInlineEditRef.current,
1321
- });
1322
- // Keep the host informed about the complete live-draft set. Unlike an
1323
- // ordinary field patch, this state survives host-app/React renders: the
1324
- // bridge reapplies these values in its mutation observer before other
1325
- // observers can see stale server markup.
1326
- bridge.sendCommand("syncRemoteFieldDrafts", { drafts: patches });
1327
- for (const patch of patches) {
1328
- const structureField = structureFields.find((field) => field.elementKey === patch.elementKey);
1329
- sendBridgeFieldPatch(bridge, patch, structureField?.textContent);
1330
- }
1331
- }, [
1332
- editContext.remoteCarets,
1333
- pageViewContext.bridgeStructure,
1334
- sendBridgeFieldPatch,
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 = latestBridgeSelectionRef.current;
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 pressed inside the canvas iframe never reach the host window, so
1722
- // the undo/redo commands (which bind those keys) could not fire. The bridge already
1723
- // preventDefaults the keystroke and forwards it here; replay it on `window`, where
1724
- // useGlobalEditorKeyDown listens, so the keyboard and the toolbar drive the same
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 = latestBridgeSelectionRef.current;
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 editor.setFocusedField(field, editor.mode !== "suggestions");
1914
+ await fieldsContextRef.current?.setFocusedField(field, editor.mode !== "suggestions");
1811
1915
  }
1812
1916
  const iframeRect = iframe.getBoundingClientRect();
1813
- const bridgeSelection = latestBridgeSelectionRef.current;
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.bridgeInteraction = effectiveInteraction;
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(pageViewContext.editUrl),
2379
- getUrlOrigin(pageViewContext.previewUrl),
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
- if (pendingRefreshScrollRef.current) {
2450
- restorePendingRefreshScroll(iframe, pendingRefreshScrollRef.current);
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
- pageViewContext.editUrl,
2755
- pageViewContext.previewUrl,
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?.remoteCarets,
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 = pageViewContext.bridgeStructure;
2912
- if (!pageViewContext.bridgeReady || !bridge || !structure?.fields.length) {
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
- modifiedFields: fieldsContext?.modifiedFields,
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
- pageViewContext.bridgeReady,
3012
- pageViewContext.bridgeStructure,
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
- !pageViewContext.editUrl ||
3202
- !pageViewContext.previewUrl)
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
- const urlPath = editContext.mode === "preview"
3205
- ? pageViewContext.previewUrl
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") || pageViewContext.site?.name);
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
- getIframeWindowScroll(iframeRef.current) ??
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 retryTimer = setTimeout(() => {
3375
- runBridgeRefresh();
3376
- }, retryDelayMs);
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 () => clearTimeout(retryTimer);
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
- pageViewContext.editUrl,
3391
- pageViewContext.previewUrl,
3392
- pageViewContext.site?.name,
3393
- pageViewContext.fullscreen,
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
- if (!editContext.scrollIntoView)
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 exactBounds = findScrollIntoViewDocumentBounds(activePageViewContext.bridgeGeometry, scrollTarget, { includeTextRangeFallback: false });
3836
+ const bridgeGeometry = activePageViewContext.getState().bridgeGeometry;
3837
+ const exactBounds = findScrollIntoViewDocumentBounds(bridgeGeometry, scrollTarget, { includeTextRangeFallback: false });
3528
3838
  let bounds = exactBounds;
3529
- bounds ??= findScrollIntoViewDocumentBounds(activePageViewContext.bridgeGeometry, scrollTarget, { includeTextRangeFallback: true });
3839
+ bounds ??= findScrollIntoViewDocumentBounds(bridgeGeometry, scrollTarget, {
3840
+ includeTextRangeFallback: true,
3841
+ });
3530
3842
  if (bounds) {
3531
3843
  scrollBridgeBoundsIntoView(activePageViewContext, bounds, latestBridgeScrollRef.current);
3532
3844
  }
3533
- if (isTextRangeScrollTarget(scrollTarget)) {
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
- pageViewContext.page,
3545
- pageViewContext.bridgeGeometry,
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
- }, [editContext.mode, editContext.readonly, isBridgeInlineEditing]);
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 (!pageViewContext.bridgeReady ||
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
- pageViewContext.bridgeReady,
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
- let geometryTimer = null;
3693
- const sendViewportStateToBridge = (event) => {
3694
- const detail = event.detail;
3695
- const nextZoom = detail?.zoom ?? pageViewContextRef.current?.zoom ?? zoom;
3696
- bridgeClientRef.current?.sendCommand("setZoom", {
3697
- zoom: nextZoom,
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
- if (geometryTimer != null) {
3710
- window.clearTimeout(geometryTimer);
3711
- }
3712
- window.removeEventListener(DEVICE_CHANGE_EVENT, sendViewportStateToBridge);
4045
+ window.clearTimeout(geometryTimer);
3713
4046
  };
3714
- }, [zoom]);
3715
- const shouldRenderMiniMap = !pageViewContext.fullscreen &&
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 - padding - miniMapReservedWidth;
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 (pageViewContext.page?.item && !pageViewContext.page?.item.hasLayout) {
4151
+ if (page?.item && !page.item.hasLayout) {
3763
4152
  return _jsx(NoLayout, {});
3764
4153
  }
3765
- const isResponsiveDevice = pageViewContext.device === "desktop" ||
3766
- pageViewContext.device === "Responsive";
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 deviceWidth = isResponsiveDevice
4157
+ const frameWidth = isResponsiveDevice
3772
4158
  ? compareFrameWidth !== undefined
3773
- ? compareFrameWidth + miniMapReservedWidth + "px"
4159
+ ? compareFrameWidth +
4160
+ miniMapReservedWidth +
4161
+ feedbackMarginReservedWidth +
4162
+ "px"
3774
4163
  : "100%"
3775
4164
  : inCompareMode
3776
- ? (pageViewContext.deviceWidth || 640) + miniMapReservedWidth + "px"
3777
- : (pageViewContext.deviceWidth || 640) +
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
- 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: [!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: {
3782
- width: deviceWidth,
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: deviceHeight,
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
- }, src: iframeSrc, "data-testid": "pageEditoriframe", onLoad: () => {
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
- const loadedSrc = iframe?.src;
3811
- if (iframeSrc && loadedSrc) {
3812
- setLoadedIframeSrc(loadedSrc);
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 && (_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 })] }));
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