verstak 0.23.121 → 0.23.123
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 +55 -57
- 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 +4 -4
- package/build/dist/source/core/Verstak.d.ts +30 -39
- package/build/dist/source/core/Verstak.js +291 -289
- package/build/dist/source/html/Elements.d.ts +27 -0
- package/build/dist/source/html/{Blocks.js → Elements.js} +76 -76
- package/build/dist/source/html/HtmlDriver.d.ts +11 -20
- package/build/dist/source/html/HtmlDriver.js +48 -48
- package/build/dist/source/html/HtmlElements.d.ts +175 -0
- package/build/dist/source/html/HtmlElements.js +356 -0
- 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 +8 -8
- package/build/dist/source/html/Blocks.d.ts +0 -27
- package/build/dist/source/html/HtmlBlocks.d.ts +0 -175
- package/build/dist/source/html/HtmlBlocks.js +0 -356
|
@@ -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
|
|
4
|
-
export type AsyncDelegate<T = unknown, M = unknown> = (
|
|
5
|
-
export type SimpleDelegate<T = unknown> = (
|
|
6
|
-
export declare enum
|
|
3
|
+
export type Delegate<T> = (element: T, base: () => void) => void;
|
|
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:
|
|
17
|
-
readonly native: T;
|
|
15
|
+
export interface El<T = unknown, M = unknown, C = unknown, R = void> {
|
|
16
|
+
readonly node: RxNode<T, M, C, R>;
|
|
18
17
|
readonly isSection: boolean;
|
|
19
18
|
readonly isTable: boolean;
|
|
19
|
+
native: T;
|
|
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,71 +28,69 @@ 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
|
-
updatePriority?: Priority;
|
|
35
|
-
childrenShuffling: boolean;
|
|
36
|
-
strictOrder: boolean;
|
|
37
|
-
readonly isInitialUpdate: boolean;
|
|
38
34
|
useStyle(styleName: string, enabled?: boolean): void;
|
|
39
35
|
configureReactronic(options: Partial<MemberOptions>): MemberOptions;
|
|
40
36
|
}
|
|
41
|
-
export interface
|
|
37
|
+
export interface RxNode<T = unknown, M = unknown, C = unknown, R = void> {
|
|
42
38
|
readonly key: string;
|
|
43
|
-
readonly driver:
|
|
44
|
-
readonly
|
|
39
|
+
readonly driver: RxNodeDriver<T>;
|
|
40
|
+
readonly spec: Readonly<RxNodeSpec<El<T, M, C, R>>>;
|
|
45
41
|
readonly level: number;
|
|
46
|
-
readonly owner:
|
|
47
|
-
readonly host:
|
|
48
|
-
readonly children: MergeListReader<
|
|
49
|
-
readonly
|
|
42
|
+
readonly owner: RxNode;
|
|
43
|
+
readonly host: RxNode;
|
|
44
|
+
readonly children: MergeListReader<El>;
|
|
45
|
+
readonly slot: MergeItem<El> | undefined;
|
|
50
46
|
readonly stamp: number;
|
|
51
|
-
readonly outer:
|
|
52
|
-
readonly context:
|
|
47
|
+
readonly outer: RxNode;
|
|
48
|
+
readonly context: RxNodeCtx | undefined;
|
|
49
|
+
readonly isInitialUpdate: boolean;
|
|
50
|
+
priority?: Priority;
|
|
51
|
+
childrenShuffling: boolean;
|
|
52
|
+
strictOrder: boolean;
|
|
53
|
+
has(mode: Mode): boolean;
|
|
53
54
|
}
|
|
54
|
-
export interface
|
|
55
|
-
base?:
|
|
55
|
+
export interface RxNodeSpec<T = unknown> {
|
|
56
|
+
base?: RxNodeSpec<T>;
|
|
56
57
|
key?: string;
|
|
57
58
|
mode?: Mode;
|
|
58
59
|
triggers?: unknown;
|
|
59
|
-
|
|
60
|
-
create?: Delegate<T
|
|
61
|
-
initialize?: Delegate<T
|
|
62
|
-
update?: Delegate<T
|
|
63
|
-
finalize?: Delegate<T
|
|
60
|
+
specify?: Delegate<T>;
|
|
61
|
+
create?: Delegate<T>;
|
|
62
|
+
initialize?: Delegate<T>;
|
|
63
|
+
update?: Delegate<T>;
|
|
64
|
+
finalize?: Delegate<T>;
|
|
64
65
|
}
|
|
65
|
-
export interface
|
|
66
|
+
export interface RxNodeCtx<T extends Object = Object> {
|
|
66
67
|
value: T;
|
|
67
68
|
}
|
|
68
|
-
export interface
|
|
69
|
+
export interface RxNodeDriver<T, C = unknown> {
|
|
69
70
|
readonly name: string;
|
|
70
|
-
readonly
|
|
71
|
+
readonly isSeparator: boolean;
|
|
71
72
|
readonly preset?: SimpleDelegate<T>;
|
|
72
|
-
|
|
73
|
-
create(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
applyContentWrapping(block: Block<T, any, C, any>, value: boolean): void;
|
|
92
|
-
applyOverlayVisible(block: Block<T, any, C, any>, value: boolean | undefined): void;
|
|
93
|
-
applyStyle(block: Block<T, any, C, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
73
|
+
specify(element: El<T, unknown, C>): void;
|
|
74
|
+
create(element: El<T, unknown, C>): void;
|
|
75
|
+
initialize(element: El<T, unknown, C>): void;
|
|
76
|
+
mount(element: El<T, unknown, C>): void;
|
|
77
|
+
update(element: El<T, unknown, C>): void | Promise<void>;
|
|
78
|
+
finalize(element: El<T, unknown, C>, isLeader: boolean): boolean;
|
|
79
|
+
applyKind(element: El<T, any, C, any>, value: ElKind): void;
|
|
80
|
+
applyCoords(element: El<T, any, C, any>, value: ElCoords | undefined): void;
|
|
81
|
+
applyWidthGrowth(element: El<T, any, C, any>, value: number): void;
|
|
82
|
+
applyMinWidth(element: El<T, any, C, any>, value: string): void;
|
|
83
|
+
applyMaxWidth(element: El<T, any, C, any>, value: string): void;
|
|
84
|
+
applyHeightGrowth(element: El<T, any, C, any>, value: number): void;
|
|
85
|
+
applyMinHeight(element: El<T, any, C, any>, value: string): void;
|
|
86
|
+
applyMaxHeight(element: El<T, any, C, any>, value: string): void;
|
|
87
|
+
applyContentAlignment(element: El<T, any, C, any>, value: Align): void;
|
|
88
|
+
applyElementAlignment(element: El<T, any, C, any>, value: Align): void;
|
|
89
|
+
applyContentWrapping(element: El<T, any, C, any>, value: boolean): void;
|
|
90
|
+
applyOverlayVisible(element: El<T, any, C, any>, value: boolean | undefined): void;
|
|
91
|
+
applyStyle(element: El<T, any, C, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
94
92
|
}
|
|
95
|
-
export interface
|
|
93
|
+
export interface ElCoords {
|
|
96
94
|
x1: number;
|
|
97
95
|
y1: number;
|
|
98
96
|
x2: number;
|
|
@@ -128,7 +126,7 @@ export interface ElasticSize {
|
|
|
128
126
|
export interface TrackSize extends ElasticSize {
|
|
129
127
|
track?: string | number;
|
|
130
128
|
}
|
|
131
|
-
export type
|
|
129
|
+
export type ElArea = undefined | string | {
|
|
132
130
|
cellsOverWidth?: number;
|
|
133
131
|
cellsOverHeight?: number;
|
|
134
132
|
};
|
|
@@ -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) {
|
|
@@ -183,7 +183,7 @@ export function getCallerInfo(prefix) {
|
|
|
183
183
|
const stack = error.stack || "";
|
|
184
184
|
Error.stackTraceLimit = restore;
|
|
185
185
|
const lines = stack.split("\n");
|
|
186
|
-
let i = lines.findIndex(x => x.indexOf(".
|
|
186
|
+
let i = lines.findIndex(x => x.indexOf(".specify") >= 0);
|
|
187
187
|
i = i >= 0 ? i + 2 : 5;
|
|
188
188
|
let caller = extractFunctionAndLocation(lines[i]);
|
|
189
189
|
let location = caller;
|
|
@@ -1,53 +1,47 @@
|
|
|
1
1
|
import { LoggingOptions } from "reactronic";
|
|
2
|
-
import {
|
|
2
|
+
import { ElCoords, ElKind, Priority, Align, RxNodeSpec, El, RxNodeDriver, 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
|
|
9
|
-
static get
|
|
10
|
-
static triggerUpdate(
|
|
8
|
+
static specify<T = undefined, M = unknown, C = unknown, R = void>(driver: RxNodeDriver<T>, spec?: RxNodeSpec<El<T, M, C, R>>, base?: RxNodeSpec<El<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;
|
|
14
14
|
}
|
|
15
|
-
export declare class BaseDriver<T, C = unknown> implements
|
|
15
|
+
export declare class BaseDriver<T, C = unknown> implements RxNodeDriver<T, C> {
|
|
16
16
|
readonly name: string;
|
|
17
|
-
readonly
|
|
17
|
+
readonly isSeparator: boolean;
|
|
18
18
|
readonly preset?: SimpleDelegate<T> | undefined;
|
|
19
19
|
static readonly fragment: BaseDriver<any, unknown>;
|
|
20
|
-
constructor(name: string,
|
|
21
|
-
|
|
22
|
-
create(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
applyContentWrapping(block: Block<T, any, C, any>, value: boolean): void;
|
|
41
|
-
applyOverlayVisible(block: Block<T, any, C, any>, value: boolean | undefined): void;
|
|
42
|
-
applyStyle(block: Block<T, any, C, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
20
|
+
constructor(name: string, isSeparator: boolean, preset?: SimpleDelegate<T> | undefined);
|
|
21
|
+
specify(element: El<T, unknown, C>): void;
|
|
22
|
+
create(element: El<T, unknown, C>): void;
|
|
23
|
+
initialize(element: El<T, unknown, C>): void;
|
|
24
|
+
mount(element: El<T, unknown, C>): void;
|
|
25
|
+
update(element: El<T, unknown, C>): void | Promise<void>;
|
|
26
|
+
finalize(element: El<T, unknown, C>, isLeader: boolean): boolean;
|
|
27
|
+
applyKind(element: El<T, any, C, any>, value: ElKind): void;
|
|
28
|
+
applyCoords(element: El<T, any, C, any>, value: ElCoords | undefined): void;
|
|
29
|
+
applyWidthGrowth(element: El<T, any, C, any>, value: number): void;
|
|
30
|
+
applyMinWidth(element: El<T, any, C, any>, value: string): void;
|
|
31
|
+
applyMaxWidth(element: El<T, any, C, any>, value: string): void;
|
|
32
|
+
applyHeightGrowth(element: El<T, any, C, any>, value: number): void;
|
|
33
|
+
applyMinHeight(element: El<T, any, C, any>, value: string): void;
|
|
34
|
+
applyMaxHeight(element: El<T, any, C, any>, value: string): void;
|
|
35
|
+
applyContentAlignment(element: El<T, any, C, any>, value: Align): void;
|
|
36
|
+
applyElementAlignment(element: El<T, any, C, any>, value: Align): void;
|
|
37
|
+
applyContentWrapping(element: El<T, any, C, any>, value: boolean): void;
|
|
38
|
+
applyOverlayVisible(element: El<T, any, C, any>, value: boolean | undefined): void;
|
|
39
|
+
applyStyle(element: El<T, any, C, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
43
40
|
}
|
|
44
41
|
export declare class StaticDriver<T> extends BaseDriver<T> {
|
|
45
|
-
readonly
|
|
46
|
-
constructor(
|
|
47
|
-
create(
|
|
48
|
-
native?: T;
|
|
49
|
-
controller?: unknown;
|
|
50
|
-
}): void;
|
|
42
|
+
readonly native: T;
|
|
43
|
+
constructor(native: T, name: string, isRow: boolean, preset?: SimpleDelegate<T>);
|
|
44
|
+
create(element: El<T, unknown, unknown, void>): void;
|
|
51
45
|
}
|
|
52
46
|
export declare class CursorCommand {
|
|
53
47
|
absolute?: string;
|
|
@@ -56,10 +50,7 @@ export declare class CursorCommand {
|
|
|
56
50
|
}
|
|
57
51
|
export declare class CursorCommandDriver extends BaseDriver<CursorCommand, void> {
|
|
58
52
|
constructor();
|
|
59
|
-
create(
|
|
60
|
-
native?: CursorCommand;
|
|
61
|
-
controller?: void;
|
|
62
|
-
}): void;
|
|
53
|
+
create(element: El<CursorCommand, unknown, void, void>): void;
|
|
63
54
|
}
|
|
64
55
|
export declare class SubTreeVariable<T extends Object = Object> {
|
|
65
56
|
readonly defaultValue: T | undefined;
|