@layers-app/shared 0.0.28 → 0.0.29

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 (53) hide show
  1. package/dist/components/AppContainer/AppContainer.d.ts +6 -0
  2. package/dist/components/AppContainer/components/DesktopNavbar.d.ts +5 -0
  3. package/dist/components/AppContainer/hooks/useHideHeader.d.ts +1 -1
  4. package/dist/components/AppContainer/hooks/useHideSidebar.d.ts +1 -0
  5. package/dist/components/{ImagePicker/ImagePicker.d.ts → FilePicker/FilePicker.d.ts} +6 -4
  6. package/dist/components/{ImagePicker/ImagePickerGallery.d.ts → FilePicker/FilePickerGallery.d.ts} +1 -1
  7. package/dist/components/FilePicker/FilePickerGiphy.d.ts +6 -0
  8. package/dist/components/FilePicker/FilePickerLink.d.ts +7 -0
  9. package/dist/components/FilePicker/FilePickerSkeletonLoader.d.ts +1 -0
  10. package/dist/components/FilePicker/FilePickerUnsplash.d.ts +6 -0
  11. package/dist/components/{ImagePicker/ImagePickerUpload.d.ts → FilePicker/FilePickerUpload.d.ts} +3 -3
  12. package/dist/components/FilePicker/index.d.ts +1 -0
  13. package/dist/components/{ImagePicker → FilePicker}/types.d.ts +2 -1
  14. package/dist/helpers/validation.d.ts +2 -0
  15. package/dist/hooks/useNumberQueryParam.d.ts +9 -0
  16. package/dist/index.d.ts +5 -6
  17. package/dist/index.js +46264 -103
  18. package/dist/index.umd.cjs +78 -270
  19. package/dist/store/pageUpdateCount.d.ts +12 -0
  20. package/dist/store/timezoneStore.d.ts +1 -1
  21. package/package.json +2 -2
  22. package/dist/components/CommentComposer/index.d.ts +0 -52
  23. package/dist/components/CommentsPanel/components/CommentActions.d.ts +0 -16
  24. package/dist/components/CommentsPanel/components/CommentFilterMenu.d.ts +0 -6
  25. package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +0 -22
  26. package/dist/components/CommentsPanel/components/CommentsEmptyPlaceholder.d.ts +0 -3
  27. package/dist/components/CommentsPanel/components/CommentsFilterHeader.d.ts +0 -3
  28. package/dist/components/CommentsPanel/components/CommentsListItemMenu.d.ts +0 -6
  29. package/dist/components/CommentsPanel/components/CommentsMultiSelectUsers.d.ts +0 -6
  30. package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +0 -19
  31. package/dist/components/CommentsPanel/components/CommentsThreadReplyControls.d.ts +0 -10
  32. package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +0 -5
  33. package/dist/components/CommentsPanel/components/Icon.d.ts +0 -8
  34. package/dist/components/CommentsPanel/components/RemoveConfirmModal.d.ts +0 -11
  35. package/dist/components/CommentsPanel/index.d.ts +0 -21
  36. package/dist/components/CommentsPanel/store.d.ts +0 -19
  37. package/dist/components/CommentsPanel/types.d.ts +0 -243
  38. package/dist/components/CommentsPanel/utils.d.ts +0 -8
  39. package/dist/components/ImagePicker/ImagePickerGiphy.d.ts +0 -6
  40. package/dist/components/ImagePicker/ImagePickerLink.d.ts +0 -5
  41. package/dist/components/ImagePicker/ImagePickerSkeletonLoader.d.ts +0 -1
  42. package/dist/components/ImagePicker/ImagePickerUnsplash.d.ts +0 -6
  43. package/dist/components/ImagePicker/index.d.ts +0 -1
  44. package/dist/helpers/getFileIcons.d.ts +0 -1
  45. package/dist/helpers/getFileType.d.ts +0 -1
  46. package/dist/index-Bz8Yenv3.js +0 -75975
  47. package/dist/layers.C5oAiCeN-DZQs9zcO.js +0 -288
  48. package/dist/layers.CovbS90x-CThbTGYw.js +0 -52
  49. package/dist/layers.CsuN1Q94-BT7000dw.js +0 -170
  50. package/dist/layers.DETHwCxI-BvdKGW_B.js +0 -281
  51. package/dist/layers.vNINlb5t-Bef3Moef.js +0 -289
  52. /package/dist/components/{ImagePicker → FilePicker}/api/giphyApi.d.ts +0 -0
  53. /package/dist/components/{ImagePicker → FilePicker}/api/unsplashApi.d.ts +0 -0
