@gem-sdk/pages 2.1.27-staging.0 → 2.1.27-staging.22

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.
@@ -410,6 +410,7 @@ const Toolbar = ()=>{
410
410
  if (!value || !currentComponentActive.current) {
411
411
  return;
412
412
  }
413
+ let isClickProcessing = false;
413
414
  const selector = getSelectorComponent({
414
415
  ...currentComponentActive.current
415
416
  });
@@ -418,6 +419,7 @@ const Toolbar = ()=>{
418
419
  const $parents = $component?.querySelectorAll('[data-toolbar-parent]');
419
420
  if ($parents.length) {
420
421
  const onHover = ($parent)=>{
422
+ if (isClickProcessing) return;
421
423
  const uid = $parent.getAttribute('data-parent-uid');
422
424
  if (!uid) return;
423
425
  const $parentComponents = document.body.querySelector('#storefront')?.querySelectorAll(`[data-uid="${uid}"]`);
@@ -446,6 +448,7 @@ const Toolbar = ()=>{
446
448
  }
447
449
  };
448
450
  const onClick = async ($parent)=>{
451
+ isClickProcessing = true;
449
452
  const uid = $parent.getAttribute('data-parent-uid');
450
453
  if (!uid) return;
451
454
  const isElementInsideProduct = async ()=>{
@@ -477,6 +480,9 @@ const Toolbar = ()=>{
477
480
  });
478
481
  outHover($parent);
479
482
  window.dispatchEvent(event);
483
+ setTimeout(()=>{
484
+ isClickProcessing = false;
485
+ }, 0);
480
486
  };
481
487
  $parents.forEach(($parent)=>{
482
488
  $parent.addEventListener('mouseover', ()=>onHover($parent));
@@ -406,6 +406,7 @@ const Toolbar = ()=>{
406
406
  if (!value || !currentComponentActive.current) {
407
407
  return;
408
408
  }
409
+ let isClickProcessing = false;
409
410
  const selector = getSelectorComponent({
410
411
  ...currentComponentActive.current
411
412
  });
@@ -414,6 +415,7 @@ const Toolbar = ()=>{
414
415
  const $parents = $component?.querySelectorAll('[data-toolbar-parent]');
415
416
  if ($parents.length) {
416
417
  const onHover = ($parent)=>{
418
+ if (isClickProcessing) return;
417
419
  const uid = $parent.getAttribute('data-parent-uid');
418
420
  if (!uid) return;
419
421
  const $parentComponents = document.body.querySelector('#storefront')?.querySelectorAll(`[data-uid="${uid}"]`);
@@ -442,6 +444,7 @@ const Toolbar = ()=>{
442
444
  }
443
445
  };
444
446
  const onClick = async ($parent)=>{
447
+ isClickProcessing = true;
445
448
  const uid = $parent.getAttribute('data-parent-uid');
446
449
  if (!uid) return;
447
450
  const isElementInsideProduct = async ()=>{
@@ -473,6 +476,9 @@ const Toolbar = ()=>{
473
476
  });
474
477
  outHover($parent);
475
478
  window.dispatchEvent(event);
479
+ setTimeout(()=>{
480
+ isClickProcessing = false;
481
+ }, 0);
476
482
  };
477
483
  $parents.forEach(($parent)=>{
478
484
  $parent.addEventListener('mouseover', ()=>onHover($parent));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.1.27-staging.0",
3
+ "version": "2.1.27-staging.22",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "next": "latest"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.1.27-staging.0",
29
+ "@gem-sdk/core": "2.1.27-staging.21",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.1.27-staging.0",
31
31
  "@gem-sdk/plugin-quick-view": "2.1.27-staging.0",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.1.27-staging.0"