@gem-sdk/core 1.45.0 → 1.45.2
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.
|
@@ -294,6 +294,11 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
294
294
|
const isEnableCreateThemeSection = ()=>{
|
|
295
295
|
return editingPageType !== 'STATIC' && editingPageType !== 'POST_PURCHASE';
|
|
296
296
|
};
|
|
297
|
+
const isEnableAIContent = ()=>{
|
|
298
|
+
const { isShopifySection, tag } = props;
|
|
299
|
+
if (isShopifySection || isThemeSection && !isThemeSectionEditor) return false;
|
|
300
|
+
return constant.ableGenerateContentElements.includes(tag);
|
|
301
|
+
};
|
|
297
302
|
// if (!isActive) return null;
|
|
298
303
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
299
304
|
children: [
|
|
@@ -459,7 +464,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
459
464
|
props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() && !props.isShopifySection && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(CreateThemeSection.CreateThemeSection, {
|
|
460
465
|
...props
|
|
461
466
|
}),
|
|
462
|
-
|
|
467
|
+
isEnableAIContent() && /*#__PURE__*/ jsxRuntime.jsx(AIContentGenerator.AIContentGenerator, {
|
|
463
468
|
...props
|
|
464
469
|
}),
|
|
465
470
|
props.tag == 'Sticky' && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -108,10 +108,10 @@ const AIContentGenerator = ({ ...props })=>{
|
|
|
108
108
|
ref: genTool,
|
|
109
109
|
children: [
|
|
110
110
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
111
|
-
className: "gp-gen-content-toolbar gp-border-r
|
|
111
|
+
className: "gp-gen-content-toolbar gp-border-r gp-pr-1 gp-mr-1",
|
|
112
112
|
children: /*#__PURE__*/ jsxRuntime.jsxs("button", {
|
|
113
113
|
className: classNames({
|
|
114
|
-
'gp-
|
|
114
|
+
'gp-toolbar-ai-active': isShowPopup
|
|
115
115
|
}, 'gp-p-1 gp-text-xs gp-flex gp-gap-1 gp-items-center gp-rounded-md hover:gp-bg-[#3B3B3B] gp-font-medium'),
|
|
116
116
|
onClick: togglePopup,
|
|
117
117
|
children: [
|
|
@@ -290,6 +290,11 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
290
290
|
const isEnableCreateThemeSection = ()=>{
|
|
291
291
|
return editingPageType !== 'STATIC' && editingPageType !== 'POST_PURCHASE';
|
|
292
292
|
};
|
|
293
|
+
const isEnableAIContent = ()=>{
|
|
294
|
+
const { isShopifySection, tag } = props;
|
|
295
|
+
if (isShopifySection || isThemeSection && !isThemeSectionEditor) return false;
|
|
296
|
+
return ableGenerateContentElements.includes(tag);
|
|
297
|
+
};
|
|
293
298
|
// if (!isActive) return null;
|
|
294
299
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
295
300
|
children: [
|
|
@@ -455,7 +460,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
455
460
|
props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() && !props.isShopifySection && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsx(CreateThemeSection, {
|
|
456
461
|
...props
|
|
457
462
|
}),
|
|
458
|
-
|
|
463
|
+
isEnableAIContent() && /*#__PURE__*/ jsx(AIContentGenerator, {
|
|
459
464
|
...props
|
|
460
465
|
}),
|
|
461
466
|
props.tag == 'Sticky' && /*#__PURE__*/ jsx("div", {
|
|
@@ -106,10 +106,10 @@ const AIContentGenerator = ({ ...props })=>{
|
|
|
106
106
|
ref: genTool,
|
|
107
107
|
children: [
|
|
108
108
|
/*#__PURE__*/ jsx("div", {
|
|
109
|
-
className: "gp-gen-content-toolbar gp-border-r
|
|
109
|
+
className: "gp-gen-content-toolbar gp-border-r gp-pr-1 gp-mr-1",
|
|
110
110
|
children: /*#__PURE__*/ jsxs("button", {
|
|
111
111
|
className: classNames({
|
|
112
|
-
'gp-
|
|
112
|
+
'gp-toolbar-ai-active': isShowPopup
|
|
113
113
|
}, 'gp-p-1 gp-text-xs gp-flex gp-gap-1 gp-items-center gp-rounded-md hover:gp-bg-[#3B3B3B] gp-font-medium'),
|
|
114
114
|
onClick: togglePopup,
|
|
115
115
|
children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.45.
|
|
3
|
+
"version": "1.45.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@gem-sdk/adapter-shopify": "1.45.0",
|
|
31
|
-
"@gem-sdk/styles": "1.45.
|
|
31
|
+
"@gem-sdk/styles": "1.45.2",
|
|
32
32
|
"@types/classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|