@vue/compiler-dom 3.6.0-alpha.7 → 3.6.0-beta.10

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.
@@ -1,695 +1,540 @@
1
1
  /**
2
- * @vue/compiler-dom v3.6.0-alpha.7
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/
6
- import { registerRuntimeHelpers, createSimpleExpression, createCompilerError, createObjectProperty, createCallExpression, getConstantType, TO_DISPLAY_STRING, transformModel as transformModel$1, findProp, hasDynamicKeyVBind, findDir, isStaticArgOf, transformOn as transformOn$1, isStaticExp, createCompoundExpression, checkCompatEnabled, isCommentOrWhitespace, noopDirectiveTransform, baseCompile, baseParse } from '@vue/compiler-core';
7
- export * from '@vue/compiler-core';
8
- import { isHTMLTag, isSVGTag, isMathMLTag, isVoidTag, parseStringStyle, makeMap, capitalize, isString, extend } from '@vue/shared';
9
-
2
+ * @vue/compiler-dom v3.6.0-beta.10
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
6
+ import { TO_DISPLAY_STRING, baseCompile, baseParse, checkCompatEnabled, createCallExpression, createCompilerError, createCompoundExpression, createObjectProperty, createSimpleExpression, findDir, findProp, getConstantType, hasDynamicKeyVBind, isCommentOrWhitespace, isStaticArgOf, isStaticExp, noopDirectiveTransform, registerRuntimeHelpers, transformModel, transformOn } from "@vue/compiler-core";
7
+ import { capitalize, extend, isHTMLTag, isMathMLTag, isSVGTag, isString, isVoidTag, makeMap, parseStringStyle } from "@vue/shared";
8
+ export * from "@vue/compiler-core";
9
+ //#region packages/compiler-dom/src/runtimeHelpers.ts
10
10
  const V_MODEL_RADIO = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelRadio` : ``);
11
- const V_MODEL_CHECKBOX = Symbol(
12
- !!(process.env.NODE_ENV !== "production") ? `vModelCheckbox` : ``
13
- );
11
+ const V_MODEL_CHECKBOX = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelCheckbox` : ``);
14
12
  const V_MODEL_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelText` : ``);
15
- const V_MODEL_SELECT = Symbol(
16
- !!(process.env.NODE_ENV !== "production") ? `vModelSelect` : ``
17
- );
18
- const V_MODEL_DYNAMIC = Symbol(
19
- !!(process.env.NODE_ENV !== "production") ? `vModelDynamic` : ``
20
- );
21
- const V_ON_WITH_MODIFIERS = Symbol(
22
- !!(process.env.NODE_ENV !== "production") ? `vOnModifiersGuard` : ``
23
- );
24
- const V_ON_WITH_KEYS = Symbol(
25
- !!(process.env.NODE_ENV !== "production") ? `vOnKeysGuard` : ``
26
- );
13
+ const V_MODEL_SELECT = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelSelect` : ``);
14
+ const V_MODEL_DYNAMIC = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelDynamic` : ``);
15
+ const V_ON_WITH_MODIFIERS = Symbol(!!(process.env.NODE_ENV !== "production") ? `vOnModifiersGuard` : ``);
16
+ const V_ON_WITH_KEYS = Symbol(!!(process.env.NODE_ENV !== "production") ? `vOnKeysGuard` : ``);
27
17
  const V_SHOW = Symbol(!!(process.env.NODE_ENV !== "production") ? `vShow` : ``);
28
18
  const TRANSITION = Symbol(!!(process.env.NODE_ENV !== "production") ? `Transition` : ``);
29
- const TRANSITION_GROUP = Symbol(
30
- !!(process.env.NODE_ENV !== "production") ? `TransitionGroup` : ``
31
- );
19
+ const TRANSITION_GROUP = Symbol(!!(process.env.NODE_ENV !== "production") ? `TransitionGroup` : ``);
32
20
  registerRuntimeHelpers({
33
- [V_MODEL_RADIO]: `vModelRadio`,
34
- [V_MODEL_CHECKBOX]: `vModelCheckbox`,
35
- [V_MODEL_TEXT]: `vModelText`,
36
- [V_MODEL_SELECT]: `vModelSelect`,
37
- [V_MODEL_DYNAMIC]: `vModelDynamic`,
38
- [V_ON_WITH_MODIFIERS]: `withModifiers`,
39
- [V_ON_WITH_KEYS]: `withKeys`,
40
- [V_SHOW]: `vShow`,
41
- [TRANSITION]: `Transition`,
42
- [TRANSITION_GROUP]: `TransitionGroup`
21
+ [V_MODEL_RADIO]: `vModelRadio`,
22
+ [V_MODEL_CHECKBOX]: `vModelCheckbox`,
23
+ [V_MODEL_TEXT]: `vModelText`,
24
+ [V_MODEL_SELECT]: `vModelSelect`,
25
+ [V_MODEL_DYNAMIC]: `vModelDynamic`,
26
+ [V_ON_WITH_MODIFIERS]: `withModifiers`,
27
+ [V_ON_WITH_KEYS]: `withKeys`,
28
+ [V_SHOW]: `vShow`,
29
+ [TRANSITION]: `Transition`,
30
+ [TRANSITION_GROUP]: `TransitionGroup`
43
31
  });
44
-
32
+ //#endregion
33
+ //#region packages/compiler-dom/src/decodeHtmlBrowser.ts
45
34
  let decoder;
46
35
  function decodeHtmlBrowser(raw, asAttr = false) {
47
- if (!decoder) {
48
- decoder = document.createElement("div");
49
- }
50
- if (asAttr) {
51
- decoder.innerHTML = `<div foo="${raw.replace(/"/g, "&quot;")}">`;
52
- return decoder.children[0].getAttribute("foo");
53
- } else {
54
- decoder.innerHTML = raw;
55
- return decoder.textContent;
56
- }
36
+ if (!decoder) decoder = document.createElement("div");
37
+ if (asAttr) {
38
+ decoder.innerHTML = `<div foo="${raw.replace(/"/g, "&quot;")}">`;
39
+ return decoder.children[0].getAttribute("foo");
40
+ } else {
41
+ decoder.innerHTML = raw;
42
+ return decoder.textContent;
43
+ }
57
44
  }
58
-
45
+ //#endregion
46
+ //#region packages/compiler-dom/src/parserOptions.ts
59
47
  const parserOptions = {
60
- parseMode: "html",
61
- isVoidTag,
62
- isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
63
- isPreTag: (tag) => tag === "pre",
64
- isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
65
- decodeEntities: decodeHtmlBrowser ,
66
- isBuiltInComponent: (tag) => {
67
- if (tag === "Transition" || tag === "transition") {
68
- return TRANSITION;
69
- } else if (tag === "TransitionGroup" || tag === "transition-group") {
70
- return TRANSITION_GROUP;
71
- }
72
- },
73
- // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
74
- getNamespace(tag, parent, rootNamespace) {
75
- let ns = parent ? parent.ns : rootNamespace;
76
- if (parent && ns === 2) {
77
- if (parent.tag === "annotation-xml") {
78
- if (isSVGTag(tag)) {
79
- return 1;
80
- }
81
- if (parent.props.some(
82
- (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
83
- )) {
84
- ns = 0;
85
- }
86
- } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
87
- ns = 0;
88
- }
89
- } else if (parent && ns === 1) {
90
- if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
91
- ns = 0;
92
- }
93
- }
94
- if (ns === 0) {
95
- if (isSVGTag(tag)) {
96
- return 1;
97
- }
98
- if (isMathMLTag(tag)) {
99
- return 2;
100
- }
101
- }
102
- return ns;
103
- }
48
+ parseMode: "html",
49
+ isVoidTag,
50
+ isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
51
+ isPreTag: (tag) => tag === "pre",
52
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
53
+ decodeEntities: decodeHtmlBrowser,
54
+ isBuiltInComponent: (tag) => {
55
+ if (tag === "Transition" || tag === "transition") return TRANSITION;
56
+ else if (tag === "TransitionGroup" || tag === "transition-group") return TRANSITION_GROUP;
57
+ },
58
+ getNamespace(tag, parent, rootNamespace) {
59
+ let ns = parent ? parent.ns : rootNamespace;
60
+ if (parent && ns === 2) {
61
+ if (parent.tag === "annotation-xml") {
62
+ if (isSVGTag(tag)) return 1;
63
+ 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;
64
+ } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") ns = 0;
65
+ } else if (parent && ns === 1) {
66
+ if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") ns = 0;
67
+ }
68
+ if (ns === 0) {
69
+ if (isSVGTag(tag)) return 1;
70
+ if (isMathMLTag(tag)) return 2;
71
+ }
72
+ return ns;
73
+ }
104
74
  };
105
-
75
+ //#endregion
76
+ //#region packages/compiler-dom/src/transforms/transformStyle.ts
106
77
  const transformStyle = (node) => {
107
- if (node.type === 1) {
108
- node.props.forEach((p, i) => {
109
- if (p.type === 6 && p.name === "style" && p.value) {
110
- node.props[i] = {
111
- type: 7,
112
- name: `bind`,
113
- arg: createSimpleExpression(`style`, true, p.loc),
114
- exp: parseInlineCSS(p.value.content, p.loc),
115
- modifiers: [],
116
- loc: p.loc
117
- };
118
- }
119
- });
120
- }
78
+ if (node.type === 1) node.props.forEach((p, i) => {
79
+ if (p.type === 6 && p.name === "style" && p.value) node.props[i] = {
80
+ type: 7,
81
+ name: `bind`,
82
+ arg: createSimpleExpression(`style`, true, p.loc),
83
+ exp: parseInlineCSS(p.value.content, p.loc),
84
+ modifiers: [],
85
+ loc: p.loc
86
+ };
87
+ });
121
88
  };
122
89
  const parseInlineCSS = (cssText, loc) => {
123
- const normalized = parseStringStyle(cssText);
124
- return createSimpleExpression(
125
- JSON.stringify(normalized),
126
- false,
127
- loc,
128
- 3
129
- );
90
+ const normalized = parseStringStyle(cssText);
91
+ return createSimpleExpression(JSON.stringify(normalized), false, loc, 3);
130
92
  };
131
-
93
+ //#endregion
94
+ //#region packages/compiler-dom/src/errors.ts
132
95
  function createDOMCompilerError(code, loc) {
133
- return createCompilerError(
134
- code,
135
- loc,
136
- !!(process.env.NODE_ENV !== "production") || false ? DOMErrorMessages : void 0
137
- );
96
+ return createCompilerError(code, loc, !!(process.env.NODE_ENV !== "production") || false ? DOMErrorMessages : void 0);
138
97
  }
139
98
  const DOMErrorCodes = {
140
- "X_V_HTML_NO_EXPRESSION": 53,
141
- "53": "X_V_HTML_NO_EXPRESSION",
142
- "X_V_HTML_WITH_CHILDREN": 54,
143
- "54": "X_V_HTML_WITH_CHILDREN",
144
- "X_V_TEXT_NO_EXPRESSION": 55,
145
- "55": "X_V_TEXT_NO_EXPRESSION",
146
- "X_V_TEXT_WITH_CHILDREN": 56,
147
- "56": "X_V_TEXT_WITH_CHILDREN",
148
- "X_V_MODEL_ON_INVALID_ELEMENT": 57,
149
- "57": "X_V_MODEL_ON_INVALID_ELEMENT",
150
- "X_V_MODEL_ARG_ON_ELEMENT": 58,
151
- "58": "X_V_MODEL_ARG_ON_ELEMENT",
152
- "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59,
153
- "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
154
- "X_V_MODEL_UNNECESSARY_VALUE": 60,
155
- "60": "X_V_MODEL_UNNECESSARY_VALUE",
156
- "X_V_SHOW_NO_EXPRESSION": 61,
157
- "61": "X_V_SHOW_NO_EXPRESSION",
158
- "X_TRANSITION_INVALID_CHILDREN": 62,
159
- "62": "X_TRANSITION_INVALID_CHILDREN",
160
- "X_IGNORED_SIDE_EFFECT_TAG": 63,
161
- "63": "X_IGNORED_SIDE_EFFECT_TAG",
162
- "__EXTEND_POINT__": 64,
163
- "64": "__EXTEND_POINT__"
99
+ "X_V_HTML_NO_EXPRESSION": 54,
100
+ "54": "X_V_HTML_NO_EXPRESSION",
101
+ "X_V_HTML_WITH_CHILDREN": 55,
102
+ "55": "X_V_HTML_WITH_CHILDREN",
103
+ "X_V_TEXT_NO_EXPRESSION": 56,
104
+ "56": "X_V_TEXT_NO_EXPRESSION",
105
+ "X_V_TEXT_WITH_CHILDREN": 57,
106
+ "57": "X_V_TEXT_WITH_CHILDREN",
107
+ "X_V_MODEL_ON_INVALID_ELEMENT": 58,
108
+ "58": "X_V_MODEL_ON_INVALID_ELEMENT",
109
+ "X_V_MODEL_ARG_ON_ELEMENT": 59,
110
+ "59": "X_V_MODEL_ARG_ON_ELEMENT",
111
+ "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 60,
112
+ "60": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
113
+ "X_V_MODEL_UNNECESSARY_VALUE": 61,
114
+ "61": "X_V_MODEL_UNNECESSARY_VALUE",
115
+ "X_V_SHOW_NO_EXPRESSION": 62,
116
+ "62": "X_V_SHOW_NO_EXPRESSION",
117
+ "X_TRANSITION_INVALID_CHILDREN": 63,
118
+ "63": "X_TRANSITION_INVALID_CHILDREN",
119
+ "X_IGNORED_SIDE_EFFECT_TAG": 64,
120
+ "64": "X_IGNORED_SIDE_EFFECT_TAG",
121
+ "__EXTEND_POINT__": 65,
122
+ "65": "__EXTEND_POINT__"
164
123
  };
165
124
  const DOMErrorMessages = {
166
- [53]: `v-html is missing expression.`,
167
- [54]: `v-html will override element children.`,
168
- [55]: `v-text is missing expression.`,
169
- [56]: `v-text will override element children.`,
170
- [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
171
- [58]: `v-model argument is not supported on plain elements.`,
172
- [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
173
- [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
174
- [61]: `v-show is missing expression.`,
175
- [62]: `<Transition> expects exactly one child element or component.`,
176
- [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`,
177
- // just to fulfill types
178
- [64]: ``
125
+ [54]: `v-html is missing expression.`,
126
+ [55]: `v-html will override element children.`,
127
+ [56]: `v-text is missing expression.`,
128
+ [57]: `v-text will override element children.`,
129
+ [58]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
130
+ [59]: `v-model argument is not supported on plain elements.`,
131
+ [60]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
132
+ [61]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
133
+ [62]: `v-show is missing expression.`,
134
+ [63]: `<Transition> expects exactly one child element or component.`,
135
+ [64]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`,
136
+ [65]: ``
179
137
  };
180
-
138
+ //#endregion
139
+ //#region packages/compiler-dom/src/transforms/vHtml.ts
181
140
  const transformVHtml = (dir, node, context) => {
182
- const { exp, loc } = dir;
183
- if (!exp) {
184
- context.onError(
185
- createDOMCompilerError(53, loc)
186
- );
187
- }
188
- if (node.children.length) {
189
- context.onError(
190
- createDOMCompilerError(54, loc)
191
- );
192
- node.children.length = 0;
193
- }
194
- return {
195
- props: [
196
- createObjectProperty(
197
- createSimpleExpression(`innerHTML`, true, loc),
198
- exp || createSimpleExpression("", true)
199
- )
200
- ]
201
- };
141
+ const { exp, loc } = dir;
142
+ if (!exp) context.onError(createDOMCompilerError(54, loc));
143
+ if (node.children.length) {
144
+ context.onError(createDOMCompilerError(55, loc));
145
+ node.children.length = 0;
146
+ }
147
+ return { props: [createObjectProperty(createSimpleExpression(`innerHTML`, true, loc), exp || createSimpleExpression("", true))] };
202
148
  };
203
-
149
+ //#endregion
150
+ //#region packages/compiler-dom/src/transforms/vText.ts
204
151
  const transformVText = (dir, node, context) => {
205
- const { exp, loc } = dir;
206
- if (!exp) {
207
- context.onError(
208
- createDOMCompilerError(55, loc)
209
- );
210
- }
211
- if (node.children.length) {
212
- context.onError(
213
- createDOMCompilerError(56, loc)
214
- );
215
- node.children.length = 0;
216
- }
217
- return {
218
- props: [
219
- createObjectProperty(
220
- createSimpleExpression(`textContent`, true),
221
- exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression(
222
- context.helperString(TO_DISPLAY_STRING),
223
- [exp],
224
- loc
225
- ) : createSimpleExpression("", true)
226
- )
227
- ]
228
- };
152
+ const { exp, loc } = dir;
153
+ if (!exp) context.onError(createDOMCompilerError(56, loc));
154
+ if (node.children.length) {
155
+ context.onError(createDOMCompilerError(57, loc));
156
+ node.children.length = 0;
157
+ }
158
+ return { props: [createObjectProperty(createSimpleExpression(`textContent`, true), exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression(context.helperString(TO_DISPLAY_STRING), [exp], loc) : createSimpleExpression("", true))] };
229
159
  };
230
-
231
- const transformModel = (dir, node, context) => {
232
- const baseResult = transformModel$1(dir, node, context);
233
- if (!baseResult.props.length || node.tagType === 1) {
234
- return baseResult;
235
- }
236
- if (dir.arg) {
237
- context.onError(
238
- createDOMCompilerError(
239
- 58,
240
- dir.arg.loc
241
- )
242
- );
243
- }
244
- function checkDuplicatedValue() {
245
- const value = findDir(node, "bind");
246
- if (value && isStaticArgOf(value.arg, "value")) {
247
- context.onError(
248
- createDOMCompilerError(
249
- 60,
250
- value.loc
251
- )
252
- );
253
- }
254
- }
255
- const { tag } = node;
256
- const isCustomElement = context.isCustomElement(tag);
257
- if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
258
- let directiveToUse = V_MODEL_TEXT;
259
- let isInvalidType = false;
260
- if (tag === "input" || isCustomElement) {
261
- const type = findProp(node, `type`);
262
- if (type) {
263
- if (type.type === 7) {
264
- directiveToUse = V_MODEL_DYNAMIC;
265
- } else if (type.value) {
266
- switch (type.value.content) {
267
- case "radio":
268
- directiveToUse = V_MODEL_RADIO;
269
- break;
270
- case "checkbox":
271
- directiveToUse = V_MODEL_CHECKBOX;
272
- break;
273
- case "file":
274
- isInvalidType = true;
275
- context.onError(
276
- createDOMCompilerError(
277
- 59,
278
- dir.loc
279
- )
280
- );
281
- break;
282
- default:
283
- !!(process.env.NODE_ENV !== "production") && checkDuplicatedValue();
284
- break;
285
- }
286
- }
287
- } else if (hasDynamicKeyVBind(node)) {
288
- directiveToUse = V_MODEL_DYNAMIC;
289
- } else {
290
- !!(process.env.NODE_ENV !== "production") && checkDuplicatedValue();
291
- }
292
- } else if (tag === "select") {
293
- directiveToUse = V_MODEL_SELECT;
294
- } else {
295
- !!(process.env.NODE_ENV !== "production") && checkDuplicatedValue();
296
- }
297
- if (!isInvalidType) {
298
- baseResult.needRuntime = context.helper(directiveToUse);
299
- }
300
- } else {
301
- context.onError(
302
- createDOMCompilerError(
303
- 57,
304
- dir.loc
305
- )
306
- );
307
- }
308
- baseResult.props = baseResult.props.filter(
309
- (p) => !(p.key.type === 4 && p.key.content === "modelValue")
310
- );
311
- return baseResult;
160
+ //#endregion
161
+ //#region packages/compiler-dom/src/transforms/vModel.ts
162
+ const transformModel$1 = (dir, node, context) => {
163
+ const baseResult = transformModel(dir, node, context);
164
+ if (!baseResult.props.length || node.tagType === 1) return baseResult;
165
+ if (dir.arg) context.onError(createDOMCompilerError(59, dir.arg.loc));
166
+ function checkDuplicatedValue() {
167
+ const value = findDir(node, "bind");
168
+ if (value && isStaticArgOf(value.arg, "value")) context.onError(createDOMCompilerError(61, value.loc));
169
+ }
170
+ const { tag } = node;
171
+ const isCustomElement = context.isCustomElement(tag);
172
+ if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
173
+ let directiveToUse = V_MODEL_TEXT;
174
+ let isInvalidType = false;
175
+ if (tag === "input" || isCustomElement) {
176
+ const type = findProp(node, `type`);
177
+ if (type) {
178
+ if (type.type === 7) directiveToUse = V_MODEL_DYNAMIC;
179
+ else if (type.value) switch (type.value.content) {
180
+ case "radio":
181
+ directiveToUse = V_MODEL_RADIO;
182
+ break;
183
+ case "checkbox":
184
+ directiveToUse = V_MODEL_CHECKBOX;
185
+ break;
186
+ case "file":
187
+ isInvalidType = true;
188
+ context.onError(createDOMCompilerError(60, dir.loc));
189
+ break;
190
+ default:
191
+ process.env.NODE_ENV !== "production" && checkDuplicatedValue();
192
+ break;
193
+ }
194
+ } else if (hasDynamicKeyVBind(node)) directiveToUse = V_MODEL_DYNAMIC;
195
+ else process.env.NODE_ENV !== "production" && checkDuplicatedValue();
196
+ } else if (tag === "select") directiveToUse = V_MODEL_SELECT;
197
+ else process.env.NODE_ENV !== "production" && checkDuplicatedValue();
198
+ if (!isInvalidType) baseResult.needRuntime = context.helper(directiveToUse);
199
+ } else context.onError(createDOMCompilerError(58, dir.loc));
200
+ baseResult.props = baseResult.props.filter((p) => !(p.key.type === 4 && p.key.content === "modelValue"));
201
+ return baseResult;
312
202
  };
313
-
203
+ //#endregion
204
+ //#region packages/compiler-dom/src/transforms/vOn.ts
314
205
  const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`);
315
- const isNonKeyModifier = /* @__PURE__ */ makeMap(
316
- // event propagation management
317
- `stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
318
- );
206
+ const isNonKeyModifier = /* @__PURE__ */ makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
319
207
  const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
320
- const isKeyboardEvent = /* @__PURE__ */ makeMap(
321
- `onkeyup,onkeydown,onkeypress`
322
- );
208
+ const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`);
323
209
  const resolveModifiers = (key, modifiers, context, loc) => {
324
- const keyModifiers = [];
325
- const nonKeyModifiers = [];
326
- const eventOptionModifiers = [];
327
- for (let i = 0; i < modifiers.length; i++) {
328
- const modifier = modifiers[i].content;
329
- if (modifier === "native" && context && checkCompatEnabled(
330
- "COMPILER_V_ON_NATIVE",
331
- context,
332
- loc
333
- )) {
334
- eventOptionModifiers.push(modifier);
335
- } else if (isEventOptionModifier(modifier)) {
336
- eventOptionModifiers.push(modifier);
337
- } else {
338
- const keyString = isString(key) ? key : isStaticExp(key) ? key.content : null;
339
- if (maybeKeyModifier(modifier)) {
340
- if (keyString) {
341
- if (isKeyboardEvent(keyString.toLowerCase())) {
342
- keyModifiers.push(modifier);
343
- } else {
344
- nonKeyModifiers.push(modifier);
345
- }
346
- } else {
347
- keyModifiers.push(modifier);
348
- nonKeyModifiers.push(modifier);
349
- }
350
- } else {
351
- if (isNonKeyModifier(modifier)) {
352
- nonKeyModifiers.push(modifier);
353
- } else {
354
- keyModifiers.push(modifier);
355
- }
356
- }
357
- }
358
- }
359
- return {
360
- keyModifiers,
361
- nonKeyModifiers,
362
- eventOptionModifiers
363
- };
210
+ const keyModifiers = [];
211
+ const nonKeyModifiers = [];
212
+ const eventOptionModifiers = [];
213
+ for (let i = 0; i < modifiers.length; i++) {
214
+ const modifier = modifiers[i].content;
215
+ if (modifier === "native" && context && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
216
+ else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
217
+ else {
218
+ const keyString = isString(key) ? key : isStaticExp(key) ? key.content : null;
219
+ if (maybeKeyModifier(modifier)) if (keyString) if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
220
+ else nonKeyModifiers.push(modifier);
221
+ else {
222
+ keyModifiers.push(modifier);
223
+ nonKeyModifiers.push(modifier);
224
+ }
225
+ else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
226
+ else keyModifiers.push(modifier);
227
+ }
228
+ }
229
+ return {
230
+ keyModifiers,
231
+ nonKeyModifiers,
232
+ eventOptionModifiers
233
+ };
364
234
  };
365
235
  const transformClick = (key, event) => {
366
- const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
367
- return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
368
- `(`,
369
- key,
370
- `) === "onClick" ? "${event}" : (`,
371
- key,
372
- `)`
373
- ]) : key;
236
+ return isStaticExp(key) && key.content.toLowerCase() === "onclick" ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
237
+ `(`,
238
+ key,
239
+ `) === "onClick" ? "${event}" : (`,
240
+ key,
241
+ `)`
242
+ ]) : key;
374
243
  };
