@player-ui/types 0.15.3-next.3 → 0.15.4--canary.881.37421

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/types/src/index.ts"],"sourcesContent":["/**\n * An asset is the smallest unit of user interaction in a player view\n */\nexport interface Asset<T extends string = string> {\n /** Each asset requires a unique id per view */\n id: string;\n\n /** The asset type determines the semantics of how a user interacts with a page */\n type: T;\n\n [key: string]: unknown;\n}\n/**\n * An asset that contains a Binding.\n */\nexport interface AssetBinding extends Asset {\n /** A binding that points to somewhere in the data model */\n binding: Binding;\n}\n\n/** A single case statement to use in a switch */\nexport interface SwitchCase<T extends Asset = Asset> {\n /** The Asset to use if this case is applicable */\n asset: T;\n\n /** An expression to execute to determine if this case applies */\n case: Expression | true;\n}\n\n/** A switch can replace an asset with the applicable case on first render */\nexport type Switch<T extends Asset = Asset> = SwitchCase<T>[];\n\n/** An object that contains an asset */\nexport type AssetWrapper<T extends Asset = Asset> = {\n /** An asset instance */\n asset: T;\n\n [key: string]: unknown;\n};\n\nexport type AssetWrapperOrSwitch<T extends Asset = Asset> =\n | (AssetWrapper<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n dynamicSwitch?: never;\n\n /** The staticSwitch property can't exist at the same time as 'asset' */\n staticSwitch?: never;\n })\n | (StaticSwitch<T> & {\n /** The staticSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The staticSwitch property can't exist at the same time as 'dynamicSwitch' */\n dynamicSwitch?: never;\n })\n | (DynamicSwitch<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The dynamicSwitch property can't exist at the same time as 'staticSwitch' */\n staticSwitch?: never;\n });\n\nexport type AssetSwitch<T extends Asset = Asset> =\n | StaticSwitch<T>\n | DynamicSwitch<T>;\n\nexport interface StaticSwitch<T extends Asset = Asset> {\n /** A static switch only evaluates the applicable base on first render of the view */\n staticSwitch: Switch<T>;\n}\n\nexport interface DynamicSwitch<T extends Asset = Asset> {\n /** A dynamic switch re-evaluates the applicable case as data changes */\n dynamicSwitch: Switch<T>;\n}\n\n/**\n * Expressions are a specialized way of executing code.\n * If the expression is a composite, the last expression executed is the return value\n */\nexport type Expression = string | string[];\nexport type ExpressionRef = `@[${string}]@`;\n\n/**\n * Bindings describe locations in the data model.\n */\nexport type Binding = string;\nexport type BindingRef = `{{${Binding}}}`;\n\n/**\n * The data-model is the location that all user data is stored\n */\nexport type DataModel = Record<any, unknown>;\n\n/** The navigation section of the flow describes a State Machine for the user. */\nexport type Navigation = {\n /** The name of the Flow to begin on */\n BEGIN: string;\n} & Record<string, string | NavigationFlow>;\n\n/** An object with an expression in it */\nexport interface ExpressionObject {\n /** The expression to run */\n exp?: Expression;\n}\n\n/** A state machine in the navigation */\nexport interface NavigationFlow {\n /** The first state to kick off the state machine */\n startState: string;\n\n /** An optional expression to run when this Flow starts */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run when this Flow ends */\n onEnd?: Expression | ExpressionObject;\n\n [key: string]:\n | undefined\n | string\n | Expression\n | ExpressionObject\n | NavigationFlowState;\n}\n\nexport type NavigationFlowTransition = Record<string, string>;\n\ninterface CommentBase {\n /** Add comments that will not be processing, but are useful for code explanation */\n _comment?: string;\n}\n\n/** The base representation of a state within a Flow */\nexport interface NavigationBaseState<T extends string> extends CommentBase {\n /** A property to determine the type of state this is */\n state_type: T;\n\n /** An optional expression to run when this view renders */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run before view transition */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * TS gets really confused with both the ActionState and the onStart state both declaring the `exp` property\n * So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'\n */\n exp?: T extends \"ACTION\" | \"ASYNC_ACTION\" ? Expression : never;\n}\n\n/** A generic state that can transition to another state */\nexport interface NavigationFlowTransitionableState<\n T extends string,\n> extends NavigationBaseState<T> {\n /** A mapping of transition-name to FlowState name */\n transitions: NavigationFlowTransition;\n}\n\n/** A state representing a view */\nexport interface NavigationFlowViewState extends NavigationFlowTransitionableState<\"VIEW\"> {\n /** An id corresponding to a view from the 'views' array */\n ref: string;\n\n /** View meta-properties */\n attributes?: {\n [key: string]: any;\n };\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/**\n * An END state of the flow.\n */\nexport interface NavigationFlowEndState extends NavigationBaseState<\"END\"> {\n /**\n * A description of _how_ the flow ended.\n * If this is a flow started from another flow, the outcome determines the flow transition\n */\n outcome: string;\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowActionState extends NavigationFlowTransitionableState<\"ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowAsyncActionState extends NavigationFlowTransitionableState<\"ASYNC_ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n\n /** Whether the expression(s) should be awaited before transitioning */\n await: boolean;\n}\n\n/**\n * External Flow states represent states in the FSM that can't be resolved internally in Player.\n * The flow will wait for the embedded application to manage moving to the next state via a transition\n */\nexport interface NavigationFlowExternalState extends NavigationFlowTransitionableState<\"EXTERNAL\"> {\n /** A reference for this external state */\n ref: string;\n /** Any additional properties are forwarded as options */\n [key: string]: unknown;\n}\n\nexport interface NavigationFlowFlowState extends NavigationFlowTransitionableState<\"FLOW\"> {\n /** A reference to a FLOW id state to run */\n ref: string;\n}\n\nexport type NavigationFlowState =\n | NavigationFlowViewState\n | NavigationFlowEndState\n | NavigationFlowFlowState\n | NavigationFlowActionState\n | NavigationFlowAsyncActionState\n | NavigationFlowExternalState;\n\n/** The data at the end of a flow */\nexport interface FlowResult {\n /** The outcome describes _how_ the flow ended (forwards, backwards, etc) */\n endState: NavigationFlowEndState;\n\n /** The serialized data-model */\n data?: any;\n}\n\n/** Any object that contains 1 or more templates */\nexport interface Templatable {\n /** A list of templates to process for this node */\n template?: Template[];\n}\n\n/** A template describes a mapping from a data array -> array of objects */\nexport interface Template<ValueType = unknown, Key extends string = string> {\n /** A pointer to the data-model containing an array of elements to map over */\n data: Binding;\n\n /**\n * The template to iterate over using each value in the supplied template data.\n * Any reference to _index_ is replaced with the current iteration index.\n */\n value: ValueType;\n\n /** should the template be recomputed when data changes */\n dynamic?: boolean;\n\n /**\n * A property on the parent object to store the new map under.\n * If it already exists, values are appended to the end.\n */\n output: Key;\n\n /** Specifies the template placement in relation to existing elements*/\n placement?: \"prepend\" | \"append\";\n}\n\n/**\n * The Schema organizes all content related to Data and it's types\n */\nexport declare namespace Schema {\n /** The authored schema object in the JSON payload */\n export interface Schema {\n /** The ROOT object is the top level object to use */\n ROOT: Node;\n\n /** Any additional keys are properties of the ROOT object */\n [key: string]: Node;\n }\n\n /** A Node describes a specific object in the tree */\n export interface Node {\n /** Each property describes a property of the object */\n [key: string]: DataTypes;\n }\n\n export type DataTypes = DataType | RecordType | ArrayType;\n\n /** Each prop in the object can have a specific DataType */\n export interface DataType<T = unknown> {\n /** The reference of the base type to use */\n type: string;\n\n /**\n * Any additional validations that are associated with this property\n * These will add to any base validations associated with the \"type\"\n */\n validation?: Validation.Reference[];\n\n /**\n * A reference to a specific data format to use.\n * If none is specified, will fallback to that of the base type\n */\n format?: Formatting.Reference;\n\n /**\n * A default value for this property.\n * Any reads for this property will result in this default value being written to the model.\n */\n default?: T;\n\n /** Any additional options */\n [key: string]: unknown;\n }\n /** Determines if the Datatype is a record object */\n export interface RecordType extends DataType {\n /** boolean to define if its a record */\n isRecord: boolean;\n\n /** This property is mutually exclusive with RecordType and can not be used with ArrayType */\n isArray?: never;\n }\n\n /** Determines if the DataType is an Array Object */\n export interface ArrayType extends DataType {\n /** boolean to define if its an array */\n isArray: boolean;\n\n /** This property is mutually exclusive with ArrayType and can not be used with RecordType */\n isRecord?: never;\n }\n}\n\n/** Namespace to wrap up core functionality to be used by the Language Service */\nexport declare namespace Language {\n /**\n * Helper to compliment `Schema.DataType` to provide a way to export a reference to a data type instead of the whole object\n */\n export interface DataTypeRef {\n /** Name of the type in Player Core */\n type: string;\n }\n}\n\n/** A spot for formatting */\nexport declare namespace Formatting {\n /** A reference to a specific formatter */\n export interface Reference {\n /** The name of the formatter (and de-formatter) to use */\n type: string;\n\n /** Any additional properties will be passed as options to the formatter function */\n [key: string]: unknown;\n }\n}\n\n/** A space for all thing validation */\nexport declare namespace Validation {\n /**\n * How serious are you about this error?\n * Warning validations are reserved for errors that could be ignored by the user without consequence\n * Errors must be fixed before proceeding\n */\n export type Severity = \"error\" | \"warning\";\n\n /**\n * When to _first_ start caring about a validation of a data-val.\n *\n * load - only check once the first time the binding appears on screen\n * change - check anytime the data changes\n * navigation - check once the user attempts to navigate away from a view\n */\n export type Trigger = \"navigation\" | \"change\" | \"load\";\n\n /**\n * Where the error/warning should be displayed.\n * - `field` is the default display target. This renders the error/warning directly underneath the field.\n * - `section` is used to display a message at a parent node that is designated as a \"section\"\n * - `page` a special section used to display a message at the top of the page.\n */\n export type DisplayTarget = \"page\" | \"section\" | \"field\";\n\n /** A reference to a validation object */\n export interface Reference {\n /**\n * The name of the referenced validation type\n * This will be used to lookup the proper handler\n */\n type: string;\n\n /** An optional means of overriding the default message if the validation is triggered */\n message?: string;\n\n /** An optional means of overriding the default severity of the validation if triggered */\n severity?: Severity;\n\n /** When to run this particular validation */\n trigger?: Trigger;\n\n /**\n * Each validation is passed the value of the data to run it's validation against.\n * By default, this is the value stored in the data-model (deformatted).\n * In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option\n */\n dataTarget?: \"formatted\" | \"deformatted\";\n\n /** Where the error should be displayed */\n displayTarget?: DisplayTarget;\n\n /**\n * If the validation blocks navigation\n * true/false - always/never block navigation\n * once - only block navigation if the validation has not been triggered before\n *\n * @default - true for errors, 'once' for warnings\n */\n blocking?: boolean | \"once\";\n\n /** Additional props to send down to a Validator */\n [key: string]: unknown;\n }\n\n export interface CrossfieldReference extends Reference {\n /** The binding to associate this validation with */\n ref?: Binding;\n\n /** Cross-field references and validation must run against the default (deformatted) value */\n dataTarget?: never;\n }\n}\n\nexport type View<T extends Asset = Asset> = unknown extends T[\"validation\"]\n ? T & {\n /** Each view can optionally supply a list of validations to run against a particular view */\n validation?: Array<Validation.CrossfieldReference>;\n }\n : T;\n\n/**\n * The JSON payload for running Player\n */\nexport interface Flow<T extends Asset = Asset> {\n /** A unique identifier for the flow */\n id: string;\n\n /** A list of views (each with an ID) that can be shown to a user */\n views?: Array<View<T>>;\n\n /**\n * The schema for the supplied (or referenced data).\n * This is used for validation, formatting, etc\n */\n schema?: Schema.Schema;\n\n /** Any initial data that the flow can use */\n data?: DataModel;\n\n /** A state machine to drive a user through the experience */\n navigation: Navigation;\n\n /** Other keys can be present. We just don't know what they are */\n [key: string]: unknown;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/types/src/index.ts"],"sourcesContent":["/**\n * An asset is the smallest unit of user interaction in a player view\n */\nexport interface Asset<T extends string = string> {\n /** Each asset requires a unique id per view */\n id: string;\n\n /** The asset type determines the semantics of how a user interacts with a page */\n type: T;\n\n [key: string]: unknown;\n}\n/**\n * An asset that contains a Binding.\n */\nexport interface AssetBinding extends Asset {\n /** A binding that points to somewhere in the data model */\n binding: Binding;\n}\n\n/** A single case statement to use in a switch */\nexport interface SwitchCase<T extends Asset = Asset> {\n /** The Asset to use if this case is applicable */\n asset: T;\n\n /** An expression to execute to determine if this case applies */\n case: Expression | true;\n}\n\n/** A switch can replace an asset with the applicable case on first render */\nexport type Switch<T extends Asset = Asset> = SwitchCase<T>[];\n\n/** An object that contains an asset */\nexport type AssetWrapper<T extends Asset = Asset> = {\n /** An asset instance */\n asset: T;\n\n [key: string]: unknown;\n};\n\nexport type AssetWrapperOrSwitch<T extends Asset = Asset> =\n | (AssetWrapper<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n dynamicSwitch?: never;\n\n /** The staticSwitch property can't exist at the same time as 'asset' */\n staticSwitch?: never;\n })\n | (StaticSwitch<T> & {\n /** The staticSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The staticSwitch property can't exist at the same time as 'dynamicSwitch' */\n dynamicSwitch?: never;\n })\n | (DynamicSwitch<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The dynamicSwitch property can't exist at the same time as 'staticSwitch' */\n staticSwitch?: never;\n });\n\nexport type AssetSwitch<T extends Asset = Asset> =\n | StaticSwitch<T>\n | DynamicSwitch<T>;\n\nexport interface StaticSwitch<T extends Asset = Asset> {\n /** A static switch only evaluates the applicable base on first render of the view */\n staticSwitch: Switch<T>;\n}\n\nexport interface DynamicSwitch<T extends Asset = Asset> {\n /** A dynamic switch re-evaluates the applicable case as data changes */\n dynamicSwitch: Switch<T>;\n}\n\n/**\n * Expressions are a specialized way of executing code.\n * If the expression is a composite, the last expression executed is the return value\n */\nexport type Expression = string | string[];\nexport type ExpressionRef = `@[${string}]@`;\n\n/**\n * Bindings describe locations in the data model.\n */\nexport type Binding = string;\nexport type BindingRef = `{{${Binding}}}`;\n\n/**\n * The data-model is the location that all user data is stored\n */\nexport type DataModel = Record<any, unknown>;\n\n/** The navigation section of the flow describes a State Machine for the user. */\nexport type Navigation = {\n /** The name of the Flow to begin on */\n BEGIN: string;\n} & Record<string, string | NavigationFlow>;\n\n/** An object with an expression in it */\nexport interface ExpressionObject {\n /** The expression to run */\n exp?: Expression;\n}\n\n/** A state machine in the navigation */\nexport interface NavigationFlow {\n /** The first state to kick off the state machine */\n startState: string;\n\n /** An optional expression to run when this Flow starts */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run when this Flow ends */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * An optional flow-level transitions map (fallback when node-level is not defined).\n * Used as a fallback when the current state doesn't have a transition defined.\n */\n transitions?: NavigationFlowTransition;\n\n /**\n * Optional flow-level error transitions map.\n * Maps error types directly to state names (no indirection through transitions map).\n */\n errorTransitions?: Record<string, string>;\n\n [key: string]:\n | undefined\n | string\n | Expression\n | ExpressionObject\n | NavigationFlowState\n | NavigationFlowTransition;\n}\n\nexport type NavigationFlowTransition = Record<string, string>;\n\ninterface CommentBase {\n /** Add comments that will not be processing, but are useful for code explanation */\n _comment?: string;\n}\n\n/** The base representation of a state within a Flow */\nexport interface NavigationBaseState<T extends string> extends CommentBase {\n /** A property to determine the type of state this is */\n state_type: T;\n\n /** An optional expression to run when this view renders */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run before view transition */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * TS gets really confused with both the ActionState and the onStart state both declaring the `exp` property\n * So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'\n */\n exp?: T extends \"ACTION\" | \"ASYNC_ACTION\" ? Expression : never;\n}\n\n/** A generic state that can transition to another state */\nexport interface NavigationFlowTransitionableState<T extends string>\n extends NavigationBaseState<T> {\n /** A mapping of transition-name to FlowState name */\n transitions: NavigationFlowTransition;\n\n /**\n * Optional error transitions map.\n * Maps error types directly to state names (no indirection through transitions map).\n */\n errorTransitions?: Record<string, string>;\n}\n\n/** A state representing a view */\nexport interface NavigationFlowViewState\n extends NavigationFlowTransitionableState<\"VIEW\"> {\n /** An id corresponding to a view from the 'views' array */\n ref: string;\n\n /** View meta-properties */\n attributes?: {\n [key: string]: any;\n };\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/**\n * An END state of the flow.\n */\nexport interface NavigationFlowEndState extends NavigationBaseState<\"END\"> {\n /**\n * A description of _how_ the flow ended.\n * If this is a flow started from another flow, the outcome determines the flow transition\n */\n outcome: string;\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowActionState\n extends NavigationFlowTransitionableState<\"ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowAsyncActionState\n extends NavigationFlowTransitionableState<\"ASYNC_ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n\n /** Whether the expression(s) should be awaited before transitioning */\n await: boolean;\n}\n\n/**\n * External Flow states represent states in the FSM that can't be resolved internally in Player.\n * The flow will wait for the embedded application to manage moving to the next state via a transition\n */\nexport interface NavigationFlowExternalState\n extends NavigationFlowTransitionableState<\"EXTERNAL\"> {\n /** A reference for this external state */\n ref: string;\n /** Any additional properties are forwarded as options */\n [key: string]: unknown;\n}\n\nexport interface NavigationFlowFlowState\n extends NavigationFlowTransitionableState<\"FLOW\"> {\n /** A reference to a FLOW id state to run */\n ref: string;\n}\n\nexport type NavigationFlowState =\n | NavigationFlowViewState\n | NavigationFlowEndState\n | NavigationFlowFlowState\n | NavigationFlowActionState\n | NavigationFlowAsyncActionState\n | NavigationFlowExternalState;\n\n/** The data at the end of a flow */\nexport interface FlowResult {\n /** The outcome describes _how_ the flow ended (forwards, backwards, etc) */\n endState: NavigationFlowEndState;\n\n /** The serialized data-model */\n data?: any;\n}\n\n/** Any object that contains 1 or more templates */\nexport interface Templatable {\n /** A list of templates to process for this node */\n template?: Template[];\n}\n\n/** A template describes a mapping from a data array -> array of objects */\nexport interface Template<ValueType = unknown, Key extends string = string> {\n /** A pointer to the data-model containing an array of elements to map over */\n data: Binding;\n\n /**\n * The template to iterate over using each value in the supplied template data.\n * Any reference to _index_ is replaced with the current iteration index.\n */\n value: ValueType;\n\n /** should the template be recomputed when data changes */\n dynamic?: boolean;\n\n /**\n * A property on the parent object to store the new map under.\n * If it already exists, values are appended to the end.\n */\n output: Key;\n\n /** Specifies the template placement in relation to existing elements*/\n placement?: \"prepend\" | \"append\";\n}\n\n/**\n * The Schema organizes all content related to Data and it's types\n */\nexport declare namespace Schema {\n /** The authored schema object in the JSON payload */\n export interface Schema {\n /** The ROOT object is the top level object to use */\n ROOT: Node;\n\n /** Any additional keys are properties of the ROOT object */\n [key: string]: Node;\n }\n\n /** A Node describes a specific object in the tree */\n export interface Node {\n /** Each property describes a property of the object */\n [key: string]: DataTypes;\n }\n\n export type DataTypes = DataType | RecordType | ArrayType;\n\n /** Each prop in the object can have a specific DataType */\n export interface DataType<T = unknown> {\n /** The reference of the base type to use */\n type: string;\n\n /**\n * Any additional validations that are associated with this property\n * These will add to any base validations associated with the \"type\"\n */\n validation?: Validation.Reference[];\n\n /**\n * A reference to a specific data format to use.\n * If none is specified, will fallback to that of the base type\n */\n format?: Formatting.Reference;\n\n /**\n * A default value for this property.\n * Any reads for this property will result in this default value being written to the model.\n */\n default?: T;\n\n /** Any additional options */\n [key: string]: unknown;\n }\n /** Determines if the Datatype is a record object */\n export interface RecordType extends DataType {\n /** boolean to define if its a record */\n isRecord: boolean;\n\n /** This property is mutually exclusive with RecordType and can not be used with ArrayType */\n isArray?: never;\n }\n\n /** Determines if the DataType is an Array Object */\n export interface ArrayType extends DataType {\n /** boolean to define if its an array */\n isArray: boolean;\n\n /** This property is mutually exclusive with ArrayType and can not be used with RecordType */\n isRecord?: never;\n }\n}\n\n/** Namespace to wrap up core functionality to be used by the Language Service */\nexport declare namespace Language {\n /**\n * Helper to compliment `Schema.DataType` to provide a way to export a reference to a data type instead of the whole object\n */\n export interface DataTypeRef {\n /** Name of the type in Player Core */\n type: string;\n }\n}\n\n/** A spot for formatting */\nexport declare namespace Formatting {\n /** A reference to a specific formatter */\n export interface Reference {\n /** The name of the formatter (and de-formatter) to use */\n type: string;\n\n /** Any additional properties will be passed as options to the formatter function */\n [key: string]: unknown;\n }\n}\n\n/** A space for all thing validation */\nexport declare namespace Validation {\n /**\n * How serious are you about this error?\n * Warning validations are reserved for errors that could be ignored by the user without consequence\n * Errors must be fixed before proceeding\n */\n export type Severity = \"error\" | \"warning\";\n\n /**\n * When to _first_ start caring about a validation of a data-val.\n *\n * load - only check once the first time the binding appears on screen\n * change - check anytime the data changes\n * navigation - check once the user attempts to navigate away from a view\n */\n export type Trigger = \"navigation\" | \"change\" | \"load\";\n\n /**\n * Where the error/warning should be displayed.\n * - `field` is the default display target. This renders the error/warning directly underneath the field.\n * - `section` is used to display a message at a parent node that is designated as a \"section\"\n * - `page` a special section used to display a message at the top of the page.\n */\n export type DisplayTarget = \"page\" | \"section\" | \"field\";\n\n /** A reference to a validation object */\n export interface Reference {\n /**\n * The name of the referenced validation type\n * This will be used to lookup the proper handler\n */\n type: string;\n\n /** An optional means of overriding the default message if the validation is triggered */\n message?: string;\n\n /** An optional means of overriding the default severity of the validation if triggered */\n severity?: Severity;\n\n /** When to run this particular validation */\n trigger?: Trigger;\n\n /**\n * Each validation is passed the value of the data to run it's validation against.\n * By default, this is the value stored in the data-model (deformatted).\n * In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option\n */\n dataTarget?: \"formatted\" | \"deformatted\";\n\n /** Where the error should be displayed */\n displayTarget?: DisplayTarget;\n\n /**\n * If the validation blocks navigation\n * true/false - always/never block navigation\n * once - only block navigation if the validation has not been triggered before\n *\n * @default - true for errors, 'once' for warnings\n */\n blocking?: boolean | \"once\";\n\n /** Additional props to send down to a Validator */\n [key: string]: unknown;\n }\n\n export interface CrossfieldReference extends Reference {\n /** The binding to associate this validation with */\n ref?: Binding;\n\n /** Cross-field references and validation must run against the default (deformatted) value */\n dataTarget?: never;\n }\n}\n\nexport type View<T extends Asset = Asset> = unknown extends T[\"validation\"]\n ? T & {\n /** Each view can optionally supply a list of validations to run against a particular view */\n validation?: Array<Validation.CrossfieldReference>;\n }\n : T;\n\n/**\n * The JSON payload for running Player\n */\nexport interface Flow<T extends Asset = Asset> {\n /** A unique identifier for the flow */\n id: string;\n\n /** A list of views (each with an ID) that can be shown to a user */\n views?: Array<View<T>>;\n\n /**\n * The schema for the supplied (or referenced data).\n * This is used for validation, formatting, etc\n */\n schema?: Schema.Schema;\n\n /** Any initial data that the flow can use */\n data?: DataModel;\n\n /** A state machine to drive a user through the experience */\n navigation: Navigation;\n\n /** Other keys can be present. We just don't know what they are */\n [key: string]: unknown;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1582,6 +1582,36 @@
1582
1582
  "title": "NavigationFlow.onEnd",
1583
1583
  "description": "An optional expression to run when this Flow ends"
1584
1584
  }
