@fictjs/runtime 0.10.0 → 0.12.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.
Files changed (72) hide show
  1. package/dist/advanced.cjs +9 -9
  2. package/dist/advanced.d.cts +3 -3
  3. package/dist/advanced.d.ts +3 -3
  4. package/dist/advanced.js +4 -4
  5. package/dist/{binding-DqxS9ZQf.d.ts → binding-DcnhUSQK.d.ts} +1 -1
  6. package/dist/{binding-DUEukRxl.d.cts → binding-FRyTeLDn.d.cts} +1 -1
  7. package/dist/{chunk-DKA2I6ET.js → chunk-2UR2UWE2.js} +3 -3
  8. package/dist/{chunk-SZLJCQFZ.cjs → chunk-44EQF3AR.cjs} +63 -52
  9. package/dist/chunk-44EQF3AR.cjs.map +1 -0
  10. package/dist/{chunk-I4GKKAAY.cjs → chunk-4QGEN5SJ.cjs} +295 -262
  11. package/dist/chunk-4QGEN5SJ.cjs.map +1 -0
  12. package/dist/{chunk-V7BC64W2.cjs → chunk-C5IE4WUG.cjs} +8 -8
  13. package/dist/{chunk-V7BC64W2.cjs.map → chunk-C5IE4WUG.cjs.map} +1 -1
  14. package/dist/{chunk-F4RVNXOL.js → chunk-DIK33H5U.js} +8 -2
  15. package/dist/chunk-DIK33H5U.js.map +1 -0
  16. package/dist/{chunk-2JRPPCG7.js → chunk-FESAXMHT.js} +7 -6
  17. package/dist/{chunk-2JRPPCG7.js.map → chunk-FESAXMHT.js.map} +1 -1
  18. package/dist/chunk-FHQZCAAK.cjs +112 -0
  19. package/dist/chunk-FHQZCAAK.cjs.map +1 -0
  20. package/dist/{chunk-EQ5E4WOV.cjs → chunk-QNMYVXRL.cjs} +44 -38
  21. package/dist/chunk-QNMYVXRL.cjs.map +1 -0
  22. package/dist/{chunk-P4TZLFV6.js → chunk-S63VBIWN.js} +27 -16
  23. package/dist/chunk-S63VBIWN.js.map +1 -0
  24. package/dist/{chunk-R6FINS25.js → chunk-WIHNVN6L.js} +106 -73
  25. package/dist/chunk-WIHNVN6L.js.map +1 -0
  26. package/dist/{devtools-CMxlJUTx.d.cts → devtools-BtIkN77t.d.cts} +1 -1
  27. package/dist/{devtools-C4Hgfa-S.d.ts → devtools-D2z4llpA.d.ts} +1 -1
  28. package/dist/index.cjs +60 -58
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +4 -4
  31. package/dist/index.d.ts +4 -4
  32. package/dist/index.dev.js +72 -51
  33. package/dist/index.dev.js.map +1 -1
  34. package/dist/index.js +13 -11
  35. package/dist/index.js.map +1 -1
  36. package/dist/internal-list.cjs +4 -4
  37. package/dist/internal-list.d.cts +1 -1
  38. package/dist/internal-list.d.ts +1 -1
  39. package/dist/internal-list.js +3 -3
  40. package/dist/internal.cjs +5 -5
  41. package/dist/internal.d.cts +4 -4
  42. package/dist/internal.d.ts +4 -4
  43. package/dist/internal.js +4 -4
  44. package/dist/{list-BBzsJhrm.d.ts → list-BKM6YOPq.d.ts} +1 -1
  45. package/dist/{list-_NJCcjl1.d.cts → list-Bi8dDF8Q.d.cts} +1 -1
  46. package/dist/loader.cjs +28 -26
  47. package/dist/loader.cjs.map +1 -1
  48. package/dist/loader.js +11 -9
  49. package/dist/loader.js.map +1 -1
  50. package/dist/{props--zJ4ebbT.d.cts → props-9chMyBGb.d.cts} +1 -1
  51. package/dist/{props-BAGR7j-j.d.ts → props-D1nj2p_3.d.ts} +1 -1
  52. package/dist/{scope-CuImnvh1.d.ts → scope-BSkhJr0a.d.ts} +1 -1
  53. package/dist/{scope-Dq5hOu7c.d.cts → scope-Bn3sxem5.d.cts} +1 -1
  54. package/package.json +1 -1
  55. package/src/binding.ts +59 -29
  56. package/src/context.ts +4 -3
  57. package/src/dom.ts +65 -39
  58. package/src/error-boundary.ts +5 -5
  59. package/src/lifecycle.ts +8 -1
  60. package/src/list-helpers.ts +30 -13
  61. package/src/loader.ts +10 -8
  62. package/src/node-ops.ts +8 -5
  63. package/src/suspense.ts +5 -4
  64. package/dist/chunk-EQ5E4WOV.cjs.map +0 -1
  65. package/dist/chunk-F4RVNXOL.js.map +0 -1
  66. package/dist/chunk-I4GKKAAY.cjs.map +0 -1
  67. package/dist/chunk-K3DH5SD5.cjs +0 -111
  68. package/dist/chunk-K3DH5SD5.cjs.map +0 -1
  69. package/dist/chunk-P4TZLFV6.js.map +0 -1
  70. package/dist/chunk-R6FINS25.js.map +0 -1
  71. package/dist/chunk-SZLJCQFZ.cjs.map +0 -1
  72. /package/dist/{chunk-DKA2I6ET.js.map → chunk-2UR2UWE2.js.map} +0 -0
