@shopgate/engage 7.32.0-beta.4 → 7.32.0-beta.6
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/back-in-stock/components/Subscriptions/components/Subscription/index.js +2 -5
- package/cart/components/CartItem/CartItemProductLayout.js +1 -1
- package/cart/components/CartItem/CartItemProductLayoutWide.js +2 -2
- package/category/components/CategoryImage/index.js +11 -15
- package/components/constants.d.ts +6 -0
- package/components/constants.d.ts.map +1 -0
- package/core/helpers/getFullImageSource.d.ts +5 -1
- package/core/helpers/getFullImageSource.d.ts.map +1 -1
- package/core/helpers/getFullImageSource.js +30 -14
- package/core/helpers/i18n.d.ts +4 -0
- package/core/helpers/i18n.d.ts.map +1 -1
- package/core/helpers/i18n.js +3 -0
- package/core/hooks/html/useLoadImage.d.ts +3 -3
- package/core/hooks/html/useLoadImage.d.ts.map +1 -1
- package/core/hooks/html/useLoadImage.js +2 -2
- package/favorites/components/Item/Item.d.ts.map +1 -1
- package/favorites/components/Item/Item.js +2 -5
- package/favorites/components/List/List.d.ts +1 -1
- package/locations/components/StoreList/StoreListProduct.js +2 -3
- package/package.json +8 -8
- package/page/components/NotFound.d.ts +7 -0
- package/page/components/NotFound.d.ts.map +1 -0
- package/page/components/NotFound.js +1 -2
- package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.d.ts +52 -0
- package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.d.ts.map +1 -0
- package/page/components/ResponsiveWidgetImage/index.d.ts +2 -0
- package/page/components/ResponsiveWidgetImage/index.d.ts.map +1 -0
- package/page/components/WidgetRichText/WidgetRichText.d.ts +25 -0
- package/page/components/WidgetRichText/WidgetRichText.d.ts.map +1 -0
- package/page/components/WidgetRichText/index.d.ts +2 -0
- package/page/components/WidgetRichText/index.d.ts.map +1 -0
- package/page/components/WidgetVideo/WidgetVideo.d.ts +43 -0
- package/page/components/WidgetVideo/WidgetVideo.d.ts.map +1 -0
- package/page/components/WidgetVideo/WidgetVideo.js +33 -39
- package/page/components/WidgetVideo/index.d.ts +2 -0
- package/page/components/WidgetVideo/index.d.ts.map +1 -0
- package/page/components/Widgets/Overlay.d.ts +17 -0
- package/page/components/Widgets/Overlay.d.ts.map +1 -0
- package/page/components/Widgets/Overlay.js +24 -38
- package/page/components/Widgets/Tooltip.d.ts +20 -0
- package/page/components/Widgets/Tooltip.d.ts.map +1 -0
- package/page/components/Widgets/Tooltip.js +6 -10
- package/page/components/Widgets/Widget.d.ts +32 -0
- package/page/components/Widgets/Widget.d.ts.map +1 -0
- package/page/components/Widgets/Widget.js +7 -18
- package/page/components/Widgets/WidgetContext.d.ts +32 -38
- package/page/components/Widgets/WidgetContext.d.ts.map +1 -0
- package/page/components/Widgets/WidgetContext.js +2 -8
- package/page/components/Widgets/WidgetProvider.d.ts +25 -0
- package/page/components/Widgets/WidgetProvider.d.ts.map +1 -0
- package/page/components/Widgets/WidgetProvider.js +5 -12
- package/page/components/Widgets/Widgets.d.ts +16 -0
- package/page/components/Widgets/Widgets.d.ts.map +1 -0
- package/page/components/Widgets/Widgets.js +5 -12
- package/page/components/Widgets/WidgetsPreviewContext.d.ts +21 -0
- package/page/components/Widgets/WidgetsPreviewContext.d.ts.map +1 -0
- package/page/components/Widgets/WidgetsPreviewContext.js +5 -7
- package/page/components/Widgets/WidgetsPreviewProvider.d.ts +18 -0
- package/page/components/Widgets/WidgetsPreviewProvider.d.ts.map +1 -0
- package/page/components/Widgets/WidgetsPreviewProvider.js +5 -6
- package/page/components/Widgets/constants.d.ts +5 -0
- package/page/components/Widgets/constants.d.ts.map +1 -0
- package/page/components/Widgets/constants.js +3 -1
- package/page/components/Widgets/events.d.ts +38 -0
- package/page/components/Widgets/events.d.ts.map +1 -0
- package/page/components/Widgets/events.js +8 -12
- package/page/components/Widgets/helpers.d.ts +50 -0
- package/page/components/Widgets/helpers.d.ts.map +1 -0
- package/page/components/Widgets/helpers.js +8 -13
- package/page/components/Widgets/hooks.d.ts +13 -0
- package/page/components/Widgets/hooks.d.ts.map +1 -0
- package/page/components/Widgets/hooks.js +13 -11
- package/page/components/Widgets/index.d.ts +3 -0
- package/page/components/Widgets/index.d.ts.map +1 -0
- package/page/components/Widgets/types.d.ts +111 -113
- package/page/components/Widgets/types.d.ts.map +1 -0
- package/page/components/Widgets/types.js +1 -0
- package/page/components/index.d.ts +5 -0
- package/page/components/index.d.ts.map +1 -0
- package/page/constants/actionTypes.d.ts +4 -0
- package/page/constants/actionTypes.d.ts.map +1 -0
- package/page/constants/index.d.ts +25 -0
- package/page/constants/index.d.ts.map +1 -0
- package/page/helpers/index.d.ts +67 -62
- package/page/helpers/index.d.ts.map +1 -0
- package/page/helpers/index.js +24 -25
- package/page/hooks/index.d.ts +54 -53
- package/page/hooks/index.d.ts.map +1 -0
- package/page/hooks/index.js +20 -15
- package/page/selectors/index.d.ts +32 -0
- package/page/selectors/index.d.ts.map +1 -0
- package/page/widgets/ProductSlider/ProductSlider.js +1 -15
- package/page/widgets/Video/Video.d.ts +6 -0
- package/page/widgets/Video/Video.d.ts.map +1 -0
- package/page/widgets/Video/Video.js +0 -2
- package/page/widgets/Video/hooks.d.ts +53 -0
- package/page/widgets/Video/hooks.d.ts.map +1 -0
- package/page/widgets/Video/hooks.js +4 -12
- package/page/widgets/Video/index.d.ts +2 -0
- package/page/widgets/Video/index.d.ts.map +1 -0
- package/product/components/Media/FeaturedMedia.js +7 -1
- package/product/components/Media/MediaImage.js +24 -23
- package/product/components/Media/MediaPlaceholder.js +4 -7
- package/product/components/MediaSlider/components/MediaImage/index.js +6 -2
- package/product/components/MediaSlider/constants.js +1 -12
- package/product/components/ProductCard/index.js +3 -10
- package/product/components/ProductGrid/components/Item/components/ItemImage/index.js +2 -5
- package/product/components/ProductGrid/constants.d.ts +2 -0
- package/product/components/ProductGrid/constants.d.ts.map +1 -0
- package/product/components/ProductGrid/constants.js +1 -0
- package/product/components/ProductGrid/hooks.d.ts +11 -0
- package/product/components/ProductGrid/hooks.d.ts.map +1 -0
- package/product/components/ProductGrid/hooks.js +48 -0
- package/product/components/ProductGrid/index.js +3 -6
- package/product/components/ProductGrid/spec.js +3 -0
- package/product/components/ProductImage/ProductImage.d.ts +42 -0
- package/product/components/ProductImage/ProductImage.d.ts.map +1 -0
- package/product/components/ProductImage/ProductImage.js +153 -0
- package/product/components/ProductImage/ProductImagePlaceholder.d.ts +23 -0
- package/product/components/ProductImage/ProductImagePlaceholder.d.ts.map +1 -0
- package/product/components/ProductImage/ProductImagePlaceholder.js +9 -14
- package/product/components/ProductImage/constants.d.ts +7 -0
- package/product/components/ProductImage/constants.d.ts.map +1 -0
- package/product/components/ProductImage/constants.js +6 -0
- package/product/components/ProductImage/hooks.d.ts +8 -0
- package/product/components/ProductImage/hooks.d.ts.map +1 -0
- package/product/components/ProductImage/hooks.js +32 -0
- package/product/components/ProductImage/index.d.ts +3 -0
- package/product/components/ProductImage/index.d.ts.map +1 -0
- package/product/components/ProductImage/index.js +1 -201
- package/product/components/ProductImage/spec.js +115 -60
- package/product/components/ProductList/components/Item/index.js +5 -3
- package/product/components/ProductRatingStars/ProductRatingStars.js +2 -4
- package/product/components/ProductSlider/constants.d.ts +3 -0
- package/product/components/ProductSlider/constants.d.ts.map +1 -0
- package/product/components/ProductSlider/constants.js +2 -0
- package/product/components/ProductSlider/hooks.d.ts +7 -0
- package/product/components/ProductSlider/hooks.d.ts.map +1 -0
- package/product/components/ProductSlider/hooks.js +40 -0
- package/product/components/ProductSlider/index.js +4 -6
- package/product/components/ProductSlider/spec.js +2 -2
- package/product/components/Rating/index.js +2 -4
- package/product/helpers/index.js +29 -11
- package/product/hooks/index.js +3 -1
- package/product/hooks/useLoadProductImage.js +4 -2
- package/product/hooks/useShowEmptyRatingStars.d.ts +7 -0
- package/product/hooks/useShowEmptyRatingStars.d.ts.map +1 -0
- package/product/hooks/useShowEmptyRatingStars.js +21 -0
- package/product/index.js +0 -1
- package/settings/constants/appSettings.d.ts +3 -0
- package/settings/constants/appSettings.d.ts.map +1 -1
- package/settings/constants/appSettings.js +6 -1
- package/settings/constants/imageSettings.d.ts +52 -0
- package/settings/constants/imageSettings.d.ts.map +1 -0
- package/settings/constants/imageSettings.js +69 -0
- package/settings/helpers/index.d.ts +3 -0
- package/settings/helpers/index.d.ts.map +1 -0
- package/settings/helpers/index.js +1 -0
- package/settings/helpers/resolveImageSettings.d.ts +70 -0
- package/settings/helpers/resolveImageSettings.d.ts.map +1 -0
- package/settings/helpers/resolveImageSettings.js +171 -0
- package/settings/helpers/toImageQuality.d.ts +7 -0
- package/settings/helpers/toImageQuality.d.ts.map +1 -0
- package/settings/helpers/toImageQuality.js +44 -0
- package/settings/helpers/toThumborColor.d.ts +15 -0
- package/settings/helpers/toThumborColor.d.ts.map +1 -0
- package/settings/helpers/toThumborColor.js +51 -0
- package/settings/hooks/index.d.ts +2 -0
- package/settings/hooks/index.d.ts.map +1 -0
- package/settings/hooks/index.js +1 -0
- package/settings/hooks/useImageSettings.d.ts +28 -0
- package/settings/hooks/useImageSettings.d.ts.map +1 -0
- package/settings/hooks/useImageSettings.js +39 -0
- package/settings/reducers/appSettings.d.ts.map +1 -1
- package/settings/reducers/appSettings.js +66 -4
- package/settings/reducers/index.d.ts +2 -2
- package/settings/selectors/appSettings.d.ts +46 -0
- package/settings/selectors/appSettings.d.ts.map +1 -1
- package/settings/selectors/appSettings.js +26 -1
- package/settings/types/appSettings.d.ts +156 -0
- package/settings/types/appSettings.d.ts.map +1 -1
- package/styles/reset/root.js +23 -4
- package/styles/reset/typographyCustomProps.d.ts +12 -0
- package/styles/reset/typographyCustomProps.d.ts.map +1 -0
- package/styles/reset/typographyCustomProps.js +11 -0
- package/styles/theme/createTheme/createTypography.js +1 -0
- package/styles/theme/createTheme/helpers/cssVarsParser.d.ts.map +1 -1
- package/styles/theme/createTheme/helpers/cssVarsParser.js +10 -3
- package/product/collections/index.js +0 -1
- package/product/components/EffectivityDates/constants.d.ts +0 -3
- package/product/components/EffectivityDates/constants.d.ts.map +0 -1
- package/product/components/EffectivityDates/helpers.d.ts +0 -6
- package/product/components/EffectivityDates/helpers.d.ts.map +0 -1
- package/product/components/Media/helpers.d.ts +0 -2
- package/product/components/Media/helpers.d.ts.map +0 -1
- package/product/components/ProductImage/connector.js +0 -12
- package/product/helpers/index.d.ts +0 -13
- package/product/helpers/index.d.ts.map +0 -1
- package/product/helpers/redirects.d.ts +0 -2
- package/product/helpers/redirects.d.ts.map +0 -1
- package/product/selectors/helpers/filterProperties.d.ts +0 -8
- package/product/selectors/helpers/filterProperties.d.ts.map +0 -1
- package/product/selectors/helpers/index.d.ts +0 -3
- package/product/selectors/helpers/index.d.ts.map +0 -1
- package/product/selectors/helpers/wrapMemoizedSelector.d.ts +0 -2
- package/product/selectors/helpers/wrapMemoizedSelector.d.ts.map +0 -1
- package/product/selectors/product.d.ts +0 -112
- package/product/selectors/product.d.ts.map +0 -1
|
@@ -2,131 +2,129 @@
|
|
|
2
2
|
* Visibility settings for a widget.
|
|
3
3
|
*/
|
|
4
4
|
export interface WidgetDefinitionVisibility {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Whether the widget is hidden.
|
|
7
|
+
*/
|
|
8
|
+
isHidden: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Start date for scheduled widgets.
|
|
11
|
+
*/
|
|
12
|
+
scheduleStartDate: string;
|
|
13
|
+
/**
|
|
14
|
+
* End date for scheduled widgets.
|
|
15
|
+
*/
|
|
16
|
+
scheduleEndDate: string;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
18
|
/**
|
|
20
19
|
* Layout settings for a widget.
|
|
21
20
|
*/
|
|
22
21
|
export interface WidgetDefinitionLayout {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Top margin for the widget.
|
|
24
|
+
*/
|
|
25
|
+
marginTop: number;
|
|
26
|
+
/**
|
|
27
|
+
* Bottom margin for the widget.
|
|
28
|
+
*/
|
|
29
|
+
marginBottom: number;
|
|
30
|
+
/**
|
|
31
|
+
* Left margin for the widget.
|
|
32
|
+
*/
|
|
33
|
+
marginLeft: number;
|
|
34
|
+
/**
|
|
35
|
+
* Right margin for the widget.
|
|
36
|
+
*/
|
|
37
|
+
marginRight: number;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
/**
|
|
42
40
|
* Definition of a API widget
|
|
43
41
|
*/
|
|
44
42
|
export interface WidgetDefinition {
|
|
45
|
-
/**
|
|
46
|
-
* Unique code for the widget.
|
|
47
|
-
*/
|
|
48
|
-
code: string;
|
|
49
|
-
/**
|
|
50
|
-
* Name of the widget
|
|
51
|
-
*/
|
|
52
|
-
widgetConfigDefinitionCode: string;
|
|
53
|
-
/**
|
|
54
|
-
* Individual configuration for the widget.
|
|
55
|
-
*/
|
|
56
|
-
widgetConfig: Record<string, any>;
|
|
57
|
-
/**
|
|
58
|
-
* Whether the widget is a legacy custom widget provided by an extension that's configured
|
|
59
|
-
* via an HTML comment inside a HTML widget.
|
|
60
|
-
*/
|
|
61
|
-
isCustomLegacyWidget?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Visibility settings for the widget.
|
|
64
|
-
*/
|
|
65
|
-
visibility: WidgetDefinitionVisibility;
|
|
66
|
-
/**
|
|
67
|
-
* Layout settings for the widget.
|
|
68
|
-
*/
|
|
69
|
-
layout: WidgetDefinitionLayout;
|
|
70
|
-
/**
|
|
71
|
-
* Optional metadata for the widget (only available in preview mode)
|
|
72
|
-
*/
|
|
73
|
-
meta?: {
|
|
74
|
-
/**
|
|
75
|
-
* Hidden state related data
|
|
76
|
-
*/
|
|
77
|
-
hidden: {
|
|
78
|
-
/**
|
|
79
|
-
* Whether the widget is hidden.
|
|
80
|
-
*/
|
|
81
|
-
isHidden: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Tooltip text for hidden related UI elements.
|
|
84
|
-
*/
|
|
85
|
-
tooltip: string;
|
|
86
|
-
/**
|
|
87
|
-
* Label text for hidden related UI elements.
|
|
88
|
-
*/
|
|
89
|
-
label: string;
|
|
90
|
-
};
|
|
91
43
|
/**
|
|
92
|
-
*
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
44
|
+
* Unique code for the widget.
|
|
45
|
+
*/
|
|
46
|
+
code: string;
|
|
47
|
+
/**
|
|
48
|
+
* Name of the widget
|
|
49
|
+
*/
|
|
50
|
+
widgetConfigDefinitionCode: string;
|
|
51
|
+
/**
|
|
52
|
+
* Individual configuration for the widget.
|
|
53
|
+
*/
|
|
54
|
+
widgetConfig: Record<string, unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the widget is a legacy custom widget provided by an extension that's configured
|
|
57
|
+
* via an HTML comment inside a HTML widget.
|
|
58
|
+
*/
|
|
59
|
+
isCustomLegacyWidget?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Visibility settings for the widget.
|
|
62
|
+
*/
|
|
63
|
+
visibility: WidgetDefinitionVisibility;
|
|
64
|
+
/**
|
|
65
|
+
* Layout settings for the widget.
|
|
66
|
+
*/
|
|
67
|
+
layout: WidgetDefinitionLayout;
|
|
68
|
+
/**
|
|
69
|
+
* Optional metadata for the widget (only available in preview mode)
|
|
70
|
+
*/
|
|
71
|
+
meta?: {
|
|
72
|
+
/**
|
|
73
|
+
* Hidden state related data
|
|
74
|
+
*/
|
|
75
|
+
hidden: {
|
|
76
|
+
/**
|
|
77
|
+
* Whether the widget is hidden.
|
|
78
|
+
*/
|
|
79
|
+
isHidden: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Tooltip text for hidden related UI elements.
|
|
82
|
+
*/
|
|
83
|
+
tooltip: string;
|
|
84
|
+
/**
|
|
85
|
+
* Label text for hidden related UI elements.
|
|
86
|
+
*/
|
|
87
|
+
label: string;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Scheduled state related data
|
|
91
|
+
*/
|
|
92
|
+
scheduled: {
|
|
93
|
+
/**
|
|
94
|
+
* Indicates if the widget is scheduled.
|
|
95
|
+
*/
|
|
96
|
+
isScheduled: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Indicates that the widget schedule time frame is currently active.
|
|
99
|
+
*/
|
|
100
|
+
isActive: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Indicates if the scheduled time frame has expired
|
|
103
|
+
*/
|
|
104
|
+
isExpired: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Tooltip text for schedule related UI elements.
|
|
107
|
+
*/
|
|
108
|
+
tooltip: string;
|
|
109
|
+
/**
|
|
110
|
+
* Label text for schedule related UI elements.
|
|
111
|
+
*/
|
|
112
|
+
label: string;
|
|
113
|
+
};
|
|
115
114
|
};
|
|
116
|
-
}
|
|
117
115
|
}
|
|
118
|
-
|
|
119
116
|
export interface ScheduledStatus {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Indicates if the widget is scheduled.
|
|
119
|
+
*/
|
|
120
|
+
isScheduled: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Indicates if the widget is currently hidden based on the scheduling
|
|
123
|
+
*/
|
|
124
|
+
isHidden: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Indicates if the scheduled time frame has expired.
|
|
127
|
+
*/
|
|
128
|
+
isExpired: boolean;
|
|
132
129
|
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../page/components/Widgets/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,UAAU,EAAE,0BAA0B,CAAC;IACvC;;OAEG;IACH,MAAM,EAAE,sBAAsB,CAAC;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE;QACL;;WAEG;QACH,MAAM,EAAE;YACN;;eAEG;YACH,QAAQ,EAAE,OAAO,CAAC;YAClB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAChB;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF;;WAEG;QACH,SAAS,EAAE;YACT;;eAEG;YACH,WAAW,EAAE,OAAO,CAAC;YACrB;;eAEG;YACH,QAAQ,EAAE,OAAO,CAAC;YAClB;;eAEG;YACH,SAAS,EAAE,OAAO,CAAC;YACnB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAChB;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAA;CACF;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as NotFound } from './NotFound';
|
|
2
|
+
export { default as Widgets } from './Widgets';
|
|
3
|
+
export { default as ResponsiveWidgetImage } from './ResponsiveWidgetImage';
|
|
4
|
+
export { default as WidgetRichText } from './WidgetRichText';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../page/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionTypes.d.ts","sourceRoot":"","sources":["../../../page/constants/actionTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,oBAAoB,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PAGE_PATH, PAGE_PATTERN } from '@shopgate/pwa-common/constants/RoutePaths';
|
|
2
|
+
export { PAGE_PREVIEW_PATTERN } from '@shopgate/engage/admin-preview/constants';
|
|
3
|
+
export * from '@shopgate/pwa-common/constants/PageIDs';
|
|
4
|
+
export { PAGE_PATH, PAGE_PATTERN };
|
|
5
|
+
export * from './actionTypes';
|
|
6
|
+
export declare const IMPRINT_PATH = "/page/imprint";
|
|
7
|
+
export declare const PAYMENT_PATH = "/page/payment";
|
|
8
|
+
export declare const PRIVACY_PATH = "/page/privacy";
|
|
9
|
+
export declare const RETURN_POLICY_PATH = "/page/return_policy";
|
|
10
|
+
export declare const SHIPPING_PATH = "/page/shipping";
|
|
11
|
+
export declare const TERMS_PATH = "/page/terms";
|
|
12
|
+
export declare const PAGE_PREVIEW_SLUG = "page_preview";
|
|
13
|
+
/**
|
|
14
|
+
* Checks if the app is currently in page preview mode.
|
|
15
|
+
* @todo For backwards compatibility, this constant is still exported from the page package and
|
|
16
|
+
* mapped to the isAdminPreviewActive helper. It should be removed in the future. Note that this
|
|
17
|
+
* is a snapshot taken when this module is evaluated - consumers that can call
|
|
18
|
+
* isAdminPreviewActive() at usage time should do that instead.
|
|
19
|
+
*/
|
|
20
|
+
export declare const IS_PAGE_PREVIEW_ACTIVE: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* One hour in milliseconds
|
|
23
|
+
*/
|
|
24
|
+
export declare const PAGE_STATE_LIFETIME = 3600000;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../page/constants/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,cAAc,wCAAwC,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AACnC,cAAc,eAAe,CAAC;AAE9B,eAAO,MAAM,YAAY,kBAAyB,CAAC;AACnD,eAAO,MAAM,YAAY,kBAAyB,CAAC;AACnD,eAAO,MAAM,YAAY,kBAAyB,CAAC;AACnD,eAAO,MAAM,kBAAkB,wBAA+B,CAAC;AAC/D,eAAO,MAAM,aAAa,mBAA0B,CAAC;AACrD,eAAO,MAAM,UAAU,gBAAuB,CAAC;AAE/C,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,SAAyB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,mBAAmB,UAAU,CAAC"}
|
package/page/helpers/index.d.ts
CHANGED
|
@@ -1,84 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Configuration of the "Products" widget input.
|
|
3
|
+
*/
|
|
4
|
+
export interface ProductsWidgetInputConfig {
|
|
5
|
+
/**
|
|
6
|
+
* A search term to filter products by.
|
|
7
|
+
*/
|
|
8
|
+
searchTerm: string;
|
|
9
|
+
/**
|
|
10
|
+
* A brand to filter products by.
|
|
11
|
+
*/
|
|
12
|
+
brand: string;
|
|
13
|
+
/**
|
|
14
|
+
* A category to filter products by.
|
|
15
|
+
*/
|
|
16
|
+
category: string;
|
|
17
|
+
/**
|
|
18
|
+
* Array of product item numbers (selected via manual input).
|
|
19
|
+
*/
|
|
20
|
+
manualItemNumbers: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Array of product item numbers (selected via product selector).
|
|
23
|
+
*/
|
|
24
|
+
selectorItemNumbers: string[];
|
|
22
25
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Return value of {@link getProductSearchParamsFromProductsInputConfig}.
|
|
28
|
+
*/
|
|
29
|
+
export interface GetProductSearchParamsFromProductsInputConfigReturnValue {
|
|
30
|
+
/**
|
|
31
|
+
* The type of product search to perform.
|
|
32
|
+
*/
|
|
33
|
+
productsSearchType: 'searchTerm' | 'brand' | 'category' | 'productIds';
|
|
34
|
+
/**
|
|
35
|
+
* The value to use for the product search. Can be a string or an array of strings
|
|
36
|
+
* (for product IDs).
|
|
37
|
+
*/
|
|
38
|
+
productsSearchValue: string | string[];
|
|
33
39
|
}
|
|
34
|
-
|
|
35
40
|
/**
|
|
36
41
|
* Helper to extract relevant search parameters from the widget configuration of the "Products"
|
|
37
42
|
* input.
|
|
38
|
-
*
|
|
39
43
|
* The return value can be used to e.g. parametrize the useWidgetProducts hook.
|
|
44
|
+
* @param products Config object of the "Products" input.
|
|
45
|
+
* @returns The extracted product search parameters.
|
|
40
46
|
*/
|
|
41
|
-
export declare
|
|
42
|
-
products: ProductsWidgetInputConfig
|
|
43
|
-
): GetProductSearchParamsFromProductsInputConfigReturnValue;
|
|
44
|
-
|
|
47
|
+
export declare const getProductSearchParamsFromProductsInputConfig: (products?: Partial<ProductsWidgetInputConfig>) => GetProductSearchParamsFromProductsInputConfigReturnValue;
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* Parses the image URL to return a high resolution version if required.
|
|
50
|
+
* @param url The original image URL.
|
|
51
|
+
* @param useHighRes Whether to return a high resolution version.
|
|
52
|
+
* @returns The parsed image URL.
|
|
47
53
|
*/
|
|
48
|
-
export declare
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
63
|
-
|
|
54
|
+
export declare const parseImageUrl: (url: string, useHighRes?: boolean) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Parameters for {@link resolveBorderRadiusFromWidgetConfig}.
|
|
57
|
+
*/
|
|
58
|
+
interface BorderRadiusParams {
|
|
59
|
+
/**
|
|
60
|
+
* The border radius option.
|
|
61
|
+
*/
|
|
62
|
+
borderRadius: 'default' | 'none' | 'rounded' | 'custom';
|
|
63
|
+
/**
|
|
64
|
+
* The custom border radius value.
|
|
65
|
+
*/
|
|
66
|
+
borderRadiusCustom?: number;
|
|
67
|
+
}
|
|
64
68
|
/**
|
|
65
|
-
* Retrieves the border radius based on the widget config
|
|
66
|
-
* @
|
|
69
|
+
* Retrieves the border radius based on the widget config.
|
|
70
|
+
* @param params The helper parameters.
|
|
71
|
+
* @param params.borderRadius The border radius option.
|
|
72
|
+
* @param params.borderRadiusCustom The custom border radius value.
|
|
73
|
+
* @returns The resolved border radius.
|
|
67
74
|
*/
|
|
68
|
-
export declare
|
|
69
|
-
params: BorderRadiusParams
|
|
70
|
-
)
|
|
71
|
-
|
|
75
|
+
export declare const resolveBorderRadiusFromWidgetConfig: ({ borderRadius, borderRadiusCustom }: BorderRadiusParams) => number;
|
|
72
76
|
/**
|
|
73
77
|
* Validator factory for regular expressions.
|
|
74
78
|
* @param regex The regular expression to match.
|
|
75
79
|
* @returns A function that validates if a value matches the regex.
|
|
76
80
|
*/
|
|
77
|
-
export declare
|
|
78
|
-
|
|
81
|
+
export declare const matchesRegex: (regex: RegExp) => (val: string) => boolean;
|
|
79
82
|
/**
|
|
80
83
|
* Validates if a given string is a valid HTTPS URL.
|
|
81
84
|
* @param val The string to validate.
|
|
82
85
|
* @returns True if the string is a valid HTTPS URL, false otherwise.
|
|
83
86
|
*/
|
|
84
87
|
export declare const isHttpsUrl: (val: string) => boolean;
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../page/helpers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,wDAAwD;IACvE;;OAEG;IACH,kBAAkB,EAAE,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,YAAY,CAAC;IACvE;;;OAGG;IACH,mBAAmB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACxC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,6CAA6C,GACxD,WAAU,OAAO,CAAC,yBAAyB,CAAM,KAChD,wDAyBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,aAAa,OAAO,KAAG,MAQjE,CAAC;AAEF;;GAEG;AACH,UAAU,kBAAkB;IAC1B;;OAEG;IACH,YAAY,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxD;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC,GAC9C,sCAAsC,kBAAkB,KACvD,MAKF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,MAAM,KAAK,MAAM,KAAG,OAAkC,CAAC;AAEjG;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAP8B,MAAM,KAAG,OAOgB,CAAC"}
|
package/page/helpers/index.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Configuration of the "Products" widget input.
|
|
5
3
|
*/
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
|
-
* @
|
|
6
|
+
* Return value of {@link getProductSearchParamsFromProductsInputConfig}.
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
|
-
/* eslint-enable max-len */
|
|
12
|
-
|
|
13
9
|
/**
|
|
14
10
|
* Helper to extract relevant search parameters from the widget configuration of the "Products"
|
|
15
11
|
* input.
|
|
16
12
|
* The return value can be used to e.g. parametrize the useWidgetProducts hook.
|
|
17
|
-
* @param
|
|
18
|
-
* @returns
|
|
13
|
+
* @param products Config object of the "Products" input.
|
|
14
|
+
* @returns The extracted product search parameters.
|
|
19
15
|
*/
|
|
20
16
|
export const getProductSearchParamsFromProductsInputConfig = (products = {}) => {
|
|
21
17
|
const {
|
|
@@ -28,8 +24,7 @@ export const getProductSearchParamsFromProductsInputConfig = (products = {}) =>
|
|
|
28
24
|
const mapping = [['brand', brand], ['category', category], ['searchTerm', searchTerm], ['productIds', manualItemNumbers], ['productIds', selectorItemNumbers]];
|
|
29
25
|
|
|
30
26
|
// Pick the first non-undefined value
|
|
31
|
-
|
|
32
|
-
let [productsSearchType, productsSearchValue] = mapping.find(([, value]) => value !== undefined) || ['searchTerm', searchTerm];
|
|
27
|
+
const [productsSearchType, productsSearchValue] = mapping.find(([, value]) => value !== undefined) || ['searchTerm', searchTerm];
|
|
33
28
|
return {
|
|
34
29
|
productsSearchType,
|
|
35
30
|
productsSearchValue
|
|
@@ -38,9 +33,9 @@ export const getProductSearchParamsFromProductsInputConfig = (products = {}) =>
|
|
|
38
33
|
|
|
39
34
|
/**
|
|
40
35
|
* Parses the image URL to return a high resolution version if required.
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @returns
|
|
36
|
+
* @param url The original image URL.
|
|
37
|
+
* @param useHighRes Whether to return a high resolution version.
|
|
38
|
+
* @returns The parsed image URL.
|
|
44
39
|
*/
|
|
45
40
|
export const parseImageUrl = (url, useHighRes) => {
|
|
46
41
|
if (!url || !useHighRes) {
|
|
@@ -51,11 +46,15 @@ export const parseImageUrl = (url, useHighRes) => {
|
|
|
51
46
|
};
|
|
52
47
|
|
|
53
48
|
/**
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
49
|
+
* Parameters for {@link resolveBorderRadiusFromWidgetConfig}.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves the border radius based on the widget config.
|
|
54
|
+
* @param params The helper parameters.
|
|
55
|
+
* @param params.borderRadius The border radius option.
|
|
56
|
+
* @param params.borderRadiusCustom The custom border radius value.
|
|
57
|
+
* @returns The resolved border radius.
|
|
59
58
|
*/
|
|
60
59
|
export const resolveBorderRadiusFromWidgetConfig = ({
|
|
61
60
|
borderRadius,
|
|
@@ -68,15 +67,15 @@ export const resolveBorderRadiusFromWidgetConfig = ({
|
|
|
68
67
|
};
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
|
-
* Validator factory for regular expressions
|
|
72
|
-
* @param
|
|
73
|
-
* @
|
|
70
|
+
* Validator factory for regular expressions.
|
|
71
|
+
* @param regex The regular expression to match.
|
|
72
|
+
* @returns A function that validates if a value matches the regex.
|
|
74
73
|
*/
|
|
75
74
|
export const matchesRegex = regex => val => !val || regex.test(val);
|
|
76
75
|
|
|
77
76
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param
|
|
80
|
-
* @
|
|
77
|
+
* Validates if a given string is a valid HTTPS URL.
|
|
78
|
+
* @param val The string to validate.
|
|
79
|
+
* @returns True if the string is a valid HTTPS URL, false otherwise.
|
|
81
80
|
*/
|
|
82
|
-
export const isHttpsUrl = matchesRegex(
|
|
81
|
+
export const isHttpsUrl = matchesRegex(/^\s*https:\/\/[^\s/$.?#].[^\s]*\s*$/i);
|