1585
+ },
1586
+ "transitions": {
1587
+ "required": false,
1588
+ "node": {
1589
+ "source": "core/types/src/index.ts",
1590
+ "name": "NavigationFlowTransition",
1591
+ "type": "record",
1592
+ "keyType": {
1593
+ "type": "string"
1594
+ },
1595
+ "valueType": {
1596
+ "type": "string"
1597
+ },
1598
+ "title": "NavigationFlow.transitions",
1599
+ "description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
1600
+ }
1601
+ },
1602
+ "errorTransitions": {
1603
+ "required": false,
1604
+ "node": {
1605
+ "type": "record",
1606
+ "keyType": {
1607
+ "type": "string"
1608
+ },
1609
+ "valueType": {
1610
+ "type": "string"
1611
+ },
1612
+ "title": "NavigationFlow.errorTransitions",
1613
+ "description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
1614
+ }
1585
1615
  }
1586
1616
  },
1587
1617
  "additionalProperties": {
@@ -1734,6 +1764,20 @@
1734
1764
  "description": "A mapping of transition-name to FlowState name"
1735
1765
  }
1736
1766
  },
1767
+ "errorTransitions": {
1768
+ "required": false,
1769
+ "node": {
1770
+ "type": "record",
1771
+ "keyType": {
1772
+ "type": "string"
1773
+ },
1774
+ "valueType": {
1775
+ "type": "string"
1776
+ },
1777
+ "title": "NavigationFlowTransitionableState.errorTransitions",
1778
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
1779
+ }
1780
+ },
1737
1781
  "ref": {
1738
1782
  "required": true,
1739
1783
  "node": {
@@ -1986,6 +2030,20 @@
1986
2030
  "description": "A mapping of transition-name to FlowState name"
1987
2031
  }
1988
2032
  },
