verstak 0.24.266 → 0.24.268

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.
@@ -9,13 +9,11 @@ export type El<T = any, M = any> = {
9
9
  kind: ElKind;
10
10
  area: ElArea;
11
11
  width: Range;
12
- widthJustMin: string;
13
12
  height: Range;
14
- heightJustMin: string;
15
13
  alignment: Align;
16
14
  extraAlignment: Align;
17
- stretchFactorX: number | undefined;
18
- stretchFactorY: number | undefined;
15
+ stretchingStrengthX: number | undefined;
16
+ stretchingStrengthY: number | undefined;
19
17
  contentWrapping: boolean;
20
18
  overlayVisible: boolean | undefined;
21
19
  readonly style: CSSStyleDeclaration;
@@ -37,17 +35,17 @@ export type ElCoords = {
37
35
  y2: number;
38
36
  };
39
37
  export declare enum Align {
40
- left = 1,
41
- centerX = 2,
42
- right = 3,
43
- stretchX = 4,
44
- top = 8,
45
- centerY = 16,
46
- bottom = 24,
47
- stretchY = 32,
48
- center = 18,
49
- stretch = 36,
50
- default = 0
38
+ default = 0,
39
+ left = 4,
40
+ centerWidth = 5,
41
+ right = 6,
42
+ stretchWidth = 7,
43
+ top = 32,
44
+ centerHeight = 40,
45
+ bottom = 48,
46
+ stretchHeight = 56,
47
+ center = 45,
48
+ stretch = 63
51
49
  }
52
50
  export type Range = {
53
51
  readonly min?: string;
@@ -74,8 +72,8 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
74
72
  private _height;
75
73
  private _alignment;
76
74
  private _extraAlignment;
77
- private _stretchFactorX;
78
- private _stretchFactorY;
75
+ private _stretchingStrengthX;
76
+ private _stretchingStrengthY;
79
77
  private _contentWrapping;
80
78
  private _overlayVisible;
81
79
  private _hasStylingPresets;
@@ -90,20 +88,16 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
90
88
  set area(value: ElArea);
91
89
  get width(): Range;
92
90
  set width(value: Range);
93
- get widthJustMin(): string;
94
- set widthJustMin(value: string);
95
91
  get height(): Range;
96
92
  set height(value: Range);
97
- get heightJustMin(): string;
98
- set heightJustMin(value: string);
99
93
  get alignment(): Align;
100
94
  set alignment(value: Align);
101
95
  get extraAlignment(): Align;
102
96
  set extraAlignment(value: Align);
103
- get stretchFactorX(): number | undefined;
104
- set stretchFactorX(value: number | undefined);
105
- get stretchFactorY(): number | undefined;
106
- set stretchFactorY(value: number | undefined);
97
+ get stretchingStrengthX(): number | undefined;
98
+ set stretchingStrengthX(value: number | undefined);
99
+ get stretchingStrengthY(): number | undefined;
100
+ set stretchingStrengthY(value: number | undefined);
107
101
  get contentWrapping(): boolean;
108
102
  set contentWrapping(value: boolean);
109
103
  get overlayVisible(): boolean | undefined;
@@ -135,19 +129,18 @@ export declare class CursorCommandDriver extends ElDriver<Element, unknown> {
135
129
  constructor();
136
130
  }
137
131
  export declare class Apply {
138
- static kind<T extends Element>(element: El<T, any>, value: ElKind): void;
139
- static coords<T extends Element>(element: El<T, any>, value: ElCoords | undefined): void;
140
- static minWidth<T extends Element>(element: El<T, any>, value: string): void;
141
- static maxWidth<T extends Element>(element: El<T, any>, value: string): void;
142
- static minHeight<T extends Element>(element: El<T, any>, value: string): void;
143
- static maxHeight<T extends Element>(element: El<T, any>, value: string): void;
144
- static alignment<T extends Element>(element: El<T, any>, value: Align): void;
145
- static extraAlignment<T extends Element>(element: El<T, any>, value: Align): void;
146
- static stretchFactorX<T extends Element>(element: El<T, any>, value: number): void;
147
- static stretchFactorY<T extends Element>(element: El<T, any>, value: number): void;
148
- static contentWrapping<T extends Element>(element: El<T, any>, value: boolean): void;
149
- static overlayVisible<T extends Element>(element: El<T, any>, value: boolean | undefined): void;
150
- static stylingPreset<T extends Element>(element: El<T, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
132
+ static kind<T extends Element>(element: ElImpl<T, any>, value: ElKind): void;
133
+ static coords<T extends Element>(element: ElImpl<T, any>, value: ElCoords | undefined): void;
134
+ static minWidth<T extends Element>(element: ElImpl<T, any>, value: string): void;
135
+ static maxWidth<T extends Element>(element: ElImpl<T, any>, value: string): void;
136
+ static minHeight<T extends Element>(element: ElImpl<T, any>, value: string): void;
137
+ static maxHeight<T extends Element>(element: ElImpl<T, any>, value: string): void;
138
+ static alignment<T extends Element>(element: ElImpl<T, any>, primary: Align, extra: Align, strengthX: number | undefined, strengthY: number | undefined): void;
139
+ static stretchingStrengthX<T extends Element>(element: ElImpl<T, any>, value: number): void;
140
+ static stretchingStrengthY<T extends Element>(element: ElImpl<T, any>, value: number): void;
141
+ static contentWrapping<T extends Element>(element: ElImpl<T, any>, value: boolean): void;
142
+ static overlayVisible<T extends Element>(element: ElImpl<T, any>, value: boolean | undefined): void;
143
+ static stylingPreset<T extends Element>(element: ElImpl<T, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
151
144
  }
152
145
  export declare const Constants: {
153
146
  element: string;
@@ -17,17 +17,17 @@ export var ElKind;
17
17
  })(ElKind || (ElKind = {}));
18
18
  export var Align;
19
19
  (function (Align) {
20
- Align[Align["left"] = 1] = "left";
21
- Align[Align["centerX"] = 2] = "centerX";
22
- Align[Align["right"] = 3] = "right";
23
- Align[Align["stretchX"] = 4] = "stretchX";
24
- Align[Align["top"] = 8] = "top";
25
- Align[Align["centerY"] = 16] = "centerY";
26
- Align[Align["bottom"] = 24] = "bottom";
27
- Align[Align["stretchY"] = 32] = "stretchY";
28
- Align[Align["center"] = 18] = "center";
29
- Align[Align["stretch"] = 36] = "stretch";
30
20
  Align[Align["default"] = 0] = "default";
21
+ Align[Align["left"] = 4] = "left";
22
+ Align[Align["centerWidth"] = 5] = "centerWidth";
23
+ Align[Align["right"] = 6] = "right";
24
+ Align[Align["stretchWidth"] = 7] = "stretchWidth";
25
+ Align[Align["top"] = 32] = "top";
26
+ Align[Align["centerHeight"] = 40] = "centerHeight";
27
+ Align[Align["bottom"] = 48] = "bottom";
28
+ Align[Align["stretchHeight"] = 56] = "stretchHeight";
29
+ Align[Align["center"] = 45] = "center";
30
+ Align[Align["stretch"] = 63] = "stretch";
31
31
  })(Align || (Align = {}));
32
32
  export class ElImpl {
33
33
  constructor(node) {
@@ -44,8 +44,8 @@ export class ElImpl {
44
44
  this._height = { min: "", max: "" };
45
45
  this._alignment = Align.default;
46
46
  this._extraAlignment = Align.default;
47
- this._stretchFactorX = undefined;
48
- this._stretchFactorY = undefined;
47
+ this._stretchingStrengthX = undefined;
48
+ this._stretchingStrengthY = undefined;
49
49
  this._contentWrapping = true;
50
50
  this._overlayVisible = undefined;
51
51
  this._hasStylingPresets = false;
@@ -104,8 +104,6 @@ export class ElImpl {
104
104
  if (updated)
105
105
  this._width = value;
106
106
  }
107
- get widthJustMin() { var _a; return (_a = this._width.min) !== null && _a !== void 0 ? _a : ""; }
108
- set widthJustMin(value) { this.width = { min: value }; }
109
107
  get height() { return this._height; }
110
108
  set height(value) {
111
109
  var _a, _b;
@@ -122,34 +120,32 @@ export class ElImpl {
122
120
  if (updated)
123
121
  this._height = value;
124
122
  }
125
- get heightJustMin() { var _a; return (_a = this._height.min) !== null && _a !== void 0 ? _a : ""; }
126
- set heightJustMin(value) { this.height = { min: value }; }
127
123
  get alignment() { return this._alignment; }
128
124
  set alignment(value) {
129
125
  if (value !== this._alignment) {
130
- Apply.alignment(this, value);
126
+ Apply.alignment(this, value, this._extraAlignment, this._stretchingStrengthX, this._stretchingStrengthY);
131
127
  this._alignment = value;
132
128
  }
133
129
  }
134
130
  get extraAlignment() { return this._extraAlignment; }
135
131
  set extraAlignment(value) {
136
132
  if (value !== this._extraAlignment) {
137
- Apply.extraAlignment(this, value);
133
+ Apply.alignment(this, this._alignment, value, this._stretchingStrengthX, this._stretchingStrengthY);
138
134
  this._extraAlignment = value;
139
135
  }
140
136
  }
141
- get stretchFactorX() { return this._stretchFactorX; }
142
- set stretchFactorX(value) {
143
- if (value !== this._stretchFactorX) {
144
- Apply.stretchFactorX(this, value !== null && value !== void 0 ? value : 0);
145
- this._stretchFactorX = value;
137
+ get stretchingStrengthX() { return this._stretchingStrengthX; }
138
+ set stretchingStrengthX(value) {
139
+ if (value !== this._stretchingStrengthX) {
140
+ Apply.stretchingStrengthX(this, value !== null && value !== void 0 ? value : 0);
141
+ this._stretchingStrengthX = value;
146
142
  }
147
143
  }
148
- get stretchFactorY() { return this._stretchFactorY; }
149
- set stretchFactorY(value) {
150
- if (value !== this._stretchFactorY) {
151
- Apply.stretchFactorY(this, value !== null && value !== void 0 ? value : 0);
152
- this._stretchFactorY = value;
144
+ get stretchingStrengthY() { return this._stretchingStrengthY; }
145
+ set stretchingStrengthY(value) {
146
+ if (value !== this._stretchingStrengthY) {
147
+ Apply.stretchingStrengthY(this, value !== null && value !== void 0 ? value : 0);
148
+ this._stretchingStrengthY = value;
153
149
  }
154
150
  }
155
151
  get contentWrapping() { return this._contentWrapping; }
@@ -343,35 +339,42 @@ export class Apply {
343
339
  if (element.native instanceof HTMLElement)
344
340
  element.native.style.maxHeight = `${value}`;
345
341
  }
346
- static alignment(element, value) {
342
+ static alignment(element, primary, extra, strengthX, strengthY) {
347
343
  if (element.native instanceof HTMLElement) {
348
344
  const s = element.native.style;
349
- if (value !== Align.default) {
350
- const v = AlignToCss[(value >> 3) & 0b11];
351
- const h = AlignToCss[value & 0b11];
352
- s.alignSelf = v;
353
- s.justifySelf = h;
345
+ let v1 = "";
346
+ let h1 = "";
347
+ let t1 = "";
348
+ if (primary !== Align.default) {
349
+ v1 = AlignToCss[(primary >> 3) & 0b11];
350
+ h1 = AlignToCss[primary & 0b11];
351
+ t1 = TextAlignCss[primary & 0b11];
354
352
  }
355
- else
356
- s.alignSelf = s.justifySelf = "";
357
- }
358
- }
359
- static extraAlignment(element, value) {
360
- if (element.native instanceof HTMLElement) {
361
- const s = element.native.style;
362
- if (value !== Align.default) {
363
- const v = AlignToCss[(value >> 3) & 0b11];
364
- const h = AlignToCss[value & 0b11];
365
- const t = TextAlignCss[value & 0b11];
366
- s.justifyContent = v;
367
- s.alignItems = h;
368
- s.textAlign = t;
353
+ s.alignSelf = v1;
354
+ s.justifySelf = h1;
355
+ if ((primary & Align.left) !== 0 && strengthX === undefined)
356
+ Apply.stretchingStrengthX(element, 1);
357
+ if ((primary & Align.top) !== 0 && strengthY === undefined)
358
+ Apply.stretchingStrengthY(element, 1);
359
+ let v2 = "";
360
+ let h2 = "";
361
+ let t2 = "";
362
+ if (extra !== Align.default) {
363
+ v2 = AlignToCss[(extra >> 3) & 0b11];
364
+ h2 = AlignToCss[extra & 0b11];
365
+ t2 = TextAlignCss[extra & 0b11];
369
366
  }
370
- else
371
- s.justifyContent = s.alignContent = s.textAlign = "";
367
+ else {
368
+ v2 = v1;
369
+ h2 = h1;
370
+ t2 = t1;
371
+ }
372
+ s.justifyContent = v2;
373
+ s.alignItems = h2;
374
+ s.textAlign = t2;
372
375
  }
373
376
  }
374
- static stretchFactorX(element, value) {
377
+ static stretchingStrengthX(element, value) {
375
378
  if (element.native instanceof HTMLElement) {
376
379
  const s = element.native.style;
377
380
  if (value > 0) {
@@ -384,7 +387,7 @@ export class Apply {
384
387
  }
385
388
  }
386
389
  }
387
- static stretchFactorY(element, value) {
390
+ static stretchingStrengthY(element, value) {
388
391
  const bNode = element.node;
389
392
  const driver = bNode.driver;
390
393
  if (driver.isPartition) {
@@ -400,8 +403,8 @@ export class Apply {
400
403
  const hostDriver = bNode.host.driver;
401
404
  if (hostDriver.isPartition) {
402
405
  const host = bNode.host.seat.instance;
403
- Apply.alignment(element, Align.stretch);
404
- Apply.stretchFactorY(host.element, value);
406
+ Apply.alignment(host.element, Align.stretchHeight, Align.default, undefined, undefined);
407
+ Apply.stretchingStrengthY(host.element, value);
405
408
  }
406
409
  }
407
410
  }
@@ -514,5 +517,5 @@ const VerstakDriversByLayout = [
514
517
  el => {
515
518
  },
516
519
  ];
517
- const AlignToCss = ["stretch", "start", "center", "end"];
518
- const TextAlignCss = ["justify", "left", "center", "right"];
520
+ const AlignToCss = ["start", "center", "end", "stretch"];
521
+ const TextAlignCss = ["left", "center", "right", "justify"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.24.266",
3
+ "version": "0.24.268",
4
4
  "description": "Verstak - Front-End Library",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",