@sonata-innovations/fiber-types 2.1.0 → 2.3.0
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/AGENTS.md +51 -0
- package/CHANGELOG.md +75 -0
- package/README.md +98 -0
- package/dist/flow-data.d.ts +3 -1
- package/dist/flow-data.d.ts.map +1 -1
- package/dist/flow.d.ts +21 -1
- package/dist/flow.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/docs/fiber-concepts.md +461 -0
- package/docs/schema/flow-data-schema.json +256 -0
- package/docs/schema/flow-data-schema.md +371 -0
- package/docs/schema/flow-quick-reference.md +196 -0
- package/docs/schema/flow-schema.json +829 -0
- package/docs/schema/flow-schema.md +846 -0
- package/package.json +18 -10
package/AGENTS.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @sonata-innovations/fiber-types — Agent Guide
|
|
2
|
+
|
|
3
|
+
The Fiber schema, as TypeScript types and as JSON Schema. Every other Fiber package depends on this one, which makes it the canonical home for the **Flow** (input) and **FlowData** (output) contracts.
|
|
4
|
+
|
|
5
|
+
Docs in this package are versioned with the code you installed. Read them from `node_modules/@sonata-innovations/fiber-types/docs/`.
|
|
6
|
+
|
|
7
|
+
## Documentation map
|
|
8
|
+
|
|
9
|
+
| Read this | When |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `docs/fiber-concepts.md` | You are new to Fiber. The Flow/Screen/Component model, Flow vs FlowData, how builders and the render engine relate. |
|
|
12
|
+
| `docs/schema/flow-quick-reference.md` | **Start here to construct Flow JSON.** Compact reference: the 30 component types and their value shapes, conditions, validation, options, widths, markup. |
|
|
13
|
+
| `docs/schema/flow-schema.md` | Exhaustive per-property reference for every component type and config field. |
|
|
14
|
+
| `docs/schema/flow-schema.json` | Machine-validatable JSON Schema (draft 2020-12) for a Flow. Validate with `ajv`. |
|
|
15
|
+
| `docs/schema/flow-data-schema.md` | The shape of the data FBRE hands back: per-type value shapes, exclusion rules, containers, calculations. |
|
|
16
|
+
| `docs/schema/flow-data-schema.json` | Machine-validatable JSON Schema for FlowData. |
|
|
17
|
+
|
|
18
|
+
**Validate a Flow you generated** rather than trusting it by inspection:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx ajv-cli validate --spec=draft2020 \
|
|
22
|
+
-s node_modules/@sonata-innovations/fiber-types/docs/schema/flow-schema.json \
|
|
23
|
+
-d my-flow.json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## What this package exports
|
|
27
|
+
|
|
28
|
+
- **Schema types** — `Flow`, `FlowScreen`, `Component` (a discriminated union keyed on `type`), `ComponentProperties`, `FlowMetadata`, `FlowConfiguration`, `ThemeConfig`, `NavigationConfig`, `ControlsConfig`, `ConfirmationConfig`
|
|
29
|
+
- **Output types** — `FlowData`, `ScreenData`, `ComponentData`, `CalculationData`, `FileUploadData`, `RangeValue`
|
|
30
|
+
- **Condition & validation types** — `FlowConditionConfig`, `ConditionRule`, `ConditionOperator` (19 operators), `FlowValidationConfig`, `ValidationRule` (17 validators)
|
|
31
|
+
- **Preset/template data** — `PresetData`, `TemplateData` (the serializable definitions FBT accepts)
|
|
32
|
+
- **Component manifest** — `COMPONENT_VARIANT_TYPES`, `ComponentType`, `ComponentOfType<K>`, `ComponentPropertiesByType`
|
|
33
|
+
- **Utilities** — `generateUUID`, `regenerateComponentUUIDs`, `regenerateFlowUUIDs`, `normalizeConditionalOrder`, `getValidationConfig`, `getComponentDisplayLabel`
|
|
34
|
+
|
|
35
|
+
## Facts worth knowing before you generate a Flow
|
|
36
|
+
|
|
37
|
+
- **30 component types.** Display types (`header`, `text`, `divider`, `callout`, `table`) never appear in FlowData; `computed` does.
|
|
38
|
+
- **19 condition operators, 17 validators.** Exact lists are in the quick reference.
|
|
39
|
+
- **Validation `pattern` rules take `params.regex`**, not `params.pattern`. A `pattern` key is ignored and the rule silently always passes.
|
|
40
|
+
- **Options must be `{ label, value }` objects**, not bare strings. `value` may be a string or a number.
|
|
41
|
+
- **Option-bearing components do not default to their first option.** Initial value is `null` unless `properties.defaultValue` matches an option's `value`.
|
|
42
|
+
- **Never set runtime-only fields** (`value`, `valid`, `addedComponents`) in Flow JSON.
|
|
43
|
+
- **`Component` is a discriminated union.** Narrow on `component.type` and `properties` narrows with it; use `ComponentOfType<"inputText">` to name one variant.
|
|
44
|
+
- **If an AI/LLM generated the flow**, run `normalizeConditionalOrder(flow)` before handing it to FBTL — it reorders conditionals to sit after their triggers, structurally only, and is idempotent.
|
|
45
|
+
|
|
46
|
+
## Companion packages
|
|
47
|
+
|
|
48
|
+
- `@sonata-innovations/fiber-fbre` — renders a Flow, returns FlowData
|
|
49
|
+
- `@sonata-innovations/fiber-fbt` — full drag-and-drop builder
|
|
50
|
+
- `@sonata-innovations/fiber-fbtl` — lite builder for non-technical end users
|
|
51
|
+
- `@sonata-innovations/fiber-shared` — the condition, validation, markup, and formula engines
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Changelog — @sonata-innovations/fiber-types
|
|
2
|
+
|
|
3
|
+
All notable changes to the Fiber schema types. Dates are release dates.
|
|
4
|
+
|
|
5
|
+
## 2.3.0 — 2026-07-10
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Documentation now ships inside the package under `docs/`, plus an `AGENTS.md` routing guide at the package root. This package is the canonical home of the schema docs (`docs/schema/`), including the machine-validatable `flow-schema.json` and `flow-data-schema.json` — every other Fiber package depends on this one, so the schema is always present in `node_modules`.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- `flow-data-schema.json` rejected output that FBRE actually emits: `confirm` was missing from the component type enum, `value` was required on entries that legitimately have no `value` key (containers, and a confirm that was ticked then unticked), and the base64 file-upload shape did not match the wire format. It now validates real FlowData.
|
|
14
|
+
- Documentation corrections: there are **30** component types (not 24) and **19** condition operators (not 20); option-bearing components such as `radio` do **not** default to their first option (the initial value is `null` unless `defaultValue` matches an option); `pattern` validation rules take `params.regex`, not `params.pattern`; the undocumented `showBorder` property on group and repeater is now in the schema; `${...}` references resolve against calculations, then component values, then context.
|
|
15
|
+
- `FileUploadBase64Data` declared a required field `lastModifiedData` — a typo for `lastModifiedDate` that was never emitted, so reading it always yielded `undefined`. It is now an optional `lastModifiedDate?: string`, matching the wire format and `flow-data-schema.json`. FBRE now emits the value as an ISO-8601 string rather than passing the deprecated `Date` object through unchanged. Code that read `lastModifiedData` will no longer type-check; it was reading a field that never existed at runtime.
|
|
16
|
+
- `FlowScreen.conditions` was typed `FlowConditionConfig | {}`, so an empty object `{}` type-checked even though the schema requires `action` and `when` and rejects it at validation. The `| {}` is removed; the field now matches `Component.conditions` (`FlowConditionConfig | undefined`), so a malformed `{}` is caught at compile time instead of at ajv validation.
|
|
17
|
+
|
|
18
|
+
## 2.2.0 — 2026-07-03
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- `ConfirmationConfig` on `FlowConfiguration` — the terminal "thank you" screen (`show`, `title`, `body`).
|
|
23
|
+
|
|
24
|
+
## 2.1.0 — 2026-06-10
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- `ThemeConfig` palette knobs: `background`, `surface`, `text`, `border`, `radius`, `fontFamily`, `error`, `success`, `warning`.
|
|
29
|
+
- `stepperStyle` on `ControlsConfig`.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- **`colorScheme: "light" | "dark"` replaces the `darkMode` boolean.** There is no runtime fallback — pre-migrate stored flows.
|
|
34
|
+
|
|
35
|
+
## 2.0.1 — 2026-06-09
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- The package emits explicit `.js` import extensions (NodeNext resolution), so it resolves under native Node ESM and server-side rendering.
|
|
40
|
+
|
|
41
|
+
## 2.0.0 — 2026-05-19
|
|
42
|
+
|
|
43
|
+
### Changed — breaking
|
|
44
|
+
|
|
45
|
+
- **`Component` is a discriminated union keyed on `type`.** `component.properties` narrows to the matching `Component*Properties` shape after a `type` check. The Flow JSON itself is unchanged; this is a TypeScript-surface change.
|
|
46
|
+
- Added `ComponentOfType<K>` and `ComponentPropertiesByType`.
|
|
47
|
+
- A single component manifest is now the source of component metadata, with `assertManifestTypeMapParity` guarding it at build time.
|
|
48
|
+
- `generateUUID` has a single export site.
|
|
49
|
+
- Removed the dead `ComponentInputType` export.
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- `getValidationConfig` and `getComponentDisplayLabel` accessors for narrowed access.
|
|
54
|
+
|
|
55
|
+
## 1.0.6 — 2026-05-18
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- `normalizeConditionalOrder(flow)` — a pure structural reorder that moves each top-level conditional to sit immediately after its trigger, so generator-authored (AI/LLM) flows group correctly in FBTL. Never rewrites conditions, properties, uuids, or labels; idempotent; leaves cycles and dangling sources in place.
|
|
60
|
+
|
|
61
|
+
## 1.0.4 — 2026-03-20
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
|
|
65
|
+
- Calculation results in the FlowData output (`FlowData.calculations`).
|
|
66
|
+
|
|
67
|
+
## 1.0.1 – 1.0.3 — 2026-03-04
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- `FlowModeType` (`"standard" | "conversational"`) and the four conversational styles.
|
|
72
|
+
- Four additional standard styles; `stepperStyle` as independent config.
|
|
73
|
+
- `signature` and `computed` component types.
|
|
74
|
+
- Computation layer: `repeater` component, `Flow.calculations`, and rich option metadata (`OptionItem.metadata`).
|
|
75
|
+
- `cardSelect` component; optional `label` on `table`.
|
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# @sonata-innovations/fiber-types
|
|
2
|
+
|
|
3
|
+
TypeScript types and JSON Schema for **Fiber** — a system for building and rendering data-collection forms.
|
|
4
|
+
|
|
5
|
+
This package defines the two contracts every other Fiber package speaks:
|
|
6
|
+
|
|
7
|
+
- **Flow** — the JSON document a builder produces and the render engine consumes
|
|
8
|
+
- **FlowData** — the collected responses the render engine hands back
|
|
9
|
+
|
|
10
|
+
It has no runtime dependencies and is the foundation of the Fiber dependency graph, which makes it the canonical home for the schema documentation.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @sonata-innovations/fiber-types
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Most consumers get this package transitively — it is a dependency of `fiber-fbre`, `fiber-fbt`, `fiber-fbtl`, and `fiber-shared`. Install it directly when you generate or inspect Flow JSON without rendering it.
|
|
19
|
+
|
|
20
|
+
## Documentation
|
|
21
|
+
|
|
22
|
+
Full docs ship inside this package under `docs/`, so they always match the version you installed. Start with `AGENTS.md` at the package root, or read them online at **[github.com/sonata-innovations/fiber-docs](https://github.com/sonata-innovations/fiber-docs)**.
|
|
23
|
+
|
|
24
|
+
| Document | What it covers |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `docs/fiber-concepts.md` | The Flow/Screen/Component model, Flow vs FlowData |
|
|
27
|
+
| `docs/schema/flow-quick-reference.md` | Compact reference: 30 component types and their value shapes, conditions, validation, widths, markup |
|
|
28
|
+
| `docs/schema/flow-schema.md` | Exhaustive per-property reference |
|
|
29
|
+
| `docs/schema/flow-schema.json` | Machine-validatable JSON Schema (draft 2020-12) for a Flow |
|
|
30
|
+
| `docs/schema/flow-data-schema.md` | The shape of the data the render engine returns |
|
|
31
|
+
| `docs/schema/flow-data-schema.json` | Machine-validatable JSON Schema for FlowData |
|
|
32
|
+
|
|
33
|
+
## Validate a Flow
|
|
34
|
+
|
|
35
|
+
The JSON Schema is the enforceable contract. Validate anything you generate rather than trusting it by inspection:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx ajv-cli validate --spec=draft2020 \
|
|
39
|
+
-s node_modules/@sonata-innovations/fiber-types/docs/schema/flow-schema.json \
|
|
40
|
+
-d my-flow.json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## What's exported
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import type {
|
|
47
|
+
Flow, FlowScreen, Component, ComponentProperties,
|
|
48
|
+
FlowMetadata, FlowConfiguration, ThemeConfig, NavigationConfig,
|
|
49
|
+
ControlsConfig, ConfirmationConfig,
|
|
50
|
+
FlowData, ScreenData, ComponentData, CalculationData,
|
|
51
|
+
FileUploadData, RangeValue,
|
|
52
|
+
FlowConditionConfig, ConditionRule, ConditionOperator,
|
|
53
|
+
FlowValidationConfig, ValidationRule,
|
|
54
|
+
PresetData, TemplateData,
|
|
55
|
+
ComponentType, ComponentOfType, ComponentPropertiesByType,
|
|
56
|
+
} from "@sonata-innovations/fiber-types";
|
|
57
|
+
|
|
58
|
+
import {
|
|
59
|
+
generateUUID,
|
|
60
|
+
regenerateComponentUUIDs,
|
|
61
|
+
regenerateFlowUUIDs,
|
|
62
|
+
normalizeConditionalOrder,
|
|
63
|
+
getValidationConfig,
|
|
64
|
+
getComponentDisplayLabel,
|
|
65
|
+
COMPONENT_VARIANT_TYPES,
|
|
66
|
+
} from "@sonata-innovations/fiber-types";
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`Component` is a **discriminated union keyed on `type`** — narrow on `component.type` and `component.properties` narrows with it:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
if (component.type === "inputText") {
|
|
73
|
+
component.properties.placeholder; // typed, no cast
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Gotchas
|
|
78
|
+
|
|
79
|
+
- **30 component types.** Display types (`header`, `text`, `divider`, `callout`, `table`) never appear in FlowData; `computed` does.
|
|
80
|
+
- **`pattern` validation rules take `params.regex`**, not `params.pattern`. A `pattern` key is silently ignored and the rule always passes.
|
|
81
|
+
- **Options must be `{ label, value }` objects**, not bare strings. `value` may be a string or a number.
|
|
82
|
+
- **Option-bearing components do not default to their first option.** The initial value is `null` unless `properties.defaultValue` matches an option's `value`.
|
|
83
|
+
- **Never set runtime-only fields** (`value`, `valid`, `addedComponents`) in Flow JSON.
|
|
84
|
+
- **AI-generated flows** should be passed through `normalizeConditionalOrder(flow)` before being loaded into FBTL. It reorders conditionals to follow their triggers — a pure structural reorder, idempotent, and it never rewrites a condition, property, uuid, or label.
|
|
85
|
+
|
|
86
|
+
## Companion packages
|
|
87
|
+
|
|
88
|
+
| Package | What it is |
|
|
89
|
+
|---|---|
|
|
90
|
+
| [`@sonata-innovations/fiber-fbre`](https://www.npmjs.com/package/@sonata-innovations/fiber-fbre) | Render engine — renders a Flow, returns FlowData |
|
|
91
|
+
| [`@sonata-innovations/fiber-fbt`](https://www.npmjs.com/package/@sonata-innovations/fiber-fbt) | Full drag-and-drop builder |
|
|
92
|
+
| [`@sonata-innovations/fiber-fbtl`](https://www.npmjs.com/package/@sonata-innovations/fiber-fbtl) | Lite builder for non-technical end users |
|
|
93
|
+
| [`@sonata-innovations/fiber-shared`](https://www.npmjs.com/package/@sonata-innovations/fiber-shared) | Condition, validation, markup, and formula engines |
|
|
94
|
+
| [`@sonata-innovations/fiber-theme-editor`](https://www.npmjs.com/package/@sonata-innovations/fiber-theme-editor) | Visual theme editor widget |
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT
|
package/dist/flow-data.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ export type FileUploadBase64Data = {
|
|
|
4
4
|
type: string;
|
|
5
5
|
size: number;
|
|
6
6
|
lastModified: number;
|
|
7
|
-
|
|
7
|
+
/** Deprecated `File.lastModifiedDate`, ISO-8601. Only browsers that still
|
|
8
|
+
* expose the property emit this. */
|
|
9
|
+
lastModifiedDate?: string;
|
|
8
10
|
data: string;
|
|
9
11
|
};
|
|
10
12
|
export type FileUploadS3Data = {
|
package/dist/flow-data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-data.d.ts","sourceRoot":"","sources":["../src/flow-data.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"flow-data.d.ts","sourceRoot":"","sources":["../src/flow-data.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB;yCACqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AAErE,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EACD,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,MAAM,EAAE,GACR,OAAO,GACP,IAAI,GACJ,cAAc,GACd,UAAU,CAAC;IACf,UAAU,CAAC,EAAE,aAAa,EAAE,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,aAAa,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;CAClC,CAAC"}
|
package/dist/flow.d.ts
CHANGED
|
@@ -59,12 +59,32 @@ export type ControlsConfig = {
|
|
|
59
59
|
showStepper?: boolean;
|
|
60
60
|
stepperStyle?: StepperStyle;
|
|
61
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Terminal "thank you" / confirmation screen shown after the flow is submitted.
|
|
64
|
+
* Presentation-only — not a data-collection screen, so it lives here on the
|
|
65
|
+
* config rather than in the `Flow → Screen → Component` hierarchy.
|
|
66
|
+
*
|
|
67
|
+
* `title` and `body` support reference markup (`${...}`) and text formatting,
|
|
68
|
+
* resolved by FBRE against collected field values and external context. The
|
|
69
|
+
* screen renders only when `show` is not `false` and at least one of
|
|
70
|
+
* `title`/`body` has content (or the parent supplies an override via the
|
|
71
|
+
* `onFlowComplete` return value).
|
|
72
|
+
*/
|
|
73
|
+
export type ConfirmationConfig = {
|
|
74
|
+
/** Explicit off-switch. Content presence is the positive gate. */
|
|
75
|
+
show?: boolean;
|
|
76
|
+
/** Heading text (supports `${...}` references + formatting). */
|
|
77
|
+
title?: string;
|
|
78
|
+
/** Body text (supports `${...}` references + formatting). */
|
|
79
|
+
body?: string;
|
|
80
|
+
};
|
|
62
81
|
export type FlowConfiguration = {
|
|
63
82
|
mode?: FlowModeType;
|
|
64
83
|
theme?: ThemeConfig;
|
|
65
84
|
navigation?: NavigationConfig;
|
|
66
85
|
controls?: ControlsConfig;
|
|
67
86
|
summary?: boolean;
|
|
87
|
+
confirmation?: ConfirmationConfig;
|
|
68
88
|
};
|
|
69
89
|
/** Fields every component variant carries regardless of `type`. */
|
|
70
90
|
type ComponentCommon = {
|
|
@@ -97,7 +117,7 @@ export type FlowScreen = {
|
|
|
97
117
|
uuid: string;
|
|
98
118
|
label?: string;
|
|
99
119
|
components: Component[];
|
|
100
|
-
conditions?: FlowConditionConfig
|
|
120
|
+
conditions?: FlowConditionConfig;
|
|
101
121
|
nextButtonLabel?: string;
|
|
102
122
|
backButtonLabel?: string;
|
|
103
123
|
valid?: boolean;
|
package/dist/flow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EACV,yBAAyB,EACzB,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,OAAO,GACP,MAAM,GACN,WAAW,GACX,MAAM,GACN,WAAW,CAAC;AAEhB,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,UAAU,GACV,eAAe,GACf,YAAY,GACZ,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,C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CAAC,EAAE,mBAAmB,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;CAClC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Flow, FlowScreen, FlowConfiguration, ThemeConfig, ColorScheme, NavigationConfig, ControlsConfig, FlowMetadata, Component, ComponentOfType, ComponentProperties, ScreenTransitionType, FlowStyleType, ControlsLayout, StepperStyle, FlowModeType, } from "./flow.js";
|
|
1
|
+
export type { Flow, FlowScreen, FlowConfiguration, ThemeConfig, ColorScheme, NavigationConfig, ControlsConfig, ConfirmationConfig, FlowMetadata, Component, ComponentOfType, ComponentProperties, ScreenTransitionType, FlowStyleType, ControlsLayout, StepperStyle, FlowModeType, } from "./flow.js";
|
|
2
2
|
export type { ComponentType, ComponentPropertiesByType, } from "./component-variants.js";
|
|
3
3
|
export { COMPONENT_VARIANT_TYPES, assertManifestTypeMapParity, } from "./component-variants.js";
|
|
4
4
|
export type { ConditionAction, ConditionLogic, ConditionOperator, ConditionRule, ConditionRuleSource, ConditionGroup, FlowConditionConfig, } from "./conditions.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,IAAI,EACJ,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,eAAe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