@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.
Files changed (208) hide show
  1. package/back-in-stock/components/Subscriptions/components/Subscription/index.js +2 -5
  2. package/cart/components/CartItem/CartItemProductLayout.js +1 -1
  3. package/cart/components/CartItem/CartItemProductLayoutWide.js +2 -2
  4. package/category/components/CategoryImage/index.js +11 -15
  5. package/components/constants.d.ts +6 -0
  6. package/components/constants.d.ts.map +1 -0
  7. package/core/helpers/getFullImageSource.d.ts +5 -1
  8. package/core/helpers/getFullImageSource.d.ts.map +1 -1
  9. package/core/helpers/getFullImageSource.js +30 -14
  10. package/core/helpers/i18n.d.ts +4 -0
  11. package/core/helpers/i18n.d.ts.map +1 -1
  12. package/core/helpers/i18n.js +3 -0
  13. package/core/hooks/html/useLoadImage.d.ts +3 -3
  14. package/core/hooks/html/useLoadImage.d.ts.map +1 -1
  15. package/core/hooks/html/useLoadImage.js +2 -2
  16. package/favorites/components/Item/Item.d.ts.map +1 -1
  17. package/favorites/components/Item/Item.js +2 -5
  18. package/favorites/components/List/List.d.ts +1 -1
  19. package/locations/components/StoreList/StoreListProduct.js +2 -3
  20. package/package.json +8 -8
  21. package/page/components/NotFound.d.ts +7 -0
  22. package/page/components/NotFound.d.ts.map +1 -0
  23. package/page/components/NotFound.js +1 -2
  24. package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.d.ts +52 -0
  25. package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.d.ts.map +1 -0
  26. package/page/components/ResponsiveWidgetImage/index.d.ts +2 -0
  27. package/page/components/ResponsiveWidgetImage/index.d.ts.map +1 -0
  28. package/page/components/WidgetRichText/WidgetRichText.d.ts +25 -0
  29. package/page/components/WidgetRichText/WidgetRichText.d.ts.map +1 -0
  30. package/page/components/WidgetRichText/index.d.ts +2 -0
  31. package/page/components/WidgetRichText/index.d.ts.map +1 -0
  32. package/page/components/WidgetVideo/WidgetVideo.d.ts +43 -0
  33. package/page/components/WidgetVideo/WidgetVideo.d.ts.map +1 -0
  34. package/page/components/WidgetVideo/WidgetVideo.js +33 -39
  35. package/page/components/WidgetVideo/index.d.ts +2 -0
  36. package/page/components/WidgetVideo/index.d.ts.map +1 -0
  37. package/page/components/Widgets/Overlay.d.ts +17 -0
  38. package/page/components/Widgets/Overlay.d.ts.map +1 -0
  39. package/page/components/Widgets/Overlay.js +24 -38
  40. package/page/components/Widgets/Tooltip.d.ts +20 -0
  41. package/page/components/Widgets/Tooltip.d.ts.map +1 -0
  42. package/page/components/Widgets/Tooltip.js +6 -10
  43. package/page/components/Widgets/Widget.d.ts +32 -0
  44. package/page/components/Widgets/Widget.d.ts.map +1 -0
  45. package/page/components/Widgets/Widget.js +7 -18
  46. package/page/components/Widgets/WidgetContext.d.ts +32 -38
  47. package/page/components/Widgets/WidgetContext.d.ts.map +1 -0
  48. package/page/components/Widgets/WidgetContext.js +2 -8
  49. package/page/components/Widgets/WidgetProvider.d.ts +25 -0
  50. package/page/components/Widgets/WidgetProvider.d.ts.map +1 -0
  51. package/page/components/Widgets/WidgetProvider.js +5 -12
  52. package/page/components/Widgets/Widgets.d.ts +16 -0
  53. package/page/components/Widgets/Widgets.d.ts.map +1 -0
  54. package/page/components/Widgets/Widgets.js +5 -12
  55. package/page/components/Widgets/WidgetsPreviewContext.d.ts +21 -0
  56. package/page/components/Widgets/WidgetsPreviewContext.d.ts.map +1 -0
  57. package/page/components/Widgets/WidgetsPreviewContext.js +5 -7
  58. package/page/components/Widgets/WidgetsPreviewProvider.d.ts +18 -0
  59. package/page/components/Widgets/WidgetsPreviewProvider.d.ts.map +1 -0
  60. package/page/components/Widgets/WidgetsPreviewProvider.js +5 -6
  61. package/page/components/Widgets/constants.d.ts +5 -0
  62. package/page/components/Widgets/constants.d.ts.map +1 -0
  63. package/page/components/Widgets/constants.js +3 -1
  64. package/page/components/Widgets/events.d.ts +38 -0
  65. package/page/components/Widgets/events.d.ts.map +1 -0
  66. package/page/components/Widgets/events.js +8 -12
  67. package/page/components/Widgets/helpers.d.ts +50 -0
  68. package/page/components/Widgets/helpers.d.ts.map +1 -0
  69. package/page/components/Widgets/helpers.js +8 -13
  70. package/page/components/Widgets/hooks.d.ts +13 -0
  71. package/page/components/Widgets/hooks.d.ts.map +1 -0
  72. package/page/components/Widgets/hooks.js +13 -11
  73. package/page/components/Widgets/index.d.ts +3 -0
  74. package/page/components/Widgets/index.d.ts.map +1 -0
  75. package/page/components/Widgets/types.d.ts +111 -113
  76. package/page/components/Widgets/types.d.ts.map +1 -0
  77. package/page/components/Widgets/types.js +1 -0
  78. package/page/components/index.d.ts +5 -0
  79. package/page/components/index.d.ts.map +1 -0
  80. package/page/constants/actionTypes.d.ts +4 -0
  81. package/page/constants/actionTypes.d.ts.map +1 -0
  82. package/page/constants/index.d.ts +25 -0
  83. package/page/constants/index.d.ts.map +1 -0
  84. package/page/helpers/index.d.ts +67 -62
  85. package/page/helpers/index.d.ts.map +1 -0
  86. package/page/helpers/index.js +24 -25
  87. package/page/hooks/index.d.ts +54 -53
  88. package/page/hooks/index.d.ts.map +1 -0
  89. package/page/hooks/index.js +20 -15
  90. package/page/selectors/index.d.ts +32 -0
  91. package/page/selectors/index.d.ts.map +1 -0
  92. package/page/widgets/ProductSlider/ProductSlider.js +1 -15
  93. package/page/widgets/Video/Video.d.ts +6 -0
  94. package/page/widgets/Video/Video.d.ts.map +1 -0
  95. package/page/widgets/Video/Video.js +0 -2
  96. package/page/widgets/Video/hooks.d.ts +53 -0
  97. package/page/widgets/Video/hooks.d.ts.map +1 -0
  98. package/page/widgets/Video/hooks.js +4 -12
  99. package/page/widgets/Video/index.d.ts +2 -0
  100. package/page/widgets/Video/index.d.ts.map +1 -0
  101. package/product/components/Media/FeaturedMedia.js +7 -1
  102. package/product/components/Media/MediaImage.js +24 -23
  103. package/product/components/Media/MediaPlaceholder.js +4 -7
  104. package/product/components/MediaSlider/components/MediaImage/index.js +6 -2
  105. package/product/components/MediaSlider/constants.js +1 -12
  106. package/product/components/ProductCard/index.js +3 -10
  107. package/product/components/ProductGrid/components/Item/components/ItemImage/index.js +2 -5
  108. package/product/components/ProductGrid/constants.d.ts +2 -0
  109. package/product/components/ProductGrid/constants.d.ts.map +1 -0
  110. package/product/components/ProductGrid/constants.js +1 -0
  111. package/product/components/ProductGrid/hooks.d.ts +11 -0
  112. package/product/components/ProductGrid/hooks.d.ts.map +1 -0
  113. package/product/components/ProductGrid/hooks.js +48 -0
  114. package/product/components/ProductGrid/index.js +3 -6
  115. package/product/components/ProductGrid/spec.js +3 -0
  116. package/product/components/ProductImage/ProductImage.d.ts +42 -0
  117. package/product/components/ProductImage/ProductImage.d.ts.map +1 -0
  118. package/product/components/ProductImage/ProductImage.js +153 -0
  119. package/product/components/ProductImage/ProductImagePlaceholder.d.ts +23 -0
  120. package/product/components/ProductImage/ProductImagePlaceholder.d.ts.map +1 -0
  121. package/product/components/ProductImage/ProductImagePlaceholder.js +9 -14
  122. package/product/components/ProductImage/constants.d.ts +7 -0
  123. package/product/components/ProductImage/constants.d.ts.map +1 -0
  124. package/product/components/ProductImage/constants.js +6 -0
  125. package/product/components/ProductImage/hooks.d.ts +8 -0
  126. package/product/components/ProductImage/hooks.d.ts.map +1 -0
  127. package/product/components/ProductImage/hooks.js +32 -0
  128. package/product/components/ProductImage/index.d.ts +3 -0
  129. package/product/components/ProductImage/index.d.ts.map +1 -0
  130. package/product/components/ProductImage/index.js +1 -201
  131. package/product/components/ProductImage/spec.js +115 -60
  132. package/product/components/ProductList/components/Item/index.js +5 -3
  133. package/product/components/ProductRatingStars/ProductRatingStars.js +2 -4
  134. package/product/components/ProductSlider/constants.d.ts +3 -0
  135. package/product/components/ProductSlider/constants.d.ts.map +1 -0
  136. package/product/components/ProductSlider/constants.js +2 -0
  137. package/product/components/ProductSlider/hooks.d.ts +7 -0
  138. package/product/components/ProductSlider/hooks.d.ts.map +1 -0
  139. package/product/components/ProductSlider/hooks.js +40 -0
  140. package/product/components/ProductSlider/index.js +4 -6
  141. package/product/components/ProductSlider/spec.js +2 -2
  142. package/product/components/Rating/index.js +2 -4
  143. package/product/helpers/index.js +29 -11
  144. package/product/hooks/index.js +3 -1
  145. package/product/hooks/useLoadProductImage.js +4 -2
  146. package/product/hooks/useShowEmptyRatingStars.d.ts +7 -0
  147. package/product/hooks/useShowEmptyRatingStars.d.ts.map +1 -0
  148. package/product/hooks/useShowEmptyRatingStars.js +21 -0
  149. package/product/index.js +0 -1
  150. package/settings/constants/appSettings.d.ts +3 -0
  151. package/settings/constants/appSettings.d.ts.map +1 -1
  152. package/settings/constants/appSettings.js +6 -1
  153. package/settings/constants/imageSettings.d.ts +52 -0
  154. package/settings/constants/imageSettings.d.ts.map +1 -0
  155. package/settings/constants/imageSettings.js +69 -0
  156. package/settings/helpers/index.d.ts +3 -0
  157. package/settings/helpers/index.d.ts.map +1 -0
  158. package/settings/helpers/index.js +1 -0
  159. package/settings/helpers/resolveImageSettings.d.ts +70 -0
  160. package/settings/helpers/resolveImageSettings.d.ts.map +1 -0
  161. package/settings/helpers/resolveImageSettings.js +171 -0
  162. package/settings/helpers/toImageQuality.d.ts +7 -0
  163. package/settings/helpers/toImageQuality.d.ts.map +1 -0
  164. package/settings/helpers/toImageQuality.js +44 -0
  165. package/settings/helpers/toThumborColor.d.ts +15 -0
  166. package/settings/helpers/toThumborColor.d.ts.map +1 -0
  167. package/settings/helpers/toThumborColor.js +51 -0
  168. package/settings/hooks/index.d.ts +2 -0
  169. package/settings/hooks/index.d.ts.map +1 -0
  170. package/settings/hooks/index.js +1 -0
  171. package/settings/hooks/useImageSettings.d.ts +28 -0
  172. package/settings/hooks/useImageSettings.d.ts.map +1 -0
  173. package/settings/hooks/useImageSettings.js +39 -0
  174. package/settings/reducers/appSettings.d.ts.map +1 -1
  175. package/settings/reducers/appSettings.js +66 -4
  176. package/settings/reducers/index.d.ts +2 -2
  177. package/settings/selectors/appSettings.d.ts +46 -0
  178. package/settings/selectors/appSettings.d.ts.map +1 -1
  179. package/settings/selectors/appSettings.js +26 -1
  180. package/settings/types/appSettings.d.ts +156 -0
  181. package/settings/types/appSettings.d.ts.map +1 -1
  182. package/styles/reset/root.js +23 -4
  183. package/styles/reset/typographyCustomProps.d.ts +12 -0
  184. package/styles/reset/typographyCustomProps.d.ts.map +1 -0
  185. package/styles/reset/typographyCustomProps.js +11 -0
  186. package/styles/theme/createTheme/createTypography.js +1 -0
  187. package/styles/theme/createTheme/helpers/cssVarsParser.d.ts.map +1 -1
  188. package/styles/theme/createTheme/helpers/cssVarsParser.js +10 -3
  189. package/product/collections/index.js +0 -1
  190. package/product/components/EffectivityDates/constants.d.ts +0 -3
  191. package/product/components/EffectivityDates/constants.d.ts.map +0 -1
  192. package/product/components/EffectivityDates/helpers.d.ts +0 -6
  193. package/product/components/EffectivityDates/helpers.d.ts.map +0 -1
  194. package/product/components/Media/helpers.d.ts +0 -2
  195. package/product/components/Media/helpers.d.ts.map +0 -1
  196. package/product/components/ProductImage/connector.js +0 -12
  197. package/product/helpers/index.d.ts +0 -13
  198. package/product/helpers/index.d.ts.map +0 -1
  199. package/product/helpers/redirects.d.ts +0 -2
  200. package/product/helpers/redirects.d.ts.map +0 -1
  201. package/product/selectors/helpers/filterProperties.d.ts +0 -8
  202. package/product/selectors/helpers/filterProperties.d.ts.map +0 -1
  203. package/product/selectors/helpers/index.d.ts +0 -3
  204. package/product/selectors/helpers/index.d.ts.map +0 -1
  205. package/product/selectors/helpers/wrapMemoizedSelector.d.ts +0 -2
  206. package/product/selectors/helpers/wrapMemoizedSelector.d.ts.map +0 -1
  207. package/product/selectors/product.d.ts +0 -112
  208. 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
