@layers-app/shared 0.0.29 → 0.0.33

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.
Files changed (91) hide show
  1. package/dist/KanbanLayout-3P7jU91D.js +287 -0
  2. package/dist/TimeLine-DNEQAsfm.js +198 -0
  3. package/dist/api/giphy/slice.d.ts +1 -1
  4. package/dist/api/unsplash/slice.d.ts +1 -1
  5. package/dist/assets/jsons/emoji-categorized.json.d.ts +3 -0
  6. package/dist/assets/jsons/icons.min.json.d.ts +3 -0
  7. package/dist/components/AlertsBlock/index.d.ts +0 -1
  8. package/dist/components/AppContainer/AppContainer.d.ts +4 -10
  9. package/dist/components/AppContainer/components/AllAppsMenu.d.ts +2 -1
  10. package/dist/components/AppContainer/components/DesktopNavbar.d.ts +1 -1
  11. package/dist/components/AppContainer/components/MobileNavbar.d.ts +1 -1
  12. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  13. package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts +1 -1
  14. package/dist/components/AppContainer/types.d.ts +4 -0
  15. package/dist/components/AttachmentsGalleryModal/ImageModal.d.ts +0 -1
  16. package/dist/components/BottomDrawerWithoutHeader/index.d.ts +16 -0
  17. package/dist/components/ColorPicker/ColorPicker.d.ts +3 -3
  18. package/dist/components/CommentComposer/index.d.ts +52 -0
  19. package/dist/components/CommentsPanel/components/CommentActions.d.ts +16 -0
  20. package/dist/components/CommentsPanel/components/CommentFilterMenu.d.ts +6 -0
  21. package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +22 -0
  22. package/dist/components/CommentsPanel/components/CommentsEmptyPlaceholder.d.ts +3 -0
  23. package/dist/components/CommentsPanel/components/CommentsFilterHeader.d.ts +3 -0
  24. package/dist/components/CommentsPanel/components/CommentsListItemMenu.d.ts +6 -0
  25. package/dist/components/CommentsPanel/components/CommentsMultiSelectUsers.d.ts +6 -0
  26. package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +19 -0
  27. package/dist/components/CommentsPanel/components/CommentsThreadReplyControls.d.ts +11 -0
  28. package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +5 -0
  29. package/dist/components/CommentsPanel/components/Icon.d.ts +8 -0
  30. package/dist/components/CommentsPanel/components/RemoveConfirmModal.d.ts +11 -0
  31. package/dist/components/CommentsPanel/index.d.ts +22 -0
  32. package/dist/components/CommentsPanel/store.d.ts +19 -0
  33. package/dist/components/CommentsPanel/types.d.ts +244 -0
  34. package/dist/components/CommentsPanel/utils.d.ts +8 -0
  35. package/dist/components/CommunitiesDialog/index.d.ts +4 -0
  36. package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -2
  37. package/dist/components/EmojiPicker/IconsPanel.d.ts +2 -2
  38. package/dist/components/EmojiPicker/constants.d.ts +2 -0
  39. package/dist/components/EmojiPicker/types.d.ts +13 -0
  40. package/dist/components/ErrorPage/components/Error404.d.ts +2 -18
  41. package/dist/components/FilePicker/FilePickerUpload.d.ts +1 -1
  42. package/dist/components/InfoMenu/index.d.ts +1 -0
  43. package/dist/components/LanguagePicker/LanguagePicker.d.ts +6 -0
  44. package/dist/components/Logotype.d.ts +2 -1
  45. package/dist/components/NavbarResizer/NavbarResizer.d.ts +0 -1
  46. package/dist/components/NewColorPicker/index.d.ts +1 -1
  47. package/dist/components/NewColorPicker/types.d.ts +0 -1
  48. package/dist/components/NoData/NoData.d.ts +3 -0
  49. package/dist/components/NotPublicPanel/NotPublicPanel.d.ts +11 -0
  50. package/dist/components/OnBoarding/steps/DifferentLayouts/TimeLine.d.ts +1 -1
  51. package/dist/components/PaymentCancel/PaymentCancel.d.ts +1 -0
  52. package/dist/components/PaymentError/PaymentError.d.ts +1 -0
  53. package/dist/components/PaymentSuccess/PaymentSuccess.d.ts +1 -0
  54. package/dist/components/ProjectIcon/ProjectIcon.d.ts +6 -6
  55. package/dist/components/RichText/index.d.ts +4 -4
  56. package/dist/components/SearchFilters/components/SearchHelp.d.ts +0 -1
  57. package/dist/components/SortableList/SortableList.d.ts +4 -4
  58. package/dist/components/SortableList/components/SortableItem/SortableItem.d.ts +3 -1
  59. package/dist/components/StorageUsageEntityList/StorageEntityItem.d.ts +8 -0
  60. package/dist/components/StorageUsageEntityList/StorageUsageEntityList.d.ts +7 -0
  61. package/dist/components/StorageUsageEntityList/index.d.ts +2 -0
  62. package/dist/components/StorageUsageProgress/index.d.ts +15 -0
  63. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +1 -0
  64. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts +9 -1
  65. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts +12 -3
  66. package/dist/emoji-categorized-DAOdcF53.js +4 -0
  67. package/dist/helpers/generateLink.d.ts +1 -1
  68. package/dist/helpers/getFileIcons.d.ts +1 -0
  69. package/dist/helpers/getFileType.d.ts +1 -0
  70. package/dist/helpers/pickRandomIcon.d.ts +1 -1
  71. package/dist/hooks/useDisableWindowScroll.d.ts +1 -0
  72. package/dist/hooks/useNumberQueryParam.d.ts +1 -1
  73. package/dist/hooks/useSwipeDetect.d.ts +1 -1
  74. package/dist/icons.min-Chyr-bjL.js +4 -0
  75. package/dist/index-nUzOFDJF.js +39587 -0
  76. package/dist/index.d.ts +18 -2
  77. package/dist/index.esm-BKxri7AJ.js +6814 -0
  78. package/dist/index.js +126 -46264
  79. package/dist/index.umd.cjs +86 -800
  80. package/dist/store/discordDialogStore.d.ts +8 -0
  81. package/dist/store/plansModal.d.ts +7 -0
  82. package/dist/store/timezoneStore.d.ts +1 -1
  83. package/dist/store/workspacesOrder.d.ts +1 -1
  84. package/dist/utils/formatStorage.d.ts +6 -0
  85. package/package.json +2 -2
  86. package/dist/components/EmojiPicker/icons.json.d.ts +0 -80399
  87. package/dist/components/ErrorAlert/ErrorAlert.story.d.ts +0 -8
  88. package/dist/components/LanguagePicker/index.d.ts +0 -11
  89. package/dist/components/NewColorPicker/NewColorPicker.story.d.ts +0 -6
  90. package/dist/icons-DayTtENI.js +0 -5658
  91. package/dist/store/pageUpdateCount.d.ts +0 -12
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type AlertType = {
3
2
  trigger: any;
4
3
  message: string | React.ReactNode;
@@ -5,14 +5,8 @@ declare global {
5
5
  preSignMode?: boolean;
6
6
  }
7
7
  }