2033
+ "errorTransitions": {
2034
+ "required": false,
2035
+ "node": {
2036
+ "type": "record",
2037
+ "keyType": {
2038
+ "type": "string"
2039
+ },
2040
+ "valueType": {
2041
+ "type": "string"
2042
+ },
2043
+ "title": "NavigationFlowTransitionableState.errorTransitions",
2044
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
2045
+ }
2046
+ },
1989
2047
  "ref": {
1990
2048
  "required": true,
1991
2049
  "node": {
@@ -2112,6 +2170,20 @@
2112
2170
  "title": "NavigationFlowTransitionableState.transitions",
2113
2171
  "description": "A mapping of transition-name to FlowState name"
2114
2172
  }
2173
+ },
2174
+ "errorTransitions": {
2175
+ "required": false,
2176
+ "node": {
2177
+ "type": "record",
2178
+ "keyType": {
2179
+ "type": "string"
2180
+ },
2181
+ "valueType": {
2182
+ "type": "string"
2183
+ },
2184
+ "title": "NavigationFlowTransitionableState.errorTransitions",
2185
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
2186
+ }
2115
2187
  }
2116
2188
  },
2117
2189
  "additionalProperties": false,
@@ -2233,6 +2305,20 @@
2233
2305
  "description": "A mapping of transition-name to FlowState name"
