marko 6.0.50 → 6.0.51

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.
@@ -29,6 +29,7 @@ export declare enum ResumeSymbol {
29
29
  BranchStart = "[",
30
30
  BranchEnd = "]",
31
31
  BranchSingleNode = "|",
32
+ BranchNativeTag = "'",
32
33
  BranchSingleNodeOnlyChildInParent = "="
33
34
  }
34
35
  export { AccessorPrefix, AccessorProp } from "./accessor.debug";
package/dist/debug/dom.js CHANGED
@@ -248,6 +248,132 @@ function stripSpacesAndPunctuation(str) {
248
248
  var DEFAULT_RUNTIME_ID = "M";
249
249
  var DEFAULT_RENDER_ID = "_";
250
250
 
251
+ // src/dom/scope.ts
252
+ function createScope($global, closestBranch) {
253
+ const scope = {
254
+ ___id: $global.___nextScopeId++,
255
+ ___creating: 1,
256
+ ___closestBranch: closestBranch,
257
+ $global
258
+ };
259
+ pendingScopes.push(scope);
260
+ return scope;
261
+ }
262
+ function skipScope(scope) {
263
+ return scope.$global.___nextScopeId++;
264
+ }
265
+ function findBranchWithKey(scope, key) {
266
+ let branch = scope.___closestBranch;
267
+ while (branch && !branch[key]) {
268
+ branch = branch.___parentBranch;
269
+ }
270
+ return branch;
271
+ }
272
+ function destroyBranch(branch) {
273
+ branch.___parentBranch?.___branchScopes?.delete(branch);
274
+ destroyNestedBranches(branch);
275
+ }
276
+ function destroyNestedBranches(branch) {
277
+ branch.___destroyed = 1;
278
+ branch.___branchScopes?.forEach(destroyNestedBranches);
279
+ branch.___abortScopes?.forEach((scope) => {
280
+ for (const id in scope.___abortControllers) {
281
+ scope.___abortControllers[id]?.abort();
282
+ }
283
+ });
284
+ }
285
+ function removeAndDestroyBranch(branch) {
286
+ destroyBranch(branch);
287
+ removeChildNodes(branch.___startNode, branch.___endNode);
288
+ }
289
+ function insertBranchBefore(branch, parentNode, nextSibling) {
290
+ insertChildNodes(
291
+ parentNode,
292
+ nextSibling,
293
+ branch.___startNode,
294
+ branch.___endNode
295
+ );
296
+ }
297
+ function tempDetachBranch(branch) {
298
+ const fragment = new DocumentFragment();
299
+ fragment.namespaceURI = branch.___startNode.parentNode.namespaceURI;
300
+ insertChildNodes(fragment, null, branch.___startNode, branch.___endNode);
301
+ }
302
+
303
+ // src/dom/walker.ts
304
+ var walker = /* @__PURE__ */ document.createTreeWalker(document);
305
+ function walk(startNode, walkCodes, branch) {
306
+ walker.currentNode = startNode;
307
+ walkInternal(0, walkCodes, branch);
308
+ }
309
+ function walkInternal(currentWalkIndex, walkCodes, scope) {
310
+ let value2;
311
+ let storedMultiplier = 0;
312
+ let currentMultiplier = 0;
313
+ let currentScopeIndex = 0;
314
+ for (; currentWalkIndex < walkCodes.length; ) {
315
+ value2 = walkCodes.charCodeAt(currentWalkIndex++);
316
+ currentMultiplier = storedMultiplier;
317
+ storedMultiplier = 0;
318
+ if (value2 === 32 /* Get */) {
319
+ const node = walker.currentNode;
320
+ scope[true ? getDebugKey(currentScopeIndex, walker.currentNode) : currentScopeIndex] = node;
321
+ scope["Getter:" /* Getter */ + (true ? getDebugKey(currentScopeIndex++, walker.currentNode) : currentScopeIndex++)] = () => node;
322
+ } else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */) {
323
+ walker.currentNode.replaceWith(
324
+ walker.currentNode = scope[true ? getDebugKey(currentScopeIndex++, "#text") : currentScopeIndex++] = new Text()
325
+ );
326
+ if (value2 === 49 /* DynamicTagWithVar */) {
327
+ scope[true ? getDebugKey(currentScopeIndex++, "#scopeOffset") : currentScopeIndex++] = skipScope(scope);
328
+ }
329
+ } else if (value2 === 38 /* EndChild */) {
330
+ return currentWalkIndex;
331
+ } else if (value2 === 47 /* BeginChild */ || value2 === 48 /* BeginChildWithVar */) {
332
+ currentWalkIndex = walkInternal(
333
+ currentWalkIndex,
334
+ walkCodes,
335
+ scope[true ? getDebugKey(currentScopeIndex++, "#childScope") : currentScopeIndex++] = createScope(scope.$global, scope.___closestBranch)
336
+ );
337
+ if (value2 === 48 /* BeginChildWithVar */) {
338
+ scope[true ? getDebugKey(currentScopeIndex++, "#scopeOffset") : currentScopeIndex++] = skipScope(scope);
339
+ }
340
+ } else if (value2 < 91 /* NextEnd */ + 1) {
341
+ value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */;
342
+ while (value2--) {
343
+ walker.nextNode();
344
+ }
345
+ } else if (value2 < 106 /* OverEnd */ + 1) {
346
+ value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */;
347
+ while (value2--) {
348
+ walker.nextSibling();
349
+ }
350
+ } else if (value2 < 116 /* OutEnd */ + 1) {
351
+ value2 = 10 /* Out */ * currentMultiplier + value2 - 107 /* Out */;
352
+ while (value2--) {
353
+ walker.parentNode();
354
+ }
355
+ walker.nextSibling();
356
+ } else {
357
+ if (value2 < 117 /* Multiplier */ || value2 > 126 /* MultiplierEnd */) {
358
+ throw new Error(`Unknown walk code: ${value2}`);
359
+ }
360
+ storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value2 - 117 /* Multiplier */;
361
+ }
362
+ }
363
+ }
364
+ function getDebugKey(index, node) {
365
+ if (typeof node === "string") {
366
+ return `${node}/${index}`;
367
+ } else if (node.nodeType === 3 /* Text */) {
368
+ return `#text/${index}`;
369
+ } else if (node.nodeType === 8 /* Comment */) {
370
+ return `#comment/${index}`;
371
+ } else if (node.nodeType === 1 /* Element */) {
372
+ return `#${node.tagName.toLowerCase()}/${index}`;
373
+ }
374
+ return index;
375
+ }
376
+
251
377
  // src/dom/resume.ts
