@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,53 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { fullCollectionSchema } from "./loader-schemas";
|
|
8
|
-
import { useReportPreviewPlaceholderRender } from "./preview-placeholder";
|
|
9
|
-
function CollectionLoaderInner({
|
|
10
|
-
loaderKey,
|
|
11
|
-
handle,
|
|
12
|
-
collectionGid,
|
|
13
|
-
children
|
|
14
|
-
}) {
|
|
15
|
-
const queryResult = useSuspenseQuery({
|
|
16
|
-
queryKey: [loaderKey, { handle, collectionGid }],
|
|
17
|
-
queryFn: async () => {
|
|
18
|
-
const loadedData = await invokeLoader({
|
|
19
|
-
loaderKey,
|
|
20
|
-
args: { handle, collectionGid }
|
|
21
|
-
});
|
|
22
|
-
return fullCollectionSchema.parse(loadedData);
|
|
23
|
-
}
|
|
2
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
3
|
+
function CollectionLoader(_props) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "CollectionLoader",
|
|
6
|
+
subpath: "loaders/collection-loader"
|
|
24
7
|
});
|
|
25
|
-
useReportPreviewPlaceholderRender(queryResult.data);
|
|
26
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
|
|
27
|
-
}
|
|
28
|
-
function CollectionLoader({
|
|
29
|
-
loaderKey,
|
|
30
|
-
handle,
|
|
31
|
-
collectionGid,
|
|
32
|
-
children,
|
|
33
|
-
fallback
|
|
34
|
-
}) {
|
|
35
|
-
return /* @__PURE__ */ jsx(
|
|
36
|
-
LoaderErrorBoundary,
|
|
37
|
-
{
|
|
38
|
-
fallback: fallback ?? null,
|
|
39
|
-
resetKey: `${loaderKey}:${handle ?? ""}:${collectionGid ?? ""}`,
|
|
40
|
-
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
41
|
-
CollectionLoaderInner,
|
|
42
|
-
{
|
|
43
|
-
loaderKey,
|
|
44
|
-
handle,
|
|
45
|
-
collectionGid,
|
|
46
|
-
children
|
|
47
|
-
}
|
|
48
|
-
) })
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
8
|
}
|
|
52
9
|
export {
|
|
53
10
|
CollectionLoader
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../loaders/collection-loader.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport type { FullCollection } from \"./loader-schemas\";\n\nimport {
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { FullCollection } from \"./loader-schemas\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\ntype CollectionLoaderProps = {\n loaderKey: string;\n handle?: string;\n collectionGid?: string;\n children: (data: FullCollection) => ReactNode;\n fallback?: ReactNode;\n};\n\n/** @deprecated Use CollectionLoader from @replohq/sdk/loaders/collection-loader. */\nexport function CollectionLoader(_props: CollectionLoaderProps): ReactElement {\n throw canopyTombstoneError({\n symbol: \"CollectionLoader\",\n subpath: \"loaders/collection-loader\",\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAKA,SAAS,4BAA4B;AAW9B,SAAS,iBAAiB,QAA6C;AAC5E,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,EACX,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import type { PaginatedProducts } from "./loader-schemas";
|
|
3
3
|
type CollectionProductsLoaderProps = {
|
|
4
4
|
loaderKey: string;
|
|
@@ -8,5 +8,6 @@ type CollectionProductsLoaderProps = {
|
|
|
8
8
|
children: (data: PaginatedProducts) => ReactNode;
|
|
9
9
|
fallback?: ReactNode;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
/** @deprecated Use CollectionProductsLoader from @replohq/sdk/loaders/collection-products-loader. */
|
|
12
|
+
export declare function CollectionProductsLoader(_props: CollectionProductsLoaderProps): ReactElement;
|
|
12
13
|
export {};
|
|
@@ -1,56 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { paginatedProductsSchema } from "./loader-schemas";
|
|
8
|
-
import { useReportPreviewPlaceholderRender } from "./preview-placeholder";
|
|
9
|
-
function CollectionProductsLoaderInner({
|
|
10
|
-
loaderKey,
|
|
11
|
-
collectionGid,
|
|
12
|
-
first,
|
|
13
|
-
after,
|
|
14
|
-
children
|
|
15
|
-
}) {
|
|
16
|
-
const queryResult = useSuspenseQuery({
|
|
17
|
-
queryKey: [loaderKey, { collectionGid, first, after }],
|
|
18
|
-
queryFn: async () => {
|
|
19
|
-
const loadedData = await invokeLoader({
|
|
20
|
-
loaderKey,
|
|
21
|
-
args: { collectionGid, first, after }
|
|
22
|
-
});
|
|
23
|
-
return paginatedProductsSchema.parse(loadedData);
|
|
24
|
-
}
|
|
2
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
3
|
+
function CollectionProductsLoader(_props) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "CollectionProductsLoader",
|
|
6
|
+
subpath: "loaders/collection-products-loader"
|
|
25
7
|
});
|
|
26
|
-
useReportPreviewPlaceholderRender(queryResult.data);
|
|
27
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
|
|
28
|
-
}
|
|
29
|
-
function CollectionProductsLoader({
|
|
30
|
-
loaderKey,
|
|
31
|
-
collectionGid,
|
|
32
|
-
first,
|
|
33
|
-
after,
|
|
34
|
-
children,
|
|
35
|
-
fallback
|
|
36
|
-
}) {
|
|
37
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
-
LoaderErrorBoundary,
|
|
39
|
-
{
|
|
40
|
-
fallback: fallback ?? null,
|
|
41
|
-
resetKey: `${loaderKey}:${collectionGid}:${first ?? ""}:${after ?? ""}`,
|
|
42
|
-
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
43
|
-
CollectionProductsLoaderInner,
|
|
44
|
-
{
|
|
45
|
-
loaderKey,
|
|
46
|
-
collectionGid,
|
|
47
|
-
first,
|
|
48
|
-
after,
|
|
49
|
-
children
|
|
50
|
-
}
|
|
51
|
-
) })
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
8
|
}
|
|
55
9
|
export {
|
|
56
10
|
CollectionProductsLoader
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../loaders/collection-products-loader.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport type { PaginatedProducts } from \"./loader-schemas\";\n\nimport {
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { PaginatedProducts } from \"./loader-schemas\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\ntype CollectionProductsLoaderProps = {\n loaderKey: string;\n collectionGid: string;\n first?: number;\n after?: string;\n children: (data: PaginatedProducts) => ReactNode;\n fallback?: ReactNode;\n};\n\n/** @deprecated Use CollectionProductsLoader from @replohq/sdk/loaders/collection-products-loader. */\nexport function CollectionProductsLoader(\n _props: CollectionProductsLoaderProps,\n): ReactElement {\n throw canopyTombstoneError({\n symbol: \"CollectionProductsLoader\",\n subpath: \"loaders/collection-products-loader\",\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAKA,SAAS,4BAA4B;AAY9B,SAAS,yBACd,QACc;AACd,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,EACX,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import type { ContentfulEntriesLoaderOutput } from "./loader-schemas";
|
|
3
3
|
type ContentfulEntriesLoaderProps = {
|
|
4
4
|
loaderKey: string;
|
|
@@ -13,5 +13,6 @@ type ContentfulEntriesLoaderProps = {
|
|
|
13
13
|
children: (data: ContentfulEntriesLoaderOutput) => ReactNode;
|
|
14
14
|
fallback?: ReactNode;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
/** @deprecated Use ContentfulEntriesLoader from @replohq/sdk/loaders/contentful-entries-loader. */
|
|
17
|
+
export declare function ContentfulEntriesLoader(_props: ContentfulEntriesLoaderProps): ReactElement;
|
|
17
18
|
export {};
|
|
@@ -1,76 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { contentfulEntriesLoaderOutputSchema } from "./loader-schemas";
|
|
8
|
-
function buildArgs({
|
|
9
|
-
spaceId,
|
|
10
|
-
contentType,
|
|
11
|
-
environmentId,
|
|
12
|
-
locale,
|
|
13
|
-
order,
|
|
14
|
-
limit,
|
|
15
|
-
skip,
|
|
16
|
-
include
|
|
17
|
-
}) {
|
|
18
|
-
return {
|
|
19
|
-
spaceId,
|
|
20
|
-
contentType,
|
|
21
|
-
...environmentId !== void 0 ? { environmentId } : {},
|
|
22
|
-
...locale !== void 0 ? { locale } : {},
|
|
23
|
-
...order !== void 0 ? { order } : {},
|
|
24
|
-
...limit !== void 0 ? { limit } : {},
|
|
25
|
-
...skip !== void 0 ? { skip } : {},
|
|
26
|
-
...include !== void 0 ? { include } : {}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function ContentfulEntriesLoaderInner({
|
|
30
|
-
loaderKey,
|
|
31
|
-
args,
|
|
32
|
-
children
|
|
33
|
-
}) {
|
|
34
|
-
const { data } = useSuspenseQuery({
|
|
35
|
-
queryKey: [loaderKey, args],
|
|
36
|
-
queryFn: async () => {
|
|
37
|
-
const loadedData = await invokeLoader({ loaderKey, args });
|
|
38
|
-
return contentfulEntriesLoaderOutputSchema.parse(loadedData);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
42
|
-
}
|
|
43
|
-
function ContentfulEntriesLoader({
|
|
44
|
-
loaderKey,
|
|
45
|
-
spaceId,
|
|
46
|
-
contentType,
|
|
47
|
-
environmentId,
|
|
48
|
-
locale,
|
|
49
|
-
order,
|
|
50
|
-
limit,
|
|
51
|
-
skip,
|
|
52
|
-
include,
|
|
53
|
-
children,
|
|
54
|
-
fallback
|
|
55
|
-
}) {
|
|
56
|
-
const args = buildArgs({
|
|
57
|
-
spaceId,
|
|
58
|
-
contentType,
|
|
59
|
-
environmentId,
|
|
60
|
-
locale,
|
|
61
|
-
order,
|
|
62
|
-
limit,
|
|
63
|
-
skip,
|
|
64
|
-
include
|
|
2
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
3
|
+
function ContentfulEntriesLoader(_props) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "ContentfulEntriesLoader",
|
|
6
|
+
subpath: "loaders/contentful-entries-loader"
|
|
65
7
|
});
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
67
|
-
LoaderErrorBoundary,
|
|
68
|
-
{
|
|
69
|
-
fallback: fallback ?? null,
|
|
70
|
-
resetKey: `${loaderKey}:${JSON.stringify(args)}`,
|
|
71
|
-
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(ContentfulEntriesLoaderInner, { loaderKey, args, children }) })
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
8
|
}
|
|
75
9
|
export {
|
|
76
10
|
ContentfulEntriesLoader
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../loaders/contentful-entries-loader.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport type { ContentfulEntriesLoaderOutput } from \"./loader-schemas\";\n\nimport {
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { ContentfulEntriesLoaderOutput } from \"./loader-schemas\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\ntype ContentfulEntriesLoaderProps = {\n loaderKey: string;\n spaceId: string;\n contentType: string;\n environmentId?: string;\n locale?: string;\n order?: string;\n limit?: number;\n skip?: number;\n include?: number;\n children: (data: ContentfulEntriesLoaderOutput) => ReactNode;\n fallback?: ReactNode;\n};\n\n/** @deprecated Use ContentfulEntriesLoader from @replohq/sdk/loaders/contentful-entries-loader. */\nexport function ContentfulEntriesLoader(\n _props: ContentfulEntriesLoaderProps,\n): ReactElement {\n throw canopyTombstoneError({\n symbol: \"ContentfulEntriesLoader\",\n subpath: \"loaders/contentful-entries-loader\",\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAKA,SAAS,4BAA4B;AAiB9B,SAAS,wBACd,QACc;AACd,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,EACX,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import type { ContentfulEntryLoaderOutput } from "./loader-schemas";
|
|
3
3
|
type ContentfulEntryLoaderProps = {
|
|
4
4
|
loaderKey: string;
|
|
@@ -10,5 +10,6 @@ type ContentfulEntryLoaderProps = {
|
|
|
10
10
|
children: (data: ContentfulEntryLoaderOutput) => ReactNode;
|
|
11
11
|
fallback?: ReactNode;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
/** @deprecated Use ContentfulEntryLoader from @replohq/sdk/loaders/contentful-entry-loader. */
|
|
14
|
+
export declare function ContentfulEntryLoader(_props: ContentfulEntryLoaderProps): ReactElement;
|
|
14
15
|
export {};
|
|
@@ -1,58 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { contentfulEntryLoaderOutputSchema } from "./loader-schemas";
|
|
8
|
-
function buildArgs({
|
|
9
|
-
spaceId,
|
|
10
|
-
entryId,
|
|
11
|
-
environmentId,
|
|
12
|
-
locale,
|
|
13
|
-
include
|
|
14
|
-
}) {
|
|
15
|
-
return {
|
|
16
|
-
spaceId,
|
|
17
|
-
entryId,
|
|
18
|
-
...environmentId !== void 0 ? { environmentId } : {},
|
|
19
|
-
...locale !== void 0 ? { locale } : {},
|
|
20
|
-
...include !== void 0 ? { include } : {}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function ContentfulEntryLoaderInner({
|
|
24
|
-
loaderKey,
|
|
25
|
-
args,
|
|
26
|
-
children
|
|
27
|
-
}) {
|
|
28
|
-
const { data } = useSuspenseQuery({
|
|
29
|
-
queryKey: [loaderKey, args],
|
|
30
|
-
queryFn: async () => {
|
|
31
|
-
const loadedData = await invokeLoader({ loaderKey, args });
|
|
32
|
-
return contentfulEntryLoaderOutputSchema.parse(loadedData);
|
|
33
|
-
}
|
|
2
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
3
|
+
function ContentfulEntryLoader(_props) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "ContentfulEntryLoader",
|
|
6
|
+
subpath: "loaders/contentful-entry-loader"
|
|
34
7
|
});
|
|
35
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
36
|
-
}
|
|
37
|
-
function ContentfulEntryLoader({
|
|
38
|
-
loaderKey,
|
|
39
|
-
spaceId,
|
|
40
|
-
entryId,
|
|
41
|
-
environmentId,
|
|
42
|
-
locale,
|
|
43
|
-
include,
|
|
44
|
-
children,
|
|
45
|
-
fallback
|
|
46
|
-
}) {
|
|
47
|
-
const args = buildArgs({ spaceId, entryId, environmentId, locale, include });
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
49
|
-
LoaderErrorBoundary,
|
|
50
|
-
{
|
|
51
|
-
fallback: fallback ?? null,
|
|
52
|
-
resetKey: `${loaderKey}:${JSON.stringify(args)}`,
|
|
53
|
-
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(ContentfulEntryLoaderInner, { loaderKey, args, children }) })
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
8
|
}
|
|
57
9
|
export {
|
|
58
10
|
ContentfulEntryLoader
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../loaders/contentful-entry-loader.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport type { ContentfulEntryLoaderOutput } from \"./loader-schemas\";\n\nimport {
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { ContentfulEntryLoaderOutput } from \"./loader-schemas\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\ntype ContentfulEntryLoaderProps = {\n loaderKey: string;\n spaceId: string;\n entryId: string;\n environmentId?: string;\n locale?: string;\n include?: number;\n children: (data: ContentfulEntryLoaderOutput) => ReactNode;\n fallback?: ReactNode;\n};\n\n/** @deprecated Use ContentfulEntryLoader from @replohq/sdk/loaders/contentful-entry-loader. */\nexport function ContentfulEntryLoader(\n _props: ContentfulEntryLoaderProps,\n): ReactElement {\n throw canopyTombstoneError({\n symbol: \"ContentfulEntryLoader\",\n subpath: \"loaders/contentful-entry-loader\",\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAKA,SAAS,4BAA4B;AAc9B,SAAS,sBACd,QACc;AACd,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,EACX,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* Called from client-side loader components when React Query needs to
|
|
4
|
-
* fetch data in the browser (e.g., client-side navigation, cache miss).
|
|
5
|
-
* This runs on the server — Next.js handles the client/server boundary
|
|
6
|
-
* automatically.
|
|
7
|
-
*/
|
|
8
|
-
export declare function invokeLoaderAction({ loaderKey, args, }: {
|
|
1
|
+
/** @deprecated Use a supported public @replohq/sdk API for this domain; invokeLoaderAction has no direct replacement. */
|
|
2
|
+
export declare function invokeLoaderAction(_args: {
|
|
9
3
|
loaderKey: string;
|
|
10
4
|
args: Record<string, unknown>;
|
|
11
5
|
}): Promise<unknown>;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use server";
|
|
2
|
-
import {
|
|
3
|
-
async function invokeLoaderAction({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
3
|
+
async function invokeLoaderAction(_args) {
|
|
4
|
+
throw canopyTombstoneError({
|
|
5
|
+
symbol: "invokeLoaderAction",
|
|
6
|
+
subpath: "loaders/invoke-loader-action",
|
|
7
|
+
replacement: {
|
|
8
|
+
kind: "internal",
|
|
9
|
+
nearestPublicSubpaths: [
|
|
10
|
+
"loaders/product-loader",
|
|
11
|
+
"loaders/prefetch-loaders"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
});
|
|
10
15
|
}
|
|
11
16
|
export {
|
|
12
17
|
invokeLoaderAction
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../loaders/invoke-loader-action.ts"],
|
|
4
|
-
"sourcesContent": ["\"use server\";\n\nimport {
|
|
5
|
-
"mappings": ";AAEA,SAAS,
|
|
4
|
+
"sourcesContent": ["\"use server\";\n\nimport { canopyTombstoneError } from \"../lib/tombstone\";\n\n/** @deprecated Use a supported public @replohq/sdk API for this domain; invokeLoaderAction has no direct replacement. */\nexport async function invokeLoaderAction(_args: {\n loaderKey: string;\n args: Record<string, unknown>;\n}): Promise<unknown> {\n throw canopyTombstoneError({\n symbol: \"invokeLoaderAction\",\n subpath: \"loaders/invoke-loader-action\",\n replacement: {\n kind: \"internal\",\n nearestPublicSubpaths: [\n \"loaders/product-loader\",\n \"loaders/prefetch-loaders\",\n ],\n },\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAEA,SAAS,4BAA4B;AAGrC,eAAsB,mBAAmB,OAGpB;AACnB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,MACX,MAAM;AAAA,MACN,uBAAuB;AAAA,QACrB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* Used by PrefetchedLoaders to seed the React Query cache during SSR.
|
|
4
|
-
*
|
|
5
|
-
* Results are cached via Next.js `unstable_cache` so repeated SSR renders
|
|
6
|
-
* for the same loader+args return instantly without a network round-trip
|
|
7
|
-
* to canopy-api. The canopy-api's own in-memory cache still acts as a second
|
|
8
|
-
* layer for cold starts and cross-instance sharing.
|
|
9
|
-
*
|
|
10
|
-
* @param revalidateSeconds - How long (in seconds) the cached result is
|
|
11
|
-
* considered fresh. Defaults to 60. Set to `false` to cache indefinitely
|
|
12
|
-
* (use tag-based invalidation via `revalidateTag` to purge).
|
|
13
|
-
*/
|
|
14
|
-
export declare function invokeLoaderServer({ loaderKey, args, revalidateSeconds, }: {
|
|
1
|
+
/** @deprecated Use a supported public @replohq/sdk API for this domain; invokeLoaderServer has no direct replacement. */
|
|
2
|
+
export declare function invokeLoaderServer(_args: {
|
|
15
3
|
loaderKey: string;
|
|
16
4
|
args: Record<string, unknown>;
|
|
17
5
|
revalidateSeconds?: number | false;
|
|
@@ -1,38 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return ["loader", loaderKey, sortedArgsJson];
|
|
13
|
-
}
|
|
14
|
-
async function invokeLoaderServer({
|
|
15
|
-
loaderKey,
|
|
16
|
-
args,
|
|
17
|
-
revalidateSeconds = DEFAULT_REVALIDATE_SECONDS
|
|
18
|
-
}) {
|
|
19
|
-
const placeholderData = resolvePreviewPlaceholderData({ loaderKey, args });
|
|
20
|
-
if (placeholderData !== null) {
|
|
21
|
-
return placeholderData;
|
|
22
|
-
}
|
|
23
|
-
const cacheKeyParts = buildStableCacheKeyParts({ loaderKey, args });
|
|
24
|
-
return unstable_cache(
|
|
25
|
-
async () => {
|
|
26
|
-
const gateway = await getCanopyApiGateway();
|
|
27
|
-
const response = await gateway.invokeLoader({ loaderKey, args });
|
|
28
|
-
return response.data;
|
|
29
|
-
},
|
|
30
|
-
cacheKeyParts,
|
|
31
|
-
{
|
|
32
|
-
revalidate: revalidateSeconds,
|
|
33
|
-
tags: [`loader:${loaderKey}`, ...cacheKeyParts]
|
|
1
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
2
|
+
async function invokeLoaderServer(_args) {
|
|
3
|
+
throw canopyTombstoneError({
|
|
4
|
+
symbol: "invokeLoaderServer",
|
|
5
|
+
subpath: "loaders/invoke-loader-server",
|
|
6
|
+
replacement: {
|
|
7
|
+
kind: "internal",
|
|
8
|
+
nearestPublicSubpaths: [
|
|
9
|
+
"loaders/product-loader",
|
|
10
|
+
"loaders/prefetch-loaders"
|
|
11
|
+
]
|
|
34
12
|
}
|
|
35
|
-
)
|
|
13
|
+
});
|
|
36
14
|
}
|
|
37
15
|
export {
|
|
38
16
|
invokeLoaderServer
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../loaders/invoke-loader-server.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"sourcesContent": ["import { canopyTombstoneError } from \"../lib/tombstone\";\n\n/** @deprecated Use a supported public @replohq/sdk API for this domain; invokeLoaderServer has no direct replacement. */\nexport async function invokeLoaderServer(_args: {\n loaderKey: string;\n args: Record<string, unknown>;\n revalidateSeconds?: number | false;\n}): Promise<unknown> {\n throw canopyTombstoneError({\n symbol: \"invokeLoaderServer\",\n subpath: \"loaders/invoke-loader-server\",\n replacement: {\n kind: \"internal\",\n nearestPublicSubpaths: [\n \"loaders/product-loader\",\n \"loaders/prefetch-loaders\",\n ],\n },\n });\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,4BAA4B;AAGrC,eAAsB,mBAAmB,OAIpB;AACnB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,MACX,MAAM;AAAA,MACN,uBAAuB;AAAA,QACrB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
export declare class LoaderInvokeError extends
|
|
1
|
+
import type { CanopyErrorConfig } from "../lib/canopy-error";
|
|
2
|
+
/** @deprecated Use a supported public @replohq/sdk API for this domain; LoaderInvokeError has no direct replacement. */
|
|
3
|
+
export declare class LoaderInvokeError extends Error {
|
|
4
|
+
constructor(_config: CanopyErrorConfig);
|
|
4
5
|
}
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
* In the browser, dynamically imports a server action so React 19 never sees
|
|
8
|
-
* the "use server" reference during render.
|
|
9
|
-
*
|
|
10
|
-
* In an editor iframe previewing an unfilled dynamic route, returns sample
|
|
11
|
-
* data instead of fetching — see `preview-placeholder.ts`.
|
|
12
|
-
*/
|
|
13
|
-
export declare function invokeLoader({ loaderKey, args, }: {
|
|
6
|
+
/** @deprecated Use a supported public @replohq/sdk API for this domain; invokeLoader has no direct replacement. */
|
|
7
|
+
export declare function invokeLoader(_args: {
|
|
14
8
|
loaderKey: string;
|
|
15
9
|
args: Record<string, unknown>;
|
|
16
10
|
}): Promise<unknown>;
|
package/loaders/invoke-loader.js
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const { getCanopyApiGateway } = await import("../gateways/canopy-api");
|
|
16
|
-
const gateway = await getCanopyApiGateway();
|
|
17
|
-
const response = await gateway.invokeLoader({ loaderKey, args });
|
|
18
|
-
return response.data;
|
|
19
|
-
}
|
|
20
|
-
const { invokeLoaderAction } = await import("./invoke-loader-action");
|
|
21
|
-
return await invokeLoaderAction({ loaderKey, args });
|
|
22
|
-
} catch (error) {
|
|
23
|
-
if (error instanceof LoaderInvokeError) {
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
26
|
-
throw new LoaderInvokeError({
|
|
27
|
-
message: `Loader ${loaderKey} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
28
|
-
cause: error,
|
|
29
|
-
additionalData: { loaderKey }
|
|
1
|
+
import { canopyTombstoneError } from "../lib/tombstone";
|
|
2
|
+
class LoaderInvokeError extends Error {
|
|
3
|
+
constructor(_config) {
|
|
4
|
+
super();
|
|
5
|
+
throw canopyTombstoneError({
|
|
6
|
+
symbol: "LoaderInvokeError",
|
|
7
|
+
subpath: "loaders/invoke-loader",
|
|
8
|
+
replacement: {
|
|
9
|
+
kind: "internal",
|
|
10
|
+
nearestPublicSubpaths: [
|
|
11
|
+
"loaders/product-loader",
|
|
12
|
+
"loaders/prefetch-loaders"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
30
15
|
});
|
|
31
16
|
}
|
|
32
17
|
}
|
|
18
|
+
async function invokeLoader(_args) {
|
|
19
|
+
throw canopyTombstoneError({
|
|
20
|
+
symbol: "invokeLoader",
|
|
21
|
+
subpath: "loaders/invoke-loader",
|
|
22
|
+
replacement: {
|
|
23
|
+
kind: "internal",
|
|
24
|
+
nearestPublicSubpaths: [
|
|
25
|
+
"loaders/product-loader",
|
|
26
|
+
"loaders/prefetch-loaders"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
33
31
|
export {
|
|
34
32
|
LoaderInvokeError,
|
|
35
33
|
invokeLoader
|