@layers-app/shared 0.4.6 → 0.4.8
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 +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.js +32 -32
- 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 +82 -70
- package/dist/components/AppContainer/AppContainer.module.css.js +20 -10
- package/dist/components/AppContainer/components/AppsSidebar/DesktopUpdateButton.d.ts +6 -0
- package/dist/components/AppContainer/components/AppsSidebar/DesktopUpdateButton.d.ts.map +1 -0
- package/dist/components/AppContainer/components/AppsSidebar/DesktopUpdateButton.js +161 -0
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +77 -49
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +238 -105
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/NavbarContent.d.ts.map +1 -1
- package/dist/components/AppContainer/components/NavbarContent.js +16 -2
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts +5 -0
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +51 -39
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts +62 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +1107 -137
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +158 -6
- package/dist/components/AppContainer/types.d.ts +12 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts +3 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +237 -93
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +18 -16
- package/dist/components/Chat/ChatInput/index.d.ts +13 -1
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatInput/index.js +264 -164
- package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts +16 -0
- package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/useVoiceRecorder.js +83 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +20 -16
- package/dist/components/Chat/ChatMessage/index.d.ts +16 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatMessage/index.js +153 -118
- package/dist/components/Chat/MessageActions/index.d.ts +2 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageActions/index.js +189 -50
- package/dist/components/Chat/MessageAuthor/index.d.ts +7 -1
- package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageAuthor/index.js +39 -25
- package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -12
- package/dist/components/Chat/MessageList/index.d.ts +17 -25
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageList/index.js +201 -149
- package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageMeta/index.js +21 -19
- package/dist/components/ColorPicker/ColorPicker.d.ts +3 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +81 -76
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +97 -91
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +2 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +29 -26
- package/dist/components/CommentComposer/index.d.ts +1 -1
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +70 -68
- package/dist/components/CommentComposer/types.d.ts +6 -0
- package/dist/components/CommentComposer/types.d.ts.map +1 -1
- package/dist/components/CustomKBD/index.js +21 -22
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +129 -121
- package/dist/components/EntityTitle/EntityTitle.d.ts +3 -4
- package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
- package/dist/components/EntityTitle/EntityTitle.js +81 -80
- package/dist/components/FormViewer/helpers/conditions.d.ts.map +1 -1
- package/dist/components/FormViewer/helpers/conditions.js +33 -17
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts +3 -1
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts.map +1 -1
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.js +26 -25
- package/dist/components/NewToolbar/utils.d.ts +12 -0
- package/dist/components/NewToolbar/utils.d.ts.map +1 -0
- package/dist/components/Notification/InfiniteScroll.d.ts +12 -0
- package/dist/components/Notification/InfiniteScroll.d.ts.map +1 -0
- package/dist/components/Notification/InfiniteScroll.js +42 -0
- package/dist/components/Notification/Notification.d.ts +4 -1
- package/dist/components/Notification/Notification.d.ts.map +1 -1
- package/dist/components/Notification/Notification.module.css.js +28 -4
- package/dist/components/Notification/atoms/ActionBadge.d.ts +11 -0
- package/dist/components/Notification/atoms/ActionBadge.d.ts.map +1 -0
- package/dist/components/Notification/atoms/ActionBadge.js +53 -0
- package/dist/components/Notification/atoms/ArchiveIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/ArchiveIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/ArchiveIcon.js +40 -0
- package/dist/components/Notification/atoms/InboxIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/InboxIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/InboxIcon.js +33 -0
- package/dist/components/Notification/atoms/MarkReadIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/MarkReadIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/MarkReadIcon.js +33 -0
- package/dist/components/Notification/atoms/ResourceIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/ResourceIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/TabBadge.d.ts +7 -0
- package/dist/components/Notification/atoms/TabBadge.d.ts.map +1 -0
- package/dist/components/Notification/atoms/TabBadge.js +32 -0
- package/dist/components/Notification/atoms/UnreadDot.d.ts +6 -0
- package/dist/components/Notification/atoms/UnreadDot.d.ts.map +1 -0
- package/dist/components/Notification/atoms/UnreadDot.js +23 -0
- package/dist/components/Notification/atoms/index.d.ts +5 -0
- package/dist/components/Notification/atoms/index.d.ts.map +1 -0
- package/dist/components/Notification/hooks/index.d.ts +8 -0
- package/dist/components/Notification/hooks/index.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxActions.d.ts +12 -0
- package/dist/components/Notification/hooks/useInboxActions.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxActions.js +58 -0
- package/dist/components/Notification/hooks/useInboxLoader.d.ts +8 -0
- package/dist/components/Notification/hooks/useInboxLoader.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxLoader.js +49 -0
- package/dist/components/Notification/hooks/useNotificationItem.d.ts +26 -0
- package/dist/components/Notification/hooks/useNotificationItem.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationItem.js +51 -0
- package/dist/components/Notification/hooks/useNotificationStore.d.ts +49 -0
- package/dist/components/Notification/hooks/useNotificationStore.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationStore.js +139 -0
- package/dist/components/Notification/hooks/useNotificationStream.d.ts +2 -0
- package/dist/components/Notification/hooks/useNotificationStream.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationStream.js +86 -0
- package/dist/components/Notification/hooks/useNotificationTime.d.ts +2 -0
- package/dist/components/Notification/hooks/useNotificationTime.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationTime.js +23 -0
- package/dist/components/Notification/hooks/useNotificationsApi.d.ts +25 -0
- package/dist/components/Notification/hooks/useNotificationsApi.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationsApi.js +64 -0
- package/dist/components/Notification/lib/api.d.ts +4 -0
- package/dist/components/Notification/lib/api.d.ts.map +1 -0
- package/dist/components/Notification/lib/api.js +19 -0
- package/dist/components/Notification/lib/index.d.ts +5 -0
- package/dist/components/Notification/lib/index.d.ts.map +1 -0
- package/dist/components/Notification/lib/notificationText.d.ts +10 -0
- package/dist/components/Notification/lib/notificationText.d.ts.map +1 -0
- package/dist/components/Notification/lib/notificationText.js +131 -0
- package/dist/components/Notification/lib/stripHtml.d.ts +2 -0
- package/dist/components/Notification/lib/stripHtml.d.ts.map +1 -0
- package/dist/components/Notification/lib/stripHtml.js +6 -0
- package/dist/components/Notification/lib/types.d.ts +45 -0
- package/dist/components/Notification/lib/types.d.ts.map +1 -0
- package/dist/components/Notification/lib/types.js +9 -0
- package/dist/components/Notification/molecules/InboxEmpty.d.ts +8 -0
- package/dist/components/Notification/molecules/InboxEmpty.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxEmpty.js +21 -0
- package/dist/components/Notification/molecules/InboxHeader.d.ts +17 -0
- package/dist/components/Notification/molecules/InboxHeader.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxHeader.js +73 -0
- package/dist/components/Notification/molecules/InboxTabs.d.ts +15 -0
- package/dist/components/Notification/molecules/InboxTabs.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxTabs.js +60 -0
- package/dist/components/Notification/molecules/NotificationActions.d.ts +9 -0
- package/dist/components/Notification/molecules/NotificationActions.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationActions.js +64 -0
- package/dist/components/Notification/molecules/NotificationAvatar.d.ts +17 -0
- package/dist/components/Notification/molecules/NotificationAvatar.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationAvatar.js +38 -0
- package/dist/components/Notification/molecules/NotificationContent.d.ts +22 -0
- package/dist/components/Notification/molecules/NotificationContent.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationContent.js +183 -0
- package/dist/components/Notification/molecules/index.d.ts +7 -0
- package/dist/components/Notification/molecules/index.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxItem.d.ts +14 -0
- package/dist/components/Notification/organisms/InboxItem.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxItem.js +100 -0
- package/dist/components/Notification/organisms/InboxPanel.d.ts +4 -0
- package/dist/components/Notification/organisms/InboxPanel.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxPanel.js +99 -0
- package/dist/components/Notification/organisms/index.d.ts +3 -0
- package/dist/components/Notification/organisms/index.d.ts.map +1 -0
- package/dist/components/OnboardingTour/index.d.ts +1 -1
- package/dist/components/OnboardingTour/index.d.ts.map +1 -1
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts +2 -0
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -1
- package/dist/components/OnboardingTour/useOnboardingTour.js +63 -51
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/components/modals/RemoveConfirmModal.js +27 -26
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +29 -29
- package/dist/config/envConfig.d.ts +4 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +29 -28
- package/dist/helpers/getFileIcons.js +5 -5
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +11 -2
- package/dist/helpers/platform.d.ts +1 -1
- package/dist/helpers/platform.d.ts.map +1 -1
- package/dist/helpers/platform.js +1 -0
- package/dist/helpers/showNotifications.d.ts +8 -14
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +107 -111
- package/dist/helpers/showNotifications.module.css.js +4 -16
- package/dist/hooks/useDateUtils.d.ts.map +1 -1
- package/dist/hooks/useDateUtils.js +19 -23
- package/dist/index.css +1 -1
- package/dist/index.js +576 -573
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.context.js +15 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.js +228 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.module.css.js +4 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioControls.js +19 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioMuteButton.js +30 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioPlayButton.js +40 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSkipButton.js +28 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpectrum.js +137 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpeedControl.js +31 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeDisplay.js +44 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeline.js +71 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioVolumeSlider.js +43 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioWaveform.js +166 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/use-audio.js +201 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.context.js +15 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.js +272 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.module.css.js +4 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoCaptionsButton.js +55 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoControls.js +30 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoFullscreenButton.js +31 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoMuteButton.js +29 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPiPButton.js +29 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPlayButton.js +28 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoSkipButton.js +27 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeDisplay.js +44 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeline.js +70 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/use-video.js +170 -0
- package/package.json +5 -3
- package/dist/components/Notification/Notification.js +0 -119
- package/dist/components/Notification/NotificationCard.d.ts +0 -10
- package/dist/components/Notification/NotificationCard.d.ts.map +0 -1
- package/dist/components/Notification/NotificationCard.js +0 -93
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Tick02Icon as
|
|
5
|
-
import { HugeiconsIcon as
|
|
6
|
-
import { useMantineTheme as
|
|
7
|
-
import { IconPalette as
|
|
8
|
-
import
|
|
9
|
-
import { DEFAULT_VALUES as
|
|
10
|
-
import { ColorPickerList as
|
|
11
|
-
import { ColorPickerToolbar as
|
|
12
|
-
import { resolveColorLabel as
|
|
13
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useState as y } from "react";
|
|
3
|
+
import { useTranslation as E } from "react-i18next";
|
|
4
|
+
import { Tick02Icon as R } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { HugeiconsIcon as D } from "@hugeicons/react";
|
|
6
|
+
import { useMantineTheme as I, getThemeColor as F, Flex as x, Tooltip as H, ColorSwatch as M, parseThemeColor as U, ColorInput as V, ActionIcon as w } from "@mantine/core";
|
|
7
|
+
import { IconPalette as q, IconPencil as _ } from "@tabler/icons-react";
|
|
8
|
+
import B from "styled-components";
|
|
9
|
+
import { DEFAULT_VALUES as k } from "../../constants.js";
|
|
10
|
+
import { ColorPickerList as G } from "./ColorPickerList.js";
|
|
11
|
+
import { ColorPickerToolbar as J } from "./ColorPickerToolbar.js";
|
|
12
|
+
import { resolveColorLabel as K, normalizeColorItem as N } from "./types.js";
|
|
13
|
+
const Q = z(
|
|
14
14
|
({
|
|
15
15
|
value: o,
|
|
16
16
|
onChange: l,
|
|
17
17
|
allowCustomColor: n,
|
|
18
18
|
colors: s,
|
|
19
|
-
swatchShape:
|
|
20
|
-
swatchVariant:
|
|
21
|
-
withTick:
|
|
22
|
-
fullWidth:
|
|
23
|
-
swatchSize:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
swatchShape: m = "circle",
|
|
20
|
+
swatchVariant: d = "filled",
|
|
21
|
+
withTick: p = !1,
|
|
22
|
+
fullWidth: u = !1,
|
|
23
|
+
swatchSize: f = 30,
|
|
24
|
+
wrapperHeight: i,
|
|
25
|
+
customSizes: a,
|
|
26
|
+
...h
|
|
27
|
+
}, C) => {
|
|
28
|
+
const r = I(), t = U({
|
|
29
|
+
color: o || k.COLORS[0],
|
|
30
|
+
theme: r
|
|
31
|
+
}), [b, O] = y(t.value), [T, g] = y(!1);
|
|
32
|
+
return T ? /* @__PURE__ */ v(x, { align: "center", mih: 30, children: [
|
|
31
33
|
/* @__PURE__ */ e(
|
|
32
|
-
|
|
34
|
+
V,
|
|
33
35
|
{
|
|
34
36
|
w: "100%",
|
|
35
37
|
popoverProps: {
|
|
@@ -39,62 +41,64 @@ const K = k(
|
|
|
39
41
|
maxLength: 7,
|
|
40
42
|
withEyeDropper: !1,
|
|
41
43
|
size: "xs",
|
|
42
|
-
value:
|
|
43
|
-
onChange:
|
|
44
|
+
value: b,
|
|
45
|
+
onChange: O,
|
|
44
46
|
onChangeEnd: l,
|
|
45
47
|
placeholder: "Select custom color"
|
|
46
48
|
}
|
|
47
49
|
),
|
|
48
50
|
/* @__PURE__ */ e(
|
|
49
|
-
|
|
51
|
+
w,
|
|
50
52
|
{
|
|
51
53
|
radius: "xl",
|
|
52
54
|
variant: "default",
|
|
53
55
|
color: "gray",
|
|
54
|
-
onClick: () =>
|
|
55
|
-
children: /* @__PURE__ */ e(
|
|
56
|
+
onClick: () => g(!1),
|
|
57
|
+
children: /* @__PURE__ */ e(q, { size: 16 })
|
|
56
58
|
}
|
|
57
59
|
)
|
|
58
|
-
] }, 1) : /* @__PURE__ */
|
|
60
|
+
] }, 1) : /* @__PURE__ */ v(
|
|
59
61
|
x,
|
|
60
62
|
{
|
|
61
|
-
ref:
|
|
62
|
-
...
|
|
63
|
-
justify:
|
|
63
|
+
ref: C,
|
|
64
|
+
...h,
|
|
65
|
+
justify: u ? "space-between" : "flex-start",
|
|
64
66
|
align: "center",
|
|
67
|
+
mih: a && i || 32,
|
|
65
68
|
children: [
|
|
66
|
-
(s ||
|
|
69
|
+
(s || k.COLORS).map((P, S) => {
|
|
67
70
|
const {
|
|
68
|
-
value:
|
|
69
|
-
border:
|
|
70
|
-
bg:
|
|
71
|
-
label:
|
|
72
|
-
} =
|
|
71
|
+
value: c,
|
|
72
|
+
border: $,
|
|
73
|
+
bg: j,
|
|
74
|
+
label: A
|
|
75
|
+
} = N(P);
|
|
73
76
|
return /* @__PURE__ */ e(
|
|
74
|
-
|
|
77
|
+
W,
|
|
75
78
|
{
|
|
76
|
-
value:
|
|
77
|
-
label:
|
|
78
|
-
isActive:
|
|
79
|
-
size:
|
|
80
|
-
swatchShape:
|
|
81
|
-
swatchVariant:
|
|
82
|
-
withTick:
|
|
83
|
-
borderColor:
|
|
84
|
-
bgColor:
|
|
85
|
-
onClick: () => l?.(
|
|
79
|
+
value: c,
|
|
80
|
+
label: A,
|
|
81
|
+
isActive: c === o,
|
|
82
|
+
size: f - 4,
|
|
83
|
+
swatchShape: m,
|
|
84
|
+
swatchVariant: d,
|
|
85
|
+
withTick: p,
|
|
86
|
+
borderColor: $,
|
|
87
|
+
bgColor: j,
|
|
88
|
+
onClick: () => l?.(c),
|
|
89
|
+
swatchSize: a ? f : void 0
|
|
86
90
|
},
|
|
87
|
-
|
|
91
|
+
c || S
|
|
88
92
|
);
|
|
89
93
|
}),
|
|
90
94
|
n && /* @__PURE__ */ e(
|
|
91
|
-
|
|
95
|
+
w,
|
|
92
96
|
{
|
|
93
97
|
radius: "xl",
|
|
94
98
|
variant: "default",
|
|
95
99
|
color: "gray",
|
|
96
|
-
onClick: () =>
|
|
97
|
-
children: /* @__PURE__ */ e(
|
|
100
|
+
onClick: () => g(!0),
|
|
101
|
+
children: /* @__PURE__ */ e(_, { size: 16 })
|
|
98
102
|
}
|
|
99
103
|
)
|
|
100
104
|
]
|
|
@@ -102,19 +106,20 @@ const K = k(
|
|
|
102
106
|
2
|
|
103
107
|
);
|
|
104
108
|
}
|
|
105
|
-
),
|
|
109
|
+
), L = z(
|
|
106
110
|
({
|
|
107
111
|
value: o,
|
|
108
112
|
label: l,
|
|
109
113
|
isActive: n,
|
|
110
114
|
swatchShape: s,
|
|
111
|
-
swatchVariant:
|
|
112
|
-
withTick:
|
|
113
|
-
borderColor:
|
|
114
|
-
bgColor:
|
|
115
|
+
swatchVariant: m = "filled",
|
|
116
|
+
withTick: d,
|
|
117
|
+
borderColor: p,
|
|
118
|
+
bgColor: u,
|
|
119
|
+
swatchSize: f,
|
|
115
120
|
...i
|
|
116
|
-
},
|
|
117
|
-
const
|
|
121
|
+
}, a) => {
|
|
122
|
+
const h = I(), { t: C } = E("ui"), r = o ? F(o, h) : "", t = m === "outline", b = K(C, o, l);
|
|
118
123
|
return /* @__PURE__ */ e(
|
|
119
124
|
x,
|
|
120
125
|
{
|
|
@@ -123,10 +128,10 @@ const K = k(
|
|
|
123
128
|
justify: "center",
|
|
124
129
|
align: "center",
|
|
125
130
|
style: { position: "relative" },
|
|
126
|
-
children: /* @__PURE__ */ e(
|
|
127
|
-
|
|
131
|
+
children: /* @__PURE__ */ e(H, { label: b, withArrow: !0, children: /* @__PURE__ */ v(
|
|
132
|
+
M,
|
|
128
133
|
{
|
|
129
|
-
ref:
|
|
134
|
+
ref: a,
|
|
130
135
|
color: t ? "transparent" : r,
|
|
131
136
|
radius: s === "circle" ? "xl" : "sm",
|
|
132
137
|
styles: t ? {
|
|
@@ -136,8 +141,8 @@ const K = k(
|
|
|
136
141
|
style: {
|
|
137
142
|
cursor: "pointer",
|
|
138
143
|
color: "var(--mantine-color-white)",
|
|
139
|
-
background: t ?
|
|
140
|
-
border: t ? `2px solid ${
|
|
144
|
+
background: t ? u || `var(--mantine-color-${o}-light, ${r}20)` : void 0,
|
|
145
|
+
border: t ? `2px solid ${p || `var(--mantine-color-${o}-outline, ${r})`}` : void 0
|
|
141
146
|
},
|
|
142
147
|
...i,
|
|
143
148
|
children: [
|
|
@@ -157,23 +162,23 @@ const K = k(
|
|
|
157
162
|
}
|
|
158
163
|
}
|
|
159
164
|
),
|
|
160
|
-
|
|
165
|
+
d && n && /* @__PURE__ */ e(D, { size: 20, icon: R })
|
|
161
166
|
]
|
|
162
167
|
}
|
|
163
168
|
) })
|
|
164
169
|
}
|
|
165
170
|
);
|
|
166
171
|
}
|
|
167
|
-
),
|
|
172
|
+
), W = B(L)`
|
|
168
173
|
.mantine-ColorSwatch-colorOverlay {
|
|
169
174
|
border-radius: ${({ swatchShape: o }) => o === "square" ? "3px" : "50%"};
|
|
170
175
|
}
|
|
171
|
-
`,
|
|
172
|
-
ColorCircle:
|
|
173
|
-
List:
|
|
174
|
-
Toolbar:
|
|
176
|
+
`, mo = Object.assign(Q, {
|
|
177
|
+
ColorCircle: L,
|
|
178
|
+
List: G,
|
|
179
|
+
Toolbar: J
|
|
175
180
|
});
|
|
176
181
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
L as ColorCircle,
|
|
183
|
+
mo as ColorPicker
|
|
179
184
|
};
|
|
@@ -8,6 +8,7 @@ export interface ColorPickerToolbarProps {
|
|
|
8
8
|
maxRecentColors?: number;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
recentColorsLabel?: string;
|
|
11
|
+
tooltipZIndex?: number;
|
|
11
12
|
}
|
|
12
13
|
export declare const ColorPickerToolbar: import("react").ForwardRefExoticComponent<ColorPickerToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
14
|
//# sourceMappingURL=ColorPickerToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAYjE;6DAC6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAYjE;6DAC6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwCD,eAAO,MAAM,kBAAkB,oHA+M9B,CAAC"}
|
|
@@ -1,112 +1,116 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { useComputedColorScheme as
|
|
5
|
-
import { TextColorIcon as
|
|
6
|
-
import { normalizeColorItem as
|
|
7
|
-
import { useRecentColors as
|
|
8
|
-
import
|
|
9
|
-
function
|
|
10
|
-
isActive:
|
|
11
|
-
round:
|
|
12
|
-
disabled:
|
|
13
|
-
onClick:
|
|
1
|
+
import { jsxs as v, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as M, useState as O, useCallback as w, useMemo as j } from "react";
|
|
3
|
+
import { useTranslation as P } from "react-i18next";
|
|
4
|
+
import { useComputedColorScheme as U, Box as m, Flex as A, Tooltip as _, UnstyledButton as q } from "@mantine/core";
|
|
5
|
+
import { TextColorIcon as B, HighlightSwatch as E } from "./icons.js";
|
|
6
|
+
import { normalizeColorItem as L, resolveColorLabel as z, isDefaultColor as V, RECENT_COLOR_HOTKEY as Y, colorsEqual as G } from "./types.js";
|
|
7
|
+
import { useRecentColors as J } from "./useRecentColors.js";
|
|
8
|
+
import t from "./ColorPicker.module.css.js";
|
|
9
|
+
function S({
|
|
10
|
+
isActive: h,
|
|
11
|
+
round: f,
|
|
12
|
+
disabled: d,
|
|
13
|
+
onClick: b,
|
|
14
14
|
children: i,
|
|
15
|
-
tooltipLabel: p
|
|
15
|
+
tooltipLabel: p,
|
|
16
|
+
tooltipZIndex: a
|
|
16
17
|
}) {
|
|
17
|
-
const
|
|
18
|
-
|
|
18
|
+
const C = /* @__PURE__ */ r(
|
|
19
|
+
q,
|
|
19
20
|
{
|
|
20
21
|
type: "button",
|
|
21
|
-
className: `${
|
|
22
|
-
onMouseDown: (
|
|
23
|
-
onClick:
|
|
24
|
-
disabled:
|
|
22
|
+
className: `${t.inlineSwatch}${f ? ` ${t.inlineSwatchRound}` : ""}${h ? ` ${t.inlineSwatchActive}` : ""}`,
|
|
23
|
+
onMouseDown: (s) => s.preventDefault(),
|
|
24
|
+
onClick: b,
|
|
25
|
+
disabled: d,
|
|
25
26
|
children: i
|
|
26
27
|
}
|
|
27
28
|
);
|
|
28
|
-
return p ? /* @__PURE__ */
|
|
29
|
+
return p ? /* @__PURE__ */ r(_, { label: p, withArrow: !0, zIndex: a, children: C }) : C;
|
|
29
30
|
}
|
|
30
|
-
const
|
|
31
|
+
const ce = M(
|
|
31
32
|
({
|
|
32
|
-
sections:
|
|
33
|
-
onChange:
|
|
34
|
-
withRecentColors:
|
|
35
|
-
maxRecentColors:
|
|
33
|
+
sections: h,
|
|
34
|
+
onChange: f,
|
|
35
|
+
withRecentColors: d,
|
|
36
|
+
maxRecentColors: b = 10,
|
|
36
37
|
disabled: i,
|
|
37
|
-
recentColorsLabel: p
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
recentColorsLabel: p,
|
|
39
|
+
tooltipZIndex: a = 400
|
|
40
|
+
}, C) => {
|
|
41
|
+
const { t: s } = P("ui"), D = p ?? s("colorPicker.recentlyUsed"), $ = U("light", {
|
|
40
42
|
getInitialValueInEffect: !0
|
|
41
|
-
}) === "dark", { recentColors:
|
|
42
|
-
maxItems:
|
|
43
|
-
}), [
|
|
44
|
-
(e, o,
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
(
|
|
43
|
+
}) === "dark", { recentColors: H, addRecent: N } = J({
|
|
44
|
+
maxItems: b
|
|
45
|
+
}), [R, y] = O(H), k = w(
|
|
46
|
+
(e, o, n) => {
|
|
47
|
+
d && (N(e, o, n), y((l) => {
|
|
48
|
+
const c = l.filter(
|
|
49
|
+
(u) => !(u.value === e && u.sectionKey === o)
|
|
48
50
|
);
|
|
49
|
-
return [{ value: e, sectionKey: o, border:
|
|
51
|
+
return [{ value: e, sectionKey: o, border: n }, ...c].slice(
|
|
50
52
|
0,
|
|
51
|
-
|
|
53
|
+
b
|
|
52
54
|
);
|
|
53
|
-
})),
|
|
55
|
+
})), f(e, o);
|
|
54
56
|
},
|
|
55
|
-
[
|
|
56
|
-
),
|
|
57
|
+
[f, d, N]
|
|
58
|
+
), g = j(() => {
|
|
57
59
|
const e = {};
|
|
58
|
-
for (const o of
|
|
60
|
+
for (const o of h) e[o.key] = o;
|
|
59
61
|
return e;
|
|
60
|
-
}, [
|
|
62
|
+
}, [h]), I = w(
|
|
61
63
|
(e, o) => {
|
|
62
|
-
const l = (o ?
|
|
63
|
-
(
|
|
64
|
-
),
|
|
65
|
-
return
|
|
64
|
+
const l = (o ? g[o] : void 0)?.colors.find(
|
|
65
|
+
(u) => L(u).value === e
|
|
66
|
+
), c = l ? L(l).label : void 0;
|
|
67
|
+
return z(s, e, c);
|
|
66
68
|
},
|
|
67
|
-
[
|
|
68
|
-
),
|
|
69
|
-
(e) =>
|
|
70
|
-
[
|
|
69
|
+
[g, s]
|
|
70
|
+
), x = w(
|
|
71
|
+
(e) => V(e) ? $ ? "#FFFFFF" : "#000000" : e,
|
|
72
|
+
[$]
|
|
71
73
|
);
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ v(m, { ref: C, children: [
|
|
75
|
+
d && R.length > 0 && /* @__PURE__ */ v(m, { className: t.inlineSection, children: [
|
|
76
|
+
/* @__PURE__ */ v(m, { className: t.inlineSectionLabelRow, children: [
|
|
77
|
+
/* @__PURE__ */ r(m, { className: t.inlineSectionLabel, children: D }),
|
|
78
|
+
/* @__PURE__ */ r("span", { className: t.inlineSectionCaption, children: Y })
|
|
77
79
|
] }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
const
|
|
80
|
+
/* @__PURE__ */ r(A, { className: t.inlineRow, gap: 2, children: R.map((e, o) => {
|
|
81
|
+
const n = e.sectionKey ? g[e.sectionKey] : void 0, l = n?.key === "textColor" || n?.key === "color" || e.sectionKey === "color", c = I(
|
|
80
82
|
e.value,
|
|
81
83
|
e.sectionKey
|
|
82
84
|
);
|
|
83
|
-
return l ? /* @__PURE__ */
|
|
84
|
-
|
|
85
|
+
return l ? /* @__PURE__ */ r(
|
|
86
|
+
S,
|
|
85
87
|
{
|
|
86
88
|
isActive: !1,
|
|
87
89
|
disabled: i,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
tooltipZIndex: a,
|
|
91
|
+
tooltipLabel: c,
|
|
92
|
+
onClick: () => k(e.value, e.sectionKey ?? ""),
|
|
93
|
+
children: /* @__PURE__ */ r(
|
|
94
|
+
B,
|
|
92
95
|
{
|
|
93
96
|
size: 20,
|
|
94
|
-
color:
|
|
97
|
+
color: x(e.value),
|
|
95
98
|
showBorder: !0
|
|
96
99
|
}
|
|
97
100
|
)
|
|
98
101
|
},
|
|
99
102
|
`${e.sectionKey}-${e.value}-${o}`
|
|
100
|
-
) : /* @__PURE__ */
|
|
101
|
-
|
|
103
|
+
) : /* @__PURE__ */ r(
|
|
104
|
+
S,
|
|
102
105
|
{
|
|
103
106
|
isActive: !1,
|
|
104
107
|
round: !0,
|
|
105
108
|
disabled: i,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
tooltipZIndex: a,
|
|
110
|
+
tooltipLabel: c,
|
|
111
|
+
onClick: () => k(e.value, e.sectionKey ?? ""),
|
|
112
|
+
children: /* @__PURE__ */ r(
|
|
113
|
+
E,
|
|
110
114
|
{
|
|
111
115
|
bgColor: e.value,
|
|
112
116
|
borderColor: e.border || "var(--mantine-color-default-border)"
|
|
@@ -117,37 +121,39 @@ const re = y(
|
|
|
117
121
|
);
|
|
118
122
|
}) })
|
|
119
123
|
] }),
|
|
120
|
-
|
|
124
|
+
h.map((e) => {
|
|
121
125
|
const o = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
e.label && /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
const { value: l, border:
|
|
126
|
-
return o ? /* @__PURE__ */
|
|
127
|
-
|
|
126
|
+
return /* @__PURE__ */ v(m, { className: t.inlineSection, children: [
|
|
127
|
+
e.label && /* @__PURE__ */ r(m, { className: t.inlineSectionLabel, children: e.label }),
|
|
128
|
+
/* @__PURE__ */ r(A, { className: t.inlineRow, gap: 2, children: e.colors.map((n) => {
|
|
129
|
+
const { value: l, border: c, label: u } = L(n), F = G(l, e.value), T = x(l), K = z(s, l, u);
|
|
130
|
+
return o ? /* @__PURE__ */ r(
|
|
131
|
+
S,
|
|
128
132
|
{
|
|
129
|
-
isActive:
|
|
133
|
+
isActive: F,
|
|
130
134
|
round: !0,
|
|
131
135
|
disabled: i,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
tooltipZIndex: a,
|
|
137
|
+
tooltipLabel: K,
|
|
138
|
+
onClick: () => k(l, e.key, c),
|
|
139
|
+
children: /* @__PURE__ */ r(
|
|
140
|
+
E,
|
|
136
141
|
{
|
|
137
142
|
bgColor: l,
|
|
138
|
-
borderColor:
|
|
143
|
+
borderColor: c || T
|
|
139
144
|
}
|
|
140
145
|
)
|
|
141
146
|
},
|
|
142
147
|
l
|
|
143
|
-
) : /* @__PURE__ */
|
|
144
|
-
|
|
148
|
+
) : /* @__PURE__ */ r(
|
|
149
|
+
S,
|
|
145
150
|
{
|
|
146
|
-
isActive:
|
|
151
|
+
isActive: F,
|
|
147
152
|
disabled: i,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
153
|
+
tooltipZIndex: a,
|
|
154
|
+
tooltipLabel: K,
|
|
155
|
+
onClick: () => k(l, e.key),
|
|
156
|
+
children: /* @__PURE__ */ r(B, { size: 20, color: T, showBorder: !0 })
|
|
151
157
|
},
|
|
152
158
|
l
|
|
153
159
|
);
|
|
@@ -158,5 +164,5 @@ const re = y(
|
|
|
158
164
|
}
|
|
159
165
|
);
|
|
160
166
|
export {
|
|
161
|
-
|
|
167
|
+
ce as ColorPickerToolbar
|
|
162
168
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommentComposerTypes } from './types';
|
|
3
|
-
export declare const CommentEditorHandler: ({ children, onSubmit, editorRef, commentDraft, onBlur, inputContainerRef, isFloat, isEdit, hasChanges, ns, }: {
|
|
3
|
+
export declare const CommentEditorHandler: ({ children, onSubmit, editorRef, commentDraft, onBlur, inputContainerRef, isFloat, isEdit, hasChanges, ns, forceAutoFocus, }: {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
onSubmit: () => void;
|
|
6
6
|
editorRef: React.MutableRefObject<any>;
|
|
@@ -14,5 +14,6 @@ export declare const CommentEditorHandler: ({ children, onSubmit, editorRef, com
|
|
|
14
14
|
isEdit: boolean;
|
|
15
15
|
hasChanges: boolean;
|
|
16
16
|
ns: string;
|
|
17
|
+
forceAutoFocus?: boolean;
|
|
17
18
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
//# sourceMappingURL=CommentEditorHotkeys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentEditorHotkeys.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentEditorHotkeys.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,eAAO,MAAM,oBAAoB,GAAI,
|
|
1
|
+
{"version":3,"file":"CommentEditorHotkeys.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentEditorHotkeys.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,eAAO,MAAM,oBAAoB,GAAI,8HAYlC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvC,iBAAiB,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC/C,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,EAAE,CAAC;KACjD,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,4CA6KA,CAAC"}
|
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as T, useEffect as u } from "react";
|
|
3
3
|
import { useTranslation as k } from "react-i18next";
|
|
4
4
|
import { openRemoveConfirmModal as P } from "../modals/RemoveConfirmModal.js";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import v from "./CommentComposer.module.css.js";
|
|
6
|
+
const W = ({
|
|
7
7
|
children: b,
|
|
8
8
|
onSubmit: E,
|
|
9
|
-
editorRef:
|
|
9
|
+
editorRef: a,
|
|
10
10
|
commentDraft: f,
|
|
11
11
|
onBlur: c,
|
|
12
12
|
inputContainerRef: p,
|
|
13
|
-
isFloat:
|
|
13
|
+
isFloat: w,
|
|
14
14
|
isEdit: i,
|
|
15
15
|
hasChanges: s,
|
|
16
|
-
ns:
|
|
16
|
+
ns: L,
|
|
17
|
+
forceAutoFocus: S
|
|
17
18
|
}) => {
|
|
18
|
-
const d =
|
|
19
|
+
const d = T(null), g = i || w || S, { t: r } = k(L);
|
|
19
20
|
return u(() => {
|
|
20
21
|
const t = (e) => {
|
|
21
22
|
if (e.code === "Enter" && !e.shiftKey) {
|
|
22
|
-
if (e.stopPropagation(), i ? s : !s) return;
|
|
23
|
+
if (document.querySelector('[id^="mention-item-"]') || (e.stopPropagation(), i ? s : !s)) return;
|
|
23
24
|
d.current && d.current.contains(document.activeElement) && (e.preventDefault(), E());
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
27
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
27
28
|
}, [E, i, s]), u(() => {
|
|
28
|
-
if (!
|
|
29
|
-
const t =
|
|
30
|
-
|
|
29
|
+
if (!g) return;
|
|
30
|
+
const t = a.current;
|
|
31
|
+
if (!t) return;
|
|
32
|
+
const e = window.setTimeout(() => {
|
|
31
33
|
t.focus(() => ({ defaultSelection: "rootEnd" }));
|
|
32
34
|
}, 100);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
return () => window.clearTimeout(e);
|
|
36
|
+
}, [g]), u(() => {
|
|
37
|
+
const t = a.current;
|
|
35
38
|
if (!t) return;
|
|
36
39
|
const e = () => setTimeout(() => {
|
|
37
40
|
t.focus(() => ({ defaultSelection: "rootEnd" }));
|
|
38
|
-
}, 0), o = (
|
|
39
|
-
const n =
|
|
41
|
+
}, 0), o = (m) => {
|
|
42
|
+
const n = m.target;
|
|
40
43
|
if (!n || n.closest("button") || n.closest("[data-no-focus]")) return;
|
|
41
44
|
if (n.closest("[data-editor-spacer='true']")) {
|
|
42
45
|
e();
|
|
43
46
|
return;
|
|
44
47
|
}
|
|
45
|
-
const l = n.closest(`.${
|
|
48
|
+
const l = n.closest(`.${v.commentComposerWrapper}`);
|
|
46
49
|
if (!l) return;
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
l.querySelector(`.${
|
|
50
|
+
const y = l.querySelector("[data-comment-footer]");
|
|
51
|
+
if (!y || !y.contains(n)) return;
|
|
52
|
+
l.querySelector(`.${v.imagePreviewWrapper}`) || l.querySelector(`.${v.filePreviewWrapper}`) || e();
|
|
50
53
|
};
|
|
51
54
|
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
52
|
-
}, [
|
|
55
|
+
}, [a]), u(() => {
|
|
53
56
|
const t = d.current;
|
|
54
57
|
if (!t) return;
|
|
55
58
|
const e = () => {
|
|
@@ -62,8 +65,8 @@ const M = ({
|
|
|
62
65
|
const t = (e) => {
|
|
63
66
|
const o = e.target;
|
|
64
67
|
if (!o) return;
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
68
|
+
const m = p.current;
|
|
69
|
+
if (m && !m.contains(o) && !(o.closest(".mantine-Modal-root") || o.closest(".floating-text-format-popup") || o.closest('[data-test-id="floating-link-dropdown"]'))) {
|
|
67
70
|
if (i) {
|
|
68
71
|
if (!s) {
|
|
69
72
|
e.stopPropagation(), e.preventDefault(), P({
|
|
@@ -84,7 +87,7 @@ const M = ({
|
|
|
84
87
|
c?.();
|
|
85
88
|
return;
|
|
86
89
|
}
|
|
87
|
-
if (
|
|
90
|
+
if (w) {
|
|
88
91
|
if (f.text.trim() !== "" || (f.files?.length ?? 0) > 0) {
|
|
89
92
|
e.stopPropagation(), e.preventDefault(), P({
|
|
90
93
|
title: r("editor.composer.discardCommentTitle"),
|
|
@@ -106,8 +109,8 @@ const M = ({
|
|
|
106
109
|
}
|
|
107
110
|
};
|
|
108
111
|
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
109
|
-
}, [i,
|
|
112
|
+
}, [i, w, s, f, c]), /* @__PURE__ */ C("div", { ref: d, children: b });
|
|
110
113
|
};
|
|
111
114
|
export {
|
|
112
|
-
|
|
115
|
+
W as CommentEditorHandler
|
|
113
116
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CommentComposerProps } from './types';
|
|
2
|
-
export declare const CommentComposer: ({ children, onSubmit, initialDraft, updateLocation, onBlur, setEdit, ns, }: CommentComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const CommentComposer: ({ children, onSubmit, initialDraft, updateLocation, onBlur, setEdit, ns, autoFocus, }: CommentComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|