@farm.js/react 0.1.0-beta.5 → 0.1.0-beta.6
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/README.md +200 -1
- package/dist/compiler-runtime.cjs +1751 -19
- package/dist/compiler-runtime.cjs.map +1 -1
- package/dist/compiler-runtime.d.mts +82 -1
- package/dist/compiler-runtime.d.ts +82 -1
- package/dist/compiler-runtime.mjs +1710 -20
- package/dist/compiler-runtime.mjs.map +1 -1
- package/dist/vite.cjs +1908 -47
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +1908 -47
- package/dist/vite.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -25,6 +25,434 @@ function materializeIterable(source) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// src/compiler-runtime.tsx
|
|
28
|
+
var COMPILER_KEYED_COLLECTION_TOKENS = /* @__PURE__ */ new WeakMap();
|
|
29
|
+
var COMPILER_KEYED_MAP_UPDATES = /* @__PURE__ */ new WeakMap();
|
|
30
|
+
var COMPILER_KEYED_ARRAY_APPENDS = /* @__PURE__ */ new WeakMap();
|
|
31
|
+
var COMPILER_KEYED_ARRAY_FILTERS = /* @__PURE__ */ new WeakMap();
|
|
32
|
+
var COMPILER_KEYED_ARRAY_PREPENDS = /* @__PURE__ */ new WeakMap();
|
|
33
|
+
var COMPILER_KEYED_ARRAY_ROLLING_WINDOWS = /* @__PURE__ */ new WeakMap();
|
|
34
|
+
var COMPILER_KEYED_ARRAY_POSITIONS = /* @__PURE__ */ new WeakMap();
|
|
35
|
+
var COMPILER_KEYED_ARRAY_REORDERS = /* @__PURE__ */ new WeakMap();
|
|
36
|
+
var COMPILER_KEYED_COLLECTION_DRAFTS = /* @__PURE__ */ new WeakMap();
|
|
37
|
+
var COMPILER_KEYED_COLLECTION_UPDATES = /* @__PURE__ */ new WeakMap();
|
|
38
|
+
var COMPILER_KEYED_COMMITTED_COLLECTIONS = /* @__PURE__ */ new WeakSet();
|
|
39
|
+
var NATIVE_ARRAY_PROTOTYPE = Array.prototype;
|
|
40
|
+
var NATIVE_ARRAY_ITERATOR = Array.prototype[Symbol.iterator];
|
|
41
|
+
var NATIVE_ARRAY_FILTER = Array.prototype.filter;
|
|
42
|
+
var NATIVE_ARRAY_SLICE = Array.prototype.slice;
|
|
43
|
+
var NATIVE_ARRAY_TO_SPLICED = Array.prototype.toSpliced;
|
|
44
|
+
var NATIVE_ARRAY_WITH = Array.prototype.with;
|
|
45
|
+
var NATIVE_ARRAY_TO_REVERSED = Array.prototype.toReversed;
|
|
46
|
+
var NATIVE_REFLECT_APPLY = Reflect.apply;
|
|
47
|
+
function compilerObject(value) {
|
|
48
|
+
return typeof value === "object" && value !== null || typeof value === "function" ? value : void 0;
|
|
49
|
+
}
|
|
50
|
+
function compilerKeyedCollectionToken(value) {
|
|
51
|
+
const target = compilerObject(value);
|
|
52
|
+
if (!target) return void 0;
|
|
53
|
+
let token = COMPILER_KEYED_COLLECTION_TOKENS.get(target);
|
|
54
|
+
if (!token) {
|
|
55
|
+
token = {};
|
|
56
|
+
COMPILER_KEYED_COLLECTION_TOKENS.set(target, token);
|
|
57
|
+
}
|
|
58
|
+
return token;
|
|
59
|
+
}
|
|
60
|
+
function commitCompilerKeyedCollection(value) {
|
|
61
|
+
const target = compilerObject(value);
|
|
62
|
+
if (!target) return void 0;
|
|
63
|
+
COMPILER_KEYED_COMMITTED_COLLECTIONS.add(target);
|
|
64
|
+
return compilerKeyedCollectionToken(target);
|
|
65
|
+
}
|
|
66
|
+
function compilerKeyedMapChangedIndices(value, sourceToken) {
|
|
67
|
+
const target = compilerObject(value);
|
|
68
|
+
if (!target || !sourceToken) return void 0;
|
|
69
|
+
const update = COMPILER_KEYED_MAP_UPDATES.get(target);
|
|
70
|
+
if (!update || update.sourceToken !== sourceToken) return void 0;
|
|
71
|
+
const changedIndices = [];
|
|
72
|
+
for (let current = update; current; current = current.previous) {
|
|
73
|
+
changedIndices.push(...current.changedIndices);
|
|
74
|
+
}
|
|
75
|
+
return changedIndices;
|
|
76
|
+
}
|
|
77
|
+
function compilerKeyedArrayAppendStart(value, sourceToken, expectedStart) {
|
|
78
|
+
const target = compilerObject(value);
|
|
79
|
+
if (!target || !sourceToken || !Array.isArray(value)) return void 0;
|
|
80
|
+
const update = COMPILER_KEYED_ARRAY_APPENDS.get(target);
|
|
81
|
+
if (!update || update.sourceToken !== sourceToken) return void 0;
|
|
82
|
+
const updates = [];
|
|
83
|
+
for (let current = update; current; current = current.previous) {
|
|
84
|
+
if (current.sourceToken !== sourceToken) return void 0;
|
|
85
|
+
updates.push(current);
|
|
86
|
+
}
|
|
87
|
+
let length = expectedStart;
|
|
88
|
+
for (let index = updates.length - 1; index >= 0; index -= 1) {
|
|
89
|
+
const current = updates[index];
|
|
90
|
+
if (current.startIndex !== length || current.resultLength < length) return void 0;
|
|
91
|
+
length = current.resultLength;
|
|
92
|
+
}
|
|
93
|
+
return length === value.length ? expectedStart : void 0;
|
|
94
|
+
}
|
|
95
|
+
function compilerKeyedArrayFilterSurvivors(value, sourceToken, expectedLength) {
|
|
96
|
+
const target = compilerObject(value);
|
|
97
|
+
if (!target || !sourceToken || !Array.isArray(value)) return void 0;
|
|
98
|
+
const update = COMPILER_KEYED_ARRAY_FILTERS.get(target);
|
|
99
|
+
if (!update || update.sourceToken !== sourceToken) return void 0;
|
|
100
|
+
const updates = [];
|
|
101
|
+
for (let current = update; current; current = current.previous) {
|
|
102
|
+
if (current.sourceToken !== sourceToken) return void 0;
|
|
103
|
+
updates.push(current);
|
|
104
|
+
}
|
|
105
|
+
let survivors = Array.from({ length: expectedLength }, (_, index) => index);
|
|
106
|
+
let keysStable = true;
|
|
107
|
+
for (let updateIndex = updates.length - 1; updateIndex >= 0; updateIndex -= 1) {
|
|
108
|
+
const current = updates[updateIndex];
|
|
109
|
+
if (current.sourceLength !== survivors.length) return void 0;
|
|
110
|
+
if (current.kind === "slice") {
|
|
111
|
+
const start = current.retainedStart;
|
|
112
|
+
const end = current.retainedEnd;
|
|
113
|
+
if (start === void 0 || end === void 0 || !Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start < 0 || end < start || end > current.sourceLength || current.resultLength !== end - start) {
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
survivors = survivors.slice(start, end);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
keysStable = false;
|
|
120
|
+
const removed = /* @__PURE__ */ new Set();
|
|
121
|
+
for (const index of current.removedIndices || []) {
|
|
122
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= current.sourceLength)
|
|
123
|
+
return void 0;
|
|
124
|
+
removed.add(index);
|
|
125
|
+
}
|
|
126
|
+
if (current.resultLength !== current.sourceLength - removed.size) return void 0;
|
|
127
|
+
survivors = survivors.filter((_sourceIndex, index) => !removed.has(index));
|
|
128
|
+
}
|
|
129
|
+
return survivors.length === value.length ? { indices: survivors, keysStable } : void 0;
|
|
130
|
+
}
|
|
131
|
+
function compilerKeyedArrayPrependLength(value, sourceToken, expectedLength) {
|
|
132
|
+
const target = compilerObject(value);
|
|
133
|
+
if (!target || !sourceToken || !Array.isArray(value)) return void 0;
|
|
134
|
+
const update = COMPILER_KEYED_ARRAY_PREPENDS.get(target);
|
|
135
|
+
if (!update || update.sourceToken !== sourceToken) return void 0;
|
|
136
|
+
const updates = [];
|
|
137
|
+
for (let current = update; current; current = current.previous) {
|
|
138
|
+
if (current.sourceToken !== sourceToken) return void 0;
|
|
139
|
+
updates.push(current);
|
|
140
|
+
}
|
|
141
|
+
let length = expectedLength;
|
|
142
|
+
let prefixLength = 0;
|
|
143
|
+
for (let index = updates.length - 1; index >= 0; index -= 1) {
|
|
144
|
+
const current = updates[index];
|
|
145
|
+
if (current.sourceLength !== length || current.prefixLength < 1 || current.resultLength !== current.sourceLength + current.prefixLength) {
|
|
146
|
+
return void 0;
|
|
147
|
+
}
|
|
148
|
+
length = current.resultLength;
|
|
149
|
+
prefixLength += current.prefixLength;
|
|
150
|
+
}
|
|
151
|
+
return length === value.length ? prefixLength : void 0;
|
|
152
|
+
}
|
|
153
|
+
function compilerKeyedArrayRollingWindow(value, sourceToken, expectedLength) {
|
|
154
|
+
const target = compilerObject(value);
|
|
155
|
+
if (!target || !sourceToken || !Array.isArray(value)) return void 0;
|
|
156
|
+
const update = COMPILER_KEYED_ARRAY_ROLLING_WINDOWS.get(target);
|
|
157
|
+
if (!update || update.sourceToken !== sourceToken || update.sourceLength !== expectedLength || update.resultLength !== value.length || update.retainedStart < 1 || update.retainedEnd !== update.sourceLength || update.resultLength <= update.retainedEnd - update.retainedStart) {
|
|
158
|
+
return void 0;
|
|
159
|
+
}
|
|
160
|
+
return update;
|
|
161
|
+
}
|
|
162
|
+
function compilerKeyedArrayPosition(value, sourceToken, expectedLength) {
|
|
163
|
+
const target = compilerObject(value);
|
|
164
|
+
if (!target || !sourceToken || !Array.isArray(value)) return void 0;
|
|
165
|
+
const update = COMPILER_KEYED_ARRAY_POSITIONS.get(target);
|
|
166
|
+
if (!update || update.sourceToken !== sourceToken || update.sourceLength !== expectedLength || update.resultLength !== value.length || update.position < 0 || update.position > expectedLength || update.kind === "insert" && update.resultLength !== expectedLength + 1 || update.kind === "replace" && (update.position >= expectedLength || update.resultLength !== expectedLength)) {
|
|
167
|
+
return void 0;
|
|
168
|
+
}
|
|
169
|
+
return update;
|
|
170
|
+
}
|
|
171
|
+
function compilerKeyedArrayReorder(value, sourceToken, expectedLength) {
|
|
172
|
+
const target = compilerObject(value);
|
|
173
|
+
if (!target || !sourceToken || !Array.isArray(value)) return void 0;
|
|
174
|
+
const update = COMPILER_KEYED_ARRAY_REORDERS.get(target);
|
|
175
|
+
if (!update || update.sourceToken !== sourceToken || update.sourceLength !== expectedLength || update.resultLength !== expectedLength || update.resultLength !== value.length) {
|
|
176
|
+
return void 0;
|
|
177
|
+
}
|
|
178
|
+
return update;
|
|
179
|
+
}
|
|
180
|
+
function compilerKeyedCollectionChangedKeys(value, sourceToken, kind) {
|
|
181
|
+
const target = compilerObject(value);
|
|
182
|
+
if (!target || !sourceToken) return void 0;
|
|
183
|
+
const update = COMPILER_KEYED_COLLECTION_UPDATES.get(target);
|
|
184
|
+
if (!update || update.kind !== kind || update.sourceToken !== sourceToken) return void 0;
|
|
185
|
+
const changedKeys = [];
|
|
186
|
+
for (let current = update; current; current = current.previous) {
|
|
187
|
+
if (current.kind !== kind || current.sourceToken !== sourceToken) return void 0;
|
|
188
|
+
changedKeys.push(...current.changedKeys);
|
|
189
|
+
}
|
|
190
|
+
return changedKeys;
|
|
191
|
+
}
|
|
192
|
+
function createCompilerKeyedMapUpdate(previous, value, changedIndices) {
|
|
193
|
+
const previousTarget = compilerObject(previous);
|
|
194
|
+
const valueTarget = compilerObject(value);
|
|
195
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
196
|
+
if (valueTarget && sourceToken) {
|
|
197
|
+
const previousUpdate = previousTarget && !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) ? COMPILER_KEYED_MAP_UPDATES.get(previousTarget) : void 0;
|
|
198
|
+
COMPILER_KEYED_MAP_UPDATES.set(valueTarget, {
|
|
199
|
+
sourceToken: previousUpdate?.sourceToken || sourceToken,
|
|
200
|
+
changedIndices,
|
|
201
|
+
...previousUpdate ? { previous: previousUpdate } : {}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return value;
|
|
205
|
+
}
|
|
206
|
+
function createCompilerKeyedArrayAppend(previous, value) {
|
|
207
|
+
try {
|
|
208
|
+
const previousTarget = compilerObject(previous);
|
|
209
|
+
const valueTarget = compilerObject(value);
|
|
210
|
+
if (!previousTarget || !valueTarget || !Array.isArray(previous) || !Array.isArray(value) || Object.getPrototypeOf(previous) !== NATIVE_ARRAY_PROTOTYPE || Object.getPrototypeOf(value) !== NATIVE_ARRAY_PROTOTYPE || previous[Symbol.iterator] !== NATIVE_ARRAY_ITERATOR) {
|
|
211
|
+
return value;
|
|
212
|
+
}
|
|
213
|
+
const startIndex = previous.length;
|
|
214
|
+
if (value.length < startIndex) return value;
|
|
215
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
216
|
+
if (!sourceToken) return value;
|
|
217
|
+
const previousUpdate = !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) ? COMPILER_KEYED_ARRAY_APPENDS.get(previousTarget) : void 0;
|
|
218
|
+
COMPILER_KEYED_ARRAY_APPENDS.set(valueTarget, {
|
|
219
|
+
sourceToken: previousUpdate?.sourceToken || sourceToken,
|
|
220
|
+
startIndex,
|
|
221
|
+
resultLength: value.length,
|
|
222
|
+
...previousUpdate ? { previous: previousUpdate } : {}
|
|
223
|
+
});
|
|
224
|
+
return value;
|
|
225
|
+
} catch {
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function createCompilerKeyedArrayPrepend(previous, value) {
|
|
230
|
+
try {
|
|
231
|
+
const previousTarget = compilerObject(previous);
|
|
232
|
+
const valueTarget = compilerObject(value);
|
|
233
|
+
if (!previousTarget || !valueTarget || !Array.isArray(previous) || !Array.isArray(value) || Object.getPrototypeOf(previous) !== NATIVE_ARRAY_PROTOTYPE || Object.getPrototypeOf(value) !== NATIVE_ARRAY_PROTOTYPE || previous[Symbol.iterator] !== NATIVE_ARRAY_ITERATOR) {
|
|
234
|
+
return value;
|
|
235
|
+
}
|
|
236
|
+
const sourceLength = previous.length;
|
|
237
|
+
const prefixLength = value.length - sourceLength;
|
|
238
|
+
if (prefixLength < 1) return value;
|
|
239
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
240
|
+
if (!sourceToken) return value;
|
|
241
|
+
const previousUpdate = !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) ? COMPILER_KEYED_ARRAY_PREPENDS.get(previousTarget) : void 0;
|
|
242
|
+
COMPILER_KEYED_ARRAY_PREPENDS.set(valueTarget, {
|
|
243
|
+
sourceToken: previousUpdate?.sourceToken || sourceToken,
|
|
244
|
+
sourceLength,
|
|
245
|
+
resultLength: value.length,
|
|
246
|
+
prefixLength,
|
|
247
|
+
...previousUpdate ? { previous: previousUpdate } : {}
|
|
248
|
+
});
|
|
249
|
+
return value;
|
|
250
|
+
} catch {
|
|
251
|
+
return value;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function createCompilerKeyedArrayFilter(previous, method, predicate) {
|
|
255
|
+
let canHint = false;
|
|
256
|
+
let sourceLength = 0;
|
|
257
|
+
try {
|
|
258
|
+
canHint = Array.isArray(previous) && Object.getPrototypeOf(previous) === NATIVE_ARRAY_PROTOTYPE && method === NATIVE_ARRAY_FILTER && typeof predicate === "function";
|
|
259
|
+
if (canHint) sourceLength = previous.length;
|
|
260
|
+
} catch {
|
|
261
|
+
canHint = false;
|
|
262
|
+
}
|
|
263
|
+
if (!canHint) {
|
|
264
|
+
return NATIVE_REFLECT_APPLY(method, previous, [predicate]);
|
|
265
|
+
}
|
|
266
|
+
const removedIndices = [];
|
|
267
|
+
let visited = 0;
|
|
268
|
+
const wrappedPredicate = function(item, index, collection) {
|
|
269
|
+
visited += 1;
|
|
270
|
+
const keep = NATIVE_REFLECT_APPLY(predicate, this, [
|
|
271
|
+
item,
|
|
272
|
+
index,
|
|
273
|
+
collection
|
|
274
|
+
]);
|
|
275
|
+
if (!keep) removedIndices.push(index);
|
|
276
|
+
return keep;
|
|
277
|
+
};
|
|
278
|
+
const value = NATIVE_REFLECT_APPLY(method, previous, [
|
|
279
|
+
wrappedPredicate
|
|
280
|
+
]);
|
|
281
|
+
try {
|
|
282
|
+
const previousTarget = compilerObject(previous);
|
|
283
|
+
const valueTarget = compilerObject(value);
|
|
284
|
+
if (!previousTarget || !valueTarget || !Array.isArray(value) || Object.getPrototypeOf(value) !== NATIVE_ARRAY_PROTOTYPE || visited !== sourceLength || value.length !== sourceLength - removedIndices.length) {
|
|
285
|
+
return value;
|
|
286
|
+
}
|
|
287
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
288
|
+
if (!sourceToken) return value;
|
|
289
|
+
const previousUpdate = !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) ? COMPILER_KEYED_ARRAY_FILTERS.get(previousTarget) : void 0;
|
|
290
|
+
COMPILER_KEYED_ARRAY_FILTERS.set(valueTarget, {
|
|
291
|
+
kind: "filter",
|
|
292
|
+
sourceToken: previousUpdate?.sourceToken || sourceToken,
|
|
293
|
+
sourceLength,
|
|
294
|
+
resultLength: value.length,
|
|
295
|
+
removedIndices,
|
|
296
|
+
...previousUpdate ? { previous: previousUpdate } : {}
|
|
297
|
+
});
|
|
298
|
+
} catch {
|
|
299
|
+
}
|
|
300
|
+
return value;
|
|
301
|
+
}
|
|
302
|
+
function createCompilerKeyedArraySlice(previous, method, ...args) {
|
|
303
|
+
const canHint = (() => {
|
|
304
|
+
try {
|
|
305
|
+
return Array.isArray(previous) && Object.getPrototypeOf(previous) === NATIVE_ARRAY_PROTOTYPE && method === NATIVE_ARRAY_SLICE && args.length > 0 && args.length <= 2 && args.every((value2) => Number.isSafeInteger(value2));
|
|
306
|
+
} catch {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
})();
|
|
310
|
+
const value = NATIVE_REFLECT_APPLY(method, previous, args);
|
|
311
|
+
if (!canHint) return value;
|
|
312
|
+
try {
|
|
313
|
+
const previousTarget = compilerObject(previous);
|
|
314
|
+
const valueTarget = compilerObject(value);
|
|
315
|
+
if (!previousTarget || !valueTarget || !Array.isArray(value) || Object.getPrototypeOf(value) !== NATIVE_ARRAY_PROTOTYPE) {
|
|
316
|
+
return value;
|
|
317
|
+
}
|
|
318
|
+
const sourceLength = previous.length;
|
|
319
|
+
const normalize = (relative) => relative < 0 ? Math.max(sourceLength + relative, 0) : Math.min(relative, sourceLength);
|
|
320
|
+
const retainedStart = normalize(args[0]);
|
|
321
|
+
const retainedEnd = args.length === 2 ? normalize(args[1]) : sourceLength;
|
|
322
|
+
const resultLength = Math.max(retainedEnd - retainedStart, 0);
|
|
323
|
+
if (value.length !== resultLength || resultLength >= sourceLength) return value;
|
|
324
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
325
|
+
if (!sourceToken) return value;
|
|
326
|
+
const previousUpdate = !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) ? COMPILER_KEYED_ARRAY_FILTERS.get(previousTarget) : void 0;
|
|
327
|
+
COMPILER_KEYED_ARRAY_FILTERS.set(valueTarget, {
|
|
328
|
+
kind: "slice",
|
|
329
|
+
sourceToken: previousUpdate?.sourceToken || sourceToken,
|
|
330
|
+
sourceLength,
|
|
331
|
+
resultLength,
|
|
332
|
+
retainedEnd: Math.max(retainedEnd, retainedStart),
|
|
333
|
+
retainedStart,
|
|
334
|
+
...previousUpdate ? { previous: previousUpdate } : {}
|
|
335
|
+
});
|
|
336
|
+
} catch {
|
|
337
|
+
}
|
|
338
|
+
return value;
|
|
339
|
+
}
|
|
340
|
+
function createCompilerKeyedArrayRollingWindow(previous, retained, value) {
|
|
341
|
+
try {
|
|
342
|
+
const previousTarget = compilerObject(previous);
|
|
343
|
+
const retainedTarget = compilerObject(retained);
|
|
344
|
+
const valueTarget = compilerObject(value);
|
|
345
|
+
if (!previousTarget || !retainedTarget || !valueTarget || !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) || !Array.isArray(previous) || !Array.isArray(retained) || !Array.isArray(value) || Object.getPrototypeOf(previous) !== NATIVE_ARRAY_PROTOTYPE || Object.getPrototypeOf(retained) !== NATIVE_ARRAY_PROTOTYPE || Object.getPrototypeOf(value) !== NATIVE_ARRAY_PROTOTYPE) {
|
|
346
|
+
return value;
|
|
347
|
+
}
|
|
348
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
349
|
+
const slice = COMPILER_KEYED_ARRAY_FILTERS.get(retainedTarget);
|
|
350
|
+
if (!sourceToken || !slice || slice.previous || slice.kind !== "slice" || slice.sourceToken !== sourceToken || slice.sourceLength !== previous.length || slice.retainedStart === void 0 || slice.retainedEnd !== previous.length || slice.retainedStart < 1 || slice.resultLength !== retained.length || value.length <= retained.length) {
|
|
351
|
+
return value;
|
|
352
|
+
}
|
|
353
|
+
for (let index = 0; index < retained.length; index += 1) {
|
|
354
|
+
if (!Object.is(value[index], retained[index])) return value;
|
|
355
|
+
}
|
|
356
|
+
COMPILER_KEYED_ARRAY_ROLLING_WINDOWS.set(valueTarget, {
|
|
357
|
+
sourceToken,
|
|
358
|
+
sourceLength: previous.length,
|
|
359
|
+
resultLength: value.length,
|
|
360
|
+
retainedEnd: slice.retainedEnd,
|
|
361
|
+
retainedStart: slice.retainedStart
|
|
362
|
+
});
|
|
363
|
+
} catch {
|
|
364
|
+
}
|
|
365
|
+
return value;
|
|
366
|
+
}
|
|
367
|
+
function createCompilerKeyedArrayPositionUpdate(previous, method, kind, position, ...args) {
|
|
368
|
+
const callArgs = [position, ...args];
|
|
369
|
+
const value = NATIVE_REFLECT_APPLY(
|
|
370
|
+
method,
|
|
371
|
+
previous,
|
|
372
|
+
callArgs
|
|
373
|
+
);
|
|
374
|
+
try {
|
|
375
|
+
const previousTarget = compilerObject(previous);
|
|
376
|
+
const valueTarget = compilerObject(value);
|
|
377
|
+
if (!previousTarget || !valueTarget || !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) || !Array.isArray(previous) || !Array.isArray(value) || Object.getPrototypeOf(previous) !== NATIVE_ARRAY_PROTOTYPE || Object.getPrototypeOf(value) !== NATIVE_ARRAY_PROTOTYPE || !Number.isSafeInteger(position)) {
|
|
378
|
+
return value;
|
|
379
|
+
}
|
|
380
|
+
const sourceLength = previous.length;
|
|
381
|
+
const normalizedPosition = position < 0 ? Math.max(sourceLength + position, 0) : Math.min(position, sourceLength);
|
|
382
|
+
const validInsert = kind === "insert" && method === NATIVE_ARRAY_TO_SPLICED && args.length === 2 && Object.is(args[0], 0) && value.length === sourceLength + 1;
|
|
383
|
+
const validReplace = kind === "replace" && method === NATIVE_ARRAY_WITH && args.length === 1 && position >= -sourceLength && position < sourceLength && value.length === sourceLength;
|
|
384
|
+
if (!validInsert && !validReplace) return value;
|
|
385
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
386
|
+
if (!sourceToken) return value;
|
|
387
|
+
COMPILER_KEYED_ARRAY_POSITIONS.set(valueTarget, {
|
|
388
|
+
kind,
|
|
389
|
+
sourceToken,
|
|
390
|
+
sourceLength,
|
|
391
|
+
resultLength: value.length,
|
|
392
|
+
position: normalizedPosition
|
|
393
|
+
});
|
|
394
|
+
} catch {
|
|
395
|
+
}
|
|
396
|
+
return value;
|
|
397
|
+
}
|
|
398
|
+
function createCompilerKeyedArrayReorder(previous, method) {
|
|
399
|
+
const value = NATIVE_REFLECT_APPLY(
|
|
400
|
+
method,
|
|
401
|
+
previous,
|
|
402
|
+
[]
|
|
403
|
+
);
|
|
404
|
+
try {
|
|
405
|
+
const previousTarget = compilerObject(previous);
|
|
406
|
+
const valueTarget = compilerObject(value);
|
|
407
|
+
if (!previousTarget || !valueTarget || !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) || !Array.isArray(previous) || !Array.isArray(value) || Object.getPrototypeOf(previous) !== NATIVE_ARRAY_PROTOTYPE || Object.getPrototypeOf(value) !== NATIVE_ARRAY_PROTOTYPE || method !== NATIVE_ARRAY_TO_REVERSED || value.length !== previous.length) {
|
|
408
|
+
return value;
|
|
409
|
+
}
|
|
410
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
411
|
+
if (!sourceToken) return value;
|
|
412
|
+
COMPILER_KEYED_ARRAY_REORDERS.set(valueTarget, {
|
|
413
|
+
kind: "reverse",
|
|
414
|
+
sourceToken,
|
|
415
|
+
sourceLength: previous.length,
|
|
416
|
+
resultLength: value.length
|
|
417
|
+
});
|
|
418
|
+
} catch {
|
|
419
|
+
}
|
|
420
|
+
return value;
|
|
421
|
+
}
|
|
422
|
+
function applyCompilerKeyedCollectionMutation(collection, method, operation, key, value) {
|
|
423
|
+
const args = operation === "map-set" ? [key, value] : [key];
|
|
424
|
+
const result = NATIVE_REFLECT_APPLY(method, collection, args);
|
|
425
|
+
const target = compilerObject(collection);
|
|
426
|
+
if (!target) return result;
|
|
427
|
+
const kind = operation.startsWith("set-") ? "set" : "map";
|
|
428
|
+
const nativeMethod = operation === "set-add" ? NATIVE_SET_ADD : operation === "set-delete" ? NATIVE_SET_DELETE : operation === "map-set" ? NATIVE_MAP_SET : NATIVE_MAP_DELETE;
|
|
429
|
+
const nativePrototype = kind === "set" ? NATIVE_SET_PROTOTYPE : NATIVE_MAP_PROTOTYPE;
|
|
430
|
+
if (method !== nativeMethod || Object.getPrototypeOf(collection) !== nativePrototype) {
|
|
431
|
+
return result;
|
|
432
|
+
}
|
|
433
|
+
const existing = COMPILER_KEYED_COLLECTION_DRAFTS.get(target);
|
|
434
|
+
if (existing && existing.kind !== kind) return result;
|
|
435
|
+
if (existing) existing.changedKeys.push(key);
|
|
436
|
+
else COMPILER_KEYED_COLLECTION_DRAFTS.set(target, { kind, changedKeys: [key] });
|
|
437
|
+
return result;
|
|
438
|
+
}
|
|
439
|
+
function createCompilerKeyedCollectionUpdate(previous, value, kind) {
|
|
440
|
+
const previousTarget = compilerObject(previous);
|
|
441
|
+
const valueTarget = compilerObject(value);
|
|
442
|
+
if (!previousTarget || !valueTarget || previousTarget === valueTarget) return value;
|
|
443
|
+
const draft = COMPILER_KEYED_COLLECTION_DRAFTS.get(valueTarget);
|
|
444
|
+
if (!draft || draft.kind !== kind || draft.changedKeys.length === 0) return value;
|
|
445
|
+
const sourceToken = compilerKeyedCollectionToken(previousTarget);
|
|
446
|
+
if (!sourceToken) return value;
|
|
447
|
+
const previousUpdate = !COMPILER_KEYED_COMMITTED_COLLECTIONS.has(previousTarget) ? COMPILER_KEYED_COLLECTION_UPDATES.get(previousTarget) : void 0;
|
|
448
|
+
COMPILER_KEYED_COLLECTION_UPDATES.set(valueTarget, {
|
|
449
|
+
kind,
|
|
450
|
+
sourceToken: previousUpdate?.sourceToken || sourceToken,
|
|
451
|
+
changedKeys: [...draft.changedKeys],
|
|
452
|
+
...previousUpdate ? { previous: previousUpdate } : {}
|
|
453
|
+
});
|
|
454
|
+
return value;
|
|
455
|
+
}
|
|
28
456
|
var COMPILER_HMR_REGISTRY = /* @__PURE__ */ Symbol.for("@farm.js/react/compiler-hmr-registry");
|
|
29
457
|
function getCompilerHmrRegistry() {
|
|
30
458
|
const globalTarget = globalThis;
|
|
@@ -412,6 +840,240 @@ var UNSET_KEYED_ROW_BINDING = /* @__PURE__ */ Symbol("unset interactive keyed-ro
|
|
|
412
840
|
function keyedRowIdentity(key) {
|
|
413
841
|
return String(key);
|
|
414
842
|
}
|
|
843
|
+
function keyedIdentityTargetSnapshot(value) {
|
|
844
|
+
const kind = typeof value;
|
|
845
|
+
return value === null || value === void 0 || kind === "string" || kind === "number" || kind === "bigint" ? { eligible: true, key: String(value) } : { eligible: false };
|
|
846
|
+
}
|
|
847
|
+
var NATIVE_SET_PROTOTYPE = Set.prototype;
|
|
848
|
+
var NATIVE_SET_ADD = Set.prototype.add;
|
|
849
|
+
var NATIVE_SET_DELETE = Set.prototype.delete;
|
|
850
|
+
var NATIVE_SET_HAS = Set.prototype.has;
|
|
851
|
+
var NATIVE_SET_VALUES = Set.prototype.values;
|
|
852
|
+
var KEYED_COLLECTION_SNAPSHOT_MAX_DEPTH = 64;
|
|
853
|
+
function materializeKeyedMembershipSnapshot(snapshot) {
|
|
854
|
+
if (!snapshot.eligible) return void 0;
|
|
855
|
+
if (snapshot.values) return new Set(snapshot.values);
|
|
856
|
+
if (!snapshot.previous || !snapshot.changes) return void 0;
|
|
857
|
+
const values = materializeKeyedMembershipSnapshot(snapshot.previous);
|
|
858
|
+
if (!values) return void 0;
|
|
859
|
+
for (const [key, present] of snapshot.changes) {
|
|
860
|
+
if (present) NATIVE_SET_ADD.call(values, key);
|
|
861
|
+
else NATIVE_SET_DELETE.call(values, key);
|
|
862
|
+
}
|
|
863
|
+
return values;
|
|
864
|
+
}
|
|
865
|
+
function keyedMembershipSnapshotHas(snapshot, key) {
|
|
866
|
+
for (let current = snapshot; current; current = current.previous) {
|
|
867
|
+
if (!current.eligible) return void 0;
|
|
868
|
+
if (current.changes?.has(key)) return current.changes.get(key);
|
|
869
|
+
if (current.values) return NATIVE_SET_HAS.call(current.values, key);
|
|
870
|
+
}
|
|
871
|
+
return void 0;
|
|
872
|
+
}
|
|
873
|
+
function keyedMembershipDeltaSnapshot(value, previous) {
|
|
874
|
+
if (!previous.eligible || !previous.sourceToken) return void 0;
|
|
875
|
+
const target = compilerObject(value);
|
|
876
|
+
if (!target) return void 0;
|
|
877
|
+
const changedKeys = compilerKeyedCollectionChangedKeys(value, previous.sourceToken, "set");
|
|
878
|
+
if (!changedKeys) return void 0;
|
|
879
|
+
if (Object.getPrototypeOf(value) !== NATIVE_SET_PROTOTYPE || Object.prototype.hasOwnProperty.call(value, "has") || value.has !== NATIVE_SET_HAS) {
|
|
880
|
+
return void 0;
|
|
881
|
+
}
|
|
882
|
+
const changes = /* @__PURE__ */ new Map();
|
|
883
|
+
const targetedKeys = /* @__PURE__ */ new Set();
|
|
884
|
+
try {
|
|
885
|
+
for (const key of changedKeys) {
|
|
886
|
+
if (!keyedIdentityTargetSnapshot(key).eligible) return void 0;
|
|
887
|
+
const present = NATIVE_SET_HAS.call(value, key);
|
|
888
|
+
const before = keyedMembershipSnapshotHas(previous, key);
|
|
889
|
+
if (before === void 0) return void 0;
|
|
890
|
+
changes.set(key, present);
|
|
891
|
+
if (before !== present) NATIVE_SET_ADD.call(targetedKeys, String(key));
|
|
892
|
+
}
|
|
893
|
+
} catch {
|
|
894
|
+
return void 0;
|
|
895
|
+
}
|
|
896
|
+
const depth = (previous.depth || 0) + 1;
|
|
897
|
+
if (depth > KEYED_COLLECTION_SNAPSHOT_MAX_DEPTH) return void 0;
|
|
898
|
+
return {
|
|
899
|
+
eligible: true,
|
|
900
|
+
previous,
|
|
901
|
+
changes,
|
|
902
|
+
sourceToken: commitCompilerKeyedCollection(value),
|
|
903
|
+
targetedKeys,
|
|
904
|
+
depth
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
function keyedMembershipTargetSnapshot(value, previous) {
|
|
908
|
+
if (previous) {
|
|
909
|
+
const delta = keyedMembershipDeltaSnapshot(value, previous);
|
|
910
|
+
if (delta) return delta;
|
|
911
|
+
}
|
|
912
|
+
if (typeof value !== "object" || value === null) return { eligible: false };
|
|
913
|
+
let iterator;
|
|
914
|
+
try {
|
|
915
|
+
iterator = NATIVE_SET_VALUES.call(value);
|
|
916
|
+
} catch {
|
|
917
|
+
return { eligible: false };
|
|
918
|
+
}
|
|
919
|
+
if (Object.getPrototypeOf(value) !== NATIVE_SET_PROTOTYPE || Object.prototype.hasOwnProperty.call(value, "has") || value.has !== NATIVE_SET_HAS) {
|
|
920
|
+
return { eligible: false };
|
|
921
|
+
}
|
|
922
|
+
const values = /* @__PURE__ */ new Set();
|
|
923
|
+
try {
|
|
924
|
+
for (const entry of iterator) {
|
|
925
|
+
if (!keyedIdentityTargetSnapshot(entry).eligible) return { eligible: false };
|
|
926
|
+
NATIVE_SET_ADD.call(values, entry);
|
|
927
|
+
}
|
|
928
|
+
} catch {
|
|
929
|
+
return { eligible: false };
|
|
930
|
+
}
|
|
931
|
+
return {
|
|
932
|
+
eligible: true,
|
|
933
|
+
values,
|
|
934
|
+
sourceToken: commitCompilerKeyedCollection(value),
|
|
935
|
+
depth: 0
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
function keyedMembershipChangedKeys(previousSnapshot, nextSnapshot) {
|
|
939
|
+
if (nextSnapshot.targetedKeys) return new Set(nextSnapshot.targetedKeys);
|
|
940
|
+
const previous = materializeKeyedMembershipSnapshot(previousSnapshot);
|
|
941
|
+
const next = materializeKeyedMembershipSnapshot(nextSnapshot);
|
|
942
|
+
const keys = /* @__PURE__ */ new Set();
|
|
943
|
+
if (!previous || !next) return keys;
|
|
944
|
+
for (const value of previous) {
|
|
945
|
+
if (!NATIVE_SET_HAS.call(next, value)) NATIVE_SET_ADD.call(keys, String(value));
|
|
946
|
+
}
|
|
947
|
+
for (const value of next) {
|
|
948
|
+
if (!NATIVE_SET_HAS.call(previous, value)) NATIVE_SET_ADD.call(keys, String(value));
|
|
949
|
+
}
|
|
950
|
+
return keys;
|
|
951
|
+
}
|
|
952
|
+
var NATIVE_MAP_PROTOTYPE = Map.prototype;
|
|
953
|
+
var NATIVE_MAP_GET = Map.prototype.get;
|
|
954
|
+
var NATIVE_MAP_HAS = Map.prototype.has;
|
|
955
|
+
var NATIVE_MAP_SET = Map.prototype.set;
|
|
956
|
+
var NATIVE_MAP_DELETE = Map.prototype.delete;
|
|
957
|
+
var NATIVE_MAP_ENTRIES = Map.prototype.entries;
|
|
958
|
+
function isSafeKeyedMapLookupValue(value) {
|
|
959
|
+
return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean";
|
|
960
|
+
}
|
|
961
|
+
function materializeKeyedMapLookupSnapshot(snapshot) {
|
|
962
|
+
if (!snapshot.eligible) return void 0;
|
|
963
|
+
if (snapshot.values) return new Map(snapshot.values);
|
|
964
|
+
if (!snapshot.previous || !snapshot.changes) return void 0;
|
|
965
|
+
const values = materializeKeyedMapLookupSnapshot(snapshot.previous);
|
|
966
|
+
if (!values) return void 0;
|
|
967
|
+
for (const [key, entry] of snapshot.changes) {
|
|
968
|
+
if (entry.present) NATIVE_MAP_SET.call(values, key, entry.value);
|
|
969
|
+
else NATIVE_MAP_DELETE.call(values, key);
|
|
970
|
+
}
|
|
971
|
+
return values;
|
|
972
|
+
}
|
|
973
|
+
function keyedMapLookupSnapshotValue(snapshot, key) {
|
|
974
|
+
for (let current = snapshot; current; current = current.previous) {
|
|
975
|
+
if (!current.eligible) return void 0;
|
|
976
|
+
const changed = current.changes?.get(key);
|
|
977
|
+
if (changed) return changed;
|
|
978
|
+
if (current.values) {
|
|
979
|
+
const present = NATIVE_MAP_HAS.call(current.values, key);
|
|
980
|
+
return {
|
|
981
|
+
present,
|
|
982
|
+
...present ? { value: NATIVE_MAP_GET.call(current.values, key) } : {}
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
return void 0;
|
|
987
|
+
}
|
|
988
|
+
function keyedMapLookupDeltaSnapshot(value, previous) {
|
|
989
|
+
if (!previous.eligible || !previous.sourceToken) return void 0;
|
|
990
|
+
const target = compilerObject(value);
|
|
991
|
+
if (!target) return void 0;
|
|
992
|
+
const changedKeys = compilerKeyedCollectionChangedKeys(value, previous.sourceToken, "map");
|
|
993
|
+
if (!changedKeys) return void 0;
|
|
994
|
+
if (Object.getPrototypeOf(value) !== NATIVE_MAP_PROTOTYPE || Object.prototype.hasOwnProperty.call(value, "get") || value.get !== NATIVE_MAP_GET) {
|
|
995
|
+
return void 0;
|
|
996
|
+
}
|
|
997
|
+
const changes = /* @__PURE__ */ new Map();
|
|
998
|
+
const targetedKeys = /* @__PURE__ */ new Set();
|
|
999
|
+
try {
|
|
1000
|
+
for (const key of changedKeys) {
|
|
1001
|
+
if (!keyedIdentityTargetSnapshot(key).eligible) return void 0;
|
|
1002
|
+
const present = NATIVE_MAP_HAS.call(value, key);
|
|
1003
|
+
const entry = present ? NATIVE_MAP_GET.call(value, key) : void 0;
|
|
1004
|
+
if (present && !isSafeKeyedMapLookupValue(entry)) return void 0;
|
|
1005
|
+
const before = keyedMapLookupSnapshotValue(previous, key);
|
|
1006
|
+
if (!before) return void 0;
|
|
1007
|
+
changes.set(key, { present, ...present ? { value: entry } : {} });
|
|
1008
|
+
if (before.present !== present || !Object.is(before.value, entry)) {
|
|
1009
|
+
NATIVE_SET_ADD.call(targetedKeys, String(key));
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
} catch {
|
|
1013
|
+
return void 0;
|
|
1014
|
+
}
|
|
1015
|
+
const depth = (previous.depth || 0) + 1;
|
|
1016
|
+
if (depth > KEYED_COLLECTION_SNAPSHOT_MAX_DEPTH) return void 0;
|
|
1017
|
+
return {
|
|
1018
|
+
eligible: true,
|
|
1019
|
+
previous,
|
|
1020
|
+
changes,
|
|
1021
|
+
sourceToken: commitCompilerKeyedCollection(value),
|
|
1022
|
+
targetedKeys,
|
|
1023
|
+
depth
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
function keyedMapLookupTargetSnapshot(value, previous) {
|
|
1027
|
+
if (previous) {
|
|
1028
|
+
const delta = keyedMapLookupDeltaSnapshot(value, previous);
|
|
1029
|
+
if (delta) return delta;
|
|
1030
|
+
}
|
|
1031
|
+
if (typeof value !== "object" || value === null) return { eligible: false };
|
|
1032
|
+
let iterator;
|
|
1033
|
+
try {
|
|
1034
|
+
iterator = NATIVE_MAP_ENTRIES.call(value);
|
|
1035
|
+
} catch {
|
|
1036
|
+
return { eligible: false };
|
|
1037
|
+
}
|
|
1038
|
+
if (Object.getPrototypeOf(value) !== NATIVE_MAP_PROTOTYPE || Object.prototype.hasOwnProperty.call(value, "get") || value.get !== NATIVE_MAP_GET) {
|
|
1039
|
+
return { eligible: false };
|
|
1040
|
+
}
|
|
1041
|
+
const values = /* @__PURE__ */ new Map();
|
|
1042
|
+
try {
|
|
1043
|
+
for (const [key, entry] of iterator) {
|
|
1044
|
+
if (!keyedIdentityTargetSnapshot(key).eligible || !isSafeKeyedMapLookupValue(entry)) {
|
|
1045
|
+
return { eligible: false };
|
|
1046
|
+
}
|
|
1047
|
+
NATIVE_MAP_SET.call(values, key, entry);
|
|
1048
|
+
}
|
|
1049
|
+
} catch {
|
|
1050
|
+
return { eligible: false };
|
|
1051
|
+
}
|
|
1052
|
+
return {
|
|
1053
|
+
eligible: true,
|
|
1054
|
+
values,
|
|
1055
|
+
sourceToken: commitCompilerKeyedCollection(value),
|
|
1056
|
+
depth: 0
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
function keyedMapLookupChangedKeys(previousSnapshot, nextSnapshot) {
|
|
1060
|
+
if (nextSnapshot.targetedKeys) return new Set(nextSnapshot.targetedKeys);
|
|
1061
|
+
const previous = materializeKeyedMapLookupSnapshot(previousSnapshot);
|
|
1062
|
+
const next = materializeKeyedMapLookupSnapshot(nextSnapshot);
|
|
1063
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1064
|
+
if (!previous || !next) return keys;
|
|
1065
|
+
for (const [key, value] of previous) {
|
|
1066
|
+
if (!Object.is(value, NATIVE_MAP_GET.call(next, key))) {
|
|
1067
|
+
NATIVE_SET_ADD.call(keys, String(key));
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
for (const [key, value] of next) {
|
|
1071
|
+
if (!Object.is(value, NATIVE_MAP_GET.call(previous, key))) {
|
|
1072
|
+
NATIVE_SET_ADD.call(keys, String(key));
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
return keys;
|
|
1076
|
+
}
|
|
415
1077
|
function normalizedKeyedRowBindingValue(binding, value) {
|
|
416
1078
|
return binding.kind === "text" ? renderTextValue(value) : value;
|
|
417
1079
|
}
|
|
@@ -1883,6 +2545,426 @@ function longestIncreasingSubsequencePositions(sequence) {
|
|
|
1883
2545
|
}
|
|
1884
2546
|
return positions;
|
|
1885
2547
|
}
|
|
2548
|
+
var keyedUpdateRuntime = {
|
|
2549
|
+
append: reconcileCompilerKeyedArrayAppend,
|
|
2550
|
+
commit: commitCompilerKeyedCollection,
|
|
2551
|
+
reconcile: reconcileCompilerKeyedMapUpdate
|
|
2552
|
+
};
|
|
2553
|
+
var keyedFilterUpdateRuntime = {
|
|
2554
|
+
...keyedUpdateRuntime,
|
|
2555
|
+
filter: reconcileCompilerKeyedArrayFilter
|
|
2556
|
+
};
|
|
2557
|
+
var keyedPrependUpdateRuntime = {
|
|
2558
|
+
...keyedUpdateRuntime,
|
|
2559
|
+
prepend: reconcileCompilerKeyedArrayPrepend
|
|
2560
|
+
};
|
|
2561
|
+
var keyedFilterPrependUpdateRuntime = {
|
|
2562
|
+
...keyedFilterUpdateRuntime,
|
|
2563
|
+
prepend: reconcileCompilerKeyedArrayPrepend
|
|
2564
|
+
};
|
|
2565
|
+
var keyedPositionUpdateRuntime = {
|
|
2566
|
+
...keyedUpdateRuntime,
|
|
2567
|
+
position: reconcileCompilerKeyedArrayPosition
|
|
2568
|
+
};
|
|
2569
|
+
var keyedReorderUpdateRuntime = {
|
|
2570
|
+
...keyedUpdateRuntime,
|
|
2571
|
+
reorder: reconcileCompilerKeyedArrayReorder
|
|
2572
|
+
};
|
|
2573
|
+
var keyedCompleteUpdateRuntime = {
|
|
2574
|
+
...keyedFilterPrependUpdateRuntime,
|
|
2575
|
+
rollingWindow: reconcileCompilerKeyedArrayRollingWindow
|
|
2576
|
+
};
|
|
2577
|
+
var keyedEveryUpdateRuntime = {
|
|
2578
|
+
...keyedCompleteUpdateRuntime,
|
|
2579
|
+
position: reconcileCompilerKeyedArrayPosition,
|
|
2580
|
+
reorder: reconcileCompilerKeyedArrayReorder
|
|
2581
|
+
};
|
|
2582
|
+
function reconcileCompilerKeyedMapUpdate(props, dirtyState, collectionToken, instances, conditionals) {
|
|
2583
|
+
const dependency = props.collectionDependency;
|
|
2584
|
+
if (dependency === void 0) return void 0;
|
|
2585
|
+
const dependencies = props.dependencies || props.structureDependencies || [];
|
|
2586
|
+
const relevantDirty = [...dirtyState].filter((index) => dependencies.includes(index));
|
|
2587
|
+
if (relevantDirty.length !== 1 || relevantDirty[0] !== dependency) return void 0;
|
|
2588
|
+
const finalValue = props.items();
|
|
2589
|
+
const hintedIndices = compilerKeyedMapChangedIndices(finalValue, collectionToken);
|
|
2590
|
+
if (!hintedIndices || !Array.isArray(finalValue) || finalValue.length !== instances.size) {
|
|
2591
|
+
return void 0;
|
|
2592
|
+
}
|
|
2593
|
+
const changedIndices = [...new Set(hintedIndices)].sort((left, right) => left - right);
|
|
2594
|
+
const updates = [];
|
|
2595
|
+
try {
|
|
2596
|
+
for (const index of changedIndices) {
|
|
2597
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= finalValue.length) return void 0;
|
|
2598
|
+
const item = finalValue[index];
|
|
2599
|
+
const key = keyedRowIdentity(props.rowKey(item, index));
|
|
2600
|
+
const instance = instances.get(key);
|
|
2601
|
+
if (!instance || instance.index !== index) return void 0;
|
|
2602
|
+
updates.push({ key, item, index, instance });
|
|
2603
|
+
}
|
|
2604
|
+
} catch {
|
|
2605
|
+
return void 0;
|
|
2606
|
+
}
|
|
2607
|
+
const conditionalChanges = [];
|
|
2608
|
+
for (const { key, item, index, instance } of updates) {
|
|
2609
|
+
if (props.hostBlocks) {
|
|
2610
|
+
const descriptor = props.create(item, index);
|
|
2611
|
+
if (!instance.scope?.update(descriptor)) {
|
|
2612
|
+
return { collectionToken, conditionalChanges: [], fallback: true };
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
applyKeyedRowBindings(props, instance, item, index);
|
|
2616
|
+
const conditionalValues = conditionals?.readValues(props, item, index) || EMPTY_KEYED_ROW_CONDITIONAL_VALUES;
|
|
2617
|
+
for (const [id, values] of conditionalValues) {
|
|
2618
|
+
if (conditionals?.changed(instance.conditionalValues.get(id), values)) {
|
|
2619
|
+
conditionalChanges.push({ key, id, item, index });
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
instance.conditionalValues = conditionalValues;
|
|
2623
|
+
instance.item = item;
|
|
2624
|
+
}
|
|
2625
|
+
return {
|
|
2626
|
+
collectionToken: commitCompilerKeyedCollection(finalValue),
|
|
2627
|
+
conditionalChanges,
|
|
2628
|
+
fallback: false
|
|
2629
|
+
};
|
|
2630
|
+
}
|
|
2631
|
+
function reconcileCompilerKeyedArrayAppend(props, dirtyState, collectionToken, instances, root, reactOwnedRows) {
|
|
2632
|
+
if (reactOwnedRows || props.hostBlocks || (props.conditionals?.length || 0) > 0 || props.collectionDependency === void 0) {
|
|
2633
|
+
return void 0;
|
|
2634
|
+
}
|
|
2635
|
+
const collectionDependency = props.collectionDependency;
|
|
2636
|
+
if (props.bindings.some((binding) => binding.dependencies?.includes(collectionDependency))) {
|
|
2637
|
+
return void 0;
|
|
2638
|
+
}
|
|
2639
|
+
const dependencies = props.dependencies || props.structureDependencies;
|
|
2640
|
+
const relevantDirty = (dependencies || []).filter((index) => dirtyState.has(index));
|
|
2641
|
+
if (relevantDirty.length !== 1 || relevantDirty[0] !== collectionDependency) {
|
|
2642
|
+
return void 0;
|
|
2643
|
+
}
|
|
2644
|
+
const finalValue = props.items();
|
|
2645
|
+
const startIndex = compilerKeyedArrayAppendStart(finalValue, collectionToken, instances.size);
|
|
2646
|
+
if (startIndex === void 0 || !Array.isArray(finalValue)) return void 0;
|
|
2647
|
+
const nextInstances = new Map(instances);
|
|
2648
|
+
const appended = [];
|
|
2649
|
+
try {
|
|
2650
|
+
for (let index = startIndex; index < finalValue.length; index += 1) {
|
|
2651
|
+
const item = finalValue[index];
|
|
2652
|
+
const key = keyedRowIdentity(props.rowKey(item, index));
|
|
2653
|
+
if (nextInstances.has(key)) return void 0;
|
|
2654
|
+
const descriptor = props.create(item, index);
|
|
2655
|
+
const instance = {
|
|
2656
|
+
key,
|
|
2657
|
+
element: createCompilerHostElement(root.ownerDocument, descriptor),
|
|
2658
|
+
values: readKeyedRowBindingValues(props, item, index),
|
|
2659
|
+
item,
|
|
2660
|
+
index,
|
|
2661
|
+
conditionalValues: EMPTY_KEYED_ROW_CONDITIONAL_VALUES
|
|
2662
|
+
};
|
|
2663
|
+
appended.push(instance);
|
|
2664
|
+
nextInstances.set(key, instance);
|
|
2665
|
+
}
|
|
2666
|
+
} catch {
|
|
2667
|
+
return void 0;
|
|
2668
|
+
}
|
|
2669
|
+
if (appended.length > 0) {
|
|
2670
|
+
const fragment = root.ownerDocument.createDocumentFragment();
|
|
2671
|
+
for (const instance of appended) fragment.append(instance.element);
|
|
2672
|
+
root.append(fragment);
|
|
2673
|
+
}
|
|
2674
|
+
return nextInstances;
|
|
2675
|
+
}
|
|
2676
|
+
function reconcileCompilerKeyedArrayRollingWindow(props, dirtyState, collectionToken, instances, root, reactOwnedRows) {
|
|
2677
|
+
if (reactOwnedRows || props.hostBlocks || (props.conditionals?.length || 0) > 0 || !props.filterIndexIndependent || props.collectionDependency === void 0) {
|
|
2678
|
+
return void 0;
|
|
2679
|
+
}
|
|
2680
|
+
const collectionDependency = props.collectionDependency;
|
|
2681
|
+
if (props.bindings.some((binding) => binding.dependencies?.includes(collectionDependency))) {
|
|
2682
|
+
return void 0;
|
|
2683
|
+
}
|
|
2684
|
+
const dependencies = props.dependencies || props.structureDependencies;
|
|
2685
|
+
const relevantDirty = (dependencies || []).filter((index) => dirtyState.has(index));
|
|
2686
|
+
if (relevantDirty.length !== 1 || relevantDirty[0] !== collectionDependency) {
|
|
2687
|
+
return void 0;
|
|
2688
|
+
}
|
|
2689
|
+
const finalValue = props.items();
|
|
2690
|
+
const update = compilerKeyedArrayRollingWindow(finalValue, collectionToken, instances.size);
|
|
2691
|
+
if (!update || !Array.isArray(finalValue)) return void 0;
|
|
2692
|
+
const previousInstances = [...instances.values()];
|
|
2693
|
+
const retainedLength = update.retainedEnd - update.retainedStart;
|
|
2694
|
+
const survivors = [];
|
|
2695
|
+
try {
|
|
2696
|
+
for (let index = 0; index < retainedLength; index += 1) {
|
|
2697
|
+
const sourceIndex = update.retainedStart + index;
|
|
2698
|
+
const instance = previousInstances[sourceIndex];
|
|
2699
|
+
if (!instance || instance.index !== sourceIndex || !Object.is(instance.item, finalValue[index])) {
|
|
2700
|
+
return void 0;
|
|
2701
|
+
}
|
|
2702
|
+
survivors.push(instance);
|
|
2703
|
+
}
|
|
2704
|
+
} catch {
|
|
2705
|
+
return void 0;
|
|
2706
|
+
}
|
|
2707
|
+
const knownKeys = new Set(instances.keys());
|
|
2708
|
+
const incoming = [];
|
|
2709
|
+
try {
|
|
2710
|
+
for (let index = retainedLength; index < finalValue.length; index += 1) {
|
|
2711
|
+
const item = finalValue[index];
|
|
2712
|
+
const key = keyedRowIdentity(props.rowKey(item, index));
|
|
2713
|
+
if (knownKeys.has(key)) return void 0;
|
|
2714
|
+
knownKeys.add(key);
|
|
2715
|
+
const descriptor = props.create(item, index);
|
|
2716
|
+
incoming.push({
|
|
2717
|
+
key,
|
|
2718
|
+
element: createCompilerHostElement(root.ownerDocument, descriptor),
|
|
2719
|
+
values: readKeyedRowBindingValues(props, item, index),
|
|
2720
|
+
item,
|
|
2721
|
+
index,
|
|
2722
|
+
conditionalValues: EMPTY_KEYED_ROW_CONDITIONAL_VALUES
|
|
2723
|
+
});
|
|
2724
|
+
}
|
|
2725
|
+
} catch {
|
|
2726
|
+
return void 0;
|
|
2727
|
+
}
|
|
2728
|
+
for (let index = 0; index < update.retainedStart; index += 1) {
|
|
2729
|
+
previousInstances[index].scope?.cleanup();
|
|
2730
|
+
previousInstances[index].element.remove();
|
|
2731
|
+
}
|
|
2732
|
+
for (let index = 0; index < survivors.length; index += 1) survivors[index].index = index;
|
|
2733
|
+
if (incoming.length > 0) {
|
|
2734
|
+
const fragment = root.ownerDocument.createDocumentFragment();
|
|
2735
|
+
for (const instance of incoming) fragment.append(instance.element);
|
|
2736
|
+
root.append(fragment);
|
|
2737
|
+
}
|
|
2738
|
+
const nextInstances = new Map(
|
|
2739
|
+
[...survivors, ...incoming].map((instance) => [instance.key, instance])
|
|
2740
|
+
);
|
|
2741
|
+
return nextInstances;
|
|
2742
|
+
}
|
|
2743
|
+
function reconcileCompilerKeyedArrayPosition(props, dirtyState, collectionToken, instances, root, reactOwnedRows) {
|
|
2744
|
+
if (reactOwnedRows || props.hostBlocks || (props.conditionals?.length || 0) > 0 || !props.positionIndexIndependent || props.collectionDependency === void 0) {
|
|
2745
|
+
return void 0;
|
|
2746
|
+
}
|
|
2747
|
+
const collectionDependency = props.collectionDependency;
|
|
2748
|
+
if (props.bindings.some((binding) => binding.dependencies?.includes(collectionDependency))) {
|
|
2749
|
+
return void 0;
|
|
2750
|
+
}
|
|
2751
|
+
const dependencies = props.dependencies || props.structureDependencies;
|
|
2752
|
+
const relevantDirty = (dependencies || []).filter((index) => dirtyState.has(index));
|
|
2753
|
+
if (relevantDirty.length !== 1 || relevantDirty[0] !== collectionDependency) {
|
|
2754
|
+
return void 0;
|
|
2755
|
+
}
|
|
2756
|
+
const finalValue = props.items();
|
|
2757
|
+
const update = compilerKeyedArrayPosition(finalValue, collectionToken, instances.size);
|
|
2758
|
+
if (!update || !Array.isArray(finalValue)) return void 0;
|
|
2759
|
+
const previousInstances = [...instances.values()];
|
|
2760
|
+
const previous = previousInstances[update.position];
|
|
2761
|
+
let item;
|
|
2762
|
+
let key;
|
|
2763
|
+
try {
|
|
2764
|
+
item = finalValue[update.position];
|
|
2765
|
+
key = keyedRowIdentity(props.rowKey(item, update.position));
|
|
2766
|
+
} catch {
|
|
2767
|
+
return void 0;
|
|
2768
|
+
}
|
|
2769
|
+
if (update.kind === "insert") {
|
|
2770
|
+
if (instances.has(key)) return void 0;
|
|
2771
|
+
let inserted;
|
|
2772
|
+
try {
|
|
2773
|
+
const descriptor = props.create(item, update.position);
|
|
2774
|
+
inserted = {
|
|
2775
|
+
key,
|
|
2776
|
+
element: createCompilerHostElement(root.ownerDocument, descriptor),
|
|
2777
|
+
values: readKeyedRowBindingValues(props, item, update.position),
|
|
2778
|
+
item,
|
|
2779
|
+
index: update.position,
|
|
2780
|
+
conditionalValues: EMPTY_KEYED_ROW_CONDITIONAL_VALUES
|
|
2781
|
+
};
|
|
2782
|
+
} catch {
|
|
2783
|
+
return void 0;
|
|
2784
|
+
}
|
|
2785
|
+
root.insertBefore(inserted.element, previous?.element || null);
|
|
2786
|
+
previousInstances.splice(update.position, 0, inserted);
|
|
2787
|
+
for (let index = update.position + 1; index < previousInstances.length; index += 1) {
|
|
2788
|
+
previousInstances[index].index = index;
|
|
2789
|
+
}
|
|
2790
|
+
return new Map(previousInstances.map((instance) => [instance.key, instance]));
|
|
2791
|
+
}
|
|
2792
|
+
if (!previous || previous.index !== update.position) return void 0;
|
|
2793
|
+
if (key === previous.key) {
|
|
2794
|
+
try {
|
|
2795
|
+
applyKeyedRowBindings(props, previous, item, update.position);
|
|
2796
|
+
} catch {
|
|
2797
|
+
return void 0;
|
|
2798
|
+
}
|
|
2799
|
+
previous.item = item;
|
|
2800
|
+
return instances;
|
|
2801
|
+
}
|
|
2802
|
+
if (instances.has(key)) return void 0;
|
|
2803
|
+
let replacement;
|
|
2804
|
+
try {
|
|
2805
|
+
const descriptor = props.create(item, update.position);
|
|
2806
|
+
replacement = {
|
|
2807
|
+
key,
|
|
2808
|
+
element: createCompilerHostElement(root.ownerDocument, descriptor),
|
|
2809
|
+
values: readKeyedRowBindingValues(props, item, update.position),
|
|
2810
|
+
item,
|
|
2811
|
+
index: update.position,
|
|
2812
|
+
conditionalValues: EMPTY_KEYED_ROW_CONDITIONAL_VALUES
|
|
2813
|
+
};
|
|
2814
|
+
} catch {
|
|
2815
|
+
return void 0;
|
|
2816
|
+
}
|
|
2817
|
+
previous.scope?.cleanup();
|
|
2818
|
+
previous.element.replaceWith(replacement.element);
|
|
2819
|
+
previousInstances[update.position] = replacement;
|
|
2820
|
+
return new Map(previousInstances.map((instance) => [instance.key, instance]));
|
|
2821
|
+
}
|
|
2822
|
+
function reconcileCompilerKeyedArrayReorder(props, dirtyState, collectionToken, instances, root, reactOwnedRows) {
|
|
2823
|
+
if (reactOwnedRows || props.hostBlocks || (props.conditionals?.length || 0) > 0 || !props.reorderIndexIndependent || props.collectionDependency === void 0) {
|
|
2824
|
+
return void 0;
|
|
2825
|
+
}
|
|
2826
|
+
const collectionDependency = props.collectionDependency;
|
|
2827
|
+
if (props.bindings.some((binding) => binding.dependencies?.includes(collectionDependency))) {
|
|
2828
|
+
return void 0;
|
|
2829
|
+
}
|
|
2830
|
+
const dependencies = props.dependencies || props.structureDependencies;
|
|
2831
|
+
const relevantDirty = (dependencies || []).filter((index) => dirtyState.has(index));
|
|
2832
|
+
if (relevantDirty.length !== 1 || relevantDirty[0] !== collectionDependency) {
|
|
2833
|
+
return void 0;
|
|
2834
|
+
}
|
|
2835
|
+
const finalValue = props.items();
|
|
2836
|
+
const update = compilerKeyedArrayReorder(finalValue, collectionToken, instances.size);
|
|
2837
|
+
if (!update || update.kind !== "reverse" || !Array.isArray(finalValue)) return void 0;
|
|
2838
|
+
const previousInstances = [...instances.values()];
|
|
2839
|
+
try {
|
|
2840
|
+
for (let sourceIndex = 0; sourceIndex < previousInstances.length; sourceIndex += 1) {
|
|
2841
|
+
const instance = previousInstances[sourceIndex];
|
|
2842
|
+
const targetIndex = previousInstances.length - sourceIndex - 1;
|
|
2843
|
+
if (instance.index !== sourceIndex || !Object.is(instance.item, finalValue[targetIndex])) {
|
|
2844
|
+
return void 0;
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
} catch {
|
|
2848
|
+
return void 0;
|
|
2849
|
+
}
|
|
2850
|
+
const activeElement = root.ownerDocument.activeElement;
|
|
2851
|
+
const restoreFocus = Boolean(activeElement && root.contains(activeElement));
|
|
2852
|
+
let anchor = previousInstances[0]?.element || null;
|
|
2853
|
+
for (let sourceIndex = 1; sourceIndex < previousInstances.length; sourceIndex += 1) {
|
|
2854
|
+
const element = previousInstances[sourceIndex].element;
|
|
2855
|
+
root.insertBefore(element, anchor);
|
|
2856
|
+
anchor = element;
|
|
2857
|
+
}
|
|
2858
|
+
previousInstances.reverse();
|
|
2859
|
+
for (let index = 0; index < previousInstances.length; index += 1) {
|
|
2860
|
+
previousInstances[index].index = index;
|
|
2861
|
+
}
|
|
2862
|
+
if (restoreFocus && activeElement?.isConnected && activeElement.ownerDocument.activeElement !== activeElement && "focus" in activeElement) {
|
|
2863
|
+
activeElement.focus({ preventScroll: true });
|
|
2864
|
+
}
|
|
2865
|
+
return new Map(previousInstances.map((instance) => [instance.key, instance]));
|
|
2866
|
+
}
|
|
2867
|
+
function reconcileCompilerKeyedArrayPrepend(props, dirtyState, collectionToken, instances, root, reactOwnedRows) {
|
|
2868
|
+
if (reactOwnedRows || props.hostBlocks || (props.conditionals?.length || 0) > 0 || !props.prependIndexIndependent || props.collectionDependency === void 0) {
|
|
2869
|
+
return void 0;
|
|
2870
|
+
}
|
|
2871
|
+
const collectionDependency = props.collectionDependency;
|
|
2872
|
+
if (props.bindings.some((binding) => binding.dependencies?.includes(collectionDependency))) {
|
|
2873
|
+
return void 0;
|
|
2874
|
+
}
|
|
2875
|
+
const dependencies = props.dependencies || props.structureDependencies;
|
|
2876
|
+
const relevantDirty = (dependencies || []).filter((index) => dirtyState.has(index));
|
|
2877
|
+
if (relevantDirty.length !== 1 || relevantDirty[0] !== collectionDependency) {
|
|
2878
|
+
return void 0;
|
|
2879
|
+
}
|
|
2880
|
+
const finalValue = props.items();
|
|
2881
|
+
const prefixLength = compilerKeyedArrayPrependLength(finalValue, collectionToken, instances.size);
|
|
2882
|
+
if (prefixLength === void 0 || !Array.isArray(finalValue)) return void 0;
|
|
2883
|
+
const previousInstances = [...instances.values()];
|
|
2884
|
+
for (let index = 0; index < previousInstances.length; index += 1) {
|
|
2885
|
+
const instance = previousInstances[index];
|
|
2886
|
+
if (instance.index !== index || !Object.is(instance.item, finalValue[prefixLength + index])) {
|
|
2887
|
+
return void 0;
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
const knownKeys = new Set(instances.keys());
|
|
2891
|
+
const prepended = [];
|
|
2892
|
+
try {
|
|
2893
|
+
for (let index = 0; index < prefixLength; index += 1) {
|
|
2894
|
+
const item = finalValue[index];
|
|
2895
|
+
const key = keyedRowIdentity(props.rowKey(item, index));
|
|
2896
|
+
if (knownKeys.has(key)) return void 0;
|
|
2897
|
+
knownKeys.add(key);
|
|
2898
|
+
const descriptor = props.create(item, index);
|
|
2899
|
+
prepended.push({
|
|
2900
|
+
key,
|
|
2901
|
+
element: createCompilerHostElement(root.ownerDocument, descriptor),
|
|
2902
|
+
values: readKeyedRowBindingValues(props, item, index),
|
|
2903
|
+
item,
|
|
2904
|
+
index,
|
|
2905
|
+
conditionalValues: EMPTY_KEYED_ROW_CONDITIONAL_VALUES
|
|
2906
|
+
});
|
|
2907
|
+
}
|
|
2908
|
+
} catch {
|
|
2909
|
+
return void 0;
|
|
2910
|
+
}
|
|
2911
|
+
if (prepended.length > 0) {
|
|
2912
|
+
const fragment = root.ownerDocument.createDocumentFragment();
|
|
2913
|
+
for (const instance of prepended) fragment.append(instance.element);
|
|
2914
|
+
root.insertBefore(fragment, root.firstChild);
|
|
2915
|
+
}
|
|
2916
|
+
for (let index = 0; index < previousInstances.length; index += 1) {
|
|
2917
|
+
previousInstances[index].index = prefixLength + index;
|
|
2918
|
+
}
|
|
2919
|
+
return new Map([...prepended, ...previousInstances].map((instance) => [instance.key, instance]));
|
|
2920
|
+
}
|
|
2921
|
+
function reconcileCompilerKeyedArrayFilter(props, dirtyState, collectionToken, instances, reactOwnedRows) {
|
|
2922
|
+
if (reactOwnedRows || props.hostBlocks || (props.conditionals?.length || 0) > 0 || !props.filterIndexIndependent || props.collectionDependency === void 0) {
|
|
2923
|
+
return void 0;
|
|
2924
|
+
}
|
|
2925
|
+
const collectionDependency = props.collectionDependency;
|
|
2926
|
+
if (props.bindings.some((binding) => binding.dependencies?.includes(collectionDependency))) {
|
|
2927
|
+
return void 0;
|
|
2928
|
+
}
|
|
2929
|
+
const dependencies = props.dependencies || props.structureDependencies;
|
|
2930
|
+
const relevantDirty = (dependencies || []).filter((index) => dirtyState.has(index));
|
|
2931
|
+
if (relevantDirty.length !== 1 || relevantDirty[0] !== collectionDependency) {
|
|
2932
|
+
return void 0;
|
|
2933
|
+
}
|
|
2934
|
+
const finalValue = props.items();
|
|
2935
|
+
const survivorResult = compilerKeyedArrayFilterSurvivors(
|
|
2936
|
+
finalValue,
|
|
2937
|
+
collectionToken,
|
|
2938
|
+
instances.size
|
|
2939
|
+
);
|
|
2940
|
+
if (!survivorResult || !Array.isArray(finalValue)) return void 0;
|
|
2941
|
+
const { indices: survivorIndices, keysStable } = survivorResult;
|
|
2942
|
+
const previousInstances = [...instances.values()];
|
|
2943
|
+
const survivors = [];
|
|
2944
|
+
try {
|
|
2945
|
+
for (let index = 0; index < survivorIndices.length; index += 1) {
|
|
2946
|
+
const sourceIndex = survivorIndices[index];
|
|
2947
|
+
const instance = previousInstances[sourceIndex];
|
|
2948
|
+
const item = finalValue[index];
|
|
2949
|
+
if (!instance || instance.index !== sourceIndex || !Object.is(instance.item, item) || !keysStable && keyedRowIdentity(props.rowKey(item, index)) !== instance.key) {
|
|
2950
|
+
return void 0;
|
|
2951
|
+
}
|
|
2952
|
+
survivors.push(instance);
|
|
2953
|
+
}
|
|
2954
|
+
} catch {
|
|
2955
|
+
return void 0;
|
|
2956
|
+
}
|
|
2957
|
+
const survivorSet = new Set(survivorIndices);
|
|
2958
|
+
for (let index = 0; index < previousInstances.length; index += 1) {
|
|
2959
|
+
if (survivorSet.has(index)) continue;
|
|
2960
|
+
previousInstances[index].scope?.cleanup();
|
|
2961
|
+
previousInstances[index].element.remove();
|
|
2962
|
+
}
|
|
2963
|
+
for (let index = 0; index < survivors.length; index += 1) {
|
|
2964
|
+
survivors[index].index = index;
|
|
2965
|
+
}
|
|
2966
|
+
return new Map(survivors.map((instance) => [instance.key, instance]));
|
|
2967
|
+
}
|
|
1886
2968
|
function createKeyedRowConditionalRuntime() {
|
|
1887
2969
|
class FarmKeyedRowConditional extends React__default.default.Component {
|
|
1888
2970
|
constructor() {
|
|
@@ -1953,6 +3035,9 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
1953
3035
|
this.propSyncQueued = false;
|
|
1954
3036
|
this.currentProps = this.props;
|
|
1955
3037
|
this.instances = /* @__PURE__ */ new Map();
|
|
3038
|
+
this.identityTargets = /* @__PURE__ */ new Map();
|
|
3039
|
+
this.membershipTargets = /* @__PURE__ */ new Map();
|
|
3040
|
+
this.mapLookupTargets = /* @__PURE__ */ new Map();
|
|
1956
3041
|
this.renderVersion = 0;
|
|
1957
3042
|
this.eventHandlers = /* @__PURE__ */ new Map();
|
|
1958
3043
|
this.conditionalListeners = /* @__PURE__ */ new Map();
|
|
@@ -2027,8 +3112,123 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2027
3112
|
});
|
|
2028
3113
|
};
|
|
2029
3114
|
this.refresh = (afterCommit, dirtyState) => {
|
|
3115
|
+
if (dirtyState && options.keyedUpdates && this.mounted && this.root && !this.state.fallback) {
|
|
3116
|
+
const result = options.keyedUpdates.reconcile(
|
|
3117
|
+
this.currentProps,
|
|
3118
|
+
dirtyState,
|
|
3119
|
+
this.collectionToken,
|
|
3120
|
+
this.instances,
|
|
3121
|
+
options.conditionals
|
|
3122
|
+
);
|
|
3123
|
+
if (result) {
|
|
3124
|
+
if (result.fallback) this.activateFallback(afterCommit);
|
|
3125
|
+
else {
|
|
3126
|
+
this.collectionToken = result.collectionToken;
|
|
3127
|
+
this.notifyConditionalChanges(result.conditionalChanges, afterCommit);
|
|
3128
|
+
}
|
|
3129
|
+
return;
|
|
3130
|
+
}
|
|
3131
|
+
const appendedInstances = options.keyedUpdates.append(
|
|
3132
|
+
this.currentProps,
|
|
3133
|
+
dirtyState,
|
|
3134
|
+
this.collectionToken,
|
|
3135
|
+
this.instances,
|
|
3136
|
+
this.root,
|
|
3137
|
+
this.hasReactOwnedRows()
|
|
3138
|
+
);
|
|
3139
|
+
if (appendedInstances) {
|
|
3140
|
+
this.instances = new Map(appendedInstances);
|
|
3141
|
+
this.rebuildElementIndex(this.instances);
|
|
3142
|
+
this.commitCurrentCollection(dirtyState);
|
|
3143
|
+
afterCommit?.();
|
|
3144
|
+
return;
|
|
3145
|
+
}
|
|
3146
|
+
const positionedInstances = options.keyedUpdates.position?.(
|
|
3147
|
+
this.currentProps,
|
|
3148
|
+
dirtyState,
|
|
3149
|
+
this.collectionToken,
|
|
3150
|
+
this.instances,
|
|
3151
|
+
this.root,
|
|
3152
|
+
this.hasReactOwnedRows()
|
|
3153
|
+
);
|
|
3154
|
+
if (positionedInstances) {
|
|
3155
|
+
this.instances = new Map(positionedInstances);
|
|
3156
|
+
this.rebuildElementIndex(this.instances);
|
|
3157
|
+
const keys = [...this.instances.keys()];
|
|
3158
|
+
this.pruneEventHandlers(keys);
|
|
3159
|
+
this.pruneConditionalListeners(keys);
|
|
3160
|
+
this.commitCurrentCollection(dirtyState);
|
|
3161
|
+
afterCommit?.();
|
|
3162
|
+
return;
|
|
3163
|
+
}
|
|
3164
|
+
const reorderedInstances = options.keyedUpdates.reorder?.(
|
|
3165
|
+
this.currentProps,
|
|
3166
|
+
dirtyState,
|
|
3167
|
+
this.collectionToken,
|
|
3168
|
+
this.instances,
|
|
3169
|
+
this.root,
|
|
3170
|
+
this.hasReactOwnedRows()
|
|
3171
|
+
);
|
|
3172
|
+
if (reorderedInstances) {
|
|
3173
|
+
this.instances = new Map(reorderedInstances);
|
|
3174
|
+
this.rebuildElementIndex(this.instances);
|
|
3175
|
+
this.commitCurrentCollection(dirtyState);
|
|
3176
|
+
afterCommit?.();
|
|
3177
|
+
return;
|
|
3178
|
+
}
|
|
3179
|
+
const rollingWindowInstances = options.keyedUpdates.rollingWindow?.(
|
|
3180
|
+
this.currentProps,
|
|
3181
|
+
dirtyState,
|
|
3182
|
+
this.collectionToken,
|
|
3183
|
+
this.instances,
|
|
3184
|
+
this.root,
|
|
3185
|
+
this.hasReactOwnedRows()
|
|
3186
|
+
);
|
|
3187
|
+
if (rollingWindowInstances) {
|
|
3188
|
+
this.instances = new Map(rollingWindowInstances);
|
|
3189
|
+
this.rebuildElementIndex(this.instances);
|
|
3190
|
+
const keys = [...this.instances.keys()];
|
|
3191
|
+
this.pruneEventHandlers(keys);
|
|
3192
|
+
this.pruneConditionalListeners(keys);
|
|
3193
|
+
this.commitCurrentCollection(dirtyState);
|
|
3194
|
+
afterCommit?.();
|
|
3195
|
+
return;
|
|
3196
|
+
}
|
|
3197
|
+
const filteredInstances = options.keyedUpdates.filter?.(
|
|
3198
|
+
this.currentProps,
|
|
3199
|
+
dirtyState,
|
|
3200
|
+
this.collectionToken,
|
|
3201
|
+
this.instances,
|
|
3202
|
+
this.hasReactOwnedRows()
|
|
3203
|
+
);
|
|
3204
|
+
if (filteredInstances) {
|
|
3205
|
+
this.instances = new Map(filteredInstances);
|
|
3206
|
+
this.rebuildElementIndex(this.instances);
|
|
3207
|
+
const keys = [...this.instances.keys()];
|
|
3208
|
+
this.pruneEventHandlers(keys);
|
|
3209
|
+
this.pruneConditionalListeners(keys);
|
|
3210
|
+
this.commitCurrentCollection(dirtyState);
|
|
3211
|
+
afterCommit?.();
|
|
3212
|
+
return;
|
|
3213
|
+
}
|
|
3214
|
+
const prependedInstances = options.keyedUpdates.prepend?.(
|
|
3215
|
+
this.currentProps,
|
|
3216
|
+
dirtyState,
|
|
3217
|
+
this.collectionToken,
|
|
3218
|
+
this.instances,
|
|
3219
|
+
this.root,
|
|
3220
|
+
this.hasReactOwnedRows()
|
|
3221
|
+
);
|
|
3222
|
+
if (prependedInstances) {
|
|
3223
|
+
this.instances = new Map(prependedInstances);
|
|
3224
|
+
this.rebuildElementIndex(this.instances);
|
|
3225
|
+
this.commitCurrentCollection(dirtyState);
|
|
3226
|
+
afterCommit?.();
|
|
3227
|
+
return;
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
2030
3230
|
if (dirtyState && this.refreshDirtyBindings(dirtyState, afterCommit)) return;
|
|
2031
|
-
this.reconcile(afterCommit);
|
|
3231
|
+
this.reconcile(afterCommit, dirtyState);
|
|
2032
3232
|
};
|
|
2033
3233
|
}
|
|
2034
3234
|
readRows(props) {
|
|
@@ -2126,8 +3326,66 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2126
3326
|
if (!active.has(key)) this.conditionalListeners.delete(key);
|
|
2127
3327
|
}
|
|
2128
3328
|
}
|
|
3329
|
+
commitCurrentCollection(dirtyState) {
|
|
3330
|
+
this.collectionToken = options.keyedUpdates?.commit(this.currentProps.items());
|
|
3331
|
+
this.commitKeyedTargets(dirtyState);
|
|
3332
|
+
}
|
|
3333
|
+
hasSafeMembershipTargets(dirtyState) {
|
|
3334
|
+
for (const binding of this.currentProps.bindings) {
|
|
3335
|
+
const target = binding.membershipTarget;
|
|
3336
|
+
if (!target || dirtyState && !dirtyState.has(target.dependency)) continue;
|
|
3337
|
+
if (!keyedMembershipTargetSnapshot(target.read()).eligible) return false;
|
|
3338
|
+
}
|
|
3339
|
+
return true;
|
|
3340
|
+
}
|
|
3341
|
+
hasSafeMapLookupTargets(dirtyState) {
|
|
3342
|
+
for (const binding of this.currentProps.bindings) {
|
|
3343
|
+
const target = binding.mapLookupTarget;
|
|
3344
|
+
if (!target || dirtyState && !dirtyState.has(target.dependency)) continue;
|
|
3345
|
+
if (!keyedMapLookupTargetSnapshot(target.read()).eligible) return false;
|
|
3346
|
+
}
|
|
3347
|
+
return true;
|
|
3348
|
+
}
|
|
3349
|
+
commitKeyedTargets(dirtyState) {
|
|
3350
|
+
if (!dirtyState) {
|
|
3351
|
+
this.identityTargets.clear();
|
|
3352
|
+
this.membershipTargets.clear();
|
|
3353
|
+
this.mapLookupTargets.clear();
|
|
3354
|
+
}
|
|
3355
|
+
for (let bindingIndex = 0; bindingIndex < this.currentProps.bindings.length; bindingIndex += 1) {
|
|
3356
|
+
const binding = this.currentProps.bindings[bindingIndex];
|
|
3357
|
+
const identityTarget = binding.identityTarget;
|
|
3358
|
+
if (!identityTarget) {
|
|
3359
|
+
this.identityTargets.delete(bindingIndex);
|
|
3360
|
+
} else if (!dirtyState || dirtyState.has(identityTarget.dependency)) {
|
|
3361
|
+
this.identityTargets.set(
|
|
3362
|
+
bindingIndex,
|
|
3363
|
+
keyedIdentityTargetSnapshot(identityTarget.read())
|
|
3364
|
+
);
|
|
3365
|
+
}
|
|
3366
|
+
const membershipTarget = binding.membershipTarget;
|
|
3367
|
+
if (!membershipTarget) {
|
|
3368
|
+
this.membershipTargets.delete(bindingIndex);
|
|
3369
|
+
} else if (!dirtyState || dirtyState.has(membershipTarget.dependency)) {
|
|
3370
|
+
this.membershipTargets.set(
|
|
3371
|
+
bindingIndex,
|
|
3372
|
+
keyedMembershipTargetSnapshot(membershipTarget.read())
|
|
3373
|
+
);
|
|
3374
|
+
}
|
|
3375
|
+
const mapLookupTarget = binding.mapLookupTarget;
|
|
3376
|
+
if (!mapLookupTarget) {
|
|
3377
|
+
this.mapLookupTargets.delete(bindingIndex);
|
|
3378
|
+
} else if (!dirtyState || dirtyState.has(mapLookupTarget.dependency)) {
|
|
3379
|
+
this.mapLookupTargets.set(
|
|
3380
|
+
bindingIndex,
|
|
3381
|
+
keyedMapLookupTargetSnapshot(mapLookupTarget.read())
|
|
3382
|
+
);
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
2129
3386
|
adopt() {
|
|
2130
3387
|
if (!this.root) return false;
|
|
3388
|
+
if (!this.hasSafeMembershipTargets() || !this.hasSafeMapLookupTargets()) return false;
|
|
2131
3389
|
const rows = this.readRows(this.currentProps);
|
|
2132
3390
|
const elements = [...this.root.children];
|
|
2133
3391
|
if (!rows || rows.items.length !== elements.length) return false;
|
|
@@ -2169,6 +3427,7 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2169
3427
|
this.rebuildElementIndex(instances);
|
|
2170
3428
|
this.pruneEventHandlers(rows.keys);
|
|
2171
3429
|
this.pruneConditionalListeners(rows.keys);
|
|
3430
|
+
this.commitCurrentCollection();
|
|
2172
3431
|
return true;
|
|
2173
3432
|
}
|
|
2174
3433
|
hasUnsafeFallbackKeys() {
|
|
@@ -2231,21 +3490,132 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2231
3490
|
affectedBindingIndices.push(bindingIndex);
|
|
2232
3491
|
}
|
|
2233
3492
|
}
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
bindingIndex
|
|
3493
|
+
const nextIdentityTargets = /* @__PURE__ */ new Map();
|
|
3494
|
+
const nextMembershipTargets = /* @__PURE__ */ new Map();
|
|
3495
|
+
const nextMapLookupTargets = /* @__PURE__ */ new Map();
|
|
3496
|
+
for (const bindingIndex of affectedBindingIndices) {
|
|
3497
|
+
const binding = this.currentProps.bindings[bindingIndex];
|
|
3498
|
+
if (binding.identityTarget) {
|
|
3499
|
+
nextIdentityTargets.set(
|
|
3500
|
+
bindingIndex,
|
|
3501
|
+
keyedIdentityTargetSnapshot(binding.identityTarget.read())
|
|
3502
|
+
);
|
|
3503
|
+
}
|
|
3504
|
+
if (binding.membershipTarget) {
|
|
3505
|
+
const snapshot = keyedMembershipTargetSnapshot(
|
|
3506
|
+
binding.membershipTarget.read(),
|
|
3507
|
+
this.membershipTargets.get(bindingIndex)
|
|
3508
|
+
);
|
|
3509
|
+
if (!snapshot.eligible) {
|
|
3510
|
+
this.activateFallback(afterCommit);
|
|
3511
|
+
return true;
|
|
3512
|
+
}
|
|
3513
|
+
nextMembershipTargets.set(bindingIndex, snapshot);
|
|
3514
|
+
}
|
|
3515
|
+
if (binding.mapLookupTarget) {
|
|
3516
|
+
const snapshot = keyedMapLookupTargetSnapshot(
|
|
3517
|
+
binding.mapLookupTarget.read(),
|
|
3518
|
+
this.mapLookupTargets.get(bindingIndex)
|
|
2242
3519
|
);
|
|
3520
|
+
if (!snapshot.eligible) {
|
|
3521
|
+
this.activateFallback(afterCommit);
|
|
3522
|
+
return true;
|
|
3523
|
+
}
|
|
3524
|
+
nextMapLookupTargets.set(bindingIndex, snapshot);
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
for (const bindingIndex of affectedBindingIndices) {
|
|
3528
|
+
const binding = this.currentProps.bindings[bindingIndex];
|
|
3529
|
+
const identityTarget = binding.identityTarget;
|
|
3530
|
+
const previousIdentityTarget = this.identityTargets.get(bindingIndex);
|
|
3531
|
+
const nextIdentityTarget = nextIdentityTargets.get(bindingIndex);
|
|
3532
|
+
const canTargetIdentity = Boolean(
|
|
3533
|
+
identityTarget && binding.dependencies?.length === 1 && binding.dependencies[0] === identityTarget.dependency && dirtyState.has(identityTarget.dependency) && previousIdentityTarget?.eligible && nextIdentityTarget?.eligible
|
|
3534
|
+
);
|
|
3535
|
+
const membershipTarget = binding.membershipTarget;
|
|
3536
|
+
const previousMembershipTarget = this.membershipTargets.get(bindingIndex);
|
|
3537
|
+
const nextMembershipTarget = nextMembershipTargets.get(bindingIndex);
|
|
3538
|
+
const canTargetMembership = Boolean(
|
|
3539
|
+
membershipTarget && binding.dependencies?.length === 1 && binding.dependencies[0] === membershipTarget.dependency && dirtyState.has(membershipTarget.dependency) && previousMembershipTarget?.eligible && nextMembershipTarget?.eligible
|
|
3540
|
+
);
|
|
3541
|
+
const mapLookupTarget = binding.mapLookupTarget;
|
|
3542
|
+
const previousMapLookupTarget = this.mapLookupTargets.get(bindingIndex);
|
|
3543
|
+
const nextMapLookupTarget = nextMapLookupTargets.get(bindingIndex);
|
|
3544
|
+
const canTargetMapLookup = Boolean(
|
|
3545
|
+
mapLookupTarget && binding.dependencies?.length === 1 && binding.dependencies[0] === mapLookupTarget.dependency && dirtyState.has(mapLookupTarget.dependency) && previousMapLookupTarget?.eligible && nextMapLookupTarget?.eligible
|
|
3546
|
+
);
|
|
3547
|
+
if (canTargetMapLookup && previousMapLookupTarget && nextMapLookupTarget) {
|
|
3548
|
+
const keys = keyedMapLookupChangedKeys(previousMapLookupTarget, nextMapLookupTarget);
|
|
3549
|
+
for (const key of keys) {
|
|
3550
|
+
const instance = this.instances.get(key);
|
|
3551
|
+
if (instance) {
|
|
3552
|
+
applyKeyedRowBinding(
|
|
3553
|
+
this.currentProps,
|
|
3554
|
+
instance,
|
|
3555
|
+
instance.item,
|
|
3556
|
+
instance.index,
|
|
3557
|
+
bindingIndex
|
|
3558
|
+
);
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
} else if (canTargetMembership && previousMembershipTarget && nextMembershipTarget) {
|
|
3562
|
+
const keys = keyedMembershipChangedKeys(previousMembershipTarget, nextMembershipTarget);
|
|
3563
|
+
for (const key of keys) {
|
|
3564
|
+
const instance = this.instances.get(key);
|
|
3565
|
+
if (instance) {
|
|
3566
|
+
applyKeyedRowBinding(
|
|
3567
|
+
this.currentProps,
|
|
3568
|
+
instance,
|
|
3569
|
+
instance.item,
|
|
3570
|
+
instance.index,
|
|
3571
|
+
bindingIndex
|
|
3572
|
+
);
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
} else if (canTargetIdentity && previousIdentityTarget && nextIdentityTarget) {
|
|
3576
|
+
const keys = /* @__PURE__ */ new Set();
|
|
3577
|
+
if (previousIdentityTarget.key !== void 0) keys.add(previousIdentityTarget.key);
|
|
3578
|
+
if (nextIdentityTarget.key !== void 0) keys.add(nextIdentityTarget.key);
|
|
3579
|
+
for (const key of keys) {
|
|
3580
|
+
const instance = this.instances.get(key);
|
|
3581
|
+
if (instance) {
|
|
3582
|
+
applyKeyedRowBinding(
|
|
3583
|
+
this.currentProps,
|
|
3584
|
+
instance,
|
|
3585
|
+
instance.item,
|
|
3586
|
+
instance.index,
|
|
3587
|
+
bindingIndex
|
|
3588
|
+
);
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
} else {
|
|
3592
|
+
for (const instance of this.instances.values()) {
|
|
3593
|
+
applyKeyedRowBinding(
|
|
3594
|
+
this.currentProps,
|
|
3595
|
+
instance,
|
|
3596
|
+
instance.item,
|
|
3597
|
+
instance.index,
|
|
3598
|
+
bindingIndex
|
|
3599
|
+
);
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
if (nextIdentityTarget) this.identityTargets.set(bindingIndex, nextIdentityTarget);
|
|
3603
|
+
else this.identityTargets.delete(bindingIndex);
|
|
3604
|
+
if (nextMembershipTarget) {
|
|
3605
|
+
this.membershipTargets.set(bindingIndex, nextMembershipTarget);
|
|
3606
|
+
} else {
|
|
3607
|
+
this.membershipTargets.delete(bindingIndex);
|
|
3608
|
+
}
|
|
3609
|
+
if (nextMapLookupTarget) {
|
|
3610
|
+
this.mapLookupTargets.set(bindingIndex, nextMapLookupTarget);
|
|
3611
|
+
} else {
|
|
3612
|
+
this.mapLookupTargets.delete(bindingIndex);
|
|
2243
3613
|
}
|
|
2244
3614
|
}
|
|
2245
3615
|
afterCommit?.();
|
|
2246
3616
|
return true;
|
|
2247
3617
|
}
|
|
2248
|
-
reconcileStableRows(rows, afterCommit) {
|
|
3618
|
+
reconcileStableRows(rows, afterCommit, dirtyState) {
|
|
2249
3619
|
if (rows.keys.length !== this.instances.size) return false;
|
|
2250
3620
|
let index = 0;
|
|
2251
3621
|
for (const key of this.instances.keys()) {
|
|
@@ -2272,17 +3642,23 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2272
3642
|
);
|
|
2273
3643
|
for (const [id, values] of conditionalValues) {
|
|
2274
3644
|
if (options.conditionals?.changed(existing.conditionalValues.get(id), values)) {
|
|
2275
|
-
conditionalChanges.push({
|
|
3645
|
+
conditionalChanges.push({
|
|
3646
|
+
key,
|
|
3647
|
+
id,
|
|
3648
|
+
item: rows.items[index],
|
|
3649
|
+
index
|
|
3650
|
+
});
|
|
2276
3651
|
}
|
|
2277
3652
|
}
|
|
2278
3653
|
existing.conditionalValues = conditionalValues;
|
|
2279
3654
|
existing.item = rows.items[index];
|
|
2280
3655
|
existing.index = index;
|
|
2281
3656
|
}
|
|
3657
|
+
this.commitCurrentCollection(dirtyState);
|
|
2282
3658
|
this.notifyConditionalChanges(conditionalChanges, afterCommit);
|
|
2283
3659
|
return true;
|
|
2284
3660
|
}
|
|
2285
|
-
reconcileSingleRemoval(rows, afterCommit) {
|
|
3661
|
+
reconcileSingleRemoval(rows, afterCommit, dirtyState) {
|
|
2286
3662
|
if (this.hasReactOwnedRows() || rows.keys.length + 1 !== this.instances.size) return false;
|
|
2287
3663
|
const previousKeys = [...this.instances.keys()];
|
|
2288
3664
|
let removedIndex = 0;
|
|
@@ -2315,7 +3691,12 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2315
3691
|
);
|
|
2316
3692
|
for (const [id, values] of conditionalValues) {
|
|
2317
3693
|
if (options.conditionals?.changed(existing.conditionalValues.get(id), values)) {
|
|
2318
|
-
conditionalChanges.push({
|
|
3694
|
+
conditionalChanges.push({
|
|
3695
|
+
key,
|
|
3696
|
+
id,
|
|
3697
|
+
item: rows.items[index],
|
|
3698
|
+
index
|
|
3699
|
+
});
|
|
2319
3700
|
}
|
|
2320
3701
|
}
|
|
2321
3702
|
existing.conditionalValues = conditionalValues;
|
|
@@ -2327,10 +3708,11 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2327
3708
|
this.instances.delete(removedKey);
|
|
2328
3709
|
this.eventHandlers.delete(removedKey);
|
|
2329
3710
|
this.conditionalListeners.delete(removedKey);
|
|
3711
|
+
this.commitCurrentCollection(dirtyState);
|
|
2330
3712
|
this.notifyConditionalChanges(conditionalChanges, afterCommit);
|
|
2331
3713
|
return true;
|
|
2332
3714
|
}
|
|
2333
|
-
reconcile(afterCommit) {
|
|
3715
|
+
reconcile(afterCommit, dirtyState) {
|
|
2334
3716
|
if (!this.mounted || !this.root) {
|
|
2335
3717
|
afterCommit?.();
|
|
2336
3718
|
return;
|
|
@@ -2344,6 +3726,14 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2344
3726
|
this.forceUpdate(afterCommit);
|
|
2345
3727
|
return;
|
|
2346
3728
|
}
|
|
3729
|
+
if (!this.hasSafeMembershipTargets(dirtyState)) {
|
|
3730
|
+
this.activateFallback(afterCommit);
|
|
3731
|
+
return;
|
|
3732
|
+
}
|
|
3733
|
+
if (!this.hasSafeMapLookupTargets(dirtyState)) {
|
|
3734
|
+
this.activateFallback(afterCommit);
|
|
3735
|
+
return;
|
|
3736
|
+
}
|
|
2347
3737
|
const rows = this.readRows(this.currentProps);
|
|
2348
3738
|
if (!rows) {
|
|
2349
3739
|
this.activateFallback(afterCommit);
|
|
@@ -2363,11 +3753,12 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2363
3753
|
this.instancesByElement = /* @__PURE__ */ new WeakMap();
|
|
2364
3754
|
this.eventHandlers.clear();
|
|
2365
3755
|
this.conditionalListeners.clear();
|
|
3756
|
+
this.commitCurrentCollection(dirtyState);
|
|
2366
3757
|
afterCommit?.();
|
|
2367
3758
|
return;
|
|
2368
3759
|
}
|
|
2369
|
-
if (this.reconcileStableRows(rows, afterCommit)) return;
|
|
2370
|
-
if (this.reconcileSingleRemoval(rows, afterCommit)) return;
|
|
3760
|
+
if (this.reconcileStableRows(rows, afterCommit, dirtyState)) return;
|
|
3761
|
+
if (this.reconcileSingleRemoval(rows, afterCommit, dirtyState)) return;
|
|
2371
3762
|
const activeElement = this.root.ownerDocument.activeElement;
|
|
2372
3763
|
const restoreFocus = Boolean(activeElement && this.root.contains(activeElement));
|
|
2373
3764
|
const nextKeys = new Set(rows.keys);
|
|
@@ -2405,7 +3796,12 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2405
3796
|
);
|
|
2406
3797
|
for (const [id, values] of conditionalValues) {
|
|
2407
3798
|
if (options.conditionals?.changed(existing.conditionalValues.get(id), values)) {
|
|
2408
|
-
conditionalChanges.push({
|
|
3799
|
+
conditionalChanges.push({
|
|
3800
|
+
key,
|
|
3801
|
+
id,
|
|
3802
|
+
item: rows.items[index],
|
|
3803
|
+
index
|
|
3804
|
+
});
|
|
2409
3805
|
}
|
|
2410
3806
|
}
|
|
2411
3807
|
existing.conditionalValues = conditionalValues;
|
|
@@ -2471,6 +3867,7 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2471
3867
|
if (restoreFocus && activeElement?.isConnected && activeElement.ownerDocument.activeElement !== activeElement && "focus" in activeElement) {
|
|
2472
3868
|
activeElement.focus({ preventScroll: true });
|
|
2473
3869
|
}
|
|
3870
|
+
this.commitCurrentCollection(dirtyState);
|
|
2474
3871
|
this.notifyConditionalChanges(conditionalChanges, afterCommit);
|
|
2475
3872
|
}
|
|
2476
3873
|
schedulePropSync() {
|
|
@@ -2510,6 +3907,9 @@ function createKeyedRowsBlockComponent(owner, options = {}) {
|
|
|
2510
3907
|
this.root = null;
|
|
2511
3908
|
this.cleanupHostScopes();
|
|
2512
3909
|
this.instances.clear();
|
|
3910
|
+
this.identityTargets.clear();
|
|
3911
|
+
this.membershipTargets.clear();
|
|
3912
|
+
this.mapLookupTargets.clear();
|
|
2513
3913
|
this.instancesByElement = /* @__PURE__ */ new WeakMap();
|
|
2514
3914
|
this.eventHandlers.clear();
|
|
2515
3915
|
this.conditionalListeners.clear();
|
|
@@ -2940,6 +4340,70 @@ var keyedRowsRuntimeFeature = {
|
|
|
2940
4340
|
KeyedRows: createKeyedRowsBlockComponent(owner)
|
|
2941
4341
|
})
|
|
2942
4342
|
};
|
|
4343
|
+
var keyedRowsHintedRuntimeFeature = {
|
|
4344
|
+
name: "keyed-rows:hinted",
|
|
4345
|
+
create: (owner) => ({
|
|
4346
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4347
|
+
keyedUpdates: keyedUpdateRuntime
|
|
4348
|
+
})
|
|
4349
|
+
})
|
|
4350
|
+
};
|
|
4351
|
+
var keyedRowsPositionHintedRuntimeFeature = {
|
|
4352
|
+
name: "keyed-rows:position-hinted",
|
|
4353
|
+
create: (owner) => ({
|
|
4354
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4355
|
+
keyedUpdates: keyedPositionUpdateRuntime
|
|
4356
|
+
})
|
|
4357
|
+
})
|
|
4358
|
+
};
|
|
4359
|
+
var keyedRowsReorderHintedRuntimeFeature = {
|
|
4360
|
+
name: "keyed-rows:reorder-hinted",
|
|
4361
|
+
create: (owner) => ({
|
|
4362
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4363
|
+
keyedUpdates: keyedReorderUpdateRuntime
|
|
4364
|
+
})
|
|
4365
|
+
})
|
|
4366
|
+
};
|
|
4367
|
+
var keyedRowsAllHintedRuntimeFeature = {
|
|
4368
|
+
name: "keyed-rows:all-hinted",
|
|
4369
|
+
create: (owner) => ({
|
|
4370
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4371
|
+
keyedUpdates: keyedCompleteUpdateRuntime
|
|
4372
|
+
})
|
|
4373
|
+
})
|
|
4374
|
+
};
|
|
4375
|
+
var keyedRowsEveryHintedRuntimeFeature = {
|
|
4376
|
+
name: "keyed-rows:every-hinted",
|
|
4377
|
+
create: (owner) => ({
|
|
4378
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4379
|
+
keyedUpdates: keyedEveryUpdateRuntime
|
|
4380
|
+
})
|
|
4381
|
+
})
|
|
4382
|
+
};
|
|
4383
|
+
var keyedRowsFilterHintedRuntimeFeature = {
|
|
4384
|
+
name: "keyed-rows:filter-hinted",
|
|
4385
|
+
create: (owner) => ({
|
|
4386
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4387
|
+
keyedUpdates: keyedFilterUpdateRuntime
|
|
4388
|
+
})
|
|
4389
|
+
})
|
|
4390
|
+
};
|
|
4391
|
+
var keyedRowsPrependHintedRuntimeFeature = {
|
|
4392
|
+
name: "keyed-rows:prepend-hinted",
|
|
4393
|
+
create: (owner) => ({
|
|
4394
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4395
|
+
keyedUpdates: keyedPrependUpdateRuntime
|
|
4396
|
+
})
|
|
4397
|
+
})
|
|
4398
|
+
};
|
|
4399
|
+
var keyedRowsFilterPrependHintedRuntimeFeature = {
|
|
4400
|
+
name: "keyed-rows:filter-prepend-hinted",
|
|
4401
|
+
create: (owner) => ({
|
|
4402
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4403
|
+
keyedUpdates: keyedFilterPrependUpdateRuntime
|
|
4404
|
+
})
|
|
4405
|
+
})
|
|
4406
|
+
};
|
|
2943
4407
|
var keyedRowsConditionalRuntimeFeature = {
|
|
2944
4408
|
name: "keyed-rows:conditional",
|
|
2945
4409
|
create: (owner) => ({
|
|
@@ -2948,6 +4412,78 @@ var keyedRowsConditionalRuntimeFeature = {
|
|
|
2948
4412
|
})
|
|
2949
4413
|
})
|
|
2950
4414
|
};
|
|
4415
|
+
var keyedRowsConditionalHintedRuntimeFeature = {
|
|
4416
|
+
name: "keyed-rows:conditional:hinted",
|
|
4417
|
+
create: (owner) => ({
|
|
4418
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4419
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4420
|
+
keyedUpdates: keyedUpdateRuntime
|
|
4421
|
+
})
|
|
4422
|
+
})
|
|
4423
|
+
};
|
|
4424
|
+
var keyedRowsConditionalPositionHintedRuntimeFeature = {
|
|
4425
|
+
name: "keyed-rows:conditional:position-hinted",
|
|
4426
|
+
create: (owner) => ({
|
|
4427
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4428
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4429
|
+
keyedUpdates: keyedPositionUpdateRuntime
|
|
4430
|
+
})
|
|
4431
|
+
})
|
|
4432
|
+
};
|
|
4433
|
+
var keyedRowsConditionalReorderHintedRuntimeFeature = {
|
|
4434
|
+
name: "keyed-rows:conditional:reorder-hinted",
|
|
4435
|
+
create: (owner) => ({
|
|
4436
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4437
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4438
|
+
keyedUpdates: keyedReorderUpdateRuntime
|
|
4439
|
+
})
|
|
4440
|
+
})
|
|
4441
|
+
};
|
|
4442
|
+
var keyedRowsConditionalAllHintedRuntimeFeature = {
|
|
4443
|
+
name: "keyed-rows:conditional:all-hinted",
|
|
4444
|
+
create: (owner) => ({
|
|
4445
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4446
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4447
|
+
keyedUpdates: keyedCompleteUpdateRuntime
|
|
4448
|
+
})
|
|
4449
|
+
})
|
|
4450
|
+
};
|
|
4451
|
+
var keyedRowsConditionalEveryHintedRuntimeFeature = {
|
|
4452
|
+
name: "keyed-rows:conditional:every-hinted",
|
|
4453
|
+
create: (owner) => ({
|
|
4454
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4455
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4456
|
+
keyedUpdates: keyedEveryUpdateRuntime
|
|
4457
|
+
})
|
|
4458
|
+
})
|
|
4459
|
+
};
|
|
4460
|
+
var keyedRowsConditionalFilterHintedRuntimeFeature = {
|
|
4461
|
+
name: "keyed-rows:conditional:filter-hinted",
|
|
4462
|
+
create: (owner) => ({
|
|
4463
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4464
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4465
|
+
keyedUpdates: keyedFilterUpdateRuntime
|
|
4466
|
+
})
|
|
4467
|
+
})
|
|
4468
|
+
};
|
|
4469
|
+
var keyedRowsConditionalPrependHintedRuntimeFeature = {
|
|
4470
|
+
name: "keyed-rows:conditional:prepend-hinted",
|
|
4471
|
+
create: (owner) => ({
|
|
4472
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4473
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4474
|
+
keyedUpdates: keyedPrependUpdateRuntime
|
|
4475
|
+
})
|
|
4476
|
+
})
|
|
4477
|
+
};
|
|
4478
|
+
var keyedRowsConditionalFilterPrependHintedRuntimeFeature = {
|
|
4479
|
+
name: "keyed-rows:conditional:filter-prepend-hinted",
|
|
4480
|
+
create: (owner) => ({
|
|
4481
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4482
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4483
|
+
keyedUpdates: keyedFilterPrependUpdateRuntime
|
|
4484
|
+
})
|
|
4485
|
+
})
|
|
4486
|
+
};
|
|
2951
4487
|
var keyedRowsHostRuntimeFeature = {
|
|
2952
4488
|
name: "keyed-rows:host",
|
|
2953
4489
|
create: (owner) => ({
|
|
@@ -2956,6 +4492,78 @@ var keyedRowsHostRuntimeFeature = {
|
|
|
2956
4492
|
})
|
|
2957
4493
|
})
|
|
2958
4494
|
};
|
|
4495
|
+
var keyedRowsHostHintedRuntimeFeature = {
|
|
4496
|
+
name: "keyed-rows:host:hinted",
|
|
4497
|
+
create: (owner) => ({
|
|
4498
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4499
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4500
|
+
keyedUpdates: keyedUpdateRuntime
|
|
4501
|
+
})
|
|
4502
|
+
})
|
|
4503
|
+
};
|
|
4504
|
+
var keyedRowsHostPositionHintedRuntimeFeature = {
|
|
4505
|
+
name: "keyed-rows:host:position-hinted",
|
|
4506
|
+
create: (owner) => ({
|
|
4507
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4508
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4509
|
+
keyedUpdates: keyedPositionUpdateRuntime
|
|
4510
|
+
})
|
|
4511
|
+
})
|
|
4512
|
+
};
|
|
4513
|
+
var keyedRowsHostReorderHintedRuntimeFeature = {
|
|
4514
|
+
name: "keyed-rows:host:reorder-hinted",
|
|
4515
|
+
create: (owner) => ({
|
|
4516
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4517
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4518
|
+
keyedUpdates: keyedReorderUpdateRuntime
|
|
4519
|
+
})
|
|
4520
|
+
})
|
|
4521
|
+
};
|
|
4522
|
+
var keyedRowsHostAllHintedRuntimeFeature = {
|
|
4523
|
+
name: "keyed-rows:host:all-hinted",
|
|
4524
|
+
create: (owner) => ({
|
|
4525
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4526
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4527
|
+
keyedUpdates: keyedCompleteUpdateRuntime
|
|
4528
|
+
})
|
|
4529
|
+
})
|
|
4530
|
+
};
|
|
4531
|
+
var keyedRowsHostEveryHintedRuntimeFeature = {
|
|
4532
|
+
name: "keyed-rows:host:every-hinted",
|
|
4533
|
+
create: (owner) => ({
|
|
4534
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4535
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4536
|
+
keyedUpdates: keyedEveryUpdateRuntime
|
|
4537
|
+
})
|
|
4538
|
+
})
|
|
4539
|
+
};
|
|
4540
|
+
var keyedRowsHostFilterHintedRuntimeFeature = {
|
|
4541
|
+
name: "keyed-rows:host:filter-hinted",
|
|
4542
|
+
create: (owner) => ({
|
|
4543
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4544
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4545
|
+
keyedUpdates: keyedFilterUpdateRuntime
|
|
4546
|
+
})
|
|
4547
|
+
})
|
|
4548
|
+
};
|
|
4549
|
+
var keyedRowsHostPrependHintedRuntimeFeature = {
|
|
4550
|
+
name: "keyed-rows:host:prepend-hinted",
|
|
4551
|
+
create: (owner) => ({
|
|
4552
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4553
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4554
|
+
keyedUpdates: keyedPrependUpdateRuntime
|
|
4555
|
+
})
|
|
4556
|
+
})
|
|
4557
|
+
};
|
|
4558
|
+
var keyedRowsHostFilterPrependHintedRuntimeFeature = {
|
|
4559
|
+
name: "keyed-rows:host:filter-prepend-hinted",
|
|
4560
|
+
create: (owner) => ({
|
|
4561
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4562
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4563
|
+
keyedUpdates: keyedFilterPrependUpdateRuntime
|
|
4564
|
+
})
|
|
4565
|
+
})
|
|
4566
|
+
};
|
|
2959
4567
|
var keyedRowsCompleteRuntimeFeature = {
|
|
2960
4568
|
name: "keyed-rows:complete",
|
|
2961
4569
|
create: (owner) => ({
|
|
@@ -2965,6 +4573,86 @@ var keyedRowsCompleteRuntimeFeature = {
|
|
|
2965
4573
|
})
|
|
2966
4574
|
})
|
|
2967
4575
|
};
|
|
4576
|
+
var keyedRowsCompleteHintedRuntimeFeature = {
|
|
4577
|
+
name: "keyed-rows:complete:hinted",
|
|
4578
|
+
create: (owner) => ({
|
|
4579
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4580
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4581
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4582
|
+
keyedUpdates: keyedUpdateRuntime
|
|
4583
|
+
})
|
|
4584
|
+
})
|
|
4585
|
+
};
|
|
4586
|
+
var keyedRowsCompletePositionHintedRuntimeFeature = {
|
|
4587
|
+
name: "keyed-rows:complete:position-hinted",
|
|
4588
|
+
create: (owner) => ({
|
|
4589
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4590
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4591
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4592
|
+
keyedUpdates: keyedPositionUpdateRuntime
|
|
4593
|
+
})
|
|
4594
|
+
})
|
|
4595
|
+
};
|
|
4596
|
+
var keyedRowsCompleteReorderHintedRuntimeFeature = {
|
|
4597
|
+
name: "keyed-rows:complete:reorder-hinted",
|
|
4598
|
+
create: (owner) => ({
|
|
4599
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4600
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4601
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4602
|
+
keyedUpdates: keyedReorderUpdateRuntime
|
|
4603
|
+
})
|
|
4604
|
+
})
|
|
4605
|
+
};
|
|
4606
|
+
var keyedRowsCompleteAllHintedRuntimeFeature = {
|
|
4607
|
+
name: "keyed-rows:complete:all-hinted",
|
|
4608
|
+
create: (owner) => ({
|
|
4609
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4610
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4611
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4612
|
+
keyedUpdates: keyedCompleteUpdateRuntime
|
|
4613
|
+
})
|
|
4614
|
+
})
|
|
4615
|
+
};
|
|
4616
|
+
var keyedRowsCompleteEveryHintedRuntimeFeature = {
|
|
4617
|
+
name: "keyed-rows:complete:every-hinted",
|
|
4618
|
+
create: (owner) => ({
|
|
4619
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4620
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4621
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4622
|
+
keyedUpdates: keyedEveryUpdateRuntime
|
|
4623
|
+
})
|
|
4624
|
+
})
|
|
4625
|
+
};
|
|
4626
|
+
var keyedRowsCompleteFilterHintedRuntimeFeature = {
|
|
4627
|
+
name: "keyed-rows:complete:filter-hinted",
|
|
4628
|
+
create: (owner) => ({
|
|
4629
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4630
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4631
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4632
|
+
keyedUpdates: keyedFilterUpdateRuntime
|
|
4633
|
+
})
|
|
4634
|
+
})
|
|
4635
|
+
};
|
|
4636
|
+
var keyedRowsCompletePrependHintedRuntimeFeature = {
|
|
4637
|
+
name: "keyed-rows:complete:prepend-hinted",
|
|
4638
|
+
create: (owner) => ({
|
|
4639
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4640
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4641
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4642
|
+
keyedUpdates: keyedPrependUpdateRuntime
|
|
4643
|
+
})
|
|
4644
|
+
})
|
|
4645
|
+
};
|
|
4646
|
+
var keyedRowsCompleteFilterPrependHintedRuntimeFeature = {
|
|
4647
|
+
name: "keyed-rows:complete:filter-prepend-hinted",
|
|
4648
|
+
create: (owner) => ({
|
|
4649
|
+
KeyedRows: createKeyedRowsBlockComponent(owner, {
|
|
4650
|
+
conditionals: createKeyedRowConditionalRuntime(),
|
|
4651
|
+
hostBlocks: createKeyedRowHostRuntime(),
|
|
4652
|
+
keyedUpdates: keyedFilterPrependUpdateRuntime
|
|
4653
|
+
})
|
|
4654
|
+
})
|
|
4655
|
+
};
|
|
2968
4656
|
var keyedRangesRuntimeFeature = {
|
|
2969
4657
|
name: "keyed-ranges",
|
|
2970
4658
|
create: (owner) => ({
|
|
@@ -2996,7 +4684,9 @@ function createCompiledComponentWithFeatures(definition, runtimeFeatures) {
|
|
|
2996
4684
|
return existing.component;
|
|
2997
4685
|
}
|
|
2998
4686
|
}
|
|
2999
|
-
const definitionReference = {
|
|
4687
|
+
const definitionReference = {
|
|
4688
|
+
current: definition
|
|
4689
|
+
};
|
|
3000
4690
|
const refreshListeners = /* @__PURE__ */ new Set();
|
|
3001
4691
|
class FarmCompiledComponent extends React__default.default.Component {
|
|
3002
4692
|
constructor(props) {
|
|
@@ -3435,7 +5125,7 @@ var COMPLETE_RUNTIME_FEATURES = [
|
|
|
3435
5125
|
hostConditionalRuntimeFeature,
|
|
3436
5126
|
conditionalRangesRuntimeFeature,
|
|
3437
5127
|
keyedListRuntimeFeature,
|
|
3438
|
-
|
|
5128
|
+
keyedRowsCompleteEveryHintedRuntimeFeature,
|
|
3439
5129
|
keyedRangesRuntimeFeature,
|
|
3440
5130
|
mixedRangesRuntimeFeature,
|
|
3441
5131
|
componentRuntimeFeature
|
|
@@ -3444,17 +5134,59 @@ function createCompiledComponent(definition) {
|
|
|
3444
5134
|
return createCompiledComponentWithFeatures(definition, COMPLETE_RUNTIME_FEATURES);
|
|
3445
5135
|
}
|
|
3446
5136
|
|
|
5137
|
+
exports.applyCompilerKeyedCollectionMutation = applyCompilerKeyedCollectionMutation;
|
|
3447
5138
|
exports.componentRuntimeFeature = componentRuntimeFeature;
|
|
3448
5139
|
exports.conditionalRangesRuntimeFeature = conditionalRangesRuntimeFeature;
|
|
3449
5140
|
exports.conditionalRuntimeFeature = conditionalRuntimeFeature;
|
|
3450
5141
|
exports.createCompiledComponent = createCompiledComponent;
|
|
3451
5142
|
exports.createCompiledComponentWithFeatures = createCompiledComponentWithFeatures;
|
|
5143
|
+
exports.createCompilerKeyedArrayAppend = createCompilerKeyedArrayAppend;
|
|
5144
|
+
exports.createCompilerKeyedArrayFilter = createCompilerKeyedArrayFilter;
|
|
5145
|
+
exports.createCompilerKeyedArrayPositionUpdate = createCompilerKeyedArrayPositionUpdate;
|
|
5146
|
+
exports.createCompilerKeyedArrayPrepend = createCompilerKeyedArrayPrepend;
|
|
5147
|
+
exports.createCompilerKeyedArrayReorder = createCompilerKeyedArrayReorder;
|
|
5148
|
+
exports.createCompilerKeyedArrayRollingWindow = createCompilerKeyedArrayRollingWindow;
|
|
5149
|
+
exports.createCompilerKeyedArraySlice = createCompilerKeyedArraySlice;
|
|
5150
|
+
exports.createCompilerKeyedCollectionUpdate = createCompilerKeyedCollectionUpdate;
|
|
5151
|
+
exports.createCompilerKeyedMapUpdate = createCompilerKeyedMapUpdate;
|
|
3452
5152
|
exports.hostConditionalRuntimeFeature = hostConditionalRuntimeFeature;
|
|
3453
5153
|
exports.keyedListRuntimeFeature = keyedListRuntimeFeature;
|
|
3454
5154
|
exports.keyedRangesRuntimeFeature = keyedRangesRuntimeFeature;
|
|
5155
|
+
exports.keyedRowsAllHintedRuntimeFeature = keyedRowsAllHintedRuntimeFeature;
|
|
5156
|
+
exports.keyedRowsCompleteAllHintedRuntimeFeature = keyedRowsCompleteAllHintedRuntimeFeature;
|
|
5157
|
+
exports.keyedRowsCompleteEveryHintedRuntimeFeature = keyedRowsCompleteEveryHintedRuntimeFeature;
|
|
5158
|
+
exports.keyedRowsCompleteFilterHintedRuntimeFeature = keyedRowsCompleteFilterHintedRuntimeFeature;
|
|
5159
|
+
exports.keyedRowsCompleteFilterPrependHintedRuntimeFeature = keyedRowsCompleteFilterPrependHintedRuntimeFeature;
|
|
5160
|
+
exports.keyedRowsCompleteHintedRuntimeFeature = keyedRowsCompleteHintedRuntimeFeature;
|
|
5161
|
+
exports.keyedRowsCompletePositionHintedRuntimeFeature = keyedRowsCompletePositionHintedRuntimeFeature;
|
|
5162
|
+
exports.keyedRowsCompletePrependHintedRuntimeFeature = keyedRowsCompletePrependHintedRuntimeFeature;
|
|
5163
|
+
exports.keyedRowsCompleteReorderHintedRuntimeFeature = keyedRowsCompleteReorderHintedRuntimeFeature;
|
|
3455
5164
|
exports.keyedRowsCompleteRuntimeFeature = keyedRowsCompleteRuntimeFeature;
|
|
5165
|
+
exports.keyedRowsConditionalAllHintedRuntimeFeature = keyedRowsConditionalAllHintedRuntimeFeature;
|
|
5166
|
+
exports.keyedRowsConditionalEveryHintedRuntimeFeature = keyedRowsConditionalEveryHintedRuntimeFeature;
|
|
5167
|
+
exports.keyedRowsConditionalFilterHintedRuntimeFeature = keyedRowsConditionalFilterHintedRuntimeFeature;
|
|
5168
|
+
exports.keyedRowsConditionalFilterPrependHintedRuntimeFeature = keyedRowsConditionalFilterPrependHintedRuntimeFeature;
|
|
5169
|
+
exports.keyedRowsConditionalHintedRuntimeFeature = keyedRowsConditionalHintedRuntimeFeature;
|
|
5170
|
+
exports.keyedRowsConditionalPositionHintedRuntimeFeature = keyedRowsConditionalPositionHintedRuntimeFeature;
|
|
5171
|
+
exports.keyedRowsConditionalPrependHintedRuntimeFeature = keyedRowsConditionalPrependHintedRuntimeFeature;
|
|
5172
|
+
exports.keyedRowsConditionalReorderHintedRuntimeFeature = keyedRowsConditionalReorderHintedRuntimeFeature;
|
|
3456
5173
|
exports.keyedRowsConditionalRuntimeFeature = keyedRowsConditionalRuntimeFeature;
|
|
5174
|
+
exports.keyedRowsEveryHintedRuntimeFeature = keyedRowsEveryHintedRuntimeFeature;
|
|
5175
|
+
exports.keyedRowsFilterHintedRuntimeFeature = keyedRowsFilterHintedRuntimeFeature;
|
|
5176
|
+
exports.keyedRowsFilterPrependHintedRuntimeFeature = keyedRowsFilterPrependHintedRuntimeFeature;
|
|
5177
|
+
exports.keyedRowsHintedRuntimeFeature = keyedRowsHintedRuntimeFeature;
|
|
5178
|
+
exports.keyedRowsHostAllHintedRuntimeFeature = keyedRowsHostAllHintedRuntimeFeature;
|
|
5179
|
+
exports.keyedRowsHostEveryHintedRuntimeFeature = keyedRowsHostEveryHintedRuntimeFeature;
|
|
5180
|
+
exports.keyedRowsHostFilterHintedRuntimeFeature = keyedRowsHostFilterHintedRuntimeFeature;
|
|
5181
|
+
exports.keyedRowsHostFilterPrependHintedRuntimeFeature = keyedRowsHostFilterPrependHintedRuntimeFeature;
|
|
5182
|
+
exports.keyedRowsHostHintedRuntimeFeature = keyedRowsHostHintedRuntimeFeature;
|
|
5183
|
+
exports.keyedRowsHostPositionHintedRuntimeFeature = keyedRowsHostPositionHintedRuntimeFeature;
|
|
5184
|
+
exports.keyedRowsHostPrependHintedRuntimeFeature = keyedRowsHostPrependHintedRuntimeFeature;
|
|
5185
|
+
exports.keyedRowsHostReorderHintedRuntimeFeature = keyedRowsHostReorderHintedRuntimeFeature;
|
|
3457
5186
|
exports.keyedRowsHostRuntimeFeature = keyedRowsHostRuntimeFeature;
|
|
5187
|
+
exports.keyedRowsPositionHintedRuntimeFeature = keyedRowsPositionHintedRuntimeFeature;
|
|
5188
|
+
exports.keyedRowsPrependHintedRuntimeFeature = keyedRowsPrependHintedRuntimeFeature;
|
|
5189
|
+
exports.keyedRowsReorderHintedRuntimeFeature = keyedRowsReorderHintedRuntimeFeature;
|
|
3458
5190
|
exports.keyedRowsRuntimeFeature = keyedRowsRuntimeFeature;
|
|
3459
5191
|
exports.mixedRangesRuntimeFeature = mixedRangesRuntimeFeature;
|
|
3460
5192
|
//# sourceMappingURL=compiler-runtime.cjs.map
|