@replohq/canopy-sdk 2.5.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +2 -13
- 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,6 +1,6 @@
|
|
|
1
|
+
import '../../chunk-UJCSKKID.mjs';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
|
|
3
|
-
// ../schemas/pageAnnotations.ts
|
|
4
4
|
var PAGE_ANNOTATIONS_PROTOCOL_VERSION = 1;
|
|
5
5
|
var pageAnnotationColorSchema = z.enum(["red", "purple", "amber"]).describe("PageAnnotationColor");
|
|
6
6
|
var pageAnnotationPlacementSchema = z.enum(["element", "pageTop"]).describe("PageAnnotationPlacement");
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { getParamSegment, getRouteParams, hasRouteParam, matchSource } from '../../../chunk-VPEVERWE.mjs';
|
|
2
2
|
import { parseUrl } from '../../../chunk-2GKD6VTQ.mjs';
|
|
3
3
|
import '../../../chunk-AKZNN7F2.mjs';
|
|
4
|
-
import { ReploError } from '../../../chunk-
|
|
4
|
+
import { ReploError } from '../../../chunk-ZZPQ3E7S.mjs';
|
|
5
5
|
import '../../../chunk-H36NDYLG.mjs';
|
|
6
6
|
import '../../../chunk-ILGEM42C.mjs';
|
|
7
7
|
import '../../../chunk-FNTGY7I5.mjs';
|
|
8
|
+
import '../../../chunk-UJCSKKID.mjs';
|
|
8
9
|
import { z } from 'zod';
|
|
9
10
|
|
|
10
11
|
var RedirectRuleValidationError = class extends ReploError {
|
|
@@ -170,14 +170,14 @@ export declare const selectablePlanDataSchema: z.ZodObject<{
|
|
|
170
170
|
}, z.core.$strip>;
|
|
171
171
|
}, z.core.$strip>;
|
|
172
172
|
export declare const selectablePlanPayloadSchema: z.ZodObject<{
|
|
173
|
-
label: z.ZodString;
|
|
174
173
|
kind: z.ZodLiteral<"plan">;
|
|
175
174
|
planId: z.ZodString;
|
|
175
|
+
label: z.ZodString;
|
|
176
176
|
}, z.core.$strip>;
|
|
177
177
|
export declare const selectableDataPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
178
|
-
label: z.ZodString;
|
|
179
178
|
kind: z.ZodLiteral<"plan">;
|
|
180
179
|
planId: z.ZodString;
|
|
180
|
+
label: z.ZodString;
|
|
181
181
|
}, z.core.$strip>], "kind">;
|
|
182
182
|
export declare const selectableDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
183
183
|
kind: z.ZodLiteral<"react-element">;
|
|
@@ -261,9 +261,9 @@ export declare function transformSelectableData({ data, offset, }: {
|
|
|
261
261
|
offset: RectOffset;
|
|
262
262
|
}): SelectableData;
|
|
263
263
|
export declare function readSelectablePayload(rawPayload: string | null): {
|
|
264
|
-
label: string;
|
|
265
264
|
kind: "plan";
|
|
266
265
|
planId: string;
|
|
266
|
+
label: string;
|
|
267
267
|
} | null;
|
|
268
268
|
export declare const selectModeOptimisticUpdatePayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
269
269
|
kind: z.ZodLiteral<"css">;
|
|
@@ -309,9 +309,9 @@ export declare const selectModeFormatCommandSchema: z.ZodEnum<{
|
|
|
309
309
|
*/
|
|
310
310
|
export declare const selectModeSelectionTypeSchema: z.ZodEnum<{
|
|
311
311
|
none: "none";
|
|
312
|
-
drag: "drag";
|
|
313
312
|
element: "element";
|
|
314
313
|
area: "area";
|
|
314
|
+
drag: "drag";
|
|
315
315
|
}>;
|
|
316
316
|
/**
|
|
317
317
|
* Parent-side selection state mirrored from messages the iframe posts
|
|
@@ -137,9 +137,9 @@ export declare const websiteBuilderToCanopyMethodConfig: {
|
|
|
137
137
|
inputSchema: z.ZodObject<{
|
|
138
138
|
selectionType: z.ZodEnum<{
|
|
139
139
|
none: "none";
|
|
140
|
-
drag: "drag";
|
|
141
140
|
element: "element";
|
|
142
141
|
area: "area";
|
|
142
|
+
drag: "drag";
|
|
143
143
|
}>;
|
|
144
144
|
}, z.core.$strip>;
|
|
145
145
|
outputSchema: z.ZodVoid;
|
|
@@ -178,8 +178,8 @@ export declare const websiteBuilderToCanopyMethodConfig: {
|
|
|
178
178
|
inputSchema: z.ZodObject<{
|
|
179
179
|
sessionId: z.ZodString;
|
|
180
180
|
outcome: z.ZodEnum<{
|
|
181
|
-
failed: "failed";
|
|
182
181
|
persisted: "persisted";
|
|
182
|
+
failed: "failed";
|
|
183
183
|
}>;
|
|
184
184
|
}, z.core.$strip>;
|
|
185
185
|
outputSchema: z.ZodVoid;
|
|
@@ -565,9 +565,9 @@ export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
565
565
|
data: z.ZodObject<{
|
|
566
566
|
selectionType: z.ZodEnum<{
|
|
567
567
|
none: "none";
|
|
568
|
-
drag: "drag";
|
|
569
568
|
element: "element";
|
|
570
569
|
area: "area";
|
|
570
|
+
drag: "drag";
|
|
571
571
|
}>;
|
|
572
572
|
}, z.core.$strip>;
|
|
573
573
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -603,8 +603,8 @@ export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
603
603
|
data: z.ZodObject<{
|
|
604
604
|
sessionId: z.ZodString;
|
|
605
605
|
outcome: z.ZodEnum<{
|
|
606
|
-
failed: "failed";
|
|
607
606
|
persisted: "persisted";
|
|
607
|
+
failed: "failed";
|
|
608
608
|
}>;
|
|
609
609
|
}, z.core.$strip>;
|
|
610
610
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -3,6 +3,7 @@ import '../../chunk-VKO7P3ED.mjs';
|
|
|
3
3
|
import '../../chunk-H36NDYLG.mjs';
|
|
4
4
|
import '../../chunk-ILGEM42C.mjs';
|
|
5
5
|
import '../../chunk-FNTGY7I5.mjs';
|
|
6
|
+
import '../../chunk-UJCSKKID.mjs';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
|
|
8
9
|
var SELECT_MODE_IFRAME_RPC_CHANNEL_ID = "replo:select-mode-iframe-rpc";
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { CheckoutProvider } from "../lib/integration-utils";
|
|
3
3
|
import type { AnalyticsSink } from "./analytics-sink";
|
|
4
|
-
|
|
4
|
+
/** @deprecated Use AnalyticsProvider from @replohq/sdk/analytics/analytics-provider. */
|
|
5
|
+
export declare function AnalyticsProvider(_props: React.PropsWithChildren<{
|
|
5
6
|
checkoutProvider?: CheckoutProvider;
|
|
6
|
-
}>):
|
|
7
|
-
/**
|
|
8
|
-
* Returns the AnalyticsSink from the nearest AnalyticsProvider.
|
|
9
|
-
* Throws if used outside of an AnalyticsProvider.
|
|
10
|
-
*/
|
|
7
|
+
}>): React.ReactElement;
|
|
8
|
+
/** @deprecated Use useAnalytics from @replohq/sdk/analytics/analytics-provider. */
|
|
11
9
|
export declare function useAnalytics(): AnalyticsSink | null;
|
|
12
|
-
/**
|
|
13
|
-
* Returns the AnalyticsSink if an AnalyticsProvider is present, or null otherwise.
|
|
14
|
-
* Does not throw -- safe to use in components that may render with or without analytics.
|
|
15
|
-
*/
|
|
10
|
+
/** @deprecated Use useAnalyticsOptional from @replohq/sdk/analytics/analytics-provider. */
|
|
16
11
|
export declare function useAnalyticsOptional(): AnalyticsSink | null;
|
|
@@ -1,109 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function combineSinks(sinks) {
|
|
9
|
-
const broadcast = async (method, ...args) => {
|
|
10
|
-
if (typeof window !== "undefined") {
|
|
11
|
-
console.debug(
|
|
12
|
-
"[analytics] broadcast",
|
|
13
|
-
method,
|
|
14
|
-
"to",
|
|
15
|
-
sinks.length,
|
|
16
|
-
"sinks",
|
|
17
|
-
{ args }
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
await Promise.all(
|
|
21
|
-
sinks.map(async (sink) => {
|
|
22
|
-
try {
|
|
23
|
-
const sinkMethod = sink[method];
|
|
24
|
-
await sinkMethod.apply(sink, args);
|
|
25
|
-
} catch {
|
|
26
|
-
if (typeof window !== "undefined") {
|
|
27
|
-
console.warn("[analytics] sink error", { method, sink });
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
return {
|
|
34
|
-
pageView: (...args) => broadcast("pageView", ...args),
|
|
35
|
-
purchase: (...args) => broadcast("purchase", ...args),
|
|
36
|
-
click: (...args) => broadcast("click", ...args),
|
|
37
|
-
productViewed: (...args) => broadcast("productViewed", ...args),
|
|
38
|
-
addToCart: (...args) => broadcast("addToCart", ...args),
|
|
39
|
-
removeFromCart: (...args) => broadcast("removeFromCart", ...args),
|
|
40
|
-
viewCart: (...args) => broadcast("viewCart", ...args),
|
|
41
|
-
startCheckout: (...args) => broadcast("startCheckout", ...args),
|
|
42
|
-
viewCollection: (...args) => broadcast("viewCollection", ...args)
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
const AnalyticsContext = createContext(null);
|
|
46
|
-
function AnalyticsProvider({
|
|
47
|
-
children,
|
|
48
|
-
checkoutProvider
|
|
49
|
-
}) {
|
|
50
|
-
const consent = useConsent();
|
|
51
|
-
const registeredScripts = useRegisteredScripts();
|
|
52
|
-
const analytics = useMemo(() => {
|
|
53
|
-
return combineSinks(
|
|
54
|
-
getAnalyticsSinks({
|
|
55
|
-
consent: {
|
|
56
|
-
mode: consent.mode,
|
|
57
|
-
categories: consent.categories,
|
|
58
|
-
decidedAt: consent.decidedAt
|
|
59
|
-
},
|
|
60
|
-
registeredScripts,
|
|
61
|
-
checkoutProvider
|
|
62
|
-
})
|
|
63
|
-
);
|
|
64
|
-
}, [
|
|
65
|
-
consent.mode,
|
|
66
|
-
consent.categories,
|
|
67
|
-
consent.decidedAt,
|
|
68
|
-
registeredScripts,
|
|
69
|
-
checkoutProvider
|
|
70
|
-
]);
|
|
71
|
-
const analyticsRef = useRef(analytics);
|
|
72
|
-
analyticsRef.current = analytics;
|
|
73
|
-
const navigationTracker = useRef(null);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (typeof window === "undefined") {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
navigationTracker.current = new NavigationTracker(
|
|
79
|
-
(metadata) => {
|
|
80
|
-
void analyticsRef.current.pageView(metadata);
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
navigationTracker.current.init();
|
|
84
|
-
return () => {
|
|
85
|
-
navigationTracker.current?.cleanup();
|
|
86
|
-
};
|
|
87
|
-
}, []);
|
|
88
|
-
return /* @__PURE__ */ jsx(AnalyticsContext.Provider, { value: { analytics }, children });
|
|
89
|
-
}
|
|
90
|
-
class AnalyticsContextError extends Error {
|
|
91
|
-
constructor({ message }) {
|
|
92
|
-
super(message);
|
|
93
|
-
}
|
|
2
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
3
|
+
function AnalyticsProvider(_props) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "AnalyticsProvider",
|
|
6
|
+
subpath: "analytics/analytics-provider"
|
|
7
|
+
});
|
|
94
8
|
}
|
|
95
9
|
function useAnalytics() {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return context.analytics;
|
|
10
|
+
throw canopyTombstoneError({
|
|
11
|
+
symbol: "useAnalytics",
|
|
12
|
+
subpath: "analytics/analytics-provider"
|
|
13
|
+
});
|
|
103
14
|
}
|
|
104
15
|
function useAnalyticsOptional() {
|
|
105
|
-
|
|
106
|
-
|
|
16
|
+
throw canopyTombstoneError({
|
|
17
|
+
symbol: "useAnalyticsOptional",
|
|
18
|
+
subpath: "analytics/analytics-provider"
|
|
19
|
+
});
|
|
107
20
|
}
|
|
108
21
|
export {
|
|
109
22
|
AnalyticsProvider,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../analytics/analytics-provider.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport type React from \"react\";\nimport type { CheckoutProvider } from \"../lib/integration-utils\";\nimport type { AnalyticsSink } from \"./analytics-sink\";\nimport
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type React from \"react\";\nimport type { CheckoutProvider } from \"../lib/integration-utils\";\nimport type { AnalyticsSink } from \"./analytics-sink\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\n/** @deprecated Use AnalyticsProvider from @replohq/sdk/analytics/analytics-provider. */\nexport function AnalyticsProvider(\n _props: React.PropsWithChildren<{ checkoutProvider?: CheckoutProvider }>,\n): React.ReactElement {\n throw canopyTombstoneError({\n symbol: \"AnalyticsProvider\",\n subpath: \"analytics/analytics-provider\",\n });\n}\n\n/** @deprecated Use useAnalytics from @replohq/sdk/analytics/analytics-provider. */\nexport function useAnalytics(): AnalyticsSink | null {\n throw canopyTombstoneError({\n symbol: \"useAnalytics\",\n subpath: \"analytics/analytics-provider\",\n });\n}\n\n/** @deprecated Use useAnalyticsOptional from @replohq/sdk/analytics/analytics-provider. */\nexport function useAnalyticsOptional(): AnalyticsSink | null {\n throw canopyTombstoneError({\n symbol: \"useAnalyticsOptional\",\n subpath: \"analytics/analytics-provider\",\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,4BAA4B;AAG9B,SAAS,kBACd,QACoB;AACpB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,EACX,CAAC;AACH;AAGO,SAAS,eAAqC;AACnD,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,EACX,CAAC;AACH;AAGO,SAAS,uBAA6C;AAC3D,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,EACX,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,25 +2,8 @@ import type { ConsentState } from "../consent/consent-store";
|
|
|
2
2
|
import type { RegisteredScript } from "../consent/script-registration-store";
|
|
3
3
|
import type { CheckoutProvider } from "../lib/integration-utils";
|
|
4
4
|
import type { AnalyticsSink } from "./analytics-sink";
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
* state and which managed scripts are registered on the page.
|
|
8
|
-
*
|
|
9
|
-
* Consent gates data egress, not in-page plumbing:
|
|
10
|
-
* - `WindowSink` is a local `CustomEvent` bus (no data leaves the device), so it
|
|
11
|
-
* always ships regardless of consent. Its consumers self-gate: managed pixels
|
|
12
|
-
* are already gated at the injection layer (they never mount without consent,
|
|
13
|
-
* so they never subscribe), and unmanaged custom scripts are the author's
|
|
14
|
-
* responsibility.
|
|
15
|
-
* - `ReploSink` forwards into Replo's first-party analytics pipeline (real
|
|
16
|
-
* egress / processing), so it counts as `analytics`-category tracking and is
|
|
17
|
-
* gated by that consent. It is an implicit sink this scaffold always ships
|
|
18
|
-
* (not tied to a registered entry) and is never editable in the miniapp.
|
|
19
|
-
*
|
|
20
|
-
* Third-party provider sinks are created only when a matching `<ReploScripts>`
|
|
21
|
-
* entry is registered AND its required consent is granted.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getAnalyticsSinks({ consent, registeredScripts, checkoutProvider, }: {
|
|
5
|
+
/** @deprecated Use a supported public @replohq/sdk API for this domain; getAnalyticsSinks has no direct replacement. */
|
|
6
|
+
export declare function getAnalyticsSinks(_args: {
|
|
24
7
|
consent: ConsentState;
|
|
25
8
|
registeredScripts: RegisteredScript[];
|
|
26
9
|
checkoutProvider?: CheckoutProvider;
|
|
@@ -1,50 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { WindowSink } from "./sinks/window-sink";
|
|
10
|
-
import { gateShopifyOwnedFunnelEvents } from "./utils/shopify-funnel-gate";
|
|
11
|
-
const PROVIDER_SINK_FACTORIES = {
|
|
12
|
-
GA4: () => new GA4Sink(),
|
|
13
|
-
Meta: () => new MetaSink(),
|
|
14
|
-
TikTok: () => new TikTokSink(),
|
|
15
|
-
Snapchat: () => new SnapchatSink(),
|
|
16
|
-
Pinterest: () => new PinterestSink(),
|
|
17
|
-
Reddit: () => new RedditSink()
|
|
18
|
-
};
|
|
19
|
-
function getAnalyticsSinks({
|
|
20
|
-
consent,
|
|
21
|
-
registeredScripts,
|
|
22
|
-
checkoutProvider
|
|
23
|
-
}) {
|
|
24
|
-
const sinks = [new WindowSink()];
|
|
25
|
-
const firstPartyAllowed = consent.mode === "off" || consent.categories.analytics;
|
|
26
|
-
if (firstPartyAllowed) {
|
|
27
|
-
sinks.push(new ReploSink());
|
|
28
|
-
}
|
|
29
|
-
const shopifyOwnsCheckout = checkoutProvider === "shopify";
|
|
30
|
-
const addedTypes = /* @__PURE__ */ new Set();
|
|
31
|
-
for (const script of registeredScripts) {
|
|
32
|
-
const factory = PROVIDER_SINK_FACTORIES[script.type];
|
|
33
|
-
if (!factory || addedTypes.has(script.type)) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (isConsentAllowed({
|
|
37
|
-
state: consent,
|
|
38
|
-
requiredConsent: script.requiredConsent
|
|
39
|
-
})) {
|
|
40
|
-
const sink = factory();
|
|
41
|
-
sinks.push(
|
|
42
|
-
shopifyOwnsCheckout ? gateShopifyOwnedFunnelEvents(sink) : sink
|
|
43
|
-
);
|
|
44
|
-
addedTypes.add(script.type);
|
|
1
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
2
|
+
function getAnalyticsSinks(_args) {
|
|
3
|
+
throw canopyTombstoneError({
|
|
4
|
+
symbol: "getAnalyticsSinks",
|
|
5
|
+
subpath: "analytics/get-analytics-sinks",
|
|
6
|
+
replacement: {
|
|
7
|
+
kind: "internal",
|
|
8
|
+
nearestPublicSubpaths: ["analytics/analytics-provider"]
|
|
45
9
|
}
|
|
46
|
-
}
|
|
47
|
-
return sinks;
|
|
10
|
+
});
|
|
48
11
|
}
|
|
49
12
|
export {
|
|
50
13
|
getAnalyticsSinks
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../analytics/get-analytics-sinks.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { ConsentState } from \"../consent/consent-store\";\nimport type { RegisteredScript } from \"../consent/script-registration-store\";\nimport type { CheckoutProvider } from \"../lib/integration-utils\";\nimport type { AnalyticsSink } from \"./analytics-sink\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\n/** @deprecated Use a supported public @replohq/sdk API for this domain; getAnalyticsSinks has no direct replacement. */\nexport function getAnalyticsSinks(_args: {\n consent: ConsentState;\n registeredScripts: RegisteredScript[];\n checkoutProvider?: CheckoutProvider;\n}): AnalyticsSink[] {\n throw canopyTombstoneError({\n symbol: \"getAnalyticsSinks\",\n subpath: \"analytics/get-analytics-sinks\",\n replacement: {\n kind: \"internal\",\n nearestPublicSubpaths: [\"analytics/analytics-provider\"],\n },\n });\n}\n"],
|
|
5
|
+
"mappings": "AAKA,SAAS,4BAA4B;AAG9B,SAAS,kBAAkB,OAId;AAClB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,MACX,MAAM;AAAA,MACN,uBAAuB,CAAC,8BAA8B;AAAA,IACxD;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,10 +14,6 @@ interface UseProductViewedAnalyticsProps {
|
|
|
14
14
|
product: AnalyticsProduct | null;
|
|
15
15
|
selectedVariant?: AnalyticsProductVariant | null;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
* changes. Deduplicates by product+variant ID so the same combination is only
|
|
20
|
-
* tracked once per component lifecycle.
|
|
21
|
-
*/
|
|
22
|
-
export declare function useProductViewedAnalytics({ product, selectedVariant, }: UseProductViewedAnalyticsProps): void;
|
|
17
|
+
/** @deprecated Use useProductViewedAnalytics from @replohq/sdk/analytics/hooks/use-product-viewed-analytics. */
|
|
18
|
+
export declare function useProductViewedAnalytics(_props: UseProductViewedAnalyticsProps): void;
|
|
23
19
|
export {};
|
|
@@ -1,32 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})
|
|
8
|
-
const analytics = useAnalytics();
|
|
9
|
-
const lastTrackedRef = useRef(null);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (analytics && product && selectedVariant) {
|
|
12
|
-
const trackingKey = `${product.id}-${selectedVariant.id}`;
|
|
13
|
-
if (lastTrackedRef.current !== trackingKey) {
|
|
14
|
-
lastTrackedRef.current = trackingKey;
|
|
15
|
-
void analytics.productViewed({
|
|
16
|
-
data: {
|
|
17
|
-
productId: product.id,
|
|
18
|
-
productTitle: product.title,
|
|
19
|
-
productSlug: product.slug,
|
|
20
|
-
productDescription: product.description,
|
|
21
|
-
variantId: selectedVariant.id ?? "",
|
|
22
|
-
variantTitle: selectedVariant.title ?? "",
|
|
23
|
-
variantSku: selectedVariant.sku ?? "",
|
|
24
|
-
price: selectedVariant.price ?? 0
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}, [analytics, product, selectedVariant]);
|
|
2
|
+
import { canopyTombstoneError } from "../../lib/tombstone";
|
|
3
|
+
function useProductViewedAnalytics(_props) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "useProductViewedAnalytics",
|
|
6
|
+
subpath: "analytics/hooks/use-product-viewed-analytics"
|
|
7
|
+
});
|
|
30
8
|
}
|
|
31
9
|
export {
|
|
32
10
|
useProductViewedAnalytics
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../analytics/hooks/use-product-viewed-analytics.ts"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\n/* eslint-disable replo/no-void-return-type -- Tombstones preserve canopy 2.3.0's explicit public return types. */\nimport { canopyTombstoneError } from \"../../lib/tombstone\";\n\ninterface AnalyticsProduct {\n id: string;\n title: string;\n slug?: string;\n description?: string;\n}\n\ninterface AnalyticsProductVariant {\n id: string;\n title?: string;\n sku?: string;\n price?: number;\n}\n\ninterface UseProductViewedAnalyticsProps {\n product: AnalyticsProduct | null;\n selectedVariant?: AnalyticsProductVariant | null;\n}\n\n/** @deprecated Use useProductViewedAnalytics from @replohq/sdk/analytics/hooks/use-product-viewed-analytics. */\nexport function useProductViewedAnalytics(\n _props: UseProductViewedAnalyticsProps,\n): void {\n throw canopyTombstoneError({\n symbol: \"useProductViewedAnalytics\",\n subpath: \"analytics/hooks/use-product-viewed-analytics\",\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,4BAA4B;AAsB9B,SAAS,0BACd,QACM;AACN,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,EACX,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* the site's `app/layout.tsx`) so every agent site ships the implicit
|
|
5
|
-
* first-party pixel automatically — mirroring how `ReploSink` is an always-on
|
|
6
|
-
* sink that is never authored in the layout or editable in the miniapp.
|
|
7
|
-
*
|
|
8
|
-
* Renders nothing when the analytics pipeline isn't wired (e.g. lean local dev,
|
|
9
|
-
* where `REPLO_ANALYTICS_PIXEL_URL` / `ANALYTICS_FIRE_API_URL` are unset),
|
|
10
|
-
* mirroring the self-disabling consent action.
|
|
11
|
-
*/
|
|
12
|
-
export declare function ReploFirstPartyPixel(): Promise<import("react/jsx-runtime").JSX.Element | null>;
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
/** @deprecated Use a supported public @replohq/sdk API for this domain; ReploFirstPartyPixel has no direct replacement. */
|
|
3
|
+
export declare function ReploFirstPartyPixel(): Promise<ReactElement | null>;
|
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getEnv } from "../env";
|
|
3
|
-
import { ReploPixelScript } from "./replo-pixel-script";
|
|
1
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
4
2
|
async function ReploFirstPartyPixel() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
apiUrl = env.ANALYTICS_FIRE_API_URL;
|
|
12
|
-
projectId = env.PROJECT_ID;
|
|
13
|
-
} catch {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
if (!pixelUrl || !apiUrl || !projectId) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return /* @__PURE__ */ jsx(
|
|
20
|
-
ReploPixelScript,
|
|
21
|
-
{
|
|
22
|
-
pixelUrl,
|
|
23
|
-
apiUrl,
|
|
24
|
-
projectId
|
|
3
|
+
throw canopyTombstoneError({
|
|
4
|
+
symbol: "ReploFirstPartyPixel",
|
|
5
|
+
subpath: "analytics/replo-first-party-pixel",
|
|
6
|
+
replacement: {
|
|
7
|
+
kind: "internal",
|
|
8
|
+
nearestPublicSubpaths: ["analytics/analytics-provider"]
|
|
25
9
|
}
|
|
26
|
-
);
|
|
10
|
+
});
|
|
27
11
|
}
|
|
28
12
|
export {
|
|
29
13
|
ReploFirstPartyPixel
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../analytics/replo-first-party-pixel.tsx"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { ReactElement } from \"react\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\n/** @deprecated Use a supported public @replohq/sdk API for this domain; ReploFirstPartyPixel has no direct replacement. */\nexport async function ReploFirstPartyPixel(): Promise<ReactElement | null> {\n throw canopyTombstoneError({\n symbol: \"ReploFirstPartyPixel\",\n subpath: \"analytics/replo-first-party-pixel\",\n replacement: {\n kind: \"internal\",\n nearestPublicSubpaths: [\"analytics/analytics-provider\"],\n },\n });\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,4BAA4B;AAGrC,eAAsB,uBAAqD;AACzE,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,MACX,MAAM;AAAA,MACN,uBAAuB,CAAC,8BAA8B;AAAA,IACxD;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* events into, so gating it on `analytics` consent keeps the first-party sink
|
|
5
|
-
* consent-correct without the pixel loading unconditionally in `<head>` the way
|
|
6
|
-
* the legacy scaffold does. `analytics` consent here matches the
|
|
7
|
-
* `firstPartyAllowed` gate that controls whether `ReploSink` is created at all.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ReploPixelScript({ pixelUrl, apiUrl, projectId, }: {
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
/** @deprecated Use a supported public @replohq/sdk API for this domain; ReploPixelScript has no direct replacement. */
|
|
3
|
+
export declare function ReploPixelScript(_args: {
|
|
10
4
|
pixelUrl: string;
|
|
11
5
|
apiUrl: string;
|
|
12
6
|
projectId: string;
|
|
13
|
-
}):
|
|
7
|
+
}): ReactElement | null;
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}) {
|
|
11
|
-
const consent = useConsent();
|
|
12
|
-
if (!isConsentAllowed({ state: consent, requiredConsent: ["analytics"] })) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
const descriptors = [
|
|
16
|
-
{
|
|
17
|
-
kind: "external",
|
|
18
|
-
src: `${pixelUrl}/latest.js`,
|
|
19
|
-
attributes: {
|
|
20
|
-
"data-api-url": apiUrl,
|
|
21
|
-
"data-project-id": projectId
|
|
22
|
-
}
|
|
2
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
3
|
+
function ReploPixelScript(_args) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "ReploPixelScript",
|
|
6
|
+
subpath: "analytics/replo-pixel-script",
|
|
7
|
+
replacement: {
|
|
8
|
+
kind: "internal",
|
|
9
|
+
nearestPublicSubpaths: ["analytics/analytics-provider"]
|
|
23
10
|
}
|
|
24
|
-
|
|
25
|
-
return /* @__PURE__ */ jsx(InjectedScript, { baseId: PIXEL_SCRIPT_ID, descriptors });
|
|
11
|
+
});
|
|
26
12
|
}
|
|
27
13
|
export {
|
|
28
14
|
ReploPixelScript
|