@schema-engine/forms-react 0.5.0 → 0.5.2

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 (2) hide show
  1. package/package.json +15 -15
  2. package/skill/SKILL.md +14 -14
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@schema-engine/forms-react",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.5.2",
5
5
  "description": "The React renderer for Schema Engine forms",
6
6
  "keywords": [
7
7
  "schema-engine",
@@ -36,9 +36,9 @@
36
36
  ],
37
37
  "devDependencies": {
38
38
  "@base-ui/react": "^1.1.0",
39
- "@storybook/addon-docs": "^10.5.2",
40
- "@storybook/addon-vitest": "^10.5.2",
41
- "@storybook/react-vite": "^10.5.2",
39
+ "@storybook/addon-docs": "^10.6.9",
40
+ "@storybook/addon-vitest": "^10.6.9",
41
+ "@storybook/react-vite": "^10.6.9",
42
42
  "@tailwindcss/postcss": "^4.1.18",
43
43
  "@tailwindcss/vite": "^4.1.18",
44
44
  "@testing-library/dom": "^10.4.1",
@@ -48,8 +48,8 @@
48
48
  "@types/react": "^19",
49
49
  "@types/react-dom": "^19",
50
50
  "@vitejs/plugin-react": "^5.1.2",
51
- "@vitest/browser": "^4.0.13",
52
- "@vitest/browser-playwright": "^4.0.13",
51
+ "@vitest/browser": "^5.1.1",
52
+ "@vitest/browser-playwright": "^5.1.1",
53
53
  "autoprefixer": "^10.4.21",
54
54
  "class-variance-authority": "^0.7.1",
55
55
  "clsx": "^2.1.1",
@@ -72,26 +72,26 @@
72
72
  "react-dropzone": "^14.3.8",
73
73
  "react-phone-number-input": "^3.4.12",
74
74
  "remark-gfm": "^4.0.1",
75
- "storybook": "^10.1.8",
75
+ "storybook": "^10.6.9",
76
76
  "tailwind-merge": "^3.4.0",
77
77
  "tailwindcss": "^4",
78
78
  "tsc-alias": "^1.8.16",
79
79
  "tw-animate-css": "^1.4.0",
80
- "vitest": "^4.0.13",
81
- "vitest-browser-react": "^2.0.2",
80
+ "typescript": "^5.9.3",
81
+ "vitest": "^5.1.1",
82
+ "vitest-browser-react": "^2.3.0",
82
83
  "zod": "^4.0.17",
83
- "@schema-engine/actions": "0.5.0",
84
- "@schema-engine/forms": "0.5.0",
85
- "@schema-engine/layout": "0.5.0",
84
+ "@schema-engine/forms": "0.5.2",
85
+ "@schema-engine/layout": "0.5.1",
86
+ "@schema-engine/actions": "0.5.1",
86
87
  "@schema-engine/scripts": "0.0.0"
87
88
  },
88
89
  "peerDependencies": {
89
90
  "react": "^19",
90
91
  "react-dom": "^19",
91
- "typescript": "^5.4",
92
92
  "zod": "^4.0.17",
93
- "@schema-engine/forms": "^0.5.0",
94
- "@schema-engine/layout": "^0.5.0"
93
+ "@schema-engine/forms": "^0.5.2",
94
+ "@schema-engine/layout": "^0.5.1"
95
95
  },