375
- const transformOn = (dir, node, context) => {
376
- return transformOn$1(dir, node, context, (baseResult) => {
377
- const { modifiers } = dir;
378
- if (!modifiers.length) return baseResult;
379
- let { key, value: handlerExp } = baseResult.props[0];
380
- const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
381
- if (nonKeyModifiers.includes("right")) {
382
- key = transformClick(key, `onContextmenu`);
383
- }
384
- if (nonKeyModifiers.includes("middle")) {
385
- key = transformClick(key, `onMouseup`);
386
- }
387
- if (nonKeyModifiers.length) {
388
- handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
389
- handlerExp,
390
- JSON.stringify(nonKeyModifiers)
391
- ]);
392
- }
393
- if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
394
- (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
395
- handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
396
- handlerExp,
397
- JSON.stringify(keyModifiers)
398
- ]);
399
- }
400
- if (eventOptionModifiers.length) {
401
- const modifierPostfix = eventOptionModifiers.map(capitalize).join("");
402
- key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
403
- }
404
- return {
405
- props: [createObjectProperty(key, handlerExp)]
406
- };
407
- });
244
+ const transformOn$1 = (dir, node, context) => {
245
+ return transformOn(dir, node, context, (baseResult) => {
246
+ const { modifiers } = dir;
247
+ if (!modifiers.length) return baseResult;
248
+ let { key, value: handlerExp } = baseResult.props[0];
249
+ const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
250
+ if (nonKeyModifiers.includes("right")) key = transformClick(key, `onContextmenu`);
251
+ if (nonKeyModifiers.includes("middle")) key = transformClick(key, `onMouseup`);
252
+ if (nonKeyModifiers.length) handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [handlerExp, JSON.stringify(nonKeyModifiers)]);
253
+ if (keyModifiers.length && (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [handlerExp, JSON.stringify(keyModifiers)]);
254
+ if (eventOptionModifiers.length) {
255
+ const modifierPostfix = eventOptionModifiers.map(capitalize).join("");
256
+ key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([
257
+ `(`,
258
+ key,
259
+ `) + "${modifierPostfix}"`
260
+ ]);
261
+ }
262
+ return { props: [createObjectProperty(key, handlerExp)] };
263
+ });
408
264
  };
