@archbase/layout 3.0.0 → 3.0.2
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/dist/ArchbaseCard.d.ts +2 -0
- package/dist/ArchbaseContainer.d.ts +2 -0
- package/dist/ArchbaseGroup.d.ts +2 -0
- package/dist/ArchbaseStack.d.ts +2 -0
- package/dist/barrel-exports.d.ts +12 -0
- package/dist/containers/ArchbaseDockableContainer.d.ts +17 -0
- package/dist/containers/advancedtabs/ArchbaseAdvancedTabs.d.ts +47 -0
- package/dist/containers/advancedtabs/index.d.ts +2 -0
- package/dist/containers/form/ArchbaseForm.d.ts +5 -0
- package/dist/containers/form/index.d.ts +1 -0
- package/dist/containers/index.d.ts +7 -0
- package/dist/containers/split-pane/ArchbaseSplitPane.d.ts +124 -0
- package/dist/containers/split-pane/index.d.ts +2 -0
- package/dist/containers/window/ArchbaseFloatingWindow.d.ts +23 -0
- package/dist/containers/window/index.d.ts +2 -0
- package/dist/containers/window/setupTests.d.ts +0 -0
- package/dist/dock/ArchbaseDockLayout.d.ts +2 -0
- package/dist/dock/ArchbaseDockLayout.types.d.ts +50 -0
- package/dist/dock/ArchbaseDockLayoutPreset.d.ts +5 -0
- package/dist/dock/index.d.ts +3 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +102 -102
- package/dist/spaces/components/ArchbaseSpace.d.ts +6 -0
- package/dist/spaces/components/ArchbaseSpaceAnchored.d.ts +88 -0
- package/dist/spaces/components/ArchbaseSpaceCentered.d.ts +6 -0
- package/dist/spaces/components/ArchbaseSpaceCenteredVertically.d.ts +6 -0
- package/dist/spaces/components/ArchbaseSpaceCustom.d.ts +18 -0
- package/dist/spaces/components/ArchbaseSpaceFill.d.ts +3 -0
- package/dist/spaces/components/ArchbaseSpaceFixed.d.ts +9 -0
- package/dist/spaces/components/ArchbaseSpaceInfo.d.ts +9 -0
- package/dist/spaces/components/ArchbaseSpaceLayer.d.ts +7 -0
- package/dist/spaces/components/ArchbaseSpaceOptions.d.ts +7 -0
- package/dist/spaces/components/ArchbaseSpacePositioned.d.ts +16 -0
- package/dist/spaces/components/ArchbaseSpaceViewPort.d.ts +11 -0
- package/dist/spaces/components/index.d.ts +11 -0
- package/dist/spaces/core-dragging.d.ts +8 -0
- package/dist/spaces/core-react.d.ts +78 -0
- package/dist/spaces/core-resizing.d.ts +12 -0
- package/dist/spaces/core-types.d.ts +167 -0
- package/dist/spaces/core-utils.d.ts +12 -0
- package/dist/spaces/core.d.ts +2 -0
- package/dist/spaces/index.d.ts +5 -0
- package/package.json +12 -11
- package/dist/archbase-layout-3.0.0.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Menu as at, ActionIcon as Zt } from "@mantine/core";
|
|
|
2
2
|
import { Card as gi, Container as bi, Group as pi, Stack as zi } from "@mantine/core";
|
|
3
3
|
import { jsx as c, jsxs as G, Fragment as Nt } from "react/jsx-runtime";
|
|
4
4
|
import * as d from "prop-types";
|
|
5
|
-
import * as
|
|
5
|
+
import * as I from "react";
|
|
6
6
|
import J, { useRef as it, useState as V, useEffect as et, useMemo as kt, useCallback as Gt } from "react";
|
|
7
7
|
import { ResizeSensor as Yt } from "css-element-queries";
|
|
8
8
|
import { useWindowSize as Kt } from "usehooks-ts";
|
|
@@ -328,23 +328,23 @@ function ce(t) {
|
|
|
328
328
|
if (n.element) {
|
|
329
329
|
const e = s(o), a = n.left.adjusted.length === 0 ? 0 : n.left.adjusted[0], b = n.top.adjusted.length === 0 ? 0 : n.top.adjusted[0], r = e.x - a, g = e.y - b;
|
|
330
330
|
let u = 0, z = 0, l = !1;
|
|
331
|
-
const m = (
|
|
331
|
+
const m = (M, B) => i(n, r, g, M, B), R = re(m, 5), S = (M) => {
|
|
332
332
|
l = !0;
|
|
333
|
-
const B = s(
|
|
334
|
-
u = B.x, z = B.y,
|
|
333
|
+
const B = s(M);
|
|
334
|
+
u = B.x, z = B.y, M.preventDefault(), R(u, z);
|
|
335
335
|
}, w = () => {
|
|
336
336
|
if (l && m(u, z), window.removeEventListener(h, S), window.removeEventListener(f, w), y) {
|
|
337
|
-
const
|
|
337
|
+
const M = n.parentId && t.getSpace(n.parentId)?.element.getBoundingClientRect() || {
|
|
338
338
|
left: 0,
|
|
339
339
|
top: 0
|
|
340
|
-
}, B = (({ left:
|
|
340
|
+
}, B = (({ left: _, top: x, right: T, bottom: P, width: k, height: N }) => ({ left: _, top: x, right: T, bottom: P, width: k, height: N }))(
|
|
341
341
|
n.element.getBoundingClientRect()
|
|
342
342
|
);
|
|
343
343
|
y(
|
|
344
344
|
{
|
|
345
345
|
...B,
|
|
346
|
-
left: B.left -
|
|
347
|
-
top: B.top -
|
|
346
|
+
left: B.left - M.left,
|
|
347
|
+
top: B.top - M.top
|
|
348
348
|
},
|
|
349
349
|
l
|
|
350
350
|
);
|
|
@@ -376,7 +376,7 @@ const bt = {
|
|
|
376
376
|
function Et(t) {
|
|
377
377
|
return t === A.ViewPort ? "fixed" : t === A.Fixed ? "relative" : "absolute";
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function _t(t) {
|
|
380
380
|
return t === C.Bottom || t === C.Top ? mt.Vertical : mt.Horizontal;
|
|
381
381
|
}
|
|
382
382
|
function ue(t) {
|
|
@@ -412,9 +412,9 @@ function fe() {
|
|
|
412
412
|
return he.forEach((m) => {
|
|
413
413
|
const R = z.filter((w) => w.anchor !== void 0 && w.anchor === m);
|
|
414
414
|
R.map((w) => w.zIndex).filter(a).forEach((w) => {
|
|
415
|
-
const
|
|
416
|
-
var x = B.length > 0 ? B.map((T) => T.order).reduce((T,
|
|
417
|
-
l = [...l, ...B, ...
|
|
415
|
+
const M = R.filter((T) => T.zIndex === w), B = M.filter((T) => T.order !== void 0), _ = M.filter((T) => T.order === void 0);
|
|
416
|
+
var x = B.length > 0 ? B.map((T) => T.order).reduce((T, P) => Math.max(T, P)) : 0;
|
|
417
|
+
l = [...l, ...B, ..._.map((T, P) => ({ ...T, order: x + P + 1 }))];
|
|
418
418
|
});
|
|
419
419
|
}), [...l, ...z.filter((m) => m.anchor === void 0)];
|
|
420
420
|
})(e.children);
|
|
@@ -472,12 +472,12 @@ function fe() {
|
|
|
472
472
|
minimumSize: R,
|
|
473
473
|
maximumSize: S,
|
|
474
474
|
handleSize: w,
|
|
475
|
-
touchHandleSize:
|
|
475
|
+
touchHandleSize: M,
|
|
476
476
|
handlePlacement: B,
|
|
477
|
-
allowOverflow:
|
|
478
|
-
} = a, x = l && l.leftResizable || !1, T = l && l.rightResizable || !1,
|
|
477
|
+
allowOverflow: _
|
|
478
|
+
} = a, x = l && l.leftResizable || !1, T = l && l.rightResizable || !1, P = l && l.topResizable || !1, k = l && l.bottomResizable || !1, N = l && l.topLeftResizable || !1, q = l && l.topRightResizable || !1, D = l && l.bottomLeftResizable || !1, ot = l && l.bottomRightResizable || !1;
|
|
479
479
|
let L = !1;
|
|
480
|
-
if (e.type !== b && (e.type = b, e.position = Et(b), L = !0), e.anchor !== r && (e.anchor = r, e.orientation =
|
|
480
|
+
if (e.type !== b && (e.type = b, e.position = Et(b), L = !0), e.anchor !== r && (e.anchor = r, e.orientation = _t(r), L = !0, b === A.Anchored && (r === C.Left ? e.adjustEdge = e.adjustLeft : r === C.Top ? e.adjustEdge = e.adjustTop : r === C.Right ? e.adjustEdge = e.adjustRight : r === C.Bottom && (e.adjustEdge = e.adjustBottom))), e.left.size !== (l && l.left) && (e.left.size = l && l.left, e.left.resized = 0, e.left.adjusted = [], L = !0), e.right.size !== (l && l.right) && (e.right.size = l && l.right, e.right.resized = 0, e.right.adjusted = [], L = !0), e.top.size !== (l && l.top) && (e.top.size = l && l.top, e.top.resized = 0, e.top.adjusted = [], L = !0), e.bottom.size !== (l && l.bottom) && (e.bottom.size = l && l.bottom, e.bottom.resized = 0, e.bottom.adjusted = [], L = !0), e.width.size !== (l && l.width) && (e.width.size = l && l.width, e.width.resized = 0, e.width.adjusted = [], L = !0), e.height.size !== (l && l.height) && (e.height.size = l && l.height, e.height.resized = 0, e.height.adjusted = [], L = !0), Z(e.order, 0) !== Z(g, 0) && (e.order = Z(g, 0), L = !0), Z(e.zIndex, 0) !== Z(u, 0) && (e.zIndex = Z(u, 0), L = !0), Z(e.scrollable, !1) !== Z(z, !1) && (e.scrollable = Z(z, !1), L = !0), e.minimumSize !== R && (e.minimumSize = R, L = !0), e.maximumSize !== S && (e.maximumSize = S, L = !0), Z(e.centerContent, st.None) !== Z(m, st.None) && (e.centerContent = Z(m, st.None), L = !0), e.handleSize !== w && (e.handleSize = w || bt.handleSize, L = !0), e.touchHandleSize !== M && (e.touchHandleSize = M || bt.touchHandleSize, L = !0), e.handlePlacement !== B && (e.handlePlacement = B || bt.handlePlacement, L = !0), e.canResizeBottom !== k && (e.canResizeBottom = k, L = !0), e.canResizeTop !== P && (e.canResizeTop = P, L = !0), e.canResizeLeft !== x && (e.canResizeLeft = x, L = !0), e.canResizeRight !== T && (e.canResizeRight = T, L = !0), e.canResizeTopLeft !== N && (e.canResizeTopLeft = N, L = !0), e.canResizeTopRight !== q && (e.canResizeTopRight = q, L = !0), e.canResizeBottomLeft !== D && (e.canResizeBottomLeft = D, L = !0), e.canResizeBottomRight !== ot && (e.canResizeBottomRight = ot, L = !0), e.allowOverflow !== _ && (e.allowOverflow = _ || bt.allowOverflow, L = !0), L) {
|
|
481
481
|
if (e.parentId) {
|
|
482
482
|
const F = o(e.parentId);
|
|
483
483
|
F && f(F);
|
|
@@ -492,7 +492,7 @@ function fe() {
|
|
|
492
492
|
startTouchDrag: () => null
|
|
493
493
|
}, s = de(h), y = ce(h);
|
|
494
494
|
return h.createSpace = (e, a, b) => {
|
|
495
|
-
const { position: r, anchor: g, type: u, ...z } = a, l = r && r.rightResizable || !1, m = r && r.leftResizable || !1, R = r && r.bottomResizable || !1, S = r && r.topResizable || !1, w = r && r.topLeftResizable || !1,
|
|
495
|
+
const { position: r, anchor: g, type: u, ...z } = a, l = r && r.rightResizable || !1, m = r && r.leftResizable || !1, R = r && r.bottomResizable || !1, S = r && r.topResizable || !1, w = r && r.topLeftResizable || !1, M = r && r.topRightResizable || !1, B = r && r.bottomLeftResizable || !1, _ = r && r.bottomRightResizable || !1, x = {
|
|
496
496
|
...bt,
|
|
497
497
|
...z,
|
|
498
498
|
store: h,
|
|
@@ -507,7 +507,7 @@ function fe() {
|
|
|
507
507
|
children: [],
|
|
508
508
|
anchor: g,
|
|
509
509
|
type: u,
|
|
510
|
-
orientation:
|
|
510
|
+
orientation: _t(g),
|
|
511
511
|
position: Et(u),
|
|
512
512
|
left: ut(r && r.left),
|
|
513
513
|
right: ut(r && r.right),
|
|
@@ -520,11 +520,11 @@ function fe() {
|
|
|
520
520
|
canResizeTop: R,
|
|
521
521
|
canResizeBottom: S,
|
|
522
522
|
canResizeTopLeft: w,
|
|
523
|
-
canResizeTopRight:
|
|
523
|
+
canResizeTopRight: M,
|
|
524
524
|
canResizeBottomLeft: B,
|
|
525
|
-
canResizeBottomRight:
|
|
525
|
+
canResizeBottomRight: _
|
|
526
526
|
};
|
|
527
|
-
return x.anchoredChildren = (T,
|
|
527
|
+
return x.anchoredChildren = (T, P, k) => T.filter((N) => N.type === A.Anchored && N.anchor === P && N.zIndex === k), x.adjustLeft = (T) => Ct(x.left.adjusted, T) ? !1 : (x.left.adjusted = T, !0), x.adjustRight = (T) => Ct(x.right.adjusted, T) ? !1 : (x.right.adjusted = T, !0), x.adjustTop = (T) => Ct(x.top.adjusted, T) ? !1 : (x.top.adjusted = T, !0), x.adjustBottom = (T) => Ct(x.bottom.adjusted, T) ? !1 : (x.bottom.adjusted = T, !0), u === A.Anchored && (g === C.Left ? x.adjustEdge = x.adjustLeft : g === C.Top ? x.adjustEdge = x.adjustTop : g === C.Right ? x.adjustEdge = x.adjustRight : g === C.Bottom && (x.adjustEdge = x.adjustBottom)), x;
|
|
528
528
|
}, h.startMouseResize = (e, a, b, r) => {
|
|
529
529
|
s.startResize(
|
|
530
530
|
b,
|
|
@@ -582,7 +582,7 @@ const Ft = (t) => {
|
|
|
582
582
|
o.current && (n.current = !0), et(() => (o.current || (i.current = t(), o.current = !0), h((s) => s + 1), () => {
|
|
583
583
|
n.current && i.current && i.current();
|
|
584
584
|
}), []);
|
|
585
|
-
},
|
|
585
|
+
}, Ot = I.createContext(void 0), jt = I.createContext(void 0), At = I.createContext(void 0), Vt = I.createContext({}), qt = fe(), yt = {
|
|
586
586
|
id: d.string,
|
|
587
587
|
className: d.string,
|
|
588
588
|
style: d.oneOfType([d.object, d.array]),
|
|
@@ -604,22 +604,22 @@ const Ft = (t) => {
|
|
|
604
604
|
onTouchEnd: d.func
|
|
605
605
|
};
|
|
606
606
|
function me() {
|
|
607
|
-
const [, t] =
|
|
608
|
-
return
|
|
607
|
+
const [, t] = I.useState(0);
|
|
608
|
+
return I.useCallback(() => {
|
|
609
609
|
t((i) => i + 1);
|
|
610
610
|
}, []);
|
|
611
611
|
}
|
|
612
612
|
function Ut() {
|
|
613
613
|
if (ft) {
|
|
614
|
-
if (
|
|
615
|
-
return `s${
|
|
616
|
-
if (
|
|
617
|
-
return `s${
|
|
614
|
+
if (I.version.startsWith("18"))
|
|
615
|
+
return `s${I.useId().replace(/\:/g, "")}`;
|
|
616
|
+
if (I.unstable_useOpaqueIdentifier)
|
|
617
|
+
return `s${I.unstable_useOpaqueIdentifier().replace(/\:/g, "")}`;
|
|
618
618
|
}
|
|
619
619
|
return `s${ne()}`;
|
|
620
620
|
}
|
|
621
621
|
function ge(t) {
|
|
622
|
-
const i = qt, o = me(), n =
|
|
622
|
+
const i = qt, o = me(), n = I.useContext(Ot), f = I.useContext(At), { debug: h } = I.useContext(Vt), s = Ut(), [y] = I.useState(t.id || s), e = I.useRef(null), a = I.useRef(void 0), [b, r] = I.useState();
|
|
623
623
|
let g = i.getSpace(y);
|
|
624
624
|
h && console.table(i.getSpaces());
|
|
625
625
|
const u = {
|
|
@@ -689,13 +689,13 @@ function pe(t, i) {
|
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
691
|
function ii() {
|
|
692
|
-
const t = qt, i =
|
|
692
|
+
const t = qt, i = I.useContext(Ot), o = i ? t.getSpace(i) : void 0, n = I.useContext(jt), f = I.useContext(At), h = I.useCallback(
|
|
693
693
|
(b, r) => o ? t.startMouseDrag(o, b, r) : null,
|
|
694
694
|
[i]
|
|
695
|
-
), s =
|
|
695
|
+
), s = I.useCallback(
|
|
696
696
|
(b, r) => o ? t.startTouchDrag(o, b, r) : null,
|
|
697
697
|
[i]
|
|
698
|
-
), y =
|
|
698
|
+
), y = I.useCallback(() => o ? t.updateStyles(o) : null, [i]);
|
|
699
699
|
return {
|
|
700
700
|
size: {
|
|
701
701
|
...{ width: 0, height: 0, x: 0, y: 0 },
|
|
@@ -721,7 +721,7 @@ function Re(t, i) {
|
|
|
721
721
|
}
|
|
722
722
|
return t;
|
|
723
723
|
}
|
|
724
|
-
class K extends
|
|
724
|
+
class K extends I.Component {
|
|
725
725
|
_react_spaces_uniqueid;
|
|
726
726
|
render() {
|
|
727
727
|
return /* @__PURE__ */ c(ve, { ...this.props, wrapperInstance: this });
|
|
@@ -729,7 +729,7 @@ class K extends M.Component {
|
|
|
729
729
|
}
|
|
730
730
|
const ve = (t) => {
|
|
731
731
|
let i = t.id ?? t.wrapperInstance._react_spaces_uniqueid;
|
|
732
|
-
const [o, n] =
|
|
732
|
+
const [o, n] = I.useState(!!ft), f = Ut();
|
|
733
733
|
i || (t.wrapperInstance._react_spaces_uniqueid = f, i = t.wrapperInstance._react_spaces_uniqueid);
|
|
734
734
|
const {
|
|
735
735
|
style: h,
|
|
@@ -755,7 +755,7 @@ const ve = (t) => {
|
|
|
755
755
|
onTouchStart: u,
|
|
756
756
|
onTouchMove: z,
|
|
757
757
|
onTouchEnd: l
|
|
758
|
-
}, { space: w, domRect:
|
|
758
|
+
}, { space: w, domRect: M, elementRef: B, resizeHandles: _ } = ge({
|
|
759
759
|
...t,
|
|
760
760
|
id: i
|
|
761
761
|
});
|
|
@@ -772,7 +772,7 @@ const ve = (t) => {
|
|
|
772
772
|
w.type === A.Fixed ? "spaces-fixedsize-layout" : void 0,
|
|
773
773
|
w.type === A.ViewPort ? "spaces-fullpage-layout" : void 0,
|
|
774
774
|
...x.map((D) => `${D}-container`)
|
|
775
|
-
].filter((D) => D),
|
|
775
|
+
].filter((D) => D), P = ["spaces-space-inner", ...x];
|
|
776
776
|
let k = h;
|
|
777
777
|
w.handlePlacement === rt.Inside && (k = {
|
|
778
778
|
...h,
|
|
@@ -788,12 +788,12 @@ const ve = (t) => {
|
|
|
788
788
|
...S
|
|
789
789
|
};
|
|
790
790
|
return /* @__PURE__ */ G(Nt, { children: [
|
|
791
|
-
|
|
791
|
+
_.mouseHandles.map((D) => R?.(D) || /* @__PURE__ */ c("div", { ...D })),
|
|
792
792
|
ft && w.ssrStyle && o && /* @__PURE__ */ c("style", { id: `style_${w.id}_ssr`, children: w.ssrStyle }),
|
|
793
|
-
|
|
793
|
+
I.createElement(
|
|
794
794
|
t.as || "div",
|
|
795
795
|
q,
|
|
796
|
-
/* @__PURE__ */ c("div", { className:
|
|
796
|
+
/* @__PURE__ */ c("div", { className: P.join(" "), style: k, children: /* @__PURE__ */ c(Ot.Provider, { value: w.id, children: /* @__PURE__ */ c(At.Provider, { value: void 0, children: /* @__PURE__ */ c(jt.Provider, { value: M, children: N }) }) }) })
|
|
797
797
|
)
|
|
798
798
|
] });
|
|
799
799
|
}, St = {
|
|
@@ -918,7 +918,7 @@ const Be = oe(
|
|
|
918
918
|
resizeTypes: d.array
|
|
919
919
|
},
|
|
920
920
|
"size"
|
|
921
|
-
),
|
|
921
|
+
), Oe = ({
|
|
922
922
|
children: t,
|
|
923
923
|
type: i,
|
|
924
924
|
left: o,
|
|
@@ -956,9 +956,9 @@ const Be = oe(
|
|
|
956
956
|
right: 0
|
|
957
957
|
}, i = A.Fill), /* @__PURE__ */ c(K, { ...g, type: i, anchor: a, position: u, children: t });
|
|
958
958
|
};
|
|
959
|
-
|
|
960
|
-
const
|
|
961
|
-
|
|
959
|
+
Oe.propTypes = Be;
|
|
960
|
+
const je = (t) => /* @__PURE__ */ c(K, { ...t, type: A.Fill, position: { left: 0, top: 0, right: 0, bottom: 0 }, children: t.children });
|
|
961
|
+
je.propTypes = yt;
|
|
962
962
|
const Me = ({ width: t, height: i, children: o, ...n }) => /* @__PURE__ */ c(K, { ...n, type: A.Fixed, position: { width: t, height: i }, children: o });
|
|
963
963
|
Me.propTypes = {
|
|
964
964
|
...yt,
|
|
@@ -1007,7 +1007,7 @@ De.propTypes = {
|
|
|
1007
1007
|
resizable: d.array
|
|
1008
1008
|
};
|
|
1009
1009
|
const ni = (t) => {
|
|
1010
|
-
const i =
|
|
1010
|
+
const i = I.useContext(jt);
|
|
1011
1011
|
return i ? t.children(i) : t.children({ left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0, x: 0, y: 0, toJSON: () => "" });
|
|
1012
1012
|
}, Ee = ({ left: t, top: i, right: o, bottom: n, children: f, ...h }) => /* @__PURE__ */ c(K, { ...h, type: A.ViewPort, position: { left: t || 0, top: i || 0, right: o || 0, bottom: n || 0 }, children: f });
|
|
1013
1013
|
Ee.propTypes = {
|
|
@@ -1017,7 +1017,7 @@ Ee.propTypes = {
|
|
|
1017
1017
|
right: d.oneOfType([d.string, d.number]),
|
|
1018
1018
|
bottom: d.oneOfType([d.string, d.number])
|
|
1019
1019
|
};
|
|
1020
|
-
const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i, children: t }),
|
|
1020
|
+
const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i, children: t }), _e = (t) => {
|
|
1021
1021
|
const {
|
|
1022
1022
|
favicon: i,
|
|
1023
1023
|
title: o,
|
|
@@ -1038,23 +1038,23 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1038
1038
|
onCloseLeftTabs: R,
|
|
1039
1039
|
onCloseRightTabs: S,
|
|
1040
1040
|
onCloseOtherTabs: w,
|
|
1041
|
-
totalTabs:
|
|
1042
|
-
} = t, { t: B } = Ht(), [
|
|
1043
|
-
et(() => (document.addEventListener("mousemove",
|
|
1044
|
-
document.removeEventListener("mousemove",
|
|
1041
|
+
totalTabs: M
|
|
1042
|
+
} = t, { t: B } = Ht(), [_, x] = V(0), [T, P] = V(!1), [k, N] = V(null), [q, D] = V(null), [ot, L] = V(!1), [F, tt] = V(0), [nt, U] = V(!1), lt = it(null), $ = 9, E = 84, H = 60, W = 48;
|
|
1043
|
+
et(() => (document.addEventListener("mousemove", O), document.addEventListener("mouseup", j), () => {
|
|
1044
|
+
document.removeEventListener("mousemove", O), document.addEventListener("mouseup", j);
|
|
1045
1045
|
})), et(() => {
|
|
1046
|
-
T || setTimeout(() =>
|
|
1046
|
+
T || setTimeout(() => P(!0), 500);
|
|
1047
1047
|
}, [T]), et(() => {
|
|
1048
1048
|
x(s + 2 * $);
|
|
1049
1049
|
}, [s]);
|
|
1050
1050
|
const X = (Y) => {
|
|
1051
1051
|
Y.button === 0 && (a(!0), D(Y.pageX), L(!1), tt(h));
|
|
1052
|
-
},
|
|
1052
|
+
}, O = (Y) => {
|
|
1053
1053
|
if (q != null && g) {
|
|
1054
1054
|
let ht = F - $ + (Y.pageX - q);
|
|
1055
|
-
ht < 0 && (ht = 0), ht > b -
|
|
1055
|
+
ht < 0 && (ht = 0), ht > b - _ && (ht = b - _), N(ht), !z && r(ht);
|
|
1056
1056
|
}
|
|
1057
|
-
},
|
|
1057
|
+
}, j = (Y) => {
|
|
1058
1058
|
q != null && g && (D(null), N(null), a(!1), L(!0));
|
|
1059
1059
|
}, [dt, ct] = V(h - $);
|
|
1060
1060
|
et(() => {
|
|
@@ -1070,14 +1070,14 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1070
1070
|
m && m(), U(!1);
|
|
1071
1071
|
}, Jt = (Y) => {
|
|
1072
1072
|
Y.preventDefault(), U(!0);
|
|
1073
|
-
}, Mt = u > 0, It =
|
|
1073
|
+
}, Mt = u > 0, It = M !== void 0 && u < M - 1, Dt = (M || 0) > 1;
|
|
1074
1074
|
return /* @__PURE__ */ G(
|
|
1075
1075
|
"div",
|
|
1076
1076
|
{
|
|
1077
1077
|
className: `archbase_tab ${T ? "" : " archbase_tab-was-just-added"}${q == null && !f ? " archbase_tab-was-just-dragged" : ""}`,
|
|
1078
1078
|
style: {
|
|
1079
1079
|
transform: `translate3d(${k ?? dt}px, 0, 0)`,
|
|
1080
|
-
width: `${
|
|
1080
|
+
width: `${_}px`
|
|
1081
1081
|
},
|
|
1082
1082
|
"tab-active": f !== !1 ? "" : null,
|
|
1083
1083
|
"is-small": s < E ? "" : null,
|
|
@@ -1099,7 +1099,7 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1099
1099
|
/* @__PURE__ */ G("div", { className: "archbase_tab-content", children: [
|
|
1100
1100
|
!!i && /* @__PURE__ */ c("div", { className: "archbase_tab-favicon", style: { backgroundImage: `url(${i})` } }),
|
|
1101
1101
|
/* @__PURE__ */ c("div", { className: "archbase_tab-title", children: n ?? o }),
|
|
1102
|
-
/* @__PURE__ */ c("div", { className: "archbase_tab-drag-handle", title: n ?? o, onClick: y, onPointerDown: (Y) => y(Y), onMouseUp:
|
|
1102
|
+
/* @__PURE__ */ c("div", { className: "archbase_tab-drag-handle", title: n ?? o, onClick: y, onPointerDown: (Y) => y(Y), onMouseUp: j, onMouseMove: O, onMouseDown: X }),
|
|
1103
1103
|
(m || R || S || w) && /* @__PURE__ */ G(at, { shadow: "md", width: 200, opened: nt, onChange: U, position: "bottom-end", children: [
|
|
1104
1104
|
/* @__PURE__ */ c(at.Target, { children: /* @__PURE__ */ c("div", { className: "archbase_tab-dropdown", onClick: (Y) => {
|
|
1105
1105
|
Y.stopPropagation(), U(!nt);
|
|
@@ -1120,12 +1120,12 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1120
1120
|
}
|
|
1121
1121
|
);
|
|
1122
1122
|
}, si = (t) => {
|
|
1123
|
-
const { currentTabs: i, onTabChange: o, activeTab: n, onTabClose: f, className: h, style: s, dark: y, onClick: e, buttonCloseOnlyActiveTab: a = !1, onCloseAllTabs: b, onCloseLeftTabs: r, onCloseRightTabs: g, onCloseOtherTabs: u } = t, [z, l] = V([]), [m, R] = V([]), [S, w] = V(i || []), [
|
|
1123
|
+
const { currentTabs: i, onTabChange: o, activeTab: n, onTabClose: f, className: h, style: s, dark: y, onClick: e, buttonCloseOnlyActiveTab: a = !1, onCloseAllTabs: b, onCloseLeftTabs: r, onCloseRightTabs: g, onCloseOtherTabs: u } = t, [z, l] = V([]), [m, R] = V([]), [S, w] = V(i || []), [M, B] = V(!1), [_, x] = V(!1), T = it(null), { width: P, height: k } = Kt(), N = 9, q = 1, D = 24, ot = 240;
|
|
1124
1124
|
et(() => {
|
|
1125
1125
|
l(F()), R(tt(F()));
|
|
1126
1126
|
}, []), et(() => {
|
|
1127
1127
|
L();
|
|
1128
|
-
}, [JSON.stringify(S),
|
|
1128
|
+
}, [JSON.stringify(S), P, k]), et(() => {
|
|
1129
1129
|
i && w(i);
|
|
1130
1130
|
}, [JSON.stringify(i)]);
|
|
1131
1131
|
const L = () => {
|
|
@@ -1134,28 +1134,28 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1134
1134
|
}, F = () => {
|
|
1135
1135
|
const $ = [];
|
|
1136
1136
|
if (T.current) {
|
|
1137
|
-
const E = S.length, H = T.current.clientWidth, W = (E - 1) * q, X = (H - 2 * N + W) / E,
|
|
1137
|
+
const E = S.length, H = T.current.clientWidth, W = (E - 1) * q, X = (H - 2 * N + W) / E, O = Math.max(D, Math.min(ot, X)), j = Math.floor(O), dt = j * E + 2 * N - W;
|
|
1138
1138
|
let gt = H - dt;
|
|
1139
1139
|
for (let xt = 0; xt < E; xt += 1) {
|
|
1140
|
-
const Lt =
|
|
1141
|
-
$.push(
|
|
1140
|
+
const Lt = j < ot && gt > 0 ? 1 : 0;
|
|
1141
|
+
$.push(j + Lt), gt > 0 && (gt -= 1);
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
return $;
|
|
1145
1145
|
}, tt = ($) => {
|
|
1146
1146
|
const E = [], H = $ || z;
|
|
1147
1147
|
let W = N;
|
|
1148
|
-
return H.forEach((X,
|
|
1149
|
-
const
|
|
1150
|
-
E.push(W -
|
|
1148
|
+
return H.forEach((X, O) => {
|
|
1149
|
+
const j = O * q;
|
|
1150
|
+
E.push(W - j), W += X;
|
|
1151
1151
|
}), E;
|
|
1152
1152
|
}, nt = ($, E) => {
|
|
1153
1153
|
B(!0);
|
|
1154
1154
|
let H = 1 / 0, W = -1, X = [];
|
|
1155
|
-
m.forEach((
|
|
1156
|
-
Math.abs($ -
|
|
1157
|
-
}), W = Math.max(0, Math.min(m.length, W)), E != W && (m.forEach((
|
|
1158
|
-
|
|
1155
|
+
m.forEach((O, j) => {
|
|
1156
|
+
Math.abs($ - O) < H && (H = Math.abs($ - O), W = j);
|
|
1157
|
+
}), W = Math.max(0, Math.min(m.length, W)), E != W && (m.forEach((O, j) => {
|
|
1158
|
+
j == E ? X[j] = S[W > E ? j + 1 : j - 1] : E > j && j >= W ? X[j] = S[j + 1] : E < j && j <= W ? X[j] = S[j - 1] : X[j] = S[j];
|
|
1159
1159
|
}), U(X) && o(X)), B(!1);
|
|
1160
1160
|
}, U = ($) => new Set($).size === $.length, lt = ($) => {
|
|
1161
1161
|
f ? f($) : o(S.filter((E, H) => H != $));
|
|
@@ -1163,10 +1163,10 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1163
1163
|
return /* @__PURE__ */ c("div", { className: h, style: s, children: /* @__PURE__ */ G(
|
|
1164
1164
|
"div",
|
|
1165
1165
|
{
|
|
1166
|
-
className: `archbase_tabs${y ? " archbase_tabs-dark-theme" : ""}${
|
|
1166
|
+
className: `archbase_tabs${y ? " archbase_tabs-dark-theme" : ""}${_ ? "" : " archbase_tabs-is-sorting"}`,
|
|
1167
1167
|
children: [
|
|
1168
1168
|
/* @__PURE__ */ c("div", { className: "archbase_tabs_content", ref: T, children: !!S && S.map(($, E) => !!m[E] && /* @__PURE__ */ c(
|
|
1169
|
-
|
|
1169
|
+
_e,
|
|
1170
1170
|
{
|
|
1171
1171
|
favicon: $.favicon,
|
|
1172
1172
|
title: $.title,
|
|
@@ -1180,10 +1180,10 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1180
1180
|
showButtonClose: a ? n === $.key : !0,
|
|
1181
1181
|
tabsContentWidth: T.current && T.current.clientWidth,
|
|
1182
1182
|
animateTabMove: (H) => nt(H, E),
|
|
1183
|
-
isDragging:
|
|
1183
|
+
isDragging: _,
|
|
1184
1184
|
id: $.key,
|
|
1185
1185
|
index: E,
|
|
1186
|
-
sorting:
|
|
1186
|
+
sorting: M,
|
|
1187
1187
|
onCloseAllTabs: b,
|
|
1188
1188
|
onCloseLeftTabs: r,
|
|
1189
1189
|
onCloseRightTabs: g,
|
|
@@ -1232,31 +1232,31 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1232
1232
|
t
|
|
1233
1233
|
);
|
|
1234
1234
|
i.id || (i.id = Date.now().toString()), Object.freeze(i);
|
|
1235
|
-
const [o, n] = J.useState(i.height), [f, h] = J.useState(i.width), [s, y] = J.useState(i.top || 0), [e, a] = J.useState(i.left || 0), [b, r] = J.useState(0), [g, u] = J.useState(0), [z, l] = J.useState(!1), [m, R] = J.useState(!1), [S, w] = J.useState("▁"), [
|
|
1236
|
-
u(
|
|
1237
|
-
}, E = (
|
|
1238
|
-
a((
|
|
1239
|
-
}, H = (
|
|
1240
|
-
a((
|
|
1235
|
+
const [o, n] = J.useState(i.height), [f, h] = J.useState(i.width), [s, y] = J.useState(i.top || 0), [e, a] = J.useState(i.left || 0), [b, r] = J.useState(0), [g, u] = J.useState(0), [z, l] = J.useState(!1), [m, R] = J.useState(!1), [S, w] = J.useState("▁"), [M, B] = J.useState("□"), [_, x] = J.useState(""), [T, P] = J.useState(pt()), [k, N] = J.useState(1), { ref: q, width: D, height: ot } = Qt(), L = J.useRef(null), F = it(o), tt = it(f), nt = it(s), U = it(e), lt = 500, $ = (O) => {
|
|
1236
|
+
u(O.clientY - s), r(O.clientX - e), P(pt()), N(0.5);
|
|
1237
|
+
}, E = (O) => {
|
|
1238
|
+
a((O.clientX || O.screenX || e + b) - b), y((O.clientY || O.screenY || s + g) - g);
|
|
1239
|
+
}, H = (O) => {
|
|
1240
|
+
a((O.clientX || O.screenX) - b), y((O.clientY || O.screenY) - g), N(1);
|
|
1241
1241
|
}, W = () => {
|
|
1242
1242
|
if (x(`${lt}ms ease-in-out`), z)
|
|
1243
1243
|
F.current = o, y(nt.current || 0), a(U.current || 0), l(!1), w("▁"), R(!1);
|
|
1244
1244
|
else {
|
|
1245
1245
|
F.current = 32, m || (U.current = e, nt.current = s);
|
|
1246
|
-
const
|
|
1246
|
+
const O = document.getElementById(i.id)?.parentElement;
|
|
1247
1247
|
tt.current = f;
|
|
1248
|
-
let
|
|
1249
|
-
const dt = (
|
|
1248
|
+
let j = (O?.clientHeight || window.innerHeight) - F.current - 4;
|
|
1249
|
+
const dt = (O?.clientWidth || window.innerWidth) - tt.current - 4, ct = document.elementFromPoint(
|
|
1250
1250
|
dt + tt.current / 2,
|
|
1251
|
-
|
|
1251
|
+
j + F.current / 2
|
|
1252
1252
|
);
|
|
1253
|
-
ct && ["archbase-window-container", "windowTitle"].includes(ct?.className || "") && (
|
|
1253
|
+
ct && ["archbase-window-container", "windowTitle"].includes(ct?.className || "") && (j -= ct?.clientHeight + 4), y(j), a(dt), l(!0), w("◰"), R(!1);
|
|
1254
1254
|
}
|
|
1255
|
-
|
|
1255
|
+
P(pt()), setTimeout(x, lt + 1, "");
|
|
1256
1256
|
}, X = () => {
|
|
1257
1257
|
x(`${lt}ms ease-in-out`);
|
|
1258
|
-
const
|
|
1259
|
-
m ? (F.current = o, tt.current = f, y(nt.current || 0), a(U.current || 0), R(!1), B("□"), l(!1), w("▁")) : (F.current =
|
|
1258
|
+
const O = document.getElementById(i.id)?.parentElement;
|
|
1259
|
+
m ? (F.current = o, tt.current = f, y(nt.current || 0), a(U.current || 0), R(!1), B("□"), l(!1), w("▁")) : (F.current = O?.clientHeight || window.innerHeight, tt.current = O?.clientWidth || window.innerWidth, z || (U.current = e, nt.current = s), y(O?.offsetTop || 0), a(O?.offsetLeft || 0), R(!0), B("❐"), l(!1), w("▁")), P(pt()), setTimeout(x, lt + 1, "");
|
|
1260
1260
|
};
|
|
1261
1261
|
return et(() => {
|
|
1262
1262
|
!m && !z && (h(D), n(ot));
|
|
@@ -1271,13 +1271,13 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1271
1271
|
top: s,
|
|
1272
1272
|
left: e,
|
|
1273
1273
|
resize: i.resizable ? "both" : "none",
|
|
1274
|
-
transition:
|
|
1274
|
+
transition: _,
|
|
1275
1275
|
zIndex: T,
|
|
1276
1276
|
opacity: k
|
|
1277
1277
|
},
|
|
1278
1278
|
ref: q,
|
|
1279
1279
|
onClick: () => {
|
|
1280
|
-
|
|
1280
|
+
P(pt());
|
|
1281
1281
|
},
|
|
1282
1282
|
children: [
|
|
1283
1283
|
i.titleBar && /* @__PURE__ */ G(
|
|
@@ -1305,7 +1305,7 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1305
1305
|
),
|
|
1306
1306
|
i.titleBar.buttons && /* @__PURE__ */ G("span", { className: "buttonContainer", children: [
|
|
1307
1307
|
i.titleBar.buttons.minimize && /* @__PURE__ */ c("span", { className: "windowButton", onClick: W, children: S }),
|
|
1308
|
-
i.titleBar.buttons.maximize && /* @__PURE__ */ c("span", { className: "windowButton", onClick: X, children:
|
|
1308
|
+
i.titleBar.buttons.maximize && /* @__PURE__ */ c("span", { className: "windowButton", onClick: X, children: M }),
|
|
1309
1309
|
!!i.titleBar.buttons.close && /* @__PURE__ */ c("span", { className: "windowButton", onClick: i.titleBar.buttons.close, children: "⨯" })
|
|
1310
1310
|
] })
|
|
1311
1311
|
]
|
|
@@ -1399,7 +1399,7 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1399
1399
|
et(() => {
|
|
1400
1400
|
g ? S() : w();
|
|
1401
1401
|
}, [g]);
|
|
1402
|
-
const
|
|
1402
|
+
const M = {
|
|
1403
1403
|
writingMode: "vertical-rl",
|
|
1404
1404
|
transform: "rotate(360deg)",
|
|
1405
1405
|
margin: "10px 0",
|
|
@@ -1411,7 +1411,7 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1411
1411
|
margin: "10px 0",
|
|
1412
1412
|
alignSelf: "flex-center",
|
|
1413
1413
|
cursor: "pointer"
|
|
1414
|
-
},
|
|
1414
|
+
}, _ = s ? "1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4))" : "none";
|
|
1415
1415
|
return /* @__PURE__ */ G(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
@@ -1433,14 +1433,14 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1433
1433
|
height: "100%",
|
|
1434
1434
|
backgroundColor: h,
|
|
1435
1435
|
cursor: "pointer",
|
|
1436
|
-
border:
|
|
1436
|
+
border: _,
|
|
1437
1437
|
display: "flex",
|
|
1438
1438
|
flexDirection: "column",
|
|
1439
1439
|
justifyContent: "flex-start",
|
|
1440
1440
|
alignItems: "center"
|
|
1441
1441
|
},
|
|
1442
1442
|
children: !l && !u && // @ts-ignore
|
|
1443
|
-
/* @__PURE__ */ c("span", { style: e === "right" ?
|
|
1443
|
+
/* @__PURE__ */ c("span", { style: e === "right" ? M : B, children: o })
|
|
1444
1444
|
}
|
|
1445
1445
|
),
|
|
1446
1446
|
/* @__PURE__ */ c(
|
|
@@ -1454,7 +1454,7 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1454
1454
|
transition: "width 0.3s ease-in-out",
|
|
1455
1455
|
backgroundColor: f,
|
|
1456
1456
|
padding: l || u ? "10px" : "0px",
|
|
1457
|
-
border: l || u ?
|
|
1457
|
+
border: l || u ? _ : 0
|
|
1458
1458
|
},
|
|
1459
1459
|
children: l || u ? /* @__PURE__ */ G(Nt, { children: [
|
|
1460
1460
|
/* @__PURE__ */ G(
|
|
@@ -1480,7 +1480,7 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1480
1480
|
}
|
|
1481
1481
|
);
|
|
1482
1482
|
};
|
|
1483
|
-
function
|
|
1483
|
+
function Pe({
|
|
1484
1484
|
components: t,
|
|
1485
1485
|
defaultLayout: i,
|
|
1486
1486
|
watermark: o,
|
|
@@ -1596,7 +1596,7 @@ function ui({
|
|
|
1596
1596
|
}) {
|
|
1597
1597
|
const { layout: y, components: e } = kt(() => ke(t, i), [t, i]);
|
|
1598
1598
|
return /* @__PURE__ */ c(
|
|
1599
|
-
|
|
1599
|
+
Pe,
|
|
1600
1600
|
{
|
|
1601
1601
|
components: e,
|
|
1602
1602
|
defaultLayout: y,
|
|
@@ -1616,7 +1616,7 @@ function ke(t, i) {
|
|
|
1616
1616
|
let n;
|
|
1617
1617
|
switch (t) {
|
|
1618
1618
|
case "dashboard":
|
|
1619
|
-
n =
|
|
1619
|
+
n = Pt(o);
|
|
1620
1620
|
break;
|
|
1621
1621
|
case "ide":
|
|
1622
1622
|
n = We(o);
|
|
@@ -1628,7 +1628,7 @@ function ke(t, i) {
|
|
|
1628
1628
|
n = Ve(o);
|
|
1629
1629
|
break;
|
|
1630
1630
|
default:
|
|
1631
|
-
n =
|
|
1631
|
+
n = Pt(o);
|
|
1632
1632
|
}
|
|
1633
1633
|
return { layout: n, components: o };
|
|
1634
1634
|
}
|
|
@@ -1709,7 +1709,7 @@ function He() {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
};
|
|
1711
1711
|
}
|
|
1712
|
-
function
|
|
1712
|
+
function Pt(t) {
|
|
1713
1713
|
return {
|
|
1714
1714
|
root: {
|
|
1715
1715
|
type: "branch",
|
|
@@ -1938,7 +1938,7 @@ export {
|
|
|
1938
1938
|
si as ArchbaseAdvancedTabs,
|
|
1939
1939
|
gi as ArchbaseCard,
|
|
1940
1940
|
bi as ArchbaseContainer,
|
|
1941
|
-
|
|
1941
|
+
Pe as ArchbaseDockLayout,
|
|
1942
1942
|
ui as ArchbaseDockLayoutPreset,
|
|
1943
1943
|
hi as ArchbaseDockableContainer,
|
|
1944
1944
|
li as ArchbaseFloatingWindow,
|
|
@@ -1948,8 +1948,8 @@ export {
|
|
|
1948
1948
|
Le as ArchbaseSpaceBottomResizable,
|
|
1949
1949
|
ze as ArchbaseSpaceCentered,
|
|
1950
1950
|
we as ArchbaseSpaceCenteredVertically,
|
|
1951
|
-
|
|
1952
|
-
|
|
1951
|
+
Oe as ArchbaseSpaceCustom,
|
|
1952
|
+
je as ArchbaseSpaceFill,
|
|
1953
1953
|
Me as ArchbaseSpaceFixed,
|
|
1954
1954
|
ni as ArchbaseSpaceInfo,
|
|
1955
1955
|
Ie as ArchbaseSpaceLayer,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IArchbaseSpaceInnerProps } from '../core-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare class ArchbaseSpace extends React.Component<IArchbaseSpaceInnerProps> {
|
|
4
|
+
_react_spaces_uniqueid?: string;
|
|
5
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
}
|