verstak 0.94.25032 → 0.95.25044
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/README.md +1 -1
- package/build/dist/source/components/Button.v.js +5 -5
- package/build/dist/source/components/Icon.v.d.ts +2 -2
- package/build/dist/source/components/Icon.v.js +3 -3
- package/build/dist/source/components/Image.v.d.ts +2 -2
- package/build/dist/source/components/Image.v.js +5 -5
- package/build/dist/source/components/Input.v.d.ts +2 -2
- package/build/dist/source/components/Input.v.js +6 -6
- package/build/dist/source/components/RealTimeClock.d.ts +2 -2
- package/build/dist/source/components/RealTimeClock.js +5 -5
- package/build/dist/source/components/Spinner.v.d.ts +2 -2
- package/build/dist/source/components/Spinner.v.js +5 -5
- package/build/dist/source/components/Theme.js +2 -2
- package/build/dist/source/components/Toggle.v.js +5 -5
- package/build/dist/source/components/api.d.ts +1 -1
- package/build/dist/source/components/api.js +1 -1
- package/build/dist/source/components/common/Utils.d.ts +1 -1
- package/build/dist/source/components/common/Utils.js +4 -4
- package/build/dist/source/components/theme/Button.s.js +4 -4
- package/build/dist/source/components/theme/Icon.s.js +2 -2
- package/build/dist/source/components/theme/Input.s.js +5 -5
- package/build/dist/source/components/theme/Styling.d.ts +2 -2
- package/build/dist/source/components/theme/Styling.js +3 -3
- package/build/dist/source/components/theme/Toggle.s.js +4 -4
- package/build/dist/source/core/El.d.ts +1 -1
- package/build/dist/source/core/El.js +1 -1
- package/build/dist/source/core/ElDriver.d.ts +1 -1
- package/build/dist/source/core/ElDriver.js +10 -10
- package/build/dist/source/core/Elements.d.ts +6 -6
- package/build/dist/source/core/Elements.js +21 -21
- package/build/dist/source/core/Restyler.d.ts +2 -2
- package/build/dist/source/core/Restyler.js +5 -5
- package/build/dist/source/core/SplitViewMath.d.ts +3 -3
- package/build/dist/source/core/SplitViewMath.js +1 -1
- package/build/dist/source/core/WebDriver.d.ts +6 -4
- package/build/dist/source/core/WebDriver.js +41 -28
- package/build/dist/source/core/sensors/ButtonSensor.js +7 -7
- package/build/dist/source/core/sensors/FocusSensor.js +6 -6
- package/build/dist/source/core/sensors/Handlers.js +7 -7
- package/build/dist/source/core/sensors/HoverSensor.js +6 -6
- package/build/dist/source/core/sensors/HtmlDragSensor.js +20 -20
- package/build/dist/source/core/sensors/HtmlElementSensor.js +5 -5
- package/build/dist/source/core/sensors/KeyboardSensor.js +6 -6
- package/build/dist/source/core/sensors/PointerSensor.js +17 -17
- package/build/dist/source/core/sensors/ResizeSensor.js +3 -3
- package/build/dist/source/core/sensors/ScrollSensor.js +3 -3
- package/build/dist/source/core/sensors/Sensor.d.ts +2 -2
- package/build/dist/source/core/sensors/Sensor.js +2 -2
- package/build/dist/source/core/sensors/WheelSensor.js +3 -3
- package/build/dist/source/core/sensors/WindowSensor.js +2 -2
- package/build/dist/source/html/DraggableArea.view.js +2 -2
- package/build/dist/source/html/HtmlElements.js +115 -115
- package/build/dist/source/svg/SvgElements.js +60 -60
- package/package.json +10 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactiveTreeNode, Mode,
|
|
1
|
+
import { ReactiveTreeNode, Mode, declare, derivative, launch, runNonReactive } 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";
|
|
@@ -6,24 +6,24 @@ import { getPrioritiesForEmptySpaceDistribution, getPrioritiesForSizeChanging, r
|
|
|
6
6
|
import { Axis, BodyFontSize, Dimension, toPx } from "./Sizes.js";
|
|
7
7
|
import { HtmlDriver, StaticDriver } from "./WebDriver.js";
|
|
8
8
|
export function Window(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
9
|
-
const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.
|
|
10
|
-
return
|
|
9
|
+
const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.block);
|
|
10
|
+
return declare(driver, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
11
11
|
}
|
|
12
|
-
export function
|
|
13
|
-
return
|
|
12
|
+
export function Block(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
13
|
+
return declare(Drivers.block, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
14
14
|
}
|
|
15
15
|
export function Table(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
16
|
-
return
|
|
16
|
+
return declare(Drivers.table, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
17
17
|
}
|
|
18
18
|
export function row(builder, shiftCursorDown) {
|
|
19
19
|
rowBreak(shiftCursorDown);
|
|
20
20
|
builder === null || builder === void 0 ? void 0 : builder();
|
|
21
21
|
}
|
|
22
22
|
export function Splitter(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
23
|
-
return
|
|
23
|
+
return declare(Drivers.splitter, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
24
24
|
}
|
|
25
25
|
export function rowBreak(shiftCursorDown) {
|
|
26
|
-
|
|
26
|
+
declare(Drivers.partition);
|
|
27
27
|
}
|
|
28
28
|
export function declareSplitter(index, splitViewNode) {
|
|
29
29
|
const key = `splitter-${index}`;
|
|
@@ -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
|
+
runNonReactive(() => 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
|
}
|
|
@@ -79,14 +79,14 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
79
79
|
}));
|
|
80
80
|
}
|
|
81
81
|
export function cursor(place) {
|
|
82
|
-
|
|
82
|
+
declare(Drivers.cursor, {
|
|
83
83
|
script: el => {
|
|
84
84
|
el.place = place;
|
|
85
85
|
},
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
export function JustText(content, formatted, declaration) {
|
|
89
|
-
return
|
|
89
|
+
return declare(Drivers.text, derivative(declaration, {
|
|
90
90
|
script: el => {
|
|
91
91
|
if (formatted)
|
|
92
92
|
el.native.innerHTML = content;
|
|
@@ -96,15 +96,15 @@ export function JustText(content, formatted, declaration) {
|
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
98
|
export function Group(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
99
|
-
return
|
|
99
|
+
return declare(Drivers.group, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
100
100
|
}
|
|
101
101
|
export function Fragment(script) {
|
|
102
102
|
return PseudoElement({ mode: Mode.autonomous, script });
|
|
103
103
|
}
|
|
104
104
|
export function PseudoElement(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
105
|
-
return
|
|
105
|
+
return declare(Drivers.pseudo, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
106
106
|
}
|
|
107
|
-
export class
|
|
107
|
+
export class BlockDriver extends HtmlDriver {
|
|
108
108
|
runScript(node) {
|
|
109
109
|
rowBreak();
|
|
110
110
|
const el = node.element;
|
|
@@ -168,13 +168,13 @@ export class DivisionDriver extends HtmlDriver {
|
|
|
168
168
|
const priorities = preferred.length > 0
|
|
169
169
|
? getPrioritiesForSizeChanging(isHorizontal, node.children, preferred)
|
|
170
170
|
: getPrioritiesForEmptySpaceDistribution(isHorizontal, node.children);
|
|
171
|
-
|
|
171
|
+
runNonReactive(() => relayout(node, priorities.resizable, priorities.manuallyResizable, sizesPx));
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
});
|
|
175
|
-
ReactiveTreeNode.
|
|
175
|
+
ReactiveTreeNode.launchNestedNodesThenDo(() => {
|
|
176
176
|
layoutInfo.isUpdateFinished = true;
|
|
177
|
-
|
|
177
|
+
launch(relayoutEl, { stamp: node.stamp });
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
return result;
|
|
@@ -208,7 +208,7 @@ export class DivisionDriver extends HtmlDriver {
|
|
|
208
208
|
}
|
|
209
209
|
else {
|
|
210
210
|
if (childDriver.isPartition) {
|
|
211
|
-
const last = ownerNode.children.
|
|
211
|
+
const last = ownerNode.children.lastItem();
|
|
212
212
|
if (((_a = last === null || last === void 0 ? void 0 : last.instance) === null || _a === void 0 ? void 0 : _a.driver) === childDriver)
|
|
213
213
|
result = last;
|
|
214
214
|
}
|
|
@@ -231,7 +231,7 @@ export class PartitionDriver extends HtmlDriver {
|
|
|
231
231
|
const ownerEl = node.owner.element;
|
|
232
232
|
if (ownerEl.sealed !== undefined) {
|
|
233
233
|
node.element.style.flexGrow = "1";
|
|
234
|
-
|
|
234
|
+
declare(Drivers.wrapper, {
|
|
235
235
|
script: el => {
|
|
236
236
|
const ownerEl = el.node.owner.owner.element;
|
|
237
237
|
if (ownerEl.splitView !== undefined) {
|
|
@@ -261,14 +261,14 @@ export class PartitionDriver extends HtmlDriver {
|
|
|
261
261
|
let host;
|
|
262
262
|
const ownerEl = node.owner.element;
|
|
263
263
|
if (ownerEl.sealed !== undefined)
|
|
264
|
-
host = node.children.
|
|
264
|
+
host = node.children.firstItem().instance;
|
|
265
265
|
else
|
|
266
266
|
host = node;
|
|
267
267
|
return host;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
export const Drivers = {
|
|
271
|
-
|
|
271
|
+
block: new BlockDriver(Constants.element, false, el => el.kind = ElKind.block),
|
|
272
272
|
table: new HtmlDriver(Constants.element, false, el => el.kind = ElKind.table),
|
|
273
273
|
text: new HtmlDriver(Constants.element, false, el => el.kind = ElKind.text),
|
|
274
274
|
group: new HtmlDriver(Constants.group, false, el => el.kind = ElKind.group),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function restyler<T>(restyle: () => T):
|
|
2
|
-
export declare class
|
|
1
|
+
export declare function restyler<T>(restyle: () => T): ObservableStyles<T>;
|
|
2
|
+
export declare class ObservableStyles<T> {
|
|
3
3
|
private readonly restyle;
|
|
4
4
|
constructor(restyle: () => T);
|
|
5
5
|
protected cache(): T;
|
|
@@ -7,11 +7,11 @@ 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, runTransactional } from "reactronic";
|
|
11
11
|
export function restyler(restyle) {
|
|
12
|
-
return
|
|
12
|
+
return runTransactional(() => new ObservableStyles(restyle));
|
|
13
13
|
}
|
|
14
|
-
export class
|
|
14
|
+
export class ObservableStyles {
|
|
15
15
|
constructor(restyle) {
|
|
16
16
|
this.restyle = restyle;
|
|
17
17
|
}
|
|
@@ -23,8 +23,8 @@ export class TriggeringStyles {
|
|
|
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)
|
|
30
|
-
],
|
|
30
|
+
], ObservableStyles.prototype, "cache", null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactiveTreeNode,
|
|
1
|
+
import { ReactiveTreeNode, ReconciliationList } from "reactronic";
|
|
2
2
|
import { ElImpl } from "./ElDriver.js";
|
|
3
3
|
export declare function equal(a: number, b: number): boolean;
|
|
4
4
|
export declare function less(a: number, b: number): boolean;
|
|
@@ -17,11 +17,11 @@ export declare function resizeUsingDelta(splitViewNode: ReactiveTreeNode<ElImpl>
|
|
|
17
17
|
}>, force?: boolean): number;
|
|
18
18
|
export declare function layout(splitViewNode: ReactiveTreeNode<ElImpl>): void;
|
|
19
19
|
export declare function getPrioritiesForSplitter(index: number, size: number): ReadonlyArray<number>;
|
|
20
|
-
export declare function getPrioritiesForSizeChanging(isHorizontal: boolean, children:
|
|
20
|
+
export declare function getPrioritiesForSizeChanging(isHorizontal: boolean, children: ReconciliationList<ReactiveTreeNode>, indexes: Array<number>): {
|
|
21
21
|
resizable: ReadonlyArray<number>;
|
|
22
22
|
manuallyResizable: ReadonlyArray<number>;
|
|
23
23
|
};
|
|
24
|
-
export declare function getPrioritiesForEmptySpaceDistribution(isHorizontal: boolean, children:
|
|
24
|
+
export declare function getPrioritiesForEmptySpaceDistribution(isHorizontal: boolean, children: ReconciliationList<ReactiveTreeNode>): {
|
|
25
25
|
resizable: ReadonlyArray<number>;
|
|
26
26
|
manuallyResizable: ReadonlyArray<number>;
|
|
27
27
|
};
|
|
@@ -148,7 +148,7 @@ export function layout(splitViewNode) {
|
|
|
148
148
|
}
|
|
149
149
|
const containerSizePx = (_e = (isHorizontal ? layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.contentSizeXpx : layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.contentSizeYpx)) !== null && _e !== void 0 ? _e : 0;
|
|
150
150
|
const isOverflowing = greater(posPx, containerSizePx);
|
|
151
|
-
const wrapper = (_g = (_f = splitViewNode.children.
|
|
151
|
+
const wrapper = (_g = (_f = splitViewNode.children.firstItem()) === null || _f === void 0 ? void 0 : _f.instance.children.firstItem()) === null || _g === void 0 ? void 0 : _g.instance;
|
|
152
152
|
if (wrapper !== undefined) {
|
|
153
153
|
if (isHorizontal)
|
|
154
154
|
wrapper.element.style.gridTemplateColumns = sizesPx.map(x => `${x}px`).join(" ");
|
|
@@ -2,11 +2,13 @@ import { ReactiveTreeNode, Handler } from "reactronic";
|
|
|
2
2
|
import { El } from "./El.js";
|
|
3
3
|
import { ElDriver } from "./ElDriver.js";
|
|
4
4
|
export declare class WebDriver<T extends Element, M = unknown> extends ElDriver<T, M> {
|
|
5
|
-
|
|
5
|
+
assignNativeElement(node: ReactiveTreeNode<El<T, M>>): void;
|
|
6
6
|
runPreparation(node: ReactiveTreeNode<El<T, M>>): void | Promise<void>;
|
|
7
7
|
runFinalization(node: ReactiveTreeNode<El<T, M>>, isLeader: boolean): boolean;
|
|
8
8
|
runMount(node: ReactiveTreeNode<El<T, M>>): void;
|
|
9
9
|
runScript(node: ReactiveTreeNode<El<T, M>>): void | Promise<void>;
|
|
10
|
+
private assignExtraAttributesAndProperties;
|
|
11
|
+
private clearExtraAttributesAndProperties;
|
|
10
12
|
static getOwnNodeOfNativeElement<T extends Element>(element: T): ReactiveTreeNode<El<T>> | undefined;
|
|
11
13
|
static findBrotherlyHost<T extends Element, R extends Element>(node: ReactiveTreeNode<El<T>>): ReactiveTreeNode<El<R>> | undefined;
|
|
12
14
|
static findBrotherlyPrevSibling<T extends Element, R extends Element>(node: ReactiveTreeNode<El<T>>): ReactiveTreeNode<El<R>> | undefined;
|
|
@@ -16,11 +18,11 @@ export declare class WebDriver<T extends Element, M = unknown> extends ElDriver<
|
|
|
16
18
|
export declare class StaticDriver<T extends HTMLElement> extends WebDriver<T> {
|
|
17
19
|
readonly native: T;
|
|
18
20
|
constructor(native: T, name: string, isRow: boolean, initialize?: Handler<El<T>>);
|
|
19
|
-
|
|
21
|
+
assignNativeElement(node: ReactiveTreeNode<El<T>>): void;
|
|
20
22
|
}
|
|
21
23
|
export declare class HtmlDriver<T extends HTMLElement, M = any> extends WebDriver<T, M> {
|
|
22
|
-
|
|
24
|
+
assignNativeElement(node: ReactiveTreeNode<El<T, M>>): void;
|
|
23
25
|
}
|
|
24
26
|
export declare class SvgDriver<T extends SVGElement, M = any> extends WebDriver<T, M> {
|
|
25
|
-
|
|
27
|
+
assignNativeElement(node: ReactiveTreeNode<El<T, M>>): void;
|
|
26
28
|
}
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
import { ReactiveTreeNode, ReactiveSystem, proceedSyncOrAsync } from "reactronic";
|
|
2
2
|
import { Constants, ElDriver, ElImpl } from "./ElDriver.js";
|
|
3
3
|
export class WebDriver extends ElDriver {
|
|
4
|
-
|
|
4
|
+
assignNativeElement(node) {
|
|
5
5
|
}
|
|
6
6
|
runPreparation(node) {
|
|
7
|
-
this.
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
this.assignNativeElement(node);
|
|
8
|
+
const native = node.element.native;
|
|
9
|
+
const isPartition = node.driver.isPartition;
|
|
10
|
+
if (native !== undefined && !isPartition)
|
|
11
|
+
this.assignExtraAttributesAndProperties(node);
|
|
11
12
|
const result = super.runPreparation(node);
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(node.element.native, Constants.ownReactiveTreeNodeKey, {
|
|
15
|
-
configurable: false, enumerable: false, value: node, writable: false,
|
|
16
|
-
});
|
|
13
|
+
if (native == undefined && node.element.native !== undefined && !isPartition)
|
|
14
|
+
this.assignExtraAttributesAndProperties(node);
|
|
17
15
|
return result;
|
|
18
16
|
}
|
|
19
17
|
runFinalization(node, isLeader) {
|
|
20
18
|
var _a;
|
|
21
|
-
const
|
|
22
|
-
const native =
|
|
19
|
+
const el = node.element;
|
|
20
|
+
const native = el.native;
|
|
23
21
|
if (native) {
|
|
22
|
+
this.clearExtraAttributesAndProperties(node);
|
|
24
23
|
(_a = native.resizeObserver) === null || _a === void 0 ? void 0 : _a.unobserve(native);
|
|
25
24
|
if (isLeader)
|
|
26
25
|
native.remove();
|
|
27
26
|
}
|
|
28
27
|
super.runFinalization(node, isLeader);
|
|
29
|
-
|
|
28
|
+
el.native = null;
|
|
30
29
|
return false;
|
|
31
30
|
}
|
|
32
31
|
runMount(node) {
|
|
33
|
-
const
|
|
34
|
-
const native =
|
|
32
|
+
const el = node.element;
|
|
33
|
+
const native = el.native;
|
|
35
34
|
if (native) {
|
|
36
35
|
const sequential = node.owner.children.isStrict;
|
|
37
|
-
const
|
|
38
|
-
const automaticNativeHost =
|
|
39
|
-
?
|
|
40
|
-
:
|
|
36
|
+
const autoHost = ReactiveTreeNode.findMatchingHost(node, n => n.element.native instanceof HTMLElement || n.element.native instanceof SVGElement);
|
|
37
|
+
const automaticNativeHost = autoHost !== node.owner
|
|
38
|
+
? autoHost === null || autoHost === void 0 ? void 0 : autoHost.driver.provideHost(autoHost).element.native
|
|
39
|
+
: autoHost === null || autoHost === void 0 ? void 0 : autoHost.element.native;
|
|
41
40
|
if (automaticNativeHost) {
|
|
42
41
|
if (sequential && !node.driver.isPartition) {
|
|
43
42
|
const after = ReactiveTreeNode.findMatchingPrevSibling(node, n => n.element.native instanceof HTMLElement || n.element.native instanceof SVGElement);
|
|
@@ -59,22 +58,36 @@ export class WebDriver extends ElDriver {
|
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
runScript(node) {
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
|
|
61
|
+
const el = node.element;
|
|
62
|
+
if (el instanceof ElImpl)
|
|
63
|
+
el.prepareForUpdate();
|
|
65
64
|
let result = super.runScript(node);
|
|
66
65
|
result = proceedSyncOrAsync(result, v => {
|
|
67
|
-
if (
|
|
66
|
+
if (el.place === undefined) {
|
|
68
67
|
const oel = node.owner.element;
|
|
69
68
|
if (oel instanceof ElImpl && oel.isTable)
|
|
70
|
-
|
|
69
|
+
el.place = undefined;
|
|
71
70
|
}
|
|
72
71
|
if (gBlinkingEffectMarker)
|
|
73
|
-
blink(
|
|
72
|
+
blink(el.native, ReactiveTreeNode.currentScriptPriority, node.stamp);
|
|
74
73
|
}, e => {
|
|
75
74
|
});
|
|
76
75
|
return result;
|
|
77
76
|
}
|
|
77
|
+
assignExtraAttributesAndProperties(node) {
|
|
78
|
+
const e = node.element.native;
|
|
79
|
+
Object.defineProperty(e, Constants.ownReactiveTreeNodeKey, {
|
|
80
|
+
configurable: true, enumerable: false, value: node, writable: false,
|
|
81
|
+
});
|
|
82
|
+
if (ReactiveSystem.isLogging)
|
|
83
|
+
e.setAttribute(Constants.keyAttrName, node.key);
|
|
84
|
+
}
|
|
85
|
+
clearExtraAttributesAndProperties(node) {
|
|
86
|
+
const e = node.element.native;
|
|
87
|
+
delete e[Constants.ownReactiveTreeNodeKey];
|
|
88
|
+
if (ReactiveSystem.isLogging)
|
|
89
|
+
e.setAttribute(Constants.keyAttrName, "");
|
|
90
|
+
}
|
|
78
91
|
static getOwnNodeOfNativeElement(element) {
|
|
79
92
|
return element[Constants.ownReactiveTreeNodeKey];
|
|
80
93
|
}
|
|
@@ -96,17 +109,17 @@ export class StaticDriver extends WebDriver {
|
|
|
96
109
|
super(name, isRow, initialize);
|
|
97
110
|
this.native = native;
|
|
98
111
|
}
|
|
99
|
-
|
|
112
|
+
assignNativeElement(node) {
|
|
100
113
|
node.element.native = this.native;
|
|
101
114
|
}
|
|
102
115
|
}
|
|
103
116
|
export class HtmlDriver extends WebDriver {
|
|
104
|
-
|
|
117
|
+
assignNativeElement(node) {
|
|
105
118
|
node.element.native = document.createElement(node.driver.name);
|
|
106
119
|
}
|
|
107
120
|
}
|
|
108
121
|
export class SvgDriver extends WebDriver {
|
|
109
|
-
|
|
122
|
+
assignNativeElement(node) {
|
|
110
123
|
node.element.native = document.createElementNS("http://www.w3.org/2000/svg", node.driver.name);
|
|
111
124
|
}
|
|
112
125
|
}
|
|
@@ -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, transaction, 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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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, transaction, 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";
|
|
@@ -132,32 +132,32 @@ export class FocusSensor extends HtmlElementSensor {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
__decorate([
|
|
135
|
-
|
|
135
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
161
161
|
options({ logging: LoggingLevel.Off }),
|
|
162
162
|
__metadata("design:type", Function),
|
|
163
163
|
__metadata("design:paramtypes", [MouseEvent]),
|
|
@@ -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, runNonReactive } from "reactronic";
|
|
11
11
|
import { PseudoElement } from "../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
|
+
runNonReactive(() => action(pointer));
|
|
23
23
|
}
|
|
24
24
|
else if (action instanceof ToggleRef) {
|
|
25
|
-
|
|
25
|
+
runNonReactive(() => 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 runNonReactive(() => action(pointer));
|
|
43
43
|
}
|
|
44
44
|
else if (action instanceof ToggleRef) {
|
|
45
|
-
|
|
45
|
+
runNonReactive(() => 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
|
+
runNonReactive(() => action(size.inlineSize, size.blockSize));
|
|
98
98
|
else if (action instanceof ResizeData && action.handler !== undefined)
|
|
99
|
-
|
|
99
|
+
runNonReactive(() => 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, transaction, 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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
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
|
+
transaction,
|
|
122
122
|
options({ logging: LoggingLevel.Off }),
|
|
123
123
|
__metadata("design:type", Function),
|
|
124
124
|
__metadata("design:paramtypes", []),
|