@xmachines/docs 2.1.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api/@xmachines/play/README.md +74 -7
- package/api/@xmachines/play/classes/NonNullableError.md +4 -4
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/functions/asCleanup.md +78 -0
- package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
- package/api/@xmachines/play/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play/type-aliases/DisposeKey.md +32 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-actor/README.md +8 -1
- package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +1 -1
- package/api/@xmachines/play-actor/functions/composePlayState.md +1 -1
- package/api/@xmachines/play-actor/functions/createFailureLatch.md +20 -0
- package/api/@xmachines/play-actor/functions/createReportGuard.md +26 -0
- package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +1 -1
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +1 -1
- package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +1 -1
- package/api/@xmachines/play-actor/functions/reuseComposedState.md +1 -1
- package/api/@xmachines/play-actor/functions/sameViewInputs.md +25 -0
- package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +1 -1
- package/api/@xmachines/play-actor/functions/toAtomState.md +1 -1
- 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/FailureLatch.md +59 -0
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/ReportGuard.md +92 -0
- package/api/@xmachines/play-actor/interfaces/ReportGuardMessages.md +18 -0
- package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/ViewInputs.md +19 -0
- package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +3 -3
- package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +4 -4
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +1 -1
- package/api/@xmachines/play-dom/README.md +84 -16
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +10 -10
- package/api/@xmachines/play-dom/functions/createPlayUI.md +8 -8
- package/api/@xmachines/play-dom/functions/createRenderer.md +3 -3
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +17 -11
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +5 -4
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +14 -12
- package/api/@xmachines/play-dom/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-dom/type-aliases/DisposablePlayUI.md +36 -0
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +6 -1
- package/api/@xmachines/play-dom-router/README.md +46 -18
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +149 -7
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +6 -5
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +3 -3
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +20 -8
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +27 -17
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +12 -6
- package/api/@xmachines/play-dom-router/interfaces/DisposableBrowserHistory.md +262 -0
- package/api/@xmachines/play-dom-router/interfaces/DisposableVanillaRouter.md +80 -0
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +4 -4
- 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/RouterConnection.md +105 -0
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +26 -5
- package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-react/README.md +2 -2
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +42 -7
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +10 -10
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +8 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -5
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +1 -1
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react-router/README.md +2 -2
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +172 -15
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +7 -18
- 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 +5 -5
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +10 -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-react-router/type-aliases/PlayRouterBridgeConstructor.md +15 -9
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-router/README.md +308 -11
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +178 -19
- 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/cleanFrameworkParams.md +40 -0
- 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/createRouterConnection.md +21 -0
- 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/getPatternParamNames.md +24 -0
- package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +36 -0
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRouteMappings.md +67 -0
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isMountableBridge.md +26 -0
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/joinBasePath.md +37 -0
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/mountKey.md +28 -0
- package/api/@xmachines/play-router/functions/normalizeBasePath.md +43 -0
- package/api/@xmachines/play-router/functions/openProviderBridge.md +41 -0
- package/api/@xmachines/play-router/functions/pickOwnParams.md +41 -0
- package/api/@xmachines/play-router/functions/repointProviderBridge.md +27 -0
- package/api/@xmachines/play-router/functions/resolveBasePath.md +51 -0
- package/api/@xmachines/play-router/functions/resolveFrameworkParams.md +51 -0
- 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/stripBasePath.md +44 -0
- 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/BasePathOptions.md +32 -0
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +6 -6
- package/api/@xmachines/play-router/interfaces/FrameworkParamsSource.md +47 -0
- package/api/@xmachines/play-router/interfaces/LocationLike.md +5 -5
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +5 -5
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +7 -7
- package/api/@xmachines/play-router/interfaces/MountableRouterBridge.md +130 -0
- package/api/@xmachines/play-router/interfaces/OpenProviderBridgeArgs.md +28 -0
- package/api/@xmachines/play-router/interfaces/PlayActor.md +7 -7
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-router/interfaces/PlayRouterProviderBaseProps.md +33 -0
- package/api/@xmachines/play-router/interfaces/ResolvedBasePath.md +14 -0
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +5 -5
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteNode.md +12 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteTree.md +7 -7
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +7 -3
- package/api/@xmachines/play-router/interfaces/RouterConnection.md +105 -0
- package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +1 -1
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/PlayRouterBridgeConstructor.md +36 -0
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-router/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-router/variables/NO_BASE_PATH.md +18 -0
- package/api/@xmachines/play-signals/README.md +4 -2
- package/api/@xmachines/play-signals/functions/watchSignal.md +27 -4
- 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/Cleanup.md +38 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +23 -5
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +14 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +10 -10
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +13 -5
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +19 -3
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +166 -18
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +8 -18
- 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 +5 -5
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +10 -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/PlayRouterBridgeConstructor.md +14 -12
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
- 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-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-svelte/README.md +3 -3
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +7 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +10 -10
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/README.md +3 -1
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +148 -6
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +12 -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/RouterConnection.md +105 -0
- 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 +3 -1
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +148 -6
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +28 -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/interfaces/RouterConnection.md +105 -0
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +148 -6
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +7 -18
- 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 +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +10 -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/PlayRouterBridgeConstructor.md +15 -9
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-tanstack-router/README.md +1 -1
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +153 -11
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/README.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +149 -7
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +7 -17
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +10 -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/PlayRouterBridgeConstructor.md +15 -9
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
- 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 +5 -5
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-vue/README.md +34 -12
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +6 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +12 -7
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +15 -10
- 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 +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +6 -1
- package/api/@xmachines/play-vue-router/README.md +1 -1
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +154 -12
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +25 -2
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +1 -1
- package/api/@xmachines/play-xstate/README.md +19 -2
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +53 -17
- 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 +7 -7
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
- 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 +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/play-xstate/variables/DISPOSE.md +34 -0
- package/api/@xmachines/shared/README.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/contributing/architecture.md +5 -1
- package/contributing/configuration.md +60 -18
- package/contributing/development.md +66 -44
- package/contributing/testing.md +34 -7
- package/examples/README.md +1 -1
- package/examples/multi-router-integration.md +126 -1
- package/examples/routing-patterns.md +1 -1
- package/guides/getting-started.md +7 -7
- package/guides/inspector.md +1 -1
- package/guides/signals.md +43 -0
- package/package.json +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +0 -32
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +0 -30
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +0 -32
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +0 -31
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Vanilla DOM renderer for XMachines Play architecture with signal-driven rendering.
|
|
6
6
|
|
|
7
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-dom)
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -116,7 +116,7 @@ disconnect();
|
|
|
116
116
|
|
|
117
117
|
Use `createPlayUI` when you need a render error handler, a fallback element, a navigation integration, a computed function, or a custom check. Use it also when your code needs the `registryResult` value, for example for `executeAction`.
|
|
118
118
|
|
|
119
|
-
The factory holds the factory options (`functions`, `validationFunctions`, `navigate`, `onRenderError`, and `fallback`) from the moment of its creation, and it applies them on every `mount()` call. Give the mount options (`store` and `loading`) to `mount()` itself.
|
|
119
|
+
The factory holds the factory options (`functions`, `validationFunctions`, `navigate`, `onRenderError`, `onError`, and `fallback`) from the moment of its creation, and it applies them on every `mount()` call. Give the mount options (`store` and `loading`) to `mount()` itself.
|
|
120
120
|
|
|
121
121
|
```typescript
|
|
122
122
|
import { defineRegistry, createPlayUI, schema } from "@xmachines/play-dom";
|
|
@@ -279,6 +279,69 @@ The order of the arguments is the same as in the `RenderErrorHandler` type of `@
|
|
|
279
279
|
|
|
280
280
|
Without `onRenderError`, the renderer writes all three types of error to `console.error`, then stops them. No exception goes to the caller, and no promise rejection stays unhandled.
|
|
281
281
|
|
|
282
|
+
### The renderer contains a failed rebuild — a change of behaviour in 2.3.0
|
|
283
|
+
|
|
284
|
+
**Read this if you catch what `mount()` or `connect()` throws.**
|
|
285
|
+
|
|
286
|
+
In 2.2.0 the renderer had no containment. A view that failed the rebuild threw out of
|
|
287
|
+
`mount()` and out of the callback of the signal watcher, so a `try` of the host, an error
|
|
288
|
+
boundary of the framework around it, or the global handler of the page received it.
|
|
289
|
+
|
|
290
|
+
In 2.3.0 the renderer contains such a failure ALWAYS. No option turns the containment on,
|
|
291
|
+
and no option turns it off. The renderer clears the container, it shows the `fallback`,
|
|
292
|
+
and `mount()` returns normally. A host that shows its own error page from a `catch` around
|
|
293
|
+
`mount()` sees that `catch` never again.
|
|
294
|
+
|
|
295
|
+
The four framework renderers contain a failed render always, because an error boundary of
|
|
296
|
+
a framework is not an option that a caller turns off. This change puts play-dom on the
|
|
297
|
+
same rule.
|
|
298
|
+
|
|
299
|
+
**To escalate a failure, raise it from a task of your own:**
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
const mount = createPlayUI(registryResult, {
|
|
303
|
+
onError: (err) => {
|
|
304
|
+
reportToSentry(err);
|
|
305
|
+
queueMicrotask(() => {
|
|
306
|
+
throw err; // the page keeps its own global handler
|
|
307
|
+
});
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
A throw that leaves the handler itself reaches no caller. The renderer contains it and
|
|
313
|
+
writes it to `console.error`, exactly as the four framework renderers do. The five hold
|
|
314
|
+
this one rule, so a host learns it one time and writes the same handler for each of them.
|
|
315
|
+
|
|
316
|
+
### `onError` — the failure of a complete rebuild
|
|
317
|
+
|
|
318
|
+
`onRenderError` covers one element: the inner renderer contains a render error of a component, and a rejection of an action handler, per element, and the rebuild continues. Some failures escape that boundary — a `$computed` function that throws during the resolution of a prop, for example — and they abort the complete rebuild.
|
|
319
|
+
|
|
320
|
+
`onError` receives such a failure. The renderer contains it with this option and without it: it resets the state of the failed rebuild, so that the next emission makes a complete render again, and it clears the container. `connect()` renders the first view synchronously, so a bad initial view makes `connect()` throw no more.
|
|
321
|
+
|
|
322
|
+
A write of the store takes the same path. The renderer resolves the props of every element that the write touched, so a `$computed` function that throws on the new state aborts that render too. The renderer contains such a failure as well, and the action handler that wrote the state receives no exception.
|
|
323
|
+
|
|
324
|
+
The second parameter is the **reset**, for a retry that the host starts. It renders the view that the actor holds at the moment of the call, so a retry cannot rewind the screen to the view that failed. A reset that the host calls from inside the handler does nothing, because no input changed between the two attempts, and a reset after the provider goes away does nothing. The five renderers hold the same three rules.
|
|
325
|
+
|
|
326
|
+
A reset of `PlayRenderer` belongs to ONE connection. `connect()` starts a connection, and the reset of a report of an older connection does nothing. A host that calls `connect()` again from inside the handler abandons the connection that reported. The "Retry" button of that report must not render into the connection that took its place. Call the reset of the newest report.
|
|
327
|
+
|
|
328
|
+
A fourth rule holds in all five: each of them CONTAINS a handler that throws, and writes the throw to `console.error`. A host that must escalate raises the failure from a task of its own, as the section above shows.
|
|
329
|
+
|
|
330
|
+
```typescript
|
|
331
|
+
const mount = createPlayUI(registryResult, {
|
|
332
|
+
onError: (err) => reportToSentry(err),
|
|
333
|
+
fallback: document.getElementById("crashed")!,
|
|
334
|
+
});
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
`createPlayUI` adds the parity with the framework providers: the renderer contains the failure, and it appends the `fallback` to the container that the failed rebuild left clear. A later view that renders clears the container again, which removes the fallback.
|
|
338
|
+
|
|
339
|
+
`onError` says WHERE the report goes, and `fallback` says what the empty container shows. Neither option turns the containment on. Without `onError` the renderer writes the contained error to `console.error`, in the same way as it does for a component that throws without an `onRenderError` handler. Give `onError` to send the failure to your own observability tool instead.
|
|
340
|
+
|
|
341
|
+
**One fallback element belongs to one mount.** `appendChild` moves a node. Two mounts of the same factory therefore take the element from each other on every null view, and the container of the first one goes empty without a notice. Build one element for each `mount()` call.
|
|
342
|
+
|
|
343
|
+
**A `fallback` producer that throws is contained too — on a null view and after a failed rebuild alike — and it reports to `console.error` and NOT to `onError`.** After a failed rebuild the renderer calls the producer from inside the containment of the view, so a second trip through `onError` would report the failure of your fallback as a failure of the view. The container stays empty, and the renderer renders the next view that works.
|
|
344
|
+
|
|
282
345
|
A component implementation can also read the handler at `ctx.ctx.onRenderError`. A component therefore sends its own internal errors through the same channel:
|
|
283
346
|
|
|
284
347
|
```typescript
|
|
@@ -298,14 +361,15 @@ const Home: ComponentFn<typeof catalog, "Home"> = ({ ctx }) => {
|
|
|
298
361
|
|
|
299
362
|
### XMachines Layer
|
|
300
363
|
|
|
301
|
-
| Export | Kind | Description
|
|
302
|
-
| ---------------------------------------- | -------- |
|
|
303
|
-
| `createRenderer(catalog, components)` | function | The one-call factory.
|
|
304
|
-
| `createPlayUI(registryResult, options?)` | function | The complete factory. It returns a `
|
|
305
|
-
| `PlayRenderer` | class | The renderer class, with a `connect()` and `disconnect()` lifecycle
|
|
306
|
-
| `defineRegistry(catalog, options)` | function | Build a catalog-typed `DomRegistry` with typed handlers
|
|
307
|
-
| `renderSpec(...)` | function | The pure low-level Spec → DOM renderer
|
|
308
|
-
| `schema` | const | The `@xmachines/json-render-dom` schema — pass to `defineCatalog()`
|
|
364
|
+
| Export | Kind | Description |
|
|
365
|
+
| ---------------------------------------- | -------- | ------------------------------------------------------------------- |
|
|
366
|
+
| `createRenderer(catalog, components)` | function | The one-call factory. Its `mount` hands a `Cleanup` back |
|
|
367
|
+
| `createPlayUI(registryResult, options?)` | function | The complete factory. It returns a `DisposablePlayUI` |
|
|
368
|
+
| `PlayRenderer` | class | The renderer class, with a `connect()` and `disconnect()` lifecycle |
|
|
369
|
+
| `defineRegistry(catalog, options)` | function | Build a catalog-typed `DomRegistry` with typed handlers |
|
|
370
|
+
| `renderSpec(...)` | function | The pure low-level Spec → DOM renderer |
|
|
371
|
+
| `schema` | const | The `@xmachines/json-render-dom` schema — pass to `defineCatalog()` |
|
|
372
|
+
| `Cleanup` | type | The release a mount returns, re-exported from `@xmachines/play` |
|
|
309
373
|
|
|
310
374
|
### Key Types
|
|
311
375
|
|
|
@@ -317,21 +381,23 @@ const Home: ComponentFn<typeof catalog, "Home"> = ({ ctx }) => {
|
|
|
317
381
|
| `EventHandle` | The handle that `on(eventName)` returns. It has `emit()`, `shouldPreventDefault`, and `bound` |
|
|
318
382
|
| `SetState` | State updater: `(prev => next) => void` |
|
|
319
383
|
| `DefineRegistryResult` | The result of `defineRegistry`. It has `registry`, `handlers`, and `executeAction` |
|
|
320
|
-
| `PlayDomOptions` | Options for `PlayRenderer` — extends `UIProviderOptions`
|
|
321
|
-
| `CreatePlayUIOptions` | Options for `createPlayUI` — extends `UIProviderOptions`, adds `fallback`
|
|
384
|
+
| `PlayDomOptions` | Options for `PlayRenderer` — extends `UIProviderOptions`, adds `fallback` and `onError` |
|
|
385
|
+
| `CreatePlayUIOptions` | Options for `createPlayUI` — extends `UIProviderOptions`, adds `fallback` and `onError` |
|
|
322
386
|
| `MountOptions` | Per-mount options for `MountFn`: `store`, `loading` |
|
|
323
|
-
| `MountFn` | The mount
|
|
387
|
+
| `MountFn` | The type of a mount that a consumer writes: `(actor, container, options?) → disconnect` |
|
|
388
|
+
| `DisposablePlayUI` | The mount that `createPlayUI` builds. It hands a `Cleanup` back, so `using` releases it |
|
|
324
389
|
| `UIProviderOptions` | Shared options: `functions`, `validationFunctions`, `navigate`, `onRenderError` |
|
|
325
390
|
| `BaseComponentProps<P>` | Catalog-agnostic component props for shared component libraries |
|
|
326
391
|
| `DomRegistry` | Raw registry type: `Record<string, DomComponentRenderer>` |
|
|
327
392
|
| `DomSchema` | Type of the `schema` export |
|
|
328
393
|
| `ComputedFunction` | The type of a named compute function for the `functions` option |
|
|
394
|
+
| `Cleanup` | The release of a mount, re-exported from `@xmachines/play` |
|
|
329
395
|
|
|
330
396
|
## Rendering Behavior
|
|
331
397
|
|
|
332
398
|
- **The first render is synchronous** — the renderer fills the container before `connect()` returns.
|
|
333
399
|
- **A signal-driven render waits for a microtask** — `watchSignal` puts each update on the next tick of the microtask queue.
|
|
334
|
-
- **A null view** clears the container
|
|
400
|
+
- **A null view** clears the container, and the renderer then shows the `fallback` element when you give one. It shows it for every null view, and not for the first mount only — the four framework providers hold the same rule for their placeholder content.
|
|
335
401
|
- **A second `connect()` is safe** — a `connect()` call on a connected renderer disconnects it first.
|
|
336
402
|
- **`disconnect()` clears the container** and cancels every signal watcher and store watcher.
|
|
337
403
|
|
|
@@ -354,9 +420,9 @@ The public API has two layers:
|
|
|
354
420
|
**The XMachines layer**, in this package:
|
|
355
421
|
|
|
356
422
|
- `createRenderer()` — the one-call factory. It returns `mount(actor, container, options?) → disconnect`
|
|
357
|
-
- `createPlayUI()` — the complete factory, with every option. It returns a `
|
|
423
|
+
- `createPlayUI()` — the complete factory, with every option. It returns a `DisposablePlayUI`
|
|
358
424
|
- `PlayRenderer` — the renderer class, with a `connect()` and `disconnect()` lifecycle
|
|
359
|
-
- `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `MountOptions`
|
|
425
|
+
- `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `DisposablePlayUI`, `MountOptions`
|
|
360
426
|
|
|
361
427
|
**The json-render layer**, re-exported from @xmachines/json-render-dom:
|
|
362
428
|
|
|
@@ -397,10 +463,12 @@ The public API has two layers:
|
|
|
397
463
|
- [Actions](type-aliases/Actions.md)
|
|
398
464
|
- [BaseComponentProps](type-aliases/BaseComponentProps.md)
|
|
399
465
|
- [CatalogHasActions](type-aliases/CatalogHasActions.md)
|
|
466
|
+
- [Cleanup](type-aliases/Cleanup.md)
|
|
400
467
|
- [ComponentFn](type-aliases/ComponentFn.md)
|
|
401
468
|
- [ComponentRegistry](type-aliases/ComponentRegistry.md)
|
|
402
469
|
- [ConfirmHandler](type-aliases/ConfirmHandler.md)
|
|
403
470
|
- [DefineRegistryOptions](type-aliases/DefineRegistryOptions.md)
|
|
471
|
+
- [DisposablePlayUI](type-aliases/DisposablePlayUI.md)
|
|
404
472
|
- [DomComponentRenderer](type-aliases/DomComponentRenderer.md)
|
|
405
473
|
- [DomRegistry](type-aliases/DomRegistry.md)
|
|
406
474
|
- [DomSchema](type-aliases/DomSchema.md)
|
|
@@ -2,7 +2,7 @@
|
|
|
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:131](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/PlayRenderer.ts#L131)
|
|
6
6
|
|
|
7
7
|
PlayRenderer connects the `currentView` signal of an actor to the DOM renderer.
|
|
8
8
|
|
|
@@ -63,16 +63,16 @@ new PlayRenderer(
|
|
|
63
63
|
options?): PlayRenderer;
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
Defined in: [packages/play-dom/src/PlayRenderer.ts:
|
|
66
|
+
Defined in: [packages/play-dom/src/PlayRenderer.ts:225](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/PlayRenderer.ts#L225)
|
|
67
67
|
|
|
68
68
|
#### Parameters
|
|
69
69
|
|
|
70
|
-
| Parameter | Type | Description
|
|
71
|
-
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
72
|
-
| `container` | `HTMLElement` | The `HTMLElement` to render into. Each view transition clears it and fills it again.
|
|
73
|
-
| `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) | The actor with the `currentView` signal. It must implement `Viewable`.
|
|
74
|
-
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | The map of the component renderers, usually `registryResult.registry` from `defineRegistry`.
|
|
75
|
-
| `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | The configuration. See [PlayDomOptions](../interfaces/PlayDomOptions.md): - `registryResult` — it connects `setState` and `state` of the xstate store for you. - `store` — an external `StateStore`, which is the controlled mode. It replaces the values of `spec.state`. - `loading` — the flag of the streaming mode. It stops each warning about an absent child. - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. It stops the `console.error` fallback. |
|
|
70
|
+
| Parameter | Type | Description |
|
|
71
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
72
|
+
| `container` | `HTMLElement` | The `HTMLElement` to render into. Each view transition clears it and fills it again. |
|
|
73
|
+
| `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) | The actor with the `currentView` signal. It must implement `Viewable`. |
|
|
74
|
+
| `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | The map of the component renderers, usually `registryResult.registry` from `defineRegistry`. |
|
|
75
|
+
| `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | The configuration. See [PlayDomOptions](../interfaces/PlayDomOptions.md): - `registryResult` — it connects `setState` and `state` of the xstate store for you. - `store` — an external `StateStore`, which is the controlled mode. It replaces the values of `spec.state`. - `loading` — the flag of the streaming mode. It stops each warning about an absent child. - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. It stops the `console.error` fallback. - `onError` — the `(error, reset)` handler of a failure of a complete rebuild. The renderer contains such a failure always, and this option says where the report goes. - `fallback` — the element to show for every null view, and after a contained failure. |
|
|
76
76
|
|
|
77
77
|
#### Returns
|
|
78
78
|
|
|
@@ -86,7 +86,7 @@ Defined in: [packages/play-dom/src/PlayRenderer.ts:130](https://gitlab.com/xmach
|
|
|
86
86
|
connect(): void;
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
Defined in: [packages/play-dom/src/PlayRenderer.ts:
|
|
89
|
+
Defined in: [packages/play-dom/src/PlayRenderer.ts:241](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/PlayRenderer.ts#L241)
|
|
90
90
|
|
|
91
91
|
Starts the watch of actor.currentView, and renders into the container.
|
|
92
92
|
It renders the first view synchronously, then it subscribes to the signal changes.
|
|
@@ -108,7 +108,7 @@ renderer first.
|
|
|
108
108
|
disconnect(): void;
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
Defined in: [packages/play-dom/src/PlayRenderer.ts:
|
|
111
|
+
Defined in: [packages/play-dom/src/PlayRenderer.ts:285](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/PlayRenderer.ts#L285)
|
|
112
112
|
|
|
113
113
|
Stops the watch and clears the container.
|
|
114
114
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
# Function: createPlayUI()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function createPlayUI(registryResult, options?):
|
|
6
|
+
function createPlayUI(registryResult, options?): DisposablePlayUI;
|
|
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:126](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-play-ui.ts#L126)
|
|
10
10
|
|
|
11
11
|
Creates the mount function of the complete DOM renderer.
|
|
12
12
|
|
|
@@ -16,13 +16,13 @@ and a container.
|
|
|
16
16
|
|
|
17
17
|
## Parameters
|
|
18
18
|
|
|
19
|
-
| Parameter | Type | Description
|
|
20
|
-
| ---------------- | --------------------------------------------------------------- |
|
|
21
|
-
| `registryResult` | [`DefineRegistryResult`](../interfaces/DefineRegistryResult.md) | The result of `defineRegistry()`. It gives the registry and the factory of the handlers, which it builds late.
|
|
22
|
-
| `options` | [`CreatePlayUIOptions`](../interfaces/CreatePlayUIOptions.md) | The factory configuration. See [CreatePlayUIOptions](../interfaces/CreatePlayUIOptions.md): - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. - `fallback` — the
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| ---------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
21
|
+
| `registryResult` | [`DefineRegistryResult`](../interfaces/DefineRegistryResult.md) | The result of `defineRegistry()`. It gives the registry and the factory of the handlers, which it builds late. |
|
|
22
|
+
| `options` | [`CreatePlayUIOptions`](../interfaces/CreatePlayUIOptions.md) | The factory configuration. See [CreatePlayUIOptions](../interfaces/CreatePlayUIOptions.md): - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. - `onError` — the `(error, reset)` handler of a failure of a complete rebuild. The renderer contains such a failure always, and this option says where the report goes. - `fallback` — the content to show when the view of the actor is `null`, and after a contained failure of a rebuild. Give a FUNCTION when the factory mounts more than one time, so that each renderer owns its own element. |
|
|
23
23
|
|
|
24
24
|
## Returns
|
|
25
25
|
|
|
26
|
-
[`
|
|
26
|
+
[`DisposablePlayUI`](../type-aliases/DisposablePlayUI.md)
|
|
27
27
|
|
|
28
|
-
The
|
|
28
|
+
The [DisposablePlayUI](../type-aliases/DisposablePlayUI.md): `(actor, container, mountOptions?) → disconnect`
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
# Function: createRenderer()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function createRenderer<C>(catalog, componentMap): (actor, container, options?) =>
|
|
6
|
+
function createRenderer<C>(catalog, componentMap): (actor, container, options?) => Cleanup;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-dom/src/create-renderer.ts:
|
|
9
|
+
Defined in: [packages/play-dom/src/create-renderer.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-renderer.ts#L89)
|
|
10
10
|
|
|
11
11
|
Creates a DOM renderer factory from a catalog and a component map. You can use
|
|
12
12
|
the factory more than one time.
|
|
@@ -31,7 +31,7 @@ the PlayRenderer in one call, and it returns a `disconnect` cleanup function.
|
|
|
31
31
|
|
|
32
32
|
A `mount` function. It accepts `(actor, container, options?)`, and it returns `disconnect`.
|
|
33
33
|
|
|
34
|
-
(`actor`, `container`, `options?`) => ()
|
|
34
|
+
(`actor`, `container`, `options?`) => [`Cleanup`](../type-aliases/Cleanup.md)
|
|
35
35
|
|
|
36
36
|
## Remarks
|
|
37
37
|
|
|
@@ -2,7 +2,7 @@
|
|
|
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:152](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/types.ts#L152)
|
|
6
6
|
|
|
7
7
|
The options of `createPlayUI()`, the complete DOM factory.
|
|
8
8
|
|
|
@@ -11,6 +11,11 @@ This type extends [UIProviderOptions](UIProviderOptions.md), which gives `functi
|
|
|
11
11
|
holds all of them from the moment of its creation, and it gives them to
|
|
12
12
|
`PlayRenderer` on every `mount()` call.
|
|
13
13
|
|
|
14
|
+
It also takes [PlayDomOptions.onError](PlayDomOptions.md#property-onerror), which the factory forwards without a
|
|
15
|
+
change: `PlayRenderer` owns it, and it receives every failure of a rebuild that the
|
|
16
|
+
renderer contains. Read that entry for the complete rule. `fallback` below says what
|
|
17
|
+
the factory adds to [PlayDomOptions.fallback](PlayDomOptions.md#property-fallback).
|
|
18
|
+
|
|
14
19
|
This type is parallel to the props of `PlayUIProvider` in the framework renderers.
|
|
15
20
|
|
|
16
21
|
## See
|
|
@@ -19,16 +24,17 @@ createPlayUI
|
|
|
19
24
|
|
|
20
25
|
## Extends
|
|
21
26
|
|
|
22
|
-
- [`UIProviderOptions`](UIProviderOptions.md)
|
|
27
|
+
- [`UIProviderOptions`](UIProviderOptions.md).`Pick`\<[`PlayDomOptions`](PlayDomOptions.md), `"onError"`\>
|
|
23
28
|
|
|
24
29
|
## Properties
|
|
25
30
|
|
|
26
|
-
| Property | Type | Description
|
|
27
|
-
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
28
|
-
| <a id="property-directives"></a> `directives?` | `DirectiveDefinition`\<`ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\>\>[] | Custom directives — user-defined `$`-prefixed dynamic values that extend the spec expression language (e.g. `{ $format: "currency", value: ... }`). Each entry is a `DirectiveDefinition` built with `defineDirective` from `@xmachines/json-render-core`. The array is converted to a `DirectiveRegistry` once per render pass and forwarded to `resolveElementProps` via `PropResolutionContext.directives`. Built-in expressions (`$state`, `$cond`, etc.) always take precedence over custom directives. Mirrors the `directives` prop on `JSONUIProvider` / `JsonUIProvider` introduced in **Json-render** 0.19. **Example** `import { defineDirective, resolvePropValue } from "@xmachines/json-render-core"; import { z } from "zod"; const formatDirective = defineDirective({ name: "$format", description: "Locale-aware number formatting.", schema: z.object({ $format: z.enum(["number", "currency"]), value: z.unknown() }), resolve(value, ctx) { const resolved = resolvePropValue(value.value, ctx); return new Intl.NumberFormat().format(resolved as number); }, }); renderSpec(spec, store, registry, { directives: [formatDirective] });`
|
|
29
|
-
| <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| `null`
|
|
30
|
-
| <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** `renderSpec(spec, store, registry, { functions: { fullName: (args) => `${args.first} ${args.last}`, formatCurrency: (args) => new Intl.NumberFormat().format(args.amount as number), }, });` Mirrors the `functions` prop on `JSONUIProvider` / `JsonUIProvider`.
|
|
31
|
-
| <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(); renderSpec(spec, store, registry, { navigate });` Spec binding that triggers navigation: `{ "on": { "click": { "action": "doSomething", "onSuccess": { "navigate": "/dashboard" } } } }`
|
|
32
|
-
| <a id="property-onconfirm"></a> `onConfirm?` | [`ConfirmHandler`](../type-aliases/ConfirmHandler.md) | Confirmation hook for actions that declare `confirm` in their binding. Consulted by `emit()` before executing a confirm-gated action. Return (or resolve) `true` to execute, `false` to skip. Without this handler, confirm-gated actions are skipped with a `console.warn` — they never execute unconfirmed. See [ConfirmHandler](../type-aliases/ConfirmHandler.md) for the full contract. This is the headless equivalent of the `pendingConfirmation` / `confirmAction()` / `cancelAction()` flow in the framework adapters.
|
|
33
|
-
| <a id="property-
|
|
34
|
-
| <a id="property-
|
|
31
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
32
|
+
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| <a id="property-directives"></a> `directives?` | `DirectiveDefinition`\<`ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\>\>[] | Custom directives — user-defined `$`-prefixed dynamic values that extend the spec expression language (e.g. `{ $format: "currency", value: ... }`). Each entry is a `DirectiveDefinition` built with `defineDirective` from `@xmachines/json-render-core`. The array is converted to a `DirectiveRegistry` once per render pass and forwarded to `resolveElementProps` via `PropResolutionContext.directives`. Built-in expressions (`$state`, `$cond`, etc.) always take precedence over custom directives. Mirrors the `directives` prop on `JSONUIProvider` / `JsonUIProvider` introduced in **Json-render** 0.19. **Example** `import { defineDirective, resolvePropValue } from "@xmachines/json-render-core"; import { z } from "zod"; const formatDirective = defineDirective({ name: "$format", description: "Locale-aware number formatting.", schema: z.object({ $format: z.enum(["number", "currency"]), value: z.unknown() }), resolve(value, ctx) { const resolved = resolvePropValue(value.value, ctx); return new Intl.NumberFormat().format(resolved as number); }, }); renderSpec(spec, store, registry, { directives: [formatDirective] });` | [`UIProviderOptions`](UIProviderOptions.md).[`directives`](UIProviderOptions.md#property-directives) | - |
|
|
34
|
+
| <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| (() => `HTMLElement`) \| `null` | The optional fallback content — see [PlayDomOptions.fallback](PlayDomOptions.md#property-fallback) for what the renderer does with it. The factory shows it for every null view, and after a failure of a rebuild that the renderer contains. **Give a FUNCTION when the factory mounts more than one time.** ONE factory serves every `mount()` call, and `appendChild` MOVES a node. A single element therefore passes from one container to the next on every null view, and the container that loses it goes empty without a notice. A function runs one time for each mount, so every renderer owns its own element: `const mount = createPlayUI(registryResult, { fallback: () => { const element = document.createElement("p"); element.textContent = "Loading…"; return element; }, });` An element stays correct for a factory that mounts one time. | - | [packages/play-dom/src/types.ts:176](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/types.ts#L176) |
|
|
35
|
+
| <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** `renderSpec(spec, store, registry, { 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) | - |
|
|
36
|
+
| <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(); renderSpec(spec, store, registry, { navigate });` Spec binding that triggers navigation: `{ "on": { "click": { "action": "doSomething", "onSuccess": { "navigate": "/dashboard" } } } }` | [`UIProviderOptions`](UIProviderOptions.md).[`navigate`](UIProviderOptions.md#property-navigate) | - |
|
|
37
|
+
| <a id="property-onconfirm"></a> `onConfirm?` | [`ConfirmHandler`](../type-aliases/ConfirmHandler.md) | Confirmation hook for actions that declare `confirm` in their binding. Consulted by `emit()` before executing a confirm-gated action. Return (or resolve) `true` to execute, `false` to skip. Without this handler, confirm-gated actions are skipped with a `console.warn` — they never execute unconfirmed. See [ConfirmHandler](../type-aliases/ConfirmHandler.md) for the full contract. This is the headless equivalent of the `pendingConfirmation` / `confirmAction()` / `cancelAction()` flow in the framework adapters. | [`UIProviderOptions`](UIProviderOptions.md).[`onConfirm`](UIProviderOptions.md#property-onconfirm) | - |
|
|
38
|
+
| <a id="property-onerror"></a> `onError?` | (`error`, `reset`) => `void` | The optional handler of a failure of a complete rebuild of the view. This option is NOT the same as `onRenderError`, which [UIProviderOptions](UIProviderOptions.md) gives: the inner renderer routes a render error of one component, and a rejection of one action handler, to `onRenderError`. It contains each of them per element, and the rebuild continues. `onError` receives the failure of the complete rebuild that no per-element boundary caught. The renderer CONTAINS a rebuild that throws, with this option and without it: it resets the state of the failed rebuild, so that the next emission makes a complete render again, and it clears the container. `connect()` renders the first view synchronously, so a bad initial view makes `connect()` throw no more. A WRITE of the store takes the same path. The renderer resolves the props of every element that the write touched, so a `$computed` function that throws on the new state aborts that render too. The renderer contains such a failure as well, and the action handler that wrote the state receives no exception. This option says WHERE the report goes. Without it, the renderer writes the contained failure to `console.error`. A handler that THROWS reaches no caller: the renderer contains that throw too, and it writes the throw to `console.error`. A host that must escalate a failure raises it from a task of its own — `queueMicrotask(() => { throw error; })` — which reaches the global handler of the page and leaves the containment whole. The five renderers hold this one rule. The second parameter is the RESET, for a retry that the host starts — a "Retry" button of its own. It renders the view that the actor holds at the MOMENT OF THE CALL, so a host that keeps the callback cannot rewind the screen to the view that failed. A reset that the host calls from inside this handler does nothing, because no input changed between the two attempts, and a reset after `disconnect()` does nothing. A reset belongs to ONE connection. `connect()` starts a connection, and the reset of a report of an older connection does nothing. A host that calls `connect()` again from inside this handler abandons the connection that reported. The "Retry" button of that report must not render into the connection that took its place. Call the reset of the newest report. This option matches the `onError` prop of the framework renderer providers, and the five renderers hold the same three rules for the reset. | [`PlayDomOptions`](PlayDomOptions.md).[`onError`](PlayDomOptions.md#property-onerror) | [packages/play-dom/src/types.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/types.ts#L100) |
|
|
39
|
+
| <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** `renderSpec(spec, store, registry, { onRenderError: (err, name) => { myErrorReporter.capture(err, { context: name }); }, });` | [`UIProviderOptions`](UIProviderOptions.md).[`onRenderError`](UIProviderOptions.md#property-onrendererror) | - |
|
|
40
|
+
| <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 `@xmachines/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 "@xmachines/json-render-core"; renderSpec(spec, store, registry, { 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) | - |
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: MountOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-dom/src/create-play-ui.ts:
|
|
5
|
+
Defined in: [packages/play-dom/src/create-play-ui.ts:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-play-ui.ts#L51)
|
|
6
6
|
|
|
7
7
|
The mount options of the `MountFn` that `createPlayUI` returns.
|
|
8
8
|
|
|
9
9
|
They replace or complete the factory options, for one actor and one container.
|
|
10
10
|
The `createPlayUI` call sets the factory options (`functions`,
|
|
11
|
-
`validationFunctions`, `navigate`, `onRenderError`, and `fallback`) one
|
|
11
|
+
`validationFunctions`, `navigate`, `onRenderError`, `onError`, and `fallback`) one
|
|
12
|
+
time.
|
|
12
13
|
|
|
13
14
|
## Properties
|
|
14
15
|
|
|
15
16
|
| Property | Type | Description | Defined in |
|
|
16
17
|
| ---------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
-
| <a id="property-loading"></a> `loading?` | `boolean` | With the value `true`, the renderer stops each warning about an absent child during the ingestion of a streaming spec. It also gives `ctx.ctx.loading` to each component implementation. | [packages/play-dom/src/create-play-ui.ts:
|
|
18
|
-
| <a id="property-store"></a> `store?` | `StateStore` | The optional external `StateStore`, which is the controlled mode. Without it, the renderer makes a new `@xstate/store` atom for each view transition, with the values of `spec.state`. | [packages/play-dom/src/create-play-ui.ts:
|
|
18
|
+
| <a id="property-loading"></a> `loading?` | `boolean` | With the value `true`, the renderer stops each warning about an absent child during the ingestion of a streaming spec. It also gives `ctx.ctx.loading` to each component implementation. | [packages/play-dom/src/create-play-ui.ts:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-play-ui.ts#L63) |
|
|
19
|
+
| <a id="property-store"></a> `store?` | `StateStore` | The optional external `StateStore`, which is the controlled mode. Without it, the renderer makes a new `@xstate/store` atom for each view transition, with the values of `spec.state`. | [packages/play-dom/src/create-play-ui.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-play-ui.ts#L57) |
|