fontdue-js 1.11.0 → 1.12.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.
Files changed (46) hide show
  1. package/dist/__generated__/StoreModalIndexQuery.graphql.d.ts +3 -1
  2. package/dist/__generated__/StoreModalIndexQuery.graphql.js +33 -22
  3. package/dist/components/BuyButton/index.js +3 -3
  4. package/dist/components/Cart/AddressFields.js +9 -9
  5. package/dist/components/Cart/CartItem/index.js +15 -16
  6. package/dist/components/Cart/CartOrder.js +5 -5
  7. package/dist/components/Cart/Checkout.js +9 -11
  8. package/dist/components/Cart/CustomerFields.js +1 -2
  9. package/dist/components/Cart/utils.js +3 -3
  10. package/dist/components/CartButton/index.js +2 -2
  11. package/dist/components/CharacterViewer/index.js +24 -24
  12. package/dist/components/ConfigContext.d.ts +2 -0
  13. package/dist/components/ConfigContext.js +31 -30
  14. package/dist/components/FontdueProvider/index.js +25 -4
  15. package/dist/components/NewsletterSignup/index.js +5 -5
  16. package/dist/components/Price/index.js +1 -2
  17. package/dist/components/Root/index.js +1 -2
  18. package/dist/components/Root/productState.js +13 -13
  19. package/dist/components/Select/index.js +1 -1
  20. package/dist/components/StoreModal/StoreModalCart.js +2 -2
  21. package/dist/components/StoreModal/StoreModalContainer.js +8 -3
  22. package/dist/components/StoreModal/StoreModalIndex.js +3 -3
  23. package/dist/components/StoreModal/StoreModalProduct.js +2 -2
  24. package/dist/components/StoreModal/StoreModalReview.js +8 -9
  25. package/dist/components/StoreModal/types.d.ts +1 -0
  26. package/dist/components/StripeProvider/index.js +2 -2
  27. package/dist/components/TestFontsForm/index.js +5 -5
  28. package/dist/components/ThemeConfig/index.js +2 -2
  29. package/dist/components/TypeTester/TypeTesterContext.js +3 -4
  30. package/dist/components/TypeTester/TypeTesterFeaturesButton.js +1 -1
  31. package/dist/components/TypeTester/TypeTesterInput.js +1 -2
  32. package/dist/components/TypeTester/TypeTesterStandalone.js +7 -7
  33. package/dist/components/TypeTester/TypeTesterStandaloneElement.js +1 -2
  34. package/dist/components/TypeTester/TypeTesterState.js +1 -1
  35. package/dist/components/TypeTester/TypeTesterToolbar.js +1 -1
  36. package/dist/components/TypeTester/index.js +4 -5
  37. package/dist/components/TypeTester/useFeaturesData.js +3 -3
  38. package/dist/components/TypeTester/useTypeTesterStyler.js +4 -4
  39. package/dist/components/TypeTesters/index.js +14 -14
  40. package/dist/components/elements/EmptyCart/index.js +9 -2
  41. package/dist/components/elements/StoreModalContainer/index.js +1 -1
  42. package/dist/components/useTotalStyles.js +1 -2
  43. package/dist/reducer.d.ts +3 -1
  44. package/dist/reducer.js +4 -21
  45. package/fontdue.css.map +1 -1
  46. package/package.json +1 -1
@@ -78,38 +78,38 @@ const StyleSelect = _ref => {
78
78
  }
79
79
  return /*#__PURE__*/_react.default.createElement(_Select.default, {
80
80
  options: collections.flatMap(coll => {
81
- var _coll$fontStyles$map$, _coll$fontStyles2;
81
+ var _coll$fontStyles2;
82
82
  if (coll.isVariableFont) {
83
- var _coll$fontStyles$flat, _coll$fontStyles;
84
- return (_coll$fontStyles$flat = (_coll$fontStyles = coll.fontStyles) === null || _coll$fontStyles === void 0 ? void 0 : _coll$fontStyles.flatMap(style => {
83
+ var _coll$fontStyles;
84
+ return ((_coll$fontStyles = coll.fontStyles) === null || _coll$fontStyles === void 0 ? void 0 : _coll$fontStyles.flatMap(style => {
85
85
  var _style$variableInstan;
86
86
  return (_style$variableInstan = style.variableInstances) === null || _style$variableInstan === void 0 ? void 0 : _style$variableInstan.map(instance => ({
87
87
  value: `${style.id}:::${instance.name}`,
88
88
  text: `${coll.name} ${instance.name}`
89
89
  })).filter(_utils.notEmpty);
90
- }).filter(_utils.notEmpty)) !== null && _coll$fontStyles$flat !== void 0 ? _coll$fontStyles$flat : [];
90
+ }).filter(_utils.notEmpty)) ?? [];
91
91
  }
92
- return (_coll$fontStyles$map$ = (_coll$fontStyles2 = coll.fontStyles) === null || _coll$fontStyles2 === void 0 ? void 0 : _coll$fontStyles2.map(style => ({
92
+ return ((_coll$fontStyles2 = coll.fontStyles) === null || _coll$fontStyles2 === void 0 ? void 0 : _coll$fontStyles2.map(style => ({
93
93
  value: style.id,
94
94
  text: `${coll.name} ${style.name}`
95
- })).filter(_utils.notEmpty)) !== null && _coll$fontStyles$map$ !== void 0 ? _coll$fontStyles$map$ : [];
95
+ })).filter(_utils.notEmpty)) ?? [];
96
96
  }),
97
97
  value: selectValue,
98
98
  onChange: handleChange
99
99
  });
100
100
  };
