@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.
Files changed (55) hide show
  1. package/LICENSE +217 -0
  2. package/README.md +254 -2
  3. package/THIRD_PARTY_NOTICES.md +78 -0
  4. package/dist/automation.d.ts +299 -0
  5. package/dist/automation.js +42 -0
  6. package/dist/builtins-nmHrq2Et.d.ts +37 -0
  7. package/dist/cascade.d.ts +196 -0
  8. package/dist/cascade.js +60 -0
  9. package/dist/cell-format-DW8yF-c-.d.ts +226 -0
  10. package/dist/chunk-2DLJYRJC.js +3171 -0
  11. package/dist/chunk-2ZU4337U.js +204 -0
  12. package/dist/chunk-44L37ENZ.js +8219 -0
  13. package/dist/chunk-77N55BLP.js +911 -0
  14. package/dist/chunk-7PV5HQPE.js +84 -0
  15. package/dist/chunk-E4VJJ556.js +756 -0
  16. package/dist/chunk-KG4IL4JI.js +436 -0
  17. package/dist/chunk-PLDK4XO6.js +9125 -0
  18. package/dist/chunk-PRHLYXHL.js +1699 -0
  19. package/dist/chunk-TE4FXG5T.js +3156 -0
  20. package/dist/contracts.d.ts +32 -0
  21. package/dist/contracts.js +0 -0
  22. package/dist/dist-C7NLNUMD.js +2850 -0
  23. package/dist/editor.d.ts +3167 -0
  24. package/dist/editor.js +309 -0
  25. package/dist/harfbuzz-measurer-CkKfsEyu.d.ts +128 -0
  26. package/dist/harfbuzz.wasm +0 -0
  27. package/dist/index.d.ts +11 -0
  28. package/dist/index.js +309 -0
  29. package/dist/layout.d.ts +111 -0
  30. package/dist/layout.js +104 -0
  31. package/dist/merge-commands-DthcNpfw.d.ts +53 -0
  32. package/dist/node-module-shim-LQXGL47O.js +18 -0
  33. package/dist/ops-CfUCjyph.d.ts +629 -0
  34. package/dist/output.d.ts +177 -0
  35. package/dist/output.js +29 -0
  36. package/dist/sheet-index-P5vevMWX.d.ts +52 -0
  37. package/dist/sheet-layout-D9M_4EBn.d.ts +494 -0
  38. package/dist/sheet-protection-D8goxm58.d.ts +209 -0
  39. package/dist/store.d.ts +615 -0
  40. package/dist/store.js +272 -0
  41. package/dist/theme-BprDji6x.d.ts +16 -0
  42. package/dist/units-D6CD_A5I.d.ts +13 -0
  43. package/dist/workbook-index-DsbeR8Kb.d.ts +294 -0
  44. package/licenses/Emscripten-LICENSE.txt +102 -0
  45. package/licenses/HarfBuzz-COPYING.txt +42 -0
  46. package/licenses/HarfBuzz-USE-MIT.txt +21 -0
  47. package/licenses/HarfBuzz-source-notices.txt +4508 -0
  48. package/licenses/README.md +19 -0
  49. package/licenses/Unicode-LICENSE.txt +39 -0
  50. package/licenses/compiler-rt-LICENSE.txt +311 -0
  51. package/licenses/harfbuzz-manifest.json +84 -0
  52. package/licenses/musl-COPYRIGHT.txt +193 -0
  53. package/package.json +79 -6
  54. package/src/styles/editor.css +1933 -0
  55. package/src/styles/editor.css.d.ts +2 -0