2234
2306
  }
2235
2307
  },
2308
+ "errorTransitions": {
2309
+ "required": false,
2310
+ "node": {
2311
+ "type": "record",
2312
+ "keyType": {
2313
+ "type": "string"
2314
+ },
2315
+ "valueType": {
2316
+ "type": "string"
2317
+ },
2318
+ "title": "NavigationFlowTransitionableState.errorTransitions",
2319
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
2320
+ }
2321
+ },
2236
2322
  "await": {
2237
2323
  "required": true,
2238
2324
  "node": {
@@ -2359,6 +2445,20 @@
2359
2445
  "description": "A mapping of transition-name to FlowState name"
2360
2446
  }
2361
2447
  },
2448
+ "errorTransitions": {
2449
+ "required": false,
2450
+ "node": {
2451
+ "type": "record",
2452
+ "keyType": {
2453
+ "type": "string"
2454
+ },
2455
+ "valueType": {
2456
+ "type": "string"
2457
+ },
2458
+ "title": "NavigationFlowTransitionableState.errorTransitions",
2459
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
2460
+ }
2461
+ },
2362
2462
  "ref": {
2363
2463
  "required": true,
2364
2464
  "node": {
@@ -2376,6 +2476,18 @@
2376
2476
  }
2377
2477
  ],