409
-
265
+ //#endregion
266
+ //#region packages/compiler-dom/src/transforms/vShow.ts
410
267
  const transformShow = (dir, node, context) => {
411
- const { exp, loc } = dir;
412
- if (!exp) {
413
- context.onError(
414
- createDOMCompilerError(61, loc)
415
- );
416
- }
417
- return {
418
- props: [],
419
- needRuntime: context.helper(V_SHOW)
420
- };
268
+ const { exp, loc } = dir;
269
+ if (!exp) context.onError(createDOMCompilerError(62, loc));
270
+ return {
271
+ props: [],
272
+ needRuntime: context.helper(V_SHOW)
273
+ };
421
274
  };
422
-
275
+ //#endregion
276
+ //#region packages/compiler-dom/src/transforms/Transition.ts
423
277
  const transformTransition = (node, context) => {
424
- if (node.type === 1 && node.tagType === 1) {
425
- const component = context.isBuiltInComponent(node.tag);
426
- if (component === TRANSITION) {
427
- return postTransformTransition(node, context.onError);
428
- }
429
- }
278
+ if (node.type === 1 && node.tagType === 1) {
279
+ if (context.isBuiltInComponent(node.tag) === TRANSITION) return postTransformTransition(node, context.onError);
280
+ }
430
281
  };
