@blaze-cms/react-page-builder 0.146.0-core-styles.43 → 0.146.0-tooltips.1

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/CHANGELOG.md CHANGED
@@ -3,237 +3,51 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [0.146.0-core-styles.43](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.42...v0.146.0-core-styles.43) (2025-02-05)
6
+ # [0.146.0-tooltips.1](https://github.com/thebyte9/blaze/compare/v0.146.0-tooltips.0...v0.146.0-tooltips.1) (2025-02-06)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
- * fixed variable placing ([cbd733b](https://github.com/thebyte9/blaze/commit/cbd733b15bf9094bec7f2349267042fe22a54dac))
12
- * handle active url ([58be170](https://github.com/thebyte9/blaze/commit/58be170c8641abeb89e6b51dca9c5a75179c3dd7))
13
- * typo ([88018f9](https://github.com/thebyte9/blaze/commit/88018f96fe2559a981826acb67a60f5b02c94f04))
14
- * update snapshot ([f3e1029](https://github.com/thebyte9/blaze/commit/f3e1029d9eb713a3126f396966ad01516a6a6add))
15
-
16
-
17
- ### Features
18
-
19
- * new preOpenMenu menu setting ([db23d0d](https://github.com/thebyte9/blaze/commit/db23d0d46a3bfe9db848ce5b52532c13e8ed5aa0))
20
-
21
-
22
-
23
-
24
-
25
- # [0.146.0-core-styles.42](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.41...v0.146.0-core-styles.42) (2025-01-06)
26
-
27
-
28
- ### Features
29
-
30
- * add Floating Side Button variant with MVP styling ([#4594](https://github.com/thebyte9/blaze/issues/4594)) ([effb843](https://github.com/thebyte9/blaze/commit/effb843fa9c226fbf07b3ad3dac359d81e164590))
31
-
32
-
33
-
34
-
35
-
36
- # [0.146.0-core-styles.41](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.40...v0.146.0-core-styles.41) (2024-12-16)
37
-
38
- **Note:** Version bump only for package @blaze-cms/react-page-builder
11
+ * menu setdisplaychildren logic ([#4629](https://github.com/thebyte9/blaze/issues/4629)) ([16c5c67](https://github.com/thebyte9/blaze/commit/16c5c674f4db1505131a8557d34f5349cf33fc42))
39
12
 
40
13
 
41
14
 
42
15
 
43
16
 
44
- # [0.146.0-core-styles.40](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.39...v0.146.0-core-styles.40) (2024-12-13)
17
+ # [0.146.0-tooltips.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-tooltips.0) (2025-02-06)
45
18
 
46
19
 
47
20
  ### Bug Fixes
48
21
 
22
+ * apply search filters even when shouldAddFilters is false ([ac82708](https://github.com/thebyte9/blaze/commit/ac827080df3001f4643a2d7a69b8f5502646cf77))
23
+ * encode dynamic menu urls ([#4497](https://github.com/thebyte9/blaze/issues/4497)) ([43695a0](https://github.com/thebyte9/blaze/commit/43695a01408a85a5cd94704d9b78f36fd3fb509f))
24
+ * exported necessary helpers from blaze react page builder ([#4466](https://github.com/thebyte9/blaze/issues/4466)) ([9a8d0db](https://github.com/thebyte9/blaze/commit/9a8d0db28dc0fbf7a2c93733fa1c7d61f293ac1b))
49
25
  * fixed nan values on ranges ([#4582](https://github.com/thebyte9/blaze/issues/4582)) ([963ceec](https://github.com/thebyte9/blaze/commit/963ceec6b1eea027cb36b9358f7dee5e91e852ce))
50
-
51
-
52
-
53
-
54
-
55
- # [0.146.0-core-styles.38](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.37...v0.146.0-core-styles.38) (2024-11-20)
56
-
57
- **Note:** Version bump only for package @blaze-cms/react-page-builder
58
-
59
-
60
-
61
-
62
-
63
- # [0.146.0-core-styles.37](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.36...v0.146.0-core-styles.37) (2024-11-12)
64
-
65
-
66
- ### Features
67
-
68
- * update image-cdn-react package with fetchpolicy update ([#4564](https://github.com/thebyte9/blaze/issues/4564)) ([1b6b719](https://github.com/thebyte9/blaze/commit/1b6b71952dc63f90fdecde1c4214e59a3207d615))
69
-
70
-
71
-
72
-
73
-
74
- # [0.146.0-core-styles.36](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.35...v0.146.0-core-styles.36) (2024-11-07)
75
-
76
- **Note:** Version bump only for package @blaze-cms/react-page-builder
77
-
78
-
79
-
80
-
81
-
82
- # [0.146.0-core-styles.35](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.34...v0.146.0-core-styles.35) (2024-11-06)
83
-
84
- **Note:** Version bump only for package @blaze-cms/react-page-builder
85
-
86
-
87
-
88
-
89
-
90
- # [0.146.0-core-styles.32](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.31...v0.146.0-core-styles.32) (2024-10-31)
91
-
92
- **Note:** Version bump only for package @blaze-cms/react-page-builder
93
-
94
-
95
-
96
-
97
-
98
- # [0.146.0-core-styles.26](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.25...v0.146.0-core-styles.26) (2024-10-28)
99
-
100
-
101
- ### Bug Fixes
102
-
26
+ * fixed url change not reflecting on filters ([#4488](https://github.com/thebyte9/blaze/issues/4488)) ([0d6574f](https://github.com/thebyte9/blaze/commit/0d6574f5d5e698633c6032668cb8e1d914cf0342))
27
+ * fixed url not being decoded when set on useEffect in SearchFilterContainer ([#4492](https://github.com/thebyte9/blaze/issues/4492)) ([64ba7a0](https://github.com/thebyte9/blaze/commit/64ba7a0260ee657561df5273fac3e537d6845db0))
28
+ * fixed variable placing ([cbd733b](https://github.com/thebyte9/blaze/commit/cbd733b15bf9094bec7f2349267042fe22a54dac))
29
+ * handle active url ([58be170](https://github.com/thebyte9/blaze/commit/58be170c8641abeb89e6b51dca9c5a75179c3dd7))
30
+ * persist last selected filter ([#4526](https://github.com/thebyte9/blaze/issues/4526)) ([5b15b57](https://github.com/thebyte9/blaze/commit/5b15b57f5b008a6a9b71a0ea4d5a7bc75b1779a3))
103
31
  * remove limit from dynamic menu item check ([535e557](https://github.com/thebyte9/blaze/commit/535e5574817c3d4248419cf42961fdc27c28dd34))
32
+ * remove limit from dynamic menu item check ([#4533](https://github.com/thebyte9/blaze/issues/4533)) ([2f9cba8](https://github.com/thebyte9/blaze/commit/2f9cba859223e0d2a81ce8bb816cfacbe7b474b6))
104
33
  * remove youtube origin api param as it breaks SSR ([#4538](https://github.com/thebyte9/blaze/issues/4538)) ([98f71c5](https://github.com/thebyte9/blaze/commit/98f71c501fa8f01f9187d3ab7807c8fc4eada3e6))
34
+ * typo ([88018f9](https://github.com/thebyte9/blaze/commit/88018f96fe2559a981826acb67a60f5b02c94f04))
35
+ * update snapshot ([f3e1029](https://github.com/thebyte9/blaze/commit/f3e1029d9eb713a3126f396966ad01516a6a6add))
36
+ * use modal adapter in frontend ([#4485](https://github.com/thebyte9/blaze/issues/4485)) ([f35adbc](https://github.com/thebyte9/blaze/commit/f35adbcd9a76a069000126a30b3c680c169a5357))
105
37
 
106
38
 
107
39
  ### Features
108
40
 
41
+ * add Floating Side Button variant with MVP styling ([#4594](https://github.com/thebyte9/blaze/issues/4594)) ([effb843](https://github.com/thebyte9/blaze/commit/effb843fa9c226fbf07b3ad3dac359d81e164590))
42
+ * add tooltip support to parent select in DynamicRelation component ([#4603](https://github.com/thebyte9/blaze/issues/4603)) ([7767b5d](https://github.com/thebyte9/blaze/commit/7767b5dd7641d4b0c2477cffe6c0be8f9e8aa9dd))
109
43
  * add video component events for youtube and jwplayer ([7b4aa78](https://github.com/thebyte9/blaze/commit/7b4aa78dea3798d736b32aed13760cc67445780c))
110
-
111
-
112
-
113
-
114
-
115
- # [0.146.0-core-styles.25](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.24...v0.146.0-core-styles.25) (2024-10-25)
116
-
117
-
118
- ### Bug Fixes
119
-
120
- * remove limit from dynamic menu item check ([#4533](https://github.com/thebyte9/blaze/issues/4533)) ([2f9cba8](https://github.com/thebyte9/blaze/commit/2f9cba859223e0d2a81ce8bb816cfacbe7b474b6))
121
-
122
-
123
-
124
-
125
-
126
- # [0.146.0-core-styles.23](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.22...v0.146.0-core-styles.23) (2024-10-23)
127
-
128
-
129
- ### Bug Fixes
130
-
131
- * persist last selected filter ([#4526](https://github.com/thebyte9/blaze/issues/4526)) ([5b15b57](https://github.com/thebyte9/blaze/commit/5b15b57f5b008a6a9b71a0ea4d5a7bc75b1779a3))
132
-
133
-
134
-
135
-
136
-
137
- # [0.146.0-core-styles.21](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.20...v0.146.0-core-styles.21) (2024-10-18)
138
-
139
-
140
- ### Bug Fixes
141
-
142
- * apply search filters even when shouldAddFilters is false ([ac82708](https://github.com/thebyte9/blaze/commit/ac827080df3001f4643a2d7a69b8f5502646cf77))
143
-
144
-
145
-
146
-
147
-
148
- # [0.146.0-core-styles.11](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.10...v0.146.0-core-styles.11) (2024-10-01)
149
-
150
-
151
- ### Bug Fixes
152
-
153
- * encode dynamic menu urls ([#4497](https://github.com/thebyte9/blaze/issues/4497)) ([43695a0](https://github.com/thebyte9/blaze/commit/43695a01408a85a5cd94704d9b78f36fd3fb509f))
154
-
155
-
156
- ### Features
157
-
158
- * improve card click wrapper feature flag to make valid html ([#4495](https://github.com/thebyte9/blaze/issues/4495)) ([cc01f4d](https://github.com/thebyte9/blaze/commit/cc01f4dae15158c0896d48ed05cb32a64c8caa1b))
159
-
160
-
161
-
162
-
163
-
164
- # [0.146.0-core-styles.10](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.9...v0.146.0-core-styles.10) (2024-09-25)
165
-
166
-
167
- ### Bug Fixes
168
-
169
- * fixed url not being decoded when set on useEffect in SearchFilterContainer ([#4492](https://github.com/thebyte9/blaze/issues/4492)) ([64ba7a0](https://github.com/thebyte9/blaze/commit/64ba7a0260ee657561df5273fac3e537d6845db0))
170
-
171
-
172
-
173
-
174
-
175
- # [0.146.0-core-styles.8](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.7...v0.146.0-core-styles.8) (2024-09-24)
176
-
177
-
178
- ### Features
179
-
44
+ * added Loading component ([#4469](https://github.com/thebyte9/blaze/issues/4469)) ([957f09b](https://github.com/thebyte9/blaze/commit/957f09bab84e2e08df879abf4eec17293d167e00))
180
45
  * allow customisation of refine search text ([#4489](https://github.com/thebyte9/blaze/issues/4489)) ([2082c4b](https://github.com/thebyte9/blaze/commit/2082c4b9322882cf779c9619d32ff44793324723))
181
-
182
-
183
-
184
-
185
-
186
- # [0.146.0-core-styles.7](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.6...v0.146.0-core-styles.7) (2024-09-20)
187
-
188
-
189
- ### Bug Fixes
190
-
191
- * use modal adapter in frontend ([#4485](https://github.com/thebyte9/blaze/issues/4485)) ([f35adbc](https://github.com/thebyte9/blaze/commit/f35adbcd9a76a069000126a30b3c680c169a5357))
192
-
193
-
194
-
195
-
196
-
197
- # [0.146.0-core-styles.6](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.5...v0.146.0-core-styles.6) (2024-09-20)
198
-
199
-
200
- ### Bug Fixes
201
-
202
- * fixed url change not reflecting on filters ([#4488](https://github.com/thebyte9/blaze/issues/4488)) ([0d6574f](https://github.com/thebyte9/blaze/commit/0d6574f5d5e698633c6032668cb8e1d914cf0342))
203
-
204
-
205
-
206
-
207
-
208
- # [0.146.0-core-styles.3](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.2...v0.146.0-core-styles.3) (2024-09-18)
209
-
210
-
211
- ### Features
212
-
213
46
  * dynamic menu items ([#4099](https://github.com/thebyte9/blaze/issues/4099)) ([c1e052b](https://github.com/thebyte9/blaze/commit/c1e052ba93218d4f603c697cf8b533d2d0befbf1))
214
47
  * fetch items from the current users item list ([#4464](https://github.com/thebyte9/blaze/issues/4464)) ([b68d4d3](https://github.com/thebyte9/blaze/commit/b68d4d30643b981402a63a961939e13e82999ba4))
215
-
216
-
217
-
218
-
219
-
220
- # [0.146.0-core-styles.0](https://github.com/thebyte9/blaze/compare/v0.145.1-core-styles.1...v0.146.0-core-styles.0) (2024-09-03)
221
-
222
-
223
- ### Features
224
-
225
- * added Loading component ([#4469](https://github.com/thebyte9/blaze/issues/4469)) ([957f09b](https://github.com/thebyte9/blaze/commit/957f09bab84e2e08df879abf4eec17293d167e00))
226
-
227
-
228
-
229
-
230
-
231
- ## [0.145.1-core-styles.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.145.1-core-styles.0) (2024-08-22)
232
-
233
-
234
- ### Bug Fixes
235
-
236
- * exported necessary helpers from blaze react page builder ([#4466](https://github.com/thebyte9/blaze/issues/4466)) ([9a8d0db](https://github.com/thebyte9/blaze/commit/9a8d0db28dc0fbf7a2c93733fa1c7d61f293ac1b))
48
+ * improve card click wrapper feature flag to make valid html ([#4495](https://github.com/thebyte9/blaze/issues/4495)) ([cc01f4d](https://github.com/thebyte9/blaze/commit/cc01f4dae15158c0896d48ed05cb32a64c8caa1b))
49
+ * new preOpenMenu menu setting ([db23d0d](https://github.com/thebyte9/blaze/commit/db23d0d46a3bfe9db848ce5b52532c13e8ed5aa0))
50
+ * update image-cdn-react package with fetchpolicy update ([#4564](https://github.com/thebyte9/blaze/issues/4564)) ([1b6b719](https://github.com/thebyte9/blaze/commit/1b6b71952dc63f90fdecde1c4214e59a3207d615))
237
51
 
238
52
 
239
53
 
@@ -57,7 +57,7 @@ var MenuItemRender = function MenuItemRender(_ref) {
57
57
  _useStringTemplate2$d = (0, _slicedToArray2["default"])(_useStringTemplate2.data, 1),
58
58
  urlToUse = _useStringTemplate2$d[0];
59
59
  (0, _react.useEffect)(function () {
60
- if (!showMobileMenu) setDisplayChildren(false);
60
+ if (!showMobileMenu && !shouldPreOpen) setDisplayChildren(false);
61
61
  }, [children, isClickEvent, loadingUrl, openActiveSubmenus, router]);
62
62
  if (loadingUrl || loadingText) return '';
63
63
  var isActive = router ? (0, _helpers2.isUrlPathMatch)(router.asPath, urlToUse) : false;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItemRender.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_fa","_classnames","_router","_utilsHandlebars","_constants","_helpers","_BlazeLink","_MenuContext","_helpers2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","MenuItemRender","_ref","children","eventType","text","modifier","url","parent","router","useRouter","_useContext","useContext","MenuContext","showMobileMenu","openActiveSubmenus","isHoverEvent","HOVER","isClickEvent","CLICK","isActiveParent","hasActiveChild","asPath","shouldPreOpen","_useState","useState","_useState2","_slicedToArray2","displayChildren","setDisplayChildren","_useStringTemplate","useStringTemplate","loadingText","loading","_useStringTemplate$da","data","textToUse","_useStringTemplate2","injectHelperIntoTemplate","loadingUrl","_useStringTemplate2$d","urlToUse","useEffect","isActive","isUrlPathMatch","childrenDisplayClass","HIDDEN","handleItemEvent","_ref2","type","MOUSE_ENTER","MOUSE_LEAVE","hasValidChildren","hasChildren","menuItemLinkClassname","classnames","createElement","className","onMouseEnter","onMouseLeave","href","role","onClick","FaChevronUp","FaChevronDown","concat","propTypes","PropTypes","string","isRequired","object","oneOfType","arrayOf","node","defaultProps","_default","exports"],"sources":["../../../src/components/MenuItem/MenuItemRender.js"],"sourcesContent":["/* eslint-disable no-console */\nimport React, { useState, useContext, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { FaChevronDown, FaChevronUp } from 'react-icons/fa';\nimport classnames from 'classnames';\nimport { useRouter } from 'next/router';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\nimport { HOVER, MOUSE_ENTER, MOUSE_LEAVE, HIDDEN, CLICK } from '../../constants';\nimport { hasChildren } from '../../helpers';\nimport BlazeLink from '../BlazeLink';\nimport MenuContext from '../Menu/MenuContext';\nimport { injectHelperIntoTemplate, isUrlPathMatch, hasActiveChild } from './helpers';\n\nconst MenuItemRender = ({ children, eventType, text, modifier, url, parent }) => {\n const router = useRouter();\n const { showMobileMenu, openActiveSubmenus } = useContext(MenuContext);\n\n const isHoverEvent = eventType === HOVER;\n const isClickEvent = eventType === CLICK;\n\n const isActiveParent = router ? hasActiveChild(router.asPath, children) : false;\n const shouldPreOpen = openActiveSubmenus && isActiveParent && isClickEvent;\n\n const [displayChildren, setDisplayChildren] = useState(shouldPreOpen);\n\n const {\n loading: loadingText,\n data: [textToUse]\n } = useStringTemplate(parent, [text]);\n\n const {\n loading: loadingUrl,\n data: [urlToUse]\n } = useStringTemplate(parent, [injectHelperIntoTemplate(url, 'url_encode')]);\n\n useEffect(\n () => {\n if (!showMobileMenu) setDisplayChildren(false);\n },\n [children, isClickEvent, loadingUrl, openActiveSubmenus, router]\n );\n\n if (loadingUrl || loadingText) return '';\n const isActive = router ? isUrlPathMatch(router.asPath, urlToUse) : false;\n const childrenDisplayClass = displayChildren ? '' : HIDDEN;\n\n const handleItemEvent = ({ type }) => {\n if (isHoverEvent) {\n if (type === MOUSE_ENTER) {\n setDisplayChildren(true);\n }\n if (type === MOUSE_LEAVE) {\n setDisplayChildren(false);\n }\n }\n };\n\n const hasValidChildren = hasChildren(children);\n\n const menuItemLinkClassname = classnames('menu--item--link', {\n 'menu--item--link--active': isActive,\n 'menu--item--link--active-parent': isActiveParent\n });\n\n return (\n <li className={modifier} onMouseEnter={handleItemEvent} onMouseLeave={handleItemEvent}>\n <div className={menuItemLinkClassname}>\n {urlToUse ? (\n <BlazeLink href={urlToUse}>{textToUse}</BlazeLink>\n ) : (\n <span role=\"button\" onClick={handleItemEvent}>\n {textToUse}\n </span>\n )}\n {hasValidChildren && (\n <i\n role=\"button\"\n className=\"menu--item--link--icon\"\n onClick={() => setDisplayChildren(!displayChildren)}>\n {displayChildren ? <FaChevronUp /> : <FaChevronDown />}\n </i>\n )}\n </div>\n\n {hasValidChildren && (\n <div className={`menu--item-children ${childrenDisplayClass}`}>{children}</div>\n )}\n </li>\n );\n};\n\nMenuItemRender.propTypes = {\n modifier: PropTypes.string,\n text: PropTypes.string,\n url: PropTypes.string,\n eventType: PropTypes.string.isRequired,\n parent: PropTypes.object,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nMenuItemRender.defaultProps = {\n url: '',\n modifier: '',\n text: '',\n children: null,\n parent: {}\n};\n\nexport default MenuItemRender;\n"],"mappings":";;;;;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,GAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,YAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AAAqF,SAAAY,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SA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AAA0F,aAAA;IAAKC,SAAS,yBAAAQ,MAAA,CAAyBpB,oBAAoB;EAAG,GAAE1C,QAAc,CAE9E,CAAC;AAET,CAAC;AAEDF,cAAc,CAACiE,SAAS,GAAG;EACzB5D,QAAQ,EAAE6D,qBAAS,CAACC,MAAM;EAC1B/D,IAAI,EAAE8D,qBAAS,CAACC,MAAM;EACtB7D,GAAG,EAAE4D,qBAAS,CAACC,MAAM;EACrBhE,SAAS,EAAE+D,qBAAS,CAACC,MAAM,CAACC,UAAU;EACtC7D,MAAM,EAAE2D,qBAAS,CAACG,MAAM;EACxBnE,QAAQ,EAAEgE,qBAAS,CAACI,SAAS,CAAC,CAACJ,qBAAS,CAACK,OAAO,CAACL,qBAAS,CAACM,IAAI,CAAC,EAAEN,qBAAS,CAACM,IAAI,CAAC;AACnF,CAAC;AAEDxE,cAAc,CAACyE,YAAY,GAAG;EAC5BnE,GAAG,EAAE,EAAE;EACPD,QAAQ,EAAE,EAAE;EACZD,IAAI,EAAE,EAAE;EACRF,QAAQ,EAAE,IAAI;EACdK,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAAmE,QAAA,GAAAC,OAAA,cAEa3E,cAAc"}
1
+ {"version":3,"file":"MenuItemRender.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_fa","_classnames","_router","_utilsHandlebars","_constants","_helpers","_BlazeLink","_MenuContext","_helpers2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","MenuItemRender","_ref","children","eventType","text","modifier","url","parent","router","useRouter","_useContext","useContext","MenuContext","showMobileMenu","openActiveSubmenus","isHoverEvent","HOVER","isClickEvent","CLICK","isActiveParent","hasActiveChild","asPath","shouldPreOpen","_useState","useState","_useState2","_slicedToArray2","displayChildren","setDisplayChildren","_useStringTemplate","useStringTemplate","loadingText","loading","_useStringTemplate$da","data","textToUse","_useStringTemplate2","injectHelperIntoTemplate","loadingUrl","_useStringTemplate2$d","urlToUse","useEffect","isActive","isUrlPathMatch","childrenDisplayClass","HIDDEN","handleItemEvent","_ref2","type","MOUSE_ENTER","MOUSE_LEAVE","hasValidChildren","hasChildren","menuItemLinkClassname","classnames","createElement","className","onMouseEnter","onMouseLeave","href","role","onClick","FaChevronUp","FaChevronDown","concat","propTypes","PropTypes","string","isRequired","object","oneOfType","arrayOf","node","defaultProps","_default","exports"],"sources":["../../../src/components/MenuItem/MenuItemRender.js"],"sourcesContent":["/* eslint-disable no-console */\nimport React, { useState, useContext, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { FaChevronDown, FaChevronUp } from 'react-icons/fa';\nimport classnames from 'classnames';\nimport { useRouter } from 'next/router';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\nimport { HOVER, MOUSE_ENTER, MOUSE_LEAVE, HIDDEN, CLICK } from '../../constants';\nimport { hasChildren } from '../../helpers';\nimport BlazeLink from '../BlazeLink';\nimport MenuContext from '../Menu/MenuContext';\nimport { injectHelperIntoTemplate, isUrlPathMatch, hasActiveChild } from './helpers';\n\nconst MenuItemRender = ({ children, eventType, text, modifier, url, parent }) => {\n const router = useRouter();\n const { showMobileMenu, openActiveSubmenus } = useContext(MenuContext);\n\n const isHoverEvent = eventType === HOVER;\n const isClickEvent = eventType === CLICK;\n\n const isActiveParent = router ? hasActiveChild(router.asPath, children) : false;\n const shouldPreOpen = openActiveSubmenus && isActiveParent && isClickEvent;\n\n const [displayChildren, setDisplayChildren] = useState(shouldPreOpen);\n\n const {\n loading: loadingText,\n data: [textToUse]\n } = useStringTemplate(parent, [text]);\n\n const {\n loading: loadingUrl,\n data: [urlToUse]\n } = useStringTemplate(parent, [injectHelperIntoTemplate(url, 'url_encode')]);\n\n useEffect(\n () => {\n if (!showMobileMenu && !shouldPreOpen) setDisplayChildren(false);\n },\n [children, isClickEvent, loadingUrl, openActiveSubmenus, router]\n );\n\n if (loadingUrl || loadingText) return '';\n const isActive = router ? isUrlPathMatch(router.asPath, urlToUse) : false;\n const childrenDisplayClass = displayChildren ? '' : HIDDEN;\n\n const handleItemEvent = ({ type }) => {\n if (isHoverEvent) {\n if (type === MOUSE_ENTER) {\n setDisplayChildren(true);\n }\n if (type === MOUSE_LEAVE) {\n setDisplayChildren(false);\n }\n }\n };\n\n const hasValidChildren = hasChildren(children);\n\n const menuItemLinkClassname = classnames('menu--item--link', {\n 'menu--item--link--active': isActive,\n 'menu--item--link--active-parent': isActiveParent\n });\n\n return (\n <li className={modifier} onMouseEnter={handleItemEvent} onMouseLeave={handleItemEvent}>\n <div className={menuItemLinkClassname}>\n {urlToUse ? (\n <BlazeLink href={urlToUse}>{textToUse}</BlazeLink>\n ) : (\n <span role=\"button\" onClick={handleItemEvent}>\n {textToUse}\n </span>\n )}\n {hasValidChildren && (\n <i\n role=\"button\"\n className=\"menu--item--link--icon\"\n onClick={() => setDisplayChildren(!displayChildren)}>\n {displayChildren ? <FaChevronUp /> : <FaChevronDown />}\n </i>\n )}\n </div>\n\n {hasValidChildren && (\n <div className={`menu--item-children ${childrenDisplayClass}`}>{children}</div>\n )}\n </li>\n );\n};\n\nMenuItemRender.propTypes = {\n modifier: PropTypes.string,\n text: PropTypes.string,\n url: PropTypes.string,\n eventType: PropTypes.string.isRequired,\n parent: PropTypes.object,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nMenuItemRender.defaultProps = {\n url: '',\n modifier: '',\n text: '',\n children: null,\n parent: {}\n};\n\nexport default MenuItemRender;\n"],"mappings":";;;;;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,GAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AACA,I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AC;AAEDxE,cAAc,CAACyE,YAAY,GAAG;EAC5BnE,GAAG,EAAE,EAAE;EACPD,QAAQ,EAAE,EAAE;EACZD,IAAI,EAAE,EAAE;EACRF,QAAQ,EAAE,IAAI;EACdK,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAAmE,QAAA,GAAAC,OAAA,cAEa3E,cAAc"}
@@ -37,7 +37,7 @@ const MenuItemRender = ({
37
37
  data: [urlToUse]
38
38
  } = useStringTemplate(parent, [injectHelperIntoTemplate(url, 'url_encode')]);
39
39
  useEffect(() => {
40
- if (!showMobileMenu) setDisplayChildren(false);
40
+ if (!showMobileMenu && !shouldPreOpen) setDisplayChildren(false);
41
41
  }, [children, isClickEvent, loadingUrl, openActiveSubmenus, router]);
42
42
  if (loadingUrl || loadingText) return '';
43
43
  const isActive = router ? isUrlPathMatch(router.asPath, urlToUse) : false;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItemRender.js","names":["React","useState","useContext","useEffect","PropTypes","FaChevronDown","FaChevronUp","classnames","useRouter","useStringTemplate","HOVER","MOUSE_ENTER","MOUSE_LEAVE","HIDDEN","CLICK","hasChildren","BlazeLink","MenuContext","injectHelperIntoTemplate","isUrlPathMatch","hasActiveChild","MenuItemRender","children","eventType","text","modifier","url","parent","router","showMobileMenu","openActiveSubmenus","isHoverEvent","isClickEvent","isActiveParent","asPath","shouldPreOpen","displayChildren","setDisplayChildren","loading","loadingText","data","textToUse","loadingUrl","urlToUse","isActive","childrenDisplayClass","handleItemEvent","type","hasValidChildren","menuItemLinkClassname","createElement","className","onMouseEnter","onMouseLeave","href","role","onClick","propTypes","string","isRequired","object","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../src/components/MenuItem/MenuItemRender.js"],"sourcesContent":["/* eslint-disable no-console */\nimport React, { useState, useContext, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { FaChevronDown, FaChevronUp } from 'react-icons/fa';\nimport classnames from 'classnames';\nimport { useRouter } from 'next/router';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\nimport { HOVER, MOUSE_ENTER, MOUSE_LEAVE, HIDDEN, CLICK } from '../../constants';\nimport { hasChildren } from '../../helpers';\nimport BlazeLink from '../BlazeLink';\nimport MenuContext from '../Menu/MenuContext';\nimport { injectHelperIntoTemplate, isUrlPathMatch, hasActiveChild } from './helpers';\n\nconst MenuItemRender = ({ children, eventType, text, modifier, url, parent }) => {\n const router = useRouter();\n const { showMobileMenu, openActiveSubmenus } = useContext(MenuContext);\n\n const isHoverEvent = eventType === HOVER;\n const isClickEvent = eventType === CLICK;\n\n const isActiveParent = router ? hasActiveChild(router.asPath, children) : false;\n const shouldPreOpen = openActiveSubmenus && isActiveParent && isClickEvent;\n\n const [displayChildren, setDisplayChildren] = useState(shouldPreOpen);\n\n const {\n loading: loadingText,\n data: [textToUse]\n } = useStringTemplate(parent, [text]);\n\n const {\n loading: loadingUrl,\n data: [urlToUse]\n } = useStringTemplate(parent, [injectHelperIntoTemplate(url, 'url_encode')]);\n\n useEffect(\n () => {\n if (!showMobileMenu) setDisplayChildren(false);\n },\n [children, isClickEvent, loadingUrl, openActiveSubmenus, router]\n );\n\n if (loadingUrl || loadingText) return '';\n const isActive = router ? isUrlPathMatch(router.asPath, urlToUse) : false;\n const childrenDisplayClass = displayChildren ? '' : HIDDEN;\n\n const handleItemEvent = ({ type }) => {\n if (isHoverEvent) {\n if (type === MOUSE_ENTER) {\n setDisplayChildren(true);\n }\n if (type === MOUSE_LEAVE) {\n setDisplayChildren(false);\n }\n }\n };\n\n const hasValidChildren = hasChildren(children);\n\n const menuItemLinkClassname = classnames('menu--item--link', {\n 'menu--item--link--active': isActive,\n 'menu--item--link--active-parent': isActiveParent\n });\n\n return (\n <li className={modifier} onMouseEnter={handleItemEvent} onMouseLeave={handleItemEvent}>\n <div className={menuItemLinkClassname}>\n {urlToUse ? (\n <BlazeLink href={urlToUse}>{textToUse}</BlazeLink>\n ) : (\n <span role=\"button\" onClick={handleItemEvent}>\n {textToUse}\n </span>\n )}\n {hasValidChildren && (\n <i\n role=\"button\"\n className=\"menu--item--link--icon\"\n onClick={() => setDisplayChildren(!displayChildren)}>\n {displayChildren ? <FaChevronUp /> : <FaChevronDown />}\n </i>\n )}\n </div>\n\n {hasValidChildren && (\n <div className={`menu--item-children ${childrenDisplayClass}`}>{children}</div>\n )}\n </li>\n );\n};\n\nMenuItemRender.propTypes = {\n modifier: PropTypes.string,\n text: PropTypes.string,\n url: PropTypes.string,\n eventType: PropTypes.string.isRequired,\n parent: PropTypes.object,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nMenuItemRender.defaultProps = {\n url: '',\n modifier: '',\n text: '',\n children: null,\n parent: {}\n};\n\nexport default MenuItemRender;\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC9D,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,EAAEC,WAAW,QAAQ,gBAAgB;AAC3D,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,KAAK,EAAEC,WAAW,EAAEC,WAAW,EAAEC,MAAM,EAAEC,KAAK,QAAQ,iBAAiB;AAChF,SAASC,WAAW,QAAQ,eAAe;AAC3C,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,WAAW,MAAM,qBAAqB;AAC7C,SAASC,wBAAwB,EAAEC,cAAc,EAAEC,cAAc,QAAQ,WAAW;AAEpF,MAAMC,cAAc,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,SAAS;EAAEC,IAAI;EAAEC,QAAQ;EAAEC,GAAG;EAAEC;AAAO,CAAC,KAAK;EAC/E,MAAMC,MAAM,GAAGpB,SAAS,CAAC,CAAC;EAC1B,MAAM;IAAEqB,cAAc;IAAEC;EAAmB,CAAC,GAAG5B,UAAU,CAACe,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EtB,SAAS,CAACsD,MAAM;EACrBnC,SAAS,EAAEnB,SAAS,CAACsD,MAAM,CAACC,UAAU;EACtChC,MAAM,EAAEvB,SAAS,CAACwD,MAAM;EACxBtC,QAAQ,EAAElB,SAAS,CAACyD,SAAS,CAAC,CAACzD,SAAS,CAAC0D,OAAO,CAAC1D,SAAS,CAAC2D,IAAI,CAAC,EAAE3D,SAAS,CAAC2D,IAAI,CAAC;AACnF,CAAC;AAED1C,cAAc,CAAC2C,YAAY,GAAG;EAC5BtC,GAAG,EAAE,EAAE;EACPD,QAAQ,EAAE,EAAE;EACZD,IAAI,EAAE,EAAE;EACRF,QAAQ,EAAE,IAAI;EACdK,MAAM,EAAE,CAAC;AACX,CAAC;AAED,eAAeN,cAAc"}
1
+ {"version":3,"file":"MenuItemRender.js","names":["React","useState","useContext","useEffect","PropTypes","FaChevronDown","FaChevronUp","classnames","useRouter","useStringTemplate","HOVER","MOUSE_ENTER","MOUSE_LEAVE","HIDDEN","CLICK","hasChildren","BlazeLink","MenuContext","injectHelperIntoTemplate","isUrlPathMatch","hasActiveChild","MenuItemRender","children","eventType","text","modifier","url","parent","router","showMobileMenu","openActiveSubmenus","isHoverEvent","isClickEvent","isActiveParent","asPath","shouldPreOpen","displayChildren","setDisplayChildren","loading","loadingText","data","textToUse","loadingUrl","urlToUse","isActive","childrenDisplayClass","handleItemEvent","type","hasValidChildren","menuItemLinkClassname","createElement","className","onMouseEnter","onMouseLeave","href","role","onClick","propTypes","string","isRequired","object","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../src/components/MenuItem/MenuItemRender.js"],"sourcesContent":["/* eslint-disable no-console */\nimport React, { useState, useContext, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { FaChevronDown, FaChevronUp } from 'react-icons/fa';\nimport classnames from 'classnames';\nimport { useRouter } from 'next/router';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\nimport { HOVER, MOUSE_ENTER, MOUSE_LEAVE, HIDDEN, CLICK } from '../../constants';\nimport { hasChildren } from '../../helpers';\nimport BlazeLink from '../BlazeLink';\nimport MenuContext from '../Menu/MenuContext';\nimport { injectHelperIntoTemplate, isUrlPathMatch, hasActiveChild } from './helpers';\n\nconst MenuItemRender = ({ children, eventType, text, modifier, url, parent }) => {\n const router = useRouter();\n const { showMobileMenu, openActiveSubmenus } = useContext(MenuContext);\n\n const isHoverEvent = eventType === HOVER;\n const isClickEvent = eventType === CLICK;\n\n const isActiveParent = router ? hasActiveChild(router.asPath, children) : false;\n const shouldPreOpen = openActiveSubmenus && isActiveParent && isClickEvent;\n\n const [displayChildren, setDisplayChildren] = useState(shouldPreOpen);\n\n const {\n loading: loadingText,\n data: [textToUse]\n } = useStringTemplate(parent, [text]);\n\n const {\n loading: loadingUrl,\n data: [urlToUse]\n } = useStringTemplate(parent, [injectHelperIntoTemplate(url, 'url_encode')]);\n\n useEffect(\n () => {\n if (!showMobileMenu && !shouldPreOpen) setDisplayChildren(false);\n },\n [children, isClickEvent, loadingUrl, openActiveSubmenus, router]\n );\n\n if (loadingUrl || loadingText) return '';\n const isActive = router ? isUrlPathMatch(router.asPath, urlToUse) : false;\n const childrenDisplayClass = displayChildren ? '' : HIDDEN;\n\n const handleItemEvent = ({ type }) => {\n if (isHoverEvent) {\n if (type === MOUSE_ENTER) {\n setDisplayChildren(true);\n }\n if (type === MOUSE_LEAVE) {\n setDisplayChildren(false);\n }\n }\n };\n\n const hasValidChildren = hasChildren(children);\n\n const menuItemLinkClassname = classnames('menu--item--link', {\n 'menu--item--link--active': isActive,\n 'menu--item--link--active-parent': isActiveParent\n });\n\n return (\n <li className={modifier} onMouseEnter={handleItemEvent} onMouseLeave={handleItemEvent}>\n <div className={menuItemLinkClassname}>\n {urlToUse ? (\n <BlazeLink href={urlToUse}>{textToUse}</BlazeLink>\n ) : (\n <span role=\"button\" onClick={handleItemEvent}>\n {textToUse}\n </span>\n )}\n {hasValidChildren && (\n <i\n role=\"button\"\n className=\"menu--item--link--icon\"\n onClick={() => setDisplayChildren(!displayChildren)}>\n {displayChildren ? <FaChevronUp /> : <FaChevronDown />}\n </i>\n )}\n </div>\n\n {hasValidChildren && (\n <div className={`menu--item-children ${childrenDisplayClass}`}>{children}</div>\n )}\n </li>\n );\n};\n\nMenuItemRender.propTypes = {\n modifier: PropTypes.string,\n text: PropTypes.string,\n url: PropTypes.string,\n eventType: PropTypes.string.isRequired,\n parent: PropTypes.object,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nMenuItemRender.defaultProps = {\n url: '',\n modifier: '',\n text: '',\n children: null,\n parent: {}\n};\n\nexport default MenuItemRender;\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC9D,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,EAAEC,WAAW,QAAQ,gBAAgB;AAC3D,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,KAAK,EAAEC,WAAW,EAAEC,WAAW,EAAEC,MAAM,EAAEC,KAAK,QAAQ,iBAAiB;AAChF,SAASC,WAAW,QAAQ,eAAe;AAC3C,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,WAAW,MAAM,qBAAqB;AAC7C,SAASC,wBAAwB,EAAEC,cAAc,EAAEC,cAAc,QAAQ,WAAW;AAEpF,MAAMC,cAAc,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,SAAS;EAAEC,IAAI;EAAEC,QAAQ;EAAEC,GAAG;EAAEC;AAAO,CAAC,KAAK;EAC/E,MAAMC,MAAM,GAAGpB,SAAS,CAAC,CAAC;EAC1B,MAAM;IAAEqB,cAAc;IAAEC;EAAmB,CAAC,GAAG5B,UAAU,CAACe,WAAW,CAAC;EAEtE,MAAMc,YAAY,GAAGR,SAAS,KAAKb,KAAK;EACxC,MAAMsB,YA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,MAAM,CAACC,UAAU;EACtChC,MAAM,EAAEvB,SAAS,CAACwD,MAAM;EACxBtC,QAAQ,EAAElB,SAAS,CAACyD,SAAS,CAAC,CAACzD,SAAS,CAAC0D,OAAO,CAAC1D,SAAS,CAAC2D,IAAI,CAAC,EAAE3D,SAAS,CAAC2D,IAAI,CAAC;AACnF,CAAC;AAED1C,cAAc,CAAC2C,YAAY,GAAG;EAC5BtC,GAAG,EAAE,EAAE;EACPD,QAAQ,EAAE,EAAE;EACZD,IAAI,EAAE,EAAE;EACRF,QAAQ,EAAE,IAAI;EACdK,MAAM,EAAE,CAAC;AACX,CAAC;AAED,eAAeN,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/react-page-builder",
3
- "version": "0.146.0-core-styles.43",
3
+ "version": "0.146.0-tooltips.1",
4
4
  "description": "Blaze react page builder",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,15 +27,15 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/core-auth-ui": "0.146.0-core-styles.41",
31
- "@blaze-cms/core-errors": "0.146.0-core-styles.41",
32
- "@blaze-cms/core-errors-ui": "0.145.1-core-styles.0",
30
+ "@blaze-cms/core-auth-ui": "0.146.0-tooltips.0",
31
+ "@blaze-cms/core-errors": "0.146.0-tooltips.0",
32
+ "@blaze-cms/core-errors-ui": "0.146.0-tooltips.0",
33
33
  "@blaze-cms/image-cdn-react": "0.3.0-alpha.7",
34
- "@blaze-cms/nextjs-components": "0.146.0-core-styles.42",
35
- "@blaze-cms/plugin-search-ui": "0.146.0-core-styles.41",
36
- "@blaze-cms/setup-ui": "0.145.1-core-styles.0",
37
- "@blaze-cms/utils": "0.146.0-core-styles.41",
38
- "@blaze-cms/utils-handlebars": "0.146.0-core-styles.42",
34
+ "@blaze-cms/nextjs-components": "0.146.0-tooltips.0",
35
+ "@blaze-cms/plugin-search-ui": "0.146.0-tooltips.0",
36
+ "@blaze-cms/setup-ui": "0.146.0-tooltips.0",
37
+ "@blaze-cms/utils": "0.146.0-tooltips.0",
38
+ "@blaze-cms/utils-handlebars": "0.146.0-tooltips.0",
39
39
  "@blaze-react/breadcrumb": "0.8.0-alpha.60",
40
40
  "@blaze-react/button": "0.8.0-alpha.82",
41
41
  "@blaze-react/checkboxes": "0.5.31",
@@ -90,5 +90,5 @@
90
90
  "lib/*",
91
91
  "lib-es/*"
92
92
  ],
93
- "gitHead": "a59ac0d9940f1e6022d9b832c468953a602b892c"
93
+ "gitHead": "ff2f259f430146c7e065a0d274e3300c442fae88"
94
94
  }
@@ -35,7 +35,7 @@ const MenuItemRender = ({ children, eventType, text, modifier, url, parent }) =>
35
35
 
36
36
  useEffect(
37
37
  () => {
38
- if (!showMobileMenu) setDisplayChildren(false);
38
+ if (!showMobileMenu && !shouldPreOpen) setDisplayChildren(false);
39
39
  },
40
40
  [children, isClickEvent, loadingUrl, openActiveSubmenus, router]
41
41
  );
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
1
4
  import '@testing-library/jest-dom/extend-expect';
2
5
  import FiltersList from '../../../../../../src/components/SearchFilter/SearchFilter/FiltersList';
3
6