@schema-engine/forms 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 (71) hide show
  1. package/README.md +3 -3
  2. package/dist/actions/index.js +4 -4
  3. package/dist/actions/plugins/index.js +3 -3
  4. package/dist/actions/plugins/registrations.js +3 -3
  5. package/dist/agent-tool/index.js +1 -1
  6. package/dist/{chunk-U2X3IYSD.js → chunk-6EYX257T.js} +1 -1
  7. package/dist/{chunk-HEAKWS27.js → chunk-A5VLMQAK.js} +693 -643
  8. package/dist/chunk-A5VLMQAK.js.map +7 -0
  9. package/dist/{chunk-5QXT7YAJ.js → chunk-CANRZY5A.js} +1 -1
  10. package/dist/{chunk-2VKEOE2L.js → chunk-GQHMU3AR.js} +12 -12
  11. package/dist/{chunk-WS7SLVXL.js → chunk-JA5ET6MC.js} +4 -4
  12. package/dist/{chunk-2PTM54FQ.js → chunk-KH6QWB5Y.js} +2 -2
  13. package/dist/chunk-PCL2KNHC.js.map +7 -0
  14. package/dist/{chunk-56CJ2UZ7.js → chunk-TSKELYW7.js} +2 -2
  15. package/dist/chunk-U3YHTQHR.js +215 -0
  16. package/dist/chunk-U3YHTQHR.js.map +7 -0
  17. package/dist/{chunk-XPQRHO5E.js → chunk-V5H7L5PJ.js} +1 -1
  18. package/dist/engine/build-form-engine.js +7 -7
  19. package/dist/engine/create-form-engine.js +8 -8
  20. package/dist/engine/form-engine.js +7 -7
  21. package/dist/engine/index.js +8 -8
  22. package/dist/engine/step-machine.js +1 -1
  23. package/dist/engine/submission-schema.js +1 -1
  24. package/dist/engine/value-validation.js +1 -1
  25. package/dist/index.js +26 -26
  26. package/dist/lib/validate-form.js +4 -4
  27. package/dist/recipes/index.js +1 -1
  28. package/dist/recipes/view-model.js +1 -1
  29. package/dist/runtime/create-form-runtime.js +7 -7
  30. package/dist/runtime/index.js +7 -7
  31. package/dist/schemas/base-field.js +2 -2
  32. package/dist/schemas/form-config-shape.js +2 -2
  33. package/dist/schemas/form-config.js +2 -2
  34. package/dist/schemas/index.js +5 -5
  35. package/dist/schemas/validation/dependencies.js +1 -1
  36. package/dist/schemas/validation/index.js +5 -5
  37. package/dist/schemas/validation/utils.js +1 -1
  38. package/dist/schemas/validation/validation-registry.js +1 -1
  39. package/dist/server-errors/from-json-api-errors.js +3 -3
  40. package/dist/server-errors/from-problem-details.js +3 -3
  41. package/dist/server-errors/index.js +6 -6
  42. package/dist/server-errors/shared.js +2 -2
  43. package/dist/state-container/create-form-state-container.js +5 -5
  44. package/dist/state-container/index.d.ts +1 -1
  45. package/dist/state-container/index.js +12 -12
  46. package/dist/state-container/selectors.js +1 -1
  47. package/dist/state-container/submission.js +1 -1
  48. package/dist/state-container/types.d.ts +1 -1
  49. package/dist/state-container/types.js +1 -1
  50. package/dist/testing/assert.d.ts +92 -0
  51. package/dist/testing/assert.js +42 -0
  52. package/dist/testing/assert.js.map +7 -0
  53. package/dist/testing/form-state-container-conformance.d.ts +15 -3
  54. package/dist/testing/form-state-container-conformance.js +4 -3
  55. package/dist/testing/index.d.ts +3 -2
  56. package/dist/testing/index.js +4 -3
  57. package/package.json +7 -13
  58. package/skill/SKILL.md +14 -14
  59. package/skill/reference/forms.md +7 -6
  60. package/dist/chunk-HEAKWS27.js.map +0 -7
  61. package/dist/chunk-PXWVKJGF.js.map +0 -7
  62. package/dist/{chunk-U2X3IYSD.js.map → chunk-6EYX257T.js.map} +0 -0
  63. package/dist/{chunk-5QXT7YAJ.js.map → chunk-CANRZY5A.js.map} +0 -0
  64. package/dist/{chunk-GY657L56.js → chunk-DP7SYLLI.js} +5 -5
  65. /package/dist/{chunk-GY657L56.js.map → chunk-DP7SYLLI.js.map} +0 -0
  66. /package/dist/{chunk-2VKEOE2L.js.map → chunk-GQHMU3AR.js.map} +0 -0
  67. /package/dist/{chunk-WS7SLVXL.js.map → chunk-JA5ET6MC.js.map} +0 -0
  68. /package/dist/{chunk-2PTM54FQ.js.map → chunk-KH6QWB5Y.js.map} +0 -0
  69. /package/dist/{chunk-PXWVKJGF.js → chunk-PCL2KNHC.js} +0 -0
  70. /package/dist/{chunk-56CJ2UZ7.js.map → chunk-TSKELYW7.js.map} +0 -0
  71. /package/dist/{chunk-XPQRHO5E.js.map → chunk-V5H7L5PJ.js.map} +0 -0
