@shopgate/engage 7.32.0-beta.10 → 7.32.0-beta.11

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 (103) hide show
  1. package/core/hooks/events/appEvents.d.ts +31 -46
  2. package/core/hooks/events/appEvents.d.ts.map +1 -0
  3. package/core/hooks/events/appEvents.js +26 -29
  4. package/core/hooks/events/index.d.ts +4 -4
  5. package/core/hooks/events/index.d.ts.map +1 -1
  6. package/core/hooks/events/useLongPress.d.ts +55 -58
  7. package/core/hooks/events/useLongPress.d.ts.map +1 -0
  8. package/core/hooks/events/useLongPress.js +23 -16
  9. package/core/hooks/events/usePressHandler.d.ts +32 -21
  10. package/core/hooks/events/usePressHandler.d.ts.map +1 -1
  11. package/core/hooks/events/usePressHandler.js +12 -10
  12. package/core/hooks/events/useScrollDirectionChange.d.ts +72 -61
  13. package/core/hooks/events/useScrollDirectionChange.d.ts.map +1 -0
  14. package/core/hooks/events/useScrollDirectionChange.js +36 -43
  15. package/development/action-creators/index.d.ts +3 -0
  16. package/development/action-creators/index.d.ts.map +1 -0
  17. package/development/action-creators/settings.d.ts +45 -0
  18. package/development/action-creators/settings.d.ts.map +1 -0
  19. package/development/action-creators/settings.js +21 -10
  20. package/development/action-creators/storage.d.ts +17 -0
  21. package/development/action-creators/storage.d.ts.map +1 -0
  22. package/development/action-creators/storage.js +7 -4
  23. package/development/components/ClientInformation/ClientInformation.d.ts +6 -0
  24. package/development/components/ClientInformation/ClientInformation.d.ts.map +1 -0
  25. package/development/components/ClientInformation/ClientInformation.js +7 -4
  26. package/development/components/ClientInformation/actions.d.ts +6 -0
  27. package/development/components/ClientInformation/actions.d.ts.map +1 -0
  28. package/development/components/ClientInformation/actions.js +1 -1
  29. package/development/components/ClientInformation/index.d.ts +2 -0
  30. package/development/components/ClientInformation/index.d.ts.map +1 -0
  31. package/development/components/DevelopmentSettings/DevelopmentSettings.d.ts +16 -0
  32. package/development/components/DevelopmentSettings/DevelopmentSettings.d.ts.map +1 -0
  33. package/development/components/DevelopmentSettings/DevelopmentSettings.js +41 -28
  34. package/development/components/DevelopmentSettings/index.d.ts +2 -0
  35. package/development/components/DevelopmentSettings/index.d.ts.map +1 -0
  36. package/development/components/DevelopmentTools/DevelopmentTools.d.ts +10 -0
  37. package/development/components/DevelopmentTools/DevelopmentTools.d.ts.map +1 -0
  38. package/development/components/DevelopmentTools/DevelopmentTools.js +8 -8
  39. package/development/components/DevelopmentTools/Shortcuts.d.ts +6 -0
  40. package/development/components/DevelopmentTools/Shortcuts.d.ts.map +1 -0
  41. package/development/components/DevelopmentTools/Shortcuts.js +0 -1
  42. package/development/components/DevelopmentTools/hooks.d.ts +8 -0
  43. package/development/components/DevelopmentTools/hooks.d.ts.map +1 -0
  44. package/development/components/DevelopmentTools/hooks.js +2 -3
  45. package/development/components/DevelopmentTools/index.d.ts +2 -0
  46. package/development/components/DevelopmentTools/index.d.ts.map +1 -0
  47. package/development/components/SimulatedInsets/SimulatedInsetBottom.d.ts +7 -0
  48. package/development/components/SimulatedInsets/SimulatedInsetBottom.d.ts.map +1 -0
  49. package/development/components/SimulatedInsets/SimulatedInsetBottom.js +1 -6
  50. package/development/components/SimulatedInsets/SimulatedInsetTop.d.ts +7 -0
  51. package/development/components/SimulatedInsets/SimulatedInsetTop.d.ts.map +1 -0
  52. package/development/components/SimulatedInsets/SimulatedInsetTop.js +2 -7
  53. package/development/components/SimulatedInsets/SimulatedInsets.d.ts +13 -0
  54. package/development/components/SimulatedInsets/SimulatedInsets.d.ts.map +1 -0
  55. package/development/components/SimulatedInsets/SimulatedInsets.js +2 -7
  56. package/development/components/SimulatedInsets/index.d.ts +2 -0
  57. package/development/components/SimulatedInsets/index.d.ts.map +1 -0
  58. package/development/components/SimulatedInsets/types.d.ts +15 -0
  59. package/development/components/SimulatedInsets/types.d.ts.map +1 -0
  60. package/development/components/SimulatedInsets/types.js +1 -0
  61. package/development/components/index.d.ts +3 -0
  62. package/development/components/index.d.ts.map +1 -0
  63. package/development/constants/actionTypes.d.ts +6 -0
  64. package/development/constants/actionTypes.d.ts.map +1 -0
  65. package/development/constants/actionTypes.js +2 -1
  66. package/development/constants/index.d.ts +2 -0
  67. package/development/constants/index.d.ts.map +1 -0
  68. package/development/reducers/index.d.ts +24 -0
  69. package/development/reducers/index.d.ts.map +1 -0
  70. package/development/reducers/settings.d.ts +17 -0
  71. package/development/reducers/settings.d.ts.map +1 -0
  72. package/development/reducers/settings.js +48 -35
  73. package/development/reducers/storage.d.ts +17 -0
  74. package/development/reducers/storage.d.ts.map +1 -0
  75. package/development/reducers/storage.js +24 -24
  76. package/development/selectors/index.d.ts +3 -0
  77. package/development/selectors/index.d.ts.map +1 -0
  78. package/development/selectors/settings.d.ts +52 -0
  79. package/development/selectors/settings.d.ts.map +1 -0
  80. package/development/selectors/settings.js +21 -11
  81. package/development/selectors/storage.d.ts +10 -0
  82. package/development/selectors/storage.d.ts.map +1 -0
  83. package/development/selectors/storage.js +6 -18
  84. package/development/streams/index.d.ts +2 -0
  85. package/development/streams/index.d.ts.map +1 -0
  86. package/development/streams/insets.d.ts +8 -0
  87. package/development/streams/insets.d.ts.map +1 -0
  88. package/development/streams/insets.js +1 -3
  89. package/development/subscriptions/index.d.ts +15 -0
  90. package/development/subscriptions/index.d.ts.map +1 -0
  91. package/development/subscriptions/index.js +6 -2
  92. package/development/types/development.d.ts +68 -0
  93. package/development/types/development.d.ts.map +1 -0
  94. package/development/types/development.js +1 -0
  95. package/development/types/index.d.ts +2 -0
  96. package/development/types/index.d.ts.map +1 -0
  97. package/development/types/index.js +1 -0
  98. package/package.json +7 -7
  99. package/page/components/Widgets/Widget.d.ts.map +1 -1
  100. package/styles/theme/createDefaultThemeOptions/index.d.ts.map +1 -1
  101. package/styles/theme/createDefaultThemeOptions/index.js +5 -0
  102. package/styles/theme/providers/ThemeProvider.d.ts.map +1 -1
  103. package/styles/theme/providers/ThemeProvider.js +11 -4
