@xmachines/docs 1.0.0-beta.45 → 1.0.0-beta.48
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 +135 -7
- package/api/@xmachines/play/README.md +134 -57
- package/api/@xmachines/play/classes/NonNullableError.md +4 -4
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +130 -155
- package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
- package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/README.md +140 -232
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +1 -1
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +13 -13
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +6 -6
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +4 -4
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +12 -12
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +5 -5
- package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +5 -5
- package/api/@xmachines/play-dom/type-aliases/ActionFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/Actions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +7 -7
- package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomSchema.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/SetState.md +1 -1
- package/api/@xmachines/play-dom/variables/schema.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +160 -158
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-react/README.md +109 -320
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
- 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/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react-router/README.md +107 -124
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +23 -23
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/README.md +235 -475
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +23 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMatcher.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/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.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/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.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/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
- 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/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatcher.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 +5 -5
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +105 -73
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- 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 +117 -263
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +93 -606
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-svelte/README.md +111 -103
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-svelte/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/README.md +156 -17
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +168 -17
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +147 -122
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +23 -23
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
- 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/interfaces/RouterBridge.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 +4 -4
- package/api/@xmachines/play-tanstack-solid-router/README.md +195 -173
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -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 +3 -3
- package/api/@xmachines/play-vue/README.md +126 -271
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +5 -5
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
- 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/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +148 -528
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +24 -24
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-xstate/README.md +167 -496
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +12 -12
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
- 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/contextFieldMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
- 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/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
- 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 +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/README.md +81 -294
- 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/vitest/functions/defineXmVitestConfig.md +1 -1
- package/examples/@xmachines/play-dom-demo/README.md +4 -4
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-dom-router-demo/README.md +3 -3
- package/examples/@xmachines/play-react-demo/README.md +2 -2
- package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-react-router-demo/README.md +2 -2
- package/examples/@xmachines/play-solid-demo/README.md +2 -2
- package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-solid-router-demo/README.md +1 -1
- package/examples/@xmachines/play-svelte-demo/README.md +2 -2
- package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-spa-router-demo/README.md +3 -3
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +3 -3
- package/examples/@xmachines/play-tanstack-react-router-demo/README.md +1 -1
- package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +1 -1
- package/examples/@xmachines/play-vue-demo/README.md +2 -2
- package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-vue-router-demo/README.md +1 -1
- package/examples/README.md +24 -25
- package/examples/form-validation.md +2 -2
- package/guides/README.md +7 -7
- package/guides/actor-model.md +18 -18
- package/guides/architecture.md +500 -0
- package/guides/configuration.md +556 -0
- package/guides/deployment.md +336 -0
- package/guides/development.md +617 -0
- package/guides/getting-started.md +351 -142
- package/guides/signals.md +19 -19
- package/guides/state-machines.md +16 -16
- package/guides/testing.md +460 -0
- package/package.json +5 -5
- package/guides/installation.md +0 -257
|
@@ -1,359 +1,214 @@
|
|
|
1
1
|
[API](../../README.md) / @xmachines/play-vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# `@xmachines/play-vue`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> Vue 3 renderer for the XMachines Play Architecture — passively observes actor signals and renders UI via `@json-render/vue`.
|
|
8
|
+
|
|
9
|
+
Part of the [XMachines Play monorepo](../../README.md).
|
|
10
|
+
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](package.json)
|
|
13
|
+
|
|
14
|
+
---
|
|
8
15
|
|
|
9
16
|
## Overview
|
|
10
17
|
|
|
11
|
-
`@xmachines/play-vue`
|
|
18
|
+
`@xmachines/play-vue` is the Vue 3 rendering layer for XMachines Play. It bridges TC39 Signals (actor state) to Vue reactivity and drives component rendering through `@json-render/vue`.
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
- Renders the current view's JSON spec via `@json-render/vue`
|
|
15
|
-
- Routes action names from spec elements to `actor.send()` via the `actions` prop
|
|
16
|
-
- Manages per-view UI state in an `@xstate/store` atom (automatic or caller-supplied)
|
|
20
|
+
**Architecture invariants this package upholds:**
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
- **Passive Infrastructure** — Components observe actor signals; they never decide state transitions.
|
|
23
|
+
- **Signal-Only Reactivity** — TC39 Signals are the source of truth; Vue reactivity is used only to trigger re-renders.
|
|
24
|
+
- **Actor Authority** — The actor controls view selection; the renderer reflects it.
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
- **Passive Infrastructure (INV-04):** Vue observes signals and dispatches events — never decides
|
|
22
|
-
- **Signal-Only Reactivity (INV-05):** `actor.currentView` signal is the sole render trigger
|
|
26
|
+
---
|
|
23
27
|
|
|
24
28
|
## Installation
|
|
25
29
|
|
|
26
30
|
```bash
|
|
27
31
|
npm install @xmachines/play-vue
|
|
28
|
-
npm install @json-render/vue @json-render/core # peer deps
|
|
29
|
-
npm install @json-render/xstate @xstate/store # store integration
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
so `defineRegistry(..., { onRenderError })` can intercept inner element-boundary errors
|
|
34
|
-
without muting console output.
|
|
35
|
-
|
|
36
|
-
## Current Exports
|
|
37
|
-
|
|
38
|
-
- `PlayRenderer` — main renderer component (Vue SFC)
|
|
39
|
-
- `useActor` — composable for accessing the actor inside a `PlayRenderer` tree
|
|
40
|
-
- `defineRegistry` — SFC-aware wrapper; auto-wraps `.vue` SFCs via `h(SFC, ctx)`
|
|
41
|
-
- `useBoundProp` — re-exported from `@json-render/vue`
|
|
42
|
-
- `ComponentFn` (type) — re-exported from `@json-render/vue`
|
|
43
|
-
- `ComponentContext` (type) — re-exported from `@json-render/vue`
|
|
44
|
-
- `ActorProvider` — escape hatch primitive (owns actor bridging, signal bridge, store lifecycle)
|
|
45
|
-
- `PlayUIProvider` — batteries-included composite (wraps `ActorProvider` + `JSONUIProvider`)
|
|
46
|
-
- `getPlayViewContext` — composable for accessing the current view spec inside a provider tree
|
|
47
|
-
- `RenderErrorHandler` (type) — inner per-element error callback signature
|
|
48
|
-
- `ActorProviderProps` (type)
|
|
49
|
-
- `ViewContextValue` (type)
|
|
50
|
-
- `PlayActor` (type)
|
|
51
|
-
|
|
52
|
-
## Quick Start
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
// catalog.ts — shared contract
|
|
56
|
-
import { defineCatalog } from "@json-render/core";
|
|
57
|
-
import { z } from "zod";
|
|
58
|
-
|
|
59
|
-
export const catalog = defineCatalog({
|
|
60
|
-
elements: {
|
|
61
|
-
Login: { props: z.object({ title: z.string() }), description: "Login form" },
|
|
62
|
-
Dashboard: { props: z.object({ username: z.string() }), description: "Dashboard" },
|
|
63
|
-
},
|
|
64
|
-
});
|
|
34
|
+
**Peer dependencies** (install alongside):
|
|
65
35
|
|
|
66
|
-
|
|
36
|
+
```bash
|
|
37
|
+
npm install vue@^3.5.0 xstate@^5.30.0 @xstate/store@^3.17.0 @json-render/vue@^0.18.0 @json-render/core@^0.18.0 @json-render/xstate@^0.18.0
|
|
67
38
|
```
|
|
68
39
|
|
|
69
|
-
|
|
70
|
-
<!-- Login.vue — Vue SFC; useBoundProp works in <script setup> -->
|
|
71
|
-
<script setup lang="ts">
|
|
72
|
-
import { useBoundProp } from "@xmachines/play-vue";
|
|
73
|
-
import type { ComponentContext } from "@xmachines/play-vue";
|
|
74
|
-
import type { Catalog } from "./catalog.js";
|
|
40
|
+
---
|
|
75
41
|
|
|
76
|
-
|
|
77
|
-
const [username, setUsername] = useBoundProp<string>(bindings?.username ?? "/username");
|
|
78
|
-
</script>
|
|
42
|
+
## Quick Start
|
|
79
43
|
|
|
44
|
+
```vue
|
|
45
|
+
<!-- App.vue -->
|
|
80
46
|
<template>
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
<input id="username" v-model="username" @input="setUsername(username)" />
|
|
85
|
-
<button type="submit">Log In</button>
|
|
86
|
-
</form>
|
|
87
|
-
</div>
|
|
47
|
+
<PlayUIProvider :actor="actor" :registryResult="registryResult">
|
|
48
|
+
<PlayRenderer />
|
|
49
|
+
</PlayUIProvider>
|
|
88
50
|
</template>
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
```ts
|
|
92
|
-
// registry.ts — pass SFCs directly; defineRegistry auto-wraps them
|
|
93
|
-
import { defineRegistry } from "@xmachines/play-vue";
|
|
94
|
-
import { catalog } from "./catalog.js";
|
|
95
|
-
import LoginSFC from "./Login.vue";
|
|
96
|
-
import DashboardSFC from "./Dashboard.vue";
|
|
97
|
-
|
|
98
|
-
export const registryResult = defineRegistry(catalog, {
|
|
99
|
-
components: { Login: LoginSFC, Dashboard: DashboardSFC },
|
|
100
|
-
actions: {
|
|
101
|
-
login: async (params) => {
|
|
102
|
-
if (!params) return;
|
|
103
|
-
actor.send({ type: "auth.login", username: params.username });
|
|
104
|
-
},
|
|
105
|
-
logout: async (params) => {
|
|
106
|
-
actor.send({ type: "auth.logout" });
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
```ts
|
|
113
|
-
// machine.ts
|
|
114
|
-
import { setup, assign } from "xstate";
|
|
115
|
-
import { formatPlayRouteTransitions } from "@xmachines/play-xstate";
|
|
116
|
-
|
|
117
|
-
export const machine = setup({
|
|
118
|
-
types: {
|
|
119
|
-
context: {} as {
|
|
120
|
-
isAuthenticated: boolean;
|
|
121
|
-
username: string | null;
|
|
122
|
-
params: Record<string, string>;
|
|
123
|
-
query: Record<string, string>;
|
|
124
|
-
},
|
|
125
|
-
events: {} as
|
|
126
|
-
| { type: "auth.login"; username: string }
|
|
127
|
-
| { type: "auth.logout" }
|
|
128
|
-
| { type: "play.route"; to: string; params?: Record<string, string> },
|
|
129
|
-
},
|
|
130
|
-
}).createMachine(
|
|
131
|
-
formatPlayRouteTransitions({
|
|
132
|
-
id: "app",
|
|
133
|
-
initial: "login",
|
|
134
|
-
context: { isAuthenticated: false, username: null, params: {}, query: {} },
|
|
135
|
-
states: {
|
|
136
|
-
login: {
|
|
137
|
-
id: "login",
|
|
138
|
-
meta: {
|
|
139
|
-
route: "/login",
|
|
140
|
-
view: {
|
|
141
|
-
root: "root",
|
|
142
|
-
elements: {
|
|
143
|
-
root: { type: "Login", props: { title: "Sign In" }, children: [] },
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
dashboard: {
|
|
149
|
-
id: "dashboard",
|
|
150
|
-
meta: {
|
|
151
|
-
route: "/dashboard",
|
|
152
|
-
view: {
|
|
153
|
-
root: "root",
|
|
154
|
-
elements: {
|
|
155
|
-
root: { type: "Dashboard", props: { username: "" }, children: [] },
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
on: {
|
|
162
|
-
"auth.login": {
|
|
163
|
-
target: ".dashboard",
|
|
164
|
-
guard: ({ context }) => !context.isAuthenticated,
|
|
165
|
-
actions: assign({ isAuthenticated: true, username: ({ event }) => event.username }),
|
|
166
|
-
},
|
|
167
|
-
"auth.logout": {
|
|
168
|
-
target: ".login",
|
|
169
|
-
guard: ({ context }) => context.isAuthenticated,
|
|
170
|
-
actions: assign({ isAuthenticated: false, username: null }),
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
}),
|
|
174
|
-
);
|
|
175
|
-
```
|
|
176
51
|
|
|
177
|
-
```vue
|
|
178
|
-
<!-- App.vue -->
|
|
179
52
|
<script setup lang="ts">
|
|
53
|
+
import { defineRegistry, PlayUIProvider, PlayRenderer } from "@xmachines/play-vue";
|
|
180
54
|
import { definePlayer } from "@xmachines/play-xstate";
|
|
181
|
-
import {
|
|
182
|
-
import {
|
|
183
|
-
import
|
|
55
|
+
import { myMachine } from "./machine.js";
|
|
56
|
+
import { myCatalog } from "./catalog.js";
|
|
57
|
+
import HomeSFC from "./views/Home.vue";
|
|
58
|
+
import LoginSFC from "./views/Login.vue";
|
|
184
59
|
|
|
185
|
-
const createPlayer = definePlayer({ machine });
|
|
60
|
+
const createPlayer = definePlayer({ machine: myMachine });
|
|
186
61
|
const actor = createPlayer();
|
|
187
62
|
actor.start();
|
|
188
|
-
</script>
|
|
189
63
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
64
|
+
const registryResult = defineRegistry(myCatalog, {
|
|
65
|
+
components: {
|
|
66
|
+
Home: HomeSFC, // .vue SFCs are auto-wrapped
|
|
67
|
+
Login: LoginSFC,
|
|
68
|
+
},
|
|
69
|
+
actions: {
|
|
70
|
+
login: async (args) => actor.send({ type: "auth.login", ...args }),
|
|
71
|
+
logout: async () => actor.send({ type: "auth.logout" }),
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
</script>
|
|
195
75
|
```
|
|
196
76
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
### `PlayUIProvider`
|
|
77
|
+
---
|
|
200
78
|
|
|
201
|
-
|
|
79
|
+
## API Summary
|
|
202
80
|
|
|
203
|
-
|
|
204
|
-
<PlayUIProvider
|
|
205
|
-
:actor="actor"
|
|
206
|
-
:registryResult="registryResult"
|
|
207
|
-
:store="myStore"
|
|
208
|
-
:onRenderError="(error, elementType) => console.warn(`<${elementType}> crashed:`, error)"
|
|
209
|
-
>
|
|
210
|
-
<template #fallback><p>Something went wrong.</p></template>
|
|
211
|
-
<PlayRenderer />
|
|
212
|
-
</PlayUIProvider>
|
|
213
|
-
```
|
|
81
|
+
### Components
|
|
214
82
|
|
|
215
|
-
|
|
83
|
+
#### `<PlayUIProvider>`
|
|
216
84
|
|
|
217
|
-
|
|
85
|
+
Batteries-included composite provider. Wraps `<ActorProvider>` and `JSONUIProvider` in one component. **Recommended for most apps.**
|
|
218
86
|
|
|
219
|
-
|
|
87
|
+
| Prop | Type | Required | Description |
|
|
88
|
+
| --------------------- | -------------------------- | -------- | ------------------------------------------- |
|
|
89
|
+
| `actor` | `AbstractActor & Viewable` | ✅ | The XMachines actor instance |
|
|
90
|
+
| `registryResult` | `DefineRegistryResult` | ✅ | Result of `defineRegistry()` |
|
|
91
|
+
| `store` | `StateStore` | — | External controlled state store (optional) |
|
|
92
|
+
| `onRenderError` | `RenderErrorHandler` | — | Error handler for render failures |
|
|
93
|
+
| `navigate` | `(path: string) => void` | — | Link navigation function |
|
|
94
|
+
| `validationFunctions` | `Record<string, Function>` | — | Custom validation functions |
|
|
95
|
+
| `functions` | `Record<string, Function>` | — | Named functions for `$computed` expressions |
|
|
220
96
|
|
|
221
|
-
|
|
222
|
-
- **Provided (controlled):** The caller owns the store; `spec.state` is ignored.
|
|
97
|
+
**Slots:** `default` (rendered content), `fallback` (shown while actor view is `null`)
|
|
223
98
|
|
|
224
|
-
|
|
225
|
-
import { createAtom } from "@xstate/store";
|
|
226
|
-
import { xstateStoreStateStore } from "@json-render/xstate";
|
|
227
|
-
import type { StateStore } from "@json-render/core";
|
|
99
|
+
#### `<PlayRenderer>`
|
|
228
100
|
|
|
229
|
-
|
|
230
|
-
```
|
|
101
|
+
Zero-prop leaf component. Reads the current `spec` and `registry` from the nearest `<ActorProvider>` or `<PlayUIProvider>` context and renders via `<Renderer>`. Must be placed inside one of those providers.
|
|
231
102
|
|
|
232
103
|
```vue
|
|
233
|
-
<PlayUIProvider :actor="actor" :registryResult="registryResult"
|
|
234
|
-
|
|
104
|
+
<PlayUIProvider :actor="actor" :registryResult="registryResult">
|
|
105
|
+
<PlayRenderer />
|
|
235
106
|
</PlayUIProvider>
|
|
236
107
|
```
|
|
237
108
|
|
|
238
|
-
|
|
109
|
+
#### `<ActorProvider>`
|
|
239
110
|
|
|
240
|
-
|
|
111
|
+
Low-level escape hatch for custom provider composition. Owns the full actor lifecycle — signal subscription, per-view state store, handler resolution, and Vue context provision. Use `<PlayUIProvider>` unless you need fine-grained control.
|
|
241
112
|
|
|
242
|
-
|
|
113
|
+
| Prop | Type | Required | Description |
|
|
114
|
+
| ---------------- | -------------------------- | -------- | ------------------------------- |
|
|
115
|
+
| `actor` | `AbstractActor & Viewable` | ✅ | The XMachines actor instance |
|
|
116
|
+
| `registryResult` | `DefineRegistryResult` | ✅ | Result of `defineRegistry()` |
|
|
117
|
+
| `store` | `StateStore` | — | External controlled state store |
|
|
118
|
+
| `onRenderError` | `RenderErrorHandler` | — | Override render error handler |
|
|
243
119
|
|
|
244
|
-
|
|
120
|
+
---
|
|
245
121
|
|
|
246
|
-
|
|
247
|
-
<ActorProvider :actor="actor" :registryResult="registryResult" :onRenderError="handleError">
|
|
248
|
-
<!-- your own JSONUIProvider + PlayRenderer tree -->
|
|
249
|
-
</ActorProvider>
|
|
250
|
-
```
|
|
122
|
+
### Functions
|
|
251
123
|
|
|
252
|
-
|
|
124
|
+
#### `defineRegistry(catalog, options)`
|
|
253
125
|
|
|
254
|
-
|
|
126
|
+
Drop-in replacement for `defineRegistry` from `@json-render/vue`. **Always import from `@xmachines/play-vue`** rather than `@json-render/vue` when working with Vue SFCs — this wrapper automatically detects `.vue` SFCs in the `components` map and wraps them via `h()` so Vue composables (including `inject`-based ones) work correctly inside `<script setup>`.
|
|
255
127
|
|
|
256
|
-
|
|
128
|
+
```typescript
|
|
129
|
+
import { defineRegistry } from "@xmachines/play-vue";
|
|
130
|
+
// NOT: import { defineRegistry } from "@json-render/vue"
|
|
257
131
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
<PlayRenderer />
|
|
261
|
-
</PlayUIProvider>
|
|
262
|
-
```
|
|
132
|
+
import LoginSFC from "./views/Login.vue";
|
|
133
|
+
import DashboardSFC from "./views/Dashboard.vue";
|
|
263
134
|
|
|
264
|
-
|
|
135
|
+
const registryResult = defineRegistry(catalog, {
|
|
136
|
+
components: {
|
|
137
|
+
Login: LoginSFC, // .vue SFC — auto-wrapped via h()
|
|
138
|
+
Dashboard: DashboardSFC,
|
|
139
|
+
},
|
|
140
|
+
actions: {
|
|
141
|
+
login: async (args, setState, getState) => {
|
|
142
|
+
/* ... */
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
```
|
|
265
147
|
|
|
266
|
-
|
|
148
|
+
Plain `ComponentFn` functions (non-SFC) also work and are passed through unchanged. Mixing SFCs and plain functions in the same registry is supported.
|
|
267
149
|
|
|
268
|
-
|
|
150
|
+
#### `useActor()`
|
|
269
151
|
|
|
270
|
-
|
|
152
|
+
Vue composable for accessing the raw actor inside a `PlayRenderer` tree. Avoids prop drilling for deeply nested components.
|
|
271
153
|
|
|
272
|
-
|
|
154
|
+
```typescript
|
|
155
|
+
import { useActor } from "@xmachines/play-vue";
|
|
273
156
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
<p>Something went wrong.</p>
|
|
278
|
-
</template>
|
|
279
|
-
<PlayRenderer />
|
|
280
|
-
</PlayUIProvider>
|
|
157
|
+
// Inside a component rendered by PlayRenderer:
|
|
158
|
+
const actor = useActor();
|
|
159
|
+
actor.send({ type: "SUBMIT" });
|
|
281
160
|
```
|
|
282
161
|
|
|
283
|
-
|
|
162
|
+
Throws if called outside an `<ActorProvider>` or `<PlayUIProvider>` tree.
|
|
284
163
|
|
|
285
|
-
|
|
164
|
+
#### `getPlayViewContext()`
|
|
286
165
|
|
|
287
|
-
|
|
166
|
+
Access the current `ViewContextValue` — `{ spec, handlers, registry, store }` — from inside an `<ActorProvider>` tree.
|
|
288
167
|
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
<PlayUIProvider
|
|
292
|
-
:actor="actor"
|
|
293
|
-
:registryResult="registryResult"
|
|
294
|
-
:onRenderError="(error, elementType) => console.warn(`<${elementType}> crashed:`, error)"
|
|
295
|
-
>
|
|
296
|
-
<PlayRenderer />
|
|
297
|
-
</PlayUIProvider>
|
|
298
|
-
```
|
|
168
|
+
```typescript
|
|
169
|
+
import { getPlayViewContext } from "@xmachines/play-vue";
|
|
299
170
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
components: { Login: LoginSFC, Dashboard: DashboardSFC },
|
|
304
|
-
actions: { login: async (params) => { ... }, logout: async () => { ... } },
|
|
305
|
-
onRenderError(error, elementType) {
|
|
306
|
-
reportExpectedRenderError(error, elementType);
|
|
307
|
-
},
|
|
308
|
-
});
|
|
171
|
+
// Inside setup() of a component within an ActorProvider tree:
|
|
172
|
+
const view = getPlayViewContext();
|
|
173
|
+
// view.spec, view.handlers, view.registry, view.store
|
|
309
174
|
```
|
|
310
175
|
|
|
311
|
-
`onRenderError` is typed as `RenderErrorHandler` and exported from.
|
|
312
|
-
|
|
313
176
|
---
|
|
314
177
|
|
|
315
|
-
### `
|
|
178
|
+
### Re-exported from `@json-render/vue`
|
|
316
179
|
|
|
317
|
-
|
|
180
|
+
The following are re-exported so consumers import everything from `@xmachines/play-vue`:
|
|
318
181
|
|
|
319
|
-
|
|
320
|
-
import { useActor } from "@xmachines/play-vue";
|
|
182
|
+
**Components:** `JSONUIProvider`, `StateProvider`, `ActionProvider`, `VisibilityProvider`, `ValidationProvider`, `Renderer`
|
|
321
183
|
|
|
322
|
-
|
|
323
|
-
const actor = useActor();
|
|
324
|
-
actor.send({ type: "auth.logout" });
|
|
325
|
-
```
|
|
184
|
+
**Composables:** `useBoundProp`
|
|
326
185
|
|
|
327
|
-
|
|
186
|
+
**Types:** `JSONUIProviderProps`, `StateProviderProps`, `ActionProviderProps`, `ValidationProviderProps`, `RendererProps`, `ComponentFn`, `ComponentContext`, `DefineRegistryResult`
|
|
328
187
|
|
|
329
188
|
---
|
|
330
189
|
|
|
331
|
-
##
|
|
190
|
+
## Testing
|
|
332
191
|
|
|
333
|
-
|
|
192
|
+
Run tests for this package in isolation:
|
|
334
193
|
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
// Component receives: { section: "profile", user: "alice" }
|
|
339
|
-
```
|
|
194
|
+
```bash
|
|
195
|
+
# From the monorepo root
|
|
196
|
+
npm test -w packages/play-vue
|
|
340
197
|
|
|
341
|
-
|
|
198
|
+
# Watch mode
|
|
199
|
+
npm run test:watch -w packages/play-vue
|
|
342
200
|
|
|
343
|
-
|
|
201
|
+
# With coverage (80% threshold enforced on lines, functions, branches, statements)
|
|
202
|
+
npx vitest run --coverage --config packages/play-vue/vitest.config.ts
|
|
203
|
+
```
|
|
344
204
|
|
|
345
|
-
|
|
205
|
+
Tests use [Vitest](https://vitest.dev/) with `jsdom` environment and `@vue/test-utils` for component mounting.
|
|
346
206
|
|
|
347
|
-
|
|
348
|
-
- `actor.currentView` (TC39 Signal) is bridged to Vue's reactive system inside `PlayRenderer`
|
|
349
|
-
- Per-view UI state lives in an `@xstate/store` atom, not in Vue reactive state
|
|
350
|
-
- `@json-render/vue` drives rendering; `PlayRenderer` is the signal bridge — import `defineRegistry`, `ComponentFn`, `ComponentContext`, and `useBoundProp` from
|
|
351
|
-
- Vue views should be `.vue` SFCs using `ComponentContext<MyCatalog, "X">` — `defineRegistry` from and Vue composables work correctly
|
|
207
|
+
---
|
|
352
208
|
|
|
353
|
-
##
|
|
209
|
+
## License
|
|
354
210
|
|
|
355
|
-
|
|
356
|
-
- [Vue Router adapter](../play-vue-router/README.md)
|
|
211
|
+
MIT — see [LICENSE](LICENSE).
|
|
357
212
|
|
|
358
213
|
@xmachines/play-vue - Vue 3 renderer for XMachines Play architecture
|
|
359
214
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function defineRegistry<C>(catalog, options): DefineRegistryResult;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/define-registry.ts:131](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/define-registry.ts:131](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-vue/src/define-registry.ts#L131)
|
|
10
10
|
|
|
11
11
|
Create a component registry, automatically wrapping `.vue` SFCs so they work
|
|
12
12
|
correctly with `@json-render/vue`'s rendering pipeline.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function getPlayViewContext(): ViewContextValue;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/actor-provider-context.ts:44](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/actor-provider-context.ts:44](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-vue/src/actor-provider-context.ts#L44)
|
|
10
10
|
|
|
11
11
|
Access the current ViewContextValue from inside an ActorProvider tree.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function useActor(): PlayActor;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/useActor.ts:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/useActor.ts:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-vue/src/useActor.ts#L43)
|
|
10
10
|
|
|
11
11
|
## Returns
|
|
12
12
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ActorProviderProps
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-vue/src/types.ts:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-vue/src/types.ts:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-vue/src/types.ts#L14)
|
|
6
6
|
|
|
7
7
|
Props for the ActorProvider component.
|
|
8
8
|
Extracted to types.ts so TypeScript can re-export without the vue-shim limitation.
|
|
@@ -19,7 +19,7 @@ Extracted to types.ts so TypeScript can re-export without the vue-shim limitatio
|
|
|
19
19
|
|
|
20
20
|
| Property | Type | Description | Inherited from | Defined in |
|
|
21
21
|
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
-
| <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) | Actor instance with currentView signal (requires Viewable capability). | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`actor`](../../play-actor/interfaces/BaseActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:154](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
23
|
-
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Called when an individual catalog component throws during render. Takes precedence over any onRenderError set via defineRegistry. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`onRenderError`](../../play-actor/interfaces/BaseActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
24
|
-
| <a id="property-registryresult"></a> `registryResult` | [`DefineRegistryResult`](DefineRegistryResult.md) | Full result from defineRegistry() — contains the component registry and action handlers factory. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`registryResult`](../../play-actor/interfaces/BaseActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
25
|
-
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (controlled mode). When provided, spec.state is ignored and this store is the single source of truth. When omitted, a fresh @xstate/store atom is created per view transition from spec.state. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`store`](../../play-actor/interfaces/BaseActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:162](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
22
|
+
| <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) | Actor instance with currentView signal (requires Viewable capability). | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`actor`](../../play-actor/interfaces/BaseActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:154](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L154) |
|
|
23
|
+
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Called when an individual catalog component throws during render. Takes precedence over any onRenderError set via defineRegistry. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`onRenderError`](../../play-actor/interfaces/BaseActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L167) |
|
|
24
|
+
| <a id="property-registryresult"></a> `registryResult` | [`DefineRegistryResult`](DefineRegistryResult.md) | Full result from defineRegistry() — contains the component registry and action handlers factory. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`registryResult`](../../play-actor/interfaces/BaseActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L156) |
|
|
25
|
+
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (controlled mode). When provided, spec.state is ignored and this store is the single source of truth. When omitted, a fresh @xstate/store atom is created per view transition from spec.state. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`store`](../../play-actor/interfaces/BaseActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:162](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L162) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayUIProviderProps
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-vue/src/types.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-vue/src/types.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-vue/src/types.ts#L25)
|
|
6
6
|
|
|
7
7
|
Props for the ActorProvider component.
|
|
8
8
|
Extracted to types.ts so TypeScript can re-export without the vue-shim limitation.
|
|
@@ -15,10 +15,10 @@ Extracted to types.ts so TypeScript can re-export without the vue-shim limitatio
|
|
|
15
15
|
|
|
16
16
|
| Property | Type | Description | Inherited from | Defined in |
|
|
17
17
|
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
-
| <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) | Actor instance with currentView signal (requires Viewable capability). | [`ActorProviderProps`](ActorProviderProps.md).[`actor`](ActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:154](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
19
|
-
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, (`args?`, `state?`) => `unknown`\> | Named functions for $computed expressions in props | - | [packages/play-vue/src/types.ts:34](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
20
|
-
| <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Navigate function forwarded to JSONUIProvider for link resolution | - | [packages/play-vue/src/types.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
21
|
-
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Called when an individual catalog component throws during render. Takes precedence over any onRenderError set via defineRegistry. | [`ActorProviderProps`](ActorProviderProps.md).[`onRenderError`](ActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
22
|
-
| <a id="property-registryresult"></a> `registryResult` | [`DefineRegistryResult`](DefineRegistryResult.md) | Full result from defineRegistry() — contains the component registry and action handlers factory. | [`ActorProviderProps`](ActorProviderProps.md).[`registryResult`](ActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
23
|
-
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (controlled mode). When provided, spec.state is ignored and this store is the single source of truth. When omitted, a fresh @xstate/store atom is created per view transition from spec.state. | [`ActorProviderProps`](ActorProviderProps.md).[`store`](ActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:162](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
24
|
-
| <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Validation functions forwarded to JSONUIProvider | - | [packages/play-vue/src/types.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
18
|
+
| <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) | Actor instance with currentView signal (requires Viewable capability). | [`ActorProviderProps`](ActorProviderProps.md).[`actor`](ActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:154](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L154) |
|
|
19
|
+
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, (`args?`, `state?`) => `unknown`\> | Named functions for $computed expressions in props | - | [packages/play-vue/src/types.ts:34](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-vue/src/types.ts#L34) |
|
|
20
|
+
| <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Navigate function forwarded to JSONUIProvider for link resolution | - | [packages/play-vue/src/types.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-vue/src/types.ts#L27) |
|
|
21
|
+
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Called when an individual catalog component throws during render. Takes precedence over any onRenderError set via defineRegistry. | [`ActorProviderProps`](ActorProviderProps.md).[`onRenderError`](ActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L167) |
|
|
22
|
+
| <a id="property-registryresult"></a> `registryResult` | [`DefineRegistryResult`](DefineRegistryResult.md) | Full result from defineRegistry() — contains the component registry and action handlers factory. | [`ActorProviderProps`](ActorProviderProps.md).[`registryResult`](ActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L156) |
|
|
23
|
+
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (controlled mode). When provided, spec.state is ignored and this store is the single source of truth. When omitted, a fresh @xstate/store atom is created per view transition from spec.state. | [`ActorProviderProps`](ActorProviderProps.md).[`store`](ActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:162](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L162) |
|
|
24
|
+
| <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Validation functions forwarded to JSONUIProvider | - | [packages/play-vue/src/types.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-vue/src/types.ts#L29) |
|