marko 6.0.101 → 6.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/accessor.d.ts +37 -22
- package/dist/common/accessor.debug.d.ts +18 -3
- package/dist/common/errors.d.ts +4 -0
- package/dist/common/helpers.d.ts +1 -0
- package/dist/common/meta.d.ts +1 -0
- package/dist/common/types.d.ts +20 -17
- package/dist/debug/dom.js +253 -141
- package/dist/debug/dom.mjs +253 -141
- package/dist/debug/html.js +65 -4
- package/dist/debug/html.mjs +65 -4
- package/dist/dom/abort-signal.d.ts +1 -1
- package/dist/dom/control-flow.d.ts +7 -6
- package/dist/dom/queue.d.ts +1 -1
- package/dist/dom/reconcile.d.ts +1 -1
- package/dist/dom/renderer.d.ts +3 -3
- package/dist/dom/resume.d.ts +3 -3
- package/dist/dom/scope.d.ts +2 -2
- package/dist/dom/signals.d.ts +8 -8
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +250 -204
- package/dist/dom.mjs +250 -204
- package/dist/html/writer.d.ts +1 -1
- package/dist/html.js +32 -31
- package/dist/html.mjs +32 -31
- package/dist/translator/index.js +281 -209
- package/dist/translator/util/references.d.ts +2 -2
- package/dist/translator/util/scope-read.d.ts +1 -1
- package/dist/translator/util/signals.d.ts +0 -1
- package/dist/translator/util/tag-name-type.d.ts +1 -1
- package/package.json +1 -1
package/dist/dom.js
CHANGED
|
@@ -76,6 +76,7 @@ __export(dom_exports, {
|
|
|
76
76
|
_on: () => _on,
|
|
77
77
|
_or: () => _or,
|
|
78
78
|
_resume: () => _resume,
|
|
79
|
+
_resume_dynamic_tag: () => _resume_dynamic_tag,
|
|
79
80
|
_return: () => _return,
|
|
80
81
|
_return_change: () => _return_change,
|
|
81
82
|
_script: () => _script,
|
|
@@ -176,10 +177,11 @@ function normalizeDynamicRenderer(value) {
|
|
|
176
177
|
if (value) {
|
|
177
178
|
if (typeof value == "string") return value;
|
|
178
179
|
let normalized = value.content || value.default || value;
|
|
179
|
-
if (/* @__KEY__ */ "
|
|
180
|
+
if (/* @__KEY__ */ "f" in normalized)
|
|
180
181
|
return normalized;
|
|
181
182
|
}
|
|
182
183
|
}
|
|
184
|
+
var decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36);
|
|
183
185
|
|
|
184
186
|
// src/dom/event.ts
|
|
185
187
|
var defaultDelegator = createDelegator();
|
|
@@ -229,10 +231,10 @@ function stripSpacesAndPunctuation(str) {
|
|
|
229
231
|
var nextScopeId = 1e6;
|
|
230
232
|
function createScope($global, closestBranch) {
|
|
231
233
|
let scope = {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
$global
|
|
234
|
+
M: nextScopeId++,
|
|
235
|
+
I: 1,
|
|
236
|
+
G: closestBranch,
|
|
237
|
+
$: $global
|
|
236
238
|
};
|
|
237
239
|
return pendingScopes.push(scope), scope;
|
|
238
240
|
}
|
|
@@ -240,34 +242,44 @@ function skipScope() {
|
|
|
240
242
|
return nextScopeId++;
|
|
241
243
|
}
|
|
242
244
|
function findBranchWithKey(scope, key) {
|
|
243
|
-
let branch = scope.
|
|
245
|
+
let branch = scope.G;
|
|
244
246
|
for (; branch && !branch[key]; )
|
|
245
|
-
branch = branch.
|
|
247
|
+
branch = branch.N;
|
|
246
248
|
return branch;
|
|
247
249
|
}
|
|
248
250
|
function destroyBranch(branch) {
|
|
249
|
-
branch.
|
|
251
|
+
branch.N?.E?.delete(
|
|
252
|
+
branch
|
|
253
|
+
), destroyNestedBranches(branch);
|
|
250
254
|
}
|
|
251
255
|
function destroyNestedBranches(branch) {
|
|
252
|
-
branch.
|
|
256
|
+
branch.J = 1, branch.E?.forEach(destroyNestedBranches), branch.B?.forEach((scope) => {
|
|
253
257
|
for (let id in scope.A)
|
|
254
258
|
$signalReset(scope, id);
|
|
255
259
|
});
|
|
256
260
|
}
|
|
257
261
|
function removeAndDestroyBranch(branch) {
|
|
258
|
-
destroyBranch(branch), removeChildNodes(
|
|
262
|
+
destroyBranch(branch), removeChildNodes(
|
|
263
|
+
branch.S,
|
|
264
|
+
branch.L
|
|
265
|
+
);
|
|
259
266
|
}
|
|
260
267
|
function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
261
268
|
insertChildNodes(
|
|
262
269
|
parentNode,
|
|
263
270
|
nextSibling,
|
|
264
|
-
branch.
|
|
265
|
-
branch.
|
|
271
|
+
branch.S,
|
|
272
|
+
branch.L
|
|
266
273
|
);
|
|
267
274
|
}
|
|
268
275
|
function tempDetachBranch(branch) {
|
|
269
276
|
let fragment = new DocumentFragment();
|
|
270
|
-
fragment.namespaceURI = branch.
|
|
277
|
+
fragment.namespaceURI = branch.S.parentNode.namespaceURI, insertChildNodes(
|
|
278
|
+
fragment,
|
|
279
|
+
null,
|
|
280
|
+
branch.S,
|
|
281
|
+
branch.L
|
|
282
|
+
);
|
|
271
283
|
}
|
|
272
284
|
|
|
273
285
|
// src/dom/walker.ts
|
|
@@ -276,15 +288,15 @@ function walk(startNode, walkCodes, branch) {
|
|
|
276
288
|
walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
|
|
277
289
|
}
|
|
278
290
|
function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
279
|
-
let value, storedMultiplier = 0, currentMultiplier = 0, currentScopeIndex = 0;
|
|
291
|
+
let value, id, storedMultiplier = 0, currentMultiplier = 0, currentScopeIndex = 0;
|
|
280
292
|
for (; currentWalkIndex < walkCodes.length; )
|
|
281
293
|
if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32 /* Get */) {
|
|
282
294
|
let node = walker.currentNode;
|
|
283
|
-
scope[currentScopeIndex] = node, scope["
|
|
295
|
+
scope[id = decodeAccessor(currentScopeIndex++)] = node, scope["J" /* Getter */ + id] = () => node;
|
|
284
296
|
} else if (value === 37 /* Replace */ || value === 49 /* DynamicTagWithVar */)
|
|
285
297
|
walker.currentNode.replaceWith(
|
|
286
|
-
walker.currentNode = scope[currentScopeIndex++] = new Text()
|
|
287
|
-
), value === 49 /* DynamicTagWithVar */ && (scope[currentScopeIndex++] = skipScope());
|
|
298
|
+
walker.currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()
|
|
299
|
+
), value === 49 /* DynamicTagWithVar */ && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
288
300
|
else {
|
|
289
301
|
if (value === 38 /* EndChild */)
|
|
290
302
|
return currentWalkIndex;
|
|
@@ -292,8 +304,11 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
|
292
304
|
currentWalkIndex = walkInternal(
|
|
293
305
|
currentWalkIndex,
|
|
294
306
|
walkCodes,
|
|
295
|
-
scope[currentScopeIndex++] = createScope(
|
|
296
|
-
|
|
307
|
+
scope[decodeAccessor(currentScopeIndex++)] = createScope(
|
|
308
|
+
scope.$,
|
|
309
|
+
scope.G
|
|
310
|
+
)
|
|
311
|
+
), value === 48 /* BeginChildWithVar */ && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
297
312
|
else if (value < 92)
|
|
298
313
|
for (value = 20 /* Next */ * currentMultiplier + value - 67 /* Next */; value--; )
|
|
299
314
|
walker.nextNode();
|
|
@@ -328,9 +343,9 @@ function init(runtimeId = "M") {
|
|
|
328
343
|
for (; startVisit.previousSibling && ~visits.indexOf(
|
|
329
344
|
startVisit = startVisit.previousSibling
|
|
330
345
|
); ) ;
|
|
331
|
-
branch.
|
|
346
|
+
branch.L = branch.S = startVisit, visitType === "'" /* BranchEndNativeTag */ && (branch.a = startVisit);
|
|
332
347
|
} else
|
|
333
|
-
startVisit = branchStarts.pop(), parent !== startVisit.parentNode && parent.prepend(startVisit), branch.
|
|
348
|
+
startVisit = branchStarts.pop(), parent !== startVisit.parentNode && parent.prepend(startVisit), branch.S = startVisit, branch.L = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
|
|
334
349
|
for (; i-- && orphanBranches[i] > branchId; )
|
|
335
350
|
branchParents.set(orphanBranches[i], branchId), claimed++;
|
|
336
351
|
orphanBranches.push(branchId), branchParents.set(branchId, 0), nextToken();
|
|
@@ -338,9 +353,9 @@ function init(runtimeId = "M") {
|
|
|
338
353
|
orphanBranches.splice(i, claimed);
|
|
339
354
|
};
|
|
340
355
|
return {
|
|
341
|
-
|
|
356
|
+
n() {
|
|
342
357
|
visitType === "[" /* BranchStart */ ? (endBranch(), branchStarts.push(visit)) : (visitScope[
|
|
343
|
-
"
|
|
358
|
+
"J" /* Getter */ + nextToken()
|
|
344
359
|
/* read accessor */
|
|
345
360
|
] = /* @__PURE__ */ ((node) => () => node)(
|
|
346
361
|
visitScope[lastToken] = visitType === ")" /* BranchEndOnlyChildInParent */ || visitType === "}" /* BranchEndSingleNodeOnlyChildInParent */ ? visit.parentNode : visit
|
|
@@ -348,8 +363,8 @@ function init(runtimeId = "M") {
|
|
|
348
363
|
visitType !== "]" /* BranchEnd */ && visitType !== ")" /* BranchEndOnlyChildInParent */
|
|
349
364
|
));
|
|
350
365
|
},
|
|
351
|
-
|
|
352
|
-
scope.
|
|
366
|
+
c(scope) {
|
|
367
|
+
scope.G = scopeLookup[scope.H || branchParents.get(scopeId)], branchParents.has(scopeId) && (scope.G && ((scope.N = scope.G).E ||= /* @__PURE__ */ new Set()).add(scope), scope.G = scope);
|
|
353
368
|
}
|
|
354
369
|
};
|
|
355
370
|
})(), $global, lastScopeId = 0, lastEffect, visits, resumes, scopeId, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, nextToken = () => lastToken = visitText.slice(
|
|
@@ -362,23 +377,23 @@ function init(runtimeId = "M") {
|
|
|
362
377
|
walk2(), isResuming = 1;
|
|
363
378
|
for (visit of visits = render.v)
|
|
364
379
|
lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], (scopeId = +nextToken()) && (visitScope = scopeLookup[scopeId] ||= {
|
|
365
|
-
|
|
366
|
-
}), visitType === "*" /* Node */ ? visitScope["
|
|
380
|
+
M: scopeId
|
|
381
|
+
}), visitType === "*" /* Node */ ? visitScope["J" /* Getter */ + nextToken()] = /* @__PURE__ */ ((node) => () => node)(visitScope[lastToken] = visit.previousSibling) : branchesEnabled && branches.n();
|
|
367
382
|
for (let serialized of resumes = render.r || [])
|
|
368
383
|
if (typeof serialized == "string")
|
|
369
384
|
lastEffect = serialized;
|
|
370
385
|
else if (typeof serialized == "number")
|
|
371
386
|
registeredValues[lastEffect](
|
|
372
387
|
scopeLookup[serialized] ||= {
|
|
373
|
-
|
|
388
|
+
M: scopeId
|
|
374
389
|
}
|
|
375
390
|
);
|
|
376
391
|
else
|
|
377
392
|
for (let scope of serialized(serializeContext))
|
|
378
|
-
$global ? typeof scope == "number" ? lastScopeId += scope : (scopeId = ++lastScopeId, scope.$
|
|
393
|
+
$global ? typeof scope == "number" ? lastScopeId += scope : (scopeId = ++lastScopeId, scope.$ = $global, scope.M = scopeId, scopeLookup[scopeId] !== scope && (scopeLookup[scopeId] = Object.assign(
|
|
379
394
|
scope,
|
|
380
395
|
scopeLookup[scopeId]
|
|
381
|
-
)), branchesEnabled && branches.
|
|
396
|
+
)), branchesEnabled && branches.c(scope)) : ($global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId);
|
|
382
397
|
} finally {
|
|
383
398
|
isResuming = visits.length = resumes.length = 0;
|
|
384
399
|
}
|
|
@@ -397,18 +412,19 @@ function init(runtimeId = "M") {
|
|
|
397
412
|
});
|
|
398
413
|
}
|
|
399
414
|
var isResuming;
|
|
400
|
-
function _resume(id, obj) {
|
|
401
|
-
return registeredValues[id] = obj, obj;
|
|
402
|
-
}
|
|
403
|
-
function _var_resume(id, signal) {
|
|
404
|
-
return registeredValues[id] = (scope) => (value) => signal(scope, value), signal;
|
|
405
|
-
}
|
|
406
415
|
function getRegisteredWithScope(id, scope) {
|
|
407
416
|
let val = registeredValues[id];
|
|
408
417
|
return scope ? val(scope) : val;
|
|
409
418
|
}
|
|
410
|
-
function
|
|
411
|
-
return
|
|
419
|
+
function _resume(id, obj) {
|
|
420
|
+
return registeredValues[id] = obj;
|
|
421
|
+
}
|
|
422
|
+
function _var_resume(id, signal) {
|
|
423
|
+
return _resume(id, (scope) => (value) => signal(scope, value)), signal;
|
|
424
|
+
}
|
|
425
|
+
function _el(id, accessor) {
|
|
426
|
+
let getterAccessor = "J" /* Getter */ + decodeAccessor(accessor);
|
|
427
|
+
return _resume(id, (scope) => () => scope[getterAccessor]());
|
|
412
428
|
}
|
|
413
429
|
|
|
414
430
|
// src/dom/controllable.ts
|
|
@@ -424,7 +440,7 @@ function _attr_input_checked(scope, nodeAccessor, checked, checkedChange) {
|
|
|
424
440
|
function _attr_input_checked_script(scope, nodeAccessor) {
|
|
425
441
|
let el = scope[nodeAccessor];
|
|
426
442
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
|
427
|
-
let checkedChange = scope["
|
|
443
|
+
let checkedChange = scope["E" /* ControlledHandler */ + nodeAccessor];
|
|
428
444
|
if (checkedChange) {
|
|
429
445
|
let newValue = el.checked;
|
|
430
446
|
el.checked = !newValue, checkedChange(newValue), run();
|
|
@@ -432,7 +448,7 @@ function _attr_input_checked_script(scope, nodeAccessor) {
|
|
|
432
448
|
});
|
|
433
449
|
}
|
|
434
450
|
function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value) {
|
|
435
|
-
scope["
|
|
451
|
+
scope["G" /* ControlledValue */ + nodeAccessor] = checkedValue, _attr(scope[nodeAccessor], "value", value), setCheckboxValue(
|
|
436
452
|
scope,
|
|
437
453
|
nodeAccessor,
|
|
438
454
|
1 /* InputCheckedValue */,
|
|
@@ -443,9 +459,9 @@ function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValu
|
|
|
443
459
|
function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
444
460
|
let el = scope[nodeAccessor];
|
|
445
461
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
|
446
|
-
let checkedValueChange = scope["
|
|
462
|
+
let checkedValueChange = scope["E" /* ControlledHandler */ + nodeAccessor];
|
|
447
463
|
if (checkedValueChange) {
|
|
448
|
-
let oldValue = scope["
|
|
464
|
+
let oldValue = scope["G" /* ControlledValue */ + nodeAccessor], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
449
465
|
if (el.name && el.type[0] === "r")
|
|
450
466
|
for (let radio of el.getRootNode().querySelectorAll(
|
|
451
467
|
`[type=radio][name=${CSS.escape(el.name)}]`
|
|
@@ -459,20 +475,20 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
|
459
475
|
}
|
|
460
476
|
function _attr_input_value(scope, nodeAccessor, value, valueChange) {
|
|
461
477
|
let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
|
|
462
|
-
scope["
|
|
478
|
+
scope["E" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["F" /* ControlledType */ + nodeAccessor] = 0 /* InputChecked */, scope["G" /* ControlledValue */ + nodeAccessor] = value, el.isConnected ? setValueAndUpdateSelection(el, normalizedValue) : el.defaultValue = normalizedValue) : (scope["F" /* ControlledType */ + nodeAccessor] = 5 /* None */, el.defaultValue = normalizedValue);
|
|
463
479
|
}
|
|
464
480
|
function _attr_input_value_script(scope, nodeAccessor) {
|
|
465
481
|
let el = scope[nodeAccessor];
|
|
466
|
-
isResuming && (scope["
|
|
467
|
-
let valueChange = scope["
|
|
482
|
+
isResuming && (scope["G" /* ControlledValue */ + nodeAccessor] = el.defaultValue), syncControllable(el, "input", hasValueChanged, (ev) => {
|
|
483
|
+
let valueChange = scope["E" /* ControlledHandler */ + nodeAccessor];
|
|
468
484
|
valueChange && (inputType = ev?.inputType, valueChange(el.value), run(), setValueAndUpdateSelection(
|
|
469
485
|
el,
|
|
470
|
-
scope["
|
|
486
|
+
scope["G" /* ControlledValue */ + nodeAccessor]
|
|
471
487
|
), inputType = "");
|
|
472
488
|
});
|
|
473
489
|
}
|
|
474
490
|
function _attr_select_value(scope, nodeAccessor, value, valueChange) {
|
|
475
|
-
scope["
|
|
491
|
+
scope["E" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["F" /* ControlledType */ + nodeAccessor] = 3 /* SelectValue */, scope["G" /* ControlledValue */ + nodeAccessor] = value) : scope["F" /* ControlledType */ + nodeAccessor] = 5 /* None */, pendingEffects.unshift(
|
|
476
492
|
() => setSelectOptions(
|
|
477
493
|
scope[nodeAccessor],
|
|
478
494
|
value,
|
|
@@ -483,20 +499,20 @@ function _attr_select_value(scope, nodeAccessor, value, valueChange) {
|
|
|
483
499
|
}
|
|
484
500
|
function _attr_select_value_script(scope, nodeAccessor) {
|
|
485
501
|
let el = scope[nodeAccessor], onChange = () => {
|
|
486
|
-
let valueChange = scope["
|
|
502
|
+
let valueChange = scope["E" /* ControlledHandler */ + nodeAccessor];
|
|
487
503
|
if (valueChange) {
|
|
488
504
|
let newValue = Array.isArray(
|
|
489
|
-
scope["
|
|
505
|
+
scope["G" /* ControlledValue */ + nodeAccessor]
|
|
490
506
|
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
|
491
507
|
setSelectOptions(
|
|
492
508
|
el,
|
|
493
|
-
scope["
|
|
509
|
+
scope["G" /* ControlledValue */ + nodeAccessor],
|
|
494
510
|
valueChange
|
|
495
511
|
), valueChange(newValue), run();
|
|
496
512
|
}
|
|
497
513
|
};
|
|
498
514
|
el._ || new MutationObserver(() => {
|
|
499
|
-
let value = scope["
|
|
515
|
+
let value = scope["G" /* ControlledValue */ + nodeAccessor];
|
|
500
516
|
(Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((value2, i) => value2 != el.selectedOptions[i].value) : el.value != value) && onChange();
|
|
501
517
|
}).observe(el, {
|
|
502
518
|
childList: !0,
|
|
@@ -519,16 +535,16 @@ function setSelectOptions(el, value, valueChange) {
|
|
|
519
535
|
}
|
|
520
536
|
}
|
|
521
537
|
function _attr_details_or_dialog_open(scope, nodeAccessor, open, openChange) {
|
|
522
|
-
scope["
|
|
538
|
+
scope["E" /* ControlledHandler */ + nodeAccessor] = openChange, openChange ? scope["F" /* ControlledType */ + nodeAccessor] = 4 /* DetailsOrDialogOpen */ : scope["F" /* ControlledType */ + nodeAccessor] = 5 /* None */, scope[nodeAccessor].open = scope["G" /* ControlledValue */ + nodeAccessor] = normalizeBoolProp(open);
|
|
523
539
|
}
|
|
524
540
|
function _attr_details_or_dialog_open_script(scope, nodeAccessor) {
|
|
525
|
-
let el = scope[nodeAccessor], hasChanged = () => el.open !== scope["
|
|
541
|
+
let el = scope[nodeAccessor], hasChanged = () => el.open !== scope["G" /* ControlledValue */ + nodeAccessor];
|
|
526
542
|
syncControllable(
|
|
527
543
|
el,
|
|
528
544
|
el.tagName === "DIALOG" ? "close" : "toggle",
|
|
529
545
|
hasChanged,
|
|
530
546
|
() => {
|
|
531
|
-
let openChange = scope["
|
|
547
|
+
let openChange = scope["E" /* ControlledHandler */ + nodeAccessor];
|
|
532
548
|
if (openChange && hasChanged()) {
|
|
533
549
|
let newValue = el.open;
|
|
534
550
|
el.open = !newValue, openChange(newValue), run();
|
|
@@ -549,7 +565,7 @@ function setValueAndUpdateSelection(el, value) {
|
|
|
549
565
|
}
|
|
550
566
|
}
|
|
551
567
|
function setCheckboxValue(scope, nodeAccessor, type, checked, checkedChange) {
|
|
552
|
-
scope["
|
|
568
|
+
scope["E" /* ControlledHandler */ + nodeAccessor] = checkedChange, checkedChange ? (scope["F" /* ControlledType */ + nodeAccessor] = type, scope[nodeAccessor].checked = checked) : (scope["F" /* ControlledType */ + nodeAccessor] = 5 /* None */, scope[nodeAccessor].defaultChecked = checked);
|
|
553
569
|
}
|
|
554
570
|
var controllableDelegate = createDelegator();
|
|
555
571
|
function syncControllable(el, event, hasChanged, onChange) {
|
|
@@ -618,43 +634,44 @@ function triggerMacroTask() {
|
|
|
618
634
|
}
|
|
619
635
|
|
|
620
636
|
// src/dom/signals.ts
|
|
621
|
-
function _let(
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}) {
|
|
629
|
-
return (scope, value) => {
|
|
630
|
-
(!(valueAccessor in scope) || scope[valueAccessor] !== value) && (scope[valueAccessor] = value, fn(scope));
|
|
637
|
+
function _let(id, fn) {
|
|
638
|
+
let valueAccessor = decodeAccessor(id), valueChangeAccessor = "O" /* TagVariableChange */ + valueAccessor;
|
|
639
|
+
return (scope, value, valueChange) => (rendering ? ((scope[valueChangeAccessor] = valueChange) && scope[valueAccessor] !== value || scope.I) && (scope[valueAccessor] = value, fn?.(scope)) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](value) : scope[valueAccessor] !== (scope[valueAccessor] = value) && fn && (schedule(), queueRender(scope, fn, id)), value);
|
|
640
|
+
}
|
|
641
|
+
function _const(valueAccessor, fn) {
|
|
642
|
+
return valueAccessor = decodeAccessor(valueAccessor), (scope, value) => {
|
|
643
|
+
(!(valueAccessor in scope) || scope[valueAccessor] !== value) && (scope[valueAccessor] = value, fn?.(scope));
|
|
631
644
|
};
|
|
632
645
|
}
|
|
633
|
-
function _or(id, fn, defaultPending = 1, scopeIdAccessor = /*
|
|
646
|
+
function _or(id, fn, defaultPending = 1, scopeIdAccessor = "M" /* Id */) {
|
|
634
647
|
return (scope) => {
|
|
635
|
-
scope.
|
|
648
|
+
scope.I ? id in scope ? --scope[id] || fn(scope) : scope[id] = defaultPending : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
|
|
636
649
|
};
|
|
637
650
|
}
|
|
638
651
|
function _for_closure(ownerLoopNodeAccessor, fn) {
|
|
639
|
-
|
|
652
|
+
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor);
|
|
653
|
+
let loopScopeAccessor = "L" /* LoopScopeArray */ + ownerLoopNodeAccessor, loopScopeMapAccessor = "M" /* LoopScopeMap */ + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
|
|
640
654
|
let scopes = ownerScope[loopScopeAccessor] ||= ownerScope[loopScopeMapAccessor] ? [...ownerScope[loopScopeMapAccessor].values()] : [], [firstScope] = scopes;
|
|
641
655
|
firstScope && queueRender(
|
|
642
656
|
ownerScope,
|
|
643
657
|
() => {
|
|
644
658
|
for (let scope of scopes)
|
|
645
|
-
!scope.
|
|
659
|
+
!scope.I && !scope.J && fn(scope);
|
|
646
660
|
},
|
|
647
661
|
-1,
|
|
648
662
|
0,
|
|
649
|
-
firstScope.
|
|
663
|
+
firstScope.M
|
|
650
664
|
);
|
|
651
665
|
};
|
|
652
666
|
return ownerSignal._ = fn, ownerSignal;
|
|
653
667
|
}
|
|
654
668
|
function _if_closure(ownerConditionalNodeAccessor, branch, fn) {
|
|
655
|
-
|
|
669
|
+
ownerConditionalNodeAccessor = decodeAccessor(
|
|
670
|
+
ownerConditionalNodeAccessor
|
|
671
|
+
);
|
|
672
|
+
let scopeAccessor = "D" /* ConditionalScope */ + ownerConditionalNodeAccessor, branchAccessor = "C" /* ConditionalRenderer */ + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
|
|
656
673
|
let ifScope = scope[scopeAccessor];
|
|
657
|
-
ifScope && !ifScope.
|
|
674
|
+
ifScope && !ifScope.I && (scope[branchAccessor] || 0) === branch && queueRender(ifScope, fn, -1);
|
|
658
675
|
};
|
|
659
676
|
return ownerSignal._ = fn, ownerSignal;
|
|
660
677
|
}
|
|
@@ -666,13 +683,13 @@ function subscribeToScopeSet(ownerScope, accessor, scope) {
|
|
|
666
683
|
));
|
|
667
684
|
}
|
|
668
685
|
function _closure(...closureSignals) {
|
|
669
|
-
let [{
|
|
686
|
+
let [{ j: ___scopeInstancesAccessor, k: ___signalIndexAccessor }] = closureSignals;
|
|
670
687
|
for (let i = closureSignals.length; i--; )
|
|
671
|
-
closureSignals[i].
|
|
688
|
+
closureSignals[i].o = i;
|
|
672
689
|
return (scope) => {
|
|
673
690
|
if (scope[___scopeInstancesAccessor])
|
|
674
691
|
for (let childScope of scope[___scopeInstancesAccessor])
|
|
675
|
-
childScope.
|
|
692
|
+
childScope.I || queueRender(
|
|
676
693
|
childScope,
|
|
677
694
|
closureSignals[childScope[___signalIndexAccessor]],
|
|
678
695
|
-1
|
|
@@ -680,14 +697,15 @@ function _closure(...closureSignals) {
|
|
|
680
697
|
};
|
|
681
698
|
}
|
|
682
699
|
function _closure_get(valueAccessor, fn, getOwnerScope) {
|
|
700
|
+
valueAccessor = decodeAccessor(valueAccessor);
|
|
683
701
|
let closureSignal = ((scope) => {
|
|
684
|
-
scope[closureSignal.
|
|
702
|
+
scope[closureSignal.k] = closureSignal.o, fn(scope), subscribeToScopeSet(
|
|
685
703
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
|
686
|
-
closureSignal.
|
|
704
|
+
closureSignal.j,
|
|
687
705
|
scope
|
|
688
706
|
);
|
|
689
707
|
});
|
|
690
|
-
return closureSignal.
|
|
708
|
+
return closureSignal.j = "A" /* ClosureScopes */ + valueAccessor, closureSignal.k = "B" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
|
|
691
709
|
}
|
|
692
710
|
function _child_setup(setup) {
|
|
693
711
|
return setup._ = (scope, owner) => {
|
|
@@ -695,14 +713,14 @@ function _child_setup(setup) {
|
|
|
695
713
|
}, setup;
|
|
696
714
|
}
|
|
697
715
|
function _var(scope, childAccessor, signal) {
|
|
698
|
-
scope[childAccessor].
|
|
716
|
+
scope[decodeAccessor(childAccessor)].T = (value) => signal(scope, value);
|
|
699
717
|
}
|
|
700
|
-
var _return = (scope, value) => scope.
|
|
718
|
+
var _return = (scope, value) => scope.T?.(value);
|
|
701
719
|
function _return_change(scope, changeHandler) {
|
|
702
|
-
changeHandler && (scope.
|
|
720
|
+
changeHandler && (scope.U = changeHandler);
|
|
703
721
|
}
|
|
704
|
-
var _var_change = (scope, value) => scope.
|
|
705
|
-
function _id({ $global }) {
|
|
722
|
+
var _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap();
|
|
723
|
+
function _id({ ["$" /* Global */]: $global }) {
|
|
706
724
|
let id = tagIdsByGlobal.get($global) || 0;
|
|
707
725
|
return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
|
|
708
726
|
}
|
|
@@ -722,7 +740,7 @@ function* traverseAllHoisted(scope, path, curIndex = path.length - 1) {
|
|
|
722
740
|
else curIndex ? yield* traverseAllHoisted(scope[path[curIndex]], path, curIndex - 1) : yield scope[path[0]];
|
|
723
741
|
}
|
|
724
742
|
function _hoist(...path) {
|
|
725
|
-
return (scope) => {
|
|
743
|
+
return path = path.map((p) => typeof p == "string" ? p : decodeAccessor(p)), (scope) => {
|
|
726
744
|
let getOne = (...args) => iterator().next().value?.(...args), iterator = getOne[Symbol.iterator] = () => traverseAllHoisted(scope, path);
|
|
727
745
|
return getOne;
|
|
728
746
|
};
|
|
@@ -730,8 +748,8 @@ function _hoist(...path) {
|
|
|
730
748
|
|
|
731
749
|
// src/dom/renderer.ts
|
|
732
750
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
733
|
-
let branch = createScope($global), parentBranch = parentScope?.
|
|
734
|
-
return branch._ = renderer.
|
|
751
|
+
let branch = createScope($global), parentBranch = parentScope?.G;
|
|
752
|
+
return branch._ = renderer.d || parentScope, branch.G = branch, parentBranch && (branch.N = parentBranch, (parentBranch.E ||= /* @__PURE__ */ new Set()).add(branch)), renderer.g?.(
|
|
735
753
|
branch,
|
|
736
754
|
parentNode.namespaceURI
|
|
737
755
|
), branch;
|
|
@@ -743,7 +761,7 @@ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
|
|
|
743
761
|
);
|
|
744
762
|
}
|
|
745
763
|
function setupBranch(renderer, branch) {
|
|
746
|
-
return renderer.
|
|
764
|
+
return renderer.h && queueRender(branch, renderer.h, -1), branch;
|
|
747
765
|
}
|
|
748
766
|
function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
749
767
|
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup = setup ? setup._ || setup : void 0, params ||= void 0;
|
|
@@ -754,18 +772,18 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
|
754
772
|
))(branch, walks);
|
|
755
773
|
} : (branch) => {
|
|
756
774
|
walk(
|
|
757
|
-
branch.
|
|
775
|
+
branch.S = branch.L = new Text(),
|
|
758
776
|
walks,
|
|
759
777
|
branch
|
|
760
778
|
);
|
|
761
779
|
};
|
|
762
780
|
return (owner) => ({
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
781
|
+
f: id,
|
|
782
|
+
g: clone,
|
|
783
|
+
d: owner,
|
|
784
|
+
h: setup,
|
|
785
|
+
a: params,
|
|
786
|
+
b: dynamicScopesAccessor
|
|
769
787
|
});
|
|
770
788
|
}
|
|
771
789
|
function _content_resume(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
@@ -777,10 +795,10 @@ function _content_resume(id, template, walks, setup, params, dynamicScopesAccess
|
|
|
777
795
|
function _content_closures(renderer, closureFns) {
|
|
778
796
|
let closureSignals = {};
|
|
779
797
|
for (let key in closureFns)
|
|
780
|
-
closureSignals[key] = _const(key, closureFns[key]);
|
|
798
|
+
closureSignals[key] = _const(+key, closureFns[key]);
|
|
781
799
|
return (owner, closureValues) => {
|
|
782
800
|
let instance = renderer(owner);
|
|
783
|
-
return instance.
|
|
801
|
+
return instance.l = closureSignals, instance.p = closureValues, instance;
|
|
784
802
|
};
|
|
785
803
|
}
|
|
786
804
|
function _content_branch(template, walks, setup, params) {
|
|
@@ -791,13 +809,13 @@ function createCloneableHTML(html, ns) {
|
|
|
791
809
|
let { firstChild, lastChild } = parseHTML(html, ns), parent = document.createElementNS(ns, "t");
|
|
792
810
|
return insertChildNodes(parent, null, firstChild, lastChild), firstChild === lastChild && firstChild.nodeType < 8 /* Comment */ ? (branch, walks) => {
|
|
793
811
|
walk(
|
|
794
|
-
branch.
|
|
812
|
+
branch.S = branch.L = firstChild.cloneNode(!0),
|
|
795
813
|
walks,
|
|
796
814
|
branch
|
|
797
815
|
);
|
|
798
816
|
} : (branch, walks) => {
|
|
799
817
|
let clone = parent.cloneNode(!0);
|
|
800
|
-
walk(clone.firstChild, walks, branch), branch.
|
|
818
|
+
walk(clone.firstChild, walks, branch), branch.S = clone.firstChild, branch.L = clone.lastChild;
|
|
801
819
|
};
|
|
802
820
|
}
|
|
803
821
|
|
|
@@ -929,23 +947,23 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
|
|
|
929
947
|
_attr_style(el, value);
|
|
930
948
|
break;
|
|
931
949
|
default: {
|
|
932
|
-
isEventHandler(name) ? (events ||= scope["
|
|
950
|
+
isEventHandler(name) ? (events ||= scope["I" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value : skip?.test(name) || name === "content" && el.tagName !== "META" || _attr(el, name, value);
|
|
933
951
|
break;
|
|
934
952
|
}
|
|
935
953
|
}
|
|
936
954
|
}
|
|
937
955
|
}
|
|
938
956
|
function _attr_content(scope, nodeAccessor, value) {
|
|
939
|
-
let content = normalizeClientRender(value), rendererAccessor = "
|
|
940
|
-
scope[rendererAccessor] !== (scope[rendererAccessor] = content?.
|
|
941
|
-
content.
|
|
942
|
-
content.
|
|
943
|
-
scope["
|
|
957
|
+
let content = normalizeClientRender(value), rendererAccessor = "C" /* ConditionalRenderer */ + nodeAccessor;
|
|
958
|
+
scope[rendererAccessor] !== (scope[rendererAccessor] = content?.f) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.b && subscribeToScopeSet(
|
|
959
|
+
content.d,
|
|
960
|
+
content.b,
|
|
961
|
+
scope["D" /* ConditionalScope */ + nodeAccessor]
|
|
944
962
|
));
|
|
945
963
|
}
|
|
946
964
|
function _attrs_script(scope, nodeAccessor) {
|
|
947
|
-
let el = scope[nodeAccessor], events = scope["
|
|
948
|
-
switch (scope["
|
|
965
|
+
let el = scope[nodeAccessor], events = scope["I" /* EventAttributes */ + nodeAccessor];
|
|
966
|
+
switch (scope["F" /* ControlledType */ + nodeAccessor]) {
|
|
949
967
|
case 0 /* InputChecked */:
|
|
950
968
|
_attr_input_checked_script(scope, nodeAccessor);
|
|
951
969
|
break;
|
|
@@ -966,7 +984,7 @@ function _attrs_script(scope, nodeAccessor) {
|
|
|
966
984
|
_on(el, name, events[name]);
|
|
967
985
|
}
|
|
968
986
|
function _html(scope, value, accessor) {
|
|
969
|
-
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["
|
|
987
|
+
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" /* DynamicPlaceholderLastChild */ + accessor] || firstChild, newContent = parseHTML(
|
|
970
988
|
value || value === 0 ? value + "" : "",
|
|
971
989
|
parentNode.namespaceURI
|
|
972
990
|
);
|
|
@@ -974,12 +992,12 @@ function _html(scope, value, accessor) {
|
|
|
974
992
|
parentNode,
|
|
975
993
|
firstChild,
|
|
976
994
|
scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()),
|
|
977
|
-
scope["
|
|
995
|
+
scope["H" /* DynamicPlaceholderLastChild */ + accessor] = newContent.lastChild
|
|
978
996
|
), removeChildNodes(firstChild, lastChild);
|
|
979
997
|
}
|
|
980
998
|
function normalizeClientRender(value) {
|
|
981
999
|
let renderer = normalizeDynamicRenderer(value);
|
|
982
|
-
if (renderer && renderer.
|
|
1000
|
+
if (renderer && renderer.f)
|
|
983
1001
|
return renderer;
|
|
984
1002
|
}
|
|
985
1003
|
function normalizeAttrValue(value) {
|
|
@@ -991,7 +1009,7 @@ function normalizeString(value) {
|
|
|
991
1009
|
}
|
|
992
1010
|
function _lifecycle(scope, index, thisObj) {
|
|
993
1011
|
let instance = scope[index];
|
|
994
|
-
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), $signal(scope, "
|
|
1012
|
+
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), $signal(scope, "K" /* LifecycleAbortController */ + index).onabort = () => thisObj.onDestroy?.());
|
|
995
1013
|
}
|
|
996
1014
|
function removeChildNodes(startNode, endNode) {
|
|
997
1015
|
let stop = endNode.nextSibling, current = startNode;
|
|
@@ -1031,7 +1049,7 @@ function reconcile(parent, oldBranches, newBranches, afterReference) {
|
|
|
1031
1049
|
}
|
|
1032
1050
|
if (oldStart > oldEnd) {
|
|
1033
1051
|
if (newStart <= newEnd) {
|
|
1034
|
-
k = newEnd + 1, nextSibling = k < newBranches.length ? newBranches[k].
|
|
1052
|
+
k = newEnd + 1, nextSibling = k < newBranches.length ? newBranches[k].S : afterReference;
|
|
1035
1053
|
do
|
|
1036
1054
|
insertBranchBefore(newBranches[newStart++], parent, nextSibling);
|
|
1037
1055
|
while (newStart <= newEnd);
|
|
@@ -1060,10 +1078,10 @@ function reconcile(parent, oldBranches, newBranches, afterReference) {
|
|
|
1060
1078
|
if (pos === WRONG_POS) {
|
|
1061
1079
|
let seq = longestIncreasingSubsequence(sources);
|
|
1062
1080
|
for (j = seq.length - 1, k = newBranches.length, i = newLength - 1; i >= 0; --i)
|
|
1063
|
-
sources[i] === -1 ? (pos = i + newStart, newBranch = newBranches[pos++], nextSibling = pos < k ? newBranches[pos].
|
|
1081
|
+
sources[i] === -1 ? (pos = i + newStart, newBranch = newBranches[pos++], nextSibling = pos < k ? newBranches[pos].S : afterReference, insertBranchBefore(newBranch, parent, nextSibling)) : j < 0 || i !== seq[j] ? (pos = i + newStart, newBranch = newBranches[pos++], nextSibling = pos < k ? newBranches[pos].S : afterReference, insertBranchBefore(newBranch, parent, nextSibling)) : --j;
|
|
1064
1082
|
} else if (synced !== newLength)
|
|
1065
1083
|
for (k = newBranches.length, i = newLength - 1; i >= 0; --i)
|
|
1066
|
-
sources[i] === -1 && (pos = i + newStart, newBranch = newBranches[pos++], nextSibling = pos < k ? newBranches[pos].
|
|
1084
|
+
sources[i] === -1 && (pos = i + newStart, newBranch = newBranches[pos++], nextSibling = pos < k ? newBranches[pos].S : afterReference, insertBranchBefore(newBranch, parent, nextSibling));
|
|
1067
1085
|
}
|
|
1068
1086
|
}
|
|
1069
1087
|
}
|
|
@@ -1090,36 +1108,37 @@ function longestIncreasingSubsequence(a) {
|
|
|
1090
1108
|
|
|
1091
1109
|
// src/dom/control-flow.ts
|
|
1092
1110
|
function _await(nodeAccessor, renderer) {
|
|
1093
|
-
|
|
1111
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1112
|
+
let promiseAccessor = "N" /* Promise */ + nodeAccessor, branchAccessor = "D" /* ConditionalScope */ + nodeAccessor;
|
|
1094
1113
|
return enableBranches(), (scope, promise) => {
|
|
1095
1114
|
let referenceNode = scope[nodeAccessor], tryWithPlaceholder = findBranchWithKey(
|
|
1096
1115
|
scope,
|
|
1097
|
-
"
|
|
1116
|
+
"Q" /* PlaceholderContent */
|
|
1098
1117
|
), awaitBranch = scope[branchAccessor];
|
|
1099
|
-
tryWithPlaceholder ? (placeholderShown.add(pendingEffects), !scope[promiseAccessor] && (tryWithPlaceholder.
|
|
1100
|
-
() => tryWithPlaceholder.
|
|
1118
|
+
tryWithPlaceholder ? (placeholderShown.add(pendingEffects), !scope[promiseAccessor] && (tryWithPlaceholder.O = (tryWithPlaceholder.O || 0) + 1) === 1 && requestAnimationFrame(
|
|
1119
|
+
() => tryWithPlaceholder.O && runEffects(
|
|
1101
1120
|
prepareEffects(
|
|
1102
1121
|
() => queueRender(
|
|
1103
1122
|
tryWithPlaceholder,
|
|
1104
1123
|
() => {
|
|
1105
1124
|
insertBranchBefore(
|
|
1106
|
-
tryWithPlaceholder.
|
|
1107
|
-
scope
|
|
1108
|
-
tryWithPlaceholder.
|
|
1125
|
+
tryWithPlaceholder.P = createAndSetupBranch(
|
|
1126
|
+
scope.$,
|
|
1127
|
+
tryWithPlaceholder.Q,
|
|
1109
1128
|
tryWithPlaceholder._,
|
|
1110
|
-
tryWithPlaceholder.
|
|
1129
|
+
tryWithPlaceholder.S.parentNode
|
|
1111
1130
|
),
|
|
1112
|
-
tryWithPlaceholder.
|
|
1113
|
-
tryWithPlaceholder.
|
|
1131
|
+
tryWithPlaceholder.S.parentNode,
|
|
1132
|
+
tryWithPlaceholder.S
|
|
1114
1133
|
), tempDetachBranch(tryWithPlaceholder);
|
|
1115
1134
|
},
|
|
1116
1135
|
-1
|
|
1117
1136
|
)
|
|
1118
1137
|
)
|
|
1119
1138
|
)
|
|
1120
|
-
)) : awaitBranch && !scope[promiseAccessor] && (awaitBranch.
|
|
1139
|
+
)) : awaitBranch && !scope[promiseAccessor] && (awaitBranch.S.parentNode.insertBefore(
|
|
1121
1140
|
referenceNode,
|
|
1122
|
-
awaitBranch.
|
|
1141
|
+
awaitBranch.S
|
|
1123
1142
|
), tempDetachBranch(awaitBranch));
|
|
1124
1143
|
let thisPromise = scope[promiseAccessor] = promise.then(
|
|
1125
1144
|
(data) => {
|
|
@@ -1127,24 +1146,24 @@ function _await(nodeAccessor, renderer) {
|
|
|
1127
1146
|
scope,
|
|
1128
1147
|
() => {
|
|
1129
1148
|
if (awaitBranch ? tryWithPlaceholder || referenceNode.replaceWith(
|
|
1130
|
-
awaitBranch.
|
|
1149
|
+
awaitBranch.S.parentNode
|
|
1131
1150
|
) : (insertBranchBefore(
|
|
1132
1151
|
awaitBranch = scope[branchAccessor] = createAndSetupBranch(
|
|
1133
|
-
scope
|
|
1152
|
+
scope.$,
|
|
1134
1153
|
renderer,
|
|
1135
1154
|
scope,
|
|
1136
1155
|
referenceNode.parentNode
|
|
1137
1156
|
),
|
|
1138
1157
|
referenceNode.parentNode,
|
|
1139
1158
|
referenceNode
|
|
1140
|
-
), referenceNode.remove()), renderer.
|
|
1141
|
-
let placeholderBranch = tryWithPlaceholder.
|
|
1142
|
-
tryWithPlaceholder.
|
|
1143
|
-
tryWithPlaceholder.
|
|
1144
|
-
placeholderBranch.
|
|
1159
|
+
), referenceNode.remove()), renderer.a?.(awaitBranch, [data]), tryWithPlaceholder && (placeholderShown.add(pendingEffects), !--tryWithPlaceholder.O)) {
|
|
1160
|
+
let placeholderBranch = tryWithPlaceholder.P;
|
|
1161
|
+
tryWithPlaceholder.P = 0, placeholderBranch && (placeholderBranch.S.parentNode.insertBefore(
|
|
1162
|
+
tryWithPlaceholder.S.parentNode,
|
|
1163
|
+
placeholderBranch.S
|
|
1145
1164
|
), removeAndDestroyBranch(placeholderBranch)), queueEffect(tryWithPlaceholder, (scope2) => {
|
|
1146
|
-
let pendingEffects2 = scope2.
|
|
1147
|
-
pendingEffects2 && (scope2.
|
|
1165
|
+
let pendingEffects2 = scope2.K;
|
|
1166
|
+
pendingEffects2 && (scope2.K = [], runEffects(pendingEffects2, !0));
|
|
1148
1167
|
});
|
|
1149
1168
|
}
|
|
1150
1169
|
},
|
|
@@ -1152,13 +1171,14 @@ function _await(nodeAccessor, renderer) {
|
|
|
1152
1171
|
));
|
|
1153
1172
|
},
|
|
1154
1173
|
(error) => {
|
|
1155
|
-
thisPromise === scope[promiseAccessor] && (tryWithPlaceholder && (tryWithPlaceholder.
|
|
1174
|
+
thisPromise === scope[promiseAccessor] && (tryWithPlaceholder && (tryWithPlaceholder.O = 0), scope[promiseAccessor] = 0, schedule(), queueRender(scope, renderCatch, -1, error));
|
|
1156
1175
|
}
|
|
1157
1176
|
);
|
|
1158
1177
|
};
|
|
1159
1178
|
}
|
|
1160
1179
|
function _try(nodeAccessor, content) {
|
|
1161
|
-
|
|
1180
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1181
|
+
let branchAccessor = "D" /* ConditionalScope */ + nodeAccessor;
|
|
1162
1182
|
return (scope, input) => {
|
|
1163
1183
|
scope[branchAccessor] || setConditionalRenderer(
|
|
1164
1184
|
scope,
|
|
@@ -1167,29 +1187,30 @@ function _try(nodeAccessor, content) {
|
|
|
1167
1187
|
createAndSetupBranch
|
|
1168
1188
|
);
|
|
1169
1189
|
let branch = scope[branchAccessor];
|
|
1170
|
-
branch && (branch.
|
|
1190
|
+
branch && (branch.D = nodeAccessor, branch.F = normalizeDynamicRenderer(input.catch), branch.Q = normalizeDynamicRenderer(
|
|
1171
1191
|
input.placeholder
|
|
1172
1192
|
));
|
|
1173
1193
|
};
|
|
1174
1194
|
}
|
|
1175
1195
|
function renderCatch(scope, error) {
|
|
1176
|
-
let tryWithCatch = findBranchWithKey(scope, "
|
|
1196
|
+
let tryWithCatch = findBranchWithKey(scope, "F" /* CatchContent */);
|
|
1177
1197
|
if (tryWithCatch) {
|
|
1178
|
-
let owner = tryWithCatch._, placeholderBranch = tryWithCatch.
|
|
1179
|
-
placeholderBranch && (tryWithCatch.
|
|
1198
|
+
let owner = tryWithCatch._, placeholderBranch = tryWithCatch.P;
|
|
1199
|
+
placeholderBranch && (tryWithCatch.O = 0, owner["D" /* ConditionalScope */ + tryWithCatch.D] = placeholderBranch, destroyBranch(tryWithCatch)), caughtError.add(pendingEffects), setConditionalRenderer(
|
|
1180
1200
|
owner,
|
|
1181
|
-
tryWithCatch.
|
|
1182
|
-
tryWithCatch.
|
|
1201
|
+
tryWithCatch.D,
|
|
1202
|
+
tryWithCatch.F,
|
|
1183
1203
|
createAndSetupBranch
|
|
1184
|
-
), tryWithCatch.
|
|
1185
|
-
owner["
|
|
1204
|
+
), tryWithCatch.F.a?.(
|
|
1205
|
+
owner["D" /* ConditionalScope */ + tryWithCatch.D],
|
|
1186
1206
|
[error]
|
|
1187
1207
|
);
|
|
1188
1208
|
} else
|
|
1189
1209
|
throw error;
|
|
1190
1210
|
}
|
|
1191
1211
|
function _if(nodeAccessor, ...branches) {
|
|
1192
|
-
|
|
1212
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1213
|
+
let branchAccessor = "C" /* ConditionalRenderer */ + nodeAccessor;
|
|
1193
1214
|
return enableBranches(), (scope, newBranch) => {
|
|
1194
1215
|
newBranch !== scope[branchAccessor] && setConditionalRenderer(
|
|
1195
1216
|
scope,
|
|
@@ -1203,32 +1224,33 @@ function patchDynamicTag(fn) {
|
|
|
1203
1224
|
_dynamic_tag = fn(_dynamic_tag);
|
|
1204
1225
|
}
|
|
1205
1226
|
var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1206
|
-
|
|
1227
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1228
|
+
let childScopeAccessor = "D" /* ConditionalScope */ + nodeAccessor, rendererAccessor = "C" /* ConditionalRenderer */ + nodeAccessor;
|
|
1207
1229
|
return enableBranches(), (scope, newRenderer, getInput) => {
|
|
1208
1230
|
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
|
1209
|
-
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.
|
|
1231
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.f || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
|
|
1210
1232
|
if (setConditionalRenderer(
|
|
1211
1233
|
scope,
|
|
1212
1234
|
nodeAccessor,
|
|
1213
1235
|
normalizedRenderer || (getContent ? getContent(scope) : void 0),
|
|
1214
1236
|
createBranchWithTagNameOrRenderer
|
|
1215
|
-
), getTagVar &&
|
|
1237
|
+
), getTagVar && (scope[childScopeAccessor].T = (value) => getTagVar()(scope, value)), typeof normalizedRenderer == "string") {
|
|
1216
1238
|
if (getContent) {
|
|
1217
1239
|
let content = getContent(scope);
|
|
1218
1240
|
setConditionalRenderer(
|
|
1219
1241
|
scope[childScopeAccessor],
|
|
1220
|
-
|
|
1242
|
+
"a",
|
|
1221
1243
|
content,
|
|
1222
1244
|
createAndSetupBranch
|
|
1223
|
-
), content.
|
|
1224
|
-
content.
|
|
1225
|
-
content.
|
|
1226
|
-
scope[childScopeAccessor]["
|
|
1245
|
+
), content.b && subscribeToScopeSet(
|
|
1246
|
+
content.d,
|
|
1247
|
+
content.b,
|
|
1248
|
+
scope[childScopeAccessor]["Da"]
|
|
1227
1249
|
);
|
|
1228
1250
|
}
|
|
1229
|
-
} else normalizedRenderer?.
|
|
1230
|
-
normalizedRenderer.
|
|
1231
|
-
normalizedRenderer.
|
|
1251
|
+
} else normalizedRenderer?.b && subscribeToScopeSet(
|
|
1252
|
+
normalizedRenderer.d,
|
|
1253
|
+
normalizedRenderer.b,
|
|
1232
1254
|
scope[childScopeAccessor]
|
|
1233
1255
|
);
|
|
1234
1256
|
if (normalizedRenderer) {
|
|
@@ -1236,24 +1258,24 @@ var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
|
1236
1258
|
if (typeof normalizedRenderer == "string")
|
|
1237
1259
|
(getContent ? _attrs : _attrs_content)(
|
|
1238
1260
|
childScope,
|
|
1239
|
-
|
|
1261
|
+
"a",
|
|
1240
1262
|
(inputIsArgs ? args[0] : args) || {}
|
|
1241
|
-
);
|
|
1263
|
+
), (childScope["Ia"] || childScope["Ea"]) && queueEffect(childScope, dynamicTagScript);
|
|
1242
1264
|
else {
|
|
1243
|
-
for (let accessor in normalizedRenderer.
|
|
1244
|
-
normalizedRenderer.
|
|
1265
|
+
for (let accessor in normalizedRenderer.l)
|
|
1266
|
+
normalizedRenderer.l[accessor](
|
|
1245
1267
|
childScope,
|
|
1246
|
-
normalizedRenderer.
|
|
1268
|
+
normalizedRenderer.p[accessor]
|
|
1247
1269
|
);
|
|
1248
|
-
if (normalizedRenderer.
|
|
1270
|
+
if (normalizedRenderer.a)
|
|
1249
1271
|
if (inputIsArgs)
|
|
1250
|
-
normalizedRenderer.
|
|
1272
|
+
normalizedRenderer.a(
|
|
1251
1273
|
childScope,
|
|
1252
1274
|
normalizedRenderer._ ? args[0] : args
|
|
1253
1275
|
);
|
|
1254
1276
|
else {
|
|
1255
1277
|
let inputWithContent = getContent ? { ...args, content: getContent(scope) } : args || {};
|
|
1256
|
-
normalizedRenderer.
|
|
1278
|
+
normalizedRenderer.a(
|
|
1257
1279
|
childScope,
|
|
1258
1280
|
normalizedRenderer._ ? inputWithContent : [inputWithContent]
|
|
1259
1281
|
);
|
|
@@ -1262,9 +1284,25 @@ var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
|
1262
1284
|
}
|
|
1263
1285
|
};
|
|
1264
1286
|
};
|
|
1287
|
+
function _resume_dynamic_tag() {
|
|
1288
|
+
_resume("d", dynamicTagScript);
|
|
1289
|
+
}
|
|
1290
|
+
function dynamicTagScript(branch) {
|
|
1291
|
+
_attrs_script(
|
|
1292
|
+
branch,
|
|
1293
|
+
"a"
|
|
1294
|
+
);
|
|
1295
|
+
}
|
|
1265
1296
|
function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch2) {
|
|
1266
|
-
let referenceNode = scope[nodeAccessor], prevBranch = scope["
|
|
1267
|
-
referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(
|
|
1297
|
+
let referenceNode = scope[nodeAccessor], prevBranch = scope["D" /* ConditionalScope */ + nodeAccessor], parentNode = referenceNode.nodeType > 1 /* Element */ ? (prevBranch?.S || referenceNode).parentNode : referenceNode, newBranch = scope["D" /* ConditionalScope */ + nodeAccessor] = newRenderer && createBranch2(scope.$, newRenderer, scope, parentNode);
|
|
1298
|
+
referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(
|
|
1299
|
+
newBranch,
|
|
1300
|
+
parentNode,
|
|
1301
|
+
prevBranch.S
|
|
1302
|
+
) : parentNode.insertBefore(
|
|
1303
|
+
referenceNode,
|
|
1304
|
+
prevBranch.S
|
|
1305
|
+
), removeAndDestroyBranch(prevBranch)) : newBranch && (insertBranchBefore(newBranch, parentNode, referenceNode), referenceNode.remove());
|
|
1268
1306
|
}
|
|
1269
1307
|
function _for_of(nodeAccessor, renderer) {
|
|
1270
1308
|
return loop(
|
|
@@ -1300,17 +1338,22 @@ function _for_until(nodeAccessor, renderer) {
|
|
|
1300
1338
|
);
|
|
1301
1339
|
}
|
|
1302
1340
|
function loop(nodeAccessor, renderer, forEach) {
|
|
1303
|
-
let params = renderer.
|
|
1304
|
-
return enableBranches(), (scope, value) => {
|
|
1305
|
-
let referenceNode = scope[nodeAccessor], oldMap = scope["
|
|
1341
|
+
let params = renderer.a;
|
|
1342
|
+
return nodeAccessor = decodeAccessor(nodeAccessor), enableBranches(), (scope, value) => {
|
|
1343
|
+
let referenceNode = scope[nodeAccessor], oldMap = scope["M" /* LoopScopeMap */ + nodeAccessor], oldArray = oldMap ? scope["L" /* LoopScopeArray */ + nodeAccessor] || [
|
|
1306
1344
|
...oldMap.values()
|
|
1307
|
-
] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].
|
|
1345
|
+
] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].S.parentNode : referenceNode, newMap = scope["M" /* LoopScopeMap */ + nodeAccessor] = /* @__PURE__ */ new Map(), newArray = scope["L" /* LoopScopeArray */ + nodeAccessor] = [];
|
|
1308
1346
|
forEach(value, (key, args) => {
|
|
1309
|
-
let branch = oldMap?.get(key) || createAndSetupBranch(
|
|
1347
|
+
let branch = oldMap?.get(key) || createAndSetupBranch(
|
|
1348
|
+
scope.$,
|
|
1349
|
+
renderer,
|
|
1350
|
+
scope,
|
|
1351
|
+
parentNode
|
|
1352
|
+
);
|
|
1310
1353
|
params?.(branch, args), newMap.set(key, branch), newArray.push(branch);
|
|
1311
1354
|
});
|
|
1312
1355
|
let afterReference = null;
|
|
1313
|
-
referenceNode !== parentNode && (oldArray.length ? (afterReference = oldArray[oldArray.length - 1].
|
|
1356
|
+
referenceNode !== parentNode && (oldArray.length ? (afterReference = oldArray[oldArray.length - 1].L.nextSibling, newArray.length || parentNode.insertBefore(referenceNode, afterReference)) : newArray.length && (afterReference = referenceNode.nextSibling, referenceNode.remove())), reconcile(parentNode, oldArray, newArray, afterReference);
|
|
1314
1357
|
};
|
|
1315
1358
|
}
|
|
1316
1359
|
function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentScope, parentNode) {
|
|
@@ -1320,7 +1363,7 @@ function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentSco
|
|
|
1320
1363
|
parentScope,
|
|
1321
1364
|
parentNode
|
|
1322
1365
|
);
|
|
1323
|
-
return typeof tagNameOrRenderer == "string" ? branch
|
|
1366
|
+
return typeof tagNameOrRenderer == "string" ? branch.a = branch.S = branch.L = document.createElementNS(
|
|
1324
1367
|
tagNameOrRenderer === "svg" ? "http://www.w3.org/2000/svg" : tagNameOrRenderer === "math" ? "http://www.w3.org/1998/Math/MathML" : parentNode.namespaceURI,
|
|
1325
1368
|
tagNameOrRenderer
|
|
1326
1369
|
) : setupBranch(tagNameOrRenderer, branch), branch;
|
|
@@ -1334,20 +1377,20 @@ function byFirstArg(name) {
|
|
|
1334
1377
|
|
|
1335
1378
|
// src/dom/queue.ts
|
|
1336
1379
|
var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, scopeKeyOffset = 1e3;
|
|
1337
|
-
function queueRender(scope, signal, signalKey, value, scopeKey = scope.
|
|
1380
|
+
function queueRender(scope, signal, signalKey, value, scopeKey = scope.M) {
|
|
1338
1381
|
let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
|
|
1339
1382
|
if (existingRender)
|
|
1340
|
-
existingRender.
|
|
1383
|
+
existingRender.m = value;
|
|
1341
1384
|
else {
|
|
1342
1385
|
let render = {
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1386
|
+
e: key,
|
|
1387
|
+
c: scope,
|
|
1388
|
+
q: signal,
|
|
1389
|
+
m: value
|
|
1347
1390
|
}, i = pendingRenders.push(render) - 1;
|
|
1348
1391
|
for (; i; ) {
|
|
1349
1392
|
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
|
1350
|
-
if (key - parent.
|
|
1393
|
+
if (key - parent.e >= 0) break;
|
|
1351
1394
|
pendingRenders[i] = parent, i = parentIndex;
|
|
1352
1395
|
}
|
|
1353
1396
|
signalKey >= 0 && pendingRendersLookup.set(key, render), pendingRenders[i] = render;
|
|
@@ -1383,43 +1426,43 @@ function runRenders() {
|
|
|
1383
1426
|
for (; pendingRenders.length; ) {
|
|
1384
1427
|
let render = pendingRenders[0], item = pendingRenders.pop();
|
|
1385
1428
|
if (render !== item) {
|
|
1386
|
-
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).
|
|
1429
|
+
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).e;
|
|
1387
1430
|
for (; i < mid; ) {
|
|
1388
1431
|
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
|
1389
|
-
if (right < pendingRenders.length && pendingRenders[right].
|
|
1432
|
+
if (right < pendingRenders.length && pendingRenders[right].e - pendingRenders[bestChild].e < 0 && (bestChild = right), pendingRenders[bestChild].e - key >= 0)
|
|
1390
1433
|
break;
|
|
1391
1434
|
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
|
1392
1435
|
}
|
|
1393
1436
|
pendingRenders[i] = item;
|
|
1394
1437
|
}
|
|
1395
|
-
render.
|
|
1438
|
+
render.c.G?.J || runRender(render);
|
|
1396
1439
|
}
|
|
1397
1440
|
for (let scope of pendingScopes)
|
|
1398
|
-
scope.
|
|
1441
|
+
scope.I = 0;
|
|
1399
1442
|
pendingScopes = [];
|
|
1400
1443
|
}
|
|
1401
|
-
var runRender = (render) => render.
|
|
1444
|
+
var runRender = (render) => render.q(render.c, render.m), _enable_catch = () => {
|
|
1402
1445
|
_enable_catch = () => {
|
|
1403
1446
|
}, enableBranches();
|
|
1404
1447
|
let handlePendingTry = (fn, scope, branch) => {
|
|
1405
1448
|
for (; branch; ) {
|
|
1406
|
-
if (branch.
|
|
1407
|
-
return (branch.
|
|
1408
|
-
branch = branch.
|
|
1449
|
+
if (branch.O)
|
|
1450
|
+
return (branch.K ||= []).push(fn, scope);
|
|
1451
|
+
branch = branch.N;
|
|
1409
1452
|
}
|
|
1410
1453
|
};
|
|
1411
1454
|
runEffects = /* @__PURE__ */ ((runEffects2) => (effects, checkPending = placeholderShown.has(effects)) => {
|
|
1412
1455
|
if (checkPending || caughtError.has(effects)) {
|
|
1413
1456
|
let i = 0, fn, scope, branch;
|
|
1414
1457
|
for (; i < effects.length; )
|
|
1415
|
-
fn = effects[i++], scope = effects[i++], branch = scope.
|
|
1458
|
+
fn = effects[i++], scope = effects[i++], branch = scope.G, !branch?.J && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope);
|
|
1416
1459
|
} else
|
|
1417
1460
|
runEffects2(effects);
|
|
1418
1461
|
})(runEffects), runRender = /* @__PURE__ */ ((runRender2) => (render) => {
|
|
1419
1462
|
try {
|
|
1420
1463
|
runRender2(render);
|
|
1421
1464
|
} catch (error) {
|
|
1422
|
-
renderCatch(render.
|
|
1465
|
+
renderCatch(render.c, error);
|
|
1423
1466
|
}
|
|
1424
1467
|
})(runRender);
|
|
1425
1468
|
};
|
|
@@ -1430,7 +1473,7 @@ function $signalReset(scope, id) {
|
|
|
1430
1473
|
ctrl && (queueEffect(ctrl, abort), scope.A[id] = void 0);
|
|
1431
1474
|
}
|
|
1432
1475
|
function $signal(scope, id) {
|
|
1433
|
-
return scope.
|
|
1476
|
+
return scope.G && (scope.G.B ||= /* @__PURE__ */ new Set()).add(scope), ((scope.A ||= {})[id] ||= new AbortController()).signal;
|
|
1434
1477
|
}
|
|
1435
1478
|
function abort(ctrl) {
|
|
1436
1479
|
ctrl.abort();
|
|
@@ -1452,13 +1495,13 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
|
1452
1495
|
_resume(RENDERER_REGISTER_ID, fn);
|
|
1453
1496
|
},
|
|
1454
1497
|
isRenderer(renderer) {
|
|
1455
|
-
return renderer.
|
|
1498
|
+
return renderer.g;
|
|
1456
1499
|
},
|
|
1457
1500
|
getStartNode(branch) {
|
|
1458
|
-
return branch.
|
|
1501
|
+
return branch.S;
|
|
1459
1502
|
},
|
|
1460
1503
|
setScopeNodes(branch, startNode, endNode) {
|
|
1461
|
-
branch.
|
|
1504
|
+
branch.S = startNode, branch.L = endNode;
|
|
1462
1505
|
},
|
|
1463
1506
|
runComponentEffects() {
|
|
1464
1507
|
this.effects && runEffects(this.effects);
|
|
@@ -1474,9 +1517,9 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
|
1474
1517
|
},
|
|
1475
1518
|
createRenderer(params, clone) {
|
|
1476
1519
|
let renderer = _content_branch(0, 0, 0, params);
|
|
1477
|
-
return renderer.
|
|
1520
|
+
return renderer.g = (branch) => {
|
|
1478
1521
|
let cloned = clone();
|
|
1479
|
-
branch.
|
|
1522
|
+
branch.S = cloned.startNode, branch.L = cloned.endNode;
|
|
1480
1523
|
}, renderer;
|
|
1481
1524
|
},
|
|
1482
1525
|
render(out, component, renderer, args) {
|
|
@@ -1490,11 +1533,14 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
|
1490
1533
|
branch || (created = 1, branch = component.scope = createAndSetupBranch(
|
|
1491
1534
|
out.global,
|
|
1492
1535
|
renderer,
|
|
1493
|
-
renderer.
|
|
1536
|
+
renderer.d,
|
|
1494
1537
|
document.body
|
|
1495
|
-
)), renderer.
|
|
1538
|
+
)), renderer.a?.(branch, renderer._ ? args[0] : args);
|
|
1496
1539
|
}), created)
|
|
1497
|
-
return toInsertNode(
|
|
1540
|
+
return toInsertNode(
|
|
1541
|
+
branch.S,
|
|
1542
|
+
branch.L
|
|
1543
|
+
);
|
|
1498
1544
|
}
|
|
1499
1545
|
};
|
|
1500
1546
|
|
|
@@ -1529,21 +1575,21 @@ function mount(input = {}, reference, position) {
|
|
|
1529
1575
|
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
1530
1576
|
break;
|
|
1531
1577
|
}
|
|
1532
|
-
let curValue, args = this.
|
|
1578
|
+
let curValue, args = this.a, effects = prepareEffects(() => {
|
|
1533
1579
|
branch = createBranch(
|
|
1534
1580
|
$global,
|
|
1535
1581
|
this,
|
|
1536
1582
|
void 0,
|
|
1537
1583
|
parentNode
|
|
1538
|
-
), branch.
|
|
1584
|
+
), branch.T = (newValue) => {
|
|
1539
1585
|
curValue = newValue;
|
|
1540
|
-
}, this.
|
|
1586
|
+
}, this.h?.(branch), args?.(branch, input);
|
|
1541
1587
|
});
|
|
1542
1588
|
return insertChildNodes(
|
|
1543
1589
|
parentNode,
|
|
1544
1590
|
nextSibling,
|
|
1545
|
-
branch.
|
|
1546
|
-
branch.
|
|
1591
|
+
branch.S,
|
|
1592
|
+
branch.L
|
|
1547
1593
|
), runEffects(effects), {
|
|
1548
1594
|
get value() {
|
|
1549
1595
|
return curValue;
|