@vue/runtime-dom 3.1.0 → 3.1.4
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 +52 -18
- package/dist/runtime-dom.cjs.prod.js +52 -18
- package/dist/runtime-dom.d.ts +2 -4
- package/dist/runtime-dom.esm-browser.js +392 -183
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +51 -17
- package/dist/runtime-dom.global.js +398 -182
- package/dist/runtime-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -7,8 +7,6 @@ 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
|
-
let tempContainer;
|
|
11
|
-
let tempSVGContainer;
|
|
12
10
|
const nodeOps = {
|
|
13
11
|
insert: (child, parent, anchor) => {
|
|
14
12
|
parent.insertBefore(child, anchor || null);
|
|
@@ -59,24 +57,60 @@ const nodeOps = {
|
|
|
59
57
|
return cloned;
|
|
60
58
|
},
|
|
61
59
|
// __UNSAFE__
|
|
62
|
-
// Reason:
|
|
60
|
+
// Reason: insertAdjacentHTML.
|
|
63
61
|
// Static content here can only come from compiled templates.
|
|
64
62
|
// As long as the user only uses trusted templates, this is safe.
|
|
65
|
-
insertStaticContent(content, parent, anchor, isSVG) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
insertStaticContent(content, parent, anchor, isSVG, cached) {
|
|
64
|
+
if (cached) {
|
|
65
|
+
let first;
|
|
66
|
+
let last;
|
|
67
|
+
let i = 0;
|
|
68
|
+
let l = cached.length;
|
|
69
|
+
for (; i < l; i++) {
|
|
70
|
+
const node = cached[i].cloneNode(true);
|
|
71
|
+
if (i === 0)
|
|
72
|
+
first = node;
|
|
73
|
+
if (i === l - 1)
|
|
74
|
+
last = node;
|
|
75
|
+
parent.insertBefore(node, anchor);
|
|
76
|
+
}
|
|
77
|
+
return [first, last];
|
|
78
|
+
}
|
|
79
|
+
// <parent> before | first ... last | anchor </parent>
|
|
80
|
+
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
81
|
+
if (anchor) {
|
|
82
|
+
let insertionPoint;
|
|
83
|
+
let usingTempInsertionPoint = false;
|
|
84
|
+
if (anchor instanceof Element) {
|
|
85
|
+
insertionPoint = anchor;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// insertAdjacentHTML only works for elements but the anchor is not an
|
|
89
|
+
// element...
|
|
90
|
+
usingTempInsertionPoint = true;
|
|
91
|
+
insertionPoint = isSVG
|
|
92
|
+
? doc.createElementNS(svgNS, 'g')
|
|
93
|
+
: doc.createElement('div');
|
|
94
|
+
parent.insertBefore(insertionPoint, anchor);
|
|
95
|
+
}
|
|
96
|
+
insertionPoint.insertAdjacentHTML('beforebegin', content);
|
|
97
|
+
if (usingTempInsertionPoint) {
|
|
98
|
+
parent.removeChild(insertionPoint);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
parent.insertAdjacentHTML('beforeend', content);
|
|
103
|
+
}
|
|
104
|
+
let first = before ? before.nextSibling : parent.firstChild;
|
|
105
|
+
const last = anchor ? anchor.previousSibling : parent.lastChild;
|
|
106
|
+
const ret = [];
|
|
107
|
+
while (first) {
|
|
108
|
+
ret.push(first);
|
|
109
|
+
if (first === last)
|
|
110
|
+
break;
|
|
111
|
+
first = first.nextSibling;
|
|
112
|
+
}
|
|
113
|
+
return ret;
|
|
80
114
|
}
|
|
81
115
|
};
|
|
82
116
|
|
|
@@ -7,8 +7,6 @@ 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
|
-
let tempContainer;
|
|
11
|
-
let tempSVGContainer;
|
|
12
10
|
const nodeOps = {
|
|
13
11
|
insert: (child, parent, anchor) => {
|
|
14
12
|
parent.insertBefore(child, anchor || null);
|
|
@@ -59,24 +57,60 @@ const nodeOps = {
|
|
|
59
57
|
return cloned;
|
|
60
58
|
},
|
|
61
59
|
// __UNSAFE__
|
|
62
|
-
// Reason:
|
|
60
|
+
// Reason: insertAdjacentHTML.
|
|
63
61
|
// Static content here can only come from compiled templates.
|
|
64
62
|
// As long as the user only uses trusted templates, this is safe.
|
|
65
|
-
insertStaticContent(content, parent, anchor, isSVG) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
insertStaticContent(content, parent, anchor, isSVG, cached) {
|
|
64
|
+
if (cached) {
|
|
65
|
+
let first;
|
|
66
|
+
let last;
|
|
67
|
+
let i = 0;
|
|
68
|
+
let l = cached.length;
|
|
69
|
+
for (; i < l; i++) {
|
|
70
|
+
const node = cached[i].cloneNode(true);
|
|
71
|
+
if (i === 0)
|
|
72
|
+
first = node;
|
|
73
|
+
if (i === l - 1)
|
|
74
|
+
last = node;
|
|
75
|
+
parent.insertBefore(node, anchor);
|
|
76
|
+
}
|
|
77
|
+
return [first, last];
|
|
78
|
+
}
|
|
79
|
+
// <parent> before | first ... last | anchor </parent>
|
|
80
|
+
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
81
|
+
if (anchor) {
|
|
82
|
+
let insertionPoint;
|
|
83
|
+
let usingTempInsertionPoint = false;
|
|
84
|
+
if (anchor instanceof Element) {
|
|
85
|
+
insertionPoint = anchor;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// insertAdjacentHTML only works for elements but the anchor is not an
|
|
89
|
+
// element...
|
|
90
|
+
usingTempInsertionPoint = true;
|
|
91
|
+
insertionPoint = isSVG
|
|
92
|
+
? doc.createElementNS(svgNS, 'g')
|
|
93
|
+
: doc.createElement('div');
|
|
94
|
+
parent.insertBefore(insertionPoint, anchor);
|
|
95
|
+
}
|
|
96
|
+
insertionPoint.insertAdjacentHTML('beforebegin', content);
|
|
97
|
+
if (usingTempInsertionPoint) {
|
|
98
|
+
parent.removeChild(insertionPoint);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
parent.insertAdjacentHTML('beforeend', content);
|
|
103
|
+
}
|
|
104
|
+
let first = before ? before.nextSibling : parent.firstChild;
|
|
105
|
+
const last = anchor ? anchor.previousSibling : parent.lastChild;
|
|
106
|
+
const ret = [];
|
|
107
|
+
while (first) {
|
|
108
|
+
ret.push(first);
|
|
109
|
+
if (first === last)
|
|
110
|
+
break;
|
|
111
|
+
first = first.nextSibling;
|
|
112
|
+
}
|
|
113
|
+
return ret;
|
|
80
114
|
}
|
|
81
115
|
};
|
|
82
116
|
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -1389,10 +1389,8 @@ export interface Events {
|
|
|
1389
1389
|
onTransitionstart: TransitionEvent
|
|
1390
1390
|
}
|
|
1391
1391
|
|
|
1392
|
-
type StringKeyOf<T> = Extract<keyof T, string>
|
|
1393
|
-
|
|
1394
1392
|
type EventHandlers<E> = {
|
|
1395
|
-
[K in
|
|
1393
|
+
[K in keyof E]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
|
|
1396
1394
|
}
|
|
1397
1395
|
|
|
1398
1396
|
// use namespace import to avoid collision with generated types which use
|
|
@@ -1410,7 +1408,7 @@ type ReservedProps = {
|
|
|
1410
1408
|
type ElementAttrs<T> = T & ReservedProps
|
|
1411
1409
|
|
|
1412
1410
|
type NativeElements = {
|
|
1413
|
-
[K in
|
|
1411
|
+
[K in keyof IntrinsicElementAttributes]: ElementAttrs<
|
|
1414
1412
|
IntrinsicElementAttributes[K]
|
|
1415
1413
|
>
|
|
1416
1414
|
}
|