verstak 0.23.120 → 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.
@@ -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> = (block: Block<T, M, C, R>, base: () => R) => R;
4
- export type AsyncDelegate<T = unknown, M = unknown> = (block: Block<T, M, Promise<void>>) => Promise<void>;
5
- export type SimpleDelegate<T = unknown> = (block: Block<T, any, any, any>) => void;
6
- export declare enum BlockKind {
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 Block<T = unknown, M = unknown, C = unknown, R = void> {
16
- readonly node: BlockNode<T, M, C, R>;
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: BlockKind;
23
- area: BlockArea;
22
+ kind: ElKind;
23
+ area: ElArea;
24
24
  widthGrowth: number;
25
25
  minWidth: string;
26
26
  maxWidth: string;
@@ -28,71 +28,72 @@ export interface Block<T = unknown, M = unknown, C = unknown, R = void> {
28
28
  minHeight: string;
29
29
  maxHeight: string;
30
30
  contentAlignment: Align;
31
- blockAlignment: Align;
31
+ elementAlignment: Align;
32
32
  contentWrapping: boolean;
33
33
  overlayVisible: boolean | undefined;
34
- rebuildPriority?: Priority;
34
+ updatePriority?: Priority;
35
35
  childrenShuffling: boolean;
36
36
  strictOrder: boolean;
37
- readonly isInitialRebuild: boolean;
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 BlockNode<T = unknown, M = unknown, C = unknown, R = void> {
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<BlockBuilder<T, M, C, R>>;
45
+ readonly builder: Readonly<ElBuilder<T, M, C, R>>;
45
46
  readonly level: number;
46
- readonly owner: Block;
47
- readonly host: Block;
48
- readonly children: MergeListReader<Block>;
49
- readonly ties: MergeItem<Block> | undefined;
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: Block;
52
- readonly context: BlockCtx | undefined;
52
+ readonly outer: El;
53
+ readonly context: ElCtx | undefined;
53
54
  }
54
- export interface BlockBuilder<T = unknown, M = unknown, C = unknown, R = void> {
55
- base?: BlockBuilder<T, M, C, R>;
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;
59
60
  claim?: Delegate<T, M, C, R>;
60
61
  create?: Delegate<T, M, C, R>;
61
62
  initialize?: Delegate<T, M, C, R>;
62
- rebuild?: Delegate<T, M, C, R>;
63
+ update?: Delegate<T, M, C, R>;
63
64
  finalize?: Delegate<T, M, C, R>;
64
65
  }
65
- export interface BlockCtx<T extends Object = Object> {
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(block: Block<T, unknown, C>): void;
73
- create(block: Block<T, unknown, C>, b: {
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(block: Block<T, unknown, C>): void;
78
- mount(block: Block<T, unknown, C>): void;
79
- rebuild(block: Block<T, unknown, C>): void | Promise<void>;
80
- finalize(block: Block<T, unknown, C>, isLeader: boolean): boolean;
81
- applyKind(block: Block<T, any, C, any>, value: BlockKind): void;
82
- applyCoords(block: Block<T, any, C, any>, value: BlockCoords | undefined): void;
83
- applyWidthGrowth(block: Block<T, any, C, any>, value: number): void;
84
- applyMinWidth(block: Block<T, any, C, any>, value: string): void;
85
- applyMaxWidth(block: Block<T, any, C, any>, value: string): void;
86
- applyHeightGrowth(block: Block<T, any, C, any>, value: number): void;
87
- applyMinHeight(block: Block<T, any, C, any>, value: string): void;
88
- applyMaxHeight(block: Block<T, any, C, any>, value: string): void;
89
- applyContentAlignment(block: Block<T, any, C, any>, value: Align): void;
90
- applyBlockAlignment(block: Block<T, any, C, any>, value: Align): void;
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;
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 BlockCoords {
96
+ export interface ElCoords {
96
97
  x1: number;
97
98
  y1: number;
98
99
  x2: number;
@@ -105,7 +106,7 @@ export declare const enum Priority {
105
106
  }
106
107
  export declare enum Mode {
107
108
  Default = 0,
108
- PinpointRebuild = 1,
109
+ PinpointUpdate = 1,
109
110
  ManualMount = 2
110
111
  }
111
112
  export declare enum Align {
@@ -128,7 +129,7 @@ export interface ElasticSize {
128
129
  export interface TrackSize extends ElasticSize {
129
130
  track?: string | number;
130
131
  }
131
- export type BlockArea = undefined | string | {
132
+ export type ElArea = undefined | string | {
132
133
  cellsOverWidth?: number;
133
134
  cellsOverHeight?: number;
134
135
  };
@@ -1,13 +1,13 @@
1
- export var BlockKind;
2
- (function (BlockKind) {
3
- BlockKind[BlockKind["Section"] = 0] = "Section";
4
- BlockKind[BlockKind["Table"] = 1] = "Table";
5
- BlockKind[BlockKind["Note"] = 2] = "Note";
6
- BlockKind[BlockKind["Group"] = 3] = "Group";
7
- BlockKind[BlockKind["Row"] = 4] = "Row";
8
- BlockKind[BlockKind["Cursor"] = 5] = "Cursor";
9
- BlockKind[BlockKind["Native"] = 6] = "Native";
10
- })(BlockKind || (BlockKind = {}));
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";
@@ -17,7 +17,7 @@ export var Priority;
17
17
  export var Mode;
18
18
  (function (Mode) {
19
19
  Mode[Mode["Default"] = 0] = "Default";
20
- Mode[Mode["PinpointRebuild"] = 1] = "PinpointRebuild";
20
+ Mode[Mode["PinpointUpdate"] = 1] = "PinpointUpdate";
21
21
  Mode[Mode["ManualMount"] = 2] = "ManualMount";
22
22
  })(Mode || (Mode = {}));
23
23
  export var Align;
@@ -1,8 +1,8 @@
1
- import { BlockCoords } from "./Interfaces.js";
2
- export declare function parseBlockCoords(text: string, result: BlockCoords): BlockCoords;
3
- export declare function emitBlockCoords(value: BlockCoords): string;
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 equalBlockCoords(a: BlockCoords, b: BlockCoords): boolean;
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 parseBlockCoords(text, result) {
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 emitBlockCoords(value) {
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 equalBlockCoords(a, b) {
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) {
@@ -187,7 +187,7 @@ export function getCallerInfo(prefix) {
187
187
  i = i >= 0 ? i + 2 : 5;
188
188
  let caller = extractFunctionAndLocation(lines[i]);
189
189
  let location = caller;
190
- if (caller.func.endsWith(".rebuild")) {
190
+ if (caller.func.endsWith(".update")) {
191
191
  i = i - 1;
192
192
  caller = extractFunctionAndLocation(lines[i]);
193
193
  location = extractFunctionAndLocation(lines[i + 1]);
@@ -1,14 +1,14 @@
1
1
  import { LoggingOptions } from "reactronic";
2
- import { BlockCoords, BlockKind, Priority, Align, BlockBuilder, Block, Driver, SimpleDelegate } from "./Interfaces.js";
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
- static currentRebuildPriority: Priority;
6
+ static currentUpdatePriority: Priority;
7
7
  static frameDuration: number;
8
- static claim<T = undefined, M = unknown, C = unknown, R = void>(driver: Driver<T>, builder?: BlockBuilder<T, M, C, R>, base?: BlockBuilder<T, M, C, R>): Block<T, M, C, R>;
9
- static get block(): Block;
10
- static triggerRebuild(block: Block<any, any, any, void>, triggers: unknown): void;
11
- static rebuildNestedTreesThenDo(action: (error: unknown) => void): void;
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
+ static updateNestedTreesThenDo(action: (error: unknown) => void): void;
12
12
  static getDefaultLoggingOptions(): LoggingOptions | undefined;
13
13
  static setDefaultLoggingOptions(logging?: LoggingOptions): void;
14
14
  }
@@ -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(block: Block<T, unknown, C>): void;
22
- create(block: Block<T, unknown, C>, b: {
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(block: Block<T, unknown, C>): void;
27
- mount(block: Block<T, unknown, C>): void;
28
- rebuild(block: Block<T, unknown, C>): void | Promise<void>;
29
- finalize(block: Block<T, unknown, C>, isLeader: boolean): boolean;
30
- applyKind(block: Block<T, any, C, any>, value: BlockKind): void;
31
- applyCoords(block: Block<T, any, C, any>, value: BlockCoords | undefined): void;
32
- applyWidthGrowth(block: Block<T, any, C, any>, value: number): void;
33
- applyMinWidth(block: Block<T, any, C, any>, value: string): void;
34
- applyMaxWidth(block: Block<T, any, C, any>, value: string): void;
35
- applyHeightGrowth(block: Block<T, any, C, any>, value: number): void;
36
- applyMinHeight(block: Block<T, any, C, any>, value: string): void;
37
- applyMaxHeight(block: Block<T, any, C, any>, value: string): void;
38
- applyContentAlignment(block: Block<T, any, C, any>, value: Align): void;
39
- applyBlockAlignment(block: Block<T, any, C, any>, value: Align): void;
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;
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 element: T;
46
- constructor(element: T, name: string, isRow: boolean, preset?: SimpleDelegate<T>);
47
- create(block: Block<T, unknown, unknown, void>, b: {
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(block: Block<CursorCommand, unknown, void, void>, b: {
59
+ create(element: El<CursorCommand, unknown, void, void>, result: {
60
60
  native?: CursorCommand;
61
61
  controller?: void;
62
62
  }): void;