@replohq/canopy-sdk 2.6.0 → 3.0.0

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 (387) hide show
  1. package/_vendor/replo-utils/lib/fonts.mjs +1 -0
  2. package/_vendor/replo-utils/lib/geometry.mjs +2 -0
  3. package/_vendor/replo-utils/lib/json.mjs +1 -0
  4. package/_vendor/replo-utils/lib/misc.mjs +1 -0
  5. package/_vendor/replo-utils/lib/posthogReplay.mjs +2 -0
  6. package/_vendor/replo-utils/lib/url.mjs +1 -0
  7. package/_vendor/replo-utils/react/use-iframe-rpc-channel.mjs +1 -1
  8. package/_vendor/schemas/designLibrary.mjs +1 -1
  9. package/_vendor/schemas/iframeRpcChannel.mjs +2 -1
  10. package/_vendor/schemas/loaderKeys.d.ts +1 -1
  11. package/_vendor/schemas/loaderKeys.mjs +103 -23
  12. package/_vendor/schemas/money.mjs +1860 -3
  13. package/_vendor/schemas/pageAnnotations.mjs +1 -1
  14. package/_vendor/schemas/routing/match.mjs +1 -0
  15. package/_vendor/schemas/routing/rules.mjs +2 -1
  16. package/_vendor/schemas/selectMode.d.ts +4 -4
  17. package/_vendor/schemas/selectMode.mjs +1 -0
  18. package/_vendor/schemas/selectModeIframeRpc.d.ts +4 -4
  19. package/_vendor/schemas/selectModeIframeRpc.mjs +1 -0
  20. package/analytics/analytics-provider.d.ts +5 -10
  21. package/analytics/analytics-provider.js +14 -101
  22. package/analytics/analytics-provider.js.map +2 -2
  23. package/analytics/get-analytics-sinks.d.ts +2 -19
  24. package/analytics/get-analytics-sinks.js +9 -46
  25. package/analytics/get-analytics-sinks.js.map +2 -2
  26. package/analytics/hooks/use-product-viewed-analytics.d.ts +2 -6
  27. package/analytics/hooks/use-product-viewed-analytics.js +6 -28
  28. package/analytics/hooks/use-product-viewed-analytics.js.map +2 -2
  29. package/analytics/replo-first-party-pixel.d.ts +3 -12
  30. package/analytics/replo-first-party-pixel.js +8 -24
  31. package/analytics/replo-first-party-pixel.js.map +2 -2
  32. package/analytics/replo-pixel-script.d.ts +4 -10
  33. package/analytics/replo-pixel-script.js +9 -23
  34. package/analytics/replo-pixel-script.js.map +2 -2
  35. package/analytics/sinks/ga4-sink.d.ts +10 -9
  36. package/analytics/sinks/ga4-sink.js +99 -50
  37. package/analytics/sinks/ga4-sink.js.map +2 -2
  38. package/analytics/sinks/meta-sink.d.ts +5 -4
  39. package/analytics/sinks/meta-sink.js +82 -29
  40. package/analytics/sinks/meta-sink.js.map +2 -2
  41. package/analytics/sinks/pinterest-sink.d.ts +7 -6
  42. package/analytics/sinks/pinterest-sink.js +82 -49
  43. package/analytics/sinks/pinterest-sink.js.map +2 -2
  44. package/analytics/sinks/reddit-sink.d.ts +8 -7
  45. package/analytics/sinks/reddit-sink.js +82 -53
  46. package/analytics/sinks/reddit-sink.js.map +2 -2
  47. package/analytics/sinks/replo-sink.d.ts +9 -8
  48. package/analytics/sinks/replo-sink.js +89 -37
  49. package/analytics/sinks/replo-sink.js.map +2 -2
  50. package/analytics/sinks/snapchat-sink.d.ts +6 -5
  51. package/analytics/sinks/snapchat-sink.js +82 -40
  52. package/analytics/sinks/snapchat-sink.js.map +2 -2
  53. package/analytics/sinks/tiktok-sink.d.ts +8 -7
  54. package/analytics/sinks/tiktok-sink.js +82 -52
  55. package/analytics/sinks/tiktok-sink.js.map +2 -2
  56. package/analytics/sinks/window-sink.d.ts +11 -14
  57. package/analytics/sinks/window-sink.js +101 -28
  58. package/analytics/sinks/window-sink.js.map +2 -2
  59. package/analytics/utils/analytics-utils.d.ts +4 -2
  60. package/analytics/utils/analytics-utils.js +19 -123
  61. package/analytics/utils/analytics-utils.js.map +2 -2
  62. package/analytics/utils/navigation-tracker.d.ts +2 -1
  63. package/analytics/utils/navigation-tracker.js +37 -30
  64. package/analytics/utils/navigation-tracker.js.map +2 -2
  65. package/analytics/utils/shopify-funnel-gate.d.ts +2 -7
  66. package/analytics/utils/shopify-funnel-gate.js +8 -15
  67. package/analytics/utils/shopify-funnel-gate.js.map +2 -2
  68. package/cart/buy-now-action.d.ts +2 -9
  69. package/cart/buy-now-action.js +5 -97
  70. package/cart/buy-now-action.js.map +2 -2
  71. package/cart/cart-actions.d.ts +12 -56
  72. package/cart/cart-actions.js +88 -68
  73. package/cart/cart-actions.js.map +2 -2
  74. package/cart/cart-loader.d.ts +3 -9
  75. package/cart/cart-loader.js +14 -6
  76. package/cart/cart-loader.js.map +2 -2
  77. package/cart/cart-provider.d.ts +6 -58
  78. package/cart/cart-provider.js +13 -359
  79. package/cart/cart-provider.js.map +3 -3
  80. package/cart/cart-schema.d.ts +2 -1
  81. package/cart/cart-schema.js +12 -64
  82. package/cart/cart-schema.js.map +2 -2
  83. package/cart/cart-types.d.ts +1 -1
  84. package/cart/cart-types.js +5 -4
  85. package/cart/cart-types.js.map +2 -2
  86. package/cart/gateways/cart-constants.d.ts +1 -0
  87. package/cart/gateways/cart-constants.js.map +2 -2
  88. package/cart/gateways/cart-gateway.d.ts +1 -0
  89. package/cart/gateways/cart-gateway.js +13 -12
  90. package/cart/gateways/cart-gateway.js.map +2 -2
  91. package/cart/gateways/cookie-cart-gateway.d.ts +8 -11
  92. package/cart/gateways/cookie-cart-gateway.js +93 -97
  93. package/cart/gateways/cookie-cart-gateway.js.map +2 -2
  94. package/cart/gateways/default-cart-gateway.d.ts +10 -16
  95. package/cart/gateways/default-cart-gateway.js +13 -23
  96. package/cart/gateways/default-cart-gateway.js.map +2 -2
  97. package/cart/gateways/resolver-cart-gateway.d.ts +1 -0
  98. package/cart/gateways/resolver-cart-gateway.js +13 -102
  99. package/cart/gateways/resolver-cart-gateway.js.map +2 -2
  100. package/cart/gateways/stripe-cart-gateway.d.ts +10 -16
  101. package/cart/gateways/stripe-cart-gateway.js +13 -21
  102. package/cart/gateways/stripe-cart-gateway.js.map +2 -2
  103. package/cart/hooks/use-add-to-cart.d.ts +3 -47
  104. package/cart/hooks/use-add-to-cart.js +10 -115
  105. package/cart/hooks/use-add-to-cart.js.map +2 -2
  106. package/cart/hooks/use-buy-now.d.ts +1 -39
  107. package/cart/hooks/use-buy-now.js +5 -55
  108. package/cart/hooks/use-buy-now.js.map +2 -2
  109. package/cart/utils/cart-utils.d.ts +8 -35
  110. package/cart/utils/cart-utils.js +21 -35
  111. package/cart/utils/cart-utils.js.map +2 -2
  112. package/cart/utils/cookie-cart-persistence.d.ts +16 -41
  113. package/cart/utils/cookie-cart-persistence.js +38 -143
  114. package/cart/utils/cookie-cart-persistence.js.map +2 -2
  115. package/cart/utils/variant-to-cart-line.d.ts +12 -42
  116. package/cart/utils/variant-to-cart-line.js +31 -147
  117. package/cart/utils/variant-to-cart-line.js.map +2 -2
  118. package/chunk-UJCSKKID.mjs +27 -0
  119. package/{chunk-OFU2QEDR.mjs → chunk-ZZPQ3E7S.mjs} +50 -5
  120. package/consent/consent-action.d.ts +2 -1
  121. package/consent/consent-action.js +10 -20
  122. package/consent/consent-action.js.map +2 -2
  123. package/consent/consent-actions.d.ts +2 -13
  124. package/consent/consent-actions.js +9 -29
  125. package/consent/consent-actions.js.map +2 -2
  126. package/consent/consent-store.d.ts +9 -36
  127. package/consent/consent-store.js +12 -182
  128. package/consent/consent-store.js.map +2 -2
  129. package/consent/cookie.d.ts +9 -12
  130. package/consent/cookie.js +32 -64
  131. package/consent/cookie.js.map +2 -2
  132. package/consent/replo-scripts.d.ts +5 -18
  133. package/consent/replo-scripts.js +11 -94
  134. package/consent/replo-scripts.js.map +2 -2
  135. package/consent/script-registration-store.d.ts +6 -2
  136. package/consent/script-registration-store.js +33 -47
  137. package/consent/script-registration-store.js.map +2 -2
  138. package/consent/script-snippets.d.ts +4 -18
  139. package/consent/script-snippets.js +19 -127
  140. package/consent/script-snippets.js.map +2 -2
  141. package/consent/window-api.d.ts +4 -15
  142. package/consent/window-api.js +8 -63
  143. package/consent/window-api.js.map +2 -2
  144. package/editor/ClientErrorBoundary.d.ts +4 -10
  145. package/editor/ClientErrorBoundary.js +7 -55
  146. package/editor/ClientErrorBoundary.js.map +2 -2
  147. package/editor/DocumentReadyBeacon.d.ts +3 -1
  148. package/editor/DocumentReadyBeacon.js +6 -3
  149. package/editor/DocumentReadyBeacon.js.map +2 -2
  150. package/editor/LinkInterceptor.d.ts +1 -0
  151. package/editor/LinkInterceptor.js +6 -121
  152. package/editor/LinkInterceptor.js.map +2 -2
  153. package/editor/NextErrorReporter.d.ts +1 -0
  154. package/editor/NextErrorReporter.js +6 -85
  155. package/editor/NextErrorReporter.js.map +2 -2
  156. package/editor/annotations/AnnotationLayerMount.d.ts +1 -0
  157. package/editor/annotations/AnnotationLayerMount.js +6 -6
  158. package/editor/annotations/AnnotationLayerMount.js.map +2 -2
  159. package/editor/annotations/annotationController.d.ts +1 -0
  160. package/editor/annotations/annotationController.js +6 -378
  161. package/editor/annotations/annotationController.js.map +2 -2
  162. package/editor/annotations/bridgeGate.d.ts +4 -7
  163. package/editor/annotations/bridgeGate.js +13 -15
  164. package/editor/annotations/bridgeGate.js.map +2 -2
  165. package/editor/design-library-preview/DesignLibraryPreview.d.ts +1 -0
  166. package/editor/design-library-preview/DesignLibraryPreview.js +6 -86
  167. package/editor/design-library-preview/DesignLibraryPreview.js.map +2 -2
  168. package/editor/posthog-relay.d.ts +1 -10
  169. package/editor/posthog-relay.js +6 -65
  170. package/editor/posthog-relay.js.map +2 -2
  171. package/editor/select-mode/EditorSelection.d.ts +1 -23
  172. package/editor/select-mode/EditorSelection.js +5 -87
  173. package/editor/select-mode/EditorSelection.js.map +2 -2
  174. package/editor/select-mode/annotationFrames.d.ts +9 -9
  175. package/editor/select-mode/annotationFrames.js +22 -103
  176. package/editor/select-mode/annotationFrames.js.map +2 -2
  177. package/editor/select-mode/descriptor/elementDescriptor.d.ts +6 -21
  178. package/editor/select-mode/descriptor/elementDescriptor.js +19 -192
  179. package/editor/select-mode/descriptor/elementDescriptor.js.map +3 -3
  180. package/editor/select-mode/descriptor/styleExtraction.d.ts +4 -2
  181. package/editor/select-mode/descriptor/styleExtraction.js +11 -262
  182. package/editor/select-mode/descriptor/styleExtraction.js.map +2 -2
  183. package/editor/select-mode/displayModeStore.d.ts +2 -0
  184. package/editor/select-mode/displayModeStore.js +14 -39
  185. package/editor/select-mode/displayModeStore.js.map +2 -2
  186. package/editor/select-mode/fast-refresh-relay.d.ts +2 -1
  187. package/editor/select-mode/fast-refresh-relay.js +7 -28
  188. package/editor/select-mode/fast-refresh-relay.js.map +2 -2
  189. package/editor/select-mode/fiber.d.ts +14 -7
  190. package/editor/select-mode/fiber.js +40 -286
  191. package/editor/select-mode/fiber.js.map +2 -2
  192. package/editor/select-mode/hooks/useCrosshairCursor.d.ts +2 -9
  193. package/editor/select-mode/hooks/useCrosshairCursor.js +7 -15
  194. package/editor/select-mode/hooks/useCrosshairCursor.js.map +2 -2
  195. package/editor/select-mode/hooks/useEditModeStateMachine.d.ts +5 -3
  196. package/editor/select-mode/hooks/useEditModeStateMachine.js +13 -228
  197. package/editor/select-mode/hooks/useEditModeStateMachine.js.map +2 -2
  198. package/editor/select-mode/hooks/useOptimisticOverrides.d.ts +2 -1
  199. package/editor/select-mode/hooks/useOptimisticOverrides.js +6 -277
  200. package/editor/select-mode/hooks/useOptimisticOverrides.js.map +2 -2
  201. package/editor/select-mode/hooks/useParentMessaging.d.ts +2 -20
  202. package/editor/select-mode/hooks/useParentMessaging.js +7 -69
  203. package/editor/select-mode/hooks/useParentMessaging.js.map +2 -2
  204. package/editor/select-mode/hooks/useSelectModeController.d.ts +2 -1
  205. package/editor/select-mode/hooks/useSelectModeController.js +6 -40
  206. package/editor/select-mode/hooks/useSelectModeController.js.map +2 -2
  207. package/editor/select-mode/hooks/useSelectionHover.d.ts +2 -16
  208. package/editor/select-mode/hooks/useSelectionHover.js +7 -105
  209. package/editor/select-mode/hooks/useSelectionHover.js.map +2 -2
  210. package/editor/select-mode/hooks/useSelectionInteractions.d.ts +2 -26
  211. package/editor/select-mode/hooks/useSelectionInteractions.js +7 -348
  212. package/editor/select-mode/hooks/useSelectionInteractions.js.map +2 -2
  213. package/editor/select-mode/hooks/useSelectionScrollSync.d.ts +2 -22
  214. package/editor/select-mode/hooks/useSelectionScrollSync.js +7 -65
  215. package/editor/select-mode/hooks/useSelectionScrollSync.js.map +2 -2
  216. package/editor/select-mode/hooks/useSiblingResolution.d.ts +4 -2
  217. package/editor/select-mode/hooks/useSiblingResolution.js +13 -52
  218. package/editor/select-mode/hooks/useSiblingResolution.js.map +2 -2
  219. package/editor/select-mode/iframeRpcChannel.d.ts +10 -349
  220. package/editor/select-mode/iframeRpcChannel.js +23 -79
  221. package/editor/select-mode/iframeRpcChannel.js.map +2 -2
  222. package/editor/select-mode/inlineTextMarks.d.ts +4 -6
  223. package/editor/select-mode/inlineTextMarks.js +13 -18
  224. package/editor/select-mode/inlineTextMarks.js.map +2 -2
  225. package/editor/select-mode/interactions/selectionGeometry.d.ts +19 -61
  226. package/editor/select-mode/interactions/selectionGeometry.js +57 -165
  227. package/editor/select-mode/interactions/selectionGeometry.js.map +2 -2
  228. package/editor/select-mode/selectModeSession.d.ts +1 -0
  229. package/editor/select-mode/selectModeSession.js +6 -3
  230. package/editor/select-mode/selectModeSession.js.map +2 -2
  231. package/editor/select-mode/selectionFrame.d.ts +9 -60
  232. package/editor/select-mode/selectionFrame.js +28 -116
  233. package/editor/select-mode/selectionFrame.js.map +2 -2
  234. package/editor/select-mode/symbolicate.d.ts +2 -1
  235. package/editor/select-mode/symbolicate.js +7 -195
  236. package/editor/select-mode/symbolicate.js.map +2 -2
  237. package/editor/select-mode/tiptapInlineEditor.d.ts +15 -2
  238. package/editor/select-mode/tiptapInlineEditor.js +6 -114
  239. package/editor/select-mode/tiptapInlineEditor.js.map +2 -2
  240. package/env.d.ts +2 -1
  241. package/env.js +10 -37
  242. package/env.js.map +2 -2
  243. package/gateways/canopy-api.d.ts +15 -12
  244. package/gateways/canopy-api.js +122 -160
  245. package/gateways/canopy-api.js.map +2 -2
  246. package/hooks/use-client-value.d.ts +2 -10
  247. package/hooks/use-client-value.js +10 -7
  248. package/hooks/use-client-value.js.map +2 -2
  249. package/hooks/use-formatted-price.d.ts +1 -14
  250. package/hooks/use-formatted-price.js +6 -14
  251. package/hooks/use-formatted-price.js.map +2 -2
  252. package/lib/canopy-error.d.ts +2 -5
  253. package/lib/canopy-error.js +10 -14
  254. package/lib/canopy-error.js.map +2 -2
  255. package/lib/get-query-client.d.ts +2 -1
  256. package/lib/get-query-client.js +8 -27
  257. package/lib/get-query-client.js.map +2 -2
  258. package/lib/integration-utils.d.ts +1 -0
  259. package/lib/integration-utils.js +9 -3
  260. package/lib/integration-utils.js.map +2 -2
  261. package/lib/shopify-utils.d.ts +2 -10
  262. package/lib/shopify-utils.js +10 -2
  263. package/lib/shopify-utils.js.map +2 -2
  264. package/lib/tombstone.d.ts +21 -0
  265. package/lib/tombstone.js +99 -0
  266. package/lib/tombstone.js.map +7 -0
  267. package/lib/url-utils.d.ts +2 -4
  268. package/lib/url-utils.js +10 -3
  269. package/lib/url-utils.js.map +2 -2
  270. package/loaders/collection-loader.d.ts +3 -2
  271. package/loaders/collection-loader.js +5 -48
  272. package/loaders/collection-loader.js.map +2 -2
  273. package/loaders/collection-products-loader.d.ts +3 -2
  274. package/loaders/collection-products-loader.js +5 -51
  275. package/loaders/collection-products-loader.js.map +2 -2
  276. package/loaders/contentful-entries-loader.d.ts +3 -2
  277. package/loaders/contentful-entries-loader.js +5 -71
  278. package/loaders/contentful-entries-loader.js.map +2 -2
  279. package/loaders/contentful-entry-loader.d.ts +3 -2
  280. package/loaders/contentful-entry-loader.js +5 -53
  281. package/loaders/contentful-entry-loader.js.map +2 -2
  282. package/loaders/invoke-loader-action.d.ts +2 -8
  283. package/loaders/invoke-loader-action.js +13 -8
  284. package/loaders/invoke-loader-action.js.map +2 -2
  285. package/loaders/invoke-loader-server.d.ts +2 -14
  286. package/loaders/invoke-loader-server.js +12 -34
  287. package/loaders/invoke-loader-server.js.map +2 -2
  288. package/loaders/invoke-loader.d.ts +6 -12
  289. package/loaders/invoke-loader.js +27 -29
  290. package/loaders/invoke-loader.js.map +2 -2
  291. package/loaders/levanta-product-loader.d.ts +3 -2
  292. package/loaders/levanta-product-loader.js +5 -46
  293. package/loaders/levanta-product-loader.js.map +2 -2
  294. package/loaders/loader-error-boundary.d.ts +9 -15
  295. package/loaders/loader-error-boundary.js +50 -13
  296. package/loaders/loader-error-boundary.js.map +2 -2
  297. package/loaders/loader-keys.d.ts +4 -12
  298. package/loaders/loader-keys.js +6 -1
  299. package/loaders/loader-keys.js.map +2 -2
  300. package/loaders/loader-schemas.d.ts +142 -61
  301. package/loaders/loader-schemas.js +253 -90
  302. package/loaders/loader-schemas.js.map +2 -2
  303. package/loaders/metaobject-loader.d.ts +3 -2
  304. package/loaders/metaobject-loader.js +5 -47
  305. package/loaders/metaobject-loader.js.map +2 -2
  306. package/loaders/metaobjects-loader.d.ts +3 -2
  307. package/loaders/metaobjects-loader.js +5 -53
  308. package/loaders/metaobjects-loader.js.map +2 -2
  309. package/loaders/okendo-review-aggregate-loader.d.ts +9 -10
  310. package/loaders/okendo-review-aggregate-loader.js +5 -49
  311. package/loaders/okendo-review-aggregate-loader.js.map +2 -2
  312. package/loaders/okendo-reviews-loader.d.ts +8 -16
  313. package/loaders/okendo-reviews-loader.js +5 -47
  314. package/loaders/okendo-reviews-loader.js.map +2 -2
  315. package/loaders/prefetch-loaders.d.ts +4 -26
  316. package/loaders/prefetch-loaders.js +5 -40
  317. package/loaders/prefetch-loaders.js.map +2 -2
  318. package/loaders/preview-placeholder.d.ts +8 -22
  319. package/loaders/preview-placeholder.js +47 -209
  320. package/loaders/preview-placeholder.js.map +2 -2
  321. package/loaders/product-loader-args.d.ts +2 -11
  322. package/loaders/product-loader-args.js +6 -12
  323. package/loaders/product-loader-args.js.map +2 -2
  324. package/loaders/product-loader.d.ts +3 -2
  325. package/loaders/product-loader.js +5 -45
  326. package/loaders/product-loader.js.map +2 -2
  327. package/loaders/rebuy-recommendations-loader.d.ts +8 -157
  328. package/loaders/rebuy-recommendations-loader.js +5 -50
  329. package/loaders/rebuy-recommendations-loader.js.map +2 -2
  330. package/loaders/reviews-io-review-aggregate-loader.d.ts +5 -4
  331. package/loaders/reviews-io-review-aggregate-loader.js +5 -36
  332. package/loaders/reviews-io-review-aggregate-loader.js.map +2 -2
  333. package/loaders/reviews-io-reviews-loader.d.ts +5 -4
  334. package/loaders/reviews-io-reviews-loader.js +5 -58
  335. package/loaders/reviews-io-reviews-loader.js.map +2 -2
  336. package/loaders/smile-earning-rules-loader.d.ts +10 -11
  337. package/loaders/smile-earning-rules-loader.js +5 -37
  338. package/loaders/smile-earning-rules-loader.js.map +2 -2
  339. package/loaders/smile-rewards-loader.d.ts +10 -11
  340. package/loaders/smile-rewards-loader.js +5 -37
  341. package/loaders/smile-rewards-loader.js.map +2 -2
  342. package/loaders/smile-vip-tiers-loader.d.ts +9 -10
  343. package/loaders/smile-vip-tiers-loader.js +5 -36
  344. package/loaders/smile-vip-tiers-loader.js.map +2 -2
  345. package/loaders/statsig-experiment-loader.d.ts +3 -8
  346. package/loaders/statsig-experiment-loader.js +5 -74
  347. package/loaders/statsig-experiment-loader.js.map +2 -2
  348. package/loaders/vendor-loader-keys.d.ts +4 -0
  349. package/loaders/vendor-loader-keys.js +9 -0
  350. package/loaders/vendor-loader-keys.js.map +7 -0
  351. package/loaders/yotpo-review-aggregate-loader.d.ts +5 -4
  352. package/loaders/yotpo-review-aggregate-loader.js +5 -43
  353. package/loaders/yotpo-review-aggregate-loader.js.map +2 -2
  354. package/loaders/yotpo-reviews-loader.d.ts +5 -4
  355. package/loaders/yotpo-reviews-loader.js +5 -58
  356. package/loaders/yotpo-reviews-loader.js.map +2 -2
  357. package/money.d.ts +9 -9
  358. package/money.js +25 -6
  359. package/money.js.map +2 -2
  360. package/next/config.d.ts +3 -1
  361. package/next/config.js +11 -85
  362. package/next/config.js.map +2 -2
  363. package/next/image-loader.d.ts +2 -1
  364. package/next/image-loader.js +7 -47
  365. package/next/image-loader.js.map +2 -2
  366. package/next/open-next.d.ts +4 -2
  367. package/next/open-next.js +6 -19
  368. package/next/open-next.js.map +2 -2
  369. package/orders/order-status-schema.d.ts +28 -13
  370. package/orders/order-status-schema.js +45 -13
  371. package/orders/order-status-schema.js.map +2 -2
  372. package/orders/order-status.d.ts +2 -8
  373. package/orders/order-status.js +6 -36
  374. package/orders/order-status.js.map +2 -2
  375. package/package.json +1 -12
  376. package/providers/query-provider.d.ts +3 -1
  377. package/providers/query-provider.js +10 -6
  378. package/providers/query-provider.js.map +2 -2
  379. package/providers/replo-provider.d.ts +3 -1
  380. package/providers/replo-provider.js +6 -37
  381. package/providers/replo-provider.js.map +2 -2
  382. package/routing/evaluate.d.ts +3 -3
  383. package/routing/evaluate.js +5 -40
  384. package/routing/evaluate.js.map +2 -2
  385. package/routing/rules.d.ts +3 -11
  386. package/routing/rules.js +7 -1
  387. package/routing/rules.js.map +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../editor/LinkInterceptor.tsx"],