@@ -0,0 +1,12 @@
1
+ import { TFunction } from 'i18next';
2
+ declare global {
3
+ interface Window {
4
+ openSignUpModal?: () => void;
5
+ closeSignUpModal?: () => void;
6
+ }
7
+ }
8
+ export declare const useUpdateCountStore: import('zustand').UseBoundStore<import('zustand').StoreApi<{
9
+ count: number;
10
+ }>>;
11
+ export declare const increaseUpdateCount: () => void;
12
+ export declare function showAskSaveModal(t: TFunction): void;
@@ -1,6 +1,5 @@
1
1
  interface IWorkspacesOrderState {
2
2
  timezone: string | null;
3
- updateTimezone: (tz: string) => void;
4
3
  }
5
4
  export declare const useLocalTimezone: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<IWorkspacesOrderState>, "persist"> & {
6
5
  persist: {
@@ -13,4 +12,5 @@ export declare const useLocalTimezone: import('zustand').UseBoundStore<Omit<impo
13
12
  getOptions: () => Partial<import('zustand/middleware').PersistOptions<IWorkspacesOrderState, unknown>>;
14
13
  };
15
14
  }>;
15
+ export declare const updateTimezone: (timezone: string) => void;
16
16
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layers-app/shared",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -46,7 +46,7 @@
46
46
  "react-helmet": "^6.1.0",
47
47
  "react-i18next": "^15.0.2",
48
48
  "react-joyride": "^2.8.2",
49
- "react-router-dom": "^7.5.2",
49
+ "react-router-dom": "6.27.0",
50
50
  "zustand": "^4.5.4"
51
51
  }
52
52
  }
@@ -1,52 +0,0 @@
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 {};
@@ -1,16 +0,0 @@
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 {};
@@ -1,6 +0,0 @@
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;
@@ -1,22 +0,0 @@
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 {};
@@ -1,3 +0,0 @@
1
- export declare const CommentsEmptyPlaceholder: ({ resolved, }: {
2
- resolved: boolean;
3
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { ICommentsFilterProps } from '../types.ts';
2
- import * as React from 'react';
3
- export declare const CommentsFilterHeader: React.FC<ICommentsFilterProps>;
@@ -1,6 +0,0 @@
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;
@@ -1,6 +0,0 @@
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;
@@ -1,19 +0,0 @@
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 {};
@@ -1,10 +0,0 @@
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 {};
@@ -1,5 +0,0 @@
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;
@@ -1,8 +0,0 @@
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;
@@ -1,11 +0,0 @@
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 {};
@@ -1,21 +0,0 @@
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 {};
@@ -1,19 +0,0 @@
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 {};
@@ -1,243 +0,0 @@
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 {};
@@ -1,8 +0,0 @@
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;
@@ -1,6 +0,0 @@
1
- import { ImagePickerLocales } from './types';
2
- export declare const ImagePickerGiphy: ({ locales, token, onChange, }: {
3
- locales: ImagePickerLocales;
4
- token?: string;
5
- onChange?: (v: string) => void;
6
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- import { ImagePickerLocales } from './types';
2
- export declare const ImagePickerLink: ({ locales, onChange, }: {
3
- locales: ImagePickerLocales;
4
- onChange?: (v: string) => void;
5
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const ImagePickerSkeletonLoader: () => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { ImagePickerLocales } from './types';
2
- export declare const ImagePickerUnsplash: ({ locales, onChange, clientId, }: {
3
- locales: ImagePickerLocales;
4
- clientId?: string;
5
- onChange?: (v: string) => void;
6
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export * from './ImagePicker';
@@ -1 +0,0 @@
1
- export declare const getFileIcons: (fileType: string, isFolder?: boolean, size?: number) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const getFileType: (mimeType: string) => "other" | "media" | "documents" | "folder" | "diagram" | "archieve";