@xmachines/play-react 1.0.0-beta.2 → 1.0.0-beta.21

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.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * PlayErrorBoundary - React error boundary for catching catalog component render errors
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import React from "react";
7
+ /**
8
+ * React class component error boundary for catching catalog component render errors.
9
+ *
10
+ * Wraps catalog component renders so failures are caught and forwarded to standard
11
+ * React error boundary protocol. Consumers can attach the `onError` prop to forward
12
+ * errors to production observability tools (Sentry, Datadog, etc.).
13
+ *
14
+ * **React 19 safety (Phase 29):** `componentDidCatch` calls `onError` for observability
15
+ * but does NOT re-throw. `getDerivedStateFromError` already sets the fallback state —
16
+ * re-throwing from `componentDidCatch` can unmount the entire React 19 root.
17
+ *
18
+ * Per CONS-14: Class component pattern works with all React versions (18 and 19).
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <PlayErrorBoundary fallback={<div>Something went wrong</div>} onError={Sentry.captureException}>
23
+ * <CatalogComponent {...props} />
24
+ * </PlayErrorBoundary>
25
+ * ```
26
+ */
27
+ export class PlayErrorBoundary extends React.Component {
28
+ constructor(props) {
29
+ super(props);
30
+ this.state = { hasError: false, error: null };
31
+ }
32
+ static getDerivedStateFromError(error) {
33
+ return { hasError: true, error };
34
+ }
35
+ componentDidCatch(error, info) {
36
+ this.props.onError?.(error, info);
37
+ }
38
+ render() {
39
+ if (this.state.hasError) {
40
+ return this.props.fallback ?? null;
41
+ }
42
+ return this.props.children;
43
+ }
44
+ }
45
+ //# sourceMappingURL=PlayErrorBoundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlayErrorBoundary.js","sourceRoot":"","sources":["../src/PlayErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK,CAAC,SAG5C;IACA,YAAY,KAA6B;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC3C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC;IAEQ,iBAAiB,CAAC,KAAY,EAAE,IAAqB;QAC7D,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAEQ,MAAM;QACd,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC;QACpC,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC5B,CAAC;CACD"}
@@ -1,18 +1,24 @@
1
1
  /**
2
2
  * PlayRenderer - Main React renderer component for XMachines Play architecture
3
3
  *
4
+ * Backed by @json-render/react for spec-driven UI rendering.
5
+ *
4
6
  * @packageDocumentation
5
7
  */
6
8
  import React from "react";
7
9
  import type { PlayRendererProps } from "./types.js";
