microboard-ui-temp 0.0.3
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/.github/workflows/npm-publish.yml +66 -0
- package/Dockerfile +15 -0
- package/LICENSE.txt +17 -0
- package/MicroboardLicense.txt +84 -0
- package/README.md +23 -0
- package/bun.lock +1079 -0
- package/bunPlugins/copyPlugin.ts +81 -0
- package/bunfig.toml +1 -0
- package/docker-compose.yml +7 -0
- package/package.json +49 -0
- package/scripts/buildPkg.ts +29 -0
- package/scripts/buildSpa.ts +29 -0
- package/server.ts +18 -0
- package/src/App/App.ts +502 -0
- package/src/App/BoardsList.ts +752 -0
- package/src/App/Clipboard.ts +22 -0
- package/src/App/Connection.ts +758 -0
- package/src/App/Location.ts +23 -0
- package/src/App/MediaHelpers.ts +221 -0
- package/src/App/Paste/index.ts +5 -0
- package/src/App/Paste/pasteTextToTheBoard.ts +19 -0
- package/src/App/Paste/tryToGetMarkdownFromDataTransfer.ts +60 -0
- package/src/App/Paste/tryToPasteAsItemOrReturnText.ts +72 -0
- package/src/App/Paste/tryToPasteAudioByLink.ts +35 -0
- package/src/App/Paste/tryToPasteFromMicroboard.ts +15 -0
- package/src/App/Paste/tryToPasteFromMiro.ts +75 -0
- package/src/App/Paste/tryToPasteImages.ts +44 -0
- package/src/App/Paste/tryToPasteVideoByLink.ts +68 -0
- package/src/App/Permissions.ts +43 -0
- package/src/App/README.md +58 -0
- package/src/App/SessionStorage.ts +248 -0
- package/src/App/Storage.ts +122 -0
- package/src/App/Wheel/Wheel.spec.ts +40 -0
- package/src/App/Wheel/Wheel.ts +229 -0
- package/src/App/Wheel/WheelEventLogger.ts +70 -0
- package/src/App/Wheel/WheelEvents.spec.ts +418 -0
- package/src/App/Wheel/index.ts +1 -0
- package/src/App/Wheel/mockedWheelData.ts +77658 -0
- package/src/App/getController.ts +878 -0
- package/src/App/getSubscriptions.ts +155 -0
- package/src/App/index.ts +1 -0
- package/src/App/isFirefox.ts +3 -0
- package/src/App/isMacos.ts +2 -0
- package/src/App/isSafari.ts +17 -0
- package/src/App/router.tsx +149 -0
- package/src/App/testRecorder.ts +393 -0
- package/src/App/throttlePointerEvent.ts +27 -0
- package/src/App/useAccount.ts +19 -0
- package/src/App/useBoardSubscription.ts +14 -0
- package/src/App/useBoardsList.ts +18 -0
- package/src/App/useDomMbr.ts +65 -0
- package/src/Config.ts +41 -0
- package/src/Globals.d.ts +6 -0
- package/src/WhiteBoardModule/Readme.md +21 -0
- package/src/WhiteBoardModule/WhiteBoardModuleNative.tsx +60 -0
- package/src/WhiteBoardModule/WhiteboardModuleReact.tsx +61 -0
- package/src/development.entrypoint.ts +38 -0
- package/src/entities/AIInput/AIContext.tsx +377 -0
- package/src/entities/AIInput/AIDropdown.tsx +296 -0
- package/src/entities/AIInput/AIGenerationButton.tsx +54 -0
- package/src/entities/AIInput/AIInput.module.css +488 -0
- package/src/entities/AIInput/AIInput.tsx +427 -0
- package/src/entities/AIInput/StarIcon.tsx +201 -0
- package/src/entities/AIInput/index.ts +12 -0
- package/src/entities/AIInput/utils.ts +384 -0
- package/src/entities/BoardMenu/BoardMenu.module.css +38 -0
- package/src/entities/BoardMenu/BoardMenu.tsx +86 -0
- package/src/entities/BoardMenu/MouseOrTracpadModal/MouseOrTrackpadModal.tsx +138 -0
- package/src/entities/BoardMenu/MouseOrTracpadModal/MouseOrTracpadModal.module.css +93 -0
- package/src/entities/BoardMenu/index.ts +1 -0
- package/src/entities/BoardMenu/sections/Comments.tsx +65 -0
- package/src/entities/BoardMenu/sections/Items.tsx +85 -0
- package/src/entities/BoardMenu/sections/MouseOrTrackpad.tsx +108 -0
- package/src/entities/BoardName/BoardName.module.css +61 -0
- package/src/entities/BoardName/BoardName.tsx +66 -0
- package/src/entities/BoardName/BoardRename.module.css +15 -0
- package/src/entities/BoardName/BoardRename.tsx +93 -0
- package/src/entities/BoardName/index.ts +3 -0
- package/src/entities/Canvas/Canvas.tsx +250 -0
- package/src/entities/Canvas/CanvasNoRouter.tsx +216 -0
- package/src/entities/Canvas/index.ts +2 -0
- package/src/entities/Folder/DragOverlay.tsx +52 -0
- package/src/entities/Folder/DragPlaceholder.module.css +5 -0
- package/src/entities/Folder/DragPlaceholder.tsx +6 -0
- package/src/entities/Folder/DraggingItem.module.css +8 -0
- package/src/entities/Folder/DraggingWrapper.tsx +18 -0
- package/src/entities/Folder/Folder.module.css +113 -0
- package/src/entities/Folder/Folder.tsx +356 -0
- package/src/entities/Folder/FolderItem.module.css +89 -0
- package/src/entities/Folder/FolderItem.tsx +165 -0
- package/src/entities/Folder/FoldersDndContext.tsx +129 -0
- package/src/entities/Folder/OpenedFoldersContext.tsx +33 -0
- package/src/entities/Folder/index.ts +8 -0
- package/src/entities/account/Account.ts +542 -0
- package/src/entities/account/AuthForm.module.css +150 -0
- package/src/entities/account/AuthForm.tsx +48 -0
- package/src/entities/account/AuthGuard.tsx +17 -0
- package/src/entities/account/AuthInterceptor.ts +21 -0
- package/src/entities/account/UnauthGuard.tsx +17 -0
- package/src/entities/account/index.ts +5 -0
- package/src/entities/comments/Cluster/Cluster.module.css +43 -0
- package/src/entities/comments/Cluster/Cluster.tsx +100 -0
- package/src/entities/comments/CommentContainer/CommentContainer.module.css +51 -0
- package/src/entities/comments/CommentContainer/CommentContainer.tsx +232 -0
- package/src/entities/comments/CommentContainer/CommentPreview/CommentPreview.module.css +89 -0
- package/src/entities/comments/CommentContainer/CommentPreview/CommentPreview.tsx +92 -0
- package/src/entities/comments/CommentInput/CommentInput.module.css +69 -0
- package/src/entities/comments/CommentInput/CommentInput.tsx +122 -0
- package/src/entities/comments/CommentsContext.tsx +65 -0
- package/src/entities/comments/CommentsPanel/CommentCard/CommentCard.module.css +36 -0
- package/src/entities/comments/CommentsPanel/CommentCard/CommentCard.tsx +132 -0
- package/src/entities/comments/CommentsPanel/CommentCard/Message/Message.module.css +73 -0
- package/src/entities/comments/CommentsPanel/CommentCard/Message/Message.tsx +72 -0
- package/src/entities/comments/CommentsPanel/CommentsPanel.module.css +143 -0
- package/src/entities/comments/CommentsPanel/CommentsPanel.tsx +278 -0
- package/src/entities/comments/CommentsPanel/CommentsPanelContext.tsx +37 -0
- package/src/entities/comments/CommentsProvider.module.css +4 -0
- package/src/entities/comments/CommentsProvider.tsx +73 -0
- package/src/entities/comments/CreateComment/CreateComment.module.css +8 -0
- package/src/entities/comments/CreateComment/CreateComment.tsx +66 -0
- package/src/entities/comments/Thread/ExtraOptions/ExtraOptions.module.css +44 -0
- package/src/entities/comments/Thread/ExtraOptions/ExtraOptions.tsx +127 -0
- package/src/entities/comments/Thread/OptionsPanel/OptionsPanel.module.css +32 -0
- package/src/entities/comments/Thread/OptionsPanel/OptionsPanel.tsx +38 -0
- package/src/entities/comments/Thread/ThreadPanel.module.css +82 -0
- package/src/entities/comments/Thread/ThreadPanel.tsx +298 -0
- package/src/entities/comments/Thread/message/Message.module.css +71 -0
- package/src/entities/comments/Thread/message/Message.tsx +137 -0
- package/src/entities/comments/index.ts +7 -0
- package/src/entities/comments/lib.ts +22 -0
- package/src/entities/comments/useCommentsMerge.ts +88 -0
- package/src/entities/comments/useIntersectionObserver.ts +58 -0
- package/src/entities/comments/useScrollToUnreadMessage.ts +24 -0
- package/src/env.d.ts +12 -0
- package/src/features/AccessDeniedModal/AccessDeniedModal.module.css +56 -0
- package/src/features/AccessDeniedModal/AccessDeniedModal.tsx +94 -0
- package/src/features/AccessDeniedModal/index.ts +1 -0
- package/src/features/AiUnavailableModal/AiUnavailableModal.module.css +52 -0
- package/src/features/AiUnavailableModal/AiUnavailableModal.tsx +59 -0
- package/src/features/AiUnavailableModal/index.ts +1 -0
- package/src/features/AppContext.tsx +17 -0
- package/src/features/AppView/AppView.module.css +18 -0
- package/src/features/AppView/AppView.tsx +302 -0
- package/src/features/AppView/InactiveBoardHidder.tsx +14 -0
- package/src/features/AppView/LocalAppView.tsx +177 -0
- package/src/features/AppView/NoBoardIsOpen.module.css +29 -0
- package/src/features/AppView/NoBoardIsOpen.tsx +69 -0
- package/src/features/AppView/QuickAddPanel/QuickAddPanel.module.css +12 -0
- package/src/features/AppView/QuickAddPanel/QuickAddPanel.tsx +171 -0
- package/src/features/AppView/QuickAddPanel/index.ts +1 -0
- package/src/features/AppView/index.ts +2 -0
- package/src/features/AppView/listeners.ts +0 -0
- package/src/features/AudioPlayer/AudioPlayer.module.css +213 -0
- package/src/features/AudioPlayer/AudioPlayer.tsx +517 -0
- package/src/features/AudioPlayer/index.ts +1 -0
- package/src/features/ChangePasswordModal/ChangePassword.module.css +129 -0
- package/src/features/ChangePasswordModal/ChangePasswordModal.tsx +247 -0
- package/src/features/ChangePasswordModal/index.ts +4 -0
- package/src/features/ContextMenu/ContextMenu.module.css +38 -0
- package/src/features/ContextMenu/ContextMenu.tsx +507 -0
- package/src/features/ContextMenu/ContextMenuContext.tsx +77 -0
- package/src/features/ContextMenu/index.ts +5 -0
- package/src/features/ContextPanel/Buttons/AIGeneration.tsx +72 -0
- package/src/features/ContextPanel/Buttons/AIModel/AIModel.module.css +5 -0
- package/src/features/ContextPanel/Buttons/AIModel/AIModel.tsx +97 -0
- package/src/features/ContextPanel/Buttons/AIModel/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/AIModel.tsx +95 -0
- package/src/features/ContextPanel/Buttons/AddList/AddList.tsx +83 -0
- package/src/features/ContextPanel/Buttons/AddList/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/ButtonWithMenu/ButtonWithMenu.tsx +107 -0
- package/src/features/ContextPanel/Buttons/ButtonWithMenu/UiButtonWithMenu.module.css +49 -0
- package/src/features/ContextPanel/Buttons/ButtonWithMenu/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/CardGame/Card/CreateDeck.tsx +65 -0
- package/src/features/ContextPanel/Buttons/CardGame/Card/FlipCard.tsx +41 -0
- package/src/features/ContextPanel/Buttons/CardGame/Deck/GetCard.tsx +61 -0
- package/src/features/ContextPanel/Buttons/CardGame/Deck/ShuffleDeck.tsx +39 -0
- package/src/features/ContextPanel/Buttons/CardGame/Dice/ChangeRange/ChangeRange.module.css +53 -0
- package/src/features/ContextPanel/Buttons/CardGame/Dice/ChangeRange/ChangeRange.tsx +133 -0
- package/src/features/ContextPanel/Buttons/CardGame/Dice/ThrowDice.tsx +38 -0
- package/src/features/ContextPanel/Buttons/ConnectorAddText.tsx +55 -0
- package/src/features/ContextPanel/Buttons/ConnectorFontStyle.tsx +28 -0
- package/src/features/ContextPanel/Buttons/ConnectorLineColor.tsx +96 -0
- package/src/features/ContextPanel/Buttons/ConnectorTextColor.tsx +22 -0
- package/src/features/ContextPanel/Buttons/ConnectorTextHighlight.tsx +28 -0
- package/src/features/ContextPanel/Buttons/ConnectorType/ConnectorType.module.css +5 -0
- package/src/features/ContextPanel/Buttons/ConnectorType/ConnectorType.tsx +108 -0
- package/src/features/ContextPanel/Buttons/ConnectorType/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/ContextPanelButton.module.css +19 -0
- package/src/features/ContextPanel/Buttons/Delete.tsx +32 -0
- package/src/features/ContextPanel/Buttons/DrawFillStyle.tsx +107 -0
- package/src/features/ContextPanel/Buttons/DrawStrokeWidth/DrawStrokeWidth.module.css +4 -0
- package/src/features/ContextPanel/Buttons/DrawStrokeWidth/DrawStrokeWidth.tsx +32 -0
- package/src/features/ContextPanel/Buttons/DrawStrokeWidth/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/Duplicate.tsx +25 -0
- package/src/features/ContextPanel/Buttons/Edit.tsx +23 -0
- package/src/features/ContextPanel/Buttons/EndPointer/EndPointer.module.css +14 -0
- package/src/features/ContextPanel/Buttons/EndPointer/EndPointer.tsx +80 -0
- package/src/features/ContextPanel/Buttons/EndPointer/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/FillStyle.tsx +91 -0
- package/src/features/ContextPanel/Buttons/FontSize/ConnectorFontSize.tsx +34 -0
- package/src/features/ContextPanel/Buttons/FontSize/FontSize.module.css +53 -0
- package/src/features/ContextPanel/Buttons/FontSize/FontSize.tsx +217 -0
- package/src/features/ContextPanel/Buttons/FontSize/index.ts +2 -0
- package/src/features/ContextPanel/Buttons/FontStyle.tsx +68 -0
- package/src/features/ContextPanel/Buttons/FrameFill.tsx +91 -0
- package/src/features/ContextPanel/Buttons/FrameNavNext.tsx +33 -0
- package/src/features/ContextPanel/Buttons/FrameNavPrev.tsx +37 -0
- package/src/features/ContextPanel/Buttons/FrameRatio/FrameRatio.module.css +14 -0
- package/src/features/ContextPanel/Buttons/FrameRatio/FrameRatio.tsx +113 -0
- package/src/features/ContextPanel/Buttons/FrameRatio/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/HyperLinkBtn.tsx +53 -0
- package/src/features/ContextPanel/Buttons/ItemType/ItemType.module.css +15 -0
- package/src/features/ContextPanel/Buttons/ItemType/ItemType.tsx +115 -0
- package/src/features/ContextPanel/Buttons/ItemType/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/Lock.tsx +98 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/BringToFront.tsx +28 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/CopyFrameLink.tsx +50 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/CopyItemLink.tsx +48 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/ExportFrame.tsx +32 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/SaveImg.tsx +32 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/SaveVideoOrAudio.tsx +45 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/SendToBack.tsx +28 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/SetLinkTo.tsx +35 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/getLinkToItem.tsx +3 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/Items/index.ts +5 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/RestOptionsMenu.module.css +51 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/RestOptionsMenu.tsx +96 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/RestOptionsMenuItem.tsx +29 -0
- package/src/features/ContextPanel/Buttons/RestOptionsMenu/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/StartPointer/StartPointer.module.css +18 -0
- package/src/features/ContextPanel/Buttons/StartPointer/StartPointer.tsx +87 -0
- package/src/features/ContextPanel/Buttons/StartPointer/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/StickerFillStyle.tsx +74 -0
- package/src/features/ContextPanel/Buttons/StrokeStyle/StrokeStyle.module.css +19 -0
- package/src/features/ContextPanel/Buttons/StrokeStyle/StrokeStyle.tsx +144 -0
- package/src/features/ContextPanel/Buttons/StrokeStyle/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/SwitchPointers.tsx +28 -0
- package/src/features/ContextPanel/Buttons/TextAlignment/TextAlignment.module.css +6 -0
- package/src/features/ContextPanel/Buttons/TextAlignment/TextAlignment.tsx +98 -0
- package/src/features/ContextPanel/Buttons/TextAlignment/index.ts +1 -0
- package/src/features/ContextPanel/Buttons/TextAlignmentSticker.tsx +87 -0
- package/src/features/ContextPanel/Buttons/TextColor.tsx +86 -0
- package/src/features/ContextPanel/Buttons/TextHighlight.tsx +85 -0
- package/src/features/ContextPanel/Buttons/ToggleFrameRatio.tsx +38 -0
- package/src/features/ContextPanel/Buttons/ToggleIsShining.tsx +36 -0
- package/src/features/ContextPanel/ContextPanel.module.css +9 -0
- package/src/features/ContextPanel/ContextPanel.tsx +531 -0
- package/src/features/ContextPanel/PanelContext.ts +17 -0
- package/src/features/ContextPanel/index.ts +1 -0
- package/src/features/ContextWrapper.tsx +47 -0
- package/src/features/Counter/Counter.module.css +20 -0
- package/src/features/Counter/Counter.tsx +49 -0
- package/src/features/CryptoWrapper/CryptoWrapper.tsx +79 -0
- package/src/features/CryptoWrapper/index.ts +1 -0
- package/src/features/Cursors/comment.svg +22 -0
- package/src/features/Cursors/customCursors.ts +31 -0
- package/src/features/Cursors/eraser.svg +3 -0
- package/src/features/Cursors/index.ts +1 -0
- package/src/features/Cursors/pencil.svg +3 -0
- package/src/features/Cursors/sticker/sticker-black.svg +27 -0
- package/src/features/Cursors/sticker/sticker-blue.svg +27 -0
- package/src/features/Cursors/sticker/sticker-gray.svg +27 -0
- package/src/features/Cursors/sticker/sticker-green.svg +27 -0
- package/src/features/Cursors/sticker/sticker-light-blue.svg +28 -0
- package/src/features/Cursors/sticker/sticker-light-gray.svg +27 -0
- package/src/features/Cursors/sticker/sticker-light-green.svg +27 -0
- package/src/features/Cursors/sticker/sticker-orange.svg +27 -0
- package/src/features/Cursors/sticker/sticker-pink.svg +27 -0
- package/src/features/Cursors/sticker/sticker-purple.svg +27 -0
- package/src/features/Cursors/sticker/sticker-sky-blue.svg +27 -0
- package/src/features/Cursors/sticker/sticker-yellow.svg +27 -0
- package/src/features/ErrorBoundary/ErrorBoundary.module.css +64 -0
- package/src/features/ErrorBoundary/ErrorBoundary.tsx +112 -0
- package/src/features/ErrorBoundary/index.ts +1 -0
- package/src/features/ExportPanel/ExportPanel.module.css +55 -0
- package/src/features/ExportPanel/ExportPanel.tsx +73 -0
- package/src/features/ExportPanel/ExportVisible.tsx +18 -0
- package/src/features/ExportPanel/index.ts +1 -0
- package/src/features/GameItems/CreateCardsModal.tsx +178 -0
- package/src/features/GameItems/CreateDiceModal.tsx +213 -0
- package/src/features/GameItems/Modal.module.css +148 -0
- package/src/features/GameItems/index.ts +1 -0
- package/src/features/GenerateChart/AIChat.module.css +162 -0
- package/src/features/GenerateChart/AIChat.tsx +198 -0
- package/src/features/GenerateChart/AIChatPanel.module.css +34 -0
- package/src/features/GenerateChart/AIChatPanel.tsx +72 -0
- package/src/features/GenerateChart/lib/engine/index.ts +616 -0
- package/src/features/GenerateChart/lib/transformOutput.ts +338 -0
- package/src/features/GoogleAuthBtn/GoogleAuthBtn.module.css +19 -0
- package/src/features/GoogleAuthBtn/GoogleAuthBtn.tsx +19 -0
- package/src/features/GoogleAuthBtn/icons.tsx +301 -0
- package/src/features/GoogleAuthBtn/index.ts +1 -0
- package/src/features/ImportMiro/AuthClipboardModal/AuthClipboardModal.module.css +26 -0
- package/src/features/ImportMiro/AuthClipboardModal/AuthClipboardModal.tsx +38 -0
- package/src/features/ImportMiro/ImgAuthClipboardModal/ImgAuthClipboardModal.module.css +36 -0
- package/src/features/ImportMiro/ImgAuthClipboardModal/ImgAuthClipboardModal.tsx +74 -0
- package/src/features/ImportMiro/ImportMiroBoards/ImportBoardItem/MiroClipboardTransformer.ts +765 -0
- package/src/features/ImportMiro/ImportMiroBoards/ImportBoardItem/index.ts +1 -0
- package/src/features/ImportMiro/ImportMiroBoards/ImportBoardItem/useCopyBoardItems.tsx +1156 -0
- package/src/features/ImportMiro/ImportMiroBoards/ImportMiro.module.css +157 -0
- package/src/features/ImportMiro/ImportMiroBoards/ImportMiro.tsx +95 -0
- package/src/features/ImportMiro/ImportMiroBoards/MiroModels.ts +250 -0
- package/src/features/ImportMiro/ImportMiroBoards/Notifications/ErrorNotification.tsx +48 -0
- package/src/features/ImportMiro/ImportMiroBoards/Notifications/LoadingNotification.tsx +53 -0
- package/src/features/ImportMiro/ImportMiroBoards/Notifications/SuccessNotification.tsx +54 -0
- package/src/features/ImportMiro/ImportMiroBoards/Notifications/WarnClipboardNotification.tsx +57 -0
- package/src/features/ImportMiro/ImportMiroBoards/Notifications/WarnNotification.tsx +68 -0
- package/src/features/ImportMiro/ImportMiroBoards/Notifications/index.ts +5 -0
- package/src/features/ImportMiro/ImportMiroStartModal/ImportMiroStartModal.module.css +35 -0
- package/src/features/ImportMiro/ImportMiroStartModal/ImportMiroStartModal.tsx +47 -0
- package/src/features/ImportMiro/index.ts +5 -0
- package/src/features/ItemTooltip/ItemTooltip.tsx +77 -0
- package/src/features/ItemTooltip/index.ts +1 -0
- package/src/features/ItemsProvider/ItemsProvider.tsx +45 -0
- package/src/features/ItemsProvider/index.ts +1 -0
- package/src/features/LandingMenu/LandingMenu.module.css +54 -0
- package/src/features/LandingMenu/LandingMenu.tsx +88 -0
- package/src/features/LandingMenu/MobileLandingMenu.module.css +78 -0
- package/src/features/LandingMenu/MobileLandingMenu.tsx +133 -0
- package/src/features/LandingMenu/const.ts +2 -0
- package/src/features/LandingMenu/index.ts +2 -0
- package/src/features/LinksProvider/LinkToButton/LinkToButton.module.css +34 -0
- package/src/features/LinksProvider/LinkToButton/LinkToButton.tsx +175 -0
- package/src/features/LinksProvider/LinksProvider.tsx +84 -0
- package/src/features/LinksProvider/index.ts +1 -0
- package/src/features/LocalFileSavingProgress/LocalFileSaveProgress.module.css +6 -0
- package/src/features/LocalFileSavingProgress/LocalFileSaveProgress.tsx +30 -0
- package/src/features/LocalFileSavingProgress/index.ts +1 -0
- package/src/features/LoginWith/LoginWith.module.css +18 -0
- package/src/features/LoginWith/LoginWith.tsx +15 -0
- package/src/features/MediaUnavailableModal/MediaUnavailableModal.module.css +52 -0
- package/src/features/MediaUnavailableModal/MediaUnavailableModal.tsx +64 -0
- package/src/features/MediaUnavailableModal/index.ts +4 -0
- package/src/features/Modal/ConfirmModal.module.css +71 -0
- package/src/features/Modal/ConfirmModal.tsx +199 -0
- package/src/features/Modal/CookiesModal.module.css +32 -0
- package/src/features/Modal/CookiesModal.tsx +75 -0
- package/src/features/Modal/InfoModal.module.css +49 -0
- package/src/features/Modal/InfoModal.tsx +90 -0
- package/src/features/Modal/ModalsWrapper.tsx +13 -0
- package/src/features/Modal/SetLinkToModal.module.css +49 -0
- package/src/features/Modal/SetLinkToModal.tsx +112 -0
- package/src/features/Notifications/Notifications.module.css +14 -0
- package/src/features/Notifications/SigninErrorNotification.tsx +34 -0
- package/src/features/Notifications/SignupErrorNotification.tsx +33 -0
- package/src/features/Notifications/index.ts +8 -0
- package/src/features/Pickers/ColorPicker/ColorItem.module.css +44 -0
- package/src/features/Pickers/ColorPicker/ColorItem.tsx +33 -0
- package/src/features/Pickers/ColorPicker/ColorPicker.module.css +12 -0
- package/src/features/Pickers/ColorPicker/ColorPicker.tsx +43 -0
- package/src/features/Pickers/ColorPicker/SquareColorItem.module.css +41 -0
- package/src/features/Pickers/ColorPicker/SquareColorItem.tsx +27 -0
- package/src/features/Pickers/ColorPicker/index.ts +1 -0
- package/src/features/Pickers/ConnectorLineStylePicker.tsx +52 -0
- package/src/features/Pickers/ConnectorPointerPicker/ConnectorPointerPicker.module.css +4 -0
- package/src/features/Pickers/ConnectorPointerPicker/ConnectorPointerPicker.tsx +39 -0
- package/src/features/Pickers/ConnectorPointerPicker/index.ts +1 -0
- package/src/features/Pickers/DrawingToolPicker.tsx +31 -0
- package/src/features/Pickers/FontSizePicker/FontSizePicker.module.css +8 -0
- package/src/features/Pickers/FontSizePicker/FontSizePicker.tsx +61 -0
- package/src/features/Pickers/FontSizePicker/index.ts +1 -0
- package/src/features/Pickers/FontStylePicker.tsx +88 -0
- package/src/features/Pickers/FramePicker/FramePicker.module.css +11 -0
- package/src/features/Pickers/FramePicker/FramePicker.tsx +40 -0
- package/src/features/Pickers/FramePicker/index.ts +1 -0
- package/src/features/Pickers/HorizontalAlignmentPicker.tsx +49 -0
- package/src/features/Pickers/ShapeTypePicker.tsx +80 -0
- package/src/features/Pickers/SliderPicker/SliderPicker.module.css +13 -0
- package/src/features/Pickers/SliderPicker/SliderPicker.tsx +43 -0
- package/src/features/Pickers/SliderPicker/index.ts +1 -0
- package/src/features/Pickers/StrokeStylePicker/StrokeStylePicker.module.css +4 -0
- package/src/features/Pickers/StrokeStylePicker/StrokeStylePicker.tsx +59 -0
- package/src/features/Pickers/StrokeStylePicker/index.ts +1 -0
- package/src/features/Pickers/VerticalAlignmentPicker.tsx +48 -0
- package/src/features/Presence/BringToMe/BringToMe.module.css +134 -0
- package/src/features/Presence/BringToMe/BringToMe.tsx +363 -0
- package/src/features/Presence/PresenceUsers/Dropdown.tsx +70 -0
- package/src/features/Presence/PresenceUsers/EyeIcon.tsx +16 -0
- package/src/features/Presence/PresenceUsers/PresenceUserAvatar.tsx +93 -0
- package/src/features/Presence/PresenceUsers/PresenceUsers.module.css +366 -0
- package/src/features/Presence/PresenceUsers/PresenceUsers.tsx +239 -0
- package/src/features/Presence/PresenceUsers/UserAvatar.tsx +92 -0
- package/src/features/Presence/PresenceUsers/mock.ts +34 -0
- package/src/features/Presence/UserTracking/UserTracking.module.css +72 -0
- package/src/features/Presence/UserTracking/UserTracking.tsx +67 -0
- package/src/features/ProfileSettingsModal/ProfileSettingsModal.module.css +100 -0
- package/src/features/ProfileSettingsModal/ProfileSettingsModal.tsx +333 -0
- package/src/features/ProfileSettingsModal/index.ts +4 -0
- package/src/features/QuickAddButtons/QuickAddButtonsClear.tsx +12 -0
- package/src/features/README.md +36 -0
- package/src/features/Rename/RenameContext.tsx +54 -0
- package/src/features/Rename/RenameInput.module.css +15 -0
- package/src/features/Rename/RenameInput.tsx +78 -0
- package/src/features/Rename/index.ts +2 -0
- package/src/features/ShapesPanel/ShapesCategory/ShapesCategory.module.css +29 -0
- package/src/features/ShapesPanel/ShapesCategory/ShapesCategory.tsx +70 -0
- package/src/features/ShapesPanel/ShapesPanel.module.css +75 -0
- package/src/features/ShapesPanel/ShapesPanel.tsx +69 -0
- package/src/features/ShapesPanel/ShapesPanelContext.tsx +109 -0
- package/src/features/ShapesPanel/index.ts +5 -0
- package/src/features/ShareModal/SaveShareModal.module.css +31 -0
- package/src/features/ShareModal/SaveShareModal.tsx +63 -0
- package/src/features/ShareModal/SearchInput.module.css +188 -0
- package/src/features/ShareModal/SearchInput.tsx +441 -0
- package/src/features/ShareModal/ShareModal.module.css +297 -0
- package/src/features/ShareModal/ShareModal.tsx +627 -0
- package/src/features/ShareModal/SharePanel.module.css +74 -0
- package/src/features/ShareModal/SharePanel.tsx +258 -0
- package/src/features/ShareModal/index.ts +1 -0
- package/src/features/ShareSnapshotModal/ShareSnapshotModal.module.css +286 -0
- package/src/features/ShareSnapshotModal/ShareSnapshotModal.tsx +41 -0
- package/src/features/ShareSnapshotModal/SnapshotNameInput.module.css +92 -0
- package/src/features/ShareSnapshotModal/SnapshotNameInput.tsx +225 -0
- package/src/features/ShareSnapshotModal/index.ts +1 -0
- package/src/features/SidePanel/LocalSidePanelContext.tsx +66 -0
- package/src/features/SidePanel/ResizableEdge.module.css +9 -0
- package/src/features/SidePanel/ResizableEdge.tsx +77 -0
- package/src/features/SidePanel/SidePanel.module.css +140 -0
- package/src/features/SidePanel/SidePanel.tsx +179 -0
- package/src/features/SidePanel/SidePanelContext.tsx +108 -0
- package/src/features/SidePanel/index.ts +3 -0
- package/src/features/SidePanelsContainer/SidePanelsContainer.module.css +15 -0
- package/src/features/SidePanelsContainer/SidePanelsContainer.tsx +61 -0
- package/src/features/SidePanelsContainer/index.ts +1 -0
- package/src/features/Templates/CreateTemplateModal/CreateTemplateModal.module.css +34 -0
- package/src/features/Templates/CreateTemplateModal/CreateTemplateModal.tsx +463 -0
- package/src/features/Templates/SelectTemplateModal/CategoriesMenu/CategoriesMenu.module.css +48 -0
- package/src/features/Templates/SelectTemplateModal/CategoriesMenu/CategoriesMenu.tsx +62 -0
- package/src/features/Templates/SelectTemplateModal/LanguagesDropdown/LanguagesDropdown.module.css +61 -0
- package/src/features/Templates/SelectTemplateModal/LanguagesDropdown/LanguagesDropdown.tsx +72 -0
- package/src/features/Templates/SelectTemplateModal/SelectTemplateModal.module.css +152 -0
- package/src/features/Templates/SelectTemplateModal/SelectTemplateModal.tsx +206 -0
- package/src/features/Templates/SelectTemplateModal/TemplateItemPreview/TemplateItemPreview.module.css +151 -0
- package/src/features/Templates/SelectTemplateModal/TemplateItemPreview/TemplateItemPreview.tsx +77 -0
- package/src/features/Templates/SelectTemplateModal/TemplateItemsGrid/TemplateItem/TemplateItem.tsx +119 -0
- package/src/features/Templates/SelectTemplateModal/TemplateItemsGrid/TemplateItem/templateItem.module.css +88 -0
- package/src/features/Templates/SelectTemplateModal/TemplateItemsGrid/TemplateItemsGrid.module.css +51 -0
- package/src/features/Templates/SelectTemplateModal/TemplateItemsGrid/TemplateItemsGrid.tsx +39 -0
- package/src/features/Templates/TolgeeProvider.tsx +29 -0
- package/src/features/Templates/config.ts +6 -0
- package/src/features/Templates/index.ts +2 -0
- package/src/features/Templates/lib.ts +59 -0
- package/src/features/TextEditor/Element.tsx +204 -0
- package/src/features/TextEditor/Leaf.tsx +72 -0
- package/src/features/TextEditor/README.md +3 -0
- package/src/features/TextEditor/TextEditor.module.css +115 -0
- package/src/features/TextEditor/TextEditor.tsx +610 -0
- package/src/features/TextEditor/index.ts +1 -0
- package/src/features/TextEditor/verticalAlignmentToFlex.tsx +14 -0
- package/src/features/TitlePanel/TitlePanel.module.css +123 -0
- package/src/features/TitlePanel/TitlePanel.tsx +341 -0
- package/src/features/TitlePanel/index.ts +1 -0
- package/src/features/ToastProvider.tsx +33 -0
- package/src/features/ToolsPanel/Buttons/AddConnector.tsx +73 -0
- package/src/features/ToolsPanel/Buttons/AddCounter.tsx +29 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/AddDrawing.module.css +13 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/AddDrawing.tsx +115 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/AddDrawingContext.tsx +15 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/AddHighlighter/AddHighlighter.module.css +26 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/AddHighlighter/AddHighlighter.tsx +138 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/AddPen/AddPen.module.css +26 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/AddPen/AddPen.tsx +126 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/Eraser/Eraser.tsx +47 -0
- package/src/features/ToolsPanel/Buttons/AddDrawing/index.ts +1 -0
- package/src/features/ToolsPanel/Buttons/AddFrame.tsx +57 -0
- package/src/features/ToolsPanel/Buttons/AddGameItem/AddCard.tsx +31 -0
- package/src/features/ToolsPanel/Buttons/AddGameItem/AddDice.tsx +32 -0
- package/src/features/ToolsPanel/Buttons/AddGameItem/AddGameItem.module.css +3 -0
- package/src/features/ToolsPanel/Buttons/AddGameItem/AddGameItem.tsx +39 -0
- package/src/features/ToolsPanel/Buttons/AddMedia/AddMedia.module.css +3 -0
- package/src/features/ToolsPanel/Buttons/AddMedia/AddMedia.tsx +72 -0
- package/src/features/ToolsPanel/Buttons/AddMedia/AddMediaButton.tsx +146 -0
- package/src/features/ToolsPanel/Buttons/AddShape/AddShape.module.css +18 -0
- package/src/features/ToolsPanel/Buttons/AddShape/AddShape.tsx +97 -0
- package/src/features/ToolsPanel/Buttons/AddShape/index.ts +1 -0
- package/src/features/ToolsPanel/Buttons/AddSticker.tsx +73 -0
- package/src/features/ToolsPanel/Buttons/AddTemplate.tsx +28 -0
- package/src/features/ToolsPanel/Buttons/AddText.tsx +31 -0
- package/src/features/ToolsPanel/Buttons/ButtonWithMenu/ButtonWithMenu.module.css +9 -0
- package/src/features/ToolsPanel/Buttons/ButtonWithMenu/ButtonWithMenu.tsx +24 -0
- package/src/features/ToolsPanel/Buttons/ButtonWithMenu/index.ts +1 -0
- package/src/features/ToolsPanel/Buttons/EventList/EventList.module.css +5 -0
- package/src/features/ToolsPanel/Buttons/EventList/EventList.tsx +144 -0
- package/src/features/ToolsPanel/Buttons/EventList/History.tsx +140 -0
- package/src/features/ToolsPanel/Buttons/EventList/HistoryEvent.tsx +28 -0
- package/src/features/ToolsPanel/Buttons/EventList/PrettifiedEvent.tsx +212 -0
- package/src/features/ToolsPanel/Buttons/EventList/SyncJournal.tsx +89 -0
- package/src/features/ToolsPanel/Buttons/EventList/index.ts +1 -0
- package/src/features/ToolsPanel/Buttons/Grab.tsx +29 -0
- package/src/features/ToolsPanel/Buttons/Redo.tsx +40 -0
- package/src/features/ToolsPanel/Buttons/Select.tsx +37 -0
- package/src/features/ToolsPanel/Buttons/Star.tsx +31 -0
- package/src/features/ToolsPanel/Buttons/Undo.tsx +39 -0
- package/src/features/ToolsPanel/PanelContext.ts +13 -0
- package/src/features/ToolsPanel/ToolsPanel.module.css +33 -0
- package/src/features/ToolsPanel/ToolsPanel.tsx +84 -0
- package/src/features/ToolsPanel/ViewToolsPanel.tsx +30 -0
- package/src/features/ToolsPanel/index.ts +1 -0
- package/src/features/UserPanel/ActionButtons/ActionButtons.module.css +9 -0
- package/src/features/UserPanel/ActionButtons/ActionButtons.tsx +22 -0
- package/src/features/UserPanel/Avatar/Avatar.module.css +21 -0
- package/src/features/UserPanel/Avatar/Avatar.tsx +44 -0
- package/src/features/UserPanel/Buttons/AddComment/AddComment.module.css +14 -0
- package/src/features/UserPanel/Buttons/AddComment/AddComment.tsx +61 -0
- package/src/features/UserPanel/Buttons/AddComment/index.ts +1 -0
- package/src/features/UserPanel/Buttons/ButtonWithMenu/ButtonWithMenu.module.css +8 -0
- package/src/features/UserPanel/Buttons/ButtonWithMenu/ButtonWithMenu.tsx +24 -0
- package/src/features/UserPanel/Buttons/ButtonWithMenu/index.ts +1 -0
- package/src/features/UserPanel/Buttons/ShareBtn/ShareBtn.tsx +49 -0
- package/src/features/UserPanel/Buttons/TogglePresenceRender/TogglePresenceRender.module.css +48 -0
- package/src/features/UserPanel/Buttons/TogglePresenceRender/TogglePresenceRender.tsx +38 -0
- package/src/features/UserPanel/UserAvatar/UserAvatar.tsx +66 -0
- package/src/features/UserPanel/UserDropdown/UserDropdown.tsx +75 -0
- package/src/features/UserPanel/UserPanel.module.css +516 -0
- package/src/features/UserPanel/UserPanel.tsx +153 -0
- package/src/features/UserPanel/UserPic/UserPic.tsx +171 -0
- package/src/features/UserPanel/icons/ChangePassword.tsx +22 -0
- package/src/features/UserPanel/icons/Click.tsx +20 -0
- package/src/features/UserPanel/icons/Logout.tsx +22 -0
- package/src/features/UserPanel/icons/Ring.tsx +18 -0
- package/src/features/UserPanel/icons/Thumb.tsx +18 -0
- package/src/features/UserPanel/icons/Upgrade.tsx +20 -0
- package/src/features/UserPanel/icons/UserShare.tsx +18 -0
- package/src/features/UserPlan/HistoryModal.tsx +30 -0
- package/src/features/UserPlan/HistoryTable.tsx +114 -0
- package/src/features/UserPlan/LimitsModal.tsx +102 -0
- package/src/features/UserPlan/LimitsTable.module.css +131 -0
- package/src/features/UserPlan/LimitsTable.tsx +171 -0
- package/src/features/UserPlan/PlanCard.module.css +184 -0
- package/src/features/UserPlan/PlanCard.tsx +245 -0
- package/src/features/UserPlan/PlanCards.module.css +26 -0
- package/src/features/UserPlan/PlanCards.tsx +476 -0
- package/src/features/UserPlan/SelectPaymentModal.module.css +206 -0
- package/src/features/UserPlan/SelectPaymentModal.tsx +810 -0
- package/src/features/UserPlan/UserPlanModal.module.css +145 -0
- package/src/features/UserPlan/UserPlanModal.tsx +124 -0
- package/src/features/UserPlan/UserPlanUsage.module.css +101 -0
- package/src/features/UserPlan/UserPlanUsage.tsx +186 -0
- package/src/features/UserPlan/index.ts +1 -0
- package/src/features/VideoPlayer/VideoCanvasControls.tsx +59 -0
- package/src/features/VideoPlayer/VideoPlayer.module.css +3 -0
- package/src/features/VideoPlayer/VideoPlayer.tsx +158 -0
- package/src/features/VideoPlayer/index.ts +2 -0
- package/src/features/ViewModeGuard.tsx +62 -0
- package/src/features/WalletLoginButton/WalletLoginButton.module.css +7 -0
- package/src/features/WalletLoginButton/WalletLoginButton.tsx +77 -0
- package/src/features/WalletLoginButton/index.ts +1 -0
- package/src/features/Widgets/Navbar/Navbar.css +148 -0
- package/src/features/Widgets/Navbar/Navbar.tsx +75 -0
- package/src/features/Widgets/Navbar/lead-icon.tsx +25 -0
- package/src/features/Widgets/form-notifications/password-changed.module.css +39 -0
- package/src/features/Widgets/form-notifications/password-changed.tsx +28 -0
- package/src/features/ZoomPanel/ZoomPanel.module.css +32 -0
- package/src/features/ZoomPanel/ZoomPanel.tsx +105 -0
- package/src/features/ZoomPanel/index.ts +1 -0
- package/src/features/hotkeys.json +315 -0
- package/src/features/hyperLink/HyperLink.module.css +20 -0
- package/src/features/hyperLink/HyperLink.tsx +77 -0
- package/src/features/hyperLink/HyperLinkContext.tsx +57 -0
- package/src/features/hyperLink/HyperLinkInput/HyperLinkInput.module.css +47 -0
- package/src/features/hyperLink/HyperLinkInput/HyperLinkInput.tsx +196 -0
- package/src/features/hyperLink/index.ts +6 -0
- package/src/features/index.drawio +115 -0
- package/src/features/index.svg +1 -0
- package/src/features/modules.d.ts +22 -0
- package/src/index.css +65 -0
- package/src/index.html +74 -0
- package/src/index.ts +4 -0
- package/src/initI18N.ts +42 -0
- package/src/pages/AddEmailView/AddEmailPage.module.css +136 -0
- package/src/pages/AddEmailView/AddEmailPage.tsx +125 -0
- package/src/pages/AddEmailView/index.ts +1 -0
- package/src/pages/BindEmailPage/BindEmailPage.module.css +73 -0
- package/src/pages/BindEmailPage/BindEmailPage.tsx +263 -0
- package/src/pages/BindEmailPage/index.ts +1 -0
- package/src/pages/BoardPage.tsx +161 -0
- package/src/pages/ForgotPasswordPage/ForgotPasswordPage.module.css +82 -0
- package/src/pages/ForgotPasswordPage/ForgotPasswordPage.tsx +148 -0
- package/src/pages/ForgotPasswordPage/SuccessIcon.tsx +20 -0
- package/src/pages/ForgotPasswordPage/index.ts +1 -0
- package/src/pages/HTMLSnapshot/HTMLSnapshot.tsx +60 -0
- package/src/pages/HTMLSnapshot/index.ts +1 -0
- package/src/pages/RestorePasswordPage/RestorePasswordPage.module.css +46 -0
- package/src/pages/RestorePasswordPage/RestorePasswordPage.tsx +197 -0
- package/src/pages/RestorePasswordPage/index.ts +1 -0
- package/src/pages/SelectBoardPage/SelectBoardPage.module.css +247 -0
- package/src/pages/SelectBoardPage/SelectBoardPage.tsx +419 -0
- package/src/pages/SelectBoardPage/getEmbedUrl.ts +3 -0
- package/src/pages/SelectBoardPage/index.ts +1 -0
- package/src/pages/SigninPage/SigninPage.module.css +17 -0
- package/src/pages/SigninPage/SigninPage.tsx +201 -0
- package/src/pages/SigninPage/index.ts +1 -0
- package/src/pages/SignupPage/EmailIcon.tsx +24 -0
- package/src/pages/SignupPage/LockIcon.tsx +24 -0
- package/src/pages/SignupPage/PeopleIcon.tsx +23 -0
- package/src/pages/SignupPage/SignupPage.module.css +52 -0
- package/src/pages/SignupPage/SignupPage.tsx +282 -0
- package/src/pages/SignupPage/index.ts +1 -0
- package/src/pages/TestPage.tsx +52 -0
- package/src/pages/VerifyMailPage/VerifyMailPage.module.css +20 -0
- package/src/pages/VerifyMailPage/VerifyMailPage.tsx +287 -0
- package/src/pages/VerifyMailPage/index.ts +1 -0
- package/src/pages/WelcomePage/WelcomePage.tsx +76 -0
- package/src/pages/WelcomePage/index.ts +1 -0
- package/src/pages/WelcomePage/welcomeBoard.json +8727 -0
- package/src/pages/WelcomePage/welcomeBoardEn.json +9683 -0
- package/src/pages/WheelLogger/WheelLogger.module.css +32 -0
- package/src/pages/WheelLogger/WheelLogger.tsx +94 -0
- package/src/pages/layouts/AppLayout.tsx +86 -0
- package/src/pages/layouts/AuthLayout/AuthLayout.module.css +80 -0
- package/src/pages/layouts/AuthLayout/AuthLayout.tsx +74 -0
- package/src/pages/layouts/AuthLayout/Tail.tsx +23 -0
- package/src/pages/layouts/AuthLayout/index.ts +1 -0
- package/src/production.entrypoint.ts +39 -0
- package/src/public/customWebComponents.js +323 -0
- package/src/public/favicon.svg +20 -0
- package/src/public/favicons/apple-touch-icon.png +0 -0
- package/src/public/favicons/favicon-16x16.png +0 -0
- package/src/public/favicons/favicon-32x32.png +0 -0
- package/src/public/favicons/favicon.ico +0 -0
- package/src/public/favicons/favicon.svg +6 -0
- package/src/public/favicons/site.webmanifest +21 -0
- package/src/public/favicons/web-app-manifest-192x192.png +0 -0
- package/src/public/favicons/web-app-manifest-512x512.png +0 -0
- package/src/public/fonts/NotoColorEmoji-Regular.ttf +0 -0
- package/src/public/fonts/OpenSans-Bold.ttf +0 -0
- package/src/public/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/src/public/fonts/OpenSans-Italic.ttf +0 -0
- package/src/public/fonts/OpenSans-Regular.ttf +0 -0
- package/src/public/fonts/RobotoMono-Regular.ttf +0 -0
- package/src/public/loadLinksImages.js +26 -0
- package/src/public/loader.svg +26 -0
- package/src/public/pdf/installiation_ru.pdf +0 -0
- package/src/public/pdf/lifecycle_ru.pdf +0 -0
- package/src/public/pdf/personal_data_policy_ru.pdf +0 -0
- package/src/public/pdf/privacy_policy_en.pdf +0 -0
- package/src/public/pdf/privacy_policy_ru.pdf +0 -0
- package/src/public/pdf/terms_conditions_en.pdf +0 -0
- package/src/public/pdf/terms_conditions_ru.pdf +0 -0
- package/src/public/pdf/user_agreement_ru.pdf +0 -0
- package/src/public/pdf/user_manual_ru.pdf +0 -0
- package/src/shared/Lang/en.json +1227 -0
- package/src/shared/Lang/i18n.d.ts +8 -0
- package/src/shared/Lang/index.ts +32 -0
- package/src/shared/Lang/ru.json +1226 -0
- package/src/shared/Logger.ts +72 -0
- package/src/shared/RawEvents.ts +7 -0
- package/src/shared/Subject.ts +29 -0
- package/src/shared/SubjectOperation.ts +31 -0
- package/src/shared/ViewSettings.tsx +9 -0
- package/src/shared/api/ai/api.ts +6 -0
- package/src/shared/api/ai/index.ts +3 -0
- package/src/shared/api/ai/requestMap.ts +22 -0
- package/src/shared/api/ai/types.ts +6 -0
- package/src/shared/api/auth/api.ts +78 -0
- package/src/shared/api/auth/index.ts +2 -0
- package/src/shared/api/auth/types.ts +51 -0
- package/src/shared/api/base/base.ts +244 -0
- package/src/shared/api/base/httpError.ts +10 -0
- package/src/shared/api/base/httpResponse.ts +7 -0
- package/src/shared/api/base/interceptors.ts +64 -0
- package/src/shared/api/base/types.ts +18 -0
- package/src/shared/api/billing/api.ts +79 -0
- package/src/shared/api/billing/index.ts +2 -0
- package/src/shared/api/billing/types.ts +155 -0
- package/src/shared/api/boards/api.ts +128 -0
- package/src/shared/api/boards/index.ts +2 -0
- package/src/shared/api/boards/types.ts +15 -0
- package/src/shared/api/index.ts +8 -0
- package/src/shared/api/media/index.ts +3 -0
- package/src/shared/api/media/uploadAudio.ts +53 -0
- package/src/shared/api/media/uploadImage.ts +180 -0
- package/src/shared/api/media/uploadVideo.ts +48 -0
- package/src/shared/api/types.ts +3 -0
- package/src/shared/api/users/api.ts +37 -0
- package/src/shared/api/users/index.ts +2 -0
- package/src/shared/api/users/types.ts +17 -0
- package/src/shared/apiV2/base.ts +9 -0
- package/src/shared/apiV2/boards/api.ts +143 -0
- package/src/shared/apiV2/boards/index.ts +2 -0
- package/src/shared/apiV2/boards/types.ts +66 -0
- package/src/shared/apiV2/folders/api.ts +81 -0
- package/src/shared/apiV2/folders/index.ts +2 -0
- package/src/shared/apiV2/folders/types.ts +35 -0
- package/src/shared/apiV2/index.ts +2 -0
- package/src/shared/assets/imgs/default-user-icon.svg +12 -0
- package/src/shared/assets/imgs/no-img-icon.svg +3 -0
- package/src/shared/lib/IframeModule.ts +223 -0
- package/src/shared/lib/convertColors.ts +51 -0
- package/src/shared/lib/debounce.ts +9 -0
- package/src/shared/lib/getCorrectEnding.ts +19 -0
- package/src/shared/lib/getEmailPrefix.ts +13 -0
- package/src/shared/lib/handleClickDetection.ts +25 -0
- package/src/shared/lib/isIframe.ts +3 -0
- package/src/shared/lib/isMicroboardIframe.ts +3 -0
- package/src/shared/lib/queryStringParser.ts +18 -0
- package/src/shared/lib/regex.ts +4 -0
- package/src/shared/lib/strictContext.ts +14 -0
- package/src/shared/lib/throttle.ts +59 -0
- package/src/shared/lib/useClickOutside.ts +50 -0
- package/src/shared/lib/useClientRect.ts +34 -0
- package/src/shared/lib/useDebounce.ts +22 -0
- package/src/shared/lib/useForceUpdate.ts +7 -0
- package/src/shared/lib/useHoverState.ts +14 -0
- package/src/shared/lib/useIsPhoneScreen.ts +21 -0
- package/src/shared/lib/useMediaQuery.tsx +19 -0
- package/src/shared/lib/withRouter.tsx +21 -0
- package/src/shared/sha256.ts +22 -0
- package/src/shared/ui-lib/Button/Button.module.css +179 -0
- package/src/shared/ui-lib/Button/Button.tsx +43 -0
- package/src/shared/ui-lib/Button/Loader.tsx +20 -0
- package/src/shared/ui-lib/Button/index.ts +1 -0
- package/src/shared/ui-lib/Checkbox/Checkbox.module.css +44 -0
- package/src/shared/ui-lib/Checkbox/Checkbox.tsx +42 -0
- package/src/shared/ui-lib/Checkbox/index.ts +1 -0
- package/src/shared/ui-lib/Dropdown/Chevron.tsx +24 -0
- package/src/shared/ui-lib/Dropdown/Dropdown.module.css +48 -0
- package/src/shared/ui-lib/Dropdown/Dropdown.tsx +42 -0
- package/src/shared/ui-lib/Icon/ConnectorIcon.tsx +33 -0
- package/src/shared/ui-lib/Icon/ConnectorPointerIcon.tsx +50 -0
- package/src/shared/ui-lib/Icon/EyeClosed.tsx +34 -0
- package/src/shared/ui-lib/Icon/EyeOpened.tsx +56 -0
- package/src/shared/ui-lib/Icon/FillColorIndicator/FillColorIndicator.module.css +11 -0
- package/src/shared/ui-lib/Icon/FillColorIndicator/FillColorIndicator.tsx +26 -0
- package/src/shared/ui-lib/Icon/FillColorIndicator/bg.png +0 -0
- package/src/shared/ui-lib/Icon/FillColorIndicator/index.ts +1 -0
- package/src/shared/ui-lib/Icon/FrameIcon.tsx +33 -0
- package/src/shared/ui-lib/Icon/Icon.module.css +11 -0
- package/src/shared/ui-lib/Icon/Icon.tsx +212 -0
- package/src/shared/ui-lib/Icon/Logo.tsx +23 -0
- package/src/shared/ui-lib/Icon/ShapeIcon.tsx +33 -0
- package/src/shared/ui-lib/Icon/StrokeColorIndicator.tsx +51 -0
- package/src/shared/ui-lib/Icon/TextColorIndicator/TextColorIndicator.module.css +14 -0
- package/src/shared/ui-lib/Icon/TextColorIndicator/TextColorIndicator.tsx +22 -0
- package/src/shared/ui-lib/Icon/TextColorIndicator/index.ts +1 -0
- package/src/shared/ui-lib/Icon/TextHighlightIndicator/TextHighlightIndicator.module.css +15 -0
- package/src/shared/ui-lib/Icon/TextHighlightIndicator/TextHighlightIndicator.tsx +22 -0
- package/src/shared/ui-lib/Icon/TextHighlightIndicator/index.ts +1 -0
- package/src/shared/ui-lib/Icon/index.ts +11 -0
- package/src/shared/ui-lib/Icon/sprite.svg +1707 -0
- package/src/shared/ui-lib/Input/EyeClose.tsx +22 -0
- package/src/shared/ui-lib/Input/EyeOpen.tsx +23 -0
- package/src/shared/ui-lib/Input/Input.css +130 -0
- package/src/shared/ui-lib/Input/Input.tsx +205 -0
- package/src/shared/ui-lib/Input/index.ts +1 -0
- package/src/shared/ui-lib/Link/Link.module.css +38 -0
- package/src/shared/ui-lib/Link/Link.tsx +19 -0
- package/src/shared/ui-lib/Link/index.ts +1 -0
- package/src/shared/ui-lib/Loader/Loader.module.css +9 -0
- package/src/shared/ui-lib/Loader/Loader.tsx +27 -0
- package/src/shared/ui-lib/Message/Message.module.css +26 -0
- package/src/shared/ui-lib/Message/Message.tsx +37 -0
- package/src/shared/ui-lib/Notification/Notification.module.css +58 -0
- package/src/shared/ui-lib/Notification/Notification.tsx +75 -0
- package/src/shared/ui-lib/Notification/index.ts +1 -0
- package/src/shared/ui-lib/OuterLink/OuterLink.module.css +38 -0
- package/src/shared/ui-lib/OuterLink/OuterLink.tsx +16 -0
- package/src/shared/ui-lib/OuterLink/index.ts +1 -0
- package/src/shared/ui-lib/Progress/Progress.module.css +16 -0
- package/src/shared/ui-lib/Progress/Progress.tsx +35 -0
- package/src/shared/ui-lib/Selector/Selector.module.css +91 -0
- package/src/shared/ui-lib/Selector/Selector.tsx +170 -0
- package/src/shared/ui-lib/Selector/index.ts +1 -0
- package/src/shared/ui-lib/Toast/Toast.module.css +142 -0
- package/src/shared/ui-lib/Toast/index.ts +2 -0
- package/src/shared/ui-lib/Toast/notify.tsx +119 -0
- package/src/shared/ui-lib/ToggleMark/ToggleMark.module.css +22 -0
- package/src/shared/ui-lib/ToggleMark/ToggleMark.tsx +15 -0
- package/src/shared/ui-lib/Tooltip/Tooltip.module.css +195 -0
- package/src/shared/ui-lib/Tooltip/Tooltip.tsx +99 -0
- package/src/shared/ui-lib/Tooltip/index.tsx +1 -0
- package/src/shared/ui-lib/Transitions/FadeTransition.module.css +22 -0
- package/src/shared/ui-lib/Transitions/FadeTransition.tsx +25 -0
- package/src/shared/ui-lib/Transitions/OpacityTransition.module.css +17 -0
- package/src/shared/ui-lib/Transitions/OpacityTransition.tsx +27 -0
- package/src/shared/ui-lib/Transitions/TopFade.module.css +25 -0
- package/src/shared/ui-lib/Transitions/TopFade.tsx +27 -0
- package/src/shared/ui-lib/Transitions/index.ts +2 -0
- package/src/shared/ui-lib/Transitions/types.ts +7 -0
- package/src/shared/ui-lib/UIMainLoader/UIMainLoader.module.css +8 -0
- package/src/shared/ui-lib/UIMainLoader/UIMainLoader.tsx +10 -0
- package/src/shared/ui-lib/UiAccordion/UiAccordion.module.css +4 -0
- package/src/shared/ui-lib/UiAccordion/UiAccordion.tsx +47 -0
- package/src/shared/ui-lib/UiAccordion/index.ts +1 -0
- package/src/shared/ui-lib/UiAdaptiveAccordion/UiAdaptiveAccordion.module.css +22 -0
- package/src/shared/ui-lib/UiAdaptiveAccordion/UiAdaptiveAccordion.tsx +90 -0
- package/src/shared/ui-lib/UiAdaptiveAccordion/index.ts +2 -0
- package/src/shared/ui-lib/UiButton/Loader.tsx +20 -0
- package/src/shared/ui-lib/UiButton/Tooltip.tsx +98 -0
- package/src/shared/ui-lib/UiButton/UiButton.module.css +306 -0
- package/src/shared/ui-lib/UiButton/UiButton.tsx +119 -0
- package/src/shared/ui-lib/UiButton/index.ts +1 -0
- package/src/shared/ui-lib/UiColorInput/UiColorInput.module.css +66 -0
- package/src/shared/ui-lib/UiColorInput/UiColorInput.tsx +66 -0
- package/src/shared/ui-lib/UiColorInput/index.ts +1 -0
- package/src/shared/ui-lib/UiColorInput/palette.png +0 -0
- package/src/shared/ui-lib/UiLink/UiLink.module.css +175 -0
- package/src/shared/ui-lib/UiLink/UiLink.tsx +72 -0
- package/src/shared/ui-lib/UiLink/index.ts +1 -0
- package/src/shared/ui-lib/UiLoader/UiLoader.module.css +19 -0
- package/src/shared/ui-lib/UiLoader/UiLoader.tsx +31 -0
- package/src/shared/ui-lib/UiLoader/index.ts +1 -0
- package/src/shared/ui-lib/UiModal/UiModal.module.css +188 -0
- package/src/shared/ui-lib/UiModal/UiModal.tsx +182 -0
- package/src/shared/ui-lib/UiModal/UiModalBackground.tsx +62 -0
- package/src/shared/ui-lib/UiModal/UiModalContext.tsx +90 -0
- package/src/shared/ui-lib/UiModal/index.ts +2 -0
- package/src/shared/ui-lib/UiPanel/UiPanel.module.css +52 -0
- package/src/shared/ui-lib/UiPanel/UiPanel.tsx +70 -0
- package/src/shared/ui-lib/UiPanel/index.ts +1 -0
- package/src/shared/ui-lib/UiSelector/UiSelector.module.css +143 -0
- package/src/shared/ui-lib/UiSelector/UiSelector.tsx +202 -0
- package/src/shared/ui-lib/UiSelector/index.ts +2 -0
- package/src/shared/ui-lib/UiSeparator/UiSeparator.module.css +18 -0
- package/src/shared/ui-lib/UiSeparator/UiSeparator.tsx +33 -0
- package/src/shared/ui-lib/UiSeparator/index.ts +1 -0
- package/src/shared/ui-lib/UiSkeleton/UiSkeleton.module.css +37 -0
- package/src/shared/ui-lib/UiSkeleton/UiSkeleton.tsx +10 -0
- package/src/shared/ui-lib/UiSkeleton/index.ts +1 -0
- package/src/shared/ui-lib/UiSlider/UiSlider.module.css +75 -0
- package/src/shared/ui-lib/UiSlider/UiSlider.tsx +50 -0
- package/src/shared/ui-lib/UiSlider/index.ts +1 -0
- package/src/shared/ui-lib/UiSwitch/UiSwitch.module.css +48 -0
- package/src/shared/ui-lib/UiSwitch/UiSwitch.tsx +103 -0
- package/src/shared/ui-lib/UiSwitch/index.ts +1 -0
- package/src/staticResources.ts +410 -0
- package/src/version.ts +1 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,752 @@
|
|
|
1
|
+
import type { Account } from "entities/account";
|
|
2
|
+
import { getConfiguredI18n } from "initI18N";
|
|
3
|
+
import { boardsApiV2, foldersApi } from "shared/apiV2";
|
|
4
|
+
import { Subject } from "shared/Subject";
|
|
5
|
+
import { Storage } from "./Storage";
|
|
6
|
+
|
|
7
|
+
function getI18n() {
|
|
8
|
+
const i18nInstance = getConfiguredI18n();
|
|
9
|
+
console.log("getI18n called, instance:", i18nInstance);
|
|
10
|
+
if (i18nInstance) {
|
|
11
|
+
console.log("i18n instance isInitialized:", i18nInstance.isInitialized);
|
|
12
|
+
console.log("i18n instance language:", i18nInstance.language);
|
|
13
|
+
console.log("i18n instance resources:", i18nInstance.store?.data);
|
|
14
|
+
}
|
|
15
|
+
return (
|
|
16
|
+
i18nInstance || {
|
|
17
|
+
t: (key: string) => {
|
|
18
|
+
console.log("Using fallback i18n for key:", key);
|
|
19
|
+
return key;
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type FolderItem = {
|
|
26
|
+
id: string | number;
|
|
27
|
+
title: string;
|
|
28
|
+
itemType: "board" | "folder";
|
|
29
|
+
type?: foldersApi.FolderType;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export class BoardsList {
|
|
33
|
+
subject = new Subject<void>();
|
|
34
|
+
private sharedFolder: foldersApi.Folder | null = null;
|
|
35
|
+
private rootFolder: foldersApi.Folder | null = null;
|
|
36
|
+
private draftsFolder: foldersApi.Folder | null = null;
|
|
37
|
+
private activeDndItem: FolderItem | null = null;
|
|
38
|
+
private overDndItem: FolderItem | null = null;
|
|
39
|
+
isLoading = true;
|
|
40
|
+
|
|
41
|
+
constructor(
|
|
42
|
+
private readonly storage: Storage,
|
|
43
|
+
private readonly account: Account,
|
|
44
|
+
) {}
|
|
45
|
+
|
|
46
|
+
getSharedFolder(): foldersApi.Folder | null {
|
|
47
|
+
return this.sharedFolder;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
getRootFolder(): foldersApi.Folder | null {
|
|
51
|
+
return this.rootFolder;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
getDraftsFolder(): foldersApi.Folder | null {
|
|
55
|
+
return this.draftsFolder;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async createFolder(title?: string, parentFolder?: number) {
|
|
59
|
+
if (!this.account.isLoggedIn) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const { data: folder } = await foldersApi.createFolder({
|
|
64
|
+
parentFolder,
|
|
65
|
+
title,
|
|
66
|
+
});
|
|
67
|
+
await this.updateList();
|
|
68
|
+
return folder?.id ?? null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async createBoard(
|
|
72
|
+
name?: string,
|
|
73
|
+
isPublic = false,
|
|
74
|
+
parentFolder?: number,
|
|
75
|
+
): Promise<string> {
|
|
76
|
+
return await this.action(
|
|
77
|
+
async () => {
|
|
78
|
+
const { data } = await boardsApiV2.createBoard({
|
|
79
|
+
title: name,
|
|
80
|
+
parentFolder,
|
|
81
|
+
isPublic,
|
|
82
|
+
});
|
|
83
|
+
if (!data) {
|
|
84
|
+
throw new Error("Board creation error");
|
|
85
|
+
}
|
|
86
|
+
await this.updateList();
|
|
87
|
+
return data.id;
|
|
88
|
+
},
|
|
89
|
+
async () => {
|
|
90
|
+
const { data } = await boardsApiV2.createBoard({
|
|
91
|
+
title: name,
|
|
92
|
+
isPublic: true,
|
|
93
|
+
parentFolder,
|
|
94
|
+
});
|
|
95
|
+
if (!data) {
|
|
96
|
+
throw new Error("Board creation error");
|
|
97
|
+
}
|
|
98
|
+
this.storage.addCreatedBoard(data);
|
|
99
|
+
await this.updateList();
|
|
100
|
+
return data.id;
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
getBoardInfo(boardId: string | null): foldersApi.NestedBoard | null {
|
|
106
|
+
if (!boardId) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const searchFolder = (
|
|
110
|
+
folder: foldersApi.Folder | null,
|
|
111
|
+
): foldersApi.NestedBoard | null => {
|
|
112
|
+
if (!folder) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
for (const item of folder.items) {
|
|
116
|
+
if (item.itemType === "board" && item.id === boardId) {
|
|
117
|
+
return item;
|
|
118
|
+
}
|
|
119
|
+
if (item.itemType === "folder") {
|
|
120
|
+
const found = searchFolder(item as foldersApi.Folder);
|
|
121
|
+
if (found) {
|
|
122
|
+
return found;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
searchFolder(this.rootFolder) ||
|
|
131
|
+
searchFolder(this.sharedFolder) ||
|
|
132
|
+
searchFolder(this.draftsFolder)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
private findPathToBoard(
|
|
137
|
+
boardId: string,
|
|
138
|
+
folder: foldersApi.Folder | null,
|
|
139
|
+
path: number[] = [],
|
|
140
|
+
): number[] | null {
|
|
141
|
+
if (!folder) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
for (const item of folder.items) {
|
|
146
|
+
if (item.itemType === "board" && item.id === boardId) {
|
|
147
|
+
return [...path, folder.id];
|
|
148
|
+
}
|
|
149
|
+
if (item.itemType === "folder") {
|
|
150
|
+
const result = this.findPathToBoard(
|
|
151
|
+
boardId,
|
|
152
|
+
item as foldersApi.Folder,
|
|
153
|
+
[...path, folder.id],
|
|
154
|
+
);
|
|
155
|
+
if (result) {
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
getPathToBoard(boardId: string): number[] | null {
|
|
165
|
+
return (
|
|
166
|
+
this.findPathToBoard(boardId, this.rootFolder) ||
|
|
167
|
+
this.findPathToBoard(boardId, this.sharedFolder) ||
|
|
168
|
+
this.findPathToBoard(boardId, this.draftsFolder)
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
private findPathToFolder(
|
|
173
|
+
folderId: number,
|
|
174
|
+
folder: foldersApi.Folder | null,
|
|
175
|
+
path: number[] = [],
|
|
176
|
+
): number[] | null {
|
|
177
|
+
if (!folder) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (folder.id === folderId) {
|
|
182
|
+
return [...path, folder.id];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
for (const item of folder.items) {
|
|
186
|
+
if (item.itemType === "folder") {
|
|
187
|
+
const result = this.findPathToFolder(
|
|
188
|
+
folderId,
|
|
189
|
+
item as foldersApi.Folder,
|
|
190
|
+
[...path, folder.id],
|
|
191
|
+
);
|
|
192
|
+
if (result) {
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
getPathToFolder(folderId: number): number[] | null {
|
|
202
|
+
return (
|
|
203
|
+
this.findPathToFolder(folderId, this.rootFolder) ||
|
|
204
|
+
this.findPathToFolder(folderId, this.sharedFolder) ||
|
|
205
|
+
this.findPathToFolder(folderId, this.draftsFolder)
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
isFolderContainsBoard(folderId: number, boardId: string): boolean {
|
|
210
|
+
const path = this.getPathToBoard(boardId);
|
|
211
|
+
if (!path) {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return path.includes(folderId);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
isFolderContainsFolder(folderId: number, targetFolderId: number): boolean {
|
|
219
|
+
const path = this.getPathToFolder(targetFolderId);
|
|
220
|
+
if (!path) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return path.includes(folderId);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
getFolder(
|
|
228
|
+
folderId: number | null,
|
|
229
|
+
): foldersApi.Folder | foldersApi.NestedFolder | null {
|
|
230
|
+
if (!folderId) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
if (this.rootFolder?.id === folderId) {
|
|
234
|
+
return this.rootFolder;
|
|
235
|
+
}
|
|
236
|
+
if (this.sharedFolder?.id === folderId) {
|
|
237
|
+
return this.sharedFolder;
|
|
238
|
+
}
|
|
239
|
+
if (this.draftsFolder?.id === folderId) {
|
|
240
|
+
return this.draftsFolder;
|
|
241
|
+
}
|
|
242
|
+
const searchFolder = (
|
|
243
|
+
folder: foldersApi.Folder | null,
|
|
244
|
+
): foldersApi.Folder | null => {
|
|
245
|
+
if (!folder) {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
for (const item of folder.items) {
|
|
249
|
+
if (item.itemType === "folder" && item.id === folderId) {
|
|
250
|
+
return item;
|
|
251
|
+
}
|
|
252
|
+
if (item.itemType === "folder") {
|
|
253
|
+
const found = searchFolder(item);
|
|
254
|
+
if (found) {
|
|
255
|
+
return item;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return null;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
searchFolder(this.rootFolder) ||
|
|
264
|
+
searchFolder(this.sharedFolder) ||
|
|
265
|
+
searchFolder(this.draftsFolder)
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
getFolderByType(
|
|
270
|
+
folderType: foldersApi.FolderType,
|
|
271
|
+
): foldersApi.Folder | foldersApi.NestedFolder | null {
|
|
272
|
+
const searchFolderByType = (
|
|
273
|
+
folder: foldersApi.Folder | null,
|
|
274
|
+
): foldersApi.Folder | null => {
|
|
275
|
+
if (!folder) {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
for (const item of folder.items) {
|
|
279
|
+
if (item.itemType === "folder" && item.type === folderType) {
|
|
280
|
+
return item;
|
|
281
|
+
}
|
|
282
|
+
if (item.itemType === "folder") {
|
|
283
|
+
const found = searchFolderByType(item);
|
|
284
|
+
if (found) {
|
|
285
|
+
return found;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return null;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
return (
|
|
293
|
+
searchFolderByType(this.rootFolder) ||
|
|
294
|
+
searchFolderByType(this.sharedFolder) ||
|
|
295
|
+
searchFolderByType(this.draftsFolder)
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
async loadBoards(): Promise<void> {
|
|
300
|
+
this.isLoading = true;
|
|
301
|
+
if (this.account.isLoggedIn) {
|
|
302
|
+
const { data: rootFolder } = await foldersApi.getRootFolder();
|
|
303
|
+
const { data: sharedFolder } = await foldersApi.getRootFolder(
|
|
304
|
+
foldersApi.FolderType.VISITED,
|
|
305
|
+
);
|
|
306
|
+
const { data: draftsFolder } = await foldersApi.getRootFolder(
|
|
307
|
+
foldersApi.FolderType.DRAFTS,
|
|
308
|
+
);
|
|
309
|
+
if (!rootFolder || !sharedFolder || !draftsFolder) {
|
|
310
|
+
throw new Error("Failed to load folders");
|
|
311
|
+
}
|
|
312
|
+
this.rootFolder = rootFolder;
|
|
313
|
+
this.sharedFolder = sharedFolder;
|
|
314
|
+
this.draftsFolder = draftsFolder;
|
|
315
|
+
this.updateEmptyTitles(this.rootFolder);
|
|
316
|
+
this.updateEmptyTitles(this.sharedFolder);
|
|
317
|
+
this.updateEmptyTitles(this.draftsFolder);
|
|
318
|
+
this.rootFolder.title = getI18n().t("sidePanel.folders.myBoards");
|
|
319
|
+
this.sharedFolder.title = getI18n().t(
|
|
320
|
+
"sidePanel.folders.sharedBoards",
|
|
321
|
+
);
|
|
322
|
+
this.draftsFolder.title = getI18n().t(
|
|
323
|
+
"sidePanel.folders.publicDrafts",
|
|
324
|
+
);
|
|
325
|
+
this.isLoading = false;
|
|
326
|
+
this.subject.publish();
|
|
327
|
+
} else {
|
|
328
|
+
this.rootFolder = {
|
|
329
|
+
id: -1,
|
|
330
|
+
items: this.storage.listCreatedBoards().map(board => ({
|
|
331
|
+
...board,
|
|
332
|
+
itemType: "board",
|
|
333
|
+
title: board.title || getI18n().t("board.untitled"),
|
|
334
|
+
})),
|
|
335
|
+
title: getI18n().t("sidePanel.folders.publicDrafts"),
|
|
336
|
+
type: foldersApi.FolderType.DRAFTS,
|
|
337
|
+
};
|
|
338
|
+
this.sharedFolder = {
|
|
339
|
+
id: -2,
|
|
340
|
+
items: this.storage.listVisitedBoards().map(board => ({
|
|
341
|
+
...board,
|
|
342
|
+
itemType: "board" as const,
|
|
343
|
+
title: board.title || getI18n().t("board.untitled"),
|
|
344
|
+
})),
|
|
345
|
+
title: getI18n().t("sidePanel.folders.sharedBoards"),
|
|
346
|
+
type: foldersApi.FolderType.VISITED,
|
|
347
|
+
};
|
|
348
|
+
this.draftsFolder = null;
|
|
349
|
+
await this.updateDetails();
|
|
350
|
+
this.isLoading = false;
|
|
351
|
+
this.subject.publish();
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
async updatePrivacySettings(
|
|
356
|
+
boardId: string,
|
|
357
|
+
isPublic: boolean,
|
|
358
|
+
mode: boardsApiV2.DirectAccessType,
|
|
359
|
+
): Promise<void> {
|
|
360
|
+
if (!this.account.isLoggedIn) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
this.isLoading = true;
|
|
364
|
+
this.subject.publish();
|
|
365
|
+
|
|
366
|
+
await boardsApiV2.editBoard(boardId, {
|
|
367
|
+
isPublic,
|
|
368
|
+
directAccessType: mode,
|
|
369
|
+
});
|
|
370
|
+
await this.updateList();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
private updateEmptyTitles(folder: foldersApi.Folder | null): void {
|
|
374
|
+
if (!folder) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
for (const item of folder.items) {
|
|
378
|
+
if (!item.title) {
|
|
379
|
+
item.title = getI18n().t("board.untitled");
|
|
380
|
+
}
|
|
381
|
+
if (item.itemType === "folder") {
|
|
382
|
+
this.updateEmptyTitles(item as foldersApi.Folder);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
async visitBoard(id: string): Promise<Promise<void>> {
|
|
388
|
+
return await this.action(
|
|
389
|
+
async () => {
|
|
390
|
+
await boardsApiV2.claimBoards({ visited: [id] });
|
|
391
|
+
await this.updateList();
|
|
392
|
+
},
|
|
393
|
+
async () => {
|
|
394
|
+
if (
|
|
395
|
+
this.storage.getVisitedBoard(id) ||
|
|
396
|
+
this.storage.getCreatedBoard(id)
|
|
397
|
+
) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const { data } = await boardsApiV2.getBoard(id);
|
|
401
|
+
if (data && data.isPublic) {
|
|
402
|
+
this.storage.addVisitedBoard(data);
|
|
403
|
+
await this.updateList();
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
async claim(): Promise<void> {
|
|
410
|
+
const url = new URL(window.location.href);
|
|
411
|
+
const searchParams = new URLSearchParams(url.search);
|
|
412
|
+
const isTemplateView = searchParams.get("isTemplateView");
|
|
413
|
+
if (!this.account.isLoggedIn || isTemplateView) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
const publicBoards = this.storage.listCreatedBoards();
|
|
417
|
+
const sharedBoards = this.storage.listVisitedBoards();
|
|
418
|
+
console.log("claim", publicBoards, sharedBoards);
|
|
419
|
+
if (publicBoards.length === 0 && sharedBoards.length === 0) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
try {
|
|
423
|
+
await boardsApiV2.claimBoards({
|
|
424
|
+
authorKeys: publicBoards
|
|
425
|
+
.map(({ authorKey }) => authorKey)
|
|
426
|
+
.filter(ak => ak !== null),
|
|
427
|
+
visited: sharedBoards.map(({ id }) => id),
|
|
428
|
+
});
|
|
429
|
+
} catch {
|
|
430
|
+
console.error("Error claiming boards");
|
|
431
|
+
}
|
|
432
|
+
await this.updateList();
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
async rename(boardId: string, name: string): Promise<void> {
|
|
436
|
+
if (name === getI18n().t("board.untitled")) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
const board = this.getBoardInfo(boardId);
|
|
441
|
+
if (!board) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
board.title = name || getI18n().t("board.untitled");
|
|
446
|
+
|
|
447
|
+
this.subject.publish();
|
|
448
|
+
|
|
449
|
+
await this.action(
|
|
450
|
+
async () => {
|
|
451
|
+
await boardsApiV2.editBoard(boardId, { title: name });
|
|
452
|
+
await this.updateList();
|
|
453
|
+
},
|
|
454
|
+
async () => {
|
|
455
|
+
await boardsApiV2.editBoard(
|
|
456
|
+
boardId,
|
|
457
|
+
{ title: name },
|
|
458
|
+
board.authorKey,
|
|
459
|
+
);
|
|
460
|
+
this.storage.renameCreatedBoard(board.id, name);
|
|
461
|
+
await this.updateList();
|
|
462
|
+
},
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
async renameFolder(folderId: number, name: string): Promise<void> {
|
|
467
|
+
if (!this.account.isLoggedIn) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (name === getI18n().t("board.untitled")) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
const folder = this.getFolder(folderId);
|
|
476
|
+
|
|
477
|
+
if (!folder) {
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
folder.title = name || getI18n().t("board.untitled");
|
|
482
|
+
|
|
483
|
+
this.subject.publish();
|
|
484
|
+
|
|
485
|
+
await foldersApi.editFolder(folderId, {
|
|
486
|
+
title: name,
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
await this.updateList();
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
async removeBoard(boardId: string): Promise<void> {
|
|
493
|
+
await this.action(
|
|
494
|
+
async () => {
|
|
495
|
+
await boardsApiV2.deleteBoard(boardId);
|
|
496
|
+
await this.updateList();
|
|
497
|
+
},
|
|
498
|
+
async () => {
|
|
499
|
+
const createdBoard = this.storage.getCreatedBoard(boardId);
|
|
500
|
+
if (createdBoard) {
|
|
501
|
+
try {
|
|
502
|
+
await boardsApiV2.deleteBoard(
|
|
503
|
+
createdBoard.id,
|
|
504
|
+
createdBoard.authorKey,
|
|
505
|
+
);
|
|
506
|
+
} finally {
|
|
507
|
+
this.storage.removeCreatedBoard(boardId);
|
|
508
|
+
}
|
|
509
|
+
} else {
|
|
510
|
+
this.storage.removeVisitedBoard(boardId);
|
|
511
|
+
}
|
|
512
|
+
await this.updateList();
|
|
513
|
+
},
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
async addItemToFolder(
|
|
518
|
+
folderId: number,
|
|
519
|
+
item: foldersApi.NestedBoard | foldersApi.NestedFolder,
|
|
520
|
+
order = 0,
|
|
521
|
+
): Promise<void> {
|
|
522
|
+
if (!this.account.isLoggedIn) {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
const findFolder = (
|
|
527
|
+
folder: foldersApi.Folder | null,
|
|
528
|
+
): foldersApi.Folder | null => {
|
|
529
|
+
if (!folder) {
|
|
530
|
+
return null;
|
|
531
|
+
}
|
|
532
|
+
if (folder.id === folderId) {
|
|
533
|
+
return folder;
|
|
534
|
+
}
|
|
535
|
+
for (const item of folder.items) {
|
|
536
|
+
if (item.itemType === "folder") {
|
|
537
|
+
const found = findFolder(item as foldersApi.Folder);
|
|
538
|
+
if (found) {
|
|
539
|
+
return found;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return null;
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
const targetFolder =
|
|
547
|
+
findFolder(this.rootFolder) ||
|
|
548
|
+
findFolder(this.sharedFolder) ||
|
|
549
|
+
findFolder(this.draftsFolder);
|
|
550
|
+
|
|
551
|
+
if (targetFolder) {
|
|
552
|
+
targetFolder.items.splice(order, 0, item);
|
|
553
|
+
this.subject.publish();
|
|
554
|
+
if (typeof item.id === "string") {
|
|
555
|
+
await foldersApi.addToFolder(folderId, {
|
|
556
|
+
nestedBoardId: item.id,
|
|
557
|
+
});
|
|
558
|
+
} else {
|
|
559
|
+
await foldersApi.addToFolder(folderId, {
|
|
560
|
+
nestedFolderId: item.id,
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
const folderItemsOrder = targetFolder.items.map((item, idx) => ({
|
|
564
|
+
id: item.id,
|
|
565
|
+
order: idx,
|
|
566
|
+
}));
|
|
567
|
+
await foldersApi.reorderFolder(targetFolder.id, folderItemsOrder);
|
|
568
|
+
await this.updateList();
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
getItemIndexInFolder(
|
|
573
|
+
folderId: number,
|
|
574
|
+
itemId: string | number,
|
|
575
|
+
): number | null {
|
|
576
|
+
const findItemIndex = (
|
|
577
|
+
folder: foldersApi.Folder | null,
|
|
578
|
+
): number | null => {
|
|
579
|
+
if (!folder) {
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
if (folder.id === folderId) {
|
|
583
|
+
const itemIndex = folder.items.findIndex(
|
|
584
|
+
item => item.id === itemId,
|
|
585
|
+
);
|
|
586
|
+
// Corrected condition to check if itemIndex is found
|
|
587
|
+
return itemIndex !== -1 ? itemIndex : null;
|
|
588
|
+
}
|
|
589
|
+
for (const item of folder.items) {
|
|
590
|
+
if (item.itemType === "folder") {
|
|
591
|
+
const foundIndex = findItemIndex(item as foldersApi.Folder);
|
|
592
|
+
if (foundIndex !== null) {
|
|
593
|
+
return foundIndex;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return null;
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
return (
|
|
601
|
+
findItemIndex(this.rootFolder) ||
|
|
602
|
+
findItemIndex(this.sharedFolder) ||
|
|
603
|
+
findItemIndex(this.draftsFolder)
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
async removeItemFromFolder(
|
|
608
|
+
folderId: number,
|
|
609
|
+
itemId: string | number,
|
|
610
|
+
): Promise<void> {
|
|
611
|
+
if (!this.account.isLoggedIn) {
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
const findAndRemoveItem = (
|
|
616
|
+
folder: foldersApi.Folder | null,
|
|
617
|
+
): boolean => {
|
|
618
|
+
if (!folder) {
|
|
619
|
+
return false;
|
|
620
|
+
}
|
|
621
|
+
if (folder.id === folderId) {
|
|
622
|
+
const itemIndex = folder.items.findIndex(
|
|
623
|
+
item => item.id === itemId,
|
|
624
|
+
);
|
|
625
|
+
if (itemIndex !== -1) {
|
|
626
|
+
folder.items.splice(itemIndex, 1);
|
|
627
|
+
return true;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
for (const item of folder.items) {
|
|
631
|
+
if (item.itemType === "folder") {
|
|
632
|
+
const found = findAndRemoveItem(item as foldersApi.Folder);
|
|
633
|
+
if (found) {
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return false;
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
const removedFromRoot = findAndRemoveItem(this.rootFolder);
|
|
642
|
+
const removedFromShared = removedFromRoot
|
|
643
|
+
? false
|
|
644
|
+
: findAndRemoveItem(this.sharedFolder);
|
|
645
|
+
const removedFromDrafts =
|
|
646
|
+
removedFromRoot || removedFromShared
|
|
647
|
+
? false
|
|
648
|
+
: findAndRemoveItem(this.draftsFolder);
|
|
649
|
+
|
|
650
|
+
if (removedFromRoot || removedFromShared || removedFromDrafts) {
|
|
651
|
+
this.subject.publish();
|
|
652
|
+
if (typeof itemId === "string") {
|
|
653
|
+
await foldersApi.deleteFolderContent(folderId, {
|
|
654
|
+
nestedBoardId: itemId,
|
|
655
|
+
});
|
|
656
|
+
} else {
|
|
657
|
+
await foldersApi.deleteFolderContent(folderId, {
|
|
658
|
+
nestedFolderId: itemId,
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
await this.updateList();
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
async removeFolder(folderId: number): Promise<void> {
|
|
666
|
+
if (!this.account.isLoggedIn) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
await foldersApi.deleteFolder(folderId);
|
|
671
|
+
await this.updateList();
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
private async updateDetails(): Promise<void> {
|
|
675
|
+
if (this.account.isLoggedIn) {
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
const visitedBoards = this.storage.listVisitedBoards();
|
|
680
|
+
try {
|
|
681
|
+
const detailsRes = await Promise.all(
|
|
682
|
+
visitedBoards.map(
|
|
683
|
+
async ({ id }) => await boardsApiV2.getBoard(id),
|
|
684
|
+
),
|
|
685
|
+
);
|
|
686
|
+
const details = detailsRes
|
|
687
|
+
.map(({ data }) => data)
|
|
688
|
+
.filter(data => data !== null);
|
|
689
|
+
this.storage.setVisitedBoards(details);
|
|
690
|
+
} catch {
|
|
691
|
+
console.error("Can't fetch board details");
|
|
692
|
+
}
|
|
693
|
+
this.subject.publish();
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
async manageAccess(
|
|
697
|
+
boardId: string,
|
|
698
|
+
payload: boardsApiV2.ManageAccessPayload,
|
|
699
|
+
) {
|
|
700
|
+
this.isLoading = true;
|
|
701
|
+
this.subject.publish();
|
|
702
|
+
|
|
703
|
+
await boardsApiV2.manageAccess(boardId, payload);
|
|
704
|
+
this.loadBoards();
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
setDraggableDndItem(item: FolderItem | null) {
|
|
708
|
+
if (item?.id === this.activeDndItem?.id) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
this.activeDndItem = item;
|
|
712
|
+
this.subject.publish();
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
getDraggableDndItem() {
|
|
716
|
+
return this.activeDndItem;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
setOverDndItem(item: FolderItem | null) {
|
|
720
|
+
if (item?.id === this.overDndItem?.id) {
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
this.overDndItem = item;
|
|
724
|
+
this.subject.publish();
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
getOverDndItem() {
|
|
728
|
+
return this.overDndItem;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
private async updateList(): Promise<void> {
|
|
732
|
+
this.isLoading = true;
|
|
733
|
+
this.subject.publish();
|
|
734
|
+
await this.account.refreshTokens();
|
|
735
|
+
await this.loadBoards();
|
|
736
|
+
this.isLoading = false;
|
|
737
|
+
this.subject.publish();
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
private async action<T, K>(
|
|
741
|
+
authorized: () => T,
|
|
742
|
+
notAuthorized: () => K,
|
|
743
|
+
): Promise<T | K> {
|
|
744
|
+
let res: T | K;
|
|
745
|
+
if (this.account.isLoggedIn) {
|
|
746
|
+
res = await authorized();
|
|
747
|
+
} else {
|
|
748
|
+
res = await notAuthorized();
|
|
749
|
+
}
|
|
750
|
+
return res;
|
|
751
|
+
}
|
|
752
|
+
}
|