@layers-app/shared 0.0.45 → 0.0.51

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 (70) hide show
  1. package/dist/KanbanLayout-CqLSzjCH.js +297 -0
  2. package/dist/assets/jsons/icons.min.json.d.ts +1 -1
  3. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  4. package/dist/components/AppContainer/types.d.ts +1 -0
  5. package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.d.ts +4 -2
  6. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +4 -1
  7. package/dist/components/AttachmentsGalleryModal/constants.d.ts +2 -1
  8. package/dist/components/AttachmentsGalleryModal/helpers.d.ts +22 -0
  9. package/dist/components/AttachmentsGalleryModal/hooks/usePanning.d.ts +10 -0
  10. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts +9 -0
  11. package/dist/components/ColorPicker/ColorPicker.d.ts +1 -0
  12. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +16 -11
  13. package/dist/components/CommentComposer/index.d.ts +2 -55
  14. package/dist/components/CommentComposer/types.d.ts +96 -0
  15. package/dist/components/CommentsPanel/index.d.ts +1 -26
  16. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
  17. package/dist/components/EmojiPicker/getIconsList.d.ts +11 -0
  18. package/dist/components/EmojiPicker/getRandomIcon.d.ts +1 -0
  19. package/dist/components/FilePicker/FilePicker.d.ts +2 -1
  20. package/dist/components/FilePicker/types.d.ts +1 -0
  21. package/dist/components/FormViewer/helpers/conditions.d.ts +1 -1
  22. package/dist/components/FormViewer/helpers/helpers.d.ts +1 -1
  23. package/dist/components/FormViewer/helpers/steps.d.ts +1 -1
  24. package/dist/components/FormViewer/hooks/useActiveStep.d.ts +1 -1
  25. package/dist/components/FormViewer/store/formStore.d.ts +6 -6
  26. package/dist/components/FormViewer/store/formStoreApi.d.ts +3 -3
  27. package/dist/components/FormViewer/store/selectors.d.ts +342 -342
  28. package/dist/components/FormViewer/types/schemes.d.ts +22 -22
  29. package/dist/components/ProjectIcon/ProjectIcon.d.ts +5 -0
  30. package/dist/components/RichText/extensions/bold.d.ts +3 -0
  31. package/dist/components/RichText/extensions/check-list.d.ts +42 -0
  32. package/dist/components/RichText/extensions/color-picker.d.ts +28 -0
  33. package/dist/components/RichText/extensions/font-size.d.ts +23 -0
  34. package/dist/components/RichText/extensions/italic.d.ts +3 -0
  35. package/dist/components/RichText/extensions/underline.d.ts +3 -0
  36. package/dist/components/RichText/index.d.ts +41 -0
  37. package/dist/components/UserAvatar/index.d.ts +3 -2
  38. package/dist/components/modals/RemoveConfirmModal.d.ts +8 -1
  39. package/dist/emoji-categorized-CRsMUQyD.js +4 -0
  40. package/dist/helpers/hotjar.d.ts +9 -0
  41. package/dist/helpers/pickRandomEmoji.d.ts +1 -0
  42. package/dist/icons.min-43tm8BtD.js +4 -0
  43. package/dist/index-By3Za6p9.js +116619 -0
  44. package/dist/index.d.ts +4 -2
  45. package/dist/index.js +261 -310
  46. package/dist/index.umd.cjs +60 -429
  47. package/dist/lang/locales/ui_en.json.d.ts +5 -4
  48. package/dist/lang/locales/ui_es.json.d.ts +2 -1
  49. package/dist/lang/locales/ui_ru.json.d.ts +2 -1
  50. package/package.json +9 -17
  51. package/dist/KanbanLayout-C6wJBGZ2.js +0 -287
  52. package/dist/components/CommentFilterMenu/index.d.ts +0 -9
  53. package/dist/components/CommentsPanel/components/CommentActionMenu.d.ts +0 -10
  54. package/dist/components/CommentsPanel/components/CommentActions.d.ts +0 -16
  55. package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +0 -21
  56. package/dist/components/CommentsPanel/components/CommentTabFilter.d.ts +0 -7
  57. package/dist/components/CommentsPanel/components/CommentsEmptyPlaceholder.d.ts +0 -6
  58. package/dist/components/CommentsPanel/components/CommentsFilterHeader.d.ts +0 -3
  59. package/dist/components/CommentsPanel/components/CommentsListItemMenu.d.ts +0 -7
  60. package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +0 -18
  61. package/dist/components/CommentsPanel/components/CommentsThreadReplyControls.d.ts +0 -15
  62. package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +0 -10
  63. package/dist/components/CommentsPanel/components/Icon.d.ts +0 -8
  64. package/dist/components/CommentsPanel/store.d.ts +0 -25
  65. package/dist/components/CommentsPanel/types.d.ts +0 -339
  66. package/dist/components/CommentsPanel/utils.d.ts +0 -14
  67. package/dist/emoji-categorized-DAOdcF53.js +0 -4
  68. package/dist/helpers/pickRandomIcon.d.ts +0 -1
  69. package/dist/icons.min-Chyr-bjL.js +0 -4
  70. package/dist/index-W83Evo8i.js +0 -78459