2378
2478
  "title": "NavigationFlowState"
2479
+ },
2480
+ {
2481
+ "source": "core/types/src/index.ts",
2482
+ "name": "NavigationFlowTransition",
2483
+ "type": "record",
2484
+ "keyType": {
2485
+ "type": "string"
2486
+ },
2487
+ "valueType": {
2488
+ "type": "string"
2489
+ },
2490
+ "title": "NavigationFlowTransition"
2379
2491
  }
2380
2492
  ]
2381
2493
  },
@@ -108,6 +108,36 @@
108
108
  "title": "NavigationFlow.onEnd",
109
109
  "description": "An optional expression to run when this Flow ends"
110
110
  }
111
+ },
112
+ "transitions": {
113
+ "required": false,
114
+ "node": {
115
+ "source": "core/types/src/index.ts",
116
+ "name": "NavigationFlowTransition",
117
+ "type": "record",
118
+ "keyType": {
119
+ "type": "string"
120
+ },
121
+ "valueType": {
122
+ "type": "string"
123
+ },
124
+ "title": "NavigationFlow.transitions",
125
+ "description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
126
+ }
127
+ },
128
+ "errorTransitions": {
129
+ "required": false,
130
+ "node": {
131
+ "type": "record",
132
+ "keyType": {
133
+ "type": "string"
134
+ },
135
+ "valueType": {
136
+ "type": "string"
137
+ },
138
+ "title": "NavigationFlow.errorTransitions",
139
+ "description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
140
+ }
111
141
  }
112
142
  },
113
143
  "additionalProperties": {
@@ -260,6 +290,20 @@
260
290
  "description": "A mapping of transition-name to FlowState name"
261
291
  }
262
292
  },
293
+ "errorTransitions": {
294
+ "required": false,
295
+ "node": {
296
+ "type": "record",
297
+ "keyType": {
298
+ "type": "string"
299
+ },
300
+ "valueType": {
301
+ "type": "string"
302
+ },
303
+ "title": "NavigationFlowTransitionableState.errorTransitions",
304
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
305
+ }
306
+ },
263
307
  "ref": {
264
308
  "required": true,
265
309
  "node": {
@@ -512,6 +556,20 @@
512
556
  "description": "A mapping of transition-name to FlowState name"
513
557
  }
514
558
  },
559
+ "errorTransitions": {
560
+ "required": false,
561
+ "node": {
562
+ "type": "record",
563
+ "keyType": {
564
+ "type": "string"
565
+ },
566
+ "valueType": {
567
+ "type": "string"
568
+ },
569
+ "title": "NavigationFlowTransitionableState.errorTransitions",
570
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
571
+ }
572
+ },
515
573
  "ref": {
516
574
  "required": true,
517
575
  "node": {
@@ -638,6 +696,20 @@
638
696
  "title": "NavigationFlowTransitionableState.transitions",
639
697
  "description": "A mapping of transition-name to FlowState name"
640
698
  }
699
+ },
700
+ "errorTransitions": {
701
+ "required": false,
702
+ "node": {
703
+ "type": "record",
704
+ "keyType": {
705
+ "type": "string"
706
+ },
707
+ "valueType": {
708
+ "type": "string"
709
+ },
710
+ "title": "NavigationFlowTransitionableState.errorTransitions",
711
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
712
+ }
641
713
  }