package/dist/advanced.cjs CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkK3DH5SD5cjs = require('./chunk-K3DH5SD5.cjs');
5
+ var _chunkFHQZCAAKcjs = require('./chunk-FHQZCAAK.cjs');
6
6
 
7
7
 
8
8
 
9
- var _chunkV7BC64W2cjs = require('./chunk-V7BC64W2.cjs');
9
+ var _chunkC5IE4WUGcjs = require('./chunk-C5IE4WUG.cjs');
10
10
 
11
11
 
12
12
 
@@ -18,7 +18,7 @@ var _chunkV7BC64W2cjs = require('./chunk-V7BC64W2.cjs');
18
18
 
19
19
 
20
20
 
21
- var _chunkI4GKKAAYcjs = require('./chunk-I4GKKAAY.cjs');
21
+ var _chunk4QGEN5SJcjs = require('./chunk-4QGEN5SJ.cjs');
22
22
 
23
23
 
24
24
 
@@ -28,13 +28,13 @@ var _chunkI4GKKAAYcjs = require('./chunk-I4GKKAAY.cjs');
28
28
 
29
29
 
30
30
 
31
- var _chunkEQ5E4WOVcjs = require('./chunk-EQ5E4WOV.cjs');
31
+ var _chunkQNMYVXRLcjs = require('./chunk-QNMYVXRL.cjs');
32
32
 
33
33
  // src/versioned-signal.ts
34
34
  function createVersionedSignal(initialValue, options) {
35
35
  const equals = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.equals]), () => ( Object.is));
36
- const value = _chunkEQ5E4WOVcjs.signal.call(void 0, initialValue);
37
- const version = _chunkEQ5E4WOVcjs.signal.call(void 0, 0);
36
+ const value = _chunkQNMYVXRLcjs.signal.call(void 0, initialValue);
37
+ const version = _chunkQNMYVXRLcjs.signal.call(void 0, 0);
38
38
  const bumpVersion = () => {
39
39
  const next = version() + 1;
40
40
  version(next);
@@ -55,8 +55,8 @@ function createVersionedSignal(initialValue, options) {
55
55
  force: () => {
56
56
  bumpVersion();
57
57
  },
58
- peekVersion: () => _chunkEQ5E4WOVcjs.untrack.call(void 0, () => version()),
59
- peekValue: () => _chunkEQ5E4WOVcjs.untrack.call(void 0, () => value())
58
+ peekVersion: () => _chunkQNMYVXRLcjs.untrack.call(void 0, () => version()),
59
+ peekValue: () => _chunkQNMYVXRLcjs.untrack.call(void 0, () => value())
60
60
  };
61
61
  }
62
62
 
