verstak 0.24.273 → 0.24.276
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,7 +5,7 @@ export type El<T = any, M = any> = {
|
|
|
5
5
|
native: T;
|
|
6
6
|
model: M;
|
|
7
7
|
kind: ElKind;
|
|
8
|
-
|
|
8
|
+
place: ElPlace;
|
|
9
9
|
width: Range;
|
|
10
10
|
height: Range;
|
|
11
11
|
horizontal: PosH | undefined;
|
|
@@ -50,13 +50,15 @@ 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
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
|
|
71
|
+
export type ElPlace = undefined | string | {
|
|
70
72
|
cellsOverWidth?: number;
|
|
71
73
|
cellsOverHeight?: number;
|
|
72
74
|
};
|
|
@@ -85,7 +87,7 @@ 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
|
|
90
|
+
private _place;
|
|
89
91
|
private _coords;
|
|
90
92
|
private _width;
|
|
91
93
|
private _height;
|
|
@@ -108,8 +110,8 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
108
110
|
get isAuxiliary(): boolean;
|
|
109
111
|
get kind(): ElKind;
|
|
110
112
|
set kind(value: ElKind);
|
|
111
|
-
get
|
|
112
|
-
set
|
|
113
|
+
get place(): ElPlace;
|
|
114
|
+
set place(value: ElPlace);
|
|
113
115
|
get width(): Range;
|
|
114
116
|
set width(value: Range);
|
|
115
117
|
get widthPx(): {
|
|
@@ -26,6 +26,7 @@ export var PosH;
|
|
|
26
26
|
PosH[PosH["center"] = 1] = "center";
|
|
27
27
|
PosH[PosH["right"] = 2] = "right";
|
|
28
28
|
PosH[PosH["stretch"] = 3] = "stretch";
|
|
29
|
+
PosH[PosH["stretchAndFix"] = 4] = "stretchAndFix";
|
|
29
30
|
})(PosH || (PosH = {}));
|
|
30
31
|
export var PosV;
|
|
31
32
|
(function (PosV) {
|
|
@@ -33,6 +34,7 @@ export var PosV;
|
|
|
33
34
|
PosV[PosV["center"] = 1] = "center";
|
|
34
35
|
PosV[PosV["bottom"] = 2] = "bottom";
|
|
35
36
|
PosV[PosV["stretch"] = 3] = "stretch";
|
|
37
|
+
PosV[PosV["stretchAndFix"] = 4] = "stretchAndFix";
|
|
36
38
|
})(PosV || (PosV = {}));
|
|
37
39
|
export var Direction;
|
|
38
40
|
(function (Direction) {
|
|
@@ -62,7 +64,7 @@ export class ElImpl {
|
|
|
62
64
|
this.native = undefined;
|
|
63
65
|
this.model = undefined;
|
|
64
66
|
this._kind = ElKind.part;
|
|
65
|
-
this.
|
|
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());
|
|
@@ -79,7 +81,7 @@ export class ElImpl {
|
|
|
79
81
|
this._hasStylingPresets = false;
|
|
80
82
|
}
|
|
81
83
|
prepareForUpdate() {
|
|
82
|
-
this.
|
|
84
|
+
this._place = undefined;
|
|
83
85
|
this._hasStylingPresets = false;
|
|
84
86
|
}
|
|
85
87
|
get index() { return this.node.seat.index; }
|
|
@@ -94,8 +96,8 @@ export class ElImpl {
|
|
|
94
96
|
this._kind = value;
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
|
-
get
|
|
98
|
-
set
|
|
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.
|
|
117
|
+
this._place = value !== null && value !== void 0 ? value : {};
|
|
116
118
|
}
|
|
117
119
|
else
|
|
118
120
|
this.rowBreak();
|
|
@@ -370,6 +372,7 @@ export class ElImpl {
|
|
|
370
372
|
css.marginRight = "";
|
|
371
373
|
break;
|
|
372
374
|
case PosH.stretch:
|
|
375
|
+
case PosH.stretchAndFix:
|
|
373
376
|
css.justifySelf = "stretch";
|
|
374
377
|
if (oldPrimary === PosH.center) {
|
|
375
378
|
css.marginLeft = "";
|
|
@@ -394,11 +397,12 @@ export class ElImpl {
|
|
|
394
397
|
css.textAlign = "right";
|
|
395
398
|
break;
|
|
396
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
|
|
405
|
+
if (newPrimary >= PosH.stretch && strength === undefined)
|
|
402
406
|
ElImpl.applyStretchingStrengthH(element, 0, 1);
|
|
403
407
|
}
|
|
404
408
|
static applyVertical(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
|
|
@@ -446,6 +450,7 @@ export class ElImpl {
|
|
|
446
450
|
css.alignSelf = "end";
|
|
447
451
|
break;
|
|
448
452
|
case PosV.stretch:
|
|
453
|
+
case PosV.stretchAndFix:
|
|
449
454
|
css.alignSelf = "stretch";
|
|
450
455
|
break;
|
|
451
456
|
}
|
|
@@ -461,10 +466,11 @@ export class ElImpl {
|
|
|
461
466
|
css.justifyContent = "end";
|
|
462
467
|
break;
|
|
463
468
|
case PosV.stretch:
|
|
469
|
+
case PosV.stretchAndFix:
|
|
464
470
|
css.justifyContent = "stretch";
|
|
465
471
|
break;
|
|
466
472
|
}
|
|
467
|
-
if (newPrimary
|
|
473
|
+
if (newPrimary >= PosV.stretch && strength === undefined)
|
|
468
474
|
ElImpl.applyStretchingStrengthV(element, 0, 1);
|
|
469
475
|
}
|
|
470
476
|
static applyStretchingStrengthH(element, existing, 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,
|
|
649
|
+
function getElCoordsAndAdjustLayoutInfo(isRegularElement, place, maxX, maxY, prevElLayoutInfo, layoutInfo) {
|
|
644
650
|
var _a, _b;
|
|
645
651
|
let result;
|
|
646
|
-
if (typeof (
|
|
647
|
-
result = parseElCoords(
|
|
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 (
|
|
659
|
-
dx = (_a =
|
|
660
|
-
dy = (_b =
|
|
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(
|
|
721
|
-
const x1 = absolutizePosition(
|
|
722
|
-
const x2 = absolutizePosition(
|
|
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(
|
|
728
|
-
const y2 = absolutizePosition(
|
|
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
|
|
@@ -753,7 +759,7 @@ export const Constants = {
|
|
|
753
759
|
partition: "part",
|
|
754
760
|
splitter: "splitter",
|
|
755
761
|
group: "group",
|
|
756
|
-
layouts: ["
|
|
762
|
+
layouts: ["panel", "table", "note", "group", "", "", ""],
|
|
757
763
|
keyAttrName: "key",
|
|
758
764
|
kindAttrName: "kind",
|
|
759
765
|
};
|
|
@@ -802,6 +808,7 @@ const VerstakDriversByLayout = [
|
|
|
802
808
|
const s = el.style;
|
|
803
809
|
s.display = owner.isTable ? "contents" : "flex";
|
|
804
810
|
s.flexDirection = "row";
|
|
811
|
+
s.alignItems = "center";
|
|
805
812
|
s.gap = "inherit";
|
|
806
813
|
},
|
|
807
814
|
el => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RxNodeDecl, RxNodeDriver, RxNode, Delegate, MergedItem } from "reactronic";
|
|
2
|
-
import { CursorCommandDriver, El,
|
|
2
|
+
import { CursorCommandDriver, El, ElPlace } from "./El.js";
|
|
3
3
|
import { HtmlDriver } from "./HtmlDriver.js";
|
|
4
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>>;
|
|
@@ -7,7 +7,7 @@ export declare function row<T = void>(builder?: (element: void) => T, shiftCurso
|
|
|
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:
|
|
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>>;
|
|
@@ -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.
|
|
60
|
+
if (element.place === undefined) {
|
|
61
61
|
const oel = node.owner.element;
|
|
62
62
|
if (oel instanceof ElImpl && oel.isTable)
|
|
63
|
-
element.
|
|
63
|
+
element.place = undefined;
|
|
64
64
|
}
|
|
65
65
|
if (gBlinkingEffectMarker)
|
|
66
66
|
blink(element.native, RxNode.currentUpdatePriority, node.stamp);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verstak",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.276",
|
|
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.
|
|
34
|
+
"reactronic": "^0.24.272"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "20.11.17",
|