verstak 0.23.121 → 0.23.122
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/Interfaces.d.ts +42 -41
- package/build/dist/source/core/Interfaces.js +10 -10
- package/build/dist/source/core/Utils.d.ts +4 -4
- package/build/dist/source/core/Utils.js +3 -3
- package/build/dist/source/core/Verstak.d.ts +27 -27
- package/build/dist/source/core/Verstak.js +199 -195
- package/build/dist/source/html/Elements.d.ts +27 -0
- package/build/dist/source/html/{Blocks.js → Elements.js} +58 -58
- package/build/dist/source/html/HtmlDriver.d.ts +11 -11
- package/build/dist/source/html/HtmlDriver.js +42 -42
- package/build/dist/source/html/HtmlElements.d.ts +175 -0
- package/build/dist/source/html/{HtmlBlocks.js → HtmlElements.js} +175 -175
- package/build/dist/source/html/ReactingFocuser.js +1 -1
- package/build/dist/source/html/api.d.ts +2 -2
- package/build/dist/source/html/api.js +2 -2
- package/build/dist/source/html/sensors/ResizeSensor.d.ts +2 -2
- package/build/dist/source/html/sensors/ResizeSensor.js +3 -3
- package/package.json +1 -1
- package/build/dist/source/html/Blocks.d.ts +0 -27
- package/build/dist/source/html/HtmlBlocks.d.ts +0 -175
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MergeListReader, MergeItem, MemberOptions } from "reactronic";
|
|
2
2
|
export type Callback<T = unknown> = (native: T) => void;
|
|
3
|
-
export type Delegate<T = unknown, M = unknown, C = unknown, R = void> = (
|
|
4
|
-
export type AsyncDelegate<T = unknown, M = unknown> = (
|
|
5
|
-
export type SimpleDelegate<T = unknown> = (
|
|
6
|
-
export declare enum
|
|
3
|
+
export type Delegate<T = unknown, M = unknown, C = unknown, R = void> = (element: El<T, M, C, R>, base: () => R) => R;
|
|
4
|
+
export type AsyncDelegate<T = unknown, M = unknown> = (element: El<T, M, Promise<void>>) => Promise<void>;
|
|
5
|
+
export type SimpleDelegate<T = unknown> = (element: El<T, any, any, any>) => void;
|
|
6
|
+
export declare enum ElKind {
|
|
7
7
|
Section = 0,
|
|
8
8
|
Table = 1,
|
|
9
9
|
Note = 2,
|
|
@@ -12,15 +12,15 @@ export declare enum BlockKind {
|
|
|
12
12
|
Cursor = 5,
|
|
13
13
|
Native = 6
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
16
|
-
readonly node:
|
|
15
|
+
export interface El<T = unknown, M = unknown, C = unknown, R = void> {
|
|
16
|
+
readonly node: ElNode<T, M, C, R>;
|
|
17
17
|
readonly native: T;
|
|
18
18
|
readonly isSection: boolean;
|
|
19
19
|
readonly isTable: boolean;
|
|
20
20
|
model: M;
|
|
21
21
|
controller: C;
|
|
22
|
-
kind:
|
|
23
|
-
area:
|
|
22
|
+
kind: ElKind;
|
|
23
|
+
area: ElArea;
|
|
24
24
|
widthGrowth: number;
|
|
25
25
|
minWidth: string;
|
|
26
26
|
maxWidth: string;
|
|
@@ -28,7 +28,7 @@ export interface Block<T = unknown, M = unknown, C = unknown, R = void> {
|
|
|
28
28
|
minHeight: string;
|
|
29
29
|
maxHeight: string;
|
|
30
30
|
contentAlignment: Align;
|
|
31
|
-
|
|
31
|
+
elementAlignment: Align;
|
|
32
32
|
contentWrapping: boolean;
|
|
33
33
|
overlayVisible: boolean | undefined;
|
|
34
34
|
updatePriority?: Priority;
|
|
@@ -37,22 +37,23 @@ export interface Block<T = unknown, M = unknown, C = unknown, R = void> {
|
|
|
37
37
|
readonly isInitialUpdate: boolean;
|
|
38
38
|
useStyle(styleName: string, enabled?: boolean): void;
|
|
39
39
|
configureReactronic(options: Partial<MemberOptions>): MemberOptions;
|
|
40
|
+
hasMode(mode: Mode): boolean;
|
|
40
41
|
}
|
|
41
|
-
export interface
|
|
42
|
+
export interface ElNode<T = unknown, M = unknown, C = unknown, R = void> {
|
|
42
43
|
readonly key: string;
|
|
43
44
|
readonly driver: Driver<T>;
|
|
44
|
-
readonly builder: Readonly<
|
|
45
|
+
readonly builder: Readonly<ElBuilder<T, M, C, R>>;
|
|
45
46
|
readonly level: number;
|
|
46
|
-
readonly owner:
|
|
47
|
-
readonly host:
|
|
48
|
-
readonly children: MergeListReader<
|
|
49
|
-
readonly ties: MergeItem<
|
|
47
|
+
readonly owner: El;
|
|
48
|
+
readonly host: El;
|
|
49
|
+
readonly children: MergeListReader<El>;
|
|
50
|
+
readonly ties: MergeItem<El> | undefined;
|
|
50
51
|
readonly stamp: number;
|
|
51
|
-
readonly outer:
|
|
52
|
-
readonly context:
|
|
52
|
+
readonly outer: El;
|
|
53
|
+
readonly context: ElCtx | undefined;
|
|
53
54
|
}
|
|
54
|
-
export interface
|
|
55
|
-
base?:
|
|
55
|
+
export interface ElBuilder<T = unknown, M = unknown, C = unknown, R = void> {
|
|
56
|
+
base?: ElBuilder<T, M, C, R>;
|
|
56
57
|
key?: string;
|
|
57
58
|
mode?: Mode;
|
|
58
59
|
triggers?: unknown;
|
|
@@ -62,37 +63,37 @@ export interface BlockBuilder<T = unknown, M = unknown, C = unknown, R = void> {
|
|
|
62
63
|
update?: Delegate<T, M, C, R>;
|
|
63
64
|
finalize?: Delegate<T, M, C, R>;
|
|
64
65
|
}
|
|
65
|
-
export interface
|
|
66
|
+
export interface ElCtx<T extends Object = Object> {
|
|
66
67
|
value: T;
|
|
67
68
|
}
|
|
68
69
|
export interface Driver<T, C = unknown> {
|
|
69
70
|
readonly name: string;
|
|
70
71
|
readonly isRow: boolean;
|
|
71
72
|
readonly preset?: SimpleDelegate<T>;
|
|
72
|
-
claim(
|
|
73
|
-
create(
|
|
73
|
+
claim(element: El<T, unknown, C>): void;
|
|
74
|
+
create(element: El<T, unknown, C>, b: {
|
|
74
75
|
native?: T;
|
|
75
76
|
controller?: C;
|
|
76
77
|
}): void;
|
|
77
|
-
initialize(
|
|
78
|
-
mount(
|
|
79
|
-
update(
|
|
80
|
-
finalize(
|
|
81
|
-
applyKind(
|
|
82
|
-
applyCoords(
|
|
83
|
-
applyWidthGrowth(
|
|
84
|
-
applyMinWidth(
|
|
85
|
-
applyMaxWidth(
|
|
86
|
-
applyHeightGrowth(
|
|
87
|
-
applyMinHeight(
|
|
88
|
-
applyMaxHeight(
|
|
89
|
-
applyContentAlignment(
|
|
90
|
-
|
|
91
|
-
applyContentWrapping(
|
|
92
|
-
applyOverlayVisible(
|
|
93
|
-
applyStyle(
|
|
78
|
+
initialize(element: El<T, unknown, C>): void;
|
|
79
|
+
mount(element: El<T, unknown, C>, nativeHost?: T): void;
|
|
80
|
+
update(element: El<T, unknown, C>): void | Promise<void>;
|
|
81
|
+
finalize(element: El<T, unknown, C>, isLeader: boolean): boolean;
|
|
82
|
+
applyKind(element: El<T, any, C, any>, value: ElKind): void;
|
|
83
|
+
applyCoords(element: El<T, any, C, any>, value: ElCoords | undefined): void;
|
|
84
|
+
applyWidthGrowth(element: El<T, any, C, any>, value: number): void;
|
|
85
|
+
applyMinWidth(element: El<T, any, C, any>, value: string): void;
|
|
86
|
+
applyMaxWidth(element: El<T, any, C, any>, value: string): void;
|
|
87
|
+
applyHeightGrowth(element: El<T, any, C, any>, value: number): void;
|
|
88
|
+
applyMinHeight(element: El<T, any, C, any>, value: string): void;
|
|
89
|
+
applyMaxHeight(element: El<T, any, C, any>, value: string): void;
|
|
90
|
+
applyContentAlignment(element: El<T, any, C, any>, value: Align): void;
|
|
91
|
+
applyElementAlignment(element: El<T, any, C, any>, value: Align): void;
|
|
92
|
+
applyContentWrapping(element: El<T, any, C, any>, value: boolean): void;
|
|
93
|
+
applyOverlayVisible(element: El<T, any, C, any>, value: boolean | undefined): void;
|
|
94
|
+
applyStyle(element: El<T, any, C, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
94
95
|
}
|
|
95
|
-
export interface
|
|
96
|
+
export interface ElCoords {
|
|
96
97
|
x1: number;
|
|
97
98
|
y1: number;
|
|
98
99
|
x2: number;
|
|
@@ -128,7 +129,7 @@ export interface ElasticSize {
|
|
|
128
129
|
export interface TrackSize extends ElasticSize {
|
|
129
130
|
track?: string | number;
|
|
130
131
|
}
|
|
131
|
-
export type
|
|
132
|
+
export type ElArea = undefined | string | {
|
|
132
133
|
cellsOverWidth?: number;
|
|
133
134
|
cellsOverHeight?: number;
|
|
134
135
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(
|
|
1
|
+
export var ElKind;
|
|
2
|
+
(function (ElKind) {
|
|
3
|
+
ElKind[ElKind["Section"] = 0] = "Section";
|
|
4
|
+
ElKind[ElKind["Table"] = 1] = "Table";
|
|
5
|
+
ElKind[ElKind["Note"] = 2] = "Note";
|
|
6
|
+
ElKind[ElKind["Group"] = 3] = "Group";
|
|
7
|
+
ElKind[ElKind["Row"] = 4] = "Row";
|
|
8
|
+
ElKind[ElKind["Cursor"] = 5] = "Cursor";
|
|
9
|
+
ElKind[ElKind["Native"] = 6] = "Native";
|
|
10
|
+
})(ElKind || (ElKind = {}));
|
|
11
11
|
export var Priority;
|
|
12
12
|
(function (Priority) {
|
|
13
13
|
Priority[Priority["Realtime"] = 0] = "Realtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
1
|
+
import { ElCoords } from "./Interfaces.js";
|
|
2
|
+
export declare function parseElCoords(text: string, result: ElCoords): ElCoords;
|
|
3
|
+
export declare function emitElCoords(value: ElCoords): string;
|
|
4
4
|
export declare function emitLetters(n: number): string;
|
|
5
5
|
export declare function emitCellPosition(x: number, y: number): string;
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function equalElCoords(a: ElCoords, b: ElCoords): boolean;
|
|
7
7
|
export declare function objectHasMember<T>(obj: any, member: string): obj is T;
|
|
8
8
|
export declare function getCallerInfo(prefix: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function parseElCoords(text, result) {
|
|
2
2
|
let i = 0;
|
|
3
3
|
let value = 0;
|
|
4
4
|
let sign = 1;
|
|
@@ -129,7 +129,7 @@ export function parseBlockCoords(text, result) {
|
|
|
129
129
|
}
|
|
130
130
|
return result;
|
|
131
131
|
}
|
|
132
|
-
export function
|
|
132
|
+
export function emitElCoords(value) {
|
|
133
133
|
const p1 = emitCellPosition(value.x1, value.y1);
|
|
134
134
|
const p2 = emitCellPosition(value.x2, value.y2);
|
|
135
135
|
return `${p1}${p2 !== "" ? `:${p2}` : ""}`;
|
|
@@ -159,7 +159,7 @@ export function emitCellPosition(x, y) {
|
|
|
159
159
|
result = "";
|
|
160
160
|
return result;
|
|
161
161
|
}
|
|
162
|
-
export function
|
|
162
|
+
export function equalElCoords(a, b) {
|
|
163
163
|
return a.x1 === b.x1 && a.y1 === b.y1 && a.x2 === b.x2 && a.y1 === b.y2;
|
|
164
164
|
}
|
|
165
165
|
function isWhitespace(char) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { LoggingOptions } from "reactronic";
|
|
2
|
-
import {
|
|
2
|
+
import { ElCoords, ElKind, Priority, Align, ElBuilder, El, Driver, SimpleDelegate } from "./Interfaces.js";
|
|
3
3
|
export declare class Verstak {
|
|
4
4
|
static readonly shortFrameDuration = 16;
|
|
5
5
|
static readonly longFrameDuration = 300;
|
|
6
6
|
static currentUpdatePriority: Priority;
|
|
7
7
|
static frameDuration: number;
|
|
8
|
-
static claim<T = undefined, M = unknown, C = unknown, R = void>(driver: Driver<T>, builder?:
|
|
9
|
-
static get
|
|
10
|
-
static triggerUpdate(
|
|
8
|
+
static claim<T = undefined, M = unknown, C = unknown, R = void>(driver: Driver<T>, builder?: ElBuilder<T, M, C, R>, base?: ElBuilder<T, M, C, R>): El<T, M, C, R>;
|
|
9
|
+
static get element(): El;
|
|
10
|
+
static triggerUpdate(element: El<any, any, any, void>, triggers: unknown): void;
|
|
11
11
|
static updateNestedTreesThenDo(action: (error: unknown) => void): void;
|
|
12
12
|
static getDefaultLoggingOptions(): LoggingOptions | undefined;
|
|
13
13
|
static setDefaultLoggingOptions(logging?: LoggingOptions): void;
|
|
@@ -18,33 +18,33 @@ export declare class BaseDriver<T, C = unknown> implements Driver<T, C> {
|
|
|
18
18
|
readonly preset?: SimpleDelegate<T> | undefined;
|
|
19
19
|
static readonly fragment: BaseDriver<any, unknown>;
|
|
20
20
|
constructor(name: string, isRow: boolean, preset?: SimpleDelegate<T> | undefined);
|
|
21
|
-
claim(
|
|
22
|
-
create(
|
|
21
|
+
claim(element: El<T, unknown, C>): void;
|
|
22
|
+
create(element: El<T, unknown, C>, result: {
|
|
23
23
|
native?: T;
|
|
24
24
|
controller?: C;
|
|
25
25
|
}): void;
|
|
26
|
-
initialize(
|
|
27
|
-
mount(
|
|
28
|
-
update(
|
|
29
|
-
finalize(
|
|
30
|
-
applyKind(
|
|
31
|
-
applyCoords(
|
|
32
|
-
applyWidthGrowth(
|
|
33
|
-
applyMinWidth(
|
|
34
|
-
applyMaxWidth(
|
|
35
|
-
applyHeightGrowth(
|
|
36
|
-
applyMinHeight(
|
|
37
|
-
applyMaxHeight(
|
|
38
|
-
applyContentAlignment(
|
|
39
|
-
|
|
40
|
-
applyContentWrapping(
|
|
41
|
-
applyOverlayVisible(
|
|
42
|
-
applyStyle(
|
|
26
|
+
initialize(element: El<T, unknown, C>): void;
|
|
27
|
+
mount(element: El<T, unknown, C>, nativeHost?: T): void;
|
|
28
|
+
update(element: El<T, unknown, C>): void | Promise<void>;
|
|
29
|
+
finalize(element: El<T, unknown, C>, isLeader: boolean): boolean;
|
|
30
|
+
applyKind(element: El<T, any, C, any>, value: ElKind): void;
|
|
31
|
+
applyCoords(element: El<T, any, C, any>, value: ElCoords | undefined): void;
|
|
32
|
+
applyWidthGrowth(element: El<T, any, C, any>, value: number): void;
|
|
33
|
+
applyMinWidth(element: El<T, any, C, any>, value: string): void;
|
|
34
|
+
applyMaxWidth(element: El<T, any, C, any>, value: string): void;
|
|
35
|
+
applyHeightGrowth(element: El<T, any, C, any>, value: number): void;
|
|
36
|
+
applyMinHeight(element: El<T, any, C, any>, value: string): void;
|
|
37
|
+
applyMaxHeight(element: El<T, any, C, any>, value: string): void;
|
|
38
|
+
applyContentAlignment(element: El<T, any, C, any>, value: Align): void;
|
|
39
|
+
applyElementAlignment(element: El<T, any, C, any>, value: Align): void;
|
|
40
|
+
applyContentWrapping(element: El<T, any, C, any>, value: boolean): void;
|
|
41
|
+
applyOverlayVisible(element: El<T, any, C, any>, value: boolean | undefined): void;
|
|
42
|
+
applyStyle(element: El<T, any, C, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
43
43
|
}
|
|
44
44
|
export declare class StaticDriver<T> extends BaseDriver<T> {
|
|
45
|
-
readonly
|
|
46
|
-
constructor(
|
|
47
|
-
create(
|
|
45
|
+
readonly native: T;
|
|
46
|
+
constructor(native: T, name: string, isRow: boolean, preset?: SimpleDelegate<T>);
|
|
47
|
+
create(element: El<T, unknown, unknown, void>, result: {
|
|
48
48
|
native?: T;
|
|
49
49
|
controller?: unknown;
|
|
50
50
|
}): void;
|
|
@@ -56,7 +56,7 @@ export declare class CursorCommand {
|
|
|
56
56
|
}
|
|
57
57
|
export declare class CursorCommandDriver extends BaseDriver<CursorCommand, void> {
|
|
58
58
|
constructor();
|
|
59
|
-
create(
|
|
59
|
+
create(element: El<CursorCommand, unknown, void, void>, result: {
|
|
60
60
|
native?: CursorCommand;
|
|
61
61
|
controller?: void;
|
|
62
62
|
}): void;
|