@vue/compiler-dom 3.2.7 → 3.2.11
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 +22 -22
- package/dist/compiler-dom.cjs.prod.js +20 -20
- package/dist/compiler-dom.d.ts +12 -12
- package/dist/compiler-dom.esm-browser.js +92 -77
- package/dist/compiler-dom.esm-browser.prod.js +1 -1
- package/dist/compiler-dom.esm-bundler.js +22 -22
- package/dist/compiler-dom.global.js +92 -77
- package/dist/compiler-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/compiler-dom.cjs.js
CHANGED
|
@@ -2483,26 +2483,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
2483
2483
|
return compilerCore.createCompilerError(code, loc, DOMErrorMessages );
|
|
2484
2484
|
}
|
|
2485
2485
|
const DOMErrorMessages = {
|
|
2486
|
-
[
|
|
2487
|
-
[
|
|
2488
|
-
[
|
|
2489
|
-
[
|
|
2490
|
-
[
|
|
2491
|
-
[
|
|
2492
|
-
[
|
|
2493
|
-
[
|
|
2494
|
-
[
|
|
2495
|
-
[
|
|
2496
|
-
[
|
|
2486
|
+
[50 /* X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
2487
|
+
[51 /* X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
2488
|
+
[52 /* X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
2489
|
+
[53 /* X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
2490
|
+
[54 /* X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
2491
|
+
[55 /* X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
2492
|
+
[56 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
2493
|
+
[57 /* X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
2494
|
+
[58 /* X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
2495
|
+
[59 /* X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
2496
|
+
[60 /* X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
2497
2497
|
};
|
|
2498
2498
|
|
|
2499
2499
|
const transformVHtml = (dir, node, context) => {
|
|
2500
2500
|
const { exp, loc } = dir;
|
|
2501
2501
|
if (!exp) {
|
|
2502
|
-
context.onError(createDOMCompilerError(
|
|
2502
|
+
context.onError(createDOMCompilerError(50 /* X_V_HTML_NO_EXPRESSION */, loc));
|
|
2503
2503
|
}
|
|
2504
2504
|
if (node.children.length) {
|
|
2505
|
-
context.onError(createDOMCompilerError(
|
|
2505
|
+
context.onError(createDOMCompilerError(51 /* X_V_HTML_WITH_CHILDREN */, loc));
|
|
2506
2506
|
node.children.length = 0;
|
|
2507
2507
|
}
|
|
2508
2508
|
return {
|
|
@@ -2515,10 +2515,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
2515
2515
|
const transformVText = (dir, node, context) => {
|
|
2516
2516
|
const { exp, loc } = dir;
|
|
2517
2517
|
if (!exp) {
|
|
2518
|
-
context.onError(createDOMCompilerError(
|
|
2518
|
+
context.onError(createDOMCompilerError(52 /* X_V_TEXT_NO_EXPRESSION */, loc));
|
|
2519
2519
|
}
|
|
2520
2520
|
if (node.children.length) {
|
|
2521
|
-
context.onError(createDOMCompilerError(
|
|
2521
|
+
context.onError(createDOMCompilerError(53 /* X_V_TEXT_WITH_CHILDREN */, loc));
|
|
2522
2522
|
node.children.length = 0;
|
|
2523
2523
|
}
|
|
2524
2524
|
return {
|
|
@@ -2537,12 +2537,12 @@ const transformModel = (dir, node, context) => {
|
|
|
2537
2537
|
return baseResult;
|
|
2538
2538
|
}
|
|
2539
2539
|
if (dir.arg) {
|
|
2540
|
-
context.onError(createDOMCompilerError(
|
|
2540
|
+
context.onError(createDOMCompilerError(55 /* X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
2541
2541
|
}
|
|
2542
2542
|
function checkDuplicatedValue() {
|
|
2543
2543
|
const value = compilerCore.findProp(node, 'value');
|
|
2544
2544
|
if (value) {
|
|
2545
|
-
context.onError(createDOMCompilerError(
|
|
2545
|
+
context.onError(createDOMCompilerError(57 /* X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
2546
2546
|
}
|
|
2547
2547
|
}
|
|
2548
2548
|
const { tag } = node;
|
|
@@ -2570,7 +2570,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2570
2570
|
break;
|
|
2571
2571
|
case 'file':
|
|
2572
2572
|
isInvalidType = true;
|
|
2573
|
-
context.onError(createDOMCompilerError(
|
|
2573
|
+
context.onError(createDOMCompilerError(56 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
2574
2574
|
break;
|
|
2575
2575
|
default:
|
|
2576
2576
|
// text type
|
|
@@ -2604,7 +2604,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2604
2604
|
}
|
|
2605
2605
|
}
|
|
2606
2606
|
else {
|
|
2607
|
-
context.onError(createDOMCompilerError(
|
|
2607
|
+
context.onError(createDOMCompilerError(54 /* X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
2608
2608
|
}
|
|
2609
2609
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
2610
2610
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -2728,7 +2728,7 @@ const transformOn = (dir, node, context) => {
|
|
|
2728
2728
|
const transformShow = (dir, node, context) => {
|
|
2729
2729
|
const { exp, loc } = dir;
|
|
2730
2730
|
if (!exp) {
|
|
2731
|
-
context.onError(createDOMCompilerError(
|
|
2731
|
+
context.onError(createDOMCompilerError(58 /* X_V_SHOW_NO_EXPRESSION */, loc));
|
|
2732
2732
|
}
|
|
2733
2733
|
return {
|
|
2734
2734
|
props: [],
|
|
@@ -2743,7 +2743,7 @@ const warnTransitionChildren = (node, context) => {
|
|
|
2743
2743
|
if (component === TRANSITION) {
|
|
2744
2744
|
return () => {
|
|
2745
2745
|
if (node.children.length && hasMultipleChildren(node)) {
|
|
2746
|
-
context.onError(createDOMCompilerError(
|
|
2746
|
+
context.onError(createDOMCompilerError(59 /* X_TRANSITION_INVALID_CHILDREN */, {
|
|
2747
2747
|
start: node.children[0].loc.start,
|
|
2748
2748
|
end: node.children[node.children.length - 1].loc.end,
|
|
2749
2749
|
source: ''
|
|
@@ -3024,7 +3024,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
3024
3024
|
if (node.type === 1 /* ELEMENT */ &&
|
|
3025
3025
|
node.tagType === 0 /* ELEMENT */ &&
|
|
3026
3026
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
3027
|
-
context.onError(createDOMCompilerError(
|
|
3027
|
+
context.onError(createDOMCompilerError(60 /* X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
3028
3028
|
context.removeNode();
|
|
3029
3029
|
}
|
|
3030
3030
|
};
|
|
@@ -2483,26 +2483,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
2483
2483
|
return compilerCore.createCompilerError(code, loc, DOMErrorMessages );
|
|
2484
2484
|
}
|
|
2485
2485
|
const DOMErrorMessages = {
|
|
2486
|
-
[
|
|
2487
|
-
[
|
|
2488
|
-
[
|
|
2489
|
-
[
|
|
2490
|
-
[
|
|
2491
|
-
[
|
|
2492
|
-
[
|
|
2493
|
-
[
|
|
2494
|
-
[
|
|
2495
|
-
[
|
|
2496
|
-
[
|
|
2486
|
+
[50 /* X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
2487
|
+
[51 /* X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
2488
|
+
[52 /* X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
2489
|
+
[53 /* X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
2490
|
+
[54 /* X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
2491
|
+
[55 /* X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
2492
|
+
[56 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
2493
|
+
[57 /* X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
2494
|
+
[58 /* X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
2495
|
+
[59 /* X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
2496
|
+
[60 /* X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
2497
2497
|
};
|
|
2498
2498
|
|
|
2499
2499
|
const transformVHtml = (dir, node, context) => {
|
|
2500
2500
|
const { exp, loc } = dir;
|
|
2501
2501
|
if (!exp) {
|
|
2502
|
-
context.onError(createDOMCompilerError(
|
|
2502
|
+
context.onError(createDOMCompilerError(50 /* X_V_HTML_NO_EXPRESSION */, loc));
|
|
2503
2503
|
}
|
|
2504
2504
|
if (node.children.length) {
|
|
2505
|
-
context.onError(createDOMCompilerError(
|
|
2505
|
+
context.onError(createDOMCompilerError(51 /* X_V_HTML_WITH_CHILDREN */, loc));
|
|
2506
2506
|
node.children.length = 0;
|
|
2507
2507
|
}
|
|
2508
2508
|
return {
|
|
@@ -2515,10 +2515,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
2515
2515
|
const transformVText = (dir, node, context) => {
|
|
2516
2516
|
const { exp, loc } = dir;
|
|
2517
2517
|
if (!exp) {
|
|
2518
|
-
context.onError(createDOMCompilerError(
|
|
2518
|
+
context.onError(createDOMCompilerError(52 /* X_V_TEXT_NO_EXPRESSION */, loc));
|
|
2519
2519
|
}
|
|
2520
2520
|
if (node.children.length) {
|
|
2521
|
-
context.onError(createDOMCompilerError(
|
|
2521
|
+
context.onError(createDOMCompilerError(53 /* X_V_TEXT_WITH_CHILDREN */, loc));
|
|
2522
2522
|
node.children.length = 0;
|
|
2523
2523
|
}
|
|
2524
2524
|
return {
|
|
@@ -2537,7 +2537,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2537
2537
|
return baseResult;
|
|
2538
2538
|
}
|
|
2539
2539
|
if (dir.arg) {
|
|
2540
|
-
context.onError(createDOMCompilerError(
|
|
2540
|
+
context.onError(createDOMCompilerError(55 /* X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
2541
2541
|
}
|
|
2542
2542
|
const { tag } = node;
|
|
2543
2543
|
const isCustomElement = context.isCustomElement(tag);
|
|
@@ -2564,7 +2564,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2564
2564
|
break;
|
|
2565
2565
|
case 'file':
|
|
2566
2566
|
isInvalidType = true;
|
|
2567
|
-
context.onError(createDOMCompilerError(
|
|
2567
|
+
context.onError(createDOMCompilerError(56 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
2568
2568
|
break;
|
|
2569
2569
|
}
|
|
2570
2570
|
}
|
|
@@ -2588,7 +2588,7 @@ const transformModel = (dir, node, context) => {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
}
|
|
2590
2590
|
else {
|
|
2591
|
-
context.onError(createDOMCompilerError(
|
|
2591
|
+
context.onError(createDOMCompilerError(54 /* X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
2592
2592
|
}
|
|
2593
2593
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
2594
2594
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -2712,7 +2712,7 @@ const transformOn = (dir, node, context) => {
|
|
|
2712
2712
|
const transformShow = (dir, node, context) => {
|
|
2713
2713
|
const { exp, loc } = dir;
|
|
2714
2714
|
if (!exp) {
|
|
2715
|
-
context.onError(createDOMCompilerError(
|
|
2715
|
+
context.onError(createDOMCompilerError(58 /* X_V_SHOW_NO_EXPRESSION */, loc));
|
|
2716
2716
|
}
|
|
2717
2717
|
return {
|
|
2718
2718
|
props: [],
|
|
@@ -2982,7 +2982,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
2982
2982
|
if (node.type === 1 /* ELEMENT */ &&
|
|
2983
2983
|
node.tagType === 0 /* ELEMENT */ &&
|
|
2984
2984
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
2985
|
-
context.onError(createDOMCompilerError(
|
|
2985
|
+
context.onError(createDOMCompilerError(60 /* X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
2986
2986
|
context.removeNode();
|
|
2987
2987
|
}
|
|
2988
2988
|
};
|
package/dist/compiler-dom.d.ts
CHANGED
|
@@ -18,18 +18,18 @@ declare interface DOMCompilerError extends CompilerError {
|
|
|
18
18
|
export declare const DOMDirectiveTransforms: Record<string, DirectiveTransform>;
|
|
19
19
|
|
|
20
20
|
export declare const enum DOMErrorCodes {
|
|
21
|
-
X_V_HTML_NO_EXPRESSION =
|
|
22
|
-
X_V_HTML_WITH_CHILDREN =
|
|
23
|
-
X_V_TEXT_NO_EXPRESSION =
|
|
24
|
-
X_V_TEXT_WITH_CHILDREN =
|
|
25
|
-
X_V_MODEL_ON_INVALID_ELEMENT =
|
|
26
|
-
X_V_MODEL_ARG_ON_ELEMENT =
|
|
27
|
-
X_V_MODEL_ON_FILE_INPUT_ELEMENT =
|
|
28
|
-
X_V_MODEL_UNNECESSARY_VALUE =
|
|
29
|
-
X_V_SHOW_NO_EXPRESSION =
|
|
30
|
-
X_TRANSITION_INVALID_CHILDREN =
|
|
31
|
-
X_IGNORED_SIDE_EFFECT_TAG =
|
|
32
|
-
__EXTEND_POINT__ =
|
|
21
|
+
X_V_HTML_NO_EXPRESSION = 50,
|
|
22
|
+
X_V_HTML_WITH_CHILDREN = 51,
|
|
23
|
+
X_V_TEXT_NO_EXPRESSION = 52,
|
|
24
|
+
X_V_TEXT_WITH_CHILDREN = 53,
|
|
25
|
+
X_V_MODEL_ON_INVALID_ELEMENT = 54,
|
|
26
|
+
X_V_MODEL_ARG_ON_ELEMENT = 55,
|
|
27
|
+
X_V_MODEL_ON_FILE_INPUT_ELEMENT = 56,
|
|
28
|
+
X_V_MODEL_UNNECESSARY_VALUE = 57,
|
|
29
|
+
X_V_SHOW_NO_EXPRESSION = 58,
|
|
30
|
+
X_TRANSITION_INVALID_CHILDREN = 59,
|
|
31
|
+
X_IGNORED_SIDE_EFFECT_TAG = 60,
|
|
32
|
+
__EXTEND_POINT__ = 61
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export declare const DOMNodeTransforms: NodeTransform[];
|