@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
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ViewStoreResolution
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-actor/src/view-store-lifecycle.ts:
|
|
5
|
+
Defined in: [packages/play-actor/src/view-store-lifecycle.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/view-store-lifecycle.ts#L38)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The result of a resolve — see [ViewStoreLifecycle.resolve](ViewStoreLifecycle.md#resolve).
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property | Type | Description
|
|
12
|
-
| ------------------------------------------------- | ------------ |
|
|
13
|
-
| <a id="property-guardedstore"></a> `guardedStore` | `StateStore` | The store to
|
|
14
|
-
| <a id="property-reseeded"></a> `reseeded` | `boolean` |
|
|
15
|
-
| <a id="property-store"></a> `store` | `StateStore` | The
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| ------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| <a id="property-guardedstore"></a> `guardedStore` | `StateStore` | The store to give to the children ($bindState, setState, and a chained set): a write under /context throws. There is one wrapper for each store below it, and the code caches the identity. Therefore a consumer in the style of `useSyncExternalStore` stays stable. | [packages/play-actor/src/view-store-lifecycle.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/view-store-lifecycle.ts#L47) |
|
|
14
|
+
| <a id="property-reseeded"></a> `reseeded` | `boolean` | It is true when this resolve made a new store: at the first resolve, on a change of the viewKey, in the fallback for each emission, and on a change of the actor. A provider that mounts a subtree again for each store, such as the storeKey of Vue, uses this field as its key. | [packages/play-actor/src/view-store-lifecycle.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/view-store-lifecycle.ts#L54) |
|
|
15
|
+
| <a id="property-store"></a> `store` | `StateStore` | The store WITHOUT the guard — the reference of the machinery for its own refresh. | [packages/play-actor/src/view-store-lifecycle.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/view-store-lifecycle.ts#L40) |
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: Viewable
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
5
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:103](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L103)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The actor capability that exposes a renderable view state.
|
|
8
8
|
|
|
9
|
-
`Viewable` marks
|
|
10
|
-
|
|
11
|
-
current view
|
|
12
|
-
|
|
9
|
+
`Viewable` marks an actor that publishes a `currentView` signal.
|
|
10
|
+
A renderer, such as `PlayRenderer`, reads this contract. It converts the
|
|
11
|
+
description of the current view into a concrete UI, and the framework adapter
|
|
12
|
+
therefore holds no view logic.
|
|
13
13
|
|
|
14
14
|
## Properties
|
|
15
15
|
|
|
16
|
-
| Property | Modifier | Type | Description
|
|
17
|
-
| ----------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------- |
|
|
18
|
-
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](PlaySpec.md) \| `null`\> |
|
|
16
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
17
|
+
| ----------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](PlaySpec.md) \| `null`\> | The signal of the current view. It holds the json-render PlaySpec of the current machine state, or null when no view is active. The infrastructure renders the view. This is the Logic-Driven UI invariant. | [packages/play-actor/src/abstract-actor.ts:110](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L110) |
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
const CONTEXT_STATE_KEY: "context" = "context";
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-actor/src/context-projection.ts:
|
|
9
|
+
Defined in: [packages/play-actor/src/context-projection.ts:32](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/context-projection.ts#L32)
|
|
10
10
|
|
|
11
|
-
The reserved top-level state key the projection
|
|
11
|
+
The reserved top-level state key of the projection.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
warning
|
|
13
|
+
The `spec.state` object of a view must not declare this key. When it does, the
|
|
14
|
+
derivation skips the projection for that view, the authored state wins, and the
|
|
15
|
+
code writes a warning in development. See [composePlayState](../functions/composePlayState.md).
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Vanilla DOM renderer for XMachines Play architecture with signal-driven rendering.
|
|
6
6
|
|
|
7
|
-
[](https://opensource.org/licenses/MIT) [.
|
|
7
|
+
[](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-dom)
|
|
10
8
|
|
|
11
9
|
## Installation
|
|
12
10
|
|
|
@@ -24,7 +22,9 @@ pnpm add xstate @xstate/store @xmachines/json-render-core @xmachines/json-render
|
|
|
24
22
|
|
|
25
23
|
```typescript
|
|
26
24
|
import { createRenderer, schema } from "@xmachines/play-dom";
|
|
25
|
+
import { definePlayer } from "@xmachines/play-xstate";
|
|
27
26
|
import { defineCatalog } from "@xmachines/json-render-core";
|
|
27
|
+
import { createMachine } from "xstate";
|
|
28
28
|
import { z } from "zod";
|
|
29
29
|
import type { ComponentFn } from "@xmachines/play-dom";
|
|
30
30
|
|
|
@@ -59,10 +59,36 @@ const Login: ComponentFn<typeof catalog, "Login"> = ({ props, on }) => {
|
|
|
59
59
|
// 3. Build the factory once (module scope)
|
|
60
60
|
const mount = createRenderer(catalog, { Home, Login });
|
|
61
61
|
|
|
62
|
-
// 4.
|
|
62
|
+
// 4. Create and start an actor — states carry meta.view specs naming catalog components
|
|
63
|
+
const machine = createMachine({
|
|
64
|
+
initial: "home",
|
|
65
|
+
states: {
|
|
66
|
+
home: {
|
|
67
|
+
on: { "goto.login": "login" },
|
|
68
|
+
meta: {
|
|
69
|
+
view: {
|
|
70
|
+
root: "root",
|
|
71
|
+
elements: { root: { type: "Home", props: { title: "Home" }, children: [] } },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
login: {
|
|
76
|
+
meta: {
|
|
77
|
+
view: {
|
|
78
|
+
root: "root",
|
|
79
|
+
elements: { root: { type: "Login", props: { title: "Login" }, children: [] } },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
const actor = definePlayer({ machine })();
|
|
86
|
+
actor.start();
|
|
87
|
+
|
|
88
|
+
// 5. Mount when actor and container are ready
|
|
63
89
|
const disconnect = mount(actor, document.getElementById("app")!);
|
|
64
90
|
|
|
65
|
-
//
|
|
91
|
+
// 6. Cleanup on teardown
|
|
66
92
|
disconnect();
|
|
67
93
|
```
|
|
68
94
|
|
|
@@ -70,7 +96,7 @@ disconnect();
|
|
|
70
96
|
|
|
71
97
|
### `createRenderer` — one-call factory (recommended)
|
|
72
98
|
|
|
73
|
-
`createRenderer` is the simplest integration path. Call it
|
|
99
|
+
`createRenderer` is the simplest integration path. Call it one time at module scope, with your catalog and your component map. Then call the `mount` function that it returns, one time for each pair of an actor and a container.
|
|
74
100
|
|
|
75
101
|
```typescript
|
|
76
102
|
import { createRenderer, schema } from "@xmachines/play-dom";
|
|
@@ -80,16 +106,17 @@ const catalog = defineCatalog(schema, {/* ... */});
|
|
|
80
106
|
|
|
81
107
|
const mount = createRenderer(catalog, { MyComponent });
|
|
82
108
|
|
|
109
|
+
// actor from the Quick Start
|
|
83
110
|
const disconnect = mount(actor, document.getElementById("app")!);
|
|
84
111
|
// Returns a cleanup function — call it to stop rendering and clear the container.
|
|
85
112
|
disconnect();
|
|
86
113
|
```
|
|
87
114
|
|
|
88
|
-
### `createPlayUI` —
|
|
115
|
+
### `createPlayUI` — the complete factory with every option
|
|
89
116
|
|
|
90
|
-
Use `createPlayUI` when you need render error
|
|
117
|
+
Use `createPlayUI` when you need a render error handler, a fallback element, a navigation integration, a computed function, or a custom check. Use it also when your code needs the `registryResult` value, for example for `executeAction`.
|
|
91
118
|
|
|
92
|
-
|
|
119
|
+
The factory holds the factory options (`functions`, `validationFunctions`, `navigate`, `onRenderError`, and `fallback`) from the moment of its creation, and it applies them on every `mount()` call. Give the mount options (`store` and `loading`) to `mount()` itself.
|
|
93
120
|
|
|
94
121
|
```typescript
|
|
95
122
|
import { defineRegistry, createPlayUI, schema } from "@xmachines/play-dom";
|
|
@@ -97,6 +124,7 @@ import { defineCatalog } from "@xmachines/json-render-core";
|
|
|
97
124
|
|
|
98
125
|
const catalog = defineCatalog(schema, {/* ... */});
|
|
99
126
|
|
|
127
|
+
// Home, Login, actor from the Quick Start
|
|
100
128
|
const registryResult = defineRegistry(catalog, {
|
|
101
129
|
components: { Home, Login },
|
|
102
130
|
actions: {
|
|
@@ -122,13 +150,15 @@ disconnect();
|
|
|
122
150
|
|
|
123
151
|
### `PlayRenderer` — class-based lifecycle control
|
|
124
152
|
|
|
125
|
-
Use `PlayRenderer` directly when you need explicit `connect()`
|
|
153
|
+
Use `PlayRenderer` directly when you need the explicit `connect()` and `disconnect()` control, or when you integrate the renderer into a system that controls its life itself.
|
|
126
154
|
|
|
127
155
|
```typescript
|
|
128
156
|
import { PlayRenderer, defineRegistry, schema } from "@xmachines/play-dom";
|
|
129
157
|
|
|
158
|
+
// catalog, actor from the Quick Start; components/actions as in the createPlayUI example
|
|
130
159
|
const registryResult = defineRegistry(catalog, { components, actions });
|
|
131
160
|
|
|
161
|
+
// container: your mount element, e.g. document.getElementById("app")!
|
|
132
162
|
const renderer = new PlayRenderer(container, actor, registryResult.registry, { registryResult });
|
|
133
163
|
|
|
134
164
|
renderer.connect();
|
|
@@ -136,15 +166,16 @@ renderer.connect();
|
|
|
136
166
|
renderer.disconnect();
|
|
137
167
|
```
|
|
138
168
|
|
|
139
|
-
**Controlled store mode
|
|
169
|
+
**Controlled store mode.** Give the renderer an external `StateStore`. The renderer then shares the state with the other parts of your application:
|
|
140
170
|
|
|
141
171
|
```typescript
|
|
142
172
|
import { createAtom } from "@xstate/store";
|
|
143
173
|
import { xstateStoreStateStore } from "@xmachines/json-render-xstate";
|
|
144
174
|
|
|
145
|
-
const atom = createAtom({ username: "" });
|
|
175
|
+
const atom = createAtom<Record<string, unknown>>({ username: "" });
|
|
146
176
|
const store = xstateStoreStateStore({ atom });
|
|
147
177
|
|
|
178
|
+
// container, actor, registryResult from the previous example
|
|
148
179
|
const renderer = new PlayRenderer(container, actor, registryResult.registry, {
|
|
149
180
|
registryResult,
|
|
150
181
|
store,
|
|
@@ -154,11 +185,11 @@ renderer.connect();
|
|
|
154
185
|
|
|
155
186
|
## Provider Options
|
|
156
187
|
|
|
157
|
-
|
|
188
|
+
Every entry point (`createPlayUI` and `PlayRenderer`) accepts the same UI-provider options, through `UIProviderOptions`. Each render pass puts the options into `DomRenderContext`. A component implementation therefore reads them at `ctx.ctx.*`.
|
|
158
189
|
|
|
159
190
|
### `functions` — named compute functions for `$computed` prop expressions
|
|
160
191
|
|
|
161
|
-
|
|
192
|
+
This option permits a dynamic prop value of the form `{ "$computed": "name", "args": {...} }` in a spec. Each function receives the resolved `args` object, and it returns the computed value.
|
|
162
193
|
|
|
163
194
|
```typescript
|
|
164
195
|
const mount = createPlayUI(registryResult, {
|
|
@@ -169,13 +200,13 @@ const mount = createPlayUI(registryResult, {
|
|
|
169
200
|
});
|
|
170
201
|
```
|
|
171
202
|
|
|
172
|
-
Without `functions`,
|
|
203
|
+
Without `functions`, every `$computed` expression resolves to `undefined`. Nothing throws, and the old behavior stays.
|
|
173
204
|
|
|
174
205
|
### `validationFunctions` — custom field validation
|
|
175
206
|
|
|
176
|
-
|
|
207
|
+
This option gives the named check functions for a field check inside a component. Each function receives `(value, args?)`. It returns `true` for a valid value, or `false` for an invalid value.
|
|
177
208
|
|
|
178
|
-
|
|
209
|
+
The DOM renderer has no `ValidationProvider` tree, and in this it is different from the framework renderers. Each component must call the check itself, with `runValidationCheck` or `runValidation` from `@xmachines/json-render-core`. Give `ctx.ctx.validationFunctions` to the call as `customFunctions`.
|
|
179
210
|
|
|
180
211
|
```typescript
|
|
181
212
|
import { runValidationCheck } from "@xmachines/json-render-core";
|
|
@@ -187,19 +218,21 @@ const mount = createPlayUI(registryResult, {
|
|
|
187
218
|
},
|
|
188
219
|
});
|
|
189
220
|
|
|
190
|
-
// Inside a ComponentFn:
|
|
191
|
-
const
|
|
221
|
+
// Inside a ComponentFn (catalog from the Quick Start):
|
|
222
|
+
const Login: ComponentFn<typeof catalog, "Login"> = ({ ctx }) => {
|
|
223
|
+
const someValue = 42; // the value to validate, e.g. read from an input
|
|
192
224
|
const result = runValidationCheck(
|
|
193
225
|
{ type: "isEven", message: "must be even" },
|
|
194
226
|
{ value: someValue, stateModel: {}, customFunctions: ctx.ctx.validationFunctions },
|
|
195
227
|
);
|
|
196
228
|
// result.valid, result.message
|
|
229
|
+
return null;
|
|
197
230
|
};
|
|
198
231
|
```
|
|
199
232
|
|
|
200
233
|
### `navigate` — programmatic navigation from action bindings
|
|
201
234
|
|
|
202
|
-
|
|
235
|
+
The renderer calls this callback when an action binding resolves with `onSuccess: { navigate: "/path" }`. The callback receives the resolved path string as its only argument. Use it with every router:
|
|
203
236
|
|
|
204
237
|
```typescript
|
|
205
238
|
// React Router / TanStack Router / any push-based router:
|
|
@@ -221,17 +254,17 @@ With a spec binding:
|
|
|
221
254
|
}
|
|
222
255
|
```
|
|
223
256
|
|
|
224
|
-
|
|
257
|
+
`submitForm` completes without an error, and the renderer then calls `navigate("/dashboard")`.
|
|
225
258
|
|
|
226
|
-
|
|
259
|
+
A component implementation can also read the function at `ctx.ctx.navigate`. Use this when a navigation must start outside an action binding.
|
|
227
260
|
|
|
228
261
|
### `onRenderError` — unified error handler
|
|
229
262
|
|
|
230
|
-
|
|
263
|
+
The handler receives `(error, name)` for three different classes of error:
|
|
231
264
|
|
|
232
|
-
- **
|
|
233
|
-
- **
|
|
234
|
-
- **
|
|
265
|
+
- **A component render error** — a `ComponentFn` throws synchronously during `renderSpec`. `name` is then the catalog component name, for example `"Home"`.
|
|
266
|
+
- **An action handler rejection on the emit path** — an `ActionFn` throws, or it returns a rejected promise, during `emit()`. `name` is then the catalog action name, for example `"submitForm"`.
|
|
267
|
+
- **An action handler rejection on the watch path** — an `ActionFn` rejects during a `watch` binding callback. `name` is then the catalog action name.
|
|
235
268
|
|
|
236
269
|
```typescript
|
|
237
270
|
const mount = createPlayUI(registryResult, {
|
|
@@ -242,19 +275,20 @@ const mount = createPlayUI(registryResult, {
|
|
|
242
275
|
});
|
|
243
276
|
```
|
|
244
277
|
|
|
245
|
-
The
|
|
278
|
+
The order of the arguments is the same as in the `RenderErrorHandler` type of `@xmachines/json-render-core`: **the error first, the name second**. The framework renderers (`@xmachines/json-render-solid` and `@xmachines/json-render-react`) use the same order.
|
|
246
279
|
|
|
247
|
-
Without `onRenderError`, all three
|
|
280
|
+
Without `onRenderError`, the renderer writes all three types of error to `console.error`, then stops them. No exception goes to the caller, and no promise rejection stays unhandled.
|
|
248
281
|
|
|
249
|
-
|
|
282
|
+
A component implementation can also read the handler at `ctx.ctx.onRenderError`. A component therefore sends its own internal errors through the same channel:
|
|
250
283
|
|
|
251
284
|
```typescript
|
|
252
|
-
|
|
285
|
+
// catalog from the Quick Start; doSomethingRisky: your render logic that may throw
|
|
286
|
+
const Home: ComponentFn<typeof catalog, "Home"> = ({ ctx }) => {
|
|
253
287
|
try {
|
|
254
288
|
const el = doSomethingRisky();
|
|
255
289
|
return el;
|
|
256
290
|
} catch (err) {
|
|
257
|
-
ctx.ctx.onRenderError?.(err, "
|
|
291
|
+
ctx.ctx.onRenderError?.(err, "Home");
|
|
258
292
|
return null;
|
|
259
293
|
}
|
|
260
294
|
};
|
|
@@ -264,42 +298,42 @@ const MyComponent: ComponentFn<typeof catalog, "MyComponent"> = ({ ctx }) => {
|
|
|
264
298
|
|
|
265
299
|
### XMachines Layer
|
|
266
300
|
|
|
267
|
-
| Export | Kind | Description
|
|
268
|
-
| ---------------------------------------- | -------- |
|
|
269
|
-
| `createRenderer(catalog, components)` | function |
|
|
270
|
-
| `createPlayUI(registryResult, options?)` | function |
|
|
271
|
-
| `PlayRenderer` | class |
|
|
272
|
-
| `defineRegistry(catalog, options)` | function | Build a catalog-typed `DomRegistry` with typed handlers
|
|
273
|
-
| `renderSpec(...)` | function |
|
|
274
|
-
| `schema` | const | The `@xmachines/json-render-dom` schema — pass to `defineCatalog()`
|
|
301
|
+
| Export | Kind | Description |
|
|
302
|
+
| ---------------------------------------- | -------- | --------------------------------------------------------------------------------- |
|
|
303
|
+
| `createRenderer(catalog, components)` | function | The one-call factory. It returns `mount(actor, container, options?) → disconnect` |
|
|
304
|
+
| `createPlayUI(registryResult, options?)` | function | The complete factory. It returns a `MountFn` |
|
|
305
|
+
| `PlayRenderer` | class | The renderer class, with a `connect()` and `disconnect()` lifecycle |
|
|
306
|
+
| `defineRegistry(catalog, options)` | function | Build a catalog-typed `DomRegistry` with typed handlers |
|
|
307
|
+
| `renderSpec(...)` | function | The pure low-level Spec → DOM renderer |
|
|
308
|
+
| `schema` | const | The `@xmachines/json-render-dom` schema — pass to `defineCatalog()` |
|
|
275
309
|
|
|
276
310
|
### Key Types
|
|
277
311
|
|
|
278
|
-
| Type | Description
|
|
279
|
-
| ------------------------ |
|
|
280
|
-
| `ComponentFn<C, K>` | Catalog-typed component function — returns `HTMLElement \| Text \| null`
|
|
281
|
-
| `ComponentContext<C, K>` |
|
|
282
|
-
| `ActionFn<C, K>` | Catalog-typed action function — receives `(params, setState, state)`
|
|
283
|
-
| `EventHandle` |
|
|
284
|
-
| `SetState` | State updater: `(prev => next) => void`
|
|
285
|
-
| `DefineRegistryResult` |
|
|
286
|
-
| `PlayDomOptions` | Options for `PlayRenderer` — extends `UIProviderOptions`
|
|
287
|
-
| `CreatePlayUIOptions` | Options for `createPlayUI` — extends `UIProviderOptions`, adds `fallback`
|
|
288
|
-
| `MountOptions` | Per-mount options for `MountFn`: `store`, `loading`
|
|
289
|
-
| `MountFn` | The mount function
|
|
290
|
-
| `UIProviderOptions` | Shared options: `functions`, `validationFunctions`, `navigate`, `onRenderError`
|
|
291
|
-
| `BaseComponentProps<P>` | Catalog-agnostic component props for shared component libraries
|
|
292
|
-
| `DomRegistry` | Raw registry type: `Record<string, DomComponentRenderer>`
|
|
293
|
-
| `DomSchema` | Type of the `schema` export
|
|
294
|
-
| `ComputedFunction` |
|
|
295
|
-
|
|
296
|
-
## Rendering
|
|
297
|
-
|
|
298
|
-
- **
|
|
299
|
-
- **
|
|
300
|
-
- **
|
|
301
|
-
- **
|
|
302
|
-
- **`disconnect()` clears the container** and
|
|
312
|
+
| Type | Description |
|
|
313
|
+
| ------------------------ | --------------------------------------------------------------------------------------------- |
|
|
314
|
+
| `ComponentFn<C, K>` | Catalog-typed component function — returns `HTMLElement \| Text \| null` |
|
|
315
|
+
| `ComponentContext<C, K>` | The context of each component: `props`, `children`, `emit`, `on`, `bindings`, and `ctx` |
|
|
316
|
+
| `ActionFn<C, K>` | Catalog-typed action function — receives `(params, setState, state)` |
|
|
317
|
+
| `EventHandle` | The handle that `on(eventName)` returns. It has `emit()`, `shouldPreventDefault`, and `bound` |
|
|
318
|
+
| `SetState` | State updater: `(prev => next) => void` |
|
|
319
|
+
| `DefineRegistryResult` | The result of `defineRegistry`. It has `registry`, `handlers`, and `executeAction` |
|
|
320
|
+
| `PlayDomOptions` | Options for `PlayRenderer` — extends `UIProviderOptions` |
|
|
321
|
+
| `CreatePlayUIOptions` | Options for `createPlayUI` — extends `UIProviderOptions`, adds `fallback` |
|
|
322
|
+
| `MountOptions` | Per-mount options for `MountFn`: `store`, `loading` |
|
|
323
|
+
| `MountFn` | The mount function that `createPlayUI` returns: `(actor, container, options?) → disconnect` |
|
|
324
|
+
| `UIProviderOptions` | Shared options: `functions`, `validationFunctions`, `navigate`, `onRenderError` |
|
|
325
|
+
| `BaseComponentProps<P>` | Catalog-agnostic component props for shared component libraries |
|
|
326
|
+
| `DomRegistry` | Raw registry type: `Record<string, DomComponentRenderer>` |
|
|
327
|
+
| `DomSchema` | Type of the `schema` export |
|
|
328
|
+
| `ComputedFunction` | The type of a named compute function for the `functions` option |
|
|
329
|
+
|
|
330
|
+
## Rendering Behavior
|
|
331
|
+
|
|
332
|
+
- **The first render is synchronous** — the renderer fills the container before `connect()` returns.
|
|
333
|
+
- **A signal-driven render waits for a microtask** — `watchSignal` puts each update on the next tick of the microtask queue.
|
|
334
|
+
- **A null view** clears the container. The renderer can show a `fallback` element on the first mount, when the view is `null`. It does **not** add that element again when the view returns to `null` after a view that was not null.
|
|
335
|
+
- **A second `connect()` is safe** — a `connect()` call on a connected renderer disconnects it first.
|
|
336
|
+
- **`disconnect()` clears the container** and cancels every signal watcher and store watcher.
|
|
303
337
|
|
|
304
338
|
## Testing
|
|
305
339
|
|
|
@@ -311,33 +345,33 @@ pnpm test
|
|
|
311
345
|
pnpm run test:coverage
|
|
312
346
|
```
|
|
313
347
|
|
|
314
|
-
|
|
348
|
+
The tests are in `test/`. They use [Vitest](https://vitest.dev/) in a jsdom environment. The coverage thresholds are 80% for lines, functions, branches, and statements.
|
|
315
349
|
|
|
316
|
-
@xmachines/play-dom —
|
|
350
|
+
@xmachines/play-dom — the vanilla DOM renderer of the XMachines Play architecture.
|
|
317
351
|
|
|
318
|
-
|
|
352
|
+
The public API has two layers:
|
|
319
353
|
|
|
320
|
-
**XMachines layer
|
|
354
|
+
**The XMachines layer**, in this package:
|
|
321
355
|
|
|
322
|
-
- `createRenderer()` — one-call factory
|
|
323
|
-
- `createPlayUI()` —
|
|
324
|
-
- `PlayRenderer` —
|
|
356
|
+
- `createRenderer()` — the one-call factory. It returns `mount(actor, container, options?) → disconnect`
|
|
357
|
+
- `createPlayUI()` — the complete factory, with every option. It returns a `MountFn`
|
|
358
|
+
- `PlayRenderer` — the renderer class, with a `connect()` and `disconnect()` lifecycle
|
|
325
359
|
- `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `MountOptions`
|
|
326
360
|
|
|
327
|
-
**json-render layer
|
|
328
|
-
|
|
329
|
-
- `defineRegistry` —
|
|
330
|
-
- `renderSpec` — pure Spec → DOM renderer
|
|
331
|
-
- `ComponentFn` — catalog-typed component function
|
|
332
|
-
- `ComponentContext` — catalog-typed render context
|
|
333
|
-
- `ComponentRegistry` — catalog-typed
|
|
334
|
-
- `DomComponentRenderer` — raw
|
|
335
|
-
- `DomRegistry` — raw registry type
|
|
336
|
-
- `DomRenderContext` — raw render context
|
|
337
|
-
- `EventHandle` — event handle
|
|
338
|
-
- `SetState` — state updater function
|
|
339
|
-
- `CatalogHasActions` — conditional type
|
|
340
|
-
- `BaseComponentProps` — base props type
|
|
361
|
+
**The json-render layer**, re-exported from @xmachines/json-render-dom:
|
|
362
|
+
|
|
363
|
+
- `defineRegistry` — it builds a catalog-typed DomRegistry
|
|
364
|
+
- `renderSpec` — the pure Spec → DOM renderer. It uses resolveElementProps of the core
|
|
365
|
+
- `ComponentFn` — the catalog-typed type of a component function
|
|
366
|
+
- `ComponentContext` — the catalog-typed render context: props, emit, on, children, bindings
|
|
367
|
+
- `ComponentRegistry` — the catalog-typed input type of the registry
|
|
368
|
+
- `DomComponentRenderer` — the raw renderer type of one element
|
|
369
|
+
- `DomRegistry` — the raw registry type
|
|
370
|
+
- `DomRenderContext` — the raw render context
|
|
371
|
+
- `EventHandle` — the event handle that on() returns
|
|
372
|
+
- `SetState` — the state updater function of an ActionFn
|
|
373
|
+
- `CatalogHasActions` — the conditional type. It is true when the catalog declares an action
|
|
374
|
+
- `BaseComponentProps` — the base props type of a catalog component definition
|
|
341
375
|
|
|
342
376
|
## Classes
|
|
343
377
|
|