@gem-sdk/core 2.0.0-staging.136 → 2.0.0-staging.152
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.
- package/dist/cjs/components/theme-section/CreateThemeSection.js +4 -0
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +8 -2
- package/dist/cjs/contexts/ShopContext.js +5 -0
- package/dist/esm/components/theme-section/CreateThemeSection.js +4 -0
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +8 -2
- package/dist/esm/contexts/ShopContext.js +5 -0
- package/dist/types/index.d.ts +3 -1
- package/package.json +2 -2
|
@@ -23,13 +23,16 @@ const LIMIT_PLANS = [
|
|
|
23
23
|
'trial',
|
|
24
24
|
'trial2022'
|
|
25
25
|
];
|
|
26
|
+
const SHOPIFY_STARTER_PLAN = 'Shopify Starter';
|
|
26
27
|
const CreateThemeSection = ({ ...props })=>{
|
|
27
28
|
const shopPlan = ShopContext.useShopStore((s)=>s.plan);
|
|
29
|
+
const shopifyPlan = ShopContext.useShopStore((s)=>s.shopifyPlan);
|
|
28
30
|
const createThemeSectionCount = ShopContext.useShopStore((s)=>s.createThemeSectionCount);
|
|
29
31
|
const limitCreateThemeSection = ShopContext.useShopStore((s)=>s.limitCreateThemeSection);
|
|
30
32
|
const isFreeLimit = LIMIT_PLANS.includes(shopPlan ?? '');
|
|
31
33
|
const isLimit = isFreeLimit || limitCreateThemeSection?.isLimit;
|
|
32
34
|
const isRenderTooltip = isLimit || createThemeSectionCount === undefined || createThemeSectionCount < NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP;
|
|
35
|
+
const isShopifyStaterPlan = shopifyPlan == SHOPIFY_STARTER_PLAN;
|
|
33
36
|
const timeoutRef = react.useRef();
|
|
34
37
|
const [isShowTooltip, setIsShowTooltip] = react.useState(false);
|
|
35
38
|
const showTooltip = ()=>{
|
|
@@ -70,6 +73,7 @@ const CreateThemeSection = ({ ...props })=>{
|
|
|
70
73
|
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
71
74
|
children: /*#__PURE__*/ jsxRuntime.jsxs(ThemeSectionTooltip.ThemeSectionTooltip, {
|
|
72
75
|
isFreeLimit: isFreeLimit,
|
|
76
|
+
isShopifyStaterPlan: isShopifyStaterPlan,
|
|
73
77
|
limitCreateThemeSection: limitCreateThemeSection,
|
|
74
78
|
isShow: isShowTooltip,
|
|
75
79
|
isRender: isRenderTooltip,
|
|
@@ -28,7 +28,7 @@ const transitions = {
|
|
|
28
28
|
opacity: 0
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCreateThemeSection, onMouseEnter, onMouseLeave, onActions })=>{
|
|
31
|
+
const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCreateThemeSection, isShopifyStaterPlan, onMouseEnter, onMouseLeave, onActions })=>{
|
|
32
32
|
const nodeRef = react.useRef(null);
|
|
33
33
|
const actionBtnLabel = isFreeLimit ? 'Upgrade to create Theme Section' : 'Create Theme Section';
|
|
34
34
|
const openHelpCenter = ()=>{
|
|
@@ -54,7 +54,13 @@ const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCre
|
|
|
54
54
|
...defaultStyles,
|
|
55
55
|
...transitions[state]
|
|
56
56
|
},
|
|
57
|
-
children:
|
|
57
|
+
children: isShopifyStaterPlan ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
58
|
+
className: "theme-section-tooltip__body theme-section-tooltip__body-disabled",
|
|
59
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
60
|
+
className: "theme-section-tooltip__body-desc theme-section-tooltip__body-disabled__desc",
|
|
61
|
+
children: "Creating Theme Sections is unavailable on the Shopify Starter plan"
|
|
62
|
+
})
|
|
63
|
+
}) : limitCreateThemeSection?.isLimit && !isFreeLimit ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
58
64
|
className: "theme-section-tooltip__body theme-section-tooltip__body-limit",
|
|
59
65
|
children: [
|
|
60
66
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -21,13 +21,16 @@ const LIMIT_PLANS = [
|
|
|
21
21
|
'trial',
|
|
22
22
|
'trial2022'
|
|
23
23
|
];
|
|
24
|
+
const SHOPIFY_STARTER_PLAN = 'Shopify Starter';
|
|
24
25
|
const CreateThemeSection = ({ ...props })=>{
|
|
25
26
|
const shopPlan = useShopStore((s)=>s.plan);
|
|
27
|
+
const shopifyPlan = useShopStore((s)=>s.shopifyPlan);
|
|
26
28
|
const createThemeSectionCount = useShopStore((s)=>s.createThemeSectionCount);
|
|
27
29
|
const limitCreateThemeSection = useShopStore((s)=>s.limitCreateThemeSection);
|
|
28
30
|
const isFreeLimit = LIMIT_PLANS.includes(shopPlan ?? '');
|
|
29
31
|
const isLimit = isFreeLimit || limitCreateThemeSection?.isLimit;
|
|
30
32
|
const isRenderTooltip = isLimit || createThemeSectionCount === undefined || createThemeSectionCount < NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP;
|
|
33
|
+
const isShopifyStaterPlan = shopifyPlan == SHOPIFY_STARTER_PLAN;
|
|
31
34
|
const timeoutRef = useRef();
|
|
32
35
|
const [isShowTooltip, setIsShowTooltip] = useState(false);
|
|
33
36
|
const showTooltip = ()=>{
|
|
@@ -68,6 +71,7 @@ const CreateThemeSection = ({ ...props })=>{
|
|
|
68
71
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
69
72
|
children: /*#__PURE__*/ jsxs(ThemeSectionTooltip, {
|
|
70
73
|
isFreeLimit: isFreeLimit,
|
|
74
|
+
isShopifyStaterPlan: isShopifyStaterPlan,
|
|
71
75
|
limitCreateThemeSection: limitCreateThemeSection,
|
|
72
76
|
isShow: isShowTooltip,
|
|
73
77
|
isRender: isRenderTooltip,
|
|
@@ -26,7 +26,7 @@ const transitions = {
|
|
|
26
26
|
opacity: 0
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCreateThemeSection, onMouseEnter, onMouseLeave, onActions })=>{
|
|
29
|
+
const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCreateThemeSection, isShopifyStaterPlan, onMouseEnter, onMouseLeave, onActions })=>{
|
|
30
30
|
const nodeRef = useRef(null);
|
|
31
31
|
const actionBtnLabel = isFreeLimit ? 'Upgrade to create Theme Section' : 'Create Theme Section';
|
|
32
32
|
const openHelpCenter = ()=>{
|
|
@@ -52,7 +52,13 @@ const ThemeSectionTooltip = ({ isShow, isFreeLimit, isRender, children, limitCre
|
|
|
52
52
|
...defaultStyles,
|
|
53
53
|
...transitions[state]
|
|
54
54
|
},
|
|
55
|
-
children:
|
|
55
|
+
children: isShopifyStaterPlan ? /*#__PURE__*/ jsx("div", {
|
|
56
|
+
className: "theme-section-tooltip__body theme-section-tooltip__body-disabled",
|
|
57
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
58
|
+
className: "theme-section-tooltip__body-desc theme-section-tooltip__body-disabled__desc",
|
|
59
|
+
children: "Creating Theme Sections is unavailable on the Shopify Starter plan"
|
|
60
|
+
})
|
|
61
|
+
}) : limitCreateThemeSection?.isLimit && !isFreeLimit ? /*#__PURE__*/ jsxs("div", {
|
|
56
62
|
className: "theme-section-tooltip__body theme-section-tooltip__body-limit",
|
|
57
63
|
children: [
|
|
58
64
|
/*#__PURE__*/ jsx("div", {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -31622,6 +31622,7 @@ type ShopContextProps = {
|
|
|
31622
31622
|
isStorefront?: boolean;
|
|
31623
31623
|
createThemeSectionCount?: number;
|
|
31624
31624
|
plan?: string;
|
|
31625
|
+
shopifyPlan?: string;
|
|
31625
31626
|
timezone?: string;
|
|
31626
31627
|
generateContentLimitation?: {
|
|
31627
31628
|
isAllow: boolean;
|
|
@@ -31643,6 +31644,7 @@ type ShopContextProps = {
|
|
|
31643
31644
|
changeLayoutSettings: (layoutSettings: LayoutSettings) => void;
|
|
31644
31645
|
changeCreateThemeSectionCount: (count: number) => void;
|
|
31645
31646
|
changeShopPlan: (plan: string) => void;
|
|
31647
|
+
changeShopifyPlan: (shopifyPlan: string) => void;
|
|
31646
31648
|
changeLimitCreateThemeSection: (data: {
|
|
31647
31649
|
isLimit?: boolean;
|
|
31648
31650
|
total?: number;
|
|
@@ -31653,7 +31655,7 @@ type ShopProviderProps = {
|
|
|
31653
31655
|
children: React.ReactNode;
|
|
31654
31656
|
key?: React.Key;
|
|
31655
31657
|
addons: AddonContextProps['components'];
|
|
31656
|
-
storeOption: Omit<ShopContextProps, 'changeLocale' | 'changeStorefrontInfo' | 'changeCurrency' | 'changeSwatches' | 'changeLayoutSettings' | 'changeCreateThemeSectionCount' | 'changeShopPlan' | 'changeLimitCreateThemeSection'>;
|
|
31658
|
+
storeOption: Omit<ShopContextProps, 'changeLocale' | 'changeStorefrontInfo' | 'changeCurrency' | 'changeSwatches' | 'changeLayoutSettings' | 'changeCreateThemeSectionCount' | 'changeShopPlan' | 'changeShopifyPlan' | 'changeLimitCreateThemeSection'>;
|
|
31657
31659
|
queryOption?: React.ComponentProps<typeof SWRConfig>['value'];
|
|
31658
31660
|
};
|
|
31659
31661
|
declare const ShopProvider: React.FC<ShopProviderProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "2.0.0-staging.
|
|
3
|
+
"version": "2.0.0-staging.152",
|
|
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.58.0-staging.79",
|
|
31
|
-
"@gem-sdk/styles": "2.0.0-staging.
|
|
31
|
+
"@gem-sdk/styles": "2.0.0-staging.152",
|
|
32
32
|
"@types/classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|