@replohq/canopy-sdk 2.6.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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 +4 -4
- package/_vendor/schemas/selectModeIframeRpc.mjs +1 -0
- 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,7 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
export declare function isAllowedEditorOrigin(origin: string): boolean;
|
|
7
|
-
export declare function isAllowedEditorMessage(event: MessageEvent): boolean;
|
|
1
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
2
|
+
export declare function isAllowedEditorOrigin(_origin: string): boolean;
|
|
3
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
4
|
+
export declare function isAllowedEditorMessage(_event: MessageEvent): boolean;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
];
|
|
9
|
-
function isAllowedEditorOrigin(origin) {
|
|
10
|
-
return ALLOWED_EDITOR_ORIGIN_PATTERNS.some((pattern) => pattern.test(origin));
|
|
1
|
+
import { canopyTombstoneError } from "../../lib/tombstone";
|
|
2
|
+
function isAllowedEditorOrigin(_origin) {
|
|
3
|
+
throw canopyTombstoneError({
|
|
4
|
+
symbol: "isAllowedEditorOrigin",
|
|
5
|
+
subpath: "editor/annotations/bridgeGate",
|
|
6
|
+
replacement: { kind: "sandbox-runtime" }
|
|
7
|
+
});
|
|
11
8
|
}
|
|
12
|
-
function isAllowedEditorMessage(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
function isAllowedEditorMessage(_event) {
|
|
10
|
+
throw canopyTombstoneError({
|
|
11
|
+
symbol: "isAllowedEditorMessage",
|
|
12
|
+
subpath: "editor/annotations/bridgeGate",
|
|
13
|
+
replacement: { kind: "sandbox-runtime" }
|
|
14
|
+
});
|
|
17
15
|
}
|
|
18
16
|
export {
|
|
19
17
|
isAllowedEditorMessage,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../editor/annotations/bridgeGate.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { canopyTombstoneError } from \"../../lib/tombstone\";\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function isAllowedEditorOrigin(_origin: string): boolean {\n throw canopyTombstoneError({\n symbol: \"isAllowedEditorOrigin\",\n subpath: \"editor/annotations/bridgeGate\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function isAllowedEditorMessage(_event: MessageEvent): boolean {\n throw canopyTombstoneError({\n symbol: \"isAllowedEditorMessage\",\n subpath: \"editor/annotations/bridgeGate\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,4BAA4B;AAG9B,SAAS,sBAAsB,SAA0B;AAC9D,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;AAGO,SAAS,uBAAuB,QAA+B;AACpE,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,91 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { buildGoogleFontsCssUrl } from "../../_vendor/replo-utils/lib/fonts.mjs";
|
|
4
|
-
import { designLibraryPreviewMessageSchema } from "../../_vendor/schemas/designLibrary.mjs";
|
|
5
|
-
const FONT_LINK_DATA_KEY = "reploDesignLibraryFont";
|
|
6
|
-
function escapeCssString(value) {
|
|
7
|
-
return value.replace(/\\/gu, "\\\\").replace(/'/gu, "\\'");
|
|
8
|
-
}
|
|
2
|
+
import { canopyTombstoneError } from "../../lib/tombstone";
|
|
9
3
|
function DesignLibraryPreview() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const handleMessage = (event) => {
|
|
16
|
-
const parsed = designLibraryPreviewMessageSchema.safeParse(event.data);
|
|
17
|
-
if (!parsed.success) return;
|
|
18
|
-
const { cssVars, fonts, defaultFontCssVar } = parsed.data;
|
|
19
|
-
const root = document.documentElement;
|
|
20
|
-
const nextVars = { ...cssVars };
|
|
21
|
-
for (const font of fonts) {
|
|
22
|
-
nextVars[font.cssVar] = `'${escapeCssString(font.family)}'`;
|
|
23
|
-
}
|
|
24
|
-
const owned = ownedKeys.current ?? /* @__PURE__ */ new Set();
|
|
25
|
-
for (const key of owned) {
|
|
26
|
-
if (!(key in nextVars)) root.style.removeProperty(key);
|
|
27
|
-
}
|
|
28
|
-
ownedKeys.current = new Set(Object.keys(nextVars));
|
|
29
|
-
for (const [key, value] of Object.entries(nextVars)) {
|
|
30
|
-
root.style.setProperty(key, value);
|
|
31
|
-
}
|
|
32
|
-
const customFonts = fonts.filter((font) => Boolean(font.faceUrl));
|
|
33
|
-
const googleFonts = fonts.filter((font) => !font.faceUrl);
|
|
34
|
-
const links = ownedFontLinks.current ?? /* @__PURE__ */ new Map();
|
|
35
|
-
const nextHrefs = new Set(
|
|
36
|
-
googleFonts.map((font) => buildGoogleFontsCssUrl(font.family))
|
|
37
|
-
);
|
|
38
|
-
for (const [href, link] of links) {
|
|
39
|
-
if (!nextHrefs.has(href)) {
|
|
40
|
-
link.remove();
|
|
41
|
-
links.delete(href);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
for (const href of nextHrefs) {
|
|
45
|
-
if (links.has(href)) continue;
|
|
46
|
-
const link = document.createElement("link");
|
|
47
|
-
link.rel = "stylesheet";
|
|
48
|
-
link.href = href;
|
|
49
|
-
link.dataset[FONT_LINK_DATA_KEY] = "";
|
|
50
|
-
document.head.append(link);
|
|
51
|
-
links.set(href, link);
|
|
52
|
-
}
|
|
53
|
-
ownedFontLinks.current = links;
|
|
54
|
-
const faces = ownedFontFaces.current ?? /* @__PURE__ */ new Map();
|
|
55
|
-
const nextFamilies = new Set(customFonts.map((font) => font.family));
|
|
56
|
-
for (const [family, entry] of faces) {
|
|
57
|
-
if (!nextFamilies.has(family)) {
|
|
58
|
-
entry.style.remove();
|
|
59
|
-
faces.delete(family);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
for (const font of customFonts) {
|
|
63
|
-
if (!font.faceUrl) continue;
|
|
64
|
-
const existing = faces.get(font.family);
|
|
65
|
-
if (existing?.url === font.faceUrl) continue;
|
|
66
|
-
existing?.style.remove();
|
|
67
|
-
const style = document.createElement("style");
|
|
68
|
-
style.dataset[FONT_LINK_DATA_KEY] = "";
|
|
69
|
-
const format = font.format ? ` format('${escapeCssString(font.format)}')` : "";
|
|
70
|
-
style.textContent = `@font-face{font-family:'${escapeCssString(font.family)}';font-weight:400;font-style:normal;src:url('${escapeCssString(font.faceUrl)}')${format};font-display:swap;}`;
|
|
71
|
-
document.head.append(style);
|
|
72
|
-
faces.set(font.family, { url: font.faceUrl, style });
|
|
73
|
-
}
|
|
74
|
-
ownedFontFaces.current = faces;
|
|
75
|
-
if (defaultFontCssVar) {
|
|
76
|
-
root.style.setProperty("font-family", `var(${defaultFontCssVar})`);
|
|
77
|
-
ownsDefaultFont.current = true;
|
|
78
|
-
} else if (ownsDefaultFont.current) {
|
|
79
|
-
root.style.removeProperty("font-family");
|
|
80
|
-
ownsDefaultFont.current = false;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
window.addEventListener("message", handleMessage);
|
|
84
|
-
return () => {
|
|
85
|
-
window.removeEventListener("message", handleMessage);
|
|
86
|
-
};
|
|
87
|
-
}, []);
|
|
88
|
-
return null;
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "DesignLibraryPreview",
|
|
6
|
+
subpath: "editor/design-library-preview/DesignLibraryPreview",
|
|
7
|
+
replacement: { kind: "sandbox-runtime" }
|
|
8
|
+
});
|
|
89
9
|
}
|
|
90
10
|
export {
|
|
91
11
|
DesignLibraryPreview
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../editor/design-library-preview/DesignLibraryPreview.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\n// eslint-disable-next-line no-unused-vars -- This type edge keeps the vendored font declaration reachable after tombstoning.\nimport type { buildGoogleFontsCssUrl } from \"replo-utils/lib/fonts\";\n// eslint-disable-next-line no-unused-vars -- This type edge keeps the vendored design-library declaration reachable after tombstoning.\nimport type { designLibraryPreviewMessageSchema } from \"schemas/designLibrary\";\n\nimport { canopyTombstoneError } from \"../../lib/tombstone\";\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function DesignLibraryPreview(): null {\n throw canopyTombstoneError({\n symbol: \"DesignLibraryPreview\",\n subpath: \"editor/design-library-preview/DesignLibraryPreview\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,4BAA4B;AAG9B,SAAS,uBAA6B;AAC3C,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
init: (apiKey: string, config: Record<string, unknown>) => void;
|
|
3
|
-
sessionRecordingStarted: () => boolean;
|
|
4
|
-
}
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
posthog?: PostHog;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
10
2
|
export default function PostHogRelay(): null;
|
|
11
|
-
export {};
|
package/editor/posthog-relay.js
CHANGED
|
@@ -1,70 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { startChildPostHogReplaySnapshotRelay } from "../_vendor/replo-utils/lib/posthogReplay.mjs";
|
|
4
|
-
const POSTHOG_API_KEY = "phc_dRETsj85vNkKrvQQszEFRBibH5kUF9l7rbjACuKPanZ";
|
|
5
|
-
const POSTHOG_API_HOST = "https://d99bbtllqsaif.cloudfront.net";
|
|
6
|
-
let initPromise = null;
|
|
7
|
-
function loadPostHogScript() {
|
|
8
|
-
return new Promise((resolve) => {
|
|
9
|
-
if (window.posthog) {
|
|
10
|
-
resolve();
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const script = document.createElement("script");
|
|
14
|
-
script.src = `${POSTHOG_API_HOST}/static/array.js`;
|
|
15
|
-
script.async = true;
|
|
16
|
-
script.addEventListener("load", () => resolve());
|
|
17
|
-
script.addEventListener("error", () => {
|
|
18
|
-
resolve();
|
|
19
|
-
console.warn("[PostHog Relay] Failed to load PostHog script");
|
|
20
|
-
});
|
|
21
|
-
document.head.append(script);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function initPostHogRelay() {
|
|
25
|
-
if (window.self === window.top) {
|
|
26
|
-
return Promise.resolve();
|
|
27
|
-
}
|
|
28
|
-
if (initPromise) {
|
|
29
|
-
return initPromise;
|
|
30
|
-
}
|
|
31
|
-
initPromise = (async () => {
|
|
32
|
-
await loadPostHogScript();
|
|
33
|
-
if (!window.posthog) {
|
|
34
|
-
initPromise = null;
|
|
35
|
-
console.warn("[PostHog Relay] PostHog not available after script load");
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
window.posthog.init(POSTHOG_API_KEY, {
|
|
39
|
-
api_host: POSTHOG_API_HOST,
|
|
40
|
-
persistence: "localStorage",
|
|
41
|
-
autocapture: false,
|
|
42
|
-
// (Noah, 2026-07-14, REPL-29305): Disable performance capture — its PerformanceObserver
|
|
43
|
-
// relays a non-cloneable PerformanceServerTiming across the iframe boundary via postMessage,
|
|
44
|
-
// throwing a DataCloneError in the preview. Matches the bedrock-sdk relay.
|
|
45
|
-
capture_performance: false,
|
|
46
|
-
capture_pageview: false,
|
|
47
|
-
session_recording: {
|
|
48
|
-
recordCrossOriginIframes: true,
|
|
49
|
-
// NOTE (Nick, 2026-02-02, REPL-23284): Disable canvas recording to prevent SecurityError on tainted canvases
|
|
50
|
-
captureCanvas: { recordCanvas: false }
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
})();
|
|
54
|
-
return initPromise;
|
|
55
|
-
}
|
|
2
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
56
3
|
function PostHogRelay() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
targetWindow: window
|
|
63
|
-
});
|
|
64
|
-
void initPostHogRelay();
|
|
65
|
-
return stopRelayingSnapshotRequests;
|
|
66
|
-
}, []);
|
|
67
|
-
return null;
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "PostHogRelay",
|
|
6
|
+
subpath: "editor/posthog-relay",
|
|
7
|
+
replacement: { kind: "sandbox-runtime" }
|
|
8
|
+
});
|
|
68
9
|
}
|
|
69
10
|
export {
|
|
70
11
|
PostHogRelay as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../editor/posthog-relay.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\n
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\n// eslint-disable-next-line no-unused-vars -- This type edge keeps the vendored PostHog relay declaration reachable after tombstoning.\nimport type { startChildPostHogReplaySnapshotRelay } from \"replo-utils/lib/posthogReplay\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport default function PostHogRelay(): null {\n throw canopyTombstoneError({\n symbol: \"PostHogRelay\",\n subpath: \"editor/posthog-relay\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAKA,SAAS,4BAA4B;AAGtB,SAAR,eAAsC;AAC3C,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mounts the iframe-side selectMode controller. This is a render-less
|
|
3
|
-
* component — every responsibility is delegated to a dedicated hook so each
|
|
4
|
-
* concern (parent messaging, cursor styling, pointer interactions, hover
|
|
5
|
-
* tracking, scroll syncing) can be read in isolation:
|
|
6
|
-
*
|
|
7
|
-
* - `useParentMessaging` — inbound messages from the parent (set mode,
|
|
8
|
-
* set selection type) + outbound `IFRAME_READY` handshake.
|
|
9
|
-
* - `useCrosshairCursor` — crosshair cursor + disable text/drag selection
|
|
10
|
-
* while in selection mode.
|
|
11
|
-
* - `useSelectionInteractions` — pointer-down / move / up state machine
|
|
12
|
-
* that produces `ELEMENT_SELECTED`, `AREA_SELECTED`, and live
|
|
13
|
-
* `DRAG_RECT_UPDATED` messages.
|
|
14
|
-
* - `useSelectionHover` — hover-element rect updates.
|
|
15
|
-
* - `useSelectionScrollSync` — keeps the parent overlay aligned with the
|
|
16
|
-
* selected element/area when the iframe scrolls.
|
|
17
|
-
*
|
|
18
|
-
* The `interactionSessionRef` is the single source of truth for the
|
|
19
|
-
* in-progress drag/selection — every hook reads/writes it via ref so we
|
|
20
|
-
* don't trigger React re-renders during interaction-heavy operations.
|
|
21
|
-
*
|
|
22
|
-
* @author Kevin O'Connell 2026-04-17
|
|
23
|
-
*/
|
|
1
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
24
2
|
export declare function EditorSelection(): null;
|
|
@@ -1,93 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { buildElementDescriptor } from "./descriptor/elementDescriptor";
|
|
4
|
-
import { installFastRefreshRelay } from "./fast-refresh-relay";
|
|
5
|
-
import { useCrosshairCursor } from "./hooks/useCrosshairCursor";
|
|
6
|
-
import { useEditModeStateMachine } from "./hooks/useEditModeStateMachine";
|
|
7
|
-
import { useOptimisticOverrides } from "./hooks/useOptimisticOverrides";
|
|
8
|
-
import { useParentMessaging } from "./hooks/useParentMessaging";
|
|
9
|
-
import { useSelectionHover } from "./hooks/useSelectionHover";
|
|
10
|
-
import { useSelectionInteractions } from "./hooks/useSelectionInteractions";
|
|
11
|
-
import { useSelectionScrollSync } from "./hooks/useSelectionScrollSync";
|
|
12
|
-
import { useSelectModeController } from "./hooks/useSelectModeController";
|
|
13
|
-
import { getWebsiteBuilderRpc } from "./iframeRpcChannel";
|
|
14
|
-
import { symbolicateSelectedElement } from "./symbolicate";
|
|
2
|
+
import { canopyTombstoneError } from "../../lib/tombstone";
|
|
15
3
|
function EditorSelection() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
setSelectionType
|
|
21
|
-
} = useSelectModeController();
|
|
22
|
-
const { beginEditing, editingElementRef, formatCommand, revert } = useEditModeStateMachine({
|
|
23
|
-
displayMode,
|
|
24
|
-
interactionSessionRef
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "EditorSelection",
|
|
6
|
+
subpath: "editor/select-mode/EditorSelection",
|
|
7
|
+
replacement: { kind: "sandbox-runtime" }
|
|
25
8
|
});
|
|
26
|
-
const {
|
|
27
|
-
applyOptimisticUpdate,
|
|
28
|
-
markCommitted,
|
|
29
|
-
reapplyOverrides,
|
|
30
|
-
resolveSessionOverrides,
|
|
31
|
-
revertOverride
|
|
32
|
-
} = useOptimisticOverrides();
|
|
33
|
-
const postSelectedElementSnapshot = useCallback(() => {
|
|
34
|
-
const session = interactionSessionRef.current;
|
|
35
|
-
if (session.type !== "element") {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const selectedElement = session.data.kind === "react-element" ? document.querySelector(session.data.selector) : null;
|
|
39
|
-
const element = selectedElement ?? session.element;
|
|
40
|
-
if (!(element instanceof Element) || !element.isConnected) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const descriptor = buildElementDescriptor({
|
|
44
|
-
element,
|
|
45
|
-
clickPosition: session.clickPosition ?? (session.data.kind === "react-element" ? session.data.clickPosition : { x: 0, y: 0 }),
|
|
46
|
-
siblingSelectors: session.data.kind === "react-element" ? session.data.siblingSelectors : []
|
|
47
|
-
});
|
|
48
|
-
if (descriptor.kind !== "react-element") {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
interactionSessionRef.current = {
|
|
52
|
-
...session,
|
|
53
|
-
element,
|
|
54
|
-
data: descriptor
|
|
55
|
-
};
|
|
56
|
-
void symbolicateSelectedElement(descriptor).then((symbolicated) => {
|
|
57
|
-
getWebsiteBuilderRpc()?.elementSelected({ data: symbolicated });
|
|
58
|
-
});
|
|
59
|
-
}, [interactionSessionRef]);
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
installFastRefreshRelay({
|
|
62
|
-
onComplete: () => {
|
|
63
|
-
reapplyOverrides({ skipElement: editingElementRef.current });
|
|
64
|
-
postSelectedElementSnapshot();
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}, [editingElementRef, postSelectedElementSnapshot, reapplyOverrides]);
|
|
68
|
-
useParentMessaging({
|
|
69
|
-
applyOptimisticUpdate,
|
|
70
|
-
markCommitted,
|
|
71
|
-
onExitEditMode: revert,
|
|
72
|
-
onFormatCommand: formatCommand,
|
|
73
|
-
resolveSessionOverrides,
|
|
74
|
-
revertOverride,
|
|
75
|
-
setDisplayMode,
|
|
76
|
-
setSelectionType
|
|
77
|
-
});
|
|
78
|
-
useCrosshairCursor({ displayMode });
|
|
79
|
-
useSelectionInteractions({
|
|
80
|
-
displayMode,
|
|
81
|
-
editingElementRef,
|
|
82
|
-
interactionSessionRef,
|
|
83
|
-
onBeginEditing: beginEditing
|
|
84
|
-
});
|
|
85
|
-
useSelectionHover({ displayMode, interactionSessionRef });
|
|
86
|
-
useSelectionScrollSync({
|
|
87
|
-
displayMode,
|
|
88
|
-
interactionSessionRef
|
|
89
|
-
});
|
|
90
|
-
return null;
|
|
91
9
|
}
|
|
92
10
|
export {
|
|
93
11
|
EditorSelection
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../editor/select-mode/EditorSelection.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport {
|
|
5
|
-
"mappings": ";AAEA,SAAS,
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport { canopyTombstoneError } from \"../../lib/tombstone\";\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function EditorSelection(): null {\n throw canopyTombstoneError({\n symbol: \"EditorSelection\",\n subpath: \"editor/select-mode/EditorSelection\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAEA,SAAS,4BAA4B;AAG9B,SAAS,kBAAwB;AACtC,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export declare const ANNOTATION_CONTAINER_ID = "replo-annotation-frames";
|
|
2
1
|
interface AnnotationRect {
|
|
3
2
|
x: number;
|
|
4
3
|
y: number;
|
|
5
4
|
width: number;
|
|
6
5
|
height: number;
|
|
7
6
|
}
|
|
7
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
8
|
+
export declare const ANNOTATION_CONTAINER_ID = "replo-annotation-frames";
|
|
8
9
|
export interface AnnotationFrameSpec {
|
|
9
10
|
id: string;
|
|
10
11
|
pageRect: AnnotationRect;
|
|
@@ -19,15 +20,14 @@ export interface AnnotationFrameSpec {
|
|
|
19
20
|
isActive: boolean;
|
|
20
21
|
onBadgeClick: () => void;
|
|
21
22
|
}
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
export declare function
|
|
28
|
-
export declare function getAnnotationBadgeViewportRect(id: string): AnnotationRect | null;
|
|
29
|
-
export declare function showAnnotationFrames({ frames, }: {
|
|
23
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
24
|
+
export declare function setActiveAnnotationBadge(_id: string | null): void;
|
|
25
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
26
|
+
export declare function getAnnotationBadgeViewportRect(_id: string): AnnotationRect | null;
|
|
27
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
28
|
+
export declare function showAnnotationFrames(_args: {
|
|
30
29
|
frames: AnnotationFrameSpec[];
|
|
31
30
|
}): void;
|
|
31
|
+
/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */
|
|
32
32
|
export declare function clearAnnotationFrames(): void;
|
|
33
33
|
export {};
|
|
@@ -1,113 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { canopyTombstoneError } from "../../lib/tombstone";
|
|
2
2
|
const ANNOTATION_CONTAINER_ID = "replo-annotation-frames";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (document.getElementById(ANNOTATION_FONT_STYLE_ID)) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const style = document.createElement("style");
|
|
12
|
-
style.id = ANNOTATION_FONT_STYLE_ID;
|
|
13
|
-
style.textContent = `@font-face{font-family:"PP Editorial New";src:url("${EDITORIAL_ITALIC_FONT_URL}") format("woff2");font-weight:normal;font-style:italic;font-display:swap;}`;
|
|
14
|
-
document.head.append(style);
|
|
15
|
-
}
|
|
16
|
-
const badgeNodesById = /* @__PURE__ */ new Map();
|
|
17
|
-
let activeBadgeId = null;
|
|
18
|
-
function badgeRestingTransform(id) {
|
|
19
|
-
return id === activeBadgeId ? "scale(1.15)" : "scale(1)";
|
|
20
|
-
}
|
|
21
|
-
function setActiveAnnotationBadge(id) {
|
|
22
|
-
activeBadgeId = id;
|
|
23
|
-
for (const [badgeId, badge] of badgeNodesById) {
|
|
24
|
-
badge.style.transform = badgeRestingTransform(badgeId);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function getAnnotationBadgeViewportRect(id) {
|
|
28
|
-
const badge = badgeNodesById.get(id);
|
|
29
|
-
if (!badge?.isConnected) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const rect = badge.getBoundingClientRect();
|
|
33
|
-
return { x: rect.x, y: rect.y, width: rect.width, height: rect.height };
|
|
34
|
-
}
|
|
35
|
-
function createFrameNode(spec) {
|
|
36
|
-
const frame = document.createElement("div");
|
|
37
|
-
frame.style.cssText = [
|
|
38
|
-
`position: ${spec.positioning}`,
|
|
39
|
-
`left: ${spec.pageRect.x}px`,
|
|
40
|
-
`top: ${spec.pageRect.y}px`,
|
|
41
|
-
"width: 0",
|
|
42
|
-
"height: 0",
|
|
43
|
-
"pointer-events: none",
|
|
44
|
-
"margin: 0",
|
|
45
|
-
"padding: 0"
|
|
46
|
-
].join(";");
|
|
47
|
-
const badge = document.createElement("button");
|
|
48
|
-
badge.type = "button";
|
|
49
|
-
badge.setAttribute("aria-label", spec.badgeAriaLabel);
|
|
50
|
-
badge.textContent = spec.badgeLabel;
|
|
51
|
-
badge.style.cssText = [
|
|
52
|
-
"position: absolute",
|
|
53
|
-
`left: ${spec.badgeCenter.x - spec.pageRect.x - BADGE_SIZE_PX / 2}px`,
|
|
54
|
-
`top: ${spec.badgeCenter.y - spec.pageRect.y - BADGE_SIZE_PX / 2}px`,
|
|
55
|
-
`width: ${BADGE_SIZE_PX}px`,
|
|
56
|
-
`height: ${BADGE_SIZE_PX}px`,
|
|
57
|
-
"display: flex",
|
|
58
|
-
"align-items: center",
|
|
59
|
-
"justify-content: center",
|
|
60
|
-
"border: none",
|
|
61
|
-
"border-radius: 50%",
|
|
62
|
-
`background: ${spec.colorHex}`,
|
|
63
|
-
"color: #ffffff",
|
|
64
|
-
`font: ${BADGE_FONT}`,
|
|
65
|
-
"box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.18)",
|
|
66
|
-
`transform: scale(${spec.isActive ? 1.15 : 1})`,
|
|
67
|
-
"transition: transform 120ms ease-out",
|
|
68
|
-
"cursor: pointer",
|
|
69
|
-
"pointer-events: auto",
|
|
70
|
-
"margin: 0",
|
|
71
|
-
"padding: 0 0 1px 0"
|
|
72
|
-
].join(";");
|
|
73
|
-
badge.addEventListener("pointerdown", () => {
|
|
74
|
-
badge.style.transform = "scale(0.9)";
|
|
3
|
+
function setActiveAnnotationBadge(_id) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "setActiveAnnotationBadge",
|
|
6
|
+
subpath: "editor/select-mode/annotationFrames",
|
|
7
|
+
replacement: { kind: "sandbox-runtime" }
|
|
75
8
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
badge.addEventListener("click", (event) => {
|
|
83
|
-
event.stopPropagation();
|
|
84
|
-
spec.onBadgeClick();
|
|
9
|
+
}
|
|
10
|
+
function getAnnotationBadgeViewportRect(_id) {
|
|
11
|
+
throw canopyTombstoneError({
|
|
12
|
+
symbol: "getAnnotationBadgeViewportRect",
|
|
13
|
+
subpath: "editor/select-mode/annotationFrames",
|
|
14
|
+
replacement: { kind: "sandbox-runtime" }
|
|
85
15
|
});
|
|
86
|
-
frame.append(badge);
|
|
87
|
-
badgeNodesById.set(spec.id, badge);
|
|
88
|
-
return frame;
|
|
89
16
|
}
|
|
90
|
-
function showAnnotationFrames({
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
zIndex: 2147483645
|
|
17
|
+
function showAnnotationFrames(_args) {
|
|
18
|
+
throw canopyTombstoneError({
|
|
19
|
+
symbol: "showAnnotationFrames",
|
|
20
|
+
subpath: "editor/select-mode/annotationFrames",
|
|
21
|
+
replacement: { kind: "sandbox-runtime" }
|
|
96
22
|
});
|
|
97
|
-
if (!container) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
ensureBadgeFont();
|
|
101
|
-
activeBadgeId = frames.find((spec) => spec.isActive)?.id ?? null;
|
|
102
|
-
badgeNodesById.clear();
|
|
103
|
-
container.replaceChildren(...frames.map((spec) => createFrameNode(spec)));
|
|
104
23
|
}
|
|
105
24
|
function clearAnnotationFrames() {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
25
|
+
throw canopyTombstoneError({
|
|
26
|
+
symbol: "clearAnnotationFrames",
|
|
27
|
+
subpath: "editor/select-mode/annotationFrames",
|
|
28
|
+
replacement: { kind: "sandbox-runtime" }
|
|
29
|
+
});
|
|
111
30
|
}
|
|
112
31
|
export {
|
|
113
32
|
ANNOTATION_CONTAINER_ID,
|