@xmachines/docs 1.0.0-beta.30 → 1.0.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/@xmachines/play/README.md +5 -0
- package/api/@xmachines/play/classes/NonNullableError.md +189 -0
- package/api/@xmachines/play/classes/PlayError.md +9 -4
- package/api/@xmachines/play/functions/assertNonNullable.md +56 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +9 -9
- 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/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/README.md +40 -10
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +20 -12
- package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/defineRegistry.md +8 -21
- package/api/@xmachines/play-dom/functions/renderSpec.md +15 -13
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +9 -48
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +7 -7
- package/api/@xmachines/play-dom/interfaces/DefineRegistryOptions.md +7 -9
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +7 -8
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +9 -12
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +6 -20
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +5 -5
- package/api/@xmachines/play-dom/type-aliases/ActionFn.md +30 -0
- package/api/@xmachines/play-dom/type-aliases/Actions.md +18 -0
- package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +1 -28
- package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +1 -7
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -17
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -6
- package/api/@xmachines/play-dom/type-aliases/DomSchema.md +9 -0
- package/api/@xmachines/play-dom/variables/schema.md +56 -0
- 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/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapLike.md +3 -3
- 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 +29 -32
- 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/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +11 -12
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +12 -5
- 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/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/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/README.md +1 -1
- package/api/@xmachines/play-router/classes/BaseRouteMap.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/createRouteMapFromMachine.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.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/RouteMap.md +4 -4
- 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/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/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 +28 -29
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/useBoundProp.md +45 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +11 -12
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +4 -25
- package/api/@xmachines/play-solid-router/README.md +2 -2
- 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 +28 -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 +7 -7
- 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 +23 -7
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +12 -35
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +23 -0
- package/api/@xmachines/play-svelte/interfaces/PlayRendererProps.md +8 -9
- package/api/@xmachines/play-svelte/type-aliases/ActionFn.md +30 -0
- package/api/@xmachines/play-svelte/type-aliases/Actions.md +17 -0
- package/api/@xmachines/play-svelte/type-aliases/SetState.md +21 -0
- 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/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/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/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/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 +8 -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 +7 -7
- 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/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 +9 -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/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 +33 -33
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/useBoundProp.md +45 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +9 -10
- 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 +3 -3
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +39 -26
- 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/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 +1 -0
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +54 -23
- 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 +47 -47
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/examples/@xmachines/play-dom-demo/README.md +7 -0
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +23 -0
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +9 -0
- 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 +9 -0
- 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 +172 -0
- package/examples/@xmachines/play-react-demo/README.md +9 -3
- package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-react-demo/functions/DebugPanel.md +1 -1
- package/examples/@xmachines/play-react-demo/functions/HeaderNav.md +1 -1
- package/examples/@xmachines/play-react-demo/functions/Shell.md +1 -1
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +9 -0
- 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 +11 -0
- 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 +11 -0
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +9 -0
- 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 +13 -0
- package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-react-router-demo/README.md +1 -3
- package/examples/@xmachines/play-solid-demo/README.md +9 -3
- package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-solid-demo/functions/DebugPanel.md +1 -1
- package/examples/@xmachines/play-solid-demo/functions/HeaderNav.md +1 -1
- package/examples/@xmachines/play-solid-demo/functions/Shell.md +1 -1
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +9 -0
- 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 +11 -0
- 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 +11 -0
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +12 -0
- 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 +13 -0
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-solid-router-demo/README.md +1 -3
- package/examples/README.md +2 -2
- package/package.json +6 -6
- package/rfc/play.md +19 -19
- package/api/@xmachines/play-react/functions/useStateBinding.md +0 -34
- package/api/@xmachines/play-solid/functions/useStateBinding.md +0 -25
- package/api/@xmachines/play-vue/functions/useStateBinding.md +0 -32
|
@@ -2,21 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: PlayRenderer
|
|
4
4
|
|
|
5
|
-
Defined in: [PlayRenderer.ts:
|
|
5
|
+
Defined in: [PlayRenderer.ts:60](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/PlayRenderer.ts#L60)
|
|
6
6
|
|
|
7
7
|
PlayRenderer connects an actor's currentView signal to the DOM renderer.
|
|
8
8
|
|
|
9
9
|
Usage:
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
const
|
|
12
|
+
const { registry, handlers } = defineRegistry(catalog, { components, actions });
|
|
13
|
+
const resolvedHandlers = handlers(
|
|
14
|
+
() => undefined,
|
|
15
|
+
() => ({}),
|
|
16
|
+
);
|
|
17
|
+
const renderer = new PlayRenderer(container, actor, registry, { handlers: resolvedHandlers });
|
|
13
18
|
renderer.connect();
|
|
14
19
|
|
|
15
20
|
// Controlled mode — bring your own store:
|
|
16
21
|
import { createAtom } from "@xstate/store";
|
|
17
22
|
import { xstateStoreStateStore } from "@json-render/xstate";
|
|
18
23
|
const store = xstateStoreStateStore({ atom: createAtom({ username: "" }) });
|
|
19
|
-
const renderer = new PlayRenderer(container, actor, registry, {
|
|
24
|
+
const renderer = new PlayRenderer(container, actor, registry, {
|
|
25
|
+
store,
|
|
26
|
+
handlers: resolvedHandlers,
|
|
27
|
+
});
|
|
20
28
|
|
|
21
29
|
// Later:
|
|
22
30
|
renderer.disconnect();
|
|
@@ -34,16 +42,16 @@ new PlayRenderer(
|
|
|
34
42
|
options?): PlayRenderer;
|
|
35
43
|
```
|
|
36
44
|
|
|
37
|
-
Defined in: [PlayRenderer.ts:
|
|
45
|
+
Defined in: [PlayRenderer.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/PlayRenderer.ts#L72)
|
|
38
46
|
|
|
39
47
|
#### Parameters
|
|
40
48
|
|
|
41
|
-
| Parameter | Type | Description
|
|
42
|
-
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
-
| `container` | `HTMLElement` | The `HTMLElement` to render into. Cleared and repopulated on every view transition.
|
|
44
|
-
| `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 providing the `currentView` signal (must implement `Viewable`).
|
|
45
|
-
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Map of component type names to `DomComponentRenderer` functions.
|
|
46
|
-
| `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | Optional configuration: `
|
|
49
|
+
| Parameter | Type | Description |
|
|
50
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `container` | `HTMLElement` | The `HTMLElement` to render into. Cleared and repopulated on every view transition. |
|
|
52
|
+
| `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 providing the `currentView` signal (must implement `Viewable`). |
|
|
53
|
+
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Map of component type names to `DomComponentRenderer` functions. |
|
|
54
|
+
| `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | Optional configuration: `handlers` map (action name → async handler) and optional external `store` (controlled mode — when omitted, a fresh `@xstate/store` atom is created per view transition seeded from `spec.state`). |
|
|
47
55
|
|
|
48
56
|
#### Returns
|
|
49
57
|
|
|
@@ -57,7 +65,7 @@ Defined in: [PlayRenderer.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/bl
|
|
|
57
65
|
connect(): void;
|
|
58
66
|
```
|
|
59
67
|
|
|
60
|
-
Defined in: [PlayRenderer.ts:
|
|
68
|
+
Defined in: [PlayRenderer.ts:83](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/PlayRenderer.ts#L83)
|
|
61
69
|
|
|
62
70
|
Start watching actor.currentView and render to container.
|
|
63
71
|
Renders the initial view synchronously, then subscribes to signal changes.
|
|
@@ -74,7 +82,7 @@ Renders the initial view synchronously, then subscribes to signal changes.
|
|
|
74
82
|
disconnect(): void;
|
|
75
83
|
```
|
|
76
84
|
|
|
77
|
-
Defined in: [PlayRenderer.ts:
|
|
85
|
+
Defined in: [PlayRenderer.ts:91](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/PlayRenderer.ts#L91)
|
|
78
86
|
|
|
79
87
|
Stop watching and clear the container.
|
|
80
88
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function connectRenderer(options): () => void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [connect-renderer.ts:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [connect-renderer.ts:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/connect-renderer.ts#L46)
|
|
10
10
|
|
|
11
11
|
Connect a signal-driven DOM renderer to an actor's currentView signal.
|
|
12
12
|
|
|
@@ -6,25 +6,10 @@
|
|
|
6
6
|
function defineRegistry<C>(_catalog, options): DefineRegistryResult;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/types.ts:
|
|
9
|
+
Defined in: [json-render/types.ts:213](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L213)
|
|
10
10
|
|
|
11
11
|
Build a `DomRegistry` from a catalog and component/action options.
|
|
12
12
|
|
|
13
|
-
Mirrors the `defineRegistry(catalog, options)` API from @json-render/react,
|
|
14
|
-
/solid, /svelte, /vue. The catalog parameter is used for TypeScript inference
|
|
15
|
-
only (the same as in the framework renderers — it is not used at runtime).
|
|
16
|
-
|
|
17
|
-
Each component in `options.components` is wrapped in a `DomComponentRenderer`
|
|
18
|
-
adapter that:
|
|
19
|
-
|
|
20
|
-
- Resolves props and two-way binding paths via `@json-render/core`
|
|
21
|
-
- Builds `emit(event)` and `on(event)` closures over the element's `on` map
|
|
22
|
-
- Renders child elements via `ctx.renderChildren`
|
|
23
|
-
- Passes the assembled `ComponentContext` to your `ComponentFn`
|
|
24
|
-
|
|
25
|
-
The `actions` map is passed through as `actorActions` so the caller does not
|
|
26
|
-
need to manage it separately.
|
|
27
|
-
|
|
28
13
|
## Type Parameters
|
|
29
14
|
|
|
30
15
|
| Type Parameter |
|
|
@@ -47,15 +32,17 @@ need to manage it separately.
|
|
|
47
32
|
```ts
|
|
48
33
|
import { defineRegistry } from "@xmachines/play-dom";
|
|
49
34
|
import { authCatalog } from "@xmachines/play-actor-shared";
|
|
50
|
-
import { Home, Login, Dashboard } from "./components/index.js";
|
|
51
35
|
|
|
52
|
-
const
|
|
36
|
+
const registryResult = defineRegistry(authCatalog, {
|
|
53
37
|
components: { Home, Login, Dashboard, ... },
|
|
54
38
|
actions: {
|
|
55
|
-
login:
|
|
56
|
-
logout:
|
|
39
|
+
login: async ({ username }) => actor.send({ type: 'auth.login', username }),
|
|
40
|
+
logout: async () => actor.send({ type: 'auth.logout' }),
|
|
41
|
+
route: async ({ to, params }) => actor.send({ type: 'play.route', to, params }),
|
|
57
42
|
},
|
|
58
43
|
});
|
|
59
44
|
|
|
60
|
-
|
|
45
|
+
const { registry, handlers } = registryResult;
|
|
46
|
+
const resolvedHandlers = handlers(() => undefined, () => ({}));
|
|
47
|
+
connectRenderer({ actor, registry, container, handlers: resolvedHandlers });
|
|
61
48
|
```
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
# Function: renderSpec()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function renderSpec(spec, store, registry, send,
|
|
6
|
+
function renderSpec(spec, store, registry, send, handlers): Node | null;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/renderer.ts:
|
|
9
|
+
Defined in: [json-render/renderer.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/renderer.ts#L53)
|
|
10
10
|
|
|
11
11
|
Render a Spec tree into DOM nodes using the provided `DomRegistry`.
|
|
12
12
|
|
|
@@ -19,13 +19,13 @@ built by `defineRegistry` — this function only orchestrates the traversal.
|
|
|
19
19
|
|
|
20
20
|
## Parameters
|
|
21
21
|
|
|
22
|
-
| Parameter
|
|
23
|
-
|
|
|
24
|
-
| `spec`
|
|
25
|
-
| `store`
|
|
26
|
-
| `registry`
|
|
27
|
-
| `send`
|
|
28
|
-
| `
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| ---------- | ----------------------------------------------- | ------------------------------------------------------------ |
|
|
24
|
+
| `spec` | `Spec` | The json-render `Spec` describing the UI tree. |
|
|
25
|
+
| `store` | `StateStore` | Live `StateStore` bound to `spec.state`. |
|
|
26
|
+
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Map of element type names → `DomComponentRenderer`. |
|
|
27
|
+
| `send` | (`event`) => `void` | Dispatcher for interaction events (e.g. actor.send). |
|
|
28
|
+
| `handlers` | `Record`\<`string`, `ActionHandler`\> | Map of catalog action names → async ActionHandler functions. |
|
|
29
29
|
|
|
30
30
|
## Returns
|
|
31
31
|
|
|
@@ -37,9 +37,11 @@ or has no registered renderer.
|
|
|
37
37
|
## Example
|
|
38
38
|
|
|
39
39
|
```ts
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
40
|
+
const { registry, handlers } = defineRegistry(catalog, { components, actions });
|
|
41
|
+
const resolvedHandlers = handlers(
|
|
42
|
+
() => undefined,
|
|
43
|
+
() => ({}),
|
|
44
|
+
);
|
|
45
|
+
const node = renderSpec(spec, store, registry, actor.send.bind(actor), resolvedHandlers);
|
|
44
46
|
if (node) container.appendChild(node);
|
|
45
47
|
```
|
|
@@ -2,46 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ComponentContext\<C, K\>
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
6
|
-
|
|
7
|
-
Catalog-typed context passed to each DOM component function.
|
|
8
|
-
|
|
9
|
-
Mirrors the `ComponentContext<C, K>` shape from @json-render/react, /solid,
|
|
10
|
-
/svelte, /vue with three DOM-specific adaptations:
|
|
11
|
-
|
|
12
|
-
- `children` is `Node[]` instead of a framework node/snippet/slot
|
|
13
|
-
- `bindings` is `Record<string, string> | undefined` (path strings for DOM
|
|
14
|
-
consumers that implement their own two-way binding, e.g. input value ↔ store)
|
|
15
|
-
- `ctx` (low-level `DomRenderContext`) is exposed for advanced use cases
|
|
16
|
-
(framework renderers do not expose this)
|
|
17
|
-
|
|
18
|
-
## Example
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
const Login: ComponentFn<AuthCatalog, "Login"> = ({ props, emit, on, bindings }) => {
|
|
22
|
-
const section = document.createElement("section");
|
|
23
|
-
|
|
24
|
-
const input = document.createElement("input");
|
|
25
|
-
input.value = props.username ?? "";
|
|
26
|
-
|
|
27
|
-
// Two-way binding: write back to state store when input changes
|
|
28
|
-
if (bindings?.username) {
|
|
29
|
-
input.addEventListener("input", () => {
|
|
30
|
-
// bindings.username contains the store path e.g. "/username"
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const btn = document.createElement("button");
|
|
35
|
-
const handle = on("submit");
|
|
36
|
-
btn.addEventListener("click", (e) => {
|
|
37
|
-
if (handle.shouldPreventDefault) e.preventDefault();
|
|
38
|
-
handle.emit();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
section.append(input, btn);
|
|
42
|
-
return section;
|
|
43
|
-
};
|
|
44
|
-
```
|
|
5
|
+
Defined in: [json-render/types.ts:78](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L78)
|
|
45
6
|
|
|
46
7
|
## Type Parameters
|
|
47
8
|
|
|
@@ -52,11 +13,11 @@ const Login: ComponentFn<AuthCatalog, "Login"> = ({ props, emit, on, bindings })
|
|
|
52
13
|
|
|
53
14
|
## Properties
|
|
54
15
|
|
|
55
|
-
| Property | Type | Description
|
|
56
|
-
| ----------------------------------------- | --------------------------------------------- |
|
|
57
|
-
| <a id="property-bindings"></a> `bindings` | `Record`\<`string`, `string`\> \| `undefined` | Two-way binding paths resolved from `$bindState` / `$bindItem` prop expressions.
|
|
58
|
-
| <a id="property-children"></a> `children` | `Node`[] | Rendered child nodes from the spec's `children` list.
|
|
59
|
-
| <a id="property-ctx"></a> `ctx` | [`DomRenderContext`](DomRenderContext.md) | Low-level render context.
|
|
60
|
-
| <a id="property-emit"></a> `emit` | (`event`) => `void` | Dispatch a named event defined in the spec's `on` map.
|
|
61
|
-
| <a id="property-on"></a> `on` | (`event`) => [`EventHandle`](EventHandle.md) | Get an `EventHandle` for a named event from the spec's `on` map.
|
|
62
|
-
| <a id="property-props"></a> `props` | `InferComponentProps`\<`C`, `K`\> | Catalog-typed, store-resolved props for this component.
|
|
16
|
+
| Property | Type | Description | Defined in |
|
|
17
|
+
| ----------------------------------------- | --------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| <a id="property-bindings"></a> `bindings` | `Record`\<`string`, `string`\> \| `undefined` | Two-way binding paths resolved from `$bindState` / `$bindItem` prop expressions. | [json-render/types.ts:88](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L88) |
|
|
19
|
+
| <a id="property-children"></a> `children` | `Node`[] | Rendered child nodes from the spec's `children` list. | [json-render/types.ts:84](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L84) |
|
|
20
|
+
| <a id="property-ctx"></a> `ctx` | [`DomRenderContext`](DomRenderContext.md) | Low-level render context. | [json-render/types.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L100) |
|
|
21
|
+
| <a id="property-emit"></a> `emit` | (`event`) => `void` | Dispatch a named event defined in the spec's `on` map. | [json-render/types.ts:92](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L92) |
|
|
22
|
+
| <a id="property-on"></a> `on` | (`event`) => [`EventHandle`](EventHandle.md) | Get an `EventHandle` for a named event from the spec's `on` map. | [json-render/types.ts:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L96) |
|
|
23
|
+
| <a id="property-props"></a> `props` | `InferComponentProps`\<`C`, `K`\> | Catalog-typed, store-resolved props for this component. | [json-render/types.ts:80](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L80) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ConnectRendererOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [xm-types.ts:
|
|
5
|
+
Defined in: [xm-types.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L38)
|
|
6
6
|
|
|
7
7
|
Options for connectRenderer() — backward compat API.
|
|
8
8
|
|
|
@@ -10,9 +10,9 @@ Options for connectRenderer() — backward compat API.
|
|
|
10
10
|
|
|
11
11
|
| Property | Type | Description | Defined in |
|
|
12
12
|
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
-
| <a id="property-
|
|
14
|
-
| <a id="property-
|
|
15
|
-
| <a id="property-
|
|
16
|
-
| <a id="property-
|
|
17
|
-
| <a id="property-registry"></a> `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Registry of component renderers — replaces old `components` map | [xm-types.ts:
|
|
18
|
-
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (e.g. from `xstateStoreStateStore` in @json-render/xstate). When provided, PlayRenderer operates in controlled mode — spec.state is ignored. When omitted, a fresh @xstate/store atom is created internally per view transition. | [xm-types.ts:
|
|
13
|
+
| <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) | [xm-types.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L40) |
|
|
14
|
+
| <a id="property-container"></a> `container` | `HTMLElement` | Container element to render into | [xm-types.ts:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L46) |
|
|
15
|
+
| <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| `null` | Optional element shown when currentView is null (defaults to nothing — clears container) | [xm-types.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L49) |
|
|
16
|
+
| <a id="property-handlers"></a> `handlers?` | `Record`\<`string`, `ActionHandler`\> | Map of catalog action name → async ActionHandler function. Replaces the old `actions: Record<string, string>` string-map approach. | [xm-types.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L55) |
|
|
17
|
+
| <a id="property-registry"></a> `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Registry of component renderers — replaces old `components` map | [xm-types.ts:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L43) |
|
|
18
|
+
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (e.g. from `xstateStoreStateStore` in @json-render/xstate). When provided, PlayRenderer operates in controlled mode — spec.state is ignored. When omitted, a fresh @xstate/store atom is created internally per view transition. | [xm-types.ts:62](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L62) |
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: DefineRegistryOptions\<C\>
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
5
|
+
Defined in: [json-render/types.ts:144](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L144)
|
|
6
6
|
|
|
7
7
|
Options for `defineRegistry`.
|
|
8
8
|
|
|
9
|
-
Mirrors `DefineRegistryOptions<C>` from @json-render/react, /solid, /svelte, /vue
|
|
10
|
-
|
|
11
|
-
map rather than async handler functions, because the DOM renderer dispatches events
|
|
12
|
-
directly via `send()` to an XState actor instead of calling framework action handlers.
|
|
9
|
+
Mirrors `DefineRegistryOptions<C>` from @json-render/react, /solid, /svelte, /vue.
|
|
10
|
+
`actions` accepts catalog-typed async handler functions — params are fully typed.
|
|
13
11
|
|
|
14
12
|
## Type Parameters
|
|
15
13
|
|
|
@@ -19,7 +17,7 @@ directly via `send()` to an XState actor instead of calling framework action han
|
|
|
19
17
|
|
|
20
18
|
## Properties
|
|
21
19
|
|
|
22
|
-
| Property | Type
|
|
23
|
-
| ---------------------------------------------- |
|
|
24
|
-
| <a id="property-actions"></a> `actions?` | `
|
|
25
|
-
| <a id="property-components"></a> `components?` | [`ComponentRegistry`](../type-aliases/ComponentRegistry.md)\<`C`\>
|
|
20
|
+
| Property | Type | Description | Defined in |
|
|
21
|
+
| ---------------------------------------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
+
| <a id="property-actions"></a> `actions?` | [`Actions`](../type-aliases/Actions.md)\<`C`\> | Map of catalog action name → catalog-typed async handler function. Each handler receives params typed to the action's schema (or `undefined`). Guard against undefined before accessing params: **Example** `actions: { login: async (params) => { if (!params) return; actor.send({ type: 'auth.login', username: params.username }); }, }` | [json-render/types.ts:165](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L165) |
|
|
23
|
+
| <a id="property-components"></a> `components?` | [`ComponentRegistry`](../type-aliases/ComponentRegistry.md)\<`C`\> | Catalog-typed component implementations. | [json-render/types.ts:148](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L148) |
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: DefineRegistryResult
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
5
|
+
Defined in: [json-render/types.ts:174](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L174)
|
|
6
6
|
|
|
7
7
|
Result returned by `defineRegistry`.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
callers can pass it directly to `connectRenderer` or `PlayRenderer`.
|
|
9
|
+
Matches `DefineRegistryResult` from @json-render/react, /solid, /svelte, /vue —
|
|
10
|
+
returns `{ registry, handlers }` instead of the old `{ registry, actorActions }`.
|
|
12
11
|
|
|
13
12
|
## Properties
|
|
14
13
|
|
|
15
|
-
| Property
|
|
16
|
-
|
|
|
17
|
-
| <a id="property-
|
|
18
|
-
| <a id="property-registry"></a> `registry`
|
|
14
|
+
| Property | Type | Description | Defined in |
|
|
15
|
+
| ----------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| <a id="property-handlers"></a> `handlers` | (`getSetState`, `getState`) => `Record`\<`string`, `ActionHandler`\> | Create ActionProvider-compatible handlers. Accepts getter functions so handlers always read the latest state. For DOM rendering, pass `() => undefined, () => ({})` since DOM actions dispatch directly to actor without needing setState. | [json-render/types.ts:185](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L185) |
|
|
17
|
+
| <a id="property-registry"></a> `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | The built `DomRegistry`, ready to pass to `connectRenderer` or `PlayRenderer`. | [json-render/types.ts:178](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L178) |
|
|
@@ -2,20 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: DomRenderContext
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
5
|
+
Defined in: [json-render/types.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L52)
|
|
6
6
|
|
|
7
7
|
Low-level render context passed to each `DomComponentRenderer`.
|
|
8
8
|
|
|
9
|
-
This is the raw renderer-level interface. Most component authors should use
|
|
10
|
-
the higher-level `ComponentContext<C, K>` provided by `defineRegistry`.
|
|
11
|
-
|
|
12
9
|
## Properties
|
|
13
10
|
|
|
14
|
-
| Property | Type
|
|
15
|
-
| -------------------------------------------------------- |
|
|
16
|
-
| <a id="property-
|
|
17
|
-
| <a id="property-
|
|
18
|
-
| <a id="property-renderchildren"></a> `renderChildren` | (`keys`) => `Node`[]
|
|
19
|
-
| <a id="property-send"></a> `send` | (`event`) => `void`
|
|
20
|
-
| <a id="property-spec"></a> `spec` | `Spec`
|
|
21
|
-
| <a id="property-store"></a> `store` | `StateStore`
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| -------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| <a id="property-elementbindings"></a> `elementBindings?` | `Record`\<`string`, `string`\> | Pre-computed two-way binding paths for this element's props. | [json-render/types.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L66) |
|
|
14
|
+
| <a id="property-handlers"></a> `handlers` | `Record`\<`string`, `ActionHandler`\> | Map of json-render catalog action names → async ActionHandler functions. | [json-render/types.ts:60](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L60) |
|
|
15
|
+
| <a id="property-renderchildren"></a> `renderChildren` | (`keys`) => `Node`[] | Render a list of child element keys into DOM nodes. | [json-render/types.ts:62](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L62) |
|
|
16
|
+
| <a id="property-send"></a> `send` | (`event`) => `void` | Dispatch an event (e.g. to an XState actor). | [json-render/types.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L58) |
|
|
17
|
+
| <a id="property-spec"></a> `spec` | `Spec` | Full spec tree for this render pass. | [json-render/types.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L54) |
|
|
18
|
+
| <a id="property-store"></a> `store` | `StateStore` | Live state store bound to `spec.state`. | [json-render/types.ts:56](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L56) |
|
|
@@ -2,28 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: EventHandle
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
5
|
+
Defined in: [json-render/types.ts:36](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L36)
|
|
6
6
|
|
|
7
7
|
Handle returned by `ComponentContext.on(eventName)`.
|
|
8
8
|
|
|
9
|
-
Matches the `EventHandle` interface from @json-render/react, /solid, /svelte, /vue.
|
|
10
|
-
|
|
11
|
-
## Example
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
const handle = on("submit");
|
|
15
|
-
if (handle.bound) {
|
|
16
|
-
btn.addEventListener("click", (e) => {
|
|
17
|
-
if (handle.shouldPreventDefault) e.preventDefault();
|
|
18
|
-
handle.emit();
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
9
|
## Properties
|
|
24
10
|
|
|
25
|
-
| Property | Type | Description
|
|
26
|
-
| ----------------------------------------------------------------- | ------------ |
|
|
27
|
-
| <a id="property-bound"></a> `bound` | `boolean` | `true` if an `on` binding exists for this event name; `false` otherwise.
|
|
28
|
-
| <a id="property-emit"></a> `emit` | () => `void` | Fire the bound action, resolving params from the current state store.
|
|
29
|
-
| <a id="property-shouldpreventdefault"></a> `shouldPreventDefault` | `boolean` | Whether any binding for this event has `preventDefault: true`.
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| ----------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| <a id="property-bound"></a> `bound` | `boolean` | `true` if an `on` binding exists for this event name; `false` otherwise. | [json-render/types.ts:44](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L44) |
|
|
14
|
+
| <a id="property-emit"></a> `emit` | () => `void` | Fire the bound action, resolving params from the current state store. | [json-render/types.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L38) |
|
|
15
|
+
| <a id="property-shouldpreventdefault"></a> `shouldPreventDefault` | `boolean` | Whether any binding for this event has `preventDefault: true`. | [json-render/types.ts:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L42) |
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayDomOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [xm-types.ts:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [xm-types.ts:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L18)
|
|
6
6
|
|
|
7
7
|
Options for PlayRenderer.
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property
|
|
12
|
-
|
|
|
13
|
-
| <a id="property-
|
|
14
|
-
| <a id="property-store"></a> `store?`
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| ------------------------------------------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| <a id="property-handlers"></a> `handlers?` | `Record`\<`string`, `ActionHandler`\> | Map of catalog action name → async ActionHandler function. Replaces the old `actions: Record<string, string>` string-map approach. | [xm-types.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L23) |
|
|
14
|
+
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (e.g. from `xstateStoreStateStore` in @json-render/xstate). When provided, PlayRenderer operates in controlled mode — spec.state is ignored and this store is the single source of truth for UI state (form values, etc.). When omitted, a fresh @xstate/store atom is created internally per view transition, seeded from spec.state. | [xm-types.ts:32](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/xm-types.ts#L32) |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-dom](../README.md) / ActionFn
|
|
2
|
+
|
|
3
|
+
# Type Alias: ActionFn\<C, K\>
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type ActionFn<C, K> = (params) => Promise<void>;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [json-render/types.ts:126](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L126)
|
|
10
|
+
|
|
11
|
+
Catalog-typed action function — mirrors `ActionFn<C, K>` from @json-render/react, /solid, /vue.
|
|
12
|
+
`params` is typed to the exact param schema defined in the catalog, or `undefined` if no spec
|
|
13
|
+
provided params. The handler must guard against undefined before accessing params.
|
|
14
|
+
|
|
15
|
+
## Type Parameters
|
|
16
|
+
|
|
17
|
+
| Type Parameter |
|
|
18
|
+
| ------------------------------------------------ |
|
|
19
|
+
| `C` _extends_ `Catalog` |
|
|
20
|
+
| `K` _extends_ keyof `InferCatalogActions`\<`C`\> |
|
|
21
|
+
|
|
22
|
+
## Parameters
|
|
23
|
+
|
|
24
|
+
| Parameter | Type |
|
|
25
|
+
| --------- | ---------------------------------------------- |
|
|
26
|
+
| `params` | `InferActionParams`\<`C`, `K`\> \| `undefined` |
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-dom](../README.md) / Actions
|
|
2
|
+
|
|
3
|
+
# Type Alias: Actions\<C\>
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type Actions<C> = { [K in keyof InferCatalogActions<C>]: ActionFn<C, K> };
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [json-render/types.ts:134](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L134)
|
|
10
|
+
|
|
11
|
+
Map of catalog-typed action handler functions.
|
|
12
|
+
Each key is a catalog action name; each value is an `ActionFn<C, K>` for that action.
|
|
13
|
+
|
|
14
|
+
## Type Parameters
|
|
15
|
+
|
|
16
|
+
| Type Parameter |
|
|
17
|
+
| ----------------------- |
|
|
18
|
+
| `C` _extends_ `Catalog` |
|
|
@@ -6,15 +6,7 @@
|
|
|
6
6
|
type ComponentFn<C, K> = (ctx) => HTMLElement | Text | null;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/types.ts:
|
|
10
|
-
|
|
11
|
-
Catalog-typed DOM component function.
|
|
12
|
-
|
|
13
|
-
The DOM equivalent of `ComponentFn<C, K>` from @json-render/react, /solid,
|
|
14
|
-
/svelte, /vue. The only structural difference is the return type:
|
|
15
|
-
`HTMLElement | Text | null` instead of a framework node.
|
|
16
|
-
|
|
17
|
-
Pass implementations to `defineRegistry` — do not call directly.
|
|
9
|
+
Defined in: [json-render/types.ts:105](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.32/packages/play-dom/src/json-render/types.ts#L105)
|
|
18
10
|
|
|
19
11
|
## Type Parameters
|
|
20
12
|
|
|
@@ -32,22 +24,3 @@ Pass implementations to `defineRegistry` — do not call directly.
|
|
|
32
24
|
## Returns
|
|
33
25
|
|
|
34
26
|
`HTMLElement` \| `Text` \| `null`
|
|
35
|
-
|
|
36
|
-
## Example
|
|
37
|
-
|
|
38
|
-
```ts
|
|
39
|
-
import type { ComponentFn } from "@xmachines/play-dom";
|
|
40
|
-
import type { AuthCatalog } from "@xmachines/play-actor-shared";
|
|
41
|
-
|
|
42
|
-
export const Home: ComponentFn<AuthCatalog, "Home"> = ({ props, children }) => {
|
|
43
|
-
const section = document.createElement("section");
|
|
44
|
-
section.setAttribute("data-page", "home");
|
|
45
|
-
|
|
46
|
-
const h2 = document.createElement("h2");
|
|
47
|
-
h2.textContent = props.title;
|
|
48
|
-
section.appendChild(h2);
|
|
49
|
-
|
|
50
|
-
children.forEach((child) => section.appendChild(child));
|
|
51
|
-
return section;
|
|
52
|
-
};
|
|
53
|
-
```
|