@chat-lab/ui 0.1.0-beta.29 → 0.1.0-beta.31
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/components/Chatkit/index.cjs +25 -24
- package/dist/components/Chatkit/index.cjs.map +1 -1
- package/dist/components/Chatkit/index.d.ts +2 -2
- package/dist/components/Chatkit/index.d.ts.map +1 -1
- package/dist/components/Chatkit/index.js +25 -24
- package/dist/components/Chatkit/index.js.map +1 -1
- package/dist/components/assistant-ui/markdown-text.cjs.map +1 -1
- package/dist/components/assistant-ui/markdown-text.d.ts.map +1 -1
- package/dist/components/assistant-ui/markdown-text.js.map +1 -1
- package/dist/components/assistant-ui/reasoning.cjs +3 -1
- package/dist/components/assistant-ui/reasoning.cjs.map +1 -1
- package/dist/components/assistant-ui/reasoning.d.ts.map +1 -1
- package/dist/components/assistant-ui/reasoning.js +3 -1
- package/dist/components/assistant-ui/reasoning.js.map +1 -1
- package/dist/components/assistant-ui/thread.cjs +23 -23
- package/dist/components/assistant-ui/thread.cjs.map +1 -1
- package/dist/components/assistant-ui/thread.d.ts +1 -1
- package/dist/components/assistant-ui/thread.d.ts.map +1 -1
- package/dist/components/assistant-ui/thread.js +23 -23
- package/dist/components/assistant-ui/thread.js.map +1 -1
- package/dist/components/assistant-ui/tooltip-icon-button.d.ts +1 -1
- package/dist/components/assistant-ui/tooltip-icon-button.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/toast.cjs +1 -1
- package/dist/components/ui/toast.cjs.map +1 -1
- package/dist/components/ui/toast.d.ts +7 -7
- package/dist/components/ui/toast.d.ts.map +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/contexts/ChatkitContext.cjs +1 -0
- package/dist/contexts/ChatkitContext.cjs.map +1 -1
- package/dist/contexts/ChatkitContext.d.ts +2 -0
- package/dist/contexts/ChatkitContext.d.ts.map +1 -1
- package/dist/contexts/ChatkitContext.js +1 -0
- package/dist/contexts/ChatkitContext.js.map +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToPairs.cjs +21 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToPairs.cjs.map +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToPairs.js +19 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToPairs.js.map +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createToPairs.cjs +33 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createToPairs.cjs.map +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createToPairs.js +31 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createToPairs.js.map +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToPairs.cjs +21 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToPairs.cjs.map +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToPairs.js +19 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToPairs.js.map +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPairs.cjs +35 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPairs.cjs.map +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPairs.js +33 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPairs.js.map +1 -0
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/react.cjs +63 -0
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/react.cjs.map +1 -0
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/react.js +61 -0
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/react.js.map +1 -0
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/vanilla.cjs +227 -0
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/vanilla.cjs.map +1 -0
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/vanilla.js +223 -0
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/vanilla.js.map +1 -0
- package/dist/packages/core/dist/index.cjs +11 -2
- package/dist/packages/core/dist/index.cjs.map +1 -1
- package/dist/packages/core/dist/index.js +11 -2
- package/dist/packages/core/dist/index.js.map +1 -1
- package/dist/utils/download.cjs +2 -1
- package/dist/utils/download.cjs.map +1 -1
- package/dist/utils/download.d.ts.map +1 -1
- package/dist/utils/download.js +2 -1
- package/dist/utils/download.js.map +1 -1
- package/package.json +8 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatkitContext.cjs","sources":["../../src/contexts/ChatkitContext.ts"],"sourcesContent":["import { ChatkitRef } from \"@/components/Chatkit/types\";\nimport { createContext, MutableRefObject, useContext } from \"react\";\n\nconst Context = createContext<{\n ref: MutableRefObject<ChatkitRef | null>;\n showThreadList: boolean;\n showHeader: boolean;\n plugins: React.ReactNode[];\n placeholder: string;\n expandToolGroup: boolean;\n expandToolDetail: boolean;\n}>({\n ref: {\n current: null,\n },\n showThreadList: false,\n expandToolGroup: false,\n expandToolDetail: false,\n showHeader: true,\n plugins: [],\n placeholder: \"Send a message...\",\n});\n\nexport const ChatkitProvider = Context.Provider;\nexport const useChatkitRef = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\"useChatkitRef must be used within a ChatkitProvider\");\n }\n return context.ref;\n};\nexport const useChatkitPlugins = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\"useChatkitPlugins must be used within a ChatkitProvider\");\n }\n return context.plugins;\n};\n\nexport const useChatkitContext = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n \"useChatkitShowThreadList must be used within a ChatkitProvider\"\n );\n }\n return context;\n};\n"],"names":["createContext","useContext"],"mappings":";;;;AAGA,MAAM,OAAO,GAAGA,mBAAa,
|
|
1
|
+
{"version":3,"file":"ChatkitContext.cjs","sources":["../../src/contexts/ChatkitContext.ts"],"sourcesContent":["import { ChatkitRef } from \"@/components/Chatkit/types\";\nimport { createContext, MutableRefObject, useContext } from \"react\";\n\nconst Context = createContext<{\n ref: MutableRefObject<ChatkitRef | null>;\n showThreadList: boolean;\n showHeader: boolean;\n plugins: React.ReactNode[];\n placeholder: string;\n expandToolGroup: boolean;\n expandToolDetail: boolean;\n expandReasoning: boolean;\n}>({\n ref: {\n current: null,\n },\n showThreadList: false,\n expandToolGroup: false,\n expandToolDetail: false,\n expandReasoning: false,\n showHeader: true,\n plugins: [],\n placeholder: \"Send a message...\",\n});\n\nexport const ChatkitProvider = Context.Provider;\nexport const useChatkitRef = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\"useChatkitRef must be used within a ChatkitProvider\");\n }\n return context.ref;\n};\nexport const useChatkitPlugins = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\"useChatkitPlugins must be used within a ChatkitProvider\");\n }\n return context.plugins;\n};\n\nexport const useChatkitContext = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n \"useChatkitShowThreadList must be used within a ChatkitProvider\"\n );\n }\n return context;\n};\n"],"names":["createContext","useContext"],"mappings":";;;;AAGA,MAAM,OAAO,GAAGA,mBAAa,CAS1B;AACD,IAAA,GAAG,EAAE;AACH,QAAA,OAAO,EAAE,IAAI;AACd,KAAA;AACD,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,gBAAgB,EAAE,KAAK;AACvB,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,WAAW,EAAE,mBAAmB;AACjC,CAAA,CAAC,CAAC;AAEU,MAAA,eAAe,GAAG,OAAO,CAAC,SAAS;AACzC,MAAM,aAAa,GAAG,MAAK;AAChC,IAAA,MAAM,OAAO,GAAGC,gBAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC,GAAG,CAAC;AACrB,EAAE;AACK,MAAM,iBAAiB,GAAG,MAAK;AACpC,IAAA,MAAM,OAAO,GAAGA,gBAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;KAC5E;IACD,OAAO,OAAO,CAAC,OAAO,CAAC;AACzB,EAAE;AAEK,MAAM,iBAAiB,GAAG,MAAK;AACpC,IAAA,MAAM,OAAO,GAAGA,gBAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;KACH;AACD,IAAA,OAAO,OAAO,CAAC;AACjB;;;;;;;"}
|
|
@@ -8,6 +8,7 @@ export declare const ChatkitProvider: import("react").Provider<{
|
|
|
8
8
|
placeholder: string;
|
|
9
9
|
expandToolGroup: boolean;
|
|
10
10
|
expandToolDetail: boolean;
|
|
11
|
+
expandReasoning: boolean;
|
|
11
12
|
}>;
|
|
12
13
|
export declare const useChatkitRef: () => MutableRefObject<ChatkitRef | null>;
|
|
13
14
|
export declare const useChatkitPlugins: () => import("react").ReactNode[];
|
|
@@ -19,5 +20,6 @@ export declare const useChatkitContext: () => {
|
|
|
19
20
|
placeholder: string;
|
|
20
21
|
expandToolGroup: boolean;
|
|
21
22
|
expandToolDetail: boolean;
|
|
23
|
+
expandReasoning: boolean;
|
|
22
24
|
};
|
|
23
25
|
//# sourceMappingURL=ChatkitContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatkitContext.d.ts","sourceRoot":"","sources":["../../src/contexts/ChatkitContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAiB,gBAAgB,EAAc,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatkitContext.d.ts","sourceRoot":"","sources":["../../src/contexts/ChatkitContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAiB,gBAAgB,EAAc,MAAM,OAAO,CAAC;AAwBpE,eAAO,MAAM,eAAe;SArBrB,gBAAgB,CAAC,UAAU,GAAG,IAAI,CAAC;oBACxB,OAAO;gBACX,OAAO;aACV,KAAK,CAAC,SAAS,EAAE;iBACb,MAAM;qBACF,OAAO;sBACN,OAAO;qBACR,OAAO;EAcqB,CAAC;AAChD,eAAO,MAAM,aAAa,2CAOzB,CAAC;AACF,eAAO,MAAM,iBAAiB,mCAO7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;SAvCvB,gBAAgB,CAAC,UAAU,GAAG,IAAI,CAAC;oBACxB,OAAO;gBACX,OAAO;aACV,KAAK,CAAC,SAAS,EAAE;iBACb,MAAM;qBACF,OAAO;sBACN,OAAO;qBACR,OAAO;CAyCzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatkitContext.js","sources":["../../src/contexts/ChatkitContext.ts"],"sourcesContent":["import { ChatkitRef } from \"@/components/Chatkit/types\";\nimport { createContext, MutableRefObject, useContext } from \"react\";\n\nconst Context = createContext<{\n ref: MutableRefObject<ChatkitRef | null>;\n showThreadList: boolean;\n showHeader: boolean;\n plugins: React.ReactNode[];\n placeholder: string;\n expandToolGroup: boolean;\n expandToolDetail: boolean;\n}>({\n ref: {\n current: null,\n },\n showThreadList: false,\n expandToolGroup: false,\n expandToolDetail: false,\n showHeader: true,\n plugins: [],\n placeholder: \"Send a message...\",\n});\n\nexport const ChatkitProvider = Context.Provider;\nexport const useChatkitRef = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\"useChatkitRef must be used within a ChatkitProvider\");\n }\n return context.ref;\n};\nexport const useChatkitPlugins = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\"useChatkitPlugins must be used within a ChatkitProvider\");\n }\n return context.plugins;\n};\n\nexport const useChatkitContext = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n \"useChatkitShowThreadList must be used within a ChatkitProvider\"\n );\n }\n return context;\n};\n"],"names":[],"mappings":";;AAGA,MAAM,OAAO,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"ChatkitContext.js","sources":["../../src/contexts/ChatkitContext.ts"],"sourcesContent":["import { ChatkitRef } from \"@/components/Chatkit/types\";\nimport { createContext, MutableRefObject, useContext } from \"react\";\n\nconst Context = createContext<{\n ref: MutableRefObject<ChatkitRef | null>;\n showThreadList: boolean;\n showHeader: boolean;\n plugins: React.ReactNode[];\n placeholder: string;\n expandToolGroup: boolean;\n expandToolDetail: boolean;\n expandReasoning: boolean;\n}>({\n ref: {\n current: null,\n },\n showThreadList: false,\n expandToolGroup: false,\n expandToolDetail: false,\n expandReasoning: false,\n showHeader: true,\n plugins: [],\n placeholder: \"Send a message...\",\n});\n\nexport const ChatkitProvider = Context.Provider;\nexport const useChatkitRef = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\"useChatkitRef must be used within a ChatkitProvider\");\n }\n return context.ref;\n};\nexport const useChatkitPlugins = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\"useChatkitPlugins must be used within a ChatkitProvider\");\n }\n return context.plugins;\n};\n\nexport const useChatkitContext = () => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n \"useChatkitShowThreadList must be used within a ChatkitProvider\"\n );\n }\n return context;\n};\n"],"names":[],"mappings":";;AAGA,MAAM,OAAO,GAAG,aAAa,CAS1B;AACD,IAAA,GAAG,EAAE;AACH,QAAA,OAAO,EAAE,IAAI;AACd,KAAA;AACD,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,gBAAgB,EAAE,KAAK;AACvB,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,WAAW,EAAE,mBAAmB;AACjC,CAAA,CAAC,CAAC;AAEU,MAAA,eAAe,GAAG,OAAO,CAAC,SAAS;AACzC,MAAM,aAAa,GAAG,MAAK;AAChC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC,GAAG,CAAC;AACrB,EAAE;AACK,MAAM,iBAAiB,GAAG,MAAK;AACpC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;KAC5E;IACD,OAAO,OAAO,CAAC,OAAO,CAAC;AACzB,EAAE;AAEK,MAAM,iBAAiB,GAAG,MAAK;AACpC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;KACH;AACD,IAAA,OAAO,OAAO,CAAC;AACjB;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _arrayMap = require('./_arrayMap.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
|
|
7
|
+
* of key-value pairs for `object` corresponding to the property names of `props`.
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
* @param {Object} object The object to query.
|
|
11
|
+
* @param {Array} props The property names to get values for.
|
|
12
|
+
* @returns {Object} Returns the key-value pairs.
|
|
13
|
+
*/
|
|
14
|
+
function baseToPairs(object, props) {
|
|
15
|
+
return _arrayMap(props, function(key) {
|
|
16
|
+
return [key, object[key]];
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = baseToPairs;
|
|
21
|
+
//# sourceMappingURL=_baseToPairs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseToPairs.cjs","sources":["../../../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToPairs.js"],"sourcesContent":["import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\nfunction baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n}\n\nexport default baseToPairs;\n"],"names":["arrayMap"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE;AACpC,EAAE,OAAOA,SAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,EAAE;AACvC,IAAI,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9B,GAAG,CAAC,CAAC;AACL;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import arrayMap from './_arrayMap.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
|
|
5
|
+
* of key-value pairs for `object` corresponding to the property names of `props`.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
* @param {Object} object The object to query.
|
|
9
|
+
* @param {Array} props The property names to get values for.
|
|
10
|
+
* @returns {Object} Returns the key-value pairs.
|
|
11
|
+
*/
|
|
12
|
+
function baseToPairs(object, props) {
|
|
13
|
+
return arrayMap(props, function(key) {
|
|
14
|
+
return [key, object[key]];
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { baseToPairs as default };
|
|
19
|
+
//# sourceMappingURL=_baseToPairs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_baseToPairs.js","sources":["../../../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToPairs.js"],"sourcesContent":["import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\nfunction baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n}\n\nexport default baseToPairs;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE;AACpC,EAAE,OAAO,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,EAAE;AACvC,IAAI,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9B,GAAG,CAAC,CAAC;AACL;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _baseToPairs = require('./_baseToPairs.cjs');
|
|
4
|
+
var _getTag = require('./_getTag.cjs');
|
|
5
|
+
var _mapToArray = require('./_mapToArray.cjs');
|
|
6
|
+
var _setToPairs = require('./_setToPairs.cjs');
|
|
7
|
+
|
|
8
|
+
/** `Object#toString` result references. */
|
|
9
|
+
var mapTag = '[object Map]',
|
|
10
|
+
setTag = '[object Set]';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates a `_.toPairs` or `_.toPairsIn` function.
|
|
14
|
+
*
|
|
15
|
+
* @private
|
|
16
|
+
* @param {Function} keysFunc The function to get the keys of a given object.
|
|
17
|
+
* @returns {Function} Returns the new pairs function.
|
|
18
|
+
*/
|
|
19
|
+
function createToPairs(keysFunc) {
|
|
20
|
+
return function(object) {
|
|
21
|
+
var tag = _getTag(object);
|
|
22
|
+
if (tag == mapTag) {
|
|
23
|
+
return _mapToArray(object);
|
|
24
|
+
}
|
|
25
|
+
if (tag == setTag) {
|
|
26
|
+
return _setToPairs(object);
|
|
27
|
+
}
|
|
28
|
+
return _baseToPairs(object, keysFunc(object));
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = createToPairs;
|
|
33
|
+
//# sourceMappingURL=_createToPairs.cjs.map
|
package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createToPairs.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_createToPairs.cjs","sources":["../../../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createToPairs.js"],"sourcesContent":["import baseToPairs from './_baseToPairs.js';\nimport getTag from './_getTag.js';\nimport mapToArray from './_mapToArray.js';\nimport setToPairs from './_setToPairs.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\nfunction createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n}\n\nexport default createToPairs;\n"],"names":["getTag","mapToArray","setToPairs","baseToPairs"],"mappings":";;;;;;;AAKA;AACA,IAAI,MAAM,GAAG,cAAc;AAC3B,IAAI,MAAM,GAAG,cAAc,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,QAAQ,EAAE;AACjC,EAAE,OAAO,SAAS,MAAM,EAAE;AAC1B,IAAI,IAAI,GAAG,GAAGA,OAAM,CAAC,MAAM,CAAC,CAAC;AAC7B,IAAI,IAAI,GAAG,IAAI,MAAM,EAAE;AACvB,MAAM,OAAOC,WAAU,CAAC,MAAM,CAAC,CAAC;AAChC,KAAK;AACL,IAAI,IAAI,GAAG,IAAI,MAAM,EAAE;AACvB,MAAM,OAAOC,WAAU,CAAC,MAAM,CAAC,CAAC;AAChC,KAAK;AACL,IAAI,OAAOC,YAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import baseToPairs from './_baseToPairs.js';
|
|
2
|
+
import getTag from './_getTag.js';
|
|
3
|
+
import mapToArray from './_mapToArray.js';
|
|
4
|
+
import setToPairs from './_setToPairs.js';
|
|
5
|
+
|
|
6
|
+
/** `Object#toString` result references. */
|
|
7
|
+
var mapTag = '[object Map]',
|
|
8
|
+
setTag = '[object Set]';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creates a `_.toPairs` or `_.toPairsIn` function.
|
|
12
|
+
*
|
|
13
|
+
* @private
|
|
14
|
+
* @param {Function} keysFunc The function to get the keys of a given object.
|
|
15
|
+
* @returns {Function} Returns the new pairs function.
|
|
16
|
+
*/
|
|
17
|
+
function createToPairs(keysFunc) {
|
|
18
|
+
return function(object) {
|
|
19
|
+
var tag = getTag(object);
|
|
20
|
+
if (tag == mapTag) {
|
|
21
|
+
return mapToArray(object);
|
|
22
|
+
}
|
|
23
|
+
if (tag == setTag) {
|
|
24
|
+
return setToPairs(object);
|
|
25
|
+
}
|
|
26
|
+
return baseToPairs(object, keysFunc(object));
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { createToPairs as default };
|
|
31
|
+
//# sourceMappingURL=_createToPairs.js.map
|
package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createToPairs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_createToPairs.js","sources":["../../../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createToPairs.js"],"sourcesContent":["import baseToPairs from './_baseToPairs.js';\nimport getTag from './_getTag.js';\nimport mapToArray from './_mapToArray.js';\nimport setToPairs from './_setToPairs.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\nfunction createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n}\n\nexport default createToPairs;\n"],"names":[],"mappings":";;;;;AAKA;AACA,IAAI,MAAM,GAAG,cAAc;AAC3B,IAAI,MAAM,GAAG,cAAc,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,QAAQ,EAAE;AACjC,EAAE,OAAO,SAAS,MAAM,EAAE;AAC1B,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC7B,IAAI,IAAI,GAAG,IAAI,MAAM,EAAE;AACvB,MAAM,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAChC,KAAK;AACL,IAAI,IAAI,GAAG,IAAI,MAAM,EAAE;AACvB,MAAM,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAChC,KAAK;AACL,IAAI,OAAO,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts `set` to its value-value pairs.
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
* @param {Object} set The set to convert.
|
|
8
|
+
* @returns {Array} Returns the value-value pairs.
|
|
9
|
+
*/
|
|
10
|
+
function setToPairs(set) {
|
|
11
|
+
var index = -1,
|
|
12
|
+
result = Array(set.size);
|
|
13
|
+
|
|
14
|
+
set.forEach(function(value) {
|
|
15
|
+
result[++index] = [value, value];
|
|
16
|
+
});
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = setToPairs;
|
|
21
|
+
//# sourceMappingURL=_setToPairs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_setToPairs.cjs","sources":["../../../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToPairs.js"],"sourcesContent":["/**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\nfunction setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n}\n\nexport default setToPairs;\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,GAAG,EAAE;AACzB,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B;AACA,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,EAAE;AAC9B,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACrC,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,MAAM,CAAC;AAChB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts `set` to its value-value pairs.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
* @param {Object} set The set to convert.
|
|
6
|
+
* @returns {Array} Returns the value-value pairs.
|
|
7
|
+
*/
|
|
8
|
+
function setToPairs(set) {
|
|
9
|
+
var index = -1,
|
|
10
|
+
result = Array(set.size);
|
|
11
|
+
|
|
12
|
+
set.forEach(function(value) {
|
|
13
|
+
result[++index] = [value, value];
|
|
14
|
+
});
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { setToPairs as default };
|
|
19
|
+
//# sourceMappingURL=_setToPairs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_setToPairs.js","sources":["../../../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToPairs.js"],"sourcesContent":["/**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\nfunction setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n}\n\nexport default setToPairs;\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,GAAG,EAAE;AACzB,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B;AACA,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,EAAE;AAC9B,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACrC,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,MAAM,CAAC;AAChB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _createToPairs = require('./_createToPairs.cjs');
|
|
4
|
+
var keys = require('./keys.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Creates an array of own enumerable string keyed-value pairs for `object`
|
|
8
|
+
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
|
|
9
|
+
* entries are returned.
|
|
10
|
+
*
|
|
11
|
+
* @static
|
|
12
|
+
* @memberOf _
|
|
13
|
+
* @since 4.0.0
|
|
14
|
+
* @alias entries
|
|
15
|
+
* @category Object
|
|
16
|
+
* @param {Object} object The object to query.
|
|
17
|
+
* @returns {Array} Returns the key-value pairs.
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* function Foo() {
|
|
21
|
+
* this.a = 1;
|
|
22
|
+
* this.b = 2;
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* Foo.prototype.c = 3;
|
|
26
|
+
*
|
|
27
|
+
* _.toPairs(new Foo);
|
|
28
|
+
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
|
|
29
|
+
*/
|
|
30
|
+
var toPairs = _createToPairs(keys);
|
|
31
|
+
|
|
32
|
+
var entries = toPairs;
|
|
33
|
+
|
|
34
|
+
module.exports = entries;
|
|
35
|
+
//# sourceMappingURL=toPairs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPairs.cjs","sources":["../../../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPairs.js"],"sourcesContent":["import createToPairs from './_createToPairs.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\nvar toPairs = createToPairs(keys);\n\nexport default toPairs;\n"],"names":["createToPairs"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,GAAGA,cAAa,CAAC,IAAI,CAAC,CAAC;AAClC;AACA,cAAe,OAAO;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import createToPairs from './_createToPairs.js';
|
|
2
|
+
import keys from './keys.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates an array of own enumerable string keyed-value pairs for `object`
|
|
6
|
+
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
|
|
7
|
+
* entries are returned.
|
|
8
|
+
*
|
|
9
|
+
* @static
|
|
10
|
+
* @memberOf _
|
|
11
|
+
* @since 4.0.0
|
|
12
|
+
* @alias entries
|
|
13
|
+
* @category Object
|
|
14
|
+
* @param {Object} object The object to query.
|
|
15
|
+
* @returns {Array} Returns the key-value pairs.
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* function Foo() {
|
|
19
|
+
* this.a = 1;
|
|
20
|
+
* this.b = 2;
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* Foo.prototype.c = 3;
|
|
24
|
+
*
|
|
25
|
+
* _.toPairs(new Foo);
|
|
26
|
+
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
|
|
27
|
+
*/
|
|
28
|
+
var toPairs = createToPairs(keys);
|
|
29
|
+
|
|
30
|
+
var entries = toPairs;
|
|
31
|
+
|
|
32
|
+
export { entries as default };
|
|
33
|
+
//# sourceMappingURL=toPairs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPairs.js","sources":["../../../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPairs.js"],"sourcesContent":["import createToPairs from './_createToPairs.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\nvar toPairs = createToPairs(keys);\n\nexport default toPairs;\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;AAClC;AACA,cAAe,OAAO;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var index$1 = require('../../../../proxy-compare@3.0.1/node_modules/proxy-compare/dist/index.cjs');
|
|
5
|
+
var vanilla = require('./vanilla.cjs');
|
|
6
|
+
var index = require('../../../../use-sync-external-store@1.6.0_react@17.0.2/node_modules/use-sync-external-store/shim/index.cjs');
|
|
7
|
+
|
|
8
|
+
const useAffectedDebugValue = (state, affected) => {
|
|
9
|
+
const pathList = React.useRef(void 0);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
pathList.current = index$1.affectedToPathList(state, affected, true);
|
|
12
|
+
});
|
|
13
|
+
React.useDebugValue(pathList.current);
|
|
14
|
+
};
|
|
15
|
+
const condUseAffectedDebugValue = useAffectedDebugValue;
|
|
16
|
+
const targetCache = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
function useSnapshot(proxyObject, options) {
|
|
18
|
+
const notifyInSync = options == null ? void 0 : options.sync;
|
|
19
|
+
const affected = React.useMemo(
|
|
20
|
+
() => proxyObject && /* @__PURE__ */ new WeakMap(),
|
|
21
|
+
[proxyObject]
|
|
22
|
+
);
|
|
23
|
+
const lastSnapshot = React.useRef(void 0);
|
|
24
|
+
let inRender = true;
|
|
25
|
+
const currSnapshot = index.shimExports.useSyncExternalStore(
|
|
26
|
+
React.useCallback(
|
|
27
|
+
(callback) => {
|
|
28
|
+
const unsub = vanilla.subscribe(proxyObject, callback, notifyInSync);
|
|
29
|
+
callback();
|
|
30
|
+
return unsub;
|
|
31
|
+
},
|
|
32
|
+
[proxyObject, notifyInSync]
|
|
33
|
+
),
|
|
34
|
+
() => {
|
|
35
|
+
const nextSnapshot = vanilla.snapshot(proxyObject);
|
|
36
|
+
try {
|
|
37
|
+
if (!inRender && lastSnapshot.current && !index$1.isChanged(
|
|
38
|
+
lastSnapshot.current,
|
|
39
|
+
nextSnapshot,
|
|
40
|
+
affected,
|
|
41
|
+
/* @__PURE__ */ new WeakMap()
|
|
42
|
+
)) {
|
|
43
|
+
return lastSnapshot.current;
|
|
44
|
+
}
|
|
45
|
+
} catch (e) {
|
|
46
|
+
}
|
|
47
|
+
return nextSnapshot;
|
|
48
|
+
},
|
|
49
|
+
() => vanilla.snapshot(proxyObject)
|
|
50
|
+
);
|
|
51
|
+
inRender = false;
|
|
52
|
+
React.useLayoutEffect(() => {
|
|
53
|
+
lastSnapshot.current = currSnapshot;
|
|
54
|
+
});
|
|
55
|
+
if ((undefined ? undefined.MODE : void 0) !== "production") {
|
|
56
|
+
condUseAffectedDebugValue(currSnapshot, affected);
|
|
57
|
+
}
|
|
58
|
+
const proxyCache = React.useMemo(() => /* @__PURE__ */ new WeakMap(), []);
|
|
59
|
+
return index$1.createProxy(currSnapshot, affected, proxyCache, targetCache);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.useSnapshot = useSnapshot;
|
|
63
|
+
//# sourceMappingURL=react.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.cjs","sources":["../../../../../../../../../node_modules/.pnpm/valtio@2.1.8_patch_hash=boxi3qpsg2dztwe4vz7tsjpr3m_@types+react@17.0.2_react@17.0.2/node_modules/valtio/esm/react.mjs"],"sourcesContent":["import { useMemo, useRef, useCallback, useLayoutEffect, useEffect, useDebugValue } from 'react';\nimport { isChanged, createProxy, affectedToPathList } from 'proxy-compare';\nimport { subscribe, snapshot } from 'valtio/vanilla';\nimport {useSyncExternalStore} from \"use-sync-external-store/shim\";\n\nconst useAffectedDebugValue = (state, affected) => {\n const pathList = useRef(void 0);\n useEffect(() => {\n pathList.current = affectedToPathList(state, affected, true);\n });\n useDebugValue(pathList.current);\n};\nconst condUseAffectedDebugValue = useAffectedDebugValue;\nconst targetCache = /* @__PURE__ */ new WeakMap();\nfunction useSnapshot(proxyObject, options) {\n const notifyInSync = options == null ? void 0 : options.sync;\n const affected = useMemo(\n () => proxyObject && /* @__PURE__ */ new WeakMap(),\n [proxyObject]\n );\n const lastSnapshot = useRef(void 0);\n let inRender = true;\n const currSnapshot = useSyncExternalStore(\n useCallback(\n (callback) => {\n const unsub = subscribe(proxyObject, callback, notifyInSync);\n callback();\n return unsub;\n },\n [proxyObject, notifyInSync]\n ),\n () => {\n const nextSnapshot = snapshot(proxyObject);\n try {\n if (!inRender && lastSnapshot.current && !isChanged(\n lastSnapshot.current,\n nextSnapshot,\n affected,\n /* @__PURE__ */ new WeakMap()\n )) {\n return lastSnapshot.current;\n }\n } catch (e) {\n }\n return nextSnapshot;\n },\n () => snapshot(proxyObject)\n );\n inRender = false;\n useLayoutEffect(() => {\n lastSnapshot.current = currSnapshot;\n });\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n condUseAffectedDebugValue(currSnapshot, affected);\n }\n const proxyCache = useMemo(() => /* @__PURE__ */ new WeakMap(), []);\n return createProxy(currSnapshot, affected, proxyCache, targetCache);\n}\n\nexport { useSnapshot };\n"],"names":["useRef","useEffect","affectedToPathList","useDebugValue","useMemo","useSyncExternalStore","useCallback","subscribe","snapshot","isChanged","useLayoutEffect","createProxy"],"mappings":";;;;;;;AAKA,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK;AACnD,EAAE,MAAM,QAAQ,GAAGA,YAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAClC,EAAEC,eAAS,CAAC,MAAM;AAClB,IAAI,QAAQ,CAAC,OAAO,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E;AACvC,SAAS,EAAE;AACX,UAAU,OAAO,YAAY,CAAC,OAAO,CAAC;AACtC,SAAS;AACT,OAAO,CAAC,OAAO,CAAC,EAAE;AAClB,OAAO;AACP,MAAM,OAAO,YAAY,CAAC;AAC1B,KAAK;AACL,IAAI,MAAMD,gBAAQ,CAAC,WAAW,CAAC;AAC/B,GAAG,CAAC;AACJ,EAAE,QAAQ,GAAG,KAAK,CAAC;AACnB,EAAEE,qBAAe,CAAC,MAAM;AACxB,IAAI,YAAY,CAAC,OAAO,GAAG,YAAY,CAAC;AACxC,GAAG,CAAC,CAAC;AACL,EAAE,IAAI,CAAC,SAAe,GAAG,SAAe,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,YAAY,EAAE;AAC1E,IAAI,yBAAyB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AACtD,GAAG;AACH,EAAE,MAAM,UAAU,GAAGN,aAAO,CAAC,sBAAsB,IAAI,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;AACtE,EAAE,OAAOO,mBAAW,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AACtE;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useMemo, useRef, useCallback, useLayoutEffect, useEffect, useDebugValue } from 'react';
|
|
2
|
+
import { isChanged, createProxy, affectedToPathList } from '../../../../proxy-compare@3.0.1/node_modules/proxy-compare/dist/index.js';
|
|
3
|
+
import { subscribe, snapshot } from './vanilla.js';
|
|
4
|
+
import { s as shimExports } from '../../../../use-sync-external-store@1.6.0_react@17.0.2/node_modules/use-sync-external-store/shim/index.js';
|
|
5
|
+
|
|
6
|
+
const useAffectedDebugValue = (state, affected) => {
|
|
7
|
+
const pathList = useRef(void 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
pathList.current = affectedToPathList(state, affected, true);
|
|
10
|
+
});
|
|
11
|
+
useDebugValue(pathList.current);
|
|
12
|
+
};
|
|
13
|
+
const condUseAffectedDebugValue = useAffectedDebugValue;
|
|
14
|
+
const targetCache = /* @__PURE__ */ new WeakMap();
|
|
15
|
+
function useSnapshot(proxyObject, options) {
|
|
16
|
+
const notifyInSync = options == null ? void 0 : options.sync;
|
|
17
|
+
const affected = useMemo(
|
|
18
|
+
() => proxyObject && /* @__PURE__ */ new WeakMap(),
|
|
19
|
+
[proxyObject]
|
|
20
|
+
);
|
|
21
|
+
const lastSnapshot = useRef(void 0);
|
|
22
|
+
let inRender = true;
|
|
23
|
+
const currSnapshot = shimExports.useSyncExternalStore(
|
|
24
|
+
useCallback(
|
|
25
|
+
(callback) => {
|
|
26
|
+
const unsub = subscribe(proxyObject, callback, notifyInSync);
|
|
27
|
+
callback();
|
|
28
|
+
return unsub;
|
|
29
|
+
},
|
|
30
|
+
[proxyObject, notifyInSync]
|
|
31
|
+
),
|
|
32
|
+
() => {
|
|
33
|
+
const nextSnapshot = snapshot(proxyObject);
|
|
34
|
+
try {
|
|
35
|
+
if (!inRender && lastSnapshot.current && !isChanged(
|
|
36
|
+
lastSnapshot.current,
|
|
37
|
+
nextSnapshot,
|
|
38
|
+
affected,
|
|
39
|
+
/* @__PURE__ */ new WeakMap()
|
|
40
|
+
)) {
|
|
41
|
+
return lastSnapshot.current;
|
|
42
|
+
}
|
|
43
|
+
} catch (e) {
|
|
44
|
+
}
|
|
45
|
+
return nextSnapshot;
|
|
46
|
+
},
|
|
47
|
+
() => snapshot(proxyObject)
|
|
48
|
+
);
|
|
49
|
+
inRender = false;
|
|
50
|
+
useLayoutEffect(() => {
|
|
51
|
+
lastSnapshot.current = currSnapshot;
|
|
52
|
+
});
|
|
53
|
+
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
|
54
|
+
condUseAffectedDebugValue(currSnapshot, affected);
|
|
55
|
+
}
|
|
56
|
+
const proxyCache = useMemo(() => /* @__PURE__ */ new WeakMap(), []);
|
|
57
|
+
return createProxy(currSnapshot, affected, proxyCache, targetCache);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { useSnapshot };
|
|
61
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../../../../../../../../../node_modules/.pnpm/valtio@2.1.8_patch_hash=boxi3qpsg2dztwe4vz7tsjpr3m_@types+react@17.0.2_react@17.0.2/node_modules/valtio/esm/react.mjs"],"sourcesContent":["import { useMemo, useRef, useCallback, useLayoutEffect, useEffect, useDebugValue } from 'react';\nimport { isChanged, createProxy, affectedToPathList } from 'proxy-compare';\nimport { subscribe, snapshot } from 'valtio/vanilla';\nimport {useSyncExternalStore} from \"use-sync-external-store/shim\";\n\nconst useAffectedDebugValue = (state, affected) => {\n const pathList = useRef(void 0);\n useEffect(() => {\n pathList.current = affectedToPathList(state, affected, true);\n });\n useDebugValue(pathList.current);\n};\nconst condUseAffectedDebugValue = useAffectedDebugValue;\nconst targetCache = /* @__PURE__ */ new WeakMap();\nfunction useSnapshot(proxyObject, options) {\n const notifyInSync = options == null ? void 0 : options.sync;\n const affected = useMemo(\n () => proxyObject && /* @__PURE__ */ new WeakMap(),\n [proxyObject]\n );\n const lastSnapshot = useRef(void 0);\n let inRender = true;\n const currSnapshot = useSyncExternalStore(\n useCallback(\n (callback) => {\n const unsub = subscribe(proxyObject, callback, notifyInSync);\n callback();\n return unsub;\n },\n [proxyObject, notifyInSync]\n ),\n () => {\n const nextSnapshot = snapshot(proxyObject);\n try {\n if (!inRender && lastSnapshot.current && !isChanged(\n lastSnapshot.current,\n nextSnapshot,\n affected,\n /* @__PURE__ */ new WeakMap()\n )) {\n return lastSnapshot.current;\n }\n } catch (e) {\n }\n return nextSnapshot;\n },\n () => snapshot(proxyObject)\n );\n inRender = false;\n useLayoutEffect(() => {\n lastSnapshot.current = currSnapshot;\n });\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n condUseAffectedDebugValue(currSnapshot, affected);\n }\n const proxyCache = useMemo(() => /*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