@gem-sdk/pages 1.58.0 → 1.60.8
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,21 @@ const parseHtml = (html, isHead)=>{
|
|
|
9
9
|
try {
|
|
10
10
|
return parse(html, {
|
|
11
11
|
replace: (node)=>{
|
|
12
|
-
if (node.type
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
+
type: "text/javascript",
|
|
22
|
+
strategy: isHead ? 'beforeInteractive' : 'afterInteractive',
|
|
23
|
+
dangerouslySetInnerHTML: {
|
|
24
|
+
__html: child.data
|
|
32
25
|
}
|
|
33
|
-
}
|
|
26
|
+
});
|
|
34
27
|
}
|
|
35
28
|
}
|
|
36
29
|
});
|
|
@@ -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,21 @@ const parseHtml = (html, isHead)=>{
|
|
|
7
7
|
try {
|
|
8
8
|
return parse(html, {
|
|
9
9
|
replace: (node)=>{
|
|
10
|
-
if (node.type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
type: "text/javascript",
|
|
20
|
+
strategy: isHead ? 'beforeInteractive' : 'afterInteractive',
|
|
21
|
+
dangerouslySetInnerHTML: {
|
|
22
|
+
__html: child.data
|
|
30
23
|
}
|
|
31
|
-
}
|
|
24
|
+
});
|
|
32
25
|
}
|
|
33
26
|
}
|
|
34
27
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.60.8",
|
|
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.
|
|
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"
|