marko 6.4.12 → 6.4.14
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/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/compat.feat.js +2 -2
- package/dist/debug/dom/compat.feat.mjs +2 -2
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/lazy.feat.js +1 -1
- package/dist/debug/dom/lazy.feat.mjs +1 -1
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-DaHYZpf2.mjs → dom-BORByF2b.mjs} +4 -2
- package/dist/debug/{dom-CtXOr4Nm.js → dom-sfzdCRAg.js} +3 -7
- package/dist/debug/dom.js +1 -1
- package/dist/debug/dom.mjs +1 -1
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/compat.feat.js +15 -15
- package/dist/dom/compat.feat.mjs +2 -2
- package/dist/dom/controllable-input.feat.js +1 -1
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +1 -1
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +1 -1
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +1 -1
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +1 -1
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.js +2 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +3 -3
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/{dom-BO-0hzLZ.mjs → dom-DKn1bCPC.mjs} +3 -2
- package/dist/{dom-BB-Te-3z.js → dom-DRiewpRL.js} +63 -67
- package/dist/dom.js +17 -17
- package/dist/dom.mjs +1 -1
- package/dist/translator/core/if.d.ts +0 -85
- package/dist/translator/core/index.d.ts +2 -85
- package/dist/translator/index.d.ts +2 -85
- package/dist/translator/index.js +35 -191
- package/dist/translator/interop/index.d.ts +2 -0
- package/package.json +4 -4
- package/tags/await.d.marko +9 -1
- package/tags/const.d.marko +7 -1
- package/tags/debug.d.marko +7 -1
- package/tags/define.d.marko +7 -1
- package/tags/effect.d.marko +6 -1
- package/tags/html-comment.d.marko +6 -0
- package/tags/html-script.d.marko +5 -0
- package/tags/html-style.d.marko +5 -0
- package/tags/id.d.marko +11 -1
- package/tags/let.d.marko +8 -1
- package/tags/lifecycle.d.marko +11 -1
- package/tags/log.d.marko +7 -1
- package/tags/script.d.marko +9 -1
- package/tags/show.d.marko +7 -1
- package/tags/try.d.marko +9 -1
- package/tags-html.d.ts +219 -134
package/dist/translator/index.js
CHANGED
|
@@ -3343,7 +3343,7 @@ function getSimilarTagHint(tagName) {
|
|
|
3343
3343
|
const lowerTagName = tagName.toLowerCase();
|
|
3344
3344
|
let closestTag;
|
|
3345
3345
|
let closestDistance = 4;
|
|
3346
|
-
for (const name
|
|
3346
|
+
for (const { name } of lookup.getTagsSorted()) {
|
|
3347
3347
|
const lengthDelta = Math.abs(name.length - tagName.length);
|
|
3348
3348
|
if (lengthDelta < closestDistance) {
|
|
3349
3349
|
if (!lengthDelta && name.toLowerCase() === lowerTagName) return ` Tag names are case-sensitive: did you mean \`<${name}>\`?`;
|
|
@@ -7615,27 +7615,7 @@ const IfTag = {
|
|
|
7615
7615
|
}
|
|
7616
7616
|
} }
|
|
7617
7617
|
}),
|
|
7618
|
-
parseOptions: { controlFlow: true }
|
|
7619
|
-
autocomplete: [{
|
|
7620
|
-
snippet: "if=${1:condition}",
|
|
7621
|
-
description: "Use to display content only if the condition is met.",
|
|
7622
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#if--else"
|
|
7623
|
-
}]
|
|
7624
|
-
};
|
|
7625
|
-
const ElseIfTag = {
|
|
7626
|
-
...IfTag,
|
|
7627
|
-
autocomplete: [{
|
|
7628
|
-
snippet: "else-if=${1:condition}",
|
|
7629
|
-
description: "Use after an <if> or <else-if> tag to display content if those conditions do not match and this one does.",
|
|
7630
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#if--else"
|
|
7631
|
-
}]
|
|
7632
|
-
};
|
|
7633
|
-
const ElseTag = {
|
|
7634
|
-
...IfTag,
|
|
7635
|
-
autocomplete: [{
|
|
7636
|
-
description: "Use after an <if> or <else-if> tag to display content if those conditions do not match.",
|
|
7637
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#if--else"
|
|
7638
|
-
}]
|
|
7618
|
+
parseOptions: { controlFlow: true }
|
|
7639
7619
|
};
|
|
7640
7620
|
function flattenTextOnlyConditional(rootTag) {
|
|
7641
7621
|
if (!isCoreTagName(rootTag, "if")) return;
|
|
@@ -7993,29 +7973,21 @@ function toConstTag(id, expr) {
|
|
|
7993
7973
|
return _marko_compiler.types.markoTag(_marko_compiler.types.stringLiteral("const"), [_marko_compiler.types.markoAttribute("value", expr, null, null, true)], _marko_compiler.types.markoTagBody(), null, id);
|
|
7994
7974
|
}
|
|
7995
7975
|
// src/translator/core/attrs.ts
|
|
7996
|
-
var attrs_default = {
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
},
|
|
8012
|
-
attributes: {},
|
|
8013
|
-
autocomplete: [{
|
|
8014
|
-
displayText: "attrs/{ ... }",
|
|
8015
|
-
description: "Use to receive the attributes passed into this template.",
|
|
8016
|
-
snippet: "attrs/{ $1 }$2"
|
|
8017
|
-
}]
|
|
8018
|
-
};
|
|
7976
|
+
var attrs_default = { migrate: (tag) => {
|
|
7977
|
+
(0, _marko_compiler_babel_utils.assertNoArgs)(tag);
|
|
7978
|
+
(0, _marko_compiler_babel_utils.assertNoParams)(tag);
|
|
7979
|
+
(0, _marko_compiler_babel_utils.assertNoAttributes)(tag);
|
|
7980
|
+
assertNoBodyContent(tag);
|
|
7981
|
+
(0, _marko_compiler_babel_utils.assertNoAttributeTags)(tag);
|
|
7982
|
+
(0, _marko_compiler_babel_utils.diagnosticDeprecate)(tag, {
|
|
7983
|
+
label: "The `attrs` tag is deprecated, prefer destructuring `input` via the `const` tag.",
|
|
7984
|
+
fix() {
|
|
7985
|
+
const tagVar = tag.node.var;
|
|
7986
|
+
if (tagVar && !(tagVar.type === "Identifier" && tagVar.name === "input")) tag.replaceWith(toConstTag(tagVar, _marko_compiler.types.identifier("input")));
|
|
7987
|
+
else tag.remove();
|
|
7988
|
+
}
|
|
7989
|
+
});
|
|
7990
|
+
} };
|
|
8019
7991
|
// src/translator/core/await.ts
|
|
8020
7992
|
var await_default = {
|
|
8021
7993
|
analyze(tag) {
|
|
@@ -8083,11 +8055,6 @@ var await_default = {
|
|
|
8083
8055
|
replaceWithStatements(tag);
|
|
8084
8056
|
} }
|
|
8085
8057
|
}),
|
|
8086
|
-
attributes: {},
|
|
8087
|
-
autocomplete: [{
|
|
8088
|
-
description: "Use to consume asynchronous data.",
|
|
8089
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#await"
|
|
8090
|
-
}],
|
|
8091
8058
|
types: runtime_info_default.name + "/tags/await.d.marko"
|
|
8092
8059
|
};
|
|
8093
8060
|
// src/translator/core/class.ts
|
|
@@ -8126,12 +8093,7 @@ function createStatementTag(keyword) {
|
|
|
8126
8093
|
parseOptions: {
|
|
8127
8094
|
statement: true,
|
|
8128
8095
|
rawOpenTag: true
|
|
8129
|
-
}
|
|
8130
|
-
autocomplete: [{
|
|
8131
|
-
displayText: `${keyword} <statement>`,
|
|
8132
|
-
description: `A JavaScript statement which is only evaluated once your template is loaded${target ? ` on the ${target}` : ""}.`,
|
|
8133
|
-
descriptionMoreURL: `https://markojs.com/docs/reference/language#${keyword === "static" ? "static" : "server-and-client"}`
|
|
8134
|
-
}]
|
|
8096
|
+
}
|
|
8135
8097
|
};
|
|
8136
8098
|
}
|
|
8137
8099
|
// src/translator/core/client.ts
|
|
@@ -8176,11 +8138,6 @@ var const_default = {
|
|
|
8176
8138
|
replaceWithStatements(tag);
|
|
8177
8139
|
} },
|
|
8178
8140
|
parseOptions: { openTagOnly: true },
|
|
8179
|
-
attributes: {},
|
|
8180
|
-
autocomplete: [{
|
|
8181
|
-
description: "Use to create a constant binding.",
|
|
8182
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#const"
|
|
8183
|
-
}],
|
|
8184
8141
|
types: runtime_info_default.name + "/tags/const.d.marko"
|
|
8185
8142
|
};
|
|
8186
8143
|
function getVarHint(tag) {
|
|
@@ -8204,11 +8161,6 @@ var debug_default = {
|
|
|
8204
8161
|
addTagStatement(tag, withPreviousLocation(_marko_compiler.types.debuggerStatement(), tag.node));
|
|
8205
8162
|
} },
|
|
8206
8163
|
parseOptions: { openTagOnly: true },
|
|
8207
|
-
attributes: {},
|
|
8208
|
-
autocomplete: [{
|
|
8209
|
-
description: "Debug on value change.",
|
|
8210
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#debug"
|
|
8211
|
-
}],
|
|
8212
8164
|
types: runtime_info_default.name + "/tags/debug.d.marko"
|
|
8213
8165
|
};
|
|
8214
8166
|
// src/translator/core/define.ts
|
|
@@ -8302,11 +8254,6 @@ var define_default = {
|
|
|
8302
8254
|
}
|
|
8303
8255
|
}
|
|
8304
8256
|
},
|
|
8305
|
-
attributes: {},
|
|
8306
|
-
autocomplete: [{
|
|
8307
|
-
description: "Use to create a constant object binding that can be rendered.",
|
|
8308
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#define"
|
|
8309
|
-
}],
|
|
8310
8257
|
types: runtime_info_default.name + "/tags/define.d.marko"
|
|
8311
8258
|
};
|
|
8312
8259
|
// src/translator/core/effect.ts
|
|
@@ -8326,7 +8273,6 @@ var effect_default = {
|
|
|
8326
8273
|
}
|
|
8327
8274
|
});
|
|
8328
8275
|
},
|
|
8329
|
-
attributes: {},
|
|
8330
8276
|
types: runtime_info_default.name + "/tags/effect.d.marko"
|
|
8331
8277
|
};
|
|
8332
8278
|
// src/translator/core/export.ts
|
|
@@ -8340,8 +8286,7 @@ var export_default = {
|
|
|
8340
8286
|
parseOptions: {
|
|
8341
8287
|
statement: true,
|
|
8342
8288
|
rawOpenTag: true
|
|
8343
|
-
}
|
|
8344
|
-
autocomplete: [{ displayText: "export <value>" }]
|
|
8289
|
+
}
|
|
8345
8290
|
};
|
|
8346
8291
|
function getDefaultExport(statement) {
|
|
8347
8292
|
if (statement.type === "ExportDefaultDeclaration") return statement;
|
|
@@ -8460,52 +8405,7 @@ var for_default = {
|
|
|
8460
8405
|
}
|
|
8461
8406
|
}
|
|
8462
8407
|
}),
|
|
8463
|
-
parseOptions: { controlFlow: true }
|
|
8464
|
-
attributes: {
|
|
8465
|
-
of: {
|
|
8466
|
-
type: "expression",
|
|
8467
|
-
autocomplete: [{ description: "Iterates over a list of items." }]
|
|
8468
|
-
},
|
|
8469
|
-
in: {
|
|
8470
|
-
type: "expression",
|
|
8471
|
-
autocomplete: [{ description: "Iterates over the keys and values of an object." }]
|
|
8472
|
-
},
|
|
8473
|
-
to: {
|
|
8474
|
-
type: "number",
|
|
8475
|
-
autocomplete: [{ description: "Iterates up to the provided number (inclusive)" }]
|
|
8476
|
-
},
|
|
8477
|
-
until: {
|
|
8478
|
-
type: "number",
|
|
8479
|
-
autocomplete: [{ description: "Iterates up to the provided number (exclusive)" }]
|
|
8480
|
-
},
|
|
8481
|
-
from: {
|
|
8482
|
-
type: "number",
|
|
8483
|
-
autocomplete: [{ description: "Iterates starting from the provided number (inclusive)" }]
|
|
8484
|
-
},
|
|
8485
|
-
step: {
|
|
8486
|
-
type: "number",
|
|
8487
|
-
autocomplete: [{ description: "The amount to increment during each iteration (with from/to/until)" }]
|
|
8488
|
-
}
|
|
8489
|
-
},
|
|
8490
|
-
autocomplete: [
|
|
8491
|
-
{
|
|
8492
|
-
snippet: "for|${1:value, index}| of=${3:array}",
|
|
8493
|
-
description: "Use to iterate over lists, object properties, or between ranges.",
|
|
8494
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#for"
|
|
8495
|
-
},
|
|
8496
|
-
{
|
|
8497
|
-
snippet: "for|${1:name, value}| in=${3:object}",
|
|
8498
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#for"
|
|
8499
|
-
},
|
|
8500
|
-
{
|
|
8501
|
-
snippet: "for|${1:index}| to=${2:number}",
|
|
8502
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#for"
|
|
8503
|
-
},
|
|
8504
|
-
{
|
|
8505
|
-
snippet: "for|${1:index}| until=${2:number}",
|
|
8506
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#for"
|
|
8507
|
-
}
|
|
8508
|
-
]
|
|
8408
|
+
parseOptions: { controlFlow: true }
|
|
8509
8409
|
};
|
|
8510
8410
|
function getLoopKeyBinding(byAttr, paramsBinding, forType) {
|
|
8511
8411
|
if (byAttr) {
|
|
@@ -8626,11 +8526,7 @@ var html_comment_default = {
|
|
|
8626
8526
|
replaceWithStatements(tag);
|
|
8627
8527
|
} },
|
|
8628
8528
|
parseOptions: { text: true },
|
|
8629
|
-
types: runtime_info_default.name + "/tags/html-comment.d.marko"
|
|
8630
|
-
autocomplete: [{
|
|
8631
|
-
description: "Use to create an html comment that is not stripped from the output.",
|
|
8632
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#html-comment"
|
|
8633
|
-
}]
|
|
8529
|
+
types: runtime_info_default.name + "/tags/html-comment.d.marko"
|
|
8634
8530
|
};
|
|
8635
8531
|
function isEmptiableCommentBody(body) {
|
|
8636
8532
|
for (const child of body) if (!_marko_compiler.types.isMarkoPlaceholder(child) || isNonEmptyLiteral(child.value)) return false;
|
|
@@ -8654,11 +8550,7 @@ var html_script_default = {
|
|
|
8654
8550
|
parseOptions: {
|
|
8655
8551
|
text: true,
|
|
8656
8552
|
preserveWhitespace: true
|
|
8657
|
-
}
|
|
8658
|
-
autocomplete: [{
|
|
8659
|
-
description: "Use instead of `<script>` to render a native tag directly, without processing by Marko.",
|
|
8660
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#html-script--html-style"
|
|
8661
|
-
}]
|
|
8553
|
+
}
|
|
8662
8554
|
};
|
|
8663
8555
|
// src/translator/core/html-style.ts
|
|
8664
8556
|
var html_style_default = {
|
|
@@ -8667,11 +8559,7 @@ var html_style_default = {
|
|
|
8667
8559
|
parseOptions: {
|
|
8668
8560
|
text: true,
|
|
8669
8561
|
preserveWhitespace: true
|
|
8670
|
-
}
|
|
8671
|
-
autocomplete: [{
|
|
8672
|
-
description: "Use instead of `<style>` to render a native tag directly, without processing by Marko.",
|
|
8673
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#html-script--html-style"
|
|
8674
|
-
}]
|
|
8562
|
+
}
|
|
8675
8563
|
};
|
|
8676
8564
|
// src/translator/core/id.ts
|
|
8677
8565
|
var id_default = {
|
|
@@ -8714,13 +8602,6 @@ var id_default = {
|
|
|
8714
8602
|
}
|
|
8715
8603
|
} },
|
|
8716
8604
|
parseOptions: { openTagOnly: true },
|
|
8717
|
-
attributes: {},
|
|
8718
|
-
autocomplete: [{
|
|
8719
|
-
displayText: "id/<name>",
|
|
8720
|
-
description: "Use to create a unique identifier.",
|
|
8721
|
-
snippet: "id/${1:name}",
|
|
8722
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#id"
|
|
8723
|
-
}],
|
|
8724
8605
|
types: runtime_info_default.name + "/tags/id.d.marko"
|
|
8725
8606
|
};
|
|
8726
8607
|
// src/translator/core/import.ts
|
|
@@ -8731,13 +8612,7 @@ var import_default = {
|
|
|
8731
8612
|
parseOptions: {
|
|
8732
8613
|
statement: true,
|
|
8733
8614
|
rawOpenTag: true
|
|
8734
|
-
}
|
|
8735
|
-
autocomplete: [{
|
|
8736
|
-
displayText: "import <scope> from \"<path>\"",
|
|
8737
|
-
description: "Use to import external modules, follows the same syntax as JavaScript imports.",
|
|
8738
|
-
snippet: "import ${2} from \"${1:path}\"",
|
|
8739
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/language#import"
|
|
8740
|
-
}]
|
|
8615
|
+
}
|
|
8741
8616
|
};
|
|
8742
8617
|
// src/translator/core/let.ts
|
|
8743
8618
|
var let_default = {
|
|
@@ -8808,11 +8683,6 @@ var let_default = {
|
|
|
8808
8683
|
replaceWithStatements(tag);
|
|
8809
8684
|
} },
|
|
8810
8685
|
parseOptions: { openTagOnly: true },
|
|
8811
|
-
attributes: {},
|
|
8812
|
-
autocomplete: [{
|
|
8813
|
-
description: "Use to create a mutable binding.",
|
|
8814
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#let"
|
|
8815
|
-
}],
|
|
8816
8686
|
types: runtime_info_default.name + "/tags/let.d.marko"
|
|
8817
8687
|
};
|
|
8818
8688
|
function getDeclarationHint(attr) {
|
|
@@ -8850,11 +8720,6 @@ var lifecycle_default = {
|
|
|
8850
8720
|
replaceWithStatements(tag);
|
|
8851
8721
|
} },
|
|
8852
8722
|
parseOptions: { openTagOnly: true },
|
|
8853
|
-
attributes: {},
|
|
8854
|
-
autocomplete: [{
|
|
8855
|
-
description: "Use to create side effects.",
|
|
8856
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#lifecycle"
|
|
8857
|
-
}],
|
|
8858
8723
|
types: runtime_info_default.name + "/tags/lifecycle.d.marko"
|
|
8859
8724
|
};
|
|
8860
8725
|
// src/translator/core/log.ts
|
|
@@ -8871,11 +8736,6 @@ var log_default = {
|
|
|
8871
8736
|
addTagStatement(tag, _marko_compiler.types.expressionStatement(_marko_compiler.types.callExpression(_marko_compiler.types.memberExpression(_marko_compiler.types.identifier("console"), _marko_compiler.types.identifier("log")), [tag.node.attributes[0].value])));
|
|
8872
8737
|
} },
|
|
8873
8738
|
parseOptions: { openTagOnly: true },
|
|
8874
|
-
attributes: {},
|
|
8875
|
-
autocomplete: [{
|
|
8876
|
-
description: "Use to log a value to the console.",
|
|
8877
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#log"
|
|
8878
|
-
}],
|
|
8879
8739
|
types: runtime_info_default.name + "/tags/log.d.marko"
|
|
8880
8740
|
};
|
|
8881
8741
|
// src/translator/core/return.ts
|
|
@@ -8920,13 +8780,7 @@ var return_default = {
|
|
|
8920
8780
|
replaceWithStatements(tag);
|
|
8921
8781
|
} }
|
|
8922
8782
|
}),
|
|
8923
|
-
parseOptions: { openTagOnly: true }
|
|
8924
|
-
autocomplete: [{
|
|
8925
|
-
displayText: "return=<value>",
|
|
8926
|
-
description: "Provides a value for use in a parent template.",
|
|
8927
|
-
snippet: "return=${1:value}",
|
|
8928
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#return"
|
|
8929
|
-
}]
|
|
8783
|
+
parseOptions: { openTagOnly: true }
|
|
8930
8784
|
};
|
|
8931
8785
|
// src/translator/core/script.ts
|
|
8932
8786
|
const htmlScriptTagAlternateMsg = " For a native html `<script>` tag use the [`html-script` core tag](https://markojs.com/docs/reference/core-tag#html-script--html-style) instead.";
|
|
@@ -9006,10 +8860,6 @@ var script_default = {
|
|
|
9006
8860
|
text: true,
|
|
9007
8861
|
preserveWhitespace: true
|
|
9008
8862
|
},
|
|
9009
|
-
autocomplete: [{
|
|
9010
|
-
description: "Use to create side effects. For a native `<script>` element, use `<html-script>`.",
|
|
9011
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#script"
|
|
9012
|
-
}],
|
|
9013
8863
|
types: runtime_info_default.name + "/tags/script.d.marko"
|
|
9014
8864
|
};
|
|
9015
8865
|
function isEmptyFunction(node) {
|
|
@@ -9136,11 +8986,6 @@ var show_default = {
|
|
|
9136
8986
|
} }
|
|
9137
8987
|
}),
|
|
9138
8988
|
parseOptions: { controlFlow: true },
|
|
9139
|
-
autocomplete: [{
|
|
9140
|
-
snippet: "show=${1:condition}",
|
|
9141
|
-
description: "Use to render content that is always mounted but only displayed when the condition is met.",
|
|
9142
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#show"
|
|
9143
|
-
}],
|
|
9144
8989
|
types: runtime_info_default.name + "/tags/show.d.marko"
|
|
9145
8990
|
};
|
|
9146
8991
|
function assertValidShow(tag) {
|
|
@@ -9296,8 +9141,7 @@ var style_default = {
|
|
|
9296
9141
|
text: true,
|
|
9297
9142
|
rawOpenTag: true,
|
|
9298
9143
|
preserveWhitespace: true
|
|
9299
|
-
}
|
|
9300
|
-
attributes: {}
|
|
9144
|
+
}
|
|
9301
9145
|
};
|
|
9302
9146
|
function analyzeDynamicStyle(tag, names) {
|
|
9303
9147
|
const { node } = tag;
|
|
@@ -9459,7 +9303,10 @@ var try_default = {
|
|
|
9459
9303
|
const { dynamic, repeated } = attrTags[name];
|
|
9460
9304
|
if (dynamic || repeated) throw tag.get("name").buildCodeFrameError(dynamic ? `The ${coreTagLink(tag)} needs its \`<${name}>\` written directly inside it, not within control flow such as \`<if>\` or \`<for>\`.` : `The ${coreTagLink(tag)} takes a single \`<${name}>\`.`);
|
|
9461
9305
|
}
|
|
9462
|
-
for (const child of tag.get("attributeTags"))
|
|
9306
|
+
for (const child of tag.get("attributeTags")) {
|
|
9307
|
+
if (child.isMarkoTag() && (child.node.attributes.length || child.node.arguments)) throw child.get("name").buildCodeFrameError(`The ${coreTagLink(tag)}'s \`<${getTagName(child)}>\` takes no attributes, only content.`);
|
|
9308
|
+
if (child.isMarkoTag() && child.node.body.params.length && getTagName(child) === "@placeholder") throw child.get("name").buildCodeFrameError(`The ${coreTagLink(tag)}'s \`<@placeholder>\` takes no parameters: nothing passes it arguments.`);
|
|
9309
|
+
}
|
|
9463
9310
|
}
|
|
9464
9311
|
assertHasBody(tag);
|
|
9465
9312
|
if (!attrTags) throw tag.get("name").buildCodeFrameError(`The ${coreTagLink(tag)} needs a \`<@catch>\` to handle errors or a \`<@placeholder>\` to show while its content is pending. Without either it has no effect, so render its content directly.`);
|
|
@@ -9525,11 +9372,6 @@ var try_default = {
|
|
|
9525
9372
|
replaceWithStatements(tag);
|
|
9526
9373
|
} }
|
|
9527
9374
|
}),
|
|
9528
|
-
attributes: {},
|
|
9529
|
-
autocomplete: [{
|
|
9530
|
-
description: "Used to capture errors and display placeholders for nested content.",
|
|
9531
|
-
descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#try"
|
|
9532
|
-
}],
|
|
9533
9375
|
types: runtime_info_default.name + "/tags/try.d.marko"
|
|
9534
9376
|
};
|
|
9535
9377
|
function getTryParts(tag) {
|
|
@@ -9559,8 +9401,8 @@ var core_default = {
|
|
|
9559
9401
|
"<debug>": debug_default,
|
|
9560
9402
|
"<define>": define_default,
|
|
9561
9403
|
"<effect>": effect_default,
|
|
9562
|
-
"<else-if>":
|
|
9563
|
-
"<else>":
|
|
9404
|
+
"<else-if>": IfTag,
|
|
9405
|
+
"<else>": IfTag,
|
|
9564
9406
|
"<export>": export_default,
|
|
9565
9407
|
"<for>": for_default,
|
|
9566
9408
|
"<html-comment>": html_comment_default,
|
|
@@ -11819,7 +11661,9 @@ function createInteropTranslator(translate5) {
|
|
|
11819
11661
|
analyze: mergeVisitors(translate5.analyze, analyze),
|
|
11820
11662
|
translate: withInteropEntryBuilder(mergeVisitors(translate5.translate, translate)),
|
|
11821
11663
|
tagDiscoveryDirs: [...tagDiscoveryDirs, ...translate5.tagDiscoveryDirs],
|
|
11822
|
-
|
|
11664
|
+
classTaglibs: translate5.classTaglibs,
|
|
11665
|
+
optionalTaglibs: translate5.optionalTaglibs,
|
|
11666
|
+
taglibs: mergeTaglibs(translate5.taglibs, taglibs.concat([["marko-interop", { migrate: out_global_default }]])),
|
|
11823
11667
|
getRuntimeEntryFiles(output, optimize) {
|
|
11824
11668
|
return [...translate5.getRuntimeEntryFiles(output, optimize), ...getRuntimeEntryFiles(output, optimize)];
|
|
11825
11669
|
}
|
|
@@ -15,6 +15,8 @@ export declare function createInteropTranslator(translate5: any): {
|
|
|
15
15
|
analyze: Record<"Accessor" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayExpression" | "ArrayPattern" | "ArrayTypeAnnotation" | "ArrowFunctionExpression" | "AssignmentExpression" | "AssignmentPattern" | "AwaitExpression" | "BigIntLiteral" | "Binary" | "BinaryExpression" | "BindExpression" | "BindingIdentifier" | "Block" | "BlockParent" | "BlockScoped" | "BlockStatement" | "BooleanLiteral" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "BreakStatement" | "CallExpression" | "CatchClause" | "Class" | "ClassAccessorProperty" | "ClassBody" | "ClassDeclaration" | "ClassExpression" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "CompletionStatement" | "Conditional" | "ConditionalExpression" | "ContinueStatement" | "DebuggerStatement" | "DecimalLiteral" | "Declaration" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoExpression" | "DoWhileStatement" | "EmptyStatement" | "EmptyTypeAnnotation" | "EnumBody" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistentialTypeParam" | "ExistsTypeAnnotation" | "ExportAllDeclaration" | "ExportDeclaration" | "ExportDefaultDeclaration" | "ExportDefaultSpecifier" | "ExportNamedDeclaration" | "ExportNamespaceSpecifier" | "ExportSpecifier" | "Expression" | "ExpressionStatement" | "ExpressionWrapper" | "File" | "Flow" | "FlowBaseAnnotation" | "FlowDeclaration" | "FlowPredicate" | "FlowType" | "For" | "ForAwaitStatement" | "ForInStatement" | "ForOfStatement" | "ForStatement" | "ForXStatement" | "Function" | "FunctionDeclaration" | "FunctionExpression" | "FunctionParameter" | "FunctionParent" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "Generated" | "GenericTypeAnnotation" | "Identifier" | "IfStatement" | "Immutable" | "Import" | "ImportAttribute" | "ImportDeclaration" | "ImportDefaultSpecifier" | "ImportExpression" | "ImportNamespaceSpecifier" | "ImportOrExportDeclaration" | "ImportSpecifier" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSX" | "JSXAttribute" | "JSXClosingElement" | "JSXClosingFragment" | "JSXElement" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXFragment" | "JSXIdentifier" | "JSXMemberExpression" | "JSXNamespacedName" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXSpreadAttribute" | "JSXSpreadChild" | "JSXText" | "LVal" | "LabeledStatement" | "Literal" | "LogicalExpression" | "Loop" | "Marko" | "MarkoAttribute" | "MarkoCDATA" | "MarkoClass" | "MarkoComment" | "MarkoDeclaration" | "MarkoDocumentType" | "MarkoParseError" | "MarkoPlaceholder" | "MarkoScriptlet" | "MarkoSpreadAttribute" | "MarkoTag" | "MarkoTagBody" | "MarkoText" | "MemberExpression" | "MetaProperty" | "Method" | "Miscellaneous" | "MixedTypeAnnotation" | "ModuleDeclaration" | "ModuleExpression" | "ModuleSpecifier" | "NewExpression" | "Noop" | "NullLiteral" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "NumericLiteral" | "NumericLiteralTypeAnnotation" | "ObjectExpression" | "ObjectMember" | "ObjectMethod" | "ObjectPattern" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalCallExpression" | "OptionalIndexedAccessType" | "OptionalMemberExpression" | "ParenthesizedExpression" | "Pattern" | "PatternLike" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "PipelineTopicExpression" | "Placeholder" | "Private" | "PrivateName" | "Program" | "Property" | "Pure" | "Pureish" | "QualifiedTypeIdentifier" | "RecordExpression" | "Referenced" | "ReferencedIdentifier" | "ReferencedMemberExpression" | "RegExpLiteral" | "RegexLiteral" | "RestElement" | "RestProperty" | "ReturnStatement" | "Scopable" | "Scope" | "SequenceExpression" | "SpreadElement" | "SpreadProperty" | "Standardized" | "Statement" | "StaticBlock" | "StringLiteral" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "Super" | "SwitchCase" | "SwitchStatement" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSAsExpression" | "TSBaseType" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEntityName" | "TSEnumBody" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInstantiationExpression" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNonNullExpression" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSSatisfiesExpression" | "TSStringKeyword" | "TSSymbolKeyword" | "TSTemplateLiteralType" | "TSThisType" | "TSTupleType" | "TSType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeAssertion" | "TSTypeElement" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "TaggedTemplateExpression" | "TemplateElement" | "TemplateLiteral" | "Terminatorless" | "ThisExpression" | "ThisTypeAnnotation" | "ThrowStatement" | "TopicReference" | "TryStatement" | "TupleExpression" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeCastExpression" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeScript" | "TypeofTypeAnnotation" | "UnaryExpression" | "UnaryLike" | "UnionTypeAnnotation" | "UpdateExpression" | "User" | "UserWhitespacable" | "V8IntrinsicIdentifier" | "Var" | "VariableDeclaration" | "VariableDeclarator" | "Variance" | "VoidPattern" | "VoidTypeAnnotation" | "While" | "WhileStatement" | "WithStatement" | "YieldExpression" | "enter" | "exit" | `${string}|${string}`, t.VisitNode<unknown, t.Node> | undefined>;
|
|
16
16
|
translate: t.Visitor<unknown>;
|
|
17
17
|
tagDiscoveryDirs: any[];
|
|
18
|
+
classTaglibs: any;
|
|
19
|
+
optionalTaglibs: any;
|
|
18
20
|
taglibs: Taglibs;
|
|
19
21
|
getRuntimeEntryFiles(output: Config["output"], optimize: boolean): any[];
|
|
20
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.14",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@marko/compiler": "^5.
|
|
54
|
+
"@marko/compiler": "^5.43.0",
|
|
55
55
|
"csstype": "^3.2.3",
|
|
56
56
|
"fastest-levenshtein": "^1.0.16",
|
|
57
57
|
"magic-string": "^1.4.5"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@marko/runtime-tags": "npm:marko@6.4.
|
|
61
|
-
"marko": "5.
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.4.14",
|
|
61
|
+
"marko": "5.40.1"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22.12.0"
|
package/tags/await.d.marko
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Unwraps the promise in its `value=` and renders its content with the result,
|
|
5
|
+
* passed as a tag parameter. Inside a `<try>`, its `@placeholder` shows while
|
|
6
|
+
* the promise is pending and its `@catch` if it rejects.
|
|
7
|
+
*
|
|
8
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#await)
|
|
9
|
+
*/
|
|
3
10
|
export interface Input<T> {
|
|
11
|
+
/** The promise to wait for. */
|
|
4
12
|
value: T;
|
|
5
13
|
content: Marko.Body<[Awaited<T>]>
|
|
6
14
|
}
|
package/tags/const.d.marko
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Exposes its `value=` through its tag variable, updated whenever what the
|
|
5
|
+
* value reads changes.
|
|
6
|
+
*
|
|
7
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#const)
|
|
8
|
+
*/
|
|
3
9
|
export interface Input<T> {
|
|
4
10
|
value: T;
|
|
5
11
|
}
|
package/tags/debug.d.marko
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Runs a `debugger` statement once the tag renders.
|
|
5
|
+
*
|
|
6
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#debug)
|
|
7
|
+
*/
|
|
3
8
|
export interface Input {
|
|
9
|
+
/** Runs the `debugger` statement again whenever it changes. */
|
|
4
10
|
value?: any;
|
|
5
11
|
}
|
package/tags/define.d.marko
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Creates a reusable snippet: its tag variable holds the attributes it was
|
|
5
|
+
* given, including its content, and renders that content as a tag.
|
|
6
|
+
*
|
|
7
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#define)
|
|
8
|
+
*/
|
|
3
9
|
export type Input<T> = T;
|
|
4
10
|
|
|
5
11
|
return=input
|
package/tags/effect.d.marko
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Replaced by `<script>`, which runs its body as code.
|
|
5
|
+
*
|
|
6
|
+
* [`<script>` docs](https://markojs.com/docs/reference/core-tag#script)
|
|
7
|
+
*/
|
|
3
8
|
export interface Input {
|
|
4
9
|
value?(): void;
|
|
5
10
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outputs a literal `<!-- comment -->`, which a template's own comments are
|
|
3
|
+
* not. Its tag variable is a getter for the comment node.
|
|
4
|
+
*
|
|
5
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#html-comment)
|
|
6
|
+
*/
|
|
1
7
|
export interface Input {}
|
|
2
8
|
|
|
3
9
|
return=(null! as () => Comment)
|
package/tags/html-script.d.marko
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A native `<script>` element, without the handling Marko gives `<script>`.
|
|
3
|
+
*
|
|
4
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#html-script--html-style)
|
|
5
|
+
*/
|
|
1
6
|
export interface Input extends Marko.HTML.Script {}
|
|
2
7
|
|
|
3
8
|
return=(null! as () => HTMLScriptElement)
|
package/tags/html-style.d.marko
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A native `<style>` element, without the handling Marko gives `<style>`.
|
|
3
|
+
*
|
|
4
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#html-script--html-style)
|
|
5
|
+
*/
|
|
1
6
|
export interface Input extends Marko.HTML.Style {}
|
|
2
7
|
|
|
3
8
|
return=(null! as () => HTMLStyleElement)
|
package/tags/id.d.marko
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Exposes a short unique id string through its tag variable, for `id=` and
|
|
5
|
+
* aria attributes.
|
|
6
|
+
*
|
|
7
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#id)
|
|
8
|
+
*/
|
|
3
9
|
export interface Input {
|
|
10
|
+
/**
|
|
11
|
+
* Used instead of the generated id when it is a non-empty string; `null`,
|
|
12
|
+
* `false` and `""` fall back to the generated one.
|
|
13
|
+
*/
|
|
4
14
|
value?: string | null | false;
|
|
5
15
|
}
|
|
6
16
|
|
package/tags/let.d.marko
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Introduces mutable state through its tag variable, starting from its
|
|
5
|
+
* `value=`. Updating the variable re-runs everything that reads it, and a
|
|
6
|
+
* `valueChange=` makes the state controllable.
|
|
7
|
+
*
|
|
8
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#let)
|
|
9
|
+
*/
|
|
3
10
|
export type Input<T = undefined, K = T> =
|
|
4
11
|
| { value: T; valueChange?: ((newValue: K) => void) | false | null }
|
|
5
12
|
| { value?: undefined; valueChange?: ((newValue: K) => void) | false | null };
|
package/tags/lifecycle.d.marko
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
3
|
/* `R` is inferred from what `onMount` returns, so a return value read from `this`
|
|
4
4
|
is circular; such a tag passes its type explicitly (`<lifecycle<{ … }>>`). */
|
|
5
|
+
/**
|
|
6
|
+
* Synchronizes side effects from imperative client APIs. Its attributes are
|
|
7
|
+
* assigned onto `this` before each call, and what `onMount` returns is merged
|
|
8
|
+
* onto it.
|
|
9
|
+
*
|
|
10
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#lifecycle)
|
|
11
|
+
*/
|
|
5
12
|
export type Input<
|
|
6
13
|
T extends object,
|
|
7
14
|
R extends object = {},
|
|
8
15
|
> = T & ThisType<T & R> & {
|
|
16
|
+
/** Called once this tag is attached to the DOM, and never again. */
|
|
9
17
|
onMount?: () => R | void;
|
|
18
|
+
/** Called every time a value read by any of this tag's attributes changes. */
|
|
10
19
|
onUpdate?: () => void;
|
|
20
|
+
/** Called once this tag is removed from the DOM. */
|
|
11
21
|
onDestroy?: () => void;
|
|
12
22
|
};
|
package/tags/log.d.marko
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Logs its `value=` with `console.log`, on the server and in the browser, and
|
|
5
|
+
* again whenever it changes.
|
|
6
|
+
*
|
|
7
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#log)
|
|
8
|
+
*/
|
|
3
9
|
export interface Input {
|
|
4
10
|
value: any;
|
|
5
11
|
}
|
package/tags/script.d.marko
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Runs its body as code once the template is mounted in the browser, and again
|
|
5
|
+
* whenever a tag variable or parameter it reads changes. For a native
|
|
6
|
+
* `<script>` element, use `<html-script>`.
|
|
7
|
+
*
|
|
8
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#script)
|
|
9
|
+
*/
|
|
3
10
|
export interface Input {
|
|
11
|
+
/** Run instead of a body, under the same conditions. */
|
|
4
12
|
value?(): unknown;
|
|
5
13
|
}
|
package/tags/show.d.marko
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/* File for types only, not actual implementation */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Displays its content only while its `value=` is truthy. Unlike `<if>`, the
|
|
5
|
+
* content stays rendered and mounted, so its state persists across toggles.
|
|
6
|
+
*
|
|
7
|
+
* [Marko docs](https://markojs.com/docs/reference/core-tag#show)
|
|
8
|
+
*/
|
|
3
9
|
export interface Input {
|
|
4
10
|
value: unknown;
|
|
5
11
|
content: Marko.Body;
|