@genai-fi/base 4.3.5 → 4.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._sidePanel_g53a4_1{background:#fff;display:flex;z-index:2;flex-shrink:0;position:relative;transition:opacity .3s ease-in;opacity:0}._sidePanelHorizontal_g53a4_14{flex-direction:column;width:100%}._sidePanel_g53a4_1._closed_g53a4_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_g53a4_1._opening_g53a4_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_g53a4_1,._sidePanel_g53a4_1._closed_g53a4_19,._sidePanel_g53a4_1._opening_g53a4_27{transition:none}}._sidePanel_g53a4_1._open_g53a4_27{opacity:1}._resizer_g53a4_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_g53a4_58{height:30px;width:100%;cursor:ns-resize;left:0;top:-8px;right:0}._resizerVertical_g53a4_67{width:30px;cursor:ew-resize;left:-8px;top:0;bottom:0}._noSelect_g53a4_75{-webkit-user-select:none;user-select:none}._resizerBar_g53a4_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_g53a4_58 ._resizerBar_g53a4_79{top:7px;left:0;width:100%;height:2px}._resizer_g53a4_47:hover ._resizerBar_g53a4_79{background-color:#75a4e288}._resizer_g53a4_47._resizing_g53a4_101 ._resizerBar_g53a4_79{background-color:#75a4e2}._resizerHandle_g53a4_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_g53a4_58 ._resizerHandle_g53a4_105{top:2px;left:50%;width:60px;height:10px;transform:translate(-50%)}._resizerHandle_g53a4_105._minimised_g53a4_131{left:-15px;width:20px}._resizerHorizontal_g53a4_58 ._resizerHandle_g53a4_105._minimised_g53a4_131{top:-15px;height:20px;left:50%;width:60px;transform:translate(-50%)}._resizerHandle_g53a4_105:focus{outline:2px solid #75a4e2;outline-offset:2px}._resizerVertical_g53a4_67 ._resizerHandle_g53a4_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_g53a4_58 ._resizerHandle_g53a4_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_g53a4_47:hover ._resizerHandle_g53a4_105,._resizer_g53a4_47._resizing_g53a4_101 ._resizerHandle_g53a4_105{border-color:#75a4e2}._expand_g53a4_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_g53a4_199{flex-grow:1;overflow:auto}._closeButton_g53a4_205{position:sticky;top:.5rem;margin-left:auto;width:min-content;z-index:100}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CSSProperties, PropsWithChildren } from 'react';
|
|
1
|
+
import { CSSProperties, PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
interface Props extends PropsWithChildren {
|
|
3
|
-
message:
|
|
3
|
+
message: ReactNode;
|
|
4
4
|
widget?: string;
|
|
5
5
|
active?: boolean;
|
|
6
6
|
style?: CSSProperties;
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as h, useRef 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:
|
|
1
|
+
import { jsxs as p, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useRef as w, useEffect as E } from "react";
|
|
3
|
+
import { C as T } from "../../Close-Cv_QwhIN.js";
|
|
4
|
+
import { IconButton as k } from "@mui/material";
|
|
5
|
+
import '../../assets/SidePanel.css';const V = "_sidePanel_g53a4_1", W = "_sidePanelHorizontal_g53a4_14", Z = "_closed_g53a4_19", C = "_opening_g53a4_27", K = "_open_g53a4_27", U = "_resizer_g53a4_47", X = "_resizerHorizontal_g53a4_58", j = "_resizerVertical_g53a4_67", F = "_noSelect_g53a4_75", O = "_resizerBar_g53a4_79", Y = "_resizing_g53a4_101", G = "_resizerHandle_g53a4_105", q = "_minimised_g53a4_131", J = "_content_g53a4_199", Q = "_closeButton_g53a4_205", t = {
|
|
6
|
+
sidePanel: V,
|
|
7
|
+
sidePanelHorizontal: W,
|
|
8
|
+
closed: Z,
|
|
9
|
+
opening: C,
|
|
10
|
+
open: K,
|
|
11
|
+
resizer: U,
|
|
12
|
+
resizerHorizontal: X,
|
|
13
|
+
resizerVertical: j,
|
|
14
|
+
noSelect: F,
|
|
15
|
+
resizerBar: O,
|
|
16
|
+
resizing: Y,
|
|
17
|
+
resizerHandle: G,
|
|
18
|
+
minimised: q,
|
|
19
19
|
content: J,
|
|
20
20
|
closeButton: Q
|
|
21
|
-
},
|
|
22
|
-
function re({ children:
|
|
23
|
-
const [
|
|
24
|
-
window.sessionStorage.getItem(c) ? Number(window.sessionStorage.getItem(c)) :
|
|
21
|
+
}, H = 30, b = 300, P = Math.max(b, Math.floor(window.innerWidth * 0.25)), c = "sidePanelWidth";
|
|
22
|
+
function re({ children: $, open: o, onClose: d, onOpen: y, closeLabel: A, position: i = "right" }) {
|
|
23
|
+
const [m, s] = h(o ? P : 0), S = w(null), [g, x] = h(!1), [v, R] = h(!1), [M, B] = h(!o), I = w(null), _ = w(null), l = w(
|
|
24
|
+
window.sessionStorage.getItem(c) ? Number(window.sessionStorage.getItem(c)) : P
|
|
25
25
|
), a = Math.max(
|
|
26
|
-
|
|
26
|
+
b,
|
|
27
27
|
Math.floor(i === "right" ? window.innerWidth * 0.9 : window.innerHeight * 0.9)
|
|
28
28
|
);
|
|
29
|
-
|
|
29
|
+
E(() => {
|
|
30
30
|
if (o)
|
|
31
|
-
|
|
31
|
+
R(!0), B(!1), _.current = document.activeElement ? document.activeElement : null;
|
|
32
32
|
else {
|
|
33
33
|
s(0);
|
|
34
34
|
const n = setTimeout(() => {
|
|
35
|
-
|
|
35
|
+
B(!0), _.current && document.contains(_.current) && _.current.focus();
|
|
36
36
|
}, 300);
|
|
37
37
|
return () => clearTimeout(n);
|
|
38
38
|
}
|
|
39
|
-
}, [o]),
|
|
40
|
-
if (
|
|
41
|
-
|
|
39
|
+
}, [o]), E(() => {
|
|
40
|
+
if (v) {
|
|
41
|
+
I.current && I.current.focus(), s(l.current || P);
|
|
42
42
|
const n = setTimeout(() => {
|
|
43
|
-
|
|
43
|
+
R(!1);
|
|
44
44
|
}, 300);
|
|
45
45
|
return () => clearTimeout(n);
|
|
46
46
|
}
|
|
47
|
-
}, [
|
|
48
|
-
if (
|
|
47
|
+
}, [v]), E(() => {
|
|
48
|
+
if (g) {
|
|
49
49
|
let n = function(e) {
|
|
50
|
-
if (
|
|
51
|
-
const
|
|
52
|
-
f -
|
|
50
|
+
if (g && S.current) {
|
|
51
|
+
const N = S.current.getBoundingClientRect(), D = i === "right" ? N.right - e.clientX : N.bottom - e.clientY, f = Math.max(Math.min(D, a), H);
|
|
52
|
+
f - D > 10 ? s(0) : (l.current = f, s(f), window.sessionStorage.setItem(c, f.toString())), e.preventDefault();
|
|
53
53
|
}
|
|
54
54
|
}, r = function() {
|
|
55
|
-
|
|
55
|
+
x(!1);
|
|
56
56
|
};
|
|
57
57
|
return window.addEventListener("pointermove", n, { passive: !1 }), window.addEventListener("pointerup", r), document.body.classList.add(t.noSelect), () => {
|
|
58
58
|
window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), document.body.classList.remove(t.noSelect);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
}, [
|
|
62
|
-
const
|
|
61
|
+
}, [g, i, a]);
|
|
62
|
+
const z = m === 0 || M, L = /* @__PURE__ */ p(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
className: `${t.resizer} ${
|
|
65
|
+
className: `${t.resizer} ${g ? t.resizing : ""} ${i === "right" ? t.resizerVertical : t.resizerHorizontal}`,
|
|
66
66
|
onPointerDown: () => {
|
|
67
|
-
|
|
67
|
+
x(!0), y && y();
|
|
68
68
|
},
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
o && /* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ u("div", { className: t.resizerBar }),
|
|
71
|
+
o && /* @__PURE__ */ u(
|
|
72
72
|
"div",
|
|
73
73
|
{
|
|
74
|
-
className: `${t.resizerHandle} ${
|
|
74
|
+
className: `${t.resizerHandle} ${z ? t.minimised : ""}`,
|
|
75
75
|
role: "separator",
|
|
76
76
|
"aria-orientation": i === "right" ? "vertical" : "horizontal",
|
|
77
77
|
"aria-label": "Resize sidebar",
|
|
78
78
|
tabIndex: 0,
|
|
79
|
-
"aria-valuenow":
|
|
79
|
+
"aria-valuenow": m,
|
|
80
80
|
"aria-valuemin": 0,
|
|
81
81
|
"aria-valuemax": a,
|
|
82
|
-
ref:
|
|
82
|
+
ref: I,
|
|
83
83
|
onKeyDown: (n) => {
|
|
84
84
|
i === "right" ? n.key === "ArrowRight" ? s((r) => {
|
|
85
85
|
const e = Math.min(a, Math.max(0, r - 50));
|
|
86
86
|
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
87
87
|
}) : n.key === "ArrowLeft" && s((r) => {
|
|
88
|
-
const e = Math.max(
|
|
88
|
+
const e = Math.max(H, Math.min(a, r + 50));
|
|
89
89
|
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
90
90
|
}) : n.key === "ArrowDown" ? s((r) => {
|
|
91
91
|
const e = Math.min(a, Math.max(0, r - 50));
|
|
92
92
|
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
93
93
|
}) : n.key === "ArrowUp" && s((r) => {
|
|
94
|
-
const e = Math.max(
|
|
94
|
+
const e = Math.max(H, Math.min(a, r + 50));
|
|
95
95
|
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -100,27 +100,27 @@ function re({ children: D, open: o, onClose: d, onOpen: q, closeLabel: $, positi
|
|
|
100
100
|
]
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ p(
|
|
104
104
|
"aside",
|
|
105
105
|
{
|
|
106
|
-
className: `${t.sidePanel} ${o ? t.open : t.closed} ${
|
|
107
|
-
style: i === "right" ? { width:
|
|
108
|
-
ref:
|
|
106
|
+
className: `${t.sidePanel} ${o ? t.open : t.closed} ${v ? t.opening : ""} ${i === "right" ? t.sidePanelVertical : t.sidePanelHorizontal}`,
|
|
107
|
+
style: i === "right" ? { width: z ? 0 : m, visibility: M ? "hidden" : void 0 } : { height: z ? 0 : m, visibility: M ? "hidden" : void 0 },
|
|
108
|
+
ref: S,
|
|
109
109
|
"aria-hidden": !o,
|
|
110
110
|
onKeyDownCapture: (n) => {
|
|
111
111
|
n.key === "Escape" && (n.stopPropagation(), d == null || d());
|
|
112
112
|
},
|
|
113
113
|
children: [
|
|
114
|
-
(i === "right" || i === "bottom") &&
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
d && /* @__PURE__ */
|
|
117
|
-
|
|
114
|
+
(i === "right" || i === "bottom") && L,
|
|
115
|
+
/* @__PURE__ */ p("div", { className: t.content, children: [
|
|
116
|
+
d && /* @__PURE__ */ u("div", { className: t.closeButton, children: /* @__PURE__ */ u(
|
|
117
|
+
k,
|
|
118
118
|
{
|
|
119
119
|
onClick: d,
|
|
120
120
|
"data-testid": "sidepanel-close-button",
|
|
121
|
-
"aria-label":
|
|
122
|
-
children: /* @__PURE__ */
|
|
123
|
-
|
|
121
|
+
"aria-label": A ?? "Close side panel",
|
|
122
|
+
children: /* @__PURE__ */ u(
|
|
123
|
+
T,
|
|
124
124
|
{
|
|
125
125
|
fontSize: "medium",
|
|
126
126
|
htmlColor: "#444"
|
|
@@ -128,7 +128,7 @@ function re({ children: D, open: o, onClose: d, onOpen: q, closeLabel: $, positi
|
|
|
128
128
|
)
|
|
129
129
|
}
|
|
130
130
|
) }),
|
|
131
|
-
|
|
131
|
+
z || m < b ? null : $
|
|
132
132
|
] })
|
|
133
133
|
]
|
|
134
134
|
}
|