@layers-app/shared 0.3.0 → 0.3.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/assets/default-workspace-avatar.jpg.js +4 -0
- package/dist/assets/layers-logo-full.svg.js +2 -3
- package/dist/assets/layers-logo-full.svg2.js +3 -2
- package/dist/assets/layers-logo-icon.svg.js +2 -3
- package/dist/assets/layers-logo-icon.svg2.js +3 -2
- package/dist/assets/projects/figureA.svg.js +4 -0
- package/dist/assets/projects/figureB.svg.js +4 -0
- package/dist/assets/qwebchannel.d.ts +15 -0
- package/dist/assets/qwebchannel.d.ts.map +1 -0
- package/dist/assets/taskPriorities/high.svg.js +5 -0
- package/dist/assets/taskPriorities/low.svg.js +5 -0
- package/dist/assets/taskPriorities/none.svg.js +5 -0
- package/dist/assets/taskPriorities/normal.svg.js +5 -0
- package/dist/assets/taskPriorities/urgent.svg.js +5 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts +3 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.js +69 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +27 -0
- package/dist/components/AnimatedFigurePage/types.d.ts +15 -0
- package/dist/components/AnimatedFigurePage/types.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/useParallax.d.ts +6 -0
- package/dist/components/AnimatedFigurePage/useParallax.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/useParallax.js +29 -0
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +37 -36
- package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +80 -45
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +60 -69
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +57 -51
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +3 -1
- package/dist/components/AppContainer/types.d.ts +3 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +14 -14
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPickerPopover.d.ts +6 -6
- package/dist/components/ColorPicker/ColorPickerPopover.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerPopover.js +29 -31
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +115 -111
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +12 -10
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +49 -46
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EmojiPicker/IconsPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +47 -45
- package/dist/components/EmojiPicker/custom-icons/customIcons.d.ts.map +1 -1
- package/dist/components/EmojiPicker/custom-icons/customIcons.js +66 -31
- package/dist/components/EntityIcon.d.ts +3 -3
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +59 -35
- package/dist/components/EntityTitle/EntityTitle.d.ts +1 -1
- package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
- package/dist/components/EntityTitle/EntityTitle.js +34 -34
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.d.ts +4 -2
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +241 -238
- package/dist/components/FilePicker/FilePicker.module.css.js +14 -12
- package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGallery.js +60 -34
- package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGiphy.js +35 -36
- package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerLink.js +26 -23
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.js +42 -43
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +60 -42
- package/dist/components/FilePicker/coverCollections.d.ts +4 -0
- package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
- package/dist/components/FilePicker/coverCollections.js +164 -0
- package/dist/components/FilePicker/index.d.ts +1 -0
- package/dist/components/FilePicker/index.d.ts.map +1 -1
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts.map +1 -1
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.js +34 -33
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +3 -3
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/Logotype.d.ts +2 -1
- package/dist/components/Logotype.d.ts.map +1 -1
- package/dist/components/Logotype.js +58 -49
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +122 -107
- package/dist/components/NavMenu/types.d.ts +1 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/Notification.module.css.js +1 -1
- package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
- package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
- package/dist/components/OnBoarding/styles.module.css.js +7 -7
- package/dist/components/ProjectIcon/ProjectIcon.js +13 -13
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.d.ts +9 -0
- package/dist/components/TreeIndent/TreeIndent.d.ts.map +1 -0
- package/dist/components/TreeIndent/TreeIndent.js +15 -0
- package/dist/components/TreeIndent/TreeIndent.module.css.js +11 -0
- package/dist/components/TreeIndent/index.d.ts +2 -0
- package/dist/components/TreeIndent/index.d.ts.map +1 -0
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +11 -11
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +97 -101
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/config/brand.d.ts +1 -0
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +42 -34
- package/dist/config/envConfig.d.ts +40 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +29 -10
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +15 -4
- package/dist/helpers/getFileIcons.d.ts.map +1 -1
- package/dist/helpers/getFileIcons.js +34 -29
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +3 -3
- package/dist/helpers/hotjar.d.ts.map +1 -1
- package/dist/helpers/hotjar.js +11 -7
- package/dist/helpers/platform.js +4 -4
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.d.ts +3 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +79 -44
- package/dist/helpers/showNotifications.module.css.js +1 -1
- package/dist/hooks/useDateFnsLocale.d.ts +2 -0
- package/dist/hooks/useDateFnsLocale.d.ts.map +1 -1
- package/dist/hooks/useDateFnsLocale.js +9 -8
- package/dist/hooks/useDateUtils.d.ts.map +1 -1
- package/dist/hooks/useDateUtils.js +19 -19
- package/dist/hooks/useFormatDistance.d.ts.map +1 -1
- package/dist/hooks/useFormatDistance.js +6 -6
- package/dist/hooks/useNumberQueryParam.d.ts +1 -1
- package/dist/hooks/useNumberQueryParam.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +504 -492
- package/dist/lang/locales/ui_en.json.js +15 -15
- package/dist/lang/locales/ui_es.json.js +11 -11
- package/dist/lang/locales/ui_ru.json.js +16 -16
- package/dist/utils/formatStorage.d.ts +9 -0
- package/dist/utils/formatStorage.d.ts.map +1 -1
- package/dist/utils/formatStorage.js +14 -10
- package/docs/README.md +499 -499
- package/package.json +75 -75
package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
"vod-player": "_vod-
|
|
3
|
-
"vod-player__player": "_vod-
|
|
1
|
+
const a = {
|
|
2
|
+
"vod-player": "_vod-player_1paib_1",
|
|
3
|
+
"vod-player__player": "_vod-player__player_1paib_25"
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_container_sq5v9_1", t = "_root_sq5v9_13", n = "_carouselRoot_sq5v9_27", e = "_carouselViewport_sq5v9_35", a = "_carouselSlide_sq5v9_43", s = "_navButton_sq5v9_57", _ = "_navButtonPrev_sq5v9_83", r = "_navButtonNext_sq5v9_91", v = "_modalContent_sq5v9_99", c = "_modalBody_sq5v9_109", i = "_videoContainer_sq5v9_121", l = "_imageContainer_sq5v9_131", u = {
|
|
2
2
|
container: o,
|
|
3
3
|
root: t,
|
|
4
4
|
carouselRoot: n,
|
|
5
5
|
carouselViewport: e,
|
|
6
6
|
carouselSlide: a,
|
|
7
|
-
navButton:
|
|
8
|
-
navButtonPrev:
|
|
7
|
+
navButton: s,
|
|
8
|
+
navButtonPrev: _,
|
|
9
9
|
navButtonNext: r,
|
|
10
|
-
modalContent:
|
|
11
|
-
modalBody:
|
|
12
|
-
videoContainer:
|
|
13
|
-
imageContainer:
|
|
10
|
+
modalContent: v,
|
|
11
|
+
modalBody: c,
|
|
12
|
+
videoContainer: i,
|
|
13
|
+
imageContainer: l
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
16
|
n as carouselRoot,
|
|
17
17
|
a as carouselSlide,
|
|
18
18
|
e as carouselViewport,
|
|
19
19
|
o as container,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
u as default,
|
|
21
|
+
l as imageContainer,
|
|
22
|
+
c as modalBody,
|
|
23
|
+
v as modalContent,
|
|
24
|
+
s as navButton,
|
|
25
25
|
r as navButtonNext,
|
|
26
|
-
|
|
26
|
+
_ as navButtonPrev,
|
|
27
27
|
t as root,
|
|
28
|
-
|
|
28
|
+
i as videoContainer
|
|
29
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const e = "_imagePreviewWrapper_1814g_1", t = "_deleteButton_1814g_11", o = "_downloadButton_1814g_25", i = "_filePreviewList_1814g_63", r = "_fileDownloadName_1814g_89", a = "_filePreviewWrapper_1814g_101", l = {
|
|
2
2
|
imagePreviewWrapper: e,
|
|
3
3
|
deleteButton: t,
|
|
4
4
|
downloadButton: o,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_wrapper_1n4or_1", s = "_logo_1n4or_15", _ = "_desktop_1n4or_45", t = "_shadow_1n4or_73", d = "_desktopShadow_1n4or_99", p = {
|
|
2
2
|
wrapper: o,
|
|
3
3
|
logo: s,
|
|
4
|
-
desktop:
|
|
5
|
-
shadow:
|
|
6
|
-
desktopShadow:
|
|
4
|
+
desktop: _,
|
|
5
|
+
shadow: t,
|
|
6
|
+
desktopShadow: d
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
p as default,
|
|
10
|
+
_ as desktop,
|
|
11
|
+
d as desktopShadow,
|
|
12
12
|
s as logo,
|
|
13
|
-
|
|
13
|
+
t as shadow,
|
|
14
14
|
o as wrapper
|
|
15
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_accordionRoot_1of7x_1", c = "_accordionControl_1of7x_9", n = "_accordionItem_1of7x_17", t = {
|
|
2
2
|
accordionRoot: o,
|
|
3
3
|
accordionControl: c,
|
|
4
4
|
accordionItem: n
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
import { PopoverProps } from '@mantine/core';
|
|
3
|
+
type ColorPickerPopoverProps = {
|
|
3
4
|
value?: string;
|
|
4
5
|
onChange?: (v: string) => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export declare const ColorPickerPopover: ({ value, onChange, defaultOpened, size, radius, children, }: PropsWithChildren<ColorPickerPopoverProps>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
opened?: boolean;
|
|
7
|
+
setOpened?: (opened: boolean) => void;
|
|
8
|
+
} & Pick<PopoverProps, 'withinPortal' | 'floatingStrategy'>;
|
|
9
|
+
export declare const ColorPickerPopover: ({ value, onChange, opened, setOpened, children, withinPortal, floatingStrategy, }: PropsWithChildren<ColorPickerPopoverProps>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=ColorPickerPopover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerPopover.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ColorPickerPopover.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAQ,YAAY,EAAE,MAAM,eAAe,CAAC;AAInD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,kBAAkB,CAAC,CAAC;AAE5D,eAAO,MAAM,kBAAkB,GAAI,mFAQhC,iBAAiB,CAAC,uBAAuB,CAAC,4CA0B5C,CAAC"}
|
|
@@ -1,42 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ColorPicker as
|
|
5
|
-
const
|
|
6
|
-
value:
|
|
7
|
-
onChange:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as a } from "react-i18next";
|
|
3
|
+
import { Menu as r } from "@mantine/core";
|
|
4
|
+
import { ColorPicker as d } from "./ColorPicker.js";
|
|
5
|
+
const x = ({
|
|
6
|
+
value: i,
|
|
7
|
+
onChange: t,
|
|
8
|
+
opened: c,
|
|
9
|
+
setOpened: e,
|
|
10
|
+
children: n,
|
|
11
|
+
withinPortal: m,
|
|
12
|
+
floatingStrategy: p
|
|
12
13
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
14
|
+
const { t: s } = a("ui");
|
|
15
|
+
return /* @__PURE__ */ l(
|
|
16
|
+
r,
|
|
16
17
|
{
|
|
17
|
-
opened:
|
|
18
|
+
opened: c,
|
|
18
19
|
onChange: e,
|
|
19
20
|
position: "bottom-start",
|
|
20
|
-
|
|
21
|
+
withinPortal: m,
|
|
22
|
+
floatingStrategy: p,
|
|
21
23
|
children: [
|
|
22
|
-
/* @__PURE__ */ o(
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
...i ? { value: r, onChange: i } : { defaultValue: r ?? void 0 }
|
|
34
|
-
}
|
|
35
|
-
) }) })
|
|
24
|
+
/* @__PURE__ */ o(r.Target, { children: n }),
|
|
25
|
+
/* @__PURE__ */ l(r.Dropdown, { children: [
|
|
26
|
+
/* @__PURE__ */ o(r.Label, { px: 4, py: 0, mih: 17, mb: 6, children: s("colorPicker.color") }),
|
|
27
|
+
/* @__PURE__ */ o("div", { onClick: () => e?.(!1), children: /* @__PURE__ */ o(
|
|
28
|
+
d,
|
|
29
|
+
{
|
|
30
|
+
...t ? { value: i, onChange: t } : { defaultValue: i ?? void 0 }
|
|
31
|
+
}
|
|
32
|
+
) })
|
|
33
|
+
] })
|
|
36
34
|
]
|
|
37
35
|
}
|
|
38
36
|
);
|
|
39
37
|
};
|
|
40
38
|
export {
|
|
41
|
-
|
|
39
|
+
x as ColorPickerPopover
|
|
42
40
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_commentComposerWrapper_f5dl7_1", e = "_commentComposerFloat_f5dl7_135", r = "_composerContainer_f5dl7_193", t = "_editorWrapper_f5dl7_225", p = "_editMode_f5dl7_361", m = {
|
|
2
2
|
commentComposerWrapper: o,
|
|
3
3
|
commentComposerFloat: e,
|
|
4
4
|
composerContainer: r,
|
|
5
5
|
editorWrapper: t,
|
|
6
|
-
editMode:
|
|
6
|
+
editMode: p
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
e as commentComposerFloat,
|
|
10
10
|
o as commentComposerWrapper,
|
|
11
11
|
r as composerContainer,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
m as default,
|
|
13
|
+
p as editMode,
|
|
14
14
|
t as editorWrapper
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,SAAS,CAAC;AA0CrE,eAAO,MAAM,eAAe,GAAI,4EAQ7B,oBAAoB,4CAuctB,CAAC"}
|
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as n, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Z, useRef as v, useMemo as U, useCallback as ee, useEffect as A } from "react";
|
|
3
3
|
import { useTranslation as te } from "react-i18next";
|
|
4
|
-
import { Attachment02Icon as oe, Sent02Icon as
|
|
4
|
+
import { Attachment02Icon as oe, Sent02Icon as re } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as $ } from "@hugeicons/react";
|
|
6
|
-
import { Stack as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { Stack as ne, Box as se, Group as B, FileButton as ie, ActionIcon as P, UnstyledButton as le, Text as ae, Button as ce, Popover as L } from "@mantine/core";
|
|
7
|
+
import { getMaxUploadSize as de } from "../../config/envConfig.js";
|
|
8
|
+
import { showErrorNotification as W } from "../../helpers/showNotifications.js";
|
|
9
|
+
import { AttachmentsPreview as me } from "../AttachmentsPreview/AttachmentsPreview.js";
|
|
10
|
+
import { CommentEditorHandler as fe } from "./CommentEditorHotkeys.js";
|
|
11
|
+
import { useVirtualAnchor as ue } from "./useVirtualAnchor.js";
|
|
12
|
+
import y from "./CommentComposer.module.css.js";
|
|
13
|
+
function j(r) {
|
|
14
|
+
return "id" in r;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return typeof
|
|
16
|
+
function pe(r) {
|
|
17
|
+
return typeof r == "object" && "isTemp" in r;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
19
|
+
function he(r) {
|
|
20
|
+
const c = URL.createObjectURL(r);
|
|
20
21
|
return {
|
|
21
22
|
id: `temp-${crypto.randomUUID()}`,
|
|
22
|
-
name:
|
|
23
|
-
type:
|
|
24
|
-
size:
|
|
25
|
-
url:
|
|
26
|
-
src:
|
|
27
|
-
isImage:
|
|
23
|
+
name: r.name,
|
|
24
|
+
type: r.type,
|
|
25
|
+
size: r.size,
|
|
26
|
+
url: c,
|
|
27
|
+
src: c,
|
|
28
|
+
isImage: r.type.startsWith("image/"),
|
|
28
29
|
isTemp: !0,
|
|
29
|
-
raw:
|
|
30
|
+
raw: r
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
34
|
-
return
|
|
33
|
+
const M = () => de() ?? 5 * 1024 * 1024, ge = 10;
|
|
34
|
+
function xe(r, c) {
|
|
35
|
+
return r(`composer.${c}`, { defaultValue: "" }) || r(`editor.composer.${c}`);
|
|
35
36
|
}
|
|
36
|
-
const
|
|
37
|
-
children:
|
|
38
|
-
onSubmit:
|
|
37
|
+
const Ne = ({
|
|
38
|
+
children: r,
|
|
39
|
+
onSubmit: c,
|
|
39
40
|
initialDraft: d,
|
|
40
|
-
updateLocation:
|
|
41
|
+
updateLocation: N,
|
|
41
42
|
onBlur: k,
|
|
42
|
-
setEdit:
|
|
43
|
-
ns:
|
|
43
|
+
setEdit: R,
|
|
44
|
+
ns: S = "comments"
|
|
44
45
|
}) => {
|
|
45
|
-
const [m,
|
|
46
|
+
const [m, _] = Z({
|
|
46
47
|
text: d?.text ?? "",
|
|
47
48
|
files: d?.files ?? []
|
|
48
|
-
}), { t:
|
|
49
|
+
}), { t: h } = te(S), G = h(S === "comments" ? "composer.placeholder" : "editor.composer.placeholder"), g = v(null), f = typeof d?.text < "u", a = {
|
|
49
50
|
text: m.text,
|
|
50
51
|
files: m.files
|
|
51
|
-
}, X = v(null), p = v(null), Y =
|
|
52
|
+
}, X = v(null), p = v(null), Y = U(
|
|
52
53
|
() => ({
|
|
53
54
|
container: document.createElement("div"),
|
|
54
55
|
elements: []
|
|
55
56
|
}),
|
|
56
57
|
[]
|
|
57
|
-
),
|
|
58
|
+
), V = v(null), u = !!N, q = ue({
|
|
58
59
|
isFloat: u,
|
|
59
|
-
updateLocation:
|
|
60
|
-
selectionRef:
|
|
60
|
+
updateLocation: N,
|
|
61
|
+
selectionRef: V,
|
|
61
62
|
selectionState: Y
|
|
62
|
-
}),
|
|
63
|
+
}), I = 10 * 30 * 0.7, b = ee(() => {
|
|
63
64
|
if (!p.current) return;
|
|
64
65
|
const e = p.current, t = e.querySelector(
|
|
65
66
|
'[class*="editorWrapper"]'
|
|
66
|
-
), s = t?.scrollHeight || 0, o = s >
|
|
67
|
+
), s = t?.scrollHeight || 0, o = s > I, l = s > 35, i = e.closest(
|
|
67
68
|
'[class*="commentComposerFloat"]'
|
|
68
69
|
) || e;
|
|
69
|
-
u && l ? i.setAttribute("data-multiline", "true") : i.removeAttribute("data-multiline"), o && t ? (t.style.maxHeight = `${
|
|
70
|
-
}, [p, u,
|
|
71
|
-
|
|
70
|
+
u && l ? i.setAttribute("data-multiline", "true") : i.removeAttribute("data-multiline"), o && t ? (t.style.maxHeight = `${I}px`, t.style.overflowY = "auto", t.style.scrollbarWidth = "thin", i.setAttribute("data-editor-constrained", "true")) : t && (t.style.maxHeight = "", t.style.overflowY = "", t.style.scrollbarWidth = "", i.removeAttribute("data-editor-constrained"));
|
|
71
|
+
}, [p, u, I]);
|
|
72
|
+
A(() => {
|
|
72
73
|
b();
|
|
73
|
-
}, [b]),
|
|
74
|
+
}, [b]), A(() => {
|
|
74
75
|
if (!p.current) return;
|
|
75
76
|
const e = new ResizeObserver(() => {
|
|
76
77
|
b();
|
|
@@ -78,7 +79,7 @@ const _e = ({
|
|
|
78
79
|
return e.observe(p.current), () => {
|
|
79
80
|
e.disconnect();
|
|
80
81
|
};
|
|
81
|
-
}, [b]),
|
|
82
|
+
}, [b]), A(() => {
|
|
82
83
|
const e = document.querySelector("main");
|
|
83
84
|
if (e && u) {
|
|
84
85
|
const t = e.style.overflow;
|
|
@@ -87,26 +88,26 @@ const _e = ({
|
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
90
|
}, [u]);
|
|
90
|
-
const { textChanged:
|
|
91
|
-
const e = d?.files || [], t = m.files, s = d?.text !==
|
|
91
|
+
const { textChanged: J, newFiles: K, deletedFiles: D, hasChanges: F } = U(() => {
|
|
92
|
+
const e = d?.files || [], t = m.files, s = d?.text !== a.text, o = t.filter((i) => i.isTemp), x = new Set(
|
|
92
93
|
t.filter(
|
|
93
|
-
(i) =>
|
|
94
|
+
(i) => j(i)
|
|
94
95
|
).map((i) => i.id)
|
|
95
|
-
), l = e.filter(
|
|
96
|
+
), l = e.filter(j).filter((i) => !x.has(i.id)), E = f ? JSON.stringify(d) === JSON.stringify(m) : a.text.trim().length > 0 || o.length > 0 || l.length > 0;
|
|
96
97
|
return {
|
|
97
98
|
textChanged: s,
|
|
98
99
|
newFiles: o,
|
|
99
100
|
deletedFiles: l,
|
|
100
101
|
hasChanges: E
|
|
101
102
|
};
|
|
102
|
-
}, [f, d, m,
|
|
103
|
-
|
|
103
|
+
}, [f, d, m, a.text]), H = () => {
|
|
104
|
+
R ? R({
|
|
104
105
|
id: "",
|
|
105
106
|
text: "",
|
|
106
107
|
files: []
|
|
107
108
|
}) : k?.();
|
|
108
109
|
}, T = (e, t = !1) => {
|
|
109
|
-
|
|
110
|
+
_((s) => {
|
|
110
111
|
if (t)
|
|
111
112
|
return { text: "", files: [] };
|
|
112
113
|
const o = typeof e == "function" ? e(s) : e;
|
|
@@ -115,98 +116,101 @@ const _e = ({
|
|
|
115
116
|
files: o.files
|
|
116
117
|
};
|
|
117
118
|
});
|
|
118
|
-
},
|
|
119
|
+
}, Q = (e, t) => {
|
|
119
120
|
e && t((s) => {
|
|
120
|
-
const o = s.files,
|
|
121
|
-
e.forEach((
|
|
122
|
-
|
|
123
|
-
}), E.length > 0 &&
|
|
124
|
-
message:
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
const o = s.files, x = ge - o.length, l = [], E = [];
|
|
122
|
+
e.forEach((z) => {
|
|
123
|
+
z.size > M() ? E.push(z) : l.push(z);
|
|
124
|
+
}), E.length > 0 && W({
|
|
125
|
+
message: h("composer.uploadErrors.fileTooLarge", {
|
|
126
|
+
defaultValue: h("editor.composer.uploadErrors.fileTooLarge", { maxSize: Math.round(M() / (1024 * 1024)) }),
|
|
127
|
+
maxSize: Math.round(M() / (1024 * 1024))
|
|
128
|
+
})
|
|
129
|
+
}), l.length > x && W({
|
|
130
|
+
message: xe(h, "uploadErrors.tooManyFiles")
|
|
127
131
|
});
|
|
128
|
-
const i = l.slice(0,
|
|
132
|
+
const i = l.slice(0, x);
|
|
129
133
|
return {
|
|
130
134
|
...s,
|
|
131
|
-
files: [...o, ...i.map(
|
|
135
|
+
files: [...o, ...i.map(he)]
|
|
132
136
|
};
|
|
133
137
|
});
|
|
134
138
|
}, w = async () => {
|
|
135
139
|
try {
|
|
136
|
-
f ? await
|
|
140
|
+
f ? await c({
|
|
137
141
|
mode: "edit",
|
|
138
142
|
data: {
|
|
139
|
-
textChanged:
|
|
140
|
-
newFiles:
|
|
141
|
-
deletedFiles:
|
|
142
|
-
newText:
|
|
143
|
+
textChanged: J,
|
|
144
|
+
newFiles: K,
|
|
145
|
+
deletedFiles: D,
|
|
146
|
+
newText: a.text
|
|
143
147
|
}
|
|
144
|
-
}) : await
|
|
148
|
+
}) : await c({
|
|
145
149
|
mode: "create",
|
|
146
150
|
data: {
|
|
147
|
-
text:
|
|
148
|
-
files: m.files.filter(
|
|
151
|
+
text: a.text,
|
|
152
|
+
files: m.files.filter(pe)
|
|
149
153
|
}
|
|
150
154
|
});
|
|
151
155
|
} catch {
|
|
152
156
|
return;
|
|
153
157
|
}
|
|
154
|
-
H(),
|
|
155
|
-
const e =
|
|
158
|
+
H(), g.current && g.current.update(() => {
|
|
159
|
+
const e = g.current._editorState._nodeMap.get("root");
|
|
156
160
|
if (!e) return;
|
|
157
161
|
e.clear();
|
|
158
|
-
const t =
|
|
162
|
+
const t = g.current._nodes.get("paragraph");
|
|
159
163
|
if (!t) return;
|
|
160
164
|
const s = new t.klass();
|
|
161
165
|
e.append(s), s.select();
|
|
162
166
|
}), T({ text: "", files: [] }, !0);
|
|
163
|
-
},
|
|
164
|
-
|
|
167
|
+
}, O = /* @__PURE__ */ n(
|
|
168
|
+
ne,
|
|
165
169
|
{
|
|
166
170
|
ref: p,
|
|
167
171
|
className: `
|
|
168
|
-
${
|
|
169
|
-
${f ?
|
|
170
|
-
${u ?
|
|
172
|
+
${y.commentComposerWrapper}
|
|
173
|
+
${f ? y.editMode : ""}
|
|
174
|
+
${u ? y.commentComposerFloat : ""}
|
|
171
175
|
`,
|
|
172
176
|
children: /* @__PURE__ */ C(
|
|
173
177
|
"div",
|
|
174
178
|
{
|
|
175
|
-
className:
|
|
179
|
+
className: y.composerContainer,
|
|
176
180
|
style: {
|
|
177
181
|
"--placeholder-text": `"${G}"`
|
|
178
182
|
},
|
|
179
183
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
184
|
+
/* @__PURE__ */ n("div", { className: y.editorWrapper, children: /* @__PURE__ */ n(
|
|
185
|
+
fe,
|
|
182
186
|
{
|
|
183
187
|
onSubmit: w,
|
|
184
|
-
editorRef:
|
|
188
|
+
editorRef: g,
|
|
185
189
|
inputContainerRef: p,
|
|
186
|
-
commentDraft:
|
|
190
|
+
commentDraft: a,
|
|
187
191
|
onBlur: H,
|
|
188
192
|
isEdit: f,
|
|
189
193
|
isFloat: u,
|
|
190
194
|
hasChanges: F,
|
|
191
|
-
ns:
|
|
192
|
-
children:
|
|
195
|
+
ns: S,
|
|
196
|
+
children: r?.({
|
|
193
197
|
onSubmit: w,
|
|
194
198
|
handleBlur: () => {
|
|
195
199
|
},
|
|
196
200
|
setCommentDraft: T,
|
|
197
|
-
commentDraft:
|
|
198
|
-
editorRef:
|
|
201
|
+
commentDraft: a,
|
|
202
|
+
editorRef: g,
|
|
199
203
|
initialContent: d?.text ?? ""
|
|
200
204
|
})
|
|
201
205
|
}
|
|
202
206
|
) }),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
|
|
207
|
+
/* @__PURE__ */ n(se, { h: 10, "data-editor-spacer": !0, tabIndex: 0, style: { width: "100%" } }),
|
|
208
|
+
/* @__PURE__ */ n(
|
|
209
|
+
me,
|
|
206
210
|
{
|
|
207
211
|
files: m.files,
|
|
208
212
|
mode: "draft",
|
|
209
|
-
onRemove: (e) =>
|
|
213
|
+
onRemove: (e) => _((t) => ({
|
|
210
214
|
...t,
|
|
211
215
|
files: t.files.filter((s, o) => o !== e)
|
|
212
216
|
}))
|
|
@@ -223,12 +227,12 @@ const _e = ({
|
|
|
223
227
|
tabIndex: 0,
|
|
224
228
|
gap: "4px",
|
|
225
229
|
children: [
|
|
226
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ n(
|
|
227
231
|
ie,
|
|
228
232
|
{
|
|
229
|
-
onChange: (e) =>
|
|
233
|
+
onChange: (e) => Q(e, T),
|
|
230
234
|
multiple: !0,
|
|
231
|
-
children: (e) => /* @__PURE__ */
|
|
235
|
+
children: (e) => /* @__PURE__ */ n(P, { ...e, variant: "subtle", size: "lg", color: "gray", children: /* @__PURE__ */ n(
|
|
232
236
|
$,
|
|
233
237
|
{
|
|
234
238
|
style: { transform: "rotate(35deg)" },
|
|
@@ -239,7 +243,7 @@ const _e = ({
|
|
|
239
243
|
}
|
|
240
244
|
),
|
|
241
245
|
f ? /* @__PURE__ */ C(B, { gap: "8px", children: [
|
|
242
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ n(
|
|
243
247
|
le,
|
|
244
248
|
{
|
|
245
249
|
onClick: H,
|
|
@@ -251,29 +255,29 @@ const _e = ({
|
|
|
251
255
|
background: "none",
|
|
252
256
|
border: "none"
|
|
253
257
|
},
|
|
254
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */ n(ae, { size: "sm", c: "dimmed", children: h("composer.cancel") })
|
|
255
259
|
}
|
|
256
260
|
),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
|
|
261
|
+
/* @__PURE__ */ n(
|
|
262
|
+
ce,
|
|
259
263
|
{
|
|
260
264
|
size: "xs",
|
|
261
265
|
radius: "md",
|
|
262
266
|
onClick: w,
|
|
263
267
|
disabled: f ? F : !F,
|
|
264
|
-
children:
|
|
268
|
+
children: h("composer.save")
|
|
265
269
|
}
|
|
266
270
|
)
|
|
267
|
-
] }) : /* @__PURE__ */
|
|
268
|
-
|
|
271
|
+
] }) : /* @__PURE__ */ n(
|
|
272
|
+
P,
|
|
269
273
|
{
|
|
270
274
|
color: "var(--mantine-primary-color-filled)",
|
|
271
275
|
size: "lg",
|
|
272
276
|
"data-comment-submit-button": !0,
|
|
273
277
|
variant: "filled",
|
|
274
278
|
onClick: w,
|
|
275
|
-
disabled: !
|
|
276
|
-
children: /* @__PURE__ */
|
|
279
|
+
disabled: !a.text.trim() && a.files.length === 0,
|
|
280
|
+
children: /* @__PURE__ */ n($, { icon: re, size: 20 })
|
|
277
281
|
}
|
|
278
282
|
)
|
|
279
283
|
]
|
|
@@ -285,7 +289,7 @@ const _e = ({
|
|
|
285
289
|
}
|
|
286
290
|
);
|
|
287
291
|
return u ? /* @__PURE__ */ C(
|
|
288
|
-
|
|
292
|
+
L,
|
|
289
293
|
{
|
|
290
294
|
opened: !0,
|
|
291
295
|
position: "bottom-start",
|
|
@@ -318,10 +322,10 @@ const _e = ({
|
|
|
318
322
|
}
|
|
319
323
|
},
|
|
320
324
|
children: [
|
|
321
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ n(L.Target, { children: /* @__PURE__ */ n(
|
|
322
326
|
"div",
|
|
323
327
|
{
|
|
324
|
-
ref:
|
|
328
|
+
ref: q,
|
|
325
329
|
style: {
|
|
326
330
|
position: "fixed",
|
|
327
331
|
width: "5px",
|
|
@@ -333,18 +337,18 @@ const _e = ({
|
|
|
333
337
|
}
|
|
334
338
|
}
|
|
335
339
|
) }),
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
|
|
340
|
+
/* @__PURE__ */ n(
|
|
341
|
+
L.Dropdown,
|
|
338
342
|
{
|
|
339
343
|
ref: X,
|
|
340
|
-
className:
|
|
341
|
-
children:
|
|
344
|
+
className: y.commentComposerFloat,
|
|
345
|
+
children: O
|
|
342
346
|
}
|
|
343
347
|
)
|
|
344
348
|
]
|
|
345
349
|
}
|
|
346
|
-
) :
|
|
350
|
+
) : O;
|
|
347
351
|
};
|
|
348
352
|
export {
|
|
349
|
-
|
|
353
|
+
Ne as CommentComposer
|
|
350
354
|
};
|