431
282
  function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
432
- return () => {
433
- if (!node.children.length) {
434
- return;
435
- }
436
- if (hasMultipleChildren(node)) {
437
- onError(
438
- createDOMCompilerError(62, {
439
- start: node.children[0].loc.start,
440
- end: node.children[node.children.length - 1].loc.end,
441
- source: ""
442
- })
443
- );
444
- }
445
- const child = node.children[0];
446
- if (child.type === 1) {
447
- for (const p of child.props) {
448
- if (p.type === 7 && p.name === "show") {
449
- node.props.push({
450
- type: 6,
451
- name: "persisted",
452
- nameLoc: node.loc,
453
- value: void 0,
454
- loc: node.loc
455
- });
456
- }
457
- }
458
- }
459
- };
283
+ return () => {
284
+ if (!node.children.length) return;
285
+ if (hasMultipleChildren(node)) onError(createDOMCompilerError(63, {
286
+ start: node.children[0].loc.start,
287
+ end: node.children[node.children.length - 1].loc.end,
288
+ source: ""
289
+ }));
290
+ const child = node.children[0];
291
+ if (child.type === 1) {
292
+ for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
293
+ type: 6,
294
+ name: "persisted",
295
+ nameLoc: node.loc,
296
+ value: void 0,
297
+ loc: node.loc
298
+ });
299
+ }
300
+ };
460
301
  }