4
- "sourcesContent": ["\"use client\";\n\nimport { useEffect } from \"react\";\n\nimport { displayModeStore } from \"./select-mode/displayModeStore\";\n\ntype NavigationNavigateEvent = {\n destination?: { url?: string };\n preventDefault?: () => void;\n};\n\ntype NavigationLike = {\n addEventListener: (\n type: \"navigate\",\n listener: (event: NavigationNavigateEvent) => void,\n ) => void;\n removeEventListener: (\n type: \"navigate\",\n listener: (event: NavigationNavigateEvent) => void,\n ) => void;\n};\n\nfunction blockNavigation(event: MouseEvent) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n}\n\nfunction isNavigationLike(value: unknown): value is NavigationLike {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n return (\n typeof Reflect.get(value, \"addEventListener\") === \"function\" &&\n typeof Reflect.get(value, \"removeEventListener\") === \"function\"\n );\n}\n\nfunction getWindowNavigation() {\n const navigation = Reflect.get(window, \"navigation\");\n return isNavigationLike(navigation) ? navigation : null;\n}\n\nfunction shouldInterceptNavigationForAgentPreview() {\n if (typeof window === \"undefined\") {\n return false;\n }\n\n if (window.parent === window) {\n return false;\n }\n\n return (\n new URLSearchParams(window.location.search).get(\"__reploAgentPreview\") ===\n \"1\"\n );\n}\n\nfunction urlLeavesSandbox(rawUrl: string | URL): boolean | null {\n try {\n const resolved =\n typeof rawUrl === \"string\"\n ? new URL(rawUrl, window.location.href)\n : new URL(rawUrl.href, window.location.href);\n return resolved.origin !== window.location.origin;\n } catch {\n return null;\n }\n}\n\nexport default function LinkInterceptor() {\n // eslint-disable-next-line replo/no-use-effect -- Browser navigation APIs must be patched at client runtime and restored when the interceptor unmounts.\n useEffect(() => {\n if (!shouldInterceptNavigationForAgentPreview()) {\n return;\n }\n\n const originalWindowOpen = window.open;\n const originalPushState = history.pushState;\n const originalReplaceState = history.replaceState;\n const navigation = getWindowNavigation();\n\n window.open = function (\n url?: string | URL,\n target?: string,\n features?: string,\n ) {\n if (url !== undefined && url !== \"\" && urlLeavesSandbox(url) === true) {\n return null;\n }\n\n return originalWindowOpen.call(window, url, target, features);\n };\n\n history.pushState = function (\n state: Parameters<History[\"pushState\"]>[0],\n unused: string,\n url?: string | URL | null,\n ) {\n if (url && urlLeavesSandbox(url) === true) {\n return;\n }\n\n return originalPushState.call(history, state, unused, url);\n };\n\n history.replaceState = function (\n state: Parameters<History[\"replaceState\"]>[0],\n unused: string,\n url?: string | URL | null,\n ) {\n if (url && urlLeavesSandbox(url) === true) {\n return;\n }\n\n return originalReplaceState.call(history, state, unused, url);\n };\n\n const handleNavigate = (event: NavigationNavigateEvent) => {\n const destinationUrl = event.destination?.url;\n if (\n destinationUrl === undefined ||\n destinationUrl === \"\" ||\n urlLeavesSandbox(destinationUrl) !== true\n ) {\n return;\n }\n\n event.preventDefault?.();\n };\n\n const handleClick = (event: MouseEvent) => {\n // While select mode is active a link click must select the element, not\n // navigate. `useSelectionInteractions` prevents the default nav, but this\n // sibling capture listener would still post `replo:navigate` and move the\n // preview off the page \u2014 `stopPropagation` there can't suppress a\n // listener on the same node, so we bail out here explicitly.\n if (displayModeStore.getSnapshot() === \"selection\") {\n return;\n }\n\n const target = event.target;\n\n if (!(target instanceof Element)) {\n return;\n }\n\n const link = target.closest(\"a[href]\");\n\n if (!(link instanceof HTMLAnchorElement)) {\n return;\n }\n\n const href = link.getAttribute(\"href\");\n if (!href) {\n return;\n }\n\n if (href.startsWith(\"#\")) {\n return;\n }\n\n const linkTarget = link.getAttribute(\"target\");\n if (linkTarget && linkTarget !== \"_self\") {\n blockNavigation(event);\n return;\n }\n\n if (urlLeavesSandbox(href) === true) {\n blockNavigation(event);\n return;\n }\n\n event.preventDefault();\n\n let route: string;\n try {\n route = new URL(href, window.location.href).pathname;\n } catch {\n route = href;\n }\n\n window.parent.postMessage(\n {\n type: \"replo:navigate\",\n route,\n },\n \"*\",\n );\n };\n\n navigation?.addEventListener(\"navigate\", handleNavigate);\n document.addEventListener(\"click\", handleClick, true);\n\n return () => {\n window.open = originalWindowOpen;\n history.pushState = originalPushState;\n history.replaceState = originalReplaceState;\n navigation?.removeEventListener(\"navigate\", handleNavigate);\n document.removeEventListener(\"click\", handleClick, true);\n };\n }, []);\n\n return null;\n}\n"],
5
- "mappings": ";AAEA,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAkBjC,SAAS,gBAAgB,OAAmB;AAC1C,QAAM,eAAe;AACrB,QAAM,gBAAgB;AACtB,QAAM,yBAAyB;AACjC;AAEA,SAAS,iBAAiB,OAAyC;AACjE,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,WAAO;AAAA,EACT;AAEA,SACE,OAAO,QAAQ,IAAI,OAAO,kBAAkB,MAAM,cAClD,OAAO,QAAQ,IAAI,OAAO,qBAAqB,MAAM;AAEzD;AAEA,SAAS,sBAAsB;AAC7B,QAAM,aAAa,QAAQ,IAAI,QAAQ,YAAY;AACnD,SAAO,iBAAiB,UAAU,IAAI,aAAa;AACrD;AAEA,SAAS,2CAA2C;AAClD,MAA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\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport default function LinkInterceptor(): null {\n throw canopyTombstoneError({\n symbol: \"LinkInterceptor\",\n subpath: \"editor/LinkInterceptor\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
5
+ "mappings": ";AAEA,SAAS,4BAA4B;AAGtB,SAAR,kBAAyC;AAC9C,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1 +1,2 @@
1
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
1
2
  export declare function NextErrorReporter(): null;
