@gem-sdk/components 2.0.5 → 2.0.7

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.
@@ -31,7 +31,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
31
31
  });
32
32
  //=== END lazyload section ====
33
33
  const childHasChildren = React.useMemo(()=>{
34
- return builderProps?.builderData?.rawChildrens?.find((child)=>child?.childrens?.length);
34
+ return builderProps?.builderData?.childrens?.length;
35
35
  }, [
36
36
  builderProps
37
37
  ]);
@@ -206,9 +206,9 @@ const ProductList = ({ children, className, setting, styles, builderProps })=>{
206
206
  if (isProductGridNotRender) return;
207
207
  setTimeout(()=>{
208
208
  const { builderData } = builderProps ?? {};
209
- const targetUid = mode === 'edit' ? builderData?.rawChildrens?.[0]?.childrens?.[0] : builderData?.childrens?.[0];
209
+ const targetUid = builderData?.childrens?.[0];
210
210
  if (!targetUid) return;
211
- const container = document.querySelector(mode === 'edit' ? `[data-uid=${targetUid}]` : `[data-id=${targetUid}] div`);
211
+ const container = document.querySelector(`[data-id=${targetUid}] div`);
212
212
  if (!container) return;
213
213
  setRowPerCol(container.childElementCount || 1);
214
214
  }, mode === 'edit' ? 0 : 500);
@@ -9,6 +9,7 @@ var React = require('react');
9
9
  const Text = /*#__PURE__*/ React.forwardRef(({ styles, builderAttrs, style, setting, advanced, builderProps, className, children, ...props }, ref)=>{
10
10
  const { text, htmlTag: Element = 'div', options, tagWidth, excludeFlex } = setting ?? {};
11
11
  const composeGlobalSize = core.makeGlobalSize(setting?.globalSize);
12
+ console.log('Text: ', text);
12
13
  const mode = core.useEditorMode();
13
14
  const getPlaceHolderWhenContentNone = ()=>{
14
15
  let classList = '';
@@ -27,7 +27,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
27
27
  });
28
28
  //=== END lazyload section ====
29
29
  const childHasChildren = useMemo(()=>{
30
- return builderProps?.builderData?.rawChildrens?.find((child)=>child?.childrens?.length);
30
+ return builderProps?.builderData?.childrens?.length;
31
31
  }, [
32
32
  builderProps
33
33
  ]);
@@ -202,9 +202,9 @@ const ProductList = ({ children, className, setting, styles, builderProps })=>{
202
202
  if (isProductGridNotRender) return;
203
203
  setTimeout(()=>{
204
204
  const { builderData } = builderProps ?? {};
205
- const targetUid = mode === 'edit' ? builderData?.rawChildrens?.[0]?.childrens?.[0] : builderData?.childrens?.[0];
205
+ const targetUid = builderData?.childrens?.[0];
206
206
  if (!targetUid) return;
207
- const container = document.querySelector(mode === 'edit' ? `[data-uid=${targetUid}]` : `[data-id=${targetUid}] div`);
207
+ const container = document.querySelector(`[data-id=${targetUid}] div`);
208
208
  if (!container) return;
209
209
  setRowPerCol(container.childElementCount || 1);
210
210
  }, mode === 'edit' ? 0 : 500);
@@ -5,6 +5,7 @@ import { forwardRef, useMemo } from 'react';
5
5
  const Text = /*#__PURE__*/ forwardRef(({ styles, builderAttrs, style, setting, advanced, builderProps, className, children, ...props }, ref)=>{
6
6
  const { text, htmlTag: Element = 'div', options, tagWidth, excludeFlex } = setting ?? {};
7
7
  const composeGlobalSize = makeGlobalSize(setting?.globalSize);
8
+ console.log('Text: ', text);
8
9
  const mode = useEditorMode();
9
10
  const getPlaceHolderWhenContentNone = ()=>{
10
11
  let classList = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,7 +21,7 @@
21
21
  "format": "prettier --write \"./src/**/*.{ts,tsx}\""
22
22
  },
23
23
  "devDependencies": {
24
- "@gem-sdk/core": "2.0.3",
24
+ "@gem-sdk/core": "2.0.6",
25
25
  "@gem-sdk/styles": "2.0.0",
26
26
  "@types/react-transition-group": "^4.4.5"
27
27
  },