461
302
  function defaultHasMultipleChildren(node) {
462
- const children = node.children = node.children.filter(
463
- (c) => !isCommentOrWhitespace(c)
464
- );
465
- const child = children[0];
466
- return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
303
+ const children = node.children = node.children.filter((c) => !isCommentOrWhitespace(c));
304
+ const child = children[0];
305
+ return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
467
306
  }
468
-
307
+ //#endregion
308
+ //#region packages/compiler-dom/src/transforms/ignoreSideEffectTags.ts
469
309
  const ignoreSideEffectTags = (node, context) => {
470
- if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
471
- !!(process.env.NODE_ENV !== "production") && context.onError(
472
- createDOMCompilerError(
473
- 63,
474
- node.loc
475
- )
476
- );
477
- context.removeNode();
478
- }
310
+ if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
311
+ process.env.NODE_ENV !== "production" && context.onError(createDOMCompilerError(64, node.loc));
312
+ context.removeNode();
313
+ }
479
314
  };
480
-
315
+ //#endregion
316
+ //#region packages/compiler-dom/src/htmlNesting.ts
317
+ /**
318
+ * Copied from https://github.com/MananTank/validate-html-nesting
319
+ * with ISC license
320
+ *
321
+ * To avoid runtime dependency on validate-html-nesting
322
+ * This file should not change very often in the original repo
323
+ * but we may need to keep it up-to-date from time to time.
324
+ */
325
+ /**
326
+ * returns true if given parent-child nesting is valid HTML
327
+ */
481
328
  function isValidHTMLNesting(parent, child) {
482
- if (parent === "template") {
483
- return true;
484
- }
485
- if (parent in onlyValidChildren) {
486
- return onlyValidChildren[parent].has(child);
487
- }
488
- if (child in onlyValidParents) {
489
- return onlyValidParents[child].has(parent);
490
- }
491
- if (parent in knownInvalidChildren) {
492
- if (knownInvalidChildren[parent].has(child)) return false;
493
- }
494
- if (child in knownInvalidParents) {
495
- if (knownInvalidParents[child].has(parent)) return false;
496
- }
497
- return true;
329
+ if (parent === "template") return true;
330
+ if (parent in onlyValidChildren) return onlyValidChildren[parent].has(child);
331
+ if (child in onlyValidParents) return onlyValidParents[child].has(parent);
332
+ if (parent in knownInvalidChildren) {
333
+ if (knownInvalidChildren[parent].has(child)) return false;
334
+ }
335
+ if (child in knownInvalidParents) {
336
+ if (knownInvalidParents[child].has(parent)) return false;
337
+ }
338
+ return true;
498
339
  }
