fontdue-js 2.20.1 → 2.22.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/CHANGELOG.md +11 -0
- package/dist/components/CharacterViewer/index.js +5 -4
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.js +4 -3
- package/dist/components/FontdueProvider/useAuxUIOwner.d.ts +1 -0
- package/dist/components/FontdueProvider/useAuxUIOwner.js +28 -0
- package/dist/components/Root/index.js +20 -19
- package/dist/components/TypeTester/TypeTesterFeatures.js +2 -1
- package/dist/components/TypeTester/TypeTesterFeaturesButton.js +5 -3
- package/dist/components/TypeTester/TypeTesterStandalone.d.ts +2 -2
- package/dist/components/TypeTester/TypeTesterStandalone.js +2 -1
- package/dist/components/TypeTester/TypeTesterStandalone.preload.d.ts +14 -0
- package/dist/components/TypeTester/TypeTesterStandalone.preload.js +19 -0
- package/dist/components/TypeTester/types.d.ts +2 -0
- package/dist/components/TypeTester/types.js +10 -1
- package/dist/components/TypeTesters/TypeTestersElement.d.ts +2 -1
- package/dist/components/TypeTesters/TypeTestersElement.js +3 -1
- package/dist/components/TypeTesters/index.d.ts +2 -0
- package/dist/components/TypeTesters/index.js +5 -2
- package/dist/config.d.ts +6 -0
- package/dist/config.js +20 -0
- package/dist/corsError.js +42 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/retryImport.d.ts +13 -0
- package/dist/retryImport.js +26 -0
- package/dist-bundle/FontdueProvider.js +6 -0
- package/dist-bundle/FontdueProvider.js.map +1 -0
- package/dist-bundle/TypeTester.js +7 -0
- package/dist-bundle/TypeTester.js.map +1 -0
- package/dist-bundle/TypeTester.preload.js +75 -0
- package/dist-bundle/TypeTester.preload.js.map +1 -0
- package/dist-bundle/chunks/ComponentsContext-CmkN9J4X.js +20843 -0
- package/dist-bundle/chunks/ComponentsContext-CmkN9J4X.js.map +1 -0
- package/dist-bundle/chunks/CorsErrorModal-C1g_-3Re.js +95 -0
- package/dist-bundle/chunks/CorsErrorModal-C1g_-3Re.js.map +1 -0
- package/dist-bundle/chunks/TypeTesterStandalone-BMWuv8Ca.js +27486 -0
- package/dist-bundle/chunks/TypeTesterStandalone-BMWuv8Ca.js.map +1 -0
- package/dist-bundle/chunks/consent-DMvR5rEh.js +84 -0
- package/dist-bundle/chunks/consent-DMvR5rEh.js.map +1 -0
- package/dist-bundle/chunks/index-BNSbxp7B.js +78 -0
- package/dist-bundle/chunks/index-BNSbxp7B.js.map +1 -0
- package/dist-bundle/chunks/index-C4ak9qTL.js +423 -0
- package/dist-bundle/chunks/index-C4ak9qTL.js.map +1 -0
- package/dist-bundle/chunks/index-DsvF5W13.js +159 -0
- package/dist-bundle/chunks/index-DsvF5W13.js.map +1 -0
- package/dist-bundle/chunks/index-o29NNufd.js +131 -0
- package/dist-bundle/chunks/index-o29NNufd.js.map +1 -0
- package/dist-bundle/index.js +23 -0
- package/dist-bundle/index.js.map +1 -0
- package/package.json +1 -1
- package/dist/__generated__/CartItem_license.graphql.d.ts +0 -27
- package/dist/__generated__/CartItem_license.graphql.js +0 -76
- package/dist/__generated__/CartItem_licenseSelection.graphql.d.ts +0 -34
- package/dist/__generated__/CartItem_licenseSelection.graphql.js +0 -106
- package/dist/__generated__/CartItem_product.graphql.d.ts +0 -32
- package/dist/__generated__/CartItem_product.graphql.js +0 -124
- package/dist/__generated__/CartItem_variable.graphql.d.ts +0 -23
- package/dist/__generated__/CartItem_variable.graphql.js +0 -67
- package/dist/__generated__/CartItem_viewer.graphql.d.ts +0 -30
- package/dist/__generated__/CartItem_viewer.graphql.js +0 -87
- package/dist/__generated__/CartOrderApplyCouponMutation.graphql.d.ts +0 -21
- package/dist/__generated__/CartOrderApplyCouponMutation.graphql.js +0 -919
- package/dist/__generated__/CartStateApplyCouponMutation.graphql.d.ts +0 -21
- package/dist/__generated__/CartStateApplyCouponMutation.graphql.js +0 -274
- package/dist/__generated__/CartTotalsCreateSnapshotMutation.graphql.d.ts +0 -22
- package/dist/__generated__/CartTotalsCreateSnapshotMutation.graphql.js +0 -84
- package/dist/__generated__/Cart_viewer.graphql.d.ts +0 -20
- package/dist/__generated__/Cart_viewer.graphql.js +0 -49
- package/dist/__generated__/CharacterViewer_Query.graphql.d.ts +0 -21
- package/dist/__generated__/CharacterViewer_Query.graphql.js +0 -230
- package/dist/__generated__/CharacterViewer_SlugQuery.graphql.d.ts +0 -25
- package/dist/__generated__/CharacterViewer_SlugQuery.graphql.js +0 -257
- package/dist/__generated__/CouponCodeInput_Refetch_Query.graphql.d.ts +0 -17
- package/dist/__generated__/CouponCodeInput_Refetch_Query.graphql.js +0 -201
- package/dist/__generated__/CouponCodeInput_order.graphql.d.ts +0 -13
- package/dist/__generated__/CouponCodeInput_order.graphql.js +0 -28
- package/dist/__generated__/CouponCodeInput_viewer.graphql.d.ts +0 -25
- package/dist/__generated__/CouponCodeInput_viewer.graphql.js +0 -88
- package/dist/__generated__/CouponCodeRefetchQuery.graphql.d.ts +0 -22
- package/dist/__generated__/CouponCodeRefetchQuery.graphql.js +0 -178
- package/dist/__generated__/Family_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/FontFamilies_node.graphql.d.ts +0 -20
- package/dist/__generated__/FontFamilies_node.graphql.js +0 -49
- package/dist/__generated__/NewsletterSignup_Query.graphql.d.ts +0 -21
- package/dist/__generated__/NewsletterSignup_Query.graphql.js +0 -99
- package/dist/__generated__/NewsletterSignup_viewer.graphql.d.ts +0 -20
- package/dist/__generated__/NewsletterSignup_viewer.graphql.js +0 -56
- package/dist/__generated__/OrderVariableSelectionMutation.graphql.d.ts +0 -69
- package/dist/__generated__/OrderVariableSelectionMutation_viewer.graphql.d.ts +0 -30
- package/dist/__generated__/PriceBarSection_RefetchQuery.graphql.d.ts +0 -26
- package/dist/__generated__/PriceBarSection_RefetchQuery.graphql.js +0 -168
- package/dist/__generated__/PriceBarSection_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/PriceBar_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/SKUPriceRefetchQuery.graphql.d.ts +0 -31
- package/dist/__generated__/SKUPriceRefetchQuery.graphql.js +0 -130
- package/dist/__generated__/SKUPriceUpdateQuery.graphql.d.ts +0 -29
- package/dist/__generated__/SKUPrice_RefetchQuery.graphql.d.ts +0 -26
- package/dist/__generated__/SKUPrice_RefetchQuery.graphql.js +0 -129
- package/dist/__generated__/SKUPrice_viewer.graphql.d.ts +0 -19
- package/dist/__generated__/SelectButton_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/SpecimenLink_node.graphql.d.ts +0 -21
- package/dist/__generated__/SpecimenLink_node.graphql.js +0 -55
- package/dist/__generated__/StoreModalBundleButton_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/StoreModalFamilyButton_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/StoreModalFamily_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/StoreModalOrderVariableSelectionHookQuery.graphql.d.ts +0 -26
- package/dist/__generated__/StoreModalOrderVariableSelectionOrderUpdateMutation.graphql.d.ts +0 -60
- package/dist/__generated__/StoreModalOrderVariableSelectionRefetchQuery.graphql.d.ts +0 -26
- package/dist/__generated__/StoreModalOrderVariableSelectionVariable_order.graphql.d.ts +0 -27
- package/dist/__generated__/StoreModalOrderVariableSelectionVariable_variable.graphql.d.ts +0 -24
- package/dist/__generated__/StoreModalProductContent_viewer.graphql.d.ts +0 -30
- package/dist/__generated__/StoreModalProductLicenseSelection_viewer.graphql.d.ts +0 -20
- package/dist/__generated__/StoreModalProductLicenseSelection_viewer.graphql.js +0 -51
- package/dist/__generated__/StoreModalProductViewerRefetchQuery.graphql.d.ts +0 -31
- package/dist/__generated__/StoreModalReviewCompleteOrderMutation.graphql.d.ts +0 -25
- package/dist/__generated__/StoreModalReviewCompleteOrderMutation.graphql.js +0 -442
- package/dist/__generated__/StoreModalReviewQuery.graphql.d.ts +0 -22
- package/dist/__generated__/StoreModalReviewQuery.graphql.js +0 -491
- package/dist/__generated__/StoreModalReviewUpdateOrderMutation.graphql.d.ts +0 -63
- package/dist/__generated__/StoreModalReviewUpdateOrderMutation.graphql.js +0 -445
- package/dist/__generated__/StoreModalReview_order.graphql.d.ts +0 -59
- package/dist/__generated__/StoreModalReview_order.graphql.js +0 -244
- package/dist/__generated__/StoreModalReview_viewer.graphql.d.ts +0 -19
- package/dist/__generated__/StoreModalReview_viewer.graphql.js +0 -47
- package/dist/__generated__/StoreModalStyleButton_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/TestFontsForm_viewer.graphql.d.ts +0 -29
- package/dist/__generated__/TestFontsForm_viewer.graphql.js +0 -101
- package/dist/__generated__/TestModeBanner_viewer.graphql.d.ts +0 -23
- package/dist/__generated__/TestModeBanner_viewer.graphql.js +0 -64
- package/dist/__generated__/ThemeConfig_viewer.graphql.d.ts +0 -19
- package/dist/__generated__/ThemeConfig_viewer.graphql.js +0 -43
- package/dist/__generated__/TypeTesterStandalone_StyleQuery.graphql.d.ts +0 -32
- package/dist/__generated__/TypeTesterStandalone_StyleQuery.graphql.js +0 -385
- package/dist/__generated__/TypeTesterStyleSelect_family.graphql.d.ts +0 -33
- package/dist/__generated__/TypeTesterStyleSelect_fontStyle.graphql.d.ts +0 -27
- package/dist/__generated__/TypeTester_NewStyleQuery.graphql.d.ts +0 -41
- package/dist/__generated__/TypeTester_NewStyleQuery.graphql.js +0 -344
- package/dist/__generated__/TypeTester_sku.graphql.d.ts +0 -21
- package/dist/__generated__/TypeTester_sku.graphql.js +0 -57
- package/dist/__generated__/useOrderVariables_order.graphql.d.ts +0 -24
- package/dist/__tests__/collectionBundleSelection.test.d.ts +0 -1
- package/dist/components/BuyButton/BuyButton.server.d.ts +0 -3
- package/dist/components/BuyButton/BuyButton.server.js +0 -39
- package/dist/components/CartButton/index-server.d.ts +0 -3
- package/dist/components/CartButton/index-server.js +0 -18
- package/dist/components/OrderVariableSelection/OrderVariableSelectionMutation.d.ts +0 -7
- package/dist/components/SelectField/index.d.ts +0 -13
- package/dist/components/SelectField/index.js +0 -49
- package/dist/components/StoreModal/StoreModalReview.d.ts +0 -6
- package/dist/components/StoreModal/StoreModalReview.js +0 -221
- package/dist/components/StoreModal/StoreModalRouterContext.d.ts +0 -7
- package/dist/components/StoreModal/StoreModalRouterContext.js +0 -11
- package/dist/components/StoreModal/createRouter.d.ts +0 -41
- package/dist/components/StoreModal/createRouter.js +0 -48
- package/dist/components/StoreModalProductLicenseSelection/ContainerElement.d.ts +0 -9
- package/dist/components/StoreModalProductLicenseSelection/ContainerElement.js +0 -25
- package/dist/components/Stylesheet/index.d.ts +0 -7
- package/dist/components/Stylesheet/index.js +0 -43
- package/dist/components/TestModeBanner/index.server.d.ts +0 -2
- package/dist/components/TestModeBanner/index.server.js +0 -17
- package/dist/components/elements/StoreModalReviewConfirm/index.d.ts +0 -12
- package/dist/components/elements/StoreModalReviewConfirm/index.js +0 -50
- package/dist/components/elements/StoreModalReviewItem/index.d.ts +0 -9
- package/dist/components/elements/StoreModalReviewItem/index.js +0 -21
- package/dist/components/elements/StoreModalReviewLayout/index.d.ts +0 -17
- package/dist/components/elements/StoreModalReviewLayout/index.js +0 -59
- package/dist/components/useFontLoaded.d.ts +0 -24
- package/dist/components/useFontLoaded.js +0 -60
- package/dist/deepMerge.d.ts +0 -4
- package/dist/deepMerge.js +0 -24
- package/dist/hooks/useOrderVariables.d.ts +0 -5
- package/dist/relay-environment.d.ts +0 -7
- package/dist/relay-environment.js +0 -34
- package/dist/utils/interpolateOrderVariableDescription.d.ts +0 -36
- package/dist/utils/interpolateOrderVariableDescription.test.d.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-C4ak9qTL.js","sources":["../../node_modules/react-error-boundary/dist/react-error-boundary.esm.js","../../src/__generated__/TestModeBannerQuery.graphql.ts","../../src/components/TestModeBanner/index.tsx","../../src/__generated__/ThemeConfigQuery.graphql.ts","../../src/components/ThemeConfig/index.tsx","../../src/components/UrlContext.ts","../../src/components/FontdueProvider/FontdueProviderClientComponent.tsx","../../src/components/FontdueProvider/useAuxUIOwner.ts","../../src/components/FontdueProvider/index.tsx"],"sourcesContent":["'use client';\nimport { createContext, Component, createElement, useContext, useState, useMemo, forwardRef } from 'react';\n\nconst ErrorBoundaryContext = createContext(null);\n\nconst initialState = {\n didCatch: false,\n error: null\n};\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n this.state = initialState;\n }\n static getDerivedStateFromError(error) {\n return {\n didCatch: true,\n error\n };\n }\n resetErrorBoundary() {\n const {\n error\n } = this.state;\n if (error !== null) {\n var _this$props$onReset, _this$props;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {\n args,\n reason: \"imperative-api\"\n });\n this.setState(initialState);\n }\n }\n componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);\n }\n componentDidUpdate(prevProps, prevState) {\n const {\n didCatch\n } = this.state;\n const {\n resetKeys\n } = this.props;\n\n // There's an edge case where if the thing that triggered the error happens to *also* be in the resetKeys array,\n // we'd end up resetting the error boundary immediately.\n // This would likely trigger a second error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call of cDU after the error is set.\n\n if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {\n var _this$props$onReset2, _this$props3;\n (_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {\n next: resetKeys,\n prev: prevProps.resetKeys,\n reason: \"keys\"\n });\n this.setState(initialState);\n }\n }\n render() {\n const {\n children,\n fallbackRender,\n FallbackComponent,\n fallback\n } = this.props;\n const {\n didCatch,\n error\n } = this.state;\n let childToRender = children;\n if (didCatch) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof fallbackRender === \"function\") {\n childToRender = fallbackRender(props);\n } else if (FallbackComponent) {\n childToRender = createElement(FallbackComponent, props);\n } else if (fallback !== undefined) {\n childToRender = fallback;\n } else {\n throw error;\n }\n }\n return createElement(ErrorBoundaryContext.Provider, {\n value: {\n didCatch,\n error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n }, childToRender);\n }\n}\nfunction hasArrayChanged() {\n let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));\n}\n\nfunction assertErrorBoundaryContext(value) {\n if (value == null || typeof value.didCatch !== \"boolean\" || typeof value.resetErrorBoundary !== \"function\") {\n throw new Error(\"ErrorBoundaryContext not found\");\n }\n}\n\nfunction useErrorBoundary() {\n const context = useContext(ErrorBoundaryContext);\n assertErrorBoundaryContext(context);\n const [state, setState] = useState({\n error: null,\n hasError: false\n });\n const memoized = useMemo(() => ({\n resetBoundary: () => {\n context.resetErrorBoundary();\n setState({\n error: null,\n hasError: false\n });\n },\n showBoundary: error => setState({\n error,\n hasError: true\n })\n }), [context.resetErrorBoundary]);\n if (state.hasError) {\n throw state.error;\n }\n return memoized;\n}\n\nfunction withErrorBoundary(component, errorBoundaryProps) {\n const Wrapped = forwardRef((props, ref) => createElement(ErrorBoundary, errorBoundaryProps, createElement(component, {\n ...props,\n ref\n })));\n\n // Format for display in DevTools\n const name = component.displayName || component.name || \"Unknown\";\n Wrapped.displayName = \"withErrorBoundary(\".concat(name, \")\");\n return Wrapped;\n}\n\nexport { ErrorBoundary, ErrorBoundaryContext, useErrorBoundary, withErrorBoundary };\n","/**\n * @generated SignedSource<<e395904ea5bda751df1ca67f9c74ac55>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest } from 'relay-runtime';\nexport type TestModeBannerQuery$variables = Record<PropertyKey, never>;\nexport type TestModeBannerQuery$data = {\n readonly viewer: {\n readonly testMode: {\n readonly isActive: boolean;\n };\n };\n};\nexport type TestModeBannerQuery = {\n response: TestModeBannerQuery$data;\n variables: TestModeBannerQuery$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"TestMode\",\n \"kind\": \"LinkedField\",\n \"name\": \"testMode\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"isActive\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n};\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"TestModeBannerQuery\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"Viewer\",\n \"kind\": \"LinkedField\",\n \"name\": \"viewer\",\n \"plural\": false,\n \"selections\": [\n (v0/*: any*/)\n ],\n \"storageKey\": null\n }\n ],\n \"type\": \"RootQueryType\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"TestModeBannerQuery\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"Viewer\",\n \"kind\": \"LinkedField\",\n \"name\": \"viewer\",\n \"plural\": false,\n \"selections\": [\n (v0/*: any*/),\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n ]\n },\n \"params\": {\n \"cacheID\": \"2cb9255aeee9b1b3edd823ee2f62d8cc\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"TestModeBannerQuery\",\n \"operationKind\": \"query\",\n \"text\": \"query TestModeBannerQuery {\\n viewer {\\n testMode {\\n isActive\\n }\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"60ad67ee88ec6b74dd04bdf5572e7faf\";\n\nexport default node;\n","'use client';\nimport React from 'react';\nimport { graphql, useLazyLoadQuery } from 'react-relay';\nimport {\n TestModeBannerQuery,\n TestModeBannerQuery$data,\n} from '../../__generated__/TestModeBannerQuery.graphql';\n\ninterface TestModeBannerComponent_props {\n data: TestModeBannerQuery$data;\n}\n\nfunction TestModeBannerComponent({ data }: TestModeBannerComponent_props) {\n const isActive = data?.viewer?.testMode?.isActive;\n\n // hide the banner completely if we're in live mode\n if (!isActive) return null;\n\n return (\n <div className=\"test-mode-banner__banner\" data-test-mode={isActive}>\n <div className=\"test-mode-banner__content\">\n <div className=\"test-mode-banner__title\">Viewing test data</div>\n </div>\n </div>\n );\n}\n\nconst query = graphql`\n query TestModeBannerQuery {\n viewer {\n testMode {\n isActive\n }\n }\n }\n`;\n\nexport default function TestModeBanner() {\n const data = useLazyLoadQuery<TestModeBannerQuery>(query, {});\n\n return <TestModeBannerComponent data={data} />;\n}\n","/**\n * @generated SignedSource<<b292c0ac6583f7d2d7cd8979e5696b21>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest } from 'relay-runtime';\nexport type ThemeConfigQuery$variables = Record<PropertyKey, never>;\nexport type ThemeConfigQuery$data = {\n readonly viewer: {\n readonly themeConfig: {\n readonly customProperties: ReadonlyArray<string> | null;\n } | null;\n };\n};\nexport type ThemeConfigQuery = {\n response: ThemeConfigQuery$data;\n variables: ThemeConfigQuery$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"ThemeConfig\",\n \"kind\": \"LinkedField\",\n \"name\": \"themeConfig\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"customProperties\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n};\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ThemeConfigQuery\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"Viewer\",\n \"kind\": \"LinkedField\",\n \"name\": \"viewer\",\n \"plural\": false,\n \"selections\": [\n (v0/*: any*/)\n ],\n \"storageKey\": null\n }\n ],\n \"type\": \"RootQueryType\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ThemeConfigQuery\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"Viewer\",\n \"kind\": \"LinkedField\",\n \"name\": \"viewer\",\n \"plural\": false,\n \"selections\": [\n (v0/*: any*/),\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n ]\n },\n \"params\": {\n \"cacheID\": \"d1f54ccc72720516df3faf57461c20e1\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ThemeConfigQuery\",\n \"operationKind\": \"query\",\n \"text\": \"query ThemeConfigQuery {\\n viewer {\\n themeConfig {\\n customProperties\\n }\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"c259bee038c4d2ea14c758fba3381f57\";\n\nexport default node;\n","'use client';\nimport React from 'react';\nimport { graphql, useLazyLoadQuery, usePreloadedQuery } from 'react-relay';\nimport {\n ThemeConfigQuery,\n ThemeConfigQuery$data,\n} from '../../__generated__/ThemeConfigQuery.graphql';\nimport { SerializablePreloadedQuery } from '../../relay/loadSerializableQuery';\nimport useSerializablePreloadedQuery from '../../relay/useSerializablePreloadedQuery';\n\n// gets the custom properties entered by users in the admin panel,\n// which also includes default values. we put the defaults there instead of\n// every call to var() so that we have defaults all in one place\n\nfunction ThemeConfigComponent({ data }: { data: ThemeConfigQuery$data }) {\n const props = data.viewer.themeConfig?.customProperties ?? [];\n return <style type=\"text/css\">{`:root { ${props.join(';')} }`}</style>;\n}\n\nconst query = graphql`\n query ThemeConfigQuery {\n viewer {\n themeConfig {\n customProperties\n }\n }\n }\n`;\n\nexport function ThemeConfigPreloadedQueryRenderer({\n preloadedQuery,\n}: {\n preloadedQuery: SerializablePreloadedQuery<ThemeConfigQuery>;\n}) {\n const queryRef = useSerializablePreloadedQuery(preloadedQuery);\n const data = usePreloadedQuery(query, queryRef);\n return <ThemeConfigComponent data={data} />;\n}\n\nexport default function ThemeConfig() {\n const data = useLazyLoadQuery<ThemeConfigQuery>(query, {});\n return <ThemeConfigComponent data={data} />;\n}\n","import { createContext, useContext } from 'react';\n\nconst FONTDUE_URL =\n typeof process !== 'undefined' ? process.env.NEXT_PUBLIC_FONTDUE_URL : undefined;\n\nconst UrlContext = createContext<string>(FONTDUE_URL ?? '');\n\nexport function useFontdueUrl(): string {\n return useContext(UrlContext);\n}\n\nexport default UrlContext;\n","'use client';\nimport React, { Suspense, lazy, useRef } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { Provider } from 'react-redux';\nimport { Store } from 'redux';\nimport { RelayEnvironmentProvider } from 'react-relay';\nimport { useCurrentEnvironment } from '../../relay/environment';\nimport ConfigContext, { Config, makeConfig } from '../ConfigContext';\nimport { FontdueAction, FontdueState, createDefaultStore } from '../../reducer';\nimport ComponentsContext, { Components } from '../ComponentsContext';\nimport UrlContext from '../UrlContext';\nimport retryImport from '../../retryImport';\n\nconst IS_SERVER = typeof window === typeof undefined;\n\n// Client-side Redux store is a module-level singleton so multiple\n// FontdueProviders on a page (e.g. one per Astro island) share cart state,\n// user state, etc. Server-side stays per-render.\nlet clientStore: Store<FontdueState, FontdueAction> | null = null;\n\nfunction useSharedStore(\n providedStore: Store<FontdueState, FontdueAction> | undefined,\n config: Config | undefined,\n): Store<FontdueState, FontdueAction> {\n const ref = useRef<Store<FontdueState, FontdueAction> | null>(null);\n if (providedStore) return providedStore;\n if (IS_SERVER) {\n if (ref.current == null) ref.current = createDefaultStore(config);\n return ref.current;\n }\n if (clientStore == null) clientStore = createDefaultStore(config);\n return clientStore;\n}\n\nconst ConsentBanner = lazy(() => retryImport(() => import('../ConsentBanner')));\nconst Tracking = lazy(() => retryImport(() => import('../Tracking')));\nconst ServerConfigProvider = lazy(() => retryImport(() => import('../ServerConfigProvider')));\n\nexport interface FontdueProvider_props {\n children?: React.ReactNode;\n url?: string;\n stripeIntegration?: 'card-element' | 'dynamic';\n config?: Config;\n components?: Components;\n store?: Store<FontdueState, FontdueAction>;\n}\n\nexport default function FontdueProviderClientComponent({\n children,\n url,\n stripeIntegration,\n config,\n components,\n store,\n renderAuxUI,\n}: FontdueProvider_props & { renderAuxUI?: boolean }) {\n const environment = useCurrentEnvironment({ url, stripeIntegration });\n\n const configValue = makeConfig(config);\n\n const sharedStore = useSharedStore(store, config);\n\n return (\n <RelayEnvironmentProvider environment={environment}>\n <Provider store={sharedStore}>\n <Suspense fallback={null}>\n <ConfigContext.Provider value={configValue}>\n <UrlContext.Provider value={url ?? (typeof process !== 'undefined' ? process.env.NEXT_PUBLIC_FONTDUE_URL : undefined) ?? ''}>\n <ComponentsContext.Provider value={components ?? {}}>\n {children}\n {renderAuxUI && (\n <ErrorBoundary fallback={null}>\n <Suspense fallback={null}>\n <ServerConfigProvider codeConfig={config}>\n <ConsentBanner />\n <Tracking />\n </ServerConfigProvider>\n </Suspense>\n </ErrorBoundary>\n )}\n </ComponentsContext.Provider>\n </UrlContext.Provider>\n </ConfigContext.Provider>\n </Suspense>\n </Provider>\n </RelayEnvironmentProvider>\n );\n}\n","'use client';\nimport { useEffect, useState } from 'react';\n\n// Module-level claim: only one FontdueProvider on a page renders\n// auxiliary UI (TestModeBanner, ThemeConfig, Tracking, ConsentBanner,\n// ServerConfigProvider). Starts false on both server and client to avoid\n// hydration mismatch; the first provider to run `useEffect` wins and flips\n// its own state to true. Relinquishes the claim on unmount so HMR and\n// route changes don't leak.\n\nlet ownerId: object | null = null;\n\nexport default function useAuxUIOwner(): boolean {\n const [isOwner, setIsOwner] = useState(false);\n\n useEffect(() => {\n const myId = {};\n if (ownerId == null) {\n ownerId = myId;\n setIsOwner(true);\n }\n return () => {\n if (ownerId === myId) {\n ownerId = null;\n }\n };\n }, []);\n\n return isOwner;\n}\n","'use client';\nimport React, { Suspense } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport TestModeBanner from '../TestModeBanner';\nimport ThemeConfig from '../ThemeConfig';\nimport FontdueProviderClientComponent from './FontdueProviderClientComponent';\nimport type { FontdueProvider_props } from './FontdueProviderClientComponent';\nimport useAuxUIOwner from './useAuxUIOwner';\n\n// Wrap each aux UI component in its own Suspense + ErrorBoundary so that its\n// query suspending (useLazyLoadQuery fetches on first client render) or\n// failing (CORS / offline / etc.) can't blank out the consumer's rendered\n// children. Without this, TestModeBanner's TestModeBannerQuery suspends the\n// whole provider subtree on hydration and the user sees a visible\n// unmount/remount flash on the TypeTester.\nfunction IsolatedAuxUI({ children }: { children: React.ReactNode }) {\n return (\n <ErrorBoundary fallback={null}>\n <Suspense fallback={null}>{children}</Suspense>\n </ErrorBoundary>\n );\n}\n\nconst FontdueProvider = ({ children, ...rest }: FontdueProvider_props) => {\n const isAuxOwner = useAuxUIOwner();\n return (\n <FontdueProviderClientComponent {...rest} renderAuxUI={isAuxOwner}>\n {isAuxOwner && (\n <IsolatedAuxUI>\n <TestModeBanner />\n </IsolatedAuxUI>\n )}\n {isAuxOwner && (\n <IsolatedAuxUI>\n <ThemeConfig />\n </IsolatedAuxUI>\n )}\n {children}\n </FontdueProviderClientComponent>\n );\n};\n\nexport type { FontdueProvider_props };\n\nexport default FontdueProvider;\n"],"names":["node","v0","hash","TestModeBannerComponent","data","isActive","viewer","testMode","React","createElement","className","query","_TestModeBannerQuery","console","error","TestModeBanner","useLazyLoadQuery","ThemeConfigComponent","props","themeConfig","customProperties","type","join","_ThemeConfigQuery","ThemeConfig","FONTDUE_URL","process","env","NEXT_PUBLIC_FONTDUE_URL","undefined","UrlContext","createContext","useFontdueUrl","useContext","IS_SERVER","window","clientStore","useSharedStore","providedStore","config","ref","useRef","current","createDefaultStore","ConsentBanner","lazy","retryImport","Tracking","ServerConfigProvider","FontdueProviderClientComponent","children","url","stripeIntegration","components","store","renderAuxUI","environment","useCurrentEnvironment","configValue","makeConfig","sharedStore","RelayEnvironmentProvider","Provider","Suspense","fallback","ConfigContext","value","ComponentsContext","ErrorBoundary","codeConfig","ownerId","useAuxUIOwner","isOwner","setIsOwner","useState","useEffect","myId","IsolatedAuxUI","FontdueProvider","rest","isAuxOwner","_extends"],"mappings":";;;AAGA,MAAM,oBAAoB,GAAG,aAAa,CAAC,IAAI,CAAC;;AAEhD,MAAM,YAAY,GAAG;AACrB,EAAE,QAAQ,EAAE,KAAK;AACjB,EAAE,KAAK,EAAE;AACT,CAAC;AACD,MAAM,aAAa,SAAS,SAAS,CAAC;AACtC,EAAE,WAAW,CAAC,KAAK,EAAE;AACrB,IAAI,KAAK,CAAC,KAAK,CAAC;AAChB,IAAI,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;AAChE,IAAI,IAAI,CAAC,KAAK,GAAG,YAAY;AAC7B,EAAE;AACF,EAAE,OAAO,wBAAwB,CAAC,KAAK,EAAE;AACzC,IAAI,OAAO;AACX,MAAM,QAAQ,EAAE,IAAI;AACpB,MAAM;AACN,KAAK;AACL,EAAE;AACF,EAAE,kBAAkB,GAAG;AACvB,IAAI,MAAM;AACV,MAAM;AACN,KAAK,GAAG,IAAI,CAAC,KAAK;AAClB,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE;AACxB,MAAM,IAAI,mBAAmB,EAAE,WAAW;AAC1C,MAAM,KAAK,IAAI,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,I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from './ComponentsContext-CmkN9J4X.js';
|
|
3
|
+
import { u as useFontdueUrl } from './index-C4ak9qTL.js';
|
|
4
|
+
import { h as hasConsent, o as onConsent, b as setClientAnonymousId } from './consent-DMvR5rEh.js';
|
|
5
|
+
import '../index.js';
|
|
6
|
+
|
|
7
|
+
function getCampaignDataFromUrl() {
|
|
8
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
9
|
+
const campaign = {};
|
|
10
|
+
const properties = {};
|
|
11
|
+
let hasCampaign = false;
|
|
12
|
+
let hasProperties = false;
|
|
13
|
+
const utmMapping = {
|
|
14
|
+
utm_source: 'source',
|
|
15
|
+
utm_medium: 'medium',
|
|
16
|
+
utm_campaign: 'name',
|
|
17
|
+
utm_term: 'term',
|
|
18
|
+
utm_content: 'content'
|
|
19
|
+
};
|
|
20
|
+
for (const [urlParam, campaignKey] of Object.entries(utmMapping)) {
|
|
21
|
+
const value = urlParams.get(urlParam);
|
|
22
|
+
if (value) {
|
|
23
|
+
campaign[campaignKey] = value;
|
|
24
|
+
hasCampaign = true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const clickIds = ['gclid', 'fbclid'];
|
|
28
|
+
for (const param of clickIds) {
|
|
29
|
+
const value = urlParams.get(param);
|
|
30
|
+
if (value) {
|
|
31
|
+
properties[param] = value;
|
|
32
|
+
hasProperties = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
campaign: hasCampaign ? campaign : null,
|
|
37
|
+
properties: hasProperties ? properties : null
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async function sendPageView(baseUrl, anonymousId) {
|
|
41
|
+
try {
|
|
42
|
+
const {
|
|
43
|
+
campaign,
|
|
44
|
+
properties: clickIdProperties
|
|
45
|
+
} = getCampaignDataFromUrl();
|
|
46
|
+
const properties = {
|
|
47
|
+
url: window.location.href,
|
|
48
|
+
path: window.location.pathname,
|
|
49
|
+
referrer: document.referrer,
|
|
50
|
+
title: document.title,
|
|
51
|
+
search: window.location.search,
|
|
52
|
+
...clickIdProperties
|
|
53
|
+
};
|
|
54
|
+
const context = {
|
|
55
|
+
userAgent: navigator.userAgent
|
|
56
|
+
};
|
|
57
|
+
if (campaign) {
|
|
58
|
+
context.campaign = campaign;
|
|
59
|
+
}
|
|
60
|
+
const body = {
|
|
61
|
+
properties,
|
|
62
|
+
context
|
|
63
|
+
};
|
|
64
|
+
if (anonymousId) {
|
|
65
|
+
body.anonymous_id = anonymousId;
|
|
66
|
+
}
|
|
67
|
+
const response = await fetch(`${baseUrl}/api/track/page`, {
|
|
68
|
+
method: 'POST',
|
|
69
|
+
headers: {
|
|
70
|
+
'Content-Type': 'application/json'
|
|
71
|
+
},
|
|
72
|
+
credentials: 'include',
|
|
73
|
+
body: JSON.stringify(body)
|
|
74
|
+
});
|
|
75
|
+
const data = await response.json();
|
|
76
|
+
return data.anonymous_id || null;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.debug('Tracking error:', error);
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const Tracking = () => {
|
|
83
|
+
const config = useContext(ConfigContext);
|
|
84
|
+
const url = useFontdueUrl();
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!config.tracking.enabled) return;
|
|
87
|
+
|
|
88
|
+
// Generate client-side anonymous ID for cookieless tracking when consent is required
|
|
89
|
+
const clientAnonymousId = config.tracking.consentRequired ? crypto.randomUUID() : undefined;
|
|
90
|
+
if (clientAnonymousId) {
|
|
91
|
+
setClientAnonymousId(clientAnonymousId);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Only send the client ID when in cookieless mode (consent required but not yet granted)
|
|
95
|
+
const analyticsConsent = hasConsent('analytics');
|
|
96
|
+
const effectiveAnonymousId = clientAnonymousId && config.tracking.consentRequired && !analyticsConsent ? clientAnonymousId : undefined;
|
|
97
|
+
|
|
98
|
+
// Send initial page view
|
|
99
|
+
const pageViewPromise = sendPageView(url, effectiveAnonymousId);
|
|
100
|
+
|
|
101
|
+
// Segment SDK for device-mode integrations (e.g. Google Tag Manager)
|
|
102
|
+
// The analytics factory is provided by the entry point — it calls AnalyticsBrowser.load()
|
|
103
|
+
// when invoked. We defer calling it until after consent when consentRequired is true.
|
|
104
|
+
const loadAnalytics = config.tracking.segment?.analytics;
|
|
105
|
+
const integrations = config.tracking.segment?.integrations || {
|
|
106
|
+
All: false,
|
|
107
|
+
'Google Tag Manager': true
|
|
108
|
+
};
|
|
109
|
+
let consentCleanup;
|
|
110
|
+
if (loadAnalytics) {
|
|
111
|
+
const fireSegmentPage = async () => {
|
|
112
|
+
try {
|
|
113
|
+
const analytics = loadAnalytics();
|
|
114
|
+
const anonymousId = await pageViewPromise;
|
|
115
|
+
if (anonymousId) {
|
|
116
|
+
await analytics.setAnonymousId(anonymousId);
|
|
117
|
+
}
|
|
118
|
+
await analytics.page(undefined, undefined, undefined, {
|
|
119
|
+
integrations
|
|
120
|
+
});
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.debug('Segment SDK error:', error);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
if (config.tracking.consentRequired) {
|
|
126
|
+
consentCleanup = onConsent('analytics', fireSegmentPage);
|
|
127
|
+
} else {
|
|
128
|
+
fireSegmentPage();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Track client-side route changes
|
|
133
|
+
const originalPushState = history.pushState.bind(history);
|
|
134
|
+
const originalReplaceState = history.replaceState.bind(history);
|
|
135
|
+
const handleRouteChange = () => {
|
|
136
|
+
// Defer slightly to let document.title update
|
|
137
|
+
setTimeout(() => sendPageView(url), 0);
|
|
138
|
+
};
|
|
139
|
+
history.pushState = function (...args) {
|
|
140
|
+
originalPushState(...args);
|
|
141
|
+
handleRouteChange();
|
|
142
|
+
};
|
|
143
|
+
history.replaceState = function (...args) {
|
|
144
|
+
originalReplaceState(...args);
|
|
145
|
+
handleRouteChange();
|
|
146
|
+
};
|
|
147
|
+
window.addEventListener('popstate', handleRouteChange);
|
|
148
|
+
return () => {
|
|
149
|
+
history.pushState = originalPushState;
|
|
150
|
+
history.replaceState = originalReplaceState;
|
|
151
|
+
window.removeEventListener('popstate', handleRouteChange);
|
|
152
|
+
consentCleanup?.();
|
|
153
|
+
};
|
|
154
|
+
}, []);
|
|
155
|
+
return null;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export { Tracking as default };
|
|
159
|
+
//# sourceMappingURL=index-DsvF5W13.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DsvF5W13.js","sources":["../../src/components/Tracking/index.tsx"],"sourcesContent":["'use client';\nimport { useContext, useEffect } from 'react';\nimport ConfigContext from '../ConfigContext';\nimport { useFontdueUrl } from '../UrlContext';\nimport { hasConsent, onConsent, setClientAnonymousId } from '../ConsentBanner/consent';\n\nfunction getCampaignDataFromUrl() {\n const urlParams = new URLSearchParams(window.location.search);\n const campaign: Record<string, string> = {};\n const properties: Record<string, string> = {};\n let hasCampaign = false;\n let hasProperties = false;\n\n const utmMapping: Record<string, string> = {\n utm_source: 'source',\n utm_medium: 'medium',\n utm_campaign: 'name',\n utm_term: 'term',\n utm_content: 'content',\n };\n\n for (const [urlParam, campaignKey] of Object.entries(utmMapping)) {\n const value = urlParams.get(urlParam);\n if (value) {\n campaign[campaignKey] = value;\n hasCampaign = true;\n }\n }\n\n const clickIds = ['gclid', 'fbclid'];\n for (const param of clickIds) {\n const value = urlParams.get(param);\n if (value) {\n properties[param] = value;\n hasProperties = true;\n }\n }\n\n return {\n campaign: hasCampaign ? campaign : null,\n properties: hasProperties ? properties : null,\n };\n}\n\nasync function sendPageView(\n baseUrl: string,\n anonymousId?: string,\n): Promise<string | null> {\n try {\n const { campaign, properties: clickIdProperties } = getCampaignDataFromUrl();\n\n const properties: Record<string, unknown> = {\n url: window.location.href,\n path: window.location.pathname,\n referrer: document.referrer,\n title: document.title,\n search: window.location.search,\n ...clickIdProperties,\n };\n\n const context: Record<string, unknown> = {\n userAgent: navigator.userAgent,\n };\n\n if (campaign) {\n context.campaign = campaign;\n }\n\n const body: Record<string, unknown> = { properties, context };\n\n if (anonymousId) {\n body.anonymous_id = anonymousId;\n }\n\n const response = await fetch(`${baseUrl}/api/track/page`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n credentials: 'include',\n body: JSON.stringify(body),\n });\n\n const data = await response.json();\n return data.anonymous_id || null;\n } catch (error) {\n console.debug('Tracking error:', error);\n return null;\n }\n}\n\nconst Tracking = () => {\n const config = useContext(ConfigContext);\n const url = useFontdueUrl();\n\n useEffect(() => {\n if (!config.tracking.enabled) return;\n\n // Generate client-side anonymous ID for cookieless tracking when consent is required\n const clientAnonymousId = config.tracking.consentRequired\n ? crypto.randomUUID()\n : undefined;\n\n if (clientAnonymousId) {\n setClientAnonymousId(clientAnonymousId);\n }\n\n // Only send the client ID when in cookieless mode (consent required but not yet granted)\n const analyticsConsent = hasConsent('analytics');\n const effectiveAnonymousId =\n clientAnonymousId && config.tracking.consentRequired && !analyticsConsent\n ? clientAnonymousId\n : undefined;\n\n // Send initial page view\n const pageViewPromise = sendPageView(url, effectiveAnonymousId);\n\n // Segment SDK for device-mode integrations (e.g. Google Tag Manager)\n // The analytics factory is provided by the entry point — it calls AnalyticsBrowser.load()\n // when invoked. We defer calling it until after consent when consentRequired is true.\n const loadAnalytics = config.tracking.segment?.analytics;\n const integrations = config.tracking.segment?.integrations || {\n All: false,\n 'Google Tag Manager': true,\n };\n\n let consentCleanup: (() => void) | undefined;\n\n if (loadAnalytics) {\n const fireSegmentPage = async () => {\n try {\n const analytics = loadAnalytics();\n const anonymousId = await pageViewPromise;\n if (anonymousId) {\n await analytics.setAnonymousId(anonymousId);\n }\n await analytics.page(undefined, undefined, undefined, { integrations });\n } catch (error) {\n console.debug('Segment SDK error:', error);\n }\n };\n\n if (config.tracking.consentRequired) {\n consentCleanup = onConsent('analytics', fireSegmentPage);\n } else {\n fireSegmentPage();\n }\n }\n\n // Track client-side route changes\n const originalPushState = history.pushState.bind(history);\n const originalReplaceState = history.replaceState.bind(history);\n\n const handleRouteChange = () => {\n // Defer slightly to let document.title update\n setTimeout(() => sendPageView(url), 0);\n };\n\n history.pushState = function (...args: Parameters<typeof history.pushState>) {\n originalPushState(...args);\n handleRouteChange();\n };\n\n history.replaceState = function (...args: Parameters<typeof history.replaceState>) {\n originalReplaceState(...args);\n handleRouteChange();\n };\n\n window.addEventListener('popstate', handleRouteChange);\n\n return () => {\n history.pushState = originalPushState;\n history.replaceState = originalReplaceState;\n window.removeEventListener('popstate', handleRouteChange);\n consentCleanup?.();\n };\n }, []);\n\n return null;\n};\n\nexport default Tracking;\n"],"names":["getCampaignDataFromUrl","urlParams","URLSearchParams","window","location","search","campaign","properties","hasCampaign","hasProperties","utmMapping","utm_source","utm_medium","utm_campaign","utm_term","utm_content","urlParam","campaignKey","Object","entries","value","get","clickIds","param","sendPageView","baseUrl","anonymousId","clickIdProperties","url","href","path","pathname","referrer","document","title","context","userAgent","navigator","body","anonymous_id","response","fetch","method","headers","credentials","JSON","stringify","data","json","error","console","debug","Tracking","config","useContext","ConfigContext","useFontdueUrl","useEffect","tracking","enabled","clientAnonymousId","consentRequired","crypto","randomUUID","undefined","setClientAnonymousId","analyticsConsent","hasConsent","effectiveAnonymousId","pageViewPromise","loadAnalytics","segment","analytics","integrations","All","consentCleanup","fireSegmentPage","setAnonymousId","page","onConsent","originalPushState","history","pushState","bind","originalReplaceState","replaceState","handleRouteChange","setTimeout","args","addEventListener","removeEventListener"],"mappings":";;;;;;AAMA,SAASA,sBAAsBA,GAAG;EAChC,MAAMC,SAAS,GAAG,IAAIC,eAAe,CAACC,MAAM,CAACC,QAAQ,CAACC,MAAM,CAAC;EAC7D,MAAMC,QAAgC,GAAG,EAAE;EAC3C,MAAMC,UAAkC,GAAG,EAAE;EAC7C,IAAIC,WAAW,GAAG,KAAK;EACvB,IAAIC,aAAa,GAAG,KAAK;AAEzB,EAAA,MAAM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__default from 'react';
|
|
2
|
+
import { r as reactRelayExports, m as makeConfig, C as ConfigContext } from './ComponentsContext-CmkN9J4X.js';
|
|
3
|
+
import '../index.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @generated SignedSource<<e36d7651684826ea0cac76a464f23dcd>>
|
|
7
|
+
* @lightSyntaxTransform
|
|
8
|
+
* @nogrep
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/* tslint:disable */
|
|
12
|
+
/* eslint-disable */
|
|
13
|
+
// @ts-nocheck
|
|
14
|
+
|
|
15
|
+
const node = function () {
|
|
16
|
+
var v0 = {
|
|
17
|
+
"alias": null,
|
|
18
|
+
"args": null,
|
|
19
|
+
"concreteType": "FontdueConfig",
|
|
20
|
+
"kind": "LinkedField",
|
|
21
|
+
"name": "fontdueConfig",
|
|
22
|
+
"plural": false,
|
|
23
|
+
"selections": [{
|
|
24
|
+
"alias": null,
|
|
25
|
+
"args": null,
|
|
26
|
+
"concreteType": "FontdueTrackingConfig",
|
|
27
|
+
"kind": "LinkedField",
|
|
28
|
+
"name": "tracking",
|
|
29
|
+
"plural": false,
|
|
30
|
+
"selections": [{
|
|
31
|
+
"alias": null,
|
|
32
|
+
"args": null,
|
|
33
|
+
"kind": "ScalarField",
|
|
34
|
+
"name": "enabled",
|
|
35
|
+
"storageKey": null
|
|
36
|
+
}, {
|
|
37
|
+
"alias": null,
|
|
38
|
+
"args": null,
|
|
39
|
+
"kind": "ScalarField",
|
|
40
|
+
"name": "consentRequired",
|
|
41
|
+
"storageKey": null
|
|
42
|
+
}, {
|
|
43
|
+
"alias": null,
|
|
44
|
+
"args": null,
|
|
45
|
+
"kind": "ScalarField",
|
|
46
|
+
"name": "consentMessage",
|
|
47
|
+
"storageKey": null
|
|
48
|
+
}],
|
|
49
|
+
"storageKey": null
|
|
50
|
+
}],
|
|
51
|
+
"storageKey": null
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
"fragment": {
|
|
55
|
+
"argumentDefinitions": [],
|
|
56
|
+
"kind": "Fragment",
|
|
57
|
+
"metadata": null,
|
|
58
|
+
"name": "ServerConfigProviderQuery",
|
|
59
|
+
"selections": [{
|
|
60
|
+
"alias": null,
|
|
61
|
+
"args": null,
|
|
62
|
+
"concreteType": "Viewer",
|
|
63
|
+
"kind": "LinkedField",
|
|
64
|
+
"name": "viewer",
|
|
65
|
+
"plural": false,
|
|
66
|
+
"selections": [v0 /*: any*/],
|
|
67
|
+
"storageKey": null
|
|
68
|
+
}],
|
|
69
|
+
"type": "RootQueryType",
|
|
70
|
+
"abstractKey": null
|
|
71
|
+
},
|
|
72
|
+
"kind": "Request",
|
|
73
|
+
"operation": {
|
|
74
|
+
"argumentDefinitions": [],
|
|
75
|
+
"kind": "Operation",
|
|
76
|
+
"name": "ServerConfigProviderQuery",
|
|
77
|
+
"selections": [{
|
|
78
|
+
"alias": null,
|
|
79
|
+
"args": null,
|
|
80
|
+
"concreteType": "Viewer",
|
|
81
|
+
"kind": "LinkedField",
|
|
82
|
+
"name": "viewer",
|
|
83
|
+
"plural": false,
|
|
84
|
+
"selections": [v0 /*: any*/, {
|
|
85
|
+
"alias": null,
|
|
86
|
+
"args": null,
|
|
87
|
+
"kind": "ScalarField",
|
|
88
|
+
"name": "id",
|
|
89
|
+
"storageKey": null
|
|
90
|
+
}],
|
|
91
|
+
"storageKey": null
|
|
92
|
+
}]
|
|
93
|
+
},
|
|
94
|
+
"params": {
|
|
95
|
+
"cacheID": "46fad3541d5416ad34b29b1a4e707f19",
|
|
96
|
+
"id": null,
|
|
97
|
+
"metadata": {},
|
|
98
|
+
"name": "ServerConfigProviderQuery",
|
|
99
|
+
"operationKind": "query",
|
|
100
|
+
"text": "query ServerConfigProviderQuery {\n viewer {\n fontdueConfig {\n tracking {\n enabled\n consentRequired\n consentMessage\n }\n }\n id\n }\n}\n"
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}();
|
|
104
|
+
node.hash = "b20ad9bdada6a425ee660a8662a78840";
|
|
105
|
+
|
|
106
|
+
const query = (node.hash && node.hash !== "b20ad9bdada6a425ee660a8662a78840" && console.error("The definition of 'ServerConfigProviderQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), node);
|
|
107
|
+
const ServerConfigProvider = ({
|
|
108
|
+
codeConfig,
|
|
109
|
+
children
|
|
110
|
+
}) => {
|
|
111
|
+
const data = reactRelayExports.useLazyLoadQuery(query, {});
|
|
112
|
+
const tracking = data.viewer?.fontdueConfig?.tracking;
|
|
113
|
+
|
|
114
|
+
// Server config is the base; code config overrides.
|
|
115
|
+
const merged = {
|
|
116
|
+
...codeConfig,
|
|
117
|
+
tracking: {
|
|
118
|
+
enabled: tracking?.enabled,
|
|
119
|
+
consentRequired: tracking?.consentRequired,
|
|
120
|
+
consentMessage: tracking?.consentMessage ?? undefined,
|
|
121
|
+
...codeConfig?.tracking
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const configValue = makeConfig(merged);
|
|
125
|
+
return /*#__PURE__*/React__default.createElement(ConfigContext.Provider, {
|
|
126
|
+
value: configValue
|
|
127
|
+
}, children);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export { ServerConfigProvider as default };
|
|
131
|
+
//# sourceMappingURL=index-o29NNufd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-o29NNufd.js","sources":["../../src/__generated__/ServerConfigProviderQuery.graphql.ts","../../src/components/ServerConfigProvider/index.tsx"],"sourcesContent":["/**\n * @generated SignedSource<<e36d7651684826ea0cac76a464f23dcd>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest } from 'relay-runtime';\nexport type ServerConfigProviderQuery$variables = Record<PropertyKey, never>;\nexport type ServerConfigProviderQuery$data = {\n readonly viewer: {\n readonly fontdueConfig: {\n readonly tracking: {\n readonly consentMessage: string | null;\n readonly consentRequired: boolean;\n readonly enabled: boolean;\n } | null;\n } | null;\n };\n};\nexport type ServerConfigProviderQuery = {\n response: ServerConfigProviderQuery$data;\n variables: ServerConfigProviderQuery$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"FontdueConfig\",\n \"kind\": \"LinkedField\",\n \"name\": \"fontdueConfig\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"FontdueTrackingConfig\",\n \"kind\": \"LinkedField\",\n \"name\": \"tracking\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"enabled\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"consentRequired\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"consentMessage\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n};\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ServerConfigProviderQuery\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"Viewer\",\n \"kind\": \"LinkedField\",\n \"name\": \"viewer\",\n \"plural\": false,\n \"selections\": [\n (v0/*: any*/)\n ],\n \"storageKey\": null\n }\n ],\n \"type\": \"RootQueryType\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ServerConfigProviderQuery\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"Viewer\",\n \"kind\": \"LinkedField\",\n \"name\": \"viewer\",\n \"plural\": false,\n \"selections\": [\n (v0/*: any*/),\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n ]\n },\n \"params\": {\n \"cacheID\": \"46fad3541d5416ad34b29b1a4e707f19\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ServerConfigProviderQuery\",\n \"operationKind\": \"query\",\n \"text\": \"query ServerConfigProviderQuery {\\n viewer {\\n fontdueConfig {\\n tracking {\\n enabled\\n consentRequired\\n consentMessage\\n }\\n }\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"b20ad9bdada6a425ee660a8662a78840\";\n\nexport default node;\n","'use client';\nimport React from 'react';\nimport { graphql, useLazyLoadQuery } from 'react-relay';\nimport ConfigContext, { Config, makeConfig } from '../ConfigContext';\nimport type { ServerConfigProviderQuery } from '../../__generated__/ServerConfigProviderQuery.graphql';\n\nconst query = graphql`\n query ServerConfigProviderQuery {\n viewer {\n fontdueConfig {\n tracking {\n enabled\n consentRequired\n consentMessage\n }\n }\n }\n }\n`;\n\ninterface Props {\n codeConfig?: Config;\n children: React.ReactNode;\n}\n\nconst ServerConfigProvider = ({ codeConfig, children }: Props) => {\n const data = useLazyLoadQuery<ServerConfigProviderQuery>(query, {});\n const tracking = data.viewer?.fontdueConfig?.tracking;\n\n // Server config is the base; code config overrides.\n const merged: Config = {\n ...codeConfig,\n tracking: {\n enabled: tracking?.enabled,\n consentRequired: tracking?.consentRequired,\n consentMessage: tracking?.consentMessage ?? undefined,\n ...codeConfig?.tracking,\n },\n };\n const configValue = makeConfig(merged);\n\n return (\n <ConfigContext.Provider value={configValue}>\n {children}\n </ConfigContext.Provider>\n );\n};\n\nexport default ServerConfigProvider;\n"],"names":["node","v0","hash","query","_ServerConfigProviderQuery","console","error","ServerConfigProvider","codeConfig","children","data","useLazyLoadQuery","tracking","viewer","fontdueConfig","merged","enabled","consentRequired","consentMessage","undefined","configValue","makeConfig","React","createElement","ConfigContext","Provider","value"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;A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G,OAAA,CAAAC,KAAA,CAAA,yJAAA,CAAA,EAAAF,IAAA,CAYV;AAOD,MAAMG,oBAAoB,GAAGA,CAAC;EAAEC,UAAU;AAAEC,EAAAA;AAAgB,CAAC,KAAK;EAChE,MAAMC,IAAI,GAAGC,kCAAgB,CAA4BR,KAAK,EAAE,EAAE,CAAC;EACnE,MAAMS,QAAQ,GAAGF,IAAI,CAACG,MAAM,EAAEC,aAAa,EAAEF,QAAQ;;AAErD;AACA,EAAA,MAAMG,MAAc,GAAG;AACrB,IAAA,GAAGP,UAAU;AACbI,IAAAA,QAAQ,EAAE;MACRI,OAAO,EAAEJ,QAAQ,EAAEI,OAAO;MAC1BC,eAAe,EAAEL,QAAQ,EAAEK,eAAe;AAC1CC,MAAAA,cAAc,EAAEN,QAAQ,EAAEM,cAAc,IAAIC,SAAS;AACrD,MAAA,GAAGX,UAAU,EAAEI;AACjB;GACD;AACD,EAAA,MAAMQ,WAAW,GAAGC,UAAU,CAACN,MAAM,CAAC;AAEtC,EAAA,oBACEO,cAAA,CAAAC,aAAA,CAACC,aAAa,CAACC,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEN;AAAY,GAAA,EACxCX,QACqB,CAAC;AAE7B;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Module-level global configuration. Consumers call `configure()` once at
|
|
2
|
+
// app startup (e.g. Astro middleware, Next layout, Vite entry) and every
|
|
3
|
+
// fontdue-js entry point reads defaults from here. Explicit options passed
|
|
4
|
+
// to loadSerializableQuery / FontdueProvider still override.
|
|
5
|
+
//
|
|
6
|
+
// Per-request isolation note: `configure` sets module-level state. That's
|
|
7
|
+
// fine for single-tenant apps (one URL for the whole site). Multi-tenant
|
|
8
|
+
// servers that switch URL per request should pass `url` explicitly to
|
|
9
|
+
// loadSerializableQuery rather than rely on configure().
|
|
10
|
+
|
|
11
|
+
let current = {};
|
|
12
|
+
function configure(opts) {
|
|
13
|
+
current = {
|
|
14
|
+
...current,
|
|
15
|
+
...opts
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function getConfig() {
|
|
19
|
+
return current;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { configure, getConfig };
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/config.ts"],"sourcesContent":["// Module-level global configuration. Consumers call `configure()` once at\n// app startup (e.g. Astro middleware, Next layout, Vite entry) and every\n// fontdue-js entry point reads defaults from here. Explicit options passed\n// to loadSerializableQuery / FontdueProvider still override.\n//\n// Per-request isolation note: `configure` sets module-level state. That's\n// fine for single-tenant apps (one URL for the whole site). Multi-tenant\n// servers that switch URL per request should pass `url` explicitly to\n// loadSerializableQuery rather than rely on configure().\n\nexport interface FontdueConfig {\n url?: string;\n stripeIntegration?: 'card-element' | 'dynamic';\n}\n\nlet current: FontdueConfig = {};\n\nexport function configure(opts: Partial<FontdueConfig>): void {\n current = { ...current, ...opts };\n}\n\nexport function getConfig(): Readonly<FontdueConfig> {\n return current;\n}\n"],"names":["current","configure","opts","getConfig"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,IAAIA,OAAsB,GAAG,EAAE;AAExB,SAASC,SAASA,CAACC,IAA4B,EAAQ;AAC5DF,EAAAA,OAAO,GAAG;AAAE,IAAA,GAAGA,OAAO;IAAE,GAAGE;GAAM;AACnC;AAEO,SAASC,SAASA,GAA4B;AACnD,EAAA,OAAOH,OAAO;AAChB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated SignedSource<<c87eab2cbcaa29e842bab709c62be0b1>>
|
|
3
|
-
* @lightSyntaxTransform
|
|
4
|
-
* @nogrep
|
|
5
|
-
*/
|
|
6
|
-
import { ReaderFragment } from 'relay-runtime';
|
|
7
|
-
import { FragmentRefs } from "relay-runtime";
|
|
8
|
-
export type CartItem_license$data = {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly name: string | null;
|
|
11
|
-
readonly variables: ReadonlyArray<{
|
|
12
|
-
readonly id: string;
|
|
13
|
-
readonly name: string | null;
|
|
14
|
-
readonly options: ReadonlyArray<{
|
|
15
|
-
readonly amount: string | null;
|
|
16
|
-
readonly id: string;
|
|
17
|
-
readonly name: string | null;
|
|
18
|
-
}> | null;
|
|
19
|
-
readonly variableType: string | null;
|
|
20
|
-
}> | null;
|
|
21
|
-
};
|
|
22
|
-
export type CartItem_license$key = {
|
|
23
|
-
readonly " $data"?: CartItem_license$data;
|
|
24
|
-
readonly " $fragmentSpreads": FragmentRefs<"CartItem_license">;
|
|
25
|
-
};
|
|
26
|
-
declare const node: ReaderFragment;
|
|
27
|
-
export default node;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* @generated SignedSource<<c87eab2cbcaa29e842bab709c62be0b1>>
|
|
9
|
-
* @lightSyntaxTransform
|
|
10
|
-
* @nogrep
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/* tslint:disable */
|
|
14
|
-
/* eslint-disable */
|
|
15
|
-
// @ts-nocheck
|
|
16
|
-
|
|
17
|
-
const node = function () {
|
|
18
|
-
var v0 = {
|
|
19
|
-
"alias": null,
|
|
20
|
-
"args": null,
|
|
21
|
-
"kind": "ScalarField",
|
|
22
|
-
"name": "id",
|
|
23
|
-
"storageKey": null
|
|
24
|
-
},
|
|
25
|
-
v1 = {
|
|
26
|
-
"alias": null,
|
|
27
|
-
"args": null,
|
|
28
|
-
"kind": "ScalarField",
|
|
29
|
-
"name": "name",
|
|
30
|
-
"storageKey": null
|
|
31
|
-
};
|
|
32
|
-
return {
|
|
33
|
-
"argumentDefinitions": [],
|
|
34
|
-
"kind": "Fragment",
|
|
35
|
-
"metadata": {
|
|
36
|
-
"mask": false
|
|
37
|
-
},
|
|
38
|
-
"name": "CartItem_license",
|
|
39
|
-
"selections": [v0 /*: any*/, v1 /*: any*/, {
|
|
40
|
-
"alias": "variables",
|
|
41
|
-
"args": null,
|
|
42
|
-
"concreteType": "LicenseVariable",
|
|
43
|
-
"kind": "LinkedField",
|
|
44
|
-
"name": "licenseVariables",
|
|
45
|
-
"plural": true,
|
|
46
|
-
"selections": [v0 /*: any*/, v1 /*: any*/, {
|
|
47
|
-
"alias": null,
|
|
48
|
-
"args": null,
|
|
49
|
-
"kind": "ScalarField",
|
|
50
|
-
"name": "variableType",
|
|
51
|
-
"storageKey": null
|
|
52
|
-
}, {
|
|
53
|
-
"alias": "options",
|
|
54
|
-
"args": null,
|
|
55
|
-
"concreteType": "LicenseOption",
|
|
56
|
-
"kind": "LinkedField",
|
|
57
|
-
"name": "licenseOptions",
|
|
58
|
-
"plural": true,
|
|
59
|
-
"selections": [v0 /*: any*/, {
|
|
60
|
-
"alias": null,
|
|
61
|
-
"args": null,
|
|
62
|
-
"kind": "ScalarField",
|
|
63
|
-
"name": "amount",
|
|
64
|
-
"storageKey": null
|
|
65
|
-
}, v1 /*: any*/],
|
|
66
|
-
"storageKey": null
|
|
67
|
-
}],
|
|
68
|
-
"storageKey": null
|
|
69
|
-
}],
|
|
70
|
-
"type": "License",
|
|
71
|
-
"abstractKey": null
|
|
72
|
-
};
|
|
73
|
-
}();
|
|
74
|
-
node.hash = "3d3c0b942c4cb8683b41bb52ab637339";
|
|
75
|
-
var _default = node;
|
|
76
|
-
exports.default = _default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated SignedSource<<6a8cfa857649a562a5ad145a507cf1f8>>
|
|
3
|
-
* @lightSyntaxTransform
|
|
4
|
-
* @nogrep
|
|
5
|
-
*/
|
|
6
|
-
import { ReaderFragment } from 'relay-runtime';
|
|
7
|
-
import { FragmentRefs } from "relay-runtime";
|
|
8
|
-
export type CartItem_licenseSelection$data = {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly license: {
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly multiplier: string | null;
|
|
13
|
-
readonly name: string | null;
|
|
14
|
-
};
|
|
15
|
-
readonly option: {
|
|
16
|
-
readonly amount: string | null;
|
|
17
|
-
readonly id: string;
|
|
18
|
-
readonly multiplier: string | null;
|
|
19
|
-
readonly name: string | null;
|
|
20
|
-
readonly " $fragmentSpreads": FragmentRefs<"VariableTableAmounts_option">;
|
|
21
|
-
} | null;
|
|
22
|
-
readonly variable: {
|
|
23
|
-
readonly id: string;
|
|
24
|
-
readonly variableType: string | null;
|
|
25
|
-
readonly " $fragmentSpreads": FragmentRefs<"VariableTableAmounts_variable">;
|
|
26
|
-
} | null;
|
|
27
|
-
readonly variableText: string | null;
|
|
28
|
-
};
|
|
29
|
-
export type CartItem_licenseSelection$key = {
|
|
30
|
-
readonly " $data"?: CartItem_licenseSelection$data;
|
|
31
|
-
readonly " $fragmentSpreads": FragmentRefs<"CartItem_licenseSelection">;
|
|
32
|
-
};
|
|
33
|
-
declare const node: ReaderFragment;
|
|
34
|
-
export default node;
|