chore(front): apply biome formatter
This commit is contained in:
@@ -274,8 +274,7 @@
|
||||
radial-gradient(55% 55% at 95% 98%, var(--color-accent-glow), transparent 58%),
|
||||
radial-gradient(48% 48% at 88% 12%, var(--color-accent-glow-soft), transparent 55%),
|
||||
radial-gradient(50% 45% at 6% 92%, var(--color-accent-glow-soft), transparent 55%),
|
||||
radial-gradient(78% 64% at 50% 33%, var(--color-bg-surface), transparent 70%),
|
||||
var(--color-bg-page);
|
||||
radial-gradient(78% 64% at 50% 33%, var(--color-bg-surface), transparent 70%), var(--color-bg-page);
|
||||
/* Desaturated fractal-noise grain — kills gradient banding and adds a
|
||||
tactile, "expensive" film. No colour inside the data-URI (token-safe);
|
||||
applied via a low-opacity overlay pseudo-element. */
|
||||
|
||||
@@ -389,7 +389,9 @@
|
||||
border-color: transparent;
|
||||
color: var(--color-on-accent);
|
||||
/* Subtle halo lifts the active step off the connector track. */
|
||||
box-shadow: 0 0 0 4px var(--color-accent-ring), 0 4px 12px var(--color-accent-shadow);
|
||||
box-shadow:
|
||||
0 0 0 4px var(--color-accent-ring),
|
||||
0 4px 12px var(--color-accent-shadow);
|
||||
}
|
||||
|
||||
.step-title {
|
||||
|
||||
@@ -455,9 +455,7 @@ async function loadFiles(options = { insertHistory: true }) {
|
||||
? '<div class="skeleton-row"><div class="skeleton skeleton-icon"></div><div class="skeleton skeleton-line skeleton-line--medium"></div><div class="skeleton skeleton-line skeleton-line--short"></div></div>'
|
||||
: '<div class="skeleton-card"><div class="skeleton skeleton-thumb"></div><div class="skeleton skeleton-line skeleton-line--medium"></div><div class="skeleton skeleton-line skeleton-line--short"></div></div>';
|
||||
const wrapper = isList ? 'files-skeleton' : 'files-grid-view files-skeleton';
|
||||
ui.showError(
|
||||
`<div class="${wrapper}" role="status" aria-busy="true" aria-label="${i18n.t('files.loading')}">${cell.repeat(8)}</div>`
|
||||
);
|
||||
ui.showError(`<div class="${wrapper}" role="status" aria-busy="true" aria-label="${i18n.t('files.loading')}">${cell.repeat(8)}</div>`);
|
||||
}, 100);
|
||||
|
||||
// A temporary guard: _loadPage sets _loading itself, but we need to
|
||||
|
||||
@@ -111,9 +111,7 @@ function initSidebarToggle() {
|
||||
// Trap Tab focus inside the open drawer (mobile).
|
||||
sidebar.addEventListener('keydown', (e) => {
|
||||
if (e.key !== 'Tab' || !sidebar.classList.contains('open')) return;
|
||||
const f = /** @type {NodeListOf<HTMLElement>} */ (
|
||||
sidebar.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])')
|
||||
);
|
||||
const f = /** @type {NodeListOf<HTMLElement>} */ (sidebar.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])'));
|
||||
if (!f.length) return;
|
||||
const first = f[0];
|
||||
const last = f[f.length - 1];
|
||||
|
||||
+2
-7
@@ -16,7 +16,7 @@ import { wopiEditor } from '../features/files/wopiEditor.js';
|
||||
import { recent } from '../features/library/recent.js';
|
||||
import { buildBatchDownloadUrl } from '../utils/download.js';
|
||||
import { positionMenu } from '../utils/menuPosition.js';
|
||||
import { loadFiles, filesView } from './filesView.js';
|
||||
import { filesView, loadFiles } from './filesView.js';
|
||||
import { updateHistory } from './main.js';
|
||||
import { activateFilesUI, switchToFilesSection, syncViewContainers } from './navigation.js';
|
||||
import { app } from './state.js';
|
||||
@@ -1057,12 +1057,7 @@ const ui = {
|
||||
const active = btn.dataset.sortField === field;
|
||||
btn.classList.toggle('is-active', active);
|
||||
const colName = btn.querySelector('span')?.textContent || '';
|
||||
btn.setAttribute(
|
||||
'aria-label',
|
||||
active
|
||||
? `${colName}: ${reversed ? i18n.t('sort.desc', 'descending') : i18n.t('sort.asc', 'ascending')}`
|
||||
: colName
|
||||
);
|
||||
btn.setAttribute('aria-label', active ? `${colName}: ${reversed ? i18n.t('sort.desc', 'descending') : i18n.t('sort.asc', 'ascending')}` : colName);
|
||||
const arrow = btn.querySelector('.list-header-sort__arrow');
|
||||
if (arrow) {
|
||||
arrow.classList.toggle('hidden', !active);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* Isolates notification rendering policy from ui.js.
|
||||
*/
|
||||
|
||||
import { notifications } from '../core/notifications.js';
|
||||
import { announce } from '../core/liveRegion.js';
|
||||
import { notifications } from '../core/notifications.js';
|
||||
|
||||
const uiNotifications = {
|
||||
/**
|
||||
|
||||
@@ -47,8 +47,7 @@ const JUST_ADDED_KEY = '__oxicloud_just_added__';
|
||||
*/
|
||||
function gridMetaDate(value) {
|
||||
if (!value) return '';
|
||||
const date =
|
||||
value instanceof Date ? value : new Date(typeof value === 'number' && value < 1e12 ? value * 1000 : value);
|
||||
const date = value instanceof Date ? value : new Date(typeof value === 'number' && value < 1e12 ? value * 1000 : value);
|
||||
if (Number.isNaN(date.getTime())) return '';
|
||||
const ageDays = (Date.now() - date.getTime()) / 86_400_000;
|
||||
return ageDays > 30 ? formatDateShort(value) : formatRelativeTime(value);
|
||||
|
||||
@@ -27,9 +27,7 @@ function formatFileSize(bytes) {
|
||||
const k = 1024;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
const num = new Intl.NumberFormat(i18n.getCurrentLocale(), { maximumFractionDigits: 2 }).format(
|
||||
bytes / k ** i
|
||||
);
|
||||
const num = new Intl.NumberFormat(i18n.getCurrentLocale(), { maximumFractionDigits: 2 }).format(bytes / k ** i);
|
||||
|
||||
return `${num} ${sizes[i]}`;
|
||||
}
|
||||
@@ -89,10 +87,7 @@ function formatDateShort(value) {
|
||||
*/
|
||||
function formatRelativeTime(value) {
|
||||
if (!value) return '';
|
||||
const date =
|
||||
value instanceof Date
|
||||
? value
|
||||
: new Date(typeof value === 'number' && value < 1e12 ? value * 1000 : value);
|
||||
const date = value instanceof Date ? value : new Date(typeof value === 'number' && value < 1e12 ? value * 1000 : value);
|
||||
if (Number.isNaN(date.getTime())) return String(value);
|
||||
const diffSec = Math.round((date.getTime() - Date.now()) / 1000);
|
||||
const abs = Math.abs(diffSec);
|
||||
|
||||
@@ -524,10 +524,7 @@ const OxiIcons = {
|
||||
'M384 96c0-35.3 28.7-64 64-64s64 28.7 64 64l0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32c0-70.7-57.3-128-128-128S320 25.3 320 96l0 64-160 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64l-32 0 0-64z'
|
||||
],
|
||||
|
||||
'adjust': [
|
||||
512,
|
||||
'M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z'
|
||||
],
|
||||
adjust: [512, 'M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z']
|
||||
};
|
||||
|
||||
// Icon CSS is now in /css/components/icons.css (loaded via main.css).
|
||||
|
||||
@@ -850,10 +850,7 @@ function initPasswordToggles() {
|
||||
const sync = () => {
|
||||
const shown = input.type === 'text';
|
||||
btn.setAttribute('aria-pressed', String(shown));
|
||||
btn.setAttribute(
|
||||
'aria-label',
|
||||
shown ? i18n.t('auth.hidePassword', 'Hide password') : i18n.t('auth.showPassword', 'Show password')
|
||||
);
|
||||
btn.setAttribute('aria-label', shown ? i18n.t('auth.hidePassword', 'Hide password') : i18n.t('auth.showPassword', 'Show password'));
|
||||
};
|
||||
sync();
|
||||
btn.addEventListener('click', () => {
|
||||
@@ -930,9 +927,7 @@ function initPasswordMatch(passId, confirmId, indicatorId) {
|
||||
}
|
||||
const ok = pass.value === confirmEl.value;
|
||||
out.className = `auth-match show ${ok ? 'auth-match--ok' : 'auth-match--bad'}`;
|
||||
out.textContent = ok
|
||||
? i18n.t('auth.passwordsMatch', 'Passwords match')
|
||||
: i18n.t('auth.passwords_mismatch', "Passwords don't match");
|
||||
out.textContent = ok ? i18n.t('auth.passwordsMatch', 'Passwords match') : i18n.t('auth.passwords_mismatch', "Passwords don't match");
|
||||
};
|
||||
pass.addEventListener('input', update);
|
||||
confirmEl.addEventListener('input', update);
|
||||
@@ -1107,9 +1102,7 @@ if (isLoginPage && loginForm) {
|
||||
const username = inputVal('login-username');
|
||||
const password = inputVal('login-password');
|
||||
|
||||
const loginSubmit = /** @type {HTMLButtonElement | null} */ (
|
||||
document.getElementById('login-submit')
|
||||
);
|
||||
const loginSubmit = /** @type {HTMLButtonElement | null} */ (document.getElementById('login-submit'));
|
||||
loginSubmit?.classList.add('is-loading');
|
||||
loginSubmit?.setAttribute('aria-busy', 'true');
|
||||
if (loginSubmit) loginSubmit.disabled = true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getCsrfHeaders } from '../../core/csrf.js';
|
||||
import { installFetchInterceptor } from '../../core/fetchWrapper.js';
|
||||
import { i18n } from '../../core/i18n.js';
|
||||
import { formatRelativeTime } from '../../core/formatters.js';
|
||||
import { i18n } from '../../core/i18n.js';
|
||||
import { oxiIconsInit } from '../../core/icons.js';
|
||||
import { resizeImageToDataUrl } from '../../utils/imageResize.js';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user