499
- const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
340
+ const headings = new Set([
341
+ "h1",
342
+ "h2",
343
+ "h3",
344
+ "h4",
345
+ "h5",
346
+ "h6"
347
+ ]);
500
348
  const emptySet = /* @__PURE__ */ new Set([]);
349
+ /**
350
+ * maps element to set of elements that can be it's children, no other */
501
351
  const onlyValidChildren = {
502
- head: /* @__PURE__ */ new Set([
503
- "base",
504
- "basefront",
505
- "bgsound",
506
- "link",
507
- "meta",
508
- "title",
509
- "noscript",
510
- "noframes",
511
- "style",
512
- "script",
513
- "template"
514
- ]),
515
- optgroup: /* @__PURE__ */ new Set(["option"]),
516
- select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
517
- // table
518
- table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
519
- tr: /* @__PURE__ */ new Set(["td", "th"]),
520
- colgroup: /* @__PURE__ */ new Set(["col"]),
521
- tbody: /* @__PURE__ */ new Set(["tr"]),
522
- thead: /* @__PURE__ */ new Set(["tr"]),
523
- tfoot: /* @__PURE__ */ new Set(["tr"]),
524
- // these elements can not have any children elements
525
- script: emptySet,
526
- iframe: emptySet,
527
- option: emptySet,
528
- textarea: emptySet,
529
- style: emptySet,
530
- title: emptySet
352
+ head: new Set([
353
+ "base",
354
+ "basefront",
355
+ "bgsound",
356
+ "link",
357
+ "meta",
358
+ "title",
359
+ "noscript",
360
+ "noframes",
361
+ "style",
362
+ "script",
363
+ "template"
364
+ ]),
365
+ optgroup: new Set(["option"]),
366
+ select: new Set([
367
+ "optgroup",
368
+ "option",
369
+ "hr"
370
+ ]),
371
+ table: new Set([
372
+ "caption",
373
+ "colgroup",
374
+ "tbody",
375
+ "tfoot",
376
+ "thead"
377
+ ]),
378
+ tr: new Set(["td", "th"]),
379
+ colgroup: new Set(["col"]),
380
+ tbody: new Set(["tr"]),
381
+ thead: new Set(["tr"]),
382
+ tfoot: new Set(["tr"]),
383
+ script: emptySet,
384
+ iframe: emptySet,
385
+ option: emptySet,
386
+ textarea: emptySet,
387
+ style: emptySet,
388
+ title: emptySet
531
389
  };
