@xmachines/docs 1.0.0-beta.16 → 1.0.0-beta.17
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/api/@xmachines/play/README.md +56 -17
- package/api/@xmachines/play/classes/PlayError.md +240 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +4 -4
- package/api/@xmachines/play-actor/README.md +32 -31
- package/api/@xmachines/play-actor/classes/AbstractActor.md +20 -19
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +37 -0
- package/api/@xmachines/play-actor/interfaces/Routable.md +5 -4
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +6 -6
- package/api/@xmachines/play-actor/interfaces/Viewable.md +8 -8
- package/api/@xmachines/play-dom/README.md +36 -0
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +83 -0
- package/api/@xmachines/play-dom/functions/connectRenderer.md +51 -0
- package/api/@xmachines/play-dom/functions/renderSpec.md +28 -0
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +18 -0
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +18 -0
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +14 -0
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +23 -0
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +11 -0
- package/api/@xmachines/play-react/README.md +226 -305
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/defineRegistry.md +47 -0
- package/api/@xmachines/play-react/functions/useActor.md +13 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/functions/useStateBinding.md +32 -0
- package/api/@xmachines/play-react/interfaces/ComponentContext.md +35 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +15 -7
- package/api/@xmachines/play-react/type-aliases/ComponentFn.md +34 -0
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +18 -30
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +32 -32
- package/api/@xmachines/play-react-router/classes/RouteMap.md +5 -5
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/README.md +51 -0
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +6 -6
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +33 -35
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-router/functions/crawlMachine.md +1 -1
- package/api/@xmachines/play-router/functions/createBrowserHistory.md +4 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +3 -3
- package/api/@xmachines/play-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractRoute.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +19 -15
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMap.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +55 -0
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/StateVisit.md +4 -4
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +22 -10
- package/api/@xmachines/play-signals/functions/watchSignal.md +35 -0
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +193 -219
- package/api/@xmachines/play-solid/functions/defineRegistry.md +47 -0
- package/api/@xmachines/play-solid/functions/useActor.md +13 -0
- package/api/@xmachines/play-solid/functions/useStateBinding.md +23 -0
- package/api/@xmachines/play-solid/interfaces/ComponentContext.md +35 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +15 -7
- package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +34 -0
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +15 -43
- package/api/@xmachines/play-solid-router/README.md +2 -0
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +6 -6
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +37 -37
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +18 -17
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +3 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/README.md +1 -5
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +45 -33
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +24 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +33 -33
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +3 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-vue/README.md +216 -209
- package/api/@xmachines/play-vue/functions/defineRegistry.md +32 -0
- package/api/@xmachines/play-vue/functions/useActor.md +13 -0
- package/api/@xmachines/play-vue/functions/useStateBinding.md +30 -0
- package/api/@xmachines/play-vue/interfaces/ComponentContext.md +35 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +14 -6
- package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +33 -0
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +21 -0
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +7 -7
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +7 -7
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +48 -51
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +4 -4
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +3 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +7 -1
- package/api/@xmachines/play-xstate/README.md +236 -111
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +36 -33
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +24 -18
- package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +12 -61
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
- package/api/@xmachines/play-xstate/functions/stateMatches.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +9 -13
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +8 -9
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +14 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +19 -4
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +2 -2
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/api/README.md +1 -1
- package/api/llms.txt +11 -5
- package/examples/multi-router-integration.md +31 -19
- package/package.json +2 -2
- package/api/@xmachines/play-catalog/README.md +0 -331
- package/api/@xmachines/play-catalog/functions/defineCatalog.md +0 -98
- package/api/@xmachines/play-catalog/functions/defineComponents.md +0 -134
- package/api/@xmachines/play-catalog/type-aliases/Catalog.md +0 -48
- package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +0 -20
- package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +0 -65
- package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +0 -17
- package/api/@xmachines/play-xstate/functions/mergeViewProps.md +0 -26
- package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +0 -39
- package/api/@xmachines/play-xstate/functions/validateViewProps.md +0 -80
- package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +0 -16
- package/api/@xmachines/play-xstate/type-aliases/Catalog.md +0 -21
- package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +0 -35
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayerOptions\<TMachine\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/types.ts:
|
|
5
|
+
Defined in: [packages/play-xstate/src/types.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/types.ts#L20)
|
|
6
6
|
|
|
7
7
|
Player lifecycle hooks
|
|
8
8
|
|
|
@@ -16,11 +16,10 @@ Per CONTEXT.md: Rich set of hooks for observability
|
|
|
16
16
|
|
|
17
17
|
## Properties
|
|
18
18
|
|
|
19
|
-
| Property
|
|
20
|
-
|
|
|
21
|
-
| <a id="property-onerror"></a> `onError?`
|
|
22
|
-
| <a id="property-onstart"></a> `onStart?`
|
|
23
|
-
| <a id="property-onstatechange"></a> `onStateChange?`
|
|
24
|
-
| <a id="property-onstop"></a> `onStop?`
|
|
25
|
-
| <a id="property-ontransition"></a> `onTransition?`
|
|
26
|
-
| <a id="property-propvalidation"></a> `propValidation?` | `"strict"` \| `"lenient"` | Prop validation failure mode (default: 'lenient') - 'lenient': On validation failure, call onError hook and render with unvalidated props (current behavior). Documents as explicit trade-off. - 'strict': On validation failure, call onError hook and set viewSignal to null (no render). Blocks rendering until machine transitions to a state with valid props. | [packages/play-xstate/src/types.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.16/packages/play-xstate/src/types.ts#L57) |
|
|
19
|
+
| Property | Type | Description | Defined in |
|
|
20
|
+
| ---------------------------------------------------- | --------------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| <a id="property-onerror"></a> `onError?` | (`actor`, `error`) => `void` | Called on actor errors | [packages/play-xstate/src/types.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/types.ts#L38) |
|
|
22
|
+
| <a id="property-onstart"></a> `onStart?` | (`actor`) => `void` | Called when actor starts | [packages/play-xstate/src/types.ts:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/types.ts#L22) |
|
|
23
|
+
| <a id="property-onstatechange"></a> `onStateChange?` | (`actor`, `state`) => `void` | Called when state signal changes | [packages/play-xstate/src/types.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/types.ts#L35) |
|
|
24
|
+
| <a id="property-onstop"></a> `onStop?` | (`actor`) => `void` | Called when actor stops | [packages/play-xstate/src/types.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/types.ts#L25) |
|
|
25
|
+
| <a id="property-ontransition"></a> `onTransition?` | (`actor`, `prevState`, `nextState`) => `void` | Called on every state transition | [packages/play-xstate/src/types.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/types.ts#L28) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteContext
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/routing/types.ts:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-xstate/src/routing/types.ts:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/types.ts#L11)
|
|
6
6
|
|
|
7
7
|
Route build context from machine context
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ Route build context from machine context
|
|
|
16
16
|
|
|
17
17
|
| Property | Type | Description | Defined in |
|
|
18
18
|
| ------------------------------------------------ | ------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| <a id="property-basepath"></a> `basePath?` | `string` | Base path for relative routes | [packages/play-xstate/src/routing/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
20
|
-
| <a id="property-hash"></a> `hash?` | `string` | Hash fragment | [packages/play-xstate/src/routing/types.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
21
|
-
| <a id="property-query"></a> `query?` | `Record`\<`string`, `unknown`\> | Query parameters | [packages/play-xstate/src/routing/types.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
22
|
-
| <a id="property-routeparams"></a> `routeParams?` | `Record`\<`string`, `unknown`\> | Route parameters to substitute | [packages/play-xstate/src/routing/types.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
19
|
+
| <a id="property-basepath"></a> `basePath?` | `string` | Base path for relative routes | [packages/play-xstate/src/routing/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/types.ts#L13) |
|
|
20
|
+
| <a id="property-hash"></a> `hash?` | `string` | Hash fragment | [packages/play-xstate/src/routing/types.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/types.ts#L19) |
|
|
21
|
+
| <a id="property-query"></a> `query?` | `Record`\<`string`, `unknown`\> | Query parameters | [packages/play-xstate/src/routing/types.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/types.ts#L17) |
|
|
22
|
+
| <a id="property-routeparams"></a> `routeParams?` | `Record`\<`string`, `unknown`\> | Route parameters to substitute | [packages/play-xstate/src/routing/types.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/types.ts#L15) |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type ComposedGuard = GuardPredicate<MachineContext, EventObject, unknown, ParameterizedObject>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/compose.ts:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/compose.ts:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/guards/compose.ts#L14)
|
|
10
10
|
|
|
11
11
|
Narrowest public return type for guard composition helpers.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type Guard<TContext, TEvent> = (args) => boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/guards/types.ts#L13)
|
|
10
10
|
|
|
11
11
|
Standard XState guard function signature
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type GuardArray<TContext, TEvent> = Guard<TContext, TEvent>[] | string[];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/types.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/types.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/guards/types.ts#L23)
|
|
10
10
|
|
|
11
11
|
Array of guard predicates or guard names
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type PlayerFactory<TMachine> = (input?, options?) => PlayerActor<TMachine>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/types.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/types.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/types.ts#L57)
|
|
10
10
|
|
|
11
11
|
Factory function returned by definePlayer()
|
|
12
12
|
|
|
@@ -6,7 +6,17 @@
|
|
|
6
6
|
type RouteMachineConfig = object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/format-play-route-transitions.ts#L52)
|
|
10
|
+
|
|
11
|
+
Minimal structural constraint for machine configs accepted by
|
|
12
|
+
`formatPlayRouteTransitions`.
|
|
13
|
+
|
|
14
|
+
This is intentionally loose so the function accepts both the bare `createMachine`
|
|
15
|
+
config object and the stricter `setup().createMachine` config without requiring
|
|
16
|
+
any type casts at the call site. The generic `T extends RouteMachineConfig`
|
|
17
|
+
parameter on `formatPlayRouteTransitions` preserves the original concrete type
|
|
18
|
+
through the transform, so the return value remains directly usable by
|
|
19
|
+
`setup().createMachine()`.
|
|
10
20
|
|
|
11
21
|
## Indexable
|
|
12
22
|
|
|
@@ -22,7 +32,7 @@ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:2
|
|
|
22
32
|
optional context?: unknown;
|
|
23
33
|
```
|
|
24
34
|
|
|
25
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:
|
|
35
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/format-play-route-transitions.ts#L53)
|
|
26
36
|
|
|
27
37
|
---
|
|
28
38
|
|
|
@@ -32,7 +42,7 @@ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:3
|
|
|
32
42
|
optional on?: Record<string, unknown>;
|
|
33
43
|
```
|
|
34
44
|
|
|
35
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:
|
|
45
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/format-play-route-transitions.ts#L55)
|
|
36
46
|
|
|
37
47
|
---
|
|
38
48
|
|
|
@@ -42,4 +52,4 @@ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:3
|
|
|
42
52
|
optional states?: Record<string, unknown>;
|
|
43
53
|
```
|
|
44
54
|
|
|
45
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:
|
|
55
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/format-play-route-transitions.ts#L54)
|
|
@@ -6,7 +6,14 @@
|
|
|
6
6
|
type RouteStateNode = object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/format-play-route-transitions.ts#L21)
|
|
10
|
+
|
|
11
|
+
Minimal structural shape of a single XState state node as read by
|
|
12
|
+
`formatPlayRouteTransitions` when crawling the machine config.
|
|
13
|
+
|
|
14
|
+
Only the fields the function actually inspects are typed here; all other
|
|
15
|
+
state-node fields (e.g. `on`, `entry`, `after`) pass through unmodified via
|
|
16
|
+
the index signature.
|
|
10
17
|
|
|
11
18
|
## Indexable
|
|
12
19
|
|
|
@@ -22,7 +29,9 @@ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:1
|
|
|
22
29
|
optional id?: string;
|
|
23
30
|
```
|
|
24
31
|
|
|
25
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:
|
|
32
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/format-play-route-transitions.ts#L23)
|
|
33
|
+
|
|
34
|
+
Optional explicit state ID (e.g. `"home"`, `"settings"`). Used as the `#id` target in `play.route` events.
|
|
26
35
|
|
|
27
36
|
---
|
|
28
37
|
|
|
@@ -32,7 +41,9 @@ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:1
|
|
|
32
41
|
optional meta?: object;
|
|
33
42
|
```
|
|
34
43
|
|
|
35
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:
|
|
44
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/format-play-route-transitions.ts#L25)
|
|
45
|
+
|
|
46
|
+
State metadata — `meta.route` marks the state as routable.
|
|
36
47
|
|
|
37
48
|
#### route?
|
|
38
49
|
|
|
@@ -40,6 +51,8 @@ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:1
|
|
|
40
51
|
optional route?: string;
|
|
41
52
|
```
|
|
42
53
|
|
|
54
|
+
URL path template (e.g. `"/profile/:username"`, `"/settings/:section?"`).
|
|
55
|
+
|
|
43
56
|
---
|
|
44
57
|
|
|
45
58
|
### states?
|
|
@@ -48,4 +61,6 @@ optional route?: string;
|
|
|
48
61
|
optional states?: Record<string, RouteStateNode>;
|
|
49
62
|
```
|
|
50
63
|
|
|
51
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:
|
|
64
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/play-xstate/src/routing/format-play-route-transitions.ts#L30)
|
|
65
|
+
|
|
66
|
+
Nested child states, recursively crawled for additional route declarations.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function defineXmVitestConfig(importMetaUrl, overrides): object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [src/index.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [src/index.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/shared/src/index.ts#L10)
|
|
10
10
|
|
|
11
11
|
Create a Vitest config with XMachines workspace defaults.
|
|
12
12
|
|
|
@@ -26,4 +26,4 @@ render it under `@xmachines/shared` instead of nested module pages.
|
|
|
26
26
|
|
|
27
27
|
| Name | Type | Defined in |
|
|
28
28
|
| ------ | ----- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
-
| `test` | `any` | [config/vitest.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
29
|
+
| `test` | `any` | [config/vitest.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/shared/config/vitest.ts#L82) |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function xmAliases(importMetaUrl): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [src/index.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [src/index.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.17/packages/shared/src/index.ts#L20)
|
|
10
10
|
|
|
11
11
|
Build Vite/Vitest alias entries for all `@xmachines/*` workspace packages.
|
|
12
12
|
|
package/api/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Generated API documentation for the XMachines JavaScript/TypeScript packages.
|
|
|
32
32
|
|
|
33
33
|
- [@xmachines/play](@xmachines/play/README.md)
|
|
34
34
|
- [@xmachines/play-actor](@xmachines/play-actor/README.md)
|
|
35
|
-
- [@xmachines/play-
|
|
35
|
+
- [@xmachines/play-dom](@xmachines/play-dom/README.md)
|
|
36
36
|
- [@xmachines/play-react](@xmachines/play-react/README.md)
|
|
37
37
|
- [@xmachines/play-react-router](@xmachines/play-react-router/README.md)
|
|
38
38
|
- [@xmachines/play-react-router-demo](@xmachines/play-react-router-demo/README.md)
|
package/api/llms.txt
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
## API
|
|
26
26
|
- [@xmachines/play](@xmachines/play/README.md): Core Play types and runtime contracts
|
|
27
27
|
- [@xmachines/play-actor](@xmachines/play-actor/README.md): Abstract actor base class plus Routable and Viewable capabilities
|
|
28
|
-
- [@xmachines/play-
|
|
28
|
+
- [@xmachines/play-dom](@xmachines/play-dom/README.md): Vanilla DOM renderer for Viewable actors
|
|
29
29
|
- [@xmachines/play-signals](@xmachines/play-signals/README.md): Signal primitives used by Play actors and adapters
|
|
30
30
|
- [@xmachines/play-router](@xmachines/play-router/README.md): Route extraction, route maps, and shared routing infrastructure
|
|
31
31
|
- [@xmachines/play-xstate](@xmachines/play-xstate/README.md): XState-backed player and actor integration
|
|
@@ -50,20 +50,26 @@
|
|
|
50
50
|
## Quick Reference
|
|
51
51
|
|
|
52
52
|
```javascript
|
|
53
|
-
import { definePlayer } from '@xmachines/play-xstate';
|
|
53
|
+
import { definePlayer, formatPlayRouteTransitions } from '@xmachines/play-xstate';
|
|
54
54
|
import { extractMachineRoutes } from '@xmachines/play-router';
|
|
55
|
+
import { defineRegistry } from '@json-render/react';
|
|
56
|
+
import { PlayRenderer } from '@xmachines/play-react';
|
|
55
57
|
|
|
56
|
-
// Define a player from a machine
|
|
57
|
-
const createPlayer = definePlayer({ machine
|
|
58
|
+
// Define a player from a machine
|
|
59
|
+
const createPlayer = definePlayer({ machine });
|
|
58
60
|
const actor = createPlayer();
|
|
59
61
|
actor.start();
|
|
60
62
|
|
|
61
63
|
// `Viewable` actors expose renderable view metadata
|
|
62
|
-
const currentView = actor.currentView.get();
|
|
64
|
+
const currentView = actor.currentView.get(); // { component, spec }
|
|
63
65
|
|
|
64
66
|
// `Routable` actors expose route state for adapters to observe
|
|
65
67
|
const currentRoute = actor.currentRoute.get();
|
|
66
68
|
|
|
67
69
|
// Extract route metadata for a framework adapter
|
|
68
70
|
const routeTree = extractMachineRoutes(machine);
|
|
71
|
+
|
|
72
|
+
// Wire components to catalog and render
|
|
73
|
+
const { registry } = defineRegistry(catalog, { components, actions });
|
|
74
|
+
<PlayRenderer actor={actor} registry={registry} actions={{ login: 'auth.login' }} />
|
|
69
75
|
```
|
|
@@ -37,7 +37,8 @@ All providers use a `renderer` prop that receives the actor and returns a ReactN
|
|
|
37
37
|
All providers require `routeMap` as an explicit prop. Routers fundamentally don't know about Play state IDs — the map bridges the gap:
|
|
38
38
|
|
|
39
39
|
```typescript
|
|
40
|
-
const routeTree =
|
|
40
|
+
const routeTree = extractMachineRoutes(machine);
|
|
41
|
+
const routeMap = createRouteMapFromTree(routeTree);
|
|
41
42
|
const router = createRouter({ routeTree, history: createMemoryHistory() });
|
|
42
43
|
|
|
43
44
|
<PlayTanStackRouterProvider
|
|
@@ -70,7 +71,8 @@ For runnable implementations of these router integration patterns, see the [Exam
|
|
|
70
71
|
import { StrictMode } from 'react';
|
|
71
72
|
import { createRoot } from 'react-dom/client';
|
|
72
73
|
import { createRouter, createMemoryHistory } from '@tanstack/react-router';
|
|
73
|
-
import {
|
|
74
|
+
import { PlayTanStackRouterProvider, createRouteMapFromTree } from '@xmachines/play-tanstack-react-router';
|
|
75
|
+
import { extractMachineRoutes } from '@xmachines/play-router';
|
|
74
76
|
import { PlayRenderer } from '@xmachines/play-react';
|
|
75
77
|
import { definePlayer } from '@xmachines/play-xstate';
|
|
76
78
|
|
|
@@ -79,7 +81,8 @@ const createPlayer = definePlayer({ machine, catalog });
|
|
|
79
81
|
const actor = createPlayer();
|
|
80
82
|
|
|
81
83
|
// 2. Create router from machine
|
|
82
|
-
const routeTree =
|
|
84
|
+
const routeTree = extractMachineRoutes(machine);
|
|
85
|
+
const routeMap = createRouteMapFromTree(routeTree);
|
|
83
86
|
const router = createRouter({
|
|
84
87
|
routeTree,
|
|
85
88
|
history: createMemoryHistory()
|
|
@@ -132,7 +135,13 @@ root.render(<StrictMode><App /></StrictMode>);
|
|
|
132
135
|
Framework-agnostic router for JSX-based frameworks.
|
|
133
136
|
|
|
134
137
|
```typescript
|
|
135
|
-
import {
|
|
138
|
+
import {
|
|
139
|
+
connectRouter,
|
|
140
|
+
createBrowserHistory,
|
|
141
|
+
createRouteMap,
|
|
142
|
+
createRouter,
|
|
143
|
+
extractMachineRoutes,
|
|
144
|
+
} from '@xmachines/play-router';
|
|
136
145
|
import { definePlayer } from '@xmachines/play-xstate';
|
|
137
146
|
|
|
138
147
|
// 1. Create actor
|
|
@@ -140,14 +149,17 @@ const createPlayer = definePlayer({ machine, catalog });
|
|
|
140
149
|
const actor = createPlayer();
|
|
141
150
|
|
|
142
151
|
// 2. Create framework-agnostic router
|
|
143
|
-
const
|
|
152
|
+
const routeTree = extractMachineRoutes(machine);
|
|
153
|
+
const routeMap = createRouteMap(routeTree);
|
|
154
|
+
const history = createBrowserHistory();
|
|
155
|
+
const router = createRouter({ routeTree, history });
|
|
144
156
|
|
|
145
157
|
// 3. Connect router with manual integration
|
|
146
|
-
const disconnect = connectRouter(actor,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
const disconnect = connectRouter(actor, router, routeMap);
|
|
159
|
+
|
|
160
|
+
history.subscribe(() => {
|
|
161
|
+
// Update your framework's router from the shared history state
|
|
162
|
+
myFrameworkRouter.push(history.location.pathname);
|
|
151
163
|
});
|
|
152
164
|
|
|
153
165
|
// 4. Framework-specific rendering
|
|
@@ -177,7 +189,7 @@ h(resolveComponent(view.component), viewProps)
|
|
|
177
189
|
Manual browser integration with no framework.
|
|
178
190
|
|
|
179
191
|
```typescript
|
|
180
|
-
import {
|
|
192
|
+
import { connectRouter } from "@xmachines/play-router";
|
|
181
193
|
|
|
182
194
|
// 1. Create actor
|
|
183
195
|
const actor = createPlayer();
|
|
@@ -240,14 +252,14 @@ renderView();
|
|
|
240
252
|
|
|
241
253
|
All three modes follow the same pattern:
|
|
242
254
|
|
|
243
|
-
| Concept | TanStack Mode | Vanilla Mode
|
|
244
|
-
| ----------- | ---------------------------------- |
|
|
245
|
-
| Actor | `createPlayer()` | `createPlayer()`
|
|
246
|
-
| Router | `createRouter()` (TanStack) | `
|
|
247
|
-
| Integration | `<PlayTanStackRouterProvider>` | Manual via `onNavigate` callback
|
|
248
|
-
| Rendering | `<PlayRenderer>` via renderer prop | Framework-specific (h, Dynamic, etc)
|
|
249
|
-
| Events | Component `onClick` → `send()` | Same
|
|
250
|
-
| Signals | Observed by `useSignalEffect` | Manual `actor.currentView.get()`
|
|
255
|
+
| Concept | TanStack Mode | Vanilla Mode | Pure Browser Mode |
|
|
256
|
+
| ----------- | ---------------------------------- | ------------------------------------- | -------------------------- |
|
|
257
|
+
| Actor | `createPlayer()` | `createPlayer()` | `createPlayer()` |
|
|
258
|
+
| Router | `createRouter()` (TanStack) | `createRouter()` + `createRouteMap()` | `connectRouter()` |
|
|
259
|
+
| Integration | `<PlayTanStackRouterProvider>` | Manual via `onNavigate` callback | Manual + `window.popstate` |
|
|
260
|
+
| Rendering | `<PlayRenderer>` via renderer prop | Framework-specific (h, Dynamic, etc) | `innerHTML` or DOM API |
|
|
261
|
+
| Events | Component `onClick` → `send()` | Same | Same |
|
|
262
|
+
| Signals | Observed by `useSignalEffect` | Manual `actor.currentView.get()` | Same |
|
|
251
263
|
|
|
252
264
|
The API parallelism ensures consistent patterns regardless of mode.
|
|
253
265
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/docs",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.17",
|
|
4
4
|
"description": "Documentation for XMachines",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typedoc": "typedoc"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@xmachines/shared": "1.0.0-beta.
|
|
49
|
+
"@xmachines/shared": "1.0.0-beta.17",
|
|
50
50
|
"typedoc": "^0.28.18",
|
|
51
51
|
"typedoc-plugin-llms-txt": "^0.1.2",
|
|
52
52
|
"typedoc-plugin-markdown": "^4.11.0"
|