fontdue-js 2.16.1 → 2.17.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 +7 -0
- package/dist/__generated__/AddressFieldsRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/AddressFieldsRefetchQuery.graphql.js +25 -4
- package/dist/__generated__/AddressFields_viewer.graphql.d.ts +5 -1
- package/dist/__generated__/AddressFields_viewer.graphql.js +23 -2
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +10 -4
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +10 -4
- package/dist/__generated__/CartOrderUpdateMutation.graphql.d.ts +3 -2
- package/dist/__generated__/CartOrderUpdateMutation.graphql.js +10 -4
- package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CartQuery.graphql.js +22 -4
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.js +43 -4
- package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +3 -2
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +60 -53
- package/dist/__generated__/CartState_order.graphql.d.ts +2 -1
- package/dist/__generated__/CartState_order.graphql.js +8 -2
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +10 -4
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.d.ts +5 -4
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +10 -4
- package/dist/__generated__/Checkout_UpdateOrderErrors.graphql.d.ts +3 -3
- package/dist/__generated__/Checkout_UpdateOrderErrors.graphql.js +3 -3
- package/dist/__generated__/Checkout_identity.graphql.d.ts +2 -2
- package/dist/__generated__/Checkout_identity.graphql.js +3 -3
- package/dist/__generated__/Checkout_order.graphql.d.ts +3 -3
- package/dist/__generated__/Checkout_order.graphql.js +2 -2
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.js +43 -4
- package/dist/__generated__/CustomerLoginFormLoginMutation.graphql.d.ts +4 -1
- package/dist/__generated__/CustomerLoginFormLoginMutation.graphql.js +1 -1
- package/dist/__generated__/FontFamiliesQuery.graphql.d.ts +2 -1
- package/dist/__generated__/FontFamiliesQuery.graphql.js +1 -1
- package/dist/__generated__/OrderVariableSelectionRedux_viewer.graphql.d.ts +6 -1
- package/dist/__generated__/OrderVariableSelectionRedux_viewer.graphql.js +29 -2
- package/dist/__generated__/OrderVariableSelection_variables.graphql.d.ts +5 -1
- package/dist/__generated__/OrderVariableSelection_variables.graphql.js +31 -15
- package/dist/__generated__/PrecartAddToCartMutation.graphql.d.ts +2 -1
- package/dist/__generated__/PrecartAddToCartMutation.graphql.js +10 -4
- package/dist/__generated__/PriceBarSectionRefetchQuery.graphql.d.ts +2 -1
- package/dist/__generated__/PriceBarSectionRefetchQuery.graphql.js +1 -1
- package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +8 -2
- package/dist/__generated__/StoreModalCartQuery.graphql.js +173 -126
- package/dist/__generated__/StoreModalIndexItem_fontCollection.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalIndexItem_fontCollection.graphql.js +8 -2
- package/dist/__generated__/StoreModalIndexQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalIndexQuery.graphql.js +9 -3
- package/dist/__generated__/StoreModalOrderVariableSelection_order.graphql.d.ts +30 -0
- package/dist/__generated__/StoreModalOrderVariableSelection_order.graphql.js +98 -0
- package/dist/__generated__/StoreModalOrderVariableSelection_viewer.graphql.d.ts +1 -16
- package/dist/__generated__/StoreModalOrderVariableSelection_viewer.graphql.js +40 -104
- package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalProductQuery.graphql.js +24 -3
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +1 -1
- package/dist/__generated__/StoreModalProductSummaryAddToCartMutation.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalProductSummaryAddToCartMutation.graphql.js +1 -1
- package/dist/__generated__/StoreModalProductSummaryRefetchQuery.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalProductSummaryRefetchQuery.graphql.js +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.js +43 -4
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.js +43 -4
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.d.ts +5 -4
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.js +43 -4
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.d.ts +13 -3
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.js +50 -4
- package/dist/__generated__/StoreModalUnifiedCheckout_viewer.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalUnifiedCheckout_viewer.graphql.js +8 -2
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +10 -4
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.d.ts +2 -1
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.js +30 -14
- package/dist/__generated__/TypeTesterStyleSelectData_fontStyle.graphql.d.ts +2 -1
- package/dist/__generated__/TypeTesterStyleSelectData_fontStyle.graphql.js +8 -2
- package/dist/__generated__/TypeTesterStyleSelectData_viewer.graphql.d.ts +4 -1
- package/dist/__generated__/TypeTesterStyleSelectData_viewer.graphql.js +17 -2
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.d.ts +2 -1
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTestersIDQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersIDQuery.graphql.js +53 -37
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.d.ts +2 -1
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTestersSlugQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersSlugQuery.graphql.js +53 -37
- package/dist/components/Cart/AddressFields.d.ts +3 -2
- package/dist/components/Cart/AddressFields.js +45 -47
- package/dist/components/Cart/CartState.js +1 -1
- package/dist/components/Cart/CartTotals.d.ts +5 -2
- package/dist/components/Cart/CartTotals.js +24 -10
- package/dist/components/Cart/Checkout.js +33 -6
- package/dist/components/Cart/types.d.ts +1 -1
- package/dist/components/OrderVariableSelection/OrderVariableSelectionRedux.js +21 -1
- package/dist/components/OrderVariableSelection/index.d.ts +1 -0
- package/dist/components/OrderVariableSelection/index.js +23 -10
- package/dist/components/StoreModal/StoreModalCart.js +9 -6
- package/dist/components/StoreModal/StoreModalIndexItem.js +3 -3
- package/dist/components/StoreModal/StoreModalOrderVariableSelection.d.ts +3 -1
- package/dist/components/StoreModal/StoreModalOrderVariableSelection.js +9 -5
- package/dist/components/StoreModal/StoreModalStyleButton.js +1 -8
- package/dist/components/StripeProvider/index.js +5 -3
- package/dist/components/TypeTester/TypeTesterStyleSelectData.js +12 -3
- package/dist/components/elements/StoreModalUnifiedCheckout.d.ts +60 -1
- package/dist/components/elements/StoreModalUnifiedCheckout.js +409 -201
- package/dist/fontdue.css +36 -10
- package/dist/reducer.d.ts +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +11 -2
- package/package.json +2 -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<<950078d2a894ea603b9774c7d0a4f31e>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -341,6 +341,12 @@ const node = function () {
|
|
|
341
341
|
}],
|
|
342
342
|
"storageKey": null
|
|
343
343
|
}, v12 /*: any*/, {
|
|
344
|
+
"alias": null,
|
|
345
|
+
"args": null,
|
|
346
|
+
"kind": "ScalarField",
|
|
347
|
+
"name": "supportedLanguages",
|
|
348
|
+
"storageKey": null
|
|
349
|
+
}, {
|
|
344
350
|
"alias": null,
|
|
345
351
|
"args": null,
|
|
346
352
|
"kind": "ScalarField",
|
|
@@ -486,12 +492,12 @@ const node = function () {
|
|
|
486
492
|
}]
|
|
487
493
|
},
|
|
488
494
|
"params": {
|
|
489
|
-
"cacheID": "
|
|
495
|
+
"cacheID": "21f60a31fa4d0078bfe4819ceb3a78d8",
|
|
490
496
|
"id": null,
|
|
491
497
|
"metadata": {},
|
|
492
498
|
"name": "TypeTestersRefetchQuery",
|
|
493
499
|
"operationKind": "query",
|
|
494
|
-
"text": "query TypeTestersRefetchQuery(\n $excludeTags: [String!] = null\n $licenseOptions: [LicenseOptionsSpec] = []\n $orderVariables: [OrderVariableSelectionInput!] = []\n $tags: [String!] = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...TypeTesters_collection_32it0Z\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment PriceBarSection_node_4sncub on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_4sncub\n id\n priceWithLicenseOptions: price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_4sncub on FontCollection {\n ...PriceBarSection_node_4sncub\n parent {\n ...PriceBarSection_node_4sncub\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_4sncub on Sku {\n id\n price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_4sncub on Sku {\n id\n ...SKUPrice_sku_4sncub\n}\n\nfragment TypeTesterFeaturesButton_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n}\n\nfragment TypeTesterFeatures_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n}\n\nfragment TypeTesterFloatingToolbar_testers on TypeTester {\n id\n fontStyle {\n ...TypeTesterToolbar_fontStyle\n ...TypeTesterFeatures_fontStyle\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n name\n id\n }\n}\n\nfragment TypeTesterToolbar_fontStyle on FontStyle {\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterFeaturesButton_fontStyle\n}\n\nfragment TypeTesterVariableAxes_fontStyle on FontStyle {\n variableAxes {\n axis\n name\n minValue\n maxValue\n }\n}\n\nfragment TypeTester_fontStyle_4sncub on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n family {\n cssUrl\n id\n }\n sku {\n ...SelectButton_sku_4sncub\n ...SKUPrice_sku_4sncub\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment TypeTesters_collection_32it0Z on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_4sncub\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_4sncub\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_4sncub\n }\n parent {\n id\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n"
|
|
500
|
+
"text": "query TypeTestersRefetchQuery(\n $excludeTags: [String!] = null\n $licenseOptions: [LicenseOptionsSpec] = []\n $orderVariables: [OrderVariableSelectionInput!] = []\n $tags: [String!] = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...TypeTesters_collection_32it0Z\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment PriceBarSection_node_4sncub on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_4sncub\n id\n priceWithLicenseOptions: price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_4sncub on FontCollection {\n ...PriceBarSection_node_4sncub\n parent {\n ...PriceBarSection_node_4sncub\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_4sncub on Sku {\n id\n price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_4sncub on Sku {\n id\n ...SKUPrice_sku_4sncub\n}\n\nfragment TypeTesterFeaturesButton_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n}\n\nfragment TypeTesterFeatures_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n}\n\nfragment TypeTesterFloatingToolbar_testers on TypeTester {\n id\n fontStyle {\n ...TypeTesterToolbar_fontStyle\n ...TypeTesterFeatures_fontStyle\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n name\n id\n }\n}\n\nfragment TypeTesterToolbar_fontStyle on FontStyle {\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterFeaturesButton_fontStyle\n}\n\nfragment TypeTesterVariableAxes_fontStyle on FontStyle {\n variableAxes {\n axis\n name\n minValue\n maxValue\n }\n}\n\nfragment TypeTester_fontStyle_4sncub on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n family {\n cssUrl\n id\n }\n sku {\n ...SelectButton_sku_4sncub\n ...SKUPrice_sku_4sncub\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment TypeTesters_collection_32it0Z on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_4sncub\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_4sncub\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_4sncub\n }\n parent {\n id\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n"
|
|
495
501
|
}
|
|
496
502
|
};
|
|
497
503
|
}();
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* @generated SignedSource<<
|
|
8
|
+
* @generated SignedSource<<6f88b8fea2605678ef19cba0d3b1604b>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -78,39 +78,46 @@ const node = function () {
|
|
|
78
78
|
"alias": null,
|
|
79
79
|
"args": null,
|
|
80
80
|
"kind": "ScalarField",
|
|
81
|
-
"name": "
|
|
81
|
+
"name": "supportedLanguages",
|
|
82
82
|
"storageKey": null
|
|
83
83
|
},
|
|
84
84
|
v12 = {
|
|
85
85
|
"alias": null,
|
|
86
86
|
"args": null,
|
|
87
87
|
"kind": "ScalarField",
|
|
88
|
-
"name": "
|
|
88
|
+
"name": "cssWeight",
|
|
89
89
|
"storageKey": null
|
|
90
90
|
},
|
|
91
91
|
v13 = {
|
|
92
92
|
"alias": null,
|
|
93
93
|
"args": null,
|
|
94
94
|
"kind": "ScalarField",
|
|
95
|
-
"name": "
|
|
95
|
+
"name": "cssStyle",
|
|
96
96
|
"storageKey": null
|
|
97
97
|
},
|
|
98
98
|
v14 = {
|
|
99
99
|
"alias": null,
|
|
100
100
|
"args": null,
|
|
101
101
|
"kind": "ScalarField",
|
|
102
|
-
"name": "
|
|
102
|
+
"name": "cssStretch",
|
|
103
103
|
"storageKey": null
|
|
104
104
|
},
|
|
105
105
|
v15 = {
|
|
106
|
+
"alias": null,
|
|
107
|
+
"args": null,
|
|
108
|
+
"kind": "ScalarField",
|
|
109
|
+
"name": "axis",
|
|
110
|
+
"storageKey": null
|
|
111
|
+
},
|
|
112
|
+
v16 = {
|
|
106
113
|
"alias": null,
|
|
107
114
|
"args": null,
|
|
108
115
|
"kind": "ScalarField",
|
|
109
116
|
"name": "value",
|
|
110
117
|
"storageKey": null
|
|
111
118
|
},
|
|
112
|
-
|
|
113
|
-
|
|
119
|
+
v17 = [v15 /*: any*/, v16 /*: any*/],
|
|
120
|
+
v18 = {
|
|
114
121
|
"alias": null,
|
|
115
122
|
"args": null,
|
|
116
123
|
"concreteType": "VariableInstance",
|
|
@@ -124,96 +131,96 @@ const node = function () {
|
|
|
124
131
|
"kind": "LinkedField",
|
|
125
132
|
"name": "coordinates",
|
|
126
133
|
"plural": true,
|
|
127
|
-
"selections":
|
|
134
|
+
"selections": v17 /*: any*/,
|
|
128
135
|
"storageKey": null
|
|
129
136
|
}],
|
|
130
137
|
"storageKey": null
|
|
131
138
|
},
|
|
132
|
-
|
|
139
|
+
v19 = {
|
|
133
140
|
"kind": "Literal",
|
|
134
141
|
"name": "licenseOptions",
|
|
135
142
|
"value": [] /*: any*/
|
|
136
143
|
},
|
|
137
|
-
|
|
144
|
+
v20 = [v19 /*: any*/, {
|
|
138
145
|
"kind": "Literal",
|
|
139
146
|
"name": "orderVariables",
|
|
140
147
|
"value": [] /*: any*/
|
|
141
148
|
}],
|
|
142
|
-
|
|
149
|
+
v21 = {
|
|
143
150
|
"alias": null,
|
|
144
151
|
"args": null,
|
|
145
152
|
"kind": "ScalarField",
|
|
146
153
|
"name": "amount",
|
|
147
154
|
"storageKey": null
|
|
148
155
|
},
|
|
149
|
-
|
|
156
|
+
v22 = [v21 /*: any*/, {
|
|
150
157
|
"alias": null,
|
|
151
158
|
"args": null,
|
|
152
159
|
"kind": "ScalarField",
|
|
153
160
|
"name": "currency",
|
|
154
161
|
"storageKey": null
|
|
155
162
|
}],
|
|
156
|
-
|
|
163
|
+
v23 = {
|
|
157
164
|
"alias": null,
|
|
158
|
-
"args":
|
|
165
|
+
"args": v20 /*: any*/,
|
|
159
166
|
"concreteType": "Money",
|
|
160
167
|
"kind": "LinkedField",
|
|
161
168
|
"name": "price",
|
|
162
169
|
"plural": false,
|
|
163
|
-
"selections":
|
|
170
|
+
"selections": v22 /*: any*/,
|
|
164
171
|
"storageKey": "price(licenseOptions:[],orderVariables:[])"
|
|
165
172
|
},
|
|
166
|
-
|
|
173
|
+
v24 = {
|
|
167
174
|
"alias": null,
|
|
168
175
|
"args": null,
|
|
169
176
|
"kind": "ScalarField",
|
|
170
177
|
"name": "collectionType",
|
|
171
178
|
"storageKey": null
|
|
172
179
|
},
|
|
173
|
-
|
|
180
|
+
v25 = {
|
|
174
181
|
"alias": null,
|
|
175
182
|
"args": null,
|
|
176
183
|
"concreteType": "Sku",
|
|
177
184
|
"kind": "LinkedField",
|
|
178
185
|
"name": "sku",
|
|
179
186
|
"plural": false,
|
|
180
|
-
"selections": [v9 /*: any*/,
|
|
187
|
+
"selections": [v9 /*: any*/, v23 /*: any*/, {
|
|
181
188
|
"alias": "priceWithLicenseOptions",
|
|
182
|
-
"args":
|
|
189
|
+
"args": v20 /*: any*/,
|
|
183
190
|
"concreteType": "Money",
|
|
184
191
|
"kind": "LinkedField",
|
|
185
192
|
"name": "price",
|
|
186
193
|
"plural": false,
|
|
187
|
-
"selections":
|
|
194
|
+
"selections": v22 /*: any*/,
|
|
188
195
|
"storageKey": "price(licenseOptions:[],orderVariables:[])"
|
|
189
196
|
}],
|
|
190
197
|
"storageKey": null
|
|
191
198
|
},
|
|
192
|
-
|
|
199
|
+
v26 = {
|
|
193
200
|
"alias": null,
|
|
194
201
|
"args": null,
|
|
195
202
|
"kind": "ScalarField",
|
|
196
203
|
"name": "totalStyles",
|
|
197
204
|
"storageKey": null
|
|
198
205
|
},
|
|
199
|
-
|
|
206
|
+
v27 = {
|
|
200
207
|
"alias": null,
|
|
201
|
-
"args": [
|
|
208
|
+
"args": [v19 /*: any*/],
|
|
202
209
|
"concreteType": "Money",
|
|
203
210
|
"kind": "LinkedField",
|
|
204
211
|
"name": "totalStylesPrice",
|
|
205
212
|
"plural": false,
|
|
206
|
-
"selections":
|
|
213
|
+
"selections": v22 /*: any*/,
|
|
207
214
|
"storageKey": "totalStylesPrice(licenseOptions:[])"
|
|
208
215
|
},
|
|
209
|
-
|
|
216
|
+
v28 = {
|
|
210
217
|
"alias": null,
|
|
211
218
|
"args": null,
|
|
212
219
|
"concreteType": "FontCollection",
|
|
213
220
|
"kind": "LinkedField",
|
|
214
221
|
"name": "parent",
|
|
215
222
|
"plural": false,
|
|
216
|
-
"selections": [v9 /*: any*/, v10 /*: any*/,
|
|
223
|
+
"selections": [v9 /*: any*/, v10 /*: any*/, v24 /*: any*/, v25 /*: any*/, v26 /*: any*/, v27 /*: any*/],
|
|
217
224
|
"storageKey": null
|
|
218
225
|
};
|
|
219
226
|
return {
|
|
@@ -308,6 +315,15 @@ const node = function () {
|
|
|
308
315
|
"kind": "ScalarField",
|
|
309
316
|
"name": "isVariableFont",
|
|
310
317
|
"storageKey": null
|
|
318
|
+
}, {
|
|
319
|
+
"alias": null,
|
|
320
|
+
"args": null,
|
|
321
|
+
"concreteType": "FontStyle",
|
|
322
|
+
"kind": "LinkedField",
|
|
323
|
+
"name": "featureStyle",
|
|
324
|
+
"plural": false,
|
|
325
|
+
"selections": [v11 /*: any*/, v9 /*: any*/],
|
|
326
|
+
"storageKey": null
|
|
311
327
|
}, {
|
|
312
328
|
"alias": null,
|
|
313
329
|
"args": null,
|
|
@@ -315,7 +331,7 @@ const node = function () {
|
|
|
315
331
|
"kind": "LinkedField",
|
|
316
332
|
"name": "fontStyles",
|
|
317
333
|
"plural": true,
|
|
318
|
-
"selections": [v9 /*: any*/, v10 /*: any*/,
|
|
334
|
+
"selections": [v9 /*: any*/, v10 /*: any*/, v12 /*: any*/, v13 /*: any*/, v14 /*: any*/, v18 /*: any*/],
|
|
319
335
|
"storageKey": null
|
|
320
336
|
}],
|
|
321
337
|
"storageKey": null
|
|
@@ -445,7 +461,7 @@ const node = function () {
|
|
|
445
461
|
"kind": "LinkedField",
|
|
446
462
|
"name": "variableAxes",
|
|
447
463
|
"plural": true,
|
|
448
|
-
"selections": [
|
|
464
|
+
"selections": [v15 /*: any*/, v10 /*: any*/, {
|
|
449
465
|
"alias": null,
|
|
450
466
|
"args": null,
|
|
451
467
|
"kind": "ScalarField",
|
|
@@ -459,7 +475,7 @@ const node = function () {
|
|
|
459
475
|
"storageKey": null
|
|
460
476
|
}],
|
|
461
477
|
"storageKey": null
|
|
462
|
-
}, v10 /*: any*/, v11 /*: any*/, v12 /*: any*/, v13 /*: any*/,
|
|
478
|
+
}, v10 /*: any*/, v11 /*: any*/, v12 /*: any*/, v13 /*: any*/, v14 /*: any*/, v18 /*: any*/, {
|
|
463
479
|
"alias": null,
|
|
464
480
|
"args": null,
|
|
465
481
|
"concreteType": "FontCollection",
|
|
@@ -487,14 +503,14 @@ const node = function () {
|
|
|
487
503
|
"kind": "LinkedField",
|
|
488
504
|
"name": "sku",
|
|
489
505
|
"plural": false,
|
|
490
|
-
"selections": [v9 /*: any*/,
|
|
506
|
+
"selections": [v9 /*: any*/, v23 /*: any*/, {
|
|
491
507
|
"alias": "basePrice",
|
|
492
508
|
"args": null,
|
|
493
509
|
"concreteType": "Money",
|
|
494
510
|
"kind": "LinkedField",
|
|
495
511
|
"name": "price",
|
|
496
512
|
"plural": false,
|
|
497
|
-
"selections": [
|
|
513
|
+
"selections": [v21 /*: any*/],
|
|
498
514
|
"storageKey": null
|
|
499
515
|
}],
|
|
500
516
|
"storageKey": null
|
|
@@ -507,7 +523,7 @@ const node = function () {
|
|
|
507
523
|
"kind": "LinkedField",
|
|
508
524
|
"name": "variableSettings",
|
|
509
525
|
"plural": true,
|
|
510
|
-
"selections":
|
|
526
|
+
"selections": v17 /*: any*/,
|
|
511
527
|
"storageKey": null
|
|
512
528
|
}, {
|
|
513
529
|
"alias": null,
|
|
@@ -522,7 +538,7 @@ const node = function () {
|
|
|
522
538
|
"kind": "ScalarField",
|
|
523
539
|
"name": "feature",
|
|
524
540
|
"storageKey": null
|
|
525
|
-
},
|
|
541
|
+
}, v16 /*: any*/],
|
|
526
542
|
"storageKey": null
|
|
527
543
|
}, {
|
|
528
544
|
"alias": null,
|
|
@@ -548,14 +564,14 @@ const node = function () {
|
|
|
548
564
|
"kind": "ScalarField",
|
|
549
565
|
"name": "typeTesterAxes",
|
|
550
566
|
"storageKey": null
|
|
551
|
-
}, v9 /*: any*/, v10 /*: any*/,
|
|
567
|
+
}, v9 /*: any*/, v10 /*: any*/, v24 /*: any*/, v25 /*: any*/, v26 /*: any*/, v27 /*: any*/, v28 /*: any*/, {
|
|
552
568
|
"alias": "families",
|
|
553
569
|
"args": [v7 /*: any*/],
|
|
554
570
|
"concreteType": "FontCollection",
|
|
555
571
|
"kind": "LinkedField",
|
|
556
572
|
"name": "children",
|
|
557
573
|
"plural": true,
|
|
558
|
-
"selections": [v9 /*: any*/, v10 /*: any*/,
|
|
574
|
+
"selections": [v9 /*: any*/, v10 /*: any*/, v24 /*: any*/, v25 /*: any*/, v26 /*: any*/, v27 /*: any*/, v28 /*: any*/],
|
|
559
575
|
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
560
576
|
}],
|
|
561
577
|
"storageKey": null
|
|
@@ -566,12 +582,12 @@ const node = function () {
|
|
|
566
582
|
}]
|
|
567
583
|
},
|
|
568
584
|
"params": {
|
|
569
|
-
"cacheID": "
|
|
585
|
+
"cacheID": "b56bf1cf6ad0eddf96fe789bec53095b",
|
|
570
586
|
"id": null,
|
|
571
587
|
"metadata": {},
|
|
572
588
|
"name": "TypeTestersSlugQuery",
|
|
573
589
|
"operationKind": "query",
|
|
574
|
-
"text": "query TypeTestersSlugQuery(\n $collectionSlug: String!\n $tags: [String!]\n $excludeTags: [String!]\n $selectable: Boolean!\n) {\n viewer {\n ...TypeTesters_viewer_4g9a6U\n slug(name: $collectionSlug) {\n collection: fontCollection {\n ...TypeTesters_collection_4Goyz5\n id\n }\n id\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment PriceBarSection_node_3BtHDv on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_3BtHDv\n id\n priceWithLicenseOptions: price(licenseOptions: [], orderVariables: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_3BtHDv on FontCollection {\n ...PriceBarSection_node_3BtHDv\n parent {\n ...PriceBarSection_node_3BtHDv\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_3BtHDv on Sku {\n id\n price(licenseOptions: [], orderVariables: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_3BtHDv on Sku {\n id\n ...SKUPrice_sku_3BtHDv\n}\n\nfragment TypeTesterFeaturesButton_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n}\n\nfragment TypeTesterFeatures_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n}\n\nfragment TypeTesterFloatingToolbar_testers on TypeTester {\n id\n fontStyle {\n ...TypeTesterToolbar_fontStyle\n ...TypeTesterFeatures_fontStyle\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n name\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_viewer_4g9a6U on Viewer {\n families: fontCollections(collectionTypes: [FAMILY], first: 999) @include(if: $selectable) {\n edges {\n node {\n id\n name\n isVariableFont\n fontStyles {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n }\n }\n }\n }\n}\n\nfragment TypeTesterToolbar_fontStyle on FontStyle {\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterFeaturesButton_fontStyle\n}\n\nfragment TypeTesterVariableAxes_fontStyle on FontStyle {\n variableAxes {\n axis\n name\n minValue\n maxValue\n }\n}\n\nfragment TypeTester_fontStyle_3BtHDv on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n family {\n cssUrl\n id\n }\n sku {\n ...SelectButton_sku_3BtHDv\n ...SKUPrice_sku_3BtHDv\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment TypeTester_viewer_4g9a6U on Viewer {\n ...TypeTesterStyleSelectData_viewer_4g9a6U\n}\n\nfragment TypeTesters_collection_4Goyz5 on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_3BtHDv\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_3BtHDv\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_3BtHDv\n }\n parent {\n id\n }\n}\n\nfragment TypeTesters_viewer_4g9a6U on Viewer {\n ...TypeTester_viewer_4g9a6U\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n"
|
|
590
|
+
"text": "query TypeTestersSlugQuery(\n $collectionSlug: String!\n $tags: [String!]\n $excludeTags: [String!]\n $selectable: Boolean!\n) {\n viewer {\n ...TypeTesters_viewer_4g9a6U\n slug(name: $collectionSlug) {\n collection: fontCollection {\n ...TypeTesters_collection_4Goyz5\n id\n }\n id\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment PriceBarSection_node_3BtHDv on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_3BtHDv\n id\n priceWithLicenseOptions: price(licenseOptions: [], orderVariables: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_3BtHDv on FontCollection {\n ...PriceBarSection_node_3BtHDv\n parent {\n ...PriceBarSection_node_3BtHDv\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_3BtHDv on Sku {\n id\n price(licenseOptions: [], orderVariables: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_3BtHDv on Sku {\n id\n ...SKUPrice_sku_3BtHDv\n}\n\nfragment TypeTesterFeaturesButton_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n}\n\nfragment TypeTesterFeatures_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n}\n\nfragment TypeTesterFloatingToolbar_testers on TypeTester {\n id\n fontStyle {\n ...TypeTesterToolbar_fontStyle\n ...TypeTesterFeatures_fontStyle\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n name\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_viewer_4g9a6U on Viewer {\n families: fontCollections(collectionTypes: [FAMILY], first: 999) @include(if: $selectable) {\n edges {\n node {\n id\n name\n isVariableFont\n featureStyle {\n supportedLanguages\n id\n }\n fontStyles {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n }\n }\n }\n }\n}\n\nfragment TypeTesterToolbar_fontStyle on FontStyle {\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterFeaturesButton_fontStyle\n}\n\nfragment TypeTesterVariableAxes_fontStyle on FontStyle {\n variableAxes {\n axis\n name\n minValue\n maxValue\n }\n}\n\nfragment TypeTester_fontStyle_3BtHDv on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n family {\n cssUrl\n id\n }\n sku {\n ...SelectButton_sku_3BtHDv\n ...SKUPrice_sku_3BtHDv\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment TypeTester_viewer_4g9a6U on Viewer {\n ...TypeTesterStyleSelectData_viewer_4g9a6U\n}\n\nfragment TypeTesters_collection_4Goyz5 on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_3BtHDv\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_3BtHDv\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_3BtHDv\n }\n parent {\n id\n }\n}\n\nfragment TypeTesters_viewer_4g9a6U on Viewer {\n ...TypeTester_viewer_4g9a6U\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n"
|
|
575
591
|
}
|
|
576
592
|
};
|
|
577
593
|
}();
|
|
@@ -5,8 +5,9 @@ interface AddressFields_props {
|
|
|
5
5
|
viewer: AddressFields_viewer$key;
|
|
6
6
|
value: Identity;
|
|
7
7
|
identityType: 'licensee' | 'billing';
|
|
8
|
-
onChange: (value: Partial<Identity
|
|
8
|
+
onChange: (value: Partial<Identity>, complete?: boolean) => void;
|
|
9
9
|
errorsObject: UpdateOrderErrors['billingIdentity' | 'licenseeIdentity'] | undefined;
|
|
10
|
+
allowedCountries?: string[];
|
|
10
11
|
}
|
|
11
|
-
declare const AddressFields: ({ viewer: viewerKey, value, onChange, identityType, errorsObject, }: AddressFields_props) => React.JSX.Element;
|
|
12
|
+
declare const AddressFields: ({ viewer: viewerKey, value, onChange, identityType, errorsObject, allowedCountries, }: AddressFields_props) => React.JSX.Element;
|
|
12
13
|
export default AddressFields;
|
|
@@ -16,23 +16,21 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
const MAPS_API_KEY = 'AIzaSyB9rSjGVPZYcRkPl1PDezIuAp3XCUs2Crk';
|
|
18
18
|
const AddressFields = _ref => {
|
|
19
|
-
var _viewer$countryData, _value$street;
|
|
19
|
+
var _viewer$countryData, _value$street, _viewer$settings;
|
|
20
20
|
let {
|
|
21
21
|
viewer: viewerKey,
|
|
22
22
|
value,
|
|
23
23
|
onChange,
|
|
24
24
|
identityType,
|
|
25
|
-
errorsObject
|
|
25
|
+
errorsObject,
|
|
26
|
+
allowedCountries
|
|
26
27
|
} = _ref;
|
|
27
28
|
const [refetching, setRefetching] = (0, _react.useState)(false);
|
|
28
|
-
const [viewer, refetch] = (0, _reactRelay.useRefetchableFragment)((_AddressFields_viewer2.default.hash && _AddressFields_viewer2.default.hash !== "
|
|
29
|
+
const [viewer, refetch] = (0, _reactRelay.useRefetchableFragment)((_AddressFields_viewer2.default.hash && _AddressFields_viewer2.default.hash !== "2369fc95f554723701a8294b4522137a" && console.error("The definition of 'AddressFields_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _AddressFields_viewer2.default), viewerKey);
|
|
29
30
|
const countryData = (_viewer$countryData = viewer.countryData) === null || _viewer$countryData === void 0 ? void 0 : _viewer$countryData.response;
|
|
30
31
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
31
32
|
(0, _react.useEffect)(() => {
|
|
32
33
|
setRefetching(true);
|
|
33
|
-
console.log({
|
|
34
|
-
country: value.country
|
|
35
|
-
});
|
|
36
34
|
|
|
37
35
|
// refetch after using fetchQuery to avoid triggering Suspense
|
|
38
36
|
const subscription = (0, _reactRelay.fetchQuery)(environment, _AddressFieldsRefetchQuery.default, {
|
|
@@ -59,9 +57,30 @@ const AddressFields = _ref => {
|
|
|
59
57
|
return errorsObject === null || errorsObject === void 0 ? void 0 : (_errorsObject$field = errorsObject[field]) === null || _errorsObject$field === void 0 ? void 0 : _errorsObject$field.filter(_utils.notEmpty);
|
|
60
58
|
};
|
|
61
59
|
const lines = (_value$street = value.street) === null || _value$street === void 0 ? void 0 : _value$street.split('\n');
|
|
60
|
+
|
|
61
|
+
// Use consolidated phone settings
|
|
62
|
+
const phoneCollection = (_viewer$settings = viewer.settings) === null || _viewer$settings === void 0 ? void 0 : _viewer$settings.checkoutPhoneNumberCollection;
|
|
63
|
+
const phoneFieldConfig = phoneCollection === 'never' ? {
|
|
64
|
+
phone: 'never'
|
|
65
|
+
} : {
|
|
66
|
+
phone: 'always'
|
|
67
|
+
};
|
|
68
|
+
const phoneValidationConfig = phoneCollection === 'required' ? {
|
|
69
|
+
phone: {
|
|
70
|
+
required: 'always'
|
|
71
|
+
}
|
|
72
|
+
} : phoneCollection === 'never' ? {} : {
|
|
73
|
+
phone: {
|
|
74
|
+
required: 'never'
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Only include phone in defaultValues if phone field is shown
|
|
62
79
|
const defaultValues = {
|
|
63
80
|
name: value.name,
|
|
64
|
-
|
|
81
|
+
...(phoneCollection !== 'never' && {
|
|
82
|
+
phone: value.phone
|
|
83
|
+
}),
|
|
65
84
|
address: {
|
|
66
85
|
country: value.country,
|
|
67
86
|
line1: lines === null || lines === void 0 ? void 0 : lines[0],
|
|
@@ -72,38 +91,19 @@ const AddressFields = _ref => {
|
|
|
72
91
|
}
|
|
73
92
|
};
|
|
74
93
|
const handleAddressElementChange = (0, _react.useCallback)(e => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
};
|
|
89
|
-
onChange(value);
|
|
90
|
-
} else {
|
|
91
|
-
// clear these fields if incomplete, e.g. if user starts with a complete address and then
|
|
92
|
-
// changes to an incomplete one, it could cause some confusion (it would allow the "save" to
|
|
93
|
-
// happen with stale state). doing this also ensures the "save" button returns to a disabled
|
|
94
|
-
// state until the new changes are complete
|
|
95
|
-
onChange({
|
|
96
|
-
name: '',
|
|
97
|
-
phone: '',
|
|
98
|
-
// keep country, otherwise we will trigger the refetch
|
|
99
|
-
country: e.value.address.country,
|
|
100
|
-
street: '',
|
|
101
|
-
locality: '',
|
|
102
|
-
sublocality: '',
|
|
103
|
-
administrativeArea: '',
|
|
104
|
-
zip: ''
|
|
105
|
-
});
|
|
106
|
-
}
|
|
94
|
+
// Always update country immediately, regardless of form completeness
|
|
95
|
+
const country = e.value.address.country;
|
|
96
|
+
const value = {
|
|
97
|
+
name: e.value.name,
|
|
98
|
+
phone: e.value.phone ?? '',
|
|
99
|
+
country,
|
|
100
|
+
street: e.value.address.line1 + (e.value.address.line2 ? `\n${e.value.address.line2}` : ''),
|
|
101
|
+
locality: e.value.address.city,
|
|
102
|
+
sublocality: '',
|
|
103
|
+
administrativeArea: e.value.address.state,
|
|
104
|
+
zip: e.value.address.postal_code
|
|
105
|
+
};
|
|
106
|
+
onChange(value, e.complete);
|
|
107
107
|
}, [onChange]);
|
|
108
108
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
109
109
|
className: "checkout-modal__section"
|
|
@@ -127,23 +127,21 @@ const AddressFields = _ref => {
|
|
|
127
127
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
128
128
|
className: "checkout-modal__section"
|
|
129
129
|
}, /*#__PURE__*/_react.default.createElement(_reactStripeJs.AddressElement, {
|
|
130
|
+
key: (allowedCountries === null || allowedCountries === void 0 ? void 0 : allowedCountries.join(',')) || 'all',
|
|
130
131
|
options: {
|
|
131
132
|
mode: identityType === 'billing' ? 'billing' : 'shipping',
|
|
132
133
|
autocomplete: {
|
|
133
134
|
mode: 'google_maps_api',
|
|
134
135
|
apiKey: MAPS_API_KEY
|
|
135
136
|
},
|
|
136
|
-
fields:
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
validation: {
|
|
140
|
-
phone: {
|
|
141
|
-
required: 'always'
|
|
142
|
-
}
|
|
143
|
-
},
|
|
137
|
+
fields: phoneFieldConfig,
|
|
138
|
+
validation: phoneValidationConfig,
|
|
144
139
|
display: {
|
|
145
140
|
name: 'full'
|
|
146
141
|
},
|
|
142
|
+
...(allowedCountries && allowedCountries.length > 0 ? {
|
|
143
|
+
allowedCountries
|
|
144
|
+
} : {}),
|
|
147
145
|
defaultValues
|
|
148
146
|
},
|
|
149
147
|
onChange: handleAddressElementChange
|
|
@@ -17,7 +17,7 @@ function CartState(_ref) {
|
|
|
17
17
|
order: orderKey,
|
|
18
18
|
children
|
|
19
19
|
} = _ref;
|
|
20
|
-
const order = (0, _reactRelay.useFragment)((_CartState_order2.default.hash && _CartState_order2.default.hash !== "
|
|
20
|
+
const order = (0, _reactRelay.useFragment)((_CartState_order2.default.hash && _CartState_order2.default.hash !== "43fd3d7af7ffe0b50a192674fde8286c" && console.error("The definition of 'CartState_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartState_order2.default), orderKey);
|
|
21
21
|
const [error, setError] = (0, _react.useState)(null);
|
|
22
22
|
const [errors, setErrors] = (0, _react.useState)(null);
|
|
23
23
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
@@ -4,7 +4,10 @@ interface CartTotalsProps {
|
|
|
4
4
|
order: CartTotals_order$key;
|
|
5
5
|
onRemoveDiscount?: () => void;
|
|
6
6
|
allowDiscountRemoval?: boolean;
|
|
7
|
-
|
|
7
|
+
billingIdentity?: {
|
|
8
|
+
name?: string | null;
|
|
9
|
+
} | null;
|
|
10
|
+
taxSystem?: string | null;
|
|
8
11
|
}
|
|
9
|
-
export default function CartTotals({ order: orderKey, onRemoveDiscount, allowDiscountRemoval,
|
|
12
|
+
export default function CartTotals({ order: orderKey, onRemoveDiscount, allowDiscountRemoval, billingIdentity, taxSystem, }: CartTotalsProps): React.JSX.Element;
|
|
10
13
|
export {};
|
|
@@ -42,13 +42,13 @@ function CartTotals(_ref2) {
|
|
|
42
42
|
order: orderKey,
|
|
43
43
|
onRemoveDiscount,
|
|
44
44
|
allowDiscountRemoval = true,
|
|
45
|
-
|
|
45
|
+
billingIdentity,
|
|
46
|
+
taxSystem
|
|
46
47
|
} = _ref2;
|
|
47
48
|
const order = (0, _reactRelay.useFragment)((_CartTotals_order2.default.hash && _CartTotals_order2.default.hash !== "7fe25d7e214b579ce085157b9bd551a8" && console.error("The definition of 'CartTotals_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartTotals_order2.default), orderKey);
|
|
48
49
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
50
|
className: "cart__price-blocks",
|
|
50
|
-
"data-has-discount": Boolean(order.discount)
|
|
51
|
-
"data-hide-total": hideTotal
|
|
51
|
+
"data-has-discount": Boolean(order.discount)
|
|
52
52
|
}, /*#__PURE__*/_react.default.createElement(PriceBlock, {
|
|
53
53
|
label: "Subtotal",
|
|
54
54
|
price: order.subtotal,
|
|
@@ -73,13 +73,27 @@ function CartTotals(_ref2) {
|
|
|
73
73
|
label: "Discounted subtotal",
|
|
74
74
|
price: order.discountedSubtotal,
|
|
75
75
|
"data-line": "discounted-subtotal"
|
|
76
|
-
})),
|
|
77
|
-
|
|
78
|
-
price: order.taxes,
|
|
76
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: "cart__price-block",
|
|
79
78
|
"data-line": "taxes"
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
80
|
+
className: "cart__price-block__label"
|
|
81
|
+
}, order.taxes && order.taxName ? `${order.taxName} (${percentage(order.taxRate)})` : 'Tax'), /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
+
className: "cart__price-block__price"
|
|
83
|
+
}, order.taxes ? /*#__PURE__*/_react.default.createElement(_Price.default, {
|
|
84
|
+
price: order.taxes
|
|
85
|
+
}) : taxSystem === 'stripe' ? /*#__PURE__*/_react.default.createElement("span", {
|
|
86
|
+
className: "cart__price-block__placeholder"
|
|
87
|
+
}, "Calculated at checkout") : taxSystem === 'fontdue' && !billingIdentity ? /*#__PURE__*/_react.default.createElement("span", {
|
|
88
|
+
className: "cart__price-block__placeholder"
|
|
89
|
+
}, "Enter billing address") : '-')), /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
+
className: "cart__price-block",
|
|
83
91
|
"data-line": "total"
|
|
84
|
-
}
|
|
92
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
+
className: "cart__price-block__label"
|
|
94
|
+
}, "Total", order.gstIncluded ? ' including GST' : ''), /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
+
className: "cart__price-block__price"
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement(_Price.default, {
|
|
97
|
+
price: order.total
|
|
98
|
+
}))));
|
|
85
99
|
}
|