verstak 0.96.26004 → 0.96.26010

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.
@@ -27,4 +27,4 @@ export class Theme {
27
27
  Theme.gCurrent.value = value;
28
28
  }
29
29
  }
30
- Theme.gCurrent = new ReactiveTreeVariable(runTransactional({ isolation: Isolation.disjoinFromOuterTransaction }, () => new Theme()));
30
+ Theme.gCurrent = new ReactiveTreeVariable(Theme.name, runTransactional({ isolation: Isolation.disjoinFromOuterTransaction }, () => new Theme()));
@@ -1,7 +1,7 @@
1
1
  import { ReactiveTreeNode } from "reactronic";
2
2
  export type El<T = any, M = any> = {
3
3
  readonly node: ReactiveTreeNode<El<T, M>>;
4
- readonly index: number;
4
+ readonly rank: number;
5
5
  native: T;
6
6
  model: M;
7
7
  kind: ElKind;
@@ -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 index(): number;
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 index() { return this.node.slot.index; }
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.slot.prev) === null || _a === void 0 ? void 0 : _a.instance.element;
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.isStrict ? new ElLayoutInfo(prevElLayoutInfo) : undefined;
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.slot;
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.instance.element;
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.slot.prev) === null || _a === void 0 ? void 0 : _a.instance.element;
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.index <= hostLayout.alignerX.index);
304
+ element.rank <= hostLayout.alignerX.rank);
305
305
  if (hostLayout.alignerX === element) {
306
306
  if (!isEffectiveAlignerX) {
307
307
  css.marginLeft = "";
@@ -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 item of splitViewNode.children.items()) {
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 });
@@ -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.instance.element;
134
- if (isSplitViewPartition(child.instance.driver) && partEl !== undefined) {
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.instance, sizePx });
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.instance.driver))
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 (((_a = last === null || last === void 0 ? void 0 : last.instance) === null || _a === void 0 ? void 0 : _a.driver) === childDriver)
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
  }
@@ -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().instance;
254
+ host = node.children.firstItem;
257
255
  else
258
256
  host = node;
259
257
  return host;
@@ -36,8 +36,8 @@ export class Dimension {
36
36
  return Dimension.gLineSizePx;
37
37
  }
38
38
  }
39
- Dimension.gFontSizePx = new ReactiveTreeVariable();
40
- Dimension.gLineSizePx = new ReactiveTreeVariable();
39
+ Dimension.gFontSizePx = new ReactiveTreeVariable("gFontSizePx");
40
+ Dimension.gLineSizePx = new ReactiveTreeVariable("gLineSizePx");
41
41
  export function dim(num, unit) {
42
42
  return new Dimension(num, unit);
43
43
  }
@@ -1,4 +1,4 @@
1
- import { ReactiveTreeNode, ReconciliationList } from "reactronic";
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: ReconciliationList<ReactiveTreeNode>, indexes: Array<number>): {
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: ReconciliationList<ReactiveTreeNode>): {
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, _g;
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 item of splitViewNode.children.items()) {
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 = item;
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 item of splitViewNode.children.items(current)) {
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 = (_g = (_f = splitViewNode.children.firstItem()) === null || _f === void 0 ? void 0 : _f.instance.children.firstItem()) === null || _g === void 0 ? void 0 : _g.instance;
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.instance.driver));
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].instance.element;
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].instance.element;
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.instance.driver)) {
223
- const el = child.instance.element;
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;
@@ -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.isStrict;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verstak",
3
- "version": "0.96.26004",
3
+ "version": "0.96.26010",
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.26004"
45
+ "reactronic": "^0.96.26010"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/markdown-it": "14.1.2",