@gem-sdk/pages 1.23.0-staging.153 → 1.23.0-staging.156
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.
|
@@ -13,31 +13,22 @@ const Toolbar = ()=>{
|
|
|
13
13
|
const isResizeSpacing = react.useRef(false);
|
|
14
14
|
/* Functions */ const changePositionToolbar = ({ state, $toolbar, $component })=>{
|
|
15
15
|
const $parentOverflow = findOverflowParent($component, $toolbar);
|
|
16
|
-
const rect = $toolbar.getBoundingClientRect();
|
|
17
|
-
const rectComponent = $component.getBoundingClientRect();
|
|
18
|
-
const windowWidth = window.innerWidth;
|
|
19
16
|
if ($parentOverflow) {
|
|
20
|
-
|
|
17
|
+
const rect = $component.getBoundingClientRect();
|
|
18
|
+
if (rect?.height <= 60) {
|
|
21
19
|
$toolbar.setAttribute(`data-toolbar-${state}-revert`, 'true');
|
|
22
20
|
} else {
|
|
23
21
|
$toolbar.setAttribute(`data-toolbar-${state}-inside`, 'true');
|
|
24
22
|
}
|
|
25
|
-
// fix toolbar overflow right side
|
|
26
|
-
if (rectComponent.left + rect.width > windowWidth) {
|
|
27
|
-
$toolbar.setAttribute(`data-toolbar-${state}-overflow`, 'true');
|
|
28
|
-
}
|
|
29
23
|
} else {
|
|
30
|
-
|
|
24
|
+
const rectComponent = $component.getBoundingClientRect();
|
|
25
|
+
if (rectComponent.top < TOOLBAR_ACTIVE_HEIGHT + 1) {
|
|
31
26
|
if (rectComponent?.height <= 60) {
|
|
32
27
|
$toolbar.setAttribute(`data-toolbar-${state}-revert`, 'true');
|
|
33
28
|
} else {
|
|
34
29
|
$toolbar.setAttribute(`data-toolbar-${state}-inside`, 'true');
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
|
-
// fix toolbar overflow right side
|
|
38
|
-
if (rectComponent.left + rect.width > windowWidth) {
|
|
39
|
-
$toolbar.setAttribute(`data-toolbar-${state}-overflow`, 'true');
|
|
40
|
-
}
|
|
41
32
|
}
|
|
42
33
|
};
|
|
43
34
|
const setHoverComponent = react.useCallback(({ $component, componentUid, focus, isThemeSection })=>{
|
|
@@ -176,8 +167,7 @@ const Toolbar = ()=>{
|
|
|
176
167
|
'data-toolbar-hover-revert',
|
|
177
168
|
'data-toolbar-hover-inside',
|
|
178
169
|
'data-outline-hover',
|
|
179
|
-
'data-toolbar-add-hover'
|
|
180
|
-
'data-toolbar-hover-overflow'
|
|
170
|
+
'data-toolbar-add-hover'
|
|
181
171
|
];
|
|
182
172
|
const $elms = document.querySelectorAll(clearAttrs.map((attr)=>`[${attr}]`).join(','));
|
|
183
173
|
if ($elms) {
|
|
@@ -199,9 +189,7 @@ const Toolbar = ()=>{
|
|
|
199
189
|
'data-toolbar-active-inside',
|
|
200
190
|
'data-spacing-margin-bottom-active',
|
|
201
191
|
'data-toolbar-force-hover',
|
|
202
|
-
'data-outline-force-hover'
|
|
203
|
-
'data-column-force-visible',
|
|
204
|
-
'data-toolbar-active-overflow'
|
|
192
|
+
'data-outline-force-hover'
|
|
205
193
|
];
|
|
206
194
|
const $elms = document.querySelectorAll(clearAttrs.map((attr)=>`[${attr}]`).join(','));
|
|
207
195
|
if ($elms) {
|
|
@@ -9,31 +9,22 @@ const Toolbar = ()=>{
|
|
|
9
9
|
const isResizeSpacing = useRef(false);
|
|
10
10
|
/* Functions */ const changePositionToolbar = ({ state, $toolbar, $component })=>{
|
|
11
11
|
const $parentOverflow = findOverflowParent($component, $toolbar);
|
|
12
|
-
const rect = $toolbar.getBoundingClientRect();
|
|
13
|
-
const rectComponent = $component.getBoundingClientRect();
|
|
14
|
-
const windowWidth = window.innerWidth;
|
|
15
12
|
if ($parentOverflow) {
|
|
16
|
-
|
|
13
|
+
const rect = $component.getBoundingClientRect();
|
|
14
|
+
if (rect?.height <= 60) {
|
|
17
15
|
$toolbar.setAttribute(`data-toolbar-${state}-revert`, 'true');
|
|
18
16
|
} else {
|
|
19
17
|
$toolbar.setAttribute(`data-toolbar-${state}-inside`, 'true');
|
|
20
18
|
}
|
|
21
|
-
// fix toolbar overflow right side
|
|
22
|
-
if (rectComponent.left + rect.width > windowWidth) {
|
|
23
|
-
$toolbar.setAttribute(`data-toolbar-${state}-overflow`, 'true');
|
|
24
|
-
}
|
|
25
19
|
} else {
|
|
26
|
-
|
|
20
|
+
const rectComponent = $component.getBoundingClientRect();
|
|
21
|
+
if (rectComponent.top < TOOLBAR_ACTIVE_HEIGHT + 1) {
|
|
27
22
|
if (rectComponent?.height <= 60) {
|
|
28
23
|
$toolbar.setAttribute(`data-toolbar-${state}-revert`, 'true');
|
|
29
24
|
} else {
|
|
30
25
|
$toolbar.setAttribute(`data-toolbar-${state}-inside`, 'true');
|
|
31
26
|
}
|
|
32
27
|
}
|
|
33
|
-
// fix toolbar overflow right side
|
|
34
|
-
if (rectComponent.left + rect.width > windowWidth) {
|
|
35
|
-
$toolbar.setAttribute(`data-toolbar-${state}-overflow`, 'true');
|
|
36
|
-
}
|
|
37
28
|
}
|
|
38
29
|
};
|
|
39
30
|
const setHoverComponent = useCallback(({ $component, componentUid, focus, isThemeSection })=>{
|
|
@@ -172,8 +163,7 @@ const Toolbar = ()=>{
|
|
|
172
163
|
'data-toolbar-hover-revert',
|
|
173
164
|
'data-toolbar-hover-inside',
|
|
174
165
|
'data-outline-hover',
|
|
175
|
-
'data-toolbar-add-hover'
|
|
176
|
-
'data-toolbar-hover-overflow'
|
|
166
|
+
'data-toolbar-add-hover'
|
|
177
167
|
];
|
|
178
168
|
const $elms = document.querySelectorAll(clearAttrs.map((attr)=>`[${attr}]`).join(','));
|
|
179
169
|
if ($elms) {
|
|
@@ -195,9 +185,7 @@ const Toolbar = ()=>{
|
|
|
195
185
|
'data-toolbar-active-inside',
|
|
196
186
|
'data-spacing-margin-bottom-active',
|
|
197
187
|
'data-toolbar-force-hover',
|
|
198
|
-
'data-outline-force-hover'
|
|
199
|
-
'data-column-force-visible',
|
|
200
|
-
'data-toolbar-active-overflow'
|
|
188
|
+
'data-outline-force-hover'
|
|
201
189
|
];
|
|
202
190
|
const $elms = document.querySelectorAll(clearAttrs.map((attr)=>`[${attr}]`).join(','));
|
|
203
191
|
if ($elms) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.23.0-staging.
|
|
3
|
+
"version": "1.23.0-staging.156",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"next-seo": "^6.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "1.23.0-staging.
|
|
28
|
+
"@gem-sdk/core": "1.23.0-staging.156",
|
|
29
29
|
"@gem-sdk/plugin-cookie-bar": "1.23.0-staging.26",
|
|
30
30
|
"@gem-sdk/plugin-quick-view": "1.23.0-staging.26",
|
|
31
31
|
"@gem-sdk/plugin-sticky-add-to-cart": "1.23.0-staging.26"
|