@lvce-editor/virtual-dom 3.5.0 → 4.0.0
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/index.js +6 -5
- package/package.json +4 -7
package/dist/index.js
CHANGED
|
@@ -399,11 +399,12 @@ const getOptions = fn => {
|
|
|
399
399
|
return undefined;
|
|
400
400
|
};
|
|
401
401
|
const attachEvent = ($Node, eventMap, key, value, newEventMap) => {
|
|
402
|
+
const keyLower = key.toLowerCase();
|
|
402
403
|
if (newEventMap && newEventMap[value]) {
|
|
403
404
|
const fn = newEventMap[value];
|
|
404
405
|
const options = getOptions(fn);
|
|
405
406
|
// TODO support event listener options
|
|
406
|
-
$Node.addEventListener(
|
|
407
|
+
$Node.addEventListener(keyLower, newEventMap[value], options);
|
|
407
408
|
return;
|
|
408
409
|
}
|
|
409
410
|
const listener = eventMap[value];
|
|
@@ -413,7 +414,7 @@ const attachEvent = ($Node, eventMap, key, value, newEventMap) => {
|
|
|
413
414
|
}
|
|
414
415
|
const options = getEventListenerOptions(key, value);
|
|
415
416
|
const wrapped = getWrappedListener(listener, eventMap.returnValue);
|
|
416
|
-
$Node.addEventListener(
|
|
417
|
+
$Node.addEventListener(keyLower, wrapped, options);
|
|
417
418
|
};
|
|
418
419
|
|
|
419
420
|
const setProp = ($Element, key, value, eventMap, newEventMap) => {
|
|
@@ -496,6 +497,7 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
|
|
|
496
497
|
case 'onPointerOut':
|
|
497
498
|
case 'onPointerOver':
|
|
498
499
|
case 'onScroll':
|
|
500
|
+
case 'onSelectionChange':
|
|
499
501
|
case 'onWheel':
|
|
500
502
|
const eventName = key.slice(2).toLowerCase();
|
|
501
503
|
if (!eventMap || !value) {
|
|
@@ -690,7 +692,7 @@ const applyDragInfoMaybe = event => {
|
|
|
690
692
|
};
|
|
691
693
|
|
|
692
694
|
const PointerMove = 'pointermove';
|
|
693
|
-
const
|
|
695
|
+
const lostpointercapture = 'lostpointercapture';
|
|
694
696
|
|
|
695
697
|
let ignore = false;
|
|
696
698
|
const startIgnore = () => {
|
|
@@ -815,8 +817,7 @@ const applyPointerTrackMaybe = (info, map, event) => {
|
|
|
815
817
|
target.setPointerCapture(pointerId);
|
|
816
818
|
const [pointerMoveKey, pointerUpKey] = trackPointerEvents;
|
|
817
819
|
target.addEventListener(PointerMove, map[pointerMoveKey]);
|
|
818
|
-
|
|
819
|
-
target.addEventListener(PointerUp, map[pointerUpKey]);
|
|
820
|
+
target.addEventListener(lostpointercapture, map[pointerUpKey]);
|
|
820
821
|
};
|
|
821
822
|
const createFn = (info, map) => {
|
|
822
823
|
const fn = event => {
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/virtual-dom",
|
|
3
|
-
"version": "
|
|
4
|
-
"main": "dist/index.js",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"keywords": [],
|
|
7
|
-
"author": "",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"description": "",
|
|
3
|
+
"version": "4.0.0",
|
|
10
4
|
"repository": {
|
|
11
5
|
"type": "git",
|
|
12
6
|
"url": "git+https://github.com/lvce-editor/virtual-dom.git"
|
|
13
7
|
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "dist/index.js",
|
|
14
11
|
"types": "dist/index.d.ts"
|
|
15
12
|
}
|