@vef-framework/core 2.0.4 → 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.
Files changed (65) hide show
  1. package/dist/cjs/api/client.cjs +1 -171
  2. package/dist/cjs/api/constants.cjs +1 -13
  3. package/dist/cjs/api/helpers.cjs +1 -12
  4. package/dist/cjs/api/index.cjs +1 -14
  5. package/dist/cjs/auth/helpers.cjs +1 -19
  6. package/dist/cjs/auth/index.cjs +1 -10
  7. package/dist/cjs/common/index.cjs +1 -3
  8. package/dist/cjs/context/api-client.cjs +1 -25
  9. package/dist/cjs/context/app.cjs +1 -15
  10. package/dist/cjs/context/context-selector.cjs +1 -65
  11. package/dist/cjs/context/disabled.cjs +1 -15
  12. package/dist/cjs/context/index.cjs +1 -19
  13. package/dist/cjs/dnd/index.cjs +1 -102
  14. package/dist/cjs/http/client.cjs +1 -445
  15. package/dist/cjs/http/errors.cjs +1 -23
  16. package/dist/cjs/http/helpers.cjs +1 -17
  17. package/dist/cjs/http/index.cjs +1 -17
  18. package/dist/cjs/immer/index.cjs +1 -40
  19. package/dist/cjs/index.cjs +1 -306
  20. package/dist/cjs/motion/features.cjs +1 -13
  21. package/dist/cjs/motion/index.cjs +1 -48
  22. package/dist/cjs/motion/motion-provider.cjs +1 -29
  23. package/dist/cjs/query/constants.cjs +1 -8
  24. package/dist/cjs/query/helpers.cjs +1 -67
  25. package/dist/cjs/query/hooks.cjs +1 -52
  26. package/dist/cjs/query/index.cjs +1 -20
  27. package/dist/cjs/state/index.cjs +1 -41
  28. package/dist/cjs/state-machine/index.cjs +1 -35
  29. package/dist/cjs/store/bound.cjs +1 -42
  30. package/dist/cjs/store/index.cjs +1 -20
  31. package/dist/cjs/store/unbound.cjs +2 -73
  32. package/dist/cjs/store/use-deep.cjs +1 -17
  33. package/dist/es/api/client.js +72 -90
  34. package/dist/es/api/constants.js +7 -8
  35. package/dist/es/api/helpers.js +6 -7
  36. package/dist/es/api/index.js +8 -4
  37. package/dist/es/auth/helpers.js +9 -14
  38. package/dist/es/auth/index.js +4 -2
  39. package/dist/es/common/index.js +1 -1
  40. package/dist/es/context/api-client.js +16 -17
  41. package/dist/es/context/app.js +8 -9
  42. package/dist/es/context/context-selector.js +30 -39
  43. package/dist/es/context/disabled.js +9 -9
  44. package/dist/es/context/index.js +13 -5
  45. package/dist/es/dnd/index.js +30 -7
  46. package/dist/es/http/client.js +173 -253
  47. package/dist/es/http/errors.js +6 -9
  48. package/dist/es/http/helpers.js +10 -10
  49. package/dist/es/http/index.js +11 -4
  50. package/dist/es/immer/index.js +15 -8
  51. package/dist/es/index.js +122 -43
  52. package/dist/es/motion/features.js +4 -2
  53. package/dist/es/motion/index.js +11 -5
  54. package/dist/es/motion/motion-provider.js +15 -17
  55. package/dist/es/query/constants.js +4 -4
  56. package/dist/es/query/helpers.js +40 -45
  57. package/dist/es/query/hooks.js +29 -20
  58. package/dist/es/query/index.js +14 -4
  59. package/dist/es/state/index.js +11 -2
  60. package/dist/es/state-machine/index.js +14 -11
  61. package/dist/es/store/bound.js +24 -26
  62. package/dist/es/store/index.js +11 -5
  63. package/dist/es/store/unbound.js +44 -63
  64. package/dist/es/store/use-deep.js +10 -11
  65. package/package.json +3 -3
@@ -1,5 +1,11 @@
1
- /*! @vef-framework/core v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:14.403Z */
2
- export { createPersistedStore, createStore } from './bound.js';
3
- export { createComponentStore } from './unbound.js';
4
- export { useDeep } from './use-deep.js';
5
- export { useShallow } from 'zustand/shallow';
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
+ };
@@ -1,70 +1,51 @@
1
- /*! @vef-framework/core v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:14.403Z */
2
- import { jsx } from '@emotion/react/jsx-runtime';
3
- import { isPlainObject, mergeWith } from '@vef-framework/shared';
4
- import { useIsomorphicLayoutEffect } from 'motion/react';
5
- import { createContext, useRef, use } from 'react';
6
- import { createStore, useStore } from 'zustand';
7
- import { subscribeWithSelector } from 'zustand/middleware';
8
- import { immer } from 'zustand/middleware/immer';
9
-
10
- const contextCache = /* @__PURE__ */ new Map();
11
- function createComponentStore(name, initializer) {
12
- const contextKey = `${name}StoreContext`;
13
- let Context = contextCache.get(contextKey);
14
- if (!Context) {
15
- Context = createContext(null);
16
- Context.displayName = contextKey;
17
- contextCache.set(contextKey, Context);
18
- }
19
- function StoreProvider(props) {
20
- const { children } = props;
21
- const storeRef = useRef(null);
22
- const storeInitializedRef = useRef(false);
23
- const latestInitialStateRef = useRef(void 0);
24
- latestInitialStateRef.current = props.initialState;
25
- if (!storeRef.current || !storeInitializedRef.current) {
26
- storeRef.current = createStore()(
27
- subscribeWithSelector(
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 useStoreApi() {
50
- const store = use(Context);
51
- if (!store) {
52
- const isDev = process.env.NODE_ENV === "development";
53
- const errorMessage = `${name}Store is not found in the React context, please check if the store is wrapped in a ${name}StoreProvider`;
54
- const devHint = isDev ? "\n\nDev hint: If you're seeing this error after hot reload, it might be a React Fast Refresh issue. Try refreshing the page." : "";
55
- throw new Error(errorMessage + devHint);
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 store;
37
+ return e;
58
38
  }
59
- function useStore$1(selector) {
60
- const store = useStoreApi();
61
- return useStore(store, selector);
39
+ function p(e) {
40
+ const o = f();
41
+ return C(o, e);
62
42
  }
63
43
  return {
64
- StoreProvider,
65
- useStoreApi,
66
- useStore: useStore$1
44
+ StoreProvider: l,
45
+ useStoreApi: f,
46
+ useStore: p
67
47
  };
68
48
  }
69
-
70
- export { createComponentStore };
49
+ export {
50
+ M as createComponentStore
51
+ };
@@ -1,13 +1,12 @@
1
- /*! @vef-framework/core v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:14.403Z */
2
- import { isDeepEqual } from '@vef-framework/shared';
3
- import { useRef } from 'react';
4
-
5
- function useDeep(selector) {
6
- const prevRef = useRef(null);
7
- return (state) => {
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
- export { useDeep };
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",
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.10",
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.4"
67
+ "@vef-framework/shared": "2.0.5"
68
68
  },
69
69
  "devDependencies": {
70
70
  "react": "^19.2.0"