@replohq/canopy-sdk 2.5.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 +2 -13
  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,87 +1,31 @@
1
- import {
2
- createIframeRpcChannel,
3
- createIframeRpcRemote
4
- } from "../../_vendor/schemas/iframeRpcChannel.mjs";
5
- import {
6
- canopyToWebsiteBuilderMethodConfig,
7
- SELECT_MODE_IFRAME_RPC_CHANNEL_ID,
8
- SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION,
9
- websiteBuilderToCanopyMethodConfig
10
- } from "../../_vendor/schemas/selectModeIframeRpc.mjs";
11
- import { symbolicateSelectedElement } from "./symbolicate";
12
- let messagingHandlers = null;
13
- function createSelectModeIframeRpcChannel() {
14
- return createIframeRpcChannel({
15
- subscriberWindow: window,
16
- channelIdentifier: SELECT_MODE_IFRAME_RPC_CHANNEL_ID,
17
- version: SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION,
18
- getTargetWindow: () => window.parent === window ? null : window.parent,
19
- targetOrigin: "*",
20
- isExpectedMessage: (event) => event.source === window.parent,
21
- outgoingMethods: canopyToWebsiteBuilderMethodConfig,
22
- incomingMethods: websiteBuilderToCanopyMethodConfig,
23
- handlers: {
24
- setDisplayMode: (input) => {
25
- messagingHandlers?.setDisplayMode(input);
26
- },
27
- setSelectionType: (input) => {
28
- messagingHandlers?.setSelectionType(input);
29
- },
30
- applyOptimisticUpdate: (input) => {
31
- messagingHandlers?.applyOptimisticUpdate(input);
32
- },
33
- markCommitted: (input) => {
34
- messagingHandlers?.markCommitted(input);
35
- },
36
- resolveSessionOverrides: (input) => {
37
- messagingHandlers?.resolveSessionOverrides(input);
38
- },
39
- revertOverride: (input) => {
40
- messagingHandlers?.revertOverride(input);
41
- },
42
- enterEditMode: (input) => {
43
- messagingHandlers?.enterEditMode(input);
44
- },
45
- exitEditMode: (input) => {
46
- messagingHandlers?.exitEditMode(input);
47
- },
48
- formatCommand: (input) => {
49
- messagingHandlers?.formatCommand(input);
50
- },
51
- symbolicateSelectedElement: (element) => {
52
- return symbolicateSelectedElement(element);
53
- }
54
- }
55
- });
56
- }
57
- let channel = null;
58
- let websiteBuilderRpc = null;
1
+ import { canopyTombstoneError } from "../../lib/tombstone";
59
2
  function getSelectModeIframeRpcChannel() {
60
- if (typeof window === "undefined") {
61
- return null;
62
- }
63
- channel ??= createSelectModeIframeRpcChannel();
64
- return channel;
3
+ throw canopyTombstoneError({
4
+ symbol: "getSelectModeIframeRpcChannel",
5
+ subpath: "editor/select-mode/iframeRpcChannel",
6
+ replacement: { kind: "sandbox-runtime" }
7
+ });
65
8
  }