101
101
  const CharacterViewerComponent = _ref3 => {
102
- var _collection$children$, _collection$children, _ref4, _collection$featureSt, _collection$fontStyle, _collection$children2, _collection$children3, _collection$children4, _initialFontStyle$id, _fontStyle$characterB, _fontStyle$characterB2, _fontStyle$featureCha, _fontStyle$featureCha2, _fontStyle$featureCha3, _fontStyle$featureCha4, _fontStyle$featureCha5, _fontStyle$characterB3, _fontStyle$featureCha6, _fontStyle$featureCha7;
102
+ var _collection$children, _collection$fontStyle, _collection$children2, _collection$children3, _collection$children4, _fontStyle$characterB, _fontStyle$characterB2, _fontStyle$featureCha, _fontStyle$featureCha2, _fontStyle$featureCha3, _fontStyle$featureCha4, _fontStyle$characterB3, _fontStyle$featureCha5, _fontStyle$featureCha6;
103
103
  let {
104
104
  collection
105
105
  } = _ref3;
106
- const allCollections = [collectionInfo(collection)].concat((_collection$children$ = (_collection$children = collection.children) === null || _collection$children === void 0 ? void 0 : _collection$children.map(collectionInfo)) !== null && _collection$children$ !== void 0 ? _collection$children$ : []);
107
- const initialFontStyle = (_ref4 = (_collection$featureSt = collection.featureStyle) !== null && _collection$featureSt !== void 0 ? _collection$featureSt : (_collection$fontStyle = collection.fontStyles) === null || _collection$fontStyle === void 0 ? void 0 : _collection$fontStyle[0]) !== null && _ref4 !== void 0 ? _ref4 : (_collection$children2 = collection.children) === null || _collection$children2 === void 0 ? void 0 : (_collection$children3 = _collection$children2[0]) === null || _collection$children3 === void 0 ? void 0 : (_collection$children4 = _collection$children3.fontStyles) === null || _collection$children4 === void 0 ? void 0 : _collection$children4[0];
106
+ const allCollections = [collectionInfo(collection)].concat(((_collection$children = collection.children) === null || _collection$children === void 0 ? void 0 : _collection$children.map(collectionInfo)) ?? []);
107
+ const initialFontStyle = collection.featureStyle ?? ((_collection$fontStyle = collection.fontStyles) === null || _collection$fontStyle === void 0 ? void 0 : _collection$fontStyle[0]) ?? ((_collection$children2 = collection.children) === null || _collection$children2 === void 0 ? void 0 : (_collection$children3 = _collection$children2[0]) === null || _collection$children3 === void 0 ? void 0 : (_collection$children4 = _collection$children3.fontStyles) === null || _collection$children4 === void 0 ? void 0 : _collection$children4[0]);
108
108
  let initialVariableSettings;
109
109
  if (initialFontStyle && initialFontStyle.variableInstances) {
110
110
  initialVariableSettings = (0, _utils.variableInstanceSettings)(initialFontStyle.variableInstances[0]);
111
111
  }
112
- const [fontStyleId, setFontStyleId] = (0, _react.useState)((_initialFontStyle$id = initialFontStyle === null || initialFontStyle === void 0 ? void 0 : initialFontStyle.id) !== null && _initialFontStyle$id !== void 0 ? _initialFontStyle$id : null);
112
+ const [fontStyleId, setFontStyleId] = (0, _react.useState)((initialFontStyle === null || initialFontStyle === void 0 ? void 0 : initialFontStyle.id) ?? null);
113
113
  const [variableSettings, setVariableSettings] = (0, _react.useState)(initialVariableSettings);
114
114
  const handleStyleSelect = value => {
115
115
  setFontStyleId(value.fontStyleId);
@@ -131,10 +131,10 @@ const CharacterViewerComponent = _ref3 => {
131
131
  }
132
132
  const [selectedCharacter, setSelectedCharacter] = (0, _react.useState)();
133
133
  const [activeCharacter, setActiveCharacter] = (0, _react.useState)(fontStyle === null || fontStyle === void 0 ? void 0 : (_fontStyle$characterB = fontStyle.characterBlocks) === null || _fontStyle$characterB === void 0 ? void 0 : (_fontStyle$characterB2 = _fontStyle$characterB[0]) === null || _fontStyle$characterB2 === void 0 ? void 0 : _fontStyle$characterB2.characters[0]);
134
- const visibleCharacter = activeCharacter !== null && activeCharacter !== void 0 ? activeCharacter : selectedCharacter;
134
+ const visibleCharacter = activeCharacter ?? selectedCharacter;
135
135
  const [selectedFeatureCharacter, setSelectedFeatureCharacter] = (0, _react.useState)();
136
- const [activeFeatureCharacter, setActiveFeatureCharacter] = (0, _react.useState)([(_fontStyle$featureCha = fontStyle === null || fontStyle === void 0 ? void 0 : (_fontStyle$featureCha2 = fontStyle.featureCharacters) === null || _fontStyle$featureCha2 === void 0 ? void 0 : (_fontStyle$featureCha3 = _fontStyle$featureCha2[0]) === null || _fontStyle$featureCha3 === void 0 ? void 0 : _fontStyle$featureCha3.characters[0]) !== null && _fontStyle$featureCha !== void 0 ? _fontStyle$featureCha : '', fontStyle === null || fontStyle === void 0 ? void 0 : (_fontStyle$featureCha4 = fontStyle.featureCharacters) === null || _fontStyle$featureCha4 === void 0 ? void 0 : (_fontStyle$featureCha5 = _fontStyle$featureCha4[0]) === null || _fontStyle$featureCha5 === void 0 ? void 0 : _fontStyle$featureCha5.feature]);
137
- const visibleFeatureCharacter = activeFeatureCharacter !== null && activeFeatureCharacter !== void 0 ? activeFeatureCharacter : selectedFeatureCharacter;
136
+ const [activeFeatureCharacter, setActiveFeatureCharacter] = (0, _react.useState)([(fontStyle === null || fontStyle === void 0 ? void 0 : (_fontStyle$featureCha = fontStyle.featureCharacters) === null || _fontStyle$featureCha === void 0 ? void 0 : (_fontStyle$featureCha2 = _fontStyle$featureCha[0]) === null || _fontStyle$featureCha2 === void 0 ? void 0 : _fontStyle$featureCha2.characters[0]) ?? '', fontStyle === null || fontStyle === void 0 ? void 0 : (_fontStyle$featureCha3 = fontStyle.featureCharacters) === null || _fontStyle$featureCha3 === void 0 ? void 0 : (_fontStyle$featureCha4 = _fontStyle$featureCha3[0]) === null || _fontStyle$featureCha4 === void 0 ? void 0 : _fontStyle$featureCha4.feature]);
137
+ const visibleFeatureCharacter = activeFeatureCharacter ?? selectedFeatureCharacter;
138
138
  const handleMouseLeave = () => {
139
139
  if (selectedCharacter) setActiveCharacter(undefined);
140
140
  };
@@ -189,11 +189,11 @@ const CharacterViewerComponent = _ref3 => {
189
189
  style: {
190
190
  '--width': blocksWidth
191
191
  }
192
- }, (_fontStyle$characterB3 = fontStyle.characterBlocks) === null || _fontStyle$characterB3 === void 0 ? void 0 : _fontStyle$characterB3.map((_ref5, i) => {
192
+ }, (_fontStyle$characterB3 = fontStyle.characterBlocks) === null || _fontStyle$characterB3 === void 0 ? void 0 : _fontStyle$characterB3.map((_ref4, i) => {
193
193
  let {
194
194
  name,
195
195
  characters
196
- } = _ref5;
196
+ } = _ref4;
197
197
  return /*#__PURE__*/_react.default.createElement("div", {
198
198
  className: "character-viewer__block",
199
199
  key: i
@@ -209,7 +209,7 @@ const CharacterViewerComponent = _ref3 => {
209
209
  onMouseEnter: () => setActiveCharacter(chars),
210
210
  "data-selected": selectedCharacter === chars
211
211
  }, chars))));
212
- }))), (_fontStyle$featureCha6 = fontStyle.featureCharacters) !== null && _fontStyle$featureCha6 !== void 0 && _fontStyle$featureCha6.length ? /*#__PURE__*/_react.default.createElement("div", {
212
+ }))), (_fontStyle$featureCha5 = fontStyle.featureCharacters) !== null && _fontStyle$featureCha5 !== void 0 && _fontStyle$featureCha5.length ? /*#__PURE__*/_react.default.createElement("div", {
213
213
  className: "character-viewer__features-map"
214
214
  }, /*#__PURE__*/_react.default.createElement("div", {
215
215
  className: "character-viewer__feature-monitor"
@@ -255,12 +255,12 @@ const CharacterViewerComponent = _ref3 => {
255
255
  style: {
256
256
  '--width': blocksWidth
257
257
  }
258
- }, (_fontStyle$featureCha7 = fontStyle.featureCharacters) === null || _fontStyle$featureCha7 === void 0 ? void 0 : _fontStyle$featureCha7.map((_ref6, i) => {
258
+ }, (_fontStyle$featureCha6 = fontStyle.featureCharacters) === null || _fontStyle$featureCha6 === void 0 ? void 0 : _fontStyle$featureCha6.map((_ref5, i) => {
259
259
  let {
260
260
  name,
261
261
  feature,
262
262
  characters
263
- } = _ref6;
263
+ } = _ref5;
264
264
  return /*#__PURE__*/_react.default.createElement("div", {
265
265
  className: "character-viewer__block",
266
266
  key: i
@@ -285,11 +285,11 @@ _CharacterViewer_family !== void 0 ? _CharacterViewer_family : (_CharacterViewer
285
285
  const CharacterViewer = (0, _reactRelay.createFragmentContainer)(CharacterViewerComponent, {
286
286
  collection: _CharacterViewer_collection !== void 0 ? _CharacterViewer_collection : (_CharacterViewer_collection = require("../../__generated__/CharacterViewer_collection.graphql"), _CharacterViewer_collection.hash && _CharacterViewer_collection.hash !== "2f49d241268129a888942889cad0bebb" && console.error("The definition of 'CharacterViewer_collection' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewer_collection)
287
287
  });
288
- const CharacterViewerQueryRenderer = _ref7 => {
288
+ const CharacterViewerQueryRenderer = _ref6 => {
289
289
  let {
290
290
  collectionId,
291
291
  collectionSlug
292
- } = _ref7;
292
+ } = _ref6;
293
293
  const environment = (0, _reactRelay.useRelayEnvironment)();
294
294
  if (collectionId) {
295
295
  return /*#__PURE__*/_react.default.createElement(_reactRelay.QueryRenderer, {
@@ -298,10 +298,10 @@ const CharacterViewerQueryRenderer = _ref7 => {
298
298
  collectionId
299
299
  },
300
300
  environment: environment,
301
- render: _ref8 => {
301
+ render: _ref7 => {
302
302
  let {
303
303
  props
304
- } = _ref8;
304
+ } = _ref7;
305
305
  const node = props === null || props === void 0 ? void 0 : props.node;
306
306
  if (!node) return null;
307
307
  return /*#__PURE__*/_react.default.createElement(CharacterViewer, {
@@ -317,11 +317,11 @@ const CharacterViewerQueryRenderer = _ref7 => {
317
317
  collectionSlug
318
318
  },
319
319
  environment: environment,
320
- render: _ref9 => {
320
+ render: _ref8 => {
321
321
  var _props$viewer, _props$viewer$slug;
322
322
  let {
323
323
  props
324
- } = _ref9;
324
+ } = _ref8;
325
325
  const collection = props === null || props === void 0 ? void 0 : (_props$viewer = props.viewer) === null || _props$viewer === void 0 ? void 0 : (_props$viewer$slug = _props$viewer.slug) === null || _props$viewer$slug === void 0 ? void 0 : _props$viewer$slug.fontCollection;
326
326
  if (!collection) return null;
327
327
  return /*#__PURE__*/_react.default.createElement(CharacterViewer, {
@@ -54,6 +54,7 @@ export declare const makeConfig: (config?: Config | undefined) => {
54
54
  };
55
55
  storeModal: {
56
56
  indexLayout: "styled-aa" | "styled-font-names";
57
+ indexExcludeTags: string[] | undefined;
57
58
  productLicensesPosition: "bottom" | "top";
58
59
  };
59
60
  };
@@ -102,6 +103,7 @@ declare const _default: React.Context<{
102
103
  };
103
104
  storeModal: {
104
105
  indexLayout: "styled-aa" | "styled-font-names";
106
+ indexExcludeTags: string[] | undefined;
105
107
  productLicensesPosition: "bottom" | "top";
106
108
  };
107
109
  }>;
@@ -7,55 +7,56 @@ exports.makeConfig = exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
9
  const makeTypeTesterConfig = config => {
10
- var _config$shy, _config$toolsPosition, _config$autofitOnChan, _config$truncate, _config$priceText, _config$selectButtonS, _config$selectButtonL, _ref, _config$selectButton, _config$selectable, _config$priceBar, _config$textInput, _config$initialMode, _config$groupEdit, _config$bulletStyle, _config$openTypeFeatu, _config$openTypeFeatu2, _config$openTypeFeatu3, _config$openTypeFeatu4, _config$openTypeFeatu5, _config$alignmentButt, _config$initialAlignm, _config$size$label, _config$size, _ref2, _config$size$min, _config$size2, _ref3, _config$size$max, _config$size3, _config$lineHeight$la, _config$lineHeight, _config$lineHeight$mi, _config$lineHeight2, _config$lineHeight$ma, _config$lineHeight3;
11
- let shy = (_config$shy = config === null || config === void 0 ? void 0 : config.shy) !== null && _config$shy !== void 0 ? _config$shy : false;
10
+ var _config$openTypeFeatu, _config$openTypeFeatu2, _config$openTypeFeatu3, _config$size, _config$size2, _config$size3, _config$lineHeight, _config$lineHeight2, _config$lineHeight3;
11
+ let shy = (config === null || config === void 0 ? void 0 : config.shy) ?? false;
12
12
  if (shy === true) shy = 'hover';
13
- let toolsPosition = (_config$toolsPosition = config === null || config === void 0 ? void 0 : config.toolsPosition) !== null && _config$toolsPosition !== void 0 ? _config$toolsPosition : 'inline';
13
+ let toolsPosition = (config === null || config === void 0 ? void 0 : config.toolsPosition) ?? 'inline';
14
14
  if (shy !== 'focus') toolsPosition = 'inline';
15
15
  return {
16
- autofitOnChange: (_config$autofitOnChan = config === null || config === void 0 ? void 0 : config.autofitOnChange) !== null && _config$autofitOnChan !== void 0 ? _config$autofitOnChan : false,
17
- truncate: (_config$truncate = config === null || config === void 0 ? void 0 : config.truncate) !== null && _config$truncate !== void 0 ? _config$truncate : false,
18
- priceText: (_config$priceText = config === null || config === void 0 ? void 0 : config.priceText) !== null && _config$priceText !== void 0 ? _config$priceText : false,
19
- selectButtonStyle: (_config$selectButtonS = config === null || config === void 0 ? void 0 : config.selectButtonStyle) !== null && _config$selectButtonS !== void 0 ? _config$selectButtonS : 'inline',
20
- selectButtonLabel: (_config$selectButtonL = config === null || config === void 0 ? void 0 : config.selectButtonLabel) !== null && _config$selectButtonL !== void 0 ? _config$selectButtonL : 'Select',
21
- selectButton: (_ref = (_config$selectButton = config === null || config === void 0 ? void 0 : config.selectButton) !== null && _config$selectButton !== void 0 ? _config$selectButton : config === null || config === void 0 ? void 0 : config.buyButton) !== null && _ref !== void 0 ? _ref : true,
16
+ autofitOnChange: (config === null || config === void 0 ? void 0 : config.autofitOnChange) ?? false,
17
+ truncate: (config === null || config === void 0 ? void 0 : config.truncate) ?? false,
18
+ priceText: (config === null || config === void 0 ? void 0 : config.priceText) ?? false,
19
+ selectButtonStyle: (config === null || config === void 0 ? void 0 : config.selectButtonStyle) ?? 'inline',
20
+ selectButtonLabel: (config === null || config === void 0 ? void 0 : config.selectButtonLabel) ?? 'Select',
21
+ selectButton: (config === null || config === void 0 ? void 0 : config.selectButton) ?? (config === null || config === void 0 ? void 0 : config.buyButton) ?? true,
22
22
  shy,
23
23
  toolsPosition,
24
- selectable: (_config$selectable = config === null || config === void 0 ? void 0 : config.selectable) !== null && _config$selectable !== void 0 ? _config$selectable : false,
25
- priceBar: (_config$priceBar = config === null || config === void 0 ? void 0 : config.priceBar) !== null && _config$priceBar !== void 0 ? _config$priceBar : false,
26
- textInput: (_config$textInput = config === null || config === void 0 ? void 0 : config.textInput) !== null && _config$textInput !== void 0 ? _config$textInput : false,
27
- initialMode: (_config$initialMode = config === null || config === void 0 ? void 0 : config.initialMode) !== null && _config$initialMode !== void 0 ? _config$initialMode : 'local',
28
- groupEdit: (_config$groupEdit = config === null || config === void 0 ? void 0 : config.groupEdit) !== null && _config$groupEdit !== void 0 ? _config$groupEdit : false,
29
- bulletStyle: (_config$bulletStyle = config === null || config === void 0 ? void 0 : config.bulletStyle) !== null && _config$bulletStyle !== void 0 ? _config$bulletStyle : 'square',
24
+ selectable: (config === null || config === void 0 ? void 0 : config.selectable) ?? false,
25
+ priceBar: (config === null || config === void 0 ? void 0 : config.priceBar) ?? false,
26
+ textInput: (config === null || config === void 0 ? void 0 : config.textInput) ?? false,
27
+ initialMode: (config === null || config === void 0 ? void 0 : config.initialMode) ?? 'local',
28
+ groupEdit: (config === null || config === void 0 ? void 0 : config.groupEdit) ?? false,
29
+ bulletStyle: (config === null || config === void 0 ? void 0 : config.bulletStyle) ?? 'square',
30
30
  openTypeFeatures: {
31
- interactionStyle: (_config$openTypeFeatu = config === null || config === void 0 ? void 0 : (_config$openTypeFeatu2 = config.openTypeFeatures) === null || _config$openTypeFeatu2 === void 0 ? void 0 : _config$openTypeFeatu2.interactionStyle) !== null && _config$openTypeFeatu !== void 0 ? _config$openTypeFeatu : 'panel',
32
- columns: config === null || config === void 0 ? void 0 : (_config$openTypeFeatu3 = config.openTypeFeatures) === null || _config$openTypeFeatu3 === void 0 ? void 0 : _config$openTypeFeatu3.columns,
33
- selectionStyle: (_config$openTypeFeatu4 = config === null || config === void 0 ? void 0 : (_config$openTypeFeatu5 = config.openTypeFeatures) === null || _config$openTypeFeatu5 === void 0 ? void 0 : _config$openTypeFeatu5.selectionStyle) !== null && _config$openTypeFeatu4 !== void 0 ? _config$openTypeFeatu4 : 'bullet'
31
+ interactionStyle: (config === null || config === void 0 ? void 0 : (_config$openTypeFeatu = config.openTypeFeatures) === null || _config$openTypeFeatu === void 0 ? void 0 : _config$openTypeFeatu.interactionStyle) ?? 'panel',
32
+ columns: config === null || config === void 0 ? void 0 : (_config$openTypeFeatu2 = config.openTypeFeatures) === null || _config$openTypeFeatu2 === void 0 ? void 0 : _config$openTypeFeatu2.columns,
33
+ selectionStyle: (config === null || config === void 0 ? void 0 : (_config$openTypeFeatu3 = config.openTypeFeatures) === null || _config$openTypeFeatu3 === void 0 ? void 0 : _config$openTypeFeatu3.selectionStyle) ?? 'bullet'
34
34
  },
35
- alignmentButtons: (_config$alignmentButt = config === null || config === void 0 ? void 0 : config.alignmentButtons) !== null && _config$alignmentButt !== void 0 ? _config$alignmentButt : false,
36
- initialAlignment: (_config$initialAlignm = config === null || config === void 0 ? void 0 : config.initialAlignment) !== null && _config$initialAlignm !== void 0 ? _config$initialAlignm : 'left',
35
+ alignmentButtons: (config === null || config === void 0 ? void 0 : config.alignmentButtons) ?? false,
36
+ initialAlignment: (config === null || config === void 0 ? void 0 : config.initialAlignment) ?? 'left',
37
37
  size: {
38
- label: (_config$size$label = config === null || config === void 0 ? void 0 : (_config$size = config.size) === null || _config$size === void 0 ? void 0 : _config$size.label) !== null && _config$size$label !== void 0 ? _config$size$label : 'Size',
39
- min: (_ref2 = (_config$size$min = config === null || config === void 0 ? void 0 : (_config$size2 = config.size) === null || _config$size2 === void 0 ? void 0 : _config$size2.min) !== null && _config$size$min !== void 0 ? _config$size$min : config === null || config === void 0 ? void 0 : config.min) !== null && _ref2 !== void 0 ? _ref2 : 10,
40
- max: (_ref3 = (_config$size$max = config === null || config === void 0 ? void 0 : (_config$size3 = config.size) === null || _config$size3 === void 0 ? void 0 : _config$size3.max) !== null && _config$size$max !== void 0 ? _config$size$max : config === null || config === void 0 ? void 0 : config.max) !== null && _ref3 !== void 0 ? _ref3 : 200
38
+ label: (config === null || config === void 0 ? void 0 : (_config$size = config.size) === null || _config$size === void 0 ? void 0 : _config$size.label) ?? 'Size',
39
+ min: (config === null || config === void 0 ? void 0 : (_config$size2 = config.size) === null || _config$size2 === void 0 ? void 0 : _config$size2.min) ?? (config === null || config === void 0 ? void 0 : config.min) ?? 10,
40
+ max: (config === null || config === void 0 ? void 0 : (_config$size3 = config.size) === null || _config$size3 === void 0 ? void 0 : _config$size3.max) ?? (config === null || config === void 0 ? void 0 : config.max) ?? 200
41
41
  },
42
42
  lineHeight: config !== null && config !== void 0 && config.lineHeight ? {
43
- label: (_config$lineHeight$la = config === null || config === void 0 ? void 0 : (_config$lineHeight = config.lineHeight) === null || _config$lineHeight === void 0 ? void 0 : _config$lineHeight.label) !== null && _config$lineHeight$la !== void 0 ? _config$lineHeight$la : 'Line height',
44
- min: (_config$lineHeight$mi = config === null || config === void 0 ? void 0 : (_config$lineHeight2 = config.lineHeight) === null || _config$lineHeight2 === void 0 ? void 0 : _config$lineHeight2.min) !== null && _config$lineHeight$mi !== void 0 ? _config$lineHeight$mi : 0.7,
45
- max: (_config$lineHeight$ma = config === null || config === void 0 ? void 0 : (_config$lineHeight3 = config.lineHeight) === null || _config$lineHeight3 === void 0 ? void 0 : _config$lineHeight3.max) !== null && _config$lineHeight$ma !== void 0 ? _config$lineHeight$ma : 2
43
+ label: (config === null || config === void 0 ? void 0 : (_config$lineHeight = config.lineHeight) === null || _config$lineHeight === void 0 ? void 0 : _config$lineHeight.label) ?? 'Line height',
44
+ min: (config === null || config === void 0 ? void 0 : (_config$lineHeight2 = config.lineHeight) === null || _config$lineHeight2 === void 0 ? void 0 : _config$lineHeight2.min) ?? 0.7,
45
+ max: (config === null || config === void 0 ? void 0 : (_config$lineHeight3 = config.lineHeight) === null || _config$lineHeight3 === void 0 ? void 0 : _config$lineHeight3.max) ?? 2
46
46
  } : undefined
47
47
  };
48
48
  };
49
49
  const makeConfig = config => {
50
- var _config$form$checkbox, _config$form, _config$storeModal$in, _config$storeModal, _config$storeModal$pr, _config$storeModal2;
50
+ var _config$form, _config$storeModal, _config$storeModal2, _config$storeModal3;
51
51
  return {
52
52
  typeTester: makeTypeTesterConfig(config === null || config === void 0 ? void 0 : config.typeTester),
53
53
  form: {
54
- checkboxStyle: (_config$form$checkbox = config === null || config === void 0 ? void 0 : (_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.checkboxStyle) !== null && _config$form$checkbox !== void 0 ? _config$form$checkbox : 'check'
54
+ checkboxStyle: (config === null || config === void 0 ? void 0 : (_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.checkboxStyle) ?? 'check'
55
55
  },
56
56
  storeModal: {
57
- indexLayout: (_config$storeModal$in = config === null || config === void 0 ? void 0 : (_config$storeModal = config.storeModal) === null || _config$storeModal === void 0 ? void 0 : _config$storeModal.indexLayout) !== null && _config$storeModal$in !== void 0 ? _config$storeModal$in : 'styled-aa',
58
- productLicensesPosition: (_config$storeModal$pr = config === null || config === void 0 ? void 0 : (_config$storeModal2 = config.storeModal) === null || _config$storeModal2 === void 0 ? void 0 : _config$storeModal2.productLicensesPosition) !== null && _config$storeModal$pr !== void 0 ? _config$storeModal$pr : 'bottom'
57
+ indexLayout: (config === null || config === void 0 ? void 0 : (_config$storeModal = config.storeModal) === null || _config$storeModal === void 0 ? void 0 : _config$storeModal.indexLayout) ?? 'styled-aa',
58
+ indexExcludeTags: config === null || config === void 0 ? void 0 : (_config$storeModal2 = config.storeModal) === null || _config$storeModal2 === void 0 ? void 0 : _config$storeModal2.indexExcludeTags,
59
+ productLicensesPosition: (config === null || config === void 0 ? void 0 : (_config$storeModal3 = config.storeModal) === null || _config$storeModal3 === void 0 ? void 0 : _config$storeModal3.productLicensesPosition) ?? 'bottom'
59
60
  }
60
61
  };
61
62
  };
@@ -7,11 +7,12 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactRelay = require("react-relay");
9
9
  var _reactRedux = require("react-redux");
10
+ var _redux = require("redux");
10
11
  var _Stylesheet = require("../Stylesheet");
11
12
  var _ConfigContext = _interopRequireWildcard(require("../ConfigContext"));
12
13
  var _ComponentsContext = _interopRequireDefault(require("../ComponentsContext"));
13
14
  var _TestModeBanner = _interopRequireDefault(require("../TestModeBanner"));
14
- var _reducer = require("../../reducer");
15
+ var _reducer = _interopRequireDefault(require("../../reducer"));
15
16
  var _relayEnvironment = _interopRequireDefault(require("../../relay-environment"));
16
17
  var _ThemeConfig = _interopRequireDefault(require("../ThemeConfig"));
17
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -29,14 +30,34 @@ const FontdueProvider = _ref => {
29
30
  url,
30
31
  stripeIntegration
31
32
  }));
33
+ const configValue = (0, _ConfigContext.makeConfig)(config);
34
+ const store = (0, _redux.createStore)(_reducer.default, {
35
+ selectedSkuIds: {},
36
+ // { [skuId]: Boolean }
37
+ licenseOptions: [],
38
+ cartOpen: false,
39
+ precartOpen: false,
40
+ collectionStyleSkus: {},
41
+ skuPrices: {},
42
+ collectionSkus: {},
43
+ stylesheets: [],
44
+ fetchedCollectionIds: [],
45
+ storeModalRoute: {
46
+ name: 'index',
47
+ variables: {
48
+ excludeTags: configValue.storeModal.indexExcludeTags
49
+ }
50
+ },
51
+ storeModalHistory: []
52
+ });
32
53
  return /*#__PURE__*/_react.default.createElement(_reactRelay.RelayEnvironmentProvider, {
33
54
  environment: environment.current
34
55
  }, /*#__PURE__*/_react.default.createElement(_reactRedux.Provider, {
35
- store: _reducer.store
56
+ store: store
36
57
  }, /*#__PURE__*/_react.default.createElement(_Stylesheet.StylesheetContainer, null), /*#__PURE__*/_react.default.createElement(_ThemeConfig.default, null), /*#__PURE__*/_react.default.createElement(_ConfigContext.default.Provider, {
37
- value: (0, _ConfigContext.makeConfig)(config)
58
+ value: configValue
38
59
  }, /*#__PURE__*/_react.default.createElement(_ComponentsContext.default.Provider, {
39
- value: components !== null && components !== void 0 ? components : {}
60
+ value: components ?? {}
40
61
  }, /*#__PURE__*/_react.default.createElement(_TestModeBanner.default, null), children))));
41
62
  };
42
63
  var _default = FontdueProvider;
@@ -15,7 +15,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
15
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
16
  const updateCustomerMutation = _NewsletterSignupUpdateCustomerMutation !== void 0 ? _NewsletterSignupUpdateCustomerMutation : (_NewsletterSignupUpdateCustomerMutation = require("../../__generated__/NewsletterSignupUpdateCustomerMutation.graphql"), _NewsletterSignupUpdateCustomerMutation.hash && _NewsletterSignupUpdateCustomerMutation.hash !== "769087891b6f263122bbb630b3f2ca6c" && console.error("The definition of 'NewsletterSignupUpdateCustomerMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NewsletterSignupUpdateCustomerMutation);
17
17
  const NewsletterSignup = _ref => {
18
- var _data$settings, _ref3, _data$settings2;
18
+ var _data$settings, _data$settings2;
19
19
  let {
20
20
  optInLabel: optInLabelProp,
21
21
  successLabel: successLabelProp,
@@ -70,7 +70,7 @@ const NewsletterSignup = _ref => {
70
70
  };
71
71
  const disabled = submitting || !newsletterOptIn || !email || !name;
72
72
  const optInLabel = optInLabelProp || (data === null || data === void 0 ? void 0 : (_data$settings = data.settings) === null || _data$settings === void 0 ? void 0 : _data$settings.newsletterOptInLabel);
73
- const successLabel = (_ref3 = successLabelProp || (data === null || data === void 0 ? void 0 : (_data$settings2 = data.settings) === null || _data$settings2 === void 0 ? void 0 : _data$settings2.newsletterSuccessLabel)) !== null && _ref3 !== void 0 ? _ref3 : 'Success!';
73
+ const successLabel = (successLabelProp || (data === null || data === void 0 ? void 0 : (_data$settings2 = data.settings) === null || _data$settings2 === void 0 ? void 0 : _data$settings2.newsletterSuccessLabel)) ?? 'Success!';
74
74
  if (submitted) {
75
75
  return /*#__PURE__*/_react.default.createElement("div", {
76
76
  className: "newsletter-signup"
@@ -122,7 +122,7 @@ const NewsletterSignup = _ref => {
122
122
  }, /*#__PURE__*/_react.default.createElement(_Check.default, null))), /*#__PURE__*/_react.default.createElement("label", {
123
123
  htmlFor: "customer-newsletter-opt-in",
124
124
  dangerouslySetInnerHTML: {
125
- __html: optInLabel !== null && optInLabel !== void 0 ? optInLabel : ''
125
+ __html: optInLabel ?? ''
126
126
  }
127
127
  })), /*#__PURE__*/_react.default.createElement("div", {
128
128
  className: "newsletter-signup__section"
@@ -139,11 +139,11 @@ const NewsletterSignupFetcher = params => {
139
139
  environment: environment,
140
140
  query: _NewsletterSignup_Query !== void 0 ? _NewsletterSignup_Query : (_NewsletterSignup_Query = require("../../__generated__/NewsletterSignup_Query.graphql"), _NewsletterSignup_Query.hash && _NewsletterSignup_Query.hash !== "ede23ce8fe999201dacb066fcef009af" && console.error("The definition of 'NewsletterSignup_Query' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NewsletterSignup_Query),
141
141
  variables: {},
142
- render: _ref4 => {
142
+ render: _ref3 => {
143
143
  let {
144
144
  props,
145
145
  error
146
- } = _ref4;
146
+ } = _ref3;
147
147
  if (error) {
148
148
  console.error(error);
149
149
  // TODO: centralize error component, report to sentry
@@ -29,9 +29,8 @@ const formatMoney = (priceInCents, format, currency) => {
29
29
  });
30
30
  return formatter.format(priceInCents / 100);
31
31
  } catch (e) {
32
- var _currencySymbols$curr;
33
32
  // fallback for browsers without support for Intl.NumberFormat
34
- const symbol = (_currencySymbols$curr = currencySymbols[currency]) !== null && _currencySymbols$curr !== void 0 ? _currencySymbols$curr : '';
33
+ const symbol = currencySymbols[currency] ?? '';
35
34
  const precision = format === PriceFormat.Truncated ? 0 : 2;
36
35
  return `${symbol}${(priceInCents / 100).toFixed(precision)}`;
37
36
  }
@@ -60,8 +60,7 @@ const renderCustomElement = (element, key) => {
60
60
  const Component = customElementMap[element.nodeName.toLowerCase()];
61
61
  const attributes = element.getAttributeNames();
62
62
  const props = attributes.reduce((acc, attribute) => {
63
- var _element$getAttribute;
64
- acc[(0, _utils.kebabToCamel)(attribute)] = (_element$getAttribute = element.getAttribute(attribute)) !== null && _element$getAttribute !== void 0 ? _element$getAttribute : '';
63
+ acc[(0, _utils.kebabToCamel)(attribute)] = element.getAttribute(attribute) ?? '';
65
64
  return acc;
66
65
  }, {});
67
66
  return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(Component, _extends({}, props, {
@@ -26,20 +26,20 @@ const populateProductState = (store, environment, id) => {
26
26
  };
27
27
  exports.populateProductState = populateProductState;
28
28
  const allSkus = function (collection) {
29
- var _collection$fontStyle, _collection$fontStyle2;
29
+ var _collection$fontStyle;
30
30
  let includeCollections = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
31
31
  let includeFontStyles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
32
32
  let bundleSkus = [];
33
33
  if ('bundles' in collection) {
34
- var _collection$bundles$f, _collection$bundles;
35
- bundleSkus = (_collection$bundles$f = 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))) !== null && _collection$bundles$f !== void 0 ? _collection$bundles$f : [];
34
+ var _collection$bundles;
35
+ 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))) ?? [];
36
36
  }
37
37
  let childrenSkus = [];
38
38
  if ('children' in collection) {
39
- var _collection$children$, _collection$children;
40
- childrenSkus = (_collection$children$ = (_collection$children = collection.children) === null || _collection$children === void 0 ? void 0 : _collection$children.flatMap(child => allSkus(child, includeCollections, includeFontStyles))) !== null && _collection$children$ !== void 0 ? _collection$children$ : [];
39
+ var _collection$children;
40
+ childrenSkus = ((_collection$children = collection.children) === null || _collection$children === void 0 ? void 0 : _collection$children.flatMap(child => allSkus(child, includeCollections, includeFontStyles))) ?? [];
41
41
  }
42
- return [includeCollections ? collection === null || collection === void 0 ? void 0 : collection.sku : null, ...(includeFontStyles ? (_collection$fontStyle = collection === null || collection === void 0 ? void 0 : (_collection$fontStyle2 = collection.fontStyles) === null || _collection$fontStyle2 === void 0 ? void 0 : _collection$fontStyle2.map(style => style.sku)) !== null && _collection$fontStyle !== void 0 ? _collection$fontStyle : [] : []), ...bundleSkus, ...childrenSkus].filter(_utils.notEmpty);
42
+ 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);
43
43
  };
44
44
  const flattenSkuData = collection => {
45
45
  let bundles = {};
@@ -58,13 +58,13 @@ const flattenSkuData = collection => {
58
58
  }
59
59
  let collectionData = {};
60
60
  if (collection.sku) {
61
- var _collection$fontStyle3, _collection$fontStyle4, _collection$children$2, _collection$children2;
61
+ var _collection$fontStyle2, _collection$children2;
62
62
  collectionData = {
63
63
  [collection.sku.id]: {
64
- fontStyleIds: ((_collection$fontStyle3 = (_collection$fontStyle4 = collection.fontStyles) === null || _collection$fontStyle4 === void 0 ? void 0 : _collection$fontStyle4.map(style => style.id)) !== null && _collection$fontStyle3 !== void 0 ? _collection$fontStyle3 : []).concat('children' in collection ? (_collection$children$2 = (_collection$children2 = collection.children) === null || _collection$children2 === void 0 ? void 0 : _collection$children2.flatMap(child => {
65
- var _child$fontStyles$map, _child$fontStyles;
66
- return (_child$fontStyles$map = (_child$fontStyles = child.fontStyles) === null || _child$fontStyles === void 0 ? void 0 : _child$fontStyles.map(style => style.id)) !== null && _child$fontStyles$map !== void 0 ? _child$fontStyles$map : [];
67
- })) !== null && _collection$children$2 !== void 0 ? _collection$children$2 : [] : []),
64
+ fontStyleIds: (((_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 => {
65
+ var _child$fontStyles;
66
+ return ((_child$fontStyles = child.fontStyles) === null || _child$fontStyles === void 0 ? void 0 : _child$fontStyles.map(style => style.id)) ?? [];
67
+ })) ?? [] : []),
68
68
  fontStyleSkuIds: allSkus(collection, false, true).map(sku => sku.id),
69
69
  childrenSkuIds: allSkus(collection, true, false).map(sku => sku.id).filter(skuId => {
70
70
  var _collection$sku;
@@ -88,7 +88,7 @@ const flattenSkuPrices = collection => {
88
88
  }, {});
89
89
  };
90
90
  const populateProductStateReducer = (state, action) => {
91
- var _data$node, _data$node$sku$id, _data$node$sku;
91
+ var _data$node, _data$node$sku;
92
92
  if (action.type !== 'POPULATE_PRODUCT_STATE') return state;
93
93
  const {
94
94
  data
@@ -118,7 +118,7 @@ const populateProductStateReducer = (state, action) => {
118
118
  // }
119
119
  collectionSkus: {
120
120
  ...state.collectionSkus,
121
- [`${data.node.id}`]: (_data$node$sku$id = (_data$node$sku = data.node.sku) === null || _data$node$sku === void 0 ? void 0 : _data$node$sku.id) !== null && _data$node$sku$id !== void 0 ? _data$node$sku$id : null
121
+ [`${data.node.id}`]: ((_data$node$sku = data.node.sku) === null || _data$node$sku === void 0 ? void 0 : _data$node$sku.id) ?? null
122
122
  },
123
123
  fetchedCollectionIds: state.fetchedCollectionIds.concat(data.node.id)
124
124
  };
@@ -26,7 +26,7 @@ const Select = _ref => {
26
26
  } = _ref2;
27
27
  return value === v;
28
28
  })) === null || _options$find === void 0 ? void 0 : _options$find.text), /*#__PURE__*/_react.default.createElement("select", _extends({
29
- value: value !== null && value !== void 0 ? value : '',
29
+ value: value ?? '',
30
30
  className: "select__select"
31
31
  }, rest), nullText && value === null && /*#__PURE__*/_react.default.createElement("option", {
32
32
  value: "",
@@ -20,7 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
20
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
22
  const StoreModalCart = _ref => {
23
- var _order$stripePaymentM, _order$orderItems$len, _order$orderItems;
23
+ var _order$stripePaymentM, _order$orderItems;
24
24
  let {
25
25
  prepared
26
26
  } = _ref;
@@ -29,7 +29,7 @@ const StoreModalCart = _ref => {
29
29
  const order = data.viewer.currentOrder;
30
30
  const canSkipCheckout = Boolean(order === null || order === void 0 ? void 0 : (_order$stripePaymentM = order.stripePaymentMethod) === null || _order$stripePaymentM === void 0 ? void 0 : _order$stripePaymentM.id);
31
31
  const checkoutEnabled = (0, _utils.textVariablesAllHaveText)(order);
32
- const orderHasItems = ((_order$orderItems$len = order === null || order === void 0 ? void 0 : (_order$orderItems = order.orderItems) === null || _order$orderItems === void 0 ? void 0 : _order$orderItems.length) !== null && _order$orderItems$len !== void 0 ? _order$orderItems$len : 0) > 0;
32
+ const orderHasItems = ((order === null || order === void 0 ? void 0 : (_order$orderItems = order.orderItems) === null || _order$orderItems === void 0 ? void 0 : _order$orderItems.length) ?? 0) > 0;
33
33
  return /*#__PURE__*/_react.default.createElement(_StoreModalPageContainer.default, null, {
34
34
  title: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, "Your cart", !orderHasItems && ' is empty'),
35
35
  body: order && orderHasItems ? /*#__PURE__*/_react.default.createElement(_CartState.default, {
@@ -12,6 +12,7 @@ var _relayRuntime = require("relay-runtime");
12
12
  var _StoreModalCheckoutContext = _interopRequireDefault(require("./StoreModalCheckoutContext"));
13
13
  var _CheckoutSteps = _interopRequireDefault(require("../Cart/CheckoutSteps"));
14
14
  var _StoreModalLoadingScreen = _interopRequireDefault(require("../elements/StoreModalLoadingScreen"));
15
+ var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
15
16
  var _StoreModalContainerQuery;
16
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -37,13 +38,13 @@ const getBackLink = (history, currentRoute) => {
37
38
  return getPageTitle(previous.name);
38
39
  };
39
40
  const StoreModalContainer = _ref => {
40
- var _currentOrder$orderIt, _currentOrder, _currentOrder$orderIt2, _settings, _settings2;
41
+ var _currentOrder, _currentOrder$orderIt, _settings, _settings2;
41
42
  let {
42
43
  children
43
44
  } = _ref;
44
45
  const data = (0, _reactRelay.useLazyLoadQuery)(_StoreModalContainerQuery !== void 0 ? _StoreModalContainerQuery : (_StoreModalContainerQuery = require("../../__generated__/StoreModalContainerQuery.graphql"), _StoreModalContainerQuery.hash && _StoreModalContainerQuery.hash !== "67cf3b7a14c2b8ff47a8138e0f234624" && console.error("The definition of 'StoreModalContainerQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalContainerQuery), {});
45
46
  const dispatch = (0, _reactRedux.useDispatch)();
46
- const showCartButton = ((_currentOrder$orderIt = (_currentOrder = data.viewer.currentOrder) === null || _currentOrder === void 0 ? void 0 : (_currentOrder$orderIt2 = _currentOrder.orderItems) === null || _currentOrder$orderIt2 === void 0 ? void 0 : _currentOrder$orderIt2.length) !== null && _currentOrder$orderIt !== void 0 ? _currentOrder$orderIt : 0) > 0;
47
+ const showCartButton = (((_currentOrder = data.viewer.currentOrder) === null || _currentOrder === void 0 ? void 0 : (_currentOrder$orderIt = _currentOrder.orderItems) === null || _currentOrder$orderIt === void 0 ? void 0 : _currentOrder$orderIt.length) ?? 0) > 0;
47
48
  const handleClose = (0, _react.useCallback)(() => {
48
49
  dispatch({
49
50
  type: 'CLOSE_CART'
@@ -52,11 +53,15 @@ const StoreModalContainer = _ref => {
52
53
  const currentRoute = (0, _reactRedux.useSelector)(state => state.storeModalRoute.name);
53
54
  const history = (0, _reactRedux.useSelector)(state => state.storeModalHistory);
54
55
  const link = getBackLink(history, currentRoute);
56
+ const config = (0, _react.useContext)(_ConfigContext.default);
55
57
  const handleBack = () => {
56
58
  if (history.length === 0) {
57
59
  dispatch({
58
60
  type: 'STORE_MODAL_REPLACE',
59
- route: 'index'
61
+ route: 'index',
62
+ variables: {
63
+ excludeTags: config.storeModal.indexExcludeTags
64
+ }
60
65
  });
61
66
  } else {
62
67
  dispatch({
@@ -11,13 +11,13 @@ var _StoreModalIndexItem = _interopRequireDefault(require("./StoreModalIndexItem
11
11
  var _StoreModalIndexQuery;
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
  const StoreModalIndex = _ref => {
14
- var _viewer$rootCollectio, _viewer$rootCollectio2;
14
+ var _viewer$rootCollectio;
15
15
  let {
16
16
  prepared
17
17
  } = _ref;
18
- const data = (0, _reactRelay.usePreloadedQuery)(_StoreModalIndexQuery !== void 0 ? _StoreModalIndexQuery : (_StoreModalIndexQuery = require("../../__generated__/StoreModalIndexQuery.graphql"), _StoreModalIndexQuery.hash && _StoreModalIndexQuery.hash !== "a36eb25fa97de6d986b72bbaf538c3db" && console.error("The definition of 'StoreModalIndexQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalIndexQuery), prepared.indexQuery);
18
+ const data = (0, _reactRelay.usePreloadedQuery)(_StoreModalIndexQuery !== void 0 ? _StoreModalIndexQuery : (_StoreModalIndexQuery = require("../../__generated__/StoreModalIndexQuery.graphql"), _StoreModalIndexQuery.hash && _StoreModalIndexQuery.hash !== "d1a037f0551211a8f93528d5bb6e39fa" && console.error("The definition of 'StoreModalIndexQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalIndexQuery), prepared.indexQuery);
19
19
  const viewer = data.viewer;
20
- const edges = (_viewer$rootCollectio = viewer === null || viewer === void 0 ? void 0 : (_viewer$rootCollectio2 = viewer.rootCollections) === null || _viewer$rootCollectio2 === void 0 ? void 0 : _viewer$rootCollectio2.edges) !== null && _viewer$rootCollectio !== void 0 ? _viewer$rootCollectio : [];
20
+ const edges = (viewer === null || viewer === void 0 ? void 0 : (_viewer$rootCollectio = viewer.rootCollections) === null || _viewer$rootCollectio === void 0 ? void 0 : _viewer$rootCollectio.edges) ?? [];
21
21
  return /*#__PURE__*/_react.default.createElement(_StoreModalPageContainer.default, null, {
22
22
  title: 'All collections',
23
23
  body: edges.map(edge => {
@@ -18,7 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
18
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
19
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
20
  const StoreModalProduct = _ref => {
21
- var _config$storeModal$pr, _config$storeModal, _collection$children;
21
+ var _config$storeModal, _collection$children;
22
22
  let {
23
23
  prepared
24
24
  } = _ref;
@@ -51,7 +51,7 @@ const StoreModalProduct = _ref => {
51
51
  });
52
52
  };
53
53
  }, []);
54
- const licensesPosition = (_config$storeModal$pr = config === null || config === void 0 ? void 0 : (_config$storeModal = config.storeModal) === null || _config$storeModal === void 0 ? void 0 : _config$storeModal.productLicensesPosition) !== null && _config$storeModal$pr !== void 0 ? _config$storeModal$pr : 'bottom';
54
+ const licensesPosition = (config === null || config === void 0 ? void 0 : (_config$storeModal = config.storeModal) === null || _config$storeModal === void 0 ? void 0 : _config$storeModal.productLicensesPosition) ?? 'bottom';
55
55
  return /*#__PURE__*/_react.default.createElement(_StoreModalPageContainer.default, null, {
56
56
  body: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, licensesPosition === 'top' && /*#__PURE__*/_react.default.createElement(_StoreModalProductLicenseSelection.default, {
57
57
  viewer: viewer