@@ -83,5 +83,5 @@ function createVersionedSignal(initialValue, options) {
83
83
 
84
84
 
85
85
 
86
- exports.createAttributeBinding = _chunkI4GKKAAYcjs.createAttributeBinding; exports.createChildBinding = _chunkI4GKKAAYcjs.createChildBinding; exports.createClassBinding = _chunkI4GKKAAYcjs.createClassBinding; exports.createContext = _chunkK3DH5SD5cjs.createContext; exports.createRenderEffect = _chunkEQ5E4WOVcjs.createRenderEffect; exports.createScope = _chunkV7BC64W2cjs.createScope; exports.createSelector = _chunkEQ5E4WOVcjs.createSelector; exports.createShow = _chunkI4GKKAAYcjs.createShow; exports.createSignal = _chunkEQ5E4WOVcjs.signal; exports.createStyleBinding = _chunkI4GKKAAYcjs.createStyleBinding; exports.createTextBinding = _chunkI4GKKAAYcjs.createTextBinding; exports.createVersionedSignal = createVersionedSignal; exports.effectScope = _chunkEQ5E4WOVcjs.effectScope; exports.getDevtoolsHook = _chunkEQ5E4WOVcjs.getDevtoolsHook; exports.hasContext = _chunkK3DH5SD5cjs.hasContext; exports.isReactive = _chunkI4GKKAAYcjs.isReactive; exports.nonReactive = _chunkI4GKKAAYcjs.nonReactive; exports.reactive = _chunkI4GKKAAYcjs.reactive; exports.registerErrorHandler = _chunkEQ5E4WOVcjs.registerErrorHandler; exports.runInScope = _chunkV7BC64W2cjs.runInScope; exports.setCycleProtectionOptions = _chunkEQ5E4WOVcjs.setCycleProtectionOptions; exports.unwrap = _chunkI4GKKAAYcjs.unwrap; exports.useContext = _chunkK3DH5SD5cjs.useContext;
86
+ exports.createAttributeBinding = _chunk4QGEN5SJcjs.createAttributeBinding; exports.createChildBinding = _chunk4QGEN5SJcjs.createChildBinding; exports.createClassBinding = _chunk4QGEN5SJcjs.createClassBinding; exports.createContext = _chunkFHQZCAAKcjs.createContext; exports.createRenderEffect = _chunkQNMYVXRLcjs.createRenderEffect; exports.createScope = _chunkC5IE4WUGcjs.createScope; exports.createSelector = _chunkQNMYVXRLcjs.createSelector; exports.createShow = _chunk4QGEN5SJcjs.createShow; exports.createSignal = _chunkQNMYVXRLcjs.signal; exports.createStyleBinding = _chunk4QGEN5SJcjs.createStyleBinding; exports.createTextBinding = _chunk4QGEN5SJcjs.createTextBinding; exports.createVersionedSignal = createVersionedSignal; exports.effectScope = _chunkQNMYVXRLcjs.effectScope; exports.getDevtoolsHook = _chunkQNMYVXRLcjs.getDevtoolsHook; exports.hasContext = _chunkFHQZCAAKcjs.hasContext; exports.isReactive = _chunk4QGEN5SJcjs.isReactive; exports.nonReactive = _chunk4QGEN5SJcjs.nonReactive; exports.reactive = _chunk4QGEN5SJcjs.reactive; exports.registerErrorHandler = _chunkQNMYVXRLcjs.registerErrorHandler; exports.runInScope = _chunkC5IE4WUGcjs.runInScope; exports.setCycleProtectionOptions = _chunkQNMYVXRLcjs.setCycleProtectionOptions; exports.unwrap = _chunk4QGEN5SJcjs.unwrap; exports.useContext = _chunkFHQZCAAKcjs.useContext;
87
87
  //# sourceMappingURL=advanced.cjs.map
@@ -1,7 +1,7 @@
1
- export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-Dq5hOu7c.cjs';
1
+ export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-Bn3sxem5.cjs';
2
2
  export { S as Signal, c as createSelector, s as createSignal, e as effectScope } from './signal-Z4KkDk9h.cjs';
3
- export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, h as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, n as nonReactive, r as reactive, g as registerErrorHandler, u as unwrap } from './binding-DUEukRxl.cjs';
4
- export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './devtools-CMxlJUTx.cjs';
3
+ export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, h as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, n as nonReactive, r as reactive, g as registerErrorHandler, u as unwrap } from './binding-FRyTeLDn.cjs';
4
+ export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './devtools-BtIkN77t.cjs';
5
5
 
6
6
  interface VersionedSignalOptions<T> {
7
7
  equals?: (prev: T, next: T) => boolean;
@@ -1,7 +1,7 @@
1
- export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-CuImnvh1.js';
1
+ export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-BSkhJr0a.js';
2
2
  export { S as Signal, c as createSelector, s as createSignal, e as effectScope } from './signal-Z4KkDk9h.js';
3
- export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, h as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, n as nonReactive, r as reactive, g as registerErrorHandler, u as unwrap } from './binding-DqxS9ZQf.js';
4
- export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './devtools-C4Hgfa-S.js';
3
+ export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, h as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, n as nonReactive, r as reactive, g as registerErrorHandler, u as unwrap } from './binding-DcnhUSQK.js';
4
+ export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './devtools-D2z4llpA.js';
5
5
 
