@layers-app/shared 0.4.0 → 0.4.1
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/components/AnimatedFigurePage/useParallax.d.ts +2 -2
- package/dist/components/AppContainer/AppContainer.d.ts +6 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts +4 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.js +22 -15
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -21
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +48 -91
- package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +7 -2
- package/dist/components/AppContainer/components/ToolbarNewButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolbarNewButton.js +14 -14
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts +3 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +96 -64
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +60 -47
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +35 -26
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +43 -36
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +7 -0
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -0
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +17 -0
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +4 -0
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +59 -20
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +28 -18
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +22 -18
- package/dist/components/ColorPicker/ColorPicker.d.ts +12 -11
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +11 -11
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts +1 -1
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +43 -33
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FormViewer/helpers/conditions.d.ts +38 -38
- package/dist/components/FormViewer/helpers/helpers.d.ts +38 -38
- package/dist/components/FormViewer/helpers/steps.d.ts +38 -38
- package/dist/components/FormViewer/hooks/useActiveControl.d.ts +19 -19
- package/dist/components/FormViewer/hooks/useActiveStep.d.ts +38 -38
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +6 -0
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts.map +1 -1
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +4 -3
- package/dist/components/FormViewer/hooks/useFormMobile.d.ts +1 -1
- package/dist/components/FormViewer/hooks/useFormMobile.d.ts.map +1 -1
- package/dist/components/FormViewer/store/formStore.d.ts +248 -248
- package/dist/components/FormViewer/store/formStoreApi.d.ts +124 -124
- package/dist/components/FormViewer/store/selectors.d.ts +11655 -11655
- package/dist/components/FormViewer/types/form.d.ts +1 -1
- package/dist/components/FormViewer/types/form.d.ts.map +1 -1
- package/dist/components/FormViewer/types/schemes.d.ts +381 -6358
- package/dist/components/FormViewer/types/schemes.d.ts.map +1 -1
- package/dist/components/FormViewer/types/schemes.js +1 -1
- package/dist/components/GroupAvatar/index.d.ts +3 -1
- package/dist/components/GroupAvatar/index.d.ts.map +1 -1
- package/dist/components/GroupAvatar/index.js +24 -21
- package/dist/components/MediaLibrary/MediaLibraryRow.js +7 -7
- package/dist/components/NavMenu/NavMenu.d.ts +3 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/components/DnDProvider.d.ts +1 -1
- package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts +7 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.js +21 -23
- package/dist/components/NewColorPicker/components/Target.d.ts +3 -1
- package/dist/components/NewColorPicker/components/Target.d.ts.map +1 -1
- package/dist/components/NewColorPicker/components/Target.js +48 -43
- package/dist/components/Notification/Notification.js +3 -1
- package/dist/components/Notification/NotificationCard.d.ts +3 -1
- package/dist/components/Notification/NotificationCard.d.ts.map +1 -1
- package/dist/components/Notification/NotificationCard.js +87 -86
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +1 -1
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
- package/dist/components/OnboardingTour/OnboardingTourWrapper.js +70 -74
- package/dist/components/ProjectIcon/ProjectIcon.d.ts +7 -12
- package/dist/components/ProjectIcon/ProjectIcon.d.ts.map +1 -1
- package/dist/components/ProjectIcon/ProjectIcon.js +58 -60
- package/dist/components/UserAvatar/index.d.ts +2 -1
- package/dist/components/UserAvatar/index.d.ts.map +1 -1
- package/dist/components/UserAvatar/index.js +38 -35
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +3 -3
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts.map +1 -1
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +19 -18
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +17 -17
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +7 -7
- package/dist/config/envConfig.d.ts +8 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +21 -13
- package/dist/helpers/getFileIcons.d.ts.map +1 -1
- package/dist/helpers/getFileIcons.js +63 -45
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +29 -8
- package/dist/helpers/getPartOfTheDay.d.ts +1 -1
- package/dist/helpers/offlineSuppression.d.ts +3 -0
- package/dist/helpers/offlineSuppression.d.ts.map +1 -0
- package/dist/helpers/offlineSuppression.js +8 -0
- package/dist/helpers/platform.d.ts +1 -1
- package/dist/helpers/platform.d.ts.map +1 -1
- package/dist/helpers/platform.js +5 -4
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +30 -29
- package/dist/hooks/useOutsideClick.d.ts +1 -1
- package/dist/hooks/useOutsideClick.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +336 -331
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/dist/node_modules/countries-and-timezones/esm/index.js +281 -4011
- package/package.json +13 -13
|
@@ -1,54 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { OnboardingTour as
|
|
5
|
-
import { Text as
|
|
6
|
-
import { DefaultSingleFooter as
|
|
7
|
-
import { useOnboardingTour as
|
|
1
|
+
import { jsx as u, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as C, useCallback as I, useMemo as S, useEffect as L } from "react";
|
|
3
|
+
import { useTranslation as q } from "react-i18next";
|
|
4
|
+
import { OnboardingTour as W } from "@gfazioli/mantine-onboarding-tour";
|
|
5
|
+
import { Text as A } from "@mantine/core";
|
|
6
|
+
import { DefaultSingleFooter as M, DefaultMultiFooter as U } from "./OnboardingTourFooter.js";
|
|
7
|
+
import { useOnboardingTour as V } from "./useOnboardingTour.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
const
|
|
9
|
+
const v = "onboarding-tour-popover-dropdown", h = "data-onboarding-tour-active-dropdown", G = (n) => typeof n == "string" ? /* @__PURE__ */ u(A, { fw: 500, size: "md", c: "white", mb: 4, children: n }) : n, H = (n) => typeof n == "string" ? /* @__PURE__ */ u(A, { size: "sm", c: "gray.3", children: n }) : n, ot = ({
|
|
10
10
|
featureKey: n,
|
|
11
11
|
tour: d,
|
|
12
|
-
children:
|
|
13
|
-
onComplete:
|
|
14
|
-
dependsOn:
|
|
15
|
-
withPopoverMoveAnimation:
|
|
16
|
-
classNames:
|
|
17
|
-
focusRevealProps:
|
|
18
|
-
onOnboardingTourEnd:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...F
|
|
12
|
+
children: w,
|
|
13
|
+
onComplete: P,
|
|
14
|
+
dependsOn: R,
|
|
15
|
+
withPopoverMoveAnimation: T = !1,
|
|
16
|
+
classNames: D = {},
|
|
17
|
+
focusRevealProps: f,
|
|
18
|
+
onOnboardingTourEnd: O,
|
|
19
|
+
onOnboardingTourChange: k,
|
|
20
|
+
onOnboardingTourStart: N,
|
|
21
|
+
...$
|
|
23
22
|
}) => {
|
|
24
|
-
const { t: l } =
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
}, [f, m, S]), j = R(() => {
|
|
29
|
-
const o = d.length, e = o === 1;
|
|
23
|
+
const { t: l } = q("pages"), { started: b, complete: x } = V(n, { dependsOn: R }), c = C(null), m = C(null), E = I(() => {
|
|
24
|
+
x(), P?.(), O?.();
|
|
25
|
+
}, [x, P, O]), F = S(() => {
|
|
26
|
+
const e = d.length, o = e === 1;
|
|
30
27
|
return d.map((r, s) => {
|
|
31
28
|
const a = {
|
|
32
29
|
...r,
|
|
33
|
-
title:
|
|
34
|
-
content:
|
|
30
|
+
title: G(r.title),
|
|
31
|
+
content: H(r.content)
|
|
35
32
|
};
|
|
36
|
-
return r.footer === void 0 && (
|
|
37
|
-
|
|
33
|
+
return r.footer === void 0 && (o ? a.footer = (p) => /* @__PURE__ */ u(
|
|
34
|
+
M,
|
|
38
35
|
{
|
|
39
|
-
controller:
|
|
36
|
+
controller: p,
|
|
40
37
|
label: l("onboarding.continue")
|
|
41
38
|
}
|
|
42
|
-
) : a.footer = (
|
|
43
|
-
|
|
39
|
+
) : a.footer = (p) => /* @__PURE__ */ u(
|
|
40
|
+
U,
|
|
44
41
|
{
|
|
45
|
-
controller:
|
|
42
|
+
controller: p,
|
|
46
43
|
stepIndex: s,
|
|
47
|
-
totalSteps:
|
|
44
|
+
totalSteps: e,
|
|
48
45
|
labels: {
|
|
49
46
|
stepOf: l("onboarding.stepOf", {
|
|
50
47
|
current: s + 1,
|
|
51
|
-
total:
|
|
48
|
+
total: e
|
|
52
49
|
}),
|
|
53
50
|
back: l("onboarding.back"),
|
|
54
51
|
next: l("onboarding.next"),
|
|
@@ -57,23 +54,23 @@ const w = "onboarding-tour-popover-dropdown", T = "data-onboarding-tour-active-d
|
|
|
57
54
|
}
|
|
58
55
|
)), a;
|
|
59
56
|
});
|
|
60
|
-
}, [d, l]),
|
|
61
|
-
const
|
|
57
|
+
}, [d, l]), B = S(() => {
|
|
58
|
+
const e = typeof f == "object" ? f : void 0, o = e?.popoverProps ?? {}, r = o.classNames ?? {}, s = o.styles ?? {}, a = [v, r.dropdown].filter(Boolean).join(" ");
|
|
62
59
|
return {
|
|
63
|
-
...
|
|
64
|
-
disableTargetInteraction:
|
|
60
|
+
...e,
|
|
61
|
+
disableTargetInteraction: e?.disableTargetInteraction ?? !0,
|
|
65
62
|
overlayProps: {
|
|
66
63
|
blur: 0,
|
|
67
|
-
...
|
|
64
|
+
...e?.overlayProps
|
|
68
65
|
},
|
|
69
66
|
popoverProps: {
|
|
70
67
|
position: "bottom",
|
|
71
68
|
offset: 10,
|
|
72
69
|
transitionProps: {
|
|
73
70
|
duration: 0,
|
|
74
|
-
...
|
|
71
|
+
...o.transitionProps ?? {}
|
|
75
72
|
},
|
|
76
|
-
...
|
|
73
|
+
...o,
|
|
77
74
|
classNames: {
|
|
78
75
|
...r,
|
|
79
76
|
dropdown: a
|
|
@@ -96,22 +93,22 @@ const w = "onboarding-tour-popover-dropdown", T = "data-onboarding-tour-active-d
|
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
};
|
|
99
|
-
}, [
|
|
100
|
-
return
|
|
101
|
-
if (!
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
|
|
96
|
+
}, [f]);
|
|
97
|
+
return L(() => {
|
|
98
|
+
if (!b || !T) return;
|
|
99
|
+
let e = 0;
|
|
100
|
+
const o = document.createElement("style");
|
|
101
|
+
o.setAttribute("data-onboarding-tour-popover-animation", "true"), o.textContent = `.${v}:not([${h}]) { opacity: 0 !important; pointer-events: none !important; }`, document.head.appendChild(o);
|
|
105
102
|
const r = (t) => {
|
|
106
|
-
t.removeAttribute(
|
|
103
|
+
t.removeAttribute(h), t.style.removeProperty("position"), t.style.removeProperty("top"), t.style.removeProperty("left"), t.style.removeProperty("width"), t.style.removeProperty("transform"), t.style.removeProperty("opacity"), t.style.removeProperty("pointer-events"), t.style.removeProperty("will-change"), t.style.removeProperty("transition");
|
|
107
104
|
}, s = (t) => {
|
|
108
105
|
const i = t.getBoundingClientRect();
|
|
109
106
|
if (i.width === 0 || i.height === 0) return;
|
|
110
|
-
const
|
|
111
|
-
c.current && c.current !== t && r(c.current), c.current = t, t.setAttribute(
|
|
107
|
+
const g = i.top, y = i.left, _ = m.current?.top ?? g, j = m.current?.left ?? y;
|
|
108
|
+
c.current && c.current !== t && r(c.current), c.current = t, t.setAttribute(h, "true"), Object.assign(t.style, {
|
|
112
109
|
position: "fixed",
|
|
113
|
-
top: `${
|
|
114
|
-
left: `${
|
|
110
|
+
top: `${_}px`,
|
|
111
|
+
left: `${j}px`,
|
|
115
112
|
width: `${i.width}px`,
|
|
116
113
|
transform: "none",
|
|
117
114
|
opacity: "1",
|
|
@@ -119,46 +116,45 @@ const w = "onboarding-tour-popover-dropdown", T = "data-onboarding-tour-active-d
|
|
|
119
116
|
willChange: "top, left",
|
|
120
117
|
transition: "top 260ms cubic-bezier(0.2, 0, 0, 1), left 260ms cubic-bezier(0.2, 0, 0, 1)"
|
|
121
118
|
}), requestAnimationFrame(() => {
|
|
122
|
-
t.isConnected && (t.style.top = `${
|
|
123
|
-
}),
|
|
119
|
+
t.isConnected && (t.style.top = `${g}px`, t.style.left = `${y}px`);
|
|
120
|
+
}), m.current = { top: g, left: y };
|
|
124
121
|
}, a = () => {
|
|
125
122
|
const t = Array.from(
|
|
126
|
-
document.querySelectorAll(`.${
|
|
123
|
+
document.querySelectorAll(`.${v}`)
|
|
127
124
|
), i = t[t.length - 1];
|
|
128
125
|
i && s(i);
|
|
129
|
-
},
|
|
130
|
-
cancelAnimationFrame(
|
|
126
|
+
}, p = new MutationObserver(() => {
|
|
127
|
+
cancelAnimationFrame(e), e = requestAnimationFrame(a);
|
|
131
128
|
});
|
|
132
|
-
return a(),
|
|
133
|
-
|
|
129
|
+
return a(), p.observe(document.body, { childList: !0, subtree: !0 }), () => {
|
|
130
|
+
p.disconnect(), cancelAnimationFrame(e), o.remove(), c.current && (r(c.current), c.current = null), m.current = null;
|
|
134
131
|
};
|
|
135
|
-
}, [
|
|
136
|
-
|
|
132
|
+
}, [b, T]), d.length === 0 ? /* @__PURE__ */ u(z, { children: w }) : /* @__PURE__ */ u(
|
|
133
|
+
W,
|
|
137
134
|
{
|
|
138
|
-
tour:
|
|
139
|
-
started:
|
|
135
|
+
tour: F,
|
|
136
|
+
started: b,
|
|
140
137
|
onOnboardingTourStart: () => {
|
|
141
|
-
|
|
138
|
+
N?.();
|
|
142
139
|
},
|
|
143
|
-
onOnboardingTourChange: (
|
|
144
|
-
|
|
140
|
+
onOnboardingTourChange: (e) => {
|
|
141
|
+
k?.(e);
|
|
145
142
|
},
|
|
146
|
-
onOnboardingTourEnd:
|
|
147
|
-
onOnboardingTourClose: _,
|
|
143
|
+
onOnboardingTourEnd: E,
|
|
148
144
|
withPrevButton: !1,
|
|
149
145
|
withNextButton: !1,
|
|
150
146
|
withSkipButton: !1,
|
|
151
147
|
withStepper: !1,
|
|
152
148
|
maw: 300,
|
|
153
149
|
classNames: {
|
|
154
|
-
...
|
|
150
|
+
...D
|
|
155
151
|
},
|
|
156
|
-
focusRevealProps:
|
|
157
|
-
|
|
158
|
-
children:
|
|
152
|
+
focusRevealProps: B,
|
|
153
|
+
...$,
|
|
154
|
+
children: w
|
|
159
155
|
}
|
|
160
156
|
);
|
|
161
157
|
};
|
|
162
158
|
export {
|
|
163
|
-
|
|
159
|
+
ot as OnboardingTourWrapper
|
|
164
160
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { AvatarProps } from '@mantine/core';
|
|
3
3
|
export type ProjectIconProps = {
|
|
4
4
|
icon?: string | null;
|
|
@@ -22,18 +22,13 @@ export declare namespace IconEntity {
|
|
|
22
22
|
const parse: (value?: string | null) => IconData | null;
|
|
23
23
|
const stringify: (value?: Partial<IconData>) => string;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
icon?: string | null;
|
|
28
|
-
name?: string | null;
|
|
29
|
-
fallback?: ReactNode;
|
|
30
|
-
fallbackColor?: string;
|
|
31
|
-
fallbackColorById?: string;
|
|
32
|
-
initials?: boolean;
|
|
33
|
-
} & Omit<AvatarProps, "color" | "name"> & {
|
|
25
|
+
type ProjectIconFullProps = ProjectIconProps & {
|
|
26
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
34
27
|
size?: number | string;
|
|
35
28
|
textSize?: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
29
|
+
};
|
|
30
|
+
/** Используется для отображения бокса с иконкой или первой буквы имени */
|
|
31
|
+
export declare const ProjectIcon: ({ icon, name, fallback, size, textSize, fallbackColorById, initials, fallbackColor, ref, ...props }: ProjectIconFullProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
32
|
+
export declare const renderIcon: (data: IconData | null, fallback?: ProjectIconProps["fallback"], initials?: ProjectIconProps["initials"], name?: ProjectIconProps["name"]) => string | number | bigint | true | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
|
|
38
33
|
export {};
|
|
39
34
|
//# sourceMappingURL=ProjectIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectIcon.d.ts","sourceRoot":"","sources":["../../../src/components/ProjectIcon/ProjectIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ProjectIcon.d.ts","sourceRoot":"","sources":["../../../src/components/ProjectIcon/ProjectIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAU,WAAW,EAAQ,MAAM,eAAe,CAAC;AAO1D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;AAExC,oBAAY,QAAQ;IAClB,QAAQ,MAAM;IACd,MAAM,MAAM;CACb;AAED,KAAK,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE/E,yBAAiB,UAAU,CAAC;IACnB,MAAM,KAAK,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,QAAQ,GAAG,IASxD,CAAC;IAEK,MAAM,SAAS,GAAI,QAAQ,OAAO,CAAC,QAAQ,CAAC,KAAG,MAQrD,CAAC;CACH;AAED,KAAK,oBAAoB,GAAG,gBAAgB,GAAG;IAC7C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,WAAW,GAAI,qGAWzB,oBAAoB,mDAsCtB,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,MAAM,QAAQ,GAAG,IAAI,EACrB,WAAW,gBAAgB,CAAC,UAAU,CAAC,EACvC,WAAW,gBAAgB,CAAC,UAAU,CAAC,EACvC,OAAO,gBAAgB,CAAC,MAAM,CAAC,2SAqBhC,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import L from "
|
|
6
|
-
import { DEFAULT_VALUES as w } from "../../constants.js";
|
|
2
|
+
import { Avatar as u, Text as y } from "@mantine/core";
|
|
3
|
+
import { omit as d, isString as x, isNil as S } from "lodash-es";
|
|
4
|
+
import j from "query-string";
|
|
5
|
+
import { DEFAULT_VALUES as L } from "../../constants.js";
|
|
7
6
|
import { customIcons as v } from "../EmojiPicker/custom-icons/customIcons.js";
|
|
8
|
-
var
|
|
7
|
+
var w = /* @__PURE__ */ ((r) => (r.OUTLINED = "o", r.FILLED = "f", r))(w || {}), c;
|
|
9
8
|
((r) => {
|
|
10
9
|
r.parse = (t) => {
|
|
11
|
-
if (!
|
|
10
|
+
if (!x(t) || t.trim() === "") return null;
|
|
12
11
|
const e = new URLSearchParams(t);
|
|
13
12
|
return {
|
|
14
13
|
icon: e.get("i") || "",
|
|
@@ -17,7 +16,7 @@ var I = /* @__PURE__ */ ((r) => (r.OUTLINED = "o", r.FILLED = "f", r))(I || {}),
|
|
|
17
16
|
type: e.get("t") || "o"
|
|
18
17
|
/* OUTLINED */
|
|
19
18
|
};
|
|
20
|
-
}, r.stringify = (t) =>
|
|
19
|
+
}, r.stringify = (t) => S(t) ? "" : j.stringify({
|
|
21
20
|
i: t.icon || void 0,
|
|
22
21
|
c: t.color || void 0,
|
|
23
22
|
e: t.emoji || void 0,
|
|
@@ -25,64 +24,63 @@ var I = /* @__PURE__ */ ((r) => (r.OUTLINED = "o", r.FILLED = "f", r))(I || {}),
|
|
|
25
24
|
/* OUTLINED */
|
|
26
25
|
});
|
|
27
26
|
})(c || (c = {}));
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
), A = (r, t, e, i) => {
|
|
27
|
+
const F = ({
|
|
28
|
+
icon: r,
|
|
29
|
+
name: t,
|
|
30
|
+
fallback: e,
|
|
31
|
+
size: i,
|
|
32
|
+
textSize: n,
|
|
33
|
+
fallbackColorById: l,
|
|
34
|
+
initials: f = !0,
|
|
35
|
+
fallbackColor: g,
|
|
36
|
+
ref: h,
|
|
37
|
+
...s
|
|
38
|
+
}) => {
|
|
39
|
+
const m = c.parse(r);
|
|
40
|
+
if (!m && !e) return null;
|
|
41
|
+
const p = m?.color || (l ? "initials" : g) || L.COLORS[0];
|
|
42
|
+
return /* @__PURE__ */ o(
|
|
43
|
+
u,
|
|
44
|
+
{
|
|
45
|
+
ref: h,
|
|
46
|
+
variant: "transparent",
|
|
47
|
+
color: p,
|
|
48
|
+
name: l,
|
|
49
|
+
size: i || 20,
|
|
50
|
+
style: {
|
|
51
|
+
overflow: s.radius ? "hidden" : "visible",
|
|
52
|
+
...s.style
|
|
53
|
+
},
|
|
54
|
+
...d(s, ["style"]),
|
|
55
|
+
children: /* @__PURE__ */ o(
|
|
56
|
+
y,
|
|
57
|
+
{
|
|
58
|
+
fz: `${n || i}px`,
|
|
59
|
+
fw: "bold",
|
|
60
|
+
tt: "uppercase",
|
|
61
|
+
style: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
justifyContent: "center",
|
|
65
|
+
lineHeight: "normal"
|
|
66
|
+
},
|
|
67
|
+
children: I(m, e, f, t)
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}, I = (r, t, e, i) => {
|
|
75
73
|
const n = v?.[r?.icon || ""];
|
|
76
74
|
return n ? /* @__PURE__ */ o(n, { width: "1em", height: "1em", style: { flexShrink: 0 } }) : r?.icon ? /* @__PURE__ */ o("svg", { width: "1em", height: "1em", style: { flexShrink: 0 }, children: /* @__PURE__ */ o(
|
|
77
75
|
"use",
|
|
78
76
|
{
|
|
79
77
|
xlinkHref: `/tabler-sprite${r.type === "f" ? "-filled" : ""}.svg#tabler-${r.type === "f" ? "filled-" : ""}${r.icon}`
|
|
80
78
|
}
|
|
81
|
-
) }) : r?.emoji ? r.emoji : t || (i && e ?
|
|
82
|
-
},
|
|
79
|
+
) }) : r?.emoji ? r.emoji : t || (i && e ? A(i) : null);
|
|
80
|
+
}, A = (r) => String.fromCodePoint(r?.trim()?.codePointAt(0) ?? 1);
|
|
83
81
|
export {
|
|
84
82
|
c as IconEntity,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
w as IconType,
|
|
84
|
+
F as ProjectIcon,
|
|
85
|
+
I as renderIcon
|
|
88
86
|
};
|
|
@@ -2,8 +2,9 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { AvatarProps } from '@mantine/core';
|
|
3
3
|
import { MenuUser } from '../AppContainer/components/menus/UserMenu/MenuUserDropdown';
|
|
4
4
|
export interface UserAvatarProps extends AvatarProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof AvatarProps> {
|
|
5
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
5
6
|
user?: Partial<MenuUser> | null;
|
|
6
7
|
emptyIcon?: ReactNode;
|
|
7
8
|
}
|
|
8
|
-
export declare const UserAvatar:
|
|
9
|
+
export declare const UserAvatar: ({ user, size, emptyIcon, ref, ...props }: UserAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UserAvatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UserAvatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,WAAW,eACf,SAAQ,WAAW,EACjB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,WAAW,CAAC;IAChE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,GAAI,0CAMxB,eAAe,4CAqCjB,CAAC"}
|
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
import { jsx as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { Avatar as d } from "@mantine/core";
|
|
2
|
+
import { Avatar as m } from "@mantine/core";
|
|
4
3
|
import { IconUser as l } from "@tabler/icons-react";
|
|
5
|
-
import { ProjectIcon as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
4
|
+
import { ProjectIcon as d } from "../ProjectIcon/ProjectIcon.js";
|
|
5
|
+
const p = ({
|
|
6
|
+
user: a,
|
|
7
|
+
size: i = 24,
|
|
8
|
+
emptyIcon: e,
|
|
9
|
+
ref: o,
|
|
10
|
+
...n
|
|
11
|
+
}) => {
|
|
12
|
+
const r = a?.avatar || a?.avatarUrl;
|
|
13
|
+
return r && (r.includes("i=") || r.includes("e=")) ? /* @__PURE__ */ t(
|
|
14
|
+
d,
|
|
15
|
+
{
|
|
16
|
+
icon: r,
|
|
17
|
+
name: a?.name,
|
|
18
|
+
fallbackColorById: a?.id,
|
|
19
|
+
size: i,
|
|
20
|
+
textSize: typeof i == "number" ? i * 0.75 : void 0,
|
|
21
|
+
radius: n.radius,
|
|
22
|
+
...n,
|
|
23
|
+
ref: o
|
|
24
|
+
}
|
|
25
|
+
) : /* @__PURE__ */ t(
|
|
26
|
+
m,
|
|
27
|
+
{
|
|
28
|
+
src: r,
|
|
29
|
+
color: "initials",
|
|
30
|
+
tt: "uppercase",
|
|
31
|
+
size: i,
|
|
32
|
+
variant: "filled",
|
|
33
|
+
name: a?.id ?? "",
|
|
34
|
+
...n,
|
|
35
|
+
ref: o,
|
|
36
|
+
children: a ? /* @__PURE__ */ t(c, { children: a.name?.charAt(0) }) : /* @__PURE__ */ t(c, { children: e ?? /* @__PURE__ */ t(l, { size: "70%" }) })
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
37
40
|
export {
|
|
38
|
-
|
|
41
|
+
p as UserAvatar
|
|
39
42
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { AvatarProps } from '@mantine/core';
|
|
2
3
|
import { MenuWorkspace } from '../WorkspaceMenu/WorkspaceMenu';
|
|
3
4
|
export type WorkspaceAvatarProps = AvatarProps & {
|
|
5
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
4
6
|
workspace?: MenuWorkspace | null;
|
|
5
7
|
};
|
|
6
|
-
export declare const WorkspaceAvatar: import("react").
|
|
7
|
-
workspace?: MenuWorkspace | null;
|
|
8
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const WorkspaceAvatar: ({ workspace, ref, ...props }: WorkspaceAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
//# sourceMappingURL=WorkspaceAvatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspaceAvatar/WorkspaceAvatar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkspaceAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspaceAvatar/WorkspaceAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAC/C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,8BAI7B,oBAAoB,4CAatB,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
import { Avatar as e } from "@mantine/core";
|
|
3
|
+
import i from "../../assets/default-workspace-avatar.jpg.js";
|
|
4
|
+
const p = ({
|
|
5
|
+
workspace: r,
|
|
6
|
+
ref: a,
|
|
7
|
+
...t
|
|
8
|
+
}) => /* @__PURE__ */ o(
|
|
9
|
+
e,
|
|
10
|
+
{
|
|
11
|
+
src: r?.workspaceIcon || i,
|
|
12
|
+
tt: "uppercase",
|
|
13
|
+
color: "initials",
|
|
14
|
+
variant: "filled",
|
|
15
|
+
name: r?.workspaceId,
|
|
16
|
+
radius: "var(--mantine-radius-default)",
|
|
17
|
+
...t,
|
|
18
|
+
ref: a
|
|
19
|
+
}
|
|
19
20
|
);
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
p as WorkspaceAvatar
|
|
22
23
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as t, Fragment as s } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as c } from "react-i18next";
|
|
3
|
-
import { Menu as p, Flex as
|
|
3
|
+
import { Menu as p, Flex as m, Box as a, Text as i } from "@mantine/core";
|
|
4
4
|
import { usePlatform as h } from "../../hooks/usePlatform.js";
|
|
5
|
-
import { WorkspaceAvatar as
|
|
6
|
-
const M = ({ workspace:
|
|
7
|
-
const { t: r } = c("workspaceMenu"),
|
|
8
|
-
return /* @__PURE__ */
|
|
5
|
+
import { WorkspaceAvatar as u } from "../WorkspaceAvatar/WorkspaceAvatar.js";
|
|
6
|
+
const M = ({ workspace: e, onClick: l }) => {
|
|
7
|
+
const { t: r } = c("workspaceMenu"), o = h();
|
|
8
|
+
return /* @__PURE__ */ n(
|
|
9
9
|
p.Item,
|
|
10
10
|
{
|
|
11
11
|
p: 4,
|
|
12
|
-
onClick: () =>
|
|
12
|
+
onClick: () => l?.(e),
|
|
13
13
|
component: "a",
|
|
14
14
|
styles: { itemLabel: { minWidth: 0 } },
|
|
15
|
-
children: /* @__PURE__ */ t(
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */ t(
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
!
|
|
20
|
-
|
|
21
|
-
r("member", { count:
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
15
|
+
children: /* @__PURE__ */ t(m, { gap: 12, children: [
|
|
16
|
+
/* @__PURE__ */ n(u, { workspace: e, size: 36 }),
|
|
17
|
+
/* @__PURE__ */ t(a, { flex: 1, miw: 0, children: [
|
|
18
|
+
/* @__PURE__ */ n(i, { truncate: !0, size: "sm", fw: 500, c: "var(--mantine-color-bright)", children: e.workspaceName }),
|
|
19
|
+
!e?.invitation && /* @__PURE__ */ n(i, { c: "gray", fw: 500, size: "xs", component: "span", children: /* @__PURE__ */ t(m, { gap: 8, component: "span", children: [
|
|
20
|
+
o.has("memberCount") && e.totalMembers ? /* @__PURE__ */ t(s, { children: [
|
|
21
|
+
r("member", { count: e.totalMembers }),
|
|
22
|
+
/* @__PURE__ */ n(
|
|
23
|
+
a,
|
|
24
24
|
{
|
|
25
25
|
w: 2,
|
|
26
26
|
h: 2,
|
|
@@ -30,7 +30,7 @@ const M = ({ workspace: n, onClick: a }) => {
|
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
] }) : null,
|
|
33
|
-
|
|
33
|
+
o.has("planBadges") && r(`plans.${e.plan}`)
|
|
34
34
|
] }) })
|
|
35
35
|
] })
|
|
36
36
|
] })
|