@replohq/canopy-sdk 2.6.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_vendor/replo-utils/lib/fonts.mjs +1 -0
- package/_vendor/replo-utils/lib/geometry.mjs +2 -0
- package/_vendor/replo-utils/lib/json.mjs +1 -0
- package/_vendor/replo-utils/lib/misc.mjs +1 -0
- package/_vendor/replo-utils/lib/posthogReplay.mjs +2 -0
- package/_vendor/replo-utils/lib/url.mjs +1 -0
- package/_vendor/replo-utils/react/use-iframe-rpc-channel.mjs +1 -1
- package/_vendor/schemas/designLibrary.mjs +1 -1
- package/_vendor/schemas/generated/consent.d.ts +2 -0
- package/_vendor/schemas/generated/selectModeIframeRpc.d.ts +8 -0
- package/_vendor/schemas/iframeRpcChannel.mjs +2 -1
- package/_vendor/schemas/loaderKeys.d.ts +1 -1
- package/_vendor/schemas/loaderKeys.mjs +103 -23
- package/_vendor/schemas/money.mjs +1860 -3
- package/_vendor/schemas/pageAnnotations.mjs +1 -1
- package/_vendor/schemas/routing/match.mjs +1 -0
- package/_vendor/schemas/routing/rules.mjs +2 -1
- package/_vendor/schemas/selectMode.d.ts +4 -4
- package/_vendor/schemas/selectMode.mjs +1 -0
- package/_vendor/schemas/selectModeIframeRpc.d.ts +25 -5
- package/_vendor/schemas/selectModeIframeRpc.mjs +12 -3
- package/analytics/analytics-provider.d.ts +5 -10
- package/analytics/analytics-provider.js +14 -101
- package/analytics/analytics-provider.js.map +2 -2
- package/analytics/get-analytics-sinks.d.ts +2 -19
- package/analytics/get-analytics-sinks.js +9 -46
- package/analytics/get-analytics-sinks.js.map +2 -2
- package/analytics/hooks/use-product-viewed-analytics.d.ts +2 -6
- package/analytics/hooks/use-product-viewed-analytics.js +6 -28
- package/analytics/hooks/use-product-viewed-analytics.js.map +2 -2
- package/analytics/replo-first-party-pixel.d.ts +3 -12
- package/analytics/replo-first-party-pixel.js +8 -24
- package/analytics/replo-first-party-pixel.js.map +2 -2
- package/analytics/replo-pixel-script.d.ts +4 -10
- package/analytics/replo-pixel-script.js +9 -23
- package/analytics/replo-pixel-script.js.map +2 -2
- package/analytics/sinks/ga4-sink.d.ts +10 -9
- package/analytics/sinks/ga4-sink.js +99 -50
- package/analytics/sinks/ga4-sink.js.map +2 -2
- package/analytics/sinks/meta-sink.d.ts +5 -4
- package/analytics/sinks/meta-sink.js +82 -29
- package/analytics/sinks/meta-sink.js.map +2 -2
- package/analytics/sinks/pinterest-sink.d.ts +7 -6
- package/analytics/sinks/pinterest-sink.js +82 -49
- package/analytics/sinks/pinterest-sink.js.map +2 -2
- package/analytics/sinks/reddit-sink.d.ts +8 -7
- package/analytics/sinks/reddit-sink.js +82 -53
- package/analytics/sinks/reddit-sink.js.map +2 -2
- package/analytics/sinks/replo-sink.d.ts +9 -8
- package/analytics/sinks/replo-sink.js +89 -37
- package/analytics/sinks/replo-sink.js.map +2 -2
- package/analytics/sinks/snapchat-sink.d.ts +6 -5
- package/analytics/sinks/snapchat-sink.js +82 -40
- package/analytics/sinks/snapchat-sink.js.map +2 -2
- package/analytics/sinks/tiktok-sink.d.ts +8 -7
- package/analytics/sinks/tiktok-sink.js +82 -52
- package/analytics/sinks/tiktok-sink.js.map +2 -2
- package/analytics/sinks/window-sink.d.ts +11 -14
- package/analytics/sinks/window-sink.js +101 -28
- package/analytics/sinks/window-sink.js.map +2 -2
- package/analytics/utils/analytics-utils.d.ts +4 -2
- package/analytics/utils/analytics-utils.js +19 -123
- package/analytics/utils/analytics-utils.js.map +2 -2
- package/analytics/utils/navigation-tracker.d.ts +2 -1
- package/analytics/utils/navigation-tracker.js +37 -30
- package/analytics/utils/navigation-tracker.js.map +2 -2
- package/analytics/utils/shopify-funnel-gate.d.ts +2 -7
- package/analytics/utils/shopify-funnel-gate.js +8 -15
- package/analytics/utils/shopify-funnel-gate.js.map +2 -2
- package/cart/buy-now-action.d.ts +2 -9
- package/cart/buy-now-action.js +5 -97
- package/cart/buy-now-action.js.map +2 -2
- package/cart/cart-actions.d.ts +12 -56
- package/cart/cart-actions.js +88 -68
- package/cart/cart-actions.js.map +2 -2
- package/cart/cart-loader.d.ts +3 -9
- package/cart/cart-loader.js +14 -6
- package/cart/cart-loader.js.map +2 -2
- package/cart/cart-provider.d.ts +6 -58
- package/cart/cart-provider.js +13 -359
- package/cart/cart-provider.js.map +3 -3
- package/cart/cart-schema.d.ts +2 -1
- package/cart/cart-schema.js +12 -64
- package/cart/cart-schema.js.map +2 -2
- package/cart/cart-types.d.ts +1 -1
- package/cart/cart-types.js +5 -4
- package/cart/cart-types.js.map +2 -2
- package/cart/gateways/cart-constants.d.ts +1 -0
- package/cart/gateways/cart-constants.js.map +2 -2
- package/cart/gateways/cart-gateway.d.ts +1 -0
- package/cart/gateways/cart-gateway.js +13 -12
- package/cart/gateways/cart-gateway.js.map +2 -2
- package/cart/gateways/cookie-cart-gateway.d.ts +8 -11
- package/cart/gateways/cookie-cart-gateway.js +93 -97
- package/cart/gateways/cookie-cart-gateway.js.map +2 -2
- package/cart/gateways/default-cart-gateway.d.ts +10 -16
- package/cart/gateways/default-cart-gateway.js +13 -23
- package/cart/gateways/default-cart-gateway.js.map +2 -2
- package/cart/gateways/resolver-cart-gateway.d.ts +1 -0
- package/cart/gateways/resolver-cart-gateway.js +13 -102
- package/cart/gateways/resolver-cart-gateway.js.map +2 -2
- package/cart/gateways/stripe-cart-gateway.d.ts +10 -16
- package/cart/gateways/stripe-cart-gateway.js +13 -21
- package/cart/gateways/stripe-cart-gateway.js.map +2 -2
- package/cart/hooks/use-add-to-cart.d.ts +3 -47
- package/cart/hooks/use-add-to-cart.js +10 -115
- package/cart/hooks/use-add-to-cart.js.map +2 -2
- package/cart/hooks/use-buy-now.d.ts +1 -39
- package/cart/hooks/use-buy-now.js +5 -55
- package/cart/hooks/use-buy-now.js.map +2 -2
- package/cart/utils/cart-utils.d.ts +8 -35
- package/cart/utils/cart-utils.js +21 -35
- package/cart/utils/cart-utils.js.map +2 -2
- package/cart/utils/cookie-cart-persistence.d.ts +16 -41
- package/cart/utils/cookie-cart-persistence.js +38 -143
- package/cart/utils/cookie-cart-persistence.js.map +2 -2
- package/cart/utils/variant-to-cart-line.d.ts +12 -42
- package/cart/utils/variant-to-cart-line.js +31 -147
- package/cart/utils/variant-to-cart-line.js.map +2 -2
- package/chunk-UJCSKKID.mjs +27 -0
- package/{chunk-OFU2QEDR.mjs → chunk-ZZPQ3E7S.mjs} +50 -5
- package/consent/consent-action.d.ts +2 -1
- package/consent/consent-action.js +10 -20
- package/consent/consent-action.js.map +2 -2
- package/consent/consent-actions.d.ts +2 -13
- package/consent/consent-actions.js +9 -29
- package/consent/consent-actions.js.map +2 -2
- package/consent/consent-store.d.ts +9 -36
- package/consent/consent-store.js +12 -182
- package/consent/consent-store.js.map +2 -2
- package/consent/cookie.d.ts +9 -12
- package/consent/cookie.js +32 -64
- package/consent/cookie.js.map +2 -2
- package/consent/replo-scripts.d.ts +5 -18
- package/consent/replo-scripts.js +11 -94
- package/consent/replo-scripts.js.map +2 -2
- package/consent/script-registration-store.d.ts +6 -2
- package/consent/script-registration-store.js +33 -47
- package/consent/script-registration-store.js.map +2 -2
- package/consent/script-snippets.d.ts +4 -18
- package/consent/script-snippets.js +19 -127
- package/consent/script-snippets.js.map +2 -2
- package/consent/window-api.d.ts +4 -15
- package/consent/window-api.js +8 -63
- package/consent/window-api.js.map +2 -2
- package/editor/ClientErrorBoundary.d.ts +4 -10
- package/editor/ClientErrorBoundary.js +7 -55
- package/editor/ClientErrorBoundary.js.map +2 -2
- package/editor/DocumentReadyBeacon.d.ts +3 -1
- package/editor/DocumentReadyBeacon.js +6 -3
- package/editor/DocumentReadyBeacon.js.map +2 -2
- package/editor/LinkInterceptor.d.ts +1 -0
- package/editor/LinkInterceptor.js +6 -121
- package/editor/LinkInterceptor.js.map +2 -2
- package/editor/NextErrorReporter.d.ts +1 -0
- package/editor/NextErrorReporter.js +6 -85
- package/editor/NextErrorReporter.js.map +2 -2
- package/editor/annotations/AnnotationLayerMount.d.ts +1 -0
- package/editor/annotations/AnnotationLayerMount.js +6 -6
- package/editor/annotations/AnnotationLayerMount.js.map +2 -2
- package/editor/annotations/annotationController.d.ts +1 -0
- package/editor/annotations/annotationController.js +6 -378
- package/editor/annotations/annotationController.js.map +2 -2
- package/editor/annotations/bridgeGate.d.ts +4 -7
- package/editor/annotations/bridgeGate.js +13 -15
- package/editor/annotations/bridgeGate.js.map +2 -2
- package/editor/design-library-preview/DesignLibraryPreview.d.ts +1 -0
- package/editor/design-library-preview/DesignLibraryPreview.js +6 -86
- package/editor/design-library-preview/DesignLibraryPreview.js.map +2 -2
- package/editor/posthog-relay.d.ts +1 -10
- package/editor/posthog-relay.js +6 -65
- package/editor/posthog-relay.js.map +2 -2
- package/editor/select-mode/EditorSelection.d.ts +1 -23
- package/editor/select-mode/EditorSelection.js +5 -87
- package/editor/select-mode/EditorSelection.js.map +2 -2
- package/editor/select-mode/annotationFrames.d.ts +9 -9
- package/editor/select-mode/annotationFrames.js +22 -103
- package/editor/select-mode/annotationFrames.js.map +2 -2
- package/editor/select-mode/descriptor/elementDescriptor.d.ts +6 -21
- package/editor/select-mode/descriptor/elementDescriptor.js +19 -192
- package/editor/select-mode/descriptor/elementDescriptor.js.map +3 -3
- package/editor/select-mode/descriptor/styleExtraction.d.ts +4 -2
- package/editor/select-mode/descriptor/styleExtraction.js +11 -262
- package/editor/select-mode/descriptor/styleExtraction.js.map +2 -2
- package/editor/select-mode/displayModeStore.d.ts +2 -0
- package/editor/select-mode/displayModeStore.js +14 -39
- package/editor/select-mode/displayModeStore.js.map +2 -2
- package/editor/select-mode/fast-refresh-relay.d.ts +2 -1
- package/editor/select-mode/fast-refresh-relay.js +7 -28
- package/editor/select-mode/fast-refresh-relay.js.map +2 -2
- package/editor/select-mode/fiber.d.ts +14 -7
- package/editor/select-mode/fiber.js +40 -286
- package/editor/select-mode/fiber.js.map +2 -2
- package/editor/select-mode/hooks/useCrosshairCursor.d.ts +2 -9
- package/editor/select-mode/hooks/useCrosshairCursor.js +7 -15
- package/editor/select-mode/hooks/useCrosshairCursor.js.map +2 -2
- package/editor/select-mode/hooks/useEditModeStateMachine.d.ts +5 -3
- package/editor/select-mode/hooks/useEditModeStateMachine.js +13 -228
- package/editor/select-mode/hooks/useEditModeStateMachine.js.map +2 -2
- package/editor/select-mode/hooks/useOptimisticOverrides.d.ts +2 -1
- package/editor/select-mode/hooks/useOptimisticOverrides.js +6 -277
- package/editor/select-mode/hooks/useOptimisticOverrides.js.map +2 -2
- package/editor/select-mode/hooks/useParentMessaging.d.ts +2 -20
- package/editor/select-mode/hooks/useParentMessaging.js +7 -69
- package/editor/select-mode/hooks/useParentMessaging.js.map +2 -2
- package/editor/select-mode/hooks/useSelectModeController.d.ts +2 -1
- package/editor/select-mode/hooks/useSelectModeController.js +6 -40
- package/editor/select-mode/hooks/useSelectModeController.js.map +2 -2
- package/editor/select-mode/hooks/useSelectionHover.d.ts +2 -16
- package/editor/select-mode/hooks/useSelectionHover.js +7 -105
- package/editor/select-mode/hooks/useSelectionHover.js.map +2 -2
- package/editor/select-mode/hooks/useSelectionInteractions.d.ts +2 -26
- package/editor/select-mode/hooks/useSelectionInteractions.js +7 -348
- package/editor/select-mode/hooks/useSelectionInteractions.js.map +2 -2
- package/editor/select-mode/hooks/useSelectionScrollSync.d.ts +2 -22
- package/editor/select-mode/hooks/useSelectionScrollSync.js +7 -65
- package/editor/select-mode/hooks/useSelectionScrollSync.js.map +2 -2
- package/editor/select-mode/hooks/useSiblingResolution.d.ts +4 -2
- package/editor/select-mode/hooks/useSiblingResolution.js +13 -52
- package/editor/select-mode/hooks/useSiblingResolution.js.map +2 -2
- package/editor/select-mode/iframeRpcChannel.d.ts +10 -349
- package/editor/select-mode/iframeRpcChannel.js +23 -79
- package/editor/select-mode/iframeRpcChannel.js.map +2 -2
- package/editor/select-mode/inlineTextMarks.d.ts +4 -6
- package/editor/select-mode/inlineTextMarks.js +13 -18
- package/editor/select-mode/inlineTextMarks.js.map +2 -2
- package/editor/select-mode/interactions/selectionGeometry.d.ts +19 -61
- package/editor/select-mode/interactions/selectionGeometry.js +57 -165
- package/editor/select-mode/interactions/selectionGeometry.js.map +2 -2
- package/editor/select-mode/selectModeSession.d.ts +1 -0
- package/editor/select-mode/selectModeSession.js +6 -3
- package/editor/select-mode/selectModeSession.js.map +2 -2
- package/editor/select-mode/selectionFrame.d.ts +9 -60
- package/editor/select-mode/selectionFrame.js +28 -116
- package/editor/select-mode/selectionFrame.js.map +2 -2
- package/editor/select-mode/symbolicate.d.ts +2 -1
- package/editor/select-mode/symbolicate.js +7 -195
- package/editor/select-mode/symbolicate.js.map +2 -2
- package/editor/select-mode/tiptapInlineEditor.d.ts +15 -2
- package/editor/select-mode/tiptapInlineEditor.js +6 -114
- package/editor/select-mode/tiptapInlineEditor.js.map +2 -2
- package/env.d.ts +2 -1
- package/env.js +10 -37
- package/env.js.map +2 -2
- package/gateways/canopy-api.d.ts +15 -12
- package/gateways/canopy-api.js +122 -160
- package/gateways/canopy-api.js.map +2 -2
- package/hooks/use-client-value.d.ts +2 -10
- package/hooks/use-client-value.js +10 -7
- package/hooks/use-client-value.js.map +2 -2
- package/hooks/use-formatted-price.d.ts +1 -14
- package/hooks/use-formatted-price.js +6 -14
- package/hooks/use-formatted-price.js.map +2 -2
- package/lib/canopy-error.d.ts +2 -5
- package/lib/canopy-error.js +10 -14
- package/lib/canopy-error.js.map +2 -2
- package/lib/get-query-client.d.ts +2 -1
- package/lib/get-query-client.js +8 -27
- package/lib/get-query-client.js.map +2 -2
- package/lib/integration-utils.d.ts +1 -0
- package/lib/integration-utils.js +9 -3
- package/lib/integration-utils.js.map +2 -2
- package/lib/shopify-utils.d.ts +2 -10
- package/lib/shopify-utils.js +10 -2
- package/lib/shopify-utils.js.map +2 -2
- package/lib/tombstone.d.ts +21 -0
- package/lib/tombstone.js +99 -0
- package/lib/tombstone.js.map +7 -0
- package/lib/url-utils.d.ts +2 -4
- package/lib/url-utils.js +10 -3
- package/lib/url-utils.js.map +2 -2
- package/loaders/collection-loader.d.ts +3 -2
- package/loaders/collection-loader.js +5 -48
- package/loaders/collection-loader.js.map +2 -2
- package/loaders/collection-products-loader.d.ts +3 -2
- package/loaders/collection-products-loader.js +5 -51
- package/loaders/collection-products-loader.js.map +2 -2
- package/loaders/contentful-entries-loader.d.ts +3 -2
- package/loaders/contentful-entries-loader.js +5 -71
- package/loaders/contentful-entries-loader.js.map +2 -2
- package/loaders/contentful-entry-loader.d.ts +3 -2
- package/loaders/contentful-entry-loader.js +5 -53
- package/loaders/contentful-entry-loader.js.map +2 -2
- package/loaders/invoke-loader-action.d.ts +2 -8
- package/loaders/invoke-loader-action.js +13 -8
- package/loaders/invoke-loader-action.js.map +2 -2
- package/loaders/invoke-loader-server.d.ts +2 -14
- package/loaders/invoke-loader-server.js +12 -34
- package/loaders/invoke-loader-server.js.map +2 -2
- package/loaders/invoke-loader.d.ts +6 -12
- package/loaders/invoke-loader.js +27 -29
- package/loaders/invoke-loader.js.map +2 -2
- package/loaders/levanta-product-loader.d.ts +3 -2
- package/loaders/levanta-product-loader.js +5 -46
- package/loaders/levanta-product-loader.js.map +2 -2
- package/loaders/loader-error-boundary.d.ts +9 -15
- package/loaders/loader-error-boundary.js +50 -13
- package/loaders/loader-error-boundary.js.map +2 -2
- package/loaders/loader-keys.d.ts +4 -12
- package/loaders/loader-keys.js +6 -1
- package/loaders/loader-keys.js.map +2 -2
- package/loaders/loader-schemas.d.ts +142 -61
- package/loaders/loader-schemas.js +253 -90
- package/loaders/loader-schemas.js.map +2 -2
- package/loaders/metaobject-loader.d.ts +3 -2
- package/loaders/metaobject-loader.js +5 -47
- package/loaders/metaobject-loader.js.map +2 -2
- package/loaders/metaobjects-loader.d.ts +3 -2
- package/loaders/metaobjects-loader.js +5 -53
- package/loaders/metaobjects-loader.js.map +2 -2
- package/loaders/okendo-review-aggregate-loader.d.ts +9 -10
- package/loaders/okendo-review-aggregate-loader.js +5 -49
- package/loaders/okendo-review-aggregate-loader.js.map +2 -2
- package/loaders/okendo-reviews-loader.d.ts +8 -16
- package/loaders/okendo-reviews-loader.js +5 -47
- package/loaders/okendo-reviews-loader.js.map +2 -2
- package/loaders/prefetch-loaders.d.ts +4 -26
- package/loaders/prefetch-loaders.js +5 -40
- package/loaders/prefetch-loaders.js.map +2 -2
- package/loaders/preview-placeholder.d.ts +8 -22
- package/loaders/preview-placeholder.js +47 -209
- package/loaders/preview-placeholder.js.map +2 -2
- package/loaders/product-loader-args.d.ts +2 -11
- package/loaders/product-loader-args.js +6 -12
- package/loaders/product-loader-args.js.map +2 -2
- package/loaders/product-loader.d.ts +3 -2
- package/loaders/product-loader.js +5 -45
- package/loaders/product-loader.js.map +2 -2
- package/loaders/rebuy-recommendations-loader.d.ts +8 -157
- package/loaders/rebuy-recommendations-loader.js +5 -50
- package/loaders/rebuy-recommendations-loader.js.map +2 -2
- package/loaders/reviews-io-review-aggregate-loader.d.ts +5 -4
- package/loaders/reviews-io-review-aggregate-loader.js +5 -36
- package/loaders/reviews-io-review-aggregate-loader.js.map +2 -2
- package/loaders/reviews-io-reviews-loader.d.ts +5 -4
- package/loaders/reviews-io-reviews-loader.js +5 -58
- package/loaders/reviews-io-reviews-loader.js.map +2 -2
- package/loaders/smile-earning-rules-loader.d.ts +10 -11
- package/loaders/smile-earning-rules-loader.js +5 -37
- package/loaders/smile-earning-rules-loader.js.map +2 -2
- package/loaders/smile-rewards-loader.d.ts +10 -11
- package/loaders/smile-rewards-loader.js +5 -37
- package/loaders/smile-rewards-loader.js.map +2 -2
- package/loaders/smile-vip-tiers-loader.d.ts +9 -10
- package/loaders/smile-vip-tiers-loader.js +5 -36
- package/loaders/smile-vip-tiers-loader.js.map +2 -2
- package/loaders/statsig-experiment-loader.d.ts +3 -8
- package/loaders/statsig-experiment-loader.js +5 -74
- package/loaders/statsig-experiment-loader.js.map +2 -2
- package/loaders/vendor-loader-keys.d.ts +4 -0
- package/loaders/vendor-loader-keys.js +9 -0
- package/loaders/vendor-loader-keys.js.map +7 -0
- package/loaders/yotpo-review-aggregate-loader.d.ts +5 -4
- package/loaders/yotpo-review-aggregate-loader.js +5 -43
- package/loaders/yotpo-review-aggregate-loader.js.map +2 -2
- package/loaders/yotpo-reviews-loader.d.ts +5 -4
- package/loaders/yotpo-reviews-loader.js +5 -58
- package/loaders/yotpo-reviews-loader.js.map +2 -2
- package/money.d.ts +9 -9
- package/money.js +25 -6
- package/money.js.map +2 -2
- package/next/config.d.ts +3 -1
- package/next/config.js +11 -85
- package/next/config.js.map +2 -2
- package/next/image-loader.d.ts +2 -1
- package/next/image-loader.js +7 -47
- package/next/image-loader.js.map +2 -2
- package/next/open-next.d.ts +4 -2
- package/next/open-next.js +6 -19
- package/next/open-next.js.map +2 -2
- package/orders/order-status-schema.d.ts +28 -13
- package/orders/order-status-schema.js +45 -13
- package/orders/order-status-schema.js.map +2 -2
- package/orders/order-status.d.ts +2 -8
- package/orders/order-status.js +6 -36
- package/orders/order-status.js.map +2 -2
- package/package.json +1 -12
- package/providers/query-provider.d.ts +3 -1
- package/providers/query-provider.js +10 -6
- package/providers/query-provider.js.map +2 -2
- package/providers/replo-provider.d.ts +3 -1
- package/providers/replo-provider.js +6 -37
- package/providers/replo-provider.js.map +2 -2
- package/routing/evaluate.d.ts +3 -3
- package/routing/evaluate.js +5 -40
- package/routing/evaluate.js.map +2 -2
- package/routing/rules.d.ts +3 -11
- package/routing/rules.js +7 -1
- 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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
3
|
+
throw canopyTombstoneError({
|
|
4
|
+
symbol: "getSelectModeIframeRpcChannel",
|
|
5
|
+
subpath: "editor/select-mode/iframeRpcChannel",
|
|
6
|
+
replacement: { kind: "sandbox-runtime" }
|
|
7
|
+
});
|
|
65
8
|
}
|
|
66
|
-
function setSelectModeParentHandlers(
|
|
67
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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": ["
|
|
5
|
-
"mappings": "
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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": ["
|
|
5
|
-
"mappings": "
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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": ["
|
|
5
|
-
"mappings": "
|
|
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
|
}
|