@shopgate/pwa-common 7.32.2-alpha.9 → 7.33.0-beta.1

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.
@@ -39,9 +39,11 @@ export default function handleLink(payload, allowExternalLinks = false) {
39
39
  pathname
40
40
  } = new URL(link));
41
41
  } catch (linkParseError) {
42
- // The error is sent to Sentry. Query string and hash can contain tokens, so they are
43
- // left out, and so is the error of the browser, which can contain the whole link.
44
- logger.error(new Error(`Could not parse link ${link.split(/[?#]/)[0]}`));
42
+ // The error is sent to Sentry. Query string, hash and credentials in front of the host can
43
+ // contain secrets, so they are left out, and so is the error of the browser, which can
44
+ // contain the whole link.
45
+ const loggedLink = link.split(/[?#]/)[0].replace(/^([^/]*\/\/)[^/@]*@/, '$1');
46
+ logger.error(new Error(`Could not parse link ${loggedLink}`));
45
47
  }
46
48
  } else {
47
49
  // Remove the deeplink protocol from the link.
@@ -136,7 +136,7 @@ let Checkbox = /*#__PURE__*/function (_Component) {
136
136
  onClick: this.handleCheck,
137
137
  onKeyDown: this.handleKeyDown,
138
138
  role: "checkbox",
139
- "aria-checked": this.props.checked,
139
+ "aria-checked": this.isChecked(),
140
140
  tabIndex: 0,
141
141
  children: [this.renderInput(), this.renderLabelIfItIsOnThe('left'), this.renderIcon(), this.renderLabelIfItIsOnThe('right')]
142
142
  });
@@ -11,21 +11,13 @@ const FormatNumber = ({
11
11
  className,
12
12
  number,
13
13
  fractions
14
- }) => {
15
- if (!className) {
16
- FormatNumber.format({
17
- number,
18
- fractions
19
- });
20
- }
21
- return /*#__PURE__*/_jsx("span", {
22
- className: className,
23
- children: FormatNumber.format({
24
- number,
25
- fractions
26
- })
27
- });
28
- };
14
+ }) => /*#__PURE__*/_jsx("span", {
15
+ className: className,
16
+ children: FormatNumber.format({
17
+ number,
18
+ fractions
19
+ })
20
+ });
29
21
  FormatNumber.format = props => {
30
22
  if (!i18n.ready) {
31
23
  return props.number;
@@ -118,9 +118,10 @@ let InfiniteContainer = /*#__PURE__*/function (_Component) {
118
118
  return;
119
119
  }
120
120
  if (nextProps.items.length >= this.state.itemCount) {
121
+ finalize();
121
122
  this.setState({
122
123
  itemCount: nextProps.items.length
123
- }, finalize());
124
+ });
124
125
  } else {
125
126
  this.resetComponent(() => {
126
127
  finalize();
@@ -154,9 +155,11 @@ let InfiniteContainer = /*#__PURE__*/function (_Component) {
154
155
  * When the component will unmount it unbinds all previously bound event listeners.
155
156
  */;
156
157
  _proto.componentWillUnmount = function componentWillUnmount() {
157
- router.update(this.context.id, {
158
- offset: this.state.offset[0]
159
- }, false);
158
+ if (this.context?.id) {
159
+ router.update(this.context.id, {
160
+ offset: this.state.offset[0]
161
+ }, false);
162
+ }
160
163
  this.unbindEvents();
161
164
  }
162
165
 
@@ -88,7 +88,7 @@ const Select = ({
88
88
  if (selected && selected.value === nextSelected.value) {
89
89
  return;
90
90
  }
91
- if (onChange instanceof Function) {
91
+ if (typeof onChange === 'function') {
92
92
  onChange(nextSelected.value);
93
93
  }
94
94
  }, [onChange, selected]);
@@ -35,9 +35,7 @@ const SelectBoxItem = ({
35
35
  handleSelectionUpdate(value);
36
36
  }, [handleSelectionUpdate, value]);
37
37
  return /*#__PURE__*/_jsx("li", {
38
- className: cx(classes.item, selectItem, {
39
- [selectItemSelected]: isSelected
40
- }),
38
+ className: cx(classes.item, selectItem, isSelected && selectItemSelected),
41
39
  onKeyUp: () => {},
42
40
  onClick: onSelect,
43
41
  "data-test-id": label,
@@ -51,5 +51,43 @@ export default appConfig;
51
51
  * Be careful when changing existing properties on the fly, reassignments should never be done!
52
52
  * @mixes AppConfig
53
53
  */
54
- declare const appConfig: any;
54
+ declare const appConfig: string | {
55
+ appId: string;
56
+ browserConnector: boolean;
57
+ colors: {};
58
+ forgotPasswordUrl: null;
59
+ hasFavorites: boolean;
60
+ hasReviews: boolean;
61
+ showWriteReview: boolean;
62
+ language: string;
63
+ logo: string;
64
+ marketId: string;
65
+ publicPath: string;
66
+ shopName: string;
67
+ webCheckoutShopify: null;
68
+ hasNoScanner: boolean;
69
+ apiUrl: string;
70
+ shopCNAME: null;
71
+ currency: string;
72
+ showGmdMenuSubHeaders: boolean;
73
+ sentry: {};
74
+ theme: {};
75
+ cartShippingHideAnonymousLegacy: null;
76
+ cartShippingTextAnonymousLegacy: null;
77
+ variantSelectionMode: null;
78
+ product: {
79
+ variantPreselect: boolean;
80
+ };
81
+ cart: {};
82
+ scanner: {};
83
+ favorites: {};
84
+ tracking: {
85
+ hasWebTrackingEngage: boolean;
86
+ useSkuAsProductId: boolean;
87
+ };
88
+ webTrackingEngage: {
89
+ android: string;
90
+ ios: string;
91
+ };
92
+ } | undefined;
55
93
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/config/index.js"],"names":[],"mappings":"AAwJA;;;;GAIG;AACH,yCAHW,MAAM,oBACN,mBAAmB,GAAC,IAAI,QAKlC;AA/GD;;GAEG;AACH,yBAFU,MAAM,CAEsB;AAWtC;;;GAGG;AACH,+BAFU,MAAM,CAKd;AASF;;;GAGG;AACH,wBAFU,MAAM,CAEsC;AAEtD;;;GAGG;AACH,0BAFU,WAAW,CAEkC;AAEvD,yBAAyB;AACzB,8BAA8C;AAC9C,0BAA0B;AAC1B,+BAAgD;AAChD,4BAA4B;AAC5B,iCAAoD;AACpD,wBAAwB;AACxB,6BAA4C;AAK5C;;;;;;;;;;GAUG;AACH,2CANU,mBAAmB,CA8B3B;AAWK,gDAPI,MAAM,SACN,GAAC,SACD,GAAC,aACD,MAAM,aACN,MAAM,GACJ,OAAO,CAGK;AAiBzB,6BAAkE;;AA/FlE;;;;GAIG;AACH,6BAA8F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/config/index.js"],"names":[],"mappings":"AAwJA;;;;GAIG;AACH,yCAHW,MAAM,oBACN,mBAAmB,GAAC,IAAI,QAKlC;AA/GD;;GAEG;AACH,yBAFU,MAAM,CAEsB;AAWtC;;;GAGG;AACH,+BAFU,MAAM,CAKd;AASF;;;GAGG;AACH,wBAFU,MAAM,CAEsC;AAEtD;;;GAGG;AACH,0BAFU,WAAW,CAEkC;AAEvD,yBAAyB;AACzB,8BAA8C;AAC9C,0BAA0B;AAC1B,+BAAgD;AAChD,4BAA4B;AAC5B,iCAAoD;AACpD,wBAAwB;AACxB,6BAA4C;AAK5C;;;;;;;;;;GAUG;AACH,2CANU,mBAAmB,CA8B3B;AAWK,gDAPI,MAAM,SACN,GAAC,SACD,GAAC,aACD,MAAM,aACN,MAAM,GACJ,OAAO,CAGK;AAiBzB,6BAAkE;;AA/FlE;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA8F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-common",
3
- "version": "7.32.2-alpha.9",
3
+ "version": "7.33.0-beta.1",
4
4
  "description": "Common library for the Shopgate Connect PWA.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -43,7 +43,7 @@
43
43
  "swiper": "12.2.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@shopgate/pwa-core": "7.32.2-alpha.9",
46
+ "@shopgate/pwa-core": "7.33.0-beta.1",
47
47
  "@types/lodash": "^4.17.25",
48
48
  "@types/react-portal": "^3.0.9",
49
49
  "lodash": "^4.18.1",