@gem-sdk/core 1.44.0-dev.140 → 1.44.0-dev.143
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.
|
@@ -53,7 +53,7 @@ const ShopProvider = ({ children, addons, storeOption, queryOption, ...passProps
|
|
|
53
53
|
const store = react.useMemo(()=>createShopStoreProvider(storeOption), [
|
|
54
54
|
storeOption
|
|
55
55
|
]);
|
|
56
|
-
const onUpdateLimitation = (e)=>{
|
|
56
|
+
const onUpdateLimitation = react.useCallback((e)=>{
|
|
57
57
|
const isAllow = !!e.detail?.isAllow;
|
|
58
58
|
const maxGenerateCount = e.detail?.maxGenerateCount;
|
|
59
59
|
const nextQuota = e.detail?.nextQuota;
|
|
@@ -64,13 +64,17 @@ const ShopProvider = ({ children, addons, storeOption, queryOption, ...passProps
|
|
|
64
64
|
nextQuota
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
}
|
|
67
|
+
}, [
|
|
68
|
+
store
|
|
69
|
+
]);
|
|
68
70
|
react.useEffect(()=>{
|
|
69
71
|
window.addEventListener('editor:ai-generate-content-update-limitation', onUpdateLimitation);
|
|
70
72
|
return ()=>{
|
|
71
73
|
window.removeEventListener('editor:ai-generate-content-update-limitation', onUpdateLimitation);
|
|
72
74
|
};
|
|
73
|
-
}, [
|
|
75
|
+
}, [
|
|
76
|
+
onUpdateLimitation
|
|
77
|
+
]);
|
|
74
78
|
return /*#__PURE__*/ jsxRuntime.jsx(AddonContext.AddonProvider, {
|
|
75
79
|
components: addons,
|
|
76
80
|
children: /*#__PURE__*/ jsxRuntime.jsx(useSWR.SWRConfig, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { SWRConfig } from 'swr';
|
|
3
3
|
import { useStore, createStore } from 'zustand';
|
|
4
|
-
import { useMemo, useEffect, useContext, createContext } from 'react';
|
|
4
|
+
import { useMemo, useCallback, useEffect, useContext, createContext } from 'react';
|
|
5
5
|
import { AddonProvider } from './AddonContext.js';
|
|
6
6
|
import { ModalProvider } from './ModalContext.js';
|
|
7
7
|
|
|
@@ -51,7 +51,7 @@ const ShopProvider = ({ children, addons, storeOption, queryOption, ...passProps
|
|
|
51
51
|
const store = useMemo(()=>createShopStoreProvider(storeOption), [
|
|
52
52
|
storeOption
|
|
53
53
|
]);
|
|
54
|
-
const onUpdateLimitation = (e)=>{
|
|
54
|
+
const onUpdateLimitation = useCallback((e)=>{
|
|
55
55
|
const isAllow = !!e.detail?.isAllow;
|
|
56
56
|
const maxGenerateCount = e.detail?.maxGenerateCount;
|
|
57
57
|
const nextQuota = e.detail?.nextQuota;
|
|
@@ -62,13 +62,17 @@ const ShopProvider = ({ children, addons, storeOption, queryOption, ...passProps
|
|
|
62
62
|
nextQuota
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
}
|
|
65
|
+
}, [
|
|
66
|
+
store
|
|
67
|
+
]);
|
|
66
68
|
useEffect(()=>{
|
|
67
69
|
window.addEventListener('editor:ai-generate-content-update-limitation', onUpdateLimitation);
|
|
68
70
|
return ()=>{
|
|
69
71
|
window.removeEventListener('editor:ai-generate-content-update-limitation', onUpdateLimitation);
|
|
70
72
|
};
|
|
71
|
-
}, [
|
|
73
|
+
}, [
|
|
74
|
+
onUpdateLimitation
|
|
75
|
+
]);
|
|
72
76
|
return /*#__PURE__*/ jsx(AddonProvider, {
|
|
73
77
|
components: addons,
|
|
74
78
|
children: /*#__PURE__*/ jsx(SWRConfig, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.44.0-dev.
|
|
3
|
+
"version": "1.44.0-dev.143",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"type-check": "yarn tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/adapter-shopify": "1.44.0-dev.
|
|
31
|
-
"@gem-sdk/styles": "1.44.0-dev.
|
|
30
|
+
"@gem-sdk/adapter-shopify": "1.44.0-dev.143",
|
|
31
|
+
"@gem-sdk/styles": "1.44.0-dev.143",
|
|
32
32
|
"@types/classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|