@nice2dev/ui 1.1.5 → 1.1.7
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/CHANGELOG.md +102 -0
- package/README.md +50 -29
- package/css/legacy-bg-text-aliases.css +65 -61
- package/dist/NiceCodeEditor-Bc81wiaN.js +1134 -0
- package/dist/NiceCodeEditor-D6f8KdHN.js +1134 -0
- package/dist/NiceCodeEditor-DE3saxyt.cjs +260 -0
- package/dist/NiceCodeEditor-DZM16My5.cjs +260 -0
- package/dist/NiceCodeEditor-HqmcJjmZ.js +1179 -0
- package/dist/NiceColorPicker-6EqXaDj0.cjs +1 -0
- package/dist/NiceColorPicker-BiEWqWnd.js +596 -0
- package/dist/NiceColorPicker-Cuc6YXqz.cjs +1 -0
- package/dist/NiceColorPicker-DMATcNWG.js +596 -0
- package/dist/NiceColorPicker-R3O1nemp.js +596 -0
- package/dist/NiceConfirmDialog-B0e10fRL.cjs +1 -0
- package/dist/NiceConfirmDialog-BBDgEMHv.js +81 -0
- package/dist/NiceConfirmDialog-C7kdr8jJ.js +81 -0
- package/dist/NiceConfirmDialog-DMHqPfFM.js +81 -0
- package/dist/NiceConfirmDialog-ZJpQLQQS.cjs +1 -0
- package/dist/NiceDataGrid-BzUw4dSu.cjs +10 -0
- package/dist/NiceDataGrid-CPKcVOVz.js +1743 -0
- package/dist/NiceDataGrid-DJr33WMy.cjs +10 -0
- package/dist/NiceDataGrid-D_4gZ1Hu.js +1736 -0
- package/dist/NiceDataGrid-DlUAaXhD.js +1736 -0
- package/dist/NiceDocumentViewer-8ghRVtfO.js +672 -0
- package/dist/NiceDocumentViewer-ChWtA_Ry.cjs +180 -0
- package/dist/NiceDocumentViewer-DwLUV7Tc.js +672 -0
- package/dist/NiceDocumentViewer-goMzF1w3.cjs +180 -0
- package/dist/NiceDocumentViewer-gt1mxzP8.js +672 -0
- package/dist/NiceForm-CHEAHxDw.js +4805 -0
- package/dist/NiceForm-CJUp1CL0.cjs +1 -0
- package/dist/NiceForm-Cp_RH3Yj.js +4805 -0
- package/dist/NiceForm-a6tGr6ss.js +4819 -0
- package/dist/NiceForm-jU89oe2S.cjs +1 -0
- package/dist/NiceGantt-BnQwyTfG.cjs +1 -0
- package/dist/NiceGantt-D8coFAvK.js +328 -0
- package/dist/NiceGantt-DOZfT6r5.js +328 -0
- package/dist/NiceGantt-DQzH1V-R.js +328 -0
- package/dist/NiceGantt-jQ8ZpXko.cjs +1 -0
- package/dist/NiceHtmlEditor-B1nlXJNW.cjs +10 -0
- package/dist/NiceHtmlEditor-Bv3VqJPG.js +862 -0
- package/dist/NiceHtmlEditor-CKsGj-Ei.cjs +10 -0
- package/dist/NiceHtmlEditor-CloMgyzg.js +841 -0
- package/dist/NiceHtmlEditor-DUAHmkWI.js +841 -0
- package/dist/NiceLoginForm-Ce_QLnLf.js +736 -0
- package/dist/NiceLoginForm-DLpNTQlR.cjs +1 -0
- package/dist/NiceLoginForm-Dg0286Cc.js +736 -0
- package/dist/NiceLoginForm-X05Vadeg.js +708 -0
- package/dist/NiceLoginForm-f_dBCnUi.cjs +1 -0
- package/dist/NiceMention-BByI4nFG.js +11120 -0
- package/dist/NiceMention-BjeLN4Jx.cjs +430 -0
- package/dist/NiceMention-C2TPiMph.cjs +430 -0
- package/dist/NiceMention-C67vT6m0.js +11145 -0
- package/dist/NiceMention-D1cdy63w.cjs +430 -0
- package/dist/NiceMention-OaCi-GNO.js +11094 -0
- package/dist/NiceMention-QIuggb9Y.js +11122 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-CHaan9al.js +95 -0
- package/dist/NiceModal-Czq6OEAT.js +95 -0
- package/dist/NiceModal-D-HFwawr.js +95 -0
- package/dist/NiceModal-DOy2XTzc.cjs +1 -0
- package/dist/NiceModal-DkawKzEE.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-1CsP8Zst.js +6997 -0
- package/dist/NiceModuleLifecyclePanel-Bkx4Yg-3.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-C5oYtczk.js +6999 -0
- package/dist/NiceModuleLifecyclePanel-DCcy2yYi.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DqdgW-0s.js +7004 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-7od5KUa3.cjs +1 -0
- package/dist/NicePagination-DMrkR8hH.cjs +1 -0
- package/dist/NicePagination-DQmZpsSQ.js +179 -0
- package/dist/NicePagination-DipQRjPq.js +172 -0
- package/dist/NicePagination-KhlVXYaT.js +172 -0
- package/dist/NicePivotGrid-B-KthuqL.cjs +152 -0
- package/dist/NicePivotGrid-CLCTHkKO.cjs +152 -0
- package/dist/NicePivotGrid-DV54FCsH.js +1174 -0
- package/dist/NicePivotGrid-DoWLUPUs.js +1167 -0
- package/dist/NicePivotGrid-etwpfccz.js +1167 -0
- package/dist/NiceSavedQueryPanel-BABkTNc5.js +5129 -0
- package/dist/NiceSavedQueryPanel-Cfeig83P.cjs +586 -0
- package/dist/NiceSavedQueryPanel-DTWRLseb.cjs +586 -0
- package/dist/NiceSavedQueryPanel-Dy154sxE.js +5129 -0
- package/dist/NiceSavedQueryPanel-v7AffOOe.js +5129 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceScheduler-BEgB7ZgF.cjs +5 -0
- package/dist/NiceScheduler-C9JprsEI.cjs +5 -0
- package/dist/NiceScheduler-DSP-PPh0.js +1645 -0
- package/dist/NiceScheduler-DuPnaA3t.js +1652 -0
- package/dist/NiceScheduler-Oa89YZx9.js +1645 -0
- package/dist/NiceSelect-A336yeLZ.js +433 -0
- package/dist/NiceSelect-B5hTbqi2.js +433 -0
- package/dist/NiceSelect-BYSgDYzq.cjs +1 -0
- package/dist/NiceSelect-Dudf2T5T.js +433 -0
- package/dist/NiceSelect-DwBAIrX7.cjs +1 -0
- package/dist/NiceWindow-B6zjBTl9.cjs +1 -0
- package/dist/NiceWindow-BKQEx7Vf.js +1623 -0
- package/dist/NiceWindow-BnTH7Gy0.js +1623 -0
- package/dist/NiceWindow-CZN9NVZw.cjs +1 -0
- package/dist/NiceWindow-lxtPR7yZ.js +1623 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-B8_V3_nq.cjs +882 -0
- package/dist/charts-BZgyyybE.js +31933 -0
- package/dist/charts-FuDk5-r6.js +31958 -0
- package/dist/charts-INj3yFo5.js +31946 -0
- package/dist/charts-NolNXKUL.cjs +882 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-A_A6c7an.js +795 -0
- package/dist/core-B2iH2J_X.js +795 -0
- package/dist/core-BmspZEfD.js +795 -0
- package/dist/core-DAfLOet6.cjs +1 -0
- package/dist/core-ZG3bgnBR.cjs +1 -0
- package/dist/data-branching-B3TOqXAO.cjs +1 -0
- package/dist/data-branching-BUGiICDZ.js +6275 -0
- package/dist/data-branching-DMXmcocj.js +6275 -0
- package/dist/data-branching-YE8P9M5P.js +6275 -0
- package/dist/data-branching-t6uhAwIm.cjs +1 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +7 -2
- package/dist/data.mjs +3 -3
- package/dist/devops-BhV3OmF7.js +8285 -0
- package/dist/devops-BqUxnbRi.cjs +17 -0
- package/dist/devops-Bx-Qwj9w.cjs +17 -0
- package/dist/devops-DYZatW45.js +8251 -0
- package/dist/devops-R98k2zpd.js +8251 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +29 -16
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +59 -28
- package/dist/editors.mjs +7 -7
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index.cjs +445 -445
- package/dist/index.css +1 -1
- package/dist/index.d.ts +214 -119
- package/dist/index.mjs +16635 -16351
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +31 -18
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +17 -14
- package/dist/navigation.mjs +130 -130
- package/dist/no-code-BPaAS4wW.cjs +332 -0
- package/dist/no-code-CBwUVL1i.js +7447 -0
- package/dist/no-code-CjktkQ50.js +7447 -0
- package/dist/no-code-DW2NrRba.js +7447 -0
- package/dist/no-code-DmFxrZ5T.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +2 -2
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +4 -4
- package/dist/overlays.mjs +2 -2
- package/dist/pickerCommons-C4XWRUvH.cjs +1 -0
- package/dist/pickerCommons-C_BpYs_m.cjs +1 -0
- package/dist/pickerCommons-DAOXH_u5.js +1122 -0
- package/dist/pickerCommons-Dn4wnDco.js +1122 -0
- package/dist/pickerCommons-DskswPS5.js +1122 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +7 -7
- package/package.json +3 -3
|
@@ -0,0 +1,1623 @@
|
|
|
1
|
+
import { jsxs as g, Fragment as Fe, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { G as Ye, g as _t, c as He, o as me, e as gt, D as vt } from "./charts-FuDk5-r6.js";
|
|
3
|
+
import bt, { useRef as V, useState as O, useCallback as N, useEffect as A, useReducer as yt, useMemo as Pe, useContext as je, createContext as Ve, forwardRef as Ue } from "react";
|
|
4
|
+
const Ft = ({
|
|
5
|
+
visible: t,
|
|
6
|
+
onClose: n,
|
|
7
|
+
title: i,
|
|
8
|
+
items: s,
|
|
9
|
+
showCancelButton: m = !0,
|
|
10
|
+
cancelText: h,
|
|
11
|
+
size: p = "md",
|
|
12
|
+
disabled: w,
|
|
13
|
+
readOnly: d,
|
|
14
|
+
loading: b,
|
|
15
|
+
error: l,
|
|
16
|
+
className: y,
|
|
17
|
+
style: Y
|
|
18
|
+
}) => {
|
|
19
|
+
const { t: L } = Ye();
|
|
20
|
+
if (!t)
|
|
21
|
+
return null;
|
|
22
|
+
const k = w || b || d;
|
|
23
|
+
return /* @__PURE__ */ g(Fe, { children: [
|
|
24
|
+
/* @__PURE__ */ e("div", { className: "nice-actionsheet__overlay", onClick: n }),
|
|
25
|
+
/* @__PURE__ */ g(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: `nice-actionsheet nice-actionsheet--${p} ${w ? "nice-actionsheet--disabled" : ""} ${d ? "nice-actionsheet--readonly" : ""} ${b ? "nice-actionsheet--loading" : ""} ${l ? "nice-actionsheet--error" : ""} ${y || ""}`,
|
|
29
|
+
style: Y,
|
|
30
|
+
"aria-disabled": w || void 0,
|
|
31
|
+
"aria-readonly": d || void 0,
|
|
32
|
+
"aria-busy": b || void 0,
|
|
33
|
+
children: [
|
|
34
|
+
l && /* @__PURE__ */ e("div", { className: "nice-actionsheet__error", role: "alert", children: l }),
|
|
35
|
+
b && /* @__PURE__ */ e("span", { className: "nice-actionsheet__spinner", "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: "nice-spinner nice-spinner--sm" }) }),
|
|
36
|
+
i && /* @__PURE__ */ e("div", { className: "nice-actionsheet__title", children: i }),
|
|
37
|
+
/* @__PURE__ */ e("div", { className: "nice-actionsheet__items", children: s.map((E, D) => /* @__PURE__ */ g(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
className: `nice-actionsheet__item ${E.type === "danger" ? "nice-actionsheet__item--danger" : ""}`,
|
|
41
|
+
disabled: E.disabled || k,
|
|
42
|
+
onClick: () => {
|
|
43
|
+
k || (E.onClick?.(), n());
|
|
44
|
+
},
|
|
45
|
+
children: [
|
|
46
|
+
E.icon && /* @__PURE__ */ e("span", { className: "nice-actionsheet__icon", children: E.icon }),
|
|
47
|
+
E.text
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
D
|
|
51
|
+
)) }),
|
|
52
|
+
m && /* @__PURE__ */ e("button", { className: "nice-actionsheet__cancel", onClick: n, children: h || L("cancel", "Cancel") })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
57
|
+
}, Ht = ({
|
|
58
|
+
visible: t,
|
|
59
|
+
onClose: n,
|
|
60
|
+
targetRef: i,
|
|
61
|
+
position: s = "bottom",
|
|
62
|
+
title: m,
|
|
63
|
+
showArrow: h = !0,
|
|
64
|
+
width: p,
|
|
65
|
+
children: w,
|
|
66
|
+
className: d,
|
|
67
|
+
style: b,
|
|
68
|
+
displayStyle: l
|
|
69
|
+
}) => {
|
|
70
|
+
_t("tooltip", l);
|
|
71
|
+
const y = V(null), [Y, L] = O({ top: 0, left: 0 }), k = N(() => {
|
|
72
|
+
const E = i.current, D = y.current;
|
|
73
|
+
if (!E || !D)
|
|
74
|
+
return;
|
|
75
|
+
const c = E.getBoundingClientRect(), v = D.getBoundingClientRect();
|
|
76
|
+
let r = 0, C = 0;
|
|
77
|
+
const _ = 8;
|
|
78
|
+
switch (s) {
|
|
79
|
+
case "top":
|
|
80
|
+
r = c.top - v.height - _, C = c.left + (c.width - v.width) / 2;
|
|
81
|
+
break;
|
|
82
|
+
case "bottom":
|
|
83
|
+
r = c.bottom + _, C = c.left + (c.width - v.width) / 2;
|
|
84
|
+
break;
|
|
85
|
+
case "left":
|
|
86
|
+
r = c.top + (c.height - v.height) / 2, C = c.left - v.width - _;
|
|
87
|
+
break;
|
|
88
|
+
case "right":
|
|
89
|
+
r = c.top + (c.height - v.height) / 2, C = c.right + _;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
L({ top: r + window.scrollY, left: C + window.scrollX });
|
|
93
|
+
}, [i, s]);
|
|
94
|
+
return A(() => {
|
|
95
|
+
if (t) {
|
|
96
|
+
requestAnimationFrame(k);
|
|
97
|
+
const E = (D) => {
|
|
98
|
+
y.current && !y.current.contains(D.target) && i.current && !i.current.contains(D.target) && n();
|
|
99
|
+
};
|
|
100
|
+
return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
|
|
101
|
+
}
|
|
102
|
+
}, [t, k, n, i]), t ? /* @__PURE__ */ g(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
ref: y,
|
|
106
|
+
className: `nice-popover nice-popover--${s} ${d || ""}`,
|
|
107
|
+
style: { ...b, position: "absolute", top: Y.top, left: Y.left, width: p },
|
|
108
|
+
children: [
|
|
109
|
+
h && /* @__PURE__ */ e("div", { className: `nice-popover__arrow nice-popover__arrow--${s}` }),
|
|
110
|
+
m && /* @__PURE__ */ e("div", { className: "nice-popover__title", children: m }),
|
|
111
|
+
/* @__PURE__ */ e("div", { className: "nice-popover__content", children: w })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
) : null;
|
|
115
|
+
}, Ut = ({
|
|
116
|
+
visible: t,
|
|
117
|
+
message: n,
|
|
118
|
+
container: i,
|
|
119
|
+
showIndicator: s = !0,
|
|
120
|
+
shading: m = !0,
|
|
121
|
+
className: h,
|
|
122
|
+
style: p
|
|
123
|
+
}) => {
|
|
124
|
+
const { t: w } = Ye();
|
|
125
|
+
if (!t)
|
|
126
|
+
return null;
|
|
127
|
+
const d = !!i?.current, b = /* @__PURE__ */ g("div", { className: `nice-loadpanel ${h || ""}`, style: p, children: [
|
|
128
|
+
m && /* @__PURE__ */ e("div", { className: "nice-loadpanel__shade" }),
|
|
129
|
+
/* @__PURE__ */ g("div", { className: "nice-loadpanel__box", children: [
|
|
130
|
+
s && /* @__PURE__ */ e("div", { className: "nice-spinner nice-spinner--md" }),
|
|
131
|
+
/* @__PURE__ */ e("span", { className: "nice-loadpanel__text", children: n || w("loading", "Loading...") })
|
|
132
|
+
] })
|
|
133
|
+
] });
|
|
134
|
+
if (d && i.current) {
|
|
135
|
+
const l = i.current;
|
|
136
|
+
return l.style.position = l.style.position || "relative", b;
|
|
137
|
+
}
|
|
138
|
+
return b;
|
|
139
|
+
}, Gt = ({
|
|
140
|
+
direction: t = "row",
|
|
141
|
+
align: n,
|
|
142
|
+
justify: i,
|
|
143
|
+
wrap: s,
|
|
144
|
+
gap: m,
|
|
145
|
+
flex: h,
|
|
146
|
+
children: p,
|
|
147
|
+
className: w,
|
|
148
|
+
style: d
|
|
149
|
+
}) => /* @__PURE__ */ e(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
className: `nice-box ${w || ""}`,
|
|
153
|
+
style: {
|
|
154
|
+
display: "flex",
|
|
155
|
+
flexDirection: t,
|
|
156
|
+
alignItems: n,
|
|
157
|
+
justifyContent: i,
|
|
158
|
+
flexWrap: s ? "wrap" : void 0,
|
|
159
|
+
gap: m,
|
|
160
|
+
flex: h,
|
|
161
|
+
...d
|
|
162
|
+
},
|
|
163
|
+
children: p
|
|
164
|
+
}
|
|
165
|
+
), Kt = ({
|
|
166
|
+
direction: t = "row",
|
|
167
|
+
items: n,
|
|
168
|
+
gap: i,
|
|
169
|
+
className: s,
|
|
170
|
+
style: m
|
|
171
|
+
}) => /* @__PURE__ */ e(
|
|
172
|
+
"div",
|
|
173
|
+
{
|
|
174
|
+
className: `nice-responsivebox ${s || ""}`,
|
|
175
|
+
style: { display: "flex", flexDirection: t, gap: i, ...m },
|
|
176
|
+
children: n.map((h, p) => /* @__PURE__ */ e(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
style: { flex: h.ratio ?? 1, flexBasis: h.baseSize, flexShrink: h.shrink ?? 1 },
|
|
180
|
+
children: h.children
|
|
181
|
+
},
|
|
182
|
+
p
|
|
183
|
+
))
|
|
184
|
+
}
|
|
185
|
+
), jt = ({
|
|
186
|
+
width: t = 200,
|
|
187
|
+
height: n = 200,
|
|
188
|
+
minWidth: i = 50,
|
|
189
|
+
minHeight: s = 50,
|
|
190
|
+
maxWidth: m = 1 / 0,
|
|
191
|
+
maxHeight: h = 1 / 0,
|
|
192
|
+
handles: p = ["right", "bottom", "bottomRight"],
|
|
193
|
+
onResize: w,
|
|
194
|
+
children: d,
|
|
195
|
+
className: b,
|
|
196
|
+
style: l
|
|
197
|
+
}) => {
|
|
198
|
+
const [y, Y] = O({ width: t, height: n }), L = V(null), k = (c, v) => {
|
|
199
|
+
v.preventDefault();
|
|
200
|
+
const r = v.clientX, C = v.clientY, _ = y.width, j = y.height, S = {
|
|
201
|
+
n: "top",
|
|
202
|
+
s: "bottom",
|
|
203
|
+
e: "right",
|
|
204
|
+
w: "left",
|
|
205
|
+
ne: "topRight",
|
|
206
|
+
se: "bottomRight",
|
|
207
|
+
sw: "bottomLeft",
|
|
208
|
+
nw: "topLeft"
|
|
209
|
+
}[c] ?? c, o = S === "right" || S === "topRight" || S === "bottomRight", I = S === "left" || S === "topLeft" || S === "bottomLeft", z = S === "bottom" || S === "bottomRight" || S === "bottomLeft", $ = S === "top" || S === "topRight" || S === "topLeft", a = (u) => {
|
|
210
|
+
const T = u.clientX - r, f = u.clientY - C;
|
|
211
|
+
let X = _, F = j;
|
|
212
|
+
o && (X = _ + T), I && (X = _ - T), z && (F = j + f), $ && (F = j - f), X = Math.max(i, Math.min(m, X)), F = Math.max(s, Math.min(h, F)), Y({ width: X, height: F }), w?.({ width: X, height: F });
|
|
213
|
+
}, x = () => {
|
|
214
|
+
document.removeEventListener("pointermove", a), document.removeEventListener("pointerup", x);
|
|
215
|
+
};
|
|
216
|
+
document.addEventListener("pointermove", a), document.addEventListener("pointerup", x);
|
|
217
|
+
}, E = (c) => {
|
|
218
|
+
switch (c) {
|
|
219
|
+
case "top":
|
|
220
|
+
case "bottom":
|
|
221
|
+
return "ns-resize";
|
|
222
|
+
case "left":
|
|
223
|
+
case "right":
|
|
224
|
+
return "ew-resize";
|
|
225
|
+
case "topLeft":
|
|
226
|
+
case "bottomRight":
|
|
227
|
+
return "nwse-resize";
|
|
228
|
+
case "topRight":
|
|
229
|
+
case "bottomLeft":
|
|
230
|
+
return "nesw-resize";
|
|
231
|
+
default:
|
|
232
|
+
return "default";
|
|
233
|
+
}
|
|
234
|
+
}, D = (c) => {
|
|
235
|
+
const v = { position: "absolute", zIndex: 1 }, r = 8;
|
|
236
|
+
return c === "right" ? {
|
|
237
|
+
...v,
|
|
238
|
+
top: 0,
|
|
239
|
+
right: -r / 2,
|
|
240
|
+
width: r,
|
|
241
|
+
height: "100%",
|
|
242
|
+
cursor: E(c)
|
|
243
|
+
} : c === "bottom" ? {
|
|
244
|
+
...v,
|
|
245
|
+
left: 0,
|
|
246
|
+
bottom: -r / 2,
|
|
247
|
+
width: "100%",
|
|
248
|
+
height: r,
|
|
249
|
+
cursor: E(c)
|
|
250
|
+
} : c === "left" ? { ...v, top: 0, left: -r / 2, width: r, height: "100%", cursor: E(c) } : c === "top" ? { ...v, top: -r / 2, left: 0, width: "100%", height: r, cursor: E(c) } : c === "bottomRight" ? {
|
|
251
|
+
...v,
|
|
252
|
+
bottom: -r / 2,
|
|
253
|
+
right: -r / 2,
|
|
254
|
+
width: r * 2,
|
|
255
|
+
height: r * 2,
|
|
256
|
+
cursor: E(c)
|
|
257
|
+
} : c === "bottomLeft" ? {
|
|
258
|
+
...v,
|
|
259
|
+
bottom: -r / 2,
|
|
260
|
+
left: -r / 2,
|
|
261
|
+
width: r * 2,
|
|
262
|
+
height: r * 2,
|
|
263
|
+
cursor: E(c)
|
|
264
|
+
} : c === "topRight" ? {
|
|
265
|
+
...v,
|
|
266
|
+
top: -r / 2,
|
|
267
|
+
right: -r / 2,
|
|
268
|
+
width: r * 2,
|
|
269
|
+
height: r * 2,
|
|
270
|
+
cursor: E(c)
|
|
271
|
+
} : c === "topLeft" ? {
|
|
272
|
+
...v,
|
|
273
|
+
top: -r / 2,
|
|
274
|
+
left: -r / 2,
|
|
275
|
+
width: r * 2,
|
|
276
|
+
height: r * 2,
|
|
277
|
+
cursor: E(c)
|
|
278
|
+
} : v;
|
|
279
|
+
};
|
|
280
|
+
return /* @__PURE__ */ g(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
ref: L,
|
|
284
|
+
className: `nice-resizable ${b || ""}`,
|
|
285
|
+
style: {
|
|
286
|
+
...l,
|
|
287
|
+
width: y.width,
|
|
288
|
+
height: y.height,
|
|
289
|
+
position: "relative",
|
|
290
|
+
overflow: "hidden"
|
|
291
|
+
},
|
|
292
|
+
children: [
|
|
293
|
+
d,
|
|
294
|
+
p.map((c) => /* @__PURE__ */ e("div", { style: D(c), onPointerDown: (v) => k(c, v) }, c))
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
}, Vt = ({
|
|
299
|
+
direction: t = "vertical",
|
|
300
|
+
showScrollbar: n = "onInteraction",
|
|
301
|
+
width: i,
|
|
302
|
+
height: s,
|
|
303
|
+
onScroll: m,
|
|
304
|
+
children: h,
|
|
305
|
+
className: p,
|
|
306
|
+
style: w
|
|
307
|
+
}) => {
|
|
308
|
+
const d = t === "horizontal" || t === "both" ? "auto" : "hidden", b = t === "vertical" || t === "both" ? "auto" : "hidden";
|
|
309
|
+
return /* @__PURE__ */ e(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
className: `nice-scrollview ${n === "never" ? "nice-scrollview--hide-sb" : n === "always" ? "nice-scrollview--show-sb" : ""} ${p || ""}`,
|
|
313
|
+
style: { ...w, width: i, height: s, overflowX: d, overflowY: b },
|
|
314
|
+
onScroll: m,
|
|
315
|
+
children: h
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
};
|
|
319
|
+
function Ae(t, n) {
|
|
320
|
+
if (!t)
|
|
321
|
+
return { score: 1, indices: [] };
|
|
322
|
+
const i = t.toLowerCase(), s = n.toLowerCase();
|
|
323
|
+
let m = 0;
|
|
324
|
+
const h = [];
|
|
325
|
+
let p = 0, w = -1;
|
|
326
|
+
for (let d = 0; d < s.length && m < i.length; d++)
|
|
327
|
+
s[d] === i[m] && (h.push(d), w === d - 1 && (p += 3), (d === 0 || /[\s\-_/.]/.test(n[d - 1])) && (p += 5), n[d] === t[m] && (p += 1), p += 1, w = d, m++);
|
|
328
|
+
return m < i.length ? null : (p -= h[0] * 0.1, { score: p, indices: h });
|
|
329
|
+
}
|
|
330
|
+
function xt(t, n) {
|
|
331
|
+
if (n.length === 0)
|
|
332
|
+
return [t];
|
|
333
|
+
const i = [];
|
|
334
|
+
let s = 0;
|
|
335
|
+
const m = new Set(n);
|
|
336
|
+
for (let h = 0; h < t.length; h++)
|
|
337
|
+
m.has(h) && (s < h && i.push(t.slice(s, h)), i.push(
|
|
338
|
+
bt.createElement(
|
|
339
|
+
"mark",
|
|
340
|
+
{ key: `m-${h}`, className: "nice-command-palette__match" },
|
|
341
|
+
t[h]
|
|
342
|
+
)
|
|
343
|
+
), s = h + 1);
|
|
344
|
+
return s < t.length && i.push(t.slice(s)), i;
|
|
345
|
+
}
|
|
346
|
+
function Nt(t, n) {
|
|
347
|
+
switch (n.type) {
|
|
348
|
+
case "REGISTER": {
|
|
349
|
+
const i = new Map(t.commands);
|
|
350
|
+
return i.set(n.command.id, n.command), { ...t, commands: i };
|
|
351
|
+
}
|
|
352
|
+
case "REGISTER_BATCH": {
|
|
353
|
+
const i = new Map(t.commands);
|
|
354
|
+
for (const s of n.commands)
|
|
355
|
+
i.set(s.id, s);
|
|
356
|
+
return { ...t, commands: i };
|
|
357
|
+
}
|
|
358
|
+
case "UNREGISTER": {
|
|
359
|
+
const i = new Map(t.commands);
|
|
360
|
+
return i.delete(n.id), { ...t, commands: i };
|
|
361
|
+
}
|
|
362
|
+
case "OPEN":
|
|
363
|
+
return { ...t, isOpen: !0, query: "", selectedIndex: 0 };
|
|
364
|
+
case "CLOSE":
|
|
365
|
+
return { ...t, isOpen: !1, query: "", selectedIndex: 0 };
|
|
366
|
+
case "SET_QUERY":
|
|
367
|
+
return { ...t, query: n.query, selectedIndex: 0 };
|
|
368
|
+
case "SET_SELECTED":
|
|
369
|
+
return { ...t, selectedIndex: n.index };
|
|
370
|
+
case "ADD_RECENT": {
|
|
371
|
+
const i = t.recentIds.filter((s) => s !== n.id);
|
|
372
|
+
return {
|
|
373
|
+
...t,
|
|
374
|
+
recentIds: [n.id, ...i].slice(0, n.maxRecent)
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
default:
|
|
378
|
+
return t;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
const Qe = Ve(null);
|
|
382
|
+
function kt() {
|
|
383
|
+
const t = je(Qe);
|
|
384
|
+
if (!t)
|
|
385
|
+
throw new Error("useCommandPalette must be used within NiceCommandPaletteProvider");
|
|
386
|
+
return t;
|
|
387
|
+
}
|
|
388
|
+
const Et = ({
|
|
389
|
+
children: t,
|
|
390
|
+
commands: n,
|
|
391
|
+
placeholder: i = "Type a command...",
|
|
392
|
+
maxVisible: s = 10,
|
|
393
|
+
maxRecent: m = 5,
|
|
394
|
+
className: h,
|
|
395
|
+
emptyText: p = "No commands found",
|
|
396
|
+
closeOnAction: w = !0,
|
|
397
|
+
onOpen: d,
|
|
398
|
+
onClose: b
|
|
399
|
+
}) => {
|
|
400
|
+
const [l, y] = yt(Nt, {
|
|
401
|
+
commands: new Map(n?.map((a) => [a.id, a]) ?? []),
|
|
402
|
+
isOpen: !1,
|
|
403
|
+
query: "",
|
|
404
|
+
selectedIndex: 0,
|
|
405
|
+
recentIds: []
|
|
406
|
+
}), Y = V(null), L = V(null), [k, E] = O(!1), D = N((a) => {
|
|
407
|
+
y({ type: "REGISTER", command: a });
|
|
408
|
+
}, []), c = N((a) => {
|
|
409
|
+
y({ type: "UNREGISTER", id: a });
|
|
410
|
+
}, []), v = N((a) => {
|
|
411
|
+
y({ type: "REGISTER_BATCH", commands: a });
|
|
412
|
+
}, []), r = N(() => {
|
|
413
|
+
y({ type: "OPEN" }), d?.();
|
|
414
|
+
}, [d]), C = N(() => {
|
|
415
|
+
y({ type: "CLOSE" }), b?.();
|
|
416
|
+
}, [b]), _ = N(() => {
|
|
417
|
+
l.isOpen ? C() : r();
|
|
418
|
+
}, [l.isOpen, C, r]), W = Pe(() => {
|
|
419
|
+
const a = Array.from(l.commands.values()).filter((u) => !u.hidden);
|
|
420
|
+
if (!l.query.trim()) {
|
|
421
|
+
const u = l.recentIds.map((f) => l.commands.get(f)).filter((f) => !!f && !f.hidden), T = a.filter((f) => !l.recentIds.includes(f.id));
|
|
422
|
+
return T.sort((f, X) => f.label.localeCompare(X.label)), [...u, ...T].map((f) => ({
|
|
423
|
+
command: f,
|
|
424
|
+
match: null,
|
|
425
|
+
isRecent: l.recentIds.includes(f.id)
|
|
426
|
+
}));
|
|
427
|
+
}
|
|
428
|
+
return a.map((u) => {
|
|
429
|
+
const T = Ae(l.query, u.label), f = u.description ? Ae(l.query, u.description) : null, X = u.keywords?.map((Q) => Ae(l.query, Q)).filter(Boolean)[0] ?? null, F = [T, f, X].filter(Boolean).sort((Q, ne) => (ne?.score ?? 0) - (Q?.score ?? 0))[0];
|
|
430
|
+
return { command: u, match: F, isRecent: !1 };
|
|
431
|
+
}).filter((u) => u.match !== null).sort((u, T) => (T.match?.score ?? 0) - (u.match?.score ?? 0));
|
|
432
|
+
}, [l.commands, l.query, l.recentIds]).slice(0, s), S = N(
|
|
433
|
+
async (a) => {
|
|
434
|
+
const x = l.commands.get(a);
|
|
435
|
+
if (!(!x || x.disabled)) {
|
|
436
|
+
E(!0);
|
|
437
|
+
try {
|
|
438
|
+
await x.action(), y({ type: "ADD_RECENT", id: a, maxRecent: m });
|
|
439
|
+
} finally {
|
|
440
|
+
E(!1), w && C();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
[l.commands, m, w, C]
|
|
445
|
+
);
|
|
446
|
+
A(() => {
|
|
447
|
+
const a = (x) => {
|
|
448
|
+
(x.metaKey || x.ctrlKey) && x.key === "k" && (x.preventDefault(), _()), x.key === "Escape" && l.isOpen && (x.preventDefault(), C());
|
|
449
|
+
};
|
|
450
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
451
|
+
}, [_, l.isOpen, C]), A(() => {
|
|
452
|
+
l.isOpen && requestAnimationFrame(() => Y.current?.focus());
|
|
453
|
+
}, [l.isOpen]);
|
|
454
|
+
const o = N(
|
|
455
|
+
(a) => {
|
|
456
|
+
const x = W.length;
|
|
457
|
+
if (x) {
|
|
458
|
+
if (a.key === "ArrowDown")
|
|
459
|
+
a.preventDefault(), y({ type: "SET_SELECTED", index: (l.selectedIndex + 1) % x });
|
|
460
|
+
else if (a.key === "ArrowUp")
|
|
461
|
+
a.preventDefault(), y({ type: "SET_SELECTED", index: (l.selectedIndex - 1 + x) % x });
|
|
462
|
+
else if (a.key === "Enter") {
|
|
463
|
+
a.preventDefault();
|
|
464
|
+
const u = W[l.selectedIndex];
|
|
465
|
+
u && S(u.command.id);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
[W, l.selectedIndex, S]
|
|
470
|
+
);
|
|
471
|
+
A(() => {
|
|
472
|
+
if (!L.current)
|
|
473
|
+
return;
|
|
474
|
+
L.current.children[l.selectedIndex]?.scrollIntoView({ block: "nearest" });
|
|
475
|
+
}, [l.selectedIndex]);
|
|
476
|
+
const I = Pe(
|
|
477
|
+
() => ({
|
|
478
|
+
registerCommand: D,
|
|
479
|
+
unregisterCommand: c,
|
|
480
|
+
registerCommands: v,
|
|
481
|
+
open: r,
|
|
482
|
+
close: C,
|
|
483
|
+
toggle: _,
|
|
484
|
+
isOpen: l.isOpen,
|
|
485
|
+
executeCommand: S
|
|
486
|
+
}),
|
|
487
|
+
[
|
|
488
|
+
D,
|
|
489
|
+
c,
|
|
490
|
+
v,
|
|
491
|
+
r,
|
|
492
|
+
C,
|
|
493
|
+
_,
|
|
494
|
+
l.isOpen,
|
|
495
|
+
S
|
|
496
|
+
]
|
|
497
|
+
), z = Pe(() => {
|
|
498
|
+
const a = /* @__PURE__ */ new Map();
|
|
499
|
+
for (const x of W) {
|
|
500
|
+
const u = x.command.category ?? "General";
|
|
501
|
+
a.has(u) || a.set(u, []), a.get(u).push(x);
|
|
502
|
+
}
|
|
503
|
+
return a;
|
|
504
|
+
}, [W]);
|
|
505
|
+
let $ = 0;
|
|
506
|
+
return /* @__PURE__ */ g(Qe.Provider, { value: I, children: [
|
|
507
|
+
t,
|
|
508
|
+
l.isOpen && /* @__PURE__ */ e("div", { className: `nice-command-palette__overlay ${h ?? ""}`, onClick: C, children: /* @__PURE__ */ g(
|
|
509
|
+
"div",
|
|
510
|
+
{
|
|
511
|
+
className: "nice-command-palette",
|
|
512
|
+
role: "dialog",
|
|
513
|
+
"aria-label": "Command Palette",
|
|
514
|
+
"aria-modal": "true",
|
|
515
|
+
onClick: (a) => a.stopPropagation(),
|
|
516
|
+
children: [
|
|
517
|
+
/* @__PURE__ */ e("div", { className: "nice-command-palette__input-wrapper", children: /* @__PURE__ */ e(
|
|
518
|
+
"input",
|
|
519
|
+
{
|
|
520
|
+
ref: Y,
|
|
521
|
+
className: "nice-command-palette__input",
|
|
522
|
+
type: "text",
|
|
523
|
+
placeholder: i,
|
|
524
|
+
value: l.query,
|
|
525
|
+
onChange: (a) => y({ type: "SET_QUERY", query: a.target.value }),
|
|
526
|
+
onKeyDown: o,
|
|
527
|
+
"aria-label": "Search commands",
|
|
528
|
+
"aria-autocomplete": "list",
|
|
529
|
+
"aria-controls": "nice-command-palette-list",
|
|
530
|
+
"aria-activedescendant": W[l.selectedIndex] ? `nice-cmd-${W[l.selectedIndex].command.id}` : void 0
|
|
531
|
+
}
|
|
532
|
+
) }),
|
|
533
|
+
/* @__PURE__ */ g(
|
|
534
|
+
"div",
|
|
535
|
+
{
|
|
536
|
+
ref: L,
|
|
537
|
+
id: "nice-command-palette-list",
|
|
538
|
+
className: "nice-command-palette__list",
|
|
539
|
+
role: "listbox",
|
|
540
|
+
children: [
|
|
541
|
+
W.length === 0 && /* @__PURE__ */ e("div", { className: "nice-command-palette__empty", children: p }),
|
|
542
|
+
Array.from(z.entries()).map(([a, x]) => /* @__PURE__ */ g("div", { className: "nice-command-palette__group", children: [
|
|
543
|
+
/* @__PURE__ */ e("div", { className: "nice-command-palette__category", children: a }),
|
|
544
|
+
x.map((u) => {
|
|
545
|
+
const T = $++, f = T === l.selectedIndex;
|
|
546
|
+
return /* @__PURE__ */ g(
|
|
547
|
+
"div",
|
|
548
|
+
{
|
|
549
|
+
id: `nice-cmd-${u.command.id}`,
|
|
550
|
+
className: `nice-command-palette__item ${f ? "nice-command-palette__item--selected" : ""} ${u.command.disabled ? "nice-command-palette__item--disabled" : ""}`,
|
|
551
|
+
role: "option",
|
|
552
|
+
"aria-selected": f,
|
|
553
|
+
"aria-disabled": u.command.disabled,
|
|
554
|
+
onClick: () => !u.command.disabled && S(u.command.id),
|
|
555
|
+
onMouseEnter: () => y({ type: "SET_SELECTED", index: T }),
|
|
556
|
+
children: [
|
|
557
|
+
u.command.icon && /* @__PURE__ */ e("span", { className: "nice-command-palette__icon", children: u.command.icon }),
|
|
558
|
+
/* @__PURE__ */ g("div", { className: "nice-command-palette__label-group", children: [
|
|
559
|
+
/* @__PURE__ */ e("span", { className: "nice-command-palette__label", children: u.match && l.query ? xt(u.command.label, u.match.indices) : u.command.label }),
|
|
560
|
+
u.command.description && /* @__PURE__ */ e("span", { className: "nice-command-palette__description", children: u.command.description })
|
|
561
|
+
] }),
|
|
562
|
+
u.command.shortcut && /* @__PURE__ */ e("kbd", { className: "nice-command-palette__shortcut", children: u.command.shortcut }),
|
|
563
|
+
u.isRecent && /* @__PURE__ */ e("span", { className: "nice-command-palette__recent-badge", children: "Recent" })
|
|
564
|
+
]
|
|
565
|
+
},
|
|
566
|
+
u.command.id
|
|
567
|
+
);
|
|
568
|
+
})
|
|
569
|
+
] }, a))
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
k && /* @__PURE__ */ e("div", { className: "nice-command-palette__executing", children: "Executing..." })
|
|
574
|
+
]
|
|
575
|
+
}
|
|
576
|
+
) })
|
|
577
|
+
] });
|
|
578
|
+
};
|
|
579
|
+
Et.displayName = "NiceCommandPaletteProvider";
|
|
580
|
+
function Qt(t) {
|
|
581
|
+
const { registerCommands: n, unregisterCommand: i } = kt();
|
|
582
|
+
A(() => (n(t), () => {
|
|
583
|
+
for (const s of t)
|
|
584
|
+
i(s.id);
|
|
585
|
+
}), []);
|
|
586
|
+
}
|
|
587
|
+
const zt = Ue(
|
|
588
|
+
({ blocked: t, message: n, spinner: i, blur: s, children: m, className: h, style: p, id: w }, d) => {
|
|
589
|
+
const b = He(w);
|
|
590
|
+
return /* @__PURE__ */ g(
|
|
591
|
+
"div",
|
|
592
|
+
{
|
|
593
|
+
ref: d,
|
|
594
|
+
id: b,
|
|
595
|
+
className: `nice-block-ui ${h || ""}`,
|
|
596
|
+
style: { position: "relative", ...p },
|
|
597
|
+
children: [
|
|
598
|
+
m,
|
|
599
|
+
t && /* @__PURE__ */ e(
|
|
600
|
+
"div",
|
|
601
|
+
{
|
|
602
|
+
className: `nice-block-ui__overlay${s ? " nice-block-ui__overlay--blur" : ""}`,
|
|
603
|
+
"aria-busy": "true",
|
|
604
|
+
role: "alert",
|
|
605
|
+
children: (i || n) && /* @__PURE__ */ g("div", { className: "nice-block-ui__content", children: [
|
|
606
|
+
i && /* @__PURE__ */ e("div", { className: "nice-block-ui__spinner", "aria-hidden": "true" }),
|
|
607
|
+
n && /* @__PURE__ */ e("div", { className: "nice-block-ui__message", children: n })
|
|
608
|
+
] })
|
|
609
|
+
}
|
|
610
|
+
)
|
|
611
|
+
]
|
|
612
|
+
}
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
zt.displayName = "NiceBlockUI";
|
|
617
|
+
const Ct = Ue(
|
|
618
|
+
({
|
|
619
|
+
windows: t,
|
|
620
|
+
children: n,
|
|
621
|
+
onChange: i,
|
|
622
|
+
onClose: s,
|
|
623
|
+
onFocus: m,
|
|
624
|
+
showTaskbar: h = !0,
|
|
625
|
+
size: p = "md",
|
|
626
|
+
className: w,
|
|
627
|
+
style: d,
|
|
628
|
+
id: b,
|
|
629
|
+
...l
|
|
630
|
+
}, y) => {
|
|
631
|
+
const Y = He(b), { t: L } = Ye(), [k, E] = O(null), D = V(null), c = t ?? [], v = Math.max(1, ...c.map((o) => o.zIndex ?? 1)), r = N(
|
|
632
|
+
(o, I) => {
|
|
633
|
+
const z = c.map(($) => $.key === o ? { ...$, ...I } : $);
|
|
634
|
+
i?.(z);
|
|
635
|
+
},
|
|
636
|
+
[c, i]
|
|
637
|
+
), C = N(
|
|
638
|
+
(o) => {
|
|
639
|
+
r(o, { zIndex: v + 1 }), m?.(o);
|
|
640
|
+
},
|
|
641
|
+
[r, v, m]
|
|
642
|
+
), _ = N(
|
|
643
|
+
(o) => {
|
|
644
|
+
s?.(o), i?.(c.filter((I) => I.key !== o));
|
|
645
|
+
},
|
|
646
|
+
[c, i, s]
|
|
647
|
+
), j = N(
|
|
648
|
+
(o) => {
|
|
649
|
+
const I = c.find((z) => z.key === o);
|
|
650
|
+
I && r(o, { minimized: !I.minimized, maximized: !1 });
|
|
651
|
+
},
|
|
652
|
+
[c, r]
|
|
653
|
+
), W = N(
|
|
654
|
+
(o) => {
|
|
655
|
+
const I = c.find((z) => z.key === o);
|
|
656
|
+
I && r(o, { maximized: !I.maximized, minimized: !1 });
|
|
657
|
+
},
|
|
658
|
+
[c, r]
|
|
659
|
+
);
|
|
660
|
+
A(() => {
|
|
661
|
+
if (!k)
|
|
662
|
+
return;
|
|
663
|
+
const o = (z) => {
|
|
664
|
+
const $ = c.find((a) => a.key === k.key);
|
|
665
|
+
if ($)
|
|
666
|
+
if (k.mode === "move")
|
|
667
|
+
r(k.key, {
|
|
668
|
+
x: z.clientX - k.offsetX,
|
|
669
|
+
y: z.clientY - k.offsetY
|
|
670
|
+
});
|
|
671
|
+
else {
|
|
672
|
+
const x = D.current?.getBoundingClientRect(), u = x?.left ?? 0, T = x?.top ?? 0;
|
|
673
|
+
r(k.key, {
|
|
674
|
+
width: Math.max(200, z.clientX - u - $.x),
|
|
675
|
+
height: Math.max(100, z.clientY - T - $.y)
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
}, I = () => E(null);
|
|
679
|
+
return document.addEventListener("mousemove", o), document.addEventListener("mouseup", I), () => {
|
|
680
|
+
document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", I);
|
|
681
|
+
};
|
|
682
|
+
}, [k, c, r]);
|
|
683
|
+
const S = N(
|
|
684
|
+
(o, I, z) => {
|
|
685
|
+
I.preventDefault();
|
|
686
|
+
const $ = c.find((a) => a.key === o);
|
|
687
|
+
$ && (C(o), E({
|
|
688
|
+
key: o,
|
|
689
|
+
offsetX: z === "move" ? I.clientX - $.x : 0,
|
|
690
|
+
offsetY: z === "move" ? I.clientY - $.y : 0,
|
|
691
|
+
mode: z
|
|
692
|
+
}));
|
|
693
|
+
},
|
|
694
|
+
[c, C]
|
|
695
|
+
);
|
|
696
|
+
return /* @__PURE__ */ g(
|
|
697
|
+
"div",
|
|
698
|
+
{
|
|
699
|
+
ref: (o) => {
|
|
700
|
+
D.current = o, typeof y == "function" ? y(o) : y && (y.current = o);
|
|
701
|
+
},
|
|
702
|
+
id: Y,
|
|
703
|
+
className: `nice-wm nice-wm--${p} ${w ?? ""}`,
|
|
704
|
+
style: { ...d, position: "relative", overflow: "hidden" },
|
|
705
|
+
...l,
|
|
706
|
+
children: [
|
|
707
|
+
c.map((o) => {
|
|
708
|
+
if (o.minimized)
|
|
709
|
+
return null;
|
|
710
|
+
const I = o.maximized, z = I ? {
|
|
711
|
+
position: "absolute",
|
|
712
|
+
top: 0,
|
|
713
|
+
left: 0,
|
|
714
|
+
width: "100%",
|
|
715
|
+
height: "100%",
|
|
716
|
+
zIndex: o.zIndex ?? 1
|
|
717
|
+
} : {
|
|
718
|
+
position: "absolute",
|
|
719
|
+
top: o.y,
|
|
720
|
+
left: o.x,
|
|
721
|
+
width: o.width,
|
|
722
|
+
height: o.height,
|
|
723
|
+
zIndex: o.zIndex ?? 1
|
|
724
|
+
};
|
|
725
|
+
return /* @__PURE__ */ g(
|
|
726
|
+
"div",
|
|
727
|
+
{
|
|
728
|
+
className: `nice-wm__window ${I ? "nice-wm__window--maximized" : ""}`,
|
|
729
|
+
style: z,
|
|
730
|
+
onMouseDown: () => C(o.key),
|
|
731
|
+
role: "dialog",
|
|
732
|
+
"aria-label": o.title,
|
|
733
|
+
children: [
|
|
734
|
+
/* @__PURE__ */ g(
|
|
735
|
+
"div",
|
|
736
|
+
{
|
|
737
|
+
className: "nice-wm__titlebar",
|
|
738
|
+
onMouseDown: ($) => !I && S(o.key, $, "move"),
|
|
739
|
+
children: [
|
|
740
|
+
o.icon && /* @__PURE__ */ e("span", { className: "nice-wm__icon", children: o.icon }),
|
|
741
|
+
/* @__PURE__ */ e("span", { className: "nice-wm__title", children: o.title }),
|
|
742
|
+
/* @__PURE__ */ g("div", { className: "nice-wm__controls", children: [
|
|
743
|
+
(o.minimizable ?? !0) && /* @__PURE__ */ e(
|
|
744
|
+
"button",
|
|
745
|
+
{
|
|
746
|
+
type: "button",
|
|
747
|
+
className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--min",
|
|
748
|
+
onClick: () => j(o.key),
|
|
749
|
+
title: L("wm.minimize", "Minimize"),
|
|
750
|
+
children: /* @__PURE__ */ e(me, { name: "minus", size: 14 })
|
|
751
|
+
}
|
|
752
|
+
),
|
|
753
|
+
(o.maximizable ?? !0) && /* @__PURE__ */ e(
|
|
754
|
+
"button",
|
|
755
|
+
{
|
|
756
|
+
type: "button",
|
|
757
|
+
className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--max",
|
|
758
|
+
onClick: () => W(o.key),
|
|
759
|
+
title: L("wm.maximize", "Maximize"),
|
|
760
|
+
children: /* @__PURE__ */ e(me, { name: I ? "copy" : "window", size: 14 })
|
|
761
|
+
}
|
|
762
|
+
),
|
|
763
|
+
(o.closable ?? !0) && /* @__PURE__ */ e(
|
|
764
|
+
"button",
|
|
765
|
+
{
|
|
766
|
+
type: "button",
|
|
767
|
+
className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--close",
|
|
768
|
+
onClick: () => _(o.key),
|
|
769
|
+
title: L("wm.close", "Close"),
|
|
770
|
+
children: /* @__PURE__ */ e(me, { name: "close", size: 14 })
|
|
771
|
+
}
|
|
772
|
+
)
|
|
773
|
+
] })
|
|
774
|
+
]
|
|
775
|
+
}
|
|
776
|
+
),
|
|
777
|
+
/* @__PURE__ */ e("div", { className: "nice-wm__body", children: o.content }),
|
|
778
|
+
(o.resizable ?? !0) && !I && /* @__PURE__ */ e(
|
|
779
|
+
"div",
|
|
780
|
+
{
|
|
781
|
+
className: "nice-wm__resize-handle",
|
|
782
|
+
onMouseDown: ($) => S(o.key, $, "resize")
|
|
783
|
+
}
|
|
784
|
+
)
|
|
785
|
+
]
|
|
786
|
+
},
|
|
787
|
+
o.key
|
|
788
|
+
);
|
|
789
|
+
}),
|
|
790
|
+
t === void 0 && n,
|
|
791
|
+
h && /* @__PURE__ */ e("div", { className: "nice-wm__taskbar", role: "toolbar", "aria-label": L("wm.taskbar", "Taskbar"), children: c.map((o) => /* @__PURE__ */ g(
|
|
792
|
+
"button",
|
|
793
|
+
{
|
|
794
|
+
type: "button",
|
|
795
|
+
className: `nice-wm__taskbar-btn ${o.minimized ? "nice-wm__taskbar-btn--minimized" : ""}`,
|
|
796
|
+
onClick: () => {
|
|
797
|
+
o.minimized && j(o.key), C(o.key);
|
|
798
|
+
},
|
|
799
|
+
children: [
|
|
800
|
+
o.icon && /* @__PURE__ */ e("span", { className: "nice-wm__taskbar-icon", children: o.icon }),
|
|
801
|
+
/* @__PURE__ */ e("span", { className: "nice-wm__taskbar-label", children: o.title })
|
|
802
|
+
]
|
|
803
|
+
},
|
|
804
|
+
o.key
|
|
805
|
+
)) })
|
|
806
|
+
]
|
|
807
|
+
}
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
);
|
|
811
|
+
Ct.displayName = "NiceWindowManager";
|
|
812
|
+
function It(t, n) {
|
|
813
|
+
const i = document.querySelector(t);
|
|
814
|
+
if (!i)
|
|
815
|
+
return null;
|
|
816
|
+
const s = i.getBoundingClientRect();
|
|
817
|
+
return {
|
|
818
|
+
top: s.top - n + window.scrollY,
|
|
819
|
+
left: s.left - n + window.scrollX,
|
|
820
|
+
width: s.width + n * 2,
|
|
821
|
+
height: s.height + n * 2
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
function Mt(t, n, i, s) {
|
|
825
|
+
const h = { w: window.innerWidth, h: window.innerHeight + window.scrollY }, p = {
|
|
826
|
+
top: {
|
|
827
|
+
top: t.top - i - 12,
|
|
828
|
+
left: t.left + t.width / 2 - n / 2
|
|
829
|
+
},
|
|
830
|
+
bottom: {
|
|
831
|
+
top: t.top + t.height + 12,
|
|
832
|
+
left: t.left + t.width / 2 - n / 2
|
|
833
|
+
},
|
|
834
|
+
left: {
|
|
835
|
+
top: t.top + t.height / 2 - i / 2,
|
|
836
|
+
left: t.left - n - 12
|
|
837
|
+
},
|
|
838
|
+
right: {
|
|
839
|
+
top: t.top + t.height / 2 - i / 2,
|
|
840
|
+
left: t.left + t.width + 12
|
|
841
|
+
}
|
|
842
|
+
};
|
|
843
|
+
if (s && s !== "auto")
|
|
844
|
+
return { ...p[s], actualPlacement: s };
|
|
845
|
+
for (const w of ["bottom", "top", "right", "left"]) {
|
|
846
|
+
const d = p[w];
|
|
847
|
+
if (d.top >= 0 && d.left >= 0 && d.top + i <= h.h && d.left + n <= h.w)
|
|
848
|
+
return { ...d, actualPlacement: w };
|
|
849
|
+
}
|
|
850
|
+
return { ...p.bottom, actualPlacement: "bottom" };
|
|
851
|
+
}
|
|
852
|
+
const ke = {
|
|
853
|
+
width: 16,
|
|
854
|
+
height: 16,
|
|
855
|
+
viewBox: "0 0 24 24",
|
|
856
|
+
fill: "none",
|
|
857
|
+
stroke: "currentColor",
|
|
858
|
+
strokeWidth: 2,
|
|
859
|
+
strokeLinecap: "round",
|
|
860
|
+
strokeLinejoin: "round",
|
|
861
|
+
"aria-hidden": !0
|
|
862
|
+
};
|
|
863
|
+
function Lt() {
|
|
864
|
+
return /* @__PURE__ */ g("svg", { ...ke, children: [
|
|
865
|
+
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
866
|
+
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
867
|
+
] });
|
|
868
|
+
}
|
|
869
|
+
function Rt() {
|
|
870
|
+
return /* @__PURE__ */ e("svg", { ...ke, children: /* @__PURE__ */ e("polyline", { points: "15 18 9 12 15 6" }) });
|
|
871
|
+
}
|
|
872
|
+
function St() {
|
|
873
|
+
return /* @__PURE__ */ e("svg", { ...ke, children: /* @__PURE__ */ e("polyline", { points: "9 18 15 12 9 6" }) });
|
|
874
|
+
}
|
|
875
|
+
function $t() {
|
|
876
|
+
return /* @__PURE__ */ g("svg", { ...ke, children: [
|
|
877
|
+
/* @__PURE__ */ e("polygon", { points: "5 4 15 12 5 20 5 4" }),
|
|
878
|
+
/* @__PURE__ */ e("line", { x1: "19", y1: "5", x2: "19", y2: "19" })
|
|
879
|
+
] });
|
|
880
|
+
}
|
|
881
|
+
function Tt() {
|
|
882
|
+
return /* @__PURE__ */ e("svg", { ...ke, children: /* @__PURE__ */ e("polygon", { points: "6 4 20 12 6 20 6 4", fill: "currentColor" }) });
|
|
883
|
+
}
|
|
884
|
+
function Pt() {
|
|
885
|
+
return /* @__PURE__ */ g("svg", { ...ke, children: [
|
|
886
|
+
/* @__PURE__ */ e("rect", { x: "6", y: "4", width: "4", height: "16", fill: "currentColor" }),
|
|
887
|
+
/* @__PURE__ */ e("rect", { x: "14", y: "4", width: "4", height: "16", fill: "currentColor" })
|
|
888
|
+
] });
|
|
889
|
+
}
|
|
890
|
+
function Te(t, n, i) {
|
|
891
|
+
return i === "text" ? /* @__PURE__ */ e("span", { className: "nice-tutorial__btn-label", children: n }) : i === "icon-text" ? /* @__PURE__ */ g(Fe, { children: [
|
|
892
|
+
t,
|
|
893
|
+
/* @__PURE__ */ e("span", { className: "nice-tutorial__btn-label", children: n })
|
|
894
|
+
] }) : t;
|
|
895
|
+
}
|
|
896
|
+
const Yt = [], Ze = ({
|
|
897
|
+
steps: t = Yt,
|
|
898
|
+
active: n,
|
|
899
|
+
onFinish: i,
|
|
900
|
+
onSkip: s,
|
|
901
|
+
onStepChange: m,
|
|
902
|
+
closeOnEscape: h = !0,
|
|
903
|
+
closeOnOverlayClick: p = !1,
|
|
904
|
+
showProgress: w = !0,
|
|
905
|
+
showSkipButton: d = !0,
|
|
906
|
+
labels: b,
|
|
907
|
+
animationDuration: l = 300,
|
|
908
|
+
overlayOpacity: y = 0.6,
|
|
909
|
+
zIndex: Y = 1e4,
|
|
910
|
+
buttonsPlacement: L = "floating-bottom",
|
|
911
|
+
buttonsDisplay: k = "icon",
|
|
912
|
+
showAutoplay: E = !0,
|
|
913
|
+
autoplayInterval: D = 5e3,
|
|
914
|
+
autoplaySpeedRange: c = { min: 2e3, max: 15e3 },
|
|
915
|
+
onAutoplayChange: v
|
|
916
|
+
}) => {
|
|
917
|
+
const [r, C] = O(0), [_, j] = O(null), [W, S] = O({ w: 340, h: 200 }), [o, I] = O(!0), [z, $] = O(!1), [a, x] = O(D), u = V(null), T = V(-1), f = t[r], X = r === t.length - 1, F = r === 0, Q = b?.next ?? "Next", ne = b?.back ?? "Back", ie = b?.finish ?? "Finish", pe = b?.skip ?? "Skip", we = b?.stepOf ?? "of", _e = b?.play ?? "Play", ge = b?.pause ?? "Pause", Se = b?.speed ?? "Speed", Ee = b?.close ?? "Close";
|
|
918
|
+
A(() => {
|
|
919
|
+
n && (C(0), $(!1), x(D));
|
|
920
|
+
}, [n, D]), A(() => {
|
|
921
|
+
if (u.current) {
|
|
922
|
+
const R = u.current.getBoundingClientRect();
|
|
923
|
+
S({ w: R.width, h: R.height });
|
|
924
|
+
}
|
|
925
|
+
}, [r, n]), A(() => {
|
|
926
|
+
if (!n || !f)
|
|
927
|
+
return;
|
|
928
|
+
const R = f.highlightPadding ?? 0, P = () => {
|
|
929
|
+
const U = It(f.target, R);
|
|
930
|
+
j(U);
|
|
931
|
+
};
|
|
932
|
+
if (P(), f.scrollIntoView !== !1) {
|
|
933
|
+
document.querySelector(f.target)?.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
934
|
+
const Z = setTimeout(P, 350);
|
|
935
|
+
return () => clearTimeout(Z);
|
|
936
|
+
}
|
|
937
|
+
}, [n, f, r]), A(() => {
|
|
938
|
+
!n || !f || T.current !== r && (T.current >= 0 && T.current < t.length && t[T.current]?.onLeave?.(), f.onEnter?.(), T.current = r);
|
|
939
|
+
}, [n, f, r, t]);
|
|
940
|
+
const oe = N(() => {
|
|
941
|
+
if (X)
|
|
942
|
+
f?.onLeave?.(), i?.();
|
|
943
|
+
else {
|
|
944
|
+
const R = r + 1;
|
|
945
|
+
C(R), m?.(R);
|
|
946
|
+
}
|
|
947
|
+
}, [r, X, i, m, f]), ve = N(() => {
|
|
948
|
+
if (!F) {
|
|
949
|
+
const R = r - 1;
|
|
950
|
+
C(R), m?.(R);
|
|
951
|
+
}
|
|
952
|
+
}, [r, F, m]);
|
|
953
|
+
A(() => {
|
|
954
|
+
if (!n || !f?.advanceOn)
|
|
955
|
+
return;
|
|
956
|
+
const R = document.querySelector(f.target);
|
|
957
|
+
if (!R)
|
|
958
|
+
return;
|
|
959
|
+
const P = () => oe();
|
|
960
|
+
return R.addEventListener(f.advanceOn.event, P), () => R.removeEventListener(f.advanceOn.event, P);
|
|
961
|
+
}, [n, f, r, oe]), A(() => {
|
|
962
|
+
if (!n)
|
|
963
|
+
return;
|
|
964
|
+
const R = (P) => {
|
|
965
|
+
P.key === "Escape" && h ? s?.() : P.key === "ArrowRight" ? oe() : P.key === "ArrowLeft" && ve();
|
|
966
|
+
};
|
|
967
|
+
return document.addEventListener("keydown", R), () => document.removeEventListener("keydown", R);
|
|
968
|
+
}, [n, r, h, oe, ve, s]), A(() => {
|
|
969
|
+
I(!0);
|
|
970
|
+
const R = setTimeout(() => I(!1), l);
|
|
971
|
+
return () => clearTimeout(R);
|
|
972
|
+
}, [r, l]), A(() => {
|
|
973
|
+
if (!n || !z)
|
|
974
|
+
return;
|
|
975
|
+
const R = setInterval(
|
|
976
|
+
() => {
|
|
977
|
+
C((P) => {
|
|
978
|
+
if (P >= t.length - 1)
|
|
979
|
+
return $(!1), v?.(!1), t[P]?.onLeave?.(), i?.(), P;
|
|
980
|
+
const U = P + 1;
|
|
981
|
+
return m?.(U), U;
|
|
982
|
+
});
|
|
983
|
+
},
|
|
984
|
+
Math.max(500, a)
|
|
985
|
+
);
|
|
986
|
+
return () => clearInterval(R);
|
|
987
|
+
}, [n, z, a, t, v, i, m]);
|
|
988
|
+
const $e = N(() => {
|
|
989
|
+
$((R) => {
|
|
990
|
+
const P = !R;
|
|
991
|
+
return v?.(P), P;
|
|
992
|
+
});
|
|
993
|
+
}, [v]), be = Pe(() => _ ? Mt(_, W.w, W.h, f?.placement) : {
|
|
994
|
+
top: typeof window < "u" ? window.innerHeight / 2 : 0,
|
|
995
|
+
left: typeof window < "u" ? window.innerWidth / 2 : 0,
|
|
996
|
+
actualPlacement: "bottom"
|
|
997
|
+
}, [_, W, f?.placement]), ze = t.length === 0 ? 0 : (r + 1) / t.length * 100, ce = N(
|
|
998
|
+
(R) => {
|
|
999
|
+
const P = E && t.length > 1, U = d && !X && /* @__PURE__ */ e(
|
|
1000
|
+
"button",
|
|
1001
|
+
{
|
|
1002
|
+
type: "button",
|
|
1003
|
+
className: `nice-tutorial__btn nice-tutorial__btn--skip nice-tutorial__btn--${k}`,
|
|
1004
|
+
onClick: s,
|
|
1005
|
+
"aria-label": pe,
|
|
1006
|
+
title: pe,
|
|
1007
|
+
children: Te(/* @__PURE__ */ e($t, {}), pe, k)
|
|
1008
|
+
}
|
|
1009
|
+
), Z = !F && /* @__PURE__ */ e(
|
|
1010
|
+
"button",
|
|
1011
|
+
{
|
|
1012
|
+
type: "button",
|
|
1013
|
+
className: `nice-tutorial__btn nice-tutorial__btn--back nice-tutorial__btn--${k}`,
|
|
1014
|
+
onClick: ve,
|
|
1015
|
+
"aria-label": ne,
|
|
1016
|
+
title: ne,
|
|
1017
|
+
children: Te(/* @__PURE__ */ e(Rt, {}), ne, k)
|
|
1018
|
+
}
|
|
1019
|
+
), ye = !f?.waitForAction && /* @__PURE__ */ e(
|
|
1020
|
+
"button",
|
|
1021
|
+
{
|
|
1022
|
+
type: "button",
|
|
1023
|
+
className: `nice-tutorial__btn nice-tutorial__btn--next nice-tutorial__btn--${k}`,
|
|
1024
|
+
onClick: oe,
|
|
1025
|
+
"aria-label": X ? ie : Q,
|
|
1026
|
+
title: X ? ie : Q,
|
|
1027
|
+
children: Te(/* @__PURE__ */ e(St, {}), X ? ie : Q, k)
|
|
1028
|
+
}
|
|
1029
|
+
), xe = P && /* @__PURE__ */ e(
|
|
1030
|
+
"button",
|
|
1031
|
+
{
|
|
1032
|
+
type: "button",
|
|
1033
|
+
className: [
|
|
1034
|
+
"nice-tutorial__btn",
|
|
1035
|
+
"nice-tutorial__btn--play",
|
|
1036
|
+
`nice-tutorial__btn--${k}`,
|
|
1037
|
+
z ? "nice-tutorial__btn--active" : ""
|
|
1038
|
+
].filter(Boolean).join(" "),
|
|
1039
|
+
onClick: $e,
|
|
1040
|
+
"aria-label": z ? ge : _e,
|
|
1041
|
+
title: z ? ge : _e,
|
|
1042
|
+
"aria-pressed": z,
|
|
1043
|
+
children: Te(
|
|
1044
|
+
z ? /* @__PURE__ */ e(Pt, {}) : /* @__PURE__ */ e(Tt, {}),
|
|
1045
|
+
z ? ge : _e,
|
|
1046
|
+
k
|
|
1047
|
+
)
|
|
1048
|
+
}
|
|
1049
|
+
);
|
|
1050
|
+
return /* @__PURE__ */ g(
|
|
1051
|
+
"div",
|
|
1052
|
+
{
|
|
1053
|
+
className: [
|
|
1054
|
+
"nice-tutorial__controls",
|
|
1055
|
+
R ? "nice-tutorial__controls--inline" : "nice-tutorial__controls--floating-bottom"
|
|
1056
|
+
].join(" "),
|
|
1057
|
+
style: R ? void 0 : { zIndex: Y + 2 },
|
|
1058
|
+
role: "group",
|
|
1059
|
+
"aria-label": "Tutorial controls",
|
|
1060
|
+
children: [
|
|
1061
|
+
U,
|
|
1062
|
+
Z,
|
|
1063
|
+
w && /* @__PURE__ */ g("span", { className: "nice-tutorial__step-label", "aria-live": "polite", children: [
|
|
1064
|
+
r + 1,
|
|
1065
|
+
" ",
|
|
1066
|
+
we,
|
|
1067
|
+
" ",
|
|
1068
|
+
t.length
|
|
1069
|
+
] }),
|
|
1070
|
+
ye,
|
|
1071
|
+
P && /* @__PURE__ */ e(
|
|
1072
|
+
"div",
|
|
1073
|
+
{
|
|
1074
|
+
className: "nice-tutorial__progress-bar",
|
|
1075
|
+
role: "progressbar",
|
|
1076
|
+
"aria-valuenow": Math.round(ze),
|
|
1077
|
+
"aria-valuemin": 0,
|
|
1078
|
+
"aria-valuemax": 100,
|
|
1079
|
+
"aria-label": `${r + 1} ${we} ${t.length}`,
|
|
1080
|
+
children: /* @__PURE__ */ e(
|
|
1081
|
+
"div",
|
|
1082
|
+
{
|
|
1083
|
+
className: "nice-tutorial__progress-bar-fill",
|
|
1084
|
+
style: { width: `${ze}%` }
|
|
1085
|
+
}
|
|
1086
|
+
)
|
|
1087
|
+
}
|
|
1088
|
+
),
|
|
1089
|
+
xe,
|
|
1090
|
+
P && /* @__PURE__ */ g("label", { className: "nice-tutorial__speed", children: [
|
|
1091
|
+
/* @__PURE__ */ e(
|
|
1092
|
+
"input",
|
|
1093
|
+
{
|
|
1094
|
+
type: "range",
|
|
1095
|
+
className: "nice-tutorial__speed-slider",
|
|
1096
|
+
min: c.min,
|
|
1097
|
+
max: c.max,
|
|
1098
|
+
step: 500,
|
|
1099
|
+
value: c.min + c.max - a,
|
|
1100
|
+
onChange: (De) => x(c.min + c.max - Number(De.target.value)),
|
|
1101
|
+
"aria-label": Se
|
|
1102
|
+
}
|
|
1103
|
+
),
|
|
1104
|
+
/* @__PURE__ */ g("span", { className: "nice-tutorial__speed-value", children: [
|
|
1105
|
+
(a / 1e3).toFixed(1),
|
|
1106
|
+
"s"
|
|
1107
|
+
] })
|
|
1108
|
+
] })
|
|
1109
|
+
]
|
|
1110
|
+
}
|
|
1111
|
+
);
|
|
1112
|
+
},
|
|
1113
|
+
[
|
|
1114
|
+
E,
|
|
1115
|
+
d,
|
|
1116
|
+
w,
|
|
1117
|
+
k,
|
|
1118
|
+
F,
|
|
1119
|
+
X,
|
|
1120
|
+
s,
|
|
1121
|
+
pe,
|
|
1122
|
+
ne,
|
|
1123
|
+
Q,
|
|
1124
|
+
ie,
|
|
1125
|
+
_e,
|
|
1126
|
+
ge,
|
|
1127
|
+
Se,
|
|
1128
|
+
we,
|
|
1129
|
+
ve,
|
|
1130
|
+
oe,
|
|
1131
|
+
f,
|
|
1132
|
+
z,
|
|
1133
|
+
$e,
|
|
1134
|
+
r,
|
|
1135
|
+
t.length,
|
|
1136
|
+
ze,
|
|
1137
|
+
a,
|
|
1138
|
+
c,
|
|
1139
|
+
Y
|
|
1140
|
+
]
|
|
1141
|
+
);
|
|
1142
|
+
if (!n || !f)
|
|
1143
|
+
return null;
|
|
1144
|
+
const Ce = typeof document < "u" ? Math.max(document.documentElement.scrollWidth, window.innerWidth) : 0, q = typeof document < "u" ? Math.max(document.documentElement.scrollHeight, window.innerHeight) : 0;
|
|
1145
|
+
return /* @__PURE__ */ g(
|
|
1146
|
+
"div",
|
|
1147
|
+
{
|
|
1148
|
+
className: "nice-tutorial",
|
|
1149
|
+
style: { zIndex: Y },
|
|
1150
|
+
"aria-modal": "true",
|
|
1151
|
+
role: "dialog",
|
|
1152
|
+
"aria-label": "Tutorial",
|
|
1153
|
+
children: [
|
|
1154
|
+
/* @__PURE__ */ g(
|
|
1155
|
+
"svg",
|
|
1156
|
+
{
|
|
1157
|
+
className: "nice-tutorial__overlay",
|
|
1158
|
+
style: {
|
|
1159
|
+
position: "absolute",
|
|
1160
|
+
top: 0,
|
|
1161
|
+
left: 0,
|
|
1162
|
+
width: Ce,
|
|
1163
|
+
height: q,
|
|
1164
|
+
pointerEvents: "auto"
|
|
1165
|
+
},
|
|
1166
|
+
onClick: p ? s : void 0,
|
|
1167
|
+
children: [
|
|
1168
|
+
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */ g("mask", { id: "nice-tutorial-mask", children: [
|
|
1169
|
+
/* @__PURE__ */ e("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "white" }),
|
|
1170
|
+
_ && /* @__PURE__ */ e(
|
|
1171
|
+
"rect",
|
|
1172
|
+
{
|
|
1173
|
+
x: _.left,
|
|
1174
|
+
y: _.top,
|
|
1175
|
+
width: _.width,
|
|
1176
|
+
height: _.height,
|
|
1177
|
+
rx: "4",
|
|
1178
|
+
fill: "black",
|
|
1179
|
+
className: o ? "nice-tutorial__spotlight--entering" : ""
|
|
1180
|
+
}
|
|
1181
|
+
)
|
|
1182
|
+
] }) }),
|
|
1183
|
+
/* @__PURE__ */ e(
|
|
1184
|
+
"rect",
|
|
1185
|
+
{
|
|
1186
|
+
x: "0",
|
|
1187
|
+
y: "0",
|
|
1188
|
+
width: "100%",
|
|
1189
|
+
height: "100%",
|
|
1190
|
+
fill: `rgba(0,0,0,${y})`,
|
|
1191
|
+
mask: "url(#nice-tutorial-mask)"
|
|
1192
|
+
}
|
|
1193
|
+
)
|
|
1194
|
+
]
|
|
1195
|
+
}
|
|
1196
|
+
),
|
|
1197
|
+
_ && /* @__PURE__ */ e(
|
|
1198
|
+
"div",
|
|
1199
|
+
{
|
|
1200
|
+
className: `nice-tutorial__highlight ${o ? "nice-tutorial__highlight--entering" : ""}`,
|
|
1201
|
+
style: {
|
|
1202
|
+
position: "absolute",
|
|
1203
|
+
top: _.top,
|
|
1204
|
+
left: _.left,
|
|
1205
|
+
width: _.width,
|
|
1206
|
+
height: _.height,
|
|
1207
|
+
transition: `all ${l}ms ease`
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
),
|
|
1211
|
+
f.disableInteraction && _ && /* @__PURE__ */ e(
|
|
1212
|
+
"div",
|
|
1213
|
+
{
|
|
1214
|
+
className: "nice-tutorial__blocker",
|
|
1215
|
+
style: {
|
|
1216
|
+
position: "absolute",
|
|
1217
|
+
top: _.top,
|
|
1218
|
+
left: _.left,
|
|
1219
|
+
width: _.width,
|
|
1220
|
+
height: _.height
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
),
|
|
1224
|
+
/* @__PURE__ */ g(
|
|
1225
|
+
"div",
|
|
1226
|
+
{
|
|
1227
|
+
ref: u,
|
|
1228
|
+
className: `nice-tutorial__tooltip nice-tutorial__tooltip--${be.actualPlacement} ${o ? "nice-tutorial__tooltip--entering" : ""}`,
|
|
1229
|
+
style: {
|
|
1230
|
+
position: "absolute",
|
|
1231
|
+
top: be.top,
|
|
1232
|
+
left: be.left,
|
|
1233
|
+
transition: `all ${l}ms ease`,
|
|
1234
|
+
maxWidth: 380,
|
|
1235
|
+
zIndex: Y + 1
|
|
1236
|
+
},
|
|
1237
|
+
children: [
|
|
1238
|
+
f.showArrow !== !1 && /* @__PURE__ */ e(
|
|
1239
|
+
"div",
|
|
1240
|
+
{
|
|
1241
|
+
className: `nice-tutorial__arrow nice-tutorial__arrow--${be.actualPlacement}`
|
|
1242
|
+
}
|
|
1243
|
+
),
|
|
1244
|
+
/* @__PURE__ */ g("div", { className: "nice-tutorial__header", children: [
|
|
1245
|
+
/* @__PURE__ */ e("h4", { className: "nice-tutorial__title", children: f.title }),
|
|
1246
|
+
d && /* @__PURE__ */ e(
|
|
1247
|
+
"button",
|
|
1248
|
+
{
|
|
1249
|
+
type: "button",
|
|
1250
|
+
className: "nice-tutorial__close",
|
|
1251
|
+
onClick: s,
|
|
1252
|
+
"aria-label": Ee,
|
|
1253
|
+
title: Ee,
|
|
1254
|
+
children: /* @__PURE__ */ e(Lt, {})
|
|
1255
|
+
}
|
|
1256
|
+
)
|
|
1257
|
+
] }),
|
|
1258
|
+
/* @__PURE__ */ e(
|
|
1259
|
+
"div",
|
|
1260
|
+
{
|
|
1261
|
+
className: "nice-tutorial__content",
|
|
1262
|
+
dangerouslySetInnerHTML: { __html: gt(f.content) }
|
|
1263
|
+
}
|
|
1264
|
+
),
|
|
1265
|
+
L === "inline" && ce(!0)
|
|
1266
|
+
]
|
|
1267
|
+
}
|
|
1268
|
+
),
|
|
1269
|
+
L === "floating-bottom" && ce(!1)
|
|
1270
|
+
]
|
|
1271
|
+
}
|
|
1272
|
+
);
|
|
1273
|
+
};
|
|
1274
|
+
Ze.displayName = "NiceTutorial";
|
|
1275
|
+
const Je = Ve({
|
|
1276
|
+
startTutorial: () => {
|
|
1277
|
+
},
|
|
1278
|
+
stopTutorial: () => {
|
|
1279
|
+
},
|
|
1280
|
+
isActive: !1,
|
|
1281
|
+
currentStep: 0,
|
|
1282
|
+
nextStep: () => {
|
|
1283
|
+
},
|
|
1284
|
+
prevStep: () => {
|
|
1285
|
+
},
|
|
1286
|
+
goToStep: () => {
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
function Zt() {
|
|
1290
|
+
return je(Je);
|
|
1291
|
+
}
|
|
1292
|
+
const Dt = ({ children: t }) => {
|
|
1293
|
+
const [n, i] = O([]), [s, m] = O(!1), [h, p] = O(0), w = N((L) => {
|
|
1294
|
+
i(L), p(0), m(!0);
|
|
1295
|
+
}, []), d = N(() => {
|
|
1296
|
+
m(!1), p(0), i([]);
|
|
1297
|
+
}, []), b = N(() => {
|
|
1298
|
+
p((L) => Math.min(L + 1, n.length - 1));
|
|
1299
|
+
}, [n.length]), l = N(() => {
|
|
1300
|
+
p((L) => Math.max(L - 1, 0));
|
|
1301
|
+
}, []), y = N(
|
|
1302
|
+
(L) => {
|
|
1303
|
+
p(Math.max(0, Math.min(L, n.length - 1)));
|
|
1304
|
+
},
|
|
1305
|
+
[n.length]
|
|
1306
|
+
), Y = {
|
|
1307
|
+
startTutorial: w,
|
|
1308
|
+
stopTutorial: d,
|
|
1309
|
+
isActive: s,
|
|
1310
|
+
currentStep: h,
|
|
1311
|
+
nextStep: b,
|
|
1312
|
+
prevStep: l,
|
|
1313
|
+
goToStep: y
|
|
1314
|
+
};
|
|
1315
|
+
return /* @__PURE__ */ g(Je.Provider, { value: Y, children: [
|
|
1316
|
+
t,
|
|
1317
|
+
s && n.length > 0 && /* @__PURE__ */ e(
|
|
1318
|
+
Ze,
|
|
1319
|
+
{
|
|
1320
|
+
steps: n,
|
|
1321
|
+
active: s,
|
|
1322
|
+
onFinish: d,
|
|
1323
|
+
onSkip: d,
|
|
1324
|
+
onStepChange: p
|
|
1325
|
+
}
|
|
1326
|
+
)
|
|
1327
|
+
] });
|
|
1328
|
+
};
|
|
1329
|
+
Dt.displayName = "NiceTutorialProvider";
|
|
1330
|
+
function Xt(t, n, i, s, m) {
|
|
1331
|
+
const h = t <= m, p = t + m >= i, w = n <= m, d = n + m >= s;
|
|
1332
|
+
return w && h ? "top-left" : w && p ? "top-right" : d && h ? "bottom-left" : d && p ? "bottom-right" : h ? "left" : p ? "right" : w ? "top" : d ? "bottom" : "none";
|
|
1333
|
+
}
|
|
1334
|
+
function Bt(t) {
|
|
1335
|
+
switch (t) {
|
|
1336
|
+
case "left":
|
|
1337
|
+
return { left: 0, top: 0, width: "50%", height: "100%" };
|
|
1338
|
+
case "right":
|
|
1339
|
+
return { left: "50%", top: 0, width: "50%", height: "100%" };
|
|
1340
|
+
case "top":
|
|
1341
|
+
return { left: 0, top: 0, width: "100%", height: "50%" };
|
|
1342
|
+
case "bottom":
|
|
1343
|
+
return { left: 0, top: "50%", width: "100%", height: "50%" };
|
|
1344
|
+
case "top-left":
|
|
1345
|
+
return { left: 0, top: 0, width: "50%", height: "50%" };
|
|
1346
|
+
case "top-right":
|
|
1347
|
+
return { left: "50%", top: 0, width: "50%", height: "50%" };
|
|
1348
|
+
case "bottom-left":
|
|
1349
|
+
return { left: 0, top: "50%", width: "50%", height: "50%" };
|
|
1350
|
+
case "bottom-right":
|
|
1351
|
+
return { left: "50%", top: "50%", width: "50%", height: "50%" };
|
|
1352
|
+
default:
|
|
1353
|
+
return null;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
const Ot = Ue(
|
|
1357
|
+
({
|
|
1358
|
+
windowKey: t,
|
|
1359
|
+
title: n,
|
|
1360
|
+
icon: i,
|
|
1361
|
+
children: s,
|
|
1362
|
+
footer: m,
|
|
1363
|
+
x: h,
|
|
1364
|
+
y: p,
|
|
1365
|
+
defaultPosition: w,
|
|
1366
|
+
width: d = 480,
|
|
1367
|
+
height: b = 360,
|
|
1368
|
+
minWidth: l = 200,
|
|
1369
|
+
minHeight: y = 120,
|
|
1370
|
+
maxWidth: Y,
|
|
1371
|
+
maxHeight: L,
|
|
1372
|
+
zIndex: k = 1,
|
|
1373
|
+
closable: E = !0,
|
|
1374
|
+
minimizable: D = !0,
|
|
1375
|
+
maximizable: c = !0,
|
|
1376
|
+
fullscreenable: v = !1,
|
|
1377
|
+
pinnable: r = !1,
|
|
1378
|
+
resizable: C = !0,
|
|
1379
|
+
draggable: _ = !0,
|
|
1380
|
+
snappable: j = !0,
|
|
1381
|
+
snapThreshold: W = 20,
|
|
1382
|
+
minimized: S,
|
|
1383
|
+
maximized: o,
|
|
1384
|
+
fullscreen: I,
|
|
1385
|
+
pinned: z,
|
|
1386
|
+
focused: $,
|
|
1387
|
+
onClose: a,
|
|
1388
|
+
onMinimize: x,
|
|
1389
|
+
onMaximize: u,
|
|
1390
|
+
onFullscreen: T,
|
|
1391
|
+
onPin: f,
|
|
1392
|
+
onFocus: X,
|
|
1393
|
+
onMove: F,
|
|
1394
|
+
onResize: Q,
|
|
1395
|
+
onSnap: ne,
|
|
1396
|
+
onTitleBarDoubleClick: ie,
|
|
1397
|
+
size: pe = "md",
|
|
1398
|
+
statusBar: we,
|
|
1399
|
+
titleBarActions: _e,
|
|
1400
|
+
className: ge,
|
|
1401
|
+
style: Se,
|
|
1402
|
+
id: Ee,
|
|
1403
|
+
accessMode: oe,
|
|
1404
|
+
...ve
|
|
1405
|
+
}, $e) => {
|
|
1406
|
+
const be = He(Ee), ze = vt(oe, Ee), { t: ce } = Ye(), Ce = V(null);
|
|
1407
|
+
Ce.current == null && (Ce.current = `nice-window-${Math.random().toString(36).slice(2, 10)}`);
|
|
1408
|
+
const q = t ?? Ce.current, R = h ?? w?.x ?? 100, P = p ?? w?.y ?? 100;
|
|
1409
|
+
if (ze === "hidden")
|
|
1410
|
+
return null;
|
|
1411
|
+
const [U, Z] = O({ x: R, y: P }), [ye, xe] = O({ width: d, height: b }), [De, et] = O(!1), [tt, nt] = O(!1), [it, ot] = O(!1), [ct, rt] = O(!1), [ee, Xe] = O("none"), st = S ?? De, J = o ?? tt, G = I ?? it, Ie = z ?? ct, Be = $ ?? !0, he = U.x, fe = U.y, re = ye.width, se = ye.height, le = V(
|
|
1412
|
+
null
|
|
1413
|
+
), K = V(null), B = V(null), lt = N(() => {
|
|
1414
|
+
a?.(q);
|
|
1415
|
+
}, [q, a]), at = N(() => {
|
|
1416
|
+
et(!0), x?.(q);
|
|
1417
|
+
}, [q, x]), Oe = N(() => {
|
|
1418
|
+
const M = !J;
|
|
1419
|
+
nt(M), !M && B.current ? (Z({ x: B.current.x, y: B.current.y }), xe({ width: B.current.w, height: B.current.h }), B.current = null) : M && (B.current = { x: he, y: fe, w: re, h: se }), Xe("none"), u?.(q, M);
|
|
1420
|
+
}, [q, J, he, fe, re, se, u]), qe = N(() => {
|
|
1421
|
+
const M = !G;
|
|
1422
|
+
ot(M), M ? B.current = { x: he, y: fe, w: re, h: se } : B.current && (Z({ x: B.current.x, y: B.current.y }), xe({ width: B.current.w, height: B.current.h }), B.current = null), T?.(q, M);
|
|
1423
|
+
}, [q, G, he, fe, re, se, T]), dt = N(() => {
|
|
1424
|
+
const M = !Ie;
|
|
1425
|
+
rt(M), f?.(q, M);
|
|
1426
|
+
}, [q, Ie, f]), Me = N(() => {
|
|
1427
|
+
X?.(q);
|
|
1428
|
+
}, [q, X]), ut = N(() => {
|
|
1429
|
+
ie ? ie(q) : c && Oe();
|
|
1430
|
+
}, [q, c, Oe, ie]);
|
|
1431
|
+
A(() => {
|
|
1432
|
+
const M = (ae) => {
|
|
1433
|
+
if (!le.current)
|
|
1434
|
+
return;
|
|
1435
|
+
const te = ae.clientX - le.current.startX + le.current.origX, Le = ae.clientY - le.current.startY + le.current.origY;
|
|
1436
|
+
Z({ x: te, y: Le }), F?.(q, { x: te, y: Le });
|
|
1437
|
+
}, H = (ae) => {
|
|
1438
|
+
if (le.current) {
|
|
1439
|
+
if (j) {
|
|
1440
|
+
const te = Xt(
|
|
1441
|
+
ae.clientX,
|
|
1442
|
+
ae.clientY,
|
|
1443
|
+
window.innerWidth,
|
|
1444
|
+
window.innerHeight,
|
|
1445
|
+
W
|
|
1446
|
+
);
|
|
1447
|
+
te !== "none" && (B.current = { x: U.x, y: U.y, w: re, h: se }, Xe(te), ne?.(q, te));
|
|
1448
|
+
}
|
|
1449
|
+
le.current = null;
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
return document.addEventListener("mousemove", M), document.addEventListener("mouseup", H), () => {
|
|
1453
|
+
document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", H);
|
|
1454
|
+
};
|
|
1455
|
+
});
|
|
1456
|
+
const mt = N(
|
|
1457
|
+
(M) => {
|
|
1458
|
+
!_ || J || G || (M.preventDefault(), ee !== "none" && (B.current && (Z({ x: B.current.x, y: B.current.y }), xe({ width: B.current.w, height: B.current.h })), Xe("none")), Me(), le.current = { startX: M.clientX, startY: M.clientY, origX: he, origY: fe });
|
|
1459
|
+
},
|
|
1460
|
+
[_, J, G, ee, he, fe, Me]
|
|
1461
|
+
);
|
|
1462
|
+
A(() => {
|
|
1463
|
+
const M = (ae) => {
|
|
1464
|
+
if (!K.current)
|
|
1465
|
+
return;
|
|
1466
|
+
const te = ae.clientX - K.current.startX, Le = ae.clientY - K.current.startY, Ne = K.current.handle;
|
|
1467
|
+
let de = K.current.origW, ue = K.current.origH;
|
|
1468
|
+
if (Ne.includes("e") && (de = K.current.origW + te), Ne.includes("w") && (de = K.current.origW - te), Ne.includes("s") && (ue = K.current.origH + Le), Ne.includes("n") && (ue = K.current.origH - Le), de = Math.max(l, Y ? Math.min(Y, de) : de), ue = Math.max(y, L ? Math.min(L, ue) : ue), Ne.includes("w")) {
|
|
1469
|
+
const We = ye.width - de;
|
|
1470
|
+
Z((Re) => ({ ...Re, x: Re.x + We }));
|
|
1471
|
+
}
|
|
1472
|
+
if (Ne.includes("n")) {
|
|
1473
|
+
const We = ye.height - ue;
|
|
1474
|
+
Z((Re) => ({ ...Re, y: Re.y + We }));
|
|
1475
|
+
}
|
|
1476
|
+
xe({ width: de, height: ue }), Q?.(q, { width: de, height: ue });
|
|
1477
|
+
}, H = () => {
|
|
1478
|
+
K.current = null;
|
|
1479
|
+
};
|
|
1480
|
+
return document.addEventListener("mousemove", M), document.addEventListener("mouseup", H), () => {
|
|
1481
|
+
document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", H);
|
|
1482
|
+
};
|
|
1483
|
+
});
|
|
1484
|
+
const ht = N(
|
|
1485
|
+
(M, H) => {
|
|
1486
|
+
!C || J || G || ee !== "none" || (H.preventDefault(), H.stopPropagation(), Me(), K.current = { startX: H.clientX, startY: H.clientY, origW: re, origH: se, handle: M });
|
|
1487
|
+
},
|
|
1488
|
+
[C, J, G, ee, re, se, Me]
|
|
1489
|
+
);
|
|
1490
|
+
if (A(() => {
|
|
1491
|
+
if (!Be)
|
|
1492
|
+
return;
|
|
1493
|
+
const M = (H) => {
|
|
1494
|
+
H.key === "Escape" && G && qe();
|
|
1495
|
+
};
|
|
1496
|
+
return document.addEventListener("keydown", M), () => document.removeEventListener("keydown", M);
|
|
1497
|
+
}, [Be, G, qe]), st)
|
|
1498
|
+
return null;
|
|
1499
|
+
const Ge = ee !== "none" ? Bt(ee) : null, Ke = J || G, ft = G ? { position: "fixed", top: 0, left: 0, width: "100vw", height: "100vh", zIndex: 999999 } : J ? { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", zIndex: k } : Ge ? { position: "absolute", ...Ge, zIndex: k } : { position: "absolute", top: fe, left: he, width: re, height: se, zIndex: k }, pt = ["n", "e", "s", "w", "ne", "se", "sw", "nw"], wt = {
|
|
1500
|
+
n: "ns-resize",
|
|
1501
|
+
s: "ns-resize",
|
|
1502
|
+
e: "ew-resize",
|
|
1503
|
+
w: "ew-resize",
|
|
1504
|
+
ne: "nesw-resize",
|
|
1505
|
+
sw: "nesw-resize",
|
|
1506
|
+
nw: "nwse-resize",
|
|
1507
|
+
se: "nwse-resize"
|
|
1508
|
+
};
|
|
1509
|
+
return /* @__PURE__ */ g(
|
|
1510
|
+
"div",
|
|
1511
|
+
{
|
|
1512
|
+
ref: $e,
|
|
1513
|
+
id: be,
|
|
1514
|
+
className: `nice-window nice-window--${pe} ${Be ? "nice-window--focused" : ""} ${Ie ? "nice-window--pinned" : ""} ${Ke ? "nice-window--maximized" : ""} ${ee !== "none" ? `nice-window--snapped-${ee}` : ""} ${ge ?? ""}`,
|
|
1515
|
+
style: { ...ft, ...Se },
|
|
1516
|
+
onMouseDown: Me,
|
|
1517
|
+
role: "dialog",
|
|
1518
|
+
"aria-label": n,
|
|
1519
|
+
...ve,
|
|
1520
|
+
children: [
|
|
1521
|
+
/* @__PURE__ */ g(
|
|
1522
|
+
"div",
|
|
1523
|
+
{
|
|
1524
|
+
className: "nice-window__titlebar",
|
|
1525
|
+
onMouseDown: mt,
|
|
1526
|
+
onDoubleClick: ut,
|
|
1527
|
+
children: [
|
|
1528
|
+
i && /* @__PURE__ */ e("span", { className: "nice-window__icon", children: i }),
|
|
1529
|
+
/* @__PURE__ */ e("span", { className: "nice-window__title", children: n }),
|
|
1530
|
+
/* @__PURE__ */ g("div", { className: "nice-window__actions", children: [
|
|
1531
|
+
_e,
|
|
1532
|
+
r && /* @__PURE__ */ e(
|
|
1533
|
+
"button",
|
|
1534
|
+
{
|
|
1535
|
+
type: "button",
|
|
1536
|
+
className: `nice-window__action nice-window__action--pin ${Ie ? "nice-window__action--active" : ""}`,
|
|
1537
|
+
onClick: dt,
|
|
1538
|
+
title: ce("window.pin", Ie ? "Unpin" : "Pin"),
|
|
1539
|
+
children: /* @__PURE__ */ e(me, { name: "paperclip", size: 14 })
|
|
1540
|
+
}
|
|
1541
|
+
),
|
|
1542
|
+
D && /* @__PURE__ */ e(
|
|
1543
|
+
"button",
|
|
1544
|
+
{
|
|
1545
|
+
type: "button",
|
|
1546
|
+
className: "nice-window__action nice-window__action--minimize",
|
|
1547
|
+
onClick: at,
|
|
1548
|
+
title: ce("window.minimize", "Minimize"),
|
|
1549
|
+
children: /* @__PURE__ */ e(me, { name: "minus", size: 14 })
|
|
1550
|
+
}
|
|
1551
|
+
),
|
|
1552
|
+
c && /* @__PURE__ */ e(
|
|
1553
|
+
"button",
|
|
1554
|
+
{
|
|
1555
|
+
type: "button",
|
|
1556
|
+
className: "nice-window__action nice-window__action--maximize",
|
|
1557
|
+
onClick: Oe,
|
|
1558
|
+
title: ce("window.maximize", J ? "Restore" : "Maximize"),
|
|
1559
|
+
children: /* @__PURE__ */ e(me, { name: J ? "copy" : "window", size: 14 })
|
|
1560
|
+
}
|
|
1561
|
+
),
|
|
1562
|
+
v && /* @__PURE__ */ e(
|
|
1563
|
+
"button",
|
|
1564
|
+
{
|
|
1565
|
+
type: "button",
|
|
1566
|
+
className: "nice-window__action nice-window__action--fullscreen",
|
|
1567
|
+
onClick: qe,
|
|
1568
|
+
title: ce("window.fullscreen", G ? "Exit Full Screen" : "Full Screen"),
|
|
1569
|
+
children: /* @__PURE__ */ e(me, { name: G ? "collapse" : "expand", size: 14 })
|
|
1570
|
+
}
|
|
1571
|
+
),
|
|
1572
|
+
E && /* @__PURE__ */ e(
|
|
1573
|
+
"button",
|
|
1574
|
+
{
|
|
1575
|
+
type: "button",
|
|
1576
|
+
className: "nice-window__action nice-window__action--close",
|
|
1577
|
+
onClick: lt,
|
|
1578
|
+
title: ce("window.close", "Close"),
|
|
1579
|
+
children: /* @__PURE__ */ e(me, { name: "close", size: 14 })
|
|
1580
|
+
}
|
|
1581
|
+
)
|
|
1582
|
+
] })
|
|
1583
|
+
]
|
|
1584
|
+
}
|
|
1585
|
+
),
|
|
1586
|
+
/* @__PURE__ */ e("div", { className: "nice-window__body", children: s }),
|
|
1587
|
+
m && /* @__PURE__ */ e("div", { className: "nice-window__footer", children: m }),
|
|
1588
|
+
we && /* @__PURE__ */ e("div", { className: "nice-window__statusbar", children: we }),
|
|
1589
|
+
C && !Ke && ee === "none" && /* @__PURE__ */ e(Fe, { children: pt.map((M) => /* @__PURE__ */ e(
|
|
1590
|
+
"div",
|
|
1591
|
+
{
|
|
1592
|
+
className: `nice-window__resize nice-window__resize--${M}`,
|
|
1593
|
+
style: { cursor: wt[M] },
|
|
1594
|
+
onMouseDown: (H) => ht(M, H)
|
|
1595
|
+
},
|
|
1596
|
+
M
|
|
1597
|
+
)) })
|
|
1598
|
+
]
|
|
1599
|
+
}
|
|
1600
|
+
);
|
|
1601
|
+
}
|
|
1602
|
+
);
|
|
1603
|
+
Ot.displayName = "NiceWindow";
|
|
1604
|
+
export {
|
|
1605
|
+
Ft as N,
|
|
1606
|
+
zt as a,
|
|
1607
|
+
Gt as b,
|
|
1608
|
+
Et as c,
|
|
1609
|
+
Ut as d,
|
|
1610
|
+
Ht as e,
|
|
1611
|
+
jt as f,
|
|
1612
|
+
Kt as g,
|
|
1613
|
+
Vt as h,
|
|
1614
|
+
Ze as i,
|
|
1615
|
+
Dt as j,
|
|
1616
|
+
Ot as k,
|
|
1617
|
+
Ct as l,
|
|
1618
|
+
Qt as m,
|
|
1619
|
+
Ae as n,
|
|
1620
|
+
xt as o,
|
|
1621
|
+
Zt as p,
|
|
1622
|
+
kt as u
|
|
1623
|
+
};
|