fontdue-js 2.22.3 → 2.23.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 +8 -0
- package/dist/__generated__/CartItemAdditionalLicenses_orderItem.graphql.d.ts +4 -1
- package/dist/__generated__/CartItemAdditionalLicenses_orderItem.graphql.js +34 -22
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +13 -4
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +13 -4
- package/dist/__generated__/CartOrderUpdateMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderUpdateMutation.graphql.js +13 -4
- package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CartQuery.graphql.js +13 -4
- package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +13 -4
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +13 -4
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +13 -4
- package/dist/__generated__/FontdueProviderQuery.graphql.d.ts +19 -0
- package/dist/__generated__/FontdueProviderQuery.graphql.js +140 -0
- package/dist/__generated__/PrecartAddToCartMutation.graphql.d.ts +1 -1
- package/dist/__generated__/PrecartAddToCartMutation.graphql.js +34 -25
- package/dist/__generated__/PrecartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/PrecartQuery.graphql.js +17 -7
- package/dist/__generated__/Precart_collection.graphql.d.ts +4 -1
- package/dist/__generated__/Precart_collection.graphql.js +13 -3
- package/dist/__generated__/Precart_license.graphql.d.ts +4 -1
- package/dist/__generated__/Precart_license.graphql.js +19 -9
- package/dist/__generated__/ServerConfigProvider_viewer.graphql.d.ts +23 -0
- package/dist/__generated__/ServerConfigProvider_viewer.graphql.js +57 -0
- package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalCartQuery.graphql.js +13 -4
- package/dist/__generated__/StoreModalIndexQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalIndexQuery.graphql.js +5 -5
- package/dist/__generated__/StoreModalProductLicense_license.graphql.d.ts +4 -1
- package/dist/__generated__/StoreModalProductLicense_license.graphql.js +11 -2
- package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductQuery.graphql.js +12 -3
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +42 -32
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +13 -4
- package/dist/__generated__/TestModeBanner_viewer.graphql.d.ts +19 -0
- package/dist/__generated__/TestModeBanner_viewer.graphql.js +36 -0
- package/dist/__generated__/ThemeConfig_viewer.graphql.d.ts +19 -0
- package/dist/__generated__/ThemeConfig_viewer.graphql.js +36 -0
- package/dist/__tests__/licenseExclusions.test.js +161 -0
- package/dist/components/BuyingOptions/index.d.ts +9 -0
- package/dist/components/Cart/CartItem/CartItemAdditionalLicenses.js +11 -5
- package/dist/components/CookieNotification/index.d.ts +13 -0
- package/dist/components/FontdueContextProvider/index.d.ts +17 -0
- package/dist/components/FontdueContextProvider/index.js +108 -0
- package/dist/components/FontdueContextProvider/index.server.d.ts +4 -0
- package/dist/components/FontdueContextProvider/index.server.js +7 -0
- package/dist/components/Precart/index.js +12 -7
- package/dist/components/StoreModal/StoreModalIndex.js +1 -1
- package/dist/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +10 -4
- package/dist/components/TypeTester/TypeTesterStandalone.preload.d.ts +3 -3
- package/dist/components/TypeTester/TypeTesterStandalone.preload.js +10 -9
- package/dist/config.d.ts +2 -1
- package/dist/config.js +17 -6
- package/dist/hooks/useResizeObserver.d.ts +11 -0
- package/dist/hooks/useResizeObserver.js +23 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/loadFontdueProviderQuery.d.ts +3 -0
- package/dist/loadFontdueProviderQuery.js +10 -0
- package/dist/reducer.d.ts +2 -0
- package/dist/reducer.js +3 -1
- package/dist/vite.d.ts +2 -0
- package/dist/vite.js +139 -0
- package/package.json +1 -1
- package/types/font-face-set.d.ts +11 -0
- package/.nvmrc +0 -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<<b8beebf238632610eff5094fa103228c>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -105,38 +105,39 @@ const node = function () {
|
|
|
105
105
|
}],
|
|
106
106
|
"storageKey": null
|
|
107
107
|
},
|
|
108
|
-
v12 =
|
|
108
|
+
v12 = [v5 /*: any*/],
|
|
109
|
+
v13 = {
|
|
109
110
|
"alias": null,
|
|
110
111
|
"args": null,
|
|
111
112
|
"concreteType": "FontCollection",
|
|
112
113
|
"kind": "LinkedField",
|
|
113
114
|
"name": "parent",
|
|
114
115
|
"plural": false,
|
|
115
|
-
"selections":
|
|
116
|
+
"selections": v12 /*: any*/,
|
|
116
117
|
"storageKey": null
|
|
117
118
|
},
|
|
118
|
-
|
|
119
|
+
v14 = {
|
|
119
120
|
"alias": null,
|
|
120
121
|
"args": null,
|
|
121
122
|
"kind": "ScalarField",
|
|
122
123
|
"name": "cssFamily",
|
|
123
124
|
"storageKey": null
|
|
124
125
|
},
|
|
125
|
-
|
|
126
|
+
v15 = {
|
|
126
127
|
"alias": null,
|
|
127
128
|
"args": null,
|
|
128
129
|
"kind": "ScalarField",
|
|
129
130
|
"name": "url",
|
|
130
131
|
"storageKey": null
|
|
131
132
|
},
|
|
132
|
-
|
|
133
|
+
v16 = {
|
|
133
134
|
"alias": null,
|
|
134
135
|
"args": null,
|
|
135
136
|
"concreteType": "WebfontSource",
|
|
136
137
|
"kind": "LinkedField",
|
|
137
138
|
"name": "webfontSources",
|
|
138
139
|
"plural": true,
|
|
139
|
-
"selections": [
|
|
140
|
+
"selections": [v15 /*: any*/, {
|
|
140
141
|
"alias": null,
|
|
141
142
|
"args": null,
|
|
142
143
|
"kind": "ScalarField",
|
|
@@ -145,7 +146,7 @@ const node = function () {
|
|
|
145
146
|
}],
|
|
146
147
|
"storageKey": null
|
|
147
148
|
},
|
|
148
|
-
|
|
149
|
+
v17 = {
|
|
149
150
|
"alias": null,
|
|
150
151
|
"args": null,
|
|
151
152
|
"concreteType": "VerticalMetrics",
|
|
@@ -179,31 +180,31 @@ const node = function () {
|
|
|
179
180
|
}],
|
|
180
181
|
"storageKey": null
|
|
181
182
|
},
|
|
182
|
-
|
|
183
|
+
v18 = {
|
|
183
184
|
"alias": null,
|
|
184
185
|
"args": null,
|
|
185
186
|
"kind": "ScalarField",
|
|
186
187
|
"name": "supportedLanguages",
|
|
187
188
|
"storageKey": null
|
|
188
189
|
},
|
|
189
|
-
|
|
190
|
+
v19 = {
|
|
190
191
|
"alias": null,
|
|
191
192
|
"args": null,
|
|
192
193
|
"concreteType": "FontStyle",
|
|
193
194
|
"kind": "LinkedField",
|
|
194
195
|
"name": "featureStyle",
|
|
195
196
|
"plural": false,
|
|
196
|
-
"selections": [
|
|
197
|
+
"selections": [v14 /*: any*/, v8 /*: any*/, v16 /*: any*/, v17 /*: any*/, v18 /*: any*/, v5 /*: any*/],
|
|
197
198
|
"storageKey": null
|
|
198
199
|
},
|
|
199
|
-
|
|
200
|
+
v20 = {
|
|
200
201
|
"alias": null,
|
|
201
202
|
"args": null,
|
|
202
203
|
"kind": "ScalarField",
|
|
203
204
|
"name": "totalStyles",
|
|
204
205
|
"storageKey": null
|
|
205
206
|
},
|
|
206
|
-
|
|
207
|
+
v21 = {
|
|
207
208
|
"alias": null,
|
|
208
209
|
"args": null,
|
|
209
210
|
"concreteType": "Money",
|
|
@@ -213,26 +214,26 @@ const node = function () {
|
|
|
213
214
|
"selections": v10 /*: any*/,
|
|
214
215
|
"storageKey": null
|
|
215
216
|
},
|
|
216
|
-
|
|
217
|
+
v22 = [{
|
|
217
218
|
"kind": "Literal",
|
|
218
219
|
"name": "collectionTypes",
|
|
219
220
|
"value": ["FAMILY"]
|
|
220
221
|
}],
|
|
221
|
-
|
|
222
|
+
v23 = {
|
|
222
223
|
"alias": null,
|
|
223
224
|
"args": null,
|
|
224
225
|
"kind": "ScalarField",
|
|
225
226
|
"name": "cssWeight",
|
|
226
227
|
"storageKey": null
|
|
227
228
|
},
|
|
228
|
-
|
|
229
|
+
v24 = {
|
|
229
230
|
"alias": null,
|
|
230
231
|
"args": null,
|
|
231
232
|
"kind": "ScalarField",
|
|
232
233
|
"name": "cssStretch",
|
|
233
234
|
"storageKey": null
|
|
234
235
|
},
|
|
235
|
-
|
|
236
|
+
v25 = {
|
|
236
237
|
"alias": null,
|
|
237
238
|
"args": null,
|
|
238
239
|
"concreteType": "VariableInstance",
|
|
@@ -263,7 +264,7 @@ const node = function () {
|
|
|
263
264
|
}],
|
|
264
265
|
"storageKey": null
|
|
265
266
|
},
|
|
266
|
-
|
|
267
|
+
v26 = {
|
|
267
268
|
"alias": null,
|
|
268
269
|
"args": null,
|
|
269
270
|
"concreteType": "Bundle",
|
|
@@ -283,25 +284,25 @@ const node = function () {
|
|
|
283
284
|
"kind": "LinkedField",
|
|
284
285
|
"name": "fontStyles",
|
|
285
286
|
"plural": true,
|
|
286
|
-
"selections": [v5 /*: any*/,
|
|
287
|
+
"selections": [v5 /*: any*/, v14 /*: any*/, v23 /*: any*/, v24 /*: any*/, v8 /*: any*/, v18 /*: any*/, v25 /*: any*/, v11 /*: any*/, v16 /*: any*/, v17 /*: any*/],
|
|
287
288
|
"storageKey": null
|
|
288
289
|
}, v8 /*: any*/, v11 /*: any*/],
|
|
289
290
|
"storageKey": null
|
|
290
291
|
},
|
|
291
|
-
|
|
292
|
+
v27 = {
|
|
292
293
|
"alias": null,
|
|
293
294
|
"args": null,
|
|
294
295
|
"concreteType": "FontStyle",
|
|
295
296
|
"kind": "LinkedField",
|
|
296
297
|
"name": "fontStyles",
|
|
297
298
|
"plural": true,
|
|
298
|
-
"selections": [v5 /*: any*/,
|
|
299
|
+
"selections": [v5 /*: any*/, v14 /*: any*/, v23 /*: any*/, v24 /*: any*/, {
|
|
299
300
|
"alias": null,
|
|
300
301
|
"args": null,
|
|
301
302
|
"kind": "ScalarField",
|
|
302
303
|
"name": "cssStyle",
|
|
303
304
|
"storageKey": null
|
|
304
|
-
}, v8 /*: any*/,
|
|
305
|
+
}, v8 /*: any*/, v18 /*: any*/, v25 /*: any*/, v11 /*: any*/, v16 /*: any*/, v17 /*: any*/],
|
|
305
306
|
"storageKey": null
|
|
306
307
|
};
|
|
307
308
|
return {
|
|
@@ -350,32 +351,32 @@ const node = function () {
|
|
|
350
351
|
"abstractKey": "__isNode"
|
|
351
352
|
}, v5 /*: any*/, {
|
|
352
353
|
"kind": "InlineFragment",
|
|
353
|
-
"selections": [v6 /*: any*/, v7 /*: any*/, v8 /*: any*/, v11 /*: any*/,
|
|
354
|
+
"selections": [v6 /*: any*/, v7 /*: any*/, v8 /*: any*/, v11 /*: any*/, v13 /*: any*/, v19 /*: any*/, v20 /*: any*/, v21 /*: any*/, {
|
|
354
355
|
"alias": null,
|
|
355
|
-
"args":
|
|
356
|
+
"args": v22 /*: any*/,
|
|
356
357
|
"concreteType": "FontCollection",
|
|
357
358
|
"kind": "LinkedField",
|
|
358
359
|
"name": "children",
|
|
359
360
|
"plural": true,
|
|
360
|
-
"selections": [v6 /*: any*/,
|
|
361
|
+
"selections": [v6 /*: any*/, v20 /*: any*/, v5 /*: any*/, v7 /*: any*/, v8 /*: any*/, v11 /*: any*/, v13 /*: any*/, v19 /*: any*/, v21 /*: any*/, {
|
|
361
362
|
"alias": null,
|
|
362
|
-
"args":
|
|
363
|
+
"args": v22 /*: any*/,
|
|
363
364
|
"concreteType": "FontCollection",
|
|
364
365
|
"kind": "LinkedField",
|
|
365
366
|
"name": "children",
|
|
366
367
|
"plural": true,
|
|
367
|
-
"selections": [v6 /*: any*/,
|
|
368
|
+
"selections": [v6 /*: any*/, v20 /*: any*/, v5 /*: any*/],
|
|
368
369
|
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
369
|
-
},
|
|
370
|
+
}, v26 /*: any*/, v27 /*: any*/],
|
|
370
371
|
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
371
|
-
},
|
|
372
|
+
}, v26 /*: any*/, v27 /*: any*/, {
|
|
372
373
|
"alias": null,
|
|
373
374
|
"args": null,
|
|
374
375
|
"concreteType": "License",
|
|
375
376
|
"kind": "LinkedField",
|
|
376
377
|
"name": "licenses",
|
|
377
378
|
"plural": true,
|
|
378
|
-
"selections": [v5 /*: any*/,
|
|
379
|
+
"selections": [v5 /*: any*/, v15 /*: any*/, v8 /*: any*/, {
|
|
379
380
|
"alias": null,
|
|
380
381
|
"args": [{
|
|
381
382
|
"kind": "Literal",
|
|
@@ -391,6 +392,15 @@ const node = function () {
|
|
|
391
392
|
"kind": "ScalarField",
|
|
392
393
|
"name": "defaultSelected",
|
|
393
394
|
"storageKey": null
|
|
395
|
+
}, {
|
|
396
|
+
"alias": null,
|
|
397
|
+
"args": null,
|
|
398
|
+
"concreteType": "License",
|
|
399
|
+
"kind": "LinkedField",
|
|
400
|
+
"name": "excludedLicenses",
|
|
401
|
+
"plural": true,
|
|
402
|
+
"selections": v12 /*: any*/,
|
|
403
|
+
"storageKey": null
|
|
394
404
|
}, {
|
|
395
405
|
"alias": "variables",
|
|
396
406
|
"args": null,
|
|
@@ -437,12 +447,12 @@ const node = function () {
|
|
|
437
447
|
}]
|
|
438
448
|
},
|
|
439
449
|
"params": {
|
|
440
|
-
"cacheID": "
|
|
450
|
+
"cacheID": "f7601eea0be580a0fdd4993eb176abe1",
|
|
441
451
|
"id": null,
|
|
442
452
|
"metadata": {},
|
|
443
453
|
"name": "StoreModalProductRefetchQuery",
|
|
444
454
|
"operationKind": "query",
|
|
445
|
-
"text": "query StoreModalProductRefetchQuery(\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...StoreModalProductContent_collection_4sncub\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\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 StoreModalBundleButton_bundle_4sncub on Bundle {\n id\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n fontStyles {\n id\n ...FontStyle_fontStyle\n }\n}\n\nfragment StoreModalFamilyButton_collection_4sncub on FontCollection {\n isVariableFont\n collectionType\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n parent {\n id\n }\n featureStyle {\n ...FontStyle_fontStyle\n supportedLanguages\n id\n }\n totalStyles\n totalStylesPrice {\n ...Price_price\n }\n ...useTotalStyles_fontCollection\n}\n\nfragment StoreModalFamily_collection_4sncub on FontCollection {\n ...StoreModalFamilyButton_collection_4sncub\n collectionType\n sku {\n id\n }\n isVariableFont\n bundles {\n id\n hidden\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n ...StoreModalBundleButton_bundle_4sncub\n }\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n cssStyle\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n}\n\nfragment StoreModalProductContent_collection_4sncub on Node {\n __isNode: __typename\n ... on FontCollection {\n id\n ...StoreModalFamily_collection_4sncub\n ...StoreModalProductLicenseSelection_collection\n children(collectionTypes: [FAMILY]) {\n id\n ...StoreModalFamily_collection_4sncub\n }\n }\n id\n}\n\nfragment StoreModalProductLicenseSelection_collection on FontCollection {\n licenses {\n id\n ...StoreModalProductLicense_license\n }\n}\n\nfragment StoreModalProductLicense_license on License {\n id\n url\n name\n description(format: HTML)\n defaultSelected\n variables: licenseVariables {\n id\n name\n variableType\n ...VariableTableAmounts_variable\n options: licenseOptions {\n id\n name\n amount\n ...VariableTableAmounts_option\n }\n }\n}\n\nfragment StoreModalStyleButton_fontStyle_4sncub on FontStyle {\n id\n name\n supportedLanguages\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n ...FontStyle_fontStyle\n}\n\nfragment VariableTableAmounts_option on LicenseOption {\n amounts\n}\n\nfragment VariableTableAmounts_variable on LicenseVariable {\n units\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n\nfragment useTotalStyles_fontCollection on FontCollection {\n isVariableFont\n totalStyles\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n}\n"
|
|
455
|
+
"text": "query StoreModalProductRefetchQuery(\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...StoreModalProductContent_collection_4sncub\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\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 StoreModalBundleButton_bundle_4sncub on Bundle {\n id\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n fontStyles {\n id\n ...FontStyle_fontStyle\n }\n}\n\nfragment StoreModalFamilyButton_collection_4sncub on FontCollection {\n isVariableFont\n collectionType\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n parent {\n id\n }\n featureStyle {\n ...FontStyle_fontStyle\n supportedLanguages\n id\n }\n totalStyles\n totalStylesPrice {\n ...Price_price\n }\n ...useTotalStyles_fontCollection\n}\n\nfragment StoreModalFamily_collection_4sncub on FontCollection {\n ...StoreModalFamilyButton_collection_4sncub\n collectionType\n sku {\n id\n }\n isVariableFont\n bundles {\n id\n hidden\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n ...StoreModalBundleButton_bundle_4sncub\n }\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n cssStyle\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n}\n\nfragment StoreModalProductContent_collection_4sncub on Node {\n __isNode: __typename\n ... on FontCollection {\n id\n ...StoreModalFamily_collection_4sncub\n ...StoreModalProductLicenseSelection_collection\n children(collectionTypes: [FAMILY]) {\n id\n ...StoreModalFamily_collection_4sncub\n }\n }\n id\n}\n\nfragment StoreModalProductLicenseSelection_collection on FontCollection {\n licenses {\n id\n ...StoreModalProductLicense_license\n }\n}\n\nfragment StoreModalProductLicense_license on License {\n id\n url\n name\n description(format: HTML)\n defaultSelected\n excludedLicenses {\n id\n }\n variables: licenseVariables {\n id\n name\n variableType\n ...VariableTableAmounts_variable\n options: licenseOptions {\n id\n name\n amount\n ...VariableTableAmounts_option\n }\n }\n}\n\nfragment StoreModalStyleButton_fontStyle_4sncub on FontStyle {\n id\n name\n supportedLanguages\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n ...FontStyle_fontStyle\n}\n\nfragment VariableTableAmounts_option on LicenseOption {\n amounts\n}\n\nfragment VariableTableAmounts_variable on LicenseVariable {\n units\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n\nfragment useTotalStyles_fontCollection on FontCollection {\n isVariableFont\n totalStyles\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n}\n"
|
|
446
456
|
}
|
|
447
457
|
};
|
|
448
458
|
}();
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* @generated SignedSource<<
|
|
8
|
+
* @generated SignedSource<<c4b112fa13523ab555027709d146aa87>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -488,7 +488,16 @@ const node = function () {
|
|
|
488
488
|
"kind": "LinkedField",
|
|
489
489
|
"name": "license",
|
|
490
490
|
"plural": false,
|
|
491
|
-
"selections": [v4 /*: any*/,
|
|
491
|
+
"selections": [v4 /*: any*/, {
|
|
492
|
+
"alias": null,
|
|
493
|
+
"args": null,
|
|
494
|
+
"concreteType": "License",
|
|
495
|
+
"kind": "LinkedField",
|
|
496
|
+
"name": "excludedLicenses",
|
|
497
|
+
"plural": true,
|
|
498
|
+
"selections": v8 /*: any*/,
|
|
499
|
+
"storageKey": null
|
|
500
|
+
}, v2 /*: any*/, {
|
|
492
501
|
"alias": null,
|
|
493
502
|
"args": null,
|
|
494
503
|
"concreteType": "LicenseVariable",
|
|
@@ -756,12 +765,12 @@ const node = function () {
|
|
|
756
765
|
}]
|
|
757
766
|
},
|
|
758
767
|
"params": {
|
|
759
|
-
"cacheID": "
|
|
768
|
+
"cacheID": "9f6700459e60f36b1d027422008e4a94",
|
|
760
769
|
"id": null,
|
|
761
770
|
"metadata": {},
|
|
762
771
|
"name": "TestFontsFormUpdateCustomerMutation",
|
|
763
772
|
"operationKind": "mutation",
|
|
764
|
-
"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 id\n }\n name\n variableInstances {\n name\n }\n }\n ... on Bundle {\n name\n fontCollection {\n name\n id\n }\n }\n ... on FontCollection {\n name\n isVariableFont\n totalStyles\n }\n ... on CollectionBundle {\n name\n totalStyles\n fontCollection {\n name\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 taxNotApplicable\n taxNotApplicableReason\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 ...useFontStyle_fontStyle\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\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n"
|
|
773
|
+
"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 excludedLicenses {\n id\n }\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 id\n }\n name\n variableInstances {\n name\n }\n }\n ... on Bundle {\n name\n fontCollection {\n name\n id\n }\n }\n ... on FontCollection {\n name\n isVariableFont\n totalStyles\n }\n ... on CollectionBundle {\n name\n totalStyles\n fontCollection {\n name\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 taxNotApplicable\n taxNotApplicableReason\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 ...useFontStyle_fontStyle\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\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n"
|
|
765
774
|
}
|
|
766
775
|
};
|
|
767
776
|
}();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<e9ace1097ef31e2ed34190d2a31634be>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
import { ReaderFragment } from 'relay-runtime';
|
|
7
|
+
import { FragmentRefs } from "relay-runtime";
|
|
8
|
+
export type TestModeBanner_viewer$data = {
|
|
9
|
+
readonly testMode: {
|
|
10
|
+
readonly isActive: boolean;
|
|
11
|
+
};
|
|
12
|
+
readonly " $fragmentType": "TestModeBanner_viewer";
|
|
13
|
+
};
|
|
14
|
+
export type TestModeBanner_viewer$key = {
|
|
15
|
+
readonly " $data"?: TestModeBanner_viewer$data;
|
|
16
|
+
readonly " $fragmentSpreads": FragmentRefs<"TestModeBanner_viewer">;
|
|
17
|
+
};
|
|
18
|
+
declare const node: ReaderFragment;
|
|
19
|
+
export default node;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<e9ace1097ef31e2ed34190d2a31634be>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* tslint:disable */
|
|
8
|
+
/* eslint-disable */
|
|
9
|
+
// @ts-nocheck
|
|
10
|
+
|
|
11
|
+
const node = {
|
|
12
|
+
"argumentDefinitions": [],
|
|
13
|
+
"kind": "Fragment",
|
|
14
|
+
"metadata": null,
|
|
15
|
+
"name": "TestModeBanner_viewer",
|
|
16
|
+
"selections": [{
|
|
17
|
+
"alias": null,
|
|
18
|
+
"args": null,
|
|
19
|
+
"concreteType": "TestMode",
|
|
20
|
+
"kind": "LinkedField",
|
|
21
|
+
"name": "testMode",
|
|
22
|
+
"plural": false,
|
|
23
|
+
"selections": [{
|
|
24
|
+
"alias": null,
|
|
25
|
+
"args": null,
|
|
26
|
+
"kind": "ScalarField",
|
|
27
|
+
"name": "isActive",
|
|
28
|
+
"storageKey": null
|
|
29
|
+
}],
|
|
30
|
+
"storageKey": null
|
|
31
|
+
}],
|
|
32
|
+
"type": "Viewer",
|
|
33
|
+
"abstractKey": null
|
|
34
|
+
};
|
|
35
|
+
node.hash = "f6b2f851466be9599d63ebf8f39e1a96";
|
|
36
|
+
export default node;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<9eff3b1fe04abdb52e7380c1158bdb71>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
import { ReaderFragment } from 'relay-runtime';
|
|
7
|
+
import { FragmentRefs } from "relay-runtime";
|
|
8
|
+
export type ThemeConfig_viewer$data = {
|
|
9
|
+
readonly themeConfig: {
|
|
10
|
+
readonly customProperties: ReadonlyArray<string> | null;
|
|
11
|
+
} | null;
|
|
12
|
+
readonly " $fragmentType": "ThemeConfig_viewer";
|
|
13
|
+
};
|
|
14
|
+
export type ThemeConfig_viewer$key = {
|
|
15
|
+
readonly " $data"?: ThemeConfig_viewer$data;
|
|
16
|
+
readonly " $fragmentSpreads": FragmentRefs<"ThemeConfig_viewer">;
|
|
17
|
+
};
|
|
18
|
+
declare const node: ReaderFragment;
|
|
19
|
+
export default node;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<9eff3b1fe04abdb52e7380c1158bdb71>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* tslint:disable */
|
|
8
|
+
/* eslint-disable */
|
|
9
|
+
// @ts-nocheck
|
|
10
|
+
|
|
11
|
+
const node = {
|
|
12
|
+
"argumentDefinitions": [],
|
|
13
|
+
"kind": "Fragment",
|
|
14
|
+
"metadata": null,
|
|
15
|
+
"name": "ThemeConfig_viewer",
|
|
16
|
+
"selections": [{
|
|
17
|
+
"alias": null,
|
|
18
|
+
"args": null,
|
|
19
|
+
"concreteType": "ThemeConfig",
|
|
20
|
+
"kind": "LinkedField",
|
|
21
|
+
"name": "themeConfig",
|
|
22
|
+
"plural": false,
|
|
23
|
+
"selections": [{
|
|
24
|
+
"alias": null,
|
|
25
|
+
"args": null,
|
|
26
|
+
"kind": "ScalarField",
|
|
27
|
+
"name": "customProperties",
|
|
28
|
+
"storageKey": null
|
|
29
|
+
}],
|
|
30
|
+
"storageKey": null
|
|
31
|
+
}],
|
|
32
|
+
"type": "Viewer",
|
|
33
|
+
"abstractKey": null
|
|
34
|
+
};
|
|
35
|
+
node.hash = "191db4fda0651cd596efa7f91699f895";
|
|
36
|
+
export default node;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _reducer = _interopRequireDefault(require("../reducer"));
|
|
5
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
_vitest.vi.mock('react-relay', () => ({
|
|
7
|
+
graphql: () => null,
|
|
8
|
+
fetchQuery: _vitest.vi.fn()
|
|
9
|
+
}));
|
|
10
|
+
function makeState() {
|
|
11
|
+
let overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
12
|
+
return {
|
|
13
|
+
cartOpen: false,
|
|
14
|
+
precartOpen: false,
|
|
15
|
+
selectedSkuIds: {},
|
|
16
|
+
licenseOptions: [],
|
|
17
|
+
collectionStyleSkus: {},
|
|
18
|
+
collectionSkus: {},
|
|
19
|
+
skuPrices: {},
|
|
20
|
+
fetchedCollectionIds: [],
|
|
21
|
+
storeModalRoute: {
|
|
22
|
+
name: 'index'
|
|
23
|
+
},
|
|
24
|
+
storeModalHistory: [],
|
|
25
|
+
orderVariableSelections: [],
|
|
26
|
+
licenseeIsBillingIdentity: null,
|
|
27
|
+
...overrides
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
(0, _vitest.describe)('PRECART_SELECT_LICENSE auto-deselect', () => {
|
|
31
|
+
(0, _vitest.it)('drops a currently-selected license when its excluder is selected', () => {
|
|
32
|
+
const state = makeState({
|
|
33
|
+
licenseOptions: [{
|
|
34
|
+
licenseId: 'A',
|
|
35
|
+
licenseOptions: {}
|
|
36
|
+
}]
|
|
37
|
+
});
|
|
38
|
+
const newState = (0, _reducer.default)(state, {
|
|
39
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
40
|
+
licenseOptionSpec: {
|
|
41
|
+
licenseId: 'B',
|
|
42
|
+
licenseOptions: {}
|
|
43
|
+
},
|
|
44
|
+
excludedLicenseIds: ['A']
|
|
45
|
+
});
|
|
46
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId)).toEqual(['B']);
|
|
47
|
+
});
|
|
48
|
+
(0, _vitest.it)('leaves non-conflicting selections in place', () => {
|
|
49
|
+
const state = makeState({
|
|
50
|
+
licenseOptions: [{
|
|
51
|
+
licenseId: 'A',
|
|
52
|
+
licenseOptions: {}
|
|
53
|
+
}, {
|
|
54
|
+
licenseId: 'C',
|
|
55
|
+
licenseOptions: {}
|
|
56
|
+
}]
|
|
57
|
+
});
|
|
58
|
+
const newState = (0, _reducer.default)(state, {
|
|
59
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
60
|
+
licenseOptionSpec: {
|
|
61
|
+
licenseId: 'B',
|
|
62
|
+
licenseOptions: {}
|
|
63
|
+
},
|
|
64
|
+
excludedLicenseIds: ['A']
|
|
65
|
+
});
|
|
66
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId).sort()).toEqual(['B', 'C']);
|
|
67
|
+
});
|
|
68
|
+
(0, _vitest.it)('is a no-op when the license is already selected', () => {
|
|
69
|
+
const state = makeState({
|
|
70
|
+
licenseOptions: [{
|
|
71
|
+
licenseId: 'B',
|
|
72
|
+
licenseOptions: {}
|
|
73
|
+
}]
|
|
74
|
+
});
|
|
75
|
+
const newState = (0, _reducer.default)(state, {
|
|
76
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
77
|
+
licenseOptionSpec: {
|
|
78
|
+
licenseId: 'B',
|
|
79
|
+
licenseOptions: {}
|
|
80
|
+
},
|
|
81
|
+
excludedLicenseIds: ['A']
|
|
82
|
+
});
|
|
83
|
+
(0, _vitest.expect)(newState).toBe(state);
|
|
84
|
+
});
|
|
85
|
+
(0, _vitest.it)('handles empty excludedLicenseIds', () => {
|
|
86
|
+
const state = makeState({
|
|
87
|
+
licenseOptions: [{
|
|
88
|
+
licenseId: 'A',
|
|
89
|
+
licenseOptions: {}
|
|
90
|
+
}]
|
|
91
|
+
});
|
|
92
|
+
const newState = (0, _reducer.default)(state, {
|
|
93
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
94
|
+
licenseOptionSpec: {
|
|
95
|
+
licenseId: 'B',
|
|
96
|
+
licenseOptions: {}
|
|
97
|
+
},
|
|
98
|
+
excludedLicenseIds: []
|
|
99
|
+
});
|
|
100
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId).sort()).toEqual(['A', 'B']);
|
|
101
|
+
});
|
|
102
|
+
(0, _vitest.it)('handles missing excludedLicenseIds (backwards compatibility)', () => {
|
|
103
|
+
const state = makeState({
|
|
104
|
+
licenseOptions: [{
|
|
105
|
+
licenseId: 'A',
|
|
106
|
+
licenseOptions: {}
|
|
107
|
+
}]
|
|
108
|
+
});
|
|
109
|
+
const newState = (0, _reducer.default)(state, {
|
|
110
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
111
|
+
licenseOptionSpec: {
|
|
112
|
+
licenseId: 'B',
|
|
113
|
+
licenseOptions: {}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId).sort()).toEqual(['A', 'B']);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
(0, _vitest.describe)('PRECART_TOGGLE_LICENSE auto-deselect', () => {
|
|
120
|
+
(0, _vitest.it)('toggling on a conflicting license drops the conflict', () => {
|
|
121
|
+
const state = makeState({
|
|
122
|
+
licenseOptions: [{
|
|
123
|
+
licenseId: 'A',
|
|
124
|
+
licenseOptions: {}
|
|
125
|
+
}]
|
|
126
|
+
});
|
|
127
|
+
const newState = (0, _reducer.default)(state, {
|
|
128
|
+
type: 'PRECART_TOGGLE_LICENSE',
|
|
129
|
+
licenseId: 'B',
|
|
130
|
+
checked: true,
|
|
131
|
+
licenseOptionSpec: {
|
|
132
|
+
licenseId: 'B',
|
|
133
|
+
licenseOptions: {}
|
|
134
|
+
},
|
|
135
|
+
excludedLicenseIds: ['A']
|
|
136
|
+
});
|
|
137
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId)).toEqual(['B']);
|
|
138
|
+
});
|
|
139
|
+
(0, _vitest.it)('toggling off does not run auto-deselect', () => {
|
|
140
|
+
const state = makeState({
|
|
141
|
+
licenseOptions: [{
|
|
142
|
+
licenseId: 'A',
|
|
143
|
+
licenseOptions: {}
|
|
144
|
+
}, {
|
|
145
|
+
licenseId: 'B',
|
|
146
|
+
licenseOptions: {}
|
|
147
|
+
}]
|
|
148
|
+
});
|
|
149
|
+
const newState = (0, _reducer.default)(state, {
|
|
150
|
+
type: 'PRECART_TOGGLE_LICENSE',
|
|
151
|
+
licenseId: 'B',
|
|
152
|
+
checked: false,
|
|
153
|
+
licenseOptionSpec: {
|
|
154
|
+
licenseId: 'B',
|
|
155
|
+
licenseOptions: {}
|
|
156
|
+
},
|
|
157
|
+
excludedLicenseIds: ['A']
|
|
158
|
+
});
|
|
159
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId)).toEqual(['A']);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BuyingOptionsProps {
|
|
3
|
+
onPrecartOpen: () => void;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import("react-redux").ConnectedComponent<({ onPrecartOpen }: BuyingOptionsProps) => React.JSX.Element, {
|
|
6
|
+
context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
|
|
7
|
+
store?: import("redux").Store | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export default _default;
|
|
@@ -10,22 +10,28 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _reactRelay = require("react-relay");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
function CartItemAdditionalLicenses(_ref) {
|
|
13
|
-
var _orderItem$licenseSel;
|
|
13
|
+
var _orderItem$licenseSel, _orderItem$licenseSel2;
|
|
14
14
|
let {
|
|
15
15
|
licenses: licensesKey,
|
|
16
16
|
orderItem: orderItemKey,
|
|
17
17
|
onAddLicense
|
|
18
18
|
} = _ref;
|
|
19
19
|
const licenses = (0, _reactRelay.useFragment)((_CartItemAdditionalLicenses_licenses2.default.hash && _CartItemAdditionalLicenses_licenses2.default.hash !== "a00d0c8ac3643f7c12911fad6f62ec4e" && console.error("The definition of 'CartItemAdditionalLicenses_licenses' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItemAdditionalLicenses_licenses2.default), licensesKey);
|
|
20
|
-
const orderItem = (0, _reactRelay.useFragment)((_CartItemAdditionalLicenses_orderItem2.default.hash && _CartItemAdditionalLicenses_orderItem2.default.hash !== "
|
|
20
|
+
const orderItem = (0, _reactRelay.useFragment)((_CartItemAdditionalLicenses_orderItem2.default.hash && _CartItemAdditionalLicenses_orderItem2.default.hash !== "52f514c1954a1d93863d7dd4c4871e3a" && console.error("The definition of 'CartItemAdditionalLicenses_orderItem' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItemAdditionalLicenses_orderItem2.default), orderItemKey);
|
|
21
21
|
if (!licenses) return null;
|
|
22
|
-
const
|
|
22
|
+
const selectedLicenseIds = new Set(((_orderItem$licenseSel = orderItem.licenseSelections) === null || _orderItem$licenseSel === void 0 ? void 0 : _orderItem$licenseSel.map(_ref2 => {
|
|
23
23
|
let {
|
|
24
24
|
license
|
|
25
25
|
} = _ref2;
|
|
26
26
|
return license.id;
|
|
27
|
-
});
|
|
28
|
-
const
|
|
27
|
+
})) ?? []);
|
|
28
|
+
const excludedLicenseIds = new Set(((_orderItem$licenseSel2 = orderItem.licenseSelections) === null || _orderItem$licenseSel2 === void 0 ? void 0 : _orderItem$licenseSel2.flatMap(_ref3 => {
|
|
29
|
+
let {
|
|
30
|
+
license
|
|
31
|
+
} = _ref3;
|
|
32
|
+
return license.excludedLicenses.map(l => l.id);
|
|
33
|
+
})) ?? []);
|
|
34
|
+
const additionalLicenses = licenses.filter(license => !selectedLicenseIds.has(license.id) && !excludedLicenseIds.has(license.id));
|
|
29
35
|
if (additionalLicenses.length < 1) return null;
|
|
30
36
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
31
37
|
className: "cart-item__additional-licenses"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CookieNotificationProps {
|
|
3
|
+
siteTitle?: string;
|
|
4
|
+
}
|
|
5
|
+
interface CookieNotificationState {
|
|
6
|
+
dismissed: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default class CookieNotification extends React.Component<CookieNotificationProps, CookieNotificationState> {
|
|
9
|
+
constructor(props: CookieNotificationProps);
|
|
10
|
+
dismiss: () => void;
|
|
11
|
+
render(): React.JSX.Element | null;
|
|
12
|
+
}
|
|
13
|
+
export {};
|