252
378
  var registeredValues = {};
253
379
  var branchesEnabled;
@@ -329,6 +455,10 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
329
455
  );
330
456
  curNode = endBranch(childScopeId, curNode).___endNode;
331
457
  parentBranchIds.set(childScopeId, scopeId);
458
+ if (visitToken === "'" /* BranchNativeTag */) {
459
+ const childBranch = scopeLookup[childScopeId];
460
+ childBranch[true ? getDebugKey(0, curNode) : 0] = childBranch.___startNode = childBranch.___endNode = curNode;
461
+ }
332
462
  }
333
463
  }
334
464
  },
@@ -739,58 +869,6 @@ function parseHTML(html2, ns) {
739
869
  return parser.content || parser;
740
870
  }
741
871
 
742
- // src/dom/scope.ts
743
- function createScope($global, closestBranch) {
744
- const scope = {
745
- ___id: $global.___nextScopeId++,
746
- ___creating: 1,
747
- ___closestBranch: closestBranch,
748
- $global
749
- };
750
- pendingScopes.push(scope);
751
- return scope;
752
- }
753
- function skipScope(scope) {
754
- return scope.$global.___nextScopeId++;
755
- }
756
- function findBranchWithKey(scope, key) {
757
- let branch = scope.___closestBranch;
758
- while (branch && !branch[key]) {
759
- branch = branch.___parentBranch;
760
- }
761
- return branch;
762
- }
763
- function destroyBranch(branch) {
764
- branch.___parentBranch?.___branchScopes?.delete(branch);
765
- destroyNestedBranches(branch);
766
- }
767
- function destroyNestedBranches(branch) {
768
- branch.___destroyed = 1;
769
- branch.___branchScopes?.forEach(destroyNestedBranches);
770
- branch.___abortScopes?.forEach((scope) => {
771
- for (const id in scope.___abortControllers) {
772
- scope.___abortControllers[id]?.abort();
773
- }
774
- });
775
- }
776
- function removeAndDestroyBranch(branch) {
777
- destroyBranch(branch);
778
- removeChildNodes(branch.___startNode, branch.___endNode);
779
- }
780
- function insertBranchBefore(branch, parentNode, nextSibling) {
781
- insertChildNodes(
782
- parentNode,
783
- nextSibling,
784
- branch.___startNode,
785
- branch.___endNode
786
- );
787
- }
788
- function tempDetachBranch(branch) {
789
- const fragment = new DocumentFragment();
790
- fragment.namespaceURI = branch.___startNode.parentNode.namespaceURI;
791
- insertChildNodes(fragment, null, branch.___startNode, branch.___endNode);
792
- }
793
-
794
872
  // src/dom/schedule.ts
