@archbase/layout 4.0.44 → 4.0.46
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/archbase-layout-4.0.46.tgz +0 -0
- package/dist/containers/advancedtabs/ArchbaseAdvancedTabs.d.ts +28 -0
- package/dist/containers/advancedtabs/index.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +656 -646
- package/package.json +3 -3
- package/dist/archbase-layout-4.0.44.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Menu as
|
|
2
|
-
import { Card as Mi, Container as
|
|
1
|
+
import { Menu as at, Loader as te, useMantineTheme as ee, useComputedColorScheme as ie, Box as oe, ActionIcon as ne, useMantineColorScheme as re } from "@mantine/core";
|
|
2
|
+
import { Card as Mi, Container as Ii, Group as Oi, Stack as Di } from "@mantine/core";
|
|
3
3
|
import { jsx as a, jsxs as F, Fragment as Et } from "react/jsx-runtime";
|
|
4
4
|
import * as h from "prop-types";
|
|
5
5
|
import * as O from "react";
|
|
6
|
-
import W, { useRef as ot, useState as
|
|
6
|
+
import W, { useRef as ot, useState as q, useEffect as et, useCallback as Ht, useMemo as Wt } from "react";
|
|
7
7
|
import { ResizeSensor as se } from "css-element-queries";
|
|
8
8
|
import { useWindowSize as le } from "usehooks-ts";
|
|
9
|
-
import { useArchbaseTranslation as
|
|
9
|
+
import { useArchbaseTranslation as Ft } from "@archbase/core";
|
|
10
10
|
import { useElementSize as ae } from "@mantine/hooks";
|
|
11
|
-
import { PanelGroup as
|
|
11
|
+
import { PanelGroup as Vt, Panel as $t, PanelResizeHandle as qt } from "react-resizable-panels";
|
|
12
12
|
import { IconPinnedOff as de, IconPinned as ce } from "@tabler/icons-react";
|
|
13
13
|
import { MosaicWindow as he, Mosaic as ue } from "react-mosaic-component";
|
|
14
14
|
import "react-mosaic-component/react-mosaic-component.css";
|
|
15
15
|
import { DockviewReact as fe } from "dockview-react";
|
|
16
|
-
function
|
|
16
|
+
function wi({ children: t }) {
|
|
17
17
|
return /* @__PURE__ */ a("form", { children: t });
|
|
18
18
|
}
|
|
19
|
-
var
|
|
19
|
+
var L = /* @__PURE__ */ ((t) => (t.ViewPort = "viewport", t.Fixed = "fixed", t.Fill = "fill", t.Positioned = "positioned", t.Anchored = "anchored", t.Custom = "custom", t))(L || {}), x = /* @__PURE__ */ ((t) => (t.Left = "anchor-left", t.Right = "anchor-right", t.Top = "anchor-top", t.Bottom = "anchor-bottom", t))(x || {}), ft = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(ft || {}), v = /* @__PURE__ */ ((t) => (t.All = "resize-all", t.Left = "resize-left", t.Right = "resize-right", t.Top = "resize-top", t.Bottom = "resize-bottom", t.TopLeft = "resize-topleft", t.TopRight = "resize-topright", t.BottomLeft = "resize-bottomleft", t.BottomRight = "resize-bottomright", t))(v || {}), st = /* @__PURE__ */ ((t) => (t.OverlayInside = "overlay-inside", t.Inside = "inside", t.OverlayBoundary = "overlay-boundary", t))(st || {}), lt = /* @__PURE__ */ ((t) => (t.None = "none", t.Vertical = "vertical", t.HorizontalVertical = "horizontalVertical", t))(lt || {}), zt = /* @__PURE__ */ ((t) => (t.Mouse = "mousemove", t.Touch = "touchmove", t))(zt || {}), wt = /* @__PURE__ */ ((t) => (t.Mouse = "mouseup", t.Touch = "touchend", t))(wt || {});
|
|
20
20
|
function me(t, ...i) {
|
|
21
21
|
const o = /* @__PURE__ */ Object.create(null);
|
|
22
22
|
i.forEach((u) => {
|
|
@@ -31,20 +31,20 @@ function ge() {
|
|
|
31
31
|
let t = Math.random() * 46656 | 0, i = Math.random() * 46656 | 0;
|
|
32
32
|
return ("000" + t.toString(36)).slice(-3) + ("000" + i.toString(36)).slice(-3);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Bt(t) {
|
|
35
35
|
return typeof t == "string" ? t : `${t}px`;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function R(t, i) {
|
|
38
38
|
if (t.size === 0 && t.adjusted.length === 0 && t.resized === 0)
|
|
39
39
|
return "0px";
|
|
40
40
|
const o = [];
|
|
41
|
-
if (t.size !== void 0 && o.push(
|
|
41
|
+
if (t.size !== void 0 && o.push(Bt(t.size)), t.adjusted.forEach((n) => o.push(Bt(n))), t.resized !== 0 && o.push(Bt(t.resized)), o.length !== 0)
|
|
42
42
|
return o.length === 1 ? o[0] : i ? o.join(" + ") : `calc(${o.join(" + ")})`;
|
|
43
43
|
}
|
|
44
44
|
function J(...t) {
|
|
45
45
|
return t.find((i) => i != null);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function xt(t, i) {
|
|
48
48
|
if (t.length !== i.length)
|
|
49
49
|
return !1;
|
|
50
50
|
for (var o = 0, n = t.length; o < n; o++)
|
|
@@ -63,41 +63,41 @@ function be(t, i) {
|
|
|
63
63
|
function pe(t) {
|
|
64
64
|
const i = [], o = {
|
|
65
65
|
position: t.position,
|
|
66
|
-
left:
|
|
67
|
-
top:
|
|
68
|
-
right:
|
|
69
|
-
bottom:
|
|
70
|
-
width:
|
|
71
|
-
height:
|
|
66
|
+
left: R(t.left),
|
|
67
|
+
top: R(t.top),
|
|
68
|
+
right: R(t.right),
|
|
69
|
+
bottom: R(t.bottom),
|
|
70
|
+
width: R(t.width),
|
|
71
|
+
height: R(t.height),
|
|
72
72
|
zIndex: t.zIndex
|
|
73
73
|
}, n = [];
|
|
74
74
|
o.position && n.push(`position: ${o.position};`), o.left && n.push(`left: ${o.left};`), o.top && n.push(`top: ${o.top};`), o.right && n.push(`right: ${o.right};`), o.bottom && n.push(`bottom: ${o.bottom};`), o.width && n.push(`width: ${o.width};`), o.height && n.push(`height: ${o.height};`), o.zIndex && n.push(`z-index: ${o.zIndex};`), t.allowOverflow && n.push("overflow: visible;"), n.length > 0 && i.push(`#${t.id} { ${n.join(" ")} }`), t.scrollable && i.push(`#${t.id} > .spaces-space-inner { overflow: auto; touch-action: auto; }`);
|
|
75
75
|
let u = 0;
|
|
76
|
-
const d = `${t.handleSize}px`, r = `-${t.touchHandleSize / 2 - t.handleSize / 2}px`,
|
|
76
|
+
const d = `${t.handleSize}px`, r = `-${t.touchHandleSize / 2 - t.handleSize / 2}px`, p = `${t.touchHandleSize / 2 - t.handleSize / 2}px`;
|
|
77
77
|
switch (t.handlePlacement) {
|
|
78
|
-
case
|
|
79
|
-
case
|
|
80
|
-
u = t.handleSize, t.type ===
|
|
78
|
+
case st.Inside:
|
|
79
|
+
case st.OverlayInside:
|
|
80
|
+
u = t.handleSize, t.type === L.Positioned && (u = 0);
|
|
81
81
|
break;
|
|
82
|
-
case
|
|
82
|
+
case st.OverlayBoundary:
|
|
83
83
|
u = t.handleSize / 2;
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
const e = `${u}px`, l = (s, f) => {
|
|
87
87
|
const m = [];
|
|
88
88
|
f.left && m.push(`left: ${f.left}`), f.top && m.push(`top: ${f.top}`), f.right && m.push(`right: ${f.right}`), f.bottom && m.push(`bottom: ${f.bottom}`), f.width && m.push(`width: ${f.width}`), f.height && m.push(`height: ${f.height}`), i.push(`#${t.id}-${s} { ${m.join("; ")}}`);
|
|
89
|
-
},
|
|
89
|
+
}, z = () => t.type === L.Positioned ? t.width.size && t.height.size : t.orientation == ft.Horizontal ? t.width.size : t.height.size;
|
|
90
90
|
return t.canResizeLeft && (t.anchor ? l("ml", {
|
|
91
|
-
right: `calc(${
|
|
91
|
+
right: `calc(${R(t.right, !0)} + ${R(t.width)} - ${e})`,
|
|
92
92
|
top: "0",
|
|
93
93
|
bottom: "0",
|
|
94
94
|
width: d
|
|
95
95
|
}) : l("ml", {
|
|
96
|
-
left: `calc(${
|
|
97
|
-
top:
|
|
98
|
-
bottom:
|
|
96
|
+
left: `calc(${R(t.left, !0)} - ${e})`,
|
|
97
|
+
top: R(t.top),
|
|
98
|
+
bottom: R(t.bottom),
|
|
99
99
|
width: d,
|
|
100
|
-
height:
|
|
100
|
+
height: R(t.height)
|
|
101
101
|
}), l("ml:after", {
|
|
102
102
|
left: r,
|
|
103
103
|
right: r,
|
|
@@ -106,60 +106,60 @@ function pe(t) {
|
|
|
106
106
|
})), t.canResizeTop && (t.anchor ? (l("mt", {
|
|
107
107
|
left: "0",
|
|
108
108
|
right: "0",
|
|
109
|
-
bottom: `calc(${
|
|
109
|
+
bottom: `calc(${R(t.bottom)} + ${R(t.height)} - ${e})`,
|
|
110
110
|
height: d
|
|
111
111
|
}), l("mt:after", {
|
|
112
112
|
top: r,
|
|
113
113
|
bottom: r,
|
|
114
114
|
left: r,
|
|
115
|
-
width:
|
|
115
|
+
width: R(t.width),
|
|
116
116
|
right: r
|
|
117
117
|
})) : (l("mt", {
|
|
118
|
-
top: `calc(${
|
|
119
|
-
left:
|
|
120
|
-
right:
|
|
121
|
-
width:
|
|
118
|
+
top: `calc(${R(t.top, !0)} - ${e})`,
|
|
119
|
+
left: R(t.left),
|
|
120
|
+
right: R(t.right),
|
|
121
|
+
width: R(t.width),
|
|
122
122
|
height: d
|
|
123
|
-
}),
|
|
123
|
+
}), z() ? l("mt:after", {
|
|
124
124
|
top: r,
|
|
125
125
|
bottom: r,
|
|
126
126
|
left: r,
|
|
127
|
-
width: `calc(${
|
|
127
|
+
width: `calc(${R(t.width, !0)} - ${e}) + ${p}`,
|
|
128
128
|
right: r
|
|
129
129
|
}) : l("mt:after", {
|
|
130
130
|
top: r,
|
|
131
131
|
bottom: r,
|
|
132
132
|
left: r,
|
|
133
|
-
width:
|
|
133
|
+
width: R(t.width),
|
|
134
134
|
right: r
|
|
135
|
-
}))), t.canResizeRight && (
|
|
136
|
-
left: `calc(${
|
|
137
|
-
top:
|
|
138
|
-
bottom:
|
|
135
|
+
}))), t.canResizeRight && (z() ? l("mr", {
|
|
136
|
+
left: `calc(${R(t.left, !0)} + ${R(t.width, !0)} - ${d} + ${e})`,
|
|
137
|
+
top: R(t.top),
|
|
138
|
+
bottom: R(t.bottom),
|
|
139
139
|
width: d,
|
|
140
|
-
height:
|
|
140
|
+
height: R(t.height)
|
|
141
141
|
}) : l("mr", {
|
|
142
|
-
right: `calc(${
|
|
143
|
-
top:
|
|
144
|
-
bottom:
|
|
142
|
+
right: `calc(${R(t.right, !0)} - ${e})`,
|
|
143
|
+
top: R(t.top),
|
|
144
|
+
bottom: R(t.bottom),
|
|
145
145
|
width: d,
|
|
146
|
-
height:
|
|
146
|
+
height: R(t.height)
|
|
147
147
|
}), l("mr:after", {
|
|
148
148
|
left: r,
|
|
149
149
|
right: r,
|
|
150
150
|
top: r,
|
|
151
151
|
bottom: r
|
|
152
|
-
})), t.canResizeBottom && (
|
|
153
|
-
top: `calc(${
|
|
154
|
-
left:
|
|
155
|
-
right:
|
|
156
|
-
width:
|
|
152
|
+
})), t.canResizeBottom && (z() ? l("mb", {
|
|
153
|
+
top: `calc(${R(t.top, !0)} + ${R(t.height, !0)} - ${d} + ${e})`,
|
|
154
|
+
left: R(t.left),
|
|
155
|
+
right: R(t.right),
|
|
156
|
+
width: R(t.width),
|
|
157
157
|
height: d
|
|
158
158
|
}) : l("mb", {
|
|
159
|
-
bottom: `calc(${
|
|
160
|
-
left:
|
|
161
|
-
right:
|
|
162
|
-
width:
|
|
159
|
+
bottom: `calc(${R(t.bottom, !0)} - ${e})`,
|
|
160
|
+
left: R(t.left),
|
|
161
|
+
right: R(t.right),
|
|
162
|
+
width: R(t.width),
|
|
163
163
|
height: d
|
|
164
164
|
}), l("mb:after", {
|
|
165
165
|
top: r,
|
|
@@ -167,8 +167,8 @@ function pe(t) {
|
|
|
167
167
|
left: r,
|
|
168
168
|
right: r
|
|
169
169
|
})), t.canResizeTopLeft && (l("mtl", {
|
|
170
|
-
left: `calc(${
|
|
171
|
-
top:
|
|
170
|
+
left: `calc(${R(t.left, !0)} - ${e})`,
|
|
171
|
+
top: R(t.top),
|
|
172
172
|
width: d,
|
|
173
173
|
height: d
|
|
174
174
|
}), l("mtl:after", {
|
|
@@ -176,14 +176,14 @@ function pe(t) {
|
|
|
176
176
|
bottom: r,
|
|
177
177
|
left: r,
|
|
178
178
|
right: r
|
|
179
|
-
})), t.canResizeTopRight && (
|
|
180
|
-
left: `calc(${
|
|
181
|
-
top:
|
|
179
|
+
})), t.canResizeTopRight && (z() ? l("mtr", {
|
|
180
|
+
left: `calc(${R(t.left, !0)} + ${R(t.width, !0)} - ${d} + ${e})`,
|
|
181
|
+
top: R(t.top),
|
|
182
182
|
width: d,
|
|
183
183
|
height: d
|
|
184
184
|
}) : l("mtr", {
|
|
185
|
-
right: `calc(${
|
|
186
|
-
top:
|
|
185
|
+
right: `calc(${R(t.right, !0)} - ${e})`,
|
|
186
|
+
top: R(t.top),
|
|
187
187
|
width: d,
|
|
188
188
|
height: d
|
|
189
189
|
}), l("mtr:after", {
|
|
@@ -191,14 +191,14 @@ function pe(t) {
|
|
|
191
191
|
bottom: r,
|
|
192
192
|
left: r,
|
|
193
193
|
right: r
|
|
194
|
-
})), t.canResizeBottomLeft && (
|
|
195
|
-
top: `calc(${
|
|
196
|
-
left:
|
|
194
|
+
})), t.canResizeBottomLeft && (z() ? l("mbl", {
|
|
195
|
+
top: `calc(${R(t.top, !0)} + ${R(t.height, !0)} - ${d} + ${e})`,
|
|
196
|
+
left: R(t.left),
|
|
197
197
|
width: d,
|
|
198
198
|
height: d
|
|
199
199
|
}) : l("mbl", {
|
|
200
|
-
bottom: `calc(${
|
|
201
|
-
left:
|
|
200
|
+
bottom: `calc(${R(t.bottom, !0)} - ${e})`,
|
|
201
|
+
left: R(t.left),
|
|
202
202
|
width: d,
|
|
203
203
|
height: d
|
|
204
204
|
}), l("mbl:after", {
|
|
@@ -206,14 +206,14 @@ function pe(t) {
|
|
|
206
206
|
bottom: r,
|
|
207
207
|
left: r,
|
|
208
208
|
right: r
|
|
209
|
-
})), t.canResizeBottomRight && (
|
|
210
|
-
left: `calc(${
|
|
211
|
-
top: `calc(${
|
|
209
|
+
})), t.canResizeBottomRight && (z() ? l("mbr", {
|
|
210
|
+
left: `calc(${R(t.left, !0)} + ${R(t.width, !0)} - ${d} + ${e})`,
|
|
211
|
+
top: `calc(${R(t.top, !0)} + ${R(t.height, !0)} - ${d} + ${e})`,
|
|
212
212
|
width: d,
|
|
213
213
|
height: d
|
|
214
214
|
}) : l("mbr", {
|
|
215
|
-
right: `calc(${
|
|
216
|
-
bottom: `calc(${
|
|
215
|
+
right: `calc(${R(t.right, !0)} - ${e})`,
|
|
216
|
+
bottom: `calc(${R(t.bottom, !0)} - ${e})`,
|
|
217
217
|
width: d,
|
|
218
218
|
height: d
|
|
219
219
|
}), l("mbr:after", {
|
|
@@ -225,7 +225,7 @@ function pe(t) {
|
|
|
225
225
|
}
|
|
226
226
|
function yt(t) {
|
|
227
227
|
const i = pe(t);
|
|
228
|
-
if (
|
|
228
|
+
if (Ut())
|
|
229
229
|
t.ssrStyle = i;
|
|
230
230
|
else {
|
|
231
231
|
const o = document.getElementById(`style_${t.id}`);
|
|
@@ -241,49 +241,49 @@ function ze(t) {
|
|
|
241
241
|
const i = document.getElementById(`style_${t.id}`);
|
|
242
242
|
i && document.head.removeChild(i);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Ut() {
|
|
245
245
|
return !(typeof document < "u" && document);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return t ===
|
|
247
|
+
function vt(t) {
|
|
248
|
+
return t === v.Left || t === v.Right;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
const r = i ===
|
|
252
|
-
return (m,
|
|
253
|
-
let c = (
|
|
254
|
-
n.type !==
|
|
250
|
+
function tt(t, i, o, n, u, d) {
|
|
251
|
+
const r = i === v.Right || i === v.Bottom ? (m) => -m : (m) => m, p = vt(i) ? n.width : n.height, e = o.resized, l = p.resized, z = vt(i) ? t.width : t.height, s = J(n.minimumSize, 20) - z + 0, f = n.maximumSize ? n.maximumSize - z + 0 : void 0;
|
|
252
|
+
return (m, w) => {
|
|
253
|
+
let c = (vt(i) ? u : d) - (vt(i) ? m : w), g = r(c);
|
|
254
|
+
n.type !== L.Positioned && (g = Math.max(r(c), s), g < s && (g = s), typeof f == "number" && g > f && (g = f)), o.size !== void 0 ? (o.resized = r(-c) + e, p.size && (p.resized = r(c) + l)) : p.resized = g + l;
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
257
|
function we(t, i, o, n) {
|
|
258
258
|
const u = i.element.getBoundingClientRect();
|
|
259
259
|
switch (t) {
|
|
260
|
-
case
|
|
261
|
-
return
|
|
262
|
-
case
|
|
263
|
-
return
|
|
264
|
-
case
|
|
265
|
-
return
|
|
266
|
-
case
|
|
267
|
-
return
|
|
268
|
-
case
|
|
269
|
-
const d =
|
|
270
|
-
return (m,
|
|
271
|
-
d(m,
|
|
260
|
+
case v.Left:
|
|
261
|
+
return tt(u, t, i.left, i, o, n);
|
|
262
|
+
case v.Right:
|
|
263
|
+
return tt(u, t, i.right, i, o, n);
|
|
264
|
+
case v.Bottom:
|
|
265
|
+
return tt(u, t, i.bottom, i, o, n);
|
|
266
|
+
case v.Top:
|
|
267
|
+
return tt(u, t, i.top, i, o, n);
|
|
268
|
+
case v.TopLeft:
|
|
269
|
+
const d = tt(u, v.Top, i.top, i, o, n), r = tt(u, v.Left, i.left, i, o, n);
|
|
270
|
+
return (m, w) => {
|
|
271
|
+
d(m, w), r(m, w);
|
|
272
272
|
};
|
|
273
|
-
case
|
|
274
|
-
const
|
|
275
|
-
return (m,
|
|
276
|
-
|
|
273
|
+
case v.TopRight:
|
|
274
|
+
const p = tt(u, v.Top, i.top, i, o, n), e = tt(u, v.Right, i.right, i, o, n);
|
|
275
|
+
return (m, w) => {
|
|
276
|
+
p(m, w), e(m, w);
|
|
277
277
|
};
|
|
278
|
-
case
|
|
279
|
-
const l =
|
|
280
|
-
return (m,
|
|
281
|
-
l(m,
|
|
278
|
+
case v.BottomLeft:
|
|
279
|
+
const l = tt(u, v.Bottom, i.bottom, i, o, n), z = tt(u, v.Left, i.left, i, o, n);
|
|
280
|
+
return (m, w) => {
|
|
281
|
+
l(m, w), z(m, w);
|
|
282
282
|
};
|
|
283
|
-
case
|
|
284
|
-
const s =
|
|
285
|
-
return (m,
|
|
286
|
-
s(m,
|
|
283
|
+
case v.BottomRight:
|
|
284
|
+
const s = tt(u, v.Bottom, i.bottom, i, o, n), f = tt(u, v.Right, i.right, i, o, n);
|
|
285
|
+
return (m, w) => {
|
|
286
|
+
s(m, w), f(m, w);
|
|
287
287
|
};
|
|
288
288
|
default:
|
|
289
289
|
throw `Resize type ${t} not supported`;
|
|
@@ -291,7 +291,7 @@ function we(t, i, o, n) {
|
|
|
291
291
|
}
|
|
292
292
|
function ye(t) {
|
|
293
293
|
return {
|
|
294
|
-
startResize(i, o, n, u, d, r,
|
|
294
|
+
startResize(i, o, n, u, d, r, p) {
|
|
295
295
|
if (n.onResizeStart) {
|
|
296
296
|
const g = n.onResizeStart(o);
|
|
297
297
|
if (typeof g == "boolean" && !g)
|
|
@@ -299,60 +299,60 @@ function ye(t) {
|
|
|
299
299
|
}
|
|
300
300
|
const e = r(i), l = we(o, n, e.x, e.y);
|
|
301
301
|
n.resizing = !0, n.updateParent();
|
|
302
|
-
let
|
|
303
|
-
const m = (g,
|
|
304
|
-
l(g,
|
|
305
|
-
},
|
|
302
|
+
let z = 0, s = 0, f = !1;
|
|
303
|
+
const m = (g, y) => {
|
|
304
|
+
l(g, y), t.updateStyles(n);
|
|
305
|
+
}, w = (g) => {
|
|
306
306
|
f = !0;
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
n.resizing && m(
|
|
307
|
+
const y = r(g);
|
|
308
|
+
z = y.x, s = y.y, g.preventDefault(), window.requestAnimationFrame(() => {
|
|
309
|
+
n.resizing && m(z, s);
|
|
310
310
|
});
|
|
311
311
|
}, c = () => {
|
|
312
|
-
n.resizing = !1, f && m(
|
|
313
|
-
const g =
|
|
312
|
+
n.resizing = !1, f && m(z, s), window.removeEventListener(d, w), window.removeEventListener(u, c), n.updateParent();
|
|
313
|
+
const g = p || n.onResizeEnd;
|
|
314
314
|
if (g) {
|
|
315
|
-
const
|
|
316
|
-
g(Math.floor(
|
|
315
|
+
const y = n.element.getBoundingClientRect();
|
|
316
|
+
g(Math.floor(vt(o) ? y.width : y.height), y, o);
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
window.addEventListener(d,
|
|
319
|
+
window.addEventListener(d, w), window.addEventListener(u, c);
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function ve(t) {
|
|
324
324
|
function i(o, n, u, d, r) {
|
|
325
|
-
const
|
|
326
|
-
o.left.adjusted = [
|
|
325
|
+
const p = -(n - d), e = -(u - r);
|
|
326
|
+
o.left.adjusted = [p], o.top.adjusted = [e], o.right.size && (o.right.adjusted = [-p]), o.bottom.size && (o.bottom.adjusted = [-e]), t.updateStyles(o);
|
|
327
327
|
}
|
|
328
328
|
return {
|
|
329
|
-
startDrag(o, n, u, d, r,
|
|
329
|
+
startDrag(o, n, u, d, r, p) {
|
|
330
330
|
if (n.element) {
|
|
331
|
-
const e = r(o), l = n.left.adjusted.length === 0 ? 0 : n.left.adjusted[0],
|
|
332
|
-
let m = 0,
|
|
333
|
-
const g = (
|
|
331
|
+
const e = r(o), l = n.left.adjusted.length === 0 ? 0 : n.left.adjusted[0], z = n.top.adjusted.length === 0 ? 0 : n.top.adjusted[0], s = e.x - l, f = e.y - z;
|
|
332
|
+
let m = 0, w = 0, c = !1;
|
|
333
|
+
const g = (M, j) => i(n, s, f, M, j), y = be(g, 5), S = (M) => {
|
|
334
334
|
c = !0;
|
|
335
|
-
const
|
|
336
|
-
m =
|
|
337
|
-
},
|
|
338
|
-
if (c && g(m,
|
|
339
|
-
const
|
|
335
|
+
const j = r(M);
|
|
336
|
+
m = j.x, w = j.y, M.preventDefault(), y(m, w);
|
|
337
|
+
}, b = () => {
|
|
338
|
+
if (c && g(m, w), window.removeEventListener(d, S), window.removeEventListener(u, b), p) {
|
|
339
|
+
const M = n.parentId && t.getSpace(n.parentId)?.element.getBoundingClientRect() || {
|
|
340
340
|
left: 0,
|
|
341
341
|
top: 0
|
|
342
|
-
},
|
|
342
|
+
}, j = (({ left: N, top: T, right: C, bottom: D, width: P, height: E }) => ({ left: N, top: T, right: C, bottom: D, width: P, height: E }))(
|
|
343
343
|
n.element.getBoundingClientRect()
|
|
344
344
|
);
|
|
345
|
-
|
|
345
|
+
p(
|
|
346
346
|
{
|
|
347
|
-
...
|
|
348
|
-
left:
|
|
349
|
-
top:
|
|
347
|
+
...j,
|
|
348
|
+
left: j.left - M.left,
|
|
349
|
+
top: j.top - M.top
|
|
350
350
|
},
|
|
351
351
|
c
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
window.addEventListener(d, S), window.addEventListener(u,
|
|
355
|
+
window.addEventListener(d, S), window.addEventListener(u, b);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
};
|
|
@@ -367,41 +367,41 @@ const bt = {
|
|
|
367
367
|
dimension: { left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0, x: 0, y: 0, toJSON: () => "" },
|
|
368
368
|
handleSize: 5,
|
|
369
369
|
touchHandleSize: 5,
|
|
370
|
-
handlePlacement:
|
|
370
|
+
handlePlacement: st.OverlayInside,
|
|
371
371
|
adjustLeft: () => !1,
|
|
372
372
|
adjustRight: () => !1,
|
|
373
373
|
adjustTop: () => !1,
|
|
374
374
|
adjustBottom: () => !1,
|
|
375
375
|
adjustEdge: () => !1,
|
|
376
376
|
anchoredChildren: () => []
|
|
377
|
-
},
|
|
377
|
+
}, Re = [x.Left, x.Top, x.Right, x.Bottom];
|
|
378
378
|
function _t(t) {
|
|
379
|
-
return t ===
|
|
379
|
+
return t === L.ViewPort ? "fixed" : t === L.Fixed ? "relative" : "absolute";
|
|
380
380
|
}
|
|
381
381
|
function Nt(t) {
|
|
382
|
-
return t ===
|
|
382
|
+
return t === x.Bottom || t === x.Top ? ft.Vertical : ft.Horizontal;
|
|
383
383
|
}
|
|
384
384
|
function Se(t) {
|
|
385
385
|
return [
|
|
386
386
|
{
|
|
387
|
-
anchor:
|
|
387
|
+
anchor: x.Left,
|
|
388
388
|
update: t.adjustLeft
|
|
389
389
|
},
|
|
390
390
|
{
|
|
391
|
-
anchor:
|
|
391
|
+
anchor: x.Top,
|
|
392
392
|
update: t.adjustTop
|
|
393
393
|
},
|
|
394
394
|
{
|
|
395
|
-
anchor:
|
|
395
|
+
anchor: x.Right,
|
|
396
396
|
update: t.adjustRight
|
|
397
397
|
},
|
|
398
398
|
{
|
|
399
|
-
anchor:
|
|
399
|
+
anchor: x.Bottom,
|
|
400
400
|
update: t.adjustBottom
|
|
401
401
|
}
|
|
402
402
|
];
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function ht(t) {
|
|
405
405
|
return { size: t, adjusted: [], resized: 0 };
|
|
406
406
|
}
|
|
407
407
|
function Te() {
|
|
@@ -409,34 +409,34 @@ function Te() {
|
|
|
409
409
|
const i = (e) => {
|
|
410
410
|
t = e;
|
|
411
411
|
}, o = (e) => n().find((l) => l.id === e), n = () => t, u = (e) => {
|
|
412
|
-
const l = (
|
|
412
|
+
const l = (w, c, g) => g.indexOf(w) === c, s = ((w) => {
|
|
413
413
|
let c = [];
|
|
414
|
-
return
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
const
|
|
418
|
-
var
|
|
419
|
-
c = [...c, ...
|
|
414
|
+
return Re.forEach((g) => {
|
|
415
|
+
const y = w.filter((b) => b.anchor !== void 0 && b.anchor === g);
|
|
416
|
+
y.map((b) => b.zIndex).filter(l).forEach((b) => {
|
|
417
|
+
const M = y.filter((C) => C.zIndex === b), j = M.filter((C) => C.order !== void 0), N = M.filter((C) => C.order === void 0);
|
|
418
|
+
var T = j.length > 0 ? j.map((C) => C.order).reduce((C, D) => Math.max(C, D)) : 0;
|
|
419
|
+
c = [...c, ...j, ...N.map((C, D) => ({ ...C, order: T + D + 1 }))];
|
|
420
420
|
});
|
|
421
|
-
}), [...c, ...
|
|
421
|
+
}), [...c, ...w.filter((g) => g.anchor === void 0)];
|
|
422
422
|
})(e.children);
|
|
423
423
|
for (var f = 0, m = s.length; f < m; f++) {
|
|
424
|
-
const
|
|
424
|
+
const w = s[f];
|
|
425
425
|
let c = !1;
|
|
426
|
-
if (
|
|
427
|
-
Se(
|
|
428
|
-
const
|
|
429
|
-
e.anchoredChildren(s, g.anchor,
|
|
430
|
-
|
|
431
|
-
}), g.update(
|
|
426
|
+
if (w.type === L.Fill)
|
|
427
|
+
Se(w).forEach((g) => {
|
|
428
|
+
const y = [];
|
|
429
|
+
e.anchoredChildren(s, g.anchor, w.zIndex).forEach((b) => {
|
|
430
|
+
b.orientation === ft.Vertical ? (b.height.size && y.push(b.height.size), b.height.resized && y.push(b.height.resized)) : (b.width.size && y.push(b.width.size), b.width.resized && y.push(b.width.resized));
|
|
431
|
+
}), g.update(y) && (c = !0);
|
|
432
432
|
});
|
|
433
|
-
else if (
|
|
433
|
+
else if (w.type === L.Anchored) {
|
|
434
434
|
const g = [];
|
|
435
|
-
e.anchoredChildren(s,
|
|
436
|
-
S.orientation ===
|
|
437
|
-
}),
|
|
435
|
+
e.anchoredChildren(s, w.anchor, w.zIndex).filter((S) => S.id !== w.id && S.order <= w.order).forEach((S) => {
|
|
436
|
+
S.orientation === ft.Vertical ? (S.height.size && g.push(S.height.size), S.height.resized && g.push(S.height.resized)) : (S.width.size && g.push(S.width.size), S.width.resized && g.push(S.width.resized));
|
|
437
|
+
}), w.adjustEdge(g) && (c = !0);
|
|
438
438
|
}
|
|
439
|
-
c && yt(
|
|
439
|
+
c && yt(w);
|
|
440
440
|
}
|
|
441
441
|
}, d = {
|
|
442
442
|
getSpaces: n,
|
|
@@ -451,7 +451,7 @@ function Te() {
|
|
|
451
451
|
removeSpace: (e) => {
|
|
452
452
|
if (i(n().filter((l) => l.id !== e.id)), e.parentId) {
|
|
453
453
|
const l = o(e.parentId);
|
|
454
|
-
l && (l.children = l.children.filter((
|
|
454
|
+
l && (l.children = l.children.filter((z) => z.id !== e.id), u(l));
|
|
455
455
|
}
|
|
456
456
|
ze(e);
|
|
457
457
|
},
|
|
@@ -464,25 +464,25 @@ function Te() {
|
|
|
464
464
|
},
|
|
465
465
|
updateSpace: (e, l) => {
|
|
466
466
|
const {
|
|
467
|
-
type:
|
|
467
|
+
type: z,
|
|
468
468
|
anchor: s,
|
|
469
469
|
order: f,
|
|
470
470
|
zIndex: m,
|
|
471
|
-
scrollable:
|
|
471
|
+
scrollable: w,
|
|
472
472
|
position: c,
|
|
473
473
|
centerContent: g,
|
|
474
|
-
minimumSize:
|
|
474
|
+
minimumSize: y,
|
|
475
475
|
maximumSize: S,
|
|
476
|
-
handleSize:
|
|
477
|
-
touchHandleSize:
|
|
478
|
-
handlePlacement:
|
|
476
|
+
handleSize: b,
|
|
477
|
+
touchHandleSize: M,
|
|
478
|
+
handlePlacement: j,
|
|
479
479
|
allowOverflow: N
|
|
480
|
-
} = l,
|
|
481
|
-
let
|
|
482
|
-
if (e.type !==
|
|
480
|
+
} = l, T = c && c.leftResizable || !1, C = c && c.rightResizable || !1, D = c && c.topResizable || !1, P = c && c.bottomResizable || !1, E = c && c.topLeftResizable || !1, Z = c && c.topRightResizable || !1, k = c && c.bottomLeftResizable || !1, it = c && c.bottomRightResizable || !1;
|
|
481
|
+
let B = !1;
|
|
482
|
+
if (e.type !== z && (e.type = z, e.position = _t(z), B = !0), e.anchor !== s && (e.anchor = s, e.orientation = Nt(s), B = !0, z === L.Anchored && (s === x.Left ? e.adjustEdge = e.adjustLeft : s === x.Top ? e.adjustEdge = e.adjustTop : s === x.Right ? e.adjustEdge = e.adjustRight : s === x.Bottom && (e.adjustEdge = e.adjustBottom))), e.left.size !== (c && c.left) && (e.left.size = c && c.left, e.left.resized = 0, e.left.adjusted = [], B = !0), e.right.size !== (c && c.right) && (e.right.size = c && c.right, e.right.resized = 0, e.right.adjusted = [], B = !0), e.top.size !== (c && c.top) && (e.top.size = c && c.top, e.top.resized = 0, e.top.adjusted = [], B = !0), e.bottom.size !== (c && c.bottom) && (e.bottom.size = c && c.bottom, e.bottom.resized = 0, e.bottom.adjusted = [], B = !0), e.width.size !== (c && c.width) && (e.width.size = c && c.width, e.width.resized = 0, e.width.adjusted = [], B = !0), e.height.size !== (c && c.height) && (e.height.size = c && c.height, e.height.resized = 0, e.height.adjusted = [], B = !0), J(e.order, 0) !== J(f, 0) && (e.order = J(f, 0), B = !0), J(e.zIndex, 0) !== J(m, 0) && (e.zIndex = J(m, 0), B = !0), J(e.scrollable, !1) !== J(w, !1) && (e.scrollable = J(w, !1), B = !0), e.minimumSize !== y && (e.minimumSize = y, B = !0), e.maximumSize !== S && (e.maximumSize = S, B = !0), J(e.centerContent, lt.None) !== J(g, lt.None) && (e.centerContent = J(g, lt.None), B = !0), e.handleSize !== b && (e.handleSize = b || bt.handleSize, B = !0), e.touchHandleSize !== M && (e.touchHandleSize = M || bt.touchHandleSize, B = !0), e.handlePlacement !== j && (e.handlePlacement = j || bt.handlePlacement, B = !0), e.canResizeBottom !== P && (e.canResizeBottom = P, B = !0), e.canResizeTop !== D && (e.canResizeTop = D, B = !0), e.canResizeLeft !== T && (e.canResizeLeft = T, B = !0), e.canResizeRight !== C && (e.canResizeRight = C, B = !0), e.canResizeTopLeft !== E && (e.canResizeTopLeft = E, B = !0), e.canResizeTopRight !== Z && (e.canResizeTopRight = Z, B = !0), e.canResizeBottomLeft !== k && (e.canResizeBottomLeft = k, B = !0), e.canResizeBottomRight !== it && (e.canResizeBottomRight = it, B = !0), e.allowOverflow !== N && (e.allowOverflow = N || bt.allowOverflow, B = !0), B) {
|
|
483
483
|
if (e.parentId) {
|
|
484
|
-
const
|
|
485
|
-
|
|
484
|
+
const U = o(e.parentId);
|
|
485
|
+
U && u(U);
|
|
486
486
|
}
|
|
487
487
|
yt(e);
|
|
488
488
|
}
|
|
@@ -492,17 +492,17 @@ function Te() {
|
|
|
492
492
|
startTouchResize: () => null,
|
|
493
493
|
startMouseDrag: () => null,
|
|
494
494
|
startTouchDrag: () => null
|
|
495
|
-
}, r = ye(d),
|
|
496
|
-
return d.createSpace = (e, l,
|
|
497
|
-
const { position: s, anchor: f, type: m, ...
|
|
495
|
+
}, r = ye(d), p = ve(d);
|
|
496
|
+
return d.createSpace = (e, l, z) => {
|
|
497
|
+
const { position: s, anchor: f, type: m, ...w } = l, c = s && s.rightResizable || !1, g = s && s.leftResizable || !1, y = s && s.bottomResizable || !1, S = s && s.topResizable || !1, b = s && s.topLeftResizable || !1, M = s && s.topRightResizable || !1, j = s && s.bottomLeftResizable || !1, N = s && s.bottomRightResizable || !1, T = {
|
|
498
498
|
...bt,
|
|
499
|
-
...
|
|
499
|
+
...w,
|
|
500
500
|
store: d,
|
|
501
|
-
update:
|
|
501
|
+
update: z,
|
|
502
502
|
updateParent: () => {
|
|
503
503
|
if (e) {
|
|
504
|
-
const
|
|
505
|
-
|
|
504
|
+
const C = d.getSpace(e);
|
|
505
|
+
C && C.update();
|
|
506
506
|
}
|
|
507
507
|
},
|
|
508
508
|
parentId: e,
|
|
@@ -511,25 +511,25 @@ function Te() {
|
|
|
511
511
|
type: m,
|
|
512
512
|
orientation: Nt(f),
|
|
513
513
|
position: _t(m),
|
|
514
|
-
left:
|
|
515
|
-
right:
|
|
516
|
-
top:
|
|
517
|
-
bottom:
|
|
518
|
-
width:
|
|
519
|
-
height:
|
|
514
|
+
left: ht(s && s.left),
|
|
515
|
+
right: ht(s && s.right),
|
|
516
|
+
top: ht(s && s.top),
|
|
517
|
+
bottom: ht(s && s.bottom),
|
|
518
|
+
width: ht(s && s.width),
|
|
519
|
+
height: ht(s && s.height),
|
|
520
520
|
canResizeLeft: c,
|
|
521
521
|
canResizeRight: g,
|
|
522
|
-
canResizeTop:
|
|
522
|
+
canResizeTop: y,
|
|
523
523
|
canResizeBottom: S,
|
|
524
|
-
canResizeTopLeft:
|
|
525
|
-
canResizeTopRight:
|
|
526
|
-
canResizeBottomLeft:
|
|
524
|
+
canResizeTopLeft: b,
|
|
525
|
+
canResizeTopRight: M,
|
|
526
|
+
canResizeBottomLeft: j,
|
|
527
527
|
canResizeBottomRight: N
|
|
528
528
|
};
|
|
529
|
-
return
|
|
530
|
-
}, d.startMouseResize = (e, l,
|
|
529
|
+
return T.anchoredChildren = (C, D, P) => C.filter((E) => E.type === L.Anchored && E.anchor === D && E.zIndex === P), T.adjustLeft = (C) => xt(T.left.adjusted, C) ? !1 : (T.left.adjusted = C, !0), T.adjustRight = (C) => xt(T.right.adjusted, C) ? !1 : (T.right.adjusted = C, !0), T.adjustTop = (C) => xt(T.top.adjusted, C) ? !1 : (T.top.adjusted = C, !0), T.adjustBottom = (C) => xt(T.bottom.adjusted, C) ? !1 : (T.bottom.adjusted = C, !0), m === L.Anchored && (f === x.Left ? T.adjustEdge = T.adjustLeft : f === x.Top ? T.adjustEdge = T.adjustTop : f === x.Right ? T.adjustEdge = T.adjustRight : f === x.Bottom && (T.adjustEdge = T.adjustBottom)), T;
|
|
530
|
+
}, d.startMouseResize = (e, l, z, s) => {
|
|
531
531
|
r.startResize(
|
|
532
|
-
|
|
532
|
+
z,
|
|
533
533
|
e,
|
|
534
534
|
l,
|
|
535
535
|
wt.Mouse,
|
|
@@ -540,9 +540,9 @@ function Te() {
|
|
|
540
540
|
}),
|
|
541
541
|
s
|
|
542
542
|
);
|
|
543
|
-
}, d.startTouchResize = (e, l,
|
|
543
|
+
}, d.startTouchResize = (e, l, z, s) => {
|
|
544
544
|
r.startResize(
|
|
545
|
-
|
|
545
|
+
z,
|
|
546
546
|
e,
|
|
547
547
|
l,
|
|
548
548
|
wt.Touch,
|
|
@@ -553,8 +553,8 @@ function Te() {
|
|
|
553
553
|
}),
|
|
554
554
|
s
|
|
555
555
|
);
|
|
556
|
-
}, d.startMouseDrag = (e, l,
|
|
557
|
-
|
|
556
|
+
}, d.startMouseDrag = (e, l, z) => {
|
|
557
|
+
p.startDrag(
|
|
558
558
|
l,
|
|
559
559
|
e,
|
|
560
560
|
wt.Mouse,
|
|
@@ -563,10 +563,10 @@ function Te() {
|
|
|
563
563
|
x: s.clientX,
|
|
564
564
|
y: s.clientY
|
|
565
565
|
}),
|
|
566
|
-
|
|
566
|
+
z
|
|
567
567
|
);
|
|
568
|
-
}, d.startTouchDrag = (e, l,
|
|
569
|
-
|
|
568
|
+
}, d.startTouchDrag = (e, l, z) => {
|
|
569
|
+
p.startDrag(
|
|
570
570
|
l,
|
|
571
571
|
e,
|
|
572
572
|
wt.Touch,
|
|
@@ -575,21 +575,21 @@ function Te() {
|
|
|
575
575
|
x: s.touches[0].clientX,
|
|
576
576
|
y: s.touches[0].clientY
|
|
577
577
|
}),
|
|
578
|
-
|
|
578
|
+
z
|
|
579
579
|
);
|
|
580
580
|
}, d;
|
|
581
581
|
}
|
|
582
|
-
const
|
|
583
|
-
const i = ot(void 0), o = ot(!1), n = ot(!1), [u, d] =
|
|
584
|
-
o.current && (n.current = !0),
|
|
582
|
+
const Xt = (t) => {
|
|
583
|
+
const i = ot(void 0), o = ot(!1), n = ot(!1), [u, d] = q(0);
|
|
584
|
+
o.current && (n.current = !0), et(() => (o.current || (i.current = t(), o.current = !0), d((r) => r + 1), () => {
|
|
585
585
|
n.current && i.current && i.current();
|
|
586
586
|
}), []);
|
|
587
|
-
},
|
|
587
|
+
}, jt = O.createContext(void 0), Mt = O.createContext(void 0), At = O.createContext(void 0), Gt = O.createContext({}), Jt = Te(), Rt = {
|
|
588
588
|
id: h.string,
|
|
589
589
|
className: h.string,
|
|
590
590
|
style: h.oneOfType([h.object, h.array]),
|
|
591
591
|
as: h.any,
|
|
592
|
-
centerContent: h.oneOf([
|
|
592
|
+
centerContent: h.oneOf([lt.None, lt.Vertical, lt.HorizontalVertical]),
|
|
593
593
|
zIndex: h.number,
|
|
594
594
|
scrollable: h.bool,
|
|
595
595
|
trackSize: h.bool,
|
|
@@ -605,14 +605,14 @@ const Ut = (t) => {
|
|
|
605
605
|
onTouchMove: h.func,
|
|
606
606
|
onTouchEnd: h.func
|
|
607
607
|
};
|
|
608
|
-
function
|
|
608
|
+
function Ce() {
|
|
609
609
|
const [, t] = O.useState(0);
|
|
610
610
|
return O.useCallback(() => {
|
|
611
611
|
t((i) => i + 1);
|
|
612
612
|
}, []);
|
|
613
613
|
}
|
|
614
|
-
function
|
|
615
|
-
if (
|
|
614
|
+
function Zt() {
|
|
615
|
+
if (ut) {
|
|
616
616
|
if (O.version && O.version.startsWith("18"))
|
|
617
617
|
return `s${O.useId().replace(/\:/g, "")}`;
|
|
618
618
|
if (typeof O.useId == "function")
|
|
@@ -620,18 +620,18 @@ function Jt() {
|
|
|
620
620
|
}
|
|
621
621
|
return `s${ge()}`;
|
|
622
622
|
}
|
|
623
|
-
function
|
|
624
|
-
const i =
|
|
625
|
-
let f = i.getSpace(
|
|
623
|
+
function xe(t) {
|
|
624
|
+
const i = Jt, o = Ce(), n = O.useContext(jt), u = O.useContext(At), { debug: d } = O.useContext(Gt), r = Zt(), [p] = O.useState(t.id || r), e = O.useRef(null), l = O.useRef(void 0), [z, s] = O.useState();
|
|
625
|
+
let f = i.getSpace(p);
|
|
626
626
|
d && console.table(i.getSpaces());
|
|
627
627
|
const m = {
|
|
628
628
|
...t,
|
|
629
|
-
id:
|
|
629
|
+
id: p,
|
|
630
630
|
zIndex: J(t.zIndex, u)
|
|
631
631
|
};
|
|
632
632
|
f ? i.updateSpace(f, m) : (f = i.createSpace(n, m, o), i.addSpace(f));
|
|
633
|
-
const
|
|
634
|
-
return
|
|
633
|
+
const w = Le(i, f);
|
|
634
|
+
return Xt(() => {
|
|
635
635
|
const c = e.current ? e.current.getBoundingClientRect() : new DOMRect();
|
|
636
636
|
return f.dimension = {
|
|
637
637
|
...c,
|
|
@@ -652,25 +652,25 @@ function Ce(t) {
|
|
|
652
652
|
})), () => {
|
|
653
653
|
l.current && l.current.detach(), i.removeSpace(f);
|
|
654
654
|
};
|
|
655
|
-
}), { space: f, resizeHandles:
|
|
655
|
+
}), { space: f, resizeHandles: w, domRect: z, elementRef: e };
|
|
656
656
|
}
|
|
657
657
|
const Ae = [
|
|
658
|
-
{ id: "ml", className: "resize-left", resizeType:
|
|
659
|
-
{ id: "mr", className: "resize-right", resizeType:
|
|
660
|
-
{ id: "mt", className: "resize-top", resizeType:
|
|
661
|
-
{ id: "mb", className: "resize-bottom", resizeType:
|
|
662
|
-
{ id: "mtl", className: "resize-top-left", resizeType:
|
|
663
|
-
{ id: "mtr", className: "resize-top-right", resizeType:
|
|
658
|
+
{ id: "ml", className: "resize-left", resizeType: v.Left, condition: (t) => t.canResizeLeft },
|
|
659
|
+
{ id: "mr", className: "resize-right", resizeType: v.Right, condition: (t) => t.canResizeRight },
|
|
660
|
+
{ id: "mt", className: "resize-top", resizeType: v.Top, condition: (t) => t.canResizeTop },
|
|
661
|
+
{ id: "mb", className: "resize-bottom", resizeType: v.Bottom, condition: (t) => t.canResizeBottom },
|
|
662
|
+
{ id: "mtl", className: "resize-top-left", resizeType: v.TopLeft, condition: (t) => t.canResizeTopLeft },
|
|
663
|
+
{ id: "mtr", className: "resize-top-right", resizeType: v.TopRight, condition: (t) => t.canResizeTopRight },
|
|
664
664
|
{
|
|
665
665
|
id: "mbl",
|
|
666
666
|
className: "resize-bottom-left",
|
|
667
|
-
resizeType:
|
|
667
|
+
resizeType: v.BottomLeft,
|
|
668
668
|
condition: (t) => t.canResizeBottomLeft
|
|
669
669
|
},
|
|
670
670
|
{
|
|
671
671
|
id: "mbr",
|
|
672
672
|
className: "resize-bottom-right",
|
|
673
|
-
resizeType:
|
|
673
|
+
resizeType: v.BottomRight,
|
|
674
674
|
condition: (t) => t.canResizeBottomRight
|
|
675
675
|
}
|
|
676
676
|
];
|
|
@@ -680,8 +680,8 @@ function Le(t, i) {
|
|
|
680
680
|
id: `${i.id}-${u}`,
|
|
681
681
|
key: u,
|
|
682
682
|
className: `spaces-resize-handle ${d}`,
|
|
683
|
-
onMouseDown: (
|
|
684
|
-
onTouchStart: (
|
|
683
|
+
onMouseDown: (p) => t.startMouseResize(r, i, p),
|
|
684
|
+
onTouchStart: (p) => t.startTouchResize(r, i, p)
|
|
685
685
|
});
|
|
686
686
|
};
|
|
687
687
|
return Ae.forEach((u) => {
|
|
@@ -690,14 +690,14 @@ function Le(t, i) {
|
|
|
690
690
|
mouseHandles: o
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
|
-
function
|
|
694
|
-
const t =
|
|
695
|
-
(
|
|
693
|
+
function yi() {
|
|
694
|
+
const t = Jt, i = O.useContext(jt), o = i ? t.getSpace(i) : void 0, n = O.useContext(Mt), u = O.useContext(At), d = O.useCallback(
|
|
695
|
+
(z, s) => o ? t.startMouseDrag(o, z, s) : null,
|
|
696
696
|
[i]
|
|
697
697
|
), r = O.useCallback(
|
|
698
|
-
(
|
|
698
|
+
(z, s) => o ? t.startTouchDrag(o, z, s) : null,
|
|
699
699
|
[i]
|
|
700
|
-
),
|
|
700
|
+
), p = O.useCallback(() => o ? t.updateStyles(o) : null, [i]);
|
|
701
701
|
return {
|
|
702
702
|
size: {
|
|
703
703
|
...{ width: 0, height: 0, x: 0, y: 0 },
|
|
@@ -706,108 +706,108 @@ function wi() {
|
|
|
706
706
|
layer: u || 0,
|
|
707
707
|
startMouseDrag: d,
|
|
708
708
|
startTouchDrag: r,
|
|
709
|
-
forceUpdate:
|
|
709
|
+
forceUpdate: p
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
let
|
|
713
|
-
function
|
|
714
|
-
|
|
712
|
+
let ut = !1;
|
|
713
|
+
function vi() {
|
|
714
|
+
ut = !0;
|
|
715
715
|
}
|
|
716
|
-
const
|
|
717
|
-
function
|
|
716
|
+
const Be = (t) => /* @__PURE__ */ a("div", { className: "spaces-centered", children: t.children }), $e = (t) => /* @__PURE__ */ a("div", { className: "spaces-centered-vertically", children: t.children });
|
|
717
|
+
function je(t, i) {
|
|
718
718
|
switch (i) {
|
|
719
|
-
case
|
|
720
|
-
return /* @__PURE__ */ a(je, { children: t });
|
|
721
|
-
case st.HorizontalVertical:
|
|
719
|
+
case lt.Vertical:
|
|
722
720
|
return /* @__PURE__ */ a($e, { children: t });
|
|
721
|
+
case lt.HorizontalVertical:
|
|
722
|
+
return /* @__PURE__ */ a(Be, { children: t });
|
|
723
723
|
}
|
|
724
724
|
return t;
|
|
725
725
|
}
|
|
726
|
-
class
|
|
726
|
+
class K extends O.Component {
|
|
727
727
|
_react_spaces_uniqueid;
|
|
728
728
|
render() {
|
|
729
|
-
return /* @__PURE__ */ a(
|
|
729
|
+
return /* @__PURE__ */ a(Me, { ...this.props, wrapperInstance: this });
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
|
-
const
|
|
732
|
+
const Me = (t) => {
|
|
733
733
|
let i = t.id ?? t.wrapperInstance._react_spaces_uniqueid;
|
|
734
|
-
const [o, n] = O.useState(!!
|
|
734
|
+
const [o, n] = O.useState(!!ut), u = Zt();
|
|
735
735
|
i || (t.wrapperInstance._react_spaces_uniqueid = u, i = t.wrapperInstance._react_spaces_uniqueid);
|
|
736
736
|
const {
|
|
737
737
|
style: d,
|
|
738
738
|
className: r,
|
|
739
|
-
onClick:
|
|
739
|
+
onClick: p,
|
|
740
740
|
onDoubleClick: e,
|
|
741
741
|
onMouseDown: l,
|
|
742
|
-
onMouseEnter:
|
|
742
|
+
onMouseEnter: z,
|
|
743
743
|
onMouseLeave: s,
|
|
744
744
|
onMouseMove: f,
|
|
745
745
|
onTouchStart: m,
|
|
746
|
-
onTouchMove:
|
|
746
|
+
onTouchMove: w,
|
|
747
747
|
onTouchEnd: c,
|
|
748
748
|
children: g,
|
|
749
|
-
handleRender:
|
|
749
|
+
handleRender: y
|
|
750
750
|
} = t, S = {
|
|
751
|
-
onClick:
|
|
751
|
+
onClick: p,
|
|
752
752
|
onDoubleClick: e,
|
|
753
753
|
onMouseDown: l,
|
|
754
|
-
onMouseEnter:
|
|
754
|
+
onMouseEnter: z,
|
|
755
755
|
onMouseLeave: s,
|
|
756
756
|
onMouseMove: f,
|
|
757
757
|
onTouchStart: m,
|
|
758
|
-
onTouchMove:
|
|
758
|
+
onTouchMove: w,
|
|
759
759
|
onTouchEnd: c
|
|
760
|
-
}, { space:
|
|
760
|
+
}, { space: b, domRect: M, elementRef: j, resizeHandles: N } = xe({
|
|
761
761
|
...t,
|
|
762
762
|
id: i
|
|
763
763
|
});
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
766
|
-
|
|
764
|
+
if (ut && !Ut()) {
|
|
765
|
+
const k = document.getElementById(`style_${i}_ssr`);
|
|
766
|
+
k && (b.ssrStyle = k.innerHTML), yt(b);
|
|
767
767
|
}
|
|
768
|
-
|
|
769
|
-
|
|
768
|
+
Xt(() => {
|
|
769
|
+
b.element = j.current, ut && o && n(!1);
|
|
770
770
|
});
|
|
771
|
-
const
|
|
771
|
+
const T = r ? r.split(" ").map((k) => k.trim()) : [], C = [
|
|
772
772
|
"spaces-space",
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
...
|
|
777
|
-
].filter((
|
|
778
|
-
let
|
|
779
|
-
|
|
773
|
+
b.children.find((k) => k.resizing) ? "spaces-resizing" : void 0,
|
|
774
|
+
b.type === L.Fixed ? "spaces-fixedsize-layout" : void 0,
|
|
775
|
+
b.type === L.ViewPort ? "spaces-fullpage-layout" : void 0,
|
|
776
|
+
...T.map((k) => `${k}-container`)
|
|
777
|
+
].filter((k) => k), D = ["spaces-space-inner", ...T];
|
|
778
|
+
let P = d;
|
|
779
|
+
b.handlePlacement === st.Inside && (P = {
|
|
780
780
|
...d,
|
|
781
|
-
left:
|
|
782
|
-
right:
|
|
783
|
-
top:
|
|
784
|
-
bottom:
|
|
781
|
+
left: b.anchor === x.Right ? b.handleSize : void 0,
|
|
782
|
+
right: b.anchor === x.Left ? b.handleSize : void 0,
|
|
783
|
+
top: b.anchor === x.Bottom ? b.handleSize : void 0,
|
|
784
|
+
bottom: b.anchor === x.Top ? b.handleSize : void 0
|
|
785
785
|
});
|
|
786
|
-
const E =
|
|
787
|
-
id:
|
|
788
|
-
ref:
|
|
789
|
-
className:
|
|
786
|
+
const E = je(g, t.centerContent), Z = {
|
|
787
|
+
id: b.id,
|
|
788
|
+
ref: j,
|
|
789
|
+
className: C.join(" "),
|
|
790
790
|
...S
|
|
791
791
|
};
|
|
792
792
|
return /* @__PURE__ */ F(Et, { children: [
|
|
793
|
-
N.mouseHandles.map((
|
|
794
|
-
|
|
793
|
+
N.mouseHandles.map((k) => y?.(k) || /* @__PURE__ */ a("div", { ...k })),
|
|
794
|
+
ut && b.ssrStyle && o && /* @__PURE__ */ a("style", { id: `style_${b.id}_ssr`, children: b.ssrStyle }),
|
|
795
795
|
O.createElement(
|
|
796
796
|
t.as || "div",
|
|
797
|
-
|
|
798
|
-
/* @__PURE__ */ a("div", { className:
|
|
797
|
+
Z,
|
|
798
|
+
/* @__PURE__ */ a("div", { className: D.join(" "), style: P, children: /* @__PURE__ */ a(jt.Provider, { value: b.id, children: /* @__PURE__ */ a(At.Provider, { value: void 0, children: /* @__PURE__ */ a(Mt.Provider, { value: M, children: E }) }) }) })
|
|
799
799
|
)
|
|
800
800
|
] });
|
|
801
801
|
}, St = {
|
|
802
|
-
...
|
|
802
|
+
...Rt,
|
|
803
803
|
size: h.oneOfType([h.string, h.number]).isRequired,
|
|
804
804
|
order: h.number,
|
|
805
805
|
handleSize: h.number,
|
|
806
806
|
touchHandleSize: h.number,
|
|
807
807
|
handlePlacement: h.oneOf([
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
808
|
+
st.Inside,
|
|
809
|
+
st.OverlayBoundary,
|
|
810
|
+
st.OverlayInside
|
|
811
811
|
]),
|
|
812
812
|
handleRender: h.func,
|
|
813
813
|
minimumSize: h.number,
|
|
@@ -818,98 +818,98 @@ const Be = (t) => {
|
|
|
818
818
|
...St,
|
|
819
819
|
resizable: h.bool
|
|
820
820
|
}, Ie = ({ children: t, size: i, ...o }) => /* @__PURE__ */ a(
|
|
821
|
-
|
|
821
|
+
K,
|
|
822
822
|
{
|
|
823
823
|
...o,
|
|
824
|
-
type:
|
|
825
|
-
anchor:
|
|
824
|
+
type: L.Anchored,
|
|
825
|
+
anchor: x.Left,
|
|
826
826
|
position: { left: 0, top: 0, bottom: 0, rightResizable: !0, width: i },
|
|
827
827
|
children: t
|
|
828
828
|
}
|
|
829
829
|
);
|
|
830
830
|
Ie.propTypes = St;
|
|
831
831
|
const Oe = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ a(
|
|
832
|
-
|
|
832
|
+
K,
|
|
833
833
|
{
|
|
834
834
|
...n,
|
|
835
|
-
type:
|
|
836
|
-
anchor:
|
|
835
|
+
type: L.Anchored,
|
|
836
|
+
anchor: x.Left,
|
|
837
837
|
position: { left: 0, top: 0, bottom: 0, rightResizable: o, width: t },
|
|
838
838
|
children: i
|
|
839
839
|
}
|
|
840
840
|
);
|
|
841
841
|
Oe.propTypes = Tt;
|
|
842
842
|
const De = ({ children: t, size: i, ...o }) => /* @__PURE__ */ a(
|
|
843
|
-
|
|
843
|
+
K,
|
|
844
844
|
{
|
|
845
845
|
...o,
|
|
846
|
-
type:
|
|
847
|
-
anchor:
|
|
846
|
+
type: L.Anchored,
|
|
847
|
+
anchor: x.Top,
|
|
848
848
|
position: { left: 0, top: 0, right: 0, bottomResizable: !0, height: i },
|
|
849
849
|
children: t
|
|
850
850
|
}
|
|
851
851
|
);
|
|
852
852
|
De.propTypes = St;
|
|
853
|
-
const
|
|
854
|
-
|
|
853
|
+
const ke = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ a(
|
|
854
|
+
K,
|
|
855
855
|
{
|
|
856
856
|
...n,
|
|
857
|
-
type:
|
|
858
|
-
anchor:
|
|
857
|
+
type: L.Anchored,
|
|
858
|
+
anchor: x.Top,
|
|
859
859
|
position: { left: 0, top: 0, right: 0, bottomResizable: o, height: t },
|
|
860
860
|
children: i
|
|
861
861
|
}
|
|
862
862
|
);
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
|
|
863
|
+
ke.propTypes = Tt;
|
|
864
|
+
const _e = ({ children: t, size: i, ...o }) => /* @__PURE__ */ a(
|
|
865
|
+
K,
|
|
866
866
|
{
|
|
867
867
|
...o,
|
|
868
|
-
type:
|
|
869
|
-
anchor:
|
|
868
|
+
type: L.Anchored,
|
|
869
|
+
anchor: x.Right,
|
|
870
870
|
position: { bottom: 0, top: 0, right: 0, leftResizable: !0, width: i },
|
|
871
871
|
children: t
|
|
872
872
|
}
|
|
873
873
|
);
|
|
874
|
-
|
|
875
|
-
const
|
|
876
|
-
|
|
874
|
+
_e.propTypes = St;
|
|
875
|
+
const Ne = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ a(
|
|
876
|
+
K,
|
|
877
877
|
{
|
|
878
878
|
...n,
|
|
879
|
-
type:
|
|
880
|
-
anchor:
|
|
879
|
+
type: L.Anchored,
|
|
880
|
+
anchor: x.Right,
|
|
881
881
|
position: { bottom: 0, top: 0, right: 0, leftResizable: o, width: t },
|
|
882
882
|
children: i
|
|
883
883
|
}
|
|
884
884
|
);
|
|
885
|
-
|
|
886
|
-
const
|
|
887
|
-
|
|
885
|
+
Ne.propTypes = Tt;
|
|
886
|
+
const Pe = ({ children: t, size: i, ...o }) => /* @__PURE__ */ a(
|
|
887
|
+
K,
|
|
888
888
|
{
|
|
889
889
|
...o,
|
|
890
|
-
type:
|
|
891
|
-
anchor:
|
|
890
|
+
type: L.Anchored,
|
|
891
|
+
anchor: x.Bottom,
|
|
892
892
|
position: { bottom: 0, left: 0, right: 0, topResizable: !0, height: i },
|
|
893
893
|
children: t
|
|
894
894
|
}
|
|
895
895
|
);
|
|
896
|
-
|
|
897
|
-
const
|
|
898
|
-
|
|
896
|
+
Pe.propTypes = St;
|
|
897
|
+
const Ee = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ a(
|
|
898
|
+
K,
|
|
899
899
|
{
|
|
900
900
|
...n,
|
|
901
|
-
type:
|
|
902
|
-
anchor:
|
|
901
|
+
type: L.Anchored,
|
|
902
|
+
anchor: x.Bottom,
|
|
903
903
|
position: { bottom: 0, left: 0, right: 0, topResizable: o, height: t },
|
|
904
904
|
children: i
|
|
905
905
|
}
|
|
906
906
|
);
|
|
907
|
-
|
|
907
|
+
Ee.propTypes = Tt;
|
|
908
908
|
const He = me(
|
|
909
909
|
{
|
|
910
910
|
...Tt,
|
|
911
|
-
type: h.oneOf([
|
|
912
|
-
anchor: h.oneOf([
|
|
911
|
+
type: h.oneOf([L.Positioned, L.Fill, L.Anchored]),
|
|
912
|
+
anchor: h.oneOf([x.Left, x.Top, x.Right, x.Bottom]),
|
|
913
913
|
anchorSize: h.oneOfType([h.string, h.number]),
|
|
914
914
|
left: h.oneOfType([h.string, h.number]),
|
|
915
915
|
top: h.oneOfType([h.string, h.number]),
|
|
@@ -928,42 +928,42 @@ const He = me(
|
|
|
928
928
|
right: u,
|
|
929
929
|
bottom: d,
|
|
930
930
|
width: r,
|
|
931
|
-
height:
|
|
931
|
+
height: p,
|
|
932
932
|
anchorSize: e,
|
|
933
933
|
anchor: l,
|
|
934
|
-
resizable:
|
|
934
|
+
resizable: z,
|
|
935
935
|
resizeTypes: s,
|
|
936
936
|
...f
|
|
937
937
|
}) => {
|
|
938
938
|
let m;
|
|
939
|
-
return i = i ||
|
|
939
|
+
return i = i || L.Fill, i === L.Positioned ? m = {
|
|
940
940
|
left: o,
|
|
941
941
|
top: n,
|
|
942
942
|
right: u,
|
|
943
943
|
bottom: d,
|
|
944
944
|
width: r,
|
|
945
|
-
height:
|
|
946
|
-
leftResizable: s && (s.includes(
|
|
947
|
-
topResizable: s && (s.includes(
|
|
948
|
-
rightResizable: s && (s.includes(
|
|
949
|
-
bottomResizable: s && (s.includes(
|
|
950
|
-
topLeftResizable: s && (s.includes(
|
|
951
|
-
topRightResizable: s && (s.includes(
|
|
952
|
-
bottomLeftResizable: s && (s.includes(
|
|
953
|
-
bottomRightResizable: s && (s.includes(
|
|
954
|
-
} : l ===
|
|
945
|
+
height: p,
|
|
946
|
+
leftResizable: s && (s.includes(v.Left) || s.includes(v.All)),
|
|
947
|
+
topResizable: s && (s.includes(v.Top) || s.includes(v.All)),
|
|
948
|
+
rightResizable: s && (s.includes(v.Right) || s.includes(v.All)),
|
|
949
|
+
bottomResizable: s && (s.includes(v.Bottom) || s.includes(v.All)),
|
|
950
|
+
topLeftResizable: s && (s.includes(v.TopLeft) || s.includes(v.All)),
|
|
951
|
+
topRightResizable: s && (s.includes(v.TopRight) || s.includes(v.All)),
|
|
952
|
+
bottomLeftResizable: s && (s.includes(v.BottomLeft) || s.includes(v.All)),
|
|
953
|
+
bottomRightResizable: s && (s.includes(v.BottomRight) || s.includes(v.All))
|
|
954
|
+
} : l === x.Left ? (m = { left: 0, top: 0, bottom: 0, width: e, rightResizable: z }, i = L.Anchored) : l === x.Right ? (m = { right: 0, top: 0, bottom: 0, width: e, leftResizable: z }, i = L.Anchored) : l === x.Top ? (m = { left: 0, top: 0, right: 0, height: e, bottomResizable: z }, i = L.Anchored) : l === x.Bottom ? (m = { left: 0, bottom: 0, right: 0, height: e, topResizable: z }, i = L.Anchored) : (m = {
|
|
955
955
|
left: 0,
|
|
956
956
|
top: 0,
|
|
957
957
|
bottom: 0,
|
|
958
958
|
right: 0
|
|
959
|
-
}, i =
|
|
959
|
+
}, i = L.Fill), /* @__PURE__ */ a(K, { ...f, type: i, anchor: l, position: m, children: t });
|
|
960
960
|
};
|
|
961
961
|
We.propTypes = He;
|
|
962
|
-
const Fe = (t) => /* @__PURE__ */ a(
|
|
963
|
-
Fe.propTypes =
|
|
964
|
-
const Ve = ({ width: t, height: i, children: o, ...n }) => /* @__PURE__ */ a(
|
|
962
|
+
const Fe = (t) => /* @__PURE__ */ a(K, { ...t, type: L.Fill, position: { left: 0, top: 0, right: 0, bottom: 0 }, children: t.children });
|
|
963
|
+
Fe.propTypes = Rt;
|
|
964
|
+
const Ve = ({ width: t, height: i, children: o, ...n }) => /* @__PURE__ */ a(K, { ...n, type: L.Fixed, position: { width: t, height: i }, children: o });
|
|
965
965
|
Ve.propTypes = {
|
|
966
|
-
...
|
|
966
|
+
...Rt,
|
|
967
967
|
width: h.oneOfType([h.string, h.number]),
|
|
968
968
|
height: h.oneOfType([h.string, h.number]).isRequired
|
|
969
969
|
};
|
|
@@ -971,35 +971,35 @@ const qe = (t) => /* @__PURE__ */ a(At.Provider, { value: t.zIndex, children: t.
|
|
|
971
971
|
qe.propTypes = {
|
|
972
972
|
zIndex: h.number.isRequired
|
|
973
973
|
};
|
|
974
|
-
const Ue = ({ left: t, top: i, right: o, bottom: n, width: u, height: d, resizable: r, ...
|
|
974
|
+
const Ue = ({ left: t, top: i, right: o, bottom: n, width: u, height: d, resizable: r, ...p }) => {
|
|
975
975
|
const e = r || [];
|
|
976
976
|
return /* @__PURE__ */ a(
|
|
977
|
-
|
|
977
|
+
K,
|
|
978
978
|
{
|
|
979
|
-
...
|
|
980
|
-
type:
|
|
979
|
+
...p,
|
|
980
|
+
type: L.Positioned,
|
|
981
981
|
position: {
|
|
982
982
|
left: t,
|
|
983
983
|
top: i,
|
|
984
984
|
right: o,
|
|
985
985
|
bottom: n,
|
|
986
|
-
leftResizable: e.includes(
|
|
987
|
-
topResizable: e.includes(
|
|
988
|
-
rightResizable: e.includes(
|
|
989
|
-
bottomResizable: e.includes(
|
|
990
|
-
topLeftResizable: e.includes(
|
|
991
|
-
topRightResizable: e.includes(
|
|
992
|
-
bottomLeftResizable: e.includes(
|
|
993
|
-
bottomRightResizable: e.includes(
|
|
986
|
+
leftResizable: e.includes(v.Left) || e.includes(v.All),
|
|
987
|
+
topResizable: e.includes(v.Top) || e.includes(v.All),
|
|
988
|
+
rightResizable: e.includes(v.Right) || e.includes(v.All),
|
|
989
|
+
bottomResizable: e.includes(v.Bottom) || e.includes(v.All),
|
|
990
|
+
topLeftResizable: e.includes(v.TopLeft) || e.includes(v.All),
|
|
991
|
+
topRightResizable: e.includes(v.TopRight) || e.includes(v.All),
|
|
992
|
+
bottomLeftResizable: e.includes(v.BottomLeft) || e.includes(v.All),
|
|
993
|
+
bottomRightResizable: e.includes(v.BottomRight) || e.includes(v.All),
|
|
994
994
|
width: u,
|
|
995
995
|
height: d
|
|
996
996
|
},
|
|
997
|
-
children:
|
|
997
|
+
children: p.children
|
|
998
998
|
}
|
|
999
999
|
);
|
|
1000
1000
|
};
|
|
1001
1001
|
Ue.propTypes = {
|
|
1002
|
-
...
|
|
1002
|
+
...Rt,
|
|
1003
1003
|
left: h.oneOfType([h.string, h.number]),
|
|
1004
1004
|
top: h.oneOfType([h.string, h.number]),
|
|
1005
1005
|
right: h.oneOfType([h.string, h.number]),
|
|
@@ -1009,17 +1009,17 @@ Ue.propTypes = {
|
|
|
1009
1009
|
resizable: h.array
|
|
1010
1010
|
};
|
|
1011
1011
|
const Ri = (t) => {
|
|
1012
|
-
const i = O.useContext(
|
|
1012
|
+
const i = O.useContext(Mt);
|
|
1013
1013
|
return i ? t.children(i) : t.children({ left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0, x: 0, y: 0, toJSON: () => "" });
|
|
1014
|
-
}, Xe = ({ left: t, top: i, right: o, bottom: n, children: u, ...d }) => /* @__PURE__ */ a(
|
|
1014
|
+
}, Xe = ({ left: t, top: i, right: o, bottom: n, children: u, ...d }) => /* @__PURE__ */ a(K, { ...d, type: L.ViewPort, position: { left: t || 0, top: i || 0, right: o || 0, bottom: n || 0 }, children: u });
|
|
1015
1015
|
Xe.propTypes = {
|
|
1016
|
-
...
|
|
1016
|
+
...Rt,
|
|
1017
1017
|
left: h.oneOfType([h.string, h.number]),
|
|
1018
1018
|
top: h.oneOfType([h.string, h.number]),
|
|
1019
1019
|
right: h.oneOfType([h.string, h.number]),
|
|
1020
1020
|
bottom: h.oneOfType([h.string, h.number])
|
|
1021
1021
|
};
|
|
1022
|
-
const
|
|
1022
|
+
const Si = ({ children: t, ...i }) => /* @__PURE__ */ a(Gt.Provider, { value: i, children: t }), Ge = (t) => {
|
|
1023
1023
|
const {
|
|
1024
1024
|
favicon: i,
|
|
1025
1025
|
title: o,
|
|
@@ -1027,66 +1027,66 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1027
1027
|
activeTab: u,
|
|
1028
1028
|
position: d,
|
|
1029
1029
|
contentWidth: r,
|
|
1030
|
-
onClick:
|
|
1030
|
+
onClick: p,
|
|
1031
1031
|
onClose: e,
|
|
1032
1032
|
setDragging: l,
|
|
1033
|
-
tabsContentWidth:
|
|
1033
|
+
tabsContentWidth: z,
|
|
1034
1034
|
animateTabMove: s,
|
|
1035
1035
|
isDragging: f,
|
|
1036
1036
|
index: m,
|
|
1037
|
-
sorting:
|
|
1037
|
+
sorting: w,
|
|
1038
1038
|
showButtonClose: c,
|
|
1039
1039
|
closing: g,
|
|
1040
|
-
onCloseAllTabs:
|
|
1040
|
+
onCloseAllTabs: y,
|
|
1041
1041
|
onCloseLeftTabs: S,
|
|
1042
|
-
onCloseRightTabs:
|
|
1043
|
-
onCloseOtherTabs:
|
|
1044
|
-
totalTabs:
|
|
1045
|
-
} = t, { t: N } =
|
|
1046
|
-
|
|
1047
|
-
document.removeEventListener("mousemove",
|
|
1048
|
-
})),
|
|
1049
|
-
|
|
1050
|
-
}, [
|
|
1051
|
-
|
|
1042
|
+
onCloseRightTabs: b,
|
|
1043
|
+
onCloseOtherTabs: M,
|
|
1044
|
+
totalTabs: j
|
|
1045
|
+
} = t, { t: N } = Ft("archbase"), [T, C] = q(0), [D, P] = q(!1), [E, Z] = q(null), [k, it] = q(null), [B, U] = q(!1), [Q, nt] = q(0), [rt, G] = q(!1), mt = ot(null), A = 9, _ = 84, H = 60, V = 48;
|
|
1046
|
+
et(() => (document.addEventListener("mousemove", X), document.addEventListener("mouseup", I), () => {
|
|
1047
|
+
document.removeEventListener("mousemove", X), document.removeEventListener("mouseup", I);
|
|
1048
|
+
})), et(() => {
|
|
1049
|
+
D || setTimeout(() => P(!0), 500);
|
|
1050
|
+
}, [D]), et(() => {
|
|
1051
|
+
C(r + 2 * A);
|
|
1052
1052
|
}, [r]);
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1055
|
-
},
|
|
1056
|
-
if (
|
|
1057
|
-
let
|
|
1058
|
-
|
|
1053
|
+
const $ = (Y) => {
|
|
1054
|
+
Y.button === 0 && (l(!0), it(Y.pageX), U(!1), nt(d));
|
|
1055
|
+
}, X = (Y) => {
|
|
1056
|
+
if (k != null && f) {
|
|
1057
|
+
let ct = Q - A + (Y.pageX - k);
|
|
1058
|
+
ct < 0 && (ct = 0), ct > z - T && (ct = z - T), Z(ct), !w && s(ct);
|
|
1059
1059
|
}
|
|
1060
|
-
},
|
|
1061
|
-
|
|
1062
|
-
}, [
|
|
1063
|
-
|
|
1064
|
-
|
|
1060
|
+
}, I = (Y) => {
|
|
1061
|
+
k != null && f && (it(null), Z(null), l(!1), U(!0));
|
|
1062
|
+
}, [dt, It] = q(d - A);
|
|
1063
|
+
et(() => {
|
|
1064
|
+
It(d ? d - A : 0);
|
|
1065
1065
|
}, [m, d]);
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1066
|
+
const gt = () => {
|
|
1067
|
+
M && M(t.id), G(!1);
|
|
1068
|
+
}, Ct = () => {
|
|
1069
|
+
S && S(t.id), G(!1);
|
|
1068
1070
|
}, Lt = () => {
|
|
1069
|
-
|
|
1070
|
-
}, Yt = () => {
|
|
1071
|
-
w && w(t.id), X(!1);
|
|
1071
|
+
b && b(t.id), G(!1);
|
|
1072
1072
|
}, Kt = () => {
|
|
1073
|
-
|
|
1074
|
-
}, Qt = (
|
|
1075
|
-
|
|
1076
|
-
},
|
|
1073
|
+
y && y(), G(!1);
|
|
1074
|
+
}, Qt = (Y) => {
|
|
1075
|
+
Y.preventDefault(), G(!0);
|
|
1076
|
+
}, Ot = m > 0, Dt = j !== void 0 && m < j - 1, kt = (j || 0) > 1;
|
|
1077
1077
|
return /* @__PURE__ */ F(
|
|
1078
1078
|
"div",
|
|
1079
1079
|
{
|
|
1080
|
-
className: `archbase_tab ${
|
|
1080
|
+
className: `archbase_tab ${D ? "" : " archbase_tab-was-just-added"}${k == null && !u ? " archbase_tab-was-just-dragged" : ""}`,
|
|
1081
1081
|
style: {
|
|
1082
|
-
transform: `translate3d(${E ??
|
|
1083
|
-
width: `${
|
|
1082
|
+
transform: `translate3d(${E ?? dt}px, 0, 0)`,
|
|
1083
|
+
width: `${T}px`
|
|
1084
1084
|
},
|
|
1085
1085
|
"tab-active": u !== !1 ? "" : null,
|
|
1086
|
-
"is-small": r <
|
|
1087
|
-
"is-smaller": r <
|
|
1088
|
-
"is-mini": r <
|
|
1089
|
-
ref:
|
|
1086
|
+
"is-small": r < _ ? "" : null,
|
|
1087
|
+
"is-smaller": r < H ? "" : null,
|
|
1088
|
+
"is-mini": r < V ? "" : null,
|
|
1089
|
+
ref: mt,
|
|
1090
1090
|
onContextMenu: Qt,
|
|
1091
1091
|
children: [
|
|
1092
1092
|
/* @__PURE__ */ a("div", { className: "archbase_tab-dividers" }),
|
|
@@ -1102,17 +1102,17 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1102
1102
|
/* @__PURE__ */ F("div", { className: "archbase_tab-content", children: [
|
|
1103
1103
|
!!i && /* @__PURE__ */ a("div", { className: "archbase_tab-favicon", style: { backgroundImage: `url(${i})` } }),
|
|
1104
1104
|
/* @__PURE__ */ a("div", { className: "archbase_tab-title", children: n ?? o }),
|
|
1105
|
-
/* @__PURE__ */ a("div", { className: "archbase_tab-drag-handle", title: n ?? o, onClick:
|
|
1106
|
-
(
|
|
1107
|
-
/* @__PURE__ */ a(
|
|
1108
|
-
|
|
1105
|
+
/* @__PURE__ */ a("div", { className: "archbase_tab-drag-handle", title: n ?? o, onClick: p, onPointerDown: (Y) => p(Y), onMouseUp: I, onMouseMove: X, onMouseDown: $ }),
|
|
1106
|
+
(y || S || b || M) && /* @__PURE__ */ F(at, { shadow: "md", width: 200, opened: rt, onChange: G, position: "bottom-end", children: [
|
|
1107
|
+
/* @__PURE__ */ a(at.Target, { children: /* @__PURE__ */ a("div", { className: "archbase_tab-dropdown", onClick: (Y) => {
|
|
1108
|
+
Y.stopPropagation(), G(!rt);
|
|
1109
1109
|
} }) }),
|
|
1110
|
-
/* @__PURE__ */ F(
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
(
|
|
1115
|
-
/* @__PURE__ */ a(
|
|
1110
|
+
/* @__PURE__ */ F(at.Dropdown, { children: [
|
|
1111
|
+
kt && /* @__PURE__ */ a(at.Item, { onClick: gt, children: String(N("tabs.closeOthers")) }),
|
|
1112
|
+
Ot && /* @__PURE__ */ a(at.Item, { onClick: Ct, children: String(N("tabs.closeLeft")) }),
|
|
1113
|
+
Dt && /* @__PURE__ */ a(at.Item, { onClick: Lt, children: String(N("tabs.closeRight")) }),
|
|
1114
|
+
(kt || Ot || Dt) && /* @__PURE__ */ a(at.Divider, {}),
|
|
1115
|
+
/* @__PURE__ */ a(at.Item, { onClick: Kt, children: String(N("tabs.closeAll")) })
|
|
1116
1116
|
] })
|
|
1117
1117
|
] }),
|
|
1118
1118
|
c ? g ? /* @__PURE__ */ a(
|
|
@@ -1123,86 +1123,96 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1123
1123
|
"aria-label": "closing",
|
|
1124
1124
|
children: /* @__PURE__ */ a(te, { size: 12 })
|
|
1125
1125
|
}
|
|
1126
|
-
) : /* @__PURE__ */ a("div", { className: "archbase_tab-close", onClick: (
|
|
1127
|
-
e(
|
|
1126
|
+
) : /* @__PURE__ */ a("div", { className: "archbase_tab-close", onClick: (Y) => {
|
|
1127
|
+
e(Y);
|
|
1128
1128
|
} }) : null
|
|
1129
1129
|
] })
|
|
1130
1130
|
]
|
|
1131
1131
|
}
|
|
1132
1132
|
);
|
|
1133
|
-
},
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1133
|
+
}, Je = (t) => t ? [
|
|
1134
|
+
["--archbase-tabs-bar-bg", t.barBackground],
|
|
1135
|
+
["--archbase-tabs-tab-bg", t.tabBackground],
|
|
1136
|
+
["--archbase-tabs-tab-active-bg", t.tabActiveBackground],
|
|
1137
|
+
["--archbase-tabs-title", t.titleColor],
|
|
1138
|
+
["--archbase-tabs-title-active", t.titleActiveColor],
|
|
1139
|
+
["--archbase-tabs-tab-active-accent", t.activeAccentColor],
|
|
1140
|
+
["--archbase-tabs-divider", t.dividerColor],
|
|
1141
|
+
["--archbase-tabs-bottom-bar-bg", t.bottomBarBackground]
|
|
1142
|
+
].reduce((o, [n, u]) => (u && (o[n] = u), o), {}) : {}, Ti = (t) => {
|
|
1143
|
+
const { currentTabs: i, onTabChange: o, activeTab: n, onTabClose: u, className: d, style: r, dark: p, onClick: e, colors: l, buttonCloseOnlyActiveTab: z = !1, onCloseAllTabs: s, onCloseLeftTabs: f, onCloseRightTabs: m, onCloseOtherTabs: w } = t, [c, g] = q([]), [y, S] = q([]), [b, M] = q(i || []), [j, N] = q(!1), [T, C] = q(!1), D = ot(null), { width: P, height: E } = le(), Z = 9, k = 1, it = 24, B = 240;
|
|
1144
|
+
et(() => {
|
|
1145
|
+
g(Q()), S(nt(Q()));
|
|
1146
|
+
}, []), et(() => {
|
|
1147
|
+
U();
|
|
1148
|
+
}, [JSON.stringify(b), P, E]), et(() => {
|
|
1149
|
+
i && M(i);
|
|
1141
1150
|
}, [JSON.stringify(i)]);
|
|
1142
|
-
const
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1145
|
-
},
|
|
1146
|
-
const
|
|
1147
|
-
if (
|
|
1148
|
-
const
|
|
1149
|
-
let gt = H -
|
|
1150
|
-
for (let
|
|
1151
|
-
const Lt =
|
|
1152
|
-
|
|
1151
|
+
const U = () => {
|
|
1152
|
+
const A = Q();
|
|
1153
|
+
A && (g(A), S(nt(A)));
|
|
1154
|
+
}, Q = () => {
|
|
1155
|
+
const A = [];
|
|
1156
|
+
if (D.current) {
|
|
1157
|
+
const _ = b.length, H = D.current.clientWidth, V = (_ - 1) * k, $ = (H - 2 * Z + V) / _, X = Math.max(it, Math.min(B, $)), I = Math.floor(X), dt = I * _ + 2 * Z - V;
|
|
1158
|
+
let gt = H - dt;
|
|
1159
|
+
for (let Ct = 0; Ct < _; Ct += 1) {
|
|
1160
|
+
const Lt = I < B && gt > 0 ? 1 : 0;
|
|
1161
|
+
A.push(I + Lt), gt > 0 && (gt -= 1);
|
|
1153
1162
|
}
|
|
1154
1163
|
}
|
|
1155
|
-
return
|
|
1156
|
-
},
|
|
1157
|
-
const
|
|
1158
|
-
let
|
|
1159
|
-
return H.forEach((
|
|
1160
|
-
const
|
|
1161
|
-
|
|
1162
|
-
}),
|
|
1163
|
-
},
|
|
1164
|
-
|
|
1165
|
-
let H = 1 / 0,
|
|
1166
|
-
|
|
1167
|
-
Math.abs(
|
|
1168
|
-
}),
|
|
1169
|
-
|
|
1170
|
-
}),
|
|
1171
|
-
},
|
|
1172
|
-
u ? u(
|
|
1164
|
+
return A;
|
|
1165
|
+
}, nt = (A) => {
|
|
1166
|
+
const _ = [], H = A || c;
|
|
1167
|
+
let V = Z;
|
|
1168
|
+
return H.forEach(($, X) => {
|
|
1169
|
+
const I = X * k;
|
|
1170
|
+
_.push(V - I), V += $;
|
|
1171
|
+
}), _;
|
|
1172
|
+
}, rt = (A, _) => {
|
|
1173
|
+
N(!0);
|
|
1174
|
+
let H = 1 / 0, V = -1, $ = [];
|
|
1175
|
+
y.forEach((X, I) => {
|
|
1176
|
+
Math.abs(A - X) < H && (H = Math.abs(A - X), V = I);
|
|
1177
|
+
}), V = Math.max(0, Math.min(y.length, V)), _ != V && (y.forEach((X, I) => {
|
|
1178
|
+
I == _ ? $[I] = b[V > _ ? I + 1 : I - 1] : _ > I && I >= V ? $[I] = b[I + 1] : _ < I && I <= V ? $[I] = b[I - 1] : $[I] = b[I];
|
|
1179
|
+
}), G($) && o($)), N(!1);
|
|
1180
|
+
}, G = (A) => new Set(A).size === A.length, mt = (A) => {
|
|
1181
|
+
u ? u(A) : o(b.filter((_, H) => H != A));
|
|
1173
1182
|
};
|
|
1174
1183
|
return /* @__PURE__ */ a("div", { className: d, style: r, children: /* @__PURE__ */ F(
|
|
1175
1184
|
"div",
|
|
1176
1185
|
{
|
|
1177
|
-
className: `archbase_tabs${
|
|
1186
|
+
className: `archbase_tabs${p ? " archbase_tabs-dark-theme" : ""}${T ? "" : " archbase_tabs-is-sorting"}`,
|
|
1187
|
+
style: Je(l),
|
|
1178
1188
|
children: [
|
|
1179
|
-
/* @__PURE__ */ a("div", { className: "archbase_tabs_content", ref:
|
|
1189
|
+
/* @__PURE__ */ a("div", { className: "archbase_tabs_content", ref: D, children: !!b && b.map((A, _) => !!y[_] && /* @__PURE__ */ a(
|
|
1180
1190
|
Ge,
|
|
1181
1191
|
{
|
|
1182
|
-
favicon:
|
|
1183
|
-
title:
|
|
1184
|
-
customTitle:
|
|
1185
|
-
activeTab: n ===
|
|
1186
|
-
position:
|
|
1187
|
-
contentWidth:
|
|
1188
|
-
onClick: (H) => e(
|
|
1189
|
-
onClose: (H) =>
|
|
1190
|
-
setDragging:
|
|
1191
|
-
showButtonClose:
|
|
1192
|
-
closing:
|
|
1193
|
-
tabsContentWidth:
|
|
1194
|
-
animateTabMove: (H) =>
|
|
1195
|
-
isDragging:
|
|
1196
|
-
id:
|
|
1197
|
-
index:
|
|
1198
|
-
sorting:
|
|
1199
|
-
onCloseAllTabs:
|
|
1200
|
-
onCloseLeftTabs:
|
|
1201
|
-
onCloseRightTabs:
|
|
1202
|
-
onCloseOtherTabs:
|
|
1203
|
-
totalTabs:
|
|
1192
|
+
favicon: A.favicon,
|
|
1193
|
+
title: A.title,
|
|
1194
|
+
customTitle: A.customTitle,
|
|
1195
|
+
activeTab: n === A.key,
|
|
1196
|
+
position: y[_],
|
|
1197
|
+
contentWidth: c[_],
|
|
1198
|
+
onClick: (H) => e(A.key),
|
|
1199
|
+
onClose: (H) => mt(A.key),
|
|
1200
|
+
setDragging: C,
|
|
1201
|
+
showButtonClose: z ? n === A.key : !0,
|
|
1202
|
+
closing: A.closing,
|
|
1203
|
+
tabsContentWidth: D.current && D.current.clientWidth,
|
|
1204
|
+
animateTabMove: (H) => rt(H, _),
|
|
1205
|
+
isDragging: T,
|
|
1206
|
+
id: A.key,
|
|
1207
|
+
index: _,
|
|
1208
|
+
sorting: j,
|
|
1209
|
+
onCloseAllTabs: s,
|
|
1210
|
+
onCloseLeftTabs: f,
|
|
1211
|
+
onCloseRightTabs: m,
|
|
1212
|
+
onCloseOtherTabs: w,
|
|
1213
|
+
totalTabs: b.length
|
|
1204
1214
|
},
|
|
1205
|
-
|
|
1215
|
+
A.key
|
|
1206
1216
|
)) }),
|
|
1207
1217
|
/* @__PURE__ */ a("div", { className: "archbase_tabs-bottom-bar" })
|
|
1208
1218
|
]
|
|
@@ -1214,7 +1224,7 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1214
1224
|
const n = parseInt(o.style.zIndex);
|
|
1215
1225
|
t = Math.max(isNaN(n) ? 0 : n, t);
|
|
1216
1226
|
}), t + 1;
|
|
1217
|
-
},
|
|
1227
|
+
}, Ci = (t) => {
|
|
1218
1228
|
const i = Object.assign(
|
|
1219
1229
|
{
|
|
1220
1230
|
id: t.id && t.id.length ? t.id : Date.now().toString(),
|
|
@@ -1244,52 +1254,52 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1244
1254
|
t
|
|
1245
1255
|
);
|
|
1246
1256
|
i.id || (i.id = Date.now().toString()), Object.freeze(i);
|
|
1247
|
-
const [o, n] = W.useState(i.height), [u, d] = W.useState(i.width), [r,
|
|
1248
|
-
m(
|
|
1249
|
-
},
|
|
1250
|
-
l((
|
|
1251
|
-
},
|
|
1252
|
-
l((
|
|
1253
|
-
},
|
|
1254
|
-
if (
|
|
1255
|
-
|
|
1257
|
+
const [o, n] = W.useState(i.height), [u, d] = W.useState(i.width), [r, p] = W.useState(i.top || 0), [e, l] = W.useState(i.left || 0), [z, s] = W.useState(0), [f, m] = W.useState(0), [w, c] = W.useState(!1), [g, y] = W.useState(!1), [S, b] = W.useState("▁"), [M, j] = W.useState("□"), [N, T] = W.useState(""), [C, D] = W.useState(pt()), [P, E] = W.useState(1), { ref: Z, width: k, height: it } = ae(), B = W.useRef(null), U = ot(o), Q = ot(u), nt = ot(r), rt = ot(e), G = 500, mt = ($) => {
|
|
1258
|
+
m($.clientY - r), s($.clientX - e), D(pt()), E(0.5);
|
|
1259
|
+
}, A = ($) => {
|
|
1260
|
+
l(($.clientX || $.screenX || e + z) - z), p(($.clientY || $.screenY || r + f) - f);
|
|
1261
|
+
}, _ = ($) => {
|
|
1262
|
+
l(($.clientX || $.screenX) - z), p(($.clientY || $.screenY) - f), E(1);
|
|
1263
|
+
}, H = () => {
|
|
1264
|
+
if (T(`${G}ms ease-in-out`), w)
|
|
1265
|
+
U.current = o, p(nt.current || 0), l(rt.current || 0), c(!1), b("▁"), y(!1);
|
|
1256
1266
|
else {
|
|
1257
|
-
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1260
|
-
let
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
|
|
1267
|
+
U.current = 32, g || (rt.current = e, nt.current = r);
|
|
1268
|
+
const $ = document.getElementById(i.id)?.parentElement;
|
|
1269
|
+
Q.current = u;
|
|
1270
|
+
let X = ($?.clientHeight || window.innerHeight) - U.current - 4;
|
|
1271
|
+
const I = ($?.clientWidth || window.innerWidth) - Q.current - 4, dt = document.elementFromPoint(
|
|
1272
|
+
I + Q.current / 2,
|
|
1273
|
+
X + U.current / 2
|
|
1264
1274
|
);
|
|
1265
|
-
|
|
1275
|
+
dt && ["archbase-window-container", "windowTitle"].includes(dt?.className || "") && (X -= dt?.clientHeight + 4), p(X), l(I), c(!0), b("◰"), y(!1);
|
|
1266
1276
|
}
|
|
1267
|
-
|
|
1268
|
-
},
|
|
1269
|
-
|
|
1270
|
-
const
|
|
1271
|
-
g ? (
|
|
1277
|
+
D(pt()), setTimeout(T, G + 1, "");
|
|
1278
|
+
}, V = () => {
|
|
1279
|
+
T(`${G}ms ease-in-out`);
|
|
1280
|
+
const $ = document.getElementById(i.id)?.parentElement;
|
|
1281
|
+
g ? (U.current = o, Q.current = u, p(nt.current || 0), l(rt.current || 0), y(!1), j("□"), c(!1), b("▁")) : (U.current = $?.clientHeight || window.innerHeight, Q.current = $?.clientWidth || window.innerWidth, w || (rt.current = e, nt.current = r), p($?.offsetTop || 0), l($?.offsetLeft || 0), y(!0), j("❐"), c(!1), b("▁")), D(pt()), setTimeout(T, G + 1, "");
|
|
1272
1282
|
};
|
|
1273
|
-
return
|
|
1274
|
-
!g && !
|
|
1275
|
-
}, [
|
|
1283
|
+
return et(() => {
|
|
1284
|
+
!g && !w && (d(k), n(it));
|
|
1285
|
+
}, [k, it, g, w]), /* @__PURE__ */ F(
|
|
1276
1286
|
"div",
|
|
1277
1287
|
{
|
|
1278
1288
|
id: i.id,
|
|
1279
1289
|
className: "archbase-window-container",
|
|
1280
1290
|
style: {
|
|
1281
|
-
height:
|
|
1282
|
-
width:
|
|
1291
|
+
height: U.current,
|
|
1292
|
+
width: Q.current,
|
|
1283
1293
|
top: r,
|
|
1284
1294
|
left: e,
|
|
1285
1295
|
resize: i.resizable ? "both" : "none",
|
|
1286
1296
|
transition: N,
|
|
1287
|
-
zIndex:
|
|
1288
|
-
opacity:
|
|
1297
|
+
zIndex: C,
|
|
1298
|
+
opacity: P
|
|
1289
1299
|
},
|
|
1290
|
-
ref:
|
|
1300
|
+
ref: Z,
|
|
1291
1301
|
onClick: () => {
|
|
1292
|
-
|
|
1302
|
+
D(pt());
|
|
1293
1303
|
},
|
|
1294
1304
|
children: [
|
|
1295
1305
|
i.titleBar && /* @__PURE__ */ F(
|
|
@@ -1298,7 +1308,7 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1298
1308
|
className: "title-bar",
|
|
1299
1309
|
"data-parent": i.id,
|
|
1300
1310
|
style: {
|
|
1301
|
-
opacity:
|
|
1311
|
+
opacity: P
|
|
1302
1312
|
},
|
|
1303
1313
|
children: [
|
|
1304
1314
|
i.titleBar.icon && /* @__PURE__ */ a("span", { className: "icon", children: i.titleBar.icon }),
|
|
@@ -1307,17 +1317,17 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1307
1317
|
{
|
|
1308
1318
|
className: "windowTitle",
|
|
1309
1319
|
draggable: !0,
|
|
1310
|
-
onDragStart:
|
|
1311
|
-
onDrag:
|
|
1312
|
-
onDragEnd:
|
|
1313
|
-
style: { opacity: Math.floor(
|
|
1314
|
-
ref:
|
|
1320
|
+
onDragStart: mt,
|
|
1321
|
+
onDrag: A,
|
|
1322
|
+
onDragEnd: _,
|
|
1323
|
+
style: { opacity: Math.floor(P) },
|
|
1324
|
+
ref: B,
|
|
1315
1325
|
children: i.titleBar.title
|
|
1316
1326
|
}
|
|
1317
1327
|
),
|
|
1318
1328
|
i.titleBar.buttons && /* @__PURE__ */ F("span", { className: "buttonContainer", children: [
|
|
1319
|
-
i.titleBar.buttons.minimize && /* @__PURE__ */ a("span", { className: "windowButton", onClick:
|
|
1320
|
-
i.titleBar.buttons.maximize && /* @__PURE__ */ a("span", { className: "windowButton", onClick:
|
|
1329
|
+
i.titleBar.buttons.minimize && /* @__PURE__ */ a("span", { className: "windowButton", onClick: H, children: S }),
|
|
1330
|
+
i.titleBar.buttons.maximize && /* @__PURE__ */ a("span", { className: "windowButton", onClick: V, children: M }),
|
|
1321
1331
|
!!i.titleBar.buttons.close && /* @__PURE__ */ a("span", { className: "windowButton", onClick: i.titleBar.buttons.close, children: "⨯" })
|
|
1322
1332
|
] })
|
|
1323
1333
|
]
|
|
@@ -1331,7 +1341,7 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1331
1341
|
ref: t.innerRef,
|
|
1332
1342
|
style: {
|
|
1333
1343
|
height: "100%",
|
|
1334
|
-
opacity:
|
|
1344
|
+
opacity: P,
|
|
1335
1345
|
...i.style
|
|
1336
1346
|
},
|
|
1337
1347
|
children: i.children
|
|
@@ -1348,17 +1358,17 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1348
1358
|
splitterHoverColor: u,
|
|
1349
1359
|
style: d,
|
|
1350
1360
|
className: r,
|
|
1351
|
-
autoSaveId:
|
|
1361
|
+
autoSaveId: p
|
|
1352
1362
|
}) => {
|
|
1353
1363
|
const e = i === "row" ? "horizontal" : "vertical";
|
|
1354
1364
|
return /* @__PURE__ */ a(
|
|
1355
|
-
|
|
1365
|
+
Vt,
|
|
1356
1366
|
{
|
|
1357
1367
|
direction: e,
|
|
1358
|
-
autoSaveId:
|
|
1368
|
+
autoSaveId: p,
|
|
1359
1369
|
style: { height: "100%", ...d },
|
|
1360
1370
|
className: r,
|
|
1361
|
-
children: W.Children.map(t, (l) => W.isValidElement(l) && l.type ===
|
|
1371
|
+
children: W.Children.map(t, (l) => W.isValidElement(l) && l.type === Ze ? W.cloneElement(l, {
|
|
1362
1372
|
_splitterSize: o,
|
|
1363
1373
|
_splitterColor: n,
|
|
1364
1374
|
_splitterHoverColor: u,
|
|
@@ -1366,7 +1376,7 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1366
1376
|
}) : l)
|
|
1367
1377
|
}
|
|
1368
1378
|
);
|
|
1369
|
-
},
|
|
1379
|
+
}, Ai = ({
|
|
1370
1380
|
children: t,
|
|
1371
1381
|
minSize: i,
|
|
1372
1382
|
maxSize: o,
|
|
@@ -1375,39 +1385,39 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1375
1385
|
style: d,
|
|
1376
1386
|
className: r
|
|
1377
1387
|
}) => {
|
|
1378
|
-
const
|
|
1388
|
+
const p = (e) => {
|
|
1379
1389
|
if (e !== void 0)
|
|
1380
1390
|
return typeof e == "string" ? parseFloat(e) : e;
|
|
1381
1391
|
};
|
|
1382
1392
|
return /* @__PURE__ */ a(
|
|
1383
|
-
|
|
1393
|
+
$t,
|
|
1384
1394
|
{
|
|
1385
|
-
defaultSize:
|
|
1386
|
-
minSize:
|
|
1387
|
-
maxSize:
|
|
1395
|
+
defaultSize: p(n),
|
|
1396
|
+
minSize: p(i),
|
|
1397
|
+
maxSize: p(o),
|
|
1388
1398
|
collapsible: u,
|
|
1389
1399
|
style: d,
|
|
1390
1400
|
className: r,
|
|
1391
1401
|
children: t
|
|
1392
1402
|
}
|
|
1393
1403
|
);
|
|
1394
|
-
},
|
|
1404
|
+
}, Ze = ({
|
|
1395
1405
|
style: t,
|
|
1396
1406
|
className: i,
|
|
1397
1407
|
...o
|
|
1398
1408
|
}) => {
|
|
1399
|
-
const n = ee(), d = ie() === "dark", r = o._splitterSize ?? 4,
|
|
1409
|
+
const n = ee(), d = ie() === "dark", r = o._splitterSize ?? 4, p = o._splitterColor ?? (d ? n.colors.dark[4] : n.colors.gray[3]);
|
|
1400
1410
|
o._splitterHoverColor ?? n.colors.blue[5];
|
|
1401
1411
|
const l = (o._direction ?? "horizontal") === "horizontal";
|
|
1402
1412
|
return /* @__PURE__ */ a(
|
|
1403
|
-
|
|
1413
|
+
qt,
|
|
1404
1414
|
{
|
|
1405
1415
|
className: i,
|
|
1406
1416
|
style: {
|
|
1407
1417
|
display: "flex",
|
|
1408
1418
|
alignItems: "center",
|
|
1409
1419
|
justifyContent: "center",
|
|
1410
|
-
backgroundColor:
|
|
1420
|
+
backgroundColor: p,
|
|
1411
1421
|
transition: "background-color 150ms ease",
|
|
1412
1422
|
...l ? { width: Number(r), cursor: "col-resize" } : { height: Number(r), cursor: "row-resize" },
|
|
1413
1423
|
...t
|
|
@@ -1425,7 +1435,7 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1425
1435
|
)
|
|
1426
1436
|
}
|
|
1427
1437
|
);
|
|
1428
|
-
},
|
|
1438
|
+
}, Li = ({
|
|
1429
1439
|
children: t,
|
|
1430
1440
|
title: i,
|
|
1431
1441
|
reducedTitle: o,
|
|
@@ -1433,28 +1443,28 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1433
1443
|
backgroundColor: u = "transparent",
|
|
1434
1444
|
hiddenBackgroundColor: d = "#ccc",
|
|
1435
1445
|
withBorder: r = !1,
|
|
1436
|
-
hiddenWidth:
|
|
1446
|
+
hiddenWidth: p = "30px",
|
|
1437
1447
|
position: e = "right",
|
|
1438
1448
|
onShow: l,
|
|
1439
|
-
onHide:
|
|
1449
|
+
onHide: z,
|
|
1440
1450
|
defaultIsDocked: s = !1,
|
|
1441
1451
|
defaultIsVisible: f = !1
|
|
1442
1452
|
}) => {
|
|
1443
|
-
const [m,
|
|
1453
|
+
const [m, w] = q(s), [c, g] = q(f), y = () => w(!m), S = () => {
|
|
1444
1454
|
!m && !c && (g(!0), l && l());
|
|
1445
|
-
},
|
|
1446
|
-
!m && c && (g(!1),
|
|
1455
|
+
}, b = () => {
|
|
1456
|
+
!m && c && (g(!1), z && z());
|
|
1447
1457
|
};
|
|
1448
|
-
|
|
1449
|
-
f ? S() :
|
|
1458
|
+
et(() => {
|
|
1459
|
+
f ? S() : b();
|
|
1450
1460
|
}, [f]);
|
|
1451
|
-
const
|
|
1461
|
+
const M = {
|
|
1452
1462
|
writingMode: "vertical-rl",
|
|
1453
1463
|
transform: "rotate(360deg)",
|
|
1454
1464
|
margin: "10px 0",
|
|
1455
1465
|
alignSelf: "flex-center",
|
|
1456
1466
|
cursor: "pointer"
|
|
1457
|
-
},
|
|
1467
|
+
}, j = {
|
|
1458
1468
|
writingMode: "vertical-rl",
|
|
1459
1469
|
transform: "rotate(180deg)",
|
|
1460
1470
|
margin: "10px 0",
|
|
@@ -1478,7 +1488,7 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1478
1488
|
{
|
|
1479
1489
|
onMouseOver: S,
|
|
1480
1490
|
style: {
|
|
1481
|
-
width: c || m ? "0px" :
|
|
1491
|
+
width: c || m ? "0px" : p,
|
|
1482
1492
|
height: "100%",
|
|
1483
1493
|
backgroundColor: d,
|
|
1484
1494
|
cursor: "pointer",
|
|
@@ -1489,13 +1499,13 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1489
1499
|
alignItems: "center"
|
|
1490
1500
|
},
|
|
1491
1501
|
children: !c && !m && // @ts-ignore
|
|
1492
|
-
/* @__PURE__ */ a("span", { style: e === "right" ?
|
|
1502
|
+
/* @__PURE__ */ a("span", { style: e === "right" ? M : j, children: o })
|
|
1493
1503
|
}
|
|
1494
1504
|
),
|
|
1495
1505
|
/* @__PURE__ */ a(
|
|
1496
1506
|
"div",
|
|
1497
1507
|
{
|
|
1498
|
-
onMouseLeave:
|
|
1508
|
+
onMouseLeave: b,
|
|
1499
1509
|
style: {
|
|
1500
1510
|
width: c || m ? n : "0px",
|
|
1501
1511
|
height: "100%",
|
|
@@ -1517,7 +1527,7 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1517
1527
|
},
|
|
1518
1528
|
children: [
|
|
1519
1529
|
/* @__PURE__ */ a("span", { children: i }),
|
|
1520
|
-
/* @__PURE__ */ a(ne, { onClick:
|
|
1530
|
+
/* @__PURE__ */ a(ne, { onClick: y, children: m ? /* @__PURE__ */ a(de, { size: 16 }) : /* @__PURE__ */ a(ce, { size: 16 }) })
|
|
1521
1531
|
]
|
|
1522
1532
|
}
|
|
1523
1533
|
),
|
|
@@ -1528,7 +1538,7 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1528
1538
|
]
|
|
1529
1539
|
}
|
|
1530
1540
|
);
|
|
1531
|
-
},
|
|
1541
|
+
}, Ye = ({
|
|
1532
1542
|
panels: t,
|
|
1533
1543
|
initialLayout: i,
|
|
1534
1544
|
onChange: o,
|
|
@@ -1536,27 +1546,27 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1536
1546
|
zeroStateView: u,
|
|
1537
1547
|
resize: d = { minimumPaneSizePercentage: 10 },
|
|
1538
1548
|
style: r,
|
|
1539
|
-
className:
|
|
1549
|
+
className: p,
|
|
1540
1550
|
height: e,
|
|
1541
1551
|
width: l
|
|
1542
1552
|
}) => {
|
|
1543
|
-
const { colorScheme:
|
|
1544
|
-
(
|
|
1545
|
-
const g = t[
|
|
1553
|
+
const { colorScheme: z } = re(), s = z === "dark", f = Ht(
|
|
1554
|
+
(w, c) => {
|
|
1555
|
+
const g = t[w];
|
|
1546
1556
|
if (!g)
|
|
1547
1557
|
return /* @__PURE__ */ F("div", { children: [
|
|
1548
1558
|
"Panel not found: ",
|
|
1549
|
-
|
|
1559
|
+
w
|
|
1550
1560
|
] });
|
|
1551
|
-
const
|
|
1561
|
+
const y = g.closable !== !1, S = /* @__PURE__ */ F("span", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
1552
1562
|
g.icon && /* @__PURE__ */ a("span", { style: { display: "inline-flex" }, children: g.icon }),
|
|
1553
1563
|
/* @__PURE__ */ a("span", { children: g.title })
|
|
1554
|
-
] }),
|
|
1555
|
-
g.toolbarControls &&
|
|
1564
|
+
] }), b = [];
|
|
1565
|
+
g.toolbarControls && b.push(...g.toolbarControls), y && b.push(
|
|
1556
1566
|
/* @__PURE__ */ a(
|
|
1557
1567
|
"button",
|
|
1558
1568
|
{
|
|
1559
|
-
onClick: () => n?.(
|
|
1569
|
+
onClick: () => n?.(w),
|
|
1560
1570
|
title: "Close",
|
|
1561
1571
|
style: {
|
|
1562
1572
|
background: "none",
|
|
@@ -1572,14 +1582,14 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1572
1582
|
"close"
|
|
1573
1583
|
)
|
|
1574
1584
|
);
|
|
1575
|
-
const
|
|
1585
|
+
const M = typeof g.component == "function" ? g.component() : g.component;
|
|
1576
1586
|
return /* @__PURE__ */ a(
|
|
1577
1587
|
he,
|
|
1578
1588
|
{
|
|
1579
1589
|
path: c,
|
|
1580
1590
|
title: S,
|
|
1581
|
-
toolbarControls:
|
|
1582
|
-
children:
|
|
1591
|
+
toolbarControls: b.length > 0 ? b : void 0,
|
|
1592
|
+
children: M
|
|
1583
1593
|
}
|
|
1584
1594
|
);
|
|
1585
1595
|
},
|
|
@@ -1590,20 +1600,20 @@ const vi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i,
|
|
|
1590
1600
|
width: l ?? "100%",
|
|
1591
1601
|
...r
|
|
1592
1602
|
};
|
|
1593
|
-
return /* @__PURE__ */ a("div", { style: m, className:
|
|
1603
|
+
return /* @__PURE__ */ a("div", { style: m, className: p, children: /* @__PURE__ */ a(
|
|
1594
1604
|
ue,
|
|
1595
1605
|
{
|
|
1596
1606
|
renderTile: f,
|
|
1597
1607
|
value: i,
|
|
1598
|
-
onChange: (
|
|
1608
|
+
onChange: (w) => o?.(w ?? null),
|
|
1599
1609
|
zeroStateView: u || void 0,
|
|
1600
1610
|
resize: d,
|
|
1601
1611
|
className: s ? "mosaic-blueprint-theme bp4-dark" : "mosaic-blueprint-theme"
|
|
1602
1612
|
}
|
|
1603
1613
|
) });
|
|
1604
1614
|
};
|
|
1605
|
-
|
|
1606
|
-
const
|
|
1615
|
+
Ye.displayName = "ArchbaseMosaicLayout";
|
|
1616
|
+
const Ke = ({
|
|
1607
1617
|
children: t,
|
|
1608
1618
|
id: i,
|
|
1609
1619
|
defaultSize: o,
|
|
@@ -1611,11 +1621,11 @@ const Ye = ({
|
|
|
1611
1621
|
maxSize: u,
|
|
1612
1622
|
collapsible: d = !1,
|
|
1613
1623
|
collapsedSize: r = 0,
|
|
1614
|
-
order:
|
|
1624
|
+
order: p,
|
|
1615
1625
|
style: e,
|
|
1616
1626
|
className: l
|
|
1617
1627
|
}) => /* @__PURE__ */ a(
|
|
1618
|
-
|
|
1628
|
+
$t,
|
|
1619
1629
|
{
|
|
1620
1630
|
id: i,
|
|
1621
1631
|
defaultSize: o,
|
|
@@ -1623,14 +1633,14 @@ const Ye = ({
|
|
|
1623
1633
|
maxSize: u,
|
|
1624
1634
|
collapsible: d,
|
|
1625
1635
|
collapsedSize: r,
|
|
1626
|
-
order:
|
|
1636
|
+
order: p,
|
|
1627
1637
|
style: e,
|
|
1628
1638
|
className: l,
|
|
1629
1639
|
children: t
|
|
1630
1640
|
}
|
|
1631
1641
|
);
|
|
1632
|
-
|
|
1633
|
-
const
|
|
1642
|
+
Ke.displayName = "ArchbaseResizablePanel";
|
|
1643
|
+
const Yt = ({
|
|
1634
1644
|
direction: t = "horizontal",
|
|
1635
1645
|
size: i = 4,
|
|
1636
1646
|
className: o,
|
|
@@ -1649,7 +1659,7 @@ const Zt = ({
|
|
|
1649
1659
|
flexDirection: u ? "row" : "column",
|
|
1650
1660
|
alignItems: "center",
|
|
1651
1661
|
justifyContent: "center"
|
|
1652
|
-
},
|
|
1662
|
+
}, p = {
|
|
1653
1663
|
width: 3,
|
|
1654
1664
|
height: 3,
|
|
1655
1665
|
borderRadius: "50%",
|
|
@@ -1657,20 +1667,20 @@ const Zt = ({
|
|
|
1657
1667
|
transition: "background-color 150ms ease"
|
|
1658
1668
|
};
|
|
1659
1669
|
return /* @__PURE__ */ a(
|
|
1660
|
-
|
|
1670
|
+
qt,
|
|
1661
1671
|
{
|
|
1662
1672
|
className: o,
|
|
1663
1673
|
style: d,
|
|
1664
1674
|
children: n && /* @__PURE__ */ F("span", { style: r, "aria-hidden": !0, children: [
|
|
1665
|
-
/* @__PURE__ */ a("span", { style:
|
|
1666
|
-
/* @__PURE__ */ a("span", { style:
|
|
1667
|
-
/* @__PURE__ */ a("span", { style:
|
|
1675
|
+
/* @__PURE__ */ a("span", { style: p }),
|
|
1676
|
+
/* @__PURE__ */ a("span", { style: p }),
|
|
1677
|
+
/* @__PURE__ */ a("span", { style: p })
|
|
1668
1678
|
] })
|
|
1669
1679
|
}
|
|
1670
1680
|
);
|
|
1671
1681
|
};
|
|
1672
|
-
|
|
1673
|
-
const
|
|
1682
|
+
Yt.displayName = "ArchbaseResizableHandle";
|
|
1683
|
+
const Qe = ({
|
|
1674
1684
|
direction: t = "horizontal",
|
|
1675
1685
|
panels: i,
|
|
1676
1686
|
onLayout: o,
|
|
@@ -1678,18 +1688,18 @@ const Ke = ({
|
|
|
1678
1688
|
handleSize: u = 4,
|
|
1679
1689
|
handleClassName: d,
|
|
1680
1690
|
showHandleGrip: r = !0,
|
|
1681
|
-
style:
|
|
1691
|
+
style: p,
|
|
1682
1692
|
className: e,
|
|
1683
1693
|
height: l,
|
|
1684
|
-
width:
|
|
1694
|
+
width: z
|
|
1685
1695
|
}) => {
|
|
1686
1696
|
const s = {
|
|
1687
1697
|
height: l ?? "100%",
|
|
1688
|
-
width:
|
|
1689
|
-
...
|
|
1698
|
+
width: z ?? "100%",
|
|
1699
|
+
...p
|
|
1690
1700
|
};
|
|
1691
1701
|
return /* @__PURE__ */ a(
|
|
1692
|
-
|
|
1702
|
+
Vt,
|
|
1693
1703
|
{
|
|
1694
1704
|
direction: t,
|
|
1695
1705
|
onLayout: o,
|
|
@@ -1698,7 +1708,7 @@ const Ke = ({
|
|
|
1698
1708
|
className: e,
|
|
1699
1709
|
children: i.map((f, m) => /* @__PURE__ */ F(W.Fragment, { children: [
|
|
1700
1710
|
/* @__PURE__ */ a(
|
|
1701
|
-
|
|
1711
|
+
$t,
|
|
1702
1712
|
{
|
|
1703
1713
|
id: f.id,
|
|
1704
1714
|
defaultSize: f.defaultSize,
|
|
@@ -1711,7 +1721,7 @@ const Ke = ({
|
|
|
1711
1721
|
}
|
|
1712
1722
|
),
|
|
1713
1723
|
m < i.length - 1 && /* @__PURE__ */ a(
|
|
1714
|
-
|
|
1724
|
+
Yt,
|
|
1715
1725
|
{
|
|
1716
1726
|
direction: t,
|
|
1717
1727
|
size: u,
|
|
@@ -1723,8 +1733,8 @@ const Ke = ({
|
|
|
1723
1733
|
}
|
|
1724
1734
|
);
|
|
1725
1735
|
};
|
|
1726
|
-
|
|
1727
|
-
function
|
|
1736
|
+
Qe.displayName = "ArchbaseResizableLayout";
|
|
1737
|
+
function ti({
|
|
1728
1738
|
components: t,
|
|
1729
1739
|
defaultLayout: i,
|
|
1730
1740
|
watermark: o,
|
|
@@ -1732,76 +1742,76 @@ function Qe({
|
|
|
1732
1742
|
autoHideHeaders: u = !1,
|
|
1733
1743
|
onLayoutChange: d,
|
|
1734
1744
|
onPanelClose: r,
|
|
1735
|
-
onPanelOpen:
|
|
1745
|
+
onPanelOpen: p,
|
|
1736
1746
|
style: e,
|
|
1737
1747
|
className: l,
|
|
1738
|
-
height:
|
|
1748
|
+
height: z = "600px",
|
|
1739
1749
|
disabled: s = !1
|
|
1740
1750
|
}) {
|
|
1741
|
-
const { t: f } =
|
|
1751
|
+
const { t: f } = Ft(), m = ot(null), w = Wt(() => {
|
|
1742
1752
|
const g = {};
|
|
1743
|
-
for (const
|
|
1744
|
-
g[
|
|
1745
|
-
|
|
1753
|
+
for (const y of Object.values(t))
|
|
1754
|
+
g[y.id] = (S) => /* @__PURE__ */ a(
|
|
1755
|
+
ei,
|
|
1746
1756
|
{
|
|
1747
|
-
component:
|
|
1757
|
+
component: y,
|
|
1748
1758
|
api: S.api,
|
|
1749
|
-
onClose: () => r?.(
|
|
1759
|
+
onClose: () => r?.(y.id)
|
|
1750
1760
|
}
|
|
1751
1761
|
);
|
|
1752
1762
|
return g;
|
|
1753
|
-
}, [t, r]), c =
|
|
1763
|
+
}, [t, r]), c = Ht((g) => {
|
|
1754
1764
|
if (m.current = g.api, i && typeof i != "string")
|
|
1755
1765
|
try {
|
|
1756
1766
|
g.api.fromJSON(i);
|
|
1757
|
-
} catch (
|
|
1758
|
-
console.warn("Failed to load default layout:",
|
|
1767
|
+
} catch (y) {
|
|
1768
|
+
console.warn("Failed to load default layout:", y);
|
|
1759
1769
|
}
|
|
1760
1770
|
if (!i && Object.keys(t).length > 0) {
|
|
1761
|
-
const
|
|
1771
|
+
const y = Object.values(t)[0];
|
|
1762
1772
|
try {
|
|
1763
1773
|
g.api.addPanel({
|
|
1764
|
-
id:
|
|
1765
|
-
component:
|
|
1766
|
-
title:
|
|
1774
|
+
id: y.id,
|
|
1775
|
+
component: y.id,
|
|
1776
|
+
title: y.title
|
|
1767
1777
|
});
|
|
1768
1778
|
} catch (S) {
|
|
1769
1779
|
console.warn("Failed to add initial panel:", S);
|
|
1770
1780
|
}
|
|
1771
1781
|
}
|
|
1772
1782
|
}, [i, t]);
|
|
1773
|
-
return
|
|
1783
|
+
return et(() => {
|
|
1774
1784
|
if (!m.current)
|
|
1775
1785
|
return;
|
|
1776
1786
|
const g = [];
|
|
1777
1787
|
if (d) {
|
|
1778
|
-
const
|
|
1788
|
+
const y = m.current.onDidLayoutChange(() => {
|
|
1779
1789
|
d(m.current.toJSON());
|
|
1780
1790
|
});
|
|
1781
|
-
g.push(
|
|
1791
|
+
g.push(y);
|
|
1782
1792
|
}
|
|
1783
1793
|
if (r) {
|
|
1784
|
-
const
|
|
1794
|
+
const y = m.current.onDidRemovePanel((S) => {
|
|
1785
1795
|
r(S.panel.id);
|
|
1786
1796
|
});
|
|
1787
|
-
g.push(
|
|
1797
|
+
g.push(y);
|
|
1788
1798
|
}
|
|
1789
1799
|
return () => {
|
|
1790
|
-
g.forEach((
|
|
1800
|
+
g.forEach((y) => y.dispose());
|
|
1791
1801
|
};
|
|
1792
1802
|
}, [d, r]), /* @__PURE__ */ a(
|
|
1793
1803
|
"div",
|
|
1794
1804
|
{
|
|
1795
1805
|
style: {
|
|
1796
1806
|
width: "100%",
|
|
1797
|
-
height:
|
|
1807
|
+
height: z,
|
|
1798
1808
|
...e
|
|
1799
1809
|
},
|
|
1800
1810
|
className: l,
|
|
1801
1811
|
children: /* @__PURE__ */ a(
|
|
1802
1812
|
fe,
|
|
1803
1813
|
{
|
|
1804
|
-
components:
|
|
1814
|
+
components: w,
|
|
1805
1815
|
onReady: c,
|
|
1806
1816
|
hideBorders: n,
|
|
1807
1817
|
watermarkComponent: o ? () => /* @__PURE__ */ a("div", { style: {
|
|
@@ -1818,7 +1828,7 @@ function Qe({
|
|
|
1818
1828
|
}
|
|
1819
1829
|
);
|
|
1820
1830
|
}
|
|
1821
|
-
function
|
|
1831
|
+
function ei({ component: t, api: i, onClose: o }) {
|
|
1822
1832
|
const n = t.component;
|
|
1823
1833
|
return /* @__PURE__ */ a("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ a(
|
|
1824
1834
|
n,
|
|
@@ -1829,7 +1839,7 @@ function ti({ component: t, api: i, onClose: o }) {
|
|
|
1829
1839
|
}
|
|
1830
1840
|
) });
|
|
1831
1841
|
}
|
|
1832
|
-
function
|
|
1842
|
+
function Bi({
|
|
1833
1843
|
preset: t,
|
|
1834
1844
|
components: i = {},
|
|
1835
1845
|
onPanelClose: o,
|
|
@@ -1838,12 +1848,12 @@ function Li({
|
|
|
1838
1848
|
className: d,
|
|
1839
1849
|
height: r
|
|
1840
1850
|
}) {
|
|
1841
|
-
const { layout:
|
|
1851
|
+
const { layout: p, components: e } = Wt(() => ii(t, i), [t, i]);
|
|
1842
1852
|
return /* @__PURE__ */ a(
|
|
1843
|
-
|
|
1853
|
+
ti,
|
|
1844
1854
|
{
|
|
1845
1855
|
components: e,
|
|
1846
|
-
defaultLayout:
|
|
1856
|
+
defaultLayout: p,
|
|
1847
1857
|
onPanelClose: o,
|
|
1848
1858
|
onPanelOpen: n,
|
|
1849
1859
|
style: u,
|
|
@@ -1852,9 +1862,9 @@ function Li({
|
|
|
1852
1862
|
}
|
|
1853
1863
|
);
|
|
1854
1864
|
}
|
|
1855
|
-
function
|
|
1865
|
+
function ii(t, i) {
|
|
1856
1866
|
const o = {
|
|
1857
|
-
...
|
|
1867
|
+
...oi(),
|
|
1858
1868
|
...i
|
|
1859
1869
|
};
|
|
1860
1870
|
let n;
|
|
@@ -1863,20 +1873,20 @@ function ei(t, i) {
|
|
|
1863
1873
|
n = Pt(o);
|
|
1864
1874
|
break;
|
|
1865
1875
|
case "ide":
|
|
1866
|
-
n =
|
|
1876
|
+
n = ni(o);
|
|
1867
1877
|
break;
|
|
1868
1878
|
case "explorer":
|
|
1869
|
-
n =
|
|
1879
|
+
n = ri(o);
|
|
1870
1880
|
break;
|
|
1871
1881
|
case "analytics":
|
|
1872
|
-
n =
|
|
1882
|
+
n = si(o);
|
|
1873
1883
|
break;
|
|
1874
1884
|
default:
|
|
1875
1885
|
n = Pt(o);
|
|
1876
1886
|
}
|
|
1877
1887
|
return { layout: n, components: o };
|
|
1878
1888
|
}
|
|
1879
|
-
function
|
|
1889
|
+
function oi() {
|
|
1880
1890
|
return {
|
|
1881
1891
|
// Dashboard
|
|
1882
1892
|
overview: {
|
|
@@ -2012,7 +2022,7 @@ function Pt(t) {
|
|
|
2012
2022
|
}
|
|
2013
2023
|
};
|
|
2014
2024
|
}
|
|
2015
|
-
function
|
|
2025
|
+
function ni(t) {
|
|
2016
2026
|
return {
|
|
2017
2027
|
root: {
|
|
2018
2028
|
type: "branch",
|
|
@@ -2093,7 +2103,7 @@ function oi(t) {
|
|
|
2093
2103
|
}
|
|
2094
2104
|
};
|
|
2095
2105
|
}
|
|
2096
|
-
function
|
|
2106
|
+
function ri(t) {
|
|
2097
2107
|
return {
|
|
2098
2108
|
root: {
|
|
2099
2109
|
type: "branch",
|
|
@@ -2124,7 +2134,7 @@ function ni(t) {
|
|
|
2124
2134
|
}
|
|
2125
2135
|
};
|
|
2126
2136
|
}
|
|
2127
|
-
function
|
|
2137
|
+
function si(t) {
|
|
2128
2138
|
return {
|
|
2129
2139
|
root: {
|
|
2130
2140
|
type: "branch",
|
|
@@ -2178,24 +2188,24 @@ function ri(t) {
|
|
|
2178
2188
|
};
|
|
2179
2189
|
}
|
|
2180
2190
|
export {
|
|
2181
|
-
|
|
2182
|
-
|
|
2191
|
+
x as AnchorType,
|
|
2192
|
+
Ti as ArchbaseAdvancedTabs,
|
|
2183
2193
|
Mi as ArchbaseCard,
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2194
|
+
Ii as ArchbaseContainer,
|
|
2195
|
+
ti as ArchbaseDockLayout,
|
|
2196
|
+
Bi as ArchbaseDockLayoutPreset,
|
|
2197
|
+
Li as ArchbaseDockableContainer,
|
|
2198
|
+
Ci as ArchbaseFloatingWindow,
|
|
2199
|
+
wi as ArchbaseForm,
|
|
2200
|
+
Oi as ArchbaseGroup,
|
|
2201
|
+
Ye as ArchbaseMosaicLayout,
|
|
2202
|
+
Yt as ArchbaseResizableHandle,
|
|
2203
|
+
Qe as ArchbaseResizableLayout,
|
|
2204
|
+
Ke as ArchbaseResizablePanel,
|
|
2205
|
+
Ee as ArchbaseSpaceBottom,
|
|
2206
|
+
Pe as ArchbaseSpaceBottomResizable,
|
|
2207
|
+
Be as ArchbaseSpaceCentered,
|
|
2208
|
+
$e as ArchbaseSpaceCenteredVertically,
|
|
2199
2209
|
We as ArchbaseSpaceCustom,
|
|
2200
2210
|
Fe as ArchbaseSpaceFill,
|
|
2201
2211
|
Ve as ArchbaseSpaceFixed,
|
|
@@ -2203,23 +2213,23 @@ export {
|
|
|
2203
2213
|
qe as ArchbaseSpaceLayer,
|
|
2204
2214
|
Oe as ArchbaseSpaceLeft,
|
|
2205
2215
|
Ie as ArchbaseSpaceLeftResizable,
|
|
2206
|
-
|
|
2216
|
+
Si as ArchbaseSpaceOptions,
|
|
2207
2217
|
Ue as ArchbaseSpacePositioned,
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2218
|
+
Ne as ArchbaseSpaceRight,
|
|
2219
|
+
_e as ArchbaseSpaceRightResizable,
|
|
2220
|
+
ke as ArchbaseSpaceTop,
|
|
2211
2221
|
De as ArchbaseSpaceTopResizable,
|
|
2212
2222
|
Xe as ArchbaseSpaceViewPort,
|
|
2213
2223
|
xi as ArchbaseSplitPane,
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2224
|
+
Ai as ArchbaseSplitPanePane,
|
|
2225
|
+
Ze as ArchbaseSplitPaneResizer,
|
|
2226
|
+
Di as ArchbaseStack,
|
|
2227
|
+
lt as CenterType,
|
|
2228
|
+
st as ResizeHandlePlacement,
|
|
2229
|
+
v as ResizeType,
|
|
2230
|
+
L as Type,
|
|
2221
2231
|
Tt as anchoredProps,
|
|
2222
|
-
|
|
2232
|
+
vi as enabledSsrSupport,
|
|
2223
2233
|
St as resizableProps,
|
|
2224
|
-
|
|
2234
|
+
yi as useArchbaseCurrentSpace
|
|
2225
2235
|
};
|