@@ -0,0 +1,209 @@
1
+ import { a as XmlPart, E as Element, X as XlsxPackage, W as WorkbookIndex } from './workbook-index-DsbeR8Kb.js';
2
+ import { S as SheetIndex } from './sheet-index-P5vevMWX.js';
3
+ import { O as OpRejection, S as StructuralOpName, W as WorkbookOp } from './ops-CfUCjyph.js';
4
+
5
+ /**
6
+ * The engine's trust-boundary caps: recursion depth, element counts, and the rest.
7
+ *
8
+ * A caller may LOWER any of these but never raise or disable one — an override of `Infinity`,
9
+ * zero, a negative or `NaN` clamps into `(0, ceiling]` rather than turning the limit off. These
10
+ * are security ceilings, not performance budgets.
11
+ */
12
+ interface ResourceLimits {
13
+ /** Max nested-structure recursion (tables/shapes/SDT/groups). */
14
+ readonly maxRecursionDepth: number;
15
+ /** Max total parsed element count. */
16
+ readonly maxElementCount: number;
17
+ /** Max package part count. */
18
+ readonly maxPartCount: number;
19
+ /** Max total decompressed bytes (zip-bomb guard). */
20
+ readonly maxDecompressedBytes: number;
21
+ /** Max total compressed input bytes. */
22
+ readonly maxCompressedBytes: number;
23
+ /** Max decompressed:compressed ratio per entry. */
24
+ readonly maxCompressionRatio: number;
25
+ /** In-memory chunk budget for streaming/spooling. */
26
+ readonly maxChunkBytes: number;
27
+ /** Max pagination passes before non-convergence is declared. */
28
+ readonly maxPaginationPasses: number;
29
+ /** Max queued items in any bounded work queue. */
30
+ readonly maxQueueDepth: number;
31
+ }
32
+ /** Finite defaults, all <= their hard ceiling. */
33
+ declare const DEFAULT_LIMITS: ResourceLimits;
34
+ /**
35
+ * Resolve caller overrides into a frozen, always-finite limit set. Each value is
36
+ * `min(override>0 ? override : default, ceiling)`. Infinity/0/negative/NaN can
37
+ * never disable a limit — the hard ceiling always wins.
38
+ */
39
+ declare function resolveLimits(overrides?: Partial<ResourceLimits>): ResourceLimits;
40
+
41
+ /** A cell position: 0-based row and column indexes inside the grid. */
42
+ interface CellAddress {
43
+ readonly row: number;
44
+ readonly col: number;
45
+ }
46
+ /** The last row of the grid, 1-based. */
47
+ declare const MAX_ROWS = 1048576;
48
+ /** The last column of the grid, 1-based (`XFD`). */
49
+ declare const MAX_COLS = 16384;
50
+ /** A 1-based column number from its letters (`A` is 1), or 0 when they are not a column. */
51
+ declare function columnNumber(letters: string): number;
52
+ /** The letters of a 1-based column number. Throws outside the grid. */
53
+ declare function columnLetters(column: number): string;
54
+ /**
55
+ * Parse an uppercase A1 reference (`B7`) to a 0-based address, or `null` when it is not a cell
56
+ * reference inside the grid. `$` markers are not accepted: cell `@r` values never hold them.
57
+ */
58
+ declare function parseCellRef(ref: string): CellAddress | null;
59
+ /** The A1 reference of a 0-based address. Throws outside the grid. */
60
+ declare function formatCellRef(address: CellAddress): string;
61
+
62
+ /**
63
+ * A range of cells as its 0-based, inclusive bounds: top row, left column, bottom row, and right
64
+ * column. The store exports take and return ranges in this one shape.
65
+ */
66
+ type RangeBox = readonly [top: number, left: number, bottom: number, right: number];
67
+ /** The 0-based bounds of `A1` or `A1:C3`, in any corner order, or undefined. */
68
+ declare function rangeBounds(ref: string): RangeBox | undefined;
69
+ /**
70
+ * Why a clear of the values in `box` of a worksheet is refused for a child of a cell, or
71
+ * undefined (`cellChildBlocker`). It reads each cell that holds a value in any form: one that
72
+ * the clear removes, and one in a child that the clear can neither keep nor replace, such as a
73
+ * formula in `mc:AlternateContent`. A cell with no value in any form is not read, so a clear
74
+ * never refuses a cell that it leaves as it is.
75
+ */
76
+ declare function clearBlocker(part: XmlPart, sheet: string, box: RangeBox): OpRejection | undefined;
77
+ /**
78
+ * The first cell in `box` of a worksheet that holds its value only in `mc:AlternateContent`
79
+ * (`holdsAlternateValue`), as a cell reference, or undefined. The copy reads the direct value
80
+ * content of a cell, so a cut of that cell would copy nothing and the clear of its paste would
81
+ * remove the value: the editor refuses such a cut with `cut-wrapped-value`.
82
+ */
83
+ declare function wrappedValueCell(part: XmlPart, box: RangeBox): string | undefined;
84
+ /**
85
+ * Why a clear of the values of `box` must be refused before it changes a cell, or undefined. It
86
+ * runs the checks of `clearRange` in its order: a cell that the clear can neither keep nor
87
+ * replace (`clearBlocker`, `cell-alternate-content`); an array or data table range that the box
88
+ * meets; a formula range master inside `mc:AlternateContent`; and a shared master that cannot
89
+ * unshare (`shared-formula`). The clear state of the toolbar reads it, so Clear contents and
90
+ * Clear all are disabled with the reason of the refusal. Only the move of a child's references
91
+ * out of the grid is checked at the clear alone. The master cells are found once for each
92
+ * revision of the sheet. Each call filters them by the box, so its cost grows with the number
93
+ * of masters in the sheet, not with the size of the box.
94
+ */
95
+ declare function clearRangeBlocker(part: XmlPart, sheet: string, box: RangeBox): OpRejection | undefined;
96
+
97
+ /** The most cells that one format command creates: one whole row. */
98
+ declare const MAX_FORMAT_NEW_CELLS = 16384;
99
+ /**
100
+ * The cells that a format patch of a range would create beyond `MAX_FORMAT_NEW_CELLS`, or
101
+ * null when it creates at most that many. The range is `[top, bottom]` by `[left, right]`, 0-based
102
+ * and inclusive. The count is the area of the range less the cells that exist in it. It is
103
+ * counted from the cells that exist, never by walking the range, and not at all when the range
104
+ * is small enough or so large that even every cell of the sheet inside it would leave too many
105
+ * (then `least` is true and `count` is a lower bound). The toolbar state and the command read
106
+ * this one function, so they refuse the same ranges.
107
+ */
108
+ declare function formatRangeOverflow(index: SheetIndex, [top, left, bottom, right]: RangeBox): {
109
+ readonly count: number;
110
+ readonly least: boolean;
111
+ } | null;
112
+ /**
113
+ * The `s="0"` cells that clearing the formats of a range creates, when they are more than
114
+ * `MAX_FORMAT_NEW_CELLS`, or null. The range is 0-based and inclusive. A range no larger than
115
+ * the limit returns null at once. The toolbar state and the command read this one count, so they
116
+ * refuse the same ranges.
117
+ */
118
+ declare function clearFormatsOverflow(root: Element, index: SheetIndex, box: RangeBox): number | null;
119
+
120
+ /**
121
+ * The widest column, in characters: this editor's limit. The schema types `x:col/@width` as a
122
+ * double with no bound (`sml.xsd`); `axis-size.test.ts` keeps the limit.
123
+ *
124
+ * @public
125
+ */
126
+ declare const MAX_COLUMN_WIDTH = 255;
127
+ /**
128
+ * The tallest row, in points: this editor's limit. The schema types `x:row/@ht` as a double
129
+ * with no bound (`sml.xsd`); `axis-size.test.ts` keeps the limit.
130
+ *
131
+ * @public
132
+ */
133
+ declare const MAX_ROW_HEIGHT = 409;
134
+ /**
135
+ * The most `x:row` elements that one `setRowHeight` creates: as many as one format command.
136
+ *
137
+ * @public
138
+ */
139
+ declare const MAX_RESIZE_NEW_ROWS = 16384;
140
+
141
+ /**
142
+ * What the protection of a worksheet allows (`x:sheetProtection`, ECMA-376 Part 1, 18.3.1.85).
143
+ * True means allowed. Each field is the opposite of its attribute in the file, where true means
144
+ * locked and the default is true, so a protection that states nothing allows none of them.
145
+ *
146
+ * @public
147
+ */
148
+ interface SheetProtection {
149
+ /**
150
+ * Format edits on any cell (`applyFormat`, `clearFormats`, `setCellFormatIndex`, and the
151
+ * formats of a paste): `@formatCells` is false. Otherwise they are refused with `locked`.
152
+ */
153
+ readonly allowFormatCells: boolean;
154
+ /**
155
+ * Setting the width of columns (`setColumnWidth`, `setColumnWidths`, a resize drag, a fit):
156
+ * `@formatColumns` is false. Otherwise it is refused with `locked`.
157
+ */
158
+ readonly allowFormatColumns: boolean;
159
+ /**
160
+ * Setting the height of rows (`setRowHeight`, `setFittedRowHeights`, a resize drag, a fit):
161
+ * `@formatRows` is false. Otherwise it is refused with `locked`.
162
+ */
163
+ readonly allowFormatRows: boolean;
164
+ /** Inserting whole rows: `@insertRows` is false. */
165
+ readonly allowInsertRows: boolean;
166
+ /** Deleting whole rows, locked cells included: `@deleteRows` is false. */
167
+ readonly allowDeleteRows: boolean;
168
+ /** Inserting whole columns: `@insertColumns` is false. */
169
+ readonly allowInsertColumns: boolean;
170
+ /** Deleting whole columns, locked cells included: `@deleteColumns` is false. */
171
+ readonly allowDeleteColumns: boolean;
172
+ }
173
+ /**
174
+ * What the protection of a workbook allows (`x:workbookProtection`, ECMA-376 Part 1, 18.2.29).
175
+ * True means allowed.
176
+ *
177
+ * @public
178
+ */
179
+ interface WorkbookProtection {
180
+ /**
181
+ * Adding, renaming, deleting, and moving sheets (`addSheet`, `renameSheet`, `deleteSheet`,
182
+ * `moveSheet`, and the sheet tabs): `@lockStructure` is not true. Otherwise they are refused
183
+ * with `locked`, and the lock rule is `workbook`.
184
+ */
185
+ readonly allowStructure: boolean;
186
+ }
187
+ /** What the protection of a workbook allows, or null when it has no `x:workbookProtection`. */
188
+ declare function readWorkbookProtection(pkg: XlsxPackage, index: WorkbookIndex): WorkbookProtection | null;
189
+ /** The field of `SheetProtection` that allows each structural op. */
190
+ declare const STRUCTURE_PERMIT: Readonly<Record<StructuralOpName, keyof SheetProtection>>;
191
+ /** What the protection of a worksheet allows, or null when `@sheet` is not true. */
192
+ declare function readSheetProtection(root: Element | undefined): SheetProtection | null;
193
+ /**
194
+ * Whether the cell at 0-based `row` and `col` of a worksheet part is locked, whatever the
195
+ * protection of its sheet. The one reader of the cell lock.
196
+ */
197
+ declare function cellLocked(pkg: XlsxPackage, index: WorkbookIndex, part: XmlPart, row: number, col: number): boolean;
198
+ /** The refusal of an op by the protection of its sheet, or null. */
199
+ declare function protectionRefusal(pkg: XlsxPackage, op: WorkbookOp): OpRejection | null;
200
+ /**
201
+ * The first locked cell, as `A1`, that a value edit of the 0-based `box` (top, left, bottom,
202
+ * right) would change, or undefined; the rule of `protectionRefusal`, whatever the protection
203
+ * of the sheet. One cell is the cell or the format that a new cell takes; a range is the cells
204
+ * that exist in it and hold content, never the cells that the range names.
205
+ */
206
+ declare function lockedCellIn(pkg: XlsxPackage, index: WorkbookIndex, part: XmlPart, box: RangeBox): string | undefined;
207
+
208
+ export { DEFAULT_LIMITS as D, MAX_COLS as M, STRUCTURE_PERMIT as S, MAX_COLUMN_WIDTH as a, MAX_FORMAT_NEW_CELLS as b, MAX_RESIZE_NEW_ROWS as c, MAX_ROWS as d, MAX_ROW_HEIGHT as e, cellLocked as h, clearBlocker as i, clearFormatsOverflow as j, clearRangeBlocker as k, columnLetters as l, columnNumber as m, formatCellRef as n, formatRangeOverflow as o, lockedCellIn as p, parseCellRef as q, protectionRefusal as r, rangeBounds as s, readSheetProtection as t, readWorkbookProtection as u, resolveLimits as v, wrappedValueCell as w };
209
+ export type { CellAddress as C, RangeBox as R, WorkbookProtection as W, ResourceLimits as f, SheetProtection as g };