@vef-framework/core 2.0.3 → 2.0.5
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/api/client.cjs +1 -171
- package/dist/cjs/api/constants.cjs +1 -13
- package/dist/cjs/api/helpers.cjs +1 -12
- package/dist/cjs/api/index.cjs +1 -14
- package/dist/cjs/auth/helpers.cjs +1 -19
- package/dist/cjs/auth/index.cjs +1 -10
- package/dist/cjs/common/index.cjs +1 -3
- package/dist/cjs/context/api-client.cjs +1 -25
- package/dist/cjs/context/app.cjs +1 -15
- package/dist/cjs/context/context-selector.cjs +1 -65
- package/dist/cjs/context/disabled.cjs +1 -15
- package/dist/cjs/context/index.cjs +1 -19
- package/dist/cjs/dnd/index.cjs +1 -102
- package/dist/cjs/http/client.cjs +1 -445
- package/dist/cjs/http/errors.cjs +1 -23
- package/dist/cjs/http/helpers.cjs +1 -17
- package/dist/cjs/http/index.cjs +1 -17
- package/dist/cjs/immer/index.cjs +1 -40
- package/dist/cjs/index.cjs +1 -306
- package/dist/cjs/motion/features.cjs +1 -13
- package/dist/cjs/motion/index.cjs +1 -48
- package/dist/cjs/motion/motion-provider.cjs +1 -29
- package/dist/cjs/query/constants.cjs +1 -8
- package/dist/cjs/query/helpers.cjs +1 -67
- package/dist/cjs/query/hooks.cjs +1 -52
- package/dist/cjs/query/index.cjs +1 -20
- package/dist/cjs/state/index.cjs +1 -41
- package/dist/cjs/state-machine/index.cjs +1 -35
- package/dist/cjs/store/bound.cjs +1 -42
- package/dist/cjs/store/index.cjs +1 -20
- package/dist/cjs/store/unbound.cjs +2 -73
- package/dist/cjs/store/use-deep.cjs +1 -17
- package/dist/es/api/client.js +72 -90
- package/dist/es/api/constants.js +7 -8
- package/dist/es/api/helpers.js +6 -7
- package/dist/es/api/index.js +8 -4
- package/dist/es/auth/helpers.js +9 -14
- package/dist/es/auth/index.js +4 -2
- package/dist/es/common/index.js +1 -1
- package/dist/es/context/api-client.js +16 -17
- package/dist/es/context/app.js +8 -9
- package/dist/es/context/context-selector.js +30 -39
- package/dist/es/context/disabled.js +9 -9
- package/dist/es/context/index.js +13 -5
- package/dist/es/dnd/index.js +30 -7
- package/dist/es/http/client.js +173 -253
- package/dist/es/http/errors.js +6 -9
- package/dist/es/http/helpers.js +10 -10
- package/dist/es/http/index.js +11 -4
- package/dist/es/immer/index.js +15 -8
- package/dist/es/index.js +122 -43
- package/dist/es/motion/features.js +4 -2
- package/dist/es/motion/index.js +11 -5
- package/dist/es/motion/motion-provider.js +15 -17
- package/dist/es/query/constants.js +4 -4
- package/dist/es/query/helpers.js +40 -45
- package/dist/es/query/hooks.js +29 -20
- package/dist/es/query/index.js +14 -4
- package/dist/es/state/index.js +11 -2
- package/dist/es/state-machine/index.js +14 -11
- package/dist/es/store/bound.js +24 -26
- package/dist/es/store/index.js +11 -5
- package/dist/es/store/unbound.js +44 -63
- package/dist/es/store/use-deep.js +10 -11
- package/package.json +3 -3
package/dist/es/store/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
1
|
+
import { createPersistedStore as o, createStore as t } from "./bound.js";
|
|
2
|
+
import { createComponentStore as m } from "./unbound.js";
|
|
3
|
+
import { useDeep as f } from "./use-deep.js";
|
|
4
|
+
import { useShallow as x } from "zustand/shallow";
|
|
5
|
+
export {
|
|
6
|
+
m as createComponentStore,
|
|
7
|
+
o as createPersistedStore,
|
|
8
|
+
t as createStore,
|
|
9
|
+
f as useDeep,
|
|
10
|
+
x as useShallow
|
|
11
|
+
};
|
package/dist/es/store/unbound.js
CHANGED
|
@@ -1,70 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
immer(initializer)
|
|
29
|
-
)
|
|
30
|
-
);
|
|
31
|
-
storeInitializedRef.current = true;
|
|
32
|
-
}
|
|
33
|
-
useIsomorphicLayoutEffect(() => {
|
|
34
|
-
if (!isPlainObject(latestInitialStateRef.current)) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (storeRef.current) {
|
|
38
|
-
storeRef.current.setState((state) => {
|
|
39
|
-
mergeWith(
|
|
40
|
-
state,
|
|
41
|
-
latestInitialStateRef.current,
|
|
42
|
-
true
|
|
43
|
-
);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}, []);
|
|
47
|
-
return /* @__PURE__ */ jsx(Context, { value: storeRef.current, children });
|
|
1
|
+
import { jsx as S } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { isPlainObject as d, mergeWith as v } from "@vef-framework/shared";
|
|
3
|
+
import { useIsomorphicLayoutEffect as x } from "motion/react";
|
|
4
|
+
import { createContext as g, useRef as u, use as R } from "react";
|
|
5
|
+
import { createStore as y, useStore as C } from "zustand";
|
|
6
|
+
import { subscribeWithSelector as b } from "zustand/middleware";
|
|
7
|
+
import { immer as w } from "zustand/middleware/immer";
|
|
8
|
+
const a = /* @__PURE__ */ new Map();
|
|
9
|
+
function M(i, m) {
|
|
10
|
+
const s = `${i}StoreContext`;
|
|
11
|
+
let r = a.get(s);
|
|
12
|
+
r || (r = g(null), r.displayName = s, a.set(s, r));
|
|
13
|
+
function l(e) {
|
|
14
|
+
const { children: o } = e, t = u(null), n = u(!1), c = u(void 0);
|
|
15
|
+
return c.current = e.initialState, (!t.current || !n.current) && (t.current = y()(
|
|
16
|
+
b(
|
|
17
|
+
w(m)
|
|
18
|
+
)
|
|
19
|
+
), n.current = !0), x(() => {
|
|
20
|
+
d(c.current) && t.current && t.current.setState((h) => {
|
|
21
|
+
v(
|
|
22
|
+
h,
|
|
23
|
+
c.current,
|
|
24
|
+
!0
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
}, []), /* @__PURE__ */ S(r, { value: t.current, children: o });
|
|
48
28
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
throw new Error(
|
|
29
|
+
function f() {
|
|
30
|
+
const e = R(r);
|
|
31
|
+
if (!e) {
|
|
32
|
+
const o = process.env.NODE_ENV === "development", t = `${i}Store is not found in the React context, please check if the store is wrapped in a ${i}StoreProvider`, n = o ? `
|
|
33
|
+
|
|
34
|
+
Dev hint: If you're seeing this error after hot reload, it might be a React Fast Refresh issue. Try refreshing the page.` : "";
|
|
35
|
+
throw new Error(t + n);
|
|
56
36
|
}
|
|
57
|
-
return
|
|
37
|
+
return e;
|
|
58
38
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
return
|
|
39
|
+
function p(e) {
|
|
40
|
+
const o = f();
|
|
41
|
+
return C(o, e);
|
|
62
42
|
}
|
|
63
43
|
return {
|
|
64
|
-
StoreProvider,
|
|
65
|
-
useStoreApi,
|
|
66
|
-
useStore:
|
|
44
|
+
StoreProvider: l,
|
|
45
|
+
useStoreApi: f,
|
|
46
|
+
useStore: p
|
|
67
47
|
};
|
|
68
48
|
}
|
|
69
|
-
|
|
70
|
-
|
|
49
|
+
export {
|
|
50
|
+
M as createComponentStore
|
|
51
|
+
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const next = selector(state);
|
|
9
|
-
return isDeepEqual(prevRef.current, next) ? prevRef.current : prevRef.current = next;
|
|
1
|
+
import { isDeepEqual as u } from "@vef-framework/shared";
|
|
2
|
+
import { useRef as o } from "react";
|
|
3
|
+
function f(t) {
|
|
4
|
+
const e = o(null);
|
|
5
|
+
return (n) => {
|
|
6
|
+
const r = t(n);
|
|
7
|
+
return u(e.current, r) ? e.current : e.current = r;
|
|
10
8
|
};
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
export {
|
|
11
|
+
f as useDeep
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vef-framework/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.5",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Core features for VEF framework",
|
|
7
7
|
"author": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@dnd-kit/react": "^0.1.21",
|
|
55
55
|
"@emotion/react": "^11.14.0",
|
|
56
56
|
"@hello-pangea/dnd": "^18.0.1",
|
|
57
|
-
"@tanstack/react-query": "^5.90.
|
|
57
|
+
"@tanstack/react-query": "^5.90.11",
|
|
58
58
|
"@xstate/react": "^6.0.0",
|
|
59
59
|
"axios": "^1.13.2",
|
|
60
60
|
"clsx": "^2.1.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"use-immer": "^0.11.0",
|
|
65
65
|
"xstate": "^5.24.0",
|
|
66
66
|
"zustand": "^5.0.8",
|
|
67
|
-
"@vef-framework/shared": "2.0.
|
|
67
|
+
"@vef-framework/shared": "2.0.5"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"react": "^19.2.0"
|