react-state-custom 1.0.24 → 1.0.26
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/LICENSE +21 -0
- package/README.md +17 -1
- package/dist/index.es.js +616 -384
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +21 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/state-utils/createAutoCtx.d.ts +5 -4
- package/dist/state-utils/createRootCtx.d.ts +6 -1
- package/dist/state-utils/ctx.d.ts +1 -0
- package/dist/state-utils/paramsToId.d.ts +1 -0
- package/package.json +21 -5
- package/.github/copilot-instructions.md +0 -57
- package/.github/workflows/deploy.yml +0 -56
- package/.vscode/extensions.json +0 -5
- package/.vscode/settings.json +0 -8
- package/API_DOCUMENTATION.md +0 -1012
- package/dist/dev.d.ts +0 -0
- package/dist/examples/Playground.d.ts +0 -1
- package/dist/examples/cart/app.d.ts +0 -1
- package/dist/examples/cart/index.d.ts +0 -3
- package/dist/examples/cart/state.d.ts +0 -23
- package/dist/examples/cart/view.d.ts +0 -4
- package/dist/examples/counter/app.d.ts +0 -1
- package/dist/examples/counter/index.d.ts +0 -2
- package/dist/examples/counter/state.d.ts +0 -6
- package/dist/examples/counter/view.d.ts +0 -2
- package/dist/examples/form/app.d.ts +0 -1
- package/dist/examples/form/index.d.ts +0 -3
- package/dist/examples/form/state.d.ts +0 -16
- package/dist/examples/form/view.d.ts +0 -4
- package/dist/examples/timer/app.d.ts +0 -1
- package/dist/examples/timer/index.d.ts +0 -2
- package/dist/examples/timer/state.d.ts +0 -11
- package/dist/examples/timer/view.d.ts +0 -4
- package/dist/examples/todo/app.d.ts +0 -1
- package/dist/examples/todo/index.d.ts +0 -3
- package/dist/examples/todo/state.d.ts +0 -17
- package/dist/examples/todo/view.d.ts +0 -4
- package/fix-vscode-yarn-pnp.sh +0 -26
- package/index.html +0 -14
- package/src/dev-tool/DataViewComponent.tsx +0 -17
- package/src/dev-tool/DevTool.css +0 -134
- package/src/dev-tool/DevTool.tsx +0 -20
- package/src/dev-tool/DevToolState.tsx +0 -78
- package/src/dev-tool/StateLabelRender.tsx +0 -38
- package/src/dev-tool/useHighlight.tsx +0 -56
- package/src/dev.tsx +0 -7
- package/src/examples/Playground.tsx +0 -180
- package/src/examples/cart/app.tsx +0 -16
- package/src/examples/cart/index.ts +0 -3
- package/src/examples/cart/state.ts +0 -67
- package/src/examples/cart/view.tsx +0 -62
- package/src/examples/counter/app.tsx +0 -14
- package/src/examples/counter/index.ts +0 -2
- package/src/examples/counter/state.ts +0 -22
- package/src/examples/counter/state.tsx?raw +0 -0
- package/src/examples/counter/view.tsx +0 -20
- package/src/examples/form/app.tsx +0 -16
- package/src/examples/form/index.ts +0 -3
- package/src/examples/form/state.ts +0 -58
- package/src/examples/form/view.tsx +0 -53
- package/src/examples/timer/app.tsx +0 -16
- package/src/examples/timer/index.ts +0 -2
- package/src/examples/timer/state.ts +0 -43
- package/src/examples/timer/view.tsx +0 -26
- package/src/examples/todo/app.tsx +0 -16
- package/src/examples/todo/index.ts +0 -3
- package/src/examples/todo/state.ts +0 -54
- package/src/examples/todo/view.tsx +0 -47
- package/src/index.ts +0 -22
- package/src/state-utils/createAutoCtx.tsx +0 -191
- package/src/state-utils/createRootCtx.tsx +0 -117
- package/src/state-utils/ctx.ts +0 -346
- package/src/state-utils/useArrayHash.ts +0 -53
- package/src/state-utils/useObjectHash.ts +0 -53
- package/src/state-utils/useQuickSubscribe.ts +0 -110
- package/src/state-utils/useRefValue.ts +0 -8
- package/src/state-utils/utils.ts +0 -43
- package/src/vite-env.d.ts +0 -6
- package/tsconfig.json +0 -27
- package/vite.config.dev.ts +0 -16
- package/vite.config.ts +0 -39
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Vo Thanh Dat
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -271,6 +271,7 @@ function App() {
|
|
|
271
271
|
```typescript
|
|
272
272
|
import { DataViewComponent } from 'react-state-custom';
|
|
273
273
|
import { ObjectView } from 'react-obj-view';
|
|
274
|
+
import 'react-obj-view/dist/react-obj-view.css'; // Required for ObjectView styling
|
|
274
275
|
|
|
275
276
|
const CustomDataView: DataViewComponent = ({ name, value }) => {
|
|
276
277
|
return <ObjectView name={name} value={value} expandLevel={2} />;
|
|
@@ -345,9 +346,12 @@ For complete API documentation, examples, and advanced patterns, see:
|
|
|
345
346
|
# Install dependencies
|
|
346
347
|
yarn install
|
|
347
348
|
|
|
348
|
-
# Run
|
|
349
|
+
# Run development UI with example selector
|
|
349
350
|
yarn dev
|
|
350
351
|
|
|
352
|
+
# Run interactive playground with live code editing
|
|
353
|
+
yarn dev:playground
|
|
354
|
+
|
|
351
355
|
# Build library
|
|
352
356
|
yarn build
|
|
353
357
|
|
|
@@ -358,6 +362,18 @@ yarn build:demo
|
|
|
358
362
|
yarn preview
|
|
359
363
|
```
|
|
360
364
|
|
|
365
|
+
### Development Modes
|
|
366
|
+
|
|
367
|
+
**`yarn dev`** - Starts a clean development UI with an interactive example selector. Great for:
|
|
368
|
+
- Testing all examples in one place
|
|
369
|
+
- Quick switching between different examples
|
|
370
|
+
- Visual debugging with DevTool component
|
|
371
|
+
|
|
372
|
+
**`yarn dev:playground`** - Starts the Sandpack-powered playground with live code editing. Perfect for:
|
|
373
|
+
- Creating interactive demos
|
|
374
|
+
- Live code editing and experimentation
|
|
375
|
+
- Sharing editable examples
|
|
376
|
+
|
|
361
377
|
## 🎓 Learning Path
|
|
362
378
|
|
|
363
379
|
1. **Start Simple** - Use `createRootCtx` + `createAutoCtx` for basic state
|