refactor: Reorganize frontend by moving UI components, hooks, and utilities to new components, logic, features, and lib directories
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
|||||||
DocumentsFilterProvider,
|
DocumentsFilterProvider,
|
||||||
} from '../documents/context/DocumentsFilterContext';
|
} from '../documents/context/DocumentsFilterContext';
|
||||||
import { PreviewProvider, usePreviewContext } from '../preview/PreviewContext';
|
import { PreviewProvider, usePreviewContext } from '../preview/PreviewContext';
|
||||||
import { DocumentOpenProvider } from '../contexts/DocumentOpenContext';
|
import { DocumentOpenProvider } from '../lib/context/DocumentOpenContext';
|
||||||
import { useWorkspaceSurface } from './useWorkspaceSurface';
|
import { useWorkspaceSurface } from './useWorkspaceSurface';
|
||||||
import { DocumentsHeaderBreadcrumb } from '../documents/panel/DocumentsPanelHeader';
|
import { DocumentsHeaderBreadcrumb } from '../documents/panel/DocumentsPanelHeader';
|
||||||
import { SidebarProvider, useSidebarContext } from '../sidebar/SidebarContext';
|
import { SidebarProvider, useSidebarContext } from '../sidebar/SidebarContext';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
serializeAuthenticationCredential,
|
serializeAuthenticationCredential,
|
||||||
serializeRegistrationCredential,
|
serializeRegistrationCredential,
|
||||||
} from '../utils/webauthn';
|
} from '../utils/webauthn';
|
||||||
import { useAppDispatch, useAppState } from './appState';
|
import { useAppDispatch, useAppState } from '../lib/store/appState';
|
||||||
import {
|
import {
|
||||||
finishPasskeyLogin,
|
finishPasskeyLogin,
|
||||||
finishSignup,
|
finishSignup,
|
||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
selectTenant,
|
selectTenant,
|
||||||
startPasskeyLogin,
|
startPasskeyLogin,
|
||||||
startSignup,
|
startSignup,
|
||||||
} from '../lib/apiClient';
|
} from '../lib/api/apiClient';
|
||||||
|
|
||||||
type StatusVariant = 'info' | 'success' | 'error';
|
type StatusVariant = 'info' | 'success' | 'error';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useCallback } from 'react';
|
import React, { useEffect, useCallback } from 'react';
|
||||||
import SettingsModal from '../settings/SettingsModal';
|
import SettingsModal from '../settings/SettingsModal';
|
||||||
import { useAppShell } from '../appShellContext';
|
import { useAppShell } from '../lib/context/AppShellContext';
|
||||||
import useApiTokens from '../settings/useApiTokens';
|
import useApiTokens from '../settings/useApiTokens';
|
||||||
import useCapabilitySets from '../settings/useCapabilitySets';
|
import useCapabilitySets from '../settings/useCapabilitySets';
|
||||||
import useCapabilities from '../settings/useCapabilities';
|
import useCapabilities from '../settings/useCapabilities';
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import {
|
|||||||
WarningIcon,
|
WarningIcon,
|
||||||
BottombarCollapseIcon,
|
BottombarCollapseIcon,
|
||||||
BottombarExpandIcon,
|
BottombarExpandIcon,
|
||||||
} from '../ui/icons';
|
} from '../components/icons';
|
||||||
import PanelHeader from '../ui/PanelHeader';
|
import PanelHeader from '../components/PanelHeader';
|
||||||
|
|
||||||
type UploadStatus = 'pending' | 'uploading' | 'success' | 'duplicate' | 'error' | (string & {});
|
type UploadStatus = 'pending' | 'uploading' | 'success' | 'duplicate' | 'error' | (string & {});
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import type { Dispatch, SetStateAction } from 'react';
|
import type { Dispatch, SetStateAction } from 'react';
|
||||||
import { TAG_FILTER_UNTAGGED } from './workspaceUtils';
|
import { TAG_FILTER_UNTAGGED } from './workspaceUtils';
|
||||||
import { listDocuments } from '../lib/apiClient';
|
import { listDocuments } from '../lib/api/apiClient';
|
||||||
import type { Identifier } from '../types/identifiers';
|
import type { Identifier } from '../types/identifiers';
|
||||||
|
|
||||||
import type { Document } from '../types/documents';
|
import type { Document } from '../types/documents';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import type { ComponentProps } from 'react';
|
import type { ComponentProps } from 'react';
|
||||||
import { useAppShell } from '../appShellContext';
|
import { useAppShell } from '../lib/context/AppShellContext';
|
||||||
import type { DocumentsFilterValue } from '../documents/context/DocumentsFilterContext';
|
import type { DocumentsFilterValue } from '../documents/context/DocumentsFilterContext';
|
||||||
import type Sidebar from '../sidebar/Sidebar';
|
import type Sidebar from '../sidebar/Sidebar';
|
||||||
import type { UseWorkspaceSurfaceArgs } from './useWorkspaceSurface';
|
import type { UseWorkspaceSurfaceArgs } from './useWorkspaceSurface';
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import TagsPanel from '../tags/TagsPanel';
|
import TagsPanel from '../tags/TagsPanel';
|
||||||
import CorrespondentsPanel, { CorrespondentsPanelProps } from '../correspondents/CorrespondentsPanel';
|
import CorrespondentsPanel, { CorrespondentsPanelProps } from '../correspondents/CorrespondentsPanel';
|
||||||
import PanelHeader from '../ui/PanelHeader';
|
import PanelHeader from '../components/PanelHeader';
|
||||||
import { CloseIcon } from '../ui/icons';
|
import { CloseIcon } from '../components/icons';
|
||||||
import { CORRESPONDENTS_MODAL, TAGS_MODAL } from '../constants/app';
|
import { CORRESPONDENTS_MODAL, TAGS_MODAL } from '../constants/app';
|
||||||
|
|
||||||
interface TagRecord {
|
interface TagRecord {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useCallback, useEffect, useMemo } from 'react';
|
import { useCallback, useEffect, useMemo } from 'react';
|
||||||
import type { ComponentProps, ReactNode } from 'react';
|
import type { ComponentProps, ReactNode } from 'react';
|
||||||
import { SidebarExpandIcon } from '../ui/icons';
|
import { SidebarExpandIcon } from '../components/icons';
|
||||||
import DocumentsPanel from '../documents/panel/DocumentsPanel';
|
import DocumentsPanel from '../documents/panel/DocumentsPanel';
|
||||||
import DocumentViewerPanel from '../preview/DocumentViewerPanel';
|
import DocumentViewerPanel from '../preview/DocumentViewerPanel';
|
||||||
import { usePanelManager } from './PanelManagerContext';
|
import { usePanelManager } from './PanelManagerContext';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useCallback, useEffect, useRef } from 'react';
|
import React, { useState, useCallback, useEffect, useRef } from 'react';
|
||||||
import { useStatusToast } from '../contexts/StatusToastContext';
|
import { useStatusToast } from '../lib/context/StatusToastContext';
|
||||||
import '../styles/status-toast.css';
|
import '../styles/status-toast.css';
|
||||||
|
|
||||||
const FADE_OUT_DURATION = 300; // Match CSS animation duration
|
const FADE_OUT_DURATION = 300; // Match CSS animation duration
|
||||||
|
|||||||
+6
-6
@@ -1,11 +1,11 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import DesktopPreviewCard from './DesktopPreviewCard';
|
import DesktopPreviewCard from './DesktopPreviewCard';
|
||||||
import { resolveCorrespondents } from '../documents/correspondents';
|
import { resolveCorrespondents } from '../../documents/correspondents';
|
||||||
import { getTagColorStyle } from '../utils/colors';
|
import { getTagColorStyle } from '../../utils/colors';
|
||||||
import type { DocumentId } from '../types/identifiers';
|
import type { DocumentId } from '../../types/identifiers';
|
||||||
import type { Document } from '../types/documents';
|
import type { Document } from '../../types/documents';
|
||||||
import { LayoutCard } from './LayoutSystem';
|
import { LayoutCard } from '../logic/LayoutSystem';
|
||||||
import { useCardPointer } from './useCardPointer';
|
import { useCardPointer } from '../interactions/useCardPointer';
|
||||||
|
|
||||||
const preventAll = (event?: React.SyntheticEvent | Event | null) => {
|
const preventAll = (event?: React.SyntheticEvent | Event | null) => {
|
||||||
if (!event) return;
|
if (!event) return;
|
||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import type { JSX } from 'react';
|
import type { JSX } from 'react';
|
||||||
import { resolveDocumentAssetUrl } from '../asset_manager';
|
import { resolveDocumentAssetUrl } from '../../lib/assets/AssetManager';
|
||||||
import type { Identifier } from '../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
import type { Document } from '../types/documents';
|
import type { Document } from '../../types/documents';
|
||||||
|
|
||||||
import type { Asset } from '../types/assets';
|
import type { Asset } from '../../types/assets';
|
||||||
|
|
||||||
type EnsureAssetUrl = (
|
type EnsureAssetUrl = (
|
||||||
documentId: Identifier,
|
documentId: Identifier,
|
||||||
+13
-13
@@ -5,20 +5,20 @@ import React, {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { LayoutStore, LayoutCard } from './LayoutSystem';
|
import { LayoutStore, LayoutCard } from '../logic/LayoutSystem';
|
||||||
import DesktopDocumentCard from './DesktopDocumentCard';
|
import DesktopDocumentCard from './DesktopDocumentCard';
|
||||||
import usePreviewMetadata from './hooks/usePreviewMetadata';
|
import usePreviewMetadata from '../hooks/usePreviewMetadata';
|
||||||
import { useDeskTagInteractions } from './tags/useDeskTagInteractions';
|
import { useDeskTagInteractions } from '../tags/useDeskTagInteractions';
|
||||||
import '../styles/workspace/workspace-layout.css';
|
import './workspace-layout.css';
|
||||||
import '../styles/workspace/workspace-items.css';
|
import './workspace-items.css';
|
||||||
import '../styles/workspace/workspace-cards.css';
|
import './workspace-cards.css';
|
||||||
import { useWorkspaceSelectionContext } from '../app/WorkspaceSelectionContext';
|
import { useWorkspaceSelectionContext } from '../../app/WorkspaceSelectionContext';
|
||||||
import { createDocumentEntryKey } from '../app/entryKey';
|
import { createDocumentEntryKey } from '../../app/entryKey';
|
||||||
import { PointerTrackingProvider, usePointerTracking } from './PointerTrackingContext';
|
import { PointerTrackingProvider, usePointerTracking } from '../interactions/PointerTrackingContext';
|
||||||
import type { Identifier } from '../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
import type { DocumentsListEntry, Document } from '../types/documents';
|
import type { DocumentsListEntry, Document } from '../../types/documents';
|
||||||
import { useAppState } from '../app/appState';
|
import { useAppState } from '../../lib/store/appState';
|
||||||
import { useDocumentOpen } from '../contexts/DocumentOpenContext';
|
import { useDocumentOpen } from '../../lib/context/DocumentOpenContext';
|
||||||
|
|
||||||
interface DocumentSizeInfo {
|
interface DocumentSizeInfo {
|
||||||
width: number;
|
width: number;
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import React, { useRef, useCallback } from 'react';
|
import React, { useRef, useCallback } from 'react';
|
||||||
import { createSafeContext } from '../utils/createSafeContext';
|
import { createSafeContext } from '../../utils/createSafeContext';
|
||||||
|
|
||||||
interface PointerTrackingContextType {
|
interface PointerTrackingContextType {
|
||||||
activePointersRef: React.MutableRefObject<Map<number, string | undefined>>;
|
activePointersRef: React.MutableRefObject<Map<number, string | undefined>>;
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
import React, { useCallback, useRef } from 'react';
|
import React, { useCallback, useRef } from 'react';
|
||||||
import { usePointerTracking } from './PointerTrackingContext';
|
import { usePointerTracking } from './PointerTrackingContext';
|
||||||
|
|
||||||
import { LayoutCard } from './LayoutSystem';
|
import { LayoutCard } from '../logic/LayoutSystem';
|
||||||
import { handleDragMove, handleDragEnd, handleDragStart, attachToDragGroup } from './CardDragLogic';
|
import { handleDragMove, handleDragEnd, handleDragStart, attachToDragGroup } from '../logic/CardDragLogic';
|
||||||
|
|
||||||
const DRAG_THRESHOLD = 3;
|
const DRAG_THRESHOLD = 3;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { constrainDimensions, getInitialPosition, CONTAINER_PADDING } from './utils/layoutUtils';
|
import { constrainDimensions, getInitialPosition, CONTAINER_PADDING } from '../utils/layoutUtils';
|
||||||
|
|
||||||
import { fetchLayoutRecords, upsertLayoutRecords } from './db';
|
import { fetchLayoutRecords, upsertLayoutRecords } from './db';
|
||||||
import { CardPhysics } from './CardPhysics';
|
import { CardPhysics } from './CardPhysics';
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { DocumentId } from '../types/identifiers';
|
import type { DocumentId } from '../../types/identifiers';
|
||||||
import { DB_NAME, DB_VERSION, LAYOUT_STORE } from '../constants/desktop';
|
import { DB_NAME, DB_VERSION, LAYOUT_STORE } from '../../constants/desktop';
|
||||||
type TenantId = import('../types/identifiers').TenantId;
|
type TenantId = import('../../types/identifiers').TenantId;
|
||||||
|
|
||||||
const currentDbPromise: { value: Promise<IDBDatabase | null> | null } = { value: null };
|
const currentDbPromise: { value: Promise<IDBDatabase | null> | null } = { value: null };
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
isTagTransferEvent,
|
isTagTransferEvent,
|
||||||
parseTagTransferPayload,
|
parseTagTransferPayload,
|
||||||
writeTagTransferData,
|
writeTagTransferData,
|
||||||
} from '../../documents/tagTransfer';
|
} from '../../documents/features/tagging/tagTransfer';
|
||||||
import type { Identifier } from '../../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
import type { Document, DocumentTag } from '../../types/documents';
|
import type { Document, DocumentTag } from '../../types/documents';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { LayoutCard } from '../LayoutSystem';
|
import type { LayoutCard } from '../logic/LayoutSystem';
|
||||||
|
|
||||||
export const CONTAINER_PADDING = 18;
|
export const CONTAINER_PADDING = 18;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import UnifiedDocumentViewer from '../preview/UnifiedDocumentViewer';
|
import UnifiedDocumentViewer from '../preview/UnifiedDocumentViewer';
|
||||||
import PanelHeader from '../ui/PanelHeader';
|
import PanelHeader from '../components/PanelHeader';
|
||||||
import { IconX, DownloadIcon, FileInfoIcon } from '../ui/icons';
|
import { IconX, DownloadIcon, FileInfoIcon } from '../components/icons';
|
||||||
|
|
||||||
import type { Document } from '../types/documents';
|
import type { Document } from '../types/documents';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useCallback, useEffect, useMemo } from 'react';
|
import { useCallback, useEffect, useMemo } from 'react';
|
||||||
import type { MutableRefObject } from 'react';
|
import type { MutableRefObject } from 'react';
|
||||||
import { resolveDocumentAssetUrl } from '../asset_manager';
|
import { resolveDocumentAssetUrl } from '../lib/assets/AssetManager';
|
||||||
import { useDetailPanel } from '../app/useDetailPanel';
|
import { useDetailPanel } from '../app/useDetailPanel';
|
||||||
import { DEFAULT_FOLDER_NAME } from '../app/workspaceUtils';
|
import { DEFAULT_FOLDER_NAME } from '../app/workspaceUtils';
|
||||||
import type { DocumentInfoPanelProps } from '../documents/DocumentInfoPanel';
|
import type { DocumentInfoPanelProps } from '../documents/DocumentInfoPanel';
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import React, { useCallback, useEffect, useMemo, useState, type FormEvent } from 'react';
|
import React, { useCallback, useEffect, useMemo, useState, type FormEvent } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { EditIcon, IconX, PlusIcon } from '../ui/icons';
|
import { EditIcon, IconX, PlusIcon } from '../components/icons';
|
||||||
import InlineRenameInput from './components/InlineRenameInput';
|
import InlineRenameInput from './components/InlineRenameInput';
|
||||||
import SelectionAssignmentMenu, {
|
import SelectionAssignmentMenu, {
|
||||||
SelectionAssignmentMenuItem,
|
SelectionAssignmentMenuItem,
|
||||||
type NormalizedSelectionAssignmentItem,
|
type NormalizedSelectionAssignmentItem,
|
||||||
} from './SelectionAssignmentMenu';
|
} from './features/selection/SelectionAssignmentMenu';
|
||||||
import { getTagColorStyle } from '../utils/colors';
|
import { getTagColorStyle } from '../utils/colors';
|
||||||
import {
|
import {
|
||||||
formatDate,
|
formatDate,
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import {
|
|||||||
getAssetFromVersion,
|
getAssetFromVersion,
|
||||||
resolveDocumentAssetUrl,
|
resolveDocumentAssetUrl,
|
||||||
resolveAssetUrl,
|
resolveAssetUrl,
|
||||||
} from '../asset_manager';
|
} from '../lib/assets/AssetManager';
|
||||||
import { DEFAULT_THUMBNAIL_SIZE } from '../constants/documents';
|
import { DEFAULT_THUMBNAIL_SIZE } from '../constants/documents';
|
||||||
import type {
|
import type {
|
||||||
Asset as AssetManagerAsset,
|
Asset as AssetManagerAsset,
|
||||||
EnsureAssetUrl as AssetManagerEnsureAssetUrl,
|
EnsureAssetUrl as AssetManagerEnsureAssetUrl,
|
||||||
GetAsset as AssetManagerGetAsset,
|
GetAsset as AssetManagerGetAsset,
|
||||||
} from '../asset_manager';
|
} from '../lib/assets/AssetManager';
|
||||||
|
|
||||||
// Detect when an element becomes visible within a scroll container so we can delay loading.
|
// Detect when an element becomes visible within a scroll container so we can delay loading.
|
||||||
const useLazyVisibility = (
|
const useLazyVisibility = (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useCallback } from 'react';
|
import React, { useEffect, useCallback } from 'react';
|
||||||
import { useDocumentViewLogic, DocumentViewLogic } from './hooks/useDocumentViewLogic';
|
import { useDocumentViewLogic, DocumentViewLogic } from './logic/useDocumentViewLogic';
|
||||||
import { useDocumentsNavigation } from './hooks/useDocumentsNavigation';
|
import { useDocumentsNavigation } from './logic/useDocumentsNavigation';
|
||||||
import { useWorkspaceSelectionContext } from '../app/WorkspaceSelectionContext';
|
import { useWorkspaceSelectionContext } from '../app/WorkspaceSelectionContext';
|
||||||
import { usePanelManager } from '../app/PanelManagerContext';
|
import { usePanelManager } from '../app/PanelManagerContext';
|
||||||
import DocumentsListRow from './components/DocumentsListRow';
|
import DocumentsListRow from './components/DocumentsListRow';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
||||||
import type { DocumentViewLogic } from '../hooks/useDocumentViewLogic';
|
import type { DocumentViewLogic } from '../logic/useDocumentViewLogic';
|
||||||
import { useDocumentItemLogic } from '../hooks/useDocumentItemLogic';
|
import { useDocumentItemLogic } from '../logic/useDocumentItemLogic';
|
||||||
import EntryShell from './EntryShell';
|
import EntryShell from './EntryShell';
|
||||||
|
|
||||||
interface DocumentEntryProps extends DocumentsViewProps {
|
interface DocumentEntryProps extends DocumentsViewProps {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { getTagColorStyle } from '../../utils/colors';
|
import { getTagColorStyle } from '../../utils/colors';
|
||||||
import { writeTagTransferData } from '../tagTransfer';
|
import { writeTagTransferData } from '../features/tagging/tagTransfer';
|
||||||
import type { DocumentTag } from '../../types/documents';
|
import type { DocumentTag } from '../../types/documents';
|
||||||
import type { Identifier } from '../../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FolderIcon } from '../../ui/icons';
|
import { FolderIcon } from '../../components/icons';
|
||||||
import DocumentThumbnailImage from '../DocumentThumbnailImage';
|
import DocumentThumbnailImage from '../DocumentThumbnailImage';
|
||||||
import { resolveCorrespondents } from '../correspondents';
|
import { resolveCorrespondents } from '../correspondents';
|
||||||
import type { DocumentsListEntry } from '../../types/documents';
|
import type { DocumentsListEntry } from '../../types/documents';
|
||||||
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
||||||
import type { DocumentViewLogic } from '../hooks/useDocumentViewLogic';
|
import type { DocumentViewLogic } from '../logic/useDocumentViewLogic';
|
||||||
import EditableEntryTitle from './EditableEntryTitle';
|
import EditableEntryTitle from './EditableEntryTitle';
|
||||||
import EntryCorrespondents from './EntryCorrespondents';
|
import EntryCorrespondents from './EntryCorrespondents';
|
||||||
import EntryTags from './EntryTags';
|
import EntryTags from './EntryTags';
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FolderIcon } from '../../ui/icons';
|
import { FolderIcon } from '../../components/icons';
|
||||||
import { formatDate } from '../../utils/date';
|
import { formatDate } from '../../utils/date';
|
||||||
import DocumentThumbnailImage from '../DocumentThumbnailImage';
|
import DocumentThumbnailImage from '../DocumentThumbnailImage';
|
||||||
import { resolveCorrespondents } from '../correspondents';
|
import { resolveCorrespondents } from '../correspondents';
|
||||||
import type { DocumentsListEntry } from '../../types/documents';
|
import type { DocumentsListEntry } from '../../types/documents';
|
||||||
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
||||||
import type { DocumentViewLogic } from '../hooks/useDocumentViewLogic';
|
import type { DocumentViewLogic } from '../logic/useDocumentViewLogic';
|
||||||
import EditableEntryTitle from './EditableEntryTitle';
|
import EditableEntryTitle from './EditableEntryTitle';
|
||||||
import EntryCorrespondents from './EntryCorrespondents';
|
import EntryCorrespondents from './EntryCorrespondents';
|
||||||
import EntryTags from './EntryTags';
|
import EntryTags from './EntryTags';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
||||||
import type { DocumentViewLogic } from '../hooks/useDocumentViewLogic';
|
import type { DocumentViewLogic } from '../logic/useDocumentViewLogic';
|
||||||
import { useFolderItemLogic } from '../hooks/useFolderItemLogic';
|
import { useFolderItemLogic } from '../features/folders/useFolderItemLogic';
|
||||||
import EntryShell from './EntryShell';
|
import EntryShell from './EntryShell';
|
||||||
|
|
||||||
interface FolderEntryProps extends DocumentsViewProps {
|
interface FolderEntryProps extends DocumentsViewProps {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { CheckIcon, CloseIcon } from '../../ui/icons';
|
import { CheckIcon, CloseIcon } from '../../components/icons';
|
||||||
|
|
||||||
interface InlineRenameInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'onSubmit' | 'value'> {
|
interface InlineRenameInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'onSubmit' | 'value'> {
|
||||||
value: string;
|
value: string;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { useCallback, useEffect, useRef } from 'react';
|
import { useCallback, useEffect, useRef } from 'react';
|
||||||
import type { MutableRefObject } from 'react';
|
import type { MutableRefObject } from 'react';
|
||||||
import { clearAuthToken, logoutSession, refreshSession, setAuthToken } from '../../lib/apiClient';
|
import { clearAuthToken, logoutSession, refreshSession, setAuthToken } from '../../lib/api/apiClient';
|
||||||
|
|
||||||
type AppStatus = string;
|
type AppStatus = string;
|
||||||
|
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { assignCorrespondentsBulk } from '../../lib/apiClient';
|
import { assignCorrespondentsBulk } from '../../lib/api/apiClient';
|
||||||
import type { Identifier } from '../../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
import type { MessageOptions } from '../../types/documents';
|
import type { MessageOptions } from '../../types/documents';
|
||||||
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { MutableRefObject, useCallback, useState } from 'react';
|
import { MutableRefObject, useCallback, useState } from 'react';
|
||||||
import type { Correspondent } from '../../types/documents';
|
import type { Correspondent } from '../../types/documents';
|
||||||
|
|
||||||
import { listCorrespondents, createCorrespondent, updateCorrespondent, deleteCorrespondent } from '../../lib/apiClient';
|
import { listCorrespondents, createCorrespondent, updateCorrespondent, deleteCorrespondent } from '../../lib/api/apiClient';
|
||||||
|
|
||||||
interface UseCorrespondentsOptions {
|
interface UseCorrespondentsOptions {
|
||||||
notifyApiError: (error: unknown, fallback: string) => void;
|
notifyApiError: (error: unknown, fallback: string) => void;
|
||||||
+1
-1
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react';
|
|||||||
import type { Identifier } from '../../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
|
|
||||||
|
|
||||||
import { addDocumentCorrespondent, removeDocumentCorrespondent } from '../../lib/apiClient';
|
import { addDocumentCorrespondent, removeDocumentCorrespondent } from '../../lib/api/apiClient';
|
||||||
|
|
||||||
interface CorrespondentOption {
|
interface CorrespondentOption {
|
||||||
id?: string;
|
id?: string;
|
||||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
|||||||
queueDocumentReanalysis,
|
queueDocumentReanalysis,
|
||||||
trashDocument,
|
trashDocument,
|
||||||
updateDocument,
|
updateDocument,
|
||||||
} from '../../lib/apiClient';
|
} from '../../lib/api/apiClient';
|
||||||
import type { DocumentId, FolderId as FolderIdentifier } from '../../types/identifiers';
|
import type { DocumentId, FolderId as FolderIdentifier } from '../../types/identifiers';
|
||||||
import type { Document, MessageOptions } from '../../types/documents';
|
import type { Document, MessageOptions } from '../../types/documents';
|
||||||
|
|
||||||
+1
-1
@@ -6,7 +6,7 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import DocumentsManager from '../../documents/DocumentsManager';
|
import DocumentsManager from '../DocumentsManager';
|
||||||
import type { DocumentId } from '../../types/identifiers';
|
import type { DocumentId } from '../../types/identifiers';
|
||||||
import type { Document } from '../../types/documents';
|
import type { Document } from '../../types/documents';
|
||||||
|
|
||||||
+20
-20
@@ -13,19 +13,19 @@ import {
|
|||||||
useMatch,
|
useMatch,
|
||||||
useNavigate,
|
useNavigate,
|
||||||
} from 'react-router-dom';
|
} from 'react-router-dom';
|
||||||
import AssetManager, { getAssetFromVersion } from '../../asset_manager';
|
import AssetManager, { getAssetFromVersion } from '../../lib/assets/AssetManager';
|
||||||
import useApiError from '../useApiError';
|
import useApiError from '../../hooks/useApiError';
|
||||||
import TagManager from '../../tag_manager';
|
import TagManager from '../../lib/assets/TagManager';
|
||||||
import { useManagementModals } from '../../app/useManagementModals';
|
import { useManagementModals } from '../../app/useManagementModals';
|
||||||
import { useAppDispatch, useAppState } from '../../app/appState';
|
import { useAppDispatch, useAppState } from '../../lib/store/appState';
|
||||||
import { fetchAsset } from '../../lib/apiClient';
|
import { fetchAsset } from '../../lib/api/apiClient';
|
||||||
import { useApi } from '../../app/ApiContext';
|
import { useApi } from '../../lib/context/ApiContext';
|
||||||
import { useWorkspaceSelection } from '../../app/useWorkspaceSelection';
|
import { useWorkspaceSelection } from '../../app/useWorkspaceSelection';
|
||||||
import { useEntryPointer as useEntryPointerCore } from '../../documents/useEntryPointer';
|
import { useEntryPointer as useEntryPointerCore } from '../features/selection/useEntryPointer';
|
||||||
import { isTagTransferEvent } from '../../documents/tagTransfer';
|
import { isTagTransferEvent } from '../features/tagging/tagTransfer';
|
||||||
import useDocumentsSelection from '../../documents/hooks/useDocumentsSelection';
|
import useDocumentsSelection from '../features/selection/useDocumentsSelection';
|
||||||
import useBulkDocumentActions from '../../documents/hooks/useBulkDocumentActions';
|
import useBulkDocumentActions from './useBulkDocumentActions';
|
||||||
import useDocumentsPanelProps from '../../documents/hooks/useDocumentsPanelProps';
|
import useDocumentsPanelProps from '../logic/useDocumentsPanelProps';
|
||||||
import useDocumentPreview from '../../app/useDocumentPreview';
|
import useDocumentPreview from '../../app/useDocumentPreview';
|
||||||
import useSidebarProps from '../../sidebar/useSidebarProps';
|
import useSidebarProps from '../../sidebar/useSidebarProps';
|
||||||
import {
|
import {
|
||||||
@@ -36,21 +36,21 @@ import {
|
|||||||
} from '../../app/workspaceUtils';
|
} from '../../app/workspaceUtils';
|
||||||
import { createDocumentEntryKey, createFolderEntryKey } from '../../app/entryKey';
|
import { createDocumentEntryKey, createFolderEntryKey } from '../../app/entryKey';
|
||||||
import useDocumentsSearch from '../../app/useDocumentsSearch';
|
import useDocumentsSearch from '../../app/useDocumentsSearch';
|
||||||
import { useStatusToast, type ToastVariant } from '../../contexts/StatusToastContext';
|
import { useStatusToast, type ToastVariant } from '../../lib/context/StatusToastContext';
|
||||||
import useAuthManager from './useAuthManager';
|
import useAuthManager from './useAuthManager';
|
||||||
import useTenantManager from './useTenantManager';
|
import useTenantManager from './useTenantManager';
|
||||||
import useDocuments from './useDocuments';
|
import useDocuments from './useDocuments';
|
||||||
import { fetchDocument } from '../../lib/apiClient';
|
import { fetchDocument } from '../../lib/api/apiClient';
|
||||||
import useFolderTree from './useFolderTree';
|
import useFolderTree from '../features/folders/useFolderTree';
|
||||||
import useFolderTreeActions from './useFolderTreeActions';
|
import useFolderTreeActions from '../features/folders/useFolderTreeActions';
|
||||||
import useDocumentTagging from './useDocumentTagging';
|
import useDocumentTagging from '../features/tagging/useDocumentTagging';
|
||||||
import useDocumentUploads from './useDocumentUploads';
|
import useDocumentUploads from '../features/upload/useDocumentUploads';
|
||||||
import useDocumentDragHandlers from './useDocumentDragHandlers';
|
import useDocumentDragHandlers from '../features/upload/useDocumentDragHandlers';
|
||||||
import useDocumentMutations from './useDocumentMutations';
|
import useDocumentMutations from './useDocumentMutations';
|
||||||
import useDetailWorkspace from '../../detail/useDetailWorkspace';
|
import useDetailWorkspace from '../../detail/useDetailWorkspace';
|
||||||
import useWorkspaceTaxonomies from './useWorkspaceTaxonomies';
|
import useWorkspaceTaxonomies from './useWorkspaceTaxonomies';
|
||||||
import useWorkspaceBreadcrumbs from './useWorkspaceBreadcrumbs';
|
import useWorkspaceBreadcrumbs from '../logic/useWorkspaceBreadcrumbs';
|
||||||
import useWorkspaceSelectionSync from './useWorkspaceSelectionSync';
|
import useWorkspaceSelectionSync from '../features/selection/useWorkspaceSelectionSync';
|
||||||
import type { DocumentId, FolderId as FolderIdentifier, Identifier } from '../../types/identifiers';
|
import type { DocumentId, FolderId as FolderIdentifier, Identifier } from '../../types/identifiers';
|
||||||
|
|
||||||
const EntryType = Object.freeze({
|
const EntryType = Object.freeze({
|
||||||
@@ -2,7 +2,7 @@ import { MutableRefObject, useCallback, useState } from 'react';
|
|||||||
import type { TagId, TenantId } from '../../types/identifiers';
|
import type { TagId, TenantId } from '../../types/identifiers';
|
||||||
import type { Tag } from '../../types/documents';
|
import type { Tag } from '../../types/documents';
|
||||||
|
|
||||||
import { listTags, updateTag, createTag, deleteTag } from '../../lib/apiClient';
|
import { listTags, updateTag, createTag, deleteTag } from '../../lib/api/apiClient';
|
||||||
|
|
||||||
interface TagManagerInterface {
|
interface TagManagerInterface {
|
||||||
buildPayload: (input: { label?: string; color?: string | null }) => { label: string; color: string | null };
|
buildPayload: (input: { label?: string; color?: string | null }) => { label: string; color: string | null };
|
||||||
+1
-1
@@ -2,7 +2,7 @@ import { MutableRefObject, useCallback } from 'react';
|
|||||||
import type { NavigateFunction } from 'react-router-dom';
|
import type { NavigateFunction } from 'react-router-dom';
|
||||||
import type { FolderId, TenantId } from '../../types/identifiers';
|
import type { FolderId, TenantId } from '../../types/identifiers';
|
||||||
|
|
||||||
import { api, listTenants, switchTenant } from '../../lib/apiClient';
|
import { api, listTenants, switchTenant } from '../../lib/api/apiClient';
|
||||||
|
|
||||||
interface TenantOption {
|
interface TenantOption {
|
||||||
id?: TenantId;
|
id?: TenantId;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useMemo } from 'react';
|
import { useEffect, useMemo } from 'react';
|
||||||
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
||||||
import usePasskeys from '../../settings/usePasskeys';
|
import usePasskeys from '../../settings/usePasskeys';
|
||||||
import TagManager from '../../tag_manager';
|
import TagManager from '../../lib/assets/TagManager';
|
||||||
import useCorrespondents from './useCorrespondents';
|
import useCorrespondents from './useCorrespondents';
|
||||||
import useDocumentCorrespondentActions from './useDocumentCorrespondentActions';
|
import useDocumentCorrespondentActions from './useDocumentCorrespondentActions';
|
||||||
import useTags from './useTags';
|
import useTags from './useTags';
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import React, { type DragEvent } from 'react';
|
import React, { type DragEvent } from 'react';
|
||||||
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
import type { DocumentsViewProps } from '../../panel/DocumentsPanel';
|
||||||
import type { DocumentViewLogic } from './useDocumentViewLogic';
|
import type { DocumentViewLogic } from '../../logic/useDocumentViewLogic';
|
||||||
|
|
||||||
interface UseFolderItemLogicProps extends DocumentsViewProps {
|
interface UseFolderItemLogicProps extends DocumentsViewProps {
|
||||||
folder: any;
|
folder: any;
|
||||||
+5
-5
@@ -1,16 +1,16 @@
|
|||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { getFolderTree, listFolderContents } from '../../lib/apiClient';
|
import { getFolderTree, listFolderContents } from '../../../lib/api/apiClient';
|
||||||
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
||||||
import { createRootNode, DEFAULT_FOLDER_NAME } from '../../app/workspaceUtils';
|
import { createRootNode, DEFAULT_FOLDER_NAME } from '../../../app/workspaceUtils';
|
||||||
import {
|
import {
|
||||||
getEntryId,
|
getEntryId,
|
||||||
isDocumentEntry,
|
isDocumentEntry,
|
||||||
isFolderEntry,
|
isFolderEntry,
|
||||||
createDocumentEntryKey,
|
createDocumentEntryKey,
|
||||||
createFolderEntryKey,
|
createFolderEntryKey,
|
||||||
} from '../../app/entryKey';
|
} from '../../../app/entryKey';
|
||||||
import type { FolderId as FolderIdentifier, Identifier } from '../../types/identifiers';
|
import type { FolderId as FolderIdentifier, Identifier } from '../../../types/identifiers';
|
||||||
import type { Document } from '../../types/documents';
|
import type { Document } from '../../../types/documents';
|
||||||
|
|
||||||
type FolderId = FolderIdentifier | 'root';
|
type FolderId = FolderIdentifier | 'root';
|
||||||
|
|
||||||
+4
-4
@@ -1,14 +1,14 @@
|
|||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
import type { DragEvent } from 'react';
|
import type { DragEvent } from 'react';
|
||||||
import { DEFAULT_FOLDER_NAME, hasFiles } from '../../app/workspaceUtils';
|
import { DEFAULT_FOLDER_NAME, hasFiles } from '../../../app/workspaceUtils';
|
||||||
import {
|
import {
|
||||||
createFolder,
|
createFolder,
|
||||||
deleteFolder,
|
deleteFolder,
|
||||||
moveFolder as moveFolderRequest,
|
moveFolder as moveFolderRequest,
|
||||||
renameFolder as renameFolderRequest,
|
renameFolder as renameFolderRequest,
|
||||||
} from '../../lib/apiClient';
|
} from '../../../lib/api/apiClient';
|
||||||
import type { FolderId } from '../../types/identifiers';
|
import type { FolderId } from '../../../types/identifiers';
|
||||||
import type { MessageOptions } from '../../types/documents';
|
import type { MessageOptions } from '../../../types/documents';
|
||||||
|
|
||||||
type FolderKey = FolderId | 'root';
|
type FolderKey = FolderId | 'root';
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import React, { CSSProperties, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import React, { CSSProperties, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import useFloatingMenu from '../ui/useFloatingMenu';
|
import useFloatingMenu from '../../../components/useFloatingMenu';
|
||||||
import { CheckIcon, CircleDashedCheckIcon, PlusIcon } from '../ui/icons';
|
import { CheckIcon, CircleDashedCheckIcon, PlusIcon } from '../../../components/icons';
|
||||||
|
|
||||||
type AssignmentState = 'all' | 'partial' | 'none';
|
type AssignmentState = 'all' | 'partial' | 'none';
|
||||||
|
|
||||||
+8
-8
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { DEFAULT_FOLDER_NAME } from '../constants/workspace';
|
import { DEFAULT_FOLDER_NAME } from '../../../constants/workspace';
|
||||||
import { getFolderTree } from '../lib/apiClient';
|
import { getFolderTree } from '../../../lib/api/apiClient';
|
||||||
import {
|
import {
|
||||||
TrashIcon,
|
TrashIcon,
|
||||||
AnalyzeIcon,
|
AnalyzeIcon,
|
||||||
@@ -8,14 +8,14 @@ import {
|
|||||||
FolderOutlineIcon,
|
FolderOutlineIcon,
|
||||||
TagIcon,
|
TagIcon,
|
||||||
CorrespondentIcon,
|
CorrespondentIcon,
|
||||||
} from '../ui/icons';
|
} from '../../../components/icons';
|
||||||
import SelectionAssignmentMenu, { SelectionAssignmentMenuItem } from './SelectionAssignmentMenu';
|
import SelectionAssignmentMenu, { SelectionAssignmentMenuItem } from './SelectionAssignmentMenu';
|
||||||
import SelectionFolderMenu from './SelectionFolderMenu';
|
import SelectionFolderMenu from './SelectionFolderMenu';
|
||||||
import SelectionSummary from './SelectionSummary';
|
import SelectionSummary from './SelectionSummary';
|
||||||
import { useAppState } from '../app/appState';
|
import { useAppState } from '../../../lib/store/appState';
|
||||||
import { useWorkspaceSelectionContext } from '../app/WorkspaceSelectionContext';
|
import { useWorkspaceSelectionContext } from '../../../app/WorkspaceSelectionContext';
|
||||||
import type { DocumentId } from '../types/identifiers';
|
import type { DocumentId } from '../../../types/identifiers';
|
||||||
import type { FolderTreeNode } from '../lib/apiTypes';
|
import type { FolderTreeNode } from '../../../lib/api/apiTypes';
|
||||||
|
|
||||||
type NullableDocumentId = DocumentId | null;
|
type NullableDocumentId = DocumentId | null;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ interface CorrespondentOption {
|
|||||||
label?: string;
|
label?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
import type { Document } from '../types/documents';
|
import type { Document } from '../../../types/documents';
|
||||||
|
|
||||||
interface BulkTagMutationArgs {
|
interface BulkTagMutationArgs {
|
||||||
label: string;
|
label: string;
|
||||||
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
import React, { CSSProperties, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import React, { CSSProperties, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import useFloatingMenu from '../ui/useFloatingMenu';
|
import useFloatingMenu from '../../../components/useFloatingMenu';
|
||||||
import {
|
import {
|
||||||
ArrowLeftIcon,
|
ArrowLeftIcon,
|
||||||
FolderIcon,
|
FolderIcon,
|
||||||
FolderMoveIcon,
|
FolderMoveIcon,
|
||||||
} from '../ui/icons';
|
} from '../../../components/icons';
|
||||||
import type { FolderTreeNode } from '../lib/apiTypes';
|
import type { FolderTreeNode } from '../../../lib/api/apiTypes';
|
||||||
import type { DocumentId } from '../types/identifiers';
|
import type { DocumentId } from '../../../types/identifiers';
|
||||||
|
|
||||||
interface SelectionFolderMenuProps {
|
interface SelectionFolderMenuProps {
|
||||||
label: React.ReactNode;
|
label: React.ReactNode;
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FileIcon, FolderOutlineIcon } from '../ui/icons';
|
import { FileIcon, FolderOutlineIcon } from '../../../components/icons';
|
||||||
|
|
||||||
interface SelectionSummaryProps {
|
interface SelectionSummaryProps {
|
||||||
documentCount?: number;
|
documentCount?: number;
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
import type { Dispatch, SetStateAction } from 'react';
|
import type { Dispatch, SetStateAction } from 'react';
|
||||||
import { createDocumentEntryKey, createFolderEntryKey, isFolderEntry } from '../../app/entryKey';
|
import { createDocumentEntryKey, createFolderEntryKey, isFolderEntry } from '../../../app/entryKey';
|
||||||
import type { DocumentId, FolderId } from '../../types/identifiers';
|
import type { DocumentId, FolderId } from '../../../types/identifiers';
|
||||||
|
|
||||||
interface FolderEntry {
|
interface FolderEntry {
|
||||||
id: FolderId;
|
id: FolderId;
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { createDocumentEntryKey, createFolderEntryKey } from '../app/entryKey';
|
import { createDocumentEntryKey, createFolderEntryKey } from '../../../app/entryKey';
|
||||||
|
|
||||||
type PointerEventLike = MouseEvent | PointerEvent;
|
type PointerEventLike = MouseEvent | PointerEvent;
|
||||||
|
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import type { MutableRefObject } from 'react';
|
import type { MutableRefObject } from 'react';
|
||||||
import type { Identifier } from '../../types/identifiers';
|
import type { Identifier } from '../../../types/identifiers';
|
||||||
|
|
||||||
interface UseWorkspaceSelectionSyncArgs {
|
interface UseWorkspaceSelectionSyncArgs {
|
||||||
showingSearchResults: boolean;
|
showingSearchResults: boolean;
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import type { DocumentId, TagId } from '../types/identifiers';
|
import type { DocumentId, TagId } from '../../../types/identifiers';
|
||||||
import { TAG_MIME_TYPES, TAG_TEXT_MIME_TYPE } from '../constants/documents';
|
import { TAG_MIME_TYPES, TAG_TEXT_MIME_TYPE } from '../../../constants/documents';
|
||||||
|
|
||||||
interface TagPayload {
|
interface TagPayload {
|
||||||
id: TagId;
|
id: TagId;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import type { Identifier } from '../../types/identifiers';
|
import type { Identifier } from '../../../types/identifiers';
|
||||||
|
|
||||||
interface TagRecord {
|
interface TagRecord {
|
||||||
id?: Identifier;
|
id?: Identifier;
|
||||||
@@ -8,7 +8,7 @@ interface TagRecord {
|
|||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
import { createTag, bulkTagDocuments, bulkReanalyzeDocuments } from '../../lib/apiClient';
|
import { createTag, bulkTagDocuments, bulkReanalyzeDocuments } from '../../../lib/api/apiClient';
|
||||||
|
|
||||||
interface TagManager {
|
interface TagManager {
|
||||||
buildPayload: (input: { label: string }) => Record<string, unknown>;
|
buildPayload: (input: { label: string }) => Record<string, unknown>;
|
||||||
+3
-3
@@ -1,12 +1,12 @@
|
|||||||
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
import type { DragEvent } from 'react';
|
import type { DragEvent } from 'react';
|
||||||
import { createDocumentEntryKey, createFolderEntryKey } from '../../app/entryKey';
|
import { createDocumentEntryKey, createFolderEntryKey } from '../../../app/entryKey';
|
||||||
import type { FolderId, Identifier } from '../../types/identifiers';
|
import type { FolderId, Identifier } from '../../../types/identifiers';
|
||||||
|
|
||||||
type FolderIdentifier = FolderId | 'root';
|
type FolderIdentifier = FolderId | 'root';
|
||||||
type FolderInput = FolderIdentifier | number;
|
type FolderInput = FolderIdentifier | number;
|
||||||
|
|
||||||
import type { Document } from '../../types/documents';
|
import type { Document } from '../../../types/documents';
|
||||||
|
|
||||||
type ApplySelectionFn = (
|
type ApplySelectionFn = (
|
||||||
keys: string[],
|
keys: string[],
|
||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
import { useCallback, useRef, useState } from 'react';
|
import { useCallback, useRef, useState } from 'react';
|
||||||
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
||||||
import useFileDrop from './useFileDrop';
|
import useFileDrop from './useFileDrop';
|
||||||
import { DEFAULT_FOLDER_NAME, hasFiles } from '../../app/workspaceUtils';
|
import { DEFAULT_FOLDER_NAME, hasFiles } from '../../../app/workspaceUtils';
|
||||||
import { fetchDocument, uploadDocument, resolveFolderPath } from '../../lib/apiClient';
|
import { fetchDocument, uploadDocument, resolveFolderPath } from '../../../lib/api/apiClient';
|
||||||
import type { Identifier } from '../../types/identifiers';
|
import type { Identifier } from '../../../types/identifiers';
|
||||||
|
|
||||||
type FolderId = Identifier | 'root' | null;
|
type FolderId = Identifier | 'root' | null;
|
||||||
|
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import React, { type DragEvent } from 'react';
|
import React, { type DragEvent } from 'react';
|
||||||
import { parseTagTransferPayload } from '../tagTransfer';
|
import { parseTagTransferPayload } from '../features/tagging/tagTransfer';
|
||||||
import { createDocumentEntryKey } from '../../app/entryKey';
|
import { createDocumentEntryKey } from '../../app/entryKey';
|
||||||
import { useDocumentOpen } from '../../contexts/DocumentOpenContext';
|
import { useDocumentOpen } from '../../lib/context/DocumentOpenContext';
|
||||||
import type { Document } from '../../types/documents';
|
import type { Document } from '../../types/documents';
|
||||||
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
import type { DocumentsViewProps } from '../panel/DocumentsPanel';
|
||||||
import type { DocumentViewLogic } from './useDocumentViewLogic';
|
import type { DocumentViewLogic } from './useDocumentViewLogic';
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { useWorkspaceSelectionContext } from '../../app/WorkspaceSelectionContext';
|
import { useWorkspaceSelectionContext } from '../../app/WorkspaceSelectionContext';
|
||||||
import useInlineRename from '../useInlineRename';
|
import useInlineRename from '../features/renaming/useInlineRename';
|
||||||
import type { Document, Folder } from '../../types/documents';
|
import type { Document, Folder } from '../../types/documents';
|
||||||
|
|
||||||
interface UseDocumentViewLogicProps {
|
interface UseDocumentViewLogicProps {
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import React, { useCallback, useMemo } from 'react';
|
import React, { useCallback, useMemo } from 'react';
|
||||||
import type { DocumentsListEntry } from '../../types/documents';
|
import type { DocumentsListEntry } from '../../types/documents';
|
||||||
import { useWorkspaceSelectionContext } from '../../app/WorkspaceSelectionContext';
|
import { useWorkspaceSelectionContext } from '../../app/WorkspaceSelectionContext';
|
||||||
import { useDocumentOpen } from '../../contexts/DocumentOpenContext';
|
import { useDocumentOpen } from '../../lib/context/DocumentOpenContext';
|
||||||
|
|
||||||
interface UseDocumentsNavigationProps {
|
interface UseDocumentsNavigationProps {
|
||||||
entries: DocumentsListEntry[];
|
entries: DocumentsListEntry[];
|
||||||
@@ -13,9 +13,9 @@ import type {
|
|||||||
Document,
|
Document,
|
||||||
DocumentTag,
|
DocumentTag,
|
||||||
} from '../../types/documents';
|
} from '../../types/documents';
|
||||||
import DesktopWorkspace from '../../desktop/DesktopWorkspace';
|
import DesktopWorkspace from '../../desktop/components/DesktopWorkspace';
|
||||||
import { isTagTransferEvent } from '../tagTransfer';
|
import { isTagTransferEvent } from '../features/tagging/tagTransfer';
|
||||||
import { isPointerModifierEvent, isPrimaryPointerEvent } from '../useEntryPointer';
|
import { isPointerModifierEvent, isPrimaryPointerEvent } from '../features/selection/useEntryPointer';
|
||||||
import {
|
import {
|
||||||
WorkspaceSelectionProvider,
|
WorkspaceSelectionProvider,
|
||||||
useWorkspaceSelectionContext,
|
useWorkspaceSelectionContext,
|
||||||
@@ -25,7 +25,7 @@ import DocumentsPanelHeader, {
|
|||||||
DocumentsPanelHeaderConfig,
|
DocumentsPanelHeaderConfig,
|
||||||
DocumentsHeaderBreadcrumb,
|
DocumentsHeaderBreadcrumb,
|
||||||
} from './DocumentsPanelHeader';
|
} from './DocumentsPanelHeader';
|
||||||
import { SelectionFloatingPanel } from '../SelectionFloatingActions';
|
import { SelectionFloatingPanel } from '../features/selection/SelectionFloatingActions';
|
||||||
import { createDocumentsTableHeaderActions } from './DocumentsToolbar';
|
import { createDocumentsTableHeaderActions } from './DocumentsToolbar';
|
||||||
import { useDocumentsFilter } from '../context/DocumentsFilterContext';
|
import { useDocumentsFilter } from '../context/DocumentsFilterContext';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import PanelHeader from '../../ui/PanelHeader';
|
import PanelHeader from '../../components/PanelHeader';
|
||||||
import BreadcrumbTrail from '../../ui/BreadcrumbTrail';
|
import BreadcrumbTrail from '../../components/BreadcrumbTrail';
|
||||||
import type { Identifier } from '../../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
|
|
||||||
export interface DocumentsHeaderBreadcrumb {
|
export interface DocumentsHeaderBreadcrumb {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
FoldersOffIcon,
|
FoldersOffIcon,
|
||||||
SortAscendingLettersIcon,
|
SortAscendingLettersIcon,
|
||||||
SortDescendingLettersIcon,
|
SortDescendingLettersIcon,
|
||||||
} from '../../ui/icons';
|
} from '../../components/icons';
|
||||||
import SortFieldQuickMenu from './SortFieldQuickMenu';
|
import SortFieldQuickMenu from './SortFieldQuickMenu';
|
||||||
|
|
||||||
type ViewMode = 'list' | 'grid' | 'desk' | (string & {});
|
type ViewMode = 'list' | 'grid' | 'desk' | (string & {});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useMemo } from 'react';
|
import React, { useCallback, useMemo } from 'react';
|
||||||
import { SORT_LABEL_LOOKUP, SORT_OPTIONS } from '../../constants/documents';
|
import { SORT_LABEL_LOOKUP, SORT_OPTIONS } from '../../constants/documents';
|
||||||
import QuickAddMenu from '../../ui/QuickAddMenu';
|
import QuickAddMenu from '../../components/QuickAddMenu';
|
||||||
|
|
||||||
interface SortFieldQuickMenuProps {
|
interface SortFieldQuickMenuProps {
|
||||||
sortField: string;
|
sortField: string;
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ import DocumentsRoute from './app/DocumentsRoute';
|
|||||||
import DropOverlay from './app/DropOverlay';
|
import DropOverlay from './app/DropOverlay';
|
||||||
import LoginRoute from './app/LoginRoute';
|
import LoginRoute from './app/LoginRoute';
|
||||||
import SettingsRoute from './app/SettingsRoute';
|
import SettingsRoute from './app/SettingsRoute';
|
||||||
import { AppStateProvider } from './app/appState';
|
import { AppStateProvider } from './lib/store/appState';
|
||||||
import { useDocumentsPreferences } from './app/useDocumentsPreferences';
|
import { useDocumentsPreferences } from './app/useDocumentsPreferences';
|
||||||
import { AppShellContext } from './appShellContext';
|
import { AppShellContext } from './lib/context/AppShellContext';
|
||||||
import useDocumentsWorkspace from './hooks/documents/useDocumentsWorkspace';
|
import useDocumentsWorkspace from './documents/data/useDocumentsWorkspace';
|
||||||
import UploadQueueOverlay from './app/UploadQueueOverlay';
|
import UploadQueueOverlay from './app/UploadQueueOverlay';
|
||||||
import { StatusToastProvider } from './contexts/StatusToastContext';
|
import { StatusToastProvider } from './lib/context/StatusToastContext';
|
||||||
import StatusToastOverlay from './components/StatusToastOverlay';
|
import StatusToastOverlay from './components/StatusToastOverlay';
|
||||||
|
|
||||||
const AppLayout: React.FC = () => {
|
const AppLayout: React.FC = () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Types aligned with OpenAPI schemas for common endpoints.
|
// Types aligned with OpenAPI schemas for common endpoints.
|
||||||
import type { Identifier } from '../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
|
|
||||||
export type { Identifier };
|
export type { Identifier };
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { Identifier } from './types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
import type { Asset } from './types/assets';
|
import type { Asset } from '../../types/assets';
|
||||||
import type { DocumentVersion, Document } from './types/documents';
|
import type { DocumentVersion, Document } from '../../types/documents';
|
||||||
|
|
||||||
type Nullable<T> = T | null;
|
type Nullable<T> = T | null;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { generateRandomTagColor } from './utils/colors';
|
import { generateRandomTagColor } from '../../utils/colors';
|
||||||
|
|
||||||
type ColorGenerator = () => string;
|
type ColorGenerator = () => string;
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useMemo } from 'react';
|
import React, { useEffect, useMemo } from 'react';
|
||||||
import type { PropsWithChildren } from 'react';
|
import type { PropsWithChildren } from 'react';
|
||||||
import { httpClient, setAuthToken, clearAuthToken } from '../lib/apiClient';
|
import { httpClient, setAuthToken, clearAuthToken } from '../api/apiClient';
|
||||||
import { createSafeContext } from '../utils/createSafeContext';
|
import { createSafeContext } from '../../utils/createSafeContext';
|
||||||
|
|
||||||
type HttpClient = typeof httpClient;
|
type HttpClient = typeof httpClient;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { createSafeContext } from './utils/createSafeContext';
|
import { createSafeContext } from '../../utils/createSafeContext';
|
||||||
|
|
||||||
type AppShellContextValue = Record<string, unknown>;
|
type AppShellContextValue = Record<string, unknown>;
|
||||||
|
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import type { Document } from '../types/documents';
|
import type { Document } from '../../types/documents';
|
||||||
import type { Identifier } from '../types/identifiers';
|
import type { Identifier } from '../../types/identifiers';
|
||||||
import { createSafeContext } from '../utils/createSafeContext';
|
import { createSafeContext } from '../../utils/createSafeContext';
|
||||||
|
|
||||||
type DocumentOpenTarget = 'preview' | 'sidepanel' | 'viewer';
|
type DocumentOpenTarget = 'preview' | 'sidepanel' | 'viewer';
|
||||||
|
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useCallback, useEffect, useRef } from 'react';
|
import React, { useState, useCallback, useEffect, useRef } from 'react';
|
||||||
import { createSafeContext } from '../utils/createSafeContext';
|
import { createSafeContext } from '../../utils/createSafeContext';
|
||||||
|
|
||||||
export type ToastVariant = 'info' | 'success' | 'error';
|
export type ToastVariant = 'info' | 'success' | 'error';
|
||||||
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { useEffect, useMemo, useReducer } from 'react';
|
import React, { useEffect, useMemo, useReducer } from 'react';
|
||||||
import { createSafeContext } from '../utils/createSafeContext';
|
import { createSafeContext } from '../../utils/createSafeContext';
|
||||||
import { clearAuthToken, setAuthToken, setAuthRefreshHandlers } from '../lib/apiClient';
|
import { clearAuthToken, setAuthToken, setAuthRefreshHandlers } from '../api/apiClient';
|
||||||
import { ApiProvider } from './ApiContext';
|
import { ApiProvider } from '../context/ApiContext';
|
||||||
import { listTenants } from '../lib/apiClient';
|
import { listTenants } from '../api/apiClient';
|
||||||
import { STORED_TOKEN_KEY } from '../constants/app';
|
import { STORED_TOKEN_KEY } from '../../constants/app';
|
||||||
|
|
||||||
type Tenant = Record<string, unknown> | null;
|
type Tenant = Record<string, unknown> | null;
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
CloseIcon,
|
CloseIcon,
|
||||||
IconZoomInArea,
|
IconZoomInArea,
|
||||||
WindowMaximizeIcon,
|
WindowMaximizeIcon,
|
||||||
} from '../ui/icons';
|
} from '../components/icons';
|
||||||
import {
|
import {
|
||||||
buildCorrespondentOptions,
|
buildCorrespondentOptions,
|
||||||
sortCorrespondents,
|
sortCorrespondents,
|
||||||
@@ -19,9 +19,9 @@ import { usePreviewContext } from '../preview/PreviewContext';
|
|||||||
import type { DocumentSummarySectionProps } from '../documents/DocumentSummarySection';
|
import type { DocumentSummarySectionProps } from '../documents/DocumentSummarySection';
|
||||||
import { extractDocumentMetadataPayload } from '../documents/documentSummary';
|
import { extractDocumentMetadataPayload } from '../documents/documentSummary';
|
||||||
import { createDocumentActionState } from '../documents/documentActions';
|
import { createDocumentActionState } from '../documents/documentActions';
|
||||||
import { resolveDocumentAssetUrl } from '../asset_manager';
|
import { resolveDocumentAssetUrl } from '../lib/assets/AssetManager';
|
||||||
import PanelHeader from '../ui/PanelHeader';
|
import PanelHeader from '../components/PanelHeader';
|
||||||
import BreadcrumbTrail from '../ui/BreadcrumbTrail';
|
import BreadcrumbTrail from '../components/BreadcrumbTrail';
|
||||||
import DocumentViewerLayout from './DocumentViewerLayout';
|
import DocumentViewerLayout from './DocumentViewerLayout';
|
||||||
import { useViewerLayoutMode } from './useViewerLayoutMode';
|
import { useViewerLayoutMode } from './useViewerLayoutMode';
|
||||||
import { usePanelResizeBindings } from '../app/PanelManagerContext';
|
import { usePanelResizeBindings } from '../app/PanelManagerContext';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { DownloadIcon } from '../ui/icons';
|
import { DownloadIcon } from '../components/icons';
|
||||||
import { AUDIO_EXTENSIONS, VIDEO_EXTENSIONS } from '../constants/preview';
|
import { AUDIO_EXTENSIONS, VIDEO_EXTENSIONS } from '../constants/preview';
|
||||||
|
|
||||||
interface MediaViewerProps {
|
interface MediaViewerProps {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import React, {
|
|||||||
useMemo,
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import PanelHeader from '../ui/PanelHeader';
|
import PanelHeader from '../components/PanelHeader';
|
||||||
import { CloseIcon } from '../ui/icons';
|
import { CloseIcon } from '../components/icons';
|
||||||
import { DEFAULT_SETTINGS_SECTIONS } from '../constants/settings';
|
import { DEFAULT_SETTINGS_SECTIONS } from '../constants/settings';
|
||||||
|
|
||||||
export interface SettingsSectionConfig {
|
export interface SettingsSectionConfig {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import type { JSX } from 'react';
|
import type { JSX } from 'react';
|
||||||
import { CheckIcon, ChevronDownIcon } from '../../ui/icons';
|
import { CheckIcon, ChevronDownIcon } from '../../components/icons';
|
||||||
import type { CapabilityValue } from '../../types/identifiers';
|
import type { CapabilityValue } from '../../types/identifiers';
|
||||||
|
|
||||||
export interface CapabilityDropdownOption {
|
export interface CapabilityDropdownOption {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import React, {
|
|||||||
useMemo,
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { IconX } from '../../ui/icons';
|
import { IconX } from '../../components/icons';
|
||||||
import CapabilityDropdown, { CapabilityDropdownOption } from '../components/CapabilityDropdown';
|
import CapabilityDropdown, { CapabilityDropdownOption } from '../components/CapabilityDropdown';
|
||||||
import type { CapabilitySetId, CapabilityValue } from '../../types/identifiers';
|
import type { CapabilitySetId, CapabilityValue } from '../../types/identifiers';
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user