verstak 0.24.272 → 0.24.274

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.
@@ -5,15 +5,15 @@ export type El<T = any, M = any> = {
5
5
  native: T;
6
6
  model: M;
7
7
  kind: ElKind;
8
- area: ElArea;
8
+ place: ElPlace;
9
9
  width: Range;
10
10
  height: Range;
11
- alignment: Alignment | undefined;
12
- alignmentInside: Alignment | undefined;
13
- verticalAlignment: VerticalAlignment | undefined;
14
- verticalAlignmentInside: VerticalAlignment | undefined;
15
- stretchingStrengthX: number | undefined;
16
- stretchingStrengthY: number | undefined;
11
+ horizontal: PosH | undefined;
12
+ contentHorizontal: PosH | undefined;
13
+ vertical: PosV | undefined;
14
+ contentVertical: PosV | undefined;
15
+ stretchingStrengthH: number | undefined;
16
+ stretchingStrengthV: number | undefined;
17
17
  contentWrapping: boolean;
18
18
  overlayVisible: boolean | undefined;
19
19
  sealed: Direction | undefined;
@@ -31,7 +31,7 @@ export type El<T = any, M = any> = {
31
31
  useStylingPreset(stylingPresetName: string, enabled?: boolean): void;
32
32
  };
33
33
  export declare enum ElKind {
34
- section = 0,
34
+ panel = 0,
35
35
  table = 1,
36
36
  note = 2,
37
37
  group = 3,
@@ -46,17 +46,19 @@ export type ElCoords = {
46
46
  x2: number;
47
47
  y2: number;
48
48
  };
49
- export declare enum Alignment {
49
+ export declare enum PosH {
50
50
  left = 0,
51
51
  center = 1,
52
52
  right = 2,
53
- stretch = 3
53
+ stretch = 3,
54
+ stretchAndFix = 4
54
55
  }
55
- export declare enum VerticalAlignment {
56
+ export declare enum PosV {
56
57
  top = 0,
57
58
  center = 1,
58
59
  bottom = 2,
59
- stretch = 3
60
+ stretch = 3,
61
+ stretchAndFix = 4
60
62
  }
61
63
  export type Range = {
62
64
  readonly min?: string;
@@ -66,7 +68,7 @@ export type Range = {
66
68
  export type MarkedRange = Range & {
67
69
  readonly marker?: string;
68
70
  };
69
- export type ElArea = undefined | string | {
71
+ export type ElPlace = undefined | string | {
70
72
  cellsOverWidth?: number;
71
73
  cellsOverHeight?: number;
72
74
  };
@@ -85,16 +87,16 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
85
87
  native: T;
86
88
  model: M;
87
89
  private _kind;
88
- private _area;
90
+ private _place;
89
91
  private _coords;
90
92
  private _width;
91
93
  private _height;
92
- private _alignment;
93
- private _verticalAlignment;
94
- private _alignmentInside;
95
- private _verticalAlignmentInside;
96
- private _stretchingStrengthX;
97
- private _stretchingStrengthY;
94
+ private _horizontal;
95
+ private _vertical;
96
+ private _contentHorizontal;
97
+ private _contentVertical;
98
+ private _stretchingStrengthH;
99
+ private _stretchingStrengthV;
98
100
  private _contentWrapping;
99
101
  private _overlayVisible;
100
102
  private _sealed;
@@ -103,13 +105,13 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
103
105
  constructor(node: RxNode<El<T, M>>);
104
106
  prepareForUpdate(): void;
105
107
  get index(): number;
106
- get isSection(): boolean;
108
+ get isPanel(): boolean;
107
109
  get isTable(): boolean;
108
110
  get isAuxiliary(): boolean;
109
111
  get kind(): ElKind;
110
112
  set kind(value: ElKind);
111
- get area(): ElArea;
112
- set area(value: ElArea);
113
+ get place(): ElPlace;
114
+ set place(value: ElPlace);
113
115
  get width(): Range;
114
116
  set width(value: Range);
115
117
  get widthPx(): {
@@ -134,18 +136,18 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
134
136
  });
135
137
  get preferredHeightUsed(): boolean;
136
138
  set preferredHeightUsed(value: boolean);
137
- get alignment(): Alignment | undefined;
138
- set alignment(value: Alignment | undefined);
139
- get verticalAlignment(): VerticalAlignment | undefined;
140
- set verticalAlignment(value: VerticalAlignment | undefined);
141
- get alignmentInside(): Alignment | undefined;
142
- set alignmentInside(value: Alignment | undefined);
143
- get verticalAlignmentInside(): VerticalAlignment | undefined;
144
- set verticalAlignmentInside(value: VerticalAlignment | undefined);
145
- get stretchingStrengthX(): number | undefined;
146
- set stretchingStrengthX(value: number | undefined);
147
- get stretchingStrengthY(): number | undefined;
148
- set stretchingStrengthY(value: number | undefined);
139
+ get horizontal(): PosH | undefined;
140
+ set horizontal(value: PosH | undefined);
141
+ get vertical(): PosV | undefined;
142
+ set vertical(value: PosV | undefined);
143
+ get contentHorizontal(): PosH | undefined;
144
+ set contentHorizontal(value: PosH | undefined);
145
+ get contentVertical(): PosV | undefined;
146
+ set contentVertical(value: PosV | undefined);
147
+ get stretchingStrengthH(): number | undefined;
148
+ set stretchingStrengthH(value: number | undefined);
149
+ get stretchingStrengthV(): number | undefined;
150
+ set stretchingStrengthV(value: number | undefined);
149
151
  get contentWrapping(): boolean;
150
152
  set contentWrapping(value: boolean);
151
153
  get overlayVisible(): boolean | undefined;
@@ -164,10 +166,10 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
164
166
  private static applyCoords;
165
167
  private static applyWidth;
166
168
  private static applyHeight;
167
- private static applyAlignment;
168
- private static applyVerticalAlignment;
169
- private static applyStretchingStrengthX;
170
- private static applyStretchingStrengthY;
169
+ private static applyHorizontal;
170
+ private static applyVertical;
171
+ private static applyStretchingStrengthH;
172
+ private static applyStretchingStrengthV;
171
173
  private static applyContentWrapping;
172
174
  private static applyOverlayVisible;
173
175
  static applySealed<T extends Element>(element: El<T, any>, value: Direction | undefined): void;
@@ -11,7 +11,7 @@ import { RxNode, BaseDriver, Transaction, obs, ObservableObject } from "reactron
11
11
  import { equalElCoords, parseElCoords } from "./ElUtils.js";
12
12
  export var ElKind;
13
13
  (function (ElKind) {
14
- ElKind[ElKind["section"] = 0] = "section";
14
+ ElKind[ElKind["panel"] = 0] = "panel";
15
15
  ElKind[ElKind["table"] = 1] = "table";
16
16
  ElKind[ElKind["note"] = 2] = "note";
17
17
  ElKind[ElKind["group"] = 3] = "group";
@@ -20,20 +20,22 @@ export var ElKind;
20
20
  ElKind[ElKind["cursor"] = 6] = "cursor";
21
21
  ElKind[ElKind["native"] = 7] = "native";
22
22
  })(ElKind || (ElKind = {}));
23
- export var Alignment;
24
- (function (Alignment) {
25
- Alignment[Alignment["left"] = 0] = "left";
26
- Alignment[Alignment["center"] = 1] = "center";
27
- Alignment[Alignment["right"] = 2] = "right";
28
- Alignment[Alignment["stretch"] = 3] = "stretch";
29
- })(Alignment || (Alignment = {}));
30
- export var VerticalAlignment;
31
- (function (VerticalAlignment) {
32
- VerticalAlignment[VerticalAlignment["top"] = 0] = "top";
33
- VerticalAlignment[VerticalAlignment["center"] = 1] = "center";
34
- VerticalAlignment[VerticalAlignment["bottom"] = 2] = "bottom";
35
- VerticalAlignment[VerticalAlignment["stretch"] = 3] = "stretch";
36
- })(VerticalAlignment || (VerticalAlignment = {}));
23
+ export var PosH;
24
+ (function (PosH) {
25
+ PosH[PosH["left"] = 0] = "left";
26
+ PosH[PosH["center"] = 1] = "center";
27
+ PosH[PosH["right"] = 2] = "right";
28
+ PosH[PosH["stretch"] = 3] = "stretch";
29
+ PosH[PosH["stretchAndFix"] = 4] = "stretchAndFix";
30
+ })(PosH || (PosH = {}));
31
+ export var PosV;
32
+ (function (PosV) {
33
+ PosV[PosV["top"] = 0] = "top";
34
+ PosV[PosV["center"] = 1] = "center";
35
+ PosV[PosV["bottom"] = 2] = "bottom";
36
+ PosV[PosV["stretch"] = 3] = "stretch";
37
+ PosV[PosV["stretchAndFix"] = 4] = "stretchAndFix";
38
+ })(PosV || (PosV = {}));
37
39
  export var Direction;
38
40
  (function (Direction) {
39
41
  Direction[Direction["horizontal"] = 0] = "horizontal";
@@ -62,16 +64,16 @@ export class ElImpl {
62
64
  this.native = undefined;
63
65
  this.model = undefined;
64
66
  this._kind = ElKind.part;
65
- this._area = undefined;
67
+ this._place = undefined;
66
68
  this._coords = UndefinedElCoords;
67
69
  this._width = Transaction.separate(() => new Size());
68
70
  this._height = Transaction.separate(() => new Size());
69
- this._alignment = undefined;
70
- this._verticalAlignment = undefined;
71
- this._alignmentInside = undefined;
72
- this._verticalAlignmentInside = undefined;
73
- this._stretchingStrengthX = undefined;
74
- this._stretchingStrengthY = undefined;
71
+ this._horizontal = undefined;
72
+ this._vertical = undefined;
73
+ this._contentHorizontal = undefined;
74
+ this._contentVertical = undefined;
75
+ this._stretchingStrengthH = undefined;
76
+ this._stretchingStrengthV = undefined;
75
77
  this._contentWrapping = true;
76
78
  this._overlayVisible = undefined;
77
79
  this._sealed = undefined;
@@ -79,11 +81,11 @@ export class ElImpl {
79
81
  this._hasStylingPresets = false;
80
82
  }
81
83
  prepareForUpdate() {
82
- this._area = undefined;
84
+ this._place = undefined;
83
85
  this._hasStylingPresets = false;
84
86
  }
85
87
  get index() { return this.node.seat.index; }
86
- get isSection() { return this.kind === ElKind.section; }
88
+ get isPanel() { return this.kind === ElKind.panel; }
87
89
  get isTable() { return this.kind === ElKind.table; }
88
90
  get isAuxiliary() { return this.kind > ElKind.note; }
89
91
  get kind() { return this._kind; }
@@ -94,8 +96,8 @@ export class ElImpl {
94
96
  this._kind = value;
95
97
  }
96
98
  }
97
- get area() { return this._area; }
98
- set area(value) {
99
+ get place() { return this._place; }
100
+ set place(value) {
99
101
  var _a, _b;
100
102
  const node = this.node;
101
103
  const driver = node.driver;
@@ -112,7 +114,7 @@ export class ElImpl {
112
114
  ElImpl.applyCoords(this, coords);
113
115
  this._coords = coords;
114
116
  }
115
- this._area = value !== null && value !== void 0 ? value : {};
117
+ this._place = value !== null && value !== void 0 ? value : {};
116
118
  }
117
119
  else
118
120
  this.rowBreak();
@@ -120,7 +122,7 @@ export class ElImpl {
120
122
  get width() { return this._width.raw; }
121
123
  set width(value) {
122
124
  const w = this._width.raw;
123
- if (value.min !== w.min || value.max !== w.max) {
125
+ if (value.min !== w.min || value.max !== w.max || value.preferred !== undefined) {
124
126
  ElImpl.applyWidth(this, value);
125
127
  this._width.raw = value;
126
128
  this._width.preferredUsed = false;
@@ -143,7 +145,7 @@ export class ElImpl {
143
145
  get height() { return this._height.raw; }
144
146
  set height(value) {
145
147
  const h = this._height.raw;
146
- if (value.min !== h.min || value.max !== h.max) {
148
+ if (value.min !== h.min || value.max !== h.max || value.preferred !== undefined) {
147
149
  ElImpl.applyHeight(this, value);
148
150
  this._height.raw = value;
149
151
  this._height.preferredUsed = false;
@@ -163,52 +165,52 @@ export class ElImpl {
163
165
  set preferredHeightUsed(value) {
164
166
  this._height.preferredUsed = value;
165
167
  }
166
- get alignment() { return this._alignment; }
167
- set alignment(value) {
168
- const existing = this._alignment;
168
+ get horizontal() { return this._horizontal; }
169
+ set horizontal(value) {
170
+ const existing = this._horizontal;
169
171
  if (value !== existing) {
170
- ElImpl.applyAlignment(this, existing, value, this._alignmentInside, this._alignmentInside, this._stretchingStrengthX);
171
- this._alignment = value;
172
+ ElImpl.applyHorizontal(this, existing, value, this._contentHorizontal, this._contentHorizontal, this._stretchingStrengthH);
173
+ this._horizontal = value;
172
174
  }
173
175
  }
174
- get verticalAlignment() { return this._verticalAlignment; }
175
- set verticalAlignment(value) {
176
- const existing = this._verticalAlignment;
176
+ get vertical() { return this._vertical; }
177
+ set vertical(value) {
178
+ const existing = this._vertical;
177
179
  if (value !== existing) {
178
- ElImpl.applyVerticalAlignment(this, existing, value, this._verticalAlignmentInside, this._verticalAlignmentInside, this._stretchingStrengthY);
179
- this._verticalAlignment = value;
180
+ ElImpl.applyVertical(this, existing, value, this._contentVertical, this._contentVertical, this._stretchingStrengthV);
181
+ this._vertical = value;
180
182
  }
181
183
  }
182
- get alignmentInside() { return this._alignmentInside; }
183
- set alignmentInside(value) {
184
- const existing = this._alignmentInside;
184
+ get contentHorizontal() { return this._contentHorizontal; }
185
+ set contentHorizontal(value) {
186
+ const existing = this._contentHorizontal;
185
187
  if (value !== existing) {
186
- ElImpl.applyAlignment(this, this._alignment, this._alignment, existing, value, this._stretchingStrengthX);
187
- this._alignmentInside = value;
188
+ ElImpl.applyHorizontal(this, this._horizontal, this._horizontal, existing, value, this._stretchingStrengthH);
189
+ this._contentHorizontal = value;
188
190
  }
189
191
  }
190
- get verticalAlignmentInside() { return this._verticalAlignmentInside; }
191
- set verticalAlignmentInside(value) {
192
- const existing = this._verticalAlignmentInside;
192
+ get contentVertical() { return this._contentVertical; }
193
+ set contentVertical(value) {
194
+ const existing = this._contentVertical;
193
195
  if (value !== existing) {
194
- ElImpl.applyVerticalAlignment(this, this._verticalAlignment, this._verticalAlignment, existing, value, this._stretchingStrengthY);
195
- this._verticalAlignmentInside = value;
196
+ ElImpl.applyVertical(this, this._vertical, this._vertical, existing, value, this._stretchingStrengthV);
197
+ this._contentVertical = value;
196
198
  }
197
199
  }
198
- get stretchingStrengthX() { return this._stretchingStrengthX; }
199
- set stretchingStrengthX(value) {
200
- const existing = this._stretchingStrengthX;
200
+ get stretchingStrengthH() { return this._stretchingStrengthH; }
201
+ set stretchingStrengthH(value) {
202
+ const existing = this._stretchingStrengthH;
201
203
  if (value !== existing) {
202
- ElImpl.applyStretchingStrengthX(this, existing, value);
203
- this._stretchingStrengthX = value;
204
+ ElImpl.applyStretchingStrengthH(this, existing, value);
205
+ this._stretchingStrengthH = value;
204
206
  }
205
207
  }
206
- get stretchingStrengthY() { return this._stretchingStrengthY; }
207
- set stretchingStrengthY(value) {
208
- const existing = this._stretchingStrengthY;
208
+ get stretchingStrengthV() { return this._stretchingStrengthV; }
209
+ set stretchingStrengthV(value) {
210
+ const existing = this._stretchingStrengthV;
209
211
  if (value !== existing) {
210
- ElImpl.applyStretchingStrengthY(this, existing, value);
211
- this._stretchingStrengthY = value;
212
+ ElImpl.applyStretchingStrengthV(this, existing, value);
213
+ this._stretchingStrengthV = value;
212
214
  }
213
215
  }
214
216
  get contentWrapping() { return this._contentWrapping; }
@@ -310,10 +312,10 @@ export class ElImpl {
310
312
  s.maxHeight = (_b = value.max) !== null && _b !== void 0 ? _b : "";
311
313
  }
312
314
  }
313
- static applyAlignment(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
315
+ static applyHorizontal(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
314
316
  var _a, _b;
315
- oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = Alignment.left);
316
- newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = Alignment.left);
317
+ oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = PosH.left);
318
+ newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = PosH.left);
317
319
  oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
318
320
  newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
319
321
  const css = element.style;
@@ -326,8 +328,8 @@ export class ElImpl {
326
328
  }
327
329
  let isEffectiveAlignerX = false;
328
330
  if (hostLayout) {
329
- const isAligner = newPrimary === Alignment.center ||
330
- newPrimary === Alignment.right;
331
+ const isAligner = newPrimary === PosH.center ||
332
+ newPrimary === PosH.right;
331
333
  isEffectiveAlignerX = isAligner && (hostLayout.alignerX === undefined ||
332
334
  element.index <= hostLayout.alignerX.index);
333
335
  if (hostLayout.alignerX === element) {
@@ -347,63 +349,65 @@ export class ElImpl {
347
349
  }
348
350
  switch (newPrimary) {
349
351
  default:
350
- case Alignment.left:
352
+ case PosH.left:
351
353
  css.justifySelf = "start";
352
- if (oldPrimary === Alignment.center) {
354
+ if (oldPrimary === PosH.center) {
353
355
  css.marginLeft = "";
354
356
  css.marginRight = "";
355
357
  }
356
- else if (oldPrimary === Alignment.right)
358
+ else if (oldPrimary === PosH.right)
357
359
  css.marginLeft = "";
358
360
  break;
359
- case Alignment.center:
361
+ case PosH.center:
360
362
  css.justifySelf = "center";
361
363
  if (hostLayout)
362
364
  css.marginLeft = isEffectiveAlignerX ? "auto" : "";
363
365
  css.marginRight = "auto";
364
366
  break;
365
- case Alignment.right:
367
+ case PosH.right:
366
368
  css.justifySelf = "end";
367
369
  if (hostLayout)
368
370
  css.marginLeft = isEffectiveAlignerX ? "auto" : "";
369
- if (oldPrimary === Alignment.center)
371
+ if (oldPrimary === PosH.center)
370
372
  css.marginRight = "";
371
373
  break;
372
- case Alignment.stretch:
374
+ case PosH.stretch:
375
+ case PosH.stretchAndFix:
373
376
  css.justifySelf = "stretch";
374
- if (oldPrimary === Alignment.center) {
377
+ if (oldPrimary === PosH.center) {
375
378
  css.marginLeft = "";
376
379
  css.marginRight = "";
377
380
  }
378
- else if (oldPrimary === Alignment.right)
381
+ else if (oldPrimary === PosH.right)
379
382
  css.marginLeft = "";
380
383
  break;
381
384
  }
382
385
  switch (newInside) {
383
386
  default:
384
- case Alignment.left:
387
+ case PosH.left:
385
388
  css.alignItems = "start";
386
389
  css.textAlign = "left";
387
390
  break;
388
- case Alignment.center:
391
+ case PosH.center:
389
392
  css.alignItems = "center";
390
393
  css.textAlign = "center";
391
394
  break;
392
- case Alignment.right:
395
+ case PosH.right:
393
396
  css.alignItems = "end";
394
397
  css.textAlign = "right";
395
398
  break;
396
- case Alignment.stretch:
399
+ case PosH.stretch:
400
+ case PosH.stretchAndFix:
397
401
  css.alignItems = "stretch";
398
402
  css.textAlign = "justify";
399
403
  break;
400
404
  }
401
- if (newPrimary === Alignment.stretch && strength === undefined)
402
- ElImpl.applyStretchingStrengthX(element, 0, 1);
405
+ if (newPrimary >= PosH.stretch && strength === undefined)
406
+ ElImpl.applyStretchingStrengthH(element, 0, 1);
403
407
  }
404
- static applyVerticalAlignment(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
405
- oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = VerticalAlignment.top);
406
- newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = VerticalAlignment.top);
408
+ static applyVertical(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
409
+ oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = PosV.top);
410
+ newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = PosV.top);
407
411
  oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
408
412
  newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
409
413
  const css = element.style;
@@ -418,10 +422,10 @@ export class ElImpl {
418
422
  }
419
423
  let isEffectiveAlignerY = false;
420
424
  if (hostLayout) {
421
- const isAligner = newPrimary === VerticalAlignment.center ||
422
- newPrimary === VerticalAlignment.bottom;
425
+ const isAligner = newPrimary === PosV.center ||
426
+ newPrimary === PosV.bottom;
423
427
  isEffectiveAlignerY = isAligner && (hostLayout.alignerY === undefined ||
424
- hostLayout.alignerY.verticalAlignment !== VerticalAlignment.center);
428
+ hostLayout.alignerY.vertical !== PosV.center);
425
429
  if (hostLayout.alignerY === element) {
426
430
  if (!isEffectiveAlignerY) {
427
431
  hostCss.marginTop = "";
@@ -436,43 +440,45 @@ export class ElImpl {
436
440
  }
437
441
  switch (newPrimary) {
438
442
  default:
439
- case VerticalAlignment.top:
443
+ case PosV.top:
440
444
  css.alignSelf = "start";
441
445
  break;
442
- case VerticalAlignment.center:
446
+ case PosV.center:
443
447
  css.alignSelf = "center";
444
448
  break;
445
- case VerticalAlignment.bottom:
449
+ case PosV.bottom:
446
450
  css.alignSelf = "end";
447
451
  break;
448
- case VerticalAlignment.stretch:
452
+ case PosV.stretch:
453
+ case PosV.stretchAndFix:
449
454
  css.alignSelf = "stretch";
450
455
  break;
451
456
  }
452
457
  switch (newInside) {
453
458
  default:
454
- case VerticalAlignment.top:
459
+ case PosV.top:
455
460
  css.justifyContent = "start";
456
461
  break;
457
- case VerticalAlignment.center:
462
+ case PosV.center:
458
463
  css.justifyContent = "center";
459
464
  break;
460
- case VerticalAlignment.bottom:
465
+ case PosV.bottom:
461
466
  css.justifyContent = "end";
462
467
  break;
463
- case VerticalAlignment.stretch:
468
+ case PosV.stretch:
469
+ case PosV.stretchAndFix:
464
470
  css.justifyContent = "stretch";
465
471
  break;
466
472
  }
467
- if (newPrimary === VerticalAlignment.stretch && strength === undefined)
468
- ElImpl.applyStretchingStrengthY(element, 0, 1);
473
+ if (newPrimary >= PosV.stretch && strength === undefined)
474
+ ElImpl.applyStretchingStrengthV(element, 0, 1);
469
475
  }
470
- static applyStretchingStrengthX(element, existing, value) {
476
+ static applyStretchingStrengthH(element, existing, value) {
471
477
  const s = element.style;
472
478
  const host = element.node.host;
473
479
  if (host.driver.isPartition) {
474
480
  const hostEl = host.element;
475
- hostEl._stretchingStrengthX = value;
481
+ hostEl._stretchingStrengthH = value;
476
482
  existing !== null && existing !== void 0 ? existing : (existing = 0);
477
483
  value !== null && value !== void 0 ? value : (value = 0);
478
484
  }
@@ -486,12 +492,12 @@ export class ElImpl {
486
492
  s.flexBasis = "";
487
493
  }
488
494
  }
489
- static applyStretchingStrengthY(element, existing, value) {
495
+ static applyStretchingStrengthV(element, existing, value) {
490
496
  var _a;
491
497
  const host = element.node.host;
492
498
  if (host.driver.isPartition) {
493
499
  const hostElement = host.element;
494
- hostElement._stretchingStrengthY = value;
500
+ hostElement._stretchingStrengthV = value;
495
501
  let delta = 0;
496
502
  existing !== null && existing !== void 0 ? existing : (existing = 0);
497
503
  value !== null && value !== void 0 ? value : (value = 0);
@@ -504,7 +510,7 @@ export class ElImpl {
504
510
  delta = -1;
505
511
  }
506
512
  if (delta !== 0) {
507
- const count = (_a = hostElement._stretchingStrengthY) !== null && _a !== void 0 ? _a : 0 + delta;
513
+ const count = (_a = hostElement._stretchingStrengthV) !== null && _a !== void 0 ? _a : 0 + delta;
508
514
  const s = hostElement.style;
509
515
  if (count === 1)
510
516
  s.flexGrow = `${value}`;
@@ -640,11 +646,11 @@ var ElLayoutInfoFlags;
640
646
  })(ElLayoutInfoFlags || (ElLayoutInfoFlags = {}));
641
647
  const UndefinedElCoords = Object.freeze({ x1: 0, y1: 0, x2: 0, y2: 0 });
642
648
  export const InitialElLayoutInfo = Object.freeze(new ElLayoutInfo({ x: 1, y: 1, runningMaxX: 0, runningMaxY: 0, flags: ElLayoutInfoFlags.none, effectiveSizePx: 0, offsetXpx: 0, offsetYpx: 0, contentSizeXpx: 0, contentSizeYpx: 0, borderSizeXpx: 0, borderSizeYpx: 0, isConstrained: false }));
643
- function getElCoordsAndAdjustLayoutInfo(isRegularElement, area, maxX, maxY, prevElLayoutInfo, layoutInfo) {
649
+ function getElCoordsAndAdjustLayoutInfo(isRegularElement, place, maxX, maxY, prevElLayoutInfo, layoutInfo) {
644
650
  var _a, _b;
645
651
  let result;
646
- if (typeof (area) === "string") {
647
- result = parseElCoords(area, { x1: 0, y1: 0, x2: 0, y2: 0 });
652
+ if (typeof (place) === "string") {
653
+ result = parseElCoords(place, { x1: 0, y1: 0, x2: 0, y2: 0 });
648
654
  absolutizeElCoords(result, prevElLayoutInfo.x, prevElLayoutInfo.y, maxX || Infinity, maxY || Infinity, result);
649
655
  if (layoutInfo) {
650
656
  layoutInfo.x = isRegularElement ? result.x2 + 1 : result.x1;
@@ -655,9 +661,9 @@ function getElCoordsAndAdjustLayoutInfo(isRegularElement, area, maxX, maxY, prev
655
661
  else if (layoutInfo) {
656
662
  let dx;
657
663
  let dy;
658
- if (area) {
659
- dx = (_a = area.cellsOverWidth) !== null && _a !== void 0 ? _a : 1;
660
- dy = (_b = area.cellsOverHeight) !== null && _b !== void 0 ? _b : 1;
664
+ if (place) {
665
+ dx = (_a = place.cellsOverWidth) !== null && _a !== void 0 ? _a : 1;
666
+ dy = (_b = place.cellsOverHeight) !== null && _b !== void 0 ? _b : 1;
661
667
  }
662
668
  else
663
669
  dx = dy = 1;
@@ -717,15 +723,15 @@ function getElCoordsAndAdjustLayoutInfo(isRegularElement, area, maxX, maxY, prev
717
723
  throw new Error("relative layout requires sequential children");
718
724
  return result;
719
725
  }
720
- function absolutizeElCoords(area, cursorX, cursorY, maxWidth, maxHeight, result) {
721
- const x1 = absolutizePosition(area.x1, cursorX, maxWidth);
722
- const x2 = absolutizePosition(area.x2, x1, maxWidth);
726
+ function absolutizeElCoords(place, cursorX, cursorY, maxWidth, maxHeight, result) {
727
+ const x1 = absolutizePosition(place.x1, cursorX, maxWidth);
728
+ const x2 = absolutizePosition(place.x2, x1, maxWidth);
723
729
  if (x1 <= x2)
724
730
  result.x1 = x1, result.x2 = x2;
725
731
  else
726
732
  result.x1 = x2, result.x2 = x1;
727
- const y1 = absolutizePosition(area.y1, cursorY, maxHeight);
728
- const y2 = absolutizePosition(area.y2, y1, maxHeight);
733
+ const y1 = absolutizePosition(place.y1, cursorY, maxHeight);
734
+ const y2 = absolutizePosition(place.y2, y1, maxHeight);
729
735
  if (y1 <= y2)
730
736
  result.y1 = y1, result.y2 = y2;
731
737
  else
@@ -1,24 +1,24 @@
1
1
  import { RxNodeDecl, RxNodeDriver, RxNode, Delegate, MergedItem } from "reactronic";
2
- import { CursorCommandDriver, El, ElArea } from "./El.js";
2
+ import { CursorCommandDriver, El, ElPlace } from "./El.js";
3
3
  import { HtmlDriver } from "./HtmlDriver.js";
4
- export declare function Section<M = unknown>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
4
+ export declare function Panel<M = unknown>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
5
5
  export declare function Table<M = unknown, R = void>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
6
6
  export declare function row<T = void>(builder?: (element: void) => T, shiftCursorDown?: number): void;
7
7
  export declare function Splitter<M = unknown, R = void>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
8
8
  export declare function rowBreak(shiftCursorDown?: number): void;
9
9
  export declare function declareSplitter<T>(index: number, splitViewNode: RxNode<El<T>>): RxNode<El<HTMLElement>>;
10
- export declare function cursor(areaParams: ElArea): void;
10
+ export declare function cursor(areaParams: ElPlace): void;
11
11
  export declare function Note(content: string, formatted?: boolean, declaration?: RxNodeDecl<El<HTMLElement, void>>): RxNode<El<HTMLElement, void>>;
12
12
  export declare function Group<M = unknown, R = void>(declaration?: RxNodeDecl<El<HTMLElement, M>>, preset?: RxNodeDecl<El<HTMLElement, M>>): RxNode<El<HTMLElement, M>>;
13
13
  export declare function Handling<M = unknown>(onChange: Delegate<El<void, M>>): RxNode<El<void, M>>;
14
14
  export declare function SyntheticElement<M = unknown>(declaration?: RxNodeDecl<El<void, M>>, preset?: RxNodeDecl<El<void, M>>): RxNode<El<void, M>>;
15
- export declare class SectionDriver<T extends HTMLElement> extends HtmlDriver<T> {
15
+ export declare class PanelDriver<T extends HTMLElement> extends HtmlDriver<T> {
16
16
  update(node: RxNode<El<T>>): void | Promise<void>;
17
17
  child(ownerNode: RxNode<El<T, any>>, childDriver: RxNodeDriver<any>, childDeclaration?: RxNodeDecl<any> | undefined, childPreset?: RxNodeDecl<any> | undefined): MergedItem<RxNode> | undefined;
18
18
  }
19
19
  export declare function isSplitViewPartition(childDriver: RxNodeDriver): boolean;
20
20
  export declare const Drivers: {
21
- section: SectionDriver<HTMLElement>;
21
+ panel: PanelDriver<HTMLElement>;
22
22
  table: HtmlDriver<HTMLElement, any>;
23
23
  note: HtmlDriver<HTMLElement, any>;
24
24
  group: HtmlDriver<HTMLElement, any>;
@@ -4,8 +4,8 @@ import { getPrioritiesForEmptySpaceDistribution, getPrioritiesForSizeChanging, r
4
4
  import { Axis, BodyFontSize, Dimension, toPx } from "./Sizes.js";
5
5
  import { HtmlDriver } from "./HtmlDriver.js";
6
6
  import { clamp } from "./ElUtils.js";
7
- export function Section(declaration, preset) {
8
- return RxNode.declare(Drivers.section, declaration, preset);
7
+ export function Panel(declaration, preset) {
8
+ return RxNode.declare(Drivers.panel, declaration, preset);
9
9
  }
10
10
  export function Table(declaration, preset) {
11
11
  return RxNode.declare(Drivers.table, declaration, preset);
@@ -85,7 +85,7 @@ export function declareSplitter(index, splitViewNode) {
85
85
  export function cursor(areaParams) {
86
86
  RxNode.declare(Drivers.cursor, {
87
87
  onChange: el => {
88
- el.area = areaParams;
88
+ el.place = areaParams;
89
89
  },
90
90
  });
91
91
  }
@@ -108,7 +108,7 @@ export function Handling(onChange) {
108
108
  export function SyntheticElement(declaration, preset) {
109
109
  return RxNode.declare(Drivers.synthetic, declaration, preset);
110
110
  }
111
- export class SectionDriver extends HtmlDriver {
111
+ export class PanelDriver extends HtmlDriver {
112
112
  update(node) {
113
113
  rowBreak();
114
114
  const result = super.update(node);
@@ -157,7 +157,7 @@ export class SectionDriver extends HtmlDriver {
157
157
  if (el.splitView !== undefined) {
158
158
  SyntheticElement({
159
159
  mode: Mode.independentUpdate,
160
- triggers: { count: el.node.stamp },
160
+ triggers: { stamp: el.node.stamp },
161
161
  onChange: () => {
162
162
  const native = el.native;
163
163
  const isHorizontal = el.splitView === Direction.horizontal;
@@ -261,7 +261,7 @@ function overrideMethod(declaration, method, func) {
261
261
  : (el, base) => { base(); func(el); };
262
262
  }
263
263
  export const Drivers = {
264
- section: new SectionDriver(Constants.element, false, el => el.kind = ElKind.section),
264
+ panel: new PanelDriver(Constants.element, false, el => el.kind = ElKind.panel),
265
265
  table: new HtmlDriver(Constants.element, false, el => el.kind = ElKind.table),
266
266
  note: new HtmlDriver(Constants.element, false, el => el.kind = ElKind.note),
267
267
  group: new HtmlDriver(Constants.group, false, el => el.kind = ElKind.group),
@@ -1,6 +1,7 @@
1
1
  import { ToggleRef } from "reactronic";
2
2
  import { FocusModel } from "./sensors/FocusSensor.js";
3
3
  import { ResizedElement } from "./sensors/ResizeSensor.js";
4
- export declare function OnClick(target: HTMLElement, action: (() => void) | ToggleRef | undefined, key?: string): void;
4
+ import { PointerSensor } from "./sensors/PointerSensor.js";
5
+ export declare function OnClick(target: HTMLElement, action: ((pointer: PointerSensor) => void) | ToggleRef | undefined, key?: string): void;
5
6
  export declare function OnResize(target: HTMLElement, action: ((element: ResizedElement) => void) | undefined, key?: string): void;
6
7
  export declare function OnFocus(target: HTMLElement, model: FocusModel, switchEditMode?: ((model: FocusModel) => void) | undefined, key?: string): void;
@@ -8,9 +8,9 @@ export function OnClick(target, action, key) {
8
8
  triggers: { target },
9
9
  onChange: el => {
10
10
  const pointer = target.sensors.pointer;
11
- if (pointer.clicked) {
11
+ if (target.dataForSensor.click !== undefined && pointer.clicked === target.dataForSensor.click || target.dataForSensor.click === undefined && pointer.clicked) {
12
12
  if (action instanceof Function) {
13
- unobs(() => action());
13
+ unobs(() => action(pointer));
14
14
  }
15
15
  else if (action instanceof ToggleRef) {
16
16
  unobs(() => action.toggle());
@@ -44,7 +44,7 @@ export function OnFocus(target, model, switchEditMode = undefined, key) {
44
44
  el.node.configureReactronic({ throttling: 0 });
45
45
  },
46
46
  onChange: el => {
47
- if (switchEditMode === undefined && !target.hasAttribute("tabindex"))
47
+ if (switchEditMode === undefined && !(target instanceof HTMLInputElement || target.hasAttribute("tabindex")))
48
48
  console.warn(`"${key !== null && key !== void 0 ? key : "noname"}" element must have "tabindex" attribute set in order to be focusable`);
49
49
  if (switchEditMode !== undefined) {
50
50
  switchEditMode(model);
@@ -57,10 +57,10 @@ export class WebDriver extends ElDriver {
57
57
  if (element instanceof ElImpl)
58
58
  element.prepareForUpdate();
59
59
  const result = super.update(node);
60
- if (element.area === undefined) {
60
+ if (element.place === undefined) {
61
61
  const oel = node.owner.element;
62
62
  if (oel instanceof ElImpl && oel.isTable)
63
- element.area = undefined;
63
+ element.place = undefined;
64
64
  }
65
65
  if (gBlinkingEffectMarker)
66
66
  blink(element.native, RxNode.currentUpdatePriority, node.stamp);
@@ -2,7 +2,7 @@ import { RxNode } from "reactronic";
2
2
  import { ElKind } from "./El.js";
3
3
  import { StaticDriver, HtmlDriver, SvgDriver } from "./HtmlDriver.js";
4
4
  export function Page(declaration, preset) {
5
- const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.section);
5
+ const driver = new StaticDriver(global.document.body, "Page", false, el => el.kind = ElKind.panel);
6
6
  return RxNode.declare(driver, declaration, preset);
7
7
  }
8
8
  export function A(declaration, preset) { return RxNode.declare(HtmlTags.a, declaration, preset); }
@@ -181,9 +181,8 @@ export function getPrioritiesForSizeChanging(isHorizontal, children, indexes) {
181
181
  const manuallyResizable = [];
182
182
  const items = Array.from(children.items()).filter(x => isSplitViewPartition(x.instance.driver));
183
183
  for (let i = items.length - 1; i >= 0; i--) {
184
- const item = items[i];
185
- const el = item.instance.element;
186
- const strength = (_a = (isHorizontal ? el.stretchingStrengthX : el.stretchingStrengthY)) !== null && _a !== void 0 ? _a : 1;
184
+ const el = items[i].instance.element;
185
+ const strength = (_a = (isHorizontal ? el.stretchingStrengthH : el.stretchingStrengthV)) !== null && _a !== void 0 ? _a : 1;
187
186
  if (!indexes.includes(i)) {
188
187
  if (strength > 0)
189
188
  resizable.push(1 << i);
@@ -191,15 +190,20 @@ export function getPrioritiesForSizeChanging(isHorizontal, children, indexes) {
191
190
  manuallyResizable.push(1 << i);
192
191
  }
193
192
  }
193
+ let r = 0;
194
+ let mr = 0;
194
195
  for (const i of indexes) {
195
- const item = items[i];
196
- const el = item.instance.element;
197
- const strength = (_b = (isHorizontal ? el.stretchingStrengthX : el.stretchingStrengthY)) !== null && _b !== void 0 ? _b : 1;
196
+ const el = items[i].instance.element;
197
+ const strength = (_b = (isHorizontal ? el.stretchingStrengthH : el.stretchingStrengthV)) !== null && _b !== void 0 ? _b : 1;
198
198
  if (strength > 0)
199
- resizable.push(1 << i);
199
+ r |= 1 << i;
200
200
  else
201
- manuallyResizable.push(1 << i);
201
+ mr |= 1 << i;
202
202
  }
203
+ if (r > 0)
204
+ resizable.push(r);
205
+ if (mr > 0)
206
+ manuallyResizable.push(mr);
203
207
  return { resizable, manuallyResizable };
204
208
  }
205
209
  export function getPrioritiesForEmptySpaceDistribution(isHorizontal, children) {
@@ -210,7 +214,7 @@ export function getPrioritiesForEmptySpaceDistribution(isHorizontal, children) {
210
214
  for (const child of children.items()) {
211
215
  if (isSplitViewPartition(child.instance.driver)) {
212
216
  const el = child.instance.element;
213
- const strength = (_a = (isHorizontal ? el.stretchingStrengthX : el.stretchingStrengthY)) !== null && _a !== void 0 ? _a : 1;
217
+ const strength = (_a = (isHorizontal ? el.stretchingStrengthH : el.stretchingStrengthV)) !== null && _a !== void 0 ? _a : 1;
214
218
  if (strength > 0)
215
219
  r |= 1 << i;
216
220
  else
@@ -224,7 +228,7 @@ function getFractionCount(isHorizontal, children, vector, index, force = false)
224
228
  var _a;
225
229
  let result = 0;
226
230
  for (const i of indexes(vector, index)) {
227
- const growth = (_a = (isHorizontal ? children[i].element.stretchingStrengthX : children[i].element.stretchingStrengthY)) !== null && _a !== void 0 ? _a : 1;
231
+ const growth = (_a = (isHorizontal ? children[i].element.stretchingStrengthH : children[i].element.stretchingStrengthV)) !== null && _a !== void 0 ? _a : 1;
228
232
  result += growth > 0 ? growth : (force ? 1 : 0);
229
233
  }
230
234
  return result;
@@ -269,7 +273,7 @@ function distribute(sign, deltaPx, index, priorities, sizesPx, isHorizontal, for
269
273
  for (const i of indexes(vector, sign * index)) {
270
274
  const child = sizesPx[i].node;
271
275
  const initialSizePx = sizesPx[i].sizePx;
272
- const strength = isHorizontal ? ((_a = child.element.stretchingStrengthX) !== null && _a !== void 0 ? _a : 1) : ((_b = child.element.stretchingStrengthY) !== null && _b !== void 0 ? _b : 1);
276
+ const strength = isHorizontal ? ((_a = child.element.stretchingStrengthH) !== null && _a !== void 0 ? _a : 1) : ((_b = child.element.stretchingStrengthV) !== null && _b !== void 0 ? _b : 1);
273
277
  const growth = strength > 0 ? strength : (force ? 1 : 0);
274
278
  const newSizePx = initialSizePx + sign * (growth * fractionSizePx);
275
279
  const size = isHorizontal ? sizesPx[i].node.element.widthPx : sizesPx[i].node.element.heightPx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.24.272",
3
+ "version": "0.24.274",
4
4
  "description": "Verstak - Front-End Library",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "homepage": "https://github.com/nezaboodka/verstak/blob/master/README.md#readme",
33
33
  "dependencies": {
34
- "reactronic": "^0.24.270"
34
+ "reactronic": "^0.24.271"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "20.11.17",