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
|
@@ -19,22 +19,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
import { reactive, nonreactive, Transaction, options, Reentrance, Rx, Collection, ObservableObject, raw } from "reactronic";
|
|
20
20
|
import { getCallerInfo } from "./Utils";
|
|
21
21
|
import { emitLetters, equalCellRanges } from "./CellRange";
|
|
22
|
-
import { Cursor, Align } from "./Cursor";
|
|
22
|
+
import { Cursor, Align, TableCursor } from "./Cursor";
|
|
23
23
|
export var Priority;
|
|
24
24
|
(function (Priority) {
|
|
25
25
|
Priority[Priority["Realtime"] = 0] = "Realtime";
|
|
26
26
|
Priority[Priority["Normal"] = 1] = "Normal";
|
|
27
27
|
Priority[Priority["Background"] = 2] = "Background";
|
|
28
28
|
})(Priority || (Priority = {}));
|
|
29
|
-
export function Fragment(
|
|
30
|
-
return VBlock.claim(
|
|
29
|
+
export function Fragment(builder, base) {
|
|
30
|
+
return VBlock.claim(Driver.fragment, builder, base);
|
|
31
31
|
}
|
|
32
32
|
export class VBlock {
|
|
33
33
|
get isInitialRendering() {
|
|
34
34
|
return this.stamp === 2;
|
|
35
35
|
}
|
|
36
36
|
static root(render) {
|
|
37
|
-
gSysRoot.instance.
|
|
37
|
+
gSysRoot.instance.builder.render = render;
|
|
38
38
|
triggerRendering(gSysRoot);
|
|
39
39
|
}
|
|
40
40
|
static get current() {
|
|
@@ -46,18 +46,18 @@ export class VBlock {
|
|
|
46
46
|
static runForAllBlocks(action) {
|
|
47
47
|
forEachChildRecursively(gSysRoot, action);
|
|
48
48
|
}
|
|
49
|
-
static claim(driver,
|
|
49
|
+
static claim(driver, builder, base) {
|
|
50
50
|
var _a;
|
|
51
51
|
let result;
|
|
52
52
|
const owner = gCurrent.instance;
|
|
53
53
|
const children = owner.children;
|
|
54
54
|
let ex = undefined;
|
|
55
|
-
if (
|
|
56
|
-
|
|
55
|
+
if (builder)
|
|
56
|
+
builder.base = base;
|
|
57
57
|
else
|
|
58
|
-
|
|
59
|
-
let key =
|
|
60
|
-
if (driver.
|
|
58
|
+
builder = base !== null && base !== void 0 ? base : {};
|
|
59
|
+
let key = builder.key;
|
|
60
|
+
if (driver.isRow) {
|
|
61
61
|
const last = children.lastClaimedItem();
|
|
62
62
|
if (((_a = last === null || last === void 0 ? void 0 : last.instance) === null || _a === void 0 ? void 0 : _a.driver) === driver)
|
|
63
63
|
ex = last;
|
|
@@ -67,16 +67,16 @@ export class VBlock {
|
|
|
67
67
|
result = ex.instance;
|
|
68
68
|
if (result.driver !== driver && driver !== undefined)
|
|
69
69
|
throw new Error(`changing block driver is not yet supported: "${result.driver.name}" -> "${driver === null || driver === void 0 ? void 0 : driver.name}"`);
|
|
70
|
-
const exTriggers = result.
|
|
71
|
-
if (triggersAreEqual(
|
|
72
|
-
|
|
73
|
-
result.
|
|
70
|
+
const exTriggers = result.builder.triggers;
|
|
71
|
+
if (triggersAreEqual(builder.triggers, exTriggers))
|
|
72
|
+
builder.triggers = exTriggers;
|
|
73
|
+
result.builder = builder;
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
result = new VBlockImpl(key || VBlock.generateKey(owner), driver, owner,
|
|
76
|
+
result = new VBlockImpl(key || VBlock.generateKey(owner), driver, owner, builder);
|
|
77
77
|
result.item = children.add(result);
|
|
78
78
|
VBlockImpl.grandCount++;
|
|
79
|
-
if (isReaction(
|
|
79
|
+
if (isReaction(builder))
|
|
80
80
|
VBlockImpl.disposableCount++;
|
|
81
81
|
}
|
|
82
82
|
return result;
|
|
@@ -102,103 +102,118 @@ VBlock.shortFrameDuration = 16;
|
|
|
102
102
|
VBlock.longFrameDuration = 300;
|
|
103
103
|
VBlock.currentRenderingPriority = Priority.Realtime;
|
|
104
104
|
VBlock.frameDuration = VBlock.longFrameDuration;
|
|
105
|
-
export var
|
|
106
|
-
(function (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
})(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
get isSequential() { return (this.layout & 1) === 0; }
|
|
116
|
-
get isAuxiliary() { return (this.layout & 2) === 2; }
|
|
117
|
-
get isBlock() { return this.layout === LayoutKind.Block; }
|
|
118
|
-
get isGrid() { return this.layout === LayoutKind.Grid; }
|
|
119
|
-
get isLine() { return this.layout === LayoutKind.Line; }
|
|
120
|
-
constructor(name, layout, createCursor) {
|
|
105
|
+
export var Layout;
|
|
106
|
+
(function (Layout) {
|
|
107
|
+
Layout[Layout["Section"] = 0] = "Section";
|
|
108
|
+
Layout[Layout["Table"] = 1] = "Table";
|
|
109
|
+
Layout[Layout["Row"] = 2] = "Row";
|
|
110
|
+
Layout[Layout["Group"] = 3] = "Group";
|
|
111
|
+
Layout[Layout["Note"] = 4] = "Note";
|
|
112
|
+
})(Layout || (Layout = {}));
|
|
113
|
+
export class Driver {
|
|
114
|
+
constructor(name, isRow, preset) {
|
|
121
115
|
this.name = name;
|
|
122
|
-
this.
|
|
123
|
-
this.
|
|
116
|
+
this.isRow = isRow;
|
|
117
|
+
this.preset = preset;
|
|
124
118
|
}
|
|
125
|
-
|
|
119
|
+
create(block, b) {
|
|
120
|
+
}
|
|
121
|
+
claim(block) {
|
|
122
|
+
const b = block;
|
|
123
|
+
invokeClaim(b, b.builder);
|
|
124
|
+
}
|
|
125
|
+
initialize(block) {
|
|
126
|
+
var _a;
|
|
126
127
|
const b = block;
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
(_a = this.preset) === null || _a === void 0 ? void 0 : _a.call(this, b);
|
|
129
|
+
invokeInitialize(b, b.builder);
|
|
129
130
|
}
|
|
130
131
|
deploy(block) {
|
|
131
132
|
}
|
|
132
133
|
render(block) {
|
|
133
|
-
|
|
134
|
+
invokeRender(block, block.builder);
|
|
134
135
|
}
|
|
135
136
|
finalize(block, isLeader) {
|
|
136
137
|
const b = block;
|
|
137
|
-
|
|
138
|
-
b.native = null;
|
|
138
|
+
invokeFinalize(b, b.builder);
|
|
139
139
|
return isLeader;
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
applyChildrenLayout(block, value) {
|
|
142
|
+
const b = block;
|
|
143
|
+
if (value === Layout.Table)
|
|
144
|
+
b.cursor = new TableCursor();
|
|
145
|
+
else
|
|
146
|
+
b.cursor = new Cursor();
|
|
142
147
|
}
|
|
143
|
-
|
|
148
|
+
applyCellRange(block, value) {
|
|
144
149
|
}
|
|
145
|
-
|
|
150
|
+
applyWidthGrowth(block, value) {
|
|
146
151
|
}
|
|
147
|
-
|
|
152
|
+
applyMinWidth(block, value) {
|
|
148
153
|
}
|
|
149
|
-
|
|
154
|
+
applyMaxWidth(block, value) {
|
|
150
155
|
}
|
|
151
|
-
|
|
156
|
+
applyHeightGrowth(block, value) {
|
|
152
157
|
}
|
|
153
|
-
|
|
158
|
+
applyMinHeight(block, value) {
|
|
154
159
|
}
|
|
155
|
-
|
|
160
|
+
applyMaxHeight(block, value) {
|
|
156
161
|
}
|
|
157
|
-
|
|
162
|
+
applyContentAlignment(block, value) {
|
|
158
163
|
}
|
|
159
|
-
|
|
164
|
+
applyBlockAlignment(block, value) {
|
|
160
165
|
}
|
|
161
|
-
|
|
166
|
+
applyContentWrapping(block, value) {
|
|
162
167
|
}
|
|
163
|
-
|
|
168
|
+
applyOverlayVisible(block, value) {
|
|
169
|
+
}
|
|
170
|
+
applyStyle(block, secondary, styleName, enabled) {
|
|
164
171
|
}
|
|
165
172
|
}
|
|
166
|
-
|
|
167
|
-
function isReaction(
|
|
173
|
+
Driver.fragment = new Driver("fragment", false, b => b.childrenLayout = Layout.Group);
|
|
174
|
+
function isReaction(builder) {
|
|
168
175
|
var _a;
|
|
169
|
-
return (_a =
|
|
176
|
+
return (_a = builder === null || builder === void 0 ? void 0 : builder.reaction) !== null && _a !== void 0 ? _a : ((builder === null || builder === void 0 ? void 0 : builder.base) ? isReaction(builder === null || builder === void 0 ? void 0 : builder.base) : false);
|
|
170
177
|
}
|
|
171
|
-
function
|
|
172
|
-
const
|
|
173
|
-
const base =
|
|
178
|
+
function invokeClaim(block, builder) {
|
|
179
|
+
const claim = builder.claim;
|
|
180
|
+
const base = builder.base;
|
|
181
|
+
if (claim)
|
|
182
|
+
claim(block, base ? () => invokeClaim(block, base) : NOP);
|
|
183
|
+
else if (base)
|
|
184
|
+
invokeClaim(block, base);
|
|
185
|
+
}
|
|
186
|
+
function invokeInitialize(block, builder) {
|
|
187
|
+
const initialize = builder.initialize;
|
|
188
|
+
const base = builder.base;
|
|
174
189
|
if (initialize)
|
|
175
|
-
initialize(block, base ? () =>
|
|
190
|
+
initialize(block, base ? () => invokeInitialize(block, base) : NOP);
|
|
176
191
|
else if (base)
|
|
177
|
-
|
|
192
|
+
invokeInitialize(block, base);
|
|
178
193
|
}
|
|
179
|
-
function
|
|
180
|
-
const render =
|
|
181
|
-
const base =
|
|
194
|
+
function invokeRender(block, builder) {
|
|
195
|
+
const render = builder.render;
|
|
196
|
+
const base = builder.base;
|
|
182
197
|
if (render)
|
|
183
|
-
render(block, base ? () =>
|
|
198
|
+
render(block, base ? () => invokeRender(block, base) : NOP);
|
|
184
199
|
else if (base)
|
|
185
|
-
|
|
200
|
+
invokeRender(block, base);
|
|
186
201
|
}
|
|
187
|
-
function
|
|
188
|
-
const finalize =
|
|
189
|
-
const base =
|
|
202
|
+
function invokeFinalize(block, builder) {
|
|
203
|
+
const finalize = builder.finalize;
|
|
204
|
+
const base = builder.base;
|
|
190
205
|
if (finalize)
|
|
191
|
-
finalize(block, base ? () =>
|
|
206
|
+
finalize(block, base ? () => invokeFinalize(block, base) : NOP);
|
|
192
207
|
else if (base)
|
|
193
|
-
|
|
208
|
+
invokeFinalize(block, base);
|
|
194
209
|
}
|
|
195
|
-
export class StaticDriver extends
|
|
196
|
-
constructor(element, name,
|
|
197
|
-
super(name,
|
|
210
|
+
export class StaticDriver extends Driver {
|
|
211
|
+
constructor(element, name, isRow, preset) {
|
|
212
|
+
super(name, isRow, preset);
|
|
198
213
|
this.element = element;
|
|
199
214
|
}
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
create(block, b) {
|
|
216
|
+
b.native = this.element;
|
|
202
217
|
}
|
|
203
218
|
}
|
|
204
219
|
export class ContextVariable {
|
|
@@ -235,14 +250,14 @@ __decorate([
|
|
|
235
250
|
__metadata("design:type", ContextVariable)
|
|
236
251
|
], VBlockContext.prototype, "variable", void 0);
|
|
237
252
|
class VBlockImpl extends VBlock {
|
|
238
|
-
constructor(key, driver, owner,
|
|
253
|
+
constructor(key, driver, owner, builder) {
|
|
239
254
|
super();
|
|
240
255
|
this.key = key;
|
|
241
256
|
this.driver = driver;
|
|
242
|
-
this.
|
|
257
|
+
this.builder = builder;
|
|
243
258
|
this.model = undefined;
|
|
244
|
-
this.
|
|
245
|
-
this.
|
|
259
|
+
this.appliedChildrenLayout = Layout.Row;
|
|
260
|
+
this.appliedPlacement = undefined;
|
|
246
261
|
this.appliedCellRange = Cursor.UndefinedCellRange;
|
|
247
262
|
this.appliedWidthGrowth = 0;
|
|
248
263
|
this.appliedMinWidth = "";
|
|
@@ -251,41 +266,54 @@ class VBlockImpl extends VBlock {
|
|
|
251
266
|
this.appliedMinHeight = "";
|
|
252
267
|
this.appliedMaxHeight = "";
|
|
253
268
|
this.appliedContentAlignment = Align.Default;
|
|
254
|
-
this.
|
|
269
|
+
this.appliedBlockAlignment = Align.Default;
|
|
255
270
|
this.appliedContentWrapping = false;
|
|
256
271
|
this.appliedOverlayVisible = undefined;
|
|
272
|
+
this.wasStyleApplied = false;
|
|
257
273
|
this.childrenShuffling = false;
|
|
258
274
|
this.renderingPriority = Priority.Realtime;
|
|
259
275
|
this.level = owner.level + 1;
|
|
260
276
|
this.host = owner;
|
|
261
|
-
this.children = new Collection(
|
|
277
|
+
this.children = new Collection(getBlockKey, this.isSequential);
|
|
262
278
|
this.numerator = 0;
|
|
263
279
|
this.item = undefined;
|
|
264
280
|
this.stamp = 0;
|
|
265
281
|
this.native = undefined;
|
|
266
|
-
this.
|
|
282
|
+
this.controller = undefined;
|
|
283
|
+
this.cursor = new Cursor();
|
|
267
284
|
this.outer = owner.context ? owner : owner.outer;
|
|
268
285
|
this.context = undefined;
|
|
269
286
|
}
|
|
287
|
+
render(_triggers) {
|
|
288
|
+
renderNow(this.item);
|
|
289
|
+
}
|
|
290
|
+
get isSequential() { return (this.childrenLayout & 1) === 0; }
|
|
291
|
+
get isAuxiliary() { return (this.childrenLayout & 2) === 2; }
|
|
292
|
+
get isSection() { return this.childrenLayout === Layout.Section; }
|
|
293
|
+
get isTable() { return this.childrenLayout === Layout.Table; }
|
|
270
294
|
get isMoved() {
|
|
271
295
|
let owner = this.host;
|
|
272
|
-
if (owner.driver.
|
|
296
|
+
if (owner.driver.isRow)
|
|
273
297
|
owner = owner.host;
|
|
274
298
|
return owner.children.isMoved(this.item);
|
|
275
299
|
}
|
|
276
|
-
|
|
277
|
-
|
|
300
|
+
get childrenLayout() { return this.appliedChildrenLayout; }
|
|
301
|
+
set childrenLayout(value) {
|
|
302
|
+
if (value !== this.appliedChildrenLayout || this.stamp < 2) {
|
|
303
|
+
this.driver.applyChildrenLayout(this, value);
|
|
304
|
+
this.appliedChildrenLayout = value;
|
|
305
|
+
}
|
|
278
306
|
}
|
|
279
|
-
get
|
|
280
|
-
set
|
|
281
|
-
if (this.
|
|
307
|
+
get placement() { return this.appliedPlacement; }
|
|
308
|
+
set placement(value) {
|
|
309
|
+
if (this.appliedPlacement !== undefined)
|
|
282
310
|
throw new Error("cells can be assigned only once during rendering");
|
|
283
311
|
const cellRange = this.host.cursor.onwards(value);
|
|
284
312
|
if (!equalCellRanges(cellRange, this.appliedCellRange)) {
|
|
285
313
|
this.driver.applyCellRange(this, cellRange);
|
|
286
314
|
this.appliedCellRange = cellRange;
|
|
287
315
|
}
|
|
288
|
-
this.
|
|
316
|
+
this.appliedPlacement = value !== null && value !== void 0 ? value : {};
|
|
289
317
|
}
|
|
290
318
|
get widthGrowth() { return this.appliedWidthGrowth; }
|
|
291
319
|
set widthGrowth(value) {
|
|
@@ -336,11 +364,11 @@ class VBlockImpl extends VBlock {
|
|
|
336
364
|
this.appliedContentAlignment = value;
|
|
337
365
|
}
|
|
338
366
|
}
|
|
339
|
-
get
|
|
340
|
-
set
|
|
341
|
-
if (value !== this.
|
|
342
|
-
this.driver.
|
|
343
|
-
this.
|
|
367
|
+
get blockAlignment() { return this.appliedBlockAlignment; }
|
|
368
|
+
set blockAlignment(value) {
|
|
369
|
+
if (value !== this.appliedBlockAlignment) {
|
|
370
|
+
this.driver.applyBlockAlignment(this, value);
|
|
371
|
+
this.appliedBlockAlignment = value;
|
|
344
372
|
}
|
|
345
373
|
}
|
|
346
374
|
get contentWrapping() { return this.appliedContentWrapping; }
|
|
@@ -358,11 +386,11 @@ class VBlockImpl extends VBlock {
|
|
|
358
386
|
}
|
|
359
387
|
}
|
|
360
388
|
style(styleName, enabled) {
|
|
361
|
-
this.driver.
|
|
362
|
-
this.
|
|
389
|
+
this.driver.applyStyle(this, this.wasStyleApplied, styleName, enabled);
|
|
390
|
+
this.wasStyleApplied = true;
|
|
363
391
|
}
|
|
364
392
|
configureReactronic(options) {
|
|
365
|
-
if (this.stamp !== 1 || !isReaction(this.
|
|
393
|
+
if (this.stamp !== 1 || !isReaction(this.builder))
|
|
366
394
|
throw new Error("reactronic can be configured only for reacting blocks and only inside initialize");
|
|
367
395
|
return Rx.getController(this.render).configure(options);
|
|
368
396
|
}
|
|
@@ -431,20 +459,20 @@ function runRenderNestedTreesThenDo(error, action) {
|
|
|
431
459
|
for (const item of children.removedItems(true))
|
|
432
460
|
triggerFinalization(item, true, true);
|
|
433
461
|
if (!error) {
|
|
434
|
-
const
|
|
435
|
-
const sequential = children.
|
|
462
|
+
const ownerIsSection = owner.isSection;
|
|
463
|
+
const sequential = children.isStrict;
|
|
436
464
|
const cursor = owner.cursor;
|
|
437
465
|
let p1 = undefined;
|
|
438
466
|
let p2 = undefined;
|
|
439
467
|
let redeploy = false;
|
|
440
|
-
let
|
|
468
|
+
let hostingRow = owner;
|
|
441
469
|
cursor.reset();
|
|
442
470
|
for (const item of children.items()) {
|
|
443
471
|
if (Transaction.isCanceled)
|
|
444
472
|
break;
|
|
445
473
|
const block = item.instance;
|
|
446
|
-
const
|
|
447
|
-
const host =
|
|
474
|
+
const isRow = block.driver.isRow;
|
|
475
|
+
const host = isRow ? owner : hostingRow;
|
|
448
476
|
const p = (_a = block.renderingPriority) !== null && _a !== void 0 ? _a : Priority.Realtime;
|
|
449
477
|
redeploy = markToRedeployIfNecessary(redeploy, host, item, children, sequential);
|
|
450
478
|
if (p === Priority.Realtime)
|
|
@@ -453,8 +481,8 @@ function runRenderNestedTreesThenDo(error, action) {
|
|
|
453
481
|
p1 = push(item, p1);
|
|
454
482
|
else
|
|
455
483
|
p2 = push(item, p2);
|
|
456
|
-
if (
|
|
457
|
-
|
|
484
|
+
if (ownerIsSection && isRow)
|
|
485
|
+
hostingRow = block;
|
|
458
486
|
}
|
|
459
487
|
if (!Transaction.isCanceled && (p1 !== undefined || p2 !== undefined))
|
|
460
488
|
promised = startIncrementalRendering(current, children, p1, p2).then(() => action(error), e => action(e));
|
|
@@ -522,7 +550,7 @@ function renderIncrementally(owner, stamp, allChildren, items, priority) {
|
|
|
522
550
|
function triggerRendering(item) {
|
|
523
551
|
const block = item.instance;
|
|
524
552
|
if (block.stamp >= 0) {
|
|
525
|
-
if (isReaction(block.
|
|
553
|
+
if (isReaction(block.builder)) {
|
|
526
554
|
if (block.stamp === 0) {
|
|
527
555
|
Transaction.outside(() => {
|
|
528
556
|
if (Rx.isLogging)
|
|
@@ -532,7 +560,7 @@ function triggerRendering(item) {
|
|
|
532
560
|
});
|
|
533
561
|
});
|
|
534
562
|
}
|
|
535
|
-
nonreactive(block.render, block.
|
|
563
|
+
nonreactive(block.render, block.builder.triggers);
|
|
536
564
|
}
|
|
537
565
|
else
|
|
538
566
|
renderNow(item);
|
|
@@ -543,7 +571,8 @@ function redeployIfNecessary(block) {
|
|
|
543
571
|
if (block.stamp === 0) {
|
|
544
572
|
block.stamp = 1;
|
|
545
573
|
nonreactive(() => {
|
|
546
|
-
driver.
|
|
574
|
+
driver.create(block, block);
|
|
575
|
+
driver.initialize(block);
|
|
547
576
|
driver.deploy(block);
|
|
548
577
|
});
|
|
549
578
|
}
|
|
@@ -559,14 +588,15 @@ function renderNow(item) {
|
|
|
559
588
|
redeployIfNecessary(block);
|
|
560
589
|
block.stamp++;
|
|
561
590
|
block.numerator = 0;
|
|
562
|
-
block.
|
|
563
|
-
block.
|
|
591
|
+
block.appliedPlacement = undefined;
|
|
592
|
+
block.wasStyleApplied = false;
|
|
564
593
|
block.children.beginMerge();
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
594
|
+
const driver = block.driver;
|
|
595
|
+
result = driver.render(block);
|
|
596
|
+
if (driver.isRow)
|
|
597
|
+
block.host.cursor.rowBreak();
|
|
598
|
+
else if (block.appliedPlacement === undefined)
|
|
599
|
+
block.placement = undefined;
|
|
570
600
|
if (result instanceof Promise)
|
|
571
601
|
result.then(v => { runRenderNestedTreesThenDo(undefined, NOP); return v; }, e => { console.log(e); runRenderNestedTreesThenDo(e !== null && e !== void 0 ? e : new Error("unknown error"), NOP); });
|
|
572
602
|
else
|
|
@@ -583,11 +613,14 @@ function renderNow(item) {
|
|
|
583
613
|
function triggerFinalization(item, isLeader, individual) {
|
|
584
614
|
const block = item.instance;
|
|
585
615
|
if (block.stamp >= 0) {
|
|
586
|
-
|
|
616
|
+
const driver = block.driver;
|
|
617
|
+
if (individual && block.key !== block.builder.key && !driver.isRow)
|
|
587
618
|
console.log(`WARNING: it is recommended to assign explicit key for conditionally rendered block in order to avoid unexpected side effects: ${block.key}`);
|
|
588
619
|
block.stamp = ~block.stamp;
|
|
589
|
-
const childrenAreLeaders = nonreactive(() =>
|
|
590
|
-
|
|
620
|
+
const childrenAreLeaders = nonreactive(() => driver.finalize(block, isLeader));
|
|
621
|
+
block.native = null;
|
|
622
|
+
block.controller = null;
|
|
623
|
+
if (isReaction(block.builder)) {
|
|
591
624
|
item.aux = undefined;
|
|
592
625
|
const last = gLastToDispose;
|
|
593
626
|
if (last)
|
|
@@ -692,7 +725,7 @@ function defaultReject(error) {
|
|
|
692
725
|
}
|
|
693
726
|
Promise.prototype.then = reactronicDomHookedThen;
|
|
694
727
|
const NOP = (...args) => { };
|
|
695
|
-
const gSysDriver = new StaticDriver(null, "SYSTEM",
|
|
728
|
+
const gSysDriver = new StaticDriver(null, "SYSTEM", false, b => b.childrenLayout = Layout.Group);
|
|
696
729
|
const gSysRoot = Collection.createItem(new VBlockImpl(gSysDriver.name, gSysDriver, { level: 0 }, { reaction: true, render: NOP }));
|
|
697
730
|
gSysRoot.instance.item = gSysRoot;
|
|
698
731
|
Object.defineProperty(gSysRoot.instance, "host", {
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { VBlock,
|
|
1
|
+
import { VBlock, Layout, BlockBuilder, Align, CellRange } from "../core/api";
|
|
2
2
|
import { HtmlDriver } from "./HtmlDriver";
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare class
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
export declare function VSection<M = unknown, R = void>(builder?: BlockBuilder<HTMLElement, M, R>, base?: BlockBuilder<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
|
|
4
|
+
export declare function VTable<M = unknown, R = void>(builder?: BlockBuilder<HTMLElement, M, R>, base?: BlockBuilder<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
|
|
5
|
+
export declare function row<T = void>(builder?: (block: void) => T, key?: string): void;
|
|
6
|
+
export declare function fromNewRow(key?: string): void;
|
|
7
|
+
export declare function VNote(content: string, builder?: BlockBuilder<HTMLElement, void, void>): VBlock<HTMLElement, void, void>;
|
|
8
|
+
export declare function VHtmlNote(content: string, builder?: BlockBuilder<HTMLElement, void, void>): VBlock<HTMLElement, void, void>;
|
|
9
|
+
export declare function VGroup<M = unknown, R = void>(builder?: BlockBuilder<HTMLElement, M, R>, base?: BlockBuilder<HTMLElement, M, R>): VBlock<HTMLElement, M, R>;
|
|
10
|
+
export declare class VerstakHtmlDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
11
|
+
applyChildrenLayout(block: VBlock<T, any, any>, value: Layout): void;
|
|
12
|
+
applyCellRange(block: VBlock<T>, value: CellRange | undefined): void;
|
|
13
|
+
applyWidthGrowth(block: VBlock<T>, value: number): void;
|
|
14
|
+
applyMinWidth(block: VBlock<T>, value: string): void;
|
|
15
|
+
applyMaxWidth(block: VBlock<T>, value: string): void;
|
|
16
|
+
applyHeightGrowth(block: VBlock<T>, value: number): void;
|
|
17
|
+
applyMinHeight(block: VBlock<T>, value: string): void;
|
|
18
|
+
applyMaxHeight(block: VBlock<T>, value: string): void;
|
|
19
|
+
applyContentAlignment(block: VBlock<T>, value: Align): void;
|
|
20
|
+
applyBlockAlignment(block: VBlock<T>, value: Align): void;
|
|
21
|
+
applyContentWrapping(block: VBlock<T>, value: boolean): void;
|
|
22
|
+
applyOverlayVisible(block: VBlock<T>, value: boolean | undefined): void;
|
|
23
|
+
applyStyle(block: VBlock<T, any, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
23
24
|
render(block: VBlock<T>): void | Promise<void>;
|
|
24
25
|
}
|