642
714
  },
643
715
  "additionalProperties": false,
@@ -759,6 +831,20 @@
759
831
  "description": "A mapping of transition-name to FlowState name"
760
832
  }
761
833
  },
834
+ "errorTransitions": {
835
+ "required": false,
836
+ "node": {
837
+ "type": "record",
838
+ "keyType": {
839
+ "type": "string"
840
+ },
841
+ "valueType": {
842
+ "type": "string"
843
+ },
844
+ "title": "NavigationFlowTransitionableState.errorTransitions",
845
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
846
+ }
847
+ },
762
848
  "await": {
763
849
  "required": true,
764
850
  "node": {
@@ -885,6 +971,20 @@
885
971
  "description": "A mapping of transition-name to FlowState name"
886
972
  }
887
973
  },
974
+ "errorTransitions": {
975
+ "required": false,
976
+ "node": {
977
+ "type": "record",
978
+ "keyType": {
979
+ "type": "string"
980
+ },
981
+ "valueType": {
982
+ "type": "string"
983
+ },
984
+ "title": "NavigationFlowTransitionableState.errorTransitions",
985
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
986
+ }
987
+ },
888
988
  "ref": {
889
989
  "required": true,
890
990
  "node": {
@@ -902,6 +1002,18 @@
902
1002
  }
903
1003
  ],
904
1004
  "title": "NavigationFlowState"
1005
+ },
1006
+ {
1007
+ "source": "core/types/src/index.ts",
1008
+ "name": "NavigationFlowTransition",
1009
+ "type": "record",
1010
+ "keyType": {
1011
+ "type": "string"
1012
+ },
1013
+ "valueType": {
1014
+ "type": "string"
1015
+ },
1016
+ "title": "NavigationFlowTransition"
905
1017
  }
906
1018
  ]
907
1019
  },
@@ -78,6 +78,36 @@
78
78
  "title": "NavigationFlow.onEnd",
79
79
  "description": "An optional expression to run when this Flow ends"
80
80
  }
81
+ },
82
+ "transitions": {
83
+ "required": false,
84
+ "node": {
85
+ "source": "core/types/src/index.ts",
86
+ "name": "NavigationFlowTransition",
87
+ "type": "record",
88
+ "keyType": {
89
+ "type": "string"
90
+ },
91
+ "valueType": {
92
+ "type": "string"
93
+ },
94
+ "title": "NavigationFlow.transitions",
95
+ "description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
96
+ }
97
+ },
98
+ "errorTransitions": {
99
+ "required": false,
100
+ "node": {
101
+ "type": "record",
102
+ "keyType": {
103
+ "type": "string"
104
+ },
105
+ "valueType": {
106
+ "type": "string"
107
+ },
108
+ "title": "NavigationFlow.errorTransitions",
109
+ "description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
110
+ }
81
111
  }
82
112
  },
83
113
  "additionalProperties": {
@@ -230,6 +260,20 @@
230
260
  "description": "A mapping of transition-name to FlowState name"
231
261
  }
232
262
  },
263
+ "errorTransitions": {
264
+ "required": false,
265
+ "node": {
266
+ "type": "record",
267
+ "keyType": {
268
+ "type": "string"
269
+ },
270
+ "valueType": {
271
+ "type": "string"
272
+ },
273
+ "title": "NavigationFlowTransitionableState.errorTransitions",
274
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
275
+ }
276
+ },
233
277
  "ref": {
234
278
  "required": true,
235
279
  "node": {
@@ -482,6 +526,20 @@
482
526
  "description": "A mapping of transition-name to FlowState name"
483
527
  }
484
528
  },
529
+ "errorTransitions": {
530
+ "required": false,
531
+ "node": {
532
+ "type": "record",
533
+ "keyType": {
534
+ "type": "string"
535
+ },
536
+ "valueType": {
537
+ "type": "string"
538
+ },
539
+ "title": "NavigationFlowTransitionableState.errorTransitions",
540
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
541
+ }
542
+ },
485
543
  "ref": {
486
544
  "required": true,
487
545
  "node": {
@@ -608,6 +666,20 @@
608
666
  "title": "NavigationFlowTransitionableState.transitions",
609
667
  "description": "A mapping of transition-name to FlowState name"
610
668
  }
669
+ },
670
+ "errorTransitions": {
671
+ "required": false,
672
+ "node": {
673
+ "type": "record",
674
+ "keyType": {
675
+ "type": "string"
676
+ },
677
+ "valueType": {
678
+ "type": "string"
679
+ },
680
+ "title": "NavigationFlowTransitionableState.errorTransitions",
681
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
682
+ }
611
683
  }
612
684
  },
613
685
  "additionalProperties": false,
@@ -729,6 +801,20 @@
729
801
  "description": "A mapping of transition-name to FlowState name"
730
802
  }
731
803
  },
804
+ "errorTransitions": {
805
+ "required": false,
806
+ "node": {
807
+ "type": "record",
808
+ "keyType": {
809
+ "type": "string"
810
+ },
811
+ "valueType": {
812
+ "type": "string"
813
+ },
814
+ "title": "NavigationFlowTransitionableState.errorTransitions",
815
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
816
+ }
817
+ },
732
818
  "await": {
733
819
  "required": true,
734
820
  "node": {
@@ -855,6 +941,20 @@
855
941
  "description": "A mapping of transition-name to FlowState name"
856
942
  }
857
943
  },
944
+ "errorTransitions": {
945
+ "required": false,
946
+ "node": {
947
+ "type": "record",
948
+ "keyType": {
949
+ "type": "string"
950
+ },
951
+ "valueType": {
952
+ "type": "string"
953
+ },
954
+ "title": "NavigationFlowTransitionableState.errorTransitions",
955
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
956
+ }
957
+ },
858
958
  "ref": {
859
959
  "required": true,
860
960
  "node": {
@@ -872,6 +972,18 @@
872
972
  }
873
973
  ],
874
974
  "title": "NavigationFlowState"
975
+ },
976
+ {
977
+ "source": "core/types/src/index.ts",
978
+ "name": "NavigationFlowTransition",
979
+ "type": "record",
980
+ "keyType": {
981
+ "type": "string"
982
+ },
983
+ "valueType": {
984
+ "type": "string"
985
+ },
986
+ "title": "NavigationFlowTransition"
875
987
  }
