@fictjs/runtime 0.3.0 → 0.5.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 +10 -8
- package/dist/advanced.cjs.map +1 -1
- package/dist/advanced.d.cts +4 -3
- package/dist/advanced.d.ts +4 -3
- package/dist/advanced.js +10 -8
- package/dist/advanced.js.map +1 -1
- package/dist/{chunk-TWELIZRY.js → chunk-5AA7HP4S.js} +5 -3
- package/dist/{chunk-TWELIZRY.js.map → chunk-5AA7HP4S.js.map} +1 -1
- package/dist/chunk-6SOPF5LZ.cjs +2363 -0
- package/dist/chunk-6SOPF5LZ.cjs.map +1 -0
- package/dist/{chunk-SO6X7G5S.js → chunk-BQG7VEBY.js} +501 -1880
- package/dist/chunk-BQG7VEBY.js.map +1 -0
- package/dist/chunk-FKDMDAUR.js +2363 -0
- package/dist/chunk-FKDMDAUR.js.map +1 -0
- package/dist/{chunk-L4DIV3RC.cjs → chunk-GHUV2FLD.cjs} +9 -7
- package/dist/chunk-GHUV2FLD.cjs.map +1 -0
- package/dist/{chunk-XLIZJMMJ.js → chunk-KKKYW54Z.js} +8 -6
- package/dist/{chunk-XLIZJMMJ.js.map → chunk-KKKYW54Z.js.map} +1 -1
- package/dist/{chunk-M2TSXZ4C.cjs → chunk-KYLNC4CD.cjs} +18 -16
- package/dist/chunk-KYLNC4CD.cjs.map +1 -0
- package/dist/chunk-TKWN42TA.cjs +2259 -0
- package/dist/chunk-TKWN42TA.cjs.map +1 -0
- package/dist/{context-B25xyQrJ.d.cts → context-CTBE00S_.d.cts} +1 -1
- package/dist/{context-CGdP7_Jb.d.ts → context-lkLhbkFJ.d.ts} +1 -1
- package/dist/{effect-D6kaLM2-.d.cts → effect-BpSNEJJz.d.cts} +7 -67
- package/dist/{effect-D6kaLM2-.d.ts → effect-BpSNEJJz.d.ts} +7 -67
- package/dist/index.cjs +40 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.dev.js +92 -4
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +19 -17
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +189 -202
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +13 -23
- package/dist/internal.d.ts +13 -23
- package/dist/internal.js +195 -208
- package/dist/internal.js.map +1 -1
- package/dist/loader.cjs +280 -0
- package/dist/loader.cjs.map +1 -0
- package/dist/loader.d.cts +57 -0
- package/dist/loader.d.ts +57 -0
- package/dist/loader.js +280 -0
- package/dist/loader.js.map +1 -0
- package/dist/{props-BIfromL0.d.cts → props-XTHYD19o.d.cts} +13 -2
- package/dist/{props-BEgIVMRx.d.ts → props-x-HbI-jX.d.ts} +13 -2
- package/dist/resume-BrAkmSTY.d.cts +79 -0
- package/dist/resume-Dx8_l72o.d.ts +79 -0
- package/dist/{scope-CzNkn587.d.ts → scope-CdbGmsFf.d.ts} +1 -1
- package/dist/{scope-Cx_3CjIZ.d.cts → scope-DfcP9I-A.d.cts} +1 -1
- package/dist/signal-C4ISF17w.d.cts +66 -0
- package/dist/signal-C4ISF17w.d.ts +66 -0
- package/package.json +8 -3
- package/src/binding.ts +254 -5
- package/src/dom.ts +103 -5
- package/src/hooks.ts +15 -2
- package/src/hydration.ts +75 -0
- package/src/internal.ts +34 -2
- package/src/list-helpers.ts +113 -12
- package/src/loader.ts +437 -0
- package/src/node-ops.ts +65 -0
- package/src/resume.ts +517 -0
- package/src/store.ts +8 -0
- package/dist/chunk-ID3WBWNO.cjs +0 -3638
- package/dist/chunk-ID3WBWNO.cjs.map +0 -1
- package/dist/chunk-L4DIV3RC.cjs.map +0 -1
- package/dist/chunk-M2TSXZ4C.cjs.map +0 -1
- package/dist/chunk-SO6X7G5S.js.map +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkGHUV2FLDcjs = require('./chunk-GHUV2FLD.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -35,6 +35,33 @@ var _chunkL4DIV3RCcjs = require('./chunk-L4DIV3RC.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
var _chunkTKWN42TAcjs = require('./chunk-TKWN42TA.cjs');
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
38
65
|
|
|
39
66
|
|
|
40
67
|
|
|
@@ -68,163 +95,14 @@ var _chunkL4DIV3RCcjs = require('./chunk-L4DIV3RC.cjs');
|
|
|
68
95
|
|
|
69
96
|
|
|
70
97
|
|
|
71
|
-
var _chunkID3WBWNOcjs = require('./chunk-ID3WBWNO.cjs');
|
|
72
98
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
function setStore(fn) {
|
|
81
|
-
_chunkID3WBWNOcjs.batch.call(void 0, () => {
|
|
82
|
-
const result = fn(wrapped);
|
|
83
|
-
if (result !== void 0) {
|
|
84
|
-
reconcile(wrapped, result);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return [wrapped, setStore];
|
|
89
|
-
}
|
|
90
|
-
var proxyCache = /* @__PURE__ */ new WeakMap();
|
|
91
|
-
var signalCache = /* @__PURE__ */ new WeakMap();
|
|
92
|
-
function wrap(value) {
|
|
93
|
-
if (value === null || typeof value !== "object") return value;
|
|
94
|
-
if (Reflect.get(value, PROXY)) return value;
|
|
95
|
-
if (proxyCache.has(value)) return proxyCache.get(value);
|
|
96
|
-
const handler = {
|
|
97
|
-
get(target, prop2, receiver) {
|
|
98
|
-
if (prop2 === PROXY) return true;
|
|
99
|
-
if (prop2 === TARGET) return target;
|
|
100
|
-
const value2 = Reflect.get(target, prop2, receiver);
|
|
101
|
-
track(target, prop2);
|
|
102
|
-
return wrap(value2);
|
|
103
|
-
},
|
|
104
|
-
has(target, prop2) {
|
|
105
|
-
const result = Reflect.has(target, prop2);
|
|
106
|
-
track(target, prop2);
|
|
107
|
-
return result;
|
|
108
|
-
},
|
|
109
|
-
ownKeys(target) {
|
|
110
|
-
track(target, ITERATE_KEY);
|
|
111
|
-
return Reflect.ownKeys(target);
|
|
112
|
-
},
|
|
113
|
-
getOwnPropertyDescriptor(target, prop2) {
|
|
114
|
-
track(target, prop2);
|
|
115
|
-
return Reflect.getOwnPropertyDescriptor(target, prop2);
|
|
116
|
-
},
|
|
117
|
-
set(target, prop2, value2, receiver) {
|
|
118
|
-
if (prop2 === PROXY || prop2 === TARGET) return false;
|
|
119
|
-
const isArrayLength = Array.isArray(target) && prop2 === "length";
|
|
120
|
-
const oldLength = isArrayLength ? target.length : void 0;
|
|
121
|
-
const hadKey = Object.prototype.hasOwnProperty.call(target, prop2);
|
|
122
|
-
const oldValue = Reflect.get(target, prop2, receiver);
|
|
123
|
-
if (oldValue === value2) return true;
|
|
124
|
-
const result = Reflect.set(target, prop2, value2, receiver);
|
|
125
|
-
if (result) {
|
|
126
|
-
trigger(target, prop2);
|
|
127
|
-
if (!hadKey) {
|
|
128
|
-
trigger(target, ITERATE_KEY);
|
|
129
|
-
}
|
|
130
|
-
if (isArrayLength) {
|
|
131
|
-
const nextLength = target.length;
|
|
132
|
-
if (typeof oldLength === "number" && nextLength < oldLength) {
|
|
133
|
-
const signals = signalCache.get(target);
|
|
134
|
-
if (signals) {
|
|
135
|
-
for (const key of signals.keys()) {
|
|
136
|
-
if (typeof key !== "string") continue;
|
|
137
|
-
const index = Number(key);
|
|
138
|
-
if (!Number.isInteger(index) || String(index) !== key) continue;
|
|
139
|
-
if (index >= nextLength && index < oldLength) {
|
|
140
|
-
trigger(target, key);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
trigger(target, ITERATE_KEY);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return result;
|
|
149
|
-
},
|
|
150
|
-
deleteProperty(target, prop2) {
|
|
151
|
-
const hadKey = Object.prototype.hasOwnProperty.call(target, prop2);
|
|
152
|
-
const result = Reflect.deleteProperty(target, prop2);
|
|
153
|
-
if (result) {
|
|
154
|
-
trigger(target, prop2);
|
|
155
|
-
if (hadKey) {
|
|
156
|
-
trigger(target, ITERATE_KEY);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return result;
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
const proxy = new Proxy(value, handler);
|
|
163
|
-
proxyCache.set(value, proxy);
|
|
164
|
-
return proxy;
|
|
165
|
-
}
|
|
166
|
-
function unwrap2(value) {
|
|
167
|
-
if (value && typeof value === "object" && Reflect.get(value, PROXY)) {
|
|
168
|
-
return Reflect.get(value, TARGET);
|
|
169
|
-
}
|
|
170
|
-
return value;
|
|
171
|
-
}
|
|
172
|
-
function track(target, prop2) {
|
|
173
|
-
let signals = signalCache.get(target);
|
|
174
|
-
if (!signals) {
|
|
175
|
-
signals = /* @__PURE__ */ new Map();
|
|
176
|
-
signalCache.set(target, signals);
|
|
177
|
-
}
|
|
178
|
-
let s = signals.get(prop2);
|
|
179
|
-
if (!s) {
|
|
180
|
-
const initial = prop2 === ITERATE_KEY ? Reflect.ownKeys(target).length : getLastValue(target, prop2);
|
|
181
|
-
s = _chunkID3WBWNOcjs.signal.call(void 0, initial);
|
|
182
|
-
signals.set(prop2, s);
|
|
183
|
-
}
|
|
184
|
-
s();
|
|
185
|
-
}
|
|
186
|
-
function trigger(target, prop2) {
|
|
187
|
-
const signals = signalCache.get(target);
|
|
188
|
-
if (signals) {
|
|
189
|
-
const s = signals.get(prop2);
|
|
190
|
-
if (s) {
|
|
191
|
-
if (prop2 === ITERATE_KEY) {
|
|
192
|
-
s(Reflect.ownKeys(target).length);
|
|
193
|
-
} else {
|
|
194
|
-
s(getLastValue(target, prop2));
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
function getLastValue(target, prop2) {
|
|
200
|
-
return Reflect.get(target, prop2);
|
|
201
|
-
}
|
|
202
|
-
function reconcile(target, value) {
|
|
203
|
-
if (target === value) return;
|
|
204
|
-
if (value === null || typeof value !== "object") {
|
|
205
|
-
throw new Error(
|
|
206
|
-
`[Fict] Cannot replace store with primitive value: ${String(
|
|
207
|
-
value
|
|
208
|
-
)}. setStore should return an object/array to merge.`
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
const realTarget = unwrap2(target);
|
|
212
|
-
const realValue = unwrap2(value);
|
|
213
|
-
const keys = /* @__PURE__ */ new Set([...Object.keys(realTarget), ...Object.keys(realValue)]);
|
|
214
|
-
for (const key of keys) {
|
|
215
|
-
const rTarget = realTarget;
|
|
216
|
-
const rValue = realValue;
|
|
217
|
-
if (rValue[key] === void 0 && rTarget[key] !== void 0) {
|
|
218
|
-
delete target[key];
|
|
219
|
-
} else if (rTarget[key] !== rValue[key]) {
|
|
220
|
-
;
|
|
221
|
-
target[key] = rValue[key];
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
if (Array.isArray(target) && Array.isArray(realValue) && target.length !== realValue.length) {
|
|
225
|
-
target.length = realValue.length;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
var _chunk6SOPF5LZcjs = require('./chunk-6SOPF5LZ.cjs');
|
|
228
106
|
|
|
229
107
|
// src/reconcile.ts
|
|
230
108
|
function reconcileArrays(parentNode, a, b) {
|
|
@@ -353,24 +231,24 @@ var MAX_SAFE_VERSION = 9007199254740991;
|
|
|
353
231
|
function createVersionedSignalAccessor(initialValue) {
|
|
354
232
|
let current = initialValue;
|
|
355
233
|
let version = 0;
|
|
356
|
-
const
|
|
234
|
+
const track = _chunk6SOPF5LZcjs.signal.call(void 0, version);
|
|
357
235
|
function accessor(value) {
|
|
358
236
|
if (arguments.length === 0) {
|
|
359
|
-
|
|
237
|
+
track();
|
|
360
238
|
return current;
|
|
361
239
|
}
|
|
362
240
|
current = value;
|
|
363
241
|
version = version >= MAX_SAFE_VERSION ? 1 : version + 1;
|
|
364
|
-
|
|
242
|
+
track(version);
|
|
365
243
|
}
|
|
366
244
|
return accessor;
|
|
367
245
|
}
|
|
368
|
-
function createKeyedListContainer() {
|
|
369
|
-
const startMarker = document.createComment("fict:list:start");
|
|
370
|
-
const endMarker = document.createComment("fict:list:end");
|
|
246
|
+
function createKeyedListContainer(startOverride, endOverride) {
|
|
247
|
+
const startMarker = _nullishCoalesce(startOverride, () => ( document.createComment("fict:list:start")));
|
|
248
|
+
const endMarker = _nullishCoalesce(endOverride, () => ( document.createComment("fict:list:end")));
|
|
371
249
|
const dispose = () => {
|
|
372
250
|
for (const block of container.blocks.values()) {
|
|
373
|
-
|
|
251
|
+
_chunk6SOPF5LZcjs.destroyRoot.call(void 0, block.root);
|
|
374
252
|
}
|
|
375
253
|
container.blocks.clear();
|
|
376
254
|
container.nextBlocks.clear();
|
|
@@ -407,34 +285,34 @@ function createKeyedListContainer() {
|
|
|
407
285
|
};
|
|
408
286
|
return container;
|
|
409
287
|
}
|
|
410
|
-
function createKeyedBlock(key, item, index,
|
|
288
|
+
function createKeyedBlock(key, item, index, render2, needsIndex = true, hostRoot) {
|
|
411
289
|
const itemSig = createVersionedSignalAccessor(item);
|
|
412
|
-
const indexSig = needsIndex ?
|
|
290
|
+
const indexSig = needsIndex ? _chunk6SOPF5LZcjs.signal.call(void 0, index) : ((next) => {
|
|
413
291
|
if (arguments.length === 0) return index;
|
|
414
292
|
index = next;
|
|
415
293
|
return index;
|
|
416
294
|
});
|
|
417
|
-
const root =
|
|
418
|
-
const prevRoot =
|
|
295
|
+
const root = _chunk6SOPF5LZcjs.createRootContext.call(void 0, hostRoot);
|
|
296
|
+
const prevRoot = _chunk6SOPF5LZcjs.pushRoot.call(void 0, root);
|
|
419
297
|
let nodes = [];
|
|
420
298
|
let scopeDispose;
|
|
421
|
-
const prevSub =
|
|
299
|
+
const prevSub = _chunk6SOPF5LZcjs.setActiveSub.call(void 0, void 0);
|
|
422
300
|
try {
|
|
423
|
-
scopeDispose =
|
|
424
|
-
const rendered =
|
|
301
|
+
scopeDispose = _chunk6SOPF5LZcjs.effectScope.call(void 0, () => {
|
|
302
|
+
const rendered = render2(itemSig, indexSig, key);
|
|
425
303
|
if (rendered instanceof Node || Array.isArray(rendered) && rendered.every((n) => n instanceof Node)) {
|
|
426
|
-
nodes =
|
|
304
|
+
nodes = _chunkTKWN42TAcjs.toNodeArray.call(void 0, rendered);
|
|
427
305
|
} else {
|
|
428
|
-
const element =
|
|
429
|
-
nodes =
|
|
306
|
+
const element = _chunkTKWN42TAcjs.createElement.call(void 0, rendered);
|
|
307
|
+
nodes = _chunkTKWN42TAcjs.toNodeArray.call(void 0, element);
|
|
430
308
|
}
|
|
431
309
|
});
|
|
432
310
|
if (scopeDispose) {
|
|
433
311
|
root.cleanups.push(scopeDispose);
|
|
434
312
|
}
|
|
435
313
|
} finally {
|
|
436
|
-
|
|
437
|
-
|
|
314
|
+
_chunk6SOPF5LZcjs.setActiveSub.call(void 0, prevSub);
|
|
315
|
+
_chunk6SOPF5LZcjs.popRoot.call(void 0, prevRoot);
|
|
438
316
|
}
|
|
439
317
|
return {
|
|
440
318
|
key,
|
|
@@ -534,20 +412,41 @@ function reorderByLIS(parent, endMarker, prev, next) {
|
|
|
534
412
|
}
|
|
535
413
|
return moved;
|
|
536
414
|
}
|
|
537
|
-
function createKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
415
|
+
function createKeyedList(getItems, keyFn, renderItem, needsIndex, startMarker, endMarker) {
|
|
538
416
|
const resolvedNeedsIndex = arguments.length >= 4 ? !!needsIndex : renderItem.length > 1;
|
|
539
|
-
return createFineGrainedKeyedList(
|
|
417
|
+
return createFineGrainedKeyedList(
|
|
418
|
+
getItems,
|
|
419
|
+
keyFn,
|
|
420
|
+
renderItem,
|
|
421
|
+
resolvedNeedsIndex,
|
|
422
|
+
startMarker,
|
|
423
|
+
endMarker
|
|
424
|
+
);
|
|
540
425
|
}
|
|
541
|
-
function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
542
|
-
const container = createKeyedListContainer();
|
|
543
|
-
const hostRoot =
|
|
544
|
-
const
|
|
545
|
-
fragment
|
|
426
|
+
function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex, startOverride, endOverride) {
|
|
427
|
+
const container = createKeyedListContainer(startOverride, endOverride);
|
|
428
|
+
const hostRoot = _chunk6SOPF5LZcjs.getCurrentRoot.call(void 0, );
|
|
429
|
+
const useProvided = !!(startOverride && endOverride);
|
|
430
|
+
const fragment = useProvided ? container.startMarker : document.createDocumentFragment();
|
|
431
|
+
if (!useProvided) {
|
|
432
|
+
;
|
|
433
|
+
fragment.append(container.startMarker, container.endMarker);
|
|
434
|
+
}
|
|
546
435
|
let disposed = false;
|
|
547
436
|
let effectDispose;
|
|
548
437
|
let connectObserver = null;
|
|
549
438
|
let effectStarted = false;
|
|
550
439
|
let startScheduled = false;
|
|
440
|
+
let initialHydrating = _chunk6SOPF5LZcjs.__fictIsHydrating.call(void 0, );
|
|
441
|
+
const collectBetween = () => {
|
|
442
|
+
const nodes = [];
|
|
443
|
+
let cursor = container.startMarker.nextSibling;
|
|
444
|
+
while (cursor && cursor !== container.endMarker) {
|
|
445
|
+
nodes.push(cursor);
|
|
446
|
+
cursor = cursor.nextSibling;
|
|
447
|
+
}
|
|
448
|
+
return nodes;
|
|
449
|
+
};
|
|
551
450
|
const getConnectedParent = () => {
|
|
552
451
|
const endParent = container.endMarker.parentNode;
|
|
553
452
|
const startParent = container.startMarker.parentNode;
|
|
@@ -560,19 +459,76 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
560
459
|
};
|
|
561
460
|
const performDiff = () => {
|
|
562
461
|
if (disposed) return;
|
|
563
|
-
const
|
|
462
|
+
const isSSR = _chunk6SOPF5LZcjs.__fictIsSSR.call(void 0, );
|
|
463
|
+
const parent = isSSR ? container.startMarker.parentNode : getConnectedParent();
|
|
564
464
|
if (!parent) return;
|
|
565
|
-
|
|
465
|
+
_chunkTKWN42TAcjs.batch.call(void 0, () => {
|
|
566
466
|
const oldBlocks = container.blocks;
|
|
567
467
|
const newBlocks = container.nextBlocks;
|
|
568
468
|
const prevOrderedBlocks = container.orderedBlocks;
|
|
569
469
|
const nextOrderedBlocks = container.nextOrderedBlocks;
|
|
570
470
|
const orderedIndexByKey = container.orderedIndexByKey;
|
|
571
471
|
const newItems = getItems();
|
|
472
|
+
if (initialHydrating && _chunkTKWN42TAcjs.isHydratingActive.call(void 0, )) {
|
|
473
|
+
initialHydrating = false;
|
|
474
|
+
newBlocks.clear();
|
|
475
|
+
nextOrderedBlocks.length = 0;
|
|
476
|
+
orderedIndexByKey.clear();
|
|
477
|
+
if (newItems.length === 0) {
|
|
478
|
+
oldBlocks.clear();
|
|
479
|
+
prevOrderedBlocks.length = 0;
|
|
480
|
+
container.currentNodes = [container.startMarker, container.endMarker];
|
|
481
|
+
container.nextNodes.length = 0;
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const createdBlocks2 = [];
|
|
485
|
+
_chunkTKWN42TAcjs.withHydrationRange.call(void 0,
|
|
486
|
+
container.startMarker.nextSibling,
|
|
487
|
+
container.endMarker,
|
|
488
|
+
_nullishCoalesce(parent.ownerDocument, () => ( document)),
|
|
489
|
+
() => {
|
|
490
|
+
for (let index = 0; index < newItems.length; index++) {
|
|
491
|
+
const item = newItems[index];
|
|
492
|
+
const key = keyFn(item, index);
|
|
493
|
+
if (newBlocks.has(key)) {
|
|
494
|
+
if (isDev) {
|
|
495
|
+
console.warn(
|
|
496
|
+
`[fict] Duplicate key "${String(key)}" detected in list hydration. Each item should have a unique key.`
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
const existing = newBlocks.get(key);
|
|
500
|
+
if (existing) {
|
|
501
|
+
_chunk6SOPF5LZcjs.destroyRoot.call(void 0, existing.root);
|
|
502
|
+
_chunkTKWN42TAcjs.removeNodes.call(void 0, existing.nodes);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
const block = createKeyedBlock(key, item, index, renderItem, needsIndex, hostRoot);
|
|
506
|
+
createdBlocks2.push(block);
|
|
507
|
+
newBlocks.set(key, block);
|
|
508
|
+
orderedIndexByKey.set(key, nextOrderedBlocks.length);
|
|
509
|
+
nextOrderedBlocks.push(block);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
);
|
|
513
|
+
container.blocks = newBlocks;
|
|
514
|
+
container.nextBlocks = oldBlocks;
|
|
515
|
+
container.orderedBlocks = nextOrderedBlocks;
|
|
516
|
+
container.nextOrderedBlocks = prevOrderedBlocks;
|
|
517
|
+
oldBlocks.clear();
|
|
518
|
+
prevOrderedBlocks.length = 0;
|
|
519
|
+
container.currentNodes = [container.startMarker, ...collectBetween(), container.endMarker];
|
|
520
|
+
container.nextNodes.length = 0;
|
|
521
|
+
for (const block of createdBlocks2) {
|
|
522
|
+
if (newBlocks.get(block.key) === block) {
|
|
523
|
+
_chunk6SOPF5LZcjs.flushOnMount.call(void 0, block.root);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
572
528
|
if (newItems.length === 0) {
|
|
573
529
|
if (oldBlocks.size > 0) {
|
|
574
530
|
for (const block of oldBlocks.values()) {
|
|
575
|
-
|
|
531
|
+
_chunk6SOPF5LZcjs.destroyRoot.call(void 0, block.root);
|
|
576
532
|
}
|
|
577
533
|
const range = document.createRange();
|
|
578
534
|
range.setStartAfter(container.startMarker);
|
|
@@ -653,8 +609,8 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
653
609
|
`[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.`
|
|
654
610
|
);
|
|
655
611
|
}
|
|
656
|
-
|
|
657
|
-
|
|
612
|
+
_chunk6SOPF5LZcjs.destroyRoot.call(void 0, existingBlock.root);
|
|
613
|
+
_chunkTKWN42TAcjs.removeNodes.call(void 0, existingBlock.nodes);
|
|
658
614
|
}
|
|
659
615
|
block = createKeyedBlock(key, item, index, renderItem, needsIndex, hostRoot);
|
|
660
616
|
createdBlocks.push(block);
|
|
@@ -667,8 +623,8 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
667
623
|
hasDuplicateKey = true;
|
|
668
624
|
const prior = nextOrderedBlocks[position];
|
|
669
625
|
if (prior && prior !== resolvedBlock) {
|
|
670
|
-
|
|
671
|
-
|
|
626
|
+
_chunk6SOPF5LZcjs.destroyRoot.call(void 0, prior.root);
|
|
627
|
+
_chunkTKWN42TAcjs.removeNodes.call(void 0, prior.nodes);
|
|
672
628
|
}
|
|
673
629
|
nextOrderedBlocks[position] = resolvedBlock;
|
|
674
630
|
} else {
|
|
@@ -706,7 +662,7 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
706
662
|
}
|
|
707
663
|
}
|
|
708
664
|
if (appendedNodes.length > 0) {
|
|
709
|
-
|
|
665
|
+
_chunkTKWN42TAcjs.insertNodesBefore.call(void 0, parent, appendedNodes, container.endMarker);
|
|
710
666
|
const currentNodes = container.currentNodes;
|
|
711
667
|
currentNodes.pop();
|
|
712
668
|
for (let i = 0; i < appendedNodes.length; i++) {
|
|
@@ -720,15 +676,15 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
720
676
|
container.nextOrderedBlocks = prevOrderedBlocks;
|
|
721
677
|
for (const block of createdBlocks) {
|
|
722
678
|
if (newBlocks.get(block.key) === block) {
|
|
723
|
-
|
|
679
|
+
_chunk6SOPF5LZcjs.flushOnMount.call(void 0, block.root);
|
|
724
680
|
}
|
|
725
681
|
}
|
|
726
682
|
return;
|
|
727
683
|
}
|
|
728
684
|
if (oldBlocks.size > 0) {
|
|
729
685
|
for (const block of oldBlocks.values()) {
|
|
730
|
-
|
|
731
|
-
|
|
686
|
+
_chunk6SOPF5LZcjs.destroyRoot.call(void 0, block.root);
|
|
687
|
+
_chunkTKWN42TAcjs.removeNodes.call(void 0, block.nodes);
|
|
732
688
|
}
|
|
733
689
|
oldBlocks.clear();
|
|
734
690
|
}
|
|
@@ -787,7 +743,7 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
787
743
|
container.nextOrderedBlocks = prevOrderedBlocks;
|
|
788
744
|
for (const block of createdBlocks) {
|
|
789
745
|
if (newBlocks.get(block.key) === block) {
|
|
790
|
-
|
|
746
|
+
_chunk6SOPF5LZcjs.flushOnMount.call(void 0, block.root);
|
|
791
747
|
}
|
|
792
748
|
}
|
|
793
749
|
});
|
|
@@ -798,18 +754,19 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
798
754
|
};
|
|
799
755
|
const ensureEffectStarted = () => {
|
|
800
756
|
if (disposed || effectStarted) return effectStarted;
|
|
801
|
-
const
|
|
757
|
+
const isSSR = _chunk6SOPF5LZcjs.__fictIsSSR.call(void 0, );
|
|
758
|
+
const parent = isSSR ? container.startMarker.parentNode : getConnectedParent();
|
|
802
759
|
if (!parent) return false;
|
|
803
760
|
const start = () => {
|
|
804
|
-
effectDispose =
|
|
761
|
+
effectDispose = _chunk6SOPF5LZcjs.createRenderEffect.call(void 0, performDiff);
|
|
805
762
|
effectStarted = true;
|
|
806
763
|
};
|
|
807
764
|
if (hostRoot) {
|
|
808
|
-
const prev =
|
|
765
|
+
const prev = _chunk6SOPF5LZcjs.pushRoot.call(void 0, hostRoot);
|
|
809
766
|
try {
|
|
810
767
|
start();
|
|
811
768
|
} finally {
|
|
812
|
-
|
|
769
|
+
_chunk6SOPF5LZcjs.popRoot.call(void 0, prev);
|
|
813
770
|
}
|
|
814
771
|
} else {
|
|
815
772
|
start();
|
|
@@ -823,7 +780,7 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
823
780
|
if (getConnectedParent()) {
|
|
824
781
|
disconnectObserver();
|
|
825
782
|
if (ensureEffectStarted()) {
|
|
826
|
-
|
|
783
|
+
_chunk6SOPF5LZcjs.flush.call(void 0, );
|
|
827
784
|
}
|
|
828
785
|
}
|
|
829
786
|
});
|
|
@@ -857,7 +814,7 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
857
814
|
if (disposed) return;
|
|
858
815
|
scheduleStart();
|
|
859
816
|
if (ensureEffectStarted()) {
|
|
860
|
-
|
|
817
|
+
_chunk6SOPF5LZcjs.flush.call(void 0, );
|
|
861
818
|
} else {
|
|
862
819
|
waitForConnection();
|
|
863
820
|
}
|
|
@@ -932,5 +889,35 @@ function createFineGrainedKeyedList(getItems, keyFn, renderItem, needsIndex) {
|
|
|
932
889
|
|
|
933
890
|
|
|
934
891
|
|
|
935
|
-
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
exports.Aliases = _chunk6SOPF5LZcjs.Aliases; exports.BooleanAttributes = _chunk6SOPF5LZcjs.BooleanAttributes; exports.ChildProperties = _chunk6SOPF5LZcjs.ChildProperties; exports.DelegatedEvents = _chunk6SOPF5LZcjs.DelegatedEvents; exports.Fragment = _chunkTKWN42TAcjs.Fragment; exports.Properties = _chunk6SOPF5LZcjs.Properties; exports.SVGElements = _chunk6SOPF5LZcjs.SVGElements; exports.SVGNamespace = _chunk6SOPF5LZcjs.SVGNamespace; exports.UnitlessStyles = _chunk6SOPF5LZcjs.UnitlessStyles; exports.__fictDisableResumable = _chunk6SOPF5LZcjs.__fictDisableResumable; exports.__fictDisableSSR = _chunk6SOPF5LZcjs.__fictDisableSSR; exports.__fictEnableResumable = _chunk6SOPF5LZcjs.__fictEnableResumable; exports.__fictEnableSSR = _chunk6SOPF5LZcjs.__fictEnableSSR; exports.__fictEnsureScope = _chunk6SOPF5LZcjs.__fictEnsureScope; exports.__fictEnterHydration = _chunk6SOPF5LZcjs.__fictEnterHydration; exports.__fictExitHydration = _chunk6SOPF5LZcjs.__fictExitHydration; exports.__fictGetResume = _chunk6SOPF5LZcjs.__fictGetResume; exports.__fictGetSSRScope = _chunk6SOPF5LZcjs.__fictGetSSRScope; exports.__fictGetScopeProps = _chunk6SOPF5LZcjs.__fictGetScopeProps; exports.__fictGetScopeRegistry = _chunk6SOPF5LZcjs.__fictGetScopeRegistry; exports.__fictIsHydrating = _chunk6SOPF5LZcjs.__fictIsHydrating; exports.__fictIsResumable = _chunk6SOPF5LZcjs.__fictIsResumable; exports.__fictIsSSR = _chunk6SOPF5LZcjs.__fictIsSSR; exports.__fictPopContext = _chunk6SOPF5LZcjs.__fictPopContext; exports.__fictPrepareContext = _chunk6SOPF5LZcjs.__fictPrepareContext; exports.__fictProp = _chunkTKWN42TAcjs.__fictProp; exports.__fictPropsRest = _chunkTKWN42TAcjs.__fictPropsRest; exports.__fictPushContext = _chunk6SOPF5LZcjs.__fictPushContext; exports.__fictQrl = _chunk6SOPF5LZcjs.__fictQrl; exports.__fictRegisterResume = _chunk6SOPF5LZcjs.__fictRegisterResume; exports.__fictRegisterScope = _chunk6SOPF5LZcjs.__fictRegisterScope; exports.__fictRender = _chunk6SOPF5LZcjs.__fictRender; exports.__fictResetContext = _chunk6SOPF5LZcjs.__fictResetContext; exports.__fictSerializeSSRState = _chunk6SOPF5LZcjs.__fictSerializeSSRState; exports.__fictSetSSRState = _chunk6SOPF5LZcjs.__fictSetSSRState; exports.__fictUseContext = _chunk6SOPF5LZcjs.__fictUseContext; exports.__fictUseEffect = _chunk6SOPF5LZcjs.__fictUseEffect; exports.__fictUseLexicalScope = _chunk6SOPF5LZcjs.__fictUseLexicalScope; exports.__fictUseMemo = _chunk6SOPF5LZcjs.__fictUseMemo; exports.__fictUseSignal = _chunk6SOPF5LZcjs.__fictUseSignal; exports.__resetReactiveState = _chunk6SOPF5LZcjs.__resetReactiveState; exports.addEventListener = _chunkTKWN42TAcjs.addEventListener; exports.assign = _chunkTKWN42TAcjs.assign; exports.bindAttribute = _chunkTKWN42TAcjs.bindAttribute; exports.bindClass = _chunkTKWN42TAcjs.bindClass; exports.bindEvent = _chunkTKWN42TAcjs.bindEvent; exports.bindProperty = _chunkTKWN42TAcjs.bindProperty; exports.bindRef = _chunkTKWN42TAcjs.bindRef; exports.bindStyle = _chunkTKWN42TAcjs.bindStyle; exports.bindText = _chunkTKWN42TAcjs.bindText; exports.callEventHandler = _chunkTKWN42TAcjs.callEventHandler; exports.classList = _chunkTKWN42TAcjs.classList; exports.clearDelegatedEvents = _chunkTKWN42TAcjs.clearDelegatedEvents; exports.createConditional = _chunkTKWN42TAcjs.createConditional; exports.createEffect = _chunk6SOPF5LZcjs.createEffect; exports.createElement = _chunkTKWN42TAcjs.createElement; exports.createKeyedList = createKeyedList; exports.createMemo = _chunk6SOPF5LZcjs.createMemo; exports.createPortal = _chunkTKWN42TAcjs.createPortal; exports.createPropsProxy = _chunkTKWN42TAcjs.createPropsProxy; exports.createRenderEffect = _chunk6SOPF5LZcjs.createRenderEffect; exports.createSelector = _chunk6SOPF5LZcjs.createSelector; exports.createSignal = _chunk6SOPF5LZcjs.signal; exports.createStore = _chunk6SOPF5LZcjs.createStore; exports.delegateEvents = _chunkTKWN42TAcjs.delegateEvents; exports.deserializeValue = _chunk6SOPF5LZcjs.deserializeValue; exports.getPropAlias = _chunk6SOPF5LZcjs.getPropAlias; exports.getSlotEnd = _chunkTKWN42TAcjs.getSlotEnd; exports.hydrateComponent = _chunkTKWN42TAcjs.hydrateComponent; exports.insert = _chunkTKWN42TAcjs.insert; exports.insertBetween = _chunkTKWN42TAcjs.insertBetween; exports.insertNodesBefore = _chunkTKWN42TAcjs.insertNodesBefore; exports.isNodeBetweenMarkers = isNodeBetweenMarkers; exports.isReactive = _chunkTKWN42TAcjs.isReactive; exports.isStoreProxy = _chunk6SOPF5LZcjs.isStoreProxy; exports.keyed = _chunkTKWN42TAcjs.keyed; exports.mergeProps = _chunkTKWN42TAcjs.mergeProps; exports.moveNodesBefore = moveNodesBefore; exports.onDestroy = _chunk6SOPF5LZcjs.onDestroy; exports.prop = _chunkTKWN42TAcjs.prop; exports.reconcileArrays = reconcileArrays; exports.removeNodes = _chunkTKWN42TAcjs.removeNodes; exports.render = _chunkTKWN42TAcjs.render; exports.resolvePath = _chunkTKWN42TAcjs.resolvePath; exports.runInScope = _chunkGHUV2FLDcjs.runInScope; exports.serializeValue = _chunk6SOPF5LZcjs.serializeValue; exports.spread = _chunkTKWN42TAcjs.spread; exports.template = _chunkTKWN42TAcjs.template; exports.toNodeArray = _chunkTKWN42TAcjs.toNodeArray; exports.unwrap = _chunkTKWN42TAcjs.unwrap; exports.unwrapStore = _chunk6SOPF5LZcjs.unwrapStore;
|
|
936
923
|
//# sourceMappingURL=internal.cjs.map
|