@layers-app/shared 0.0.44 → 0.0.50

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 (130) hide show
  1. package/dist/{KanbanLayout-DrevX3Ow.js → KanbanLayout-oWz6EhPt.js} +5 -5
  2. package/dist/assets/jsons/icons.min.json.d.ts +1 -1
  3. package/dist/components/AppContainer/AppContainer.d.ts +2 -3
  4. package/dist/components/AppContainer/Header.d.ts +8 -0
  5. package/dist/components/AppContainer/Main.d.ts +2 -0
  6. package/dist/components/AppContainer/components/AppSidebarButton.d.ts +9 -0
  7. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts +1 -0
  8. package/dist/components/AppContainer/components/AppsSidebar/AppsSidebar.d.ts +4 -0
  9. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts +1 -0
  10. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts +4 -0
  11. package/dist/components/AppContainer/components/MobileNavbar.d.ts +2 -2
  12. package/dist/components/AppContainer/components/RightSidebar.d.ts +2 -0
  13. package/dist/components/AppContainer/components/SidebarToggleButton.d.ts +3 -0
  14. package/dist/components/AppContainer/components/SlideAnimation.d.ts +6 -0
  15. package/dist/components/AppContainer/components/ToolSidebar.d.ts +3 -0
  16. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +2 -0
  17. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts +1 -0
  18. package/dist/components/AppContainer/components/menus/HelpMenu/WhatsNew.d.ts +7 -0
  19. package/dist/components/AppContainer/components/menus/MoreMenu.d.ts +1 -0
  20. package/dist/components/AppContainer/components/{MenuUserDropdown.d.ts → menus/UserMenu/MenuUserDropdown.d.ts} +1 -1
  21. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  22. package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts +30 -12
  23. package/dist/components/AppContainer/types.d.ts +16 -11
  24. package/dist/components/AppShell/AppShell.d.ts +12 -0
  25. package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.d.ts +24 -0
  26. package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryModal.d.ts +9 -0
  27. package/dist/components/AttachmentsGalleryModal/components/ErrorSection.d.ts +1 -0
  28. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts +9 -0
  29. package/dist/components/AttachmentsGalleryModal/components/ModalFooter.d.ts +4 -0
  30. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts +7 -0
  31. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +10 -0
  32. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +9 -0
  33. package/dist/components/AttachmentsGalleryModal/constants.d.ts +20 -0
  34. package/dist/components/AttachmentsGalleryModal/helpers.d.ts +22 -0
  35. package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts +8 -0
  36. package/dist/components/AttachmentsGalleryModal/hooks/useEmblaCarousel.d.ts +8 -0
  37. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +8 -0
  38. package/dist/components/AttachmentsGalleryModal/hooks/usePanning.d.ts +10 -0
  39. package/dist/components/AttachmentsGalleryModal/hooks/useZoomReset.d.ts +1 -0
  40. package/dist/components/AttachmentsGalleryModal/types.d.ts +0 -8
  41. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts +9 -0
  42. package/dist/components/ColorPicker/ColorPicker.d.ts +1 -0
  43. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +16 -11
  44. package/dist/components/CommentComposer/index.d.ts +2 -55
  45. package/dist/components/CommentComposer/types.d.ts +96 -0
  46. package/dist/components/CommentsPanel/index.d.ts +1 -26
  47. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
  48. package/dist/components/EmojiPicker/getIconsList.d.ts +11 -0
  49. package/dist/components/EmojiPicker/getRandomIcon.d.ts +1 -0
  50. package/dist/components/EntityIcon.d.ts +7 -0
  51. package/dist/components/FilePicker/FilePicker.d.ts +2 -1
  52. package/dist/components/FilePicker/types.d.ts +1 -0
  53. package/dist/components/FormViewer/helpers/conditions.d.ts +2 -2
  54. package/dist/components/FormViewer/helpers/helpers.d.ts +2 -2
  55. package/dist/components/FormViewer/helpers/steps.d.ts +2 -2
  56. package/dist/components/FormViewer/hooks/useActiveStep.d.ts +2 -2
  57. package/dist/components/FormViewer/store/formStore.d.ts +36 -36
  58. package/dist/components/FormViewer/store/formStoreApi.d.ts +6 -6
  59. package/dist/components/FormViewer/store/selectors.d.ts +684 -684
  60. package/dist/components/FormViewer/types/schemes.d.ts +44 -44
  61. package/dist/components/Loaders/BaseLoader.d.ts +3 -0
  62. package/dist/components/NavMenu/NavMenu.d.ts +21 -0
  63. package/dist/components/NavMenu/components/DnDItem.d.ts +8 -0
  64. package/dist/components/NavMenu/components/DnDProvider.d.ts +8 -0
  65. package/dist/components/NavMenu/components/DraggableOverlay.d.ts +1 -0
  66. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts +2 -0
  67. package/dist/components/NavMenu/components/NavMenuItem.d.ts +7 -0
  68. package/dist/components/NavMenu/components/NavMenuLabel.d.ts +3 -0
  69. package/dist/components/NavMenu/index.d.ts +5 -0
  70. package/dist/components/NavMenu/store.d.ts +37 -0
  71. package/dist/components/NavMenu/types.d.ts +29 -0
  72. package/dist/components/NavbarResizer/NavbarResizer.d.ts +5 -2
  73. package/dist/components/Notification/Notification.d.ts +1 -0
  74. package/dist/components/Notification/NotificationCard.d.ts +1 -1
  75. package/dist/components/ProjectIcon/ProjectIcon.d.ts +8 -3
  76. package/dist/components/RichText/index.d.ts +3 -3
  77. package/dist/components/SubmitModal/index.d.ts +2 -2
  78. package/dist/components/UserAvatar/index.d.ts +1 -1
  79. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +6 -10
  80. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts +2 -14
  81. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts +9 -8
  82. package/dist/components/modals/RemoveConfirmModal.d.ts +7 -0
  83. package/dist/constants.d.ts +0 -1
  84. package/dist/helpers/download.d.ts +2 -2
  85. package/dist/helpers/hotjar.d.ts +9 -0
  86. package/dist/helpers/pickRandomEmoji.d.ts +1 -0
  87. package/dist/hooks/useDateUtils.d.ts +1 -0
  88. package/dist/hooks/useMenu.d.ts +0 -3
  89. package/dist/icons.min-43tm8BtD.js +4 -0
  90. package/dist/{index-B6qa0aiu.js → index-tn5CWDGz.js} +23985 -22644
  91. package/dist/index.d.ts +14 -13
  92. package/dist/index.js +247 -249
  93. package/dist/index.umd.cjs +59 -59
  94. package/dist/lang/index.d.ts +4 -0
  95. package/dist/lang/locales/ui_en.json.d.ts +81 -0
  96. package/dist/lang/locales/ui_es.json.d.ts +78 -0
  97. package/dist/lang/locales/ui_ru.json.d.ts +82 -0
  98. package/dist/types/files.d.ts +18 -0
  99. package/package.json +2 -3
  100. package/dist/components/AppContainer/components/AllAppsMenu.d.ts +0 -5
  101. package/dist/components/AppContainer/components/DesktopNavbar.d.ts +0 -7
  102. package/dist/components/AppContainer/components/NavbarFooter.d.ts +0 -3
  103. package/dist/components/AppContainer/components/NavbarHeader.d.ts +0 -3
  104. package/dist/components/AttachmentsGalleryModal/ShakaPlayer.d.ts +0 -15
  105. package/dist/components/AttachmentsGalleryModal/index.d.ts +0 -2
  106. package/dist/components/CommentFilterMenu/index.d.ts +0 -9
  107. package/dist/components/CommentsPanel/components/CommentActionMenu.d.ts +0 -10
  108. package/dist/components/CommentsPanel/components/CommentActions.d.ts +0 -16
  109. package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +0 -21
  110. package/dist/components/CommentsPanel/components/CommentTabFilter.d.ts +0 -7
  111. package/dist/components/CommentsPanel/components/CommentsEmptyPlaceholder.d.ts +0 -6
  112. package/dist/components/CommentsPanel/components/CommentsFilterHeader.d.ts +0 -3
  113. package/dist/components/CommentsPanel/components/CommentsListItemMenu.d.ts +0 -7
  114. package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +0 -18
  115. package/dist/components/CommentsPanel/components/CommentsThreadReplyControls.d.ts +0 -15
  116. package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +0 -10
  117. package/dist/components/CommentsPanel/components/Icon.d.ts +0 -8
  118. package/dist/components/CommentsPanel/store.d.ts +0 -25
  119. package/dist/components/CommentsPanel/types.d.ts +0 -339
  120. package/dist/components/CommentsPanel/utils.d.ts +0 -14
  121. package/dist/components/InfoMenu/index.d.ts +0 -1
  122. package/dist/components/InviteModal/InviteModal.d.ts +0 -2
  123. package/dist/components/InviteModal/slice.d.ts +0 -13
  124. package/dist/components/Notification/index.d.ts +0 -6
  125. package/dist/components/modals/openRemoveConfirmModal.d.ts +0 -4
  126. package/dist/helpers/pickRandomIcon.d.ts +0 -1
  127. package/dist/icons.min-wo13YUY4.js +0 -4
  128. package/dist/store/aboutModal.d.ts +0 -7
  129. package/dist/store/trashModal.d.ts +0 -7
  130. /package/dist/components/{AttachmentsGalleryModal → ImageModal}/ImageModal.d.ts +0 -0
