frontend
This commit is contained in:
Generated
+10
@@ -8,6 +8,7 @@
|
|||||||
"name": "papercrate-frontend",
|
"name": "papercrate-frontend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@fontsource/inter": "^5.2.8",
|
||||||
"@tabler/icons-react": "3.11.0",
|
"@tabler/icons-react": "3.11.0",
|
||||||
"axios": "1.7.7",
|
"axios": "1.7.7",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
@@ -1852,6 +1853,15 @@
|
|||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@fontsource/inter": {
|
||||||
|
"version": "5.2.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-5.2.8.tgz",
|
||||||
|
"integrity": "sha512-P6r5WnJoKiNVV+zvW2xM13gNdFhAEpQ9dQJHt3naLvfg+LkF2ldgSLiF4T41lf1SQCM9QmkqPTn4TH568IRagg==",
|
||||||
|
"license": "OFL-1.1",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ayuhito"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@jridgewell/gen-mapping": {
|
"node_modules/@jridgewell/gen-mapping": {
|
||||||
"version": "0.3.13",
|
"version": "0.3.13",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"lint": "echo \"No linting configured\""
|
"lint": "echo \"No linting configured\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@fontsource/inter": "^5.2.8",
|
||||||
"@tabler/icons-react": "3.11.0",
|
"@tabler/icons-react": "3.11.0",
|
||||||
"axios": "1.7.7",
|
"axios": "1.7.7",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
@@ -19,6 +20,7 @@
|
|||||||
"@babel/core": "7.26.0",
|
"@babel/core": "7.26.0",
|
||||||
"@babel/preset-env": "7.26.0",
|
"@babel/preset-env": "7.26.0",
|
||||||
"@babel/preset-react": "7.26.3",
|
"@babel/preset-react": "7.26.3",
|
||||||
|
"@svgr/webpack": "8.1.0",
|
||||||
"babel-loader": "9.2.1",
|
"babel-loader": "9.2.1",
|
||||||
"css-loader": "7.1.2",
|
"css-loader": "7.1.2",
|
||||||
"dotenv": "16.4.5",
|
"dotenv": "16.4.5",
|
||||||
@@ -26,7 +28,6 @@
|
|||||||
"style-loader": "4.0.0",
|
"style-loader": "4.0.0",
|
||||||
"webpack": "5.95.0",
|
"webpack": "5.95.0",
|
||||||
"webpack-cli": "5.1.4",
|
"webpack-cli": "5.1.4",
|
||||||
"webpack-dev-server": "5.1.0",
|
"webpack-dev-server": "5.1.0"
|
||||||
"@svgr/webpack": "8.1.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ function CorrespondentsPanel({
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="correspondents-panel column">
|
<section className="correspondents-panel">
|
||||||
<div className="column-header">
|
<div className="column-header">
|
||||||
<div className="column-header__titles">
|
<div className="column-header__titles">
|
||||||
<h2>Correspondents</h2>
|
<h2>Correspondents</h2>
|
||||||
|
|||||||
@@ -1086,7 +1086,7 @@ const DetailPanel = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<aside className="detail-panel column">
|
<aside className="detail-panel">
|
||||||
<div className="column-body scrollable">
|
<div className="column-body scrollable">
|
||||||
{selectedCount <= 1 ? renderSingle() : renderBulk()}
|
{selectedCount <= 1 ? renderSingle() : renderBulk()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
import { getAssetFromVersion, resolveDocumentAssetUrl, createAssetView } from '../asset_manager';
|
import { getAssetFromVersion, resolveDocumentAssetUrl, createAssetView } from '../asset_manager';
|
||||||
import { getTagColorStyle } from '../utils/colors';
|
import { getTagColorStyle } from '../utils/colors';
|
||||||
import { DownloadIcon, EditIcon, ViewListIcon, ViewGridIcon, FolderIcon } from '../ui/icons';
|
import { DownloadIcon, EditIcon, ViewListIcon, ViewGridIcon, FolderIcon, TrashIcon } from '../ui/icons';
|
||||||
|
|
||||||
const TAG_MIME_TYPES = ['application/x-papercrate-tag', 'text/papercrate-tag'];
|
const TAG_MIME_TYPES = ['application/x-papercrate-tag', 'text/papercrate-tag'];
|
||||||
const DEFAULT_GRID_ICON_SIZE = 96;
|
const DEFAULT_GRID_ICON_SIZE = 96;
|
||||||
@@ -263,16 +263,6 @@ const DocumentsTable = ({
|
|||||||
[isTagDragEvent, onDocumentTagDrop],
|
[isTagDragEvent, onDocumentTagDrop],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleGridBackgroundClick = useCallback(
|
|
||||||
(event) => {
|
|
||||||
if (event.target !== event.currentTarget) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
onClearSelection?.();
|
|
||||||
},
|
|
||||||
[onClearSelection],
|
|
||||||
);
|
|
||||||
|
|
||||||
const showDefaultEmptyState = !showingSearchResults && !subfolders.length && rows.length === 0;
|
const showDefaultEmptyState = !showingSearchResults && !subfolders.length && rows.length === 0;
|
||||||
const showListSearchEmptyState =
|
const showListSearchEmptyState =
|
||||||
showingSearchResults && rows.length === 0 && !isGridView && !isSearchLoading;
|
showingSearchResults && rows.length === 0 && !isGridView && !isSearchLoading;
|
||||||
@@ -376,13 +366,22 @@ const DocumentsTable = ({
|
|||||||
onDocumentListKeyDown(event);
|
onDocumentListKeyDown(event);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
onClick={(event) => {
|
||||||
|
if (event.target === event.currentTarget) {
|
||||||
|
onClearSelection?.();
|
||||||
|
}
|
||||||
|
}}
|
||||||
aria-activedescendant={isGridView ? undefined : activeDescendantId}
|
aria-activedescendant={isGridView ? undefined : activeDescendantId}
|
||||||
>
|
>
|
||||||
{showDefaultEmptyState ? null : isGridView ? (
|
{showDefaultEmptyState ? null : isGridView ? (
|
||||||
<div
|
<div
|
||||||
className="documents-grid"
|
className="documents-grid"
|
||||||
role="list"
|
role="list"
|
||||||
onClick={handleGridBackgroundClick}
|
onClick={(event) => {
|
||||||
|
if (event.target === event.currentTarget) {
|
||||||
|
onClearSelection?.();
|
||||||
|
}
|
||||||
|
}}
|
||||||
style={{ '--documents-grid-icon-size': `${gridIconSize}px` }}
|
style={{ '--documents-grid-icon-size': `${gridIconSize}px` }}
|
||||||
>
|
>
|
||||||
{!showingSearchResults &&
|
{!showingSearchResults &&
|
||||||
@@ -619,13 +618,20 @@ const DocumentsTable = ({
|
|||||||
<td className="doc-list__name">
|
<td className="doc-list__name">
|
||||||
<div className="doc-list__name-content">
|
<div className="doc-list__name-content">
|
||||||
<span>{folder.name}</span>
|
<span>{folder.name}</span>
|
||||||
{folder.id !== 'root' && (
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>Folder</td>
|
||||||
|
<td>—</td>
|
||||||
|
<td className="actions">
|
||||||
|
<div className="action-buttons">
|
||||||
|
{folder.id !== 'root' && onFolderRename && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="icon-button ghost doc-list__icon-button"
|
className="icon-button ghost"
|
||||||
|
title="Rename"
|
||||||
|
aria-label={`Rename folder ${folder.name}`}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (!onFolderRename) return;
|
|
||||||
const nextName = window.prompt('Rename folder', folder.name || '');
|
const nextName = window.prompt('Rename folder', folder.name || '');
|
||||||
if (!nextName) {
|
if (!nextName) {
|
||||||
return;
|
return;
|
||||||
@@ -636,28 +642,24 @@ const DocumentsTable = ({
|
|||||||
}
|
}
|
||||||
onFolderRename(folder.id, trimmed);
|
onFolderRename(folder.id, trimmed);
|
||||||
}}
|
}}
|
||||||
title="Rename folder"
|
|
||||||
aria-label={`Rename folder ${folder.name}`}
|
|
||||||
>
|
>
|
||||||
<EditIcon className="doc-list__icon" size={16} />
|
<EditIcon className="icon-inline" />
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="icon-button danger"
|
||||||
|
title="Delete"
|
||||||
|
aria-label={`Delete folder ${folder.name}`}
|
||||||
|
onClick={(event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
onFolderDelete(folder.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TrashIcon className="icon-inline" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>Folder</td>
|
|
||||||
<td>—</td>
|
|
||||||
<td className="actions">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="icon-button danger"
|
|
||||||
onClick={(event) => {
|
|
||||||
event.stopPropagation();
|
|
||||||
onFolderDelete(folder.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Delete
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -696,30 +698,6 @@ const DocumentsTable = ({
|
|||||||
<div className="doc-name">
|
<div className="doc-name">
|
||||||
<div className="doc-list__name-content">
|
<div className="doc-list__name-content">
|
||||||
<span className="doc-name__title">{doc.title || doc.original_name}</span>
|
<span className="doc-name__title">{doc.title || doc.original_name}</span>
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="icon-button ghost doc-list__icon-button"
|
|
||||||
onClick={(event) => {
|
|
||||||
event.stopPropagation();
|
|
||||||
if (!onDocumentRename) return;
|
|
||||||
const nextName = window.prompt(
|
|
||||||
'Rename document',
|
|
||||||
doc.title || doc.original_name || '',
|
|
||||||
);
|
|
||||||
if (!nextName) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const trimmed = nextName.trim();
|
|
||||||
if (!trimmed || trimmed === (doc.title || doc.original_name)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
onDocumentRename(doc.id, trimmed);
|
|
||||||
}}
|
|
||||||
title="Rename document"
|
|
||||||
aria-label={`Rename document ${doc.title || doc.original_name}`}
|
|
||||||
>
|
|
||||||
<EditIcon className="doc-list__icon" size={16} />
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
{(doc.tags || []).length > 0 && (
|
{(doc.tags || []).length > 0 && (
|
||||||
<div className="doc-name__tags">
|
<div className="doc-name__tags">
|
||||||
@@ -788,31 +766,59 @@ const DocumentsTable = ({
|
|||||||
</td>
|
</td>
|
||||||
<td className="actions">
|
<td className="actions">
|
||||||
<div className="action-buttons">
|
<div className="action-buttons">
|
||||||
|
{onDocumentRename && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="icon-button ghost"
|
||||||
|
title="Rename"
|
||||||
|
aria-label={`Rename document ${doc.title || doc.original_name}`}
|
||||||
|
onClick={(event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
const nextName = window.prompt(
|
||||||
|
'Rename document',
|
||||||
|
doc.title || doc.original_name || '',
|
||||||
|
);
|
||||||
|
if (!nextName) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const trimmed = nextName.trim();
|
||||||
|
if (!trimmed || trimmed === (doc.title || doc.original_name)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
onDocumentRename(doc.id, trimmed);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<EditIcon className="icon-inline" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
{downloadHref ? (
|
{downloadHref ? (
|
||||||
<a
|
<a
|
||||||
className="button-link with-icon"
|
className="icon-button"
|
||||||
href={downloadHref}
|
href={downloadHref}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
|
title="Download"
|
||||||
|
aria-label="Download document"
|
||||||
onClick={(event) => event.stopPropagation()}
|
onClick={(event) => event.stopPropagation()}
|
||||||
onAuxClick={(event) => event.stopPropagation()}
|
onAuxClick={(event) => event.stopPropagation()}
|
||||||
onContextMenu={(event) => event.stopPropagation()}
|
onContextMenu={(event) => event.stopPropagation()}
|
||||||
>
|
>
|
||||||
<DownloadIcon className="icon-inline" />
|
<DownloadIcon className="icon-inline" />
|
||||||
<span>Download</span>
|
|
||||||
</a>
|
</a>
|
||||||
) : (
|
) : (
|
||||||
<span className="meta">No download</span>
|
<span className="meta">No download</span>
|
||||||
)}
|
)}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="danger"
|
className="icon-button danger"
|
||||||
|
title="Delete"
|
||||||
|
aria-label="Delete document"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
onDocumentDelete?.(doc.id);
|
onDocumentDelete?.(doc.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Delete
|
<TrashIcon className="icon-inline" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
+6
-15
@@ -1,3 +1,5 @@
|
|||||||
|
import '@fontsource/inter/400.css';
|
||||||
|
|
||||||
import React, {
|
import React, {
|
||||||
useCallback,
|
useCallback,
|
||||||
useContext,
|
useContext,
|
||||||
@@ -368,15 +370,11 @@ const AppLayout = () => {
|
|||||||
const stored = window.localStorage.getItem('papercrate_view_mode');
|
const stored = window.localStorage.getItem('papercrate_view_mode');
|
||||||
return stored === 'grid' ? 'grid' : 'list';
|
return stored === 'grid' ? 'grid' : 'list';
|
||||||
});
|
});
|
||||||
const initialRowSelection = routeDocumentId
|
const initialRowSelection = [];
|
||||||
? [resolveDocumentRowKey(routeDocumentId)]
|
|
||||||
: [];
|
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState(initialRowSelection);
|
const [selectedRowKeys, setSelectedRowKeys] = useState(initialRowSelection);
|
||||||
const [selectionOrder, setSelectionOrder] = useState(initialRowSelection);
|
const [selectionOrder, setSelectionOrder] = useState(initialRowSelection);
|
||||||
const [focusedDocumentId, setFocusedDocumentId] = useState(routeDocumentId);
|
const [focusedDocumentId, setFocusedDocumentId] = useState(null);
|
||||||
const [focusedRowKey, setFocusedRowKey] = useState(() =>
|
const [focusedRowKey, setFocusedRowKey] = useState(null);
|
||||||
routeDocumentId ? resolveDocumentRowKey(routeDocumentId) : null,
|
|
||||||
);
|
|
||||||
const tokenRef = useRef(token);
|
const tokenRef = useRef(token);
|
||||||
const refreshPromiseRef = useRef(null);
|
const refreshPromiseRef = useRef(null);
|
||||||
const breadcrumbFetchRef = useRef(new Set());
|
const breadcrumbFetchRef = useRef(new Set());
|
||||||
@@ -816,14 +814,7 @@ const AppLayout = () => {
|
|||||||
if (selectionInitializedRef.current) {
|
if (selectionInitializedRef.current) {
|
||||||
nextDocKeys = previousDocKeys.filter((key) => availableDocKeySet.has(key));
|
nextDocKeys = previousDocKeys.filter((key) => availableDocKeySet.has(key));
|
||||||
} else {
|
} else {
|
||||||
const filtered = previousDocKeys.filter((key) => availableDocKeySet.has(key));
|
nextDocKeys = previousDocKeys.filter((key) => availableDocKeySet.has(key));
|
||||||
if (filtered.length) {
|
|
||||||
nextDocKeys = filtered;
|
|
||||||
} else if (availableDocKeys.length) {
|
|
||||||
nextDocKeys = [availableDocKeys[0]];
|
|
||||||
} else {
|
|
||||||
nextDocKeys = [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mergedSelection = [...previousFolderKeys, ...nextDocKeys];
|
mergedSelection = [...previousFolderKeys, ...nextDocKeys];
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ const Sidebar = ({
|
|||||||
: 'Drag files here to upload.';
|
: 'Drag files here to upload.';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<aside className="sidebar column">
|
<aside className="sidebar">
|
||||||
<div className="sidebar__meta">
|
<div className="sidebar__meta">
|
||||||
<h1 className="sidebar__title">Papercrate</h1>
|
<h1 className="sidebar__title">Papercrate</h1>
|
||||||
<span className="sidebar__hint">{hintText}</span>
|
<span className="sidebar__hint">{hintText}</span>
|
||||||
@@ -284,44 +284,40 @@ const Sidebar = ({
|
|||||||
}`}
|
}`}
|
||||||
role="list"
|
role="list"
|
||||||
>
|
>
|
||||||
{tags.length ? (
|
{tags.map((tag) => {
|
||||||
tags.map((tag) => {
|
const isActive = activeTagSet.has(tag.id);
|
||||||
const isActive = activeTagSet.has(tag.id);
|
const style = getTagColorStyle(tag.color);
|
||||||
const style = getTagColorStyle(tag.color);
|
const className = `sidebar-tag-pill${isActive ? ' active' : ''}`;
|
||||||
const className = `sidebar-tag-pill${isActive ? ' active' : ''}`;
|
return (
|
||||||
return (
|
<button
|
||||||
<button
|
key={tag.id}
|
||||||
key={tag.id}
|
type="button"
|
||||||
type="button"
|
role="listitem"
|
||||||
role="listitem"
|
className={className}
|
||||||
className={className}
|
style={style || undefined}
|
||||||
style={style || undefined}
|
onClick={() => handleToggleTag(tag.id)}
|
||||||
onClick={() => handleToggleTag(tag.id)}
|
aria-pressed={isActive}
|
||||||
aria-pressed={isActive}
|
draggable
|
||||||
draggable
|
onDragStart={(event) => {
|
||||||
onDragStart={(event) => {
|
try {
|
||||||
try {
|
const payload = JSON.stringify({
|
||||||
const payload = JSON.stringify({
|
id: tag.id,
|
||||||
id: tag.id,
|
label: tag.label,
|
||||||
label: tag.label,
|
color: tag.color || null,
|
||||||
color: tag.color || null,
|
});
|
||||||
});
|
event.dataTransfer.effectAllowed = 'copy';
|
||||||
event.dataTransfer.effectAllowed = 'copy';
|
event.dataTransfer.setData('application/x-papercrate-tag', payload);
|
||||||
event.dataTransfer.setData('application/x-papercrate-tag', payload);
|
event.dataTransfer.setData('text/papercrate-tag', payload);
|
||||||
event.dataTransfer.setData('text/papercrate-tag', payload);
|
} catch (
|
||||||
} catch (
|
// eslint-disable-next-line no-empty
|
||||||
// eslint-disable-next-line no-empty
|
error
|
||||||
error
|
) {}
|
||||||
) {}
|
}}
|
||||||
}}
|
>
|
||||||
>
|
{tag.label}
|
||||||
{tag.label}
|
</button>
|
||||||
</button>
|
);
|
||||||
);
|
})}
|
||||||
})
|
|
||||||
) : (
|
|
||||||
<span className="meta">No tags yet</span>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="sidebar-section">
|
<div className="sidebar-section">
|
||||||
@@ -336,36 +332,32 @@ const Sidebar = ({
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<ul className="sidebar-correspondent-list">
|
<ul className="sidebar-correspondent-list">
|
||||||
{sortedCorrespondents.length ? (
|
{sortedCorrespondents.map((correspondent) => {
|
||||||
sortedCorrespondents.map((correspondent) => {
|
const isActive = activeCorrespondentSet.has(correspondent.id);
|
||||||
const isActive = activeCorrespondentSet.has(correspondent.id);
|
const className = `sidebar-correspondent-item${isActive ? ' active' : ''}`;
|
||||||
const className = `sidebar-correspondent-item${isActive ? ' active' : ''}`;
|
const label = correspondent.name || 'Unnamed';
|
||||||
const label = correspondent.name || 'Unnamed';
|
const handleSelect = () => {
|
||||||
const handleSelect = () => {
|
const nextId = isActive ? null : correspondent.id;
|
||||||
const nextId = isActive ? null : correspondent.id;
|
onToggleCorrespondentFilter?.(nextId);
|
||||||
onToggleCorrespondentFilter?.(nextId);
|
};
|
||||||
};
|
return (
|
||||||
return (
|
<li key={correspondent.id}>
|
||||||
<li key={correspondent.id}>
|
<span
|
||||||
<span
|
className={className}
|
||||||
className={className}
|
role="button"
|
||||||
role="button"
|
onClick={handleSelect}
|
||||||
onClick={handleSelect}
|
onKeyDown={(event) => {
|
||||||
onKeyDown={(event) => {
|
if (event.key === 'Enter' || event.key === ' ') {
|
||||||
if (event.key === 'Enter' || event.key === ' ') {
|
event.preventDefault();
|
||||||
event.preventDefault();
|
handleSelect();
|
||||||
handleSelect();
|
}
|
||||||
}
|
}}
|
||||||
}}
|
>
|
||||||
>
|
{label}
|
||||||
{label}
|
</span>
|
||||||
</span>
|
</li>
|
||||||
</li>
|
);
|
||||||
);
|
})}
|
||||||
})
|
|
||||||
) : (
|
|
||||||
<li className="meta">No correspondents yet</li>
|
|
||||||
)}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div className="sidebar__footer">
|
<div className="sidebar__footer">
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
grid-column: 2 / -1;
|
grid-column: 2 / -1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: var(--surface-subtle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.skeuo-header {
|
.skeuo-header {
|
||||||
@@ -22,7 +21,6 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding: 0.75rem 1rem 0.5rem;
|
padding: 0.75rem 1rem 0.5rem;
|
||||||
background-color: var(--surface-subtle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.skeuo-header__meta {
|
.skeuo-header__meta {
|
||||||
|
|||||||
+134
-86
@@ -1,59 +1,56 @@
|
|||||||
:root {
|
:root {
|
||||||
color-scheme: light;
|
color-scheme: light;
|
||||||
/* Neutrals */
|
|
||||||
--bg: #f6f6f6;
|
|
||||||
--surface: #fbfbfb;
|
|
||||||
--surface-subtle: #f3f3f3;
|
|
||||||
--fg: #2b2b2b;
|
|
||||||
--muted: #646a75;
|
|
||||||
--sidebar-fg: #5f6672;
|
|
||||||
--border: #dde1e6;
|
|
||||||
--shadow-faint: rgba(0, 0, 0, 0.06);
|
|
||||||
--shadow-soft: rgba(0, 0, 0, 0.12);
|
|
||||||
--shadow-medium: rgba(0, 0, 0, 0.18);
|
|
||||||
--overlay-backdrop: rgba(30, 33, 39, 0.45);
|
|
||||||
--overlay-shadow: rgba(30, 33, 39, 0.18);
|
|
||||||
|
|
||||||
/* Accent (primary action, selection, focus) */
|
/* master warmth bias: positive = warmer, negative = cooler */
|
||||||
--accent: #3f6ad8;
|
--warmth: 3deg; /* try +5deg for warmer, -5deg for cooler */
|
||||||
--accent-hover: #9bb6ff;
|
|
||||||
--on-accent: #ffffff;
|
|
||||||
|
|
||||||
/* Soft tints & outlines (for chips, row hovers, subtle fills) */
|
/* --- Neutrals --- */
|
||||||
--accent-soft: rgba(63, 106, 216, 0.12);
|
--bg: oklch(0.97 0.001 calc(100deg + var(--warmth)));
|
||||||
--accent-elevated: rgba(63, 106, 216, 0.16);
|
--surface: oklch(0.985 0.001 calc(100deg + var(--warmth)));
|
||||||
--accent-elevated-strong: rgba(63, 106, 216, 0.22);
|
--surface-subtle: oklch(0.96 0.002 calc(100deg + var(--warmth)));
|
||||||
--accent-outline: rgba(63, 106, 216, 0.45);
|
--fg: oklch(0.32 0.005 calc(270deg + var(--warmth)));
|
||||||
--accent-outline-strong: rgba(63, 106, 216, 0.9);
|
--muted: oklch(0.54 0.008 calc(270deg + var(--warmth)));
|
||||||
--accent-focus: rgba(63, 106, 216, 0.85);
|
--sidebar-fg: oklch(0.56 0.007 calc(270deg + var(--warmth)));
|
||||||
--surface-overlay: rgba(255, 255, 255, 0.82);
|
--border: oklch(0.88 0.002 calc(270deg + var(--warmth)));
|
||||||
|
|
||||||
/* States specific to explorer UX */
|
/* --- Accent (primary) --- */
|
||||||
--row-hover-bg: rgba(63, 106, 216, 0.06);
|
--accent: oklch(0.61 0.20 calc(260deg + var(--warmth)));
|
||||||
--row-active-bg: rgba(63, 106, 216, 0.12);
|
--accent-hover: oklch(0.70 0.18 calc(260deg + var(--warmth)));
|
||||||
--sidebar-hover-bg: rgba(63, 106, 216, 0.08);
|
--on-accent: oklch(1 0 0);
|
||||||
--sidebar-active-bg: rgba(63, 106, 216, 0.16);
|
|
||||||
--selection-ring: #9bb6ff;
|
|
||||||
--documents-grid-title-size: 12px;
|
|
||||||
--documents-grid-icon-size: 128px;
|
|
||||||
|
|
||||||
/* Semantic colors */
|
/* --- Derived accent states --- */
|
||||||
--success: #2e7d6b;
|
--accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
|
||||||
--success-subtle: rgba(46, 125, 107, 0.12);
|
--accent-elevated: color-mix(in oklch, var(--accent) 16%, transparent);
|
||||||
--warning: #b98a2e;
|
--accent-elevated-strong: color-mix(in oklch, var(--accent) 22%, transparent);
|
||||||
--warning-subtle: rgba(185, 138, 46, 0.12);
|
--accent-outline: color-mix(in oklch, var(--accent) 45%, transparent);
|
||||||
--danger: #cc5a52;
|
--accent-outline-strong: color-mix(in oklch, var(--accent) 90%, transparent);
|
||||||
--danger-border: rgba(204, 90, 82, 0.45);
|
--accent-focus: color-mix(in oklch, var(--accent) 85%, transparent);
|
||||||
--danger-soft: rgba(204, 90, 82, 0.12);
|
--surface-overlay: color-mix(in oklch, white 82%, transparent);
|
||||||
--danger-subtle: rgba(204, 90, 82, 0.08);
|
|
||||||
|
|
||||||
/* File-type accents (used for icons/labels) */
|
/* --- Shadows & overlays --- */
|
||||||
--file-folder: #e6a23c; /* folders */
|
--shadow-faint: color-mix(in oklch, black 6%, transparent);
|
||||||
--file-doc: #3f6ad8; /* docs */
|
--shadow-soft: color-mix(in oklch, black 12%, transparent);
|
||||||
--file-code: #5b9b5f; /* code */
|
--shadow-medium: color-mix(in oklch, black 18%, transparent);
|
||||||
--file-image: #9a6bd1; /* images */
|
--overlay-backdrop: color-mix(in oklch, oklch(0.22 0.015 calc(265deg + var(--warmth))) 45%, transparent);
|
||||||
--file-audio: #db6f9a; /* audio */
|
--overlay-shadow: color-mix(in oklch, oklch(0.22 0.015 calc(265deg + var(--warmth))) 18%, transparent);
|
||||||
--file-archive: #9c7a59; /* zips */
|
|
||||||
|
/* --- Semantic colors (relative warmth) --- */
|
||||||
|
--success: oklch(0.62 0.18 calc(190deg + var(--warmth)));
|
||||||
|
--warning: oklch(0.72 0.17 calc(95deg + var(--warmth)));
|
||||||
|
--danger: oklch(0.60 0.18 calc(35deg + var(--warmth)));
|
||||||
|
|
||||||
|
--success-subtle: color-mix(in oklch, var(--success) 12%, transparent);
|
||||||
|
--warning-subtle: color-mix(in oklch, var(--warning) 12%, transparent);
|
||||||
|
--danger-border: color-mix(in oklch, var(--danger) 45%, transparent);
|
||||||
|
--danger-soft: color-mix(in oklch, var(--danger) 12%, transparent);
|
||||||
|
--danger-subtle: color-mix(in oklch, var(--danger) 8%, transparent);
|
||||||
|
|
||||||
|
/* --- Explorer states --- */
|
||||||
|
--row-hover-bg: color-mix(in oklch, var(--accent) 6%, transparent);
|
||||||
|
--row-active-bg: color-mix(in oklch, var(--accent) 12%, transparent);
|
||||||
|
--sidebar-hover-bg: color-mix(in oklch, var(--accent) 8%, transparent);
|
||||||
|
--sidebar-active-bg: color-mix(in oklch, var(--accent) 16%, transparent);
|
||||||
|
--selection-ring: oklch(0.78 0.16 calc(260deg + var(--warmth)));
|
||||||
|
|
||||||
font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
@@ -142,19 +139,40 @@ button.danger:hover:not([disabled]) {
|
|||||||
background: var(--danger-subtle);
|
background: var(--danger-subtle);
|
||||||
}
|
}
|
||||||
|
|
||||||
button.icon-button {
|
.icon-button {
|
||||||
padding: 0.25rem 0.55rem;
|
display: inline-flex;
|
||||||
min-width: auto;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--muted);
|
||||||
|
padding: 0.25rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.15s ease, color 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.icon-button.ghost {
|
.icon-button:hover:not([disabled]) {
|
||||||
|
background: var(--sidebar-hover-bg);
|
||||||
|
color: var(--fg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-button.danger {
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-button.danger:hover:not([disabled]) {
|
||||||
|
background: var(--danger-subtle);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-button.ghost {
|
||||||
border: none;
|
border: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
padding: 0.2rem;
|
padding: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.icon-button.ghost:hover:not([disabled]) {
|
.icon-button.ghost:hover:not([disabled]) {
|
||||||
color: var(--danger);
|
color: var(--danger);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
@@ -633,17 +651,6 @@ button.icon-button.ghost:hover:not([disabled]) {
|
|||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.column {
|
|
||||||
background: transparent;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.column + .column {
|
|
||||||
padding-left: 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.column-header {
|
.column-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -743,9 +750,6 @@ button.icon-button.ghost:hover:not([disabled]) {
|
|||||||
gap: 0.25rem;
|
gap: 0.25rem;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
padding-right: 3rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.folder-row:hover {
|
.folder-row:hover {
|
||||||
@@ -830,6 +834,8 @@ button.icon-button.ghost:hover:not([disabled]) {
|
|||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
color: var(--sidebar-fg);
|
color: var(--sidebar-fg);
|
||||||
box-shadow: inset -12px 0 24px -12px var(--shadow-faint);
|
box-shadow: inset -12px 0 24px -12px var(--shadow-faint);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar__meta {
|
.sidebar__meta {
|
||||||
@@ -1070,11 +1076,17 @@ button.icon-button.ghost:hover:not([disabled]) {
|
|||||||
|
|
||||||
.documents-panel {
|
.documents-panel {
|
||||||
padding: 1.25rem 1.25rem 0 1.25rem;
|
padding: 1.25rem 1.25rem 0 1.25rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tags-panel,
|
.tags-panel,
|
||||||
.correspondents-panel {
|
.correspondents-panel {
|
||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.folder-row.is-drop-target {
|
.folder-row.is-drop-target {
|
||||||
@@ -1110,6 +1122,7 @@ button.icon-button.ghost:hover:not([disabled]) {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
padding-right: 0.3rem;
|
padding-right: 0.3rem;
|
||||||
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.documents-panel table {
|
.documents-panel table {
|
||||||
@@ -1233,6 +1246,56 @@ button.icon-button.ghost:hover:not([disabled]) {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.documents-panel td.doc-list__name {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-entry {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-entry--with-thumb .doc-entry__thumb {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-entry__thumb .document-thumbnail-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-entry__main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.35rem;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-entry__name {
|
||||||
|
font-weight: 600;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-entry__tags {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.documents-panel td.actions .action-buttons {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
.documents-panel tbody tr {
|
.documents-panel tbody tr {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
transition: background 0.15s ease;
|
transition: background 0.15s ease;
|
||||||
@@ -1244,7 +1307,6 @@ button.icon-button.ghost:hover:not([disabled]) {
|
|||||||
|
|
||||||
.documents-panel tbody tr.folder {
|
.documents-panel tbody tr.folder {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-weight: 600;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.documents-panel tbody tr.folder.focused {
|
.documents-panel tbody tr.folder.focused {
|
||||||
@@ -1471,6 +1533,9 @@ button.icon-button.ghost:hover:not([disabled]) {
|
|||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
box-shadow: 0 0 24px var(--shadow-faint);
|
box-shadow: 0 0 24px var(--shadow-faint);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail-panel .column-body {
|
.detail-panel .column-body {
|
||||||
@@ -2110,23 +2175,6 @@ form.inline {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.doc-list__icon-button {
|
|
||||||
opacity: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
padding: 0.14rem;
|
|
||||||
margin: 0;
|
|
||||||
transition: opacity 0.12s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-list__name-content:hover .doc-list__icon-button, .doc-list__name-content:focus-within .doc-list__icon-button {
|
|
||||||
opacity: 1;
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-list__icon {
|
|
||||||
width: 0.9rem;
|
|
||||||
height: 0.9rem;
|
|
||||||
}
|
|
||||||
.preview-pane__nav-button svg {
|
.preview-pane__nav-button svg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ function TagsPanel({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="tags-panel column">
|
<section className="tags-panel">
|
||||||
<div className="column-header">
|
<div className="column-header">
|
||||||
<div className="column-header__titles">
|
<div className="column-header__titles">
|
||||||
<h2>Tags</h2>
|
<h2>Tags</h2>
|
||||||
|
|||||||
Reference in New Issue
Block a user