@shopgate/engage 7.32.0-beta.1 → 7.32.0-beta.3
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/README.md +0 -1
- package/admin-preview/constants/index.d.ts +0 -12
- package/admin-preview/constants/index.d.ts.map +1 -1
- package/admin-preview/constants/index.js +0 -16
- package/admin-preview/helpers/_internal/detection.d.ts +53 -0
- package/admin-preview/helpers/_internal/detection.d.ts.map +1 -0
- package/admin-preview/helpers/_internal/detection.js +93 -0
- package/admin-preview/helpers/index.d.ts +7 -0
- package/admin-preview/helpers/index.d.ts.map +1 -1
- package/admin-preview/helpers/index.js +12 -4
- package/cart/components/CartItem/CartItemProductProvider.connector.js +0 -2
- package/cart/components/CartItem/CartItemProductProvider.js +3 -30
- package/cart/components/CartItem/CartItemProductProvider.types.js +0 -1
- package/cart/components/PaymentBar/PaymentBarContent.js +1 -1
- package/components/Logo/index.d.ts.map +1 -1
- package/components/Logo/index.js +3 -6
- package/components/PickerUtilize/index.d.ts +2 -1
- package/components/PickerUtilize/index.d.ts.map +1 -1
- package/components/View/components/Above/index.d.ts.map +1 -1
- package/components/View/components/Above/index.js +3 -1
- package/components/View/components/Below/index.d.ts.map +1 -1
- package/components/View/components/Below/index.js +3 -1
- package/components/View/components/Content/index.d.ts +2 -1
- package/components/View/components/Content/index.d.ts.map +1 -1
- package/components/v2/ButtonBase/Ripple.d.ts +2 -1
- package/components/v2/ButtonBase/Ripple.d.ts.map +1 -1
- package/development/components/SimulatedInsets/SimulatedInsetBottom.js +3 -3
- package/development/components/SimulatedInsets/SimulatedInsetTop.js +2 -2
- package/favorites/components/Item/Item.js +5 -2
- package/favorites/components/Lists/Lists.js +13 -1
- package/locations/components/FulfillmentSheet/FulfillmentSheetContent.js +4 -8
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +1 -5
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +1 -5
- package/package.json +11 -11
- package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.js +2 -2
- package/page/constants/index.js +5 -3
- package/product/components/FilterBar/components/Content/components/FilterButton/index.js +2 -6
- package/product/components/FilterBar/components/Content/components/Sort/index.js +1 -5
- package/product/components/ProductName/ProductName.d.ts +1 -1
- package/product/components/ProductName/ProductName.d.ts.map +1 -1
- package/product/components/ProductName/ProductNameContent.d.ts +2 -1
- package/product/components/ProductName/ProductNameContent.d.ts.map +1 -1
- package/product/components/ProductRatingStars/ProductRatingStars.d.ts +1 -1
- package/product/components/RelationsSlider/RelationsSheet.js +1 -5
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +1 -1
- package/styles/index.d.ts +1 -1
- package/styles/index.d.ts.map +1 -1
- package/styles/index.js +1 -1
- package/styles/theme/createTheme/createComponents.d.ts +2 -2
- package/styles/theme/createTheme/createComponents.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.js +0 -1
- package/styles/theme/createTheme/createComponents.types.d.ts +20 -0
- package/styles/theme/createTheme/createComponents.types.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.types.js +20 -0
- package/styles/theme/createTheme/createSpacing.js +4 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts +2 -2
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts.map +1 -1
- package/styles/theme/createTheme/index.d.ts.map +1 -1
- package/styles/theme/createTheme/index.js +2 -1
- package/styles/theme/createTheme/layout.d.ts +23 -0
- package/styles/theme/createTheme/layout.d.ts.map +1 -0
- package/styles/theme/createTheme/layout.js +20 -0
- package/styles/theme/createTheme/transitions.d.ts +4 -0
- package/styles/theme/createTheme/transitions.js +3 -1
- package/styles/theme/createTheme/types.d.ts +25 -4
- package/styles/theme/createTheme/types.d.ts.map +1 -1
- package/styles/theme/createTheme/types.js +8 -1
- package/styles/theme/hocs/index.d.ts +2 -0
- package/styles/theme/hocs/index.d.ts.map +1 -0
- package/styles/theme/hocs/index.js +1 -0
- package/styles/theme/hocs/withTheme.d.ts +21 -0
- package/styles/theme/hocs/withTheme.d.ts.map +1 -0
- package/styles/theme/hocs/withTheme.js +33 -0
- package/styles/theme/index.d.ts +1 -0
- package/styles/theme/index.d.ts.map +1 -1
- package/styles/theme/index.js +2 -1
- package/styles/theme/providers/ActiveBreakpointProvider.d.ts +1 -1
- package/styles/theme/providers/ThemeProvider.d.ts +3 -3
- package/styles/theme/providers/ThemeProvider.d.ts.map +1 -1
- package/styles/theme/providers/ThemeProvider.js +11 -15
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { Theme } from '../createTheme';
|
|
3
|
+
/**
|
|
4
|
+
* Props injected by the `withTheme` HOC.
|
|
5
|
+
*/
|
|
6
|
+
export interface WithThemeProps {
|
|
7
|
+
/** The active styling theme (same object returned by `useTheme()`). */
|
|
8
|
+
theme: Theme;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Injects the styling theme as a `theme` prop into the wrapped component.
|
|
12
|
+
*
|
|
13
|
+
* Intended for legacy class components that cannot use the `useTheme` hook.
|
|
14
|
+
* For function components, prefer the `useTheme` hook instead.
|
|
15
|
+
*
|
|
16
|
+
* @param WrappedComponent The component to inject the theme into.
|
|
17
|
+
* @returns The wrapped component with `theme` supplied automatically.
|
|
18
|
+
*/
|
|
19
|
+
export declare function withTheme<P extends WithThemeProps>(WrappedComponent: ComponentType<P>): ComponentType<Omit<P, keyof WithThemeProps>>;
|
|
20
|
+
export default withTheme;
|
|
21
|
+
//# sourceMappingURL=withTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withTheme.d.ts","sourceRoot":"","sources":["../../../../styles/theme/hocs/withTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,cAAc,EAChD,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC,GACjC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,cAAc,CAAC,CAAC,CAe9C;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import useTheme from "../hooks/useTheme";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props injected by the `withTheme` HOC.
|
|
5
|
+
*/
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* Injects the styling theme as a `theme` prop into the wrapped component.
|
|
9
|
+
*
|
|
10
|
+
* Intended for legacy class components that cannot use the `useTheme` hook.
|
|
11
|
+
* For function components, prefer the `useTheme` hook instead.
|
|
12
|
+
*
|
|
13
|
+
* @param WrappedComponent The component to inject the theme into.
|
|
14
|
+
* @returns The wrapped component with `theme` supplied automatically.
|
|
15
|
+
*/
|
|
16
|
+
export function withTheme(WrappedComponent) {
|
|
17
|
+
/**
|
|
18
|
+
* The actual HOC.
|
|
19
|
+
* @param props The component props.
|
|
20
|
+
* @returns The wrapped component with the theme injected.
|
|
21
|
+
*/
|
|
22
|
+
const WithTheme = props => {
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
return /*#__PURE__*/_jsx(WrappedComponent, {
|
|
25
|
+
...props,
|
|
26
|
+
theme: theme
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
30
|
+
WithTheme.displayName = `WithTheme(${displayName})`;
|
|
31
|
+
return WithTheme;
|
|
32
|
+
}
|
|
33
|
+
export default withTheme;
|
package/styles/theme/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { default as ThemeProvider } from './providers/ThemeProvider';
|
|
|
2
2
|
export { createTheme } from './createTheme';
|
|
3
3
|
export type { Theme, Breakpoint, PaletteColorsWithMain } from './createTheme';
|
|
4
4
|
export { useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, } from './hooks';
|
|
5
|
+
export { withTheme, type WithThemeProps } from './hocs';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../styles/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../styles/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC"}
|
package/styles/theme/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as ThemeProvider } from "./providers/ThemeProvider";
|
|
2
2
|
export { createTheme } from "./createTheme";
|
|
3
|
-
export { useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme } from "./hooks";
|
|
3
|
+
export { useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme } from "./hooks";
|
|
4
|
+
export { withTheme } from "./hocs";
|
|
@@ -4,6 +4,6 @@ export declare const ActiveBreakpointContext: React.Context<Breakpoint | undefin
|
|
|
4
4
|
type ActiveBreakpointProviderProps = {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
declare const _default: React.MemoExoticComponent<({ children }: ActiveBreakpointProviderProps) =>
|
|
7
|
+
declare const _default: React.MemoExoticComponent<({ children }: ActiveBreakpointProviderProps) => React.JSX.Element>;
|
|
8
8
|
export default _default;
|
|
9
9
|
//# sourceMappingURL=ActiveBreakpointProvider.d.ts.map
|
|
@@ -3,11 +3,11 @@ export interface ColorSchemeContextValue {
|
|
|
3
3
|
/**
|
|
4
4
|
* The current color scheme (e.g., 'light' or 'dark')
|
|
5
5
|
*/
|
|
6
|
-
mode: ColorSchemeName;
|
|
6
|
+
mode: ColorSchemeName | null;
|
|
7
7
|
/**
|
|
8
8
|
* Function to update the color scheme
|
|
9
9
|
*/
|
|
10
|
-
setMode: React.Dispatch<React.SetStateAction<ColorSchemeName>>;
|
|
10
|
+
setMode: React.Dispatch<React.SetStateAction<ColorSchemeName | null>>;
|
|
11
11
|
}
|
|
12
12
|
export declare const ThemeContext: import("react").Context<Theme>;
|
|
13
13
|
export declare const ColorSchemeContext: import("react").Context<ColorSchemeContextValue>;
|
|
@@ -18,6 +18,6 @@ type ThemeProviderProps = {
|
|
|
18
18
|
theme: ThemeInternal;
|
|
19
19
|
children: React.ReactNode;
|
|
20
20
|
};
|
|
21
|
-
declare const _default: import("react").MemoExoticComponent<({ children, theme, }: ThemeProviderProps) => import("react
|
|
21
|
+
declare const _default: import("react").MemoExoticComponent<({ children, theme, }: ThemeProviderProps) => import("react").JSX.Element>;
|
|
22
22
|
export default _default;
|
|
23
23
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../styles/theme/providers/ThemeProvider.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtF,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../styles/theme/providers/ThemeProvider.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtF,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,YAAY,gCAAqC,CAAC;AAE/D,eAAO,MAAM,kBAAkB,kDAG7B,CAAC;AAwCH,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAA;mFAtCE,kBAAkB;AAwCrB,wBAAmC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext, memo, useMemo, useLayoutEffect } from 'react';
|
|
2
2
|
import useLocalStorage from '@shopgate/engage/core/hooks/useLocalStorage';
|
|
3
3
|
import { GlobalStyles } from '@shopgate/engage/styles';
|
|
4
|
-
import {
|
|
4
|
+
import { isFrontendSettingsAdminPreviewActive } from '@shopgate/engage/admin-preview/helpers';
|
|
5
5
|
import { FrontendSettingsPreviewBridge } from '@shopgate/engage/admin-preview/components';
|
|
6
6
|
import ActiveBreakpointProvider from "./ActiveBreakpointProvider";
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -30,20 +30,16 @@ const ThemeProvider = ({
|
|
|
30
30
|
theme.setActiveColorScheme(activeColorScheme);
|
|
31
31
|
}, [activeColorScheme, theme]);
|
|
32
32
|
const styleSheets = useMemo(() => theme.generateStyleSheets(), [theme]);
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
children: children
|
|
42
|
-
}), /*#__PURE__*/_jsx(GlobalStyles, {
|
|
43
|
-
styles: styleSheets
|
|
44
|
-
})]
|
|
33
|
+
return /*#__PURE__*/_jsxs(ColorSchemeContext.Provider, {
|
|
34
|
+
value: colorSchemeContextValue,
|
|
35
|
+
children: [isFrontendSettingsAdminPreviewActive() && /*#__PURE__*/_jsx(FrontendSettingsPreviewBridge, {}), /*#__PURE__*/_jsxs(ThemeContext.Provider, {
|
|
36
|
+
value: theme,
|
|
37
|
+
children: [/*#__PURE__*/_jsx(ActiveBreakpointProvider, {
|
|
38
|
+
children: children
|
|
39
|
+
}), /*#__PURE__*/_jsx(GlobalStyles, {
|
|
40
|
+
styles: styleSheets
|
|
45
41
|
})]
|
|
46
|
-
})
|
|
47
|
-
);
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
48
44
|
};
|
|
49
45
|
export default /*#__PURE__*/memo(ThemeProvider);
|