@onoxm/react-tools 0.1.6 → 0.1.7
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/tools/createDesignateStore.js +1 -1
- package/dist/tools/createStateManagement.tsx.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/utils/dist/utils/common/forEach.js +1 -0
- package/dist/tools/utils/dist/utils/is/isArray.js +1 -0
- package/dist/types/createDesignateStore.d.ts +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{selectProperties as
|
|
1
|
+
import{selectProperties as o}from "./utils/dist/utils/common/selectProperties.js";import{isArray as a}from "./utils/dist/utils/is/isArray.js";import{useShallow as m}from "zustand/shallow";const c=(r)=>{function e(t){return t ? r(m((s)=>o(s,a(t)? t:[t]))):r();}return e.setState=r.setState,e;};export{c as createDesignateStore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from "react/jsx-runtime";import{c as p}from "react/compiler-runtime";import{forEach as h}from "./utils/dist/utils/common/forEach.js";import{selectProperties as u}from "./utils/dist/utils/common/selectProperties.js";import{useReducer as m,createContext as y,useContext as f}from "react";const v={get:(a)=>a,set:(a,t)=>({...a,[t.key]:t.value}),del:(a,t)=>{const e={...a};return delete e[t.key],e;}},k=(a,t)=>v[t.type](a,t),n=y(null),g=(a)=>{const t=p(5),{initData:e,children:i}=a,[d,o]=m(k,e);let s,r;return t[0]!==d ?(s={data:d,dispatch:o},t[0]=d,t[1]=s):s=t[1],t[2]!==i||t[3]!==s ?(r=l(n.Provider,{value:s,children:i}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r;},D=(a)=>{const t=p(9),e=f(n);if(!e)throw new Error("useData must be used within a DataProvider");let i;t[0]!==e ?(i={set:(r,c)=>e.dispatch({type:"set",key:r,value:c}),setAll:(r)=>{h(Object.keys(r),(c)=>e.dispatch({type:"set",key:c,value:r[c]}));},del:(r)=>e.dispatch({type:"del",key:r})},t[0]=e,t[1]=i):i=t[1];const d=i;let o,s;return t[2]!==e.data||t[3]!==a ?(o=a ? u(e.data,a):e.data,t[2]=e.data,t[3]=a,t[4]=o):o=t[4],t[5]!==e.dispatch||t[6]!==d||t[7]!==o ?(s={data:o,dispatch:d,originDispatch:e.dispatch},t[5]=e.dispatch,t[6]=d,t[7]=o,t[8]=s):s=t[8],s;},j=()=>D;export{g as DataProvider,j as createContextData};
|
package/dist/tools/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createDesignateStore as t}from "./createDesignateStore.js";import{DataProvider as a,createContextData as p}from "./createStateManagement.tsx.js";import{portalRenderer as f}from "./portalRenderer.js";export{a as DataProvider,p as createContextData,t as createDesignateStore,f as portalRenderer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=(o,f)=>{for(const c of o)f(c,o.indexOf(c));};export{n as forEach};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a=(r)=>Array.isArray(r);export{a as isArray};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
2
|
export declare const createDesignateStore: <T extends Record<string, unknown>>(useStore: UseBoundStore<StoreApi<T>>) => {
|
|
3
3
|
(): T;
|
|
4
|
-
<K extends Partial<keyof T>>(designateStates: K[]): Pick<T, K>;
|
|
4
|
+
<K extends Partial<keyof T>>(designateStates: K | K[]): Pick<T, K>;
|
|
5
5
|
setState: {
|
|
6
6
|
(partial: T | Partial<T> | ((state: T) => T | Partial<T>), replace?: false): void;
|
|
7
7
|
(state: T | ((state: T) => T), replace: true): void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './createDesignateStore';
|
|
2
|
+
export * from './createStateManagement.tsx';
|
|
3
|
+
export * from './portalRenderer';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onoxm/react-tools",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7",
|
|
5
5
|
"description": "Component library by React + Typescript",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/tools/index.js",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"author": "ono",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@onoxm/utils": "0.1.
|
|
34
|
+
"@onoxm/utils": "0.1.7"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@types/react": ">=
|
|
38
|
-
"@types/react-dom": ">=
|
|
39
|
-
"react": ">=
|
|
40
|
-
"react-dom": ">=
|
|
37
|
+
"@types/react": ">=19",
|
|
38
|
+
"@types/react-dom": ">=19",
|
|
39
|
+
"react": ">=19",
|
|
40
|
+
"react-dom": ">=19",
|
|
41
41
|
"zustand": ">=5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|