package/README.md CHANGED
@@ -38,7 +38,7 @@ const result = engine.safeValidateForm({
38
38
  });
39
39
  ```
40
40
 
41
- `result` is `{ success: true, data }` with the frozen, normalized config, or `{ success: false, issues }` with the `path` of every key to fix. `createFormRuntime` runs the form without a renderer: it owns the submission, the wizard steps and every action.
41
+ `result` is `{ success: true, data }` with the frozen, normalized config, or `{ success: false, issues }` with the `path` of every key to fix. To draw the form, give the engine and the config to a renderer: `FormRenderer` of Forms React or Forms Radiant. A renderer creates a `createFormRuntime` for each form it draws, which owns the submission, the wizard steps and every action; only a renderer author calls it.
42
42
 
43
43
  ## Entry points
44
44
 
@@ -52,12 +52,12 @@ const result = engine.safeValidateForm({
52
52
  | `@schema-engine/forms/recipes/built-in` | The built-in recipe specs and their slot schemas |
53
53
  | `@schema-engine/forms/browser` | Browser actions: auto-save, reset and analytics, with consent |
54
54
  | `@schema-engine/forms/agent-tool` | Offers a form to a browser agent as a WebMCP tool (experimental) |
55
- | `@schema-engine/forms/testing` | A conformance suite for a form state container (needs `vitest`) |
55
+ | `@schema-engine/forms/testing` | A conformance suite for a form state container, for any test runner |
56
56
 
57
57
  ## Documentation
58
58
 
59
59
  - [Forms](https://schema-engine.com/docs/forms/overview): what a form can do.
60
- - [Installation and quick start](https://schema-engine.com/docs/forms/getting-started): register elements, check JSON and submit with no renderer.
60
+ - [Installation and quick start](https://schema-engine.com/docs/forms/getting-started): create the engine, check JSON and render it.
61
61
  - [Engine and registrations](https://schema-engine.com/docs/forms/engine): the engine, custom fields and configuration errors.
62
62
  - [Validation](https://schema-engine.com/docs/forms/validation) and [custom and async rules](https://schema-engine.com/docs/forms/validation-custom).
63
63
  - [Form state](https://schema-engine.com/docs/forms/form-state), [Wizard and runtime](https://schema-engine.com/docs/forms/wizard) and [Actions in forms](https://schema-engine.com/docs/forms/actions).
@@ -1,6 +1,9 @@
1
+ import "../chunk-4FELFUCD.js";
1
2
  import "../chunk-QH7VW7IY.js";
2
3
  import "../chunk-BIHEIJG3.js";
3
- import "../chunk-4FELFUCD.js";
4
+ import {
5
+ NotificationActionRegistration
6
+ } from "../chunk-6FUGK5HQ.js";
4
7
  import {
5
8
  SubmitActionRegistration
6
9
  } from "../chunk-Z6DQLJS2.js";
@@ -8,9 +11,6 @@ import {
8
11
  FormSubmitActionSchema,
9
12
  formSubmitPlugin
10
13
  } from "../chunk-GT2LARKT.js";
11
- import {
12
- NotificationActionRegistration
13
- } from "../chunk-6FUGK5HQ.js";
14
14
  import {
15
15
  NotificationActionSchema,
16
16
  notificationPlugin
@@ -1,5 +1,8 @@
1
1
  import "../../chunk-QH7VW7IY.js";
2
2
  import "../../chunk-BIHEIJG3.js";
3
+ import {
4
+ NotificationActionRegistration
5
+ } from "../../chunk-6FUGK5HQ.js";
3
6
  import {
4
7
  SubmitActionRegistration
5
8
  } from "../../chunk-Z6DQLJS2.js";
@@ -7,9 +10,6 @@ import {
7
10
  FormSubmitActionSchema,
8
11
  formSubmitPlugin
9
12
  } from "../../chunk-GT2LARKT.js";
10
- import {
11
- NotificationActionRegistration
12
- } from "../../chunk-6FUGK5HQ.js";
13
13
  import {
14
14
  NotificationActionSchema,
15
15
  notificationPlugin
@@ -1,11 +1,11 @@
1
1
  import "../../chunk-BIHEIJG3.js";
2
+ import {
3
+ NotificationActionRegistration
4
+ } from "../../chunk-6FUGK5HQ.js";
2
5
  import {
3
6
  SubmitActionRegistration
4
7
  } from "../../chunk-Z6DQLJS2.js";
5
8
  import "../../chunk-GT2LARKT.js";
6
- import {
7
- NotificationActionRegistration
8
- } from "../../chunk-6FUGK5HQ.js";
9
9
  import "../../chunk-QT3EYUL5.js";
10
10
  import "../../chunk-VGGERKV2.js";
11
11
  export {
@@ -13,7 +13,7 @@ import "../chunk-QLGM2AZW.js";
13
13
  import "../chunk-ZUYSGCEH.js";
14
14
  import {
15
15
  FORM_ROOT
16
- } from "../chunk-PXWVKJGF.js";
16
+ } from "../chunk-PCL2KNHC.js";
17
17
  import "../chunk-3YLRJVVN.js";
18
18
  import {
19
19
  isPlainObject
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildFormEngine
3
- } from "./chunk-XPQRHO5E.js";
3
+ } from "./chunk-V5H7L5PJ.js";
4
4
 
5
5
  // src/engine/create-form-engine.ts
6
6
  function createFormEngine(options) {