@mintplayer/web-components 2.13.0 → 2.14.0
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/chunks/{mp-splitter-LszuRDbR.mjs → mp-splitter-Ckn1kN4v.mjs} +33 -19
- package/dock/index.mjs +841 -830
- package/dock/src/components/mint-dock-manager.element.d.ts +6 -34
- package/dock/src/core/geometry.d.ts +36 -0
- package/dock/src/core/index.d.ts +5 -0
- package/dock/src/core/layout-tree.d.ts +84 -0
- package/dock/src/core/resize.d.ts +83 -0
- package/dock/src/core/sizes.d.ts +31 -0
- package/dock/src/core/types.d.ts +44 -0
- package/file-manager/index.mjs +1 -1
- package/navbar/index.mjs +71 -44
- package/navbar/src/components/mp-navbar.d.ts +17 -1
- package/package.json +1 -1
- package/ribbon/index.mjs +7 -3
- package/ribbon/src/mp-quick-access-toolbar.element.d.ts +11 -0
- package/splitter/index.mjs +1 -1
- package/splitter/src/state/splitter-state.d.ts +9 -0
|
@@ -12,8 +12,22 @@ class R {
|
|
|
12
12
|
...e
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* A snapshot no caller can write back through.
|
|
17
|
+
*
|
|
18
|
+
* The arrays are copied, not just the envelope: every setter here already
|
|
19
|
+
* copies on the way IN, and a shallow spread on the way out quietly undid
|
|
20
|
+
* that — a subscriber holding `panelSizes` was holding the store's own array,
|
|
21
|
+
* so sorting or splicing it reordered the panels with no notification to
|
|
22
|
+
* anyone. The asymmetry is the bug; this is the other half of it.
|
|
23
|
+
*/
|
|
15
24
|
getState() {
|
|
16
|
-
return {
|
|
25
|
+
return {
|
|
26
|
+
...this.state,
|
|
27
|
+
panelSizes: [...this.state.panelSizes],
|
|
28
|
+
previewSizes: this.state.previewSizes ? [...this.state.previewSizes] : null,
|
|
29
|
+
resizeOperation: this.state.resizeOperation ? { ...this.state.resizeOperation, sizes: [...this.state.resizeOperation.sizes] } : null
|
|
30
|
+
};
|
|
17
31
|
}
|
|
18
32
|
subscribe(e) {
|
|
19
33
|
return this.listeners.add(e), () => {
|
|
@@ -153,8 +167,8 @@ class P {
|
|
|
153
167
|
};
|
|
154
168
|
}
|
|
155
169
|
calculatePreviewSizes(e, i, t) {
|
|
156
|
-
const { startPosition: s, sizes: n, indexBefore: a, indexAfter: o } = e, d = t === "horizontal" ? i.x - s.x : i.y - s.y, h = [...n], r = n[a],
|
|
157
|
-
let p = r + d, l =
|
|
170
|
+
const { startPosition: s, sizes: n, indexBefore: a, indexAfter: o } = e, d = t === "horizontal" ? i.x - s.x : i.y - s.y, h = [...n], r = n[a], m = n[o];
|
|
171
|
+
let p = r + d, l = m - d;
|
|
158
172
|
if (p < this.options.minPanelSize) {
|
|
159
173
|
const c = this.options.minPanelSize - p;
|
|
160
174
|
p = this.options.minPanelSize, l -= c;
|
|
@@ -172,7 +186,7 @@ class P {
|
|
|
172
186
|
return this.options.minPanelSize;
|
|
173
187
|
}
|
|
174
188
|
}
|
|
175
|
-
const
|
|
189
|
+
const O = S(`:host {
|
|
176
190
|
display: block;
|
|
177
191
|
width: 100%;
|
|
178
192
|
height: 100%;
|
|
@@ -314,10 +328,10 @@ const L = S(`:host {
|
|
|
314
328
|
transition: none !important;
|
|
315
329
|
}
|
|
316
330
|
}`);
|
|
317
|
-
let
|
|
331
|
+
let L = 0;
|
|
318
332
|
class C extends A {
|
|
319
333
|
constructor() {
|
|
320
|
-
super(), this.container = null, this.panelWrappers = [], this.dividers = [], this.slotElement = null, this.mutationObserver = null, this.containerResizeObserver = null, this.unsubscribeState = null, this.instanceId = `mp-splitter-${++
|
|
334
|
+
super(), this.container = null, this.panelWrappers = [], this.dividers = [], this.slotElement = null, this.mutationObserver = null, this.containerResizeObserver = null, this.unsubscribeState = null, this.instanceId = `mp-splitter-${++L}`, this.dividerFocusRestore = new w(() => this.shadowRoot, {
|
|
321
335
|
selector: ".divider",
|
|
322
336
|
keyOf: (e) => e.dataset.key ?? null
|
|
323
337
|
}), this.stateManager = new R(), this.resizeManager = new P(), this.inputHandler = new y({
|
|
@@ -328,7 +342,7 @@ class C extends A {
|
|
|
328
342
|
});
|
|
329
343
|
}
|
|
330
344
|
static {
|
|
331
|
-
this.styles = [
|
|
345
|
+
this.styles = [O];
|
|
332
346
|
}
|
|
333
347
|
static get observedAttributes() {
|
|
334
348
|
return [
|
|
@@ -441,8 +455,8 @@ class C extends A {
|
|
|
441
455
|
this.dividers.forEach((a, o) => {
|
|
442
456
|
const d = i[o], h = i[o + 1];
|
|
443
457
|
if (d === void 0 || h === void 0) return;
|
|
444
|
-
const r = Math.round(d / s * 100),
|
|
445
|
-
a.setAttribute("aria-valuenow", String(r)), a.setAttribute("aria-valuemin", String(
|
|
458
|
+
const r = Math.round(d / s * 100), m = Math.round(n / s * 100), p = d + h, l = Math.round((p - n) / s * 100);
|
|
459
|
+
a.setAttribute("aria-valuenow", String(r)), a.setAttribute("aria-valuemin", String(m)), a.setAttribute("aria-valuemax", String(l));
|
|
446
460
|
const c = Math.round(h / s * 100);
|
|
447
461
|
a.setAttribute("aria-valuetext", r + "% / " + c + "%");
|
|
448
462
|
});
|
|
@@ -520,11 +534,11 @@ class C extends A {
|
|
|
520
534
|
(l, c) => l + c.getBoundingClientRect()[s],
|
|
521
535
|
0
|
|
522
536
|
), a = this.orientation === "horizontal" ? "marginLeft" : "marginTop", o = this.orientation === "horizontal" ? "marginRight" : "marginBottom", d = this.panelWrappers.reduce((l, c) => {
|
|
523
|
-
const
|
|
524
|
-
return l + parseFloat(
|
|
537
|
+
const z = getComputedStyle(c);
|
|
538
|
+
return l + parseFloat(z[a]) + parseFloat(z[o]);
|
|
525
539
|
}, 0), h = Math.max(0, t - n - d), r = e.reduce((l, c) => l + c, 0);
|
|
526
540
|
if (r <= 0 || Math.abs(h - r) < 1) return;
|
|
527
|
-
const
|
|
541
|
+
const m = h / r, p = e.map((l) => l * m);
|
|
528
542
|
this.applyPanelSizes(p), this.stateManager.setPanelSizes(p), this.updateDividerAriaValues();
|
|
529
543
|
}
|
|
530
544
|
updateContainerOrientation() {
|
|
@@ -601,20 +615,20 @@ class C extends A {
|
|
|
601
615
|
if (a === void 0 || o === void 0) return;
|
|
602
616
|
const d = this.container.getBoundingClientRect(), h = this.orientation === "horizontal" ? d.width : d.height;
|
|
603
617
|
if (h <= 0) return;
|
|
604
|
-
const r = this.resizeManager.getMinPanelSize(),
|
|
618
|
+
const r = this.resizeManager.getMinPanelSize(), m = this.orientation === "horizontal", p = m ? "ArrowRight" : "ArrowDown", l = m ? "ArrowLeft" : "ArrowUp";
|
|
605
619
|
let c = 0;
|
|
606
620
|
e === p ? c = 1 : e === l && (c = -1);
|
|
607
|
-
let
|
|
621
|
+
let z, v;
|
|
608
622
|
if (e === "Home")
|
|
609
|
-
|
|
623
|
+
z = r, v = a + o - r;
|
|
610
624
|
else if (e === "End")
|
|
611
|
-
|
|
625
|
+
z = a + o - r, v = r;
|
|
612
626
|
else if (c !== 0) {
|
|
613
627
|
const f = (i ? 1 : 10) / 100 * h * c;
|
|
614
|
-
|
|
628
|
+
z = a + f, v = o - f, z < r ? (z = r, v = a + o - r) : v < r && (v = r, z = a + o - r);
|
|
615
629
|
} else
|
|
616
630
|
return;
|
|
617
|
-
|
|
631
|
+
z === a && v === o || (n[t] = z, n[t + 1] = v, this.applyPanelSizes(n), this.stateManager.setPanelSizes(n), this.updateDividerAriaValues(), s.classList.add("active"), queueMicrotask(() => s.classList.remove("active")), this.dispatchEvent(
|
|
618
632
|
new CustomEvent("resize-end", {
|
|
619
633
|
bubbles: !0,
|
|
620
634
|
detail: { sizes: n, orientation: this.orientation }
|
|
@@ -636,5 +650,5 @@ export {
|
|
|
636
650
|
R as S,
|
|
637
651
|
b as a,
|
|
638
652
|
g as n,
|
|
639
|
-
|
|
653
|
+
O as s
|
|
640
654
|
};
|