@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
|
@@ -0,0 +1,756 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MAX_MERGES
|
|
3
|
+
} from "./chunk-2ZU4337U.js";
|
|
4
|
+
import {
|
|
5
|
+
EN_US,
|
|
6
|
+
builtinFormatCode,
|
|
7
|
+
cellFormat,
|
|
8
|
+
cellStringItem,
|
|
9
|
+
cellValue,
|
|
10
|
+
dateToSerial,
|
|
11
|
+
formatCodeOf,
|
|
12
|
+
isErrorValue,
|
|
13
|
+
stringItemHidesText
|
|
14
|
+
} from "./chunk-PRHLYXHL.js";
|
|
15
|
+
import {
|
|
16
|
+
MAX_CELL_TEXT,
|
|
17
|
+
WorkbookDocumentStore,
|
|
18
|
+
applyOps,
|
|
19
|
+
arrayFormulaIn,
|
|
20
|
+
arrayRangeCount,
|
|
21
|
+
cellChildBlocker,
|
|
22
|
+
cellKey,
|
|
23
|
+
columnFormatAt,
|
|
24
|
+
formatIndex,
|
|
25
|
+
holdsWrappedValue,
|
|
26
|
+
lockReader,
|
|
27
|
+
lowerNumberFormat,
|
|
28
|
+
mergedBoxesMeeting,
|
|
29
|
+
mergedRangeCount,
|
|
30
|
+
protectionRefusal,
|
|
31
|
+
readSheetProtection,
|
|
32
|
+
rowFormat,
|
|
33
|
+
saveXlsx,
|
|
34
|
+
sharedStringIndices,
|
|
35
|
+
sheetIndex
|
|
36
|
+
} from "./chunk-44L37ENZ.js";
|
|
37
|
+
import {
|
|
38
|
+
MAX_COLS,
|
|
39
|
+
MAX_ROWS,
|
|
40
|
+
attr,
|
|
41
|
+
cellHasFormula,
|
|
42
|
+
formatCellRef,
|
|
43
|
+
parseCellRef,
|
|
44
|
+
readXlsx,
|
|
45
|
+
sheetsByKey,
|
|
46
|
+
workbookIndex,
|
|
47
|
+
xmlPartOf
|
|
48
|
+
} from "./chunk-2DLJYRJC.js";
|
|
49
|
+
|
|
50
|
+
// src/automation/format-commands.ts
|
|
51
|
+
function formatOps(sheet, ref2, patch) {
|
|
52
|
+
const lowered = lowerNumberFormat(patch);
|
|
53
|
+
if ("problem" in lowered)
|
|
54
|
+
return { ok: false, rejection: { code: "unreadable-number-format", detail: lowered.problem } };
|
|
55
|
+
return { ok: true, ops: [{ op: "applyFormat", sheet, ref: ref2, patch }] };
|
|
56
|
+
}
|
|
57
|
+
function clearOps(sheet, ref2, kind) {
|
|
58
|
+
const values = { op: "clearValues", sheet, ref: ref2 };
|
|
59
|
+
const formats = { op: "clearFormats", sheet, ref: ref2 };
|
|
60
|
+
return kind === "contents" ? [values] : kind === "formats" ? [formats] : [values, formats];
|
|
61
|
+
}
|
|
62
|
+
function togglePatch(format, which) {
|
|
63
|
+
switch (which) {
|
|
64
|
+
case "bold":
|
|
65
|
+
return { bold: !format.font.bold };
|
|
66
|
+
case "italic":
|
|
67
|
+
return { italic: !format.font.italic };
|
|
68
|
+
case "underline":
|
|
69
|
+
return { underline: format.font.underline === "none" };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/automation/merge-commands.ts
|
|
74
|
+
var ref = (top, left, bottom, right) => `${formatCellRef({ row: top, col: left })}:${formatCellRef({ row: bottom, col: right })}`;
|
|
75
|
+
function mergeOps(sheet, selection, options = {}) {
|
|
76
|
+
const { start, end } = selection.range;
|
|
77
|
+
const range = ref(start.row, start.col, end.row, end.col);
|
|
78
|
+
const ops = [];
|
|
79
|
+
if (options.center)
|
|
80
|
+
ops.push({ op: "applyFormat", sheet, ref: range, patch: { horizontal: "center" } });
|
|
81
|
+
if (options.dropValues) {
|
|
82
|
+
if (end.col > start.col)
|
|
83
|
+
ops.push({
|
|
84
|
+
op: "clearValues",
|
|
85
|
+
sheet,
|
|
86
|
+
ref: ref(start.row, start.col + 1, start.row, end.col)
|
|
87
|
+
});
|
|
88
|
+
if (end.row > start.row)
|
|
89
|
+
ops.push({ op: "clearValues", sheet, ref: ref(start.row + 1, start.col, end.row, end.col) });
|
|
90
|
+
}
|
|
91
|
+
ops.push({ op: "mergeCells", sheet, ref: range });
|
|
92
|
+
return ops;
|
|
93
|
+
}
|
|
94
|
+
function unmergeOp(sheet, selection) {
|
|
95
|
+
const { start, end } = selection.range;
|
|
96
|
+
return { op: "unmergeCells", sheet, ref: ref(start.row, start.col, end.row, end.col) };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// src/automation/structure-commands.ts
|
|
100
|
+
function selectionBand(selection) {
|
|
101
|
+
const { start, end } = selection.range;
|
|
102
|
+
const allCols = start.col === 0 && end.col === MAX_COLS - 1;
|
|
103
|
+
const allRows = start.row === 0 && end.row === MAX_ROWS - 1;
|
|
104
|
+
if (allCols && !allRows) return "rows";
|
|
105
|
+
if (allRows && !allCols) return "columns";
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
function isWholeSheet(selection) {
|
|
109
|
+
const { start, end } = selection.range;
|
|
110
|
+
return start.col === 0 && end.col === MAX_COLS - 1 && start.row === 0 && end.row === MAX_ROWS - 1;
|
|
111
|
+
}
|
|
112
|
+
function structureOp(sheet, selection, name) {
|
|
113
|
+
const rows = name === "insertRows" || name === "deleteRows";
|
|
114
|
+
const band = selectionBand(selection);
|
|
115
|
+
const { start, end } = selection.range;
|
|
116
|
+
const active = selection.active;
|
|
117
|
+
const across = rows ? band === "columns" : band === "rows";
|
|
118
|
+
const first = across ? rows ? active.row : active.col : rows ? start.row : start.col;
|
|
119
|
+
const last = across ? first : rows ? end.row : end.col;
|
|
120
|
+
return { op: name, sheet, start: first + 1, count: last - first + 1 };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// src/automation/host-memo.ts
|
|
124
|
+
function readMemo() {
|
|
125
|
+
return {
|
|
126
|
+
sheets: /* @__PURE__ */ new Map(),
|
|
127
|
+
values: /* @__PURE__ */ new Map(),
|
|
128
|
+
styles: /* @__PURE__ */ new Map(),
|
|
129
|
+
rows: /* @__PURE__ */ new Map(),
|
|
130
|
+
codes: /* @__PURE__ */ new Map(),
|
|
131
|
+
guarded: /* @__PURE__ */ new Map(),
|
|
132
|
+
locks: /* @__PURE__ */ new Map()
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
var hostWork = {
|
|
136
|
+
sheets: 0,
|
|
137
|
+
names: 0,
|
|
138
|
+
folds: 0,
|
|
139
|
+
values: 0,
|
|
140
|
+
styles: 0,
|
|
141
|
+
rows: 0,
|
|
142
|
+
codes: 0,
|
|
143
|
+
guarded: 0,
|
|
144
|
+
locks: 0,
|
|
145
|
+
searches: 0
|
|
146
|
+
};
|
|
147
|
+
function memoized(map, key, make) {
|
|
148
|
+
if (map.has(key)) return map.get(key);
|
|
149
|
+
const value = make();
|
|
150
|
+
map.set(key, value);
|
|
151
|
+
return value;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/automation/open-diagnostics.ts
|
|
155
|
+
var ZIP_CODES = {
|
|
156
|
+
"inflate-error": "open.zip-corrupt",
|
|
157
|
+
"overlapping-entries": "open.zip-corrupt",
|
|
158
|
+
"bad-name": "open.zip-invalid-entry-name",
|
|
159
|
+
"too-many-entries": "open.zip-entry-limit",
|
|
160
|
+
"invalid-limits": "open.invalid-limits"
|
|
161
|
+
};
|
|
162
|
+
var XML_CODES = {
|
|
163
|
+
"parse-error": "open.xml-malformed",
|
|
164
|
+
"no-root": "open.xml-malformed",
|
|
165
|
+
"unbound-prefix": "open.xml-malformed",
|
|
166
|
+
"bad-name": "open.xml-malformed",
|
|
167
|
+
"dtd-forbidden": "open.xml-dtd-forbidden",
|
|
168
|
+
"entity-forbidden": "open.xml-dtd-forbidden",
|
|
169
|
+
"too-deep": "open.xml-depth-limit",
|
|
170
|
+
"too-many-elements": "open.xml-element-limit",
|
|
171
|
+
"invalid-limits": "open.invalid-limits"
|
|
172
|
+
};
|
|
173
|
+
var XML_LIMITS = {
|
|
174
|
+
"too-large": "xml.maxBytes",
|
|
175
|
+
"too-many-elements": "xml.maxElements",
|
|
176
|
+
"too-deep": "xml.maxDepth"
|
|
177
|
+
};
|
|
178
|
+
function own(table, key) {
|
|
179
|
+
return Object.hasOwn(table, key) ? table[key] : void 0;
|
|
180
|
+
}
|
|
181
|
+
function xmlLimitOf(reason) {
|
|
182
|
+
return own(XML_LIMITS, reason);
|
|
183
|
+
}
|
|
184
|
+
function openLimitOf(error) {
|
|
185
|
+
if (error.reason === "xml") return xmlLimitOf(error.detail);
|
|
186
|
+
if (error.reason !== "zip") return void 0;
|
|
187
|
+
return error.detail === "too-many-entries" ? "zip.maxEntries" : error.limit;
|
|
188
|
+
}
|
|
189
|
+
function openDiagnosticOf(error) {
|
|
190
|
+
const limit = openLimitOf(error);
|
|
191
|
+
return { code: codeOf(error, limit), ...limit === void 0 ? {} : { limit } };
|
|
192
|
+
}
|
|
193
|
+
function codeOf(error, limit) {
|
|
194
|
+
switch (error.reason) {
|
|
195
|
+
case "no-content-types":
|
|
196
|
+
return "open.content-types-invalid";
|
|
197
|
+
case "not-a-workbook":
|
|
198
|
+
return "open.missing-workbook";
|
|
199
|
+
case "zip":
|
|
200
|
+
case "xml":
|
|
201
|
+
if (error.detail === "too-large") {
|
|
202
|
+
if (limit === "zip.maxRatio") return "open.zip-ratio-limit";
|
|
203
|
+
return limit === "zip.maxTotalBytes" ? "open.zip-size-limit" : "open.xml-part-size-limit";
|
|
204
|
+
}
|
|
205
|
+
return own(error.reason === "zip" ? ZIP_CODES : XML_CODES, error.detail) ?? "open.failed";
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// src/automation/range-address.ts
|
|
210
|
+
var MAX_RANGE_CELLS = 1e5;
|
|
211
|
+
var MAX_ADDRESS_LENGTH = 32;
|
|
212
|
+
var CELL = /^\$?([A-Za-z]{1,3})\$?([0-9]{1,8})$/;
|
|
213
|
+
function cellOf(text) {
|
|
214
|
+
const match = CELL.exec(text);
|
|
215
|
+
if (!match) return null;
|
|
216
|
+
const letters = match[1].toUpperCase();
|
|
217
|
+
let col = 0;
|
|
218
|
+
for (let i = 0; i < letters.length; i += 1) col = col * 26 + (letters.charCodeAt(i) - 64);
|
|
219
|
+
const row = Number(match[2]);
|
|
220
|
+
if (col < 1 || col > MAX_COLS || row < 1 || row > MAX_ROWS) return void 0;
|
|
221
|
+
return { row: row - 1, col: col - 1 };
|
|
222
|
+
}
|
|
223
|
+
function parseRangeAddress(address) {
|
|
224
|
+
if (typeof address !== "string" || address.length === 0)
|
|
225
|
+
return { ok: false, code: "invalid-argument" };
|
|
226
|
+
if (address.length > MAX_ADDRESS_LENGTH) return { ok: false, code: "unsupported" };
|
|
227
|
+
const parts = address.split(":");
|
|
228
|
+
if (parts.length > 2) return { ok: false, code: "unsupported" };
|
|
229
|
+
const first = cellOf(parts[0]);
|
|
230
|
+
const last = parts.length === 2 ? cellOf(parts[1]) : first;
|
|
231
|
+
if (first === null || last === null) return { ok: false, code: "unsupported" };
|
|
232
|
+
if (first === void 0 || last === void 0) return { ok: false, code: "invalid-argument" };
|
|
233
|
+
return {
|
|
234
|
+
ok: true,
|
|
235
|
+
bounds: {
|
|
236
|
+
top: Math.min(first.row, last.row),
|
|
237
|
+
left: Math.min(first.col, last.col),
|
|
238
|
+
bottom: Math.max(first.row, last.row),
|
|
239
|
+
right: Math.max(first.col, last.col)
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function boundsCells(bounds) {
|
|
244
|
+
return (bounds.bottom - bounds.top + 1) * (bounds.right - bounds.left + 1);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// src/automation/host.ts
|
|
248
|
+
var MAX_BATCH_OPERATIONS = 1e4;
|
|
249
|
+
var MAX_BATCH_CELLS = 1e6;
|
|
250
|
+
var MAX_BATCH_WRITE_CELLS = 1e4;
|
|
251
|
+
var MAX_BATCH_MERGE_CHECKS = 5e7;
|
|
252
|
+
var MAX_BATCH_LISTED_WORKSHEETS = 1e5;
|
|
253
|
+
var MAX_ARRAY_RANGES = 1e4;
|
|
254
|
+
var MAX_CELL_CHILDREN = 1e3;
|
|
255
|
+
var Refusal = class {
|
|
256
|
+
constructor(error) {
|
|
257
|
+
this.error = error;
|
|
258
|
+
}
|
|
259
|
+
error;
|
|
260
|
+
};
|
|
261
|
+
function automationError(code, message, detail, cell) {
|
|
262
|
+
return Object.freeze({
|
|
263
|
+
code,
|
|
264
|
+
message,
|
|
265
|
+
...detail === void 0 ? {} : { detail },
|
|
266
|
+
...cell === void 0 ? {} : { cell }
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function refuseWith(code, message, detail, cell) {
|
|
270
|
+
throw new Refusal(automationError(code, message, detail, cell));
|
|
271
|
+
}
|
|
272
|
+
var SKIPPED = Object.freeze({ status: "skipped" });
|
|
273
|
+
function refused(count, index, error, revision) {
|
|
274
|
+
const results = [];
|
|
275
|
+
for (let at = 0; at < count; at += 1)
|
|
276
|
+
results.push(at === index ? { status: "error", error } : SKIPPED);
|
|
277
|
+
return { ok: false, results, revision, changed: false };
|
|
278
|
+
}
|
|
279
|
+
function openingWorksheet(index) {
|
|
280
|
+
const ok = (at) => {
|
|
281
|
+
const s = index.sheets[at];
|
|
282
|
+
return !!s && s.state === "visible" && s.kind === "worksheet";
|
|
283
|
+
};
|
|
284
|
+
if (ok(index.activeTab)) return index.activeTab;
|
|
285
|
+
return index.sheets.findIndex((_, at) => ok(at));
|
|
286
|
+
}
|
|
287
|
+
function push(map, key, value) {
|
|
288
|
+
const list = map.get(key);
|
|
289
|
+
if (list) list.push(value);
|
|
290
|
+
else map.set(key, [value]);
|
|
291
|
+
}
|
|
292
|
+
function worksheetDirectory(index) {
|
|
293
|
+
const reads = [];
|
|
294
|
+
const byId = /* @__PURE__ */ new Map();
|
|
295
|
+
const byName = /* @__PURE__ */ new Map();
|
|
296
|
+
for (const entry of index.sheets) {
|
|
297
|
+
if (entry.kind !== "worksheet" || entry.partName === void 0) continue;
|
|
298
|
+
reads.push(Object.freeze({ id: entry.partName, name: entry.name }));
|
|
299
|
+
if (!byId.has(entry.partName)) byId.set(entry.partName, entry);
|
|
300
|
+
push(byName, entry.name, entry);
|
|
301
|
+
}
|
|
302
|
+
const active = index.sheets[openingWorksheet(index)];
|
|
303
|
+
return {
|
|
304
|
+
index,
|
|
305
|
+
reads: Object.freeze(reads),
|
|
306
|
+
byId,
|
|
307
|
+
byName,
|
|
308
|
+
active: active?.kind === "worksheet" && active.partName !== void 0 ? active : void 0,
|
|
309
|
+
found: /* @__PURE__ */ new Map()
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
var isWorksheet = (entry) => entry.kind === "worksheet" && entry.partName !== void 0;
|
|
313
|
+
function worksheetOf(directory, selector) {
|
|
314
|
+
const s = typeof selector === "object" && selector !== null ? selector : {};
|
|
315
|
+
if (Object.keys(s).length === 1) {
|
|
316
|
+
if (typeof s.id === "string")
|
|
317
|
+
return directory.byId.get(s.id) ?? refuseWith("item-not-found", "the workbook no longer holds the worksheet", "gone");
|
|
318
|
+
if (typeof s.name === "string") {
|
|
319
|
+
const name = s.name;
|
|
320
|
+
const found = memoized(directory.found, name, () => {
|
|
321
|
+
hostWork.names += 1;
|
|
322
|
+
const exact = directory.byName.get(name) ?? [];
|
|
323
|
+
if (exact.length === 1) return exact[0];
|
|
324
|
+
hostWork.folds += 1;
|
|
325
|
+
const matches = sheetsByKey(directory.index, name).filter(isWorksheet);
|
|
326
|
+
const list = matches.length === 1 ? matches : exact;
|
|
327
|
+
return list.length === 1 ? list[0] : void 0;
|
|
328
|
+
});
|
|
329
|
+
return found ?? refuseWith("item-not-found", "the workbook has no worksheet of that name", "name");
|
|
330
|
+
}
|
|
331
|
+
if (s.active === true)
|
|
332
|
+
return directory.active ?? refuseWith("item-not-found", "the workbook has no active worksheet", "no-active");
|
|
333
|
+
}
|
|
334
|
+
return refuseWith("invalid-argument", "a selector has one of id, name, or active", "sheet");
|
|
335
|
+
}
|
|
336
|
+
function boundsOf(address) {
|
|
337
|
+
const parsed = parseRangeAddress(address);
|
|
338
|
+
if (!parsed.ok) refuseWith(parsed.code, "the address is not in the subset", "address");
|
|
339
|
+
if (boundsCells(parsed.bounds) > MAX_RANGE_CELLS)
|
|
340
|
+
refuseWith("resource-limit", "the range has too many cells", "range-cells");
|
|
341
|
+
return parsed.bounds;
|
|
342
|
+
}
|
|
343
|
+
function addressSheetText(name) {
|
|
344
|
+
const plain = /^[\p{L}_][\p{L}\p{N}_]*$/u.test(name) && !/^[A-Za-z]{1,3}[0-9]+$/.test(name) && !/^[Rr][0-9]*(?:[Cc][0-9]*)?$/.test(name) && !/^[Cc][0-9]*$/.test(name) && !/^(?:true|false)$/i.test(name);
|
|
345
|
+
return plain ? `${name}!` : `'${name.replace(/'/g, "''")}'!`;
|
|
346
|
+
}
|
|
347
|
+
function addressText(entry, bounds, memo) {
|
|
348
|
+
const first = formatCellRef({ row: bounds.top, col: bounds.left });
|
|
349
|
+
const last = formatCellRef({ row: bounds.bottom, col: bounds.right });
|
|
350
|
+
const sheet = memoized(memo.sheets, entry, () => {
|
|
351
|
+
hostWork.sheets += 1;
|
|
352
|
+
return addressSheetText(entry.name);
|
|
353
|
+
});
|
|
354
|
+
return `${sheet}${first === last ? first : `${first}:${last}`}`;
|
|
355
|
+
}
|
|
356
|
+
function worksheetPart(pkg, entry) {
|
|
357
|
+
const part = xmlPartOf(pkg, entry.partName);
|
|
358
|
+
const sheet = part ? sheetIndex(part) : void 0;
|
|
359
|
+
if (!part || !sheet || sheet.problems.length > 0 || !sheet.sheetData)
|
|
360
|
+
refuseWith("unsupported", "the worksheet cannot be read", "unreadable-sheet");
|
|
361
|
+
return { part, sheet };
|
|
362
|
+
}
|
|
363
|
+
function checkArrayRanges(part, bounds) {
|
|
364
|
+
const count = arrayRangeCount(part);
|
|
365
|
+
if (count.unreadable > 0 || count.all > MAX_ARRAY_RANGES)
|
|
366
|
+
refuseWith("unsupported", "the formula ranges of the worksheet are unknown", "formula-ranges");
|
|
367
|
+
const range = arrayFormulaIn(part, bounds.top, bounds.left, bounds.bottom, bounds.right);
|
|
368
|
+
if (range !== void 0) {
|
|
369
|
+
const ref2 = firstCell(range, bounds);
|
|
370
|
+
refuseWith("unsupported", "a cell holds a formula result", "formula-cell", ref2);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
function firstCell(range, bounds) {
|
|
374
|
+
const at = parseCellRef(range.split(":")[0]);
|
|
375
|
+
if (!at) return void 0;
|
|
376
|
+
return formatCellRef({ row: Math.max(at.row, bounds.top), col: Math.max(at.col, bounds.left) });
|
|
377
|
+
}
|
|
378
|
+
function plainValue(value, index, cell) {
|
|
379
|
+
switch (value.kind) {
|
|
380
|
+
case "empty":
|
|
381
|
+
return "";
|
|
382
|
+
case "number":
|
|
383
|
+
case "boolean":
|
|
384
|
+
return value.value;
|
|
385
|
+
case "string":
|
|
386
|
+
return value.text;
|
|
387
|
+
case "error":
|
|
388
|
+
return isErrorValue(value.code) ? value.code : refuseWith("unsupported", "a stored value cannot be read", "unreadable-value", cell);
|
|
389
|
+
case "date":
|
|
390
|
+
return dateToSerial(value.iso, index.date1904) ?? refuseWith("unsupported", "a stored date cannot be read", "unreadable-value", cell);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
var FORMAT_PROBLEMS = /* @__PURE__ */ new Set([
|
|
394
|
+
"cell-format-out-of-range",
|
|
395
|
+
"number-format-id-malformed"
|
|
396
|
+
]);
|
|
397
|
+
function formatAt(pkg, index, memo, s, row, col) {
|
|
398
|
+
const code = memoized(memo.codes, s, () => {
|
|
399
|
+
hostWork.codes += 1;
|
|
400
|
+
const { format, problems } = cellFormat(pkg, index, s);
|
|
401
|
+
return problems.some((problem) => FORMAT_PROBLEMS.has(problem.code)) ? void 0 : format.formatCode === void 0 && format.numFmtId !== 0 ? builtinFormatCode(format.numFmtId, EN_US) : formatCodeOf(format, EN_US);
|
|
402
|
+
});
|
|
403
|
+
if (code === void 0) {
|
|
404
|
+
const ref2 = formatCellRef({ row, col });
|
|
405
|
+
refuseWith("unsupported", "a number format cannot be read", "unreadable-format", ref2);
|
|
406
|
+
}
|
|
407
|
+
return code;
|
|
408
|
+
}
|
|
409
|
+
function valueOf(pkg, index, el, ref2) {
|
|
410
|
+
hostWork.values += 1;
|
|
411
|
+
if (el.children.length > MAX_CELL_CHILDREN)
|
|
412
|
+
refuseWith("resource-limit", "a cell holds too many elements", "cell-children", ref2);
|
|
413
|
+
if (holdsWrappedValue(el))
|
|
414
|
+
refuseWith("unsupported", "a stored value cannot be read", "unreadable-value", ref2);
|
|
415
|
+
const resolved = cellValue(pkg, index, el, false);
|
|
416
|
+
if (resolved.formula)
|
|
417
|
+
refuseWith("unsupported", "a cell holds a formula result", "formula-cell", ref2);
|
|
418
|
+
if (resolved.problem)
|
|
419
|
+
refuseWith("unsupported", "a stored value cannot be read", "unreadable-value", ref2);
|
|
420
|
+
if (stringItemHidesText(cellStringItem(pkg, index, el)))
|
|
421
|
+
refuseWith("unsupported", "a stored value cannot be read", "unreadable-value", ref2);
|
|
422
|
+
return plainValue(resolved.value, index, ref2);
|
|
423
|
+
}
|
|
424
|
+
function readRange(pkg, index, entry, bounds, want, memo) {
|
|
425
|
+
const address = addressText(entry, bounds, memo);
|
|
426
|
+
if (!want.values && !want.numberFormat) return Object.freeze({ address });
|
|
427
|
+
const { part, sheet } = worksheetPart(pkg, entry);
|
|
428
|
+
if (want.values) checkArrayRanges(part, bounds);
|
|
429
|
+
const values = [];
|
|
430
|
+
const formats = [];
|
|
431
|
+
for (let row = bounds.top; row <= bounds.bottom; row += 1) {
|
|
432
|
+
const valueRow = [];
|
|
433
|
+
const formatRow = [];
|
|
434
|
+
const rowEl = want.numberFormat ? sheet.rows.get(row) : void 0;
|
|
435
|
+
const rowStyle = rowEl ? memoized(memo.rows, rowEl, () => {
|
|
436
|
+
hostWork.rows += 1;
|
|
437
|
+
return rowFormat(rowEl);
|
|
438
|
+
}) : void 0;
|
|
439
|
+
for (let col = bounds.left; col <= bounds.right; col += 1) {
|
|
440
|
+
const el = sheet.cells.get(cellKey(row, col))?.el;
|
|
441
|
+
if (want.values)
|
|
442
|
+
valueRow.push(
|
|
443
|
+
el ? memoized(memo.values, el, () => valueOf(pkg, index, el, formatCellRef({ row, col }))) : ""
|
|
444
|
+
);
|
|
445
|
+
if (want.numberFormat) {
|
|
446
|
+
const s = el ? memoized(memo.styles, el, () => {
|
|
447
|
+
hostWork.styles += 1;
|
|
448
|
+
return attr(el, "s");
|
|
449
|
+
}) : String(rowStyle ?? columnFormatAt(sheet.root, col) ?? 0);
|
|
450
|
+
formatRow.push(formatAt(pkg, index, memo, s, row, col));
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if (want.values) values.push(valueRow);
|
|
454
|
+
if (want.numberFormat) formats.push(formatRow);
|
|
455
|
+
}
|
|
456
|
+
return Object.freeze({
|
|
457
|
+
address,
|
|
458
|
+
...want.values ? { values } : {},
|
|
459
|
+
...want.numberFormat ? { numberFormat: formats } : {}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
function cellWrite(value) {
|
|
463
|
+
if (value === null) return null;
|
|
464
|
+
const v = typeof value === "object" ? value : {};
|
|
465
|
+
if (v.type === "number" && typeof v.value === "number" && Number.isFinite(v.value))
|
|
466
|
+
return { type: "number", value: v.value };
|
|
467
|
+
if (v.type === "string" && typeof v.value === "string") return { type: "string", value: v.value };
|
|
468
|
+
if (v.type === "boolean" && typeof v.value === "boolean")
|
|
469
|
+
return { type: "boolean", value: v.value };
|
|
470
|
+
if (v.type === "empty") return { type: "empty" };
|
|
471
|
+
return refuseWith("invalid-argument", "a cell write this protocol does not define", "values");
|
|
472
|
+
}
|
|
473
|
+
function storesValue(value) {
|
|
474
|
+
const write = cellWrite(value);
|
|
475
|
+
return write !== null && write.type !== "empty";
|
|
476
|
+
}
|
|
477
|
+
function checkMergedCells(merges, bounds, grid) {
|
|
478
|
+
const rows = bounds.bottom - bounds.top + 1;
|
|
479
|
+
const cols = bounds.right - bounds.left + 1;
|
|
480
|
+
const width = cols + 1;
|
|
481
|
+
const sum = new Uint32Array((rows + 1) * width);
|
|
482
|
+
for (let r = 0; r < rows; r += 1)
|
|
483
|
+
for (let c = 0; c < cols; c += 1)
|
|
484
|
+
sum[(r + 1) * width + c + 1] = (storesValue(grid[r][c]) ? 1 : 0) + sum[r * width + c + 1] + sum[(r + 1) * width + c] - sum[r * width + c];
|
|
485
|
+
const at = (r, c) => sum[r * width + c];
|
|
486
|
+
for (const [mergeTop, mergeLeft, mergeBottom, mergeRight] of merges) {
|
|
487
|
+
const top = Math.max(mergeTop, bounds.top) - bounds.top;
|
|
488
|
+
const left = Math.max(mergeLeft, bounds.left) - bounds.left;
|
|
489
|
+
const bottom = Math.min(mergeBottom, bounds.bottom) - bounds.top;
|
|
490
|
+
const right = Math.min(mergeRight, bounds.right) - bounds.left;
|
|
491
|
+
const anchor = mergeTop === bounds.top + top && mergeLeft === bounds.left + left;
|
|
492
|
+
const stored = at(bottom + 1, right + 1) - at(top, right + 1) - at(bottom + 1, left) + at(top, left);
|
|
493
|
+
if (stored - (anchor && storesValue(grid[top][left]) ? 1 : 0) === 0) continue;
|
|
494
|
+
for (let r = top; r <= bottom; r += 1)
|
|
495
|
+
for (let c = left; c <= right; c += 1)
|
|
496
|
+
if (!(anchor && r === top && c === left) && storesValue(grid[r][c])) {
|
|
497
|
+
const ref2 = formatCellRef({ row: bounds.top + r, col: bounds.left + c });
|
|
498
|
+
refuseWith("unsupported", "a merged range hides the cell", "merged-cell", ref2);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function writeOps(pkg, index, entry, bounds, grid, budget) {
|
|
503
|
+
const rows = bounds.bottom - bounds.top + 1;
|
|
504
|
+
const cols = bounds.right - bounds.left + 1;
|
|
505
|
+
if (!Array.isArray(grid) || grid.length !== rows || grid.some((r) => !Array.isArray(r) || r.length !== cols))
|
|
506
|
+
refuseWith("invalid-argument", "values need the rows and columns of the range", "values");
|
|
507
|
+
const { part, sheet } = worksheetPart(pkg, entry);
|
|
508
|
+
checkArrayRanges(part, bounds);
|
|
509
|
+
const mergeCount = mergedRangeCount(part.root);
|
|
510
|
+
if (mergeCount > MAX_MERGES)
|
|
511
|
+
refuseWith("resource-limit", "the worksheet has too many merged ranges", "merged-ranges");
|
|
512
|
+
budget.mergeChecks += mergeCount;
|
|
513
|
+
if (budget.mergeChecks > MAX_BATCH_MERGE_CHECKS)
|
|
514
|
+
refuseWith(
|
|
515
|
+
"resource-limit",
|
|
516
|
+
"the writes of the batch meet too many merged ranges",
|
|
517
|
+
"merge-checks"
|
|
518
|
+
);
|
|
519
|
+
const box = [bounds.top, bounds.left, bounds.bottom, bounds.right];
|
|
520
|
+
const merges = mergedBoxesMeeting(part.root, box);
|
|
521
|
+
if (merges.length > 0) checkMergedCells(merges, bounds, grid);
|
|
522
|
+
const ops = [];
|
|
523
|
+
const guarded = memoized(budget.reads.guarded, part.root, () => {
|
|
524
|
+
hostWork.guarded += 1;
|
|
525
|
+
return readSheetProtection(part.root) !== null;
|
|
526
|
+
});
|
|
527
|
+
for (let r = 0; r < rows; r += 1)
|
|
528
|
+
for (let c = 0; c < cols; c += 1) {
|
|
529
|
+
const write = cellWrite(grid[r][c]);
|
|
530
|
+
if (write === null) continue;
|
|
531
|
+
const at = { row: bounds.top + r, col: bounds.left + c };
|
|
532
|
+
const ref2 = formatCellRef(at);
|
|
533
|
+
const cell = sheet.cells.get(cellKey(at.row, at.col));
|
|
534
|
+
if (cell && cell.el.children.length > MAX_CELL_CHILDREN)
|
|
535
|
+
refuseWith("resource-limit", "a cell holds too many elements", "cell-children", ref2);
|
|
536
|
+
if (cell && cellHasFormula(cell.el))
|
|
537
|
+
refuseWith("unsupported", "a cell holds a formula", "formula-cell", ref2);
|
|
538
|
+
if (write.type === "string" && write.value.length > MAX_CELL_TEXT)
|
|
539
|
+
refuseWith("transaction-refused", "the text is too long for a cell", "text-too-long", ref2);
|
|
540
|
+
const blocker = cell && cellChildBlocker(entry.name, ref2, cell.el);
|
|
541
|
+
if (blocker)
|
|
542
|
+
refuseWith("transaction-refused", "the store refused the edit", blocker.code, ref2);
|
|
543
|
+
if (guarded && cellLocked(pkg, index, sheet, at.row, at.col, cell?.el, budget.reads))
|
|
544
|
+
refuseWith("transaction-refused", "the cell is locked", "locked", ref2);
|
|
545
|
+
ops.push({ op: "setCellValue", sheet: entry.name, ref: ref2, value: write });
|
|
546
|
+
}
|
|
547
|
+
return ops;
|
|
548
|
+
}
|
|
549
|
+
function cellLocked(pkg, index, sheet, row, col, el, memo) {
|
|
550
|
+
let s;
|
|
551
|
+
if (el) {
|
|
552
|
+
const text = memoized(memo.styles, el, () => {
|
|
553
|
+
hostWork.styles += 1;
|
|
554
|
+
return attr(el, "s");
|
|
555
|
+
});
|
|
556
|
+
s = formatIndex(text) ?? 0;
|
|
557
|
+
} else {
|
|
558
|
+
const rowEl = sheet.rows.get(row);
|
|
559
|
+
const rowStyle = rowEl ? memoized(memo.rows, rowEl, () => {
|
|
560
|
+
hostWork.rows += 1;
|
|
561
|
+
return rowFormat(rowEl);
|
|
562
|
+
}) : void 0;
|
|
563
|
+
s = rowStyle ?? columnFormatAt(sheet.root, col) ?? 0;
|
|
564
|
+
}
|
|
565
|
+
return memoized(memo.locks, s, () => {
|
|
566
|
+
hostWork.locks += 1;
|
|
567
|
+
return (memo.locker ??= lockReader(pkg, index)).locked(s);
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
function textOf(op) {
|
|
571
|
+
return op.op === "setCellValue" && op.value.type === "string" ? [op.value.value] : [];
|
|
572
|
+
}
|
|
573
|
+
function spend(budget, bounds, write) {
|
|
574
|
+
budget.cells += boundsCells(bounds);
|
|
575
|
+
if (budget.cells > MAX_BATCH_CELLS)
|
|
576
|
+
refuseWith("resource-limit", "the batch reaches too many cells", "batch-cells");
|
|
577
|
+
if (!write) return;
|
|
578
|
+
budget.writeCells += boundsCells(bounds);
|
|
579
|
+
if (budget.writeCells > MAX_BATCH_WRITE_CELLS)
|
|
580
|
+
refuseWith("resource-limit", "the writes of the batch reach too many cells", "write-cells");
|
|
581
|
+
}
|
|
582
|
+
function plan(operation, pkg, index, directory, budget, written) {
|
|
583
|
+
switch (operation?.op) {
|
|
584
|
+
case "listWorksheets":
|
|
585
|
+
budget.listed += directory.reads.length;
|
|
586
|
+
if (budget.listed > MAX_BATCH_LISTED_WORKSHEETS)
|
|
587
|
+
refuseWith("resource-limit", "the lists give too many worksheets", "batch-worksheets");
|
|
588
|
+
return { value: directory.reads };
|
|
589
|
+
case "getWorksheet": {
|
|
590
|
+
const o = operation;
|
|
591
|
+
try {
|
|
592
|
+
const entry = worksheetOf(directory, o.sheet);
|
|
593
|
+
return { value: Object.freeze({ id: entry.partName, name: entry.name }) };
|
|
594
|
+
} catch (error) {
|
|
595
|
+
if (o.orNull === true && error instanceof Refusal && error.error.code === "item-not-found")
|
|
596
|
+
return { value: null };
|
|
597
|
+
throw error;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
case "readRange": {
|
|
601
|
+
const o = operation;
|
|
602
|
+
const entry = worksheetOf(directory, o.sheet);
|
|
603
|
+
const bounds = boundsOf(o.address);
|
|
604
|
+
const want = { values: o.values === true, numberFormat: o.numberFormat === true };
|
|
605
|
+
if (want.values || want.numberFormat) {
|
|
606
|
+
if (written)
|
|
607
|
+
refuseWith("unsupported", "a read follows a write in the batch", "read-after-write");
|
|
608
|
+
spend(budget, bounds, false);
|
|
609
|
+
}
|
|
610
|
+
return { value: readRange(pkg, index, entry, bounds, want, budget.reads) };
|
|
611
|
+
}
|
|
612
|
+
case "writeValues": {
|
|
613
|
+
const o = operation;
|
|
614
|
+
const named = worksheetOf(directory, o.sheet);
|
|
615
|
+
const entry = directory.byId.get(named.partName ?? "") ?? named;
|
|
616
|
+
const bounds = boundsOf(o.address);
|
|
617
|
+
spend(budget, bounds, true);
|
|
618
|
+
return { value: null, ops: writeOps(pkg, index, entry, bounds, o.values, budget) };
|
|
619
|
+
}
|
|
620
|
+
default:
|
|
621
|
+
return refuseWith("unknown-operation", "this protocol does not define the operation");
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
function bySheet(writes) {
|
|
625
|
+
const groups = /* @__PURE__ */ new Map();
|
|
626
|
+
for (const write of writes)
|
|
627
|
+
for (const op of write.ops) push(groups, "sheet" in op ? op.sheet : "", op);
|
|
628
|
+
return [...groups.values()].flat();
|
|
629
|
+
}
|
|
630
|
+
function firstRefusedWrite(pkg, writes) {
|
|
631
|
+
let low = 0;
|
|
632
|
+
let high = writes.length - 1;
|
|
633
|
+
while (low < high) {
|
|
634
|
+
const middle = low + high >> 1;
|
|
635
|
+
hostWork.searches += 1;
|
|
636
|
+
if (applyOps(pkg, bySheet(writes.slice(0, middle + 1))).ok) low = middle + 1;
|
|
637
|
+
else high = middle;
|
|
638
|
+
}
|
|
639
|
+
return low;
|
|
640
|
+
}
|
|
641
|
+
function lockedCell(pkg, ops) {
|
|
642
|
+
for (const op of ops)
|
|
643
|
+
if (op.op === "setCellValue" && protectionRefusal(pkg, op)?.lock === "cell") return op.ref;
|
|
644
|
+
return void 0;
|
|
645
|
+
}
|
|
646
|
+
function openAutomationHost(bytes) {
|
|
647
|
+
const read = readXlsx(bytes);
|
|
648
|
+
if (read.ok)
|
|
649
|
+
return { ok: true, host: createStoreAutomationHost(new WorkbookDocumentStore(read.pkg)) };
|
|
650
|
+
const { code, limit } = openDiagnosticOf(read.error);
|
|
651
|
+
return limit === void 0 ? { ok: false, code: "invalid-argument", reason: code } : { ok: false, code: "resource-limit", reason: code, limit };
|
|
652
|
+
}
|
|
653
|
+
function createStoreAutomationHost(store) {
|
|
654
|
+
const capabilities = Object.freeze({ document: true, save: true });
|
|
655
|
+
let disposed = false;
|
|
656
|
+
const execute = (request) => {
|
|
657
|
+
const revision = store.revision;
|
|
658
|
+
const operations = request?.operations;
|
|
659
|
+
const count = Array.isArray(operations) ? operations.length : 0;
|
|
660
|
+
const fail = (at, code, message, detail, cell) => refused(Math.max(count, 1), at, automationError(code, message, detail, cell), revision);
|
|
661
|
+
if (disposed) return fail(0, "disposed", "this host was disposed");
|
|
662
|
+
if (!Array.isArray(operations))
|
|
663
|
+
return fail(0, "invalid-argument", "a batch has an array of operations", "operations-list");
|
|
664
|
+
if (count > MAX_BATCH_OPERATIONS)
|
|
665
|
+
return fail(0, "resource-limit", "too many operations", "operations");
|
|
666
|
+
if (count === 0) return { ok: true, results: [], revision, changed: false };
|
|
667
|
+
const expected = request.expectedRevision;
|
|
668
|
+
if (expected !== void 0 && expected !== revision)
|
|
669
|
+
return fail(0, "stale-revision", "the workbook changed after the caller read it");
|
|
670
|
+
const pkg = store.package;
|
|
671
|
+
const index = workbookIndex(pkg);
|
|
672
|
+
if (!index)
|
|
673
|
+
return fail(0, "unsupported", "the package has no workbook part", "unreadable-sheet");
|
|
674
|
+
const directory = worksheetDirectory(index);
|
|
675
|
+
const budget = {
|
|
676
|
+
cells: 0,
|
|
677
|
+
writeCells: 0,
|
|
678
|
+
mergeChecks: 0,
|
|
679
|
+
listed: 0,
|
|
680
|
+
reads: readMemo()
|
|
681
|
+
};
|
|
682
|
+
const writes = [];
|
|
683
|
+
const results = [];
|
|
684
|
+
for (let at = 0; at < count; at += 1) {
|
|
685
|
+
try {
|
|
686
|
+
const planned = plan(operations[at], pkg, index, directory, budget, writes.length > 0);
|
|
687
|
+
if (planned.ops && planned.ops.length > 0) writes.push({ at, ops: planned.ops });
|
|
688
|
+
results.push(Object.freeze({ status: "ok", value: planned.value }));
|
|
689
|
+
} catch (error) {
|
|
690
|
+
if (error instanceof Refusal) return refused(count, at, error.error, revision);
|
|
691
|
+
throw error;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
if (writes.length === 0) return { ok: true, results, revision, changed: false };
|
|
695
|
+
const texts = writes.flatMap((write) => write.ops.flatMap(textOf));
|
|
696
|
+
const table = texts.length > 0 ? sharedStringIndices(pkg, index, texts) : void 0;
|
|
697
|
+
if (table && "code" in table) {
|
|
698
|
+
const at = writes.find((write) => write.ops.some((op) => textOf(op).length > 0)).at;
|
|
699
|
+
return fail(at, "transaction-refused", "the store refused the edit", table.code);
|
|
700
|
+
}
|
|
701
|
+
const before = store.revision;
|
|
702
|
+
const committed = store.transact(bySheet(writes), {
|
|
703
|
+
label: "automation",
|
|
704
|
+
baseRevision: revision
|
|
705
|
+
});
|
|
706
|
+
if (!committed.ok) {
|
|
707
|
+
if (committed.rejection.code === "stale-revision")
|
|
708
|
+
return fail(writes[0].at, "stale-revision", "another writer changed the workbook first");
|
|
709
|
+
const write = writes[firstRefusedWrite(pkg, writes)];
|
|
710
|
+
const code = committed.rejection.code;
|
|
711
|
+
return fail(
|
|
712
|
+
write.at,
|
|
713
|
+
"transaction-refused",
|
|
714
|
+
"the store refused the edit",
|
|
715
|
+
code,
|
|
716
|
+
code === "locked" ? lockedCell(pkg, write.ops) : void 0
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
return { ok: true, results, revision: store.revision, changed: store.revision !== before };
|
|
720
|
+
};
|
|
721
|
+
return {
|
|
722
|
+
capabilities,
|
|
723
|
+
revision: () => store.revision,
|
|
724
|
+
execute,
|
|
725
|
+
save() {
|
|
726
|
+
if (disposed)
|
|
727
|
+
return { ok: false, error: automationError("disposed", "this host was disposed") };
|
|
728
|
+
return { ok: true, bytes: saveXlsx(store.package) };
|
|
729
|
+
},
|
|
730
|
+
dispose() {
|
|
731
|
+
disposed = true;
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
export {
|
|
737
|
+
formatOps,
|
|
738
|
+
clearOps,
|
|
739
|
+
togglePatch,
|
|
740
|
+
mergeOps,
|
|
741
|
+
unmergeOp,
|
|
742
|
+
selectionBand,
|
|
743
|
+
isWholeSheet,
|
|
744
|
+
structureOp,
|
|
745
|
+
xmlLimitOf,
|
|
746
|
+
openLimitOf,
|
|
747
|
+
MAX_RANGE_CELLS,
|
|
748
|
+
MAX_BATCH_OPERATIONS,
|
|
749
|
+
MAX_BATCH_CELLS,
|
|
750
|
+
MAX_BATCH_WRITE_CELLS,
|
|
751
|
+
MAX_BATCH_MERGE_CHECKS,
|
|
752
|
+
MAX_BATCH_LISTED_WORKSHEETS,
|
|
753
|
+
MAX_ARRAY_RANGES,
|
|
754
|
+
MAX_CELL_CHILDREN,
|
|
755
|
+
openAutomationHost
|
|
756
|
+
};
|