@shopgate/pwa-common 7.31.4-beta.1 → 7.32.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.
@@ -1,8 +1,4 @@
1
1
  import { css } from '@shopgate/engage/styles';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const {
4
- colors
5
- } = themeConfig;
6
2
  const responsiveContainer = css({
7
3
  position: 'relative',
8
4
  height: 0,
@@ -29,19 +25,18 @@ const consentContainer = css({
29
25
  justifyContent: 'center',
30
26
  textAlign: 'center',
31
27
  gap: 16,
32
- background: colors.shade10,
33
- border: `1px solid ${colors.shade5}`,
34
- // Add a tiny little border radius to make the message container look nice with padding
28
+ background: 'var(--sg-palette-grey-light)',
29
+ border: '1px solid var(--sg-components-border-medium)',
35
30
  borderRadius: 4,
36
31
  top: 0
37
32
  });
38
33
  const consentLink = css({
39
34
  textAlign: 'center',
40
- color: colors.primary,
35
+ color: 'var(--sg-palette-primary-main)',
41
36
  fontWeight: 500
42
37
  }).toString();
43
38
  const consentIcon = css({
44
- fill: colors.shade5,
39
+ fill: 'var(--sg-palette-grey-medium)',
45
40
  height: 40
46
41
  });
47
42
  export default {
@@ -104,7 +104,7 @@ function Backdrop({
104
104
  }
105
105
  Backdrop.defaultProps = {
106
106
  className: '',
107
- color: '#000',
107
+ color: 'var(--sg-palette-common-black)',
108
108
  duration: 200,
109
109
  isVisible: false,
110
110
  level: 2,
@@ -1,14 +1,10 @@
1
1
  import React, { useMemo, useState, useEffect, useRef, useCallback, memo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import noop from 'lodash/noop';
4
- import { themeConfig } from '@shopgate/engage';
5
4
  import { makeStyles } from '@shopgate/engage/styles';
6
5
  import { getFullImageSource } from '@shopgate/engage/core/helpers';
7
6
  import ImageInner from "./ImageInner";
8
7
  import { jsx as _jsx } from "react/jsx-runtime";
9
- const {
10
- colors: themeColors
11
- } = themeConfig;
12
8
  const useStyles = makeStyles()((_theme, {
13
9
  background,
14
10
  paddingTop
@@ -204,7 +200,7 @@ const defaultResolutions = [{
204
200
  }];
205
201
  Image.defaultProps = {
206
202
  alt: null,
207
- backgroundColor: themeColors.placeholder,
203
+ backgroundColor: 'var(--sg-palette-background-emphasized)',
208
204
  className: '',
209
205
  classNameImg: '',
210
206
  forcePlaceholder: false,
@@ -9,10 +9,9 @@ import 'swiper/css/navigation';
9
9
  import 'swiper/css/zoom';
10
10
  import { useReduceMotion } from '@shopgate/engage/a11y/hooks';
11
11
  import { makeStyles } from '@shopgate/engage/styles';
12
- import { themeColors } from '@shopgate/pwa-common/helpers/config';
13
12
  import SwiperItem from "./components/SwiperItem";
14
13
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
- const useStyles = makeStyles()(() => ({
14
+ const useStyles = makeStyles()(theme => ({
16
15
  container: {
17
16
  position: 'relative',
18
17
  maxHeight: '100%',
@@ -27,7 +26,7 @@ const useStyles = makeStyles()(() => ({
27
26
  },
28
27
  innerContainer: {
29
28
  overflow: 'hidden',
30
- '--swiper-navigation-color': themeColors.gray,
29
+ '--swiper-navigation-color': theme.components.swiper.paginationBulletColor,
31
30
  '& .swiper-wrapper': {
32
31
  alignItems: 'stretch'
33
32
  },
@@ -36,11 +35,10 @@ const useStyles = makeStyles()(() => ({
36
35
  },
37
36
  '& .swiper-pagination': {
38
37
  '& .swiper-pagination-bullet': {
39
- background: themeColors.gray,
38
+ background: theme.components.swiper.paginationBulletActiveColor,
40
39
  opacity: '.5',
41
40
  margin: '0 4px',
42
- transition: 'opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1)',
43
- border: `1px solid ${themeColors.dark}`
41
+ transition: 'opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1)'
44
42
  },
45
43
  '& .swiper-pagination-bullet-active.swiper-pagination-bullet-active-main': {
46
44
  opacity: 1
@@ -51,8 +49,8 @@ const useStyles = makeStyles()(() => ({
51
49
  left: 'auto',
52
50
  right: 0,
53
51
  bottom: 'auto',
54
- fontSize: 12,
55
- background: themeColors.background,
52
+ fontSize: theme.typography.caption.fontSize,
53
+ background: theme.components.swiper.paginationFractionBackground,
56
54
  borderRadius: '50px',
57
55
  width: 'fit-content',
58
56
  padding: '4px 8px',
@@ -60,9 +58,9 @@ const useStyles = makeStyles()(() => ({
60
58
  transition: 'opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1)'
61
59
  },
62
60
  '& .swiper-pagination-progressbar': {
63
- background: themeColors.shade7,
61
+ background: theme.components.swiper.paginationProgressbarBackground,
64
62
  '& .swiper-pagination-progressbar-fill': {
65
- background: themeColors.dark
63
+ background: theme.components.swiper.paginationProgressbarActiveColor
66
64
  }
67
65
  }
68
66
  },
@@ -51,44 +51,5 @@ 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: 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
- benchmark: boolean;
74
- sentry: {};
75
- theme: {};
76
- cartShippingHideAnonymousLegacy: null;
77
- cartShippingTextAnonymousLegacy: null;
78
- variantSelectionMode: null;
79
- product: {
80
- variantPreselect: boolean;
81
- };
82
- cart: {};
83
- scanner: {};
84
- favorites: {};
85
- tracking: {
86
- hasWebTrackingEngage: boolean;
87
- useSkuAsProductId: boolean;
88
- };
89
- webTrackingEngage: {
90
- android: string;
91
- ios: string;
92
- };
93
- } | undefined;
54
+ declare const appConfig: any;
94
55
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/config/index.js"],"names":[],"mappings":"AAyJA;;;;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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/config/index.js"],"names":[],"mappings":"AAyJA;;;;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-common",
3
- "version": "7.31.4-beta.1",
3
+ "version": "7.32.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>",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@redux-devtools/extension": "^3.3.0",
19
19
  "@sentry/browser": "6.0.1",
20
- "@shopgate/pwa-benchmark": "7.31.4-beta.1",
20
+ "@shopgate/pwa-benchmark": "7.32.0-beta.1",
21
21
  "@virtuous/conductor": "~2.5.0",
22
22
  "@virtuous/react-conductor": "~2.5.0",
23
23
  "@virtuous/redux-persister": "1.1.0-beta.7",
@@ -40,7 +40,7 @@
40
40
  "swiper": "12.1.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@shopgate/pwa-core": "7.31.4-beta.1",
43
+ "@shopgate/pwa-core": "7.32.0-beta.1",
44
44
  "@types/lodash": "^4.17.24",
45
45
  "@types/react-portal": "^3.0.9",
46
46
  "lodash": "^4.17.23",
@@ -9,7 +9,7 @@ import Route from '@virtuous/conductor/Route';
9
9
  import { Linking } from '@shopgate/native-modules';
10
10
  import { HISTORY_RESET_TO } from '@shopgate/pwa-common/constants/ActionTypes';
11
11
  import { logger } from '@shopgate/pwa-core';
12
- import { IS_PAGE_PREVIEW_ACTIVE } from '@shopgate/engage/page/constants';
12
+ import { isPageAdminPreviewActive } from '@shopgate/engage/admin-preview/helpers';
13
13
  import addCouponsToCart from '@shopgate/pwa-common-commerce/cart/actions/addCouponsToCart';
14
14
  import { getCurrentRoute, getRouterStackIndex } from "../selectors/router";
15
15
  import { LoadingProvider } from "../providers";
@@ -31,7 +31,7 @@ import ToastProvider from "../providers/toast";
31
31
  */
32
32
  export default function routerSubscriptions(subscribe) {
33
33
  subscribe(navigate$, async params => {
34
- if (IS_PAGE_PREVIEW_ACTIVE) {
34
+ if (isPageAdminPreviewActive()) {
35
35
  // No navigation is allowed in page preview mode.
36
36
  return;
37
37
  }