8
10
  /**
9
11
  * Main renderer component that subscribes to actor signals and renders UI
12
+ * via @json-render/react Renderer.
10
13
  *
11
- * Architecture (per RESEARCH.md Pattern 1):
14
+ * Architecture:
12
15
  * - Subscribes to actor.currentView signal via useSignalEffect
13
- * - Dynamically renders catalog components based on view.component string
14
- * - Forwards user events to actor via actor.send()
15
- * - React state only for triggering renders, NOT business logic
16
+ * - Renders view.spec via StateProvider ActionProvider VisibilityProvider → Renderer
17
+ * - Routes action names to actor.send() via the `actions` prop mapping
18
+ * - State store: uses external `store` prop if provided (controlled mode); otherwise
19
+ * creates a fresh @xstate/store atom per view transition seeded from spec.state.
20
+ * The atom resets automatically when the actor transitions to a new view, mirroring
21
+ * the actor's currentView lifecycle.
16
22
  *
17
23
  * Invariant: Actor Authority - Actor decides all state transitions via guards.
18
24
  * Invariant: Passive Infrastructure - Component observes signals and sends events.
@@ -21,37 +27,22 @@ import type { PlayRendererProps } from "./types.js";
21
27
  * @example
22
28
  * ```typescript
23
29
  * import { PlayRenderer } from "@xmachines/play-react";
24
- * import { definePlayer } from "@xmachines/play-xstate";
30
+ * import { defineRegistry } from "@json-render/react";
25
31
  *
26
- * const actor = definePlayer({ machine, catalog })();
27
- * actor.start();
32
+ * const { registry } = defineRegistry(catalog, { components: { ... } });
28
33
  *
29
- * const components = {
30
- * Dashboard: ({ userId, send }) => <div>User: {userId}</div>,
31
- * LoginForm: ({ error, send }) => <form onSubmit={(e) => {
32
- * e.preventDefault();
33
- * send({ type: "intent", name: "login.submit", payload: {...} });
34
- * }}>...</form>
35
- * };
34
+ * // Uncontrolled fresh atom created per view, seeded from spec.state:
35
+ * <PlayRenderer actor={actor} registry={registry} actions={{ login: "auth.login" }} />
36
36
  *
37
- * <PlayRenderer actor={actor} components={components} />
37
+ * // Controlled caller provides and owns the store:
38
+ * import { createAtom } from "@xstate/store";
39
+ * import { xstateStoreStateStore } from "@json-render/xstate";
40
+ * const store = xstateStoreStateStore({ atom: createAtom({ username: "" }) });
41
+ * <PlayRenderer actor={actor} registry={registry} store={store} actions={{ login: "auth.login" }} />
38
42
  * ```
39
43
  *
40
44
  * @param props - Component props
41
45
  * @returns React element rendering current view from actor
42
- *
43
- * @remarks
44
- * **Component lookup:** Dynamically looks up component from `components` map
45
- * using `view.component` string from actor.currentView signal.
46
- *
47
- * **Event forwarding:** Injects `send` function as prop to components. Components
48
- * call `send(event)` to forward intents to actor. Actor guards decide validity.
49
- *
50
- * **Error handling:** If component not found in catalog, logs error and shows
51
- * fallback. This indicates missing component registration, not runtime error.
52
- *
53
- * **CRITICAL:** Never call actor.send() during render - only in event handlers.
54
- * Calling send during render causes infinite render loops.
55
46
  */
56
47
  export declare const PlayRenderer: React.FC<PlayRendererProps>;
57
48
  //# sourceMappingURL=PlayRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlayRenderer.d.ts","sourceRoot":"","sources":["../src/PlayRenderer.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2CpD,CAAC"}