8
- export declare const AppContainer: (({ header, content, navbar, navbarTitle, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
9
- NavbarContent: ({ children }: {
10
- children?: import('react').ReactNode;
11
- }) => import("react/jsx-runtime").JSX.Element;
12
- NavbarFooter: ({ children }: {
13
- children?: import('react').ReactNode;
14
- }) => import("react/jsx-runtime").JSX.Element;
15
- NavbarHeader: ({ children }: {
16
- children?: import('react').ReactNode;
17
- }) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const AppContainer: (({ header, content, navbar, navbarTitle, displayType, footer, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
9
+ NavbarContent: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
10
+ NavbarFooter: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
11
+ NavbarHeader: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
18
12
  };
@@ -1,4 +1,5 @@
1
1
  import { ToolDef } from '../types';
2
- export declare const AllAppsMenu: ({ tools }: {
2
+ export declare const AllAppsMenu: ({ tools, radius, }: {
3
3
  tools?: ToolDef[];
4
+ radius?: number | string;
4
5
  }) => import("react/jsx-runtime").JSX.Element;
@@ -4,4 +4,4 @@ declare global {
4
4
  openTemplatesModal?: () => void;
5
5
  }
6
6
  }
7
- export declare const DesktopNavbar: (props: Pick<AppContainerProps, 'navbar' | 'navbarTitle'>) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const DesktopNavbar: (props: Pick<AppContainerProps, "navbar" | "navbarTitle" | "displayType">) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { AppContainerProps } from '../types';
2
- export declare const MobileNavbar: (props: Pick<AppContainerProps, 'navbar'>) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MobileNavbar: (props: Pick<AppContainerProps, "navbar">) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { AppContainerActionsStore, AppContainerDataStore } from '../types';
2
- export declare const useAppContainer: ({ user, workspaceMenu, tools, userMenuItems, notifications, isAnonym, readNotificationsFunc, publicMode, }: AppContainerDataStore & AppContainerActionsStore) => void;
2
+ export declare const useAppContainer: ({ user, workspaceMenu, tools, userMenuItems, notifications, isAnonym, readNotificationsFunc, publicMode, showMessenger, showNewMessage, }: AppContainerDataStore & AppContainerActionsStore) => void;
@@ -3,7 +3,7 @@ export declare const useAppContainerStore: import('zustand').UseBoundStore<Omit<
3
3
  persist: {
4
4
  setOptions: (options: Partial<import('zustand/middleware').PersistOptions<AppContainerStore, AppContainerStore>>) => void;
5
5
  clearStorage: () => void;
6
- rehydrate: () => void | Promise<void>;
6
+ rehydrate: () => Promise<void> | void;
7
7
  hasHydrated: () => boolean;
8
8
  onHydrate: (fn: (state: AppContainerStore) => void) => () => void;
9
9
  onFinishHydration: (fn: (state: AppContainerStore) => void) => () => void;
@@ -13,6 +13,8 @@ export type AppContainerProps = {
13
13
  navbar?: ReactNode;
14
14
  header?: ReactNode;
15
15
  navbarTitle?: string;
16
+ displayType?: 'ROUNDED' | 'BOXED';
17
+ footer?: ReactNode;
16
18
  };
17
19
  export type AppContainerDataStore = {
18
20
  tools: ToolDef[];
@@ -22,6 +24,8 @@ export type AppContainerDataStore = {
22
24
  notifications: UserNotifications[];
23
25
  isAnonym: boolean;
24
26
  publicMode: boolean;
27
+ showMessenger: () => void;
28
+ showNewMessage: (message: string) => void;
25
29
  };
26
30
  type ReadNotificationsRequest = {
27
31
  messageIds: number[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface ImageModalState {
3
2
  opened: boolean;
4
3
  src: string;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { DrawerProps } from '@mantine/core';
3
+ type BaseProps = Omit<DrawerProps, 'title' | 'onClose'> & {
4
+ children: React.ReactNode;
5
+ };
6
+ type WithCustomHeader = BaseProps & {
7
+ drawerHeader: React.ReactNode;
8
+ };
9
+ type WithDefaultHeader = BaseProps & {
10
+ drawerHeader?: undefined;
11
+ onClose: () => void;
12
+ onSave?: () => void;
13
+ };
14
+ type BottomDrawerWithoutHeaderProps = WithCustomHeader | WithDefaultHeader;
15
+ export declare const BottomDrawerWithoutHeader: React.FC<BottomDrawerWithoutHeaderProps>;
16
+ export {};
@@ -4,9 +4,9 @@ interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.C
4
4
  isActive?: boolean;
5
5
  }
6
6
  export declare const ColorPicker: import('react').ForwardRefExoticComponent<{
7
- value?: string | null | undefined;
8
- onChange?: ((v: string) => void) | undefined;
9
- allowCustomColor?: boolean | undefined;
7
+ value?: string | null;
8
+ onChange?: (v: string) => void;
9
+ allowCustomColor?: boolean;
10
10
  } & Omit<FlexProps, "onChange"> & import('react').RefAttributes<HTMLDivElement>> & {
11
11
  ColorCircle: import('react').ForwardRefExoticComponent<ColorCircleProps & import('react').RefAttributes<HTMLDivElement>>;
12
12
  };
@@ -0,0 +1,52 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { RangeSelection } from '@layers-app/editor';
3
+ import { Comment, GeneralComment, ICommentOptions, ICommentFile, ILocalCommentFile, IUser, Thread } from '../CommentsPanel/types.ts';
4
+ import * as React from 'react';
5
+ interface CommentValue {
6
+ value: string;
7
+ files: (ICommentFile | ILocalCommentFile)[];
8
+ }
9
+ interface CommentComposerProps {
10
+ children: ((args: {
11
+ onSubmit: () => void;
12
+ handleBlur: () => void;
13
+ autoFocus: boolean;
14
+ setCommentValue: React.Dispatch<React.SetStateAction<CommentValue>>;
15
+ commentValue: CommentValue;
16
+ registerClearEditor?: (fn: () => void) => void;
17
+ }) => React.ReactNode);
18
+ getSelectionText?: (selection: RangeSelection) => string;
19
+ removeCommentImage?: (index: string) => void;
20
+ providedUser?: IUser;
21
+ updateLocation?: (boxElem: HTMLDivElement, selectionRef: MutableRefObject<RangeSelection | null>, selectionState: {
22
+ container: HTMLDivElement;
23
+ elements: HTMLSpanElement[];
24
+ }) => void;
25
+ commentValue: {
26
+ value: string;
27
+ files: (ICommentFile | ILocalCommentFile)[];
28
+ };
29
+ setCommentValue: React.Dispatch<React.SetStateAction<{
30
+ value: string;
31
+ files: (ICommentFile | ILocalCommentFile)[];
32
+ }>>;
33
+ isEditInput?: boolean;
34
+ autoFocus?: boolean;
35
+ handleBlur: () => void;
36
+ thread?: Thread;
37
+ updateThreadId?: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
38
+ setCommentActions?: React.Dispatch<React.SetStateAction<{
39
+ replyList: string[];
40
+ editCommentId: string;
41
+ editedContent: string;
42
+ }>>;
43
+ isGeneral?: boolean;
44
+ submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
45
+ handleEditComment?: (data: {
46
+ value: string;
47
+ files: (ICommentFile | ILocalCommentFile)[];
48
+ }) => void;
49
+ provideCommentOptions?: ICommentOptions;
50
+ }
51
+ export declare const CommentComposer: ({ submitAddComment, commentValue, thread, setCommentValue, handleBlur, autoFocus, provideCommentOptions, removeCommentImage, handleEditComment, isEditInput, isGeneral, updateThreadId, setCommentActions, updateLocation, getSelectionText, children, providedUser, }: CommentComposerProps) => import("react/jsx-runtime").JSX.Element;
52
+ export {};
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { Comment, GeneralComment, SharedCommentProps, Thread } from '../types.ts';
3
+ interface CommentActionsProps extends Omit<SharedCommentProps, 'commentOrThread'> {
4
+ accepted: boolean;
5
+ showEmojiPicker: boolean;
6
+ setShowEmojiPicker: React.Dispatch<React.SetStateAction<boolean>>;
7
+ commentSelected?: boolean;
8
+ commentOrThread: Thread | GeneralComment;
9
+ handleBlur: (e: React.MouseEvent<HTMLButtonElement>) => void;
10
+ toggleRepliesInput?: (id: string, event: React.MouseEvent<HTMLElement>) => void;
11
+ handleEditClick: (comment: Comment | Thread | GeneralComment) => void;
12
+ handleReactionClick: (emoji: string) => void;
13
+ hasPermission: boolean;
14
+ }
15
+ export declare const CommentActions: React.FC<CommentActionsProps>;
16
+ export {};
@@ -0,0 +1,6 @@
1
+ import { CommentsFilter } from '../types.ts';
2
+ import * as React from 'react';
3
+ export declare const CommentFilterMenu: ({ commentsFilter, setCommentsFilter, }: {
4
+ commentsFilter: CommentsFilter;
5
+ setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { NodeKey, RangeSelection } from '@layers-app/editor';
2
+ import { TFunction } from 'i18next';
3
+ import { Comment, GeneralComment, ICommentFile, SharedCommentProps, Thread, UpdateCommentTextArgs } from '../types.ts';
4
+ import * as React from 'react';
5
+ interface ICommentPanelListItemProps extends SharedCommentProps {
6
+ t: TFunction;
7
+ deleteCommentImage: (photoToRemove: string, threadOrGeneralId: string, commentId?: string) => void;
8
+ addCommentReaction: (reaction: string, comment: Thread | GeneralComment | Comment, threatOrGeneral?: Thread | GeneralComment) => void;
9
+ removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
10
+ toggleRepliesInput: (id: string) => void;
11
+ parentThreadOrGeneral?: Thread | GeneralComment;
12
+ updateThreadId?: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
13
+ handleClickThread?: (e: React.MouseEvent<HTMLElement>) => void;
14
+ markNodeMap?: Map<string, Set<NodeKey>>;
15
+ submitAddComment?: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
16
+ updateCommentTextOrImage: UpdateCommentTextArgs;
17
+ replyInput?: string;
18
+ setShowReplyInput?: React.Dispatch<React.SetStateAction<string>>;
19
+ activeIDs?: Array<string>;
20
+ }
21
+ export declare const CommentPanelListItem: ({ commentOrThread, handleClickThread, markNodeMap, parentThreadOrGeneral, submitAddComment, removeCommentReactions, updateThreadId, addCommentReaction, deleteCommentImage, activeIDs, updateCommentTextOrImage, resolveThreat, toggleRepliesInput, t, deleteCommentOrThread, replyInput, }: ICommentPanelListItemProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const CommentsEmptyPlaceholder: ({ resolved, }: {
2
+ resolved: boolean;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ICommentsFilterProps } from '../types.ts';
2
+ import * as React from 'react';
3
+ export declare const CommentsFilterHeader: React.FC<ICommentsFilterProps>;
@@ -0,0 +1,6 @@
1
+ import { Comment, GeneralComment, Thread } from '../types.ts';
2
+ export declare const CommentsListItemMenu: ({ handleEditClick, commentOrThread, deleteCommentOrThread, }: {
3
+ handleEditClick: (comment: Comment | Thread | GeneralComment) => void;
4
+ commentOrThread: Comment | Thread | GeneralComment;
5
+ deleteCommentOrThread: (commentOrThread: Comment | Thread, thread?: Thread) => void;
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { CommentsFilter, IMember } from '../types.ts';
2
+ export declare function SearchableMultiSelect({ addUserToFilter, membersList, selectedMembers, }: {
3
+ addUserToFilter: (key: keyof CommentsFilter, member: IMember) => void;
4
+ membersList: IMember[];
5
+ selectedMembers: IMember[];
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { ReactElement } from 'react';
2
+ import { RangeSelection, NodeKey } from '@layers-app/editor';
3
+ import { Comment, Comments, GeneralComment, ICommentFile, SharedCommentProps, Thread, UpdateCommentTextArgs } from '../types.ts';
4
+ interface CommentsPanelListProps extends Omit<SharedCommentProps, 'commentOrThread'> {
5
+ activeIDs: string[];
6
+ comments: Comments;
7
+ listRef: {
8
+ current: null | HTMLUListElement;
9
+ };
10
+ updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
11
+ deleteCommentImage: (photoToRemove: string, threadOrGeneralId: string, commentId?: string) => void;
12
+ removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
13
+ addCommentReaction: (reaction: string, comment: Thread | GeneralComment | Comment, threatOrGeneral?: Thread | GeneralComment) => void;
14
+ markNodeMap: Map<string, Set<NodeKey>>;
15
+ submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
16
+ updateCommentTextOrImage: UpdateCommentTextArgs;
17
+ }
18
+ export declare function CommentsPanelList({ activeIDs, comments, deleteCommentOrThread, listRef, addCommentReaction, updateThreadId, submitAddComment, deleteCommentImage, removeCommentReactions, markNodeMap, resolveThreat, updateCommentTextOrImage, }: CommentsPanelListProps): ReactElement;
19
+ export {};
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ interface CommentsThreadReplyControlsProps {
3
+ onSubmit: () => void;
4
+ handleFileChange: (files: File[]) => void;
5
+ disabledSubmitButton: boolean;
6
+ disabledUploadButton: boolean;
7
+ isSubmitting: boolean;
8
+ setIsSubmitting: React.Dispatch<React.SetStateAction<boolean>>;
9
+ }
10
+ export declare const CommentsThreadReplyControls: ({ onSubmit, handleFileChange, disabledSubmitButton, disabledUploadButton, setIsSubmitting, isSubmitting, }: CommentsThreadReplyControlsProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ICommentFile, ILocalCommentFile } from '../types.ts';
2
+ export declare const CommentsUploadFilesPreview: ({ files, removeImage, }: {
3
+ files: Array<ICommentFile | ILocalCommentFile>;
4
+ removeImage: (index: number | string) => void;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from '@tabler/icons-react';
3
+ declare const iconsBlockTypeToBlockName: Record<string, FC<IconProps>>;
4
+ declare const Icon: ({ name, iconStyle, ...rest }: {
5
+ name: keyof typeof iconsBlockTypeToBlockName;
6
+ [key: string]: any;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export default Icon;
@@ -0,0 +1,11 @@
1
+ type RemoveConfirmModalProps = {
2
+ opened: boolean;
3
+ onClose: () => void;
4
+ onConfirm: () => void;
5
+ title: string;
6
+ description: string;
7
+ confirmLabel?: string;
8
+ cancelLabel?: string;
9
+ };
10
+ export declare const RemoveConfirmModal: ({ opened, onClose, onConfirm, title, description, confirmLabel, cancelLabel, }: RemoveConfirmModalProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,22 @@
1
+ import { ReactElement } from 'react';
2
+ import { NodeKey, RangeSelection } from '@layers-app/editor';
3
+ import { Comment, Comments, GeneralComment, GetEditorFn, ICommentFile, StoreOptions, Thread, UpdateCommentTextArgs, SharedCommentProps } from './types.ts';
4
+ interface CommentsPanelProps extends Omit<SharedCommentProps, 'commentOrThread'> {
5
+ comments: Comments;
6
+ activeIDs: string[];
7
+ storeOptions: StoreOptions;
8
+ updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
9
+ deleteCommentImage: (photoToRemove: string, threadOrGeneralId: string, commentId?: string) => void;
10
+ removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
11
+ addCommentReaction: (reaction: string, comment: Thread | GeneralComment | Comment, threatOrGeneral?: Thread | GeneralComment) => void;
12
+ updateCommentTextOrImage: UpdateCommentTextArgs;
13
+ markNodeMap: Map<string, Set<NodeKey>>;
14
+ submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
15
+ listRef: {
16
+ current: null | HTMLUListElement;
17
+ };
18
+ getEditor: GetEditorFn;
19
+ clipPath?: string;
20
+ }
21
+ export declare function CommentsPanel({ activeIDs, deleteCommentOrThread, comments, submitAddComment, markNodeMap, storeOptions, deleteCommentImage, addCommentReaction, removeCommentReactions, updateCommentTextOrImage, listRef, resolveThreat, updateThreadId, getEditor, clipPath }: CommentsPanelProps): ReactElement;
22
+ export {};
@@ -0,0 +1,19 @@
1
+ import { GetEditorFn, ICommentOptions, IMember, IUser } from './types.ts';
2
+ interface CommentsState {
3
+ workspaceMembers: IMember[];
4
+ currentUser?: IUser;
5
+ showComments: boolean;
6
+ commentOptions?: ICommentOptions;
7
+ getEditor?: GetEditorFn;
8
+ selectMarkNode?: (markNodeKeys: Set<string>, activeElement: Element | null) => void;
9
+ initializeComments: (data: {
10
+ workspaceMembers?: IMember[];
11
+ currentUser?: IUser;
12
+ showComments?: boolean;
13
+ commentOptions?: ICommentOptions;
14
+ getEditor?: GetEditorFn;
15
+ selectMarkNode?: (markNodeKeys: Set<string>, activeElement: Element | null) => void;
16
+ }) => void;
17
+ }
18
+ export declare const useCommentsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<CommentsState>>;
19
+ export {};
@@ -0,0 +1,244 @@
1
+ import * as React from 'react';
2
+ export interface ICommentReaction {
3
+ id: string;
4
+ commentId: string;
5
+ parentId: string;
6
+ parentType: 'COMMENT' | 'THREAD';
7
+ reaction: string;
8
+ userId: string;
9
+ createdAt: string;
10
+ deleted: boolean;
11
+ deletedAt: string;
12
+ version: number;
13
+ }
14
+ export interface ICommentFile extends File {
15
+ id?: string;
16
+ lastModified: number;
17
+ lastModifiedDate: Date;
18
+ name: string;
19
+ size: number;
20
+ type: string;
21
+ webkitRelativePath: string;
22
+ }
23
+ export interface ILocalCommentFile {
24
+ clientKey: string;
25
+ loading?: boolean;
26
+ file: File;
27
+ }
28
+ export type UpdateCommentTextArgs = (text: {
29
+ value: string;
30
+ restore: boolean;
31
+ }, files: {
32
+ deletedFile: ICommentFile[];
33
+ newFiles: ILocalCommentFile[];
34
+ }, threadOrGeneralId: string, commentId?: string) => void;
35
+ export type Comment = {
36
+ author: string;
37
+ content: string;
38
+ deleted: boolean;
39
+ clientKey: string;
40
+ id: string;
41
+ tempId?: string;
42
+ reactions: ICommentReaction[];
43
+ files: Array<ICommentFile | ILocalCommentFile>;
44
+ timeStamp: number;
45
+ type: 'comment';
46
+ };
47
+ export type Thread = {
48
+ children: Array<Comment>;
49
+ id: string;
50
+ quote: string;
51
+ type: 'thread';
52
+ resolve: CommentResolve;
53
+ author: string;
54
+ tempId?: string;
55
+ reactions: ICommentReaction[];
56
+ files: Array<ICommentFile | ILocalCommentFile>;
57
+ timeStamp: number;
58
+ clientKey: string;
59
+ content: string;
60
+ deleted: boolean;
61
+ };
62
+ export type GeneralComment = {
63
+ content: string;
64
+ author: string;
65
+ id: string;
66
+ tempId?: string;
67
+ quote: string;
68
+ timeStamp: number;
69
+ resolve: CommentResolve;
70
+ reactions: ICommentReaction[];
71
+ files: Array<ICommentFile | ILocalCommentFile>;
72
+ type: 'general';
73
+ clientKey: string;
74
+ children: Array<Comment>;
75
+ deleted: boolean;
76
+ };
77
+ type CommentValueType = {
78
+ value: string;
79
+ files: (ICommentFile | ILocalCommentFile)[];
80
+ };
81
+ export type GetEditorFn = (params: {
82
+ onSubmit: () => void;
83
+ handleBlur: () => void;
84
+ autoFocus: boolean;
85
+ setCommentValue: React.Dispatch<React.SetStateAction<CommentValueType>>;
86
+ commentValue?: CommentValueType;
87
+ initialContent?: string;
88
+ registerClearEditor?: (fn: () => void) => void;
89
+ }) => React.ReactNode;
90
+ export type Comments = Array<Thread | Comment | GeneralComment>;
91
+ export type CommentResolve = 'ACCEPTED' | 'REJECTED' | null;
92
+ export interface ICommentsFilterProps {
93
+ commentsFilter: CommentsFilter;
94
+ setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
95
+ disabled: boolean;
96
+ updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
97
+ commentValue: {
98
+ value: string;
99
+ files: (ICommentFile | ILocalCommentFile)[];
100
+ };
101
+ setCommentValue: React.Dispatch<React.SetStateAction<{
102
+ value: string;
103
+ files: (ICommentFile | ILocalCommentFile)[];
104
+ }>>;
105
+ submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: any | null, files?: File[]) => void;
106
+ }
107
+ export interface IMember {
108
+ accepted: boolean;
109
+ avatarUrl: string;
110
+ email: string;
111
+ expiresAt: string | null;
112
+ invitationId: string | null;
113
+ invitationToken: string | null;
114
+ name: string;
115
+ roleType: string;
116
+ roleId: string;
117
+ userId: string;
118
+ }
119
+ export interface IUser {
120
+ activeWorkspaceId: string;
121
+ createdAt: string;
122
+ darkMode: boolean;
123
+ email: string;
124
+ id: string;
125
+ lang: string;
126
+ metaData: {
127
+ cover: Record<string, any>;
128
+ about: string;
129
+ socialNetworks: any[];
130
+ fontFamily: string;
131
+ };
132
+ name: string;
133
+ nickname: string;
134
+ plan: 'FREE' | 'PRO' | 'BUSINESS' | string;
135
+ profilePicture: {
136
+ url: string;
137
+ };
138
+ timeZone: string | null;
139
+ twoFactorEnabled: boolean;
140
+ workspaces: any[];
141
+ }
142
+ export type CommentsFilter = {
143
+ resolved: boolean;
144
+ feedback: boolean;
145
+ filteredUsers: IMember[];
146
+ };
147
+ interface IFetchCommentsParams {
148
+ fetchPageComments?: boolean;
149
+ pageId: string;
150
+ fetchCommentComments?: boolean;
151
+ onSuccess: (data: any) => void;
152
+ }
153
+ interface IResolveCommentParams {
154
+ threatId: string;
155
+ resolveValue: 'ACCEPTED' | 'REJECTED';
156
+ onSuccess?: () => void;
157
+ }
158
+ interface ICommentReactionParams {
159
+ commentId: string;
160
+ author: string;
161
+ emojiValue: string;
162
+ onSuccess?: (data: ICommentReaction) => void;
163
+ onError: () => void;
164
+ }
165
+ interface IDeleteReactionParams {
166
+ reactionId: string;
167
+ onSuccess?: () => void;
168
+ onError: () => void;
169
+ }
170
+ interface IDeleteCommentParams {
171
+ deleteCommentId: string;
172
+ onSuccess?: () => void;
173
+ }
174
+ interface IRestoreCommentParams {
175
+ commentId: string;
176
+ onSuccess?: () => void;
177
+ }
178
+ interface IUpdateCommentTextParams {
179
+ commentId: string;
180
+ textValue: string;
181
+ onSuccess?: () => void;
182
+ onError?: () => void;
183
+ }
184
+ interface IDeleteCommentImageParams {
185
+ photoToRemove: string;
186
+ onSuccess?: () => void;
187
+ }
188
+ interface ISubmitCommentParams {
189
+ text: string;
190
+ parentType: string;
191
+ parentId: string;
192
+ commentType: string;
193
+ onSuccess?: (data: any) => void;
194
+ }
195
+ export interface IGetReactionsParams {
196
+ commentId: string;
197
+ }
198
+ export interface IGetPhotosParams {
199
+ commentId: string;
200
+ }
201
+ interface IUploadCommentFileParams {
202
+ file: File;
203
+ commentId: string;
204
+ onSuccess?: (data: any) => void;
205
+ }
206
+ interface ICommentActions {
207
+ fetchCommentsApi: (params: IFetchCommentsParams) => Promise<void>;
208
+ resolveCommentApi: (params: IResolveCommentParams) => Promise<void>;
209
+ commentReactionApi: (params: ICommentReactionParams) => Promise<void>;
210
+ deleteReactionApi: (params: IDeleteReactionParams) => Promise<void>;
211
+ deleteCommentApi: (params: IDeleteCommentParams) => Promise<void>;
212
+ restoreCommentApi: (params: IRestoreCommentParams) => Promise<void>;
213
+ updateCommentTextApi: (params: IUpdateCommentTextParams) => Promise<void>;
214
+ deleteCommentImageApi: (params: IDeleteCommentImageParams) => Promise<void>;
215
+ submitCommentApi: (params: ISubmitCommentParams) => Promise<void>;
216
+ getReactionsApi: (params: IGetReactionsParams) => Promise<{
217
+ content: ICommentReaction[];
218
+ }>;
219
+ getPhotosApi: (params: IGetPhotosParams) => Promise<File[]>;
220
+ uploadCommentFileApi: (params: IUploadCommentFileParams) => Promise<void>;
221
+ }
222
+ export interface ICommentOptions {
223
+ showComments: boolean;
224
+ setShowComments: (value?: boolean) => void;
225
+ pageId: string;
226
+ workspaceInfo: {
227
+ title: string;
228
+ icon: string;
229
+ };
230
+ commentActions: ICommentActions;
231
+ }
232
+ export interface SharedCommentProps {
233
+ commentOrThread: Comment | Thread | GeneralComment;
234
+ deleteCommentOrThread: (commentOrThread: Comment | Thread, thread?: Thread) => void;
235
+ resolveThreat?: (threat: Thread | GeneralComment) => void;
236
+ }
237
+ type SelectMarkNodeFn = (markNodeKeys: Set<string>, activeElement: Element | null) => void;
238
+ export interface StoreOptions {
239
+ currentUser?: IUser;
240
+ workspaceMembers?: IMember[] | undefined;
241
+ commentOptions?: ICommentOptions;
242
+ selectMarkNode: SelectMarkNodeFn;
243
+ }
244
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ICommentFile, ILocalCommentFile } from './types.ts';
2
+ import { TFunction } from 'i18next';
3
+ export declare const cutDeleteImageId: (imageSrc: string) => string;
4
+ export declare const uploadAllFiles: (commentId: string, images: ILocalCommentFile[], uploadCommentFileApi: any) => Promise<ICommentFile[]>;
5
+ export declare function scrollToTop(selector: string): void;
6
+ export declare const getDescription: (type: string, t: TFunction) => string;
7
+ export declare const getTitle: (type: string, t: TFunction) => string;
8
+ export declare const IS_APPLE: boolean;
@@ -0,0 +1,4 @@
1
+ export declare const CommunitiesDialog: ({ handleAccess, handleRemindLater, }: {
2
+ handleAccess: () => void;
3
+ handleRemindLater: () => void;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
- import { EmojiPickerProps } from './EmojiPicker';
2
- export declare const EmojiPanel: ({ locales, onChange, onClose, setRandomIcon, }: Pick<EmojiPickerProps, 'locales' | 'value' | 'onChange'> & {
1
+ import { EmojiPickerProps } from '../..';
2
+ export declare const EmojiPanel: ({ locales, onChange, onClose, setRandomIcon, }: Pick<EmojiPickerProps, "locales" | "value" | "onChange"> & {
3
3
  onClose: () => void;
4
4
  setRandomIcon: (icon: string) => void;
5
5
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { EmojiPickerProps } from './EmojiPicker';
2
- export declare const IconsPanel: ({ showColors, locales, onChange, value, onClose, }: Pick<EmojiPickerProps, 'locales' | 'showColors' | 'value' | 'onChange'> & {
2
+ export declare const IconsPanel: import('react').MemoExoticComponent<({ showColors, locales, onChange, value, onClose, }: Pick<EmojiPickerProps, "locales" | "showColors" | "value" | "onChange"> & {
3
3
  onClose: () => void;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,2 @@
1
+ export declare const excludeCategories: string[];
2
+ export declare const frequentEmoji: string[];
@@ -0,0 +1,13 @@
1
+ export interface IEmojiItem {
2
+ i: string;
3
+ e: {
4
+ e: string;
5
+ n: string;
6
+ k: string;
7
+ }[];
8
+ }
9
+ export interface IEmoji {
10
+ e: string;
11
+ n: string;
12
+ k: string;
13
+ }