876
988
  ]
877
989
  },
@@ -112,6 +112,20 @@
112
112
  "title": "NavigationFlowTransitionableState.transitions",
113
113
  "description": "A mapping of transition-name to FlowState name"
114
114
  }
115
+ },
116
+ "errorTransitions": {
117
+ "required": false,
118
+ "node": {
119
+ "type": "record",
120
+ "keyType": {
121
+ "type": "string"
122
+ },
123
+ "valueType": {
124
+ "type": "string"
125
+ },
126
+ "title": "NavigationFlowTransitionableState.errorTransitions",
127
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
128
+ }
115
129
  }
116
130
  },
117
131
  "additionalProperties": false,
@@ -113,6 +113,20 @@
113
113
  "description": "A mapping of transition-name to FlowState name"
114
114
  }
115
115
  },
116
+ "errorTransitions": {
117
+ "required": false,
118
+ "node": {
119
+ "type": "record",
120
+ "keyType": {
121
+ "type": "string"
122
+ },
123
+ "valueType": {
124
+ "type": "string"
125
+ },
126
+ "title": "NavigationFlowTransitionableState.errorTransitions",
127
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
128
+ }
129
+ },
116
130
  "await": {
117
131
  "required": true,
118
132
  "node": {
@@ -111,6 +111,20 @@
111
111
  "description": "A mapping of transition-name to FlowState name"
112
112
  }
113
113
  },
114
+ "errorTransitions": {
115
+ "required": false,
116
+ "node": {
117
+ "type": "record",
118
+ "keyType": {
119
+ "type": "string"
120
+ },
121
+ "valueType": {
122
+ "type": "string"
123
+ },
124
+ "title": "NavigationFlowTransitionableState.errorTransitions",
125
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
126
+ }
127
+ },
114
128
  "ref": {
115
129
  "required": true,
116
130
  "node": {
@@ -111,6 +111,20 @@
111
111
  "description": "A mapping of transition-name to FlowState name"
112
112
  }
113
113
  },
114
+ "errorTransitions": {
115
+ "required": false,
116
+ "node": {
117
+ "type": "record",
118
+ "keyType": {
119
+ "type": "string"
120
+ },
121
+ "valueType": {
122
+ "type": "string"
123
+ },
124
+ "title": "NavigationFlowTransitionableState.errorTransitions",
125
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
126
+ }
127
+ },
114
128
  "ref": {
115
129
  "required": true,
116
130
  "node": {
@@ -116,6 +116,20 @@
116
116
  "description": "A mapping of transition-name to FlowState name"
117
117
  }
118
118
  },
119
+ "errorTransitions": {
120
+ "required": false,
121
+ "node": {
122
+ "type": "record",
123
+ "keyType": {
124
+ "type": "string"
125
+ },
126
+ "valueType": {
127
+ "type": "string"
128
+ },
129
+ "title": "NavigationFlowTransitionableState.errorTransitions",
130
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
131
+ }
132
+ },
119
133
  "ref": {
120
134
  "required": true,
121
135
  "node": {
@@ -368,6 +382,20 @@
368
382
  "description": "A mapping of transition-name to FlowState name"
369
383
  }
370
384
  },
385
+ "errorTransitions": {
386
+ "required": false,
387
+ "node": {
388
+ "type": "record",
389
+ "keyType": {
390
+ "type": "string"
391
+ },
392
+ "valueType": {
393
+ "type": "string"
394
+ },
395
+ "title": "NavigationFlowTransitionableState.errorTransitions",
396
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
397
+ }
398
+ },
371
399
  "ref": {
372
400
  "required": true,
373
401
  "node": {
@@ -494,6 +522,20 @@
494
522
  "title": "NavigationFlowTransitionableState.transitions",
495
523
  "description": "A mapping of transition-name to FlowState name"
496
524
  }
525
+ },
526
+ "errorTransitions": {
527
+ "required": false,
528
+ "node": {
529
+ "type": "record",
530
+ "keyType": {
531
+ "type": "string"
532
+ },
533
+ "valueType": {
534
+ "type": "string"
535
+ },
536
+ "title": "NavigationFlowTransitionableState.errorTransitions",
537
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
538
+ }
497
539
  }
498
540
  },
499
541
  "additionalProperties": false,
@@ -615,6 +657,20 @@
615
657
  "description": "A mapping of transition-name to FlowState name"
616
658
  }
617
659
  },
660
+ "errorTransitions": {
661
+ "required": false,
662
+ "node": {
663
+ "type": "record",
664
+ "keyType": {
665
+ "type": "string"
666
+ },
667
+ "valueType": {
668
+ "type": "string"
669
+ },
670
+ "title": "NavigationFlowTransitionableState.errorTransitions",
671
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
672
+ }
673
+ },
618
674
  "await": {
619
675
  "required": true,
620
676
  "node": {
@@ -741,6 +797,20 @@
741
797
  "description": "A mapping of transition-name to FlowState name"
742
798
  }
743
799
  },
800
+ "errorTransitions": {
801
+ "required": false,
802
+ "node": {
803
+ "type": "record",
804
+ "keyType": {
805
+ "type": "string"
806
+ },
807
+ "valueType": {
808
+ "type": "string"
809
+ },
810
+ "title": "NavigationFlowTransitionableState.errorTransitions",
811
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
812
+ }
813
+ },
744
814
  "ref": {
745
815
  "required": true,
746
816
  "node": {
@@ -139,6 +139,20 @@
139
139
  "title": "NavigationFlowTransitionableState.transitions",
140
140
  "description": "A mapping of transition-name to FlowState name"
141
141
  }
142
+ },
143
+ "errorTransitions": {
144
+ "required": false,
145
+ "node": {
146
+ "type": "record",
147
+ "keyType": {
148
+ "type": "string"
149
+ },
150
+ "valueType": {
151
+ "type": "string"
152
+ },
153
+ "title": "NavigationFlowTransitionableState.errorTransitions",
154
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
155
+ }
142
156
  }
143
157
  },
144
158
  "additionalProperties": false,
@@ -111,6 +111,20 @@
111
111
  "description": "A mapping of transition-name to FlowState name"
112
112
  }
113
113
  },