96
96
  "dependencies": {
97
97
  "@ecopages/logger": "^0.2.3"
package/skill/SKILL.md CHANGED
@@ -27,7 +27,7 @@ This file is the router. It defines the concepts once; the references assume the
27
27
 
28
28
  - **config**: a form is plain data, a `FormConfig` of steps holding elements, each with a `$type`, a `name`, `rules` and `constraints`. `engine.defineForm()` (typed, in TypeScript) or `engine.validateForm(unknown)` (portable JSON) checks it against the engine's registrations and returns a frozen `NormalizedFormConfig` that the engine owns.
29
29
  - **container**: the form's state, a `FormStateContainer` from `@schema-engine/forms/state-container`. It owns the nested values, errors, warnings, touched and dirty marks, field-array row ids and the validation in flight. Paths are dotted (`contacts.1.email`) and `FORM_ROOT` is the form itself. Every change is a command (`setValue`, `blur`, `reportNative`, `validate`, `submit`, `reset`, `fieldArray`), and every read is a pure selector over an immutable snapshot.
30
- - **runtime**: `createFormRuntime` is the lifecycle every renderer shares. It builds the container and owns the submission, the wizard steps and their navigation, `form_mount` and `form_change`, and every action dispatch. A renderer supplies only what an element can do, such as focus.
30
+ - **runtime**: for renderer authors, `createFormRuntime` is the lifecycle every renderer shares, and a renderer creates one for each form it draws. It builds the container and owns the submission, the wizard steps and their navigation, `form_mount` and `form_change`, and every action dispatch. A renderer supplies only what an element can do, such as focus. An app does not create one: it gives the engine and a config to a renderer.
31
31
  - **issues and the formatter**: the engine reports what is wrong as an issue (`type`, `source`, `ruleId`, `params`, `message`) and never makes up text. `formatIssue`, a function of the application, turns an issue into the words shown, and falls back to the issue's own `message`.
32
32
 
33
33
  Outcomes use one vocabulary: a check or a submission ends `passed`, `invalid` or `overtaken`. `overtaken` means an edit or a reset outran the check, so there is no verdict and nothing to show.
@@ -49,19 +49,19 @@ A symbol has one import path. `@schema-engine/forms` has these entries: `.` (the
49
49
 
50
50
  Each package ships this router as its own `skill/SKILL.md` and its references in its `skill/reference/` folder, so a reference is `node_modules/@schema-engine/<package>/skill/reference/<file>`, and any installed package has the router. Read the rows of the packages the project depends on and skip the others: a package that is not installed has no file. The deployed site serves the latest version of the router and of every reference at `/skill/`, with the references flat at `/skill/reference/<file>`.
51
51
 
52
- | To do | Package | Reference |
53
- | ---------------------------------------------------------------------------- | ------------------------------ | ------------------------------------ |
54
- | Register something, build a registry, or read a YAML document | `@schema-engine/registry` | `reference/registry.md` |
55
- | Parse, dispatch or cancel actions outside a form | `@schema-engine/actions` | `reference/actions.md` |
56
- | Build a grid, an appearance axis or a layout theme | `@schema-engine/layout` | `reference/layout.md` |
57
- | Create an engine, author a config, use the container or the runtime directly | `@schema-engine/forms` | `reference/forms.md` |
58
- | Add a rule, explain a validation result, or translate messages | `@schema-engine/forms` | `reference/forms-validation.md` |
59
- | Handle submit, server errors, CSRF or wizard steps | `@schema-engine/forms` | `reference/forms-submission.md` |
60
- | Run code on a form event, or define a form action | `@schema-engine/forms` | `reference/forms-actions.md` |
61
- | Render a form in React, or use its hooks | `@schema-engine/forms-react` | `reference/forms-react.md` |
62
- | Write or change a React field widget, and test it | `@schema-engine/forms-react` | `reference/forms-react-widgets.md` |
63
- | Render a form in Radiant, or reach the container from an element | `@schema-engine/forms-radiant` | `reference/forms-radiant.md` |
64
- | Write or change a Radiant field widget, and test it | `@schema-engine/forms-radiant` | `reference/forms-radiant-widgets.md` |
52
+ | To do | Package | Reference |
53
+ | ---------------------------------------------------------------- | ------------------------------ | ------------------------------------ |
54
+ | Register something, build a registry, or read a YAML document | `@schema-engine/registry` | `reference/registry.md` |
55
+ | Parse, dispatch or cancel actions outside a form | `@schema-engine/actions` | `reference/actions.md` |
56
+ | Build a grid, an appearance axis or a layout theme | `@schema-engine/layout` | `reference/layout.md` |
57
+ | Create an engine, author a config, or use the container directly | `@schema-engine/forms` | `reference/forms.md` |
58
+ | Add a rule, explain a validation result, or translate messages | `@schema-engine/forms` | `reference/forms-validation.md` |
59
+ | Handle submit, server errors, CSRF or wizard steps | `@schema-engine/forms` | `reference/forms-submission.md` |
60
+ | Run code on a form event, or define a form action | `@schema-engine/forms` | `reference/forms-actions.md` |
61
+ | Render a form in React, or use its hooks | `@schema-engine/forms-react` | `reference/forms-react.md` |
62
+ | Write or change a React field widget, and test it | `@schema-engine/forms-react` | `reference/forms-react-widgets.md` |
63
+ | Render a form in Radiant, or reach the container from an element | `@schema-engine/forms-radiant` | `reference/forms-radiant.md` |
64
+ | Write or change a Radiant field widget, and test it | `@schema-engine/forms-radiant` | `reference/forms-radiant-widgets.md` |
65
65
 
66
66
  ## Documentation map
67
67