66
- function setSelectModeParentHandlers(nextHandlers) {
67
- messagingHandlers = nextHandlers;
9
+ function setSelectModeParentHandlers(_nextHandlers) {
10
+ throw canopyTombstoneError({
11
+ symbol: "setSelectModeParentHandlers",
12
+ subpath: "editor/select-mode/iframeRpcChannel",
13
+ replacement: { kind: "sandbox-runtime" }
14
+ });
68
15
  }
69
16
  function getWebsiteBuilderRpc() {
70
- const currentChannel = getSelectModeIframeRpcChannel();
71
- if (!currentChannel) {
72
- return null;
73
- }
74
- websiteBuilderRpc ??= createIframeRpcRemote(currentChannel);
75
- return websiteBuilderRpc;
17
+ throw canopyTombstoneError({
18
+ symbol: "getWebsiteBuilderRpc",
19
+ subpath: "editor/select-mode/iframeRpcChannel",
20
+ replacement: { kind: "sandbox-runtime" }
21
+ });
76
22
  }
77
- function requestInlineTextEdit(input) {
78
- const remote = getWebsiteBuilderRpc();
79
- if (!remote) {
80
- return Promise.reject(
81
- new Error("Website Builder iframe RPC is unavailable")
82
- );
83
- }
84
- return remote.requestInlineTextEdit(input);
23
+ function requestInlineTextEdit(_input) {
24
+ throw canopyTombstoneError({
25
+ symbol: "requestInlineTextEdit",
26
+ subpath: "editor/select-mode/iframeRpcChannel",
27
+ replacement: { kind: "sandbox-runtime" }
28
+ });
85
29
  }
86
30
  export {
87
31
  getSelectModeIframeRpcChannel,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../editor/select-mode/iframeRpcChannel.ts"],
4
- "sourcesContent": ["import type { SelectedElement } from \"schemas/generated/selectMode\";\nimport type {\n IframeRpcChannelInputHandlers,\n IframeRpcChannelRemote,\n} from \"schemas/iframeRpcChannel\";\n\nimport {\n createIframeRpcChannel,\n createIframeRpcRemote,\n} from \"schemas/iframeRpcChannel\";\nimport {\n canopyToWebsiteBuilderMethodConfig,\n SELECT_MODE_IFRAME_RPC_CHANNEL_ID,\n SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION,\n websiteBuilderToCanopyMethodConfig,\n} from \"schemas/selectModeIframeRpc\";\n\nimport { symbolicateSelectedElement } from \"./symbolicate\";\n\nexport type WebsiteBuilderRpcRemote = IframeRpcChannelRemote<\n typeof canopyToWebsiteBuilderMethodConfig\n>;\n\ntype SelectModeParentMessagingHandlers = Omit<\n IframeRpcChannelInputHandlers<typeof websiteBuilderToCanopyMethodConfig>,\n \"symbolicateSelectedElement\"\n>;\n\n// Module-level handler pointers; `useParentMessaging` sets these on mount\n// and nulls them on unmount. Inbound void methods are dropped until then.\n// `symbolicateSelectedElement` is wired permanently on the channel.\nlet messagingHandlers: SelectModeParentMessagingHandlers | null = null;\n\nfunction createSelectModeIframeRpcChannel() {\n return createIframeRpcChannel({\n subscriberWindow: window,\n channelIdentifier: SELECT_MODE_IFRAME_RPC_CHANNEL_ID,\n version: SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION,\n getTargetWindow: () => (window.parent === window ? null : window.parent),\n targetOrigin: \"*\",\n isExpectedMessage: (event) => event.source === window.parent,\n outgoingMethods: canopyToWebsiteBuilderMethodConfig,\n incomingMethods: websiteBuilderToCanopyMethodConfig,\n handlers: {\n setDisplayMode: (input) => {\n messagingHandlers?.setDisplayMode(input);\n },\n setSelectionType: (input) => {\n messagingHandlers?.setSelectionType(input);\n },\n applyOptimisticUpdate: (input) => {\n messagingHandlers?.applyOptimisticUpdate(input);\n },\n markCommitted: (input) => {\n messagingHandlers?.markCommitted(input);\n },\n resolveSessionOverrides: (input) => {\n messagingHandlers?.resolveSessionOverrides(input);\n },\n revertOverride: (input) => {\n messagingHandlers?.revertOverride(input);\n },\n enterEditMode: (input) => {\n messagingHandlers?.enterEditMode(input);\n },\n exitEditMode: (input) => {\n messagingHandlers?.exitEditMode(input);\n },\n formatCommand: (input) => {\n messagingHandlers?.formatCommand(input);\n },\n symbolicateSelectedElement: (element) => {\n return symbolicateSelectedElement(element);\n },\n },\n });\n}\n\nlet channel: ReturnType<typeof createSelectModeIframeRpcChannel> | null = null;\nlet websiteBuilderRpc: WebsiteBuilderRpcRemote | null = null;\n\nexport function getSelectModeIframeRpcChannel() {\n if (typeof window === \"undefined\") {\n return null;\n }\n channel ??= createSelectModeIframeRpcChannel();\n return channel;\n}\n\nexport function setSelectModeParentHandlers(\n nextHandlers: SelectModeParentMessagingHandlers | null,\n) {\n messagingHandlers = nextHandlers;\n}\n\nexport function getWebsiteBuilderRpc(): WebsiteBuilderRpcRemote | null {\n const currentChannel = getSelectModeIframeRpcChannel();\n if (!currentChannel) {\n return null;\n }\n websiteBuilderRpc ??= createIframeRpcRemote(currentChannel);\n return websiteBuilderRpc;\n}\n\nexport function requestInlineTextEdit(input: {\n editId: string;\n element: SelectedElement;\n}) {\n const remote = getWebsiteBuilderRpc();\n if (!remote) {\n return Promise.reject(\n new Error(\"Website Builder iframe RPC is unavailable\"),\n );\n }\n return remote.requestInlineTextEdit(input);\n}\n"],
5
- "mappings": "AAMA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,kCAAkC;AAc3C,IAAI,oBAA8D;AAElE,SAAS,mCAAmC;AAC1C,SAAO,uBAAuB;AAAA,IAC5B,kBAAkB;AAAA,IAClB,mBAAmB;AAAA,IACnB,SAAS;AAAA,IACT,iBAAiB,MAAO,OAAO,WAAW,SAAS,OAAO,OAAO;AAAA,IACjE,cAAc;AAAA,IACd,mBAAmB,CAAC,UAAU,MAAM,WAAW,OAAO;AAAA,IACtD,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,UAAU;AAAA,MACR,gBAAgB,CAAC,UAAU;AACzB,2BAAmB,eAAe,KAAK;AAAA,MACzC;AAAA,MACA,kBAAkB,CAAC,UAAU;AAC3B,2BAAmB,iBAAiB,KAAK;AAAA,MAC3C;AAAA,MACA,uBAAuB,CAAC,UAAU;AAChC,2BAAmB,sBAAsB,KAAK;AAAA,MAChD;AAAA,MACA,eAAe,CAAC,UAAU;AACxB,2BAAmB,cAAc,KAAK;AAAA,MACxC;AAAA,MACA,yBAAyB,CAAC,UAAU;AAClC,2BAAmB,wBAAwB,KAAK;AAAA,MAClD;AAAA,MACA,gBAAgB,CAAC,UAAU;AACzB,2BAAmB,eAAe,KAAK;AAAA,MACzC;AAAA,MACA,eAAe,CAAC,UAAU;AACxB,2BAAmB,cAAc,KAAK;AAAA,MACxC;AAAA,MACA,cAAc,CAAC,UAAU;AACvB,2BAAmB,aAAa,KAAK;AAAA,MACvC;AAAA,MACA,eAAe,CAAC,UAAU;AACxB,2BAAmB,cAAc,KAAK;AAAA,MACxC;AAAA,MACA,4BAA4B,CAAC,YAAY;AACvC,eAAO,2BAA2B,OAAO;AAAA,MAC3C;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEA,IAAI,UAAsE;AAC1E,IAAI,oBAAoD;AAEjD,SAAS,gCAAgC;AAC9C,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO;AAAA,EACT;AACA,cAAY,iCAAiC;AAC7C,SAAO;AACT;AAEO,SAAS,4BACd,cACA;AACA,sBAAoB;AACtB;AAEO,SAAS,uBAAuD;AACrE,QAAM,iBAAiB,8BAA8B;AACrD,MAAI,CAAC,gBAAgB;AACnB,WAAO;AAAA,EACT;AACA,wBAAsB,sBAAsB,cAAc;AAC1D,SAAO;AACT;AAEO,SAAS,sBAAsB,OAGnC;AACD,QAAM,SAAS,qBAAqB;AACpC,MAAI,CAAC,QAAQ;AACX,WAAO,QAAQ;AAAA,MACb,IAAI,MAAM,2CAA2C;AAAA,IACvD;AAAA,EACF;AACA,SAAO,OAAO,sBAAsB,KAAK;AAC3C;",
4
+ "sourcesContent": ["/* oxlint-disable replo/no-void-return-type -- Tombstone declarations preserve exact return types for consumer compatibility. */\nimport type { SelectedElement } from \"schemas/generated/selectMode\";\nimport type {\n IframeRpcChannel,\n IframeRpcChannelInputHandlers,\n IframeRpcChannelRemote,\n} from \"schemas/iframeRpcChannel\";\nimport type {\n canopyToWebsiteBuilderMethodConfig,\n websiteBuilderToCanopyMethodConfig,\n} from \"schemas/selectModeIframeRpc\";\n\nimport { canopyTombstoneError } from \"../../lib/tombstone\";\n\nexport type WebsiteBuilderRpcRemote = IframeRpcChannelRemote<\n typeof canopyToWebsiteBuilderMethodConfig\n>;\n\ntype SelectModeParentMessagingHandlers = Omit<\n IframeRpcChannelInputHandlers<typeof websiteBuilderToCanopyMethodConfig>,\n \"symbolicateSelectedElement\"\n>;\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getSelectModeIframeRpcChannel(): IframeRpcChannel<\n typeof canopyToWebsiteBuilderMethodConfig\n> | null {\n throw canopyTombstoneError({\n symbol: \"getSelectModeIframeRpcChannel\",\n subpath: \"editor/select-mode/iframeRpcChannel\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function setSelectModeParentHandlers(\n _nextHandlers: SelectModeParentMessagingHandlers | null,\n): void {\n throw canopyTombstoneError({\n symbol: \"setSelectModeParentHandlers\",\n subpath: \"editor/select-mode/iframeRpcChannel\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getWebsiteBuilderRpc(): WebsiteBuilderRpcRemote | null {\n throw canopyTombstoneError({\n symbol: \"getWebsiteBuilderRpc\",\n subpath: \"editor/select-mode/iframeRpcChannel\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function requestInlineTextEdit(_input: {\n editId: string;\n element: SelectedElement;\n}): ReturnType<WebsiteBuilderRpcRemote[\"requestInlineTextEdit\"]> {\n throw canopyTombstoneError({\n symbol: \"requestInlineTextEdit\",\n subpath: \"editor/select-mode/iframeRpcChannel\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
5
+ "mappings": "AAYA,SAAS,4BAA4B;AAY9B,SAAS,gCAEP;AACP,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,4BACd,eACM;AACN,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,uBAAuD;AACrE,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,sBAAsB,QAG2B;AAC/D,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,4 @@
1
- export declare function isInlineTextMarkElement(element: Element): boolean;
2
- /**
3
- * Walk up past nested inline text marks so selection targets the host
4
- * element (e.g. `<p>hello <em>world</em></p>` → the `<p>`).
5
- */
6
- export declare function skipInlineTextMarkElements(element: Element): Element;
1
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
2
+ export declare function isInlineTextMarkElement(_element: Element): boolean;
3
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
4
+ export declare function skipInlineTextMarkElements(_element: Element): Element;
@@ -1,22 +1,17 @@
1
- const INLINE_TEXT_MARK_TAGS = /* @__PURE__ */ new Set([
2
- "b",
3
- "strong",
4
- "em",
5
- "i",
6
- "s",
7
- "strike",
8
- "u",
9
- "mark"
10
- ]);
11
- function isInlineTextMarkElement(element) {
12
- return INLINE_TEXT_MARK_TAGS.has(element.tagName.toLowerCase());
1
+ import { canopyTombstoneError } from "../../lib/tombstone";
2
+ function isInlineTextMarkElement(_element) {
3
+ throw canopyTombstoneError({
4
+ symbol: "isInlineTextMarkElement",
5
+ subpath: "editor/select-mode/inlineTextMarks",
6
+ replacement: { kind: "sandbox-runtime" }
7
+ });
13
8
  }
14
- function skipInlineTextMarkElements(element) {
15
- let current = element;
16
- while (isInlineTextMarkElement(current) && current.parentElement && current.parentElement !== document.documentElement && current.parentElement !== document.body) {
17
- current = current.parentElement;
18
- }
19
- return current;
9
+ function skipInlineTextMarkElements(_element) {
10
+ throw canopyTombstoneError({
11
+ symbol: "skipInlineTextMarkElements",
12
+ subpath: "editor/select-mode/inlineTextMarks",
13
+ replacement: { kind: "sandbox-runtime" }
14
+ });
20
15
  }
21
16
  export {
22
17
  isInlineTextMarkElement,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../editor/select-mode/inlineTextMarks.ts"],
4
- "sourcesContent": ["// NOTE (Noah, 2026-07-23): TipTap / inline JSX marks are not independently\n// selectable \u2014 clicking bold/italic text should select the host block, not\n// the <strong>/<em> wrapper. Keep in sync with tiptapInlineEditor marks.\nconst INLINE_TEXT_MARK_TAGS = new Set([\n \"b\",\n \"strong\",\n \"em\",\n \"i\",\n \"s\",\n \"strike\",\n \"u\",\n \"mark\",\n]);\n\nexport function isInlineTextMarkElement(element: Element): boolean {\n return INLINE_TEXT_MARK_TAGS.has(element.tagName.toLowerCase());\n}\n\n/**\n * Walk up past nested inline text marks so selection targets the host\n * element (e.g. `<p>hello <em>world</em></p>` \u2192 the `<p>`).\n */\nexport function skipInlineTextMarkElements(element: Element): Element {\n let current = element;\n while (\n isInlineTextMarkElement(current) &&\n current.parentElement &&\n current.parentElement !== document.documentElement &&\n current.parentElement !== document.body\n ) {\n current = current.parentElement;\n }\n return current;\n}\n"],
5
- "mappings": "AAGA,MAAM,wBAAwB,oBAAI,IAAI;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,wBAAwB,SAA2B;AACjE,SAAO,sBAAsB,IAAI,QAAQ,QAAQ,YAAY,CAAC;AAChE;AAMO,SAAS,2BAA2B,SAA2B;AACpE,MAAI,UAAU;AACd,SACE,wBAAwB,OAAO,KAC/B,QAAQ,iBACR,QAAQ,kBAAkB,SAAS,mBACnC,QAAQ,kBAAkB,SAAS,MACnC;AACA,cAAU,QAAQ;AAAA,EACpB;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import { canopyTombstoneError } from \"../../lib/tombstone\";\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function isInlineTextMarkElement(_element: Element): boolean {\n throw canopyTombstoneError({\n symbol: \"isInlineTextMarkElement\",\n subpath: \"editor/select-mode/inlineTextMarks\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function skipInlineTextMarkElements(_element: Element): Element {\n throw canopyTombstoneError({\n symbol: \"skipInlineTextMarkElements\",\n subpath: \"editor/select-mode/inlineTextMarks\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
5
+ "mappings": "AAAA,SAAS,4BAA4B;AAG9B,SAAS,wBAAwB,UAA4B;AAClE,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,2BAA2B,UAA4B;AACrE,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -12,48 +12,32 @@ export type ScrollOffset = {
12
12
  export type SelectedAreaState = {
13
13
  pageRect: SelectModeBoundingRect;
14
14
  };
15
- /**
16
- * @author Kevin O'Connell 2026-04-17
17
- */
18
- export declare function getDragPositionFromClient({ clientX, clientY, scrollOffset, }: {
15
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
16
+ export declare function getDragPositionFromClient(_args: {
19
17
  clientX: number;
20
18
  clientY: number;
21
19
  scrollOffset: ScrollOffset;
22
20
  }): DragPosition;
23
- /**
24
- * @author Kevin O'Connell 2026-04-17
25
- */
21
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
26
22
  export declare function getDocumentScrollOffset(): ScrollOffset;
27
- /**
28
- * @author Kevin O'Connell 2026-04-17
29
- */
30
- export declare function getViewportSelectionRect({ dragStart, dragCurrent, scrollOffset, }: {
23
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
24
+ export declare function getViewportSelectionRect(_args: {
31
25
  dragStart: DragPosition;
32
26
  dragCurrent: DragPosition;
33
27
  scrollOffset: ScrollOffset;
34
28
  }): SelectModeBoundingRect;
35
- /**
36
- * @author Kevin O'Connell 2026-04-17
37
- */
38
- export declare function getPageRectFromViewportRect({ rect, scrollOffset, }: {
29
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
30
+ export declare function getPageRectFromViewportRect(_args: {
39
31
  rect: SelectModeBoundingRect;
40
32
  scrollOffset: ScrollOffset;
41
33
  }): SelectModeBoundingRect;
42
- /**
43
- * @author Kevin O'Connell 2026-04-17
44
- */
45
- export declare function getViewportRectFromPageRect({ rect, scrollOffset, }: {
34
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
35
+ export declare function getViewportRectFromPageRect(_args: {
46
36
  rect: SelectModeBoundingRect;
47
37
  scrollOffset: ScrollOffset;
48
38
  }): SelectModeBoundingRect;
49
- /**
50
- * A drag captures an element when their boxes overlap (within
51
- * `tolerancePx`) — but NOT when the drag sits entirely inside the
52
- * element. The latter case is the user dragging *within* a large
53
- * container (a section, `<main>`, `<body>`) to lasso its children; the
54
- * container itself isn't a thing they're trying to select, so we drop it.
55
- */
56
- export declare function doesRectIntersectSelection({ elementRect, selectionRect, tolerancePx, }: {
39
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
40
+ export declare function doesRectIntersectSelection(_args: {
57
41
  elementRect: SelectModeBoundingRect;
58
42
  selectionRect: SelectModeBoundingRect;
59
43
  tolerancePx: number;
@@ -63,43 +47,17 @@ export type DragCandidate = {
63
47
  element: Element;
64
48
  pageRect: SelectModeBoundingRect;
65
49
  };
66
- /**
67
- * Snapshots every meaningful element and its page rect when a drag begins.
68
- * Each candidate gets a stable id so the parent overlay can key its
69
- * live highlights without remounting them as the drag moves.
70
- */
71
- export declare function collectDragCandidates(scrollOffset: ScrollOffset): DragCandidate[];
72
- /**
73
- * Cheap per-move hit-test against the pre-collected candidates: keep the
74
- * ones whose page rect overlaps the selection (excluding any that wholly
75
- * enclose it), then collapse any fully-covered parent/children group down
76
- * to just the parent (see `collapseFullyCoveredChildren`). Does no DOM
77
- * queries or re-measures of geometry — the only DOM reads are cheap
78
- * parent/child structural lookups.
79
- *
80
- * Because the collapse depends on which siblings are currently captured,
81
- * elements legitimately move in and out of the result as the drag grows or
82
- * shrinks: a child drops out the moment the drag swallows its last sibling
83
- * (the parent takes over), and reappears if the drag retreats.
84
- */
85
- export declare function getCandidatesInSelection({ candidates, selectionPageRect, }: {
50
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
51
+ export declare function collectDragCandidates(_scrollOffset: ScrollOffset): DragCandidate[];
52
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
53
+ export declare function getCandidatesInSelection(_args: {
86
54
  candidates: DragCandidate[];
87
55
  selectionPageRect: SelectModeBoundingRect;
88
56
  }): DragCandidate[];
89
- /**
90
- * Picks a "click position" for an element that fell inside an area
91
- * selection. We use the corner of the element nearest the top-left of the
92
- * selection rect, clamped to the element's own bounds. This anchor is what
93
- * lets the selected-element overlay continue to track the element when the
94
- * user scrolls (`useSelectionScrollSync` re-projects relative to it).
95
- *
96
- * @author Kevin O'Connell 2026-04-17
97
- */
98
- export declare function getElementAnchor({ element, selectionRect, }: {
57
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
58
+ export declare function getElementAnchor(_args: {
99
59
  element: Element;
100
60
  selectionRect: SelectModeBoundingRect;
101
61
  }): SelectModeClickPosition;
102
- /**
103
- * @author Kevin O'Connell 2026-04-17
104
- */
105
- export declare function getElementBoundingRect(element: Element): SelectModeBoundingRect;
62
+ /** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
63
+ export declare function getElementBoundingRect(_element: Element): SelectModeBoundingRect;
@@ -1,181 +1,73 @@
1
- import { isIntersecting, isRectEnclosing } from "../../../_vendor/replo-utils/lib/geometry.mjs";
2
- import { v4 as uuidv4 } from "uuid";
3
- import { isInlineTextMarkElement } from "../inlineTextMarks";
4
- const SELECTION_TOLERANCE_PX = 4;
5
- function normalizeSelectionRect({
6
- startX,
7
- startY,
8
- endX,
9
- endY
10
- }) {
11
- const left = Math.min(startX, endX);
12
- const right = Math.max(startX, endX);
13
- const top = Math.min(startY, endY);
14
- const bottom = Math.max(startY, endY);
15
- return {
16
- x: left,
17
- y: top,
18
- width: right - left,
19
- height: bottom - top,
20
- top,
21
- right,
22
- bottom,
23
- left
24
- };
25
- }
26
- function getDragPositionFromClient({
27
- clientX,
28
- clientY,
29
- scrollOffset
30
- }) {
31
- return {
32
- clientX,
33
- clientY,
34
- pageX: clientX + scrollOffset.left,
35
- pageY: clientY + scrollOffset.top
36
- };
1
+ import { canopyTombstoneError } from "../../../lib/tombstone";
2
+ function getDragPositionFromClient(_args) {
3
+ throw canopyTombstoneError({
4
+ symbol: "getDragPositionFromClient",
5
+ subpath: "editor/select-mode/interactions/selectionGeometry",
6
+ replacement: { kind: "sandbox-runtime" }
7
+ });
37
8
  }
38
9
  function getDocumentScrollOffset() {
39
- const scrollingElement = document.scrollingElement;
40
- return {
41
- left: scrollingElement?.scrollLeft ?? window.scrollX,
42
- top: scrollingElement?.scrollTop ?? window.scrollY
43
- };
44
- }
45
- function getViewportSelectionRect({
46
- dragStart,
47
- dragCurrent,
48
- scrollOffset
49
- }) {
50
- return normalizeSelectionRect({
51
- startX: dragStart.pageX - scrollOffset.left,
52
- startY: dragStart.pageY - scrollOffset.top,
53
- endX: dragCurrent.pageX - scrollOffset.left,
54
- endY: dragCurrent.pageY - scrollOffset.top
10
+ throw canopyTombstoneError({
11
+ symbol: "getDocumentScrollOffset",
12
+ subpath: "editor/select-mode/interactions/selectionGeometry",
13
+ replacement: { kind: "sandbox-runtime" }
55
14
  });
56
15
  }
57
- function getPageRectFromViewportRect({
58
- rect,
59
- scrollOffset
60
- }) {
61
- return {
62
- x: rect.x + scrollOffset.left,
63
- y: rect.y + scrollOffset.top,
64
- width: rect.width,
65
- height: rect.height,
66
- left: rect.left + scrollOffset.left,
67
- top: rect.top + scrollOffset.top,
68
- right: rect.right + scrollOffset.left,
69
- bottom: rect.bottom + scrollOffset.top
70
- };
71
- }
72
- function getViewportRectFromPageRect({
73
- rect,
74
- scrollOffset
75
- }) {
76
- return {
77
- x: rect.x - scrollOffset.left,
78
- y: rect.y - scrollOffset.top,
79
- width: rect.width,
80
- height: rect.height,
81
- left: rect.left - scrollOffset.left,
82
- top: rect.top - scrollOffset.top,
83
- right: rect.right - scrollOffset.left,
84
- bottom: rect.bottom - scrollOffset.top
85
- };
16
+ function getViewportSelectionRect(_args) {
17
+ throw canopyTombstoneError({
18
+ symbol: "getViewportSelectionRect",
19
+ subpath: "editor/select-mode/interactions/selectionGeometry",
20
+ replacement: { kind: "sandbox-runtime" }
21
+ });
86
22
  }
87
- function isMeaningfulElement(element, elementRect) {
88
- const tagName = element.tagName.toLowerCase();
89
- if (["html", "body", "script", "style", "meta", "link"].includes(tagName)) {
90
- return false;
91
- }
92
- if (isInlineTextMarkElement(element)) {
93
- return false;
94
- }
95
- if (elementRect.width < 4 || elementRect.height < 4) {
96
- return false;
97
- }
98
- return true;
23
+ function getPageRectFromViewportRect(_args) {
24
+ throw canopyTombstoneError({
25
+ symbol: "getPageRectFromViewportRect",
26
+ subpath: "editor/select-mode/interactions/selectionGeometry",
27
+ replacement: { kind: "sandbox-runtime" }
28
+ });
99
29
  }
100
- function doesRectIntersectSelection({
101
- elementRect,
102
- selectionRect,
103
- tolerancePx
104
- }) {
105
- return isIntersecting(elementRect, selectionRect, { tolerance: tolerancePx }) && !isRectEnclosing(elementRect, selectionRect);
30
+ function getViewportRectFromPageRect(_args) {
31
+ throw canopyTombstoneError({
32
+ symbol: "getViewportRectFromPageRect",
33
+ subpath: "editor/select-mode/interactions/selectionGeometry",
34
+ replacement: { kind: "sandbox-runtime" }
35
+ });
106
36
  }
107
- function collectDragCandidates(scrollOffset) {
108
- const candidates = [];
109
- for (const element of Array.from(document.querySelectorAll("*"))) {
110
- const viewportRect = getElementBoundingRect(element);
111
- if (!isMeaningfulElement(element, viewportRect)) {
112
- continue;
113
- }
114
- candidates.push({
115
- id: uuidv4(),
116
- element,
117
- pageRect: getPageRectFromViewportRect({
118
- rect: viewportRect,
119
- scrollOffset
120
- })
121
- });
122
- }
123
- return candidates;
37
+ function doesRectIntersectSelection(_args) {
38
+ throw canopyTombstoneError({
39
+ symbol: "doesRectIntersectSelection",
40
+ subpath: "editor/select-mode/interactions/selectionGeometry",
41
+ replacement: { kind: "sandbox-runtime" }
42
+ });
124
43
  }
125
- function collapseFullyCoveredChildren({
126
- candidates,
127
- selected
128
- }) {
129
- const candidateElements = new Set(
130
- candidates.map((candidate) => candidate.element)
131
- );
132
- const selectedElements = new Set(
133
- selected.map((candidate) => candidate.element)
134
- );
135
- return selected.filter((candidate) => {
136
- const parent = candidate.element.parentElement;
137
- if (!parent || !selectedElements.has(parent)) {
138
- return true;
139
- }
140
- const everyCandidateChildSelected = Array.from(parent.children).filter((child) => candidateElements.has(child)).every((child) => selectedElements.has(child));
141
- return !everyCandidateChildSelected;
44
+ function collectDragCandidates(_scrollOffset) {
45
+ throw canopyTombstoneError({
46
+ symbol: "collectDragCandidates",
47
+ subpath: "editor/select-mode/interactions/selectionGeometry",
48
+ replacement: { kind: "sandbox-runtime" }
142
49
  });
143
50
  }
144
- function getCandidatesInSelection({
145
- candidates,
146
- selectionPageRect
147
- }) {
148
- const intersecting = candidates.filter((candidate) => {
149
- return doesRectIntersectSelection({
150
- elementRect: candidate.pageRect,
151
- selectionRect: selectionPageRect,
152
- tolerancePx: SELECTION_TOLERANCE_PX
153
- });
51
+ function getCandidatesInSelection(_args) {
52
+ throw canopyTombstoneError({
53
+ symbol: "getCandidatesInSelection",
54
+ subpath: "editor/select-mode/interactions/selectionGeometry",
55
+ replacement: { kind: "sandbox-runtime" }
154
56
  });
155
- return collapseFullyCoveredChildren({ candidates, selected: intersecting });
156
57
  }
157
- function getElementAnchor({
158
- element,
159
- selectionRect
160
- }) {
161
- const rect = element.getBoundingClientRect();
162
- return {
163
- x: Math.min(Math.max(selectionRect.left, rect.left), rect.right),
164
- y: Math.min(Math.max(selectionRect.top, rect.top), rect.bottom)
165
- };
58
+ function getElementAnchor(_args) {
59
+ throw canopyTombstoneError({
60
+ symbol: "getElementAnchor",
61
+ subpath: "editor/select-mode/interactions/selectionGeometry",
62
+ replacement: { kind: "sandbox-runtime" }
63
+ });
166
64
  }
167
- function getElementBoundingRect(element) {
168
- const rect = element.getBoundingClientRect();
169
- return {
170
- x: rect.x,
171
- y: rect.y,
172
- width: rect.width,
173
- height: rect.height,
174
- top: rect.top,
175
- right: rect.right,
176
- bottom: rect.bottom,
177
- left: rect.left
178
- };
65
+ function getElementBoundingRect(_element) {
66
+ throw canopyTombstoneError({
67
+ symbol: "getElementBoundingRect",
68
+ subpath: "editor/select-mode/interactions/selectionGeometry",
69
+ replacement: { kind: "sandbox-runtime" }
70
+ });
179
71
  }
180
72
  export {
181
73
  collectDragCandidates,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../editor/select-mode/interactions/selectionGeometry.ts"],
4
- "sourcesContent": ["import type {\n SelectModeBoundingRect,\n SelectModeClickPosition,\n} from \"schemas/generated/selectMode\";\n\nimport { isIntersecting, isRectEnclosing } from \"replo-utils/lib/geometry\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { isInlineTextMarkElement } from \"../inlineTextMarks\";\n\nexport type DragPosition = {\n clientX: number;\n clientY: number;\n pageX: number;\n pageY: number;\n};\n\nexport type ScrollOffset = {\n left: number;\n top: number;\n};\n\nexport type SelectedAreaState = {\n pageRect: SelectModeBoundingRect;\n};\n\n// NOTE (Noah, 2026-04-21): A small fudge factor so elements\n// that visually appear to touch the selection rect (but whose bounding\n// box is a pixel or two off due to borders/sub-pixel rendering) still get\n// included.\nconst SELECTION_TOLERANCE_PX = 4;\n\nfunction normalizeSelectionRect({\n startX,\n startY,\n endX,\n endY,\n}: {\n startX: number;\n startY: number;\n endX: number;\n endY: number;\n}): SelectModeBoundingRect {\n const left = Math.min(startX, endX);\n const right = Math.max(startX, endX);\n const top = Math.min(startY, endY);\n const bottom = Math.max(startY, endY);\n\n return {\n x: left,\n y: top,\n width: right - left,\n height: bottom - top,\n top,\n right,\n bottom,\n left,\n };\n}\n\n/**\n * @author Kevin O'Connell 2026-04-17\n */\nexport function getDragPositionFromClient({\n clientX,\n clientY,\n scrollOffset,\n}: {\n clientX: number;\n clientY: number;\n scrollOffset: ScrollOffset;\n}): DragPosition {\n return {\n clientX,\n clientY,\n pageX: clientX + scrollOffset.left,\n pageY: clientY + scrollOffset.top,\n };\n}\n\n/**\n * @author Kevin O'Connell 2026-04-17\n */\nexport function getDocumentScrollOffset(): ScrollOffset {\n const scrollingElement = document.scrollingElement;\n return {\n left: scrollingElement?.scrollLeft ?? window.scrollX,\n top: scrollingElement?.scrollTop ?? window.scrollY,\n };\n}\n\n/**\n * @author Kevin O'Connell 2026-04-17\n */\nexport function getViewportSelectionRect({\n dragStart,\n dragCurrent,\n scrollOffset,\n}: {\n dragStart: DragPosition;\n dragCurrent: DragPosition;\n scrollOffset: ScrollOffset;\n}): SelectModeBoundingRect {\n return normalizeSelectionRect({\n startX: dragStart.pageX - scrollOffset.left,\n startY: dragStart.pageY - scrollOffset.top,\n endX: dragCurrent.pageX - scrollOffset.left,\n endY: dragCurrent.pageY - scrollOffset.top,\n });\n}\n\n/**\n * @author Kevin O'Connell 2026-04-17\n */\nexport function getPageRectFromViewportRect({\n rect,\n scrollOffset,\n}: {\n rect: SelectModeBoundingRect;\n scrollOffset: ScrollOffset;\n}): SelectModeBoundingRect {\n return {\n x: rect.x + scrollOffset.left,\n y: rect.y + scrollOffset.top,\n width: rect.width,\n height: rect.height,\n left: rect.left + scrollOffset.left,\n top: rect.top + scrollOffset.top,\n right: rect.right + scrollOffset.left,\n bottom: rect.bottom + scrollOffset.top,\n };\n}\n\n/**\n * @author Kevin O'Connell 2026-04-17\n */\nexport function getViewportRectFromPageRect({\n rect,\n scrollOffset,\n}: {\n rect: SelectModeBoundingRect;\n scrollOffset: ScrollOffset;\n}): SelectModeBoundingRect {\n return {\n x: rect.x - scrollOffset.left,\n y: rect.y - scrollOffset.top,\n width: rect.width,\n height: rect.height,\n left: rect.left - scrollOffset.left,\n top: rect.top - scrollOffset.top,\n right: rect.right - scrollOffset.left,\n bottom: rect.bottom - scrollOffset.top,\n };\n}\n\nfunction isMeaningfulElement(\n element: Element,\n elementRect: SelectModeBoundingRect,\n): boolean {\n const tagName = element.tagName.toLowerCase();\n if ([\"html\", \"body\", \"script\", \"style\", \"meta\", \"link\"].includes(tagName)) {\n return false;\n }\n\n if (isInlineTextMarkElement(element)) {\n return false;\n }\n\n if (elementRect.width < 4 || elementRect.height < 4) {\n return false;\n }\n\n return true;\n}\n\n/**\n * A drag captures an element when their boxes overlap (within\n * `tolerancePx`) \u2014 but NOT when the drag sits entirely inside the\n * element. The latter case is the user dragging *within* a large\n * container (a section, `<main>`, `<body>`) to lasso its children; the\n * container itself isn't a thing they're trying to select, so we drop it.\n */\nexport function doesRectIntersectSelection({\n elementRect,\n selectionRect,\n tolerancePx,\n}: {\n elementRect: SelectModeBoundingRect;\n selectionRect: SelectModeBoundingRect;\n tolerancePx: number;\n}) {\n return (\n isIntersecting(elementRect, selectionRect, { tolerance: tolerancePx }) &&\n !isRectEnclosing(elementRect, selectionRect)\n );\n}\n\n// A meaningful element plus its page-coordinate rect and a stable id,\n// snapshotted once when a drag begins. Page coordinates are scroll-\n// invariant, so per-move hit-testing never needs to re-measure.\nexport type DragCandidate = {\n id: string;\n element: Element;\n pageRect: SelectModeBoundingRect;\n};\n\n/**\n * Snapshots every meaningful element and its page rect when a drag begins.\n * Each candidate gets a stable id so the parent overlay can key its\n * live highlights without remounting them as the drag moves.\n */\nexport function collectDragCandidates(\n scrollOffset: ScrollOffset,\n): DragCandidate[] {\n const candidates: DragCandidate[] = [];\n for (const element of Array.from(document.querySelectorAll(\"*\"))) {\n const viewportRect = getElementBoundingRect(element);\n if (!isMeaningfulElement(element, viewportRect)) {\n continue;\n }\n candidates.push({\n id: uuidv4(),\n element,\n pageRect: getPageRectFromViewportRect({\n rect: viewportRect,\n scrollOffset,\n }),\n });\n }\n return candidates;\n}\n\n/**\n * Drop a child whose parent is also selected and every one of that\n * parent's *candidate* children is selected: the parent already represents\n * the whole group, so the children are redundant. Returns only the\n * candidates that survive the collapse.\n *\n * Only children that are themselves drag candidates count toward \"fully\n * covered\". A parent's DOM children can include decorative / non-selectable\n * elements (and `.children` excludes text nodes); those can never be\n * selected, so counting them would wedge the check permanently false and\n * the collapse would never fire.\n *\n * Membership is read once up front, so the collapse cascades up the tree\n * in a single pass \u2014 a parent kept this round is itself dropped when *its*\n * parent is likewise fully covered, leaving only the topmost ancestor of\n * any fully-enclosed subtree.\n */\nfunction collapseFullyCoveredChildren({\n candidates,\n selected,\n}: {\n candidates: DragCandidate[];\n selected: DragCandidate[];\n}): DragCandidate[] {\n const candidateElements = new Set(\n candidates.map((candidate) => candidate.element),\n );\n const selectedElements = new Set(\n selected.map((candidate) => candidate.element),\n );\n return selected.filter((candidate) => {\n const parent = candidate.element.parentElement;\n if (!parent || !selectedElements.has(parent)) {\n return true;\n }\n const everyCandidateChildSelected = Array.from(parent.children)\n .filter((child) => candidateElements.has(child))\n .every((child) => selectedElements.has(child));\n return !everyCandidateChildSelected;\n });\n}\n\n/**\n * Cheap per-move hit-test against the pre-collected candidates: keep the\n * ones whose page rect overlaps the selection (excluding any that wholly\n * enclose it), then collapse any fully-covered parent/children group down\n * to just the parent (see `collapseFullyCoveredChildren`). Does no DOM\n * queries or re-measures of geometry \u2014 the only DOM reads are cheap\n * parent/child structural lookups.\n *\n * Because the collapse depends on which siblings are currently captured,\n * elements legitimately move in and out of the result as the drag grows or\n * shrinks: a child drops out the moment the drag swallows its last sibling\n * (the parent takes over), and reappears if the drag retreats.\n */\nexport function getCandidatesInSelection({\n candidates,\n selectionPageRect,\n}: {\n candidates: DragCandidate[];\n selectionPageRect: SelectModeBoundingRect;\n}): DragCandidate[] {\n const intersecting = candidates.filter((candidate) => {\n return doesRectIntersectSelection({\n elementRect: candidate.pageRect,\n selectionRect: selectionPageRect,\n tolerancePx: SELECTION_TOLERANCE_PX,\n });\n });\n\n return collapseFullyCoveredChildren({ candidates, selected: intersecting });\n}\n\n/**\n * Picks a \"click position\" for an element that fell inside an area\n * selection. We use the corner of the element nearest the top-left of the\n * selection rect, clamped to the element's own bounds. This anchor is what\n * lets the selected-element overlay continue to track the element when the\n * user scrolls (`useSelectionScrollSync` re-projects relative to it).\n *\n * @author Kevin O'Connell 2026-04-17\n */\nexport function getElementAnchor({\n element,\n selectionRect,\n}: {\n element: Element;\n selectionRect: SelectModeBoundingRect;\n}): SelectModeClickPosition {\n const rect = element.getBoundingClientRect();\n\n return {\n x: Math.min(Math.max(selectionRect.left, rect.left), rect.right),\n y: Math.min(Math.max(selectionRect.top, rect.top), rect.bottom),\n };\n}\n\n/**\n * @author Kevin O'Connell 2026-04-17\n */\nexport function getElementBoundingRect(\n element: Element,\n): SelectModeBoundingRect {\n const rect = element.getBoundingClientRect();\n\n return {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n };\n}\n"],
5
- "mappings": "AAKA,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,MAAM,cAAc;AAE7B,SAAS,+BAA+B;AAsBxC,MAAM,yBAAyB;AAE/B,SAAS,uBAAuB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAK2B;AACzB,QAAM,OAAO,KAAK,IAAI,QAAQ,IAAI;AAClC,QAAM,QAAQ,KAAK,IAAI,QAAQ,IAAI;AACnC,QAAM,MAAM,KAAK,IAAI,QAAQ,IAAI;AACjC,QAAM,SAAS,KAAK,IAAI,QAAQ,IAAI;AAEpC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,OAAO,QAAQ;AAAA,IACf,QAAQ,SAAS;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAKO,SAAS,0BAA0B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACF,GAIiB;AACf,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OAAO,UAAU,aAAa;AAAA,IAC9B,OAAO,UAAU,aAAa;AAAA,EAChC;AACF;AAKO,SAAS,0BAAwC;AACtD,QAAM,mBAAmB,SAAS;AAClC,SAAO;AAAA,IACL,MAAM,kBAAkB,cAAc,OAAO;AAAA,IAC7C,KAAK,kBAAkB,aAAa,OAAO;AAAA,EAC7C;AACF;AAKO,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AACF,GAI2B;AACzB,SAAO,uBAAuB;AAAA,IAC5B,QAAQ,UAAU,QAAQ,aAAa;AAAA,IACvC,QAAQ,UAAU,QAAQ,aAAa;AAAA,IACvC,MAAM,YAAY,QAAQ,aAAa;AAAA,IACvC,MAAM,YAAY,QAAQ,aAAa;AAAA,EACzC,CAAC;AACH;AAKO,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA;AACF,GAG2B;AACzB,SAAO;AAAA,IACL,GAAG,KAAK,IAAI,aAAa;AAAA,IACzB,GAAG,KAAK,IAAI,aAAa;AAAA,IACzB,OAAO,KAAK;AAAA,IACZ,QAAQ,KAAK;AAAA,IACb,MAAM,KAAK,OAAO,aAAa;AAAA,IAC/B,KAAK,KAAK,MAAM,aAAa;AAAA,IAC7B,OAAO,KAAK,QAAQ,aAAa;AAAA,IACjC,QAAQ,KAAK,SAAS,aAAa;AAAA,EACrC;AACF;AAKO,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA;AACF,GAG2B;AACzB,SAAO;AAAA,IACL,GAAG,KAAK,IAAI,aAAa;AAAA,IACzB,GAAG,KAAK,IAAI,aAAa;AAAA,IACzB,OAAO,KAAK;AAAA,IACZ,QAAQ,KAAK;AAAA,IACb,MAAM,KAAK,OAAO,aAAa;AAAA,IAC/B,KAAK,KAAK,MAAM,aAAa;AAAA,IAC7B,OAAO,KAAK,QAAQ,aAAa;AAAA,IACjC,QAAQ,KAAK,SAAS,aAAa;AAAA,EACrC;AACF;AAEA,SAAS,oBACP,SACA,aACS;AACT,QAAM,UAAU,QAAQ,QAAQ,YAAY;AAC5C,MAAI,CAAC,QAAQ,QAAQ,UAAU,SAAS,QAAQ,MAAM,EAAE,SAAS,OAAO,GAAG;AACzE,WAAO;AAAA,EACT;AAEA,MAAI,wBAAwB,OAAO,GAAG;AACpC,WAAO;AAAA,EACT;AAEA,MAAI,YAAY,QAAQ,KAAK,YAAY,SAAS,GAAG;AACnD,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AASO,SAAS,2BAA2B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SACE,eAAe,aAAa,eAAe,EAAE,WAAW,YAAY,CAAC,KACrE,CAAC,gBAAgB,aAAa,aAAa;AAE/C;AAgBO,SAAS,sBACd,cACiB;AACjB,QAAM,aAA8B,CAAC;AACrC,aAAW,WAAW,MAAM,KAAK,SAAS,iBAAiB,GAAG,CAAC,GAAG;AAChE,UAAM,eAAe,uBAAuB,OAAO;AACnD,QAAI,CAAC,oBAAoB,SAAS,YAAY,GAAG;AAC/C;AAAA,IACF;AACA,eAAW,KAAK;AAAA,MACd,IAAI,OAAO;AAAA,MACX;AAAA,MACA,UAAU,4BAA4B;AAAA,QACpC,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAmBA,SAAS,6BAA6B;AAAA,EACpC;AAAA,EACA;AACF,GAGoB;AAClB,QAAM,oBAAoB,IAAI;AAAA,IAC5B,WAAW,IAAI,CAAC,cAAc,UAAU,OAAO;AAAA,EACjD;AACA,QAAM,mBAAmB,IAAI;AAAA,IAC3B,SAAS,IAAI,CAAC,cAAc,UAAU,OAAO;AAAA,EAC/C;AACA,SAAO,SAAS,OAAO,CAAC,cAAc;AACpC,UAAM,SAAS,UAAU,QAAQ;AACjC,QAAI,CAAC,UAAU,CAAC,iBAAiB,IAAI,MAAM,GAAG;AAC5C,aAAO;AAAA,IACT;AACA,UAAM,8BAA8B,MAAM,KAAK,OAAO,QAAQ,EAC3D,OAAO,CAAC,UAAU,kBAAkB,IAAI,KAAK,CAAC,EAC9C,MAAM,CAAC,UAAU,iBAAiB,IAAI,KAAK,CAAC;AAC/C,WAAO,CAAC;AAAA,EACV,CAAC;AACH;AAeO,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AACF,GAGoB;AAClB,QAAM,eAAe,WAAW,OAAO,CAAC,cAAc;AACpD,WAAO,2BAA2B;AAAA,MAChC,aAAa,UAAU;AAAA,MACvB,eAAe;AAAA,MACf,aAAa;AAAA,IACf,CAAC;AAAA,EACH,CAAC;AAED,SAAO,6BAA6B,EAAE,YAAY,UAAU,aAAa,CAAC;AAC5E;AAWO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AACF,GAG4B;AAC1B,QAAM,OAAO,QAAQ,sBAAsB;AAE3C,SAAO;AAAA,IACL,GAAG,KAAK,IAAI,KAAK,IAAI,cAAc,MAAM,KAAK,IAAI,GAAG,KAAK,KAAK;AAAA,IAC/D,GAAG,KAAK,IAAI,KAAK,IAAI,cAAc,KAAK,KAAK,GAAG,GAAG,KAAK,MAAM;AAAA,EAChE;AACF;AAKO,SAAS,uBACd,SACwB;AACxB,QAAM,OAAO,QAAQ,sBAAsB;AAE3C,SAAO;AAAA,IACL,GAAG,KAAK;AAAA,IACR,GAAG,KAAK;AAAA,IACR,OAAO,KAAK;AAAA,IACZ,QAAQ,KAAK;AAAA,IACb,KAAK,KAAK;AAAA,IACV,OAAO,KAAK;AAAA,IACZ,QAAQ,KAAK;AAAA,IACb,MAAM,KAAK;AAAA,EACb;AACF;",
4
+ "sourcesContent": ["// eslint-disable-next-line no-unused-vars -- This type edge keeps the vendored geometry declaration reachable after tombstoning.\nimport type { GeometryRect } from \"replo-utils/lib/geometry\";\nimport type {\n SelectModeBoundingRect,\n SelectModeClickPosition,\n} from \"schemas/generated/selectMode\";\n\nimport { canopyTombstoneError } from \"../../../lib/tombstone\";\n\nexport type DragPosition = {\n clientX: number;\n clientY: number;\n pageX: number;\n pageY: number;\n};\n\nexport type ScrollOffset = {\n left: number;\n top: number;\n};\n\nexport type SelectedAreaState = {\n pageRect: SelectModeBoundingRect;\n};\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getDragPositionFromClient(_args: {\n clientX: number;\n clientY: number;\n scrollOffset: ScrollOffset;\n}): DragPosition {\n throw canopyTombstoneError({\n symbol: \"getDragPositionFromClient\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getDocumentScrollOffset(): ScrollOffset {\n throw canopyTombstoneError({\n symbol: \"getDocumentScrollOffset\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getViewportSelectionRect(_args: {\n dragStart: DragPosition;\n dragCurrent: DragPosition;\n scrollOffset: ScrollOffset;\n}): SelectModeBoundingRect {\n throw canopyTombstoneError({\n symbol: \"getViewportSelectionRect\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getPageRectFromViewportRect(_args: {\n rect: SelectModeBoundingRect;\n scrollOffset: ScrollOffset;\n}): SelectModeBoundingRect {\n throw canopyTombstoneError({\n symbol: \"getPageRectFromViewportRect\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getViewportRectFromPageRect(_args: {\n rect: SelectModeBoundingRect;\n scrollOffset: ScrollOffset;\n}): SelectModeBoundingRect {\n throw canopyTombstoneError({\n symbol: \"getViewportRectFromPageRect\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function doesRectIntersectSelection(_args: {\n elementRect: SelectModeBoundingRect;\n selectionRect: SelectModeBoundingRect;\n tolerancePx: number;\n}): boolean {\n throw canopyTombstoneError({\n symbol: \"doesRectIntersectSelection\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n// A meaningful element plus its page-coordinate rect and a stable id,\n// snapshotted once when a drag begins. Page coordinates are scroll-\n// invariant, so per-move hit-testing never needs to re-measure.\nexport type DragCandidate = {\n id: string;\n element: Element;\n pageRect: SelectModeBoundingRect;\n};\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function collectDragCandidates(\n _scrollOffset: ScrollOffset,\n): DragCandidate[] {\n throw canopyTombstoneError({\n symbol: \"collectDragCandidates\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getCandidatesInSelection(_args: {\n candidates: DragCandidate[];\n selectionPageRect: SelectModeBoundingRect;\n}): DragCandidate[] {\n throw canopyTombstoneError({\n symbol: \"getCandidatesInSelection\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getElementAnchor(_args: {\n element: Element;\n selectionRect: SelectModeBoundingRect;\n}): SelectModeClickPosition {\n throw canopyTombstoneError({\n symbol: \"getElementAnchor\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function getElementBoundingRect(\n _element: Element,\n): SelectModeBoundingRect {\n throw canopyTombstoneError({\n symbol: \"getElementBoundingRect\",\n subpath: \"editor/select-mode/interactions/selectionGeometry\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
5
+ "mappings": "AAOA,SAAS,4BAA4B;AAmB9B,SAAS,0BAA0B,OAIzB;AACf,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,0BAAwC;AACtD,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,yBAAyB,OAId;AACzB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,4BAA4B,OAGjB;AACzB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,4BAA4B,OAGjB;AACzB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,2BAA2B,OAI/B;AACV,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAYO,SAAS,sBACd,eACiB;AACjB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,yBAAyB,OAGrB;AAClB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,iBAAiB,OAGL;AAC1B,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,uBACd,UACwB;AACxB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
6
6
  "names": []
7
7
  }