@@ -5,8 +5,7 @@ declare global {
5
5
  preSignMode?: boolean;
6
6
  }
7
7
  }
8
- export declare const AppContainer: (({ header, content, navbar, navbarTitle, displayType, footer, onTitleChange, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
8
+ export declare const AppContainer: (({ header, content, toolbar, navbarTitle, footer, onTitleChange, trashMenu, rightbar, onInviteClick, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
9
9
  NavbarContent: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
10
- NavbarFooter: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
11
- NavbarHeader: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
10
+ NewButton: ({ children, ...props }: import('@mantine/core').PolymorphicComponentProps<"button", import('@mantine/core').ButtonProps>) => import("react/jsx-runtime").JSX.Element;
12
11
  };
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+ declare global {
3
+ interface Window {
4
+ publicMode?: boolean;
5
+ preSignMode?: boolean;
6
+ }
7
+ }
8
+ export declare const Header: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare const Main: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { MouseEventHandler } from 'react';
2
+ type AppSidebarButtonProps = {
3
+ title: string;
4
+ icon: React.ReactNode;
5
+ active?: boolean;
6
+ onClick?: MouseEventHandler<HTMLButtonElement>;
7
+ };
8
+ export declare const AppSidebarButton: import('react').ForwardRefExoticComponent<AppSidebarButtonProps & import('react').RefAttributes<HTMLDivElement>>;
9
+ export {};
@@ -0,0 +1 @@
1
+ export declare const AppsSection: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const AppsSidebar: ({ trashMenu, onInviteClick, }: {
2
+ trashMenu: React.ReactNode;
3
+ onInviteClick?: () => void;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const TopSection: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const UserSection: ({ trashMenu, onInviteClick, }: {
2
+ trashMenu: React.ReactNode;
3
+ onInviteClick?: () => void;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import { AppContainerProps } from '../types';
2
- export declare const MobileNavbar: (props: Pick<AppContainerProps, "navbar">) => import("react/jsx-runtime").JSX.Element;
1
+ import { PropsWithChildren } from 'react';
2
+ export declare const MobileNavbar: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare const RightSidebar: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const SidebarToggleButton: ({ forOpen }: {
2
+ forOpen?: boolean;
3
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ export declare const SlideAnimation: ({ children, show, width, position, }: {
2
+ children: React.ReactNode;
3
+ show: boolean;
4
+ width: string;
5
+ position: "left" | "right";
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { AppContainerProps } from '../types';
3
+ export declare const ToolSidebar: (props: PropsWithChildren<Pick<AppContainerProps, "navbarTitle" | "onTitleChange">>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ButtonProps, PolymorphicComponentProps } from '@mantine/core';
2
+ export declare const ToolbarNewButton: ({ children, ...props }: PolymorphicComponentProps<"button", ButtonProps>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const HelpMenu: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export type WhatsNewProps = {
2
+ items?: {
3
+ title: string;
4
+ link: string;
5
+ }[];
6
+ };
7
+ export declare const WhatsNew: ({ items }: WhatsNewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const MoreMenu: () => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
- import { appMode } from '../../..';
2
+ import { appMode } from '../../../../..';
3
3
  import { FloatingPosition } from '@mantine/core';
4
4
  export type MenuUser = {
5
5
  id: string;
@@ -1,2 +1,2 @@
1
1
  import { AppContainerActionsStore, AppContainerDataStore } from '../types';
2
- export declare const useAppContainer: ({ user, workspaceMenu, tools, userMenuItems, notifications, isAnonym, readNotificationsFunc, publicMode, showMessenger, showNewMessage, }: AppContainerDataStore & AppContainerActionsStore) => void;
2
+ export declare const useAppContainer: ({ user, workspaceMenu, tools, userMenuItems, notifications, isAnonym, readNotificationsFunc, publicMode, showMessenger, showNewMessage, version, updatedAt, privacyPolicyLink, userAgreementLink, whatsNewItems, }: AppContainerDataStore & AppContainerActionsStore) => void;
@@ -1,14 +1,32 @@
1
+ import { StoreApi, UseBoundStore } from 'zustand';
1
2
  import { AppContainerStore } from '../types';
2
- export declare const useAppContainerStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<AppContainerStore>, "setState" | "persist"> & {
3
- setState(partial: AppContainerStore | Partial<AppContainerStore> | ((state: AppContainerStore) => AppContainerStore | Partial<AppContainerStore>), replace?: false | undefined): unknown;
4
- setState(state: AppContainerStore | ((state: AppContainerStore) => AppContainerStore), replace: true): unknown;
5
- persist: {
6
- setOptions: (options: Partial<import('zustand/middleware').PersistOptions<AppContainerStore, AppContainerStore, unknown>>) => void;
7
- clearStorage: () => void;
8
- rehydrate: () => Promise<void> | void;
9
- hasHydrated: () => boolean;
10
- onHydrate: (fn: (state: AppContainerStore) => void) => () => void;
11
- onFinishHydration: (fn: (state: AppContainerStore) => void) => () => void;
12
- getOptions: () => Partial<import('zustand/middleware').PersistOptions<AppContainerStore, AppContainerStore, unknown>>;
3
+ export declare const appContainerStore: {
4
+ useStore: UseBoundStore<Omit<StoreApi<AppContainerStore>, "setState" | "persist"> & {
5
+ setState(partial: AppContainerStore | Partial<AppContainerStore> | ((state: AppContainerStore) => AppContainerStore | Partial<AppContainerStore>), replace?: false | undefined): unknown;
6
+ setState(state: AppContainerStore | ((state: AppContainerStore) => AppContainerStore), replace: true): unknown;
7
+ persist: {
8
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<AppContainerStore, AppContainerStore, unknown>>) => void;
9
+ clearStorage: () => void;
10
+ rehydrate: () => Promise<void> | void;
11
+ hasHydrated: () => boolean;
12
+ onHydrate: (fn: (state: AppContainerStore) => void) => () => void;
13
+ onFinishHydration: (fn: (state: AppContainerStore) => void) => () => void;
14
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<AppContainerStore, AppContainerStore, unknown>>;
15
+ };
16
+ }>;
17
+ api: {
18
+ toggleToolbar: () => void;
19
+ closeToolbar: () => void;
20
+ openToolbar: () => void;
21
+ toggleRightbar: () => void;
22
+ closeRightbar: () => void;
23
+ openRightbar: () => void;
24
+ toggleTourPassed: (flag: boolean) => void;
25
+ setToolbarWidth: (width: number) => void;
26
+ setRightbarWidth: (width: number) => void;
27
+ toggleToolVisibility: (id: string) => void;
28
+ setWithoutToolbar: (flag: boolean) => void;
29
+ setWithoutHeader: (flag: boolean) => void;
30
+ setTheme: (theme: string) => void;
13
31
  };
14
- }>;
32
+ };
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { WorkspaceMenuProps } from '../WorkspaceMenu/WorkspaceMenu';
3
- import { MenuUser, UserNotifications } from './components/MenuUserDropdown';
3
+ import { WhatsNewProps } from './components/menus/HelpMenu/WhatsNew';
4
+ import { MenuUser, UserNotifications } from './components/menus/UserMenu/MenuUserDropdown';
4
5
  export type ToolDef = {
5
6
  id: string;
6
7
  name: string;
@@ -12,12 +13,15 @@ export type ToolDef = {
12
13
  };
13
14
  export type AppContainerProps = {
14
15
  content?: ReactNode;
15
- navbar?: ReactNode;
16
+ toolbar?: ReactNode;
17
+ rightbar?: ReactNode;
16
18
  header?: ReactNode;
17
19
  navbarTitle?: string;
18
20
  displayType?: 'ROUNDED' | 'BOXED';
19
21
  footer?: ReactNode;
20
22
  onTitleChange?: (title?: string) => void;
23
+ trashMenu?: ReactNode;
24
+ onInviteClick?: () => void;
21
25
  };
22
26
  export type AppContainerDataStore = {
23
27
  tools: ToolDef[];
@@ -31,6 +35,11 @@ export type AppContainerDataStore = {
31
35
  publicMode: boolean;
32
36
  showMessenger: () => void;
33
37
  showNewMessage: (message: string) => void;
38
+ version: string;
39
+ updatedAt: string;
40
+ privacyPolicyLink: string;
41
+ userAgreementLink: string;
42
+ whatsNewItems: WhatsNewProps['items'];
34
43
  };
35
44
  type ReadNotificationsRequest = {
36
45
  messageIds: number[];
@@ -41,18 +50,14 @@ export type AppContainerActionsStore = {
41
50
  readNotificationsFunc: (data: ReadNotificationsRequest) => void;
42
51
  };
43
52
  export type AppContainerStore = {
44
- navbarWidth: number;
45
- onNavbarWidthChange: (width: number) => void;
46
- opened: boolean;
47
- toggle: () => void;
48
- close: () => void;
49
- open: () => void;
53
+ toolbarWidth: number;
54
+ showToolbar: boolean;
50
55
  theme: string;
51
56
  hiddenTools: string[];
52
- toggleToolVisibility: (id: string) => void;
53
- withoutNavbar: boolean;
57
+ withoutToolbar: boolean;
54
58
  withoutHeader: boolean;
55
59
  isTourPassed: boolean;
56
- toggleTourPassed: (flag: boolean) => void;
60
+ showRightbar: boolean;
61
+ rightbarWidth: number;
57
62
  };
58
63
  export {};
@@ -0,0 +1,12 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { BoxProps } from '@mantine/core';
3
+ export type AppShellProps = BoxProps;
4
+ export declare const AppShell: (({ children, ...props }: PropsWithChildren<AppShellProps>) => import("react/jsx-runtime").JSX.Element) & {
5
+ Section: ({ children, ...props }: PropsWithChildren<BoxProps>) => import("react/jsx-runtime").JSX.Element;
6
+ LeftSidebar: ({ children, ...props }: PropsWithChildren<BoxProps>) => import("react/jsx-runtime").JSX.Element;
7
+ RightSidebar: ({ children, ...props }: PropsWithChildren<BoxProps>) => import("react/jsx-runtime").JSX.Element;
8
+ Content: ({ children, ...props }: PropsWithChildren<BoxProps>) => import("react/jsx-runtime").JSX.Element;
9
+ Header: ({ children, ...props }: PropsWithChildren<BoxProps>) => import("react/jsx-runtime").JSX.Element;
10
+ Main: ({ children, ...props }: PropsWithChildren<BoxProps>) => import("react/jsx-runtime").JSX.Element;
11
+ WorkContent: ({ children, ...props }: PropsWithChildren<BoxProps>) => import("react/jsx-runtime").JSX.Element;
12
+ };
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from 'react';
2
+ import { ReactZoomPanPinchContentRef } from 'react-zoom-pan-pinch';
3
+ import { EmblaCarouselType } from 'embla-carousel';
4
+ interface AttachmentsGalleryContextValue {
5
+ embla: EmblaCarouselType | null;
6
+ setEmbla: (embla: EmblaCarouselType | null) => void;
7
+ canScrollPrev: boolean;
8
+ setCanScrollPrev: (value: boolean) => void;
9
+ canScrollNext: boolean;
10
+ setCanScrollNext: (value: boolean) => void;
11
+ selectedIndex: number;
12
+ setSelectedIndex: (value: number) => void;
13
+ zoomPercentage: number;
14
+ setZoomPercentage: (value: number) => void;
15
+ transformRefs: React.MutableRefObject<ReactZoomPanPinchContentRef[]>;
16
+ prevIndexRef: React.MutableRefObject<number>;
17
+ }
18
+ export declare const useAttachmentsGalleryContext: () => AttachmentsGalleryContextValue;
19
+ interface AttachmentsGalleryProviderProps {
20
+ children: ReactNode;
21
+ initialIndex: number;
22
+ }
23
+ export declare const AttachmentsGalleryProvider: ({ children, initialIndex, }: AttachmentsGalleryProviderProps) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,9 @@
1
+ import { IFileResponse } from '../../types/files.ts';
2
+ interface AttachmentsGalleryModalV2Props {
3
+ opened: boolean;
4
+ onOpenChange?: (opened: boolean) => void;
5
+ attachments?: IFileResponse[];
6
+ initialIndex?: number;
7
+ }
8
+ export declare const AttachmentsGalleryModal: import('react').MemoExoticComponent<({ opened, onOpenChange, attachments, initialIndex, }: AttachmentsGalleryModalV2Props) => import("react/jsx-runtime").JSX.Element>;
9
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ErrorSection: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { TransformWrapper } from 'react-zoom-pan-pinch';
2
+ import { IFileResponse } from '../../../types/files.ts';
3
+ interface IProps {
4
+ onTransformed?: React.ComponentProps<typeof TransformWrapper>['onTransformed'];
5
+ isActive: boolean;
6
+ attachment: IFileResponse;
7
+ }
8
+ export declare const GallerySlide: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<IProps & import('react').RefAttributes<HTMLDivElement>>>;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ import { IFileResponse } from '../../../types/files.ts';
2
+ export declare const ModalFooter: ({ attachments, }: {
3
+ attachments?: IFileResponse[];
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import { IFileResponse } from '../../../types/files.ts';
2
+ interface ModalHeaderProps {
3
+ onClose: () => void;
4
+ attachments?: IFileResponse[];
5
+ }
6
+ export declare const ModalHeader: import('react').MemoExoticComponent<({ onClose, attachments }: ModalHeaderProps) => import("react/jsx-runtime").JSX.Element>;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ type BaseProps = {
2
+ autoPlay?: boolean;
3
+ isActive?: boolean;
4
+ attachmentId: string;
5
+ loader?: React.ReactNode;
6
+ stylesContainer?: React.CSSProperties;
7
+ classNameContainer?: string;
8
+ };
9
+ export declare const ShakaVideoPlayer: ({ attachmentId, autoPlay, isActive, loader, stylesContainer, classNameContainer, }: BaseProps) => string | number | boolean | Iterable<import('react').ReactNode> | import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const useShakePlayer: ({ attachmentId, isActive, autoPlay, }: {
2
+ attachmentId?: string;
3
+ isActive?: boolean;
4
+ autoPlay?: boolean;
5
+ }) => {
6
+ containerRef: import('react').RefObject<HTMLDivElement>;
7
+ isError: boolean;
8
+ vodUrl: string | null;
9
+ };
@@ -0,0 +1,20 @@
1
+ export declare const MOCK_SLIDES: string[];
2
+ export declare const ZOOM_CONFIG: {
3
+ readonly initialScale: 1;
4
+ readonly minScale: 1;
5
+ readonly maxScale: 5;
6
+ readonly wheelStep: 0.1;
7
+ readonly buttonStepPercent: 50;
8
+ };
9
+ export declare const MODAL_TRANSITION: {
10
+ readonly duration: 200;
11
+ readonly exitDuration: 200;
12
+ };
13
+ export declare const TRANSFORM_COMPONENT_STYLES: {
14
+ width: string;
15
+ height: string;
16
+ display: string;
17
+ alignItems: string;
18
+ justifyContent: string;
19
+ };
20
+ export declare const STEPS: number[];
@@ -0,0 +1,22 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { ReactZoomPanPinchContentRef } from 'react-zoom-pan-pinch';
3
+ export declare const animateTransform: ({ instance, from, to, duration, animationRef, }: {
4
+ instance: ReactZoomPanPinchContentRef["instance"];
5
+ from: {
6
+ scale: number;
7
+ x: number;
8
+ y: number;
9
+ };
10
+ to: {
11
+ scale: number;
12
+ x: number;
13
+ y: number;
14
+ };
15
+ duration: number;
16
+ animationRef: MutableRefObject<number | null>;
17
+ }) => void;
18
+ export declare const zoomStep: ({ dir, activeRef, animationRef, }: {
19
+ dir: "in" | "out";
20
+ activeRef: ReactZoomPanPinchContentRef;
21
+ animationRef: MutableRefObject<number | null>;
22
+ }) => void;
@@ -0,0 +1,8 @@
1
+ import { SyntheticEvent } from 'react';
2
+ import { IFileResponse } from '../../../types/files.ts';
3
+ export declare const useDownloadFile: (targetAttach?: IFileResponse) => {
4
+ isVideo: boolean;
5
+ isMobile: boolean;
6
+ onDownload: (e: SyntheticEvent) => Promise<void>;
7
+ isFetching: boolean;
8
+ };
@@ -0,0 +1,8 @@
1
+ export declare const useEmblaCarousel: () => {
2
+ scrollPrev: () => void;
3
+ scrollNext: () => void;
4
+ canScrollPrev: boolean;
5
+ canScrollNext: boolean;
6
+ selectedIndex: number;
7
+ visibleSlides: number[];
8
+ };
@@ -0,0 +1,8 @@
1
+ import { IFileResponse } from '../../../types/files.ts';
2
+ export declare const useGetPreviewUrl: (attachment: IFileResponse) => {
3
+ fileUrl: string | null;
4
+ isFetching: boolean;
5
+ isError: boolean;
6
+ setIsError: import('react').Dispatch<import('react').SetStateAction<boolean>>;
7
+ isVideo: boolean;
8
+ };
@@ -0,0 +1,10 @@
1
+ export declare const usePanning: ({ isVideo, isFetching, }: {
2
+ isFetching: boolean;
3
+ isVideo: boolean;
4
+ }) => {
5
+ onMouseDown: (e: React.MouseEvent) => void;
6
+ onMouseMove: (e: React.MouseEvent) => void;
7
+ onMouseUp: () => void;
8
+ onMouseLeave: () => void;
9
+ onDoubleClick: () => void;
10
+ };
@@ -0,0 +1 @@
1
+ export declare const useZoomReset: () => void;
@@ -5,11 +5,3 @@ export type IAttachment = {
5
5
  contentType: string;
6
6
  Url?: string;
7
7
  };
8
- export type AttachmentsGalleryModalProps = {
9
- opened: boolean;
10
- onOpenChange: (v: boolean) => void;
11
- showAttach?: IAttachment | null;
12
- setShowAttach?: (v: IAttachment | null) => void;
13
- attachments: IAttachment[];
14
- translation?: Record<string, string>;
15
- };
@@ -0,0 +1,9 @@
1
+ import { CommentComposerTypes } from '../CommentComposer/types';
2
+ interface CommentAttachmentsPreviewProps {
3
+ files: CommentComposerTypes.AnyCommentFile[];
4
+ mode: 'draft' | 'view';
5
+ onRemove?: (index: number) => void;
6
+ parentIsExisting?: boolean;
7
+ }
8
+ export declare const AttachmentsPreview: ({ files, onRemove, mode, parentIsExisting, }: CommentAttachmentsPreviewProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -12,6 +12,7 @@ export declare const ColorPicker: import('react').ForwardRefExoticComponent<{
12
12
  colors?: string[];
13
13
  swatchShape?: "circle" | "square";
14
14
  fullWidth?: boolean;
15
+ swatchSize?: number;
15
16
  } & Omit<FlexProps, "onChange"> & import('react').RefAttributes<HTMLDivElement>> & {
16
17
  ColorCircle: import('react').ForwardRefExoticComponent<ColorCircleProps & import('react').RefAttributes<HTMLDivElement>>;
17
18
  };
@@ -1,12 +1,17 @@
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;
1
+ import { default as React } from 'react';
2
+ import { CommentComposerTypes } from './types';
3
+ export declare const CommentEditorHandler: ({ children, onSubmit, editorRef, commentDraft, onBlur, inputContainerRef, isFloat, isEdit, hasChanges, ns, }: {
4
+ children: React.ReactNode;
6
5
  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 {};
6
+ editorRef: React.MutableRefObject<any>;
7
+ inputContainerRef: React.MutableRefObject<any>;
8
+ commentDraft: {
9
+ text: string;
10
+ files: CommentComposerTypes.CommentAttachment[];
11
+ };
12
+ onBlur?: () => void;
13
+ isFloat: boolean;
14
+ isEdit: boolean;
15
+ hasChanges: boolean;
16
+ ns: string;
17
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,55 +1,2 @@
1
- import { MutableRefObject } from 'react';
2
- import { RangeSelection, EditorType } from '@layers-app/editor';
3
- import { Comment, CommentsNs, GeneralComment, ICommentFile, ICommentOptions, IUser, Thread } from '../CommentsPanel/types.ts';
4
- import * as React from 'react';
5
- interface CommentValue {
6
- value: string;
7
- files: ICommentFile[];
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
- editorRef?: React.MutableRefObject<EditorType | null>;
18
- }) => React.ReactNode;
19
- getSelectionText?: (selection: RangeSelection) => string;
20
- removeCommentImage?: (index: string) => void;
21
- providedUser?: IUser;
22
- updateLocation?: (boxElem: HTMLDivElement, selectionRef: MutableRefObject<RangeSelection | null>, selectionState: {
23
- container: HTMLDivElement;
24
- elements: HTMLSpanElement[];
25
- }) => void;
26
- commentValue: {
27
- value: string;
28
- files: ICommentFile[];
29
- };
30
- setCommentValue: React.Dispatch<React.SetStateAction<{
31
- value: string;
32
- files: ICommentFile[];
33
- }>>;
34
- isEditInput?: boolean;
35
- autoFocus?: boolean;
36
- handleBlur: () => void;
37
- thread?: Thread;
38
- updateThreadId?: (tempId: string, realId: string, updatedAt: string, commentType: string, files: ICommentFile[], thread?: Thread) => void;
39
- setCommentActions?: React.Dispatch<React.SetStateAction<{
40
- replyList: string[];
41
- editCommentId: string;
42
- editedContent: string;
43
- }>>;
44
- isGeneral?: boolean;
45
- submitAddComment: (commentOrThread: Comment | Thread | GeneralComment, isInlineComment: boolean, thread?: Thread | GeneralComment, selection?: RangeSelection | null, files?: File[]) => void;
46
- handleEditComment?: (data: {
47
- value: string;
48
- files: ICommentFile[];
49
- }) => void;
50
- provideCommentOptions?: ICommentOptions;
51
- placeholder?: string;
52
- composerLocales?: CommentsNs;
53
- }
54
- 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;
55
- export {};
1
+ import { CommentComposerProps } from './types';
2
+ export declare const CommentComposer: ({ children, onSubmit, initialDraft, updateLocation, onBlur, setEdit, ns, }: CommentComposerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,96 @@
1
+ export declare namespace CommentComposerTypes {
2
+ enum Entity {
3
+ None = "NONE",
4
+ Project = "PROJECT",
5
+ Sprint = "SPRINT",
6
+ Folder = "FOLDER",
7
+ Workspace = "WORKSPACE",
8
+ Page = "PAGE",
9
+ Task = "PROJECTTASK",
10
+ Form = "FORM",
11
+ Attachment = "ATTACHMENT",
12
+ User = "USER",
13
+ Comment = "COMMENT",
14
+ Flow = "FLOW"
15
+ }
16
+ interface OptimisticCommentFile {
17
+ id: string;
18
+ name: string;
19
+ type: string;
20
+ size: number;
21
+ url: string;
22
+ src: string;
23
+ isImage: boolean;
24
+ isTemp: true;
25
+ raw: File;
26
+ }
27
+ interface CommentAttachment {
28
+ id: string;
29
+ name: string;
30
+ type: string;
31
+ size: number;
32
+ url: string;
33
+ src: string;
34
+ isImage: boolean;
35
+ isTemp: boolean;
36
+ raw?: File;
37
+ }
38
+ type AnyCommentFile = CommentAttachment;
39
+ interface CommentDraft {
40
+ text: string;
41
+ files: CommentAttachment[];
42
+ }
43
+ interface RenderEditorParams {
44
+ onSubmit: () => void;
45
+ handleBlur: (e: any) => void;
46
+ setCommentDraft: React.Dispatch<React.SetStateAction<CommentDraft>>;
47
+ commentDraft: CommentDraft;
48
+ editorRef: React.MutableRefObject<unknown>;
49
+ initialContent?: string;
50
+ }
51
+ interface ComposerInitialDraft {
52
+ text: string;
53
+ files: CommentAttachment[];
54
+ }
55
+ interface ComposerDraft {
56
+ text: string;
57
+ files: CommentAttachment[];
58
+ quote?: string;
59
+ }
60
+ interface EditChangesPayload {
61
+ textChanged: boolean;
62
+ newFiles: CommentAttachment[];
63
+ deletedFiles: CommentAttachment[];
64
+ newText: string;
65
+ }
66
+ type ComposerSubmitPayload = {
67
+ mode: 'create';
68
+ data: ComposerDraft;
69
+ } | {
70
+ mode: 'edit';
71
+ data: EditChangesPayload;
72
+ };
73
+ }
74
+ export interface CommentComposerBaseProps {
75
+ children?: (params: CommentComposerTypes.RenderEditorParams) => React.ReactNode;
76
+ onSubmit: (payload: CommentComposerTypes.ComposerSubmitPayload) => void;
77
+ initialDraft?: CommentComposerTypes.ComposerInitialDraft;
78
+ ns?: string;
79
+ setEdit?: (v: {
80
+ id: string;
81
+ text: string;
82
+ files: CommentComposerTypes.AnyCommentFile[];
83
+ }) => void;
84
+ }
85
+ export interface FloatComposerProps extends CommentComposerBaseProps {
86
+ updateLocation: (boxElem: HTMLDivElement, selectionRef: React.MutableRefObject<any>, selectionState: {
87
+ container: HTMLDivElement;
88
+ elements: HTMLSpanElement[];
89
+ }) => void;
90
+ onBlur: () => void;
91
+ }
92
+ export interface InlineComposerProps extends CommentComposerBaseProps {
93
+ updateLocation?: undefined;
94
+ onBlur?: () => void;
95
+ }
96
+ export type CommentComposerProps = FloatComposerProps | InlineComposerProps;