mlform 0.1.9 → 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 +16 -14
- package/dist/builtins-D8rXH4ED.js +725 -0
- package/dist/{design-system-CIU_vH6O.js → design-6suKVQDo.js} +15 -15
- package/dist/mlform/builtins.mjs +2 -0
- package/dist/mlform/{design-system.mjs → design.mjs} +2 -2
- package/dist/mlform/kit.mjs +1896 -3
- package/dist/mlform/primitives.mjs +2 -2
- package/dist/mlform/runtime.mjs +3 -4
- package/dist/mlform/schema.mjs +2 -102
- package/dist/mlform/transport.mjs +2 -2
- package/dist/{primitives-Di95y_ur.js → primitives-k9HTnd72.js} +2303 -3384
- package/dist/{runtime-C5iTM3uu.js → runtime-CI7vlp9i.js} +655 -791
- package/dist/schema-DSAZ6bts.js +88 -0
- package/dist/{transport-B6ePTLFK.js → transport-CO6udZ6z.js} +605 -575
- package/dist/types/{builtins-ml/definitions/index.d.ts → builtins/definitions/collections.d.ts} +0 -14
- package/dist/types/{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-ml → builtins}/definitions/shared.d.ts +2 -9
- 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-system/recipes/index.d.ts → design/recipes/collections.d.ts} +0 -1
- package/dist/types/design/recipes/index.d.ts +2 -0
- package/dist/types/design/resolve/index.d.ts +4 -0
- package/dist/types/{design-system/resolve/index.d.ts → design/resolve/resolve-design.d.ts} +0 -3
- package/dist/types/{design-system → design}/runtime/index.d.ts +3 -3
- package/dist/types/{design-system/themes/index.d.ts → design/themes/collections.d.ts} +0 -2
- package/dist/types/design/themes/index.d.ts +3 -0
- package/dist/types/{design-system → design}/types.d.ts +1 -1
- package/dist/types/kit/constants.d.ts +2 -10
- package/dist/types/kit/defaults.d.ts +1 -1
- package/dist/types/kit/disclosure-root-styles.d.ts +1 -0
- package/dist/types/kit/error-navigation.d.ts +2 -1
- package/dist/types/kit/index.d.ts +3 -5
- package/dist/types/{presentation → kit/kinds}/define-field-kind.d.ts +11 -3
- package/dist/types/kit/kinds/define-report-kind.d.ts +40 -0
- package/dist/types/kit/kinds/index.d.ts +3 -0
- package/dist/types/kit/kinds/register-kind.d.ts +5 -0
- package/dist/types/kit/layout-helpers.d.ts +7 -11
- package/dist/types/kit/layout-node-render.d.ts +4 -4
- package/dist/types/kit/layout-node-resolver.d.ts +1 -1
- package/dist/types/kit/{accordion-root.d.ts → layout-root.d.ts} +3 -4
- package/dist/types/kit/layout-types.d.ts +8 -36
- package/dist/types/kit/layout-utils.d.ts +0 -1
- package/dist/types/kit/layout.d.ts +2 -2
- package/dist/types/kit/mount-types.d.ts +8 -7
- package/dist/types/kit/panel-nav.d.ts +1 -1
- package/dist/types/kit/tabs-root.d.ts +1 -2
- package/dist/types/kit/types.d.ts +2 -3
- package/dist/types/kit/view-core-types.d.ts +110 -0
- package/dist/types/kit/view-layout-state.d.ts +10 -3
- package/dist/types/kit/view-navigation.d.ts +3 -3
- package/dist/types/kit/view-snapshot-cache.d.ts +3 -3
- package/dist/types/kit/view-snapshot.d.ts +4 -4
- package/dist/types/kit/view-types.d.ts +1 -172
- package/dist/types/kit/view.d.ts +2 -8
- package/dist/types/kit/wizard-root.d.ts +1 -2
- package/dist/types/primitives/base-async-report-element.d.ts +1 -1
- package/dist/types/primitives/base-field-element.d.ts +3 -3
- package/dist/types/primitives/base-report-element.d.ts +3 -3
- package/dist/types/primitives/components/descriptor-content.d.ts +4 -0
- package/dist/types/primitives/components/error-focus.d.ts +3 -2
- package/dist/types/primitives/components/field-frame-feedback.d.ts +3 -3
- package/dist/types/primitives/components/field-frame.d.ts +3 -3
- package/dist/types/primitives/components/form-errors.d.ts +2 -2
- package/dist/types/primitives/components/form-root-presenters.d.ts +6 -11
- package/dist/types/primitives/components/form-root-state.d.ts +4 -6
- package/dist/types/primitives/components/form-root-templates.d.ts +4 -8
- package/dist/types/primitives/components/form-root.d.ts +4 -4
- package/dist/types/primitives/components/report-frame.d.ts +4 -4
- package/dist/types/primitives/components/submit-button.d.ts +2 -2
- package/dist/types/primitives/constants.d.ts +6 -9
- package/dist/types/primitives/controller-types.d.ts +96 -0
- package/dist/types/primitives/descriptor-resolution.d.ts +6 -0
- package/dist/types/primitives/descriptors/content.d.ts +61 -0
- package/dist/types/primitives/descriptors/field.d.ts +32 -0
- package/dist/types/primitives/descriptors/index.d.ts +5 -0
- package/dist/types/primitives/descriptors/registry.d.ts +11 -0
- package/dist/types/primitives/descriptors/report.d.ts +20 -0
- package/dist/types/primitives/index.d.ts +8 -3
- package/dist/types/primitives/mount-form.d.ts +2 -2
- package/dist/types/primitives/request-runner.d.ts +13 -0
- package/dist/types/primitives/types.d.ts +16 -53
- package/dist/types/runtime/errors.d.ts +1 -2
- package/dist/types/runtime/index.d.ts +2 -4
- package/dist/types/runtime/reports/controller.d.ts +3 -2
- package/dist/types/runtime/runtime-controller.d.ts +1 -5
- package/dist/types/runtime/state/engine.d.ts +1 -2
- package/dist/types/runtime/submission/create-submitter.d.ts +1 -1
- package/dist/types/runtime/submission/index.d.ts +1 -1
- package/dist/types/runtime/submission/lifecycle.d.ts +1 -2
- package/dist/types/runtime/submission/pipeline.d.ts +1 -1
- package/dist/types/runtime/submission/report-fetches.d.ts +2 -0
- package/dist/types/runtime/submission/types.d.ts +1 -2
- package/dist/types/runtime/types/form.d.ts +9 -13
- package/dist/types/runtime/types/index.d.ts +0 -1
- package/dist/types/runtime/types/pipeline.d.ts +10 -10
- package/dist/types/runtime/types/registry.d.ts +2 -3
- package/dist/types/runtime/types/report.d.ts +4 -1
- package/dist/types/runtime/types/transport.d.ts +3 -4
- package/dist/types/runtime/utils.d.ts +1 -3
- package/dist/types/runtime/validation/form.d.ts +1 -1
- package/dist/types/schema/ids.d.ts +1 -0
- package/dist/types/schema/index.d.ts +3 -1
- package/dist/types/schema/registry.d.ts +2 -4
- package/dist/types/schema/report-fetch-request.d.ts +6 -0
- package/dist/types/schema/types/form.d.ts +0 -3
- package/dist/types/schema/types/registry.d.ts +0 -5
- package/dist/types/schema/types/report.d.ts +25 -3
- package/dist/types/schema/types/submit.d.ts +11 -0
- package/dist/types/transport/errors.d.ts +1 -2
- package/dist/types/transport/index.d.ts +2 -0
- package/dist/types/transport/request-runner.d.ts +16 -0
- package/package.json +9 -22
- package/dist/builtins-ml-pjab8_gu.js +0 -3878
- package/dist/errors-CTNw8fwS.js +0 -8
- package/dist/kit-QY6zff-h.js +0 -1888
- package/dist/mlform/behaviors.mjs +0 -32
- package/dist/mlform/builtins-ml.mjs +0 -2
- package/dist/mlform/presentation.mjs +0 -2
- package/dist/mlform.mjs +0 -8
- package/dist/presentation-BrlVO4oV.js +0 -200
- package/dist/strings-CWwrrYzz.js +0 -4
- package/dist/types/behaviors/index.d.ts +0 -3
- package/dist/types/builtins-ml/index.d.ts +0 -5
- package/dist/types/index.d.ts +0 -13
- package/dist/types/kit/accordion-root-styles.d.ts +0 -1
- package/dist/types/kit/accordion.d.ts +0 -2
- package/dist/types/kit/tabs.d.ts +0 -2
- package/dist/types/kit/wizard.d.ts +0 -2
- package/dist/types/packs/default.d.ts +0 -2
- package/dist/types/packs/index.d.ts +0 -3
- package/dist/types/packs/ml.d.ts +0 -2
- package/dist/types/packs/shared.d.ts +0 -24
- package/dist/types/presentation/define-explanation-kind.d.ts +0 -11
- package/dist/types/presentation/define-report-kind.d.ts +0 -15
- package/dist/types/presentation/index.d.ts +0 -10
- package/dist/types/presentation/register-kind.d.ts +0 -6
- package/dist/types/presentation/registry.d.ts +0 -15
- package/dist/types/presentation/types/explanation.d.ts +0 -32
- package/dist/types/presentation/types/field.d.ts +0 -36
- package/dist/types/presentation/types/presentation.d.ts +0 -61
- package/dist/types/presentation/types/report.d.ts +0 -41
- package/dist/types/primitives/base-explanation-element.d.ts +0 -22
- package/dist/types/primitives/components/declarative-explanation.d.ts +0 -5
- package/dist/types/primitives/components/explanation-panel.d.ts +0 -24
- package/dist/types/primitives/components/presentation.d.ts +0 -4
- package/dist/types/primitives/presentation.d.ts +0 -8
- package/dist/types/runtime/explanations/controller.d.ts +0 -13
- package/dist/types/runtime/explanations/index.d.ts +0 -1
- package/dist/types/runtime/schema/index.d.ts +0 -7
- package/dist/types/runtime/submission/explanations.d.ts +0 -2
- package/dist/types/runtime/types/explanation.d.ts +0 -15
- package/dist/types/schema/types/explanation.d.ts +0 -43
- package/dist/types/shared/errors.d.ts +0 -3
- package/dist/types/shared/index.d.ts +0 -3
- package/dist/types/shared/strings.d.ts +0 -1
- package/dist/utils-J5o8lkea.js +0 -29
- /package/dist/types/{runtime → builtins}/constants.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/boolean.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/category.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/date.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/long-text.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/mapped-category.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/multi-choice.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/number.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/rating.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/series-helpers.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/series.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/single-choice.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/text.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/reports/classifier.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/reports/regressor.d.ts +0 -0
- /package/dist/types/{design-system → design}/constants.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/component-keys.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/component-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/global-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/token-keys.d.ts +0 -0
- /package/dist/types/{design-system → design}/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/contrast.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/default.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/minimal.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/soft.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/builtins.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/create-registry.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/deep-freeze.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-recipe.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-theme.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-token-maps.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/diagnostics.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/merge-config.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/migrate-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-mode.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-recipe.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-theme.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/apply-tokens.d.ts +0 -0
- /package/dist/types/{design-system/runtime/attach-design-system.d.ts → design/runtime/attach-design.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/controller-helpers.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/create-stylesheet.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/declarations.d.ts +0 -0
- /package/dist/types/{design-system/runtime/design-system-controller.d.ts → design/runtime/design-controller.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/fingerprint.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/host-observer.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/host-state.d.ts +0 -0
- /package/dist/types/{design-system/runtime/hydrate-design-system.d.ts → design/runtime/hydrate-design.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/hydration-state.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/inherited-scheme.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/media.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/airbnb.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/clickhouse.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/cobalt.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/graphite.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/neutral.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/sage.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/sunset.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/base.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/contrast.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/density.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/forced-colors.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/motion.d.ts +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { t as e } from "../errors-CTNw8fwS.js";
|
|
2
|
-
import { t } from "../strings-CWwrrYzz.js";
|
|
3
|
-
//#region src/behaviors/index.ts
|
|
4
|
-
var n = (e) => e.kind === "mapped-category" ? e.config : null, r = (e, n) => e.getField(n) ?? e.getField(t(n)), i = async (t, i) => {
|
|
5
|
-
let a = i.getField(t.fieldId);
|
|
6
|
-
if (!a) return;
|
|
7
|
-
let o = n(a);
|
|
8
|
-
if (!o) return;
|
|
9
|
-
let s = t.values[t.fieldId], c = o.options.find((e) => e.value === s);
|
|
10
|
-
if (c?.mapping) {
|
|
11
|
-
for (let [n, a] of Object.entries(c.mapping)) {
|
|
12
|
-
let o = r(i, n);
|
|
13
|
-
if (!o) throw new e(`mapped-category "${t.fieldId}": target field "${n}" not found in schema.`);
|
|
14
|
-
i.commitDerivedValue(o.id, a);
|
|
15
|
-
}
|
|
16
|
-
i.syncDerivedState();
|
|
17
|
-
}
|
|
18
|
-
}, a = () => ({
|
|
19
|
-
validate(t) {
|
|
20
|
-
for (let i of t.fields) {
|
|
21
|
-
let a = n(i);
|
|
22
|
-
if (a) {
|
|
23
|
-
for (let n of a.options) for (let a of Object.keys(n.mapping ?? {})) if (!r(t, a)) throw new e(`mapped-category "${i.id}": mapping references unknown field "${a}".`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
async onValuesChanged(e, t) {
|
|
28
|
-
await i(e, t);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
//#endregion
|
|
32
|
-
export { a as createMappedCategoryBehavior };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../presentation-BrlVO4oV.js";
|
|
2
|
-
export { c as PresentationRegistry, i as createPresentationRegistry, t as defineExplanationKind, s as defineFieldKind, a as defineReportKind, o as registerDefinedExplanationKind, n as registerDefinedFieldKind, e as registerDefinedReportKind, r as toPresentationNodes };
|
package/dist/mlform.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createRegistry as e, defineExplanationDefinition as t, defineFieldDefinition as n, defineReportDefinition as r } from "./mlform/schema.mjs";
|
|
2
|
-
import { i, n as a, r as o } from "./runtime-C5iTM3uu.js";
|
|
3
|
-
import { A as s, B as c, C as l, D as u, E as d, F as f, G as p, H as m, K as h, M as g, N as _, O as v, P as y, R as b, S as x, T as S, U as C, V as w, W as T, _ as E, a as D, b as O, c as k, d as A, f as j, g as M, h as N, i as P, j as F, k as I, l as L, m as R, n as z, o as B, p as V, q as H, r as U, s as W, t as G, u as K, v as q, w as J, x as Y, y as X, z as Z } from "./transport-B6ePTLFK.js";
|
|
4
|
-
import { n as Q, r as $, t as ee } from "./builtins-ml-pjab8_gu.js";
|
|
5
|
-
import { createMappedCategoryBehavior as te } from "./mlform/behaviors.mjs";
|
|
6
|
-
import { c as ne, l as re, o as ie, s as ae } from "./presentation-BrlVO4oV.js";
|
|
7
|
-
import { a as oe, c as se, d as ce, i as le, l as ue, n as de, o as fe, r as pe, s as me, t as he, u as ge } from "./kit-QY6zff-h.js";
|
|
8
|
-
export { h as TransportError, b as assertPayloadWithinLimits, Z as assertTransportCapabilities, c as cloneCapabilities, me as collectLayoutReferences, ee as createBuiltinMlRegistry, $ as createDefaultRegistryPack, i as createExplanationController, D as createFallbackTransport, W as createFanoutTransport, fe as createFormView, y as createGraphqlTransport, u as createGrpcSessionTransport, v as createGrpcStreamTransport, I as createGrpcTransport, s as createGrpcUnaryTransport, z as createHedgedTransport, f as createJsonTransport, k as createLoadBalancedTransport, te as createMappedCategoryBehavior, E as createMemoryCircuitBreakerState, N as createMemorySharedRateLimiter, j as createMemoryTransportCacheStore, G as createMemoryTransportHealthState, Q as createMlRegistryPack, P as createPipelineTransport, B as createQuorumFanoutTransport, U as createRacingTransport, e as createRegistry, L as createRoutingTransport, g as createSessionTransport, _ as createSseTransport, F as createWebSocketSessionTransport, K as createWeightedRoutingTransport, ge as defaultKitDesignSystem, ce as defaultKitLabels, t as defineExplanationDefinition, ne as defineExplanationKind, n as defineFieldDefinition, ae as defineFieldKind, r as defineReportDefinition, ie as defineReportKind, o as executeExplanations, a as executeFormPipeline, se as flattenLayoutNodes, w as inferTransportCapabilities, m as mergeTransportCapabilities, oe as mountAccordionForm, pe as mountForm, de as mountTabsForm, he as mountWizardForm, C as normalizeTransportCapabilities, d as pipe, re as toPresentationNodes, T as transportDefaults, H as transportErrorCodes, p as transportErrorMessages, le as unmountForm, ue as walkLayoutNodes, q as withAuth, A as withCache, M as withCircuitBreaker, V as withDedup, Y as withLogging, X as withMetrics, R as withRateLimit, x as withRequestTransform, l as withResponseTransform, S as withRetry, J as withTimeout, O as withTracing };
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { RegistryError as e } from "./mlform/schema.mjs";
|
|
2
|
-
//#region src/presentation/types/presentation.ts
|
|
3
|
-
var t = (e) => e ? Array.isArray(e) ? e : [e] : [], n = (e) => {
|
|
4
|
-
let n = {
|
|
5
|
-
kind: e.kind,
|
|
6
|
-
schema: e.schema,
|
|
7
|
-
transport: (t) => e.fetch({
|
|
8
|
-
config: t,
|
|
9
|
-
explanationId: t.id
|
|
10
|
-
})
|
|
11
|
-
}, r = {
|
|
12
|
-
kind: e.kind,
|
|
13
|
-
describe(n, r) {
|
|
14
|
-
let i = {
|
|
15
|
-
config: n,
|
|
16
|
-
explanationId: n.id,
|
|
17
|
-
state: r.state,
|
|
18
|
-
result: r.state.result
|
|
19
|
-
};
|
|
20
|
-
return {
|
|
21
|
-
component: "declarative-explanation",
|
|
22
|
-
props: {
|
|
23
|
-
id: n.id,
|
|
24
|
-
kind: n.kind,
|
|
25
|
-
label: n.label ?? n.id,
|
|
26
|
-
description: n.description ?? "",
|
|
27
|
-
result: r.state.result,
|
|
28
|
-
error: r.state.error,
|
|
29
|
-
state: r.state.status,
|
|
30
|
-
summary: e.render.summary?.(i) ?? null,
|
|
31
|
-
content: r.state.result === void 0 && r.state.error === null ? [] : t(e.render.content(i))
|
|
32
|
-
},
|
|
33
|
-
meta: { declarative: !0 }
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}, i = r.describe.bind(r);
|
|
37
|
-
return Object.assign(n, { describe: i }), {
|
|
38
|
-
kind: e.kind,
|
|
39
|
-
schema: e.schema,
|
|
40
|
-
transport: n.transport,
|
|
41
|
-
describe: i,
|
|
42
|
-
definition: n,
|
|
43
|
-
presenter: r
|
|
44
|
-
};
|
|
45
|
-
}, r = (e, t) => e ? typeof e == "function" ? e(t) ?? {} : e : {}, i = (e) => {
|
|
46
|
-
let t = e.validate, n = {
|
|
47
|
-
kind: e.kind,
|
|
48
|
-
schema: e.schema,
|
|
49
|
-
getDefaultValue: e.value?.default,
|
|
50
|
-
normalizeValue: e.value?.normalize,
|
|
51
|
-
cloneValue: e.value?.clone,
|
|
52
|
-
isEqual: e.value?.isEqual,
|
|
53
|
-
serializeValue: e.value?.serialize,
|
|
54
|
-
validate: t ? (e, n, r) => t({
|
|
55
|
-
...r,
|
|
56
|
-
config: n,
|
|
57
|
-
value: e
|
|
58
|
-
}) : void 0
|
|
59
|
-
}, i = {
|
|
60
|
-
kind: e.kind,
|
|
61
|
-
describe(t, n) {
|
|
62
|
-
let i = r(e.render.hints, {
|
|
63
|
-
config: t,
|
|
64
|
-
fieldId: t.id,
|
|
65
|
-
state: n.state,
|
|
66
|
-
value: n.value
|
|
67
|
-
});
|
|
68
|
-
return {
|
|
69
|
-
component: "declarative-field",
|
|
70
|
-
props: {
|
|
71
|
-
id: t.id,
|
|
72
|
-
kind: t.kind,
|
|
73
|
-
label: t.label,
|
|
74
|
-
description: t.description ?? "",
|
|
75
|
-
showDescriptionInline: !!t.showDescriptionInline,
|
|
76
|
-
required: !!t.required,
|
|
77
|
-
disabled: !!t.disabled,
|
|
78
|
-
widget: e.render.widget,
|
|
79
|
-
value: n.value,
|
|
80
|
-
state: n.state.status,
|
|
81
|
-
errors: n.state.errors,
|
|
82
|
-
...i,
|
|
83
|
-
...t.ui
|
|
84
|
-
},
|
|
85
|
-
meta: {
|
|
86
|
-
declarative: !0,
|
|
87
|
-
widget: e.render.widget
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
}, a = i.describe.bind(i);
|
|
92
|
-
return Object.assign(n, { describe: a }), {
|
|
93
|
-
kind: e.kind,
|
|
94
|
-
schema: e.schema,
|
|
95
|
-
getDefaultValue: e.value?.default,
|
|
96
|
-
normalizeValue: e.value?.normalize,
|
|
97
|
-
cloneValue: e.value?.clone,
|
|
98
|
-
isEqual: e.value?.isEqual,
|
|
99
|
-
serializeValue: e.value?.serialize,
|
|
100
|
-
validate: n.validate,
|
|
101
|
-
describe: a,
|
|
102
|
-
definition: n,
|
|
103
|
-
presenter: i
|
|
104
|
-
};
|
|
105
|
-
}, a = (e) => {
|
|
106
|
-
let n = {
|
|
107
|
-
kind: e.kind,
|
|
108
|
-
schema: e.schema,
|
|
109
|
-
payloadSchema: e.payloadSchema,
|
|
110
|
-
payloadValidationPolicy: e.payloadValidationPolicy,
|
|
111
|
-
partialUpdatePolicy: e.partialUpdatePolicy,
|
|
112
|
-
clonePayload: e.clonePayload,
|
|
113
|
-
resolvePayload: (t, n) => e.resolve({
|
|
114
|
-
config: n.report,
|
|
115
|
-
report: n.report,
|
|
116
|
-
result: n.result
|
|
117
|
-
})
|
|
118
|
-
}, r = {
|
|
119
|
-
kind: e.kind,
|
|
120
|
-
describe(n, r) {
|
|
121
|
-
if (r.payload === void 0 && r.state.error === null) return null;
|
|
122
|
-
let i = {
|
|
123
|
-
config: n,
|
|
124
|
-
report: n,
|
|
125
|
-
reportId: n.id,
|
|
126
|
-
state: r.state,
|
|
127
|
-
payload: r.payload,
|
|
128
|
-
result: r.result
|
|
129
|
-
};
|
|
130
|
-
return {
|
|
131
|
-
component: "declarative-report",
|
|
132
|
-
props: {
|
|
133
|
-
id: n.id,
|
|
134
|
-
kind: n.kind,
|
|
135
|
-
label: n.label ?? n.id,
|
|
136
|
-
description: n.description ?? "",
|
|
137
|
-
payload: r.payload,
|
|
138
|
-
error: r.state.error,
|
|
139
|
-
state: r.state.status,
|
|
140
|
-
summary: e.render.summary?.(i) ?? null,
|
|
141
|
-
content: t(e.render.content(i)),
|
|
142
|
-
...n.ui
|
|
143
|
-
},
|
|
144
|
-
meta: { declarative: !0 }
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
}, i = r.describe.bind(r);
|
|
148
|
-
return Object.assign(n, { describe: i }), {
|
|
149
|
-
kind: e.kind,
|
|
150
|
-
schema: e.schema,
|
|
151
|
-
payloadSchema: e.payloadSchema,
|
|
152
|
-
payloadValidationPolicy: e.payloadValidationPolicy,
|
|
153
|
-
partialUpdatePolicy: e.partialUpdatePolicy,
|
|
154
|
-
clonePayload: n.clonePayload,
|
|
155
|
-
resolvePayload: n.resolvePayload,
|
|
156
|
-
describe: i,
|
|
157
|
-
definition: n,
|
|
158
|
-
presenter: r
|
|
159
|
-
};
|
|
160
|
-
}, o = (e, t, n) => {
|
|
161
|
-
e.registerField(n.definition), t.registerField(n.presenter);
|
|
162
|
-
}, s = (e, t, n) => {
|
|
163
|
-
e.registerReport(n.definition), t.registerReport(n.presenter);
|
|
164
|
-
}, c = (e, t, n) => {
|
|
165
|
-
e.registerExplanation(n.definition), t.registerExplanation(n.presenter);
|
|
166
|
-
}, l = class t {
|
|
167
|
-
fieldPresenters = /* @__PURE__ */ new Map();
|
|
168
|
-
reportPresenters = /* @__PURE__ */ new Map();
|
|
169
|
-
explanationPresenters = /* @__PURE__ */ new Map();
|
|
170
|
-
registerField(t) {
|
|
171
|
-
if (this.fieldPresenters.has(t.kind)) throw new e(`Field presenter "${t.kind}" is already registered.`);
|
|
172
|
-
return this.fieldPresenters.set(t.kind, t), this;
|
|
173
|
-
}
|
|
174
|
-
registerReport(t) {
|
|
175
|
-
if (this.reportPresenters.has(t.kind)) throw new e(`Report presenter "${t.kind}" is already registered.`);
|
|
176
|
-
return this.reportPresenters.set(t.kind, t), this;
|
|
177
|
-
}
|
|
178
|
-
registerExplanation(t) {
|
|
179
|
-
if (this.explanationPresenters.has(t.kind)) throw new e(`Explanation presenter "${t.kind}" is already registered.`);
|
|
180
|
-
return this.explanationPresenters.set(t.kind, t), this;
|
|
181
|
-
}
|
|
182
|
-
getField(e) {
|
|
183
|
-
return this.fieldPresenters.get(e);
|
|
184
|
-
}
|
|
185
|
-
getReport(e) {
|
|
186
|
-
return this.reportPresenters.get(e);
|
|
187
|
-
}
|
|
188
|
-
getExplanation(e) {
|
|
189
|
-
return this.explanationPresenters.get(e);
|
|
190
|
-
}
|
|
191
|
-
clone() {
|
|
192
|
-
let e = new t();
|
|
193
|
-
for (let t of this.fieldPresenters.values()) e.registerField(t);
|
|
194
|
-
for (let t of this.reportPresenters.values()) e.registerReport(t);
|
|
195
|
-
for (let t of this.explanationPresenters.values()) e.registerExplanation(t);
|
|
196
|
-
return e;
|
|
197
|
-
}
|
|
198
|
-
}, u = () => new l();
|
|
199
|
-
//#endregion
|
|
200
|
-
export { s as a, n as c, o as i, t as l, u as n, a as o, c as r, i as s, l as t };
|
package/dist/strings-CWwrrYzz.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { RuntimeBehavior } from '../runtime/types';
|
|
2
|
-
export declare const createMappedCategoryBehavior: () => RuntimeBehavior;
|
|
3
|
-
export type { RuntimeBehavior, RuntimeBehaviorContext, RuntimeBehaviorSubmissionRecords, RuntimeBehaviorValueChangeEvent, } from '../runtime/types';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { classifierReportDefinition, regressorReportDefinition } from './definitions';
|
|
2
|
-
import { Registry } from '../schema';
|
|
3
|
-
export { classifierReportDefinition, regressorReportDefinition };
|
|
4
|
-
export declare const createBuiltinMlRegistry: () => Registry;
|
|
5
|
-
export declare const createMlRegistryPack: () => import('../packs').RegistryPack;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { collectLayoutReferences, createFormView, defaultKitDesignSystem, defaultKitLabels, flattenLayoutNodes, mountForm, mountAccordionForm, mountTabsForm, mountWizardForm, unmountForm, walkLayoutNodes, } from './kit';
|
|
2
|
-
export { assertPayloadWithinLimits, assertTransportCapabilities, cloneCapabilities, createFanoutTransport, createFallbackTransport, createGraphqlTransport, createGrpcSessionTransport, createGrpcStreamTransport, createGrpcTransport, createGrpcUnaryTransport, createHedgedTransport, createJsonTransport, createLoadBalancedTransport, createMemoryCircuitBreakerState, createMemorySharedRateLimiter, createMemoryTransportCacheStore, createMemoryTransportHealthState, createPipelineTransport, createQuorumFanoutTransport, createRacingTransport, createRoutingTransport, createSessionTransport, createSseTransport, createWebSocketSessionTransport, createWeightedRoutingTransport, inferTransportCapabilities, mergeTransportCapabilities, normalizeTransportCapabilities, pipe, transportDefaults, transportErrorMessages, transportErrorCodes, TransportError, withAuth, withCache, withCircuitBreaker, withDedup, withLogging, withMetrics, withRateLimit, withRequestTransform, withResponseTransform, withRetry, withTracing, withTimeout, } from './transport';
|
|
3
|
-
export type { ApiKeyAuthOptions, AuthOptions, BearerAuthOptions, CacheOptions, CapabilityRequirement, CircuitBreakerOptions, CircuitBreakerSharedState, CircuitBreakerStateSnapshot, CustomAuthOptions, DedupOptions, FanoutTransportFailure, FanoutTransportOptions, FanoutTransportResult, FallbackTransportFailure, FallbackTransportOptions, GraphqlTransportOptions, GrpcSessionTransportOptions, GrpcStreamTransportOptions, GrpcTransportOptions, GrpcUnaryTransportOptions, HedgedTransportOptions, JsonTransportMethod, JsonTransportOptions, LoadBalancingTransportOptions, PipelineStage, PipelineTransportOptions, QuorumFanoutTransportOptions, RateLimitLeaseRequest, RateLimitOptions, RacingTransportOptions, RetryOptions, RoutingTransportOptions, SessionTransportOptions, SharedRateLimiter, SharedRateLimiterLease, SseTransportOptions, TransportBackpressureMode, TransportCacheEntry, TransportCacheStore, TransportCapabilities, TransportCollection, TransportConsistency, TransportContextAuthOptions, TransportDeliveryMode, TransportErrorCode, TransportHealthSnapshot, TransportHealthState, TransportLogOptions, TransportMetricsOptions, TransportMiddleware, TransportTelemetryEvent, TransportTraceOptions, WebSocketSessionTransportOptions, WeightedRoutingTransportOptions, } from './transport';
|
|
4
|
-
export type { AccordionLayoutConfig, AccordionMountUiOptions, AccordionSectionConfig, AccordionState, CreateFormViewOptions, FormLayoutConfig, FormLayoutExplanationNode, FormLayoutFieldNode, FormLayoutGroupNode, FormLayoutNode, FormLayoutReportNode, FormLayoutSectionNode, FormViewController, FormViewExplanationItem, FormViewFieldItem, FormViewReportItem, FormViewSnapshot, FormViewState, KitDesignSystemSnapshot, KitLabels, MountedAccordionForm, MountFormOptions, MountedForm, MountedTabsForm, MountedWizardForm, MountAccordionFormOptions, MountTabsFormOptions, MountWizardFormOptions, PanelState, ResolvedAccordionLayout, ResolvedAccordionSection, ResolvedFormLayout, ResolvedFormLayoutExplanationNode, ResolvedFormLayoutFieldNode, ResolvedFormLayoutGroupNode, ResolvedFormLayoutNode, ResolvedFormLayoutReportNode, ResolvedFormLayoutSectionNode, ResolvedTabLayout, ResolvedTabsLayout, TabLayoutConfig, TabsLayoutConfig, TabsState, WizardLayoutConfig, WizardState, WizardStepConfig, } from './kit';
|
|
5
|
-
export type { ExplanationRequest, ExplanationTransport, PrimitiveFieldRenderContext, PrimitiveExplanationRenderContext, PrimitiveExplanationRendererElement, PrimitiveFieldRendererElement, PrimitiveReportRenderContext, PrimitiveReportRendererElement, } from './primitives';
|
|
6
|
-
export { createExplanationController, executeExplanations, executeFormPipeline } from './runtime';
|
|
7
|
-
export { createRegistry, defineExplanationDefinition, defineFieldDefinition, defineReportDefinition, } from './schema';
|
|
8
|
-
export { defineExplanationKind, defineFieldKind, defineReportKind, toPresentationNodes, } from './presentation';
|
|
9
|
-
export { createBuiltinMlRegistry, createMlRegistryPack } from './builtins-ml';
|
|
10
|
-
export { createMappedCategoryBehavior } from './behaviors';
|
|
11
|
-
export { createDefaultRegistryPack } from './packs';
|
|
12
|
-
export type { AfterExplanationContext, ExplanationConfig, ExplanationController, ExplanationDefinition, ExplanationErrorContext, ExplanationExecutionContext, ExplanationExecutionResult, ExplanationFetchContext, ExplanationFetchFactory, ExplanationFetchRequest, ExplanationFetchTransport, ExplanationStateSnapshot, ExplanationStatus, FieldValidationFnContext, FieldValueAdapter, NormalizedExplanationConfig, PipelineArtifactAdapter, PipelineArtifactContext, PipelineResult, ExecuteFormPipelineOptions, ReportResolveContext, } from './runtime';
|
|
13
|
-
export type { DeclarativeExplanationKind, DeclarativeFieldKind, DeclarativeReportKind, ExplanationDescriptor, ExplanationDescriptorContext, ExplanationRenderSpec, ExplanationRenderSpecContext, FieldDescriptor, FieldRenderHints, FieldRenderSpec, FieldRenderSpecContext, FieldWidget, PresentationContent, PresentationNode, PresentationSummary, PresentationTone, ReportDescriptor, ReportRenderSpec, ReportRenderSpecContext, } from './presentation';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const accordionRootStyles: import('lit').CSSResult;
|
package/dist/types/kit/tabs.d.ts
DELETED
package/dist/types/packs/ml.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ExplanationPresenter, FieldPresenter, PresentationRegistry, ReportPresenter } from '../presentation';
|
|
2
|
-
import { RuntimeBehavior } from '../runtime';
|
|
3
|
-
import { ExplanationConfig, FieldConfig, Registry, ReportConfig } from '../schema';
|
|
4
|
-
type DescriptorCapableFieldDefinition = {
|
|
5
|
-
kind: string;
|
|
6
|
-
describe?: FieldPresenter<FieldConfig, unknown>["describe"];
|
|
7
|
-
};
|
|
8
|
-
type DescriptorCapableReportDefinition = {
|
|
9
|
-
kind: string;
|
|
10
|
-
describe?: ReportPresenter<ReportConfig>["describe"];
|
|
11
|
-
};
|
|
12
|
-
type DescriptorCapableExplanationDefinition = {
|
|
13
|
-
kind: string;
|
|
14
|
-
describe?: ExplanationPresenter<ExplanationConfig>["describe"];
|
|
15
|
-
};
|
|
16
|
-
export type RegistryPack = {
|
|
17
|
-
registry: Registry;
|
|
18
|
-
presentationRegistry: PresentationRegistry;
|
|
19
|
-
behaviors: RuntimeBehavior[];
|
|
20
|
-
};
|
|
21
|
-
export declare const registerFieldPresenterFromDefinition: (presentationRegistry: PresentationRegistry, definition: DescriptorCapableFieldDefinition) => void;
|
|
22
|
-
export declare const registerReportPresenterFromDefinition: (presentationRegistry: PresentationRegistry, definition: DescriptorCapableReportDefinition) => void;
|
|
23
|
-
export declare const registerExplanationPresenterFromDefinition: (presentationRegistry: PresentationRegistry, definition: DescriptorCapableExplanationDefinition) => void;
|
|
24
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ExplanationConfig, ExplanationDefinition, NormalizedExplanationConfig } from '../schema';
|
|
2
|
-
import { DeclarativeExplanationKind, ExplanationDescriptor, ExplanationDescriptorContext, ExplanationPresenter } from './index';
|
|
3
|
-
export type DefinedExplanationKind<TConfig extends ExplanationConfig, _TResult> = {
|
|
4
|
-
kind: string;
|
|
5
|
-
schema: import('zod').ZodType<TConfig>;
|
|
6
|
-
transport: ExplanationDefinition<TConfig>["transport"];
|
|
7
|
-
describe?: (config: NormalizedExplanationConfig<TConfig>, context: ExplanationDescriptorContext) => ExplanationDescriptor | null;
|
|
8
|
-
definition: ExplanationDefinition<TConfig>;
|
|
9
|
-
presenter: ExplanationPresenter<TConfig>;
|
|
10
|
-
};
|
|
11
|
-
export declare const defineExplanationKind: <TConfig extends ExplanationConfig, TResult>(kind: DeclarativeExplanationKind<TConfig, TResult>) => DefinedExplanationKind<TConfig, TResult>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NormalizedReportConfig, ReportConfig, ReportDefinition } from '../schema';
|
|
2
|
-
import { DeclarativeReportKind, ReportDescriptor, ReportDescriptorContext, ReportPresenter } from './index';
|
|
3
|
-
export type DefinedReportKind<TConfig extends ReportConfig, _TPayload> = {
|
|
4
|
-
kind: string;
|
|
5
|
-
schema: import('zod').ZodType<TConfig>;
|
|
6
|
-
payloadSchema?: ReportDefinition<TConfig>["payloadSchema"];
|
|
7
|
-
payloadValidationPolicy?: ReportDefinition<TConfig>["payloadValidationPolicy"];
|
|
8
|
-
partialUpdatePolicy?: ReportDefinition<TConfig>["partialUpdatePolicy"];
|
|
9
|
-
clonePayload?: ReportDefinition<TConfig>["clonePayload"];
|
|
10
|
-
resolvePayload?: ReportDefinition<TConfig>["resolvePayload"];
|
|
11
|
-
describe?: (config: NormalizedReportConfig<TConfig>, context: ReportDescriptorContext) => ReportDescriptor | null;
|
|
12
|
-
definition: ReportDefinition<TConfig>;
|
|
13
|
-
presenter: ReportPresenter<TConfig>;
|
|
14
|
-
};
|
|
15
|
-
export declare const defineReportKind: <TConfig extends ReportConfig, TPayload>(kind: DeclarativeReportKind<TConfig, TPayload>) => DefinedReportKind<TConfig, TPayload>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { defineExplanationKind, type DefinedExplanationKind } from './define-explanation-kind';
|
|
2
|
-
export { defineFieldKind, type DefinedFieldKind } from './define-field-kind';
|
|
3
|
-
export { defineReportKind, type DefinedReportKind } from './define-report-kind';
|
|
4
|
-
export { registerDefinedExplanationKind, registerDefinedFieldKind, registerDefinedReportKind, } from './register-kind';
|
|
5
|
-
export { createPresentationRegistry, PresentationRegistry } from './registry';
|
|
6
|
-
export { toPresentationNodes } from './types/presentation';
|
|
7
|
-
export type * from './types/explanation';
|
|
8
|
-
export type * from './types/field';
|
|
9
|
-
export type * from './types/presentation';
|
|
10
|
-
export type * from './types/report';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Registry } from '../schema';
|
|
2
|
-
import { DefinedExplanationKind, DefinedFieldKind, DefinedReportKind } from './index';
|
|
3
|
-
import { PresentationRegistry } from './registry';
|
|
4
|
-
export declare const registerDefinedFieldKind: <TConfig extends import('../schema').FieldConfig, TValue>(registry: Registry, presentationRegistry: PresentationRegistry, kind: DefinedFieldKind<TConfig, TValue>) => void;
|
|
5
|
-
export declare const registerDefinedReportKind: <TConfig extends import('../schema').ReportConfig>(registry: Registry, presentationRegistry: PresentationRegistry, kind: DefinedReportKind<TConfig, unknown>) => void;
|
|
6
|
-
export declare const registerDefinedExplanationKind: <TConfig extends import('../schema').ExplanationConfig>(registry: Registry, presentationRegistry: PresentationRegistry, kind: DefinedExplanationKind<TConfig, unknown>) => void;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BaseExplanationConfig, BaseFieldConfig, BaseReportConfig } from '../schema';
|
|
2
|
-
import { ExplanationPresenter, FieldPresenter, ReportPresenter } from './index';
|
|
3
|
-
export declare class PresentationRegistry {
|
|
4
|
-
private readonly fieldPresenters;
|
|
5
|
-
private readonly reportPresenters;
|
|
6
|
-
private readonly explanationPresenters;
|
|
7
|
-
registerField<TConfig extends BaseFieldConfig, TValue>(presenter: FieldPresenter<TConfig, TValue>): this;
|
|
8
|
-
registerReport<TConfig extends BaseReportConfig>(presenter: ReportPresenter<TConfig>): this;
|
|
9
|
-
registerExplanation<TConfig extends BaseExplanationConfig>(presenter: ExplanationPresenter<TConfig>): this;
|
|
10
|
-
getField(kind: string): FieldPresenter<BaseFieldConfig, unknown> | undefined;
|
|
11
|
-
getReport(kind: string): ReportPresenter<BaseReportConfig> | undefined;
|
|
12
|
-
getExplanation(kind: string): ExplanationPresenter<BaseExplanationConfig> | undefined;
|
|
13
|
-
clone(): PresentationRegistry;
|
|
14
|
-
}
|
|
15
|
-
export declare const createPresentationRegistry: () => PresentationRegistry;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ExplanationConfig, ExplanationFetchFactory, ExplanationStateSnapshot, NormalizedExplanationConfig } from '../../schema';
|
|
2
|
-
import { ZodType } from 'zod';
|
|
3
|
-
import { PresentationContent, PresentationSummary } from './presentation';
|
|
4
|
-
export interface ExplanationDescriptor {
|
|
5
|
-
component: string;
|
|
6
|
-
props: Record<string, unknown>;
|
|
7
|
-
meta?: Record<string, unknown>;
|
|
8
|
-
}
|
|
9
|
-
export interface ExplanationDescriptorContext {
|
|
10
|
-
explanationId: string;
|
|
11
|
-
state: ExplanationStateSnapshot;
|
|
12
|
-
}
|
|
13
|
-
export interface ExplanationRenderSpecContext<TConfig extends ExplanationConfig = ExplanationConfig, TResult = unknown> {
|
|
14
|
-
config: NormalizedExplanationConfig<TConfig>;
|
|
15
|
-
explanationId: string;
|
|
16
|
-
state: ExplanationStateSnapshot;
|
|
17
|
-
result: TResult;
|
|
18
|
-
}
|
|
19
|
-
export interface ExplanationRenderSpec<TConfig extends ExplanationConfig = ExplanationConfig, TResult = unknown> {
|
|
20
|
-
summary?: (context: ExplanationRenderSpecContext<TConfig, TResult>) => PresentationSummary | undefined;
|
|
21
|
-
content: (context: ExplanationRenderSpecContext<TConfig, TResult>) => PresentationContent;
|
|
22
|
-
}
|
|
23
|
-
export interface DeclarativeExplanationKind<TConfig extends ExplanationConfig = ExplanationConfig, TResult = unknown> {
|
|
24
|
-
kind: string;
|
|
25
|
-
schema: ZodType<TConfig>;
|
|
26
|
-
fetch: ExplanationFetchFactory<TConfig>;
|
|
27
|
-
render: ExplanationRenderSpec<TConfig, TResult>;
|
|
28
|
-
}
|
|
29
|
-
export interface ExplanationPresenter<TConfig extends ExplanationConfig = ExplanationConfig> {
|
|
30
|
-
kind: string;
|
|
31
|
-
describe(config: NormalizedExplanationConfig<TConfig>, context: ExplanationDescriptorContext): ExplanationDescriptor | null;
|
|
32
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FieldConfig, FieldStateSnapshot, FieldValidationFnContext, FieldValueAdapter, NormalizedFieldConfig } from '../../schema';
|
|
2
|
-
import { ZodType } from 'zod';
|
|
3
|
-
export interface FieldDescriptor {
|
|
4
|
-
component: string;
|
|
5
|
-
props: Record<string, unknown>;
|
|
6
|
-
meta?: Record<string, unknown>;
|
|
7
|
-
}
|
|
8
|
-
export type FieldWidget = "text" | "number" | "boolean" | "select" | "date" | "series";
|
|
9
|
-
export type FieldRenderHints = Record<string, unknown>;
|
|
10
|
-
export interface FieldRenderSpecContext<TConfig extends FieldConfig = FieldConfig, TValue = unknown> {
|
|
11
|
-
config: TConfig;
|
|
12
|
-
fieldId: string;
|
|
13
|
-
state: FieldStateSnapshot;
|
|
14
|
-
value: TValue;
|
|
15
|
-
}
|
|
16
|
-
export interface FieldRenderSpec<TConfig extends FieldConfig = FieldConfig, TValue = unknown> {
|
|
17
|
-
widget: FieldWidget;
|
|
18
|
-
hints?: FieldRenderHints | ((context: FieldRenderSpecContext<TConfig, TValue>) => FieldRenderHints);
|
|
19
|
-
}
|
|
20
|
-
export interface DeclarativeFieldKind<TConfig extends FieldConfig = FieldConfig, TValue = unknown> {
|
|
21
|
-
kind: string;
|
|
22
|
-
schema: ZodType<TConfig>;
|
|
23
|
-
value?: FieldValueAdapter<TConfig, TValue>;
|
|
24
|
-
validate?: (context: FieldValidationFnContext<TConfig, TValue>) => string[] | PromiseLike<string[]>;
|
|
25
|
-
render: FieldRenderSpec<TConfig, TValue>;
|
|
26
|
-
}
|
|
27
|
-
export interface FieldDescriptorContext {
|
|
28
|
-
fieldId: string;
|
|
29
|
-
state: FieldStateSnapshot;
|
|
30
|
-
}
|
|
31
|
-
export interface FieldPresenter<TConfig extends FieldConfig = FieldConfig, TValue = unknown> {
|
|
32
|
-
kind: string;
|
|
33
|
-
describe(config: NormalizedFieldConfig<TConfig>, context: FieldDescriptorContext & {
|
|
34
|
-
value: TValue;
|
|
35
|
-
}): FieldDescriptor;
|
|
36
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export type PresentationTone = "neutral" | "info" | "success" | "warning" | "danger";
|
|
2
|
-
export interface PresentationSummary {
|
|
3
|
-
title?: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
value?: unknown;
|
|
6
|
-
badge?: string;
|
|
7
|
-
tone?: PresentationTone;
|
|
8
|
-
}
|
|
9
|
-
export interface PresentationTextNode {
|
|
10
|
-
type: "text";
|
|
11
|
-
label?: string;
|
|
12
|
-
value: unknown;
|
|
13
|
-
tone?: PresentationTone;
|
|
14
|
-
}
|
|
15
|
-
export interface PresentationMetricNode {
|
|
16
|
-
type: "metric";
|
|
17
|
-
label: string;
|
|
18
|
-
value: unknown;
|
|
19
|
-
hint?: string;
|
|
20
|
-
tone?: PresentationTone;
|
|
21
|
-
}
|
|
22
|
-
export interface PresentationKeyValueEntry {
|
|
23
|
-
label: string;
|
|
24
|
-
value: unknown;
|
|
25
|
-
}
|
|
26
|
-
export interface PresentationKeyValueNode {
|
|
27
|
-
type: "kv";
|
|
28
|
-
label?: string;
|
|
29
|
-
entries: PresentationKeyValueEntry[] | Record<string, unknown>;
|
|
30
|
-
}
|
|
31
|
-
export interface PresentationListNode {
|
|
32
|
-
type: "list";
|
|
33
|
-
label?: string;
|
|
34
|
-
items: unknown[];
|
|
35
|
-
ordered?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface PresentationTableNode {
|
|
38
|
-
type: "table";
|
|
39
|
-
label?: string;
|
|
40
|
-
columns: string[];
|
|
41
|
-
rows: Array<Record<string, unknown> | unknown[]>;
|
|
42
|
-
}
|
|
43
|
-
export interface PresentationBadgeNode {
|
|
44
|
-
type: "badge";
|
|
45
|
-
label: string;
|
|
46
|
-
tone?: PresentationTone;
|
|
47
|
-
}
|
|
48
|
-
export interface PresentationNoticeNode {
|
|
49
|
-
type: "notice";
|
|
50
|
-
title?: string;
|
|
51
|
-
body: unknown;
|
|
52
|
-
tone?: PresentationTone;
|
|
53
|
-
}
|
|
54
|
-
export interface PresentationJsonNode {
|
|
55
|
-
type: "json";
|
|
56
|
-
label?: string;
|
|
57
|
-
value: unknown;
|
|
58
|
-
}
|
|
59
|
-
export type PresentationNode = PresentationTextNode | PresentationMetricNode | PresentationKeyValueNode | PresentationListNode | PresentationTableNode | PresentationBadgeNode | PresentationNoticeNode | PresentationJsonNode;
|
|
60
|
-
export type PresentationContent = PresentationNode | PresentationNode[];
|
|
61
|
-
export declare const toPresentationNodes: (value: PresentationContent | undefined) => PresentationNode[];
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { NormalizedReportConfig, ReportConfig, ReportResolveContext, ReportStateSnapshot } from '../../schema';
|
|
2
|
-
import { SubmitResult } from '../../runtime/types/transport';
|
|
3
|
-
import { ZodType } from 'zod';
|
|
4
|
-
import { PresentationContent, PresentationSummary } from './presentation';
|
|
5
|
-
export interface ReportDescriptor {
|
|
6
|
-
component: string;
|
|
7
|
-
props: Record<string, unknown>;
|
|
8
|
-
meta?: Record<string, unknown>;
|
|
9
|
-
}
|
|
10
|
-
export interface ReportDescriptorContext {
|
|
11
|
-
reportId: string;
|
|
12
|
-
state: ReportStateSnapshot;
|
|
13
|
-
payload: unknown;
|
|
14
|
-
result: SubmitResult | null;
|
|
15
|
-
}
|
|
16
|
-
export interface ReportRenderSpecContext<TConfig extends ReportConfig = ReportConfig, TPayload = unknown> {
|
|
17
|
-
config: NormalizedReportConfig<TConfig>;
|
|
18
|
-
report: NormalizedReportConfig<TConfig>;
|
|
19
|
-
reportId: string;
|
|
20
|
-
state: ReportStateSnapshot;
|
|
21
|
-
payload: TPayload;
|
|
22
|
-
result: SubmitResult | null;
|
|
23
|
-
}
|
|
24
|
-
export interface ReportRenderSpec<TConfig extends ReportConfig = ReportConfig, TPayload = unknown> {
|
|
25
|
-
summary?: (context: ReportRenderSpecContext<TConfig, TPayload>) => PresentationSummary | undefined;
|
|
26
|
-
content: (context: ReportRenderSpecContext<TConfig, TPayload>) => PresentationContent;
|
|
27
|
-
}
|
|
28
|
-
export interface DeclarativeReportKind<TConfig extends ReportConfig = ReportConfig, TPayload = unknown> {
|
|
29
|
-
kind: string;
|
|
30
|
-
schema: ZodType<TConfig>;
|
|
31
|
-
payloadSchema?: ZodType<unknown>;
|
|
32
|
-
payloadValidationPolicy?: "report-error" | "fail-submit";
|
|
33
|
-
partialUpdatePolicy?: "trust" | "validate" | "defer";
|
|
34
|
-
clonePayload?: (payload: TPayload, config: TConfig) => TPayload;
|
|
35
|
-
resolve: (context: ReportResolveContext<TConfig>) => unknown;
|
|
36
|
-
render: ReportRenderSpec<TConfig, TPayload>;
|
|
37
|
-
}
|
|
38
|
-
export interface ReportPresenter<TConfig extends ReportConfig = ReportConfig> {
|
|
39
|
-
kind: string;
|
|
40
|
-
describe(config: NormalizedReportConfig<TConfig>, context: ReportDescriptorContext): ReportDescriptor | null;
|
|
41
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { LitElement, CSSResultGroup } from 'lit';
|
|
2
|
-
import { ExplanationDescriptor } from '../presentation';
|
|
3
|
-
import { ExplanationController } from '../runtime';
|
|
4
|
-
import { PrimitiveText } from './constants';
|
|
5
|
-
import { PrimitiveExplanationRenderContext } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* Base class for explanation renderer elements.
|
|
8
|
-
*
|
|
9
|
-
* Explanation plugin authors should extend this class and implement `render()`
|
|
10
|
-
* to display the explanation result. The `explanation-panel` frame component
|
|
11
|
-
* drives the fetch lifecycle and passes `controller`, `descriptor`, `context`,
|
|
12
|
-
* and `text` as properties — no second subscription is needed here.
|
|
13
|
-
*/
|
|
14
|
-
export declare abstract class PrimitiveExplanationElement extends LitElement {
|
|
15
|
-
static styles: CSSResultGroup;
|
|
16
|
-
accessor controller: ExplanationController | undefined;
|
|
17
|
-
accessor descriptor: ExplanationDescriptor | null;
|
|
18
|
-
accessor context: PrimitiveExplanationRenderContext | undefined;
|
|
19
|
-
accessor text: PrimitiveText;
|
|
20
|
-
protected get props(): Record<string, unknown>;
|
|
21
|
-
protected get explanationContext(): PrimitiveExplanationRenderContext | undefined;
|
|
22
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PrimitiveExplanationElement } from '../base-explanation-element';
|
|
2
|
-
export declare class PrimitiveDeclarativeExplanationElement extends PrimitiveExplanationElement {
|
|
3
|
-
static styles: import('lit').CSSResultGroup[];
|
|
4
|
-
render(): import('lit').TemplateResult<1>;
|
|
5
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { ExplanationController, SubmitResult } from '../../runtime';
|
|
3
|
-
import { ExplanationDescriptor } from '../../presentation';
|
|
4
|
-
import { primitiveTagNames, PrimitiveText } from '../constants';
|
|
5
|
-
import { PrimitiveRegistry } from '../types';
|
|
6
|
-
export declare class PrimitiveExplanationPanelElement extends LitElement {
|
|
7
|
-
#private;
|
|
8
|
-
static styles: import('lit').CSSResult;
|
|
9
|
-
accessor controller: ExplanationController | undefined;
|
|
10
|
-
accessor registry: PrimitiveRegistry | undefined;
|
|
11
|
-
accessor lastResult: SubmitResult | null;
|
|
12
|
-
accessor text: PrimitiveText;
|
|
13
|
-
accessor descriptor: ExplanationDescriptor | null;
|
|
14
|
-
private accessor resolvedDescriptor;
|
|
15
|
-
private accessor explanationState;
|
|
16
|
-
protected willUpdate(changedProperties: Map<string, unknown>): void;
|
|
17
|
-
disconnectedCallback(): void;
|
|
18
|
-
render(): import('lit').TemplateResult<1>;
|
|
19
|
-
}
|
|
20
|
-
declare global {
|
|
21
|
-
interface HTMLElementTagNameMap {
|
|
22
|
-
[primitiveTagNames.explanationPanel]: PrimitiveExplanationPanelElement;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { nothing, TemplateResult } from 'lit';
|
|
2
|
-
import { PresentationNode, PresentationSummary } from '../../presentation';
|
|
3
|
-
export declare const renderPresentationSummary: (summary: PresentationSummary | null | undefined, fallbackTitle?: string) => TemplateResult | typeof nothing;
|
|
4
|
-
export declare const renderPresentationNodes: (nodes: PresentationNode[]) => TemplateResult | typeof nothing;
|