795
873
  var runTask;
796
874
  var isScheduled;
@@ -1026,80 +1104,6 @@ function hoist(...path) {
1026
1104
  };
1027
1105
  }
1028
1106
 
1029
- // src/dom/walker.ts
1030
- var walker = /* @__PURE__ */ document.createTreeWalker(document);
1031
- function walk(startNode, walkCodes, branch) {
1032
- walker.currentNode = startNode;
1033
- walkInternal(0, walkCodes, branch);
1034
- }
1035
- function walkInternal(currentWalkIndex, walkCodes, scope) {
1036
- let value2;
1037
- let storedMultiplier = 0;
1038
- let currentMultiplier = 0;
1039
- let currentScopeIndex = 0;
1040
- for (; currentWalkIndex < walkCodes.length; ) {
1041
- value2 = walkCodes.charCodeAt(currentWalkIndex++);
1042
- currentMultiplier = storedMultiplier;
1043
- storedMultiplier = 0;
1044
- if (value2 === 32 /* Get */) {
1045
- const node = walker.currentNode;
1046
- scope[true ? getDebugKey(currentScopeIndex, walker.currentNode) : currentScopeIndex] = node;
1047
- scope["Getter:" /* Getter */ + (true ? getDebugKey(currentScopeIndex++, walker.currentNode) : currentScopeIndex++)] = () => node;
1048
- } else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */) {
1049
- walker.currentNode.replaceWith(
1050
- walker.currentNode = scope[true ? getDebugKey(currentScopeIndex++, "#text") : currentScopeIndex++] = new Text()
1051
- );
1052
- if (value2 === 49 /* DynamicTagWithVar */) {
1053
- scope[true ? getDebugKey(currentScopeIndex++, "#scopeOffset") : currentScopeIndex++] = skipScope(scope);
1054
- }
1055
- } else if (value2 === 38 /* EndChild */) {
1056
- return currentWalkIndex;
1057
- } else if (value2 === 47 /* BeginChild */ || value2 === 48 /* BeginChildWithVar */) {
1058
- currentWalkIndex = walkInternal(
1059
- currentWalkIndex,
1060
- walkCodes,
1061
- scope[true ? getDebugKey(currentScopeIndex++, "#childScope") : currentScopeIndex++] = createScope(scope.$global, scope.___closestBranch)
1062
- );
1063
- if (value2 === 48 /* BeginChildWithVar */) {
1064
- scope[true ? getDebugKey(currentScopeIndex++, "#scopeOffset") : currentScopeIndex++] = skipScope(scope);
1065
- }
1066
- } else if (value2 < 91 /* NextEnd */ + 1) {
1067
- value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */;
1068
- while (value2--) {
1069
- walker.nextNode();
1070
- }
1071
- } else if (value2 < 106 /* OverEnd */ + 1) {
1072
- value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */;
1073
- while (value2--) {
1074
- walker.nextSibling();
1075
- }
1076
- } else if (value2 < 116 /* OutEnd */ + 1) {
1077
- value2 = 10 /* Out */ * currentMultiplier + value2 - 107 /* Out */;
1078
- while (value2--) {
1079
- walker.parentNode();
1080
- }
1081
- walker.nextSibling();
1082
- } else {
1083
- if (value2 < 117 /* Multiplier */ || value2 > 126 /* MultiplierEnd */) {
1084
- throw new Error(`Unknown walk code: ${value2}`);
1085
- }
1086
- storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value2 - 117 /* Multiplier */;
1087
- }
1088
- }
1089
- }
1090
- function getDebugKey(index, node) {
1091
- if (typeof node === "string") {
1092
- return `${node}/${index}`;
1093
- } else if (node.nodeType === 3 /* Text */) {
1094
- return `#text/${index}`;
1095
- } else if (node.nodeType === 8 /* Comment */) {
1096
- return `#comment/${index}`;
1097
- } else if (node.nodeType === 1 /* Element */) {
1098
- return `#${node.tagName.toLowerCase()}/${index}`;
1099
- }
1100
- return index;
1101
- }
1102
-
1103
1107
  // src/dom/renderer.ts
