@xmachines/docs 1.0.0-beta.50 → 1.0.0-beta.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/api/@xmachines/play/README.md +6 -5
- package/api/@xmachines/play/classes/NonNullableError.md +4 -4
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +2 -2
- package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
- package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/README.md +125 -47
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +20 -10
- package/api/@xmachines/play-dom/functions/createPlayUI.md +9 -9
- package/api/@xmachines/play-dom/functions/createRenderer.md +3 -2
- package/api/@xmachines/play-dom/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +17 -13
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +15 -12
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +4 -4
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +17 -14
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +10 -6
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +20 -8
- package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +13 -10
- package/api/@xmachines/play-dom/type-aliases/ActionFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/Actions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +7 -7
- package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomSchema.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +6 -4
- package/api/@xmachines/play-dom/type-aliases/SetState.md +1 -1
- package/api/@xmachines/play-dom/variables/schema.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +23 -25
- 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 +6 -6
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +68 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-react/README.md +3 -3
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +3 -3
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react-router/README.md +16 -1
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +85 -41
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +8 -8
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/README.md +21 -18
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +83 -43
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMatcher.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
- package/api/@xmachines/play-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +64 -0
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatcher.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +4 -3
- 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 +18 -20
- package/api/@xmachines/play-solid/functions/useActor.md +3 -3
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-solid/variables/ActorContext.md +2 -2
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +77 -10
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +83 -35
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +4 -4
- 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/PlayActor.md +68 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +8 -8
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +6 -4
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-svelte/README.md +23 -14
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +3 -3
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +13 -13
- 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 +6 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +20 -20
- 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 +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +3 -6
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +80 -35
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +4 -4
- 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/PlayActor.md +68 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/README.md +23 -17
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/{SolidRouterBridge.md → TanStackSolidRouterBridge.md} +86 -38
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +8 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +6 -4
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +3 -3
- package/api/@xmachines/play-vue/README.md +3 -3
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +3 -3
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +5 -5
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +27 -17
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +81 -33
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +6 -4
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +3 -3
- package/api/@xmachines/play-xstate/README.md +7 -3
- 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/interfaces/RouteObject.md +17 -0
- 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/RouteMetadata.md +9 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/README.md +25 -12
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/contributing/architecture.md +599 -0
- package/contributing/configuration.md +262 -419
- package/contributing/development.md +300 -453
- package/contributing/testing.md +165 -172
- package/examples/@xmachines/play-dom-demo/README.md +30 -21
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-dom-router-demo/README.md +23 -18
- package/examples/@xmachines/play-react-demo/README.md +38 -37
- 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 +37 -33
- package/examples/@xmachines/play-solid-demo/README.md +5 -2
- package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-solid-router-demo/README.md +38 -25
- package/examples/@xmachines/play-svelte-demo/README.md +8 -5
- package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-spa-router-demo/README.md +11 -9
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +14 -9
- package/examples/@xmachines/play-tanstack-react-router-demo/README.md +39 -13
- package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +27 -13
- package/examples/@xmachines/play-vue-demo/README.md +35 -24
- package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-vue-router-demo/README.md +2 -0
- package/examples/README.md +7 -7
- package/examples/multi-router-integration.md +13 -16
- package/examples/routing-patterns.md +2 -2
- package/guides/README.md +1 -1
- package/guides/actor-model.md +2 -2
- package/guides/getting-started.md +325 -132
- package/guides/signals.md +1 -1
- package/guides/state-machines.md +1 -1
- package/package.json +2 -2
- package/api/@xmachines/play-dom/functions/connectRenderer.md +0 -70
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +0 -28
- package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +0 -9
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +0 -9
- package/api/@xmachines/play-svelte/type-aliases/PlayActor.md +0 -9
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +0 -9
- package/guides/architecture.md +0 -500
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Vanilla DOM renderer for XMachines Play architecture with signal-driven rendering.
|
|
8
8
|
|
|
9
|
-
Part of the [
|
|
9
|
+
Part of the [XMachines Play monorepo](../../README.md).
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -89,7 +89,9 @@ disconnect();
|
|
|
89
89
|
|
|
90
90
|
### `createPlayUI` — batteries-included factory with full options
|
|
91
91
|
|
|
92
|
-
Use `createPlayUI` when you need render error handling, a fallback element, or
|
|
92
|
+
Use `createPlayUI` when you need render error handling, a fallback element, navigation integration, computed functions, or custom validation — or when you need to reference `registryResult` programmatically (e.g. for `executeAction`).
|
|
93
|
+
|
|
94
|
+
Factory-level options (`functions`, `validationFunctions`, `navigate`, `onRenderError`, `fallback`) are closed over at creation time and applied on every `mount()` call. Per-mount options (`store`, `loading`) are passed to `mount()` itself.
|
|
93
95
|
|
|
94
96
|
```typescript
|
|
95
97
|
import { defineRegistry, createPlayUI, schema } from "@xmachines/play-dom";
|
|
@@ -112,6 +114,10 @@ const registryResult = defineRegistry(catalog, {
|
|
|
112
114
|
const mount = createPlayUI(registryResult, {
|
|
113
115
|
onRenderError: console.error,
|
|
114
116
|
fallback: document.getElementById("loading")!,
|
|
117
|
+
navigate: (path) => myRouter.push(path),
|
|
118
|
+
functions: {
|
|
119
|
+
fullName: (args) => `${args.first} ${args.last}`,
|
|
120
|
+
},
|
|
115
121
|
});
|
|
116
122
|
|
|
117
123
|
const disconnect = mount(actor, document.getElementById("app")!);
|
|
@@ -150,35 +156,112 @@ const renderer = new PlayRenderer(container, actor, registryResult.registry, {
|
|
|
150
156
|
renderer.connect();
|
|
151
157
|
```
|
|
152
158
|
|
|
153
|
-
|
|
159
|
+
## Provider Options
|
|
154
160
|
|
|
155
|
-
`
|
|
161
|
+
All entry points (`createPlayUI`, `PlayRenderer`) accept the same set of UI-provider options via `UIProviderOptions`. These are forwarded into `DomRenderContext` on every render pass, making them available to component implementations via `ctx.ctx.*`.
|
|
156
162
|
|
|
157
|
-
|
|
158
|
-
import { connectRenderer, defineRegistry, schema } from "@xmachines/play-dom";
|
|
163
|
+
### `functions` — named compute functions for `$computed` prop expressions
|
|
159
164
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
Enables `{ "$computed": "name", "args": {...} }` dynamic prop values in specs. Each function receives the resolved `args` object and returns the computed value.
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
const mount = createPlayUI(registryResult, {
|
|
169
|
+
functions: {
|
|
170
|
+
fullName: (args) => `${args.first} ${args.last}`,
|
|
171
|
+
formatDate: (args) => new Date(args.iso as string).toLocaleDateString(),
|
|
167
172
|
},
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Without `functions`, any `$computed` expression silently resolves to `undefined` (no throw, backward-compatible).
|
|
177
|
+
|
|
178
|
+
### `validationFunctions` — custom field validation
|
|
179
|
+
|
|
180
|
+
Provides named validation functions for inline field validation within components. Functions receive `(value, args?)` and return `true` (valid) or `false` (invalid).
|
|
181
|
+
|
|
182
|
+
Unlike the framework renderers, the DOM renderer has no automatic `ValidationProvider` tree. Components must invoke validation explicitly using `runValidationCheck` / `runValidation` from `@json-render/core`, passing `ctx.ctx.validationFunctions` as `customFunctions`.
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
import { runValidationCheck } from "@json-render/core";
|
|
186
|
+
|
|
187
|
+
const mount = createPlayUI(registryResult, {
|
|
188
|
+
validationFunctions: {
|
|
189
|
+
isEven: (value) => typeof value === "number" && value % 2 === 0,
|
|
190
|
+
phoneNumber: (value) => /^\+?[\d\s\-()]{7,}$/.test(String(value)),
|
|
170
191
|
},
|
|
171
192
|
});
|
|
172
193
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
194
|
+
// Inside a ComponentFn:
|
|
195
|
+
const MyField: ComponentFn<typeof catalog, "MyField"> = ({ ctx }) => {
|
|
196
|
+
const result = runValidationCheck(
|
|
197
|
+
{ type: "isEven", message: "must be even" },
|
|
198
|
+
{ value: someValue, stateModel: {}, customFunctions: ctx.ctx.validationFunctions },
|
|
199
|
+
);
|
|
200
|
+
// result.valid, result.message
|
|
201
|
+
};
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### `navigate` — programmatic navigation from action bindings
|
|
205
|
+
|
|
206
|
+
A callback invoked when an action binding resolves with `onSuccess: { navigate: "/path" }`. The resolved path string is passed as the sole argument. Integrate with any router:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
// React Router / TanStack Router / any push-based router:
|
|
210
|
+
const mount = createPlayUI(registryResult, {
|
|
211
|
+
navigate: (path) => myRouter.push(path),
|
|
178
212
|
});
|
|
213
|
+
```
|
|
179
214
|
|
|
180
|
-
|
|
181
|
-
|
|
215
|
+
With a spec binding:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"on": {
|
|
220
|
+
"click": {
|
|
221
|
+
"action": "submitForm",
|
|
222
|
+
"onSuccess": { "navigate": "/dashboard" }
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
When `submitForm` completes successfully, `navigate("/dashboard")` is called automatically.
|
|
229
|
+
|
|
230
|
+
The function is also readable by component implementations directly via `ctx.ctx.navigate` for cases where navigation needs to be triggered outside of an action binding.
|
|
231
|
+
|
|
232
|
+
### `onRenderError` — unified error handler
|
|
233
|
+
|
|
234
|
+
Receives `(error, name)` for three distinct error classes:
|
|
235
|
+
|
|
236
|
+
- **Component render errors** — when a `ComponentFn` throws synchronously during `renderSpec`. `name` is the catalog component name (e.g. `"Home"`).
|
|
237
|
+
- **Action handler rejections (emit path)** — when an `ActionFn` throws or returns a rejected promise during `emit()`. `name` is the catalog action name (e.g. `"submitForm"`).
|
|
238
|
+
- **Action handler rejections (watch path)** — when an `ActionFn` rejects during a `watch` binding callback. `name` is the catalog action name.
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
const mount = createPlayUI(registryResult, {
|
|
242
|
+
onRenderError: (err, name) => {
|
|
243
|
+
// Route to your application's error tracking
|
|
244
|
+
Sentry.captureException(err, { extra: { name } });
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
The argument order matches the upstream `RenderErrorHandler` type from `@json-render/core`: **error first, name second**. This is consistent with the framework renderers (`@json-render/solid`, `@json-render/react`).
|
|
250
|
+
|
|
251
|
+
Without `onRenderError`, all three error types are logged via `console.error` and swallowed. No exception propagates, and no unhandled promise rejection is created.
|
|
252
|
+
|
|
253
|
+
The handler is also available to component implementations via `ctx.ctx.onRenderError`, enabling components to route their own internal errors through the same channel:
|
|
254
|
+
|
|
255
|
+
```typescript
|
|
256
|
+
const MyComponent: ComponentFn<typeof catalog, "MyComponent"> = ({ ctx }) => {
|
|
257
|
+
try {
|
|
258
|
+
const el = doSomethingRisky();
|
|
259
|
+
return el;
|
|
260
|
+
} catch (err) {
|
|
261
|
+
ctx.ctx.onRenderError?.(err, "MyComponent");
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
};
|
|
182
265
|
```
|
|
183
266
|
|
|
184
267
|
## API Summary
|
|
@@ -190,36 +273,33 @@ disconnect();
|
|
|
190
273
|
| `createRenderer(catalog, components)` | function | One-call factory — returns `mount(actor, container, options?) → disconnect` |
|
|
191
274
|
| `createPlayUI(registryResult, options?)` | function | Batteries-included factory — returns `MountFn` |
|
|
192
275
|
| `PlayRenderer` | class | Class-based renderer with `connect()` / `disconnect()` lifecycle |
|
|
193
|
-
| `connectRenderer(options)` | function | Functional API; backward-compatible alternative to `PlayRenderer` |
|
|
194
276
|
| `defineRegistry(catalog, options)` | function | Build a catalog-typed `DomRegistry` with typed handlers |
|
|
195
277
|
| `renderSpec(...)` | function | Pure Spec → DOM renderer (low-level) |
|
|
196
278
|
| `schema` | const | The `@json-render/dom` schema — pass to `defineCatalog()` |
|
|
197
279
|
|
|
198
280
|
### Key Types
|
|
199
281
|
|
|
200
|
-
| Type | Description
|
|
201
|
-
| ------------------------ |
|
|
202
|
-
| `ComponentFn<C, K>` | Catalog-typed component function — returns `HTMLElement \| Text \| null`
|
|
203
|
-
| `ComponentContext<C, K>` | Context passed to each component: `props`, `children`, `emit`, `on`, `bindings`, `ctx`
|
|
204
|
-
| `ActionFn<C, K>` | Catalog-typed action function — receives `(params, setState, state)`
|
|
205
|
-
| `EventHandle` | Handle returned by `on(eventName)` — has `emit()`, `shouldPreventDefault`, `bound`
|
|
206
|
-
| `SetState` | State updater: `(prev => next) => void`
|
|
207
|
-
| `DefineRegistryResult` | Result from `defineRegistry` — has `registry`, `handlers`, `executeAction`
|
|
208
|
-
| `PlayDomOptions` | Options for `PlayRenderer`
|
|
209
|
-
| `
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
|
216
|
-
|
|
|
217
|
-
| `MissingCatalogError` | `PLAY_RENDERER_MISSING_CATALOG` | Components map was `null` or `undefined` |
|
|
218
|
-
| `MissingComponentError` | `PLAY_RENDERER_MISSING_COMPONENT` | Component name not found in catalog |
|
|
282
|
+
| Type | Description |
|
|
283
|
+
| ------------------------ | ------------------------------------------------------------------------------------------ |
|
|
284
|
+
| `ComponentFn<C, K>` | Catalog-typed component function — returns `HTMLElement \| Text \| null` |
|
|
285
|
+
| `ComponentContext<C, K>` | Context passed to each component: `props`, `children`, `emit`, `on`, `bindings`, `ctx` |
|
|
286
|
+
| `ActionFn<C, K>` | Catalog-typed action function — receives `(params, setState, state)` |
|
|
287
|
+
| `EventHandle` | Handle returned by `on(eventName)` — has `emit()`, `shouldPreventDefault`, `bound` |
|
|
288
|
+
| `SetState` | State updater: `(prev => next) => void` |
|
|
289
|
+
| `DefineRegistryResult` | Result from `defineRegistry` — has `registry`, `handlers`, `executeAction` |
|
|
290
|
+
| `PlayDomOptions` | Options for `PlayRenderer` — extends `UIProviderOptions` |
|
|
291
|
+
| `CreatePlayUIOptions` | Options for `createPlayUI` — extends `UIProviderOptions`, adds `fallback` |
|
|
292
|
+
| `MountOptions` | Per-mount options for `MountFn`: `store`, `loading` |
|
|
293
|
+
| `MountFn` | The mount function returned by `createPlayUI`: `(actor, container, options?) → disconnect` |
|
|
294
|
+
| `UIProviderOptions` | Shared options: `functions`, `validationFunctions`, `navigate`, `onRenderError` |
|
|
295
|
+
| `BaseComponentProps<P>` | Catalog-agnostic component props for shared component libraries |
|
|
296
|
+
| `DomRegistry` | Raw registry type: `Record<string, DomComponentRenderer>` |
|
|
297
|
+
| `DomSchema` | Type of the `schema` export |
|
|
298
|
+
| `ComputedFunction` | Type for named compute functions used with the `functions` option |
|
|
219
299
|
|
|
220
300
|
## Rendering Behaviour
|
|
221
301
|
|
|
222
|
-
- **Initial render is synchronous** — the container is populated before `connect()`
|
|
302
|
+
- **Initial render is synchronous** — the container is populated before `connect()` returns.
|
|
223
303
|
- **Signal-driven re-renders are microtask-deferred** — `watchSignal` schedules updates on the next microtask queue tick.
|
|
224
304
|
- **Null view** clears the container. A `fallback` element can be shown on initial mount when the view is `null`; it is **not** re-appended if the view later transitions back to `null` after a non-null view.
|
|
225
305
|
- **Double `connect()` is safe** — calling `connect()` on an already-connected renderer auto-disconnects first.
|
|
@@ -244,9 +324,9 @@ Public API split into two layers:
|
|
|
244
324
|
**XMachines layer** (this package):
|
|
245
325
|
|
|
246
326
|
- `createRenderer()` — one-call factory: returns `mount(actor, container, options?) → disconnect`
|
|
327
|
+
- `createPlayUI()` — batteries-included factory with full options: returns `MountFn`
|
|
247
328
|
- `PlayRenderer` — class-based renderer with `connect()` / `disconnect()` lifecycle
|
|
248
|
-
- `
|
|
249
|
-
- `ConnectRendererOptions`, `PlayDomOptions`
|
|
329
|
+
- `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `MountOptions`
|
|
250
330
|
|
|
251
331
|
**json-render layer** (upstreamable to @json-render/dom):
|
|
252
332
|
|
|
@@ -270,7 +350,6 @@ Public API split into two layers:
|
|
|
270
350
|
## Interfaces
|
|
271
351
|
|
|
272
352
|
- [ComponentContext](interfaces/ComponentContext.md)
|
|
273
|
-
- [ConnectRendererOptions](interfaces/ConnectRendererOptions.md)
|
|
274
353
|
- [CreatePlayUIOptions](interfaces/CreatePlayUIOptions.md)
|
|
275
354
|
- [DefineRegistryResult](interfaces/DefineRegistryResult.md)
|
|
276
355
|
- [DomRenderContext](interfaces/DomRenderContext.md)
|
|
@@ -301,7 +380,6 @@ Public API split into two layers:
|
|
|
301
380
|
|
|
302
381
|
## Functions
|
|
303
382
|
|
|
304
|
-
- [connectRenderer](functions/connectRenderer.md)
|
|
305
383
|
- [createPlayUI](functions/createPlayUI.md)
|
|
306
384
|
- [createRenderer](functions/createRenderer.md)
|
|
307
385
|
- [defineRegistry](functions/defineRegistry.md)
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: PlayRenderer
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-dom/src/PlayRenderer.ts:
|
|
5
|
+
Defined in: [packages/play-dom/src/PlayRenderer.ts:87](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/PlayRenderer.ts#L87)
|
|
6
6
|
|
|
7
7
|
PlayRenderer connects an actor's `currentView` signal to the DOM renderer.
|
|
8
8
|
|
|
9
9
|
Watches `actor.currentView` via TC39 Signals and renders `DomComponentRenderer`
|
|
10
10
|
functions into `container` on every view transition. Cleared on `disconnect()`.
|
|
11
11
|
|
|
12
|
+
Options from `PlayDomOptions` (which extends `UIProviderOptions`) are all forwarded
|
|
13
|
+
into `DomRenderContext` on every render pass:
|
|
14
|
+
|
|
15
|
+
- `functions` — named compute functions for `{ $computed: "name" }` prop expressions
|
|
16
|
+
- `validationFunctions` — custom validation functions, available at `ctx.ctx.validationFunctions`
|
|
17
|
+
- `navigate` — navigation callback, invoked on `onSuccess: { navigate: "..." }` action bindings
|
|
18
|
+
- `onRenderError` — called with `(error, name)` for component render errors and action handler rejections
|
|
19
|
+
|
|
12
20
|
**Preferred usage — via `registryResult`:**
|
|
13
21
|
|
|
14
22
|
```typescript
|
|
@@ -17,6 +25,8 @@ import { PlayRenderer, defineRegistry } from "@xmachines/play-dom";
|
|
|
17
25
|
const registryResult = defineRegistry(catalog, { components, actions });
|
|
18
26
|
const renderer = new PlayRenderer(container, actor, registryResult.registry, {
|
|
19
27
|
registryResult, // wires setState/getState from xstate store automatically
|
|
28
|
+
navigate: (path) => myRouter.push(path),
|
|
29
|
+
functions: { fullName: (args) => `${args.first} ${args.last}` },
|
|
20
30
|
});
|
|
21
31
|
renderer.connect();
|
|
22
32
|
// Later:
|
|
@@ -50,16 +60,16 @@ new PlayRenderer(
|
|
|
50
60
|
options?): PlayRenderer;
|
|
51
61
|
```
|
|
52
62
|
|
|
53
|
-
Defined in: [packages/play-dom/src/PlayRenderer.ts:
|
|
63
|
+
Defined in: [packages/play-dom/src/PlayRenderer.ts:113](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/PlayRenderer.ts#L113)
|
|
54
64
|
|
|
55
65
|
#### Parameters
|
|
56
66
|
|
|
57
|
-
| Parameter | Type | Description
|
|
58
|
-
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
-
| `container` | `HTMLElement` | `HTMLElement` to render into. Cleared and repopulated on every view transition.
|
|
60
|
-
| `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 providing the `currentView` signal (must implement `Viewable`).
|
|
61
|
-
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Component renderer map — typically `registryResult.registry` from `defineRegistry`.
|
|
62
|
-
| `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | Configuration: - `registryResult` —
|
|
67
|
+
| Parameter | Type | Description |
|
|
68
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
+
| `container` | `HTMLElement` | `HTMLElement` to render into. Cleared and repopulated on every view transition. |
|
|
70
|
+
| `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 providing the `currentView` signal (must implement `Viewable`). |
|
|
71
|
+
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Component renderer map — typically `registryResult.registry` from `defineRegistry`. |
|
|
72
|
+
| `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | Configuration (see [PlayDomOptions](../interfaces/PlayDomOptions.md)): - `registryResult` — auto-wires `setState`/`state` from the xstate store. - `store` — external `StateStore` (controlled mode; overrides `spec.state` seeding). - `loading` — streaming mode flag; suppresses missing-child warnings. - `functions` — named compute functions for `$computed` prop expressions. - `validationFunctions` — custom validation functions; available at `ctx.ctx.validationFunctions`. - `navigate` — navigation callback; invoked on `onSuccess: { navigate: "..." }`. - `onRenderError` — `(error, name)` handler for component render errors and action handler rejections; suppresses `console.error` fallback. |
|
|
63
73
|
|
|
64
74
|
#### Returns
|
|
65
75
|
|
|
@@ -73,7 +83,7 @@ Defined in: [packages/play-dom/src/PlayRenderer.ts:101](https://gitlab.com/xmach
|
|
|
73
83
|
connect(): void;
|
|
74
84
|
```
|
|
75
85
|
|
|
76
|
-
Defined in: [packages/play-dom/src/PlayRenderer.ts:
|
|
86
|
+
Defined in: [packages/play-dom/src/PlayRenderer.ts:129](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/PlayRenderer.ts#L129)
|
|
77
87
|
|
|
78
88
|
Start watching actor.currentView and render to container.
|
|
79
89
|
Renders the initial view synchronously, then subscribes to signal changes.
|
|
@@ -95,7 +105,7 @@ change. Guard against this by auto-disconnecting first.
|
|
|
95
105
|
disconnect(): void;
|
|
96
106
|
```
|
|
97
107
|
|
|
98
|
-
Defined in: [packages/play-dom/src/PlayRenderer.ts:
|
|
108
|
+
Defined in: [packages/play-dom/src/PlayRenderer.ts:138](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/PlayRenderer.ts#L138)
|
|
99
109
|
|
|
100
110
|
Stop watching and clear the container.
|
|
101
111
|
|
|
@@ -6,23 +6,23 @@
|
|
|
6
6
|
function createPlayUI(registryResult, options?): MountFn;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-dom/src/create-play-ui.ts:
|
|
9
|
+
Defined in: [packages/play-dom/src/create-play-ui.ts:92](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/create-play-ui.ts#L92)
|
|
10
10
|
|
|
11
11
|
Create a batteries-included DOM renderer mount function.
|
|
12
12
|
|
|
13
|
-
The
|
|
14
|
-
createPlayUI closes over
|
|
15
|
-
|
|
13
|
+
The caller is responsible for producing `registryResult` via `defineRegistry`.
|
|
14
|
+
`createPlayUI` closes over it and returns a `MountFn` that can be invoked
|
|
15
|
+
once per actor/container pair.
|
|
16
16
|
|
|
17
17
|
## Parameters
|
|
18
18
|
|
|
19
|
-
| Parameter | Type | Description
|
|
20
|
-
| ---------------- | --------------------------------------------------------------- |
|
|
21
|
-
| `registryResult` | [`DefineRegistryResult`](../interfaces/DefineRegistryResult.md) | Result from defineRegistry()
|
|
22
|
-
| `options` | [`CreatePlayUIOptions`](../interfaces/CreatePlayUIOptions.md) |
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| ---------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `registryResult` | [`DefineRegistryResult`](../interfaces/DefineRegistryResult.md) | Result from `defineRegistry()` — provides the registry and the lazy handlers factory. |
|
|
22
|
+
| `options` | [`CreatePlayUIOptions`](../interfaces/CreatePlayUIOptions.md) | Factory-level configuration (see [CreatePlayUIOptions](../interfaces/CreatePlayUIOptions.md)): - `functions` — named compute functions for `$computed` prop expressions. - `validationFunctions` — custom validation functions; available at `ctx.ctx.validationFunctions`. - `navigate` — navigation callback; invoked on `onSuccess: { navigate: "..." }`. - `onRenderError` — `(error, name)` handler for component render errors and action handler rejections. - `fallback` — element shown when the actor's initial view is `null`. |
|
|
23
23
|
|
|
24
24
|
## Returns
|
|
25
25
|
|
|
26
26
|
[`MountFn`](../type-aliases/MountFn.md)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
`MountFn`: `(actor, container, mountOptions?) → disconnect`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function createRenderer<C>(catalog, componentMap): (actor, container, options?) => () => void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-dom/src/create-renderer.ts:
|
|
9
|
+
Defined in: [packages/play-dom/src/create-renderer.ts:84](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/create-renderer.ts#L84)
|
|
10
10
|
|
|
11
11
|
Create a reusable DOM renderer factory from a catalog and component map.
|
|
12
12
|
|
|
@@ -39,5 +39,6 @@ reuses the result across all `mount()` calls. The `mount` options type therefore
|
|
|
39
39
|
`registryResult` (it is always provided by `createRenderer` itself and cannot be overridden).
|
|
40
40
|
|
|
41
41
|
If you need to call `registryResult.executeAction()` programmatically (outside the emit/on
|
|
42
|
-
flow), or
|
|
42
|
+
flow), or pass additional provider options (`navigate`, `onRenderError`, `functions`, etc.),
|
|
43
|
+
use `createPlayUI` (which accepts the full `CreatePlayUIOptions`) or `defineRegistry` with
|
|
43
44
|
`PlayRenderer` directly rather than `createRenderer`.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function defineRegistry<C>(_catalog, options): DefineRegistryResult;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-dom/src/json-render/types.ts:
|
|
9
|
+
Defined in: [packages/play-dom/src/json-render/types.ts:527](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L527)
|
|
10
10
|
|
|
11
11
|
## Type Parameters
|
|
12
12
|
|
|
@@ -14,10 +14,12 @@ function renderSpec(
|
|
|
14
14
|
functions?,
|
|
15
15
|
loading?,
|
|
16
16
|
onWatchSetup?,
|
|
17
|
+
validationFunctions?,
|
|
18
|
+
navigate?,
|
|
17
19
|
): Node | null;
|
|
18
20
|
```
|
|
19
21
|
|
|
20
|
-
Defined in: [packages/play-dom/src/json-render/renderer.ts:
|
|
22
|
+
Defined in: [packages/play-dom/src/json-render/renderer.ts:135](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/renderer.ts#L135)
|
|
21
23
|
|
|
22
24
|
Render a Spec tree into DOM nodes using the provided `DomRegistry`.
|
|
23
25
|
|
|
@@ -30,18 +32,20 @@ built by `defineRegistry` — this function only orchestrates the traversal.
|
|
|
30
32
|
|
|
31
33
|
## Parameters
|
|
32
34
|
|
|
33
|
-
| Parameter
|
|
34
|
-
|
|
|
35
|
-
| `spec`
|
|
36
|
-
| `store`
|
|
37
|
-
| `registry`
|
|
38
|
-
| `send`
|
|
39
|
-
| `handlers`
|
|
40
|
-
| `fallback?`
|
|
41
|
-
| `onRenderError?`
|
|
42
|
-
| `functions?`
|
|
43
|
-
| `loading?`
|
|
44
|
-
| `onWatchSetup?`
|
|
35
|
+
| Parameter | Type | Description |
|
|
36
|
+
| ---------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `spec` | `Spec` | The json-render `Spec` describing the UI tree. |
|
|
38
|
+
| `store` | `StateStore` | Live `StateStore` bound to `spec.state`. |
|
|
39
|
+
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Map of element type names → `DomComponentRenderer`. |
|
|
40
|
+
| `send` | (`event`) => `void` | Dispatcher for interaction events (e.g. actor.send). |
|
|
41
|
+
| `handlers` | `Record`\<`string`, `ActionHandler`\> | Map of catalog action names → async ActionHandler functions. |
|
|
42
|
+
| `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`. |
|
|
43
|
+
| `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Optional callback matching `RenderErrorHandler = (error, name)`. Invoked for three distinct error classes: - `(error, elementType)` when a component renderer throws (GAP-08) - `(error, actionName)` when an action handler rejects during `emit()` - `(error, actionName)` when an action handler rejects in a `watch` binding If absent, all three fall back to `console.error`. Forwarded into `DomRenderContext.onRenderError` so `emit()` and `watch` handlers route errors through the same channel as component render errors. |
|
|
44
|
+
| `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). |
|
|
45
|
+
| `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. |
|
|
46
|
+
| `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(). |
|
|
47
|
+
| `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Optional map of custom validation functions forwarded to `DomRenderContext.validationFunctions`. Components pass these as `customFunctions` to `runValidationCheck` / `runValidation` from `@json-render/core`. Has no effect on prop resolution. |
|
|
48
|
+
| `navigate?` | (`path`) => `void` | Optional navigation callback forwarded to `DomRenderContext.navigate`. Invoked automatically by `defineRegistry`'s `emit()` when an action binding resolves with `onSuccess: { navigate: "/path" }`. Also readable by component implementations via `ctx.navigate`. |
|
|
45
49
|
|
|
46
50
|
## Returns
|
|
47
51
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ComponentContext\<C, K\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-dom/src/json-render/types.ts:
|
|
5
|
+
Defined in: [packages/play-dom/src/json-render/types.ts:305](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L305)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -15,9 +15,9 @@ Defined in: [packages/play-dom/src/json-render/types.ts:184](https://gitlab.com/
|
|
|
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. | [packages/play-dom/src/json-render/types.ts:
|
|
19
|
-
| <a id="property-children"></a> `children` | `Node`[] | Rendered child nodes from the spec's `children` list. | [packages/play-dom/src/json-render/types.ts:
|
|
20
|
-
| <a id="property-ctx"></a> `ctx` | [`DomRenderContext`](DomRenderContext.md) | Low-level render context. | [packages/play-dom/src/json-render/types.ts:
|
|
21
|
-
| <a id="property-emit"></a> `emit` | (`event`) => `void` | Dispatch a named event defined in the spec's `on` map. | [packages/play-dom/src/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. | [packages/play-dom/src/json-render/types.ts:
|
|
23
|
-
| <a id="property-props"></a> `props` | `InferComponentProps`\<`C`, `K`\> | Catalog-typed, store-resolved props for this component. | [packages/play-dom/src/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. | [packages/play-dom/src/json-render/types.ts:315](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L315) |
|
|
19
|
+
| <a id="property-children"></a> `children` | `Node`[] | Rendered child nodes from the spec's `children` list. | [packages/play-dom/src/json-render/types.ts:311](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L311) |
|
|
20
|
+
| <a id="property-ctx"></a> `ctx` | [`DomRenderContext`](DomRenderContext.md) | Low-level render context. | [packages/play-dom/src/json-render/types.ts:327](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L327) |
|
|
21
|
+
| <a id="property-emit"></a> `emit` | (`event`) => `void` | Dispatch a named event defined in the spec's `on` map. | [packages/play-dom/src/json-render/types.ts:319](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L319) |
|
|
22
|
+
| <a id="property-on"></a> `on` | (`event`) => [`EventHandle`](EventHandle.md) | Get an `EventHandle` for a named event from the spec's `on` map. | [packages/play-dom/src/json-render/types.ts:323](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L323) |
|
|
23
|
+
| <a id="property-props"></a> `props` | `InferComponentProps`\<`C`, `K`\> | Catalog-typed, store-resolved props for this component. | [packages/play-dom/src/json-render/types.ts:307](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L307) |
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: CreatePlayUIOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-dom/src/types.ts:
|
|
5
|
+
Defined in: [packages/play-dom/src/types.ts:67](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/types.ts#L67)
|
|
6
6
|
|
|
7
|
-
Options for createPlayUI() — the batteries-included DOM factory.
|
|
7
|
+
Options for `createPlayUI()` — the batteries-included DOM factory.
|
|
8
8
|
|
|
9
|
-
Extends UIProviderOptions
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Extends [UIProviderOptions](UIProviderOptions.md), which contributes `functions`,
|
|
10
|
+
`validationFunctions`, `navigate`, and `onRenderError`. All four are
|
|
11
|
+
closed over at factory creation time and forwarded into `PlayRenderer`
|
|
12
|
+
on every `mount()` call.
|
|
13
|
+
|
|
14
|
+
Parallel to `PlayUIProvider`'s props in the framework renderers.
|
|
12
15
|
|
|
13
16
|
## See
|
|
14
17
|
|
|
@@ -20,10 +23,10 @@ createPlayUI
|
|
|
20
23
|
|
|
21
24
|
## Properties
|
|
22
25
|
|
|
23
|
-
| Property | Type | Description
|
|
24
|
-
| ---------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
25
|
-
| <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| `null` | Optional fallback element shown when `currentView` is `null` on **initial mount** only. The fallback is appended immediately after `mount()` 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.
|
|
26
|
-
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> |
|
|
27
|
-
| <a id="property-navigate"></a> `navigate?` | (`path`) => `void` |
|
|
28
|
-
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) |
|
|
29
|
-
| <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions for
|
|
26
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
27
|
+
| ---------------------------------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
28
|
+
| <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| `null` | Optional fallback element shown when `currentView` is `null` on **initial mount** only. The fallback is appended immediately after `mount()` 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. | - | [packages/play-dom/src/types.ts:79](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/types.ts#L79) |
|
|
29
|
+
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named compute functions for `{ $computed: "name", args: {...} }` prop expressions. Each function receives the resolved `args` object and returns the computed value. Forwarded directly to `resolveElementProps` via `PropResolutionContext.functions`, matching the `FunctionsContext` provider in the framework renderers. Without this option, `$computed` expressions resolve to `undefined` (no throw). **Example** `const mount = createPlayUI(registryResult, { functions: { fullName: (args) => `${args.first} ${args.last}`, formatCurrency: (args) => new Intl.NumberFormat().format(args.amount as number), }, });` Mirrors the `functions` prop on `JSONUIProvider` / `JsonUIProvider`. | [`UIProviderOptions`](UIProviderOptions.md).[`functions`](UIProviderOptions.md#property-functions) | [packages/play-dom/src/json-render/types.ts:88](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L88) |
|
|
30
|
+
| <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Programmatic navigation function. Called automatically when an action binding resolves with `onSuccess: { navigate: "/path" }`. The resolved path string is passed as the sole argument. Mirrors the `navigate` prop in `ActionProvider` from the framework renderers, where it is captured in the `execute()` closure. Also available to component implementations directly via `ctx.ctx.navigate` for cases where navigation needs to be triggered outside of an action binding. **Example** `import { useNavigate } from "my-router"; const navigate = useNavigate(); const mount = createPlayUI(registryResult, { navigate });` Spec binding that triggers navigation: `{ "on": { "click": { "action": "doSomething", "onSuccess": { "navigate": "/dashboard" } } } }` | [`UIProviderOptions`](UIProviderOptions.md).[`navigate`](UIProviderOptions.md#property-navigate) | [packages/play-dom/src/json-render/types.ts:152](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L152) |
|
|
31
|
+
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Unified error handler for component render errors and action handler rejections. Matches `RenderErrorHandler = (error: unknown, name: string) => void`. Invoked for three distinct error classes: - `(error, elementType)` — when a component renderer throws synchronously during `renderSpec` - `(error, actionName)` — when an action handler rejects during `emit()` (on-event path) - `(error, actionName)` — when an action handler rejects during a `watch` binding callback When provided, suppresses the `console.error` fallback for all three error types. Forwarded into `renderSpec` as the `onRenderError` parameter and into `DomRenderContext.onRenderError` so both `emit()` and `watch` handlers route their errors through the same channel as component render errors. **Example** `const mount = createPlayUI(registryResult, { onRenderError: (err, name) => { myErrorReporter.capture(err, { context: name }); }, });` | [`UIProviderOptions`](UIProviderOptions.md).[`onRenderError`](UIProviderOptions.md#property-onrendererror) | [packages/play-dom/src/json-render/types.ts:178](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L178) |
|
|
32
|
+
| <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions for inline field validation. Each function receives `(value, args?)` and returns `true` (valid) or `false` (invalid). Functions are available to component implementations via `ctx.ctx.validationFunctions` and should be passed as `customFunctions` to `runValidationCheck` / `runValidation` from `@json-render/core`. Mirrors `customFunctions` in `ValidationProvider` from the framework renderers. The DOM renderer has no automatic `ValidationProvider` tree — validation must be invoked explicitly by component implementations. **Example** `import { runValidationCheck } from "@json-render/core"; const mount = createPlayUI(registryResult, { validationFunctions: { isEven: (value) => typeof value === "number" && value % 2 === 0, phoneNumber: (value) => /^\+?[\d\s\-()]{7,}$/.test(String(value)), }, }); // Inside a ComponentFn: const MyField: ComponentFn<typeof catalog, "MyField"> = ({ ctx }) => { const result = runValidationCheck( { type: "isEven", message: "must be even" }, { value: someValue, stateModel: {}, customFunctions: ctx.ctx.validationFunctions }, ); // result.valid, result.message };` | [`UIProviderOptions`](UIProviderOptions.md).[`validationFunctions`](UIProviderOptions.md#property-validationfunctions) | [packages/play-dom/src/json-render/types.ts:123](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.52/packages/play-dom/src/json-render/types.ts#L123) |
|