@gem-sdk/core 2.1.44 → 2.1.45

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,6 @@ 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 customCdoe = require('../helpers/custom-cdoe.js');
24
23
 
25
24
  const componentsRenderWithParentId = [
26
25
  'CarouselItem'
@@ -207,7 +206,7 @@ const RenderCustomCode = (item)=>{
207
206
  const { css, javascript, rootClassName } = item.advanced?.editorData || {};
208
207
  const replacedCSS = css?.replaceAll(rootClassName, item.uid);
209
208
  const replacedJS = javascript?.replaceAll(rootClassName, item.uid);
210
- const cssCode = render.RenderIf(!!css && customCdoe.hasNonEmptyCSSRules(replacedCSS), render.template`
209
+ const cssCode = render.RenderIf(!!css, render.template`
211
210
  <style id="${`custom-css-${item?.uid}`}">
212
211
  ${replacedCSS}
213
212
  </style>
@@ -19,7 +19,6 @@ require('@gem-sdk/adapter-shopify');
19
19
  require('swr/mutation');
20
20
  require('vanilla-lazyload');
21
21
  require('../hooks/useCartUI.js');
22
- var customCdoe = require('../helpers/custom-cdoe.js');
23
22
 
24
23
  const RenderCustomCode = ({ uid, advanced })=>{
25
24
  const mode = shop.useEditorMode();
@@ -42,7 +41,7 @@ const RenderCustomCode = ({ uid, advanced })=>{
42
41
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
43
42
  children: [
44
43
  /*#__PURE__*/ jsxRuntime.jsx(Head, {
45
- children: !!css && customCdoe.hasNonEmptyCSSRules(replacedCSS) && /*#__PURE__*/ jsxRuntime.jsx("style", {
44
+ children: !!css && /*#__PURE__*/ jsxRuntime.jsx("style", {
46
45
  id: mapId['css'],
47
46
  dangerouslySetInnerHTML: {
48
47
  __html: replacedCSS
@@ -16,7 +16,6 @@ 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 { hasNonEmptyCSSRules } from '../helpers/custom-cdoe.js';
20
19
 
21
20
  const componentsRenderWithParentId = [
22
21
  'CarouselItem'
@@ -203,7 +202,7 @@ const RenderCustomCode = (item)=>{
203
202
  const { css, javascript, rootClassName } = item.advanced?.editorData || {};
204
203
  const replacedCSS = css?.replaceAll(rootClassName, item.uid);
205
204
  const replacedJS = javascript?.replaceAll(rootClassName, item.uid);
206
- const cssCode = RenderIf(!!css && hasNonEmptyCSSRules(replacedCSS), template`
205
+ const cssCode = RenderIf(!!css, template`
207
206
  <style id="${`custom-css-${item?.uid}`}">
208
207
  ${replacedCSS}
209
208
  </style>
@@ -15,7 +15,6 @@ import '@gem-sdk/adapter-shopify';
15
15
  import 'swr/mutation';
16
16
  import 'vanilla-lazyload';
17
17
  import '../hooks/useCartUI.js';
18
- import { hasNonEmptyCSSRules } from '../helpers/custom-cdoe.js';
19
18
 
20
19
  const RenderCustomCode = ({ uid, advanced })=>{
21
20
  const mode = useEditorMode();
@@ -38,7 +37,7 @@ const RenderCustomCode = ({ uid, advanced })=>{
38
37
  return /*#__PURE__*/ jsxs(Fragment, {
39
38
  children: [
40
39
  /*#__PURE__*/ jsx(Head, {
41
- children: !!css && hasNonEmptyCSSRules(replacedCSS) && /*#__PURE__*/ jsx("style", {
40
+ children: !!css && /*#__PURE__*/ jsx("style", {
42
41
  id: mapId['css'],
43
42
  dangerouslySetInnerHTML: {
44
43
  __html: replacedCSS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "2.1.44",
3
+ "version": "2.1.45",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- const hasNonEmptyCSSRules = (css)=>{
4
- const regex = /[^{]+\{\s*\}/g;
5
- return !regex.test(css);
6
- };
7
-
8
- exports.hasNonEmptyCSSRules = hasNonEmptyCSSRules;
@@ -1,6 +0,0 @@
1
- const hasNonEmptyCSSRules = (css)=>{
2
- const regex = /[^{]+\{\s*\}/g;
3
- return !regex.test(css);
4
- };
5
-
6
- export { hasNonEmptyCSSRules };