1104
1108
  function createBranch($global, renderer, parentScope, parentNode) {
1105
1109
  const branch = createScope($global);
@@ -1877,7 +1881,7 @@ var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, input
1877
1881
  const childScope = scope[childScopeAccessor];
1878
1882
  const args = getInput?.();
1879
1883
  if (typeof normalizedRenderer === "string") {
1880
- attrs(
1884
+ (getContent ? attrs : attrsAndContent)(
1881
1885
  childScope,
1882
1886
  true ? `#${normalizedRenderer}/0` : 0,
1883
1887
  (inputIsArgs ? args[0] : args) || {}
@@ -152,6 +152,132 @@ function stripSpacesAndPunctuation(str) {
152
152
  var DEFAULT_RUNTIME_ID = "M";
153
153
  var DEFAULT_RENDER_ID = "_";
154
154
 
155
+ // src/dom/scope.ts
156
+ function createScope($global, closestBranch) {
157
+ const scope = {
158
+ ___id: $global.___nextScopeId++,
159
+ ___creating: 1,
160
+ ___closestBranch: closestBranch,
161
+ $global
162
+ };
163
+ pendingScopes.push(scope);
164
+ return scope;
165
+ }
166
+ function skipScope(scope) {
167
+ return scope.$global.___nextScopeId++;
168
+ }
169
+ function findBranchWithKey(scope, key) {
170
+ let branch = scope.___closestBranch;
171
+ while (branch && !branch[key]) {
172
+ branch = branch.___parentBranch;
173
+ }
174
+ return branch;
175
+ }
176
+ function destroyBranch(branch) {
177
+ branch.___parentBranch?.___branchScopes?.delete(branch);
178
+ destroyNestedBranches(branch);
179
+ }
180
+ function destroyNestedBranches(branch) {
181
+ branch.___destroyed = 1;
182
+ branch.___branchScopes?.forEach(destroyNestedBranches);
183
+ branch.___abortScopes?.forEach((scope) => {
184
+ for (const id in scope.___abortControllers) {
185
+ scope.___abortControllers[id]?.abort();
186
+ }
187
+ });
188
+ }
189
+ function removeAndDestroyBranch(branch) {
190
+ destroyBranch(branch);
191
+ removeChildNodes(branch.___startNode, branch.___endNode);
192
+ }
193
+ function insertBranchBefore(branch, parentNode, nextSibling) {
194
+ insertChildNodes(
195
+ parentNode,
196
+ nextSibling,
197
+ branch.___startNode,
198
+ branch.___endNode
199
+ );
200
+ }
201
+ function tempDetachBranch(branch) {
202
+ const fragment = new DocumentFragment();
203
+ fragment.namespaceURI = branch.___startNode.parentNode.namespaceURI;
204
+ insertChildNodes(fragment, null, branch.___startNode, branch.___endNode);
205
+ }
206
+
207
+ // src/dom/walker.ts
208
+ var walker = /* @__PURE__ */ document.createTreeWalker(document);
209
+ function walk(startNode, walkCodes, branch) {
210
+ walker.currentNode = startNode;
211
+ walkInternal(0, walkCodes, branch);
212
+ }
213
+ function walkInternal(currentWalkIndex, walkCodes, scope) {
214
+ let value2;
215
+ let storedMultiplier = 0;
216
+ let currentMultiplier = 0;
217
+ let currentScopeIndex = 0;
218
+ for (; currentWalkIndex < walkCodes.length; ) {
219
+ value2 = walkCodes.charCodeAt(currentWalkIndex++);
220
+ currentMultiplier = storedMultiplier;
221
+ storedMultiplier = 0;
222
+ if (value2 === 32 /* Get */) {
223
+ const node = walker.currentNode;
224
+ scope[true ? getDebugKey(currentScopeIndex, walker.currentNode) : currentScopeIndex] = node;
225
+ scope["Getter:" /* Getter */ + (true ? getDebugKey(currentScopeIndex++, walker.currentNode) : currentScopeIndex++)] = () => node;
226
+ } else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */) {
227
+ walker.currentNode.replaceWith(
228
+ walker.currentNode = scope[true ? getDebugKey(currentScopeIndex++, "#text") : currentScopeIndex++] = new Text()
229
+ );
230
+ if (value2 === 49 /* DynamicTagWithVar */) {
231
+ scope[true ? getDebugKey(currentScopeIndex++, "#scopeOffset") : currentScopeIndex++] = skipScope(scope);
232
+ }
233
+ } else if (value2 === 38 /* EndChild */) {
234
+ return currentWalkIndex;
235
+ } else if (value2 === 47 /* BeginChild */ || value2 === 48 /* BeginChildWithVar */) {
236
+ currentWalkIndex = walkInternal(
237
+ currentWalkIndex,
238
+ walkCodes,
239
+ scope[true ? getDebugKey(currentScopeIndex++, "#childScope") : currentScopeIndex++] = createScope(scope.$global, scope.___closestBranch)
240
+ );
241
+ if (value2 === 48 /* BeginChildWithVar */) {
242
+ scope[true ? getDebugKey(currentScopeIndex++, "#scopeOffset") : currentScopeIndex++] = skipScope(scope);
243
+ }
244
+ } else if (value2 < 91 /* NextEnd */ + 1) {
245
+ value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */;
246
+ while (value2--) {
247
+ walker.nextNode();
248
+ }
249
+ } else if (value2 < 106 /* OverEnd */ + 1) {
250
+ value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */;
251
+ while (value2--) {
252
+ walker.nextSibling();
253
+ }
254
+ } else if (value2 < 116 /* OutEnd */ + 1) {
255
+ value2 = 10 /* Out */ * currentMultiplier + value2 - 107 /* Out */;
256
+ while (value2--) {
257
+ walker.parentNode();
258
+ }
259
+ walker.nextSibling();
260
+ } else {
261
+ if (value2 < 117 /* Multiplier */ || value2 > 126 /* MultiplierEnd */) {
262
+ throw new Error(`Unknown walk code: ${value2}`);
263
+ }
264
+ storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value2 - 117 /* Multiplier */;
265
+ }
266
+ }
267
+ }
268
+ function getDebugKey(index, node) {
269
+ if (typeof node === "string") {
270
+ return `${node}/${index}`;
271
+ } else if (node.nodeType === 3 /* Text */) {
272
+ return `#text/${index}`;
273
+ } else if (node.nodeType === 8 /* Comment */) {
274
+ return `#comment/${index}`;
275
+ } else if (node.nodeType === 1 /* Element */) {
276
+ return `#${node.tagName.toLowerCase()}/${index}`;
277
+ }
278
+ return index;
279
+ }
280
+
155
281
  // src/dom/resume.ts
156
282
  var registeredValues = {};
157
283
  var branchesEnabled;
@@ -233,6 +359,10 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
233
359
  );
234
360
  curNode = endBranch(childScopeId, curNode).___endNode;
235
361
  parentBranchIds.set(childScopeId, scopeId);
362
+ if (visitToken === "'" /* BranchNativeTag */) {
363
+ const childBranch = scopeLookup[childScopeId];
364
+ childBranch[true ? getDebugKey(0, curNode) : 0] = childBranch.___startNode = childBranch.___endNode = curNode;
365
+ }
236
366
  }
237
367
  }
238
368
  },
