@xlsx-editor.dev/core 0.0.0-placeholder.0 → 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +217 -0
- package/README.md +254 -2
- package/THIRD_PARTY_NOTICES.md +78 -0
- package/dist/automation.d.ts +299 -0
- package/dist/automation.js +42 -0
- package/dist/builtins-nmHrq2Et.d.ts +37 -0
- package/dist/cascade.d.ts +196 -0
- package/dist/cascade.js +60 -0
- package/dist/cell-format-DW8yF-c-.d.ts +226 -0
- package/dist/chunk-2DLJYRJC.js +3171 -0
- package/dist/chunk-2ZU4337U.js +204 -0
- package/dist/chunk-44L37ENZ.js +8219 -0
- package/dist/chunk-77N55BLP.js +911 -0
- package/dist/chunk-7PV5HQPE.js +84 -0
- package/dist/chunk-E4VJJ556.js +756 -0
- package/dist/chunk-KG4IL4JI.js +436 -0
- package/dist/chunk-PLDK4XO6.js +9125 -0
- package/dist/chunk-PRHLYXHL.js +1699 -0
- package/dist/chunk-TE4FXG5T.js +3156 -0
- package/dist/contracts.d.ts +32 -0
- package/dist/contracts.js +0 -0
- package/dist/dist-C7NLNUMD.js +2850 -0
- package/dist/editor.d.ts +3167 -0
- package/dist/editor.js +309 -0
- package/dist/harfbuzz-measurer-CkKfsEyu.d.ts +128 -0
- package/dist/harfbuzz.wasm +0 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +309 -0
- package/dist/layout.d.ts +111 -0
- package/dist/layout.js +104 -0
- package/dist/merge-commands-DthcNpfw.d.ts +53 -0
- package/dist/node-module-shim-LQXGL47O.js +18 -0
- package/dist/ops-CfUCjyph.d.ts +629 -0
- package/dist/output.d.ts +177 -0
- package/dist/output.js +29 -0
- package/dist/sheet-index-P5vevMWX.d.ts +52 -0
- package/dist/sheet-layout-D9M_4EBn.d.ts +494 -0
- package/dist/sheet-protection-D8goxm58.d.ts +209 -0
- package/dist/store.d.ts +615 -0
- package/dist/store.js +272 -0
- package/dist/theme-BprDji6x.d.ts +16 -0
- package/dist/units-D6CD_A5I.d.ts +13 -0
- package/dist/workbook-index-DsbeR8Kb.d.ts +294 -0
- package/licenses/Emscripten-LICENSE.txt +102 -0
- package/licenses/HarfBuzz-COPYING.txt +42 -0
- package/licenses/HarfBuzz-USE-MIT.txt +21 -0
- package/licenses/HarfBuzz-source-notices.txt +4508 -0
- package/licenses/README.md +19 -0
- package/licenses/Unicode-LICENSE.txt +39 -0
- package/licenses/compiler-rt-LICENSE.txt +311 -0
- package/licenses/harfbuzz-manifest.json +84 -0
- package/licenses/musl-COPYRIGHT.txt +193 -0
- package/package.json +79 -6
- package/src/styles/editor.css +1933 -0
- package/src/styles/editor.css.d.ts +2 -0
package/dist/output.d.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { SheetLayout, CellTextBox } from './layout.js';
|
|
2
|
+
import { XlsxPackage } from './store.js';
|
|
3
|
+
import { RegisteredFace } from './layout.js';
|
|
4
|
+
import { Rgb, GradientRect, ResolvedFill } from './cascade.js';
|
|
5
|
+
import './builtins-nmHrq2Et.js';
|
|
6
|
+
import './sheet-index-P5vevMWX.js';
|
|
7
|
+
import './theme-BprDji6x.js';
|
|
8
|
+
|
|
9
|
+
/** A picture larger than this many pixels is not decoded. */
|
|
10
|
+
declare const MAX_PICTURE_PIXELS = 50000000;
|
|
11
|
+
/** The window functions that decoding needs: the window that owns the paint target. */
|
|
12
|
+
interface PictureWindow {
|
|
13
|
+
readonly Blob: typeof Blob;
|
|
14
|
+
createImageBitmap(image: Blob): Promise<ImageBitmap>;
|
|
15
|
+
}
|
|
16
|
+
/** The state of one picture part. */
|
|
17
|
+
type PictureState = {
|
|
18
|
+
readonly kind: 'loading';
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: 'ready';
|
|
21
|
+
readonly bitmap: ImageBitmap;
|
|
22
|
+
} | {
|
|
23
|
+
readonly kind: 'unsupported';
|
|
24
|
+
readonly reason: string;
|
|
25
|
+
};
|
|
26
|
+
/** Decoded pictures of one package, by part name. */
|
|
27
|
+
interface PictureStore {
|
|
28
|
+
/** The state of a picture part; the first call starts decoding. */
|
|
29
|
+
get(partName: string, contentType: string | undefined): PictureState;
|
|
30
|
+
/** Called once each time a picture finishes decoding, so the host can paint again. */
|
|
31
|
+
onReady(listener: () => void): () => void;
|
|
32
|
+
dispose(): void;
|
|
33
|
+
}
|
|
34
|
+
/** A picture store over the bytes of `pkg`, decoding in `win`. */
|
|
35
|
+
declare function createPictureStore(pkg: XlsxPackage, win: PictureWindow | undefined): PictureStore;
|
|
36
|
+
|
|
37
|
+
/** How to paint a sheet window. */
|
|
38
|
+
interface PaintOptions {
|
|
39
|
+
/** CSS pixels for each point. */
|
|
40
|
+
readonly scale: number;
|
|
41
|
+
/** The paint area, in points. */
|
|
42
|
+
readonly width: number;
|
|
43
|
+
readonly height: number;
|
|
44
|
+
/**
|
|
45
|
+
* Draw gridlines: the sheet view flag on screen (`x:sheetView/@showGridLines`), the print flag
|
|
46
|
+
* on a printed page (`x:printOptions/@gridLines`).
|
|
47
|
+
*/
|
|
48
|
+
readonly gridlines: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* `RRGGBB`; `DEFAULT_GRIDLINE_COLOR` when absent. Layout does not read
|
|
51
|
+
* `x:sheetView/@colorId` or `@defaultGridColor` (`CT_SheetView`).
|
|
52
|
+
*/
|
|
53
|
+
readonly gridlineColor?: string;
|
|
54
|
+
/** Draw the frozen pane edges (screen only). */
|
|
55
|
+
readonly frozenLines?: boolean;
|
|
56
|
+
/** Decoded pictures; pictures paint nothing without it. */
|
|
57
|
+
readonly pictures?: PictureStore;
|
|
58
|
+
/** Device pixels for each CSS pixel. Default 1. */
|
|
59
|
+
readonly devicePixelRatio?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Where the tile grid of pattern fills starts, in viewport points, for every pane. The
|
|
62
|
+
* reference PDFs start it at the bottom-left corner of the page, so the fidelity harness passes
|
|
63
|
+
* that corner. When absent, each pane starts it at its sheet origin, so a pattern moves with its
|
|
64
|
+
* cells when the view scrolls.
|
|
65
|
+
*/
|
|
66
|
+
readonly patternOrigin?: {
|
|
67
|
+
readonly x: number;
|
|
68
|
+
readonly y: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** What a paint drew, for tests, the harness, and the viewer. */
|
|
72
|
+
interface PaintStats {
|
|
73
|
+
readonly cells: number;
|
|
74
|
+
readonly texts: number;
|
|
75
|
+
readonly drawings: number;
|
|
76
|
+
/** Pictures that are still decoding: paint again when the store reports them ready. */
|
|
77
|
+
readonly pendingPictures: number;
|
|
78
|
+
}
|
|
79
|
+
/** The largest side of the canvas backing store, in device pixels. */
|
|
80
|
+
declare const MAX_CANVAS_SIDE = 16384;
|
|
81
|
+
/**
|
|
82
|
+
* Paint a sheet window into `canvas`: the backing store is sized to the paint area at the device
|
|
83
|
+
* pixel ratio, and the CSS size to the paint area at `scale`. Paint again with a new layout to
|
|
84
|
+
* scroll or zoom.
|
|
85
|
+
*/
|
|
86
|
+
declare function paintSheet(canvas: HTMLCanvasElement, layout: SheetLayout, options: PaintOptions): PaintStats;
|
|
87
|
+
|
|
88
|
+
/** The shown text of a cell: its lines, joined by a space. */
|
|
89
|
+
declare function cellText(box: CellTextBox): string;
|
|
90
|
+
/** The words that the accessible rows add to a cell text. */
|
|
91
|
+
interface AccessibleGridLabels {
|
|
92
|
+
/**
|
|
93
|
+
* The text of a formula cell whose shown result can be out of date, from the
|
|
94
|
+
* cell's shown text: the editor passes the catalog's `grid.staleResult`.
|
|
95
|
+
*/
|
|
96
|
+
staleCell(text: string): string;
|
|
97
|
+
/**
|
|
98
|
+
* The words of a stale formula cell that shows no text, because it has no cached result: the
|
|
99
|
+
* editor passes the catalog's `grid.staleNoResult`, with no placeholder.
|
|
100
|
+
*/
|
|
101
|
+
readonly staleNoResult: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A visually hidden row group of the cell texts of `layout`, in `doc`. A stale formula cell
|
|
105
|
+
* reads its shown text with the stale words of `labels`, so assistive technology hears the
|
|
106
|
+
* stale state of each cell; `data-stale` marks it for tests and styles.
|
|
107
|
+
*/
|
|
108
|
+
declare function accessibleGrid(doc: Document, layout: SheetLayout, labels: AccessibleGridLabels): HTMLElement;
|
|
109
|
+
|
|
110
|
+
/** Registered faces, removable when the document closes. */
|
|
111
|
+
interface FontFaceHandle {
|
|
112
|
+
readonly ready: Promise<void>;
|
|
113
|
+
dispose(): void;
|
|
114
|
+
}
|
|
115
|
+
/** Add faces to `doc.fonts`. Bytes are copied into the FontFace; nothing touches disk. */
|
|
116
|
+
declare function registerFontFaces(doc: Document, faces: readonly RegisteredFace[]): FontFaceHandle;
|
|
117
|
+
|
|
118
|
+
/** A resolved `RRGGBB` color as CSS, or `fallback` when it is not one. */
|
|
119
|
+
declare function cssColor(rgb: Rgb | undefined, fallback?: string): string;
|
|
120
|
+
/** One border line: its width and its dash pattern, in grid pixels. */
|
|
121
|
+
interface BorderLine {
|
|
122
|
+
/** The width of the line, in grid pixels. */
|
|
123
|
+
readonly width: number;
|
|
124
|
+
/** Dash and gap lengths in grid pixels; empty for a solid line. */
|
|
125
|
+
readonly dash: readonly number[];
|
|
126
|
+
/** Two thin lines with one pixel between them (`double`). */
|
|
127
|
+
readonly double: boolean;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The line of a border style (`x:left/@style` and its siblings, `ST_BorderStyle`), or undefined
|
|
131
|
+
* for `none` and for an unknown style.
|
|
132
|
+
*/
|
|
133
|
+
declare function borderLine(style: string): BorderLine | undefined;
|
|
134
|
+
/** One color stop of a gradient fill, with its position from 0 to 1. */
|
|
135
|
+
interface GradientStop {
|
|
136
|
+
readonly offset: number;
|
|
137
|
+
readonly color: string;
|
|
138
|
+
}
|
|
139
|
+
/** What a cell fill paints: nothing, one color, or a gradient. */
|
|
140
|
+
type FillPaint = {
|
|
141
|
+
readonly kind: 'none';
|
|
142
|
+
} | {
|
|
143
|
+
readonly kind: 'color';
|
|
144
|
+
readonly color: string;
|
|
145
|
+
} | {
|
|
146
|
+
readonly kind: 'pattern';
|
|
147
|
+
/** A key of `PATTERN_TILES`. */
|
|
148
|
+
readonly pattern: string;
|
|
149
|
+
readonly foreground: string;
|
|
150
|
+
readonly background: string;
|
|
151
|
+
/**
|
|
152
|
+
* The mix of the two colors in the share of the set pixels: the paint when one tile is
|
|
153
|
+
* smaller than 8 device pixels or larger than 512 (approximation "Fill pixels").
|
|
154
|
+
*/
|
|
155
|
+
readonly mix: string;
|
|
156
|
+
} | {
|
|
157
|
+
readonly kind: 'gradient';
|
|
158
|
+
/** `x:gradientFill/@type` (`ST_GradientType`, default `linear`). */
|
|
159
|
+
readonly type: 'linear' | 'path';
|
|
160
|
+
/** `x:gradientFill/@degree`: clockwise degrees from the left edge, for `linear`. */
|
|
161
|
+
readonly degree: number;
|
|
162
|
+
/** The inner rectangle of a `path` gradient, as fractions of the box of the cell. */
|
|
163
|
+
readonly rect: GradientRect;
|
|
164
|
+
readonly stops: readonly GradientStop[];
|
|
165
|
+
};
|
|
166
|
+
/** The paint of a resolved fill. */
|
|
167
|
+
declare function fillPaint(fill: ResolvedFill): FillPaint;
|
|
168
|
+
/**
|
|
169
|
+
* The gridline color on screen, as `RRGGBB`. Not measured: the reference PDFs print no gridlines
|
|
170
|
+
* (approximation "Gridline color"). `x:sheetView` (`CT_SheetView`, sml.xsd) can name the color
|
|
171
|
+
* with `@defaultGridColor` (`xsd:boolean`, default true) and `@colorId` (an indexed color,
|
|
172
|
+
* default 64). The engine does not read these two attributes; it reads only `@showGridLines`.
|
|
173
|
+
*/
|
|
174
|
+
declare const DEFAULT_GRIDLINE_COLOR: Rgb;
|
|
175
|
+
|
|
176
|
+
export { DEFAULT_GRIDLINE_COLOR, MAX_CANVAS_SIDE, MAX_PICTURE_PIXELS, accessibleGrid, borderLine, cellText, createPictureStore, cssColor, fillPaint, paintSheet, registerFontFaces };
|
|
177
|
+
export type { AccessibleGridLabels, BorderLine, FillPaint, FontFaceHandle, PaintOptions, PaintStats, PictureState, PictureStore, PictureWindow };
|
package/dist/output.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_GRIDLINE_COLOR,
|
|
3
|
+
MAX_CANVAS_SIDE,
|
|
4
|
+
MAX_PICTURE_PIXELS,
|
|
5
|
+
accessibleGrid,
|
|
6
|
+
borderLine,
|
|
7
|
+
cellText,
|
|
8
|
+
createPictureStore,
|
|
9
|
+
cssColor,
|
|
10
|
+
fillPaint,
|
|
11
|
+
paintSheet,
|
|
12
|
+
registerFontFaces
|
|
13
|
+
} from "./chunk-77N55BLP.js";
|
|
14
|
+
import "./chunk-KG4IL4JI.js";
|
|
15
|
+
import "./chunk-44L37ENZ.js";
|
|
16
|
+
import "./chunk-2DLJYRJC.js";
|
|
17
|
+
export {
|
|
18
|
+
DEFAULT_GRIDLINE_COLOR,
|
|
19
|
+
MAX_CANVAS_SIDE,
|
|
20
|
+
MAX_PICTURE_PIXELS,
|
|
21
|
+
accessibleGrid,
|
|
22
|
+
borderLine,
|
|
23
|
+
cellText,
|
|
24
|
+
createPictureStore,
|
|
25
|
+
cssColor,
|
|
26
|
+
fillPaint,
|
|
27
|
+
paintSheet,
|
|
28
|
+
registerFontFaces
|
|
29
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { E as Element, a as XmlPart } from './workbook-index-DsbeR8Kb.js';
|
|
2
|
+
|
|
3
|
+
/** One cell of the index. */
|
|
4
|
+
interface CellEntry {
|
|
5
|
+
/** 0-based row. */
|
|
6
|
+
readonly row: number;
|
|
7
|
+
/** 0-based column. */
|
|
8
|
+
readonly col: number;
|
|
9
|
+
readonly el: Element;
|
|
10
|
+
/** The row element that holds the cell. */
|
|
11
|
+
readonly rowEl: Element;
|
|
12
|
+
}
|
|
13
|
+
/** A problem with the cell structure of a sheet, recorded with the reference where it is. */
|
|
14
|
+
interface SheetProblem {
|
|
15
|
+
readonly code: 'bad-row-number' | 'row-out-of-order' | 'bad-cell-reference' | 'cell-in-wrong-row' | 'cell-out-of-order' | 'duplicate-cell'
|
|
16
|
+
/** Rows or cells inside a markup-compatibility wrapper: kept verbatim, not indexed. */
|
|
17
|
+
| 'wrapped-content';
|
|
18
|
+
/** The cell reference or the row number, as the file wrote it, when there is one. */
|
|
19
|
+
readonly at?: string;
|
|
20
|
+
}
|
|
21
|
+
/** The index of one worksheet. */
|
|
22
|
+
interface SheetIndex {
|
|
23
|
+
readonly partName: string;
|
|
24
|
+
readonly root: Element;
|
|
25
|
+
/** `x:sheetData`, when the sheet has one in place. */
|
|
26
|
+
readonly sheetData: Element | undefined;
|
|
27
|
+
/** Cells by {@link cellKey}. */
|
|
28
|
+
readonly cells: ReadonlyMap<number, CellEntry>;
|
|
29
|
+
/** Row elements by 0-based row. */
|
|
30
|
+
readonly rows: ReadonlyMap<number, Element>;
|
|
31
|
+
/** Cell keys in document order. */
|
|
32
|
+
readonly order: readonly number[];
|
|
33
|
+
/**
|
|
34
|
+
* The number of indexed cells with a direct `x:f` child, counted in the same pass. It skips
|
|
35
|
+
* the cells that the index skips and an `x:f` inside `mc:AlternateContent` in a cell. So the
|
|
36
|
+
* stale flag reads `workbookHasFormula`, and the notice reads `sheetMayHoldFormula`.
|
|
37
|
+
*/
|
|
38
|
+
readonly formulas: number;
|
|
39
|
+
readonly problems: readonly SheetProblem[];
|
|
40
|
+
}
|
|
41
|
+
/** The map key of a cell: unique for every cell of the grid, and ordered row by row. */
|
|
42
|
+
declare const cellKey: (row: number, col: number) => number;
|
|
43
|
+
/** The row and column of a {@link cellKey}. */
|
|
44
|
+
declare function keyAddress(key: number): {
|
|
45
|
+
row: number;
|
|
46
|
+
col: number;
|
|
47
|
+
};
|
|
48
|
+
/** The cell index of a worksheet part. Cached per part revision. */
|
|
49
|
+
declare function sheetIndex(part: XmlPart): SheetIndex;
|
|
50
|
+
|
|
51
|
+
export { cellKey as c, keyAddress as k, sheetIndex as s };
|
|
52
|
+
export type { CellEntry as C, SheetIndex as S, SheetProblem as a };
|