@marko/runtime-tags 0.3.0 → 0.3.1
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/translator/index.js +853 -479
- package/dist/translator/util/evaluate.d.ts +1 -1
- package/dist/translator/util/get-root.d.ts +1 -1
- package/dist/translator/util/is-core-tag.d.ts +0 -1
- package/dist/translator/util/runtime-info.d.ts +5 -0
- package/dist/translator/util/runtime.d.ts +3 -3
- package/dist/translator/util/signals.d.ts +1 -1
- package/dist/translator/util/to-first-expression-or-block.d.ts +2 -2
- package/dist/translator/util/to-property-name.d.ts +1 -1
- package/dist/translator/util/walks.d.ts +1 -1
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
|
@@ -6,8 +6,8 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
9
|
-
for (var
|
|
10
|
-
__defProp(target,
|
|
9
|
+
for (var name2 in all)
|
|
10
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
11
11
|
};
|
|
12
12
|
var __copyProps = (to, from, except, desc) => {
|
|
13
13
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -39,56 +39,16 @@ __export(translator_exports, {
|
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(translator_exports);
|
|
41
41
|
|
|
42
|
-
// src/translator/util/
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// src/translator/util/is-core-tag.ts
|
|
51
|
-
var taglibId = "marko-core";
|
|
52
|
-
var htmlTaglibId = "marko-html";
|
|
53
|
-
var interopTaglibId = "@marko/translator-interop-class-tags";
|
|
54
|
-
function isCoreTag(tag) {
|
|
55
|
-
if (tag.isMarkoTag()) {
|
|
56
|
-
const tagDef = (0, import_babel_utils.getTagDef)(tag);
|
|
57
|
-
if (tagDef) {
|
|
58
|
-
switch (tagDef.taglibId) {
|
|
59
|
-
case taglibId:
|
|
60
|
-
case interopTaglibId:
|
|
61
|
-
return true;
|
|
62
|
-
case htmlTaglibId:
|
|
63
|
-
switch (tagDef.name) {
|
|
64
|
-
case "script":
|
|
65
|
-
case "style":
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
function isCoreTagName(tag, name) {
|
|
75
|
-
return isCoreTag(tag) && getTagName(tag) === name;
|
|
76
|
-
}
|
|
77
|
-
function isConditionTag(tag) {
|
|
78
|
-
if (isCoreTag(tag)) {
|
|
79
|
-
switch (getTagName(tag)) {
|
|
80
|
-
case "if":
|
|
81
|
-
case "else-if":
|
|
82
|
-
case "else":
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
42
|
+
// src/translator/util/runtime-info.ts
|
|
43
|
+
var import_package = require("../../package.json");
|
|
44
|
+
var runtime_info_default = {
|
|
45
|
+
name: import_package.name,
|
|
46
|
+
taglibId: "marko-core"
|
|
47
|
+
};
|
|
88
48
|
|
|
89
49
|
// src/translator/core/attrs.ts
|
|
90
50
|
var import_compiler = require("@marko/compiler");
|
|
91
|
-
var
|
|
51
|
+
var import_babel_utils = require("@marko/compiler/babel-utils");
|
|
92
52
|
|
|
93
53
|
// src/translator/util/assert.ts
|
|
94
54
|
function assertNoSpreadAttrs(tag) {
|
|
@@ -112,12 +72,12 @@ function assertNoBodyContent(tag) {
|
|
|
112
72
|
var attrs_default = {
|
|
113
73
|
migrate: [
|
|
114
74
|
(tag) => {
|
|
115
|
-
(0,
|
|
116
|
-
(0,
|
|
117
|
-
(0,
|
|
75
|
+
(0, import_babel_utils.assertNoArgs)(tag);
|
|
76
|
+
(0, import_babel_utils.assertNoParams)(tag);
|
|
77
|
+
(0, import_babel_utils.assertNoAttributes)(tag);
|
|
118
78
|
assertNoBodyContent(tag);
|
|
119
|
-
(0,
|
|
120
|
-
(0,
|
|
79
|
+
(0, import_babel_utils.assertNoAttributeTags)(tag);
|
|
80
|
+
(0, import_babel_utils.diagnosticDeprecate)(tag, {
|
|
121
81
|
label: "The `attrs` tag is deprecated, prefer destructuring `input` via the `const` tag.",
|
|
122
82
|
fix() {
|
|
123
83
|
const tagVar = tag.node.var;
|
|
@@ -148,7 +108,7 @@ var attrs_default = {
|
|
|
148
108
|
|
|
149
109
|
// src/translator/core/client.ts
|
|
150
110
|
var import_compiler2 = require("@marko/compiler");
|
|
151
|
-
var
|
|
111
|
+
var import_babel_utils2 = require("@marko/compiler/babel-utils");
|
|
152
112
|
var client_default = {
|
|
153
113
|
parse(tag) {
|
|
154
114
|
const {
|
|
@@ -158,7 +118,7 @@ var client_default = {
|
|
|
158
118
|
const rawValue = node.rawValue;
|
|
159
119
|
const code = rawValue.replace(/^client\s*/, "").trim();
|
|
160
120
|
const start = node.name.start + (rawValue.length - code.length);
|
|
161
|
-
let body = (0,
|
|
121
|
+
let body = (0, import_babel_utils2.parseStatements)(file, code, start, start + code.length);
|
|
162
122
|
if (body.length === 1 && import_compiler2.types.isBlockStatement(body[0])) {
|
|
163
123
|
body = body[0].body;
|
|
164
124
|
}
|
|
@@ -182,14 +142,14 @@ var import_compiler24 = require("@marko/compiler");
|
|
|
182
142
|
var import_babel_utils12 = require("@marko/compiler/babel-utils");
|
|
183
143
|
|
|
184
144
|
// src/translator/util/evaluate.ts
|
|
185
|
-
var
|
|
145
|
+
var import_babel_utils3 = require("@marko/compiler/babel-utils");
|
|
186
146
|
function evaluate(value) {
|
|
187
147
|
let { extra } = value;
|
|
188
148
|
if (!extra) {
|
|
189
149
|
extra = value.extra = {};
|
|
190
150
|
}
|
|
191
151
|
if (extra.confident === void 0) {
|
|
192
|
-
const computed = (0,
|
|
152
|
+
const computed = (0, import_babel_utils3.computeNode)(value);
|
|
193
153
|
if (computed) {
|
|
194
154
|
extra.computed = computed.value;
|
|
195
155
|
extra.confident = true;
|
|
@@ -220,7 +180,7 @@ function bindingHasDownstreamExpressions(binding) {
|
|
|
220
180
|
|
|
221
181
|
// src/translator/util/entry-builder.ts
|
|
222
182
|
var import_compiler3 = require("@marko/compiler");
|
|
223
|
-
var
|
|
183
|
+
var import_babel_utils4 = require("@marko/compiler/babel-utils");
|
|
224
184
|
var kState = Symbol();
|
|
225
185
|
var entry_builder_default = {
|
|
226
186
|
build(entryFile) {
|
|
@@ -238,7 +198,7 @@ var entry_builder_default = {
|
|
|
238
198
|
import_compiler3.types.importDeclaration(
|
|
239
199
|
[import_compiler3.types.importSpecifier(import_compiler3.types.identifier("init"), import_compiler3.types.identifier("init"))],
|
|
240
200
|
import_compiler3.types.stringLiteral(
|
|
241
|
-
|
|
201
|
+
`${runtime_info_default.name}/${entryFile.markoOpts.optimize ? "" : "debug/"}dom`
|
|
242
202
|
)
|
|
243
203
|
)
|
|
244
204
|
);
|
|
@@ -255,7 +215,7 @@ var entry_builder_default = {
|
|
|
255
215
|
};
|
|
256
216
|
const { analyzedTags } = file.metadata.marko;
|
|
257
217
|
state.imports.push(
|
|
258
|
-
(0,
|
|
218
|
+
(0, import_babel_utils4.resolveRelativePath)(entryFile, file.opts.filename)
|
|
259
219
|
);
|
|
260
220
|
state.init ||= file.path.node.extra.hasInteractiveChild || file.path.node.extra.isInteractive || false;
|
|
261
221
|
for (const tag of analyzedTags || []) {
|
|
@@ -583,6 +543,53 @@ function joinRepeatable(compare, a, b) {
|
|
|
583
543
|
var import_compiler5 = require("@marko/compiler");
|
|
584
544
|
var import_babel_utils7 = require("@marko/compiler/babel-utils");
|
|
585
545
|
|
|
546
|
+
// src/translator/util/is-core-tag.ts
|
|
547
|
+
var import_babel_utils5 = require("@marko/compiler/babel-utils");
|
|
548
|
+
|
|
549
|
+
// src/translator/util/get-tag-name.ts
|
|
550
|
+
function getTagName(tag) {
|
|
551
|
+
return tag.node.name.value;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// src/translator/util/is-core-tag.ts
|
|
555
|
+
var { taglibId } = runtime_info_default;
|
|
556
|
+
var htmlTaglibId = "marko-html";
|
|
557
|
+
var interopTaglibId = "@marko/translator-interop-class-tags";
|
|
558
|
+
function isCoreTag(tag) {
|
|
559
|
+
if (tag.isMarkoTag()) {
|
|
560
|
+
const tagDef = (0, import_babel_utils5.getTagDef)(tag);
|
|
561
|
+
if (tagDef) {
|
|
562
|
+
switch (tagDef.taglibId) {
|
|
563
|
+
case taglibId:
|
|
564
|
+
case interopTaglibId:
|
|
565
|
+
return true;
|
|
566
|
+
case htmlTaglibId:
|
|
567
|
+
switch (tagDef.name) {
|
|
568
|
+
case "script":
|
|
569
|
+
case "style":
|
|
570
|
+
return true;
|
|
571
|
+
}
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
function isCoreTagName(tag, name2) {
|
|
579
|
+
return isCoreTag(tag) && getTagName(tag) === name2;
|
|
580
|
+
}
|
|
581
|
+
function isConditionTag(tag) {
|
|
582
|
+
if (isCoreTag(tag)) {
|
|
583
|
+
switch (getTagName(tag)) {
|
|
584
|
+
case "if":
|
|
585
|
+
case "else-if":
|
|
586
|
+
case "else":
|
|
587
|
+
return true;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
|
|
586
593
|
// src/translator/util/state.ts
|
|
587
594
|
var createProgramState = (init) => {
|
|
588
595
|
const map2 = /* @__PURE__ */ new WeakMap();
|
|
@@ -631,26 +638,26 @@ var TAG_NAME_IDENTIFIER_REG = /^[A-Z][a-zA-Z0-9_$]*$/;
|
|
|
631
638
|
function analyzeTagNameType(tag) {
|
|
632
639
|
const extra = tag.node.extra ??= {};
|
|
633
640
|
if (extra.tagNameType === void 0) {
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
636
|
-
extra.tagNameType =
|
|
641
|
+
const name2 = tag.get("name");
|
|
642
|
+
if (name2.isStringLiteral()) {
|
|
643
|
+
extra.tagNameType = name2.node.value[0] === "@" ? 3 /* AttributeTag */ : (0, import_babel_utils6.isNativeTag)(tag) ? 0 /* NativeTag */ : 1 /* CustomTag */;
|
|
637
644
|
if (extra.tagNameType === 1 /* CustomTag */) {
|
|
638
|
-
const bindingName =
|
|
645
|
+
const bindingName = name2.node.value;
|
|
639
646
|
const bindingIdentifier = tag.scope.getBinding(bindingName)?.identifier;
|
|
640
647
|
if (bindingIdentifier && TAG_NAME_IDENTIFIER_REG.test(bindingIdentifier.name)) {
|
|
641
648
|
const tagIdentifier = withPreviousLocation(
|
|
642
649
|
import_compiler4.types.identifier(bindingName),
|
|
643
|
-
|
|
650
|
+
name2.node
|
|
644
651
|
);
|
|
645
652
|
tagIdentifier.extra = {
|
|
646
653
|
referencedBindings: bindingIdentifier.extra?.binding
|
|
647
654
|
};
|
|
648
|
-
analyzeExpressionTagName(
|
|
655
|
+
analyzeExpressionTagName(name2.replaceWith(tagIdentifier)[0], extra);
|
|
649
656
|
}
|
|
650
657
|
}
|
|
651
658
|
extra.tagNameNullable = extra.tagNameNullable = false;
|
|
652
659
|
} else {
|
|
653
|
-
analyzeExpressionTagName(
|
|
660
|
+
analyzeExpressionTagName(name2, extra);
|
|
654
661
|
}
|
|
655
662
|
if (extra.tagNameType === void 0) {
|
|
656
663
|
extra.tagNameType = 2 /* DynamicTag */;
|
|
@@ -667,8 +674,8 @@ function analyzeTagNameType(tag) {
|
|
|
667
674
|
}
|
|
668
675
|
return extra.tagNameType;
|
|
669
676
|
}
|
|
670
|
-
function analyzeExpressionTagName(
|
|
671
|
-
const pending = [
|
|
677
|
+
function analyzeExpressionTagName(name2, extra) {
|
|
678
|
+
const pending = [name2];
|
|
672
679
|
let path4;
|
|
673
680
|
let type;
|
|
674
681
|
let nullable = false;
|
|
@@ -707,7 +714,7 @@ function analyzeExpressionTagName(name, extra) {
|
|
|
707
714
|
if (binding.kind === "module") {
|
|
708
715
|
const decl = binding.path.parent;
|
|
709
716
|
if (MARKO_FILE_REG.test(decl.source.value) && decl.specifiers.some((it) => import_compiler4.types.isImportDefaultSpecifier(it))) {
|
|
710
|
-
const resolvedImport = (0, import_babel_utils6.resolveTagImport)(
|
|
717
|
+
const resolvedImport = (0, import_babel_utils6.resolveTagImport)(name2, decl.source.value) || decl.source.value;
|
|
711
718
|
if (type === 0 /* NativeTag */ || tagNameImported && tagNameImported !== resolvedImport) {
|
|
712
719
|
type = 2 /* DynamicTag */;
|
|
713
720
|
tagNameImported = void 0;
|
|
@@ -913,16 +920,16 @@ var checkStatefulClosures = (section, immediateOnly) => {
|
|
|
913
920
|
|
|
914
921
|
// src/translator/util/to-property-name.ts
|
|
915
922
|
var import_compiler6 = require("@marko/compiler");
|
|
916
|
-
function toPropertyName(
|
|
917
|
-
if (/^[a-z_$][a-z0-9_$]*$/i.test(
|
|
918
|
-
return import_compiler6.types.identifier(
|
|
919
|
-
} else if (/^(?:0|[1-9][0-9]*)$/.test(
|
|
920
|
-
return import_compiler6.types.numericLiteral(parseInt(
|
|
923
|
+
function toPropertyName(name2) {
|
|
924
|
+
if (/^[a-z_$][a-z0-9_$]*$/i.test(name2)) {
|
|
925
|
+
return import_compiler6.types.identifier(name2);
|
|
926
|
+
} else if (/^(?:0|[1-9][0-9]*)$/.test(name2)) {
|
|
927
|
+
return import_compiler6.types.numericLiteral(parseInt(name2, 10));
|
|
921
928
|
}
|
|
922
|
-
return import_compiler6.types.stringLiteral(
|
|
929
|
+
return import_compiler6.types.stringLiteral(name2);
|
|
923
930
|
}
|
|
924
|
-
function toObjectProperty(
|
|
925
|
-
return import_compiler6.types.objectProperty(toPropertyName(
|
|
931
|
+
function toObjectProperty(name2, value) {
|
|
932
|
+
return import_compiler6.types.objectProperty(toPropertyName(name2), value);
|
|
926
933
|
}
|
|
927
934
|
function toMemberExpression(object, key, optional) {
|
|
928
935
|
const prop = toPropertyName(key);
|
|
@@ -933,11 +940,11 @@ function toMemberExpression(object, key, optional) {
|
|
|
933
940
|
// src/translator/util/references.ts
|
|
934
941
|
var [getBindings] = createProgramState(() => /* @__PURE__ */ new Set());
|
|
935
942
|
var [getNextBindingId, setNextBindingId] = createProgramState(() => 0);
|
|
936
|
-
function createBinding(
|
|
943
|
+
function createBinding(name2, type, section, upstreamAlias, upstreamExpression, property, declared = false) {
|
|
937
944
|
const id = getNextBindingId();
|
|
938
945
|
const binding = {
|
|
939
946
|
id,
|
|
940
|
-
name,
|
|
947
|
+
name: name2,
|
|
941
948
|
type,
|
|
942
949
|
section,
|
|
943
950
|
property,
|
|
@@ -1278,10 +1285,10 @@ function finalizeReferences() {
|
|
|
1278
1285
|
}
|
|
1279
1286
|
}
|
|
1280
1287
|
for (const binding of bindings) {
|
|
1281
|
-
const { name, section } = binding;
|
|
1288
|
+
const { name: name2, section } = binding;
|
|
1282
1289
|
if (binding.type !== 0 /* dom */) {
|
|
1283
|
-
if (find(section.bindings, ({ name:
|
|
1284
|
-
binding.name = currentProgramPath.scope.generateUid(
|
|
1290
|
+
if (find(section.bindings, ({ name: name3 }) => name3 === binding.name)) {
|
|
1291
|
+
binding.name = currentProgramPath.scope.generateUid(name2);
|
|
1285
1292
|
}
|
|
1286
1293
|
}
|
|
1287
1294
|
section.bindings = bindingUtil.add(section.bindings, binding);
|
|
@@ -1585,7 +1592,391 @@ var import_compiler20 = require("@marko/compiler");
|
|
|
1585
1592
|
// src/translator/util/runtime.ts
|
|
1586
1593
|
var import_compiler8 = require("@marko/compiler");
|
|
1587
1594
|
var import_babel_utils8 = require("@marko/compiler/babel-utils");
|
|
1588
|
-
|
|
1595
|
+
|
|
1596
|
+
// src/common/attr-tag.ts
|
|
1597
|
+
var rest = false ? Symbol("Attribute Tag") : Symbol();
|
|
1598
|
+
|
|
1599
|
+
// src/common/helpers.ts
|
|
1600
|
+
function classValue(value) {
|
|
1601
|
+
return toDelimitedString(value, " ", stringifyClassObject);
|
|
1602
|
+
}
|
|
1603
|
+
function stringifyClassObject(name2, value) {
|
|
1604
|
+
return value ? name2 : "";
|
|
1605
|
+
}
|
|
1606
|
+
function styleValue(value) {
|
|
1607
|
+
return toDelimitedString(value, ";", stringifyStyleObject);
|
|
1608
|
+
}
|
|
1609
|
+
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
1610
|
+
function stringifyStyleObject(name2, value) {
|
|
1611
|
+
return value || value === 0 ? `${name2}:${typeof value === "number" && value && !NON_DIMENSIONAL.test(name2) ? value + "px" : value}` : "";
|
|
1612
|
+
}
|
|
1613
|
+
function toDelimitedString(val, delimiter, stringify) {
|
|
1614
|
+
switch (typeof val) {
|
|
1615
|
+
case "string":
|
|
1616
|
+
return val;
|
|
1617
|
+
case "object":
|
|
1618
|
+
if (val !== null) {
|
|
1619
|
+
let result = "";
|
|
1620
|
+
let curDelimiter = "";
|
|
1621
|
+
if (Array.isArray(val)) {
|
|
1622
|
+
for (const v of val) {
|
|
1623
|
+
const part = toDelimitedString(v, delimiter, stringify);
|
|
1624
|
+
if (part !== "") {
|
|
1625
|
+
result += curDelimiter + part;
|
|
1626
|
+
curDelimiter = delimiter;
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
} else {
|
|
1630
|
+
for (const name2 in val) {
|
|
1631
|
+
const v = val[name2];
|
|
1632
|
+
const part = stringify(name2, v);
|
|
1633
|
+
if (part !== "") {
|
|
1634
|
+
result += curDelimiter + part;
|
|
1635
|
+
curDelimiter = delimiter;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
return result;
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
return "";
|
|
1643
|
+
}
|
|
1644
|
+
function isEventHandler(name2) {
|
|
1645
|
+
return /^on[A-Z-]/.test(name2);
|
|
1646
|
+
}
|
|
1647
|
+
function getEventHandlerName(name2) {
|
|
1648
|
+
return name2[2] === "-" ? name2.slice(3) : name2.slice(2).toLowerCase();
|
|
1649
|
+
}
|
|
1650
|
+
function isVoid(value) {
|
|
1651
|
+
return value == null || value === false;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
// src/html/content.ts
|
|
1655
|
+
function toString(val) {
|
|
1656
|
+
return val ? val + "" : val === 0 ? "0" : "";
|
|
1657
|
+
}
|
|
1658
|
+
var unsafeXMLReg = /[<&]/g;
|
|
1659
|
+
var replaceUnsafeXML = (c) => c === "&" ? "&" : "<";
|
|
1660
|
+
var escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, replaceUnsafeXML) : str;
|
|
1661
|
+
function escapeXML(val) {
|
|
1662
|
+
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "‍";
|
|
1663
|
+
}
|
|
1664
|
+
var unsafeScriptReg = /<\/script/g;
|
|
1665
|
+
var escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C/script") : str;
|
|
1666
|
+
function escapeScript(val) {
|
|
1667
|
+
return val ? escapeScriptStr(val + "") : val === 0 ? "0" : "";
|
|
1668
|
+
}
|
|
1669
|
+
var unsafeStyleReg = /<\/style/g;
|
|
1670
|
+
var escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C/style") : str;
|
|
1671
|
+
function escapeStyle(val) {
|
|
1672
|
+
return val ? escapeStyleStr(val + "") : val === 0 ? "0" : "";
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
// src/html/serializer.ts
|
|
1676
|
+
var { hasOwnProperty } = {};
|
|
1677
|
+
var Generator = function* () {
|
|
1678
|
+
}().constructor;
|
|
1679
|
+
var AsyncGenerator = async function* () {
|
|
1680
|
+
}().constructor;
|
|
1681
|
+
var KNOWN_SYMBOLS = (() => {
|
|
1682
|
+
const KNOWN_SYMBOLS2 = /* @__PURE__ */ new Map();
|
|
1683
|
+
for (const name2 of Object.getOwnPropertyNames(Symbol)) {
|
|
1684
|
+
const symbol = Symbol[name2];
|
|
1685
|
+
if (typeof symbol === "symbol") {
|
|
1686
|
+
KNOWN_SYMBOLS2.set(symbol, "Symbol." + name2);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
return KNOWN_SYMBOLS2;
|
|
1690
|
+
})();
|
|
1691
|
+
var KNOWN_FUNCTIONS = /* @__PURE__ */ new Map([
|
|
1692
|
+
// This is by no means an exhaustive list,
|
|
1693
|
+
// but it should cover most of the built-in functions.
|
|
1694
|
+
[AggregateError, "AggregateError"],
|
|
1695
|
+
[Array, "Array"],
|
|
1696
|
+
[Array.from, "Array.from"],
|
|
1697
|
+
[Array.isArray, "Array.isArray"],
|
|
1698
|
+
[Array.of, "Array.of"],
|
|
1699
|
+
[ArrayBuffer, "ArrayBuffer"],
|
|
1700
|
+
[ArrayBuffer.isView, "ArrayBuffer.isView"],
|
|
1701
|
+
[Atomics.add, "Atomics.add"],
|
|
1702
|
+
[Atomics.and, "Atomics.and"],
|
|
1703
|
+
[Atomics.compareExchange, "Atomics.compareExchange"],
|
|
1704
|
+
[Atomics.exchange, "Atomics.exchange"],
|
|
1705
|
+
[Atomics.isLockFree, "Atomics.isLockFree"],
|
|
1706
|
+
[Atomics.load, "Atomics.load"],
|
|
1707
|
+
[Atomics.notify, "Atomics.notify"],
|
|
1708
|
+
[Atomics.or, "Atomics.or"],
|
|
1709
|
+
[Atomics.store, "Atomics.store"],
|
|
1710
|
+
[Atomics.sub, "Atomics.sub"],
|
|
1711
|
+
[Atomics.wait, "Atomics.wait"],
|
|
1712
|
+
[BigInt, "BigInt"],
|
|
1713
|
+
[BigInt.asIntN, "BigInt.asIntN"],
|
|
1714
|
+
[BigInt.asUintN, "BigInt.asUintN"],
|
|
1715
|
+
[BigInt64Array, "BigInt64Array"],
|
|
1716
|
+
[BigInt64Array.from, "BigInt64Array.from"],
|
|
1717
|
+
[BigInt64Array.of, "BigInt64Array.of"],
|
|
1718
|
+
[BigUint64Array, "BigUint64Array"],
|
|
1719
|
+
[BigUint64Array.from, "BigUint64Array.from"],
|
|
1720
|
+
[BigUint64Array.of, "BigUint64Array.of"],
|
|
1721
|
+
[Boolean, "Boolean"],
|
|
1722
|
+
[console.assert, "console.assert"],
|
|
1723
|
+
[console.clear, "console.clear"],
|
|
1724
|
+
[console.count, "console.count"],
|
|
1725
|
+
[console.countReset, "console.countReset"],
|
|
1726
|
+
[console.debug, "console.debug"],
|
|
1727
|
+
[console.dir, "console.dir"],
|
|
1728
|
+
[console.dirxml, "console.dirxml"],
|
|
1729
|
+
[console.error, "console.error"],
|
|
1730
|
+
[console.group, "console.group"],
|
|
1731
|
+
[console.groupCollapsed, "console.groupCollapsed"],
|
|
1732
|
+
[console.groupEnd, "console.groupEnd"],
|
|
1733
|
+
[console.info, "console.info"],
|
|
1734
|
+
[console.log, "console.log"],
|
|
1735
|
+
[console.table, "console.table"],
|
|
1736
|
+
[console.time, "console.time"],
|
|
1737
|
+
[console.timeEnd, "console.timeEnd"],
|
|
1738
|
+
[console.timeLog, "console.timeLog"],
|
|
1739
|
+
[console.timeStamp, "console.timeStamp"],
|
|
1740
|
+
[console.trace, "console.trace"],
|
|
1741
|
+
[console.warn, "console.warn"],
|
|
1742
|
+
[DataView, "DataView"],
|
|
1743
|
+
[Date, "Date"],
|
|
1744
|
+
[Date.now, "Date.now"],
|
|
1745
|
+
[Date.parse, "Date.parse"],
|
|
1746
|
+
[Date.UTC, "Date.UTC"],
|
|
1747
|
+
[decodeURI, "decodeURI"],
|
|
1748
|
+
[decodeURIComponent, "decodeURIComponent"],
|
|
1749
|
+
[encodeURI, "encodeURI"],
|
|
1750
|
+
[encodeURIComponent, "encodeURIComponent"],
|
|
1751
|
+
[Error, "Error"],
|
|
1752
|
+
[EvalError, "EvalError"],
|
|
1753
|
+
[Float32Array, "Float32Array"],
|
|
1754
|
+
[Float32Array.from, "Float32Array.from"],
|
|
1755
|
+
[Float32Array.of, "Float32Array.of"],
|
|
1756
|
+
[Float64Array, "Float64Array"],
|
|
1757
|
+
[Float64Array.from, "Float64Array.from"],
|
|
1758
|
+
[Float64Array.of, "Float64Array.of"],
|
|
1759
|
+
[Function, "Function"],
|
|
1760
|
+
[globalThis.atob, "atob"],
|
|
1761
|
+
[globalThis.btoa, "btoa"],
|
|
1762
|
+
[globalThis.clearImmediate, "clearImmediate"],
|
|
1763
|
+
[globalThis.clearInterval, "clearInterval"],
|
|
1764
|
+
[globalThis.clearTimeout, "clearTimeout"],
|
|
1765
|
+
[globalThis.crypto?.getRandomValues, "crypto.getRandomValues"],
|
|
1766
|
+
[globalThis.crypto?.randomUUID, "crypto.randomUUID"],
|
|
1767
|
+
[globalThis.fetch, "fetch"],
|
|
1768
|
+
[globalThis.performance?.now, "performance.now"],
|
|
1769
|
+
[globalThis.queueMicrotask, "queueMicrotask"],
|
|
1770
|
+
[globalThis.setImmediate, "setImmediate"],
|
|
1771
|
+
[globalThis.setInterval, "setInterval"],
|
|
1772
|
+
[globalThis.setTimeout, "setTimeout"],
|
|
1773
|
+
[globalThis.structuredClone, "structuredClone"],
|
|
1774
|
+
[globalThis.URL, "URL"],
|
|
1775
|
+
[globalThis.URLSearchParams, "URLSearchParams"],
|
|
1776
|
+
[globalThis.WritableStream, "WritableStream"],
|
|
1777
|
+
[Int16Array, "Int16Array"],
|
|
1778
|
+
[Int16Array.from, "Int16Array.from"],
|
|
1779
|
+
[Int16Array.of, "Int16Array.of"],
|
|
1780
|
+
[Int32Array, "Int32Array"],
|
|
1781
|
+
[Int32Array.from, "Int32Array.from"],
|
|
1782
|
+
[Int32Array.of, "Int32Array.of"],
|
|
1783
|
+
[Int8Array, "Int8Array"],
|
|
1784
|
+
[Int8Array.from, "Int8Array.from"],
|
|
1785
|
+
[Int8Array.of, "Int8Array.of"],
|
|
1786
|
+
[Intl.Collator, "Intl.Collator"],
|
|
1787
|
+
[Intl.DateTimeFormat, "Intl.DateTimeFormat"],
|
|
1788
|
+
[Intl.DisplayNames, "Intl.DisplayNames"],
|
|
1789
|
+
[Intl.getCanonicalLocales, "Intl.getCanonicalLocales"],
|
|
1790
|
+
[Intl.ListFormat, "Intl.ListFormat"],
|
|
1791
|
+
[Intl.Locale, "Intl.Locale"],
|
|
1792
|
+
[Intl.NumberFormat, "Intl.NumberFormat"],
|
|
1793
|
+
[Intl.PluralRules, "Intl.PluralRules"],
|
|
1794
|
+
[Intl.RelativeTimeFormat, "Intl.RelativeTimeFormat"],
|
|
1795
|
+
[Intl.Segmenter, "Intl.Segmenter"],
|
|
1796
|
+
[Intl.supportedValuesOf, "Intl.supportedValuesOf"],
|
|
1797
|
+
[isFinite, "isFinite"],
|
|
1798
|
+
[isNaN, "isNaN"],
|
|
1799
|
+
[JSON.parse, "JSON.parse"],
|
|
1800
|
+
[JSON.stringify, "JSON.stringify"],
|
|
1801
|
+
[Map, "Map"],
|
|
1802
|
+
[Map.groupBy, "Map.groupBy"],
|
|
1803
|
+
[Math.abs, "Math.abs"],
|
|
1804
|
+
[Math.acos, "Math.acos"],
|
|
1805
|
+
[Math.acosh, "Math.acosh"],
|
|
1806
|
+
[Math.asin, "Math.asin"],
|
|
1807
|
+
[Math.asinh, "Math.asinh"],
|
|
1808
|
+
[Math.atan, "Math.atan"],
|
|
1809
|
+
[Math.atan2, "Math.atan2"],
|
|
1810
|
+
[Math.atanh, "Math.atanh"],
|
|
1811
|
+
[Math.cbrt, "Math.cbrt"],
|
|
1812
|
+
[Math.ceil, "Math.ceil"],
|
|
1813
|
+
[Math.clz32, "Math.clz32"],
|
|
1814
|
+
[Math.cos, "Math.cos"],
|
|
1815
|
+
[Math.cosh, "Math.cosh"],
|
|
1816
|
+
[Math.exp, "Math.exp"],
|
|
1817
|
+
[Math.expm1, "Math.expm1"],
|
|
1818
|
+
[Math.floor, "Math.floor"],
|
|
1819
|
+
[Math.fround, "Math.fround"],
|
|
1820
|
+
[Math.hypot, "Math.hypot"],
|
|
1821
|
+
[Math.imul, "Math.imul"],
|
|
1822
|
+
[Math.log, "Math.log"],
|
|
1823
|
+
[Math.log10, "Math.log10"],
|
|
1824
|
+
[Math.log1p, "Math.log1p"],
|
|
1825
|
+
[Math.log2, "Math.log2"],
|
|
1826
|
+
[Math.max, "Math.max"],
|
|
1827
|
+
[Math.min, "Math.min"],
|
|
1828
|
+
[Math.pow, "Math.pow"],
|
|
1829
|
+
[Math.random, "Math.random"],
|
|
1830
|
+
[Math.round, "Math.round"],
|
|
1831
|
+
[Math.sign, "Math.sign"],
|
|
1832
|
+
[Math.sin, "Math.sin"],
|
|
1833
|
+
[Math.sinh, "Math.sinh"],
|
|
1834
|
+
[Math.sqrt, "Math.sqrt"],
|
|
1835
|
+
[Math.tan, "Math.tan"],
|
|
1836
|
+
[Math.tanh, "Math.tanh"],
|
|
1837
|
+
[Math.trunc, "Math.trunc"],
|
|
1838
|
+
[Number, "Number"],
|
|
1839
|
+
[Number.isFinite, "Number.isFinite"],
|
|
1840
|
+
[Number.isInteger, "Number.isInteger"],
|
|
1841
|
+
[Number.isNaN, "Number.isNaN"],
|
|
1842
|
+
[Number.isSafeInteger, "Number.isSafeInteger"],
|
|
1843
|
+
[Number.parseFloat, "Number.parseFloat"],
|
|
1844
|
+
[Number.parseInt, "Number.parseInt"],
|
|
1845
|
+
[Object, "Object"],
|
|
1846
|
+
[Object.assign, "Object.assign"],
|
|
1847
|
+
[Object.create, "Object.create"],
|
|
1848
|
+
[Object.defineProperties, "Object.defineProperties"],
|
|
1849
|
+
[Object.defineProperty, "Object.defineProperty"],
|
|
1850
|
+
[Object.entries, "Object.entries"],
|
|
1851
|
+
[Object.freeze, "Object.freeze"],
|
|
1852
|
+
[Object.fromEntries, "Object.fromEntries"],
|
|
1853
|
+
[Object.getOwnPropertyDescriptor, "Object.getOwnPropertyDescriptor"],
|
|
1854
|
+
[Object.getOwnPropertyDescriptors, "Object.getOwnPropertyDescriptors"],
|
|
1855
|
+
[Object.getOwnPropertyNames, "Object.getOwnPropertyNames"],
|
|
1856
|
+
[Object.getOwnPropertySymbols, "Object.getOwnPropertySymbols"],
|
|
1857
|
+
[Object.getPrototypeOf, "Object.getPrototypeOf"],
|
|
1858
|
+
[Object.is, "Object.is"],
|
|
1859
|
+
[Object.isExtensible, "Object.isExtensible"],
|
|
1860
|
+
[Object.isFrozen, "Object.isFrozen"],
|
|
1861
|
+
[Object.isSealed, "Object.isSealed"],
|
|
1862
|
+
[Object.keys, "Object.keys"],
|
|
1863
|
+
[Object.preventExtensions, "Object.preventExtensions"],
|
|
1864
|
+
[Object.seal, "Object.seal"],
|
|
1865
|
+
[Object.setPrototypeOf, "Object.setPrototypeOf"],
|
|
1866
|
+
[Object.values, "Object.values"],
|
|
1867
|
+
[parseFloat, "parseFloat"],
|
|
1868
|
+
[parseInt, "parseInt"],
|
|
1869
|
+
[Promise, "Promise"],
|
|
1870
|
+
[Proxy, "Proxy"],
|
|
1871
|
+
[RangeError, "RangeError"],
|
|
1872
|
+
[ReferenceError, "ReferenceError"],
|
|
1873
|
+
[Reflect.apply, "Reflect.apply"],
|
|
1874
|
+
[Reflect.construct, "Reflect.construct"],
|
|
1875
|
+
[Reflect.defineProperty, "Reflect.defineProperty"],
|
|
1876
|
+
[Reflect.deleteProperty, "Reflect.deleteProperty"],
|
|
1877
|
+
[Reflect.get, "Reflect.get"],
|
|
1878
|
+
[Reflect.getOwnPropertyDescriptor, "Reflect.getOwnPropertyDescriptor"],
|
|
1879
|
+
[Reflect.getPrototypeOf, "Reflect.getPrototypeOf"],
|
|
1880
|
+
[Reflect.has, "Reflect.has"],
|
|
1881
|
+
[Reflect.isExtensible, "Reflect.isExtensible"],
|
|
1882
|
+
[Reflect.ownKeys, "Reflect.ownKeys"],
|
|
1883
|
+
[Reflect.preventExtensions, "Reflect.preventExtensions"],
|
|
1884
|
+
[Reflect.set, "Reflect.set"],
|
|
1885
|
+
[Reflect.setPrototypeOf, "Reflect.setPrototypeOf"],
|
|
1886
|
+
[RegExp, "RegExp"],
|
|
1887
|
+
[Set, "Set"],
|
|
1888
|
+
[String, "String"],
|
|
1889
|
+
[String.fromCharCode, "String.fromCharCode"],
|
|
1890
|
+
[String.fromCodePoint, "String.fromCodePoint"],
|
|
1891
|
+
[String.raw, "String.raw"],
|
|
1892
|
+
[Symbol, "Symbol"],
|
|
1893
|
+
[Symbol.for, "Symbol.for"],
|
|
1894
|
+
[SyntaxError, "SyntaxError"],
|
|
1895
|
+
[TypeError, "TypeError"],
|
|
1896
|
+
[Uint16Array, "Uint16Array"],
|
|
1897
|
+
[Uint16Array.from, "Uint16Array.from"],
|
|
1898
|
+
[Uint16Array.of, "Uint16Array.of"],
|
|
1899
|
+
[Uint32Array, "Uint32Array"],
|
|
1900
|
+
[Uint32Array.from, "Uint32Array.from"],
|
|
1901
|
+
[Uint32Array.of, "Uint32Array.of"],
|
|
1902
|
+
[Uint8Array, "Uint8Array"],
|
|
1903
|
+
[Uint8Array.from, "Uint8Array.from"],
|
|
1904
|
+
[Uint8Array.of, "Uint8Array.of"],
|
|
1905
|
+
[Uint8ClampedArray, "Uint8ClampedArray"],
|
|
1906
|
+
[Uint8ClampedArray.from, "Uint8ClampedArray.from"],
|
|
1907
|
+
[Uint8ClampedArray.of, "Uint8ClampedArray.of"],
|
|
1908
|
+
[URIError, "URIError"],
|
|
1909
|
+
[WeakMap, "WeakMap"],
|
|
1910
|
+
[WeakSet, "WeakSet"]
|
|
1911
|
+
]);
|
|
1912
|
+
var KNOWN_OBJECTS = /* @__PURE__ */ new Map([
|
|
1913
|
+
[Atomics, "Atomics"],
|
|
1914
|
+
[console, "console"],
|
|
1915
|
+
[globalThis, "globalThis"],
|
|
1916
|
+
[globalThis.crypto, "crypto"],
|
|
1917
|
+
[Intl, "Intl"],
|
|
1918
|
+
[JSON, "JSON"],
|
|
1919
|
+
[Math, "Math"],
|
|
1920
|
+
[Reflect, "Reflect"]
|
|
1921
|
+
]);
|
|
1922
|
+
|
|
1923
|
+
// src/html/writer.ts
|
|
1924
|
+
var K_SCOPE_ID = Symbol("Scope ID");
|
|
1925
|
+
var kPendingContexts = Symbol("Pending Contexts");
|
|
1926
|
+
var tick = globalThis.setImmediate || globalThis.setTimeout || globalThis.queueMicrotask || ((cb) => Promise.resolve().then(cb));
|
|
1927
|
+
|
|
1928
|
+
// src/html/attrs.ts
|
|
1929
|
+
function classAttr(val) {
|
|
1930
|
+
return stringAttr("class", classValue(val));
|
|
1931
|
+
}
|
|
1932
|
+
function styleAttr(val) {
|
|
1933
|
+
return stringAttr("style", styleValue(val));
|
|
1934
|
+
}
|
|
1935
|
+
var kSelectedValue = Symbol("selectedValue");
|
|
1936
|
+
function attr(name2, val) {
|
|
1937
|
+
return isVoid(val) ? "" : nonVoidAttr(name2, val);
|
|
1938
|
+
}
|
|
1939
|
+
function stringAttr(name2, val) {
|
|
1940
|
+
return val && ` ${name2}=${escapeAttrValue(val)}`;
|
|
1941
|
+
}
|
|
1942
|
+
function nonVoidAttr(name2, val) {
|
|
1943
|
+
switch (typeof val) {
|
|
1944
|
+
case "string":
|
|
1945
|
+
return ` ${name2 + attrAssignment(val)}`;
|
|
1946
|
+
case "boolean":
|
|
1947
|
+
return ` ${name2}`;
|
|
1948
|
+
case "number":
|
|
1949
|
+
return ` ${name2}=${val}`;
|
|
1950
|
+
case "object":
|
|
1951
|
+
if (val instanceof RegExp) {
|
|
1952
|
+
return ` ${name2 + attrAssignment(val.source)}`;
|
|
1953
|
+
}
|
|
1954
|
+
break;
|
|
1955
|
+
}
|
|
1956
|
+
return ` ${name2 + attrAssignment(val + "")}`;
|
|
1957
|
+
}
|
|
1958
|
+
function attrAssignment(val) {
|
|
1959
|
+
return val ? `=${escapeAttrValue(val)}` : "";
|
|
1960
|
+
}
|
|
1961
|
+
var unsafeAttrChars = /["'>\s]/g;
|
|
1962
|
+
function escapeAttrValue(str) {
|
|
1963
|
+
if (unsafeAttrChars.test(str)) {
|
|
1964
|
+
const c = str[unsafeAttrChars.lastIndex - 1];
|
|
1965
|
+
unsafeAttrChars.lastIndex = 0;
|
|
1966
|
+
return c === '"' ? `'${str.replace(/'/g, "'")}'` : `"${str.replace(/"/g, """)}"`;
|
|
1967
|
+
}
|
|
1968
|
+
return str;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
// src/common/compat-meta.ts
|
|
1972
|
+
var prefix = false ? "$compat_" : "$C_";
|
|
1973
|
+
var RENDERER_REGISTER_ID = prefix + (false ? "renderer" : "r");
|
|
1974
|
+
var SET_SCOPE_REGISTER_ID = prefix + (false ? "setScope" : "s");
|
|
1975
|
+
|
|
1976
|
+
// src/html/compat.ts
|
|
1977
|
+
var K_TAGS_API_STATE = Symbol();
|
|
1978
|
+
|
|
1979
|
+
// src/translator/util/runtime.ts
|
|
1589
1980
|
var pureFunctions = [
|
|
1590
1981
|
"createTemplate",
|
|
1591
1982
|
"createRenderer",
|
|
@@ -1600,21 +1991,19 @@ var pureFunctions = [
|
|
|
1600
1991
|
"loopTo",
|
|
1601
1992
|
"conditional"
|
|
1602
1993
|
];
|
|
1603
|
-
function importRuntime(
|
|
1994
|
+
function importRuntime(name2) {
|
|
1604
1995
|
const { output } = getMarkoOpts();
|
|
1605
1996
|
return toMemberExpression(
|
|
1606
1997
|
(0, import_babel_utils8.importStar)(currentProgramPath.hub.file, getRuntimePath(output), "$"),
|
|
1607
|
-
|
|
1998
|
+
name2
|
|
1608
1999
|
);
|
|
1609
2000
|
}
|
|
1610
|
-
function callRuntime(
|
|
2001
|
+
function callRuntime(name2, ...args) {
|
|
1611
2002
|
const callExpression2 = import_compiler8.types.callExpression(
|
|
1612
|
-
importRuntime(
|
|
2003
|
+
importRuntime(name2),
|
|
1613
2004
|
filterArguments(args)
|
|
1614
2005
|
);
|
|
1615
|
-
if (pureFunctions.includes(
|
|
1616
|
-
name
|
|
1617
|
-
)) {
|
|
2006
|
+
if (pureFunctions.includes(name2)) {
|
|
1618
2007
|
callExpression2.leadingComments = [
|
|
1619
2008
|
{
|
|
1620
2009
|
type: "CommentBlock",
|
|
@@ -1626,18 +2015,18 @@ function callRuntime(name, ...args) {
|
|
|
1626
2015
|
}
|
|
1627
2016
|
function getHTMLRuntime() {
|
|
1628
2017
|
return {
|
|
1629
|
-
escapeXML
|
|
1630
|
-
toString
|
|
1631
|
-
attr
|
|
1632
|
-
classAttr
|
|
1633
|
-
styleAttr
|
|
1634
|
-
escapeScript
|
|
1635
|
-
escapeStyle
|
|
2018
|
+
escapeXML,
|
|
2019
|
+
toString,
|
|
2020
|
+
attr,
|
|
2021
|
+
classAttr,
|
|
2022
|
+
styleAttr,
|
|
2023
|
+
escapeScript,
|
|
2024
|
+
escapeStyle
|
|
1636
2025
|
};
|
|
1637
2026
|
}
|
|
1638
2027
|
function getRuntimePath(output) {
|
|
1639
2028
|
const { optimize } = getMarkoOpts();
|
|
1640
|
-
return
|
|
2029
|
+
return `${runtime_info_default.name}/${optimize ? "" : "debug/"}${output === "html" ? "html" : "dom"}`;
|
|
1641
2030
|
}
|
|
1642
2031
|
function filterArguments(args) {
|
|
1643
2032
|
const filteredArgs = [];
|
|
@@ -1653,22 +2042,20 @@ function filterArguments(args) {
|
|
|
1653
2042
|
// src/translator/util/signals.ts
|
|
1654
2043
|
var import_compiler19 = require("@marko/compiler");
|
|
1655
2044
|
var import_babel_utils10 = require("@marko/compiler/babel-utils");
|
|
1656
|
-
var import_types3 = require("@marko/runtime-tags/common/types");
|
|
1657
2045
|
|
|
1658
2046
|
// src/translator/core/return.ts
|
|
1659
2047
|
var import_compiler13 = require("@marko/compiler");
|
|
1660
2048
|
var import_babel_utils9 = require("@marko/compiler/babel-utils");
|
|
1661
|
-
var import_types2 = require("@marko/runtime-tags/common/types");
|
|
1662
2049
|
|
|
1663
2050
|
// src/translator/util/get-known-attr-values.ts
|
|
1664
2051
|
function getKnownAttrValues(tag) {
|
|
1665
|
-
const
|
|
2052
|
+
const attrs2 = {};
|
|
1666
2053
|
for (const attr2 of tag.attributes) {
|
|
1667
2054
|
if (attr2.type === "MarkoAttribute") {
|
|
1668
|
-
|
|
2055
|
+
attrs2[attr2.name] = attr2.value;
|
|
1669
2056
|
}
|
|
1670
2057
|
}
|
|
1671
|
-
return
|
|
2058
|
+
return attrs2;
|
|
1672
2059
|
}
|
|
1673
2060
|
|
|
1674
2061
|
// src/translator/util/plugin-hooks.ts
|
|
@@ -1713,12 +2100,12 @@ function extractVisitors(visitors2) {
|
|
|
1713
2100
|
translate: {}
|
|
1714
2101
|
};
|
|
1715
2102
|
for (const _name in visitors2) {
|
|
1716
|
-
const
|
|
1717
|
-
const value = visitors2[
|
|
1718
|
-
if (value.migrate) result.migrate[
|
|
1719
|
-
if (value.transform) result.transform[
|
|
1720
|
-
if (value.analyze) result.analyze[
|
|
1721
|
-
if (value.translate) result.translate[
|
|
2103
|
+
const name2 = _name;
|
|
2104
|
+
const value = visitors2[name2];
|
|
2105
|
+
if (value.migrate) result.migrate[name2] = value.migrate;
|
|
2106
|
+
if (value.transform) result.transform[name2] = value.transform;
|
|
2107
|
+
if (value.analyze) result.analyze[name2] = value.analyze;
|
|
2108
|
+
if (value.translate) result.translate[name2] = value.translate;
|
|
1722
2109
|
}
|
|
1723
2110
|
return result;
|
|
1724
2111
|
}
|
|
@@ -1793,7 +2180,6 @@ function shiftItems(list, start, offset) {
|
|
|
1793
2180
|
|
|
1794
2181
|
// src/translator/util/walks.ts
|
|
1795
2182
|
var import_compiler11 = require("@marko/compiler");
|
|
1796
|
-
var import_types = require("@marko/runtime-tags/common/types");
|
|
1797
2183
|
var [getWalks] = createSectionState(
|
|
1798
2184
|
"walks",
|
|
1799
2185
|
() => [""]
|
|
@@ -1804,19 +2190,19 @@ var [getWalkComment] = createSectionState(
|
|
|
1804
2190
|
);
|
|
1805
2191
|
var [getSteps] = createSectionState("steps", () => []);
|
|
1806
2192
|
var walkCodeToName = {
|
|
1807
|
-
[
|
|
1808
|
-
[
|
|
1809
|
-
[
|
|
1810
|
-
[
|
|
1811
|
-
[
|
|
1812
|
-
[
|
|
1813
|
-
[
|
|
1814
|
-
[
|
|
1815
|
-
[
|
|
1816
|
-
[
|
|
1817
|
-
[
|
|
1818
|
-
[
|
|
1819
|
-
[
|
|
2193
|
+
[32 /* Get */]: "get",
|
|
2194
|
+
[36 /* Inside */]: "inside",
|
|
2195
|
+
[37 /* Replace */]: "replace",
|
|
2196
|
+
[38 /* EndChild */]: "endChild",
|
|
2197
|
+
[47 /* BeginChild */]: "beginChild",
|
|
2198
|
+
[67 /* Next */]: "next",
|
|
2199
|
+
[97 /* Over */]: "over",
|
|
2200
|
+
[107 /* Out */]: "out",
|
|
2201
|
+
[117 /* Multiplier */]: "multiplier",
|
|
2202
|
+
[91 /* NextEnd */]: "nextEnd",
|
|
2203
|
+
[106 /* OverEnd */]: "overEnd",
|
|
2204
|
+
[116 /* OutEnd */]: "outEnd",
|
|
2205
|
+
[126 /* MultiplierEnd */]: "multiplierEnd"
|
|
1820
2206
|
};
|
|
1821
2207
|
function enter2(path4) {
|
|
1822
2208
|
getSteps(getSection(path4)).push(0 /* Enter */);
|
|
@@ -1831,12 +2217,12 @@ function injectWalks(path4, expr) {
|
|
|
1831
2217
|
const walks = getWalks(getSection(path4));
|
|
1832
2218
|
const walkComment = getWalkComment(getSection(path4));
|
|
1833
2219
|
walkComment.push(
|
|
1834
|
-
`${walkCodeToName[
|
|
2220
|
+
`${walkCodeToName[47 /* BeginChild */]}`,
|
|
1835
2221
|
expr.name,
|
|
1836
|
-
walkCodeToName[
|
|
2222
|
+
walkCodeToName[38 /* EndChild */]
|
|
1837
2223
|
);
|
|
1838
|
-
appendLiteral(walks, String.fromCharCode(
|
|
1839
|
-
walks.push(expr, String.fromCharCode(
|
|
2224
|
+
appendLiteral(walks, String.fromCharCode(47 /* BeginChild */));
|
|
2225
|
+
walks.push(expr, String.fromCharCode(38 /* EndChild */));
|
|
1840
2226
|
}
|
|
1841
2227
|
function visit(path4, code) {
|
|
1842
2228
|
if (isOutputHTML()) {
|
|
@@ -1853,15 +2239,15 @@ function visit(path4, code) {
|
|
|
1853
2239
|
for (const step of steps) {
|
|
1854
2240
|
if (step === 0 /* Enter */) {
|
|
1855
2241
|
depth++;
|
|
1856
|
-
walkCodes.push(
|
|
2242
|
+
walkCodes.push(67 /* Next */);
|
|
1857
2243
|
} else {
|
|
1858
2244
|
depth--;
|
|
1859
2245
|
if (depth >= 0) {
|
|
1860
|
-
walkCodes.length = walkCodes.lastIndexOf(
|
|
1861
|
-
walkCodes.push(
|
|
2246
|
+
walkCodes.length = walkCodes.lastIndexOf(67 /* Next */);
|
|
2247
|
+
walkCodes.push(97 /* Over */);
|
|
1862
2248
|
} else {
|
|
1863
|
-
walkCodes.length = walkCodes.lastIndexOf(
|
|
1864
|
-
walkCodes.push(
|
|
2249
|
+
walkCodes.length = walkCodes.lastIndexOf(107 /* Out */) + 1;
|
|
2250
|
+
walkCodes.push(107 /* Out */);
|
|
1865
2251
|
depth = 0;
|
|
1866
2252
|
}
|
|
1867
2253
|
}
|
|
@@ -1883,7 +2269,7 @@ function visit(path4, code) {
|
|
|
1883
2269
|
steps.length = 0;
|
|
1884
2270
|
}
|
|
1885
2271
|
if (code !== void 0) {
|
|
1886
|
-
if (code !==
|
|
2272
|
+
if (code !== 32 /* Get */) {
|
|
1887
2273
|
writeTo(path4)`<!>`;
|
|
1888
2274
|
}
|
|
1889
2275
|
walkComment.push(`${walkCodeToName[code]}`);
|
|
@@ -1893,12 +2279,12 @@ function visit(path4, code) {
|
|
|
1893
2279
|
}
|
|
1894
2280
|
function nCodeString(code, number) {
|
|
1895
2281
|
switch (code) {
|
|
1896
|
-
case
|
|
1897
|
-
return toCharString(number, code,
|
|
1898
|
-
case
|
|
1899
|
-
return toCharString(number, code,
|
|
1900
|
-
case
|
|
1901
|
-
return toCharString(number, code,
|
|
2282
|
+
case 67 /* Next */:
|
|
2283
|
+
return toCharString(number, code, 20 /* Next */);
|
|
2284
|
+
case 97 /* Over */:
|
|
2285
|
+
return toCharString(number, code, 10 /* Over */);
|
|
2286
|
+
case 107 /* Out */:
|
|
2287
|
+
return toCharString(number, code, 10 /* Out */);
|
|
1902
2288
|
default:
|
|
1903
2289
|
throw new Error(`Unexpected walk code: ${code}`);
|
|
1904
2290
|
}
|
|
@@ -1909,8 +2295,8 @@ function toCharString(number, startCode, rangeSize) {
|
|
|
1909
2295
|
const multiplier = Math.floor(number / rangeSize);
|
|
1910
2296
|
result += toCharString(
|
|
1911
2297
|
multiplier,
|
|
1912
|
-
|
|
1913
|
-
|
|
2298
|
+
117 /* Multiplier */,
|
|
2299
|
+
10 /* Multiplier */
|
|
1914
2300
|
);
|
|
1915
2301
|
number -= multiplier * rangeSize;
|
|
1916
2302
|
}
|
|
@@ -1918,10 +2304,10 @@ function toCharString(number, startCode, rangeSize) {
|
|
|
1918
2304
|
return result;
|
|
1919
2305
|
}
|
|
1920
2306
|
function getWalkString(section) {
|
|
1921
|
-
const
|
|
1922
|
-
const postfix = section.content?.endType === 1 /* Dynamic */ ? String.fromCharCode(
|
|
2307
|
+
const prefix2 = section.content?.startType === 1 /* Dynamic */ ? String.fromCharCode(67 /* Next */ + 1) : "";
|
|
2308
|
+
const postfix = section.content?.endType === 1 /* Dynamic */ ? String.fromCharCode(67 /* Next */ + 1) : "";
|
|
1923
2309
|
const walks = getWalks(section);
|
|
1924
|
-
const walkLiteral = normalizeStringExpression([
|
|
2310
|
+
const walkLiteral = normalizeStringExpression([prefix2, ...walks, postfix]) || import_compiler11.types.stringLiteral("");
|
|
1925
2311
|
if (walkLiteral.value !== "") {
|
|
1926
2312
|
walkLiteral.leadingComments = [
|
|
1927
2313
|
{
|
|
@@ -2042,20 +2428,20 @@ var return_default = {
|
|
|
2042
2428
|
html: {
|
|
2043
2429
|
exit(tag) {
|
|
2044
2430
|
const section = getSection(tag);
|
|
2045
|
-
const
|
|
2431
|
+
const attrs2 = getKnownAttrValues(tag.node);
|
|
2046
2432
|
flushBefore(tag);
|
|
2047
|
-
if (
|
|
2433
|
+
if (attrs2.valueChange) {
|
|
2048
2434
|
getSerializedScopeProperties(section).set(
|
|
2049
|
-
import_compiler13.types.stringLiteral(
|
|
2050
|
-
|
|
2435
|
+
import_compiler13.types.stringLiteral("@" /* TagVariableChange */),
|
|
2436
|
+
attrs2.valueChange
|
|
2051
2437
|
);
|
|
2052
2438
|
}
|
|
2053
|
-
if (
|
|
2439
|
+
if (attrs2.value) {
|
|
2054
2440
|
const returnId2 = currentProgramPath.scope.generateUidIdentifier("return");
|
|
2055
2441
|
_setReturnId(section, returnId2);
|
|
2056
2442
|
tag.replaceWith(
|
|
2057
2443
|
import_compiler13.types.variableDeclaration("const", [
|
|
2058
|
-
import_compiler13.types.variableDeclarator(returnId2,
|
|
2444
|
+
import_compiler13.types.variableDeclarator(returnId2, attrs2.value)
|
|
2059
2445
|
])
|
|
2060
2446
|
)[0].skip();
|
|
2061
2447
|
}
|
|
@@ -2064,27 +2450,27 @@ var return_default = {
|
|
|
2064
2450
|
dom: {
|
|
2065
2451
|
exit(tag) {
|
|
2066
2452
|
const section = getSection(tag);
|
|
2067
|
-
const
|
|
2068
|
-
if (
|
|
2453
|
+
const attrs2 = getKnownAttrValues(tag.node);
|
|
2454
|
+
if (attrs2.value) {
|
|
2069
2455
|
addValue(
|
|
2070
2456
|
section,
|
|
2071
|
-
|
|
2457
|
+
attrs2.value.extra?.referencedBindings,
|
|
2072
2458
|
{
|
|
2073
2459
|
identifier: importRuntime("tagVarSignal"),
|
|
2074
2460
|
hasDownstreamIntersections: () => true
|
|
2075
2461
|
},
|
|
2076
|
-
|
|
2462
|
+
attrs2.value
|
|
2077
2463
|
);
|
|
2078
2464
|
}
|
|
2079
|
-
if (
|
|
2465
|
+
if (attrs2.valueChange) {
|
|
2080
2466
|
addValue(
|
|
2081
2467
|
section,
|
|
2082
|
-
|
|
2468
|
+
attrs2.valueChange.extra?.referencedBindings,
|
|
2083
2469
|
{
|
|
2084
2470
|
identifier: importRuntime("setTagVarChange"),
|
|
2085
2471
|
hasDownstreamIntersections: () => false
|
|
2086
2472
|
},
|
|
2087
|
-
|
|
2473
|
+
attrs2.valueChange
|
|
2088
2474
|
);
|
|
2089
2475
|
}
|
|
2090
2476
|
tag.remove();
|
|
@@ -2283,7 +2669,7 @@ var [getSerializedScopeProperties] = createSectionState("serializedScopeProperti
|
|
|
2283
2669
|
var unimplementedBuild = () => {
|
|
2284
2670
|
return import_compiler19.types.stringLiteral("SIGNAL NOT INITIALIZED");
|
|
2285
2671
|
};
|
|
2286
|
-
function getSignal(section, referencedBindings,
|
|
2672
|
+
function getSignal(section, referencedBindings, name2 = generateSignalName(referencedBindings)) {
|
|
2287
2673
|
const signals = getSignals(section);
|
|
2288
2674
|
let signal = signals.get(referencedBindings);
|
|
2289
2675
|
if (!signal) {
|
|
@@ -2292,7 +2678,7 @@ function getSignal(section, referencedBindings, name = generateSignalName(refere
|
|
|
2292
2678
|
referencedBindings,
|
|
2293
2679
|
signal = {
|
|
2294
2680
|
identifier: exportName ? import_compiler19.types.identifier(exportName) : currentProgramPath.scope.generateUidIdentifier(
|
|
2295
|
-
|
|
2681
|
+
name2 + section.name.replace("_", "$")
|
|
2296
2682
|
),
|
|
2297
2683
|
referencedBindings,
|
|
2298
2684
|
section,
|
|
@@ -2544,20 +2930,20 @@ function subscribe(provider, subscriber) {
|
|
|
2544
2930
|
);
|
|
2545
2931
|
}
|
|
2546
2932
|
function generateSignalName(referencedBindings) {
|
|
2547
|
-
let
|
|
2933
|
+
let name2;
|
|
2548
2934
|
if (referencedBindings) {
|
|
2549
2935
|
if (Array.isArray(referencedBindings)) {
|
|
2550
|
-
|
|
2936
|
+
name2 = "expr";
|
|
2551
2937
|
for (const ref of referencedBindings) {
|
|
2552
|
-
|
|
2938
|
+
name2 += `_${ref.name}`;
|
|
2553
2939
|
}
|
|
2554
2940
|
} else {
|
|
2555
|
-
|
|
2941
|
+
name2 = referencedBindings.name;
|
|
2556
2942
|
}
|
|
2557
2943
|
} else {
|
|
2558
|
-
|
|
2944
|
+
name2 = "setup";
|
|
2559
2945
|
}
|
|
2560
|
-
return
|
|
2946
|
+
return name2;
|
|
2561
2947
|
}
|
|
2562
2948
|
function finalizeSignalArgs(args) {
|
|
2563
2949
|
for (let i = args.length - 1; i >= 0; i--) {
|
|
@@ -2619,26 +3005,26 @@ function getResumeRegisterId(section, referencedBindings, type) {
|
|
|
2619
3005
|
markoOpts,
|
|
2620
3006
|
opts: { filename }
|
|
2621
3007
|
} = currentProgramPath.hub.file;
|
|
2622
|
-
let
|
|
3008
|
+
let name2 = "";
|
|
2623
3009
|
if (referencedBindings) {
|
|
2624
3010
|
if (typeof referencedBindings === "string") {
|
|
2625
|
-
|
|
3011
|
+
name2 += `_${referencedBindings}`;
|
|
2626
3012
|
} else if (Array.isArray(referencedBindings)) {
|
|
2627
3013
|
for (const ref of referencedBindings) {
|
|
2628
|
-
|
|
3014
|
+
name2 += `_${ref.name}`;
|
|
2629
3015
|
}
|
|
2630
3016
|
} else {
|
|
2631
|
-
|
|
3017
|
+
name2 += `_${referencedBindings.name}`;
|
|
2632
3018
|
}
|
|
2633
3019
|
}
|
|
2634
3020
|
return (0, import_babel_utils10.getTemplateId)(
|
|
2635
3021
|
markoOpts,
|
|
2636
3022
|
filename,
|
|
2637
|
-
`${section.id}${
|
|
3023
|
+
`${section.id}${name2}${type ? "/" + type : ""}`
|
|
2638
3024
|
);
|
|
2639
3025
|
}
|
|
2640
3026
|
var usedRegisterIdsBySection = /* @__PURE__ */ new WeakMap();
|
|
2641
|
-
function getRegisterUID(section,
|
|
3027
|
+
function getRegisterUID(section, name2) {
|
|
2642
3028
|
const {
|
|
2643
3029
|
markoOpts,
|
|
2644
3030
|
opts: { filename }
|
|
@@ -2648,7 +3034,7 @@ function getRegisterUID(section, name) {
|
|
|
2648
3034
|
const baseId = (0, import_babel_utils10.getTemplateId)(
|
|
2649
3035
|
markoOpts,
|
|
2650
3036
|
filename,
|
|
2651
|
-
`${section.id}/${
|
|
3037
|
+
`${section.id}/${name2}`
|
|
2652
3038
|
);
|
|
2653
3039
|
let count = 0;
|
|
2654
3040
|
let id = baseId;
|
|
@@ -2886,7 +3272,7 @@ function writeHTMLResumeStatements(path4, tagVarIdentifier) {
|
|
|
2886
3272
|
if (tagVarIdentifier && returnId(section) !== void 0) {
|
|
2887
3273
|
serializedProperties.push(
|
|
2888
3274
|
import_compiler19.types.objectProperty(
|
|
2889
|
-
import_compiler19.types.stringLiteral(
|
|
3275
|
+
import_compiler19.types.stringLiteral("/" /* TagVariable */),
|
|
2890
3276
|
tagVarIdentifier
|
|
2891
3277
|
)
|
|
2892
3278
|
);
|
|
@@ -3547,7 +3933,7 @@ var const_default = {
|
|
|
3547
3933
|
descriptionMoreURL: "https://markojs.com/docs/core-tags/#const"
|
|
3548
3934
|
}
|
|
3549
3935
|
],
|
|
3550
|
-
types: "
|
|
3936
|
+
types: runtime_info_default.name + "/tag-types/const.d.marko"
|
|
3551
3937
|
};
|
|
3552
3938
|
|
|
3553
3939
|
// src/translator/core/debug.ts
|
|
@@ -3590,7 +3976,7 @@ var debug_default = {
|
|
|
3590
3976
|
descriptionMoreURL: "https://markojs.com/docs/core-tags/#debug"
|
|
3591
3977
|
}
|
|
3592
3978
|
],
|
|
3593
|
-
types: "
|
|
3979
|
+
types: runtime_info_default.name + "/tag-types/debug.d.marko"
|
|
3594
3980
|
};
|
|
3595
3981
|
|
|
3596
3982
|
// src/translator/core/define.ts
|
|
@@ -3604,7 +3990,6 @@ var import_babel_utils17 = require("@marko/compiler/babel-utils");
|
|
|
3604
3990
|
// src/translator/core/for.ts
|
|
3605
3991
|
var import_compiler27 = require("@marko/compiler");
|
|
3606
3992
|
var import_babel_utils15 = require("@marko/compiler/babel-utils");
|
|
3607
|
-
var import_types5 = require("@marko/runtime-tags/common/types");
|
|
3608
3993
|
|
|
3609
3994
|
// src/translator/util/get-parent-tag.ts
|
|
3610
3995
|
function getParentTag(tag) {
|
|
@@ -3617,18 +4002,16 @@ function getParentTag(tag) {
|
|
|
3617
4002
|
// src/translator/visitors/tag/native-tag.ts
|
|
3618
4003
|
var import_compiler26 = require("@marko/compiler");
|
|
3619
4004
|
var import_babel_utils14 = require("@marko/compiler/babel-utils");
|
|
3620
|
-
var import_helpers = require("@marko/runtime-tags/common/helpers");
|
|
3621
|
-
var import_types4 = require("@marko/runtime-tags/common/types");
|
|
3622
4005
|
var kNativeTagBinding = Symbol("native tag binding");
|
|
3623
4006
|
var kSerializeMarker = Symbol("serialize marker");
|
|
3624
4007
|
var kGetterId = Symbol("node getter id");
|
|
3625
4008
|
var htmlSelectArgs = /* @__PURE__ */ new WeakMap();
|
|
3626
|
-
function assertExclusiveControllableGroups(tag,
|
|
4009
|
+
function assertExclusiveControllableGroups(tag, attrs2) {
|
|
3627
4010
|
const exclusiveGroups = [
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
4011
|
+
attrs2.open || attrs2.openChange,
|
|
4012
|
+
attrs2.checked || attrs2.checkedChange,
|
|
4013
|
+
attrs2.checkedValue || attrs2.checkedValueChange,
|
|
4014
|
+
attrs2.valueChange
|
|
3632
4015
|
].filter(Boolean);
|
|
3633
4016
|
if (exclusiveGroups.length > 1) {
|
|
3634
4017
|
throw tag.get("name").buildCodeFrameError(
|
|
@@ -3636,56 +4019,56 @@ function assertExclusiveControllableGroups(tag, attrs) {
|
|
|
3636
4019
|
);
|
|
3637
4020
|
}
|
|
3638
4021
|
}
|
|
3639
|
-
function getRelatedControllable(tagName,
|
|
4022
|
+
function getRelatedControllable(tagName, attrs2) {
|
|
3640
4023
|
switch (tagName) {
|
|
3641
4024
|
case "input":
|
|
3642
|
-
if (
|
|
4025
|
+
if (attrs2.checked || attrs2.checkedChange) {
|
|
3643
4026
|
return {
|
|
3644
4027
|
special: false,
|
|
3645
4028
|
helper: "controllable_input_checked",
|
|
3646
|
-
attrs: [
|
|
4029
|
+
attrs: [attrs2.checked, attrs2.checkedChange]
|
|
3647
4030
|
};
|
|
3648
4031
|
}
|
|
3649
|
-
if (
|
|
4032
|
+
if (attrs2.checkedValue || attrs2.checkedValueChange) {
|
|
3650
4033
|
return {
|
|
3651
4034
|
special: true,
|
|
3652
4035
|
helper: "controllable_input_checkedValue",
|
|
3653
|
-
attrs: [
|
|
4036
|
+
attrs: [attrs2.checkedValue, attrs2.checkedValueChange, attrs2.value]
|
|
3654
4037
|
};
|
|
3655
4038
|
}
|
|
3656
|
-
if (
|
|
4039
|
+
if (attrs2.value || attrs2.valueChange) {
|
|
3657
4040
|
return {
|
|
3658
4041
|
special: false,
|
|
3659
4042
|
helper: "controllable_input_value",
|
|
3660
|
-
attrs: [
|
|
4043
|
+
attrs: [attrs2.value, attrs2.valueChange]
|
|
3661
4044
|
};
|
|
3662
4045
|
}
|
|
3663
4046
|
break;
|
|
3664
4047
|
case "select":
|
|
3665
|
-
if (
|
|
4048
|
+
if (attrs2.value || attrs2.valueChange) {
|
|
3666
4049
|
return {
|
|
3667
4050
|
special: true,
|
|
3668
4051
|
helper: "controllable_select_value",
|
|
3669
|
-
attrs: [
|
|
4052
|
+
attrs: [attrs2.value, attrs2.valueChange]
|
|
3670
4053
|
};
|
|
3671
4054
|
}
|
|
3672
4055
|
break;
|
|
3673
4056
|
case "textarea":
|
|
3674
|
-
if (
|
|
4057
|
+
if (attrs2.value || attrs2.valueChange) {
|
|
3675
4058
|
return {
|
|
3676
4059
|
special: true,
|
|
3677
4060
|
helper: "controllable_textarea_value",
|
|
3678
|
-
attrs: [
|
|
4061
|
+
attrs: [attrs2.value, attrs2.valueChange]
|
|
3679
4062
|
};
|
|
3680
4063
|
}
|
|
3681
4064
|
break;
|
|
3682
4065
|
case "details":
|
|
3683
4066
|
case "dialog":
|
|
3684
|
-
if (
|
|
4067
|
+
if (attrs2.open || attrs2.openChange) {
|
|
3685
4068
|
return {
|
|
3686
4069
|
special: false,
|
|
3687
4070
|
helper: "controllable_detailsOrDialog_open",
|
|
3688
|
-
attrs: [
|
|
4071
|
+
attrs: [attrs2.open, attrs2.openChange]
|
|
3689
4072
|
};
|
|
3690
4073
|
}
|
|
3691
4074
|
break;
|
|
@@ -3745,7 +4128,7 @@ var native_tag_default = {
|
|
|
3745
4128
|
continue;
|
|
3746
4129
|
}
|
|
3747
4130
|
seen[attr2.name] = attr2;
|
|
3748
|
-
if (
|
|
4131
|
+
if (isEventHandler(attr2.name) || isChangeHandler(attr2.name)) {
|
|
3749
4132
|
(attr2.value.extra ??= {}).isEffect = true;
|
|
3750
4133
|
hasEventHandlers = true;
|
|
3751
4134
|
} else if (!evaluate(attr2.value).confident) {
|
|
@@ -3811,11 +4194,11 @@ var native_tag_default = {
|
|
|
3811
4194
|
enter(tag) {
|
|
3812
4195
|
const tagName = getTagName(tag);
|
|
3813
4196
|
const extra = tag.node.extra;
|
|
3814
|
-
const
|
|
4197
|
+
const nodeRef2 = extra[kNativeTagBinding];
|
|
3815
4198
|
const isHTML = isOutputHTML();
|
|
3816
|
-
const
|
|
4199
|
+
const name2 = tag.get("name");
|
|
3817
4200
|
const tagDef = (0, import_babel_utils14.getTagDef)(tag);
|
|
3818
|
-
const
|
|
4201
|
+
const write2 = writeTo(tag);
|
|
3819
4202
|
const section = getSection(tag);
|
|
3820
4203
|
if (isHTML && extra.tagNameNullable) {
|
|
3821
4204
|
flushBefore(tag);
|
|
@@ -3863,7 +4246,7 @@ var native_tag_default = {
|
|
|
3863
4246
|
callRuntime(
|
|
3864
4247
|
"nodeRef",
|
|
3865
4248
|
import_compiler26.types.stringLiteral(getterId),
|
|
3866
|
-
getScopeAccessorLiteral(
|
|
4249
|
+
getScopeAccessorLiteral(nodeRef2)
|
|
3867
4250
|
)
|
|
3868
4251
|
)
|
|
3869
4252
|
])
|
|
@@ -3874,7 +4257,7 @@ var native_tag_default = {
|
|
|
3874
4257
|
if (reference.parentPath?.isCallExpression()) {
|
|
3875
4258
|
reference.parentPath.replaceWith(
|
|
3876
4259
|
import_compiler26.types.expressionStatement(
|
|
3877
|
-
createScopeReadExpression(referenceSection,
|
|
4260
|
+
createScopeReadExpression(referenceSection, nodeRef2)
|
|
3878
4261
|
)
|
|
3879
4262
|
);
|
|
3880
4263
|
} else if (getterFnIdentifier) {
|
|
@@ -3888,22 +4271,22 @@ var native_tag_default = {
|
|
|
3888
4271
|
}
|
|
3889
4272
|
}
|
|
3890
4273
|
let visitAccessor;
|
|
3891
|
-
if (
|
|
3892
|
-
visitAccessor = getScopeAccessorLiteral(
|
|
3893
|
-
visit(tag,
|
|
4274
|
+
if (nodeRef2) {
|
|
4275
|
+
visitAccessor = getScopeAccessorLiteral(nodeRef2);
|
|
4276
|
+
visit(tag, 32 /* Get */);
|
|
3894
4277
|
}
|
|
3895
|
-
|
|
4278
|
+
write2`<${name2.node}`;
|
|
3896
4279
|
const usedAttrs = getUsedAttrs(tagName, tag.node);
|
|
3897
4280
|
const { staticAttrs, staticControllable, skipExpression } = usedAttrs;
|
|
3898
4281
|
let { spreadExpression } = usedAttrs;
|
|
3899
4282
|
if (staticControllable) {
|
|
3900
|
-
const { helper, attrs } = staticControllable;
|
|
3901
|
-
const firstAttr =
|
|
4283
|
+
const { helper, attrs: attrs2 } = staticControllable;
|
|
4284
|
+
const firstAttr = attrs2.find(Boolean);
|
|
3902
4285
|
const referencedBindings = firstAttr.value.extra?.referencedBindings;
|
|
3903
|
-
const values =
|
|
4286
|
+
const values = attrs2.map((attr2) => attr2?.value);
|
|
3904
4287
|
if (isHTML) {
|
|
3905
4288
|
if (tagName !== "select" && tagName !== "textarea") {
|
|
3906
|
-
|
|
4289
|
+
write2`${callRuntime(helper, getScopeIdIdentifier(section), visitAccessor, ...values)}`;
|
|
3907
4290
|
}
|
|
3908
4291
|
addHTMLEffectCall(section, void 0);
|
|
3909
4292
|
} else {
|
|
@@ -3976,7 +4359,7 @@ var native_tag_default = {
|
|
|
3976
4359
|
writeAtStartOfBody = callRuntime(
|
|
3977
4360
|
"controllable_textarea_value",
|
|
3978
4361
|
getScopeIdIdentifier(getSection(tag)),
|
|
3979
|
-
getScopeAccessorLiteral(
|
|
4362
|
+
getScopeAccessorLiteral(nodeRef2),
|
|
3980
4363
|
value,
|
|
3981
4364
|
valueChange
|
|
3982
4365
|
);
|
|
@@ -3984,21 +4367,21 @@ var native_tag_default = {
|
|
|
3984
4367
|
}
|
|
3985
4368
|
}
|
|
3986
4369
|
for (const attr2 of staticAttrs) {
|
|
3987
|
-
const { name:
|
|
4370
|
+
const { name: name3, value } = attr2;
|
|
3988
4371
|
const { confident, computed } = value.extra || {};
|
|
3989
4372
|
const valueReferences = value.extra?.referencedBindings;
|
|
3990
|
-
if (isHTML && tagName === "option" &&
|
|
3991
|
-
|
|
4373
|
+
if (isHTML && tagName === "option" && name3 === "value") {
|
|
4374
|
+
write2`${callRuntime("optionValueAttr", value)}`;
|
|
3992
4375
|
continue;
|
|
3993
4376
|
}
|
|
3994
|
-
switch (
|
|
4377
|
+
switch (name3) {
|
|
3995
4378
|
case "class":
|
|
3996
4379
|
case "style": {
|
|
3997
|
-
const helper = `${
|
|
4380
|
+
const helper = `${name3}Attr`;
|
|
3998
4381
|
if (confident) {
|
|
3999
|
-
|
|
4382
|
+
write2`${getHTMLRuntime()[helper](computed)}`;
|
|
4000
4383
|
} else if (isHTML) {
|
|
4001
|
-
|
|
4384
|
+
write2`${callRuntime(helper, value)}`;
|
|
4002
4385
|
} else {
|
|
4003
4386
|
addStatement(
|
|
4004
4387
|
"render",
|
|
@@ -4017,14 +4400,14 @@ var native_tag_default = {
|
|
|
4017
4400
|
}
|
|
4018
4401
|
default:
|
|
4019
4402
|
if (confident) {
|
|
4020
|
-
|
|
4403
|
+
write2`${getHTMLRuntime().attr(name3, computed)}`;
|
|
4021
4404
|
} else if (isHTML) {
|
|
4022
|
-
if (
|
|
4405
|
+
if (isEventHandler(name3)) {
|
|
4023
4406
|
addHTMLEffectCall(section, valueReferences);
|
|
4024
4407
|
} else {
|
|
4025
|
-
|
|
4408
|
+
write2`${callRuntime("attr", import_compiler26.types.stringLiteral(name3), value)}`;
|
|
4026
4409
|
}
|
|
4027
|
-
} else if (
|
|
4410
|
+
} else if (isEventHandler(name3)) {
|
|
4028
4411
|
addStatement(
|
|
4029
4412
|
"effect",
|
|
4030
4413
|
section,
|
|
@@ -4033,7 +4416,7 @@ var native_tag_default = {
|
|
|
4033
4416
|
callRuntime(
|
|
4034
4417
|
"on",
|
|
4035
4418
|
import_compiler26.types.memberExpression(scopeIdentifier, visitAccessor, true),
|
|
4036
|
-
import_compiler26.types.stringLiteral(
|
|
4419
|
+
import_compiler26.types.stringLiteral(getEventHandlerName(name3)),
|
|
4037
4420
|
value
|
|
4038
4421
|
)
|
|
4039
4422
|
)
|
|
@@ -4047,7 +4430,7 @@ var native_tag_default = {
|
|
|
4047
4430
|
callRuntime(
|
|
4048
4431
|
"attr",
|
|
4049
4432
|
import_compiler26.types.memberExpression(scopeIdentifier, visitAccessor, true),
|
|
4050
|
-
import_compiler26.types.stringLiteral(
|
|
4433
|
+
import_compiler26.types.stringLiteral(name3),
|
|
4051
4434
|
value
|
|
4052
4435
|
)
|
|
4053
4436
|
)
|
|
@@ -4060,9 +4443,9 @@ var native_tag_default = {
|
|
|
4060
4443
|
if (isHTML) {
|
|
4061
4444
|
addHTMLEffectCall(section, extra.referencedBindings);
|
|
4062
4445
|
if (skipExpression) {
|
|
4063
|
-
|
|
4446
|
+
write2`${callRuntime("partialAttrs", spreadExpression, skipExpression, visitAccessor, getScopeIdIdentifier(section), name2.node)}`;
|
|
4064
4447
|
} else {
|
|
4065
|
-
|
|
4448
|
+
write2`${callRuntime("attrs", spreadExpression, visitAccessor, getScopeIdIdentifier(section), name2.node)}`;
|
|
4066
4449
|
}
|
|
4067
4450
|
} else {
|
|
4068
4451
|
if (skipExpression) {
|
|
@@ -4110,26 +4493,26 @@ var native_tag_default = {
|
|
|
4110
4493
|
switch (tagDef.htmlType) {
|
|
4111
4494
|
case "svg":
|
|
4112
4495
|
case "math":
|
|
4113
|
-
|
|
4496
|
+
write2`/>`;
|
|
4114
4497
|
break;
|
|
4115
4498
|
default:
|
|
4116
|
-
|
|
4499
|
+
write2`>`;
|
|
4117
4500
|
break;
|
|
4118
4501
|
}
|
|
4119
4502
|
} else {
|
|
4120
|
-
|
|
4503
|
+
write2`>`;
|
|
4121
4504
|
}
|
|
4122
4505
|
if (isHTML && extra.tagNameNullable) {
|
|
4123
|
-
tag.insertBefore(import_compiler26.types.ifStatement(
|
|
4506
|
+
tag.insertBefore(import_compiler26.types.ifStatement(name2.node, consumeHTML(tag)))[0].skip();
|
|
4124
4507
|
}
|
|
4125
4508
|
if (writeAtStartOfBody) {
|
|
4126
|
-
|
|
4509
|
+
write2`${writeAtStartOfBody}`;
|
|
4127
4510
|
}
|
|
4128
4511
|
enter2(tag);
|
|
4129
4512
|
},
|
|
4130
4513
|
exit(tag) {
|
|
4131
4514
|
const extra = tag.node.extra;
|
|
4132
|
-
const
|
|
4515
|
+
const nodeRef2 = extra[kNativeTagBinding];
|
|
4133
4516
|
const isHTML = isOutputHTML();
|
|
4134
4517
|
const openTagOnly = (0, import_babel_utils14.getTagDef)(tag)?.parseOptions?.openTagOnly;
|
|
4135
4518
|
const selectArgs = isHTML && htmlSelectArgs.get(tag.node);
|
|
@@ -4145,7 +4528,7 @@ var native_tag_default = {
|
|
|
4145
4528
|
callRuntime(
|
|
4146
4529
|
"controllable_select_value",
|
|
4147
4530
|
getScopeIdIdentifier(getSection(tag)),
|
|
4148
|
-
getScopeAccessorLiteral(
|
|
4531
|
+
getScopeAccessorLiteral(nodeRef2),
|
|
4149
4532
|
selectArgs.value,
|
|
4150
4533
|
selectArgs.valueChange,
|
|
4151
4534
|
import_compiler26.types.arrowFunctionExpression(
|
|
@@ -4169,10 +4552,10 @@ var native_tag_default = {
|
|
|
4169
4552
|
import_compiler26.types.ifStatement(tag.node.name, consumeHTML(tag))
|
|
4170
4553
|
)[0].skip();
|
|
4171
4554
|
}
|
|
4172
|
-
if (
|
|
4555
|
+
if (nodeRef2 && (extra[kSerializeMarker] || isStatefulReferences(extra.referencedBindings) || tag.node.attributes.some(
|
|
4173
4556
|
(attr2) => isStatefulReferences(attr2.value.extra?.referencedBindings)
|
|
4174
4557
|
))) {
|
|
4175
|
-
markNode(tag,
|
|
4558
|
+
markNode(tag, nodeRef2);
|
|
4176
4559
|
}
|
|
4177
4560
|
exit2(tag);
|
|
4178
4561
|
tag.remove();
|
|
@@ -4240,8 +4623,8 @@ function getUsedAttrs(tagName, tag) {
|
|
|
4240
4623
|
}
|
|
4241
4624
|
}
|
|
4242
4625
|
}
|
|
4243
|
-
for (const { name } of staticAttrs) {
|
|
4244
|
-
(skipProps ||= []).push(toObjectProperty(
|
|
4626
|
+
for (const { name: name2 } of staticAttrs) {
|
|
4627
|
+
(skipProps ||= []).push(toObjectProperty(name2, import_compiler26.types.numericLiteral(1)));
|
|
4245
4628
|
}
|
|
4246
4629
|
if (skipProps) {
|
|
4247
4630
|
skipExpression = import_compiler26.types.objectExpression(skipProps);
|
|
@@ -4334,7 +4717,7 @@ var for_default = {
|
|
|
4334
4717
|
const isStateful = isStatefulReferences(tagExtra.referencedBindings);
|
|
4335
4718
|
setSectionParentIsOwner(bodySection, true);
|
|
4336
4719
|
if (!isOnlyChildInParent(tag)) {
|
|
4337
|
-
visit(tag,
|
|
4720
|
+
visit(tag, 37 /* Replace */);
|
|
4338
4721
|
enterShallow(tag);
|
|
4339
4722
|
}
|
|
4340
4723
|
flushBefore(tag);
|
|
@@ -4356,7 +4739,7 @@ var for_default = {
|
|
|
4356
4739
|
const tagExtra = node.extra;
|
|
4357
4740
|
const isStateful = isStatefulReferences(tagExtra.referencedBindings);
|
|
4358
4741
|
const parentTag = getParentTag(tag);
|
|
4359
|
-
const
|
|
4742
|
+
const nodeRef2 = isOnlyChildInParent(tag) ? parentTag.node.extra[kNativeTagBinding] : tag.node.extra[kForMarkerBinding];
|
|
4360
4743
|
const forAttrs = getKnownAttrValues(node);
|
|
4361
4744
|
const forType = getForType(node);
|
|
4362
4745
|
const params = node.body.params;
|
|
@@ -4429,7 +4812,7 @@ var for_default = {
|
|
|
4429
4812
|
} else {
|
|
4430
4813
|
keyExpression = params[defaultByParamIndex];
|
|
4431
4814
|
}
|
|
4432
|
-
const
|
|
4815
|
+
const write2 = writeTo(tag);
|
|
4433
4816
|
const forScopeIdsIdentifier = tag.scope.generateUidIdentifier("forScopeIds");
|
|
4434
4817
|
const forScopesIdentifier = getScopeIdentifier(bodySection);
|
|
4435
4818
|
statements.push(
|
|
@@ -4460,23 +4843,23 @@ var for_default = {
|
|
|
4460
4843
|
)
|
|
4461
4844
|
)
|
|
4462
4845
|
);
|
|
4463
|
-
|
|
4846
|
+
write2`${callRuntime(
|
|
4464
4847
|
"markResumeControlSingleNodeEnd",
|
|
4465
4848
|
getScopeIdIdentifier(tagSection),
|
|
4466
|
-
getScopeAccessorLiteral(
|
|
4849
|
+
getScopeAccessorLiteral(nodeRef2),
|
|
4467
4850
|
forScopeIdsIdentifier
|
|
4468
4851
|
)}`;
|
|
4469
4852
|
} else {
|
|
4470
|
-
|
|
4853
|
+
write2`${callRuntime(
|
|
4471
4854
|
"markResumeControlEnd",
|
|
4472
4855
|
getScopeIdIdentifier(tagSection),
|
|
4473
|
-
getScopeAccessorLiteral(
|
|
4856
|
+
getScopeAccessorLiteral(nodeRef2)
|
|
4474
4857
|
)}`;
|
|
4475
4858
|
}
|
|
4476
4859
|
}
|
|
4477
4860
|
getSerializedScopeProperties(tagSection).set(
|
|
4478
4861
|
import_compiler27.types.stringLiteral(
|
|
4479
|
-
getScopeAccessorLiteral(
|
|
4862
|
+
getScopeAccessorLiteral(nodeRef2).value + "(" /* LoopScopeMap */
|
|
4480
4863
|
),
|
|
4481
4864
|
import_compiler27.types.conditionalExpression(
|
|
4482
4865
|
import_compiler27.types.memberExpression(forScopesIdentifier, import_compiler27.types.identifier("size")),
|
|
@@ -4527,7 +4910,7 @@ var for_default = {
|
|
|
4527
4910
|
}
|
|
4528
4911
|
setSectionParentIsOwner(bodySection, true);
|
|
4529
4912
|
if (!isOnlyChildInParent(tag)) {
|
|
4530
|
-
visit(tag,
|
|
4913
|
+
visit(tag, 37 /* Replace */);
|
|
4531
4914
|
enterShallow(tag);
|
|
4532
4915
|
}
|
|
4533
4916
|
},
|
|
@@ -4539,20 +4922,20 @@ var for_default = {
|
|
|
4539
4922
|
const { node } = tag;
|
|
4540
4923
|
const tagExtra = node.extra;
|
|
4541
4924
|
const { referencedBindings } = tagExtra;
|
|
4542
|
-
const
|
|
4925
|
+
const nodeRef2 = isOnlyChildInParent(tag) ? getParentTag(tag).node.extra[kNativeTagBinding] : tag.node.extra[kForMarkerBinding];
|
|
4543
4926
|
setSubscriberBuilder(tag, (signal2) => {
|
|
4544
4927
|
return callRuntime(
|
|
4545
4928
|
"inLoopScope",
|
|
4546
4929
|
signal2,
|
|
4547
|
-
getScopeAccessorLiteral(
|
|
4930
|
+
getScopeAccessorLiteral(nodeRef2)
|
|
4548
4931
|
);
|
|
4549
4932
|
});
|
|
4550
4933
|
const forType = getForType(node);
|
|
4551
|
-
const signal = getSignal(tagSection,
|
|
4934
|
+
const signal = getSignal(tagSection, nodeRef2, "for");
|
|
4552
4935
|
signal.build = () => {
|
|
4553
4936
|
return callRuntime(
|
|
4554
4937
|
forTypeToDOMRuntime(forType),
|
|
4555
|
-
getScopeAccessorLiteral(
|
|
4938
|
+
getScopeAccessorLiteral(nodeRef2),
|
|
4556
4939
|
import_compiler27.types.identifier(bodySection.name)
|
|
4557
4940
|
);
|
|
4558
4941
|
};
|
|
@@ -4652,11 +5035,11 @@ var for_default = {
|
|
|
4652
5035
|
}
|
|
4653
5036
|
]
|
|
4654
5037
|
};
|
|
4655
|
-
function buildForRuntimeCall(type,
|
|
5038
|
+
function buildForRuntimeCall(type, attrs2, params, statements) {
|
|
4656
5039
|
return import_compiler27.types.expressionStatement(
|
|
4657
5040
|
callRuntime(
|
|
4658
5041
|
forTypeToRuntime(type),
|
|
4659
|
-
...getBaseArgsInForTag(type,
|
|
5042
|
+
...getBaseArgsInForTag(type, attrs2),
|
|
4660
5043
|
import_compiler27.types.arrowFunctionExpression(params, import_compiler27.types.blockStatement(statements))
|
|
4661
5044
|
)
|
|
4662
5045
|
);
|
|
@@ -4703,17 +5086,17 @@ function forTypeToHTMLByRuntime(type) {
|
|
|
4703
5086
|
return "forToBy";
|
|
4704
5087
|
}
|
|
4705
5088
|
}
|
|
4706
|
-
function getBaseArgsInForTag(type,
|
|
5089
|
+
function getBaseArgsInForTag(type, attrs2) {
|
|
4707
5090
|
switch (type) {
|
|
4708
5091
|
case "in":
|
|
4709
|
-
return [
|
|
5092
|
+
return [attrs2.in];
|
|
4710
5093
|
case "of":
|
|
4711
|
-
return [
|
|
5094
|
+
return [attrs2.of];
|
|
4712
5095
|
case "to":
|
|
4713
5096
|
return [
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
5097
|
+
attrs2.to,
|
|
5098
|
+
attrs2.from || import_compiler27.types.numericLiteral(0),
|
|
5099
|
+
attrs2.step || import_compiler27.types.numericLiteral(1)
|
|
4717
5100
|
];
|
|
4718
5101
|
}
|
|
4719
5102
|
}
|
|
@@ -4734,53 +5117,53 @@ var import_compiler28 = require("@marko/compiler");
|
|
|
4734
5117
|
var import_babel_utils16 = require("@marko/compiler/babel-utils");
|
|
4735
5118
|
var attrTagToIdentifierLookup = /* @__PURE__ */ new WeakMap();
|
|
4736
5119
|
function getAttrTagIdentifier(meta) {
|
|
4737
|
-
let
|
|
4738
|
-
if (!
|
|
4739
|
-
|
|
4740
|
-
attrTagToIdentifierLookup.set(meta,
|
|
5120
|
+
let name2 = attrTagToIdentifierLookup.get(meta);
|
|
5121
|
+
if (!name2) {
|
|
5122
|
+
name2 = currentProgramPath.scope.generateUid(meta.name);
|
|
5123
|
+
attrTagToIdentifierLookup.set(meta, name2);
|
|
4741
5124
|
}
|
|
4742
|
-
return import_compiler28.types.identifier(
|
|
5125
|
+
return import_compiler28.types.identifier(name2);
|
|
4743
5126
|
}
|
|
4744
5127
|
function analyzeAttributeTags(tag) {
|
|
4745
5128
|
if (tag.node.extra?.attributeTags) return tag.node.extra.attributeTags;
|
|
4746
|
-
const
|
|
4747
|
-
if (!
|
|
5129
|
+
const attrTags2 = tag.node.body.attributeTags ? tag.get("body").get("body") : tag.get("attributeTags");
|
|
5130
|
+
if (!attrTags2.length) return;
|
|
4748
5131
|
const tagExtra = tag.node.extra ??= {};
|
|
4749
5132
|
const lookup = tagExtra.attributeTags = {};
|
|
4750
5133
|
const attrTagNodesByName = {};
|
|
4751
5134
|
const sampleAttrTagsForControlFlow = /* @__PURE__ */ new Map();
|
|
4752
|
-
for (const child of
|
|
5135
|
+
for (const child of attrTags2) {
|
|
4753
5136
|
if (child.isMarkoTag()) {
|
|
4754
5137
|
if ((0, import_babel_utils16.isAttributeTag)(child)) {
|
|
4755
|
-
const
|
|
4756
|
-
lookup[
|
|
5138
|
+
const name2 = getTagName(child);
|
|
5139
|
+
lookup[name2] ||= createAttrTagMeta(name2, [name2]);
|
|
4757
5140
|
analyzeAttributeTags(child);
|
|
4758
5141
|
} else {
|
|
4759
5142
|
const isRepeated = (0, import_babel_utils16.isLoopTag)(child);
|
|
4760
5143
|
let curGroup;
|
|
4761
|
-
for (const
|
|
4762
|
-
const oldMeta = lookup[
|
|
5144
|
+
for (const name2 of crawlAttrTags(child, attrTagNodesByName)) {
|
|
5145
|
+
const oldMeta = lookup[name2];
|
|
4763
5146
|
if (oldMeta) {
|
|
4764
5147
|
if (!curGroup) {
|
|
4765
5148
|
curGroup = oldMeta.group;
|
|
4766
5149
|
} else if (curGroup !== oldMeta.group) {
|
|
4767
|
-
for (const
|
|
4768
|
-
lookup[
|
|
4769
|
-
curGroup.push(
|
|
5150
|
+
for (const name3 of oldMeta.group) {
|
|
5151
|
+
lookup[name3].group = curGroup;
|
|
5152
|
+
curGroup.push(name3);
|
|
4770
5153
|
}
|
|
4771
5154
|
}
|
|
4772
5155
|
}
|
|
4773
|
-
let attrTagMeta = lookup[
|
|
5156
|
+
let attrTagMeta = lookup[name2];
|
|
4774
5157
|
if (!attrTagMeta) {
|
|
4775
|
-
attrTagMeta = lookup[
|
|
5158
|
+
attrTagMeta = lookup[name2] = createAttrTagMeta(name2, []);
|
|
4776
5159
|
curGroup = attrTagMeta.group;
|
|
4777
|
-
curGroup.push(
|
|
5160
|
+
curGroup.push(name2);
|
|
4778
5161
|
}
|
|
4779
5162
|
attrTagMeta.dynamic = true;
|
|
4780
5163
|
if (isRepeated) {
|
|
4781
5164
|
attrTagMeta.repeated = true;
|
|
4782
5165
|
}
|
|
4783
|
-
sampleAttrTagsForControlFlow.set(child,
|
|
5166
|
+
sampleAttrTagsForControlFlow.set(child, name2);
|
|
4784
5167
|
}
|
|
4785
5168
|
}
|
|
4786
5169
|
}
|
|
@@ -4788,10 +5171,10 @@ function analyzeAttributeTags(tag) {
|
|
|
4788
5171
|
for (const [controlFlowTag, sampleAttrName] of sampleAttrTagsForControlFlow) {
|
|
4789
5172
|
(controlFlowTag.node.extra ??= {}).attributeTagGroup = lookup[sampleAttrName].group;
|
|
4790
5173
|
}
|
|
4791
|
-
for (const
|
|
4792
|
-
const attrTagMeta = lookup[
|
|
5174
|
+
for (const name2 in attrTagNodesByName) {
|
|
5175
|
+
const attrTagMeta = lookup[name2];
|
|
4793
5176
|
if (!attrTagMeta.repeated) {
|
|
4794
|
-
const attrTagNodes = attrTagNodesByName[
|
|
5177
|
+
const attrTagNodes = attrTagNodesByName[name2];
|
|
4795
5178
|
if (attrTagNodes.length > 1) {
|
|
4796
5179
|
attrTagMeta.repeated = !attrTagMeta.dynamic || hasRepeatedDynamicAttrTags(attrTagNodes);
|
|
4797
5180
|
}
|
|
@@ -4799,17 +5182,17 @@ function analyzeAttributeTags(tag) {
|
|
|
4799
5182
|
}
|
|
4800
5183
|
return lookup;
|
|
4801
5184
|
}
|
|
4802
|
-
function createAttrTagMeta(
|
|
5185
|
+
function createAttrTagMeta(name2, group) {
|
|
4803
5186
|
return {
|
|
4804
|
-
name:
|
|
5187
|
+
name: name2.slice(1),
|
|
4805
5188
|
dynamic: false,
|
|
4806
5189
|
repeated: false,
|
|
4807
5190
|
group
|
|
4808
5191
|
};
|
|
4809
5192
|
}
|
|
4810
5193
|
function crawlAttrTags(tag, attrTagNodesByName, attrTagNames = /* @__PURE__ */ new Set()) {
|
|
4811
|
-
const
|
|
4812
|
-
for (const child of
|
|
5194
|
+
const attrTags2 = tag.node.body.attributeTags ? tag.get("body").get("body") : tag.get("attributeTags");
|
|
5195
|
+
for (const child of attrTags2) {
|
|
4813
5196
|
if (child.isMarkoTag()) {
|
|
4814
5197
|
if ((0, import_babel_utils16.isAttributeTag)(child)) {
|
|
4815
5198
|
const tagName = getTagName(child);
|
|
@@ -4823,11 +5206,11 @@ function crawlAttrTags(tag, attrTagNodesByName, attrTagNames = /* @__PURE__ */ n
|
|
|
4823
5206
|
}
|
|
4824
5207
|
return attrTagNames;
|
|
4825
5208
|
}
|
|
4826
|
-
function hasRepeatedDynamicAttrTags(
|
|
5209
|
+
function hasRepeatedDynamicAttrTags(attrTags2) {
|
|
4827
5210
|
let conditionRoot;
|
|
4828
5211
|
const seenBranches = /* @__PURE__ */ new Set();
|
|
4829
|
-
for (const
|
|
4830
|
-
const parentTag = getParentTag(
|
|
5212
|
+
for (const attrTag2 of attrTags2) {
|
|
5213
|
+
const parentTag = getParentTag(attrTag2);
|
|
4831
5214
|
if (seenBranches.has(parentTag) || !isConditionTag(parentTag)) {
|
|
4832
5215
|
return true;
|
|
4833
5216
|
}
|
|
@@ -4857,8 +5240,8 @@ function translateAttrs(tag, templateExports, statements = []) {
|
|
|
4857
5240
|
const properties = [];
|
|
4858
5241
|
const attrTagLookup = tag.node.extra?.attributeTags;
|
|
4859
5242
|
if (attrTagLookup) {
|
|
4860
|
-
for (const
|
|
4861
|
-
const attrTagMeta = attrTagLookup[
|
|
5243
|
+
for (const name2 in attrTagLookup) {
|
|
5244
|
+
const attrTagMeta = attrTagLookup[name2];
|
|
4862
5245
|
if (usesExport(templateExports, attrTagMeta.name)) {
|
|
4863
5246
|
seen.add(attrTagMeta.name);
|
|
4864
5247
|
if (attrTagMeta.dynamic) {
|
|
@@ -4876,15 +5259,15 @@ function translateAttrs(tag, templateExports, statements = []) {
|
|
|
4876
5259
|
}
|
|
4877
5260
|
}
|
|
4878
5261
|
}
|
|
4879
|
-
const
|
|
4880
|
-
for (let i = 0; i <
|
|
4881
|
-
const child =
|
|
5262
|
+
const attrTags2 = tag.node.body.attributeTags ? tag.get("body").get("body") : tag.get("attributeTags");
|
|
5263
|
+
for (let i = 0; i < attrTags2.length; i++) {
|
|
5264
|
+
const child = attrTags2[i];
|
|
4882
5265
|
if (child.isMarkoTag()) {
|
|
4883
5266
|
if ((0, import_babel_utils17.isAttributeTag)(child)) {
|
|
4884
5267
|
const attrTagMeta = attrTagLookup[getTagName(child)];
|
|
4885
5268
|
if (attrTagMeta.dynamic) {
|
|
4886
5269
|
i = addDynamicAttrTagStatements(
|
|
4887
|
-
|
|
5270
|
+
attrTags2,
|
|
4888
5271
|
i,
|
|
4889
5272
|
attrTagLookup,
|
|
4890
5273
|
statements,
|
|
@@ -4929,7 +5312,7 @@ function translateAttrs(tag, templateExports, statements = []) {
|
|
|
4929
5312
|
}
|
|
4930
5313
|
} else {
|
|
4931
5314
|
i = addDynamicAttrTagStatements(
|
|
4932
|
-
|
|
5315
|
+
attrTags2,
|
|
4933
5316
|
i,
|
|
4934
5317
|
attrTagLookup,
|
|
4935
5318
|
statements,
|
|
@@ -4972,8 +5355,8 @@ function getTranslatedRenderBodyProperty(props) {
|
|
|
4972
5355
|
}
|
|
4973
5356
|
}
|
|
4974
5357
|
}
|
|
4975
|
-
function addDynamicAttrTagStatements(
|
|
4976
|
-
const tag =
|
|
5358
|
+
function addDynamicAttrTagStatements(attrTags2, index, attrTagLookup, statements, templateExports) {
|
|
5359
|
+
const tag = attrTags2[index];
|
|
4977
5360
|
if (tag.isMarkoTag()) {
|
|
4978
5361
|
if ((0, import_babel_utils17.isAttributeTag)(tag)) {
|
|
4979
5362
|
const attrTagMeta = attrTagLookup[getTagName(tag)];
|
|
@@ -5016,7 +5399,7 @@ function addDynamicAttrTagStatements(attrTags, index, attrTagLookup, statements,
|
|
|
5016
5399
|
switch (getTagName(tag)) {
|
|
5017
5400
|
case "if":
|
|
5018
5401
|
return translateIfAttrTag(
|
|
5019
|
-
|
|
5402
|
+
attrTags2,
|
|
5020
5403
|
index,
|
|
5021
5404
|
attrTagLookup,
|
|
5022
5405
|
statements,
|
|
@@ -5024,7 +5407,7 @@ function addDynamicAttrTagStatements(attrTags, index, attrTagLookup, statements,
|
|
|
5024
5407
|
);
|
|
5025
5408
|
case "for": {
|
|
5026
5409
|
return translateForAttrTag(
|
|
5027
|
-
|
|
5410
|
+
attrTags2,
|
|
5028
5411
|
index,
|
|
5029
5412
|
attrTagLookup,
|
|
5030
5413
|
statements,
|
|
@@ -5039,8 +5422,8 @@ function addDynamicAttrTagStatements(attrTags, index, attrTagLookup, statements,
|
|
|
5039
5422
|
function propsToExpression(props) {
|
|
5040
5423
|
return props.length === 1 && import_compiler29.types.isSpreadElement(props[0]) ? props[0].argument : import_compiler29.types.objectExpression(props);
|
|
5041
5424
|
}
|
|
5042
|
-
function translateForAttrTag(
|
|
5043
|
-
const forTag =
|
|
5425
|
+
function translateForAttrTag(attrTags2, index, attrTagLookup, statements, templateExports) {
|
|
5426
|
+
const forTag = attrTags2[index];
|
|
5044
5427
|
const bodyStatements = [];
|
|
5045
5428
|
addAllAttrTagsAsDynamic(
|
|
5046
5429
|
forTag,
|
|
@@ -5058,8 +5441,8 @@ function translateForAttrTag(attrTags, index, attrTagLookup, statements, templat
|
|
|
5058
5441
|
);
|
|
5059
5442
|
return index;
|
|
5060
5443
|
}
|
|
5061
|
-
function translateIfAttrTag(
|
|
5062
|
-
const ifTag =
|
|
5444
|
+
function translateIfAttrTag(attrTags2, index, attrTagLookup, statements, templateExports) {
|
|
5445
|
+
const ifTag = attrTags2[index];
|
|
5063
5446
|
const consequentStatements = [];
|
|
5064
5447
|
let ifStatement = import_compiler29.types.ifStatement(
|
|
5065
5448
|
getConditionTestValue(ifTag),
|
|
@@ -5073,8 +5456,8 @@ function translateIfAttrTag(attrTags, index, attrTagLookup, statements, template
|
|
|
5073
5456
|
templateExports
|
|
5074
5457
|
);
|
|
5075
5458
|
let nextIndex = index + 1;
|
|
5076
|
-
while (nextIndex <
|
|
5077
|
-
const nextTag =
|
|
5459
|
+
while (nextIndex < attrTags2.length) {
|
|
5460
|
+
const nextTag = attrTags2[nextIndex];
|
|
5078
5461
|
if (nextTag.isMarkoTag()) {
|
|
5079
5462
|
switch (getTagName(nextTag)) {
|
|
5080
5463
|
case "else-if":
|
|
@@ -5106,10 +5489,10 @@ function translateIfAttrTag(attrTags, index, attrTagLookup, statements, template
|
|
|
5106
5489
|
return nextIndex - 1;
|
|
5107
5490
|
}
|
|
5108
5491
|
function addAllAttrTagsAsDynamic(tag, attrTagLookup, statements, templateExports) {
|
|
5109
|
-
const
|
|
5110
|
-
for (let i = 0; i <
|
|
5492
|
+
const attrTags2 = tag.node.body.attributeTags ? tag.get("body").get("body") : tag.get("attributeTags");
|
|
5493
|
+
for (let i = 0; i < attrTags2.length; i++) {
|
|
5111
5494
|
i = addDynamicAttrTagStatements(
|
|
5112
|
-
|
|
5495
|
+
attrTags2,
|
|
5113
5496
|
i,
|
|
5114
5497
|
attrTagLookup,
|
|
5115
5498
|
statements,
|
|
@@ -5117,20 +5500,20 @@ function addAllAttrTagsAsDynamic(tag, attrTagLookup, statements, templateExports
|
|
|
5117
5500
|
);
|
|
5118
5501
|
}
|
|
5119
5502
|
}
|
|
5120
|
-
function usesExport(templateExports,
|
|
5121
|
-
return !templateExports || !!templateExports[
|
|
5503
|
+
function usesExport(templateExports, name2) {
|
|
5504
|
+
return !templateExports || !!templateExports[name2];
|
|
5122
5505
|
}
|
|
5123
|
-
function findObjectProperty(
|
|
5506
|
+
function findObjectProperty(name2, props) {
|
|
5124
5507
|
for (const prop of props) {
|
|
5125
5508
|
if (prop.type === "ObjectProperty") {
|
|
5126
5509
|
switch (prop.key.type) {
|
|
5127
5510
|
case "StringLiteral":
|
|
5128
|
-
if (prop.key.value ===
|
|
5511
|
+
if (prop.key.value === name2) {
|
|
5129
5512
|
return prop;
|
|
5130
5513
|
}
|
|
5131
5514
|
break;
|
|
5132
5515
|
case "Identifier":
|
|
5133
|
-
if (prop.key.name ===
|
|
5516
|
+
if (prop.key.name === name2) {
|
|
5134
5517
|
return prop;
|
|
5135
5518
|
}
|
|
5136
5519
|
break;
|
|
@@ -5239,7 +5622,7 @@ var define_default = {
|
|
|
5239
5622
|
descriptionMoreURL: "https://markojs.com/docs/core-tags/#define"
|
|
5240
5623
|
}
|
|
5241
5624
|
],
|
|
5242
|
-
types: "
|
|
5625
|
+
types: runtime_info_default.name + "/tag-types/define.d.marko"
|
|
5243
5626
|
};
|
|
5244
5627
|
|
|
5245
5628
|
// src/translator/core/effect.ts
|
|
@@ -5273,7 +5656,7 @@ var effect_default = {
|
|
|
5273
5656
|
}
|
|
5274
5657
|
],
|
|
5275
5658
|
attributes: {},
|
|
5276
|
-
types: "
|
|
5659
|
+
types: runtime_info_default.name + "/tag-types/effect.d.marko"
|
|
5277
5660
|
};
|
|
5278
5661
|
|
|
5279
5662
|
// src/translator/core/export.ts
|
|
@@ -5299,7 +5682,6 @@ var export_default = {
|
|
|
5299
5682
|
// src/translator/core/html-comment.ts
|
|
5300
5683
|
var import_compiler32 = require("@marko/compiler");
|
|
5301
5684
|
var import_babel_utils21 = require("@marko/compiler/babel-utils");
|
|
5302
|
-
var import_types6 = require("@marko/runtime-tags/common/types");
|
|
5303
5685
|
var kCommentTagBinding = Symbol("comment tag binding");
|
|
5304
5686
|
var kGetterId2 = Symbol("node getter id");
|
|
5305
5687
|
var html_comment_default = {
|
|
@@ -5406,17 +5788,17 @@ var html_comment_default = {
|
|
|
5406
5788
|
}
|
|
5407
5789
|
}
|
|
5408
5790
|
if (tagExtra[kCommentTagBinding]) {
|
|
5409
|
-
visit(tag,
|
|
5791
|
+
visit(tag, 32 /* Get */);
|
|
5410
5792
|
}
|
|
5411
|
-
const
|
|
5793
|
+
const write2 = writeTo(tag);
|
|
5412
5794
|
enter2(tag);
|
|
5413
|
-
|
|
5795
|
+
write2`<!--`;
|
|
5414
5796
|
if (isOutputHTML()) {
|
|
5415
5797
|
for (const child of tag.node.body.body) {
|
|
5416
5798
|
if (import_compiler32.types.isMarkoText(child)) {
|
|
5417
|
-
|
|
5799
|
+
write2`${child.value}`;
|
|
5418
5800
|
} else if (import_compiler32.types.isMarkoPlaceholder(child)) {
|
|
5419
|
-
|
|
5801
|
+
write2`${callRuntime("escapeXML", child.value)}`;
|
|
5420
5802
|
}
|
|
5421
5803
|
}
|
|
5422
5804
|
} else {
|
|
@@ -5433,7 +5815,7 @@ var html_comment_default = {
|
|
|
5433
5815
|
}
|
|
5434
5816
|
}
|
|
5435
5817
|
if (templateExpressions.length === 0) {
|
|
5436
|
-
|
|
5818
|
+
write2`${currentQuasi}`;
|
|
5437
5819
|
} else {
|
|
5438
5820
|
templateQuasis.push(import_compiler32.types.templateElement({ raw: currentQuasi }));
|
|
5439
5821
|
addStatement(
|
|
@@ -5455,7 +5837,7 @@ var html_comment_default = {
|
|
|
5455
5837
|
}
|
|
5456
5838
|
}
|
|
5457
5839
|
exit2(tag);
|
|
5458
|
-
|
|
5840
|
+
write2`-->`;
|
|
5459
5841
|
if (commentBinding) {
|
|
5460
5842
|
markNode(tag, commentBinding);
|
|
5461
5843
|
}
|
|
@@ -5476,8 +5858,6 @@ var html_comment_default = {
|
|
|
5476
5858
|
// src/translator/core/html-script.ts
|
|
5477
5859
|
var import_compiler33 = require("@marko/compiler");
|
|
5478
5860
|
var import_babel_utils22 = require("@marko/compiler/babel-utils");
|
|
5479
|
-
var import_helpers2 = require("@marko/runtime-tags/common/helpers");
|
|
5480
|
-
var import_types7 = require("@marko/runtime-tags/common/types");
|
|
5481
5861
|
var kGetterId3 = Symbol("node getter id");
|
|
5482
5862
|
var html_script_default = {
|
|
5483
5863
|
analyze(tag) {
|
|
@@ -5503,7 +5883,7 @@ var html_script_default = {
|
|
|
5503
5883
|
continue;
|
|
5504
5884
|
}
|
|
5505
5885
|
seen[attr2.name] = attr2;
|
|
5506
|
-
if (
|
|
5886
|
+
if (isEventHandler(attr2.name)) {
|
|
5507
5887
|
(attr2.value.extra ??= {}).isEffect = true;
|
|
5508
5888
|
hasEventHandlers = true;
|
|
5509
5889
|
} else if (!evaluate(attr2.value).confident) {
|
|
@@ -5565,9 +5945,9 @@ var html_script_default = {
|
|
|
5565
5945
|
},
|
|
5566
5946
|
translate(tag) {
|
|
5567
5947
|
const tagExtra = tag.node.extra;
|
|
5568
|
-
const
|
|
5948
|
+
const nodeRef2 = tagExtra[kNativeTagBinding];
|
|
5569
5949
|
const isHTML = isOutputHTML();
|
|
5570
|
-
const
|
|
5950
|
+
const write2 = writeTo(tag);
|
|
5571
5951
|
const section = getSection(tag);
|
|
5572
5952
|
const hasVar = !!tag.node.var;
|
|
5573
5953
|
if (hasVar) {
|
|
@@ -5611,7 +5991,7 @@ var html_script_default = {
|
|
|
5611
5991
|
callRuntime(
|
|
5612
5992
|
"nodeRef",
|
|
5613
5993
|
import_compiler33.types.stringLiteral(getterId),
|
|
5614
|
-
getScopeAccessorLiteral(
|
|
5994
|
+
getScopeAccessorLiteral(nodeRef2)
|
|
5615
5995
|
)
|
|
5616
5996
|
)
|
|
5617
5997
|
])
|
|
@@ -5622,7 +6002,7 @@ var html_script_default = {
|
|
|
5622
6002
|
if (reference.parentPath?.isCallExpression()) {
|
|
5623
6003
|
reference.parentPath.replaceWith(
|
|
5624
6004
|
import_compiler33.types.expressionStatement(
|
|
5625
|
-
createScopeReadExpression(referenceSection,
|
|
6005
|
+
createScopeReadExpression(referenceSection, nodeRef2)
|
|
5626
6006
|
)
|
|
5627
6007
|
);
|
|
5628
6008
|
} else if (getterFnIdentifier) {
|
|
@@ -5636,25 +6016,25 @@ var html_script_default = {
|
|
|
5636
6016
|
}
|
|
5637
6017
|
}
|
|
5638
6018
|
let visitAccessor;
|
|
5639
|
-
if (
|
|
5640
|
-
visitAccessor = getScopeAccessorLiteral(
|
|
5641
|
-
visit(tag,
|
|
6019
|
+
if (nodeRef2) {
|
|
6020
|
+
visitAccessor = getScopeAccessorLiteral(nodeRef2);
|
|
6021
|
+
visit(tag, 32 /* Get */);
|
|
5642
6022
|
}
|
|
5643
|
-
|
|
6023
|
+
write2`<script`;
|
|
5644
6024
|
const usedAttrs = getUsedAttrs2(tag.node);
|
|
5645
6025
|
const { staticAttrs, skipExpression, spreadExpression } = usedAttrs;
|
|
5646
6026
|
for (const attr2 of staticAttrs) {
|
|
5647
|
-
const { name, value } = attr2;
|
|
6027
|
+
const { name: name2, value } = attr2;
|
|
5648
6028
|
const { confident, computed } = value.extra || {};
|
|
5649
6029
|
const valueReferences = value.extra?.referencedBindings;
|
|
5650
|
-
switch (
|
|
6030
|
+
switch (name2) {
|
|
5651
6031
|
case "class":
|
|
5652
6032
|
case "style": {
|
|
5653
|
-
const helper = `${
|
|
6033
|
+
const helper = `${name2}Attr`;
|
|
5654
6034
|
if (confident) {
|
|
5655
|
-
|
|
6035
|
+
write2`${getHTMLRuntime()[helper](computed)}`;
|
|
5656
6036
|
} else if (isHTML) {
|
|
5657
|
-
|
|
6037
|
+
write2`${callRuntime(helper, value)}`;
|
|
5658
6038
|
} else {
|
|
5659
6039
|
addStatement(
|
|
5660
6040
|
"render",
|
|
@@ -5673,14 +6053,14 @@ var html_script_default = {
|
|
|
5673
6053
|
}
|
|
5674
6054
|
default:
|
|
5675
6055
|
if (confident) {
|
|
5676
|
-
|
|
6056
|
+
write2`${getHTMLRuntime().attr(name2, computed)}`;
|
|
5677
6057
|
} else if (isHTML) {
|
|
5678
|
-
if (
|
|
6058
|
+
if (isEventHandler(name2)) {
|
|
5679
6059
|
addHTMLEffectCall(section, valueReferences);
|
|
5680
6060
|
} else {
|
|
5681
|
-
|
|
6061
|
+
write2`${callRuntime("attr", import_compiler33.types.stringLiteral(name2), value)}`;
|
|
5682
6062
|
}
|
|
5683
|
-
} else if (
|
|
6063
|
+
} else if (isEventHandler(name2)) {
|
|
5684
6064
|
addStatement(
|
|
5685
6065
|
"effect",
|
|
5686
6066
|
section,
|
|
@@ -5689,7 +6069,7 @@ var html_script_default = {
|
|
|
5689
6069
|
callRuntime(
|
|
5690
6070
|
"on",
|
|
5691
6071
|
import_compiler33.types.memberExpression(scopeIdentifier, visitAccessor, true),
|
|
5692
|
-
import_compiler33.types.stringLiteral(
|
|
6072
|
+
import_compiler33.types.stringLiteral(getEventHandlerName(name2)),
|
|
5693
6073
|
value
|
|
5694
6074
|
)
|
|
5695
6075
|
)
|
|
@@ -5703,7 +6083,7 @@ var html_script_default = {
|
|
|
5703
6083
|
callRuntime(
|
|
5704
6084
|
"attr",
|
|
5705
6085
|
import_compiler33.types.memberExpression(scopeIdentifier, visitAccessor, true),
|
|
5706
|
-
import_compiler33.types.stringLiteral(
|
|
6086
|
+
import_compiler33.types.stringLiteral(name2),
|
|
5707
6087
|
value
|
|
5708
6088
|
)
|
|
5709
6089
|
)
|
|
@@ -5716,9 +6096,9 @@ var html_script_default = {
|
|
|
5716
6096
|
if (isHTML) {
|
|
5717
6097
|
addHTMLEffectCall(section, tagExtra.referencedBindings);
|
|
5718
6098
|
if (skipExpression) {
|
|
5719
|
-
|
|
6099
|
+
write2`${callRuntime("partialAttrs", spreadExpression, skipExpression, visitAccessor, getScopeIdIdentifier(section), import_compiler33.types.stringLiteral("script"))}`;
|
|
5720
6100
|
} else {
|
|
5721
|
-
|
|
6101
|
+
write2`${callRuntime("attrs", spreadExpression, visitAccessor, getScopeIdIdentifier(section), import_compiler33.types.stringLiteral("script"))}`;
|
|
5722
6102
|
}
|
|
5723
6103
|
} else {
|
|
5724
6104
|
if (skipExpression) {
|
|
@@ -5762,14 +6142,14 @@ var html_script_default = {
|
|
|
5762
6142
|
);
|
|
5763
6143
|
}
|
|
5764
6144
|
}
|
|
5765
|
-
|
|
6145
|
+
write2`>`;
|
|
5766
6146
|
enter2(tag);
|
|
5767
6147
|
if (isOutputHTML()) {
|
|
5768
6148
|
for (const child of tag.node.body.body) {
|
|
5769
6149
|
if (import_compiler33.types.isMarkoText(child)) {
|
|
5770
|
-
|
|
6150
|
+
write2`${child.value}`;
|
|
5771
6151
|
} else if (import_compiler33.types.isMarkoPlaceholder(child)) {
|
|
5772
|
-
|
|
6152
|
+
write2`${callRuntime("escapeScript", child.value)}`;
|
|
5773
6153
|
}
|
|
5774
6154
|
}
|
|
5775
6155
|
} else {
|
|
@@ -5788,7 +6168,7 @@ var html_script_default = {
|
|
|
5788
6168
|
}
|
|
5789
6169
|
}
|
|
5790
6170
|
if (!referencePlaceholder) {
|
|
5791
|
-
|
|
6171
|
+
write2`${currentQuasi}`;
|
|
5792
6172
|
} else {
|
|
5793
6173
|
templateQuasis.push(import_compiler33.types.templateElement({ raw: currentQuasi }));
|
|
5794
6174
|
addStatement(
|
|
@@ -5805,9 +6185,9 @@ var html_script_default = {
|
|
|
5805
6185
|
);
|
|
5806
6186
|
}
|
|
5807
6187
|
}
|
|
5808
|
-
|
|
5809
|
-
if (
|
|
5810
|
-
markNode(tag,
|
|
6188
|
+
write2`</script>`;
|
|
6189
|
+
if (nodeRef2) {
|
|
6190
|
+
markNode(tag, nodeRef2);
|
|
5811
6191
|
}
|
|
5812
6192
|
exit2(tag);
|
|
5813
6193
|
tag.remove();
|
|
@@ -5855,8 +6235,8 @@ function getUsedAttrs2(tag) {
|
|
|
5855
6235
|
const staticAttrs = [...maybeStaticAttrs].reverse();
|
|
5856
6236
|
if (spreadProps) {
|
|
5857
6237
|
spreadProps.reverse();
|
|
5858
|
-
for (const { name } of staticAttrs) {
|
|
5859
|
-
(skipProps ||= []).push(toObjectProperty(
|
|
6238
|
+
for (const { name: name2 } of staticAttrs) {
|
|
6239
|
+
(skipProps ||= []).push(toObjectProperty(name2, import_compiler33.types.numericLiteral(1)));
|
|
5860
6240
|
}
|
|
5861
6241
|
if (skipProps) {
|
|
5862
6242
|
skipExpression = import_compiler33.types.objectExpression(skipProps);
|
|
@@ -5873,8 +6253,6 @@ function getUsedAttrs2(tag) {
|
|
|
5873
6253
|
// src/translator/core/html-style.ts
|
|
5874
6254
|
var import_compiler34 = require("@marko/compiler");
|
|
5875
6255
|
var import_babel_utils23 = require("@marko/compiler/babel-utils");
|
|
5876
|
-
var import_helpers3 = require("@marko/runtime-tags/common/helpers");
|
|
5877
|
-
var import_types8 = require("@marko/runtime-tags/common/types");
|
|
5878
6256
|
var kGetterId4 = Symbol("node getter id");
|
|
5879
6257
|
var html_style_default = {
|
|
5880
6258
|
analyze(tag) {
|
|
@@ -5900,7 +6278,7 @@ var html_style_default = {
|
|
|
5900
6278
|
continue;
|
|
5901
6279
|
}
|
|
5902
6280
|
seen[attr2.name] = attr2;
|
|
5903
|
-
if (
|
|
6281
|
+
if (isEventHandler(attr2.name)) {
|
|
5904
6282
|
(attr2.value.extra ??= {}).isEffect = true;
|
|
5905
6283
|
hasEventHandlers = true;
|
|
5906
6284
|
} else if (!evaluate(attr2.value).confident) {
|
|
@@ -5962,9 +6340,9 @@ var html_style_default = {
|
|
|
5962
6340
|
},
|
|
5963
6341
|
translate(tag) {
|
|
5964
6342
|
const tagExtra = tag.node.extra;
|
|
5965
|
-
const
|
|
6343
|
+
const nodeRef2 = tagExtra[kNativeTagBinding];
|
|
5966
6344
|
const isHTML = isOutputHTML();
|
|
5967
|
-
const
|
|
6345
|
+
const write2 = writeTo(tag);
|
|
5968
6346
|
const section = getSection(tag);
|
|
5969
6347
|
const hasVar = !!tag.node.var;
|
|
5970
6348
|
if (hasVar) {
|
|
@@ -6008,7 +6386,7 @@ var html_style_default = {
|
|
|
6008
6386
|
callRuntime(
|
|
6009
6387
|
"nodeRef",
|
|
6010
6388
|
import_compiler34.types.stringLiteral(getterId),
|
|
6011
|
-
getScopeAccessorLiteral(
|
|
6389
|
+
getScopeAccessorLiteral(nodeRef2)
|
|
6012
6390
|
)
|
|
6013
6391
|
)
|
|
6014
6392
|
])
|
|
@@ -6019,7 +6397,7 @@ var html_style_default = {
|
|
|
6019
6397
|
if (reference.parentPath?.isCallExpression()) {
|
|
6020
6398
|
reference.parentPath.replaceWith(
|
|
6021
6399
|
import_compiler34.types.expressionStatement(
|
|
6022
|
-
createScopeReadExpression(referenceSection,
|
|
6400
|
+
createScopeReadExpression(referenceSection, nodeRef2)
|
|
6023
6401
|
)
|
|
6024
6402
|
);
|
|
6025
6403
|
} else if (getterFnIdentifier) {
|
|
@@ -6033,25 +6411,25 @@ var html_style_default = {
|
|
|
6033
6411
|
}
|
|
6034
6412
|
}
|
|
6035
6413
|
let visitAccessor;
|
|
6036
|
-
if (
|
|
6037
|
-
visitAccessor = getScopeAccessorLiteral(
|
|
6038
|
-
visit(tag,
|
|
6414
|
+
if (nodeRef2) {
|
|
6415
|
+
visitAccessor = getScopeAccessorLiteral(nodeRef2);
|
|
6416
|
+
visit(tag, 32 /* Get */);
|
|
6039
6417
|
}
|
|
6040
|
-
|
|
6418
|
+
write2`<style`;
|
|
6041
6419
|
const usedAttrs = getUsedAttrs3(tag.node);
|
|
6042
6420
|
const { staticAttrs, skipExpression, spreadExpression } = usedAttrs;
|
|
6043
6421
|
for (const attr2 of staticAttrs) {
|
|
6044
|
-
const { name, value } = attr2;
|
|
6422
|
+
const { name: name2, value } = attr2;
|
|
6045
6423
|
const { confident, computed } = value.extra || {};
|
|
6046
6424
|
const valueReferences = value.extra?.referencedBindings;
|
|
6047
|
-
switch (
|
|
6425
|
+
switch (name2) {
|
|
6048
6426
|
case "class":
|
|
6049
6427
|
case "style": {
|
|
6050
|
-
const helper = `${
|
|
6428
|
+
const helper = `${name2}Attr`;
|
|
6051
6429
|
if (confident) {
|
|
6052
|
-
|
|
6430
|
+
write2`${getHTMLRuntime()[helper](computed)}`;
|
|
6053
6431
|
} else if (isHTML) {
|
|
6054
|
-
|
|
6432
|
+
write2`${callRuntime(helper, value)}`;
|
|
6055
6433
|
} else {
|
|
6056
6434
|
addStatement(
|
|
6057
6435
|
"render",
|
|
@@ -6070,14 +6448,14 @@ var html_style_default = {
|
|
|
6070
6448
|
}
|
|
6071
6449
|
default:
|
|
6072
6450
|
if (confident) {
|
|
6073
|
-
|
|
6451
|
+
write2`${getHTMLRuntime().attr(name2, computed)}`;
|
|
6074
6452
|
} else if (isHTML) {
|
|
6075
|
-
if (
|
|
6453
|
+
if (isEventHandler(name2)) {
|
|
6076
6454
|
addHTMLEffectCall(section, valueReferences);
|
|
6077
6455
|
} else {
|
|
6078
|
-
|
|
6456
|
+
write2`${callRuntime("attr", import_compiler34.types.stringLiteral(name2), value)}`;
|
|
6079
6457
|
}
|
|
6080
|
-
} else if (
|
|
6458
|
+
} else if (isEventHandler(name2)) {
|
|
6081
6459
|
addStatement(
|
|
6082
6460
|
"effect",
|
|
6083
6461
|
section,
|
|
@@ -6086,7 +6464,7 @@ var html_style_default = {
|
|
|
6086
6464
|
callRuntime(
|
|
6087
6465
|
"on",
|
|
6088
6466
|
import_compiler34.types.memberExpression(scopeIdentifier, visitAccessor, true),
|
|
6089
|
-
import_compiler34.types.stringLiteral(
|
|
6467
|
+
import_compiler34.types.stringLiteral(getEventHandlerName(name2)),
|
|
6090
6468
|
value
|
|
6091
6469
|
)
|
|
6092
6470
|
)
|
|
@@ -6100,7 +6478,7 @@ var html_style_default = {
|
|
|
6100
6478
|
callRuntime(
|
|
6101
6479
|
"attr",
|
|
6102
6480
|
import_compiler34.types.memberExpression(scopeIdentifier, visitAccessor, true),
|
|
6103
|
-
import_compiler34.types.stringLiteral(
|
|
6481
|
+
import_compiler34.types.stringLiteral(name2),
|
|
6104
6482
|
value
|
|
6105
6483
|
)
|
|
6106
6484
|
)
|
|
@@ -6113,9 +6491,9 @@ var html_style_default = {
|
|
|
6113
6491
|
if (isHTML) {
|
|
6114
6492
|
addHTMLEffectCall(section, tagExtra.referencedBindings);
|
|
6115
6493
|
if (skipExpression) {
|
|
6116
|
-
|
|
6494
|
+
write2`${callRuntime("partialAttrs", spreadExpression, skipExpression, visitAccessor, getScopeIdIdentifier(section), import_compiler34.types.stringLiteral("style"))}`;
|
|
6117
6495
|
} else {
|
|
6118
|
-
|
|
6496
|
+
write2`${callRuntime("attrs", spreadExpression, visitAccessor, getScopeIdIdentifier(section), import_compiler34.types.stringLiteral("style"))}`;
|
|
6119
6497
|
}
|
|
6120
6498
|
} else {
|
|
6121
6499
|
if (skipExpression) {
|
|
@@ -6159,14 +6537,14 @@ var html_style_default = {
|
|
|
6159
6537
|
);
|
|
6160
6538
|
}
|
|
6161
6539
|
}
|
|
6162
|
-
|
|
6540
|
+
write2`>`;
|
|
6163
6541
|
enter2(tag);
|
|
6164
6542
|
if (isOutputHTML()) {
|
|
6165
6543
|
for (const child of tag.node.body.body) {
|
|
6166
6544
|
if (import_compiler34.types.isMarkoText(child)) {
|
|
6167
|
-
|
|
6545
|
+
write2`${child.value}`;
|
|
6168
6546
|
} else if (import_compiler34.types.isMarkoPlaceholder(child)) {
|
|
6169
|
-
|
|
6547
|
+
write2`${callRuntime("escapeStyle", child.value)}`;
|
|
6170
6548
|
}
|
|
6171
6549
|
}
|
|
6172
6550
|
} else {
|
|
@@ -6185,7 +6563,7 @@ var html_style_default = {
|
|
|
6185
6563
|
}
|
|
6186
6564
|
}
|
|
6187
6565
|
if (!referencePlaceholder) {
|
|
6188
|
-
|
|
6566
|
+
write2`${currentQuasi}`;
|
|
6189
6567
|
} else {
|
|
6190
6568
|
templateQuasis.push(import_compiler34.types.templateElement({ raw: currentQuasi }));
|
|
6191
6569
|
addStatement(
|
|
@@ -6202,9 +6580,9 @@ var html_style_default = {
|
|
|
6202
6580
|
);
|
|
6203
6581
|
}
|
|
6204
6582
|
}
|
|
6205
|
-
|
|
6206
|
-
if (
|
|
6207
|
-
markNode(tag,
|
|
6583
|
+
write2`</style>`;
|
|
6584
|
+
if (nodeRef2) {
|
|
6585
|
+
markNode(tag, nodeRef2);
|
|
6208
6586
|
}
|
|
6209
6587
|
exit2(tag);
|
|
6210
6588
|
tag.remove();
|
|
@@ -6247,8 +6625,8 @@ function getUsedAttrs3(tag) {
|
|
|
6247
6625
|
const staticAttrs = [...maybeStaticAttrs].reverse();
|
|
6248
6626
|
if (spreadProps) {
|
|
6249
6627
|
spreadProps.reverse();
|
|
6250
|
-
for (const { name } of staticAttrs) {
|
|
6251
|
-
(skipProps ||= []).push(toObjectProperty(
|
|
6628
|
+
for (const { name: name2 } of staticAttrs) {
|
|
6629
|
+
(skipProps ||= []).push(toObjectProperty(name2, import_compiler34.types.numericLiteral(1)));
|
|
6252
6630
|
}
|
|
6253
6631
|
if (skipProps) {
|
|
6254
6632
|
skipExpression = import_compiler34.types.objectExpression(skipProps);
|
|
@@ -6308,13 +6686,12 @@ var id_default = {
|
|
|
6308
6686
|
descriptionMoreURL: "https://markojs.com/docs/core-tags/#id"
|
|
6309
6687
|
}
|
|
6310
6688
|
],
|
|
6311
|
-
types: "
|
|
6689
|
+
types: runtime_info_default.name + "/tag-types/id.d.marko"
|
|
6312
6690
|
};
|
|
6313
6691
|
|
|
6314
6692
|
// src/translator/core/if.ts
|
|
6315
6693
|
var import_compiler37 = require("@marko/compiler");
|
|
6316
6694
|
var import_babel_utils25 = require("@marko/compiler/babel-utils");
|
|
6317
|
-
var import_types9 = require("@marko/runtime-tags/common/types");
|
|
6318
6695
|
|
|
6319
6696
|
// src/translator/util/to-first-statement-or-block.ts
|
|
6320
6697
|
var import_compiler36 = require("@marko/compiler");
|
|
@@ -6374,7 +6751,7 @@ var IfTag = {
|
|
|
6374
6751
|
const isStateful = isStatefulReferences(rootExtra.referencedBindings);
|
|
6375
6752
|
const singleNodeOptimization = rootExtra.singleNodeOptimization;
|
|
6376
6753
|
if (isRoot(tag)) {
|
|
6377
|
-
visit(tag,
|
|
6754
|
+
visit(tag, 37 /* Replace */);
|
|
6378
6755
|
}
|
|
6379
6756
|
enterShallow(tag);
|
|
6380
6757
|
flushBefore(tag);
|
|
@@ -6395,7 +6772,7 @@ var IfTag = {
|
|
|
6395
6772
|
const bodySection = getSectionForBody(tagBody);
|
|
6396
6773
|
const [isLast, branches] = getBranches(tag, bodySection);
|
|
6397
6774
|
const rootExtra = branches[0][0].node.extra;
|
|
6398
|
-
const
|
|
6775
|
+
const nodeRef2 = rootExtra[kBinding];
|
|
6399
6776
|
const isStateful = isStatefulReferences(rootExtra.referencedBindings);
|
|
6400
6777
|
const singleNodeOptimization = rootExtra.singleNodeOptimization;
|
|
6401
6778
|
const hasStatefulClosures = bodySection && checkStatefulClosures(bodySection, true);
|
|
@@ -6409,7 +6786,7 @@ var IfTag = {
|
|
|
6409
6786
|
writeHTMLResumeStatements(tagBody);
|
|
6410
6787
|
}
|
|
6411
6788
|
if (isLast) {
|
|
6412
|
-
const
|
|
6789
|
+
const write2 = writeTo(tag);
|
|
6413
6790
|
const nextTag = tag.getNextSibling();
|
|
6414
6791
|
const ifScopeIdIdentifier = tag.scope.generateUidIdentifier("ifScopeId");
|
|
6415
6792
|
const ifRendererIdentifier = tag.scope.generateUidIdentifier("ifRenderer");
|
|
@@ -6482,29 +6859,29 @@ var IfTag = {
|
|
|
6482
6859
|
]);
|
|
6483
6860
|
if (isStateful) {
|
|
6484
6861
|
if (singleNodeOptimization) {
|
|
6485
|
-
|
|
6862
|
+
write2`${callRuntime(
|
|
6486
6863
|
"markResumeControlSingleNodeEnd",
|
|
6487
6864
|
getScopeIdIdentifier(section),
|
|
6488
|
-
getScopeAccessorLiteral(
|
|
6865
|
+
getScopeAccessorLiteral(nodeRef2),
|
|
6489
6866
|
ifScopeIdIdentifier
|
|
6490
6867
|
)}`;
|
|
6491
6868
|
} else {
|
|
6492
|
-
|
|
6869
|
+
write2`${callRuntime(
|
|
6493
6870
|
"markResumeControlEnd",
|
|
6494
6871
|
getScopeIdIdentifier(section),
|
|
6495
|
-
getScopeAccessorLiteral(
|
|
6872
|
+
getScopeAccessorLiteral(nodeRef2)
|
|
6496
6873
|
)}`;
|
|
6497
6874
|
}
|
|
6498
6875
|
getSerializedScopeProperties(section).set(
|
|
6499
6876
|
import_compiler37.types.stringLiteral(
|
|
6500
|
-
getScopeAccessorLiteral(
|
|
6877
|
+
getScopeAccessorLiteral(nodeRef2).value + "(" /* ConditionalRenderer */
|
|
6501
6878
|
),
|
|
6502
6879
|
ifRendererIdentifier
|
|
6503
6880
|
);
|
|
6504
6881
|
}
|
|
6505
6882
|
getSerializedScopeProperties(section).set(
|
|
6506
6883
|
import_compiler37.types.stringLiteral(
|
|
6507
|
-
getScopeAccessorLiteral(
|
|
6884
|
+
getScopeAccessorLiteral(nodeRef2).value + "!" /* ConditionalScope */
|
|
6508
6885
|
),
|
|
6509
6886
|
callRuntime("getScopeById", ifScopeIdIdentifier)
|
|
6510
6887
|
);
|
|
@@ -6521,7 +6898,7 @@ var IfTag = {
|
|
|
6521
6898
|
setSectionParentIsOwner(bodySection, true);
|
|
6522
6899
|
}
|
|
6523
6900
|
if (isRoot(tag)) {
|
|
6524
|
-
visit(tag,
|
|
6901
|
+
visit(tag, 37 /* Replace */);
|
|
6525
6902
|
}
|
|
6526
6903
|
enterShallow(tag);
|
|
6527
6904
|
},
|
|
@@ -6534,7 +6911,7 @@ var IfTag = {
|
|
|
6534
6911
|
if (isLast) {
|
|
6535
6912
|
const section = getSection(tag);
|
|
6536
6913
|
const rootExtra = branches[0][0].node.extra;
|
|
6537
|
-
const
|
|
6914
|
+
const nodeRef2 = rootExtra[kBinding];
|
|
6538
6915
|
let expr = import_compiler37.types.nullLiteral();
|
|
6539
6916
|
for (let i = branches.length; i--; ) {
|
|
6540
6917
|
const [branchTag, branchBodySection] = branches[i];
|
|
@@ -6544,18 +6921,18 @@ var IfTag = {
|
|
|
6544
6921
|
return callRuntime(
|
|
6545
6922
|
"inConditionalScope",
|
|
6546
6923
|
subscriber,
|
|
6547
|
-
getScopeAccessorLiteral(
|
|
6924
|
+
getScopeAccessorLiteral(nodeRef2)
|
|
6548
6925
|
/*t.identifier(section.name)*/
|
|
6549
6926
|
);
|
|
6550
6927
|
});
|
|
6551
6928
|
branchTag.remove();
|
|
6552
6929
|
expr = testAttr ? import_compiler37.types.conditionalExpression(testAttr.value, consequent, expr) : consequent;
|
|
6553
6930
|
}
|
|
6554
|
-
const signal = getSignal(section,
|
|
6931
|
+
const signal = getSignal(section, nodeRef2, "if");
|
|
6555
6932
|
signal.build = () => {
|
|
6556
6933
|
return callRuntime(
|
|
6557
6934
|
"conditional",
|
|
6558
|
-
getScopeAccessorLiteral(
|
|
6935
|
+
getScopeAccessorLiteral(nodeRef2),
|
|
6559
6936
|
getSignalFn(signal, [scopeIdentifier])
|
|
6560
6937
|
);
|
|
6561
6938
|
};
|
|
@@ -6712,7 +7089,6 @@ var import_default = {
|
|
|
6712
7089
|
// src/translator/core/let.ts
|
|
6713
7090
|
var import_compiler38 = require("@marko/compiler");
|
|
6714
7091
|
var import_babel_utils27 = require("@marko/compiler/babel-utils");
|
|
6715
|
-
var import_types10 = require("@marko/runtime-tags/common/types");
|
|
6716
7092
|
var let_default = {
|
|
6717
7093
|
analyze(tag) {
|
|
6718
7094
|
const { node } = tag;
|
|
@@ -6790,7 +7166,7 @@ var let_default = {
|
|
|
6790
7166
|
if (valueChangeAttr) {
|
|
6791
7167
|
getSerializedScopeProperties(section).set(
|
|
6792
7168
|
import_compiler38.types.stringLiteral(
|
|
6793
|
-
getScopeAccessorLiteral(binding).value +
|
|
7169
|
+
getScopeAccessorLiteral(binding).value + "@" /* TagVariableChange */
|
|
6794
7170
|
),
|
|
6795
7171
|
valueChangeAttr.value
|
|
6796
7172
|
);
|
|
@@ -6809,7 +7185,7 @@ var let_default = {
|
|
|
6809
7185
|
descriptionMoreURL: "https://markojs.com/docs/core-tags/#let"
|
|
6810
7186
|
}
|
|
6811
7187
|
],
|
|
6812
|
-
types: "
|
|
7188
|
+
types: runtime_info_default.name + "/tag-types/let.d.marko"
|
|
6813
7189
|
};
|
|
6814
7190
|
|
|
6815
7191
|
// src/translator/core/lifecycle.ts
|
|
@@ -6889,7 +7265,7 @@ var lifecycle_default = {
|
|
|
6889
7265
|
descriptionMoreURL: "https://markojs.com/docs/core-tags/#effect"
|
|
6890
7266
|
}
|
|
6891
7267
|
],
|
|
6892
|
-
types: "
|
|
7268
|
+
types: runtime_info_default.name + "/tag-types/lifecycle.d.marko"
|
|
6893
7269
|
};
|
|
6894
7270
|
|
|
6895
7271
|
// src/translator/core/log.ts
|
|
@@ -6941,7 +7317,7 @@ var log_default = {
|
|
|
6941
7317
|
descriptionMoreURL: "https://markojs.com/docs/core-tags/#log"
|
|
6942
7318
|
}
|
|
6943
7319
|
],
|
|
6944
|
-
types: "
|
|
7320
|
+
types: runtime_info_default.name + "/tag-types/log.d.marko"
|
|
6945
7321
|
};
|
|
6946
7322
|
|
|
6947
7323
|
// src/translator/core/script.ts
|
|
@@ -7072,7 +7448,7 @@ var script_default = {
|
|
|
7072
7448
|
descriptionMoreURL: "https://markojs.com/docs/core-tags/#script"
|
|
7073
7449
|
}
|
|
7074
7450
|
],
|
|
7075
|
-
types: "
|
|
7451
|
+
types: runtime_info_default.name + "/tag-types/script.d.marko"
|
|
7076
7452
|
};
|
|
7077
7453
|
function isAwaitExpression(node) {
|
|
7078
7454
|
switch (node.type) {
|
|
@@ -7266,7 +7642,7 @@ var style_default = {
|
|
|
7266
7642
|
|
|
7267
7643
|
// src/translator/core/index.ts
|
|
7268
7644
|
var core_default = {
|
|
7269
|
-
taglibId,
|
|
7645
|
+
taglibId: runtime_info_default.taglibId,
|
|
7270
7646
|
"<attrs>": attrs_default,
|
|
7271
7647
|
"<client>": client_default,
|
|
7272
7648
|
"<const>": const_default,
|
|
@@ -7351,7 +7727,7 @@ var function_default = {
|
|
|
7351
7727
|
}
|
|
7352
7728
|
const { node } = fn;
|
|
7353
7729
|
const extra = node.extra ??= {};
|
|
7354
|
-
const
|
|
7730
|
+
const name2 = extra.name = fn.node.id?.name || (isMarkoAttribute(markoRoot) ? markoRoot.node.default ? import_compiler45.types.toIdentifier(
|
|
7355
7731
|
markoRoot.parentPath.has("var") ? markoRoot.parentPath.get("var") : markoRoot.parentPath.get("name")
|
|
7356
7732
|
) : markoRoot.node.name : import_compiler45.types.isVariableDeclarator(fn.parent) && import_compiler45.types.isIdentifier(fn.parent.id) ? fn.parent.id.name : "anonymous");
|
|
7357
7733
|
if (isMarkoAttribute(markoRoot) && ((0, import_babel_utils34.isNativeTag)(markoRoot.parentPath) && /^on[A-Z-]/.test(markoRoot.node.name) || isCoreTagName(markoRoot.parentPath, "script") || isCoreTagName(markoRoot.parentPath, "lifecycle") || isCoreTagName(markoRoot.parentPath, "for"))) {
|
|
@@ -7367,10 +7743,10 @@ var function_default = {
|
|
|
7367
7743
|
functionNameCounts = /* @__PURE__ */ new Map();
|
|
7368
7744
|
functionIdsBySection.set(section, functionNameCounts);
|
|
7369
7745
|
}
|
|
7370
|
-
const index = functionNameCounts.get(
|
|
7746
|
+
const index = functionNameCounts.get(name2);
|
|
7371
7747
|
let id = "";
|
|
7372
7748
|
if (index === void 0) {
|
|
7373
|
-
functionNameCounts.set(
|
|
7749
|
+
functionNameCounts.set(name2, 0);
|
|
7374
7750
|
} else {
|
|
7375
7751
|
id = `_${index}`;
|
|
7376
7752
|
}
|
|
@@ -7378,7 +7754,7 @@ var function_default = {
|
|
|
7378
7754
|
extra.registerId = (0, import_babel_utils34.getTemplateId)(
|
|
7379
7755
|
markoOpts,
|
|
7380
7756
|
filename,
|
|
7381
|
-
`${section.id}/${
|
|
7757
|
+
`${section.id}/${name2 + id}`
|
|
7382
7758
|
);
|
|
7383
7759
|
}
|
|
7384
7760
|
};
|
|
@@ -7428,14 +7804,13 @@ var import_declaration_default = {
|
|
|
7428
7804
|
|
|
7429
7805
|
// src/translator/visitors/placeholder.ts
|
|
7430
7806
|
var import_compiler46 = require("@marko/compiler");
|
|
7431
|
-
var import_types11 = require("@marko/runtime-tags/common/types");
|
|
7432
7807
|
var kBinding2 = Symbol("placeholder node binding");
|
|
7433
7808
|
var kSiblingText = Symbol("placeholder has sibling text");
|
|
7434
7809
|
var placeholder_default = {
|
|
7435
7810
|
analyze(placeholder) {
|
|
7436
7811
|
const { node } = placeholder;
|
|
7437
7812
|
const { confident, computed } = evaluate(node.value);
|
|
7438
|
-
if (!(confident && (node.escape ||
|
|
7813
|
+
if (!(confident && (node.escape || isVoid2(computed)))) {
|
|
7439
7814
|
(node.extra ??= {})[kBinding2] = createBinding(
|
|
7440
7815
|
"#text",
|
|
7441
7816
|
0 /* dom */,
|
|
@@ -7451,12 +7826,12 @@ var placeholder_default = {
|
|
|
7451
7826
|
const { node } = placeholder;
|
|
7452
7827
|
const { value } = node;
|
|
7453
7828
|
const { confident, computed, referencedBindings } = evaluate(value);
|
|
7454
|
-
if (confident &&
|
|
7829
|
+
if (confident && isVoid2(computed)) {
|
|
7455
7830
|
placeholder.remove();
|
|
7456
7831
|
return;
|
|
7457
7832
|
}
|
|
7458
7833
|
const isHTML = isOutputHTML();
|
|
7459
|
-
const
|
|
7834
|
+
const write2 = writeTo(placeholder);
|
|
7460
7835
|
const extra = node.extra || {};
|
|
7461
7836
|
const nodeBinding = extra[kBinding2];
|
|
7462
7837
|
const canWriteHTML = isHTML || confident && node.escape;
|
|
@@ -7464,21 +7839,21 @@ var placeholder_default = {
|
|
|
7464
7839
|
const isStateful = isStatefulReferences(referencedBindings);
|
|
7465
7840
|
const siblingText = extra[kSiblingText];
|
|
7466
7841
|
if (confident && canWriteHTML) {
|
|
7467
|
-
|
|
7842
|
+
write2`${getHTMLRuntime()[method](computed)}`;
|
|
7468
7843
|
} else {
|
|
7469
7844
|
if (siblingText === 1 /* Before */) {
|
|
7470
7845
|
if (isHTML && isStateful) {
|
|
7471
|
-
|
|
7846
|
+
write2`<!>`;
|
|
7472
7847
|
}
|
|
7473
|
-
visit(placeholder,
|
|
7848
|
+
visit(placeholder, 37 /* Replace */);
|
|
7474
7849
|
} else if (siblingText === 2 /* After */) {
|
|
7475
|
-
visit(placeholder,
|
|
7850
|
+
visit(placeholder, 37 /* Replace */);
|
|
7476
7851
|
} else {
|
|
7477
|
-
if (!isHTML)
|
|
7478
|
-
visit(placeholder,
|
|
7852
|
+
if (!isHTML) write2` `;
|
|
7853
|
+
visit(placeholder, 32 /* Get */);
|
|
7479
7854
|
}
|
|
7480
7855
|
if (isHTML) {
|
|
7481
|
-
|
|
7856
|
+
write2`${callRuntime(method, value)}`;
|
|
7482
7857
|
if (isStateful) {
|
|
7483
7858
|
markNode(placeholder, nodeBinding);
|
|
7484
7859
|
}
|
|
@@ -7549,7 +7924,7 @@ function analyzeSiblingText(placeholder) {
|
|
|
7549
7924
|
}
|
|
7550
7925
|
return placeholderExtra[kSiblingText] = 0 /* None */;
|
|
7551
7926
|
}
|
|
7552
|
-
function
|
|
7927
|
+
function isVoid2(value) {
|
|
7553
7928
|
return value == null || value === false;
|
|
7554
7929
|
}
|
|
7555
7930
|
|
|
@@ -7558,9 +7933,9 @@ var import_compiler47 = require("@marko/compiler");
|
|
|
7558
7933
|
var abortIdsByExpressionForSection = /* @__PURE__ */ new WeakMap();
|
|
7559
7934
|
var referenced_identifier_default = {
|
|
7560
7935
|
migrate(identifier) {
|
|
7561
|
-
const { name } = identifier.node;
|
|
7562
|
-
if (identifier.scope.hasBinding(
|
|
7563
|
-
switch (
|
|
7936
|
+
const { name: name2 } = identifier.node;
|
|
7937
|
+
if (identifier.scope.hasBinding(name2)) return;
|
|
7938
|
+
switch (name2) {
|
|
7564
7939
|
case "out":
|
|
7565
7940
|
if (import_compiler47.types.isMemberExpression(identifier.parent) && import_compiler47.types.isIdentifier(identifier.parent.property) && identifier.parent.property.name === "global") {
|
|
7566
7941
|
identifier.parentPath.replaceWith(import_compiler47.types.identifier("$global"));
|
|
@@ -7573,16 +7948,16 @@ var referenced_identifier_default = {
|
|
|
7573
7948
|
}
|
|
7574
7949
|
},
|
|
7575
7950
|
analyze(identifier) {
|
|
7576
|
-
const { name } = identifier.node;
|
|
7577
|
-
if (identifier.scope.hasBinding(
|
|
7578
|
-
if (
|
|
7951
|
+
const { name: name2 } = identifier.node;
|
|
7952
|
+
if (identifier.scope.hasBinding(name2)) return;
|
|
7953
|
+
if (name2 === "$global" || name2 === "$signal") {
|
|
7579
7954
|
setReferencesScope(identifier);
|
|
7580
7955
|
}
|
|
7581
7956
|
},
|
|
7582
7957
|
translate(identifier) {
|
|
7583
|
-
const { name } = identifier.node;
|
|
7584
|
-
if (identifier.scope.hasBinding(
|
|
7585
|
-
switch (
|
|
7958
|
+
const { name: name2 } = identifier.node;
|
|
7959
|
+
if (identifier.scope.hasBinding(name2)) return;
|
|
7960
|
+
switch (name2) {
|
|
7586
7961
|
case "$global":
|
|
7587
7962
|
if (isOutputHTML()) {
|
|
7588
7963
|
identifier.replaceWith(
|
|
@@ -7600,8 +7975,8 @@ var referenced_identifier_default = {
|
|
|
7600
7975
|
if (!section.hasCleanup) {
|
|
7601
7976
|
section.hasCleanup = true;
|
|
7602
7977
|
const exprRoot = getExprRoot(identifier);
|
|
7603
|
-
const
|
|
7604
|
-
|
|
7978
|
+
const write2 = writeTo(exprRoot);
|
|
7979
|
+
write2`${callRuntime("markResumeCleanup", getScopeIdIdentifier(section))}`;
|
|
7605
7980
|
}
|
|
7606
7981
|
identifier.replaceWith(
|
|
7607
7982
|
import_compiler47.types.callExpression(
|
|
@@ -7882,7 +8257,7 @@ function translateDOM(tag) {
|
|
|
7882
8257
|
const { node } = tag;
|
|
7883
8258
|
const extra = node.extra;
|
|
7884
8259
|
const childScopeBinding = extra[kChildScopeBinding];
|
|
7885
|
-
const
|
|
8260
|
+
const write2 = writeTo(tag);
|
|
7886
8261
|
const { file } = tag.hub;
|
|
7887
8262
|
const tagName = import_compiler49.types.isIdentifier(node.name) ? node.name.name : import_compiler49.types.isStringLiteral(node.name) ? node.name.value : "tag";
|
|
7888
8263
|
const relativePath = getTagRelativePath(tag);
|
|
@@ -7903,7 +8278,7 @@ function translateDOM(tag) {
|
|
|
7903
8278
|
childScopeBinding
|
|
7904
8279
|
});
|
|
7905
8280
|
}
|
|
7906
|
-
|
|
8281
|
+
write2`${(0, import_babel_utils37.importNamed)(file, relativePath, childExports.template, `${tagName}_template`)}`;
|
|
7907
8282
|
injectWalks(
|
|
7908
8283
|
tag,
|
|
7909
8284
|
(0, import_babel_utils37.importNamed)(file, relativePath, childExports.walks, `${tagName}_walks`)
|
|
@@ -7997,8 +8372,8 @@ function analyzeAttrs(section, tag, templateExport) {
|
|
|
7997
8372
|
for (const attrTagName in attrTagLookup) {
|
|
7998
8373
|
seen.add(attrTagLookup[attrTagName].name);
|
|
7999
8374
|
}
|
|
8000
|
-
const
|
|
8001
|
-
for (const child of
|
|
8375
|
+
const attrTags2 = tag.node.body.attributeTags ? tag.get("body").get("body") : tag.get("attributeTags");
|
|
8376
|
+
for (const child of attrTags2) {
|
|
8002
8377
|
if (child.isMarkoTag()) {
|
|
8003
8378
|
if ((0, import_babel_utils37.isAttributeTag)(child)) {
|
|
8004
8379
|
const attrTagMeta = attrTagLookup[getTagName(child)];
|
|
@@ -8015,8 +8390,8 @@ function analyzeAttrs(section, tag, templateExport) {
|
|
|
8015
8390
|
} else {
|
|
8016
8391
|
const group = child.node.extra.attributeTagGroup;
|
|
8017
8392
|
let childUsesGroupProp = false;
|
|
8018
|
-
for (const
|
|
8019
|
-
if (templateExport.props[attrTagLookup[
|
|
8393
|
+
for (const name2 of group) {
|
|
8394
|
+
if (templateExport.props[attrTagLookup[name2].name]) {
|
|
8020
8395
|
childUsesGroupProp = true;
|
|
8021
8396
|
break;
|
|
8022
8397
|
}
|
|
@@ -8117,10 +8492,10 @@ function writeAttrsToExports(tag, templateExport, importAlias, info) {
|
|
|
8117
8492
|
const seen = /* @__PURE__ */ new Set();
|
|
8118
8493
|
const attrTagLookup = analyzeAttributeTags(tag);
|
|
8119
8494
|
if (attrTagLookup) {
|
|
8120
|
-
const
|
|
8495
|
+
const attrTags2 = tag.get("attributeTags");
|
|
8121
8496
|
const statementsByGroup = /* @__PURE__ */ new Map();
|
|
8122
8497
|
const translateDynamicAttrTagChildInGroup = (group, index) => {
|
|
8123
|
-
const child =
|
|
8498
|
+
const child = attrTags2[index];
|
|
8124
8499
|
let statements = statementsByGroup.get(group)?.statements;
|
|
8125
8500
|
if (!statements) {
|
|
8126
8501
|
statements = [];
|
|
@@ -8130,7 +8505,7 @@ function writeAttrsToExports(tag, templateExport, importAlias, info) {
|
|
|
8130
8505
|
});
|
|
8131
8506
|
}
|
|
8132
8507
|
return addDynamicAttrTagStatements(
|
|
8133
|
-
|
|
8508
|
+
attrTags2,
|
|
8134
8509
|
index,
|
|
8135
8510
|
attrTagLookup,
|
|
8136
8511
|
statements,
|
|
@@ -8140,8 +8515,8 @@ function writeAttrsToExports(tag, templateExport, importAlias, info) {
|
|
|
8140
8515
|
for (const attrTagName in attrTagLookup) {
|
|
8141
8516
|
seen.add(attrTagLookup[attrTagName].name);
|
|
8142
8517
|
}
|
|
8143
|
-
for (let i = 0; i <
|
|
8144
|
-
const child =
|
|
8518
|
+
for (let i = 0; i < attrTags2.length; i++) {
|
|
8519
|
+
const child = attrTags2[i];
|
|
8145
8520
|
if (child.isMarkoTag()) {
|
|
8146
8521
|
if ((0, import_babel_utils37.isAttributeTag)(child)) {
|
|
8147
8522
|
const attrTagMeta = attrTagLookup[getTagName(child)];
|
|
@@ -8171,8 +8546,8 @@ function writeAttrsToExports(tag, templateExport, importAlias, info) {
|
|
|
8171
8546
|
{ referencedBindings, statements }
|
|
8172
8547
|
] of statementsByGroup) {
|
|
8173
8548
|
const decls = [];
|
|
8174
|
-
for (const
|
|
8175
|
-
const attrTagMeta = attrTagLookup[
|
|
8549
|
+
for (const name2 of group) {
|
|
8550
|
+
const attrTagMeta = attrTagLookup[name2];
|
|
8176
8551
|
const childAttrExports = templateExport.props[attrTagMeta.name];
|
|
8177
8552
|
if (!childAttrExports) continue;
|
|
8178
8553
|
const attrExportIdentifier = importOrSelfReferenceName(
|
|
@@ -8268,33 +8643,33 @@ function writeAttrsToExports(tag, templateExport, importAlias, info) {
|
|
|
8268
8643
|
);
|
|
8269
8644
|
}
|
|
8270
8645
|
const missing = new Set(Object.keys(templateExport.props));
|
|
8271
|
-
for (const
|
|
8646
|
+
for (const name2 of seen) missing.delete(name2);
|
|
8272
8647
|
if (missing.size) {
|
|
8273
8648
|
const referencedBindings = tag.node.extra?.referencedBindings;
|
|
8274
8649
|
let getMissingPropValue = buildUndefined2;
|
|
8275
8650
|
if (spreadProps) {
|
|
8276
8651
|
const spreadId = tag.scope.generateUidIdentifier(`${importAlias}_spread`);
|
|
8277
8652
|
spreadProps.reverse();
|
|
8278
|
-
getMissingPropValue = (
|
|
8653
|
+
getMissingPropValue = (name2) => toMemberExpression(spreadId, name2);
|
|
8279
8654
|
addStatement("render", info.tagSection, referencedBindings, [
|
|
8280
8655
|
import_compiler49.types.variableDeclaration("const", [
|
|
8281
8656
|
import_compiler49.types.variableDeclarator(spreadId, propsToExpression(spreadProps))
|
|
8282
8657
|
])
|
|
8283
8658
|
]);
|
|
8284
8659
|
}
|
|
8285
|
-
for (const
|
|
8286
|
-
const childAttrExports = templateExport.props[
|
|
8660
|
+
for (const name2 of missing) {
|
|
8661
|
+
const childAttrExports = templateExport.props[name2];
|
|
8287
8662
|
const attrExportIdentifier = importOrSelfReferenceName(
|
|
8288
8663
|
tag.hub.file,
|
|
8289
8664
|
info.relativePath,
|
|
8290
8665
|
childAttrExports.id,
|
|
8291
|
-
`${importAlias}_${
|
|
8666
|
+
`${importAlias}_${name2}`
|
|
8292
8667
|
);
|
|
8293
8668
|
addValue(
|
|
8294
8669
|
info.tagSection,
|
|
8295
8670
|
referencedBindings,
|
|
8296
8671
|
identifierToSignal(attrExportIdentifier),
|
|
8297
|
-
getMissingPropValue(
|
|
8672
|
+
getMissingPropValue(name2),
|
|
8298
8673
|
createScopeReadExpression(info.tagSection, info.childScopeBinding),
|
|
8299
8674
|
callRuntime(
|
|
8300
8675
|
"inChild",
|
|
@@ -8305,11 +8680,11 @@ function writeAttrsToExports(tag, templateExport, importAlias, info) {
|
|
|
8305
8680
|
}
|
|
8306
8681
|
}
|
|
8307
8682
|
}
|
|
8308
|
-
function importOrSelfReferenceName(file, request,
|
|
8683
|
+
function importOrSelfReferenceName(file, request, name2, nameHint) {
|
|
8309
8684
|
if (isCircularRequest(file, request)) {
|
|
8310
|
-
return import_compiler49.types.identifier(
|
|
8685
|
+
return import_compiler49.types.identifier(name2);
|
|
8311
8686
|
}
|
|
8312
|
-
return (0, import_babel_utils37.importNamed)(file, request,
|
|
8687
|
+
return (0, import_babel_utils37.importNamed)(file, request, name2, nameHint);
|
|
8313
8688
|
}
|
|
8314
8689
|
function isCircularRequest(file, request) {
|
|
8315
8690
|
const { filename } = file.opts;
|
|
@@ -8337,7 +8712,6 @@ function always() {
|
|
|
8337
8712
|
// src/translator/visitors/tag/dynamic-tag.ts
|
|
8338
8713
|
var import_compiler50 = require("@marko/compiler");
|
|
8339
8714
|
var import_babel_utils38 = require("@marko/compiler/babel-utils");
|
|
8340
|
-
var import_types12 = require("@marko/runtime-tags/common/types");
|
|
8341
8715
|
var kDOMBinding = Symbol("dynamic tag dom binding");
|
|
8342
8716
|
var dynamic_tag_default = {
|
|
8343
8717
|
analyze: {
|
|
@@ -8363,7 +8737,7 @@ var dynamic_tag_default = {
|
|
|
8363
8737
|
},
|
|
8364
8738
|
translate: {
|
|
8365
8739
|
enter(tag) {
|
|
8366
|
-
visit(tag,
|
|
8740
|
+
visit(tag, 37 /* Replace */);
|
|
8367
8741
|
enterShallow(tag);
|
|
8368
8742
|
if (isOutputHTML()) {
|
|
8369
8743
|
flushBefore(tag);
|
|
@@ -8372,7 +8746,7 @@ var dynamic_tag_default = {
|
|
|
8372
8746
|
exit(tag) {
|
|
8373
8747
|
const { node } = tag;
|
|
8374
8748
|
const extra = node.extra;
|
|
8375
|
-
const
|
|
8749
|
+
const nodeRef2 = extra[kDOMBinding];
|
|
8376
8750
|
const section = getSection(tag);
|
|
8377
8751
|
let tagExpression = node.name;
|
|
8378
8752
|
if (import_compiler50.types.isStringLiteral(tagExpression)) {
|
|
@@ -8434,7 +8808,7 @@ var dynamic_tag_default = {
|
|
|
8434
8808
|
if (isOutputHTML()) {
|
|
8435
8809
|
flushInto(tag);
|
|
8436
8810
|
writeHTMLResumeStatements(tag.get("body"));
|
|
8437
|
-
const
|
|
8811
|
+
const write2 = writeTo(tag);
|
|
8438
8812
|
if (node.var) {
|
|
8439
8813
|
if (!hasMultipleArgs && args.length === 1) {
|
|
8440
8814
|
args.push(import_compiler50.types.unaryExpression("void", import_compiler50.types.numericLiteral(0)));
|
|
@@ -8480,20 +8854,20 @@ var dynamic_tag_default = {
|
|
|
8480
8854
|
import_compiler50.types.variableDeclarator(node.var, dynamicTagExpr)
|
|
8481
8855
|
]) : import_compiler50.types.expressionStatement(dynamicTagExpr)
|
|
8482
8856
|
);
|
|
8483
|
-
|
|
8857
|
+
write2`${callRuntime(
|
|
8484
8858
|
"markResumeControlEnd",
|
|
8485
8859
|
getScopeIdIdentifier(section),
|
|
8486
|
-
getScopeAccessorLiteral(
|
|
8860
|
+
getScopeAccessorLiteral(nodeRef2)
|
|
8487
8861
|
)}`;
|
|
8488
8862
|
getSerializedScopeProperties(section).set(
|
|
8489
8863
|
import_compiler50.types.stringLiteral(
|
|
8490
|
-
getScopeAccessorLiteral(
|
|
8864
|
+
getScopeAccessorLiteral(nodeRef2).value + "!" /* ConditionalScope */
|
|
8491
8865
|
),
|
|
8492
8866
|
callRuntime("writeExistingScope", dynamicScopeIdentifier)
|
|
8493
8867
|
);
|
|
8494
8868
|
getSerializedScopeProperties(section).set(
|
|
8495
8869
|
import_compiler50.types.stringLiteral(
|
|
8496
|
-
getScopeAccessorLiteral(
|
|
8870
|
+
getScopeAccessorLiteral(nodeRef2).value + "(" /* ConditionalRenderer */
|
|
8497
8871
|
),
|
|
8498
8872
|
callRuntime(
|
|
8499
8873
|
"normalizeDynamicRenderer",
|
|
@@ -8506,11 +8880,11 @@ var dynamic_tag_default = {
|
|
|
8506
8880
|
} else {
|
|
8507
8881
|
const section2 = getSection(tag);
|
|
8508
8882
|
const bodySection = getSectionForBody(tag.get("body"));
|
|
8509
|
-
const signal = getSignal(section2,
|
|
8883
|
+
const signal = getSignal(section2, nodeRef2, "dynamicTagName");
|
|
8510
8884
|
signal.build = () => {
|
|
8511
8885
|
return callRuntime(
|
|
8512
8886
|
"conditional",
|
|
8513
|
-
getScopeAccessorLiteral(
|
|
8887
|
+
getScopeAccessorLiteral(nodeRef2),
|
|
8514
8888
|
getSignalFn(signal, [scopeIdentifier]),
|
|
8515
8889
|
buildSignalIntersections(signal)
|
|
8516
8890
|
);
|
|
@@ -8530,7 +8904,7 @@ var dynamic_tag_default = {
|
|
|
8530
8904
|
);
|
|
8531
8905
|
if (tag.node.var) {
|
|
8532
8906
|
const childScopeLiteral = import_compiler50.types.stringLiteral(
|
|
8533
|
-
getScopeAccessorLiteral(extra[kDOMBinding]).value +
|
|
8907
|
+
getScopeAccessorLiteral(extra[kDOMBinding]).value + "!" /* ConditionalScope */
|
|
8534
8908
|
);
|
|
8535
8909
|
const source = initValue(
|
|
8536
8910
|
// TODO: support destructuring
|
|
@@ -8550,7 +8924,7 @@ var dynamic_tag_default = {
|
|
|
8550
8924
|
addStatement(
|
|
8551
8925
|
"render",
|
|
8552
8926
|
section2,
|
|
8553
|
-
|
|
8927
|
+
nodeRef2,
|
|
8554
8928
|
import_compiler50.types.expressionStatement(
|
|
8555
8929
|
callRuntime(
|
|
8556
8930
|
"setTagVar",
|
|
@@ -8586,7 +8960,7 @@ var dynamic_tag_default = {
|
|
|
8586
8960
|
id,
|
|
8587
8961
|
callRuntime(
|
|
8588
8962
|
"dynamicTagAttrs",
|
|
8589
|
-
getScopeAccessorLiteral(
|
|
8963
|
+
getScopeAccessorLiteral(nodeRef2),
|
|
8590
8964
|
bodySection && import_compiler50.types.identifier(bodySection.name),
|
|
8591
8965
|
hasMultipleArgs && import_compiler50.types.numericLiteral(1)
|
|
8592
8966
|
)
|
|
@@ -8615,9 +8989,9 @@ function getCompatRuntimeFile(markoOpts) {
|
|
|
8615
8989
|
var tag_default = {
|
|
8616
8990
|
transform: {
|
|
8617
8991
|
enter(tag) {
|
|
8618
|
-
const
|
|
8619
|
-
for (let i = 0; i <
|
|
8620
|
-
const attr2 =
|
|
8992
|
+
const attrs2 = tag.get("attributes");
|
|
8993
|
+
for (let i = 0; i < attrs2.length; i++) {
|
|
8994
|
+
const attr2 = attrs2[i];
|
|
8621
8995
|
if (import_compiler51.types.isMarkoAttribute(attr2.node) && attr2.node.bound) {
|
|
8622
8996
|
attr2.node.bound = false;
|
|
8623
8997
|
const changeValue = getChangeHandler(tag, attr2);
|
|
@@ -8817,7 +9191,7 @@ var taglibs = [
|
|
|
8817
9191
|
];
|
|
8818
9192
|
function getRuntimeEntryFiles(output, optimize) {
|
|
8819
9193
|
return [
|
|
8820
|
-
|
|
9194
|
+
`${runtime_info_default.name}${optimize ? "" : "/debug"}/${output === "html" ? "html" : "dom"}`
|
|
8821
9195
|
];
|
|
8822
9196
|
}
|
|
8823
9197
|
// Annotate the CommonJS export names for ESM import in node:
|