@xmachines/docs 1.0.0-beta.31 → 1.0.0-beta.33
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 +228 -39
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +39 -26
- package/api/@xmachines/play-dom/functions/connectRenderer.md +39 -20
- package/api/@xmachines/play-dom/functions/createRenderer.md +43 -0
- package/api/@xmachines/play-dom/functions/defineRegistry.md +5 -5
- package/api/@xmachines/play-dom/functions/renderSpec.md +43 -9
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +11 -9
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +7 -7
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +14 -9
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +7 -5
- package/api/@xmachines/play-dom/type-aliases/ActionFn.md +23 -7
- package/api/@xmachines/play-dom/type-aliases/Actions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +114 -0
- package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +25 -0
- package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +39 -0
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomSchema.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/SetState.md +30 -0
- package/api/@xmachines/play-dom/variables/schema.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +166 -59
- 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 +1 -0
- 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 +9 -8
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/type-aliases/RenderErrorHandler.md +22 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- 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 +1 -0
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +9 -8
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/type-aliases/RenderErrorHandler.md +22 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- 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 +52 -12
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +12 -35
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +24 -0
- package/api/@xmachines/play-svelte/interfaces/PlayRendererProps.md +9 -8
- 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/RenderErrorHandler.md +23 -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 +1 -0
- 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/interfaces/PlayRendererProps.md +7 -6
- 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/type-aliases/RenderErrorHandler.md +22 -0
- 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/classes/PlayerActor.md +12 -12
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/README.md +47 -47
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/api/_media/README.md +321 -0
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-react-router-demo/README.md +1 -3
- package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-solid-router-demo/README.md +1 -3
- package/examples/README.md +2 -2
- package/examples/form-validation.md +80 -0
- package/examples/routing-patterns.md +9 -19
- package/guides/getting-started.md +51 -38
- package/guides/installation.md +6 -6
- package/package.json +6 -6
- package/rfc/play.md +19 -19
- package/api/@xmachines/play-dom/interfaces/DefineRegistryOptions.md +0 -23
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
# Function: renderSpec()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function renderSpec(
|
|
6
|
+
function renderSpec(
|
|
7
|
+
spec,
|
|
8
|
+
store,
|
|
9
|
+
registry,
|
|
10
|
+
send,
|
|
11
|
+
handlers,
|
|
12
|
+
fallback?,
|
|
13
|
+
onRenderError?,
|
|
14
|
+
functions?,
|
|
15
|
+
loading?,
|
|
16
|
+
onWatchSetup?,
|
|
17
|
+
): Node | null;
|
|
7
18
|
```
|
|
8
19
|
|
|
9
|
-
Defined in: [json-render/renderer.ts:
|
|
20
|
+
Defined in: [json-render/renderer.ts:116](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/renderer.ts#L116)
|
|
10
21
|
|
|
11
22
|
Render a Spec tree into DOM nodes using the provided `DomRegistry`.
|
|
12
23
|
|
|
@@ -19,13 +30,18 @@ built by `defineRegistry` — this function only orchestrates the traversal.
|
|
|
19
30
|
|
|
20
31
|
## Parameters
|
|
21
32
|
|
|
22
|
-
| Parameter
|
|
23
|
-
|
|
|
24
|
-
| `spec`
|
|
25
|
-
| `store`
|
|
26
|
-
| `registry`
|
|
27
|
-
| `send`
|
|
28
|
-
| `handlers`
|
|
33
|
+
| Parameter | Type | Description |
|
|
34
|
+
| ---------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| `spec` | `Spec` | The json-render `Spec` describing the UI tree. |
|
|
36
|
+
| `store` | `StateStore` | Live `StateStore` bound to `spec.state`. |
|
|
37
|
+
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Map of element type names → `DomComponentRenderer`. |
|
|
38
|
+
| `send` | (`event`) => `void` | Dispatcher for interaction events (e.g. actor.send). |
|
|
39
|
+
| `handlers` | `Record`\<`string`, `ActionHandler`\> | Map of catalog action names → async ActionHandler functions. |
|
|
40
|
+
| `fallback?` | [`DomComponentRenderer`](../type-aliases/DomComponentRenderer.md) | Optional renderer called when `registry` has no entry for an element's `type` (GAP-04). If absent, unknown types return `null`. |
|
|
41
|
+
| `onRenderError?` | (`type`, `err`) => `void` | Optional callback invoked with `(type, error)` when a component renderer throws (GAP-08). If absent, errors are logged via `console.error` with the prefix `[json-render] Rendering error in`. |
|
|
42
|
+
| `functions?` | `Record`\<`string`, `ComputedFunction`\> | Optional map of named compute functions forwarded to `PropResolutionContext` (GAP-03). Enables `{ $computed: "fn", args }` prop expressions to resolve. When absent, `$computed` expressions return `undefined` (backward-compatible, no throw). |
|
|
43
|
+
| `loading?` | `boolean` | Optional flag indicating the spec is still streaming (GAP-06). When `true`, components can read `ctx.loading` to render skeleton states, and missing-child warnings (GAP-07) are suppressed since referenced elements may not yet have arrived in the incremental spec. |
|
|
44
|
+
| `onWatchSetup?` | (`cleanup`) => `void` | Optional callback invoked with each watch subscription cleanup function (GAP-02). When an element declares `watch`, the renderer sets up a store subscription and passes its unsubscribe function to this callback. Callers (e.g. PlayRenderer) collect these to call on disconnect(). |
|
|
29
45
|
|
|
30
46
|
## Returns
|
|
31
47
|
|
|
@@ -34,6 +50,24 @@ built by `defineRegistry` — this function only orchestrates the traversal.
|
|
|
34
50
|
The root DOM `Node`, or `null` if the root is invisible
|
|
35
51
|
or has no registered renderer.
|
|
36
52
|
|
|
53
|
+
## Remarks
|
|
54
|
+
|
|
55
|
+
**Devtools isolation in tests:** The module-level `_devtoolsActive` flag is a
|
|
56
|
+
singleton that persists for the lifetime of the module. In test environments,
|
|
57
|
+
any call to `markDevtoolsActive()` MUST be paired with a `release()` call
|
|
58
|
+
inside a `try/finally` block. Failing to do so leaves `_devtoolsActive = true`
|
|
59
|
+
for all subsequent tests, causing false positives in devtools-conditional
|
|
60
|
+
rendering paths (e.g. `data-jr-key` wrapper spans).
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
const release = markDevtoolsActive();
|
|
64
|
+
try {
|
|
65
|
+
// test code
|
|
66
|
+
} finally {
|
|
67
|
+
release();
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
37
71
|
## Example
|
|
38
72
|
|
|
39
73
|
```ts
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ComponentContext\<C, K\>
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
5
|
+
Defined in: [json-render/types.ts:141](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L141)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -15,9 +15,9 @@ Defined in: [json-render/types.ts:78](https://gitlab.com/xmachin-es/xmachines-js
|
|
|
15
15
|
|
|
16
16
|
| Property | Type | Description | Defined in |
|
|
17
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:
|
|
19
|
-
| <a id="property-children"></a> `children` | `Node`[] | Rendered child nodes from the spec's `children` list. | [json-render/types.ts:
|
|
20
|
-
| <a id="property-ctx"></a> `ctx` | [`DomRenderContext`](DomRenderContext.md) | Low-level render context. | [json-render/types.ts:
|
|
21
|
-
| <a id="property-emit"></a> `emit` | (`event`) => `void` | Dispatch a named event defined in the spec's `on` map. | [json-render/types.ts:
|
|
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:
|
|
23
|
-
| <a id="property-props"></a> `props` | `InferComponentProps`\<`C`, `K`\> | Catalog-typed, store-resolved props for this component. | [json-render/types.ts:
|
|
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:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L151) |
|
|
19
|
+
| <a id="property-children"></a> `children` | `Node`[] | Rendered child nodes from the spec's `children` list. | [json-render/types.ts:147](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L147) |
|
|
20
|
+
| <a id="property-ctx"></a> `ctx` | [`DomRenderContext`](DomRenderContext.md) | Low-level render context. | [json-render/types.ts:163](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L163) |
|
|
21
|
+
| <a id="property-emit"></a> `emit` | (`event`) => `void` | Dispatch a named event defined in the spec's `on` map. | [json-render/types.ts:155](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L155) |
|
|
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:159](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L159) |
|
|
23
|
+
| <a id="property-props"></a> `props` | `InferComponentProps`\<`C`, `K`\> | Catalog-typed, store-resolved props for this component. | [json-render/types.ts:143](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L143) |
|
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ConnectRendererOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [xm-types.ts:
|
|
5
|
+
Defined in: [xm-types.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L59)
|
|
6
6
|
|
|
7
7
|
Options for connectRenderer() — backward compat API.
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property
|
|
12
|
-
|
|
|
13
|
-
| <a id="property-actor"></a> `actor`
|
|
14
|
-
| <a id="property-container"></a> `container`
|
|
15
|
-
| <a id="property-fallback"></a> `fallback?`
|
|
16
|
-
| <a id="property-handlers"></a> `handlers?`
|
|
17
|
-
| <a id="property-
|
|
18
|
-
| <a id="property-
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
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:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L61) |
|
|
14
|
+
| <a id="property-container"></a> `container` | `HTMLElement` | Container element to render into | [xm-types.ts:85](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L85) |
|
|
15
|
+
| <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| `null` | Optional element shown when `currentView` is `null` on **initial mount** only. The fallback is appended immediately after `renderer.connect()` if the container is empty at that moment (i.e. the actor's initial view is `null`). **Limitation:** If the actor's view transitions to `null` after mount, the container will be cleared but this fallback will NOT be re-appended. For dynamic fallback behavior (null view after non-null), use `PlayRenderer` directly and wrap the `actor.currentView` signal to inject fallback content. | [xm-types.ts:98](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L98) |
|
|
16
|
+
| <a id="property-handlers"></a> `handlers?` | `Record`\<`string`, `ActionHandler`\> | Pre-resolved handler map — for backward compatibility. Ignored when `registryResult` is provided. | [xm-types.ts:110](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L110) |
|
|
17
|
+
| <a id="property-loading"></a> `loading?` | `boolean` | When true, indicates the spec is still streaming (e.g. from an AI provider). Forwarded to PlayRenderer which threads it into renderSpec so components can read ctx.ctx.loading to show skeleton states. Also suppresses missing-child warnings. Mirrors the `loading` prop from framework renderer providers. | [xm-types.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L125) |
|
|
18
|
+
| <a id="property-registry"></a> `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Registry of component renderers — replaces old `components` map. When also providing `registryResult`, this **must** be the `.registry` field from the **same** `defineRegistry()` call to keep component renderers and action handlers aligned. Mixing a `registry` from one catalog with a `registryResult` from another will cause component wrappers and action handlers to be mismatched, producing silent runtime failures. **Example** `const registryResult = defineRegistry(catalog, { components, actions }); connectRenderer({ registry: registryResult.registry, // ← from the same call registryResult, // ... });` | [xm-types.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L82) |
|
|
19
|
+
| <a id="property-registryresult"></a> `registryResult?` | [`DefineRegistryResult`](DefineRegistryResult.md) | The result from `defineRegistry` — wires setState/getState from the xstate store into action handlers automatically. Preferred over `handlers` for new code. | [xm-types.ts:104](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L104) |
|
|
20
|
+
| <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:117](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L117) |
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: DefineRegistryResult
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
5
|
+
Defined in: [json-render/types.ts:291](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L291)
|
|
6
6
|
|
|
7
7
|
Result returned by `defineRegistry`.
|
|
8
8
|
|
|
9
|
-
Matches `DefineRegistryResult` from @json-render/react, /solid, /svelte, /vue
|
|
10
|
-
returns `{ registry, handlers }` instead of the old `{ registry, actorActions }`.
|
|
9
|
+
Matches `DefineRegistryResult` from @json-render/react, /solid, /svelte, /vue.
|
|
11
10
|
|
|
12
11
|
## Properties
|
|
13
12
|
|
|
14
|
-
| Property
|
|
15
|
-
|
|
|
16
|
-
| <a id="property-
|
|
17
|
-
| <a id="property-
|
|
13
|
+
| Property | Type | Description | Defined in |
|
|
14
|
+
| --------------------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| <a id="property-executeaction"></a> `executeAction` | (`actionName`, `params`, `setState`, `state?`) => `Promise`\<`void`\> | Execute a named action by name, with optional params. Mirrors `executeAction` on `DefineRegistryResult` from @json-render/react, /solid, /vue, /svelte. Useful for programmatically triggering actions outside of the emit/on flow. | [json-render/types.ts:321](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L321) |
|
|
16
|
+
| <a id="property-handlers"></a> `handlers` | (`getSetState`, `getState`) => `Record`\<`string`, `ActionHandler`\> | Create ActionProvider-compatible handlers. Accepts getter functions (called lazily at action-invocation time) so handlers always see the latest setState and state snapshot — matching the pattern from the framework renderers. In `PlayRenderer`, these are wired automatically from the xstate store. Pass `() => undefined, () => ({})` only in tests or when state management is not needed. | [json-render/types.ts:306](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L306) |
|
|
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:295](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L295) |
|
|
@@ -2,17 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: DomRenderContext
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
5
|
+
Defined in: [json-render/types.ts:85](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L85)
|
|
6
6
|
|
|
7
7
|
Low-level render context passed to each `DomComponentRenderer`.
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property | Type
|
|
12
|
-
| -------------------------------------------------------- |
|
|
13
|
-
| <a id="property-elementbindings"></a> `elementBindings?` | `Record`\<`string`, `string`\>
|
|
14
|
-
| <a id="property-
|
|
15
|
-
| <a id="property-
|
|
16
|
-
| <a id="property-
|
|
17
|
-
| <a id="property-
|
|
18
|
-
| <a id="property-
|
|
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:99](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L99) |
|
|
14
|
+
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Optional map of named compute functions, forwarded to PropResolutionContext. Enables { $computed: "funcName", args: {...} } prop expressions to resolve. Mirrors the `functions` prop from framework renderer providers. | [json-render/types.ts:106](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L106) |
|
|
15
|
+
| <a id="property-handlers"></a> `handlers` | `Record`\<`string`, `ActionHandler`\> | Map of json-render catalog action names → async ActionHandler functions. | [json-render/types.ts:93](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L93) |
|
|
16
|
+
| <a id="property-loading"></a> `loading?` | `boolean` | When true, indicates the spec is still streaming (e.g. from an AI provider). Component implementations can use this to show skeleton/loading states. When loading=true, missing-child warnings are suppressed. Mirrors the `loading` prop from framework renderer providers. | [json-render/types.ts:114](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L114) |
|
|
17
|
+
| <a id="property-renderchildren"></a> `renderChildren` | (`keys`) => `Node`[] | Render a list of child element keys into DOM nodes. | [json-render/types.ts:95](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L95) |
|
|
18
|
+
| <a id="property-repeatbasepath"></a> `repeatBasePath?` | `string` | Absolute JSON Pointer path to the current repeat item (e.g. "/todos/0"). Mirrors `repeatBasePath` in `PropResolutionContext`. | [json-render/types.ts:129](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L129) |
|
|
19
|
+
| <a id="property-repeatindex"></a> `repeatIndex?` | `number` | Current repeat array index when inside a repeat scope. Mirrors `repeatIndex` in `PropResolutionContext`. | [json-render/types.ts:124](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L124) |
|
|
20
|
+
| <a id="property-repeatitem"></a> `repeatItem?` | `unknown` | Current repeat item when inside a repeat scope. Mirrors `repeatItem` in `@json-render/core`'s `PropResolutionContext`. | [json-render/types.ts:119](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L119) |
|
|
21
|
+
| <a id="property-send"></a> `send` | (`event`) => `void` | Dispatch an event (e.g. to an XState actor). | [json-render/types.ts:91](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L91) |
|
|
22
|
+
| <a id="property-spec"></a> `spec` | `Spec` | Full spec tree for this render pass. | [json-render/types.ts:87](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L87) |
|
|
23
|
+
| <a id="property-store"></a> `store` | `StateStore` | Live state store bound to `spec.state`. | [json-render/types.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L89) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: EventHandle
|
|
4
4
|
|
|
5
|
-
Defined in: [json-render/types.ts:
|
|
5
|
+
Defined in: [json-render/types.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L69)
|
|
6
6
|
|
|
7
7
|
Handle returned by `ComponentContext.on(eventName)`.
|
|
8
8
|
|
|
@@ -10,6 +10,6 @@ Handle returned by `ComponentContext.on(eventName)`.
|
|
|
10
10
|
|
|
11
11
|
| Property | Type | Description | Defined in |
|
|
12
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:
|
|
14
|
-
| <a id="property-emit"></a> `emit` | () => `void` | Fire the bound action, resolving params from the current state store. | [json-render/types.ts:
|
|
15
|
-
| <a id="property-shouldpreventdefault"></a> `shouldPreventDefault` | `boolean` | Whether any binding for this event has `preventDefault: true`. | [json-render/types.ts:
|
|
13
|
+
| <a id="property-bound"></a> `bound` | `boolean` | `true` if an `on` binding exists for this event name; `false` otherwise. | [json-render/types.ts:77](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L77) |
|
|
14
|
+
| <a id="property-emit"></a> `emit` | () => `void` | Fire the bound action, resolving params from the current state store. | [json-render/types.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L71) |
|
|
15
|
+
| <a id="property-shouldpreventdefault"></a> `shouldPreventDefault` | `boolean` | Whether any binding for this event has `preventDefault: true`. | [json-render/types.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L75) |
|
|
@@ -2,13 +2,15 @@
|
|
|
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.33/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-handlers"></a> `handlers?`
|
|
14
|
-
| <a id="property-
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| ------------------------------------------------------ | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| <a id="property-handlers"></a> `handlers?` | `Record`\<`string`, `ActionHandler`\> | Pre-resolved handler map — for backward compatibility or advanced use cases. When `registryResult` is provided, this is ignored. If you need actions to receive `setState` and `state`, use `registryResult` instead. | [xm-types.ts:36](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L36) |
|
|
14
|
+
| <a id="property-loading"></a> `loading?` | `boolean` | When true, indicates the spec is still streaming (e.g. from an AI provider). Forwarded to renderSpec so ComponentFn implementations can read ctx.ctx.loading to show skeleton states. Also suppresses missing-child warnings during stream ingestion. Mirrors the `loading` prop from framework renderer providers. | [xm-types.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L53) |
|
|
15
|
+
| <a id="property-registryresult"></a> `registryResult?` | [`DefineRegistryResult`](DefineRegistryResult.md) | The result from `defineRegistry` — provides both the registry and the handlers factory. When provided, `PlayRenderer` wires `setState` and `getState` from the @xstate/store-backed `StateStore` into the handlers factory automatically. This is the preferred approach as it ensures actions always receive live `setState` and `state` bound to the current store. Mutually exclusive with `handlers`. | [xm-types.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L28) |
|
|
16
|
+
| <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:45](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/xm-types.ts#L45) |
|
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
# Type Alias: ActionFn\<C, K\>
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
type ActionFn<C, K> = (params) => Promise<void>;
|
|
6
|
+
type ActionFn<C, K> = (params, setState, state) => Promise<void>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/types.ts:
|
|
9
|
+
Defined in: [json-render/types.ts:232](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L232)
|
|
10
10
|
|
|
11
11
|
Catalog-typed action function — mirrors `ActionFn<C, K>` from @json-render/react, /solid, /vue.
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
|
|
13
|
+
- `params` is typed to the exact param schema defined in the catalog, or `undefined` if the
|
|
14
|
+
spec provided no params. Guard against undefined before accessing params.
|
|
15
|
+
- `setState` writes to the @xstate/store-backed local state store. Use it to update ephemeral
|
|
16
|
+
UI state (e.g. form field values, error messages) from within an action handler.
|
|
17
|
+
- `state` is a snapshot of the current state model at the time the action was invoked.
|
|
14
18
|
|
|
15
19
|
## Type Parameters
|
|
16
20
|
|
|
@@ -21,10 +25,22 @@ provided params. The handler must guard against undefined before accessing param
|
|
|
21
25
|
|
|
22
26
|
## Parameters
|
|
23
27
|
|
|
24
|
-
| Parameter
|
|
25
|
-
|
|
|
26
|
-
| `params`
|
|
28
|
+
| Parameter | Type |
|
|
29
|
+
| ---------- | ---------------------------------------------- |
|
|
30
|
+
| `params` | `InferActionParams`\<`C`, `K`\> \| `undefined` |
|
|
31
|
+
| `setState` | [`SetState`](SetState.md) |
|
|
32
|
+
| `state` | `StateModel` |
|
|
27
33
|
|
|
28
34
|
## Returns
|
|
29
35
|
|
|
30
36
|
`Promise`\<`void`\>
|
|
37
|
+
|
|
38
|
+
## Example
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
login: async (params, setState, state) => {
|
|
42
|
+
if (!params) return;
|
|
43
|
+
setState((prev) => ({ ...prev, loading: true }));
|
|
44
|
+
await actor.send({ type: "auth.login", username: params.username });
|
|
45
|
+
};
|
|
46
|
+
```
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type Actions<C> = { [K in keyof InferCatalogActions<C>]: ActionFn<C, K> };
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/types.ts:
|
|
9
|
+
Defined in: [json-render/types.ts:242](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L242)
|
|
10
10
|
|
|
11
11
|
Map of catalog-typed action handler functions.
|
|
12
12
|
Each key is a catalog action name; each value is an `ActionFn<C, K>` for that action.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-dom](../README.md) / BaseComponentProps
|
|
2
|
+
|
|
3
|
+
# Type Alias: BaseComponentProps\<P\>
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type BaseComponentProps<P> = object;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [json-render/types.ts:187](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L187)
|
|
10
|
+
|
|
11
|
+
Catalog-agnostic component props type.
|
|
12
|
+
|
|
13
|
+
Use this when building shared component libraries that should not be tied to
|
|
14
|
+
a specific catalog instance. Mirrors `BaseComponentProps<P>` from
|
|
15
|
+
@json-render/react, /vue, /svelte.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import type { BaseComponentProps } from "@xmachines/play-dom";
|
|
21
|
+
|
|
22
|
+
function MyButton({ props, emit }: BaseComponentProps<{ label: string }>) {
|
|
23
|
+
const el = document.createElement("button");
|
|
24
|
+
el.textContent = props.label;
|
|
25
|
+
el.addEventListener("click", () => emit("click"));
|
|
26
|
+
return el;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Type Parameters
|
|
31
|
+
|
|
32
|
+
| Type Parameter | Default type |
|
|
33
|
+
| --------------------------------------------- | ------------------------------- |
|
|
34
|
+
| `P` _extends_ `Record`\<`string`, `unknown`\> | `Record`\<`string`, `unknown`\> |
|
|
35
|
+
|
|
36
|
+
## Properties
|
|
37
|
+
|
|
38
|
+
### bindings
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
bindings: Record<string, string> | undefined;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Defined in: [json-render/types.ts:190](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L190)
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### children
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
children: Node[];
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Defined in: [json-render/types.ts:189](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L189)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### ctx
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
ctx: DomRenderContext;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Defined in: [json-render/types.ts:193](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L193)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### emit
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
emit: (event) => void;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Defined in: [json-render/types.ts:191](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L191)
|
|
75
|
+
|
|
76
|
+
#### Parameters
|
|
77
|
+
|
|
78
|
+
| Parameter | Type |
|
|
79
|
+
| --------- | -------- |
|
|
80
|
+
| `event` | `string` |
|
|
81
|
+
|
|
82
|
+
#### Returns
|
|
83
|
+
|
|
84
|
+
`void`
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### on
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
on: (event) => EventHandle;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Defined in: [json-render/types.ts:192](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L192)
|
|
95
|
+
|
|
96
|
+
#### Parameters
|
|
97
|
+
|
|
98
|
+
| Parameter | Type |
|
|
99
|
+
| --------- | -------- |
|
|
100
|
+
| `event` | `string` |
|
|
101
|
+
|
|
102
|
+
#### Returns
|
|
103
|
+
|
|
104
|
+
[`EventHandle`](../interfaces/EventHandle.md)
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### props
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
props: P;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Defined in: [json-render/types.ts:188](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L188)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-dom](../README.md) / CatalogHasActions
|
|
2
|
+
|
|
3
|
+
# Type Alias: CatalogHasActions\<C\>
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type CatalogHasActions<C> = [InferCatalogActions<C>] extends [never]
|
|
7
|
+
? false
|
|
8
|
+
: [keyof InferCatalogActions<C>] extends [never]
|
|
9
|
+
? false
|
|
10
|
+
: true;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [json-render/types.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L58)
|
|
14
|
+
|
|
15
|
+
Evaluates to `true` when a catalog declares at least one action; `false` otherwise.
|
|
16
|
+
|
|
17
|
+
Mirrors `CatalogHasActions<C>` from @json-render/react, /solid, /vue.
|
|
18
|
+
Used to make the `actions` field required in `DefineRegistryOptions` when the
|
|
19
|
+
catalog defines actions, and optional when it does not.
|
|
20
|
+
|
|
21
|
+
## Type Parameters
|
|
22
|
+
|
|
23
|
+
| Type Parameter |
|
|
24
|
+
| ----------------------- |
|
|
25
|
+
| `C` _extends_ `Catalog` |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type ComponentFn<C, K> = (ctx) => HTMLElement | Text | null;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/types.ts:
|
|
9
|
+
Defined in: [json-render/types.ts:198](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L198)
|
|
10
10
|
|
|
11
11
|
## Type Parameters
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type ComponentRegistry<C> = { [K in keyof InferCatalogComponents<C>]: ComponentFn<C, K> };
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/types.ts:
|
|
9
|
+
Defined in: [json-render/types.ts:204](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L204)
|
|
10
10
|
|
|
11
11
|
## Type Parameters
|
|
12
12
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-dom](../README.md) / DefineRegistryOptions
|
|
2
|
+
|
|
3
|
+
# Type Alias: DefineRegistryOptions\<C\>
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type DefineRegistryOptions<C> = object & CatalogHasActions<C> extends true ? object : object;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [json-render/types.ts:264](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L264)
|
|
10
|
+
|
|
11
|
+
Options for `defineRegistry`.
|
|
12
|
+
|
|
13
|
+
Mirrors `DefineRegistryOptions<C>` from @json-render/react, /solid, /svelte, /vue.
|
|
14
|
+
`actions` accepts catalog-typed async handler functions — params, setState, and state are
|
|
15
|
+
fully typed. When the catalog declares actions, `actions` is required; otherwise optional.
|
|
16
|
+
|
|
17
|
+
## Type Declaration
|
|
18
|
+
|
|
19
|
+
| Name | Type | Description | Defined in |
|
|
20
|
+
| ------------- | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `components?` | [`ComponentRegistry`](ComponentRegistry.md)\<`C`\> | Catalog-typed component implementations. If omitted, all elements fall through to the `fallback` renderer (if provided) or return `null` — the container will be empty. | [json-render/types.ts:270](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L270) |
|
|
22
|
+
|
|
23
|
+
## Type Parameters
|
|
24
|
+
|
|
25
|
+
| Type Parameter |
|
|
26
|
+
| ----------------------- |
|
|
27
|
+
| `C` _extends_ `Catalog` |
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
actions: {
|
|
33
|
+
login: async (params, setState, state) => {
|
|
34
|
+
if (!params) return;
|
|
35
|
+
setState(prev => ({ ...prev, loading: true }));
|
|
36
|
+
actor.send({ type: 'auth.login', username: params.username });
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
```
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type DomComponentRenderer = (element, ctx) => HTMLElement | Text | null;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/types.ts:
|
|
9
|
+
Defined in: [json-render/types.ts:134](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L134)
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
type DomRegistry = Record<string, DomComponentRenderer>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [json-render/types.ts:
|
|
9
|
+
Defined in: [json-render/types.ts:210](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.33/packages/play-dom/src/json-render/types.ts#L210)
|