@gem-sdk/pages 1.58.0 → 1.60.9

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.
@@ -122,7 +122,7 @@ const Header = (props)=>{
122
122
  })
123
123
  ]
124
124
  }),
125
- !isOriginTemplate && /*#__PURE__*/ jsxRuntime.jsx("button", {
125
+ !(isOriginTemplate || pageType === 'STATIC') && /*#__PURE__*/ jsxRuntime.jsx("button", {
126
126
  className: "gp-header gp-invisible gp-absolute gp-left-[8px] gp-flex gp-h-[24px] gp-cursor-pointer gp-items-center gp-justify-center gp-rounded gp-bg-[#EEEEEE] gp-p-[4px] hover:gp-bg-[#f4f4f4] group-hover:gp-visible",
127
127
  onClick: openPageSetting,
128
128
  children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
@@ -9,28 +9,19 @@ const parseHtml = (html, isHead)=>{
9
9
  try {
10
10
  return parse(html, {
11
11
  replace: (node)=>{
12
- if (node.type === 'script' && node instanceof parse.Element) {
13
- const child = node.children?.[0];
14
- if (child instanceof parse.Text) {
15
- if (isHead) return /*#__PURE__*/ jsxRuntime.jsx("script", {
16
- ...node.attribs,
17
- dangerouslySetInnerHTML: {
18
- __html: child.data
19
- }
20
- });
21
- else return /*#__PURE__*/ jsxRuntime.jsx(Script, {
22
- ...node.attribs,
23
- dangerouslySetInnerHTML: {
24
- __html: child.data
25
- }
26
- });
27
- } else {
28
- if (!isHead) {
29
- return /*#__PURE__*/ jsxRuntime.jsx(Script, {
30
- ...node.attribs
31
- });
12
+ if (node.type !== 'script' || !(node instanceof parse.Element)) return null;
13
+ const child = node.children?.[0];
14
+ if (!child) return null;
15
+ if (!(child instanceof parse.Text) && !isHead) return /*#__PURE__*/ jsxRuntime.jsx(Script, {
16
+ ...node.attribs
17
+ });
18
+ if (child instanceof parse.Text && isHead) {
19
+ return /*#__PURE__*/ jsxRuntime.jsx("script", {
20
+ ...node.attribs,
21
+ dangerouslySetInnerHTML: {
22
+ __html: child.data
32
23
  }
33
- }
24
+ });
34
25
  }
35
26
  }
36
27
  });
@@ -118,7 +118,7 @@ const Header = (props)=>{
118
118
  })
119
119
  ]
120
120
  }),
121
- !isOriginTemplate && /*#__PURE__*/ jsx("button", {
121
+ !(isOriginTemplate || pageType === 'STATIC') && /*#__PURE__*/ jsx("button", {
122
122
  className: "gp-header gp-invisible gp-absolute gp-left-[8px] gp-flex gp-h-[24px] gp-cursor-pointer gp-items-center gp-justify-center gp-rounded gp-bg-[#EEEEEE] gp-p-[4px] hover:gp-bg-[#f4f4f4] group-hover:gp-visible",
123
123
  onClick: openPageSetting,
124
124
  children: /*#__PURE__*/ jsxs("div", {
@@ -7,28 +7,19 @@ const parseHtml = (html, isHead)=>{
7
7
  try {
8
8
  return parse(html, {
9
9
  replace: (node)=>{
10
- if (node.type === 'script' && node instanceof Element) {
11
- const child = node.children?.[0];
12
- if (child instanceof Text) {
13
- if (isHead) return /*#__PURE__*/ jsx("script", {
14
- ...node.attribs,
15
- dangerouslySetInnerHTML: {
16
- __html: child.data
17
- }
18
- });
19
- else return /*#__PURE__*/ jsx(Script, {
20
- ...node.attribs,
21
- dangerouslySetInnerHTML: {
22
- __html: child.data
23
- }
24
- });
25
- } else {
26
- if (!isHead) {
27
- return /*#__PURE__*/ jsx(Script, {
28
- ...node.attribs
29
- });
10
+ if (node.type !== 'script' || !(node instanceof Element)) return null;
11
+ const child = node.children?.[0];
12
+ if (!child) return null;
13
+ if (!(child instanceof Text) && !isHead) return /*#__PURE__*/ jsx(Script, {
14
+ ...node.attribs
15
+ });
16
+ if (child instanceof Text && isHead) {
17
+ return /*#__PURE__*/ jsx("script", {
18
+ ...node.attribs,
19
+ dangerouslySetInnerHTML: {
20
+ __html: child.data
30
21
  }
31
- }
22
+ });
32
23
  }
33
24
  }
34
25
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.58.0",
3
+ "version": "1.60.9",
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.58.0",
29
+ "@gem-sdk/core": "1.60.7",
30
30
  "@gem-sdk/plugin-cookie-bar": "1.58.0",
31
31
  "@gem-sdk/plugin-quick-view": "1.58.0",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "1.58.0"