@xmachines/docs 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -13
- package/api/@xmachines/play/README.md +58 -63
- package/api/@xmachines/play/classes/NonNullableError.md +7 -7
- package/api/@xmachines/play/classes/PlayError.md +25 -27
- package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
- package/api/@xmachines/play/type-aliases/PlayEvent.md +26 -25
- package/api/@xmachines/play-actor/README.md +72 -63
- package/api/@xmachines/play-actor/classes/AbstractActor.md +39 -39
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
- package/api/@xmachines/play-actor/functions/composePlayState.md +9 -8
- package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +5 -5
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +27 -25
- package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +12 -11
- package/api/@xmachines/play-actor/functions/reuseComposedState.md +23 -22
- package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +6 -5
- package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
- package/api/@xmachines/play-actor/functions/typedSpec.md +12 -11
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -13
- package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +4 -4
- package/api/@xmachines/play-actor/interfaces/Routable.md +4 -4
- package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +11 -11
- package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
- package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +5 -5
- package/api/@xmachines/play-dom/README.md +119 -85
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
- package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
- package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +8 -8
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +9 -9
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
- package/api/@xmachines/play-dom-router/README.md +66 -49
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +19 -18
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
- package/api/@xmachines/play-react/README.md +63 -54
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
- package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
- package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
- package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
- package/api/@xmachines/play-react-router/README.md +37 -28
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
- package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
- package/api/@xmachines/play-router/README.md +94 -82
- package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
- package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
- package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
- package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
- package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
- package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
- package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +8 -8
- package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
- package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -7
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
- package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
- package/api/@xmachines/play-signals/README.md +38 -36
- package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
- package/api/@xmachines/play-solid/README.md +46 -42
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
- package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
- package/api/@xmachines/play-solid-router/README.md +34 -29
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +39 -39
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-svelte/README.md +40 -31
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
- package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/README.md +25 -25
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +38 -34
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +66 -48
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-router/README.md +37 -17
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/README.md +71 -45
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
- package/api/@xmachines/play-vue/README.md +37 -35
- package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
- package/api/@xmachines/play-vue-router/README.md +65 -56
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
- package/api/@xmachines/play-xstate/README.md +72 -70
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +123 -112
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -16
- package/api/@xmachines/play-xstate/functions/composeGuards.md +25 -23
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +20 -20
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +15 -15
- package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
- package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -8
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +16 -13
- package/api/@xmachines/play-xstate/functions/hasContext.md +8 -8
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
- package/api/@xmachines/play-xstate/functions/negateGuard.md +19 -18
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -10
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +9 -9
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +4 -3
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +7 -7
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -12
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -14
- package/api/@xmachines/shared/README.md +11 -13
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/contributing/development.md +28 -0
- package/guides/inspector.md +1 -1
- package/package.json +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
> Solid renderer for XMachines Play architecture
|
|
6
6
|
|
|
7
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-solid)
|
|
8
8
|
|
|
9
|
-
SolidJS rendering layer
|
|
10
|
-
|
|
11
|
-
Part of the [xmachines-js monorepo](../../README.md).
|
|
9
|
+
The SolidJS rendering layer observes the actor signals and renders the UI components through `@xmachines/json-render-solid`. SolidJS reactivity only triggers the re-render. The TC39 Signals are the source of truth.
|
|
12
10
|
|
|
13
11
|
## Installation
|
|
14
12
|
|
|
@@ -16,7 +14,7 @@ Part of the [xmachines-js monorepo](../../README.md).
|
|
|
16
14
|
pnpm add @xmachines/play-solid
|
|
17
15
|
```
|
|
18
16
|
|
|
19
|
-
**Peer dependencies
|
|
17
|
+
**Peer dependencies.** Install them with the package:
|
|
20
18
|
|
|
21
19
|
```bash
|
|
22
20
|
pnpm add solid-js xstate @xstate/store @xmachines/json-render-solid @xmachines/json-render-core @xmachines/json-render-xstate
|
|
@@ -29,15 +27,24 @@ import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-so
|
|
|
29
27
|
import { definePlayer } from "@xmachines/play-xstate";
|
|
30
28
|
import { defineCatalog } from "@xmachines/json-render-core";
|
|
31
29
|
import { schema } from "@xmachines/json-render-solid/schema";
|
|
30
|
+
import { myMachine } from "./machine.js"; // your xstate machine (states carry meta.view specs)
|
|
31
|
+
// authCatalogDef is a plain object describing components/actions — in this repo it
|
|
32
|
+
// comes from the workspace-only @xmachines/play-actor-shared demo package
|
|
33
|
+
import { authCatalogDef } from "@xmachines/play-actor-shared";
|
|
32
34
|
|
|
33
|
-
// 1. Define a catalog
|
|
35
|
+
// 1. Define a catalog
|
|
34
36
|
const catalog = defineCatalog(schema, authCatalogDef);
|
|
35
37
|
|
|
36
|
-
// 2.
|
|
38
|
+
// 2. Create and start an actor
|
|
39
|
+
const createPlayer = definePlayer({ machine: myMachine });
|
|
40
|
+
const actor = createPlayer();
|
|
41
|
+
actor.start();
|
|
42
|
+
|
|
43
|
+
// 3. Build a component registry
|
|
37
44
|
const registryResult = defineRegistry(catalog, {
|
|
38
45
|
components: {
|
|
39
46
|
Home: () => <div>Welcome home!</div>,
|
|
40
|
-
Login: (ctx) => <div>Login {ctx.props.
|
|
47
|
+
Login: (ctx) => <div>Login {ctx.props.username && <span>{ctx.props.username}</span>}</div>,
|
|
41
48
|
},
|
|
42
49
|
actions: {
|
|
43
50
|
login: async (args) => actor.send({ type: "auth.login", username: args.username }),
|
|
@@ -45,11 +52,6 @@ const registryResult = defineRegistry(catalog, {
|
|
|
45
52
|
},
|
|
46
53
|
});
|
|
47
54
|
|
|
48
|
-
// 3. Create and start an actor
|
|
49
|
-
const createPlayer = definePlayer({ machine: myMachine });
|
|
50
|
-
const actor = createPlayer();
|
|
51
|
-
actor.start();
|
|
52
|
-
|
|
53
55
|
// 4. Render
|
|
54
56
|
function App() {
|
|
55
57
|
return (
|
|
@@ -64,30 +66,32 @@ function App() {
|
|
|
64
66
|
|
|
65
67
|
### `PlayUIProvider` + `PlayRenderer` (recommended)
|
|
66
68
|
|
|
67
|
-
`PlayUIProvider` is the
|
|
69
|
+
`PlayUIProvider` is the standard entry point. It wraps `ActorProvider` and `JSONUIProvider` into one composite provider. `PlayRenderer` is a leaf component without props. It reads the view context and renders the current spec.
|
|
68
70
|
|
|
69
71
|
```tsx
|
|
70
72
|
import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-solid";
|
|
71
73
|
|
|
74
|
+
// actor, registryResult from the Quick Start above
|
|
72
75
|
<PlayUIProvider
|
|
73
76
|
actor={actor}
|
|
74
77
|
registryResult={registryResult}
|
|
75
78
|
fallback={<div>Loading…</div>}
|
|
76
79
|
onError={(err) => console.error(err)}
|
|
77
|
-
navigate={navigateFn} // optional: passed to JSONUIProvider
|
|
78
|
-
validationFunctions={valFns} // optional: form validation helpers
|
|
80
|
+
navigate={navigateFn} // optional: your navigation callback, passed to JSONUIProvider
|
|
81
|
+
validationFunctions={valFns} // optional: your form validation helpers
|
|
79
82
|
>
|
|
80
83
|
<PlayRenderer />
|
|
81
84
|
</PlayUIProvider>;
|
|
82
85
|
```
|
|
83
86
|
|
|
84
|
-
### `ActorProvider` (
|
|
87
|
+
### `ActorProvider` (low-level)
|
|
85
88
|
|
|
86
89
|
For library authors who need direct control over provider composition:
|
|
87
90
|
|
|
88
91
|
```tsx
|
|
89
92
|
import { ActorProvider, PlayRenderer } from "@xmachines/play-solid";
|
|
90
93
|
|
|
94
|
+
// actor, registryResult from the Quick Start above
|
|
91
95
|
<ActorProvider actor={actor} registryResult={registryResult}>
|
|
92
96
|
<PlayRenderer />
|
|
93
97
|
</ActorProvider>;
|
|
@@ -124,28 +128,28 @@ const MyRenderer = () => {
|
|
|
124
128
|
|
|
125
129
|
### Components
|
|
126
130
|
|
|
127
|
-
| Export | Description
|
|
128
|
-
| ---------------- |
|
|
129
|
-
| `PlayUIProvider` |
|
|
130
|
-
| `PlayRenderer` |
|
|
131
|
-
| `ActorProvider` |
|
|
131
|
+
| Export | Description |
|
|
132
|
+
| ---------------- | ----------------------------------------------------------------------------------------- |
|
|
133
|
+
| `PlayUIProvider` | The composite provider. Use it as the standard entry point |
|
|
134
|
+
| `PlayRenderer` | The leaf component without props. It renders the current view spec inside a provider tree |
|
|
135
|
+
| `ActorProvider` | The low-level provider for a custom provider composition |
|
|
132
136
|
|
|
133
137
|
### Hooks
|
|
134
138
|
|
|
135
|
-
| Export | Description
|
|
136
|
-
| --------------- |
|
|
137
|
-
| `useActor()` | Returns the raw `AnyPlayActor` instance from context
|
|
138
|
-
| `usePlayView()` | Returns the current `ViewContextValue` (spec, handlers, registry, store)
|
|
139
|
+
| Export | Description |
|
|
140
|
+
| --------------- | ---------------------------------------------------------------------------------------------------- |
|
|
141
|
+
| `useActor()` | Returns the raw `AnyPlayActor` instance from the context. It throws outside a provider tree |
|
|
142
|
+
| `usePlayView()` | Returns the current `ViewContextValue` (spec, handlers, registry, store). It throws outside the tree |
|
|
139
143
|
|
|
140
144
|
### Context
|
|
141
145
|
|
|
142
|
-
| Export | Description
|
|
143
|
-
| -------------- |
|
|
144
|
-
| `ActorContext` | SolidJS context
|
|
146
|
+
| Export | Description |
|
|
147
|
+
| -------------- | ----------------------------------------------------------------------------------------------- |
|
|
148
|
+
| `ActorContext` | The SolidJS context of the actor. Use `ActorContext.Provider` directly for a custom composition |
|
|
145
149
|
|
|
146
150
|
### Re-exports from `@xmachines/json-render-solid`
|
|
147
151
|
|
|
148
|
-
This package re-exports the
|
|
152
|
+
This package re-exports the complete `@xmachines/json-render-solid` public API, so that a consumer does not need a direct dependency:
|
|
149
153
|
|
|
150
154
|
```tsx
|
|
151
155
|
import {
|
|
@@ -174,12 +178,12 @@ import {
|
|
|
174
178
|
|
|
175
179
|
### Key Types
|
|
176
180
|
|
|
177
|
-
| Type | Description
|
|
178
|
-
| --------------------- |
|
|
179
|
-
| `PlayUIProviderProps` | Props for `PlayUIProvider`
|
|
180
|
-
| `ActorProviderProps` | Props for `ActorProvider`
|
|
181
|
-
| `ViewContextValue` | Shape of the context value from `usePlayView()`
|
|
182
|
-
| `AnyPlayActor` | `AbstractActor<AnyActorLogic>` — bare actor type
|
|
181
|
+
| Type | Description |
|
|
182
|
+
| --------------------- | -------------------------------------------------------------------------------------- |
|
|
183
|
+
| `PlayUIProviderProps` | Props for `PlayUIProvider` |
|
|
184
|
+
| `ActorProviderProps` | Props for `ActorProvider` |
|
|
185
|
+
| `ViewContextValue` | Shape of the context value from `usePlayView()` |
|
|
186
|
+
| `AnyPlayActor` | `AbstractActor<AnyActorLogic>` — the bare actor type that the context providers accept |
|
|
183
187
|
|
|
184
188
|
## Testing
|
|
185
189
|
|
|
@@ -197,17 +201,17 @@ pnpm run test:watch # watch mode
|
|
|
197
201
|
pnpm run test:ui # interactive Vitest UI
|
|
198
202
|
```
|
|
199
203
|
|
|
200
|
-
|
|
204
|
+
The v8 provider collects the coverage, with a threshold of 80% for lines, functions, branches, and statements. The browser tests are in `test/browser/`. The default jsdom run excludes them.
|
|
201
205
|
|
|
202
206
|
## License
|
|
203
207
|
|
|
204
208
|
MIT
|
|
205
209
|
|
|
206
|
-
@xmachines/play-solid - SolidJS renderer for XMachines Play architecture
|
|
210
|
+
@xmachines/play-solid - SolidJS renderer for the XMachines Play architecture
|
|
207
211
|
|
|
208
|
-
|
|
209
|
-
renders UI components
|
|
210
|
-
|
|
212
|
+
This package is the SolidJS rendering layer. It observes the actor signals and
|
|
213
|
+
renders the UI components through @xmachines/json-render-solid. SolidJS
|
|
214
|
+
reactivity only triggers the re-render. The signals are the source of truth.
|
|
211
215
|
|
|
212
216
|
Primary entry point:
|
|
213
217
|
|
|
@@ -215,7 +219,7 @@ Primary entry point:
|
|
|
215
219
|
import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-solid";
|
|
216
220
|
```
|
|
217
221
|
|
|
218
|
-
For
|
|
222
|
+
For a custom provider composition:
|
|
219
223
|
|
|
220
224
|
```tsx
|
|
221
225
|
import { ActorProvider, ActorContext, usePlayView } from "@xmachines/play-solid";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function useActor(): AnyPlayActor;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid/src/useActor.ts:
|
|
9
|
+
Defined in: [packages/play-solid/src/useActor.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/useActor.ts#L40)
|
|
10
10
|
|
|
11
11
|
## Returns
|
|
12
12
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
function usePlayView(): ViewContextValue;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid/src/ActorProvider.tsx:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [packages/play-solid/src/ActorProvider.tsx:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L75)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The hook that gives the current view context inside an ActorProvider tree.
|
|
12
12
|
|
|
13
13
|
## Returns
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ Hook to access the current view context inside an ActorProvider tree.
|
|
|
16
16
|
|
|
17
17
|
## Throws
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
When the caller is outside an ActorProvider tree or a PlayUIProvider tree
|
|
20
20
|
|
|
21
21
|
## Example
|
|
22
22
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ActorProviderProps
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-solid/src/ActorProvider.tsx:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [packages/play-solid/src/ActorProvider.tsx:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L89)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The props of ActorProvider, the low-level provider.
|
|
8
8
|
|
|
9
|
-
For
|
|
10
|
-
with JSONUIProvider and
|
|
9
|
+
For the standard use, prefer PlayUIProvider. That component wraps ActorProvider
|
|
10
|
+
with JSONUIProvider and with every necessary sub-provider.
|
|
11
11
|
|
|
12
12
|
## Extends
|
|
13
13
|
|
|
@@ -19,12 +19,12 @@ with JSONUIProvider and all required sub-providers.
|
|
|
19
19
|
|
|
20
20
|
## Properties
|
|
21
21
|
|
|
22
|
-
| Property | Type | Description
|
|
23
|
-
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
24
|
-
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) |
|
|
25
|
-
| <a id="property-children"></a> `children` | `any` |
|
|
26
|
-
| <a id="property-fallback"></a> `fallback?` | `any` |
|
|
27
|
-
| <a id="property-onerror"></a> `onError?` | (`error`) => `void` |
|
|
28
|
-
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) |
|
|
29
|
-
| <a id="property-registryresult"></a> `registryResult` | [`DefineRegistryResult`](DefineRegistryResult.md) |
|
|
30
|
-
| <a id="property-store"></a> `store?` | `StateStore` |
|
|
22
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
23
|
+
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | The actor instance with the currentView signal. It requires the Viewable capability. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`actor`](../../play-actor/interfaces/BaseActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:163](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L163) |
|
|
25
|
+
| <a id="property-children"></a> `children` | `any` | The children. They are necessary, and they must hold a <PlayRenderer />. You can also use the PlayUIProvider short form | - | [packages/play-solid/src/ActorProvider.tsx:101](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L101) |
|
|
26
|
+
| <a id="property-fallback"></a> `fallback?` | `any` | The optional fallback element. The provider shows it when currentView is null, and when the ErrorBoundary catches an error | - | [packages/play-solid/src/ActorProvider.tsx:93](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L93) |
|
|
27
|
+
| <a id="property-onerror"></a> `onError?` | (`error`) => `void` | The optional callback. The provider calls it when the SolidJS ErrorBoundary catches an error | - | [packages/play-solid/src/ActorProvider.tsx:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L96) |
|
|
28
|
+
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | The provider calls it when one catalog component throws during a render. This handler replaces every onRenderError of defineRegistry. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`onRenderError`](../../play-actor/interfaces/BaseActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:177](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L177) |
|
|
29
|
+
| <a id="property-registryresult"></a> `registryResult` | [`DefineRegistryResult`](DefineRegistryResult.md) | The complete result of defineRegistry(). It holds the component registry and the factory of the action handlers. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`registryResult`](../../play-actor/interfaces/BaseActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:165](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L165) |
|
|
30
|
+
| <a id="property-store"></a> `store?` | `StateStore` | The optional external StateStore, which is the controlled mode. With this option, the provider ignores spec.state, and this store is the single source of truth. Without it, the provider makes a new @xstate/store atom for each view transition, with the values of spec.state. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`store`](../../play-actor/interfaces/BaseActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:172](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L172) |
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayUIProviderProps
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-solid/src/PlayUIProvider.tsx:
|
|
5
|
+
Defined in: [packages/play-solid/src/PlayUIProvider.tsx:37](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/PlayUIProvider.tsx#L37)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The props of PlayUIProvider — every ActorProvider prop, and also the props that it forwards to JSONUIProvider.
|
|
8
8
|
|
|
9
9
|
## Extends
|
|
10
10
|
|
|
@@ -12,15 +12,15 @@ Props for PlayUIProvider — all ActorProvider props plus JSONUIProvider's forwa
|
|
|
12
12
|
|
|
13
13
|
## Properties
|
|
14
14
|
|
|
15
|
-
| Property | Type | Description
|
|
16
|
-
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
-
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) |
|
|
18
|
-
| <a id="property-children"></a> `children` | `any` |
|
|
19
|
-
| <a id="property-fallback"></a> `fallback?` | `any` |
|
|
20
|
-
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named functions for `$computed` expressions in props
|
|
21
|
-
| <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Navigation function
|
|
22
|
-
| <a id="property-onerror"></a> `onError?` | (`error`) => `void` |
|
|
23
|
-
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) |
|
|
24
|
-
| <a id="property-registryresult"></a> `registryResult` | [`DefineRegistryResult`](DefineRegistryResult.md) |
|
|
25
|
-
| <a id="property-store"></a> `store?` | `StateStore` |
|
|
26
|
-
| <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions
|
|
15
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
16
|
+
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | The actor instance with the currentView signal. It requires the Viewable capability. | [`ActorProviderProps`](ActorProviderProps.md).[`actor`](ActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:163](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L163) |
|
|
18
|
+
| <a id="property-children"></a> `children` | `any` | The children. They are necessary, and they must hold a <PlayRenderer />. You can also use the PlayUIProvider short form | [`ActorProviderProps`](ActorProviderProps.md).[`children`](ActorProviderProps.md#property-children) | [packages/play-solid/src/ActorProvider.tsx:101](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L101) |
|
|
19
|
+
| <a id="property-fallback"></a> `fallback?` | `any` | The optional fallback element. The provider shows it when currentView is null, and when the ErrorBoundary catches an error | [`ActorProviderProps`](ActorProviderProps.md).[`fallback`](ActorProviderProps.md#property-fallback) | [packages/play-solid/src/ActorProvider.tsx:93](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L93) |
|
|
20
|
+
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named functions for `$computed` expressions in props | [`JSONUIProviderProps`](JSONUIProviderProps.md).[`functions`](JSONUIProviderProps.md#property-functions) | - |
|
|
21
|
+
| <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Navigation function | [`JSONUIProviderProps`](JSONUIProviderProps.md).[`navigate`](JSONUIProviderProps.md#property-navigate) | - |
|
|
22
|
+
| <a id="property-onerror"></a> `onError?` | (`error`) => `void` | The optional callback. The provider calls it when the SolidJS ErrorBoundary catches an error | [`ActorProviderProps`](ActorProviderProps.md).[`onError`](ActorProviderProps.md#property-onerror) | [packages/play-solid/src/ActorProvider.tsx:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L96) |
|
|
23
|
+
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | The provider calls it when one catalog component throws during a render. This handler replaces every onRenderError of defineRegistry. | [`ActorProviderProps`](ActorProviderProps.md).[`onRenderError`](ActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:177](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L177) |
|
|
24
|
+
| <a id="property-registryresult"></a> `registryResult` | [`DefineRegistryResult`](DefineRegistryResult.md) | The complete result of defineRegistry(). It holds the component registry and the factory of the action handlers. | [`ActorProviderProps`](ActorProviderProps.md).[`registryResult`](ActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:165](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L165) |
|
|
25
|
+
| <a id="property-store"></a> `store?` | `StateStore` | The optional external StateStore, which is the controlled mode. With this option, the provider ignores spec.state, and this store is the single source of truth. Without it, the provider makes a new @xstate/store atom for each view transition, with the values of spec.state. | [`ActorProviderProps`](ActorProviderProps.md).[`store`](ActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:172](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L172) |
|
|
26
|
+
| <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions | [`JSONUIProviderProps`](JSONUIProviderProps.md).[`validationFunctions`](JSONUIProviderProps.md#property-validationfunctions) | - |
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ViewContextValue
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-solid/src/ActorProvider.tsx:56](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [packages/play-solid/src/ActorProvider.tsx:56](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L56)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
The value that the ViewContext of ActorProvider provides.
|
|
8
|
+
usePlayView() gives it inside the ActorProvider tree.
|
|
9
9
|
|
|
10
10
|
## Extends
|
|
11
11
|
|
|
@@ -13,9 +13,9 @@ Access via usePlayView() inside the ActorProvider tree.
|
|
|
13
13
|
|
|
14
14
|
## Properties
|
|
15
15
|
|
|
16
|
-
| Property | Type | Description
|
|
17
|
-
| ----------------------------------------- | ----------------------------------------------------- |
|
|
18
|
-
| <a id="property-handlers"></a> `handlers` | `Record`\<`string`, `ActionHandler`\> |
|
|
19
|
-
| <a id="property-registry"></a> `registry` | `TRegistry` |
|
|
20
|
-
| <a id="property-spec"></a> `spec` | [`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) | The current PlaySpec to render.
|
|
21
|
-
| <a id="property-store"></a> `store` | `StateStore` | The active StateStore
|
|
16
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
17
|
+
| ----------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| <a id="property-handlers"></a> `handlers` | `Record`\<`string`, `ActionHandler`\> | The action handlers, resolved against the live StateStore. | [`BaseViewContextValue`](../../play-actor/interfaces/BaseViewContextValue.md).[`handlers`](../../play-actor/interfaces/BaseViewContextValue.md#property-handlers) | [packages/play-actor/src/abstract-actor.ts:127](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L127) |
|
|
19
|
+
| <a id="property-registry"></a> `registry` | `TRegistry` | The component registry, from registryResult.registry. | [`BaseViewContextValue`](../../play-actor/interfaces/BaseViewContextValue.md).[`registry`](../../play-actor/interfaces/BaseViewContextValue.md#property-registry) | [packages/play-actor/src/abstract-actor.ts:129](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L129) |
|
|
20
|
+
| <a id="property-spec"></a> `spec` | [`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) | The current PlaySpec to render. | [`BaseViewContextValue`](../../play-actor/interfaces/BaseViewContextValue.md).[`spec`](../../play-actor/interfaces/BaseViewContextValue.md#property-spec) | [packages/play-actor/src/abstract-actor.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L125) |
|
|
21
|
+
| <a id="property-store"></a> `store` | `StateStore` | The active StateStore. Give it to JSONUIProvider or JsonUIProvider as `store`, and the providers then share the state. | [`BaseViewContextValue`](../../play-actor/interfaces/BaseViewContextValue.md).[`store`](../../play-actor/interfaces/BaseViewContextValue.md#property-store) | [packages/play-actor/src/abstract-actor.ts:133](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L133) |
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
type AnyPlayActor = AbstractActor<AnyActorLogic>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid/src/useActor.ts:
|
|
9
|
+
Defined in: [packages/play-solid/src/useActor.ts:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/useActor.ts#L30)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The bare actor type that the Solid context providers accept. For the complete routing and view shape, use `PlayActor` from `@xmachines/play-router`.
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
const ActorContext: Context<AnyPlayActor | null>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid/src/useActor.ts:
|
|
9
|
+
Defined in: [packages/play-solid/src/useActor.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/useActor.ts#L38)
|
|
10
10
|
|
|
11
|
-
SolidJS context
|
|
12
|
-
directly
|
|
13
|
-
the name "ActorProvider" and is the recommended
|
|
11
|
+
The SolidJS context of the actor. This package exports it, so that a consumer
|
|
12
|
+
can use ActorContext.Provider directly for a custom composition (see D-11). The
|
|
13
|
+
ActorProvider component has the name "ActorProvider", and it is the recommended
|
|
14
|
+
entry point.
|
|
@@ -6,15 +6,16 @@
|
|
|
6
6
|
const ActorProvider: Component<ActorProviderProps>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid/src/ActorProvider.tsx:
|
|
9
|
+
Defined in: [packages/play-solid/src/ActorProvider.tsx:165](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/ActorProvider.tsx#L165)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
StateStore lifecycle,
|
|
11
|
+
The ActorProvider component. It owns the actor bridge, the signal subscription, the
|
|
12
|
+
StateStore lifecycle, the resolution of the handlers, and the error boundary.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`<
|
|
17
|
-
|
|
14
|
+
D-11: this component replaces the old raw alias
|
|
15
|
+
`ActorProvider = ActorContext.Provider`. A consumer with an
|
|
16
|
+
`<ActorProvider value={actor}>` element takes
|
|
17
|
+
`<ActorContext.Provider value={actor}>` now, for the raw access to the provider.
|
|
18
|
+
That consumer can also move to this component, or to PlayUIProvider.
|
|
18
19
|
|
|
19
20
|
## Example
|
|
20
21
|
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
const PlayRenderer: Component;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid/src/PlayRenderer.tsx:
|
|
9
|
+
Defined in: [packages/play-solid/src/PlayRenderer.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/PlayRenderer.tsx#L30)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The leaf renderer without props. Put it inside an ActorProvider tree or a
|
|
12
|
+
PlayUIProvider tree.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
It reads the ViewContextValue (the spec, the handlers, and the registry) of the
|
|
15
|
+
provider around it, with usePlayView(). It then renders the spec with the Renderer
|
|
16
|
+
of @xmachines/json-render-solid.
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
const PlayUIProvider: Component<PlayUIProviderProps>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid/src/PlayUIProvider.tsx:
|
|
9
|
+
Defined in: [packages/play-solid/src/PlayUIProvider.tsx:84](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid/src/PlayUIProvider.tsx#L84)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The composite provider: ActorProvider and JSONUIProvider.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
It gives you the complete stack of the JSON render context:
|
|
14
14
|
|
|
15
|
-
- ActorContext
|
|
16
|
-
- ViewContext
|
|
17
|
-
- StateProvider
|
|
18
|
-
- ConfirmDialogManager
|
|
15
|
+
- ActorContext, which holds the actor instance, through ActorProvider
|
|
16
|
+
- ViewContext, which holds the spec, the handlers, and the registry, through ActorProvider
|
|
17
|
+
- StateProvider, ActionProvider, VisibilityProvider, and ValidationProvider, through JSONUIProvider
|
|
18
|
+
- ConfirmDialogManager, through JSONUIProvider
|
|
19
19
|
|
|
20
20
|
## Example
|
|
21
21
|
|