mlform 0.1.9 → 0.1.11
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/README.md +18 -16
- package/dist/builtins-D8rXH4ED.js +725 -0
- package/dist/{design-system-CIU_vH6O.js → design-6suKVQDo.js} +15 -15
- package/dist/mlform/builtins.mjs +2 -0
- package/dist/mlform/{design-system.mjs → design.mjs} +2 -2
- package/dist/mlform/kit.mjs +1896 -3
- package/dist/mlform/primitives.mjs +2 -2
- package/dist/mlform/runtime.mjs +3 -4
- package/dist/mlform/schema.mjs +2 -102
- package/dist/mlform/transport.mjs +2 -2
- package/dist/{primitives-Di95y_ur.js → primitives-k9HTnd72.js} +2303 -3384
- package/dist/{runtime-C5iTM3uu.js → runtime-CI7vlp9i.js} +655 -791
- package/dist/schema-DSAZ6bts.js +88 -0
- package/dist/{transport-B6ePTLFK.js → transport-CO6udZ6z.js} +605 -575
- package/dist/types/{builtins-ml/definitions/index.d.ts → builtins/definitions/collections.d.ts} +1 -15
- package/dist/types/{shared/object.d.ts → builtins/definitions/fields/value-helpers.d.ts} +1 -0
- package/dist/types/builtins/definitions/index.d.ts +16 -0
- package/dist/types/{builtins-ml → builtins}/definitions/shared.d.ts +2 -9
- package/dist/types/builtins/index.d.ts +6 -0
- package/dist/types/builtins/mapped-category-behavior.d.ts +2 -0
- package/dist/types/builtins/registry-pack.d.ts +10 -0
- package/dist/types/{design-system → design}/index.d.ts +1 -1
- package/dist/types/{design-system/recipes/index.d.ts → design/recipes/collections.d.ts} +0 -1
- package/dist/types/design/recipes/index.d.ts +2 -0
- package/dist/types/design/resolve/index.d.ts +4 -0
- package/dist/types/{design-system/resolve/index.d.ts → design/resolve/resolve-design.d.ts} +0 -3
- package/dist/types/{design-system → design}/runtime/index.d.ts +3 -3
- package/dist/types/{design-system/themes/index.d.ts → design/themes/collections.d.ts} +0 -2
- package/dist/types/design/themes/index.d.ts +3 -0
- package/dist/types/{design-system → design}/types.d.ts +1 -1
- package/dist/types/kit/constants.d.ts +2 -10
- package/dist/types/kit/defaults.d.ts +1 -1
- package/dist/types/kit/disclosure-root-styles.d.ts +1 -0
- package/dist/types/kit/error-navigation.d.ts +2 -1
- package/dist/types/kit/index.d.ts +4 -5
- package/dist/types/{presentation → kit/kinds}/define-field-kind.d.ts +11 -3
- package/dist/types/kit/kinds/define-report-kind.d.ts +40 -0
- package/dist/types/kit/kinds/index.d.ts +3 -0
- package/dist/types/kit/kinds/register-kind.d.ts +5 -0
- package/dist/types/kit/layout-helpers.d.ts +7 -11
- package/dist/types/kit/layout-node-render.d.ts +4 -4
- package/dist/types/kit/layout-node-resolver.d.ts +1 -1
- package/dist/types/kit/{accordion-root.d.ts → layout-root.d.ts} +3 -4
- package/dist/types/kit/layout-types.d.ts +8 -36
- package/dist/types/kit/layout-utils.d.ts +0 -1
- package/dist/types/kit/layout.d.ts +2 -2
- package/dist/types/kit/mount-types.d.ts +8 -7
- package/dist/types/kit/panel-nav.d.ts +1 -1
- package/dist/types/kit/tabs-root.d.ts +1 -2
- package/dist/types/kit/types.d.ts +2 -3
- package/dist/types/kit/view-core-types.d.ts +110 -0
- package/dist/types/kit/view-layout-state.d.ts +10 -3
- package/dist/types/kit/view-navigation.d.ts +3 -3
- package/dist/types/kit/view-snapshot-cache.d.ts +3 -3
- package/dist/types/kit/view-snapshot.d.ts +4 -4
- package/dist/types/kit/view-types.d.ts +1 -172
- package/dist/types/kit/view.d.ts +2 -8
- package/dist/types/kit/wizard-root.d.ts +1 -2
- package/dist/types/primitives/base-async-report-element.d.ts +1 -1
- package/dist/types/primitives/base-field-element.d.ts +3 -3
- package/dist/types/primitives/base-report-element.d.ts +3 -3
- package/dist/types/primitives/components/descriptor-content.d.ts +4 -0
- package/dist/types/primitives/components/error-focus.d.ts +3 -2
- package/dist/types/primitives/components/field-frame-feedback.d.ts +3 -3
- package/dist/types/primitives/components/field-frame.d.ts +3 -3
- package/dist/types/primitives/components/form-errors.d.ts +2 -2
- package/dist/types/primitives/components/form-root-presenters.d.ts +6 -11
- package/dist/types/primitives/components/form-root-state.d.ts +4 -6
- package/dist/types/primitives/components/form-root-templates.d.ts +4 -8
- package/dist/types/primitives/components/form-root.d.ts +4 -4
- package/dist/types/primitives/components/report-frame.d.ts +4 -4
- package/dist/types/primitives/components/submit-button.d.ts +2 -2
- package/dist/types/primitives/constants.d.ts +6 -9
- package/dist/types/primitives/controller-types.d.ts +96 -0
- package/dist/types/primitives/descriptor-resolution.d.ts +6 -0
- package/dist/types/primitives/descriptors/content.d.ts +61 -0
- package/dist/types/primitives/descriptors/field.d.ts +32 -0
- package/dist/types/primitives/descriptors/index.d.ts +5 -0
- package/dist/types/primitives/descriptors/registry.d.ts +11 -0
- package/dist/types/primitives/descriptors/report.d.ts +20 -0
- package/dist/types/primitives/index.d.ts +8 -3
- package/dist/types/primitives/mount-form.d.ts +2 -2
- package/dist/types/primitives/request-runner.d.ts +13 -0
- package/dist/types/primitives/types.d.ts +16 -53
- package/dist/types/runtime/errors.d.ts +1 -2
- package/dist/types/runtime/index.d.ts +2 -4
- package/dist/types/runtime/reports/controller.d.ts +3 -2
- package/dist/types/runtime/runtime-controller.d.ts +1 -5
- package/dist/types/runtime/state/engine.d.ts +1 -2
- package/dist/types/runtime/submission/create-submitter.d.ts +1 -1
- package/dist/types/runtime/submission/index.d.ts +1 -1
- package/dist/types/runtime/submission/lifecycle.d.ts +1 -2
- package/dist/types/runtime/submission/pipeline.d.ts +1 -1
- package/dist/types/runtime/submission/report-fetches.d.ts +2 -0
- package/dist/types/runtime/submission/types.d.ts +1 -2
- package/dist/types/runtime/types/form.d.ts +9 -13
- package/dist/types/runtime/types/index.d.ts +0 -1
- package/dist/types/runtime/types/pipeline.d.ts +10 -10
- package/dist/types/runtime/types/registry.d.ts +2 -3
- package/dist/types/runtime/types/report.d.ts +4 -1
- package/dist/types/runtime/types/transport.d.ts +3 -4
- package/dist/types/runtime/utils.d.ts +1 -3
- package/dist/types/runtime/validation/form.d.ts +1 -1
- package/dist/types/schema/ids.d.ts +1 -0
- package/dist/types/schema/index.d.ts +3 -1
- package/dist/types/schema/registry.d.ts +2 -4
- package/dist/types/schema/report-fetch-request.d.ts +6 -0
- package/dist/types/schema/types/form.d.ts +0 -3
- package/dist/types/schema/types/registry.d.ts +0 -5
- package/dist/types/schema/types/report.d.ts +25 -3
- package/dist/types/schema/types/submit.d.ts +11 -0
- package/dist/types/transport/errors.d.ts +1 -2
- package/dist/types/transport/index.d.ts +2 -0
- package/dist/types/transport/request-runner.d.ts +16 -0
- package/package.json +14 -27
- package/dist/builtins-ml-pjab8_gu.js +0 -3878
- package/dist/errors-CTNw8fwS.js +0 -8
- package/dist/kit-QY6zff-h.js +0 -1888
- package/dist/mlform/behaviors.mjs +0 -32
- package/dist/mlform/builtins-ml.mjs +0 -2
- package/dist/mlform/presentation.mjs +0 -2
- package/dist/mlform.mjs +0 -8
- package/dist/presentation-BrlVO4oV.js +0 -200
- package/dist/strings-CWwrrYzz.js +0 -4
- package/dist/types/behaviors/index.d.ts +0 -3
- package/dist/types/builtins-ml/index.d.ts +0 -5
- package/dist/types/index.d.ts +0 -13
- package/dist/types/kit/accordion-root-styles.d.ts +0 -1
- package/dist/types/kit/accordion.d.ts +0 -2
- package/dist/types/kit/tabs.d.ts +0 -2
- package/dist/types/kit/wizard.d.ts +0 -2
- package/dist/types/packs/default.d.ts +0 -2
- package/dist/types/packs/index.d.ts +0 -3
- package/dist/types/packs/ml.d.ts +0 -2
- package/dist/types/packs/shared.d.ts +0 -24
- package/dist/types/presentation/define-explanation-kind.d.ts +0 -11
- package/dist/types/presentation/define-report-kind.d.ts +0 -15
- package/dist/types/presentation/index.d.ts +0 -10
- package/dist/types/presentation/register-kind.d.ts +0 -6
- package/dist/types/presentation/registry.d.ts +0 -15
- package/dist/types/presentation/types/explanation.d.ts +0 -32
- package/dist/types/presentation/types/field.d.ts +0 -36
- package/dist/types/presentation/types/presentation.d.ts +0 -61
- package/dist/types/presentation/types/report.d.ts +0 -41
- package/dist/types/primitives/base-explanation-element.d.ts +0 -22
- package/dist/types/primitives/components/declarative-explanation.d.ts +0 -5
- package/dist/types/primitives/components/explanation-panel.d.ts +0 -24
- package/dist/types/primitives/components/presentation.d.ts +0 -4
- package/dist/types/primitives/presentation.d.ts +0 -8
- package/dist/types/runtime/explanations/controller.d.ts +0 -13
- package/dist/types/runtime/explanations/index.d.ts +0 -1
- package/dist/types/runtime/schema/index.d.ts +0 -7
- package/dist/types/runtime/submission/explanations.d.ts +0 -2
- package/dist/types/runtime/types/explanation.d.ts +0 -15
- package/dist/types/schema/types/explanation.d.ts +0 -43
- package/dist/types/shared/errors.d.ts +0 -3
- package/dist/types/shared/index.d.ts +0 -3
- package/dist/types/shared/strings.d.ts +0 -1
- package/dist/utils-J5o8lkea.js +0 -29
- /package/dist/types/{runtime → builtins}/constants.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/boolean.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/category.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/date.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/long-text.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/mapped-category.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/multi-choice.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/number.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/rating.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/series-helpers.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/series.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/single-choice.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/text.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/reports/classifier.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/reports/regressor.d.ts +0 -0
- /package/dist/types/{design-system → design}/constants.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/component-keys.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/component-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/global-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/token-keys.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/contrast.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/default.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/minimal.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/soft.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/builtins.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/create-registry.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/deep-freeze.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-recipe.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-theme.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-token-maps.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/diagnostics.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/merge-config.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/migrate-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-mode.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-recipe.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-theme.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/apply-tokens.d.ts +0 -0
- /package/dist/types/{design-system/runtime/attach-design-system.d.ts → design/runtime/attach-design.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/controller-helpers.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/create-stylesheet.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/declarations.d.ts +0 -0
- /package/dist/types/{design-system/runtime/design-system-controller.d.ts → design/runtime/design-controller.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/fingerprint.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/host-observer.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/host-state.d.ts +0 -0
- /package/dist/types/{design-system/runtime/hydrate-design-system.d.ts → design/runtime/hydrate-design.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/hydration-state.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/inherited-scheme.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/media.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/airbnb.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/clickhouse.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/cobalt.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/graphite.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/neutral.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/sage.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/sunset.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/base.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/contrast.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/density.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/forced-colors.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/motion.d.ts +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Schema-driven forms for machine learning applications.
|
|
|
9
9
|
|
|
10
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.
|
|
11
11
|
|
|
12
|
-
Version `0.1.
|
|
12
|
+
Version `0.1.11` is the current release in this repository.
|
|
13
13
|
|
|
14
14
|
## Why MLForm
|
|
15
15
|
|
|
@@ -38,10 +38,11 @@ For application usage:
|
|
|
38
38
|
npm install mlform
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Import from the
|
|
41
|
+
Import from the explicit package subpath you need:
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
|
-
import {
|
|
44
|
+
import { mountForm } from "mlform/kit";
|
|
45
|
+
import { createJsonTransport } from "mlform/transport";
|
|
45
46
|
```
|
|
46
47
|
|
|
47
48
|
## Quick Start
|
|
@@ -55,7 +56,8 @@ Create a host element:
|
|
|
55
56
|
Mount a form:
|
|
56
57
|
|
|
57
58
|
```ts
|
|
58
|
-
import {
|
|
59
|
+
import { mountForm } from "mlform/kit";
|
|
60
|
+
import { createJsonTransport } from "mlform/transport";
|
|
59
61
|
|
|
60
62
|
const container = document.querySelector("#prediction-form");
|
|
61
63
|
|
|
@@ -143,11 +145,11 @@ Return reports keyed by report id:
|
|
|
143
145
|
- Schema-driven fields, reports, conditions, defaults, and serialization
|
|
144
146
|
- Accessible Web Components for form inputs, submit actions, and result rendering
|
|
145
147
|
- Headless `createFormView()` API for custom layouts and app-owned rendering
|
|
146
|
-
- Official `
|
|
148
|
+
- Official `mountForm()` helper for step-based flows
|
|
147
149
|
- Built-in JSON transport plus composable transport middleware
|
|
148
150
|
- Headless engine APIs for custom orchestration and registries
|
|
149
151
|
- Runtime design system with themes, recipes, density, motion, and token overrides
|
|
150
|
-
- Extension points for custom field
|
|
152
|
+
- Extension points for custom field and report kinds
|
|
151
153
|
|
|
152
154
|
Built-in fields:
|
|
153
155
|
|
|
@@ -182,11 +184,10 @@ Built-in recipes:
|
|
|
182
184
|
|
|
183
185
|
| Surface | Use it for |
|
|
184
186
|
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
185
|
-
| `mlform`
|
|
186
|
-
| `mlform/kit` | Explicit kit entrypoint with `mountForm`, `mountWizardForm`, `createFormView`, transport, labels, and lifecycle utilities. |
|
|
187
|
+
| `mlform/kit` | Explicit kit entrypoint with `mountForm`, `createFormView`, labels, layout, and lifecycle utilities. |
|
|
187
188
|
| `mlform/runtime` | Headless state, validation, registries, hooks, conditions, and submission orchestration. |
|
|
188
189
|
| `mlform/primitives` | Web Component renderers and custom renderer registries. |
|
|
189
|
-
| `mlform/design
|
|
190
|
+
| `mlform/design` | Themes, recipes, tokens, mode resolution, and host integration. |
|
|
190
191
|
| `mlform/transport` | Transport composition, middleware, resilience policies, and orchestration helpers. |
|
|
191
192
|
|
|
192
193
|
## Custom Domain Kinds
|
|
@@ -194,15 +195,15 @@ Built-in recipes:
|
|
|
194
195
|
When built-in kinds are not enough, define your own field and report kinds without rewriting the normal rendering path.
|
|
195
196
|
|
|
196
197
|
```ts
|
|
197
|
-
import { createMlRegistryPack } from "mlform/builtins
|
|
198
|
-
import { defineFieldKind, registerDefinedFieldKind } from "mlform/
|
|
198
|
+
import { createMlRegistryPack } from "mlform/builtins";
|
|
199
|
+
import { defineFieldKind, registerDefinedFieldKind } from "mlform/kit";
|
|
199
200
|
import { z } from "zod";
|
|
200
201
|
|
|
201
202
|
const pack = createMlRegistryPack();
|
|
202
203
|
|
|
203
204
|
registerDefinedFieldKind(
|
|
204
205
|
pack.registry,
|
|
205
|
-
pack.
|
|
206
|
+
pack.descriptorRegistry,
|
|
206
207
|
defineFieldKind({
|
|
207
208
|
kind: "score",
|
|
208
209
|
schema: z.object({
|
|
@@ -246,7 +247,8 @@ Stay at the declarative `define*Kind` layer unless you truly need fully custom r
|
|
|
246
247
|
Use `createFormView()` when you want MLForm to own state and validation, but your app to own layout:
|
|
247
248
|
|
|
248
249
|
```ts
|
|
249
|
-
import { createFormView
|
|
250
|
+
import { createFormView } from "mlform/kit";
|
|
251
|
+
import { createJsonTransport } from "mlform/transport";
|
|
250
252
|
|
|
251
253
|
const view = createFormView({
|
|
252
254
|
transport: createJsonTransport({ endpoint: "/api/predict" }),
|
|
@@ -261,7 +263,7 @@ const view = createFormView({
|
|
|
261
263
|
});
|
|
262
264
|
```
|
|
263
265
|
|
|
264
|
-
If you want a built-in step UI, use `
|
|
266
|
+
If you want a built-in step UI, use `mountForm()` with the same layout config.
|
|
265
267
|
|
|
266
268
|
## Documentation
|
|
267
269
|
|
|
@@ -272,7 +274,7 @@ If you want a built-in step UI, use `mountWizardForm()` with the same layout con
|
|
|
272
274
|
- Transport guide: https://ulloasp.github.io/mlform/kit/transport/
|
|
273
275
|
- Headless kit: https://ulloasp.github.io/mlform/kit/headless-kit/
|
|
274
276
|
- Wizard layout: https://ulloasp.github.io/mlform/kit/wizard-layout/
|
|
275
|
-
- Design system: https://ulloasp.github.io/mlform/design
|
|
277
|
+
- Design system: https://ulloasp.github.io/mlform/design/overview/
|
|
276
278
|
- API reference: https://ulloasp.github.io/mlform/reference/kit/
|
|
277
279
|
- Migration guide: https://ulloasp.github.io/mlform/migration/from-legacy-mlform/
|
|
278
280
|
- Versioning notes: https://ulloasp.github.io/mlform/support/versioning/
|
|
@@ -304,7 +306,7 @@ The main package targets Node.js `>=24.9.0`.
|
|
|
304
306
|
|
|
305
307
|
## Release Notes
|
|
306
308
|
|
|
307
|
-
For `0.1.
|
|
309
|
+
For `0.1.11`, use the repository release entry and the published docs as the source of truth:
|
|
308
310
|
|
|
309
311
|
- GitHub releases: https://github.com/UlloaSP/mlform/releases
|
|
310
312
|
- npm package: https://www.npmjs.com/package/mlform
|