mlform 0.1.7 → 0.1.8
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 +39 -12
- package/dist/builtins-DegwhFGA.js +3507 -0
- package/dist/builtins-ml-9qB2MOxt.js +51 -0
- package/dist/{design-system-CrrSGfFB.js → design-system-Dxx1Sh7r.js} +284 -268
- package/dist/errors-B3H1wRwj.js +8 -0
- package/dist/kit-CuRF6dhL.js +1847 -0
- package/dist/mlform/behaviors.mjs +32 -0
- package/dist/mlform/builtins-ml.mjs +3 -0
- package/dist/mlform/design-system.mjs +1 -1
- package/dist/mlform/kit.mjs +3 -3
- package/dist/mlform/presentation.mjs +2 -0
- package/dist/mlform/primitives.mjs +2 -2
- package/dist/mlform/runtime.mjs +5 -0
- package/dist/mlform/schema.mjs +102 -0
- package/dist/mlform/transport.mjs +2 -2
- package/dist/mlform.mjs +8 -4
- package/dist/presentation-CkQuYheR.js +200 -0
- package/dist/{primitives-BqjFDDhL.js → primitives-Duag8Lj0.js} +1367 -1312
- package/dist/runtime-DMjDVo0H.js +1824 -0
- package/dist/strings-CWwrrYzz.js +4 -0
- package/dist/{transport-A1RsnZhD.js → transport-CtVX8ZUT.js} +311 -336
- package/dist/types/src/behaviors/index.d.ts +3 -0
- package/dist/types/src/builtins-ml/index.d.ts +5 -0
- package/dist/types/src/design-system/runtime/fingerprint.d.ts +8 -0
- package/dist/types/src/design-system/runtime/host-observer.d.ts +1 -0
- package/dist/types/src/design-system/runtime/hydration-state.d.ts +13 -0
- package/dist/types/src/design-system/runtime/inherited-scheme.d.ts +5 -0
- package/dist/types/src/design-system/runtime/media.d.ts +19 -0
- package/dist/types/src/index.d.ts +10 -4
- package/dist/types/src/kit/accordion-root-styles.d.ts +1 -0
- package/dist/types/src/kit/accordion-root.d.ts +24 -0
- package/dist/types/src/kit/accordion.d.ts +2 -0
- package/dist/types/src/kit/constants.d.ts +29 -0
- package/dist/types/src/kit/defaults.d.ts +2 -2
- package/dist/types/src/kit/index.d.ts +6 -1
- package/dist/types/src/kit/layout-helpers.d.ts +29 -0
- package/dist/types/src/kit/layout-node-render.d.ts +18 -0
- package/dist/types/src/kit/layout-node-resolver.d.ts +3 -0
- package/dist/types/src/kit/layout-types.d.ts +124 -0
- package/dist/types/src/kit/layout-utils.d.ts +9 -0
- package/dist/types/src/kit/layout.d.ts +8 -0
- package/dist/types/src/kit/mount-types.d.ts +54 -0
- package/dist/types/src/kit/panel-nav.d.ts +9 -0
- package/dist/types/src/{questionnaire/primitives/components → kit}/step-indicator.d.ts +3 -3
- package/dist/types/src/kit/tabs-root-styles.d.ts +1 -0
- package/dist/types/src/kit/tabs-root.d.ts +24 -0
- package/dist/types/src/kit/tabs.d.ts +2 -0
- package/dist/types/src/kit/types.d.ts +4 -51
- package/dist/types/src/kit/view-layout-state.d.ts +14 -0
- package/dist/types/src/kit/view-navigation.d.ts +8 -0
- package/dist/types/src/kit/view-snapshot-cache.d.ts +14 -0
- package/dist/types/src/kit/view-snapshot.d.ts +15 -0
- package/dist/types/src/kit/view-types.d.ts +172 -0
- package/dist/types/src/kit/view.d.ts +8 -0
- package/dist/types/src/kit/wizard-constants.d.ts +19 -0
- package/dist/types/src/kit/wizard-root-styles.d.ts +1 -0
- package/dist/types/src/kit/wizard-root.d.ts +23 -0
- package/dist/types/src/kit/wizard.d.ts +2 -0
- package/dist/types/src/packs/default.d.ts +2 -0
- package/dist/types/src/packs/index.d.ts +3 -0
- package/dist/types/src/packs/ml.d.ts +2 -0
- package/dist/types/src/packs/shared.d.ts +25 -0
- package/dist/types/src/presentation/define-explanation-kind.d.ts +11 -0
- package/dist/types/src/presentation/define-field-kind.d.ts +18 -0
- package/dist/types/src/presentation/define-report-kind.d.ts +15 -0
- package/dist/types/src/presentation/index.d.ts +10 -0
- package/dist/types/src/presentation/register-kind.d.ts +6 -0
- package/dist/types/src/presentation/registry.d.ts +15 -0
- package/dist/types/src/presentation/types/explanation.d.ts +32 -0
- package/dist/types/src/presentation/types/field.d.ts +36 -0
- package/dist/types/src/presentation/types/report.d.ts +41 -0
- package/dist/types/src/primitives/base-explanation-element.d.ts +2 -1
- package/dist/types/src/primitives/base-field-element.d.ts +2 -1
- package/dist/types/src/primitives/base-report-element.d.ts +2 -1
- package/dist/types/src/primitives/components/explanation-panel.d.ts +4 -2
- package/dist/types/src/primitives/components/field-frame-feedback.d.ts +9 -0
- package/dist/types/src/primitives/components/field-frame-styles.d.ts +1 -0
- package/dist/types/src/primitives/components/field-frame.d.ts +5 -3
- package/dist/types/src/primitives/components/form-errors.d.ts +1 -1
- package/dist/types/src/primitives/components/form-root-presenters.d.ts +17 -0
- package/dist/types/src/primitives/components/form-root-state.d.ts +19 -0
- package/dist/types/src/primitives/components/form-root-styles.d.ts +1 -0
- package/dist/types/src/primitives/components/form-root-templates.d.ts +42 -0
- package/dist/types/src/primitives/components/form-root.d.ts +4 -2
- package/dist/types/src/primitives/components/presentation.d.ts +1 -1
- package/dist/types/src/primitives/components/report-frame.d.ts +4 -2
- package/dist/types/src/primitives/components/submit-button.d.ts +1 -1
- package/dist/types/src/primitives/constants.d.ts +1 -1
- package/dist/types/src/primitives/fields/series-field-helpers.d.ts +23 -0
- package/dist/types/src/primitives/fields/series-field-styles.d.ts +1 -0
- package/dist/types/src/primitives/mount-form.d.ts +1 -1
- package/dist/types/src/primitives/presentation.d.ts +8 -0
- package/dist/types/src/primitives/types.d.ts +4 -1
- package/dist/types/src/{engine → runtime}/builtins/index.d.ts +1 -3
- package/dist/types/src/{engine → runtime}/builtins/reports/classifier.d.ts +1 -1
- package/dist/types/src/{engine → runtime}/builtins/shared.d.ts +2 -0
- package/dist/types/src/runtime/declarative/presentation.d.ts +61 -0
- package/dist/types/src/runtime/fields/state-calculations.d.ts +25 -0
- package/dist/types/src/runtime/fields/state.d.ts +2 -0
- package/dist/types/src/runtime/form.d.ts +1 -0
- package/dist/types/src/runtime/index.d.ts +16 -0
- package/dist/types/src/runtime/registry/index.d.ts +5 -0
- package/dist/types/src/runtime/runtime-behaviors.d.ts +23 -0
- package/dist/types/src/runtime/runtime-controller.d.ts +34 -0
- package/dist/types/src/runtime/runtime-refresh.d.ts +14 -0
- package/dist/types/src/runtime/runtime-values.d.ts +19 -0
- package/dist/types/src/runtime/submission/create-submitter.d.ts +2 -0
- package/dist/types/src/runtime/submission/error-flow.d.ts +19 -0
- package/dist/types/src/runtime/submission/field-updates.d.ts +14 -0
- package/dist/types/src/runtime/submission/report-updates.d.ts +16 -0
- package/dist/types/src/runtime/submission/stream-progress.d.ts +4 -0
- package/dist/types/src/runtime/submission/submitter.d.ts +2 -0
- package/dist/types/src/runtime/submission/types.d.ts +60 -0
- package/dist/types/src/runtime/types/behavior.d.ts +32 -0
- package/dist/types/src/runtime/types/explanation.d.ts +22 -0
- package/dist/types/src/runtime/types/field.d.ts +24 -0
- package/dist/types/src/{engine → runtime}/types/form.d.ts +8 -11
- package/dist/types/src/runtime/types/index.d.ts +9 -0
- package/dist/types/src/runtime/types/registry.d.ts +6 -0
- package/dist/types/src/runtime/types/report.d.ts +23 -0
- package/dist/types/src/{engine → runtime}/utils.d.ts +2 -2
- package/dist/types/src/{engine/validation/field.d.ts → runtime/validation/field-state.d.ts} +3 -19
- package/dist/types/src/runtime/validation/field-validator.d.ts +18 -0
- package/dist/types/src/runtime/validation/field.d.ts +2 -0
- package/dist/types/src/schema/index.d.ts +7 -0
- package/dist/types/src/schema/normalize.d.ts +2 -0
- package/dist/types/src/schema/registry.d.ts +9 -0
- package/dist/types/src/schema/types/explanation.d.ts +43 -0
- package/dist/types/src/{engine → schema}/types/field.d.ts +3 -45
- package/dist/types/src/schema/types/form.d.ts +13 -0
- package/dist/types/src/schema/types/report.d.ts +43 -0
- package/dist/types/src/shared/index.d.ts +2 -0
- package/dist/types/src/shared/object.d.ts +1 -0
- package/dist/types/src/shared/strings.d.ts +1 -0
- package/dist/types/src/transport/composition/fanout-helpers.d.ts +2 -0
- package/dist/types/src/transport/composition/fanout.d.ts +1 -2
- package/dist/types/src/transport/composition/index.d.ts +1 -0
- package/dist/types/src/transport/composition/quorum-fanout.d.ts +2 -0
- package/dist/types/src/transport/internal-core.d.ts +21 -0
- package/dist/types/src/transport/internal-errors.d.ts +21 -0
- package/dist/types/src/transport/internal-request.d.ts +21 -0
- package/dist/types/src/transport/internal-routing.d.ts +25 -0
- package/dist/types/src/transport/internal-sse.d.ts +14 -0
- package/dist/types/src/transport/internal-stream.d.ts +13 -0
- package/dist/types/src/transport/internal.d.ts +6 -110
- package/dist/types/src/transport/types/options-http.d.ts +85 -0
- package/dist/types/src/transport/types/options-middleware.d.ts +96 -0
- package/dist/types/src/transport/types/options-routing.d.ts +82 -0
- package/dist/types/src/transport/types/options.d.ts +3 -258
- package/package.json +20 -8
- package/dist/engine-CEy1IX7y.js +0 -5367
- package/dist/kit-DrrbtxI2.js +0 -76
- package/dist/mlform/engine.mjs +0 -3
- package/dist/mlform/questionnaire.mjs +0 -640
- package/dist/types/src/engine/index.d.ts +0 -11
- package/dist/types/src/engine/registry/index.d.ts +0 -26
- package/dist/types/src/engine/submission/submitter.d.ts +0 -40
- package/dist/types/src/engine/types/explanation.d.ts +0 -109
- package/dist/types/src/engine/types/index.d.ts +0 -9
- package/dist/types/src/engine/types/report.d.ts +0 -87
- package/dist/types/src/questionnaire/constants.d.ts +0 -31
- package/dist/types/src/questionnaire/defaults.d.ts +0 -8
- package/dist/types/src/questionnaire/engine/controller.d.ts +0 -12
- package/dist/types/src/questionnaire/engine/schema.d.ts +0 -9
- package/dist/types/src/questionnaire/errors.d.ts +0 -3
- package/dist/types/src/questionnaire/index.d.ts +0 -6
- package/dist/types/src/questionnaire/mount.d.ts +0 -3
- package/dist/types/src/questionnaire/primitives/components/questionnaire-root.d.ts +0 -23
- package/dist/types/src/questionnaire/primitives/register.d.ts +0 -0
- package/dist/types/src/questionnaire/types.d.ts +0 -69
- package/dist/types/src/{engine/declarative → presentation/types}/presentation.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/boolean.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/category.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/date.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/long-text.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/mapped-category.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/multi-choice.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/number.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/rating.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/series.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/single-choice.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/fields/text.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/builtins/reports/regressor.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/comparison.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/constants.d.ts +0 -0
- package/dist/types/src/{engine/form.d.ts → runtime/create-runtime.d.ts} +0 -0
- package/dist/types/src/{engine → runtime}/declarative/explanation.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/declarative/field.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/declarative/report.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/equality.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/errors.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/explanations/controller.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/explanations/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/fields/controller.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/fields/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/paths.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/reports/controller.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/reports/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/schema/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/state/engine.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/state/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/state/snapshots.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/state/store.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/abort.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/explanations.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/lifecycle.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/pipeline.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/reports.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/request.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/submission/result.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/types/pipeline.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/types/transport.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/validation/conditions.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/validation/form.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/validation/index.d.ts +0 -0
- package/dist/types/src/{engine → runtime}/values.d.ts +0 -0
- package/dist/types/src/{engine → schema}/types/registry.d.ts +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RuntimeBehavior } from '../../runtime/types';
|
|
2
|
+
export declare const createMappedCategoryBehavior: () => RuntimeBehavior;
|
|
3
|
+
export type { RuntimeBehavior, RuntimeBehaviorContext, RuntimeBehaviorSubmissionRecords, RuntimeBehaviorValueChangeEvent, } from '../../runtime/types';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { classifierReportDefinition, regressorReportDefinition } from '../../runtime/builtins';
|
|
2
|
+
import { Registry } from '../../schema';
|
|
3
|
+
export { classifierReportDefinition, regressorReportDefinition };
|
|
4
|
+
export declare const createBuiltinMlRegistry: () => Registry;
|
|
5
|
+
export declare const createMlRegistryPack: () => import('../packs').RegistryPack;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DesignSystemConfig } from '../types';
|
|
2
|
+
export type DesignSystemMediaSnapshot = {
|
|
3
|
+
prefersDarkScheme: boolean;
|
|
4
|
+
prefersReducedMotion: boolean;
|
|
5
|
+
prefersMoreContrast: boolean;
|
|
6
|
+
forcedColors: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const fingerprintEnvironment: (config: DesignSystemConfig, media: DesignSystemMediaSnapshot) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const observeHostChain: (host: HTMLElement, observer: MutationObserver | null, observedNodes: Set<Node>) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ResolvedDesignSystem } from '../types';
|
|
2
|
+
export declare const captureOriginalTokenValues: (host: HTMLElement, originalTokenValues: Map<string, string | null>, tokens: Record<string, string>) => void;
|
|
3
|
+
export declare const restoreRemovedTokenValues: (host: HTMLElement, appliedTokens: Set<string>, originalTokenValues: Map<string, string | null>, tokens: Record<string, string>) => void;
|
|
4
|
+
export declare const hostMatchesResolved: (host: HTMLElement, resolved: ResolvedDesignSystem) => boolean;
|
|
5
|
+
export declare const seedHydratedResolvedState: (host: HTMLElement, originalTokenValues: Map<string, string | null>, config: {
|
|
6
|
+
resolved: ResolvedDesignSystem;
|
|
7
|
+
envSnapshot: string;
|
|
8
|
+
}) => {
|
|
9
|
+
appliedTokens: Set<string>;
|
|
10
|
+
resolved: ResolvedDesignSystem;
|
|
11
|
+
signature: string;
|
|
12
|
+
envSnapshot: string;
|
|
13
|
+
} | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DesignSystemConfig, DesignSystemScheme, EffectiveModeSource } from '../types';
|
|
2
|
+
export declare const resolveInheritedScheme: (host: HTMLElement, config: DesignSystemConfig) => {
|
|
3
|
+
scheme: DesignSystemScheme | null;
|
|
4
|
+
source: Extract<EffectiveModeSource, "host-attribute" | "host-style" | "host-resolver"> | null;
|
|
5
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DesignSystemMediaSnapshot } from './fingerprint';
|
|
2
|
+
export type MediaQueryListWithLegacy = MediaQueryList & {
|
|
3
|
+
addListener?: (callback: (event: MediaQueryListEvent) => void) => void;
|
|
4
|
+
removeListener?: (callback: (event: MediaQueryListEvent) => void) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const createMediaQueries: () => {
|
|
7
|
+
scheme: MediaQueryListWithLegacy | null;
|
|
8
|
+
motion: MediaQueryListWithLegacy | null;
|
|
9
|
+
contrast: MediaQueryListWithLegacy | null;
|
|
10
|
+
forcedColors: MediaQueryListWithLegacy | null;
|
|
11
|
+
};
|
|
12
|
+
export declare const addMediaListener: (mql: MediaQueryListWithLegacy, fn: () => void) => void;
|
|
13
|
+
export declare const removeMediaListener: (mql: MediaQueryListWithLegacy, fn: () => void) => void;
|
|
14
|
+
export declare const getMediaSnapshot: (queries: {
|
|
15
|
+
scheme: MediaQueryListWithLegacy | null;
|
|
16
|
+
motion: MediaQueryListWithLegacy | null;
|
|
17
|
+
contrast: MediaQueryListWithLegacy | null;
|
|
18
|
+
forcedColors: MediaQueryListWithLegacy | null;
|
|
19
|
+
}) => DesignSystemMediaSnapshot;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
export { defaultKitDesignSystem, defaultKitLabels, mountForm, unmountForm } from '../kit';
|
|
1
|
+
export { collectLayoutReferences, createFormView, defaultKitDesignSystem, defaultKitLabels, flattenLayoutNodes, mountForm, mountAccordionForm, mountTabsForm, mountWizardForm, unmountForm, walkLayoutNodes, } from '../kit';
|
|
2
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
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 { KitDesignSystemSnapshot, KitLabels, MountFormOptions, MountedForm } from '../kit';
|
|
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
5
|
export type { ExplanationRequest, ExplanationTransport, PrimitiveFieldRenderContext, PrimitiveExplanationRenderContext, PrimitiveExplanationRendererElement, PrimitiveFieldRendererElement, PrimitiveReportRenderContext, PrimitiveReportRendererElement, } from '../primitives';
|
|
6
|
-
export { createExplanationController,
|
|
7
|
-
export
|
|
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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const accordionRootStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { PrimitiveText } from '../../primitives/constants';
|
|
3
|
+
import { PrimitiveRegistry } from '../../primitives/types';
|
|
4
|
+
import { kitTagNames } from './constants';
|
|
5
|
+
import { FormViewController } from './types';
|
|
6
|
+
export declare class KitAccordionElement extends LitElement {
|
|
7
|
+
#private;
|
|
8
|
+
static styles: import('lit').CSSResult;
|
|
9
|
+
accessor view: FormViewController | undefined;
|
|
10
|
+
accessor registry: PrimitiveRegistry | undefined;
|
|
11
|
+
accessor primitiveText: PrimitiveText;
|
|
12
|
+
accessor submitLabel: string;
|
|
13
|
+
accessor validatingLabel: string;
|
|
14
|
+
accessor submittingLabel: string;
|
|
15
|
+
private accessor snapshot;
|
|
16
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
render(): import('lit').TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
[kitTagNames.accordion]: KitAccordionElement;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
export declare const kitErrorMessages: {
|
|
2
2
|
readonly invalidDesignSystemSnapshot: "replaceDesignSystem requires an explicit mode, theme, and recipe.";
|
|
3
|
+
readonly fieldDuplicateInLayout: (fieldId: string) => string;
|
|
4
|
+
readonly fieldMissingInLayout: (fieldId: string) => string;
|
|
5
|
+
readonly reportDuplicateInLayout: (reportId: string) => string;
|
|
6
|
+
readonly explanationDuplicateInLayout: (explanationId: string) => string;
|
|
7
|
+
readonly unknownFieldReference: (fieldId: string) => string;
|
|
8
|
+
readonly unknownReportReference: (reportId: string) => string;
|
|
9
|
+
readonly unknownExplanationReference: (explanationId: string) => string;
|
|
10
|
+
readonly wizardRequiresSteps: "Wizard layout must define at least one step.";
|
|
11
|
+
readonly wizardStepEmpty: (stepId: string) => string;
|
|
12
|
+
readonly tabsRequiresTabs: "Tabs layout must define at least one tab.";
|
|
13
|
+
readonly tabEmpty: (tabId: string) => string;
|
|
14
|
+
readonly accordionRequiresSections: "Accordion layout must define at least one section.";
|
|
15
|
+
readonly accordionSectionEmpty: (sectionId: string) => string;
|
|
16
|
+
readonly wizardMissingLayout: "mountWizardForm requires a wizard layout.";
|
|
17
|
+
readonly tabsMissingLayout: "mountTabsForm requires a tabs layout.";
|
|
18
|
+
readonly accordionMissingLayout: "mountAccordionForm requires an accordion layout.";
|
|
19
|
+
readonly nonWizardNextStep: "nextStep() is only available for wizard layouts.";
|
|
20
|
+
readonly nonWizardGoToStep: "goToStep() is only available for wizard layouts.";
|
|
21
|
+
readonly nonTabsSetActiveTab: "setActiveTab() is only available for tabs layouts.";
|
|
22
|
+
readonly nonAccordionToggleSection: "Accordion section controls are only available for accordion layouts.";
|
|
23
|
+
readonly unknownTab: (tabId: string) => string;
|
|
24
|
+
readonly unknownWizardStep: (stepId: string) => string;
|
|
25
|
+
readonly unknownAccordionSection: (sectionId: string) => string;
|
|
26
|
+
};
|
|
27
|
+
export declare const kitTagNames: {
|
|
28
|
+
readonly wizard: "mlf-kit-wizard";
|
|
29
|
+
readonly tabs: "mlf-kit-tabs";
|
|
30
|
+
readonly accordion: "mlf-kit-accordion";
|
|
31
|
+
readonly stepIndicator: "mlf-kit-step-indicator";
|
|
3
32
|
};
|
|
4
33
|
export { transportDefaults as kitTransportDefaults, transportErrorMessages } from '../../transport';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DesignSystemConfig, DesignSystemRegistry } from '../../design-system';
|
|
2
|
-
import { Registry } from '../../
|
|
2
|
+
import { Registry } from '../../runtime';
|
|
3
3
|
import { PrimitiveRegistry } from '../../primitives';
|
|
4
4
|
import { KitLabels } from './types';
|
|
5
5
|
export declare const defaultKitLabels: Required<KitLabels>;
|
|
6
6
|
export declare const defaultKitDesignSystem: DesignSystemConfig;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const cloneSchemaRegistry: (registry?: Registry) => Registry;
|
|
8
8
|
export declare const resolvePrimitiveRegistry: (registry?: PrimitiveRegistry) => PrimitiveRegistry;
|
|
9
9
|
export declare const resolveDesignSystemRegistry: (registry?: DesignSystemRegistry) => DesignSystemRegistry;
|
|
10
10
|
export declare const resolveKitLabels: (labels?: KitLabels) => Required<KitLabels>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export { defaultKitDesignSystem, defaultKitLabels } from './defaults';
|
|
2
|
+
export { mountAccordionForm } from './accordion';
|
|
3
|
+
export { collectLayoutReferences, flattenLayoutNodes, walkLayoutNodes } from './layout-utils';
|
|
2
4
|
export { mountForm, unmountForm } from './mount-form';
|
|
5
|
+
export { mountTabsForm } from './tabs';
|
|
6
|
+
export { createFormView } from './view';
|
|
7
|
+
export { mountWizardForm } from './wizard';
|
|
3
8
|
export { assertPayloadWithinLimits, assertTransportCapabilities, createFanoutTransport, createFallbackTransport, createGraphqlTransport, createGrpcSessionTransport, createGrpcStreamTransport, createGrpcTransport, createGrpcUnaryTransport, createHedgedTransport, createJsonTransport, createLoadBalancedTransport, createMemoryCircuitBreakerState, createMemorySharedRateLimiter, createMemoryTransportCacheStore, createMemoryTransportHealthState, createPipelineTransport, createQuorumFanoutTransport, createRacingTransport, createRoutingTransport, createSseTransport, createSessionTransport, createWebSocketSessionTransport, createWeightedRoutingTransport, pipe, withAuth, withCache, withCircuitBreaker, withDedup, withLogging, withMetrics, withRateLimit, withRequestTransform, withResponseTransform, withRetry, withTracing, withTimeout, } from '../../transport';
|
|
4
|
-
export type { ApiKeyAuthOptions, AuthOptions, BearerAuthOptions, CapabilityRequirement, CacheOptions, CircuitBreakerSharedState, CircuitBreakerOptions, CustomAuthOptions, DedupOptions, FanoutTransportFailure, FanoutTransportOptions, FanoutTransportResult, FallbackTransportFailure, FallbackTransportOptions, GraphqlTransportOptions, GrpcSessionTransportOptions, GrpcStreamTransportOptions, GrpcTransportOptions, GrpcUnaryTransportOptions, HedgedTransportOptions, JsonTransportMethod, JsonTransportOptions, KitDesignSystemSnapshot, KitLabels, LoadBalancingTransportOptions, MountFormOptions, MountedForm, PipelineStage, PipelineTransportOptions, QuorumFanoutTransportOptions, RateLimitLeaseRequest, SharedRateLimiter, SharedRateLimiterLease, SessionTransportOptions, TransportCacheEntry, TransportCacheStore, TransportHealthSnapshot, TransportHealthState, RateLimitOptions, RacingTransportOptions, RetryOptions, RoutingTransportOptions, TransportContextAuthOptions, TransportCollection, TransportMetricsOptions, TransportTelemetryEvent, TransportLogOptions, TransportMiddleware, TransportTraceOptions, SseTransportOptions, WebSocketSessionTransportOptions, WeightedRoutingTransportOptions, } from './types';
|
|
9
|
+
export type { ApiKeyAuthOptions, AuthOptions, BearerAuthOptions, CapabilityRequirement, CacheOptions, CircuitBreakerSharedState, CircuitBreakerOptions, CustomAuthOptions, DedupOptions, FanoutTransportFailure, FanoutTransportOptions, FanoutTransportResult, FallbackTransportFailure, FallbackTransportOptions, GraphqlTransportOptions, GrpcSessionTransportOptions, GrpcStreamTransportOptions, GrpcTransportOptions, GrpcUnaryTransportOptions, HedgedTransportOptions, JsonTransportMethod, JsonTransportOptions, AccordionLayoutConfig, AccordionMountUiOptions, AccordionSectionConfig, AccordionState, CreateFormViewOptions, FormLayoutConfig, FormLayoutExplanationNode, FormLayoutFieldNode, FormLayoutGroupNode, FormLayoutNode, FormLayoutReportNode, FormLayoutSectionNode, FormViewController, FormViewExplanationItem, FormViewFieldItem, FormViewReportItem, FormViewSnapshot, FormViewState, KitDesignSystemSnapshot, KitLabels, LoadBalancingTransportOptions, MountFormOptions, MountedAccordionForm, MountedWizardForm, MountedTabsForm, MountedForm, MountAccordionFormOptions, MountTabsFormOptions, MountWizardFormOptions, PanelState, PipelineStage, PipelineTransportOptions, QuorumFanoutTransportOptions, RateLimitLeaseRequest, SharedRateLimiter, SharedRateLimiterLease, SessionTransportOptions, TransportCacheEntry, TransportCacheStore, TransportHealthSnapshot, TransportHealthState, RateLimitOptions, RacingTransportOptions, RetryOptions, RoutingTransportOptions, TransportContextAuthOptions, TransportCollection, TransportMetricsOptions, TransportTelemetryEvent, TransportLogOptions, TransportMiddleware, TransportTraceOptions, ResolvedAccordionLayout, ResolvedAccordionSection, ResolvedFormLayout, ResolvedFormLayoutExplanationNode, ResolvedFormLayoutFieldNode, ResolvedFormLayoutGroupNode, ResolvedFormLayoutNode, ResolvedFormLayoutReportNode, ResolvedFormLayoutSectionNode, ResolvedTabLayout, ResolvedTabsLayout, SseTransportOptions, TabsLayoutConfig, TabsState, TabLayoutConfig, WebSocketSessionTransportOptions, WizardLayoutConfig, WizardState, WizardStepConfig, WeightedRoutingTransportOptions, } from './types';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ExplanationController, FieldController, ReportController } from '../../runtime';
|
|
2
|
+
import { FormLayoutNode } from './types';
|
|
3
|
+
export type LayoutReferenceMaps = {
|
|
4
|
+
fieldStepIds: Map<string, string>;
|
|
5
|
+
reportStepIds: Map<string, string>;
|
|
6
|
+
explanationStepIds: Map<string, string>;
|
|
7
|
+
fieldTabIds: Map<string, string>;
|
|
8
|
+
reportTabIds: Map<string, string>;
|
|
9
|
+
explanationTabIds: Map<string, string>;
|
|
10
|
+
fieldIdsInLayout: Set<string>;
|
|
11
|
+
reportIdsInLayout: Set<string>;
|
|
12
|
+
explanationIdsInLayout: Set<string>;
|
|
13
|
+
};
|
|
14
|
+
export type EntityMaps = {
|
|
15
|
+
fieldIds: Set<string>;
|
|
16
|
+
reportIds: Set<string>;
|
|
17
|
+
explanationIds: Set<string>;
|
|
18
|
+
};
|
|
19
|
+
export declare const createEntityMaps: (fields: readonly FieldController[], reports: readonly ReportController[], explanations: readonly ExplanationController[]) => EntityMaps;
|
|
20
|
+
export declare const createReferenceMaps: () => LayoutReferenceMaps;
|
|
21
|
+
export declare const nextNodeId: (prefix: string, preferred: string | undefined, counts: Map<string, number>) => string;
|
|
22
|
+
export declare const assertKnownField: (fieldId: string, entities: EntityMaps) => void;
|
|
23
|
+
export declare const assertKnownReport: (reportId: string, entities: EntityMaps) => void;
|
|
24
|
+
export declare const assertKnownExplanation: (explanationId: string, entities: EntityMaps) => void;
|
|
25
|
+
export declare const markField: (fieldId: string, maps: LayoutReferenceMaps, stepId: string | null, tabId: string | null) => void;
|
|
26
|
+
export declare const markReport: (reportId: string, maps: LayoutReferenceMaps, stepId: string | null, tabId: string | null) => void;
|
|
27
|
+
export declare const markExplanation: (explanationId: string, maps: LayoutReferenceMaps, stepId: string | null, tabId: string | null) => void;
|
|
28
|
+
export declare const createDefaultSinglePageNodes: (fields: readonly FieldController[], explanations: readonly ExplanationController[], reports: readonly ReportController[]) => FormLayoutNode[];
|
|
29
|
+
export declare const assertAllFieldsCovered: (fields: readonly FieldController[], maps: LayoutReferenceMaps) => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { nothing, TemplateResult } from 'lit';
|
|
2
|
+
import { PrimitiveText } from '../../primitives/constants';
|
|
3
|
+
import { PrimitiveRegistry } from '../../primitives/types';
|
|
4
|
+
import { FormViewSnapshot, ResolvedFormLayoutNode } from './types';
|
|
5
|
+
type RenderLayoutNodeOptions = {
|
|
6
|
+
node: ResolvedFormLayoutNode;
|
|
7
|
+
snapshot: FormViewSnapshot;
|
|
8
|
+
registry: PrimitiveRegistry | undefined;
|
|
9
|
+
primitiveText?: PrimitiveText;
|
|
10
|
+
sectionClass: string;
|
|
11
|
+
sectionCopyClass: string;
|
|
12
|
+
sectionTitleClass: string;
|
|
13
|
+
sectionDescriptionClass: string;
|
|
14
|
+
childrenClass: string;
|
|
15
|
+
groupBaseClass: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const renderLayoutNode: ({ node, snapshot, registry, primitiveText, sectionClass, sectionCopyClass, sectionTitleClass, sectionDescriptionClass, childrenClass, groupBaseClass, }: RenderLayoutNodeOptions) => TemplateResult | typeof nothing;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FormLayoutNode, ResolvedFormLayoutNode } from './types';
|
|
2
|
+
import { EntityMaps, LayoutReferenceMaps } from './layout-helpers';
|
|
3
|
+
export declare const resolveNodes: (nodes: FormLayoutNode[], entities: EntityMaps, maps: LayoutReferenceMaps, nodeIds: Map<string, number>, stepId: string | null, tabId: string | null) => ResolvedFormLayoutNode[];
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export interface FormLayoutSectionNode {
|
|
2
|
+
kind: "section";
|
|
3
|
+
id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
children: FormLayoutNode[];
|
|
7
|
+
}
|
|
8
|
+
export interface FormLayoutGroupNode {
|
|
9
|
+
kind: "group";
|
|
10
|
+
id?: string;
|
|
11
|
+
columns?: 1 | 2 | 3;
|
|
12
|
+
children: FormLayoutNode[];
|
|
13
|
+
}
|
|
14
|
+
export interface FormLayoutFieldNode {
|
|
15
|
+
kind: "field";
|
|
16
|
+
field: string;
|
|
17
|
+
}
|
|
18
|
+
export interface FormLayoutReportNode {
|
|
19
|
+
kind: "report";
|
|
20
|
+
report: string;
|
|
21
|
+
}
|
|
22
|
+
export interface FormLayoutExplanationNode {
|
|
23
|
+
kind: "explanation";
|
|
24
|
+
explanation: string;
|
|
25
|
+
}
|
|
26
|
+
export type FormLayoutNode = FormLayoutSectionNode | FormLayoutGroupNode | FormLayoutFieldNode | FormLayoutReportNode | FormLayoutExplanationNode;
|
|
27
|
+
export interface SinglePageLayoutConfig {
|
|
28
|
+
kind?: "single-page";
|
|
29
|
+
children?: FormLayoutNode[];
|
|
30
|
+
}
|
|
31
|
+
export interface WizardStepConfig {
|
|
32
|
+
id?: string;
|
|
33
|
+
title: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
children: FormLayoutNode[];
|
|
36
|
+
}
|
|
37
|
+
export interface WizardLayoutConfig {
|
|
38
|
+
kind: "wizard";
|
|
39
|
+
steps: WizardStepConfig[];
|
|
40
|
+
}
|
|
41
|
+
export interface TabLayoutConfig {
|
|
42
|
+
id?: string;
|
|
43
|
+
title: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
children: FormLayoutNode[];
|
|
46
|
+
}
|
|
47
|
+
export interface TabsLayoutConfig {
|
|
48
|
+
kind: "tabs";
|
|
49
|
+
tabs: TabLayoutConfig[];
|
|
50
|
+
}
|
|
51
|
+
export interface AccordionSectionConfig {
|
|
52
|
+
id?: string;
|
|
53
|
+
title: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
children: FormLayoutNode[];
|
|
56
|
+
defaultOpen?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface AccordionLayoutConfig {
|
|
59
|
+
kind: "accordion";
|
|
60
|
+
sections: AccordionSectionConfig[];
|
|
61
|
+
}
|
|
62
|
+
export type FormLayoutConfig = SinglePageLayoutConfig | WizardLayoutConfig | TabsLayoutConfig | AccordionLayoutConfig;
|
|
63
|
+
export interface ResolvedFormLayoutSectionNode {
|
|
64
|
+
kind: "section";
|
|
65
|
+
id: string;
|
|
66
|
+
title?: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
children: ResolvedFormLayoutNode[];
|
|
69
|
+
}
|
|
70
|
+
export interface ResolvedFormLayoutGroupNode {
|
|
71
|
+
kind: "group";
|
|
72
|
+
id: string;
|
|
73
|
+
columns?: 1 | 2 | 3;
|
|
74
|
+
children: ResolvedFormLayoutNode[];
|
|
75
|
+
}
|
|
76
|
+
export interface ResolvedFormLayoutFieldNode {
|
|
77
|
+
kind: "field";
|
|
78
|
+
field: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ResolvedFormLayoutReportNode {
|
|
81
|
+
kind: "report";
|
|
82
|
+
report: string;
|
|
83
|
+
}
|
|
84
|
+
export interface ResolvedFormLayoutExplanationNode {
|
|
85
|
+
kind: "explanation";
|
|
86
|
+
explanation: string;
|
|
87
|
+
}
|
|
88
|
+
export type ResolvedFormLayoutNode = ResolvedFormLayoutSectionNode | ResolvedFormLayoutGroupNode | ResolvedFormLayoutFieldNode | ResolvedFormLayoutReportNode | ResolvedFormLayoutExplanationNode;
|
|
89
|
+
export interface ResolvedSinglePageLayout {
|
|
90
|
+
kind: "single-page";
|
|
91
|
+
children: ResolvedFormLayoutNode[];
|
|
92
|
+
}
|
|
93
|
+
export interface ResolvedWizardStep {
|
|
94
|
+
id: string;
|
|
95
|
+
title: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
children: ResolvedFormLayoutNode[];
|
|
98
|
+
}
|
|
99
|
+
export interface ResolvedWizardLayout {
|
|
100
|
+
kind: "wizard";
|
|
101
|
+
steps: ResolvedWizardStep[];
|
|
102
|
+
}
|
|
103
|
+
export interface ResolvedTabLayout {
|
|
104
|
+
id: string;
|
|
105
|
+
title: string;
|
|
106
|
+
description?: string;
|
|
107
|
+
children: ResolvedFormLayoutNode[];
|
|
108
|
+
}
|
|
109
|
+
export interface ResolvedTabsLayout {
|
|
110
|
+
kind: "tabs";
|
|
111
|
+
tabs: ResolvedTabLayout[];
|
|
112
|
+
}
|
|
113
|
+
export interface ResolvedAccordionSection {
|
|
114
|
+
id: string;
|
|
115
|
+
title: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
defaultOpen: boolean;
|
|
118
|
+
children: ResolvedFormLayoutNode[];
|
|
119
|
+
}
|
|
120
|
+
export interface ResolvedAccordionLayout {
|
|
121
|
+
kind: "accordion";
|
|
122
|
+
sections: ResolvedAccordionSection[];
|
|
123
|
+
}
|
|
124
|
+
export type ResolvedFormLayout = ResolvedSinglePageLayout | ResolvedWizardLayout | ResolvedTabsLayout | ResolvedAccordionLayout;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ResolvedFormLayout, ResolvedFormLayoutNode } from './types';
|
|
2
|
+
export interface LayoutReferences {
|
|
3
|
+
fields: string[];
|
|
4
|
+
reports: string[];
|
|
5
|
+
explanations: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const walkLayoutNodes: (layout: ResolvedFormLayout, visitor: (node: ResolvedFormLayoutNode) => void) => void;
|
|
8
|
+
export declare const flattenLayoutNodes: (layout: ResolvedFormLayout) => ResolvedFormLayoutNode[];
|
|
9
|
+
export declare const collectLayoutReferences: (layout: ResolvedFormLayout) => LayoutReferences;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExplanationController, FieldController, ReportController } from '../../runtime';
|
|
2
|
+
import { LayoutReferenceMaps } from './layout-helpers';
|
|
3
|
+
import { FormLayoutConfig, ResolvedFormLayout } from './types';
|
|
4
|
+
export interface ResolvedLayoutResult {
|
|
5
|
+
layout: ResolvedFormLayout;
|
|
6
|
+
maps: LayoutReferenceMaps;
|
|
7
|
+
}
|
|
8
|
+
export declare const resolveFormLayout: (layout: FormLayoutConfig | undefined, fields: readonly FieldController[], reports: readonly ReportController[], explanations: readonly ExplanationController[]) => ResolvedLayoutResult;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AttachedDesignSystem, DesignSystemConfig, DesignSystemRegistry, ResolvedDesignSystem } from '../../design-system';
|
|
2
|
+
import { FormController, FormHooks, FormSchema, FormValidator, InactiveFieldPolicy, Registry, Transport } from '../../runtime';
|
|
3
|
+
import { PrimitiveContainerStrategy, PrimitiveLayout, PrimitiveRegistry, PrimitiveReportTransport, PrimitiveTextOverrides } from '../../primitives';
|
|
4
|
+
import { PresentationRegistry } from '../../presentation';
|
|
5
|
+
export interface KitDesignSystemSnapshot extends Omit<DesignSystemConfig, "mode" | "theme" | "recipe"> {
|
|
6
|
+
mode: NonNullable<DesignSystemConfig["mode"]>;
|
|
7
|
+
theme: NonNullable<DesignSystemConfig["theme"]>;
|
|
8
|
+
recipe: NonNullable<DesignSystemConfig["recipe"]>;
|
|
9
|
+
}
|
|
10
|
+
export interface KitLabels {
|
|
11
|
+
form?: string;
|
|
12
|
+
reports?: string;
|
|
13
|
+
submit?: string;
|
|
14
|
+
validating?: string;
|
|
15
|
+
submitting?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface MountFormOptions {
|
|
18
|
+
schema: FormSchema;
|
|
19
|
+
transport: Transport;
|
|
20
|
+
registry?: Registry;
|
|
21
|
+
presentationRegistry?: PresentationRegistry;
|
|
22
|
+
primitiveRegistry?: PrimitiveRegistry;
|
|
23
|
+
designSystemRegistry?: DesignSystemRegistry;
|
|
24
|
+
designSystem?: DesignSystemConfig;
|
|
25
|
+
initialValues?: Record<string, unknown>;
|
|
26
|
+
validators?: FormValidator[];
|
|
27
|
+
hooks?: FormHooks;
|
|
28
|
+
hookFailurePolicy?: {
|
|
29
|
+
afterSubmit?: "fail-submit" | "preserve-success";
|
|
30
|
+
};
|
|
31
|
+
inactiveFieldPolicy?: InactiveFieldPolicy;
|
|
32
|
+
listenerErrorPolicy?: "ignore" | "throw-aggregate";
|
|
33
|
+
onListenerError?: (error: unknown) => void;
|
|
34
|
+
layout?: PrimitiveLayout;
|
|
35
|
+
containerStrategy?: PrimitiveContainerStrategy;
|
|
36
|
+
reportPane?: "auto" | "always" | "hidden";
|
|
37
|
+
reportTransport?: PrimitiveReportTransport;
|
|
38
|
+
labels?: KitLabels;
|
|
39
|
+
primitiveText?: PrimitiveTextOverrides;
|
|
40
|
+
onDesignSystemChange?: (resolved: ResolvedDesignSystem) => void;
|
|
41
|
+
}
|
|
42
|
+
export interface MountedForm {
|
|
43
|
+
readonly form: FormController;
|
|
44
|
+
readonly host: HTMLElement;
|
|
45
|
+
readonly engineRegistry: Registry;
|
|
46
|
+
readonly presentationRegistry: PresentationRegistry;
|
|
47
|
+
readonly primitiveRegistry: PrimitiveRegistry;
|
|
48
|
+
readonly designSystemRegistry: DesignSystemRegistry;
|
|
49
|
+
readonly designSystem: AttachedDesignSystem;
|
|
50
|
+
updateDesignSystem(config: DesignSystemConfig): void;
|
|
51
|
+
replaceDesignSystem(config: KitDesignSystemSnapshot): void;
|
|
52
|
+
resetDesignSystem(): void;
|
|
53
|
+
unmount(): void;
|
|
54
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PanelState {
|
|
2
|
+
kind: "wizard-step" | "tab" | "accordion-section";
|
|
3
|
+
index: number;
|
|
4
|
+
count: number;
|
|
5
|
+
currentId: string;
|
|
6
|
+
canGoNext: boolean;
|
|
7
|
+
canGoPrev: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const createIndexedPanelState: (kind: PanelState["kind"], index: number, ids: readonly string[]) => PanelState | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
3
|
-
export declare class
|
|
2
|
+
import { kitTagNames } from './constants';
|
|
3
|
+
export declare class KitStepIndicatorElement extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult;
|
|
5
5
|
accessor current: number;
|
|
6
6
|
accessor total: number;
|
|
@@ -9,6 +9,6 @@ export declare class QuestionnaireStepIndicatorElement extends LitElement {
|
|
|
9
9
|
}
|
|
10
10
|
declare global {
|
|
11
11
|
interface HTMLElementTagNameMap {
|
|
12
|
-
[
|
|
12
|
+
[kitTagNames.stepIndicator]: KitStepIndicatorElement;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tabsRootStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { PrimitiveText } from '../../primitives/constants';
|
|
3
|
+
import { PrimitiveRegistry } from '../../primitives/types';
|
|
4
|
+
import { kitTagNames } from './constants';
|
|
5
|
+
import { FormViewController } from './types';
|
|
6
|
+
export declare class KitTabsElement extends LitElement {
|
|
7
|
+
#private;
|
|
8
|
+
static styles: import('lit').CSSResult;
|
|
9
|
+
accessor view: FormViewController | undefined;
|
|
10
|
+
accessor registry: PrimitiveRegistry | undefined;
|
|
11
|
+
accessor primitiveText: PrimitiveText;
|
|
12
|
+
accessor submitLabel: string;
|
|
13
|
+
accessor validatingLabel: string;
|
|
14
|
+
accessor submittingLabel: string;
|
|
15
|
+
private accessor snapshot;
|
|
16
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
render(): import('lit').TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
[kitTagNames.tabs]: KitTabsElement;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,52 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export type { FormLayoutNode, FormLayoutSectionNode, FormLayoutGroupNode, FormLayoutFieldNode, FormLayoutReportNode, FormLayoutExplanationNode, SinglePageLayoutConfig, WizardStepConfig, WizardLayoutConfig, TabLayoutConfig, TabsLayoutConfig, AccordionSectionConfig, AccordionLayoutConfig, FormLayoutConfig, ResolvedFormLayoutNode, ResolvedFormLayoutSectionNode, ResolvedFormLayoutGroupNode, ResolvedFormLayoutFieldNode, ResolvedFormLayoutReportNode, ResolvedFormLayoutExplanationNode, ResolvedSinglePageLayout, ResolvedWizardStep, ResolvedWizardLayout, ResolvedTabLayout, ResolvedTabsLayout, ResolvedAccordionSection, ResolvedAccordionLayout, ResolvedFormLayout, } from './layout-types';
|
|
2
|
+
export type { KitDesignSystemSnapshot, KitLabels, MountFormOptions, MountedForm, } from './mount-types';
|
|
3
|
+
export type { WizardState, TabsState, AccordionState, FormViewFieldItem, FormViewReportItem, FormViewExplanationItem, FormViewState, FormViewSnapshot, CreateFormViewOptions, FormViewController, WizardMountUiOptions, MountWizardFormOptions, MountedWizardForm, TabsMountUiOptions, MountTabsFormOptions, MountedTabsForm, AccordionMountUiOptions, MountAccordionFormOptions, MountedAccordionForm, LayoutReferences, PanelState, } from './view-types';
|
|
4
|
+
export type { WizardLabels, WizardTextOverrides } from './wizard-constants';
|
|
4
5
|
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, TransportCacheEntry, TransportCacheStore, TransportCollection, TransportContextAuthOptions, TransportHealthSnapshot, TransportHealthState, TransportLogOptions, TransportMetricsOptions, TransportMiddleware, TransportTelemetryEvent, TransportTraceOptions, WebSocketSessionTransportOptions, WeightedRoutingTransportOptions, } from '../../transport';
|
|
5
|
-
export interface KitDesignSystemSnapshot extends Omit<DesignSystemConfig, "mode" | "theme" | "recipe"> {
|
|
6
|
-
mode: NonNullable<DesignSystemConfig["mode"]>;
|
|
7
|
-
theme: NonNullable<DesignSystemConfig["theme"]>;
|
|
8
|
-
recipe: NonNullable<DesignSystemConfig["recipe"]>;
|
|
9
|
-
}
|
|
10
|
-
export interface KitLabels {
|
|
11
|
-
form?: string;
|
|
12
|
-
reports?: string;
|
|
13
|
-
submit?: string;
|
|
14
|
-
validating?: string;
|
|
15
|
-
submitting?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface MountFormOptions {
|
|
18
|
-
schema: FormSchema;
|
|
19
|
-
transport: Transport;
|
|
20
|
-
registry?: Registry;
|
|
21
|
-
primitiveRegistry?: PrimitiveRegistry;
|
|
22
|
-
designSystemRegistry?: DesignSystemRegistry;
|
|
23
|
-
designSystem?: DesignSystemConfig;
|
|
24
|
-
initialValues?: Record<string, unknown>;
|
|
25
|
-
validators?: FormValidator[];
|
|
26
|
-
hooks?: FormHooks;
|
|
27
|
-
hookFailurePolicy?: {
|
|
28
|
-
afterSubmit?: "fail-submit" | "preserve-success";
|
|
29
|
-
};
|
|
30
|
-
inactiveFieldPolicy?: InactiveFieldPolicy;
|
|
31
|
-
listenerErrorPolicy?: "ignore" | "throw-aggregate";
|
|
32
|
-
onListenerError?: (error: unknown) => void;
|
|
33
|
-
layout?: PrimitiveLayout;
|
|
34
|
-
containerStrategy?: PrimitiveContainerStrategy;
|
|
35
|
-
reportPane?: "auto" | "always" | "hidden";
|
|
36
|
-
reportTransport?: PrimitiveReportTransport;
|
|
37
|
-
labels?: KitLabels;
|
|
38
|
-
primitiveText?: PrimitiveTextOverrides;
|
|
39
|
-
onDesignSystemChange?: (resolved: ResolvedDesignSystem) => void;
|
|
40
|
-
}
|
|
41
|
-
export interface MountedForm {
|
|
42
|
-
readonly form: FormController;
|
|
43
|
-
readonly host: HTMLElement;
|
|
44
|
-
readonly engineRegistry: Registry;
|
|
45
|
-
readonly primitiveRegistry: PrimitiveRegistry;
|
|
46
|
-
readonly designSystemRegistry: DesignSystemRegistry;
|
|
47
|
-
readonly designSystem: AttachedDesignSystem;
|
|
48
|
-
updateDesignSystem(config: DesignSystemConfig): void;
|
|
49
|
-
replaceDesignSystem(config: KitDesignSystemSnapshot): void;
|
|
50
|
-
resetDesignSystem(): void;
|
|
51
|
-
unmount(): void;
|
|
52
|
-
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AccordionState, FormViewState, TabsState, WizardState, ResolvedFormLayout } from './types';
|
|
2
|
+
type LayoutStateOptions = {
|
|
3
|
+
layout: ResolvedFormLayout;
|
|
4
|
+
stepIndex: number;
|
|
5
|
+
activeTabIndex: number;
|
|
6
|
+
openSectionIds: Set<string>;
|
|
7
|
+
formState: FormViewState["form"];
|
|
8
|
+
};
|
|
9
|
+
export declare const getWizardState: ({ layout, stepIndex, formState, }: LayoutStateOptions) => WizardState | null;
|
|
10
|
+
export declare const getTabsState: ({ layout, activeTabIndex }: LayoutStateOptions) => TabsState | null;
|
|
11
|
+
export declare const getAccordionState: ({ layout, openSectionIds, }: LayoutStateOptions) => AccordionState | null;
|
|
12
|
+
export declare const createFormViewState: (options: LayoutStateOptions) => FormViewState;
|
|
13
|
+
export declare const isVisibleInLayout: (layout: ResolvedFormLayout, stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>, stepId: string | null, tabId: string | null) => boolean;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormController } from '../../runtime';
|
|
2
|
+
import { ResolvedLayoutResult } from './layout';
|
|
3
|
+
export declare const validateCurrentWizardStep: (form: FormController, resolvedLayout: ResolvedLayoutResult, stepIndex: number) => Promise<boolean>;
|
|
4
|
+
export declare const getActiveLayoutNodes: (resolvedLayout: ResolvedLayoutResult, stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>) => import('./layout-types').ResolvedFormLayoutNode[];
|
|
5
|
+
export declare const assertAccordionSection: (resolvedLayout: ResolvedLayoutResult, accordionSections: readonly {
|
|
6
|
+
id: string;
|
|
7
|
+
}[], sectionId: string) => void;
|
|
8
|
+
export declare const assertAccordionLayout: (resolvedLayout: ResolvedLayoutResult) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PresentationRegistry } from '../../presentation';
|
|
2
|
+
import { FormController } from '../../runtime';
|
|
3
|
+
import { ResolvedLayoutResult } from './layout';
|
|
4
|
+
import { FormViewSnapshot } from './types';
|
|
5
|
+
type SnapshotCacheOptions = {
|
|
6
|
+
form: FormController;
|
|
7
|
+
presentationRegistry: PresentationRegistry;
|
|
8
|
+
resolvedLayout: ResolvedLayoutResult;
|
|
9
|
+
getStepIndex: () => number;
|
|
10
|
+
getActiveTabIndex: () => number;
|
|
11
|
+
getOpenSectionIds: () => Set<string>;
|
|
12
|
+
};
|
|
13
|
+
export declare const createFormViewSnapshotCache: ({ form, presentationRegistry, resolvedLayout, getStepIndex, getActiveTabIndex, getOpenSectionIds, }: SnapshotCacheOptions) => (() => FormViewSnapshot);
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PresentationRegistry } from '../../presentation';
|
|
2
|
+
import { FormController } from '../../runtime';
|
|
3
|
+
import { FormViewSnapshot } from './types';
|
|
4
|
+
import { ResolvedLayoutResult } from './layout';
|
|
5
|
+
type BuildSnapshotOptions = {
|
|
6
|
+
form: FormController;
|
|
7
|
+
presentationRegistry: PresentationRegistry;
|
|
8
|
+
resolvedLayout: ResolvedLayoutResult;
|
|
9
|
+
stepIndex: number;
|
|
10
|
+
activeTabIndex: number;
|
|
11
|
+
openSectionIds: Set<string>;
|
|
12
|
+
};
|
|
13
|
+
export declare const buildFormViewSnapshot: ({ form, presentationRegistry, resolvedLayout, stepIndex, activeTabIndex, openSectionIds, }: BuildSnapshotOptions) => FormViewSnapshot;
|
|
14
|
+
export declare const createViewState: (form: FormController, layout: ResolvedLayoutResult["layout"], stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>) => import('./view-types').FormViewState;
|
|
15
|
+
export {};
|