verstak 0.24.272 → 0.24.273

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.
@@ -8,12 +8,12 @@ export type El<T = any, M = any> = {
8
8
  area: ElArea;
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,13 +46,13 @@ 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
53
  stretch = 3
54
54
  }
55
- export declare enum VerticalAlignment {
55
+ export declare enum PosV {
56
56
  top = 0,
57
57
  center = 1,
58
58
  bottom = 2,
@@ -89,12 +89,12 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
89
89
  private _coords;
90
90
  private _width;
91
91
  private _height;
92
- private _alignment;
93
- private _verticalAlignment;
94
- private _alignmentInside;
95
- private _verticalAlignmentInside;
96
- private _stretchingStrengthX;
97
- private _stretchingStrengthY;
92
+ private _horizontal;
93
+ private _vertical;
94
+ private _contentHorizontal;
95
+ private _contentVertical;
96
+ private _stretchingStrengthH;
97
+ private _stretchingStrengthV;
98
98
  private _contentWrapping;
99
99
  private _overlayVisible;
100
100
  private _sealed;
@@ -103,7 +103,7 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
103
103
  constructor(node: RxNode<El<T, M>>);
104
104
  prepareForUpdate(): void;
105
105
  get index(): number;
106
- get isSection(): boolean;
106
+ get isPanel(): boolean;
107
107
  get isTable(): boolean;
108
108
  get isAuxiliary(): boolean;
109
109
  get kind(): ElKind;
@@ -134,18 +134,18 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
134
134
  });
135
135
  get preferredHeightUsed(): boolean;
136
136
  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);
137
+ get horizontal(): PosH | undefined;
138
+ set horizontal(value: PosH | undefined);
139
+ get vertical(): PosV | undefined;
140
+ set vertical(value: PosV | undefined);
141
+ get contentHorizontal(): PosH | undefined;
142
+ set contentHorizontal(value: PosH | undefined);
143
+ get contentVertical(): PosV | undefined;
144
+ set contentVertical(value: PosV | undefined);
145
+ get stretchingStrengthH(): number | undefined;
146
+ set stretchingStrengthH(value: number | undefined);
147
+ get stretchingStrengthV(): number | undefined;
148
+ set stretchingStrengthV(value: number | undefined);
149
149
  get contentWrapping(): boolean;
150
150
  set contentWrapping(value: boolean);
151
151
  get overlayVisible(): boolean | undefined;
@@ -164,10 +164,10 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
164
164
  private static applyCoords;
165
165
  private static applyWidth;
166
166
  private static applyHeight;
167
- private static applyAlignment;
168
- private static applyVerticalAlignment;
169
- private static applyStretchingStrengthX;
170
- private static applyStretchingStrengthY;
167
+ private static applyHorizontal;
168
+ private static applyVertical;
169
+ private static applyStretchingStrengthH;
170
+ private static applyStretchingStrengthV;
171
171
  private static applyContentWrapping;
172
172
  private static applyOverlayVisible;
173
173
  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,20 @@ 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 = {}));
30
+ export var PosV;
31
+ (function (PosV) {
32
+ PosV[PosV["top"] = 0] = "top";
33
+ PosV[PosV["center"] = 1] = "center";
34
+ PosV[PosV["bottom"] = 2] = "bottom";
35
+ PosV[PosV["stretch"] = 3] = "stretch";
36
+ })(PosV || (PosV = {}));
37
37
  export var Direction;