@@ -1,24 +1,25 @@
1
1
  import { createSelector } from 'reselect';
2
2
  import MobileDetect from 'mobile-detect';
3
3
  import { isDev as isDevelopment, hasSGJavaScriptBridge } from '@shopgate/engage/core/helpers';
4
+ import { DEFAULT_DEVELOPMENT_SETTINGS } from "../reducers/settings";
4
5
  const md = new MobileDetect(navigator.userAgent);
5
6
 
6
7
  /**
7
- * Retrieves the development settings state from the store.
8
- * @param {Object} state The current application state.
9
- * @return {Object} The development settings state.
8
+ * Retrieves the development settings state from the store. Falls back to the defaults when the
9
+ * slice is not present - the theme provider reads these on every render, including in tests and
10
+ * hosts that do not register the development reducers.
11
+ * @param state The current application state.
12
+ * @returns The development settings state.
10
13
  */
11
- const getState = state => state.development.settings;
14
+ const getState = state => state?.development?.settings ?? DEFAULT_DEVELOPMENT_SETTINGS;
12
15
 
13
16
  /**
14
17
  * Creates a selector to determine if development mode is enabled.
15
- * @type {(state: any) => boolean}
16
18
  */
17
- export const getIsDev = createSelector(() => isDevelopment);
19
+ export const getIsDev = createSelector(_state => isDevelopment, isDev => isDev);
18
20
 