6
6
  interface VersionedSignalOptions<T> {
7
7
  equals?: (prev: T, next: T) => boolean;
package/dist/advanced.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  createContext,
3
3
  hasContext,
4
4
  useContext
5
- } from "./chunk-2JRPPCG7.js";
5
+ } from "./chunk-FESAXMHT.js";
6
6
  import {
7
7
  createScope,
8
8
  runInScope
9
- } from "./chunk-DKA2I6ET.js";
9
+ } from "./chunk-2UR2UWE2.js";
10
10
  import {
11
11
  createAttributeBinding,
12
12
  createChildBinding,
@@ -18,7 +18,7 @@ import {
18
18
  nonReactive,
19
19
  reactive,
20
20
  unwrap
21
- } from "./chunk-R6FINS25.js";
21
+ } from "./chunk-WIHNVN6L.js";
22
22
  import {
23
23
  createRenderEffect,
24
24
  createSelector,
@@ -28,7 +28,7 @@ import {
28
28
  setCycleProtectionOptions,
29
29
  signal,
30
30
  untrack
31
- } from "./chunk-F4RVNXOL.js";
31
+ } from "./chunk-DIK33H5U.js";
32
32
 
33
33
  // src/versioned-signal.ts
34
34
  function createVersionedSignal(initialValue, options) {
@@ -179,7 +179,7 @@ declare function callEventHandler(handler: EventListenerOrEventListenerObject |
179
179
  * createTextBinding(() => $count())
180
180
  * ```
181
181
  */
182
- declare function createTextBinding(value: MaybeReactive<unknown>): Text;
182
+ declare function createTextBinding(value: MaybeReactive<unknown>, owner?: Document | Node | null): Text;
183
183
  /**
184
184
  * Bind a reactive value to an existing text node.
185
185
  * This is a convenience function for binding to existing DOM nodes.
@@ -179,7 +179,7 @@ declare function callEventHandler(handler: EventListenerOrEventListenerObject |
179
179
  * createTextBinding(() => $count())
180
180
  * ```
181
181
  */
182
- declare function createTextBinding(value: MaybeReactive<unknown>): Text;
182
+ declare function createTextBinding(value: MaybeReactive<unknown>, owner?: Document | Node | null): Text;
183
183
  /**
184
184
  * Bind a reactive value to an existing text node.
185
185
  * This is a convenience function for binding to existing DOM nodes.
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  isReactive
3
- } from "./chunk-R6FINS25.js";
3
+ } from "./chunk-WIHNVN6L.js";
4
4
  import {
5
5
  createEffect,
6
6
  createRoot,
7
7
  onCleanup,
8
8
  registerRootCleanup
9
- } from "./chunk-F4RVNXOL.js";
9
+ } from "./chunk-DIK33H5U.js";
10
10
 
11
11
  // src/scope.ts
12
12
  function createScope() {
@@ -44,4 +44,4 @@ export {
44
44
  createScope,
45
45
  runInScope
46
46
  };
47
- //# sourceMappingURL=chunk-DKA2I6ET.js.map
47
+ //# sourceMappingURL=chunk-2UR2UWE2.js.map
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkI4GKKAAYcjs = require('./chunk-I4GKKAAY.cjs');
9
+ var _chunk4QGEN5SJcjs = require('./chunk-4QGEN5SJ.cjs');
10
10
 
11
11
 
12
12
 
@@ -21,7 +21,7 @@ var _chunkI4GKKAAYcjs = require('./chunk-I4GKKAAY.cjs');
21
21
 
22
22
 
23
23
 
24
- var _chunkEQ5E4WOVcjs = require('./chunk-EQ5E4WOV.cjs');
24
+ var _chunkQNMYVXRLcjs = require('./chunk-QNMYVXRL.cjs');
25
25
 
26
26
  // src/reconcile.ts
27
27
  function reconcileArrays(parentNode, a, b) {
@@ -151,7 +151,7 @@ var MAX_SAFE_VERSION = 9007199254740991;
151
151
  function createVersionedSignalAccessor(initialValue) {
152
152
  let current = initialValue;
153
153
  let version = 0;
154
- const track = _chunkEQ5E4WOVcjs.signal.call(void 0, version);
154
+ const track = _chunkQNMYVXRLcjs.signal.call(void 0, version);
155
155
  function accessor(value) {
156
156
  if (arguments.length === 0) {
157
157
  track();
@@ -163,12 +163,13 @@ function createVersionedSignalAccessor(initialValue) {
163
163
  }
164
164
  return accessor;
165
165
  }
166
- function createKeyedListContainer(startOverride, endOverride) {
167
- const startMarker = _nullishCoalesce(startOverride, () => ( document.createComment("fict:list:start")));
168
- const endMarker = _nullishCoalesce(endOverride, () => ( document.createComment("fict:list:end")));
166
+ function createKeyedListContainer(startOverride, endOverride, defaultOwnerDocument) {
167
+ const markerOwnerDocument = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([startOverride, 'optionalAccess', _9 => _9.ownerDocument]), () => ( _optionalChain([endOverride, 'optionalAccess', _10 => _10.ownerDocument]))), () => ( defaultOwnerDocument)), () => ( document));
168
+ const startMarker = _nullishCoalesce(startOverride, () => ( markerOwnerDocument.createComment("fict:list:start")));
169
+ const endMarker = _nullishCoalesce(endOverride, () => ( markerOwnerDocument.createComment("fict:list:end")));
169
170
  const dispose = () => {
170
171
  for (const block of container.blocks.values()) {
171
- _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, block.root);
172
+ _chunkQNMYVXRLcjs.destroyRoot.call(void 0, block.root);
172
173
  }
173
174
  container.blocks.clear();
174
175
  container.nextBlocks.clear();
@@ -180,7 +181,8 @@ function createKeyedListContainer(startOverride, endOverride) {
180
181
  container.orderedIndexByKey.clear();
181
182
  return;
182
183
  }
183
- const range = document.createRange();
184
+ const rangeOwnerDocument = _nullishCoalesce(_nullishCoalesce(startMarker.ownerDocument, () => ( endMarker.ownerDocument)), () => ( markerOwnerDocument));
185
+ const range = rangeOwnerDocument.createRange();
184
186
  range.setStartBefore(startMarker);
185
187
  range.setEndAfter(endMarker);
186
188
  range.deleteContents();
@@ -207,32 +209,33 @@ function createKeyedListContainer(startOverride, endOverride) {
207
209
  }
208
210
  function createKeyedBlock(key, item, index, render, needsIndex = true, hostRoot) {
209
211
  const itemSig = createVersionedSignalAccessor(item);
210
- const indexSig = needsIndex ? _chunkEQ5E4WOVcjs.signal.call(void 0, index) : ((next) => {
212
+ const indexSig = needsIndex ? _chunkQNMYVXRLcjs.signal.call(void 0, index) : (function indexSignal(next) {
211
213
  if (arguments.length === 0) return index;
212
214
  index = next;
213
215
  return index;
214
216
  });
215
- const root = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, hostRoot);
216
- const prevRoot = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root);
217
+ const root = _chunkQNMYVXRLcjs.createRootContext.call(void 0, hostRoot);
218
+ const nodeOwnerDocument = _nullishCoalesce(_nullishCoalesce(root.ownerDocument, () => ( _optionalChain([hostRoot, 'optionalAccess', _11 => _11.ownerDocument]))), () => ( document));
219
+ const prevRoot = _chunkQNMYVXRLcjs.pushRoot.call(void 0, root);
217
220
  let nodes = [];
218
221
  let scopeDispose;
219
- const prevSub = _chunkEQ5E4WOVcjs.setActiveSub.call(void 0, void 0);
222
+ const prevSub = _chunkQNMYVXRLcjs.setActiveSub.call(void 0, void 0);
220
223
  try {
221
- scopeDispose = _chunkEQ5E4WOVcjs.effectScope.call(void 0, () => {
224
+ scopeDispose = _chunkQNMYVXRLcjs.effectScope.call(void 0, () => {
222
225
  const rendered = render(itemSig, indexSig, key);
223
226
  if (rendered instanceof Node || Array.isArray(rendered) && rendered.every((n) => n instanceof Node)) {
224
- nodes = _chunkI4GKKAAYcjs.toNodeArray.call(void 0, rendered);
227
+ nodes = _chunk4QGEN5SJcjs.toNodeArray.call(void 0, rendered, nodeOwnerDocument);
225
228
  } else {
226
- const element = _chunkI4GKKAAYcjs.createElement.call(void 0, rendered);
227
- nodes = _chunkI4GKKAAYcjs.toNodeArray.call(void 0, element);
229
+ const element = _chunk4QGEN5SJcjs.createElement.call(void 0, rendered);
230
+ nodes = _chunk4QGEN5SJcjs.toNodeArray.call(void 0, element, nodeOwnerDocument);
228
231
  }
229
232
  });
230
233
  if (scopeDispose) {
231
234
  root.cleanups.push(scopeDispose);
232
235
  }
233
236
  } finally {
234
- _chunkEQ5E4WOVcjs.setActiveSub.call(void 0, prevSub);
235
- _chunkEQ5E4WOVcjs.popRoot.call(void 0, prevRoot);
237
+ _chunkQNMYVXRLcjs.setActiveSub.call(void 0, prevSub);
238
+ _chunkQNMYVXRLcjs.popRoot.call(void 0, prevRoot);
236
239
  }
237
240
  return {
238
241
  key,
@@ -344,10 +347,15 @@ function createKeyedList(getItems, keyFn, renderItem, needsIndex, startMarker, e
344
347
  );
345
348
  }
346
349
  function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, startOverride, endOverride) {
347
- const container = createKeyedListContainer(startOverride, endOverride);
348
- const hostRoot = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
350
+ const hostRoot = _chunkQNMYVXRLcjs.getCurrentRoot.call(void 0, );
351
+ const container = createKeyedListContainer(
352
+ startOverride,
353
+ endOverride,
354
+ _nullishCoalesce(_optionalChain([hostRoot, 'optionalAccess', _12 => _12.ownerDocument]), () => ( document))
355
+ );
356
+ const markerOwnerDocument = _nullishCoalesce(_nullishCoalesce(container.startMarker.ownerDocument, () => ( _optionalChain([hostRoot, 'optionalAccess', _13 => _13.ownerDocument]))), () => ( document));
349
357
  const useProvided = !!(startOverride && endOverride);
350
- const fragment = useProvided ? container.startMarker : document.createDocumentFragment();
358
+ const fragment = useProvided ? container.startMarker : markerOwnerDocument.createDocumentFragment();
351
359
  if (!useProvided) {
352
360
  ;
353
361
  fragment.append(container.startMarker, container.endMarker);
@@ -357,7 +365,7 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
357
365
  let connectObserver = null;
358
366
  let effectStarted = false;
359
367
  let startScheduled = false;
360
- let initialHydrating = _chunkEQ5E4WOVcjs.__fictIsHydrating.call(void 0, );
368
+ let initialHydrating = _chunkQNMYVXRLcjs.__fictIsHydrating.call(void 0, );
361
369
  const collectBetween = () => {
362
370
  const nodes = [];
363
371
  let cursor = container.startMarker.nextSibling;
@@ -385,17 +393,17 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
385
393
  };
386
394
  const performDiff = () => {
387
395
  if (disposed) return;
388
- const isSSR = _chunkEQ5E4WOVcjs.__fictIsSSR.call(void 0, );
396
+ const isSSR = _chunkQNMYVXRLcjs.__fictIsSSR.call(void 0, );
389
397
  const parent = isSSR ? container.startMarker.parentNode : getConnectedParent();
390
398
  if (!parent) return;
391
- _chunkI4GKKAAYcjs.batch.call(void 0, () => {
399
+ _chunk4QGEN5SJcjs.batch.call(void 0, () => {
392
400
  const oldBlocks = container.blocks;
393
401
  const newBlocks = container.nextBlocks;
394
402
  const prevOrderedBlocks = container.orderedBlocks;
395
403
  const nextOrderedBlocks = container.nextOrderedBlocks;
396
404
  const orderedIndexByKey = container.orderedIndexByKey;
397
405
  const newItems = getItems();
398
- if (initialHydrating && _chunkI4GKKAAYcjs.isHydratingActive.call(void 0, )) {
406
+ if (initialHydrating && _chunk4QGEN5SJcjs.isHydratingActive.call(void 0, )) {
399
407
  initialHydrating = false;
400
408
  newBlocks.clear();
401
409
  nextOrderedBlocks.length = 0;
@@ -408,10 +416,10 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
408
416
  return;
409
417
  }
410
418
  const createdBlocks2 = [];
411
- _chunkI4GKKAAYcjs.withHydrationRange.call(void 0,
419
+ _chunk4QGEN5SJcjs.withHydrationRange.call(void 0,
412
420
  container.startMarker.nextSibling,
413
421
  container.endMarker,
414
- _nullishCoalesce(parent.ownerDocument, () => ( document)),
422
+ _nullishCoalesce(parent.ownerDocument, () => ( markerOwnerDocument)),
415
423
  () => {
416
424
  for (let index = 0; index < newItems.length; index++) {
417
425
  const item = newItems[index];
@@ -424,8 +432,8 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
424
432
  }
425
433
  const existing = newBlocks.get(key);
426
434
  if (existing) {
427
- _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, existing.root);
428
- _chunkI4GKKAAYcjs.removeNodes.call(void 0, existing.nodes);
435
+ _chunkQNMYVXRLcjs.destroyRoot.call(void 0, existing.root);
436
+ _chunk4QGEN5SJcjs.removeNodes.call(void 0, existing.nodes);
429
437
  }
430
438
  }
431
439
  const block = createKeyedBlock(key, item, index, renderItem, needsIndex, hostRoot);
@@ -446,7 +454,7 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
446
454
  container.nextNodes.length = 0;
447
455
  for (const block of createdBlocks2) {
448
456
  if (newBlocks.get(block.key) === block) {
449
- _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, block.root);
457
+ _chunkQNMYVXRLcjs.flushOnMount.call(void 0, block.root);
450
458
  }
451
459
  }
452
460
  return;
@@ -454,9 +462,9 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
454
462
  if (newItems.length === 0) {
455
463
  if (oldBlocks.size > 0) {
456
464
  for (const block of oldBlocks.values()) {
457
- _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, block.root);
465
+ _chunkQNMYVXRLcjs.destroyRoot.call(void 0, block.root);
458
466
  }
459
- const range = document.createRange();
467
+ const range = (_nullishCoalesce(parent.ownerDocument, () => ( markerOwnerDocument))).createRange();
460
468
  range.setStartAfter(container.startMarker);
461
469
  range.setEndBefore(container.endMarker);
462
470
  range.deleteContents();
@@ -535,8 +543,8 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
535
543
  `[fict] Duplicate key "${String(key)}" detected in list rendering. Each item should have a unique key. The previous item with this key will be replaced.`
536
544
  );
537
545
  }
538
- _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, existingBlock.root);
539
- _chunkI4GKKAAYcjs.removeNodes.call(void 0, existingBlock.nodes);
546
+ _chunkQNMYVXRLcjs.destroyRoot.call(void 0, existingBlock.root);
547
+ _chunk4QGEN5SJcjs.removeNodes.call(void 0, existingBlock.nodes);
540
548
  }
541
549
  block = createKeyedBlock(key, item, index, renderItem, needsIndex, hostRoot);
542
550
  createdBlocks.push(block);
@@ -549,8 +557,8 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
549
557
  hasDuplicateKey = true;
550
558
  const prior = nextOrderedBlocks[position];
551
559
  if (prior && prior !== resolvedBlock) {
552
- _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, prior.root);
553
- _chunkI4GKKAAYcjs.removeNodes.call(void 0, prior.nodes);
560
+ _chunkQNMYVXRLcjs.destroyRoot.call(void 0, prior.root);
561
+ _chunk4QGEN5SJcjs.removeNodes.call(void 0, prior.nodes);
554
562
  }
555
563
  nextOrderedBlocks[position] = resolvedBlock;
556
564
  } else {
@@ -588,7 +596,7 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
588
596
  }
589
597
  }
590
598
  if (appendedNodes.length > 0) {
591
- _chunkI4GKKAAYcjs.insertNodesBefore.call(void 0, parent, appendedNodes, container.endMarker);
599
+ _chunk4QGEN5SJcjs.insertNodesBefore.call(void 0, parent, appendedNodes, container.endMarker);
592
600
  const currentNodes = container.currentNodes;
593
601
  currentNodes.pop();
594
602
  for (let i = 0; i < appendedNodes.length; i++) {
@@ -602,15 +610,15 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
602
610
  container.nextOrderedBlocks = prevOrderedBlocks;
603
611
  for (const block of createdBlocks) {
604
612
  if (newBlocks.get(block.key) === block) {
605
- _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, block.root);
613
+ _chunkQNMYVXRLcjs.flushOnMount.call(void 0, block.root);
606
614
  }
607
615
  }
608
616
  return;
609
617
  }
610
618
  if (oldBlocks.size > 0) {
611
619
  for (const block of oldBlocks.values()) {
612
- _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, block.root);
613
- _chunkI4GKKAAYcjs.removeNodes.call(void 0, block.nodes);
620
+ _chunkQNMYVXRLcjs.destroyRoot.call(void 0, block.root);
621
+ _chunk4QGEN5SJcjs.removeNodes.call(void 0, block.nodes);
614
622
  }
615
623
  oldBlocks.clear();
616
624
  }
@@ -669,30 +677,30 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
669
677
  container.nextOrderedBlocks = prevOrderedBlocks;
670
678
  for (const block of createdBlocks) {
671
679
  if (newBlocks.get(block.key) === block) {
672
- _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, block.root);
680
+ _chunkQNMYVXRLcjs.flushOnMount.call(void 0, block.root);
673
681
  }
674
682
  }
675
683
  });
676
684
  };
677
685
  const disconnectObserver = () => {
678
- _optionalChain([connectObserver, 'optionalAccess', _9 => _9.disconnect, 'call', _10 => _10()]);
686
+ _optionalChain([connectObserver, 'optionalAccess', _14 => _14.disconnect, 'call', _15 => _15()]);
679
687
  connectObserver = null;
680
688
  };
681
689
  const ensureEffectStarted = () => {
682
690
  if (disposed || effectStarted) return effectStarted;
683
- const isSSR = _chunkEQ5E4WOVcjs.__fictIsSSR.call(void 0, );
691
+ const isSSR = _chunkQNMYVXRLcjs.__fictIsSSR.call(void 0, );
684
692
  const parent = isSSR ? container.startMarker.parentNode : getConnectedParent();
685
693
  if (!parent) return false;
686
694
  const start = () => {
687
- effectDispose = _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, performDiff);
695
+ effectDispose = _chunkQNMYVXRLcjs.createRenderEffect.call(void 0, performDiff);
688
696
  effectStarted = true;
689
697
  };
690
698
  if (hostRoot) {
691
- const prev = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, hostRoot);
699
+ const prev = _chunkQNMYVXRLcjs.pushRoot.call(void 0, hostRoot);
692
700
  try {
693
701
  start();
694
702
  } finally {
695
- _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev);
703
+ _chunkQNMYVXRLcjs.popRoot.call(void 0, prev);
696
704
  }
697
705
  } else {
698
706
  start();
@@ -701,18 +709,21 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
701
709
  };
702
710
  const waitForConnection = () => {
703
711
  if (connectObserver || typeof MutationObserver === "undefined") return;
704
- const root = _nullishCoalesce(_optionalChain([container, 'access', _11 => _11.startMarker, 'access', _12 => _12.getRootNode, 'optionalCall', _13 => _13()]), () => ( document));
712
+ const root = _nullishCoalesce(_optionalChain([container, 'access', _16 => _16.startMarker, 'access', _17 => _17.getRootNode, 'optionalCall', _18 => _18()]), () => ( markerOwnerDocument));
705
713
  const shadowRoot = root && root.nodeType === 11 && isShadowRoot(root) ? root : null;
706
714
  connectObserver = new MutationObserver(() => {
707
715
  if (disposed) return;
708
716
  if (getConnectedParent()) {
709
717
  disconnectObserver();
710
718
  if (ensureEffectStarted()) {
711
- _chunkEQ5E4WOVcjs.flush.call(void 0, );
719
+ _chunkQNMYVXRLcjs.flush.call(void 0, );
712
720
  }
713
721
  }
714
722
  });
715
- connectObserver.observe(document, { childList: true, subtree: true });
723
+ connectObserver.observe(markerOwnerDocument, { childList: true, subtree: true });
724
+ if (root && root.nodeType === 11) {
725
+ connectObserver.observe(root, { childList: true, subtree: true });
726
+ }
716
727
  if (shadowRoot) {
717
728
  connectObserver.observe(shadowRoot, { childList: true, subtree: true });
718
729
  }
@@ -745,14 +756,14 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
745
756
  if (disposed) return;
746
757
  scheduleStart();
747
758
  if (ensureEffectStarted()) {
748
- _chunkEQ5E4WOVcjs.flush.call(void 0, );
759
+ _chunkQNMYVXRLcjs.flush.call(void 0, );
749
760
  } else {
750
761
  waitForConnection();
751
762
  }
752
763
  },
753
764
  dispose: () => {
754
765
  disposed = true;
755
- _optionalChain([effectDispose, 'optionalCall', _14 => _14()]);
766
+ _optionalChain([effectDispose, 'optionalCall', _19 => _19()]);
756
767
  disconnectObserver();
757
768
  container.dispose();
758
769
  }
@@ -765,4 +776,4 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, sta
765
776
 
766
777
 
767
778
  exports.reconcileArrays = reconcileArrays; exports.moveNodesBefore = moveNodesBefore; exports.isNodeBetweenMarkers = isNodeBetweenMarkers; exports.createKeyedList = createKeyedList;
768
- //# sourceMappingURL=chunk-SZLJCQFZ.cjs.map
779
+ //# sourceMappingURL=chunk-44EQF3AR.cjs.map