@@ -643,58 +773,6 @@ function parseHTML(html2, ns) {
643
773
  return parser.content || parser;
644
774
  }
645
775
 
646
- // src/dom/scope.ts
647
- function createScope($global, closestBranch) {
648
- const scope = {
649
- ___id: $global.___nextScopeId++,
650
- ___creating: 1,
651
- ___closestBranch: closestBranch,
652
- $global
653
- };
654
- pendingScopes.push(scope);
655
- return scope;
656
- }
657
- function skipScope(scope) {
658
- return scope.$global.___nextScopeId++;
659
- }
660
- function findBranchWithKey(scope, key) {
661
- let branch = scope.___closestBranch;
662
- while (branch && !branch[key]) {
663
- branch = branch.___parentBranch;
664
- }
665
- return branch;
666
- }
667
- function destroyBranch(branch) {
668
- branch.___parentBranch?.___branchScopes?.delete(branch);
669
- destroyNestedBranches(branch);
670
- }
671
- function destroyNestedBranches(branch) {
672
- branch.___destroyed = 1;
673
- branch.___branchScopes?.forEach(destroyNestedBranches);
674
- branch.___abortScopes?.forEach((scope) => {
675
- for (const id in scope.___abortControllers) {
676
- scope.___abortControllers[id]?.abort();
677
- }
678
- });
679
- }
680
- function removeAndDestroyBranch(branch) {
681
- destroyBranch(branch);
682
- removeChildNodes(branch.___startNode, branch.___endNode);
683
- }
684
- function insertBranchBefore(branch, parentNode, nextSibling) {
685
- insertChildNodes(
686
- parentNode,
687
- nextSibling,
688
- branch.___startNode,
689
- branch.___endNode
690
- );
691
- }
692
- function tempDetachBranch(branch) {
693
- const fragment = new DocumentFragment();
694
- fragment.namespaceURI = branch.___startNode.parentNode.namespaceURI;
695
- insertChildNodes(fragment, null, branch.___startNode, branch.___endNode);
696
- }
697
-
698
776
  // src/dom/schedule.ts
