verstak 0.22.511 → 0.22.514
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/VBlock.d.ts +31 -32
- package/build/dist/source/core/VBlock.js +101 -95
- package/build/dist/source/html/Blocks.d.ts +15 -15
- package/build/dist/source/html/Blocks.js +45 -45
- package/build/dist/source/html/HtmlBlocks.d.ts +175 -175
- package/build/dist/source/html/HtmlBlocks.js +175 -175
- package/build/dist/source/html/HtmlDriver.d.ts +1 -1
- package/build/dist/source/html/ReactingFocuser.js +3 -1
- package/package.json +1 -1
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoggingOptions, Item, CollectionReader, MemberOptions } from "reactronic";
|
|
2
2
|
import { CellRange } from "./CellRange";
|
|
3
3
|
import { Cursor, Align, Cells } from "./Cursor";
|
|
4
4
|
export declare type Callback<T = unknown> = (native: T) => void;
|
|
5
|
-
export declare type Render<T = unknown, M = unknown, R = void> = (
|
|
6
|
-
export declare type AsyncRender<T = unknown, M = unknown> = (
|
|
5
|
+
export declare type Render<T = unknown, M = unknown, R = void> = (block: VBlock<T, M, R>, base: () => R) => R;
|
|
6
|
+
export declare type AsyncRender<T = unknown, M = unknown> = (block: VBlock<T, M, Promise<void>>) => Promise<void>;
|
|
7
7
|
export declare const enum Priority {
|
|
8
8
|
SyncP0 = 0,
|
|
9
9
|
AsyncP1 = 1,
|
|
10
10
|
AsyncP2 = 2
|
|
11
11
|
}
|
|
12
12
|
export declare type Type<T> = new (...args: any[]) => T;
|
|
13
|
-
export
|
|
13
|
+
export declare type BlockBody<T = unknown, M = unknown, R = void> = Render<T, M, R> | BlockVmt<T, M, R>;
|
|
14
|
+
export interface BlockVmt<T = unknown, M = unknown, R = void> {
|
|
14
15
|
reacting?: boolean;
|
|
15
16
|
triggers?: unknown;
|
|
16
|
-
priority?: Priority;
|
|
17
|
-
monitor?: Monitor;
|
|
18
|
-
throttling?: number;
|
|
19
|
-
logging?: Partial<LoggingOptions>;
|
|
20
|
-
shuffle?: boolean;
|
|
21
17
|
initialize?: Render<T, M, R>;
|
|
22
18
|
override?: Render<T, M, R>;
|
|
23
19
|
render?: Render<T, M, R>;
|
|
24
20
|
finalize?: Render<T, M, R>;
|
|
25
21
|
}
|
|
26
|
-
export declare function
|
|
27
|
-
export declare function
|
|
22
|
+
export declare function baseFor<T, M, R>(outer: BlockBody<T, M, R> | undefined, base: BlockBody<T, M, R>): BlockVmt<T, M, R>;
|
|
23
|
+
export declare function defineSubTreeContext<T extends Object>(type: Type<T>, context: T): void;
|
|
28
24
|
export declare function use<T extends Object>(type: Type<T>): T;
|
|
29
25
|
export declare abstract class VBlock<T = unknown, M = unknown, R = void> {
|
|
30
26
|
static readonly shortFrameDuration = 16;
|
|
@@ -33,31 +29,34 @@ export declare abstract class VBlock<T = unknown, M = unknown, R = void> {
|
|
|
33
29
|
static frameDuration: number;
|
|
34
30
|
abstract readonly name: string;
|
|
35
31
|
abstract readonly driver: AbstractDriver<T>;
|
|
36
|
-
abstract readonly
|
|
32
|
+
abstract readonly body: Readonly<BlockVmt<T, M, R>>;
|
|
37
33
|
abstract model: M;
|
|
38
34
|
abstract cells: Cells;
|
|
39
35
|
abstract widthGrowth: number;
|
|
40
|
-
abstract
|
|
41
|
-
abstract
|
|
36
|
+
abstract minWidth: string;
|
|
37
|
+
abstract maxWidth: string;
|
|
42
38
|
abstract heightGrowth: number;
|
|
43
|
-
abstract
|
|
44
|
-
abstract
|
|
45
|
-
abstract
|
|
46
|
-
abstract
|
|
47
|
-
abstract
|
|
48
|
-
abstract
|
|
39
|
+
abstract minHeight: string;
|
|
40
|
+
abstract maxHeight: string;
|
|
41
|
+
abstract contentAlignment: Align;
|
|
42
|
+
abstract frameAlignment: Align;
|
|
43
|
+
abstract contentWrapping: boolean;
|
|
44
|
+
abstract floating: boolean;
|
|
45
|
+
abstract childrenShuffling: boolean;
|
|
46
|
+
abstract renderingPriority?: Priority;
|
|
49
47
|
abstract readonly level: number;
|
|
50
48
|
abstract readonly host: VBlock;
|
|
51
49
|
abstract readonly children: CollectionReader<VBlock>;
|
|
52
50
|
abstract readonly item: Item<VBlock> | undefined;
|
|
53
51
|
abstract readonly stamp: number;
|
|
54
|
-
abstract readonly native: T
|
|
52
|
+
abstract readonly native: T;
|
|
55
53
|
get isInitialRendering(): boolean;
|
|
54
|
+
abstract configureReactronic(options: Partial<MemberOptions>): MemberOptions;
|
|
56
55
|
static root(render: () => void): void;
|
|
57
56
|
static get current(): VBlock;
|
|
58
57
|
static renderNestedTreesThenDo(action: (error: unknown) => void): void;
|
|
59
58
|
static runForAllBlocks<T>(action: (e: T) => void): void;
|
|
60
|
-
static claim<T = undefined, M = unknown, R = void>(name: string, driver: AbstractDriver<T> | undefined,
|
|
59
|
+
static claim<T = undefined, M = unknown, R = void>(name: string, driver: AbstractDriver<T> | undefined, body: BlockBody<T, M, R>): VBlock<T, M, R>;
|
|
61
60
|
static getDefaultLoggingOptions(): LoggingOptions | undefined;
|
|
62
61
|
static setDefaultLoggingOptions(logging?: LoggingOptions): void;
|
|
63
62
|
}
|
|
@@ -79,24 +78,24 @@ export declare class AbstractDriver<T> {
|
|
|
79
78
|
get isGrid(): boolean;
|
|
80
79
|
get isRow(): boolean;
|
|
81
80
|
constructor(name: string, layout: LayoutKind, createCursor?: () => Cursor);
|
|
82
|
-
initialize(block: VBlock<T>, native: T
|
|
81
|
+
initialize(block: VBlock<T>, native: T): void;
|
|
83
82
|
finalize(block: VBlock<T>, isLeader: boolean): boolean;
|
|
84
83
|
deploy(block: VBlock<T>, sequential: boolean): void;
|
|
85
84
|
applyCellRange(block: VBlock<T, any, any>, cellRange: CellRange | undefined): void;
|
|
86
85
|
applyWidthGrowth(block: VBlock<T, any, any>, widthGrowth: number): void;
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
applyMinWidth(block: VBlock<T, any, any>, minWidth: string): void;
|
|
87
|
+
applyMaxWidth(block: VBlock<T, any, any>, maxWidth: string): void;
|
|
89
88
|
applyHeightGrowth(block: VBlock<T, any, any>, heightGrowth: number): void;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
applyMinHeight(block: VBlock<T, any, any>, minHeight: string): void;
|
|
90
|
+
applyMaxHeight(block: VBlock<T, any, any>, maxHeight: string): void;
|
|
91
|
+
applyContentAlignment(block: VBlock<T, any, any>, contentAlignment: Align): void;
|
|
92
|
+
applyFrameAlignment(block: VBlock<T, any, any>, frameAlignment: Align): void;
|
|
93
|
+
applyContentWrapping(block: VBlock<T, any, any>, contentWrapping: boolean): void;
|
|
94
|
+
applyFloating(block: VBlock<T, any, any>, floating: boolean): void;
|
|
96
95
|
render(block: VBlock<T>): void | Promise<void>;
|
|
97
96
|
}
|
|
98
97
|
export declare class StaticDriver<T> extends AbstractDriver<T> {
|
|
99
98
|
readonly element: T;
|
|
100
99
|
constructor(element: T, name: string, layout: LayoutKind, createCursor?: () => Cursor);
|
|
101
|
-
initialize(block: VBlock<T>, element: T
|
|
100
|
+
initialize(block: VBlock<T>, element: T): void;
|
|
102
101
|
}
|
|
@@ -25,16 +25,20 @@ export var Priority;
|
|
|
25
25
|
Priority[Priority["AsyncP1"] = 1] = "AsyncP1";
|
|
26
26
|
Priority[Priority["AsyncP2"] = 2] = "AsyncP2";
|
|
27
27
|
})(Priority || (Priority = {}));
|
|
28
|
-
export function
|
|
28
|
+
export function baseFor(outer, base) {
|
|
29
|
+
if (outer instanceof Function)
|
|
30
|
+
outer = { render: outer };
|
|
31
|
+
if (base instanceof Function)
|
|
32
|
+
base = { render: base };
|
|
29
33
|
const result = Object.assign(Object.assign(Object.assign({}, base), outer), { initialize: via(outer === null || outer === void 0 ? void 0 : outer.initialize, base.initialize), render: via(outer === null || outer === void 0 ? void 0 : outer.render, base.render), finalize: via(outer === null || outer === void 0 ? void 0 : outer.finalize, base.finalize) });
|
|
30
34
|
return result;
|
|
31
35
|
}
|
|
32
36
|
function via(outer, base) {
|
|
33
37
|
const inherited = base !== null && base !== void 0 ? base : NOP;
|
|
34
|
-
return outer ?
|
|
38
|
+
return outer ? b => outer(b, () => inherited(b)) : inherited;
|
|
35
39
|
}
|
|
36
|
-
export function
|
|
37
|
-
return VBlockImpl.
|
|
40
|
+
export function defineSubTreeContext(type, context) {
|
|
41
|
+
return VBlockImpl.defineSubTreeContext(type, context);
|
|
38
42
|
}
|
|
39
43
|
export function use(type) {
|
|
40
44
|
return VBlockImpl.use(type);
|
|
@@ -44,7 +48,7 @@ export class VBlock {
|
|
|
44
48
|
return this.stamp === 2;
|
|
45
49
|
}
|
|
46
50
|
static root(render) {
|
|
47
|
-
gSysRoot.instance.
|
|
51
|
+
gSysRoot.instance.body.render = render;
|
|
48
52
|
prepareAndRunRender(gSysRoot, false, false);
|
|
49
53
|
}
|
|
50
54
|
static get current() {
|
|
@@ -56,8 +60,10 @@ export class VBlock {
|
|
|
56
60
|
static runForAllBlocks(action) {
|
|
57
61
|
forEachChildRecursively(gSysRoot, action);
|
|
58
62
|
}
|
|
59
|
-
static claim(name, driver,
|
|
63
|
+
static claim(name, driver, body) {
|
|
60
64
|
var _a, _b;
|
|
65
|
+
if (body instanceof Function)
|
|
66
|
+
body = { render: body };
|
|
61
67
|
let result;
|
|
62
68
|
const owner = gCurrent.instance;
|
|
63
69
|
const children = owner.children;
|
|
@@ -74,16 +80,16 @@ export class VBlock {
|
|
|
74
80
|
result = ex.instance;
|
|
75
81
|
if (result.driver !== driver && driver !== undefined)
|
|
76
82
|
throw new Error(`changing block driver is not yet supported: "${result.driver.name}" -> "${driver === null || driver === void 0 ? void 0 : driver.name}"`);
|
|
77
|
-
const exTriggers = (_b = result.
|
|
78
|
-
if (triggersAreEqual(
|
|
79
|
-
|
|
80
|
-
result.
|
|
83
|
+
const exTriggers = (_b = result.body) === null || _b === void 0 ? void 0 : _b.triggers;
|
|
84
|
+
if (triggersAreEqual(body.triggers, exTriggers))
|
|
85
|
+
body.triggers = exTriggers;
|
|
86
|
+
result.body = body;
|
|
81
87
|
}
|
|
82
88
|
else {
|
|
83
|
-
result = new VBlockImpl(name, driver, owner,
|
|
89
|
+
result = new VBlockImpl(name, driver, owner, body);
|
|
84
90
|
result.item = children.add(result);
|
|
85
91
|
VBlockImpl.grandCount++;
|
|
86
|
-
if (
|
|
92
|
+
if (body.reacting)
|
|
87
93
|
VBlockImpl.disposableCount++;
|
|
88
94
|
}
|
|
89
95
|
return result;
|
|
@@ -123,14 +129,13 @@ export class AbstractDriver {
|
|
|
123
129
|
var _a, _b;
|
|
124
130
|
const b = block;
|
|
125
131
|
b.native = native;
|
|
126
|
-
(_b = (_a = block.
|
|
132
|
+
(_b = (_a = block.body).initialize) === null || _b === void 0 ? void 0 : _b.call(_a, block, NOP);
|
|
127
133
|
}
|
|
128
134
|
finalize(block, isLeader) {
|
|
129
135
|
var _a, _b;
|
|
130
136
|
const b = block;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
b.native = undefined;
|
|
137
|
+
(_b = (_a = block.body).finalize) === null || _b === void 0 ? void 0 : _b.call(_a, block, NOP);
|
|
138
|
+
b.native = null;
|
|
134
139
|
return isLeader;
|
|
135
140
|
}
|
|
136
141
|
deploy(block, sequential) {
|
|
@@ -139,30 +144,30 @@ export class AbstractDriver {
|
|
|
139
144
|
}
|
|
140
145
|
applyWidthGrowth(block, widthGrowth) {
|
|
141
146
|
}
|
|
142
|
-
|
|
147
|
+
applyMinWidth(block, minWidth) {
|
|
143
148
|
}
|
|
144
|
-
|
|
149
|
+
applyMaxWidth(block, maxWidth) {
|
|
145
150
|
}
|
|
146
151
|
applyHeightGrowth(block, heightGrowth) {
|
|
147
152
|
}
|
|
148
|
-
|
|
153
|
+
applyMinHeight(block, minHeight) {
|
|
149
154
|
}
|
|
150
|
-
|
|
155
|
+
applyMaxHeight(block, maxHeight) {
|
|
151
156
|
}
|
|
152
|
-
|
|
157
|
+
applyContentAlignment(block, contentAlignment) {
|
|
153
158
|
}
|
|
154
|
-
|
|
159
|
+
applyFrameAlignment(block, frameAlignment) {
|
|
155
160
|
}
|
|
156
|
-
|
|
161
|
+
applyContentWrapping(block, contentWrapping) {
|
|
157
162
|
}
|
|
158
|
-
|
|
163
|
+
applyFloating(block, floating) {
|
|
159
164
|
}
|
|
160
165
|
render(block) {
|
|
161
166
|
var _a;
|
|
162
167
|
let result;
|
|
163
|
-
const override = (_a = block.
|
|
168
|
+
const override = (_a = block.body) === null || _a === void 0 ? void 0 : _a.override;
|
|
164
169
|
if (override)
|
|
165
|
-
result = override(block
|
|
170
|
+
result = override(block, NOP);
|
|
166
171
|
else
|
|
167
172
|
result = invokeRenderFunction(block);
|
|
168
173
|
return result;
|
|
@@ -171,8 +176,8 @@ export class AbstractDriver {
|
|
|
171
176
|
AbstractDriver.group = new AbstractDriver("group", LayoutKind.Group);
|
|
172
177
|
function invokeRenderFunction(block) {
|
|
173
178
|
var _a;
|
|
174
|
-
const r = (_a = block.
|
|
175
|
-
return r(block
|
|
179
|
+
const r = (_a = block.body.render) !== null && _a !== void 0 ? _a : NOP;
|
|
180
|
+
return r(block, NOP);
|
|
176
181
|
}
|
|
177
182
|
export class StaticDriver extends AbstractDriver {
|
|
178
183
|
constructor(element, name, layout, createCursor) {
|
|
@@ -198,24 +203,26 @@ __decorate([
|
|
|
198
203
|
__metadata("design:type", Object)
|
|
199
204
|
], VBlockContext.prototype, "type", void 0);
|
|
200
205
|
class VBlockImpl extends VBlock {
|
|
201
|
-
constructor(name, driver, owner,
|
|
206
|
+
constructor(name, driver, owner, body) {
|
|
202
207
|
super();
|
|
203
208
|
this.name = name;
|
|
204
209
|
this.driver = driver;
|
|
205
|
-
this.
|
|
210
|
+
this.body = body;
|
|
206
211
|
this.model = undefined;
|
|
207
212
|
this.assignedCells = undefined;
|
|
208
213
|
this.appliedCellRange = Cursor.UndefinedCellRange;
|
|
209
214
|
this.appliedWidthGrowth = 0;
|
|
210
|
-
this.
|
|
211
|
-
this.
|
|
215
|
+
this.appliedMinWidth = "";
|
|
216
|
+
this.appliedMaxWidth = "";
|
|
212
217
|
this.appliedHeightGrowth = 0;
|
|
213
|
-
this.
|
|
214
|
-
this.
|
|
215
|
-
this.
|
|
216
|
-
this.
|
|
217
|
-
this.
|
|
218
|
-
this.
|
|
218
|
+
this.appliedMinHeight = "";
|
|
219
|
+
this.appliedMaxHeight = "";
|
|
220
|
+
this.appliedContentAlignment = Align.Default;
|
|
221
|
+
this.appliedFrameAlignment = Align.Default;
|
|
222
|
+
this.appliedContentWrapping = false;
|
|
223
|
+
this.appliedFloating = false;
|
|
224
|
+
this.childrenShuffling = false;
|
|
225
|
+
this.renderingPriority = Priority.SyncP0;
|
|
219
226
|
this.level = owner.level + 1;
|
|
220
227
|
this.host = owner;
|
|
221
228
|
this.children = new Collection(driver.isSequential, getBlockName);
|
|
@@ -248,18 +255,18 @@ class VBlockImpl extends VBlock {
|
|
|
248
255
|
this.appliedWidthGrowth = value;
|
|
249
256
|
}
|
|
250
257
|
}
|
|
251
|
-
get
|
|
252
|
-
set
|
|
253
|
-
if (value !== this.
|
|
254
|
-
this.driver.
|
|
255
|
-
this.
|
|
258
|
+
get minWidth() { return this.appliedMinWidth; }
|
|
259
|
+
set minWidth(value) {
|
|
260
|
+
if (value !== this.appliedMinWidth) {
|
|
261
|
+
this.driver.applyMinWidth(this, value);
|
|
262
|
+
this.appliedMinWidth = value;
|
|
256
263
|
}
|
|
257
264
|
}
|
|
258
|
-
get
|
|
259
|
-
set
|
|
260
|
-
if (value !== this.
|
|
261
|
-
this.driver.
|
|
262
|
-
this.
|
|
265
|
+
get maxWidth() { return this.appliedMaxWidth; }
|
|
266
|
+
set maxWidth(value) {
|
|
267
|
+
if (value !== this.appliedMaxWidth) {
|
|
268
|
+
this.driver.applyMaxWidth(this, value);
|
|
269
|
+
this.appliedMaxWidth = value;
|
|
263
270
|
}
|
|
264
271
|
}
|
|
265
272
|
get heightGrowth() { return this.appliedHeightGrowth; }
|
|
@@ -269,48 +276,53 @@ class VBlockImpl extends VBlock {
|
|
|
269
276
|
this.appliedHeightGrowth = value;
|
|
270
277
|
}
|
|
271
278
|
}
|
|
272
|
-
get
|
|
273
|
-
set
|
|
274
|
-
if (value !== this.
|
|
275
|
-
this.driver.
|
|
276
|
-
this.
|
|
279
|
+
get minHeight() { return this.appliedMinHeight; }
|
|
280
|
+
set minHeight(value) {
|
|
281
|
+
if (value !== this.appliedMinWidth) {
|
|
282
|
+
this.driver.applyMinWidth(this, value);
|
|
283
|
+
this.appliedMinWidth = value;
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
|
-
get
|
|
280
|
-
set
|
|
281
|
-
if (value !== this.
|
|
282
|
-
this.driver.
|
|
283
|
-
this.
|
|
286
|
+
get maxHeight() { return this.appliedMaxHeight; }
|
|
287
|
+
set maxHeight(value) {
|
|
288
|
+
if (value !== this.appliedMaxWidth) {
|
|
289
|
+
this.driver.applyMaxWidth(this, value);
|
|
290
|
+
this.appliedMaxWidth = value;
|
|
284
291
|
}
|
|
285
292
|
}
|
|
286
|
-
get
|
|
287
|
-
set
|
|
288
|
-
if (value !== this.
|
|
289
|
-
this.driver.
|
|
290
|
-
this.
|
|
293
|
+
get contentAlignment() { return this.appliedContentAlignment; }
|
|
294
|
+
set contentAlignment(value) {
|
|
295
|
+
if (value !== this.appliedContentAlignment) {
|
|
296
|
+
this.driver.applyContentAlignment(this, value);
|
|
297
|
+
this.appliedContentAlignment = value;
|
|
291
298
|
}
|
|
292
299
|
}
|
|
293
|
-
get
|
|
294
|
-
set
|
|
295
|
-
if (value !== this.
|
|
296
|
-
this.driver.
|
|
297
|
-
this.
|
|
300
|
+
get frameAlignment() { return this.appliedFrameAlignment; }
|
|
301
|
+
set frameAlignment(value) {
|
|
302
|
+
if (value !== this.appliedFrameAlignment) {
|
|
303
|
+
this.driver.applyFrameAlignment(this, value);
|
|
304
|
+
this.appliedFrameAlignment = value;
|
|
298
305
|
}
|
|
299
306
|
}
|
|
300
|
-
get
|
|
301
|
-
set
|
|
302
|
-
if (value !== this.
|
|
303
|
-
this.driver.
|
|
304
|
-
this.
|
|
307
|
+
get contentWrapping() { return this.appliedContentWrapping; }
|
|
308
|
+
set contentWrapping(value) {
|
|
309
|
+
if (value !== this.appliedContentWrapping) {
|
|
310
|
+
this.driver.applyContentWrapping(this, value);
|
|
311
|
+
this.appliedContentWrapping = value;
|
|
305
312
|
}
|
|
306
313
|
}
|
|
307
|
-
get
|
|
308
|
-
set
|
|
309
|
-
if (value !== this.
|
|
310
|
-
this.driver.
|
|
311
|
-
this.
|
|
314
|
+
get floating() { return this.appliedFloating; }
|
|
315
|
+
set floating(value) {
|
|
316
|
+
if (value !== this.appliedFloating) {
|
|
317
|
+
this.driver.applyFloating(this, value);
|
|
318
|
+
this.appliedFloating = value;
|
|
312
319
|
}
|
|
313
320
|
}
|
|
321
|
+
configureReactronic(options) {
|
|
322
|
+
if (this.stamp !== 1 || !this.body.reacting)
|
|
323
|
+
throw new Error("reactronic can be configured only for reacting blocks and only inside initialize");
|
|
324
|
+
return Rx.getController(this.rerender).configure(options);
|
|
325
|
+
}
|
|
314
326
|
static use(type) {
|
|
315
327
|
var _a, _b;
|
|
316
328
|
let b = gCurrent.instance;
|
|
@@ -320,7 +332,7 @@ class VBlockImpl extends VBlock {
|
|
|
320
332
|
throw new Error(`${type.name} context doesn't exist`);
|
|
321
333
|
return (_b = b.context) === null || _b === void 0 ? void 0 : _b.instance;
|
|
322
334
|
}
|
|
323
|
-
static
|
|
335
|
+
static defineSubTreeContext(type, context) {
|
|
324
336
|
const block = gCurrent.instance;
|
|
325
337
|
const host = block.host;
|
|
326
338
|
const hostCtx = nonreactive(() => { var _a; return (_a = host.context) === null || _a === void 0 ? void 0 : _a.instance; });
|
|
@@ -384,13 +396,12 @@ function runRenderNestedTreesThenDo(error, action) {
|
|
|
384
396
|
break;
|
|
385
397
|
const block = item.instance;
|
|
386
398
|
const driver = block.driver;
|
|
387
|
-
const opt = block.args;
|
|
388
399
|
const host = driver.isRow ? owner : partHost;
|
|
400
|
+
const p = (_a = block.renderingPriority) !== null && _a !== void 0 ? _a : Priority.SyncP0;
|
|
389
401
|
redeploy = markToRedeployIfNecessary(redeploy, host, item, children, sequential);
|
|
390
|
-
|
|
391
|
-
if (priority === Priority.SyncP0)
|
|
402
|
+
if (p === Priority.SyncP0)
|
|
392
403
|
prepareAndRunRender(item, children.isMoved(item), sequential);
|
|
393
|
-
else if (
|
|
404
|
+
else if (p === Priority.AsyncP1)
|
|
394
405
|
p1 = push(item, p1);
|
|
395
406
|
else
|
|
396
407
|
p2 = push(item, p2);
|
|
@@ -430,7 +441,6 @@ function startIncrementalRendering(owner, allChildren, priority1, priority2) {
|
|
|
430
441
|
});
|
|
431
442
|
}
|
|
432
443
|
function renderIncrementally(owner, stamp, allChildren, items, priority) {
|
|
433
|
-
var _a;
|
|
434
444
|
return __awaiter(this, void 0, void 0, function* () {
|
|
435
445
|
yield Transaction.requestNextFrame();
|
|
436
446
|
const block = owner.instance;
|
|
@@ -439,7 +449,7 @@ function renderIncrementally(owner, stamp, allChildren, items, priority) {
|
|
|
439
449
|
VBlock.currentRenderingPriority = priority;
|
|
440
450
|
try {
|
|
441
451
|
const sequential = block.children.strict;
|
|
442
|
-
if (
|
|
452
|
+
if (block.childrenShuffling)
|
|
443
453
|
shuffle(items);
|
|
444
454
|
const frameDurationLimit = priority === Priority.AsyncP2 ? VBlock.shortFrameDuration : Infinity;
|
|
445
455
|
let frameDuration = Math.min(frameDurationLimit, Math.max(VBlock.frameDuration / 4, VBlock.shortFrameDuration));
|
|
@@ -467,8 +477,8 @@ function prepareAndRunRender(item, redeploy, sequential) {
|
|
|
467
477
|
const block = item.instance;
|
|
468
478
|
if (block.stamp >= 0) {
|
|
469
479
|
prepareRender(item, redeploy, sequential);
|
|
470
|
-
if ((_a = block.
|
|
471
|
-
nonreactive(block.rerender, (_b = block.
|
|
480
|
+
if ((_a = block.body) === null || _a === void 0 ? void 0 : _a.reacting)
|
|
481
|
+
nonreactive(block.rerender, (_b = block.body) === null || _b === void 0 ? void 0 : _b.triggers);
|
|
472
482
|
else
|
|
473
483
|
runRender(item);
|
|
474
484
|
}
|
|
@@ -480,16 +490,12 @@ function prepareRender(item, redeploy, sequential) {
|
|
|
480
490
|
block.stamp = 1;
|
|
481
491
|
runUnder(item, () => {
|
|
482
492
|
var _a;
|
|
483
|
-
if ((_a = block.
|
|
493
|
+
if ((_a = block.body) === null || _a === void 0 ? void 0 : _a.reacting) {
|
|
484
494
|
Transaction.outside(() => {
|
|
485
|
-
var _a, _b, _c;
|
|
486
495
|
if (Rx.isLogging)
|
|
487
496
|
Rx.setLoggingHint(block, block.name);
|
|
488
497
|
Rx.getController(block.rerender).configure({
|
|
489
498
|
order: block.level,
|
|
490
|
-
monitor: (_a = block.args) === null || _a === void 0 ? void 0 : _a.monitor,
|
|
491
|
-
throttling: (_b = block.args) === null || _b === void 0 ? void 0 : _b.throttling,
|
|
492
|
-
logging: (_c = block.args) === null || _c === void 0 ? void 0 : _c.logging,
|
|
493
499
|
});
|
|
494
500
|
});
|
|
495
501
|
}
|
|
@@ -536,7 +542,7 @@ function runFinalize(item, isLeader) {
|
|
|
536
542
|
if (block.stamp >= 0) {
|
|
537
543
|
block.stamp = ~block.stamp;
|
|
538
544
|
const childrenAreLeaders = block.driver.finalize(block, isLeader);
|
|
539
|
-
if ((_a = block.
|
|
545
|
+
if ((_a = block.body) === null || _a === void 0 ? void 0 : _a.reacting) {
|
|
540
546
|
item.aux = undefined;
|
|
541
547
|
const last = gLastToDispose;
|
|
542
548
|
if (last)
|
|
@@ -569,8 +575,8 @@ function runDisposalLoop() {
|
|
|
569
575
|
}
|
|
570
576
|
function forEachChildRecursively(item, action) {
|
|
571
577
|
const block = item.instance;
|
|
572
|
-
const
|
|
573
|
-
|
|
578
|
+
const e = block.native;
|
|
579
|
+
e && action(e);
|
|
574
580
|
for (const item of block.children.items())
|
|
575
581
|
forEachChildRecursively(item, action);
|
|
576
582
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { VBlock,
|
|
1
|
+
import { VBlock, BlockBody, Align, CellRange } from "../core/api";
|
|
2
2
|
import { HtmlDriver } from "./HtmlDriver";
|
|
3
|
-
export declare function Block<M = unknown, R = void>(name: string,
|
|
4
|
-
export declare function PlainText(content: string, name?: string,
|
|
5
|
-
export declare function HtmlText(content: string, name?: string,
|
|
6
|
-
export declare function Grid<M = unknown, R = void>(name: string,
|
|
3
|
+
export declare function Block<M = unknown, R = void>(name: string, body: BlockBody<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
|
|
4
|
+
export declare function PlainText(content: string, name?: string, body?: BlockBody<HTMLElement, void, void>): VBlock<HTMLElement, void, void>;
|
|
5
|
+
export declare function HtmlText(content: string, name?: string, body?: BlockBody<HTMLElement, void, void>): VBlock<HTMLElement, void, void>;
|
|
6
|
+
export declare function Grid<M = unknown, R = void>(name: string, body: BlockBody<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
|
|
7
7
|
export declare function Line<T = void>(claim: (x: void) => T): VBlock<HTMLElement>;
|
|
8
|
-
export declare function lineFeed(
|
|
9
|
-
export declare function Group<M = unknown, R = void>(name: string,
|
|
8
|
+
export declare function lineFeed(body?: BlockBody<HTMLElement, void, void>, noCoalescing?: boolean): VBlock<HTMLElement>;
|
|
9
|
+
export declare function Group<M = unknown, R = void>(name: string, body: BlockBody<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
|
|
10
10
|
export declare class VerstakDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
11
11
|
applyCellRange(block: VBlock<T>, cellRange: CellRange | undefined): void;
|
|
12
12
|
applyWidthGrowth(block: VBlock<T>, widthGrowth: number): void;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
applyMinWidth(block: VBlock<T>, minWidth: string): void;
|
|
14
|
+
applyMaxWidth(block: VBlock<T>, maxWidth: string): void;
|
|
15
15
|
applyHeightGrowth(block: VBlock<T>, heightGrowth: number): void;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
applyMinHeight(block: VBlock<T>, minHeight: string): void;
|
|
17
|
+
applyMaxHeight(block: VBlock<T>, maxHeight: string): void;
|
|
18
|
+
applyContentAlignment(block: VBlock<T>, contentAlign: Align): void;
|
|
19
|
+
applyFrameAlignment(block: VBlock<T>, frameAlign: Align): void;
|
|
20
|
+
applyContentWrapping(block: VBlock<T>, contentWrapping: boolean): void;
|
|
21
|
+
applyFloating(block: VBlock<T>, floating: boolean): void;
|
|
22
22
|
render(block: VBlock<T>): void | Promise<void>;
|
|
23
23
|
}
|