@layers-app/shared 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CommentComposer/index.d.ts +52 -0
- package/dist/components/CommentsPanel/components/CommentActions.d.ts +16 -0
- package/dist/components/CommentsPanel/components/CommentFilterMenu.d.ts +6 -0
- package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +22 -0
- package/dist/components/CommentsPanel/components/CommentsEmptyPlaceholder.d.ts +3 -0
- package/dist/components/CommentsPanel/components/CommentsFilterHeader.d.ts +3 -0
- package/dist/components/CommentsPanel/components/CommentsListItemMenu.d.ts +6 -0
- package/dist/components/CommentsPanel/components/CommentsMultiSelectUsers.d.ts +6 -0
- package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +19 -0
- package/dist/components/CommentsPanel/components/CommentsThreadReplyControls.d.ts +10 -0
- package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +5 -0
- package/dist/components/CommentsPanel/components/Icon.d.ts +8 -0
- package/dist/components/CommentsPanel/components/RemoveConfirmModal.d.ts +11 -0
- package/dist/components/CommentsPanel/index.d.ts +21 -0
- package/dist/components/CommentsPanel/store.d.ts +19 -0
- package/dist/components/CommentsPanel/types.d.ts +243 -0
- package/dist/components/CommentsPanel/utils.d.ts +8 -0
- package/dist/helpers/getFileIcons.d.ts +1 -0
- package/dist/helpers/getFileType.d.ts +1 -0
- package/dist/index-Bz8Yenv3.js +75975 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +102 -46106
- package/dist/index.umd.cjs +269 -77
- package/dist/layers.C5oAiCeN-DZQs9zcO.js +288 -0
- package/dist/layers.CovbS90x-CThbTGYw.js +52 -0
- package/dist/layers.CsuN1Q94-BT7000dw.js +170 -0
- package/dist/layers.DETHwCxI-BvdKGW_B.js +281 -0
- package/dist/layers.vNINlb5t-Bef3Moef.js +289 -0
- package/package.json +2 -2
|
@@ -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,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,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface CommentsThreadReplyControlsProps {
|
|
3
|
+
onSubmit: () => void;
|
|
4
|
+
handleFileChange: (files: File[]) => void;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
isSubmitting: boolean;
|
|
7
|
+
setIsSubmitting: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
|
+
}
|
|
9
|
+
export declare const CommentsThreadReplyControls: ({ onSubmit, handleFileChange, disabled, setIsSubmitting, isSubmitting, }: CommentsThreadReplyControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
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,21 @@
|
|
|
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
|
+
}
|
|
20
|
+
export declare function CommentsPanel({ activeIDs, deleteCommentOrThread, comments, submitAddComment, markNodeMap, storeOptions, deleteCommentImage, addCommentReaction, removeCommentReactions, updateCommentTextOrImage, listRef, resolveThreat, updateThreadId, getEditor, }: CommentsPanelProps): ReactElement;
|
|
21
|
+
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,243 @@
|
|
|
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
|
+
onSuccess?: (data: any) => void;
|
|
193
|
+
}
|
|
194
|
+
export interface IGetReactionsParams {
|
|
195
|
+
commentId: string;
|
|
196
|
+
}
|
|
197
|
+
export interface IGetPhotosParams {
|
|
198
|
+
commentId: string;
|
|
199
|
+
}
|
|
200
|
+
interface IUploadCommentFileParams {
|
|
201
|
+
file: File;
|
|
202
|
+
commentId: string;
|
|
203
|
+
onSuccess?: (data: any) => void;
|
|
204
|
+
}
|
|
205
|
+
interface ICommentActions {
|
|
206
|
+
fetchCommentsApi: (params: IFetchCommentsParams) => Promise<void>;
|
|
207
|
+
resolveCommentApi: (params: IResolveCommentParams) => Promise<void>;
|
|
208
|
+
commentReactionApi: (params: ICommentReactionParams) => Promise<void>;
|
|
209
|
+
deleteReactionApi: (params: IDeleteReactionParams) => Promise<void>;
|
|
210
|
+
deleteCommentApi: (params: IDeleteCommentParams) => Promise<void>;
|
|
211
|
+
restoreCommentApi: (params: IRestoreCommentParams) => Promise<void>;
|
|
212
|
+
updateCommentTextApi: (params: IUpdateCommentTextParams) => Promise<void>;
|
|
213
|
+
deleteCommentImageApi: (params: IDeleteCommentImageParams) => Promise<void>;
|
|
214
|
+
submitCommentApi: (params: ISubmitCommentParams) => Promise<void>;
|
|
215
|
+
getReactionsApi: (params: IGetReactionsParams) => Promise<{
|
|
216
|
+
content: ICommentReaction[];
|
|
217
|
+
}>;
|
|
218
|
+
getPhotosApi: (params: IGetPhotosParams) => Promise<File[]>;
|
|
219
|
+
uploadCommentFileApi: (params: IUploadCommentFileParams) => Promise<void>;
|
|
220
|
+
}
|
|
221
|
+
export interface ICommentOptions {
|
|
222
|
+
showComments: boolean;
|
|
223
|
+
setShowComments: (value?: boolean) => void;
|
|
224
|
+
pageId: string;
|
|
225
|
+
workspaceInfo: {
|
|
226
|
+
title: string;
|
|
227
|
+
icon: string;
|
|
228
|
+
};
|
|
229
|
+
commentActions: ICommentActions;
|
|
230
|
+
}
|
|
231
|
+
export interface SharedCommentProps {
|
|
232
|
+
commentOrThread: Comment | Thread | GeneralComment;
|
|
233
|
+
deleteCommentOrThread: (commentOrThread: Comment | Thread, thread?: Thread) => void;
|
|
234
|
+
resolveThreat?: (threat: Thread | GeneralComment) => void;
|
|
235
|
+
}
|
|
236
|
+
type SelectMarkNodeFn = (markNodeKeys: Set<string>, activeElement: Element | null) => void;
|
|
237
|
+
export interface StoreOptions {
|
|
238
|
+
currentUser?: IUser;
|
|
239
|
+
workspaceMembers?: IMember[] | undefined;
|
|
240
|
+
commentOptions?: ICommentOptions;
|
|
241
|
+
selectMarkNode: SelectMarkNodeFn;
|
|
242
|
+
}
|
|
243
|
+
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 @@
|
|
|
1
|
+
export declare const getFileIcons: (fileType: string, isFolder?: boolean, size?: number) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getFileType: (mimeType: string) => "other" | "media" | "documents" | "folder" | "diagram" | "archieve";
|