- * 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
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
- * Top margin for the widget.
25
- */
26
- marginTop: number;
27
- /**
28
- * Bottom margin for the widget.
29
- */
30
- marginBottom: number;
31
- /**
32
- * Left margin for the widget.
33
- */
34
- marginLeft: number;
35
- /**
36
- * Right margin for the widget.
37
- */
38
- marginRight: number;
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
- * Scheduled state related data
93
- */
94
- scheduled: {
95
- /**
96
- * Indicates if the widget is scheduled.
97
- */
98
- isScheduled: boolean;
99
- /**
100
- * Indicates that the widget schedule time frame is currently active.
101
- */
102
- isActive: boolean;
103
- /**
104
- * Indicates if the scheduled time frame has expired
105
- */
106
- isExpired: boolean;
107
- /**
108
- * Tooltip text for schedule related UI elements.
109
- */
110
- tooltip: string;
111
- /**
112
- * Label text for schedule related UI elements.
113
- */
114
- label: string;
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
- * Indicates if the widget is scheduled.
122
- */
123
- isScheduled: boolean;
124
- /**
125
- * Indicates if the widget is currently hidden based on the scheduling
126
- */
127
- isHidden: boolean;
128
- /**
129
- * Indicates if the scheduled time frame has expired.
130
- */
131
- isExpired: boolean;
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,4 @@
1
+ export declare const REQUEST_PAGE_CONFIG_V2 = "REQUEST_PAGE_CONFIG_V2";
2
+ export declare const RECEIVE_PAGE_CONFIG_V2 = "RECEIVE_PAGE_CONFIG_V2";
3
+ export declare const ERROR_PAGE_CONFIG_V2 = "ERROR_PAGE_CONFIG_V2";
4
+ //# sourceMappingURL=actionTypes.d.ts.map
@@ -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"}
@@ -1,84 +1,89 @@
1
- export type ProductsWidgetInputConfig = {
2
- /**
3
- * A search term to filter products by
4
- */
5
- searchTerm: string;
6
- /**
7
- * A brand to filter products by
8
- */
9
- brand: string;
10
- /**
11
- * A category to filter products by
12
- */
13
- category: string;
14
- /**
15
- * Array of product item numbers (selected via manual input)
16
- */
17
- manualItemNumbers: string[];
18
- /**
19
- * Array of product item numbers (selected via product selector)
20
- */
21
- selectorItemNumbers: string[];
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
- export type GetProductSearchParamsFromProductsInputConfigReturnValue = {
25
- /**
26
- * The type of product search to perform.
27
- */
28
- productsSearchType: 'searchTerm' | 'brand' | 'category' | 'productIds';
29
- /**
30
- * The value to use for the product search. Can be a string or an array of strings (for product IDs).
31
- */
32
- productsSearchValue: string | string[];
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 function getProductSearchParamsFromProductsInputConfig(
42
- products: ProductsWidgetInputConfig
43
- ): GetProductSearchParamsFromProductsInputConfigReturnValue;
44
-
47
+ export declare const getProductSearchParamsFromProductsInputConfig: (products?: Partial<ProductsWidgetInputConfig>) => GetProductSearchParamsFromProductsInputConfigReturnValue;
45
48
  /**
46
- * Helper to parse the image URL to return a high resolution version if required.
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 function parseImageUrl(
49
- url: string,
50
- useHighRes?: boolean
51
- ): string;
52
-
53
- type BorderRadiusParams = {
54
- /**
55
- * The border radius option
56
- */
57
- borderRadius: 'default' | 'none' |'rounded' | 'custom';
58
- /**
59
- * The custom border radius value
60
- */
61
- customBorderRadius?: number
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
- * @returns The resolved border radius
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 function resolveBorderRadiusFromWidgetConfig(
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 function matchesRegex(regex: RegExp): (val: string) => boolean;
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"}
@@ -1,21 +1,17 @@
1
- /* eslint-disable max-len */
2
-
3
1
  /**
4
- * @typedef {import('./').ProductsWidgetInputConfig} ProductsWidgetInputConfig
2
+ * Configuration of the "Products" widget input.
5
3
  */
6
4
 
7
5
  /**
8
- * @typedef {import('./').GetProductSearchParamsFromProductsInputConfigReturnValue} GetProductSearchParamsFromProductsInputConfigReturnValue
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 {ProductsWidgetInputConfig} products Config object of the "Products" input.
18
- * @returns {GetProductSearchParamsFromProductsInputConfigReturnValue}
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
- // eslint-disable-next-line prefer-const
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 {string} url The original image URL.
42
- * @param {boolean} useHighRes Whether to return a high resolution version.
43
- * @returns {string} The parsed image URL.
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
- * Retrieves the border radius based on the widget config
55
- * @param {Object} params The helper parameters.
56
- * @param {"default"|"none"|"rounded"|"custom"} params.borderRadius The border radius option.
57
- * @param {number} params.borderRadiusCustom The custom border radius value.
58
- * @returns {number} The resolved border radius.
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 {RegExp} regex the regex
73
- * @return {Function}
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
- * Returns a function that validates if input is a valid url with the https protocol
79
- * @param {string} val the string to be validated
80
- * @return {boolean}
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(new RegExp('^\\s*https://[^\\s/$.?#].[^\\s]*\\s*$', 'i'));
81
+ export const isHttpsUrl = matchesRegex(/^\s*https:\/\/[^\s/$.?#].[^\s]*\s*$/i);