699
777
  var runTask;
700
778
  var isScheduled;
@@ -930,80 +1008,6 @@ function hoist(...path) {
930
1008
  };
931
1009
  }
932
1010
 
933
- // src/dom/walker.ts
934
- var walker = /* @__PURE__ */ document.createTreeWalker(document);
935
- function walk(startNode, walkCodes, branch) {
936
- walker.currentNode = startNode;
937
- walkInternal(0, walkCodes, branch);
938
- }
939
- function walkInternal(currentWalkIndex, walkCodes, scope) {
940
- let value2;
941
- let storedMultiplier = 0;
942
- let currentMultiplier = 0;
943
- let currentScopeIndex = 0;
944
- for (; currentWalkIndex < walkCodes.length; ) {
945
- value2 = walkCodes.charCodeAt(currentWalkIndex++);
946
- currentMultiplier = storedMultiplier;
947
- storedMultiplier = 0;
948
- if (value2 === 32 /* Get */) {
949
- const node = walker.currentNode;
950
- scope[true ? getDebugKey(currentScopeIndex, walker.currentNode) : currentScopeIndex] = node;
951
- scope["Getter:" /* Getter */ + (true ? getDebugKey(currentScopeIndex++, walker.currentNode) : currentScopeIndex++)] = () => node;
952
- } else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */) {
953
- walker.currentNode.replaceWith(
954
- walker.currentNode = scope[true ? getDebugKey(currentScopeIndex++, "#text") : currentScopeIndex++] = new Text()
955
- );
956
- if (value2 === 49 /* DynamicTagWithVar */) {
957
- scope[true ? getDebugKey(currentScopeIndex++, "#scopeOffset") : currentScopeIndex++] = skipScope(scope);
958
- }
959
- } else if (value2 === 38 /* EndChild */) {
960
- return currentWalkIndex;
961
- } else if (value2 === 47 /* BeginChild */ || value2 === 48 /* BeginChildWithVar */) {
962
- currentWalkIndex = walkInternal(
963
- currentWalkIndex,
964
- walkCodes,
965
- scope[true ? getDebugKey(currentScopeIndex++, "#childScope") : currentScopeIndex++] = createScope(scope.$global, scope.___closestBranch)
966
- );
967
- if (value2 === 48 /* BeginChildWithVar */) {
968
- scope[true ? getDebugKey(currentScopeIndex++, "#scopeOffset") : currentScopeIndex++] = skipScope(scope);
969
- }
970
- } else if (value2 < 91 /* NextEnd */ + 1) {
971
- value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */;
972
- while (value2--) {
973
- walker.nextNode();
974
- }
975
- } else if (value2 < 106 /* OverEnd */ + 1) {
976
- value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */;
977
- while (value2--) {
978
- walker.nextSibling();
979
- }
980
- } else if (value2 < 116 /* OutEnd */ + 1) {
981
- value2 = 10 /* Out */ * currentMultiplier + value2 - 107 /* Out */;
982
- while (value2--) {
983
- walker.parentNode();
984
- }
985
- walker.nextSibling();
986
- } else {
987
- if (value2 < 117 /* Multiplier */ || value2 > 126 /* MultiplierEnd */) {
988
- throw new Error(`Unknown walk code: ${value2}`);
989
- }
990
- storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value2 - 117 /* Multiplier */;
991
- }
992
- }
993
- }
994
- function getDebugKey(index, node) {
995
- if (typeof node === "string") {
996
- return `${node}/${index}`;
997
- } else if (node.nodeType === 3 /* Text */) {
998
- return `#text/${index}`;
999
- } else if (node.nodeType === 8 /* Comment */) {
1000
- return `#comment/${index}`;
1001
- } else if (node.nodeType === 1 /* Element */) {
1002
- return `#${node.tagName.toLowerCase()}/${index}`;
1003
- }
1004
- return index;
1005
- }
1006
-
1007
1011
  // src/dom/renderer.ts
