@gem-sdk/core 1.46.0 → 1.46.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.
@@ -20,7 +20,7 @@ require('dayjs');
20
20
  var composeAdvanceStyle = require('../helpers/compose-advance-style.js');
21
21
  var convert = require('../helpers/convert.js');
22
22
  var render = require('../helpers/render.js');
23
- var cssjson = require('cssjson');
23
+ require('cssjson');
24
24
 
25
25
  const componentsRenderWithParentId = [
26
26
  'CarouselItem'
@@ -182,22 +182,11 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
182
182
  };
183
183
  }
184
184
  };
185
- const isEmptyCSS = (cssString)=>{
186
- if (!cssString) return true;
187
- const cssJSON = cssjson.toJSON(cssString);
188
- const isObjectEmpty = (obj)=>{
189
- if (typeof obj !== 'object' || obj === null) return true;
190
- return !Object.keys(obj).some((key)=>{
191
- return key === 'attributes' && Object.keys(obj[key]).length > 0 || typeof obj[key] === 'object' && !isObjectEmpty(obj[key]);
192
- });
193
- };
194
- return isObjectEmpty(cssJSON.children);
195
- };
196
185
  const RenderCustomCode = (item)=>{
197
186
  const { css, javascript, rootClassName } = item.advanced?.editorData || {};
198
187
  const replacedCSS = css?.replaceAll(rootClassName, item.uid);
199
188
  const replacedJS = javascript?.replaceAll(rootClassName, item.uid);
200
- const cssCode = render.RenderIf(!!css && !isEmptyCSS(replacedCSS), render.template`
189
+ const cssCode = render.RenderIf(!!css, render.template`
201
190
  <style id="${`custom-css-${item?.uid}`}">
202
191
  ${replacedCSS}
203
192
  </style>
@@ -16,7 +16,7 @@ import 'dayjs';
16
16
  import { composeAdvanceStyle } from '../helpers/compose-advance-style.js';
17
17
  import { baseAssetURL, isLocalEnv } from '../helpers/convert.js';
18
18
  import { RenderIf, template } from '../helpers/render.js';
19
- import { toJSON } from 'cssjson';
19
+ import 'cssjson';
20
20
 
21
21
  const componentsRenderWithParentId = [
22
22
  'CarouselItem'
@@ -178,22 +178,11 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
178
178
  };
179
179
  }
180
180
  };
181
- const isEmptyCSS = (cssString)=>{
182
- if (!cssString) return true;
183
- const cssJSON = toJSON(cssString);
184
- const isObjectEmpty = (obj)=>{
185
- if (typeof obj !== 'object' || obj === null) return true;
186
- return !Object.keys(obj).some((key)=>{
187
- return key === 'attributes' && Object.keys(obj[key]).length > 0 || typeof obj[key] === 'object' && !isObjectEmpty(obj[key]);
188
- });
189
- };
190
- return isObjectEmpty(cssJSON.children);
191
- };
192
181
  const RenderCustomCode = (item)=>{
193
182
  const { css, javascript, rootClassName } = item.advanced?.editorData || {};
194
183
  const replacedCSS = css?.replaceAll(rootClassName, item.uid);
195
184
  const replacedJS = javascript?.replaceAll(rootClassName, item.uid);
196
- const cssCode = RenderIf(!!css && !isEmptyCSS(replacedCSS), template`
185
+ const cssCode = RenderIf(!!css, template`
197
186
  <style id="${`custom-css-${item?.uid}`}">
198
187
  ${replacedCSS}
199
188
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.46.0",
3
+ "version": "1.46.1",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",