@torpor/view 1.3.0 → 1.3.2

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/dist/index.cjs CHANGED
@@ -1244,22 +1244,76 @@ function isServerComponent(component) {
1244
1244
  return component.constructor?.name === "AsyncFunction";
1245
1245
  }
1246
1246
  //#endregion
1247
+ //#region src/render/regionTreeRegistry.ts
1248
+ /**
1249
+ * Region trees created by `mount`/`hydrate`, keyed by the container they
1250
+ * were created into.
1251
+ *
1252
+ * Root-level calls (the usual `mount`/`hydrate` bootstrap) register the root
1253
+ * region, so `unmount` disposes exactly what was registered. Nested calls —
1254
+ * an embed hydrating server-rendered markup inside a live page — register a
1255
+ * region tree of their own, so their teardown (`unmount(parent)`) disposes
1256
+ * only the embed and leaves the host's render context alone. Without this,
1257
+ * hydrating an embed would replace the host's `rootRegion`/`previousRegion`
1258
+ * and the embed's teardown would clear the host's root.
1259
+ */
1260
+ const trees = /* @__PURE__ */ new Map();
1261
+ function registerRegionTree(parent, region) {
1262
+ trees.set(parent, region);
1263
+ }
1264
+ function registeredRegionTree(parent) {
1265
+ return trees.get(parent);
1266
+ }
1267
+ function unregisterRegionTree(parent) {
1268
+ trees.delete(parent);
1269
+ }
1270
+ /** Entries for trees whose container lives inside `parent` (nested embeds). */
1271
+ function containedTrees(parent) {
1272
+ const found = [];
1273
+ for (const entry of trees) if (entry[0] !== parent && parent.contains(entry[0])) found.push(entry);
1274
+ return found;
1275
+ }
1276
+ //#endregion
1247
1277
  //#region src/render/hydrate.ts
1248
1278
  /**
1249
1279
  * Hydrates a component into an existing DOM tree
1280
+ *
1281
+ * When a root region is already live (an embed hydrating its server-rendered
1282
+ * markup inside a mounted page), the component hydrates against a region
1283
+ * tree of its own and the surrounding render context is restored afterwards
1284
+ * — hydration must not replace the host's `rootRegion`/`previousRegion`.
1285
+ * Tearing the embed down later (`unmount(parent)`) then disposes only the
1286
+ * embed's tree.
1287
+ *
1250
1288
  * @param parent The parent node
1251
1289
  * @param component The component to mount
1252
1290
  * @param props An object containing component props
1253
1291
  */
1254
1292
  function hydrate(parent, component, props, slots) {
1255
1293
  if (isServerComponent(component)) throw new Error("The component was compiled for SSR (it renders to an HTML string) and cannot be hydrated in the browser. Import the client build instead, e.g. with the '?client' import query");
1294
+ const saved = context.rootRegion !== null ? {
1295
+ activeRegion: context.activeRegion,
1296
+ hydrationNode: context.hydrationNode,
1297
+ previousRegion: context.previousRegion,
1298
+ rootRegion: context.rootRegion
1299
+ } : null;
1256
1300
  context.hydrationNode = parent.firstChild;
1257
- context.rootRegion = newRegion(require_devContext.devContext.enabled ? "Root" : void 0);
1258
- context.previousRegion = context.rootRegion;
1259
- pushRegion(context.rootRegion);
1301
+ const root = newRegion(require_devContext.devContext.enabled ? "Root" : void 0);
1302
+ context.rootRegion = root;
1303
+ context.previousRegion = root;
1304
+ pushRegion(root);
1260
1305
  component(parent, null, props, void 0, slots);
1261
1306
  context.hydrationNode = null;
1262
1307
  flushMountEffects();
1308
+ if (saved === null) {
1309
+ registerRegionTree(parent, root);
1310
+ return;
1311
+ }
1312
+ context.hydrationNode = saved.hydrationNode;
1313
+ context.rootRegion = saved.rootRegion;
1314
+ context.previousRegion = saved.previousRegion;
1315
+ context.activeRegion = saved.activeRegion;
1316
+ registerRegionTree(parent, root);
1263
1317
  }
1264
1318
  //#endregion
1265
1319
  //#region src/render/mount.ts
