@fileverse-dev/dsheet 4.1.23-stabilise-package-8 → 4.1.24
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/README.md +0 -10
- package/dist/editor/contexts/editor-context.d.ts +0 -9
- package/dist/editor/hooks/use-celldata-compaction.d.ts +2 -44
- package/dist/editor/hooks/use-editor-data.d.ts +0 -1
- package/dist/editor/hooks/use-editor-sync.d.ts +1 -5
- package/dist/editor/types.d.ts +1 -41
- package/dist/editor/utils/after-update-cell.d.ts +0 -6
- package/dist/editor/utils/apply-comment-markers.d.ts +1 -3
- package/dist/editor/utils/editor-handle.d.ts +1 -1
- package/dist/editor/utils/remote-apply-guard.d.ts +0 -45
- package/dist/editor/utils/sheet-ydoc-sync-utils.d.ts +4 -13
- package/dist/editor/utils/update-ydoc.d.ts +1 -9
- package/dist/{executeStringFunction-CN6ZZqZM.js → executeStringFunction-B3Tw7e1U.js} +13166 -13690
- package/dist/formula.js +1 -1
- package/dist/{index-Dbl7Dh2_.js → index-DvpQioe4.js} +22321 -23599
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +21 -21
- package/dist/persistence-utils-BXFajzvq.js +98 -0
- package/dist/persistence-utils.d.ts +0 -2
- package/dist/persistence.d.ts +0 -13
- package/dist/persistence.js +74 -122
- package/dist/sheet-engine/core/api/cell.d.ts +1 -25
- package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +0 -1
- package/dist/sheet-engine/core/index.d.ts +1 -1
- package/dist/sheet-engine/core/modules/border.d.ts +0 -9
- package/dist/sheet-engine/core/modules/dataVerification.d.ts +0 -15
- package/dist/sheet-engine/core/modules/formula-arrow-mode.d.ts +81 -0
- package/dist/sheet-engine/core/modules/formula-async-eval.d.ts +0 -5
- package/dist/sheet-engine/core/modules/formula-snapshot-eval.d.ts +0 -2
- package/dist/sheet-engine/core/modules/formula-transitive-deps.d.ts +1 -26
- package/dist/sheet-engine/core/modules/formula.d.ts +33 -88
- package/dist/sheet-engine/core/modules/index.d.ts +3 -4
- package/dist/sheet-engine/core/modules/rowcol.d.ts +0 -8
- package/dist/sheet-engine/core/paste-helpers/calculate-range-cell-size.d.ts +0 -14
- package/dist/sheet-engine/core/settings.d.ts +1 -11
- package/dist/sheet-engine/core/utils/ydoc-celldata-changes.d.ts +2 -29
- package/dist/sheet-engine/react/components/ContextMenu/FilterMenu.d.ts +2 -2
- package/dist/sheet-engine/react/components/ContextMenu/SheetTab.d.ts +2 -2
- package/dist/sheet-engine/react/components/ContextMenu/index.d.ts +2 -2
- package/dist/sheet-engine/react/components/SVGDefines.d.ts +2 -2
- package/dist/sheet-engine/react/components/SheetTab/index.d.ts +2 -2
- package/dist/sheet-engine/react/components/Toolbar/index.d.ts +2 -2
- package/dist/sheet-engine/react/components/Workbook/api.d.ts +0 -4
- package/dist/sheet-engine/react/components/Workbook/index.d.ts +0 -2
- package/dist/sheet-engine/react/context/index.d.ts +0 -15
- package/dist/style.css +1 -1
- package/dist/sync-local/SyncManager.d.ts +2 -2
- package/dist/sync-local/types/index.d.ts +1 -2
- package/dist/{use-xlsx-import-impl-sGRvmOlI.js → use-xlsx-import-impl-DWkIjd5v.js} +119 -120
- package/dist/{xlsx-defined-names-C6c8LJn5.js → xlsx-defined-names-776Vg9GT.js} +2 -2
- package/dist/{xlsx-export-impl-Dno93LqB.js → xlsx-export-impl-C60SB8Ve.js} +4 -4
- package/dist/{xlsx-hyperlink-inline-DjtQMKIL.js → xlsx-hyperlink-inline-DaxgypSu.js} +2 -2
- package/package.json +1 -1
- package/dist/editor/utils/active-sheet-keeper.test.d.ts +0 -1
- package/dist/editor/utils/after-update-cell.test.d.ts +0 -1
- package/dist/editor/utils/apply-comment-markers.test.d.ts +0 -1
- package/dist/editor/utils/calc-chain-ydoc-update.test.d.ts +0 -1
- package/dist/editor/utils/content-change.d.ts +0 -48
- package/dist/editor/utils/content-change.test.d.ts +0 -1
- package/dist/editor/utils/content-fingerprint.d.ts +0 -37
- package/dist/editor/utils/content-fingerprint.test.d.ts +0 -1
- package/dist/editor/utils/format-gate.d.ts +0 -27
- package/dist/editor/utils/format-gate.test.d.ts +0 -1
- package/dist/editor/utils/legacy-on-change.d.ts +0 -20
- package/dist/editor/utils/legacy-on-change.test.d.ts +0 -1
- package/dist/editor/utils/patch-plain-celldata.d.ts +0 -19
- package/dist/editor/utils/patch-plain-celldata.test.d.ts +0 -1
- package/dist/editor/utils/rebuild-indexeddb-store.d.ts +0 -19
- package/dist/editor/utils/rebuild-indexeddb-store.failure.test.d.ts +0 -1
- package/dist/editor/utils/rebuild-indexeddb-store.test.d.ts +0 -1
- package/dist/editor/utils/remote-apply-guard.test.d.ts +0 -1
- package/dist/editor/utils/sheet-ydoc-sync-utils.test.d.ts +0 -1
- package/dist/editor/utils/structural-edit-formula-sync.test.d.ts +0 -1
- package/dist/editor/utils/structural-edit-other-tabs.test.d.ts +0 -1
- package/dist/editor/utils/wait-for-sync.d.ts +0 -35
- package/dist/editor/utils/wait-for-sync.test.d.ts +0 -1
- package/dist/persistence-utils-CSKBobX8.js +0 -151
- package/dist/persistence.append.test.d.ts +0 -1
- package/dist/persistence.fingerprint.test.d.ts +0 -1
- package/dist/sheet-engine/core/api/remote-apply.test.d.ts +0 -1
- package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/b6-ydoc-writes.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/cell-shift.d.ts +0 -11
- package/dist/sheet-engine/core/modules/cell.commit-ydoc.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/engine-hot-spots.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/formula-dep-text.d.ts +0 -23
- package/dist/sheet-engine/core/modules/formula-dep-text.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/formula-edge-update.d.ts +0 -13
- package/dist/sheet-engine/core/modules/formula-narrowing.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/formula-tab-load.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/formula-warmup.d.ts +0 -33
- package/dist/sheet-engine/core/modules/formula-warmup.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/formula.dep-graph.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/formula.str-change.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/formula.wide-seed.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/history-calc-chain.d.ts +0 -39
- package/dist/sheet-engine/core/modules/history-calc-chain.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/history-celldata.d.ts +0 -25
- package/dist/sheet-engine/core/modules/history-grid-size.d.ts +0 -16
- package/dist/sheet-engine/core/modules/history-grid-size.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/rowcol-refused-edit.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/rowcol-unloaded-history.test.d.ts +0 -1
- package/dist/sheet-engine/core/modules/structural-edit-prep.d.ts +0 -36
- package/dist/sheet-engine/core/modules/structural-edit-prep.test.d.ts +0 -1
- package/dist/sheet-engine/core/paste/paste-dep-graph.test.d.ts +0 -1
- package/dist/sheet-engine/core/paste-helpers/calculate-range-cell-size.test.d.ts +0 -1
- package/dist/sheet-engine/react/components/NotationBoxes/shown-comments.d.ts +0 -20
- package/dist/sheet-engine/react/components/NotationBoxes/shown-comments.test.d.ts +0 -1
- package/dist/sheet-engine/react/components/SheetOverlay/editing-as-formula.d.ts +0 -7
- package/dist/sheet-engine/react/components/SheetOverlay/editing-as-formula.test.d.ts +0 -1
- package/dist/sheet-engine/react/components/SheetOverlay/hover-tracker.d.ts +0 -44
- package/dist/sheet-engine/react/components/SheetOverlay/hover-tracker.test.d.ts +0 -1
- package/dist/sheet-engine/react/components/Toolbar/FunctionList/group-functions.d.ts +0 -9
- package/dist/sheet-engine/react/components/Toolbar/FunctionList/group-functions.test.d.ts +0 -1
- package/dist/sheet-engine/react/components/Workbook/denomination-scan.d.ts +0 -16
- package/dist/sheet-engine/react/components/Workbook/denomination-scan.test.d.ts +0 -1
- package/dist/sheet-engine/react/components/Workbook/stable-handle.d.ts +0 -8
- package/dist/sheet-engine/react/components/Workbook/stable-handle.test.d.ts +0 -1
- package/dist/sheet-engine/react/context/use-workbook-store.d.ts +0 -30
- package/dist/sheet-engine/react/context/workbook-store.d.ts +0 -30
- package/dist/sheet-engine/react/context/workbook-store.test.d.ts +0 -1
- package/dist/sync-local/SyncManager.remote-apply.test.d.ts +0 -1
- /package/dist/{editor/hooks/use-celldata-compaction.test.d.ts → sheet-engine/core/modules/formula-arrow-mode.test.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { executeStringFunction } from './editor/utils/executeStringFunction';
|
|
|
5
5
|
export { FLVURL } from '@fileverse-dev/formulajs';
|
|
6
6
|
export { loadLocale } from './sheet-engine/core';
|
|
7
7
|
export type { ErrorMessageHandlerReturnType, DataBlockEvent, DataBlockEventType, ApiKeyStorage, DSheetEditorHandle, DSheetPermissionMode, } from './editor/types';
|
|
8
|
-
export type { PanelConfig, PanelId, BuiltInPanelType
|
|
8
|
+
export type { PanelConfig, PanelId, BuiltInPanelType } from './editor/types';
|
|
9
9
|
export type { CommentThread, CommentReply, CommentActionParams, CommentsConfig, CommentAnchorMove, } from './editor/types/comments';
|
|
10
10
|
export { CommentAction } from './editor/types/comments';
|
|
11
11
|
export { remapCommentAnchors } from './editor/utils/remap-comment-anchors';
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as s,
|
|
2
|
-
import {
|
|
1
|
+
import { C as s, d as o, f as t, S as r, g as l, h as n, j as d, T as S, k as c, l as i, n as m, o as h, p, q as C, t as u, u as E, v as F, w as x, x as g, z as R, A as f, B as A, D as I, E as L, F as w, G as T, H as v, I as y, J as D, K as M, L as b, M as O, N as k, O as P, P as V } from "./index-DvpQioe4.js";
|
|
2
|
+
import { cB as B, cC as K, cD as U, cJ as X, bx as _, e as G, f as H, l as J, a as j, dn as q, dp as N, bb as Y, dq as Z, dr as Q, dv as W, dw as $, dy as ee, I as ae, dO as se, el as oe, b4 as te } from "./executeStringFunction-B3Tw7e1U.js";
|
|
3
3
|
import { FLVURL as le } from "@fileverse-dev/formulajs";
|
|
4
4
|
import { E as de, S as Se } from "./constants-8Ij49Lxv.js";
|
|
5
5
|
export {
|
|
@@ -15,22 +15,22 @@ export {
|
|
|
15
15
|
d as SupportedChain,
|
|
16
16
|
S as TEMPLATES,
|
|
17
17
|
c as api,
|
|
18
|
-
|
|
18
|
+
B as clearColumnsCellsFormat,
|
|
19
19
|
i as clearFilter,
|
|
20
|
-
|
|
20
|
+
K as clearRowsCellsFormat,
|
|
21
21
|
U as clearSelectedCellFormat,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
m as createFilter,
|
|
23
|
+
h as decryptForRoomKey,
|
|
24
24
|
X as deleteRowCol,
|
|
25
25
|
_ as deleteSelectedCellText,
|
|
26
26
|
p as describeMatchedShortcut,
|
|
27
27
|
C as encryptForRoomKey,
|
|
28
|
-
|
|
28
|
+
G as executeStringFunction,
|
|
29
29
|
u as fetchSessionState,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
H as formulaResponseUiSync,
|
|
31
|
+
J as getFlowdata,
|
|
32
|
+
E as getRemoveDuplicatesErrorMessage,
|
|
33
|
+
F as getRemoveDuplicatesPreview,
|
|
34
34
|
j as getSheetIndex,
|
|
35
35
|
x as handleCSVUpload,
|
|
36
36
|
g as handleCopy,
|
|
@@ -40,26 +40,26 @@ export {
|
|
|
40
40
|
I as handleExportToXLSX,
|
|
41
41
|
q as handleFreeze,
|
|
42
42
|
N as handleHorizontalAlign,
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
Y as handleLink,
|
|
44
|
+
Z as handleMerge,
|
|
45
45
|
L as handlePasteByClick,
|
|
46
|
-
|
|
46
|
+
Q as handleSort,
|
|
47
47
|
W as handleTextSize,
|
|
48
48
|
$ as handleVerticalAlign,
|
|
49
49
|
w as importSpreadsheetFile,
|
|
50
50
|
ee as insertRowCol,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
T as isBrowserZoomShortcut,
|
|
52
|
+
v as isFormulaListShortcut,
|
|
53
|
+
y as isOpenShortcutsModalShortcut,
|
|
54
54
|
ae as jfrefreshgrid,
|
|
55
55
|
se as loadLocale,
|
|
56
56
|
D as remapCommentAnchors,
|
|
57
57
|
M as removeActiveImage,
|
|
58
58
|
b as removeDuplicates,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
O as seedSession,
|
|
60
|
+
k as showImgChooser,
|
|
61
61
|
oe as toolbarItemClickHandler,
|
|
62
62
|
te as updateFormat,
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
P as useEnsStatus,
|
|
64
|
+
V as useXLSXImport
|
|
65
65
|
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as i from "yjs";
|
|
2
|
+
const p = typeof Buffer == "function";
|
|
3
|
+
typeof TextDecoder == "function" && new TextDecoder();
|
|
4
|
+
typeof TextEncoder == "function" && new TextEncoder();
|
|
5
|
+
const A = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", c = Array.prototype.slice.call(A), f = ((t) => {
|
|
6
|
+
let e = {};
|
|
7
|
+
return t.forEach((r, n) => e[r] = n), e;
|
|
8
|
+
})(c), b = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, u = String.fromCharCode.bind(String), d = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (t) => new Uint8Array(Array.prototype.slice.call(t, 0)), E = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" : "_"), g = (t) => t.replace(/[^A-Za-z0-9\+\/]/g, ""), S = (t) => {
|
|
9
|
+
let e, r, n, o, a = "";
|
|
10
|
+
const s = t.length % 3;
|
|
11
|
+
for (let l = 0; l < t.length; ) {
|
|
12
|
+
if ((r = t.charCodeAt(l++)) > 255 || (n = t.charCodeAt(l++)) > 255 || (o = t.charCodeAt(l++)) > 255)
|
|
13
|
+
throw new TypeError("invalid character found");
|
|
14
|
+
e = r << 16 | n << 8 | o, a += c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[e & 63];
|
|
15
|
+
}
|
|
16
|
+
return s ? a.slice(0, s - 3) + "===".substring(s) : a;
|
|
17
|
+
}, U = typeof btoa == "function" ? (t) => btoa(t) : p ? (t) => Buffer.from(t, "binary").toString("base64") : S, y = p ? (t) => Buffer.from(t).toString("base64") : (t) => {
|
|
18
|
+
let r = [];
|
|
19
|
+
for (let n = 0, o = t.length; n < o; n += 4096)
|
|
20
|
+
r.push(u.apply(null, t.subarray(n, n + 4096)));
|
|
21
|
+
return U(r.join(""));
|
|
22
|
+
}, h = (t, e = !1) => e ? E(y(t)) : y(t), _ = (t) => {
|
|
23
|
+
if (t = t.replace(/\s+/g, ""), !b.test(t))
|
|
24
|
+
throw new TypeError("malformed base64.");
|
|
25
|
+
t += "==".slice(2 - (t.length & 3));
|
|
26
|
+
let e, r, n, o = [];
|
|
27
|
+
for (let a = 0; a < t.length; )
|
|
28
|
+
e = f[t.charAt(a++)] << 18 | f[t.charAt(a++)] << 12 | (r = f[t.charAt(a++)]) << 6 | (n = f[t.charAt(a++)]), r === 64 ? o.push(u(e >> 16 & 255)) : n === 64 ? o.push(u(e >> 16 & 255, e >> 8 & 255)) : o.push(u(e >> 16 & 255, e >> 8 & 255, e & 255));
|
|
29
|
+
return o.join("");
|
|
30
|
+
}, w = typeof atob == "function" ? (t) => atob(g(t)) : p ? (t) => Buffer.from(t, "base64").toString("binary") : _, D = p ? (t) => d(Buffer.from(t, "base64")) : (t) => d(w(t).split("").map((e) => e.charCodeAt(0))), T = (t) => D(C(t)), C = (t) => g(t.replace(/[-_]/g, (e) => e == "-" ? "+" : "/")), v = 8e3, x = (t) => t instanceof Error ? t : new Error(String(t)), B = (t, e, r = "dsheet-package-ingress") => {
|
|
31
|
+
const n = T(e), o = new i.Doc();
|
|
32
|
+
try {
|
|
33
|
+
i.applyUpdate(o, n);
|
|
34
|
+
} finally {
|
|
35
|
+
o.destroy();
|
|
36
|
+
}
|
|
37
|
+
let a = !1;
|
|
38
|
+
const s = () => {
|
|
39
|
+
a = !0;
|
|
40
|
+
};
|
|
41
|
+
t.on("update", s);
|
|
42
|
+
try {
|
|
43
|
+
return i.applyUpdate(t, n, r), a;
|
|
44
|
+
} finally {
|
|
45
|
+
t.off("update", s);
|
|
46
|
+
}
|
|
47
|
+
}, z = async (t, e) => {
|
|
48
|
+
let r;
|
|
49
|
+
try {
|
|
50
|
+
return await Promise.race([
|
|
51
|
+
t,
|
|
52
|
+
new Promise((n, o) => {
|
|
53
|
+
r = setTimeout(
|
|
54
|
+
() => o(new Error("dSheet IndexedDB operation timed out")),
|
|
55
|
+
e
|
|
56
|
+
);
|
|
57
|
+
})
|
|
58
|
+
]);
|
|
59
|
+
} finally {
|
|
60
|
+
r && clearTimeout(r);
|
|
61
|
+
}
|
|
62
|
+
}, m = (t, e, r) => ({
|
|
63
|
+
dsheetId: t,
|
|
64
|
+
status: e,
|
|
65
|
+
encodedState: null,
|
|
66
|
+
stateVector: null,
|
|
67
|
+
...r ? { error: x(r) } : {}
|
|
68
|
+
}), P = (t, e) => {
|
|
69
|
+
const r = i.encodeStateAsUpdate(e);
|
|
70
|
+
return {
|
|
71
|
+
dsheetId: t,
|
|
72
|
+
status: r.length <= 2 ? "empty" : "available",
|
|
73
|
+
encodedState: h(r),
|
|
74
|
+
stateVector: h(i.encodeStateVector(e))
|
|
75
|
+
};
|
|
76
|
+
}, Z = (t, e, r) => {
|
|
77
|
+
if (!r)
|
|
78
|
+
return m(
|
|
79
|
+
t,
|
|
80
|
+
"unavailable",
|
|
81
|
+
new Error("dSheet document is not ready")
|
|
82
|
+
);
|
|
83
|
+
try {
|
|
84
|
+
return B(r, e, "dsheet-package-ingress"), P(t, r);
|
|
85
|
+
} catch (n) {
|
|
86
|
+
return m(t, "corrupt", n);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
v as D,
|
|
91
|
+
Z as a,
|
|
92
|
+
h as f,
|
|
93
|
+
B as m,
|
|
94
|
+
P as s,
|
|
95
|
+
T as t,
|
|
96
|
+
m as u,
|
|
97
|
+
z as w
|
|
98
|
+
};
|
|
@@ -6,8 +6,6 @@ export type DSheetContentSnapshot = {
|
|
|
6
6
|
status: DSheetContentStatus;
|
|
7
7
|
encodedState: string | null;
|
|
8
8
|
stateVector: string | null;
|
|
9
|
-
/** A1 content fingerprint of the document read; null when unavailable. */
|
|
10
|
-
fingerprint: string | null;
|
|
11
9
|
error?: Error;
|
|
12
10
|
};
|
|
13
11
|
export type DSheetContentReadOptions = {
|
package/dist/persistence.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DSheetContentReadOptions, DSheetContentSnapshot } from './persistence-utils';
|
|
2
2
|
|
|
3
3
|
export type { DSheetContentReadOptions, DSheetContentSnapshot, DSheetContentStatus, } from './persistence-utils';
|
|
4
|
-
export { fingerprintFromUpdate } from './editor/utils/content-fingerprint';
|
|
5
4
|
export declare const getDsheetStateVector: (encodedState: string | Uint8Array) => string;
|
|
6
5
|
/**
|
|
7
6
|
* Read the package-owned Y-IndexedDB database without attaching another
|
|
@@ -11,15 +10,3 @@ export declare const readDsheetContent: (dsheetId: string, options?: DSheetConte
|
|
|
11
10
|
/** Merge content into the package-owned Y-IndexedDB document. */
|
|
12
11
|
export declare const mergeDsheetContent: (dsheetId: string, encodedState: string, options?: DSheetContentReadOptions) => Promise<DSheetContentSnapshot>;
|
|
13
12
|
export declare const deleteDsheetContent: (dsheetId: string) => Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Append one Yjs update as a single row of the package-owned y-indexeddb
|
|
16
|
-
* `updates` store. Unlike mergeDsheetContent it never builds a Y.Doc and never
|
|
17
|
-
* writes a full copy of the document: the caller passes only what is missing
|
|
18
|
-
* (for example Y.diffUpdate(remote, localStateVector)).
|
|
19
|
-
*
|
|
20
|
-
* If the database does not exist yet it is created with the same schema
|
|
21
|
-
* y-indexeddb uses (`updates` autoIncrement, `custom`). Rejects with
|
|
22
|
-
* "IndexedDB is unavailable" when there is no indexedDB, and with the
|
|
23
|
-
* underlying error if the transaction fails or aborts.
|
|
24
|
-
*/
|
|
25
|
-
export declare const appendDsheetUpdate: (dsheetId: string, update: Uint8Array, options?: DSheetContentReadOptions) => Promise<void>;
|
package/dist/persistence.js
CHANGED
|
@@ -1,166 +1,118 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const i = new p.Doc();
|
|
1
|
+
import { t as D, f as h, D as b, u as p, w as S, s as w } from "./persistence-utils-BXFajzvq.js";
|
|
2
|
+
import * as u from "yjs";
|
|
3
|
+
import { clearDocument as v, IndexeddbPersistence as E } from "y-indexeddb";
|
|
4
|
+
const f = /* @__PURE__ */ new Map(), M = (e) => {
|
|
5
|
+
const o = new u.Doc();
|
|
7
6
|
try {
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
typeof e == "string" ?
|
|
11
|
-
),
|
|
7
|
+
return u.applyUpdate(
|
|
8
|
+
o,
|
|
9
|
+
typeof e == "string" ? D(e) : e
|
|
10
|
+
), h(u.encodeStateVector(o));
|
|
12
11
|
} finally {
|
|
13
|
-
|
|
12
|
+
o.destroy();
|
|
14
13
|
}
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
},
|
|
14
|
+
}, x = (e, o) => new Promise((s) => {
|
|
15
|
+
const a = new u.Doc();
|
|
16
|
+
let r = null, t = null, i = !1, m = !1;
|
|
17
|
+
const y = (n) => {
|
|
18
|
+
i || (i = !0, clearTimeout(g), r == null || r.close(), a.destroy(), s(n));
|
|
19
|
+
}, c = (n, d) => y(p(e, n, d)), g = setTimeout(() => {
|
|
21
20
|
try {
|
|
22
21
|
t == null || t.abort();
|
|
23
22
|
} catch {
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
let
|
|
24
|
+
c("timed-out", new Error("dSheet IndexedDB read timed out"));
|
|
25
|
+
}, o);
|
|
26
|
+
let l;
|
|
28
27
|
try {
|
|
29
|
-
|
|
30
|
-
} catch (
|
|
31
|
-
|
|
28
|
+
l = indexedDB.open(e);
|
|
29
|
+
} catch (n) {
|
|
30
|
+
c("unavailable", n);
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
if (
|
|
41
|
-
|
|
33
|
+
l.onupgradeneeded = () => {
|
|
34
|
+
var n;
|
|
35
|
+
m = !0, (n = l.transaction) == null || n.abort();
|
|
36
|
+
}, l.onerror = () => {
|
|
37
|
+
m ? y(p(e, "missing")) : c("unavailable", l.error);
|
|
38
|
+
}, l.onsuccess = () => {
|
|
39
|
+
if (r = l.result, !r.objectStoreNames.contains("updates") || !r.objectStoreNames.contains("custom")) {
|
|
40
|
+
c("corrupt", new Error("dSheet IndexedDB schema is invalid"));
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
43
|
try {
|
|
45
|
-
t =
|
|
46
|
-
const
|
|
47
|
-
|
|
44
|
+
t = r.transaction("updates", "readonly");
|
|
45
|
+
const n = t.objectStore("updates").getAll();
|
|
46
|
+
n.onerror = () => c("unavailable", n.error), n.onsuccess = () => {
|
|
48
47
|
try {
|
|
49
|
-
for (const
|
|
50
|
-
if (!(
|
|
48
|
+
for (const d of n.result ?? []) {
|
|
49
|
+
if (!(d instanceof Uint8Array))
|
|
51
50
|
throw new Error("dSheet IndexedDB contains a non-Yjs update");
|
|
52
|
-
|
|
51
|
+
u.applyUpdate(a, d);
|
|
53
52
|
}
|
|
54
|
-
} catch (
|
|
55
|
-
|
|
53
|
+
} catch (d) {
|
|
54
|
+
c("corrupt", d);
|
|
56
55
|
}
|
|
57
|
-
}, t.oncomplete = () =>
|
|
58
|
-
|
|
56
|
+
}, t.oncomplete = () => y(w(e, a)), t.onabort = () => {
|
|
57
|
+
i || c("unavailable", t == null ? void 0 : t.error);
|
|
59
58
|
}, t.onerror = () => {
|
|
60
|
-
|
|
59
|
+
i || c("unavailable", t == null ? void 0 : t.error);
|
|
61
60
|
};
|
|
62
|
-
} catch (
|
|
63
|
-
|
|
61
|
+
} catch (n) {
|
|
62
|
+
c("unavailable", n);
|
|
64
63
|
}
|
|
65
64
|
};
|
|
66
|
-
}), B = async (e,
|
|
65
|
+
}), B = async (e, o) => {
|
|
67
66
|
if (typeof indexedDB > "u")
|
|
68
|
-
return
|
|
67
|
+
return p(
|
|
69
68
|
e,
|
|
70
69
|
"unavailable",
|
|
71
70
|
new Error("IndexedDB is unavailable")
|
|
72
71
|
);
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
72
|
+
const s = indexedDB;
|
|
73
|
+
if (s.databases)
|
|
75
74
|
try {
|
|
76
|
-
if (!(await
|
|
77
|
-
return
|
|
75
|
+
if (!(await s.databases()).some((r) => r.name === e))
|
|
76
|
+
return p(e, "missing");
|
|
78
77
|
} catch {
|
|
79
78
|
}
|
|
80
|
-
return
|
|
81
|
-
},
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
79
|
+
return x(e, o);
|
|
80
|
+
}, A = (e, o = {}) => {
|
|
81
|
+
const s = f.get(e);
|
|
82
|
+
if (s) return s;
|
|
83
|
+
const a = B(
|
|
85
84
|
e,
|
|
86
|
-
|
|
85
|
+
o.timeoutMs ?? b
|
|
87
86
|
).finally(() => {
|
|
88
|
-
|
|
87
|
+
f.get(e) === a && f.delete(e);
|
|
89
88
|
});
|
|
90
|
-
return
|
|
91
|
-
},
|
|
92
|
-
const
|
|
89
|
+
return f.set(e, a), a;
|
|
90
|
+
}, C = async (e, o, s = {}) => {
|
|
91
|
+
const a = s.timeoutMs ?? b, r = new u.Doc();
|
|
93
92
|
try {
|
|
94
|
-
|
|
95
|
-
} catch (
|
|
96
|
-
return
|
|
93
|
+
u.applyUpdate(r, D(o), "dsheet-package-ingress");
|
|
94
|
+
} catch (i) {
|
|
95
|
+
return r.destroy(), p(e, "corrupt", i);
|
|
97
96
|
}
|
|
98
97
|
let t = null;
|
|
99
98
|
try {
|
|
100
|
-
return t = new E(e,
|
|
101
|
-
} catch (
|
|
102
|
-
return
|
|
99
|
+
return t = new E(e, r), await S(t.whenSynced, a), w(e, r);
|
|
100
|
+
} catch (i) {
|
|
101
|
+
return p(
|
|
103
102
|
e,
|
|
104
|
-
/timed out/i.test(String(
|
|
105
|
-
|
|
103
|
+
/timed out/i.test(String(i)) ? "timed-out" : "unavailable",
|
|
104
|
+
i
|
|
106
105
|
);
|
|
107
106
|
} finally {
|
|
108
107
|
await (t == null ? void 0 : t.destroy().catch(() => {
|
|
109
|
-
})),
|
|
110
|
-
}
|
|
111
|
-
}, N = async (e) => {
|
|
112
|
-
y.delete(e), typeof indexedDB < "u" && await x(e);
|
|
113
|
-
}, C = async (e, i, c = {}) => {
|
|
114
|
-
if (!(i instanceof Uint8Array))
|
|
115
|
-
throw new TypeError("appendDsheetUpdate expects a Uint8Array update");
|
|
116
|
-
if (typeof indexedDB > "u")
|
|
117
|
-
throw new Error("IndexedDB is unavailable");
|
|
118
|
-
let r = null, n = !1;
|
|
119
|
-
const t = () => {
|
|
120
|
-
try {
|
|
121
|
-
r == null || r.close();
|
|
122
|
-
} catch {
|
|
123
|
-
}
|
|
124
|
-
}, u = new Promise((b, l) => {
|
|
125
|
-
let o;
|
|
126
|
-
try {
|
|
127
|
-
o = indexedDB.open(e);
|
|
128
|
-
} catch (a) {
|
|
129
|
-
l(a);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
o.onupgradeneeded = () => {
|
|
133
|
-
const a = o.result;
|
|
134
|
-
a.objectStoreNames.contains("updates") || a.createObjectStore("updates", { autoIncrement: !0 }), a.objectStoreNames.contains("custom") || a.createObjectStore("custom");
|
|
135
|
-
}, o.onerror = () => l(o.error), o.onsuccess = () => {
|
|
136
|
-
if (r = o.result, r.onversionchange = () => t(), n) {
|
|
137
|
-
t();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
try {
|
|
141
|
-
if (!r.objectStoreNames.contains("updates"))
|
|
142
|
-
throw new Error("dSheet IndexedDB schema is invalid");
|
|
143
|
-
const a = r.transaction("updates", "readwrite");
|
|
144
|
-
a.objectStore("updates").add(i), a.oncomplete = () => b(), a.onerror = () => l(a.error), a.onabort = () => l(a.error ?? new Error("dSheet IndexedDB write aborted"));
|
|
145
|
-
} catch (a) {
|
|
146
|
-
l(a);
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
});
|
|
150
|
-
try {
|
|
151
|
-
await w(
|
|
152
|
-
u,
|
|
153
|
-
c.timeoutMs ?? D
|
|
154
|
-
);
|
|
155
|
-
} finally {
|
|
156
|
-
n = !0, t();
|
|
108
|
+
})), r.destroy();
|
|
157
109
|
}
|
|
110
|
+
}, j = async (e) => {
|
|
111
|
+
f.delete(e), typeof indexedDB < "u" && await v(e);
|
|
158
112
|
};
|
|
159
113
|
export {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
A as
|
|
164
|
-
j as mergeDsheetContent,
|
|
165
|
-
M as readDsheetContent
|
|
114
|
+
j as deleteDsheetContent,
|
|
115
|
+
M as getDsheetStateVector,
|
|
116
|
+
C as mergeDsheetContent,
|
|
117
|
+
A as readDsheetContent
|
|
166
118
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from '../context';
|
|
2
|
-
import { Cell, SingleRange
|
|
2
|
+
import { Cell, SingleRange } from '../types';
|
|
3
3
|
import { CommonOptions } from './common';
|
|
4
4
|
|
|
5
5
|
export declare function getCellValue(ctx: Context, row: number, column: number, options?: CommonOptions & {
|
|
@@ -7,30 +7,6 @@ export declare function getCellValue(ctx: Context, row: number, column: number,
|
|
|
7
7
|
}): any;
|
|
8
8
|
export declare function setCellValue(ctx: Context, row: number, column: number, value: any, cellInput: HTMLDivElement | null, options?: CommonOptions, callAfterUpdate?: boolean): void;
|
|
9
9
|
export declare function applyRemoteCellValue(ctx: Context, row: number, column: number, value: any, options?: CommonOptions): void;
|
|
10
|
-
/**
|
|
11
|
-
* Replace a sheet's formula list with the collaborator's value from Yjs (A4).
|
|
12
|
-
* This is what the grid rebuild it replaces produced, without the rebuild. The
|
|
13
|
-
* caller runs it with noHistory.
|
|
14
|
-
*
|
|
15
|
-
* The dependency edges follow the change (C8): an entry that left the chain
|
|
16
|
-
* loses its edges, one that joined gets the edges its cell's text names (or
|
|
17
|
-
* runs on every commit until its cell arrives), and the rest are left alone, so
|
|
18
|
-
* `depGraphComplete` stays on. When the two chains can't be compared the
|
|
19
|
-
* indexes reset to a fresh mount's state.
|
|
20
|
-
*/
|
|
21
|
-
export declare function setSheetCalcChain(ctx: Context, calcChain: Sheet['calcChain'], options?: CommonOptions): void;
|
|
22
|
-
export type RemoteCellChange = {
|
|
23
|
-
r: number;
|
|
24
|
-
c: number;
|
|
25
|
-
v: unknown;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Apply a remote batch of cells inside one draft (A5). The caller runs it in
|
|
29
|
-
* one setContext with noHistory, so a batch is one Immer pass and never
|
|
30
|
-
* lands on the local undo stack. A cell that fails is reported through
|
|
31
|
-
* onSkip and the rest still apply.
|
|
32
|
-
*/
|
|
33
|
-
export declare function applyRemoteCells(ctx: Context, cells: RemoteCellChange[], options?: CommonOptions, onSkip?: (cell: RemoteCellChange, error: unknown) => void): void;
|
|
34
10
|
export declare function clearCell(ctx: Context, row: number, column: number, options?: CommonOptions): void;
|
|
35
11
|
export declare function setCellFormat(ctx: Context, row: number, column: number, attr: keyof Cell, value: any, options?: CommonOptions): void;
|
|
36
12
|
export declare function autoFillCell(ctx: Context, copyRange: SingleRange, applyRange: SingleRange, direction: 'up' | 'down' | 'left' | 'right'): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Context } from '../context';
|
|
2
2
|
|
|
3
|
-
export declare function collectSheetIdsFromFormulaText(ctx: Context, formula: string): Set<string>;
|
|
4
3
|
/** Drop cached dense-sheet set (e.g. after structural workbook changes). */
|
|
5
4
|
export declare function invalidateSheetsRequiredDenseCache(): void;
|
|
6
5
|
/**
|
|
@@ -7,7 +7,7 @@ export { defaultSettings } from './settings';
|
|
|
7
7
|
export type { Settings, Hooks, DateBaseLocale, CommentAnchorMove, } from './settings';
|
|
8
8
|
export { handleCopy, handleGlobalKeyDown, handlePaste, handlePasteByClick, fixPositionOnFrozenCells, handleCellAreaMouseDown, handleCellAreaDoubleClick, handleContextMenu, mouseRender, handleOverlayMouseMove, handleOverlayMouseUp, handleRowHeaderMouseDown, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColSizeHandleDoubleClick, handleRowSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleRowFreezeHandleMouseDown, describeMatchedShortcut, isBrowserZoomShortcut, isOpenShortcutsModalShortcut, isFormulaListShortcut, } from './events';
|
|
9
9
|
export * from './locale';
|
|
10
|
-
export { getBorderInfoComputeRange, getBorderInfoCompute, normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, isValidRangeText, getInlineStringHTML, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, clipboard, moveToEnd, getRangeRectsByCharacterOffset, getDateBaseLocale, getCanonicalDateDisplayFormat, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, update, is_date, valueShowEs, isTypedCurrencyDisplayFormat, isCurrencyLikeNumberFormat, buildFiatCurrencyFormat, quoteSsfLiteral, FormulaCache, groupValuesRefresh, execFunctionGroup, runFormulaEvalChunk, applyWorkerFormulaChunkResults,
|
|
10
|
+
export { getBorderInfoComputeRange, getBorderInfoCompute, normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, isValidRangeText, getInlineStringHTML, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, clipboard, moveToEnd, getRangeRectsByCharacterOffset, getDateBaseLocale, getCanonicalDateDisplayFormat, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, update, is_date, valueShowEs, isTypedCurrencyDisplayFormat, isCurrencyLikeNumberFormat, buildFiatCurrencyFormat, quoteSsfLiteral, FormulaCache, groupValuesRefresh, execFunctionGroup, runFormulaEvalChunk, applyWorkerFormulaChunkResults, isFormulaEvalPending, FORMULA_ASYNC_CHUNK_SIZE, FORMULA_ASYNC_EVAL_THRESHOLD, FORMULA_WORKER_CHUNK_SIZE, FORMULA_WORKER_THRESHOLD, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, maybeRecoverDirtyRangeSelection, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, setFormulaEditorOwner, functionHTMLGenerate, suppressFormulaRangeSelectionForInitialEdit, resetFormulaArrowSession, ensureFormulaRangeToSheet, shouldPreserveFormulaEditOnSheetSwitch, activateSheetForNavigation, returnToFormulaOriginSheet, rangeSetValue, getFormulaRangeIndexForKeyboardSync, createFormulaRangeSelect, isFormulaReferenceInputMode, seedFormulaFuncSelectedRangeFromLastSelection, initFreeze, isInlineStringCell, getInlineStringNoStyle, rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, insertRowCol, deleteRowCol, hideSelected, showSelected, isShowHidenCR, getFilterHiddenRowsUnionFromFilterMap, getFilterHiddenRowsUnion, ensureManualHiddenInitialized, rebuildRowHiddenUnion, scrollToHighlightCell, selectTitlesMap, selectTitlesRange, defaultLuckysheetSelectRanges, normalizeSelection, syncPrimaryCellActiveFromSelection, selectionIsExactlyOneMergeBlock, setPrimaryCellActive, advancePrimaryCellInLastMultiSelection, snapSheetSelectionFocusToCellPreserveMultiRange, moveHighlightCell, deleteSelectedCellText, selectAll, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, calcSelectionInfo, addSheet, deleteSheet, editSheetName, changeSheet, updateFormat, autoSelectionFormula, handleBold, handleItalic, handleStrikeThrough, handleUnderline, handleHorizontalAlign, handleVerticalAlign, handleTextColor, handleTextBackground, handleBorder, handleMerge, mergeSelectionHasValues, handleSort, getRemoveDuplicatesPreview, removeDuplicates, getRemoveDuplicatesErrorMessage, handleFreeze, handleTextSize, handleSum, handleLink, captureLinkEditorOpenSnapshot, isHyperlinkCreationBlocked, toolbarItemClickHandler, toolbarItemSelectedFunc, handleScreenShot, insertImage, showImgChooser, drawArrow, setEditingComment, removeEditingComment, removeOverShowComment, newComment, editComment, deleteComment, showComments, showHideComment, showHideAllComments, onCommentBoxMoveStart, removeActiveImage, copyActiveImage, cutActiveImage, pasteImageItem, loadImageFromFile, getImageClipboard, getImageCutSourceId, cancelActiveImgItem, onImageMoveStart, onImageResizeStart, createDropCellRange, sortSelection, sortSheetBySelectedColumn, searchAll, searchNext, replace, replaceAll, replaceAllScoped, getSearchIndexArr, getSearchIndexArrAsync, getFindRangeOnCurrentSheet, getQuickSearchIndexArr, getQuickSearchHiddenConfig, getCellHyperlinks, getHyperlinkDisplayTextInCell, getInlineLinkPlainRange, getUniformLinkCoveringPlainRange, getUniformLinkAtPlainOffset, removeHyperlinkForLink, updateHyperlinkForLink, syncLinkCardAfterHyperlinkChange, expandCellRectForMerge, shouldQuickSearchUseAsync, runQuickSearchIndexArrAsync, QUICK_SEARCH_ASYNC_ROW_THRESHOLD, parseRangeText, getCellRowColumn, getCellHyperlink, saveHyperlink, removeHyperlink, showLinkCard, goToLink, isLinkValid, createFilterOptions, clearFilter, clearFilterForColumn, toggleViewerFilter, createFilter, applySheetFilterState, getFilterColumnValues, getFilterColumnColors, orderbydatafiler, saveFilter, onCellsMoveStart, cfSplitRange, updateMoreCell, getRegStr, getDataArr, applyLocation, getOptionValue, getSelectRange, getDropdownList, setDropdownValue, confirmMessage, setConditionRules, CF_DATE_DEFAULT_FORMAT, parseCfDateConditionForUi, formatCfDatePresetSnapshot, parseDdMmYyyyToSerial, handleOverlayTouchStart, handleOverlayTouchEnd, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, jfrefreshgrid, sanitizeDuneUrl, insertDuneChart, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, setCellError, clearCellError, detectDateFormat, isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, iscelldata, getcellrange, cancelFunctionrangeSelected, seletedHighlistByindex, spillSortResult, execfunction, insertUpdateFunctionGroup, remapFormulaReferencesByMap, refreshFormulasUsingDefinedNames, checkCF, getComputeMap, isValidDefinedNameIdentifier, getDefinedNameDisplayRange, findDefinedNameForSelection, findDefinedNameByName, resolveDefinedNameForFormula, addDefinedName, updateDefinedName, deleteDefinedName, selectDefinedName, openNamedRangesSidebar, scheduleDefinedNamesSync, shiftDefinedNamesOnInsert, shiftDefinedNamesOnDelete, removeDefinedNamesForSheet, cancelPaintModel, hideCRCount, getdatabyselection, } from './modules';
|
|
11
11
|
export type { FilterDate, FilterValue, FilterColor } from './modules';
|
|
12
12
|
export { getFreezeState, getFrozenPixelBounds, toggleFreeze, indexToColumnChar, escapeScriptTag, escapeHTMLTag, getSheetIndex, replaceHtml, isAllowEdit, isAllowEditReadOnly, filterPatch, patchToOp, opToPatch, inverseRowColOptions, } from './utils';
|
|
13
13
|
export type { PatchOptions, ChangedSheet } from './utils';
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { Context } from '../context';
|
|
2
2
|
|
|
3
3
|
export declare function getBorderInfoComputeRange(ctx: Context, dataset_row_st: number, dataset_row_ed: number, dataset_col_st: number, dataset_col_ed: number, sheetId?: string): Record<string, any>;
|
|
4
|
-
/**
|
|
5
|
-
* getBorderInfoComputeRange for the current sheet's canvas draw, cached (C6).
|
|
6
|
-
* The draw re-expanded every borderInfo entry on every repaint. Keyed by the
|
|
7
|
-
* identities of borderInfo, merge, rowhidden and colhidden (Immer gives each
|
|
8
|
-
* a new identity on change; merged cells' `mc` follows `merge`), the grid
|
|
9
|
-
* size and the drawn bounds, so redraws for scroll-back, selection moves,
|
|
10
|
-
* edits and remote cells reuse the result. Callers only read it.
|
|
11
|
-
*/
|
|
12
|
-
export declare function getBorderInfoComputeRangeCached(ctx: Context, dataset_row_st: number, dataset_row_ed: number, dataset_col_st: number, dataset_col_ed: number): Record<string, any>;
|
|
13
4
|
export declare function getBorderInfoCompute(ctx: Context, sheetId?: string): any;
|
|
@@ -2,20 +2,6 @@ import { Context, GlobalCache } from '..';
|
|
|
2
2
|
|
|
3
3
|
export declare function dataRangeSelection(ctx: Context, cache: GlobalCache, rangT: string, type: string, value: string): void;
|
|
4
4
|
export declare function getDropdownList(ctx: Context, txt: string): (string | number | boolean)[];
|
|
5
|
-
type DropdownOptions = {
|
|
6
|
-
list: (string | number | boolean)[];
|
|
7
|
-
set: Set<unknown>;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Parsed dropdown options, cached per option text (C7). The canvas validates
|
|
11
|
-
* every visible dropdown cell on every draw, and getDropdownList re-splits
|
|
12
|
-
* and de-duplicates with list.includes, O(L^2) per cell. When the options
|
|
13
|
-
* come from a cell range, the key also includes the identity of the source
|
|
14
|
-
* sheet's data, so an edit there re-reads the range. Shared and read-only.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getDropdownOptions(ctx: Context, txt: string): DropdownOptions;
|
|
17
|
-
/** `value1.split(',')`, memoized for the canvas pill colours (C7). */
|
|
18
|
-
export declare function splitDropdownOptions(value1: string): string[];
|
|
19
5
|
export declare function validateIdCard(ctx: Context, idCard: string): boolean;
|
|
20
6
|
export declare function validateCellData(ctx: Context, item: any, cellValue: any): any;
|
|
21
7
|
export declare function checkboxChange(ctx: Context, r: number, c: number): void;
|
|
@@ -31,4 +17,3 @@ export declare function setDropdownValue(ctx: Context, value: string, arr: any,
|
|
|
31
17
|
column: number;
|
|
32
18
|
}): void;
|
|
33
19
|
export declare function confirmMessage(ctx: Context, generalDialog: any, dataVerification: any): boolean;
|
|
34
|
-
export {};
|