@gem-sdk/pages 1.57.0-staging.11 → 1.57.0-staging.13

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.
@@ -368,9 +368,10 @@ const Toolbar = ()=>{
368
368
  }
369
369
  } else {
370
370
  if (currentComponentActive.current?.componentUid) {
371
- const componentUid = currentComponentActive.current?.componentUid;
372
- const productId = currentComponentActive.current?.productId;
373
- const $component = await waitForElementToExist.waitForElementToExist(`${productId ? `[data-product-id="${productId}"] ` : ''}[data-uid="${componentUid}"]`, 500);
371
+ const selector = getSelectorComponent({
372
+ ...currentComponentActive.current
373
+ });
374
+ const $component = await waitForElementToExist.waitForElementToExist(selector, 500);
374
375
  if ($component) {
375
376
  const $toolbar = getChildrenByAttrSelector.getChildrenByAttrSelector($component, 'data-toolbar');
376
377
  const $outline = getChildrenByAttrSelector.getChildrenByAttrSelector($component, 'data-outline');
@@ -406,10 +407,13 @@ const Toolbar = ()=>{
406
407
  }
407
408
  }, []);
408
409
  const setShowParents = async ({ value })=>{
409
- if (!value) {
410
+ if (!value || !currentComponentActive.current) {
410
411
  return;
411
412
  }
412
- const $component = await waitForElementToExist.waitForElementToExist(`${currentComponentActive.current?.productId ? `[data-product-id="${currentComponentActive.current?.productId}"] ` : ''}[data-uid="${currentComponentActive.current?.componentUid}"]`, 500);
413
+ const selector = getSelectorComponent({
414
+ ...currentComponentActive.current
415
+ });
416
+ const $component = await waitForElementToExist.waitForElementToExist(selector, 500);
413
417
  if ($component) {
414
418
  const $parents = $component?.querySelectorAll('[data-toolbar-parent]');
415
419
  if ($parents.length) {
@@ -139,8 +139,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
139
139
  facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
140
140
  tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
141
141
  customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
142
- customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
143
- interaction: dataBuilder?.interaction
142
+ customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
144
143
  });
145
144
  } catch (err) {
146
145
  nextjs.captureException(err);
@@ -364,9 +364,10 @@ const Toolbar = ()=>{
364
364
  }
365
365
  } else {
366
366
  if (currentComponentActive.current?.componentUid) {
367
- const componentUid = currentComponentActive.current?.componentUid;
368
- const productId = currentComponentActive.current?.productId;
369
- const $component = await waitForElementToExist(`${productId ? `[data-product-id="${productId}"] ` : ''}[data-uid="${componentUid}"]`, 500);
367
+ const selector = getSelectorComponent({
368
+ ...currentComponentActive.current
369
+ });
370
+ const $component = await waitForElementToExist(selector, 500);
370
371
  if ($component) {
371
372
  const $toolbar = getChildrenByAttrSelector($component, 'data-toolbar');
372
373
  const $outline = getChildrenByAttrSelector($component, 'data-outline');
@@ -402,10 +403,13 @@ const Toolbar = ()=>{
402
403
  }
403
404
  }, []);
404
405
  const setShowParents = async ({ value })=>{
405
- if (!value) {
406
+ if (!value || !currentComponentActive.current) {
406
407
  return;
407
408
  }
408
- const $component = await waitForElementToExist(`${currentComponentActive.current?.productId ? `[data-product-id="${currentComponentActive.current?.productId}"] ` : ''}[data-uid="${currentComponentActive.current?.componentUid}"]`, 500);
409
+ const selector = getSelectorComponent({
410
+ ...currentComponentActive.current
411
+ });
412
+ const $component = await waitForElementToExist(selector, 500);
409
413
  if ($component) {
410
414
  const $parents = $component?.querySelectorAll('[data-toolbar-parent]');
411
415
  if ($parents.length) {
@@ -137,8 +137,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
137
137
  facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
138
138
  tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
139
139
  customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
140
- customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
141
- interaction: dataBuilder?.interaction
140
+ customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
142
141
  });
143
142
  } catch (err) {
144
143
  captureException(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.57.0-staging.11",
3
+ "version": "1.57.0-staging.13",
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": "1.57.0-staging.2",
29
+ "@gem-sdk/core": "1.57.0-staging.13",
30
30
  "@gem-sdk/plugin-cookie-bar": "1.57.0-staging.2",
31
31
  "@gem-sdk/plugin-quick-view": "1.57.0-staging.2",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "1.57.0-staging.2"