19
21
  /**
20
22
  * Creates a selector to determine if the simulated iOS insets are supposed to be shown.
21
- * @type {(state: any) => boolean}
22
23
  */
23
24
  export const getAreInsetsVisible = createSelector(getIsDev, getState, (isDev, settings) => {
24
25
  if (!isDev) {
@@ -29,7 +30,6 @@ export const getAreInsetsVisible = createSelector(getIsDev, getState, (isDev, se
29
30
 
30
31
  /**
31
32
  * Creates a selector to determine if the inset highlight is visible.
32
- * @type {(state: any) => boolean}
33
33
  */
34
34
  export const getIsInsetHighlightVisible = createSelector(getIsDev, getState, (isDev, settings) => {
35
35
  if (!isDev) {
@@ -40,7 +40,6 @@ export const getIsInsetHighlightVisible = createSelector(getIsDev, getState, (is
40
40
 
41
41
  /**
42
42
  * Creates a selector to check if simulated safe area insets are supposed to be injected.
43
- * @type {(state: any) => boolean}
44
43
  */
45
44
  export const getAreSimulatedInsetsInjected = createSelector(getIsDev, getAreInsetsVisible, (isDev, insetsVisible) => {
46
45
  // No insets injected if the app is not in development mode.
@@ -64,6 +63,17 @@ export const getAreSimulatedInsetsInjected = createSelector(getIsDev, getAreInse
64
63
 
65
64
  /**
66
65
  * Creates a selector to determine if the CMS2 preview is enabled.
67
- * @type {(state: any) => boolean}
68
66
  */
69
- export const getIsCMS2PreviewEnabled = createSelector(getState, settings => !!settings.cms2PreviewEnabled);
67
+ export const getIsCMS2PreviewEnabled = createSelector(getState, settings => !!settings.cms2PreviewEnabled);
68
+
69
+ /**
70
+ * Creates a selector to determine if a color scheme may be selected without the app settings
71
+ * allowing it. Development only - in production the merchant's appearance setting is the only
72
+ * thing that may enable it.
73
+ */
74
+ export const getIsColorSchemeSelectionEnabled = createSelector(getIsDev, getState, (isDev, settings) => {
75
+ if (!isDev) {
76
+ return false;
77
+ }
78
+ return !!settings.colorSchemeSelectionEnabled;
79
+ });
@@ -0,0 +1,10 @@
1
+ import type { DevelopmentState, DevelopmentStorageState } from '../types';
2
+ /**
3
+ * Creates a selector that returns the current status bar style object from the storage.
4
+ */
5
+ export declare const getStatusBarStyleStorage: ((state: DevelopmentState) => import("../types").StatusBarStyle) & import("reselect").OutputSelectorFields<(args_0: DevelopmentStorageState) => import("../types").StatusBarStyle, {
6
+ clearCache: () => void;
7
+ }> & {
8
+ clearCache: () => void;
9
+ };
10
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../development/selectors/storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAW1E;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;CAGpC,CAAC"}
@@ -1,26 +1,14 @@
1
1
  import { createSelector } from 'reselect';
2
-
3
- /**
4
- * Retrieves the development storage state from the store.
5
- * @param {Object} state The current application state.
6
- * @return {Object} The development storage state.
7
- */
8
- const getState = state => state.development.storage;
9
-
10
- /**
11
- * @typedef {Object} StatusBarStyleStyles
12
- * @property {string} statusBarBackground Current background color of the app bar
13
- */
14
-
2
+ import { DEFAULT_DEVELOPMENT_STORAGE } from "../reducers/storage";
15
3
  /**
16
- * @typedef {Object} StatusBarStyle
17
- * @property {boolean} isDefault Whether the style is the default one which was initially applied
18
- * @property {"light"|"dark"} statusBarStyle The status style for the iOS status bar
19
- * @property {StatusBarStyleStyles} styles Additional styles for the status bar
4
+ * Retrieves the development storage state from the store. Falls back to the defaults when the
5
+ * slice is not present, for the same reason the settings selectors do.
6
+ * @param state The current application state.
7
+ * @returns The development storage state.
20
8
  */
9
+ const getState = state => state?.development?.storage ?? DEFAULT_DEVELOPMENT_STORAGE;
21
10
 
22
11
  /**
23
12
  * Creates a selector that returns the current status bar style object from the storage.
24
- * @type {(state: any) => StatusBarStyle}
25
13
  */
26
14
  export const getStatusBarStyleStorage = createSelector(getState, state => state.statusBarStyle);
@@ -0,0 +1,2 @@
1
+ export * from './insets';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../development/streams/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { DevelopmentSettingsAction } from '../action-creators/settings';
2
+ /**
3
+ * Gets triggered after the simulated page insets were updated.
4
+ */
5
+ export declare const simulatedPageInsetsDidUpdate$: import("rxjs/Observable").Observable<{
6
+ action: DevelopmentSettingsAction;
7
+ }>;
8
+ //# sourceMappingURL=insets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insets.d.ts","sourceRoot":"","sources":["../../../development/streams/insets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,6BAA6B;YACT,yBAAyB;EACN,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import { main$ } from '@shopgate/engage/core/streams';
2
2
  import { DEVELOPMENT_TOOLS_TOGGLE_INSETS } from "../constants";
3
-
4
3
  /**
5
- * Gets triggered after the simulated page insets were updated
6
- * @type {Observable}
4
+ * Gets triggered after the simulated page insets were updated.
7
5
  */
8
6
  export const simulatedPageInsetsDidUpdate$ = main$.filter(({
9
7
  action
@@ -0,0 +1,15 @@
1
+ import { appWillStart$ } from '@shopgate/engage/core/streams';
2
+ /**
3
+ * The subset of the subscription helpers this module uses.
4
+ */
5
+ interface SubscriptionContext {
6
+ dispatch: (action: unknown) => void;
7
+ }
8
+ type Subscribe = (stream: typeof appWillStart$, callback: (context: SubscriptionContext) => void) => void;
9
+ /**
10
+ * Development subscriptions.
11
+ * @param subscribe The subscribe function.
12
+ */
13
+ export default function development(subscribe: Subscribe): void;
14
+ export {};
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../development/subscriptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAK9D;;GAEG;AACH,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC;AAED,KAAK,SAAS,GAAG,CACf,MAAM,EAAE,OAAO,aAAa,EAC5B,QAAQ,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,KAC7C,IAAI,CAAC;AAEV;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,SAAS,EAAE,SAAS,QAQvD"}
@@ -3,8 +3,12 @@ import { UIEvents } from '@shopgate/engage/core/events';
3
3
  import { updateStatusBarStyleStorage } from '@shopgate/engage/development/action-creators';
4
4
 
5
5
  /**
6
- * Development subscriptions
7
- * @param {Function} subscribe The subscribe function
6
+ * The subset of the subscription helpers this module uses.
7
+ */
8
+
9
+ /**
10
+ * Development subscriptions.
11
+ * @param subscribe The subscribe function.
8
12
  */
9
13
  export default function development(subscribe) {
10
14
  subscribe(appWillStart$, ({
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Additional styles the app sends along with a status bar style update.
3
+ */
4
+ export interface StatusBarStyleStyles {
5
+ /**
6
+ * Current background color of the app bar.
7
+ */
8
+ statusBarBackground?: string;
9
+ }
10
+ /**
11
+ * The status bar style the app last reported through the `devInternalUpdateStatusBarStyle` event.
12
+ */
13
+ export interface StatusBarStyle {
14
+ /**
15
+ * Whether the style is the default one which was initially applied.
16
+ */
17
+ isDefault?: boolean;
18
+ /**
19
+ * The status style for the iOS status bar.
20
+ */
21
+ statusBarStyle?: 'light' | 'dark' | 'none';
22
+ /**
23
+ * Additional styles for the status bar.
24
+ */
25
+ styles?: StatusBarStyleStyles;
26
+ }
27
+ /**
28
+ * Settings the development tools maintain. Everything but the CMS 2.0 preview is development only -
29
+ * the reducer refuses to write those outside a development build.
30
+ */
31
+ export interface DevelopmentSettingsState {
32
+ /**
33
+ * Whether simulated iOS safe area insets are shown. `null` while nobody decided, which lets
34
+ * simulated iOS devices default to showing them.
35
+ */
36
+ showInsets: boolean | null;
37
+ /**
38
+ * Whether the simulated safe area insets are highlighted.
39
+ */
40
+ showInsetHighlight: boolean;
41
+ /**
42
+ * Whether the CMS 2.0 preview is enabled.
43
+ */
44
+ cms2PreviewEnabled: boolean;
45
+ /**
46
+ * Whether a color scheme may be selected without the app settings allowing it.
47
+ */
48
+ colorSchemeSelectionEnabled: boolean;
49
+ }
50
+ /**
51
+ * Values the development tools store for inspection rather than to drive behaviour.
52
+ */
53
+ export interface DevelopmentStorageState {
54
+ /**
55
+ * The status bar style the app last reported.
56
+ */
57
+ statusBarStyle: StatusBarStyle;
58
+ }
59
+ /**
60
+ * The slice of the application state the development selectors read from.
61
+ */
62
+ export interface DevelopmentState {
63
+ development: {
64
+ settings: DevelopmentSettingsState;
65
+ storage: DevelopmentStorageState;
66
+ };
67
+ }
68
+ //# sourceMappingURL=development.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development.d.ts","sourceRoot":"","sources":["../../../development/types/development.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3C;;OAEG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,2BAA2B,EAAE,OAAO,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,cAAc,EAAE,cAAc,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE;QACX,QAAQ,EAAE,wBAAwB,CAAC;QACnC,OAAO,EAAE,uBAAuB,CAAC;KAClC,CAAC;CACH"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { DevelopmentSettingsState, DevelopmentState, DevelopmentStorageState, StatusBarStyle, StatusBarStyleStyles, } from './development';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../development/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,GACrB,MAAM,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.32.0-beta.10",
3
+ "version": "7.32.0-beta.11",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -18,12 +18,12 @@
18
18
  "dependencies": {
19
19
  "@emotion/react": "^11.14.0",
20
20
  "@shopgate/native-modules": "1.0.0-beta.34",
21
- "@shopgate/pwa-common": "7.32.0-beta.10",
22
- "@shopgate/pwa-common-commerce": "7.32.0-beta.10",
23
- "@shopgate/pwa-core": "7.32.0-beta.10",
24
- "@shopgate/pwa-ui-ios": "7.32.0-beta.10",
25
- "@shopgate/pwa-ui-material": "7.32.0-beta.10",
26
- "@shopgate/pwa-ui-shared": "7.32.0-beta.10",
21
+ "@shopgate/pwa-common": "7.32.0-beta.11",
22
+ "@shopgate/pwa-common-commerce": "7.32.0-beta.11",
23
+ "@shopgate/pwa-core": "7.32.0-beta.11",
24
+ "@shopgate/pwa-ui-ios": "7.32.0-beta.11",
25
+ "@shopgate/pwa-ui-material": "7.32.0-beta.11",
26
+ "@shopgate/pwa-ui-shared": "7.32.0-beta.11",
27
27
  "@stripe/react-stripe-js": "^1.16.5",
28
28
  "@stripe/stripe-js": "^1.44.1",
29
29
  "@virtuous/conductor": "~2.5.0",
@@ -1 +1 @@
1
- {"version":3,"file":"Widget.d.ts","sourceRoot":"","sources":["../../../../page/components/Widgets/Widget.tsx"],"names":[],"mappings":"AAAA,OAAO,EACkB,KAAK,aAAa,EAC1C,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAiDhD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAA;KAAE,CAAC,CAAC;IAC1E;;OAEG;IACH,UAAU,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,QAAA,MAAM,MAAM,GAAI,wEAKb,WAAW,uCAqEb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Widget.d.ts","sourceRoot":"","sources":["../../../../page/components/Widgets/Widget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAQlE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAiDhD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAA;KAAE,CAAC,CAAC;IAC1E;;OAEG;IACH,UAAU,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,QAAA,MAAM,MAAM,GAAI,wEAKb,WAAW,uCAqEb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createDefaultThemeOptions/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,YAmN3C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createDefaultThemeOptions/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,YAwN3C,CAAC"}
@@ -99,6 +99,11 @@ export const createDefaultThemeOptions = () => ({
99
99
  background: settings?.['@shopgate/engage/components/AppBar']?.background || '#FFF'
100
100
  }
101
101
  },
102
+ discountBadge: {
103
+ vars: {
104
+ background: 'var(--sg-palette-primary-main)'
105
+ }
106
+ },
102
107
  ratingStars: {
103
108
  vars: {
104
109
  filled: `var(--rating-stars-filled, ${getCSSCustomProp('--color-primary')})`,
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../styles/theme/providers/ThemeProvider.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACgB,KAAK,aAAa,EACxC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAuH9C,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAA;mFArHE,kBAAkB;AAuHrB,wBAAmC"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../styles/theme/providers/ThemeProvider.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACgB,KAAK,aAAa,EACxC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA4H9C,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAA;mFA1HE,kBAAkB;AA4HrB,wBAAmC"}
@@ -9,6 +9,7 @@ import { FrontendSettingsPreviewBridge } from '@shopgate/engage/admin-preview/co
9
9
  // Imported via its module path rather than a settings barrel, to keep this module out of an import
10
10
  // cycle - the settings types reach back into the "styles/theme" barrel, which exports this file.
11
11
  import { getCanSelectColorScheme, getDefaultColorSchemeMode } from '@shopgate/engage/settings/selectors/appSettings';
12
+ import { getIsColorSchemeSelectionEnabled } from '@shopgate/engage/development/selectors';
12
13
  import ActiveBreakpointProvider from "./ActiveBreakpointProvider";
13
14
  import { ColorSchemeContext } from "./ColorSchemeContext";
14
15
  import { ThemeContext } from "./ThemeContext";
@@ -31,13 +32,19 @@ const ThemeProvider = ({
31
32
  // Otherwise the provider could expose and accept a scheme (e.g. `dark`) the theme doesn't style,
32
33
  // and setActiveColorScheme would flip the root selector to an unstyled scheme.
33
34
  const colorSchemes = useMemo(() => Object.keys(theme.colorSchemes), [theme]);
34
- const defaultMode = useSelector(getDefaultColorSchemeMode);
35
+ const configuredMode = useSelector(getDefaultColorSchemeMode);
35
36
  const isColorSchemeSelectable = useSelector(getCanSelectColorScheme);
36
37
 
38
+ // The development setting simulates the `selectable` appearance rather than lifting the gate on
39
+ // its own, so a development build resolves the scheme along the very same path a shop does. It is
40
+ // false outside development builds, where the merchant's setting stays the only input.
41
+ const isSelectionEnabledForDevelopment = useSelector(getIsColorSchemeSelectionEnabled);
42
+
37
43
  // Whether the merchant lets visitors choose. A binding `light` or `dark` rules a pick out, so one
38
- // left over from when selecting still was allowed does not keep overriding it. Development builds
39
- // have no app settings to configure at all, so both schemes stay reachable there.
40
- const canSelectColorScheme = isColorSchemeSelectable || process.env.NODE_ENV === 'development';
44
+ // left over from when selecting still was allowed does not keep overriding it - and with it the
45
+ // operating system, which only ever reaches the scheme through a `system` pick.
46
+ const canSelectColorScheme = isColorSchemeSelectable || isSelectionEnabledForDevelopment;
47
+ const defaultMode = isSelectionEnabledForDevelopment ? COLOR_SCHEME_SYSTEM : configuredMode;
41
48
  const prefersDarkColorScheme = useMatchMedia('(prefers-color-scheme: dark)');
42
49
  const systemColorScheme = prefersDarkColorScheme ? 'dark' : 'light';
43
50
  const [pickedMode, setPersistedMode] = useLocalStorage('persistedColorScheme', {