marko 5.39.51 → 5.40.0
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/compiler/index.js +0 -2
- package/dist/core-tags/core/await/index.d.marko +17 -0
- package/dist/core-tags/core/script.d.marko +6 -1
- package/dist/runtime/vdom/VElement.js +10 -29
- package/dist/runtime/vdom/morphdom/index.js +0 -1
- package/dist/taglib/index.js +3 -6
- package/dist/translator/index.js +6 -17
- package/dist/translator/tag/attribute/index.js +0 -16
- package/dist/translator/tag/attribute-tag.js +4 -11
- package/dist/translator/tag/native-tag[html]/index.js +1 -13
- package/dist/translator/tag/native-tag[vdom]/index.js +0 -12
- package/dist/translator/tag/util.js +64 -53
- package/dist/translator/taglib/core/index.js +17 -366
- package/dist/translator/util/runtime-flags.js +2 -3
- package/dist/translator.js +4 -2
- package/docs/marko-json.md +3 -6
- package/package.json +4 -4
- package/src/compiler/index.js +0 -2
- package/src/core-tags/core/await/index.d.marko +17 -0
- package/src/core-tags/core/script.d.marko +6 -1
- package/src/runtime/vdom/VElement.js +10 -29
- package/src/runtime/vdom/morphdom/index.js +0 -1
- package/src/taglib/index.js +3 -6
- package/src/translator/index.js +4 -15
- package/src/translator/tag/attribute/index.js +1 -17
- package/src/translator/tag/attribute-tag.js +4 -11
- package/src/translator/tag/native-tag[html]/index.js +0 -12
- package/src/translator/tag/native-tag[vdom]/index.js +1 -13
- package/src/translator/tag/util.js +64 -53
- package/src/translator/taglib/core/index.js +0 -349
- package/src/translator/util/runtime-flags.js +1 -2
- package/src/translator.js +2 -0
- package/translator/index.d.ts +1 -0
|
@@ -28,16 +28,6 @@ export default {
|
|
|
28
28
|
statement: true,
|
|
29
29
|
rawOpenTag: true,
|
|
30
30
|
},
|
|
31
|
-
autocomplete: [
|
|
32
|
-
{
|
|
33
|
-
displayText: 'import <scope> from "<path>"',
|
|
34
|
-
description:
|
|
35
|
-
"Use to import external modules, follows the same syntax as JavaScript imports.",
|
|
36
|
-
snippet: 'import ${2} from "${1:path}"',
|
|
37
|
-
descriptionMoreURL:
|
|
38
|
-
"https://markojs.com/docs/syntax/#importing-external-files",
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
31
|
},
|
|
42
32
|
"<export>": {
|
|
43
33
|
"node-factory": parseExport,
|
|
@@ -45,16 +35,6 @@ export default {
|
|
|
45
35
|
statement: true,
|
|
46
36
|
rawOpenTag: true,
|
|
47
37
|
},
|
|
48
|
-
autocomplete: [
|
|
49
|
-
{
|
|
50
|
-
displayText: "export <scope>",
|
|
51
|
-
description:
|
|
52
|
-
"Use export additional data with the template, follows the same syntax as JavaScript exports.",
|
|
53
|
-
snippet: "export ${1}",
|
|
54
|
-
descriptionMoreURL:
|
|
55
|
-
"https://markojs.com/docs/syntax/#importing-external-files",
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
38
|
},
|
|
59
39
|
"<client>": {
|
|
60
40
|
"node-factory": parseClient,
|
|
@@ -76,16 +56,6 @@ export default {
|
|
|
76
56
|
statement: true,
|
|
77
57
|
rawOpenTag: true,
|
|
78
58
|
},
|
|
79
|
-
autocomplete: [
|
|
80
|
-
{
|
|
81
|
-
displayText: "class { /** lifecycle methods **/ }",
|
|
82
|
-
snippet: "class {\n\t$0\n}",
|
|
83
|
-
description:
|
|
84
|
-
"A class containing the lifecycle methods, event handlers, and other properties for this component.",
|
|
85
|
-
descriptionMoreURL:
|
|
86
|
-
"https://markojs.com/docs/class-components/#single-file-components",
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
59
|
},
|
|
90
60
|
"<static>": {
|
|
91
61
|
"node-factory": parseStatic,
|
|
@@ -93,15 +63,6 @@ export default {
|
|
|
93
63
|
statement: true,
|
|
94
64
|
rawOpenTag: true,
|
|
95
65
|
},
|
|
96
|
-
autocomplete: [
|
|
97
|
-
{
|
|
98
|
-
displayText: "static <statement>",
|
|
99
|
-
description:
|
|
100
|
-
"A JavaScript statement which is only evaluated once your template is loaded.",
|
|
101
|
-
descriptionMoreURL:
|
|
102
|
-
"https://markojs.com/docs/syntax/#static-javascript",
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
66
|
},
|
|
106
67
|
"<style>": {
|
|
107
68
|
transformer: transformStyle,
|
|
@@ -114,189 +75,45 @@ export default {
|
|
|
114
75
|
"<macro>": {
|
|
115
76
|
"node-factory": parseMacro,
|
|
116
77
|
"code-generator": translateMacro,
|
|
117
|
-
"@name": {
|
|
118
|
-
type: "string",
|
|
119
|
-
autocomplete: [
|
|
120
|
-
{
|
|
121
|
-
description: "The name which can be used as a tag within a template.",
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
},
|
|
125
|
-
autocomplete: [
|
|
126
|
-
{
|
|
127
|
-
displayText: 'macro|<params>| name="<name>"',
|
|
128
|
-
description: "Creates a reusable fragment within the template.",
|
|
129
|
-
snippet: 'macro|${2:param1, param2}| name="${1:name}"',
|
|
130
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#macro",
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
78
|
},
|
|
134
79
|
"<include-text>": {
|
|
135
80
|
"code-generator": translateIncludeContent,
|
|
136
|
-
attributes: {},
|
|
137
|
-
autocomplete: [
|
|
138
|
-
{
|
|
139
|
-
displayText: 'include-text("<path>")',
|
|
140
|
-
description: "Allows you to inline the contents of a text file.",
|
|
141
|
-
snippet: 'include-text(${1:"./foo.txt"})',
|
|
142
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#include-text",
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
81
|
},
|
|
146
82
|
"<include-html>": {
|
|
147
83
|
"code-generator": translateIncludeContent,
|
|
148
|
-
attributes: {},
|
|
149
|
-
autocomplete: [
|
|
150
|
-
{
|
|
151
|
-
displayText: 'include-html("<path>")',
|
|
152
|
-
snippet: 'include-html(${1:"./foo.html"})',
|
|
153
|
-
description: "Allows you to inline the contents of an html file.",
|
|
154
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#include-html",
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
84
|
},
|
|
158
85
|
"<if>": {
|
|
159
86
|
"parse-options": { controlFlow: true },
|
|
160
87
|
"code-generator": translateIf,
|
|
161
|
-
attributes: {},
|
|
162
|
-
autocomplete: [
|
|
163
|
-
{
|
|
164
|
-
snippet: "if(${1:condition})",
|
|
165
|
-
description: "Use to display content only if the condition is meant.",
|
|
166
|
-
descriptionMoreURL:
|
|
167
|
-
"https://markojs.com/docs/core-tags/#if-else-if-else",
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
88
|
},
|
|
171
89
|
"<else-if>": {
|
|
172
90
|
"parse-options": { controlFlow: true },
|
|
173
91
|
"code-generator": translateElseIf,
|
|
174
|
-
attributes: {},
|
|
175
|
-
autocomplete: [
|
|
176
|
-
{
|
|
177
|
-
snippet: "else-if(${1:condition})",
|
|
178
|
-
description:
|
|
179
|
-
"Use after an <if> or <else-if> tag to display content if those conditions do not match and this one does.",
|
|
180
|
-
descriptionMoreURL:
|
|
181
|
-
"https://markojs.com/docs/core-tags/#if-else-if-else",
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
92
|
},
|
|
185
93
|
"<else>": {
|
|
186
94
|
"parse-options": { controlFlow: true },
|
|
187
95
|
"code-generator": translateElse,
|
|
188
|
-
attributes: {},
|
|
189
|
-
autocomplete: [
|
|
190
|
-
{
|
|
191
|
-
description:
|
|
192
|
-
"Use after an <if> or <else-if> tag to display content if those conditions do not match.",
|
|
193
|
-
descriptionMoreURL:
|
|
194
|
-
"https://markojs.com/docs/core-tags/#if-else-if-else",
|
|
195
|
-
},
|
|
196
|
-
],
|
|
197
96
|
},
|
|
198
97
|
"<for>": {
|
|
199
98
|
"parse-options": { controlFlow: true },
|
|
200
99
|
"code-generator": translateFor,
|
|
201
|
-
"@of": {
|
|
202
|
-
type: "expression",
|
|
203
|
-
autocomplete: [
|
|
204
|
-
{
|
|
205
|
-
description: "Iterates over a list of items.",
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
},
|
|
209
|
-
"@in": {
|
|
210
|
-
type: "expression",
|
|
211
|
-
autocomplete: [
|
|
212
|
-
{
|
|
213
|
-
description: "Iterates over the keys and values of an object.",
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
},
|
|
217
|
-
"@to": {
|
|
218
|
-
type: "number",
|
|
219
|
-
autocomplete: [
|
|
220
|
-
{
|
|
221
|
-
description: "Iterates up to the provided number (inclusive)",
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
},
|
|
225
|
-
"@from": {
|
|
226
|
-
type: "number",
|
|
227
|
-
autocomplete: [
|
|
228
|
-
{
|
|
229
|
-
description: "Iterates starting from the provided number (inclusive)",
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
},
|
|
233
|
-
"@step": {
|
|
234
|
-
type: "number",
|
|
235
|
-
autocomplete: [
|
|
236
|
-
{
|
|
237
|
-
description:
|
|
238
|
-
"The amount to increment during each iteration (with from/to)",
|
|
239
|
-
},
|
|
240
|
-
],
|
|
241
|
-
},
|
|
242
|
-
autocomplete: [
|
|
243
|
-
{
|
|
244
|
-
snippet: "for|${1:value, index}| of=${3:array}",
|
|
245
|
-
description:
|
|
246
|
-
"Use to iterate over lists, object properties, or between ranges.",
|
|
247
|
-
descriptionMoreURL:
|
|
248
|
-
"https://markojs.com/docs/core-tags/#iterating-over-a-list",
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
snippet: "for|${1:name, value}| in=${3:object}",
|
|
252
|
-
descriptionMoreURL:
|
|
253
|
-
"https://markojs.com/docs/core-tags/#iterating-over-an-objects-properties",
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
snippet:
|
|
257
|
-
"for|${1:index}| from=${2:number} to=${3:number} step=${4:number}",
|
|
258
|
-
descriptionMoreURL:
|
|
259
|
-
"https://markojs.com/docs/core-tags/#iterating-between-a-range-of-numbers",
|
|
260
|
-
},
|
|
261
|
-
],
|
|
262
100
|
},
|
|
263
101
|
"<while>": {
|
|
264
102
|
"parse-options": { controlFlow: true },
|
|
265
103
|
"code-generator": translateWhile,
|
|
266
|
-
autocomplete: [
|
|
267
|
-
{
|
|
268
|
-
snippet: "while(${1:condition})",
|
|
269
|
-
description:
|
|
270
|
-
"Renders the content multiple times until the condition is no longer met.",
|
|
271
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#while",
|
|
272
|
-
},
|
|
273
|
-
],
|
|
274
104
|
},
|
|
275
105
|
"<html-comment>": {
|
|
276
106
|
"code-generator": translateHTMLComment,
|
|
277
107
|
"parse-options": {
|
|
278
108
|
text: true,
|
|
279
109
|
},
|
|
280
|
-
attributes: {},
|
|
281
|
-
autocomplete: [
|
|
282
|
-
{
|
|
283
|
-
description:
|
|
284
|
-
"Use to create an html comment that is not stripped from the output.",
|
|
285
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#html-comment",
|
|
286
|
-
},
|
|
287
|
-
],
|
|
288
110
|
},
|
|
289
111
|
"<_preserve>": {
|
|
290
112
|
renderer: "marko/src/core-tags/components/preserve-tag.js",
|
|
291
|
-
"@n": "boolean",
|
|
292
|
-
"@i": "boolean",
|
|
293
|
-
"@b": "boolean",
|
|
294
|
-
autocomplete: [],
|
|
295
113
|
},
|
|
296
114
|
"<init-components>": {
|
|
297
115
|
"code-generator": translateServerOnly,
|
|
298
116
|
renderer: "marko/src/core-tags/components/init-components-tag.js",
|
|
299
|
-
"@immediate": "boolean",
|
|
300
117
|
},
|
|
301
118
|
"<_preferred-script-location>": {
|
|
302
119
|
"code-generator": translateServerOnly,
|
|
@@ -306,92 +123,10 @@ export default {
|
|
|
306
123
|
renderer: "marko/src/core-tags/core/await/renderer.js",
|
|
307
124
|
types: "marko/src/core-tags/core/await/index.d.marko",
|
|
308
125
|
"code-generator": translateAwait,
|
|
309
|
-
"@_provider": "expression",
|
|
310
|
-
"@_name": "string",
|
|
311
|
-
"@name": {
|
|
312
|
-
type: "string",
|
|
313
|
-
autocomplete: [
|
|
314
|
-
{
|
|
315
|
-
description:
|
|
316
|
-
"Used to improve debugging and also to ensure promise ordering with the show-after attribute.",
|
|
317
|
-
snippet: 'name="${1:name}"',
|
|
318
|
-
},
|
|
319
|
-
],
|
|
320
|
-
},
|
|
321
|
-
"@timeout": {
|
|
322
|
-
type: "number",
|
|
323
|
-
autocomplete: [
|
|
324
|
-
{
|
|
325
|
-
description:
|
|
326
|
-
"An optional timeout that when reached will cause the promise to reject with a TimeoutError.",
|
|
327
|
-
},
|
|
328
|
-
],
|
|
329
|
-
},
|
|
330
|
-
"@client-reorder": {
|
|
331
|
-
type: "boolean",
|
|
332
|
-
autocomplete: [
|
|
333
|
-
{
|
|
334
|
-
description:
|
|
335
|
-
"If set anything after this promise will be sent out immediately, and reordered using JS in the browser.",
|
|
336
|
-
},
|
|
337
|
-
],
|
|
338
|
-
},
|
|
339
|
-
"@show-after": {
|
|
340
|
-
type: "string",
|
|
341
|
-
autocomplete: [
|
|
342
|
-
{
|
|
343
|
-
description:
|
|
344
|
-
"This attribute will ensure that (with client-reorder) this await tag will always show after another await tag with the provided name.",
|
|
345
|
-
},
|
|
346
|
-
],
|
|
347
|
-
},
|
|
348
|
-
"@then <then>": {
|
|
349
|
-
autocomplete: [
|
|
350
|
-
{
|
|
351
|
-
displayText: "then|<result>|",
|
|
352
|
-
description: "Executed with the result of the resolved promise.",
|
|
353
|
-
snippet: "then|${1:result}|",
|
|
354
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await",
|
|
355
|
-
},
|
|
356
|
-
],
|
|
357
|
-
},
|
|
358
|
-
"@catch <catch>": {
|
|
359
|
-
autocomplete: [
|
|
360
|
-
{
|
|
361
|
-
displayText: "catch|<err>|",
|
|
362
|
-
description: "Executed with the err of the rejected promise.",
|
|
363
|
-
snippet: "catch|${1:err}|",
|
|
364
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await",
|
|
365
|
-
},
|
|
366
|
-
],
|
|
367
|
-
},
|
|
368
|
-
"@placeholder <placeholder>": {
|
|
369
|
-
autocomplete: [
|
|
370
|
-
{
|
|
371
|
-
description: "A placeholder to display while the promise is pending.",
|
|
372
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await",
|
|
373
|
-
},
|
|
374
|
-
],
|
|
375
|
-
},
|
|
376
|
-
autocomplete: [
|
|
377
|
-
{
|
|
378
|
-
displayText: "await(<promise>)",
|
|
379
|
-
description:
|
|
380
|
-
"Used to render a template asynchronously with the results of a Promise",
|
|
381
|
-
snippet: "await(${1:promise})",
|
|
382
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await",
|
|
383
|
-
},
|
|
384
|
-
],
|
|
385
126
|
},
|
|
386
127
|
"<await-reorderer>": {
|
|
387
128
|
"code-generator": translateServerOnly,
|
|
388
129
|
renderer: "marko/src/core-tags/core/await/reorderer-renderer.js",
|
|
389
|
-
autocomplete: [
|
|
390
|
-
{
|
|
391
|
-
snippet: "await-reorderer",
|
|
392
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await",
|
|
393
|
-
},
|
|
394
|
-
],
|
|
395
130
|
},
|
|
396
131
|
"<__flush_here_and_after__>": {
|
|
397
132
|
"code-generator": translateServerOnly,
|
|
@@ -406,88 +141,4 @@ export default {
|
|
|
406
141
|
"<script>": {
|
|
407
142
|
types: "marko/src/core-tags/core/script.d.marko",
|
|
408
143
|
},
|
|
409
|
-
"<*>": {
|
|
410
|
-
"@key": {
|
|
411
|
-
type: "string",
|
|
412
|
-
"preserve-name": true,
|
|
413
|
-
autocomplete: [
|
|
414
|
-
{
|
|
415
|
-
displayText: 'key="<method>"',
|
|
416
|
-
snippet: 'key="${1:method}"',
|
|
417
|
-
descriptionMoreURL: "https://markojs.com/docs/class-components/#key",
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
descriptionMoreURL: "https://markojs.com/docs/class-components/#key",
|
|
421
|
-
},
|
|
422
|
-
],
|
|
423
|
-
},
|
|
424
|
-
"@on*": {
|
|
425
|
-
pattern: true,
|
|
426
|
-
type: "statement",
|
|
427
|
-
"allow-expressions": true,
|
|
428
|
-
"preserve-name": true,
|
|
429
|
-
"set-flag": "hasComponentEvents",
|
|
430
|
-
autocomplete: [
|
|
431
|
-
{
|
|
432
|
-
displayText: 'on<event>("<method>")',
|
|
433
|
-
snippet: 'on${1:Click}("handle${2:Button}${1:Click}")',
|
|
434
|
-
descriptionMoreURL:
|
|
435
|
-
"https://markojs.com/docs/components/#attaching-dom-event-listeners",
|
|
436
|
-
},
|
|
437
|
-
],
|
|
438
|
-
},
|
|
439
|
-
"@once*": {
|
|
440
|
-
pattern: true,
|
|
441
|
-
type: "statement",
|
|
442
|
-
"allow-expressions": true,
|
|
443
|
-
"preserve-name": true,
|
|
444
|
-
"set-flag": "hasComponentEvents",
|
|
445
|
-
autocomplete: {
|
|
446
|
-
displayText: 'once<event>("<method>")',
|
|
447
|
-
snippet: 'once${1:Click}("handle${2:Button}${1:Click}")',
|
|
448
|
-
descriptionMoreURL:
|
|
449
|
-
"https://markojs.com/docs/components/#attaching-dom-event-listeners",
|
|
450
|
-
},
|
|
451
|
-
},
|
|
452
|
-
"@no-update": {
|
|
453
|
-
type: "flag",
|
|
454
|
-
"preserve-name": true,
|
|
455
|
-
autocomplete: [
|
|
456
|
-
{
|
|
457
|
-
descriptionMoreURL:
|
|
458
|
-
"https://markojs.com/docs/class-components/#no-update",
|
|
459
|
-
},
|
|
460
|
-
],
|
|
461
|
-
},
|
|
462
|
-
"@no-update-body": {
|
|
463
|
-
type: "flag",
|
|
464
|
-
"preserve-name": true,
|
|
465
|
-
autocomplete: [
|
|
466
|
-
{
|
|
467
|
-
descriptionMoreURL:
|
|
468
|
-
"https://markojs.com/docs/class-components/#no-update-body",
|
|
469
|
-
},
|
|
470
|
-
],
|
|
471
|
-
},
|
|
472
|
-
"@no-update-if": {
|
|
473
|
-
"preserve-name": true,
|
|
474
|
-
autocomplete: [
|
|
475
|
-
{
|
|
476
|
-
snippet: "no-update-if(${1:condition})",
|
|
477
|
-
descriptionMoreURL:
|
|
478
|
-
"https://markojs.com/docs/class-components/#no-update-if",
|
|
479
|
-
},
|
|
480
|
-
],
|
|
481
|
-
},
|
|
482
|
-
"@no-update-body-if": {
|
|
483
|
-
"preserve-name": true,
|
|
484
|
-
autocomplete: [
|
|
485
|
-
{
|
|
486
|
-
snippet: "no-update-body-if(${1:condition})",
|
|
487
|
-
descriptionMoreURL:
|
|
488
|
-
"https://markojs.com/docs/class-components/#no-update-body-if",
|
|
489
|
-
},
|
|
490
|
-
],
|
|
491
|
-
},
|
|
492
|
-
},
|
|
493
144
|
};
|
package/src/translator.js
CHANGED