verstak 0.24.502 → 0.91.25002
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 +1 -1
- package/build/dist/source/api.js +1 -1
- package/build/dist/source/core/El.d.ts +78 -0
- package/build/dist/source/core/El.js +32 -0
- package/build/dist/source/{html/El.d.ts → core/ElDriver.d.ts} +1 -77
- package/build/dist/source/{html/El.js → core/ElDriver.js} +9 -40
- package/build/dist/source/core/Elements.d.ts +42 -0
- package/build/dist/source/{html → core}/Elements.js +31 -26
- package/build/dist/source/{html → core}/SplitViewMath.d.ts +1 -1
- package/build/dist/source/{html/HtmlDriver.d.ts → core/WebDriver.d.ts} +6 -5
- package/build/dist/source/{html/HtmlDriver.js → core/WebDriver.js} +8 -8
- package/build/dist/source/core/api.d.ts +7 -0
- package/build/dist/source/core/api.js +7 -0
- package/build/dist/source/express/Button.v.d.ts +8 -0
- package/build/dist/source/express/Button.v.js +39 -0
- package/build/dist/source/express/Field.v.d.ts +16 -0
- package/build/dist/source/express/Field.v.js +118 -0
- package/build/dist/source/express/Icon.v.d.ts +3 -0
- package/build/dist/source/express/Icon.v.js +14 -0
- package/build/dist/source/express/Image.v.d.ts +6 -0
- package/build/dist/source/express/Image.v.js +18 -0
- package/build/dist/source/express/Markdown.v.d.ts +1 -0
- package/build/dist/source/express/Markdown.v.js +18 -0
- package/build/dist/source/express/Spinner.v.d.ts +9 -0
- package/build/dist/source/express/Spinner.v.js +23 -0
- package/build/dist/source/express/Theme.d.ts +34 -0
- package/build/dist/source/express/Theme.js +30 -0
- package/build/dist/source/express/Toggle.v.d.ts +8 -0
- package/build/dist/source/express/Toggle.v.js +40 -0
- package/build/dist/source/express/api.d.ts +9 -0
- package/build/dist/source/express/api.js +9 -0
- package/build/dist/source/express/common/Utils.d.ts +5 -0
- package/build/dist/source/express/common/Utils.js +26 -0
- package/build/dist/source/express/theme/Button.s.d.ts +11 -0
- package/build/dist/source/express/theme/Button.s.js +49 -0
- package/build/dist/source/express/theme/Field.s.d.ts +13 -0
- package/build/dist/source/express/theme/Field.s.js +68 -0
- package/build/dist/source/express/theme/Icon.s.d.ts +7 -0
- package/build/dist/source/express/theme/Icon.s.js +26 -0
- package/build/dist/source/express/theme/Styling.d.ts +16 -0
- package/build/dist/source/express/theme/Styling.js +20 -0
- package/build/dist/source/express/theme/Toggle.s.d.ts +11 -0
- package/build/dist/source/express/theme/Toggle.s.js +48 -0
- package/build/dist/source/html/DraggableArea.view.d.ts +2 -2
- package/build/dist/source/html/DraggableArea.view.js +2 -2
- package/build/dist/source/html/HtmlApiExt.d.ts +2 -2
- package/build/dist/source/html/HtmlApiExt.js +2 -2
- package/build/dist/source/html/HtmlElements.d.ts +2 -4
- package/build/dist/source/html/HtmlElements.js +2 -6
- package/build/dist/source/html/api.d.ts +0 -19
- package/build/dist/source/html/api.js +0 -19
- package/build/dist/source/{html/sensors → sensors}/FocusSensor.js +1 -1
- package/build/dist/source/{html → sensors}/Handlers.d.ts +3 -3
- package/build/dist/source/{html → sensors}/Handlers.js +5 -5
- package/build/dist/source/{html/sensors → sensors}/ResizeSensor.d.ts +1 -1
- package/build/dist/source/{html/sensors → sensors}/WindowSensor.js +1 -1
- package/build/dist/source/sensors/api.d.ts +13 -0
- package/build/dist/source/sensors/api.js +13 -0
- package/package.json +21 -9
- package/build/dist/source/html/Elements.d.ts +0 -39
- package/build/dist/source/{html → core}/ElUtils.d.ts +0 -0
- package/build/dist/source/{html → core}/ElUtils.js +0 -0
- package/build/dist/source/{html → core}/Sizes.d.ts +0 -0
- package/build/dist/source/{html → core}/Sizes.js +0 -0
- package/build/dist/source/{html → core}/SplitViewMath.js +1 -1
- /package/build/dist/source/{html/sensors → sensors}/BasePointerSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/BasePointerSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/ButtonSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/ButtonSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/DataForSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/DataForSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/FocusSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/HoverSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/HoverSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/HtmlDragSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/HtmlDragSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/HtmlElementSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/HtmlElementSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/HtmlSensors.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/HtmlSensors.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/KeyboardSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/KeyboardSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/PointerSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/PointerSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/ResizeSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/ScrollSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/ScrollSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/Sensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/Sensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/WheelSensor.d.ts +0 -0
- /package/build/dist/source/{html/sensors → sensors}/WheelSensor.js +0 -0
- /package/build/dist/source/{html/sensors → sensors}/WindowSensor.d.ts +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./core/api.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./sensors/api.js";
|
package/build/dist/source/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./core/api.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./sensors/api.js";
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ReactiveNode } from "reactronic";
|
|
2
|
+
export type El<T = any, M = any> = {
|
|
3
|
+
readonly node: ReactiveNode<El<T, M>>;
|
|
4
|
+
readonly index: number;
|
|
5
|
+
native: T;
|
|
6
|
+
model: M;
|
|
7
|
+
kind: ElKind;
|
|
8
|
+
place: ElPlace;
|
|
9
|
+
width: Range;
|
|
10
|
+
height: Range;
|
|
11
|
+
horizontally: Horizontal | undefined;
|
|
12
|
+
contentHorizontally: Horizontal | undefined;
|
|
13
|
+
vertically: Vertical | undefined;
|
|
14
|
+
contentVertically: Vertical | undefined;
|
|
15
|
+
stretchingStrengthHorizontally: number | undefined;
|
|
16
|
+
stretchingStrengthVertically: number | undefined;
|
|
17
|
+
contentWrapping: boolean;
|
|
18
|
+
overlayVisible: boolean | undefined;
|
|
19
|
+
sealed: Direction | undefined;
|
|
20
|
+
splitView: Direction | undefined;
|
|
21
|
+
widthPx: {
|
|
22
|
+
minPx: number;
|
|
23
|
+
maxPx: number;
|
|
24
|
+
};
|
|
25
|
+
heightPx: {
|
|
26
|
+
minPx: number;
|
|
27
|
+
maxPx: number;
|
|
28
|
+
};
|
|
29
|
+
partitionSizeInSplitViewPx: number;
|
|
30
|
+
readonly style: CSSStyleDeclaration;
|
|
31
|
+
useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
|
|
32
|
+
};
|
|
33
|
+
export declare enum ElKind {
|
|
34
|
+
panel = 0,
|
|
35
|
+
table = 1,
|
|
36
|
+
note = 2,
|
|
37
|
+
group = 3,
|
|
38
|
+
part = 4,
|
|
39
|
+
splitter = 5,
|
|
40
|
+
cursor = 6,
|
|
41
|
+
native = 7
|
|
42
|
+
}
|
|
43
|
+
export type ElCoords = {
|
|
44
|
+
x1: number;
|
|
45
|
+
y1: number;
|
|
46
|
+
x2: number;
|
|
47
|
+
y2: number;
|
|
48
|
+
};
|
|
49
|
+
export declare enum Horizontal {
|
|
50
|
+
left = 0,
|
|
51
|
+
center = 1,
|
|
52
|
+
right = 2,
|
|
53
|
+
stretch = 3,
|
|
54
|
+
stretchAndFix = 4
|
|
55
|
+
}
|
|
56
|
+
export declare enum Vertical {
|
|
57
|
+
top = 0,
|
|
58
|
+
center = 1,
|
|
59
|
+
bottom = 2,
|
|
60
|
+
stretch = 3,
|
|
61
|
+
stretchAndFix = 4
|
|
62
|
+
}
|
|
63
|
+
export type Range = {
|
|
64
|
+
readonly min?: string;
|
|
65
|
+
readonly max?: string;
|
|
66
|
+
preferred?: string;
|
|
67
|
+
};
|
|
68
|
+
export type MarkedRange = Range & {
|
|
69
|
+
readonly marker?: string;
|
|
70
|
+
};
|
|
71
|
+
export type ElPlace = undefined | string | {
|
|
72
|
+
cellsOverWidth?: number;
|
|
73
|
+
cellsOverHeight?: number;
|
|
74
|
+
};
|
|
75
|
+
export declare enum Direction {
|
|
76
|
+
horizontal = 0,
|
|
77
|
+
vertical = 1
|
|
78
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export var ElKind;
|
|
2
|
+
(function (ElKind) {
|
|
3
|
+
ElKind[ElKind["panel"] = 0] = "panel";
|
|
4
|
+
ElKind[ElKind["table"] = 1] = "table";
|
|
5
|
+
ElKind[ElKind["note"] = 2] = "note";
|
|
6
|
+
ElKind[ElKind["group"] = 3] = "group";
|
|
7
|
+
ElKind[ElKind["part"] = 4] = "part";
|
|
8
|
+
ElKind[ElKind["splitter"] = 5] = "splitter";
|
|
9
|
+
ElKind[ElKind["cursor"] = 6] = "cursor";
|
|
10
|
+
ElKind[ElKind["native"] = 7] = "native";
|
|
11
|
+
})(ElKind || (ElKind = {}));
|
|
12
|
+
export var Horizontal;
|
|
13
|
+
(function (Horizontal) {
|
|
14
|
+
Horizontal[Horizontal["left"] = 0] = "left";
|
|
15
|
+
Horizontal[Horizontal["center"] = 1] = "center";
|
|
16
|
+
Horizontal[Horizontal["right"] = 2] = "right";
|
|
17
|
+
Horizontal[Horizontal["stretch"] = 3] = "stretch";
|
|
18
|
+
Horizontal[Horizontal["stretchAndFix"] = 4] = "stretchAndFix";
|
|
19
|
+
})(Horizontal || (Horizontal = {}));
|
|
20
|
+
export var Vertical;
|
|
21
|
+
(function (Vertical) {
|
|
22
|
+
Vertical[Vertical["top"] = 0] = "top";
|
|
23
|
+
Vertical[Vertical["center"] = 1] = "center";
|
|
24
|
+
Vertical[Vertical["bottom"] = 2] = "bottom";
|
|
25
|
+
Vertical[Vertical["stretch"] = 3] = "stretch";
|
|
26
|
+
Vertical[Vertical["stretchAndFix"] = 4] = "stretchAndFix";
|
|
27
|
+
})(Vertical || (Vertical = {}));
|
|
28
|
+
export var Direction;
|
|
29
|
+
(function (Direction) {
|
|
30
|
+
Direction[Direction["horizontal"] = 0] = "horizontal";
|
|
31
|
+
Direction[Direction["vertical"] = 1] = "vertical";
|
|
32
|
+
})(Direction || (Direction = {}));
|
|
@@ -1,81 +1,5 @@
|
|
|
1
1
|
import { ReactiveNode, BaseDriver } from "reactronic";
|
|
2
|
-
|
|
3
|
-
readonly node: ReactiveNode<El<T, M>>;
|
|
4
|
-
readonly index: number;
|
|
5
|
-
native: T;
|
|
6
|
-
model: M;
|
|
7
|
-
kind: ElKind;
|
|
8
|
-
place: ElPlace;
|
|
9
|
-
width: Range;
|
|
10
|
-
height: Range;
|
|
11
|
-
horizontally: Horizontal | undefined;
|
|
12
|
-
contentHorizontally: Horizontal | undefined;
|
|
13
|
-
vertically: Vertical | undefined;
|
|
14
|
-
contentVertically: Vertical | undefined;
|
|
15
|
-
stretchingStrengthHorizontally: number | undefined;
|
|
16
|
-
stretchingStrengthVertically: number | undefined;
|
|
17
|
-
contentWrapping: boolean;
|
|
18
|
-
overlayVisible: boolean | undefined;
|
|
19
|
-
sealed: Direction | undefined;
|
|
20
|
-
splitView: Direction | undefined;
|
|
21
|
-
widthPx: {
|
|
22
|
-
minPx: number;
|
|
23
|
-
maxPx: number;
|
|
24
|
-
};
|
|
25
|
-
heightPx: {
|
|
26
|
-
minPx: number;
|
|
27
|
-
maxPx: number;
|
|
28
|
-
};
|
|
29
|
-
partitionSizeInSplitViewPx: number;
|
|
30
|
-
readonly style: CSSStyleDeclaration;
|
|
31
|
-
useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
|
|
32
|
-
};
|
|
33
|
-
export declare enum ElKind {
|
|
34
|
-
panel = 0,
|
|
35
|
-
table = 1,
|
|
36
|
-
note = 2,
|
|
37
|
-
group = 3,
|
|
38
|
-
part = 4,
|
|
39
|
-
splitter = 5,
|
|
40
|
-
cursor = 6,
|
|
41
|
-
native = 7
|
|
42
|
-
}
|
|
43
|
-
export type ElCoords = {
|
|
44
|
-
x1: number;
|
|
45
|
-
y1: number;
|
|
46
|
-
x2: number;
|
|
47
|
-
y2: number;
|
|
48
|
-
};
|
|
49
|
-
export declare enum Horizontal {
|
|
50
|
-
left = 0,
|
|
51
|
-
center = 1,
|
|
52
|
-
right = 2,
|
|
53
|
-
stretch = 3,
|
|
54
|
-
stretchAndFix = 4
|
|
55
|
-
}
|
|
56
|
-
export declare enum Vertical {
|
|
57
|
-
top = 0,
|
|
58
|
-
center = 1,
|
|
59
|
-
bottom = 2,
|
|
60
|
-
stretch = 3,
|
|
61
|
-
stretchAndFix = 4
|
|
62
|
-
}
|
|
63
|
-
export type Range = {
|
|
64
|
-
readonly min?: string;
|
|
65
|
-
readonly max?: string;
|
|
66
|
-
preferred?: string;
|
|
67
|
-
};
|
|
68
|
-
export type MarkedRange = Range & {
|
|
69
|
-
readonly marker?: string;
|
|
70
|
-
};
|
|
71
|
-
export type ElPlace = undefined | string | {
|
|
72
|
-
cellsOverWidth?: number;
|
|
73
|
-
cellsOverHeight?: number;
|
|
74
|
-
};
|
|
75
|
-
export declare enum Direction {
|
|
76
|
-
horizontal = 0,
|
|
77
|
-
vertical = 1
|
|
78
|
-
}
|
|
2
|
+
import { El, ElKind, Horizontal, Vertical, Range, ElPlace, Direction } from "./El.js";
|
|
79
3
|
export declare class ElDriver<T extends Element, M = unknown> extends BaseDriver<El<T, M>> {
|
|
80
4
|
create(node: ReactiveNode<El<T, M>>): El<T, M>;
|
|
81
5
|
}
|
|
@@ -8,47 +8,8 @@ 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
10
|
import { ReactiveNode, BaseDriver, Transaction, obs, ObservableObject } from "reactronic";
|
|
11
|
+
import { ElKind, Horizontal, Vertical, Direction } from "./El.js";
|
|
11
12
|
import { equalElCoords, parseElCoords } from "./ElUtils.js";
|
|
12
|
-
export var ElKind;
|
|
13
|
-
(function (ElKind) {
|
|
14
|
-
ElKind[ElKind["panel"] = 0] = "panel";
|
|
15
|
-
ElKind[ElKind["table"] = 1] = "table";
|
|
16
|
-
ElKind[ElKind["note"] = 2] = "note";
|
|
17
|
-
ElKind[ElKind["group"] = 3] = "group";
|
|
18
|
-
ElKind[ElKind["part"] = 4] = "part";
|
|
19
|
-
ElKind[ElKind["splitter"] = 5] = "splitter";
|
|
20
|
-
ElKind[ElKind["cursor"] = 6] = "cursor";
|
|
21
|
-
ElKind[ElKind["native"] = 7] = "native";
|
|
22
|
-
})(ElKind || (ElKind = {}));
|
|
23
|
-
export var Horizontal;
|
|
24
|
-
(function (Horizontal) {
|
|
25
|
-
Horizontal[Horizontal["left"] = 0] = "left";
|
|
26
|
-
Horizontal[Horizontal["center"] = 1] = "center";
|
|
27
|
-
Horizontal[Horizontal["right"] = 2] = "right";
|
|
28
|
-
Horizontal[Horizontal["stretch"] = 3] = "stretch";
|
|
29
|
-
Horizontal[Horizontal["stretchAndFix"] = 4] = "stretchAndFix";
|
|
30
|
-
})(Horizontal || (Horizontal = {}));
|
|
31
|
-
export var Vertical;
|
|
32
|
-
(function (Vertical) {
|
|
33
|
-
Vertical[Vertical["top"] = 0] = "top";
|
|
34
|
-
Vertical[Vertical["center"] = 1] = "center";
|
|
35
|
-
Vertical[Vertical["bottom"] = 2] = "bottom";
|
|
36
|
-
Vertical[Vertical["stretch"] = 3] = "stretch";
|
|
37
|
-
Vertical[Vertical["stretchAndFix"] = 4] = "stretchAndFix";
|
|
38
|
-
})(Vertical || (Vertical = {}));
|
|
39
|
-
export var Direction;
|
|
40
|
-
(function (Direction) {
|
|
41
|
-
Direction[Direction["horizontal"] = 0] = "horizontal";
|
|
42
|
-
Direction[Direction["vertical"] = 1] = "vertical";
|
|
43
|
-
})(Direction || (Direction = {}));
|
|
44
|
-
class Size extends ObservableObject {
|
|
45
|
-
constructor() {
|
|
46
|
-
super();
|
|
47
|
-
this.raw = { min: "", max: "" };
|
|
48
|
-
this.minPx = 0;
|
|
49
|
-
this.maxPx = Number.POSITIVE_INFINITY;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
13
|
export class ElDriver extends BaseDriver {
|
|
53
14
|
create(node) {
|
|
54
15
|
return new ElImpl(node);
|
|
@@ -574,6 +535,14 @@ export class ElImpl {
|
|
|
574
535
|
native.className = enabled ? styleName : "";
|
|
575
536
|
}
|
|
576
537
|
}
|
|
538
|
+
class Size extends ObservableObject {
|
|
539
|
+
constructor() {
|
|
540
|
+
super();
|
|
541
|
+
this.raw = { min: "", max: "" };
|
|
542
|
+
this.minPx = 0;
|
|
543
|
+
this.maxPx = Number.POSITIVE_INFINITY;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
577
546
|
export class ElLayoutInfo {
|
|
578
547
|
constructor(prev) {
|
|
579
548
|
this.x = prev.x;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactiveNodeDecl, ReactiveNodeDriver, ReactiveNode, Script, Mode, MergedItem, ScriptAsync } from "reactronic";
|
|
2
|
+
import { El, ElPlace } from "./El.js";
|
|
3
|
+
import { CursorCommandDriver } from "./ElDriver.js";
|
|
4
|
+
import { HtmlDriver } from "./WebDriver.js";
|
|
5
|
+
export declare function Window(script?: Script<El<HTMLBodyElement>>, scriptAsync?: ScriptAsync<El<HTMLBodyElement>>, key?: string, mode?: Mode, preparation?: Script<El<HTMLBodyElement>>, preparationAsync?: ScriptAsync<El<HTMLBodyElement>>, finalization?: Script<El<HTMLBodyElement>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLBodyElement>>): ReactiveNode<El<HTMLBodyElement>>;
|
|
6
|
+
export declare function Window(declaration?: ReactiveNodeDecl<El<HTMLBodyElement>>): ReactiveNode<El<HTMLBodyElement>>;
|
|
7
|
+
export declare function Panel<M = unknown>(script?: Script<El<HTMLElement, M>>, scriptAsync?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, preparation?: Script<El<HTMLElement, M>>, preparationAsync?: ScriptAsync<El<HTMLElement, M>>, finalization?: Script<El<HTMLElement, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
8
|
+
export declare function Panel<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
9
|
+
export declare function Table<M = unknown>(script?: Script<El<HTMLElement, M>>, scriptAsync?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, preparation?: Script<El<HTMLElement, M>>, preparationAsync?: ScriptAsync<El<HTMLElement, M>>, finalization?: Script<El<HTMLElement, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
10
|
+
export declare function Table<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
11
|
+
export declare function row<T = void>(builder?: (element: void) => T, shiftCursorDown?: number): void;
|
|
12
|
+
export declare function Splitter<M = unknown>(script?: Script<El<HTMLElement, M>>, scriptAsync?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, preparation?: Script<El<HTMLElement, M>>, preparationAsync?: ScriptAsync<El<HTMLElement, M>>, finalization?: Script<El<HTMLElement, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
13
|
+
export declare function Splitter<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
14
|
+
export declare function rowBreak(shiftCursorDown?: number): void;
|
|
15
|
+
export declare function declareSplitter<T>(index: number, splitViewNode: ReactiveNode<El<T>>): ReactiveNode<El<HTMLElement>>;
|
|
16
|
+
export declare function cursor(areaParams: ElPlace): void;
|
|
17
|
+
export declare function Note(content: string, formatted?: boolean, declaration?: ReactiveNodeDecl<El<HTMLElement, void>>): ReactiveNode<El<HTMLElement, void>>;
|
|
18
|
+
export declare function Group<M = unknown>(script?: Script<El<HTMLElement, M>>, scriptAsync?: ScriptAsync<El<HTMLElement, M>>, key?: string, mode?: Mode, preparation?: Script<El<HTMLElement, M>>, preparationAsync?: ScriptAsync<El<HTMLElement, M>>, finalization?: Script<El<HTMLElement, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
19
|
+
export declare function Group<M = unknown>(declaration?: ReactiveNodeDecl<El<HTMLElement, M>>): ReactiveNode<El<HTMLElement, M>>;
|
|
20
|
+
export declare function Handling<M = unknown>(script: Script<El<void, M>>): ReactiveNode<El<void, M>>;
|
|
21
|
+
export declare function SyntheticElement<M = unknown>(script?: Script<El<void, M>>, scriptAsync?: ScriptAsync<El<void, M>>, key?: string, mode?: Mode, preparation?: Script<El<void, M>>, preparationAsync?: ScriptAsync<El<void, M>>, finalization?: Script<El<void, M>>, triggers?: unknown, basis?: ReactiveNodeDecl<El<void, M>>): ReactiveNode<El<void, M>>;
|
|
22
|
+
export declare function SyntheticElement<M = unknown>(declaration?: ReactiveNodeDecl<El<void, M>>): ReactiveNode<El<void, M>>;
|
|
23
|
+
export declare class PanelDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
24
|
+
runScript(node: ReactiveNode<El<T>>): void | Promise<void>;
|
|
25
|
+
declareChild(ownerNode: ReactiveNode<El<T, any>>, childDriver: ReactiveNodeDriver<any>, childDeclaration?: ReactiveNodeDecl<any> | undefined, childBasis?: ReactiveNodeDecl<any> | undefined): MergedItem<ReactiveNode> | undefined;
|
|
26
|
+
}
|
|
27
|
+
export declare function isSplitViewPartition(childDriver: ReactiveNodeDriver): boolean;
|
|
28
|
+
export declare class PartitionDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
29
|
+
runScript(node: ReactiveNode<El<T>>): void | Promise<void>;
|
|
30
|
+
provideHost(node: ReactiveNode<El<T, any>>): ReactiveNode<El<T, any>>;
|
|
31
|
+
}
|
|
32
|
+
export declare const Drivers: {
|
|
33
|
+
panel: PanelDriver<HTMLElement>;
|
|
34
|
+
table: HtmlDriver<HTMLElement, any>;
|
|
35
|
+
note: HtmlDriver<HTMLElement, any>;
|
|
36
|
+
group: HtmlDriver<HTMLElement, any>;
|
|
37
|
+
partition: PartitionDriver<HTMLElement>;
|
|
38
|
+
wrapper: HtmlDriver<HTMLElement, any>;
|
|
39
|
+
splitter: HtmlDriver<HTMLElement, any>;
|
|
40
|
+
cursor: CursorCommandDriver;
|
|
41
|
+
synthetic: ReactiveNodeDriver<El<void, any>>;
|
|
42
|
+
};
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { ReactiveNode, Mode, unobs } from "reactronic";
|
|
2
|
-
import {
|
|
2
|
+
import { ElKind, Direction } from "./El.js";
|
|
3
|
+
import { clamp } from "./ElUtils.js";
|
|
4
|
+
import { Constants, CursorCommandDriver, ElDriver, ElLayoutInfo, InitialElLayoutInfo } from "./ElDriver.js";
|
|
3
5
|
import { getPrioritiesForEmptySpaceDistribution, getPrioritiesForSizeChanging, relayout, relayoutUsingSplitter } from "./SplitViewMath.js";
|
|
4
6
|
import { Axis, BodyFontSize, Dimension, toPx } from "./Sizes.js";
|
|
5
|
-
import { HtmlDriver } from "./
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return ReactiveNode.declare(
|
|
7
|
+
import { HtmlDriver, StaticDriver } from "./WebDriver.js";
|
|
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.panel);
|
|
10
|
+
return ReactiveNode.declare(driver, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
11
|
+
}
|
|
12
|
+
export function Panel(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
13
|
+
return ReactiveNode.declare(Drivers.panel, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
9
14
|
}
|
|
10
|
-
export function Table(
|
|
11
|
-
return ReactiveNode.declare(Drivers.table,
|
|
15
|
+
export function Table(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
16
|
+
return ReactiveNode.declare(Drivers.table, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
12
17
|
}
|
|
13
18
|
export function row(builder, shiftCursorDown) {
|
|
14
19
|
rowBreak(shiftCursorDown);
|
|
15
20
|
builder === null || builder === void 0 ? void 0 : builder();
|
|
16
21
|
}
|
|
17
|
-
export function Splitter(
|
|
18
|
-
return ReactiveNode.declare(Drivers.splitter,
|
|
22
|
+
export function Splitter(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
23
|
+
return ReactiveNode.declare(Drivers.splitter, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
19
24
|
}
|
|
20
25
|
export function rowBreak(shiftCursorDown) {
|
|
21
26
|
ReactiveNode.declare(Drivers.partition);
|
|
@@ -26,7 +31,7 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
26
31
|
key,
|
|
27
32
|
mode: Mode.autonomous,
|
|
28
33
|
preparation: el => el.native.className = `splitter ${key}`,
|
|
29
|
-
|
|
34
|
+
script: b => {
|
|
30
35
|
const e = b.native;
|
|
31
36
|
const model = b.model;
|
|
32
37
|
const dataForSensor = e.dataForSensor;
|
|
@@ -75,14 +80,14 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
75
80
|
}
|
|
76
81
|
export function cursor(areaParams) {
|
|
77
82
|
ReactiveNode.declare(Drivers.cursor, {
|
|
78
|
-
|
|
83
|
+
script: el => {
|
|
79
84
|
el.place = areaParams;
|
|
80
85
|
},
|
|
81
86
|
});
|
|
82
87
|
}
|
|
83
88
|
export function Note(content, formatted, declaration) {
|
|
84
89
|
return ReactiveNode.declare(Drivers.note, ReactiveNode.withBasis(declaration, {
|
|
85
|
-
|
|
90
|
+
script: el => {
|
|
86
91
|
if (formatted)
|
|
87
92
|
el.native.innerHTML = content;
|
|
88
93
|
else
|
|
@@ -90,20 +95,20 @@ export function Note(content, formatted, declaration) {
|
|
|
90
95
|
},
|
|
91
96
|
}));
|
|
92
97
|
}
|
|
93
|
-
export function Group(
|
|
94
|
-
return ReactiveNode.declare(Drivers.group,
|
|
98
|
+
export function Group(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
99
|
+
return ReactiveNode.declare(Drivers.group, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
95
100
|
}
|
|
96
|
-
export function Handling(
|
|
97
|
-
return SyntheticElement({ mode: Mode.autonomous,
|
|
101
|
+
export function Handling(script) {
|
|
102
|
+
return SyntheticElement({ mode: Mode.autonomous, script });
|
|
98
103
|
}
|
|
99
|
-
export function SyntheticElement(
|
|
100
|
-
return ReactiveNode.declare(Drivers.synthetic,
|
|
104
|
+
export function SyntheticElement(scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis) {
|
|
105
|
+
return ReactiveNode.declare(Drivers.synthetic, scriptOrDeclaration, scriptAsync, key, mode, preparation, preparationAsync, finalization, triggers, basis);
|
|
101
106
|
}
|
|
102
107
|
export class PanelDriver extends HtmlDriver {
|
|
103
|
-
|
|
108
|
+
runScript(node) {
|
|
104
109
|
rowBreak();
|
|
105
110
|
const el = node.element;
|
|
106
|
-
const result = super.
|
|
111
|
+
const result = super.runScript(node);
|
|
107
112
|
if (el.splitView !== undefined) {
|
|
108
113
|
if (el.layoutInfo === undefined)
|
|
109
114
|
el.layoutInfo = new ElLayoutInfo(InitialElLayoutInfo);
|
|
@@ -123,7 +128,7 @@ export class PanelDriver extends HtmlDriver {
|
|
|
123
128
|
});
|
|
124
129
|
const relayoutEl = SyntheticElement({
|
|
125
130
|
mode: Mode.autonomous,
|
|
126
|
-
|
|
131
|
+
script: () => {
|
|
127
132
|
const native = el.native;
|
|
128
133
|
const isHorizontal = el.splitView === Direction.horizontal;
|
|
129
134
|
if (layoutInfo.isUpdateFinished) {
|
|
@@ -174,7 +179,7 @@ export class PanelDriver extends HtmlDriver {
|
|
|
174
179
|
}
|
|
175
180
|
return result;
|
|
176
181
|
}
|
|
177
|
-
|
|
182
|
+
declareChild(ownerNode, childDriver, childDeclaration, childBasis) {
|
|
178
183
|
var _a;
|
|
179
184
|
let result = undefined;
|
|
180
185
|
const el = ownerNode.element;
|
|
@@ -190,7 +195,7 @@ export class PanelDriver extends HtmlDriver {
|
|
|
190
195
|
if (childDeclaration.triggers === undefined)
|
|
191
196
|
childDeclaration.triggers = {};
|
|
192
197
|
Object.defineProperty(childDeclaration.triggers, "index", { value: partCount });
|
|
193
|
-
overrideMethod(childDeclaration, "
|
|
198
|
+
overrideMethod(childDeclaration, "script", el => {
|
|
194
199
|
if (isHorizontal)
|
|
195
200
|
el.style.gridColumn = `${partCount + 1}`;
|
|
196
201
|
else
|
|
@@ -221,13 +226,13 @@ function overrideMethod(declaration, method, func) {
|
|
|
221
226
|
: (el, base) => { base(); func(el); };
|
|
222
227
|
}
|
|
223
228
|
export class PartitionDriver extends HtmlDriver {
|
|
224
|
-
|
|
225
|
-
const result = super.
|
|
229
|
+
runScript(node) {
|
|
230
|
+
const result = super.runScript(node);
|
|
226
231
|
const ownerEl = node.owner.element;
|
|
227
232
|
if (ownerEl.sealed !== undefined) {
|
|
228
233
|
node.element.style.flexGrow = "1";
|
|
229
234
|
ReactiveNode.declare(Drivers.wrapper, {
|
|
230
|
-
|
|
235
|
+
script: el => {
|
|
231
236
|
const ownerEl = el.node.owner.owner.element;
|
|
232
237
|
if (ownerEl.splitView !== undefined) {
|
|
233
238
|
el.style.display = "grid";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MergeList, ReactiveNode } from "reactronic";
|
|
2
|
-
import { ElImpl } from "./
|
|
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;
|
|
5
5
|
export declare function greater(a: number, b: number): boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ReactiveNode, Handler } from "reactronic";
|
|
2
|
-
import { El
|
|
2
|
+
import { El } from "./El.js";
|
|
3
|
+
import { ElDriver } from "./ElDriver.js";
|
|
3
4
|
export declare class WebDriver<T extends Element, M = unknown> extends ElDriver<T, M> {
|
|
4
5
|
setNativeElement(node: ReactiveNode<El<T, M>>): void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
runPreparation(node: ReactiveNode<El<T, M>>): void | Promise<void>;
|
|
7
|
+
runFinalization(node: ReactiveNode<El<T, M>>, isLeader: boolean): boolean;
|
|
8
|
+
runMount(node: ReactiveNode<El<T, M>>): void;
|
|
9
|
+
runScript(node: ReactiveNode<El<T, M>>): void | Promise<void>;
|
|
9
10
|
static findBrotherlyHost<T, R>(node: ReactiveNode<El<T>>): ReactiveNode<El<R>> | undefined;
|
|
10
11
|
static findBrotherlyPrevSibling<T, R>(node: ReactiveNode<El<T>>): ReactiveNode<El<R>> | undefined;
|
|
11
12
|
static get blinkingEffectMarker(): string | undefined;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ReactiveSystem, ReactiveNode, proceedSyncOrAsync } from "reactronic";
|
|
2
|
-
import { Constants, ElDriver, ElImpl } from "./
|
|
2
|
+
import { Constants, ElDriver, ElImpl } from "./ElDriver.js";
|
|
3
3
|
export class WebDriver extends ElDriver {
|
|
4
4
|
setNativeElement(node) {
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
runPreparation(node) {
|
|
7
7
|
this.setNativeElement(node);
|
|
8
8
|
const e = node.element.native;
|
|
9
9
|
if (ReactiveSystem.isLogging && e !== undefined && !node.driver.isPartition)
|
|
10
10
|
e.setAttribute(Constants.keyAttrName, node.key);
|
|
11
|
-
const result = super.
|
|
11
|
+
const result = super.runPreparation(node);
|
|
12
12
|
if (e == undefined && ReactiveSystem.isLogging && !node.driver.isPartition)
|
|
13
13
|
node.element.native.setAttribute(Constants.keyAttrName, node.key);
|
|
14
14
|
return result;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
runFinalization(node, isLeader) {
|
|
17
17
|
var _a;
|
|
18
18
|
const element = node.element;
|
|
19
19
|
const native = element.native;
|
|
@@ -22,11 +22,11 @@ export class WebDriver extends ElDriver {
|
|
|
22
22
|
if (isLeader)
|
|
23
23
|
native.remove();
|
|
24
24
|
}
|
|
25
|
-
super.
|
|
25
|
+
super.runFinalization(node, isLeader);
|
|
26
26
|
element.native = null;
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
runMount(node) {
|
|
30
30
|
const element = node.element;
|
|
31
31
|
const native = element.native;
|
|
32
32
|
if (native) {
|
|
@@ -55,11 +55,11 @@ export class WebDriver extends ElDriver {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
runScript(node) {
|
|
59
59
|
const element = node.element;
|
|
60
60
|
if (element instanceof ElImpl)
|
|
61
61
|
element.prepareForUpdate();
|
|
62
|
-
let result = super.
|
|
62
|
+
let result = super.runScript(node);
|
|
63
63
|
result = proceedSyncOrAsync(result, v => {
|
|
64
64
|
if (element.place === undefined) {
|
|
65
65
|
const oel = node.owner.element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactiveNodeDecl, ReactiveNode } from "reactronic";
|
|
2
|
+
import { El } from "verstak";
|
|
3
|
+
export type ButtonModel = {
|
|
4
|
+
icon?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
action?(): void;
|
|
7
|
+
};
|
|
8
|
+
export declare function Button(declaration?: ReactiveNodeDecl<El<HTMLElement, ButtonModel>>): ReactiveNode<El<HTMLElement, ButtonModel>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Mode, ReactiveNode } from "reactronic";
|
|
2
|
+
import { Panel, Note, OnClick } from "verstak";
|
|
3
|
+
import { observableModel } from "./common/Utils.js";
|
|
4
|
+
import { Theme } from "./Theme.js";
|
|
5
|
+
import { Icon } from "./Icon.v.js";
|
|
6
|
+
export function Button(declaration) {
|
|
7
|
+
return (Panel(ReactiveNode.withBasis(declaration, {
|
|
8
|
+
mode: Mode.autonomous,
|
|
9
|
+
preparation: el => {
|
|
10
|
+
var _a;
|
|
11
|
+
(_a = el.model) !== null && _a !== void 0 ? _a : (el.model = observableModel({
|
|
12
|
+
icon: "fa-solid fa-square",
|
|
13
|
+
label: ReactiveNode.key,
|
|
14
|
+
}));
|
|
15
|
+
},
|
|
16
|
+
script: el => {
|
|
17
|
+
const m = el.model;
|
|
18
|
+
const theme = Theme.current.button;
|
|
19
|
+
el.useStylingPreset(theme.main);
|
|
20
|
+
if (m.icon) {
|
|
21
|
+
Icon(m.icon, {
|
|
22
|
+
script: (el, base) => {
|
|
23
|
+
base();
|
|
24
|
+
el.useStylingPreset(theme.icon);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (m.label) {
|
|
29
|
+
Note(m.label, false, {
|
|
30
|
+
script: (el, base) => {
|
|
31
|
+
base();
|
|
32
|
+
el.useStylingPreset(theme.label);
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
OnClick(el.native, m.action);
|
|
37
|
+
},
|
|
38
|
+
})));
|
|
39
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactiveNodeDecl, ReactiveNode } from "reactronic";
|
|
2
|
+
import { FocusModel, El } from "verstak";
|
|
3
|
+
import { ValuesOrRefs } from "./common/Utils.js";
|
|
4
|
+
export type FieldModel<T = string> = FocusModel & {
|
|
5
|
+
icon?: string;
|
|
6
|
+
text: string;
|
|
7
|
+
options: Array<T>;
|
|
8
|
+
selected: T | undefined;
|
|
9
|
+
multiSelected: Set<T>;
|
|
10
|
+
position: number;
|
|
11
|
+
isMultiLineText: boolean;
|
|
12
|
+
isHotText: boolean;
|
|
13
|
+
inputStyle: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function Field(declaration?: ReactiveNodeDecl<El<HTMLElement, FieldModel>>): ReactiveNode<El<HTMLElement, FieldModel<string>>>;
|
|
16
|
+
export declare function composeFieldModel<T>(props?: Partial<ValuesOrRefs<FieldModel<T>>>): FieldModel<T>;
|