@layers-app/shared 0.0.39-froms-01 → 0.0.40
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/{KanbanLayout-D5Ex3f-G.js → KanbanLayout-Cgno2syU.js} +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/components/DesktopNavbar.d.ts +1 -1
- package/dist/components/AppContainer/components/MenuUserDropdown.d.ts +2 -0
- package/dist/components/AppContainer/types.d.ts +4 -1
- package/dist/components/CircleColorPicker/CircleColorPicker.d.ts +2 -2
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +12 -0
- package/dist/components/CommentComposer/index.d.ts +10 -8
- package/dist/components/CommentFilterMenu/index.d.ts +9 -0
- package/dist/components/CommentsPanel/components/CommentActionMenu.d.ts +5 -1
- package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +3 -4
- package/dist/components/CommentsPanel/components/{CommentFilterMenu.d.ts → CommentTabFilter.d.ts} +2 -1
- package/dist/components/CommentsPanel/components/CommentsEmptyPlaceholder.d.ts +5 -2
- package/dist/components/CommentsPanel/components/CommentsListItemMenu.d.ts +2 -1
- package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +3 -4
- package/dist/components/CommentsPanel/components/CommentsThreadReplyControls.d.ts +5 -1
- package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +9 -5
- package/dist/components/CommentsPanel/index.d.ts +10 -6
- package/dist/components/CommentsPanel/store.d.ts +7 -1
- package/dist/components/CommentsPanel/types.d.ts +152 -57
- package/dist/components/CommentsPanel/utils.d.ts +11 -5
- package/dist/components/FormViewer/components/Container.d.ts +3 -3
- package/dist/components/FormViewer/components/Step.d.ts +3 -2
- package/dist/components/FormViewer/components/StepDescription.d.ts +4 -3
- package/dist/components/FormViewer/components/StepTitle.d.ts +4 -3
- package/dist/components/FormViewer/components/fields/ButtonField/ButtonField.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/ButtonField/InnerButton.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/ChoiceField/ChoiceCard.d.ts +3 -3
- package/dist/components/FormViewer/components/fields/ChoiceField/ChoiceField.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/ChoiceField/PictureChoiceCard.d.ts +3 -3
- package/dist/components/FormViewer/components/fields/ChoiceField/PictureChoiceField.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/ConfirmButton.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/ConfirmField.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/MultipleChoice/MultipleChoiceCard.d.ts +3 -3
- package/dist/components/FormViewer/components/fields/MultipleChoice/MultipleChoiceField.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/RatingField.d.ts +3 -3
- package/dist/components/FormViewer/components/fields/SelectableCard/PictureSelectableCard.d.ts +3 -3
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.d.ts +3 -3
- package/dist/components/FormViewer/components/fields/SliderField.d.ts +3 -3
- package/dist/components/FormViewer/components/fields/StartField.d.ts +3 -2
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts +3 -3
- package/dist/components/FormViewer/constants/defaultTheme.d.ts +2 -0
- package/dist/components/FormViewer/helpers/conditions.d.ts +9 -5
- package/dist/components/FormViewer/helpers/helpers.d.ts +9 -5
- package/dist/components/FormViewer/helpers/steps.d.ts +9 -5
- package/dist/components/FormViewer/hooks/useActiveControl.d.ts +2 -0
- package/dist/components/FormViewer/hooks/useActiveStep.d.ts +9 -5
- package/dist/components/FormViewer/store/formStore.d.ts +1280 -72
- package/dist/components/FormViewer/store/formStoreApi.d.ts +630 -7
- package/dist/components/FormViewer/store/selectors.d.ts +6893 -2159
- package/dist/components/FormViewer/types/schemes.d.ts +210 -206
- package/dist/components/InviteModal/InviteModal.d.ts +2 -0
- package/dist/components/InviteModal/slice.d.ts +13 -0
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +1 -0
- package/dist/components/modals/openRemoveConfirmModal.d.ts +4 -0
- package/dist/helpers/getFileType.d.ts +2 -1
- package/dist/helpers/isAppMode.d.ts +2 -0
- package/dist/{index-BVdsep1X.js → index-jQFbCQG3.js} +10852 -9973
- package/dist/index.d.ts +8 -0
- package/dist/index.js +25 -16
- package/dist/index.umd.cjs +59 -59
- package/package.json +8 -8
- package/dist/components/CommentsPanel/components/CommentsMultiSelectUsers.d.ts +0 -6
- package/dist/components/CommentsPanel/components/RemoveConfirmModal.d.ts +0 -11
|
@@ -11,7 +11,7 @@ import "@mantine/form";
|
|
|
11
11
|
import "@mantine/dropzone";
|
|
12
12
|
import "@mantine/notifications";
|
|
13
13
|
import "lodash-es";
|
|
14
|
-
import { u as useOnboardingState, S as StatusBadge } from "./index-
|
|
14
|
+
import { u as useOnboardingState, S as StatusBadge } from "./index-jQFbCQG3.js";
|
|
15
15
|
import "react-dom";
|
|
16
16
|
import "draggable-ui";
|
|
17
17
|
import "@mantine/modals";
|
|
@@ -5,7 +5,7 @@ declare global {
|
|
|
5
5
|
preSignMode?: boolean;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
export declare const AppContainer: (({ header, content, navbar, navbarTitle, displayType, footer, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
8
|
+
export declare const AppContainer: (({ header, content, navbar, navbarTitle, displayType, footer, onTitleChange, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
9
9
|
NavbarContent: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
NavbarFooter: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
NavbarHeader: ({ children }: import('react').PropsWithChildren) => 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" | "displayType">) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const DesktopNavbar: (props: Pick<AppContainerProps, "navbar" | "navbarTitle" | "displayType" | "onTitleChange">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { appMode } from '../../..';
|
|
2
3
|
import { FloatingPosition } from '@mantine/core';
|
|
3
4
|
export type MenuUser = {
|
|
4
5
|
id: string;
|
|
5
6
|
avatar: string | null;
|
|
6
7
|
email?: string | null;
|
|
7
8
|
name: string | null;
|
|
9
|
+
mode?: appMode;
|
|
8
10
|
};
|
|
9
11
|
export type UserNotifications = {
|
|
10
12
|
createdAt: string;
|
|
@@ -17,11 +17,14 @@ export type AppContainerProps = {
|
|
|
17
17
|
navbarTitle?: string;
|
|
18
18
|
displayType?: 'ROUNDED' | 'BOXED';
|
|
19
19
|
footer?: ReactNode;
|
|
20
|
+
onTitleChange?: (title?: string) => void;
|
|
20
21
|
};
|
|
21
22
|
export type AppContainerDataStore = {
|
|
22
23
|
tools: ToolDef[];
|
|
23
24
|
workspaceMenu: WorkspaceMenuProps;
|
|
24
|
-
user: MenuUser
|
|
25
|
+
user: MenuUser & {
|
|
26
|
+
role: string;
|
|
27
|
+
};
|
|
25
28
|
userMenuItems?: ReactNode;
|
|
26
29
|
notifications: UserNotifications[];
|
|
27
30
|
isAnonym: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColorPickerProps, MenuProps } from '@mantine/core';
|
|
2
2
|
export declare const CircleColorPicker: ({ value, onChange, menuProps, colorPickerProps, }: {
|
|
3
|
-
value
|
|
4
|
-
onChange: (value: string) => void;
|
|
3
|
+
value?: string | null;
|
|
4
|
+
onChange: (value: string | null) => void;
|
|
5
5
|
menuProps?: MenuProps;
|
|
6
6
|
colorPickerProps?: ColorPickerProps;
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { EditorType } from '@layers-app/editor';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
type Props = {
|
|
5
|
+
children: (editorRef: React.MutableRefObject<EditorType | null>) => ReactNode;
|
|
6
|
+
onSubmit: () => void;
|
|
7
|
+
handleBlur: () => void;
|
|
8
|
+
autoFocus?: boolean;
|
|
9
|
+
registerClearEditor?: (fn: () => void) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function CommentEditorBehavior({ children, onSubmit, handleBlur, autoFocus, registerClearEditor, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
2
|
import { RangeSelection } from '@layers-app/editor';
|
|
3
|
-
import { Comment,
|
|
3
|
+
import { Comment, CommentsNs, GeneralComment, ICommentFile, ICommentOptions, IUser, Thread } from '../CommentsPanel/types.ts';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
interface CommentValue {
|
|
6
6
|
value: string;
|
|
7
|
-
files:
|
|
7
|
+
files: ICommentFile[];
|
|
8
8
|
}
|
|
9
9
|
interface CommentComposerProps {
|
|
10
|
-
children: (
|
|
10
|
+
children: (args: {
|
|
11
11
|
onSubmit: () => void;
|
|
12
12
|
handleBlur: () => void;
|
|
13
13
|
autoFocus: boolean;
|
|
14
14
|
setCommentValue: React.Dispatch<React.SetStateAction<CommentValue>>;
|
|
15
15
|
commentValue: CommentValue;
|
|
16
16
|
registerClearEditor?: (fn: () => void) => void;
|
|
17
|
-
}) => React.ReactNode
|
|
17
|
+
}) => React.ReactNode;
|
|
18
18
|
getSelectionText?: (selection: RangeSelection) => string;
|
|
19
19
|
removeCommentImage?: (index: string) => void;
|
|
20
20
|
providedUser?: IUser;
|
|
@@ -24,11 +24,11 @@ interface CommentComposerProps {
|
|
|
24
24
|
}) => void;
|
|
25
25
|
commentValue: {
|
|
26
26
|
value: string;
|
|
27
|
-
files:
|
|
27
|
+
files: ICommentFile[];
|
|
28
28
|
};
|
|
29
29
|
setCommentValue: React.Dispatch<React.SetStateAction<{
|
|
30
30
|
value: string;
|
|
31
|
-
files:
|
|
31
|
+
files: ICommentFile[];
|
|
32
32
|
}>>;
|
|
33
33
|
isEditInput?: boolean;
|
|
34
34
|
autoFocus?: boolean;
|
|
@@ -44,9 +44,11 @@ interface CommentComposerProps {
|
|
|
44
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
|
-
files:
|
|
47
|
+
files: ICommentFile[];
|
|
48
48
|
}) => void;
|
|
49
49
|
provideCommentOptions?: ICommentOptions;
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
composerLocales?: CommentsNs;
|
|
50
52
|
}
|
|
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;
|
|
53
|
+
export declare const CommentComposer: ({ submitAddComment, commentValue, thread, setCommentValue, handleBlur, autoFocus, provideCommentOptions, removeCommentImage, handleEditComment, isEditInput, isGeneral, updateThreadId, setCommentActions, updateLocation, getSelectionText, children, providedUser, placeholder, composerLocales, }: CommentComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
54
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CommentsFilter } from '../CommentsPanel/types.ts';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare const CommentFilterMenu: ({ commentsFilter, setCommentsFilter, disabled, onCollapse, listRef, }: {
|
|
4
|
+
commentsFilter: CommentsFilter;
|
|
5
|
+
setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
listRef?: React.RefObject<HTMLElement>;
|
|
8
|
+
onCollapse?: React.Dispatch<React.SetStateAction<string | null>>;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { CommentsNs } from '../types.ts';
|
|
1
2
|
interface CommentActionMenuProps {
|
|
2
3
|
onDownload: () => void;
|
|
3
4
|
onDelete: () => void;
|
|
5
|
+
iconColor?: string;
|
|
6
|
+
hasPermission: boolean;
|
|
7
|
+
locales?: CommentsNs;
|
|
4
8
|
}
|
|
5
|
-
export declare const CommentActionMenu: ({ onDownload, onDelete }: CommentActionMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const CommentActionMenu: ({ onDownload, onDelete, iconColor, hasPermission, locales: propLocales, }: CommentActionMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
10
|
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { NodeKey, RangeSelection } from '@layers-app/editor';
|
|
2
|
-
import {
|
|
3
|
-
import { Comment, GeneralComment, ICommentFile, SharedCommentProps, Thread, UpdateCommentTextArgs } from '../types.ts';
|
|
2
|
+
import { Comment, CommentsNs, GeneralComment, ICommentFile, SharedCommentProps, Thread, UpdateCommentTextArgs } from '../types.ts';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
interface ICommentPanelListItemProps extends SharedCommentProps {
|
|
6
|
-
t: TFunction;
|
|
7
5
|
deleteCommentImage: (photoToRemove: string, threadOrGeneralId: string, commentId?: string) => void;
|
|
8
6
|
addCommentReaction: (reaction: string, comment: Thread | GeneralComment | Comment, threatOrGeneral?: Thread | GeneralComment) => void;
|
|
9
7
|
removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
|
|
@@ -17,6 +15,7 @@ interface ICommentPanelListItemProps extends SharedCommentProps {
|
|
|
17
15
|
replyInput?: string;
|
|
18
16
|
setShowReplyInput?: React.Dispatch<React.SetStateAction<string>>;
|
|
19
17
|
activeIDs?: Array<string>;
|
|
18
|
+
locales: CommentsNs;
|
|
20
19
|
}
|
|
21
|
-
export declare const CommentPanelListItem: ({ commentOrThread, handleClickThread, markNodeMap, parentThreadOrGeneral, submitAddComment, removeCommentReactions, updateThreadId, addCommentReaction, deleteCommentImage, activeIDs, updateCommentTextOrImage, resolveThreat, toggleRepliesInput,
|
|
20
|
+
export declare const CommentPanelListItem: ({ commentOrThread, handleClickThread, markNodeMap, parentThreadOrGeneral, submitAddComment, removeCommentReactions, updateThreadId, addCommentReaction, deleteCommentImage, activeIDs, updateCommentTextOrImage, resolveThreat, toggleRepliesInput, locales, deleteCommentOrThread, replyInput, }: ICommentPanelListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
21
|
export {};
|
package/dist/components/CommentsPanel/components/{CommentFilterMenu.d.ts → CommentTabFilter.d.ts}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CommentsFilter } from '../types.ts';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const CommentTabFilter: ({ commentsFilter, setCommentsFilter, listRef, }: {
|
|
4
4
|
commentsFilter: CommentsFilter;
|
|
5
5
|
setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
|
|
6
|
+
listRef: React.RefObject<HTMLElement>;
|
|
6
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { CommentsFilter } from '../types.ts';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare const CommentsEmptyPlaceholder: ({ commentsFilter, listRef }: {
|
|
4
|
+
commentsFilter: CommentsFilter;
|
|
5
|
+
listRef: React.RefObject<HTMLElement>;
|
|
3
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Comment, GeneralComment, Thread } from '../types.ts';
|
|
2
|
-
export declare const CommentsListItemMenu: ({ handleEditClick, commentOrThread, deleteCommentOrThread, }: {
|
|
2
|
+
export declare const CommentsListItemMenu: ({ handleEditClick, commentOrThread, deleteCommentOrThread, hasPermission }: {
|
|
3
3
|
handleEditClick: (comment: Comment | Thread | GeneralComment) => void;
|
|
4
4
|
commentOrThread: Comment | Thread | GeneralComment;
|
|
5
5
|
deleteCommentOrThread: (commentOrThread: Comment | Thread, thread?: Thread) => void;
|
|
6
|
+
hasPermission: boolean;
|
|
6
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { RangeSelection, NodeKey } from '@layers-app/editor';
|
|
3
3
|
import { Comment, Comments, GeneralComment, ICommentFile, SharedCommentProps, Thread, UpdateCommentTextArgs } from '../types.ts';
|
|
4
|
+
import * as React from 'react';
|
|
4
5
|
interface CommentsPanelListProps extends Omit<SharedCommentProps, 'commentOrThread'> {
|
|
5
6
|
activeIDs: string[];
|
|
6
7
|
comments: Comments;
|
|
7
|
-
listRef:
|
|
8
|
-
current: null | HTMLUListElement;
|
|
9
|
-
};
|
|
8
|
+
listRef: React.RefObject<HTMLElement>;
|
|
10
9
|
updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
|
|
11
10
|
deleteCommentImage: (photoToRemove: string, threadOrGeneralId: string, commentId?: string) => void;
|
|
12
11
|
removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
|
|
13
12
|
addCommentReaction: (reaction: string, comment: Thread | GeneralComment | Comment, threatOrGeneral?: Thread | GeneralComment) => void;
|
|
14
|
-
markNodeMap
|
|
13
|
+
markNodeMap?: Map<string, Set<NodeKey>>;
|
|
15
14
|
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
|
|
16
15
|
updateCommentTextOrImage: UpdateCommentTextArgs;
|
|
17
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommentsNs } from '../types.ts';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
interface CommentsThreadReplyControlsProps {
|
|
3
4
|
onSubmit: () => void;
|
|
@@ -6,6 +7,9 @@ interface CommentsThreadReplyControlsProps {
|
|
|
6
7
|
disabledUploadButton: boolean;
|
|
7
8
|
isSubmitting: boolean;
|
|
8
9
|
setIsSubmitting: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
+
handleClearInput: () => void;
|
|
11
|
+
isFloatInput?: boolean;
|
|
12
|
+
locales?: CommentsNs;
|
|
9
13
|
}
|
|
10
|
-
export declare const CommentsThreadReplyControls: ({ onSubmit, handleFileChange, disabledSubmitButton, disabledUploadButton, setIsSubmitting, isSubmitting, }: CommentsThreadReplyControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const CommentsThreadReplyControls: ({ onSubmit, handleFileChange, disabledSubmitButton, disabledUploadButton, isFloatInput, setIsSubmitting, isSubmitting, handleClearInput, locales: propLocales, }: CommentsThreadReplyControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
files: Array<ICommentFile
|
|
1
|
+
import { CommentsNs, ICommentFile } from '../types.ts';
|
|
2
|
+
interface CommentsUploadFilesPreviewProps {
|
|
3
|
+
files: Array<ICommentFile>;
|
|
4
|
+
hasPermission?: boolean;
|
|
4
5
|
removeImage: (index: number | string) => void;
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
showLoading?: boolean;
|
|
7
|
+
locales?: CommentsNs;
|
|
8
|
+
}
|
|
9
|
+
export declare const CommentsUploadFilesPreview: ({ files, hasPermission, removeImage, showLoading, locales, }: CommentsUploadFilesPreviewProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { NodeKey, RangeSelection } from '@layers-app/editor';
|
|
3
|
-
import { Comment, Comments, GeneralComment, GetEditorFn, ICommentFile, StoreOptions, Thread, UpdateCommentTextArgs, SharedCommentProps } from './types.ts';
|
|
3
|
+
import { Comment, Comments, CommentsFilter, CommentsLocales, GeneralComment, GetEditorFn, ICommentFile, StoreOptions, Thread, UpdateCommentTextArgs, SharedCommentProps } from './types.ts';
|
|
4
|
+
import * as React from 'react';
|
|
4
5
|
interface CommentsPanelProps extends Omit<SharedCommentProps, 'commentOrThread'> {
|
|
5
6
|
comments: Comments;
|
|
6
7
|
activeIDs: string[];
|
|
@@ -10,13 +11,16 @@ interface CommentsPanelProps extends Omit<SharedCommentProps, 'commentOrThread'>
|
|
|
10
11
|
removeCommentReactions: (reaction: string, threatOrGeneral: Thread | GeneralComment | Comment, comment?: Thread | GeneralComment) => void;
|
|
11
12
|
addCommentReaction: (reaction: string, comment: Thread | GeneralComment | Comment, threatOrGeneral?: Thread | GeneralComment) => void;
|
|
12
13
|
updateCommentTextOrImage: UpdateCommentTextArgs;
|
|
13
|
-
markNodeMap
|
|
14
|
+
markNodeMap?: Map<string, Set<NodeKey>>;
|
|
14
15
|
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
|
|
15
|
-
listRef:
|
|
16
|
-
current: null | HTMLUListElement;
|
|
17
|
-
};
|
|
16
|
+
listRef: React.RefObject<HTMLElement>;
|
|
18
17
|
getEditor: GetEditorFn;
|
|
19
18
|
clipPath?: string;
|
|
19
|
+
isSidebar?: boolean;
|
|
20
|
+
locales: CommentsLocales;
|
|
21
|
+
commentsFilter: CommentsFilter;
|
|
22
|
+
setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
|
|
23
|
+
isLoading: boolean;
|
|
20
24
|
}
|
|
21
|
-
export declare function CommentsPanel({ activeIDs, deleteCommentOrThread, comments, submitAddComment, markNodeMap, storeOptions, deleteCommentImage, addCommentReaction, removeCommentReactions, updateCommentTextOrImage, listRef, resolveThreat, updateThreadId, getEditor, clipPath }: CommentsPanelProps): ReactElement;
|
|
25
|
+
export declare function CommentsPanel({ activeIDs, deleteCommentOrThread, comments, submitAddComment, markNodeMap, storeOptions, deleteCommentImage, addCommentReaction, removeCommentReactions, updateCommentTextOrImage, listRef, resolveThreat, updateThreadId, locales, getEditor, setCommentsFilter, commentsFilter, clipPath, isLoading, isSidebar, }: CommentsPanelProps): ReactElement;
|
|
22
26
|
export {};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { GetEditorFn, ICommentOptions, IMember, IUser } from './types
|
|
1
|
+
import { CommentsNs, GetEditorFn, ICommentOptions, IMember, IUser } from './types';
|
|
2
2
|
interface CommentsState {
|
|
3
3
|
workspaceMembers: IMember[];
|
|
4
4
|
currentUser?: IUser;
|
|
5
5
|
showComments: boolean;
|
|
6
|
+
adminPermission: boolean;
|
|
6
7
|
commentOptions?: ICommentOptions;
|
|
7
8
|
getEditor?: GetEditorFn;
|
|
9
|
+
isSidebar: boolean;
|
|
10
|
+
isGuest: boolean;
|
|
11
|
+
commentsLocales: CommentsNs;
|
|
8
12
|
selectMarkNode?: (markNodeKeys: Set<string>, activeElement: Element | null) => void;
|
|
9
13
|
initializeComments: (data: {
|
|
10
14
|
workspaceMembers?: IMember[];
|
|
@@ -12,6 +16,8 @@ interface CommentsState {
|
|
|
12
16
|
showComments?: boolean;
|
|
13
17
|
commentOptions?: ICommentOptions;
|
|
14
18
|
getEditor?: GetEditorFn;
|
|
19
|
+
isSidebar: boolean;
|
|
20
|
+
commentsLocales: CommentsNs;
|
|
15
21
|
selectMarkNode?: (markNodeKeys: Set<string>, activeElement: Element | null) => void;
|
|
16
22
|
}) => void;
|
|
17
23
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditorType } from '@layers-app/editor';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
export interface ICommentReaction {
|
|
3
4
|
id: string;
|
|
@@ -11,72 +12,69 @@ export interface ICommentReaction {
|
|
|
11
12
|
deletedAt: string;
|
|
12
13
|
version: number;
|
|
13
14
|
}
|
|
14
|
-
export interface ICommentFile
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
webkitRelativePath: string;
|
|
22
|
-
}
|
|
23
|
-
export interface ILocalCommentFile {
|
|
24
|
-
clientKey: string;
|
|
25
|
-
loading?: boolean;
|
|
26
|
-
file: File;
|
|
15
|
+
export interface ICommentFile {
|
|
16
|
+
src: string;
|
|
17
|
+
id: string;
|
|
18
|
+
file: File & {
|
|
19
|
+
id?: string;
|
|
20
|
+
};
|
|
21
|
+
isImage: boolean;
|
|
27
22
|
}
|
|
28
23
|
export type UpdateCommentTextArgs = (text: {
|
|
29
24
|
value: string;
|
|
30
25
|
restore: boolean;
|
|
31
26
|
}, files: {
|
|
32
27
|
deletedFile: ICommentFile[];
|
|
33
|
-
newFiles:
|
|
28
|
+
newFiles: ICommentFile[];
|
|
34
29
|
}, threadOrGeneralId: string, commentId?: string) => void;
|
|
35
30
|
export type Comment = {
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
authorId: string;
|
|
32
|
+
text: string;
|
|
38
33
|
deleted: boolean;
|
|
39
34
|
clientKey: string;
|
|
35
|
+
edited: boolean;
|
|
40
36
|
id: string;
|
|
41
37
|
tempId?: string;
|
|
42
38
|
reactions: ICommentReaction[];
|
|
43
|
-
files: Array<ICommentFile
|
|
39
|
+
files: Array<ICommentFile>;
|
|
44
40
|
timeStamp: number;
|
|
45
|
-
type:
|
|
41
|
+
type: string;
|
|
46
42
|
};
|
|
47
43
|
export type Thread = {
|
|
48
44
|
children: Array<Comment>;
|
|
49
45
|
id: string;
|
|
50
46
|
quote: string;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
edited: boolean;
|
|
48
|
+
type: string;
|
|
49
|
+
resolution: CommentResolve;
|
|
50
|
+
authorId: string;
|
|
54
51
|
tempId?: string;
|
|
55
52
|
reactions: ICommentReaction[];
|
|
56
|
-
files: Array<ICommentFile
|
|
53
|
+
files: Array<ICommentFile>;
|
|
57
54
|
timeStamp: number;
|
|
58
55
|
clientKey: string;
|
|
59
|
-
|
|
56
|
+
text: string;
|
|
60
57
|
deleted: boolean;
|
|
61
58
|
};
|
|
62
59
|
export type GeneralComment = {
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
text: string;
|
|
61
|
+
authorId: string;
|
|
65
62
|
id: string;
|
|
66
63
|
tempId?: string;
|
|
64
|
+
edited: boolean;
|
|
67
65
|
quote: string;
|
|
68
66
|
timeStamp: number;
|
|
69
|
-
|
|
67
|
+
resolution: CommentResolve;
|
|
70
68
|
reactions: ICommentReaction[];
|
|
71
|
-
files: Array<ICommentFile
|
|
72
|
-
type:
|
|
69
|
+
files: Array<ICommentFile>;
|
|
70
|
+
type: string;
|
|
73
71
|
clientKey: string;
|
|
74
72
|
children: Array<Comment>;
|
|
75
73
|
deleted: boolean;
|
|
76
74
|
};
|
|
77
75
|
type CommentValueType = {
|
|
78
76
|
value: string;
|
|
79
|
-
files: (ICommentFile
|
|
77
|
+
files: (ICommentFile)[];
|
|
80
78
|
};
|
|
81
79
|
export type GetEditorFn = (params: {
|
|
82
80
|
onSubmit: () => void;
|
|
@@ -86,61 +84,57 @@ export type GetEditorFn = (params: {
|
|
|
86
84
|
commentValue?: CommentValueType;
|
|
87
85
|
initialContent?: string;
|
|
88
86
|
registerClearEditor?: (fn: () => void) => void;
|
|
87
|
+
editorRef?: React.MutableRefObject<EditorType | null>;
|
|
89
88
|
}) => React.ReactNode;
|
|
90
89
|
export type Comments = Array<Thread | Comment | GeneralComment>;
|
|
91
|
-
export type CommentResolve = 'ACCEPTED' | 'REJECTED' | null;
|
|
90
|
+
export type CommentResolve = 'ACCEPTED' | 'REJECTED' | null | 'NONE';
|
|
92
91
|
export interface ICommentsFilterProps {
|
|
93
92
|
commentsFilter: CommentsFilter;
|
|
94
93
|
setCommentsFilter: React.Dispatch<React.SetStateAction<CommentsFilter>>;
|
|
95
94
|
disabled: boolean;
|
|
95
|
+
listRef: React.RefObject<HTMLElement>;
|
|
96
96
|
updateThreadId: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
|
|
97
97
|
commentValue: {
|
|
98
98
|
value: string;
|
|
99
|
-
files: (ICommentFile
|
|
99
|
+
files: (ICommentFile)[];
|
|
100
100
|
};
|
|
101
101
|
setCommentValue: React.Dispatch<React.SetStateAction<{
|
|
102
102
|
value: string;
|
|
103
|
-
files: (ICommentFile
|
|
103
|
+
files: (ICommentFile)[];
|
|
104
104
|
}>>;
|
|
105
105
|
submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: any | null, files?: File[]) => void;
|
|
106
106
|
}
|
|
107
|
-
export
|
|
107
|
+
export type IMember = {
|
|
108
|
+
avatarUrl: string | null;
|
|
109
|
+
roleType: string;
|
|
110
|
+
roleId: string;
|
|
108
111
|
accepted: boolean;
|
|
109
|
-
avatarUrl: string;
|
|
110
112
|
email: string;
|
|
111
|
-
|
|
113
|
+
userId: string | null;
|
|
112
114
|
invitationId: string | null;
|
|
113
115
|
invitationToken: string | null;
|
|
114
|
-
name: string;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
userId: string;
|
|
118
|
-
}
|
|
116
|
+
name: string | null;
|
|
117
|
+
expiresAt: string | null;
|
|
118
|
+
};
|
|
119
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
|
-
};
|
|
120
|
+
activeWorkspaceId: string | null;
|
|
132
121
|
name: string;
|
|
133
122
|
nickname: string;
|
|
134
|
-
|
|
123
|
+
email: string;
|
|
135
124
|
profilePicture: {
|
|
136
125
|
url: string;
|
|
137
126
|
};
|
|
127
|
+
createdAt: string;
|
|
128
|
+
id: string;
|
|
129
|
+
lang: string;
|
|
130
|
+
plan: string;
|
|
131
|
+
darkMode: boolean;
|
|
138
132
|
timeZone: string | null;
|
|
139
133
|
twoFactorEnabled: boolean;
|
|
140
|
-
workspaces: any[];
|
|
141
134
|
}
|
|
135
|
+
export type ResolvedFilter = 'resolved' | 'not-resolved' | 'all';
|
|
142
136
|
export type CommentsFilter = {
|
|
143
|
-
resolved:
|
|
137
|
+
resolved: ResolvedFilter;
|
|
144
138
|
feedback: boolean;
|
|
145
139
|
filteredUsers: IMember[];
|
|
146
140
|
};
|
|
@@ -222,6 +216,8 @@ interface ICommentActions {
|
|
|
222
216
|
export interface ICommentOptions {
|
|
223
217
|
showComments: boolean;
|
|
224
218
|
setShowComments: (value?: boolean) => void;
|
|
219
|
+
adminPermission: boolean;
|
|
220
|
+
isGuest: boolean;
|
|
225
221
|
pageId: string;
|
|
226
222
|
workspaceInfo: {
|
|
227
223
|
title: string;
|
|
@@ -231,8 +227,8 @@ export interface ICommentOptions {
|
|
|
231
227
|
}
|
|
232
228
|
export interface SharedCommentProps {
|
|
233
229
|
commentOrThread: Comment | Thread | GeneralComment;
|
|
234
|
-
deleteCommentOrThread: (commentOrThread: Comment | Thread, thread?: Thread) => void
|
|
235
|
-
resolveThreat?: (threat: Thread | GeneralComment) => void
|
|
230
|
+
deleteCommentOrThread: (commentOrThread: Comment | Thread, thread?: Thread) => Promise<void>;
|
|
231
|
+
resolveThreat?: (threat: Thread | GeneralComment) => Promise<void>;
|
|
236
232
|
}
|
|
237
233
|
type SelectMarkNodeFn = (markNodeKeys: Set<string>, activeElement: Element | null) => void;
|
|
238
234
|
export interface StoreOptions {
|
|
@@ -241,4 +237,103 @@ export interface StoreOptions {
|
|
|
241
237
|
commentOptions?: ICommentOptions;
|
|
242
238
|
selectMarkNode: SelectMarkNodeFn;
|
|
243
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
|
+
}
|
|
244
339
|
export {};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { default as React, Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { CommentsFilter, CommentsNs, ICommentFile, IMember } from './types.ts';
|
|
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: ICommentFile[], uploadCommentFileApi: any) => Promise<ICommentFile[]>;
|
|
5
5
|
export declare function scrollToTop(selector: string): void;
|
|
6
|
-
export declare const getDescription: (type: string,
|
|
7
|
-
export declare const getTitle: (type: string,
|
|
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;
|
|
8
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;
|