390
+ /** maps elements to set of elements which can be it's parent, no other */
532
391
  const onlyValidParents = {
533
- // sections
534
- html: emptySet,
535
- body: /* @__PURE__ */ new Set(["html"]),
536
- head: /* @__PURE__ */ new Set(["html"]),
537
- // table
538
- td: /* @__PURE__ */ new Set(["tr"]),
539
- colgroup: /* @__PURE__ */ new Set(["table"]),
540
- caption: /* @__PURE__ */ new Set(["table"]),
541
- tbody: /* @__PURE__ */ new Set(["table"]),
542
- tfoot: /* @__PURE__ */ new Set(["table"]),
543
- col: /* @__PURE__ */ new Set(["colgroup"]),
544
- th: /* @__PURE__ */ new Set(["tr"]),
545
- thead: /* @__PURE__ */ new Set(["table"]),
546
- tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
547
- // data list
548
- dd: /* @__PURE__ */ new Set(["dl", "div"]),
549
- dt: /* @__PURE__ */ new Set(["dl", "div"]),
550
- // other
551
- figcaption: /* @__PURE__ */ new Set(["figure"]),
552
- // li: new Set(["ul", "ol"]),
553
- summary: /* @__PURE__ */ new Set(["details"]),
554
- area: /* @__PURE__ */ new Set(["map"])
392
+ html: emptySet,
393
+ body: new Set(["html"]),
394
+ head: new Set(["html"]),
395
+ td: new Set(["tr"]),
396
+ colgroup: new Set(["table"]),
397
+ caption: new Set(["table"]),
398
+ tbody: new Set(["table"]),
399
+ tfoot: new Set(["table"]),
400
+ col: new Set(["colgroup"]),
401
+ th: new Set(["tr"]),
402
+ thead: new Set(["table"]),
403
+ tr: new Set([
404
+ "tbody",
405
+ "thead",
406
+ "tfoot"
407
+ ]),
408
+ dd: new Set(["dl", "div"]),
409
+ dt: new Set(["dl", "div"]),
410
+ figcaption: new Set(["figure"]),
411
+ summary: new Set(["details"]),
412
+ area: new Set(["map"])
555
413
  };
414
+ /** maps element to set of elements that can not be it's children, others can */
556
415
  const knownInvalidChildren = {
557
- p: /* @__PURE__ */ new Set([
558
- "address",
559
- "article",
560
- "aside",
561
- "blockquote",
562
- "center",
563
- "details",
564
- "dialog",
565
- "dir",
566
- "div",
567
- "dl",
568
- "fieldset",
569
- "figure",
570
- "footer",
571
- "form",
572
- "h1",
573
- "h2",
574
- "h3",
575
- "h4",
576
- "h5",
577
- "h6",
578
- "header",
579
- "hgroup",
580
- "hr",
581
- "li",
582
- "main",
583
- "nav",
584
- "menu",
585
- "ol",
586
- "p",
587
- "pre",
588
- "section",
589
- "table",
590
- "ul"
591
- ]),
592
- svg: /* @__PURE__ */ new Set([
593
- "b",
594
- "blockquote",
595
- "br",
596
- "code",
597
- "dd",
598
- "div",
599
- "dl",
600
- "dt",
601
- "em",
602
- "embed",
603
- "h1",
604
- "h2",
605
- "h3",
606
- "h4",
607
- "h5",
608
- "h6",
609
- "hr",
610
- "i",
611
- "img",
612
- "li",
613
- "menu",
614
- "meta",
615
- "ol",
616
- "p",
617
- "pre",
618
- "ruby",
619
- "s",
620
- "small",
621
- "span",
622
- "strong",
623
- "sub",
624
- "sup",
625
- "table",
626
- "u",
627
- "ul",
628
- "var"
629
- ])
416
+ p: new Set([
417
+ "address",
418
+ "article",
419
+ "aside",
420
+ "blockquote",
421
+ "center",
422
+ "details",
423
+ "dialog",
424
+ "dir",
425
+ "div",
426
+ "dl",
427
+ "fieldset",
428
+ "figure",
429
+ "footer",
430
+ "form",
431
+ "h1",
432
+ "h2",
433
+ "h3",
434
+ "h4",
435
+ "h5",
436
+ "h6",
437
+ "header",
438
+ "hgroup",
439
+ "hr",
440
+ "li",
441
+ "main",
442
+ "nav",
443
+ "menu",
444
+ "ol",
445
+ "p",
446
+ "pre",
447
+ "section",
448
+ "table",
449
+ "ul"
450
+ ]),
451
+ svg: new Set([
452
+ "b",
453
+ "blockquote",
454
+ "br",
455
+ "code",
456
+ "dd",
457
+ "div",
458
+ "dl",
459
+ "dt",
460
+ "em",
461
+ "embed",
462
+ "h1",
463
+ "h2",
464
+ "h3",
465
+ "h4",
466
+ "h5",
467
+ "h6",
468
+ "hr",
469
+ "i",
470
+ "img",
471
+ "li",
472
+ "menu",
473
+ "meta",
474
+ "ol",
475
+ "p",
476
+ "pre",
477
+ "ruby",
478
+ "s",
479
+ "small",
480
+ "span",
481
+ "strong",
482
+ "sub",
483
+ "sup",
484
+ "table",
485
+ "u",
486
+ "ul",
487
+ "var"
488
+ ])
630
489
  };
