@nice2dev/ui 1.4.20 → 1.4.21
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 +50 -0
- package/dist/NiceGantt-Drl4gvw9.cjs +1 -0
- package/dist/{NiceGantt.doc-B6YZcJvG.cjs → NiceGantt.doc-DTv0r7bP.cjs} +2 -2
- package/dist/NiceModuleLifecyclePanel-jckyVqqt.cjs +1 -0
- package/dist/NiceWindow-DQyf5wat.cjs +1 -0
- package/dist/{core-lazy-BhQxFuLf.cjs → core-lazy-DirbU7jp.cjs} +1 -1
- package/dist/display/NiceDocumentApprovalFlow.mjs +67 -89
- package/dist/display/NiceLeaderboard.mjs +47 -40
- package/dist/display/NiceQuestCard.mjs +93 -76
- package/dist/docs/NiceGantt.doc.json.mjs +9 -9
- package/dist/documentation/utils.mjs +1 -1
- package/dist/index.cjs +94 -94
- package/dist/index.d.ts +58 -2
- package/dist/index.mjs +778 -776
- package/dist/navigation/NiceMenu.mjs +249 -248
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +6 -0
- package/dist/overlays/NiceResponsiveBox.mjs +51 -24
- package/dist/overlays/NiceTutorial.mjs +136 -127
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +25 -2
- package/dist/planning/NiceGantt.mjs +130 -121
- package/dist/planning/NiceStepper.mjs +36 -35
- package/dist/style.css +2 -2
- package/dist/tools/NiceDraggable.mjs +44 -29
- package/dist/tools/NiceSortable.mjs +66 -48
- package/dist/tools/NiceSpeechToText.mjs +67 -52
- package/dist/tools/NiceValidationBuilder.mjs +210 -119
- package/dist/tools/NiceViewRegistry.mjs +67 -34
- package/package.json +4 -4
- package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +0 -8
- package/dist/NiceGantt-BygumlaY.cjs +0 -1
- package/dist/NiceModuleLifecyclePanel-DAIbzfZd.cjs +0 -1
- package/dist/NiceWindow-BklnkBpu.cjs +0 -1
- package/dist/docs/NiceBottomSheet.doc.json.mjs +0 -32
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as i, jsxs as d, Fragment as
|
|
2
|
-
import { useNiceTranslation as
|
|
3
|
-
import { useState as k, useRef as
|
|
1
|
+
import { jsx as i, jsxs as d, Fragment as Tt } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation as Et, useOverlayFocus as $t, useInputEngine as Lt, useIntent as Ot, useInputHints as Ht, sanitizeHtml as zt, NiceIcon as y } from "@nice2dev/ui-core";
|
|
3
|
+
import { useState as k, useRef as it, useEffect as b, useCallback as C, useId as Bt, useMemo as Ft } from "react";
|
|
4
4
|
/* empty css */
|
|
5
|
-
function
|
|
5
|
+
function Ct(t, o) {
|
|
6
6
|
const s = document.querySelector(t);
|
|
7
7
|
if (!s)
|
|
8
8
|
return null;
|
|
@@ -14,7 +14,7 @@ function Bt(t, o) {
|
|
|
14
14
|
height: u.height + o * 2
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Mt(t, o, s, u) {
|
|
18
18
|
const M = { w: window.innerWidth, h: window.innerHeight + window.scrollY }, P = {
|
|
19
19
|
top: {
|
|
20
20
|
top: t.top - s - 12,
|
|
@@ -42,32 +42,32 @@ function Ot(t, o, s, u) {
|
|
|
42
42
|
}
|
|
43
43
|
return { ...P.bottom, actualPlacement: "bottom" };
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function jt() {
|
|
46
46
|
return /* @__PURE__ */ i(y, { name: "close", size: 16 });
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function At() {
|
|
49
49
|
return /* @__PURE__ */ i(y, { name: "chevron-left", size: 16 });
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function Rt() {
|
|
52
52
|
return /* @__PURE__ */ i(y, { name: "chevron-right", size: 16 });
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function qt() {
|
|
55
55
|
return /* @__PURE__ */ i(y, { name: "skip-forward", size: 16 });
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Vt() {
|
|
58
58
|
return /* @__PURE__ */ i(y, { name: "play", size: 16 });
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Wt() {
|
|
61
61
|
return /* @__PURE__ */ i(y, { name: "pause", size: 16 });
|
|
62
62
|
}
|
|
63
63
|
function Y(t, o, s) {
|
|
64
|
-
return s === "text" ? /* @__PURE__ */ i("span", { className: "nice-tutorial__btn-label", children: o }) : s === "icon-text" ? /* @__PURE__ */ d(
|
|
64
|
+
return s === "text" ? /* @__PURE__ */ i("span", { className: "nice-tutorial__btn-label", children: o }) : s === "icon-text" ? /* @__PURE__ */ d(Tt, { children: [
|
|
65
65
|
t,
|
|
66
66
|
/* @__PURE__ */ i("span", { className: "nice-tutorial__btn-label", children: o })
|
|
67
67
|
] }) : t;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
70
|
-
steps: t =
|
|
69
|
+
const Yt = [], Kt = ({
|
|
70
|
+
steps: t = Yt,
|
|
71
71
|
active: o,
|
|
72
72
|
onFinish: s,
|
|
73
73
|
onSkip: u,
|
|
@@ -76,53 +76,59 @@ const jt = [], Rt = ({
|
|
|
76
76
|
closeOnOverlayClick: P = !1,
|
|
77
77
|
showProgress: N = !0,
|
|
78
78
|
showSkipButton: h = !0,
|
|
79
|
+
// 1.4.21 ("PROPS do wyświetlania ile z kontrolek ma być, bo nie zawsze wszystko"): every part of the
|
|
80
|
+
// control strip can be switched off on its own.
|
|
81
|
+
showBackButton: ot = !0,
|
|
82
|
+
showCloseButton: bt,
|
|
83
|
+
showProgressBar: lt,
|
|
84
|
+
showSpeedControl: rt = !0,
|
|
79
85
|
labels: m,
|
|
80
|
-
animationDuration:
|
|
81
|
-
overlayOpacity:
|
|
82
|
-
zIndex:
|
|
83
|
-
buttonsPlacement:
|
|
86
|
+
animationDuration: j = 300,
|
|
87
|
+
overlayOpacity: wt = 0.6,
|
|
88
|
+
zIndex: A = 1e4,
|
|
89
|
+
buttonsPlacement: ct = "floating-bottom",
|
|
84
90
|
buttonsDisplay: _ = "icon",
|
|
85
|
-
showAutoplay:
|
|
86
|
-
autoplayInterval:
|
|
91
|
+
showAutoplay: K = !0,
|
|
92
|
+
autoplayInterval: X = 5e3,
|
|
87
93
|
autoplaySpeedRange: p = { min: 2e3, max: 15e3 },
|
|
88
94
|
onAutoplayChange: R
|
|
89
95
|
}) => {
|
|
90
|
-
const { t:
|
|
96
|
+
const { t: G } = Et(), [l, I] = k(0), [c, pt] = k(null), [J, vt] = k({ w: 340, h: 200 }), [Q, at] = k(!0), [g, U] = k(!1), [T, st] = k(X), Z = it(null), E = it(-1), e = t[l], w = l === t.length - 1, $ = l === 0, L = m?.next ?? "Next", O = m?.back ?? "Back", H = m?.finish ?? "Finish", z = m?.skip ?? "Skip", S = m?.stepOf ?? "of", q = m?.play ?? "Play", V = m?.pause ?? "Pause", ut = m?.speed ?? "Speed", dt = m?.close ?? "Close";
|
|
91
97
|
b(() => {
|
|
92
|
-
o && (I(0),
|
|
93
|
-
}, [o,
|
|
94
|
-
if (
|
|
95
|
-
const n =
|
|
96
|
-
|
|
98
|
+
o && (I(0), U(!1), st(X));
|
|
99
|
+
}, [o, X]), b(() => {
|
|
100
|
+
if (Z.current) {
|
|
101
|
+
const n = Z.current.getBoundingClientRect();
|
|
102
|
+
vt({ w: n.width, h: n.height });
|
|
97
103
|
}
|
|
98
104
|
}, [l, o]), b(() => {
|
|
99
105
|
if (!o || !e)
|
|
100
106
|
return;
|
|
101
107
|
const n = e.highlightPadding ?? 0, r = () => {
|
|
102
|
-
const a =
|
|
103
|
-
|
|
108
|
+
const a = Ct(e.target, n);
|
|
109
|
+
pt(a);
|
|
104
110
|
};
|
|
105
111
|
if (r(), e.scrollIntoView !== !1) {
|
|
106
112
|
document.querySelector(e.target)?.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
107
|
-
const
|
|
108
|
-
return () => clearTimeout(
|
|
113
|
+
const nt = setTimeout(r, 350);
|
|
114
|
+
return () => clearTimeout(nt);
|
|
109
115
|
}
|
|
110
116
|
}, [o, e, l]), b(() => {
|
|
111
117
|
!o || !e || E.current !== l && (E.current >= 0 && E.current < t.length && t[E.current]?.onLeave?.(), e.onEnter?.(), E.current = l);
|
|
112
118
|
}, [o, e, l, t]);
|
|
113
|
-
const v =
|
|
119
|
+
const v = C(() => {
|
|
114
120
|
if (w)
|
|
115
121
|
e?.onLeave?.(), s?.();
|
|
116
122
|
else {
|
|
117
123
|
const n = l + 1;
|
|
118
124
|
I(n), f?.(n);
|
|
119
125
|
}
|
|
120
|
-
}, [l, w, s, f, e]),
|
|
126
|
+
}, [l, w, s, f, e]), B = C(() => {
|
|
121
127
|
if (!$) {
|
|
122
128
|
const n = l - 1;
|
|
123
129
|
I(n), f?.(n);
|
|
124
130
|
}
|
|
125
|
-
}, [l, $, f]),
|
|
131
|
+
}, [l, $, f]), ft = C(
|
|
126
132
|
(n) => {
|
|
127
133
|
n !== l && n >= 0 && n < t.length && (I(n), f?.(n));
|
|
128
134
|
},
|
|
@@ -137,15 +143,15 @@ const jt = [], Rt = ({
|
|
|
137
143
|
const r = () => v();
|
|
138
144
|
return n.addEventListener(e.advanceOn.event, r), () => n.removeEventListener(e.advanceOn.event, r);
|
|
139
145
|
}, [o, e, l, v]);
|
|
140
|
-
const
|
|
141
|
-
|
|
146
|
+
const F = it(null), x = !!(o && e);
|
|
147
|
+
$t(F, {
|
|
142
148
|
open: x,
|
|
143
149
|
modal: !(e?.waitForAction || e?.advanceOn),
|
|
144
150
|
onClose: () => u?.(),
|
|
145
151
|
closeOnEscape: M,
|
|
146
|
-
closeHint:
|
|
152
|
+
closeHint: z
|
|
147
153
|
}), b(() => {
|
|
148
|
-
const n =
|
|
154
|
+
const n = F.current;
|
|
149
155
|
if (!x || !n)
|
|
150
156
|
return;
|
|
151
157
|
const r = (a) => {
|
|
@@ -153,22 +159,22 @@ const jt = [], Rt = ({
|
|
|
153
159
|
if (a.key === "ArrowRight")
|
|
154
160
|
v();
|
|
155
161
|
else if (a.key === "ArrowLeft")
|
|
156
|
-
|
|
162
|
+
B();
|
|
157
163
|
else if (a.key === "Home" || a.key === "End")
|
|
158
|
-
|
|
164
|
+
ft(a.key === "Home" ? 0 : t.length - 1);
|
|
159
165
|
else
|
|
160
166
|
return;
|
|
161
167
|
a.preventDefault();
|
|
162
168
|
}
|
|
163
169
|
};
|
|
164
170
|
return n.addEventListener("keydown", r), () => n.removeEventListener("keydown", r);
|
|
165
|
-
}, [x, v,
|
|
166
|
-
const
|
|
171
|
+
}, [x, v, B, ft, t.length]);
|
|
172
|
+
const ht = Lt(), D = x ? e?.title : void 0;
|
|
167
173
|
b(() => {
|
|
168
|
-
|
|
169
|
-
}, [
|
|
170
|
-
const
|
|
171
|
-
|
|
174
|
+
D && l > 0 && ht?.announce(D);
|
|
175
|
+
}, [ht, D, l]);
|
|
176
|
+
const tt = Bt(), mt = `${tt}-content`;
|
|
177
|
+
Ot(
|
|
172
178
|
["sectionPrev", "sectionNext"],
|
|
173
179
|
(n) => {
|
|
174
180
|
if (n.intent === "sectionNext") {
|
|
@@ -176,27 +182,27 @@ const jt = [], Rt = ({
|
|
|
176
182
|
return !1;
|
|
177
183
|
v();
|
|
178
184
|
} else
|
|
179
|
-
|
|
185
|
+
B();
|
|
180
186
|
},
|
|
181
|
-
{ ref:
|
|
182
|
-
),
|
|
183
|
-
|
|
187
|
+
{ ref: F, enabled: x }
|
|
188
|
+
), Ht(
|
|
189
|
+
F,
|
|
184
190
|
x ? [
|
|
185
|
-
...$ ? [] : [{ intent: "sectionPrev", label:
|
|
186
|
-
...e?.waitForAction ? [] : [{ intent: "sectionNext", label: w ?
|
|
191
|
+
...$ ? [] : [{ intent: "sectionPrev", label: O }],
|
|
192
|
+
...e?.waitForAction ? [] : [{ intent: "sectionNext", label: w ? H : L }]
|
|
187
193
|
] : []
|
|
188
194
|
), b(() => {
|
|
189
|
-
|
|
190
|
-
const n = setTimeout(() =>
|
|
195
|
+
at(!0);
|
|
196
|
+
const n = setTimeout(() => at(!1), j);
|
|
191
197
|
return () => clearTimeout(n);
|
|
192
|
-
}, [l,
|
|
198
|
+
}, [l, j]), b(() => {
|
|
193
199
|
if (!o || !g)
|
|
194
200
|
return;
|
|
195
201
|
const n = setInterval(
|
|
196
202
|
() => {
|
|
197
203
|
I((r) => {
|
|
198
204
|
if (r >= t.length - 1)
|
|
199
|
-
return
|
|
205
|
+
return U(!1), R?.(!1), t[r]?.onLeave?.(), s?.(), r;
|
|
200
206
|
const a = r + 1;
|
|
201
207
|
return f?.(a), a;
|
|
202
208
|
});
|
|
@@ -205,48 +211,48 @@ const jt = [], Rt = ({
|
|
|
205
211
|
);
|
|
206
212
|
return () => clearInterval(n);
|
|
207
213
|
}, [o, g, T, t, R, s, f]);
|
|
208
|
-
const
|
|
209
|
-
|
|
214
|
+
const _t = C(() => {
|
|
215
|
+
U((n) => {
|
|
210
216
|
const r = !n;
|
|
211
217
|
return R?.(r), r;
|
|
212
218
|
});
|
|
213
|
-
}, [R]), W =
|
|
219
|
+
}, [R]), W = Ft(() => c ? Mt(c, J.w, J.h, e?.placement) : {
|
|
214
220
|
top: typeof window < "u" ? window.innerHeight / 2 : 0,
|
|
215
221
|
left: typeof window < "u" ? window.innerWidth / 2 : 0,
|
|
216
222
|
actualPlacement: "bottom"
|
|
217
|
-
}, [c,
|
|
223
|
+
}, [c, J, e?.placement]), et = t.length === 0 ? 0 : (l + 1) / t.length * 100, gt = C(
|
|
218
224
|
(n) => {
|
|
219
|
-
const r =
|
|
225
|
+
const r = K && t.length > 1, a = (lt ?? K) && t.length > 1, nt = h && !w && /* @__PURE__ */ i(
|
|
220
226
|
"button",
|
|
221
227
|
{
|
|
222
228
|
type: "button",
|
|
223
229
|
className: `nice-tutorial__btn nice-tutorial__btn--skip nice-tutorial__btn--${_}`,
|
|
224
230
|
onClick: u,
|
|
225
|
-
"aria-label":
|
|
226
|
-
title:
|
|
227
|
-
children: Y(/* @__PURE__ */ i(
|
|
231
|
+
"aria-label": z,
|
|
232
|
+
title: z,
|
|
233
|
+
children: Y(/* @__PURE__ */ i(qt, {}), z, _)
|
|
228
234
|
}
|
|
229
|
-
),
|
|
235
|
+
), kt = ot && !$ && /* @__PURE__ */ i(
|
|
230
236
|
"button",
|
|
231
237
|
{
|
|
232
238
|
type: "button",
|
|
233
239
|
className: `nice-tutorial__btn nice-tutorial__btn--back nice-tutorial__btn--${_}`,
|
|
234
|
-
onClick:
|
|
235
|
-
"aria-label":
|
|
236
|
-
title:
|
|
237
|
-
children: Y(/* @__PURE__ */ i(
|
|
240
|
+
onClick: B,
|
|
241
|
+
"aria-label": O,
|
|
242
|
+
title: O,
|
|
243
|
+
children: Y(/* @__PURE__ */ i(At, {}), O, _)
|
|
238
244
|
}
|
|
239
|
-
),
|
|
245
|
+
), yt = !e?.waitForAction && /* @__PURE__ */ i(
|
|
240
246
|
"button",
|
|
241
247
|
{
|
|
242
248
|
type: "button",
|
|
243
249
|
className: `nice-tutorial__btn nice-tutorial__btn--next nice-tutorial__btn--${_}`,
|
|
244
250
|
onClick: v,
|
|
245
|
-
"aria-label": w ?
|
|
246
|
-
title: w ?
|
|
247
|
-
children: Y(/* @__PURE__ */ i(
|
|
251
|
+
"aria-label": w ? H : L,
|
|
252
|
+
title: w ? H : L,
|
|
253
|
+
children: Y(/* @__PURE__ */ i(Rt, {}), w ? H : L, _)
|
|
248
254
|
}
|
|
249
|
-
),
|
|
255
|
+
), Pt = r && /* @__PURE__ */ i(
|
|
250
256
|
"button",
|
|
251
257
|
{
|
|
252
258
|
type: "button",
|
|
@@ -256,12 +262,12 @@ const jt = [], Rt = ({
|
|
|
256
262
|
`nice-tutorial__btn--${_}`,
|
|
257
263
|
g ? "nice-tutorial__btn--active" : ""
|
|
258
264
|
].filter(Boolean).join(" "),
|
|
259
|
-
onClick:
|
|
265
|
+
onClick: _t,
|
|
260
266
|
"aria-label": g ? V : q,
|
|
261
267
|
title: g ? V : q,
|
|
262
268
|
"aria-pressed": g,
|
|
263
269
|
children: Y(
|
|
264
|
-
g ? /* @__PURE__ */ i(
|
|
270
|
+
g ? /* @__PURE__ */ i(Wt, {}) : /* @__PURE__ */ i(Vt, {}),
|
|
265
271
|
g ? V : q,
|
|
266
272
|
_
|
|
267
273
|
)
|
|
@@ -274,40 +280,40 @@ const jt = [], Rt = ({
|
|
|
274
280
|
"nice-tutorial__controls",
|
|
275
281
|
n ? "nice-tutorial__controls--inline" : "nice-tutorial__controls--floating-bottom"
|
|
276
282
|
].join(" "),
|
|
277
|
-
style: n ? void 0 : { zIndex:
|
|
283
|
+
style: n ? void 0 : { zIndex: A + 2 },
|
|
278
284
|
role: "group",
|
|
279
|
-
"aria-label":
|
|
285
|
+
"aria-label": G("tutorial.tutorialControls", "Tutorial controls"),
|
|
280
286
|
children: [
|
|
281
|
-
|
|
282
|
-
|
|
287
|
+
nt,
|
|
288
|
+
kt,
|
|
283
289
|
N && /* @__PURE__ */ d("span", { className: "nice-tutorial__step-label", "aria-live": "polite", children: [
|
|
284
290
|
l + 1,
|
|
285
291
|
" ",
|
|
286
|
-
|
|
292
|
+
S,
|
|
287
293
|
" ",
|
|
288
294
|
t.length
|
|
289
295
|
] }),
|
|
290
|
-
|
|
291
|
-
|
|
296
|
+
yt,
|
|
297
|
+
a && /* @__PURE__ */ i(
|
|
292
298
|
"div",
|
|
293
299
|
{
|
|
294
300
|
className: "nice-tutorial__progress-bar",
|
|
295
301
|
role: "progressbar",
|
|
296
|
-
"aria-valuenow": Math.round(
|
|
302
|
+
"aria-valuenow": Math.round(et),
|
|
297
303
|
"aria-valuemin": 0,
|
|
298
304
|
"aria-valuemax": 100,
|
|
299
|
-
"aria-label": `${l + 1} ${
|
|
305
|
+
"aria-label": `${l + 1} ${S} ${t.length}`,
|
|
300
306
|
children: /* @__PURE__ */ i(
|
|
301
307
|
"div",
|
|
302
308
|
{
|
|
303
309
|
className: "nice-tutorial__progress-bar-fill",
|
|
304
|
-
style: { width: `${
|
|
310
|
+
style: { width: `${et}%` }
|
|
305
311
|
}
|
|
306
312
|
)
|
|
307
313
|
}
|
|
308
314
|
),
|
|
309
|
-
|
|
310
|
-
r && /* @__PURE__ */ d("label", { className: "nice-tutorial__speed", children: [
|
|
315
|
+
Pt,
|
|
316
|
+
r && rt && /* @__PURE__ */ d("label", { className: "nice-tutorial__speed", children: [
|
|
311
317
|
/* @__PURE__ */ i(
|
|
312
318
|
"input",
|
|
313
319
|
{
|
|
@@ -317,8 +323,8 @@ const jt = [], Rt = ({
|
|
|
317
323
|
max: p.max,
|
|
318
324
|
step: 500,
|
|
319
325
|
value: p.min + p.max - T,
|
|
320
|
-
onChange: (
|
|
321
|
-
"aria-label":
|
|
326
|
+
onChange: (It) => st(p.min + p.max - Number(It.target.value)),
|
|
327
|
+
"aria-label": ut
|
|
322
328
|
}
|
|
323
329
|
),
|
|
324
330
|
/* @__PURE__ */ d("span", { className: "nice-tutorial__speed-value", children: [
|
|
@@ -331,49 +337,52 @@ const jt = [], Rt = ({
|
|
|
331
337
|
);
|
|
332
338
|
},
|
|
333
339
|
[
|
|
334
|
-
|
|
340
|
+
K,
|
|
335
341
|
h,
|
|
336
342
|
N,
|
|
343
|
+
ot,
|
|
344
|
+
lt,
|
|
345
|
+
rt,
|
|
337
346
|
_,
|
|
338
347
|
$,
|
|
339
348
|
w,
|
|
340
349
|
u,
|
|
341
|
-
|
|
342
|
-
B,
|
|
343
|
-
L,
|
|
350
|
+
z,
|
|
344
351
|
O,
|
|
352
|
+
L,
|
|
353
|
+
H,
|
|
345
354
|
q,
|
|
346
355
|
V,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
356
|
+
ut,
|
|
357
|
+
S,
|
|
358
|
+
B,
|
|
350
359
|
v,
|
|
351
360
|
e,
|
|
352
361
|
g,
|
|
353
|
-
|
|
362
|
+
_t,
|
|
354
363
|
l,
|
|
355
364
|
t.length,
|
|
356
|
-
|
|
365
|
+
et,
|
|
357
366
|
T,
|
|
358
367
|
p,
|
|
359
|
-
|
|
360
|
-
|
|
368
|
+
A,
|
|
369
|
+
G
|
|
361
370
|
]
|
|
362
371
|
);
|
|
363
372
|
if (!o || !e)
|
|
364
373
|
return null;
|
|
365
|
-
const
|
|
374
|
+
const Nt = typeof document < "u" ? Math.max(document.documentElement.scrollWidth, window.innerWidth) : 0, xt = typeof document < "u" ? Math.max(document.documentElement.scrollHeight, window.innerHeight) : 0;
|
|
366
375
|
return /* @__PURE__ */ d(
|
|
367
376
|
"div",
|
|
368
377
|
{
|
|
369
|
-
ref:
|
|
378
|
+
ref: F,
|
|
370
379
|
className: "nice-tutorial",
|
|
371
|
-
style: { zIndex:
|
|
380
|
+
style: { zIndex: A },
|
|
372
381
|
"aria-modal": e.waitForAction || e.advanceOn ? void 0 : !0,
|
|
373
382
|
role: "dialog",
|
|
374
|
-
"aria-label": e.title ? void 0 :
|
|
375
|
-
"aria-labelledby": e.title ?
|
|
376
|
-
"aria-describedby": e.content ?
|
|
383
|
+
"aria-label": e.title ? void 0 : G("tutorial.tutorial", "Tutorial"),
|
|
384
|
+
"aria-labelledby": e.title ? tt : void 0,
|
|
385
|
+
"aria-describedby": e.content ? mt : void 0,
|
|
377
386
|
children: [
|
|
378
387
|
/* @__PURE__ */ d(
|
|
379
388
|
"svg",
|
|
@@ -383,8 +392,8 @@ const jt = [], Rt = ({
|
|
|
383
392
|
position: "absolute",
|
|
384
393
|
top: 0,
|
|
385
394
|
left: 0,
|
|
386
|
-
width:
|
|
387
|
-
height:
|
|
395
|
+
width: Nt,
|
|
396
|
+
height: xt,
|
|
388
397
|
pointerEvents: "auto"
|
|
389
398
|
},
|
|
390
399
|
onClick: P ? u : void 0,
|
|
@@ -400,7 +409,7 @@ const jt = [], Rt = ({
|
|
|
400
409
|
height: c.height,
|
|
401
410
|
rx: "4",
|
|
402
411
|
fill: "black",
|
|
403
|
-
className:
|
|
412
|
+
className: Q ? "nice-tutorial__spotlight--entering" : ""
|
|
404
413
|
}
|
|
405
414
|
)
|
|
406
415
|
] }) }),
|
|
@@ -411,7 +420,7 @@ const jt = [], Rt = ({
|
|
|
411
420
|
y: "0",
|
|
412
421
|
width: "100%",
|
|
413
422
|
height: "100%",
|
|
414
|
-
fill: `rgba(0,0,0,${
|
|
423
|
+
fill: `rgba(0,0,0,${wt})`,
|
|
415
424
|
mask: "url(#nice-tutorial-mask)"
|
|
416
425
|
}
|
|
417
426
|
)
|
|
@@ -421,14 +430,14 @@ const jt = [], Rt = ({
|
|
|
421
430
|
c && /* @__PURE__ */ i(
|
|
422
431
|
"div",
|
|
423
432
|
{
|
|
424
|
-
className: `nice-tutorial__highlight ${
|
|
433
|
+
className: `nice-tutorial__highlight ${Q ? "nice-tutorial__highlight--entering" : ""}`,
|
|
425
434
|
style: {
|
|
426
435
|
position: "absolute",
|
|
427
436
|
top: c.top,
|
|
428
437
|
left: c.left,
|
|
429
438
|
width: c.width,
|
|
430
439
|
height: c.height,
|
|
431
|
-
transition: `all ${
|
|
440
|
+
transition: `all ${j}ms ease`
|
|
432
441
|
}
|
|
433
442
|
}
|
|
434
443
|
),
|
|
@@ -448,15 +457,15 @@ const jt = [], Rt = ({
|
|
|
448
457
|
/* @__PURE__ */ d(
|
|
449
458
|
"div",
|
|
450
459
|
{
|
|
451
|
-
ref:
|
|
452
|
-
className: `nice-tutorial__tooltip nice-tutorial__tooltip--${W.actualPlacement} ${
|
|
460
|
+
ref: Z,
|
|
461
|
+
className: `nice-tutorial__tooltip nice-tutorial__tooltip--${W.actualPlacement} ${Q ? "nice-tutorial__tooltip--entering" : ""}`,
|
|
453
462
|
style: {
|
|
454
463
|
position: "absolute",
|
|
455
464
|
top: W.top,
|
|
456
465
|
left: W.left,
|
|
457
|
-
transition: `all ${
|
|
466
|
+
transition: `all ${j}ms ease`,
|
|
458
467
|
maxWidth: 380,
|
|
459
|
-
zIndex:
|
|
468
|
+
zIndex: A + 1
|
|
460
469
|
},
|
|
461
470
|
children: [
|
|
462
471
|
e.showArrow !== !1 && /* @__PURE__ */ i(
|
|
@@ -466,37 +475,37 @@ const jt = [], Rt = ({
|
|
|
466
475
|
}
|
|
467
476
|
),
|
|
468
477
|
/* @__PURE__ */ d("div", { className: "nice-tutorial__header", children: [
|
|
469
|
-
/* @__PURE__ */ i("h4", { id:
|
|
470
|
-
h && /* @__PURE__ */ i(
|
|
478
|
+
/* @__PURE__ */ i("h4", { id: tt, className: "nice-tutorial__title", children: e.title }),
|
|
479
|
+
(bt ?? h) && /* @__PURE__ */ i(
|
|
471
480
|
"button",
|
|
472
481
|
{
|
|
473
482
|
type: "button",
|
|
474
483
|
className: "nice-tutorial__close",
|
|
475
484
|
onClick: u,
|
|
476
|
-
"aria-label":
|
|
477
|
-
title:
|
|
478
|
-
children: /* @__PURE__ */ i(
|
|
485
|
+
"aria-label": dt,
|
|
486
|
+
title: dt,
|
|
487
|
+
children: /* @__PURE__ */ i(jt, {})
|
|
479
488
|
}
|
|
480
489
|
)
|
|
481
490
|
] }),
|
|
482
491
|
/* @__PURE__ */ i(
|
|
483
492
|
"div",
|
|
484
493
|
{
|
|
485
|
-
id:
|
|
494
|
+
id: mt,
|
|
486
495
|
className: "nice-tutorial__content",
|
|
487
|
-
dangerouslySetInnerHTML: { __html:
|
|
496
|
+
dangerouslySetInnerHTML: { __html: zt(e.content) }
|
|
488
497
|
}
|
|
489
498
|
),
|
|
490
|
-
|
|
499
|
+
ct === "inline" && gt(!0)
|
|
491
500
|
]
|
|
492
501
|
}
|
|
493
502
|
),
|
|
494
|
-
|
|
503
|
+
ct === "floating-bottom" && gt(!1)
|
|
495
504
|
]
|
|
496
505
|
}
|
|
497
506
|
);
|
|
498
507
|
};
|
|
499
|
-
process.env.NODE_ENV !== "production" && (
|
|
508
|
+
process.env.NODE_ENV !== "production" && (Kt.displayName = "NiceTutorial");
|
|
500
509
|
export {
|
|
501
|
-
|
|
510
|
+
Kt as NiceTutorial
|
|
502
511
|
};
|
package/dist/overlays.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NiceWindow-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NiceWindow-DQyf5wat.cjs");exports.NiceActionSheet=e.NiceActionSheet;exports.NiceBlockUI=e.NiceBlockUI;exports.NiceBox=e.NiceBox;exports.NiceCommandPaletteProvider=e.NiceCommandPaletteProvider;exports.NiceLoadPanel=e.NiceLoadPanel;exports.NiceModalBody=e.NiceModalBody;exports.NiceModalFooter=e.NiceModalFooter;exports.NiceModalHeader=e.NiceModalHeader;exports.NiceOverlayBottomSheet=e.NiceBottomSheet;exports.NiceOverlayContextMenu=e.NiceContextMenu;exports.NiceOverlayDrawer=e.NiceDrawer;exports.NiceOverlayModal=e.NiceModal;exports.NiceOverlayPopover=e.NicePopover;exports.NicePopover=e.NicePopover$1;exports.NiceResizable=e.NiceResizable;exports.NiceResponsiveBox=e.NiceResponsiveBox;exports.NiceScrollView=e.NiceScrollView;exports.NiceTutorial=e.NiceTutorial;exports.NiceTutorialProvider=e.NiceTutorialProvider;exports.NiceWindow=e.NiceWindow;exports.NiceWindowManager=e.NiceWindowManager;exports.useCommandPalette=e.useCommandPalette;exports.useRegisterCommands=e.useRegisterCommands;
|
package/dist/overlays.d.ts
CHANGED
|
@@ -371,6 +371,11 @@ export declare interface NiceResizableProps extends NiceBaseProps {
|
|
|
371
371
|
/** Resize handle position for the {@link NiceResizable} component. */
|
|
372
372
|
declare type NiceResizeHandle = 'top' | 'right' | 'bottom' | 'left' | 'topRight' | 'bottomRight' | 'bottomLeft' | 'topLeft';
|
|
373
373
|
|
|
374
|
+
/**
|
|
375
|
+
* {@link NiceResponsiveBox} — a flex row of items with ratios that adapts to the room it has (1.4.21:
|
|
376
|
+
* "kompletnie nieresponsywne" — it was a fixed row): it stacks into a column when narrower than
|
|
377
|
+
* `stackBelow` and, with `minItemWidth`, wraps items onto new lines rather than squeezing them.
|
|
378
|
+
*/
|
|
374
379
|
export declare const NiceResponsiveBox: default_2.FC<NiceResponsiveBoxProps>;
|
|
375
380
|
|
|
376
381
|
/** A flex item within the {@link NiceResponsiveBox}. */
|
|
@@ -387,12 +392,22 @@ declare interface NiceResponsiveBoxItem {
|
|
|
387
392
|
|
|
388
393
|
/** Props for the {@link NiceResponsiveBox} component — a flex container with configurable ratios and base sizes. */
|
|
389
394
|
export declare interface NiceResponsiveBoxProps extends NiceBaseProps {
|
|
390
|
-
/** Flex direction. */
|
|
395
|
+
/** Flex direction (while the box is wide enough — see `stackBelow`). */
|
|
391
396
|
direction?: 'row' | 'column';
|
|
392
397
|
/** Flex items. */
|
|
393
398
|
items?: NiceResponsiveBoxItem[];
|
|
394
399
|
/** Gap between items (px or CSS value). */
|
|
395
400
|
gap?: number | string;
|
|
401
|
+
/**
|
|
402
|
+
* Below this width of the box (px) a row stacks into a column (1.4.21; default 480, `0` never). The
|
|
403
|
+
* box's own width counts, not the window's, so it adapts wherever it is placed.
|
|
404
|
+
*/
|
|
405
|
+
stackBelow?: number;
|
|
406
|
+
/**
|
|
407
|
+
* Items never shrink below this width (px): they wrap onto the next line instead (1.4.21). Unset:
|
|
408
|
+
* no wrapping.
|
|
409
|
+
*/
|
|
410
|
+
minItemWidth?: number;
|
|
396
411
|
}
|
|
397
412
|
|
|
398
413
|
export declare const NiceScrollView: default_2.FC<NiceScrollViewProps>;
|
|
@@ -431,10 +446,18 @@ export declare interface NiceTutorialProps {
|
|
|
431
446
|
closeOnEscape?: boolean;
|
|
432
447
|
/** Close on overlay click (default false) */
|
|
433
448
|
closeOnOverlayClick?: boolean;
|
|
434
|
-
/** Show step
|
|
449
|
+
/** Show the "1 of 5" step counter (default true) */
|
|
435
450
|
showProgress?: boolean;
|
|
436
451
|
/** Show skip button (default true) */
|
|
437
452
|
showSkipButton?: boolean;
|
|
453
|
+
/** Show the Back button from the second step on (default true). 1.4.21. */
|
|
454
|
+
showBackButton?: boolean;
|
|
455
|
+
/** Show the close (×) icon in the tooltip header (default: follows `showSkipButton`). 1.4.21. */
|
|
456
|
+
showCloseButton?: boolean;
|
|
457
|
+
/** Show the progress bar (default: follows `showAutoplay`). 1.4.21. */
|
|
458
|
+
showProgressBar?: boolean;
|
|
459
|
+
/** Show the autoplay speed slider next to Play (default true). 1.4.21. */
|
|
460
|
+
showSpeedControl?: boolean;
|
|
438
461
|
/** Custom labels */
|
|
439
462
|
labels?: {
|
|
440
463
|
next?: string;
|