@@ -1,90 +1,11 @@
1
1
  "use client";
2
- import * as React from "react";
3
- const RED_CHROME_SELECTOR = '[data-next-badge][data-error="true"], [data-nextjs-dialog]';
4
- const BLOCKING_ERROR_SELECTOR = "[data-nextjs-dialog]";
5
- const STATUS_LATCH_MS = 500;
2
+ import { canopyTombstoneError } from "../lib/tombstone";
6
3
  function NextErrorReporter() {
7
- React.useEffect(() => {
8
- let lastStatus = null;
9
- let shadowObserver = null;
10
- let observedRoot = null;
11
- let pendingPost = null;
12
- const postNow = (status) => {
13
- if (status === lastStatus) {
14
- return;
15
- }
16
- lastStatus = status;
17
- window.parent.postMessage(
18
- {
19
- type: "replo:preview:status",
20
- status,
21
- route: window.location.pathname
22
- },
23
- "*"
24
- );
25
- };
26
- const post = (status) => {
27
- if (pendingPost) {
28
- if (pendingPost.status === status) {
29
- return;
30
- }
31
- window.clearTimeout(pendingPost.timeoutId);
32
- pendingPost = null;
33
- }
34
- if (status === lastStatus) {
35
- return;
36
- }
37
- if (lastStatus === null && status === "ok") {
38
- postNow("ok");
39
- return;
40
- }
41
- const timeoutId = window.setTimeout(() => {
42
- pendingPost = null;
43
- postNow(status);
44
- }, STATUS_LATCH_MS);
45
- pendingPost = { status, timeoutId };
46
- };
47
- const syncOverlayState = () => {
48
- const portal = document.getElementsByTagName("nextjs-portal")[0];
49
- if (!(portal instanceof HTMLElement)) {
50
- post("ok");
51
- return;
52
- }
53
- const root = portal.shadowRoot;
54
- if (root && root !== observedRoot) {
55
- shadowObserver?.disconnect();
56
- shadowObserver = new MutationObserver(syncOverlayState);
57
- shadowObserver.observe(root, {
58
- childList: true,
59
- subtree: true,
60
- attributes: true,
61
- attributeFilter: ["data-error"]
62
- });
63
- observedRoot = root;
64
- }
65
- portal.style.display = portal.shadowRoot?.querySelector(
66
- RED_CHROME_SELECTOR
67
- ) ? "none" : "";
68
- const hasBlockingError = Boolean(
69
- portal.shadowRoot?.querySelector(BLOCKING_ERROR_SELECTOR)
70
- );
71
- post(hasBlockingError ? "error" : "ok");
72
- };
73
- const lightObserver = new MutationObserver(syncOverlayState);
74
- lightObserver.observe(document.documentElement, {
75
- childList: true,
76
- subtree: true
77
- });
78
- syncOverlayState();
79
- return () => {
80
- lightObserver.disconnect();
81
- shadowObserver?.disconnect();
82
- if (pendingPost) {
83
- window.clearTimeout(pendingPost.timeoutId);
84
- }
85
- };
86
- }, []);
87
- return null;
4
+ throw canopyTombstoneError({
5
+ symbol: "NextErrorReporter",
6
+ subpath: "editor/NextErrorReporter",
7
+ replacement: { kind: "sandbox-runtime" }
8
+ });
88
9
  }
