verstak 0.23.106 → 0.23.107
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/archive/RxDomV1.js +4 -3
- package/build/dist/source/core/Cursor.d.ts +10 -9
- package/build/dist/source/core/Cursor.js +15 -19
- package/build/dist/source/core/VBlock.d.ts +57 -49
- package/build/dist/source/core/VBlock.js +151 -118
- package/build/dist/source/html/Blocks.d.ts +22 -21
- package/build/dist/source/html/Blocks.js +146 -75
- package/build/dist/source/html/HtmlBlocks.d.ts +175 -175
- package/build/dist/source/html/HtmlBlocks.js +350 -350
- package/build/dist/source/html/HtmlDriver.d.ts +20 -12
- package/build/dist/source/html/HtmlDriver.js +15 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# **Verstak** - Experimental Front-End Library
|
|
7
7
|
|
|
8
8
|
Verstak is an experimental JavaScript library that provides
|
|
9
|
-
|
|
9
|
+
chain-based an table-based layouts with
|
|
10
10
|
[transactional reactive](https://blog.nezaboodka.com/post/2019/593-modern-database-should-natively-support-transactionally-reactive-programming)
|
|
11
11
|
facilities for building front-end applications.
|
|
12
12
|
|
|
@@ -33,18 +33,19 @@ export class BasicNodeType {
|
|
|
33
33
|
throw new Error("element must be initialized before rendering");
|
|
34
34
|
if (inst.buffer)
|
|
35
35
|
throw new Error("rendering re-entrance is not supported yet");
|
|
36
|
+
const native = inst.native;
|
|
36
37
|
inst.buffer = [];
|
|
37
38
|
let result;
|
|
38
39
|
if (node.superRender)
|
|
39
40
|
result = node.superRender(options => {
|
|
40
|
-
const res = node.render(
|
|
41
|
+
const res = node.render(native, options);
|
|
41
42
|
if (res instanceof Promise)
|
|
42
43
|
return res.then();
|
|
43
44
|
else
|
|
44
45
|
return options;
|
|
45
|
-
},
|
|
46
|
+
}, native);
|
|
46
47
|
else
|
|
47
|
-
result = node.render(
|
|
48
|
+
result = node.render(native, args);
|
|
48
49
|
if (result instanceof Promise)
|
|
49
50
|
result = result.then(value => { RxDom.renderChildrenThenDo(NOP); return value; }, error => { console.log(error); RxDom.renderChildrenThenDo(NOP); });
|
|
50
51
|
else
|
|
@@ -2,12 +2,13 @@ import { CellRange } from "./CellRange";
|
|
|
2
2
|
export declare enum Align {
|
|
3
3
|
Stretch = 0,
|
|
4
4
|
Left = 1,
|
|
5
|
-
|
|
5
|
+
CenterX = 2,
|
|
6
6
|
Right = 3,
|
|
7
7
|
Top = 4,
|
|
8
|
-
|
|
8
|
+
CenterY = 8,
|
|
9
9
|
Bottom = 12,
|
|
10
|
-
Default = 16
|
|
10
|
+
Default = 16,
|
|
11
|
+
Center = 10
|
|
11
12
|
}
|
|
12
13
|
export interface ElasticSize {
|
|
13
14
|
cells?: number;
|
|
@@ -18,7 +19,7 @@ export interface ElasticSize {
|
|
|
18
19
|
export interface TrackSize extends ElasticSize {
|
|
19
20
|
track?: string | number;
|
|
20
21
|
}
|
|
21
|
-
export type
|
|
22
|
+
export type Placement = undefined | string | {
|
|
22
23
|
widthInCells?: number;
|
|
23
24
|
heightInCells?: number;
|
|
24
25
|
widthOverlap?: boolean;
|
|
@@ -32,10 +33,10 @@ export declare class Cursor {
|
|
|
32
33
|
y2: 0;
|
|
33
34
|
}>;
|
|
34
35
|
reset(): void;
|
|
35
|
-
onwards(
|
|
36
|
-
|
|
36
|
+
onwards(placement: Placement): CellRange;
|
|
37
|
+
rowBreak(): void;
|
|
37
38
|
}
|
|
38
|
-
export declare class
|
|
39
|
+
export declare class TableCursor extends Cursor {
|
|
39
40
|
private maxColumnCount;
|
|
40
41
|
private maxRowCount;
|
|
41
42
|
private actualColumnCount;
|
|
@@ -44,6 +45,6 @@ export declare class GridCursor extends Cursor {
|
|
|
44
45
|
private rowCursor;
|
|
45
46
|
private newRowCursor;
|
|
46
47
|
reset(): void;
|
|
47
|
-
onwards(
|
|
48
|
-
|
|
48
|
+
onwards(placement: Placement): CellRange;
|
|
49
|
+
rowBreak(): void;
|
|
49
50
|
}
|
|
@@ -3,20 +3,21 @@ export var Align;
|
|
|
3
3
|
(function (Align) {
|
|
4
4
|
Align[Align["Stretch"] = 0] = "Stretch";
|
|
5
5
|
Align[Align["Left"] = 1] = "Left";
|
|
6
|
-
Align[Align["
|
|
6
|
+
Align[Align["CenterX"] = 2] = "CenterX";
|
|
7
7
|
Align[Align["Right"] = 3] = "Right";
|
|
8
8
|
Align[Align["Top"] = 4] = "Top";
|
|
9
|
-
Align[Align["
|
|
9
|
+
Align[Align["CenterY"] = 8] = "CenterY";
|
|
10
10
|
Align[Align["Bottom"] = 12] = "Bottom";
|
|
11
11
|
Align[Align["Default"] = 16] = "Default";
|
|
12
|
+
Align[Align["Center"] = 10] = "Center";
|
|
12
13
|
})(Align || (Align = {}));
|
|
13
14
|
export class Cursor {
|
|
14
15
|
reset() { }
|
|
15
|
-
onwards(
|
|
16
|
-
|
|
16
|
+
onwards(placement) { return Cursor.UndefinedCellRange; }
|
|
17
|
+
rowBreak() { }
|
|
17
18
|
}
|
|
18
19
|
Cursor.UndefinedCellRange = Object.freeze({ x1: 0, y1: 0, x2: 0, y2: 0 });
|
|
19
|
-
export class
|
|
20
|
+
export class TableCursor extends Cursor {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
22
23
|
this.maxColumnCount = 0;
|
|
@@ -36,11 +37,11 @@ export class GridCursor extends Cursor {
|
|
|
36
37
|
this.rowCursor = 0;
|
|
37
38
|
this.newRowCursor = 0;
|
|
38
39
|
}
|
|
39
|
-
onwards(
|
|
40
|
+
onwards(placement) {
|
|
40
41
|
var _a, _b, _c, _d;
|
|
41
42
|
let result;
|
|
42
|
-
if (typeof (
|
|
43
|
-
result = parseCellRange(
|
|
43
|
+
if (typeof (placement) === "string") {
|
|
44
|
+
result = parseCellRange(placement, { x1: 0, y1: 0, x2: 0, y2: 0 });
|
|
44
45
|
absolutizeCellRange(result, this.columnCursor + 1, this.rowCursor + 1, this.maxColumnCount || Infinity, this.maxRowCount || Infinity, result);
|
|
45
46
|
}
|
|
46
47
|
else {
|
|
@@ -48,16 +49,11 @@ export class GridCursor extends Cursor {
|
|
|
48
49
|
let h;
|
|
49
50
|
let wOverlap;
|
|
50
51
|
let hOverlap;
|
|
51
|
-
if (
|
|
52
|
-
w =
|
|
53
|
-
h = 1;
|
|
54
|
-
wOverlap =
|
|
55
|
-
|
|
56
|
-
else if (bounds) {
|
|
57
|
-
w = (_a = bounds.widthInCells) !== null && _a !== void 0 ? _a : 1;
|
|
58
|
-
h = (_b = bounds.heightInCells) !== null && _b !== void 0 ? _b : 1;
|
|
59
|
-
wOverlap = (_c = bounds.widthOverlap) !== null && _c !== void 0 ? _c : false;
|
|
60
|
-
hOverlap = (_d = bounds.heightOverlap) !== null && _d !== void 0 ? _d : false;
|
|
52
|
+
if (placement) {
|
|
53
|
+
w = (_a = placement.widthInCells) !== null && _a !== void 0 ? _a : 1;
|
|
54
|
+
h = (_b = placement.heightInCells) !== null && _b !== void 0 ? _b : 1;
|
|
55
|
+
wOverlap = (_c = placement.widthOverlap) !== null && _c !== void 0 ? _c : false;
|
|
56
|
+
hOverlap = (_d = placement.heightOverlap) !== null && _d !== void 0 ? _d : false;
|
|
61
57
|
}
|
|
62
58
|
else {
|
|
63
59
|
w = 1;
|
|
@@ -94,7 +90,7 @@ export class GridCursor extends Cursor {
|
|
|
94
90
|
}
|
|
95
91
|
return result;
|
|
96
92
|
}
|
|
97
|
-
|
|
93
|
+
rowBreak() {
|
|
98
94
|
this.columnCursor = 0;
|
|
99
95
|
this.rowCursor = this.newRowCursor;
|
|
100
96
|
}
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
import { LoggingOptions, Item, CollectionReader, MemberOptions } from "reactronic";
|
|
2
2
|
import { CellRange } from "./CellRange";
|
|
3
|
-
import {
|
|
3
|
+
import { Align, Placement } from "./Cursor";
|
|
4
4
|
export type Callback<T = unknown> = (native: T) => void;
|
|
5
|
-
export type Operation<T = unknown, M = unknown, R = void> = (block: VBlock<T, M, R>, base: () => R) => R;
|
|
5
|
+
export type Operation<T = unknown, M = unknown, C = unknown, R = void> = (block: VBlock<T, M, C, R>, base: () => R) => R;
|
|
6
6
|
export type AsyncOperation<T = unknown, M = unknown> = (block: VBlock<T, M, Promise<void>>) => Promise<void>;
|
|
7
|
+
export type SimpleOperation<T = unknown> = (block: VBlock<T, any, any, any>) => void;
|
|
7
8
|
export declare const enum Priority {
|
|
8
9
|
Realtime = 0,
|
|
9
10
|
Normal = 1,
|
|
10
11
|
Background = 2
|
|
11
12
|
}
|
|
12
|
-
export interface
|
|
13
|
-
base?:
|
|
13
|
+
export interface BlockBuilder<T = unknown, M = unknown, C = unknown, R = void> {
|
|
14
|
+
base?: BlockBuilder<T, M, C, R>;
|
|
14
15
|
key?: string;
|
|
15
16
|
reaction?: boolean;
|
|
16
17
|
triggers?: unknown;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
claim?: Operation<T, M, C, R>;
|
|
19
|
+
initialize?: Operation<T, M, C, R>;
|
|
20
|
+
render?: Operation<T, M, C, R>;
|
|
21
|
+
finalize?: Operation<T, M, C, R>;
|
|
20
22
|
}
|
|
21
|
-
export declare function Fragment<M = unknown, R = void>(
|
|
22
|
-
export declare abstract class VBlock<T = unknown, M = unknown, R = void> {
|
|
23
|
+
export declare function Fragment<M = unknown, R = void>(builder?: BlockBuilder<void, M, R>, base?: BlockBuilder<void, M, R>): VBlock<void, M, R>;
|
|
24
|
+
export declare abstract class VBlock<T = unknown, M = unknown, C = unknown, R = void> {
|
|
23
25
|
static readonly shortFrameDuration = 16;
|
|
24
26
|
static readonly longFrameDuration = 300;
|
|
25
27
|
static currentRenderingPriority: Priority;
|
|
26
28
|
static frameDuration: number;
|
|
27
29
|
abstract readonly key: string;
|
|
28
|
-
abstract readonly driver:
|
|
29
|
-
abstract readonly
|
|
30
|
+
abstract readonly driver: Driver<T>;
|
|
31
|
+
abstract readonly builder: Readonly<BlockBuilder<T, M, C, R>>;
|
|
30
32
|
abstract model: M;
|
|
31
|
-
abstract
|
|
33
|
+
abstract childrenLayout: Layout;
|
|
34
|
+
abstract placement: Placement;
|
|
32
35
|
abstract widthGrowth: number;
|
|
33
36
|
abstract minWidth: string;
|
|
34
37
|
abstract maxWidth: string;
|
|
@@ -36,7 +39,7 @@ export declare abstract class VBlock<T = unknown, M = unknown, R = void> {
|
|
|
36
39
|
abstract minHeight: string;
|
|
37
40
|
abstract maxHeight: string;
|
|
38
41
|
abstract contentAlignment: Align;
|
|
39
|
-
abstract
|
|
42
|
+
abstract blockAlignment: Align;
|
|
40
43
|
abstract contentWrapping: boolean;
|
|
41
44
|
abstract overlayVisible: boolean | undefined;
|
|
42
45
|
abstract childrenShuffling: boolean;
|
|
@@ -48,56 +51,61 @@ export declare abstract class VBlock<T = unknown, M = unknown, R = void> {
|
|
|
48
51
|
abstract readonly item: Item<VBlock> | undefined;
|
|
49
52
|
abstract readonly stamp: number;
|
|
50
53
|
abstract readonly native: T;
|
|
54
|
+
abstract readonly controller: C;
|
|
51
55
|
get isInitialRendering(): boolean;
|
|
52
56
|
abstract configureReactronic(options: Partial<MemberOptions>): MemberOptions;
|
|
53
57
|
static root(render: () => void): void;
|
|
54
58
|
static get current(): VBlock;
|
|
55
59
|
static renderNestedTreesThenDo(action: (error: unknown) => void): void;
|
|
56
60
|
static runForAllBlocks<T>(action: (e: T) => void): void;
|
|
57
|
-
static claim<T = undefined, M = unknown, R = void>(driver:
|
|
61
|
+
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>): VBlock<T, M, C, R>;
|
|
58
62
|
private static generateKey;
|
|
59
63
|
static getDefaultLoggingOptions(): LoggingOptions | undefined;
|
|
60
64
|
static setDefaultLoggingOptions(logging?: LoggingOptions): void;
|
|
61
65
|
}
|
|
62
|
-
export declare enum
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
export declare enum Layout {
|
|
67
|
+
Section = 0,
|
|
68
|
+
Table = 1,
|
|
69
|
+
Row = 2,
|
|
70
|
+
Group = 3,
|
|
71
|
+
Note = 4
|
|
68
72
|
}
|
|
69
|
-
export declare class
|
|
70
|
-
static readonly fragment: AbstractDriver<any>;
|
|
73
|
+
export declare class Driver<T, C = unknown> {
|
|
71
74
|
readonly name: string;
|
|
72
|
-
readonly
|
|
73
|
-
readonly
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
75
|
+
readonly isRow: boolean;
|
|
76
|
+
readonly preset?: SimpleOperation<T> | undefined;
|
|
77
|
+
static readonly fragment: Driver<any, unknown>;
|
|
78
|
+
constructor(name: string, isRow: boolean, preset?: SimpleOperation<T> | undefined);
|
|
79
|
+
create(block: VBlock<T, unknown, C>, b: {
|
|
80
|
+
native?: T;
|
|
81
|
+
controller?: C;
|
|
82
|
+
}): void;
|
|
83
|
+
claim(block: VBlock<T, unknown, C>): void;
|
|
84
|
+
initialize(block: VBlock<T, unknown, C>): void;
|
|
85
|
+
deploy(block: VBlock<T, unknown, C>): void;
|
|
86
|
+
render(block: VBlock<T, unknown, C>): void | Promise<void>;
|
|
87
|
+
finalize(block: VBlock<T, unknown, C>, isLeader: boolean): boolean;
|
|
88
|
+
applyChildrenLayout(block: VBlock<T, any, C, any>, value: Layout): void;
|
|
89
|
+
applyCellRange(block: VBlock<T, any, C, any>, value: CellRange | undefined): void;
|
|
90
|
+
applyWidthGrowth(block: VBlock<T, any, C, any>, value: number): void;
|
|
91
|
+
applyMinWidth(block: VBlock<T, any, C, any>, value: string): void;
|
|
92
|
+
applyMaxWidth(block: VBlock<T, any, C, any>, value: string): void;
|
|
93
|
+
applyHeightGrowth(block: VBlock<T, any, C, any>, value: number): void;
|
|
94
|
+
applyMinHeight(block: VBlock<T, any, C, any>, value: string): void;
|
|
95
|
+
applyMaxHeight(block: VBlock<T, any, C, any>, value: string): void;
|
|
96
|
+
applyContentAlignment(block: VBlock<T, any, C, any>, value: Align): void;
|
|
97
|
+
applyBlockAlignment(block: VBlock<T, any, C, any>, value: Align): void;
|
|
98
|
+
applyContentWrapping(block: VBlock<T, any, C, any>, value: boolean): void;
|
|
99
|
+
applyOverlayVisible(block: VBlock<T, any, C, any>, value: boolean | undefined): void;
|
|
100
|
+
applyStyle(block: VBlock<T, any, C, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
96
101
|
}
|
|
97
|
-
export declare class StaticDriver<T> extends
|
|
102
|
+
export declare class StaticDriver<T> extends Driver<T> {
|
|
98
103
|
readonly element: T;
|
|
99
|
-
constructor(element: T, name: string,
|
|
100
|
-
|
|
104
|
+
constructor(element: T, name: string, isRow: boolean, preset?: SimpleOperation<T>);
|
|
105
|
+
create(block: VBlock<T, unknown, unknown, void>, b: {
|
|
106
|
+
native?: T;
|
|
107
|
+
controller?: unknown;
|
|
108
|
+
}): void;
|
|
101
109
|
}
|
|
102
110
|
export declare class ContextVariable<T extends Object = Object> {
|
|
103
111
|
readonly defaultValue: T | undefined;
|