verstak 0.23.109 → 0.23.111

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.
@@ -13,7 +13,7 @@ export declare enum BlockKind {
13
13
  Native = 6
14
14
  }
15
15
  export interface Block<T = unknown, M = unknown, C = unknown, R = void> {
16
- readonly descriptor: BlockDescriptor<T, M, C, R>;
16
+ readonly node: BlockNode<T, M, C, R>;
17
17
  readonly native: T;
18
18
  readonly isBand: boolean;
19
19
  readonly isTable: boolean;
@@ -31,14 +31,14 @@ export interface Block<T = unknown, M = unknown, C = unknown, R = void> {
31
31
  blockAlignment: Align;
32
32
  contentWrapping: boolean;
33
33
  overlayVisible: boolean | undefined;
34
- childrenShuffling: boolean;
35
34
  renderingPriority?: Priority;
36
- isSequential: boolean;
35
+ childrenShuffling: boolean;
36
+ strictOrder: boolean;
37
37
  readonly isInitialRendering: boolean;
38
38
  useStyle(styleName: string, enabled?: boolean): void;
39
39
  configureReactronic(options: Partial<MemberOptions>): MemberOptions;
40
40
  }
41
- export interface BlockDescriptor<T = unknown, M = unknown, C = unknown, R = void> {
41
+ export interface BlockNode<T = unknown, M = unknown, C = unknown, R = void> {
42
42
  readonly key: string;
43
43
  readonly driver: Driver<T>;
44
44
  readonly builder: Readonly<BlockBuilder<T, M, C, R>>;
@@ -46,7 +46,7 @@ export interface BlockDescriptor<T = unknown, M = unknown, C = unknown, R = void
46
46
  readonly owner: Block;
47
47
  readonly host: Block;
48
48
  readonly children: CollectionReader<Block>;
49
- readonly item: Item<Block> | undefined;
49
+ readonly ties: Item<Block> | undefined;
50
50
  readonly stamp: number;
51
51
  readonly outer: Block;
52
52
  readonly context: BlockCtx | undefined;
@@ -106,7 +106,7 @@ export declare const enum Priority {
106
106
  export declare enum Mode {
107
107
  Default = 0,
108
108
  PinpointRefresh = 1,
109
- ManualMounting = 2
109
+ ManualMount = 2
110
110
  }
111
111
  export declare enum Align {
112
112
  Stretch = 0,
@@ -18,7 +18,7 @@ export var Mode;
18
18
  (function (Mode) {
19
19
  Mode[Mode["Default"] = 0] = "Default";
20
20
  Mode[Mode["PinpointRefresh"] = 1] = "PinpointRefresh";
21
- Mode[Mode["ManualMounting"] = 2] = "ManualMounting";
21
+ Mode[Mode["ManualMount"] = 2] = "ManualMount";
22
22
  })(Mode || (Mode = {}));
23
23
  export var Align;
24
24
  (function (Align) {
@@ -7,6 +7,7 @@ export declare class Verstak {
7
7
  static frameDuration: number;
8
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
9
  static get block(): Block;
10
+ static triggerRendering(block: Block<any, any, any, void>, triggers: unknown): void;
10
11
  static renderNestedTreesThenDo(action: (error: unknown) => void): void;
11
12
  static getDefaultLoggingOptions(): LoggingOptions | undefined;
12
13
  static setDefaultLoggingOptions(logging?: LoggingOptions): void;
@@ -60,7 +61,7 @@ export declare class CursorCommandDriver extends BaseDriver<CursorCommand, void>
60
61
  controller?: void;
61
62
  }): void;
62
63
  }
63
- export declare class ContextVariable<T extends Object = Object> {
64
+ export declare class SubTreeVariable<T extends Object = Object> {
64
65
  readonly defaultValue: T | undefined;
65
66
  constructor(defaultValue?: T);
66
67
  set value(value: T);
@@ -31,32 +31,32 @@ export class Verstak {
31
31
  const owner = gCurrent === null || gCurrent === void 0 ? void 0 : gCurrent.instance;
32
32
  if (owner) {
33
33
  let ex = undefined;
34
- const children = owner.descriptor.children;
34
+ const children = owner.node.children;
35
35
  if (driver.isRow) {
36
36
  const last = children.lastClaimedItem();
37
- if (((_a = last === null || last === void 0 ? void 0 : last.instance) === null || _a === void 0 ? void 0 : _a.descriptor.driver) === driver)
37
+ if (((_a = last === null || last === void 0 ? void 0 : last.instance) === null || _a === void 0 ? void 0 : _a.node.driver) === driver)
38
38
  ex = last;
39
39
  }
40
40
  ex !== null && ex !== void 0 ? ex : (ex = children.claim(key = key || generateKey(owner), undefined, "nested blocks can be declared inside render function only"));
41
41
  if (ex) {
42
42
  result = ex.instance;
43
- const d = result.descriptor;
44
- if (d.driver !== driver && driver !== undefined)
45
- throw new Error(`changing block driver is not yet supported: "${result.descriptor.driver.name}" -> "${driver === null || driver === void 0 ? void 0 : driver.name}"`);
46
- const exTriggers = d.builder.triggers;
43
+ const node = result.node;
44
+ if (node.driver !== driver && driver !== undefined)
45
+ throw new Error(`changing block driver is not yet supported: "${result.node.driver.name}" -> "${driver === null || driver === void 0 ? void 0 : driver.name}"`);
46
+ const exTriggers = node.builder.triggers;
47
47
  if (triggersAreEqual(builder.triggers, exTriggers))
48
48
  builder.triggers = exTriggers;
49
- d.builder = builder;
49
+ node.builder = builder;
50
50
  }
51
51
  else {
52
52
  result = new BlockImpl(key || generateKey(owner), driver, owner, builder);
53
- result.descriptor.item = children.add(result);
53
+ result.node.ties = children.add(result);
54
54
  }
55
55
  }
56
56
  else {
57
57
  result = new BlockImpl(key || "", driver, owner, builder);
58
- result.descriptor.item = Collection.createItem(result);
59
- triggerRendering(result.descriptor.item);
58
+ result.node.ties = Collection.createItem(result);
59
+ triggerRendering(result.node.ties);
60
60
  }
61
61
  return result;
62
62
  }
@@ -65,6 +65,14 @@ export class Verstak {
65
65
  throw new Error("current block is undefined");
66
66
  return gCurrent.instance;
67
67
  }
68
+ static triggerRendering(block, triggers) {
69
+ const b = block;
70
+ const builder = b.node.builder;
71
+ if (!triggersAreEqual(triggers, builder.triggers)) {
72
+ builder.triggers = triggers;
73
+ triggerRendering(b.node.ties);
74
+ }
75
+ }
68
76
  static renderNestedTreesThenDo(action) {
69
77
  runRenderNestedTreesThenDo(undefined, action);
70
78
  }
@@ -87,25 +95,25 @@ export class BaseDriver {
87
95
  }
88
96
  claim(block) {
89
97
  const b = block;
90
- chainedClaim(b, b.descriptor.builder);
98
+ chainedClaim(b, b.node.builder);
91
99
  }
92
100
  create(block, b) {
93
- chainedCreate(block, block.descriptor.builder);
101
+ chainedCreate(block, block.node.builder);
94
102
  }
95
103
  initialize(block) {
96
104
  var _a;
97
105
  const b = block;
98
106
  (_a = this.preset) === null || _a === void 0 ? void 0 : _a.call(this, b);
99
- chainedInitialize(b, b.descriptor.builder);
107
+ chainedInitialize(b, b.node.builder);
100
108
  }
101
109
  mount(block) {
102
110
  }
103
111
  render(block) {
104
- chainedRender(block, block.descriptor.builder);
112
+ chainedRender(block, block.node.builder);
105
113
  }
106
114
  finalize(block, isLeader) {
107
115
  const b = block;
108
- chainedFinalize(b, b.descriptor.builder);
116
+ chainedFinalize(b, b.node.builder);
109
117
  return isLeader;
110
118
  }
111
119
  applyKind(block, value) { }
@@ -124,7 +132,7 @@ export class BaseDriver {
124
132
  }
125
133
  BaseDriver.fragment = new BaseDriver("fragment", false, b => b.kind = BlockKind.Group);
126
134
  function generateKey(owner) {
127
- const n = owner.descriptor.numerator++;
135
+ const n = owner.node.numerator++;
128
136
  const lettered = emitLetters(n);
129
137
  let result;
130
138
  if (Rx.isLogging)
@@ -197,18 +205,18 @@ export class CursorCommandDriver extends BaseDriver {
197
205
  super.create(block, b);
198
206
  }
199
207
  }
200
- export class ContextVariable {
208
+ export class SubTreeVariable {
201
209
  constructor(defaultValue) {
202
210
  this.defaultValue = defaultValue;
203
211
  }
204
212
  set value(value) {
205
- BlockImpl.setContextVariableValue(this, value);
213
+ BlockImpl.setSubTreeVariableValue(this, value);
206
214
  }
207
215
  get value() {
208
- return BlockImpl.useContextVariableValue(this);
216
+ return BlockImpl.useSubTreeVariableValue(this);
209
217
  }
210
218
  get valueOrUndefined() {
211
- return BlockImpl.tryUseContextVariable(this);
219
+ return BlockImpl.tryUseSubTreeVariable(this);
212
220
  }
213
221
  }
214
222
  class CursorPosition {
@@ -243,9 +251,9 @@ __decorate([
243
251
  ], BlockCtxImpl.prototype, "next", void 0);
244
252
  __decorate([
245
253
  raw,
246
- __metadata("design:type", ContextVariable)
254
+ __metadata("design:type", SubTreeVariable)
247
255
  ], BlockCtxImpl.prototype, "variable", void 0);
248
- class BlockDescriptorImpl {
256
+ class BlockNodeImpl {
249
257
  constructor(key, driver, builder, self, owner) {
250
258
  this.maxColumnCount = 0;
251
259
  this.maxRowCount = 0;
@@ -253,10 +261,10 @@ class BlockDescriptorImpl {
253
261
  this.driver = driver;
254
262
  this.builder = builder;
255
263
  if (owner) {
256
- const d = owner.descriptor;
257
- this.level = d.level + 1;
264
+ const node = owner.node;
265
+ this.level = node.level + 1;
258
266
  this.owner = owner;
259
- this.outer = d.context ? owner : d.outer;
267
+ this.outer = node.context ? owner : node.outer;
260
268
  }
261
269
  else {
262
270
  this.level = 1;
@@ -265,7 +273,7 @@ class BlockDescriptorImpl {
265
273
  }
266
274
  this.host = self;
267
275
  this.children = new Collection(getBlockKey, true);
268
- this.item = undefined;
276
+ this.ties = undefined;
269
277
  this.stamp = 0;
270
278
  this.context = undefined;
271
279
  this.numerator = 0;
@@ -276,7 +284,7 @@ class BlockDescriptorImpl {
276
284
  }
277
285
  class BlockImpl {
278
286
  constructor(key, driver, owner, builder) {
279
- this.descriptor = new BlockDescriptorImpl(key, driver, builder, this, owner);
287
+ this.node = new BlockNodeImpl(key, driver, builder, this, owner);
280
288
  this.native = undefined;
281
289
  this.model = undefined;
282
290
  this.controller = undefined;
@@ -291,49 +299,49 @@ class BlockImpl {
291
299
  this._maxHeight = "";
292
300
  this._contentAlignment = Align.Default;
293
301
  this._blockAlignment = Align.Default;
294
- this._contentWrapping = false;
302
+ this._contentWrapping = true;
295
303
  this._overlayVisible = undefined;
296
304
  this._hasStyles = false;
297
- this.childrenShuffling = false;
298
305
  this.renderingPriority = Priority.Realtime;
299
- BlockImpl.grandCount++;
306
+ this.childrenShuffling = false;
307
+ BlockImpl.grandBlockCount++;
300
308
  if (this.isOn(Mode.PinpointRefresh))
301
- BlockImpl.disposableCount++;
309
+ BlockImpl.disposableBlockCount++;
302
310
  }
303
311
  render(_triggers) {
304
- renderNow(this.descriptor.item);
312
+ renderNow(this.node.ties);
305
313
  }
306
314
  prepareForRender() {
307
315
  this._area = undefined;
308
316
  this._hasStyles = false;
309
317
  }
310
318
  isOn(mode) {
311
- return (chainedMode(this.descriptor.builder) & mode) === mode;
319
+ return (chainedMode(this.node.builder) & mode) === mode;
312
320
  }
313
- get isInitialRendering() { return this.descriptor.stamp === 2; }
314
- get isSequential() { return this.descriptor.children.isStrict; }
315
- set isSequential(value) { this.descriptor.children.isStrict = value; }
321
+ get isInitialRendering() { return this.node.stamp === 2; }
316
322
  get isAuxiliary() { return this.kind > BlockKind.Note; }
317
323
  get isBand() { return this.kind === BlockKind.Band; }
318
324
  get isTable() { return this.kind === BlockKind.Table; }
319
- get isAutoMountingEnabled() { return !this.isOn(Mode.ManualMounting) && this.descriptor.host !== this; }
320
- get isMoved() { return this.descriptor.owner.descriptor.children.isMoved(this.descriptor.item); }
325
+ get isAutoMountEnabled() { return !this.isOn(Mode.ManualMount) && this.node.host !== this; }
326
+ get isMoved() { return this.node.owner.node.children.isMoved(this.node.ties); }
327
+ get strictOrder() { return this.node.children.isStrict; }
328
+ set strictOrder(value) { this.node.children.isStrict = value; }
321
329
  get kind() { return this._kind; }
322
330
  set kind(value) {
323
- if (value !== this._kind || this.descriptor.stamp < 2) {
324
- this.descriptor.driver.applyKind(this, value);
331
+ if (value !== this._kind || this.node.stamp < 2) {
332
+ this.node.driver.applyKind(this, value);
325
333
  this._kind = value;
326
334
  }
327
335
  }
328
336
  get area() { return this._area; }
329
337
  set area(value) {
330
338
  var _a, _b;
331
- const d = this.descriptor;
332
- const driver = d.driver;
339
+ const node = this.node;
340
+ const driver = node.driver;
333
341
  if (!driver.isRow) {
334
- const owner = d.owner.descriptor;
335
- const cursorPosition = (_b = (_a = d.item.prev) === null || _a === void 0 ? void 0 : _a.instance.descriptor.cursorPosition) !== null && _b !== void 0 ? _b : InitialCursorPosition;
336
- const newCursorPosition = d.cursorPosition = owner.children.isStrict ? new CursorPosition(cursorPosition) : undefined;
342
+ const owner = node.owner.node;
343
+ const cursorPosition = (_b = (_a = node.ties.prev) === null || _a === void 0 ? void 0 : _a.instance.node.cursorPosition) !== null && _b !== void 0 ? _b : InitialCursorPosition;
344
+ const newCursorPosition = node.cursorPosition = owner.children.isStrict ? new CursorPosition(cursorPosition) : undefined;
337
345
  const isCursorBlock = driver instanceof CursorCommandDriver;
338
346
  const coords = getEffectiveBlockCoords(!isCursorBlock, value, owner.maxColumnCount, owner.maxRowCount, cursorPosition, newCursorPosition);
339
347
  if (!equalBlockCoords(coords, this._coords)) {
@@ -348,79 +356,79 @@ class BlockImpl {
348
356
  get widthGrowth() { return this._widthGrowth; }
349
357
  set widthGrowth(value) {
350
358
  if (value !== this._widthGrowth) {
351
- this.descriptor.driver.applyWidthGrowth(this, value);
359
+ this.node.driver.applyWidthGrowth(this, value);
352
360
  this._widthGrowth = value;
353
361
  }
354
362
  }
355
363
  get minWidth() { return this._minWidth; }
356
364
  set minWidth(value) {
357
365
  if (value !== this._minWidth) {
358
- this.descriptor.driver.applyMinWidth(this, value);
366
+ this.node.driver.applyMinWidth(this, value);
359
367
  this._minWidth = value;
360
368
  }
361
369
  }
362
370
  get maxWidth() { return this._maxWidth; }
363
371
  set maxWidth(value) {
364
372
  if (value !== this._maxWidth) {
365
- this.descriptor.driver.applyMaxWidth(this, value);
373
+ this.node.driver.applyMaxWidth(this, value);
366
374
  this._maxWidth = value;
367
375
  }
368
376
  }
369
377
  get heightGrowth() { return this._heightGrowth; }
370
378
  set heightGrowth(value) {
371
379
  if (value !== this._heightGrowth) {
372
- this.descriptor.driver.applyHeightGrowth(this, value);
380
+ this.node.driver.applyHeightGrowth(this, value);
373
381
  this._heightGrowth = value;
374
382
  }
375
383
  }
376
384
  get minHeight() { return this._minHeight; }
377
385
  set minHeight(value) {
378
386
  if (value !== this._minHeight) {
379
- this.descriptor.driver.applyMinHeight(this, value);
387
+ this.node.driver.applyMinHeight(this, value);
380
388
  this._minHeight = value;
381
389
  }
382
390
  }
383
391
  get maxHeight() { return this._maxHeight; }
384
392
  set maxHeight(value) {
385
393
  if (value !== this._maxHeight) {
386
- this.descriptor.driver.applyMaxHeight(this, value);
394
+ this.node.driver.applyMaxHeight(this, value);
387
395
  this._maxHeight = value;
388
396
  }
389
397
  }
390
398
  get contentAlignment() { return this._contentAlignment; }
391
399
  set contentAlignment(value) {
392
400
  if (value !== this._contentAlignment) {
393
- this.descriptor.driver.applyContentAlignment(this, value);
401
+ this.node.driver.applyContentAlignment(this, value);
394
402
  this._contentAlignment = value;
395
403
  }
396
404
  }
397
405
  get blockAlignment() { return this._blockAlignment; }
398
406
  set blockAlignment(value) {
399
407
  if (value !== this._blockAlignment) {
400
- this.descriptor.driver.applyBlockAlignment(this, value);
408
+ this.node.driver.applyBlockAlignment(this, value);
401
409
  this._blockAlignment = value;
402
410
  }
403
411
  }
404
412
  get contentWrapping() { return this._contentWrapping; }
405
413
  set contentWrapping(value) {
406
414
  if (value !== this._contentWrapping) {
407
- this.descriptor.driver.applyContentWrapping(this, value);
415
+ this.node.driver.applyContentWrapping(this, value);
408
416
  this._contentWrapping = value;
409
417
  }
410
418
  }
411
419
  get overlayVisible() { return this._overlayVisible; }
412
420
  set overlayVisible(value) {
413
421
  if (value !== this._overlayVisible) {
414
- this.descriptor.driver.applyOverlayVisible(this, value);
422
+ this.node.driver.applyOverlayVisible(this, value);
415
423
  this._overlayVisible = value;
416
424
  }
417
425
  }
418
426
  useStyle(styleName, enabled) {
419
- this.descriptor.driver.applyStyle(this, this._hasStyles, styleName, enabled);
427
+ this.node.driver.applyStyle(this, this._hasStyles, styleName, enabled);
420
428
  this._hasStyles = true;
421
429
  }
422
430
  configureReactronic(options) {
423
- if (this.descriptor.stamp !== 1 || !this.isOn(Mode.PinpointRefresh))
431
+ if (this.node.stamp !== 1 || !this.isOn(Mode.PinpointRefresh))
424
432
  throw new Error("reactronic can be configured only for blocks with separate reaction mode and only inside initialize");
425
433
  return Rx.getController(this.render).configure(options);
426
434
  }
@@ -429,56 +437,56 @@ class BlockImpl {
429
437
  throw new Error("current block is undefined");
430
438
  return gCurrent;
431
439
  }
432
- static tryUseContextVariable(variable) {
440
+ static tryUseSubTreeVariable(variable) {
433
441
  var _a, _b;
434
442
  let b = BlockImpl.curr.instance;
435
- while (((_a = b.descriptor.context) === null || _a === void 0 ? void 0 : _a.variable) !== variable && b.descriptor.owner !== b)
436
- b = b.descriptor.outer;
437
- return (_b = b.descriptor.context) === null || _b === void 0 ? void 0 : _b.value;
443
+ while (((_a = b.node.context) === null || _a === void 0 ? void 0 : _a.variable) !== variable && b.node.owner !== b)
444
+ b = b.node.outer;
445
+ return (_b = b.node.context) === null || _b === void 0 ? void 0 : _b.value;
438
446
  }
439
- static useContextVariableValue(variable) {
447
+ static useSubTreeVariableValue(variable) {
440
448
  var _a;
441
- const result = (_a = BlockImpl.tryUseContextVariable(variable)) !== null && _a !== void 0 ? _a : variable.defaultValue;
449
+ const result = (_a = BlockImpl.tryUseSubTreeVariable(variable)) !== null && _a !== void 0 ? _a : variable.defaultValue;
442
450
  if (!result)
443
451
  throw new Error("context doesn't exist");
444
452
  return result;
445
453
  }
446
- static setContextVariableValue(variable, value) {
454
+ static setSubTreeVariableValue(variable, value) {
447
455
  const b = BlockImpl.curr.instance;
448
- const d = b.descriptor;
449
- const owner = d.owner;
450
- const hostCtx = nonreactive(() => { var _a; return (_a = owner.descriptor.context) === null || _a === void 0 ? void 0 : _a.value; });
456
+ const node = b.node;
457
+ const owner = node.owner;
458
+ const hostCtx = nonreactive(() => { var _a; return (_a = owner.node.context) === null || _a === void 0 ? void 0 : _a.value; });
451
459
  if (value && value !== hostCtx) {
452
460
  if (hostCtx)
453
- d.outer = owner;
461
+ node.outer = owner;
454
462
  else
455
- d.outer = owner.descriptor.outer;
463
+ node.outer = owner.node.outer;
456
464
  Transaction.run({ separation: true }, () => {
457
- const ctx = d.context;
465
+ const ctx = node.context;
458
466
  if (ctx) {
459
467
  ctx.variable = variable;
460
468
  ctx.value = value;
461
469
  }
462
470
  else
463
- d.context = new BlockCtxImpl(variable, value);
471
+ node.context = new BlockCtxImpl(variable, value);
464
472
  });
465
473
  }
466
474
  else if (hostCtx)
467
- d.outer = owner;
475
+ node.outer = owner;
468
476
  else
469
- d.outer = owner.descriptor.outer;
477
+ node.outer = owner.node.outer;
470
478
  }
471
479
  rowBreak() {
472
480
  var _a, _b;
473
- const d = this.descriptor;
474
- const cursorPosition = (_b = (_a = d.item.prev) === null || _a === void 0 ? void 0 : _a.instance.descriptor.cursorPosition) !== null && _b !== void 0 ? _b : InitialCursorPosition;
475
- const newCursorPosition = this.descriptor.cursorPosition = new CursorPosition(cursorPosition);
481
+ const node = this.node;
482
+ const cursorPosition = (_b = (_a = node.ties.prev) === null || _a === void 0 ? void 0 : _a.instance.node.cursorPosition) !== null && _b !== void 0 ? _b : InitialCursorPosition;
483
+ const newCursorPosition = this.node.cursorPosition = new CursorPosition(cursorPosition);
476
484
  newCursorPosition.x = 1;
477
485
  newCursorPosition.y = newCursorPosition.runningMaxY + 1;
478
486
  }
479
487
  }
480
- BlockImpl.grandCount = 0;
481
- BlockImpl.disposableCount = 0;
488
+ BlockImpl.grandBlockCount = 0;
489
+ BlockImpl.disposableBlockCount = 0;
482
490
  BlockImpl.logging = undefined;
483
491
  __decorate([
484
492
  reactive,
@@ -492,8 +500,8 @@ __decorate([
492
500
  __metadata("design:returntype", void 0)
493
501
  ], BlockImpl.prototype, "render", null);
494
502
  function getBlockKey(block) {
495
- const d = block.descriptor;
496
- return d.stamp >= 0 ? d.key : undefined;
503
+ const node = block.node;
504
+ return node.stamp >= 0 ? node.key : undefined;
497
505
  }
498
506
  function getEffectiveBlockCoords(isRegularBlock, area, maxX, maxY, cursorPosition, newCursorPosition) {
499
507
  var _a, _b;
@@ -576,7 +584,7 @@ function runRenderNestedTreesThenDo(error, action) {
576
584
  var _a;
577
585
  const curr = BlockImpl.curr;
578
586
  const owner = curr.instance;
579
- const children = owner.descriptor.children;
587
+ const children = owner.node.children;
580
588
  if (children.isMergeInProgress) {
581
589
  let promised = undefined;
582
590
  try {
@@ -594,7 +602,7 @@ function runRenderNestedTreesThenDo(error, action) {
594
602
  if (Transaction.isCanceled)
595
603
  break;
596
604
  const block = item.instance;
597
- const isRow = block.descriptor.driver.isRow;
605
+ const isRow = block.node.driver.isRow;
598
606
  const host = isRow ? owner : hostingRow;
599
607
  const p = (_a = block.renderingPriority) !== null && _a !== void 0 ? _a : Priority.Realtime;
600
608
  mounting = markToMountIfNecessary(mounting, host, item, children, sequential);
@@ -617,23 +625,23 @@ function runRenderNestedTreesThenDo(error, action) {
617
625
  }
618
626
  }
619
627
  }
620
- function markToMountIfNecessary(mounting, host, item, children, sequential) {
621
- const b = item.instance;
622
- const d = b.descriptor;
623
- if (b.native && !b.isOn(Mode.ManualMounting)) {
624
- if (mounting || d.host !== host) {
625
- children.markAsMoved(item);
628
+ function markToMountIfNecessary(mounting, host, ties, children, sequential) {
629
+ const b = ties.instance;
630
+ const node = b.node;
631
+ if (b.native && !b.isOn(Mode.ManualMount)) {
632
+ if (mounting || node.host !== host) {
633
+ children.markAsMoved(ties);
626
634
  mounting = false;
627
635
  }
628
636
  }
629
- else if (sequential && children.isMoved(item))
637
+ else if (sequential && children.isMoved(ties))
630
638
  mounting = true;
631
- d.host = host;
639
+ node.host = host;
632
640
  return mounting;
633
641
  }
634
642
  function startIncrementalRendering(owner, allChildren, priority1, priority2) {
635
643
  return __awaiter(this, void 0, void 0, function* () {
636
- const stamp = owner.instance.descriptor.stamp;
644
+ const stamp = owner.instance.node.stamp;
637
645
  if (priority1)
638
646
  yield renderIncrementally(owner, stamp, allChildren, priority1, Priority.Normal);
639
647
  if (priority2)
@@ -671,56 +679,56 @@ function renderIncrementally(owner, stamp, allChildren, items, priority) {
671
679
  }
672
680
  });
673
681
  }
674
- function triggerRendering(item) {
675
- const b = item.instance;
676
- const d = b.descriptor;
677
- if (d.stamp >= 0) {
682
+ function triggerRendering(ties) {
683
+ const b = ties.instance;
684
+ const node = b.node;
685
+ if (node.stamp >= 0) {
678
686
  if (b.isOn(Mode.PinpointRefresh)) {
679
- if (d.stamp === 0) {
687
+ if (node.stamp === 0) {
680
688
  Transaction.outside(() => {
681
689
  if (Rx.isLogging)
682
- Rx.setLoggingHint(b, d.key);
690
+ Rx.setLoggingHint(b, node.key);
683
691
  Rx.getController(b.render).configure({
684
- order: d.level,
692
+ order: node.level,
685
693
  });
686
694
  });
687
695
  }
688
- nonreactive(b.render, d.builder.triggers);
696
+ nonreactive(b.render, node.builder.triggers);
689
697
  }
690
698
  else
691
- renderNow(item);
699
+ renderNow(ties);
692
700
  }
693
701
  }
694
702
  function mountIfNecessary(block) {
695
- const d = block.descriptor;
696
- const driver = d.driver;
697
- if (d.stamp === 0) {
698
- d.stamp = 1;
703
+ const node = block.node;
704
+ const driver = node.driver;
705
+ if (node.stamp === 0) {
706
+ node.stamp = 1;
699
707
  nonreactive(() => {
700
708
  driver.create(block, block);
701
709
  driver.initialize(block);
702
- if (block.isAutoMountingEnabled)
710
+ if (block.isAutoMountEnabled)
703
711
  driver.mount(block);
704
712
  });
705
713
  }
706
- else if (block.isMoved && block.isAutoMountingEnabled)
714
+ else if (block.isMoved && block.isAutoMountEnabled)
707
715
  nonreactive(() => driver.mount(block));
708
716
  }
709
- function renderNow(item) {
710
- const b = item.instance;
711
- const d = b.descriptor;
712
- if (d.stamp >= 0) {
717
+ function renderNow(ties) {
718
+ const b = ties.instance;
719
+ const node = b.node;
720
+ if (node.stamp >= 0) {
713
721
  let result = undefined;
714
- runInside(item, () => {
722
+ runInside(ties, () => {
715
723
  try {
716
724
  mountIfNecessary(b);
717
- d.stamp++;
718
- d.numerator = 0;
725
+ node.stamp++;
726
+ node.numerator = 0;
719
727
  b.prepareForRender();
720
- d.children.beginMerge();
721
- const driver = d.driver;
728
+ node.children.beginMerge();
729
+ const driver = node.driver;
722
730
  result = driver.render(b);
723
- if (b.area === undefined && d.owner.isTable)
731
+ if (b.area === undefined && node.owner.isTable)
724
732
  b.area = undefined;
725
733
  if (result instanceof Promise)
726
734
  result.then(v => { runRenderNestedTreesThenDo(undefined, NOP); return v; }, e => { console.log(e); runRenderNestedTreesThenDo(e !== null && e !== void 0 ? e : new Error("unknown error"), NOP); });
@@ -729,38 +737,38 @@ function renderNow(item) {
729
737
  }
730
738
  catch (e) {
731
739
  runRenderNestedTreesThenDo(e, NOP);
732
- console.log(`Rendering failed: ${d.key}`);
740
+ console.log(`Rendering failed: ${node.key}`);
733
741
  console.log(`${e}`);
734
742
  }
735
743
  });
736
744
  }
737
745
  }
738
- function triggerFinalization(item, isLeader, individual) {
739
- const b = item.instance;
740
- const d = b.descriptor;
741
- if (d.stamp >= 0) {
742
- const driver = d.driver;
743
- if (individual && d.key !== d.builder.key && !driver.isRow)
744
- console.log(`WARNING: it is recommended to assign explicit key for conditionally rendered block in order to avoid unexpected side effects: ${d.key}`);
745
- d.stamp = ~d.stamp;
746
+ function triggerFinalization(ties, isLeader, individual) {
747
+ const b = ties.instance;
748
+ const node = b.node;
749
+ if (node.stamp >= 0) {
750
+ const driver = node.driver;
751
+ if (individual && node.key !== node.builder.key && !driver.isRow)
752
+ console.log(`WARNING: it is recommended to assign explicit key for conditionally rendered block in order to avoid unexpected side effects: ${node.key}`);
753
+ node.stamp = ~node.stamp;
746
754
  const childrenAreLeaders = nonreactive(() => driver.finalize(b, isLeader));
747
755
  b.native = null;
748
756
  b.controller = null;
749
757
  if (b.isOn(Mode.PinpointRefresh)) {
750
- item.aux = undefined;
758
+ ties.aux = undefined;
751
759
  const last = gLastToDispose;
752
760
  if (last)
753
- gLastToDispose = last.aux = item;
761
+ gLastToDispose = last.aux = ties;
754
762
  else
755
- gFirstToDispose = gLastToDispose = item;
756
- if (gFirstToDispose === item)
757
- Transaction.run({ separation: "disposal", hint: `runDisposalLoop(initiator=${item.instance.descriptor.key})` }, () => {
763
+ gFirstToDispose = gLastToDispose = ties;
764
+ if (gFirstToDispose === ties)
765
+ Transaction.run({ separation: "disposal", hint: `runDisposalLoop(initiator=${ties.instance.node.key})` }, () => {
758
766
  void runDisposalLoop().then(NOP, error => console.log(error));
759
767
  });
760
768
  }
761
- for (const item of d.children.items())
769
+ for (const item of node.children.items())
762
770
  triggerFinalization(item, childrenAreLeaders, false);
763
- BlockImpl.grandCount--;
771
+ BlockImpl.grandBlockCount--;
764
772
  }
765
773
  }
766
774
  function runDisposalLoop() {
@@ -772,7 +780,7 @@ function runDisposalLoop() {
772
780
  yield Transaction.requestNextFrame();
773
781
  Rx.dispose(item.instance);
774
782
  item = item.aux;
775
- BlockImpl.disposableCount--;
783
+ BlockImpl.disposableBlockCount--;
776
784
  }
777
785
  gFirstToDispose = gLastToDispose = undefined;
778
786
  });
@@ -788,10 +796,10 @@ function wrapToRunInside(func) {
788
796
  wrappedToRunInside = func;
789
797
  return wrappedToRunInside;
790
798
  }
791
- function runInside(item, func, ...args) {
799
+ function runInside(ties, func, ...args) {
792
800
  const outer = gCurrent;
793
801
  try {
794
- gCurrent = item;
802
+ gCurrent = ties;
795
803
  return func(...args);
796
804
  }
797
805
  finally {
@@ -78,7 +78,7 @@ export class VerstakHtmlDriver extends HtmlDriver {
78
78
  block.native.style.maxWidth = `${value}`;
79
79
  }
80
80
  applyHeightGrowth(block, value) {
81
- const bNode = block.descriptor;
81
+ const bNode = block.node;
82
82
  const driver = bNode.driver;
83
83
  if (driver.isRow) {
84
84
  const s = block.native.style;
@@ -88,7 +88,7 @@ export class VerstakHtmlDriver extends HtmlDriver {
88
88
  s.flexGrow = "";
89
89
  }
90
90
  else {
91
- const hostDriver = bNode.host.descriptor.driver;
91
+ const hostDriver = bNode.host.node.driver;
92
92
  if (hostDriver.isRow) {
93
93
  driver.applyBlockAlignment(block, Align.Stretch);
94
94
  hostDriver.applyHeightGrowth(bNode.host, value);
@@ -202,14 +202,14 @@ const VerstakDriversByLayout = [
202
202
  const s = b.native.style;
203
203
  s.display = "flex";
204
204
  s.flexDirection = "column";
205
- s.alignSelf = b.descriptor.owner.isTable ? "stretch" : "center";
205
+ s.alignSelf = b.node.owner.isTable ? "stretch" : "center";
206
206
  s.textAlign = "initial";
207
207
  s.flexShrink = "1";
208
208
  s.minWidth = "0";
209
209
  },
210
210
  b => {
211
211
  const s = b.native.style;
212
- s.alignSelf = b.descriptor.owner.isTable ? "stretch" : "center";
212
+ s.alignSelf = b.node.owner.isTable ? "stretch" : "center";
213
213
  s.display = "grid";
214
214
  s.flexBasis = "0";
215
215
  s.gridAutoRows = "minmax(min-content, 1fr)";
@@ -218,12 +218,9 @@ const VerstakDriversByLayout = [
218
218
  },
219
219
  b => {
220
220
  const s = b.native.style;
221
- s.alignSelf = b.descriptor.owner.isTable ? "stretch" : "center";
221
+ s.alignSelf = b.node.owner.isTable ? "stretch" : "center";
222
222
  s.display = "inline-grid";
223
223
  s.flexShrink = "1";
224
- s.overflow = "";
225
- s.textOverflow = "";
226
- s.whiteSpace = "";
227
224
  },
228
225
  b => {
229
226
  const s = b.native.style;
@@ -231,7 +228,7 @@ const VerstakDriversByLayout = [
231
228
  },
232
229
  b => {
233
230
  const s = b.native.style;
234
- s.display = b.descriptor.owner.isTable ? "none" : "flex";
231
+ s.display = b.node.owner.isTable ? "none" : "flex";
235
232
  s.flexDirection = "row";
236
233
  },
237
234
  ];
@@ -87,7 +87,7 @@ export declare function Ruby<M = unknown, R = void>(builder?: BlockBuilder<HTMLE
87
87
  export declare function S<M = unknown, R = void>(builder?: BlockBuilder<HTMLElement, M, void, R>, base?: BlockBuilder<HTMLElement, M, void, R>): Block<HTMLElement, M, void, R>;
88
88
  export declare function Samp<M = unknown, R = void>(builder?: BlockBuilder<HTMLElement, M, void, R>, base?: BlockBuilder<HTMLElement, M, void, R>): Block<HTMLElement, M, void, R>;
89
89
  export declare function Script<M = unknown, R = void>(builder?: BlockBuilder<HTMLScriptElement, M, void, R>, base?: BlockBuilder<HTMLScriptElement, M, void, R>): Block<HTMLScriptElement, M, void, R>;
90
- export declare function Section<M = unknown, R = void>(builder?: BlockBuilder<HTMLElement, M, void, R>, base?: BlockBuilder<HTMLElement, M, void, R>): Block<HTMLElement, M, void, R>;
90
+ export declare function Sctn<M = unknown, R = void>(builder?: BlockBuilder<HTMLElement, M, void, R>, base?: BlockBuilder<HTMLElement, M, void, R>): Block<HTMLElement, M, void, R>;
91
91
  export declare function Select<M = unknown, R = void>(builder?: BlockBuilder<HTMLSelectElement, M, void, R>, base?: BlockBuilder<HTMLSelectElement, M, void, R>): Block<HTMLSelectElement, M, void, R>;
92
92
  export declare function Small<M = unknown, R = void>(builder?: BlockBuilder<HTMLElement, M, void, R>, base?: BlockBuilder<HTMLElement, M, void, R>): Block<HTMLElement, M, void, R>;
93
93
  export declare function Source<M = unknown, R = void>(builder?: BlockBuilder<HTMLSourceElement, M, void, R>, base?: BlockBuilder<HTMLSourceElement, M, void, R>): Block<HTMLSourceElement, M, void, R>;
@@ -91,7 +91,7 @@ export function Ruby(builder, base) { return Verstak.claim(HtmlTags.ruby, builde
91
91
  export function S(builder, base) { return Verstak.claim(HtmlTags.s, builder, base); }
92
92
  export function Samp(builder, base) { return Verstak.claim(HtmlTags.samp, builder, base); }
93
93
  export function Script(builder, base) { return Verstak.claim(HtmlTags.script, builder, base); }
94
- export function Section(builder, base) { return Verstak.claim(HtmlTags.section, builder, base); }
94
+ export function Sctn(builder, base) { return Verstak.claim(HtmlTags.section, builder, base); }
95
95
  export function Select(builder, base) { return Verstak.claim(HtmlTags.select, builder, base); }
96
96
  export function Small(builder, base) { return Verstak.claim(HtmlTags.small, builder, base); }
97
97
  export function Source(builder, base) { return Verstak.claim(HtmlTags.source, builder, base); }
@@ -13,7 +13,7 @@ export declare abstract class BaseHtmlDriver<T extends Element, C = unknown> ext
13
13
  static get blinkingEffectMarker(): string | undefined;
14
14
  static set blinkingEffectMarker(value: string | undefined);
15
15
  static findEffectiveHtmlBlockHost(block: Block<any>): Block<HTMLElement | SVGElement>;
16
- static findPrevSiblingHtmlBlock(item: Item<Block<any>>): Item<Block<HTMLElement | SVGElement>> | undefined;
16
+ static findPrevSiblingHtmlBlock(ties: Item<Block<any>>): Item<Block<HTMLElement | SVGElement>> | undefined;
17
17
  }
18
18
  export declare class HtmlDriver<T extends HTMLElement, C = unknown> extends BaseHtmlDriver<T, C> {
19
19
  create(block: Block<T, unknown, C, void>, b: {
@@ -5,8 +5,8 @@ export class BaseHtmlDriver extends BaseDriver {
5
5
  super.create(block, b);
6
6
  }
7
7
  initialize(block) {
8
- if (Rx.isLogging && !block.descriptor.driver.isRow)
9
- block.native.setAttribute("key", block.descriptor.key);
8
+ if (Rx.isLogging && !block.node.driver.isRow)
9
+ block.native.setAttribute("key", block.node.key);
10
10
  super.initialize(block);
11
11
  }
12
12
  finalize(block, isLeader) {
@@ -23,13 +23,13 @@ export class BaseHtmlDriver extends BaseDriver {
23
23
  mount(block) {
24
24
  const e = block.native;
25
25
  if (e) {
26
- const bNode = block.descriptor;
27
- const sequential = bNode.owner.descriptor.children.isStrict;
26
+ const node = block.node;
27
+ const sequential = node.owner.node.children.isStrict;
28
28
  const nativeParent = BaseHtmlDriver.findEffectiveHtmlBlockHost(block).native;
29
29
  if (nativeParent) {
30
- if (sequential && !bNode.driver.isRow) {
31
- const after = BaseHtmlDriver.findPrevSiblingHtmlBlock(block.descriptor.item);
32
- if (after === undefined || after.instance.descriptor.driver.isRow) {
30
+ if (sequential && !node.driver.isRow) {
31
+ const after = BaseHtmlDriver.findPrevSiblingHtmlBlock(block.node.ties);
32
+ if (after === undefined || after.instance.node.driver.isRow) {
33
33
  if (nativeParent !== e.parentNode || !e.previousSibling)
34
34
  nativeParent.prepend(e);
35
35
  }
@@ -51,7 +51,7 @@ export class BaseHtmlDriver extends BaseDriver {
51
51
  render(block) {
52
52
  const result = super.render(block);
53
53
  if (gBlinkingEffectMarker)
54
- blink(block.native, Verstak.currentRenderingPriority, block.descriptor.stamp);
54
+ blink(block.native, Verstak.currentRenderingPriority, block.node.stamp);
55
55
  return result;
56
56
  }
57
57
  static get blinkingEffectMarker() {
@@ -61,14 +61,14 @@ export class BaseHtmlDriver extends BaseDriver {
61
61
  gBlinkingEffectMarker = value;
62
62
  }
63
63
  static findEffectiveHtmlBlockHost(block) {
64
- let p = block.descriptor.host;
64
+ let p = block.node.host;
65
65
  while (p.native instanceof HTMLElement === false &&
66
66
  p.native instanceof SVGElement === false && p !== block)
67
- p = p.descriptor.host;
67
+ p = p.node.host;
68
68
  return p;
69
69
  }
70
- static findPrevSiblingHtmlBlock(item) {
71
- let p = item.prev;
70
+ static findPrevSiblingHtmlBlock(ties) {
71
+ let p = ties.prev;
72
72
  while (p && !(p.instance.native instanceof HTMLElement) && !(p.instance.native instanceof SVGElement))
73
73
  p = p.prev;
74
74
  return p;
@@ -76,13 +76,13 @@ export class BaseHtmlDriver extends BaseDriver {
76
76
  }
77
77
  export class HtmlDriver extends BaseHtmlDriver {
78
78
  create(block, b) {
79
- b.native = document.createElement(block.descriptor.driver.name);
79
+ b.native = document.createElement(block.node.driver.name);
80
80
  super.create(block, b);
81
81
  }
82
82
  }
83
83
  export class SvgDriver extends BaseHtmlDriver {
84
84
  create(block, b) {
85
- b.native = document.createElementNS("http://www.w3.org/2000/svg", block.descriptor.driver.name);
85
+ b.native = document.createElementNS("http://www.w3.org/2000/svg", block.node.driver.name);
86
86
  super.create(block, b);
87
87
  }
88
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.23.109",
3
+ "version": "0.23.111",
4
4
  "description": "Verstak - Front-End Library",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",