verstak 0.96.26003 → 0.96.26005
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.
- package/build/dist/source/core/El.d.ts +1 -1
- package/build/dist/source/core/ElDriver.d.ts +1 -1
- package/build/dist/source/core/ElDriver.js +7 -7
- package/build/dist/source/core/Elements.d.ts +2 -2
- package/build/dist/source/core/Elements.js +12 -14
- package/build/dist/source/core/SplitViewMath.d.ts +3 -3
- package/build/dist/source/core/SplitViewMath.js +10 -12
- package/build/dist/source/core/WebDriver.d.ts +1 -1
- package/build/dist/source/core/WebDriver.js +3 -3
- package/package.json +2 -2
|
@@ -31,7 +31,7 @@ export declare class ElImpl<T extends Element = any, M = any> implements El<T, M
|
|
|
31
31
|
private _hasStylingPresets;
|
|
32
32
|
constructor(node: ReactiveTreeNode<El<T, M>>);
|
|
33
33
|
prepareForUpdate(): void;
|
|
34
|
-
get
|
|
34
|
+
get rank(): number;
|
|
35
35
|
get isBlock(): boolean;
|
|
36
36
|
get isTable(): boolean;
|
|
37
37
|
get isAuxiliary(): boolean;
|
|
@@ -47,7 +47,7 @@ export class ElImpl {
|
|
|
47
47
|
this._place = undefined;
|
|
48
48
|
this._hasStylingPresets = false;
|
|
49
49
|
}
|
|
50
|
-
get
|
|
50
|
+
get rank() { return this.node.rank; }
|
|
51
51
|
get isBlock() { return this.kind === ElKind.block; }
|
|
52
52
|
get isTable() { return this.kind === ElKind.table; }
|
|
53
53
|
get isAuxiliary() { return this.kind > ElKind.table; }
|
|
@@ -67,9 +67,9 @@ export class ElImpl {
|
|
|
67
67
|
if (!driver.isPartition) {
|
|
68
68
|
const owner = node.owner;
|
|
69
69
|
const ownerEl = owner.element;
|
|
70
|
-
const prevEl = (_a = node.
|
|
70
|
+
const prevEl = (_a = node.prev) === null || _a === void 0 ? void 0 : _a.element;
|
|
71
71
|
const prevElLayoutInfo = (_b = prevEl === null || prevEl === void 0 ? void 0 : prevEl.layoutInfo) !== null && _b !== void 0 ? _b : InitialElLayoutInfo;
|
|
72
|
-
const layoutInfo = this.layoutInfo = owner.children.
|
|
72
|
+
const layoutInfo = this.layoutInfo = owner.children.isStrictOrder ? new ElLayoutInfo(prevElLayoutInfo) : undefined;
|
|
73
73
|
const isCursorElement = driver instanceof CursorCommandDriver;
|
|
74
74
|
const coords = getElCoordsAndAdjustLayoutInfo(!isCursorElement, value, ownerEl.maxColumnCount, ownerEl.maxRowCount, prevElLayoutInfo, layoutInfo);
|
|
75
75
|
if (!equalElCoords(coords, this._coords)) {
|
|
@@ -223,9 +223,9 @@ export class ElImpl {
|
|
|
223
223
|
this._hasStylingPresets = true;
|
|
224
224
|
}
|
|
225
225
|
*children(onlyAfter) {
|
|
226
|
-
const after = onlyAfter === null || onlyAfter === void 0 ? void 0 : onlyAfter.node
|
|
226
|
+
const after = onlyAfter === null || onlyAfter === void 0 ? void 0 : onlyAfter.node;
|
|
227
227
|
for (const child of this.node.children.items(after))
|
|
228
|
-
yield child.
|
|
228
|
+
yield child.element;
|
|
229
229
|
}
|
|
230
230
|
static *childrenOf(node, onlyAfter) {
|
|
231
231
|
return node.element.children(onlyAfter);
|
|
@@ -233,7 +233,7 @@ export class ElImpl {
|
|
|
233
233
|
rowBreak() {
|
|
234
234
|
var _a, _b;
|
|
235
235
|
const node = this.node;
|
|
236
|
-
const prevEl = (_a = node.
|
|
236
|
+
const prevEl = (_a = node.prev) === null || _a === void 0 ? void 0 : _a.element;
|
|
237
237
|
const prevElLayoutInfo = (_b = prevEl === null || prevEl === void 0 ? void 0 : prevEl.layoutInfo) !== null && _b !== void 0 ? _b : InitialElLayoutInfo;
|
|
238
238
|
const layoutInfo = this.layoutInfo = new ElLayoutInfo(prevElLayoutInfo);
|
|
239
239
|
layoutInfo.x = 1;
|
|
@@ -301,7 +301,7 @@ export class ElImpl {
|
|
|
301
301
|
const isAligner = newPrimary === Horizontal.center ||
|
|
302
302
|
newPrimary === Horizontal.right;
|
|
303
303
|
isEffectiveAlignerX = isAligner && (hostLayout.alignerX === undefined ||
|
|
304
|
-
element.
|
|
304
|
+
element.rank <= hostLayout.alignerX.rank);
|
|
305
305
|
if (hostLayout.alignerX === element) {
|
|
306
306
|
if (!isEffectiveAlignerX) {
|
|
307
307
|
css.marginLeft = "";
|
|
@@ -20,12 +20,12 @@ export declare function Fragment<M = unknown>(body: Script<El<void, M>>): Reacti
|
|
|
20
20
|
export declare function PseudoElement<M = unknown>(body?: Script<El<void, M>>, bodyTask?: ScriptAsync<El<void, M>>, key?: string, mode?: Mode, preparation?: Script<El<void, M>>, preparationTask?: ScriptAsync<El<void, M>>, finalization?: Script<El<void, M>>, signalArgs?: unknown, basis?: ReactiveTreeNodeDecl<El<void, M>>): ReactiveTreeNode<El<void, M>>;
|
|
21
21
|
export declare function PseudoElement<M = unknown>(declaration?: ReactiveTreeNodeDecl<El<void, M>>): ReactiveTreeNode<El<void, M>>;
|
|
22
22
|
export declare class BlockDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
23
|
-
|
|
23
|
+
rebuildBody(node: ReactiveTreeNode<El<T>>): void | Promise<void>;
|
|
24
24
|
declareChild(ownerNode: ReactiveTreeNode<El<T, any>>, childDriver: ReactiveTreeNodeDriver<any>, childDeclaration?: ReactiveTreeNodeDecl<any> | undefined, childBasis?: ReactiveTreeNodeDecl<any> | undefined): LinkedItem<ReactiveTreeNode> | undefined;
|
|
25
25
|
}
|
|
26
26
|
export declare function isSplitViewPartition(childDriver: ReactiveTreeNodeDriver): boolean;
|
|
27
27
|
export declare class PartitionDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
28
|
-
|
|
28
|
+
rebuildBody(node: ReactiveTreeNode<El<T>>): void | Promise<void>;
|
|
29
29
|
provideHost(node: ReactiveTreeNode<El<T, any>>): ReactiveTreeNode<El<T, any>>;
|
|
30
30
|
}
|
|
31
31
|
export declare const Drivers: {
|
|
@@ -61,8 +61,7 @@ export function declareSplitter(index, splitViewNode) {
|
|
|
61
61
|
else {
|
|
62
62
|
e.setAttribute("rx-dragging", "true");
|
|
63
63
|
const initialSizesPx = [];
|
|
64
|
-
for (const
|
|
65
|
-
const child = item.instance;
|
|
64
|
+
for (const child of splitViewNode.children.items()) {
|
|
66
65
|
if (isSplitViewPartition(child.driver)) {
|
|
67
66
|
const sizePx = (_c = (_b = child.element.layoutInfo) === null || _b === void 0 ? void 0 : _b.effectiveSizePx) !== null && _c !== void 0 ? _c : 0;
|
|
68
67
|
initialSizesPx.push({ node: child, sizePx });
|
|
@@ -97,10 +96,10 @@ export function PseudoElement(bodyOrDeclaration, bodyTask, key, mode, preparatio
|
|
|
97
96
|
return declare(Drivers.pseudo, bodyOrDeclaration, bodyTask, key, mode, preparation, preparationTask, finalization, signalArgs, basis);
|
|
98
97
|
}
|
|
99
98
|
export class BlockDriver extends HtmlDriver {
|
|
100
|
-
|
|
99
|
+
rebuildBody(node) {
|
|
101
100
|
rowBreak();
|
|
102
101
|
const el = node.element;
|
|
103
|
-
const result = super.
|
|
102
|
+
const result = super.rebuildBody(node);
|
|
104
103
|
if (el.splitView !== undefined) {
|
|
105
104
|
if (el.layoutInfo === undefined)
|
|
106
105
|
el.layoutInfo = new ElLayoutInfo(InitialElLayoutInfo);
|
|
@@ -130,8 +129,8 @@ export class BlockDriver extends HtmlDriver {
|
|
|
130
129
|
const preferred = [];
|
|
131
130
|
const sizesPx = [];
|
|
132
131
|
for (const child of node.children.items()) {
|
|
133
|
-
const partEl = child.
|
|
134
|
-
if (isSplitViewPartition(child.
|
|
132
|
+
const partEl = child.element;
|
|
133
|
+
if (isSplitViewPartition(child.driver) && partEl !== undefined) {
|
|
135
134
|
const size = isHorizontal ? partEl.width : partEl.height;
|
|
136
135
|
const options = {
|
|
137
136
|
axis: isHorizontal ? Axis.X : Axis.Y, lineSizePx: BodyFontSize, fontSizePx: BodyFontSize,
|
|
@@ -153,7 +152,7 @@ export class BlockDriver extends HtmlDriver {
|
|
|
153
152
|
preferred.push(i);
|
|
154
153
|
}
|
|
155
154
|
const sizePx = partEl.layoutInfo.effectiveSizePx = clamp(partEl.layoutInfo.effectiveSizePx, minPx, maxPx);
|
|
156
|
-
sizesPx.push({ node: child
|
|
155
|
+
sizesPx.push({ node: child, sizePx });
|
|
157
156
|
i++;
|
|
158
157
|
}
|
|
159
158
|
}
|
|
@@ -172,14 +171,13 @@ export class BlockDriver extends HtmlDriver {
|
|
|
172
171
|
return result;
|
|
173
172
|
}
|
|
174
173
|
declareChild(ownerNode, childDriver, childDeclaration, childBasis) {
|
|
175
|
-
var _a;
|
|
176
174
|
let result = undefined;
|
|
177
175
|
const el = ownerNode.element;
|
|
178
176
|
if (el.splitView !== undefined) {
|
|
179
177
|
if (isSplitViewPartition(childDriver)) {
|
|
180
178
|
let partCount = 0;
|
|
181
179
|
for (const child of ownerNode.children.items()) {
|
|
182
|
-
if (isSplitViewPartition(child.
|
|
180
|
+
if (isSplitViewPartition(child.driver))
|
|
183
181
|
partCount++;
|
|
184
182
|
}
|
|
185
183
|
const isHorizontal = el.splitView === Direction.horizontal;
|
|
@@ -200,8 +198,8 @@ export class BlockDriver extends HtmlDriver {
|
|
|
200
198
|
}
|
|
201
199
|
else {
|
|
202
200
|
if (childDriver.isPartition) {
|
|
203
|
-
const last = ownerNode.children.lastItem
|
|
204
|
-
if ((
|
|
201
|
+
const last = ownerNode.children.lastItem;
|
|
202
|
+
if ((last === null || last === void 0 ? void 0 : last.driver) === childDriver)
|
|
205
203
|
result = last;
|
|
206
204
|
}
|
|
207
205
|
}
|
|
@@ -218,8 +216,8 @@ function overrideMethod(declaration, method, func) {
|
|
|
218
216
|
: (el, base) => { base(); func.call(el, el); };
|
|
219
217
|
}
|
|
220
218
|
export class PartitionDriver extends HtmlDriver {
|
|
221
|
-
|
|
222
|
-
const result = super.
|
|
219
|
+
rebuildBody(node) {
|
|
220
|
+
const result = super.rebuildBody(node);
|
|
223
221
|
const ownerEl = node.owner.element;
|
|
224
222
|
if (ownerEl.sealed !== undefined) {
|
|
225
223
|
node.element.style.flexGrow = "1";
|
|
@@ -253,7 +251,7 @@ export class PartitionDriver extends HtmlDriver {
|
|
|
253
251
|
let host;
|
|
254
252
|
const ownerEl = node.owner.element;
|
|
255
253
|
if (ownerEl.sealed !== undefined)
|
|
256
|
-
host = node.children.firstItem
|
|
254
|
+
host = node.children.firstItem;
|
|
257
255
|
else
|
|
258
256
|
host = node;
|
|
259
257
|
return host;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactiveTreeNode,
|
|
1
|
+
import { ReactiveTreeNode, LinkedList } from "reactronic";
|
|
2
2
|
import { ElImpl } from "./ElDriver.js";
|
|
3
3
|
export declare function equal(a: number, b: number): boolean;
|
|
4
4
|
export declare function less(a: number, b: number): boolean;
|
|
@@ -17,11 +17,11 @@ export declare function resizeUsingDelta(splitViewNode: ReactiveTreeNode<ElImpl>
|
|
|
17
17
|
}>, force?: boolean): number;
|
|
18
18
|
export declare function layout(splitViewNode: ReactiveTreeNode<ElImpl>): void;
|
|
19
19
|
export declare function getPrioritiesForSplitter(index: number, size: number): ReadonlyArray<number>;
|
|
20
|
-
export declare function getPrioritiesForSizeChanging(isHorizontal: boolean, children:
|
|
20
|
+
export declare function getPrioritiesForSizeChanging(isHorizontal: boolean, children: LinkedList<ReactiveTreeNode>, indexes: Array<number>): {
|
|
21
21
|
resizable: ReadonlyArray<number>;
|
|
22
22
|
manuallyResizable: ReadonlyArray<number>;
|
|
23
23
|
};
|
|
24
|
-
export declare function getPrioritiesForEmptySpaceDistribution(isHorizontal: boolean, children:
|
|
24
|
+
export declare function getPrioritiesForEmptySpaceDistribution(isHorizontal: boolean, children: LinkedList<ReactiveTreeNode>): {
|
|
25
25
|
resizable: ReadonlyArray<number>;
|
|
26
26
|
manuallyResizable: ReadonlyArray<number>;
|
|
27
27
|
};
|
|
@@ -94,7 +94,7 @@ export function resizeUsingDelta(splitViewNode, deltaPx, index, priorities, size
|
|
|
94
94
|
return beforeDeltaPx;
|
|
95
95
|
}
|
|
96
96
|
export function layout(splitViewNode) {
|
|
97
|
-
var _a, _b, _c, _d, _e, _f
|
|
97
|
+
var _a, _b, _c, _d, _e, _f;
|
|
98
98
|
const isHorizontal = splitViewNode.element.splitView === Direction.horizontal;
|
|
99
99
|
let posPx = 0;
|
|
100
100
|
let shrinkBefore = false;
|
|
@@ -102,12 +102,11 @@ export function layout(splitViewNode) {
|
|
|
102
102
|
let isSplitterEnabled = false;
|
|
103
103
|
const sizesPx = [];
|
|
104
104
|
const layoutInfo = splitViewNode.element.layoutInfo;
|
|
105
|
-
for (const
|
|
106
|
-
const child = item.instance;
|
|
105
|
+
for (const child of splitViewNode.children.items()) {
|
|
107
106
|
if (isSplitViewPartition(child.driver)) {
|
|
108
107
|
const el = child.element;
|
|
109
108
|
if (el.native !== undefined) {
|
|
110
|
-
const current =
|
|
109
|
+
const current = child;
|
|
111
110
|
const sizePx = isHorizontal ? el.widthPx : el.heightPx;
|
|
112
111
|
const effectiveSizePx = (_b = (_a = el.layoutInfo) === null || _a === void 0 ? void 0 : _a.effectiveSizePx) !== null && _b !== void 0 ? _b : 0;
|
|
113
112
|
posPx += effectiveSizePx;
|
|
@@ -118,8 +117,7 @@ export function layout(splitViewNode) {
|
|
|
118
117
|
growBefore || (growBefore = greater(sizePx.maxPx - effectiveSizePx, 0));
|
|
119
118
|
let shrinkAfter = false;
|
|
120
119
|
let growAfter = false;
|
|
121
|
-
for (const
|
|
122
|
-
const child = item.instance;
|
|
120
|
+
for (const child of splitViewNode.children.items(current)) {
|
|
123
121
|
if (isSplitViewPartition(child.driver)) {
|
|
124
122
|
const el = child.element;
|
|
125
123
|
if (el.native !== undefined) {
|
|
@@ -148,7 +146,7 @@ export function layout(splitViewNode) {
|
|
|
148
146
|
}
|
|
149
147
|
const containerSizePx = (_e = (isHorizontal ? layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.contentSizeXpx : layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.contentSizeYpx)) !== null && _e !== void 0 ? _e : 0;
|
|
150
148
|
const isOverflowing = greater(posPx, containerSizePx);
|
|
151
|
-
const wrapper = (
|
|
149
|
+
const wrapper = (_f = splitViewNode.children.firstItem) === null || _f === void 0 ? void 0 : _f.children.firstItem;
|
|
152
150
|
if (wrapper !== undefined) {
|
|
153
151
|
if (isHorizontal)
|
|
154
152
|
wrapper.element.style.gridTemplateColumns = sizesPx.map(x => `${x}px`).join(" ");
|
|
@@ -186,9 +184,9 @@ export function getPrioritiesForSizeChanging(isHorizontal, children, indexes) {
|
|
|
186
184
|
var _a, _b;
|
|
187
185
|
const resizable = [];
|
|
188
186
|
const manuallyResizable = [];
|
|
189
|
-
const items = Array.from(children.items()).filter(x => isSplitViewPartition(x.
|
|
187
|
+
const items = Array.from(children.items()).filter(x => isSplitViewPartition(x.driver));
|
|
190
188
|
for (let i = items.length - 1; i >= 0; i--) {
|
|
191
|
-
const el = items[i].
|
|
189
|
+
const el = items[i].element;
|
|
192
190
|
const strength = (_a = (isHorizontal ? el.stretchingStrengthHorizontally : el.stretchingStrengthVertically)) !== null && _a !== void 0 ? _a : 1;
|
|
193
191
|
if (!indexes.includes(i)) {
|
|
194
192
|
if (strength > 0)
|
|
@@ -200,7 +198,7 @@ export function getPrioritiesForSizeChanging(isHorizontal, children, indexes) {
|
|
|
200
198
|
let r = 0;
|
|
201
199
|
let mr = 0;
|
|
202
200
|
for (const i of indexes) {
|
|
203
|
-
const el = items[i].
|
|
201
|
+
const el = items[i].element;
|
|
204
202
|
const strength = (_b = (isHorizontal ? el.stretchingStrengthHorizontally : el.stretchingStrengthVertically)) !== null && _b !== void 0 ? _b : 1;
|
|
205
203
|
if (strength > 0)
|
|
206
204
|
r |= 1 << i;
|
|
@@ -219,8 +217,8 @@ export function getPrioritiesForEmptySpaceDistribution(isHorizontal, children) {
|
|
|
219
217
|
let mr = 0;
|
|
220
218
|
let i = 0;
|
|
221
219
|
for (const child of children.items()) {
|
|
222
|
-
if (isSplitViewPartition(child.
|
|
223
|
-
const el = child.
|
|
220
|
+
if (isSplitViewPartition(child.driver)) {
|
|
221
|
+
const el = child.element;
|
|
224
222
|
const strength = (_a = (isHorizontal ? el.stretchingStrengthHorizontally : el.stretchingStrengthVertically)) !== null && _a !== void 0 ? _a : 1;
|
|
225
223
|
if (strength > 0)
|
|
226
224
|
r |= 1 << i;
|
|
@@ -6,7 +6,7 @@ export declare class WebDriver<T extends Element, M = unknown> extends ElDriver<
|
|
|
6
6
|
runPreparation(node: ReactiveTreeNode<El<T, M>>): void | Promise<void>;
|
|
7
7
|
runFinalization(node: ReactiveTreeNode<El<T, M>>, isLeader: boolean): boolean;
|
|
8
8
|
runMount(node: ReactiveTreeNode<El<T, M>>): void;
|
|
9
|
-
|
|
9
|
+
rebuildBody(node: ReactiveTreeNode<El<T, M>>): void | Promise<void>;
|
|
10
10
|
private assignExtraAttributesAndProperties;
|
|
11
11
|
private clearExtraAttributesAndProperties;
|
|
12
12
|
static getOwnNodeOfNativeElement<T extends Element>(element: T): ReactiveTreeNode<El<T>> | undefined;
|
|
@@ -32,7 +32,7 @@ export class WebDriver extends ElDriver {
|
|
|
32
32
|
const el = node.element;
|
|
33
33
|
const native = el.native;
|
|
34
34
|
if (native) {
|
|
35
|
-
const sequential = node.owner.children.
|
|
35
|
+
const sequential = node.owner.children.isStrictOrder;
|
|
36
36
|
const autoHost = ReactiveTreeNode.findMatchingHost(node, n => n.element.native instanceof HTMLElement || n.element.native instanceof SVGElement);
|
|
37
37
|
const automaticNativeHost = autoHost !== node.owner
|
|
38
38
|
? autoHost === null || autoHost === void 0 ? void 0 : autoHost.driver.provideHost(autoHost).element.native
|
|
@@ -57,11 +57,11 @@ export class WebDriver extends ElDriver {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
rebuildBody(node) {
|
|
61
61
|
const el = node.element;
|
|
62
62
|
if (el instanceof ElImpl)
|
|
63
63
|
el.prepareForUpdate();
|
|
64
|
-
let result = super.
|
|
64
|
+
let result = super.rebuildBody(node);
|
|
65
65
|
result = proceedSyncOrAsync(result, v => {
|
|
66
66
|
if (el.place === undefined) {
|
|
67
67
|
const oel = node.owner.element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verstak",
|
|
3
|
-
"version": "0.96.
|
|
3
|
+
"version": "0.96.26005",
|
|
4
4
|
"description": "Verstak - Front-End Library",
|
|
5
5
|
"publisher": "Nezaboodka Software",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"markdown-it": "^14.1.0",
|
|
43
43
|
"markdown-it-prism": "^2.3.0",
|
|
44
44
|
"prismjs": "^1.30.0",
|
|
45
|
-
"reactronic": "^0.96.
|
|
45
|
+
"reactronic": "^0.96.26008"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/markdown-it": "14.1.2",
|