490
+ /** maps element to set of elements that can not be it's parent, others can */
631
491
  const knownInvalidParents = {
632
- a: /* @__PURE__ */ new Set(["a"]),
633
- button: /* @__PURE__ */ new Set(["button"]),
634
- dd: /* @__PURE__ */ new Set(["dd", "dt"]),
635
- dt: /* @__PURE__ */ new Set(["dd", "dt"]),
636
- form: /* @__PURE__ */ new Set(["form"]),
637
- li: /* @__PURE__ */ new Set(["li"]),
638
- h1: headings,
639
- h2: headings,
640
- h3: headings,
641
- h4: headings,
642
- h5: headings,
643
- h6: headings
492
+ a: new Set(["a"]),
493
+ button: new Set(["button"]),
494
+ dd: new Set(["dd", "dt"]),
495
+ dt: new Set(["dd", "dt"]),
496
+ form: new Set(["form"]),
497
+ li: new Set(["li"]),
498
+ h1: headings,
499
+ h2: headings,
500
+ h3: headings,
501
+ h4: headings,
502
+ h5: headings,
503
+ h6: headings
644
504
  };
645
-
505
+ //#endregion
506
+ //#region packages/compiler-dom/src/transforms/validateHtmlNesting.ts
646
507
  const validateHtmlNesting = (node, context) => {
647
- if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
648
- const error = new SyntaxError(
649
- `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
650
- );
651
- error.loc = node.loc;
652
- context.onWarn(error);
653
- }
508
+ if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
509
+ 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.`);
510
+ error.loc = node.loc;
511
+ context.onWarn(error);
512
+ }
654
513
  };
655
-
656
- const DOMNodeTransforms = [
657
- transformStyle,
658
- ...!!(process.env.NODE_ENV !== "production") ? [transformTransition, validateHtmlNesting] : []
659
- ];
514
+ //#endregion
515
+ //#region packages/compiler-dom/src/index.ts
516
+ const DOMNodeTransforms = [transformStyle, ...!!(process.env.NODE_ENV !== "production") ? [transformTransition, validateHtmlNesting] : []];
660
517
  const DOMDirectiveTransforms = {
661
- cloak: noopDirectiveTransform,
662
- html: transformVHtml,
663
- text: transformVText,
664
- model: transformModel,
665
- // override compiler-core
666
- on: transformOn,
667
- // override compiler-core
668
- show: transformShow
518
+ cloak: noopDirectiveTransform,
519
+ html: transformVHtml,
520
+ text: transformVText,
521
+ model: transformModel$1,
522
+ on: transformOn$1,
523
+ show: transformShow
669
524
  };
670
525
  function compile(src, options = {}) {
671
- return baseCompile(
672
- src,
673
- extend({}, parserOptions, options, {
674
- nodeTransforms: [
675
- // ignore <script> and <tag>
676
- // this is not put inside DOMNodeTransforms because that list is used
677
- // by compiler-ssr to generate vnode fallback branches
678
- ignoreSideEffectTags,
679
- ...DOMNodeTransforms,
680
- ...options.nodeTransforms || []
681
- ],
682
- directiveTransforms: extend(
683
- {},
684
- DOMDirectiveTransforms,
685
- options.directiveTransforms || {}
686
- ),
687
- transformHoist: null
688
- })
689
- );
526
+ return baseCompile(src, extend({}, parserOptions, options, {
527
+ nodeTransforms: [
528
+ ignoreSideEffectTags,
529
+ ...DOMNodeTransforms,
530
+ ...options.nodeTransforms || []
531
+ ],
532
+ directiveTransforms: extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
533
+ transformHoist: null
534
+ }));
690
535
  }
691
536
  function parse(template, options = {}) {
692
- return baseParse(template, extend({}, parserOptions, options));
537
+ return baseParse(template, extend({}, parserOptions, options));
693
538
  }
694
-
539
+ //#endregion
695
540
  export { DOMDirectiveTransforms, DOMErrorCodes, DOMErrorMessages, DOMNodeTransforms, TRANSITION, TRANSITION_GROUP, V_MODEL_CHECKBOX, V_MODEL_DYNAMIC, V_MODEL_RADIO, V_MODEL_SELECT, V_MODEL_TEXT, V_ON_WITH_KEYS, V_ON_WITH_MODIFIERS, V_SHOW, compile, createDOMCompilerError, isKeyboardEvent, isValidHTMLNesting, parse, parserOptions, postTransformTransition, resolveModifiers, transformStyle };