mlform 0.1.8 → 0.1.10
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 +21 -17
- package/dist/builtins-D8rXH4ED.js +725 -0
- package/dist/{design-system-Dxx1Sh7r.js → design-6suKVQDo.js} +577 -396
- package/dist/mlform/builtins.mjs +2 -0
- package/dist/mlform/design.mjs +2 -0
- package/dist/mlform/kit.mjs +1896 -3
- package/dist/mlform/primitives.mjs +2 -2
- package/dist/mlform/runtime.mjs +3 -5
- package/dist/mlform/schema.mjs +2 -102
- package/dist/mlform/transport.mjs +2 -2
- package/dist/{primitives-Duag8Lj0.js → primitives-k9HTnd72.js} +2304 -3348
- package/dist/runtime-CI7vlp9i.js +1703 -0
- package/dist/schema-DSAZ6bts.js +88 -0
- package/dist/{transport-CtVX8ZUT.js → transport-CO6udZ6z.js} +633 -605
- package/dist/types/builtins/definitions/collections.d.ts +70 -0
- package/dist/types/builtins/definitions/fields/boolean.d.ts +9 -0
- package/dist/types/builtins/definitions/fields/category.d.ts +12 -0
- package/dist/types/builtins/definitions/fields/date.d.ts +10 -0
- package/dist/types/builtins/definitions/fields/long-text.d.ts +11 -0
- package/dist/types/{src/runtime/builtins → builtins/definitions}/fields/mapped-category.d.ts +3 -2
- package/dist/types/{src/runtime/builtins → builtins/definitions}/fields/multi-choice.d.ts +3 -2
- package/dist/types/builtins/definitions/fields/number.d.ts +12 -0
- package/dist/types/builtins/definitions/fields/rating.d.ts +10 -0
- package/dist/types/builtins/definitions/fields/series-helpers.d.ts +52 -0
- package/dist/types/builtins/definitions/fields/series.d.ts +3 -0
- package/dist/types/{src/runtime/builtins → builtins/definitions}/fields/single-choice.d.ts +3 -2
- package/dist/types/builtins/definitions/fields/text.d.ts +11 -0
- package/dist/types/{src/shared/object.d.ts → builtins/definitions/fields/value-helpers.d.ts} +1 -0
- package/dist/types/builtins/definitions/index.d.ts +14 -0
- package/dist/types/builtins/definitions/reports/classifier.d.ts +9 -0
- package/dist/types/builtins/definitions/reports/regressor.d.ts +9 -0
- package/dist/types/{src/runtime/builtins → builtins/definitions}/shared.d.ts +16 -1
- package/dist/types/builtins/index.d.ts +5 -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/recipes/collections.d.ts +2 -0
- package/dist/types/design/recipes/index.d.ts +2 -0
- package/dist/types/{src/design-system → design}/registry/builtins.d.ts +0 -3
- package/dist/types/{src/design-system → design}/registry/index.d.ts +3 -1
- package/dist/types/design/resolve/index.d.ts +4 -0
- package/dist/types/{src/design-system/resolve/index.d.ts → design/resolve/resolve-design.d.ts} +0 -3
- package/dist/types/design/runtime/controller-helpers.d.ts +12 -0
- package/dist/types/{src/design-system → design}/runtime/index.d.ts +3 -3
- package/dist/types/design/themes/airbnb.d.ts +2 -0
- package/dist/types/design/themes/clickhouse.d.ts +2 -0
- package/dist/types/design/themes/collections.d.ts +2 -0
- package/dist/types/design/themes/index.d.ts +3 -0
- package/dist/types/{src/design-system → design}/types.d.ts +1 -1
- package/dist/types/{src/kit → kit}/constants.d.ts +3 -11
- package/dist/types/{src/kit → kit}/defaults.d.ts +4 -4
- package/dist/types/kit/disclosure-root-styles.d.ts +1 -0
- package/dist/types/kit/error-navigation.d.ts +3 -0
- package/dist/types/kit/index.d.ts +7 -0
- package/dist/types/{src/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/{src/kit → kit}/layout-helpers.d.ts +7 -11
- package/dist/types/kit/layout-node-render.d.ts +18 -0
- package/dist/types/{src/kit → kit}/layout-node-resolver.d.ts +1 -1
- package/dist/types/{src/kit/accordion-root.d.ts → kit/layout-root.d.ts} +3 -4
- package/dist/types/{src/kit → kit}/layout-types.d.ts +8 -36
- package/dist/types/{src/kit → kit}/layout-utils.d.ts +0 -1
- package/dist/types/{src/kit → kit}/layout.d.ts +2 -2
- package/dist/types/{src/kit → kit}/mount-types.d.ts +8 -7
- package/dist/types/{src/kit → kit}/panel-nav.d.ts +1 -1
- package/dist/types/{src/kit → kit}/tabs-root.d.ts +1 -2
- package/dist/types/kit/types.d.ts +4 -0
- package/dist/types/kit/view-core-types.d.ts +110 -0
- package/dist/types/{src/kit → kit}/view-layout-state.d.ts +10 -3
- package/dist/types/{src/kit → kit}/view-navigation.d.ts +4 -4
- package/dist/types/kit/view-snapshot-cache.d.ts +14 -0
- package/dist/types/kit/view-snapshot.d.ts +15 -0
- package/dist/types/kit/view-types.d.ts +1 -0
- package/dist/types/kit/view.d.ts +2 -0
- package/dist/types/{src/kit → kit}/wizard-root.d.ts +1 -2
- package/dist/types/{src/primitives → primitives}/base-async-report-element.d.ts +1 -1
- package/dist/types/{src/primitives → primitives}/base-field-element.d.ts +3 -3
- package/dist/types/{src/primitives → 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 +5 -0
- package/dist/types/{src/primitives → primitives}/components/field-frame-feedback.d.ts +3 -3
- package/dist/types/{src/primitives → primitives}/components/field-frame.d.ts +3 -3
- package/dist/types/{src/primitives → primitives}/components/form-errors.d.ts +2 -2
- package/dist/types/primitives/components/form-root-presenters.d.ts +12 -0
- package/dist/types/primitives/components/form-root-split-styles.d.ts +1 -0
- package/dist/types/{src/primitives → primitives}/components/form-root-state.d.ts +4 -6
- package/dist/types/{src/primitives → primitives}/components/form-root-templates.d.ts +4 -8
- package/dist/types/{src/primitives → primitives}/components/form-root.d.ts +4 -4
- package/dist/types/{src/primitives → primitives}/components/report-frame.d.ts +4 -4
- package/dist/types/{src/primitives → primitives}/components/submit-button.d.ts +2 -2
- package/dist/types/{src/primitives → 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/fields/series-field-renderers.d.ts +18 -0
- package/dist/types/primitives/index.d.ts +13 -0
- package/dist/types/primitives/mount-form.d.ts +4 -0
- package/dist/types/primitives/request-runner.d.ts +13 -0
- package/dist/types/{src/primitives → primitives}/types.d.ts +16 -53
- package/dist/types/runtime/create-runtime-helpers.d.ts +11 -0
- package/dist/types/{src/runtime → runtime}/errors.d.ts +3 -4
- package/dist/types/runtime/index.d.ts +10 -0
- package/dist/types/{src/runtime → runtime}/reports/controller.d.ts +3 -2
- package/dist/types/{src/runtime → runtime}/runtime-behaviors.d.ts +1 -1
- package/dist/types/{src/runtime → runtime}/runtime-controller.d.ts +1 -5
- package/dist/types/{src/runtime → runtime}/state/engine.d.ts +1 -2
- package/dist/types/runtime/submission/create-submitter.d.ts +2 -0
- package/dist/types/{src/runtime → runtime}/submission/index.d.ts +1 -1
- package/dist/types/{src/runtime → runtime}/submission/lifecycle.d.ts +1 -2
- package/dist/types/runtime/submission/pending-patches.d.ts +2 -0
- package/dist/types/{src/runtime → runtime}/submission/pipeline.d.ts +1 -1
- package/dist/types/runtime/submission/report-fetches.d.ts +2 -0
- package/dist/types/runtime/submission/stream-events.d.ts +13 -0
- package/dist/types/{src/runtime → runtime}/submission/types.d.ts +1 -2
- package/dist/types/{src/runtime → runtime}/types/behavior.d.ts +1 -1
- package/dist/types/{src/runtime → runtime}/types/field.d.ts +3 -10
- package/dist/types/{src/runtime → runtime}/types/form.d.ts +9 -13
- package/dist/types/runtime/types/index.d.ts +7 -0
- package/dist/types/{src/runtime → runtime}/types/pipeline.d.ts +10 -10
- package/dist/types/runtime/types/registry.d.ts +5 -0
- package/dist/types/runtime/types/report.d.ts +16 -0
- package/dist/types/{src/runtime → runtime}/types/transport.d.ts +4 -5
- package/dist/types/{src/runtime → runtime}/utils.d.ts +1 -3
- package/dist/types/{src/runtime → runtime}/validation/form.d.ts +1 -1
- package/dist/types/schema/ids.d.ts +1 -0
- package/dist/types/{src/schema → schema}/index.d.ts +3 -1
- package/dist/types/schema/registry.d.ts +7 -0
- package/dist/types/schema/report-fetch-request.d.ts +6 -0
- package/dist/types/{src/schema → schema}/types/form.d.ts +0 -3
- package/dist/types/{src/schema → schema}/types/registry.d.ts +0 -5
- package/dist/types/{src/schema → schema}/types/report.d.ts +25 -3
- package/dist/types/schema/types/submit.d.ts +11 -0
- package/dist/types/transport/composition/fanout-options.d.ts +9 -0
- package/dist/types/{src/transport → transport}/errors.d.ts +1 -2
- package/dist/types/{src/transport → transport}/index.d.ts +2 -0
- package/dist/types/transport/request-runner.d.ts +16 -0
- package/package.json +13 -26
- package/dist/builtins-DegwhFGA.js +0 -3507
- package/dist/builtins-ml-9qB2MOxt.js +0 -51
- package/dist/errors-B3H1wRwj.js +0 -8
- package/dist/kit-CuRF6dhL.js +0 -1847
- package/dist/mlform/behaviors.mjs +0 -32
- package/dist/mlform/builtins-ml.mjs +0 -3
- package/dist/mlform/design-system.mjs +0 -2
- package/dist/mlform/presentation.mjs +0 -2
- package/dist/mlform.mjs +0 -8
- package/dist/presentation-CkQuYheR.js +0 -200
- package/dist/runtime-DMjDVo0H.js +0 -1824
- package/dist/strings-CWwrrYzz.js +0 -4
- package/dist/types/src/behaviors/index.d.ts +0 -3
- package/dist/types/src/builtins-ml/index.d.ts +0 -5
- package/dist/types/src/design-system/recipes/index.d.ts +0 -4
- package/dist/types/src/design-system/themes/index.d.ts +0 -5
- package/dist/types/src/index.d.ts +0 -13
- package/dist/types/src/kit/accordion-root-styles.d.ts +0 -1
- package/dist/types/src/kit/accordion.d.ts +0 -2
- package/dist/types/src/kit/index.d.ts +0 -9
- package/dist/types/src/kit/layout-node-render.d.ts +0 -18
- package/dist/types/src/kit/tabs.d.ts +0 -2
- package/dist/types/src/kit/types.d.ts +0 -5
- package/dist/types/src/kit/view-snapshot-cache.d.ts +0 -14
- package/dist/types/src/kit/view-snapshot.d.ts +0 -15
- package/dist/types/src/kit/view-types.d.ts +0 -172
- package/dist/types/src/kit/view.d.ts +0 -8
- package/dist/types/src/kit/wizard.d.ts +0 -2
- package/dist/types/src/packs/default.d.ts +0 -2
- package/dist/types/src/packs/index.d.ts +0 -3
- package/dist/types/src/packs/ml.d.ts +0 -2
- package/dist/types/src/packs/shared.d.ts +0 -25
- package/dist/types/src/presentation/define-explanation-kind.d.ts +0 -11
- package/dist/types/src/presentation/define-report-kind.d.ts +0 -15
- package/dist/types/src/presentation/index.d.ts +0 -10
- package/dist/types/src/presentation/register-kind.d.ts +0 -6
- package/dist/types/src/presentation/registry.d.ts +0 -15
- package/dist/types/src/presentation/types/explanation.d.ts +0 -32
- package/dist/types/src/presentation/types/field.d.ts +0 -36
- package/dist/types/src/presentation/types/presentation.d.ts +0 -61
- package/dist/types/src/presentation/types/report.d.ts +0 -41
- package/dist/types/src/primitives/base-explanation-element.d.ts +0 -22
- package/dist/types/src/primitives/components/declarative-explanation.d.ts +0 -5
- package/dist/types/src/primitives/components/explanation-panel.d.ts +0 -24
- package/dist/types/src/primitives/components/form-root-presenters.d.ts +0 -17
- package/dist/types/src/primitives/components/presentation.d.ts +0 -4
- package/dist/types/src/primitives/index.d.ts +0 -8
- package/dist/types/src/primitives/mount-form.d.ts +0 -4
- package/dist/types/src/primitives/presentation.d.ts +0 -8
- package/dist/types/src/runtime/builtins/fields/boolean.d.ts +0 -8
- package/dist/types/src/runtime/builtins/fields/category.d.ts +0 -11
- package/dist/types/src/runtime/builtins/fields/date.d.ts +0 -9
- package/dist/types/src/runtime/builtins/fields/long-text.d.ts +0 -10
- package/dist/types/src/runtime/builtins/fields/number.d.ts +0 -11
- package/dist/types/src/runtime/builtins/fields/rating.d.ts +0 -9
- package/dist/types/src/runtime/builtins/fields/series.d.ts +0 -20
- package/dist/types/src/runtime/builtins/fields/text.d.ts +0 -10
- package/dist/types/src/runtime/builtins/index.d.ts +0 -103
- package/dist/types/src/runtime/builtins/reports/classifier.d.ts +0 -8
- package/dist/types/src/runtime/builtins/reports/regressor.d.ts +0 -8
- package/dist/types/src/runtime/declarative/explanation.d.ts +0 -2
- package/dist/types/src/runtime/declarative/field.d.ts +0 -2
- package/dist/types/src/runtime/declarative/presentation.d.ts +0 -61
- package/dist/types/src/runtime/declarative/report.d.ts +0 -2
- package/dist/types/src/runtime/explanations/controller.d.ts +0 -13
- package/dist/types/src/runtime/index.d.ts +0 -16
- package/dist/types/src/runtime/registry/index.d.ts +0 -5
- package/dist/types/src/runtime/reports/index.d.ts +0 -1
- package/dist/types/src/runtime/schema/index.d.ts +0 -7
- package/dist/types/src/runtime/submission/create-submitter.d.ts +0 -2
- package/dist/types/src/runtime/submission/explanations.d.ts +0 -2
- package/dist/types/src/runtime/types/explanation.d.ts +0 -22
- package/dist/types/src/runtime/types/index.d.ts +0 -9
- package/dist/types/src/runtime/types/registry.d.ts +0 -6
- package/dist/types/src/runtime/types/report.d.ts +0 -23
- package/dist/types/src/schema/registry.d.ts +0 -9
- package/dist/types/src/schema/types/explanation.d.ts +0 -43
- package/dist/types/src/shared/errors.d.ts +0 -3
- package/dist/types/src/shared/index.d.ts +0 -3
- package/dist/types/src/shared/strings.d.ts +0 -1
- /package/dist/types/{src/runtime → builtins}/constants.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/constants.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/contract/component-keys.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/contract/component-tokens.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/contract/global-tokens.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/contract/index.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/contract/token-keys.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/index.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/recipes/contrast.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/recipes/default.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/recipes/minimal.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/recipes/soft.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/registry/create-registry.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/registry/deep-freeze.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/registry/define-recipe.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/registry/define-theme.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/registry/define-token-maps.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/resolve/diagnostics.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/resolve/merge-config.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/resolve/migrate-tokens.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/resolve/resolve-mode.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/resolve/resolve-recipe.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/resolve/resolve-theme.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/resolve/resolve-tokens.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/runtime/apply-tokens.d.ts +0 -0
- /package/dist/types/{src/design-system/runtime/attach-design-system.d.ts → design/runtime/attach-design.d.ts} +0 -0
- /package/dist/types/{src/design-system → design}/runtime/create-stylesheet.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/runtime/declarations.d.ts +0 -0
- /package/dist/types/{src/design-system/runtime/design-system-controller.d.ts → design/runtime/design-controller.d.ts} +0 -0
- /package/dist/types/{src/design-system → design}/runtime/fingerprint.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/runtime/host-observer.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/runtime/host-state.d.ts +0 -0
- /package/dist/types/{src/design-system/runtime/hydrate-design-system.d.ts → design/runtime/hydrate-design.d.ts} +0 -0
- /package/dist/types/{src/design-system → design}/runtime/hydration-state.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/runtime/inherited-scheme.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/runtime/media.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/themes/cobalt.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/themes/graphite.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/themes/neutral.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/themes/sage.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/themes/sunset.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/tokens/base.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/tokens/contrast.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/tokens/density.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/tokens/forced-colors.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/tokens/index.d.ts +0 -0
- /package/dist/types/{src/design-system → design}/tokens/motion.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/mount-form.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/step-indicator.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/tabs-root-styles.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/wizard-constants.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/wizard-root-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/declarative-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/declarative-report.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/field-frame-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/form-root-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/unsupported-component.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/controller-binding.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/boolean-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/category-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/date-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/long-text-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/multi-choice-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/number-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/rating-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/series-field-helpers.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/series-field-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/series-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/single-choice-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/text-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/register.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/registry.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/reports/classifier-report.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/reports/regressor-report.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/utils.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/comparison.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/create-runtime.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/equality.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/fields/controller.d.ts +0 -0
- /package/dist/types/{src/runtime/explanations → runtime/fields}/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/fields/state-calculations.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/fields/state.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/form.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/paths.d.ts +0 -0
- /package/dist/types/{src/runtime/fields → runtime/reports}/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/runtime-refresh.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/runtime-values.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/state/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/state/snapshots.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/state/store.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/abort.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/error-flow.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/field-updates.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/report-updates.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/reports.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/request.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/result.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/stream-progress.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/submitter.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/conditions.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/field-state.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/field-validator.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/field.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/values.d.ts +0 -0
- /package/dist/types/{src/schema → schema}/normalize.d.ts +0 -0
- /package/dist/types/{src/schema → schema}/types/field.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/capabilities.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/clone.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/fallback.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/fanout-helpers.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/fanout.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/hedged.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/index.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/load-balancing.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/pipeline.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/quorum-fanout.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/racing.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/composition/routing.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/constants.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/internal-core.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/internal-errors.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/internal-request.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/internal-routing.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/internal-sse.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/internal-stream.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/internal.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/auth.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/cache.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/circuit-breaker.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/dedup.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/index.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/logging.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/metrics.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/pipe.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/rate-limit.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/retry.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/timeout.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/tracing.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/middleware/transform.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/policy-context.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/protocols/graphql.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/protocols/grpc.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/protocols/index.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/protocols/json.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/protocols/sse.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/protocols/websocket.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/runtime.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/state/cache-store.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/state/circuit-breaker.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/state/health.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/state/index.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/state/rate-limiter.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/state/session.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/capabilities.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/core.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/events.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/index.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/middleware.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/options-http.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/options-middleware.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/options-routing.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/options.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/session.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/types/state.d.ts +0 -0
|
@@ -3,10 +3,9 @@ import { SubmitResult } from '../types';
|
|
|
3
3
|
type SubmissionTransitionOptions = {
|
|
4
4
|
store: EngineStore;
|
|
5
5
|
resetReports: () => void;
|
|
6
|
-
resetExplanations: () => void;
|
|
7
6
|
syncAfterSubmissionTransition: () => void;
|
|
8
7
|
};
|
|
9
|
-
export declare const createSubmissionLifecycle: ({ store, resetReports,
|
|
8
|
+
export declare const createSubmissionLifecycle: ({ store, resetReports, syncAfterSubmissionTransition, }: SubmissionTransitionOptions) => {
|
|
10
9
|
start(submissionVersion: number): void;
|
|
11
10
|
succeed(result: SubmitResult): void;
|
|
12
11
|
abort(message: string): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ExecuteFormPipelineOptions, PipelineResult } from '../types';
|
|
2
|
-
export declare const executeFormPipeline: <TArtifacts extends Record<string, unknown> = Record<string, never>>({ form, submit, artifactAdapter,
|
|
2
|
+
export declare const executeFormPipeline: <TArtifacts extends Record<string, unknown> = Record<string, never>>({ form, submit, artifactAdapter, reportFetchMode, }: ExecuteFormPipelineOptions<TArtifacts>) => Promise<PipelineResult<TArtifacts>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TransportStreamEvent } from '../types';
|
|
2
|
+
import { SubmissionValueRecords } from './request';
|
|
3
|
+
export type ApplySubmissionStreamEventOptions = {
|
|
4
|
+
event: TransportStreamEvent;
|
|
5
|
+
records: SubmissionValueRecords;
|
|
6
|
+
backend: string | undefined;
|
|
7
|
+
applyValidatedReportReplace: (reportId: string, payload: unknown, records: SubmissionValueRecords, backend: string | undefined) => Promise<void>;
|
|
8
|
+
applyValidatedReportPatch: (reportId: string, patch: unknown, strategy: "replace" | "shallow-merge" | "deep-merge" | undefined, records: SubmissionValueRecords, backend: string | undefined) => Promise<void>;
|
|
9
|
+
applyFieldUpdate: (event: Extract<TransportStreamEvent, {
|
|
10
|
+
type: "field-update";
|
|
11
|
+
}>) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const applySubmissionStreamEvent: ({ event, records, backend, applyValidatedReportReplace, applyValidatedReportPatch, applyFieldUpdate, }: ApplySubmissionStreamEventOptions) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedFormSchema } from '
|
|
1
|
+
import { NormalizedFormSchema } from '../../schema';
|
|
2
2
|
import { InternalFieldState, EngineStore } from '../state';
|
|
3
3
|
import { FormHooks, FormValidationResult, InactiveFieldPolicy, SubmissionProgressState, SubmitOptions, SubmitResult, Transport, TransportStreamEvent } from '../types';
|
|
4
4
|
import { buildSubmissionValueRecords, SubmissionValueRecords } from './request';
|
|
@@ -30,7 +30,6 @@ export type CreateFormSubmitterOptions = {
|
|
|
30
30
|
getSubmitCount: () => number;
|
|
31
31
|
markReportsLoading: () => void;
|
|
32
32
|
resetReports: () => void;
|
|
33
|
-
resetExplanations: () => void;
|
|
34
33
|
syncDerivedFieldState: (options?: SyncDerivedFieldStateOptions) => void;
|
|
35
34
|
shouldResetInactiveFields: () => boolean;
|
|
36
35
|
resolveInactiveFieldPolicy: (field: SubmissionField) => InactiveFieldPolicy;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { FieldDefinition as SchemaFieldDefinition, FieldStateSnapshot, FieldValidationResult, NormalizedFieldConfig } from '
|
|
2
|
-
|
|
3
|
-
export type { AllConditions, AnyConditions, BaseFieldConfig, DeclarativeFieldCondition, FieldComparisonCondition, FieldCondition, FieldConditionContext, FieldConfig, FieldStateSnapshot, FieldStatus, FieldValidationContext, FieldValidationFnContext, FieldValidationResult, FieldValueAdapter, FieldValueCondition, FormStatusCondition, InactiveFieldPolicy, NormalizedFieldConfig, NotCondition, SelectorSubscriptionOptions, SubmitCountCondition, } from '../../../schema';
|
|
1
|
+
import { FieldDefinition as SchemaFieldDefinition, FieldStateSnapshot, FieldValidationResult, NormalizedFieldConfig } from '../../schema';
|
|
2
|
+
export type { AllConditions, AnyConditions, BaseFieldConfig, DeclarativeFieldCondition, FieldComparisonCondition, FieldCondition, FieldConditionContext, FieldConfig, FieldStateSnapshot, FieldStatus, FieldValidationContext, FieldValidationFnContext, FieldValidationResult, FieldValueAdapter, FieldValueCondition, FormStatusCondition, InactiveFieldPolicy, NormalizedFieldConfig, NotCondition, SelectorSubscriptionOptions, SubmitCountCondition, } from '../../schema';
|
|
4
3
|
export interface FieldHandle {
|
|
5
4
|
readonly id: string;
|
|
6
5
|
readonly kind: string;
|
|
@@ -14,11 +13,5 @@ export interface FieldHandle {
|
|
|
14
13
|
subscribe(listener: (state: FieldStateSnapshot) => void): () => void;
|
|
15
14
|
}
|
|
16
15
|
export type FieldController = FieldHandle;
|
|
17
|
-
export type FieldDefinition<TConfig extends import('
|
|
18
|
-
describe?: (config: NormalizedFieldConfig<TConfig>, context: {
|
|
19
|
-
fieldId: string;
|
|
20
|
-
state: FieldStateSnapshot;
|
|
21
|
-
}) => FieldDescriptor;
|
|
22
|
-
[key: string]: unknown;
|
|
23
|
-
};
|
|
16
|
+
export type FieldDefinition<TConfig extends import('../../schema').FieldConfig = import('../../schema').FieldConfig, TValue = unknown> = SchemaFieldDefinition<TConfig, TValue>;
|
|
24
17
|
export type RuntimeFieldDefinition = FieldDefinition;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldConfig, FieldStateSnapshot, FormSchema, InactiveFieldPolicy, NormalizedFieldConfig, NormalizedReportConfig, Registry, ReportConfig, ReportStateSnapshot, SelectorSubscriptionOptions } from '../../schema';
|
|
2
2
|
import { RuntimeBehavior } from './behavior';
|
|
3
3
|
import { AfterSubmitContext, BeforeSubmitContext, SubmitErrorContext, SubmitOptions, SubmitResult, Transport, TransportStreamEvent } from './transport';
|
|
4
|
-
import { ExplanationController, ExplanationStateSnapshot } from './explanation';
|
|
5
4
|
import { FieldController } from './field';
|
|
6
5
|
import { ReportController } from './report';
|
|
7
6
|
type MaybePromise<T> = T | PromiseLike<T>;
|
|
@@ -31,7 +30,6 @@ export interface FormState {
|
|
|
31
30
|
touched: boolean;
|
|
32
31
|
values: Record<string, unknown>;
|
|
33
32
|
reportStates: Record<string, ReportStateSnapshot>;
|
|
34
|
-
explanationStates: Record<string, ExplanationStateSnapshot>;
|
|
35
33
|
submissionProgress: SubmissionProgressState | null;
|
|
36
34
|
errors: {
|
|
37
35
|
form: string[];
|
|
@@ -63,13 +61,13 @@ export interface AfterValidateContext {
|
|
|
63
61
|
result: FormValidationResult;
|
|
64
62
|
submitCount: number;
|
|
65
63
|
}
|
|
66
|
-
export interface
|
|
67
|
-
|
|
64
|
+
export interface AfterReportFetchContext {
|
|
65
|
+
reportId: string;
|
|
68
66
|
kind: string;
|
|
69
|
-
|
|
67
|
+
payload: unknown;
|
|
70
68
|
}
|
|
71
|
-
export interface
|
|
72
|
-
|
|
69
|
+
export interface ReportFetchErrorContext {
|
|
70
|
+
reportId: string;
|
|
73
71
|
kind: string;
|
|
74
72
|
error: unknown;
|
|
75
73
|
}
|
|
@@ -79,8 +77,8 @@ export interface FormHooks {
|
|
|
79
77
|
beforeSubmit?: (context: BeforeSubmitContext) => MaybePromise<void>;
|
|
80
78
|
afterSubmit?: (context: AfterSubmitContext) => MaybePromise<void>;
|
|
81
79
|
onSubmitError?: (context: SubmitErrorContext) => MaybePromise<void>;
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
afterReportFetch?: (context: AfterReportFetchContext) => MaybePromise<void>;
|
|
81
|
+
onReportFetchError?: (context: ReportFetchErrorContext) => MaybePromise<void>;
|
|
84
82
|
}
|
|
85
83
|
export interface CreateFormConfig {
|
|
86
84
|
schema: FormSchema;
|
|
@@ -100,11 +98,9 @@ export interface CreateFormConfig {
|
|
|
100
98
|
export interface FormController {
|
|
101
99
|
readonly fields: readonly FieldController[];
|
|
102
100
|
readonly reports: readonly ReportController[];
|
|
103
|
-
readonly explanations: readonly ExplanationController[];
|
|
104
101
|
readonly state: FormState;
|
|
105
102
|
getField(id: string): FieldController | undefined;
|
|
106
103
|
getReport(id: string): ReportController | undefined;
|
|
107
|
-
getExplanation(id: string): ExplanationController | undefined;
|
|
108
104
|
getValues(): Record<string, unknown>;
|
|
109
105
|
setValues(values: Record<string, unknown>): void;
|
|
110
106
|
validate(): Promise<FormValidationResult>;
|
|
@@ -114,4 +110,4 @@ export interface FormController {
|
|
|
114
110
|
subscribe(listener: (state: FormState) => void): () => void;
|
|
115
111
|
subscribeSelector<TSelected>(selector: (state: FormState) => TSelected, listener: (selected: TSelected, state: FormState) => void, options?: SelectorSubscriptionOptions<TSelected>): () => void;
|
|
116
112
|
}
|
|
117
|
-
export type {
|
|
113
|
+
export type { FieldConfig, FormSchema, Registry, ReportConfig };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ExplanationController, ExplanationFetchRequest } from './explanation';
|
|
2
1
|
import { FormController } from './form';
|
|
2
|
+
import { ReportController, ReportFetchRequest } from './report';
|
|
3
3
|
import { SubmitOptions, SubmitResult } from './transport';
|
|
4
|
-
export interface
|
|
4
|
+
export interface ReportFetchExecutionResult {
|
|
5
5
|
results: Record<string, unknown>;
|
|
6
6
|
errors: Record<string, string>;
|
|
7
7
|
}
|
|
8
8
|
export interface PipelineArtifactContext {
|
|
9
9
|
submitResult: SubmitResult;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
reportFetchResults: Record<string, unknown>;
|
|
11
|
+
reportFetchErrors: Record<string, string>;
|
|
12
12
|
}
|
|
13
13
|
export interface PipelineArtifactAdapter<TArtifacts extends Record<string, unknown> = {}> {
|
|
14
14
|
derive(context: PipelineArtifactContext): TArtifacts | Promise<TArtifacts>;
|
|
@@ -17,15 +17,15 @@ export interface ExecuteFormPipelineOptions<TArtifacts extends Record<string, un
|
|
|
17
17
|
form: FormController;
|
|
18
18
|
submit?: SubmitOptions;
|
|
19
19
|
artifactAdapter?: PipelineArtifactAdapter<TArtifacts>;
|
|
20
|
-
|
|
20
|
+
reportFetchMode?: "none" | "all";
|
|
21
21
|
}
|
|
22
22
|
export interface PipelineResult<TArtifacts extends Record<string, unknown> = {}> {
|
|
23
23
|
submitResult: SubmitResult;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
reportFetchResults: Record<string, unknown>;
|
|
25
|
+
reportFetchErrors: Record<string, string>;
|
|
26
26
|
artifacts: TArtifacts;
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
request:
|
|
28
|
+
export interface ReportFetchExecutionContext {
|
|
29
|
+
reports: readonly ReportController[];
|
|
30
|
+
request: ReportFetchRequest;
|
|
31
31
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldDefinition, Registry as SchemaRegistry, ReportDefinition } from '../../schema';
|
|
2
|
+
export interface Registry extends Omit<SchemaRegistry, "registerField" | "registerReport"> {
|
|
3
|
+
registerField(definition: FieldDefinition): Registry;
|
|
4
|
+
registerReport(definition: ReportDefinition): Registry;
|
|
5
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NormalizedReportConfig as SchemaNormalizedReportConfig, ReportDefinition as SchemaReportDefinition, ReportStateSnapshot } from '../../schema';
|
|
2
|
+
export type { BaseReportConfig, PartialReportUpdatePolicy, ReportConfig, ReportFetchContext, ReportFetchFactory, ReportFetchRequest, ReportFetchStatus, ReportFetchTransport, ReportPayloadContext, ReportPayloadValidationPolicy, ReportResolveContext, ReportStateSnapshot, ReportStatus, } from '../../schema';
|
|
3
|
+
export interface ReportHandle {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly kind: string;
|
|
6
|
+
readonly config: SchemaNormalizedReportConfig;
|
|
7
|
+
readonly state: ReportStateSnapshot;
|
|
8
|
+
readonly canFetch: boolean;
|
|
9
|
+
fetch(request: import('../../schema').ReportFetchRequest): Promise<void>;
|
|
10
|
+
abort(): void;
|
|
11
|
+
subscribe(listener: (state: ReportStateSnapshot) => void): () => void;
|
|
12
|
+
}
|
|
13
|
+
export type ReportController = ReportHandle;
|
|
14
|
+
export type ReportDefinition<TConfig extends import('../../schema').ReportConfig = import('../../schema').ReportConfig> = SchemaReportDefinition<TConfig>;
|
|
15
|
+
export type NormalizedReportConfig<TConfig extends import('../../schema').ReportConfig = import('../../schema').ReportConfig> = SchemaNormalizedReportConfig<TConfig>;
|
|
16
|
+
export type RuntimeReportDefinition = ReportDefinition;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { SubmitRequest as BaseSubmitRequest,
|
|
1
|
+
import { SubmitRequest as BaseSubmitRequest, Transport as BaseTransport, TransportStreamEvent as BaseTransportStreamEvent } from '../../transport';
|
|
2
|
+
import { SubmitResult as SchemaSubmitResult } from '../../schema';
|
|
2
3
|
import { NormalizedFieldConfig } from './field';
|
|
3
4
|
import { NormalizedReportConfig, ReportStateSnapshot } from './report';
|
|
4
|
-
export type { CapabilityRequirement, CircuitBreakerSharedState, CircuitBreakerStateSnapshot, RateLimitLeaseRequest, SharedRateLimiter, SharedRateLimiterLease, SubmitRequestMetadata, SubmitRequestTransportContext, TransportAuthKind, TransportBackpressureMode, TransportCacheEntry, TransportCacheStore, TransportCapabilities, TransportCollection, TransportConsistency, TransportDeliveryMode, TransportHealthSnapshot, TransportHealthState, TransportPolicyContext, TransportResponse, TransportSession, TransportSessionCloseEvent, TransportSessionErrorEvent, TransportSessionEvent, TransportSessionMessage, TransportSessionMessageEvent, TransportSessionMetaEvent, TransportSessionProgressEvent, TransportSessionResultEvent, TransportStreamChunkEvent, TransportStreamErrorEvent, TransportStreamMetaEvent, TransportStreamProgressEvent, TransportStreamReportPatchEvent, TransportStreamReportReplaceEvent, } from '
|
|
5
|
+
export type { CapabilityRequirement, CircuitBreakerSharedState, CircuitBreakerStateSnapshot, RateLimitLeaseRequest, SharedRateLimiter, SharedRateLimiterLease, SubmitRequestMetadata, SubmitRequestTransportContext, TransportAuthKind, TransportBackpressureMode, TransportCacheEntry, TransportCacheStore, TransportCapabilities, TransportCollection, TransportConsistency, TransportDeliveryMode, TransportHealthSnapshot, TransportHealthState, TransportPolicyContext, TransportResponse, TransportSession, TransportSessionCloseEvent, TransportSessionErrorEvent, TransportSessionEvent, TransportSessionMessage, TransportSessionMessageEvent, TransportSessionMetaEvent, TransportSessionProgressEvent, TransportSessionResultEvent, TransportStreamChunkEvent, TransportStreamErrorEvent, TransportStreamMetaEvent, TransportStreamProgressEvent, TransportStreamReportPatchEvent, TransportStreamReportReplaceEvent, } from '../../transport';
|
|
5
6
|
export type SubmitRequest = BaseSubmitRequest<NormalizedFieldConfig, NormalizedReportConfig>;
|
|
6
|
-
export type SubmitResult =
|
|
7
|
-
reportStates: Record<string, ReportStateSnapshot>;
|
|
8
|
-
};
|
|
7
|
+
export type SubmitResult = SchemaSubmitResult<ReportStateSnapshot>;
|
|
9
8
|
export type Transport = BaseTransport<NormalizedFieldConfig, NormalizedReportConfig>;
|
|
10
9
|
export type TransportStreamEvent = BaseTransportStreamEvent;
|
|
11
10
|
export interface SubmitOptions {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { MaybePromise } from './types';
|
|
2
|
-
|
|
3
|
-
export { isRecord, slugify };
|
|
2
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
4
3
|
export declare const isPromiseLike: <T>(value: MaybePromise<T>) => value is PromiseLike<T>;
|
|
5
4
|
export declare const isEmptyValue: (value: unknown) => boolean;
|
|
6
|
-
export declare const toDate: (value: unknown) => Date | null;
|
|
7
5
|
export declare const identity: <T>(value: T) => T;
|
|
8
6
|
export declare const deepFreeze: <T>(value: T) => T;
|
|
9
7
|
export declare const delay: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedFormSchema } from '
|
|
1
|
+
import { NormalizedFormSchema } from '../../schema';
|
|
2
2
|
import { EngineStore } from '../state';
|
|
3
3
|
import { FieldValidationResult, FormHooks, FormStatus, FormValidationIssue, FormValidationResult, FormValidator, InactiveFieldPolicy } from '../types';
|
|
4
4
|
type FormValidationField = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizeSchemaId: (value: string) => string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export { normalizeSchemaId } from './ids';
|
|
1
2
|
export * from './normalize';
|
|
3
|
+
export { createReportFetchRequest } from './report-fetch-request';
|
|
2
4
|
export * from './registry';
|
|
3
|
-
export type * from './types/explanation';
|
|
4
5
|
export type * from './types/field';
|
|
5
6
|
export type * from './types/form';
|
|
6
7
|
export type * from './types/registry';
|
|
7
8
|
export type * from './types/report';
|
|
9
|
+
export type * from './types/submit';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FieldConfig, FieldDefinition, Registry, ReportConfig, ReportDefinition } from './index';
|
|
2
|
+
export declare class RegistryError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare const createRegistry: () => Registry;
|
|
6
|
+
export declare const defineFieldDefinition: <TDefinition extends FieldDefinition<FieldConfig, unknown>>(definition: TDefinition) => TDefinition;
|
|
7
|
+
export declare const defineReportDefinition: <TDefinition extends ReportDefinition<ReportConfig>>(definition: TDefinition) => TDefinition;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { ExplanationConfig, NormalizedExplanationConfig } from './explanation';
|
|
2
1
|
import { FieldConfig, NormalizedFieldConfig } from './field';
|
|
3
2
|
import { NormalizedReportConfig, ReportConfig } from './report';
|
|
4
3
|
export interface FormSchema {
|
|
5
4
|
fields: FieldConfig[];
|
|
6
5
|
reports?: ReportConfig[];
|
|
7
|
-
explanations?: ExplanationConfig[];
|
|
8
6
|
}
|
|
9
7
|
export interface NormalizedFormSchema {
|
|
10
8
|
fields: NormalizedFieldConfig[];
|
|
11
9
|
reports: NormalizedReportConfig[];
|
|
12
|
-
explanations: NormalizedExplanationConfig[];
|
|
13
10
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ExplanationConfig, ExplanationDefinition } from './explanation';
|
|
2
1
|
import { FieldConfig, FieldDefinition } from './field';
|
|
3
2
|
import { ReportConfig, ReportDefinition } from './report';
|
|
4
3
|
export interface Registry {
|
|
@@ -10,8 +9,4 @@ export interface Registry {
|
|
|
10
9
|
unregisterReport(kind: string): Registry;
|
|
11
10
|
getReport<TConfig extends ReportConfig = ReportConfig>(kind: string): ReportDefinition<TConfig> | undefined;
|
|
12
11
|
listReports(): ReportDefinition<ReportConfig>[];
|
|
13
|
-
registerExplanation<TConfig extends ExplanationConfig>(definition: ExplanationDefinition<TConfig>): Registry;
|
|
14
|
-
unregisterExplanation(kind: string): Registry;
|
|
15
|
-
getExplanation<TConfig extends ExplanationConfig = ExplanationConfig>(kind: string): ExplanationDefinition<TConfig> | undefined;
|
|
16
|
-
listExplanations(): ExplanationDefinition<ExplanationConfig>[];
|
|
17
12
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ZodType } from 'zod';
|
|
2
2
|
import { MaybePromise } from './field';
|
|
3
|
-
import { SubmitResult } from '
|
|
3
|
+
import { SubmitResult } from './submit';
|
|
4
4
|
export type ReportStatus = "idle" | "loading" | "ready" | "error";
|
|
5
|
+
export type ReportFetchStatus = ReportStatus;
|
|
5
6
|
export type ReportPayloadValidationPolicy = "report-error" | "fail-submit";
|
|
6
7
|
export type PartialReportUpdatePolicy = "trust" | "validate" | "defer";
|
|
7
8
|
export interface BaseReportConfig {
|
|
@@ -25,13 +26,33 @@ export interface ReportStateSnapshot {
|
|
|
25
26
|
}
|
|
26
27
|
export interface ReportPayloadContext<TConfig extends ReportConfig = ReportConfig> {
|
|
27
28
|
report: NormalizedReportConfig<TConfig>;
|
|
28
|
-
result: SubmitResult
|
|
29
|
+
result: SubmitResult<ReportStateSnapshot>;
|
|
29
30
|
}
|
|
30
31
|
export interface ReportResolveContext<TConfig extends ReportConfig = ReportConfig> {
|
|
31
32
|
config: NormalizedReportConfig<TConfig>;
|
|
32
33
|
report: NormalizedReportConfig<TConfig>;
|
|
33
|
-
result: SubmitResult
|
|
34
|
+
result: SubmitResult<ReportStateSnapshot>;
|
|
34
35
|
}
|
|
36
|
+
export interface ReportFetchRequest {
|
|
37
|
+
reportId: string;
|
|
38
|
+
backend?: string;
|
|
39
|
+
values: Record<string, unknown>;
|
|
40
|
+
fieldValues: Record<string, unknown>;
|
|
41
|
+
serializedValues: Record<string, unknown>;
|
|
42
|
+
serializedFieldValues: Record<string, unknown>;
|
|
43
|
+
reports: Record<string, unknown>;
|
|
44
|
+
meta: Record<string, unknown>;
|
|
45
|
+
raw: unknown;
|
|
46
|
+
signal?: AbortSignal;
|
|
47
|
+
}
|
|
48
|
+
export interface ReportFetchTransport {
|
|
49
|
+
submit: (request: ReportFetchRequest) => Promise<unknown>;
|
|
50
|
+
}
|
|
51
|
+
export interface ReportFetchContext<TConfig extends ReportConfig = ReportConfig> {
|
|
52
|
+
config: NormalizedReportConfig<TConfig>;
|
|
53
|
+
reportId: string;
|
|
54
|
+
}
|
|
55
|
+
export type ReportFetchFactory<TConfig extends ReportConfig = ReportConfig> = (context: ReportFetchContext<TConfig>) => ReportFetchTransport;
|
|
35
56
|
export interface ReportDefinition<TConfig extends ReportConfig = ReportConfig> {
|
|
36
57
|
kind: string;
|
|
37
58
|
schema: ZodType<TConfig>;
|
|
@@ -39,5 +60,6 @@ export interface ReportDefinition<TConfig extends ReportConfig = ReportConfig> {
|
|
|
39
60
|
payloadValidationPolicy?: ReportPayloadValidationPolicy;
|
|
40
61
|
partialUpdatePolicy?: PartialReportUpdatePolicy;
|
|
41
62
|
clonePayload?: (payload: unknown, config: TConfig) => unknown;
|
|
63
|
+
fetch?: ReportFetchFactory<TConfig>;
|
|
42
64
|
resolvePayload?: (config: TConfig, context: ReportPayloadContext<TConfig>) => MaybePromise<unknown>;
|
|
43
65
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SubmitResult<TReportState = unknown> {
|
|
2
|
+
backend?: string;
|
|
3
|
+
values: Record<string, unknown>;
|
|
4
|
+
fieldValues: Record<string, unknown>;
|
|
5
|
+
serializedValues: Record<string, unknown>;
|
|
6
|
+
serializedFieldValues: Record<string, unknown>;
|
|
7
|
+
reports: Record<string, unknown>;
|
|
8
|
+
reportStates: Record<string, TReportState>;
|
|
9
|
+
meta: Record<string, unknown>;
|
|
10
|
+
raw: unknown;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FanoutTransportOptions, SubmitRequest, TransportCapabilities } from '../types';
|
|
2
|
+
export type FanoutTransportEntry<TTransportId extends string> = {
|
|
3
|
+
id: TTransportId | undefined;
|
|
4
|
+
index: number;
|
|
5
|
+
transport: import('../types').Transport;
|
|
6
|
+
};
|
|
7
|
+
export declare const resolveActiveFanoutEntries: <TTransportId extends string>(entries: readonly FanoutTransportEntry<TTransportId>[], options: FanoutTransportOptions<TTransportId>, request: SubmitRequest) => Promise<readonly FanoutTransportEntry<TTransportId>[]>;
|
|
8
|
+
export declare const collectFanoutCapabilities: (entries: readonly FanoutTransportEntry<string>[]) => TransportCapabilities | undefined;
|
|
9
|
+
export declare const createFanoutAbortOthers: (controllers: readonly AbortController[]) => (reason: string, skipIndex: number) => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MLFormError } from '../../shared';
|
|
2
1
|
export declare const transportErrorCodes: {
|
|
3
2
|
readonly TIMEOUT: "TIMEOUT";
|
|
4
3
|
readonly AUTH_FAILED: "AUTH_FAILED";
|
|
@@ -16,7 +15,7 @@ export declare const transportErrorCodes: {
|
|
|
16
15
|
readonly QUORUM_NOT_REACHED: "QUORUM_NOT_REACHED";
|
|
17
16
|
};
|
|
18
17
|
export type TransportErrorCode = (typeof transportErrorCodes)[keyof typeof transportErrorCodes] | (string & {});
|
|
19
|
-
export declare class TransportError extends
|
|
18
|
+
export declare class TransportError extends Error {
|
|
20
19
|
readonly cause: unknown;
|
|
21
20
|
readonly source?: string;
|
|
22
21
|
readonly status?: number;
|
|
@@ -3,6 +3,8 @@ export { TransportError, transportErrorCodes, type TransportErrorCode } from './
|
|
|
3
3
|
export { transportDefaults, transportErrorMessages } from './constants';
|
|
4
4
|
export { assertPayloadWithinLimits, assertTransportCapabilities, cloneCapabilities, inferTransportCapabilities, mergeTransportCapabilities, normalizeTransportCapabilities, } from './capabilities';
|
|
5
5
|
export { getTransportPolicyContext, withTransportPolicyContext } from './policy-context';
|
|
6
|
+
export { createTransportRequestRunner, extractErrorMessage } from './request-runner';
|
|
7
|
+
export type { TransportRequestOutcome, TransportRequestRunner } from './request-runner';
|
|
6
8
|
export * from './protocols';
|
|
7
9
|
export * from './middleware';
|
|
8
10
|
export * from './composition';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TransportRequestOutcome<TResult> = {
|
|
2
|
+
status: "completed";
|
|
3
|
+
value: TResult;
|
|
4
|
+
} | {
|
|
5
|
+
status: "aborted";
|
|
6
|
+
} | {
|
|
7
|
+
status: "failed";
|
|
8
|
+
error: unknown;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
export type TransportRequestRunner = {
|
|
12
|
+
run<TResult>(submit: (signal: AbortSignal | undefined) => Promise<TResult>, signals?: readonly (AbortSignal | undefined)[]): Promise<TransportRequestOutcome<TResult>>;
|
|
13
|
+
abort(reason?: unknown): void;
|
|
14
|
+
};
|
|
15
|
+
export declare const extractErrorMessage: (error: unknown) => string;
|
|
16
|
+
export declare const createTransportRequestRunner: () => TransportRequestRunner;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mlform",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Composable form generation utilities for machine learning backend integration",
|
|
6
6
|
"keywords": [
|
|
@@ -50,12 +50,7 @@
|
|
|
50
50
|
"dist/**"
|
|
51
51
|
],
|
|
52
52
|
"type": "module",
|
|
53
|
-
"types": "dist/types/src/index.d.ts",
|
|
54
53
|
"exports": {
|
|
55
|
-
".": {
|
|
56
|
-
"types": "./dist/types/src/index.d.ts",
|
|
57
|
-
"import": "./dist/mlform.mjs"
|
|
58
|
-
},
|
|
59
54
|
"./kit": {
|
|
60
55
|
"types": "./dist/types/src/kit/index.d.ts",
|
|
61
56
|
"import": "./dist/mlform/kit.mjs"
|
|
@@ -68,17 +63,9 @@
|
|
|
68
63
|
"types": "./dist/types/src/schema/index.d.ts",
|
|
69
64
|
"import": "./dist/mlform/schema.mjs"
|
|
70
65
|
},
|
|
71
|
-
"./
|
|
72
|
-
"types": "./dist/types/src/
|
|
73
|
-
"import": "./dist/mlform/
|
|
74
|
-
},
|
|
75
|
-
"./builtins-ml": {
|
|
76
|
-
"types": "./dist/types/src/builtins-ml/index.d.ts",
|
|
77
|
-
"import": "./dist/mlform/builtins-ml.mjs"
|
|
78
|
-
},
|
|
79
|
-
"./behaviors": {
|
|
80
|
-
"types": "./dist/types/src/behaviors/index.d.ts",
|
|
81
|
-
"import": "./dist/mlform/behaviors.mjs"
|
|
66
|
+
"./builtins": {
|
|
67
|
+
"types": "./dist/types/src/builtins/index.d.ts",
|
|
68
|
+
"import": "./dist/mlform/builtins.mjs"
|
|
82
69
|
},
|
|
83
70
|
"./transport": {
|
|
84
71
|
"types": "./dist/types/src/transport/index.d.ts",
|
|
@@ -88,9 +75,9 @@
|
|
|
88
75
|
"types": "./dist/types/src/primitives/index.d.ts",
|
|
89
76
|
"import": "./dist/mlform/primitives.mjs"
|
|
90
77
|
},
|
|
91
|
-
"./design
|
|
92
|
-
"types": "./dist/types/src/design
|
|
93
|
-
"import": "./dist/mlform/design
|
|
78
|
+
"./design": {
|
|
79
|
+
"types": "./dist/types/src/design/index.d.ts",
|
|
80
|
+
"import": "./dist/mlform/design.mjs"
|
|
94
81
|
}
|
|
95
82
|
},
|
|
96
83
|
"publishConfig": {
|
|
@@ -98,15 +85,15 @@
|
|
|
98
85
|
"registry": "https://registry.npmjs.org/"
|
|
99
86
|
},
|
|
100
87
|
"dependencies": {
|
|
101
|
-
"lit": "3.3.
|
|
102
|
-
"zod": "4.3
|
|
88
|
+
"lit": "3.3.3",
|
|
89
|
+
"zod": "4.4.3"
|
|
103
90
|
},
|
|
104
91
|
"devDependencies": {
|
|
105
|
-
"@types/node": "^25.
|
|
106
|
-
"jsdom": "^29.
|
|
107
|
-
"typescript": "~6.0.
|
|
92
|
+
"@types/node": "^25.9.1",
|
|
93
|
+
"jsdom": "^29.1.1",
|
|
94
|
+
"typescript": "~6.0.3",
|
|
108
95
|
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
109
|
-
"vite-plugin-dts": "^
|
|
96
|
+
"vite-plugin-dts": "^5.0.1",
|
|
110
97
|
"vite-plus": "latest",
|
|
111
98
|
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
|
|
112
99
|
},
|