@fictjs/runtime 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced.cjs +9 -9
- package/dist/advanced.d.cts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +4 -4
- package/dist/{binding-DqxS9ZQf.d.ts → binding-DcnhUSQK.d.ts} +1 -1
- package/dist/{binding-DUEukRxl.d.cts → binding-FRyTeLDn.d.cts} +1 -1
- package/dist/{chunk-DKA2I6ET.js → chunk-2UR2UWE2.js} +3 -3
- package/dist/{chunk-SZLJCQFZ.cjs → chunk-44EQF3AR.cjs} +63 -52
- package/dist/chunk-44EQF3AR.cjs.map +1 -0
- package/dist/{chunk-I4GKKAAY.cjs → chunk-4QGEN5SJ.cjs} +295 -262
- package/dist/chunk-4QGEN5SJ.cjs.map +1 -0
- package/dist/{chunk-V7BC64W2.cjs → chunk-C5IE4WUG.cjs} +8 -8
- package/dist/{chunk-V7BC64W2.cjs.map → chunk-C5IE4WUG.cjs.map} +1 -1
- package/dist/{chunk-F4RVNXOL.js → chunk-DIK33H5U.js} +8 -2
- package/dist/chunk-DIK33H5U.js.map +1 -0
- package/dist/{chunk-2JRPPCG7.js → chunk-FESAXMHT.js} +7 -6
- package/dist/{chunk-2JRPPCG7.js.map → chunk-FESAXMHT.js.map} +1 -1
- package/dist/chunk-FHQZCAAK.cjs +112 -0
- package/dist/chunk-FHQZCAAK.cjs.map +1 -0
- package/dist/{chunk-EQ5E4WOV.cjs → chunk-QNMYVXRL.cjs} +44 -38
- package/dist/chunk-QNMYVXRL.cjs.map +1 -0
- package/dist/{chunk-P4TZLFV6.js → chunk-S63VBIWN.js} +27 -16
- package/dist/chunk-S63VBIWN.js.map +1 -0
- package/dist/{chunk-R6FINS25.js → chunk-WIHNVN6L.js} +106 -73
- package/dist/chunk-WIHNVN6L.js.map +1 -0
- package/dist/{devtools-CMxlJUTx.d.cts → devtools-BtIkN77t.d.cts} +1 -1
- package/dist/{devtools-C4Hgfa-S.d.ts → devtools-D2z4llpA.d.ts} +1 -1
- package/dist/index.cjs +60 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.dev.js +72 -51
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/internal-list.cjs +4 -4
- package/dist/internal-list.d.cts +1 -1
- package/dist/internal-list.d.ts +1 -1
- package/dist/internal-list.js +3 -3
- package/dist/internal.cjs +5 -5
- package/dist/internal.d.cts +4 -4
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +4 -4
- package/dist/{list-BBzsJhrm.d.ts → list-BKM6YOPq.d.ts} +1 -1
- package/dist/{list-_NJCcjl1.d.cts → list-Bi8dDF8Q.d.cts} +1 -1
- package/dist/loader.cjs +28 -26
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.js +11 -9
- package/dist/loader.js.map +1 -1
- package/dist/{props--zJ4ebbT.d.cts → props-9chMyBGb.d.cts} +1 -1
- package/dist/{props-BAGR7j-j.d.ts → props-D1nj2p_3.d.ts} +1 -1
- package/dist/{scope-CuImnvh1.d.ts → scope-BSkhJr0a.d.ts} +1 -1
- package/dist/{scope-Dq5hOu7c.d.cts → scope-Bn3sxem5.d.cts} +1 -1
- package/package.json +1 -1
- package/src/binding.ts +59 -29
- package/src/context.ts +4 -3
- package/src/dom.ts +65 -39
- package/src/error-boundary.ts +5 -5
- package/src/lifecycle.ts +8 -1
- package/src/list-helpers.ts +30 -13
- package/src/loader.ts +10 -8
- package/src/node-ops.ts +8 -5
- package/src/suspense.ts +5 -4
- package/dist/chunk-EQ5E4WOV.cjs.map +0 -1
- package/dist/chunk-F4RVNXOL.js.map +0 -1
- package/dist/chunk-I4GKKAAY.cjs.map +0 -1
- package/dist/chunk-K3DH5SD5.cjs +0 -111
- package/dist/chunk-K3DH5SD5.cjs.map +0 -1
- package/dist/chunk-P4TZLFV6.js.map +0 -1
- package/dist/chunk-R6FINS25.js.map +0 -1
- package/dist/chunk-SZLJCQFZ.cjs.map +0 -1
- /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
|
|
5
|
+
var _chunkFHQZCAAKcjs = require('./chunk-FHQZCAAK.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
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
|
|
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
|
|
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 =
|
|
37
|
-
const version =
|
|
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: () =>
|
|
59
|
-
peekValue: () =>
|
|
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 =
|
|
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
|
package/dist/advanced.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-
|
|
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-
|
|
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-
|
|
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;
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-
|
|
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-
|
|
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-
|
|
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-
|
|
5
|
+
} from "./chunk-FESAXMHT.js";
|
|
6
6
|
import {
|
|
7
7
|
createScope,
|
|
8
8
|
runInScope
|
|
9
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
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-
|
|
3
|
+
} from "./chunk-WIHNVN6L.js";
|
|
4
4
|
import {
|
|
5
5
|
createEffect,
|
|
6
6
|
createRoot,
|
|
7
7
|
onCleanup,
|
|
8
8
|
registerRootCleanup
|
|
9
|
-
} from "./chunk-
|
|
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-
|
|
47
|
+
//# sourceMappingURL=chunk-2UR2UWE2.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
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
|
|
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 =
|
|
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
|
|
168
|
-
const
|
|
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
|
-
|
|
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
|
|
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 ?
|
|
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 =
|
|
216
|
-
const
|
|
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 =
|
|
222
|
+
const prevSub = _chunkQNMYVXRLcjs.setActiveSub.call(void 0, void 0);
|
|
220
223
|
try {
|
|
221
|
-
scopeDispose =
|
|
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 =
|
|
227
|
+
nodes = _chunk4QGEN5SJcjs.toNodeArray.call(void 0, rendered, nodeOwnerDocument);
|
|
225
228
|
} else {
|
|
226
|
-
const element =
|
|
227
|
-
nodes =
|
|
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
|
-
|
|
235
|
-
|
|
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
|
|
348
|
-
const
|
|
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 :
|
|
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 =
|
|
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 =
|
|
396
|
+
const isSSR = _chunkQNMYVXRLcjs.__fictIsSSR.call(void 0, );
|
|
389
397
|
const parent = isSSR ? container.startMarker.parentNode : getConnectedParent();
|
|
390
398
|
if (!parent) return;
|
|
391
|
-
|
|
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 &&
|
|
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
|
-
|
|
419
|
+
_chunk4QGEN5SJcjs.withHydrationRange.call(void 0,
|
|
412
420
|
container.startMarker.nextSibling,
|
|
413
421
|
container.endMarker,
|
|
414
|
-
_nullishCoalesce(parent.ownerDocument, () => (
|
|
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
|
-
|
|
428
|
-
|
|
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
|
-
|
|
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
|
-
|
|
465
|
+
_chunkQNMYVXRLcjs.destroyRoot.call(void 0, block.root);
|
|
458
466
|
}
|
|
459
|
-
const range =
|
|
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
|
-
|
|
539
|
-
|
|
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
|
-
|
|
553
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
613
|
-
|
|
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
|
-
|
|
680
|
+
_chunkQNMYVXRLcjs.flushOnMount.call(void 0, block.root);
|
|
673
681
|
}
|
|
674
682
|
}
|
|
675
683
|
});
|
|
676
684
|
};
|
|
677
685
|
const disconnectObserver = () => {
|
|
678
|
-
_optionalChain([connectObserver, 'optionalAccess',
|
|
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 =
|
|
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 =
|
|
695
|
+
effectDispose = _chunkQNMYVXRLcjs.createRenderEffect.call(void 0, performDiff);
|
|
688
696
|
effectStarted = true;
|
|
689
697
|
};
|
|
690
698
|
if (hostRoot) {
|
|
691
|
-
const prev =
|
|
699
|
+
const prev = _chunkQNMYVXRLcjs.pushRoot.call(void 0, hostRoot);
|
|
692
700
|
try {
|
|
693
701
|
start();
|
|
694
702
|
} finally {
|
|
695
|
-
|
|
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',
|
|
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
|
-
|
|
719
|
+
_chunkQNMYVXRLcjs.flush.call(void 0, );
|
|
712
720
|
}
|
|
713
721
|
}
|
|
714
722
|
});
|
|
715
|
-
connectObserver.observe(
|
|
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
|
-
|
|
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',
|
|
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-
|
|
779
|
+
//# sourceMappingURL=chunk-44EQF3AR.cjs.map
|