ssovee-os-web-ui 0.1.84 → 0.1.86
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/index.cjs +102 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +34 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React23 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var react = require('@phosphor-icons/react');
|
|
6
6
|
var Editor = require('@monaco-editor/react');
|
|
@@ -26,7 +26,7 @@ function _interopNamespace(e) {
|
|
|
26
26
|
return Object.freeze(n);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var React23__namespace = /*#__PURE__*/_interopNamespace(React23);
|
|
30
30
|
var Editor__default = /*#__PURE__*/_interopDefault(Editor);
|
|
31
31
|
|
|
32
32
|
// src/components/Button.tsx
|
|
@@ -35,7 +35,7 @@ var Editor__default = /*#__PURE__*/_interopDefault(Editor);
|
|
|
35
35
|
function cn(...inputs) {
|
|
36
36
|
return inputs.filter(Boolean).join(" ");
|
|
37
37
|
}
|
|
38
|
-
var Button =
|
|
38
|
+
var Button = React23__namespace.default.forwardRef(
|
|
39
39
|
({
|
|
40
40
|
className,
|
|
41
41
|
variant = "primary",
|
|
@@ -171,7 +171,7 @@ var Typography = ({
|
|
|
171
171
|
return /* @__PURE__ */ jsxRuntime.jsx(Component, { className: classes, children });
|
|
172
172
|
};
|
|
173
173
|
var Typography_default = Typography;
|
|
174
|
-
var Input =
|
|
174
|
+
var Input = React23__namespace.default.forwardRef(
|
|
175
175
|
({
|
|
176
176
|
className,
|
|
177
177
|
variant = "default",
|
|
@@ -249,7 +249,7 @@ var Input = React22__namespace.default.forwardRef(
|
|
|
249
249
|
);
|
|
250
250
|
Input.displayName = "Input";
|
|
251
251
|
var Input_default = Input;
|
|
252
|
-
var TextArea =
|
|
252
|
+
var TextArea = React23__namespace.default.forwardRef(
|
|
253
253
|
({
|
|
254
254
|
className,
|
|
255
255
|
variant = "default",
|
|
@@ -310,17 +310,22 @@ var CodeEditor = ({
|
|
|
310
310
|
value,
|
|
311
311
|
onChange,
|
|
312
312
|
language = "json",
|
|
313
|
-
theme = "light",
|
|
314
313
|
height = "100%",
|
|
315
314
|
options,
|
|
316
|
-
className
|
|
315
|
+
className,
|
|
316
|
+
isDarkTheme
|
|
317
317
|
}) => {
|
|
318
|
+
const editorTheme = React23.useMemo(() => {
|
|
319
|
+
if (typeof isDarkTheme === "undefined") return "light";
|
|
320
|
+
const isDark = Boolean(isDarkTheme);
|
|
321
|
+
return isDark ? "vs-dark" : "light";
|
|
322
|
+
}, [isDarkTheme]);
|
|
318
323
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { height }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
319
324
|
Editor__default.default,
|
|
320
325
|
{
|
|
321
326
|
height: "100%",
|
|
322
327
|
language,
|
|
323
|
-
theme,
|
|
328
|
+
theme: editorTheme,
|
|
324
329
|
value,
|
|
325
330
|
onChange: (nextValue) => onChange(nextValue ?? ""),
|
|
326
331
|
options
|
|
@@ -328,7 +333,7 @@ var CodeEditor = ({
|
|
|
328
333
|
) });
|
|
329
334
|
};
|
|
330
335
|
var CodeEditor_default = CodeEditor;
|
|
331
|
-
var Select =
|
|
336
|
+
var Select = React23__namespace.default.forwardRef(
|
|
332
337
|
({
|
|
333
338
|
className,
|
|
334
339
|
options,
|
|
@@ -408,7 +413,7 @@ var Select = React22__namespace.default.forwardRef(
|
|
|
408
413
|
);
|
|
409
414
|
Select.displayName = "Select";
|
|
410
415
|
var Select_default = Select;
|
|
411
|
-
var Checkbox =
|
|
416
|
+
var Checkbox = React23__namespace.default.forwardRef(
|
|
412
417
|
({
|
|
413
418
|
className,
|
|
414
419
|
variant = "default",
|
|
@@ -483,7 +488,7 @@ var Checkbox = React22__namespace.default.forwardRef(
|
|
|
483
488
|
);
|
|
484
489
|
Checkbox.displayName = "Checkbox";
|
|
485
490
|
var Checkbox_default = Checkbox;
|
|
486
|
-
var Toggle =
|
|
491
|
+
var Toggle = React23__namespace.default.forwardRef(
|
|
487
492
|
({
|
|
488
493
|
checked,
|
|
489
494
|
onChange,
|
|
@@ -589,10 +594,10 @@ var Dropdown = ({
|
|
|
589
594
|
className,
|
|
590
595
|
trigger
|
|
591
596
|
}) => {
|
|
592
|
-
const [isOpen, setIsOpen] =
|
|
593
|
-
const dropdownRef =
|
|
597
|
+
const [isOpen, setIsOpen] = React23.useState(false);
|
|
598
|
+
const dropdownRef = React23.useRef(null);
|
|
594
599
|
const selectedOption = options.find((option) => option.value === value);
|
|
595
|
-
|
|
600
|
+
React23.useEffect(() => {
|
|
596
601
|
const handleClickOutside = (event) => {
|
|
597
602
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
598
603
|
setIsOpen(false);
|
|
@@ -719,9 +724,9 @@ var ImageWithPlaceholder = ({
|
|
|
719
724
|
};
|
|
720
725
|
const resolvedSrc = resolveSrc(src);
|
|
721
726
|
const initialSrc = isValidSrc(resolvedSrc) ? resolvedSrc : fallbackSrc;
|
|
722
|
-
const [imgSrc, setImgSrc] =
|
|
723
|
-
const [hasError, setHasError] =
|
|
724
|
-
|
|
727
|
+
const [imgSrc, setImgSrc] = React23.useState(initialSrc);
|
|
728
|
+
const [hasError, setHasError] = React23.useState(!isValidSrc(resolvedSrc));
|
|
729
|
+
React23.useEffect(() => {
|
|
725
730
|
const nextResolvedSrc = resolveSrc(src);
|
|
726
731
|
if (isValidSrc(nextResolvedSrc)) {
|
|
727
732
|
setImgSrc(nextResolvedSrc);
|
|
@@ -930,8 +935,8 @@ var Toast = ({
|
|
|
930
935
|
showCloseButton = true,
|
|
931
936
|
className
|
|
932
937
|
}) => {
|
|
933
|
-
const [isShowing, setIsShowing] =
|
|
934
|
-
|
|
938
|
+
const [isShowing, setIsShowing] = React23.useState(false);
|
|
939
|
+
React23.useEffect(() => {
|
|
935
940
|
if (isVisible) {
|
|
936
941
|
setIsShowing(true);
|
|
937
942
|
let timer = null;
|
|
@@ -1155,7 +1160,7 @@ var Modal = ({
|
|
|
1155
1160
|
closeOnEscape = true,
|
|
1156
1161
|
className
|
|
1157
1162
|
}) => {
|
|
1158
|
-
|
|
1163
|
+
React23.useEffect(() => {
|
|
1159
1164
|
if (!isOpen) return;
|
|
1160
1165
|
const handleEscape = (e) => {
|
|
1161
1166
|
if (e.key === "Escape" && closeOnEscape) {
|
|
@@ -1222,7 +1227,7 @@ var Modal = ({
|
|
|
1222
1227
|
);
|
|
1223
1228
|
};
|
|
1224
1229
|
var Modal_default = Modal;
|
|
1225
|
-
var Card =
|
|
1230
|
+
var Card = React23__namespace.default.forwardRef(
|
|
1226
1231
|
({
|
|
1227
1232
|
className,
|
|
1228
1233
|
variant = "default",
|
|
@@ -1260,7 +1265,7 @@ var Card = React22__namespace.default.forwardRef(
|
|
|
1260
1265
|
);
|
|
1261
1266
|
Card.displayName = "Card";
|
|
1262
1267
|
var Card_default = Card;
|
|
1263
|
-
var Badge =
|
|
1268
|
+
var Badge = React23__namespace.default.forwardRef(
|
|
1264
1269
|
({
|
|
1265
1270
|
className,
|
|
1266
1271
|
variant = "default",
|
|
@@ -1315,7 +1320,7 @@ var Avatar = ({
|
|
|
1315
1320
|
className,
|
|
1316
1321
|
onClick
|
|
1317
1322
|
}) => {
|
|
1318
|
-
const [imgError, setImgError] =
|
|
1323
|
+
const [imgError, setImgError] = React23.useState(false);
|
|
1319
1324
|
const sizeClasses = {
|
|
1320
1325
|
sm: "w-8 h-8 text-xs",
|
|
1321
1326
|
md: "w-10 h-10 text-sm",
|
|
@@ -1338,7 +1343,7 @@ var Avatar = ({
|
|
|
1338
1343
|
}
|
|
1339
1344
|
) }) });
|
|
1340
1345
|
};
|
|
1341
|
-
const handleImgError =
|
|
1346
|
+
const handleImgError = React23.useCallback(() => {
|
|
1342
1347
|
setImgError(true);
|
|
1343
1348
|
}, []);
|
|
1344
1349
|
const isSrcAvailable = typeof src === "string" && src.trim() !== "";
|
|
@@ -1410,8 +1415,8 @@ var Tooltip = ({
|
|
|
1410
1415
|
delay = 200,
|
|
1411
1416
|
className
|
|
1412
1417
|
}) => {
|
|
1413
|
-
const [isVisible, setIsVisible] =
|
|
1414
|
-
const [timeoutId, setTimeoutId] =
|
|
1418
|
+
const [isVisible, setIsVisible] = React23.useState(false);
|
|
1419
|
+
const [timeoutId, setTimeoutId] = React23.useState(null);
|
|
1415
1420
|
const showTooltip = () => {
|
|
1416
1421
|
const id = setTimeout(() => setIsVisible(true), delay);
|
|
1417
1422
|
setTimeoutId(id);
|
|
@@ -1541,14 +1546,14 @@ var matchShortcut = (event, shortcut, os) => {
|
|
|
1541
1546
|
var useShortcutFormatter = ({
|
|
1542
1547
|
globalKeyboardShortcuts: globalKeyboardShortcuts2 = []
|
|
1543
1548
|
} = {}) => {
|
|
1544
|
-
const [os, setOS] =
|
|
1545
|
-
const listenersRef =
|
|
1549
|
+
const [os, setOS] = React23.useState("windows");
|
|
1550
|
+
const listenersRef = React23.useRef(
|
|
1546
1551
|
/* @__PURE__ */ new Map()
|
|
1547
1552
|
);
|
|
1548
|
-
|
|
1553
|
+
React23.useEffect(() => {
|
|
1549
1554
|
setOS(detectOS());
|
|
1550
1555
|
}, []);
|
|
1551
|
-
|
|
1556
|
+
React23.useEffect(() => {
|
|
1552
1557
|
if (!globalKeyboardShortcuts2.length) return;
|
|
1553
1558
|
const handleKeyDown = (event) => {
|
|
1554
1559
|
for (const shortcut of globalKeyboardShortcuts2) {
|
|
@@ -1566,21 +1571,21 @@ var useShortcutFormatter = ({
|
|
|
1566
1571
|
window.removeEventListener("keydown", handleKeyDown);
|
|
1567
1572
|
};
|
|
1568
1573
|
}, [os, globalKeyboardShortcuts2]);
|
|
1569
|
-
const formatKeys =
|
|
1574
|
+
const formatKeys = React23.useCallback(
|
|
1570
1575
|
(keys = []) => {
|
|
1571
1576
|
const separator = os === "mac" ? "" : " + ";
|
|
1572
1577
|
return keys.map((key) => keyMap[os][key.toLowerCase()] || key.toUpperCase()).join(separator);
|
|
1573
1578
|
},
|
|
1574
1579
|
[os]
|
|
1575
1580
|
);
|
|
1576
|
-
const getShortcutByCommand =
|
|
1581
|
+
const getShortcutByCommand = React23.useCallback(
|
|
1577
1582
|
(command) => {
|
|
1578
1583
|
const found = globalKeyboardShortcuts2.find((s) => s.command === command);
|
|
1579
1584
|
return found ? found.shortcut : [];
|
|
1580
1585
|
},
|
|
1581
1586
|
[globalKeyboardShortcuts2]
|
|
1582
1587
|
);
|
|
1583
|
-
const addShortcutListener =
|
|
1588
|
+
const addShortcutListener = React23.useCallback(
|
|
1584
1589
|
(command, listener) => {
|
|
1585
1590
|
if (!listenersRef.current.has(command)) {
|
|
1586
1591
|
listenersRef.current.set(command, /* @__PURE__ */ new Set());
|
|
@@ -1589,7 +1594,7 @@ var useShortcutFormatter = ({
|
|
|
1589
1594
|
},
|
|
1590
1595
|
[]
|
|
1591
1596
|
);
|
|
1592
|
-
const removeShortcutListener =
|
|
1597
|
+
const removeShortcutListener = React23.useCallback(
|
|
1593
1598
|
(command, listener) => {
|
|
1594
1599
|
if (listenersRef.current.has(command)) {
|
|
1595
1600
|
listenersRef.current.get(command).delete(listener);
|
|
@@ -1629,7 +1634,7 @@ var globalKeyboardShortcuts = [
|
|
|
1629
1634
|
usage: "Focus search"
|
|
1630
1635
|
}
|
|
1631
1636
|
];
|
|
1632
|
-
var SearchInput =
|
|
1637
|
+
var SearchInput = React23__namespace.default.forwardRef(
|
|
1633
1638
|
({
|
|
1634
1639
|
onSearch,
|
|
1635
1640
|
placeholder = "Search...",
|
|
@@ -1644,16 +1649,16 @@ var SearchInput = React22__namespace.default.forwardRef(
|
|
|
1644
1649
|
isActive = true,
|
|
1645
1650
|
...props
|
|
1646
1651
|
}, ref) => {
|
|
1647
|
-
const [searchValue, setSearchValue] =
|
|
1648
|
-
const inputRef =
|
|
1649
|
-
|
|
1652
|
+
const [searchValue, setSearchValue] = React23__namespace.default.useState(value || "");
|
|
1653
|
+
const inputRef = React23.useRef(null);
|
|
1654
|
+
React23.useImperativeHandle(ref, () => inputRef.current);
|
|
1650
1655
|
const {
|
|
1651
1656
|
addShortcutListener,
|
|
1652
1657
|
removeShortcutListener,
|
|
1653
1658
|
formatKeys,
|
|
1654
1659
|
getShortcutByCommand
|
|
1655
1660
|
} = useShortcutFormatter_default({ globalKeyboardShortcuts });
|
|
1656
|
-
|
|
1661
|
+
React23.useEffect(() => {
|
|
1657
1662
|
setSearchValue(value ?? "");
|
|
1658
1663
|
}, [value]);
|
|
1659
1664
|
const handleChange = (e) => {
|
|
@@ -1662,7 +1667,7 @@ var SearchInput = React22__namespace.default.forwardRef(
|
|
|
1662
1667
|
onChange?.(e);
|
|
1663
1668
|
onSearch?.(newValue);
|
|
1664
1669
|
};
|
|
1665
|
-
const handleClear =
|
|
1670
|
+
const handleClear = React23.useCallback(() => {
|
|
1666
1671
|
setSearchValue("");
|
|
1667
1672
|
onSearch?.("");
|
|
1668
1673
|
const syntheticEvent = {
|
|
@@ -1670,7 +1675,7 @@ var SearchInput = React22__namespace.default.forwardRef(
|
|
|
1670
1675
|
};
|
|
1671
1676
|
onChange?.(syntheticEvent);
|
|
1672
1677
|
}, [onChange, onSearch]);
|
|
1673
|
-
|
|
1678
|
+
React23.useEffect(() => {
|
|
1674
1679
|
if (!enableKeyboardShortcuts || !isActive) return;
|
|
1675
1680
|
const handleFocusSearch = (e) => {
|
|
1676
1681
|
e?.preventDefault();
|
|
@@ -1823,8 +1828,8 @@ var FileUpload = ({
|
|
|
1823
1828
|
children,
|
|
1824
1829
|
dragAndDrop = false
|
|
1825
1830
|
}) => {
|
|
1826
|
-
const fileInputRef =
|
|
1827
|
-
const [isDragOver, setIsDragOver] =
|
|
1831
|
+
const fileInputRef = React23.useRef(null);
|
|
1832
|
+
const [isDragOver, setIsDragOver] = React23__namespace.default.useState(false);
|
|
1828
1833
|
const handleFileSelect = (files) => {
|
|
1829
1834
|
if (!files) return;
|
|
1830
1835
|
const fileArray = Array.from(files);
|
|
@@ -2122,7 +2127,7 @@ var Pagination = ({
|
|
|
2122
2127
|
] });
|
|
2123
2128
|
};
|
|
2124
2129
|
var Pagination_default = Pagination;
|
|
2125
|
-
var Radio =
|
|
2130
|
+
var Radio = React23__namespace.default.forwardRef(
|
|
2126
2131
|
({
|
|
2127
2132
|
className,
|
|
2128
2133
|
label,
|
|
@@ -2187,7 +2192,7 @@ var Radio = React22__namespace.default.forwardRef(
|
|
|
2187
2192
|
Radio.displayName = "Radio";
|
|
2188
2193
|
var Radio_default = Radio;
|
|
2189
2194
|
var Accordion = ({ items, active = -1 }) => {
|
|
2190
|
-
const [activeIndex, setActiveIndex] =
|
|
2195
|
+
const [activeIndex, setActiveIndex] = React23.useState(active);
|
|
2191
2196
|
const toggleAccordion = (index) => {
|
|
2192
2197
|
setActiveIndex(activeIndex === index ? null : index);
|
|
2193
2198
|
};
|
|
@@ -2228,8 +2233,8 @@ var Tabs = ({
|
|
|
2228
2233
|
buttonClassName = "flex items-center gap-1 px-[8px] py-[2px] text-[13px] cursor-pointer transition-all duration-300 text-neutral-300 rounded-[6px] m-[8px]",
|
|
2229
2234
|
activeButtonClassName = "bg-surface-3 text-neutral-400"
|
|
2230
2235
|
}) => {
|
|
2231
|
-
const [activeTab, setActiveTab] =
|
|
2232
|
-
|
|
2236
|
+
const [activeTab, setActiveTab] = React23.useState(defaultActiveTab);
|
|
2237
|
+
React23.useEffect(() => {
|
|
2233
2238
|
setActiveTab(defaultActiveTab);
|
|
2234
2239
|
}, [defaultActiveTab]);
|
|
2235
2240
|
const handleTabClick = (index) => {
|
|
@@ -2268,11 +2273,11 @@ function renderPluginChild(child, app, api, reloadKey) {
|
|
|
2268
2273
|
const renderFn = child;
|
|
2269
2274
|
return renderFn({ app, api });
|
|
2270
2275
|
}
|
|
2271
|
-
return
|
|
2272
|
-
if (!
|
|
2276
|
+
return React23.Children.map(child, (node, index) => {
|
|
2277
|
+
if (!React23.isValidElement(node)) {
|
|
2273
2278
|
return node;
|
|
2274
2279
|
}
|
|
2275
|
-
return
|
|
2280
|
+
return React23.cloneElement(
|
|
2276
2281
|
node,
|
|
2277
2282
|
{
|
|
2278
2283
|
key: `${reloadKey}-${index}`,
|
|
@@ -2304,20 +2309,20 @@ function PluginPlayground({
|
|
|
2304
2309
|
onClose,
|
|
2305
2310
|
onMinimize
|
|
2306
2311
|
}) {
|
|
2307
|
-
const [mockUser] =
|
|
2308
|
-
const [mockToken] =
|
|
2309
|
-
const [isMinimized, setIsMinimized] =
|
|
2310
|
-
const [isClosed, setIsClosed] =
|
|
2311
|
-
const [isActive, setIsActive] =
|
|
2312
|
-
const [isNightMode, setIsNightMode] =
|
|
2313
|
-
|
|
2312
|
+
const [mockUser] = React23.useState(DEFAULT_MOCK_USER);
|
|
2313
|
+
const [mockToken] = React23.useState(DEFAULT_TOKEN);
|
|
2314
|
+
const [isMinimized, setIsMinimized] = React23.useState(false);
|
|
2315
|
+
const [isClosed, setIsClosed] = React23.useState(false);
|
|
2316
|
+
const [isActive, setIsActive] = React23.useState(true);
|
|
2317
|
+
const [isNightMode, setIsNightMode] = React23.useState(true);
|
|
2318
|
+
React23.useEffect(() => {
|
|
2314
2319
|
if (typeof window === "undefined") return;
|
|
2315
2320
|
const storedTheme = window.localStorage.getItem("plugin-playground-theme");
|
|
2316
2321
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
2317
2322
|
const shouldUseDark = storedTheme ? storedTheme === "dark" : prefersDark;
|
|
2318
2323
|
setIsNightMode(shouldUseDark);
|
|
2319
2324
|
}, []);
|
|
2320
|
-
|
|
2325
|
+
React23.useEffect(() => {
|
|
2321
2326
|
if (typeof document === "undefined") return;
|
|
2322
2327
|
document.documentElement.classList.toggle("dark", isNightMode);
|
|
2323
2328
|
window.localStorage.setItem(
|
|
@@ -2327,28 +2332,28 @@ function PluginPlayground({
|
|
|
2327
2332
|
}, [isNightMode]);
|
|
2328
2333
|
const title = metadata.title ?? metadata.name ?? "Plugin Playground";
|
|
2329
2334
|
const slug = metadata.slug ?? "local-plugin";
|
|
2330
|
-
const defaultSize =
|
|
2335
|
+
const defaultSize = React23.useMemo(() => getDefaultSize(metadata), [metadata]);
|
|
2331
2336
|
const canvasBackground = backgroundImage ?? metadata.backgroundImage ?? DEFAULT_BACKGROUND;
|
|
2332
2337
|
const isWindowResizable = metadata.windowSize?.isAppWindowResizing ?? metadata.isResizing ?? true;
|
|
2333
|
-
const minimizeWindow =
|
|
2338
|
+
const minimizeWindow = React23.useCallback(() => {
|
|
2334
2339
|
setIsActive(false);
|
|
2335
2340
|
setIsMinimized(true);
|
|
2336
2341
|
setIsClosed(false);
|
|
2337
2342
|
onMinimize?.(true);
|
|
2338
2343
|
}, [onMinimize]);
|
|
2339
|
-
const closeWindow =
|
|
2344
|
+
const closeWindow = React23.useCallback(() => {
|
|
2340
2345
|
setIsActive(false);
|
|
2341
2346
|
setIsClosed(true);
|
|
2342
2347
|
setIsMinimized(false);
|
|
2343
2348
|
onClose?.();
|
|
2344
2349
|
}, [onClose]);
|
|
2345
|
-
const restoreWindow =
|
|
2350
|
+
const restoreWindow = React23.useCallback(() => {
|
|
2346
2351
|
setIsActive(true);
|
|
2347
2352
|
setIsClosed(false);
|
|
2348
2353
|
setIsMinimized(false);
|
|
2349
2354
|
onMinimize?.(false);
|
|
2350
2355
|
}, [onMinimize]);
|
|
2351
|
-
const mockApi =
|
|
2356
|
+
const mockApi = React23.useMemo(
|
|
2352
2357
|
() => ({
|
|
2353
2358
|
showToast: (message, type) => {
|
|
2354
2359
|
console.info(`[playground:${type}] ${message}`);
|
|
@@ -2361,11 +2366,12 @@ function PluginPlayground({
|
|
|
2361
2366
|
},
|
|
2362
2367
|
getToken: async () => {
|
|
2363
2368
|
return mockToken;
|
|
2364
|
-
}
|
|
2369
|
+
},
|
|
2370
|
+
isDarkTheme: true
|
|
2365
2371
|
}),
|
|
2366
2372
|
[mockToken, mockUser]
|
|
2367
2373
|
);
|
|
2368
|
-
const appProps =
|
|
2374
|
+
const appProps = React23.useMemo(
|
|
2369
2375
|
() => ({
|
|
2370
2376
|
name: title,
|
|
2371
2377
|
slug,
|
|
@@ -2535,13 +2541,13 @@ var WindowWithSideMenu = ({
|
|
|
2535
2541
|
removeShortcutListener,
|
|
2536
2542
|
getShortcutByCommand
|
|
2537
2543
|
} = useShortcutFormatter_default({ globalKeyboardShortcuts });
|
|
2538
|
-
const [state, dispatch] =
|
|
2544
|
+
const [state, dispatch] = React23.useReducer(reducer, {
|
|
2539
2545
|
...initialState,
|
|
2540
2546
|
windowSize: app.windowSize.windowSize ?? defaultSize,
|
|
2541
2547
|
defaultSize: app.windowSize.windowSize ?? defaultSize
|
|
2542
2548
|
});
|
|
2543
|
-
const windowRef =
|
|
2544
|
-
|
|
2549
|
+
const windowRef = React23.useRef(null);
|
|
2550
|
+
React23.useEffect(() => {
|
|
2545
2551
|
if (app.isMinimize !== state.isMinimized) {
|
|
2546
2552
|
dispatch({ type: "SYNC_MINIMIZE_STATE", payload: app.isMinimize });
|
|
2547
2553
|
}
|
|
@@ -2602,7 +2608,7 @@ var WindowWithSideMenu = ({
|
|
|
2602
2608
|
document.body.style.userSelect = "none";
|
|
2603
2609
|
dispatch({ type: "START_RESIZE", payload: { x: e.clientX, y: e.clientY } });
|
|
2604
2610
|
};
|
|
2605
|
-
|
|
2611
|
+
React23.useEffect(() => {
|
|
2606
2612
|
if (state.isDragging || state.resizeStart) {
|
|
2607
2613
|
window.addEventListener("mousemove", handleMouseMove);
|
|
2608
2614
|
window.addEventListener("mouseup", handleMouseUp);
|
|
@@ -2613,7 +2619,7 @@ var WindowWithSideMenu = ({
|
|
|
2613
2619
|
document.body.style.userSelect = "";
|
|
2614
2620
|
};
|
|
2615
2621
|
}, [state.isDragging, state.resizeStart]);
|
|
2616
|
-
|
|
2622
|
+
React23.useEffect(() => {
|
|
2617
2623
|
if (windowRef.current) {
|
|
2618
2624
|
windowRef.current.addEventListener("click", () => {
|
|
2619
2625
|
if (app?.callback) {
|
|
@@ -2622,7 +2628,7 @@ var WindowWithSideMenu = ({
|
|
|
2622
2628
|
});
|
|
2623
2629
|
}
|
|
2624
2630
|
}, [app?.slug, windowRef]);
|
|
2625
|
-
|
|
2631
|
+
React23.useEffect(() => {
|
|
2626
2632
|
const handleExitApp = () => {
|
|
2627
2633
|
if (app?.callback) {
|
|
2628
2634
|
app?.callback("CLOSE_APP");
|
|
@@ -2633,7 +2639,7 @@ var WindowWithSideMenu = ({
|
|
|
2633
2639
|
removeShortcutListener("exit_app", handleExitApp);
|
|
2634
2640
|
};
|
|
2635
2641
|
}, [app?.slug, app.isActive]);
|
|
2636
|
-
|
|
2642
|
+
React23.useEffect(() => {
|
|
2637
2643
|
const handleMinimize = () => {
|
|
2638
2644
|
if (app?.slug && app.isActive) {
|
|
2639
2645
|
dispatch({
|
|
@@ -2650,7 +2656,7 @@ var WindowWithSideMenu = ({
|
|
|
2650
2656
|
removeShortcutListener("minimize_app", handleMinimize);
|
|
2651
2657
|
};
|
|
2652
2658
|
}, [app?.slug, app.isActive, state.isMinimized, state.windowSize]);
|
|
2653
|
-
|
|
2659
|
+
React23.useEffect(() => {
|
|
2654
2660
|
const handleMaximize = () => {
|
|
2655
2661
|
if (app?.slug && app.isActive) {
|
|
2656
2662
|
dispatch({
|
|
@@ -2821,7 +2827,7 @@ var WindowWithSideMenu = ({
|
|
|
2821
2827
|
style: {
|
|
2822
2828
|
maxHeight: `${state.windowSize.height - 37}px`
|
|
2823
2829
|
},
|
|
2824
|
-
children:
|
|
2830
|
+
children: React23.isValidElement(children) && typeof children.type !== "string" ? React23__namespace.default.cloneElement(children, {
|
|
2825
2831
|
windowSize: state.windowSize,
|
|
2826
2832
|
isAppWindowResizing: state.resizeStart !== null
|
|
2827
2833
|
}) : children
|
|
@@ -2927,13 +2933,13 @@ var WindowWithoutSideMenu = ({
|
|
|
2927
2933
|
removeShortcutListener,
|
|
2928
2934
|
getShortcutByCommand
|
|
2929
2935
|
} = useShortcutFormatter_default({ globalKeyboardShortcuts });
|
|
2930
|
-
const [state, dispatch] =
|
|
2936
|
+
const [state, dispatch] = React23.useReducer(reducer2, {
|
|
2931
2937
|
...initialState2,
|
|
2932
2938
|
windowSize: app.windowSize.windowSize ?? defaultSize,
|
|
2933
2939
|
defaultSize: app.windowSize.windowSize ?? defaultSize
|
|
2934
2940
|
});
|
|
2935
|
-
const windowRef =
|
|
2936
|
-
|
|
2941
|
+
const windowRef = React23.useRef(null);
|
|
2942
|
+
React23.useEffect(() => {
|
|
2937
2943
|
if (app.isMinimize !== state.isMinimized) {
|
|
2938
2944
|
dispatch({ type: "SYNC_MINIMIZE_STATE", payload: app.isMinimize });
|
|
2939
2945
|
}
|
|
@@ -2990,7 +2996,7 @@ var WindowWithoutSideMenu = ({
|
|
|
2990
2996
|
document.body.style.userSelect = "none";
|
|
2991
2997
|
dispatch({ type: "START_RESIZE", payload: { x: e.clientX, y: e.clientY } });
|
|
2992
2998
|
};
|
|
2993
|
-
|
|
2999
|
+
React23.useEffect(() => {
|
|
2994
3000
|
if (state.isDragging || state.resizeStart) {
|
|
2995
3001
|
window.addEventListener("mousemove", handleMouseMove);
|
|
2996
3002
|
window.addEventListener("mouseup", handleMouseUp);
|
|
@@ -3001,7 +3007,7 @@ var WindowWithoutSideMenu = ({
|
|
|
3001
3007
|
document.body.style.userSelect = "";
|
|
3002
3008
|
};
|
|
3003
3009
|
}, [state.isDragging, state.resizeStart]);
|
|
3004
|
-
|
|
3010
|
+
React23.useEffect(() => {
|
|
3005
3011
|
if (windowRef.current) {
|
|
3006
3012
|
windowRef.current.addEventListener("click", () => {
|
|
3007
3013
|
if (app?.callback) {
|
|
@@ -3010,7 +3016,7 @@ var WindowWithoutSideMenu = ({
|
|
|
3010
3016
|
});
|
|
3011
3017
|
}
|
|
3012
3018
|
}, [app?.slug, windowRef]);
|
|
3013
|
-
|
|
3019
|
+
React23.useEffect(() => {
|
|
3014
3020
|
const handleExitApp = () => {
|
|
3015
3021
|
if (app?.callback) {
|
|
3016
3022
|
app?.callback("CLOSE_APP");
|
|
@@ -3021,7 +3027,7 @@ var WindowWithoutSideMenu = ({
|
|
|
3021
3027
|
removeShortcutListener("exit_app", handleExitApp);
|
|
3022
3028
|
};
|
|
3023
3029
|
}, [app?.slug, app.isActive]);
|
|
3024
|
-
|
|
3030
|
+
React23.useEffect(() => {
|
|
3025
3031
|
const handleMinimize = () => {
|
|
3026
3032
|
if (app?.slug && app.isActive) {
|
|
3027
3033
|
dispatch({
|
|
@@ -3038,7 +3044,7 @@ var WindowWithoutSideMenu = ({
|
|
|
3038
3044
|
removeShortcutListener("minimize_app", handleMinimize);
|
|
3039
3045
|
};
|
|
3040
3046
|
}, [app?.slug, app.isActive, state.isMinimized, state.windowSize]);
|
|
3041
|
-
|
|
3047
|
+
React23.useEffect(() => {
|
|
3042
3048
|
const handleMaximize = () => {
|
|
3043
3049
|
if (app?.slug && app.isActive) {
|
|
3044
3050
|
dispatch({
|
|
@@ -3154,7 +3160,7 @@ var WindowWithoutSideMenu = ({
|
|
|
3154
3160
|
style: {
|
|
3155
3161
|
maxHeight: `${state.windowSize.height - 37}px`
|
|
3156
3162
|
},
|
|
3157
|
-
children:
|
|
3163
|
+
children: React23.isValidElement(children) && typeof children.type !== "string" ? React23__namespace.default.cloneElement(children, {
|
|
3158
3164
|
windowSize: state.windowSize,
|
|
3159
3165
|
isAppWindowResizing: state.resizeStart !== null
|
|
3160
3166
|
}) : children
|
|
@@ -3177,7 +3183,7 @@ var WindowWithoutSideMenu = ({
|
|
|
3177
3183
|
);
|
|
3178
3184
|
};
|
|
3179
3185
|
var WindowWithoutSideMenu_default = WindowWithoutSideMenu;
|
|
3180
|
-
var Table =
|
|
3186
|
+
var Table = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3181
3187
|
"table",
|
|
3182
3188
|
{
|
|
3183
3189
|
ref,
|
|
@@ -3186,9 +3192,9 @@ var Table = React22__namespace.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
3186
3192
|
}
|
|
3187
3193
|
) }));
|
|
3188
3194
|
Table.displayName = "Table";
|
|
3189
|
-
var TableHeader =
|
|
3195
|
+
var TableHeader = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b text-neutral-400 bg-surface-2", className), ...props }));
|
|
3190
3196
|
TableHeader.displayName = "TableHeader";
|
|
3191
|
-
var TableBody =
|
|
3197
|
+
var TableBody = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3192
3198
|
"tbody",
|
|
3193
3199
|
{
|
|
3194
3200
|
ref,
|
|
@@ -3197,7 +3203,7 @@ var TableBody = React22__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
3197
3203
|
}
|
|
3198
3204
|
));
|
|
3199
3205
|
TableBody.displayName = "TableBody";
|
|
3200
|
-
var TableFooter =
|
|
3206
|
+
var TableFooter = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3201
3207
|
"tfoot",
|
|
3202
3208
|
{
|
|
3203
3209
|
ref,
|
|
@@ -3209,7 +3215,7 @@ var TableFooter = React22__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
3209
3215
|
}
|
|
3210
3216
|
));
|
|
3211
3217
|
TableFooter.displayName = "TableFooter";
|
|
3212
|
-
var TableRow =
|
|
3218
|
+
var TableRow = React23__namespace.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
3213
3219
|
const isInteractive = typeof onClick === "function";
|
|
3214
3220
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3215
3221
|
"tr",
|
|
@@ -3226,7 +3232,7 @@ var TableRow = React22__namespace.forwardRef(({ className, onClick, ...props },
|
|
|
3226
3232
|
);
|
|
3227
3233
|
});
|
|
3228
3234
|
TableRow.displayName = "TableRow";
|
|
3229
|
-
var TableHead =
|
|
3235
|
+
var TableHead = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3230
3236
|
"th",
|
|
3231
3237
|
{
|
|
3232
3238
|
ref,
|
|
@@ -3238,7 +3244,7 @@ var TableHead = React22__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
3238
3244
|
}
|
|
3239
3245
|
));
|
|
3240
3246
|
TableHead.displayName = "TableHead";
|
|
3241
|
-
var TableCell =
|
|
3247
|
+
var TableCell = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3242
3248
|
"td",
|
|
3243
3249
|
{
|
|
3244
3250
|
ref,
|
|
@@ -3247,7 +3253,7 @@ var TableCell = React22__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
3247
3253
|
}
|
|
3248
3254
|
));
|
|
3249
3255
|
TableCell.displayName = "TableCell";
|
|
3250
|
-
var TableCaption =
|
|
3256
|
+
var TableCaption = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3251
3257
|
"caption",
|
|
3252
3258
|
{
|
|
3253
3259
|
ref,
|
|
@@ -3257,12 +3263,12 @@ var TableCaption = React22__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
3257
3263
|
));
|
|
3258
3264
|
TableCaption.displayName = "TableCaption";
|
|
3259
3265
|
var useGridClasses = (windowSize, gridRules) => {
|
|
3260
|
-
const deviceType =
|
|
3266
|
+
const deviceType = React23.useMemo(() => {
|
|
3261
3267
|
if (windowSize.width <= 640) return "mobile";
|
|
3262
3268
|
if (windowSize.width <= 1024) return "tablet";
|
|
3263
3269
|
return "desktop";
|
|
3264
3270
|
}, [windowSize]);
|
|
3265
|
-
const gridClasses =
|
|
3271
|
+
const gridClasses = React23.useMemo(() => {
|
|
3266
3272
|
const classes = {};
|
|
3267
3273
|
for (const element in gridRules) {
|
|
3268
3274
|
const classRules = gridRules[element] ?? {};
|
|
@@ -3275,8 +3281,8 @@ var useGridClasses = (windowSize, gridRules) => {
|
|
|
3275
3281
|
};
|
|
3276
3282
|
var useGridClasses_default = useGridClasses;
|
|
3277
3283
|
var useDeviceSupport = () => {
|
|
3278
|
-
const [isSupported, setIsSupported] =
|
|
3279
|
-
|
|
3284
|
+
const [isSupported, setIsSupported] = React23.useState(true);
|
|
3285
|
+
React23.useEffect(() => {
|
|
3280
3286
|
function checkSupport() {
|
|
3281
3287
|
const ua = typeof window !== "undefined" ? window.navigator.userAgent : "";
|
|
3282
3288
|
const width = typeof window !== "undefined" ? window.innerWidth : 1920;
|
|
@@ -3402,7 +3408,7 @@ var useSound = () => {
|
|
|
3402
3408
|
audio.currentTime = 0;
|
|
3403
3409
|
await audio.play();
|
|
3404
3410
|
};
|
|
3405
|
-
const playSound =
|
|
3411
|
+
const playSound = React23.useCallback((type) => {
|
|
3406
3412
|
if (typeof window === "undefined") {
|
|
3407
3413
|
return;
|
|
3408
3414
|
}
|