114
+ "errorTransitions": {
115
+ "required": false,
116
+ "node": {
117
+ "type": "record",
118
+ "keyType": {
119
+ "type": "string"
120
+ },
121
+ "valueType": {
122
+ "type": "string"
123
+ },
124
+ "title": "NavigationFlowTransitionableState.errorTransitions",
125
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
126
+ }
127
+ },
114
128
  "ref": {
115
129
  "required": true,
116
130
  "node": {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "types"
7
7
  ],
8
8
  "name": "@player-ui/types",
9
- "version": "0.15.3-next.3",
9
+ "version": "0.15.4--canary.881.37421",
10
10
  "main": "dist/cjs/index.cjs",
11
11
  "module": "dist/index.legacy-esm.js",
12
12
  "types": "types/index.d.ts",
package/src/index.ts CHANGED
@@ -116,12 +116,25 @@ export interface NavigationFlow {
116
116
  /** An optional expression to run when this Flow ends */
117
117
  onEnd?: Expression | ExpressionObject;
118
118
 
119
+ /**
120
+ * An optional flow-level transitions map (fallback when node-level is not defined).
121
+ * Used as a fallback when the current state doesn't have a transition defined.
122
+ */
123
+ transitions?: NavigationFlowTransition;
124
+
125
+ /**
126
+ * Optional flow-level error transitions map.
127
+ * Maps error types directly to state names (no indirection through transitions map).
128
+ */
129
+ errorTransitions?: Record<string, string>;
130
+
119
131
  [key: string]:
120
132
  | undefined
121
133
  | string
122
134
  | Expression
123
135
  | ExpressionObject
124
- | NavigationFlowState;
136
+ | NavigationFlowState
137
+ | NavigationFlowTransition;
125
138
  }
126
139
 
127
140
  export type NavigationFlowTransition = Record<string, string>;
@@ -150,15 +163,21 @@ export interface NavigationBaseState<T extends string> extends CommentBase {
150
163
  }
151
164
 
152
165
  /** A generic state that can transition to another state */
153
- export interface NavigationFlowTransitionableState<
154
- T extends string,
155
- > extends NavigationBaseState<T> {
166
+ export interface NavigationFlowTransitionableState<T extends string>
167
+ extends NavigationBaseState<T> {
156
168
  /** A mapping of transition-name to FlowState name */
157
169
  transitions: NavigationFlowTransition;
170
+
171
+ /**
172
+ * Optional error transitions map.
173
+ * Maps error types directly to state names (no indirection through transitions map).
174
+ */
175
+ errorTransitions?: Record<string, string>;
158
176
  }
159
177
 
160
178
  /** A state representing a view */
161
- export interface NavigationFlowViewState extends NavigationFlowTransitionableState<"VIEW"> {
179
+ export interface NavigationFlowViewState
180
+ extends NavigationFlowTransitionableState<"VIEW"> {
162
181
  /** An id corresponding to a view from the 'views' array */
163
182
  ref: string;
164
183
 
@@ -186,7 +205,8 @@ export interface NavigationFlowEndState extends NavigationBaseState<"END"> {
186
205
  }
187
206
 
188
207
  /** Action states execute an expression to determine the next state to transition to */
189
- export interface NavigationFlowActionState extends NavigationFlowTransitionableState<"ACTION"> {
208
+ export interface NavigationFlowActionState
209
+ extends NavigationFlowTransitionableState<"ACTION"> {
190
210
  /**
191
211
  * An expression to execute.
192
212
  * The return value determines the transition to take
@@ -195,7 +215,8 @@ export interface NavigationFlowActionState extends NavigationFlowTransitionableS
195
215
  }
196
216
 
197
217
  /** Action states execute an expression to determine the next state to transition to */
198
- export interface NavigationFlowAsyncActionState extends NavigationFlowTransitionableState<"ASYNC_ACTION"> {
218
+ export interface NavigationFlowAsyncActionState
219
+ extends NavigationFlowTransitionableState<"ASYNC_ACTION"> {
199
220
  /**
200
221
  * An expression to execute.
201
222
  * The return value determines the transition to take
@@ -210,14 +231,16 @@ export interface NavigationFlowAsyncActionState extends NavigationFlowTransition
210
231
  * External Flow states represent states in the FSM that can't be resolved internally in Player.
211
232
  * The flow will wait for the embedded application to manage moving to the next state via a transition
212
233
  */
213
- export interface NavigationFlowExternalState extends NavigationFlowTransitionableState<"EXTERNAL"> {
234
+ export interface NavigationFlowExternalState
235
+ extends NavigationFlowTransitionableState<"EXTERNAL"> {
214
236
  /** A reference for this external state */
215
237
  ref: string;
216
238
  /** Any additional properties are forwarded as options */
217
239
  [key: string]: unknown;
218
240
  }
219
241
 
220
- export interface NavigationFlowFlowState extends NavigationFlowTransitionableState<"FLOW"> {
242
+ export interface NavigationFlowFlowState
243
+ extends NavigationFlowTransitionableState<"FLOW"> {
221
244
  /** A reference to a FLOW id state to run */
222
245
  ref: string;
223
246
  }
package/types/index.d.ts CHANGED
@@ -88,7 +88,17 @@ export interface NavigationFlow {
88
88
  onStart?: Expression | ExpressionObject;
89
89
  /** An optional expression to run when this Flow ends */
90
90
  onEnd?: Expression | ExpressionObject;
91
- [key: string]: undefined | string | Expression | ExpressionObject | NavigationFlowState;
91
+ /**
92
+ * An optional flow-level transitions map (fallback when node-level is not defined).
93
+ * Used as a fallback when the current state doesn't have a transition defined.
94
+ */
95
+ transitions?: NavigationFlowTransition;
96
+ /**
97
+ * Optional flow-level error transitions map.
98
+ * Maps error types directly to state names (no indirection through transitions map).
99
+ */
100
+ errorTransitions?: Record<string, string>;
101
+ [key: string]: undefined | string | Expression | ExpressionObject | NavigationFlowState | NavigationFlowTransition;
92
102
  }
93
103
  export type NavigationFlowTransition = Record<string, string>;
94
104
  interface CommentBase {
@@ -113,6 +123,11 @@ export interface NavigationBaseState<T extends string> extends CommentBase {
113
123
  export interface NavigationFlowTransitionableState<T extends string> extends NavigationBaseState<T> {
114
124
  /** A mapping of transition-name to FlowState name */
115
125
  transitions: NavigationFlowTransition;
126
+ /**
127
+ * Optional error transitions map.
128
+ * Maps error types directly to state names (no indirection through transitions map).
129
+ */
130
+ errorTransitions?: Record<string, string>;
116
131
  }
117
132
  /** A state representing a view */
118
133
  export interface NavigationFlowViewState extends NavigationFlowTransitionableState<"VIEW"> {