@xmachines/play-dom 6.1.0 → 7.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.
@@ -1 +1 @@
1
- {"version":3,"file":"PlayRenderer.js","sourceRoot":"","sources":["../src/PlayRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACN,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAKvE;;;;;;;;;;;;GAYG;AACH,MAAM,cAAc,GAAG;IACtB,SAAS,EACR,6EAA6E;QAC7E,uCAAuC;IACxC,YAAY,EACX,+DAA+D;QAC/D,8DAA8D;CAC/D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAS,oBAAoB,CAAC,cAAuB;IACpD,OAAO,CAAC,KAAK,CACZ,yDAAyD;QACxD,mDAAmD,EACpD,cAAc,CACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,OAAO,YAAY;IA0GN;IACA;IACA;IACA;IA5GlB;;;;;;;OAOG;IACK,SAAS,GAAG,KAAK,CAAC;IAClB,OAAO,GAAwB,IAAI,CAAC;IACpC,gBAAgB,GAAwB,IAAI,CAAC;IACrD;;;;;;;OAOG;IACK,aAAa,GAAG,IAAI,GAAG,EAAc,CAAC;IAC9C;;;;;;;;;;OAUG;IACK,WAAW,GAAuB,SAAS,CAAC;IAC5C,YAAY,GAAsB,IAAI,CAAC;IAC/C;;;;;;;OAOG;IACK,WAAW,G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CAAC;QAEF,2EAA2E;QAC3E,gFAAgF;QAChF,sFAAsF;QACtF,sFAAsF;QACtF,uFAAuF;QACvF,kFAAkF;QAClF,wEAAwE;QACxE,MAAM,WAAW,GAAG,yBAAyB,CAC5C,IAAI,EACJ,YAAY,EACZ,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,aAAa,CACb,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;QAElC,sFAAsF;QACtF,kDAAkD;QAClD,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAC,SAAS,CAAC,GAAG,EAAE;YACnD,+DAA+D;YAC/D,iFAAiF;YACjF,6DAA6D;YAC7D,IAAI,CAAC,IAAI,CAAC,KAAK;gBAAE,OAAO;YACxB,8EAA8E;YAC9E,kFAAkF;YAClF,iFAAiF;YACjF,+EAA+E;YAC/E,iFAAiF;YACjF,+EAA+E;YAC/E,+EAA+E;YAC/E,gFAAgF;YAChF,+EAA+E;YAC/E,oCAAoC;YACpC,IAAI,CAAC;gBACJ,WAAW,CAAC,MAAM,EAAE,CAAC;YACtB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;QACF,CAAC,CAAC,CAAC;QACH,WAAW,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC;CACD"}
1
+ {"version":3,"file":"PlayRenderer.js","names":[],"sources":["../src/PlayRenderer.ts"],"sourcesContent":["/**\n * PlayRenderer.ts — the XMachines wrapper of @xmachines/json-render-dom.\n *\n * It connects actor.currentView, an atom, to the DOM renderer below it, through the\n * view session of @xmachines/play-view. It gives you the connect() method and the disconnect() method, in\n * the same pattern as the PlayRenderer class of play-react, of play-vue, and of\n * play-solid.\n *\n * The state store: the renderer uses the external `store` option when the caller\n * gives one, and this is the controlled mode. Without that option, it makes a new\n * @xstate/store atom for each view transition, with the values of spec.state.\n */\n\nimport { createAtom } from \"@xmachines/play-atom\";\nimport type { OnRenderError, RenderErrorInfo, StateStore } from \"@xmachines/json-render-core\";\nimport { xstateStoreStateStore } from \"@xmachines/json-render-xstate\";\nimport {\n\tbindStoreHandlers,\n\tcreateReportGuard,\n\tcreateViewSession,\n\tforwardRenderError,\n} from \"@xmachines/play-view\";\nimport type {\n\tReportGuard,\n\tViewActor,\n\tViewSession,\n\tViewSessionSnapshot,\n} from \"@xmachines/play-view\";\nimport type { PlaySpec } from \"@xmachines/play-view\";\nimport { releaseQuietly } from \"@xmachines/core/utils\";\nimport { createIncrementalRenderer } from \"@xmachines/json-render-dom\";\nimport type { IncrementalDomRenderer, RenderSpecOptions } from \"@xmachines/json-render-dom\";\nimport type { DomRegistry } from \"@xmachines/json-render-dom\";\nimport type { PlayDomOptions } from \"./types.js\";\n\n/**\n * What the report guard writes, and what it lets through.\n *\n * It CONTAINS a handler of the host that throws, exactly as the four framework renderers\n * do. The five hold one rule, and a caller learns it one time: a handler of the host never\n * defeats the containment. A host that must escalate raises the failure from a task of its\n * own, which reaches the global handler of the page in every one of the five.\n *\n * It stands ABOVE the doc comment of the class, and so does every other declaration of\n * this module: a declaration takes the comment block that stands directly before it, so a\n * const or a function placed between that comment and the class takes the documentation\n * of `PlayRenderer` with it, and the class reaches the generated reference with none.\n */\nconst GUARD_MESSAGES = {\n\tnoHandler:\n\t\t\"[@xmachines/play-dom] PlayRenderer contained a failed rebuild of the view. \" +\n\t\t\"Give an onError option to receive it.\",\n\thandlerThrew:\n\t\t\"[@xmachines/play-dom] the onError handler of the host threw. \" +\n\t\t\"PlayRenderer contained the failure of the view all the same.\",\n};\n\n/**\n * Reports a failure of one release of a caller, for `releaseQuietly` of `@xmachines/core/utils`.\n *\n * Every release that `disconnect()`, `render()`, and `resetFailedRebuild()` run is CODE\n * OF A CALLER: the `unsubscribe` of a store that the host gave, and the watch cleanups\n * that the inner renderer registered. Each one can throw, and a throw must stop no path.\n * `render()` releases the registrations of the previous view on the path of a view that\n * works, and the comment at that call gives its reason.\n *\n * `resetFailedRebuild()` runs the releases of a FAILED rebuild, BEFORE the renderer\n * contains the failure of the view. A throw there takes the containment down with it: the\n * catch that called it reaches `contain()` never, so the failure of the view reaches no\n * handler, the dead tree stays on the screen, and the failure of the release escapes in\n * its place — which is both outcomes that the containment exists to prevent.\n *\n * `disconnect()` has no containment to defeat, and it has the same rule for a second\n * reason: a throw from the first release skips every release after it, it skips the clear\n * of the container, and it skips the reset of the identity. The renderer then holds a\n * half teardown that no caller can complete.\n *\n * Each release therefore stands alone, and a failure of one goes to `console.error`.\n */\nfunction reportReleaseFailure(releaseFailure: unknown): void {\n\tconsole.error(\n\t\t\"[@xmachines/play-dom] a release of PlayRenderer threw. \" +\n\t\t\t\"The renderer completed the teardown all the same.\",\n\t\treleaseFailure,\n\t);\n}\n\n/**\n * PlayRenderer connects the `currentView` atom of an actor to the DOM renderer.\n *\n * It watches `actor.currentView` through the atoms. It renders each\n * `DomComponentRenderer` function into `container` on every view transition.\n * `disconnect()` clears the container.\n *\n * Every option of `PlayDomOptions`, which extends `UIProviderOptions`, goes into\n * `DomRenderContext` on each render pass:\n * - `functions` — the named compute functions of a `{ $computed: \"name\" }` prop expression\n * - `directives` — your own dynamic values with a `$` prefix, from `defineDirective`. The renderer resolves them with the props\n * - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`\n * - `navigate` — the navigation callback. The renderer calls it for an `onSuccess: { navigate: \"...\" }` action binding\n * - `onRenderError` — the renderer calls it with `(error, name, info)` for each failure that the inner renderer reports\n *\n * **The preferred use, with `registryResult`:**\n * ```typescript\n * import { PlayRenderer, defineRegistry } from \"@xmachines/play-dom\";\n *\n * const registryResult = defineRegistry(catalog, { components, actions });\n * const renderer = new PlayRenderer(container, actor, registryResult.registry, {\n * registryResult, // it connects setState and getState of the xstate store for you\n * navigate: (path) => myRouter.push(path),\n * functions: { fullName: (args) => `${args.first} ${args.last}` },\n * });\n * renderer.connect();\n * // Later:\n * renderer.disconnect();\n * ```\n *\n * **The controlled store mode** — you give your own `StateStore`:\n * ```typescript\n * import { createAtom } from \"@xmachines/play-atom\";\n * import { xstateStoreStateStore } from \"@xmachines/json-render-xstate\";\n *\n * const atom = createAtom({ username: \"\" });\n * const store = xstateStoreStateStore({ atom });\n * const renderer = new PlayRenderer(container, actor, registry, { registryResult, store });\n * renderer.connect();\n * ```\n *\n * A second `connect()` is safe. A `connect()` call on a connected renderer\n * disconnects it first. Therefore the renderer holds no second render\n * subscription.\n */\nexport class PlayRenderer {\n\t/**\n\t * True from the start of `connect()` to the end of `disconnect()`.\n\t *\n\t * The watcher cannot answer this question. `connect()` installs it AFTER the\n\t * synchronous first render, so a host that calls `connect()` again from the `onError`\n\t * of that render finds no watcher, and a test of the watcher alone would skip the\n\t * `disconnect()` and leave the guard of the abandoned connection alive for ever.\n\t */\n\tprivate connected = false;\n\tprivate unwatch: (() => void) | null = null;\n\tprivate storeUnsubscribe: (() => void) | null = null;\n\t/**\n\t * The cleanup functions of the live watch subscriptions. This field is a `Set`,\n\t * and not an array, so that each registered cleanup function can delete ITSELF on\n\t * its call: the incremental renderer releases a watcher when its element unmounts,\n\t * and it calls the registered wrapper. The Set therefore shrinks with the live\n\t * subscriptions. It does not collect one spent closure for each historical mount of\n\t * a view with a long life.\n\t */\n\tprivate watchCleanups = new Set<() => void>();\n\t/**\n\t * The generation of the store behind the tree on the screen, from the lifecycle. A\n\t * resolution with the same generation keeps the store: only the /context projection\n\t * moved, or a composed view changed its page, so the renderer keeps the tree and the\n\t * ephemeral view state, such as a draft or a toggle. A new generation is a new store,\n\t * and the renderer builds the tree again. A null emission, from a state with no\n\t * meta.view, is a GAP, and not a new view: the DOM goes away, but the lifecycle keeps\n\t * the store. A return to the same view therefore builds again around the ephemeral\n\t * state that survived, in the same way as the framework providers.\n\t */\n\tprivate treeGeneration: number | undefined = undefined;\n\t/**\n\t * The incremental renderer of the live tree, and the `root` and `elements` of the\n\t * spec that it renders. An emission with the same viewKey and the same two\n\t * references moved the /context projection alone. An emission with the same\n\t * viewKey and a new `elements` object is a new spec of the same view — a composed\n\t * view whose page changed, or a streamed chunk — and the renderer takes it in place\n\t * through `setSpec`.\n\t */\n\tprivate incremental: IncrementalDomRenderer | null = null;\n\tprivate lastRoot: string | undefined = undefined;\n\tprivate lastElements: PlaySpec[\"elements\"] | undefined = undefined;\n\t/** The fallback element, built at the first moment that the renderer shows it. */\n\tprivate fallbackElement: HTMLElement | null = null;\n\t/**\n\t * The view session of the connection, from @xmachines/play-view. It resolves the store\n\t * of each view by the rules of the lifecycle — it seeds the store again on a change of\n\t * the viewKey, and it refreshes /context in place in every other case — and it hands\n\t * this renderer one snapshot for each attempt. Its generation decides whether the live\n\t * tree stays. `connect()` makes one, and `disconnect()` drops it with its store.\n\t */\n\tprivate session: ViewSession | null = null;\n\t/**\n\t * `disconnect()` sets this field to `false` before it calls `storeUnsub()`.\n\t * The `rerender` closure reads the flag at its start. Therefore a synchronous\n\t * callback from the `StateStore` implementation inside its own `unsubscribe()`\n\t * call, which is rare but correct, changes no detached DOM tree.\n\t */\n\tprivate alive = true;\n\n\t/**\n\t * The depth of the synchronous calls into the inner renderer: `render()`, `setSpec()`\n\t * and `update()`. A failure of the root that the inner renderer reports inside such a\n\t * call waits for the end of the call. See {@link PlayRenderer.failRoot}.\n\t */\n\tprivate innerDepth = 0;\n\n\t/**\n\t * The failure of the root that the inner renderer reported, until the renderer\n\t * contains it, and the inner renderer that reported it.\n\t */\n\tprivate rootFailure: { error: unknown; owner: IncrementalDomRenderer } | null = null;\n\n\t/**\n\t * The report guard, from @xmachines/play-view.\n\t *\n\t * It blocks a reset that the host calls from INSIDE the report, and every reset once\n\t * the renderer is disconnected. The five renderers share the one implementation.\n\t *\n\t * `alive` cannot answer the second half. A contained failure sets that flag to `false`\n\t * and the next emission sets it back, because it guards the callback of the store\n\t * subscription — a reset that a host keeps outlives both.\n\t */\n\t// It is NOT readonly: `disconnect()` disposes the guard, and `connect()` revives the\n\t// renderer, so a reconnected renderer needs a guard that is not spent.\n\tprivate guard: ReportGuard = createReportGuard(GUARD_MESSAGES);\n\n\t/**\n\t * The retry that every report of THIS connection hands the host.\n\t *\n\t * `connect()` builds one, beside the guard that it belongs to. The four framework\n\t * renderers hand the host one reset for the life of the provider, and this field holds\n\t * the same rule for the life of the connection.\n\t */\n\tprivate retry: () => void = this.retryOf(this.guard);\n\n\t/**\n\t * @param container - The `HTMLElement` to render into. Each view transition clears it and fills it again.\n\t * @param actor - The actor with the `currentView` atom. It must implement `Viewable`.\n\t * @param registry - The map of the component renderers, usually `registryResult.registry` from `defineRegistry`.\n\t * @param options - The configuration. See {@link PlayDomOptions}:\n\t * - `registryResult` — it connects `setState` and `state` of the xstate store for you.\n\t * - `store` — an external `StateStore`, which is the controlled mode. It replaces the values of `spec.state`.\n\t * - `loading` — the flag of the streaming mode. It stops each warning about an absent child.\n\t * - `functions` — the named compute functions of a `$computed` prop expression.\n\t * - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props.\n\t * - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`.\n\t * - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: \"...\" }`.\n\t * - `onRenderError` — the `(error, name, info)` handler of each failure that the inner renderer reports. It stops the `[json-render]` console line.\n\t * - `onError` — the `(error, reset)` handler of a failure of the view: a failure of the root, or of a complete rebuild. The renderer contains such a failure always, and this option says where the report goes.\n\t * - `fallback` — the element to show for every null view, and after a contained failure.\n\t */\n\tconstructor(\n\t\tprivate readonly container: HTMLElement,\n\t\tprivate readonly actor: ViewActor,\n\t\tprivate readonly registry: DomRegistry,\n\t\tprivate readonly options: PlayDomOptions = {},\n\t) {}\n\n\t/**\n\t * Starts the watch of actor.currentView, and renders into the container.\n\t * It renders the first view synchronously, then it subscribes to the atom changes.\n\t *\n\t * A `connect()` call on a connected renderer, where a `disconnect()` call did not\n\t * follow the previous `connect()`, installs a second subscription of the view.\n\t * Each view change then renders two times. Therefore this method disconnects the\n\t * renderer first.\n\t */\n\tconnect(): void {\n\t\tif (this.connected) this.disconnect();\n\t\tthis.connected = true;\n\t\tconst guard = createReportGuard(GUARD_MESSAGES);\n\t\tthis.guard = guard;\n\t\t// ONE retry for the connection, as the four framework renderers hand the host one\n\t\t// reset for the life of the provider. A retry built for each report gives a host\n\t\t// that keys a Map on the callback one entry for each failure.\n\t\tthis.retry = this.retryOf(guard);\n\t\t// The subscription connects the session. The session watches the view of the actor\n\t\t// BEFORE it resolves, so a host that repairs the actor from `onError` moves an atom\n\t\t// that it watches already, and the screen follows the repair. It then resolves, and\n\t\t// it notifies this renderer, which renders the first view SYNCHRONOUSLY. That render\n\t\t// can reach `onError`, and it needs no `try`: the renderer contains a failed rebuild,\n\t\t// and the guard contains a handler of the host that throws.\n\t\tconst session = createViewSession(this.actor, this.options.store, {\n\t\t\tcreateStore: (seed) => xstateStoreStateStore({ atom: createAtom(seed) }),\n\t\t});\n\t\tthis.session = session;\n\t\tconst release = session.subscribe(() => {\n\t\t\tthis.render(session.getSnapshot());\n\t\t});\n\t\t// A host that tears the renderer down from the handler of the first render disposed\n\t\t// this session already, and the release then does nothing.\n\t\tthis.unwatch = release;\n\t}\n\n\t/**\n\t * Stops the watch and clears the container.\n\t */\n\tdisconnect(): void {\n\t\tthis.connected = false;\n\t\tthis.guard.dispose();\n\t\treleaseQuietly(this.unwatch, reportReleaseFailure);\n\t\tthis.unwatch = null;\n\t\t// Set alive = false before the release. A synchronous rerender callback from inside\n\t\t// an unsubscribe() therefore returns at once.\n\t\tthis.alive = false;\n\t\tthis.releaseTree();\n\t\tthis.container.replaceChildren();\n\t\t// The rule of the lifetime: the store that stays alive dies with the connection.\n\t\tthis.forgetTree();\n\t\tthis.session?.dispose();\n\t\tthis.session = null;\n\t}\n\n\t/**\n\t * Releases the store subscription and the watch subscriptions of the tree.\n\t *\n\t * It captures both and clears both BEFORE a release. Some store implementations fire a\n\t * synchronous callback during their unsubscribe(). Without this order, that callback\n\t * sees a live storeUnsubscribe, and it enters the rerender path again with an old view\n\t * and an old store, or it overwrites watchCleanups before the loop below reaches it.\n\t *\n\t * See reportReleaseFailure: a throw of one release must skip none of the work below it.\n\t * This is code of a caller, and it also runs on the path of a view that WORKS.\n\t */\n\tprivate releaseTree(): void {\n\t\tconst storeUnsub = this.storeUnsubscribe;\n\t\tconst watchCleanups = [...this.watchCleanups];\n\t\tconst incremental = this.incremental;\n\t\tthis.storeUnsubscribe = null;\n\t\tthis.watchCleanups = new Set();\n\t\tthis.rootFailure = null;\n\t\treleaseQuietly(storeUnsub, reportReleaseFailure);\n\t\t// The inner renderer shows a store write at its COMMIT POINT, a microtask after the\n\t\t// write. A tree that goes must therefore stop the work that waits: without the\n\t\t// dispose, a commit of the old tree renders into the container after the next view,\n\t\t// or after a disconnect(). The dispose also runs the cleanups of `ctx.effect` and\n\t\t// releases the watch subscriptions and the fields of the tree.\n\t\tif (incremental !== null) releaseQuietly(() => incremental.dispose(), reportReleaseFailure);\n\t\tfor (const cleanup of watchCleanups) releaseQuietly(cleanup, reportReleaseFailure);\n\t}\n\n\t/** Forgets the tree on the screen, so that the next emission builds it again. */\n\tprivate forgetTree(): void {\n\t\tthis.treeGeneration = undefined;\n\t\tthis.incremental = null;\n\t\tthis.lastRoot = undefined;\n\t\tthis.lastElements = undefined;\n\t}\n\n\t/**\n\t * The number of live watch-subscription cleanup functions now.\n\t *\n\t * @internal This accessor is for a test only. A test asserts with it that the\n\t * collection of the watch cleanups holds the live registrations, and that no mount\n\t * leaks. It is not part of the public API, and it can change without a notice.\n\t */\n\tget watchCleanupCount(): number {\n\t\treturn this.watchCleanups.size;\n\t}\n\n\t/**\n\t * Brings the screen in line with one snapshot of the view session.\n\t *\n\t * The session resolved the store already: it refreshed /context in place, or it seeded\n\t * a new store, or it recorded the failure of `spec.state`. This method decides the\n\t * tree alone.\n\t */\n\tprivate render(snapshot: ViewSessionSnapshot): void {\n\t\tconst { view } = snapshot;\n\t\t// A failed resolution aborts the rebuild exactly as a failure of renderView does, so\n\t\t// the containment covers it. `spec.state` can fail — the accessor of a projection\n\t\t// throws, or a seed of the store does. The session gives no report of its own here:\n\t\t// failView() takes the registrations of the dead tree down BEFORE the report, and\n\t\t// that order is load-bearing.\n\t\tif (snapshot.failure) {\n\t\t\tthis.failView(snapshot.failure.error);\n\t\t\treturn;\n\t\t}\n\n\t\t// ── A live tree ──────────────────────────────────────────────────────────\n\t\t// The same generation keeps the tree, so the ephemeral view state stays: the store\n\t\t// subscription below calls incremental.update(), which compares the snapshots and\n\t\t// patches the elements of the change only. A new spec of the same store — a composed\n\t\t// view whose page changed, or a streamed chunk — goes to setSpec, which keeps each\n\t\t// node whose element did not change. The store update reached the incremental\n\t\t// renderer first, on the spec that it holds, and setSpec then renders the new spec\n\t\t// against the store of NOW. A new generation is a new store, and the tree builds\n\t\t// again.\n\t\tif (view !== null && this.incremental !== null && this.storeUnsubscribe !== null) {\n\t\t\tif (snapshot.generation === this.treeGeneration) {\n\t\t\t\tconst incremental = this.incremental;\n\t\t\t\ttry {\n\t\t\t\t\tif (view.root !== this.lastRoot || view.elements !== this.lastElements) {\n\t\t\t\t\t\t// Record the spec BEFORE the call. A failure of the root in the call\n\t\t\t\t\t\t// forgets the tree, and the record must not survive that.\n\t\t\t\t\t\tthis.lastRoot = view.root;\n\t\t\t\t\t\tthis.lastElements = view.elements;\n\t\t\t\t\t\tthis.callInner(incremental, () => incremental.setSpec(view));\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.failView(error);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.clearTree();\n\t\t// A null emission is a gap between two views, and not a new view: the session keeps\n\t\t// its store, so a return to the same identity uses the store again. disconnect()\n\t\t// stays the boundary of the lifetime.\n\t\tif (view === null || snapshot.store === null) {\n\t\t\t// Show the fallback for EVERY null view, and not for the first mount only. The\n\t\t\t// four framework providers hold the same rule: a null currentView renders the\n\t\t\t// placeholder content of the provider, at any moment of the life of the tree.\n\t\t\tthis.showFallback();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis.renderView(view, snapshot.store, snapshot.generation);\n\t\t} catch (error) {\n\t\t\t// Containment: the renderer holds a failure of the complete rebuild ALWAYS. It\n\t\t\t// propagates none — not out of connect() for the initial view, and not out of\n\t\t\t// the listener of the session for a later view. No option turns this on, and\n\t\t\t// none turns it off.\n\t\t\t// failView() clears the container and fills it with the fallback, exactly as on\n\t\t\t// a null view. The next view that renders clears the container again, which\n\t\t\t// removes the fallback.\n\t\t\tthis.failView(error);\n\t\t}\n\t}\n\n\t/**\n\t * Takes the tree of the previous view off the screen, before a rebuild.\n\t *\n\t * The watch subscriptions of the previous view must go too. Without this step, they\n\t * stay active between a view transition and the first store update of the new view.\n\t * They then hold a reference to a DOM element that is gone, and the garbage collector\n\t * cannot take it.\n\t */\n\tprivate clearTree(): void {\n\t\tthis.alive = true;\n\t\tthis.releaseTree();\n\t\t// Forget the released tree, as resetFailedRebuild() does. A tree that stayed named\n\t\t// here kept a disposed inner renderer, and only the null test of storeUnsubscribe in\n\t\t// render() kept the fast path off it.\n\t\tthis.forgetTree();\n\t\tthis.container.replaceChildren();\n\t}\n\n\t/**\n\t * The end of a render that failed, in ONE place.\n\t *\n\t * Three paths render — the fast path of a slice, the complete rebuild, and the write\n\t * of the store — and each one ends here: through a throw, or through a failure of the\n\t * root that the inner renderer reports (see {@link PlayRenderer.failRoot}). The ORDER\n\t * is load-bearing: the reset takes the registrations of the dead tree down BEFORE the\n\t * report, so a handler of the host that renders again meets a renderer that holds\n\t * nothing of the failed attempt. A second copy of the pair is a second chance to put\n\t * the two in the other order.\n\t *\n\t * @param error - The failure that the renderer contains.\n\t */\n\tprivate failView(error: unknown): void {\n\t\tthis.resetFailedRebuild();\n\t\tthis.contain(error);\n\t}\n\n\t/**\n\t * Gives a failure that the inner renderer reports to the handler of the host, and\n\t * contains a failure of the ROOT as a failure of the view.\n\t *\n\t * The inner renderer reports each failure one time, with `(error, name, info)`. This\n\t * method gives each one to `forwardRenderError` of @xmachines/play-view, which holds\n\t * the rule of the five renderers: the `onRenderError` of the host, or the handler of the\n\t * registry, or the one `[json-render]` console line.\n\t *\n\t * A failure of the root — its component, a prop, or its `visible` condition — leaves\n\t * no view on the screen. The inner renderer throws it to no caller, so the renderer\n\t * contains it here, as it contains a complete rebuild that throws: it shows the\n\t * fallback, and it reports the failure to `onError` one time. A handler of the host\n\t * also gets it, with `info.kind` `\"root\"`. Without such a handler, the method writes\n\t * no `[json-render]` line for it: the containment reports it to `onError`, or to its\n\t * own console line, and a second line would report one failure two times.\n\t *\n\t * @param owner - The inner renderer that this handler belongs to, or `null` before it exists.\n\t */\n\tprivate reportInner(\n\t\towner: IncrementalDomRenderer | null,\n\t\terror: unknown,\n\t\tname: string,\n\t\tinfo: RenderErrorInfo | undefined,\n\t): void {\n\t\tconst root = forwardRenderError(\n\t\t\tthis.options.onRenderError,\n\t\t\tthis.registry,\n\t\t\terror,\n\t\t\tname,\n\t\t\tinfo,\n\t\t);\n\t\tif (root && owner !== null) this.failRoot(owner, error);\n\t}\n\n\t/**\n\t * Contains a failure of the root that the inner renderer reported.\n\t *\n\t * The report comes in the middle of the work of the inner renderer, which writes the\n\t * container after it. The containment therefore waits for the end of that work. Inside\n\t * a synchronous call, {@link PlayRenderer.callInner} contains the failure when the call\n\t * returns. At the commit point of a store write, which no call of this class holds, a\n\t * microtask contains it.\n\t *\n\t * @param owner - The inner renderer that reported the failure.\n\t * @param error - The failure of the root.\n\t */\n\tprivate failRoot(owner: IncrementalDomRenderer, error: unknown): void {\n\t\tif (this.incremental !== owner || this.rootFailure !== null) return;\n\t\tthis.rootFailure = { error, owner };\n\t\tif (this.innerDepth > 0) return;\n\t\tqueueMicrotask(() => this.settleRoot());\n\t}\n\n\t/**\n\t * Hands the failure of the root that waits to the session, when it belongs to the\n\t * live tree.\n\t *\n\t * The four framework providers take the same path: `failView` of the session records\n\t * the failure in a new snapshot, and it gives the next attempt a new generation. The\n\t * session then notifies this renderer, and `render()` contains the failed snapshot\n\t * with {@link PlayRenderer.failView}: it clears the tree, shows the fallback, and\n\t * reports to `onError` one time. The session has no `onFailure` here, so it reports\n\t * nothing of its own.\n\t */\n\tprivate settleRoot(): void {\n\t\tconst failure = this.rootFailure;\n\t\tthis.rootFailure = null;\n\t\tif (failure === null || this.incremental !== failure.owner) return;\n\t\tthis.session?.failView(failure.error);\n\t}\n\n\t/**\n\t * Runs one synchronous call into the inner renderer, and then contains a failure of the\n\t * root that the call reported.\n\t *\n\t * @param owner - The inner renderer of the call.\n\t * @param call - The call: `render()`, `setSpec()` or `update()`.\n\t */\n\tprivate callInner(owner: IncrementalDomRenderer, call: () => void): void {\n\t\tthis.innerDepth += 1;\n\t\ttry {\n\t\t\tcall();\n\t\t} finally {\n\t\t\tthis.innerDepth -= 1;\n\t\t}\n\t\tif (this.innerDepth === 0 && this.rootFailure?.owner === owner) this.settleRoot();\n\t}\n\n\t/**\n\t * Clears the screen of the failed view, shows the fallback, and reports the failure.\n\t *\n\t * The renderer contains such a failure ALWAYS. No option turns the containment on,\n\t * and none turns it off: `onError` says where the report goes, and `fallback` says\n\t * what the empty container shows. The four framework renderers hold the same rule,\n\t * because an error boundary of a framework is not an option that a caller turns off.\n\t * A host that must escalate a failure raises it from a task of its own —\n\t * `rethrowLater(error)` of `@xmachines/core/utils` — because the guard contains a handler\n\t * that throws, exactly as the four framework renderers do.\n\t *\n\t * The container is cleared FIRST. The fast path of a slice holds the live tree of the\n\t * previous emission, and that tree is dead as soon as the refresh throws, so the\n\t * renderer must not keep it on the screen. A clear container also lets the fallback\n\t * stand alone.\n\t *\n\t * The SCREEN comes first, and the report second: a handler that throws — a reporter\n\t * that fails, or one that re-raises to escalate — must not defeat the containment\n\t * that it was given to observe. With the order reversed the container stays empty AND\n\t * the error escapes, which is both outcomes that the containment exists to prevent.\n\t */\n\tprivate contain(error: unknown): void {\n\t\tthis.container.replaceChildren();\n\t\tthis.showFallback();\n\n\t\t// Without `onError` the error reaches no handler and no caller. Write it to\n\t\t// `console.error`, in the same way as the inner renderer does for a component that\n\t\t// throws without an `onRenderError` handler. A silent crash is the one result that\n\t\t// no caller can debug.\n\t\tconst { onError } = this.options;\n\t\t// The guard and the retry of THIS connection, read one time. A `connect()` that the\n\t\t// handler starts replaces both fields, and this report belongs to the connection\n\t\t// that reported.\n\t\tconst guard = this.guard;\n\t\tconst retry = this.retry;\n\t\tguard.report(error, onError && (() => onError(error, retry)));\n\t}\n\n\t/**\n\t * Builds the retry that one report hands the host.\n\t *\n\t * The read of the atom happens at the moment of the CALL: a retry that held the view\n\t * that failed would take a host off the healthy screen and back onto the one that\n\t * threw.\n\t *\n\t * The retry belongs to the guard of ITS connection, and it asks that guard alone. A\n\t * host may KEEP the callback — a \"Retry\" button of a toast outlives the route that\n\t * opened it — and `disconnect()` disposes the guard that was live then. `connect()`\n\t * disconnects a connected renderer first, so every guard that leaves the field is a\n\t * disposed guard, and a retry of an older connection stays dead. The rule of the prop\n\t * is one rule: a reset after `disconnect()` does nothing.\n\t *\n\t * @param guard - The guard of the connection that this retry belongs to.\n\t */\n\tprivate retryOf(guard: ReportGuard): () => void {\n\t\treturn (): void => {\n\t\t\tif (guard.blocked()) return;\n\t\t\tthis.session?.retry();\n\t\t};\n\t}\n\n\t/**\n\t * Appends the fallback element to the container, which the caller cleared already.\n\t * The renderer calls it for a null view, and after a failure of a rebuild that it\n\t * contains. Both callers clear the container first. `appendChild` moves the node.\n\t * Therefore a second call adds no copy.\n\t */\n\tprivate showFallback(): void {\n\t\tconst fallback = this.options.fallback;\n\t\tif (fallback == null) return;\n\t\t// The producer of the fallback is CODE OF THE HOST, and it can throw: a template\n\t\t// lookup that finds nothing, a DOM API that the runtime lacks. This method runs on\n\t\t// the null path outside every try, and inside `contain()` after the containment\n\t\t// decided to hold an error — so a throw here escaped `connect()` and the callback\n\t\t// of watchAtom uncontained, and it turned a contained failure into an uncontained\n\t\t// one with the container empty.\n\t\t//\n\t\t// The report goes to `console.error` and NOT to `onError`: this method runs from\n\t\t// inside `contain()`, and a second trip through the containment would report the\n\t\t// failure of the fallback as a failure of the view.\n\t\ttry {\n\t\t\t// A producer runs at the first moment that the renderer needs the element, and\n\t\t\t// the memo keeps it: a later null view of THIS renderer shows the same node, and\n\t\t\t// a renderer whose view is never null builds nothing at all.\n\t\t\tthis.fallbackElement ??= typeof fallback === \"function\" ? fallback() : fallback;\n\t\t\tthis.container.appendChild(this.fallbackElement);\n\t\t} catch (error) {\n\t\t\tconsole.error(\n\t\t\t\t\"[@xmachines/play-dom] the fallback of PlayRenderer failed to build. \" +\n\t\t\t\t\t\"The container stays empty.\",\n\t\t\t\terror,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * A rebuild that fails must not leave the guard of the fast path armed on a dead\n\t * tree, because the container is empty already. Therefore this code resets the view\n\t * identity. The next emission, also one with the same viewKey, then makes a\n\t * complete render again. It does not patch a store that nothing shows.\n\t *\n\t * It releases the watch subscriptions of the dead tree too. A complete rebuild\n\t * releases them before it builds again, and disconnect() releases them at the end of\n\t * the life of the renderer — but a failure takes the DOM down HERE, between those two\n\t * moments. Without this step one update of the store of the host runs every watch\n\t * action of a tree that nothing shows, against detached elements, with `send` still\n\t * bound to the actor. The fast path of a slice leaves a live tree of its own, and it\n\t * reaches this code only when it fails.\n\t */\n\tprivate resetFailedRebuild(): void {\n\t\t// Set alive = false BEFORE the release — the order of disconnect(). Some StateStore\n\t\t// implementations fire a synchronous callback from inside their own unsubscribe().\n\t\t// Without the flag that callback passes the guard and runs incremental.update() on\n\t\t// the tree that this method is taking down, with `send` still bound to the actor.\n\t\t// render() sets the flag to true again on the complete rebuild that the next\n\t\t// emission makes, and the path of a live tree needs storeUnsubscribe, which is null\n\t\t// from here. This method runs BEFORE contain(), so releaseTree() reports a throw of\n\t\t// a release and lets it take the place of the failure of the view never.\n\t\tthis.alive = false;\n\t\tthis.releaseTree();\n\t\tthis.forgetTree();\n\t}\n\n\t/**\n\t * The tail of a complete rebuild, which can throw. See the catch block of render().\n\t *\n\t * @param view - The view to render.\n\t * @param guardedStore - The store of the view, from the session. Everything that the\n\t * spec can write through, which includes $bindState, setState, and a chained set,\n\t * receives the GUARDED store: /context is read-only to the spec, because the machine\n\t * context changes through an event only.\n\t * @param generation - The generation of that store, which the tree records.\n\t */\n\tprivate renderView(view: PlaySpec, guardedStore: StateStore, generation: number): void {\n\t\tconst send = this.actor.send.bind(this.actor);\n\n\t\t// Resolve the handlers from registryResult. They read and write the store with the\n\t\t// guard at the moment of an action, so each action sees the newest state. The guard\n\t\t// lets the context key of a read-modify-write round trip pass, because the round trip\n\t\t// changes that key not. A real mutation of /context throws.\n\t\tconst handlers = this.options.registryResult\n\t\t\t? bindStoreHandlers(this.options.registryResult, () => guardedStore)\n\t\t\t: {};\n\n\t\tconst loading = this.options.loading;\n\n\t\tconst functions = this.options.functions;\n\t\tconst directives = this.options.directives;\n\t\tconst validationFunctions = this.options.validationFunctions;\n\t\tconst navigate = this.options.navigate;\n\t\tconst onConfirm = this.options.onConfirm;\n\t\tconst confirmDialog = this.options.confirmDialog;\n\n\t\t// The inner renderer ALWAYS gets this handler, and the handler reads the handler of\n\t\t// the host at each report. See reportInner(): it contains a failure of the root.\n\t\tlet owner: IncrementalDomRenderer | null = null;\n\t\tconst onRenderError: OnRenderError = (error, name, info) => {\n\t\t\tthis.reportInner(owner, error, name, info as RenderErrorInfo | undefined);\n\t\t};\n\n\t\t// ── The lifecycle of a watch ─────────────────────────────────────────────\n\t\t// A watch subscription follows the MOUNT of an element, and the registry of each\n\t\t// instance in the incremental renderer manages it: an element of the first render\n\t\t// registers then, and a repeat item that the code appends later registers at that\n\t\t// moment, with the same skip-on-mount baseline. The visibility of an element hides\n\t\t// its output and keeps its watch, as the element renderer of @json-render/react\n\t\t// does: a hidden element still fires for a change of its path. The renderer\n\t\t// releases a subscription when its element unmounts, from a repeat item that the\n\t\t// code removes. It also releases each subscription on a view change, at the top of\n\t\t// this method, and on a disconnect().\n\t\t//\n\t\t// A stable element does NOT receive a new watch on each rerender. The code registers\n\t\t// the update subscription below with the store before the watch subscriptions of\n\t\t// renderSpec, and @xstate/store notifies in the order of the insertion. If a render\n\t\t// in place removed the watchers and made them again, each old watcher would die in\n\t\t// the queue, before it fires, and each new watcher would take the snapshot after the\n\t\t// update as its baseline. A watch action would then fire never. Therefore the registry\n\t\t// keeps the ORIGINAL subscription, with its baseline and its position in the\n\t\t// notification, whenever the code only renders an instance again. It registers a\n\t\t// real new mount only.\n\t\t//\n\t\t// Each registered cleanup is idempotent, and the Set watchCleanups also holds it.\n\t\t// Therefore a second call here, after the incremental renderer released it already, is\n\t\t// safe.\n\t\tconst renderOptions: RenderSpecOptions = {\n\t\t\tsend,\n\t\t\thandlers,\n\t\t\tonRenderError,\n\t\t\t...(functions !== undefined ? { functions } : {}),\n\t\t\t...(directives !== undefined ? { directives } : {}),\n\t\t\t...(loading !== undefined ? { loading } : {}),\n\t\t\tonWatchSetup: (cleanup: () => void): (() => void) => {\n\t\t\t\t// Wrap each cleanup. A call of the wrapper, from the disconnect() here or from the\n\t\t\t\t// view change here, OR from the incremental renderer when the element of the cleanup\n\t\t\t\t// unmounts, also removes the cleanup from the Set. The code returns the wrapper.\n\t\t\t\t// Therefore the incremental renderer registers THIS wrapper and calls it on a\n\t\t\t\t// release, and the Set stays in step with the live subscriptions.\n\t\t\t\tconst entry = (): void => {\n\t\t\t\t\tthis.watchCleanups.delete(entry);\n\t\t\t\t\tcleanup();\n\t\t\t\t};\n\t\t\t\tthis.watchCleanups.add(entry);\n\t\t\t\treturn entry;\n\t\t\t},\n\t\t\t...(validationFunctions !== undefined ? { validationFunctions } : {}),\n\t\t\t...(navigate !== undefined ? { navigate } : {}),\n\t\t\t...(onConfirm !== undefined ? { onConfirm } : {}),\n\t\t\t...(confirmDialog !== undefined ? { confirmDialog } : {}),\n\t\t};\n\n\t\t// ── The incremental updates ─────────────────────────────────────────────\n\t\t// A store update rebuilds the complete tree no longer: the incremental renderer\n\t\t// compares the previous snapshot and the next snapshot on the tracked $state paths of\n\t\t// each element, and it renders the elements of the change again, in place. An element\n\t\t// without a state binding keeps the identity of its DOM node. Therefore the focus, the\n\t\t// selection, and the scroll position survive an update of another element. A view\n\t\t// transition still rebuilds everything, because this method runs again.\n\t\tconst incremental = createIncrementalRenderer(\n\t\t\tview,\n\t\t\tguardedStore,\n\t\t\tthis.registry,\n\t\t\tthis.container,\n\t\t\trenderOptions,\n\t\t);\n\t\towner = incremental;\n\t\tthis.incremental = incremental;\n\t\tthis.treeGeneration = generation;\n\t\tthis.lastRoot = view.root;\n\t\tthis.lastElements = view.elements;\n\n\t\t// subscribe passes through the guard without a change, and it keeps the same function\n\t\t// reference. The guard wraps set and update only.\n\t\tthis.storeUnsubscribe = guardedStore.subscribe(() => {\n\t\t\t// The guard: stop when a caller disconnected the PlayRenderer.\n\t\t\t// This handles the case of a StateStore implementation that fires its subscribed\n\t\t\t// callbacks synchronously inside its own unsubscribe() call.\n\t\t\tif (!this.alive) return;\n\t\t\t// `incremental.update()` renders nothing itself: the inner renderer shows the\n\t\t\t// write at its commit point, a microtask later, and a failure of the root there\n\t\t\t// reaches reportInner(), which contains it. This callback runs from inside\n\t\t\t// `store.update()`, which an ACTION HANDLER of the host calls, so the action of\n\t\t\t// the host never receives a failure of the view. The try stays as a net: a throw\n\t\t\t// that leaves update() all the same is a failure of the view too, and the\n\t\t\t// containment of a failure of the view holds on every path that renders.\n\t\t\ttry {\n\t\t\t\tthis.callInner(incremental, () => incremental.update());\n\t\t\t} catch (error) {\n\t\t\t\tthis.failView(error);\n\t\t\t}\n\t\t});\n\t\tthis.callInner(incremental, () => incremental.render());\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,IAAM,iBAAiB;CACtB,WACC;CAED,cACC;AAEF;;;;;;;;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sC;IAMpD,MAAM,cAAoB;KACzB,KAAK,cAAc,OAAO,KAAK;KAC/B,QAAQ;IACT;IACA,KAAK,cAAc,IAAI,KAAK;IAC5B,OAAO;GACR;GACA,GAAI,wBAAwB,KAAA,IAAY,EAAE,oBAAoB,IAAI,CAAC;GACnE,GAAI,aAAa,KAAA,IAAY,EAAE,SAAS,IAAI,CAAC;GAC7C,GAAI,cAAc,KAAA,IAAY,EAAE,UAAU,IAAI,CAAC;GAC/C,GAAI,kBAAkB,KAAA,IAAY,EAAE,cAAc,IAAI,CAAC;EACxD;EASA,MAAM,cAAc,0BACnB,MACA,cACA,KAAK,UACL,KAAK,WACL,aACD;EACA,QAAQ;EACR,KAAK,cAAc;EACnB,KAAK,iBAAiB;EACtB,KAAK,WAAW,KAAK;EACrB,KAAK,eAAe,KAAK;EAIzB,KAAK,mBAAmB,aAAa,gBAAgB;GAIpD,IAAI,CAAC,KAAK,OAAO;GAQjB,IAAI;IACH,KAAK,UAAU,mBAAmB,YAAY,OAAO,CAAC;GACvD,SAAS,OAAO;IACf,KAAK,SAAS,KAAK;GACpB;EACD,CAAC;EACD,KAAK,UAAU,mBAAmB,YAAY,OAAO,CAAC;CACvD;AACD"}
@@ -90,7 +90,9 @@ export type MountFn = (actor: ViewActor, container: HTMLElement, options?: Mount
90
90
  * - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props.
91
91
  * - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`.
92
92
  * - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`.
93
- * - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection.
93
+ * - `onRenderError` — the `(error, name, info)` handler of each failure that the inner renderer reports.
94
+ * - `onConfirm` — the hook that decides each binding with `confirm`. Without it, the default confirm dialog shows the binding.
95
+ * - `confirmDialog` — `false` turns the default confirm dialog off. The binding then waits for `ctx.confirmation`.
94
96
  * - `onError` — the `(error, reset)` handler of a failure of a complete rebuild. The renderer
95
97
  * contains such a failure always, and this option says where the report goes.
96
98
  * - `fallback` — the content to show when the view of the actor is `null`, and after a contained
@@ -1 +1 @@
1
- {"version":3,"file":"create-play-ui.d.ts","sourceRoot":"","sources":["../src/create-play-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,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;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,OAAO,GAAG,CACrB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,YAAY,KAClB,MAAM,IAAI,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAC3B,cAAc,EAAE,oBAAoB,EACpC,OAAO,GAAE,mBAAwB,GAC/B,OAAO,CAyDT"}
1
+ {"version":3,"file":"create-play-ui.d.ts","sourceRoot":"","sources":["../src/create-play-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,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;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,OAAO,GAAG,CACrB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,YAAY,KAClB,MAAM,IAAI,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAC3B,cAAc,EAAE,oBAAoB,EACpC,OAAO,GAAE,mBAAwB,GAC/B,OAAO,CA2DT"}
@@ -1,98 +1,54 @@
1
- /**
2
- * createPlayUI — the complete DOM factory.
3
- *
4
- * It takes a `DefineRegistryResult`, and the caller calls `defineRegistry` itself.
5
- * It returns a `MountFn`. A `mount(actor, container)` call starts the renderer, and
6
- * it returns a `disconnect` cleanup function.
7
- *
8
- * The factory holds the factory options (`functions`, `validationFunctions`,
9
- * `navigate`, `onRenderError`, `onError`, and `fallback`) from the moment of its
10
- * creation, and it applies them on every `mount()` call. Give the mount options
11
- * (`store` and `loading`) to the `mount()` call itself, through `MountOptions`.
12
- *
13
- * This factory is parallel to `<PlayUIProvider registryResult={...}>` in the
14
- * framework renderers.
15
- *
16
- * @example
17
- * ```typescript
18
- * import { defineRegistry, createPlayUI } from "@xmachines/play-dom";
19
- *
20
- * const registryResult = defineRegistry(catalog, { components, actions });
21
- * const mount = createPlayUI(registryResult, {
22
- * onRenderError: console.error,
23
- * navigate: (path) => myRouter.push(path),
24
- * functions: { fullName: (args) => `${args.first} ${args.last}` },
25
- * });
26
- * const disconnect = mount(actor, document.getElementById("app")!);
27
- *
28
- * // Later:
29
- * disconnect();
30
- * ```
31
- *
32
- * @packageDocumentation
33
- */
34
1
  import { PlayRenderer } from "./PlayRenderer.js";
2
+ //#region packages/play-dom/src/create-play-ui.ts
35
3
  /**
36
- * Creates the mount function of the complete DOM renderer.
37
- *
38
- * The caller makes `registryResult` with `defineRegistry`. `createPlayUI` holds it,
39
- * and it returns a `MountFn`. Call that function one time for each pair of an actor
40
- * and a container.
41
- *
42
- * @param registryResult - The result of `defineRegistry()`. It gives the registry
43
- * and the factory of the handlers, which it builds late.
44
- * @param options - The factory configuration. See {@link CreatePlayUIOptions}:
45
- * - `functions` — the named compute functions of a `$computed` prop expression.
46
- * - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props.
47
- * - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`.
48
- * - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`.
49
- * - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection.
50
- * - `onError` — the `(error, reset)` handler of a failure of a complete rebuild. The renderer
51
- * contains such a failure always, and this option says where the report goes.
52
- * - `fallback` — the content to show when the view of the actor is `null`, and after a contained
53
- * failure of a rebuild. Give a FUNCTION when the factory mounts more than one
54
- * time, so that each renderer owns its own element.
55
- * @returns The {@link MountFn}: `(actor, container, mountOptions?) → disconnect`
56
- */
57
- export function createPlayUI(registryResult, options = {}) {
58
- const { onRenderError, onError, fallback, functions, directives, validationFunctions, navigate, onConfirm, } = options;
59
- return function mount(actor, container, mountOptions) {
60
- // Each option of UIProviderOptions (onRenderError, functions, validationFunctions,
61
- // and navigate) goes directly through PlayDomOptions, then PlayRenderer, then
62
- // renderSpec, then DomRenderContext.
63
- const rendererOptions = {
64
- registryResult,
65
- ...(mountOptions?.store !== undefined && { store: mountOptions.store }),
66
- ...(mountOptions?.loading !== undefined && { loading: mountOptions.loading }),
67
- ...(functions !== undefined && { functions }),
68
- ...(directives !== undefined && { directives }),
69
- ...(validationFunctions !== undefined && { validationFunctions }),
70
- ...(navigate !== undefined && { navigate }),
71
- ...(onConfirm !== undefined && { onConfirm }),
72
- ...(onRenderError !== undefined && { onRenderError }),
73
- // PlayRenderer owns both of them now. It contains a rebuild that throws always,
74
- // and it shows the fallback for every null view and after each contained
75
- // failure. The factory therefore forwards the two options, and it appends
76
- // nothing itself.
77
- ...(onError !== undefined && { onError }),
78
- // The producer travels UNCHANGED. PlayRenderer calls it at the first moment it
79
- // needs the element, and it holds the memo — one mount builds one renderer, so
80
- // a second memo here would hold the same element for the same lifetime. A
81
- // producer gives every renderer its own element; a single element that every
82
- // mount shares would pass from one container to the next on each null view,
83
- // because appendChild moves a node.
84
- ...(fallback != null && { fallback }),
85
- };
86
- const renderer = new PlayRenderer(container, actor, registryResult.registry, rendererOptions);
87
- // connect() renders the first view synchronously, and PlayRenderer appends the
88
- // fallback itself when that view is null.
89
- // It needs no `try`: PlayRenderer contains a failed rebuild AND a handler of the
90
- // host that throws, so `connect()` returns for every view. `mount()` therefore
91
- // always reaches the `return` below, and the caller always receives the release.
92
- renderer.connect();
93
- return function disconnect() {
94
- renderer.disconnect();
95
- };
96
- };
4
+ * Creates the mount function of the complete DOM renderer.
5
+ *
6
+ * The caller makes `registryResult` with `defineRegistry`. `createPlayUI` holds it,
7
+ * and it returns a `MountFn`. Call that function one time for each pair of an actor
8
+ * and a container.
9
+ *
10
+ * @param registryResult - The result of `defineRegistry()`. It gives the registry
11
+ * and the factory of the handlers, which it builds late.
12
+ * @param options - The factory configuration. See {@link CreatePlayUIOptions}:
13
+ * - `functions` — the named compute functions of a `$computed` prop expression.
14
+ * - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props.
15
+ * - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`.
16
+ * - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`.
17
+ * - `onRenderError` — the `(error, name, info)` handler of each failure that the inner renderer reports.
18
+ * - `onConfirm` — the hook that decides each binding with `confirm`. Without it, the default confirm dialog shows the binding.
19
+ * - `confirmDialog` — `false` turns the default confirm dialog off. The binding then waits for `ctx.confirmation`.
20
+ * - `onError` — the `(error, reset)` handler of a failure of a complete rebuild. The renderer
21
+ * contains such a failure always, and this option says where the report goes.
22
+ * - `fallback` — the content to show when the view of the actor is `null`, and after a contained
23
+ * failure of a rebuild. Give a FUNCTION when the factory mounts more than one
24
+ * time, so that each renderer owns its own element.
25
+ * @returns The {@link MountFn}: `(actor, container, mountOptions?) → disconnect`
26
+ */
27
+ function createPlayUI(registryResult, options = {}) {
28
+ const { onRenderError, onError, fallback, functions, directives, validationFunctions, navigate, onConfirm, confirmDialog } = options;
29
+ return function mount(actor, container, mountOptions) {
30
+ const rendererOptions = {
31
+ registryResult,
32
+ ...mountOptions?.store !== void 0 && { store: mountOptions.store },
33
+ ...mountOptions?.loading !== void 0 && { loading: mountOptions.loading },
34
+ ...functions !== void 0 && { functions },
35
+ ...directives !== void 0 && { directives },
36
+ ...validationFunctions !== void 0 && { validationFunctions },
37
+ ...navigate !== void 0 && { navigate },
38
+ ...onConfirm !== void 0 && { onConfirm },
39
+ ...confirmDialog !== void 0 && { confirmDialog },
40
+ ...onRenderError !== void 0 && { onRenderError },
41
+ ...onError !== void 0 && { onError },
42
+ ...fallback != null && { fallback }
43
+ };
44
+ const renderer = new PlayRenderer(container, actor, registryResult.registry, rendererOptions);
45
+ renderer.connect();
46
+ return function disconnect() {
47
+ renderer.disconnect();
48
+ };
49
+ };
97
50
  }
51
+ //#endregion
52
+ export { createPlayUI };
53
+
98
54
  //# sourceMappingURL=create-play-ui.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-play-ui.js","sourceRoot":"","sources":["../src/create-play-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAmDjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,YAAY,CAC3B,cAAoC,EACpC,UAA+B,EAAE;IAEjC,MAAM,EACL,aAAa,EACb,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,mBA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,0CAA0C;QAC1C,iFAAiF;QACjF,+EAA+E;QAC/E,iFAAiF;QACjF,QAAQ,CAAC,OAAO,EAAE,CAAC;QAEnB,OAAO,SAAS,UAAU;YACzB,QAAQ,CAAC,UAAU,EAAE,CAAC;QACvB,CAAC,CAAC;IACH,CAAC,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"create-play-ui.js","names":[],"sources":["../src/create-play-ui.ts"],"sourcesContent":["/**\n * createPlayUI — the complete DOM factory.\n *\n * It takes a `DefineRegistryResult`, and the caller calls `defineRegistry` itself.\n * It returns a `MountFn`. A `mount(actor, container)` call starts the renderer, and\n * it returns a `disconnect` cleanup function.\n *\n * The factory holds the factory options (`functions`, `validationFunctions`,\n * `navigate`, `onRenderError`, `onError`, and `fallback`) from the moment of its\n * creation, and it applies them on every `mount()` call. Give the mount options\n * (`store` and `loading`) to the `mount()` call itself, through `MountOptions`.\n *\n * This factory is parallel to `<PlayUIProvider registryResult={...}>` in the\n * framework renderers.\n *\n * @example\n * ```typescript\n * import { defineRegistry, createPlayUI } from \"@xmachines/play-dom\";\n *\n * const registryResult = defineRegistry(catalog, { components, actions });\n * const mount = createPlayUI(registryResult, {\n * onRenderError: console.error,\n * navigate: (path) => myRouter.push(path),\n * functions: { fullName: (args) => `${args.first} ${args.last}` },\n * });\n * const disconnect = mount(actor, document.getElementById(\"app\")!);\n *\n * // Later:\n * disconnect();\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { ViewActor } from \"@xmachines/play-view\";\nimport type { StateStore } from \"@xmachines/json-render-core\";\nimport { PlayRenderer } from \"./PlayRenderer.js\";\nimport type { DefineRegistryResult } from \"@xmachines/json-render-dom\";\nimport type { CreatePlayUIOptions } from \"./types.js\";\n\n/**\n * The mount options of the `MountFn` that `createPlayUI` returns.\n *\n * They replace or complete the factory options, for one actor and one container.\n * The `createPlayUI` call sets the factory options (`functions`,\n * `validationFunctions`, `navigate`, `onRenderError`, `onError`, and `fallback`) one\n * time.\n */\nexport interface MountOptions {\n\t/**\n\t * The optional external `StateStore`, which is the controlled mode.\n\t * Without it, the renderer makes a new `@xstate/store` atom for each view\n\t * transition, with the values of `spec.state`.\n\t */\n\tstore?: StateStore;\n\t/**\n\t * With the value `true`, the renderer stops each warning about an absent child\n\t * during the ingestion of a streaming spec. It also gives `ctx.ctx.loading` to each\n\t * component implementation.\n\t */\n\tloading?: boolean;\n}\n\n/**\n * The mount function that `createPlayUI` returns.\n *\n * Call it with `(actor, container, mountOptions?)` to start the renderer.\n * It returns a `disconnect` cleanup function. That function stops the render and\n * clears the container.\n *\n * The return is a plain function. A caller runs it, or it publishes the release with\n * `asDisposable` of `@xmachines/core/utils`, and a scope releases it:\n *\n * ```ts\n * const mount = createPlayUI(registryResult);\n * {\n * using stop = asDisposable(mount(actor, container));\n * // stop() runs at the end of the scope, and after an exception too\n * }\n * ```\n */\nexport type MountFn = (\n\tactor: ViewActor,\n\tcontainer: HTMLElement,\n\toptions?: MountOptions,\n) => () => void;\n\n/**\n * Creates the mount function of the complete DOM renderer.\n *\n * The caller makes `registryResult` with `defineRegistry`. `createPlayUI` holds it,\n * and it returns a `MountFn`. Call that function one time for each pair of an actor\n * and a container.\n *\n * @param registryResult - The result of `defineRegistry()`. It gives the registry\n * and the factory of the handlers, which it builds late.\n * @param options - The factory configuration. See {@link CreatePlayUIOptions}:\n * - `functions` — the named compute functions of a `$computed` prop expression.\n * - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props.\n * - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`.\n * - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: \"...\" }`.\n * - `onRenderError` — the `(error, name, info)` handler of each failure that the inner renderer reports.\n * - `onConfirm` — the hook that decides each binding with `confirm`. Without it, the default confirm dialog shows the binding.\n * - `confirmDialog` — `false` turns the default confirm dialog off. The binding then waits for `ctx.confirmation`.\n * - `onError` — the `(error, reset)` handler of a failure of a complete rebuild. The renderer\n * contains such a failure always, and this option says where the report goes.\n * - `fallback` — the content to show when the view of the actor is `null`, and after a contained\n * failure of a rebuild. Give a FUNCTION when the factory mounts more than one\n * time, so that each renderer owns its own element.\n * @returns The {@link MountFn}: `(actor, container, mountOptions?) → disconnect`\n */\nexport function createPlayUI(\n\tregistryResult: DefineRegistryResult,\n\toptions: CreatePlayUIOptions = {},\n): MountFn {\n\tconst {\n\t\tonRenderError,\n\t\tonError,\n\t\tfallback,\n\t\tfunctions,\n\t\tdirectives,\n\t\tvalidationFunctions,\n\t\tnavigate,\n\t\tonConfirm,\n\t\tconfirmDialog,\n\t} = options;\n\n\treturn function mount(actor, container, mountOptions) {\n\t\t// Each option of UIProviderOptions (onRenderError, functions, directives,\n\t\t// validationFunctions, navigate, onConfirm, and confirmDialog) goes directly through\n\t\t// PlayDomOptions, then PlayRenderer, then the inner renderer.\n\t\tconst rendererOptions = {\n\t\t\tregistryResult,\n\t\t\t...(mountOptions?.store !== undefined && { store: mountOptions.store }),\n\t\t\t...(mountOptions?.loading !== undefined && { loading: mountOptions.loading }),\n\t\t\t...(functions !== undefined && { functions }),\n\t\t\t...(directives !== undefined && { directives }),\n\t\t\t...(validationFunctions !== undefined && { validationFunctions }),\n\t\t\t...(navigate !== undefined && { navigate }),\n\t\t\t...(onConfirm !== undefined && { onConfirm }),\n\t\t\t...(confirmDialog !== undefined && { confirmDialog }),\n\t\t\t...(onRenderError !== undefined && { onRenderError }),\n\t\t\t// PlayRenderer owns both of them now. It contains a rebuild that throws always,\n\t\t\t// and it shows the fallback for every null view and after each contained\n\t\t\t// failure. The factory therefore forwards the two options, and it appends\n\t\t\t// nothing itself.\n\t\t\t...(onError !== undefined && { onError }),\n\t\t\t// The producer travels UNCHANGED. PlayRenderer calls it at the first moment it\n\t\t\t// needs the element, and it holds the memo — one mount builds one renderer, so\n\t\t\t// a second memo here would hold the same element for the same lifetime. A\n\t\t\t// producer gives every renderer its own element; a single element that every\n\t\t\t// mount shares would pass from one container to the next on each null view,\n\t\t\t// because appendChild moves a node.\n\t\t\t...(fallback != null && { fallback }),\n\t\t};\n\n\t\tconst renderer = new PlayRenderer(\n\t\t\tcontainer,\n\t\t\tactor,\n\t\t\tregistryResult.registry,\n\t\t\trendererOptions,\n\t\t);\n\t\t// connect() renders the first view synchronously, and PlayRenderer appends the\n\t\t// fallback itself when that view is null.\n\t\t// It needs no `try`: PlayRenderer contains a failed rebuild AND a handler of the\n\t\t// host that throws, so `connect()` returns for every view. `mount()` therefore\n\t\t// always reaches the `return` below, and the caller always receives the release.\n\t\trenderer.connect();\n\n\t\treturn function disconnect() {\n\t\t\trenderer.disconnect();\n\t\t};\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,SAAgB,aACf,gBACA,UAA+B,CAAC,GACtB;CACV,MAAM,EACL,eACA,SACA,UACA,WACA,YACA,qBACA,UACA,WACA,kBACG;CAEJ,OAAO,SAAS,MAAM,OAAO,WAAW,cAAc;EAIrD,MAAM,kBAAkB;GACvB;GACA,GAAI,cAAc,UAAU,KAAA,KAAa,EAAE,OAAO,aAAa,MAAM;GACrE,GAAI,cAAc,YAAY,KAAA,KAAa,EAAE,SAAS,aAAa,QAAQ;GAC3E,GAAI,cAAc,KAAA,KAAa,EAAE,UAAU;GAC3C,GAAI,eAAe,KAAA,KAAa,EAAE,WAAW;GAC7C,GAAI,wBAAwB,KAAA,KAAa,EAAE,oBAAoB;GAC/D,GAAI,aAAa,KAAA,KAAa,EAAE,SAAS;GACzC,GAAI,cAAc,KAAA,KAAa,EAAE,UAAU;GAC3C,GAAI,kBAAkB,KAAA,KAAa,EAAE,cAAc;GACnD,GAAI,kBAAkB,KAAA,KAAa,EAAE,cAAc;GAKnD,GAAI,YAAY,KAAA,KAAa,EAAE,QAAQ;GAOvC,GAAI,YAAY,QAAQ,EAAE,SAAS;EACpC;EAEA,MAAM,WAAW,IAAI,aACpB,WACA,OACA,eAAe,UACf,eACD;EAMA,SAAS,QAAQ;EAEjB,OAAO,SAAS,aAAa;GAC5B,SAAS,WAAW;EACrB;CACD;AACD"}
@@ -1,92 +1,42 @@
1
- /**
2
- * create-renderer.ts — the createRenderer factory of @xmachines/play-dom.
3
- *
4
- * It matches the `createRenderer` export of @xmachines/json-render-react, of /vue,
5
- * of /solid, and of /svelte. It calls `defineRegistry` one time, at the creation of
6
- * the factory. It then returns a `mount(actor, container, options?)` function. That
7
- * function connects a PlayRenderer, and it returns a `disconnect` cleanup function.
8
- *
9
- * The consumer therefore writes one call, and not three or four steps.
10
- *
11
- * @example
12
- * ```ts
13
- * import { createRenderer, schema } from "@xmachines/play-dom";
14
- * import { defineCatalog } from "@xmachines/json-render-core";
15
- * import { z } from "zod";
16
- * import type { ComponentFn } from "@xmachines/play-dom";
17
- *
18
- * const catalog = defineCatalog(schema, {
19
- * components: {
20
- * Home: { props: z.object({ title: z.string() }) },
21
- * Login: { props: z.object({ title: z.string(), username: z.string().optional() }) },
22
- * },
23
- * actions: {
24
- * login: { params: z.object({ username: z.string() }) },
25
- * logout: {},
26
- * },
27
- * });
28
- *
29
- * const Home: ComponentFn<typeof catalog, "Home"> = ({ props }) => {
30
- * const el = document.createElement("section");
31
- * el.textContent = props.title;
32
- * return el;
33
- * };
34
- * const Login: ComponentFn<typeof catalog, "Login"> = ({ props, on }) => {
35
- * const el = document.createElement("section");
36
- * const btn = document.createElement("button");
37
- * const submit = on("submit");
38
- * btn.addEventListener("click", () => submit.emit());
39
- * el.append(btn);
40
- * return el;
41
- * };
42
- *
43
- * // Build the factory one time, at module scope
44
- * const mount = createRenderer(catalog, { Home, Login });
45
- *
46
- * // Mount when the actor and the container are ready
47
- * const disconnect = mount(actor, document.getElementById("app")!);
48
- *
49
- * // Clean up:
50
- * disconnect();
51
- * ```
52
- *
53
- * @packageDocumentation
54
- */
55
1
  import { PlayRenderer } from "./PlayRenderer.js";
56
2
  import { defineRegistry } from "@xmachines/json-render-dom";
3
+ //#region packages/play-dom/src/create-renderer.ts
57
4
  /**
58
- * Creates a DOM renderer factory from a catalog and a component map. You can use
59
- * the factory more than one time.
60
- *
61
- * It returns a `mount(actor, container, options?)` function. That function connects
62
- * the PlayRenderer in one call, and it returns a `disconnect` cleanup function.
63
- *
64
- * @param catalog - The json-render Catalog. It describes the schema of each component and of each action.
65
- * @param componentMap - The component implementations, with the catalog component name as the key.
66
- * @returns A `mount` function. It accepts `(actor, container, options?)`, and it returns `disconnect`.
67
- *
68
- * @remarks
69
- * `createRenderer` manages `registryResult` internally. It calls `defineRegistry`
70
- * one time, and it uses that result in every `mount()` call. Therefore the options
71
- * type of `mount` holds no `registryResult`: `createRenderer` always gives it, and
72
- * you cannot replace it.
73
- *
74
- * Two situations need a different function. In the first, your code calls
75
- * `registryResult.executeAction()` itself, outside the emit and on flow. In the
76
- * second, you give more provider options, such as `navigate`, `onRenderError`, or
77
- * `functions`. Use `createPlayUI`, which accepts the complete
78
- * `CreatePlayUIOptions`. You can also use `defineRegistry` with `PlayRenderer`
79
- * directly.
80
- */
81
- export function createRenderer(catalog, componentMap) {
82
- const registryResult = defineRegistry(catalog, { components: componentMap });
83
- return function mount(actor, container, options = {}) {
84
- const renderer = new PlayRenderer(container, actor, registryResult.registry, {
85
- ...options,
86
- registryResult,
87
- });
88
- renderer.connect();
89
- return () => renderer.disconnect();
90
- };
5
+ * Creates a DOM renderer factory from a catalog and a component map. You can use
6
+ * the factory more than one time.
7
+ *
8
+ * It returns a `mount(actor, container, options?)` function. That function connects
9
+ * the PlayRenderer in one call, and it returns a `disconnect` cleanup function.
10
+ *
11
+ * @param catalog - The json-render Catalog. It describes the schema of each component and of each action.
12
+ * @param componentMap - The component implementations, with the catalog component name as the key.
13
+ * @returns A `mount` function. It accepts `(actor, container, options?)`, and it returns `disconnect`.
14
+ *
15
+ * @remarks
16
+ * `createRenderer` manages `registryResult` internally. It calls `defineRegistry`
17
+ * one time, and it uses that result in every `mount()` call. Therefore the options
18
+ * type of `mount` holds no `registryResult`: `createRenderer` always gives it, and
19
+ * you cannot replace it.
20
+ *
21
+ * Two situations need a different function. In the first, your code calls
22
+ * `registryResult.executeAction()` itself, outside the emit and on flow. In the
23
+ * second, you give more provider options, such as `navigate`, `onRenderError`, or
24
+ * `functions`. Use `createPlayUI`, which accepts the complete
25
+ * `CreatePlayUIOptions`. You can also use `defineRegistry` with `PlayRenderer`
26
+ * directly.
27
+ */
28
+ function createRenderer(catalog, componentMap) {
29
+ const registryResult = defineRegistry(catalog, { components: componentMap });
30
+ return function mount(actor, container, options = {}) {
31
+ const renderer = new PlayRenderer(container, actor, registryResult.registry, {
32
+ ...options,
33
+ registryResult
34
+ });
35
+ renderer.connect();
36
+ return () => renderer.disconnect();
37
+ };
91
38
  }
39
+ //#endregion
40
+ export { createRenderer };
41
+
92
42
  //# sourceMappingURL=create-renderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-renderer.js","sourceRoot":"","sources":["../src/create-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAMH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;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"}
1
+ {"version":3,"file":"create-renderer.js","names":[],"sources":["../src/create-renderer.ts"],"sourcesContent":["/**\n * create-renderer.ts — the createRenderer factory of @xmachines/play-dom.\n *\n * It matches the `createRenderer` export of @xmachines/json-render-react, of /vue,\n * of /solid, and of /svelte. It calls `defineRegistry` one time, at the creation of\n * the factory. It then returns a `mount(actor, container, options?)` function. That\n * function connects a PlayRenderer, and it returns a `disconnect` cleanup function.\n *\n * The consumer therefore writes one call, and not three or four steps.\n *\n * @example\n * ```ts\n * import { createRenderer, schema } from \"@xmachines/play-dom\";\n * import { defineCatalog } from \"@xmachines/json-render-core\";\n * import { z } from \"zod\";\n * import type { ComponentFn } from \"@xmachines/play-dom\";\n *\n * const catalog = defineCatalog(schema, {\n * components: {\n * Home: { props: z.object({ title: z.string() }) },\n * Login: { props: z.object({ title: z.string(), username: z.string().optional() }) },\n * },\n * actions: {\n * login: { params: z.object({ username: z.string() }) },\n * logout: {},\n * },\n * });\n *\n * const Home: ComponentFn<typeof catalog, \"Home\"> = ({ props }) => {\n * const el = document.createElement(\"section\");\n * el.textContent = props.title;\n * return el;\n * };\n * const Login: ComponentFn<typeof catalog, \"Login\"> = ({ props, on }) => {\n * const el = document.createElement(\"section\");\n * const btn = document.createElement(\"button\");\n * const submit = on(\"submit\");\n * btn.addEventListener(\"click\", () => submit.emit());\n * el.append(btn);\n * return el;\n * };\n *\n * // Build the factory one time, at module scope\n * const mount = createRenderer(catalog, { Home, Login });\n *\n * // Mount when the actor and the container are ready\n * const disconnect = mount(actor, document.getElementById(\"app\")!);\n *\n * // Clean up:\n * disconnect();\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { ViewActor } from \"@xmachines/play-view\";\nimport type { Catalog } from \"@xmachines/json-render-core\";\nimport type { ComponentRegistry } from \"@xmachines/json-render-dom\";\nimport type { PlayDomOptions } from \"./types.js\";\nimport { PlayRenderer } from \"./PlayRenderer.js\";\nimport { defineRegistry } from \"@xmachines/json-render-dom\";\n\n/**\n * Creates a DOM renderer factory from a catalog and a component map. You can use\n * the factory more than one time.\n *\n * It returns a `mount(actor, container, options?)` function. That function connects\n * the PlayRenderer in one call, and it returns a `disconnect` cleanup function.\n *\n * @param catalog - The json-render Catalog. It describes the schema of each component and of each action.\n * @param componentMap - The component implementations, with the catalog component name as the key.\n * @returns A `mount` function. It accepts `(actor, container, options?)`, and it returns `disconnect`.\n *\n * @remarks\n * `createRenderer` manages `registryResult` internally. It calls `defineRegistry`\n * one time, and it uses that result in every `mount()` call. Therefore the options\n * type of `mount` holds no `registryResult`: `createRenderer` always gives it, and\n * you cannot replace it.\n *\n * Two situations need a different function. In the first, your code calls\n * `registryResult.executeAction()` itself, outside the emit and on flow. In the\n * second, you give more provider options, such as `navigate`, `onRenderError`, or\n * `functions`. Use `createPlayUI`, which accepts the complete\n * `CreatePlayUIOptions`. You can also use `defineRegistry` with `PlayRenderer`\n * directly.\n */\nexport function createRenderer<C extends Catalog>(\n\tcatalog: C,\n\tcomponentMap: ComponentRegistry<C>,\n): (\n\tactor: ViewActor,\n\tcontainer: HTMLElement,\n\toptions?: Omit<PlayDomOptions, \"registryResult\">,\n) => () => void {\n\tconst registryResult = defineRegistry(catalog, { components: componentMap });\n\n\treturn function mount(actor, container, options = {}) {\n\t\tconst renderer = new PlayRenderer(container, actor, registryResult.registry, {\n\t\t\t...options,\n\t\t\tregistryResult,\n\t\t});\n\t\trenderer.connect();\n\t\treturn () => renderer.disconnect();\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,SAAgB,eACf,SACA,cAKe;CACf,MAAM,iBAAiB,eAAe,SAAS,EAAE,YAAY,aAAa,CAAC;CAE3E,OAAO,SAAS,MAAM,OAAO,WAAW,UAAU,CAAC,GAAG;EACrD,MAAM,WAAW,IAAI,aAAa,WAAW,OAAO,eAAe,UAAU;GAC5E,GAAG;GACH;EACD,CAAC;EACD,SAAS,QAAQ;EACjB,aAAa,SAAS,WAAW;CAClC;AACD"}
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ 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
33
  export { defineRegistry, renderSpec, schema, createValidationRegistry, } from "@xmachines/json-render-dom";
34
- export type { ValidationRegistry, FieldValidationState } from "@xmachines/json-render-dom";
34
+ export type { ValidationRegistry, FieldValidationState, PassOptions, } from "@xmachines/json-render-dom";
35
35
  export type { RenderSpecOptions } from "@xmachines/json-render-dom";
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
+ export type { ConfirmHandler, EventHandle, SetState, RenderErrorHandler, OnRenderError, RenderErrorInfo, RenderErrorKind, UIProviderOptions, CatalogHasActions, BaseComponentProps, DomRenderContext, DomComponentRenderer, ComponentContext, ComponentFn, ComponentRegistry, Actions, ActionFn, DefineRegistryOptions, DefineRegistryResult, DomRegistry, DomSchema, } from "@xmachines/json-render-dom";
37
37
  //# sourceMappingURL=index.d.ts.map
@@ -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,EACN,cAAc,E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B,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
@@ -1,34 +1,5 @@
1
- /**
2
- * @xmachines/play-dom — the vanilla DOM renderer of the XMachines Play architecture.
3
- *
4
- * The public API has two layers:
5
- *
6
- * **The XMachines layer**, in this package:
7
- * - `createRenderer()` — the one-call factory. It returns `mount(actor, container, options?) → disconnect`
8
- * - `createPlayUI()` — the complete factory, with every option. It returns a `MountFn`
9
- * - `PlayRenderer` — the renderer class, with a `connect()` and `disconnect()` lifecycle
10
- * - `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `MountOptions`
11
- *
12
- * **The json-render layer**, re-exported from @xmachines/json-render-dom:
13
- * - `defineRegistry` — it builds a catalog-typed DomRegistry
14
- * - `renderSpec` — the pure Spec → DOM renderer. It uses resolveElementProps of the core
15
- * - `ComponentFn` — the catalog-typed type of a component function
16
- * - `ComponentContext` — the catalog-typed render context: props, emit, on, children, bindings
17
- * - `ComponentRegistry` — the catalog-typed input type of the registry
18
- * - `DomComponentRenderer` — the raw renderer type of one element
19
- * - `DomRegistry` — the raw registry type
20
- * - `DomRenderContext` — the raw render context
21
- * - `EventHandle` — the event handle that on() returns
22
- * - `SetState` — the state updater function of an ActionFn
23
- * - `CatalogHasActions` — the conditional type. It is true when the catalog declares an action
24
- * - `BaseComponentProps` — the base props type of a catalog component definition
25
- *
26
- * @packageDocumentation
27
- */
28
- // The integration layer of XMachines
29
- export { PlayRenderer } from "./PlayRenderer.js";
30
- export { createRenderer } from "./create-renderer.js";
31
- export { createPlayUI } from "./create-play-ui.js";
32
- // @xmachines/json-render-dom. This package re-exports it, for the convenience of a consumer
33
- export { defineRegistry, renderSpec, schema, createValidationRegistry, } from "@xmachines/json-render-dom";
34
- //# sourceMappingURL=index.js.map
1
+ import { PlayRenderer } from "./PlayRenderer.js";
2
+ import { createRenderer } from "./create-renderer.js";
3
+ import { createPlayUI } from "./create-play-ui.js";
4
+ import { createValidationRegistry, defineRegistry, renderSpec, schema } from "@xmachines/json-render-dom";
5
+ export { PlayRenderer, createPlayUI, createRenderer, createValidationRegistry, defineRegistry, renderSpec, schema };