mlform 0.1.23 → 0.1.24

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 (261) hide show
  1. package/README.md +98 -229
  2. package/dist/builtins-jvAitKUC.js +560 -0
  3. package/dist/{design-Dr7o4rR9.js → design-D8zce4Mh.js} +13 -12
  4. package/dist/mlform/builtins.mjs +2 -2
  5. package/dist/mlform/design.mjs +1 -1
  6. package/dist/mlform/kit.mjs +435 -275
  7. package/dist/mlform/primitives.mjs +2 -2
  8. package/dist/mlform/runtime.mjs +1 -1
  9. package/dist/mlform/schema.mjs +1 -1
  10. package/dist/{primitives-ljp3c5R8.js → primitives-ChLgMFl9.js} +452 -450
  11. package/dist/{runtime-BQsOz8iz.js → runtime-B_vnmwya.js} +9 -9
  12. package/dist/{schema-BI-Ia-h9.js → schema-C34LJ8aV.js} +5 -5
  13. package/dist/types/{src/builtins → builtins}/definitions/collections.d.ts +12 -12
  14. package/dist/types/{src/builtins → builtins}/definitions/fields/boolean.d.ts +1 -1
  15. package/dist/types/{src/builtins → builtins}/definitions/fields/category.d.ts +1 -1
  16. package/dist/types/{src/builtins → builtins}/definitions/fields/date.d.ts +1 -1
  17. package/dist/types/{src/builtins → builtins}/definitions/fields/long-text.d.ts +1 -1
  18. package/dist/types/{src/builtins → builtins}/definitions/fields/mapped-category.d.ts +1 -1
  19. package/dist/types/{src/builtins → builtins}/definitions/fields/multi-choice.d.ts +1 -1
  20. package/dist/types/{src/builtins → builtins}/definitions/fields/number.d.ts +1 -1
  21. package/dist/types/{src/builtins → builtins}/definitions/fields/onehot-category.d.ts +1 -1
  22. package/dist/types/{src/builtins → builtins}/definitions/fields/rating.d.ts +1 -1
  23. package/dist/types/{src/builtins → builtins}/definitions/fields/series-helpers.d.ts +4 -4
  24. package/dist/types/{src/builtins → builtins}/definitions/fields/single-choice.d.ts +1 -1
  25. package/dist/types/{src/builtins → builtins}/definitions/fields/text.d.ts +1 -1
  26. package/dist/types/{src/builtins → builtins}/definitions/reports/classifier.d.ts +1 -1
  27. package/dist/types/{src/builtins → builtins}/definitions/reports/regressor.d.ts +1 -1
  28. package/dist/types/{src/builtins → builtins}/definitions/shared.d.ts +3 -28
  29. package/dist/types/{src/builtins → builtins}/index.d.ts +2 -3
  30. package/dist/types/{src/builtins → builtins}/mapped-category-behavior.d.ts +1 -1
  31. package/dist/types/builtins/registry.d.ts +2 -0
  32. package/dist/types/kit/builtin-presenters.d.ts +2 -0
  33. package/dist/types/{src/kit → kit}/defaults.d.ts +3 -3
  34. package/dist/types/{src/kit → kit}/index.d.ts +3 -0
  35. package/dist/types/{src/kit → kit}/kinds/define-field-kind.d.ts +4 -3
  36. package/dist/types/{src/kit → kit}/kinds/define-report-kind.d.ts +4 -3
  37. package/dist/types/kit/kinds/register-kind.d.ts +6 -0
  38. package/dist/types/{src/kit → kit}/layout-helpers.d.ts +1 -1
  39. package/dist/types/{src/kit → kit}/layout-node-render.d.ts +1 -1
  40. package/dist/types/{src/kit → kit}/layout-root.d.ts +1 -1
  41. package/dist/types/{src/kit → kit}/layout-utils.d.ts +1 -1
  42. package/dist/types/{src/kit → kit}/layout.d.ts +1 -1
  43. package/dist/types/{src/kit → kit}/mount-types.d.ts +5 -3
  44. package/dist/types/kit/plugin.d.ts +19 -0
  45. package/dist/types/kit/registry-pack.d.ts +16 -0
  46. package/dist/types/{src/kit → kit}/tabs-root.d.ts +1 -1
  47. package/dist/types/{src/kit → kit}/view-core-types.d.ts +4 -2
  48. package/dist/types/{src/kit → kit}/view-navigation.d.ts +1 -1
  49. package/dist/types/{src/kit → kit}/view-snapshot-cache.d.ts +2 -2
  50. package/dist/types/{src/kit → kit}/view-snapshot.d.ts +2 -2
  51. package/dist/types/{src/kit → kit}/wizard-root.d.ts +1 -1
  52. package/dist/types/{src/primitives → primitives}/descriptors/registry.d.ts +2 -1
  53. package/dist/types/{src/primitives → primitives}/index.d.ts +1 -1
  54. package/dist/types/primitives/mount-form.d.ts +4 -0
  55. package/dist/types/{src/runtime → runtime}/errors.d.ts +1 -1
  56. package/dist/types/{src/runtime → runtime}/runtime-behaviors.d.ts +1 -1
  57. package/dist/types/{src/runtime → runtime}/submission/request.d.ts +1 -1
  58. package/dist/types/{src/runtime → runtime}/submission/types.d.ts +1 -1
  59. package/dist/types/{src/runtime → runtime}/types/behavior.d.ts +2 -2
  60. package/dist/types/{src/runtime → runtime}/types/field.d.ts +3 -3
  61. package/dist/types/{src/runtime → runtime}/types/form.d.ts +3 -2
  62. package/dist/types/{src/runtime → runtime}/types/index.d.ts +1 -0
  63. package/dist/types/{src/runtime → runtime}/types/registry.d.ts +1 -1
  64. package/dist/types/{src/runtime → runtime}/types/report.d.ts +5 -5
  65. package/dist/types/runtime/types/status.d.ts +1 -0
  66. package/dist/types/{src/runtime → runtime}/types/transport.d.ts +5 -5
  67. package/dist/types/{src/runtime → runtime}/validation/form.d.ts +1 -1
  68. package/dist/types/{src/schema → schema}/index.d.ts +1 -0
  69. package/dist/types/{src/schema → schema}/mapped-to.d.ts +2 -6
  70. package/dist/types/{src/schema → schema}/normalize.d.ts +2 -1
  71. package/dist/types/{src/schema → schema}/registry.d.ts +3 -1
  72. package/dist/types/{src/schema → schema}/types/field.d.ts +1 -1
  73. package/dist/types/schema/types/mapping.d.ts +6 -0
  74. package/dist/types/{src/schema → schema}/types/report.d.ts +1 -1
  75. package/dist/types/{src/schema → schema}/types/submit.d.ts +1 -1
  76. package/dist/types/{src/schema → schema}/validation.d.ts +2 -1
  77. package/dist/types/{src/transport → transport}/types.d.ts +1 -1
  78. package/package.json +27 -20
  79. package/dist/builtins-rkxD-h7K.js +0 -749
  80. package/dist/types/src/builtins/registry-pack.d.ts +0 -10
  81. package/dist/types/src/kit/kinds/register-kind.d.ts +0 -5
  82. package/dist/types/src/primitives/mount-form.d.ts +0 -4
  83. /package/dist/types/{src/builtins → builtins}/constants.d.ts +0 -0
  84. /package/dist/types/{src/builtins → builtins}/definitions/fields/series.d.ts +0 -0
  85. /package/dist/types/{src/builtins → builtins}/definitions/fields/value-helpers.d.ts +0 -0
  86. /package/dist/types/{src/builtins → builtins}/definitions/index.d.ts +0 -0
  87. /package/dist/types/{src/design → design}/constants.d.ts +0 -0
  88. /package/dist/types/{src/design → design}/contract/component-keys.d.ts +0 -0
  89. /package/dist/types/{src/design → design}/contract/component-tokens.d.ts +0 -0
  90. /package/dist/types/{src/design → design}/contract/global-tokens.d.ts +0 -0
  91. /package/dist/types/{src/design → design}/contract/index.d.ts +0 -0
  92. /package/dist/types/{src/design → design}/contract/token-keys.d.ts +0 -0
  93. /package/dist/types/{src/design → design}/index.d.ts +0 -0
  94. /package/dist/types/{src/design → design}/recipes/collections.d.ts +0 -0
  95. /package/dist/types/{src/design → design}/recipes/contrast.d.ts +0 -0
  96. /package/dist/types/{src/design → design}/recipes/default.d.ts +0 -0
  97. /package/dist/types/{src/design → design}/recipes/index.d.ts +0 -0
  98. /package/dist/types/{src/design → design}/recipes/minimal.d.ts +0 -0
  99. /package/dist/types/{src/design → design}/recipes/soft.d.ts +0 -0
  100. /package/dist/types/{src/design → design}/registry/builtins.d.ts +0 -0
  101. /package/dist/types/{src/design → design}/registry/create-registry.d.ts +0 -0
  102. /package/dist/types/{src/design → design}/registry/deep-freeze.d.ts +0 -0
  103. /package/dist/types/{src/design → design}/registry/define-recipe.d.ts +0 -0
  104. /package/dist/types/{src/design → design}/registry/define-theme.d.ts +0 -0
  105. /package/dist/types/{src/design → design}/registry/define-token-maps.d.ts +0 -0
  106. /package/dist/types/{src/design → design}/registry/index.d.ts +0 -0
  107. /package/dist/types/{src/design → design}/resolve/diagnostics.d.ts +0 -0
  108. /package/dist/types/{src/design → design}/resolve/index.d.ts +0 -0
  109. /package/dist/types/{src/design → design}/resolve/merge-config.d.ts +0 -0
  110. /package/dist/types/{src/design → design}/resolve/migrate-tokens.d.ts +0 -0
  111. /package/dist/types/{src/design → design}/resolve/resolve-design.d.ts +0 -0
  112. /package/dist/types/{src/design → design}/resolve/resolve-mode.d.ts +0 -0
  113. /package/dist/types/{src/design → design}/resolve/resolve-recipe.d.ts +0 -0
  114. /package/dist/types/{src/design → design}/resolve/resolve-theme.d.ts +0 -0
  115. /package/dist/types/{src/design → design}/resolve/resolve-tokens.d.ts +0 -0
  116. /package/dist/types/{src/design → design}/runtime/apply-tokens.d.ts +0 -0
  117. /package/dist/types/{src/design → design}/runtime/attach-design.d.ts +0 -0
  118. /package/dist/types/{src/design → design}/runtime/controller-helpers.d.ts +0 -0
  119. /package/dist/types/{src/design → design}/runtime/create-stylesheet.d.ts +0 -0
  120. /package/dist/types/{src/design → design}/runtime/declarations.d.ts +0 -0
  121. /package/dist/types/{src/design → design}/runtime/design-controller.d.ts +0 -0
  122. /package/dist/types/{src/design → design}/runtime/fingerprint.d.ts +0 -0
  123. /package/dist/types/{src/design → design}/runtime/host-observer.d.ts +0 -0
  124. /package/dist/types/{src/design → design}/runtime/host-state.d.ts +0 -0
  125. /package/dist/types/{src/design → design}/runtime/hydrate-design.d.ts +0 -0
  126. /package/dist/types/{src/design → design}/runtime/hydration-state.d.ts +0 -0
  127. /package/dist/types/{src/design → design}/runtime/index.d.ts +0 -0
  128. /package/dist/types/{src/design → design}/runtime/inherited-scheme.d.ts +0 -0
  129. /package/dist/types/{src/design → design}/runtime/media.d.ts +0 -0
  130. /package/dist/types/{src/design → design}/themes/airbnb.d.ts +0 -0
  131. /package/dist/types/{src/design → design}/themes/clickhouse.d.ts +0 -0
  132. /package/dist/types/{src/design → design}/themes/cobalt.d.ts +0 -0
  133. /package/dist/types/{src/design → design}/themes/collections.d.ts +0 -0
  134. /package/dist/types/{src/design → design}/themes/graphite.d.ts +0 -0
  135. /package/dist/types/{src/design → design}/themes/index.d.ts +0 -0
  136. /package/dist/types/{src/design → design}/themes/neutral.d.ts +0 -0
  137. /package/dist/types/{src/design → design}/themes/sage.d.ts +0 -0
  138. /package/dist/types/{src/design → design}/themes/sunset.d.ts +0 -0
  139. /package/dist/types/{src/design → design}/tokens/base.d.ts +0 -0
  140. /package/dist/types/{src/design → design}/tokens/contrast.d.ts +0 -0
  141. /package/dist/types/{src/design → design}/tokens/density.d.ts +0 -0
  142. /package/dist/types/{src/design → design}/tokens/forced-colors.d.ts +0 -0
  143. /package/dist/types/{src/design → design}/tokens/index.d.ts +0 -0
  144. /package/dist/types/{src/design → design}/tokens/motion.d.ts +0 -0
  145. /package/dist/types/{src/design → design}/types.d.ts +0 -0
  146. /package/dist/types/{src/kit → kit}/constants.d.ts +0 -0
  147. /package/dist/types/{src/kit → kit}/disclosure-root-styles.d.ts +0 -0
  148. /package/dist/types/{src/kit → kit}/error-navigation.d.ts +0 -0
  149. /package/dist/types/{src/kit → kit}/kinds/index.d.ts +0 -0
  150. /package/dist/types/{src/kit → kit}/layout-node-resolver.d.ts +0 -0
  151. /package/dist/types/{src/kit → kit}/layout-types.d.ts +0 -0
  152. /package/dist/types/{src/kit → kit}/mount-form.d.ts +0 -0
  153. /package/dist/types/{src/kit → kit}/panel-nav.d.ts +0 -0
  154. /package/dist/types/{src/kit → kit}/step-indicator.d.ts +0 -0
  155. /package/dist/types/{src/kit → kit}/tabs-root-styles.d.ts +0 -0
  156. /package/dist/types/{src/kit → kit}/types.d.ts +0 -0
  157. /package/dist/types/{src/kit → kit}/view-layout-state.d.ts +0 -0
  158. /package/dist/types/{src/kit → kit}/view-types.d.ts +0 -0
  159. /package/dist/types/{src/kit → kit}/view.d.ts +0 -0
  160. /package/dist/types/{src/kit → kit}/wizard-constants.d.ts +0 -0
  161. /package/dist/types/{src/kit → kit}/wizard-root-styles.d.ts +0 -0
  162. /package/dist/types/{src/primitives → primitives}/base-async-report-element.d.ts +0 -0
  163. /package/dist/types/{src/primitives → primitives}/base-field-element.d.ts +0 -0
  164. /package/dist/types/{src/primitives → primitives}/base-report-element.d.ts +0 -0
  165. /package/dist/types/{src/primitives → primitives}/components/declarative-field.d.ts +0 -0
  166. /package/dist/types/{src/primitives → primitives}/components/declarative-report.d.ts +0 -0
  167. /package/dist/types/{src/primitives → primitives}/components/descriptor-content.d.ts +0 -0
  168. /package/dist/types/{src/primitives → primitives}/components/error-focus.d.ts +0 -0
  169. /package/dist/types/{src/primitives → primitives}/components/field-frame-feedback.d.ts +0 -0
  170. /package/dist/types/{src/primitives → primitives}/components/field-frame-styles.d.ts +0 -0
  171. /package/dist/types/{src/primitives → primitives}/components/field-frame.d.ts +0 -0
  172. /package/dist/types/{src/primitives → primitives}/components/form-errors.d.ts +0 -0
  173. /package/dist/types/{src/primitives → primitives}/components/form-root-presenters.d.ts +0 -0
  174. /package/dist/types/{src/primitives → primitives}/components/form-root-split-styles.d.ts +0 -0
  175. /package/dist/types/{src/primitives → primitives}/components/form-root-state.d.ts +0 -0
  176. /package/dist/types/{src/primitives → primitives}/components/form-root-styles.d.ts +0 -0
  177. /package/dist/types/{src/primitives → primitives}/components/form-root-templates.d.ts +0 -0
  178. /package/dist/types/{src/primitives → primitives}/components/form-root.d.ts +0 -0
  179. /package/dist/types/{src/primitives → primitives}/components/mounted-report.d.ts +0 -0
  180. /package/dist/types/{src/primitives → primitives}/components/report-frame.d.ts +0 -0
  181. /package/dist/types/{src/primitives → primitives}/components/submit-button.d.ts +0 -0
  182. /package/dist/types/{src/primitives → primitives}/components/unsupported-component.d.ts +0 -0
  183. /package/dist/types/{src/primitives → primitives}/constants.d.ts +0 -0
  184. /package/dist/types/{src/primitives → primitives}/controller-binding.d.ts +0 -0
  185. /package/dist/types/{src/primitives → primitives}/controller-types.d.ts +0 -0
  186. /package/dist/types/{src/primitives → primitives}/descriptor-resolution.d.ts +0 -0
  187. /package/dist/types/{src/primitives → primitives}/descriptors/content.d.ts +0 -0
  188. /package/dist/types/{src/primitives → primitives}/descriptors/field.d.ts +0 -0
  189. /package/dist/types/{src/primitives → primitives}/descriptors/index.d.ts +0 -0
  190. /package/dist/types/{src/primitives → primitives}/descriptors/report.d.ts +0 -0
  191. /package/dist/types/{src/primitives → primitives}/fields/boolean-field.d.ts +0 -0
  192. /package/dist/types/{src/primitives → primitives}/fields/category-field.d.ts +0 -0
  193. /package/dist/types/{src/primitives → primitives}/fields/date-field.d.ts +0 -0
  194. /package/dist/types/{src/primitives → primitives}/fields/long-text-field.d.ts +0 -0
  195. /package/dist/types/{src/primitives → primitives}/fields/multi-choice-field.d.ts +0 -0
  196. /package/dist/types/{src/primitives → primitives}/fields/number-field.d.ts +0 -0
  197. /package/dist/types/{src/primitives → primitives}/fields/rating-field.d.ts +0 -0
  198. /package/dist/types/{src/primitives → primitives}/fields/series-field-helpers.d.ts +0 -0
  199. /package/dist/types/{src/primitives → primitives}/fields/series-field-renderers.d.ts +0 -0
  200. /package/dist/types/{src/primitives → primitives}/fields/series-field-styles.d.ts +0 -0
  201. /package/dist/types/{src/primitives → primitives}/fields/series-field.d.ts +0 -0
  202. /package/dist/types/{src/primitives → primitives}/fields/single-choice-field.d.ts +0 -0
  203. /package/dist/types/{src/primitives → primitives}/fields/text-field.d.ts +0 -0
  204. /package/dist/types/{src/primitives → primitives}/register.d.ts +0 -0
  205. /package/dist/types/{src/primitives → primitives}/registry.d.ts +0 -0
  206. /package/dist/types/{src/primitives → primitives}/reports/classifier-report.d.ts +0 -0
  207. /package/dist/types/{src/primitives → primitives}/reports/regressor-report.d.ts +0 -0
  208. /package/dist/types/{src/primitives → primitives}/request-runner.d.ts +0 -0
  209. /package/dist/types/{src/primitives → primitives}/types.d.ts +0 -0
  210. /package/dist/types/{src/primitives → primitives}/utils.d.ts +0 -0
  211. /package/dist/types/{src/runtime → runtime}/comparison.d.ts +0 -0
  212. /package/dist/types/{src/runtime → runtime}/create-runtime-helpers.d.ts +0 -0
  213. /package/dist/types/{src/runtime → runtime}/create-runtime.d.ts +0 -0
  214. /package/dist/types/{src/runtime → runtime}/equality.d.ts +0 -0
  215. /package/dist/types/{src/runtime → runtime}/fields/controller.d.ts +0 -0
  216. /package/dist/types/{src/runtime → runtime}/fields/index.d.ts +0 -0
  217. /package/dist/types/{src/runtime → runtime}/fields/state-calculations.d.ts +0 -0
  218. /package/dist/types/{src/runtime → runtime}/fields/state.d.ts +0 -0
  219. /package/dist/types/{src/runtime → runtime}/form.d.ts +0 -0
  220. /package/dist/types/{src/runtime → runtime}/index.d.ts +0 -0
  221. /package/dist/types/{src/runtime → runtime}/paths.d.ts +0 -0
  222. /package/dist/types/{src/runtime → runtime}/reports/controller.d.ts +0 -0
  223. /package/dist/types/{src/runtime → runtime}/reports/index.d.ts +0 -0
  224. /package/dist/types/{src/runtime → runtime}/runtime-controller.d.ts +0 -0
  225. /package/dist/types/{src/runtime → runtime}/runtime-refresh.d.ts +0 -0
  226. /package/dist/types/{src/runtime → runtime}/runtime-values.d.ts +0 -0
  227. /package/dist/types/{src/runtime → runtime}/state/engine.d.ts +0 -0
  228. /package/dist/types/{src/runtime → runtime}/state/index.d.ts +0 -0
  229. /package/dist/types/{src/runtime → runtime}/state/snapshots.d.ts +0 -0
  230. /package/dist/types/{src/runtime → runtime}/state/store.d.ts +0 -0
  231. /package/dist/types/{src/runtime → runtime}/submission/abort.d.ts +0 -0
  232. /package/dist/types/{src/runtime → runtime}/submission/create-submitter.d.ts +0 -0
  233. /package/dist/types/{src/runtime → runtime}/submission/error-flow.d.ts +0 -0
  234. /package/dist/types/{src/runtime → runtime}/submission/index.d.ts +0 -0
  235. /package/dist/types/{src/runtime → runtime}/submission/lifecycle.d.ts +0 -0
  236. /package/dist/types/{src/runtime → runtime}/submission/multi-backend.d.ts +0 -0
  237. /package/dist/types/{src/runtime → runtime}/submission/pipeline.d.ts +0 -0
  238. /package/dist/types/{src/runtime → runtime}/submission/report-fetches.d.ts +0 -0
  239. /package/dist/types/{src/runtime → runtime}/submission/reports.d.ts +0 -0
  240. /package/dist/types/{src/runtime → runtime}/submission/result.d.ts +0 -0
  241. /package/dist/types/{src/runtime → runtime}/submission/snapshot.d.ts +0 -0
  242. /package/dist/types/{src/runtime → runtime}/submission/submitter.d.ts +0 -0
  243. /package/dist/types/{src/runtime → runtime}/submission/transport-response.d.ts +0 -0
  244. /package/dist/types/{src/runtime → runtime}/types/pipeline.d.ts +0 -0
  245. /package/dist/types/{src/runtime → runtime}/utils.d.ts +0 -0
  246. /package/dist/types/{src/runtime → runtime}/validation/conditions.d.ts +0 -0
  247. /package/dist/types/{src/runtime → runtime}/validation/field-state.d.ts +0 -0
  248. /package/dist/types/{src/runtime → runtime}/validation/field-validator.d.ts +0 -0
  249. /package/dist/types/{src/runtime → runtime}/validation/field.d.ts +0 -0
  250. /package/dist/types/{src/runtime → runtime}/validation/index.d.ts +0 -0
  251. /package/dist/types/{src/runtime → runtime}/values.d.ts +0 -0
  252. /package/dist/types/{src/schema → schema}/ids.d.ts +0 -0
  253. /package/dist/types/{src/schema → schema}/onehot-display.d.ts +0 -0
  254. /package/dist/types/{src/schema → schema}/report-context.d.ts +0 -0
  255. /package/dist/types/{src/schema → schema}/report-fetch-request.d.ts +0 -0
  256. /package/dist/types/{src/schema → schema}/types/form.d.ts +0 -0
  257. /package/dist/types/{src/schema → schema}/types/registry.d.ts +0 -0
  258. /package/dist/types/{src/transport → transport}/errors.d.ts +0 -0
  259. /package/dist/types/{src/transport → transport}/fanout.d.ts +0 -0
  260. /package/dist/types/{src/transport → transport}/index.d.ts +0 -0
  261. /package/dist/types/{src/transport → transport}/request-runner.d.ts +0 -0
