@xmachines/play-dom 1.0.0-beta.55 → 1.0.0-beta.57
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 +12 -12
- package/dist/PlayRenderer.d.ts +5 -3
- package/dist/PlayRenderer.d.ts.map +1 -1
- package/dist/PlayRenderer.js +8 -4
- package/dist/PlayRenderer.js.map +1 -1
- package/dist/create-play-ui.d.ts +3 -2
- package/dist/create-play-ui.d.ts.map +1 -1
- package/dist/create-play-ui.js +3 -1
- package/dist/create-play-ui.js.map +1 -1
- package/dist/create-renderer.d.ts +4 -4
- package/dist/create-renderer.d.ts.map +1 -1
- package/dist/create-renderer.js +3 -3
- package/dist/create-renderer.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +9 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/package.json +11 -9
- package/dist/json-render/incremental.d.ts +0 -102
- package/dist/json-render/incremental.d.ts.map +0 -1
- package/dist/json-render/incremental.js +0 -830
- package/dist/json-render/incremental.js.map +0 -1
- package/dist/json-render/index.d.ts +0 -21
- package/dist/json-render/index.d.ts.map +0 -1
- package/dist/json-render/index.js +0 -17
- package/dist/json-render/index.js.map +0 -1
- package/dist/json-render/renderer.d.ts +0 -213
- package/dist/json-render/renderer.d.ts.map +0 -1
- package/dist/json-render/renderer.js +0 -317
- package/dist/json-render/renderer.js.map +0 -1
- package/dist/json-render/schema.d.ts +0 -55
- package/dist/json-render/schema.d.ts.map +0 -1
- package/dist/json-render/schema.js +0 -55
- package/dist/json-render/schema.js.map +0 -1
- package/dist/json-render/types.d.ts +0 -454
- package/dist/json-render/types.d.ts.map +0 -1
- package/dist/json-render/types.js +0 -172
- package/dist/json-render/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,20 +9,20 @@ Part of the [XMachines Play monorepo](../../README.md).
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
12
|
+
pnpm add @xmachines/play-dom
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
**Peer dependencies:**
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
|
|
18
|
+
pnpm add xstate @xstate/store @xmachines/json-render-core @xmachines/json-render-xstate
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Quick Start
|
|
22
22
|
|
|
23
23
|
```typescript
|
|
24
24
|
import { createRenderer, schema } from "@xmachines/play-dom";
|
|
25
|
-
import { defineCatalog } from "@json-render
|
|
25
|
+
import { defineCatalog } from "@xmachines/json-render-core";
|
|
26
26
|
import { z } from "zod";
|
|
27
27
|
import type { ComponentFn } from "@xmachines/play-dom";
|
|
28
28
|
|
|
@@ -72,7 +72,7 @@ disconnect();
|
|
|
72
72
|
|
|
73
73
|
```typescript
|
|
74
74
|
import { createRenderer, schema } from "@xmachines/play-dom";
|
|
75
|
-
import { defineCatalog } from "@json-render
|
|
75
|
+
import { defineCatalog } from "@xmachines/json-render-core";
|
|
76
76
|
|
|
77
77
|
const catalog = defineCatalog(schema, {
|
|
78
78
|
/* ... */
|
|
@@ -93,7 +93,7 @@ Factory-level options (`functions`, `validationFunctions`, `navigate`, `onRender
|
|
|
93
93
|
|
|
94
94
|
```typescript
|
|
95
95
|
import { defineRegistry, createPlayUI, schema } from "@xmachines/play-dom";
|
|
96
|
-
import { defineCatalog } from "@json-render
|
|
96
|
+
import { defineCatalog } from "@xmachines/json-render-core";
|
|
97
97
|
|
|
98
98
|
const catalog = defineCatalog(schema, {
|
|
99
99
|
/* ... */
|
|
@@ -142,7 +142,7 @@ renderer.disconnect();
|
|
|
142
142
|
|
|
143
143
|
```typescript
|
|
144
144
|
import { createAtom } from "@xstate/store";
|
|
145
|
-
import { xstateStoreStateStore } from "@json-render
|
|
145
|
+
import { xstateStoreStateStore } from "@xmachines/json-render-xstate";
|
|
146
146
|
|
|
147
147
|
const atom = createAtom({ username: "" });
|
|
148
148
|
const store = xstateStoreStateStore({ atom });
|
|
@@ -177,10 +177,10 @@ Without `functions`, any `$computed` expression silently resolves to `undefined`
|
|
|
177
177
|
|
|
178
178
|
Provides named validation functions for inline field validation within components. Functions receive `(value, args?)` and return `true` (valid) or `false` (invalid).
|
|
179
179
|
|
|
180
|
-
Unlike the framework renderers, the DOM renderer has no automatic `ValidationProvider` tree. Components must invoke validation explicitly using `runValidationCheck` / `runValidation` from `@json-render
|
|
180
|
+
Unlike the framework renderers, the DOM renderer has no automatic `ValidationProvider` tree. Components must invoke validation explicitly using `runValidationCheck` / `runValidation` from `@xmachines/json-render-core`, passing `ctx.ctx.validationFunctions` as `customFunctions`.
|
|
181
181
|
|
|
182
182
|
```typescript
|
|
183
|
-
import { runValidationCheck } from "@json-render
|
|
183
|
+
import { runValidationCheck } from "@xmachines/json-render-core";
|
|
184
184
|
|
|
185
185
|
const mount = createPlayUI(registryResult, {
|
|
186
186
|
validationFunctions: {
|
|
@@ -244,7 +244,7 @@ const mount = createPlayUI(registryResult, {
|
|
|
244
244
|
});
|
|
245
245
|
```
|
|
246
246
|
|
|
247
|
-
The argument order matches the upstream `RenderErrorHandler` type from `@json-render
|
|
247
|
+
The argument order matches the upstream `RenderErrorHandler` type from `@xmachines/json-render-core`: **error first, name second**. This is consistent with the framework renderers (`@xmachines/json-render-solid`, `@xmachines/json-render-react`).
|
|
248
248
|
|
|
249
249
|
Without `onRenderError`, all three error types are logged via `console.error` and swallowed. No exception propagates, and no unhandled promise rejection is created.
|
|
250
250
|
|
|
@@ -273,7 +273,7 @@ const MyComponent: ComponentFn<typeof catalog, "MyComponent"> = ({ ctx }) => {
|
|
|
273
273
|
| `PlayRenderer` | class | Class-based renderer with `connect()` / `disconnect()` lifecycle |
|
|
274
274
|
| `defineRegistry(catalog, options)` | function | Build a catalog-typed `DomRegistry` with typed handlers |
|
|
275
275
|
| `renderSpec(...)` | function | Pure Spec → DOM renderer (low-level) |
|
|
276
|
-
| `schema` | const | The `@json-render
|
|
276
|
+
| `schema` | const | The `@xmachines/json-render-dom` schema — pass to `defineCatalog()` |
|
|
277
277
|
|
|
278
278
|
### Key Types
|
|
279
279
|
|
|
@@ -307,10 +307,10 @@ const MyComponent: ComponentFn<typeof catalog, "MyComponent"> = ({ ctx }) => {
|
|
|
307
307
|
|
|
308
308
|
```bash
|
|
309
309
|
# Run all tests (jsdom environment)
|
|
310
|
-
|
|
310
|
+
pnpm test
|
|
311
311
|
|
|
312
312
|
# Run with coverage
|
|
313
|
-
|
|
313
|
+
pnpm run test:coverage
|
|
314
314
|
```
|
|
315
315
|
|
|
316
316
|
Tests live in `test/` and use [Vitest](https://vitest.dev/) with a jsdom environment. Coverage thresholds: 80% lines, functions, branches, and statements.
|
package/dist/PlayRenderer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PlayRenderer.ts — XMachines wrapper around
|
|
2
|
+
* PlayRenderer.ts — XMachines wrapper around @xmachines/json-render-dom.
|
|
3
3
|
*
|
|
4
4
|
* Bridges actor.currentView (TC39 Signal) to the inner DOM renderer using watchSignal.
|
|
5
5
|
* Exposes connect() / disconnect() methods following the same pattern as
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { AbstractActor, Viewable } from "@xmachines/play-actor";
|
|
12
12
|
import type { AnyActorLogic } from "xstate";
|
|
13
|
-
import type { DomRegistry } from "
|
|
13
|
+
import type { DomRegistry } from "@xmachines/json-render-dom";
|
|
14
14
|
import type { PlayDomOptions } from "./types.js";
|
|
15
15
|
/**
|
|
16
16
|
* PlayRenderer connects an actor's `currentView` signal to the DOM renderer.
|
|
@@ -21,6 +21,7 @@ import type { PlayDomOptions } from "./types.js";
|
|
|
21
21
|
* Options from `PlayDomOptions` (which extends `UIProviderOptions`) are all forwarded
|
|
22
22
|
* into `DomRenderContext` on every render pass:
|
|
23
23
|
* - `functions` — named compute functions for `{ $computed: "name" }` prop expressions
|
|
24
|
+
* - `directives` — custom `$`-prefixed dynamic values (from `defineDirective`), resolved during prop resolution
|
|
24
25
|
* - `validationFunctions` — custom validation functions, available at `ctx.ctx.validationFunctions`
|
|
25
26
|
* - `navigate` — navigation callback, invoked on `onSuccess: { navigate: "..." }` action bindings
|
|
26
27
|
* - `onRenderError` — called with `(error, name)` for component render errors and action handler rejections
|
|
@@ -43,7 +44,7 @@ import type { PlayDomOptions } from "./types.js";
|
|
|
43
44
|
* **Controlled store mode** — bring your own `StateStore`:
|
|
44
45
|
* ```typescript
|
|
45
46
|
* import { createAtom } from "@xstate/store";
|
|
46
|
-
* import { xstateStoreStateStore } from "@json-render
|
|
47
|
+
* import { xstateStoreStateStore } from "@xmachines/json-render-xstate";
|
|
47
48
|
*
|
|
48
49
|
* const atom = createAtom({ username: "" });
|
|
49
50
|
* const store = xstateStoreStateStore({ atom });
|
|
@@ -87,6 +88,7 @@ export declare class PlayRenderer {
|
|
|
87
88
|
* - `store` — external `StateStore` (controlled mode; overrides `spec.state` seeding).
|
|
88
89
|
* - `loading` — streaming mode flag; suppresses missing-child warnings.
|
|
89
90
|
* - `functions` — named compute functions for `$computed` prop expressions.
|
|
91
|
+
* - `directives` — custom `$`-prefixed dynamic values resolved during prop resolution.
|
|
90
92
|
* - `validationFunctions` — custom validation functions; available at `ctx.ctx.validationFunctions`.
|
|
91
93
|
* - `navigate` — navigation callback; invoked on `onSuccess: { navigate: "..." }`.
|
|
92
94
|
* - `onRenderError` — `(error, name)` handler for component render errors and action handler rejections; suppresses `console.error` fallback.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayRenderer.d.ts","sourceRoot":"","sources":["../src/PlayRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAY,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,C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
|
|
2
|
+
* PlayRenderer.ts — XMachines wrapper around @xmachines/json-render-dom.
|
|
3
3
|
*
|
|
4
4
|
* Bridges actor.currentView (TC39 Signal) to the inner DOM renderer using watchSignal.
|
|
5
5
|
* Exposes connect() / disconnect() methods following the same pattern as
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { watchSignal } from "@xmachines/play-signals";
|
|
12
12
|
import { createAtom } from "@xstate/store";
|
|
13
|
-
import { xstateStoreStateStore } from "@json-render
|
|
13
|
+
import { xstateStoreStateStore } from "@xmachines/json-render-xstate";
|
|
14
14
|
import { toAtomState } from "@xmachines/play-actor";
|
|
15
|
-
import { createIncrementalRenderer } from "
|
|
15
|
+
import { createIncrementalRenderer } from "@xmachines/json-render-dom";
|
|
16
16
|
/**
|
|
17
17
|
* PlayRenderer connects an actor's `currentView` signal to the DOM renderer.
|
|
18
18
|
*
|
|
@@ -22,6 +22,7 @@ import { createIncrementalRenderer } from "./json-render/incremental.js";
|
|
|
22
22
|
* Options from `PlayDomOptions` (which extends `UIProviderOptions`) are all forwarded
|
|
23
23
|
* into `DomRenderContext` on every render pass:
|
|
24
24
|
* - `functions` — named compute functions for `{ $computed: "name" }` prop expressions
|
|
25
|
+
* - `directives` — custom `$`-prefixed dynamic values (from `defineDirective`), resolved during prop resolution
|
|
25
26
|
* - `validationFunctions` — custom validation functions, available at `ctx.ctx.validationFunctions`
|
|
26
27
|
* - `navigate` — navigation callback, invoked on `onSuccess: { navigate: "..." }` action bindings
|
|
27
28
|
* - `onRenderError` — called with `(error, name)` for component render errors and action handler rejections
|
|
@@ -44,7 +45,7 @@ import { createIncrementalRenderer } from "./json-render/incremental.js";
|
|
|
44
45
|
* **Controlled store mode** — bring your own `StateStore`:
|
|
45
46
|
* ```typescript
|
|
46
47
|
* import { createAtom } from "@xstate/store";
|
|
47
|
-
* import { xstateStoreStateStore } from "@json-render
|
|
48
|
+
* import { xstateStoreStateStore } from "@xmachines/json-render-xstate";
|
|
48
49
|
*
|
|
49
50
|
* const atom = createAtom({ username: "" });
|
|
50
51
|
* const store = xstateStoreStateStore({ atom });
|
|
@@ -88,6 +89,7 @@ export class PlayRenderer {
|
|
|
88
89
|
* - `store` — external `StateStore` (controlled mode; overrides `spec.state` seeding).
|
|
89
90
|
* - `loading` — streaming mode flag; suppresses missing-child warnings.
|
|
90
91
|
* - `functions` — named compute functions for `$computed` prop expressions.
|
|
92
|
+
* - `directives` — custom `$`-prefixed dynamic values resolved during prop resolution.
|
|
91
93
|
* - `validationFunctions` — custom validation functions; available at `ctx.ctx.validationFunctions`.
|
|
92
94
|
* - `navigate` — navigation callback; invoked on `onSuccess: { navigate: "..." }`.
|
|
93
95
|
* - `onRenderError` — `(error, name)` handler for component render errors and action handler rejections; suppresses `console.error` fallback.
|
|
@@ -194,6 +196,7 @@ export class PlayRenderer {
|
|
|
194
196
|
: {};
|
|
195
197
|
const loading = this.options.loading;
|
|
196
198
|
const functions = this.options.functions;
|
|
199
|
+
const directives = this.options.directives;
|
|
197
200
|
const validationFunctions = this.options.validationFunctions;
|
|
198
201
|
const navigate = this.options.navigate;
|
|
199
202
|
const onConfirm = this.options.onConfirm;
|
|
@@ -225,6 +228,7 @@ export class PlayRenderer {
|
|
|
225
228
|
handlers,
|
|
226
229
|
...(onRenderError !== undefined ? { onRenderError } : {}),
|
|
227
230
|
...(functions !== undefined ? { functions } : {}),
|
|
231
|
+
...(directives !== undefined ? { directives } : {}),
|
|
228
232
|
...(loading !== undefined ? { loading } : {}),
|
|
229
233
|
onWatchSetup: (cleanup) => {
|
|
230
234
|
// Wrap so that invoking the cleanup — from disconnect()/view change
|
package/dist/PlayRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayRenderer.js","sourceRoot":"","sources":["../src/PlayRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EA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3C,MAAM,KAAK,GAAG,GAAS,EAAE;oBACxB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACjC,OAAO,EAAE,CAAC;gBACX,CAAC,CAAC;gBACF,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAC9B,OAAO,KAAK,CAAC;YACd,CAAC;YACD,GAAG,CAAC,mBAAmB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrE,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/C,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjD,CAAC;QAEF,uEAAuE;QACvE,kEAAkE;QAClE,iEAAiE;QACjE,oEAAoE;QACpE,sEAAsE;QACtE,6DAA6D;QAC7D,oEAAoE;QACpE,MAAM,WAAW,GAAG,yBAAyB,CAC5C,IAAI,EACJ,KAAK,EACL,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,aAAa,CACb,CAAC;QAEF,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;YAC5C,qDAAqD;YACrD,oEAAoE;YACpE,wEAAwE;YACxE,IAAI,CAAC,IAAI,CAAC,KAAK;gBAAE,OAAO;YACxB,WAAW,CAAC,MAAM,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;QACH,WAAW,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC;CACD"}
|
package/dist/create-play-ui.d.ts
CHANGED
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
*/
|
|
33
33
|
import type { AbstractActor, Viewable } from "@xmachines/play-actor";
|
|
34
34
|
import type { AnyActorLogic } from "xstate";
|
|
35
|
-
import type { StateStore } from "@json-render
|
|
36
|
-
import type { DefineRegistryResult } from "
|
|
35
|
+
import type { StateStore } from "@xmachines/json-render-core";
|
|
36
|
+
import type { DefineRegistryResult } from "@xmachines/json-render-dom";
|
|
37
37
|
import type { CreatePlayUIOptions } from "./types.js";
|
|
38
38
|
/**
|
|
39
39
|
* Per-mount options passed to the `MountFn` returned by `createPlayUI`.
|
|
@@ -74,6 +74,7 @@ export type MountFn = (actor: AbstractActor<AnyActorLogic> & Viewable, container
|
|
|
74
74
|
* and the lazy handlers factory.
|
|
75
75
|
* @param options - Factory-level configuration (see {@link CreatePlayUIOptions}):
|
|
76
76
|
* - `functions` — named compute functions for `$computed` prop expressions.
|
|
77
|
+
* - `directives` — custom `$`-prefixed dynamic values resolved during prop resolution.
|
|
77
78
|
* - `validationFunctions` — custom validation functions; available at `ctx.ctx.validationFunctions`.
|
|
78
79
|
* - `navigate` — navigation callback; invoked on `onSuccess: { navigate: "..." }`.
|
|
79
80
|
* - `onRenderError` — `(error, name)` handler for component render errors and action handler rejections.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-play-ui.d.ts","sourceRoot":"","sources":["../src/create-play-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-play-ui.d.ts","sourceRoot":"","sources":["../src/create-play-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG,CACrB,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,EAC9C,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,YAAY,KAClB,MAAM,IAAI,CAAC;AAEhB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAC3B,cAAc,EAAE,oBAAoB,EACpC,OAAO,GAAE,mBAAwB,GAC/B,OAAO,CA6CT"}
|
package/dist/create-play-ui.js
CHANGED
|
@@ -42,6 +42,7 @@ import { PlayRenderer } from "./PlayRenderer.js";
|
|
|
42
42
|
* and the lazy handlers factory.
|
|
43
43
|
* @param options - Factory-level configuration (see {@link CreatePlayUIOptions}):
|
|
44
44
|
* - `functions` — named compute functions for `$computed` prop expressions.
|
|
45
|
+
* - `directives` — custom `$`-prefixed dynamic values resolved during prop resolution.
|
|
45
46
|
* - `validationFunctions` — custom validation functions; available at `ctx.ctx.validationFunctions`.
|
|
46
47
|
* - `navigate` — navigation callback; invoked on `onSuccess: { navigate: "..." }`.
|
|
47
48
|
* - `onRenderError` — `(error, name)` handler for component render errors and action handler rejections.
|
|
@@ -49,7 +50,7 @@ import { PlayRenderer } from "./PlayRenderer.js";
|
|
|
49
50
|
* @returns `MountFn`: `(actor, container, mountOptions?) → disconnect`
|
|
50
51
|
*/
|
|
51
52
|
export function createPlayUI(registryResult, options = {}) {
|
|
52
|
-
const { onRenderError, fallback, functions, validationFunctions, navigate, onConfirm } = options;
|
|
53
|
+
const { onRenderError, fallback, functions, directives, validationFunctions, navigate, onConfirm, } = options;
|
|
53
54
|
return function mount(actor, container, mountOptions) {
|
|
54
55
|
// All UIProviderOptions (onRenderError, functions, validationFunctions, navigate) are
|
|
55
56
|
// forwarded directly through PlayDomOptions → PlayRenderer → renderSpec → DomRenderContext.
|
|
@@ -58,6 +59,7 @@ export function createPlayUI(registryResult, options = {}) {
|
|
|
58
59
|
...(mountOptions?.store !== undefined && { store: mountOptions.store }),
|
|
59
60
|
...(mountOptions?.loading !== undefined && { loading: mountOptions.loading }),
|
|
60
61
|
...(functions !== undefined && { functions }),
|
|
62
|
+
...(directives !== undefined && { directives }),
|
|
61
63
|
...(validationFunctions !== undefined && { validationFunctions }),
|
|
62
64
|
...(navigate !== undefined && { navigate }),
|
|
63
65
|
...(onConfirm !== undefined && { onConfirm }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-play-ui.js","sourceRoot":"","sources":["../src/create-play-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAsCjD
|
|
1
|
+
{"version":3,"file":"create-play-ui.js","sourceRoot":"","sources":["../src/create-play-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAsCjD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAC3B,cAAoC,EACpC,UAA+B,EAAE;IAEjC,MAAM,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,QAAQ,EACR,SAAS,GACT,GAAG,OAAO,CAAC;IAEZ,OAAO,SAAS,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,YAAY;QACnD,sFA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
3
|
*
|
|
4
|
-
* Mirrors the `createRenderer` export from @json-render
|
|
4
|
+
* Mirrors the `createRenderer` export from @xmachines/json-render-react, /vue, /solid, /svelte.
|
|
5
5
|
* Calls `defineRegistry` once at factory creation time and returns a
|
|
6
6
|
* `mount(actor, container, options?)` function that wires up PlayRenderer and
|
|
7
7
|
* returns a `disconnect` cleanup function.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
13
|
* import { createRenderer, schema } from "@xmachines/play-dom";
|
|
14
|
-
* import { defineCatalog } from "@json-render
|
|
14
|
+
* import { defineCatalog } from "@xmachines/json-render-core";
|
|
15
15
|
* import { z } from "zod";
|
|
16
16
|
* import type { ComponentFn } from "@xmachines/play-dom";
|
|
17
17
|
*
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
*/
|
|
55
55
|
import type { AbstractActor, Viewable } from "@xmachines/play-actor";
|
|
56
56
|
import type { AnyActorLogic } from "xstate";
|
|
57
|
-
import type { Catalog } from "@json-render
|
|
58
|
-
import type { ComponentRegistry } from "
|
|
57
|
+
import type { Catalog } from "@xmachines/json-render-core";
|
|
58
|
+
import type { ComponentRegistry } from "@xmachines/json-render-dom";
|
|
59
59
|
import type { PlayDomOptions } from "./types.js";
|
|
60
60
|
/**
|
|
61
61
|
* Create a reusable DOM renderer factory from a catalog and component map.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-renderer.d.ts","sourceRoot":"","sources":["../src/create-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-renderer.d.ts","sourceRoot":"","sources":["../src/create-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,OAAO,EAC/C,OAAO,EAAE,CAAC,EACV,YAAY,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAChC,CACF,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,EAC9C,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,KAC5C,MAAM,IAAI,CAWd"}
|
package/dist/create-renderer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* create-renderer.ts — createRenderer convenience factory for @xmachines/play-dom.
|
|
3
3
|
*
|
|
4
|
-
* Mirrors the `createRenderer` export from @json-render
|
|
4
|
+
* Mirrors the `createRenderer` export from @xmachines/json-render-react, /vue, /solid, /svelte.
|
|
5
5
|
* Calls `defineRegistry` once at factory creation time and returns a
|
|
6
6
|
* `mount(actor, container, options?)` function that wires up PlayRenderer and
|
|
7
7
|
* returns a `disconnect` cleanup function.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
13
|
* import { createRenderer, schema } from "@xmachines/play-dom";
|
|
14
|
-
* import { defineCatalog } from "@json-render
|
|
14
|
+
* import { defineCatalog } from "@xmachines/json-render-core";
|
|
15
15
|
* import { z } from "zod";
|
|
16
16
|
* import type { ComponentFn } from "@xmachines/play-dom";
|
|
17
17
|
*
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
* @packageDocumentation
|
|
54
54
|
*/
|
|
55
55
|
import { PlayRenderer } from "./PlayRenderer.js";
|
|
56
|
-
import { defineRegistry } from "
|
|
56
|
+
import { defineRegistry } from "@xmachines/json-render-dom";
|
|
57
57
|
/**
|
|
58
58
|
* Create a reusable DOM renderer factory from a catalog and component map.
|
|
59
59
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-renderer.js","sourceRoot":"","sources":["../src/create-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAOH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-renderer.js","sourceRoot":"","sources":["../src/create-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAOH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,cAAc,CAC7B,OAAU,EACV,YAAkC;IAMlC,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC;IAE7E,OAAO,SAAS,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;QACnD,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE;YAC5E,GAAG,OAAO;YACV,cAAc;SACd,CAAC,CAAC;QACH,QAAQ,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - `PlayRenderer` — class-based renderer with `connect()` / `disconnect()` lifecycle
|
|
10
10
|
* - `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `MountOptions`
|
|
11
11
|
*
|
|
12
|
-
* **json-render layer** (
|
|
12
|
+
* **json-render layer** (re-exported from @xmachines/json-render-dom):
|
|
13
13
|
* - `defineRegistry` — build a catalog-typed DomRegistry
|
|
14
14
|
* - `renderSpec` — pure Spec → DOM renderer (uses resolveElementProps from core)
|
|
15
15
|
* - `ComponentFn` — catalog-typed component function type
|
|
@@ -30,7 +30,7 @@ export { createRenderer } from "./create-renderer.js";
|
|
|
30
30
|
export { createPlayUI } from "./create-play-ui.js";
|
|
31
31
|
export type { MountFn, MountOptions } from "./create-play-ui.js";
|
|
32
32
|
export type { PlayDomOptions, CreatePlayUIOptions } from "./types.js";
|
|
33
|
-
export { defineRegistry, renderSpec, schema } from "
|
|
34
|
-
export type { RenderSpecOptions } from "
|
|
35
|
-
export type { ConfirmHandler, EventHandle, SetState, RenderErrorHandler, UIProviderOptions, CatalogHasActions, BaseComponentProps, DomRenderContext, DomComponentRenderer, ComponentContext, ComponentFn, ComponentRegistry, Actions, ActionFn, DefineRegistryOptions, DefineRegistryResult, DomRegistry, DomSchema, } from "
|
|
33
|
+
export { defineRegistry, renderSpec, schema } from "@xmachines/json-render-dom";
|
|
34
|
+
export type { RenderSpecOptions } from "@xmachines/json-render-dom";
|
|
35
|
+
export type { ConfirmHandler, EventHandle, SetState, RenderErrorHandler, UIProviderOptions, CatalogHasActions, BaseComponentProps, DomRenderContext, DomComponentRenderer, ComponentContext, ComponentFn, ComponentRegistry, Actions, ActionFn, DefineRegistryOptions, DefineRegistryResult, DomRegistry, DomSchema, } from "@xmachines/json-render-dom";
|
|
36
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGjE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGjE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAChF,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EACX,cAAc,EACd,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,SAAS,GACT,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - `PlayRenderer` — class-based renderer with `connect()` / `disconnect()` lifecycle
|
|
10
10
|
* - `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `MountOptions`
|
|
11
11
|
*
|
|
12
|
-
* **json-render layer** (
|
|
12
|
+
* **json-render layer** (re-exported from @xmachines/json-render-dom):
|
|
13
13
|
* - `defineRegistry` — build a catalog-typed DomRegistry
|
|
14
14
|
* - `renderSpec` — pure Spec → DOM renderer (uses resolveElementProps from core)
|
|
15
15
|
* - `ComponentFn` — catalog-typed component function type
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
export { PlayRenderer } from "./PlayRenderer.js";
|
|
30
30
|
export { createRenderer } from "./create-renderer.js";
|
|
31
31
|
export { createPlayUI } from "./create-play-ui.js";
|
|
32
|
-
// json-render
|
|
33
|
-
export { defineRegistry, renderSpec, schema } from "
|
|
32
|
+
// @xmachines/json-render-dom (re-exported for consumer convenience)
|
|
33
|
+
export { defineRegistry, renderSpec, schema } from "@xmachines/json-render-dom";
|
|
34
34
|
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMnD
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMnD,oEAAoE;AACpE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* types.ts — XMachines-specific type definitions for play-dom.
|
|
3
3
|
*
|
|
4
4
|
* These types depend on @xmachines/play-actor and stay in play-dom.
|
|
5
|
-
* Pure json-render types live in
|
|
5
|
+
* Pure json-render types live in @xmachines/json-render-dom.
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import type { StateStore } from "@json-render
|
|
10
|
-
import type { DefineRegistryResult, UIProviderOptions } from "
|
|
11
|
-
export type { UIProviderOptions } from "
|
|
9
|
+
import type { StateStore } from "@xmachines/json-render-core";
|
|
10
|
+
import type { DefineRegistryResult, UIProviderOptions } from "@xmachines/json-render-dom";
|
|
11
|
+
export type { UIProviderOptions } from "@xmachines/json-render-dom";
|
|
12
12
|
/**
|
|
13
13
|
* Options for `PlayRenderer`.
|
|
14
14
|
*
|
|
15
15
|
* Extends {@link UIProviderOptions}, which contributes `functions`,
|
|
16
|
-
* `validationFunctions`, `navigate`, and `onRenderError`. All
|
|
17
|
-
* forwarded into `DomRenderContext` on every render pass and are readable
|
|
16
|
+
* `directives`, `validationFunctions`, `navigate`, and `onRenderError`. All
|
|
17
|
+
* are forwarded into `DomRenderContext` on every render pass and are readable
|
|
18
18
|
* by component implementations via `ctx.ctx.*`.
|
|
19
19
|
*/
|
|
20
20
|
export interface PlayDomOptions extends UIProviderOptions {
|
|
@@ -27,7 +27,7 @@ export interface PlayDomOptions extends UIProviderOptions {
|
|
|
27
27
|
*/
|
|
28
28
|
registryResult?: DefineRegistryResult;
|
|
29
29
|
/**
|
|
30
|
-
* Optional external StateStore (e.g. from `xstateStoreStateStore` in @json-render
|
|
30
|
+
* Optional external StateStore (e.g. from `xstateStoreStateStore` in @xmachines/json-render-xstate).
|
|
31
31
|
*
|
|
32
32
|
* When provided, `PlayRenderer` operates in controlled mode — `spec.state` is ignored and
|
|
33
33
|
* this store is the single source of truth for UI state (form values, etc.).
|
|
@@ -50,8 +50,8 @@ export interface PlayDomOptions extends UIProviderOptions {
|
|
|
50
50
|
* Options for `createPlayUI()` — the batteries-included DOM factory.
|
|
51
51
|
*
|
|
52
52
|
* Extends {@link UIProviderOptions}, which contributes `functions`,
|
|
53
|
-
* `validationFunctions`, `navigate`, and `onRenderError`. All
|
|
54
|
-
* closed over at factory creation time and forwarded into `PlayRenderer`
|
|
53
|
+
* `directives`, `validationFunctions`, `navigate`, and `onRenderError`. All
|
|
54
|
+
* are closed over at factory creation time and forwarded into `PlayRenderer`
|
|
55
55
|
* on every `mount()` call.
|
|
56
56
|
*
|
|
57
57
|
* Parallel to `PlayUIProvider`'s props in the framework renderers.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE1F,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACxD;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;IAEtC;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC7D;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC9B"}
|
package/dist/types.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* types.ts — XMachines-specific type definitions for play-dom.
|
|
3
3
|
*
|
|
4
4
|
* These types depend on @xmachines/play-actor and stay in play-dom.
|
|
5
|
-
* Pure json-render types live in
|
|
5
|
+
* Pure json-render types live in @xmachines/json-render-dom.
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-dom",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.57",
|
|
4
4
|
"description": "Vanilla DOM renderer for XMachines Play architecture with signal-driven rendering",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"actor",
|
|
@@ -43,17 +43,18 @@
|
|
|
43
43
|
"prepublishOnly": "npm run build"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@xmachines/play": "1.0.0-beta.
|
|
47
|
-
"@xmachines/play-actor": "1.0.0-beta.
|
|
48
|
-
"@xmachines/play-signals": "1.0.0-beta.
|
|
46
|
+
"@xmachines/play": "1.0.0-beta.57",
|
|
47
|
+
"@xmachines/play-actor": "1.0.0-beta.57",
|
|
48
|
+
"@xmachines/play-signals": "1.0.0-beta.57"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@json-render/core": "^0.18.0",
|
|
52
|
-
"@json-render/xstate": "^0.18.0",
|
|
53
51
|
"@testing-library/jest-dom": "^6.9.1",
|
|
54
52
|
"@types/node": "^25.6.0",
|
|
55
53
|
"@vitest/browser-playwright": "^4.1.5",
|
|
56
|
-
"@xmachines/
|
|
54
|
+
"@xmachines/json-render-core": "^0.19.0-xm.2",
|
|
55
|
+
"@xmachines/json-render-dom": "^0.19.0-xm.2",
|
|
56
|
+
"@xmachines/json-render-xstate": "^0.19.0-xm.2",
|
|
57
|
+
"@xmachines/shared": "1.0.0-beta.57",
|
|
57
58
|
"@xstate/store": "^3.17.0",
|
|
58
59
|
"oxfmt": "^0.47.0",
|
|
59
60
|
"oxlint": "^1.62.0",
|
|
@@ -63,8 +64,9 @@
|
|
|
63
64
|
"zod": "^4.4.1"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
|
-
"@json-render
|
|
67
|
-
"@json-render
|
|
67
|
+
"@xmachines/json-render-core": "^0.19.0-xm.2",
|
|
68
|
+
"@xmachines/json-render-dom": "^0.19.0-xm.2",
|
|
69
|
+
"@xmachines/json-render-xstate": "^0.19.0-xm.2",
|
|
68
70
|
"@xstate/store": "^3.17.0",
|
|
69
71
|
"xstate": "^5.31.0"
|
|
70
72
|
},
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* incremental.ts — Targeted store-driven re-rendering for the DOM renderer.
|
|
3
|
-
*
|
|
4
|
-
* Zero XMachines dependencies. Upstreamable to @json-render/dom.
|
|
5
|
-
*
|
|
6
|
-
* `createIncrementalRenderer` wraps {@link renderSpec} with a per-element
|
|
7
|
-
* dependency registry: while rendering, every element instance is recorded as
|
|
8
|
-
* a {@link RenderUnit} carrying the resolved `$state` paths its props and
|
|
9
|
-
* visibility depend on (a conservative superset extracted statically from the
|
|
10
|
-
* raw spec). On each store update the previous and next snapshots are diffed
|
|
11
|
-
* per tracked path (shallow reference compare via `getByPath`) and ONLY the
|
|
12
|
-
* affected elements are re-rendered in place — untouched siblings and
|
|
13
|
-
* ancestors keep their DOM node identity, focus, selection, and scroll.
|
|
14
|
-
*
|
|
15
|
-
* Granularity rules:
|
|
16
|
-
* - `$state` / `$template` / `$cond` / `$computed` args → the referenced
|
|
17
|
-
* absolute paths are re-render dependencies of the element.
|
|
18
|
-
* - Visibility conditions → their referenced paths are dependencies; while an
|
|
19
|
-
* element is invisible a `Comment` placeholder holds its position so it can
|
|
20
|
-
* be mounted in place when the condition flips.
|
|
21
|
-
* - `repeat` containers → reconciled per index when their array path changes
|
|
22
|
-
* (index-based diffing — the spec has no user-provided item keys):
|
|
23
|
-
* unchanged-reference items keep their DOM nodes untouched, trailing growth
|
|
24
|
-
* appends new item instances in place, trailing shrink removes them, and
|
|
25
|
-
* changed indices re-render through the per-unit diff (see next bullet).
|
|
26
|
-
* Wholesale container re-renders remain as documented fallbacks — see
|
|
27
|
-
* {@link reconcileRepeat}.
|
|
28
|
-
* - `$item` / `$index` / `$bindItem` inside a repeat → attributed to the
|
|
29
|
-
* enclosing item's absolute path (e.g. `"/todos/1"`), so mutating one
|
|
30
|
-
* item's object re-renders only the element instances inside that index.
|
|
31
|
-
* - `$bindState` / `$bindItem` (two-way bindings) → tracked separately: when
|
|
32
|
-
* ONLY bound paths changed and the element currently contains focus, the
|
|
33
|
-
* re-render is skipped. The focused input already displays the value it
|
|
34
|
-
* just wrote to the store, and replacing its node would destroy focus and
|
|
35
|
-
* selection on every keystroke. Unfocused bound elements re-render normally
|
|
36
|
-
* so external writes still propagate.
|
|
37
|
-
* - Elements with no state bindings are never touched by store updates.
|
|
38
|
-
*
|
|
39
|
-
* Fallbacks (correctness over cleverness):
|
|
40
|
-
* - Re-rendering the root element (or any unit whose DOM node is no longer
|
|
41
|
-
* connected, e.g. a component that ignored its children) escalates to the
|
|
42
|
-
* nearest ancestor and ultimately to a full container re-render.
|
|
43
|
-
* - If a store notification delivers a snapshot that is reference-identical
|
|
44
|
-
* to the previous one (in-place mutation cannot be diffed), a full
|
|
45
|
-
* re-render preserves the pre-incremental behavior.
|
|
46
|
-
*
|
|
47
|
-
* `watch` bindings are NOT re-render dependencies — they are managed as a
|
|
48
|
-
* per-element-instance subscription registry: a subscription is created when
|
|
49
|
-
* an instance first MOUNTS (initial render, visibility flipping on, a repeat
|
|
50
|
-
* item being appended) with the skip-on-mount baseline captured at that
|
|
51
|
-
* moment; it is PRESERVED — never rewired — across in-place re-renders of the
|
|
52
|
-
* same instance (so its baseline and store-notification position survive, see
|
|
53
|
-
* PlayRenderer's watch lifecycle notes); and it is RELEASED when the instance
|
|
54
|
-
* unmounts (visibility off, repeat item removed, or the element vanishing
|
|
55
|
-
* from a re-rendered subtree). Each registration's cleanup is idempotent and
|
|
56
|
-
* is also forwarded to `options.onWatchSetup`, so callers may safely invoke
|
|
57
|
-
* it again on teardown (view change / disconnect).
|
|
58
|
-
*
|
|
59
|
-
* @packageDocumentation
|
|
60
|
-
*/
|
|
61
|
-
import type { Spec, StateStore } from "@json-render/core";
|
|
62
|
-
import type { RenderSpecOptions } from "./renderer.js";
|
|
63
|
-
import type { DomRegistry } from "./types.js";
|
|
64
|
-
/**
|
|
65
|
-
* Handle returned by {@link createIncrementalRenderer}.
|
|
66
|
-
*/
|
|
67
|
-
export interface IncrementalDomRenderer {
|
|
68
|
-
/**
|
|
69
|
-
* Full initial render into the container (clears it first). Registers
|
|
70
|
-
* `watch` subscriptions via `options.onWatchSetup` for every mounted
|
|
71
|
-
* element that declares them.
|
|
72
|
-
*/
|
|
73
|
-
render(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Diff the current store snapshot against the previous one and re-render
|
|
76
|
-
* only the affected element instances in place. Elements mounted by the
|
|
77
|
-
* update (visibility flips, appended repeat items) register their `watch`
|
|
78
|
-
* subscriptions; unmounted elements release theirs; instances re-rendered
|
|
79
|
-
* in place keep their original subscriptions (never rewired).
|
|
80
|
-
*/
|
|
81
|
-
update(): void;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Create an incremental DOM renderer for one spec/store/container triple.
|
|
85
|
-
*
|
|
86
|
-
* Call {@link IncrementalDomRenderer.render} once for the initial mount, then
|
|
87
|
-
* {@link IncrementalDomRenderer.update} on every store notification. A view
|
|
88
|
-
* transition should discard the instance and create a fresh one (matching
|
|
89
|
-
* PlayRenderer's full-rebuild-per-view contract).
|
|
90
|
-
*
|
|
91
|
-
* @param spec - The json-render `Spec` for the current view.
|
|
92
|
-
* @param store - Live `StateStore` bound to `spec.state`.
|
|
93
|
-
* @param registry - Map of element type names → `DomComponentRenderer`.
|
|
94
|
-
* @param container - Host element that owns the rendered tree.
|
|
95
|
-
* @param options - Forwarded to {@link renderSpec}. `onWatchSetup` receives
|
|
96
|
-
* one idempotent cleanup per watch registration, over the
|
|
97
|
-
* whole lifetime of the instance (initial mounts AND
|
|
98
|
-
* late mounts) — never a duplicate for an instance that is
|
|
99
|
-
* merely re-rendered in place.
|
|
100
|
-
*/
|
|
101
|
-
export declare function createIncrementalRenderer(spec: Spec, store: StateStore, registry: DomRegistry, container: HTMLElement, options?: RenderSpecOptions): IncrementalDomRenderer;
|
|
102
|
-
//# sourceMappingURL=incremental.d.ts.map
|