@fileverse-dev/dsheet 4.1.1-edit-mode-15 → 4.1.1
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 +7 -9
- package/dist/editor/components/editor-workbook.d.ts +1 -5
- package/dist/editor/components/permission-chip.d.ts +1 -5
- package/dist/editor/contexts/editor-context.d.ts +2 -11
- package/dist/editor/dsheet-editor.d.ts +2 -3
- package/dist/editor/hooks/use-collab-awareness.d.ts +6 -3
- package/dist/editor/hooks/use-editor-data.d.ts +2 -2
- package/dist/editor/hooks/use-editor-sync.d.ts +2 -6
- package/dist/editor/types/comments.d.ts +11 -0
- package/dist/editor/types.d.ts +4 -30
- package/dist/editor/utils/apply-comment-markers.d.ts +3 -11
- package/dist/editor/utils/comment-anchors-ydoc.d.ts +32 -0
- package/dist/editor/utils/remap-comment-anchors.d.ts +26 -0
- package/dist/{executeStringFunction-CxsiamWG.js → executeStringFunction-BJ00H04h.js} +1144 -1101
- package/dist/formula.js +1 -1
- package/dist/{index-D_W1NZHN.js → index-CsYiH7pp.js} +23348 -23529
- package/dist/index.d.ts +3 -4
- package/dist/index.es.js +52 -55
- package/dist/persistence-utils-DsM_MOB1.js +89 -0
- package/dist/persistence-utils.d.ts +0 -6
- package/dist/persistence.js +1 -1
- package/dist/sheet-engine/core/index.d.ts +1 -1
- package/dist/sheet-engine/core/settings.d.ts +40 -0
- package/dist/sheet-engine/core/utils/comment-anchor-move.d.ts +17 -0
- package/dist/sheet-engine/react/components/Toolbar/index.d.ts +0 -1
- package/dist/sheet-engine/react/components/Workbook/index.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/sync-local/SyncManager.d.ts +9 -54
- package/dist/sync-local/index.d.ts +1 -1
- package/dist/sync-local/socketClient.d.ts +8 -74
- package/dist/sync-local/types/index.d.ts +15 -111
- package/dist/sync-local/useSyncManager.d.ts +0 -4
- package/dist/sync-local/utils/objectToFile.d.ts +1 -0
- package/dist/{use-xlsx-import-impl-DfZxkUKs.js → use-xlsx-import-impl-OXKPbMbG.js} +148 -148
- package/dist/{xlsx-defined-names-Dk4NkT2h.js → xlsx-defined-names-Klp22jvp.js} +2 -2
- package/dist/{xlsx-export-impl-QxGHOZ3_.js → xlsx-export-impl-Y8hmWj_I.js} +4 -4
- package/dist/{xlsx-hyperlink-inline-qlVTYo8g.js → xlsx-hyperlink-inline-DNeesFv6.js} +2 -2
- package/package.json +2 -2
- package/dist/editor/components/editor-workbook-controls.d.ts +0 -11
- package/dist/editor/components/permission-chip-model.d.ts +0 -34
- package/dist/editor/components/permission-chip.test.d.ts +0 -1
- package/dist/editor/hooks/collaboration-lifecycle.d.ts +0 -35
- package/dist/editor/hooks/collaboration-lifecycle.test.d.ts +0 -1
- package/dist/editor/utils/detach-workbook-data.d.ts +0 -8
- package/dist/editor/utils/detach-workbook-data.test.d.ts +0 -1
- package/dist/editor/utils/editor-handle.d.ts +0 -11
- package/dist/editor/utils/editor-handle.test.d.ts +0 -1
- package/dist/persistence-utils-BXFajzvq.js +0 -98
- package/dist/persistence-utils.test.d.ts +0 -1
- package/dist/sync-local/crypto/room-key.d.ts +0 -2
- package/dist/sync-local/crypto/room-key.test.d.ts +0 -1
- package/dist/sync-local/floor.d.ts +0 -8
- package/dist/sync-local/floor.test.d.ts +0 -1
- package/dist/sync-local/presence.d.ts +0 -11
- package/dist/sync-local/presence.test.d.ts +0 -1
- package/dist/sync-local/session-tools.d.ts +0 -31
- package/dist/sync-local/session-tools.test.d.ts +0 -1
- /package/dist/editor/{components/editor-workbook-controls.test.d.ts → utils/remap-comment-anchors.test.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ export { formulaResponseUiSync } from './editor/utils/formula-ui-sync';
|
|
|
4
4
|
export { executeStringFunction } from './editor/utils/executeStringFunction';
|
|
5
5
|
export { FLVURL } from '@fileverse-dev/formulajs';
|
|
6
6
|
export { loadLocale } from './sheet-engine/core';
|
|
7
|
-
export type { ErrorMessageHandlerReturnType, DataBlockEvent, DataBlockEventType, ApiKeyStorage
|
|
7
|
+
export type { ErrorMessageHandlerReturnType, DataBlockEvent, DataBlockEventType, ApiKeyStorage } from './editor/types';
|
|
8
8
|
export type { PanelConfig, PanelId, BuiltInPanelType } from './editor/types';
|
|
9
|
-
export type { CommentThread, CommentReply, CommentActionParams, CommentsConfig, } from './editor/types/comments';
|
|
9
|
+
export type { CommentThread, CommentReply, CommentActionParams, CommentsConfig, CommentAnchorMove, } from './editor/types/comments';
|
|
10
10
|
export { CommentAction } from './editor/types/comments';
|
|
11
|
+
export { remapCommentAnchors } from './editor/utils/remap-comment-anchors';
|
|
11
12
|
export { CommentsContent } from './editor/components/comments/comment-sidebar';
|
|
12
13
|
export { CommentCellUI } from './editor/components/comments/comment-cell-popup';
|
|
13
14
|
export { useEnsStatus } from './editor/components/comments/ens/use-ens-status';
|
|
@@ -16,8 +17,6 @@ export type { SmartContractConfig, SmartContractEvent, SmartContractEventType, C
|
|
|
16
17
|
export { SupportedChain } from './editor/types/smart-contract';
|
|
17
18
|
export type { WorkbookInstance } from './sheet-engine/react';
|
|
18
19
|
export type { CollaborationProps, CollabConnectionConfig, CollabSessionMeta, CollabServices, CollabCallbacks, CollabState, CollabStatus, CollabError, CollabErrorCode, CollabUser, } from './sync-local/types';
|
|
19
|
-
export { fetchSessionState, seedSession } from './sync-local/session-tools';
|
|
20
|
-
export { encryptForRoomKey, decryptForRoomKey, } from './sync-local/crypto/room-key';
|
|
21
20
|
export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from './editor/constants/shared-constants';
|
|
22
21
|
export { TEMPLATES } from '@fileverse-dev/dsheets-templates/template-metadata-list';
|
|
23
22
|
export { handleCSVUpload } from './editor/utils/csv-import';
|
package/dist/index.es.js
CHANGED
|
@@ -1,63 +1,60 @@
|
|
|
1
|
-
import { C as s, d as
|
|
2
|
-
import {
|
|
3
|
-
import { FLVURL as
|
|
4
|
-
import { E as
|
|
1
|
+
import { C as s, d as t, f as o, S as r, g as l, h as n, j as d, T as i, k as c, l as S, n as m, o as h, p, q as C, t as u, u as E, v as F, w as g, x, z as A, A as I, B as R, D as f, E as L, F as w, G as T, H as v, I as b, J as k, K as D } from "./index-CsYiH7pp.js";
|
|
2
|
+
import { cy as z, cz as V, cA as y, cG as G, bs as P, e as U, f as X, l as _, a as j, di as B, dj as H, bb as O, dk as q, dl as J, dq as K, dr as N, dt as Y, I as Z, dI as Q, ef as W, b4 as $ } from "./executeStringFunction-BJ00H04h.js";
|
|
3
|
+
import { FLVURL as ae } from "@fileverse-dev/formulajs";
|
|
4
|
+
import { E as te, S as oe } from "./constants-CRFfbkoQ.js";
|
|
5
5
|
export {
|
|
6
6
|
s as CommentAction,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
t as CommentCellUI,
|
|
8
|
+
o as CommentsContent,
|
|
9
9
|
r as DSheetEditor,
|
|
10
10
|
l as DSheetSkeleton,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
te as ERROR_MESSAGES_FLAG,
|
|
12
|
+
ae as FLVURL,
|
|
13
|
+
n as FortuneCore,
|
|
14
|
+
oe as SERVICES_API_KEY,
|
|
15
|
+
d as SupportedChain,
|
|
16
16
|
i as TEMPLATES,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_ as
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
g as
|
|
36
|
-
x as
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
J as
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
v as removeActiveImage,
|
|
56
|
-
M as removeDuplicates,
|
|
57
|
-
D as seedSession,
|
|
17
|
+
c as api,
|
|
18
|
+
z as clearColumnsCellsFormat,
|
|
19
|
+
S as clearFilter,
|
|
20
|
+
V as clearRowsCellsFormat,
|
|
21
|
+
y as clearSelectedCellFormat,
|
|
22
|
+
m as createFilter,
|
|
23
|
+
G as deleteRowCol,
|
|
24
|
+
P as deleteSelectedCellText,
|
|
25
|
+
h as describeMatchedShortcut,
|
|
26
|
+
U as executeStringFunction,
|
|
27
|
+
X as formulaResponseUiSync,
|
|
28
|
+
_ as getFlowdata,
|
|
29
|
+
p as getRemoveDuplicatesErrorMessage,
|
|
30
|
+
C as getRemoveDuplicatesPreview,
|
|
31
|
+
j as getSheetIndex,
|
|
32
|
+
u as handleCSVUpload,
|
|
33
|
+
E as handleCopy,
|
|
34
|
+
F as handleExportToCSV,
|
|
35
|
+
g as handleExportToJSON,
|
|
36
|
+
x as handleExportToXLSX,
|
|
37
|
+
B as handleFreeze,
|
|
38
|
+
H as handleHorizontalAlign,
|
|
39
|
+
O as handleLink,
|
|
40
|
+
q as handleMerge,
|
|
41
|
+
A as handlePasteByClick,
|
|
42
|
+
J as handleSort,
|
|
43
|
+
K as handleTextSize,
|
|
44
|
+
N as handleVerticalAlign,
|
|
45
|
+
I as importSpreadsheetFile,
|
|
46
|
+
Y as insertRowCol,
|
|
47
|
+
R as isBrowserZoomShortcut,
|
|
48
|
+
f as isFormulaListShortcut,
|
|
49
|
+
L as isOpenShortcutsModalShortcut,
|
|
50
|
+
Z as jfrefreshgrid,
|
|
51
|
+
Q as loadLocale,
|
|
52
|
+
w as remapCommentAnchors,
|
|
53
|
+
T as removeActiveImage,
|
|
54
|
+
v as removeDuplicates,
|
|
58
55
|
b as showImgChooser,
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
W as toolbarItemClickHandler,
|
|
57
|
+
$ as updateFormat,
|
|
61
58
|
k as useEnsStatus,
|
|
62
|
-
|
|
59
|
+
D as useXLSXImport
|
|
63
60
|
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as c from "yjs";
|
|
2
|
+
const u = typeof Buffer == "function";
|
|
3
|
+
typeof TextDecoder == "function" && new TextDecoder();
|
|
4
|
+
typeof TextEncoder == "function" && new TextEncoder();
|
|
5
|
+
const b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s = Array.prototype.slice.call(b), l = ((t) => {
|
|
6
|
+
let e = {};
|
|
7
|
+
return t.forEach((r, o) => e[r] = o), e;
|
|
8
|
+
})(s), g = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, f = String.fromCharCode.bind(String), h = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (t) => new Uint8Array(Array.prototype.slice.call(t, 0)), S = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" : "_"), A = (t) => t.replace(/[^A-Za-z0-9\+\/]/g, ""), E = (t) => {
|
|
9
|
+
let e, r, o, n, a = "";
|
|
10
|
+
const p = t.length % 3;
|
|
11
|
+
for (let i = 0; i < t.length; ) {
|
|
12
|
+
if ((r = t.charCodeAt(i++)) > 255 || (o = t.charCodeAt(i++)) > 255 || (n = t.charCodeAt(i++)) > 255)
|
|
13
|
+
throw new TypeError("invalid character found");
|
|
14
|
+
e = r << 16 | o << 8 | n, a += s[e >> 18 & 63] + s[e >> 12 & 63] + s[e >> 6 & 63] + s[e & 63];
|
|
15
|
+
}
|
|
16
|
+
return p ? a.slice(0, p - 3) + "===".substring(p) : a;
|
|
17
|
+
}, U = typeof btoa == "function" ? (t) => btoa(t) : u ? (t) => Buffer.from(t, "binary").toString("base64") : E, d = u ? (t) => Buffer.from(t).toString("base64") : (t) => {
|
|
18
|
+
let r = [];
|
|
19
|
+
for (let o = 0, n = t.length; o < n; o += 4096)
|
|
20
|
+
r.push(f.apply(null, t.subarray(o, o + 4096)));
|
|
21
|
+
return U(r.join(""));
|
|
22
|
+
}, m = (t, e = !1) => e ? S(d(t)) : d(t), _ = (t) => {
|
|
23
|
+
if (t = t.replace(/\s+/g, ""), !g.test(t))
|
|
24
|
+
throw new TypeError("malformed base64.");
|
|
25
|
+
t += "==".slice(2 - (t.length & 3));
|
|
26
|
+
let e, r, o, n = [];
|
|
27
|
+
for (let a = 0; a < t.length; )
|
|
28
|
+
e = l[t.charAt(a++)] << 18 | l[t.charAt(a++)] << 12 | (r = l[t.charAt(a++)]) << 6 | (o = l[t.charAt(a++)]), r === 64 ? n.push(f(e >> 16 & 255)) : o === 64 ? n.push(f(e >> 16 & 255, e >> 8 & 255)) : n.push(f(e >> 16 & 255, e >> 8 & 255, e & 255));
|
|
29
|
+
return n.join("");
|
|
30
|
+
}, w = typeof atob == "function" ? (t) => atob(A(t)) : u ? (t) => Buffer.from(t, "base64").toString("binary") : _, D = u ? (t) => h(Buffer.from(t, "base64")) : (t) => h(w(t).split("").map((e) => e.charCodeAt(0))), T = (t) => D(C(t)), C = (t) => A(t.replace(/[-_]/g, (e) => e == "-" ? "+" : "/")), P = 8e3, x = (t) => t instanceof Error ? t : new Error(String(t)), v = async (t, e) => {
|
|
31
|
+
let r;
|
|
32
|
+
try {
|
|
33
|
+
return await Promise.race([
|
|
34
|
+
t,
|
|
35
|
+
new Promise((o, n) => {
|
|
36
|
+
r = setTimeout(
|
|
37
|
+
() => n(new Error("dSheet IndexedDB operation timed out")),
|
|
38
|
+
e
|
|
39
|
+
);
|
|
40
|
+
})
|
|
41
|
+
]);
|
|
42
|
+
} finally {
|
|
43
|
+
r && clearTimeout(r);
|
|
44
|
+
}
|
|
45
|
+
}, y = (t, e, r) => ({
|
|
46
|
+
dsheetId: t,
|
|
47
|
+
status: e,
|
|
48
|
+
encodedState: null,
|
|
49
|
+
stateVector: null,
|
|
50
|
+
...r ? { error: x(r) } : {}
|
|
51
|
+
}), B = (t, e) => {
|
|
52
|
+
const r = c.encodeStateAsUpdate(e);
|
|
53
|
+
return {
|
|
54
|
+
dsheetId: t,
|
|
55
|
+
status: r.length <= 2 ? "empty" : "available",
|
|
56
|
+
encodedState: m(r),
|
|
57
|
+
stateVector: m(c.encodeStateVector(e))
|
|
58
|
+
};
|
|
59
|
+
}, z = (t, e, r) => {
|
|
60
|
+
if (!r)
|
|
61
|
+
return y(
|
|
62
|
+
t,
|
|
63
|
+
"unavailable",
|
|
64
|
+
new Error("dSheet document is not ready")
|
|
65
|
+
);
|
|
66
|
+
let o;
|
|
67
|
+
const n = new c.Doc();
|
|
68
|
+
try {
|
|
69
|
+
o = T(e), c.applyUpdate(n, o);
|
|
70
|
+
} catch (a) {
|
|
71
|
+
return y(t, "corrupt", a);
|
|
72
|
+
} finally {
|
|
73
|
+
n.destroy();
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
return c.applyUpdate(r, o, "dsheet-package-ingress"), B(t, r);
|
|
77
|
+
} catch (a) {
|
|
78
|
+
return y(t, "corrupt", a);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
P as D,
|
|
83
|
+
m as f,
|
|
84
|
+
z as m,
|
|
85
|
+
B as s,
|
|
86
|
+
T as t,
|
|
87
|
+
y as u,
|
|
88
|
+
v as w
|
|
89
|
+
};
|
|
@@ -11,12 +11,6 @@ export type DSheetContentSnapshot = {
|
|
|
11
11
|
export type DSheetContentReadOptions = {
|
|
12
12
|
timeoutMs?: number;
|
|
13
13
|
};
|
|
14
|
-
/**
|
|
15
|
-
* Apply a full dSheet artifact without rebuilding its shared types. Keeping the
|
|
16
|
-
* original Yjs structs is required for independently bootstrapped peers to
|
|
17
|
-
* converge instead of inserting duplicate workbook data.
|
|
18
|
-
*/
|
|
19
|
-
export declare const mergeDsheetEncodedContent: (doc: Y.Doc, encodedState: string, origin?: unknown) => boolean;
|
|
20
14
|
export declare const withDsheetPersistenceTimeout: <T>(promise: Promise<T>, timeoutMs: number) => Promise<T>;
|
|
21
15
|
export declare const unavailableDsheetContentSnapshot: (dsheetId: string, status: Exclude<DSheetContentStatus, "available" | "empty">, error?: unknown) => DSheetContentSnapshot;
|
|
22
16
|
export declare const snapshotDsheetDocument: (dsheetId: string, doc: Y.Doc) => DSheetContentSnapshot;
|
package/dist/persistence.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as D, f as h, D as b, u as p, w as S, s as w } from "./persistence-utils-
|
|
1
|
+
import { t as D, f as h, D as b, u as p, w as S, s as w } from "./persistence-utils-DsM_MOB1.js";
|
|
2
2
|
import * as u from "yjs";
|
|
3
3
|
import { clearDocument as v, IndexeddbPersistence as E } from "y-indexeddb";
|
|
4
4
|
const f = /* @__PURE__ */ new Map(), M = (e) => {
|
|
@@ -4,7 +4,7 @@ export { Canvas, defaultStyle } from './canvas';
|
|
|
4
4
|
export { defaultContext, getFlowdata, ensureSheetIndex, initSheetIndex, updateContextWithSheetData, updateContextWithCanvas, } from './context';
|
|
5
5
|
export type { Context } from './context';
|
|
6
6
|
export { defaultSettings } from './settings';
|
|
7
|
-
export type { Settings, Hooks, DateBaseLocale } from './settings';
|
|
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
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, 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, 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';
|
|
@@ -94,6 +94,46 @@ export type Hooks = {
|
|
|
94
94
|
afterShowGridLinesChange?: () => void;
|
|
95
95
|
afterNameChanges?: () => void;
|
|
96
96
|
afterStatusChanges?: () => void;
|
|
97
|
+
/**
|
|
98
|
+
* Fired after row/column drag-drop, cell-range move, or insert/delete
|
|
99
|
+
* so host apps can remap comment keys (`${sheetId}_${row}_${col}`).
|
|
100
|
+
*/
|
|
101
|
+
afterCommentAnchorMove?: (move: CommentAnchorMove) => void;
|
|
102
|
+
};
|
|
103
|
+
export type CommentAnchorMove = {
|
|
104
|
+
type: 'row' | 'column';
|
|
105
|
+
sheetId: string;
|
|
106
|
+
/** Prefixes that identify this sheet in comment keys (id, order, index). */
|
|
107
|
+
sheetKeys?: string[];
|
|
108
|
+
/** old index → new index for every row/col on the sheet */
|
|
109
|
+
indexMap: Record<number, number>;
|
|
110
|
+
} | {
|
|
111
|
+
type: 'cells';
|
|
112
|
+
sheetId: string;
|
|
113
|
+
sheetKeys?: string[];
|
|
114
|
+
source: {
|
|
115
|
+
row: [number, number];
|
|
116
|
+
column: [number, number];
|
|
117
|
+
};
|
|
118
|
+
target: {
|
|
119
|
+
row: [number, number];
|
|
120
|
+
column: [number, number];
|
|
121
|
+
};
|
|
122
|
+
} | {
|
|
123
|
+
type: 'insert';
|
|
124
|
+
axis: 'row' | 'column';
|
|
125
|
+
sheetId: string;
|
|
126
|
+
sheetKeys?: string[];
|
|
127
|
+
index: number;
|
|
128
|
+
count: number;
|
|
129
|
+
direction: 'lefttop' | 'rightbottom';
|
|
130
|
+
} | {
|
|
131
|
+
type: 'delete';
|
|
132
|
+
axis: 'row' | 'column';
|
|
133
|
+
sheetId: string;
|
|
134
|
+
sheetKeys?: string[];
|
|
135
|
+
start: number;
|
|
136
|
+
end: number;
|
|
97
137
|
};
|
|
98
138
|
type CommentUIDragFn = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
99
139
|
export type Settings = {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CommentAnchorMove } from '../settings';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build oldIndex → newIndex for a contiguous block move (row or column drag).
|
|
5
|
+
* `targetIndex` is the insertion index *after* the block has been removed,
|
|
6
|
+
* matching the splice used on the sheet data.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildBlockMoveIndexMap(length: number, sourceStart: number, moveCount: number, targetIndex: number): Record<number, number>;
|
|
9
|
+
export declare function getSheetCommentKeyPrefixes(sheet: {
|
|
10
|
+
id?: string;
|
|
11
|
+
order?: number;
|
|
12
|
+
} | null | undefined, sheetIndex: number): string[];
|
|
13
|
+
export declare function notifyCommentAnchorMove(ctx: {
|
|
14
|
+
hooks?: {
|
|
15
|
+
afterCommentAnchorMove?: (move: CommentAnchorMove) => void;
|
|
16
|
+
};
|
|
17
|
+
}, move: CommentAnchorMove): void;
|
|
@@ -12,7 +12,6 @@ type AdditionalProps = {
|
|
|
12
12
|
sidebarActivePanel?: string | null;
|
|
13
13
|
sidebarPortalRegistry?: SidebarPortalRegistryHandle | null;
|
|
14
14
|
sidebarPortalRenderers?: Record<string, SidebarPortalRenderer>;
|
|
15
|
-
toolbarTrailingContent?: React.ReactNode;
|
|
16
15
|
theme?: ThemeKey;
|
|
17
16
|
};
|
|
18
17
|
declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalProps & React.RefAttributes<{
|