BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/retab-ui/xlsx-worker-protocol

XLSX worker protocol

retab-ui/xlsx-worker-protocol
FreeUtility

Typed worker messages, parse limits, and error codes for the XLSX viewer.

Install it

npx shadcn@latest add https://ui.retab.com/r/xlsx-worker-protocol.json

Source

registry/new-york-v4/lib/xlsx-worker-protocol.tsui.retab.com/r/xlsx-worker-protocol.json
1import type { CompactSheet } from "@/lib/xlsx-workbook";
2
3export interface XlsxParseLimits {
4 maxRowMajorIndex: number;
5 maxNonEmptyCells: number;
6 maxTextChars: number;
7}
8
9export const XLSX_PARSE_LIMITS: XlsxParseLimits = {
10 maxRowMajorIndex: 0xffffffff,
11 maxNonEmptyCells: 1_000_000,
12 maxTextChars: 50_000_000,
13};
14
15export type XlsxWorkerErrorCode =
16 | "parse_failed"
17 | "range_too_large"
18 | "too_many_cells"
19 | "text_too_large";
20
21export type XlsxWorkerRequest = {
22 type: "parse_workbook";
23 buffer: ArrayBuffer;
24};
25
26export type XlsxWorkerResponse =
27 | { type: "workbook"; sheets: CompactSheet[] }
28 | { type: "error"; message: string; code: XlsxWorkerErrorCode };
29
30export class XlsxWorkerError extends Error {
31 constructor(
32 readonly code: XlsxWorkerErrorCode,
33 message: string,
34 ) {
35 super(message);
36 this.name = "XlsxWorkerError";
37 }
38}
39
40// ZIP local-file-header variants ("PK\x03\x04", empty, and spanned archives)
41// cover .xlsx/.xlsm/.xlsb/.ods. The OLE2 / Compound File Binary header covers
42// legacy binary .xls.
43const SPREADSHEET_CONTAINER_PREFIXES: ReadonlyArray<ReadonlyArray<number>> = [
44 [0x50, 0x4b, 0x03, 0x04],
45 [0x50, 0x4b, 0x05, 0x06],
46 [0x50, 0x4b, 0x07, 0x08],
47 [0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1],
48];
49
50function hasBytePrefix(
51 bytes: Uint8Array,
52 prefix: ReadonlyArray<number>,
53): boolean {
54 if (bytes.length < prefix.length) return false;
55 for (let i = 0; i < prefix.length; i++) {
56 if (bytes[i] !== prefix[i]) return false;
57 }
58 return true;
59}
60
61/**
62 * True when the buffer begins with a recognized spreadsheet container
63 * signature: a ZIP archive (.xlsx/.xlsm/.xlsb/.ods) or an OLE2 compound file
64 * (legacy .xls). This guards SheetJS's lenient format sniffer, which would
65 * otherwise coerce arbitrary bytes — a mislabeled PDF, image, or text file —
66 * into a degenerate single-cell sheet instead of surfacing a parse error.
67 */
68export function isSpreadsheetContainer(buffer: ArrayBuffer): boolean {
69 const bytes = new Uint8Array(buffer);
70 return SPREADSHEET_CONTAINER_PREFIXES.some((prefix) =>
71 hasBytePrefix(bytes, prefix),
72 );
73}

What it pulls in

Other registry items

  • @retab/xlsx-workbook

Files it writes

  • registry/new-york-v4/lib/xlsx-worker-protocol.ts

Facts

Registry
retab-ui
Type
registry:lib
Access
Free
Files written
1
Licence
NOASSERTION
In the index
at or before 2026-08-13
Last confirmed
yesterday

Go to the source

ui.retab.com retab-dev/retab-ui on GitHub Raw registry item This item as JSON

More from retab-ui

All 130 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
CSV parsercsvretab-uiUtilitiesFreeno deps · 4 files
Document source modeldocument-sourceretab-uiUtilitiesFreeno deps
DOCX Document Resourcedocx-document-resourceretab-uiUtilitiesFreeno deps · 5 files
Effect Keyeffect-keyretab-uiUtilitiesFreeno deps
PDF Document Resourcepdf-document-resourceretab-uiUtilitiesFree1 dep · 6 files
Segment Interactionsegment-interactionretab-uiUtilitiesFreeno deps
Segments modelsegmentsretab-uiUtilitiesFreeno deps
Utilsutilsretab-uiUtilitiesFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex