@layers-app/shared 0.0.26 → 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 +7 -7
- package/dist/components/CommentsPanel/components/CommentFilterMenu.d.ts +1 -2
- package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +4 -4
- package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +3 -3
- package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +3 -3
- package/dist/components/CommentsPanel/index.d.ts +4 -4
- package/dist/components/CommentsPanel/types.d.ts +13 -13
- package/dist/components/CommentsPanel/utils.d.ts +2 -2
- package/dist/helpers/getFileIcons.d.ts +1 -0
- package/dist/helpers/getFileType.d.ts +1 -0
- package/dist/{index-Vul891jq.js → index-Bz8Yenv3.js} +27508 -19863
- package/dist/index.d.ts +3 -0
- package/dist/index.js +87 -84
- package/dist/index.umd.cjs +150 -147
- 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.DRxNz4Ly-Cp9JbXSH.js → layers.DETHwCxI-BvdKGW_B.js} +74 -74
- package/dist/layers.vNINlb5t-Bef3Moef.js +289 -0
- package/package.json +2 -2
- package/dist/layers.Cv0RBArs-D32HURxV.js +0 -343
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
2
|
import { RangeSelection } from '@layers-app/editor';
|
|
3
|
-
import { Comment, GeneralComment, ICommentOptions,
|
|
3
|
+
import { Comment, GeneralComment, ICommentOptions, ICommentFile, ILocalCommentFile, IUser, Thread } from '../CommentsPanel/types.ts';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
interface CommentValue {
|
|
6
6
|
value: string;
|
|
7
|
-
|
|
7
|
+
files: (ICommentFile | ILocalCommentFile)[];
|
|
8
8
|
}
|
|
9
9
|
interface CommentComposerProps {
|
|
10
10
|
children: ((args: {
|
|
@@ -24,27 +24,27 @@ interface CommentComposerProps {
|
|
|
24
24
|
}) => void;
|
|
25
25
|
commentValue: {
|
|
26
26
|
value: string;
|
|
27
|
-
|
|
27
|
+
files: (ICommentFile | ILocalCommentFile)[];
|
|
28
28
|
};
|
|
29
29
|
setCommentValue: React.Dispatch<React.SetStateAction<{
|
|
30
30
|
value: string;
|
|
31
|
-
|
|
31
|
+
files: (ICommentFile | ILocalCommentFile)[];
|
|
32
32
|
}>>;
|
|
33
33
|
isEditInput?: boolean;
|
|
34
34
|
autoFocus?: boolean;
|
|
35
35
|
handleBlur: () => void;
|
|
36
36
|
thread?: Thread;
|
|
37
|
-
updateThreadId?: (tempId: string, realId: string, updatedAt: string, commentType: string,
|
|
37
|
+
updateThreadId?: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
|
|
38
38
|
setCommentActions?: React.Dispatch<React.SetStateAction<{
|
|
39
39
|
replyList: string[];
|
|
40
40
|
editCommentId: string;
|
|
41
41
|
editedContent: string;
|
|
42
42
|
}>>;
|
|
43
43
|
isGeneral?: boolean;
|
|
44
|
-
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null,
|
|
44
|
+
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
|
|
45
45
|
handleEditComment?: (data: {
|
|
46
46
|
value: string;
|
|
47
|
-
|
|
47
|
+
files: (ICommentFile | ILocalCommentFile)[];
|
|
48
48
|
}) => void;
|
|
49
49
|
provideCommentOptions?: ICommentOptions;
|
|
50
50
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CommentsFilter } from '../types.ts';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
export declare const CommentFilterMenu: ({ commentsFilter, setCommentsFilter,
|
|
3
|
+
export declare const CommentFilterMenu: ({ commentsFilter, setCommentsFilter, }: {
|
|
4
4
|
commentsFilter: CommentsFilter;
|
|
5
5
|
setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
|
|
6
|
-
disabled: boolean;
|
|
7
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { NodeKey, RangeSelection } from '@layers-app/editor';
|
|
1
2
|
import { TFunction } from 'i18next';
|
|
2
|
-
import {
|
|
3
|
-
import { Comment, GeneralComment, ICommentPhoto, SharedCommentProps, Thread, UpdateCommentTextArgs } from '../types.ts';
|
|
3
|
+
import { Comment, GeneralComment, ICommentFile, SharedCommentProps, Thread, UpdateCommentTextArgs } from '../types.ts';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
interface ICommentPanelListItemProps extends SharedCommentProps {
|
|
6
6
|
t: TFunction;
|
|
@@ -9,10 +9,10 @@ interface ICommentPanelListItemProps extends SharedCommentProps {
|
|
|
9
9
|
removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
|
|
10
10
|
toggleRepliesInput: (id: string) => void;
|
|
11
11
|
parentThreadOrGeneral?: Thread | GeneralComment;
|
|
12
|
-
updateThreadId?: (tempId: string, realId: string, updatedAt: string, commentType: string,
|
|
12
|
+
updateThreadId?: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
|
|
13
13
|
handleClickThread?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
14
14
|
markNodeMap?: Map<string, Set<NodeKey>>;
|
|
15
|
-
submitAddComment?: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null,
|
|
15
|
+
submitAddComment?: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
|
|
16
16
|
updateCommentTextOrImage: UpdateCommentTextArgs;
|
|
17
17
|
replyInput?: string;
|
|
18
18
|
setShowReplyInput?: React.Dispatch<React.SetStateAction<string>>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { RangeSelection, NodeKey } from '@layers-app/editor';
|
|
3
|
-
import { Comment, Comments, GeneralComment,
|
|
3
|
+
import { Comment, Comments, GeneralComment, ICommentFile, SharedCommentProps, Thread, UpdateCommentTextArgs } from '../types.ts';
|
|
4
4
|
interface CommentsPanelListProps extends Omit<SharedCommentProps, 'commentOrThread'> {
|
|
5
5
|
activeIDs: string[];
|
|
6
6
|
comments: Comments;
|
|
7
7
|
listRef: {
|
|
8
8
|
current: null | HTMLUListElement;
|
|
9
9
|
};
|
|
10
|
-
updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string,
|
|
10
|
+
updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
|
|
11
11
|
deleteCommentImage: (photoToRemove: string, threadOrGeneralId: string, commentId?: string) => void;
|
|
12
12
|
removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
|
|
13
13
|
addCommentReaction: (reaction: string, comment: Thread | GeneralComment | Comment, threatOrGeneral?: Thread | GeneralComment) => void;
|
|
14
14
|
markNodeMap: Map<string, Set<NodeKey>>;
|
|
15
|
-
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null,
|
|
15
|
+
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
|
|
16
16
|
updateCommentTextOrImage: UpdateCommentTextArgs;
|
|
17
17
|
}
|
|
18
18
|
export declare function CommentsPanelList({ activeIDs, comments, deleteCommentOrThread, listRef, addCommentReaction, updateThreadId, submitAddComment, deleteCommentImage, removeCommentReactions, markNodeMap, resolveThreat, updateCommentTextOrImage, }: CommentsPanelListProps): ReactElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const CommentsUploadFilesPreview: ({
|
|
3
|
-
|
|
1
|
+
import { ICommentFile, ILocalCommentFile } from '../types.ts';
|
|
2
|
+
export declare const CommentsUploadFilesPreview: ({ files, removeImage, }: {
|
|
3
|
+
files: Array<ICommentFile | ILocalCommentFile>;
|
|
4
4
|
removeImage: (index: number | string) => void;
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Comment, Comments, GeneralComment, GetEditorFn,
|
|
2
|
+
import { NodeKey, RangeSelection } from '@layers-app/editor';
|
|
3
|
+
import { Comment, Comments, GeneralComment, GetEditorFn, ICommentFile, StoreOptions, Thread, UpdateCommentTextArgs, SharedCommentProps } from './types.ts';
|
|
4
4
|
interface CommentsPanelProps extends Omit<SharedCommentProps, 'commentOrThread'> {
|
|
5
5
|
comments: Comments;
|
|
6
6
|
activeIDs: string[];
|
|
7
7
|
storeOptions: StoreOptions;
|
|
8
|
-
updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string,
|
|
8
|
+
updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
|
|
9
9
|
deleteCommentImage: (photoToRemove: string, threadOrGeneralId: string, commentId?: string) => void;
|
|
10
10
|
removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
|
|
11
11
|
addCommentReaction: (reaction: string, comment: Thread | GeneralComment | Comment, threatOrGeneral?: Thread | GeneralComment) => void;
|
|
12
12
|
updateCommentTextOrImage: UpdateCommentTextArgs;
|
|
13
13
|
markNodeMap: Map<string, Set<NodeKey>>;
|
|
14
|
-
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null,
|
|
14
|
+
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
|
|
15
15
|
listRef: {
|
|
16
16
|
current: null | HTMLUListElement;
|
|
17
17
|
};
|
|
@@ -11,7 +11,7 @@ export interface ICommentReaction {
|
|
|
11
11
|
deletedAt: string;
|
|
12
12
|
version: number;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface ICommentFile extends File {
|
|
15
15
|
id?: string;
|
|
16
16
|
lastModified: number;
|
|
17
17
|
lastModifiedDate: Date;
|
|
@@ -20,7 +20,7 @@ export interface ICommentPhoto extends File {
|
|
|
20
20
|
type: string;
|
|
21
21
|
webkitRelativePath: string;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface ILocalCommentFile {
|
|
24
24
|
clientKey: string;
|
|
25
25
|
loading?: boolean;
|
|
26
26
|
file: File;
|
|
@@ -28,9 +28,9 @@ export interface ILocalCommentPhoto {
|
|
|
28
28
|
export type UpdateCommentTextArgs = (text: {
|
|
29
29
|
value: string;
|
|
30
30
|
restore: boolean;
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
}, files: {
|
|
32
|
+
deletedFile: ICommentFile[];
|
|
33
|
+
newFiles: ILocalCommentFile[];
|
|
34
34
|
}, threadOrGeneralId: string, commentId?: string) => void;
|
|
35
35
|
export type Comment = {
|
|
36
36
|
author: string;
|
|
@@ -40,7 +40,7 @@ export type Comment = {
|
|
|
40
40
|
id: string;
|
|
41
41
|
tempId?: string;
|
|
42
42
|
reactions: ICommentReaction[];
|
|
43
|
-
|
|
43
|
+
files: Array<ICommentFile | ILocalCommentFile>;
|
|
44
44
|
timeStamp: number;
|
|
45
45
|
type: 'comment';
|
|
46
46
|
};
|
|
@@ -53,7 +53,7 @@ export type Thread = {
|
|
|
53
53
|
author: string;
|
|
54
54
|
tempId?: string;
|
|
55
55
|
reactions: ICommentReaction[];
|
|
56
|
-
|
|
56
|
+
files: Array<ICommentFile | ILocalCommentFile>;
|
|
57
57
|
timeStamp: number;
|
|
58
58
|
clientKey: string;
|
|
59
59
|
content: string;
|
|
@@ -68,7 +68,7 @@ export type GeneralComment = {
|
|
|
68
68
|
timeStamp: number;
|
|
69
69
|
resolve: CommentResolve;
|
|
70
70
|
reactions: ICommentReaction[];
|
|
71
|
-
|
|
71
|
+
files: Array<ICommentFile | ILocalCommentFile>;
|
|
72
72
|
type: 'general';
|
|
73
73
|
clientKey: string;
|
|
74
74
|
children: Array<Comment>;
|
|
@@ -76,7 +76,7 @@ export type GeneralComment = {
|
|
|
76
76
|
};
|
|
77
77
|
type CommentValueType = {
|
|
78
78
|
value: string;
|
|
79
|
-
|
|
79
|
+
files: (ICommentFile | ILocalCommentFile)[];
|
|
80
80
|
};
|
|
81
81
|
export type GetEditorFn = (params: {
|
|
82
82
|
onSubmit: () => void;
|
|
@@ -93,16 +93,16 @@ export interface ICommentsFilterProps {
|
|
|
93
93
|
commentsFilter: CommentsFilter;
|
|
94
94
|
setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
|
|
95
95
|
disabled: boolean;
|
|
96
|
-
updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string,
|
|
96
|
+
updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
|
|
97
97
|
commentValue: {
|
|
98
98
|
value: string;
|
|
99
|
-
|
|
99
|
+
files: (ICommentFile | ILocalCommentFile)[];
|
|
100
100
|
};
|
|
101
101
|
setCommentValue: React.Dispatch<React.SetStateAction<{
|
|
102
102
|
value: string;
|
|
103
|
-
|
|
103
|
+
files: (ICommentFile | ILocalCommentFile)[];
|
|
104
104
|
}>>;
|
|
105
|
-
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: any | null,
|
|
105
|
+
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: any | null, files?: File[]) => void;
|
|
106
106
|
}
|
|
107
107
|
export interface IMember {
|
|
108
108
|
accepted: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICommentFile, ILocalCommentFile } from './types.ts';
|
|
2
2
|
import { TFunction } from 'i18next';
|
|
3
3
|
export declare const cutDeleteImageId: (imageSrc: string) => string;
|
|
4
|
-
export declare const uploadAllFiles: (commentId: string, images:
|
|
4
|
+
export declare const uploadAllFiles: (commentId: string, images: ILocalCommentFile[], uploadCommentFileApi: any) => Promise<ICommentFile[]>;
|
|
5
5
|
export declare function scrollToTop(selector: string): void;
|
|
6
6
|
export declare const getDescription: (type: string, t: TFunction) => string;
|
|
7
7
|
export declare const getTitle: (type: string, t: TFunction) => string;
|
|
@@ -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";
|