@vue/runtime-dom 3.2.23 → 3.2.27
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/runtime-dom.cjs.js +16 -10
- package/dist/runtime-dom.cjs.prod.js +15 -9
- package/dist/runtime-dom.d.ts +2 -0
- package/dist/runtime-dom.esm-browser.js +6475 -6430
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +16 -10
- package/dist/runtime-dom.global.js +6475 -6430
- package/dist/runtime-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -7,7 +7,7 @@ var shared = require('@vue/shared');
|
|
|
7
7
|
|
|
8
8
|
const svgNS = 'http://www.w3.org/2000/svg';
|
|
9
9
|
const doc = (typeof document !== 'undefined' ? document : null);
|
|
10
|
-
const
|
|
10
|
+
const templateContainer = doc && doc.createElement('template');
|
|
11
11
|
const nodeOps = {
|
|
12
12
|
insert: (child, parent, anchor) => {
|
|
13
13
|
parent.insertBefore(child, anchor || null);
|
|
@@ -61,14 +61,21 @@ const nodeOps = {
|
|
|
61
61
|
// Reason: innerHTML.
|
|
62
62
|
// Static content here can only come from compiled templates.
|
|
63
63
|
// As long as the user only uses trusted templates, this is safe.
|
|
64
|
-
insertStaticContent(content, parent, anchor, isSVG) {
|
|
64
|
+
insertStaticContent(content, parent, anchor, isSVG, start, end) {
|
|
65
65
|
// <parent> before | first ... last | anchor </parent>
|
|
66
66
|
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
if (start && end) {
|
|
68
|
+
// cached
|
|
69
|
+
while (true) {
|
|
70
|
+
parent.insertBefore(start.cloneNode(true), anchor);
|
|
71
|
+
if (start === end || !(start = start.nextSibling))
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// fresh insert
|
|
77
|
+
templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
|
|
78
|
+
const template = templateContainer.content;
|
|
72
79
|
if (isSVG) {
|
|
73
80
|
// remove outer svg wrapper
|
|
74
81
|
const wrapper = template.firstChild;
|
|
@@ -77,9 +84,8 @@ const nodeOps = {
|
|
|
77
84
|
}
|
|
78
85
|
template.removeChild(wrapper);
|
|
79
86
|
}
|
|
80
|
-
|
|
87
|
+
parent.insertBefore(template, anchor);
|
|
81
88
|
}
|
|
82
|
-
parent.insertBefore(template.cloneNode(true), anchor);
|
|
83
89
|
return [
|
|
84
90
|
// first
|
|
85
91
|
before ? before.nextSibling : parent.firstChild,
|
|
@@ -621,7 +627,7 @@ class VueElement extends BaseClass {
|
|
|
621
627
|
// HMR
|
|
622
628
|
{
|
|
623
629
|
instance.ceReload = newStyles => {
|
|
624
|
-
//
|
|
630
|
+
// always reset styles
|
|
625
631
|
if (this._styles) {
|
|
626
632
|
this._styles.forEach(s => this.shadowRoot.removeChild(s));
|
|
627
633
|
this._styles.length = 0;
|
|
@@ -7,7 +7,7 @@ var shared = require('@vue/shared');
|
|
|
7
7
|
|
|
8
8
|
const svgNS = 'http://www.w3.org/2000/svg';
|
|
9
9
|
const doc = (typeof document !== 'undefined' ? document : null);
|
|
10
|
-
const
|
|
10
|
+
const templateContainer = doc && doc.createElement('template');
|
|
11
11
|
const nodeOps = {
|
|
12
12
|
insert: (child, parent, anchor) => {
|
|
13
13
|
parent.insertBefore(child, anchor || null);
|
|
@@ -61,14 +61,21 @@ const nodeOps = {
|
|
|
61
61
|
// Reason: innerHTML.
|
|
62
62
|
// Static content here can only come from compiled templates.
|
|
63
63
|
// As long as the user only uses trusted templates, this is safe.
|
|
64
|
-
insertStaticContent(content, parent, anchor, isSVG) {
|
|
64
|
+
insertStaticContent(content, parent, anchor, isSVG, start, end) {
|
|
65
65
|
// <parent> before | first ... last | anchor </parent>
|
|
66
66
|
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
if (start && end) {
|
|
68
|
+
// cached
|
|
69
|
+
while (true) {
|
|
70
|
+
parent.insertBefore(start.cloneNode(true), anchor);
|
|
71
|
+
if (start === end || !(start = start.nextSibling))
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// fresh insert
|
|
77
|
+
templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
|
|
78
|
+
const template = templateContainer.content;
|
|
72
79
|
if (isSVG) {
|
|
73
80
|
// remove outer svg wrapper
|
|
74
81
|
const wrapper = template.firstChild;
|
|
@@ -77,9 +84,8 @@ const nodeOps = {
|
|
|
77
84
|
}
|
|
78
85
|
template.removeChild(wrapper);
|
|
79
86
|
}
|
|
80
|
-
|
|
87
|
+
parent.insertBefore(template, anchor);
|
|
81
88
|
}
|
|
82
|
-
parent.insertBefore(template.cloneNode(true), anchor);
|
|
83
89
|
return [
|
|
84
90
|
// first
|
|
85
91
|
before ? before.nextSibling : parent.firstChild,
|
package/dist/runtime-dom.d.ts
CHANGED