fontdue-js 2.18.1 → 2.18.2
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 +4 -0
- package/dist/__generated__/CartItemProduct_product.graphql.d.ts +1 -1
- package/dist/__generated__/CartItemProduct_product.graphql.js +16 -10
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +16 -10
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +16 -10
- package/dist/__generated__/CartOrderUpdateMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderUpdateMutation.graphql.js +16 -10
- package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CartQuery.graphql.js +16 -10
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.js +37 -29
- package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +79 -66
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +16 -10
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +16 -10
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.js +37 -29
- package/dist/__generated__/PrecartAddToCartMutation.graphql.d.ts +1 -1
- package/dist/__generated__/PrecartAddToCartMutation.graphql.js +21 -15
- package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalCartQuery.graphql.js +27 -21
- package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductQuery.graphql.js +8 -3
- package/dist/__generated__/StoreModalProductSummaryRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductSummaryRefetchQuery.graphql.js +9 -4
- package/dist/__generated__/StoreModalProductSummary_viewer.graphql.d.ts +7 -1
- package/dist/__generated__/StoreModalProductSummary_viewer.graphql.js +7 -2
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.js +10 -4
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.js +10 -4
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.js +36 -28
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.js +9 -3
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +16 -10
- package/dist/__generated__/productState_Query.graphql.d.ts +29 -1
- package/dist/__generated__/productState_Query.graphql.js +24 -5
- package/dist/__generated__/productState_collectionBundle.graphql.d.ts +41 -0
- package/dist/__generated__/productState_collectionBundle.graphql.js +88 -0
- package/dist/__generated__/productState_node.graphql.d.ts +29 -1
- package/dist/__generated__/productState_node.graphql.js +20 -2
- package/dist/components/Cart/CartItem/CartItemProduct.js +3 -3
- package/dist/components/Root/productState.js +35 -7
- package/dist/components/StoreModal/StoreModalCart.js +2 -3
- package/dist/components/StoreModalProductSummary/index.js +1 -1
- package/dist/components/StripeProvider/index.d.ts +1 -2
- package/dist/components/StripeProvider/index.js +7 -10
- package/dist/components/elements/StoreModalUnifiedCheckout.js +4 -4
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* @generated SignedSource<<
|
|
8
|
+
* @generated SignedSource<<7fdadb278562d0302596d82154638f19>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -161,6 +161,13 @@ const node = function () {
|
|
|
161
161
|
"kind": "ScalarField",
|
|
162
162
|
"name": "cssUrl",
|
|
163
163
|
"storageKey": null
|
|
164
|
+
},
|
|
165
|
+
v13 = {
|
|
166
|
+
"alias": null,
|
|
167
|
+
"args": null,
|
|
168
|
+
"kind": "ScalarField",
|
|
169
|
+
"name": "totalStyles",
|
|
170
|
+
"storageKey": null
|
|
164
171
|
};
|
|
165
172
|
return {
|
|
166
173
|
"fragment": {
|
|
@@ -521,13 +528,7 @@ const node = function () {
|
|
|
521
528
|
"kind": "ScalarField",
|
|
522
529
|
"name": "isVariableFont",
|
|
523
530
|
"storageKey": null
|
|
524
|
-
},
|
|
525
|
-
"alias": null,
|
|
526
|
-
"args": null,
|
|
527
|
-
"kind": "ScalarField",
|
|
528
|
-
"name": "totalStyles",
|
|
529
|
-
"storageKey": null
|
|
530
|
-
}],
|
|
531
|
+
}, v13 /*: any*/],
|
|
531
532
|
"type": "FontCollection",
|
|
532
533
|
"abstractKey": null
|
|
533
534
|
}, {
|
|
@@ -567,6 +568,11 @@ const node = function () {
|
|
|
567
568
|
}],
|
|
568
569
|
"type": "FontStyle",
|
|
569
570
|
"abstractKey": null
|
|
571
|
+
}, {
|
|
572
|
+
"kind": "InlineFragment",
|
|
573
|
+
"selections": [v2 /*: any*/, v13 /*: any*/],
|
|
574
|
+
"type": "CollectionBundle",
|
|
575
|
+
"abstractKey": null
|
|
570
576
|
}, {
|
|
571
577
|
"kind": "InlineFragment",
|
|
572
578
|
"selections": [{
|
|
@@ -686,12 +692,12 @@ const node = function () {
|
|
|
686
692
|
}]
|
|
687
693
|
},
|
|
688
694
|
"params": {
|
|
689
|
-
"cacheID": "
|
|
695
|
+
"cacheID": "b284cc8ceb665cc1bd54161535f2607d",
|
|
690
696
|
"id": null,
|
|
691
697
|
"metadata": {},
|
|
692
698
|
"name": "TestFontsFormUpdateCustomerMutation",
|
|
693
699
|
"operationKind": "mutation",
|
|
694
|
-
"text": "mutation TestFontsFormUpdateCustomerMutation(\n $input: UpdateCustomerInput!\n) {\n updateCustomer(input: $input) {\n order {\n ...CartOrder_order\n id\n }\n }\n}\n\nfragment CartItemAdditionalLicenses_licenses on License {\n id\n name\n}\n\nfragment CartItemAdditionalLicenses_orderItem on OrderItem {\n licenseSelections {\n license {\n id\n }\n id\n }\n}\n\nfragment CartItemLicense_selection on LicenseSelection {\n id\n license {\n id\n name\n licenseVariables {\n id\n ...CartItemVariable_variable\n }\n }\n licenseVariable {\n id\n }\n ...CartItemVariable_selection\n}\n\nfragment CartItemProduct_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ...CollectionAa_product\n ...FontStyle_fontStyle\n ... on FontStyle {\n family {\n name\n cssUrl\n id\n }\n name\n variableInstances {\n name\n }\n }\n ... on Bundle {\n name\n }\n ... on FontCollection {\n name\n isVariableFont\n totalStyles\n featureStyle {\n family {\n cssUrl\n id\n }\n id\n }\n }\n}\n\nfragment CartItemVariable_selection on LicenseSelection {\n id\n variableText\n license {\n id\n }\n licenseVariable {\n ...VariableTableAmounts_variable\n id\n name\n variableType\n licenseOptions {\n id\n }\n }\n licenseOption {\n ...VariableTableAmounts_option\n id\n name\n amount\n }\n}\n\nfragment CartItemVariable_variable on LicenseVariable {\n id\n licenseOptions {\n id\n name\n amount\n }\n}\n\nfragment CartItem_node on OrderItem {\n ...CartItemAdditionalLicenses_orderItem\n id\n price {\n ...Price_price\n }\n sku {\n price {\n ...Price_price\n }\n product {\n ...CartItemProduct_product\n __typename\n ... on Licenseable {\n __isLicenseable: __typename\n licenses {\n ...CartItemAdditionalLicenses_licenses\n id\n licenseVariables {\n id\n licenseOptions {\n id\n }\n }\n }\n }\n ... on Node {\n __isNode: __typename\n id\n }\n }\n id\n }\n licenseSelections {\n ...CartItemLicense_selection\n id\n license {\n id\n }\n licenseVariable {\n id\n }\n licenseOption {\n id\n }\n variableText\n }\n}\n\nfragment CartOrder_order on Order {\n ...Checkout_order\n ...Download_order\n ...CartTotals_order\n ...CartState_order\n id\n orderItems {\n ...CartItem_node\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n variableType\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n orderVariableSelections {\n orderVariable {\n id\n }\n orderVariableOption {\n id\n }\n id\n }\n discount {\n id\n }\n customer {\n email\n name\n anonymous\n id\n }\n billingIdentity {\n ...IdentityBox_identity\n }\n licenseeIdentity {\n ...IdentityBox_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brand\n }\n }\n stripePaymentIntent {\n status\n }\n canCompleteWithCoupon\n completedWithCoupon\n}\n\nfragment CartState_order on Order {\n id\n orderItems {\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n orderVariableSelections {\n orderVariable {\n id\n }\n orderVariableOption {\n id\n }\n countryCode\n id\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxRate\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment Checkout_order on Order {\n canCompleteWithCoupon\n customer {\n name\n email\n newsletterOptIn\n id\n }\n billingIdentity {\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIdentity {\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIsBillingIdentity\n}\n\nfragment CollectionAa_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ... on FontCollection {\n featureStyle {\n ...FontStyle_fontStyle\n id\n }\n }\n ... on Bundle {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n }\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmount {\n amount\n currency\n }\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Download_order on Order {\n id\n archiveUrl\n customer {\n email\n id\n }\n completedWithCoupon\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment IdentityBox_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment VariableTableAmounts_option on LicenseOption {\n amounts\n}\n\nfragment VariableTableAmounts_variable on LicenseVariable {\n units\n}\n"
|
|
700
|
+
"text": "mutation TestFontsFormUpdateCustomerMutation(\n $input: UpdateCustomerInput!\n) {\n updateCustomer(input: $input) {\n order {\n ...CartOrder_order\n id\n }\n }\n}\n\nfragment CartItemAdditionalLicenses_licenses on License {\n id\n name\n}\n\nfragment CartItemAdditionalLicenses_orderItem on OrderItem {\n licenseSelections {\n license {\n id\n }\n id\n }\n}\n\nfragment CartItemLicense_selection on LicenseSelection {\n id\n license {\n id\n name\n licenseVariables {\n id\n ...CartItemVariable_variable\n }\n }\n licenseVariable {\n id\n }\n ...CartItemVariable_selection\n}\n\nfragment CartItemProduct_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ...CollectionAa_product\n ...FontStyle_fontStyle\n ... on FontStyle {\n family {\n name\n cssUrl\n id\n }\n name\n variableInstances {\n name\n }\n }\n ... on Bundle {\n name\n }\n ... on FontCollection {\n name\n isVariableFont\n totalStyles\n featureStyle {\n family {\n cssUrl\n id\n }\n id\n }\n }\n ... on CollectionBundle {\n name\n totalStyles\n }\n}\n\nfragment CartItemVariable_selection on LicenseSelection {\n id\n variableText\n license {\n id\n }\n licenseVariable {\n ...VariableTableAmounts_variable\n id\n name\n variableType\n licenseOptions {\n id\n }\n }\n licenseOption {\n ...VariableTableAmounts_option\n id\n name\n amount\n }\n}\n\nfragment CartItemVariable_variable on LicenseVariable {\n id\n licenseOptions {\n id\n name\n amount\n }\n}\n\nfragment CartItem_node on OrderItem {\n ...CartItemAdditionalLicenses_orderItem\n id\n price {\n ...Price_price\n }\n sku {\n price {\n ...Price_price\n }\n product {\n ...CartItemProduct_product\n __typename\n ... on Licenseable {\n __isLicenseable: __typename\n licenses {\n ...CartItemAdditionalLicenses_licenses\n id\n licenseVariables {\n id\n licenseOptions {\n id\n }\n }\n }\n }\n ... on Node {\n __isNode: __typename\n id\n }\n }\n id\n }\n licenseSelections {\n ...CartItemLicense_selection\n id\n license {\n id\n }\n licenseVariable {\n id\n }\n licenseOption {\n id\n }\n variableText\n }\n}\n\nfragment CartOrder_order on Order {\n ...Checkout_order\n ...Download_order\n ...CartTotals_order\n ...CartState_order\n id\n orderItems {\n ...CartItem_node\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n variableType\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n orderVariableSelections {\n orderVariable {\n id\n }\n orderVariableOption {\n id\n }\n id\n }\n discount {\n id\n }\n customer {\n email\n name\n anonymous\n id\n }\n billingIdentity {\n ...IdentityBox_identity\n }\n licenseeIdentity {\n ...IdentityBox_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brand\n }\n }\n stripePaymentIntent {\n status\n }\n canCompleteWithCoupon\n completedWithCoupon\n}\n\nfragment CartState_order on Order {\n id\n orderItems {\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n orderVariableSelections {\n orderVariable {\n id\n }\n orderVariableOption {\n id\n }\n countryCode\n id\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxRate\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment Checkout_order on Order {\n canCompleteWithCoupon\n customer {\n name\n email\n newsletterOptIn\n id\n }\n billingIdentity {\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIdentity {\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIsBillingIdentity\n}\n\nfragment CollectionAa_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ... on FontCollection {\n featureStyle {\n ...FontStyle_fontStyle\n id\n }\n }\n ... on Bundle {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n }\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmount {\n amount\n currency\n }\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Download_order on Order {\n id\n archiveUrl\n customer {\n email\n id\n }\n completedWithCoupon\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment IdentityBox_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment VariableTableAmounts_option on LicenseOption {\n amounts\n}\n\nfragment VariableTableAmounts_variable on LicenseVariable {\n units\n}\n"
|
|
695
701
|
}
|
|
696
702
|
};
|
|
697
703
|
}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<b4e88c2638ba792951d57f4750391bdc>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -67,6 +67,34 @@ export type productState_Query$data = {
|
|
|
67
67
|
};
|
|
68
68
|
} | null;
|
|
69
69
|
}> | null;
|
|
70
|
+
readonly collectionBundles: ReadonlyArray<{
|
|
71
|
+
readonly id: string;
|
|
72
|
+
readonly memberCollections: ReadonlyArray<{
|
|
73
|
+
readonly fontStyles: ReadonlyArray<{
|
|
74
|
+
readonly id: string;
|
|
75
|
+
readonly sku: {
|
|
76
|
+
readonly id: string;
|
|
77
|
+
readonly price: {
|
|
78
|
+
readonly amount: number;
|
|
79
|
+
};
|
|
80
|
+
} | null;
|
|
81
|
+
}>;
|
|
82
|
+
readonly id: string;
|
|
83
|
+
readonly sku: {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly price: {
|
|
86
|
+
readonly amount: number;
|
|
87
|
+
};
|
|
88
|
+
} | null;
|
|
89
|
+
}> | null;
|
|
90
|
+
readonly name: string;
|
|
91
|
+
readonly sku: {
|
|
92
|
+
readonly id: string;
|
|
93
|
+
readonly price: {
|
|
94
|
+
readonly amount: number;
|
|
95
|
+
};
|
|
96
|
+
} | null;
|
|
97
|
+
}> | null;
|
|
70
98
|
readonly fontStyles: ReadonlyArray<{
|
|
71
99
|
readonly id: string;
|
|
72
100
|
readonly sku: {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* @generated SignedSource<<
|
|
8
|
+
* @generated SignedSource<<b4e88c2638ba792951d57f4750391bdc>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -92,6 +92,25 @@ const node = function () {
|
|
|
92
92
|
"storageKey": null
|
|
93
93
|
},
|
|
94
94
|
v8 = {
|
|
95
|
+
"alias": null,
|
|
96
|
+
"args": null,
|
|
97
|
+
"concreteType": "CollectionBundle",
|
|
98
|
+
"kind": "LinkedField",
|
|
99
|
+
"name": "collectionBundles",
|
|
100
|
+
"plural": true,
|
|
101
|
+
"selections": [v3 /*: any*/, v4 /*: any*/, v5 /*: any*/, {
|
|
102
|
+
"alias": null,
|
|
103
|
+
"args": null,
|
|
104
|
+
"concreteType": "FontCollection",
|
|
105
|
+
"kind": "LinkedField",
|
|
106
|
+
"name": "memberCollections",
|
|
107
|
+
"plural": true,
|
|
108
|
+
"selections": [v3 /*: any*/, v5 /*: any*/, v6 /*: any*/],
|
|
109
|
+
"storageKey": null
|
|
110
|
+
}],
|
|
111
|
+
"storageKey": null
|
|
112
|
+
},
|
|
113
|
+
v9 = {
|
|
95
114
|
"alias": null,
|
|
96
115
|
"args": [{
|
|
97
116
|
"kind": "Literal",
|
|
@@ -120,7 +139,7 @@ const node = function () {
|
|
|
120
139
|
"plural": false,
|
|
121
140
|
"selections": [{
|
|
122
141
|
"kind": "InlineFragment",
|
|
123
|
-
"selections": [v2 /*: any*/, v3 /*: any*/, v4 /*: any*/, v5 /*: any*/, v6 /*: any*/, v7 /*: any*/, v8 /*: any*/],
|
|
142
|
+
"selections": [v2 /*: any*/, v3 /*: any*/, v4 /*: any*/, v5 /*: any*/, v6 /*: any*/, v7 /*: any*/, v8 /*: any*/, v9 /*: any*/],
|
|
124
143
|
"type": "FontCollection",
|
|
125
144
|
"abstractKey": null
|
|
126
145
|
}],
|
|
@@ -143,7 +162,7 @@ const node = function () {
|
|
|
143
162
|
"plural": false,
|
|
144
163
|
"selections": [v2 /*: any*/, v3 /*: any*/, {
|
|
145
164
|
"kind": "InlineFragment",
|
|
146
|
-
"selections": [v4 /*: any*/, v5 /*: any*/, v6 /*: any*/, v7 /*: any*/, v8 /*: any*/],
|
|
165
|
+
"selections": [v4 /*: any*/, v5 /*: any*/, v6 /*: any*/, v7 /*: any*/, v8 /*: any*/, v9 /*: any*/],
|
|
147
166
|
"type": "FontCollection",
|
|
148
167
|
"abstractKey": null
|
|
149
168
|
}],
|
|
@@ -151,12 +170,12 @@ const node = function () {
|
|
|
151
170
|
}]
|
|
152
171
|
},
|
|
153
172
|
"params": {
|
|
154
|
-
"cacheID": "
|
|
173
|
+
"cacheID": "46b69511613049f8b0186da9dd74c579",
|
|
155
174
|
"id": null,
|
|
156
175
|
"metadata": {},
|
|
157
176
|
"name": "productState_Query",
|
|
158
177
|
"operationKind": "query",
|
|
159
|
-
"text": "query productState_Query(\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ... on FontCollection {\n __typename\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n bundles {\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n }\n children(collectionTypes: [FAMILY]) {\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n bundles {\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n }\n }\n }\n id\n }\n}\n"
|
|
178
|
+
"text": "query productState_Query(\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ... on FontCollection {\n __typename\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n bundles {\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n }\n collectionBundles {\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n memberCollections {\n id\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n }\n }\n children(collectionTypes: [FAMILY]) {\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n bundles {\n id\n name\n sku {\n id\n price {\n amount\n }\n }\n fontStyles {\n id\n sku {\n id\n price {\n amount\n }\n }\n }\n }\n }\n }\n id\n }\n}\n"
|
|
160
179
|
}
|
|
161
180
|
};
|
|
162
181
|
}();
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<c1a8446af3677d58e3851338c54cf16e>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
import { ReaderFragment } from 'relay-runtime';
|
|
7
|
+
import { FragmentRefs } from "relay-runtime";
|
|
8
|
+
export type productState_collectionBundle$data = {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly memberCollections: ReadonlyArray<{
|
|
11
|
+
readonly fontStyles: ReadonlyArray<{
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly sku: {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly price: {
|
|
16
|
+
readonly amount: number;
|
|
17
|
+
};
|
|
18
|
+
} | null;
|
|
19
|
+
}>;
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly sku: {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly price: {
|
|
24
|
+
readonly amount: number;
|
|
25
|
+
};
|
|
26
|
+
} | null;
|
|
27
|
+
}> | null;
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly sku: {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly price: {
|
|
32
|
+
readonly amount: number;
|
|
33
|
+
};
|
|
34
|
+
} | null;
|
|
35
|
+
};
|
|
36
|
+
export type productState_collectionBundle$key = {
|
|
37
|
+
readonly " $data"?: productState_collectionBundle$data;
|
|
38
|
+
readonly " $fragmentSpreads": FragmentRefs<"productState_collectionBundle">;
|
|
39
|
+
};
|
|
40
|
+
declare const node: ReaderFragment;
|
|
41
|
+
export default node;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @generated SignedSource<<c1a8446af3677d58e3851338c54cf16e>>
|
|
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
|
+
"concreteType": "Sku",
|
|
29
|
+
"kind": "LinkedField",
|
|
30
|
+
"name": "sku",
|
|
31
|
+
"plural": false,
|
|
32
|
+
"selections": [v0 /*: any*/, {
|
|
33
|
+
"alias": null,
|
|
34
|
+
"args": null,
|
|
35
|
+
"concreteType": "Money",
|
|
36
|
+
"kind": "LinkedField",
|
|
37
|
+
"name": "price",
|
|
38
|
+
"plural": false,
|
|
39
|
+
"selections": [{
|
|
40
|
+
"alias": null,
|
|
41
|
+
"args": null,
|
|
42
|
+
"kind": "ScalarField",
|
|
43
|
+
"name": "amount",
|
|
44
|
+
"storageKey": null
|
|
45
|
+
}],
|
|
46
|
+
"storageKey": null
|
|
47
|
+
}],
|
|
48
|
+
"storageKey": null
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
"argumentDefinitions": [],
|
|
52
|
+
"kind": "Fragment",
|
|
53
|
+
"metadata": {
|
|
54
|
+
"mask": false
|
|
55
|
+
},
|
|
56
|
+
"name": "productState_collectionBundle",
|
|
57
|
+
"selections": [v0 /*: any*/, {
|
|
58
|
+
"alias": null,
|
|
59
|
+
"args": null,
|
|
60
|
+
"kind": "ScalarField",
|
|
61
|
+
"name": "name",
|
|
62
|
+
"storageKey": null
|
|
63
|
+
}, v1 /*: any*/, {
|
|
64
|
+
"alias": null,
|
|
65
|
+
"args": null,
|
|
66
|
+
"concreteType": "FontCollection",
|
|
67
|
+
"kind": "LinkedField",
|
|
68
|
+
"name": "memberCollections",
|
|
69
|
+
"plural": true,
|
|
70
|
+
"selections": [v0 /*: any*/, v1 /*: any*/, {
|
|
71
|
+
"alias": null,
|
|
72
|
+
"args": null,
|
|
73
|
+
"concreteType": "FontStyle",
|
|
74
|
+
"kind": "LinkedField",
|
|
75
|
+
"name": "fontStyles",
|
|
76
|
+
"plural": true,
|
|
77
|
+
"selections": [v0 /*: any*/, v1 /*: any*/],
|
|
78
|
+
"storageKey": null
|
|
79
|
+
}],
|
|
80
|
+
"storageKey": null
|
|
81
|
+
}],
|
|
82
|
+
"type": "CollectionBundle",
|
|
83
|
+
"abstractKey": null
|
|
84
|
+
};
|
|
85
|
+
}();
|
|
86
|
+
node.hash = "6744aa8f57d14b0111a0c49f488d7b03";
|
|
87
|
+
var _default = node;
|
|
88
|
+
exports.default = _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<89ccca0787788a2ceb37d58b6ab5340a>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -63,6 +63,34 @@ export type productState_node$data = {
|
|
|
63
63
|
};
|
|
64
64
|
} | null;
|
|
65
65
|
}> | null;
|
|
66
|
+
readonly collectionBundles: ReadonlyArray<{
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly memberCollections: ReadonlyArray<{
|
|
69
|
+
readonly fontStyles: ReadonlyArray<{
|
|
70
|
+
readonly id: string;
|
|
71
|
+
readonly sku: {
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly price: {
|
|
74
|
+
readonly amount: number;
|
|
75
|
+
};
|
|
76
|
+
} | null;
|
|
77
|
+
}>;
|
|
78
|
+
readonly id: string;
|
|
79
|
+
readonly sku: {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly price: {
|
|
82
|
+
readonly amount: number;
|
|
83
|
+
};
|
|
84
|
+
} | null;
|
|
85
|
+
}> | null;
|
|
86
|
+
readonly name: string;
|
|
87
|
+
readonly sku: {
|
|
88
|
+
readonly id: string;
|
|
89
|
+
readonly price: {
|
|
90
|
+
readonly amount: number;
|
|
91
|
+
};
|
|
92
|
+
} | null;
|
|
93
|
+
}> | null;
|
|
66
94
|
readonly fontStyles: ReadonlyArray<{
|
|
67
95
|
readonly id: string;
|
|
68
96
|
readonly sku: {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* @generated SignedSource<<
|
|
8
|
+
* @generated SignedSource<<89ccca0787788a2ceb37d58b6ab5340a>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -82,6 +82,24 @@ const node = function () {
|
|
|
82
82
|
},
|
|
83
83
|
"name": "productState_node",
|
|
84
84
|
"selections": [v0 /*: any*/, v1 /*: any*/, v2 /*: any*/, v3 /*: any*/, v4 /*: any*/, {
|
|
85
|
+
"alias": null,
|
|
86
|
+
"args": null,
|
|
87
|
+
"concreteType": "CollectionBundle",
|
|
88
|
+
"kind": "LinkedField",
|
|
89
|
+
"name": "collectionBundles",
|
|
90
|
+
"plural": true,
|
|
91
|
+
"selections": [v0 /*: any*/, v1 /*: any*/, v2 /*: any*/, {
|
|
92
|
+
"alias": null,
|
|
93
|
+
"args": null,
|
|
94
|
+
"concreteType": "FontCollection",
|
|
95
|
+
"kind": "LinkedField",
|
|
96
|
+
"name": "memberCollections",
|
|
97
|
+
"plural": true,
|
|
98
|
+
"selections": [v0 /*: any*/, v2 /*: any*/, v3 /*: any*/],
|
|
99
|
+
"storageKey": null
|
|
100
|
+
}],
|
|
101
|
+
"storageKey": null
|
|
102
|
+
}, {
|
|
85
103
|
"alias": null,
|
|
86
104
|
"args": [{
|
|
87
105
|
"kind": "Literal",
|
|
@@ -99,6 +117,6 @@ const node = function () {
|
|
|
99
117
|
"abstractKey": null
|
|
100
118
|
};
|
|
101
119
|
}();
|
|
102
|
-
node.hash = "
|
|
120
|
+
node.hash = "a1e172db45ca550a254819d877497d12";
|
|
103
121
|
var _default = node;
|
|
104
122
|
exports.default = _default;
|
|
@@ -17,7 +17,7 @@ function CartItemProduct(_ref) {
|
|
|
17
17
|
let {
|
|
18
18
|
product: productKey
|
|
19
19
|
} = _ref;
|
|
20
|
-
const product = (0, _reactRelay.useFragment)((_CartItemProduct_product2.default.hash && _CartItemProduct_product2.default.hash !== "
|
|
20
|
+
const product = (0, _reactRelay.useFragment)((_CartItemProduct_product2.default.hash && _CartItemProduct_product2.default.hash !== "22f49bcb8a461d2d3eefc4f8ba1e575c" && console.error("The definition of 'CartItemProduct_product' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItemProduct_product2.default), productKey);
|
|
21
21
|
let productCss;
|
|
22
22
|
if ((product === null || product === void 0 ? void 0 : product.__typename) === 'FontStyle') productCss = (_product$family = product.family) === null || _product$family === void 0 ? void 0 : _product$family.cssUrl;
|
|
23
23
|
if ((product === null || product === void 0 ? void 0 : product.__typename) === 'FontCollection') productCss = (_product$featureStyle = product.featureStyle) === null || _product$featureStyle === void 0 ? void 0 : (_product$featureStyle2 = _product$featureStyle.family) === null || _product$featureStyle2 === void 0 ? void 0 : _product$featureStyle2.cssUrl;
|
|
@@ -27,7 +27,7 @@ function CartItemProduct(_ref) {
|
|
|
27
27
|
className: "cart-item__aa"
|
|
28
28
|
}, product ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Stylesheet.default, {
|
|
29
29
|
href: productCss
|
|
30
|
-
}), ['FontCollection', 'Bundle'].indexOf(product.__typename) >= 0 ? /*#__PURE__*/_react.default.createElement(_CollectionAa.CollectionAa, {
|
|
30
|
+
}), ['FontCollection', 'Bundle', 'CollectionBundle'].indexOf(product.__typename) >= 0 ? /*#__PURE__*/_react.default.createElement(_CollectionAa.CollectionAa, {
|
|
31
31
|
product: product
|
|
32
32
|
}) : /*#__PURE__*/_react.default.createElement(_FontStyle.default, {
|
|
33
33
|
fontStyle: product
|
|
@@ -37,7 +37,7 @@ function CartItemProduct(_ref) {
|
|
|
37
37
|
className: "cart-item__name"
|
|
38
38
|
}, productName), product !== null && product !== void 0 && product.isVariableFont || product !== null && product !== void 0 && (_product$variableInst = product.variableInstances) !== null && _product$variableInst !== void 0 && _product$variableInst.length ? /*#__PURE__*/_react.default.createElement("div", {
|
|
39
39
|
className: "cart-item__label"
|
|
40
|
-
}, "Variable font") : (product === null || product === void 0 ? void 0 : product.__typename) === 'FontCollection' && /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
}, "Variable font") : ((product === null || product === void 0 ? void 0 : product.__typename) === 'FontCollection' || (product === null || product === void 0 ? void 0 : product.__typename) === 'CollectionBundle') && /*#__PURE__*/_react.default.createElement("div", {
|
|
41
41
|
className: "cart-item__label"
|
|
42
42
|
}, "(", (0, _utils.pluralize)(product.totalStyles ?? 0, 'style'), ")")));
|
|
43
43
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.populateProductStateReducer = exports.populateProductState = void 0;
|
|
7
7
|
var _productState_Query2 = _interopRequireDefault(require("../../__generated__/productState_Query.graphql"));
|
|
8
8
|
var _productState_node2 = _interopRequireDefault(require("../../__generated__/productState_node.graphql"));
|
|
9
|
+
var _productState_collectionBundle2 = _interopRequireDefault(require("../../__generated__/productState_collectionBundle.graphql"));
|
|
9
10
|
var _productState_bundle2 = _interopRequireDefault(require("../../__generated__/productState_bundle.graphql"));
|
|
10
11
|
var _productState_collection2 = _interopRequireDefault(require("../../__generated__/productState_collection.graphql"));
|
|
11
12
|
var _productState_sku2 = _interopRequireDefault(require("../../__generated__/productState_sku.graphql"));
|
|
@@ -15,7 +16,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
15
16
|
_productState_sku2.default.hash && _productState_sku2.default.hash !== "2cee6ddddc85699f0c90e2607c0634ef" && console.error("The definition of 'productState_sku' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _productState_sku2.default;
|
|
16
17
|
_productState_collection2.default.hash && _productState_collection2.default.hash !== "90e56933f956c6773c0958284de81884" && console.error("The definition of 'productState_collection' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _productState_collection2.default;
|
|
17
18
|
_productState_bundle2.default.hash && _productState_bundle2.default.hash !== "fa38bbc9f2062a727da4f5062b362054" && console.error("The definition of 'productState_bundle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _productState_bundle2.default;
|
|
18
|
-
|
|
19
|
+
_productState_collectionBundle2.default.hash && _productState_collectionBundle2.default.hash !== "6744aa8f57d14b0111a0c49f488d7b03" && console.error("The definition of 'productState_collectionBundle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _productState_collectionBundle2.default;
|
|
20
|
+
_productState_node2.default.hash && _productState_node2.default.hash !== "a1e172db45ca550a254819d877497d12" && console.error("The definition of 'productState_node' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _productState_node2.default;
|
|
19
21
|
const query = (_productState_Query2.default.hash && _productState_Query2.default.hash !== "ac3292bae9a274139d5a525fd0162711" && console.error("The definition of 'productState_Query' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _productState_Query2.default);
|
|
20
22
|
const populateProductState = (store, environment, id) => {
|
|
21
23
|
const existingState = store.getState().fetchedCollectionIds;
|
|
@@ -39,12 +41,25 @@ const allSkus = function (collection) {
|
|
|
39
41
|
var _collection$bundles;
|
|
40
42
|
bundleSkus = (collection === null || collection === void 0 ? void 0 : (_collection$bundles = collection.bundles) === null || _collection$bundles === void 0 ? void 0 : _collection$bundles.flatMap(bundle => allSkus(bundle, includeCollections, includeFontStyles))) ?? [];
|
|
41
43
|
}
|
|
44
|
+
let collectionBundleSkus = [];
|
|
45
|
+
if ('collectionBundles' in collection && collection.collectionBundles) {
|
|
46
|
+
collectionBundleSkus = collection.collectionBundles.flatMap(collBundle => allSkus(collBundle, includeCollections, includeFontStyles));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// For collection bundles, get SKUs from member collections
|
|
50
|
+
let memberCollectionSkus = [];
|
|
51
|
+
if ('memberCollections' in collection && collection.memberCollections) {
|
|
52
|
+
memberCollectionSkus = collection.memberCollections.flatMap(member => {
|
|
53
|
+
var _member$fontStyles;
|
|
54
|
+
return [includeCollections ? member.sku : null, ...(includeFontStyles ? ((_member$fontStyles = member.fontStyles) === null || _member$fontStyles === void 0 ? void 0 : _member$fontStyles.map(style => style.sku)) ?? [] : [])];
|
|
55
|
+
}).filter(_utils.notEmpty);
|
|
56
|
+
}
|
|
42
57
|
let childrenSkus = [];
|
|
43
58
|
if ('children' in collection) {
|
|
44
59
|
var _collection$children;
|
|
45
60
|
childrenSkus = ((_collection$children = collection.children) === null || _collection$children === void 0 ? void 0 : _collection$children.flatMap(child => allSkus(child, includeCollections, includeFontStyles))) ?? [];
|
|
46
61
|
}
|
|
47
|
-
return [includeCollections ? collection === null || collection === void 0 ? void 0 : collection.sku : null, ...(includeFontStyles ? (collection === null || collection === void 0 ? void 0 : (_collection$fontStyle = collection.fontStyles) === null || _collection$fontStyle === void 0 ? void 0 : _collection$fontStyle.map(style => style.sku)) ?? [] : []), ...bundleSkus, ...childrenSkus].filter(_utils.notEmpty);
|
|
62
|
+
return [includeCollections ? collection === null || collection === void 0 ? void 0 : collection.sku : null, ...(includeFontStyles && 'fontStyles' in collection ? (collection === null || collection === void 0 ? void 0 : (_collection$fontStyle = collection.fontStyles) === null || _collection$fontStyle === void 0 ? void 0 : _collection$fontStyle.map(style => style.sku)) ?? [] : []), ...bundleSkus, ...collectionBundleSkus, ...memberCollectionSkus, ...childrenSkus].filter(_utils.notEmpty);
|
|
48
63
|
};
|
|
49
64
|
const flattenSkuData = collection => {
|
|
50
65
|
let bundles = {};
|
|
@@ -54,6 +69,13 @@ const flattenSkuData = collection => {
|
|
|
54
69
|
...flattenSkuData(bundle)
|
|
55
70
|
}), {});
|
|
56
71
|
}
|
|
72
|
+
let collectionBundles = {};
|
|
73
|
+
if ('collectionBundles' in collection && collection.collectionBundles) {
|
|
74
|
+
collectionBundles = collection.collectionBundles.reduce((res, collBundle) => ({
|
|
75
|
+
...res,
|
|
76
|
+
...flattenSkuData(collBundle)
|
|
77
|
+
}), {});
|
|
78
|
+
}
|
|
57
79
|
let children = {};
|
|
58
80
|
if ('children' in collection && collection.children) {
|
|
59
81
|
children = collection.children.reduce((res, child) => ({
|
|
@@ -64,12 +86,17 @@ const flattenSkuData = collection => {
|
|
|
64
86
|
let collectionData = {};
|
|
65
87
|
if (collection.sku) {
|
|
66
88
|
var _collection$fontStyle2, _collection$children2;
|
|
89
|
+
// For collection bundles, get font style IDs from member collections
|
|
90
|
+
const fontStyleIds = 'memberCollections' in collection && collection.memberCollections ? collection.memberCollections.flatMap(member => {
|
|
91
|
+
var _member$fontStyles2;
|
|
92
|
+
return ((_member$fontStyles2 = member.fontStyles) === null || _member$fontStyles2 === void 0 ? void 0 : _member$fontStyles2.map(style => style.id)) ?? [];
|
|
93
|
+
}) : 'fontStyles' in collection ? (((_collection$fontStyle2 = collection.fontStyles) === null || _collection$fontStyle2 === void 0 ? void 0 : _collection$fontStyle2.map(style => style.id)) ?? []).concat('children' in collection ? ((_collection$children2 = collection.children) === null || _collection$children2 === void 0 ? void 0 : _collection$children2.flatMap(child => {
|
|
94
|
+
var _child$fontStyles;
|
|
95
|
+
return ((_child$fontStyles = child.fontStyles) === null || _child$fontStyles === void 0 ? void 0 : _child$fontStyles.map(style => style.id)) ?? [];
|
|
96
|
+
})) ?? [] : []) : [];
|
|
67
97
|
collectionData = {
|
|
68
98
|
[collection.sku.id]: {
|
|
69
|
-
fontStyleIds
|
|
70
|
-
var _child$fontStyles;
|
|
71
|
-
return ((_child$fontStyles = child.fontStyles) === null || _child$fontStyles === void 0 ? void 0 : _child$fontStyles.map(style => style.id)) ?? [];
|
|
72
|
-
})) ?? [] : []),
|
|
99
|
+
fontStyleIds,
|
|
73
100
|
fontStyleSkuIds: allSkus(collection, false, true).map(sku => sku.id),
|
|
74
101
|
childrenSkuIds: allSkus(collection, true, false).map(sku => sku.id).filter(skuId => {
|
|
75
102
|
var _collection$sku;
|
|
@@ -83,7 +110,8 @@ const flattenSkuData = collection => {
|
|
|
83
110
|
return {
|
|
84
111
|
...collectionData,
|
|
85
112
|
...children,
|
|
86
|
-
...bundles
|
|
113
|
+
...bundles,
|
|
114
|
+
...collectionBundles
|
|
87
115
|
};
|
|
88
116
|
};
|
|
89
117
|
const flattenSkuPrices = collection => {
|
|
@@ -35,7 +35,7 @@ const StoreModalCart = _ref => {
|
|
|
35
35
|
body: order && orderHasItems ? /*#__PURE__*/_react.default.createElement(_CartState.default, {
|
|
36
36
|
order: order
|
|
37
37
|
}, _ref2 => {
|
|
38
|
-
var _data$viewer, _data$viewer$currentO, _data$viewer$currentO2, _order$orderItems2, _order$total, _data$viewer2, _data$viewer2$setting
|
|
38
|
+
var _data$viewer, _data$viewer$currentO, _data$viewer$currentO2, _order$orderItems2, _order$total, _data$viewer2, _data$viewer2$setting;
|
|
39
39
|
let {
|
|
40
40
|
onUpdateOrderVariableSelections,
|
|
41
41
|
onRemoveDiscount,
|
|
@@ -71,8 +71,7 @@ const StoreModalCart = _ref => {
|
|
|
71
71
|
}),
|
|
72
72
|
checkout: /*#__PURE__*/_react.default.createElement(_StripeProvider.default, {
|
|
73
73
|
viewer: data.viewer,
|
|
74
|
-
providerType: "elements"
|
|
75
|
-
requireClientSecret: ((_data$viewer3 = data.viewer) === null || _data$viewer3 === void 0 ? void 0 : (_data$viewer3$setting = _data$viewer3.settings) === null || _data$viewer3$setting === void 0 ? void 0 : _data$viewer3$setting.taxSystem) === 'fontdue'
|
|
74
|
+
providerType: "elements"
|
|
76
75
|
}, /*#__PURE__*/_react.default.createElement(_StoreModalUnifiedCheckout.default, {
|
|
77
76
|
viewer: data.viewer,
|
|
78
77
|
order: order,
|
|
@@ -63,7 +63,7 @@ const StoreModalProductSummary = _ref => {
|
|
|
63
63
|
const refetchVariables = (0, _react.useMemo)(() => ({
|
|
64
64
|
selectedSkuIds: selectedSkuIdsArray
|
|
65
65
|
}), [selectedSkuIdsArray]);
|
|
66
|
-
const [viewer, refetch] = (0, _reactRelay.useRefetchableFragment)((_StoreModalProductSummary_viewer2.default.hash && _StoreModalProductSummary_viewer2.default.hash !== "
|
|
66
|
+
const [viewer, refetch] = (0, _reactRelay.useRefetchableFragment)((_StoreModalProductSummary_viewer2.default.hash && _StoreModalProductSummary_viewer2.default.hash !== "81a5f120d76cbb84753d158a7ff38c19" && console.error("The definition of 'StoreModalProductSummary_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalProductSummary_viewer2.default), viewerKey);
|
|
67
67
|
(0, _useRefetchOnLicenseChanges.useRefetchOnLicenseChanges)({
|
|
68
68
|
environment,
|
|
69
69
|
refetch,
|
|
@@ -4,7 +4,6 @@ interface StripeProvider_props {
|
|
|
4
4
|
viewer: StripeProvider_viewer$key;
|
|
5
5
|
children: JSX.Element;
|
|
6
6
|
providerType: 'checkout' | 'elements';
|
|
7
|
-
requireClientSecret?: boolean;
|
|
8
7
|
}
|
|
9
|
-
declare const StripeProvider: ({ viewer, providerType, children,
|
|
8
|
+
declare const StripeProvider: ({ viewer, providerType, children, }: StripeProvider_props) => JSX.Element | null;
|
|
10
9
|
export default StripeProvider;
|
|
@@ -20,8 +20,7 @@ const StripeProvider = _ref => {
|
|
|
20
20
|
let {
|
|
21
21
|
viewer,
|
|
22
22
|
providerType,
|
|
23
|
-
children
|
|
24
|
-
requireClientSecret
|
|
23
|
+
children
|
|
25
24
|
} = _ref;
|
|
26
25
|
const data = (0, _reactRelay.useFragment)((_StripeProvider_viewer2.default.hash && _StripeProvider_viewer2.default.hash !== "dd5fd4cdd75d727050b8d1d6f4269fa8" && console.error("The definition of 'StripeProvider_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StripeProvider_viewer2.default), viewer);
|
|
27
26
|
const stripeKey = data.stripePublishableKey;
|
|
@@ -29,6 +28,12 @@ const StripeProvider = _ref => {
|
|
|
29
28
|
const stripePromiseRef = (0, _react.useRef)(stripeKey && stripeAccount ? (0, _stripeJs.loadStripe)(stripeKey, {
|
|
30
29
|
stripeAccount
|
|
31
30
|
}) : null);
|
|
31
|
+
|
|
32
|
+
// All hooks must be called before any conditional returns (React rules of hooks)
|
|
33
|
+
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
34
|
+
const {
|
|
35
|
+
stripe: config
|
|
36
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
32
37
|
let customFontSource;
|
|
33
38
|
const woffSrc = (_data$settings = data.settings) === null || _data$settings === void 0 ? void 0 : (_data$settings$uiFont = _data$settings.uiFontStyle) === null || _data$settings$uiFont === void 0 ? void 0 : (_data$settings$uiFont2 = _data$settings$uiFont.webfontSources) === null || _data$settings$uiFont2 === void 0 ? void 0 : (_data$settings$uiFont3 = _data$settings$uiFont2.find(source => (source === null || source === void 0 ? void 0 : source.format) === 'woff2')) === null || _data$settings$uiFont3 === void 0 ? void 0 : _data$settings$uiFont3.url;
|
|
34
39
|
let fontFamily = (_data$settings2 = data.settings) !== null && _data$settings2 !== void 0 && _data$settings2.uiFontStyle ? `${data.settings.uiFontStyle.cssFamily} ${data.settings.uiFontStyle.name}` : undefined;
|
|
@@ -46,13 +51,8 @@ const StripeProvider = _ref => {
|
|
|
46
51
|
weight: '400'
|
|
47
52
|
};
|
|
48
53
|
}
|
|
49
|
-
|
|
50
|
-
// the stripe provider may not be rendered, so we have to conditonally call
|
|
51
|
-
// useStripe down in the children
|
|
52
54
|
const clientSecret = ((_data$currentOrder = data.currentOrder) === null || _data$currentOrder === void 0 ? void 0 : (_data$currentOrder$st = _data$currentOrder.stripePaymentIntent) === null || _data$currentOrder$st === void 0 ? void 0 : _data$currentOrder$st.clientSecret) ?? undefined;
|
|
53
|
-
if (requireClientSecret && !clientSecret) return children;
|
|
54
55
|
const customProperties = (0, _utils.parseCustomProperties)((_data$themeConfig = data.themeConfig) === null || _data$themeConfig === void 0 ? void 0 : _data$themeConfig.customProperties);
|
|
55
|
-
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
56
56
|
const fetchClientSecret = (0, _react.useCallback)(() => {
|
|
57
57
|
return new Promise((resolve, reject) => {
|
|
58
58
|
(0, _reactRelay.commitMutation)(environment, {
|
|
@@ -73,9 +73,6 @@ const StripeProvider = _ref => {
|
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
}, [environment]);
|
|
76
|
-
const {
|
|
77
|
-
stripe: config
|
|
78
|
-
} = (0, _react.useContext)(_ConfigContext.default);
|
|
79
76
|
const options = {
|
|
80
77
|
appearance: config.appearance ?? {
|
|
81
78
|
theme: 'flat',
|