/** * The .xlsx preview component: renders via the Univer sheets preset (data + * formulas + formatting). Lives in its own module (split out of the former * office-view.tsx) so it builds as a standalone lazy chunk * (`lib/client-xlsx.js`) — the Univer family and SheetJS pull in several MB * but are loaded only when a .xlsx is first opened. The docx stack never * shares this script. * * Errors degrade to the shared download-button affordance, so a corrupted / * encrypted / oversized file always leaves the user with a way to get it. */ import { useEffect, useRef, useState } from 'react' import { mediaUrl } from './api.ts' import { isZh, t } from './locales.ts' import { BinaryFallback, type LoadState, type OfficeViewProps } from './office-shared.tsx' import { xlsxWorkbookToUniver } from './xlsx-to-univer.ts' import css from './sidebar.module.css' // Univer's stylesheets ride the same dsh-css-inline pipeline as xterm's CSS // (one