diff --git a/app/assets/javascripts/App.tsx b/app/assets/javascripts/App.tsx index 22134ef52..d78da57eb 100644 --- a/app/assets/javascripts/App.tsx +++ b/app/assets/javascripts/App.tsx @@ -20,13 +20,13 @@ declare global { } } -import { IsWebPlatform, WebAppVersion } from '@/Version' +import { IsWebPlatform, WebAppVersion } from '@/Constants/Version' import { DesktopManagerInterface, SNLog } from '@standardnotes/snjs' import ApplicationGroupView from './Components/ApplicationGroupView/ApplicationGroupView' -import { WebDevice } from './Device/WebDevice' -import { StartApplication } from './Device/StartApplication' +import { WebDevice } from './Application/Device/WebDevice' +import { StartApplication } from './Application/Device/StartApplication' import { ApplicationGroup } from './Application/ApplicationGroup' -import { WebOrDesktopDevice } from './Device/WebOrDesktopDevice' +import { WebOrDesktopDevice } from './Application/Device/WebOrDesktopDevice' import { WebApplication } from './Application/Application' import { createRoot, Root } from 'react-dom/client' diff --git a/app/assets/javascripts/Application/Application.ts b/app/assets/javascripts/Application/Application.ts index b6e9cb744..03a832d9f 100644 --- a/app/assets/javascripts/Application/Application.ts +++ b/app/assets/javascripts/Application/Application.ts @@ -1,4 +1,4 @@ -import { WebCrypto } from '@/Crypto' +import { WebCrypto } from '@/Application/Crypto' import { WebAlertService } from '@/Services/AlertService' import { ArchiveManager } from '@/Services/ArchiveManager' import { AutolockService } from '@/Services/AutolockService' @@ -6,7 +6,7 @@ import { DesktopManager } from '@/Services/DesktopManager' import { IOService } from '@/Services/IOService' import { ThemeManager } from '@/Services/ThemeManager' import { ViewControllerManager } from '@/Services/ViewControllerManager' -import { WebOrDesktopDevice } from '@/Device/WebOrDesktopDevice' +import { WebOrDesktopDevice } from '@/Application/Device/WebOrDesktopDevice' import { DeinitSource, Platform, diff --git a/app/assets/javascripts/Application/ApplicationGroup.ts b/app/assets/javascripts/Application/ApplicationGroup.ts index 28e554e15..a5fbca58e 100644 --- a/app/assets/javascripts/Application/ApplicationGroup.ts +++ b/app/assets/javascripts/Application/ApplicationGroup.ts @@ -13,7 +13,7 @@ import { DesktopManager } from '@/Services/DesktopManager' import { IOService } from '@/Services/IOService' import { AutolockService } from '@/Services/AutolockService' import { ThemeManager } from '@/Services/ThemeManager' -import { WebOrDesktopDevice } from '@/Device/WebOrDesktopDevice' +import { WebOrDesktopDevice } from '@/Application/Device/WebOrDesktopDevice' const createApplication = ( descriptor: ApplicationDescriptor, diff --git a/app/assets/javascripts/Crypto.ts b/app/assets/javascripts/Application/Crypto.ts similarity index 100% rename from app/assets/javascripts/Crypto.ts rename to app/assets/javascripts/Application/Crypto.ts diff --git a/app/assets/javascripts/Database.ts b/app/assets/javascripts/Application/Database.ts similarity index 100% rename from app/assets/javascripts/Database.ts rename to app/assets/javascripts/Application/Database.ts diff --git a/app/assets/javascripts/Device/DesktopSnjsExports.ts b/app/assets/javascripts/Application/Device/DesktopSnjsExports.ts similarity index 100% rename from app/assets/javascripts/Device/DesktopSnjsExports.ts rename to app/assets/javascripts/Application/Device/DesktopSnjsExports.ts diff --git a/app/assets/javascripts/Device/StartApplication.ts b/app/assets/javascripts/Application/Device/StartApplication.ts similarity index 100% rename from app/assets/javascripts/Device/StartApplication.ts rename to app/assets/javascripts/Application/Device/StartApplication.ts diff --git a/app/assets/javascripts/Device/WebDevice.ts b/app/assets/javascripts/Application/Device/WebDevice.ts similarity index 100% rename from app/assets/javascripts/Device/WebDevice.ts rename to app/assets/javascripts/Application/Device/WebDevice.ts diff --git a/app/assets/javascripts/Device/WebOrDesktopDevice.ts b/app/assets/javascripts/Application/Device/WebOrDesktopDevice.ts similarity index 100% rename from app/assets/javascripts/Device/WebOrDesktopDevice.ts rename to app/assets/javascripts/Application/Device/WebOrDesktopDevice.ts diff --git a/app/assets/javascripts/Components/AccountMenu/ConfirmPassword.tsx b/app/assets/javascripts/Components/AccountMenu/ConfirmPassword.tsx index 935d93867..5eb71f147 100644 --- a/app/assets/javascripts/Components/AccountMenu/ConfirmPassword.tsx +++ b/app/assets/javascripts/Components/AccountMenu/ConfirmPassword.tsx @@ -1,4 +1,4 @@ -import { STRING_NON_MATCHING_PASSWORDS } from '@/Strings' +import { STRING_NON_MATCHING_PASSWORDS } from '@/Constants/Strings' import { WebApplication } from '@/Application/Application' import { ViewControllerManager } from '@/Services/ViewControllerManager' import { observer } from 'mobx-react-lite' diff --git a/app/assets/javascripts/Components/AccountMenu/GeneralAccountMenu.tsx b/app/assets/javascripts/Components/AccountMenu/GeneralAccountMenu.tsx index 13d7f783b..e555cd259 100644 --- a/app/assets/javascripts/Components/AccountMenu/GeneralAccountMenu.tsx +++ b/app/assets/javascripts/Components/AccountMenu/GeneralAccountMenu.tsx @@ -3,7 +3,7 @@ import { ViewControllerManager } from '@/Services/ViewControllerManager' import { observer } from 'mobx-react-lite' import Icon from '@/Components/Icon/Icon' import { SyncQueueStrategy } from '@standardnotes/snjs' -import { STRING_GENERIC_SYNC_ERROR } from '@/Strings' +import { STRING_GENERIC_SYNC_ERROR } from '@/Constants/Strings' import { useCallback, useMemo, useState, FunctionComponent } from 'react' import { AccountMenuPane } from './AccountMenuPane' import Menu from '@/Components/Menu/Menu' diff --git a/app/assets/javascripts/Components/AccountMenu/WorkspaceSwitcher/WorkspaceSwitcherOption.tsx b/app/assets/javascripts/Components/AccountMenu/WorkspaceSwitcher/WorkspaceSwitcherOption.tsx index 43907697d..014e50b3d 100644 --- a/app/assets/javascripts/Components/AccountMenu/WorkspaceSwitcher/WorkspaceSwitcherOption.tsx +++ b/app/assets/javascripts/Components/AccountMenu/WorkspaceSwitcher/WorkspaceSwitcherOption.tsx @@ -1,4 +1,4 @@ -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { ApplicationGroup } from '@/Application/ApplicationGroup' import { ViewControllerManager } from '@/Services/ViewControllerManager' import { calculateSubmenuStyle, SubmenuStyle } from '@/Utils/CalculateSubmenuStyle' diff --git a/app/assets/javascripts/Components/ApplicationGroupView/ApplicationGroupView.tsx b/app/assets/javascripts/Components/ApplicationGroupView/ApplicationGroupView.tsx index 475c4d3e0..83b4a6784 100644 --- a/app/assets/javascripts/Components/ApplicationGroupView/ApplicationGroupView.tsx +++ b/app/assets/javascripts/Components/ApplicationGroupView/ApplicationGroupView.tsx @@ -2,7 +2,7 @@ import { ApplicationGroup } from '@/Application/ApplicationGroup' import { WebApplication } from '@/Application/Application' import { Component } from 'react' import ApplicationView from '@/Components/ApplicationView/ApplicationView' -import { WebOrDesktopDevice } from '@/Device/WebOrDesktopDevice' +import { WebOrDesktopDevice } from '@/Application/Device/WebOrDesktopDevice' import { ApplicationGroupEvent, ApplicationGroupEventData, DeinitSource } from '@standardnotes/snjs' import { DialogContent, DialogOverlay } from '@reach/dialog' import { isDesktopApplication } from '@/Utils' diff --git a/app/assets/javascripts/Components/ApplicationView/ApplicationView.tsx b/app/assets/javascripts/Components/ApplicationView/ApplicationView.tsx index 0fe3edc89..fb492862f 100644 --- a/app/assets/javascripts/Components/ApplicationView/ApplicationView.tsx +++ b/app/assets/javascripts/Components/ApplicationView/ApplicationView.tsx @@ -2,7 +2,7 @@ import { ApplicationGroup } from '@/Application/ApplicationGroup' import { getPlatformString, getWindowUrlParams } from '@/Utils' import { ViewControllerManagerEvent } from '@/Services/ViewControllerManager' import { ApplicationEvent, Challenge, removeFromArray } from '@standardnotes/snjs' -import { PANEL_NAME_NOTES, PANEL_NAME_NAVIGATION } from '@/Constants' +import { PANEL_NAME_NOTES, PANEL_NAME_NAVIGATION } from '@/Constants/Constants' import { alertDialog } from '@/Services/AlertService' import { WebApplication } from '@/Application/Application' import Navigation from '@/Components/Navigation/Navigation' @@ -23,7 +23,7 @@ import FilePreviewModalWrapper from '@/Components/Files/FilePreviewModal' import ContentListView from '@/Components/ContentListView/ContentListView' import FileContextMenuWrapper from '@/Components/FileContextMenu/FileContextMenu' import PermissionsModalWrapper from '@/Components/PermissionsModal/PermissionsModalWrapper' -import { PanelResizedData } from '@/Typings/PanelResizedData' +import { PanelResizedData } from '@/Types/PanelResizedData' type Props = { application: WebApplication diff --git a/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesButton.tsx b/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesButton.tsx index 8c3e17a85..5fdb5e54f 100644 --- a/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesButton.tsx +++ b/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesButton.tsx @@ -1,6 +1,6 @@ import { WebApplication } from '@/Application/Application' import { ViewControllerManager } from '@/Services/ViewControllerManager' -import { MENU_MARGIN_FROM_APP_BORDER } from '@/Constants' +import { MENU_MARGIN_FROM_APP_BORDER } from '@/Constants/Constants' import { Disclosure, DisclosureButton, DisclosurePanel } from '@reach/disclosure' import VisuallyHidden from '@reach/visually-hidden' import { observer } from 'mobx-react-lite' diff --git a/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesPopover.tsx b/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesPopover.tsx index ffe6601f1..12197f05a 100644 --- a/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesPopover.tsx +++ b/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesPopover.tsx @@ -1,4 +1,4 @@ -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { WebApplication } from '@/Application/Application' import { ViewControllerManager } from '@/Services/ViewControllerManager' import { FileItem } from '@standardnotes/snjs' diff --git a/app/assets/javascripts/Components/AttachedFilesPopover/PopoverFileItem.tsx b/app/assets/javascripts/Components/AttachedFilesPopover/PopoverFileItem.tsx index 61692e579..5715ce576 100644 --- a/app/assets/javascripts/Components/AttachedFilesPopover/PopoverFileItem.tsx +++ b/app/assets/javascripts/Components/AttachedFilesPopover/PopoverFileItem.tsx @@ -1,4 +1,4 @@ -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { KeyboardKey } from '@/Services/IOService' import { formatSizeToReadableString } from '@standardnotes/filepicker' import { FileItem } from '@standardnotes/snjs' diff --git a/app/assets/javascripts/Components/AttachedFilesPopover/PopoverFileSubmenu.tsx b/app/assets/javascripts/Components/AttachedFilesPopover/PopoverFileSubmenu.tsx index c0604c38d..29d055f2b 100644 --- a/app/assets/javascripts/Components/AttachedFilesPopover/PopoverFileSubmenu.tsx +++ b/app/assets/javascripts/Components/AttachedFilesPopover/PopoverFileSubmenu.tsx @@ -1,4 +1,4 @@ -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { calculateSubmenuStyle, SubmenuStyle } from '@/Utils/CalculateSubmenuStyle' import { Disclosure, DisclosureButton, DisclosurePanel } from '@reach/disclosure' import { Dispatch, FunctionComponent, SetStateAction, useCallback, useEffect, useRef, useState } from 'react' diff --git a/app/assets/javascripts/Components/ChangeEditor/ChangeEditorButton.tsx b/app/assets/javascripts/Components/ChangeEditor/ChangeEditorButton.tsx index f5edbec27..e94c08124 100644 --- a/app/assets/javascripts/Components/ChangeEditor/ChangeEditorButton.tsx +++ b/app/assets/javascripts/Components/ChangeEditor/ChangeEditorButton.tsx @@ -1,6 +1,6 @@ import { WebApplication } from '@/Application/Application' import { ViewControllerManager } from '@/Services/ViewControllerManager' -import { MENU_MARGIN_FROM_APP_BORDER } from '@/Constants' +import { MENU_MARGIN_FROM_APP_BORDER } from '@/Constants/Constants' import { Disclosure, DisclosureButton, DisclosurePanel } from '@reach/disclosure' import VisuallyHidden from '@reach/visually-hidden' import { observer } from 'mobx-react-lite' diff --git a/app/assets/javascripts/Components/ChangeEditor/ChangeEditorMenu.tsx b/app/assets/javascripts/Components/ChangeEditor/ChangeEditorMenu.tsx index 491bba8cf..6adcdfec1 100644 --- a/app/assets/javascripts/Components/ChangeEditor/ChangeEditorMenu.tsx +++ b/app/assets/javascripts/Components/ChangeEditor/ChangeEditorMenu.tsx @@ -3,7 +3,7 @@ import Menu from '@/Components/Menu/Menu' import MenuItem from '@/Components/Menu/MenuItem' import { MenuItemType } from '@/Components/Menu/MenuItemType' import { usePremiumModal } from '@/Hooks/usePremiumModal' -import { STRING_EDIT_LOCKED_ATTEMPT } from '@/Strings' +import { STRING_EDIT_LOCKED_ATTEMPT } from '@/Constants/Strings' import { WebApplication } from '@/Application/Application' import { ComponentArea, @@ -18,7 +18,7 @@ import { Fragment, FunctionComponent, useCallback, useEffect, useState } from 'r import { EditorMenuGroup } from '@/Components/NotesOptions/EditorMenuGroup' import { EditorMenuItem } from '@/Components/NotesOptions/EditorMenuItem' import { createEditorMenuGroups } from './createEditorMenuGroups' -import { PLAIN_EDITOR_NAME } from '@/Constants' +import { PLAIN_EDITOR_NAME } from '@/Constants/Constants' import { transactionForAssociateComponentWithCurrentNote, transactionForDisassociateComponentWithCurrentNote, diff --git a/app/assets/javascripts/Components/ChangeEditor/createEditorMenuGroups.ts b/app/assets/javascripts/Components/ChangeEditor/createEditorMenuGroups.ts index 0c2e962e4..f9ff4b28e 100644 --- a/app/assets/javascripts/Components/ChangeEditor/createEditorMenuGroups.ts +++ b/app/assets/javascripts/Components/ChangeEditor/createEditorMenuGroups.ts @@ -10,7 +10,7 @@ import { } from '@standardnotes/snjs' import { EditorMenuGroup } from '@/Components/NotesOptions/EditorMenuGroup' import { EditorMenuItem } from '@/Components/NotesOptions/EditorMenuItem' -import { PLAIN_EDITOR_NAME } from '@/Constants' +import { PLAIN_EDITOR_NAME } from '@/Constants/Constants' type EditorGroup = NoteType | 'plain' | 'others' diff --git a/app/assets/javascripts/Components/ConfirmSignoutModal/ConfirmSignoutModal.tsx b/app/assets/javascripts/Components/ConfirmSignoutModal/ConfirmSignoutModal.tsx index 9a6c94b55..e0662b529 100644 --- a/app/assets/javascripts/Components/ConfirmSignoutModal/ConfirmSignoutModal.tsx +++ b/app/assets/javascripts/Components/ConfirmSignoutModal/ConfirmSignoutModal.tsx @@ -1,6 +1,6 @@ import { FunctionComponent, useEffect, useRef, useState } from 'react' import { AlertDialog, AlertDialogDescription, AlertDialogLabel } from '@reach/alert-dialog' -import { STRING_SIGN_OUT_CONFIRMATION } from '@/Strings' +import { STRING_SIGN_OUT_CONFIRMATION } from '@/Constants/Strings' import { WebApplication } from '@/Application/Application' import { ViewControllerManager } from '@/Services/ViewControllerManager' import { observer } from 'mobx-react-lite' diff --git a/app/assets/javascripts/Components/ContentListView/ContentList.tsx b/app/assets/javascripts/Components/ContentListView/ContentList.tsx index dac21cb3b..33f8b2066 100644 --- a/app/assets/javascripts/Components/ContentListView/ContentList.tsx +++ b/app/assets/javascripts/Components/ContentListView/ContentList.tsx @@ -4,7 +4,7 @@ import { ViewControllerManager } from '@/Services/ViewControllerManager' import { UuidString } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' import { FunctionComponent, KeyboardEventHandler, UIEventHandler, useCallback } from 'react' -import { FOCUSABLE_BUT_NOT_TABBABLE, NOTES_LIST_SCROLL_THRESHOLD } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE, NOTES_LIST_SCROLL_THRESHOLD } from '@/Constants/Constants' import { ListableContentItem } from './Types/ListableContentItem' import ContentListItem from './ContentListItem' diff --git a/app/assets/javascripts/Components/ContentListView/ContentListView.tsx b/app/assets/javascripts/Components/ContentListView/ContentListView.tsx index 0c3a90f5e..1385f550e 100644 --- a/app/assets/javascripts/Components/ContentListView/ContentListView.tsx +++ b/app/assets/javascripts/Components/ContentListView/ContentListView.tsx @@ -1,7 +1,7 @@ import { KeyboardKey, KeyboardModifier } from '@/Services/IOService' import { WebApplication } from '@/Application/Application' import { ViewControllerManager } from '@/Services/ViewControllerManager' -import { PANEL_NAME_NOTES } from '@/Constants' +import { PANEL_NAME_NOTES } from '@/Constants/Constants' import { PrefKey, SystemViewId } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' import { diff --git a/app/assets/javascripts/Components/ContentListView/NoteListItem.tsx b/app/assets/javascripts/Components/ContentListView/NoteListItem.tsx index d1575459f..7672fe7e8 100644 --- a/app/assets/javascripts/Components/ContentListView/NoteListItem.tsx +++ b/app/assets/javascripts/Components/ContentListView/NoteListItem.tsx @@ -1,4 +1,4 @@ -import { PLAIN_EDITOR_NAME } from '@/Constants' +import { PLAIN_EDITOR_NAME } from '@/Constants/Constants' import { sanitizeHtmlString, SNNote } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' import { FunctionComponent } from 'react' diff --git a/app/assets/javascripts/Components/FileContextMenu/FileContextMenu.tsx b/app/assets/javascripts/Components/FileContextMenu/FileContextMenu.tsx index a0c1dbdad..8861bd965 100644 --- a/app/assets/javascripts/Components/FileContextMenu/FileContextMenu.tsx +++ b/app/assets/javascripts/Components/FileContextMenu/FileContextMenu.tsx @@ -1,4 +1,4 @@ -import { MAX_MENU_SIZE_MULTIPLIER, MENU_MARGIN_FROM_APP_BORDER } from '@/Constants' +import { MAX_MENU_SIZE_MULTIPLIER, MENU_MARGIN_FROM_APP_BORDER } from '@/Constants/Constants' import { useCloseOnBlur } from '@/Hooks/useCloseOnBlur' import { useCloseOnClickOutside } from '@/Hooks/useCloseOnClickOutside' import { ViewControllerManager } from '@/Services/ViewControllerManager' diff --git a/app/assets/javascripts/Components/FileContextMenu/FileMenuOptions.tsx b/app/assets/javascripts/Components/FileContextMenu/FileMenuOptions.tsx index 01909bee6..136312de4 100644 --- a/app/assets/javascripts/Components/FileContextMenu/FileMenuOptions.tsx +++ b/app/assets/javascripts/Components/FileContextMenu/FileMenuOptions.tsx @@ -1,4 +1,4 @@ -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { FileItem } from '@standardnotes/snjs' import { FunctionComponent } from 'react' import { PopoverFileItemAction, PopoverFileItemActionType } from '../AttachedFilesPopover/PopoverFileItemAction' diff --git a/app/assets/javascripts/Components/Files/FilePreviewModal.tsx b/app/assets/javascripts/Components/Files/FilePreviewModal.tsx index 348926298..2798e4500 100644 --- a/app/assets/javascripts/Components/Files/FilePreviewModal.tsx +++ b/app/assets/javascripts/Components/Files/FilePreviewModal.tsx @@ -10,7 +10,7 @@ import Icon from '@/Components/Icon/Icon' import FilePreviewInfoPanel from './FilePreviewInfoPanel' import { isFileTypePreviewable } from './isFilePreviewable' import PreviewComponent from './PreviewComponent' -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { KeyboardKey } from '@/Services/IOService' import { ViewControllerManager } from '@/Services/ViewControllerManager' import { observer } from 'mobx-react-lite' diff --git a/app/assets/javascripts/Components/Footer/Footer.tsx b/app/assets/javascripts/Components/Footer/Footer.tsx index ed0ec053d..9967719bb 100644 --- a/app/assets/javascripts/Components/Footer/Footer.tsx +++ b/app/assets/javascripts/Components/Footer/Footer.tsx @@ -9,7 +9,7 @@ import { STRING_UPGRADE_ACCOUNT_CONFIRM_TEXT, STRING_UPGRADE_ACCOUNT_CONFIRM_TITLE, STRING_UPGRADE_ACCOUNT_CONFIRM_BUTTON, -} from '@/Strings' +} from '@/Constants/Strings' import { alertDialog, confirmDialog } from '@/Services/AlertService' import AccountMenu from '@/Components/AccountMenu/AccountMenu' import { ViewControllerManagerEvent } from '@/Services/ViewControllerManager' @@ -18,7 +18,7 @@ import QuickSettingsMenu from '@/Components/QuickSettingsMenu/QuickSettingsMenu' import SyncResolutionMenu from '@/Components/SyncResolutionMenu/SyncResolutionMenu' import { Fragment } from 'react' import { AccountMenuPane } from '../AccountMenu/AccountMenuPane' -import { EditorEventSource } from '@/Typings/EditorEventSource' +import { EditorEventSource } from '@/Types/EditorEventSource' type Props = { application: WebApplication diff --git a/app/assets/javascripts/Components/Menu/MenuItem.tsx b/app/assets/javascripts/Components/Menu/MenuItem.tsx index afdae1e3a..8c1c01312 100644 --- a/app/assets/javascripts/Components/Menu/MenuItem.tsx +++ b/app/assets/javascripts/Components/Menu/MenuItem.tsx @@ -3,7 +3,7 @@ import Icon from '@/Components/Icon/Icon' import Switch from '@/Components/Switch/Switch' import { SwitchProps } from '@/Components/Switch/SwitchProps' import { IconType } from '@standardnotes/snjs' -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { MenuItemType } from './MenuItemType' type MenuItemProps = { diff --git a/app/assets/javascripts/Components/Navigation/Navigation.tsx b/app/assets/javascripts/Components/Navigation/Navigation.tsx index 1c3685026..1ca094af9 100644 --- a/app/assets/javascripts/Components/Navigation/Navigation.tsx +++ b/app/assets/javascripts/Components/Navigation/Navigation.tsx @@ -1,7 +1,7 @@ import SmartViewsSection from '@/Components/Tags/SmartViewsSection' import TagsSection from '@/Components/Tags/TagsSection' import { WebApplication } from '@/Application/Application' -import { PANEL_NAME_NAVIGATION } from '@/Constants' +import { PANEL_NAME_NAVIGATION } from '@/Constants/Constants' import { ApplicationEvent, PrefKey } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' import { FunctionComponent, useCallback, useEffect, useMemo, useState } from 'react' diff --git a/app/assets/javascripts/Components/NoteGroupView/NoteGroupView.tsx b/app/assets/javascripts/Components/NoteGroupView/NoteGroupView.tsx index a4082e660..ef09fcc27 100644 --- a/app/assets/javascripts/Components/NoteGroupView/NoteGroupView.tsx +++ b/app/assets/javascripts/Components/NoteGroupView/NoteGroupView.tsx @@ -3,7 +3,7 @@ import { PureComponent } from '@/Components/Abstract/PureComponent' import { WebApplication } from '@/Application/Application' import MultipleSelectedNotes from '@/Components/MultipleSelectedNotes/MultipleSelectedNotes' import NoteView from '@/Components/NoteView/NoteView' -import { ElementIds } from '@/ElementIDs' +import { ElementIds } from '@/Constants/ElementIDs' type State = { showMultipleSelectedNotes: boolean diff --git a/app/assets/javascripts/Components/NoteView/NoteView.tsx b/app/assets/javascripts/Components/NoteView/NoteView.tsx index 205e22a8f..5e1d95299 100644 --- a/app/assets/javascripts/Components/NoteView/NoteView.tsx +++ b/app/assets/javascripts/Components/NoteView/NoteView.tsx @@ -14,9 +14,9 @@ import { PayloadEmitSource, } from '@standardnotes/snjs' import { debounce, isDesktopApplication } from '@/Utils' -import { EditorEventSource } from '../../Typings/EditorEventSource' +import { EditorEventSource } from '../../Types/EditorEventSource' import { KeyboardModifier, KeyboardKey } from '@/Services/IOService' -import { STRING_DELETE_PLACEHOLDER_ATTEMPT, STRING_DELETE_LOCKED_ATTEMPT, StringDeleteNote } from '@/Strings' +import { STRING_DELETE_PLACEHOLDER_ATTEMPT, STRING_DELETE_LOCKED_ATTEMPT, StringDeleteNote } from '@/Constants/Strings' import { confirmDialog } from '@/Services/AlertService' import { PureComponent } from '@/Components/Abstract/PureComponent' import ProtectedNoteOverlay from '@/Components/ProtectedNoteOverlay/ProtectedNoteOverlay' @@ -25,7 +25,7 @@ import NotesOptionsPanel from '@/Components/NotesOptions/NotesOptionsPanel' import NoteTagsContainer from '@/Components/NoteTags/NoteTagsContainer' import ComponentView from '@/Components/ComponentView/ComponentView' import PanelResizer, { PanelSide, PanelResizeType } from '@/Components/PanelResizer/PanelResizer' -import { ElementIds } from '@/ElementIDs' +import { ElementIds } from '@/Constants/ElementIDs' import ChangeEditorButton from '@/Components/ChangeEditor/ChangeEditorButton' import AttachedFilesButton from '@/Components/AttachedFilesPopover/AttachedFilesButton' import EditingDisabledBanner from './EditingDisabledBanner' diff --git a/app/assets/javascripts/Components/NotesOptions/NotesOptions.tsx b/app/assets/javascripts/Components/NotesOptions/NotesOptions.tsx index 46cd4b00f..8e20dac52 100644 --- a/app/assets/javascripts/Components/NotesOptions/NotesOptions.tsx +++ b/app/assets/javascripts/Components/NotesOptions/NotesOptions.tsx @@ -6,7 +6,7 @@ import { useState, useEffect, useMemo, useCallback, FunctionComponent } from 're import { SNApplication, SNNote } from '@standardnotes/snjs' import { KeyboardModifier } from '@/Services/IOService' import ChangeEditorOption from './ChangeEditorOption' -import { BYTES_IN_ONE_MEGABYTE } from '@/Constants' +import { BYTES_IN_ONE_MEGABYTE } from '@/Constants/Constants' import ListedActionsOption from './ListedActionsOption' import AddTagOption from './AddTagOption' import { addToast, dismissToast, ToastType } from '@standardnotes/stylekit' diff --git a/app/assets/javascripts/Components/NotesOptions/NotesOptionsPanel.tsx b/app/assets/javascripts/Components/NotesOptions/NotesOptionsPanel.tsx index 09874408f..dfb0d6461 100644 --- a/app/assets/javascripts/Components/NotesOptions/NotesOptionsPanel.tsx +++ b/app/assets/javascripts/Components/NotesOptions/NotesOptionsPanel.tsx @@ -7,7 +7,7 @@ import { useRef, useState } from 'react' import { observer } from 'mobx-react-lite' import NotesOptions from './NotesOptions' import { WebApplication } from '@/Application/Application' -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' type Props = { application: WebApplication diff --git a/app/assets/javascripts/Components/Preferences/Panes/Account/OfflineSubscription.tsx b/app/assets/javascripts/Components/Preferences/Panes/Account/OfflineSubscription.tsx index 573393817..56dbcbe17 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Account/OfflineSubscription.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Account/OfflineSubscription.tsx @@ -5,7 +5,7 @@ import Button from '@/Components/Button/Button' import { WebApplication } from '@/Application/Application' import { ViewControllerManager } from '@/Services/ViewControllerManager' import { observer } from 'mobx-react-lite' -import { STRING_REMOVE_OFFLINE_KEY_CONFIRMATION } from '@/Strings' +import { STRING_REMOVE_OFFLINE_KEY_CONFIRMATION } from '@/Constants/Strings' import { ButtonType, ClientDisplayableError } from '@standardnotes/snjs' import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator' diff --git a/app/assets/javascripts/Components/Preferences/Panes/Account/Sync.tsx b/app/assets/javascripts/Components/Preferences/Panes/Account/Sync.tsx index a8145d89a..abcb737d5 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Account/Sync.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Account/Sync.tsx @@ -1,7 +1,7 @@ import { Text, Title } from '@/Components/Preferences/PreferencesComponents/Content' import Button from '@/Components/Button/Button' import { SyncQueueStrategy } from '@standardnotes/snjs' -import { STRING_GENERIC_SYNC_ERROR } from '@/Strings' +import { STRING_GENERIC_SYNC_ERROR } from '@/Constants/Strings' import { observer } from 'mobx-react-lite' import { WebApplication } from '@/Application/Application' import { FunctionComponent, useState } from 'react' diff --git a/app/assets/javascripts/Components/Preferences/Panes/Backups/CloudBackups/CloudBackups.tsx b/app/assets/javascripts/Components/Preferences/Panes/Backups/CloudBackups/CloudBackups.tsx index 5dedd7c02..9a809b436 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Backups/CloudBackups/CloudBackups.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Backups/CloudBackups/CloudBackups.tsx @@ -13,7 +13,7 @@ import { import Switch from '@/Components/Switch/Switch' import { convertStringifiedBooleanToBoolean } from '@/Utils' -import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/Strings' +import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/Constants/Strings' import PreferencesGroup from '@/Components/Preferences/PreferencesComponents/PreferencesGroup' import PreferencesSegment from '@/Components/Preferences/PreferencesComponents/PreferencesSegment' diff --git a/app/assets/javascripts/Components/Preferences/Panes/Backups/DataBackups.tsx b/app/assets/javascripts/Components/Preferences/Panes/Backups/DataBackups.tsx index c76522731..35d81fec9 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Backups/DataBackups.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Backups/DataBackups.tsx @@ -9,7 +9,7 @@ import { STRING_E2E_ENABLED, STRING_LOCAL_ENC_ENABLED, STRING_ENC_NOT_ENABLED, -} from '@/Strings' +} from '@/Constants/Strings' import { BackupFile } from '@standardnotes/snjs' import { ChangeEventHandler, MouseEventHandler, useCallback, useEffect, useRef, useState } from 'react' import { WebApplication } from '@/Application/Application' diff --git a/app/assets/javascripts/Components/Preferences/Panes/Backups/EmailBackups.tsx b/app/assets/javascripts/Components/Preferences/Panes/Backups/EmailBackups.tsx index 488b1400e..6bd2b4ddd 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Backups/EmailBackups.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Backups/EmailBackups.tsx @@ -1,5 +1,5 @@ import { convertStringifiedBooleanToBoolean, isDesktopApplication } from '@/Utils' -import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/Strings' +import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/Constants/Strings' import { useCallback, useEffect, useState } from 'react' import { WebApplication } from '@/Application/Application' import { observer } from 'mobx-react-lite' diff --git a/app/assets/javascripts/Components/Preferences/Panes/General/Defaults.tsx b/app/assets/javascripts/Components/Preferences/Panes/General/Defaults.tsx index 4c8aef6a9..2801073d9 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/General/Defaults.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/General/Defaults.tsx @@ -6,7 +6,7 @@ import { WebApplication } from '@/Application/Application' import { FunctionComponent, useEffect, useState } from 'react' import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator' import Switch from '@/Components/Switch/Switch' -import { PLAIN_EDITOR_NAME } from '@/Constants' +import { PLAIN_EDITOR_NAME } from '@/Constants/Constants' import PreferencesGroup from '../../PreferencesComponents/PreferencesGroup' import PreferencesSegment from '../../PreferencesComponents/PreferencesSegment' diff --git a/app/assets/javascripts/Components/Preferences/Panes/Security/Encryption.tsx b/app/assets/javascripts/Components/Preferences/Panes/Security/Encryption.tsx index 45b000a66..e9b1799e2 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Security/Encryption.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Security/Encryption.tsx @@ -1,4 +1,4 @@ -import { STRING_E2E_ENABLED, STRING_ENC_NOT_ENABLED, STRING_LOCAL_ENC_ENABLED } from '@/Strings' +import { STRING_E2E_ENABLED, STRING_ENC_NOT_ENABLED, STRING_LOCAL_ENC_ENABLED } from '@/Constants/Strings' import { ViewControllerManager } from '@/Services/ViewControllerManager' import { observer } from 'mobx-react-lite' import { FunctionComponent } from 'react' diff --git a/app/assets/javascripts/Components/Preferences/Panes/Security/PasscodeLock.tsx b/app/assets/javascripts/Components/Preferences/Panes/Security/PasscodeLock.tsx index eb7b6e73c..697c33fb4 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Security/PasscodeLock.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Security/PasscodeLock.tsx @@ -7,7 +7,7 @@ import { STRING_NON_MATCHING_PASSCODES, StringUtils, Strings, -} from '@/Strings' +} from '@/Constants/Strings' import { WebApplication } from '@/Application/Application' import { preventRefreshing } from '@/Utils' import { alertDialog } from '@/Services/AlertService' diff --git a/app/assets/javascripts/Components/Preferences/Panes/Security/Privacy.tsx b/app/assets/javascripts/Components/Preferences/Panes/Security/Privacy.tsx index 6949235c4..913dd891f 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Security/Privacy.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Security/Privacy.tsx @@ -5,7 +5,7 @@ import { WebApplication } from '@/Application/Application' import { MuteSignInEmailsOption, LogSessionUserAgentOption, SettingName } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' import { FunctionComponent, useCallback, useEffect, useState } from 'react' -import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/Strings' +import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/Constants/Strings' import PreferencesGroup from '../../PreferencesComponents/PreferencesGroup' import PreferencesSegment from '../../PreferencesComponents/PreferencesSegment' diff --git a/app/assets/javascripts/Components/RevisionHistoryModal/HistoryListItem.tsx b/app/assets/javascripts/Components/RevisionHistoryModal/HistoryListItem.tsx index 6b9821366..3c93eb13c 100644 --- a/app/assets/javascripts/Components/RevisionHistoryModal/HistoryListItem.tsx +++ b/app/assets/javascripts/Components/RevisionHistoryModal/HistoryListItem.tsx @@ -1,4 +1,4 @@ -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { FunctionComponent } from 'react' type HistoryListItemProps = { diff --git a/app/assets/javascripts/Components/RevisionHistoryModal/RevisionHistoryModalWrapper.tsx b/app/assets/javascripts/Components/RevisionHistoryModal/RevisionHistoryModalWrapper.tsx index d459e9835..b29f5f21a 100644 --- a/app/assets/javascripts/Components/RevisionHistoryModal/RevisionHistoryModalWrapper.tsx +++ b/app/assets/javascripts/Components/RevisionHistoryModal/RevisionHistoryModalWrapper.tsx @@ -1,5 +1,5 @@ import { confirmDialog } from '@/Services/AlertService' -import { STRING_RESTORE_LOCKED_ATTEMPT } from '@/Strings' +import { STRING_RESTORE_LOCKED_ATTEMPT } from '@/Constants/Strings' import { WebApplication } from '@/Application/Application' import { ViewControllerManager } from '@/Services/ViewControllerManager' import { getPlatformString } from '@/Utils' diff --git a/app/assets/javascripts/Components/RevisionHistoryModal/utils.ts b/app/assets/javascripts/Components/RevisionHistoryModal/utils.ts index efc0d64b5..782b5bc39 100644 --- a/app/assets/javascripts/Components/RevisionHistoryModal/utils.ts +++ b/app/assets/javascripts/Components/RevisionHistoryModal/utils.ts @@ -1,4 +1,4 @@ -import { DAYS_IN_A_WEEK, DAYS_IN_A_YEAR } from '@/Constants' +import { DAYS_IN_A_WEEK, DAYS_IN_A_YEAR } from '@/Constants/Constants' import { HistoryEntry, NoteHistoryEntry, RevisionListEntry } from '@standardnotes/snjs' import { calculateDifferenceBetweenDatesInDays } from '../../Utils/CalculateDifferenceBetweenDatesInDays' diff --git a/app/assets/javascripts/Components/Tags/TagsListItem.tsx b/app/assets/javascripts/Components/Tags/TagsListItem.tsx index d879eadee..7c524c511 100644 --- a/app/assets/javascripts/Components/Tags/TagsListItem.tsx +++ b/app/assets/javascripts/Components/Tags/TagsListItem.tsx @@ -1,5 +1,5 @@ import Icon from '@/Components/Icon/Icon' -import { TAG_FOLDERS_FEATURE_NAME } from '@/Constants' +import { TAG_FOLDERS_FEATURE_NAME } from '@/Constants/Constants' import { usePremiumModal } from '@/Hooks/usePremiumModal' import { KeyboardKey } from '@/Services/IOService' import { FeaturesController } from '@/Controllers/FeaturesController' diff --git a/app/assets/javascripts/Components/Tags/TagsSectionTitle.tsx b/app/assets/javascripts/Components/Tags/TagsSectionTitle.tsx index 6d60b9ecd..f895daf6a 100644 --- a/app/assets/javascripts/Components/Tags/TagsSectionTitle.tsx +++ b/app/assets/javascripts/Components/Tags/TagsSectionTitle.tsx @@ -1,4 +1,4 @@ -import { TAG_FOLDERS_FEATURE_NAME, TAG_FOLDERS_FEATURE_TOOLTIP } from '@/Constants' +import { TAG_FOLDERS_FEATURE_NAME, TAG_FOLDERS_FEATURE_TOOLTIP } from '@/Constants/Constants' import { usePremiumModal } from '@/Hooks/usePremiumModal' import { FeaturesController } from '@/Controllers/FeaturesController' import { Tooltip } from '@reach/tooltip' diff --git a/app/assets/javascripts/Constants.ts b/app/assets/javascripts/Constants/Constants.ts similarity index 100% rename from app/assets/javascripts/Constants.ts rename to app/assets/javascripts/Constants/Constants.ts diff --git a/app/assets/javascripts/ElementIDs.ts b/app/assets/javascripts/Constants/ElementIDs.ts similarity index 100% rename from app/assets/javascripts/ElementIDs.ts rename to app/assets/javascripts/Constants/ElementIDs.ts diff --git a/app/assets/javascripts/Strings.ts b/app/assets/javascripts/Constants/Strings.ts similarity index 99% rename from app/assets/javascripts/Strings.ts rename to app/assets/javascripts/Constants/Strings.ts index 5cdbf2f28..cf78fec9b 100644 --- a/app/assets/javascripts/Strings.ts +++ b/app/assets/javascripts/Constants/Strings.ts @@ -1,5 +1,5 @@ import { Platform, SNApplication } from '@standardnotes/snjs' -import { getPlatform, isDesktopApplication } from './Utils' +import { getPlatform, isDesktopApplication } from '../Utils' /** @generic */ export const STRING_SESSION_EXPIRED = diff --git a/app/assets/javascripts/Version.ts b/app/assets/javascripts/Constants/Version.ts similarity index 100% rename from app/assets/javascripts/Version.ts rename to app/assets/javascripts/Constants/Version.ts diff --git a/app/assets/javascripts/Controllers/FilesController.ts b/app/assets/javascripts/Controllers/FilesController.ts index 5399be420..aeb7c11d0 100644 --- a/app/assets/javascripts/Controllers/FilesController.ts +++ b/app/assets/javascripts/Controllers/FilesController.ts @@ -3,7 +3,7 @@ import { PopoverFileItemActionType, } from '@/Components/AttachedFilesPopover/PopoverFileItemAction' import { PopoverTabs } from '@/Components/AttachedFilesPopover/PopoverTabs' -import { BYTES_IN_ONE_MEGABYTE } from '@/Constants' +import { BYTES_IN_ONE_MEGABYTE } from '@/Constants/Constants' import { confirmDialog } from '@/Services/AlertService' import { concatenateUint8Arrays } from '@/Utils/ConcatenateUint8Arrays' import { diff --git a/app/assets/javascripts/Controllers/Navigation/TagsController.ts b/app/assets/javascripts/Controllers/Navigation/TagsController.ts index 6447bc8fb..6e4d254b2 100644 --- a/app/assets/javascripts/Controllers/Navigation/TagsController.ts +++ b/app/assets/javascripts/Controllers/Navigation/TagsController.ts @@ -1,6 +1,6 @@ import { confirmDialog } from '@/Services/AlertService' -import { STRING_DELETE_TAG } from '@/Strings' -import { MAX_MENU_SIZE_MULTIPLIER, MENU_MARGIN_FROM_APP_BORDER, SMART_TAGS_FEATURE_NAME } from '@/Constants' +import { STRING_DELETE_TAG } from '@/Constants/Strings' +import { MAX_MENU_SIZE_MULTIPLIER, MENU_MARGIN_FROM_APP_BORDER, SMART_TAGS_FEATURE_NAME } from '@/Constants/Constants' import { ComponentAction, ContentType, diff --git a/app/assets/javascripts/Controllers/NoteTagsController.ts b/app/assets/javascripts/Controllers/NoteTagsController.ts index 78e9869d3..2cca0809a 100644 --- a/app/assets/javascripts/Controllers/NoteTagsController.ts +++ b/app/assets/javascripts/Controllers/NoteTagsController.ts @@ -1,4 +1,4 @@ -import { ElementIds } from '@/ElementIDs' +import { ElementIds } from '@/Constants/ElementIDs' import { destroyAllObjectProperties } from '@/Utils' import { ApplicationEvent, ContentType, DeinitSource, PrefKey, SNNote, SNTag, UuidString } from '@standardnotes/snjs' import { action, computed, makeObservable, observable } from 'mobx' diff --git a/app/assets/javascripts/Controllers/NotesController.ts b/app/assets/javascripts/Controllers/NotesController.ts index 9a3bdb0a3..363c2ea8d 100644 --- a/app/assets/javascripts/Controllers/NotesController.ts +++ b/app/assets/javascripts/Controllers/NotesController.ts @@ -1,7 +1,7 @@ import { destroyAllObjectProperties } from '@/Utils' import { confirmDialog } from '@/Services/AlertService' -import { StringEmptyTrash, Strings, StringUtils } from '@/Strings' -import { MENU_MARGIN_FROM_APP_BORDER } from '@/Constants' +import { StringEmptyTrash, Strings, StringUtils } from '@/Constants/Strings' +import { MENU_MARGIN_FROM_APP_BORDER } from '@/Constants/Constants' import { SNNote, NoteMutator, ContentType, SNTag, DeinitSource, TagMutator } from '@standardnotes/snjs' import { makeObservable, observable, action, computed, runInAction } from 'mobx' import { WebApplication } from '../Application/Application' diff --git a/app/assets/javascripts/Enums.ts b/app/assets/javascripts/Enums.ts deleted file mode 100644 index e19ae9350..000000000 --- a/app/assets/javascripts/Enums.ts +++ /dev/null @@ -1,24 +0,0 @@ -export enum HtmlInputTypes { - Button = 'button', - Checkbox = 'checkbox', - Color = 'color', - Date = 'date', - DateTimeLocal = 'datetime-local', - Email = 'email', - File = 'file', - Hidden = 'hidden', - Image = 'image', - Month = 'month', - Number = 'number', - Password = 'password', - Radio = 'radio', - Range = 'range', - Reset = 'reset', - Search = 'search', - Submit = 'submit', - Tel = 'tel', - Text = 'text', - Time = 'time', - Url = 'url', - Week = 'week', -} diff --git a/app/assets/javascripts/Hooks/useListKeyboardNavigation.ts b/app/assets/javascripts/Hooks/useListKeyboardNavigation.ts index 491437215..8ad795cb3 100644 --- a/app/assets/javascripts/Hooks/useListKeyboardNavigation.ts +++ b/app/assets/javascripts/Hooks/useListKeyboardNavigation.ts @@ -1,5 +1,5 @@ import { KeyboardKey } from '@/Services/IOService' -import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants' +import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { useCallback, useState, useEffect, RefObject } from 'react' export const useListKeyboardNavigation = (container: RefObject, initialFocus = 0) => { diff --git a/app/assets/javascripts/Services/ViewControllerManager/ViewControllerManager.ts b/app/assets/javascripts/Services/ViewControllerManager/ViewControllerManager.ts index 3bb4beb28..2621abaae 100644 --- a/app/assets/javascripts/Services/ViewControllerManager/ViewControllerManager.ts +++ b/app/assets/javascripts/Services/ViewControllerManager/ViewControllerManager.ts @@ -30,8 +30,8 @@ import { FilePreviewModalController } from '../../Controllers/FilePreviewModalCo import { SelectedItemsController } from '../../Controllers/SelectedItemsController' import { ListableContentItem } from '@/Components/ContentListView/Types/ListableContentItem' import { ViewControllerManagerEvent } from './ViewControllerManagerEvent' -import { EditorEventSource } from '../../Typings/EditorEventSource' -import { PanelResizedData } from '../../Typings/PanelResizedData' +import { EditorEventSource } from '../../Types/EditorEventSource' +import { PanelResizedData } from '../../Types/PanelResizedData' type ObserverCallback = (event: ViewControllerManagerEvent, data?: unknown) => Promise diff --git a/app/assets/javascripts/Types.ts b/app/assets/javascripts/Types.ts deleted file mode 100644 index bc8c8085b..000000000 --- a/app/assets/javascripts/Types.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type PanelPuppet = { - onReady?: () => void - ready?: boolean - setWidth?: (width: number) => void - setLeft?: (left: number) => void - isCollapsed?: () => boolean - flash?: () => void -} - -export type FooterStatus = { - string: string -} diff --git a/app/assets/javascripts/Typings/EditorEventSource.ts b/app/assets/javascripts/Types/EditorEventSource.ts similarity index 100% rename from app/assets/javascripts/Typings/EditorEventSource.ts rename to app/assets/javascripts/Types/EditorEventSource.ts diff --git a/app/assets/javascripts/@types/Svg.d.ts b/app/assets/javascripts/Types/External/Svg.d.ts similarity index 100% rename from app/assets/javascripts/@types/Svg.d.ts rename to app/assets/javascripts/Types/External/Svg.d.ts diff --git a/app/assets/javascripts/@types/qrcode.react.d.ts b/app/assets/javascripts/Types/External/qrcode.react.d.ts similarity index 100% rename from app/assets/javascripts/@types/qrcode.react.d.ts rename to app/assets/javascripts/Types/External/qrcode.react.d.ts diff --git a/app/assets/javascripts/Typings/PanelResizedData.ts b/app/assets/javascripts/Types/PanelResizedData.ts similarity index 100% rename from app/assets/javascripts/Typings/PanelResizedData.ts rename to app/assets/javascripts/Types/PanelResizedData.ts diff --git a/app/assets/javascripts/Typings/hoist-non-react-statics.d.ts b/app/assets/javascripts/Typings/hoist-non-react-statics.d.ts deleted file mode 100644 index a4019f8db..000000000 --- a/app/assets/javascripts/Typings/hoist-non-react-statics.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-types */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -// Type definitions for hoist-non-react-statics 3.3 -// Project: https://github.com/mridgway/hoist-non-react-statics#readme -// Definitions by: JounQin , James Reggio -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 -// https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hoist-non-react-statics - -declare module 'hoist-non-react-statics' { - interface REACT_STATICS { - childContextTypes: true - contextType: true - contextTypes: true - defaultProps: true - displayName: true - getDefaultProps: true - getDerivedStateFromError: true - getDerivedStateFromProps: true - mixins: true - propTypes: true - type: true - } - - interface KNOWN_STATICS { - name: true - length: true - prototype: true - caller: true - callee: true - arguments: true - arity: true - } - - interface MEMO_STATICS { - $$typeof: true - compare: true - defaultProps: true - displayName: true - propTypes: true - type: true - } - - interface FORWARD_REF_STATICS { - $$typeof: true - render: true - defaultProps: true - displayName: true - propTypes: true - } - - export type NonReactStatics< - S extends React.ComponentType, - C extends { - [key: string]: true - } = {}, - > = { - [key in Exclude< - keyof S, - S extends React.MemoExoticComponent - ? keyof MEMO_STATICS | keyof C - : S extends React.ForwardRefExoticComponent - ? keyof FORWARD_REF_STATICS | keyof C - : keyof REACT_STATICS | keyof KNOWN_STATICS | keyof C - >]: S[key] - } -} diff --git a/app/assets/javascripts/Utils/CalculateDifferenceBetweenDatesInDays.ts b/app/assets/javascripts/Utils/CalculateDifferenceBetweenDatesInDays.ts index 47c5e5173..ce4a1a6a1 100644 --- a/app/assets/javascripts/Utils/CalculateDifferenceBetweenDatesInDays.ts +++ b/app/assets/javascripts/Utils/CalculateDifferenceBetweenDatesInDays.ts @@ -1,4 +1,4 @@ -import { MILLISECONDS_IN_A_DAY } from '@/Constants' +import { MILLISECONDS_IN_A_DAY } from '@/Constants/Constants' export const calculateDifferenceBetweenDatesInDays = (firstDate: Date, secondDate: Date) => { const firstDateAsUTCMilliseconds = Date.UTC(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate()) diff --git a/app/assets/javascripts/Utils/CalculateSubmenuStyle.tsx b/app/assets/javascripts/Utils/CalculateSubmenuStyle.tsx index 5ad77e12c..8e2e4755f 100644 --- a/app/assets/javascripts/Utils/CalculateSubmenuStyle.tsx +++ b/app/assets/javascripts/Utils/CalculateSubmenuStyle.tsx @@ -1,4 +1,4 @@ -import { MAX_MENU_SIZE_MULTIPLIER, MENU_MARGIN_FROM_APP_BORDER } from '@/Constants' +import { MAX_MENU_SIZE_MULTIPLIER, MENU_MARGIN_FROM_APP_BORDER } from '@/Constants/Constants' export type SubmenuStyle = { top?: number | 'auto' diff --git a/app/assets/javascripts/Utils/Utils.ts b/app/assets/javascripts/Utils/Utils.ts index 603992ab7..d1cdfc050 100644 --- a/app/assets/javascripts/Utils/Utils.ts +++ b/app/assets/javascripts/Utils/Utils.ts @@ -1,6 +1,6 @@ import { Platform, platformFromString } from '@standardnotes/snjs' -import { IsDesktopPlatform, IsWebPlatform } from '@/Version' -import { EMAIL_REGEX } from '../Constants' +import { IsDesktopPlatform, IsWebPlatform } from '@/Constants/Version' +import { EMAIL_REGEX } from '../Constants/Constants' export { isMobile } from './IsMobile' declare const process: { diff --git a/app/assets/javascripts/tsconfig.json b/app/assets/javascripts/tsconfig.json index eecf40d38..e96a9cee4 100644 --- a/app/assets/javascripts/tsconfig.json +++ b/app/assets/javascripts/tsconfig.json @@ -16,7 +16,7 @@ "declarationDir": "../../../dist/@types", "baseUrl": ".", "jsx": "react-jsx", - "typeRoots": ["./@types", "../../../node_modules/@types"], + "typeRoots": ["./Types/External", "../../../node_modules/@types"], "paths": { "%/*": ["../templates/*"], "@/*": ["./*"],