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
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
import { i as e, s as t } from "./schema-DSAZ6bts.js";
|
|
2
|
+
import { s as n } from "./primitives-k9HTnd72.js";
|
|
3
|
+
import * as r from "zod";
|
|
4
|
+
//#region src/builtins/constants.ts
|
|
5
|
+
var i = {
|
|
6
|
+
classifier: "classifier",
|
|
7
|
+
regressor: "regressor"
|
|
8
|
+
}, a = {
|
|
9
|
+
classifier: i.classifier,
|
|
10
|
+
regressor: i.regressor
|
|
11
|
+
}, o = {
|
|
12
|
+
text: "text",
|
|
13
|
+
number: "number",
|
|
14
|
+
boolean: "boolean",
|
|
15
|
+
category: "category",
|
|
16
|
+
date: "date",
|
|
17
|
+
series: "series",
|
|
18
|
+
longText: "long-text",
|
|
19
|
+
singleChoice: "single-choice",
|
|
20
|
+
multiChoice: "multi-choice",
|
|
21
|
+
rating: "rating"
|
|
22
|
+
}, s = {
|
|
23
|
+
classifier: "Classifier report",
|
|
24
|
+
regressor: "Regressor report"
|
|
25
|
+
}, c = {
|
|
26
|
+
unknownPrediction: "Unknown",
|
|
27
|
+
classifierClassLabel: (e) => `Class ${e + 1}`
|
|
28
|
+
}, l = {
|
|
29
|
+
invalidNumber: "Value must be a valid number.",
|
|
30
|
+
textPatternMismatch: "Value does not match the expected pattern.",
|
|
31
|
+
booleanRequired: "This field must be accepted.",
|
|
32
|
+
categoryOptionMismatch: "Value must match one of the available options.",
|
|
33
|
+
invalidTextLengthRange: "Minimum length cannot exceed maximum length.",
|
|
34
|
+
invalidNumericRange: "Minimum value cannot exceed maximum value.",
|
|
35
|
+
invalidDateRange: "Minimum date cannot be after maximum date.",
|
|
36
|
+
invalidPointCountRange: "Minimum number of points cannot exceed maximum number of points.",
|
|
37
|
+
minLength: (e) => `Minimum length is ${e} characters.`,
|
|
38
|
+
maxLength: (e) => `Maximum length is ${e} characters.`,
|
|
39
|
+
minValue: (e) => `Minimum value is ${e}.`,
|
|
40
|
+
maxValue: (e) => `Maximum value is ${e}.`,
|
|
41
|
+
stepValue: (e) => `Value must be a multiple of ${e}.`,
|
|
42
|
+
dateOnOrAfter: (e) => `Date must be on or after ${e}.`,
|
|
43
|
+
dateOnOrBefore: (e) => `Date must be on or before ${e}.`,
|
|
44
|
+
stepDate: (e) => `Date must fall on a step of ${e} day(s) from the minimum date.`,
|
|
45
|
+
minPoints: (e) => `Minimum number of points is ${e}.`,
|
|
46
|
+
maxPoints: (e) => `Maximum number of points is ${e}.`,
|
|
47
|
+
timestampsUnique: "Timestamps must be unique.",
|
|
48
|
+
timestampsAscending: "Timestamps must be sorted in ascending order.",
|
|
49
|
+
timestampsDescending: "Timestamps must be sorted in descending order."
|
|
50
|
+
}, u = r.record(r.string(), r.unknown()).optional(), d = r.custom((e) => typeof e == "function"), f = r.enum([
|
|
51
|
+
"idle",
|
|
52
|
+
"editing",
|
|
53
|
+
"validating",
|
|
54
|
+
"submitting",
|
|
55
|
+
"success",
|
|
56
|
+
"error"
|
|
57
|
+
]), p = r.lazy(() => r.union([
|
|
58
|
+
r.object({
|
|
59
|
+
kind: r.literal("field-value"),
|
|
60
|
+
field: r.string().min(1),
|
|
61
|
+
equals: r.unknown().optional(),
|
|
62
|
+
notEquals: r.unknown().optional(),
|
|
63
|
+
greaterThan: r.unknown().optional(),
|
|
64
|
+
greaterThanOrEqual: r.unknown().optional(),
|
|
65
|
+
lessThan: r.unknown().optional(),
|
|
66
|
+
lessThanOrEqual: r.unknown().optional(),
|
|
67
|
+
in: r.array(r.unknown()).optional(),
|
|
68
|
+
notIn: r.array(r.unknown()).optional(),
|
|
69
|
+
empty: r.boolean().optional(),
|
|
70
|
+
notEmpty: r.boolean().optional(),
|
|
71
|
+
truthy: r.boolean().optional(),
|
|
72
|
+
falsy: r.boolean().optional()
|
|
73
|
+
}),
|
|
74
|
+
r.object({
|
|
75
|
+
kind: r.literal("field-comparison"),
|
|
76
|
+
field: r.string().min(1),
|
|
77
|
+
otherField: r.string().min(1),
|
|
78
|
+
operator: r.enum([
|
|
79
|
+
"eq",
|
|
80
|
+
"neq",
|
|
81
|
+
"gt",
|
|
82
|
+
"gte",
|
|
83
|
+
"lt",
|
|
84
|
+
"lte"
|
|
85
|
+
])
|
|
86
|
+
}),
|
|
87
|
+
r.object({
|
|
88
|
+
kind: r.literal("form-status"),
|
|
89
|
+
equals: r.union([f, r.array(f).min(1)])
|
|
90
|
+
}),
|
|
91
|
+
r.object({
|
|
92
|
+
kind: r.literal("submit-count"),
|
|
93
|
+
eq: r.number().int().nonnegative().optional(),
|
|
94
|
+
gte: r.number().int().nonnegative().optional(),
|
|
95
|
+
lte: r.number().int().nonnegative().optional()
|
|
96
|
+
}),
|
|
97
|
+
r.object({
|
|
98
|
+
kind: r.literal("all"),
|
|
99
|
+
conditions: r.array(p).min(1)
|
|
100
|
+
}),
|
|
101
|
+
r.object({
|
|
102
|
+
kind: r.literal("any"),
|
|
103
|
+
conditions: r.array(p).min(1)
|
|
104
|
+
}),
|
|
105
|
+
r.object({
|
|
106
|
+
kind: r.literal("not"),
|
|
107
|
+
condition: p
|
|
108
|
+
})
|
|
109
|
+
])), m = r.union([d, p]), h = {
|
|
110
|
+
id: r.string().optional(),
|
|
111
|
+
label: r.string().min(1),
|
|
112
|
+
description: r.string().optional(),
|
|
113
|
+
showDescriptionInline: r.boolean().optional().default(!1),
|
|
114
|
+
required: r.boolean().optional().default(!1),
|
|
115
|
+
disabled: r.boolean().optional().default(!1),
|
|
116
|
+
hidden: r.boolean().optional().default(!1),
|
|
117
|
+
readOnly: r.boolean().optional().default(!1),
|
|
118
|
+
disabledWhen: m.optional(),
|
|
119
|
+
hiddenWhen: m.optional(),
|
|
120
|
+
readOnlyWhen: m.optional(),
|
|
121
|
+
asyncValidationDebounceMs: r.number().int().nonnegative().optional(),
|
|
122
|
+
inactiveFieldPolicy: r.enum([
|
|
123
|
+
"include",
|
|
124
|
+
"omit",
|
|
125
|
+
"reset-on-hide"
|
|
126
|
+
]).optional(),
|
|
127
|
+
includeInSubmission: r.boolean().optional(),
|
|
128
|
+
valuePath: r.union([r.string().min(1), r.array(r.string().min(1)).min(1)]).optional(),
|
|
129
|
+
defaultValue: r.unknown().optional(),
|
|
130
|
+
ui: u
|
|
131
|
+
}, g = {
|
|
132
|
+
id: r.string().optional(),
|
|
133
|
+
label: r.string().optional(),
|
|
134
|
+
description: r.string().optional(),
|
|
135
|
+
source: r.string().optional(),
|
|
136
|
+
ui: u
|
|
137
|
+
}, _ = r.union([r.string(), r.object({
|
|
138
|
+
label: r.string(),
|
|
139
|
+
value: r.string()
|
|
140
|
+
})]), v = (e, t) => {
|
|
141
|
+
let n = e.raw;
|
|
142
|
+
if (!(typeof n != "object" || !n || !("outputs" in n) || !Array.isArray(n.outputs))) return n.outputs.find((e) => e.type === t);
|
|
143
|
+
}, y = (e, t, n) => ({
|
|
144
|
+
component: e,
|
|
145
|
+
props: {
|
|
146
|
+
id: t.id,
|
|
147
|
+
kind: t.kind,
|
|
148
|
+
label: t.label,
|
|
149
|
+
description: t.description ?? "",
|
|
150
|
+
showDescriptionInline: !!t.showDescriptionInline,
|
|
151
|
+
required: !!t.required,
|
|
152
|
+
disabled: !!t.disabled,
|
|
153
|
+
...n,
|
|
154
|
+
...t.ui
|
|
155
|
+
}
|
|
156
|
+
}), b = {
|
|
157
|
+
kind: "boolean",
|
|
158
|
+
schema: r.object({
|
|
159
|
+
kind: r.literal("boolean"),
|
|
160
|
+
...h,
|
|
161
|
+
trueLabel: r.string().optional(),
|
|
162
|
+
falseLabel: r.string().optional()
|
|
163
|
+
}),
|
|
164
|
+
getDefaultValue(e) {
|
|
165
|
+
return typeof e.defaultValue == "boolean" ? e.defaultValue : !1;
|
|
166
|
+
},
|
|
167
|
+
normalizeValue(e) {
|
|
168
|
+
return !!e;
|
|
169
|
+
},
|
|
170
|
+
validate(e, t) {
|
|
171
|
+
return t.required && e !== !0 ? [l.booleanRequired] : [];
|
|
172
|
+
},
|
|
173
|
+
describe(e, t) {
|
|
174
|
+
return y("boolean-field", e, {
|
|
175
|
+
checked: t.state.value,
|
|
176
|
+
trueLabel: e.trueLabel,
|
|
177
|
+
falseLabel: e.falseLabel,
|
|
178
|
+
state: t.state.status,
|
|
179
|
+
errors: t.state.errors
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}, x = {
|
|
183
|
+
kind: "category",
|
|
184
|
+
schema: r.object({
|
|
185
|
+
kind: r.literal("category"),
|
|
186
|
+
...h,
|
|
187
|
+
options: r.array(_).min(1)
|
|
188
|
+
}),
|
|
189
|
+
getDefaultValue(e) {
|
|
190
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : null;
|
|
191
|
+
},
|
|
192
|
+
normalizeValue(e) {
|
|
193
|
+
return e == null || e === "" ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : null;
|
|
194
|
+
},
|
|
195
|
+
validate(e, t) {
|
|
196
|
+
return e === null || t.options.map((e) => typeof e == "string" ? e : e.value).includes(e) ? [] : [l.categoryOptionMismatch];
|
|
197
|
+
},
|
|
198
|
+
describe(e, t) {
|
|
199
|
+
return y("category-field", e, {
|
|
200
|
+
value: t.state.value,
|
|
201
|
+
options: e.options,
|
|
202
|
+
state: t.state.status,
|
|
203
|
+
errors: t.state.errors
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}, S = r.object({
|
|
207
|
+
label: r.string(),
|
|
208
|
+
value: r.string(),
|
|
209
|
+
mapping: r.record(r.string(), r.unknown())
|
|
210
|
+
}), C = {
|
|
211
|
+
kind: "mapped-category",
|
|
212
|
+
schema: r.object({
|
|
213
|
+
kind: r.literal("mapped-category"),
|
|
214
|
+
...h,
|
|
215
|
+
includeInSubmission: r.boolean().optional().default(!1),
|
|
216
|
+
options: r.array(S).min(1)
|
|
217
|
+
}),
|
|
218
|
+
getDefaultValue(e) {
|
|
219
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : null;
|
|
220
|
+
},
|
|
221
|
+
normalizeValue(e) {
|
|
222
|
+
return e == null || e === "" ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : null;
|
|
223
|
+
},
|
|
224
|
+
validate(e, t) {
|
|
225
|
+
return e === null || t.options.map((e) => e.value).includes(e) ? [] : [l.categoryOptionMismatch];
|
|
226
|
+
},
|
|
227
|
+
describe(e, t) {
|
|
228
|
+
return y("category-field", e, {
|
|
229
|
+
value: t.state.value,
|
|
230
|
+
options: e.options.map((e) => ({
|
|
231
|
+
label: e.label,
|
|
232
|
+
value: e.value
|
|
233
|
+
})),
|
|
234
|
+
state: t.state.status,
|
|
235
|
+
errors: t.state.errors
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}, w = (e) => typeof e == "object" && !!e && !Array.isArray(e), T = (e) => {
|
|
239
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
240
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
241
|
+
let t = new Date(e);
|
|
242
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
243
|
+
}
|
|
244
|
+
return null;
|
|
245
|
+
}, E = {
|
|
246
|
+
kind: "date",
|
|
247
|
+
schema: r.object({
|
|
248
|
+
kind: r.literal("date"),
|
|
249
|
+
...h,
|
|
250
|
+
min: r.string().optional(),
|
|
251
|
+
max: r.string().optional(),
|
|
252
|
+
step: r.number().positive().optional()
|
|
253
|
+
}),
|
|
254
|
+
getDefaultValue(e) {
|
|
255
|
+
return T(e.defaultValue) ?? null;
|
|
256
|
+
},
|
|
257
|
+
normalizeValue(e) {
|
|
258
|
+
return T(e);
|
|
259
|
+
},
|
|
260
|
+
serializeValue(e) {
|
|
261
|
+
return e instanceof Date ? e.toISOString() : e;
|
|
262
|
+
},
|
|
263
|
+
validate(e, t) {
|
|
264
|
+
let n = [], r = T(t.min), i = T(t.max);
|
|
265
|
+
if (r && i && r.getTime() > i.getTime() && n.push(l.invalidDateRange), e === null) return n;
|
|
266
|
+
if (r && e.getTime() < r.getTime() && n.push(l.dateOnOrAfter(String(t.min))), i && e.getTime() > i.getTime() && n.push(l.dateOnOrBefore(String(t.max))), t.step !== void 0) {
|
|
267
|
+
let i = r ?? /* @__PURE__ */ new Date("1970-01-01T00:00:00Z");
|
|
268
|
+
Math.round(Math.abs(e.getTime() - i.getTime()) / 864e5) % t.step !== 0 && n.push(l.stepDate(t.step));
|
|
269
|
+
}
|
|
270
|
+
return n;
|
|
271
|
+
},
|
|
272
|
+
describe(e, t) {
|
|
273
|
+
return y("date-field", e, {
|
|
274
|
+
value: t.state.value instanceof Date ? t.state.value.toISOString().slice(0, 10) : t.state.value,
|
|
275
|
+
min: e.min,
|
|
276
|
+
max: e.max,
|
|
277
|
+
step: e.step,
|
|
278
|
+
state: t.state.status,
|
|
279
|
+
errors: t.state.errors
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}, D = {
|
|
283
|
+
kind: "long-text",
|
|
284
|
+
schema: r.object({
|
|
285
|
+
kind: r.literal("long-text"),
|
|
286
|
+
...h,
|
|
287
|
+
placeholder: r.string().optional(),
|
|
288
|
+
minLength: r.number().int().nonnegative().optional(),
|
|
289
|
+
maxLength: r.number().int().nonnegative().optional(),
|
|
290
|
+
rows: r.number().int().positive().optional()
|
|
291
|
+
}),
|
|
292
|
+
getDefaultValue(e) {
|
|
293
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
294
|
+
},
|
|
295
|
+
normalizeValue(e) {
|
|
296
|
+
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : "";
|
|
297
|
+
},
|
|
298
|
+
validate(e, t) {
|
|
299
|
+
let n = [];
|
|
300
|
+
return t.minLength !== void 0 && t.maxLength !== void 0 && t.minLength > t.maxLength && n.push(l.invalidTextLengthRange), e.length === 0 ? n : (t.minLength !== void 0 && e.length < t.minLength && n.push(l.minLength(t.minLength)), t.maxLength !== void 0 && e.length > t.maxLength && n.push(l.maxLength(t.maxLength)), n);
|
|
301
|
+
},
|
|
302
|
+
describe(e, t) {
|
|
303
|
+
return y("long-text-field", e, {
|
|
304
|
+
value: t.state.value,
|
|
305
|
+
placeholder: e.placeholder ?? "",
|
|
306
|
+
minLength: e.minLength,
|
|
307
|
+
maxLength: e.maxLength,
|
|
308
|
+
rows: e.rows,
|
|
309
|
+
state: t.state.status,
|
|
310
|
+
errors: t.state.errors
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}, O = {
|
|
314
|
+
kind: "multi-choice",
|
|
315
|
+
schema: r.object({
|
|
316
|
+
kind: r.literal("multi-choice"),
|
|
317
|
+
...h,
|
|
318
|
+
options: r.array(_).min(1),
|
|
319
|
+
layout: r.enum(["horizontal", "vertical"]).optional()
|
|
320
|
+
}),
|
|
321
|
+
getDefaultValue(e) {
|
|
322
|
+
return Array.isArray(e.defaultValue) ? e.defaultValue.filter((e) => typeof e == "string").map(String) : [];
|
|
323
|
+
},
|
|
324
|
+
normalizeValue(e) {
|
|
325
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint").map(String) : [];
|
|
326
|
+
},
|
|
327
|
+
cloneValue(e) {
|
|
328
|
+
return [...e];
|
|
329
|
+
},
|
|
330
|
+
isEqual(e, t) {
|
|
331
|
+
return e.length === t.length ? e.every((e, n) => e === t[n]) : !1;
|
|
332
|
+
},
|
|
333
|
+
validate(e, t) {
|
|
334
|
+
if (e.length === 0) return [];
|
|
335
|
+
let n = t.options.map((e) => typeof e == "string" ? e : e.value);
|
|
336
|
+
return e.filter((e) => !n.includes(e)).length > 0 ? [l.categoryOptionMismatch] : [];
|
|
337
|
+
},
|
|
338
|
+
describe(e, t) {
|
|
339
|
+
return y("multi-choice-field", e, {
|
|
340
|
+
value: t.state.value,
|
|
341
|
+
options: e.options,
|
|
342
|
+
layout: e.layout ?? "vertical",
|
|
343
|
+
state: t.state.status,
|
|
344
|
+
errors: t.state.errors
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}, k = {
|
|
348
|
+
kind: "number",
|
|
349
|
+
schema: r.object({
|
|
350
|
+
kind: r.literal("number"),
|
|
351
|
+
...h,
|
|
352
|
+
min: r.number().optional(),
|
|
353
|
+
max: r.number().optional(),
|
|
354
|
+
step: r.number().positive().optional(),
|
|
355
|
+
unit: r.string().optional(),
|
|
356
|
+
placeholder: r.string().optional()
|
|
357
|
+
}),
|
|
358
|
+
getDefaultValue(e) {
|
|
359
|
+
return typeof e.defaultValue == "number" ? e.defaultValue : null;
|
|
360
|
+
},
|
|
361
|
+
normalizeValue(e) {
|
|
362
|
+
if (e == null || e === "") return null;
|
|
363
|
+
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
364
|
+
if (typeof e == "string") {
|
|
365
|
+
let t = e.trim();
|
|
366
|
+
if (t.length === 0) return null;
|
|
367
|
+
let n = Number(t);
|
|
368
|
+
return Number.isNaN(n) ? e : n;
|
|
369
|
+
}
|
|
370
|
+
let t = Number(e);
|
|
371
|
+
return Number.isNaN(t) ? null : t;
|
|
372
|
+
},
|
|
373
|
+
validate(e, t) {
|
|
374
|
+
let n = [];
|
|
375
|
+
if (t.min !== void 0 && t.max !== void 0 && t.min > t.max && n.push(l.invalidNumericRange), e === null) return n;
|
|
376
|
+
if (typeof e != "number") return n.push(l.invalidNumber), n;
|
|
377
|
+
if (t.min !== void 0 && e < t.min && n.push(l.minValue(t.min)), t.max !== void 0 && e > t.max && n.push(l.maxValue(t.max)), t.step !== void 0) {
|
|
378
|
+
let r = t.min ?? 0, i = Math.abs(e - r) % t.step, a = t.step * 1e-9;
|
|
379
|
+
i > a && Math.abs(i - t.step) > a && n.push(l.stepValue(t.step));
|
|
380
|
+
}
|
|
381
|
+
return n;
|
|
382
|
+
},
|
|
383
|
+
describe(e, t) {
|
|
384
|
+
let n = e.min !== void 0 && e.max !== void 0 && !e.required && t.state.value !== null;
|
|
385
|
+
return y("number-field", e, {
|
|
386
|
+
value: t.state.value,
|
|
387
|
+
min: e.min,
|
|
388
|
+
max: e.max,
|
|
389
|
+
step: e.step,
|
|
390
|
+
unit: e.unit,
|
|
391
|
+
placeholder: e.placeholder ?? "",
|
|
392
|
+
input: n ? "range" : "text",
|
|
393
|
+
state: t.state.status,
|
|
394
|
+
errors: t.state.errors
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}, A = {
|
|
398
|
+
kind: "rating",
|
|
399
|
+
schema: r.object({
|
|
400
|
+
kind: r.literal("rating"),
|
|
401
|
+
...h,
|
|
402
|
+
min: r.number().int().optional(),
|
|
403
|
+
max: r.number().int().min(1),
|
|
404
|
+
step: r.number().int().positive().optional()
|
|
405
|
+
}),
|
|
406
|
+
getDefaultValue(e) {
|
|
407
|
+
return typeof e.defaultValue == "number" ? e.defaultValue : null;
|
|
408
|
+
},
|
|
409
|
+
normalizeValue(e) {
|
|
410
|
+
if (e == null) return null;
|
|
411
|
+
let t = typeof e == "number" ? e : Number(e);
|
|
412
|
+
return Number.isNaN(t) ? null : t;
|
|
413
|
+
},
|
|
414
|
+
validate(e, t) {
|
|
415
|
+
if (e === null) return [];
|
|
416
|
+
let n = [], r = t.min ?? 1, i = t.max;
|
|
417
|
+
return r > i ? (n.push(l.invalidNumericRange), n) : (e < r && n.push(l.minValue(r)), e > i && n.push(l.maxValue(i)), n);
|
|
418
|
+
},
|
|
419
|
+
describe(e, t) {
|
|
420
|
+
return y("rating-field", e, {
|
|
421
|
+
value: t.state.value,
|
|
422
|
+
min: e.min ?? 1,
|
|
423
|
+
max: e.max,
|
|
424
|
+
step: e.step ?? 1,
|
|
425
|
+
state: t.state.status,
|
|
426
|
+
errors: t.state.errors
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}, j = {
|
|
430
|
+
kind: "text",
|
|
431
|
+
schema: r.object({
|
|
432
|
+
kind: r.literal("text"),
|
|
433
|
+
...h,
|
|
434
|
+
placeholder: r.string().optional(),
|
|
435
|
+
minLength: r.number().int().nonnegative().optional(),
|
|
436
|
+
maxLength: r.number().int().nonnegative().optional(),
|
|
437
|
+
pattern: r.string().optional()
|
|
438
|
+
}),
|
|
439
|
+
getDefaultValue(e) {
|
|
440
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
441
|
+
},
|
|
442
|
+
normalizeValue(e) {
|
|
443
|
+
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : "";
|
|
444
|
+
},
|
|
445
|
+
validate(e, t) {
|
|
446
|
+
let n = [];
|
|
447
|
+
return t.minLength !== void 0 && t.maxLength !== void 0 && t.minLength > t.maxLength && n.push(l.invalidTextLengthRange), e.length === 0 ? n : (t.minLength !== void 0 && e.length < t.minLength && n.push(l.minLength(t.minLength)), t.maxLength !== void 0 && e.length > t.maxLength && n.push(l.maxLength(t.maxLength)), t.pattern && !new RegExp(t.pattern).test(e) && n.push(l.textPatternMismatch), n);
|
|
448
|
+
},
|
|
449
|
+
describe(e, t) {
|
|
450
|
+
return y("text-field", e, {
|
|
451
|
+
value: t.state.value,
|
|
452
|
+
placeholder: e.placeholder ?? "",
|
|
453
|
+
minLength: e.minLength,
|
|
454
|
+
maxLength: e.maxLength,
|
|
455
|
+
pattern: e.pattern,
|
|
456
|
+
state: t.state.status,
|
|
457
|
+
errors: t.state.errors
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
}, M = r.object({
|
|
461
|
+
kind: r.string().min(1),
|
|
462
|
+
label: r.string().min(1),
|
|
463
|
+
required: r.boolean().optional()
|
|
464
|
+
}).passthrough(), N = r.object({
|
|
465
|
+
kind: r.literal("series"),
|
|
466
|
+
...h,
|
|
467
|
+
field1: M,
|
|
468
|
+
field2: M,
|
|
469
|
+
minPoints: r.number().int().nonnegative().optional(),
|
|
470
|
+
maxPoints: r.number().int().nonnegative().optional()
|
|
471
|
+
}), ee = "This field is required.", P = (e) => e.toISOString().slice(0, 10), F = {
|
|
472
|
+
text: j,
|
|
473
|
+
number: k,
|
|
474
|
+
date: E,
|
|
475
|
+
category: x
|
|
476
|
+
}, I = (e) => F[e], L = (e) => {
|
|
477
|
+
if (e == null || e === "") return null;
|
|
478
|
+
if (typeof e == "boolean") return e;
|
|
479
|
+
if (typeof e == "string") {
|
|
480
|
+
if (e === "true") return !0;
|
|
481
|
+
if (e === "false") return !1;
|
|
482
|
+
}
|
|
483
|
+
return !!e;
|
|
484
|
+
}, R = (e, t) => {
|
|
485
|
+
if (e.kind === b.kind) return L(t);
|
|
486
|
+
let n = I(e.kind);
|
|
487
|
+
return n?.normalizeValue ? n.normalizeValue(t, e) : t;
|
|
488
|
+
}, z = (e, t) => {
|
|
489
|
+
if (t == null) return null;
|
|
490
|
+
if (e.kind === "date" && t instanceof Date) return P(t);
|
|
491
|
+
let n = I(e.kind);
|
|
492
|
+
return n?.serializeValue ? n.serializeValue(t, e) : t;
|
|
493
|
+
}, B = (e, t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : e.kind === b.kind ? t == null : !1, V = (e, t) => {
|
|
494
|
+
if (e.required && B(e, t)) return [ee];
|
|
495
|
+
if (e.kind === b.kind) {
|
|
496
|
+
if (t === null) return [];
|
|
497
|
+
let n = b.validate?.(t, e, {
|
|
498
|
+
field: {
|
|
499
|
+
...e,
|
|
500
|
+
id: e.label
|
|
501
|
+
},
|
|
502
|
+
values: {},
|
|
503
|
+
submitCount: 0,
|
|
504
|
+
validationVersion: 0,
|
|
505
|
+
signal: void 0
|
|
506
|
+
});
|
|
507
|
+
return Array.isArray(n) ? n : [];
|
|
508
|
+
}
|
|
509
|
+
let n = I(e.kind);
|
|
510
|
+
if (!n?.validate) return [];
|
|
511
|
+
let r = n.validate(t, e, {
|
|
512
|
+
field: {
|
|
513
|
+
...e,
|
|
514
|
+
id: e.label
|
|
515
|
+
},
|
|
516
|
+
values: {},
|
|
517
|
+
submitCount: 0,
|
|
518
|
+
validationVersion: 0,
|
|
519
|
+
signal: void 0
|
|
520
|
+
});
|
|
521
|
+
return Array.isArray(r) ? r : [];
|
|
522
|
+
}, H = (e, t, n) => n.map((n) => `Row ${e + 1} (${t}): ${n}`), U = (e) => {
|
|
523
|
+
if (Array.isArray(e)) return e.length >= 2 ? {
|
|
524
|
+
field1: e[0],
|
|
525
|
+
field2: e[1]
|
|
526
|
+
} : null;
|
|
527
|
+
if (!w(e)) return null;
|
|
528
|
+
if ("field1" in e || "field2" in e) return {
|
|
529
|
+
field1: e.field1,
|
|
530
|
+
field2: e.field2
|
|
531
|
+
};
|
|
532
|
+
let t = Object.entries(e);
|
|
533
|
+
return t.length < 2 ? null : {
|
|
534
|
+
field1: t[0]?.[1],
|
|
535
|
+
field2: t[1]?.[1]
|
|
536
|
+
};
|
|
537
|
+
}, W = (e, t) => {
|
|
538
|
+
let n = U(e);
|
|
539
|
+
return n ? {
|
|
540
|
+
field1: R(t.field1, n.field1),
|
|
541
|
+
field2: R(t.field2, n.field2)
|
|
542
|
+
} : null;
|
|
543
|
+
}, G = (e, t) => {
|
|
544
|
+
let n = /* @__PURE__ */ new Set();
|
|
545
|
+
return t.minPoints !== void 0 && t.maxPoints !== void 0 && t.minPoints > t.maxPoints && n.add(l.invalidPointCountRange), t.minPoints !== void 0 && e.length < t.minPoints && n.add(l.minPoints(t.minPoints)), t.maxPoints !== void 0 && e.length > t.maxPoints && n.add(l.maxPoints(t.maxPoints)), n;
|
|
546
|
+
}, K = {
|
|
547
|
+
kind: "series",
|
|
548
|
+
schema: N,
|
|
549
|
+
getDefaultValue(e) {
|
|
550
|
+
return Array.isArray(e.defaultValue) ? e.defaultValue.map((t) => W(t, e)).filter((e) => e !== null) : [];
|
|
551
|
+
},
|
|
552
|
+
normalizeValue(e, t) {
|
|
553
|
+
return Array.isArray(e) ? e.map((e) => W(e, t)).filter((e) => e !== null) : [];
|
|
554
|
+
},
|
|
555
|
+
serializeValue(e, t) {
|
|
556
|
+
return e.map((e) => ({
|
|
557
|
+
field1: z(t.field1, e.field1),
|
|
558
|
+
field2: z(t.field2, e.field2)
|
|
559
|
+
}));
|
|
560
|
+
},
|
|
561
|
+
validate(e, t) {
|
|
562
|
+
let n = G(e, t);
|
|
563
|
+
return e.forEach((e, r) => {
|
|
564
|
+
for (let i of H(r, t.field1.label, V(t.field1, e.field1))) n.add(i);
|
|
565
|
+
for (let i of H(r, t.field2.label, V(t.field2, e.field2))) n.add(i);
|
|
566
|
+
}), [...n];
|
|
567
|
+
},
|
|
568
|
+
describe(e, t) {
|
|
569
|
+
return y("series-field", e, {
|
|
570
|
+
value: Array.isArray(t.state.value) ? t.state.value.map((t) => w(t) ? {
|
|
571
|
+
field1: z(e.field1, t.field1),
|
|
572
|
+
field2: z(e.field2, t.field2)
|
|
573
|
+
} : t) : [],
|
|
574
|
+
field1: e.field1,
|
|
575
|
+
field2: e.field2,
|
|
576
|
+
minPoints: e.minPoints,
|
|
577
|
+
maxPoints: e.maxPoints,
|
|
578
|
+
state: t.state.status,
|
|
579
|
+
errors: t.state.errors
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
}, q = {
|
|
583
|
+
kind: "single-choice",
|
|
584
|
+
schema: r.object({
|
|
585
|
+
kind: r.literal("single-choice"),
|
|
586
|
+
...h,
|
|
587
|
+
options: r.array(_).min(1),
|
|
588
|
+
layout: r.enum(["horizontal", "vertical"]).optional()
|
|
589
|
+
}),
|
|
590
|
+
getDefaultValue(e) {
|
|
591
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : null;
|
|
592
|
+
},
|
|
593
|
+
normalizeValue(e) {
|
|
594
|
+
return e == null || e === "" ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : null;
|
|
595
|
+
},
|
|
596
|
+
validate(e, t) {
|
|
597
|
+
return e === null || t.options.map((e) => typeof e == "string" ? e : e.value).includes(e) ? [] : [l.categoryOptionMismatch];
|
|
598
|
+
},
|
|
599
|
+
describe(e, t) {
|
|
600
|
+
return y("single-choice-field", e, {
|
|
601
|
+
value: t.state.value,
|
|
602
|
+
options: e.options,
|
|
603
|
+
layout: e.layout ?? "vertical",
|
|
604
|
+
state: t.state.status,
|
|
605
|
+
errors: t.state.errors
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
}, J = {
|
|
609
|
+
kind: "classifier",
|
|
610
|
+
partialUpdatePolicy: "validate",
|
|
611
|
+
schema: r.object({
|
|
612
|
+
kind: r.literal("classifier"),
|
|
613
|
+
...g,
|
|
614
|
+
labels: r.array(r.string()).optional(),
|
|
615
|
+
showClassProbabilities: r.boolean().optional().default(!0)
|
|
616
|
+
}),
|
|
617
|
+
resolvePayload(e, t) {
|
|
618
|
+
return t.result.reports[t.report.source] ?? v(t.result, a.classifier);
|
|
619
|
+
},
|
|
620
|
+
describe(e, t) {
|
|
621
|
+
return t.state.status === "idle" && t.payload === void 0 ? null : {
|
|
622
|
+
component: "classifier-report",
|
|
623
|
+
props: {
|
|
624
|
+
id: t.reportId,
|
|
625
|
+
kind: e.kind,
|
|
626
|
+
label: e.label ?? s.classifier,
|
|
627
|
+
description: e.description ?? "",
|
|
628
|
+
payload: t.payload,
|
|
629
|
+
error: t.state.error,
|
|
630
|
+
state: t.state.status,
|
|
631
|
+
showClassProbabilities: e.showClassProbabilities,
|
|
632
|
+
labels: e.labels,
|
|
633
|
+
...e.ui
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
}, Y = {
|
|
638
|
+
kind: "regressor",
|
|
639
|
+
partialUpdatePolicy: "validate",
|
|
640
|
+
schema: r.object({
|
|
641
|
+
kind: r.literal("regressor"),
|
|
642
|
+
...g,
|
|
643
|
+
unit: r.string().optional(),
|
|
644
|
+
precision: r.number().int().nonnegative().optional().default(2)
|
|
645
|
+
}),
|
|
646
|
+
resolvePayload(e, t) {
|
|
647
|
+
return t.result.reports[t.report.source] ?? v(t.result, a.regressor);
|
|
648
|
+
},
|
|
649
|
+
describe(e, t) {
|
|
650
|
+
return t.state.status === "idle" && t.payload === void 0 ? null : {
|
|
651
|
+
component: "regressor-report",
|
|
652
|
+
props: {
|
|
653
|
+
id: t.reportId,
|
|
654
|
+
kind: e.kind,
|
|
655
|
+
label: e.label ?? s.regressor,
|
|
656
|
+
description: e.description ?? "",
|
|
657
|
+
payload: t.payload,
|
|
658
|
+
error: t.state.error,
|
|
659
|
+
state: t.state.status,
|
|
660
|
+
unit: e.unit,
|
|
661
|
+
precision: e.precision,
|
|
662
|
+
...e.ui
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
}, X = (e) => e.kind === "mapped-category" ? e.config : null, Z = (e, n) => e.getField(n) ?? e.getField(t(n)), Q = async (e, t) => {
|
|
667
|
+
let n = t.getField(e.fieldId);
|
|
668
|
+
if (!n) return;
|
|
669
|
+
let r = X(n);
|
|
670
|
+
if (!r) return;
|
|
671
|
+
let i = e.values[e.fieldId], a = r.options.find((e) => e.value === i);
|
|
672
|
+
if (a?.mapping) {
|
|
673
|
+
for (let [n, r] of Object.entries(a.mapping)) {
|
|
674
|
+
let i = Z(t, n);
|
|
675
|
+
if (!i) throw Error(`mapped-category "${e.fieldId}": target field "${n}" not found in schema.`);
|
|
676
|
+
t.commitDerivedValue(i.id, r);
|
|
677
|
+
}
|
|
678
|
+
t.syncDerivedState();
|
|
679
|
+
}
|
|
680
|
+
}, $ = () => ({
|
|
681
|
+
validate(e) {
|
|
682
|
+
for (let t of e.fields) {
|
|
683
|
+
let n = X(t);
|
|
684
|
+
if (n) {
|
|
685
|
+
for (let r of n.options) for (let n of Object.keys(r.mapping ?? {})) if (!Z(e, n)) throw Error(`mapped-category "${t.id}": mapping references unknown field "${n}".`);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
async onValuesChanged(e, t) {
|
|
690
|
+
await Q(e, t);
|
|
691
|
+
}
|
|
692
|
+
}), te = [
|
|
693
|
+
j,
|
|
694
|
+
k,
|
|
695
|
+
b,
|
|
696
|
+
x,
|
|
697
|
+
C,
|
|
698
|
+
E,
|
|
699
|
+
K,
|
|
700
|
+
D,
|
|
701
|
+
q,
|
|
702
|
+
O,
|
|
703
|
+
A
|
|
704
|
+
], ne = [J, Y], re = (e, t) => {
|
|
705
|
+
!t.describe || e.getField(t.kind) || e.registerField({
|
|
706
|
+
kind: t.kind,
|
|
707
|
+
describe: t.describe
|
|
708
|
+
});
|
|
709
|
+
}, ie = (e, t) => {
|
|
710
|
+
!t.describe || e.getReport(t.kind) || e.registerReport({
|
|
711
|
+
kind: t.kind,
|
|
712
|
+
describe: t.describe
|
|
713
|
+
});
|
|
714
|
+
}, ae = () => e().registerReport(J).registerReport(Y), oe = () => {
|
|
715
|
+
let t = e(), r = n();
|
|
716
|
+
for (let e of te) t.registerField(e), re(r, e);
|
|
717
|
+
for (let e of ne) t.registerReport(e), ie(r, e);
|
|
718
|
+
return {
|
|
719
|
+
registry: t,
|
|
720
|
+
descriptorRegistry: r,
|
|
721
|
+
behaviors: [$()]
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
//#endregion
|
|
725
|
+
export { l as S, o as _, J as a, i as b, j as c, O as d, D as f, b as g, x as h, Y as i, A as l, C as m, oe as n, q as o, E as p, $ as r, K as s, ae as t, k as u, a as v, s as x, c as y };
|