@vue/compiler-dom 3.4.26 → 3.5.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler-dom.cjs.js +176 -2
- package/dist/compiler-dom.cjs.prod.js +1 -1
- package/dist/compiler-dom.esm-browser.js +176 -2
- package/dist/compiler-dom.esm-browser.prod.js +1 -1
- package/dist/compiler-dom.esm-bundler.js +176 -2
- package/dist/compiler-dom.global.js +176 -2
- package/dist/compiler-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/compiler-dom.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-dom v3.
|
|
2
|
+
* @vue/compiler-dom v3.5.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -664,9 +664,183 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
|
|
667
|
+
function isValidHTMLNesting(parent, child) {
|
|
668
|
+
if (parent in onlyValidChildren) {
|
|
669
|
+
return onlyValidChildren[parent].has(child);
|
|
670
|
+
}
|
|
671
|
+
if (child in onlyValidParents) {
|
|
672
|
+
return onlyValidParents[child].has(parent);
|
|
673
|
+
}
|
|
674
|
+
if (parent in knownInvalidChildren) {
|
|
675
|
+
if (knownInvalidChildren[parent].has(child))
|
|
676
|
+
return false;
|
|
677
|
+
}
|
|
678
|
+
if (child in knownInvalidParents) {
|
|
679
|
+
if (knownInvalidParents[child].has(parent))
|
|
680
|
+
return false;
|
|
681
|
+
}
|
|
682
|
+
return true;
|
|
683
|
+
}
|
|
684
|
+
const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
685
|
+
const emptySet = /* @__PURE__ */ new Set([]);
|
|
686
|
+
const onlyValidChildren = {
|
|
687
|
+
head: /* @__PURE__ */ new Set([
|
|
688
|
+
"base",
|
|
689
|
+
"basefront",
|
|
690
|
+
"bgsound",
|
|
691
|
+
"link",
|
|
692
|
+
"meta",
|
|
693
|
+
"title",
|
|
694
|
+
"noscript",
|
|
695
|
+
"noframes",
|
|
696
|
+
"style",
|
|
697
|
+
"script",
|
|
698
|
+
"template"
|
|
699
|
+
]),
|
|
700
|
+
optgroup: /* @__PURE__ */ new Set(["option"]),
|
|
701
|
+
select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
|
|
702
|
+
// table
|
|
703
|
+
table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
|
|
704
|
+
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
|
705
|
+
colgroup: /* @__PURE__ */ new Set(["col"]),
|
|
706
|
+
tbody: /* @__PURE__ */ new Set(["tr"]),
|
|
707
|
+
thead: /* @__PURE__ */ new Set(["tr"]),
|
|
708
|
+
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
|
709
|
+
// these elements can not have any children elements
|
|
710
|
+
script: emptySet,
|
|
711
|
+
iframe: emptySet,
|
|
712
|
+
option: emptySet,
|
|
713
|
+
textarea: emptySet,
|
|
714
|
+
style: emptySet,
|
|
715
|
+
title: emptySet
|
|
716
|
+
};
|
|
717
|
+
const onlyValidParents = {
|
|
718
|
+
// sections
|
|
719
|
+
html: emptySet,
|
|
720
|
+
body: /* @__PURE__ */ new Set(["html"]),
|
|
721
|
+
head: /* @__PURE__ */ new Set(["html"]),
|
|
722
|
+
// table
|
|
723
|
+
td: /* @__PURE__ */ new Set(["tr"]),
|
|
724
|
+
colgroup: /* @__PURE__ */ new Set(["table"]),
|
|
725
|
+
caption: /* @__PURE__ */ new Set(["table"]),
|
|
726
|
+
tbody: /* @__PURE__ */ new Set(["table"]),
|
|
727
|
+
tfoot: /* @__PURE__ */ new Set(["table"]),
|
|
728
|
+
col: /* @__PURE__ */ new Set(["colgroup"]),
|
|
729
|
+
th: /* @__PURE__ */ new Set(["tr"]),
|
|
730
|
+
thead: /* @__PURE__ */ new Set(["table"]),
|
|
731
|
+
tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
|
|
732
|
+
// data list
|
|
733
|
+
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
734
|
+
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
735
|
+
// other
|
|
736
|
+
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
|
737
|
+
// li: new Set(["ul", "ol"]),
|
|
738
|
+
summary: /* @__PURE__ */ new Set(["details"]),
|
|
739
|
+
area: /* @__PURE__ */ new Set(["map"])
|
|
740
|
+
};
|
|
741
|
+
const knownInvalidChildren = {
|
|
742
|
+
p: /* @__PURE__ */ new Set([
|
|
743
|
+
"address",
|
|
744
|
+
"article",
|
|
745
|
+
"aside",
|
|
746
|
+
"blockquote",
|
|
747
|
+
"center",
|
|
748
|
+
"details",
|
|
749
|
+
"dialog",
|
|
750
|
+
"dir",
|
|
751
|
+
"div",
|
|
752
|
+
"dl",
|
|
753
|
+
"fieldset",
|
|
754
|
+
"figure",
|
|
755
|
+
"footer",
|
|
756
|
+
"form",
|
|
757
|
+
"h1",
|
|
758
|
+
"h2",
|
|
759
|
+
"h3",
|
|
760
|
+
"h4",
|
|
761
|
+
"h5",
|
|
762
|
+
"h6",
|
|
763
|
+
"header",
|
|
764
|
+
"hgroup",
|
|
765
|
+
"hr",
|
|
766
|
+
"li",
|
|
767
|
+
"main",
|
|
768
|
+
"nav",
|
|
769
|
+
"menu",
|
|
770
|
+
"ol",
|
|
771
|
+
"p",
|
|
772
|
+
"pre",
|
|
773
|
+
"section",
|
|
774
|
+
"table",
|
|
775
|
+
"ul"
|
|
776
|
+
]),
|
|
777
|
+
svg: /* @__PURE__ */ new Set([
|
|
778
|
+
"b",
|
|
779
|
+
"blockquote",
|
|
780
|
+
"br",
|
|
781
|
+
"code",
|
|
782
|
+
"dd",
|
|
783
|
+
"div",
|
|
784
|
+
"dl",
|
|
785
|
+
"dt",
|
|
786
|
+
"em",
|
|
787
|
+
"embed",
|
|
788
|
+
"h1",
|
|
789
|
+
"h2",
|
|
790
|
+
"h3",
|
|
791
|
+
"h4",
|
|
792
|
+
"h5",
|
|
793
|
+
"h6",
|
|
794
|
+
"hr",
|
|
795
|
+
"i",
|
|
796
|
+
"img",
|
|
797
|
+
"li",
|
|
798
|
+
"menu",
|
|
799
|
+
"meta",
|
|
800
|
+
"ol",
|
|
801
|
+
"p",
|
|
802
|
+
"pre",
|
|
803
|
+
"ruby",
|
|
804
|
+
"s",
|
|
805
|
+
"small",
|
|
806
|
+
"span",
|
|
807
|
+
"strong",
|
|
808
|
+
"sub",
|
|
809
|
+
"sup",
|
|
810
|
+
"table",
|
|
811
|
+
"u",
|
|
812
|
+
"ul",
|
|
813
|
+
"var"
|
|
814
|
+
])
|
|
815
|
+
};
|
|
816
|
+
const knownInvalidParents = {
|
|
817
|
+
a: /* @__PURE__ */ new Set(["a"]),
|
|
818
|
+
button: /* @__PURE__ */ new Set(["button"]),
|
|
819
|
+
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
820
|
+
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
821
|
+
form: /* @__PURE__ */ new Set(["form"]),
|
|
822
|
+
li: /* @__PURE__ */ new Set(["li"]),
|
|
823
|
+
h1: headings,
|
|
824
|
+
h2: headings,
|
|
825
|
+
h3: headings,
|
|
826
|
+
h4: headings,
|
|
827
|
+
h5: headings,
|
|
828
|
+
h6: headings
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
const validateHtmlNesting = (node, context) => {
|
|
832
|
+
if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
|
|
833
|
+
const error = new SyntaxError(
|
|
834
|
+
`<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
|
|
835
|
+
);
|
|
836
|
+
error.loc = node.loc;
|
|
837
|
+
context.onWarn(error);
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
|
|
667
841
|
const DOMNodeTransforms = [
|
|
668
842
|
transformStyle,
|
|
669
|
-
...[transformTransition]
|
|
843
|
+
...[transformTransition, validateHtmlNesting]
|
|
670
844
|
];
|
|
671
845
|
const DOMDirectiveTransforms = {
|
|
672
846
|
cloak: compilerCore.noopDirectiveTransform,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-dom v3.
|
|
2
|
+
* @vue/compiler-dom v3.5.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -6270,9 +6270,183 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
6270
6270
|
}
|
|
6271
6271
|
};
|
|
6272
6272
|
|
|
6273
|
+
function isValidHTMLNesting(parent, child) {
|
|
6274
|
+
if (parent in onlyValidChildren) {
|
|
6275
|
+
return onlyValidChildren[parent].has(child);
|
|
6276
|
+
}
|
|
6277
|
+
if (child in onlyValidParents) {
|
|
6278
|
+
return onlyValidParents[child].has(parent);
|
|
6279
|
+
}
|
|
6280
|
+
if (parent in knownInvalidChildren) {
|
|
6281
|
+
if (knownInvalidChildren[parent].has(child))
|
|
6282
|
+
return false;
|
|
6283
|
+
}
|
|
6284
|
+
if (child in knownInvalidParents) {
|
|
6285
|
+
if (knownInvalidParents[child].has(parent))
|
|
6286
|
+
return false;
|
|
6287
|
+
}
|
|
6288
|
+
return true;
|
|
6289
|
+
}
|
|
6290
|
+
const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
6291
|
+
const emptySet = /* @__PURE__ */ new Set([]);
|
|
6292
|
+
const onlyValidChildren = {
|
|
6293
|
+
head: /* @__PURE__ */ new Set([
|
|
6294
|
+
"base",
|
|
6295
|
+
"basefront",
|
|
6296
|
+
"bgsound",
|
|
6297
|
+
"link",
|
|
6298
|
+
"meta",
|
|
6299
|
+
"title",
|
|
6300
|
+
"noscript",
|
|
6301
|
+
"noframes",
|
|
6302
|
+
"style",
|
|
6303
|
+
"script",
|
|
6304
|
+
"template"
|
|
6305
|
+
]),
|
|
6306
|
+
optgroup: /* @__PURE__ */ new Set(["option"]),
|
|
6307
|
+
select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
|
|
6308
|
+
// table
|
|
6309
|
+
table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
|
|
6310
|
+
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
|
6311
|
+
colgroup: /* @__PURE__ */ new Set(["col"]),
|
|
6312
|
+
tbody: /* @__PURE__ */ new Set(["tr"]),
|
|
6313
|
+
thead: /* @__PURE__ */ new Set(["tr"]),
|
|
6314
|
+
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
|
6315
|
+
// these elements can not have any children elements
|
|
6316
|
+
script: emptySet,
|
|
6317
|
+
iframe: emptySet,
|
|
6318
|
+
option: emptySet,
|
|
6319
|
+
textarea: emptySet,
|
|
6320
|
+
style: emptySet,
|
|
6321
|
+
title: emptySet
|
|
6322
|
+
};
|
|
6323
|
+
const onlyValidParents = {
|
|
6324
|
+
// sections
|
|
6325
|
+
html: emptySet,
|
|
6326
|
+
body: /* @__PURE__ */ new Set(["html"]),
|
|
6327
|
+
head: /* @__PURE__ */ new Set(["html"]),
|
|
6328
|
+
// table
|
|
6329
|
+
td: /* @__PURE__ */ new Set(["tr"]),
|
|
6330
|
+
colgroup: /* @__PURE__ */ new Set(["table"]),
|
|
6331
|
+
caption: /* @__PURE__ */ new Set(["table"]),
|
|
6332
|
+
tbody: /* @__PURE__ */ new Set(["table"]),
|
|
6333
|
+
tfoot: /* @__PURE__ */ new Set(["table"]),
|
|
6334
|
+
col: /* @__PURE__ */ new Set(["colgroup"]),
|
|
6335
|
+
th: /* @__PURE__ */ new Set(["tr"]),
|
|
6336
|
+
thead: /* @__PURE__ */ new Set(["table"]),
|
|
6337
|
+
tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
|
|
6338
|
+
// data list
|
|
6339
|
+
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
6340
|
+
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
6341
|
+
// other
|
|
6342
|
+
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
|
6343
|
+
// li: new Set(["ul", "ol"]),
|
|
6344
|
+
summary: /* @__PURE__ */ new Set(["details"]),
|
|
6345
|
+
area: /* @__PURE__ */ new Set(["map"])
|
|
6346
|
+
};
|
|
6347
|
+
const knownInvalidChildren = {
|
|
6348
|
+
p: /* @__PURE__ */ new Set([
|
|
6349
|
+
"address",
|
|
6350
|
+
"article",
|
|
6351
|
+
"aside",
|
|
6352
|
+
"blockquote",
|
|
6353
|
+
"center",
|
|
6354
|
+
"details",
|
|
6355
|
+
"dialog",
|
|
6356
|
+
"dir",
|
|
6357
|
+
"div",
|
|
6358
|
+
"dl",
|
|
6359
|
+
"fieldset",
|
|
6360
|
+
"figure",
|
|
6361
|
+
"footer",
|
|
6362
|
+
"form",
|
|
6363
|
+
"h1",
|
|
6364
|
+
"h2",
|
|
6365
|
+
"h3",
|
|
6366
|
+
"h4",
|
|
6367
|
+
"h5",
|
|
6368
|
+
"h6",
|
|
6369
|
+
"header",
|
|
6370
|
+
"hgroup",
|
|
6371
|
+
"hr",
|
|
6372
|
+
"li",
|
|
6373
|
+
"main",
|
|
6374
|
+
"nav",
|
|
6375
|
+
"menu",
|
|
6376
|
+
"ol",
|
|
6377
|
+
"p",
|
|
6378
|
+
"pre",
|
|
6379
|
+
"section",
|
|
6380
|
+
"table",
|
|
6381
|
+
"ul"
|
|
6382
|
+
]),
|
|
6383
|
+
svg: /* @__PURE__ */ new Set([
|
|
6384
|
+
"b",
|
|
6385
|
+
"blockquote",
|
|
6386
|
+
"br",
|
|
6387
|
+
"code",
|
|
6388
|
+
"dd",
|
|
6389
|
+
"div",
|
|
6390
|
+
"dl",
|
|
6391
|
+
"dt",
|
|
6392
|
+
"em",
|
|
6393
|
+
"embed",
|
|
6394
|
+
"h1",
|
|
6395
|
+
"h2",
|
|
6396
|
+
"h3",
|
|
6397
|
+
"h4",
|
|
6398
|
+
"h5",
|
|
6399
|
+
"h6",
|
|
6400
|
+
"hr",
|
|
6401
|
+
"i",
|
|
6402
|
+
"img",
|
|
6403
|
+
"li",
|
|
6404
|
+
"menu",
|
|
6405
|
+
"meta",
|
|
6406
|
+
"ol",
|
|
6407
|
+
"p",
|
|
6408
|
+
"pre",
|
|
6409
|
+
"ruby",
|
|
6410
|
+
"s",
|
|
6411
|
+
"small",
|
|
6412
|
+
"span",
|
|
6413
|
+
"strong",
|
|
6414
|
+
"sub",
|
|
6415
|
+
"sup",
|
|
6416
|
+
"table",
|
|
6417
|
+
"u",
|
|
6418
|
+
"ul",
|
|
6419
|
+
"var"
|
|
6420
|
+
])
|
|
6421
|
+
};
|
|
6422
|
+
const knownInvalidParents = {
|
|
6423
|
+
a: /* @__PURE__ */ new Set(["a"]),
|
|
6424
|
+
button: /* @__PURE__ */ new Set(["button"]),
|
|
6425
|
+
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
6426
|
+
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
6427
|
+
form: /* @__PURE__ */ new Set(["form"]),
|
|
6428
|
+
li: /* @__PURE__ */ new Set(["li"]),
|
|
6429
|
+
h1: headings,
|
|
6430
|
+
h2: headings,
|
|
6431
|
+
h3: headings,
|
|
6432
|
+
h4: headings,
|
|
6433
|
+
h5: headings,
|
|
6434
|
+
h6: headings
|
|
6435
|
+
};
|
|
6436
|
+
|
|
6437
|
+
const validateHtmlNesting = (node, context) => {
|
|
6438
|
+
if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
|
|
6439
|
+
const error = new SyntaxError(
|
|
6440
|
+
`<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
|
|
6441
|
+
);
|
|
6442
|
+
error.loc = node.loc;
|
|
6443
|
+
context.onWarn(error);
|
|
6444
|
+
}
|
|
6445
|
+
};
|
|
6446
|
+
|
|
6273
6447
|
const DOMNodeTransforms = [
|
|
6274
6448
|
transformStyle,
|
|
6275
|
-
...[transformTransition]
|
|
6449
|
+
...[transformTransition, validateHtmlNesting]
|
|
6276
6450
|
];
|
|
6277
6451
|
const DOMDirectiveTransforms = {
|
|
6278
6452
|
cloak: noopDirectiveTransform,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-dom v3.
|
|
2
|
+
* @vue/compiler-dom v3.5.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -464,9 +464,183 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
+
function isValidHTMLNesting(parent, child) {
|
|
468
|
+
if (parent in onlyValidChildren) {
|
|
469
|
+
return onlyValidChildren[parent].has(child);
|
|
470
|
+
}
|
|
471
|
+
if (child in onlyValidParents) {
|
|
472
|
+
return onlyValidParents[child].has(parent);
|
|
473
|
+
}
|
|
474
|
+
if (parent in knownInvalidChildren) {
|
|
475
|
+
if (knownInvalidChildren[parent].has(child))
|
|
476
|
+
return false;
|
|
477
|
+
}
|
|
478
|
+
if (child in knownInvalidParents) {
|
|
479
|
+
if (knownInvalidParents[child].has(parent))
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
return true;
|
|
483
|
+
}
|
|
484
|
+
const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
485
|
+
const emptySet = /* @__PURE__ */ new Set([]);
|
|
486
|
+
const onlyValidChildren = {
|
|
487
|
+
head: /* @__PURE__ */ new Set([
|
|
488
|
+
"base",
|
|
489
|
+
"basefront",
|
|
490
|
+
"bgsound",
|
|
491
|
+
"link",
|
|
492
|
+
"meta",
|
|
493
|
+
"title",
|
|
494
|
+
"noscript",
|
|
495
|
+
"noframes",
|
|
496
|
+
"style",
|
|
497
|
+
"script",
|
|
498
|
+
"template"
|
|
499
|
+
]),
|
|
500
|
+
optgroup: /* @__PURE__ */ new Set(["option"]),
|
|
501
|
+
select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
|
|
502
|
+
// table
|
|
503
|
+
table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
|
|
504
|
+
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
|
505
|
+
colgroup: /* @__PURE__ */ new Set(["col"]),
|
|
506
|
+
tbody: /* @__PURE__ */ new Set(["tr"]),
|
|
507
|
+
thead: /* @__PURE__ */ new Set(["tr"]),
|
|
508
|
+
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
|
509
|
+
// these elements can not have any children elements
|
|
510
|
+
script: emptySet,
|
|
511
|
+
iframe: emptySet,
|
|
512
|
+
option: emptySet,
|
|
513
|
+
textarea: emptySet,
|
|
514
|
+
style: emptySet,
|
|
515
|
+
title: emptySet
|
|
516
|
+
};
|
|
517
|
+
const onlyValidParents = {
|
|
518
|
+
// sections
|
|
519
|
+
html: emptySet,
|
|
520
|
+
body: /* @__PURE__ */ new Set(["html"]),
|
|
521
|
+
head: /* @__PURE__ */ new Set(["html"]),
|
|
522
|
+
// table
|
|
523
|
+
td: /* @__PURE__ */ new Set(["tr"]),
|
|
524
|
+
colgroup: /* @__PURE__ */ new Set(["table"]),
|
|
525
|
+
caption: /* @__PURE__ */ new Set(["table"]),
|
|
526
|
+
tbody: /* @__PURE__ */ new Set(["table"]),
|
|
527
|
+
tfoot: /* @__PURE__ */ new Set(["table"]),
|
|
528
|
+
col: /* @__PURE__ */ new Set(["colgroup"]),
|
|
529
|
+
th: /* @__PURE__ */ new Set(["tr"]),
|
|
530
|
+
thead: /* @__PURE__ */ new Set(["table"]),
|
|
531
|
+
tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
|
|
532
|
+
// data list
|
|
533
|
+
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
534
|
+
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
535
|
+
// other
|
|
536
|
+
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
|
537
|
+
// li: new Set(["ul", "ol"]),
|
|
538
|
+
summary: /* @__PURE__ */ new Set(["details"]),
|
|
539
|
+
area: /* @__PURE__ */ new Set(["map"])
|
|
540
|
+
};
|
|
541
|
+
const knownInvalidChildren = {
|
|
542
|
+
p: /* @__PURE__ */ new Set([
|
|
543
|
+
"address",
|
|
544
|
+
"article",
|
|
545
|
+
"aside",
|
|
546
|
+
"blockquote",
|
|
547
|
+
"center",
|
|
548
|
+
"details",
|
|
549
|
+
"dialog",
|
|
550
|
+
"dir",
|
|
551
|
+
"div",
|
|
552
|
+
"dl",
|
|
553
|
+
"fieldset",
|
|
554
|
+
"figure",
|
|
555
|
+
"footer",
|
|
556
|
+
"form",
|
|
557
|
+
"h1",
|
|
558
|
+
"h2",
|
|
559
|
+
"h3",
|
|
560
|
+
"h4",
|
|
561
|
+
"h5",
|
|
562
|
+
"h6",
|
|
563
|
+
"header",
|
|
564
|
+
"hgroup",
|
|
565
|
+
"hr",
|
|
566
|
+
"li",
|
|
567
|
+
"main",
|
|
568
|
+
"nav",
|
|
569
|
+
"menu",
|
|
570
|
+
"ol",
|
|
571
|
+
"p",
|
|
572
|
+
"pre",
|
|
573
|
+
"section",
|
|
574
|
+
"table",
|
|
575
|
+
"ul"
|
|
576
|
+
]),
|
|
577
|
+
svg: /* @__PURE__ */ new Set([
|
|
578
|
+
"b",
|
|
579
|
+
"blockquote",
|
|
580
|
+
"br",
|
|
581
|
+
"code",
|
|
582
|
+
"dd",
|
|
583
|
+
"div",
|
|
584
|
+
"dl",
|
|
585
|
+
"dt",
|
|
586
|
+
"em",
|
|
587
|
+
"embed",
|
|
588
|
+
"h1",
|
|
589
|
+
"h2",
|
|
590
|
+
"h3",
|
|
591
|
+
"h4",
|
|
592
|
+
"h5",
|
|
593
|
+
"h6",
|
|
594
|
+
"hr",
|
|
595
|
+
"i",
|
|
596
|
+
"img",
|
|
597
|
+
"li",
|
|
598
|
+
"menu",
|
|
599
|
+
"meta",
|
|
600
|
+
"ol",
|
|
601
|
+
"p",
|
|
602
|
+
"pre",
|
|
603
|
+
"ruby",
|
|
604
|
+
"s",
|
|
605
|
+
"small",
|
|
606
|
+
"span",
|
|
607
|
+
"strong",
|
|
608
|
+
"sub",
|
|
609
|
+
"sup",
|
|
610
|
+
"table",
|
|
611
|
+
"u",
|
|
612
|
+
"ul",
|
|
613
|
+
"var"
|
|
614
|
+
])
|
|
615
|
+
};
|
|
616
|
+
const knownInvalidParents = {
|
|
617
|
+
a: /* @__PURE__ */ new Set(["a"]),
|
|
618
|
+
button: /* @__PURE__ */ new Set(["button"]),
|
|
619
|
+
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
620
|
+
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
621
|
+
form: /* @__PURE__ */ new Set(["form"]),
|
|
622
|
+
li: /* @__PURE__ */ new Set(["li"]),
|
|
623
|
+
h1: headings,
|
|
624
|
+
h2: headings,
|
|
625
|
+
h3: headings,
|
|
626
|
+
h4: headings,
|
|
627
|
+
h5: headings,
|
|
628
|
+
h6: headings
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
const validateHtmlNesting = (node, context) => {
|
|
632
|
+
if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
|
|
633
|
+
const error = new SyntaxError(
|
|
634
|
+
`<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
|
|
635
|
+
);
|
|
636
|
+
error.loc = node.loc;
|
|
637
|
+
context.onWarn(error);
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
|
|
467
641
|
const DOMNodeTransforms = [
|
|
468
642
|
transformStyle,
|
|
469
|
-
...!!(process.env.NODE_ENV !== "production") ? [transformTransition] : []
|
|
643
|
+
...!!(process.env.NODE_ENV !== "production") ? [transformTransition, validateHtmlNesting] : []
|
|
470
644
|
];
|
|
471
645
|
const DOMDirectiveTransforms = {
|
|
472
646
|
cloak: noopDirectiveTransform,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-dom v3.
|
|
2
|
+
* @vue/compiler-dom v3.5.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -6273,9 +6273,183 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
|
|
|
6273
6273
|
}
|
|
6274
6274
|
};
|
|
6275
6275
|
|
|
6276
|
+
function isValidHTMLNesting(parent, child) {
|
|
6277
|
+
if (parent in onlyValidChildren) {
|
|
6278
|
+
return onlyValidChildren[parent].has(child);
|
|
6279
|
+
}
|
|
6280
|
+
if (child in onlyValidParents) {
|
|
6281
|
+
return onlyValidParents[child].has(parent);
|
|
6282
|
+
}
|
|
6283
|
+
if (parent in knownInvalidChildren) {
|
|
6284
|
+
if (knownInvalidChildren[parent].has(child))
|
|
6285
|
+
return false;
|
|
6286
|
+
}
|
|
6287
|
+
if (child in knownInvalidParents) {
|
|
6288
|
+
if (knownInvalidParents[child].has(parent))
|
|
6289
|
+
return false;
|
|
6290
|
+
}
|
|
6291
|
+
return true;
|
|
6292
|
+
}
|
|
6293
|
+
const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
6294
|
+
const emptySet = /* @__PURE__ */ new Set([]);
|
|
6295
|
+
const onlyValidChildren = {
|
|
6296
|
+
head: /* @__PURE__ */ new Set([
|
|
6297
|
+
"base",
|
|
6298
|
+
"basefront",
|
|
6299
|
+
"bgsound",
|
|
6300
|
+
"link",
|
|
6301
|
+
"meta",
|
|
6302
|
+
"title",
|
|
6303
|
+
"noscript",
|
|
6304
|
+
"noframes",
|
|
6305
|
+
"style",
|
|
6306
|
+
"script",
|
|
6307
|
+
"template"
|
|
6308
|
+
]),
|
|
6309
|
+
optgroup: /* @__PURE__ */ new Set(["option"]),
|
|
6310
|
+
select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
|
|
6311
|
+
// table
|
|
6312
|
+
table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
|
|
6313
|
+
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
|
6314
|
+
colgroup: /* @__PURE__ */ new Set(["col"]),
|
|
6315
|
+
tbody: /* @__PURE__ */ new Set(["tr"]),
|
|
6316
|
+
thead: /* @__PURE__ */ new Set(["tr"]),
|
|
6317
|
+
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
|
6318
|
+
// these elements can not have any children elements
|
|
6319
|
+
script: emptySet,
|
|
6320
|
+
iframe: emptySet,
|
|
6321
|
+
option: emptySet,
|
|
6322
|
+
textarea: emptySet,
|
|
6323
|
+
style: emptySet,
|
|
6324
|
+
title: emptySet
|
|
6325
|
+
};
|
|
6326
|
+
const onlyValidParents = {
|
|
6327
|
+
// sections
|
|
6328
|
+
html: emptySet,
|
|
6329
|
+
body: /* @__PURE__ */ new Set(["html"]),
|
|
6330
|
+
head: /* @__PURE__ */ new Set(["html"]),
|
|
6331
|
+
// table
|
|
6332
|
+
td: /* @__PURE__ */ new Set(["tr"]),
|
|
6333
|
+
colgroup: /* @__PURE__ */ new Set(["table"]),
|
|
6334
|
+
caption: /* @__PURE__ */ new Set(["table"]),
|
|
6335
|
+
tbody: /* @__PURE__ */ new Set(["table"]),
|
|
6336
|
+
tfoot: /* @__PURE__ */ new Set(["table"]),
|
|
6337
|
+
col: /* @__PURE__ */ new Set(["colgroup"]),
|
|
6338
|
+
th: /* @__PURE__ */ new Set(["tr"]),
|
|
6339
|
+
thead: /* @__PURE__ */ new Set(["table"]),
|
|
6340
|
+
tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
|
|
6341
|
+
// data list
|
|
6342
|
+
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
6343
|
+
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
|
6344
|
+
// other
|
|
6345
|
+
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
|
6346
|
+
// li: new Set(["ul", "ol"]),
|
|
6347
|
+
summary: /* @__PURE__ */ new Set(["details"]),
|
|
6348
|
+
area: /* @__PURE__ */ new Set(["map"])
|
|
6349
|
+
};
|
|
6350
|
+
const knownInvalidChildren = {
|
|
6351
|
+
p: /* @__PURE__ */ new Set([
|
|
6352
|
+
"address",
|
|
6353
|
+
"article",
|
|
6354
|
+
"aside",
|
|
6355
|
+
"blockquote",
|
|
6356
|
+
"center",
|
|
6357
|
+
"details",
|
|
6358
|
+
"dialog",
|
|
6359
|
+
"dir",
|
|
6360
|
+
"div",
|
|
6361
|
+
"dl",
|
|
6362
|
+
"fieldset",
|
|
6363
|
+
"figure",
|
|
6364
|
+
"footer",
|
|
6365
|
+
"form",
|
|
6366
|
+
"h1",
|
|
6367
|
+
"h2",
|
|
6368
|
+
"h3",
|
|
6369
|
+
"h4",
|
|
6370
|
+
"h5",
|
|
6371
|
+
"h6",
|
|
6372
|
+
"header",
|
|
6373
|
+
"hgroup",
|
|
6374
|
+
"hr",
|
|
6375
|
+
"li",
|
|
6376
|
+
"main",
|
|
6377
|
+
"nav",
|
|
6378
|
+
"menu",
|
|
6379
|
+
"ol",
|
|
6380
|
+
"p",
|
|
6381
|
+
"pre",
|
|
6382
|
+
"section",
|
|
6383
|
+
"table",
|
|
6384
|
+
"ul"
|
|
6385
|
+
]),
|
|
6386
|
+
svg: /* @__PURE__ */ new Set([
|
|
6387
|
+
"b",
|
|
6388
|
+
"blockquote",
|
|
6389
|
+
"br",
|
|
6390
|
+
"code",
|
|
6391
|
+
"dd",
|
|
6392
|
+
"div",
|
|
6393
|
+
"dl",
|
|
6394
|
+
"dt",
|
|
6395
|
+
"em",
|
|
6396
|
+
"embed",
|
|
6397
|
+
"h1",
|
|
6398
|
+
"h2",
|
|
6399
|
+
"h3",
|
|
6400
|
+
"h4",
|
|
6401
|
+
"h5",
|
|
6402
|
+
"h6",
|
|
6403
|
+
"hr",
|
|
6404
|
+
"i",
|
|
6405
|
+
"img",
|
|
6406
|
+
"li",
|
|
6407
|
+
"menu",
|
|
6408
|
+
"meta",
|
|
6409
|
+
"ol",
|
|
6410
|
+
"p",
|
|
6411
|
+
"pre",
|
|
6412
|
+
"ruby",
|
|
6413
|
+
"s",
|
|
6414
|
+
"small",
|
|
6415
|
+
"span",
|
|
6416
|
+
"strong",
|
|
6417
|
+
"sub",
|
|
6418
|
+
"sup",
|
|
6419
|
+
"table",
|
|
6420
|
+
"u",
|
|
6421
|
+
"ul",
|
|
6422
|
+
"var"
|
|
6423
|
+
])
|
|
6424
|
+
};
|
|
6425
|
+
const knownInvalidParents = {
|
|
6426
|
+
a: /* @__PURE__ */ new Set(["a"]),
|
|
6427
|
+
button: /* @__PURE__ */ new Set(["button"]),
|
|
6428
|
+
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
6429
|
+
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
|
6430
|
+
form: /* @__PURE__ */ new Set(["form"]),
|
|
6431
|
+
li: /* @__PURE__ */ new Set(["li"]),
|
|
6432
|
+
h1: headings,
|
|
6433
|
+
h2: headings,
|
|
6434
|
+
h3: headings,
|
|
6435
|
+
h4: headings,
|
|
6436
|
+
h5: headings,
|
|
6437
|
+
h6: headings
|
|
6438
|
+
};
|
|
6439
|
+
|
|
6440
|
+
const validateHtmlNesting = (node, context) => {
|
|
6441
|
+
if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
|
|
6442
|
+
const error = new SyntaxError(
|
|
6443
|
+
`<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
|
|
6444
|
+
);
|
|
6445
|
+
error.loc = node.loc;
|
|
6446
|
+
context.onWarn(error);
|
|
6447
|
+
}
|
|
6448
|
+
};
|
|
6449
|
+
|
|
6276
6450
|
const DOMNodeTransforms = [
|
|
6277
6451
|
transformStyle,
|
|
6278
|
-
...[transformTransition]
|
|
6452
|
+
...[transformTransition, validateHtmlNesting]
|
|
6279
6453
|
];
|
|
6280
6454
|
const DOMDirectiveTransforms = {
|
|
6281
6455
|
cloak: noopDirectiveTransform,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-dom",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-alpha.2",
|
|
4
4
|
"description": "@vue/compiler-dom",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/compiler-dom.esm-bundler.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme",
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@vue/shared": "3.
|
|
55
|
-
"@vue/compiler-core": "3.
|
|
54
|
+
"@vue/shared": "3.5.0-alpha.2",
|
|
55
|
+
"@vue/compiler-core": "3.5.0-alpha.2"
|
|
56
56
|
}
|
|
57
57
|
}
|