@@ -1,339 +0,0 @@
1
- import { EditorType } from '@layers-app/editor';
2
- import * as React from 'react';
3
- export interface ICommentReaction {
4
- id: string;
5
- commentId: string;
6
- parentId: string;
7
- parentType: 'COMMENT' | 'THREAD';
8
- reaction: string;
9
- userId: string;
10
- createdAt: string;
11
- deleted: boolean;
12
- deletedAt: string;
13
- version: number;
14
- }
15
- export interface ICommentFile {
16
- src: string;
17
- id: string;
18
- file: File & {
19
- id?: string;
20
- };
21
- isImage: boolean;
22
- }
23
- export type UpdateCommentTextArgs = (text: {
24
- value: string;
25
- restore: boolean;
26
- }, files: {
27
- deletedFile: ICommentFile[];
28
- newFiles: ICommentFile[];
29
- }, threadOrGeneralId: string, commentId?: string) => void;
30
- export type Comment = {
31
- authorId: string;
32
- text: string;
33
- deleted: boolean;
34
- clientKey: string;
35
- edited: boolean;
36
- id: string;
37
- tempId?: string;
38
- reactions: ICommentReaction[];
39
- files: Array<ICommentFile>;
40
- timeStamp: number;
41
- type: string;
42
- };
43
- export type Thread = {
44
- children: Array<Comment>;
45
- id: string;
46
- quote: string;
47
- edited: boolean;
48
- type: string;
49
- resolution: CommentResolve;
50
- authorId: string;
51
- tempId?: string;
52
- reactions: ICommentReaction[];
53
- files: Array<ICommentFile>;
54
- timeStamp: number;
55
- clientKey: string;
56
- text: string;
57
- deleted: boolean;
58
- };
59
- export type GeneralComment = {
60
- text: string;
61
- authorId: string;
62
- id: string;
63
- tempId?: string;
64
- edited: boolean;
65
- quote: string;
66
- timeStamp: number;
67
- resolution: CommentResolve;
68
- reactions: ICommentReaction[];
69
- files: Array<ICommentFile>;
70
- type: string;
71
- clientKey: string;
72
- children: Array<Comment>;
73
- deleted: boolean;
74
- };
75
- type CommentValueType = {
76
- value: string;
77
- files: (ICommentFile)[];
78
- };
79
- export type GetEditorFn = (params: {
80
- onSubmit: () => void;
81
- handleBlur: () => void;
82
- autoFocus: boolean;
83
- setCommentValue: React.Dispatch<React.SetStateAction<CommentValueType>>;
84
- commentValue?: CommentValueType;
85
- initialContent?: string;
86
- registerClearEditor?: (fn: () => void) => void;
87
- editorRef?: React.MutableRefObject<EditorType | null>;
88
- }) => React.ReactNode;
89
- export type Comments = Array<Thread | Comment | GeneralComment>;
90
- export type CommentResolve = 'ACCEPTED' | 'REJECTED' | null | 'NONE';
91
- export interface ICommentsFilterProps {
92
- commentsFilter: CommentsFilter;
93
- setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
94
- disabled: boolean;
95
- listRef: React.RefObject<HTMLElement>;
96
- updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
97
- commentValue: {
98
- value: string;
99
- files: (ICommentFile)[];
100
- };
101
- setCommentValue: React.Dispatch<React.SetStateAction<{
102
- value: string;
103
- files: (ICommentFile)[];
104
- }>>;
105
- submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: any | null, files?: File[]) => void;
106
- }
107
- export type IMember = {
108
- avatarUrl: string | null;
109
- roleType: string;
110
- roleId: string;
111
- accepted: boolean;
112
- email: string;
113
- userId: string | null;
114
- invitationId: string | null;
115
- invitationToken: string | null;
116
- name: string | null;
117
- expiresAt: string | null;
118
- };
119
- export interface IUser {
120
- activeWorkspaceId: string | null;
121
- name: string;
122
- nickname: string;
123
- email: string;
124
- profilePicture: {
125
- url: string;
126
- };
127
- createdAt: string;
128
- id: string;
129
- lang: string;
130
- plan: string;
131
- darkMode: boolean;
132
- timeZone: string | null;
133
- twoFactorEnabled: boolean;
134
- }
135
- export type ResolvedFilter = 'resolved' | 'not-resolved' | 'all';
136
- export type CommentsFilter = {
137
- resolved: ResolvedFilter;
138
- feedback: boolean;
139
- filteredUsers: IMember[];
140
- };
141
- interface IFetchCommentsParams {
142
- fetchPageComments?: boolean;
143
- pageId: string;
144
- fetchCommentComments?: boolean;
145
- onSuccess: (data: any) => void;
146
- }
147
- interface IResolveCommentParams {
148
- threatId: string;
149
- resolveValue: 'ACCEPTED' | 'REJECTED';
150
- onSuccess?: () => void;
151
- }
152
- interface ICommentReactionParams {
153
- commentId: string;
154
- author: string;
155
- emojiValue: string;
156
- onSuccess?: (data: ICommentReaction) => void;
157
- onError: () => void;
158
- }
159
- interface IDeleteReactionParams {
160
- reactionId: string;
161
- onSuccess?: () => void;
162
- onError: () => void;
163
- }
164
- interface IDeleteCommentParams {
165
- deleteCommentId: string;
166
- onSuccess?: () => void;
167
- }
168
- interface IRestoreCommentParams {
169
- commentId: string;
170
- onSuccess?: () => void;
171
- }
172
- interface IUpdateCommentTextParams {
173
- commentId: string;
174
- textValue: string;
175
- onSuccess?: () => void;
176
- onError?: () => void;
177
- }
178
- interface IDeleteCommentImageParams {
179
- photoToRemove: string;
180
- onSuccess?: () => void;
181
- }
182
- interface ISubmitCommentParams {
183
- text: string;
184
- parentType: string;
185
- parentId: string;
186
- commentType: string;
187
- onSuccess?: (data: any) => void;
188
- }
189
- export interface IGetReactionsParams {
190
- commentId: string;
191
- }
192
- export interface IGetPhotosParams {
193
- commentId: string;
194
- }
195
- interface IUploadCommentFileParams {
196
- file: File;
197
- commentId: string;
198
- onSuccess?: (data: any) => void;
199
- }
200
- interface ICommentActions {
201
- fetchCommentsApi: (params: IFetchCommentsParams) => Promise<void>;
202
- resolveCommentApi: (params: IResolveCommentParams) => Promise<void>;
203
- commentReactionApi: (params: ICommentReactionParams) => Promise<void>;
204
- deleteReactionApi: (params: IDeleteReactionParams) => Promise<void>;
205
- deleteCommentApi: (params: IDeleteCommentParams) => Promise<void>;
206
- restoreCommentApi: (params: IRestoreCommentParams) => Promise<void>;
207
- updateCommentTextApi: (params: IUpdateCommentTextParams) => Promise<void>;
208
- deleteCommentImageApi: (params: IDeleteCommentImageParams) => Promise<void>;
209
- submitCommentApi: (params: ISubmitCommentParams) => Promise<void>;
210
- getReactionsApi: (params: IGetReactionsParams) => Promise<{
211
- content: ICommentReaction[];
212
- }>;
213
- getPhotosApi: (params: IGetPhotosParams) => Promise<File[]>;
214
- uploadCommentFileApi: (params: IUploadCommentFileParams) => Promise<void>;
215
- }
216
- export interface ICommentOptions {
217
- showComments: boolean;
218
- setShowComments: (value?: boolean) => void;
219
- adminPermission: boolean;
220
- isGuest: boolean;
221
- pageId: string;
222
- workspaceInfo: {
223
- title: string;
224
- icon: string;
225
- };
226
- commentActions: ICommentActions;
227
- }
228
- export interface SharedCommentProps {
229
- commentOrThread: Comment | Thread | GeneralComment;
230
- deleteCommentOrThread: (commentOrThread: Comment | Thread, thread?: Thread) => Promise<void>;
231
- resolveThreat?: (threat: Thread | GeneralComment) => Promise<void>;
232
- }
233
- type SelectMarkNodeFn = (markNodeKeys: Set<string>, activeElement: Element | null) => void;
234
- export interface StoreOptions {
235
- currentUser?: IUser;
236
- workspaceMembers?: IMember[] | undefined;
237
- commentOptions?: ICommentOptions;
238
- selectMarkNode: SelectMarkNodeFn;
239
- }
240
- export interface CommentsNs {
241
- edited: string;
242
- title: string;
243
- addComment: string;
244
- generalComment: string;
245
- replyComment: string;
246
- actionTooltips: {
247
- resolve: string;
248
- reopen: string;
249
- addReaction: string;
250
- reactionLimit: string;
251
- reply: string;
252
- };
253
- deleteModal: {
254
- title: {
255
- thread: string;
256
- general: string;
257
- comment: string;
258
- };
259
- description: {
260
- thread: string;
261
- general: string;
262
- comment: string;
263
- };
264
- actions: {
265
- cancel: string;
266
- delete: string;
267
- remove: string;
268
- };
269
- };
270
- emptyState: {
271
- "not-resolved": string;
272
- resolved: string;
273
- all: string;
274
- userFilter: string;
275
- };
276
- filter: {
277
- resolved: string;
278
- open: string;
279
- all: string;
280
- selectUsers: string;
281
- searchPlaceholder: string;
282
- emptyPlaceholder: string;
283
- byStatus: string;
284
- byPerson: string;
285
- };
286
- inputEditor: {
287
- uploadFiles: string;
288
- sendMessage: string;
289
- editMessage: string;
290
- clear: string;
291
- clearModal: {
292
- title: string;
293
- description: {
294
- both: string;
295
- text: string;
296
- files: string;
297
- empty: string;
298
- };
299
- };
300
- discardModal: {
301
- title: string;
302
- description: string;
303
- labels: {
304
- confirm: string;
305
- cancel: string;
306
- };
307
- };
308
- cancelCommentModal: {
309
- description: string;
310
- };
311
- };
312
- menuActions: {
313
- edit: string;
314
- delete: string;
315
- download: string;
316
- };
317
- notifications: {
318
- title: string;
319
- description: string;
320
- options: {
321
- all: string;
322
- replies: string;
323
- };
324
- uploadMessages: {
325
- tooManyFiles: string;
326
- fileTooLarge: string;
327
- fileLimit: string;
328
- };
329
- };
330
- repliesToggle: {
331
- show_one: string;
332
- show_other: string;
333
- hide: string;
334
- };
335
- }
336
- export interface CommentsLocales {
337
- comments: CommentsNs;
338
- }
339
- export {};
@@ -1,14 +0,0 @@
1
- import { default as React, Dispatch, SetStateAction } from 'react';
2
- import { CommentsFilter, CommentsNs, ICommentFile, IMember } from './types.ts';
3
- export declare const cutDeleteImageId: (imageSrc: string) => string;
4
- export declare const uploadAllFiles: (commentId: string, images: ICommentFile[], uploadCommentFileApi: any) => Promise<ICommentFile[]>;
5
- export declare function scrollToTop(selector: string): void;
6
- export declare const getDescription: (type: string, locales: CommentsNs) => string;
7
- export declare const getTitle: (type: string, locales: CommentsNs) => string;
8
- export declare function toggleFilter(setState: Dispatch<SetStateAction<CommentsFilter>>, key: keyof CommentsFilter, value?: IMember | boolean | string, listRef?: React.RefObject<HTMLElement>): void;
9
- export declare const IS_APPLE: boolean;
10
- export declare const createDefaultCommentsLocales: () => CommentsNs;
11
- export declare function getClearInputMessage(hasText: boolean, hasFiles: boolean, locales: CommentsNs): string;
12
- export declare const preparePreviewFile: (file: File & {
13
- id?: string;
14
- }, temp?: boolean) => ICommentFile;