@genai-fi/base 4.3.2 → 4.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Help.css +1 -1
- package/dist/assets/InfoPop.css +1 -1
- package/dist/assets/SidePanel.css +1 -1
- package/dist/components/Help/Help.d.ts +4 -1
- package/dist/components/Help/Help.js +85 -46
- package/dist/components/InfoPop/InfoPop.d.ts +1 -1
- package/dist/components/InfoPop/InfoPop.js +62 -35
- package/dist/components/SidePanel/SidePanel.d.ts +2 -1
- package/dist/components/SidePanel/SidePanel.js +93 -76
- package/package.json +1 -1
package/dist/assets/Help.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._helpButton_cw98j_1{position:absolute;z-index:10;color:#0a4bd6;background:#fff6;transition:opacity .3s ease-out;opacity:0}._helpButton_cw98j_1._left_cw98j_10{left:-3rem;top:.5rem}._helpButton_cw98j_1._right_cw98j_15{right:-3rem;top:.5rem}._helpButton_cw98j_1._top_cw98j_20{top:-3rem;right:.5rem}._helpButton_cw98j_1._bottom_cw98j_25{bottom:-3rem;right:.5rem}._helpButtonInplace_cw98j_30{color:#0a4bd6;margin-left:8px;transition:opacity .3s ease-out;opacity:.2}._helpButton_cw98j_1:hover{background:#fff}._container_cw98j_41{position:relative;border-radius:6px}._container_cw98j_41:hover ._helpButton_cw98j_1{opacity:1}._helpButton_cw98j_1:focus{opacity:1;background:#fff}._inplaceContainer_cw98j_55{display:flex;align-items:center}._inplaceContainer_cw98j_55:hover ._helpButtonInplace_cw98j_30{opacity:1}._helpButtonInplace_cw98j_30:focus{opacity:1;background:#fff}._active_cw98j_69{box-shadow:0 0 10px #0a4bd6}._helpButtonInside_cw98j_73{left:1rem}._closeButton_cw98j_77{margin-top:.5rem;align-self:flex-end;font-size:.75rem;padding:3px 8px}
|
package/dist/assets/InfoPop.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._popper_19um0_1{position:relative;display:flex;flex-direction:column;padding:1rem 1.5rem;border-radius:6px;font-family:Andika,sans-serif;animation:_fadeIn_19um0_1 .3s ease-out;max-width:250px;--infopop-bg: #0a4bd6}._dark_19um0_13{--infopop-bg: #0a4bd6;background:var(--infopop-bg);color:#fff}._light_19um0_19{--infopop-bg: white;background:var(--infopop-bg);color:#444}._arrow_19um0_25{position:absolute;width:0;height:0;background:none;transform:rotate(45deg)}._root_19um0_34[data-popper-placement^=bottom] ._arrow_19um0_25{top:-10px;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:10px solid #0a4bd6}._root_19um0_34[data-popper-placement^=top] ._arrow_19um0_25{bottom:-10px;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #0a4bd6}._root_19um0_34[data-popper-placement^=right] ._arrow_19um0_25{left:-10px;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:10px solid #0a4bd6}._root_19um0_34[data-popper-placement^=left] ._arrow_19um0_25{right:-10px;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:10px solid #0a4bd6}._popper_19um0_1._right_19um0_60:before{content:"";position:absolute;width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:10px solid #0a4bd6;left:0;top:calc(50% - 10px)}._popper_19um0_1._left_19um0_72:before{content:"";position:absolute;width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:10px solid #0a4bd6;right:0;top:calc(50% - 10px)}._popper_19um0_1._bottom_19um0_84:before{content:"";position:absolute;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:10px solid #0a4bd6;top:0;left:calc(50% - 8px)}._popper_19um0_1._top_19um0_96:before{content:"";position:absolute;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #0a4bd6;bottom:0;left:calc(50% - 8px)}._popper_19um0_1 h2{margin:0;font-size:1.2rem}._popper_19um0_1 p{margin:0;font-size:.9rem}._root_19um0_34[data-popper-placement^=bottom] ._popper_19um0_1{margin-top:10px}._root_19um0_34[data-popper-placement^=top] ._popper_19um0_1{margin-bottom:10px}._root_19um0_34[data-popper-placement^=right] ._popper_19um0_1{margin-left:5px}._root_19um0_34[data-popper-placement^=left] ._popper_19um0_1{margin-right:5px}@keyframes _fadeIn_19um0_1{0%{opacity:0}to{opacity:1}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._sidePanel_aqxrv_1{background:#fff;display:flex;z-index:2;flex-shrink:0;position:relative;transition:opacity .3s ease-in;opacity:0}._sidePanelHorizontal_aqxrv_14{flex-direction:column;width:100%}._sidePanel_aqxrv_1._closed_aqxrv_19{opacity:0;transition:width .3s cubic-bezier(.4,0,.2,1),height .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-out}._sidePanel_aqxrv_1._opening_aqxrv_27{opacity:1;transition:width .3s cubic-bezier(.4,0,.2,1),height .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-in}@media (prefers-reduced-motion: reduce){._sidePanel_aqxrv_1,._sidePanel_aqxrv_1._closed_aqxrv_19,._sidePanel_aqxrv_1._opening_aqxrv_27{transition:none}}._sidePanel_aqxrv_1._open_aqxrv_27{opacity:1}._resizer_aqxrv_47{background-color:transparent;box-sizing:border-box;position:absolute;opacity:1;touch-action:none;-webkit-user-select:none;user-select:none;z-index:2}._resizerHorizontal_aqxrv_58{height:30px;width:100%;cursor:ns-resize;left:0;top:-8px;right:0}._resizerVertical_aqxrv_67{width:30px;cursor:ew-resize;left:-8px;top:0;bottom:0}._noSelect_aqxrv_75{-webkit-user-select:none;user-select:none}._resizerBar_aqxrv_79{position:absolute;top:0;left:7px;width:2px;height:100%;background-color:#bbb;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHorizontal_aqxrv_58 ._resizerBar_aqxrv_79{top:7px;left:0;width:100%;height:2px}._resizer_aqxrv_47:hover ._resizerBar_aqxrv_79{background-color:#75a4e288}._resizer_aqxrv_47._resizing_aqxrv_101 ._resizerBar_aqxrv_79{background-color:#75a4e2}._resizerHandle_aqxrv_105{position:absolute;top:50%;left:2px;width:10px;height:60px;transform:translateY(-50%);background-color:#fff;border-radius:3px;border:2px solid #bbb;box-shadow:0 0 4px #ccc;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHorizontal_aqxrv_58 ._resizerHandle_aqxrv_105{top:2px;left:50%;width:60px;height:10px;transform:translate(-50%)}._resizerHandle_aqxrv_105._minimised_aqxrv_131{left:-15px;width:20px}._resizerHorizontal_aqxrv_58 ._resizerHandle_aqxrv_105._minimised_aqxrv_131{top:-15px;height:20px;left:50%;width:60px;transform:translate(-50%)}._resizerHandle_aqxrv_105:focus{outline:2px solid #75a4e2;outline-offset:2px}._resizerVertical_aqxrv_67 ._resizerHandle_aqxrv_105:before{content:"";display:block;width:4px;height:20px;background:radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 2px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 8px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 14px;background-repeat:no-repeat;background-size:4px 4px}._resizerHorizontal_aqxrv_58 ._resizerHandle_aqxrv_105:before{content:"";display:block;width:20px;height:4px;background:radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 2px 0,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 8px 0,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 14px 0;background-repeat:no-repeat;background-size:4px 4px}._resizer_aqxrv_47:hover ._resizerHandle_aqxrv_105,._resizer_aqxrv_47._resizing_aqxrv_101 ._resizerHandle_aqxrv_105{border-color:#75a4e2}._expand_aqxrv_183{position:absolute;top:2rem;right:0;height:40px;width:30px;background-color:#fff;border-radius:3px;border:2px solid #aaa;cursor:pointer;display:flex;align-items:center;justify-content:center}._content_aqxrv_199{flex-grow:1;overflow:auto;min-width:300px!important}._closeButton_aqxrv_206{position:sticky;top:.5rem;margin-left:auto;width:min-content;z-index:100}
|
|
@@ -5,8 +5,11 @@ interface Props extends PropsWithChildren {
|
|
|
5
5
|
active?: boolean;
|
|
6
6
|
style?: CSSProperties;
|
|
7
7
|
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
8
|
+
buttonPlacement?: 'top' | 'bottom' | 'left' | 'right';
|
|
8
9
|
inplace?: boolean;
|
|
9
10
|
inside?: boolean;
|
|
11
|
+
keepOpen?: boolean;
|
|
12
|
+
closeLabel?: string;
|
|
10
13
|
}
|
|
11
|
-
export default function Help({ message, children, widget, style: customStyle, active, placement, inplace, inside, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default function Help({ message, children, widget, style: customStyle, active, placement, inplace, inside, keepOpen, closeLabel, buttonPlacement, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
15
|
export {};
|
|
@@ -1,69 +1,108 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { IconButton as
|
|
3
|
-
import
|
|
4
|
-
import { c as
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { IconButton as p } from "@mui/material";
|
|
3
|
+
import w from "../InfoPop/InfoPop.js";
|
|
4
|
+
import { c as g } from "../../createSvgIcon-BM4dw4Lw.js";
|
|
5
|
+
import { useState as S } from "react";
|
|
6
|
+
import { C as $ } from "../../Close-Cv_QwhIN.js";
|
|
7
|
+
import "../../state/webrtcState.js";
|
|
8
|
+
import "react-i18next";
|
|
9
|
+
import "../../hooks/peer.js";
|
|
10
|
+
import { Button as z } from "../Button/Button.js";
|
|
11
|
+
import "../../index-SOhdqzHq.js";
|
|
12
|
+
import "../../style/theme.js";
|
|
13
|
+
import "../../util/canvas.js";
|
|
14
|
+
import "../../FileSaver.min-DhePf63e.js";
|
|
15
|
+
import "../BusyButton/BusyButton.js";
|
|
16
|
+
import "../../browser-HW-wgeM2.js";
|
|
17
|
+
import "../WorkflowLayout/lines.js";
|
|
18
|
+
import "../WorkflowLayout/svgContext.js";
|
|
19
|
+
import "../WorkflowLayout/Widget.js";
|
|
20
|
+
import "../IconMenu/context.js";
|
|
21
|
+
import "@emotion/react";
|
|
22
|
+
import '../../assets/Help.css';const u = g(/* @__PURE__ */ o("path", {
|
|
7
23
|
d: "M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"
|
|
8
|
-
}), "HelpOutline"),
|
|
9
|
-
helpButton:
|
|
10
|
-
|
|
11
|
-
|
|
24
|
+
}), "HelpOutline"), N = "_helpButton_cw98j_1", b = "_left_cw98j_10", x = "_right_cw98j_15", y = "_top_cw98j_20", E = "_bottom_cw98j_25", H = "_helpButtonInplace_cw98j_30", M = "_container_cw98j_41", k = "_inplaceContainer_cw98j_55", L = "_active_cw98j_69", T = "_helpButtonInside_cw98j_73", A = "_closeButton_cw98j_77", t = {
|
|
25
|
+
helpButton: N,
|
|
26
|
+
left: b,
|
|
27
|
+
right: x,
|
|
28
|
+
top: y,
|
|
29
|
+
bottom: E,
|
|
30
|
+
helpButtonInplace: H,
|
|
31
|
+
container: M,
|
|
12
32
|
inplaceContainer: k,
|
|
13
|
-
active:
|
|
14
|
-
helpButtonInside:
|
|
33
|
+
active: L,
|
|
34
|
+
helpButtonInside: T,
|
|
35
|
+
closeButton: A
|
|
15
36
|
};
|
|
16
|
-
function
|
|
17
|
-
message:
|
|
37
|
+
function lt({
|
|
38
|
+
message: _,
|
|
18
39
|
children: h,
|
|
19
|
-
widget:
|
|
20
|
-
style:
|
|
21
|
-
active:
|
|
22
|
-
placement:
|
|
40
|
+
widget: d,
|
|
41
|
+
style: f,
|
|
42
|
+
active: B,
|
|
43
|
+
placement: I,
|
|
23
44
|
inplace: n,
|
|
24
|
-
inside:
|
|
45
|
+
inside: e,
|
|
46
|
+
keepOpen: c,
|
|
47
|
+
closeLabel: j,
|
|
48
|
+
buttonPlacement: C = "left"
|
|
25
49
|
}) {
|
|
26
|
-
const [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
50
|
+
const [l, r] = S(null), s = (a) => {
|
|
51
|
+
r(
|
|
52
|
+
(v) => v ? null : n || e ? a.currentTarget : a.currentTarget.parentElement
|
|
53
|
+
);
|
|
54
|
+
}, i = () => {
|
|
55
|
+
r(null);
|
|
30
56
|
};
|
|
31
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ m(
|
|
32
58
|
"div",
|
|
33
59
|
{
|
|
34
|
-
className: `${n ? t.inplaceContainer : t.container} ${
|
|
35
|
-
"data-widget":
|
|
36
|
-
"data-active":
|
|
37
|
-
style:
|
|
60
|
+
className: `${n ? t.inplaceContainer : t.container} ${l && !n && !e ? t.active : ""}`,
|
|
61
|
+
"data-widget": d,
|
|
62
|
+
"data-active": B ? "true" : "false",
|
|
63
|
+
style: f,
|
|
38
64
|
children: [
|
|
39
|
-
!n && /* @__PURE__ */
|
|
40
|
-
|
|
65
|
+
!n && /* @__PURE__ */ o(
|
|
66
|
+
p,
|
|
41
67
|
{
|
|
42
|
-
onClick:
|
|
43
|
-
onMouseLeave:
|
|
44
|
-
className: `${t.helpButton} ${
|
|
68
|
+
onClick: s,
|
|
69
|
+
onMouseLeave: c ? void 0 : i,
|
|
70
|
+
className: `${t.helpButton} ${e ? t.helpButtonInside : ""} ${t[C]}`,
|
|
45
71
|
color: "inherit",
|
|
46
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ o(u, { fontSize: "medium" })
|
|
47
73
|
}
|
|
48
74
|
),
|
|
49
75
|
h,
|
|
50
|
-
n && /* @__PURE__ */
|
|
51
|
-
|
|
76
|
+
n && /* @__PURE__ */ o(
|
|
77
|
+
p,
|
|
52
78
|
{
|
|
53
|
-
onClick:
|
|
54
|
-
onMouseLeave:
|
|
79
|
+
onClick: s,
|
|
80
|
+
onMouseLeave: c ? void 0 : i,
|
|
55
81
|
className: t.helpButtonInplace,
|
|
56
82
|
color: "inherit",
|
|
57
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ o(u, { fontSize: "medium" })
|
|
58
84
|
}
|
|
59
85
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
86
|
+
/* @__PURE__ */ m(
|
|
87
|
+
w,
|
|
62
88
|
{
|
|
63
|
-
anchorEl:
|
|
64
|
-
open: !!
|
|
65
|
-
placement:
|
|
66
|
-
children:
|
|
89
|
+
anchorEl: l,
|
|
90
|
+
open: !!l,
|
|
91
|
+
placement: I,
|
|
92
|
+
children: [
|
|
93
|
+
_,
|
|
94
|
+
c && /* @__PURE__ */ o(
|
|
95
|
+
z,
|
|
96
|
+
{
|
|
97
|
+
onClick: i,
|
|
98
|
+
className: t.closeButton,
|
|
99
|
+
color: "inherit",
|
|
100
|
+
startIcon: /* @__PURE__ */ o($, { fontSize: "small" }),
|
|
101
|
+
variant: "outlined",
|
|
102
|
+
children: j || "Close"
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
67
106
|
}
|
|
68
107
|
)
|
|
69
108
|
]
|
|
@@ -71,5 +110,5 @@ function j({
|
|
|
71
110
|
);
|
|
72
111
|
}
|
|
73
112
|
export {
|
|
74
|
-
|
|
113
|
+
lt as default
|
|
75
114
|
};
|
|
@@ -6,5 +6,5 @@ interface Props extends Omit<PopperProps, 'children'>, PropsWithChildren {
|
|
|
6
6
|
offsetX?: number;
|
|
7
7
|
delay?: number;
|
|
8
8
|
}
|
|
9
|
-
export default function InfoPop({ open, delay, children, offsetY, offsetX, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function InfoPop({ open, delay, children, offsetY, offsetX, modifiers: userModifiers, theme, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,48 +1,75 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Popper as
|
|
3
|
-
import { useState as d, useRef as
|
|
4
|
-
import '../../assets/InfoPop.css';const
|
|
5
|
-
popper:
|
|
6
|
-
fadeIn:
|
|
7
|
-
dark:
|
|
8
|
-
light:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
right:
|
|
12
|
-
left:
|
|
1
|
+
import { jsx as f, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { Popper as N } from "@mui/material";
|
|
3
|
+
import { useState as d, useRef as O, useEffect as j, useMemo as v } from "react";
|
|
4
|
+
import '../../assets/InfoPop.css';const P = "_popper_19um0_1", R = "_fadeIn_19um0_1", T = "_dark_19um0_13", $ = "_light_19um0_19", z = "_arrow_19um0_25", A = "_root_19um0_34", S = "_right_19um0_60", q = "_left_19um0_72", B = "_bottom_19um0_84", C = "_top_19um0_96", e = {
|
|
5
|
+
popper: P,
|
|
6
|
+
fadeIn: R,
|
|
7
|
+
dark: T,
|
|
8
|
+
light: $,
|
|
9
|
+
arrow: z,
|
|
10
|
+
root: A,
|
|
11
|
+
right: S,
|
|
12
|
+
left: q,
|
|
13
|
+
bottom: B,
|
|
14
|
+
top: C
|
|
13
15
|
};
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
function H({
|
|
17
|
+
open: t,
|
|
18
|
+
delay: r,
|
|
19
|
+
children: h,
|
|
20
|
+
offsetY: s = 0,
|
|
21
|
+
offsetX: n = 0,
|
|
22
|
+
modifiers: c,
|
|
23
|
+
theme: w = "dark",
|
|
24
|
+
...x
|
|
25
|
+
}) {
|
|
26
|
+
const [g, i] = d(t), p = O(t), [a, I] = d(null);
|
|
27
|
+
p.current = t, j(() => {
|
|
17
28
|
if (t) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
},
|
|
29
|
+
const o = r ? setTimeout(() => {
|
|
30
|
+
p.current && i(t);
|
|
31
|
+
}, r) : void 0;
|
|
21
32
|
return () => {
|
|
22
|
-
|
|
33
|
+
o && clearTimeout(o);
|
|
23
34
|
};
|
|
24
35
|
} else
|
|
25
|
-
|
|
26
|
-
}, [t,
|
|
27
|
-
const
|
|
28
|
-
{
|
|
36
|
+
i(!1);
|
|
37
|
+
}, [t, r]);
|
|
38
|
+
const k = v(() => {
|
|
39
|
+
const o = [...c ?? []], m = (b, u) => {
|
|
40
|
+
const l = o.findIndex((_) => (_ == null ? void 0 : _.name) === b);
|
|
41
|
+
l >= 0 ? o[l] = u : o.push(u);
|
|
42
|
+
};
|
|
43
|
+
return (n || s) && m("offset", {
|
|
29
44
|
name: "offset",
|
|
30
|
-
options: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
options: { offset: [n, s] }
|
|
46
|
+
}), a && m("arrow", {
|
|
47
|
+
name: "arrow",
|
|
48
|
+
options: { element: a, padding: 8 }
|
|
49
|
+
}), o;
|
|
50
|
+
}, [c, n, s, a]);
|
|
51
|
+
return /* @__PURE__ */ f(
|
|
52
|
+
N,
|
|
37
53
|
{
|
|
38
|
-
open:
|
|
39
|
-
...
|
|
40
|
-
|
|
54
|
+
open: r ? g : t,
|
|
55
|
+
...x,
|
|
56
|
+
className: e.root,
|
|
57
|
+
modifiers: k,
|
|
41
58
|
sx: { zIndex: 10 },
|
|
42
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ E("div", { className: `${e.popper} ${e[w]}`, children: [
|
|
60
|
+
/* @__PURE__ */ f(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
ref: I,
|
|
64
|
+
className: e.arrow,
|
|
65
|
+
"data-popper-arrow": !0
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
h
|
|
69
|
+
] })
|
|
43
70
|
}
|
|
44
71
|
);
|
|
45
72
|
}
|
|
46
73
|
export {
|
|
47
|
-
|
|
74
|
+
H as default
|
|
48
75
|
};
|
|
@@ -4,6 +4,7 @@ interface Props extends PropsWithChildren {
|
|
|
4
4
|
onClose?: () => void;
|
|
5
5
|
onOpen?: () => void;
|
|
6
6
|
position?: 'right' | 'bottom';
|
|
7
|
+
closeLabel?: string;
|
|
7
8
|
}
|
|
8
|
-
export default function SidePanel({ children, open, onClose, onOpen, position }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function SidePanel({ children, open, onClose, onOpen, closeLabel, position }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,109 +1,126 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { C as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import '../../assets/SidePanel.css';const
|
|
6
|
-
sidePanel:
|
|
7
|
-
sidePanelHorizontal:
|
|
8
|
-
closed:
|
|
9
|
-
opening:
|
|
10
|
-
open:
|
|
11
|
-
resizer:
|
|
12
|
-
resizerHorizontal:
|
|
13
|
-
resizerVertical:
|
|
14
|
-
noSelect:
|
|
15
|
-
resizerBar:
|
|
16
|
-
resizing:
|
|
17
|
-
resizerHandle:
|
|
18
|
-
minimised:
|
|
19
|
-
content:
|
|
20
|
-
closeButton:
|
|
21
|
-
},
|
|
22
|
-
function
|
|
23
|
-
const [
|
|
24
|
-
window.sessionStorage.getItem(
|
|
25
|
-
),
|
|
1
|
+
import { jsxs as M, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useRef as v, useEffect as I } from "react";
|
|
3
|
+
import { C as L } from "../../Close-Cv_QwhIN.js";
|
|
4
|
+
import { IconButton as T } from "@mui/material";
|
|
5
|
+
import '../../assets/SidePanel.css';const k = "_sidePanel_aqxrv_1", V = "_sidePanelHorizontal_aqxrv_14", W = "_closed_aqxrv_19", Z = "_opening_aqxrv_27", C = "_open_aqxrv_27", K = "_resizer_aqxrv_47", U = "_resizerHorizontal_aqxrv_58", X = "_resizerVertical_aqxrv_67", j = "_noSelect_aqxrv_75", F = "_resizerBar_aqxrv_79", O = "_resizing_aqxrv_101", Y = "_resizerHandle_aqxrv_105", G = "_minimised_aqxrv_131", J = "_content_aqxrv_199", Q = "_closeButton_aqxrv_206", t = {
|
|
6
|
+
sidePanel: k,
|
|
7
|
+
sidePanelHorizontal: V,
|
|
8
|
+
closed: W,
|
|
9
|
+
opening: Z,
|
|
10
|
+
open: C,
|
|
11
|
+
resizer: K,
|
|
12
|
+
resizerHorizontal: U,
|
|
13
|
+
resizerVertical: X,
|
|
14
|
+
noSelect: j,
|
|
15
|
+
resizerBar: F,
|
|
16
|
+
resizing: O,
|
|
17
|
+
resizerHandle: Y,
|
|
18
|
+
minimised: G,
|
|
19
|
+
content: J,
|
|
20
|
+
closeButton: Q
|
|
21
|
+
}, p = 30, N = 300, E = Math.max(N, Math.floor(window.innerWidth * 0.25)), c = "sidePanelWidth";
|
|
22
|
+
function re({ children: D, open: o, onClose: d, onOpen: q, closeLabel: $, position: i = "right" }) {
|
|
23
|
+
const [u, s] = h(o ? E : 0), w = v(null), [_, H] = h(!1), [g, P] = h(!1), [b, y] = h(!o), S = v(null), z = v(null), l = v(
|
|
24
|
+
window.sessionStorage.getItem(c) ? Number(window.sessionStorage.getItem(c)) : E
|
|
25
|
+
), a = Math.max(
|
|
26
26
|
N,
|
|
27
|
-
Math.floor(
|
|
27
|
+
Math.floor(i === "right" ? window.innerWidth * 0.9 : window.innerHeight * 0.9)
|
|
28
28
|
);
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
29
|
+
I(() => {
|
|
30
|
+
if (o)
|
|
31
|
+
P(!0), y(!1), z.current = document.activeElement ? document.activeElement : null;
|
|
32
32
|
else {
|
|
33
33
|
s(0);
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const n = setTimeout(() => {
|
|
35
|
+
y(!0), z.current && document.contains(z.current) && z.current.focus();
|
|
36
36
|
}, 300);
|
|
37
|
-
return () => clearTimeout(
|
|
37
|
+
return () => clearTimeout(n);
|
|
38
38
|
}
|
|
39
|
-
}, [
|
|
40
|
-
if (
|
|
41
|
-
s(
|
|
42
|
-
const
|
|
43
|
-
|
|
39
|
+
}, [o]), I(() => {
|
|
40
|
+
if (g) {
|
|
41
|
+
S.current && S.current.focus(), s(l.current || E);
|
|
42
|
+
const n = setTimeout(() => {
|
|
43
|
+
P(!1);
|
|
44
44
|
}, 300);
|
|
45
|
-
return () => clearTimeout(
|
|
45
|
+
return () => clearTimeout(n);
|
|
46
46
|
}
|
|
47
|
-
}, [
|
|
48
|
-
if (
|
|
49
|
-
let
|
|
50
|
-
if (
|
|
51
|
-
const
|
|
52
|
-
|
|
47
|
+
}, [g]), I(() => {
|
|
48
|
+
if (_) {
|
|
49
|
+
let n = function(e) {
|
|
50
|
+
if (_ && w.current) {
|
|
51
|
+
const R = w.current.getBoundingClientRect(), B = i === "right" ? R.right - e.clientX : R.bottom - e.clientY, f = Math.max(Math.min(B, a), p);
|
|
52
|
+
f - B > 10 ? s(0) : (l.current = f, s(f), window.sessionStorage.setItem(c, f.toString())), e.preventDefault();
|
|
53
53
|
}
|
|
54
|
-
},
|
|
55
|
-
|
|
54
|
+
}, r = function() {
|
|
55
|
+
H(!1);
|
|
56
56
|
};
|
|
57
|
-
return window.addEventListener("pointermove",
|
|
58
|
-
window.removeEventListener("pointermove",
|
|
57
|
+
return window.addEventListener("pointermove", n, { passive: !1 }), window.addEventListener("pointerup", r), document.body.classList.add(t.noSelect), () => {
|
|
58
|
+
window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), document.body.classList.remove(t.noSelect);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
}, [
|
|
62
|
-
const
|
|
61
|
+
}, [_, i, a]);
|
|
62
|
+
const x = u === 0, A = /* @__PURE__ */ M(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
className: `${
|
|
65
|
+
className: `${t.resizer} ${_ ? t.resizing : ""} ${i === "right" ? t.resizerVertical : t.resizerHorizontal}`,
|
|
66
66
|
onPointerDown: () => {
|
|
67
|
-
|
|
67
|
+
H(!0), q && q();
|
|
68
68
|
},
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
70
|
+
/* @__PURE__ */ m("div", { className: t.resizerBar }),
|
|
71
|
+
o && /* @__PURE__ */ m(
|
|
72
72
|
"div",
|
|
73
73
|
{
|
|
74
|
-
className: `${
|
|
74
|
+
className: `${t.resizerHandle} ${x ? t.minimised : ""}`,
|
|
75
75
|
role: "separator",
|
|
76
|
-
"aria-orientation":
|
|
76
|
+
"aria-orientation": i === "right" ? "vertical" : "horizontal",
|
|
77
77
|
"aria-label": "Resize sidebar",
|
|
78
78
|
tabIndex: 0,
|
|
79
|
-
"aria-valuenow":
|
|
80
|
-
"aria-valuemin":
|
|
81
|
-
"aria-valuemax":
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
"aria-valuenow": u,
|
|
80
|
+
"aria-valuemin": 0,
|
|
81
|
+
"aria-valuemax": a,
|
|
82
|
+
ref: S,
|
|
83
|
+
onKeyDown: (n) => {
|
|
84
|
+
i === "right" ? n.key === "ArrowRight" ? s((r) => {
|
|
85
|
+
const e = Math.min(a, Math.max(0, r - 50));
|
|
86
|
+
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
87
|
+
}) : n.key === "ArrowLeft" && s((r) => {
|
|
88
|
+
const e = Math.max(p, Math.min(a, r + 50));
|
|
89
|
+
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
90
|
+
}) : n.key === "ArrowDown" ? s((r) => {
|
|
91
|
+
const e = Math.min(a, Math.max(0, r - 50));
|
|
92
|
+
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
93
|
+
}) : n.key === "ArrowUp" && s((r) => {
|
|
94
|
+
const e = Math.max(p, Math.min(a, r + 50));
|
|
95
|
+
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
96
|
+
});
|
|
84
97
|
}
|
|
85
98
|
}
|
|
86
99
|
)
|
|
87
100
|
]
|
|
88
101
|
}
|
|
89
102
|
);
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
"
|
|
103
|
+
return /* @__PURE__ */ M(
|
|
104
|
+
"aside",
|
|
92
105
|
{
|
|
93
|
-
className: `${
|
|
94
|
-
style:
|
|
95
|
-
ref:
|
|
96
|
-
"aria-hidden": !
|
|
106
|
+
className: `${t.sidePanel} ${o ? t.open : t.closed} ${g ? t.opening : ""} ${i === "right" ? t.sidePanelVertical : t.sidePanelHorizontal}`,
|
|
107
|
+
style: i === "right" ? { width: x ? 0 : u, visibility: b ? "hidden" : void 0 } : { height: x ? 0 : u, visibility: b ? "hidden" : void 0 },
|
|
108
|
+
ref: w,
|
|
109
|
+
"aria-hidden": !o,
|
|
110
|
+
onKeyDownCapture: (n) => {
|
|
111
|
+
n.key === "Escape" && (n.stopPropagation(), d == null || d());
|
|
112
|
+
},
|
|
97
113
|
children: [
|
|
98
|
-
(
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
101
|
-
|
|
114
|
+
(i === "right" || i === "bottom") && A,
|
|
115
|
+
/* @__PURE__ */ M("div", { className: t.content, children: [
|
|
116
|
+
d && /* @__PURE__ */ m("div", { className: t.closeButton, children: /* @__PURE__ */ m(
|
|
117
|
+
T,
|
|
102
118
|
{
|
|
103
|
-
onClick:
|
|
119
|
+
onClick: d,
|
|
104
120
|
"data-testid": "sidepanel-close-button",
|
|
105
|
-
|
|
106
|
-
|
|
121
|
+
"aria-label": $ ?? "Close side panel",
|
|
122
|
+
children: /* @__PURE__ */ m(
|
|
123
|
+
L,
|
|
107
124
|
{
|
|
108
125
|
fontSize: "medium",
|
|
109
126
|
htmlColor: "#444"
|
|
@@ -111,12 +128,12 @@ function ie({ children: R, open: r, onClose: S, onOpen: I, position: t = "right"
|
|
|
111
128
|
)
|
|
112
129
|
}
|
|
113
130
|
) }),
|
|
114
|
-
|
|
131
|
+
D
|
|
115
132
|
] })
|
|
116
133
|
]
|
|
117
134
|
}
|
|
118
135
|
);
|
|
119
136
|
}
|
|
120
137
|
export {
|
|
121
|
-
|
|
138
|
+
re as default
|
|
122
139
|
};
|