verstak 0.24.303 → 0.24.305
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/build/dist/source/html/El.js +8 -3
- package/build/dist/source/html/sensors/ButtonSensor.js +20 -15
- package/build/dist/source/html/sensors/FocusSensor.js +17 -12
- package/build/dist/source/html/sensors/HoverSensor.js +19 -14
- package/build/dist/source/html/sensors/HtmlDragSensor.js +24 -19
- package/build/dist/source/html/sensors/KeyboardSensor.js +17 -12
- package/build/dist/source/html/sensors/PointerSensor.js +15 -10
- package/build/dist/source/html/sensors/ScrollSensor.js +13 -8
- package/build/dist/source/html/sensors/WheelSensor.js +13 -8
- package/package.json +2 -2
|
@@ -65,8 +65,8 @@ export class ElImpl {
|
|
|
65
65
|
this._kind = ElKind.part;
|
|
66
66
|
this._place = undefined;
|
|
67
67
|
this._coords = UndefinedElCoords;
|
|
68
|
-
this._width =
|
|
69
|
-
this._height =
|
|
68
|
+
this._width = new Size();
|
|
69
|
+
this._height = new Size();
|
|
70
70
|
this._horizontal = undefined;
|
|
71
71
|
this._vertical = undefined;
|
|
72
72
|
this._contentHorizontal = undefined;
|
|
@@ -557,7 +557,12 @@ export class ElImpl {
|
|
|
557
557
|
const e = element.native;
|
|
558
558
|
if (e instanceof HTMLElement) {
|
|
559
559
|
element.sealed = value;
|
|
560
|
-
|
|
560
|
+
const t = Transaction.current;
|
|
561
|
+
Transaction.outside(() => {
|
|
562
|
+
t.whenFinished(true).then(() => {
|
|
563
|
+
e.sensors.resize.observeResizing(element, value !== undefined);
|
|
564
|
+
}, e => { });
|
|
565
|
+
});
|
|
561
566
|
}
|
|
562
567
|
}
|
|
563
568
|
static applyStylingPreset(element, secondary, styleName, enabled) {
|
|
@@ -30,21 +30,26 @@ export class ButtonSensor extends BasePointerSensor {
|
|
|
30
30
|
this.selected = false;
|
|
31
31
|
}
|
|
32
32
|
listen(enabled = true) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
const t = Transaction.current;
|
|
34
|
+
Transaction.outside(() => {
|
|
35
|
+
t.whenFinished(true).then(() => {
|
|
36
|
+
const element = this.sourceElement;
|
|
37
|
+
if (enabled) {
|
|
38
|
+
element.addEventListener("pointerdown", this.onPointerDown.bind(this), { capture: true });
|
|
39
|
+
element.addEventListener("pointermove", this.onPointerMove.bind(this), { capture: true });
|
|
40
|
+
element.addEventListener("pointerup", this.onPointerUp.bind(this), { capture: true });
|
|
41
|
+
element.addEventListener("lostpointercapture", this.onLostPointerCapture.bind(this), { capture: true });
|
|
42
|
+
element.addEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
element.removeEventListener("pointerdown", this.onPointerDown.bind(this), { capture: true });
|
|
46
|
+
element.removeEventListener("pointermove", this.onPointerMove.bind(this), { capture: true });
|
|
47
|
+
element.removeEventListener("pointerup", this.onPointerUp.bind(this), { capture: true });
|
|
48
|
+
element.removeEventListener("lostpointercapture", this.onLostPointerCapture.bind(this), { capture: true });
|
|
49
|
+
element.removeEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
50
|
+
}
|
|
51
|
+
}, e => { });
|
|
52
|
+
});
|
|
48
53
|
}
|
|
49
54
|
onPointerDown(e) {
|
|
50
55
|
if (this.state === ButtonState.released && (this.pointerButton === PointerButton.none))
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { options, transactional, LoggingLevel } from "reactronic";
|
|
10
|
+
import { options, transactional, LoggingLevel, Transaction } from "reactronic";
|
|
11
11
|
import { objectHasMember } from "../ElUtils.js";
|
|
12
12
|
import { grabElementDataList, SymDataForSensor } from "./DataForSensor.js";
|
|
13
13
|
import { HtmlElementSensor } from "./HtmlElementSensor.js";
|
|
@@ -37,17 +37,22 @@ export class FocusSensor extends HtmlElementSensor {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
listen(enabled = true) {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
const t = Transaction.current;
|
|
41
|
+
Transaction.outside(() => {
|
|
42
|
+
t.whenFinished(true).then(() => {
|
|
43
|
+
const element = this.sourceElement;
|
|
44
|
+
if (enabled) {
|
|
45
|
+
element.addEventListener("focusin", this.onFocusIn.bind(this), { capture: true });
|
|
46
|
+
element.addEventListener("focusout", this.onFocusOut.bind(this), { capture: true });
|
|
47
|
+
element.addEventListener("mousedown", this.onMouseDown.bind(this), { capture: true });
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
element.removeEventListener("focusin", this.onFocusIn.bind(this), { capture: true });
|
|
51
|
+
element.removeEventListener("focusout", this.onFocusOut.bind(this), { capture: true });
|
|
52
|
+
element.removeEventListener("mousedown", this.onMouseDown.bind(this), { capture: true });
|
|
53
|
+
}
|
|
54
|
+
}, e => { });
|
|
55
|
+
});
|
|
51
56
|
}
|
|
52
57
|
reset() {
|
|
53
58
|
this.preventDefault = false;
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { options, transactional, LoggingLevel } from "reactronic";
|
|
10
|
+
import { options, transactional, LoggingLevel, Transaction } from "reactronic";
|
|
11
11
|
import { SymDataForSensor, findTargetElementData } from "./DataForSensor.js";
|
|
12
12
|
import { BasePointerSensor } from "./BasePointerSensor.js";
|
|
13
13
|
import { KeyboardModifiers, extractModifierKeys } from "./KeyboardSensor.js";
|
|
@@ -19,19 +19,24 @@ export class HoverSensor extends BasePointerSensor {
|
|
|
19
19
|
this.target = undefined;
|
|
20
20
|
}
|
|
21
21
|
listen(enabled = true) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
const t = Transaction.current;
|
|
23
|
+
Transaction.outside(() => {
|
|
24
|
+
t.whenFinished(true).then(() => {
|
|
25
|
+
const element = this.sourceElement;
|
|
26
|
+
if (enabled) {
|
|
27
|
+
element.addEventListener("pointerenter", this.onPointerEnter.bind(this));
|
|
28
|
+
element.addEventListener("pointerover", this.onPointerOver.bind(this), { capture: true });
|
|
29
|
+
element.addEventListener("pointermove", this.onPointerMove.bind(this), { capture: true });
|
|
30
|
+
element.addEventListener("pointerleave", this.onPointerLeave.bind(this));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
element.removeEventListener("pointerenter", this.onPointerEnter.bind(this));
|
|
34
|
+
element.removeEventListener("pointerover", this.onPointerOver.bind(this), { capture: true });
|
|
35
|
+
element.removeEventListener("pointermove", this.onPointerMove.bind(this), { capture: true });
|
|
36
|
+
element.removeEventListener("pointerleave", this.onPointerLeave.bind(this));
|
|
37
|
+
}
|
|
38
|
+
}, e => { });
|
|
39
|
+
});
|
|
35
40
|
}
|
|
36
41
|
onPointerEnter(e) {
|
|
37
42
|
this.doPointerEnter(e);
|
|
@@ -61,25 +61,30 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
61
61
|
this.draggingImageY = y;
|
|
62
62
|
}
|
|
63
63
|
listen(enabled = true) {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
const t = Transaction.current;
|
|
65
|
+
Transaction.outside(() => {
|
|
66
|
+
t.whenFinished(true).then(() => {
|
|
67
|
+
const element = this.sourceElement;
|
|
68
|
+
if (enabled) {
|
|
69
|
+
element.addEventListener("dragstart", this.onDragStart.bind(this), { capture: true });
|
|
70
|
+
element.addEventListener("drag", this.onDrag.bind(this), { capture: true });
|
|
71
|
+
element.addEventListener("dragenter", this.onDragEnter.bind(this), { capture: false });
|
|
72
|
+
element.addEventListener("dragleave", this.onDragLeave.bind(this), { capture: false });
|
|
73
|
+
element.addEventListener("dragover", this.onDragOver.bind(this), { capture: true });
|
|
74
|
+
element.addEventListener("drop", this.onDrop.bind(this), { capture: true });
|
|
75
|
+
element.addEventListener("dragend", this.onDragEnd.bind(this), { capture: true });
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
element.removeEventListener("dragstart", this.onDragStart.bind(this), { capture: true });
|
|
79
|
+
element.removeEventListener("drag", this.onDrag.bind(this), { capture: true });
|
|
80
|
+
element.removeEventListener("dragenter", this.onDragEnter.bind(this), { capture: false });
|
|
81
|
+
element.removeEventListener("dragleave", this.onDragLeave.bind(this), { capture: false });
|
|
82
|
+
element.removeEventListener("dragover", this.onDragOver.bind(this), { capture: true });
|
|
83
|
+
element.removeEventListener("drop", this.onDrop.bind(this), { capture: true });
|
|
84
|
+
element.removeEventListener("dragend", this.onDragEnd.bind(this), { capture: true });
|
|
85
|
+
}
|
|
86
|
+
}, e => { });
|
|
87
|
+
});
|
|
83
88
|
}
|
|
84
89
|
onDragStart(e) {
|
|
85
90
|
this.startDragging(e);
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { options, sensitive, transactional, LoggingLevel } from "reactronic";
|
|
10
|
+
import { options, sensitive, transactional, LoggingLevel, Transaction } from "reactronic";
|
|
11
11
|
import { grabElementDataList, SymDataForSensor } from "./DataForSensor.js";
|
|
12
12
|
import { HtmlElementSensor } from "./HtmlElementSensor.js";
|
|
13
13
|
export var KeyboardModifiers;
|
|
@@ -36,17 +36,22 @@ export class KeyboardSensor extends HtmlElementSensor {
|
|
|
36
36
|
this.modifiers = KeyboardModifiers.none;
|
|
37
37
|
}
|
|
38
38
|
listen(enabled = true) {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
const t = Transaction.current;
|
|
40
|
+
Transaction.outside(() => {
|
|
41
|
+
t.whenFinished(true).then(() => {
|
|
42
|
+
const element = this.sourceElement;
|
|
43
|
+
if (enabled) {
|
|
44
|
+
element.addEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
45
|
+
element.addEventListener("keyup", this.onKeyUp.bind(this), { capture: true });
|
|
46
|
+
window.addEventListener("blur", this.doWindowBlur.bind(this), { capture: true });
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
element.removeEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
50
|
+
element.removeEventListener("keyup", this.onKeyUp.bind(this), { capture: true });
|
|
51
|
+
window.removeEventListener("blur", this.doWindowBlur.bind(this), { capture: true });
|
|
52
|
+
}
|
|
53
|
+
}, e => { });
|
|
54
|
+
});
|
|
50
55
|
}
|
|
51
56
|
reset() {
|
|
52
57
|
this.preventDefault = false;
|
|
@@ -52,16 +52,21 @@ export class PointerSensor extends BasePointerSensor {
|
|
|
52
52
|
this.draggingData = value;
|
|
53
53
|
}
|
|
54
54
|
listen(enabled = true) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
const t = Transaction.current;
|
|
56
|
+
Transaction.outside(() => {
|
|
57
|
+
t.whenFinished(true).then(() => {
|
|
58
|
+
const element = this.sourceElement;
|
|
59
|
+
if (enabled) {
|
|
60
|
+
element.addEventListener("pointerdown", this.onPointerDown.bind(this), { capture: true });
|
|
61
|
+
element.addEventListener("pointermove", this.onPointerMove.bind(this), { capture: true });
|
|
62
|
+
element.addEventListener("pointerup", this.onPointerUp.bind(this), { capture: true });
|
|
63
|
+
element.addEventListener("lostpointercapture", this.onLostPointerCapture.bind(this), { capture: true });
|
|
64
|
+
element.addEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
}
|
|
68
|
+
}, e => { });
|
|
69
|
+
});
|
|
65
70
|
}
|
|
66
71
|
onPointerDown(e) {
|
|
67
72
|
var _a;
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { options, Reentrance, transactional, LoggingLevel } from "reactronic";
|
|
10
|
+
import { options, Reentrance, transactional, LoggingLevel, Transaction } from "reactronic";
|
|
11
11
|
import { HtmlElementSensor } from "./HtmlElementSensor.js";
|
|
12
12
|
export class ScrollSensor extends HtmlElementSensor {
|
|
13
13
|
constructor(element) {
|
|
@@ -16,13 +16,18 @@ export class ScrollSensor extends HtmlElementSensor {
|
|
|
16
16
|
this.y = Infinity;
|
|
17
17
|
}
|
|
18
18
|
listen(enabled = true) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const t = Transaction.current;
|
|
20
|
+
Transaction.outside(() => {
|
|
21
|
+
t.whenFinished(true).then(() => {
|
|
22
|
+
const element = this.sourceElement;
|
|
23
|
+
if (enabled) {
|
|
24
|
+
element.addEventListener("scroll", this.onScroll.bind(this), { capture: true, passive: true });
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
element.removeEventListener("scroll", this.onScroll.bind(this), { capture: true });
|
|
28
|
+
}
|
|
29
|
+
}, e => { });
|
|
30
|
+
});
|
|
26
31
|
}
|
|
27
32
|
reset() {
|
|
28
33
|
this.doReset();
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { options, Reentrance, transactional, LoggingLevel } from "reactronic";
|
|
10
|
+
import { options, Reentrance, transactional, LoggingLevel, Transaction } from "reactronic";
|
|
11
11
|
import { findTargetElementData, SymDataForSensor } from "./DataForSensor.js";
|
|
12
12
|
import { extractModifierKeys, KeyboardModifiers } from "./KeyboardSensor.js";
|
|
13
13
|
import { BasePointerSensor } from "./BasePointerSensor.js";
|
|
@@ -20,13 +20,18 @@ export class WheelSensor extends BasePointerSensor {
|
|
|
20
20
|
this.deltaY = Infinity;
|
|
21
21
|
}
|
|
22
22
|
listen(enabled = true) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
const t = Transaction.current;
|
|
24
|
+
Transaction.outside(() => {
|
|
25
|
+
t.whenFinished(true).then(() => {
|
|
26
|
+
const element = this.sourceElement;
|
|
27
|
+
if (enabled) {
|
|
28
|
+
element.addEventListener("wheel", this.onWheel.bind(this), { capture: true, passive: true });
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
element.removeEventListener("wheel", this.onWheel.bind(this), { capture: true });
|
|
32
|
+
}
|
|
33
|
+
}, e => { });
|
|
34
|
+
});
|
|
30
35
|
}
|
|
31
36
|
reset() {
|
|
32
37
|
this.doReset();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verstak",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.305",
|
|
4
4
|
"description": "Verstak - Front-End Library",
|
|
5
5
|
"publisher": "Nezaboodka Software",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/nezaboodka/verstak/blob/master/README.md#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"reactronic": "^0.24.
|
|
34
|
+
"reactronic": "^0.24.306"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "20.11.17",
|