@xmachines/play-dom 2.0.0-alpha.1 → 2.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 +3 -3
- package/dist/PlayRenderer.d.ts +36 -0
- package/dist/PlayRenderer.d.ts.map +1 -1
- package/dist/PlayRenderer.js +98 -15
- package/dist/PlayRenderer.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +27 -25
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
-
|
|
3
1
|
# @xmachines/play-dom
|
|
4
2
|
|
|
5
3
|
Vanilla DOM renderer for XMachines Play architecture with signal-driven rendering.
|
|
6
4
|
|
|
5
|
+
[](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-dom)
|
|
6
|
+
|
|
7
7
|
Part of the [XMachines Play monorepo](../../README.md).
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
@@ -15,7 +15,7 @@ pnpm add @xmachines/play-dom
|
|
|
15
15
|
**Peer dependencies:**
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
pnpm add xstate @xstate/store @xmachines/json-render-core @xmachines/json-render-xstate
|
|
18
|
+
pnpm add xstate @xstate/store @xmachines/json-render-core @xmachines/json-render-dom @xmachines/json-render-xstate
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Quick Start
|
package/dist/PlayRenderer.d.ts
CHANGED
|
@@ -71,6 +71,27 @@ export declare class PlayRenderer {
|
|
|
71
71
|
* mount over a long-lived view.
|
|
72
72
|
*/
|
|
73
73
|
private watchCleanups;
|
|
74
|
+
/**
|
|
75
|
+
* viewKey of the currently rendered view and the (unguarded) store backing
|
|
76
|
+
* it. A same-key emission means only the /context projection moved: the
|
|
77
|
+
* slice-only fast path in render() refreshes the store in place instead of
|
|
78
|
+
* tearing the tree down, so ephemeral view state (drafts, toggles) survives.
|
|
79
|
+
* A null emission (a state with no meta.view) is a GAP, not a new view:
|
|
80
|
+
* the DOM tears down but the identity and store are kept, so returning to
|
|
81
|
+
* the same view rebuilds around the surviving ephemeral state — matching
|
|
82
|
+
* the framework providers. Reset in disconnect() — a kept-alive store must
|
|
83
|
+
* not outlive the connection.
|
|
84
|
+
*/
|
|
85
|
+
private lastViewKey;
|
|
86
|
+
private currentStore;
|
|
87
|
+
/**
|
|
88
|
+
* Store lifecycle (reseed on viewKey change, refresh /context in place
|
|
89
|
+
* otherwise, guard identity cache) — the shared coordinator from
|
|
90
|
+
* @xmachines/play-actor. lastViewKey/currentStore above remain DOM-side
|
|
91
|
+
* bookkeeping for the slice-only fast path, which is about the live TREE
|
|
92
|
+
* (spec + subscription), not the store.
|
|
93
|
+
*/
|
|
94
|
+
private readonly storeLifecycle;
|
|
74
95
|
/**
|
|
75
96
|
* Set to `false` in `disconnect()` before calling `storeUnsub()`.
|
|
76
97
|
* The `rerender` closure checks this flag at entry so that any synchronous
|
|
@@ -117,5 +138,20 @@ export declare class PlayRenderer {
|
|
|
117
138
|
*/
|
|
118
139
|
get watchCleanupCount(): number;
|
|
119
140
|
private render;
|
|
141
|
+
/**
|
|
142
|
+
* A failed rebuild must not leave the fast-path guard armed on a dead tree
|
|
143
|
+
* (the container was already cleared): reset the view identity so the next
|
|
144
|
+
* emission — same viewKey included — retries a full render instead of
|
|
145
|
+
* patching a store nothing displays.
|
|
146
|
+
*/
|
|
147
|
+
private resetFailedRebuild;
|
|
148
|
+
/**
|
|
149
|
+
* The throw-capable tail of a full rebuild — see render()'s catch.
|
|
150
|
+
*
|
|
151
|
+
* @param guardedStore - Everything the spec can write through ($bindState,
|
|
152
|
+
* setState, chained set) gets the GUARDED store: /context is read-only to
|
|
153
|
+
* the spec — machine context changes only through events.
|
|
154
|
+
*/
|
|
155
|
+
private renderView;
|
|
120
156
|
}
|
|
121
157
|
//# sourceMappingURL=PlayRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayRenderer.d.ts","sourceRoot":"","sources":["../src/PlayRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"PlayRenderer.d.ts","sourceRoot":"","sources":["../src/PlayRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAY,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,qBAAa,YAAY;IA2DvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IA7DzB,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,gBAAgB,CAA6B;IACrD;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa,CAAyB;IAC9C;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,YAAY,CAA2B;IAC/C;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;IACF;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,CAAQ;IAErB;;;;;;;;;;;;;OAaG;gBAEe,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,EAC9C,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE,cAAmB;IAG9C;;;;;;;;OAQG;IACH,OAAO,IAAI,IAAI;IAMf;;OAEG;IACH,UAAU,IAAI,IAAI;IAuBlB;;;;;;OAMG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED,OAAO,CAAC,MAAM;IAkEd;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;CA6GlB"}
|
package/dist/PlayRenderer.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { watchSignal } from "@xmachines/play-signals";
|
|
12
12
|
import { createAtom } from "@xstate/store";
|
|
13
13
|
import { xstateStoreStateStore } from "@xmachines/json-render-xstate";
|
|
14
|
-
import {
|
|
14
|
+
import { createViewStoreLifecycle, refreshContextSubtree } from "@xmachines/play-actor";
|
|
15
15
|
import { createIncrementalRenderer } from "@xmachines/json-render-dom";
|
|
16
16
|
/**
|
|
17
17
|
* PlayRenderer connects an actor's `currentView` signal to the DOM renderer.
|
|
@@ -72,6 +72,27 @@ export class PlayRenderer {
|
|
|
72
72
|
* mount over a long-lived view.
|
|
73
73
|
*/
|
|
74
74
|
watchCleanups = new Set();
|
|
75
|
+
/**
|
|
76
|
+
* viewKey of the currently rendered view and the (unguarded) store backing
|
|
77
|
+
* it. A same-key emission means only the /context projection moved: the
|
|
78
|
+
* slice-only fast path in render() refreshes the store in place instead of
|
|
79
|
+
* tearing the tree down, so ephemeral view state (drafts, toggles) survives.
|
|
80
|
+
* A null emission (a state with no meta.view) is a GAP, not a new view:
|
|
81
|
+
* the DOM tears down but the identity and store are kept, so returning to
|
|
82
|
+
* the same view rebuilds around the surviving ephemeral state — matching
|
|
83
|
+
* the framework providers. Reset in disconnect() — a kept-alive store must
|
|
84
|
+
* not outlive the connection.
|
|
85
|
+
*/
|
|
86
|
+
lastViewKey = undefined;
|
|
87
|
+
currentStore = null;
|
|
88
|
+
/**
|
|
89
|
+
* Store lifecycle (reseed on viewKey change, refresh /context in place
|
|
90
|
+
* otherwise, guard identity cache) — the shared coordinator from
|
|
91
|
+
* @xmachines/play-actor. lastViewKey/currentStore above remain DOM-side
|
|
92
|
+
* bookkeeping for the slice-only fast path, which is about the live TREE
|
|
93
|
+
* (spec + subscription), not the store.
|
|
94
|
+
*/
|
|
95
|
+
storeLifecycle = createViewStoreLifecycle((seed) => xstateStoreStateStore({ atom: createAtom(seed) }));
|
|
75
96
|
/**
|
|
76
97
|
* Set to `false` in `disconnect()` before calling `storeUnsub()`.
|
|
77
98
|
* The `rerender` closure checks this flag at entry so that any synchronous
|
|
@@ -136,6 +157,10 @@ export class PlayRenderer {
|
|
|
136
157
|
for (const cleanup of watchCleanups)
|
|
137
158
|
cleanup();
|
|
138
159
|
this.container.replaceChildren();
|
|
160
|
+
// Lifetime rule: the kept-alive store dies with the connection.
|
|
161
|
+
this.lastViewKey = undefined;
|
|
162
|
+
this.currentStore = null;
|
|
163
|
+
this.storeLifecycle.reset();
|
|
139
164
|
}
|
|
140
165
|
/**
|
|
141
166
|
* Number of live watch-subscription cleanups currently retained.
|
|
@@ -148,6 +173,25 @@ export class PlayRenderer {
|
|
|
148
173
|
return this.watchCleanups.size;
|
|
149
174
|
}
|
|
150
175
|
render(view) {
|
|
176
|
+
// ── Slice-only fast path ────────────────────────────────────────────
|
|
177
|
+
// Same viewKey as the live tree → only the /context projection changed
|
|
178
|
+
// (deriveCurrentView keys emissions to the selected meta entry, and the
|
|
179
|
+
// authored spec is static per state). Refresh the store subtree in place
|
|
180
|
+
// — the store subscription below already drives incremental.update(),
|
|
181
|
+
// which diffs snapshots and patches only affected elements — and skip
|
|
182
|
+
// the teardown entirely so ephemeral view state survives.
|
|
183
|
+
// createIncrementalRenderer binds the SPEC at construction, so this
|
|
184
|
+
// path is only safe because the spec is unchanged; a real view change
|
|
185
|
+
// (different viewKey, or no viewKey to compare) still rebuilds below,
|
|
186
|
+
// per the incremental renderer's discard-on-view-transition contract.
|
|
187
|
+
if (view !== null &&
|
|
188
|
+
view.viewKey !== undefined &&
|
|
189
|
+
this.lastViewKey === view.viewKey &&
|
|
190
|
+
this.currentStore !== null &&
|
|
191
|
+
this.storeUnsubscribe !== null) {
|
|
192
|
+
refreshContextSubtree(this.currentStore, view);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
151
195
|
this.alive = true;
|
|
152
196
|
// Capture and clear before calling — prevents the synchronous callback fired
|
|
153
197
|
// by some store implementations during unsubscribe from seeing a live
|
|
@@ -165,34 +209,71 @@ export class PlayRenderer {
|
|
|
165
209
|
for (const cleanup of prevWatchCleanups)
|
|
166
210
|
cleanup();
|
|
167
211
|
this.container.replaceChildren();
|
|
212
|
+
// A null emission is a gap between views, not a new view: keep
|
|
213
|
+
// lastViewKey and currentStore so a return to the same identity reuses
|
|
214
|
+
// the store below. disconnect() remains the lifetime boundary.
|
|
168
215
|
if (!view)
|
|
169
216
|
return;
|
|
170
|
-
// Resolve the store: external (controlled
|
|
171
|
-
//
|
|
172
|
-
//
|
|
173
|
-
//
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
217
|
+
// Resolve the store through the shared lifecycle: external (controlled,
|
|
218
|
+
// /context refreshed — machinery-owned in both modes), the kept store
|
|
219
|
+
// when this emission returns to the live identity (view → null → same
|
|
220
|
+
// view — the fast path could not take it because the DOM is gone; the
|
|
221
|
+
// coordinator refreshes /context in place, context may have moved
|
|
222
|
+
// during the gap), or a fresh per-view store seeded from the composed
|
|
223
|
+
// state.
|
|
224
|
+
const resolution = this.storeLifecycle.resolve(this.actor, view, this.options.store);
|
|
225
|
+
this.lastViewKey = view.viewKey;
|
|
226
|
+
// Kept unguarded for the slice-only fast path's refresh.
|
|
227
|
+
this.currentStore = resolution.store;
|
|
228
|
+
try {
|
|
229
|
+
this.renderView(view, resolution.guardedStore);
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
this.resetFailedRebuild();
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* A failed rebuild must not leave the fast-path guard armed on a dead tree
|
|
238
|
+
* (the container was already cleared): reset the view identity so the next
|
|
239
|
+
* emission — same viewKey included — retries a full render instead of
|
|
240
|
+
* patching a store nothing displays.
|
|
241
|
+
*/
|
|
242
|
+
resetFailedRebuild() {
|
|
243
|
+
const failedUnsub = this.storeUnsubscribe;
|
|
244
|
+
this.storeUnsubscribe = null;
|
|
245
|
+
failedUnsub?.();
|
|
246
|
+
this.lastViewKey = undefined;
|
|
247
|
+
this.currentStore = null;
|
|
248
|
+
this.storeLifecycle.reset();
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The throw-capable tail of a full rebuild — see render()'s catch.
|
|
252
|
+
*
|
|
253
|
+
* @param guardedStore - Everything the spec can write through ($bindState,
|
|
254
|
+
* setState, chained set) gets the GUARDED store: /context is read-only to
|
|
255
|
+
* the spec — machine context changes only through events.
|
|
256
|
+
*/
|
|
257
|
+
renderView(view, guardedStore) {
|
|
179
258
|
const send = this.actor.send.bind(this.actor);
|
|
180
259
|
// Build a SetState function backed by the xstate store.
|
|
181
260
|
// Called lazily at action-invocation time (not at handlers() call time)
|
|
182
261
|
// so actions always see the latest store state.
|
|
183
262
|
const setState = (updater) => {
|
|
184
|
-
const prev =
|
|
263
|
+
const prev = guardedStore.getSnapshot();
|
|
185
264
|
const next = updater(prev);
|
|
186
265
|
// store.update() is called with a full state snapshot (not a patch map).
|
|
187
266
|
// This is compatible with createStoreAdapter/createStateStore where update()
|
|
188
267
|
// performs a shallow merge of the provided top-level keys, effectively
|
|
189
268
|
// replacing the entire state model. Do not change this to a path-keyed
|
|
190
269
|
// patch unless the StateStore contract is updated to match.
|
|
191
|
-
store
|
|
270
|
+
// The guarded store lets the untouched context key of this read-modify-
|
|
271
|
+
// write round-trip pass as a no-op; a genuine /context mutation throws.
|
|
272
|
+
guardedStore.update(next);
|
|
192
273
|
};
|
|
193
274
|
// Resolve handlers from registryResult (wires setState/getState from store).
|
|
194
275
|
const handlers = this.options.registryResult
|
|
195
|
-
? this.options.registryResult.handlers(() => setState, () =>
|
|
276
|
+
? this.options.registryResult.handlers(() => setState, () => guardedStore.getSnapshot())
|
|
196
277
|
: {};
|
|
197
278
|
const loading = this.options.loading;
|
|
198
279
|
const functions = this.options.functions;
|
|
@@ -254,8 +335,10 @@ export class PlayRenderer {
|
|
|
254
335
|
// place. Elements without state bindings keep their DOM node identity
|
|
255
336
|
// (focus, selection, scroll survive unrelated updates). View
|
|
256
337
|
// transitions still perform a full rebuild — this method runs anew.
|
|
257
|
-
const incremental = createIncrementalRenderer(view,
|
|
258
|
-
|
|
338
|
+
const incremental = createIncrementalRenderer(view, guardedStore, this.registry, this.container, renderOptions);
|
|
339
|
+
// subscribe passes through the guard untouched (identical function
|
|
340
|
+
// reference) — only set/update are wrapped.
|
|
341
|
+
this.storeUnsubscribe = guardedStore.subscribe(() => {
|
|
259
342
|
// Guard: skip if PlayRenderer has been disconnected.
|
|
260
343
|
// Handles the edge case where a StateStore implementation fires its
|
|
261
344
|
// subscribed callbacks synchronously within its own unsubscribe() call.
|
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,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,
|
|
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,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAA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BACrE,mEAAmE;gBACnE,2CAA2C;gBAC3C,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,YAAY,EACZ,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,aAAa,CACb,CAAC;QAEF,mEAAmE;QACnE,4CAA4C;QAC5C,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAC,SAAS,CAAC,GAAG,EAAE;YACnD,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/index.d.ts
CHANGED
|
@@ -30,7 +30,8 @@ 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 "@xmachines/json-render-dom";
|
|
33
|
+
export { defineRegistry, renderSpec, schema, createValidationRegistry, } from "@xmachines/json-render-dom";
|
|
34
|
+
export type { ValidationRegistry, FieldValidationState } from "@xmachines/json-render-dom";
|
|
34
35
|
export type { RenderSpecOptions } from "@xmachines/json-render-dom";
|
|
35
36
|
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
37
|
//# 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,
|
|
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,EACN,cAAc,EACd,UAAU,EACV,MAAM,EACN,wBAAwB,GACxB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC3F,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
|
@@ -30,5 +30,5 @@ export { PlayRenderer } from "./PlayRenderer.js";
|
|
|
30
30
|
export { createRenderer } from "./create-renderer.js";
|
|
31
31
|
export { createPlayUI } from "./create-play-ui.js";
|
|
32
32
|
// @xmachines/json-render-dom (re-exported for consumer convenience)
|
|
33
|
-
export { defineRegistry, renderSpec, schema } from "@xmachines/json-render-dom";
|
|
33
|
+
export { defineRegistry, renderSpec, schema, createValidationRegistry, } 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,oEAAoE;AACpE,OAAO,
|
|
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,EACN,cAAc,EACd,UAAU,EACV,MAAM,EACN,wBAAwB,GACxB,MAAM,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-dom",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vanilla DOM renderer for XMachines Play architecture with signal-driven rendering",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"actor",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"author": "XMachines Contributors",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+
|
|
18
|
+
"url": "git+https://gitlab.com/xmachin-es/xmachines-js.git",
|
|
19
19
|
"directory": "packages/play-dom"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
@@ -24,51 +24,53 @@
|
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
27
30
|
"exports": {
|
|
28
31
|
".": {
|
|
29
|
-
"source": "./src/index.ts",
|
|
30
32
|
"types": "./dist/index.d.ts",
|
|
31
|
-
"
|
|
32
|
-
}
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
33
36
|
},
|
|
34
37
|
"publishConfig": {
|
|
35
38
|
"access": "public"
|
|
36
39
|
},
|
|
37
40
|
"scripts": {
|
|
38
|
-
"build": "tsc --build",
|
|
41
|
+
"build": "vite build && tsc --build",
|
|
39
42
|
"clean": "rm -rf dist *.tsbuildinfo coverage .vitest-attachments test/browser/__screenshots__ node_modules/.svelte2tsx-* node_modules/.vite*",
|
|
40
43
|
"lint": "oxlint .",
|
|
41
44
|
"format": "oxfmt .",
|
|
42
|
-
"test": "vitest"
|
|
43
|
-
"prepublishOnly": "npm run build"
|
|
45
|
+
"test": "vitest"
|
|
44
46
|
},
|
|
45
47
|
"dependencies": {
|
|
46
|
-
"@xmachines/play": "2.0.0
|
|
47
|
-
"@xmachines/play-actor": "2.0.0
|
|
48
|
-
"@xmachines/play-signals": "2.0.0
|
|
48
|
+
"@xmachines/play": "2.0.0",
|
|
49
|
+
"@xmachines/play-actor": "2.0.0",
|
|
50
|
+
"@xmachines/play-signals": "2.0.0"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
53
|
"@testing-library/jest-dom": "^6.9.1",
|
|
52
|
-
"@types/node": "^26.
|
|
53
|
-
"@vitest/browser-playwright": "^4.1.
|
|
54
|
-
"@xmachines/json-render-core": "^0.
|
|
55
|
-
"@xmachines/json-render-dom": "^0.
|
|
56
|
-
"@xmachines/json-render-xstate": "^0.
|
|
57
|
-
"@xmachines/shared": "2.0.0-alpha.1",
|
|
54
|
+
"@types/node": "^26.2.0",
|
|
55
|
+
"@vitest/browser-playwright": "^4.1.11",
|
|
56
|
+
"@xmachines/json-render-core": "^0.20.0-xm.2",
|
|
57
|
+
"@xmachines/json-render-dom": "^0.20.0-xm.2",
|
|
58
|
+
"@xmachines/json-render-xstate": "^0.20.0-xm.2",
|
|
58
59
|
"@xstate/store": "^3.17.0",
|
|
59
|
-
"oxfmt": "^0.
|
|
60
|
-
"oxlint": "^1.
|
|
60
|
+
"oxfmt": "^0.64.0",
|
|
61
|
+
"oxlint": "^1.79.0",
|
|
61
62
|
"typescript": "^5.9.3 || ^6.0.3",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
63
|
+
"vite": "^8.0.10",
|
|
64
|
+
"vitest": "^4.1.11",
|
|
65
|
+
"xstate": "^5.31.0",
|
|
64
66
|
"zod": "^4.4.1"
|
|
65
67
|
},
|
|
66
68
|
"peerDependencies": {
|
|
67
|
-
"@xmachines/json-render-core": "^0.
|
|
68
|
-
"@xmachines/json-render-dom": "^0.
|
|
69
|
-
"@xmachines/json-render-xstate": "^0.
|
|
69
|
+
"@xmachines/json-render-core": "^0.20.0-xm.2",
|
|
70
|
+
"@xmachines/json-render-dom": "^0.20.0-xm.2",
|
|
71
|
+
"@xmachines/json-render-xstate": "^0.20.0-xm.2",
|
|
70
72
|
"@xstate/store": "^3.17.0",
|
|
71
|
-
"xstate": "^
|
|
73
|
+
"xstate": "^5.31.0"
|
|
72
74
|
},
|
|
73
75
|
"engines": {
|
|
74
76
|
"node": ">=22.0.0"
|