@serhii.olishevskyi/docs 1.0.5 → 1.0.6
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/{UserPopoverComponent-JBJBONYL.mjs → UserPopoverComponent-MG2V632M.mjs} +1 -1
- package/dist/{chunk-R2QQMMHL.mjs → chunk-UYCEKHKQ.mjs} +148 -82
- package/dist/index.d.mts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +187 -110
- package/dist/index.mjs +6 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/UI/components/data.display/UserPopoverComponent.tsx
|
|
2
|
-
import { useEffect as
|
|
2
|
+
import { useEffect as useEffect9, useState as useState13 } from "react";
|
|
3
3
|
import {
|
|
4
4
|
Popover,
|
|
5
5
|
Box as Box4,
|
|
@@ -1389,9 +1389,73 @@ var useConfirmation = () => {
|
|
|
1389
1389
|
return context.confirm;
|
|
1390
1390
|
};
|
|
1391
1391
|
|
|
1392
|
+
// src/context/AppSettingsProvider.tsx
|
|
1393
|
+
import { createContext as createContext11, useContext as useContext11, useEffect as useEffect7, useState as useState10, useCallback as useCallback5 } from "react";
|
|
1394
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1395
|
+
var DEFAULT_SETTINGS = {
|
|
1396
|
+
max_group_members: 100
|
|
1397
|
+
};
|
|
1398
|
+
var AppSettingsContext = createContext11(void 0);
|
|
1399
|
+
var AppSettingsProvider = ({ children }) => {
|
|
1400
|
+
const supabase = useSupabase();
|
|
1401
|
+
const [settings, setSettings] = useState10(DEFAULT_SETTINGS);
|
|
1402
|
+
const [loading, setLoading] = useState10(true);
|
|
1403
|
+
const [error, setError] = useState10(null);
|
|
1404
|
+
const fetchSettings = useCallback5(async () => {
|
|
1405
|
+
try {
|
|
1406
|
+
setLoading(true);
|
|
1407
|
+
setError(null);
|
|
1408
|
+
const { data, error: supabaseError } = await supabase.from("app_settings").select("key, value");
|
|
1409
|
+
if (supabaseError) throw supabaseError;
|
|
1410
|
+
if (data) {
|
|
1411
|
+
const parsedSettings = data.reduce((acc, item) => {
|
|
1412
|
+
acc[item.key] = item.value;
|
|
1413
|
+
return acc;
|
|
1414
|
+
}, { ...DEFAULT_SETTINGS });
|
|
1415
|
+
setSettings(parsedSettings);
|
|
1416
|
+
}
|
|
1417
|
+
} catch (err) {
|
|
1418
|
+
console.error("\u041E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u044B\u0445 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A:", err.message || err);
|
|
1419
|
+
setError(err.message || "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F");
|
|
1420
|
+
} finally {
|
|
1421
|
+
setLoading(false);
|
|
1422
|
+
}
|
|
1423
|
+
}, []);
|
|
1424
|
+
useEffect7(() => {
|
|
1425
|
+
fetchSettings();
|
|
1426
|
+
}, [fetchSettings]);
|
|
1427
|
+
const getSetting = useCallback5((key, defaultValue) => {
|
|
1428
|
+
if (key in settings && settings[key] !== null && settings[key] !== void 0) {
|
|
1429
|
+
return settings[key];
|
|
1430
|
+
}
|
|
1431
|
+
return defaultValue;
|
|
1432
|
+
}, [settings]);
|
|
1433
|
+
return /* @__PURE__ */ jsx13(
|
|
1434
|
+
AppSettingsContext.Provider,
|
|
1435
|
+
{
|
|
1436
|
+
value: {
|
|
1437
|
+
settings,
|
|
1438
|
+
loading,
|
|
1439
|
+
error,
|
|
1440
|
+
getSetting,
|
|
1441
|
+
refetchSettings: fetchSettings
|
|
1442
|
+
},
|
|
1443
|
+
children
|
|
1444
|
+
}
|
|
1445
|
+
);
|
|
1446
|
+
};
|
|
1447
|
+
var useAppSettings = () => {
|
|
1448
|
+
const context = useContext11(AppSettingsContext);
|
|
1449
|
+
if (!context) {
|
|
1450
|
+
throw new Error("useAppSettings should be used within the AppSettingsProvider");
|
|
1451
|
+
}
|
|
1452
|
+
return context;
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1392
1455
|
// src/context/index.ts
|
|
1393
1456
|
var Providers = {
|
|
1394
1457
|
Supabase: SupabaseProvider,
|
|
1458
|
+
AppSettings: AppSettingsProvider,
|
|
1395
1459
|
Translate: TranslateProvider,
|
|
1396
1460
|
TranslationEdit: TranslationEditProvider,
|
|
1397
1461
|
Localization: LocalizationProvider,
|
|
@@ -1403,26 +1467,26 @@ var Providers = {
|
|
|
1403
1467
|
};
|
|
1404
1468
|
|
|
1405
1469
|
// src/UI/components/data.display/UserStatusChipComponent.tsx
|
|
1406
|
-
import { jsx as
|
|
1470
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1407
1471
|
var UserStatusChipComponent = ({ overrideNamespace, state }) => {
|
|
1408
1472
|
const confirm = useConfirmation();
|
|
1409
1473
|
const handleShowReason = async (e) => {
|
|
1410
1474
|
e.stopPropagation();
|
|
1411
1475
|
if (!state.locked_reason) return;
|
|
1412
1476
|
await confirm({
|
|
1413
|
-
title: /* @__PURE__ */
|
|
1477
|
+
title: /* @__PURE__ */ jsx14(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Lock Reason" }),
|
|
1414
1478
|
message: state.locked_reason,
|
|
1415
1479
|
type: "info",
|
|
1416
|
-
confirmText: /* @__PURE__ */
|
|
1480
|
+
confirmText: /* @__PURE__ */ jsx14(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "OK" }),
|
|
1417
1481
|
showNoButton: false,
|
|
1418
1482
|
showCancelButton: false
|
|
1419
1483
|
});
|
|
1420
1484
|
};
|
|
1421
1485
|
if (state.profile_archived) {
|
|
1422
|
-
return /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ jsx14(
|
|
1423
1487
|
Chip,
|
|
1424
1488
|
{
|
|
1425
|
-
label: /* @__PURE__ */
|
|
1489
|
+
label: /* @__PURE__ */ jsx14(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Archived" }),
|
|
1426
1490
|
color: "default",
|
|
1427
1491
|
size: "small",
|
|
1428
1492
|
variant: "filled"
|
|
@@ -1430,10 +1494,10 @@ var UserStatusChipComponent = ({ overrideNamespace, state }) => {
|
|
|
1430
1494
|
);
|
|
1431
1495
|
}
|
|
1432
1496
|
if (state.profile_locked) {
|
|
1433
|
-
return /* @__PURE__ */
|
|
1497
|
+
return /* @__PURE__ */ jsx14(
|
|
1434
1498
|
Chip,
|
|
1435
1499
|
{
|
|
1436
|
-
label: /* @__PURE__ */
|
|
1500
|
+
label: /* @__PURE__ */ jsx14(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "System Locked" }),
|
|
1437
1501
|
color: "error",
|
|
1438
1502
|
size: "small",
|
|
1439
1503
|
variant: "filled"
|
|
@@ -1441,30 +1505,30 @@ var UserStatusChipComponent = ({ overrideNamespace, state }) => {
|
|
|
1441
1505
|
);
|
|
1442
1506
|
}
|
|
1443
1507
|
if (state.excluded) {
|
|
1444
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ jsx14(
|
|
1445
1509
|
Chip,
|
|
1446
1510
|
{
|
|
1447
|
-
label: /* @__PURE__ */
|
|
1511
|
+
label: /* @__PURE__ */ jsx14(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Excluded" }),
|
|
1448
1512
|
size: "small"
|
|
1449
1513
|
}
|
|
1450
1514
|
);
|
|
1451
1515
|
}
|
|
1452
1516
|
if (state.locked) {
|
|
1453
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ jsx14(
|
|
1454
1518
|
Chip,
|
|
1455
1519
|
{
|
|
1456
|
-
label: /* @__PURE__ */
|
|
1520
|
+
label: /* @__PURE__ */ jsx14(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Locked" }),
|
|
1457
1521
|
color: "error",
|
|
1458
1522
|
size: "small",
|
|
1459
1523
|
onDelete: state.locked_reason ? handleShowReason : void 0,
|
|
1460
|
-
deleteIcon: state.locked_reason ? /* @__PURE__ */
|
|
1524
|
+
deleteIcon: state.locked_reason ? /* @__PURE__ */ jsx14(IconButton2, { size: "small", component: "span", sx: { p: 0.2 }, children: /* @__PURE__ */ jsx14(InfoOutlinedIcon, { fontSize: "small" }) }) : void 0
|
|
1461
1525
|
}
|
|
1462
1526
|
);
|
|
1463
1527
|
}
|
|
1464
|
-
return /* @__PURE__ */
|
|
1528
|
+
return /* @__PURE__ */ jsx14(
|
|
1465
1529
|
Chip,
|
|
1466
1530
|
{
|
|
1467
|
-
label: /* @__PURE__ */
|
|
1531
|
+
label: /* @__PURE__ */ jsx14(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Active" }),
|
|
1468
1532
|
color: "success",
|
|
1469
1533
|
size: "small",
|
|
1470
1534
|
variant: "outlined"
|
|
@@ -1474,32 +1538,32 @@ var UserStatusChipComponent = ({ overrideNamespace, state }) => {
|
|
|
1474
1538
|
|
|
1475
1539
|
// src/UI/components/data.display/UserRoleChipComponent.tsx
|
|
1476
1540
|
import { Chip as Chip2 } from "@mui/material";
|
|
1477
|
-
import { jsx as
|
|
1541
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1478
1542
|
var UserRoleChipComponent = ({ overrideNamespace, role }) => {
|
|
1479
1543
|
switch (role) {
|
|
1480
1544
|
case "superadmin":
|
|
1481
|
-
return /* @__PURE__ */
|
|
1545
|
+
return /* @__PURE__ */ jsx15(
|
|
1482
1546
|
Chip2,
|
|
1483
1547
|
{
|
|
1484
|
-
label: /* @__PURE__ */
|
|
1548
|
+
label: /* @__PURE__ */ jsx15(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Superadministrator" }),
|
|
1485
1549
|
color: "error",
|
|
1486
1550
|
size: "small"
|
|
1487
1551
|
}
|
|
1488
1552
|
);
|
|
1489
1553
|
case "admin":
|
|
1490
|
-
return /* @__PURE__ */
|
|
1554
|
+
return /* @__PURE__ */ jsx15(
|
|
1491
1555
|
Chip2,
|
|
1492
1556
|
{
|
|
1493
|
-
label: /* @__PURE__ */
|
|
1557
|
+
label: /* @__PURE__ */ jsx15(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "Administrator" }),
|
|
1494
1558
|
color: "primary",
|
|
1495
1559
|
size: "small"
|
|
1496
1560
|
}
|
|
1497
1561
|
);
|
|
1498
1562
|
default:
|
|
1499
|
-
return /* @__PURE__ */
|
|
1563
|
+
return /* @__PURE__ */ jsx15(
|
|
1500
1564
|
Chip2,
|
|
1501
1565
|
{
|
|
1502
|
-
label: /* @__PURE__ */
|
|
1566
|
+
label: /* @__PURE__ */ jsx15(TranslateText, { overrideNamespace: overrideNamespace || "system_widgets", children: "User" }),
|
|
1503
1567
|
variant: "outlined",
|
|
1504
1568
|
size: "small"
|
|
1505
1569
|
}
|
|
@@ -1508,14 +1572,14 @@ var UserRoleChipComponent = ({ overrideNamespace, role }) => {
|
|
|
1508
1572
|
};
|
|
1509
1573
|
|
|
1510
1574
|
// src/UI/components/buttons/CopyClipboardButtonComponent.tsx
|
|
1511
|
-
import { useState as
|
|
1575
|
+
import { useState as useState11 } from "react";
|
|
1512
1576
|
import { IconButton as IconButton3 } from "@mui/material";
|
|
1513
1577
|
import CheckIcon from "@mui/icons-material/Check";
|
|
1514
1578
|
import CopyIcon from "@mui/icons-material/ContentCopy";
|
|
1515
1579
|
|
|
1516
1580
|
// src/UI/components/data.display/TranslatableTooltipComponent.tsx
|
|
1517
1581
|
import { Tooltip as Tooltip2 } from "@mui/material";
|
|
1518
|
-
import { jsx as
|
|
1582
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1519
1583
|
var TranslatableTooltipComponent = ({
|
|
1520
1584
|
overrideNamespace,
|
|
1521
1585
|
title,
|
|
@@ -1524,10 +1588,10 @@ var TranslatableTooltipComponent = ({
|
|
|
1524
1588
|
...props
|
|
1525
1589
|
}) => {
|
|
1526
1590
|
const { isTranslationMode } = useTranslationEdit();
|
|
1527
|
-
return /* @__PURE__ */
|
|
1591
|
+
return /* @__PURE__ */ jsx16(
|
|
1528
1592
|
Tooltip2,
|
|
1529
1593
|
{
|
|
1530
|
-
title: typeof title === "string" ? /* @__PURE__ */
|
|
1594
|
+
title: typeof title === "string" ? /* @__PURE__ */ jsx16(TranslateText, { overrideNamespace, children: title }) : title,
|
|
1531
1595
|
slotProps: {
|
|
1532
1596
|
popper: {
|
|
1533
1597
|
sx: isTranslationMode ? {
|
|
@@ -1541,13 +1605,13 @@ var TranslatableTooltipComponent = ({
|
|
|
1541
1605
|
},
|
|
1542
1606
|
leaveDelay: isTranslationMode ? 1e3 : 100,
|
|
1543
1607
|
...props,
|
|
1544
|
-
children: disableSpan ? children : /* @__PURE__ */
|
|
1608
|
+
children: disableSpan ? children : /* @__PURE__ */ jsx16("span", { children })
|
|
1545
1609
|
}
|
|
1546
1610
|
);
|
|
1547
1611
|
};
|
|
1548
1612
|
|
|
1549
1613
|
// src/UI/components/buttons/CopyClipboardButtonComponent.tsx
|
|
1550
|
-
import { jsx as
|
|
1614
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1551
1615
|
var CopyClipboardButtonComponent = ({
|
|
1552
1616
|
overrideNamespace,
|
|
1553
1617
|
textToCopy,
|
|
@@ -1560,7 +1624,7 @@ var CopyClipboardButtonComponent = ({
|
|
|
1560
1624
|
sx,
|
|
1561
1625
|
...iconButtonProps
|
|
1562
1626
|
}) => {
|
|
1563
|
-
const [copied, setCopied] =
|
|
1627
|
+
const [copied, setCopied] = useState11(false);
|
|
1564
1628
|
const handleCopy = async (e) => {
|
|
1565
1629
|
e.stopPropagation();
|
|
1566
1630
|
if (!textToCopy) return;
|
|
@@ -1577,7 +1641,7 @@ var CopyClipboardButtonComponent = ({
|
|
|
1577
1641
|
console.error("Failed to copy text to clipboard:", error);
|
|
1578
1642
|
}
|
|
1579
1643
|
};
|
|
1580
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ jsx17(TranslatableTooltipComponent, { title: copied ? copiedTooltipText : copyTooltipText, children: /* @__PURE__ */ jsx17("span", { children: /* @__PURE__ */ jsx17(
|
|
1581
1645
|
IconButton3,
|
|
1582
1646
|
{
|
|
1583
1647
|
size,
|
|
@@ -1585,17 +1649,17 @@ var CopyClipboardButtonComponent = ({
|
|
|
1585
1649
|
disabled: !textToCopy || iconButtonProps.disabled,
|
|
1586
1650
|
sx: { p: 0.25, ...sx },
|
|
1587
1651
|
...iconButtonProps,
|
|
1588
|
-
children: copied ? /* @__PURE__ */
|
|
1652
|
+
children: copied ? /* @__PURE__ */ jsx17(CheckIcon, { fontSize: size === "large" ? "medium" : "small", color: "success" }) : /* @__PURE__ */ jsx17(CopyIcon, { fontSize: size === "large" ? "medium" : "small" })
|
|
1589
1653
|
}
|
|
1590
1654
|
) }) });
|
|
1591
1655
|
};
|
|
1592
1656
|
|
|
1593
1657
|
// src/context/UserSettingsProvider.tsx
|
|
1594
|
-
import { createContext as
|
|
1595
|
-
import { jsx as
|
|
1596
|
-
var UserSettingsContext =
|
|
1658
|
+
import { createContext as createContext12, useContext as useContext12, useEffect as useEffect8, useState as useState12, useCallback as useCallback6 } from "react";
|
|
1659
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1660
|
+
var UserSettingsContext = createContext12(void 0);
|
|
1597
1661
|
var useUserSettings = () => {
|
|
1598
|
-
const context =
|
|
1662
|
+
const context = useContext12(UserSettingsContext);
|
|
1599
1663
|
if (!context) {
|
|
1600
1664
|
throw new Error("useUserSettings should be used within the UserSettingsProvider");
|
|
1601
1665
|
}
|
|
@@ -1603,11 +1667,11 @@ var useUserSettings = () => {
|
|
|
1603
1667
|
};
|
|
1604
1668
|
|
|
1605
1669
|
// src/UI/components/data.display/UserPopoverComponent.tsx
|
|
1606
|
-
import { Fragment as Fragment2, jsx as
|
|
1670
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1607
1671
|
var useUserStatus = (supabase, userId, open) => {
|
|
1608
|
-
const [lastSeenAt, setLastSeenAt] =
|
|
1609
|
-
const [loading, setLoading] =
|
|
1610
|
-
|
|
1672
|
+
const [lastSeenAt, setLastSeenAt] = useState13(null);
|
|
1673
|
+
const [loading, setLoading] = useState13(true);
|
|
1674
|
+
useEffect9(() => {
|
|
1611
1675
|
if (!userId || !open) {
|
|
1612
1676
|
setLastSeenAt(null);
|
|
1613
1677
|
setLoading(false);
|
|
@@ -1656,13 +1720,13 @@ var UserPopoverComponent = ({
|
|
|
1656
1720
|
const { activeCompanyId, membership: currentMembership } = useAuth();
|
|
1657
1721
|
const { openChatWithUser } = useUserSettings();
|
|
1658
1722
|
const { formatDate, formatRelativeTime } = useLocalization();
|
|
1659
|
-
const [profileData, setProfileData] =
|
|
1660
|
-
const [membershipData, setMembershipData] =
|
|
1661
|
-
const [avatarUrl, setAvatarUrl] =
|
|
1662
|
-
const [coverUrl, setCoverUrl] =
|
|
1663
|
-
const [loading, setLoading] =
|
|
1723
|
+
const [profileData, setProfileData] = useState13(null);
|
|
1724
|
+
const [membershipData, setMembershipData] = useState13(null);
|
|
1725
|
+
const [avatarUrl, setAvatarUrl] = useState13(null);
|
|
1726
|
+
const [coverUrl, setCoverUrl] = useState13(null);
|
|
1727
|
+
const [loading, setLoading] = useState13(true);
|
|
1664
1728
|
const { lastSeenAt, isOnline } = useUserStatus(supabase, userId, open);
|
|
1665
|
-
|
|
1729
|
+
useEffect9(() => {
|
|
1666
1730
|
if (!open || !userId || !activeCompanyId) return;
|
|
1667
1731
|
let isMounted = true;
|
|
1668
1732
|
setLoading(true);
|
|
@@ -1708,7 +1772,7 @@ var UserPopoverComponent = ({
|
|
|
1708
1772
|
}, [open, userId, currentMembership?.id, activeCompanyId]);
|
|
1709
1773
|
const getStatusChip = () => {
|
|
1710
1774
|
if (!profileData) return null;
|
|
1711
|
-
return /* @__PURE__ */
|
|
1775
|
+
return /* @__PURE__ */ jsx19(UserStatusChipComponent, { state: { profile_archived: profileData.archived, profile_locked: profileData.locked, excluded: membershipData?.excluded || false, locked: membershipData?.locked || false, locked_reason: membershipData?.locked_reason || "" } });
|
|
1712
1776
|
};
|
|
1713
1777
|
const getStatusTypographyColor = (isOnline2, lastSeenAt2) => {
|
|
1714
1778
|
if (isOnline2) return "success";
|
|
@@ -1729,7 +1793,7 @@ var UserPopoverComponent = ({
|
|
|
1729
1793
|
return "inherit";
|
|
1730
1794
|
};
|
|
1731
1795
|
const canChat = currentMembership && membershipData && currentMembership.id !== membershipData.id;
|
|
1732
|
-
return /* @__PURE__ */
|
|
1796
|
+
return /* @__PURE__ */ jsx19(
|
|
1733
1797
|
Popover,
|
|
1734
1798
|
{
|
|
1735
1799
|
open,
|
|
@@ -1748,7 +1812,7 @@ var UserPopoverComponent = ({
|
|
|
1748
1812
|
}
|
|
1749
1813
|
}
|
|
1750
1814
|
},
|
|
1751
|
-
children: loading ? /* @__PURE__ */
|
|
1815
|
+
children: loading ? /* @__PURE__ */ jsx19(Box4, { sx: { display: "flex", justifyContent: "center", py: 4 }, children: /* @__PURE__ */ jsx19(CircularProgress2, { size: 28 }) }) : profileData ? /* @__PURE__ */ jsxs6(Box4, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
1752
1816
|
/* @__PURE__ */ jsxs6(
|
|
1753
1817
|
Box4,
|
|
1754
1818
|
{
|
|
@@ -1759,7 +1823,7 @@ var UserPopoverComponent = ({
|
|
|
1759
1823
|
bgcolor: "action.selected"
|
|
1760
1824
|
},
|
|
1761
1825
|
children: [
|
|
1762
|
-
coverUrl && /* @__PURE__ */
|
|
1826
|
+
coverUrl && /* @__PURE__ */ jsx19(
|
|
1763
1827
|
Box4,
|
|
1764
1828
|
{
|
|
1765
1829
|
component: "img",
|
|
@@ -1775,7 +1839,7 @@ var UserPopoverComponent = ({
|
|
|
1775
1839
|
}
|
|
1776
1840
|
}
|
|
1777
1841
|
),
|
|
1778
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ jsx19(
|
|
1779
1843
|
IconButton4,
|
|
1780
1844
|
{
|
|
1781
1845
|
size: "small",
|
|
@@ -1793,7 +1857,7 @@ var UserPopoverComponent = ({
|
|
|
1793
1857
|
transform: "scale(1.1)"
|
|
1794
1858
|
}
|
|
1795
1859
|
},
|
|
1796
|
-
children: /* @__PURE__ */
|
|
1860
|
+
children: /* @__PURE__ */ jsx19(CloseIcon, { fontSize: "small" })
|
|
1797
1861
|
}
|
|
1798
1862
|
)
|
|
1799
1863
|
]
|
|
@@ -1801,7 +1865,7 @@ var UserPopoverComponent = ({
|
|
|
1801
1865
|
),
|
|
1802
1866
|
/* @__PURE__ */ jsxs6(Box4, { sx: { p: 2, pt: 0 }, children: [
|
|
1803
1867
|
/* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1.5, sx: { alignItems: "flex-end", mt: "-18px", mb: 1 }, children: [
|
|
1804
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ jsx19(
|
|
1805
1869
|
Badge,
|
|
1806
1870
|
{
|
|
1807
1871
|
overlap: "circular",
|
|
@@ -1838,7 +1902,7 @@ var UserPopoverComponent = ({
|
|
|
1838
1902
|
}
|
|
1839
1903
|
}
|
|
1840
1904
|
},
|
|
1841
|
-
children: /* @__PURE__ */
|
|
1905
|
+
children: /* @__PURE__ */ jsx19(
|
|
1842
1906
|
Avatar,
|
|
1843
1907
|
{
|
|
1844
1908
|
src: avatarUrl || coverUrl || void 0,
|
|
@@ -1858,52 +1922,52 @@ var UserPopoverComponent = ({
|
|
|
1858
1922
|
}
|
|
1859
1923
|
),
|
|
1860
1924
|
/* @__PURE__ */ jsxs6(Box4, { sx: { overflow: "hidden", pb: 0.5 }, children: [
|
|
1861
|
-
/* @__PURE__ */
|
|
1862
|
-
membershipData?.employee_post && /* @__PURE__ */
|
|
1925
|
+
/* @__PURE__ */ jsx19(Typography2, { variant: "subtitle1", sx: { fontWeight: 600, lineHeight: 1.2 }, noWrap: true, children: profileData.display_name || `${profileData.first_name || ""} ${profileData.last_name || ""}` }),
|
|
1926
|
+
membershipData?.employee_post && /* @__PURE__ */ jsx19(Typography2, { variant: "body2", color: "text.secondary", noWrap: true, children: membershipData.employee_post })
|
|
1863
1927
|
] })
|
|
1864
1928
|
] }),
|
|
1865
1929
|
/* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1, sx: { my: 1, flexWrap: "wrap", gap: 0.5 }, children: [
|
|
1866
1930
|
getStatusChip(),
|
|
1867
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__PURE__ */ jsx19(UserRoleChipComponent, { role: membershipData?.role || "user" })
|
|
1868
1932
|
] }),
|
|
1869
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ jsx19(Divider, { sx: { my: 1.5 } }),
|
|
1870
1934
|
/* @__PURE__ */ jsxs6(Stack, { spacing: 1, sx: { fontSize: "0.875rem", mb: 1.5 }, children: [
|
|
1871
1935
|
/* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
1872
|
-
/* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
1874
|
-
/* @__PURE__ */
|
|
1936
|
+
/* @__PURE__ */ jsx19(AccessTimeIcon, { fontSize: "small", color: getStatusIconColor(isOnline, lastSeenAt) }),
|
|
1937
|
+
/* @__PURE__ */ jsx19(Typography2, { variant: "body2", color: getStatusTypographyColor(isOnline, lastSeenAt), children: isOnline ? /* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Online" }) : lastSeenAt ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1938
|
+
/* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Last seen" }),
|
|
1875
1939
|
":",
|
|
1876
1940
|
" ",
|
|
1877
|
-
/* @__PURE__ */
|
|
1878
|
-
] }) : /* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ jsx19("strong", { children: formatRelativeTime(lastSeenAt) })
|
|
1942
|
+
] }) : /* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Offline" }) })
|
|
1879
1943
|
] }),
|
|
1880
1944
|
profileData.email && /* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
1883
|
-
/* @__PURE__ */
|
|
1945
|
+
/* @__PURE__ */ jsx19(EmailIcon, { fontSize: "small" }),
|
|
1946
|
+
/* @__PURE__ */ jsx19(Typography2, { variant: "body2", color: "text.primary", noWrap: true, sx: { flexGrow: 1 }, children: profileData.email }),
|
|
1947
|
+
/* @__PURE__ */ jsx19(CopyClipboardButtonComponent, { textToCopy: profileData.email })
|
|
1884
1948
|
] }),
|
|
1885
1949
|
membershipData?.employee_post && /* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
1886
|
-
/* @__PURE__ */
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ jsx19(WorkIcon, { fontSize: "small" }),
|
|
1951
|
+
/* @__PURE__ */ jsx19(Typography2, { variant: "body2", color: "text.primary", noWrap: true, sx: { flexGrow: 1 }, children: membershipData.employee_post }),
|
|
1952
|
+
/* @__PURE__ */ jsx19(CopyClipboardButtonComponent, { textToCopy: membershipData.employee_post })
|
|
1889
1953
|
] }),
|
|
1890
1954
|
profileData.phone && /* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
1891
|
-
/* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ jsx19(PhoneIcon, { fontSize: "small" }),
|
|
1956
|
+
/* @__PURE__ */ jsx19(Typography2, { variant: "body2", color: "text.primary", children: profileData.phone })
|
|
1893
1957
|
] }),
|
|
1894
1958
|
profileData.birthday && /* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
1895
|
-
/* @__PURE__ */
|
|
1896
|
-
/* @__PURE__ */
|
|
1959
|
+
/* @__PURE__ */ jsx19(CakeIcon, { fontSize: "small" }),
|
|
1960
|
+
/* @__PURE__ */ jsx19(Typography2, { variant: "body2", color: "text.primary", children: formatDate(profileData.birthday) })
|
|
1897
1961
|
] }),
|
|
1898
1962
|
membershipData?.created_at && /* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, color: "text.secondary", children: [
|
|
1899
|
-
/* @__PURE__ */
|
|
1963
|
+
/* @__PURE__ */ jsx19(CalendarIcon, { fontSize: "small" }),
|
|
1900
1964
|
/* @__PURE__ */ jsxs6(Typography2, { variant: "body2", color: "text.primary", children: [
|
|
1901
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "In company from" }),
|
|
1902
1966
|
": ",
|
|
1903
1967
|
formatDate(membershipData.created_at)
|
|
1904
1968
|
] })
|
|
1905
1969
|
] }),
|
|
1906
|
-
profileData.description && /* @__PURE__ */
|
|
1970
|
+
profileData.description && /* @__PURE__ */ jsx19(
|
|
1907
1971
|
Typography2,
|
|
1908
1972
|
{
|
|
1909
1973
|
variant: "caption",
|
|
@@ -1919,28 +1983,28 @@ var UserPopoverComponent = ({
|
|
|
1919
1983
|
}
|
|
1920
1984
|
)
|
|
1921
1985
|
] }),
|
|
1922
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ jsx19(Divider, { sx: { my: 1 } }),
|
|
1923
1987
|
/* @__PURE__ */ jsxs6(Stack, { direction: "row", spacing: 1, sx: { justifyContent: "space-around", pt: 0.5 }, children: [
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ jsx19(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Send a notification" }), children: /* @__PURE__ */ jsx19(IconButton4, { size: "small", color: "primary", children: /* @__PURE__ */ jsx19(NotificationIcon, { fontSize: "small" }) }) }),
|
|
1989
|
+
/* @__PURE__ */ jsx19(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Set a task" }), children: /* @__PURE__ */ jsx19(IconButton4, { size: "small", color: "primary", children: /* @__PURE__ */ jsx19(TaskIcon, { fontSize: "small" }) }) }),
|
|
1990
|
+
/* @__PURE__ */ jsx19(TranslatableTooltipComponent, { title: /* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Start a chat" }), children: /* @__PURE__ */ jsx19(
|
|
1927
1991
|
IconButton4,
|
|
1928
1992
|
{
|
|
1929
1993
|
size: "small",
|
|
1930
1994
|
color: "primary",
|
|
1931
1995
|
disabled: !canChat,
|
|
1932
1996
|
onClick: () => membershipData && openChatWithUser(membershipData.id),
|
|
1933
|
-
children: /* @__PURE__ */
|
|
1997
|
+
children: /* @__PURE__ */ jsx19(ChatIcon, { fontSize: "small" })
|
|
1934
1998
|
}
|
|
1935
1999
|
) })
|
|
1936
2000
|
] })
|
|
1937
2001
|
] })
|
|
1938
|
-
] }) : /* @__PURE__ */
|
|
2002
|
+
] }) : /* @__PURE__ */ jsx19(Box4, { sx: { p: 2 }, children: /* @__PURE__ */ jsx19(
|
|
1939
2003
|
Typography2,
|
|
1940
2004
|
{
|
|
1941
2005
|
color: "error",
|
|
1942
2006
|
variant: "body2",
|
|
1943
|
-
children: /* @__PURE__ */
|
|
2007
|
+
children: /* @__PURE__ */ jsx19(TranslateText, { overrideNamespace: overrideNamespace || "form_components", children: "Failed to load user data" })
|
|
1944
2008
|
}
|
|
1945
2009
|
) })
|
|
1946
2010
|
}
|
|
@@ -1971,6 +2035,8 @@ export {
|
|
|
1971
2035
|
useToast,
|
|
1972
2036
|
ConfirmationProvider,
|
|
1973
2037
|
useConfirmation,
|
|
2038
|
+
AppSettingsProvider,
|
|
2039
|
+
useAppSettings,
|
|
1974
2040
|
Providers,
|
|
1975
2041
|
UserStatusChipComponent,
|
|
1976
2042
|
UserRoleChipComponent,
|
package/dist/index.d.mts
CHANGED
|
@@ -217,6 +217,22 @@ declare const SupabaseProvider: React__default.FC<SupabaseProviderProps>;
|
|
|
217
217
|
/** Хук для доступа к Supabase из любого компонента */
|
|
218
218
|
declare const useSupabase: () => SupabaseClient;
|
|
219
219
|
|
|
220
|
+
interface AppSettingsMap {
|
|
221
|
+
max_group_members: number;
|
|
222
|
+
[key: string]: any;
|
|
223
|
+
}
|
|
224
|
+
interface AppSettingsContextType {
|
|
225
|
+
settings: AppSettingsMap;
|
|
226
|
+
loading: boolean;
|
|
227
|
+
error: string | null;
|
|
228
|
+
getSetting: <T = any>(key: string, defaultValue: T) => T;
|
|
229
|
+
refetchSettings: () => Promise<void>;
|
|
230
|
+
}
|
|
231
|
+
declare const AppSettingsProvider: React__default.FC<{
|
|
232
|
+
children: React__default.ReactNode;
|
|
233
|
+
}>;
|
|
234
|
+
declare const useAppSettings: () => AppSettingsContextType;
|
|
235
|
+
|
|
220
236
|
interface TranslateTextProps {
|
|
221
237
|
overrideNamespace?: string;
|
|
222
238
|
children: string;
|
|
@@ -337,6 +353,9 @@ declare const useToast: () => ToastContextType;
|
|
|
337
353
|
|
|
338
354
|
declare const Providers: {
|
|
339
355
|
readonly Supabase: React$1.FC<SupabaseProviderProps>;
|
|
356
|
+
readonly AppSettings: React$1.FC<{
|
|
357
|
+
children: React.ReactNode;
|
|
358
|
+
}>;
|
|
340
359
|
readonly Translate: React$1.FC<TranslateProviderProps>;
|
|
341
360
|
readonly TranslationEdit: React$1.FC<{
|
|
342
361
|
children: React.ReactNode;
|
|
@@ -357,4 +376,4 @@ declare const Providers: {
|
|
|
357
376
|
readonly AI: React$1.FC<AIProviderProps>;
|
|
358
377
|
};
|
|
359
378
|
|
|
360
|
-
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, BreadcrumbProvider, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps as CopyClipboardButtonProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps as EmailInputProps, type Language, LocalizationProvider, type NumberInputComponentProps as NumberInputProps, Providers, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps as TextFieldProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps as TranslatableTooltipProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps as UserAvatarProps, type UserPopoverComponentProps as UserPopoverProps, type UserRoleChipComponentProps as UserRoleChipProps, type UserStatusChipComponentProps as UserStatusChipProps, useAI, useAppTheme, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace };
|
|
379
|
+
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, BreadcrumbProvider, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps as CopyClipboardButtonProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps as EmailInputProps, type Language, LocalizationProvider, type NumberInputComponentProps as NumberInputProps, Providers, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps as TextFieldProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps as TranslatableTooltipProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps as UserAvatarProps, type UserPopoverComponentProps as UserPopoverProps, type UserRoleChipComponentProps as UserRoleChipProps, type UserStatusChipComponentProps as UserStatusChipProps, useAI, useAppSettings, useAppTheme, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace };
|
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,22 @@ declare const SupabaseProvider: React__default.FC<SupabaseProviderProps>;
|
|
|
217
217
|
/** Хук для доступа к Supabase из любого компонента */
|
|
218
218
|
declare const useSupabase: () => SupabaseClient;
|
|
219
219
|
|
|
220
|
+
interface AppSettingsMap {
|
|
221
|
+
max_group_members: number;
|
|
222
|
+
[key: string]: any;
|
|
223
|
+
}
|
|
224
|
+
interface AppSettingsContextType {
|
|
225
|
+
settings: AppSettingsMap;
|
|
226
|
+
loading: boolean;
|
|
227
|
+
error: string | null;
|
|
228
|
+
getSetting: <T = any>(key: string, defaultValue: T) => T;
|
|
229
|
+
refetchSettings: () => Promise<void>;
|
|
230
|
+
}
|
|
231
|
+
declare const AppSettingsProvider: React__default.FC<{
|
|
232
|
+
children: React__default.ReactNode;
|
|
233
|
+
}>;
|
|
234
|
+
declare const useAppSettings: () => AppSettingsContextType;
|
|
235
|
+
|
|
220
236
|
interface TranslateTextProps {
|
|
221
237
|
overrideNamespace?: string;
|
|
222
238
|
children: string;
|
|
@@ -337,6 +353,9 @@ declare const useToast: () => ToastContextType;
|
|
|
337
353
|
|
|
338
354
|
declare const Providers: {
|
|
339
355
|
readonly Supabase: React$1.FC<SupabaseProviderProps>;
|
|
356
|
+
readonly AppSettings: React$1.FC<{
|
|
357
|
+
children: React.ReactNode;
|
|
358
|
+
}>;
|
|
340
359
|
readonly Translate: React$1.FC<TranslateProviderProps>;
|
|
341
360
|
readonly TranslationEdit: React$1.FC<{
|
|
342
361
|
children: React.ReactNode;
|
|
@@ -357,4 +376,4 @@ declare const Providers: {
|
|
|
357
376
|
readonly AI: React$1.FC<AIProviderProps>;
|
|
358
377
|
};
|
|
359
378
|
|
|
360
|
-
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, BreadcrumbProvider, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps as CopyClipboardButtonProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps as EmailInputProps, type Language, LocalizationProvider, type NumberInputComponentProps as NumberInputProps, Providers, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps as TextFieldProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps as TranslatableTooltipProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps as UserAvatarProps, type UserPopoverComponentProps as UserPopoverProps, type UserRoleChipComponentProps as UserRoleChipProps, type UserStatusChipComponentProps as UserStatusChipProps, useAI, useAppTheme, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace };
|
|
379
|
+
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, BreadcrumbProvider, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps as CopyClipboardButtonProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps as EmailInputProps, type Language, LocalizationProvider, type NumberInputComponentProps as NumberInputProps, Providers, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps as TextFieldProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps as TranslatableTooltipProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps as UserAvatarProps, type UserPopoverComponentProps as UserPopoverProps, type UserRoleChipComponentProps as UserRoleChipProps, type UserStatusChipComponentProps as UserStatusChipProps, useAI, useAppSettings, useAppTheme, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace };
|