@@ -1272,7 +1326,13 @@ function hydrate(parent, component, props, slots) {
1272
1326
  * handlers. (`hydrate` mounts into server-rendered markup, which is already
1273
1327
  * connected.)
1274
1328
  *
1275
- * @param parent The node to mount the component into
1329
+ * When a root region is already live (an embed mounting into an element
1330
+ * inside a mounted page), the component mounts against a region tree of its
1331
+ * own and the surrounding render context is left untouched — so tearing the
1332
+ * embed down later (`unmount(parent)`) disposes only the embed.
1333
+ *
1334
+ * @param parent The node to mount into. Like `hydrate`, it must have no
1335
+ * child elements
1276
1336
  * @param component The component to mount
1277
1337
  * @param props An object containing component props
1278
1338
  */
@@ -1280,33 +1340,59 @@ function mount(parent, component, props, slots) {
1280
1340
  if (isServerComponent(component)) throw new Error("The component was compiled for SSR (it renders to an HTML string) and cannot be mounted in the browser. Import the client build instead, e.g. with the '?client' import query");
1281
1341
  if (parent.childElementCount > 0) throw new Error("The parent node must have no child elements");
1282
1342
  while (parent.firstChild !== null) parent.firstChild.remove();
1283
- if (context.rootRegion === null) {
1284
- context.rootRegion = newRegion(require_devContext.devContext.enabled ? "Root" : void 0);
1285
- context.previousRegion = context.rootRegion;
1286
- pushRegion(context.rootRegion);
1287
- }
1343
+ const saved = context.rootRegion !== null ? {
1344
+ activeRegion: context.activeRegion,
1345
+ previousRegion: context.previousRegion,
1346
+ rootRegion: context.rootRegion
1347
+ } : null;
1348
+ const root = newRegion(require_devContext.devContext.enabled ? "Root" : void 0);
1349
+ context.rootRegion = root;
1350
+ context.previousRegion = root;
1351
+ pushRegion(root);
1288
1352
  component(parent, null, props, void 0, slots);
1353
+ if (saved !== null) {
1354
+ context.rootRegion = saved.rootRegion;
1355
+ context.previousRegion = saved.previousRegion;
1356
+ context.activeRegion = saved.activeRegion;
1357
+ }
1358
+ registerRegionTree(parent, root);
1289
1359
  }
1290
1360
  //#endregion
1291
1361
  //#region src/render/unmount.ts
1292
1362
  /**
1293
- * Tears down the current UI: disposes the root region tree (running effect
1294
- * cleanups and detaching subscriptions), resets the render context, and
1295
- * removes any remaining child nodes from `parent`.
1363
+ * Tears down the component tree that was mounted/hydrated into `parent`:
1364
+ * disposes its region tree (running effect cleanups and detaching
1365
+ * subscriptions), removes any remaining child nodes from `parent`, and —
1366
+ * when `parent` holds the root tree — resets the render context.
1367
+ *
1368
+ * When `parent` holds a nested tree (an embed inside a live page), only the
1369
+ * embed is disposed and the host's render context is left untouched. Any
1370
+ * embeds living inside a root container are disposed along with it.
1296
1371
  *
1297
1372
  * Call this before `mount`ing a fresh component tree into the same container
1298
1373
  * (e.g. when client-side navigating to a route whose layout chain differs
1299
1374
  * from the previous one). `mount` refuses to mount into a non-empty parent
1300
- * and reuses an existing root region, so both must be cleared first.
1375
+ * and expects no leftover tree, so both must be cleared first.
1301
1376
  *
1302
1377
  * @param parent The container that the previous UI was mounted into
1303
1378
  */
1304
1379
  function unmount(parent) {
1305
- if (context.rootRegion !== null) {
1306
- clearRegion(context.rootRegion);
1307
- context.rootRegion = null;
1308
- context.previousRegion = null;
1309
- context.activeRegion = null;
1380
+ const owned = registeredRegionTree(parent);
1381
+ for (const [nestedParent, nestedTree] of containedTrees(parent)) {
1382
+ clearRegion(nestedTree);
1383
+ unregisterRegionTree(nestedParent);
1384
+ }
1385
+ if (owned !== void 0 && owned !== context.rootRegion) {
1386
+ clearRegion(owned);
1387
+ unregisterRegionTree(parent);
1388
+ } else {
1389
+ if (context.rootRegion !== null) {
1390
+ clearRegion(context.rootRegion);
1391
+ context.rootRegion = null;
1392
+ context.previousRegion = null;
1393
+ context.activeRegion = null;
1394
+ }
1395
+ if (owned !== void 0) unregisterRegionTree(parent);
1310
1396
  }
1311
1397
  while (parent.firstChild !== null) parent.firstChild.remove();
1312
1398
  }
@@ -1682,7 +1768,24 @@ function runControl(region, anchor, create, name) {
1682
1768
  }
1683
1769
  //#endregion
1684
1770
  //#region src/render/runControlBranch.ts
1685
- function runControlBranch(region, oldIndex, index) {
1771
+ /**
1772
+ * Runs one branch of a control block (`@if`/`@switch`/`@replace`, and the
1773
+ * runtime-driven `@await`/`@try` groups). Returns the region to pop after
1774
+ * the branch's content has rendered, or `null` when the branch should be
1775
+ * skipped (same index as the previous render and not forced to recreate).
1776
+ *
1777
+ * The branch region is created and pushed here — the single point of branch
1778
+ * bookkeeping, so emitters (and the runtime-driven groups) don't repeat the
1779
+ * region/push/pop dance and can't get it wrong (e.g. forgetting that the
1780
+ * clear above can release the region `context.previousRegion` points at).
1781
+ *
1782
+ * @param region The control's own region
1783
+ * @param oldIndex The branch index of the previous render (callers pass a
1784
+ * sentinel like `0` → `-1` to force a clear-and-rerender)
1785
+ * @param index The branch index of this render
1786
+ * @param name Dev-only name for the pushed branch region
1787
+ */
1788
+ function runControlBranch(region, oldIndex, index, name) {
1686
1789
  const recreate = region.recreate;
1687
1790
  if (recreate) region.recreate = false;
1688
1791
  const anchor = region.ssrBranchAnchor;
@@ -1701,12 +1804,24 @@ function runControlBranch(region, oldIndex, index) {
1701
1804
  if (oldIndex === index) {
1702
1805
  if (recreate) {
1703
1806
  if (region.nextRegion !== null && region.nextRegion.depth > region.depth) clearRegion(region.nextRegion);
1704
- return true;
1807
+ return pushBranchRegion(region, name);
1705
1808
  }
1706
- return false;
1809
+ return null;
1707
1810
  }
1708
1811
  if (!firstRender && region.nextRegion !== null && region.nextRegion.depth > region.depth) clearRegion(region.nextRegion);
1709
- return true;
1812
+ return pushBranchRegion(region, name);
1813
+ }
1814
+ /**
1815
+ * Creates and pushes the region the branch's content renders into.
1816
+ *
1817
+ * The clear above can release the region `context.previousRegion` points at
1818
+ * (the previous branch subtree's last region), so re-anchor it to the control
1819
+ * region before linking — otherwise the fresh branch would chain off a
1820
+ * released region instead of the control's.
1821
+ */
1822
+ function pushBranchRegion(region, name) {
1823
+ context.previousRegion = region;
1824
+ return pushRegion(newRegion(require_devContext.devContext.enabled ? name : void 0), true);
1710
1825
  }
1711
1826
  /**
1712
1827
  * Clears a server-rendered control branch that the client didn't pick, so the
@@ -2730,9 +2845,8 @@ function runAwait(region, anchor, renderContent, renderWith, name) {
2730
2845
  const oldRegion = pushRegion(region, first);
2731
2846
  first = false;
2732
2847
  const renderBranch = (targetIndex, fn) => {
2733
- runControlBranch(region, index, targetIndex);
2734
- context.previousRegion = region;
2735
- const oldR = pushRegion(newRegion(targetIndex === 0 ? "await_content" : "await_with"), true);
2848
+ const oldR = runControlBranch(region, index, targetIndex, targetIndex === 0 ? "await_content" : "await_with");
2849
+ if (oldR === null) return;
2736
2850
  try {
2737
2851
  fn(anchor);
2738
2852
  } finally {
@@ -2765,7 +2879,8 @@ function runAwait(region, anchor, renderContent, renderWith, name) {
2765
2879
  }
2766
2880
  if (boundary.suspended && renderWith !== null) renderBranch(1, renderWith);
2767
2881
  else if (boundary.suspended && aborted) {
2768
- runControlBranch(region, index, 1);
2882
+ const oldR = runControlBranch(region, index, 1, "await_with");
2883
+ if (oldR !== null) popRegion(oldR);
2769
2884
  index = 1;
2770
2885
  } else if (!boundary.suspended) hasContent = true;
2771
2886
  };
@@ -2782,7 +2897,8 @@ function runAwait(region, anchor, renderContent, renderWith, name) {
2782
2897
  else if (!hasContent) {
2783
2898
  if (renderWith !== null) renderBranch(1, renderWith);
2784
2899
  else {
2785
- runControlBranch(region, index, 1);
2900
+ const oldR = runControlBranch(region, index, 1, "await_with");
2901
+ if (oldR !== null) popRegion(oldR);
2786
2902
  index = 1;
2787
2903
  }
2788
2904
  }
@@ -2867,9 +2983,8 @@ function runTry(region, anchor, renderTry, renderCatch, name) {
2867
2983
  const oldRegion = pushRegion(region, first);
2868
2984
  first = false;
2869
2985
  const renderBranch = (targetIndex, fn) => {
2870
- runControlBranch(region, index, targetIndex);
2871
- context.previousRegion = region;
2872
- const oldR = pushRegion(newRegion(targetIndex === 0 ? "try" : "catch"), true);
2986
+ const oldR = runControlBranch(region, index, targetIndex, targetIndex === 0 ? "try" : "catch");
2987
+ if (oldR === null) return;
2873
2988
  fn(anchor);
2874
2989
  popRegion(oldR);
2875
2990
  index = targetIndex;
@@ -3083,9 +3198,10 @@ function $async(fn, _options) {
3083
3198
  *
3084
3199
  * For each key, `$bind` creates:
3085
3200
  * - **Forward sync** (`props → state`): when the parent pushes a new value via
3086
- * `$props[key]`, it flows into `$state[key]`. Skips `undefined` values so
3087
- * that defaults set in the initial `$watch(...)` are preserved when the
3088
- * parent doesn't provide a value.
3201
+ * `$props[key]`, it flows into `$state[key]`. `undefined` is skipped on the
3202
+ * first run only, so defaults set in the initial `$watch(...)` are preserved
3203
+ * when the parent doesn't provide a value -- while a later `undefined` (a
3204
+ * parent resetting a bound value to empty) clears the state value.
3089
3205
  * - **Backward sync** (`state → props`): when the component mutates
3090
3206
  * `$state[key]`, the new value is written back to `$props[key]`, which the
3091
3207
  * call site's `&key={...}` binding picks up and propagates to the parent.
@@ -3114,9 +3230,11 @@ function $bind(state, props, ...keys) {
3114
3230
  if (props === void 0) return;
3115
3231
  for (let key of keys.flat()) {
3116
3232
  if (!(key in state)) throw new Error(`$bind: the key "${key}" does not exist on the state object. $bind syncs same-named keys, so the state object must declare it (e.g. in the initial $watch).`);
3233
+ let firstForward = true;
3117
3234
  $run(() => {
3118
3235
  const v = props[key];
3119
- if (v !== void 0) state[key] = v;
3236
+ if (v !== void 0 || !firstForward) state[key] = v;
3237
+ firstForward = false;
3120
3238
  }, `bind:forward:${key}`);
3121
3239
  let firstBackward = true;
3122
3240
  $run(() => {
package/dist/index.d.cts CHANGED
@@ -120,6 +120,14 @@ declare function getElementFragment(document: Document, array: Element[], index:
120
120
  //#region src/render/hydrate.d.ts
121
121
  /**
122
122
  * Hydrates a component into an existing DOM tree
123
+ *
124
+ * When a root region is already live (an embed hydrating its server-rendered
125
+ * markup inside a mounted page), the component hydrates against a region
126
+ * tree of its own and the surrounding render context is restored afterwards
127
+ * — hydration must not replace the host's `rootRegion`/`previousRegion`.
128
+ * Tearing the embed down later (`unmount(parent)`) then disposes only the
129
+ * embed's tree.
130
+ *
123
131
  * @param parent The parent node
124
132
  * @param component The component to mount
125
133
  * @param props An object containing component props
@@ -136,7 +144,13 @@ declare function hydrate(parent: ParentNode, component: Component, props?: Recor
136
144
  * handlers. (`hydrate` mounts into server-rendered markup, which is already
137
145
  * connected.)
138
146
  *
139
- * @param parent The node to mount the component into
147
+ * When a root region is already live (an embed mounting into an element
148
+ * inside a mounted page), the component mounts against a region tree of its
149
+ * own and the surrounding render context is left untouched — so tearing the
150
+ * embed down later (`unmount(parent)`) disposes only the embed.
151
+ *
152
+ * @param parent The node to mount into. Like `hydrate`, it must have no
153
+ * child elements
140
154
  * @param component The component to mount
141
155
  * @param props An object containing component props
142
156
  */
@@ -144,14 +158,19 @@ declare function mount(parent: ParentNode, component: Component, props?: Record<
144
158
  //#endregion
145
159
  //#region src/render/unmount.d.ts
146
160
  /**
147
- * Tears down the current UI: disposes the root region tree (running effect
148
- * cleanups and detaching subscriptions), resets the render context, and
149
- * removes any remaining child nodes from `parent`.
161
+ * Tears down the component tree that was mounted/hydrated into `parent`:
162
+ * disposes its region tree (running effect cleanups and detaching
163
+ * subscriptions), removes any remaining child nodes from `parent`, and —
164
+ * when `parent` holds the root tree — resets the render context.
165
+ *
166
+ * When `parent` holds a nested tree (an embed inside a live page), only the
167
+ * embed is disposed and the host's render context is left untouched. Any
168
+ * embeds living inside a root container are disposed along with it.
150
169
  *
151
170
  * Call this before `mount`ing a fresh component tree into the same container
152
171
  * (e.g. when client-side navigating to a route whose layout chain differs
153
172
  * from the previous one). `mount` refuses to mount into a non-empty parent
154
- * and reuses an existing root region, so both must be cleared first.
173
+ * and expects no leftover tree, so both must be cleared first.
155
174
  *
156
175
  * @param parent The container that the previous UI was mounted into
157
176
  */
@@ -344,7 +363,24 @@ declare function restoreHydration(node: ChildNode | null): void;
344
363
  declare function runControl(region: Region, anchor: Node | null, create: (anchor: Node | null) => void, name?: string): void;
345
364
  //#endregion
346
365
  //#region src/render/runControlBranch.d.ts
347
- declare function runControlBranch(region: Region, oldIndex: number, index: number): boolean;
366
+ /**
367
+ * Runs one branch of a control block (`@if`/`@switch`/`@replace`, and the
368
+ * runtime-driven `@await`/`@try` groups). Returns the region to pop after
369
+ * the branch's content has rendered, or `null` when the branch should be
370
+ * skipped (same index as the previous render and not forced to recreate).
371
+ *
372
+ * The branch region is created and pushed here — the single point of branch
373
+ * bookkeeping, so emitters (and the runtime-driven groups) don't repeat the
374
+ * region/push/pop dance and can't get it wrong (e.g. forgetting that the
375
+ * clear above can release the region `context.previousRegion` points at).
376
+ *
377
+ * @param region The control's own region
378
+ * @param oldIndex The branch index of the previous render (callers pass a
379
+ * sentinel like `0` → `-1` to force a clear-and-rerender)
380
+ * @param index The branch index of this render
381
+ * @param name Dev-only name for the pushed branch region
382
+ */
383
+ declare function runControlBranch(region: Region, oldIndex: number, index: number, name?: string): Region | null;
348
384
  //#endregion
349
385
  //#region src/render/runList.d.ts
350
386
  /**
@@ -541,9 +577,10 @@ declare function $async<T>(fn: (serverValue?: T) => Promise<T>, _options?: Async
541
577
  *
542
578
  * For each key, `$bind` creates:
543
579
  * - **Forward sync** (`props → state`): when the parent pushes a new value via
544
- * `$props[key]`, it flows into `$state[key]`. Skips `undefined` values so
545
- * that defaults set in the initial `$watch(...)` are preserved when the
546
- * parent doesn't provide a value.
580
+ * `$props[key]`, it flows into `$state[key]`. `undefined` is skipped on the
581
+ * first run only, so defaults set in the initial `$watch(...)` are preserved
582
+ * when the parent doesn't provide a value -- while a later `undefined` (a
583
+ * parent resetting a bound value to empty) clears the state value.
547
584
  * - **Backward sync** (`state → props`): when the component mutates
548
585
  * `$state[key]`, the new value is written back to `$props[key]`, which the
549
586
  * call site's `&key={...}` binding picks up and propagates to the parent.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/Animation.ts","../src/render/addAnimation.ts","../src/render/addEvent.ts","../src/render/addElement.ts","../src/render/addFragment.ts","../src/render/applyProps.ts","../src/render/buildClasses.ts","../src/render/buildStyles.ts","../src/render/clearLayoutSlot.ts","../src/render/fillLayoutSlot.ts","../src/render/formatText.ts","../src/render/firstInsideNode.ts","../src/render/getFragment.ts","../src/render/getElementFragment.ts","../src/render/hydrate.ts","../src/render/mount.ts","../src/render/unmount.ts","../src/types/ListItemSpec.ts","../src/types/ListItem.ts","../src/render/newListItem.ts","../src/render/newRegion.ts","../src/render/nodeAnchor.ts","../src/render/nodeChild.ts","../src/render/nodeNext.ts","../src/render/nodeRootElement.ts","../src/render/nodeRoot.ts","../src/render/nodeSkip.ts","../src/render/popRegion.ts","../src/render/pushRegion.ts","../src/render/rerunRegionEffects.ts","../src/render/restoreHydration.ts","../src/render/runControl.ts","../src/render/runControlBranch.ts","../src/render/runList.ts","../src/render/runAwait.ts","../src/render/runTry.ts","../src/render/saveHydration.ts","../src/render/headElement.ts","../src/render/setAttribute.ts","../src/render/setDynamicElement.ts","../src/types/Bindable.ts","../src/watch/$batch.ts","../src/watch/$async.ts","../src/watch/$bind.ts","../src/watch/$cache.ts","../src/watch/$onmount.ts","../src/watch/$peek.ts","../src/watch/$pending.ts","../src/watch/$refresh.ts","../src/watch/$run.ts","../src/watch/$stream.ts","../src/watch/$unwrap.ts","../src/types/WatchOptions.ts","../src/watch/$watch.ts"],"mappings":";;;;;UAAyB;EACxB,WAAW,aAAa;EACxB,mBAAmB;;;;iBCCI,aAAa,IAAI,aAAa,QAAQ,WAAW,OAAO;;;iBCDxD,SACvB,IAAI,SACJ,cACA,YAAA,MAAkB,SAAS;;;;;;;;;;;;;;;;;;;;;;iBCkBJ,WAAW,MAAM,SAAS,QAAQ,YAAY,QAAQ;;;iBCnBtD,YACvB,UAAU,kBACV,QAAQ,YACR,QAAQ,aACR,UAAU,WACV,YAAY;;;iBCNW,WACvB,IAAI,SACJ,OAAO,iCACP;;;iBCHuB,aAAa,OAAO,YAAY;;;iBCChC,YAAY,OAAO;;;;;;;;;;iBCQnB,gBAAgB,QAAQ;;;;;;;;;;;;;;;;;;iBC6BxB,eACvB,WAAW,WACX,MAAM,YACN,QAAQ,YACR,QAAQ,aACR,SAAS,OAAO,mBAChB,WAAW,OAAO,oBAChB;;;iBC9CqB,WAAW;;;;;;;;iBCiBX,gBAAgB,QAAQ,YAAY;;;iBCnBpC,YACvB,UAAU,UACV,OAAO,oBACP,eACA,cACA,eACE;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCkBqB,mBACvB,UAAU,UACV,OAAO,WACP,eACA,cACA,eACE;;;;;;;;;iBCfqB,QACvB,QAAQ,YACR,WAAW,WACX,QAAQ,qBACR,QAAQ,eAAe;;;;;;;;;;;;;;;;iBCEA,MACvB,QAAQ,YACR,WAAW,WACX,QAAQ,qBACR,QAAQ,eAAe;;;;;;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B;;;iBCNhD,aAAa,IAAI,SAAS,cAAc;;;iBCKxC,kBAAkB,IAAI,aAAa,cAAc;;;;;;;;;;;;;;;;;;;KCWpE,SAAS,KAAK;;;;;;;;;iBCNK,OAAO,GAAG,UAAU,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC+BxB,OAAO,GAAG,KAAK,cAAc,MAAM,QAAQ,IAAI,WAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCNzE,MACvB,OAAO,OAAO,mBACd,OAAO,OAAO,kCACX;;;;;;;;iBC5BoB,OAAO,GAAG,UAAU,IAAI;;;;;;;;;;;;;;;;;;;;;;;;iBCcxB,SAAS,UAAU;;;;;;;;;;;iBCdnB,MAAM,GAAG,UAAU,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;iBCcvB,SAAS;;;;;;UCZhB;;;;;;;;EAQhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4CuB,SAAS,eAAe,UAAU;;;;;;;;;;iBChDlC,KACvB,UAAU,gBACV,eACA,UAAU,KAAK,0CACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCqBqB,QAAQ,GAC/B,QAAQ,aAAa,IACrB,UAAU,OAAO,YACjB;EAAY;;;;;;;;;iBCrCW,QAAQ,UAAU,OAAO,mBAAmB,QAAQ,IAAI;;;;;;UCJvD;;;;EAIxB;;;;;;;;;;;;;iBC6CuB,OAAO,kBAAkB,QAAQ,GAAG,UAAU,eAAe"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/Animation.ts","../src/render/addAnimation.ts","../src/render/addEvent.ts","../src/render/addElement.ts","../src/render/addFragment.ts","../src/render/applyProps.ts","../src/render/buildClasses.ts","../src/render/buildStyles.ts","../src/render/clearLayoutSlot.ts","../src/render/fillLayoutSlot.ts","../src/render/formatText.ts","../src/render/firstInsideNode.ts","../src/render/getFragment.ts","../src/render/getElementFragment.ts","../src/render/hydrate.ts","../src/render/mount.ts","../src/render/unmount.ts","../src/types/ListItemSpec.ts","../src/types/ListItem.ts","../src/render/newListItem.ts","../src/render/newRegion.ts","../src/render/nodeAnchor.ts","../src/render/nodeChild.ts","../src/render/nodeNext.ts","../src/render/nodeRootElement.ts","../src/render/nodeRoot.ts","../src/render/nodeSkip.ts","../src/render/popRegion.ts","../src/render/pushRegion.ts","../src/render/rerunRegionEffects.ts","../src/render/restoreHydration.ts","../src/render/runControl.ts","../src/render/runControlBranch.ts","../src/render/runList.ts","../src/render/runAwait.ts","../src/render/runTry.ts","../src/render/saveHydration.ts","../src/render/headElement.ts","../src/render/setAttribute.ts","../src/render/setDynamicElement.ts","../src/types/Bindable.ts","../src/watch/$batch.ts","../src/watch/$async.ts","../src/watch/$bind.ts","../src/watch/$cache.ts","../src/watch/$onmount.ts","../src/watch/$peek.ts","../src/watch/$pending.ts","../src/watch/$refresh.ts","../src/watch/$run.ts","../src/watch/$stream.ts","../src/watch/$unwrap.ts","../src/types/WatchOptions.ts","../src/watch/$watch.ts"],"mappings":";;;;;UAAyB;EACxB,WAAW,aAAa;EACxB,mBAAmB;;;;iBCCI,aAAa,IAAI,aAAa,QAAQ,WAAW,OAAO;;;iBCDxD,SACvB,IAAI,SACJ,cACA,YAAA,MAAkB,SAAS;;;;;;;;;;;;;;;;;;;;;;iBCkBJ,WAAW,MAAM,SAAS,QAAQ,YAAY,QAAQ;;;iBCnBtD,YACvB,UAAU,kBACV,QAAQ,YACR,QAAQ,aACR,UAAU,WACV,YAAY;;;iBCNW,WACvB,IAAI,SACJ,OAAO,iCACP;;;iBCHuB,aAAa,OAAO,YAAY;;;iBCChC,YAAY,OAAO;;;;;;;;;;iBCQnB,gBAAgB,QAAQ;;;;;;;;;;;;;;;;;;iBC6BxB,eACvB,WAAW,WACX,MAAM,YACN,QAAQ,YACR,QAAQ,aACR,SAAS,OAAO,mBAChB,WAAW,OAAO,oBAChB;;;iBC9CqB,WAAW;;;;;;;;i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mB,QAAQ,IAAI;;;;;;UCJvD;;;;EAIxB;;;;;;;;;;;;;iBC6CuB,OAAO,kBAAkB,QAAQ,GAAG,UAAU,eAAe"}
package/dist/index.d.mts CHANGED
@@ -120,6 +120,14 @@ declare function getElementFragment(document: Document, array: Element[], index:
120
120
  //#region src/render/hydrate.d.ts
121
121
  /**
122
122
  * Hydrates a component into an existing DOM tree
123
+ *
124
+ * When a root region is already live (an embed hydrating its server-rendered
125
+ * markup inside a mounted page), the component hydrates against a region
126
+ * tree of its own and the surrounding render context is restored afterwards
127
+ * — hydration must not replace the host's `rootRegion`/`previousRegion`.
128
+ * Tearing the embed down later (`unmount(parent)`) then disposes only the
129
+ * embed's tree.
130
+ *
123
131
  * @param parent The parent node
124
132
  * @param component The component to mount
125
133
  * @param props An object containing component props
@@ -136,7 +144,13 @@ declare function hydrate(parent: ParentNode, component: Component, props?: Recor
136
144
  * handlers. (`hydrate` mounts into server-rendered markup, which is already
137
145
  * connected.)
138
146
  *
139
- * @param parent The node to mount the component into
147
+ * When a root region is already live (an embed mounting into an element
148
+ * inside a mounted page), the component mounts against a region tree of its
149
+ * own and the surrounding render context is left untouched — so tearing the
150
+ * embed down later (`unmount(parent)`) disposes only the embed.
151
+ *
152
+ * @param parent The node to mount into. Like `hydrate`, it must have no
153
+ * child elements
140
154
  * @param component The component to mount
141
155
  * @param props An object containing component props
142
156
  */
@@ -144,14 +158,19 @@ declare function mount(parent: ParentNode, component: Component, props?: Record<
144
158
  //#endregion
145
159
  //#region src/render/unmount.d.ts
146
160
  /**
147
- * Tears down the current UI: disposes the root region tree (running effect
148
- * cleanups and detaching subscriptions), resets the render context, and
149
- * removes any remaining child nodes from `parent`.
161
+ * Tears down the component tree that was mounted/hydrated into `parent`:
162
+ * disposes its region tree (running effect cleanups and detaching
163
+ * subscriptions), removes any remaining child nodes from `parent`, and —
164
+ * when `parent` holds the root tree — resets the render context.
165
+ *
166
+ * When `parent` holds a nested tree (an embed inside a live page), only the
167
+ * embed is disposed and the host's render context is left untouched. Any
168
+ * embeds living inside a root container are disposed along with it.
150
169
  *
151
170
  * Call this before `mount`ing a fresh component tree into the same container
152
171
  * (e.g. when client-side navigating to a route whose layout chain differs
153
172
  * from the previous one). `mount` refuses to mount into a non-empty parent
154
- * and reuses an existing root region, so both must be cleared first.
173
+ * and expects no leftover tree, so both must be cleared first.
155
174
  *
156
175
  * @param parent The container that the previous UI was mounted into
157
176
  */
@@ -344,7 +363,24 @@ declare function restoreHydration(node: ChildNode | null): void;
344
363
  declare function runControl(region: Region, anchor: Node | null, create: (anchor: Node | null) => void, name?: string): void;
345
364
  //#endregion
346
365
  //#region src/render/runControlBranch.d.ts
347
- declare function runControlBranch(region: Region, oldIndex: number, index: number): boolean;
366
+ /**
367
+ * Runs one branch of a control block (`@if`/`@switch`/`@replace`, and the
368
+ * runtime-driven `@await`/`@try` groups). Returns the region to pop after
369
+ * the branch's content has rendered, or `null` when the branch should be
370
+ * skipped (same index as the previous render and not forced to recreate).
371
+ *
372
+ * The branch region is created and pushed here — the single point of branch
373
+ * bookkeeping, so emitters (and the runtime-driven groups) don't repeat the
374
+ * region/push/pop dance and can't get it wrong (e.g. forgetting that the
375
+ * clear above can release the region `context.previousRegion` points at).
376
+ *
377
+ * @param region The control's own region
378
+ * @param oldIndex The branch index of the previous render (callers pass a
379
+ * sentinel like `0` → `-1` to force a clear-and-rerender)
380
+ * @param index The branch index of this render
381
+ * @param name Dev-only name for the pushed branch region
382
+ */
383
+ declare function runControlBranch(region: Region, oldIndex: number, index: number, name?: string): Region | null;
348
384
  //#endregion
349
385
  //#region src/render/runList.d.ts
350
386
  /**
@@ -541,9 +577,10 @@ declare function $async<T>(fn: (serverValue?: T) => Promise<T>, _options?: Async
541
577
  *
542
578
  * For each key, `$bind` creates:
543
579
  * - **Forward sync** (`props → state`): when the parent pushes a new value via
544
- * `$props[key]`, it flows into `$state[key]`. Skips `undefined` values so
545
- * that defaults set in the initial `$watch(...)` are preserved when the
546
- * parent doesn't provide a value.
580
+ * `$props[key]`, it flows into `$state[key]`. `undefined` is skipped on the
581
+ * first run only, so defaults set in the initial `$watch(...)` are preserved
582
+ * when the parent doesn't provide a value -- while a later `undefined` (a
583
+ * parent resetting a bound value to empty) clears the state value.
547
584
  * - **Backward sync** (`state → props`): when the component mutates
548
585
  * `$state[key]`, the new value is written back to `$props[key]`, which the
549
586
  * call site's `&key={...}` binding picks up and propagates to the parent.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/Animation.ts","../src/render/addAnimation.ts","../src/render/addEvent.ts","../src/render/addElement.ts","../src/render/addFragment.ts","../src/render/applyProps.ts","../src/render/buildClasses.ts","../src/render/buildStyles.ts","../src/render/clearLayoutSlot.ts","../src/render/fillLayoutSlot.ts","../src/render/formatText.ts","../src/render/firstInsideNode.ts","../src/render/getFragment.ts","../src/render/getElementFragment.ts","../src/render/hydrate.ts","../src/render/mount.ts","../src/render/unmount.ts","../src/types/ListItemSpec.ts","../src/types/ListItem.ts","../src/render/newListItem.ts","../src/render/newRegion.ts","../src/render/nodeAnchor.ts","../src/render/nodeChild.ts","../src/render/nodeNext.ts","../src/render/nodeRootElement.ts","../src/render/nodeRoot.ts","../src/render/nodeSkip.ts","../src/render/popRegion.ts","../src/render/pushRegion.ts","../src/render/rerunRegionEffects.ts","../src/render/restoreHydration.ts","../src/render/runControl.ts","../src/render/runControlBranch.ts","../src/render/runList.ts","../src/render/runAwait.ts","../src/render/runTry.ts","../src/render/saveHydration.ts","../src/render/headElement.ts","../src/render/setAttribute.ts","../src/render/setDynamicElement.ts","../src/types/Bindable.ts","../src/watch/$batch.ts","../src/watch/$async.ts","../src/watch/$bind.ts","../src/watch/$cache.ts","../src/watch/$onmount.ts","../src/watch/$peek.ts","../src/watch/$pending.ts","../src/watch/$refresh.ts","../src/watch/$run.ts","../src/watch/$stream.ts","../src/watch/$unwrap.ts","../src/types/WatchOptions.ts","../src/watch/$watch.ts"],"mappings":";;;;;UAAyB;EACxB,WAA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iBC5BoB,OAAO,GAAG,UAAU,IAAI;;;;;;;;;;;;;;;;;;;;;;;;iBCcxB,SAAS,UAAU;;;;;;;;;;;iBCdnB,MAAM,GAAG,UAAU,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;iBCcvB,SAAS;;;;;;UCZhB;;;;;;;;EAQhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4CuB,SAAS,eAAe,UAAU;;;;;;;;;;iBChDlC,KACvB,UAAU,gBACV,eACA,UAAU,KAAK,0CACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCqBqB,QAAQ,GAC/B,QAAQ,aAAa,IACrB,UAAU,OAAO,YACjB;EAAY;;;;;;;;;iBCrCW,QAAQ,UAAU,OAAO,mBAAmB,QAAQ,IAAI;;;;;;UCJvD;;;;EAIxB;;;;;;;;;;;;;iBC6CuB,OAAO,kBAAkB,QAAQ,GAAG,UAAU,eAAe"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/Animation.ts","../src/render/addAnimation.ts","../src/render/addEvent.ts","../src/render/addElement.ts","../src/render/addFragment.ts","../src/render/applyProps.ts","../src/render/buildClasses.ts","../src/render/buildStyles.ts","../src/render/clearLayoutSlot.ts","../src/render/fillLayoutSlot.ts","../src/render/formatText.ts","../src/render/firstInsideNode.ts","../src/render/getFragment.ts","../src/render/getElementFragment.ts","../src/render/hydrate.ts","../src/render/mount.ts","../src/render/unmount.ts","../src/types/ListItemSpec.ts","../src/types/ListItem.ts","../src/render/newListItem.ts","../src/render/newRegion.ts","../src/render/nodeAnchor.ts","../src/render/nodeChild.ts","../src/render/nodeNext.ts","../src/render/nodeRootElement.ts","../src/render/nodeRoot.ts","../src/render/nodeSkip.ts","../src/render/popRegion.ts","../src/render/pushRegion.ts","../src/render/rerunRegionEffects.ts","../src/render/restoreHydration.ts","../src/render/runControl.ts","../src/render/runControlBranch.ts","../src/render/runList.ts","../src/render/runAwait.ts","../src/render/runTry.ts","../src/render/saveHydration.ts","../src/render/headElement.ts","../src/render/setAttribute.ts","../src/render/setDynamicElement.ts","../src/types/Bindable.ts","../src/watch/$batch.ts","../src/watch/$async.ts","../src/watch/$bind.ts","../src/watch/$cache.ts","../src/watch/$onmount.ts","../src/watch/$peek.ts","../src/watch/$pending.ts","../src/watch/$refresh.ts","../src/watch/$run.ts","../src/watch/$stream.ts","../src/watch/$unwrap.ts","../src/types/WatchOptions.ts","../src/watch/$watch.ts"],"mappings":";;;;;UAAyB;EACxB,WAAW,aAAa;EACxB,mBAAmB;;;;iBCCI,aAAa,IAAI,aAAa,QAAQ,WAAW,OAAO;;;iBCDxD,SACvB,IAAI,SACJ,cACA,YAAA,MAAkB,SAAS;;;;;;;;;;;;;;;;;;;;;;iBCkBJ,WAAW,MAAM,SAAS,QAAQ,YAAY,QAAQ;;;iBCnBtD,YACvB,UAAU,kBACV,QAAQ,YACR,QAAQ,aACR,UAAU,WACV,YAAY;;;iBCNW,WACvB,IAAI,SACJ,OAAO,iCACP;;;iBCHuB,aAAa,OAAO,YAAY;;;iBCChC,YAAY,OAAO;;;;;;;;;;iBCQnB,gBAAgB,QAAQ;;;;;;;;;;;;;;;;;;iBC6BxB,eACvB,WAAW,WACX,MAAM,YACN,QAAQ,YACR,QAAQ,aACR,SAAS,OAAO,mBAChB,WAAW,OAAO,oBAChB;;;iBC9CqB,WAAW;;;;;;;;iBCiBX,gBAAgB,QAAQ,YAAY;;;iBCnBpC,YACvB,UAAU,UACV,OAAO,oBACP,eACA,cACA,eACE;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCkBqB,mBACvB,UAAU,UACV,OAAO,WACP,eACA,cACA,eACE;;;;;;;;;;;;;;;;;iBCNqB,QACvB,QAAQ,YACR,WAAW,WACX,QAAQ,qBACR,QAAQ,eAAe;;;;;;;;;;;;;;;;;;;;;;iBCAA,MACvB,QAAQ,YACR,WAAW,WACX,QAAQ,qBACR,QAAQ,eAAe;;;;;;;;;;;;;;;;;;;;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