@nice2dev/ui-3d 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/i18n.js +3 -3
- package/dist/cjs/dance/DanceBridge.js +13 -13
- package/dist/cjs/dance/DanceScoreEngine.js +8 -8
- package/dist/cjs/dance/PoseDetector.js +20 -20
- package/dist/cjs/material/NiceMaterialEditor.js +19 -19
- package/dist/cjs/model/ModelEditorLeftPanel.js +5 -5
- package/dist/cjs/model/ModelEditorMenuBar.js +6 -6
- package/dist/cjs/model/ModelEditorRightPanel.js +19 -19
- package/dist/cjs/model/ModelEditorSubComponents.js +10 -10
- package/dist/cjs/model/ModelEditorTimeline.js +6 -6
- package/dist/cjs/model/ModelEditorToolbar.js +4 -4
- package/dist/cjs/model/ModelEditorViewport.js +2 -2
- package/dist/cjs/model/ModelViewer.js +14 -14
- package/dist/cjs/model/NiceArmatureEditor.js +18 -18
- package/dist/cjs/model/NiceMorphTargetEditor.js +18 -18
- package/dist/cjs/model/NiceOctree.js +16 -16
- package/dist/cjs/model/NicePhysicsSimulation.js +24 -24
- package/dist/cjs/model/NiceProceduralGeometry.js +8 -8
- package/dist/cjs/model/NiceTerrainEditor.js +19 -19
- package/dist/cjs/model/NiceWeightPainter.js +14 -14
- package/dist/cjs/model/NiceXRPreview.js +18 -18
- package/dist/cjs/model/useModelEditor.js +127 -127
- package/dist/cjs/model/useModelViewer.js +61 -61
- package/dist/cjs/particle/NiceParticleEditor.js +11 -11
- package/dist/cjs/rendering/NiceCascadedShadows.js +12 -12
- package/dist/cjs/rendering/NiceRenderExport.js +5 -5
- package/dist/cjs/rendering/NiceSSAO.js +18 -18
- package/dist/cjs/rendering/NiceSSR.js +14 -14
- package/dist/cjs/rendering/NiceWebGPURenderer.js +21 -21
- package/dist/cjs/ui/dist/NiceButton-D9l39Rs7.js +598 -0
- package/dist/cjs/ui/dist/NiceButton-D9l39Rs7.js.map +1 -0
- package/dist/cjs/ui/dist/NiceErrorBoundary-niMx1aSJ.js +647 -0
- package/dist/cjs/ui/dist/NiceErrorBoundary-niMx1aSJ.js.map +1 -0
- package/dist/cjs/ui/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5048 -0
- package/dist/cjs/ui/dist/NiceModuleLifecyclePanel-I_TXRiiY.js.map +1 -0
- package/dist/cjs/ui/dist/NicePinCodeInput-CrMfdxxc.js +13081 -0
- package/dist/cjs/ui/dist/NicePinCodeInput-CrMfdxxc.js.map +1 -0
- package/dist/cjs/ui/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6054 -0
- package/dist/cjs/ui/dist/NiceSavedQueryPanel-CUAsdOjJ.js.map +1 -0
- package/dist/cjs/ui/dist/NiceToggle-CaY1u82g.js +280 -0
- package/dist/cjs/ui/dist/NiceToggle-CaY1u82g.js.map +1 -0
- package/dist/cjs/ui/dist/NiceWindow-SiCaREbq.js +806 -0
- package/dist/cjs/ui/dist/NiceWindow-SiCaREbq.js.map +1 -0
- package/dist/cjs/ui/dist/charts-Bx_kNBsE.js +3508 -0
- package/dist/cjs/ui/dist/charts-Bx_kNBsE.js.map +1 -0
- package/dist/cjs/ui/dist/core-BpghV7Ls.js +10249 -0
- package/dist/cjs/ui/dist/core-BpghV7Ls.js.map +1 -0
- package/dist/cjs/ui/dist/index-CIl98Vbm.js +40039 -0
- package/dist/cjs/ui/dist/index-CIl98Vbm.js.map +1 -0
- package/dist/cjs/uv/NiceUVEditor.js +24 -24
- package/dist/esm/model/ModelEditorLeftPanel.js +4 -4
- package/dist/esm/model/ModelEditorMenuBar.js +4 -4
- package/dist/esm/model/ModelEditorRightPanel.js +5 -5
- package/dist/esm/model/ModelEditorSubComponents.js +2 -2
- package/dist/esm/model/ModelEditorTimeline.js +5 -5
- package/dist/esm/model/ModelEditorToolbar.js +3 -3
- package/dist/esm/model/ModelEditorViewport.js +2 -2
- package/dist/esm/model/ModelViewer.js +2 -2
- package/dist/esm/ui/dist/NiceButton-D9l39Rs7.js +593 -0
- package/dist/esm/ui/dist/NiceButton-D9l39Rs7.js.map +1 -0
- package/dist/esm/ui/dist/NiceErrorBoundary-niMx1aSJ.js +637 -0
- package/dist/esm/ui/dist/NiceErrorBoundary-niMx1aSJ.js.map +1 -0
- package/dist/esm/ui/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5007 -0
- package/dist/esm/ui/dist/NiceModuleLifecyclePanel-I_TXRiiY.js.map +1 -0
- package/dist/esm/ui/dist/NicePinCodeInput-CrMfdxxc.js +13011 -0
- package/dist/esm/ui/dist/NicePinCodeInput-CrMfdxxc.js.map +1 -0
- package/dist/esm/ui/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6037 -0
- package/dist/esm/ui/dist/NiceSavedQueryPanel-CUAsdOjJ.js.map +1 -0
- package/dist/esm/ui/dist/NiceToggle-CaY1u82g.js +276 -0
- package/dist/esm/ui/dist/NiceToggle-CaY1u82g.js.map +1 -0
- package/dist/esm/ui/dist/NiceWindow-SiCaREbq.js +795 -0
- package/dist/esm/ui/dist/NiceWindow-SiCaREbq.js.map +1 -0
- package/dist/esm/ui/dist/charts-Bx_kNBsE.js +3483 -0
- package/dist/esm/ui/dist/charts-Bx_kNBsE.js.map +1 -0
- package/dist/esm/ui/dist/core-BpghV7Ls.js +10071 -0
- package/dist/esm/ui/dist/core-BpghV7Ls.js.map +1 -0
- package/dist/esm/ui/dist/index-CIl98Vbm.js +39917 -0
- package/dist/esm/ui/dist/index-CIl98Vbm.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { g as de, b as ys, f as ei, i as cl } from './core-BpghV7Ls.js';
|
|
3
|
+
import { useState, useRef, forwardRef, useCallback, useEffect, createContext } from 'react';
|
|
4
|
+
|
|
5
|
+
const Mt = ({
|
|
6
|
+
visible: e,
|
|
7
|
+
onClose: n,
|
|
8
|
+
title: i,
|
|
9
|
+
items: r,
|
|
10
|
+
showCancelButton: m = true,
|
|
11
|
+
cancelText: a,
|
|
12
|
+
className: h,
|
|
13
|
+
style: w
|
|
14
|
+
}) => {
|
|
15
|
+
const { t: p } = de();
|
|
16
|
+
return e ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx("div", { className: "nice-actionsheet__overlay", onClick: n }),
|
|
18
|
+
/* @__PURE__ */ jsxs("div", { className: `nice-actionsheet ${h || ""}`, style: w, children: [
|
|
19
|
+
i && /* @__PURE__ */ jsx("div", { className: "nice-actionsheet__title", children: i }),
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "nice-actionsheet__items", children: r.map((N, s) => /* @__PURE__ */ jsxs(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
className: `nice-actionsheet__item ${N.type === "danger" ? "nice-actionsheet__item--danger" : ""}`,
|
|
24
|
+
disabled: N.disabled,
|
|
25
|
+
onClick: () => {
|
|
26
|
+
N.onClick?.(), n();
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
N.icon && /* @__PURE__ */ jsx("span", { className: "nice-actionsheet__icon", children: N.icon }),
|
|
30
|
+
N.text
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
s
|
|
34
|
+
)) }),
|
|
35
|
+
m && /* @__PURE__ */ jsx("button", { className: "nice-actionsheet__cancel", onClick: n, children: a || p("cancel", "Cancel") })
|
|
36
|
+
] })
|
|
37
|
+
] }) : null;
|
|
38
|
+
}, St = ({
|
|
39
|
+
visible: e,
|
|
40
|
+
onClose: n,
|
|
41
|
+
targetRef: i,
|
|
42
|
+
position: r = "bottom",
|
|
43
|
+
title: m,
|
|
44
|
+
showArrow: a = true,
|
|
45
|
+
width: h,
|
|
46
|
+
children: w,
|
|
47
|
+
className: p,
|
|
48
|
+
style: N,
|
|
49
|
+
displayStyle: s
|
|
50
|
+
}) => {
|
|
51
|
+
cl("tooltip", s);
|
|
52
|
+
const k = useRef(null), [L, d] = useState({ top: 0, left: 0 }), A = useCallback(() => {
|
|
53
|
+
const _ = i.current, $ = k.current;
|
|
54
|
+
if (!_ || !$)
|
|
55
|
+
return;
|
|
56
|
+
const c = _.getBoundingClientRect(), v = $.getBoundingClientRect();
|
|
57
|
+
let u = 0, I = 0;
|
|
58
|
+
const R = 8;
|
|
59
|
+
switch (r) {
|
|
60
|
+
case "top":
|
|
61
|
+
u = c.top - v.height - R, I = c.left + (c.width - v.width) / 2;
|
|
62
|
+
break;
|
|
63
|
+
case "bottom":
|
|
64
|
+
u = c.bottom + R, I = c.left + (c.width - v.width) / 2;
|
|
65
|
+
break;
|
|
66
|
+
case "left":
|
|
67
|
+
u = c.top + (c.height - v.height) / 2, I = c.left - v.width - R;
|
|
68
|
+
break;
|
|
69
|
+
case "right":
|
|
70
|
+
u = c.top + (c.height - v.height) / 2, I = c.right + R;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
d({ top: u + window.scrollY, left: I + window.scrollX });
|
|
74
|
+
}, [i, r]);
|
|
75
|
+
return useEffect(() => {
|
|
76
|
+
if (e) {
|
|
77
|
+
requestAnimationFrame(A);
|
|
78
|
+
const _ = ($) => {
|
|
79
|
+
k.current && !k.current.contains($.target) && i.current && !i.current.contains($.target) && n();
|
|
80
|
+
};
|
|
81
|
+
return document.addEventListener("mousedown", _), () => document.removeEventListener("mousedown", _);
|
|
82
|
+
}
|
|
83
|
+
}, [e, A, n, i]), e ? /* @__PURE__ */ jsxs(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
ref: k,
|
|
87
|
+
className: `nice-popover nice-popover--${r} ${p || ""}`,
|
|
88
|
+
style: { ...N, position: "absolute", top: L.top, left: L.left, width: h },
|
|
89
|
+
children: [
|
|
90
|
+
a && /* @__PURE__ */ jsx("div", { className: `nice-popover__arrow nice-popover__arrow--${r}` }),
|
|
91
|
+
m && /* @__PURE__ */ jsx("div", { className: "nice-popover__title", children: m }),
|
|
92
|
+
/* @__PURE__ */ jsx("div", { className: "nice-popover__content", children: w })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
) : null;
|
|
96
|
+
}, Rt = ({
|
|
97
|
+
visible: e,
|
|
98
|
+
message: n,
|
|
99
|
+
container: i,
|
|
100
|
+
showIndicator: r = true,
|
|
101
|
+
shading: m = true,
|
|
102
|
+
className: a,
|
|
103
|
+
style: h
|
|
104
|
+
}) => {
|
|
105
|
+
const { t: w } = de();
|
|
106
|
+
if (!e)
|
|
107
|
+
return null;
|
|
108
|
+
const p = !!i?.current, N = /* @__PURE__ */ jsxs("div", { className: `nice-loadpanel ${a || ""}`, style: h, children: [
|
|
109
|
+
m && /* @__PURE__ */ jsx("div", { className: "nice-loadpanel__shade" }),
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { className: "nice-loadpanel__box", children: [
|
|
111
|
+
r && /* @__PURE__ */ jsx("div", { className: "nice-spinner nice-spinner--md" }),
|
|
112
|
+
/* @__PURE__ */ jsx("span", { className: "nice-loadpanel__text", children: n || w("loading", "Loading...") })
|
|
113
|
+
] })
|
|
114
|
+
] });
|
|
115
|
+
if (p && i.current) {
|
|
116
|
+
const s = i.current;
|
|
117
|
+
return s.style.position = s.style.position || "relative", N;
|
|
118
|
+
}
|
|
119
|
+
return N;
|
|
120
|
+
}, Lt = ({
|
|
121
|
+
direction: e = "row",
|
|
122
|
+
align: n,
|
|
123
|
+
justify: i,
|
|
124
|
+
wrap: r,
|
|
125
|
+
gap: m,
|
|
126
|
+
flex: a,
|
|
127
|
+
children: h,
|
|
128
|
+
className: w,
|
|
129
|
+
style: p
|
|
130
|
+
}) => /* @__PURE__ */ jsx(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: `nice-box ${w || ""}`,
|
|
134
|
+
style: {
|
|
135
|
+
display: "flex",
|
|
136
|
+
flexDirection: e,
|
|
137
|
+
alignItems: n,
|
|
138
|
+
justifyContent: i,
|
|
139
|
+
flexWrap: r ? "wrap" : void 0,
|
|
140
|
+
gap: m,
|
|
141
|
+
flex: a,
|
|
142
|
+
...p
|
|
143
|
+
},
|
|
144
|
+
children: h
|
|
145
|
+
}
|
|
146
|
+
), Tt = ({
|
|
147
|
+
direction: e = "row",
|
|
148
|
+
items: n,
|
|
149
|
+
gap: i,
|
|
150
|
+
className: r,
|
|
151
|
+
style: m
|
|
152
|
+
}) => /* @__PURE__ */ jsx(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
className: `nice-responsivebox ${r || ""}`,
|
|
156
|
+
style: { display: "flex", flexDirection: e, gap: i, ...m },
|
|
157
|
+
children: n.map((a, h) => /* @__PURE__ */ jsx(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
style: { flex: a.ratio ?? 1, flexBasis: a.baseSize, flexShrink: a.shrink ?? 1 },
|
|
161
|
+
children: a.children
|
|
162
|
+
},
|
|
163
|
+
h
|
|
164
|
+
))
|
|
165
|
+
}
|
|
166
|
+
), $t = ({
|
|
167
|
+
width: e = 200,
|
|
168
|
+
height: n = 200,
|
|
169
|
+
minWidth: i = 50,
|
|
170
|
+
minHeight: r = 50,
|
|
171
|
+
maxWidth: m = 1 / 0,
|
|
172
|
+
maxHeight: a = 1 / 0,
|
|
173
|
+
handles: h = ["right", "bottom", "bottomRight"],
|
|
174
|
+
onResize: w,
|
|
175
|
+
children: p,
|
|
176
|
+
className: N,
|
|
177
|
+
style: s
|
|
178
|
+
}) => {
|
|
179
|
+
const [k, L] = useState({ width: e, height: n }), d = useRef(null), A = (c, v) => {
|
|
180
|
+
v.preventDefault();
|
|
181
|
+
const u = v.clientX, I = v.clientY, R = k.width, X = k.height, t = (z) => {
|
|
182
|
+
const M = z.clientX - u, W = z.clientY - I;
|
|
183
|
+
let Y = R, l = X;
|
|
184
|
+
(c.includes("right") || c === "right") && (Y = R + M), (c.includes("bottom") || c === "bottom") && (l = X + W), (c.includes("left") || c === "left") && (Y = R - M), (c.includes("top") || c === "top") && (l = X - W), Y = Math.max(i, Math.min(m, Y)), l = Math.max(r, Math.min(a, l)), L({ width: Y, height: l }), w?.({ width: Y, height: l });
|
|
185
|
+
}, g = () => {
|
|
186
|
+
document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", g);
|
|
187
|
+
};
|
|
188
|
+
document.addEventListener("pointermove", t), document.addEventListener("pointerup", g);
|
|
189
|
+
}, _ = (c) => {
|
|
190
|
+
switch (c) {
|
|
191
|
+
case "top":
|
|
192
|
+
case "bottom":
|
|
193
|
+
return "ns-resize";
|
|
194
|
+
case "left":
|
|
195
|
+
case "right":
|
|
196
|
+
return "ew-resize";
|
|
197
|
+
case "topLeft":
|
|
198
|
+
case "bottomRight":
|
|
199
|
+
return "nwse-resize";
|
|
200
|
+
case "topRight":
|
|
201
|
+
case "bottomLeft":
|
|
202
|
+
return "nesw-resize";
|
|
203
|
+
default:
|
|
204
|
+
return "default";
|
|
205
|
+
}
|
|
206
|
+
}, $ = (c) => {
|
|
207
|
+
const v = { position: "absolute", zIndex: 1 }, u = 8;
|
|
208
|
+
return c === "right" ? {
|
|
209
|
+
...v,
|
|
210
|
+
top: 0,
|
|
211
|
+
right: -u / 2,
|
|
212
|
+
width: u,
|
|
213
|
+
height: "100%",
|
|
214
|
+
cursor: _(c)
|
|
215
|
+
} : c === "bottom" ? {
|
|
216
|
+
...v,
|
|
217
|
+
left: 0,
|
|
218
|
+
bottom: -u / 2,
|
|
219
|
+
width: "100%",
|
|
220
|
+
height: u,
|
|
221
|
+
cursor: _(c)
|
|
222
|
+
} : c === "left" ? { ...v, top: 0, left: -u / 2, width: u, height: "100%", cursor: _(c) } : c === "top" ? { ...v, top: -u / 2, left: 0, width: "100%", height: u, cursor: _(c) } : c === "bottomRight" ? {
|
|
223
|
+
...v,
|
|
224
|
+
bottom: -u / 2,
|
|
225
|
+
right: -u / 2,
|
|
226
|
+
width: u * 2,
|
|
227
|
+
height: u * 2,
|
|
228
|
+
cursor: _(c)
|
|
229
|
+
} : c === "bottomLeft" ? {
|
|
230
|
+
...v,
|
|
231
|
+
bottom: -u / 2,
|
|
232
|
+
left: -u / 2,
|
|
233
|
+
width: u * 2,
|
|
234
|
+
height: u * 2,
|
|
235
|
+
cursor: _(c)
|
|
236
|
+
} : c === "topRight" ? {
|
|
237
|
+
...v,
|
|
238
|
+
top: -u / 2,
|
|
239
|
+
right: -u / 2,
|
|
240
|
+
width: u * 2,
|
|
241
|
+
height: u * 2,
|
|
242
|
+
cursor: _(c)
|
|
243
|
+
} : c === "topLeft" ? {
|
|
244
|
+
...v,
|
|
245
|
+
top: -u / 2,
|
|
246
|
+
left: -u / 2,
|
|
247
|
+
width: u * 2,
|
|
248
|
+
height: u * 2,
|
|
249
|
+
cursor: _(c)
|
|
250
|
+
} : v;
|
|
251
|
+
};
|
|
252
|
+
return /* @__PURE__ */ jsxs(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
ref: d,
|
|
256
|
+
className: `nice-resizable ${N || ""}`,
|
|
257
|
+
style: {
|
|
258
|
+
...s,
|
|
259
|
+
width: k.width,
|
|
260
|
+
height: k.height,
|
|
261
|
+
position: "relative",
|
|
262
|
+
overflow: "hidden"
|
|
263
|
+
},
|
|
264
|
+
children: [
|
|
265
|
+
p,
|
|
266
|
+
h.map((c) => /* @__PURE__ */ jsx("div", { style: $(c), onPointerDown: (v) => A(c, v) }, c))
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}, Pt = ({
|
|
271
|
+
direction: e = "vertical",
|
|
272
|
+
showScrollbar: n = "onInteraction",
|
|
273
|
+
width: i,
|
|
274
|
+
height: r,
|
|
275
|
+
onScroll: m,
|
|
276
|
+
children: a,
|
|
277
|
+
className: h,
|
|
278
|
+
style: w
|
|
279
|
+
}) => {
|
|
280
|
+
const p = e === "horizontal" || e === "both" ? "auto" : "hidden", N = e === "vertical" || e === "both" ? "auto" : "hidden";
|
|
281
|
+
return /* @__PURE__ */ jsx(
|
|
282
|
+
"div",
|
|
283
|
+
{
|
|
284
|
+
className: `nice-scrollview ${n === "never" ? "nice-scrollview--hide-sb" : n === "always" ? "nice-scrollview--show-sb" : ""} ${h || ""}`,
|
|
285
|
+
style: { ...w, width: i, height: r, overflowX: p, overflowY: N },
|
|
286
|
+
onScroll: m,
|
|
287
|
+
children: a
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
};
|
|
291
|
+
createContext(null);
|
|
292
|
+
const wt = forwardRef(
|
|
293
|
+
({ blocked: e, message: n, children: i, className: r, style: m, id: a }, h) => {
|
|
294
|
+
const w = ys(a);
|
|
295
|
+
return /* @__PURE__ */ jsxs(
|
|
296
|
+
"div",
|
|
297
|
+
{
|
|
298
|
+
ref: h,
|
|
299
|
+
id: w,
|
|
300
|
+
className: `nice-block-ui ${r || ""}`,
|
|
301
|
+
style: { position: "relative", ...m },
|
|
302
|
+
children: [
|
|
303
|
+
i,
|
|
304
|
+
e && /* @__PURE__ */ jsx("div", { className: "nice-block-ui__overlay", "aria-busy": "true", role: "alert", children: n && /* @__PURE__ */ jsx("div", { className: "nice-block-ui__message", children: n }) })
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
wt.displayName = "NiceBlockUI";
|
|
311
|
+
const vt = forwardRef(
|
|
312
|
+
({
|
|
313
|
+
windows: e,
|
|
314
|
+
onChange: n,
|
|
315
|
+
onClose: i,
|
|
316
|
+
onFocus: r,
|
|
317
|
+
showTaskbar: m = true,
|
|
318
|
+
size: a = "md",
|
|
319
|
+
className: h,
|
|
320
|
+
style: w,
|
|
321
|
+
id: p,
|
|
322
|
+
...N
|
|
323
|
+
}, s) => {
|
|
324
|
+
const k = ys(p), { t: L } = de(), [d, A] = useState(null), _ = useRef(null), $ = Math.max(1, ...e.map((t) => t.zIndex ?? 1)), c = useCallback(
|
|
325
|
+
(t, g) => {
|
|
326
|
+
const z = e.map((M) => M.key === t ? { ...M, ...g } : M);
|
|
327
|
+
n?.(z);
|
|
328
|
+
},
|
|
329
|
+
[e, n]
|
|
330
|
+
), v = useCallback(
|
|
331
|
+
(t) => {
|
|
332
|
+
c(t, { zIndex: $ + 1 }), r?.(t);
|
|
333
|
+
},
|
|
334
|
+
[c, $, r]
|
|
335
|
+
), u = useCallback(
|
|
336
|
+
(t) => {
|
|
337
|
+
i?.(t), n?.(e.filter((g) => g.key !== t));
|
|
338
|
+
},
|
|
339
|
+
[e, n, i]
|
|
340
|
+
), I = useCallback(
|
|
341
|
+
(t) => {
|
|
342
|
+
const g = e.find((z) => z.key === t);
|
|
343
|
+
g && c(t, { minimized: !g.minimized, maximized: false });
|
|
344
|
+
},
|
|
345
|
+
[e, c]
|
|
346
|
+
), R = useCallback(
|
|
347
|
+
(t) => {
|
|
348
|
+
const g = e.find((z) => z.key === t);
|
|
349
|
+
g && c(t, { maximized: !g.maximized, minimized: false });
|
|
350
|
+
},
|
|
351
|
+
[e, c]
|
|
352
|
+
);
|
|
353
|
+
useEffect(() => {
|
|
354
|
+
if (!d)
|
|
355
|
+
return;
|
|
356
|
+
const t = (z) => {
|
|
357
|
+
const M = e.find((W) => W.key === d.key);
|
|
358
|
+
if (M)
|
|
359
|
+
if (d.mode === "move")
|
|
360
|
+
c(d.key, {
|
|
361
|
+
x: z.clientX - d.offsetX,
|
|
362
|
+
y: z.clientY - d.offsetY
|
|
363
|
+
});
|
|
364
|
+
else {
|
|
365
|
+
const Y = _.current?.getBoundingClientRect(), l = Y?.left ?? 0, E = Y?.top ?? 0;
|
|
366
|
+
c(d.key, {
|
|
367
|
+
width: Math.max(200, z.clientX - l - M.x),
|
|
368
|
+
height: Math.max(100, z.clientY - E - M.y)
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}, g = () => A(null);
|
|
372
|
+
return document.addEventListener("mousemove", t), document.addEventListener("mouseup", g), () => {
|
|
373
|
+
document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", g);
|
|
374
|
+
};
|
|
375
|
+
}, [d, e, c]);
|
|
376
|
+
const X = useCallback(
|
|
377
|
+
(t, g, z) => {
|
|
378
|
+
g.preventDefault();
|
|
379
|
+
const M = e.find((W) => W.key === t);
|
|
380
|
+
M && (v(t), A({
|
|
381
|
+
key: t,
|
|
382
|
+
offsetX: z === "move" ? g.clientX - M.x : 0,
|
|
383
|
+
offsetY: z === "move" ? g.clientY - M.y : 0,
|
|
384
|
+
mode: z
|
|
385
|
+
}));
|
|
386
|
+
},
|
|
387
|
+
[e, v]
|
|
388
|
+
);
|
|
389
|
+
return /* @__PURE__ */ jsxs(
|
|
390
|
+
"div",
|
|
391
|
+
{
|
|
392
|
+
ref: (t) => {
|
|
393
|
+
_.current = t, typeof s == "function" ? s(t) : s && (s.current = t);
|
|
394
|
+
},
|
|
395
|
+
id: k,
|
|
396
|
+
className: `nice-wm nice-wm--${a} ${h ?? ""}`,
|
|
397
|
+
style: { ...w, position: "relative", overflow: "hidden" },
|
|
398
|
+
...N,
|
|
399
|
+
children: [
|
|
400
|
+
e.map((t) => {
|
|
401
|
+
if (t.minimized)
|
|
402
|
+
return null;
|
|
403
|
+
const g = t.maximized, z = g ? {
|
|
404
|
+
position: "absolute",
|
|
405
|
+
top: 0,
|
|
406
|
+
left: 0,
|
|
407
|
+
width: "100%",
|
|
408
|
+
height: "100%",
|
|
409
|
+
zIndex: t.zIndex ?? 1
|
|
410
|
+
} : {
|
|
411
|
+
position: "absolute",
|
|
412
|
+
top: t.y,
|
|
413
|
+
left: t.x,
|
|
414
|
+
width: t.width,
|
|
415
|
+
height: t.height,
|
|
416
|
+
zIndex: t.zIndex ?? 1
|
|
417
|
+
};
|
|
418
|
+
return /* @__PURE__ */ jsxs(
|
|
419
|
+
"div",
|
|
420
|
+
{
|
|
421
|
+
className: `nice-wm__window ${g ? "nice-wm__window--maximized" : ""}`,
|
|
422
|
+
style: z,
|
|
423
|
+
onMouseDown: () => v(t.key),
|
|
424
|
+
role: "dialog",
|
|
425
|
+
"aria-label": t.title,
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ jsxs(
|
|
428
|
+
"div",
|
|
429
|
+
{
|
|
430
|
+
className: "nice-wm__titlebar",
|
|
431
|
+
onMouseDown: (M) => !g && X(t.key, M, "move"),
|
|
432
|
+
children: [
|
|
433
|
+
t.icon && /* @__PURE__ */ jsx("span", { className: "nice-wm__icon", children: t.icon }),
|
|
434
|
+
/* @__PURE__ */ jsx("span", { className: "nice-wm__title", children: t.title }),
|
|
435
|
+
/* @__PURE__ */ jsxs("div", { className: "nice-wm__controls", children: [
|
|
436
|
+
(t.minimizable ?? true) && /* @__PURE__ */ jsx(
|
|
437
|
+
"button",
|
|
438
|
+
{
|
|
439
|
+
type: "button",
|
|
440
|
+
className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--min",
|
|
441
|
+
onClick: () => I(t.key),
|
|
442
|
+
title: L("wm.minimize", "Minimize"),
|
|
443
|
+
children: "─"
|
|
444
|
+
}
|
|
445
|
+
),
|
|
446
|
+
(t.maximizable ?? true) && /* @__PURE__ */ jsx(
|
|
447
|
+
"button",
|
|
448
|
+
{
|
|
449
|
+
type: "button",
|
|
450
|
+
className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--max",
|
|
451
|
+
onClick: () => R(t.key),
|
|
452
|
+
title: L("wm.maximize", "Maximize"),
|
|
453
|
+
children: g ? "❐" : "☐"
|
|
454
|
+
}
|
|
455
|
+
),
|
|
456
|
+
(t.closable ?? true) && /* @__PURE__ */ jsx(
|
|
457
|
+
"button",
|
|
458
|
+
{
|
|
459
|
+
type: "button",
|
|
460
|
+
className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--close",
|
|
461
|
+
onClick: () => u(t.key),
|
|
462
|
+
title: L("wm.close", "Close"),
|
|
463
|
+
children: "✕"
|
|
464
|
+
}
|
|
465
|
+
)
|
|
466
|
+
] })
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
),
|
|
470
|
+
/* @__PURE__ */ jsx("div", { className: "nice-wm__body", children: t.content }),
|
|
471
|
+
(t.resizable ?? true) && !g && /* @__PURE__ */ jsx(
|
|
472
|
+
"div",
|
|
473
|
+
{
|
|
474
|
+
className: "nice-wm__resize-handle",
|
|
475
|
+
onMouseDown: (M) => X(t.key, M, "resize")
|
|
476
|
+
}
|
|
477
|
+
)
|
|
478
|
+
]
|
|
479
|
+
},
|
|
480
|
+
t.key
|
|
481
|
+
);
|
|
482
|
+
}),
|
|
483
|
+
m && /* @__PURE__ */ jsx("div", { className: "nice-wm__taskbar", role: "toolbar", "aria-label": L("wm.taskbar", "Taskbar"), children: e.map((t) => /* @__PURE__ */ jsxs(
|
|
484
|
+
"button",
|
|
485
|
+
{
|
|
486
|
+
type: "button",
|
|
487
|
+
className: `nice-wm__taskbar-btn ${t.minimized ? "nice-wm__taskbar-btn--minimized" : ""}`,
|
|
488
|
+
onClick: () => {
|
|
489
|
+
t.minimized && I(t.key), v(t.key);
|
|
490
|
+
},
|
|
491
|
+
children: [
|
|
492
|
+
t.icon && /* @__PURE__ */ jsx("span", { className: "nice-wm__taskbar-icon", children: t.icon }),
|
|
493
|
+
/* @__PURE__ */ jsx("span", { className: "nice-wm__taskbar-label", children: t.title })
|
|
494
|
+
]
|
|
495
|
+
},
|
|
496
|
+
t.key
|
|
497
|
+
)) })
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
vt.displayName = "NiceWindowManager";
|
|
504
|
+
createContext({
|
|
505
|
+
startTutorial: () => {
|
|
506
|
+
},
|
|
507
|
+
stopTutorial: () => {
|
|
508
|
+
},
|
|
509
|
+
isActive: false,
|
|
510
|
+
currentStep: 0,
|
|
511
|
+
nextStep: () => {
|
|
512
|
+
},
|
|
513
|
+
prevStep: () => {
|
|
514
|
+
},
|
|
515
|
+
goToStep: () => {
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
function Nt(e, n, i, r, m) {
|
|
519
|
+
const a = e <= m, h = e + m >= i, w = n <= m, p = n + m >= r;
|
|
520
|
+
return w && a ? "top-left" : w && h ? "top-right" : p && a ? "bottom-left" : p && h ? "bottom-right" : a ? "left" : h ? "right" : w ? "top" : p ? "bottom" : "none";
|
|
521
|
+
}
|
|
522
|
+
function kt(e) {
|
|
523
|
+
switch (e) {
|
|
524
|
+
case "left":
|
|
525
|
+
return { left: 0, top: 0, width: "50%", height: "100%" };
|
|
526
|
+
case "right":
|
|
527
|
+
return { left: "50%", top: 0, width: "50%", height: "100%" };
|
|
528
|
+
case "top":
|
|
529
|
+
return { left: 0, top: 0, width: "100%", height: "50%" };
|
|
530
|
+
case "bottom":
|
|
531
|
+
return { left: 0, top: "50%", width: "100%", height: "50%" };
|
|
532
|
+
case "top-left":
|
|
533
|
+
return { left: 0, top: 0, width: "50%", height: "50%" };
|
|
534
|
+
case "top-right":
|
|
535
|
+
return { left: "50%", top: 0, width: "50%", height: "50%" };
|
|
536
|
+
case "bottom-left":
|
|
537
|
+
return { left: 0, top: "50%", width: "50%", height: "50%" };
|
|
538
|
+
case "bottom-right":
|
|
539
|
+
return { left: "50%", top: "50%", width: "50%", height: "50%" };
|
|
540
|
+
default:
|
|
541
|
+
return null;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
const Et = forwardRef(
|
|
545
|
+
({
|
|
546
|
+
windowKey: e,
|
|
547
|
+
title: n,
|
|
548
|
+
icon: i,
|
|
549
|
+
children: r,
|
|
550
|
+
footer: m,
|
|
551
|
+
x: a = 100,
|
|
552
|
+
y: h = 100,
|
|
553
|
+
width: w = 480,
|
|
554
|
+
height: p = 360,
|
|
555
|
+
minWidth: N = 200,
|
|
556
|
+
minHeight: s = 120,
|
|
557
|
+
maxWidth: k,
|
|
558
|
+
maxHeight: L,
|
|
559
|
+
zIndex: d = 1,
|
|
560
|
+
closable: A = true,
|
|
561
|
+
minimizable: _ = true,
|
|
562
|
+
maximizable: $ = true,
|
|
563
|
+
fullscreenable: c = false,
|
|
564
|
+
pinnable: v = false,
|
|
565
|
+
resizable: u = true,
|
|
566
|
+
draggable: I = true,
|
|
567
|
+
snappable: R = true,
|
|
568
|
+
snapThreshold: X = 20,
|
|
569
|
+
minimized: t,
|
|
570
|
+
maximized: g,
|
|
571
|
+
fullscreen: z,
|
|
572
|
+
pinned: M,
|
|
573
|
+
focused: W,
|
|
574
|
+
onClose: Y,
|
|
575
|
+
onMinimize: l,
|
|
576
|
+
onMaximize: E,
|
|
577
|
+
onFullscreen: f,
|
|
578
|
+
onPin: O,
|
|
579
|
+
onFocus: S,
|
|
580
|
+
onMove: ne,
|
|
581
|
+
onResize: se,
|
|
582
|
+
onSnap: C,
|
|
583
|
+
onTitleBarDoubleClick: P,
|
|
584
|
+
size: we = "md",
|
|
585
|
+
statusBar: Ce,
|
|
586
|
+
titleBarActions: Ye,
|
|
587
|
+
className: Xe,
|
|
588
|
+
style: Oe,
|
|
589
|
+
id: Ie,
|
|
590
|
+
accessMode: qe,
|
|
591
|
+
...Ae
|
|
592
|
+
}, Be) => {
|
|
593
|
+
const We = ys(Ie), Fe = ei(qe, Ie), { t: le } = de();
|
|
594
|
+
if (Fe === "hidden")
|
|
595
|
+
return null;
|
|
596
|
+
const [he, ce] = useState({ x: a, y: h }), [pe, fe] = useState({ width: w, height: p }), [He, Ue] = useState(false), [Ge, Ve] = useState(false), [je, Qe] = useState(false), [Ze, Je] = useState(false), [V, ve] = useState("none"), Ke = t ?? He, U = g ?? Ge, H = z ?? je, ae = M ?? Ze, be = W ?? true, ie = he.x, oe = he.y, Z = pe.width, J = pe.height, j = useRef(
|
|
597
|
+
null
|
|
598
|
+
), F = useRef(null), T = useRef(null), et = useCallback(() => {
|
|
599
|
+
Y?.(e);
|
|
600
|
+
}, [e, Y]), tt = useCallback(() => {
|
|
601
|
+
Ue(true), l?.(e);
|
|
602
|
+
}, [e, l]), ye = useCallback(() => {
|
|
603
|
+
const y = !U;
|
|
604
|
+
Ve(y), !y && T.current ? (ce({ x: T.current.x, y: T.current.y }), fe({ width: T.current.w, height: T.current.h }), T.current = null) : y && (T.current = { x: ie, y: oe, w: Z, h: J }), ve("none"), E?.(e, y);
|
|
605
|
+
}, [e, U, ie, oe, Z, J, E]), xe = useCallback(() => {
|
|
606
|
+
const y = !H;
|
|
607
|
+
Qe(y), y ? T.current = { x: ie, y: oe, w: Z, h: J } : T.current && (ce({ x: T.current.x, y: T.current.y }), fe({ width: T.current.w, height: T.current.h }), T.current = null), f?.(e, y);
|
|
608
|
+
}, [e, H, ie, oe, Z, J, f]), nt = useCallback(() => {
|
|
609
|
+
const y = !ae;
|
|
610
|
+
Je(y), O?.(e, y);
|
|
611
|
+
}, [e, ae, O]), de$1 = useCallback(() => {
|
|
612
|
+
S?.(e);
|
|
613
|
+
}, [e, S]), it = useCallback(() => {
|
|
614
|
+
P ? P(e) : $ && ye();
|
|
615
|
+
}, [e, $, ye, P]);
|
|
616
|
+
useEffect(() => {
|
|
617
|
+
if (!j.current)
|
|
618
|
+
return;
|
|
619
|
+
const y = (K) => {
|
|
620
|
+
if (!j.current)
|
|
621
|
+
return;
|
|
622
|
+
const Q = K.clientX - j.current.startX + j.current.origX, ue = K.clientY - j.current.startY + j.current.origY;
|
|
623
|
+
ce({ x: Q, y: ue }), ne?.(e, { x: Q, y: ue });
|
|
624
|
+
}, B = (K) => {
|
|
625
|
+
if (j.current) {
|
|
626
|
+
if (R) {
|
|
627
|
+
const Q = Nt(
|
|
628
|
+
K.clientX,
|
|
629
|
+
K.clientY,
|
|
630
|
+
window.innerWidth,
|
|
631
|
+
window.innerHeight,
|
|
632
|
+
X
|
|
633
|
+
);
|
|
634
|
+
Q !== "none" && (T.current = { x: he.x, y: he.y, w: Z, h: J }, ve(Q), C?.(e, Q));
|
|
635
|
+
}
|
|
636
|
+
j.current = null;
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
return document.addEventListener("mousemove", y), document.addEventListener("mouseup", B), () => {
|
|
640
|
+
document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", B);
|
|
641
|
+
};
|
|
642
|
+
});
|
|
643
|
+
const ot = useCallback(
|
|
644
|
+
(y) => {
|
|
645
|
+
!I || U || H || (y.preventDefault(), V !== "none" && (T.current && (ce({ x: T.current.x, y: T.current.y }), fe({ width: T.current.w, height: T.current.h })), ve("none")), de$1(), j.current = { startX: y.clientX, startY: y.clientY, origX: ie, origY: oe });
|
|
646
|
+
},
|
|
647
|
+
[I, U, H, V, ie, oe, de$1]
|
|
648
|
+
);
|
|
649
|
+
useEffect(() => {
|
|
650
|
+
if (!F.current)
|
|
651
|
+
return;
|
|
652
|
+
const y = (K) => {
|
|
653
|
+
if (!F.current)
|
|
654
|
+
return;
|
|
655
|
+
const Q = K.clientX - F.current.startX, ue = K.clientY - F.current.startY, re = F.current.handle;
|
|
656
|
+
let ee = F.current.origW, te = F.current.origH;
|
|
657
|
+
if (re.includes("e") && (ee = F.current.origW + Q), re.includes("w") && (ee = F.current.origW - Q), re.includes("s") && (te = F.current.origH + ue), re.includes("n") && (te = F.current.origH - ue), ee = Math.max(N, k ? Math.min(k, ee) : ee), te = Math.max(s, L ? Math.min(L, te) : te), re.includes("w")) {
|
|
658
|
+
const Ne = pe.width - ee;
|
|
659
|
+
ce((me) => ({ ...me, x: me.x + Ne }));
|
|
660
|
+
}
|
|
661
|
+
if (re.includes("n")) {
|
|
662
|
+
const Ne = pe.height - te;
|
|
663
|
+
ce((me) => ({ ...me, y: me.y + Ne }));
|
|
664
|
+
}
|
|
665
|
+
fe({ width: ee, height: te }), se?.(e, { width: ee, height: te });
|
|
666
|
+
}, B = () => {
|
|
667
|
+
F.current = null;
|
|
668
|
+
};
|
|
669
|
+
return document.addEventListener("mousemove", y), document.addEventListener("mouseup", B), () => {
|
|
670
|
+
document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", B);
|
|
671
|
+
};
|
|
672
|
+
});
|
|
673
|
+
const ct = useCallback(
|
|
674
|
+
(y, B) => {
|
|
675
|
+
!u || U || H || V !== "none" || (B.preventDefault(), B.stopPropagation(), de$1(), F.current = { startX: B.clientX, startY: B.clientY, origW: Z, origH: J, handle: y });
|
|
676
|
+
},
|
|
677
|
+
[u, U, H, V, Z, J, de$1]
|
|
678
|
+
);
|
|
679
|
+
if (useEffect(() => {
|
|
680
|
+
if (!be)
|
|
681
|
+
return;
|
|
682
|
+
const y = (B) => {
|
|
683
|
+
B.key === "Escape" && H && xe();
|
|
684
|
+
};
|
|
685
|
+
return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
|
|
686
|
+
}, [be, H, xe]), Ke)
|
|
687
|
+
return null;
|
|
688
|
+
const Me = V !== "none" ? kt(V) : null, Se = U || H, rt = H ? { position: "fixed", top: 0, left: 0, width: "100vw", height: "100vh", zIndex: 999999 } : U ? { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", zIndex: d } : Me ? { position: "absolute", ...Me, zIndex: d } : { position: "absolute", top: oe, left: ie, width: Z, height: J, zIndex: d }, st = ["n", "e", "s", "w", "ne", "se", "sw", "nw"], lt = {
|
|
689
|
+
n: "ns-resize",
|
|
690
|
+
s: "ns-resize",
|
|
691
|
+
e: "ew-resize",
|
|
692
|
+
w: "ew-resize",
|
|
693
|
+
ne: "nesw-resize",
|
|
694
|
+
sw: "nesw-resize",
|
|
695
|
+
nw: "nwse-resize",
|
|
696
|
+
se: "nwse-resize"
|
|
697
|
+
};
|
|
698
|
+
return /* @__PURE__ */ jsxs(
|
|
699
|
+
"div",
|
|
700
|
+
{
|
|
701
|
+
ref: Be,
|
|
702
|
+
id: We,
|
|
703
|
+
className: `nice-window nice-window--${we} ${be ? "nice-window--focused" : ""} ${ae ? "nice-window--pinned" : ""} ${Se ? "nice-window--maximized" : ""} ${V !== "none" ? `nice-window--snapped-${V}` : ""} ${Xe ?? ""}`,
|
|
704
|
+
style: { ...rt, ...Oe },
|
|
705
|
+
onMouseDown: de$1,
|
|
706
|
+
role: "dialog",
|
|
707
|
+
"aria-label": n,
|
|
708
|
+
...Ae,
|
|
709
|
+
children: [
|
|
710
|
+
/* @__PURE__ */ jsxs(
|
|
711
|
+
"div",
|
|
712
|
+
{
|
|
713
|
+
className: "nice-window__titlebar",
|
|
714
|
+
onMouseDown: ot,
|
|
715
|
+
onDoubleClick: it,
|
|
716
|
+
children: [
|
|
717
|
+
i && /* @__PURE__ */ jsx("span", { className: "nice-window__icon", children: i }),
|
|
718
|
+
/* @__PURE__ */ jsx("span", { className: "nice-window__title", children: n }),
|
|
719
|
+
/* @__PURE__ */ jsxs("div", { className: "nice-window__actions", children: [
|
|
720
|
+
Ye,
|
|
721
|
+
v && /* @__PURE__ */ jsx(
|
|
722
|
+
"button",
|
|
723
|
+
{
|
|
724
|
+
type: "button",
|
|
725
|
+
className: `nice-window__action nice-window__action--pin ${ae ? "nice-window__action--active" : ""}`,
|
|
726
|
+
onClick: nt,
|
|
727
|
+
title: le("window.pin", ae ? "Unpin" : "Pin"),
|
|
728
|
+
children: "📌"
|
|
729
|
+
}
|
|
730
|
+
),
|
|
731
|
+
_ && /* @__PURE__ */ jsx(
|
|
732
|
+
"button",
|
|
733
|
+
{
|
|
734
|
+
type: "button",
|
|
735
|
+
className: "nice-window__action nice-window__action--minimize",
|
|
736
|
+
onClick: tt,
|
|
737
|
+
title: le("window.minimize", "Minimize"),
|
|
738
|
+
children: "─"
|
|
739
|
+
}
|
|
740
|
+
),
|
|
741
|
+
$ && /* @__PURE__ */ jsx(
|
|
742
|
+
"button",
|
|
743
|
+
{
|
|
744
|
+
type: "button",
|
|
745
|
+
className: "nice-window__action nice-window__action--maximize",
|
|
746
|
+
onClick: ye,
|
|
747
|
+
title: le("window.maximize", U ? "Restore" : "Maximize"),
|
|
748
|
+
children: U ? "❐" : "☐"
|
|
749
|
+
}
|
|
750
|
+
),
|
|
751
|
+
c && /* @__PURE__ */ jsx(
|
|
752
|
+
"button",
|
|
753
|
+
{
|
|
754
|
+
type: "button",
|
|
755
|
+
className: "nice-window__action nice-window__action--fullscreen",
|
|
756
|
+
onClick: xe,
|
|
757
|
+
title: le("window.fullscreen", H ? "Exit Full Screen" : "Full Screen"),
|
|
758
|
+
children: H ? "⇲" : "⇱"
|
|
759
|
+
}
|
|
760
|
+
),
|
|
761
|
+
A && /* @__PURE__ */ jsx(
|
|
762
|
+
"button",
|
|
763
|
+
{
|
|
764
|
+
type: "button",
|
|
765
|
+
className: "nice-window__action nice-window__action--close",
|
|
766
|
+
onClick: et,
|
|
767
|
+
title: le("window.close", "Close"),
|
|
768
|
+
children: "✕"
|
|
769
|
+
}
|
|
770
|
+
)
|
|
771
|
+
] })
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ jsx("div", { className: "nice-window__body", children: r }),
|
|
776
|
+
m && /* @__PURE__ */ jsx("div", { className: "nice-window__footer", children: m }),
|
|
777
|
+
Ce && /* @__PURE__ */ jsx("div", { className: "nice-window__statusbar", children: Ce }),
|
|
778
|
+
u && !Se && V === "none" && /* @__PURE__ */ jsx(Fragment, { children: st.map((y) => /* @__PURE__ */ jsx(
|
|
779
|
+
"div",
|
|
780
|
+
{
|
|
781
|
+
className: `nice-window__resize nice-window__resize--${y}`,
|
|
782
|
+
style: { cursor: lt[y] },
|
|
783
|
+
onMouseDown: (B) => ct(y, B)
|
|
784
|
+
},
|
|
785
|
+
y
|
|
786
|
+
)) })
|
|
787
|
+
]
|
|
788
|
+
}
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
Et.displayName = "NiceWindow";
|
|
793
|
+
|
|
794
|
+
export { Mt as N, wt as a, Lt as b, Rt as d, St as e, $t as f, Tt as g, Pt as h, Et as k, vt as l };
|
|
795
|
+
//# sourceMappingURL=NiceWindow-SiCaREbq.js.map
|