verstak 0.91.25002 → 0.92.25003
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/core/ElDriver.js +7 -7
- package/build/dist/source/core/Elements.js +3 -3
- package/build/dist/source/core/Restyler.js +3 -3
- package/build/dist/source/express/Theme.js +2 -2
- package/build/dist/source/express/Toggle.v.js +7 -4
- package/build/dist/source/express/common/Utils.js +2 -2
- package/build/dist/source/express/theme/Button.s.js +4 -4
- package/build/dist/source/express/theme/Field.s.js +5 -5
- package/build/dist/source/express/theme/Icon.s.js +2 -2
- package/build/dist/source/express/theme/Styling.js +2 -2
- package/build/dist/source/express/theme/Toggle.s.js +4 -4
- package/build/dist/source/sensors/ButtonSensor.js +7 -7
- package/build/dist/source/sensors/FocusSensor.js +6 -6
- package/build/dist/source/sensors/Handlers.d.ts +1 -1
- package/build/dist/source/sensors/Handlers.js +7 -7
- package/build/dist/source/sensors/HoverSensor.js +6 -6
- package/build/dist/source/sensors/HtmlDragSensor.js +20 -20
- package/build/dist/source/sensors/HtmlElementSensor.js +5 -5
- package/build/dist/source/sensors/KeyboardSensor.js +4 -4
- package/build/dist/source/sensors/PointerSensor.js +17 -17
- package/build/dist/source/sensors/ResizeSensor.js +3 -3
- package/build/dist/source/sensors/ScrollSensor.js +3 -3
- package/build/dist/source/sensors/WheelSensor.js +3 -3
- package/build/dist/source/sensors/WindowSensor.js +2 -2
- package/package.json +2 -2
- package/build/dist/source/archive/RxDomV1.Types.d.ts +0 -46
- package/build/dist/source/archive/RxDomV1.Types.js +0 -22
- package/build/dist/source/archive/RxDomV1.d.ts +0 -45
- package/build/dist/source/archive/RxDomV1.js +0 -557
|
@@ -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 { ReactiveNode, BaseDriver, Transaction,
|
|
10
|
+
import { ReactiveNode, BaseDriver, Transaction, observable, ObservableObject } from "reactronic";
|
|
11
11
|
import { ElKind, Horizontal, Vertical, Direction } from "./El.js";
|
|
12
12
|
import { equalElCoords, parseElCoords } from "./ElUtils.js";
|
|
13
13
|
export class ElDriver extends BaseDriver {
|
|
@@ -561,27 +561,27 @@ export class ElLayoutInfo {
|
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
__decorate([
|
|
564
|
-
|
|
564
|
+
observable,
|
|
565
565
|
__metadata("design:type", Number)
|
|
566
566
|
], ElLayoutInfo.prototype, "effectiveSizePx", void 0);
|
|
567
567
|
__decorate([
|
|
568
|
-
|
|
568
|
+
observable,
|
|
569
569
|
__metadata("design:type", Number)
|
|
570
570
|
], ElLayoutInfo.prototype, "contentSizeXpx", void 0);
|
|
571
571
|
__decorate([
|
|
572
|
-
|
|
572
|
+
observable,
|
|
573
573
|
__metadata("design:type", Number)
|
|
574
574
|
], ElLayoutInfo.prototype, "contentSizeYpx", void 0);
|
|
575
575
|
__decorate([
|
|
576
|
-
|
|
576
|
+
observable,
|
|
577
577
|
__metadata("design:type", Number)
|
|
578
578
|
], ElLayoutInfo.prototype, "borderSizeYpx", void 0);
|
|
579
579
|
__decorate([
|
|
580
|
-
|
|
580
|
+
observable,
|
|
581
581
|
__metadata("design:type", Number)
|
|
582
582
|
], ElLayoutInfo.prototype, "borderSizeXpx", void 0);
|
|
583
583
|
__decorate([
|
|
584
|
-
|
|
584
|
+
observable,
|
|
585
585
|
__metadata("design:type", Boolean)
|
|
586
586
|
], ElLayoutInfo.prototype, "isUpdateFinished", void 0);
|
|
587
587
|
var ElLayoutInfoFlags;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactiveNode, Mode,
|
|
1
|
+
import { ReactiveNode, Mode, nonreactive } from "reactronic";
|
|
2
2
|
import { ElKind, Direction } from "./El.js";
|
|
3
3
|
import { clamp } from "./ElUtils.js";
|
|
4
4
|
import { Constants, CursorCommandDriver, ElDriver, ElLayoutInfo, InitialElLayoutInfo } from "./ElDriver.js";
|
|
@@ -51,7 +51,7 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
51
51
|
for (const item of initialSizesPx) {
|
|
52
52
|
clonedSizesPx.push({ node: item.node, sizePx: item.sizePx });
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
nonreactive(() => relayoutUsingSplitter(splitViewNode, deltaPx, index, clonedSizesPx));
|
|
55
55
|
if (pointer.dropped) {
|
|
56
56
|
(_a = model === null || model === void 0 ? void 0 : model.droppedAction) === null || _a === void 0 ? void 0 : _a.call(model, pointer);
|
|
57
57
|
}
|
|
@@ -168,7 +168,7 @@ export class PanelDriver extends HtmlDriver {
|
|
|
168
168
|
const priorities = preferred.length > 0
|
|
169
169
|
? getPrioritiesForSizeChanging(isHorizontal, node.children, preferred)
|
|
170
170
|
: getPrioritiesForEmptySpaceDistribution(isHorizontal, node.children);
|
|
171
|
-
|
|
171
|
+
nonreactive(() => relayout(node, priorities.resizable, priorities.manuallyResizable, sizesPx));
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
});
|
|
@@ -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 {
|
|
10
|
+
import { cache, apply } from "reactronic";
|
|
11
11
|
export function restyler(restyle) {
|
|
12
|
-
return
|
|
12
|
+
return apply(() => new ObservablesStyles(restyle));
|
|
13
13
|
}
|
|
14
14
|
export class ObservablesStyles {
|
|
15
15
|
constructor(restyle) {
|
|
@@ -23,7 +23,7 @@ export class ObservablesStyles {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
__decorate([
|
|
26
|
-
|
|
26
|
+
cache,
|
|
27
27
|
__metadata("design:type", Function),
|
|
28
28
|
__metadata("design:paramtypes", []),
|
|
29
29
|
__metadata("design:returntype", Object)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { apply, ReactiveNodeVariable, Isolation } from "reactronic";
|
|
2
2
|
import { DefaultButtonStyling } from "./theme/Button.s.js";
|
|
3
3
|
import { DefaultFieldStyling } from "./theme/Field.s.js";
|
|
4
4
|
import { DefaultIconStyling } from "./theme/Icon.s.js";
|
|
@@ -27,4 +27,4 @@ export class Theme {
|
|
|
27
27
|
Theme.gCurrent.value = value;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
Theme.gCurrent = new ReactiveNodeVariable(
|
|
30
|
+
Theme.gCurrent = new ReactiveNodeVariable(apply({ isolation: Isolation.disjoinFromOuterTransaction }, () => new Theme()));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Panel, Note } from "verstak";
|
|
1
|
+
import { Mode, ReactiveNode } from "reactronic";
|
|
2
|
+
import { Panel, Note, OnClick } from "verstak";
|
|
3
3
|
import { observableModel } from "./common/Utils.js";
|
|
4
4
|
import { Theme } from "./Theme.js";
|
|
5
5
|
import { Icon } from "./Icon.v.js";
|
|
@@ -13,7 +13,6 @@ export function Toggle(declaration) {
|
|
|
13
13
|
checked: true,
|
|
14
14
|
color: "green"
|
|
15
15
|
}));
|
|
16
|
-
el.native.onclick = () => Transaction.run(null, () => el.model.checked = !el.model.checked);
|
|
17
16
|
},
|
|
18
17
|
script: el => {
|
|
19
18
|
const m = el.model;
|
|
@@ -28,13 +27,17 @@ export function Toggle(declaration) {
|
|
|
28
27
|
el.style.color = m.checked ? ((_a = theme.positiveColor) !== null && _a !== void 0 ? _a : "") : "";
|
|
29
28
|
},
|
|
30
29
|
});
|
|
31
|
-
if (m.label)
|
|
30
|
+
if (m.label) {
|
|
32
31
|
Note(m.label, false, {
|
|
33
32
|
script: (el, base) => {
|
|
34
33
|
base();
|
|
35
34
|
el.useStylingPreset(toggleTheme.label);
|
|
36
35
|
},
|
|
37
36
|
});
|
|
37
|
+
}
|
|
38
|
+
OnClick(el.native, () => {
|
|
39
|
+
el.model.checked = !el.model.checked;
|
|
40
|
+
});
|
|
38
41
|
},
|
|
39
42
|
})));
|
|
40
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ObservableObject, Ref,
|
|
1
|
+
import { ObservableObject, Ref, apply, Isolation } from "reactronic";
|
|
2
2
|
export function observableModel(modelProps) {
|
|
3
|
-
return
|
|
3
|
+
return apply({ isolation: Isolation.disjoinFromOuterTransaction }, () => new ObservableComposition(modelProps));
|
|
4
4
|
}
|
|
5
5
|
class ObservableComposition extends ObservableObject {
|
|
6
6
|
constructor(composition) {
|
|
@@ -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 {
|
|
10
|
+
import { cache } from "reactronic";
|
|
11
11
|
import { css } from "@emotion/css";
|
|
12
12
|
import { Styling } from "./Styling.js";
|
|
13
13
|
export class DefaultButtonStyling extends Styling {
|
|
@@ -33,17 +33,17 @@ export class DefaultButtonStyling extends Styling {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
__decorate([
|
|
36
|
-
|
|
36
|
+
cache,
|
|
37
37
|
__metadata("design:type", String),
|
|
38
38
|
__metadata("design:paramtypes", [])
|
|
39
39
|
], DefaultButtonStyling.prototype, "main", null);
|
|
40
40
|
__decorate([
|
|
41
|
-
|
|
41
|
+
cache,
|
|
42
42
|
__metadata("design:type", String),
|
|
43
43
|
__metadata("design:paramtypes", [])
|
|
44
44
|
], DefaultButtonStyling.prototype, "icon", null);
|
|
45
45
|
__decorate([
|
|
46
|
-
|
|
46
|
+
cache,
|
|
47
47
|
__metadata("design:type", String),
|
|
48
48
|
__metadata("design:paramtypes", [])
|
|
49
49
|
], DefaultButtonStyling.prototype, "label", null);
|
|
@@ -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 {
|
|
10
|
+
import { cache } from "reactronic";
|
|
11
11
|
import { css } from "@emotion/css";
|
|
12
12
|
import { Styling } from "./Styling.js";
|
|
13
13
|
export class DefaultFieldStyling extends Styling {
|
|
@@ -47,22 +47,22 @@ export class DefaultFieldStyling extends Styling {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
__decorate([
|
|
50
|
-
|
|
50
|
+
cache,
|
|
51
51
|
__metadata("design:type", String),
|
|
52
52
|
__metadata("design:paramtypes", [])
|
|
53
53
|
], DefaultFieldStyling.prototype, "main", null);
|
|
54
54
|
__decorate([
|
|
55
|
-
|
|
55
|
+
cache,
|
|
56
56
|
__metadata("design:type", String),
|
|
57
57
|
__metadata("design:paramtypes", [])
|
|
58
58
|
], DefaultFieldStyling.prototype, "icon", null);
|
|
59
59
|
__decorate([
|
|
60
|
-
|
|
60
|
+
cache,
|
|
61
61
|
__metadata("design:type", String),
|
|
62
62
|
__metadata("design:paramtypes", [])
|
|
63
63
|
], DefaultFieldStyling.prototype, "input", null);
|
|
64
64
|
__decorate([
|
|
65
|
-
|
|
65
|
+
cache,
|
|
66
66
|
__metadata("design:type", String),
|
|
67
67
|
__metadata("design:paramtypes", [])
|
|
68
68
|
], DefaultFieldStyling.prototype, "popup", null);
|
|
@@ -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 {
|
|
10
|
+
import { cache } from "reactronic";
|
|
11
11
|
import { css } from "@emotion/css";
|
|
12
12
|
import { Styling } from "./Styling.js";
|
|
13
13
|
export class DefaultIconStyling extends Styling {
|
|
@@ -20,7 +20,7 @@ export class DefaultIconStyling extends Styling {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
__decorate([
|
|
23
|
-
|
|
23
|
+
cache,
|
|
24
24
|
__metadata("design:type", String),
|
|
25
25
|
__metadata("design:paramtypes", [])
|
|
26
26
|
], DefaultIconStyling.prototype, "main", null);
|
|
@@ -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 { ObservableObject,
|
|
10
|
+
import { ObservableObject, unobservable } from "reactronic";
|
|
11
11
|
export class Styling extends ObservableObject {
|
|
12
12
|
constructor($) {
|
|
13
13
|
super();
|
|
@@ -15,6 +15,6 @@ export class Styling extends ObservableObject {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
__decorate([
|
|
18
|
-
|
|
18
|
+
unobservable,
|
|
19
19
|
__metadata("design:type", Object)
|
|
20
20
|
], Styling.prototype, "$", void 0);
|
|
@@ -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 {
|
|
10
|
+
import { cache } from "reactronic";
|
|
11
11
|
import { css } from "@emotion/css";
|
|
12
12
|
import { Styling } from "./Styling.js";
|
|
13
13
|
export class DefaultToggleStyling extends Styling {
|
|
@@ -32,17 +32,17 @@ export class DefaultToggleStyling extends Styling {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
__decorate([
|
|
35
|
-
|
|
35
|
+
cache,
|
|
36
36
|
__metadata("design:type", String),
|
|
37
37
|
__metadata("design:paramtypes", [])
|
|
38
38
|
], DefaultToggleStyling.prototype, "main", null);
|
|
39
39
|
__decorate([
|
|
40
|
-
|
|
40
|
+
cache,
|
|
41
41
|
__metadata("design:type", String),
|
|
42
42
|
__metadata("design:paramtypes", [])
|
|
43
43
|
], DefaultToggleStyling.prototype, "icon", null);
|
|
44
44
|
__decorate([
|
|
45
|
-
|
|
45
|
+
cache,
|
|
46
46
|
__metadata("design:type", String),
|
|
47
47
|
__metadata("design:paramtypes", [])
|
|
48
48
|
], DefaultToggleStyling.prototype, "label", null);
|
|
@@ -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,
|
|
10
|
+
import { options, Reentrance, apply, Transaction, LoggingLevel } from "reactronic";
|
|
11
11
|
import { extractPointerButton, isPointerButtonDown, PointerButton, BasePointerSensor } from "./BasePointerSensor.js";
|
|
12
12
|
import { findTargetElementData, SymDataForSensor } from "./DataForSensor.js";
|
|
13
13
|
import { extractModifierKeys, KeyboardModifiers } from "./KeyboardSensor.js";
|
|
@@ -164,42 +164,42 @@ export class ButtonSensor extends BasePointerSensor {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
__decorate([
|
|
167
|
-
|
|
167
|
+
apply,
|
|
168
168
|
options({ logging: LoggingLevel.Off }),
|
|
169
169
|
__metadata("design:type", Function),
|
|
170
170
|
__metadata("design:paramtypes", [PointerEvent]),
|
|
171
171
|
__metadata("design:returntype", void 0)
|
|
172
172
|
], ButtonSensor.prototype, "press", null);
|
|
173
173
|
__decorate([
|
|
174
|
-
|
|
174
|
+
apply,
|
|
175
175
|
options({ reentrance: Reentrance.cancelPrevious, logging: LoggingLevel.Off }),
|
|
176
176
|
__metadata("design:type", Function),
|
|
177
177
|
__metadata("design:paramtypes", [PointerEvent]),
|
|
178
178
|
__metadata("design:returntype", void 0)
|
|
179
179
|
], ButtonSensor.prototype, "selecting", null);
|
|
180
180
|
__decorate([
|
|
181
|
-
|
|
181
|
+
apply,
|
|
182
182
|
options({ logging: LoggingLevel.Off }),
|
|
183
183
|
__metadata("design:type", Function),
|
|
184
184
|
__metadata("design:paramtypes", [PointerEvent]),
|
|
185
185
|
__metadata("design:returntype", void 0)
|
|
186
186
|
], ButtonSensor.prototype, "select", null);
|
|
187
187
|
__decorate([
|
|
188
|
-
|
|
188
|
+
apply,
|
|
189
189
|
options({ logging: LoggingLevel.Off }),
|
|
190
190
|
__metadata("design:type", Function),
|
|
191
191
|
__metadata("design:paramtypes", []),
|
|
192
192
|
__metadata("design:returntype", void 0)
|
|
193
193
|
], ButtonSensor.prototype, "release", null);
|
|
194
194
|
__decorate([
|
|
195
|
-
|
|
195
|
+
apply,
|
|
196
196
|
options({ logging: LoggingLevel.Off }),
|
|
197
197
|
__metadata("design:type", Function),
|
|
198
198
|
__metadata("design:paramtypes", []),
|
|
199
199
|
__metadata("design:returntype", void 0)
|
|
200
200
|
], ButtonSensor.prototype, "cancel", null);
|
|
201
201
|
__decorate([
|
|
202
|
-
|
|
202
|
+
apply,
|
|
203
203
|
options({ logging: LoggingLevel.Off }),
|
|
204
204
|
__metadata("design:type", Function),
|
|
205
205
|
__metadata("design:paramtypes", []),
|
|
@@ -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,
|
|
10
|
+
import { options, apply, LoggingLevel, Transaction } from "reactronic";
|
|
11
11
|
import { objectHasMember } from "../core/ElUtils.js";
|
|
12
12
|
import { grabElementDataList, SymDataForSensor } from "./DataForSensor.js";
|
|
13
13
|
import { HtmlElementSensor } from "./HtmlElementSensor.js";
|
|
@@ -132,32 +132,32 @@ export class FocusSensor extends HtmlElementSensor {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
__decorate([
|
|
135
|
-
|
|
135
|
+
apply,
|
|
136
136
|
__metadata("design:type", Function),
|
|
137
137
|
__metadata("design:paramtypes", [Object, String]),
|
|
138
138
|
__metadata("design:returntype", void 0)
|
|
139
139
|
], FocusSensor.prototype, "setActiveData", null);
|
|
140
140
|
__decorate([
|
|
141
|
-
|
|
141
|
+
apply,
|
|
142
142
|
__metadata("design:type", Function),
|
|
143
143
|
__metadata("design:paramtypes", [Boolean]),
|
|
144
144
|
__metadata("design:returntype", void 0)
|
|
145
145
|
], FocusSensor.prototype, "listen", null);
|
|
146
146
|
__decorate([
|
|
147
|
-
|
|
147
|
+
apply,
|
|
148
148
|
options({ logging: LoggingLevel.Off }),
|
|
149
149
|
__metadata("design:type", Function),
|
|
150
150
|
__metadata("design:paramtypes", [FocusEvent]),
|
|
151
151
|
__metadata("design:returntype", void 0)
|
|
152
152
|
], FocusSensor.prototype, "doFocusIn", null);
|
|
153
153
|
__decorate([
|
|
154
|
-
|
|
154
|
+
apply,
|
|
155
155
|
__metadata("design:type", Function),
|
|
156
156
|
__metadata("design:paramtypes", [FocusEvent]),
|
|
157
157
|
__metadata("design:returntype", void 0)
|
|
158
158
|
], FocusSensor.prototype, "doFocusOut", null);
|
|
159
159
|
__decorate([
|
|
160
|
-
|
|
160
|
+
apply,
|
|
161
161
|
options({ logging: LoggingLevel.Off }),
|
|
162
162
|
__metadata("design:type", Function),
|
|
163
163
|
__metadata("design:paramtypes", [MouseEvent]),
|
|
@@ -2,7 +2,7 @@ import { ToggleRef } from "reactronic";
|
|
|
2
2
|
import { FocusModel } from "./FocusSensor.js";
|
|
3
3
|
import { ResizedElement } from "./ResizeSensor.js";
|
|
4
4
|
import { PointerSensor } from "./PointerSensor.js";
|
|
5
|
-
export declare function OnClick(target:
|
|
5
|
+
export declare function OnClick(target: Element, action: ((pointer: PointerSensor) => void) | ToggleRef | undefined, key?: string): void;
|
|
6
6
|
export declare function OnClickAsync(target: HTMLElement, action: ((pointer: PointerSensor) => Promise<void>) | ToggleRef | undefined, key?: string): void;
|
|
7
7
|
export declare function OnResize(target: HTMLElement, action: ((element: ResizedElement) => void) | undefined, key?: string): void;
|
|
8
8
|
export declare function OnFocus(target: HTMLElement, model: FocusModel, switchEditMode?: ((model: FocusModel) => void) | undefined, key?: string): void;
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Mode, ToggleRef,
|
|
10
|
+
import { Mode, ToggleRef, nonreactive } from "reactronic";
|
|
11
11
|
import { SyntheticElement } from "../core/Elements.js";
|
|
12
12
|
export function OnClick(target, action, key) {
|
|
13
13
|
if (action !== undefined) {
|
|
@@ -19,10 +19,10 @@ export function OnClick(target, action, key) {
|
|
|
19
19
|
const pointer = target.sensors.pointer;
|
|
20
20
|
if (target.dataForSensor.click !== undefined && pointer.clicked === target.dataForSensor.click || target.dataForSensor.click === undefined && pointer.clicked) {
|
|
21
21
|
if (action instanceof Function) {
|
|
22
|
-
|
|
22
|
+
nonreactive(() => action(pointer));
|
|
23
23
|
}
|
|
24
24
|
else if (action instanceof ToggleRef) {
|
|
25
|
-
|
|
25
|
+
nonreactive(() => action.toggle());
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -39,10 +39,10 @@ export function OnClickAsync(target, action, key) {
|
|
|
39
39
|
const pointer = target.sensors.pointer;
|
|
40
40
|
if (target.dataForSensor.click !== undefined && pointer.clicked === target.dataForSensor.click || target.dataForSensor.click === undefined && pointer.clicked) {
|
|
41
41
|
if (action instanceof Function) {
|
|
42
|
-
yield
|
|
42
|
+
yield nonreactive(() => action(pointer));
|
|
43
43
|
}
|
|
44
44
|
else if (action instanceof ToggleRef) {
|
|
45
|
-
|
|
45
|
+
nonreactive(() => action.toggle());
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}),
|
|
@@ -94,8 +94,8 @@ export function prepareResizeHandler(action) {
|
|
|
94
94
|
return (element) => {
|
|
95
95
|
const size = element.borderBoxSize[0];
|
|
96
96
|
if (action instanceof Function)
|
|
97
|
-
|
|
97
|
+
nonreactive(() => action(size.inlineSize, size.blockSize));
|
|
98
98
|
else if (action instanceof ResizeData && action.handler !== undefined)
|
|
99
|
-
|
|
99
|
+
nonreactive(() => action.handler(size.inlineSize, size.blockSize));
|
|
100
100
|
};
|
|
101
101
|
}
|
|
@@ -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,
|
|
10
|
+
import { options, apply, 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";
|
|
@@ -90,35 +90,35 @@ export class HoverSensor extends BasePointerSensor {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
__decorate([
|
|
93
|
-
|
|
93
|
+
apply,
|
|
94
94
|
options({ logging: LoggingLevel.Off }),
|
|
95
95
|
__metadata("design:type", Function),
|
|
96
96
|
__metadata("design:paramtypes", [PointerEvent]),
|
|
97
97
|
__metadata("design:returntype", void 0)
|
|
98
98
|
], HoverSensor.prototype, "doPointerEnter", null);
|
|
99
99
|
__decorate([
|
|
100
|
-
|
|
100
|
+
apply,
|
|
101
101
|
options({ logging: LoggingLevel.Off }),
|
|
102
102
|
__metadata("design:type", Function),
|
|
103
103
|
__metadata("design:paramtypes", [PointerEvent]),
|
|
104
104
|
__metadata("design:returntype", void 0)
|
|
105
105
|
], HoverSensor.prototype, "doPointerOver", null);
|
|
106
106
|
__decorate([
|
|
107
|
-
|
|
107
|
+
apply,
|
|
108
108
|
options({ logging: LoggingLevel.Off }),
|
|
109
109
|
__metadata("design:type", Function),
|
|
110
110
|
__metadata("design:paramtypes", [PointerEvent]),
|
|
111
111
|
__metadata("design:returntype", void 0)
|
|
112
112
|
], HoverSensor.prototype, "doPointerMove", null);
|
|
113
113
|
__decorate([
|
|
114
|
-
|
|
114
|
+
apply,
|
|
115
115
|
options({ logging: LoggingLevel.Off }),
|
|
116
116
|
__metadata("design:type", Function),
|
|
117
117
|
__metadata("design:paramtypes", [PointerEvent]),
|
|
118
118
|
__metadata("design:returntype", void 0)
|
|
119
119
|
], HoverSensor.prototype, "doPointerLeave", null);
|
|
120
120
|
__decorate([
|
|
121
|
-
|
|
121
|
+
apply,
|
|
122
122
|
options({ logging: LoggingLevel.Off }),
|
|
123
123
|
__metadata("design:type", Function),
|
|
124
124
|
__metadata("design:paramtypes", []),
|
|
@@ -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,
|
|
10
|
+
import { options, reaction, apply, unobservable, Transaction, LoggingLevel } from "reactronic";
|
|
11
11
|
import { findTargetElementData, SymDataForSensor } from "./DataForSensor.js";
|
|
12
12
|
import { HtmlElementSensor } from "./HtmlElementSensor.js";
|
|
13
13
|
import { extractModifierKeys, KeyboardModifiers } from "./KeyboardSensor.js";
|
|
@@ -262,109 +262,109 @@ export class HtmlDragSensor extends HtmlElementSensor {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
__decorate([
|
|
265
|
-
|
|
265
|
+
unobservable,
|
|
266
266
|
__metadata("design:type", Map)
|
|
267
267
|
], HtmlDragSensor.prototype, "dataByFormat", void 0);
|
|
268
268
|
__decorate([
|
|
269
|
-
|
|
269
|
+
unobservable,
|
|
270
270
|
__metadata("design:type", Object)
|
|
271
271
|
], HtmlDragSensor.prototype, "draggingImage", void 0);
|
|
272
272
|
__decorate([
|
|
273
|
-
|
|
273
|
+
unobservable,
|
|
274
274
|
__metadata("design:type", Number)
|
|
275
275
|
], HtmlDragSensor.prototype, "draggingImageX", void 0);
|
|
276
276
|
__decorate([
|
|
277
|
-
|
|
277
|
+
unobservable,
|
|
278
278
|
__metadata("design:type", Number)
|
|
279
279
|
], HtmlDragSensor.prototype, "draggingImageY", void 0);
|
|
280
280
|
__decorate([
|
|
281
|
-
|
|
281
|
+
unobservable,
|
|
282
282
|
__metadata("design:type", String)
|
|
283
283
|
], HtmlDragSensor.prototype, "dropEffect", void 0);
|
|
284
284
|
__decorate([
|
|
285
|
-
|
|
285
|
+
unobservable,
|
|
286
286
|
__metadata("design:type", Array)
|
|
287
287
|
], HtmlDragSensor.prototype, "dataTypesAllowed", void 0);
|
|
288
288
|
__decorate([
|
|
289
|
-
|
|
289
|
+
unobservable,
|
|
290
290
|
__metadata("design:type", String)
|
|
291
291
|
], HtmlDragSensor.prototype, "effectAllowed", void 0);
|
|
292
292
|
__decorate([
|
|
293
|
-
|
|
293
|
+
unobservable,
|
|
294
294
|
__metadata("design:type", Boolean)
|
|
295
295
|
], HtmlDragSensor.prototype, "dropAllowed", void 0);
|
|
296
296
|
__decorate([
|
|
297
|
-
|
|
297
|
+
apply,
|
|
298
298
|
options({ logging: LoggingLevel.Off }),
|
|
299
299
|
__metadata("design:type", Function),
|
|
300
300
|
__metadata("design:paramtypes", [DragEvent]),
|
|
301
301
|
__metadata("design:returntype", void 0)
|
|
302
302
|
], HtmlDragSensor.prototype, "startDragging", null);
|
|
303
303
|
__decorate([
|
|
304
|
-
|
|
304
|
+
apply,
|
|
305
305
|
options({ logging: LoggingLevel.Off }),
|
|
306
306
|
__metadata("design:type", Function),
|
|
307
307
|
__metadata("design:paramtypes", [DragEvent]),
|
|
308
308
|
__metadata("design:returntype", void 0)
|
|
309
309
|
], HtmlDragSensor.prototype, "dragging", null);
|
|
310
310
|
__decorate([
|
|
311
|
-
|
|
311
|
+
apply,
|
|
312
312
|
options({ logging: LoggingLevel.Off }),
|
|
313
313
|
__metadata("design:type", Function),
|
|
314
314
|
__metadata("design:paramtypes", [DragEvent]),
|
|
315
315
|
__metadata("design:returntype", void 0)
|
|
316
316
|
], HtmlDragSensor.prototype, "finishDragging", null);
|
|
317
317
|
__decorate([
|
|
318
|
-
|
|
318
|
+
apply,
|
|
319
319
|
options({ logging: LoggingLevel.Off }),
|
|
320
320
|
__metadata("design:type", Function),
|
|
321
321
|
__metadata("design:paramtypes", [DragEvent]),
|
|
322
322
|
__metadata("design:returntype", void 0)
|
|
323
323
|
], HtmlDragSensor.prototype, "enterTarget", null);
|
|
324
324
|
__decorate([
|
|
325
|
-
|
|
325
|
+
apply,
|
|
326
326
|
options({ logging: LoggingLevel.Off }),
|
|
327
327
|
__metadata("design:type", Function),
|
|
328
328
|
__metadata("design:paramtypes", [DragEvent]),
|
|
329
329
|
__metadata("design:returntype", void 0)
|
|
330
330
|
], HtmlDragSensor.prototype, "leaveTarget", null);
|
|
331
331
|
__decorate([
|
|
332
|
-
|
|
332
|
+
apply,
|
|
333
333
|
options({ logging: LoggingLevel.Off }),
|
|
334
334
|
__metadata("design:type", Function),
|
|
335
335
|
__metadata("design:paramtypes", [DragEvent]),
|
|
336
336
|
__metadata("design:returntype", void 0)
|
|
337
337
|
], HtmlDragSensor.prototype, "dragOver", null);
|
|
338
338
|
__decorate([
|
|
339
|
-
|
|
339
|
+
apply,
|
|
340
340
|
options({ logging: LoggingLevel.Off }),
|
|
341
341
|
__metadata("design:type", Function),
|
|
342
342
|
__metadata("design:paramtypes", [DragEvent]),
|
|
343
343
|
__metadata("design:returntype", void 0)
|
|
344
344
|
], HtmlDragSensor.prototype, "drop", null);
|
|
345
345
|
__decorate([
|
|
346
|
-
|
|
346
|
+
apply,
|
|
347
347
|
options({ logging: LoggingLevel.Off }),
|
|
348
348
|
__metadata("design:type", Function),
|
|
349
349
|
__metadata("design:paramtypes", [DragEvent]),
|
|
350
350
|
__metadata("design:returntype", void 0)
|
|
351
351
|
], HtmlDragSensor.prototype, "updateEventOnDragStart", null);
|
|
352
352
|
__decorate([
|
|
353
|
-
|
|
353
|
+
apply,
|
|
354
354
|
options({ logging: LoggingLevel.Off }),
|
|
355
355
|
__metadata("design:type", Function),
|
|
356
356
|
__metadata("design:paramtypes", [DragEvent]),
|
|
357
357
|
__metadata("design:returntype", void 0)
|
|
358
358
|
], HtmlDragSensor.prototype, "updateEventOnDropAllowed", null);
|
|
359
359
|
__decorate([
|
|
360
|
-
|
|
360
|
+
apply,
|
|
361
361
|
options({ logging: LoggingLevel.Off }),
|
|
362
362
|
__metadata("design:type", Function),
|
|
363
363
|
__metadata("design:paramtypes", []),
|
|
364
364
|
__metadata("design:returntype", void 0)
|
|
365
365
|
], HtmlDragSensor.prototype, "reset", null);
|
|
366
366
|
__decorate([
|
|
367
|
-
|
|
367
|
+
reaction,
|
|
368
368
|
options({ throttling: 0 }),
|
|
369
369
|
__metadata("design:type", Function),
|
|
370
370
|
__metadata("design:paramtypes", []),
|