1008
1012
  function createBranch($global, renderer, parentScope, parentNode) {
1009
1013
  const branch = createScope($global);
@@ -1781,7 +1785,7 @@ var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, input
1781
1785
  const childScope = scope[childScopeAccessor];
1782
1786
  const args = getInput?.();
1783
1787
  if (typeof normalizedRenderer === "string") {
1784
- attrs(
1788
+ (getContent ? attrs : attrsAndContent)(
1785
1789
  childScope,
1786
1790
  true ? `#${normalizedRenderer}/0` : 0,
1787
1791
  (inputIsArgs ? args[0] : args) || {}
@@ -3128,48 +3128,51 @@ var dynamicTag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, ser
3128
3128
  let result;
3129
3129
  if (typeof renderer === "string") {
3130
3130
  const input = (inputIsArgs ? inputOrArgs[0] : inputOrArgs) || {};
3131
- const renderContent = content || normalizeDynamicRenderer(input.content);
3132
3131
  nextScopeId();
3133
- write(`<${renderer}${attrs(input, accessor, scopeId, renderer)}>`);
3132
+ write(
3133
+ `<${renderer}${attrs(input, true ? `#${renderer}/0` : 0, branchId, renderer)}>`
3134
+ );
3134
3135
  if (!voidElementsReg.test(renderer)) {
3135
- const renderNativeTag = () => {
3136
- if (renderer === "textarea") {
3137
- if (content) {
3138
- throw new Error(
3139
- "A dynamic tag rendering a `<textarea>` cannot have `content` and must use the `value` attribute instead."
3140
- );
3141
- }
3142
- write(
3143
- controllable_textarea_value(
3144
- scopeId,
3145
- accessor,
3146
- input.value,
3147
- input.valueChange
3148
- )
3136
+ const renderContent = content || normalizeDynamicRenderer(input.content);
3137
+ if (renderer === "textarea") {
3138
+ if (renderContent) {
3139
+ throw new Error(
3140
+ "A dynamic tag rendering a `<textarea>` cannot have `content` and must use the `value` attribute instead."
3141
+ );
3142
+ }
3143
+ write(
3144
+ controllable_textarea_value(
3145
+ branchId,
3146
+ true ? `#${renderer}/0` : 0,
3147
+ input.value,
3148
+ input.valueChange
3149
+ )
3150
+ );
3151
+ } else if (renderContent) {
3152
+ if (typeof renderContent !== "function") {
3153
+ throw new Error(
3154
+ `Body content is not supported for the \`<${renderer}>\` tag.`
3155
+ );
3156
+ }
3157
+ if (renderer === "select" && ("value" in input || "valueChange" in input)) {
3158
+ controllable_select_value(
3159
+ branchId,
3160
+ true ? `#${renderer}/0` : 0,
3161
+ input.value,
3162
+ input.valueChange,
3163
+ renderContent
3164
+ );
3165
+ } else {
3166
+ dynamicTag(
3167
+ branchId,
3168
+ true ? `#${renderer}/0` : 0,
3169
+ renderContent,
3170
+ [],
3171
+ 0,
3172
+ 1,
3173
+ serializeReason
3149
3174
  );
3150
- } else if (renderContent) {
3151
- if (typeof renderContent !== "function") {
3152
- throw new Error(
3153
- `Body content is not supported for the \`<${renderer}>\` tag.`
3154
- );
3155
- }
3156
- if (renderer === "select" && ("value" in input || "valueChange" in input)) {
3157
- controllable_select_value(
3158
- scopeId,
3159
- accessor,
3160
- input.value,
3161
- input.valueChange,
3162
- renderContent
3163
- );
3164
- } else {
3165
- renderContent();
3166
- }
3167
3175
  }
3168
- };
3169
- if (shouldResume) {
3170
- withBranchId(branchId, renderNativeTag);
3171
- } else {
3172
- renderNativeTag();
3173
3176
  }
3174
3177
  write(`</${renderer}>`);
3175
3178
  } else if (content) {
@@ -3180,7 +3183,7 @@ var dynamicTag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, ser
3180
3183
  if (shouldResume) {
3181
3184
  write(
3182
3185
  state.mark(
3183
- "|" /* BranchSingleNode */,
3186
+ "'" /* BranchNativeTag */,
3184
3187
  scopeId + " " + accessor + " " + branchId
3185
3188
  )
3186
3189
  );