package/README.md CHANGED
@@ -1,89 +1,75 @@
1
1
  # MLForm
2
2
 
3
- [![CI Pipeline](https://github.com/UlloaSP/mlform/actions/workflows/ci.yml/badge.svg)](https://github.com/UlloaSP/mlform/actions/workflows/ci.yml)
4
- [![Release](https://github.com/UlloaSP/mlform/actions/workflows/release.yml/badge.svg)](https://github.com/UlloaSP/mlform/actions/workflows/release.yml)
5
- [![npm version](https://img.shields.io/npm/v/mlform.svg)](https://www.npmjs.com/package/mlform)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
3
+ [![CI](https://github.com/UlloaSP/mlform/actions/workflows/ci.yml/badge.svg)](https://github.com/UlloaSP/mlform/actions/workflows/ci.yml)
4
+ [![npm](https://img.shields.io/npm/v/mlform.svg)](https://www.npmjs.com/package/mlform)
5
+ [![MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](LICENSE)
7
6
 
8
- Schema-driven forms for machine learning applications.
7
+ MLForm is a schema-driven form runtime and Web Component kit for machine-learning products. Define inputs and reports once; MLForm handles normalization, validation, backend-facing values, submission state, and result rendering.
9
8
 
10
- MLForm gives you a predictable UI layer between users and model backends. You describe inputs and reports with a schema, MLForm renders accessible Web Components, validates values, submits structured payloads, and displays model results in the same host container.
9
+ Use the complete UI from `mlform`, build your own UI on the headless runtime, or adopt the layers between those two points.
11
10
 
12
- Version `0.1.23` is the current release in this repository.
11
+ ## Why another form library?
13
12
 
14
- ## Why MLForm
13
+ Most form libraries stop at collecting values. ML interfaces also need to keep model mappings, validation, asynchronous reports, loading states, and result rendering consistent with the backend contract.
15
14
 
16
- Most ML product forms drift over time:
15
+ MLForm exists so every screen does not invent that integration again. The schema stays the source of truth, transports remain replaceable, and rendering is optional. The project is MIT licensed; if its direction stops fitting your product, you can fork it or use only the lower-level packages.
17
16
 
18
- - the frontend shape stops matching the backend contract
19
- - validation rules end up duplicated across components
20
- - model outputs are rendered ad hoc in each screen
21
- - design and accessibility regress when teams move fast
17
+ ## Installation
22
18
 
23
- MLForm solves that by centering everything on an explicit schema and a transport layer.
24
-
25
- Use it for:
26
-
27
- - prediction forms
28
- - scoring and approval tools
29
- - forecasting dashboards
30
- - internal review consoles
31
- - embedded model workflows inside larger apps
32
-
33
- ## Install
34
-
35
- For application usage:
19
+ > [!NOTE]
20
+ > MLForm is pre-1.0. Public APIs may change between minor releases. Node-based consumers require Node.js 20.19 or newer; contributors need Node.js 24.15 or newer.
36
21
 
37
22
  ```bash
38
23
  npm install mlform
39
24
  ```
40
25
 
41
- Import from the explicit package subpath you need:
42
-
43
- ```ts
44
- import { mountForm } from "mlform/kit";
45
- import { createJsonTransport } from "mlform/transport";
46
- ```
26
+ ## Quick start
47
27
 
48
- ## Quick Start
49
-
50
- Create a host element:
28
+ Add a host element:
51
29
 
52
30
  ```html
53
31
  <div id="prediction-form"></div>
54
32
  ```
55
33
 
56
- Mount a form:
34
+ Mount MLForm with a schema and any object implementing the transport contract:
57
35
 
58
36
  ```ts
59
- import { mountForm } from "mlform/kit";
60
- import { createJsonTransport } from "mlform/transport";
37
+ import { mountForm } from "mlform";
38
+ import type { Transport } from "mlform/transport";
39
+
40
+ const transport: Transport = {
41
+ async submit(request) {
42
+ const response = await fetch("/api/predict", {
43
+ method: "POST",
44
+ headers: { "content-type": "application/json" },
45
+ body: JSON.stringify({
46
+ inputs: request.modelValues,
47
+ reports: request.reports,
48
+ }),
49
+ signal: request.signal,
50
+ });
61
51
 
62
- const container = document.querySelector("#prediction-form");
52
+ if (!response.ok) throw new Error(`Prediction failed: ${response.status}`);
53
+ return response.json();
54
+ },
55
+ };
63
56
 
64
- if (!container) {
65
- throw new Error("Missing #prediction-form container.");
66
- }
57
+ const container = document.querySelector<HTMLElement>("#prediction-form");
58
+ if (!container) throw new Error("Missing #prediction-form container.");
67
59
 
68
- const mounted = mountForm(container as HTMLElement, {
69
- transport: createJsonTransport({ endpoint: "/api/predict" }),
60
+ const mounted = mountForm(container, {
61
+ transport,
70
62
  schema: {
71
63
  fields: [
72
- {
73
- id: "prompt",
74
- kind: "text",
75
- label: "Prompt",
76
- required: true,
77
- minLength: 3,
78
- },
64
+ { id: "prompt", kind: "text", label: "Prompt", required: true },
79
65
  {
80
66
  id: "threshold",
81
67
  kind: "number",
82
68
  label: "Confidence threshold",
83
69
  min: 0,
84
70
  max: 1,
85
- step: 0.05,
86
71
  defaultValue: 0.75,
72
+ mappedTo: "threshold",
87
73
  },
88
74
  ],
89
75
  reports: [
@@ -91,225 +77,108 @@ const mounted = mountForm(container as HTMLElement, {
91
77
  id: "prediction",
92
78
  kind: "classifier",
93
79
  label: "Prediction",
80
+ mappedTo: "prediction",
94
81
  },
95
82
  ],
96
83
  },
97
- labels: {
98
- submit: "Run prediction",
99
- submitting: "Running...",
100
- },
101
- layout: "split",
102
- designSystem: {
103
- mode: "auto",
104
- theme: "cobalt",
105
- recipe: "soft",
106
- },
84
+ labels: { submit: "Run prediction" },
85
+ designSystem: { mode: "auto", theme: "cobalt", recipe: "soft" },
107
86
  });
108
87
 
109
88
  window.addEventListener("beforeunload", () => mounted.unmount());
110
89
  ```
111
90
 
112
- The default JSON transport sends:
91
+ The backend returns explicit report results:
113
92
 
114
93
  ```json
115
94
  {
116
- "inputs": {
117
- "prompt": "Example text",
118
- "threshold": 0.75
119
- }
120
- }
121
- ```
122
-
123
- Return reports keyed by report id:
124
-
125
- ```json
126
- {
127
- "reports": {
128
- "prediction": {
129
- "label": "Approved",
130
- "confidence": 0.91,
131
- "probabilities": {
132
- "Approved": 0.91,
133
- "Rejected": 0.09
95
+ "reports": [
96
+ {
97
+ "backend": "default",
98
+ "mappedTo": "prediction",
99
+ "status": "ready",
100
+ "payload": {
101
+ "prediction": "Approved",
102
+ "labels": ["Approved", "Rejected"],
103
+ "probabilities": [0.91, 0.09]
134
104
  }
135
105
  }
136
- },
137
- "meta": {
138
- "model": "credit-risk-v2"
139
- }
106
+ ],
107
+ "meta": { "model": "credit-risk-v2" }
140
108
  }
141
109
  ```
142
110
 
143
- ## What You Get
144
-
145
- - Schema-driven fields, reports, conditions, defaults, and serialization
146
- - Accessible Web Components for form inputs, submit actions, and result rendering
147
- - Headless `createFormView()` API for custom layouts and app-owned rendering
148
- - Official `mountForm()` helper for step-based flows
149
- - Built-in JSON transport plus composable transport middleware
150
- - Headless engine APIs for custom orchestration and registries
151
- - Runtime design system with themes, recipes, density, motion, and token overrides
152
- - Extension points for custom field and report kinds
153
-
154
- Built-in fields:
155
-
156
- - `text`
157
- - `number`
158
- - `boolean`
159
- - `category`
160
- - `date`
161
- - `time-series`
162
-
163
- Built-in reports:
111
+ ## Choose your level
164
112
 
165
- - `classifier`
166
- - `regressor`
113
+ | Package | Purpose |
114
+ | --- | --- |
115
+ | `mlform` | Application-facing alias of `mlform/kit`. |
116
+ | `mlform/kit` | Mounting, layouts, navigation, lifecycle, and declarative extensions. |
117
+ | `mlform/runtime` | Headless state, validation, conditions, hooks, and submission orchestration. |
118
+ | `mlform/schema` | Schema contracts, normalization, mappings, and registries. |
119
+ | `mlform/builtins` | Headless definitions for included field and report kinds. |
120
+ | `mlform/transport` | Transport contracts, request execution, errors, and fanout. |
121
+ | `mlform/primitives` | Web Component renderers and renderer registries. |
122
+ | `mlform/design` | Themes, recipes, tokens, density, motion, and host integration. |
167
123
 
168
- Built-in themes:
124
+ ## What is included?
169
125
 
170
- - `neutral`
171
- - `cobalt`
172
- - `graphite`
173
- - `sage`
174
- - `sunset`
126
+ - Accessible built-in fields and report renderers
127
+ - Headless runtime and form-view APIs
128
+ - Single-page, split, tabs, accordion, and wizard layouts
129
+ - Explicit display-value and model-value boundaries
130
+ - Custom field and report kinds through the normal registration path
131
+ - Themes, recipes, design tokens, forced-colors support, and host integration
132
+ - Replaceable transports for HTTP, local models, workers, or application-owned clients
175
133
 
176
- Built-in recipes:
134
+ ## Some notes
177
135
 
178
- - `default`
179
- - `minimal`
180
- - `soft`
181
- - `contrast`
136
+ MLForm is young. Expect the API to become smaller and more explicit before 1.0.
182
137
 
183
- ## Package Surfaces
138
+ MLForm does not host models, prescribe a backend framework, or require its built-in UI. It owns the form contract and lifecycle; your application owns transport, authentication, deployment, and model execution.
184
139
 
185
- | Surface | Use it for |
186
- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------- |
187
- | `mlform/kit` | Explicit kit entrypoint with `mountForm`, `createFormView`, labels, layout, and lifecycle utilities. |
188
- | `mlform/runtime` | Headless state, validation, registries, hooks, conditions, and submission orchestration. |
189
- | `mlform/primitives` | Web Component renderers and custom renderer registries. |
190
- | `mlform/design` | Themes, recipes, tokens, mode resolution, and host integration. |
191
- | `mlform/transport` | Transport composition, middleware, resilience policies, and orchestration helpers. |
140
+ ## Documentation
192
141
 
193
- ## Custom Domain Kinds
142
+ Full documentation lives at [ulloasp.github.io/mlform](https://ulloasp.github.io/mlform/).
194
143
 
195
- When built-in kinds are not enough, define your own field and report kinds without rewriting the normal rendering path.
144
+ - [Installation](https://ulloasp.github.io/mlform/getting-started/installation/)
145
+ - [Quick start](https://ulloasp.github.io/mlform/getting-started/quick-start/)
146
+ - [Backend contract](https://ulloasp.github.io/mlform/guides/backend-contract/)
147
+ - [Headless kit](https://ulloasp.github.io/mlform/kit/headless-kit/)
148
+ - [Design system](https://ulloasp.github.io/mlform/design/overview/)
149
+ - [Package exports](https://ulloasp.github.io/mlform/reference/package-exports/)
196
150
 
197
- ```ts
198
- import { createMlRegistryPack } from "mlform/builtins";
199
- import { defineFieldKind, registerDefinedFieldKind } from "mlform/kit";
200
- import { z } from "zod";
201
-
202
- const pack = createMlRegistryPack();
203
-
204
- registerDefinedFieldKind(
205
- pack.registry,
206
- pack.descriptorRegistry,
207
- defineFieldKind({
208
- kind: "score",
209
- schema: z.object({
210
- kind: z.literal("score"),
211
- id: z.string().optional(),
212
- label: z.string(),
213
- min: z.number().default(0),
214
- max: z.number().default(100),
215
- }),
216
- value: {
217
- default: () => 0,
218
- normalize: (value) => Number(value ?? 0),
219
- serialize: (value) => value,
220
- },
221
- validate: ({ value, config }) =>
222
- value < config.min || value > config.max ? ["Score out of range."] : [],
223
- render: {
224
- widget: "number",
225
- hints: ({ config }) => ({
226
- min: config.min,
227
- max: config.max,
228
- unit: "%",
229
- }),
230
- },
231
- }),
232
- );
233
- ```
151
+ The current architecture is available as an [interactive diagram](./architecture/mlform-system.architecture.html).
234
152
 
235
- Stay at the declarative `define*Kind` layer unless you truly need fully custom rendering or low-level primitive behavior.
153
+ ## Contributing
236
154
 
237
- ## Typical Flow
155
+ MLForm uses [Vite+](https://viteplus.dev/guide/) for dependency management, checks, tests, and builds.
238
156
 
239
- 1. Define the schema with `fields` and `reports`.
240
- 2. Mount the form with `mountForm`.
241
- 3. Point the transport at your model endpoint or custom backend adapter.
242
- 4. Return normalized reports from the backend.
243
- 5. Customize theme, recipe, labels, or registries only where your product needs it.
157
+ Install `vp`:
244
158
 
245
- ## Headless Layouts
159
+ ### macOS / Linux
246
160
 
247
- Use `createFormView()` when you want MLForm to own state and validation, but your app to own layout:
248
-
249
- ```ts
250
- import { createFormView } from "mlform/kit";
251
- import { createJsonTransport } from "mlform/transport";
252
-
253
- const view = createFormView({
254
- transport: createJsonTransport({ endpoint: "/api/predict" }),
255
- schema,
256
- layout: {
257
- kind: "wizard",
258
- steps: [
259
- { title: "Profile", children: [{ kind: "field", field: "name" }] },
260
- { title: "Review", children: [{ kind: "field", field: "email" }] },
261
- ],
262
- },
263
- });
161
+ ```bash
162
+ curl -fsSL https://vite.plus | bash
264
163
  ```
265
164
 
266
- If you want a built-in step UI, use `mountForm()` with the same layout config.
267
-
268
- ## Documentation
269
-
270
- - Docs home: https://ulloasp.github.io/mlform/
271
- - Quick start: https://ulloasp.github.io/mlform/getting-started/quick-start/
272
- - Installation: https://ulloasp.github.io/mlform/getting-started/installation/
273
- - Backend contract: https://ulloasp.github.io/mlform/guides/backend-contract/
274
- - Transport guide: https://ulloasp.github.io/mlform/kit/transport/
275
- - Headless kit: https://ulloasp.github.io/mlform/kit/headless-kit/
276
- - Wizard layout: https://ulloasp.github.io/mlform/kit/wizard-layout/
277
- - Design system: https://ulloasp.github.io/mlform/design/overview/
278
- - API reference: https://ulloasp.github.io/mlform/reference/kit/
279
- - Migration guide: https://ulloasp.github.io/mlform/migration/from-legacy-mlform/
280
- - Versioning notes: https://ulloasp.github.io/mlform/support/versioning/
165
+ ### Windows
281
166
 
282
- ## Development
283
-
284
- This repository uses Vite+. Do not use `npm`, `pnpm`, or `yarn` directly for workspace tasks in this repo.
285
-
286
- Run the main package checks:
287
-
288
- ```bash
289
- vp install
290
- vp check
291
- vp test
292
- vp build
167
+ ```powershell
168
+ irm https://vite.plus/ps1 | iex
293
169
  ```
294
170
 
295
- Docs live in `docs/`:
171
+ Then install and verify the repository:
296
172
 
297
173
  ```bash
298
- cd docs
299
174
  vp install
175
+ vp check
300
176
  vp run typecheck
301
- vp run build
302
- vp run dev
177
+ vp test run
178
+ vp build
303
179
  ```
304
180
 
305
- The main package targets Node.js `>=24.9.0`.
306
-
307
- ## Release Notes
308
-
309
- For `0.1.23`, use the repository release entry and the published docs as the source of truth:
310
-
311
- - GitHub releases: https://github.com/UlloaSP/mlform/releases
312
- - npm package: https://www.npmjs.com/package/mlform
181
+ Read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening an issue or pull request.
313
182
 
314
183
  ## License
315
184