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.
Files changed (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -1
  3. package/dist/index.es.js +616 -384
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +21 -1
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/state-utils/createAutoCtx.d.ts +5 -4
  8. package/dist/state-utils/createRootCtx.d.ts +6 -1
  9. package/dist/state-utils/ctx.d.ts +1 -0
  10. package/dist/state-utils/paramsToId.d.ts +1 -0
  11. package/package.json +21 -5
  12. package/.github/copilot-instructions.md +0 -57
  13. package/.github/workflows/deploy.yml +0 -56
  14. package/.vscode/extensions.json +0 -5
  15. package/.vscode/settings.json +0 -8
  16. package/API_DOCUMENTATION.md +0 -1012
  17. package/dist/dev.d.ts +0 -0
  18. package/dist/examples/Playground.d.ts +0 -1
  19. package/dist/examples/cart/app.d.ts +0 -1
  20. package/dist/examples/cart/index.d.ts +0 -3
  21. package/dist/examples/cart/state.d.ts +0 -23
  22. package/dist/examples/cart/view.d.ts +0 -4
  23. package/dist/examples/counter/app.d.ts +0 -1
  24. package/dist/examples/counter/index.d.ts +0 -2
  25. package/dist/examples/counter/state.d.ts +0 -6
  26. package/dist/examples/counter/view.d.ts +0 -2
  27. package/dist/examples/form/app.d.ts +0 -1
  28. package/dist/examples/form/index.d.ts +0 -3
  29. package/dist/examples/form/state.d.ts +0 -16
  30. package/dist/examples/form/view.d.ts +0 -4
  31. package/dist/examples/timer/app.d.ts +0 -1
  32. package/dist/examples/timer/index.d.ts +0 -2
  33. package/dist/examples/timer/state.d.ts +0 -11
  34. package/dist/examples/timer/view.d.ts +0 -4
  35. package/dist/examples/todo/app.d.ts +0 -1
  36. package/dist/examples/todo/index.d.ts +0 -3
  37. package/dist/examples/todo/state.d.ts +0 -17
  38. package/dist/examples/todo/view.d.ts +0 -4
  39. package/fix-vscode-yarn-pnp.sh +0 -26
  40. package/index.html +0 -14
  41. package/src/dev-tool/DataViewComponent.tsx +0 -17
  42. package/src/dev-tool/DevTool.css +0 -134
  43. package/src/dev-tool/DevTool.tsx +0 -20
  44. package/src/dev-tool/DevToolState.tsx +0 -78
  45. package/src/dev-tool/StateLabelRender.tsx +0 -38
  46. package/src/dev-tool/useHighlight.tsx +0 -56
  47. package/src/dev.tsx +0 -7
  48. package/src/examples/Playground.tsx +0 -180
  49. package/src/examples/cart/app.tsx +0 -16
  50. package/src/examples/cart/index.ts +0 -3
  51. package/src/examples/cart/state.ts +0 -67
  52. package/src/examples/cart/view.tsx +0 -62
  53. package/src/examples/counter/app.tsx +0 -14
  54. package/src/examples/counter/index.ts +0 -2
  55. package/src/examples/counter/state.ts +0 -22
  56. package/src/examples/counter/state.tsx?raw +0 -0
  57. package/src/examples/counter/view.tsx +0 -20
  58. package/src/examples/form/app.tsx +0 -16
  59. package/src/examples/form/index.ts +0 -3
  60. package/src/examples/form/state.ts +0 -58
  61. package/src/examples/form/view.tsx +0 -53
  62. package/src/examples/timer/app.tsx +0 -16
  63. package/src/examples/timer/index.ts +0 -2
  64. package/src/examples/timer/state.ts +0 -43
  65. package/src/examples/timer/view.tsx +0 -26
  66. package/src/examples/todo/app.tsx +0 -16
  67. package/src/examples/todo/index.ts +0 -3
  68. package/src/examples/todo/state.ts +0 -54
  69. package/src/examples/todo/view.tsx +0 -47
  70. package/src/index.ts +0 -22
  71. package/src/state-utils/createAutoCtx.tsx +0 -191
  72. package/src/state-utils/createRootCtx.tsx +0 -117
  73. package/src/state-utils/ctx.ts +0 -346
  74. package/src/state-utils/useArrayHash.ts +0 -53
  75. package/src/state-utils/useObjectHash.ts +0 -53
  76. package/src/state-utils/useQuickSubscribe.ts +0 -110
  77. package/src/state-utils/useRefValue.ts +0 -8
  78. package/src/state-utils/utils.ts +0 -43
  79. package/src/vite-env.d.ts +0 -6
  80. package/tsconfig.json +0 -27
  81. package/vite.config.dev.ts +0 -16
  82. 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 dev server with examples
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