1
+ {"version":3,"file":"PlayRenderer.d.ts","sourceRoot":"","sources":["../src/PlayRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA2B,MAAM,OAAO,CAAC;AAOhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAYpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoEpD,CAAC"}
@@ -2,18 +2,36 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  /**
3
3
  * PlayRenderer - Main React renderer component for XMachines Play architecture
4
4
  *
5
+ * Backed by @json-render/react for spec-driven UI rendering.
6
+ *
5
7
  * @packageDocumentation
6
8
  */
7
- import React, { useState } from "react";
9
+ import React, { useState, useRef } from "react";
10
+ import { Renderer, StateProvider, ActionProvider, VisibilityProvider } from "@json-render/react";
11
+ import { createAtom } from "@xstate/store";
12
+ import { xstateStoreStateStore } from "@json-render/xstate";
8
13
  import { useSignalEffect } from "./useSignalEffect.js";
14
+ import { PlayErrorBoundary } from "./PlayErrorBoundary.js";
15
+ import { ActorContext } from "./useActor.js";
16
+ /**
17
+ * Create a StateStore backed by a fresh @xstate/store atom seeded from the given state.
18
+ * Called internally per view transition when no external store prop is provided.
19
+ */
20
+ function createViewStore(initialState) {
21
+ return xstateStoreStateStore({ atom: createAtom(initialState) });
22
+ }
9
23
  /**
10
24
  * Main renderer component that subscribes to actor signals and renders UI
25
+ * via @json-render/react Renderer.
11
26
  *
12
- * Architecture (per RESEARCH.md Pattern 1):
27
+ * Architecture:
13
28
  * - Subscribes to actor.currentView signal via useSignalEffect
14
- * - Dynamically renders catalog components based on view.component string
15
- * - Forwards user events to actor via actor.send()
16
- * - React state only for triggering renders, NOT business logic
29
+ * - Renders view.spec via StateProvider ActionProvider VisibilityProvider → Renderer
30
+ * - Routes action names to actor.send() via the `actions` prop mapping
31
+ * - State store: uses external `store` prop if provided (controlled mode); otherwise
32
+ * creates a fresh @xstate/store atom per view transition seeded from spec.state.
33
+ * The atom resets automatically when the actor transitions to a new view, mirroring
34
+ * the actor's currentView lifecycle.
17
35
  *
18
36
  * Invariant: Actor Authority - Actor decides all state transitions via guards.
19
37
  * Invariant: Passive Infrastructure - Component observes signals and sends events.
@@ -22,66 +40,64 @@ import { useSignalEffect } from "./useSignalEffect.js";
22
40
  * @example
23
41
  * ```typescript
24
42
  * import { PlayRenderer } from "@xmachines/play-react";
25
- * import { definePlayer } from "@xmachines/play-xstate";
43
+ * import { defineRegistry } from "@json-render/react";
26
44
  *
27
- * const actor = definePlayer({ machine, catalog })();
28
- * actor.start();
45
+ * const { registry } = defineRegistry(catalog, { components: { ... } });
29
46
  *
30
- * const components = {
31
- * Dashboard: ({ userId, send }) => <div>User: {userId}</div>,
32
- * LoginForm: ({ error, send }) => <form onSubmit={(e) => {
33
- * e.preventDefault();
34
- * send({ type: "intent", name: "login.submit", payload: {...} });
35
- * }}>...</form>
36
- * };
47
+ * // Uncontrolled fresh atom created per view, seeded from spec.state:
48
+ * <PlayRenderer actor={actor} registry={registry} actions={{ login: "auth.login" }} />
37
49
  *
38
- * <PlayRenderer actor={actor} components={components} />
50
+ * // Controlled caller provides and owns the store:
51
+ * import { createAtom } from "@xstate/store";
52
+ * import { xstateStoreStateStore } from "@json-render/xstate";
53
+ * const store = xstateStoreStateStore({ atom: createAtom({ username: "" }) });
54
+ * <PlayRenderer actor={actor} registry={registry} store={store} actions={{ login: "auth.login" }} />
39
55
  * ```
40
56
  *
41
57
  * @param props - Component props
42
58
  * @returns React element rendering current view from actor
43
- *
44
- * @remarks
45
- * **Component lookup:** Dynamically looks up component from `components` map
46
- * using `view.component` string from actor.currentView signal.
47
- *
48
- * **Event forwarding:** Injects `send` function as prop to components. Components
49
- * call `send(event)` to forward intents to actor. Actor guards decide validity.
50
- *
51
- * **Error handling:** If component not found in catalog, logs error and shows
52
- * fallback. This indicates missing component registration, not runtime error.
53
- *
54
- * **CRITICAL:** Never call actor.send() during render - only in event handlers.
55
- * Calling send during render causes infinite render loops.
56
59
  */
57
- export const PlayRenderer = ({ actor, components, fallback = null, }) => {
60
+ export const PlayRenderer = ({ actor, registry, store: externalStore, fallback = null, actions = {}, }) => {
58
61
  // React state for triggering re-renders (NOT business logic state)
59
62
  // Signal is source of truth, useState is just React's render trigger
60
63
  const [view, setView] = useState(() => actor.currentView.get());
64
+ // Internal store ref — tracks the current per-view atom store.
65
+ // Keyed to view identity: recreated whenever the view changes (new spec.state seed).
66
+ // Ignored when externalStore is provided.
67
+ const internalStoreRef = useRef(null);
68
+ const lastViewRef = useRef(null);
61
69
  // Subscribe to signal changes
62
70
  useSignalEffect(() => {
63
71
  const currentView = actor.currentView.get();
64
72
  setView(currentView);
65
73
  });
66
- // No view in current state
74
+ // No view in current state — render fallback
67
75
  if (!view) {
68
76
  return _jsx(_Fragment, { children: fallback });
69
77
  }
70
- // Handle null/undefined components catalog gracefully
71
- if (!components) {
72
- console.error(`Components catalog is ${components === null ? "null" : "undefined"}. ` +
73
- `Cannot render component "${view.component}".`);
74
- return _jsx(_Fragment, { children: fallback });
78
+ // Resolve the store to use for StateProvider:
79
+ // - External (controlled): use as-is, caller manages lifecycle
80
+ // - Internal: create a fresh atom when the view changes (new route/state)
81
+ let store;
82
+ if (externalStore) {
83
+ store = externalStore;
75
84
  }
76
- // Look up component from catalog
77
- const Component = components[view.component];
78
- if (!Component) {
79
- console.error(`Component "${view.component}" not found in catalog. ` +
80
- `Available components: ${Object.keys(components).join(", ")}`);
81
- return _jsx(_Fragment, { children: fallback });
85
+ else {
86
+ // Recreate the internal store when the view identity changes
87
+ // (view is a new object on every transition per deriveCurrentView)
88
+ if (internalStoreRef.current === null || lastViewRef.current !== view) {
89
+ const initialState = view.spec?.state ?? {};
90
+ internalStoreRef.current = createViewStore(initialState);
91
+ lastViewRef.current = view;
92
+ }
93
+ store = internalStoreRef.current;
82
94
  }
83
- // Render with props from actor + send function
84
- // bind(actor) ensures 'this' context is correct when components call send()
85
- return _jsx(Component, { ...view.props, send: actor.send.bind(actor) });
95
+ // Build ActionProvider handlers from actions mapping
96
+ // Each handler calls actor.send() with the configured event type + params
97
+ const handlers = Object.fromEntries(Object.entries(actions).map(([actionName, eventType]) => [
98
+ actionName,
99
+ async (params = {}) => actor.send({ type: eventType, ...params }),
100
+ ]));
101
+ return (_jsx(ActorContext.Provider, { value: actor, children: _jsx(PlayErrorBoundary, { fallback: fallback, children: _jsx(StateProvider, { store: store, children: _jsx(ActionProvider, { handlers: handlers, children: _jsx(VisibilityProvider, { children: _jsx(Renderer, { spec: view.spec ?? null, registry: registry }) }) }) }) }) }));
86
102
  };
87
103
  //# sourceMappingURL=PlayRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlayRenderer.js","sourceRoot":"","sources":["../src/PlayRenderer.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,CAAC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AC/C,KAAC,iBAAiB,IAAC,QAAQ,EAAE,QAAQ,YACpC,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAC1B,KAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,YACjC,KAAC,kBAAkB,cAClB,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAI,GACrC,GACL,GACF,GACG,GACG,CACxB,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { PlayError } from "@xmachines/play";
2
+ /**
3
+ * Error class for renderer-level errors in the Play architecture.
4
+ *
5
+ * **Note (Phase 29):** `PlayErrorBoundary.componentDidCatch()` no longer throws
6
+ * this error. Re-throwing from `componentDidCatch` can unmount the entire React 19
7
+ * root. `RendererError` is retained for programmatic use in custom error handlers
8
+ * and parent boundaries — it is no longer emitted by the built-in boundary itself.
9
+ *
10
+ * **Error code:** `PLAY_RENDERER_RENDER_ERROR`
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { RendererError } from "@xmachines/play-react/errors";
15
+ *
16
+ * // Create a RendererError programmatically in a custom boundary:
17
+ * throw new RendererError("Custom render failure", { cause: originalError });
18
+ * ```
19
+ */
20
+ export declare class RendererError extends PlayError {
21
+ constructor(message: string, options?: ErrorOptions);
22
+ }
23
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,aAAc,SAAQ,SAAS;gBAC/B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAInD"}
package/dist/errors.js ADDED
@@ -0,0 +1,26 @@
1
+ import { PlayError } from "@xmachines/play";
2
+ /**
3
+ * Error class for renderer-level errors in the Play architecture.
4
+ *
5
+ * **Note (Phase 29):** `PlayErrorBoundary.componentDidCatch()` no longer throws
6
+ * this error. Re-throwing from `componentDidCatch` can unmount the entire React 19
7
+ * root. `RendererError` is retained for programmatic use in custom error handlers
8
+ * and parent boundaries — it is no longer emitted by the built-in boundary itself.
9
+ *
10
+ * **Error code:** `PLAY_RENDERER_RENDER_ERROR`
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { RendererError } from "@xmachines/play-react/errors";
15
+ *
16
+ * // Create a RendererError programmatically in a custom boundary:
17
+ * throw new RendererError("Custom render failure", { cause: originalError });
18
+ * ```
19
+ */
20
+ export class RendererError extends PlayError {
21
+ constructor(message, options) {
22
+ super("PlayRenderer", "PLAY_RENDERER_RENDER_ERROR", message, options);
23
+ this.name = "RendererError";
24
+ }
25
+ }
26
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAS;IAC3C,YAAY,OAAe,EAAE,OAAsB;QAClD,KAAK,CAAC,cAAc,EAAE,4BAA4B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC7B,CAAC;CACD"}
package/dist/index.d.ts CHANGED
@@ -2,17 +2,27 @@
2
2
  * @xmachines/play-react - React renderer for XMachines Play architecture
3
3
  *
4
4
  * Provides a thin React rendering layer that passively observes actor signals
5
- * and renders UI components from catalog definitions. This package enables
5
+ * and renders UI components via @json-render/react. This package enables
6
6
  * framework-swappable architecture where React is just a rendering target
7
7
  * that subscribes to signal changes.
8
8
  *
9
9
  * **Key principle:** React state is NEVER used for business logic—only for
10
10
  * triggering React's render cycle. Signals are the source of truth.
11
11
  *
12
+ * Re-exports `defineRegistry`, `useStateBinding`, `ComponentFn`, and
13
+ * `ComponentContext` from `@json-render/react` so consumers import everything
14
+ * from `@xmachines/play-react` rather than `@json-render/react` directly.
15
+ *
12
16
  * @packageDocumentation
13
17
  * @module @xmachines/play-react
14
18
  */
15
19
  export { PlayRenderer } from "./PlayRenderer.js";
16
20
  export { useSignalEffect } from "./useSignalEffect.js";
21
+ export { PlayErrorBoundary } from "./PlayErrorBoundary.js";
22
+ export { useActor } from "./useActor.js";
23
+ export { defineRegistry, useStateBinding, useBoundProp } from "@json-render/react";
24
+ export type { ComponentFn, ComponentContext } from "@json-render/react";
17
25
  export type { PlayRendererProps } from "./types.js";
26
+ export type { PlayErrorBoundaryProps, PlayErrorBoundaryState } from "./PlayErrorBoundary.js";
27
+ export type { PlayActor } from "./useActor.js";
18
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnF,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -2,17 +2,26 @@
2
2
  * @xmachines/play-react - React renderer for XMachines Play architecture
3
3
  *
4
4
  * Provides a thin React rendering layer that passively observes actor signals
5
- * and renders UI components from catalog definitions. This package enables
5
+ * and renders UI components via @json-render/react. This package enables
6
6
  * framework-swappable architecture where React is just a rendering target
7
7
  * that subscribes to signal changes.
8
8
  *
9
9
  * **Key principle:** React state is NEVER used for business logic—only for
10
10
  * triggering React's render cycle. Signals are the source of truth.
11
11
  *
12
+ * Re-exports `defineRegistry`, `useStateBinding`, `ComponentFn`, and
13
+ * `ComponentContext` from `@json-render/react` so consumers import everything
14
+ * from `@xmachines/play-react` rather than `@json-render/react` directly.
15
+ *
12
16
  * @packageDocumentation
13
17
  * @module @xmachines/play-react
14
18
  */
15
19
  // Main exports
16
20
  export { PlayRenderer } from "./PlayRenderer.js";
17
21
  export { useSignalEffect } from "./useSignalEffect.js";
22
+ export { PlayErrorBoundary } from "./PlayErrorBoundary.js";
23
+ export { useActor } from "./useActor.js";
24
+ // Re-export from @json-render/react so consumers import everything from @xmachines/play-react.
25
+ // React's useContext works anywhere in the call tree — no wrapper needed.
26
+ export { defineRegistry, useStateBinding, useBoundProp } from "@json-render/react";
18
27
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAe;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAe;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,+FAA+F;AAC/F,0EAA0E;AAC1E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/types.d.ts CHANGED
@@ -3,22 +3,52 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
+ import type { ComponentRegistry } from "@json-render/react";
7
+ import type { StateStore } from "@json-render/core";
6
8
  import type { AbstractActor, Viewable } from "@xmachines/play-actor";
7
9
  import type React from "react";
8
- import type { AnyActorLogic } from "xstate";
10
+ import type { AnyActorLogic, EventFromLogic } from "xstate";
9
11
  /**
10
12
  * Props for PlayRenderer component
11
13
  *
14
+ * @typeParam TLogic - The XState actor logic type. Defaults to `AnyActorLogic` for
15
+ * non-generic usage. When a specific machine type is provided, the `actions` values
16
+ * are constrained to the event type strings that the machine actually accepts.
17
+ *
12
18
  * @property actor - Actor instance with currentView signal (requires Viewable capability)
13
- * @property components - Map of component names to React components
19
+ * @property registry - ComponentRegistry from defineRegistry() in @json-render/react
20
+ * @property store - Optional external StateStore (e.g. from @json-render/xstate). When
21
+ * provided, PlayRenderer operates in controlled mode — spec.state is ignored and the
22
+ * store is the single source of truth for UI state. When omitted, a fresh
23
+ * @xstate/store atom is created internally per view transition, seeded from spec.state.
14
24
  * @property fallback - Optional component shown when currentView is null
25
+ * @property actions - Maps json-render action names to XState event type strings.
26
+ * Values are constrained to `EventFromLogic<TLogic>["type"]` — passing a non-existent
27
+ * event type string is a compile error when TLogic is specified.
15
28
  */
16
- export interface PlayRendererProps {
29
+ export interface PlayRendererProps<TLogic extends AnyActorLogic = AnyActorLogic> {
17
30
  /** Actor instance with currentView signal (requires Viewable capability) */
18
- actor: AbstractActor<AnyActorLogic> & Viewable;
19
- /** Map of component names to React components */
20
- components: Record<string, React.ElementType>;
31
+ actor: AbstractActor<TLogic> & Viewable;
32
+ /** ComponentRegistry from defineRegistry() in @json-render/react */
33
+ registry: ComponentRegistry;
34
+ /**
35
+ * Optional external StateStore (e.g. from `xstateStoreStateStore` in @json-render/xstate).
36
+ * When provided, PlayRenderer operates in controlled mode — spec.state is ignored and
37
+ * this store is the single source of truth for UI state (form values, etc.).
38
+ * When omitted, a fresh @xstate/store atom is created internally per view transition,
39
+ * seeded from spec.state. The atom resets automatically when the actor transitions to a
40
+ * new view, mirroring the actor's currentView lifecycle.
41
+ */
42
+ store?: StateStore;
21
43
  /** Optional component shown when currentView is null */
22
44
  fallback?: React.ReactNode;
45
+ /**
46
+ * Maps json-render action names to XState event type strings.
47
+ * Values are constrained to valid event types for TLogic — wrong event type strings
48
+ * are caught at compile time when TLogic is specified.
49
+ */
50
+ actions?: {
51
+ [actionName: string]: EventFromLogic<TLogic>["type"];
52
+ };
23
53
  }
24
54
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IACjC,4EAA4E;IAC5E,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC;IAE/C,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAE9C,wDAAwD;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE5D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,iBAAiB,CAAC,MAAM,SAAS,aAAa,GAAG,aAAa;IAC9E,4EAA4E;IAC5E,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;IAExC,oEAAoE;IACpE,QAAQ,EAAE,iBAAiB,CAAC;IAE5B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;OAIG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;CACnE"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * useActor — React hook for accessing the raw actor inside a PlayRenderer tree.
3
+ *
4
+ * Components rendered inside PlayRenderer can call useActor() to get direct
5
+ * access to the actor instance without prop drilling.
6
+ *
7
+ * @throws {Error} If called outside a PlayRenderer tree
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { useActor } from "@xmachines/play-react";
12
+ *
13
+ * function MyComponent() {
14
+ * const actor = useActor();
15
+ * return <button onClick={() => actor.send({ type: "SUBMIT" })}>Submit</button>;
16
+ * }
17
+ * ```
18
+ *
19
+ * @packageDocumentation
20
+ */
21
+ import type { AbstractActor } from "@xmachines/play-actor";
22
+ import type { AnyActorLogic } from "xstate";
23
+ export type PlayActor = AbstractActor<AnyActorLogic>;
24
+ export declare const ActorContext: import("react").Context<PlayActor | null>;
25
+ export declare function useActor(): PlayActor;
26
+ //# sourceMappingURL=useActor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActor.d.ts","sourceRoot":"","sources":["../src/useActor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,YAAY,2CAAwC,CAAC;AAElE,wBAAgB,QAAQ,IAAI,SAAS,CAIpC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * useActor — React hook for accessing the raw actor inside a PlayRenderer tree.
3
+ *
4
+ * Components rendered inside PlayRenderer can call useActor() to get direct
5
+ * access to the actor instance without prop drilling.
6
+ *
7
+ * @throws {Error} If called outside a PlayRenderer tree
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { useActor } from "@xmachines/play-react";
12
+ *
13
+ * function MyComponent() {
14
+ * const actor = useActor();
15
+ * return <button onClick={() => actor.send({ type: "SUBMIT" })}>Submit</button>;
16
+ * }
17
+ * ```
18
+ *
19
+ * @packageDocumentation
20
+ */
21
+ import { createContext, useContext } from "react";
22
+ export const ActorContext = createContext(null);
23
+ export function useActor() {
24
+ const actor = useContext(ActorContext);
25
+ if (!actor)
26
+ throw new Error("useActor() must be called inside <PlayRenderer>");
27
+ return actor;
28
+ }
29
+ //# sourceMappingURL=useActor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActor.js","sourceRoot":"","sources":["../src/useActor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAMlD,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAmB,IAAI,CAAC,CAAC;AAElE,MAAM,UAAU,QAAQ;IACvB,MAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSignalEffect.d.ts","sourceRoot":"","sources":["../src/useSignalEffect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,KAAG,IAuDrE,CAAC"}
1
+ {"version":3,"file":"useSignalEffect.d.ts","sourceRoot":"","sources":["../src/useSignalEffect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,KAAG,IA6DrE,CAAC"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- import { useEffect, useReducer } from "react";
6
+ import { useEffect, useReducer, useRef } from "react";
7
7
  import { Signal } from "@xmachines/play-signals";
8
8
  /**
9
9
  * Marker symbol returned by effect Computed to satisfy type requirements
@@ -60,6 +60,11 @@ const EFFECT_RUN_MARKER = Symbol("effect-run");
60
60
  * The Computed handles dependency tracking, and the Watcher monitors it.
61
61
  */
62
62
  export const useSignalEffect = (callback) => {
63
+ // Store callback in a ref so the effect closure always calls the latest version
64
+ // WITHOUT triggering watcher teardown/re-setup on each render (standard React ref pattern)
65
+ const callbackRef = useRef(callback);
66
+ // Assignment outside useEffect keeps ref current without triggering re-effect
67
+ callbackRef.current = callback;
63
68
  // Force re-render when signal changes (React needs state change to re-render)
64
69
  const [, forceUpdate] = useReducer((x) => x + 1, 0);
65
70
  useEffect(() => {
@@ -69,9 +74,10 @@ export const useSignalEffect = (callback) => {
69
74
  // The Computed will re-evaluate when any accessed signal changes
70
75
  const effect = new Signal.Computed(() => {
71
76
  // Run cleanup from previous effect
72
- cleanup?.();
73
- // Run user callback (may access signals, return cleanup)
74
- cleanup = callback();
77
+ if (typeof cleanup === "function")
78
+ cleanup();
79
+ // Run user callback via ref (always latest version, no dep churn)
80
+ cleanup = callbackRef.current();
75
81
  // Return marker value (Computed requires a return value)
76
82
  return EFFECT_RUN_MARKER;
77
83
  });
@@ -98,10 +104,11 @@ export const useSignalEffect = (callback) => {
98
104
  effect.get();
99
105
  // Cleanup on unmount
100
106
  return () => {
101
- cleanup?.();
107
+ if (typeof cleanup === "function")
108
+ cleanup();
102
109
  // Unwatch to stop receiving signal updates
103
110
  watcher.unwatch(effect);
104
111
  };
105
- }, [callback]);
112
+ }, []); // ← [] dep array: watcher created ONCE per mount, not once per render
106
113
  };
107
114
  //# sourceMappingURL=useSignalEffect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSignalEffect.js","sourceRoot":"","sources":["../src/useSignalEffect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;;GAGG;AACH,MAAM,iBAAiB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,CAAC,MAA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