@marko/translator-default 5.22.0 → 5.22.2
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/cdata/index.js +3 -3
- package/dist/class.js +3 -3
- package/dist/comment/index.js +3 -3
- package/dist/declaration/index.js +3 -3
- package/dist/document-type/index.js +3 -3
- package/dist/index.js +12 -12
- package/dist/placeholder/index.js +3 -3
- package/dist/placeholder/index[html].js +9 -9
- package/dist/tag/attribute/directives/class.js +4 -3
- package/dist/tag/attribute/directives/index.js +2 -1
- package/dist/tag/attribute/directives/no-update-body-if.js +4 -3
- package/dist/tag/attribute/directives/no-update-body.js +2 -1
- package/dist/tag/attribute/directives/no-update-if.js +2 -1
- package/dist/tag/attribute/directives/no-update.js +2 -1
- package/dist/tag/attribute/directives/style.js +4 -3
- package/dist/tag/attribute/index.js +6 -6
- package/dist/tag/attribute/modifiers/index.js +2 -1
- package/dist/tag/attribute/modifiers/no-update.js +4 -3
- package/dist/tag/attribute/modifiers/scoped.js +4 -3
- package/dist/tag/custom-tag.js +10 -10
- package/dist/tag/dynamic-tag.js +2 -2
- package/dist/tag/index.js +4 -4
- package/dist/tag/native-tag.js +2 -2
- package/dist/tag/native-tag[html]/attributes.js +4 -4
- package/dist/tag/native-tag[html]/index.js +4 -4
- package/dist/tag/native-tag[vdom]/index.js +8 -8
- package/dist/tag/util.js +4 -4
- package/dist/taglib/core/conditional/translate-else.js +2 -2
- package/dist/taglib/core/index.js +140 -138
- package/dist/taglib/core/parse-class.js +4 -4
- package/dist/taglib/core/parse-export.js +4 -4
- package/dist/taglib/core/parse-import.js +4 -4
- package/dist/taglib/core/parse-module-code.js +2 -2
- package/dist/taglib/core/parse-static.js +2 -2
- package/dist/taglib/core/transform-style.js +2 -2
- package/dist/taglib/core/translate-await.js +4 -4
- package/dist/taglib/core/translate-for.js +4 -4
- package/dist/taglib/core/translate-include-content.js +2 -2
- package/dist/taglib/migrate/all-templates.js +2 -1
- package/dist/taglib/migrate/index.js +2 -1
- package/dist/util/add-dependencies.js +4 -4
- package/dist/util/get-component-files.js +2 -2
- package/dist/util/key-manager.js +4 -4
- package/dist/util/optimize-html-writes.js +5 -5
- package/dist/util/optimize-vdom-create.js +9 -9
- package/package.json +4 -4
@@ -24,8 +24,8 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
24
24
|
"node-factory": parseImport,
|
25
25
|
"parse-options": {
|
26
26
|
statement: true,
|
27
|
-
rawOpenTag: true
|
28
|
-
|
27
|
+
rawOpenTag: true
|
28
|
+
},
|
29
29
|
autocomplete: [
|
30
30
|
{
|
31
31
|
displayText: 'import <scope> from "<path>"',
|
@@ -33,16 +33,16 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
33
33
|
"Use to import external modules, follows the same syntax as JavaScript imports.",
|
34
34
|
snippet: 'import ${2} from "${1:path}"',
|
35
35
|
descriptionMoreURL:
|
36
|
-
"https://markojs.com/docs/syntax/#importing-external-files"
|
37
|
-
|
38
|
-
|
36
|
+
"https://markojs.com/docs/syntax/#importing-external-files"
|
37
|
+
}]
|
39
38
|
|
39
|
+
},
|
40
40
|
"<export>": {
|
41
41
|
"node-factory": parseExport,
|
42
42
|
"parse-options": {
|
43
43
|
statement: true,
|
44
|
-
rawOpenTag: true
|
45
|
-
|
44
|
+
rawOpenTag: true
|
45
|
+
},
|
46
46
|
autocomplete: [
|
47
47
|
{
|
48
48
|
displayText: "export <scope>",
|
@@ -50,16 +50,16 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
50
50
|
"Use export additional data with the template, follows the same syntax as JavaScript exports.",
|
51
51
|
snippet: "export ${1}",
|
52
52
|
descriptionMoreURL:
|
53
|
-
"https://markojs.com/docs/syntax/#importing-external-files"
|
54
|
-
|
55
|
-
|
53
|
+
"https://markojs.com/docs/syntax/#importing-external-files"
|
54
|
+
}]
|
56
55
|
|
56
|
+
},
|
57
57
|
"<class>": {
|
58
58
|
"node-factory": parseClass,
|
59
59
|
"parse-options": {
|
60
60
|
statement: true,
|
61
|
-
rawOpenTag: true
|
62
|
-
|
61
|
+
rawOpenTag: true
|
62
|
+
},
|
63
63
|
autocomplete: [
|
64
64
|
{
|
65
65
|
displayText: "class { /** lifecycle methods **/ }",
|
@@ -67,32 +67,32 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
67
67
|
description:
|
68
68
|
"A class containing the lifecycle methods, event handlers, and other properties for this component.",
|
69
69
|
descriptionMoreURL:
|
70
|
-
"https://markojs.com/docs/class-components/#single-file-components"
|
71
|
-
|
72
|
-
|
70
|
+
"https://markojs.com/docs/class-components/#single-file-components"
|
71
|
+
}]
|
73
72
|
|
73
|
+
},
|
74
74
|
"<static>": {
|
75
75
|
"node-factory": parseStatic,
|
76
76
|
"parse-options": {
|
77
77
|
statement: true,
|
78
|
-
rawOpenTag: true
|
79
|
-
|
78
|
+
rawOpenTag: true
|
79
|
+
},
|
80
80
|
autocomplete: [
|
81
81
|
{
|
82
82
|
displayText: "static <statement>",
|
83
83
|
description:
|
84
84
|
"A JavaScript statement which is only evaluated once your template is loaded.",
|
85
|
-
descriptionMoreURL: "https://markojs.com/docs/syntax/#static-javascript"
|
86
|
-
|
87
|
-
|
85
|
+
descriptionMoreURL: "https://markojs.com/docs/syntax/#static-javascript"
|
86
|
+
}]
|
88
87
|
|
88
|
+
},
|
89
89
|
"<style>": {
|
90
90
|
"node-factory": parseStyle,
|
91
91
|
transformer: transformStyle,
|
92
92
|
"parse-options": {
|
93
|
-
rawOpenTag: true
|
94
|
-
|
95
|
-
|
93
|
+
rawOpenTag: true
|
94
|
+
}
|
95
|
+
},
|
96
96
|
"<macro>": {
|
97
97
|
"node-factory": parseMacro,
|
98
98
|
"code-generator": translateMacro,
|
@@ -100,19 +100,19 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
100
100
|
type: "string",
|
101
101
|
autocomplete: [
|
102
102
|
{
|
103
|
-
description: "The name which can be used as a tag within a template."
|
104
|
-
|
105
|
-
|
103
|
+
description: "The name which can be used as a tag within a template."
|
104
|
+
}]
|
106
105
|
|
106
|
+
},
|
107
107
|
autocomplete: [
|
108
108
|
{
|
109
109
|
displayText: 'macro|<params>| name="<name>"',
|
110
110
|
description: "Creates a reusable fragment within the template.",
|
111
111
|
snippet: 'macro|${2:param1, param2}| name="${1:name}"',
|
112
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#macro"
|
113
|
-
|
114
|
-
|
112
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#macro"
|
113
|
+
}]
|
115
114
|
|
115
|
+
},
|
116
116
|
"<include-text>": {
|
117
117
|
"code-generator": translateIncludeContent,
|
118
118
|
attributes: {},
|
@@ -121,10 +121,10 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
121
121
|
displayText: 'include-text("<path>")',
|
122
122
|
description: "Allows you to inline the contents of a text file.",
|
123
123
|
snippet: 'include-text(${1:"./foo.txt"})',
|
124
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#include-text"
|
125
|
-
|
126
|
-
|
124
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#include-text"
|
125
|
+
}]
|
127
126
|
|
127
|
+
},
|
128
128
|
"<include-html>": {
|
129
129
|
"code-generator": translateIncludeContent,
|
130
130
|
attributes: {},
|
@@ -133,10 +133,10 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
133
133
|
displayText: 'include-html("<path>")',
|
134
134
|
snippet: 'include-html(${1:"./foo.html"})',
|
135
135
|
description: "Allows you to inline the contents of an html file.",
|
136
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#include-html"
|
137
|
-
|
138
|
-
|
136
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#include-html"
|
137
|
+
}]
|
139
138
|
|
139
|
+
},
|
140
140
|
"<if>": {
|
141
141
|
"code-generator": translateIf,
|
142
142
|
attributes: {},
|
@@ -145,10 +145,10 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
145
145
|
snippet: "if(${1:condition})",
|
146
146
|
description: "Use to display content only if the condition is meant.",
|
147
147
|
descriptionMoreURL:
|
148
|
-
"https://markojs.com/docs/core-tags/#if-else-if-else"
|
149
|
-
|
150
|
-
|
148
|
+
"https://markojs.com/docs/core-tags/#if-else-if-else"
|
149
|
+
}]
|
151
150
|
|
151
|
+
},
|
152
152
|
"<else-if>": {
|
153
153
|
"code-generator": translateElseIf,
|
154
154
|
attributes: {},
|
@@ -158,10 +158,10 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
158
158
|
description:
|
159
159
|
"Use after an <if> or <else-if> tag to display content if those conditions do not match and this one does.",
|
160
160
|
descriptionMoreURL:
|
161
|
-
"https://markojs.com/docs/core-tags/#if-else-if-else"
|
162
|
-
|
163
|
-
|
161
|
+
"https://markojs.com/docs/core-tags/#if-else-if-else"
|
162
|
+
}]
|
164
163
|
|
164
|
+
},
|
165
165
|
"<else>": {
|
166
166
|
"code-generator": translateElse,
|
167
167
|
attributes: {},
|
@@ -170,74 +170,74 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
170
170
|
description:
|
171
171
|
"Use after an <if> or <else-if> tag to display content if those conditions do not match.",
|
172
172
|
descriptionMoreURL:
|
173
|
-
"https://markojs.com/docs/core-tags/#if-else-if-else"
|
174
|
-
|
175
|
-
|
173
|
+
"https://markojs.com/docs/core-tags/#if-else-if-else"
|
174
|
+
}]
|
176
175
|
|
176
|
+
},
|
177
177
|
"<for>": {
|
178
178
|
"code-generator": translateFor,
|
179
179
|
"@of": {
|
180
180
|
type: "expression",
|
181
181
|
autocomplete: [
|
182
182
|
{
|
183
|
-
description: "Iterates over a list of items."
|
184
|
-
|
185
|
-
|
183
|
+
description: "Iterates over a list of items."
|
184
|
+
}]
|
186
185
|
|
186
|
+
},
|
187
187
|
"@in": {
|
188
188
|
type: "expression",
|
189
189
|
autocomplete: [
|
190
190
|
{
|
191
|
-
description: "Iterates over the keys and values of an object."
|
192
|
-
|
193
|
-
|
191
|
+
description: "Iterates over the keys and values of an object."
|
192
|
+
}]
|
194
193
|
|
194
|
+
},
|
195
195
|
"@to": {
|
196
196
|
type: "number",
|
197
197
|
autocomplete: [
|
198
198
|
{
|
199
|
-
description: "Iterates up to the provided number (inclusive)"
|
200
|
-
|
201
|
-
|
199
|
+
description: "Iterates up to the provided number (inclusive)"
|
200
|
+
}]
|
202
201
|
|
202
|
+
},
|
203
203
|
"@from": {
|
204
204
|
type: "number",
|
205
205
|
autocomplete: [
|
206
206
|
{
|
207
|
-
description: "Iterates starting from the provided number (inclusive)"
|
208
|
-
|
209
|
-
|
207
|
+
description: "Iterates starting from the provided number (inclusive)"
|
208
|
+
}]
|
210
209
|
|
210
|
+
},
|
211
211
|
"@step": {
|
212
212
|
type: "number",
|
213
213
|
autocomplete: [
|
214
214
|
{
|
215
215
|
description:
|
216
|
-
"The amount to increment during each interation (with from/to)"
|
217
|
-
|
218
|
-
|
216
|
+
"The amount to increment during each interation (with from/to)"
|
217
|
+
}]
|
219
218
|
|
219
|
+
},
|
220
220
|
autocomplete: [
|
221
221
|
{
|
222
222
|
snippet: "for|${1:value, index}| of=${3:array}",
|
223
223
|
description:
|
224
224
|
"Use to iterate over lists, object properties, or between ranges.",
|
225
225
|
descriptionMoreURL:
|
226
|
-
"https://markojs.com/docs/core-tags/#iterating-over-a-list"
|
227
|
-
|
226
|
+
"https://markojs.com/docs/core-tags/#iterating-over-a-list"
|
227
|
+
},
|
228
228
|
{
|
229
229
|
snippet: "for|${1:name, value}| in=${3:object}",
|
230
230
|
descriptionMoreURL:
|
231
|
-
"https://markojs.com/docs/core-tags/#iterating-over-an-objects-properties"
|
232
|
-
|
231
|
+
"https://markojs.com/docs/core-tags/#iterating-over-an-objects-properties"
|
232
|
+
},
|
233
233
|
{
|
234
234
|
snippet:
|
235
235
|
"for|${1:index}| from=${2:number} to=${3:number} step=${4:number}",
|
236
236
|
descriptionMoreURL:
|
237
|
-
"https://markojs.com/docs/core-tags/#iterating-between-a-range-of-numbers"
|
238
|
-
|
239
|
-
|
237
|
+
"https://markojs.com/docs/core-tags/#iterating-between-a-range-of-numbers"
|
238
|
+
}]
|
240
239
|
|
240
|
+
},
|
241
241
|
"<while>": {
|
242
242
|
"code-generator": translateWhile,
|
243
243
|
autocomplete: [
|
@@ -245,43 +245,43 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
245
245
|
snippet: "while(${1:condition})",
|
246
246
|
description:
|
247
247
|
"Renders the content multiple times until the condition is no longer met.",
|
248
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#while"
|
249
|
-
|
250
|
-
|
248
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#while"
|
249
|
+
}]
|
251
250
|
|
251
|
+
},
|
252
252
|
"<html-comment>": {
|
253
253
|
"code-generator": translateHTMLComment,
|
254
254
|
"parse-options": {
|
255
|
-
text: true
|
256
|
-
|
255
|
+
text: true
|
256
|
+
},
|
257
257
|
attributes: {},
|
258
258
|
autocomplete: [
|
259
259
|
{
|
260
260
|
description:
|
261
261
|
"Use to create an html comment that is not stripped from the output.",
|
262
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#html-comment"
|
263
|
-
|
264
|
-
|
262
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#html-comment"
|
263
|
+
}]
|
265
264
|
|
265
|
+
},
|
266
266
|
"<_preserve>": {
|
267
267
|
renderer: "marko/src/core-tags/components/preserve-tag",
|
268
268
|
"@n": "boolean",
|
269
269
|
"@i": "boolean",
|
270
270
|
"@b": "boolean",
|
271
|
-
autocomplete: []
|
272
|
-
|
271
|
+
autocomplete: []
|
272
|
+
},
|
273
273
|
"<init-components>": {
|
274
274
|
"code-generator": translateServerOnly,
|
275
275
|
renderer: "marko/src/core-tags/components/init-components-tag.js",
|
276
|
-
"@immediate": "boolean"
|
277
|
-
|
276
|
+
"@immediate": "boolean"
|
277
|
+
},
|
278
278
|
"<_preferred-script-location>": {
|
279
279
|
"code-generator": translateServerOnly,
|
280
|
-
renderer: "marko/src/core-tags/components/preferred-script-location-tag.js"
|
281
|
-
|
280
|
+
renderer: "marko/src/core-tags/components/preferred-script-location-tag.js"
|
281
|
+
},
|
282
282
|
"<body>": {
|
283
|
-
"code-generator": translateBody
|
284
|
-
|
283
|
+
"code-generator": translateBody
|
284
|
+
},
|
285
285
|
"<await>": {
|
286
286
|
renderer: "marko/src/core-tags/core/await/renderer.js",
|
287
287
|
"code-generator": translateAwait,
|
@@ -293,96 +293,95 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
293
293
|
{
|
294
294
|
description:
|
295
295
|
"Used to improve debugging and also to ensure promise ordering with the show-after attribute.",
|
296
|
-
snippet: 'name="${1:name}"'
|
297
|
-
|
298
|
-
|
296
|
+
snippet: 'name="${1:name}"'
|
297
|
+
}]
|
299
298
|
|
299
|
+
},
|
300
300
|
"@timeout": {
|
301
301
|
type: "number",
|
302
302
|
autocomplete: [
|
303
303
|
{
|
304
304
|
description:
|
305
|
-
"An optional timeout that when reached will cause the promise to reject with a TimeoutError."
|
306
|
-
|
307
|
-
|
305
|
+
"An optional timeout that when reached will cause the promise to reject with a TimeoutError."
|
306
|
+
}]
|
308
307
|
|
308
|
+
},
|
309
309
|
"@client-reorder": {
|
310
310
|
type: "boolean",
|
311
311
|
autocomplete: [
|
312
312
|
{
|
313
313
|
description:
|
314
|
-
"If set anything after this promise will be sent out immediately, and reordered using JS in the browser."
|
315
|
-
|
316
|
-
|
314
|
+
"If set anything after this promise will be sent out immediately, and reordered using JS in the browser."
|
315
|
+
}]
|
317
316
|
|
317
|
+
},
|
318
318
|
"@show-after": {
|
319
319
|
type: "string",
|
320
320
|
autocomplete: [
|
321
321
|
{
|
322
322
|
description:
|
323
|
-
"This attribute will ensure that (with client-reorder) this await tag will always show after another await tag with the provided name."
|
324
|
-
|
325
|
-
|
323
|
+
"This attribute will ensure that (with client-reorder) this await tag will always show after another await tag with the provided name."
|
324
|
+
}]
|
326
325
|
|
326
|
+
},
|
327
327
|
"<then>": {
|
328
328
|
autocomplete: [
|
329
329
|
{
|
330
330
|
displayText: "then|<result>|",
|
331
331
|
description: "Executed with the result of the resolved promise.",
|
332
332
|
snippet: "then|${1:result}|",
|
333
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
334
|
-
|
335
|
-
|
333
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
334
|
+
}]
|
336
335
|
|
336
|
+
},
|
337
337
|
"<catch>": {
|
338
338
|
autocomplete: [
|
339
339
|
{
|
340
340
|
displayText: "catch|<err>|",
|
341
341
|
description: "Executed with the err of the rejected promise.",
|
342
342
|
snippet: "catch|${1:err}|",
|
343
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
344
|
-
|
345
|
-
|
343
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
344
|
+
}]
|
346
345
|
|
346
|
+
},
|
347
347
|
"<placeholder>": {
|
348
348
|
autocomplete: [
|
349
349
|
{
|
350
350
|
description: "A placeholder to display while the promise is pending.",
|
351
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
352
|
-
|
353
|
-
|
351
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
352
|
+
}]
|
354
353
|
|
354
|
+
},
|
355
355
|
autocomplete: [
|
356
356
|
{
|
357
357
|
displayText: "await(<promise>)",
|
358
358
|
description:
|
359
359
|
"Used to render a template asynchronously with the results of a Promise",
|
360
360
|
snippet: "await(${1:promise})",
|
361
|
-
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
362
|
-
|
363
|
-
|
361
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
362
|
+
}]
|
364
363
|
|
364
|
+
},
|
365
365
|
"<await-reorderer>": {
|
366
366
|
"code-generator": translateServerOnly,
|
367
367
|
renderer: "marko/src/core-tags/core/await/reorderer-renderer.js",
|
368
368
|
autocomplete: [
|
369
369
|
{
|
370
370
|
snippet: "await-reorderer",
|
371
|
-
descriptionMoreURL:
|
372
|
-
|
373
|
-
|
374
|
-
|
371
|
+
descriptionMoreURL: "https://markojs.com/docs/core-tags/#await"
|
372
|
+
}]
|
375
373
|
|
374
|
+
},
|
376
375
|
"<__flush_here_and_after__>": {
|
377
376
|
"code-generator": translateServerOnly,
|
378
|
-
renderer: "marko/src/core-tags/core/__flush_here_and_after__.js"
|
379
|
-
|
377
|
+
renderer: "marko/src/core-tags/core/__flush_here_and_after__.js"
|
378
|
+
},
|
380
379
|
"<module-code>": {
|
381
380
|
"node-factory": parseModuleCode,
|
382
381
|
"parse-options": {
|
383
|
-
rawOpenTag: true
|
384
|
-
|
385
|
-
|
382
|
+
rawOpenTag: true
|
383
|
+
}
|
384
|
+
},
|
386
385
|
"<*>": {
|
387
386
|
"@key": {
|
388
387
|
type: "string",
|
@@ -391,15 +390,13 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
391
390
|
{
|
392
391
|
displayText: 'key="<method>"',
|
393
392
|
snippet: 'key="${1:method}"',
|
394
|
-
descriptionMoreURL:
|
395
|
-
|
396
|
-
|
393
|
+
descriptionMoreURL: "https://markojs.com/docs/class-components/#key"
|
394
|
+
},
|
397
395
|
{
|
398
|
-
descriptionMoreURL:
|
399
|
-
|
400
|
-
|
401
|
-
|
396
|
+
descriptionMoreURL: "https://markojs.com/docs/class-components/#key"
|
397
|
+
}]
|
402
398
|
|
399
|
+
},
|
403
400
|
"@on*": {
|
404
401
|
pattern: true,
|
405
402
|
type: "statement",
|
@@ -411,10 +408,10 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
411
408
|
displayText: 'on<event>("<method>")',
|
412
409
|
snippet: 'on${1:Click}("handle${2:Button}${1:Click}")',
|
413
410
|
descriptionMoreURL:
|
414
|
-
"https://markojs.com/docs/components/#attaching-dom-event-listeners"
|
415
|
-
|
416
|
-
|
411
|
+
"https://markojs.com/docs/components/#attaching-dom-event-listeners"
|
412
|
+
}]
|
417
413
|
|
414
|
+
},
|
418
415
|
"@once*": {
|
419
416
|
pattern: true,
|
420
417
|
type: "statement",
|
@@ -425,43 +422,48 @@ var parseModuleCode = _interopRequireWildcard(require("./parse-module-code"));fu
|
|
425
422
|
displayText: 'once<event>("<method>")',
|
426
423
|
snippet: 'once${1:Click}("handle${2:Button}${1:Click}")',
|
427
424
|
descriptionMoreURL:
|
428
|
-
"https://markojs.com/docs/components/#attaching-dom-event-listeners"
|
429
|
-
|
430
|
-
|
425
|
+
"https://markojs.com/docs/components/#attaching-dom-event-listeners"
|
426
|
+
}
|
427
|
+
},
|
431
428
|
"@no-update": {
|
432
429
|
type: "flag",
|
433
430
|
"preserve-name": true,
|
434
431
|
autocomplete: [
|
435
432
|
{
|
436
433
|
descriptionMoreURL:
|
437
|
-
"
|
438
|
-
|
439
|
-
|
434
|
+
"https://markojs.com/docs/class-components/#no-update"
|
435
|
+
}]
|
440
436
|
|
437
|
+
},
|
441
438
|
"@no-update-body": {
|
442
439
|
type: "flag",
|
443
440
|
"preserve-name": true,
|
444
441
|
autocomplete: [
|
445
442
|
{
|
446
443
|
descriptionMoreURL:
|
447
|
-
"
|
448
|
-
|
449
|
-
|
444
|
+
"https://markojs.com/docs/class-components/#no-update-body"
|
445
|
+
}]
|
450
446
|
|
447
|
+
},
|
451
448
|
"@no-update-if": {
|
452
449
|
"preserve-name": true,
|
453
450
|
autocomplete: [
|
454
451
|
{
|
455
452
|
snippet: "no-update-if(${1:condition})",
|
456
453
|
descriptionMoreURL:
|
457
|
-
"
|
458
|
-
|
459
|
-
|
454
|
+
"https://markojs.com/docs/class-components/#no-update-if"
|
455
|
+
}]
|
460
456
|
|
457
|
+
},
|
461
458
|
"@no-update-body-if": {
|
462
459
|
"preserve-name": true,
|
463
460
|
autocomplete: [
|
464
461
|
{
|
465
462
|
snippet: "no-update-body-if(${1:condition})",
|
466
463
|
descriptionMoreURL:
|
467
|
-
"
|
464
|
+
"https://markojs.com/docs/class-components/#no-update-body-if"
|
465
|
+
}]
|
466
|
+
|
467
|
+
}
|
468
|
+
}
|
469
|
+
};exports.default = _default;
|
@@ -5,12 +5,12 @@ var _getComponentFiles = _interopRequireDefault(require("../../util/get-componen
|
|
5
5
|
function _default(path) {
|
6
6
|
const {
|
7
7
|
node,
|
8
|
-
hub: { file }
|
9
|
-
path;
|
8
|
+
hub: { file }
|
9
|
+
} = path;
|
10
10
|
const {
|
11
11
|
rawValue: code,
|
12
|
-
name: { start }
|
13
|
-
node;
|
12
|
+
name: { start }
|
13
|
+
} = node;
|
14
14
|
const meta = file.metadata.marko;
|
15
15
|
|
16
16
|
if ((0, _getComponentFiles.default)(path).componentFile) {
|
@@ -3,12 +3,12 @@
|
|
3
3
|
function _default(path) {
|
4
4
|
const {
|
5
5
|
node,
|
6
|
-
hub: { file }
|
7
|
-
path;
|
6
|
+
hub: { file }
|
7
|
+
} = path;
|
8
8
|
const {
|
9
9
|
rawValue,
|
10
|
-
name: { start }
|
11
|
-
node;
|
10
|
+
name: { start }
|
11
|
+
} = node;
|
12
12
|
const [exportNode] = (0, _babelUtils.parseScript)(file, rawValue, start).body;
|
13
13
|
path.replaceWith(exportNode);
|
14
14
|
}
|
@@ -3,12 +3,12 @@
|
|
3
3
|
function _default(path) {
|
4
4
|
const {
|
5
5
|
node,
|
6
|
-
hub: { file }
|
7
|
-
path;
|
6
|
+
hub: { file }
|
7
|
+
} = path;
|
8
8
|
const {
|
9
9
|
rawValue,
|
10
|
-
name: { start }
|
11
|
-
node;
|
10
|
+
name: { start }
|
11
|
+
} = node;
|
12
12
|
const [importNode] = (0, _babelUtils.parseScript)(file, rawValue, start).body;
|
13
13
|
path.replaceWith(importNode);
|
14
14
|
}
|
@@ -7,8 +7,8 @@ const startOffset = "module-code".length;
|
|
7
7
|
function _default(tag) {
|
8
8
|
const {
|
9
9
|
hub: { file },
|
10
|
-
node: { rawValue }
|
11
|
-
tag;
|
10
|
+
node: { rawValue }
|
11
|
+
} = tag;
|
12
12
|
const dirname = _path.default.dirname(file.opts.filename);
|
13
13
|
const relativeRequire = (entry) =>
|
14
14
|
_modules.default.require((0, _resolveFrom.default)(dirname, entry));
|
@@ -4,8 +4,8 @@ var _babelUtils = require("@marko/babel-utils");
|
|
4
4
|
function _default(path) {
|
5
5
|
const {
|
6
6
|
node,
|
7
|
-
hub: { file }
|
8
|
-
path;
|
7
|
+
hub: { file }
|
8
|
+
} = path;
|
9
9
|
const { rawValue } = node;
|
10
10
|
const code = rawValue.replace(/^static\s*/, "").trim();
|
11
11
|
const start = node.name.start + (rawValue.length - code.length);
|
@@ -11,11 +11,11 @@ function enter(path) {
|
|
11
11
|
|
12
12
|
} else if (args.length > 1) {
|
13
13
|
const {
|
14
|
-
loc: { start }
|
15
|
-
args[1].node;
|
14
|
+
loc: { start }
|
15
|
+
} = args[1].node;
|
16
16
|
const {
|
17
|
-
loc: { end }
|
18
|
-
args[args.length - 1].node;
|
17
|
+
loc: { end }
|
18
|
+
} = args[args.length - 1].node;
|
19
19
|
throw path.hub.file.buildCodeFrameError(
|
20
20
|
{ loc: { start, end } },
|
21
21
|
'You can only pass one argument to the "<await>" tag.');
|