89
10
  export {
90
11
  NextErrorReporter
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../editor/NextErrorReporter.tsx"],
4
- "sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\n\n/**\n * NOTE (Max, 2026-06-10): This component sends post messages to its embedder (website-builder miniapp)\n * so that it can render a loading / error UI if there's an error on this page.\n *\n * Ideally, we wouldn't need any update to canopy-sdk to achieve this: the miniapp would just read the\n * iframe's content and detect whenever there's a nextjs error overlay.\n * But the preview runs cross-origin from the editor, so the editor can't read the iframe's\n * DOM (browser security).\n *\n * This component has observers that detect when the nextjs error overlay appears or\n * disappears, and sends a post message with a status:\n * - `status`: \"error\" while Next's dev overlay opens its blocking error dialog\n * (a real page break \u2014 see the selectors below for why the badge's issue\n * count is deliberately NOT used: it also counts recovered loader misses)\n * - `status`: \"ok\" otherwise. Cleared by Fast Refresh on a fix, so it's also the\n * recovery signal (agent fixed the error, so it's the error -> ok transition)\n *\n * It also hides Next's dev error overlay (`<nextjs-portal>`) at the source the\n * instant an error appears, so the red bubble never paints \u2014 the MutationObserver\n * callback runs as a microtask before paint. `data-error` stays queryable while\n * hidden, so detection is unaffected;\n *\n * The overlay lives in `<nextjs-portal>`'s shadow root, which Next can recreate,\n * so we re-attach the shadow observer whenever it hands us a new root. No polling.\n *\n * This must be mounted OUTSIDE the error boundary (see ReploProvider) so it keeps\n * reporting while the boundary is caught (and showing its neutral cover).\n *\n * I'm unsatisfied with this approach: observing for the nextjs-portal is brittle and ugly.\n * Ideally, the ClientErrorBoundary, which hooks into the render cycle, in componentDidCatch, would\n * just report a post message to the miniapp. I prototyped that, the error detection works\n * great (ok -> error transition).\n * But the error -> ok transition doesn't work for Server components (it only does for Client\n * components). Here's a slack thread with me <> Gabe on it:\n * https://replohq.slack.com/archives/C03AACVP08Y/p1781154057832689?thread_ts=1781029224.564489&cid=C03AACVP08Y.\n */\n// NOTE (Max, 2026-08-04): <nextjs-portal> surfaces two very different things,\n// and only one of them means the page is actually broken:\n// - the dev-tools badge (`[data-next-badge][data-error=\"true\"]`) lights for\n// EVERY collected issue, including a server-side loader error that React\n// already recovered from by streaming the LoaderErrorBoundary fallback. That\n// is a graceful, recoverable miss (product unpublished, deleted collection,\n// \u2026) \u2014 the page renders fine \u2014 and it must NOT be reported as a page error.\n// - the error overlay dialog (`[data-nextjs-dialog]`) only mounts when Next\n// auto-opens the overlay for a genuinely blocking error: the app shell's\n// error boundary catching an uncaught render crash, an unrecoverable SSR\n// error (missing root tags), or a build error. Next never auto-opens the\n// dialog for a recovered error. Verified against next@16.1.7 (the version\n// canopy-sdk and most templates pin) and next@15.3.8: the sole auto-open\n// is AppDevOverlayErrorBoundary's componentDidCatch -> openErrorOverlay,\n// i.e. the shell boundary, which a nested LoaderErrorBoundary never reaches\n// (a caught loader miss only increments the badge count). The badge count\n// opens the dialog only on an explicit user click.\n// So the open dialog \u2014 not the badge's issue count \u2014 is the fatal-vs-recoverable\n// discriminator. Keying off the badge reported recoverable loader misses as\n// full-page errors, blanking a preview that had actually rendered its fallback.\n//\n// We still *hide* the whole portal whenever Next paints red chrome (the errored\n// badge OR the dialog) so no dev overlay bleeds into the preview \u2014 a recovered\n// loader miss shouldn't flash a red dot either. Only the blocking dialog is\n// reported upward as a page error.\nconst RED_CHROME_SELECTOR =\n '[data-next-badge][data-error=\"true\"], [data-nextjs-dialog]';\nconst BLOCKING_ERROR_SELECTOR = \"[data-nextjs-dialog]\";\n\n// HMR portal churn flips the overlay for milliseconds in both directions; only a state that persists this long is real.\nconst STATUS_LATCH_MS = 500;\n\ntype PreviewStatus = \"ok\" | \"error\";\n\nexport function NextErrorReporter() {\n // eslint-disable-next-line replo/no-use-effect -- Observes Next's dev error overlay (a shadow-DOM node outside React's tree) and relays its state to the cross-origin embedder. No React alternative applies.\n React.useEffect(() => {\n let lastStatus: PreviewStatus | null = null;\n let shadowObserver: MutationObserver | null = null;\n let observedRoot: ShadowRoot | null = null;\n let pendingPost: { status: PreviewStatus; timeoutId: number } | null = null;\n\n const postNow = (status: PreviewStatus) => {\n if (status === lastStatus) {\n return;\n }\n lastStatus = status;\n window.parent.postMessage(\n {\n type: \"replo:preview:status\",\n status,\n route: window.location.pathname,\n },\n \"*\",\n );\n };\n\n // Latch every transition (the opposite observation cancels a pending one) \u2014 a false error <-> ok flip makes the editor reload the preview. Only the initial \"ok\" posts immediately, as the readiness signal.\n const post = (status: PreviewStatus) => {\n if (pendingPost) {\n if (pendingPost.status === status) {\n return;\n }\n window.clearTimeout(pendingPost.timeoutId);\n pendingPost = null;\n }\n if (status === lastStatus) {\n return;\n }\n if (lastStatus === null && status === \"ok\") {\n postNow(\"ok\");\n return;\n }\n const timeoutId = window.setTimeout(() => {\n pendingPost = null;\n postNow(status);\n }, STATUS_LATCH_MS);\n pendingPost = { status, timeoutId };\n };\n\n // NOTE (Max, 2026-06-10): Reads the dev overlay's current error state and\n // propagates it \u2014 re-attach the shadow observer to the live root, hide the\n // portal while erroring, and post ok/error up to the editor. Runs on init and\n // on every observed DOM mutation.\n const syncOverlayState = () => {\n const portal = document.getElementsByTagName(\"nextjs-portal\")[0];\n if (!(portal instanceof HTMLElement)) {\n post(\"ok\");\n return;\n }\n // NOTE (Max, 2026-06-10): Re-attach whenever Next hands us a fresh shadow\n // root, else we'd keep watching a detached one after the overlay is\n // recreated.\n const root = portal.shadowRoot;\n if (root && root !== observedRoot) {\n shadowObserver?.disconnect();\n shadowObserver = new MutationObserver(syncOverlayState);\n shadowObserver.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"data-error\"],\n });\n observedRoot = root;\n }\n // NOTE (Max, 2026-06-10): Hide the dev overlay at the source so the red\n // bubble never paints \u2014 for any red chrome, including a recovered miss's\n // errored badge.\n portal.style.display = portal.shadowRoot?.querySelector(\n RED_CHROME_SELECTOR,\n )\n ? \"none\"\n : \"\";\n // Only the blocking overlay dialog means the page actually broke; the\n // badge's issue count also covers recovered loader misses (see selectors).\n const hasBlockingError = Boolean(\n portal.shadowRoot?.querySelector(BLOCKING_ERROR_SELECTOR),\n );\n post(hasBlockingError ? \"error\" : \"ok\");\n };\n\n // NOTE (Max, 2026-06-10): Catches the portal being added/removed in the light\n // DOM; the re-attached shadow observer catches in-overlay changes.\n const lightObserver = new MutationObserver(syncOverlayState);\n lightObserver.observe(document.documentElement, {\n childList: true,\n subtree: true,\n });\n syncOverlayState();\n\n return () => {\n lightObserver.disconnect();\n shadowObserver?.disconnect();\n if (pendingPost) {\n window.clearTimeout(pendingPost.timeoutId);\n }\n };\n }, []);\n\n return null;\n}\n"],
5
- "mappings": ";AAEA,YAAY,WAAW;AA+DvB,MAAM,sBACJ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Y;AAAA,QACxC;AAAA,MACF,IACI,SACA;AAGJ,YAAM,mBAAmB;AAAA,QACvB,OAAO,YAAY,cAAc,uBAAuB;AAAA,MAC1D;AACA,WAAK,mBAAmB,UAAU,IAAI;AAAA,IACxC;AAIA,UAAM,gBAAgB,IAAI,iBAAiB,gBAAgB;AAC3D,kBAAc,QAAQ,SAAS,iBAAiB;AAAA,MAC9C,WAAW;AAAA,MACX,SAAS;AAAA,IACX,CAAC;AACD,qBAAiB;AAEjB,WAAO,MAAM;AACX,oBAAc,WAAW;AACzB,sBAAgB,WAAW;AAC3B,UAAI,aAAa;AACf,eAAO,aAAa,YAAY,SAAS;AAAA,MAC3C;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;",
4
+ "sourcesContent": ["\"use client\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function NextErrorReporter(): null {\n throw canopyTombstoneError({\n symbol: \"NextErrorReporter\",\n subpath: \"editor/NextErrorReporter\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
5
+ "mappings": ";AAEA,SAAS,4BAA4B;AAG9B,SAAS,oBAA0B;AACxC,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1 +1,2 @@
1
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
1
2
  export declare function AnnotationLayerMount(): null;
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- if (typeof window !== "undefined") {
3
- void import("./annotationController").then((module) => {
4
- module.initAnnotationLayer();
5
- });
6
- }
2
+ import { canopyTombstoneError } from "../../lib/tombstone";
7
3
  function AnnotationLayerMount() {
8
- return null;
4
+ throw canopyTombstoneError({
5
+ symbol: "AnnotationLayerMount",
6
+ subpath: "editor/annotations/AnnotationLayerMount",
7
+ replacement: { kind: "sandbox-runtime" }
8
+ });
9
9
  }
10
10
  export {
11
11
  AnnotationLayerMount
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../editor/annotations/AnnotationLayerMount.tsx"],
4
- "sourcesContent": ["\"use client\";\n\n/**\n * Boots the vanilla annotation controller inside preview iframes. The chunk\n * loads (and this module-scope boot runs) only when the provider actually\n * renders the element, which it folds away on a NODE_ENV literal \u2014 so\n * annotation code never ships to published storefronts.\n */\nif (typeof window !== \"undefined\") {\n void import(\"./annotationController\").then((module) => {\n module.initAnnotationLayer();\n });\n}\n\nexport function AnnotationLayerMount() {\n return null;\n}\n"],
5
- "mappings": ";AAQA,IAAI,OAAO,WAAW,aAAa;AACjC,OAAK,OAAO,wBAAwB,EAAE,KAAK,CAAC,WAAW;AACrD,WAAO,oBAAoB;AAAA,EAC7B,CAAC;AACH;AAEO,SAAS,uBAAuB;AACrC,SAAO;AACT;",
4
+ "sourcesContent": ["\"use client\";\n\nimport { canopyTombstoneError } from \"../../lib/tombstone\";\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function AnnotationLayerMount(): null {\n throw canopyTombstoneError({\n symbol: \"AnnotationLayerMount\",\n subpath: \"editor/annotations/AnnotationLayerMount\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
5
+ "mappings": ";AAEA,SAAS,4BAA4B;AAG9B,SAAS,uBAA6B;AAC3C,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1 +1,2 @@
1
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
1
2
  export declare function initAnnotationLayer(): void;
@@ -1,382 +1,10 @@
1
- import { exhaustiveSwitch } from "../../_vendor/replo-utils/lib/misc.mjs";
2
- import {
3
- PAGE_ANNOTATIONS_PROTOCOL_VERSION,
4
- pageAnnotationsParentMessageSchema
5
- } from "../../_vendor/schemas/pageAnnotations.mjs";
6
- import {
7
- ANNOTATION_CONTAINER_ID,
8
- clearAnnotationFrames,
9
- getAnnotationBadgeViewportRect,
10
- setActiveAnnotationBadge,
11
- showAnnotationFrames
12
- } from "../select-mode/annotationFrames";
13
- import { getDocumentScrollOffset } from "../select-mode/interactions/selectionGeometry";
14
- import { isAllowedEditorMessage, isAllowedEditorOrigin } from "./bridgeGate";
15
- const CLUSTER_DISTANCE_PX = 24;
16
- const CLUSTER_FAN_RADIUS_PX = 30;
17
- const REMEASURE_DEBOUNCE_MS = 250;
18
- const PAGE_TOP_STACK_X_PX = 20;
19
- const PAGE_TOP_STACK_Y_PX = 20;
20
- const PAGE_TOP_STACK_GAP_PX = 36;
21
- const COLOR_HEX = {
22
- red: "#ef196e",
23
- purple: "#8b32a8",
24
- amber: "#274ae2"
25
- };
26
- const COLOR_SEVERITY = [
27
- "red",
28
- "purple",
29
- "amber"
30
- ];
31
- let isInitialized = false;
32
- let editorOrigin = null;
33
- let markers = [];
34
- let setId = null;
35
- let expandedClusterId = null;
36
- let activeMarkerId = null;
37
- let remeasureFrameId = null;
38
- let remeasureDebounceId = null;
39
- let activeRectFrameId = null;
40
- let observersActive = false;
41
- let lastRenderSignature = null;
42
- let resizeObserver = null;
43
- let mutationObserver = null;
44
- function postToEditor(message) {
45
- if (editorOrigin === null) {
46
- return;
47
- }
48
- window.parent.postMessage(message, editorOrigin);
49
- }
50
- function hasFixedAncestor(element) {
51
- let current = element;
52
- while (current !== null && current !== document.documentElement) {
53
- const position = getComputedStyle(current).position;
54
- if (position === "fixed" || position === "sticky") {
55
- return true;
56
- }
57
- current = current.parentElement;
58
- }
59
- return false;
60
- }
61
- function resolveMarkers() {
62
- const resolved = [];
63
- const unresolvedIds = [];
64
- let pageTopSlot = 0;
65
- for (const marker of markers) {
66
- if (marker.placement === "pageTop") {
67
- resolved.push({
68
- marker,
69
- element: null,
70
- isFixed: false,
71
- rect: {
72
- x: PAGE_TOP_STACK_X_PX + pageTopSlot * PAGE_TOP_STACK_GAP_PX,
73
- y: PAGE_TOP_STACK_Y_PX,
74
- width: 0,
75
- height: 0
76
- },
77
- // The editor owns numbering; rendering the wire number keeps dots in sync with the panel.
78
- displayNumber: marker.number
79
- });
80
- pageTopSlot += 1;
81
- continue;
82
- }
83
- let element = null;
84
- try {
85
- element = document.querySelector(marker.selector);
86
- } catch {
87
- }
88
- const domRect = element?.getBoundingClientRect();
89
- if (!element || !domRect || domRect.width === 0 && domRect.height === 0) {
90
- unresolvedIds.push(marker.id);
91
- continue;
92
- }
93
- const isFixed = hasFixedAncestor(element);
94
- const scrollOffset = getDocumentScrollOffset();
95
- resolved.push({
96
- marker,
97
- element,
98
- isFixed,
99
- // Fixed frames use viewport coords; absolute frames use page coords.
100
- rect: {
101
- x: domRect.x + (isFixed ? 0 : scrollOffset.left),
102
- y: domRect.y + (isFixed ? 0 : scrollOffset.top),
103
- width: domRect.width,
104
- height: domRect.height
105
- },
106
- displayNumber: marker.number
107
- });
108
- }
109
- return { resolved, unresolvedIds };
110
- }
111
- function clusterResolvedMarkers(resolved) {
112
- const clusters = [];
113
- for (const entry of resolved) {
114
- const centerX = entry.rect.x + entry.rect.width / 2;
115
- const centerY = entry.rect.y;
116
- const host = clusters.find((cluster) => {
117
- return cluster.isFixed === entry.isFixed && Math.hypot(cluster.centerX - centerX, cluster.centerY - centerY) < CLUSTER_DISTANCE_PX;
118
- });
119
- if (host) {
120
- host.members.push(entry);
121
- } else {
122
- clusters.push({
123
- id: entry.marker.id,
124
- centerX,
125
- centerY,
126
- isFixed: entry.isFixed,
127
- members: [entry]
128
- });
129
- }
130
- }
131
- return clusters;
132
- }
133
- function getMostSevereColorHex(members) {
134
- const color = COLOR_SEVERITY.find((candidate) => {
135
- return members.some((member) => member.marker.color === candidate);
136
- }) ?? "amber";
137
- return COLOR_HEX[color];
138
- }
139
- function activateMarker(id) {
140
- activeMarkerId = id;
141
- const viewportRect = getAnnotationBadgeViewportRect(id);
142
- if (viewportRect) {
143
- postToEditor({ type: "replo:annotations:clicked", id, viewportRect });
144
- }
145
- setActiveAnnotationBadge(id);
146
- }
147
- function buildMemberSpec({
148
- member,
149
- badgeCenter
150
- }) {
151
- const marker = member.marker;
152
- return {
153
- id: marker.id,
154
- pageRect: member.rect,
155
- badgeCenter,
156
- positioning: member.isFixed ? "fixed" : "absolute",
157
- colorHex: COLOR_HEX[marker.color],
158
- badgeLabel: String(member.displayNumber),
159
- badgeAriaLabel: `Page issue ${member.displayNumber}`,
160
- isActive: activeMarkerId === marker.id,
161
- onBadgeClick: () => activateMarker(marker.id)
162
- };
163
- }
164
- function buildClusterSpecs(cluster) {
165
- const [only] = cluster.members;
166
- if (cluster.members.length === 1 && only) {
167
- return [
168
- buildMemberSpec({
169
- member: only,
170
- badgeCenter: { x: cluster.centerX, y: cluster.centerY }
171
- })
172
- ];
173
- }
174
- const hub = {
175
- x: cluster.centerX,
176
- y: cluster.centerY,
177
- width: 0,
178
- height: 0
179
- };
180
- if (expandedClusterId !== cluster.id) {
181
- return [
182
- {
183
- id: `cluster:${cluster.id}`,
184
- pageRect: hub,
185
- badgeCenter: { x: cluster.centerX, y: cluster.centerY },
186
- positioning: cluster.isFixed ? "fixed" : "absolute",
187
- colorHex: getMostSevereColorHex(cluster.members),
188
- badgeLabel: String(cluster.members.length),
189
- badgeAriaLabel: `${cluster.members.length} page issues near this element`,
190
- isActive: false,
191
- onBadgeClick: () => {
192
- expandedClusterId = cluster.id;
193
- render();
194
- }
195
- }
196
- ];
197
- }
198
- const memberSpecs = cluster.members.map((member, index) => {
199
- const angle = index / cluster.members.length * 2 * Math.PI - Math.PI / 2;
200
- return buildMemberSpec({
201
- member,
202
- badgeCenter: {
203
- x: cluster.centerX + Math.cos(angle) * CLUSTER_FAN_RADIUS_PX,
204
- y: cluster.centerY + Math.sin(angle) * CLUSTER_FAN_RADIUS_PX
205
- }
206
- });
207
- });
208
- return [
209
- {
210
- id: `cluster:${cluster.id}`,
211
- pageRect: hub,
212
- badgeCenter: { x: cluster.centerX, y: cluster.centerY },
213
- positioning: cluster.isFixed ? "fixed" : "absolute",
214
- colorHex: "#94a3b8",
215
- badgeLabel: "\xD7",
216
- badgeAriaLabel: "Collapse issue cluster",
217
- isActive: false,
218
- onBadgeClick: () => {
219
- expandedClusterId = null;
220
- render();
221
- }
222
- },
223
- ...memberSpecs
224
- ];
225
- }
226
- function render() {
227
- if (markers.length === 0) {
228
- lastRenderSignature = null;
229
- clearAnnotationFrames();
230
- syncObservers();
231
- return;
232
- }
233
- const { resolved, unresolvedIds } = resolveMarkers();
234
- if (activeMarkerId !== null && unresolvedIds.includes(activeMarkerId)) {
235
- activeMarkerId = null;
236
- }
237
- const signature = [
238
- resolved.map((entry) => {
239
- return `${entry.marker.id}:${Math.round(entry.rect.x)},${Math.round(entry.rect.y)}`;
240
- }).join("|"),
241
- `active:${activeMarkerId ?? ""}`,
242
- `expanded:${expandedClusterId ?? ""}`,
243
- `unresolved:${unresolvedIds.join(",")}`
244
- ].join("#");
245
- if (signature === lastRenderSignature) {
246
- return;
247
- }
248
- lastRenderSignature = signature;
249
- const frames = clusterResolvedMarkers(resolved).flatMap((cluster) => {
250
- return buildClusterSpecs(cluster);
251
- });
252
- showAnnotationFrames({ frames });
253
- if (setId !== null) {
254
- postToEditor({
255
- type: "replo:annotations:unresolved",
256
- setId,
257
- ids: unresolvedIds
258
- });
259
- }
260
- syncObservers();
261
- }
262
- function scheduleRemeasure() {
263
- remeasureFrameId ??= requestAnimationFrame(() => {
264
- remeasureFrameId = null;
265
- render();
266
- });
267
- }
268
- function scheduleDebouncedRemeasure() {
269
- if (remeasureDebounceId !== null) {
270
- clearTimeout(remeasureDebounceId);
271
- }
272
- remeasureDebounceId = setTimeout(scheduleRemeasure, REMEASURE_DEBOUNCE_MS);
273
- }
274
- function handleScroll(event) {
275
- if (event.target !== document) {
276
- scheduleRemeasure();
277
- }
278
- if (activeMarkerId !== null) {
279
- const id = activeMarkerId;
280
- activeRectFrameId ??= requestAnimationFrame(() => {
281
- activeRectFrameId = null;
282
- const viewportRect = getAnnotationBadgeViewportRect(id);
283
- if (viewportRect) {
284
- postToEditor({
285
- type: "replo:annotations:activeRect",
286
- id,
287
- viewportRect
288
- });
289
- }
290
- });
291
- }
292
- }
293
- function syncObservers() {
294
- const shouldObserve = markers.length > 0;
295
- if (shouldObserve === observersActive) {
296
- return;
297
- }
298
- observersActive = shouldObserve;
299
- if (shouldObserve) {
300
- window.addEventListener("resize", scheduleRemeasure);
301
- window.addEventListener("scroll", handleScroll, { capture: true });
302
- if (typeof ResizeObserver !== "undefined") {
303
- resizeObserver = new ResizeObserver(scheduleRemeasure);
304
- resizeObserver.observe(document.body);
305
- }
306
- mutationObserver = new MutationObserver((records) => {
307
- const container = document.getElementById(ANNOTATION_CONTAINER_ID);
308
- const hasForeignMutation = records.some((record) => {
309
- return !container || !container.contains(record.target);
310
- });
311
- if (hasForeignMutation) {
312
- scheduleDebouncedRemeasure();
313
- }
314
- });
315
- mutationObserver.observe(document.body, { childList: true, subtree: true });
316
- } else {
317
- window.removeEventListener("resize", scheduleRemeasure);
318
- window.removeEventListener("scroll", handleScroll, { capture: true });
319
- resizeObserver?.disconnect();
320
- resizeObserver = null;
321
- mutationObserver?.disconnect();
322
- mutationObserver = null;
323
- }
324
- }
325
- function handleMessage(event) {
326
- if (!isAllowedEditorMessage(event)) {
327
- return;
328
- }
329
- const parsed = pageAnnotationsParentMessageSchema.safeParse(event.data);
330
- if (!parsed.success) {
331
- return;
332
- }
333
- editorOrigin = event.origin;
334
- exhaustiveSwitch(parsed.data)({
335
- "replo:annotations:set": (message) => {
336
- markers = message.markers;
337
- setId = message.setId;
338
- expandedClusterId = null;
339
- activeMarkerId = null;
340
- lastRenderSignature = null;
341
- render();
342
- },
343
- "replo:annotations:clear": () => {
344
- markers = [];
345
- setId = null;
346
- expandedClusterId = null;
347
- activeMarkerId = null;
348
- render();
349
- },
350
- "replo:annotations:requestReady": () => {
351
- postToEditor({
352
- type: "replo:annotations:ready",
353
- protocolVersion: PAGE_ANNOTATIONS_PROTOCOL_VERSION
354
- });
355
- }
356
- });
357
- }
1
+ import { canopyTombstoneError } from "../../lib/tombstone";
358
2
  function initAnnotationLayer() {
359
- if (isInitialized || typeof window === "undefined") {
360
- return;
361
- }
362
- if (window.self === window.top) {
363
- return;
364
- }
365
- isInitialized = true;
366
- window.addEventListener("message", handleMessage);
367
- try {
368
- const referrerOrigin = new URL(document.referrer).origin;
369
- if (isAllowedEditorOrigin(referrerOrigin)) {
370
- window.parent.postMessage(
371
- {
372
- type: "replo:annotations:ready",
373
- protocolVersion: PAGE_ANNOTATIONS_PROTOCOL_VERSION
374
- },
375
- referrerOrigin
376
- );
377
- }
378
- } catch {
379
- }
3
+ throw canopyTombstoneError({
4
+ symbol: "initAnnotationLayer",
5
+ subpath: "editor/annotations/annotationController",
6
+ replacement: { kind: "sandbox-runtime" }
7
+ });
380
8
  }
381
9
  export {
382
10
  initAnnotationLayer
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../editor/annotations/annotationController.ts"],
4
- "sourcesContent": ["/**\n * In-iframe annotation controller: consumes declarative marker sets from the\n * editor bridge, resolves selectors against the live DOM, and drives the\n * shared annotation frame renderer. Scroll costs zero JavaScript (frames use\n * page coordinates); re-measure runs only on resize/mutation/container\n * scroll, batched per animation frame. Data-only protocol \u2014 the editor can\n * describe dots, never execute code.\n */\nimport type {\n PageAnnotationMarker,\n PageAnnotationsIframeMessage,\n} from \"schemas/generated/pageAnnotations\";\nimport type { AnnotationFrameSpec } from \"../select-mode/annotationFrames\";\n\nimport { exhaustiveSwitch } from \"replo-utils/lib/misc\";\nimport {\n PAGE_ANNOTATIONS_PROTOCOL_VERSION,\n pageAnnotationsParentMessageSchema,\n} from \"schemas/pageAnnotations\";\n\nimport {\n ANNOTATION_CONTAINER_ID,\n clearAnnotationFrames,\n getAnnotationBadgeViewportRect,\n setActiveAnnotationBadge,\n showAnnotationFrames,\n} from \"../select-mode/annotationFrames\";\nimport { getDocumentScrollOffset } from \"../select-mode/interactions/selectionGeometry\";\nimport { isAllowedEditorMessage, isAllowedEditorOrigin } from \"./bridgeGate\";\n\nconst CLUSTER_DISTANCE_PX = 24;\nconst CLUSTER_FAN_RADIUS_PX = 30;\nconst REMEASURE_DEBOUNCE_MS = 250;\n// Page-wide findings stack in a row near the top-left of the page and scroll\n// with it like any other annotation.\nconst PAGE_TOP_STACK_X_PX = 20;\nconst PAGE_TOP_STACK_Y_PX = 20;\nconst PAGE_TOP_STACK_GAP_PX = 36;\n\n// Replo brand palette (lattice --color-brand-*): the wire enum names stay\n// red/purple/amber but the rendered hues are brand magenta/purple/blue,\n// matching the editor-side dots and cards.\nconst COLOR_HEX: Record<PageAnnotationMarker[\"color\"], string> = {\n red: \"#ef196e\",\n purple: \"#8b32a8\",\n amber: \"#274ae2\",\n};\nconst COLOR_SEVERITY: PageAnnotationMarker[\"color\"][] = [\n \"red\",\n \"purple\",\n \"amber\",\n];\n\ninterface ResolvedMarker {\n marker: PageAnnotationMarker;\n element: Element | null;\n isFixed: boolean;\n rect: { x: number; y: number; width: number; height: number };\n // The editor-assigned wire number, rendered verbatim.\n displayNumber: number;\n}\n\ninterface MarkerCluster {\n id: string;\n centerX: number;\n centerY: number;\n isFixed: boolean;\n members: ResolvedMarker[];\n}\n\nlet isInitialized = false;\nlet editorOrigin: string | null = null;\nlet markers: PageAnnotationMarker[] = [];\nlet setId: string | null = null;\nlet expandedClusterId: string | null = null;\nlet activeMarkerId: string | null = null;\nlet remeasureFrameId: number | null = null;\nlet remeasureDebounceId: ReturnType<typeof setTimeout> | null = null;\nlet activeRectFrameId: number | null = null;\nlet observersActive = false;\nlet lastRenderSignature: string | null = null;\nlet resizeObserver: ResizeObserver | null = null;\nlet mutationObserver: MutationObserver | null = null;\n\nfunction postToEditor(message: PageAnnotationsIframeMessage) {\n if (editorOrigin === null) {\n return;\n }\n window.parent.postMessage(message, editorOrigin);\n}\n\nfunction hasFixedAncestor(element: Element): boolean {\n let current: Element | null = element;\n while (current !== null && current !== document.documentElement) {\n const position = getComputedStyle(current).position;\n if (position === \"fixed\" || position === \"sticky\") {\n return true;\n }\n current = current.parentElement;\n }\n return false;\n}\n\nfunction resolveMarkers(): {\n resolved: ResolvedMarker[];\n unresolvedIds: string[];\n} {\n const resolved: ResolvedMarker[] = [];\n const unresolvedIds: string[] = [];\n let pageTopSlot = 0;\n for (const marker of markers) {\n if (marker.placement === \"pageTop\") {\n // Page-wide finding: a fixed slot in the top-of-page stack, no selector.\n resolved.push({\n marker,\n element: null,\n isFixed: false,\n rect: {\n x: PAGE_TOP_STACK_X_PX + pageTopSlot * PAGE_TOP_STACK_GAP_PX,\n y: PAGE_TOP_STACK_Y_PX,\n width: 0,\n height: 0,\n },\n // The editor owns numbering; rendering the wire number keeps dots in sync with the panel.\n displayNumber: marker.number,\n });\n pageTopSlot += 1;\n continue;\n }\n let element: Element | null = null;\n try {\n element = document.querySelector(marker.selector);\n } catch {\n // Malformed selector \u2014 unresolved, never a throw.\n }\n const domRect = element?.getBoundingClientRect();\n if (!element || !domRect || (domRect.width === 0 && domRect.height === 0)) {\n unresolvedIds.push(marker.id);\n continue;\n }\n const isFixed = hasFixedAncestor(element);\n const scrollOffset = getDocumentScrollOffset();\n resolved.push({\n marker,\n element,\n isFixed,\n // Fixed frames use viewport coords; absolute frames use page coords.\n rect: {\n x: domRect.x + (isFixed ? 0 : scrollOffset.left),\n y: domRect.y + (isFixed ? 0 : scrollOffset.top),\n width: domRect.width,\n height: domRect.height,\n },\n displayNumber: marker.number,\n });\n }\n return { resolved, unresolvedIds };\n}\n\n// Greedy: a marker joins the first cluster whose badge anchor lies within\n// 24px; fixed and absolute markers never co-cluster (their coordinate spaces\n// diverge as soon as the page scrolls).\nfunction clusterResolvedMarkers(resolved: ResolvedMarker[]): MarkerCluster[] {\n const clusters: MarkerCluster[] = [];\n for (const entry of resolved) {\n const centerX = entry.rect.x + entry.rect.width / 2;\n const centerY = entry.rect.y;\n const host = clusters.find((cluster) => {\n return (\n cluster.isFixed === entry.isFixed &&\n Math.hypot(cluster.centerX - centerX, cluster.centerY - centerY) <\n CLUSTER_DISTANCE_PX\n );\n });\n if (host) {\n host.members.push(entry);\n } else {\n clusters.push({\n id: entry.marker.id,\n centerX,\n centerY,\n isFixed: entry.isFixed,\n members: [entry],\n });\n }\n }\n return clusters;\n}\n\nfunction getMostSevereColorHex(members: ResolvedMarker[]): string {\n const color =\n COLOR_SEVERITY.find((candidate) => {\n return members.some((member) => member.marker.color === candidate);\n }) ?? \"amber\";\n return COLOR_HEX[color];\n}\n\nfunction activateMarker(id: string) {\n activeMarkerId = id;\n const viewportRect = getAnnotationBadgeViewportRect(id);\n if (viewportRect) {\n postToEditor({ type: \"replo:annotations:clicked\", id, viewportRect });\n }\n // Style-only: a rebuild here would race the pointer sequence and swallow\n // the very click being handled.\n setActiveAnnotationBadge(id);\n}\n\nfunction buildMemberSpec({\n member,\n badgeCenter,\n}: {\n member: ResolvedMarker;\n badgeCenter: { x: number; y: number };\n}): AnnotationFrameSpec {\n const marker = member.marker;\n return {\n id: marker.id,\n pageRect: member.rect,\n badgeCenter,\n positioning: member.isFixed ? \"fixed\" : \"absolute\",\n colorHex: COLOR_HEX[marker.color],\n badgeLabel: String(member.displayNumber),\n badgeAriaLabel: `Page issue ${member.displayNumber}`,\n isActive: activeMarkerId === marker.id,\n onBadgeClick: () => activateMarker(marker.id),\n };\n}\n\nfunction buildClusterSpecs(cluster: MarkerCluster): AnnotationFrameSpec[] {\n const [only] = cluster.members;\n if (cluster.members.length === 1 && only) {\n return [\n buildMemberSpec({\n member: only,\n badgeCenter: { x: cluster.centerX, y: cluster.centerY },\n }),\n ];\n }\n const hub = {\n x: cluster.centerX,\n y: cluster.centerY,\n width: 0,\n height: 0,\n };\n if (expandedClusterId !== cluster.id) {\n return [\n {\n id: `cluster:${cluster.id}`,\n pageRect: hub,\n badgeCenter: { x: cluster.centerX, y: cluster.centerY },\n positioning: cluster.isFixed ? \"fixed\" : \"absolute\",\n colorHex: getMostSevereColorHex(cluster.members),\n badgeLabel: String(cluster.members.length),\n badgeAriaLabel: `${cluster.members.length} page issues near this element`,\n isActive: false,\n onBadgeClick: () => {\n expandedClusterId = cluster.id;\n render();\n },\n },\n ];\n }\n const memberSpecs = cluster.members.map((member, index) => {\n const angle = (index / cluster.members.length) * 2 * Math.PI - Math.PI / 2;\n return buildMemberSpec({\n member,\n badgeCenter: {\n x: cluster.centerX + Math.cos(angle) * CLUSTER_FAN_RADIUS_PX,\n y: cluster.centerY + Math.sin(angle) * CLUSTER_FAN_RADIUS_PX,\n },\n });\n });\n return [\n {\n id: `cluster:${cluster.id}`,\n pageRect: hub,\n badgeCenter: { x: cluster.centerX, y: cluster.centerY },\n positioning: cluster.isFixed ? \"fixed\" : \"absolute\",\n colorHex: \"#94a3b8\",\n badgeLabel: \"\u00D7\",\n badgeAriaLabel: \"Collapse issue cluster\",\n isActive: false,\n onBadgeClick: () => {\n expandedClusterId = null;\n render();\n },\n },\n ...memberSpecs,\n ];\n}\n\nfunction render() {\n if (markers.length === 0) {\n lastRenderSignature = null;\n clearAnnotationFrames();\n syncObservers();\n return;\n }\n const { resolved, unresolvedIds } = resolveMarkers();\n if (activeMarkerId !== null && unresolvedIds.includes(activeMarkerId)) {\n activeMarkerId = null;\n }\n // Rebuilding the node pool mid-pointer-sequence swallows clicks, so skip\n // renders whose output would be identical to what is already on screen.\n const signature = [\n resolved\n .map((entry) => {\n return `${entry.marker.id}:${Math.round(entry.rect.x)},${Math.round(entry.rect.y)}`;\n })\n .join(\"|\"),\n `active:${activeMarkerId ?? \"\"}`,\n `expanded:${expandedClusterId ?? \"\"}`,\n `unresolved:${unresolvedIds.join(\",\")}`,\n ].join(\"#\");\n if (signature === lastRenderSignature) {\n return;\n }\n lastRenderSignature = signature;\n const frames = clusterResolvedMarkers(resolved).flatMap((cluster) => {\n return buildClusterSpecs(cluster);\n });\n showAnnotationFrames({ frames });\n if (setId !== null) {\n postToEditor({\n type: \"replo:annotations:unresolved\",\n setId,\n ids: unresolvedIds,\n });\n }\n syncObservers();\n}\n\nfunction scheduleRemeasure() {\n remeasureFrameId ??= requestAnimationFrame(() => {\n remeasureFrameId = null;\n render();\n });\n}\n\nfunction scheduleDebouncedRemeasure() {\n if (remeasureDebounceId !== null) {\n clearTimeout(remeasureDebounceId);\n }\n remeasureDebounceId = setTimeout(scheduleRemeasure, REMEASURE_DEBOUNCE_MS);\n}\n\nfunction handleScroll(event: Event) {\n // Document scroll is free for absolute frames; scrolls of inner overflow\n // containers move elements relative to the page, so re-measure everything.\n if (event.target !== document) {\n scheduleRemeasure();\n }\n if (activeMarkerId !== null) {\n const id = activeMarkerId;\n activeRectFrameId ??= requestAnimationFrame(() => {\n activeRectFrameId = null;\n const viewportRect = getAnnotationBadgeViewportRect(id);\n if (viewportRect) {\n postToEditor({\n type: \"replo:annotations:activeRect\",\n id,\n viewportRect,\n });\n }\n });\n }\n}\n\nfunction syncObservers() {\n const shouldObserve = markers.length > 0;\n if (shouldObserve === observersActive) {\n return;\n }\n observersActive = shouldObserve;\n if (shouldObserve) {\n window.addEventListener(\"resize\", scheduleRemeasure);\n window.addEventListener(\"scroll\", handleScroll, { capture: true });\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleRemeasure);\n resizeObserver.observe(document.body);\n }\n mutationObserver = new MutationObserver((records) => {\n // Rendering our own frames mutates body's subtree; reacting to that\n // would re-render forever. Only foreign mutations can move elements.\n const container = document.getElementById(ANNOTATION_CONTAINER_ID);\n const hasForeignMutation = records.some((record) => {\n return !container || !container.contains(record.target);\n });\n if (hasForeignMutation) {\n scheduleDebouncedRemeasure();\n }\n });\n mutationObserver.observe(document.body, { childList: true, subtree: true });\n } else {\n window.removeEventListener(\"resize\", scheduleRemeasure);\n window.removeEventListener(\"scroll\", handleScroll, { capture: true });\n resizeObserver?.disconnect();\n resizeObserver = null;\n mutationObserver?.disconnect();\n mutationObserver = null;\n }\n}\n\nfunction handleMessage(event: MessageEvent) {\n // Origin gate BEFORE any parsing \u2014 hostile embedders never reach the schema.\n if (!isAllowedEditorMessage(event)) {\n return;\n }\n const parsed = pageAnnotationsParentMessageSchema.safeParse(event.data);\n if (!parsed.success) {\n return;\n }\n editorOrigin = event.origin;\n exhaustiveSwitch(parsed.data)({\n \"replo:annotations:set\": (message) => {\n markers = message.markers;\n setId = message.setId;\n expandedClusterId = null;\n activeMarkerId = null;\n // A fresh set always paints (and re-posts unresolved), even if geometry\n // happens to match the previous render.\n lastRenderSignature = null;\n render();\n },\n \"replo:annotations:clear\": () => {\n markers = [];\n setId = null;\n expandedClusterId = null;\n activeMarkerId = null;\n render();\n },\n \"replo:annotations:requestReady\": () => {\n postToEditor({\n type: \"replo:annotations:ready\",\n protocolVersion: PAGE_ANNOTATIONS_PROTOCOL_VERSION,\n });\n },\n });\n}\n\nexport function initAnnotationLayer() {\n if (isInitialized || typeof window === \"undefined\") {\n return;\n }\n if (window.self === window.top) {\n return;\n }\n isInitialized = true;\n window.addEventListener(\"message\", handleMessage);\n // Announce on load for iframe-reload cases where the editor isn't polling;\n // the referrer origin is verified against the same allowlist first.\n try {\n const referrerOrigin = new URL(document.referrer).origin;\n if (isAllowedEditorOrigin(referrerOrigin)) {\n window.parent.postMessage(\n {\n type: \"replo:annotations:ready\",\n protocolVersion: PAGE_ANNOTATIONS_PROTOCOL_VERSION,\n },\n referrerOrigin,\n );\n }\n } catch {\n // No usable referrer \u2014 the editor's requestReady polling covers this.\n }\n}\n"],
5
- "mappings": "AAcA,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,+BAA+B;AACxC,SAAS,wBAAwB,6BAA6B;AAE9D,MAAM,sBAAsB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;AACtB,aAAO;AAAA,IACT;AAAA,IACA,2BAA2B,MAAM;AAC/B,gBAAU,CAAC;AACX,cAAQ;AACR,0BAAoB;AACpB,uBAAiB;AACjB,aAAO;AAAA,IACT;AAAA,IACA,kCAAkC,MAAM;AACtC,mBAAa;AAAA,QACX,MAAM;AAAA,QACN,iBAAiB;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;AAEO,SAAS,sBAAsB;AACpC,MAAI,iBAAiB,OAAO,WAAW,aAAa;AAClD;AAAA,EACF;AACA,MAAI,OAAO,SAAS,OAAO,KAAK;AAC9B;AAAA,EACF;AACA,kBAAgB;AAChB,SAAO,iBAAiB,WAAW,aAAa;AAGhD,MAAI;AACF,UAAM,iBAAiB,IAAI,IAAI,SAAS,QAAQ,EAAE;AAClD,QAAI,sBAAsB,cAAc,GAAG;AACzC,aAAO,OAAO;AAAA,QACZ;AAAA,UACE,MAAM;AAAA,UACN,iBAAiB;AAAA,QACnB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF,QAAQ;AAAA,EAER;AACF;",
4
+ "sourcesContent": ["/* oxlint-disable replo/no-void-return-type -- Tombstone declarations preserve exact return types for consumer compatibility. */\n// eslint-disable-next-line no-unused-vars -- This type edge keeps the vendored annotation declaration reachable after tombstoning.\nimport type { PageAnnotationMarker } from \"schemas/generated/pageAnnotations\";\n// eslint-disable-next-line no-unused-vars -- This type edge keeps the vendored annotation schema reachable after tombstoning.\nimport type { pageAnnotationsParentMessageSchema } from \"schemas/pageAnnotations\";\n\nimport { canopyTombstoneError } from \"../../lib/tombstone\";\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function initAnnotationLayer(): void {\n throw canopyTombstoneError({\n symbol: \"initAnnotationLayer\",\n subpath: \"editor/annotations/annotationController\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
5
+ "mappings": "AAMA,SAAS,4BAA4B;AAG9B,SAAS,sBAA4B;AAC1C,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
6
6
  "names": []
7
7
  }