@gem-sdk/core 1.21.7 → 1.21.10
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/ComponentWrapperPreview.js +27 -10
- package/dist/cjs/components/Render.liquid.js +26 -0
- package/dist/cjs/components/RenderCustomCode.js +56 -0
- package/dist/cjs/contexts/ProductContext.js +5 -3
- package/dist/cjs/hooks/useProduct.js +4 -0
- package/dist/cjs/index.js +1 -0
- package/dist/esm/components/ComponentWrapperPreview.js +28 -11
- package/dist/esm/components/Render.liquid.js +26 -0
- package/dist/esm/components/RenderCustomCode.js +52 -0
- package/dist/esm/contexts/ProductContext.js +5 -3
- package/dist/esm/hooks/useProduct.js +4 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/index.d.ts +18 -7
- package/package.json +2 -2
|
@@ -6,6 +6,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var composeAdvanceStyle = require('../helpers/compose-advance-style.js');
|
|
8
8
|
var constant = require('./constant.js');
|
|
9
|
+
var RenderCustomCode = require('./RenderCustomCode.js');
|
|
9
10
|
|
|
10
11
|
const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
11
12
|
if (props.type === 'section') {
|
|
@@ -53,19 +54,35 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
53
54
|
'data-component-label': props.label
|
|
54
55
|
};
|
|
55
56
|
if (constant.disableWrap.includes(props.tag) && /*#__PURE__*/ react.isValidElement(children)) {
|
|
56
|
-
return /*#__PURE__*/ jsxRuntime.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ jsxRuntime.jsx(RenderCustomCode.default, {
|
|
60
|
+
uid: props.uid,
|
|
61
|
+
advanced: advanced
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ jsxRuntime.jsx(children.type, {
|
|
64
|
+
...children.props,
|
|
65
|
+
style,
|
|
66
|
+
builderAttrs,
|
|
67
|
+
advanced
|
|
68
|
+
})
|
|
69
|
+
]
|
|
61
70
|
});
|
|
62
71
|
}
|
|
63
72
|
// Render
|
|
64
|
-
return /*#__PURE__*/ jsxRuntime.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ jsxRuntime.jsx(RenderCustomCode.default, {
|
|
76
|
+
uid: props.uid,
|
|
77
|
+
advanced: advanced
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
80
|
+
style: style,
|
|
81
|
+
className: `${props.uid}`,
|
|
82
|
+
...builderAttrs,
|
|
83
|
+
children: children
|
|
84
|
+
})
|
|
85
|
+
]
|
|
69
86
|
});
|
|
70
87
|
};
|
|
71
88
|
|
|
@@ -136,12 +136,38 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, ...passPr
|
|
|
136
136
|
})}
|
|
137
137
|
</div>`;
|
|
138
138
|
}
|
|
139
|
+
const { cssCode, jsCode } = RenderCustomCode(item);
|
|
140
|
+
if (cssCode) liquid += cssCode;
|
|
141
|
+
if (jsCode) liquid += jsCode;
|
|
139
142
|
return {
|
|
140
143
|
liquid,
|
|
141
144
|
extraFiles: customProps.extraFiles
|
|
142
145
|
};
|
|
143
146
|
}
|
|
144
147
|
};
|
|
148
|
+
const RenderCustomCode = (item)=>{
|
|
149
|
+
const { css, javascript, rootClassName } = item.advanced?.editorData || {};
|
|
150
|
+
const replacedCSS = css?.replaceAll(rootClassName, item.uid);
|
|
151
|
+
const replacedJS = javascript?.replaceAll(rootClassName, item.uid);
|
|
152
|
+
const cssCode = render.RenderIf(!!css, render.template`
|
|
153
|
+
<style
|
|
154
|
+
id="${`custom-css-${item?.uid}`}"
|
|
155
|
+
>${replacedCSS}</style>
|
|
156
|
+
`);
|
|
157
|
+
const jsCode = render.RenderIf(!!javascript, render.template`
|
|
158
|
+
<script
|
|
159
|
+
id="${`custom-js-${item?.uid}`}"
|
|
160
|
+
>
|
|
161
|
+
try {
|
|
162
|
+
${replacedJS}
|
|
163
|
+
} catch(err){}
|
|
164
|
+
</script>
|
|
165
|
+
`);
|
|
166
|
+
return {
|
|
167
|
+
cssCode,
|
|
168
|
+
jsCode
|
|
169
|
+
};
|
|
170
|
+
};
|
|
145
171
|
const RenderChildren = (props)=>{
|
|
146
172
|
const data = Render(props);
|
|
147
173
|
// Append to prop parent
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var Head = require('next/head');
|
|
7
|
+
var Script = require('next/script');
|
|
8
|
+
var react = require('react');
|
|
9
|
+
require('zustand');
|
|
10
|
+
require('swr');
|
|
11
|
+
require('@gem-sdk/adapter-shopify');
|
|
12
|
+
require('swr/mutation');
|
|
13
|
+
var shop = require('../hooks/shop.js');
|
|
14
|
+
require('vanilla-lazyload');
|
|
15
|
+
require('../hooks/useCartUI.js');
|
|
16
|
+
require('../helpers/convert.js');
|
|
17
|
+
|
|
18
|
+
const RenderCustomCode = ({ uid, advanced })=>{
|
|
19
|
+
const mode = shop.useEditorMode();
|
|
20
|
+
const { css, javascript, rootClassName } = advanced?.editorData || {};
|
|
21
|
+
const replacedCSS = css?.replaceAll(rootClassName, uid);
|
|
22
|
+
const replacedJS = javascript?.replaceAll(rootClassName, uid);
|
|
23
|
+
const mapId = {
|
|
24
|
+
css: `custom-css-${uid}`,
|
|
25
|
+
javascript: `custom-js-${uid}`
|
|
26
|
+
};
|
|
27
|
+
const jsCode = react.useMemo(()=>{
|
|
28
|
+
return `
|
|
29
|
+
try {
|
|
30
|
+
${replacedJS}
|
|
31
|
+
} catch(err){}
|
|
32
|
+
`;
|
|
33
|
+
}, [
|
|
34
|
+
replacedJS
|
|
35
|
+
]);
|
|
36
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ jsxRuntime.jsx(Head, {
|
|
39
|
+
children: !!css && /*#__PURE__*/ jsxRuntime.jsx("style", {
|
|
40
|
+
id: mapId['css'],
|
|
41
|
+
dangerouslySetInnerHTML: {
|
|
42
|
+
__html: replacedCSS
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}),
|
|
46
|
+
!!javascript && mode !== 'edit' && /*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
47
|
+
id: mapId['javascript'],
|
|
48
|
+
dangerouslySetInnerHTML: {
|
|
49
|
+
__html: jsCode
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.default = RenderCustomCode;
|
|
@@ -96,7 +96,7 @@ const createProductStoreProvider = (data)=>zustand.createStore((set, get)=>({
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
}));
|
|
99
|
-
const ProductProvider = ({ children, product, initialVariantId, quantity = 1 })=>{
|
|
99
|
+
const ProductProvider = ({ children, product, initialVariantId, quantity = 1, isSyncProduct })=>{
|
|
100
100
|
const uiqueId = react.useId();
|
|
101
101
|
const store = react.useMemo(()=>{
|
|
102
102
|
let selectedOptions = {};
|
|
@@ -122,13 +122,15 @@ const ProductProvider = ({ children, product, initialVariantId, quantity = 1 })=
|
|
|
122
122
|
quantity,
|
|
123
123
|
selectedOptions,
|
|
124
124
|
uiqueId,
|
|
125
|
-
featuredImageGlobal
|
|
125
|
+
featuredImageGlobal,
|
|
126
|
+
isSyncProduct
|
|
126
127
|
});
|
|
127
128
|
}, [
|
|
128
129
|
initialVariantId,
|
|
129
130
|
product,
|
|
130
131
|
quantity,
|
|
131
|
-
uiqueId
|
|
132
|
+
uiqueId,
|
|
133
|
+
isSyncProduct
|
|
132
134
|
]);
|
|
133
135
|
return /*#__PURE__*/ jsxRuntime.jsx(ProductContext.Provider, {
|
|
134
136
|
value: store,
|
|
@@ -20,6 +20,9 @@ const useFeaturedImageGlobal = ()=>{
|
|
|
20
20
|
const useProductProperties = ()=>{
|
|
21
21
|
return ProductContext.useProductStore((s)=>s.properties);
|
|
22
22
|
};
|
|
23
|
+
const useIsSyncProduct = ()=>{
|
|
24
|
+
return ProductContext.useProductStore((s)=>s.isSyncProduct);
|
|
25
|
+
};
|
|
23
26
|
const useQuantity = ()=>{
|
|
24
27
|
const quantity = ProductContext.useProductStore((s)=>s.quantity);
|
|
25
28
|
const decrement = ProductContext.useProductStore((s)=>s.decrementQuantity);
|
|
@@ -144,6 +147,7 @@ exports.useCheckAvailableVariantInStock = useCheckAvailableVariantInStock;
|
|
|
144
147
|
exports.useCurrentVariant = useCurrentVariant;
|
|
145
148
|
exports.useCurrentVariantInStock = useCurrentVariantInStock;
|
|
146
149
|
exports.useFeaturedImageGlobal = useFeaturedImageGlobal;
|
|
150
|
+
exports.useIsSyncProduct = useIsSyncProduct;
|
|
147
151
|
exports.useProduct = useProduct;
|
|
148
152
|
exports.useProductProperties = useProductProperties;
|
|
149
153
|
exports.useQuantity = useQuantity;
|
package/dist/cjs/index.js
CHANGED
|
@@ -268,6 +268,7 @@ exports.useCheckAvailableVariantInStock = useProduct.useCheckAvailableVariantInS
|
|
|
268
268
|
exports.useCurrentVariant = useProduct.useCurrentVariant;
|
|
269
269
|
exports.useCurrentVariantInStock = useProduct.useCurrentVariantInStock;
|
|
270
270
|
exports.useFeaturedImageGlobal = useProduct.useFeaturedImageGlobal;
|
|
271
|
+
exports.useIsSyncProduct = useProduct.useIsSyncProduct;
|
|
271
272
|
exports.useProduct = useProduct.useProduct;
|
|
272
273
|
exports.useProductProperties = useProduct.useProductProperties;
|
|
273
274
|
exports.useQuantity = useProduct.useQuantity;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { isValidElement } from 'react';
|
|
3
3
|
import { composeAdvanceStyle } from '../helpers/compose-advance-style.js';
|
|
4
4
|
import { disableWrap } from './constant.js';
|
|
5
|
+
import RenderCustomCode from './RenderCustomCode.js';
|
|
5
6
|
|
|
6
7
|
const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
7
8
|
if (props.type === 'section') {
|
|
@@ -49,19 +50,35 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
49
50
|
'data-component-label': props.label
|
|
50
51
|
};
|
|
51
52
|
if (disableWrap.includes(props.tag) && /*#__PURE__*/ isValidElement(children)) {
|
|
52
|
-
return /*#__PURE__*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ jsx(RenderCustomCode, {
|
|
56
|
+
uid: props.uid,
|
|
57
|
+
advanced: advanced
|
|
58
|
+
}),
|
|
59
|
+
/*#__PURE__*/ jsx(children.type, {
|
|
60
|
+
...children.props,
|
|
61
|
+
style,
|
|
62
|
+
builderAttrs,
|
|
63
|
+
advanced
|
|
64
|
+
})
|
|
65
|
+
]
|
|
57
66
|
});
|
|
58
67
|
}
|
|
59
68
|
// Render
|
|
60
|
-
return /*#__PURE__*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
70
|
+
children: [
|
|
71
|
+
/*#__PURE__*/ jsx(RenderCustomCode, {
|
|
72
|
+
uid: props.uid,
|
|
73
|
+
advanced: advanced
|
|
74
|
+
}),
|
|
75
|
+
/*#__PURE__*/ jsx("div", {
|
|
76
|
+
style: style,
|
|
77
|
+
className: `${props.uid}`,
|
|
78
|
+
...builderAttrs,
|
|
79
|
+
children: children
|
|
80
|
+
})
|
|
81
|
+
]
|
|
65
82
|
});
|
|
66
83
|
};
|
|
67
84
|
|
|
@@ -132,12 +132,38 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, ...passPr
|
|
|
132
132
|
})}
|
|
133
133
|
</div>`;
|
|
134
134
|
}
|
|
135
|
+
const { cssCode, jsCode } = RenderCustomCode(item);
|
|
136
|
+
if (cssCode) liquid += cssCode;
|
|
137
|
+
if (jsCode) liquid += jsCode;
|
|
135
138
|
return {
|
|
136
139
|
liquid,
|
|
137
140
|
extraFiles: customProps.extraFiles
|
|
138
141
|
};
|
|
139
142
|
}
|
|
140
143
|
};
|
|
144
|
+
const RenderCustomCode = (item)=>{
|
|
145
|
+
const { css, javascript, rootClassName } = item.advanced?.editorData || {};
|
|
146
|
+
const replacedCSS = css?.replaceAll(rootClassName, item.uid);
|
|
147
|
+
const replacedJS = javascript?.replaceAll(rootClassName, item.uid);
|
|
148
|
+
const cssCode = RenderIf(!!css, template`
|
|
149
|
+
<style
|
|
150
|
+
id="${`custom-css-${item?.uid}`}"
|
|
151
|
+
>${replacedCSS}</style>
|
|
152
|
+
`);
|
|
153
|
+
const jsCode = RenderIf(!!javascript, template`
|
|
154
|
+
<script
|
|
155
|
+
id="${`custom-js-${item?.uid}`}"
|
|
156
|
+
>
|
|
157
|
+
try {
|
|
158
|
+
${replacedJS}
|
|
159
|
+
} catch(err){}
|
|
160
|
+
</script>
|
|
161
|
+
`);
|
|
162
|
+
return {
|
|
163
|
+
cssCode,
|
|
164
|
+
jsCode
|
|
165
|
+
};
|
|
166
|
+
};
|
|
141
167
|
const RenderChildren = (props)=>{
|
|
142
168
|
const data = Render(props);
|
|
143
169
|
// Append to prop parent
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import Head from 'next/head';
|
|
3
|
+
import Script from 'next/script';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import 'zustand';
|
|
6
|
+
import 'swr';
|
|
7
|
+
import '@gem-sdk/adapter-shopify';
|
|
8
|
+
import 'swr/mutation';
|
|
9
|
+
import { useEditorMode } from '../hooks/shop.js';
|
|
10
|
+
import 'vanilla-lazyload';
|
|
11
|
+
import '../hooks/useCartUI.js';
|
|
12
|
+
import '../helpers/convert.js';
|
|
13
|
+
|
|
14
|
+
const RenderCustomCode = ({ uid, advanced })=>{
|
|
15
|
+
const mode = useEditorMode();
|
|
16
|
+
const { css, javascript, rootClassName } = advanced?.editorData || {};
|
|
17
|
+
const replacedCSS = css?.replaceAll(rootClassName, uid);
|
|
18
|
+
const replacedJS = javascript?.replaceAll(rootClassName, uid);
|
|
19
|
+
const mapId = {
|
|
20
|
+
css: `custom-css-${uid}`,
|
|
21
|
+
javascript: `custom-js-${uid}`
|
|
22
|
+
};
|
|
23
|
+
const jsCode = useMemo(()=>{
|
|
24
|
+
return `
|
|
25
|
+
try {
|
|
26
|
+
${replacedJS}
|
|
27
|
+
} catch(err){}
|
|
28
|
+
`;
|
|
29
|
+
}, [
|
|
30
|
+
replacedJS
|
|
31
|
+
]);
|
|
32
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ jsx(Head, {
|
|
35
|
+
children: !!css && /*#__PURE__*/ jsx("style", {
|
|
36
|
+
id: mapId['css'],
|
|
37
|
+
dangerouslySetInnerHTML: {
|
|
38
|
+
__html: replacedCSS
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
!!javascript && mode !== 'edit' && /*#__PURE__*/ jsx(Script, {
|
|
43
|
+
id: mapId['javascript'],
|
|
44
|
+
dangerouslySetInnerHTML: {
|
|
45
|
+
__html: jsCode
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { RenderCustomCode as default };
|
|
@@ -94,7 +94,7 @@ const createProductStoreProvider = (data)=>createStore((set, get)=>({
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}));
|
|
97
|
-
const ProductProvider = ({ children, product, initialVariantId, quantity = 1 })=>{
|
|
97
|
+
const ProductProvider = ({ children, product, initialVariantId, quantity = 1, isSyncProduct })=>{
|
|
98
98
|
const uiqueId = useId();
|
|
99
99
|
const store = useMemo(()=>{
|
|
100
100
|
let selectedOptions = {};
|
|
@@ -120,13 +120,15 @@ const ProductProvider = ({ children, product, initialVariantId, quantity = 1 })=
|
|
|
120
120
|
quantity,
|
|
121
121
|
selectedOptions,
|
|
122
122
|
uiqueId,
|
|
123
|
-
featuredImageGlobal
|
|
123
|
+
featuredImageGlobal,
|
|
124
|
+
isSyncProduct
|
|
124
125
|
});
|
|
125
126
|
}, [
|
|
126
127
|
initialVariantId,
|
|
127
128
|
product,
|
|
128
129
|
quantity,
|
|
129
|
-
uiqueId
|
|
130
|
+
uiqueId,
|
|
131
|
+
isSyncProduct
|
|
130
132
|
]);
|
|
131
133
|
return /*#__PURE__*/ jsx(ProductContext.Provider, {
|
|
132
134
|
value: store,
|
|
@@ -18,6 +18,9 @@ const useFeaturedImageGlobal = ()=>{
|
|
|
18
18
|
const useProductProperties = ()=>{
|
|
19
19
|
return useProductStore((s)=>s.properties);
|
|
20
20
|
};
|
|
21
|
+
const useIsSyncProduct = ()=>{
|
|
22
|
+
return useProductStore((s)=>s.isSyncProduct);
|
|
23
|
+
};
|
|
21
24
|
const useQuantity = ()=>{
|
|
22
25
|
const quantity = useProductStore((s)=>s.quantity);
|
|
23
26
|
const decrement = useProductStore((s)=>s.decrementQuantity);
|
|
@@ -138,4 +141,4 @@ const useCheckAvailableVariantInStock = (optionId, optionValue)=>{
|
|
|
138
141
|
}) : false;
|
|
139
142
|
};
|
|
140
143
|
|
|
141
|
-
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants };
|
|
144
|
+
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useIsSyncProduct, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants };
|
package/dist/esm/index.js
CHANGED
|
@@ -80,7 +80,7 @@ export { default as useIsomorphicLayoutEffect } from './hooks/useIsomorphicLayou
|
|
|
80
80
|
export { default as useLoadScript } from './hooks/useLoadScript.js';
|
|
81
81
|
export { default as useMoney } from './hooks/useMoney.js';
|
|
82
82
|
export { usePrevious } from './hooks/usePrevious.js';
|
|
83
|
-
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants } from './hooks/useProduct.js';
|
|
83
|
+
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useIsSyncProduct, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants } from './hooks/useProduct.js';
|
|
84
84
|
export { useProductList, useProductListProducts, useProductListSettings, useProductListStyles } from './hooks/useProductList.js';
|
|
85
85
|
export { default as useSuspenseFetch } from './hooks/useSuspenseFetch.js';
|
|
86
86
|
export { default as useSwatchesOptions } from './hooks/useSwatchesOptions.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7400,8 +7400,9 @@ type ProductContextProps = {
|
|
|
7400
7400
|
forceSelectedOption: (value?: Record<string, any>) => void;
|
|
7401
7401
|
isSubmit?: boolean;
|
|
7402
7402
|
updateIsSubmit: (value: boolean) => void;
|
|
7403
|
+
isSyncProduct?: boolean;
|
|
7403
7404
|
};
|
|
7404
|
-
type ProductProviderProps = Pick<ProductContextProps, 'product' | 'quantity' | 'selectedOptions'> & {
|
|
7405
|
+
type ProductProviderProps = Pick<ProductContextProps, 'product' | 'quantity' | 'selectedOptions' | 'isSyncProduct'> & {
|
|
7405
7406
|
initialVariantId?: string;
|
|
7406
7407
|
readOnly?: boolean;
|
|
7407
7408
|
children: React.ReactNode;
|
|
@@ -8389,6 +8390,15 @@ declare const composeTypographyStyle: (typo?: TypographySettingV2, typography?:
|
|
|
8389
8390
|
'--pt-mobile'?: csstype.Property.PaddingTop<string | number> | undefined;
|
|
8390
8391
|
'--hvr-pt-mobile'?: csstype.Property.PaddingTop<string | number> | undefined;
|
|
8391
8392
|
'--focus-pt-mobile'?: csstype.Property.PaddingTop<string | number> | undefined;
|
|
8393
|
+
'--pe'?: csstype.Property.PointerEvents | undefined;
|
|
8394
|
+
'--hvr-pe'?: csstype.Property.PointerEvents | undefined;
|
|
8395
|
+
'--focus-pe'?: csstype.Property.PointerEvents | undefined;
|
|
8396
|
+
'--pe-tablet'?: csstype.Property.PointerEvents | undefined;
|
|
8397
|
+
'--hvr-pe-tablet'?: csstype.Property.PointerEvents | undefined;
|
|
8398
|
+
'--focus-pe-tablet'?: csstype.Property.PointerEvents | undefined;
|
|
8399
|
+
'--pe-mobile'?: csstype.Property.PointerEvents | undefined;
|
|
8400
|
+
'--hvr-pe-mobile'?: csstype.Property.PointerEvents | undefined;
|
|
8401
|
+
'--focus-pe-mobile'?: csstype.Property.PointerEvents | undefined;
|
|
8392
8402
|
'--pos'?: csstype.Property.Position | undefined;
|
|
8393
8403
|
'--hvr-pos'?: csstype.Property.Position | undefined;
|
|
8394
8404
|
'--focus-pos'?: csstype.Property.Position | undefined;
|
|
@@ -9418,7 +9428,7 @@ type RequiredCursorEdge<T> = {
|
|
|
9418
9428
|
};
|
|
9419
9429
|
declare const fetchVariants: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<RequiredCursorEdge<VariantSelectFragment>[]>;
|
|
9420
9430
|
declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<(Pick<MediaEdge, "cursor"> & {
|
|
9421
|
-
node?: Maybe<Pick<Media, "width" | "height" | "id" | "
|
|
9431
|
+
node?: Maybe<Pick<Media, "width" | "height" | "id" | "src" | "alt" | "contentType" | "previewImage">>;
|
|
9422
9432
|
})[]>;
|
|
9423
9433
|
|
|
9424
9434
|
type FetchProductsParams = {
|
|
@@ -9601,6 +9611,7 @@ declare const useProductProperties: () => {
|
|
|
9601
9611
|
value?: string | undefined;
|
|
9602
9612
|
required?: boolean | undefined;
|
|
9603
9613
|
}[] | undefined;
|
|
9614
|
+
declare const useIsSyncProduct: () => boolean | undefined;
|
|
9604
9615
|
declare const useQuantity: () => {
|
|
9605
9616
|
quantity: number | undefined;
|
|
9606
9617
|
increment: () => void;
|
|
@@ -9613,13 +9624,13 @@ declare const useSelectedOption: () => {
|
|
|
9613
9624
|
setSelectedOption: (optionId?: Maybe<string>, optionValue?: Maybe<string>, productId?: Maybe<string>, noEmit?: boolean) => void;
|
|
9614
9625
|
forceSelectedOption: (selectedOption?: Record<string, string>, productId?: Maybe<string>, noEmit?: boolean) => void;
|
|
9615
9626
|
};
|
|
9616
|
-
declare const useVariants: () => Maybe<Pick<ProductVariant, "title" | "width" | "length" | "weight" | "height" | "id" | "
|
|
9627
|
+
declare const useVariants: () => Maybe<Pick<ProductVariant, "title" | "width" | "length" | "weight" | "height" | "id" | "baseID" | "platform" | "sku" | "barcode" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "price" | "salePrice" | "soldIndividually"> & {
|
|
9617
9628
|
selectedOptions: Pick<SelectedOption, "value" | "name" | "optionType">[];
|
|
9618
|
-
media?: Maybe<Pick<Media, "width" | "height" | "id" | "
|
|
9629
|
+
media?: Maybe<Pick<Media, "width" | "height" | "id" | "src" | "alt" | "contentType" | "previewImage">>;
|
|
9619
9630
|
}>[];
|
|
9620
|
-
declare const useVariant: (id: string) => Maybe<Pick<ProductVariant, "title" | "width" | "length" | "weight" | "height" | "id" | "
|
|
9631
|
+
declare const useVariant: (id: string) => Maybe<Pick<ProductVariant, "title" | "width" | "length" | "weight" | "height" | "id" | "baseID" | "platform" | "sku" | "barcode" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "price" | "salePrice" | "soldIndividually"> & {
|
|
9621
9632
|
selectedOptions: Pick<SelectedOption, "value" | "name" | "optionType">[];
|
|
9622
|
-
media?: Maybe<Pick<Media, "width" | "height" | "id" | "
|
|
9633
|
+
media?: Maybe<Pick<Media, "width" | "height" | "id" | "src" | "alt" | "contentType" | "previewImage">>;
|
|
9623
9634
|
}>;
|
|
9624
9635
|
declare const useCurrentVariant: () => Maybe<VariantSelectFragment>;
|
|
9625
9636
|
declare const useCurrentVariantInStock: () => boolean;
|
|
@@ -9665,4 +9676,4 @@ type PublishedThemePageSelectFragment = Pick<PublishedThemePage, 'id' | 'name' |
|
|
|
9665
9676
|
|
|
9666
9677
|
declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
|
|
9667
9678
|
|
|
9668
|
-
export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, BoldSubscriptionsWidgetType, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionSelectFragment, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentPreset, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OptionNormalStyle, OptionSpecialStyle, PageType, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, Ratio$1 as Ratio, RenderMemo as Render, RenderChildren, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RivyoWidgetType, RoundedSize, RyviuWidgetType, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeType, SpacingType, StampedWidgetType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, VariantSelectFragment, VitalsWidgetType, WiserWidgetType, WrapRenderChildren, baseAssetURL, calculateFirstProduct, checkAvailableVariantInStock, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, convertOldLayout, dataStringify, fetchMedias, fetchVariants, flattenConnection, fpixel, genSizeClass, genTypoClass, genVariable, generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isColumnDirectionExist, isDefined, isEmptyChildren, isLocalEnv, isSafari, loadScript, makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeNullUndefined, splitStyle, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckAvailableVariantInStock, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, useMoneyFormat, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
|
|
9679
|
+
export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, BoldSubscriptionsWidgetType, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionSelectFragment, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentPreset, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OptionNormalStyle, OptionSpecialStyle, PageType, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, Ratio$1 as Ratio, RenderMemo as Render, RenderChildren, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RivyoWidgetType, RoundedSize, RyviuWidgetType, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeType, SpacingType, StampedWidgetType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, VariantSelectFragment, VitalsWidgetType, WiserWidgetType, WrapRenderChildren, baseAssetURL, calculateFirstProduct, checkAvailableVariantInStock, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, convertOldLayout, dataStringify, fetchMedias, fetchVariants, flattenConnection, fpixel, genSizeClass, genTypoClass, genVariable, generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isColumnDirectionExist, isDefined, isEmptyChildren, isLocalEnv, isSafari, loadScript, makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeNullUndefined, splitStyle, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckAvailableVariantInStock, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsSyncProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, useMoneyFormat, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@gem-sdk/adapter-shopify": "1.12.0",
|
|
28
|
-
"@gem-sdk/styles": "1.21.
|
|
28
|
+
"@gem-sdk/styles": "1.21.8"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-error-boundary": "4.0.10",
|