verstak 0.22.500 → 0.22.503
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/api.d.ts +2 -2
- package/build/dist/source/api.js +2 -2
- package/build/dist/source/archive/RxDomV1.d.ts +1 -1
- package/build/dist/source/archive/RxDomV1.js +13 -13
- package/build/dist/source/core/Allocator.d.ts +64 -0
- package/build/dist/source/core/Allocator.js +141 -0
- package/build/dist/source/core/CellRange.d.ts +8 -0
- package/build/dist/source/core/CellRange.js +173 -0
- package/build/dist/source/core/Kernel.d.ts +77 -0
- package/build/dist/source/core/Kernel.js +504 -0
- package/build/dist/source/core/Restyler.js +1 -1
- package/build/dist/source/core/api.d.ts +5 -5
- package/build/dist/source/core/api.js +5 -5
- package/build/dist/source/html/Blocks.d.ts +14 -0
- package/build/dist/source/html/Blocks.js +124 -0
- package/build/dist/source/html/HtmlApiExt.d.ts +1 -1
- package/build/dist/source/html/HtmlApiExt.js +3 -3
- package/build/dist/source/html/HtmlBlocks.d.ts +175 -0
- package/build/dist/source/html/HtmlBlocks.js +356 -0
- package/build/dist/source/html/HtmlDriver.d.ts +20 -0
- package/build/dist/source/html/{HtmlNodeFactory.js → HtmlDriver.js} +25 -23
- package/build/dist/source/html/ReactingFocuser.d.ts +2 -0
- package/build/dist/source/html/ReactingFocuser.js +16 -0
- package/build/dist/source/html/api.d.ts +18 -17
- package/build/dist/source/html/api.js +18 -17
- package/build/dist/source/html/sensors/BasePointerSensor.d.ts +4 -4
- package/build/dist/source/html/sensors/BasePointerSensor.js +2 -2
- package/build/dist/source/html/sensors/ButtonSensor.d.ts +3 -3
- package/build/dist/source/html/sensors/ButtonSensor.js +17 -17
- package/build/dist/source/html/sensors/DataForSensor.js +6 -6
- package/build/dist/source/html/sensors/FocusSensor.d.ts +3 -3
- package/build/dist/source/html/sensors/FocusSensor.js +27 -27
- package/build/dist/source/html/sensors/HoverSensor.d.ts +1 -1
- package/build/dist/source/html/sensors/HoverSensor.js +9 -9
- package/build/dist/source/html/sensors/HtmlDragSensor.d.ts +6 -6
- package/build/dist/source/html/sensors/HtmlDragSensor.js +28 -28
- package/build/dist/source/html/sensors/HtmlElementSensor.d.ts +3 -3
- package/build/dist/source/html/sensors/HtmlElementSensor.js +4 -4
- package/build/dist/source/html/sensors/HtmlSensors.d.ts +9 -9
- package/build/dist/source/html/sensors/HtmlSensors.js +10 -10
- package/build/dist/source/html/sensors/KeyboardSensor.d.ts +1 -1
- package/build/dist/source/html/sensors/KeyboardSensor.js +18 -18
- package/build/dist/source/html/sensors/PointerSensor.d.ts +4 -4
- package/build/dist/source/html/sensors/PointerSensor.js +20 -20
- package/build/dist/source/html/sensors/ResizeSensor.d.ts +3 -3
- package/build/dist/source/html/sensors/ResizeSensor.js +13 -13
- package/build/dist/source/html/sensors/Sensor.d.ts +1 -1
- package/build/dist/source/html/sensors/Sensor.js +1 -1
- package/build/dist/source/html/sensors/WheelSensor.d.ts +1 -1
- package/build/dist/source/html/sensors/WheelSensor.js +7 -7
- package/build/dist/source/html/sensors/WindowSensor.d.ts +2 -2
- package/build/dist/source/html/sensors/WindowSensor.js +5 -5
- package/package.json +3 -3
- package/build/dist/source/core/Block.d.ts +0 -62
- package/build/dist/source/core/Block.js +0 -431
- package/build/dist/source/core/Elements.d.ts +0 -3
- package/build/dist/source/core/Elements.js +0 -7
- package/build/dist/source/core/Layout.d.ts +0 -27
- package/build/dist/source/core/Layout.js +0 -259
- package/build/dist/source/html/Cluster.d.ts +0 -11
- package/build/dist/source/html/Cluster.js +0 -14
- package/build/dist/source/html/HtmlElements.d.ts +0 -349
- package/build/dist/source/html/HtmlElements.js +0 -529
- package/build/dist/source/html/HtmlNodeFactory.d.ts +0 -19
- package/build/dist/source/html/RxFocuser.d.ts +0 -2
- package/build/dist/source/html/RxFocuser.js +0 -11
|
@@ -7,10 +7,10 @@ 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, reactive, transactional, raw, Transaction, LoggingLevel } from
|
|
11
|
-
import { findTargetElementData, SymDataForSensor } from
|
|
12
|
-
import { HtmlElementSensor } from
|
|
13
|
-
import { extractModifierKeys, KeyboardModifiers } from
|
|
10
|
+
import { options, reactive, transactional, raw, Transaction, LoggingLevel } from "reactronic";
|
|
11
|
+
import { findTargetElementData, SymDataForSensor } from "./DataForSensor";
|
|
12
|
+
import { HtmlElementSensor } from "./HtmlElementSensor";
|
|
13
|
+
import { extractModifierKeys, KeyboardModifiers } from "./KeyboardSensor";
|
|
14
14
|
export class HtmlDragSensor extends HtmlElementSensor {
|
|
15
15
|
constructor(focusSensor, windowSensor) {
|
|
16
16
|
super(focusSensor, windowSensor);
|
|
@@ -27,9 +27,9 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
27
27
|
this.draggingImage = undefined;
|
|
28
28
|
this.draggingImageX = Infinity;
|
|
29
29
|
this.draggingImageY = Infinity;
|
|
30
|
-
this.dropEffect =
|
|
30
|
+
this.dropEffect = "none";
|
|
31
31
|
this.dataTypesAllowed = [];
|
|
32
|
-
this.effectAllowed =
|
|
32
|
+
this.effectAllowed = "uninitialized";
|
|
33
33
|
this.dropAllowed = false;
|
|
34
34
|
this.draggingOver = false;
|
|
35
35
|
this.draggingDataTypes = [];
|
|
@@ -64,23 +64,23 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
64
64
|
const existing = this.sourceElement;
|
|
65
65
|
if (element !== existing) {
|
|
66
66
|
if (existing) {
|
|
67
|
-
existing.removeEventListener(
|
|
68
|
-
existing.removeEventListener(
|
|
69
|
-
existing.removeEventListener(
|
|
70
|
-
existing.removeEventListener(
|
|
71
|
-
existing.removeEventListener(
|
|
72
|
-
existing.removeEventListener(
|
|
73
|
-
existing.removeEventListener(
|
|
67
|
+
existing.removeEventListener("dragstart", this.onDragStart.bind(this), { capture: true });
|
|
68
|
+
existing.removeEventListener("drag", this.onDrag.bind(this), { capture: true });
|
|
69
|
+
existing.removeEventListener("dragenter", this.onDragEnter.bind(this), { capture: false });
|
|
70
|
+
existing.removeEventListener("dragleave", this.onDragLeave.bind(this), { capture: false });
|
|
71
|
+
existing.removeEventListener("dragover", this.onDragOver.bind(this), { capture: true });
|
|
72
|
+
existing.removeEventListener("drop", this.onDrop.bind(this), { capture: true });
|
|
73
|
+
existing.removeEventListener("dragend", this.onDragEnd.bind(this), { capture: true });
|
|
74
74
|
}
|
|
75
75
|
this.sourceElement = element;
|
|
76
76
|
if (element && enabled) {
|
|
77
|
-
element.addEventListener(
|
|
78
|
-
element.addEventListener(
|
|
79
|
-
element.addEventListener(
|
|
80
|
-
element.addEventListener(
|
|
81
|
-
element.addEventListener(
|
|
82
|
-
element.addEventListener(
|
|
83
|
-
element.addEventListener(
|
|
77
|
+
element.addEventListener("dragstart", this.onDragStart.bind(this), { capture: true });
|
|
78
|
+
element.addEventListener("drag", this.onDrag.bind(this), { capture: true });
|
|
79
|
+
element.addEventListener("dragenter", this.onDragEnter.bind(this), { capture: false });
|
|
80
|
+
element.addEventListener("dragleave", this.onDragLeave.bind(this), { capture: false });
|
|
81
|
+
element.addEventListener("dragover", this.onDragOver.bind(this), { capture: true });
|
|
82
|
+
element.addEventListener("drop", this.onDrop.bind(this), { capture: true });
|
|
83
|
+
element.addEventListener("dragend", this.onDragEnd.bind(this), { capture: true });
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -115,9 +115,9 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
115
115
|
this.stopPropagation = false;
|
|
116
116
|
const targetPath = e.composedPath();
|
|
117
117
|
const underPointer = document.elementsFromPoint(e.clientX, e.clientY);
|
|
118
|
-
const { data, window } = findTargetElementData(targetPath, underPointer, SymDataForSensor, [
|
|
118
|
+
const { data, window } = findTargetElementData(targetPath, underPointer, SymDataForSensor, ["htmlDraggable"]);
|
|
119
119
|
this.draggable = data === null || data === void 0 ? void 0 : data.htmlDraggable;
|
|
120
|
-
this.dragSource = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, [
|
|
120
|
+
this.dragSource = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, ["htmlDrag"], true).data) === null || _a === void 0 ? void 0 : _a.htmlDrag;
|
|
121
121
|
this.dragStarted = true;
|
|
122
122
|
this.dragFinished = false;
|
|
123
123
|
this.startX = e.clientX;
|
|
@@ -132,7 +132,7 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
132
132
|
this.revision++;
|
|
133
133
|
Transaction.separate(() => {
|
|
134
134
|
var _a;
|
|
135
|
-
(_a = this.windowSensor) === null || _a === void 0 ? void 0 : _a.setActiveWindow(window,
|
|
135
|
+
(_a = this.windowSensor) === null || _a === void 0 ? void 0 : _a.setActiveWindow(window, "htmlDrag");
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
dragging(e) {
|
|
@@ -168,7 +168,7 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
168
168
|
dt.types.forEach(type => {
|
|
169
169
|
if (!dataByFormat.has(type)) {
|
|
170
170
|
const data = dt.getData(type);
|
|
171
|
-
if (data !==
|
|
171
|
+
if (data !== "") {
|
|
172
172
|
this.dataByFormat = dataByFormat = dataByFormat.toMutable();
|
|
173
173
|
dataByFormat.set(type, data);
|
|
174
174
|
}
|
|
@@ -183,7 +183,7 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
183
183
|
dt.dropEffect = this.dropEffect;
|
|
184
184
|
dt.effectAllowed = this.effectAllowed;
|
|
185
185
|
this.dataByFormat.forEach((data, format) => {
|
|
186
|
-
if (typeof data ===
|
|
186
|
+
if (typeof data === "string")
|
|
187
187
|
dt.setData(format, data);
|
|
188
188
|
});
|
|
189
189
|
if (this.draggingImage) {
|
|
@@ -209,9 +209,9 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
209
209
|
this.draggingImage = undefined;
|
|
210
210
|
this.draggingImageX = Infinity;
|
|
211
211
|
this.draggingImageY = Infinity;
|
|
212
|
-
this.dropEffect =
|
|
212
|
+
this.dropEffect = "none";
|
|
213
213
|
this.dataTypesAllowed = [];
|
|
214
|
-
this.effectAllowed =
|
|
214
|
+
this.effectAllowed = "uninitialized";
|
|
215
215
|
this.dropAllowed = false;
|
|
216
216
|
this.draggingOver = false;
|
|
217
217
|
this.draggingDataTypes = [];
|
|
@@ -230,7 +230,7 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
230
230
|
var _a;
|
|
231
231
|
const targetPath = e.composedPath();
|
|
232
232
|
const underPointer = document.elementsFromPoint(e.clientX, e.clientY);
|
|
233
|
-
const { data, window } = findTargetElementData(targetPath, underPointer, SymDataForSensor, [
|
|
233
|
+
const { data, window } = findTargetElementData(targetPath, underPointer, SymDataForSensor, ["htmlDrag"]);
|
|
234
234
|
const dragTarget = data === null || data === void 0 ? void 0 : data.htmlDrag;
|
|
235
235
|
if (dragTarget !== this.dragTarget) {
|
|
236
236
|
this.previousDragTarget = this.dragTarget;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DataForSensor } from
|
|
2
|
-
import { Sensor } from
|
|
3
|
-
import { WindowSensor } from
|
|
1
|
+
import { DataForSensor } from "./DataForSensor";
|
|
2
|
+
import { Sensor } from "./Sensor";
|
|
3
|
+
import { WindowSensor } from "./WindowSensor";
|
|
4
4
|
export declare class HtmlElementSensor extends Sensor {
|
|
5
5
|
readonly focusSensor?: any;
|
|
6
6
|
readonly windowSensor?: WindowSensor;
|
|
@@ -7,10 +7,10 @@ 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 { raw } from
|
|
11
|
-
import { SymDataForSensor } from
|
|
12
|
-
import { Sensor } from
|
|
13
|
-
import { WindowSensor } from
|
|
10
|
+
import { raw } from "reactronic";
|
|
11
|
+
import { SymDataForSensor } from "./DataForSensor";
|
|
12
|
+
import { Sensor } from "./Sensor";
|
|
13
|
+
import { WindowSensor } from "./WindowSensor";
|
|
14
14
|
export class HtmlElementSensor extends Sensor {
|
|
15
15
|
constructor(focusSensor, windowSensor) {
|
|
16
16
|
super();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FocusSensor } from
|
|
2
|
-
import { HoverSensor } from
|
|
3
|
-
import { HtmlDragSensor } from
|
|
4
|
-
import { KeyboardSensor } from
|
|
5
|
-
import { ButtonSensor } from
|
|
6
|
-
import { ResizeSensor } from
|
|
7
|
-
import { WheelSensor } from
|
|
8
|
-
import { WindowSensor } from
|
|
9
|
-
import { PointerSensor } from
|
|
1
|
+
import { FocusSensor } from "./FocusSensor";
|
|
2
|
+
import { HoverSensor } from "./HoverSensor";
|
|
3
|
+
import { HtmlDragSensor } from "./HtmlDragSensor";
|
|
4
|
+
import { KeyboardSensor } from "./KeyboardSensor";
|
|
5
|
+
import { ButtonSensor } from "./ButtonSensor";
|
|
6
|
+
import { ResizeSensor } from "./ResizeSensor";
|
|
7
|
+
import { WheelSensor } from "./WheelSensor";
|
|
8
|
+
import { WindowSensor } from "./WindowSensor";
|
|
9
|
+
import { PointerSensor } from "./PointerSensor";
|
|
10
10
|
export declare class HtmlSensors {
|
|
11
11
|
readonly window: WindowSensor;
|
|
12
12
|
readonly focus: FocusSensor;
|
|
@@ -7,16 +7,16 @@ 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 { transactional } from
|
|
11
|
-
import { FocusSensor } from
|
|
12
|
-
import { HoverSensor } from
|
|
13
|
-
import { HtmlDragSensor } from
|
|
14
|
-
import { KeyboardSensor } from
|
|
15
|
-
import { ButtonSensor } from
|
|
16
|
-
import { ResizeSensor } from
|
|
17
|
-
import { WheelSensor } from
|
|
18
|
-
import { WindowSensor } from
|
|
19
|
-
import { PointerSensor } from
|
|
10
|
+
import { transactional } from "reactronic";
|
|
11
|
+
import { FocusSensor } from "./FocusSensor";
|
|
12
|
+
import { HoverSensor } from "./HoverSensor";
|
|
13
|
+
import { HtmlDragSensor } from "./HtmlDragSensor";
|
|
14
|
+
import { KeyboardSensor } from "./KeyboardSensor";
|
|
15
|
+
import { ButtonSensor } from "./ButtonSensor";
|
|
16
|
+
import { ResizeSensor } from "./ResizeSensor";
|
|
17
|
+
import { WheelSensor } from "./WheelSensor";
|
|
18
|
+
import { WindowSensor } from "./WindowSensor";
|
|
19
|
+
import { PointerSensor } from "./PointerSensor";
|
|
20
20
|
export class HtmlSensors {
|
|
21
21
|
constructor() {
|
|
22
22
|
this.window = new WindowSensor();
|
|
@@ -7,9 +7,9 @@ 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
|
|
11
|
-
import { grabElementDataList, SymDataForSensor } from
|
|
12
|
-
import { HtmlElementSensor } from
|
|
10
|
+
import { options, sensitive, transactional, LoggingLevel } from "reactronic";
|
|
11
|
+
import { grabElementDataList, SymDataForSensor } from "./DataForSensor";
|
|
12
|
+
import { HtmlElementSensor } from "./HtmlElementSensor";
|
|
13
13
|
export var KeyboardModifiers;
|
|
14
14
|
(function (KeyboardModifiers) {
|
|
15
15
|
KeyboardModifiers[KeyboardModifiers["None"] = 0] = "None";
|
|
@@ -31,29 +31,29 @@ export var KeyboardModifiers;
|
|
|
31
31
|
export class KeyboardSensor extends HtmlElementSensor {
|
|
32
32
|
constructor() {
|
|
33
33
|
super();
|
|
34
|
-
this.down =
|
|
35
|
-
this.up =
|
|
34
|
+
this.down = "";
|
|
35
|
+
this.up = "";
|
|
36
36
|
this.modifiers = KeyboardModifiers.None;
|
|
37
37
|
}
|
|
38
38
|
listen(element, enabled = true) {
|
|
39
39
|
const existing = this.sourceElement;
|
|
40
40
|
if (element !== existing) {
|
|
41
41
|
if (existing) {
|
|
42
|
-
existing.removeEventListener(
|
|
43
|
-
existing.removeEventListener(
|
|
42
|
+
existing.removeEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
43
|
+
existing.removeEventListener("keyup", this.onKeyUp.bind(this), { capture: true });
|
|
44
44
|
}
|
|
45
45
|
this.sourceElement = element;
|
|
46
46
|
if (element && enabled) {
|
|
47
|
-
element.addEventListener(
|
|
48
|
-
element.addEventListener(
|
|
47
|
+
element.addEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
48
|
+
element.addEventListener("keyup", this.onKeyUp.bind(this), { capture: true });
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
reset() {
|
|
53
53
|
this.preventDefault = false;
|
|
54
54
|
this.stopPropagation = false;
|
|
55
|
-
this.down =
|
|
56
|
-
this.up =
|
|
55
|
+
this.down = "";
|
|
56
|
+
this.up = "";
|
|
57
57
|
this.modifiers = KeyboardModifiers.None;
|
|
58
58
|
}
|
|
59
59
|
onKeyDown(e) {
|
|
@@ -66,31 +66,31 @@ export class KeyboardSensor extends HtmlElementSensor {
|
|
|
66
66
|
}
|
|
67
67
|
keyDown(e) {
|
|
68
68
|
this.updateSensorData(e);
|
|
69
|
-
this.up =
|
|
69
|
+
this.up = "";
|
|
70
70
|
sensitive(true, () => this.down = e.key);
|
|
71
71
|
}
|
|
72
72
|
keyUp(e) {
|
|
73
73
|
this.updateSensorData(e);
|
|
74
|
-
this.down =
|
|
74
|
+
this.down = "";
|
|
75
75
|
sensitive(true, () => this.up = e.key);
|
|
76
76
|
}
|
|
77
77
|
updateSensorData(e) {
|
|
78
78
|
this.preventDefault = false;
|
|
79
79
|
this.stopPropagation = false;
|
|
80
80
|
const path = e.composedPath();
|
|
81
|
-
this.elementDataList = grabElementDataList(path, SymDataForSensor,
|
|
81
|
+
this.elementDataList = grabElementDataList(path, SymDataForSensor, "keyboard", this.elementDataList).dataList;
|
|
82
82
|
this.modifiers = extractModifierKeys(e);
|
|
83
83
|
this.revision++;
|
|
84
84
|
}
|
|
85
85
|
static getKeyAsModifierIfAny(key) {
|
|
86
86
|
let modifier = KeyboardModifiers.None;
|
|
87
|
-
if (key ===
|
|
87
|
+
if (key === "Control")
|
|
88
88
|
modifier = KeyboardModifiers.Ctrl;
|
|
89
|
-
else if (key ===
|
|
89
|
+
else if (key === "Shift")
|
|
90
90
|
modifier = KeyboardModifiers.Shift;
|
|
91
|
-
else if (key ===
|
|
91
|
+
else if (key === "Alt")
|
|
92
92
|
modifier = KeyboardModifiers.Alt;
|
|
93
|
-
else if (key ===
|
|
93
|
+
else if (key === "Meta")
|
|
94
94
|
modifier = KeyboardModifiers.Meta;
|
|
95
95
|
return modifier;
|
|
96
96
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PointerButton, BasePointerSensor } from
|
|
2
|
-
import { FocusSensor } from
|
|
3
|
-
import { KeyboardModifiers } from
|
|
4
|
-
import { WindowSensor } from
|
|
1
|
+
import { PointerButton, BasePointerSensor } from "./BasePointerSensor";
|
|
2
|
+
import { FocusSensor } from "./FocusSensor";
|
|
3
|
+
import { KeyboardModifiers } from "./KeyboardSensor";
|
|
4
|
+
import { WindowSensor } from "./WindowSensor";
|
|
5
5
|
export declare class PointerSensor extends BasePointerSensor {
|
|
6
6
|
pointerButton: PointerButton;
|
|
7
7
|
private clickable;
|
|
@@ -7,10 +7,10 @@ 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, reactive, Reentrance, transactional, raw, Transaction, LoggingLevel } from
|
|
11
|
-
import { extractPointerButton, isPointerButtonDown, PointerButton, BasePointerSensor } from
|
|
12
|
-
import { findTargetElementData, SymDataForSensor } from
|
|
13
|
-
import { extractModifierKeys, KeyboardModifiers } from
|
|
10
|
+
import { options, reactive, Reentrance, transactional, raw, Transaction, LoggingLevel } from "reactronic";
|
|
11
|
+
import { extractPointerButton, isPointerButtonDown, PointerButton, BasePointerSensor } from "./BasePointerSensor";
|
|
12
|
+
import { findTargetElementData, SymDataForSensor } from "./DataForSensor";
|
|
13
|
+
import { extractModifierKeys, KeyboardModifiers } from "./KeyboardSensor";
|
|
14
14
|
export class PointerSensor extends BasePointerSensor {
|
|
15
15
|
constructor(focusSensor, windowSensor) {
|
|
16
16
|
super(focusSensor, windowSensor);
|
|
@@ -55,19 +55,19 @@ export class PointerSensor extends BasePointerSensor {
|
|
|
55
55
|
const existing = this.sourceElement;
|
|
56
56
|
if (element !== existing) {
|
|
57
57
|
if (existing) {
|
|
58
|
-
existing.removeEventListener(
|
|
59
|
-
existing.removeEventListener(
|
|
60
|
-
existing.removeEventListener(
|
|
61
|
-
existing.removeEventListener(
|
|
62
|
-
existing.removeEventListener(
|
|
58
|
+
existing.removeEventListener("pointerdown", this.onPointerDown.bind(this), { capture: true });
|
|
59
|
+
existing.removeEventListener("pointermove", this.onPointerMove.bind(this), { capture: true });
|
|
60
|
+
existing.removeEventListener("pointerup", this.onPointerUp.bind(this), { capture: true });
|
|
61
|
+
existing.removeEventListener("lostpointercapture", this.onLostPointerCapture.bind(this), { capture: true });
|
|
62
|
+
existing.removeEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
63
63
|
}
|
|
64
64
|
this.sourceElement = element;
|
|
65
65
|
if (element && enabled) {
|
|
66
|
-
element.addEventListener(
|
|
67
|
-
element.addEventListener(
|
|
68
|
-
element.addEventListener(
|
|
69
|
-
element.addEventListener(
|
|
70
|
-
element.addEventListener(
|
|
66
|
+
element.addEventListener("pointerdown", this.onPointerDown.bind(this), { capture: true });
|
|
67
|
+
element.addEventListener("pointermove", this.onPointerMove.bind(this), { capture: true });
|
|
68
|
+
element.addEventListener("pointerup", this.onPointerUp.bind(this), { capture: true });
|
|
69
|
+
element.addEventListener("lostpointercapture", this.onLostPointerCapture.bind(this), { capture: true });
|
|
70
|
+
element.addEventListener("keydown", this.onKeyDown.bind(this), { capture: true });
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -124,7 +124,7 @@ export class PointerSensor extends BasePointerSensor {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
onKeyDown(e) {
|
|
127
|
-
if (e.key ===
|
|
127
|
+
if (e.key === "Escape" && (this.dragStarted || this.clickable)) {
|
|
128
128
|
this.cancelDragging();
|
|
129
129
|
this.reset();
|
|
130
130
|
}
|
|
@@ -139,7 +139,7 @@ export class PointerSensor extends BasePointerSensor {
|
|
|
139
139
|
this.stopPropagation = false;
|
|
140
140
|
const targetPath = e.composedPath();
|
|
141
141
|
const underPointer = document.elementsFromPoint(e.clientX, e.clientY);
|
|
142
|
-
const { data, window } = findTargetElementData(targetPath, underPointer, SymDataForSensor, [
|
|
142
|
+
const { data, window } = findTargetElementData(targetPath, underPointer, SymDataForSensor, ["click", "draggable"]);
|
|
143
143
|
const clickable = data === null || data === void 0 ? void 0 : data.click;
|
|
144
144
|
const draggable = data === null || data === void 0 ? void 0 : data.draggable;
|
|
145
145
|
if (clickable || draggable) {
|
|
@@ -147,7 +147,7 @@ export class PointerSensor extends BasePointerSensor {
|
|
|
147
147
|
this.clicking = clickable;
|
|
148
148
|
this.draggableData = draggable;
|
|
149
149
|
this.tryingDragging = draggable !== undefined;
|
|
150
|
-
this.dragSource = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, [
|
|
150
|
+
this.dragSource = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, ["drag"], true).data) === null || _a === void 0 ? void 0 : _a.drag;
|
|
151
151
|
this.pointerButton = extractPointerButton(e);
|
|
152
152
|
this.startX = e.clientX;
|
|
153
153
|
this.startY = e.clientY;
|
|
@@ -160,7 +160,7 @@ export class PointerSensor extends BasePointerSensor {
|
|
|
160
160
|
this.previousDragTarget = undefined;
|
|
161
161
|
Transaction.separate(() => {
|
|
162
162
|
var _a;
|
|
163
|
-
(_a = this.windowSensor) === null || _a === void 0 ? void 0 : _a.setActiveWindow(window,
|
|
163
|
+
(_a = this.windowSensor) === null || _a === void 0 ? void 0 : _a.setActiveWindow(window, "pointer");
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
this.revision++;
|
|
@@ -248,7 +248,7 @@ export class PointerSensor extends BasePointerSensor {
|
|
|
248
248
|
var _a;
|
|
249
249
|
const targetPath = e.composedPath();
|
|
250
250
|
const underPointer = document.elementsFromPoint(e.clientX, e.clientY);
|
|
251
|
-
const clickable = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, [
|
|
251
|
+
const clickable = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, ["click"]).data) === null || _a === void 0 ? void 0 : _a.click;
|
|
252
252
|
const isSameClickable = this.clickable === clickable;
|
|
253
253
|
if (isSameClickable)
|
|
254
254
|
this.clicking = clickable;
|
|
@@ -260,7 +260,7 @@ export class PointerSensor extends BasePointerSensor {
|
|
|
260
260
|
updateDragTarget(e) {
|
|
261
261
|
const targetPath = e.composedPath();
|
|
262
262
|
const underPointer = document.elementsFromPoint(e.clientX, e.clientY);
|
|
263
|
-
const { data, window } = findTargetElementData(targetPath, underPointer, SymDataForSensor, [
|
|
263
|
+
const { data, window } = findTargetElementData(targetPath, underPointer, SymDataForSensor, ["drag"]);
|
|
264
264
|
const dragTarget = data === null || data === void 0 ? void 0 : data.drag;
|
|
265
265
|
if (dragTarget !== this.dragTarget) {
|
|
266
266
|
this.previousDragTarget = this.dragTarget;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Sensor } from
|
|
1
|
+
import { VBlock } from "../../core/api";
|
|
2
|
+
import { Sensor } from "./Sensor";
|
|
3
3
|
export interface ResizedElement {
|
|
4
4
|
readonly borderBoxSize: ReadonlyArray<ResizeObserverSize>;
|
|
5
5
|
readonly contentBoxSize: ReadonlyArray<ResizeObserverSize>;
|
|
@@ -11,7 +11,7 @@ export declare class ResizeSensor extends Sensor {
|
|
|
11
11
|
resizedElements: Array<ResizedElement>;
|
|
12
12
|
constructor();
|
|
13
13
|
reset(): void;
|
|
14
|
-
observeResizing(block:
|
|
14
|
+
observeResizing(block: VBlock<any, any, any>, value: boolean, boxSizing?: ResizeObserverBoxOptions): void;
|
|
15
15
|
protected onResize(entries: Array<ResizeObserverEntry>): void;
|
|
16
16
|
protected resize(entries: Array<ResizeObserverEntry>): void;
|
|
17
17
|
protected doReset(): void;
|
|
@@ -7,8 +7,8 @@ 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
|
|
11
|
-
import { Sensor } from
|
|
10
|
+
import { options, transactional, LoggingLevel } from "reactronic";
|
|
11
|
+
import { Sensor } from "./Sensor";
|
|
12
12
|
export class ResizeSensor extends Sensor {
|
|
13
13
|
constructor() {
|
|
14
14
|
super();
|
|
@@ -18,24 +18,24 @@ export class ResizeSensor extends Sensor {
|
|
|
18
18
|
reset() {
|
|
19
19
|
this.doReset();
|
|
20
20
|
}
|
|
21
|
-
observeResizing(block, value, boxSizing =
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
21
|
+
observeResizing(block, value, boxSizing = "content-box") {
|
|
22
|
+
const native = block.native;
|
|
23
|
+
if (native instanceof Element) {
|
|
24
24
|
if (value) {
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.observer.observe(
|
|
25
|
+
if (native.resizeObserver !== undefined && native.resizeObserver !== this.observer)
|
|
26
|
+
native.resizeObserver.unobserve(native);
|
|
27
|
+
native.resizeObserver = this.observer;
|
|
28
|
+
this.observer.observe(native, { box: boxSizing });
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
|
-
if (
|
|
32
|
-
this.observer.unobserve(
|
|
33
|
-
|
|
31
|
+
if (native.resizeObserver === this.observer) {
|
|
32
|
+
this.observer.unobserve(native);
|
|
33
|
+
native.resizeObserver = undefined;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
else
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error("cannot observe resizing of non-HTML block");
|
|
39
39
|
}
|
|
40
40
|
onResize(entries) {
|
|
41
41
|
this.resize(entries);
|
|
@@ -7,10 +7,10 @@ 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
|
|
11
|
-
import { findTargetElementData, SymDataForSensor } from
|
|
12
|
-
import { extractModifierKeys, KeyboardModifiers } from
|
|
13
|
-
import { BasePointerSensor } from
|
|
10
|
+
import { options, Reentrance, transactional, LoggingLevel } from "reactronic";
|
|
11
|
+
import { findTargetElementData, SymDataForSensor } from "./DataForSensor";
|
|
12
|
+
import { extractModifierKeys, KeyboardModifiers } from "./KeyboardSensor";
|
|
13
|
+
import { BasePointerSensor } from "./BasePointerSensor";
|
|
14
14
|
export class WheelSensor extends BasePointerSensor {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
@@ -23,11 +23,11 @@ export class WheelSensor extends BasePointerSensor {
|
|
|
23
23
|
const existing = this.sourceElement;
|
|
24
24
|
if (element !== existing) {
|
|
25
25
|
if (existing) {
|
|
26
|
-
existing.removeEventListener(
|
|
26
|
+
existing.removeEventListener("wheel", this.onWheel.bind(this), { capture: true });
|
|
27
27
|
}
|
|
28
28
|
this.sourceElement = element;
|
|
29
29
|
if (element && enabled) {
|
|
30
|
-
element.addEventListener(
|
|
30
|
+
element.addEventListener("wheel", this.onWheel.bind(this), { capture: true, passive: true });
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -56,7 +56,7 @@ export class WheelSensor extends BasePointerSensor {
|
|
|
56
56
|
this.stopPropagation = false;
|
|
57
57
|
const targetPath = e.composedPath();
|
|
58
58
|
const underPointer = document.elementsFromPoint(e.clientX, e.clientY);
|
|
59
|
-
this.target = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, [
|
|
59
|
+
this.target = (_a = findTargetElementData(targetPath, underPointer, SymDataForSensor, ["wheel"]).data) === null || _a === void 0 ? void 0 : _a.wheel;
|
|
60
60
|
this.modifiers = extractModifierKeys(e);
|
|
61
61
|
this.positionX = e.clientX;
|
|
62
62
|
this.positionY = e.clientY;
|
|
@@ -7,19 +7,19 @@ 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 { ToggleRef, transactional } from
|
|
11
|
-
import { objectHasMember } from
|
|
12
|
-
import { Sensor } from
|
|
10
|
+
import { ToggleRef, transactional } from "reactronic";
|
|
11
|
+
import { objectHasMember } from "../../core/Utils";
|
|
12
|
+
import { Sensor } from "./Sensor";
|
|
13
13
|
export class WindowSensor extends Sensor {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.activeData = undefined;
|
|
17
17
|
this.previousActiveData = undefined;
|
|
18
18
|
}
|
|
19
|
-
setActiveWindow(window, debugHint =
|
|
19
|
+
setActiveWindow(window, debugHint = "") {
|
|
20
20
|
if (window !== this.activeData) {
|
|
21
21
|
const activeData = this.activeData;
|
|
22
|
-
if (activeData && objectHasMember(activeData,
|
|
22
|
+
if (activeData && objectHasMember(activeData, "popupToggle")) {
|
|
23
23
|
const popupToggle = activeData.popupToggle;
|
|
24
24
|
if (popupToggle instanceof ToggleRef) {
|
|
25
25
|
popupToggle.variable = popupToggle.valueOff;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verstak",
|
|
3
|
-
"version": "0.22.
|
|
4
|
-
"description": "Verstak -
|
|
3
|
+
"version": "0.22.503",
|
|
4
|
+
"description": "Verstak - Front-End Library",
|
|
5
5
|
"publisher": "Nezaboodka Software",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
@@ -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.22.
|
|
34
|
+
"reactronic": "^0.22.503"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "18.11.7",
|