verstak 0.24.269 → 0.24.271

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.
@@ -1,10 +1,14 @@
1
- import { RxNode, BaseDriver } from "reactronic";
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { RxNode, BaseDriver, Transaction, obs, ObservableObject } from "reactronic";
2
11
  import { equalElCoords, parseElCoords } from "./ElUtils.js";
3
- export class ElDriver extends BaseDriver {
4
- allocate(node) {
5
- return new ElImpl(node);
6
- }
7
- }
8
12
  export var ElKind;
9
13
  (function (ElKind) {
10
14
  ElKind[ElKind["section"] = 0] = "section";
@@ -12,23 +16,43 @@ export var ElKind;
12
16
  ElKind[ElKind["note"] = 2] = "note";
13
17
  ElKind[ElKind["group"] = 3] = "group";
14
18
  ElKind[ElKind["part"] = 4] = "part";
15
- ElKind[ElKind["cursor"] = 5] = "cursor";
16
- ElKind[ElKind["native"] = 6] = "native";
19
+ ElKind[ElKind["splitter"] = 5] = "splitter";
20
+ ElKind[ElKind["cursor"] = 6] = "cursor";
21
+ ElKind[ElKind["native"] = 7] = "native";
17
22
  })(ElKind || (ElKind = {}));
18
- export var Align;
19
- (function (Align) {
20
- Align[Align["default"] = 0] = "default";
21
- Align[Align["left"] = 4] = "left";
22
- Align[Align["centerX"] = 5] = "centerX";
23
- Align[Align["right"] = 6] = "right";
24
- Align[Align["stretchX"] = 7] = "stretchX";
25
- Align[Align["top"] = 32] = "top";
26
- Align[Align["centerY"] = 40] = "centerY";
27
- Align[Align["bottom"] = 48] = "bottom";
28
- Align[Align["stretchY"] = 56] = "stretchY";
29
- Align[Align["centerXY"] = 45] = "centerXY";
30
- Align[Align["stretchXY"] = 63] = "stretchXY";
31
- })(Align || (Align = {}));
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 = {}));
37
+ export var SplitView;
38
+ (function (SplitView) {
39
+ SplitView[SplitView["horizontal"] = 0] = "horizontal";
40
+ SplitView[SplitView["vertical"] = 1] = "vertical";
41
+ })(SplitView || (SplitView = {}));
42
+ class Size extends ObservableObject {
43
+ constructor() {
44
+ super();
45
+ this.raw = { min: "", max: "" };
46
+ this.minPx = 0;
47
+ this.maxPx = Number.POSITIVE_INFINITY;
48
+ this.preferredUsed = false;
49
+ }
50
+ }
51
+ export class ElDriver extends BaseDriver {
52
+ allocate(node) {
53
+ return new ElImpl(node);
54
+ }
55
+ }
32
56
  export class ElImpl {
33
57
  constructor(node) {
34
58
  this.node = node;
@@ -40,14 +64,17 @@ export class ElImpl {
40
64
  this._kind = ElKind.part;
41
65
  this._area = undefined;
42
66
  this._coords = UndefinedElCoords;
43
- this._width = { min: "", max: "" };
44
- this._height = { min: "", max: "" };
45
- this._alignment = Align.default;
46
- this._extraAlignment = Align.default;
67
+ this._width = Transaction.separate(() => new Size());
68
+ this._height = Transaction.separate(() => new Size());
69
+ this._alignment = undefined;
70
+ this._verticalAlignment = undefined;
71
+ this._alignmentInside = undefined;
72
+ this._verticalAlignmentInside = undefined;
47
73
  this._stretchingStrengthX = undefined;
48
74
  this._stretchingStrengthY = undefined;
49
75
  this._contentWrapping = true;
50
76
  this._overlayVisible = undefined;
77
+ this._splitView = undefined;
51
78
  this._hasStylingPresets = false;
52
79
  }
53
80
  prepareForUpdate() {
@@ -89,59 +116,89 @@ export class ElImpl {
89
116
  else
90
117
  this.rowBreak();
91
118
  }
92
- get width() { return this._width; }
119
+ get width() { return this._width.raw; }
93
120
  set width(value) {
94
- var _a, _b;
95
- const w = this._width;
96
- let updated = false;
97
- if (value.min !== w.min) {
98
- ElImpl.applyMinWidth(this, (_a = value.min) !== null && _a !== void 0 ? _a : "");
99
- updated = true;
100
- }
101
- if (value.max !== w.max) {
102
- ElImpl.applyMaxWidth(this, (_b = value.max) !== null && _b !== void 0 ? _b : "");
103
- updated = true;
121
+ const w = this._width.raw;
122
+ if (value.min !== w.min || value.max !== w.max) {
123
+ ElImpl.applyWidth(this, value);
124
+ this._width.raw = value;
125
+ this._width.preferredUsed = false;
104
126
  }
105
- if (updated)
106
- this._width = value;
107
127
  }
108
- get height() { return this._height; }
128
+ get widthPx() { return this._width; }
129
+ set widthPx(value) {
130
+ const w = this._width;
131
+ if (value.minPx !== w.minPx)
132
+ this._width.minPx = value.minPx;
133
+ if (value.maxPx !== w.maxPx)
134
+ this._width.maxPx = value.maxPx;
135
+ }
136
+ get preferredWidthUsed() {
137
+ return this._width.preferredUsed;
138
+ }
139
+ set preferredWidthUsed(value) {
140
+ this._width.preferredUsed = value;
141
+ }
142
+ get height() { return this._height.raw; }
109
143
  set height(value) {
110
- var _a, _b;
111
- const w = this._height;
112
- let updated = false;
113
- if (value.min !== w.min) {
114
- ElImpl.applyMinHeight(this, (_a = value.min) !== null && _a !== void 0 ? _a : "");
115
- updated = true;
116
- }
117
- if (value.max !== w.max) {
118
- ElImpl.applyMaxHeight(this, (_b = value.max) !== null && _b !== void 0 ? _b : "");
119
- updated = true;
144
+ const h = this._height.raw;
145
+ if (value.min !== h.min || value.max !== h.max) {
146
+ ElImpl.applyHeight(this, value);
147
+ this._height.raw = value;
148
+ this._height.preferredUsed = false;
120
149
  }
121
- if (updated)
122
- this._height = value;
150
+ }
151
+ get heightPx() { return this._height; }
152
+ set heightPx(value) {
153
+ const w = this._height;
154
+ if (value.minPx !== w.minPx)
155
+ this._height.minPx = value.minPx;
156
+ if (value.maxPx !== w.maxPx)
157
+ this._height.maxPx = value.maxPx;
158
+ }
159
+ get preferredHeightUsed() {
160
+ return this._height.preferredUsed;
161
+ }
162
+ set preferredHeightUsed(value) {
163
+ this._height.preferredUsed = value;
123
164
  }
124
165
  get alignment() { return this._alignment; }
125
166
  set alignment(value) {
126
167
  const existing = this._alignment;
127
168
  if (value !== existing) {
128
- ElImpl.applyAlignment(this, existing, value, this._extraAlignment, this._extraAlignment, this._stretchingStrengthX, this._stretchingStrengthY);
169
+ ElImpl.applyAlignment(this, existing, value, this._alignmentInside, this._alignmentInside, this._stretchingStrengthX);
129
170
  this._alignment = value;
130
171
  }
131
172
  }
132
- get extraAlignment() { return this._extraAlignment; }
133
- set extraAlignment(value) {
134
- const existing = this._extraAlignment;
173
+ get verticalAlignment() { return this._verticalAlignment; }
174
+ set verticalAlignment(value) {
175
+ const existing = this._verticalAlignment;
176
+ if (value !== existing) {
177
+ ElImpl.applyVerticalAlignment(this, existing, value, this._verticalAlignmentInside, this._verticalAlignmentInside, this._stretchingStrengthY);
178
+ this._verticalAlignment = value;
179
+ }
180
+ }
181
+ get alignmentInside() { return this._alignmentInside; }
182
+ set alignmentInside(value) {
183
+ const existing = this._alignmentInside;
184
+ if (value !== existing) {
185
+ ElImpl.applyAlignment(this, this._alignment, this._alignment, existing, value, this._stretchingStrengthX);
186
+ this._alignmentInside = value;
187
+ }
188
+ }
189
+ get verticalAlignmentInside() { return this._verticalAlignmentInside; }
190
+ set verticalAlignmentInside(value) {
191
+ const existing = this._verticalAlignmentInside;
135
192
  if (value !== existing) {
136
- ElImpl.applyAlignment(this, this._alignment, this._alignment, existing, value, this._stretchingStrengthX, this._stretchingStrengthY);
137
- this._extraAlignment = value;
193
+ ElImpl.applyVerticalAlignment(this, this._verticalAlignment, this._verticalAlignment, existing, value, this._stretchingStrengthY);
194
+ this._verticalAlignmentInside = value;
138
195
  }
139
196
  }
140
197
  get stretchingStrengthX() { return this._stretchingStrengthX; }
141
198
  set stretchingStrengthX(value) {
142
199
  const existing = this._stretchingStrengthX;
143
200
  if (value !== existing) {
144
- ElImpl.applyStretchingStrengthX(this, existing !== null && existing !== void 0 ? existing : 0, value !== null && value !== void 0 ? value : 0);
201
+ ElImpl.applyStretchingStrengthX(this, existing, value);
145
202
  this._stretchingStrengthX = value;
146
203
  }
147
204
  }
@@ -149,7 +206,7 @@ export class ElImpl {
149
206
  set stretchingStrengthY(value) {
150
207
  const existing = this._stretchingStrengthY;
151
208
  if (value !== existing) {
152
- ElImpl.applyStretchingStrengthY(this, existing !== null && existing !== void 0 ? existing : 0, value !== null && value !== void 0 ? value : 0);
209
+ ElImpl.applyStretchingStrengthY(this, existing, value);
153
210
  this._stretchingStrengthY = value;
154
211
  }
155
212
  }
@@ -167,6 +224,19 @@ export class ElImpl {
167
224
  this._overlayVisible = value;
168
225
  }
169
226
  }
227
+ get splitView() { return this._splitView; }
228
+ set splitView(value) {
229
+ if (value !== this._splitView) {
230
+ ElImpl.applySplitView(this, value);
231
+ this._splitView = value;
232
+ }
233
+ }
234
+ get partitionSizeInSplitViewPx() {
235
+ var _a;
236
+ if (this.layoutInfo === undefined)
237
+ this.layoutInfo = new ElLayoutInfo(InitialElLayoutInfo);
238
+ return (_a = this.layoutInfo.effectiveSizePx) !== null && _a !== void 0 ? _a : 0;
239
+ }
170
240
  get style() { return this.native.style; }
171
241
  useStylingPreset(stylingPresetName, enabled) {
172
242
  ElImpl.applyStylingPreset(this, this._hasStylingPresets, stylingPresetName, enabled);
@@ -177,6 +247,9 @@ export class ElImpl {
177
247
  for (const child of this.node.children.items(after))
178
248
  yield child.instance.element;
179
249
  }
250
+ static *childrenOf(node, onlyAfter) {
251
+ return node.element.children(onlyAfter);
252
+ }
180
253
  rowBreak() {
181
254
  var _a, _b;
182
255
  const node = this.node;
@@ -203,36 +276,50 @@ export class ElImpl {
203
276
  else
204
277
  s.gridArea = "";
205
278
  }
206
- static applyMinWidth(element, value) {
207
- element.style.minWidth = `${value}`;
208
- }
209
- static applyMaxWidth(element, value) {
210
- element.style.maxWidth = `${value}`;
211
- }
212
- static applyMinHeight(element, value) {
213
- element.style.minHeight = `${value}`;
279
+ static applyWidth(element, value) {
280
+ var _a, _b;
281
+ const s = element.style;
282
+ const node = element.node;
283
+ const owner = node.owner;
284
+ const ownerEl = owner.element;
285
+ if (ownerEl.splitView === SplitView.horizontal) {
286
+ }
287
+ else {
288
+ s.minWidth = (_a = value.min) !== null && _a !== void 0 ? _a : "";
289
+ s.maxWidth = (_b = value.max) !== null && _b !== void 0 ? _b : "";
290
+ }
214
291
  }
215
- static applyMaxHeight(element, value) {
216
- element.style.maxHeight = `${value}`;
292
+ static applyHeight(element, value) {
293
+ var _a, _b;
294
+ const s = element.style;
295
+ const node = element.node;
296
+ const owner = node.owner;
297
+ const ownerEl = owner.element;
298
+ if (ownerEl.splitView === SplitView.vertical) {
299
+ }
300
+ else {
301
+ s.minHeight = (_a = value.min) !== null && _a !== void 0 ? _a : "";
302
+ s.maxHeight = (_b = value.max) !== null && _b !== void 0 ? _b : "";
303
+ }
217
304
  }
218
- static applyAlignment(element, oldPrimary, newPrimary, oldExtra, newExtra, strengthX, strengthY) {
305
+ static applyAlignment(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
219
306
  var _a;
307
+ oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = Alignment.left);
308
+ newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = Alignment.left);
309
+ oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
310
+ newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
220
311
  const css = element.style;
221
312
  let hostLayout = undefined;
222
- let hostCss = undefined;
223
313
  if (element.node.host.driver.isPartition) {
224
314
  const hostEl = element.node.host.element;
225
- hostCss = hostEl.style;
226
315
  hostLayout = hostEl.layoutInfo;
227
316
  if (hostLayout === undefined)
228
317
  hostLayout = hostEl.layoutInfo = new ElLayoutInfo(InitialElLayoutInfo);
229
318
  }
230
- if (newExtra === Align.default)
231
- newExtra = newPrimary;
232
319
  let isEffectiveAlignerX = false;
233
320
  if (hostLayout) {
234
- const isAligner = alignIs(newPrimary, Align.centerX) ||
235
- alignIs(newPrimary, Align.right);
321
+ const isAligner = newPrimary === Alignment.center ||
322
+ newPrimary === Alignment.right;
236
323
  isEffectiveAlignerX = isAligner && (hostLayout.alignerX === undefined ||
237
324
  element.index <= hostLayout.alignerX.index);
238
325
  if (hostLayout.alignerX === element) {
@@ -250,69 +337,86 @@ export class ElImpl {
250
337
  }
251
338
  }
252
339
  }
253
- switch (newPrimary & 0b00000111) {
340
+ switch (newPrimary) {
254
341
  default:
255
- case Align.left:
342
+ case Alignment.left:
256
343
  css.justifySelf = "start";
257
- if (alignIs(oldPrimary, Align.centerX)) {
344
+ if (oldPrimary === Alignment.center) {
258
345
  css.marginLeft = "";
259
346
  css.marginRight = "";
260
347
  }
261
- else if ((oldPrimary & Align.right) === Align.right)
348
+ else if (oldPrimary === Alignment.right)
262
349
  css.marginLeft = "";
263
350
  break;
264
- case Align.centerX:
351
+ case Alignment.center:
265
352
  css.justifySelf = "center";
266
353
  if (hostLayout)
267
354
  css.marginLeft = isEffectiveAlignerX ? "auto" : "";
268
355
  css.marginRight = "auto";
269
356
  break;
270
- case Align.right:
357
+ case Alignment.right:
271
358
  css.justifySelf = "end";
272
359
  if (hostLayout)
273
360
  css.marginLeft = isEffectiveAlignerX ? "auto" : "";
274
- if (alignIs(oldPrimary, Align.centerX))
361
+ if (oldPrimary === Alignment.center)
275
362
  css.marginRight = "";
276
363
  break;
277
- case Align.stretchX:
364
+ case Alignment.stretch:
278
365
  css.justifySelf = "stretch";
279
- if (alignIs(oldPrimary, Align.centerX)) {
366
+ if (oldPrimary === Alignment.center) {
280
367
  css.marginLeft = "";
281
368
  css.marginRight = "";
282
369
  }
283
- else if (alignIs(oldPrimary, Align.right))
370
+ else if (oldPrimary === Alignment.right)
284
371
  css.marginLeft = "";
285
372
  break;
286
373
  }
287
- switch (newExtra & 0b00000111) {
374
+ switch (newInside) {
288
375
  default:
289
- case Align.left:
376
+ case Alignment.left:
290
377
  css.alignItems = "start";
291
378
  css.textAlign = "left";
292
379
  break;
293
- case Align.centerX:
380
+ case Alignment.center:
294
381
  css.alignItems = "center";
295
382
  css.textAlign = "center";
296
383
  break;
297
- case Align.right:
384
+ case Alignment.right:
298
385
  css.alignItems = "end";
299
386
  css.textAlign = "right";
300
387
  break;
301
- case Align.stretchX:
388
+ case Alignment.stretch:
302
389
  css.alignItems = "stretch";
303
390
  css.textAlign = "justify";
304
391
  break;
305
392
  }
393
+ if (newPrimary === Alignment.stretch && strength === undefined)
394
+ ElImpl.applyStretchingStrengthX(element, 0, 1);
395
+ }
396
+ static applyVerticalAlignment(element, oldPrimary, newPrimary, oldInside, newInside, strength) {
397
+ oldPrimary !== null && oldPrimary !== void 0 ? oldPrimary : (oldPrimary = VerticalAlignment.top);
398
+ newPrimary !== null && newPrimary !== void 0 ? newPrimary : (newPrimary = VerticalAlignment.top);
399
+ oldInside !== null && oldInside !== void 0 ? oldInside : (oldInside = oldPrimary);
400
+ newInside !== null && newInside !== void 0 ? newInside : (newInside = newPrimary);
401
+ const css = element.style;
402
+ let hostLayout = undefined;
403
+ let hostCss = undefined;
404
+ if (element.node.host.driver.isPartition) {
405
+ const hostEl = element.node.host.element;
406
+ hostCss = hostEl.style;
407
+ hostLayout = hostEl.layoutInfo;
408
+ if (hostLayout === undefined)
409
+ hostLayout = hostEl.layoutInfo = new ElLayoutInfo(InitialElLayoutInfo);
410
+ }
306
411
  let isEffectiveAlignerY = false;
307
412
  if (hostLayout) {
308
- const isAligner = alignIs(newPrimary, Align.centerY) ||
309
- alignIs(newPrimary, Align.bottom);
413
+ const isAligner = newPrimary === VerticalAlignment.center ||
414
+ newPrimary === VerticalAlignment.bottom;
310
415
  isEffectiveAlignerY = isAligner && (hostLayout.alignerY === undefined ||
311
- !alignIs(hostLayout.alignerY.alignment, Align.centerY));
416
+ hostLayout.alignerY.verticalAlignment !== VerticalAlignment.center);
312
417
  if (hostLayout.alignerY === element) {
313
418
  if (!isEffectiveAlignerY) {
314
419
  hostCss.marginTop = "";
315
- throw new Error("changing alignment leader is not implemented yet");
316
420
  }
317
421
  }
318
422
  else {
@@ -322,55 +426,49 @@ export class ElImpl {
322
426
  }
323
427
  }
324
428
  }
325
- switch (newPrimary & 0b00111000) {
429
+ switch (newPrimary) {
326
430
  default:
327
- case Align.top:
431
+ case VerticalAlignment.top:
328
432
  css.alignSelf = "start";
329
433
  break;
330
- case Align.centerY:
434
+ case VerticalAlignment.center:
331
435
  css.alignSelf = "center";
332
436
  break;
333
- case Align.bottom:
437
+ case VerticalAlignment.bottom:
334
438
  css.alignSelf = "end";
335
439
  break;
336
- case Align.stretchY:
440
+ case VerticalAlignment.stretch:
337
441
  css.alignSelf = "stretch";
338
442
  break;
339
443
  }
340
- switch (newExtra & 0b00111000) {
444
+ switch (newInside) {
341
445
  default:
342
- case Align.top:
446
+ case VerticalAlignment.top:
343
447
  css.justifyContent = "start";
344
448
  break;
345
- case Align.centerY:
449
+ case VerticalAlignment.center:
346
450
  css.justifyContent = "center";
347
451
  break;
348
- case Align.bottom:
452
+ case VerticalAlignment.bottom:
349
453
  css.justifyContent = "end";
350
454
  break;
351
- case Align.stretchY:
455
+ case VerticalAlignment.stretch:
352
456
  css.justifyContent = "stretch";
353
457
  break;
354
458
  }
355
- if (alignIs(newPrimary, Align.stretchX) && strengthX === undefined)
356
- ElImpl.applyStretchingStrengthX(element, 0, 1);
357
- if (alignIs(newPrimary, Align.stretchY) && strengthY === undefined)
459
+ if (newPrimary === VerticalAlignment.stretch && strength === undefined)
358
460
  ElImpl.applyStretchingStrengthY(element, 0, 1);
359
461
  }
360
462
  static applyStretchingStrengthX(element, existing, value) {
361
463
  var _a;
362
464
  const s = element.style;
363
- if (value > 0) {
364
- s.flexGrow = `${value}`;
365
- s.flexBasis = "0";
366
- }
367
- else {
368
- s.flexGrow = "";
369
- s.flexBasis = "";
370
- }
371
465
  const host = element.node.host;
372
- if (host.driver.isPartition) {
466
+ if (host.driver.isPartition && element.splitView === undefined) {
467
+ const hostEl = host.element;
468
+ hostEl._stretchingStrengthX = value;
373
469
  let delta = 0;
470
+ existing !== null && existing !== void 0 ? existing : (existing = 0);
471
+ value !== null && value !== void 0 ? value : (value = 0);
374
472
  if (existing === 0) {
375
473
  if (value !== 0)
376
474
  delta = 1;
@@ -380,7 +478,6 @@ export class ElImpl {
380
478
  delta = -1;
381
479
  }
382
480
  if (delta !== 0) {
383
- const hostEl = host.element;
384
481
  const count = (_a = hostEl._stretchingStrengthX) !== null && _a !== void 0 ? _a : 0 + delta;
385
482
  if (count === 1)
386
483
  s.alignSelf = "stretch";
@@ -388,12 +485,25 @@ export class ElImpl {
388
485
  s.alignSelf = "";
389
486
  }
390
487
  }
488
+ value !== null && value !== void 0 ? value : (value = 0);
489
+ if (value > 0) {
490
+ s.flexGrow = `${value}`;
491
+ s.flexBasis = "0";
492
+ }
493
+ else {
494
+ s.flexGrow = "";
495
+ s.flexBasis = "";
496
+ }
391
497
  }
392
498
  static applyStretchingStrengthY(element, existing, value) {
393
499
  var _a;
394
500
  const host = element.node.host;
395
- if (host.driver.isPartition) {
501
+ if (host.driver.isPartition && element.splitView === undefined) {
502
+ const hostElement = host.element;
503
+ hostElement._stretchingStrengthY = value;
396
504
  let delta = 0;
505
+ existing !== null && existing !== void 0 ? existing : (existing = 0);
506
+ value !== null && value !== void 0 ? value : (value = 0);
397
507
  if (existing === 0) {
398
508
  if (value !== 0)
399
509
  delta = 1;
@@ -403,7 +513,6 @@ export class ElImpl {
403
513
  delta = -1;
404
514
  }
405
515
  if (delta !== 0) {
406
- const hostElement = host.element;
407
516
  const count = (_a = hostElement._stretchingStrengthY) !== null && _a !== void 0 ? _a : 0 + delta;
408
517
  const s = hostElement.style;
409
518
  if (count === 1)
@@ -457,6 +566,13 @@ export class ElImpl {
457
566
  s.position = s.display = s.left = s.right = s.top = s.bottom = "";
458
567
  }
459
568
  }
569
+ static applySplitView(element, value) {
570
+ const e = element.native;
571
+ if (e instanceof HTMLElement) {
572
+ e.style.position = value !== undefined ? "relative" : "";
573
+ Transaction.separate(() => e.sensors.resize.observeResizing(element, value !== undefined));
574
+ }
575
+ }
460
576
  static applyStylingPreset(element, secondary, styleName, enabled) {
461
577
  const native = element.native;
462
578
  enabled !== null && enabled !== void 0 ? enabled : (enabled = true);
@@ -466,7 +582,7 @@ export class ElImpl {
466
582
  native.className = enabled ? styleName : "";
467
583
  }
468
584
  }
469
- class ElLayoutInfo {
585
+ export class ElLayoutInfo {
470
586
  constructor(prev) {
471
587
  this.x = prev.x;
472
588
  this.y = prev.y;
@@ -475,17 +591,58 @@ class ElLayoutInfo {
475
591
  this.alignerX = undefined;
476
592
  this.alignerY = undefined;
477
593
  this.flags = prev.flags & ~ElLayoutInfoFlags.ownCursorPosition;
594
+ this.effectiveSizePx = 0;
595
+ this.offsetXpx = 0;
596
+ this.offsetYpx = 0;
597
+ this.contentSizeXpx = 0;
598
+ this.contentSizeYpx = 0;
599
+ this.borderSizeXpx = 0;
600
+ this.borderSizeYpx = 0;
601
+ this.isConstrained = false;
478
602
  }
479
603
  }
604
+ __decorate([
605
+ obs,
606
+ __metadata("design:type", Number)
607
+ ], ElLayoutInfo.prototype, "effectiveSizePx", void 0);
608
+ __decorate([
609
+ obs,
610
+ __metadata("design:type", Number)
611
+ ], ElLayoutInfo.prototype, "offsetXpx", void 0);
612
+ __decorate([
613
+ obs,
614
+ __metadata("design:type", Number)
615
+ ], ElLayoutInfo.prototype, "offsetYpx", void 0);
616
+ __decorate([
617
+ obs,
618
+ __metadata("design:type", Number)
619
+ ], ElLayoutInfo.prototype, "contentSizeXpx", void 0);
620
+ __decorate([
621
+ obs,
622
+ __metadata("design:type", Number)
623
+ ], ElLayoutInfo.prototype, "contentSizeYpx", void 0);
624
+ __decorate([
625
+ obs,
626
+ __metadata("design:type", Number)
627
+ ], ElLayoutInfo.prototype, "borderSizeYpx", void 0);
628
+ __decorate([
629
+ obs,
630
+ __metadata("design:type", Number)
631
+ ], ElLayoutInfo.prototype, "borderSizeXpx", void 0);
632
+ __decorate([
633
+ obs,
634
+ __metadata("design:type", Boolean)
635
+ ], ElLayoutInfo.prototype, "isConstrained", void 0);
480
636
  var ElLayoutInfoFlags;
481
637
  (function (ElLayoutInfoFlags) {
482
638
  ElLayoutInfoFlags[ElLayoutInfoFlags["none"] = 0] = "none";
483
639
  ElLayoutInfoFlags[ElLayoutInfoFlags["ownCursorPosition"] = 1] = "ownCursorPosition";
484
640
  ElLayoutInfoFlags[ElLayoutInfoFlags["usesRunningColumnCount"] = 2] = "usesRunningColumnCount";
485
641
  ElLayoutInfoFlags[ElLayoutInfoFlags["usesRunningRowCount"] = 4] = "usesRunningRowCount";
642
+ ElLayoutInfoFlags[ElLayoutInfoFlags["childrenRelayoutIsNeeded"] = 8] = "childrenRelayoutIsNeeded";
486
643
  })(ElLayoutInfoFlags || (ElLayoutInfoFlags = {}));
487
644
  const UndefinedElCoords = Object.freeze({ x1: 0, y1: 0, x2: 0, y2: 0 });
488
- const InitialElLayoutInfo = Object.freeze(new ElLayoutInfo({ x: 1, y: 1, runningMaxX: 0, runningMaxY: 0, flags: ElLayoutInfoFlags.none }));
645
+ 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 }));
489
646
  function getElCoordsAndAdjustLayoutInfo(isRegularElement, area, maxX, maxY, prevElLayoutInfo, layoutInfo) {
490
647
  var _a, _b;
491
648
  let result;
@@ -597,55 +754,79 @@ export class CursorCommandDriver extends ElDriver {
597
754
  export const Constants = {
598
755
  element: "el",
599
756
  partition: "part",
757
+ splitter: "splitter",
600
758
  group: "group",
601
- layouts: ["section", "table", "note", "group", "", ""],
759
+ layouts: ["section", "table", "note", "group", "", "", ""],
602
760
  keyAttrName: "key",
603
761
  kindAttrName: "kind",
604
762
  };
605
763
  const VerstakDriversByLayout = [
606
764
  el => {
607
765
  const owner = el.node.owner.element;
608
- const s = el.native.style;
766
+ const s = el.style;
609
767
  s.display = "flex";
610
768
  s.flexDirection = "column";
611
769
  s.alignSelf = owner.isTable ? "stretch" : "center";
612
770
  s.textAlign = "initial";
613
771
  s.flexShrink = "1";
614
772
  s.minWidth = "0";
773
+ if (owner.splitView !== undefined) {
774
+ s.overflow = "hidden";
775
+ s.flexGrow = "1";
776
+ }
615
777
  },
616
778
  el => {
617
779
  const owner = el.node.owner.element;
618
- const s = el.native.style;
780
+ const s = el.style;
619
781
  s.alignSelf = owner.isTable ? "stretch" : "center";
620
782
  s.display = "grid";
621
783
  s.flexBasis = "0";
622
784
  s.gridAutoRows = "minmax(min-content, 1fr)";
623
785
  s.gridAutoColumns = "minmax(min-content, 1fr)";
624
786
  s.textAlign = "initial";
787
+ if (owner.splitView !== undefined) {
788
+ s.overflow = "hidden";
789
+ s.flexGrow = "1";
790
+ }
625
791
  },
626
792
  el => {
627
793
  const owner = el.node.owner.element;
628
- const s = el.native.style;
794
+ const s = el.style;
629
795
  s.alignSelf = owner.isTable ? "stretch" : "center";
630
796
  s.display = "inline-grid";
631
797
  s.flexShrink = "1";
632
798
  },
633
799
  el => {
634
- const s = el.native.style;
800
+ const s = el.style;
635
801
  s.display = "contents";
636
802
  },
637
803
  el => {
638
804
  const owner = el.node.owner.element;
639
- const s = el.native.style;
805
+ const s = el.style;
640
806
  s.display = owner.isTable ? "contents" : "flex";
641
807
  s.flexDirection = "row";
642
808
  s.gap = "inherit";
643
809
  },
810
+ el => {
811
+ const s = el.style;
812
+ const owner = el.node.owner.element;
813
+ s.position = "absolute";
814
+ s.zIndex = `${Number.MAX_SAFE_INTEGER}`;
815
+ if (owner.splitView === SplitView.horizontal) {
816
+ s.width = "4px";
817
+ s.marginLeft = "-2px";
818
+ s.top = s.bottom = "0";
819
+ s.cursor = "col-resize";
820
+ }
821
+ else {
822
+ s.height = "4px";
823
+ s.marginTop = "-2px";
824
+ s.left = s.right = "0";
825
+ s.cursor = "row-resize";
826
+ }
827
+ },
644
828
  el => {
645
829
  },
646
830
  el => {
647
831
  },
648
832
  ];
649
- function alignIs(align, like) {
650
- return (align & like) == like;
651
- }