@vue/compiler-dom 3.6.0-beta.4 → 3.6.0-beta.6
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-dom.cjs.js +651 -832
- package/dist/compiler-dom.cjs.prod.js +630 -795
- package/dist/compiler-dom.d.ts +43 -35
- package/dist/compiler-dom.esm-browser.js +4490 -6180
- package/dist/compiler-dom.esm-browser.prod.js +10 -13
- package/dist/compiler-dom.esm-bundler.js +482 -620
- package/dist/compiler-dom.global.js +5172 -6862
- package/dist/compiler-dom.global.prod.js +10 -13
- package/package.json +3 -3
package/dist/compiler-dom.cjs.js
CHANGED
|
@@ -1,920 +1,736 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-dom v3.6.0-beta.
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/
|
|
6
|
-
'
|
|
2
|
+
* @vue/compiler-dom v3.6.0-beta.6
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/
|
|
6
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
7
|
+
let _vue_compiler_core = require("@vue/compiler-core");
|
|
8
|
+
let _vue_shared = require("@vue/shared");
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
);
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const V_SHOW = /* @__PURE__ */ Symbol(`vShow` );
|
|
31
|
-
const TRANSITION = /* @__PURE__ */ Symbol(`Transition` );
|
|
32
|
-
const TRANSITION_GROUP = /* @__PURE__ */ Symbol(
|
|
33
|
-
`TransitionGroup`
|
|
34
|
-
);
|
|
35
|
-
compilerCore.registerRuntimeHelpers({
|
|
36
|
-
[V_MODEL_RADIO]: `vModelRadio`,
|
|
37
|
-
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
|
|
38
|
-
[V_MODEL_TEXT]: `vModelText`,
|
|
39
|
-
[V_MODEL_SELECT]: `vModelSelect`,
|
|
40
|
-
[V_MODEL_DYNAMIC]: `vModelDynamic`,
|
|
41
|
-
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
|
42
|
-
[V_ON_WITH_KEYS]: `withKeys`,
|
|
43
|
-
[V_SHOW]: `vShow`,
|
|
44
|
-
[TRANSITION]: `Transition`,
|
|
45
|
-
[TRANSITION_GROUP]: `TransitionGroup`
|
|
10
|
+
//#region packages/compiler-dom/src/runtimeHelpers.ts
|
|
11
|
+
const V_MODEL_RADIO = Symbol(`vModelRadio`);
|
|
12
|
+
const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox`);
|
|
13
|
+
const V_MODEL_TEXT = Symbol(`vModelText`);
|
|
14
|
+
const V_MODEL_SELECT = Symbol(`vModelSelect`);
|
|
15
|
+
const V_MODEL_DYNAMIC = Symbol(`vModelDynamic`);
|
|
16
|
+
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard`);
|
|
17
|
+
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard`);
|
|
18
|
+
const V_SHOW = Symbol(`vShow`);
|
|
19
|
+
const TRANSITION = Symbol(`Transition`);
|
|
20
|
+
const TRANSITION_GROUP = Symbol(`TransitionGroup`);
|
|
21
|
+
(0, _vue_compiler_core.registerRuntimeHelpers)({
|
|
22
|
+
[V_MODEL_RADIO]: `vModelRadio`,
|
|
23
|
+
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
|
|
24
|
+
[V_MODEL_TEXT]: `vModelText`,
|
|
25
|
+
[V_MODEL_SELECT]: `vModelSelect`,
|
|
26
|
+
[V_MODEL_DYNAMIC]: `vModelDynamic`,
|
|
27
|
+
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
|
28
|
+
[V_ON_WITH_KEYS]: `withKeys`,
|
|
29
|
+
[V_SHOW]: `vShow`,
|
|
30
|
+
[TRANSITION]: `Transition`,
|
|
31
|
+
[TRANSITION_GROUP]: `TransitionGroup`
|
|
46
32
|
});
|
|
47
33
|
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region packages/compiler-dom/src/parserOptions.ts
|
|
48
36
|
const parserOptions = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
|
|
76
|
-
ns = 0;
|
|
77
|
-
}
|
|
78
|
-
} else if (parent && ns === 1) {
|
|
79
|
-
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
|
|
80
|
-
ns = 0;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (ns === 0) {
|
|
84
|
-
if (shared.isSVGTag(tag)) {
|
|
85
|
-
return 1;
|
|
86
|
-
}
|
|
87
|
-
if (shared.isMathMLTag(tag)) {
|
|
88
|
-
return 2;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return ns;
|
|
92
|
-
}
|
|
37
|
+
parseMode: "html",
|
|
38
|
+
isVoidTag: _vue_shared.isVoidTag,
|
|
39
|
+
isNativeTag: (tag) => (0, _vue_shared.isHTMLTag)(tag) || (0, _vue_shared.isSVGTag)(tag) || (0, _vue_shared.isMathMLTag)(tag),
|
|
40
|
+
isPreTag: (tag) => tag === "pre",
|
|
41
|
+
isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
|
|
42
|
+
decodeEntities: void 0,
|
|
43
|
+
isBuiltInComponent: (tag) => {
|
|
44
|
+
if (tag === "Transition" || tag === "transition") return TRANSITION;
|
|
45
|
+
else if (tag === "TransitionGroup" || tag === "transition-group") return TRANSITION_GROUP;
|
|
46
|
+
},
|
|
47
|
+
getNamespace(tag, parent, rootNamespace) {
|
|
48
|
+
let ns = parent ? parent.ns : rootNamespace;
|
|
49
|
+
if (parent && ns === 2) {
|
|
50
|
+
if (parent.tag === "annotation-xml") {
|
|
51
|
+
if ((0, _vue_shared.isSVGTag)(tag)) return 1;
|
|
52
|
+
if (parent.props.some((a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml"))) ns = 0;
|
|
53
|
+
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") ns = 0;
|
|
54
|
+
} else if (parent && ns === 1) {
|
|
55
|
+
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") ns = 0;
|
|
56
|
+
}
|
|
57
|
+
if (ns === 0) {
|
|
58
|
+
if ((0, _vue_shared.isSVGTag)(tag)) return 1;
|
|
59
|
+
if ((0, _vue_shared.isMathMLTag)(tag)) return 2;
|
|
60
|
+
}
|
|
61
|
+
return ns;
|
|
62
|
+
}
|
|
93
63
|
};
|
|
94
64
|
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region packages/compiler-dom/src/transforms/transformStyle.ts
|
|
95
67
|
const transformStyle = (node) => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
68
|
+
if (node.type === 1) node.props.forEach((p, i) => {
|
|
69
|
+
if (p.type === 6 && p.name === "style" && p.value) node.props[i] = {
|
|
70
|
+
type: 7,
|
|
71
|
+
name: `bind`,
|
|
72
|
+
arg: (0, _vue_compiler_core.createSimpleExpression)(`style`, true, p.loc),
|
|
73
|
+
exp: parseInlineCSS(p.value.content, p.loc),
|
|
74
|
+
modifiers: [],
|
|
75
|
+
loc: p.loc
|
|
76
|
+
};
|
|
77
|
+
});
|
|
110
78
|
};
|
|
111
79
|
const parseInlineCSS = (cssText, loc) => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
JSON.stringify(normalized),
|
|
115
|
-
false,
|
|
116
|
-
loc,
|
|
117
|
-
3
|
|
118
|
-
);
|
|
80
|
+
const normalized = (0, _vue_shared.parseStringStyle)(cssText);
|
|
81
|
+
return (0, _vue_compiler_core.createSimpleExpression)(JSON.stringify(normalized), false, loc, 3);
|
|
119
82
|
};
|
|
120
83
|
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region packages/compiler-dom/src/errors.ts
|
|
121
86
|
function createDOMCompilerError(code, loc) {
|
|
122
|
-
|
|
123
|
-
code,
|
|
124
|
-
loc,
|
|
125
|
-
DOMErrorMessages
|
|
126
|
-
);
|
|
87
|
+
return (0, _vue_compiler_core.createCompilerError)(code, loc, DOMErrorMessages);
|
|
127
88
|
}
|
|
128
89
|
const DOMErrorCodes = {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
90
|
+
"X_V_HTML_NO_EXPRESSION": 54,
|
|
91
|
+
"54": "X_V_HTML_NO_EXPRESSION",
|
|
92
|
+
"X_V_HTML_WITH_CHILDREN": 55,
|
|
93
|
+
"55": "X_V_HTML_WITH_CHILDREN",
|
|
94
|
+
"X_V_TEXT_NO_EXPRESSION": 56,
|
|
95
|
+
"56": "X_V_TEXT_NO_EXPRESSION",
|
|
96
|
+
"X_V_TEXT_WITH_CHILDREN": 57,
|
|
97
|
+
"57": "X_V_TEXT_WITH_CHILDREN",
|
|
98
|
+
"X_V_MODEL_ON_INVALID_ELEMENT": 58,
|
|
99
|
+
"58": "X_V_MODEL_ON_INVALID_ELEMENT",
|
|
100
|
+
"X_V_MODEL_ARG_ON_ELEMENT": 59,
|
|
101
|
+
"59": "X_V_MODEL_ARG_ON_ELEMENT",
|
|
102
|
+
"X_V_MODEL_ON_FILE_INPUT_ELEMENT": 60,
|
|
103
|
+
"60": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
|
|
104
|
+
"X_V_MODEL_UNNECESSARY_VALUE": 61,
|
|
105
|
+
"61": "X_V_MODEL_UNNECESSARY_VALUE",
|
|
106
|
+
"X_V_SHOW_NO_EXPRESSION": 62,
|
|
107
|
+
"62": "X_V_SHOW_NO_EXPRESSION",
|
|
108
|
+
"X_TRANSITION_INVALID_CHILDREN": 63,
|
|
109
|
+
"63": "X_TRANSITION_INVALID_CHILDREN",
|
|
110
|
+
"X_IGNORED_SIDE_EFFECT_TAG": 64,
|
|
111
|
+
"64": "X_IGNORED_SIDE_EFFECT_TAG",
|
|
112
|
+
"__EXTEND_POINT__": 65,
|
|
113
|
+
"65": "__EXTEND_POINT__"
|
|
153
114
|
};
|
|
154
115
|
const DOMErrorMessages = {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
[65]: ``
|
|
116
|
+
[54]: `v-html is missing expression.`,
|
|
117
|
+
[55]: `v-html will override element children.`,
|
|
118
|
+
[56]: `v-text is missing expression.`,
|
|
119
|
+
[57]: `v-text will override element children.`,
|
|
120
|
+
[58]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
121
|
+
[59]: `v-model argument is not supported on plain elements.`,
|
|
122
|
+
[60]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
123
|
+
[61]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
124
|
+
[62]: `v-show is missing expression.`,
|
|
125
|
+
[63]: `<Transition> expects exactly one child element or component.`,
|
|
126
|
+
[64]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`,
|
|
127
|
+
[65]: ``
|
|
168
128
|
};
|
|
169
129
|
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region packages/compiler-dom/src/transforms/vHtml.ts
|
|
170
132
|
const transformVHtml = (dir, node, context) => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
context.onError(
|
|
179
|
-
createDOMCompilerError(55, loc)
|
|
180
|
-
);
|
|
181
|
-
node.children.length = 0;
|
|
182
|
-
}
|
|
183
|
-
return {
|
|
184
|
-
props: [
|
|
185
|
-
compilerCore.createObjectProperty(
|
|
186
|
-
compilerCore.createSimpleExpression(`innerHTML`, true, loc),
|
|
187
|
-
exp || compilerCore.createSimpleExpression("", true)
|
|
188
|
-
)
|
|
189
|
-
]
|
|
190
|
-
};
|
|
133
|
+
const { exp, loc } = dir;
|
|
134
|
+
if (!exp) context.onError(createDOMCompilerError(54, loc));
|
|
135
|
+
if (node.children.length) {
|
|
136
|
+
context.onError(createDOMCompilerError(55, loc));
|
|
137
|
+
node.children.length = 0;
|
|
138
|
+
}
|
|
139
|
+
return { props: [(0, _vue_compiler_core.createObjectProperty)((0, _vue_compiler_core.createSimpleExpression)(`innerHTML`, true, loc), exp || (0, _vue_compiler_core.createSimpleExpression)("", true))] };
|
|
191
140
|
};
|
|
192
141
|
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region packages/compiler-dom/src/transforms/vText.ts
|
|
193
144
|
const transformVText = (dir, node, context) => {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
context.onError(
|
|
202
|
-
createDOMCompilerError(57, loc)
|
|
203
|
-
);
|
|
204
|
-
node.children.length = 0;
|
|
205
|
-
}
|
|
206
|
-
return {
|
|
207
|
-
props: [
|
|
208
|
-
compilerCore.createObjectProperty(
|
|
209
|
-
compilerCore.createSimpleExpression(`textContent`, true),
|
|
210
|
-
exp ? compilerCore.getConstantType(exp, context) > 0 ? exp : compilerCore.createCallExpression(
|
|
211
|
-
context.helperString(compilerCore.TO_DISPLAY_STRING),
|
|
212
|
-
[exp],
|
|
213
|
-
loc
|
|
214
|
-
) : compilerCore.createSimpleExpression("", true)
|
|
215
|
-
)
|
|
216
|
-
]
|
|
217
|
-
};
|
|
145
|
+
const { exp, loc } = dir;
|
|
146
|
+
if (!exp) context.onError(createDOMCompilerError(56, loc));
|
|
147
|
+
if (node.children.length) {
|
|
148
|
+
context.onError(createDOMCompilerError(57, loc));
|
|
149
|
+
node.children.length = 0;
|
|
150
|
+
}
|
|
151
|
+
return { props: [(0, _vue_compiler_core.createObjectProperty)((0, _vue_compiler_core.createSimpleExpression)(`textContent`, true), exp ? (0, _vue_compiler_core.getConstantType)(exp, context) > 0 ? exp : (0, _vue_compiler_core.createCallExpression)(context.helperString(_vue_compiler_core.TO_DISPLAY_STRING), [exp], loc) : (0, _vue_compiler_core.createSimpleExpression)("", true))] };
|
|
218
152
|
};
|
|
219
153
|
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region packages/compiler-dom/src/transforms/vModel.ts
|
|
220
156
|
const transformModel = (dir, node, context) => {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
directiveToUse = V_MODEL_CHECKBOX;
|
|
261
|
-
break;
|
|
262
|
-
case "file":
|
|
263
|
-
isInvalidType = true;
|
|
264
|
-
context.onError(
|
|
265
|
-
createDOMCompilerError(
|
|
266
|
-
60,
|
|
267
|
-
dir.loc
|
|
268
|
-
)
|
|
269
|
-
);
|
|
270
|
-
break;
|
|
271
|
-
default:
|
|
272
|
-
checkDuplicatedValue();
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
} else if (compilerCore.hasDynamicKeyVBind(node)) {
|
|
277
|
-
directiveToUse = V_MODEL_DYNAMIC;
|
|
278
|
-
} else {
|
|
279
|
-
checkDuplicatedValue();
|
|
280
|
-
}
|
|
281
|
-
} else if (tag === "select") {
|
|
282
|
-
directiveToUse = V_MODEL_SELECT;
|
|
283
|
-
} else {
|
|
284
|
-
checkDuplicatedValue();
|
|
285
|
-
}
|
|
286
|
-
if (!isInvalidType) {
|
|
287
|
-
baseResult.needRuntime = context.helper(directiveToUse);
|
|
288
|
-
}
|
|
289
|
-
} else {
|
|
290
|
-
context.onError(
|
|
291
|
-
createDOMCompilerError(
|
|
292
|
-
58,
|
|
293
|
-
dir.loc
|
|
294
|
-
)
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
baseResult.props = baseResult.props.filter(
|
|
298
|
-
(p) => !(p.key.type === 4 && p.key.content === "modelValue")
|
|
299
|
-
);
|
|
300
|
-
return baseResult;
|
|
157
|
+
const baseResult = (0, _vue_compiler_core.transformModel)(dir, node, context);
|
|
158
|
+
if (!baseResult.props.length || node.tagType === 1) return baseResult;
|
|
159
|
+
if (dir.arg) context.onError(createDOMCompilerError(59, dir.arg.loc));
|
|
160
|
+
function checkDuplicatedValue() {
|
|
161
|
+
const value = (0, _vue_compiler_core.findDir)(node, "bind");
|
|
162
|
+
if (value && (0, _vue_compiler_core.isStaticArgOf)(value.arg, "value")) context.onError(createDOMCompilerError(61, value.loc));
|
|
163
|
+
}
|
|
164
|
+
const { tag } = node;
|
|
165
|
+
const isCustomElement = context.isCustomElement(tag);
|
|
166
|
+
if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
|
|
167
|
+
let directiveToUse = V_MODEL_TEXT;
|
|
168
|
+
let isInvalidType = false;
|
|
169
|
+
if (tag === "input" || isCustomElement) {
|
|
170
|
+
const type = (0, _vue_compiler_core.findProp)(node, `type`);
|
|
171
|
+
if (type) {
|
|
172
|
+
if (type.type === 7) directiveToUse = V_MODEL_DYNAMIC;
|
|
173
|
+
else if (type.value) switch (type.value.content) {
|
|
174
|
+
case "radio":
|
|
175
|
+
directiveToUse = V_MODEL_RADIO;
|
|
176
|
+
break;
|
|
177
|
+
case "checkbox":
|
|
178
|
+
directiveToUse = V_MODEL_CHECKBOX;
|
|
179
|
+
break;
|
|
180
|
+
case "file":
|
|
181
|
+
isInvalidType = true;
|
|
182
|
+
context.onError(createDOMCompilerError(60, dir.loc));
|
|
183
|
+
break;
|
|
184
|
+
default:
|
|
185
|
+
checkDuplicatedValue();
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
} else if ((0, _vue_compiler_core.hasDynamicKeyVBind)(node)) directiveToUse = V_MODEL_DYNAMIC;
|
|
189
|
+
else checkDuplicatedValue();
|
|
190
|
+
} else if (tag === "select") directiveToUse = V_MODEL_SELECT;
|
|
191
|
+
else checkDuplicatedValue();
|
|
192
|
+
if (!isInvalidType) baseResult.needRuntime = context.helper(directiveToUse);
|
|
193
|
+
} else context.onError(createDOMCompilerError(58, dir.loc));
|
|
194
|
+
baseResult.props = baseResult.props.filter((p) => !(p.key.type === 4 && p.key.content === "modelValue"));
|
|
195
|
+
return baseResult;
|
|
301
196
|
};
|
|
302
197
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
);
|
|
308
|
-
const
|
|
309
|
-
const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(
|
|
310
|
-
`onkeyup,onkeydown,onkeypress`
|
|
311
|
-
);
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region packages/compiler-dom/src/transforms/vOn.ts
|
|
200
|
+
const isEventOptionModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)(`passive,once,capture`);
|
|
201
|
+
const isNonKeyModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
|
|
202
|
+
const maybeKeyModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)("left,right");
|
|
203
|
+
const isKeyboardEvent = /* @__PURE__ */ (0, _vue_shared.makeMap)(`onkeyup,onkeydown,onkeypress`);
|
|
312
204
|
const resolveModifiers = (key, modifiers, context, loc) => {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
nonKeyModifiers.push(modifier);
|
|
338
|
-
}
|
|
339
|
-
} else {
|
|
340
|
-
if (isNonKeyModifier(modifier)) {
|
|
341
|
-
nonKeyModifiers.push(modifier);
|
|
342
|
-
} else {
|
|
343
|
-
keyModifiers.push(modifier);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
return {
|
|
349
|
-
keyModifiers,
|
|
350
|
-
nonKeyModifiers,
|
|
351
|
-
eventOptionModifiers
|
|
352
|
-
};
|
|
205
|
+
const keyModifiers = [];
|
|
206
|
+
const nonKeyModifiers = [];
|
|
207
|
+
const eventOptionModifiers = [];
|
|
208
|
+
for (let i = 0; i < modifiers.length; i++) {
|
|
209
|
+
const modifier = modifiers[i].content;
|
|
210
|
+
if (modifier === "native" && context && (0, _vue_compiler_core.checkCompatEnabled)("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
|
|
211
|
+
else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
|
|
212
|
+
else {
|
|
213
|
+
const keyString = (0, _vue_shared.isString)(key) ? key : (0, _vue_compiler_core.isStaticExp)(key) ? key.content : null;
|
|
214
|
+
if (maybeKeyModifier(modifier)) if (keyString) if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
|
|
215
|
+
else nonKeyModifiers.push(modifier);
|
|
216
|
+
else {
|
|
217
|
+
keyModifiers.push(modifier);
|
|
218
|
+
nonKeyModifiers.push(modifier);
|
|
219
|
+
}
|
|
220
|
+
else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
|
|
221
|
+
else keyModifiers.push(modifier);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
keyModifiers,
|
|
226
|
+
nonKeyModifiers,
|
|
227
|
+
eventOptionModifiers
|
|
228
|
+
};
|
|
353
229
|
};
|
|
354
230
|
const transformClick = (key, event) => {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
]) : key;
|
|
231
|
+
return (0, _vue_compiler_core.isStaticExp)(key) && key.content.toLowerCase() === "onclick" ? (0, _vue_compiler_core.createSimpleExpression)(event, true) : key.type !== 4 ? (0, _vue_compiler_core.createCompoundExpression)([
|
|
232
|
+
`(`,
|
|
233
|
+
key,
|
|
234
|
+
`) === "onClick" ? "${event}" : (`,
|
|
235
|
+
key,
|
|
236
|
+
`)`
|
|
237
|
+
]) : key;
|
|
363
238
|
};
|
|
364
239
|
const transformOn = (dir, node, context) => {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
|
|
385
|
-
handlerExp,
|
|
386
|
-
JSON.stringify(keyModifiers)
|
|
387
|
-
]);
|
|
388
|
-
}
|
|
389
|
-
if (eventOptionModifiers.length) {
|
|
390
|
-
const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join("");
|
|
391
|
-
key = compilerCore.isStaticExp(key) ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true) : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
|
|
392
|
-
}
|
|
393
|
-
return {
|
|
394
|
-
props: [compilerCore.createObjectProperty(key, handlerExp)]
|
|
395
|
-
};
|
|
396
|
-
});
|
|
240
|
+
return (0, _vue_compiler_core.transformOn)(dir, node, context, (baseResult) => {
|
|
241
|
+
const { modifiers } = dir;
|
|
242
|
+
if (!modifiers.length) return baseResult;
|
|
243
|
+
let { key, value: handlerExp } = baseResult.props[0];
|
|
244
|
+
const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
|
|
245
|
+
if (nonKeyModifiers.includes("right")) key = transformClick(key, `onContextmenu`);
|
|
246
|
+
if (nonKeyModifiers.includes("middle")) key = transformClick(key, `onMouseup`);
|
|
247
|
+
if (nonKeyModifiers.length) handlerExp = (0, _vue_compiler_core.createCallExpression)(context.helper(V_ON_WITH_MODIFIERS), [handlerExp, JSON.stringify(nonKeyModifiers)]);
|
|
248
|
+
if (keyModifiers.length && (!(0, _vue_compiler_core.isStaticExp)(key) || isKeyboardEvent(key.content.toLowerCase()))) handlerExp = (0, _vue_compiler_core.createCallExpression)(context.helper(V_ON_WITH_KEYS), [handlerExp, JSON.stringify(keyModifiers)]);
|
|
249
|
+
if (eventOptionModifiers.length) {
|
|
250
|
+
const modifierPostfix = eventOptionModifiers.map(_vue_shared.capitalize).join("");
|
|
251
|
+
key = (0, _vue_compiler_core.isStaticExp)(key) ? (0, _vue_compiler_core.createSimpleExpression)(`${key.content}${modifierPostfix}`, true) : (0, _vue_compiler_core.createCompoundExpression)([
|
|
252
|
+
`(`,
|
|
253
|
+
key,
|
|
254
|
+
`) + "${modifierPostfix}"`
|
|
255
|
+
]);
|
|
256
|
+
}
|
|
257
|
+
return { props: [(0, _vue_compiler_core.createObjectProperty)(key, handlerExp)] };
|
|
258
|
+
});
|
|
397
259
|
};
|
|
398
260
|
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region packages/compiler-dom/src/transforms/vShow.ts
|
|
399
263
|
const transformShow = (dir, node, context) => {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
return {
|
|
407
|
-
props: [],
|
|
408
|
-
needRuntime: context.helper(V_SHOW)
|
|
409
|
-
};
|
|
264
|
+
const { exp, loc } = dir;
|
|
265
|
+
if (!exp) context.onError(createDOMCompilerError(62, loc));
|
|
266
|
+
return {
|
|
267
|
+
props: [],
|
|
268
|
+
needRuntime: context.helper(V_SHOW)
|
|
269
|
+
};
|
|
410
270
|
};
|
|
411
271
|
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region packages/compiler-dom/src/transforms/Transition.ts
|
|
412
274
|
const transformTransition = (node, context) => {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
return postTransformTransition(node, context.onError);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
275
|
+
if (node.type === 1 && node.tagType === 1) {
|
|
276
|
+
if (context.isBuiltInComponent(node.tag) === TRANSITION) return postTransformTransition(node, context.onError);
|
|
277
|
+
}
|
|
419
278
|
};
|
|
420
279
|
function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
type: 6,
|
|
440
|
-
name: "persisted",
|
|
441
|
-
nameLoc: node.loc,
|
|
442
|
-
value: void 0,
|
|
443
|
-
loc: node.loc
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
};
|
|
280
|
+
return () => {
|
|
281
|
+
if (!node.children.length) return;
|
|
282
|
+
if (hasMultipleChildren(node)) onError(createDOMCompilerError(63, {
|
|
283
|
+
start: node.children[0].loc.start,
|
|
284
|
+
end: node.children[node.children.length - 1].loc.end,
|
|
285
|
+
source: ""
|
|
286
|
+
}));
|
|
287
|
+
const child = node.children[0];
|
|
288
|
+
if (child.type === 1) {
|
|
289
|
+
for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
|
|
290
|
+
type: 6,
|
|
291
|
+
name: "persisted",
|
|
292
|
+
nameLoc: node.loc,
|
|
293
|
+
value: void 0,
|
|
294
|
+
loc: node.loc
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
};
|
|
449
298
|
}
|
|
450
299
|
function defaultHasMultipleChildren(node) {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const child = children[0];
|
|
455
|
-
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
|
|
300
|
+
const children = node.children = node.children.filter((c) => !(0, _vue_compiler_core.isCommentOrWhitespace)(c));
|
|
301
|
+
const child = children[0];
|
|
302
|
+
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
|
|
456
303
|
}
|
|
457
304
|
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region packages/compiler-dom/src/transforms/stringifyStatic.ts
|
|
307
|
+
/**
|
|
308
|
+
* This module is Node-only.
|
|
309
|
+
*/
|
|
310
|
+
/**
|
|
311
|
+
* Regex for replacing placeholders for embedded constant variables
|
|
312
|
+
* (e.g. import URL string constants generated by compiler-sfc)
|
|
313
|
+
*/
|
|
458
314
|
const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
|
|
315
|
+
/**
|
|
316
|
+
* Turn eligible hoisted static trees into stringified static nodes, e.g.
|
|
317
|
+
*
|
|
318
|
+
* ```js
|
|
319
|
+
* const _hoisted_1 = createStaticVNode(`<div class="foo">bar</div>`)
|
|
320
|
+
* ```
|
|
321
|
+
*
|
|
322
|
+
* A single static vnode can contain stringified content for **multiple**
|
|
323
|
+
* consecutive nodes (element and plain text), called a "chunk".
|
|
324
|
+
* `@vue/runtime-dom` will create the content via innerHTML in a hidden
|
|
325
|
+
* container element and insert all the nodes in place. The call must also
|
|
326
|
+
* provide the number of nodes contained in the chunk so that during hydration
|
|
327
|
+
* we can know how many nodes the static vnode should adopt.
|
|
328
|
+
*
|
|
329
|
+
* The optimization scans a children list that contains hoisted nodes, and
|
|
330
|
+
* tries to find the largest chunk of consecutive hoisted nodes before running
|
|
331
|
+
* into a non-hoisted node or the end of the list. A chunk is then converted
|
|
332
|
+
* into a single static vnode and replaces the hoisted expression of the first
|
|
333
|
+
* node in the chunk. Other nodes in the chunk are considered "merged" and
|
|
334
|
+
* therefore removed from both the hoist list and the children array.
|
|
335
|
+
*
|
|
336
|
+
* This optimization is only performed in Node.js.
|
|
337
|
+
*/
|
|
459
338
|
const stringifyStatic = (children, context, parent) => {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
for (; i < children.length; i++) {
|
|
507
|
-
const child = children[i];
|
|
508
|
-
const isCached = isParentCached || getCachedNode(child);
|
|
509
|
-
if (isCached) {
|
|
510
|
-
const result = analyzeNode(child);
|
|
511
|
-
if (result) {
|
|
512
|
-
nc += result[0];
|
|
513
|
-
ec += result[1];
|
|
514
|
-
currentChunk.push(child);
|
|
515
|
-
continue;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
i -= stringifyCurrentChunk(i);
|
|
519
|
-
nc = 0;
|
|
520
|
-
ec = 0;
|
|
521
|
-
currentChunk.length = 0;
|
|
522
|
-
}
|
|
523
|
-
stringifyCurrentChunk(i);
|
|
339
|
+
if (context.scopes.vSlot > 0) return;
|
|
340
|
+
const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !(0, _vue_shared.isArray)(parent.codegenNode.children) && parent.codegenNode.children.type === 20;
|
|
341
|
+
let nc = 0;
|
|
342
|
+
let ec = 0;
|
|
343
|
+
const currentChunk = [];
|
|
344
|
+
const stringifyCurrentChunk = (currentIndex) => {
|
|
345
|
+
if (nc >= 20 || ec >= 5) {
|
|
346
|
+
const staticCall = (0, _vue_compiler_core.createCallExpression)(context.helper(_vue_compiler_core.CREATE_STATIC), [JSON.stringify(currentChunk.map((node) => stringifyNode(node, context)).join("")).replace(expReplaceRE, `" + $1 + "`), String(currentChunk.length)]);
|
|
347
|
+
const deleteCount = currentChunk.length - 1;
|
|
348
|
+
if (isParentCached) children.splice(currentIndex - currentChunk.length, currentChunk.length, staticCall);
|
|
349
|
+
else {
|
|
350
|
+
currentChunk[0].codegenNode.value = staticCall;
|
|
351
|
+
if (currentChunk.length > 1) {
|
|
352
|
+
children.splice(currentIndex - currentChunk.length + 1, deleteCount);
|
|
353
|
+
const cacheIndex = context.cached.indexOf(currentChunk[currentChunk.length - 1].codegenNode);
|
|
354
|
+
if (cacheIndex > -1) {
|
|
355
|
+
for (let i = cacheIndex; i < context.cached.length; i++) {
|
|
356
|
+
const c = context.cached[i];
|
|
357
|
+
if (c) c.index -= deleteCount;
|
|
358
|
+
}
|
|
359
|
+
context.cached.splice(cacheIndex - deleteCount + 1, deleteCount);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return deleteCount;
|
|
364
|
+
}
|
|
365
|
+
return 0;
|
|
366
|
+
};
|
|
367
|
+
let i = 0;
|
|
368
|
+
for (; i < children.length; i++) {
|
|
369
|
+
const child = children[i];
|
|
370
|
+
if (isParentCached || getCachedNode(child)) {
|
|
371
|
+
const result = analyzeNode(child);
|
|
372
|
+
if (result) {
|
|
373
|
+
nc += result[0];
|
|
374
|
+
ec += result[1];
|
|
375
|
+
currentChunk.push(child);
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
i -= stringifyCurrentChunk(i);
|
|
380
|
+
nc = 0;
|
|
381
|
+
ec = 0;
|
|
382
|
+
currentChunk.length = 0;
|
|
383
|
+
}
|
|
384
|
+
stringifyCurrentChunk(i);
|
|
524
385
|
};
|
|
525
386
|
const getCachedNode = (node) => {
|
|
526
|
-
|
|
527
|
-
return node.codegenNode;
|
|
528
|
-
}
|
|
387
|
+
if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) return node.codegenNode;
|
|
529
388
|
};
|
|
530
389
|
const dataAriaRE = /^(?:data|aria)-/;
|
|
531
390
|
const isStringifiableAttr = (name, ns) => {
|
|
532
|
-
|
|
391
|
+
return (ns === 0 ? (0, _vue_shared.isKnownHtmlAttr)(name) : ns === 1 ? (0, _vue_shared.isKnownSvgAttr)(name) : ns === 2 ? (0, _vue_shared.isKnownMathMLAttr)(name) : false) || dataAriaRE.test(name);
|
|
533
392
|
};
|
|
534
|
-
const isNonStringifiable = /* @__PURE__ */
|
|
535
|
-
|
|
536
|
-
|
|
393
|
+
const isNonStringifiable = /* @__PURE__ */ (0, _vue_shared.makeMap)(`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`);
|
|
394
|
+
/**
|
|
395
|
+
* for a cached node, analyze it and return:
|
|
396
|
+
* - false: bailed (contains non-stringifiable props or runtime constant)
|
|
397
|
+
* - [nc, ec] where
|
|
398
|
+
* - nc is the number of nodes inside
|
|
399
|
+
* - ec is the number of element with bindings inside
|
|
400
|
+
*/
|
|
537
401
|
function analyzeNode(node) {
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
for (let i = 0; i < node2.children.length; i++) {
|
|
574
|
-
nc++;
|
|
575
|
-
const child = node2.children[i];
|
|
576
|
-
if (child.type === 1) {
|
|
577
|
-
if (child.props.length > 0) {
|
|
578
|
-
ec++;
|
|
579
|
-
}
|
|
580
|
-
walk(child);
|
|
581
|
-
if (bailed) {
|
|
582
|
-
return false;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
return true;
|
|
587
|
-
}
|
|
588
|
-
return walk(node) ? [nc, ec] : false;
|
|
402
|
+
if (node.type === 1 && isNonStringifiable(node.tag)) return false;
|
|
403
|
+
if (node.type === 1 && (0, _vue_compiler_core.findDir)(node, "once", true)) return false;
|
|
404
|
+
if (node.type === 12) return [1, 0];
|
|
405
|
+
let nc = 1;
|
|
406
|
+
let ec = node.props.length > 0 ? 1 : 0;
|
|
407
|
+
let bailed = false;
|
|
408
|
+
const bail = () => {
|
|
409
|
+
bailed = true;
|
|
410
|
+
return false;
|
|
411
|
+
};
|
|
412
|
+
function walk(node) {
|
|
413
|
+
const isOptionTag = node.tag === "option" && node.ns === 0;
|
|
414
|
+
for (let i = 0; i < node.props.length; i++) {
|
|
415
|
+
const p = node.props[i];
|
|
416
|
+
if (p.type === 6 && !isStringifiableAttr(p.name, node.ns)) return bail();
|
|
417
|
+
if (p.type === 7 && p.name === "bind") {
|
|
418
|
+
if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns))) return bail();
|
|
419
|
+
if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) return bail();
|
|
420
|
+
if (isOptionTag && (0, _vue_compiler_core.isStaticArgOf)(p.arg, "value") && p.exp && !p.exp.isStatic) return bail();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
for (let i = 0; i < node.children.length; i++) {
|
|
424
|
+
nc++;
|
|
425
|
+
const child = node.children[i];
|
|
426
|
+
if (child.type === 1) {
|
|
427
|
+
if (child.props.length > 0) ec++;
|
|
428
|
+
walk(child);
|
|
429
|
+
if (bailed) return false;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
return true;
|
|
433
|
+
}
|
|
434
|
+
return walk(node) ? [nc, ec] : false;
|
|
589
435
|
}
|
|
590
436
|
function stringifyNode(node, context) {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
case 3:
|
|
603
|
-
return `<!--${shared.escapeHtml(node.content)}-->`;
|
|
604
|
-
case 5:
|
|
605
|
-
return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content)));
|
|
606
|
-
case 8:
|
|
607
|
-
return shared.escapeHtml(evaluateConstant(node));
|
|
608
|
-
case 12:
|
|
609
|
-
return stringifyNode(node.content, context);
|
|
610
|
-
default:
|
|
611
|
-
return "";
|
|
612
|
-
}
|
|
437
|
+
if ((0, _vue_shared.isString)(node)) return node;
|
|
438
|
+
if ((0, _vue_shared.isSymbol)(node)) return ``;
|
|
439
|
+
switch (node.type) {
|
|
440
|
+
case 1: return stringifyElement(node, context);
|
|
441
|
+
case 2: return (0, _vue_shared.escapeHtml)(node.content);
|
|
442
|
+
case 3: return `<!--${(0, _vue_shared.escapeHtml)(node.content)}-->`;
|
|
443
|
+
case 5: return (0, _vue_shared.escapeHtml)((0, _vue_shared.toDisplayString)(evaluateConstant(node.content)));
|
|
444
|
+
case 8: return (0, _vue_shared.escapeHtml)(evaluateConstant(node));
|
|
445
|
+
case 12: return stringifyNode(node.content, context);
|
|
446
|
+
default: return "";
|
|
447
|
+
}
|
|
613
448
|
}
|
|
614
449
|
function stringifyElement(node, context) {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
innerHTML = evaluateConstant(p.exp);
|
|
648
|
-
} else if (p.name === "text") {
|
|
649
|
-
innerHTML = shared.escapeHtml(
|
|
650
|
-
shared.toDisplayString(evaluateConstant(p.exp))
|
|
651
|
-
);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
if (context.scopeId) {
|
|
656
|
-
res += ` ${context.scopeId}`;
|
|
657
|
-
}
|
|
658
|
-
res += `>`;
|
|
659
|
-
if (innerHTML) {
|
|
660
|
-
res += innerHTML;
|
|
661
|
-
} else {
|
|
662
|
-
for (let i = 0; i < node.children.length; i++) {
|
|
663
|
-
res += stringifyNode(node.children[i], context);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
if (!shared.isVoidTag(node.tag)) {
|
|
667
|
-
res += `</${node.tag}>`;
|
|
668
|
-
}
|
|
669
|
-
return res;
|
|
450
|
+
let res = `<${node.tag}`;
|
|
451
|
+
let innerHTML = "";
|
|
452
|
+
for (let i = 0; i < node.props.length; i++) {
|
|
453
|
+
const p = node.props[i];
|
|
454
|
+
if (p.type === 6) {
|
|
455
|
+
res += ` ${p.name}`;
|
|
456
|
+
if (p.value) res += `="${(0, _vue_shared.escapeHtml)(p.value.content)}"`;
|
|
457
|
+
} else if (p.type === 7) {
|
|
458
|
+
if (p.name === "bind") {
|
|
459
|
+
const exp = p.exp;
|
|
460
|
+
if (exp.content[0] === "_") {
|
|
461
|
+
res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
if ((0, _vue_shared.isBooleanAttr)(p.arg.content) && exp.content === "false") continue;
|
|
465
|
+
let evaluated = evaluateConstant(exp);
|
|
466
|
+
if (evaluated != null) {
|
|
467
|
+
const arg = p.arg && p.arg.content;
|
|
468
|
+
if (arg === "class") evaluated = (0, _vue_shared.normalizeClass)(evaluated);
|
|
469
|
+
else if (arg === "style") evaluated = (0, _vue_shared.stringifyStyle)((0, _vue_shared.normalizeStyle)(evaluated));
|
|
470
|
+
res += ` ${p.arg.content}="${(0, _vue_shared.escapeHtml)(evaluated)}"`;
|
|
471
|
+
}
|
|
472
|
+
} else if (p.name === "html") innerHTML = evaluateConstant(p.exp);
|
|
473
|
+
else if (p.name === "text") innerHTML = (0, _vue_shared.escapeHtml)((0, _vue_shared.toDisplayString)(evaluateConstant(p.exp)));
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (context.scopeId) res += ` ${context.scopeId}`;
|
|
477
|
+
res += `>`;
|
|
478
|
+
if (innerHTML) res += innerHTML;
|
|
479
|
+
else for (let i = 0; i < node.children.length; i++) res += stringifyNode(node.children[i], context);
|
|
480
|
+
if (!(0, _vue_shared.isVoidTag)(node.tag)) res += `</${node.tag}>`;
|
|
481
|
+
return res;
|
|
670
482
|
}
|
|
671
483
|
function evaluateConstant(exp) {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
res += shared.toDisplayString(evaluateConstant(c.content));
|
|
684
|
-
} else {
|
|
685
|
-
res += evaluateConstant(c);
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
return res;
|
|
689
|
-
}
|
|
484
|
+
if (exp.type === 4) return new Function(`return (${exp.content})`)();
|
|
485
|
+
else {
|
|
486
|
+
let res = ``;
|
|
487
|
+
exp.children.forEach((c) => {
|
|
488
|
+
if ((0, _vue_shared.isString)(c) || (0, _vue_shared.isSymbol)(c)) return;
|
|
489
|
+
if (c.type === 2) res += c.content;
|
|
490
|
+
else if (c.type === 5) res += (0, _vue_shared.toDisplayString)(evaluateConstant(c.content));
|
|
491
|
+
else res += evaluateConstant(c);
|
|
492
|
+
});
|
|
493
|
+
return res;
|
|
494
|
+
}
|
|
690
495
|
}
|
|
691
496
|
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region packages/compiler-dom/src/transforms/ignoreSideEffectTags.ts
|
|
692
499
|
const ignoreSideEffectTags = (node, context) => {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
node.loc
|
|
698
|
-
)
|
|
699
|
-
);
|
|
700
|
-
context.removeNode();
|
|
701
|
-
}
|
|
500
|
+
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
|
|
501
|
+
context.onError(createDOMCompilerError(64, node.loc));
|
|
502
|
+
context.removeNode();
|
|
503
|
+
}
|
|
702
504
|
};
|
|
703
505
|
|
|
506
|
+
//#endregion
|
|
507
|
+
//#region packages/compiler-dom/src/htmlNesting.ts
|
|
508
|
+
/**
|
|
509
|
+
* Copied from https://github.com/MananTank/validate-html-nesting
|
|
510
|
+
* with ISC license
|
|
511
|
+
*
|
|
512
|
+
* To avoid runtime dependency on validate-html-nesting
|
|
513
|
+
* This file should not change very often in the original repo
|
|
514
|
+
* but we may need to keep it up-to-date from time to time.
|
|
515
|
+
*/
|
|
516
|
+
/**
|
|
517
|
+
* returns true if given parent-child nesting is valid HTML
|
|
518
|
+
*/
|
|
704
519
|
function isValidHTMLNesting(parent, child) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
if (knownInvalidChildren[parent].has(child)) return false;
|
|
716
|
-
}
|
|
717
|
-
if (child in knownInvalidParents) {
|
|
718
|
-
if (knownInvalidParents[child].has(parent)) return false;
|
|
719
|
-
}
|
|
720
|
-
return true;
|
|
520
|
+
if (parent === "template") return true;
|
|
521
|
+
if (parent in onlyValidChildren) return onlyValidChildren[parent].has(child);
|
|
522
|
+
if (child in onlyValidParents) return onlyValidParents[child].has(parent);
|
|
523
|
+
if (parent in knownInvalidChildren) {
|
|
524
|
+
if (knownInvalidChildren[parent].has(child)) return false;
|
|
525
|
+
}
|
|
526
|
+
if (child in knownInvalidParents) {
|
|
527
|
+
if (knownInvalidParents[child].has(parent)) return false;
|
|
528
|
+
}
|
|
529
|
+
return true;
|
|
721
530
|
}
|
|
722
|
-
const headings =
|
|
531
|
+
const headings = new Set([
|
|
532
|
+
"h1",
|
|
533
|
+
"h2",
|
|
534
|
+
"h3",
|
|
535
|
+
"h4",
|
|
536
|
+
"h5",
|
|
537
|
+
"h6"
|
|
538
|
+
]);
|
|
723
539
|
const emptySet = /* @__PURE__ */ new Set([]);
|
|
540
|
+
/**
|
|
541
|
+
* maps element to set of elements that can be it's children, no other */
|
|
724
542
|
const onlyValidChildren = {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
543
|
+
head: new Set([
|
|
544
|
+
"base",
|
|
545
|
+
"basefront",
|
|
546
|
+
"bgsound",
|
|
547
|
+
"link",
|
|
548
|
+
"meta",
|
|
549
|
+
"title",
|
|
550
|
+
"noscript",
|
|
551
|
+
"noframes",
|
|
552
|
+
"style",
|
|
553
|
+
"script",
|
|
554
|
+
"template"
|
|
555
|
+
]),
|
|
556
|
+
optgroup: new Set(["option"]),
|
|
557
|
+
select: new Set([
|
|
558
|
+
"optgroup",
|
|
559
|
+
"option",
|
|
560
|
+
"hr"
|
|
561
|
+
]),
|
|
562
|
+
table: new Set([
|
|
563
|
+
"caption",
|
|
564
|
+
"colgroup",
|
|
565
|
+
"tbody",
|
|
566
|
+
"tfoot",
|
|
567
|
+
"thead"
|
|
568
|
+
]),
|
|
569
|
+
tr: new Set(["td", "th"]),
|
|
570
|
+
colgroup: new Set(["col"]),
|
|
571
|
+
tbody: new Set(["tr"]),
|
|
572
|
+
thead: new Set(["tr"]),
|
|
573
|
+
tfoot: new Set(["tr"]),
|
|
574
|
+
script: emptySet,
|
|
575
|
+
iframe: emptySet,
|
|
576
|
+
option: emptySet,
|
|
577
|
+
textarea: emptySet,
|
|
578
|
+
style: emptySet,
|
|
579
|
+
title: emptySet
|
|
754
580
|
};
|
|
581
|
+
/** maps elements to set of elements which can be it's parent, no other */
|
|
755
582
|
const onlyValidParents = {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
area: /* @__PURE__ */ new Set(["map"])
|
|
583
|
+
html: emptySet,
|
|
584
|
+
body: new Set(["html"]),
|
|
585
|
+
head: new Set(["html"]),
|
|
586
|
+
td: new Set(["tr"]),
|
|
587
|
+
colgroup: new Set(["table"]),
|
|
588
|
+
caption: new Set(["table"]),
|
|
589
|
+
tbody: new Set(["table"]),
|
|
590
|
+
tfoot: new Set(["table"]),
|
|
591
|
+
col: new Set(["colgroup"]),
|
|
592
|
+
th: new Set(["tr"]),
|
|
593
|
+
thead: new Set(["table"]),
|
|
594
|
+
tr: new Set([
|
|
595
|
+
"tbody",
|
|
596
|
+
"thead",
|
|
597
|
+
"tfoot"
|
|
598
|
+
]),
|
|
599
|
+
dd: new Set(["dl", "div"]),
|
|
600
|
+
dt: new Set(["dl", "div"]),
|
|
601
|
+
figcaption: new Set(["figure"]),
|
|
602
|
+
summary: new Set(["details"]),
|
|
603
|
+
area: new Set(["map"])
|
|
778
604
|
};
|
|
605
|
+
/** maps element to set of elements that can not be it's children, others can */
|
|
779
606
|
const knownInvalidChildren = {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
607
|
+
p: new Set([
|
|
608
|
+
"address",
|
|
609
|
+
"article",
|
|
610
|
+
"aside",
|
|
611
|
+
"blockquote",
|
|
612
|
+
"center",
|
|
613
|
+
"details",
|
|
614
|
+
"dialog",
|
|
615
|
+
"dir",
|
|
616
|
+
"div",
|
|
617
|
+
"dl",
|
|
618
|
+
"fieldset",
|
|
619
|
+
"figure",
|
|
620
|
+
"footer",
|
|
621
|
+
"form",
|
|
622
|
+
"h1",
|
|
623
|
+
"h2",
|
|
624
|
+
"h3",
|
|
625
|
+
"h4",
|
|
626
|
+
"h5",
|
|
627
|
+
"h6",
|
|
628
|
+
"header",
|
|
629
|
+
"hgroup",
|
|
630
|
+
"hr",
|
|
631
|
+
"li",
|
|
632
|
+
"main",
|
|
633
|
+
"nav",
|
|
634
|
+
"menu",
|
|
635
|
+
"ol",
|
|
636
|
+
"p",
|
|
637
|
+
"pre",
|
|
638
|
+
"section",
|
|
639
|
+
"table",
|
|
640
|
+
"ul"
|
|
641
|
+
]),
|
|
642
|
+
svg: new Set([
|
|
643
|
+
"b",
|
|
644
|
+
"blockquote",
|
|
645
|
+
"br",
|
|
646
|
+
"code",
|
|
647
|
+
"dd",
|
|
648
|
+
"div",
|
|
649
|
+
"dl",
|
|
650
|
+
"dt",
|
|
651
|
+
"em",
|
|
652
|
+
"embed",
|
|
653
|
+
"h1",
|
|
654
|
+
"h2",
|
|
655
|
+
"h3",
|
|
656
|
+
"h4",
|
|
657
|
+
"h5",
|
|
658
|
+
"h6",
|
|
659
|
+
"hr",
|
|
660
|
+
"i",
|
|
661
|
+
"img",
|
|
662
|
+
"li",
|
|
663
|
+
"menu",
|
|
664
|
+
"meta",
|
|
665
|
+
"ol",
|
|
666
|
+
"p",
|
|
667
|
+
"pre",
|
|
668
|
+
"ruby",
|
|
669
|
+
"s",
|
|
670
|
+
"small",
|
|
671
|
+
"span",
|
|
672
|
+
"strong",
|
|
673
|
+
"sub",
|
|
674
|
+
"sup",
|
|
675
|
+
"table",
|
|
676
|
+
"u",
|
|
677
|
+
"ul",
|
|
678
|
+
"var"
|
|
679
|
+
])
|
|
853
680
|
};
|
|
681
|
+
/** maps element to set of elements that can not be it's parent, others can */
|
|
854
682
|
const knownInvalidParents = {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
683
|
+
a: new Set(["a"]),
|
|
684
|
+
button: new Set(["button"]),
|
|
685
|
+
dd: new Set(["dd", "dt"]),
|
|
686
|
+
dt: new Set(["dd", "dt"]),
|
|
687
|
+
form: new Set(["form"]),
|
|
688
|
+
li: new Set(["li"]),
|
|
689
|
+
h1: headings,
|
|
690
|
+
h2: headings,
|
|
691
|
+
h3: headings,
|
|
692
|
+
h4: headings,
|
|
693
|
+
h5: headings,
|
|
694
|
+
h6: headings
|
|
867
695
|
};
|
|
868
696
|
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region packages/compiler-dom/src/transforms/validateHtmlNesting.ts
|
|
869
699
|
const validateHtmlNesting = (node, context) => {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
context.onWarn(error);
|
|
876
|
-
}
|
|
700
|
+
if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
|
|
701
|
+
const error = /* @__PURE__ */ new SyntaxError(`<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);
|
|
702
|
+
error.loc = node.loc;
|
|
703
|
+
context.onWarn(error);
|
|
704
|
+
}
|
|
877
705
|
};
|
|
878
706
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
];
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region packages/compiler-dom/src/index.ts
|
|
709
|
+
const DOMNodeTransforms = [transformStyle, ...[transformTransition, validateHtmlNesting]];
|
|
883
710
|
const DOMDirectiveTransforms = {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
// override compiler-core
|
|
891
|
-
show: transformShow
|
|
711
|
+
cloak: _vue_compiler_core.noopDirectiveTransform,
|
|
712
|
+
html: transformVHtml,
|
|
713
|
+
text: transformVText,
|
|
714
|
+
model: transformModel,
|
|
715
|
+
on: transformOn,
|
|
716
|
+
show: transformShow
|
|
892
717
|
};
|
|
893
718
|
function compile(src, options = {}) {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
...options.nodeTransforms || []
|
|
904
|
-
],
|
|
905
|
-
directiveTransforms: shared.extend(
|
|
906
|
-
{},
|
|
907
|
-
DOMDirectiveTransforms,
|
|
908
|
-
options.directiveTransforms || {}
|
|
909
|
-
),
|
|
910
|
-
transformHoist: stringifyStatic
|
|
911
|
-
})
|
|
912
|
-
);
|
|
719
|
+
return (0, _vue_compiler_core.baseCompile)(src, (0, _vue_shared.extend)({}, parserOptions, options, {
|
|
720
|
+
nodeTransforms: [
|
|
721
|
+
ignoreSideEffectTags,
|
|
722
|
+
...DOMNodeTransforms,
|
|
723
|
+
...options.nodeTransforms || []
|
|
724
|
+
],
|
|
725
|
+
directiveTransforms: (0, _vue_shared.extend)({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
|
|
726
|
+
transformHoist: stringifyStatic
|
|
727
|
+
}));
|
|
913
728
|
}
|
|
914
729
|
function parse(template, options = {}) {
|
|
915
|
-
|
|
730
|
+
return (0, _vue_compiler_core.baseParse)(template, (0, _vue_shared.extend)({}, parserOptions, options));
|
|
916
731
|
}
|
|
917
732
|
|
|
733
|
+
//#endregion
|
|
918
734
|
exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
|
|
919
735
|
exports.DOMErrorCodes = DOMErrorCodes;
|
|
920
736
|
exports.DOMErrorMessages = DOMErrorMessages;
|
|
@@ -938,6 +754,9 @@ exports.parserOptions = parserOptions;
|
|
|
938
754
|
exports.postTransformTransition = postTransformTransition;
|
|
939
755
|
exports.resolveModifiers = resolveModifiers;
|
|
940
756
|
exports.transformStyle = transformStyle;
|
|
941
|
-
Object.keys(
|
|
942
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports
|
|
757
|
+
Object.keys(_vue_compiler_core).forEach(function (k) {
|
|
758
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
759
|
+
enumerable: true,
|
|
760
|
+
get: function () { return _vue_compiler_core[k]; }
|
|
761
|
+
});
|
|
943
762
|
});
|