38
38
  (function (Direction) {
39
39
  Direction[Direction["horizontal"] = 0] = "horizontal";
@@ -66,12 +66,12 @@ export class ElImpl {
66
66
  this._coords = UndefinedElCoords;
67
67
  this._width = Transaction.separate(() => new Size());
68
68
  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;
69
+ this._horizontal = undefined;
70
+ this._vertical = undefined;
71
+ this._contentHorizontal = undefined;
72
+ this._contentVertical = undefined;
73
+ this._stretchingStrengthH = undefined;
74
+ this._stretchingStrengthV = undefined;
75
75
  this._contentWrapping = true;
76
76
  this._overlayVisible = undefined;
77
77
  this._sealed = undefined;
@@ -83,7 +83,7 @@ export class ElImpl {
83
83
  this._hasStylingPresets = false;
84
84
  }
85
85
  get index() { return this.node.seat.index; }
86
- get isSection() { return this.kind === ElKind.section; }
86
+ get isPanel() { return this.kind === ElKind.panel; }
87
87
  get isTable() { return this.kind === ElKind.table; }
88
88
  get isAuxiliary() { return this.kind > ElKind.note; }
89
89
  get kind() { return this._kind; }
@@ -120,7 +120,7 @@ export class ElImpl {
120
120
  get width() { return this._width.raw; }
121
121
  set width(value) {
122
122
  const w = this._width.raw;
123
- if (value.min !== w.min || value.max !== w.max) {
123
+ if (value.min !== w.min || value.max !== w.max || value.preferred !== undefined) {
124
124
  ElImpl.applyWidth(this, value);
125
125
  this._width.raw = value;
126
126
  this._width.preferredUsed = false;
@@ -143,7 +143,7 @@ export class ElImpl {
143
143
  get height() { return this._height.raw; }
144
144
  set height(value) {
145
145
  const h = this._height.raw;
146
- if (value.min !== h.min || value.max !== h.max) {
146
+ if (value.min !== h.min || value.max !== h.max || value.preferred !== undefined) {
147
147
  ElImpl.applyHeight(this, value);
148
148
  this._height.raw = value;
149
149
  this._height.preferredUsed = false;
@@ -163,52 +163,52 @@ export class ElImpl {
163
163
  set preferredHeightUsed(value) {
164
164
  this._height.preferredUsed = value;
165
165
  }
166
- get alignment() { return this._alignment; }
167
- set alignment(value) {
168
- const existing = this._alignment;
166
+ get horizontal() { return this._horizontal; }
167
+ set horizontal(value) {
168
+ const existing = this._horizontal;
169
169
  if (value !== existing) {
170
- ElImpl.applyAlignment(this, existing, value, this._alignmentInside, this._alignmentInside, this._stretchingStrengthX);
171
- this._alignment = value;
170
+ ElImpl.applyHorizontal(this, existing, value, this._contentHorizontal, this._contentHorizontal, this._stretchingStrengthH);
171
+ this._horizontal = value;
172
172
  }
173
173
  }
174
- get verticalAlignment() { return this._verticalAlignment; }
175
- set verticalAlignment(value) {
176
- const existing = this._verticalAlignment;
174
+ get vertical() { return this._vertical; }
175
+ set vertical(value) {
176
+ const existing = this._vertical;
177
177
  if (value !== existing) {
178
- ElImpl.applyVerticalAlignment(this, existing, value, this._verticalAlignmentInside, this._verticalAlignmentInside, this._stretchingStrengthY);
179
- this._verticalAlignment = value;
178
+ ElImpl.applyVertical(this, existing, value, this._contentVertical, this._contentVertical, this._stretchingStrengthV);
179
+ this._vertical = value;
180
180
  }
181
181
  }
182
- get alignmentInside() { return this._alignmentInside; }
183
- set alignmentInside(value) {
184
- const existing = this._alignmentInside;
182
+ get contentHorizontal() { return this._contentHorizontal; }
183
+ set contentHorizontal(value) {
184
+ const existing = this._contentHorizontal;
185
185
  if (value !== existing) {
186
- ElImpl.applyAlignment(this, this._alignment, this._alignment, existing, value, this._stretchingStrengthX);
187
- this._alignmentInside = value;
186
+ ElImpl.applyHorizontal(this, this._horizontal, this._horizontal, existing, value, this._stretchingStrengthH);
187
+ this._contentHorizontal = value;
188
188
  }
189
189
  }
190
- get verticalAlignmentInside() { return this._verticalAlignmentInside; }
191
- set verticalAlignmentInside(value) {
192
- const existing = this._verticalAlignmentInside;
190
+ get contentVertical() { return this._contentVertical; }
191
+ set contentVertical(value) {
192
+ const existing = this._contentVertical;
193
193
  if (value !== existing) {
194
- ElImpl.applyVerticalAlignment(this, this._verticalAlignment, this._verticalAlignment, existing, value, this._stretchingStrengthY);
195
- this._verticalAlignmentInside = value;
194
+ ElImpl.applyVertical(this, this._vertical, this._vertical, existing, value, this._stretchingStrengthV);
195
+ this._contentVertical = value;
196
196
  }
197
197
  }
198
- get stretchingStrengthX() { return this._stretchingStrengthX; }
199
- set stretchingStrengthX(value) {
200
- const existing = this._stretchingStrengthX;
198
+ get stretchingStrengthH() { return this._stretchingStrengthH; }
199
+ set stretchingStrengthH(value) {
200
+ const existing = this._stretchingStrengthH;
201
201
  if (value !== existing) {
202
- ElImpl.applyStretchingStrengthX(this, existing, value);
203
- this._stretchingStrengthX = value;
202
+ ElImpl.applyStretchingStrengthH(this, existing, value);
203
+ this._stretchingStrengthH = value;
204
204
  }
205
205
  }
206
- get stretchingStrengthY() { return this._stretchingStrengthY; }
207
- set stretchingStrengthY(value) {
208
- const existing = this._stretchingStrengthY;
206
+ get stretchingStrengthV() { return this._stretchingStrengthV; }
207
+ set stretchingStrengthV(value) {
208
+ const existing = this._stretchingStrengthV;
209
209
  if (value !== existing) {
210
- ElImpl.applyStretchingStrengthY(this, existing, value);
211
- this._stretchingStrengthY = value;
210
+ ElImpl.applyStretchingStrengthV(this, existing, value);
211
+ this._stretchingStrengthV = value;
212
212
  }
213
213
  }
214
214
  get contentWrapping() { return this._contentWrapping; }
@@ -310,10 +310,10 @@ export class ElImpl {
310
310
  s.maxHeight = (_b = value.max) !== null && _b !== void 0 ? _b : "";
311
311
  }
312
312
  }
313
- static applyAlignment(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
313
+ static applyHorizontal(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
314
314
  var _a, _b;
315
- oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = Alignment.left);
316
- newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = Alignment.left);
315
+ oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = PosH.left);
316
+ newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = PosH.left);
317
317
  oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
318
318
  newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
319
319
  const css = element.style;
@@ -326,8 +326,8 @@ export class ElImpl {
326
326
  }
327
327
  let isEffectiveAlignerX = false;
328
328
  if (hostLayout) {
329
- const isAligner = newPrimary === Alignment.center ||
330
- newPrimary === Alignment.right;
329
+ const isAligner = newPrimary === PosH.center ||
330
+ newPrimary === PosH.right;
331
331
  isEffectiveAlignerX = isAligner && (hostLayout.alignerX === undefined ||
332
332
  element.index <= hostLayout.alignerX.index);
333
333
  if (hostLayout.alignerX === element) {
@@ -347,63 +347,63 @@ export class ElImpl {
347
347
  }
348
348
  switch (newPrimary) {
349
349
  default:
350
- case Alignment.left:
350
+ case PosH.left:
351
351
  css.justifySelf = "start";
352
- if (oldPrimary === Alignment.center) {
352
+ if (oldPrimary === PosH.center) {
353
353
  css.marginLeft = "";
354
354
  css.marginRight = "";
355
355
  }
356
- else if (oldPrimary === Alignment.right)
356
+ else if (oldPrimary === PosH.right)
357
357
  css.marginLeft = "";
358
358
  break;
359
- case Alignment.center:
359
+ case PosH.center:
360
360
  css.justifySelf = "center";
361
361
  if (hostLayout)
362
362
  css.marginLeft = isEffectiveAlignerX ? "auto" : "";
363
363
  css.marginRight = "auto";
364
364
  break;
365
- case Alignment.right:
365
+ case PosH.right:
366
366
  css.justifySelf = "end";
367
367
  if (hostLayout)
368
368
  css.marginLeft = isEffectiveAlignerX ? "auto" : "";
369
- if (oldPrimary === Alignment.center)
369
+ if (oldPrimary === PosH.center)
370
370
  css.marginRight = "";
371
371
  break;
372
- case Alignment.stretch:
372
+ case PosH.stretch:
373
373
  css.justifySelf = "stretch";
374
- if (oldPrimary === Alignment.center) {
374
+ if (oldPrimary === PosH.center) {
375
375
  css.marginLeft = "";
376
376
  css.marginRight = "";
377
377
  }
378
- else if (oldPrimary === Alignment.right)
378
+ else if (oldPrimary === PosH.right)
379
379
  css.marginLeft = "";
380
380
  break;
381
381
  }
382
382
  switch (newInside) {
383
383
  default:
384
- case Alignment.left:
384
+ case PosH.left:
385
385
  css.alignItems = "start";
386
386
  css.textAlign = "left";
387
387
  break;
388
- case Alignment.center:
388
+ case PosH.center:
389
389
  css.alignItems = "center";
390
390
  css.textAlign = "center";
391
391
  break;
392
- case Alignment.right:
392
+ case PosH.right:
393
393
  css.alignItems = "end";
394
394
  css.textAlign = "right";
395
395
  break;
396
- case Alignment.stretch:
396
+ case PosH.stretch:
397
397
  css.alignItems = "stretch";
398
398
  css.textAlign = "justify";
399
399
  break;
400
400
  }
401
- if (newPrimary === Alignment.stretch && strength === undefined)
402
- ElImpl.applyStretchingStrengthX(element, 0, 1);
401
+ if (newPrimary === PosH.stretch && strength === undefined)
402
+ ElImpl.applyStretchingStrengthH(element, 0, 1);
403
403
  }
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);
404
+ static applyVertical(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
405
+ oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = PosV.top);
406
+ newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = PosV.top);
407
407
  oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
408
408
  newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
409
409
  const css = element.style;
@@ -418,10 +418,10 @@ export class ElImpl {
418
418
  }
419
419
  let isEffectiveAlignerY = false;
420
420
  if (hostLayout) {
421
- const isAligner = newPrimary === VerticalAlignment.center ||
422
- newPrimary === VerticalAlignment.bottom;
421
+ const isAligner = newPrimary === PosV.center ||
422
+ newPrimary === PosV.bottom;
423
423
  isEffectiveAlignerY = isAligner && (hostLayout.alignerY === undefined ||
424
- hostLayout.alignerY.verticalAlignment !== VerticalAlignment.center);
424
+ hostLayout.alignerY.vertical !== PosV.center);
425
425
  if (hostLayout.alignerY === element) {
426
426
  if (!isEffectiveAlignerY) {
427
427
  hostCss.marginTop = "";
@@ -436,43 +436,43 @@ export class ElImpl {
436
436
  }
437
437
  switch (newPrimary) {
438
438
  default:
439
- case VerticalAlignment.top:
439
+ case PosV.top:
440
440
  css.alignSelf = "start";
441
441
  break;
442
- case VerticalAlignment.center:
442
+ case PosV.center:
443
443
  css.alignSelf = "center";
444
444
  break;
445
- case VerticalAlignment.bottom:
445
+ case PosV.bottom:
446
446
  css.alignSelf = "end";
447
447
  break;
448
- case VerticalAlignment.stretch:
448
+ case PosV.stretch:
449
449
  css.alignSelf = "stretch";
450
450
  break;
451
451
  }
452
452
  switch (newInside) {
453
453
  default:
454
- case VerticalAlignment.top:
454
+ case PosV.top:
455
455
  css.justifyContent = "start";
456
456
  break;
457
- case VerticalAlignment.center:
457
+ case PosV.center:
458
458
  css.justifyContent = "center";
459
459
  break;
460
- case VerticalAlignment.bottom:
460
+ case PosV.bottom:
461
461
  css.justifyContent = "end";
462
462
  break;
463
- case VerticalAlignment.stretch:
463
+ case PosV.stretch:
464
464
  css.justifyContent = "stretch";
465
465
  break;
466
466
  }
467
- if (newPrimary === VerticalAlignment.stretch && strength === undefined)
468
- ElImpl.applyStretchingStrengthY(element, 0, 1);
467
+ if (newPrimary === PosV.stretch && strength === undefined)
468
+ ElImpl.applyStretchingStrengthV(element, 0, 1);
469
469
  }
470
- static applyStretchingStrengthX(element, existing, value) {
470
+ static applyStretchingStrengthH(element, existing, value) {
471
471
  const s = element.style;
472
472
  const host = element.node.host;
473
473
  if (host.driver.isPartition) {
474
474
  const hostEl = host.element;
475
- hostEl._stretchingStrengthX = value;
475
+ hostEl._stretchingStrengthH = value;
476
476
  existing !== null && existing !== void 0 ? existing : (existing = 0);
477
477
  value !== null && value !== void 0 ? value : (value = 0);
478
478
  }
@@ -486,12 +486,12 @@ export class ElImpl {
486
486
  s.flexBasis = "";
487
487
  }
488
488
  }
489
- static applyStretchingStrengthY(element, existing, value) {
489
+ static applyStretchingStrengthV(element, existing, value) {
490
490
  var _a;
491
491
  const host = element.node.host;
492
492
  if (host.driver.isPartition) {
493
493
  const hostElement = host.element;
494
- hostElement._stretchingStrengthY = value;
494
+ hostElement._stretchingStrengthV = value;
495
495
  let delta = 0;
496
496
  existing !== null && existing !== void 0 ? existing : (existing = 0);
497
497
  value !== null && value !== void 0 ? value : (value = 0);
@@ -504,7 +504,7 @@ export class ElImpl {
504
504
  delta = -1;
505
505
  }
506
506
  if (delta !== 0) {
507
- const count = (_a = hostElement._stretchingStrengthY) !== null && _a !== void 0 ? _a : 0 + delta;
507
+ const count = (_a = hostElement._stretchingStrengthV) !== null && _a !== void 0 ? _a : 0 + delta;
508
508
  const s = hostElement.style;
509
509
  if (count === 1)
510
510
  s.flexGrow = `${value}`;
@@ -1,7 +1,7 @@
1
1
  import { RxNodeDecl, RxNodeDriver, RxNode, Delegate, MergedItem } from "reactronic";
2
2
  import { CursorCommandDriver, El, ElArea } 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>>;
@@ -12,13 +12,13 @@ export declare function Note(content: string, formatted?: boolean, declaration?:
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);
@@ -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);
@@ -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.273",
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",