@koordinates/xstate-tree 4.1.2 → 4.1.3

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.
@@ -77,7 +77,8 @@ export function buildTestRootComponent(machine, logger) {
77
77
  if (!machine.meta) {
78
78
  throw new Error("Root machine has no meta");
79
79
  }
80
- if (!machine.meta.view) {
80
+ if ((machine.meta.builderVersion === 1 && !machine.meta.view) ||
81
+ (machine.meta.builderVersion === 2 && !machine.meta.View)) {
81
82
  throw new Error("Root machine has no associated view");
82
83
  }
83
84
  const onChangeEmitter = new TinyEmitter();
@@ -202,7 +202,7 @@ export declare function buildSelectors<TMachine extends AnyStateMachine, TSelect
202
202
  *
203
203
  * It also delays for 5ms to ensure any React re-rendering happens in response to the state transition
204
204
  */
205
- export declare function buildTestRootComponent<TMachine extends AnyStateMachine, TSelectors extends AnySelector, TActions extends AnyActions, TContext = ContextFrom<TMachine>>(machine: StateMachine<TContext, XstateTreeMachineStateSchemaV1<TMachine, TSelectors, TActions>, EventFrom<TMachine>>, logger: typeof console.log): {
205
+ export declare function buildTestRootComponent<TMachine extends AnyStateMachine, TSelectors extends AnySelector, TActions extends AnyActions, TContext = ContextFrom<TMachine>>(machine: StateMachine<TContext, XstateTreeMachineStateSchemaV1<TMachine, TSelectors, TActions> | XstateTreeMachineStateSchemaV2<TMachine, TSelectors, TActions>, EventFrom<TMachine>>, logger: typeof console.log): {
206
206
  rootComponent: () => JSX.Element | null;
207
207
  addTransitionListener: (listener: () => void) => void;
208
208
  awaitTransition(): Promise<void>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@koordinates/xstate-tree",
3
3
  "main": "lib/index.js",
4
4
  "types": "lib/xstate-tree.d.ts",
5
- "version": "4.1.2",
5
+ "version": "4.1.3",
6
6
  "license": "MIT",
7
7
  "description": "Build UIs with Actors using xstate and React",
8
8
  "keywords": [