@shopgate/engage 7.32.0-beta.10 → 7.32.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/hooks/events/appEvents.d.ts +31 -46
- package/core/hooks/events/appEvents.d.ts.map +1 -0
- package/core/hooks/events/appEvents.js +26 -29
- package/core/hooks/events/index.d.ts +4 -4
- package/core/hooks/events/index.d.ts.map +1 -1
- package/core/hooks/events/useLongPress.d.ts +55 -58
- package/core/hooks/events/useLongPress.d.ts.map +1 -0
- package/core/hooks/events/useLongPress.js +23 -16
- package/core/hooks/events/usePressHandler.d.ts +32 -21
- package/core/hooks/events/usePressHandler.d.ts.map +1 -1
- package/core/hooks/events/usePressHandler.js +12 -10
- package/core/hooks/events/useScrollDirectionChange.d.ts +72 -61
- package/core/hooks/events/useScrollDirectionChange.d.ts.map +1 -0
- package/core/hooks/events/useScrollDirectionChange.js +36 -43
- package/development/action-creators/index.d.ts +3 -0
- package/development/action-creators/index.d.ts.map +1 -0
- package/development/action-creators/settings.d.ts +45 -0
- package/development/action-creators/settings.d.ts.map +1 -0
- package/development/action-creators/settings.js +21 -10
- package/development/action-creators/storage.d.ts +17 -0
- package/development/action-creators/storage.d.ts.map +1 -0
- package/development/action-creators/storage.js +7 -4
- package/development/components/ClientInformation/ClientInformation.d.ts +6 -0
- package/development/components/ClientInformation/ClientInformation.d.ts.map +1 -0
- package/development/components/ClientInformation/ClientInformation.js +7 -4
- package/development/components/ClientInformation/actions.d.ts +6 -0
- package/development/components/ClientInformation/actions.d.ts.map +1 -0
- package/development/components/ClientInformation/actions.js +1 -1
- package/development/components/ClientInformation/index.d.ts +2 -0
- package/development/components/ClientInformation/index.d.ts.map +1 -0
- package/development/components/DevelopmentSettings/DevelopmentSettings.d.ts +16 -0
- package/development/components/DevelopmentSettings/DevelopmentSettings.d.ts.map +1 -0
- package/development/components/DevelopmentSettings/DevelopmentSettings.js +41 -28
- package/development/components/DevelopmentSettings/index.d.ts +2 -0
- package/development/components/DevelopmentSettings/index.d.ts.map +1 -0
- package/development/components/DevelopmentTools/DevelopmentTools.d.ts +10 -0
- package/development/components/DevelopmentTools/DevelopmentTools.d.ts.map +1 -0
- package/development/components/DevelopmentTools/DevelopmentTools.js +8 -8
- package/development/components/DevelopmentTools/Shortcuts.d.ts +6 -0
- package/development/components/DevelopmentTools/Shortcuts.d.ts.map +1 -0
- package/development/components/DevelopmentTools/Shortcuts.js +0 -1
- package/development/components/DevelopmentTools/hooks.d.ts +8 -0
- package/development/components/DevelopmentTools/hooks.d.ts.map +1 -0
- package/development/components/DevelopmentTools/hooks.js +2 -3
- package/development/components/DevelopmentTools/index.d.ts +2 -0
- package/development/components/DevelopmentTools/index.d.ts.map +1 -0
- package/development/components/SimulatedInsets/SimulatedInsetBottom.d.ts +7 -0
- package/development/components/SimulatedInsets/SimulatedInsetBottom.d.ts.map +1 -0
- package/development/components/SimulatedInsets/SimulatedInsetBottom.js +1 -6
- package/development/components/SimulatedInsets/SimulatedInsetTop.d.ts +7 -0
- package/development/components/SimulatedInsets/SimulatedInsetTop.d.ts.map +1 -0
- package/development/components/SimulatedInsets/SimulatedInsetTop.js +2 -7
- package/development/components/SimulatedInsets/SimulatedInsets.d.ts +13 -0
- package/development/components/SimulatedInsets/SimulatedInsets.d.ts.map +1 -0
- package/development/components/SimulatedInsets/SimulatedInsets.js +2 -7
- package/development/components/SimulatedInsets/index.d.ts +2 -0
- package/development/components/SimulatedInsets/index.d.ts.map +1 -0
- package/development/components/SimulatedInsets/types.d.ts +15 -0
- package/development/components/SimulatedInsets/types.d.ts.map +1 -0
- package/development/components/SimulatedInsets/types.js +1 -0
- package/development/components/index.d.ts +3 -0
- package/development/components/index.d.ts.map +1 -0
- package/development/constants/actionTypes.d.ts +6 -0
- package/development/constants/actionTypes.d.ts.map +1 -0
- package/development/constants/actionTypes.js +2 -1
- package/development/constants/index.d.ts +2 -0
- package/development/constants/index.d.ts.map +1 -0
- package/development/reducers/index.d.ts +24 -0
- package/development/reducers/index.d.ts.map +1 -0
- package/development/reducers/settings.d.ts +17 -0
- package/development/reducers/settings.d.ts.map +1 -0
- package/development/reducers/settings.js +48 -35
- package/development/reducers/storage.d.ts +17 -0
- package/development/reducers/storage.d.ts.map +1 -0
- package/development/reducers/storage.js +24 -24
- package/development/selectors/index.d.ts +3 -0
- package/development/selectors/index.d.ts.map +1 -0
- package/development/selectors/settings.d.ts +52 -0
- package/development/selectors/settings.d.ts.map +1 -0
- package/development/selectors/settings.js +21 -11
- package/development/selectors/storage.d.ts +10 -0
- package/development/selectors/storage.d.ts.map +1 -0
- package/development/selectors/storage.js +6 -18
- package/development/streams/index.d.ts +2 -0
- package/development/streams/index.d.ts.map +1 -0
- package/development/streams/insets.d.ts +8 -0
- package/development/streams/insets.d.ts.map +1 -0
- package/development/streams/insets.js +1 -3
- package/development/subscriptions/index.d.ts +15 -0
- package/development/subscriptions/index.d.ts.map +1 -0
- package/development/subscriptions/index.js +6 -2
- package/development/types/development.d.ts +68 -0
- package/development/types/development.d.ts.map +1 -0
- package/development/types/development.js +1 -0
- package/development/types/index.d.ts +2 -0
- package/development/types/index.d.ts.map +1 -0
- package/development/types/index.js +1 -0
- package/package.json +7 -7
- package/page/components/Widgets/Widget.d.ts.map +1 -1
- package/page/components/Widgets/Widget.js +12 -15
- package/page/components/Widgets/WidgetContext.d.ts +3 -3
- package/page/components/Widgets/WidgetContext.d.ts.map +1 -1
- package/page/components/Widgets/WidgetProvider.d.ts +6 -2
- package/page/components/Widgets/WidgetProvider.d.ts.map +1 -1
- package/page/components/Widgets/WidgetProvider.js +3 -3
- package/page/components/Widgets/constants.d.ts +13 -0
- package/page/components/Widgets/constants.d.ts.map +1 -1
- package/page/components/Widgets/constants.js +21 -1
- package/page/components/Widgets/helpers.d.ts +19 -0
- package/page/components/Widgets/helpers.d.ts.map +1 -1
- package/page/components/Widgets/helpers.js +50 -0
- package/page/components/Widgets/types.d.ts +31 -5
- package/page/components/Widgets/types.d.ts.map +1 -1
- package/page/widget.config.schema.json +54 -0
- package/page/widgets/HeroBanner/config.json +6 -0
- package/page/widgets/Image/config.json +6 -0
- package/page/widgets/ImageRow/config.json +6 -0
- package/page/widgets/ImageSlider/config.json +6 -0
- package/page/widgets/ImageSlider/hooks.js +4 -2
- package/page/widgets/README.md +92 -0
- package/page/widgets/Video/config.json +6 -0
- package/settings/reducers/appSettings.d.ts.map +1 -1
- package/settings/reducers/appSettings.js +24 -1
- package/settings/selectors/appSettings.d.ts +8 -0
- package/settings/selectors/appSettings.d.ts.map +1 -1
- package/settings/selectors/appSettings.js +5 -0
- package/settings/types/appSettings.d.ts +35 -0
- package/settings/types/appSettings.d.ts.map +1 -1
- package/settings/types/appSettings.js +9 -0
- package/styles/theme/createDefaultThemeOptions/index.d.ts.map +1 -1
- package/styles/theme/createDefaultThemeOptions/index.js +5 -0
- package/styles/theme/providers/ThemeProvider.d.ts.map +1 -1
- package/styles/theme/providers/ThemeProvider.js +11 -4
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { memo } from 'react';
|
|
3
2
|
import { isDev } from '@shopgate/engage/core/helpers';
|
|
4
3
|
import Shortcuts from "./Shortcuts";
|
|
5
4
|
import SimulatedInsets from "../SimulatedInsets";
|
|
6
|
-
|
|
5
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
6
|
/**
|
|
8
7
|
* Provides development tools for the app.
|
|
9
|
-
* @param {Object} props The component props.
|
|
10
|
-
* @param {React.ReactNode} props.children The child components.
|
|
11
|
-
* @returns {JSX.Element}
|
|
12
8
|
*/
|
|
13
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
9
|
const DevelopmentTools = ({
|
|
15
10
|
children
|
|
16
11
|
}) => {
|
|
17
12
|
if (!isDev) {
|
|
18
|
-
|
|
13
|
+
// Wrapped rather than returned directly: children can be an array, which a component may not
|
|
14
|
+
// return under the React 17 types.
|
|
15
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
16
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
19
|
}
|
|
20
20
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
21
21
|
children: [/*#__PURE__*/_jsx(Shortcuts, {}), /*#__PURE__*/_jsx(SimulatedInsets, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shortcuts.d.ts","sourceRoot":"","sources":["../../../../development/components/DevelopmentTools/Shortcuts.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,QAAA,MAAM,SAAS,YASd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to handle a single keyboard shortcut.
|
|
3
|
+
* Supports both 'cmd' (meta) and 'ctrl' keys explicitly.
|
|
4
|
+
* @param shortcut Shortcut string using mac-style notation, e.g. 'cmd+i'.
|
|
5
|
+
* @param callback Function to call when the shortcut is triggered.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useShortcut(shortcut: string, callback: (event: KeyboardEvent) => void): void;
|
|
8
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../development/components/DevelopmentTools/hooks.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,QAoCrF"}
|
|
@@ -4,9 +4,8 @@ import { useEffect, useCallback } from 'react';
|
|
|
4
4
|
/**
|
|
5
5
|
* Hook to handle a single keyboard shortcut.
|
|
6
6
|
* Supports both 'cmd' (meta) and 'ctrl' keys explicitly.
|
|
7
|
-
*
|
|
8
|
-
* @param
|
|
9
|
-
* @param {Function} callback - Function to call when the shortcut is triggered.
|
|
7
|
+
* @param shortcut Shortcut string using mac-style notation, e.g. 'cmd+i'.
|
|
8
|
+
* @param callback Function to call when the shortcut is triggered.
|
|
10
9
|
*/
|
|
11
10
|
export function useShortcut(shortcut, callback) {
|
|
12
11
|
const normalizeShortcut = useCallback(() => shortcut.toLowerCase().split('+').map(k => k.trim()).sort().join('+'), [shortcut]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../development/components/DevelopmentTools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SimulatedInsetProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a simulated iOS bottom inset in development.
|
|
4
|
+
*/
|
|
5
|
+
declare const SimulatedInsetBottom: ({ highlightInset, onClick, ...props }: SimulatedInsetProps) => import("react").JSX.Element;
|
|
6
|
+
export default SimulatedInsetBottom;
|
|
7
|
+
//# sourceMappingURL=SimulatedInsetBottom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulatedInsetBottom.d.ts","sourceRoot":"","sources":["../../../../development/components/SimulatedInsets/SimulatedInsetBottom.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA4BnD;;GAEG;AACH,QAAA,MAAM,oBAAoB,GAAI,uCAI3B,mBAAmB,gCAiBrB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { useMemo } from 'react';
|
|
3
2
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
4
|
const useStyles = makeStyles()(theme => ({
|
|
@@ -30,10 +29,6 @@ const useStyles = makeStyles()(theme => ({
|
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* Renders a simulated iOS bottom inset in development.
|
|
33
|
-
* @param {Object} props The component props.
|
|
34
|
-
* @param {boolean} props.highlightInset Whether the inset is highlighted.
|
|
35
|
-
* @param {Function} props.onClick The function to call when the inset is clicked.
|
|
36
|
-
* @returns {JSX.Element}
|
|
37
32
|
*/
|
|
38
33
|
const SimulatedInsetBottom = ({
|
|
39
34
|
highlightInset,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SimulatedInsetProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a simulated iOS top inset in development.
|
|
4
|
+
*/
|
|
5
|
+
declare const SimulatedInsetTop: ({ highlightInset, onClick, ...props }: SimulatedInsetProps) => import("react").JSX.Element;
|
|
6
|
+
export default SimulatedInsetTop;
|
|
7
|
+
//# sourceMappingURL=SimulatedInsetTop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulatedInsetTop.d.ts","sourceRoot":"","sources":["../../../../development/components/SimulatedInsets/SimulatedInsetTop.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAuDnD;;GAEG;AACH,QAAA,MAAM,iBAAiB,GAAI,uCAIxB,mBAAmB,gCAuCrB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
3
2
|
import { useSelector } from 'react-redux';
|
|
4
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
4
|
import { getStatusBarStyleStorage } from '@shopgate/engage/development/selectors';
|
|
@@ -47,7 +46,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
47
46
|
|
|
48
47
|
/**
|
|
49
48
|
* Creates a human readable time string to mimic the iOS clock.
|
|
50
|
-
* @returns
|
|
49
|
+
* @returns The current time in a human readable format.
|
|
51
50
|
*/
|
|
52
51
|
const getTime = () => {
|
|
53
52
|
const now = new Date();
|
|
@@ -59,10 +58,6 @@ const getTime = () => {
|
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* Renders a simulated iOS top inset in development.
|
|
62
|
-
* @param {Object} props The component props.
|
|
63
|
-
* @param {boolean} props.highlightInset Whether the inset is highlighted.
|
|
64
|
-
* @param {Function} props.onClick The function to call when the inset is clicked.
|
|
65
|
-
* @returns {JSX.Element}
|
|
66
61
|
*/
|
|
67
62
|
const SimulatedInsetTop = ({
|
|
68
63
|
highlightInset,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface SimulatedInsetsProps {
|
|
3
|
+
/**
|
|
4
|
+
* The child components.
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Simulates iOS insets in development mode.
|
|
10
|
+
*/
|
|
11
|
+
declare const SimulatedInsets: ({ children }: SimulatedInsetsProps) => import("react").JSX.Element;
|
|
12
|
+
export default SimulatedInsets;
|
|
13
|
+
//# sourceMappingURL=SimulatedInsets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulatedInsets.d.ts","sourceRoot":"","sources":["../../../../development/components/SimulatedInsets/SimulatedInsets.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,QAAA,MAAM,eAAe,GAAI,cAAc,oBAAoB,gCAiC1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
2
|
import { useSelector, useDispatch } from 'react-redux';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { useLongPress } from '@shopgate/engage/core/hooks';
|
|
5
4
|
import { getAreSimulatedInsetsInjected, getIsInsetHighlightVisible } from '@shopgate/engage/development/selectors';
|
|
6
5
|
import { toggleInsetHighlight, toggleInsets } from '@shopgate/engage/development/action-creators';
|
|
7
6
|
import SimulatedInsetTop from "./SimulatedInsetTop";
|
|
8
7
|
import SimulatedInsetBottom from "./SimulatedInsetBottom";
|
|
9
|
-
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
/**
|
|
11
10
|
* Simulates iOS insets in development mode.
|
|
12
|
-
* @param {Object} props The component props.
|
|
13
|
-
* @param {React.ReactNode} props.children The child components.
|
|
14
|
-
* @returns {JSX.Element}
|
|
15
11
|
*/
|
|
16
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
12
|
const SimulatedInsets = ({
|
|
18
13
|
children
|
|
19
14
|
}) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../development/components/SimulatedInsets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props shared by the simulated top and bottom insets.
|
|
4
|
+
*/
|
|
5
|
+
export interface SimulatedInsetProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the inset is highlighted.
|
|
8
|
+
*/
|
|
9
|
+
highlightInset: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The function to call when the inset is clicked.
|
|
12
|
+
*/
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../development/components/SimulatedInsets/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACzE;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../development/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DEVELOPMENT_TOOLS_TOGGLE_INSETS = "DEVELOPMENT_TOOLS_TOGGLE_INSETS";
|
|
2
|
+
export declare const DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT = "DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT";
|
|
3
|
+
export declare const DEVELOPMENT_TOOLS_UPDATE_STATUS_BAR_STYLE_STORAGE = "DEVELOPMENT_TOOLS_UPDATE_STATUS_BAR_STYLE_STORAGE";
|
|
4
|
+
export declare const DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW = "DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW";
|
|
5
|
+
export declare const DEVELOPMENT_TOOLS_TOGGLE_COLOR_SCHEME_SELECTION = "DEVELOPMENT_TOOLS_TOGGLE_COLOR_SCHEME_SELECTION";
|
|
6
|
+
//# sourceMappingURL=actionTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionTypes.d.ts","sourceRoot":"","sources":["../../../development/constants/actionTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;AACjF,eAAO,MAAM,wCAAwC,6CAA6C,CAAC;AAEnG,eAAO,MAAM,iDAAiD,sDAAsD,CAAC;AAErH,eAAO,MAAM,qCAAqC,0CAA0C,CAAC;AAE7F,eAAO,MAAM,+CAA+C,oDAAoD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const DEVELOPMENT_TOOLS_TOGGLE_INSETS = 'DEVELOPMENT_TOOLS_TOGGLE_INSETS';
|
|
2
2
|
export const DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT = 'DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT';
|
|
3
3
|
export const DEVELOPMENT_TOOLS_UPDATE_STATUS_BAR_STYLE_STORAGE = 'DEVELOPMENT_TOOLS_UPDATE_STATUS_BAR_STYLE_STORAGE';
|
|
4
|
-
export const DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW = 'DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW';
|
|
4
|
+
export const DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW = 'DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW';
|
|
5
|
+
export const DEVELOPMENT_TOOLS_TOGGLE_COLOR_SCHEME_SELECTION = 'DEVELOPMENT_TOOLS_TOGGLE_COLOR_SCHEME_SELECTION';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../development/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: import("redux").Reducer<{
|
|
2
|
+
settings: import("../types").DevelopmentSettingsState;
|
|
3
|
+
storage: import("../types").DevelopmentStorageState;
|
|
4
|
+
}, import("redux").UnknownAction | {
|
|
5
|
+
readonly type: "DEVELOPMENT_TOOLS_TOGGLE_INSETS";
|
|
6
|
+
readonly visible: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
readonly type: "DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT";
|
|
9
|
+
readonly visible: boolean;
|
|
10
|
+
} | {
|
|
11
|
+
readonly type: "DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW";
|
|
12
|
+
readonly enabled: boolean;
|
|
13
|
+
} | {
|
|
14
|
+
readonly type: "DEVELOPMENT_TOOLS_TOGGLE_COLOR_SCHEME_SELECTION";
|
|
15
|
+
readonly enabled: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
readonly type: "DEVELOPMENT_TOOLS_UPDATE_STATUS_BAR_STYLE_STORAGE";
|
|
18
|
+
readonly style: import("../types").StatusBarStyle;
|
|
19
|
+
}, Partial<{
|
|
20
|
+
settings: import("../types").DevelopmentSettingsState | undefined;
|
|
21
|
+
storage: import("../types").DevelopmentStorageState | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
export default _default;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../development/reducers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,wBAGG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Reducer, UnknownAction } from 'redux';
|
|
2
|
+
import type { DevelopmentSettingsAction } from '../action-creators/settings';
|
|
3
|
+
import type { DevelopmentSettingsState } from '../types';
|
|
4
|
+
type SettingsAction = DevelopmentSettingsAction | UnknownAction;
|
|
5
|
+
/**
|
|
6
|
+
* The state the development settings start out with.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_DEVELOPMENT_SETTINGS: DevelopmentSettingsState;
|
|
9
|
+
/**
|
|
10
|
+
* The reducer for all development tools settings related states.
|
|
11
|
+
* @param state The application state.
|
|
12
|
+
* @param action The redux action.
|
|
13
|
+
* @returns The new state.
|
|
14
|
+
*/
|
|
15
|
+
declare const settingsReducer: Reducer<DevelopmentSettingsState, SettingsAction>;
|
|
16
|
+
export default settingsReducer;
|
|
17
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../development/reducers/settings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,KAAK,cAAc,GAAG,yBAAyB,GAAG,aAAa,CAAC;AAchE;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,wBAK1C,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,eAAe,EAAE,OAAO,CAAC,wBAAwB,EAAE,cAAc,CAsCrE,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -1,51 +1,64 @@
|
|
|
1
|
+
import "core-js/modules/es.array.includes.js";
|
|
1
2
|
import { produce } from 'immer';
|
|
2
3
|
import { isDev } from '@shopgate/engage/core/helpers';
|
|
3
|
-
import { DEVELOPMENT_TOOLS_TOGGLE_INSETS, DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT, DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW } from "../constants";
|
|
4
|
+
import { DEVELOPMENT_TOOLS_TOGGLE_INSETS, DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT, DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW, DEVELOPMENT_TOOLS_TOGGLE_COLOR_SCHEME_SELECTION } from "../constants";
|
|
5
|
+
const HANDLED_ACTION_TYPES = [DEVELOPMENT_TOOLS_TOGGLE_INSETS, DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT, DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW, DEVELOPMENT_TOOLS_TOGGLE_COLOR_SCHEME_SELECTION];
|
|
6
|
+
|
|
7
|
+
// Narrowing in one place, since `UnknownAction` types `type` as a plain string and would keep the
|
|
8
|
+
// switch below from discriminating the union on its own.
|
|
9
|
+
const isSettingsAction = action => HANDLED_ACTION_TYPES.includes(action.type);
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @property {boolean} showInsets
|
|
8
|
-
* @property {boolean} showInsetHighlight
|
|
12
|
+
* The state the development settings start out with.
|
|
9
13
|
*/
|
|
10
|
-
|
|
11
|
-
/** @type DevToolsSettingsState */
|
|
12
|
-
const initialState = {
|
|
14
|
+
export const DEFAULT_DEVELOPMENT_SETTINGS = {
|
|
13
15
|
showInsets: null,
|
|
14
16
|
showInsetHighlight: false,
|
|
15
|
-
cms2PreviewEnabled: false
|
|
17
|
+
cms2PreviewEnabled: false,
|
|
18
|
+
colorSchemeSelectionEnabled: false
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
/**
|
|
19
22
|
* The reducer for all development tools settings related states.
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @returns
|
|
23
|
+
* @param state The application state.
|
|
24
|
+
* @param action The redux action.
|
|
25
|
+
* @returns The new state.
|
|
23
26
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const settingsReducer = (state = DEFAULT_DEVELOPMENT_SETTINGS, action = {
|
|
28
|
+
type: ''
|
|
29
|
+
}) => produce(state, draft => {
|
|
30
|
+
if (!isSettingsAction(action)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
switch (action.type) {
|
|
34
|
+
case DEVELOPMENT_TOOLS_TOGGLE_INSETS:
|
|
35
|
+
{
|
|
36
|
+
if (isDev) {
|
|
37
|
+
draft.showInsets = action.visible;
|
|
33
38
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case DEVELOPMENT_TOOLS_TOGGLE_INSET_HIGHLIGHT:
|
|
42
|
+
{
|
|
43
|
+
if (isDev) {
|
|
44
|
+
draft.showInsetHighlight = action.visible;
|
|
40
45
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case DEVELOPMENT_TOOLS_TOGGLE_CMS2_PREVIEW:
|
|
49
|
+
{
|
|
50
|
+
draft.cms2PreviewEnabled = action.enabled;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case DEVELOPMENT_TOOLS_TOGGLE_COLOR_SCHEME_SELECTION:
|
|
54
|
+
{
|
|
55
|
+
if (isDev) {
|
|
56
|
+
draft.colorSchemeSelectionEnabled = action.enabled;
|
|
45
57
|
}
|
|
46
|
-
default:
|
|
47
58
|
break;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
59
|
+
}
|
|
60
|
+
default:
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
export default settingsReducer;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Reducer, UnknownAction } from 'redux';
|
|
2
|
+
import type { DevelopmentStorageAction } from '../action-creators/storage';
|
|
3
|
+
import type { DevelopmentStorageState } from '../types';
|
|
4
|
+
type StorageAction = DevelopmentStorageAction | UnknownAction;
|
|
5
|
+
/**
|
|
6
|
+
* The state the development storage starts out with.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_DEVELOPMENT_STORAGE: DevelopmentStorageState;
|
|
9
|
+
/**
|
|
10
|
+
* The reducer for all developer tools storage related states.
|
|
11
|
+
* @param state The application state.
|
|
12
|
+
* @param action The redux action.
|
|
13
|
+
* @returns The new state.
|
|
14
|
+
*/
|
|
15
|
+
declare const storageReducer: Reducer<DevelopmentStorageState, StorageAction>;
|
|
16
|
+
export default storageReducer;
|
|
17
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../development/reducers/storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,KAAK,aAAa,GAAG,wBAAwB,GAAG,aAAa,CAAC;AAO9D;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,uBAIzC,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,cAAc,EAAE,OAAO,CAAC,uBAAuB,EAAE,aAAa,CAiBlE,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { produce } from 'immer';
|
|
2
2
|
import { isDev } from '@shopgate/engage/core/helpers';
|
|
3
3
|
import { DEVELOPMENT_TOOLS_UPDATE_STATUS_BAR_STYLE_STORAGE } from "../constants";
|
|
4
|
+
// Narrowing in one place, since `UnknownAction` types `type` as a plain string and would keep the
|
|
5
|
+
// switch below from discriminating the union on its own.
|
|
6
|
+
const isStorageAction = action => action.type === DEVELOPMENT_TOOLS_UPDATE_STATUS_BAR_STYLE_STORAGE;
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @property {Object} statusBarStyle
|
|
9
|
+
* The state the development storage starts out with.
|
|
8
10
|
*/
|
|
9
|
-
|
|
10
|
-
/** @type DevToolsStorageState */
|
|
11
|
-
const initialState = {
|
|
11
|
+
export const DEFAULT_DEVELOPMENT_STORAGE = {
|
|
12
12
|
statusBarStyle: {
|
|
13
13
|
styles: {}
|
|
14
14
|
}
|
|
@@ -16,24 +16,24 @@ const initialState = {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* The reducer for all developer tools storage related states.
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
21
|
-
* @returns
|
|
19
|
+
* @param state The application state.
|
|
20
|
+
* @param action The redux action.
|
|
21
|
+
* @returns The new state.
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
default:
|
|
23
|
+
const storageReducer = (state = DEFAULT_DEVELOPMENT_STORAGE, action = {
|
|
24
|
+
type: ''
|
|
25
|
+
}) => produce(state, draft => {
|
|
26
|
+
if (!isDev || !isStorageAction(action)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
switch (action.type) {
|
|
30
|
+
case DEVELOPMENT_TOOLS_UPDATE_STATUS_BAR_STYLE_STORAGE:
|
|
31
|
+
{
|
|
32
|
+
draft.statusBarStyle = action.style;
|
|
35
33
|
break;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
34
|
+
}
|
|
35
|
+
default:
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export default storageReducer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../development/selectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { DevelopmentSettingsState, DevelopmentState } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a selector to determine if development mode is enabled.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getIsDev: ((state: DevelopmentState) => boolean) & import("reselect").OutputSelectorFields<(args_0: boolean) => boolean, {
|
|
6
|
+
clearCache: () => void;
|
|
7
|
+
}> & {
|
|
8
|
+
clearCache: () => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Creates a selector to determine if the simulated iOS insets are supposed to be shown.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getAreInsetsVisible: ((state: DevelopmentState) => boolean | null) & import("reselect").OutputSelectorFields<(args_0: boolean, args_1: DevelopmentSettingsState) => boolean | null, {
|
|
14
|
+
clearCache: () => void;
|
|
15
|
+
}> & {
|
|
16
|
+
clearCache: () => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Creates a selector to determine if the inset highlight is visible.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getIsInsetHighlightVisible: ((state: DevelopmentState) => boolean) & import("reselect").OutputSelectorFields<(args_0: boolean, args_1: DevelopmentSettingsState) => boolean, {
|
|
22
|
+
clearCache: () => void;
|
|
23
|
+
}> & {
|
|
24
|
+
clearCache: () => void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Creates a selector to check if simulated safe area insets are supposed to be injected.
|
|
28
|
+
*/
|
|
29
|
+
export declare const getAreSimulatedInsetsInjected: ((state: DevelopmentState) => boolean) & import("reselect").OutputSelectorFields<(args_0: boolean, args_1: boolean | null) => boolean, {
|
|
30
|
+
clearCache: () => void;
|
|
31
|
+
}> & {
|
|
32
|
+
clearCache: () => void;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Creates a selector to determine if the CMS2 preview is enabled.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getIsCMS2PreviewEnabled: ((state: DevelopmentState) => boolean) & import("reselect").OutputSelectorFields<(args_0: DevelopmentSettingsState) => boolean, {
|
|
38
|
+
clearCache: () => void;
|
|
39
|
+
}> & {
|
|
40
|
+
clearCache: () => void;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Creates a selector to determine if a color scheme may be selected without the app settings
|
|
44
|
+
* allowing it. Development only - in production the merchant's appearance setting is the only
|
|
45
|
+
* thing that may enable it.
|
|
46
|
+
*/
|
|
47
|
+
export declare const getIsColorSchemeSelectionEnabled: ((state: DevelopmentState) => boolean) & import("reselect").OutputSelectorFields<(args_0: boolean, args_1: DevelopmentSettingsState) => boolean, {
|
|
48
|
+
clearCache: () => void;
|
|
49
|
+
}> & {
|
|
50
|
+
clearCache: () => void;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../development/selectors/settings.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAc3E;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAGpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;CAQ/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;CAQtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;CAoBzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;CAGnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;;;;CAQ5C,CAAC"}
|