@fileverse-dev/dsheet 4.1.12 → 4.1.13-a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/{es-yR2JIXsz.js → es-S4GKlN-t.js} +15 -11
  2. package/dist/{executeStringFunction-BaZeRysE.js → executeStringFunction-D1IXrBP2.js} +4128 -4040
  3. package/dist/formula.js +1 -1
  4. package/dist/{hi-DRcLnrnZ.js → hi-DMMTDTxZ.js} +15 -11
  5. package/dist/{index-D0OdnFi2.js → index-C2bF_Npd.js} +11740 -11670
  6. package/dist/index.es.js +7 -7
  7. package/dist/sheet-engine/core/index.d.ts +2 -2
  8. package/dist/sheet-engine/core/modules/date-base-locale.d.ts +2 -0
  9. package/dist/sheet-engine/core/modules/index.d.ts +1 -1
  10. package/dist/sheet-engine/core/modules/validation.date.test.d.ts +1 -0
  11. package/dist/sheet-engine/core/utils/freeze.d.ts +15 -0
  12. package/dist/sheet-engine/core/utils/index.d.ts +2 -1
  13. package/dist/sheet-engine/core/utils/sheet-name-ref.d.ts +21 -0
  14. package/dist/sheet-engine/core/utils/sheet-name-ref.test.d.ts +1 -0
  15. package/dist/sheet-engine/formula-parser/quoted-sheet-ref.test.d.ts +1 -0
  16. package/dist/sheet-engine/react/hooks/useLastFormulaCaretOffset.d.ts +14 -0
  17. package/dist/style.css +1 -1
  18. package/dist/{use-xlsx-import-impl-Cfz1iq04.js → use-xlsx-import-impl-DSYOyk4c.js} +4 -4
  19. package/dist/{xlsx-defined-names-CQYS45zi.js → xlsx-defined-names-AmoE3FGc.js} +2 -2
  20. package/dist/{xlsx-export-impl-06gHB4Bx.js → xlsx-export-impl-Buo3mgXM.js} +4 -4
  21. package/dist/{xlsx-hyperlink-inline-DQRkchZf.js → xlsx-hyperlink-inline-BqwlPUEK.js} +2 -2
  22. package/dist/{zh-B1KUs68q.js → zh-Bv4KIDiJ.js} +15 -11
  23. package/dist/{zh_tw-B9_7WgLO.js → zh_tw-BdpsK45h.js} +15 -11
  24. package/package.json +2 -2
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
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 g, x, z as R, A as f, B as A, D as I, E as L, F as T, G as w, H as y, I as v, J as D, K as M, L as b, M as k, N as z, O, P } from "./index-D0OdnFi2.js";
2
- import { cy as G, cz as K, cA as U, cG as X, bs as _, e as j, f as B, l as H, a as q, di as J, dj as N, bb as Y, dk as Z, dl as Q, dq as W, dr as $, dt as ee, I as ae, dI as se, ef as oe, b4 as te } from "./executeStringFunction-BaZeRysE.js";
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 g, x, z as R, A, B as f, D as I, E as L, F as T, G as w, H as y, I as v, J as D, K as M, L as b, M as k, N as z, O, P } from "./index-C2bF_Npd.js";
2
+ import { cy as G, cz as K, cA as U, cG as X, bs as _, e as j, f as B, l as H, a as J, dj as N, dk as q, bb as Y, dl as Z, dm as Q, dr as W, ds as $, du as ee, I as ae, dJ as se, eg as oe, b4 as te } from "./executeStringFunction-D1IXrBP2.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 {
@@ -31,15 +31,15 @@ export {
31
31
  H as getFlowdata,
32
32
  E as getRemoveDuplicatesErrorMessage,
33
33
  F as getRemoveDuplicatesPreview,
34
- q as getSheetIndex,
34
+ J as getSheetIndex,
35
35
  g as handleCSVUpload,
36
36
  x as handleCopy,
37
37
  R as handleExportToCSV,
38
- f as handleExportToJSON,
39
- A as handleExportToODS,
38
+ A as handleExportToJSON,
39
+ f as handleExportToODS,
40
40
  I as handleExportToXLSX,
41
- J as handleFreeze,
42
- N as handleHorizontalAlign,
41
+ N as handleFreeze,
42
+ q as handleHorizontalAlign,
43
43
  Y as handleLink,
44
44
  Z as handleMerge,
45
45
  L as handlePasteByClick,
@@ -7,9 +7,9 @@ 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, 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';
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, 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
- export { getFreezeState, toggleFreeze, indexToColumnChar, escapeScriptTag, escapeHTMLTag, getSheetIndex, replaceHtml, isAllowEdit, isAllowEditReadOnly, filterPatch, patchToOp, opToPatch, inverseRowColOptions, } from './utils';
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';
14
14
  export type { Op, Cell, CellWithRowAndCol, CellMatrix, HyperlinkEntry, Selection, Presence, Sheet, GlobalCache, SingleRange, Range, SearchResult, LinkCardProps, LiveQueryData, Freezen, DefinedName, } from './types';
15
15
  export type { RemoveDuplicatesColumnOption, RemoveDuplicatesError, RemoveDuplicatesOptions, RemoveDuplicatesPreview, RemoveDuplicatesResult, } from './modules';
@@ -3,6 +3,8 @@ export declare function normalizeDateBaseLocale(locale: unknown): DateBaseLocale
3
3
  export declare function setDateBaseLocale(locale: unknown): void;
4
4
  export declare function getDateBaseLocale(): DateBaseLocale;
5
5
  export declare function isUsDateBaseLocale(): boolean;
6
+ /** Standard Date toolbar / formula display format (no leading zeros). */
7
+ export declare function getCanonicalDateDisplayFormat(hasTime?: boolean): string;
6
8
  export declare function getCanonicalDateEditFormat(hasTime: boolean): string;
7
9
  export declare function shouldPreserveDateFormatForEdit(format: string): boolean;
8
10
  export declare function getDateEditFormatForCell(cellDateFormat: string, hasTime: boolean): string;
@@ -2,7 +2,7 @@ export { getBorderInfoComputeRange, getBorderInfoCompute } from './border';
2
2
  export { normalizedCellAttr, normalizedAttr, getCellValue, setCellValue, getRealCellValue, mergeBorder, cancelNormalSelected, updateCell, getRangetxt, getRangeByTxt, isValidRangeText, getInlineStringHTML, getStyleByCell, clearSelectedCellFormat, clearRowsCellsFormat, clearColumnsCellsFormat, cancelFunctionrangeSelected, } from './cell';
3
3
  export { default as clipboard } from './clipboard';
4
4
  export { moveToEnd, getRangeRectsByCharacterOffset } from './cursor';
5
- export { getDateBaseLocale, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, } from './date-base-locale';
5
+ export { getDateBaseLocale, getCanonicalDateDisplayFormat, getCanonicalDateEditFormat, getDateEditFormatForCell, isUsDateBaseLocale, normalizeDateBaseLocale, shouldPreserveDateFormatForEdit, setDateBaseLocale, } from './date-base-locale';
6
6
  export { update, is_date, valueShowEs, isTypedCurrencyDisplayFormat, isCurrencyLikeNumberFormat, buildFiatCurrencyFormat, quoteSsfLiteral, } from './format';
7
7
  export { FormulaCache, groupValuesRefresh, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, createFormulaRangeSelect, maybeRecoverDirtyRangeSelection, delFunctionGroup, functionHTMLGenerate, onFormulaRangeDragEnd, rangeDrag, rangeSetValue, remapFormulaReferencesByMap, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, getFormulaRangeIndexForKeyboardSync, isFormulaReferenceInputMode, seedFormulaFuncSelectedRangeFromLastSelection, functionStrChange, setFormulaEditorOwner, getAllFunctionGroup, suppressFormulaRangeSelectionForInitialEdit, ensureFormulaRangeToSheet, shouldPreserveFormulaEditOnSheetSwitch, activateSheetForNavigation, returnToFormulaOriginSheet, } from './formula';
8
8
  export { FORMULA_ASYNC_CHUNK_SIZE, FORMULA_ASYNC_EVAL_THRESHOLD, FORMULA_WORKER_CHUNK_SIZE, FORMULA_WORKER_THRESHOLD, isFormulaEvalPending, } from './formula-async-eval';
@@ -4,5 +4,20 @@ export declare const getFreezeState: (ctx: Context) => {
4
4
  isRowFrozen: boolean;
5
5
  isColFrozen: boolean;
6
6
  };
7
+ /**
8
+ * Pixel size (in the same zoomed screen-pixel space as visibledatarow /
9
+ * visibledatacolumn) of the frozen strip currently pinned to the top-left
10
+ * of the viewport. Zero on an axis that isn't frozen.
11
+ *
12
+ * Frozen rows/columns are only ever redrawn at a fixed on-screen position
13
+ * by the canvas itself -- there's no separate DOM layer for them -- so any
14
+ * DOM overlay positioned in document space (e.g. inserted images) needs
15
+ * this boundary to know when it has scrolled into the area the frozen
16
+ * pane owns and should stay hidden behind it.
17
+ */
18
+ export declare const getFrozenPixelBounds: (ctx: Context) => {
19
+ widthPx: number;
20
+ heightPx: number;
21
+ };
7
22
  export type FreezeType = 'row' | 'column' | 'both' | 'unfreeze-row' | 'unfreeze-column' | 'unfreeze-all';
8
23
  export declare const toggleFreeze: (ctx: Context, type: FreezeType) => void;
@@ -3,7 +3,8 @@ import { Sheet } from '../types';
3
3
 
4
4
  export { filterPatch, patchToOp, opToPatch, inverseRowColOptions, extractFormulaCellOps, } from './patch';
5
5
  export type { PatchOptions, ChangedSheet } from './patch';
6
- export { getFreezeState, toggleFreeze } from './freeze';
6
+ export { getFreezeState, getFrozenPixelBounds, toggleFreeze } from './freeze';
7
+ export { sheetNameNeedsQuotes, formatSheetNameForFormula, quoteSheetNamesInFormula, } from './sheet-name-ref';
7
8
  export type { FreezeType } from './freeze';
8
9
  export declare function generateRandomSheetName(file: Sheet[], isPivotTable: boolean, ctx: Context): any;
9
10
  export declare function rgbToHex(color: string): string;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Helpers for sheet-qualified references in formulas (`Sheet1!A1`,
3
+ * `'Finance - 1'!A1`, `'It''s'!A1`).
4
+ *
5
+ * Like Google Sheets / Excel, a sheet name can only appear bare when it is a
6
+ * plain identifier. Anything else (spaces, `-`, punctuation, a leading digit,
7
+ * a name that looks like a cell such as `A1`, non-Latin scripts) must be
8
+ * wrapped in single quotes, with embedded `'` doubled.
9
+ */
10
+ export declare function sheetNameNeedsQuotes(name: string): boolean;
11
+ /** `Sheet1` -> `Sheet1`, `Finance - 1` -> `'Finance - 1'`, `It's` -> `'It''s'`. */
12
+ export declare function formatSheetNameForFormula(name: string): string;
13
+ /**
14
+ * Wraps bare references to existing sheets whose names need quoting, e.g.
15
+ * `=SUM(Sheet-4!H6,B2:C2)` -> `=SUM('Sheet-4'!H6,B2:C2)`.
16
+ *
17
+ * Only exact (case-insensitive) matches of an existing sheet name immediately
18
+ * followed by `!` are rewritten; text inside "strings" and already-quoted
19
+ * '...' names is left untouched.
20
+ */
21
+ export declare function quoteSheetNamesInFormula(formula: string, sheetNames: string[]): string;
@@ -0,0 +1,14 @@
1
+ import { RefObject } from 'react';
2
+
3
+ /**
4
+ * Remembers the last caret position (text offset) inside a formula editor.
5
+ *
6
+ * Clicking a sheet tab moves the DOM selection out of the editor, so by the
7
+ * time the sheet switch finishes the caret is gone. The value kept here lets
8
+ * the editor put the caret back exactly where the user left it (e.g. after the
9
+ * `,` in `=SUM('Sheet - 2'!B2,`) instead of guessing.
10
+ *
11
+ * The offset counts characters across text nodes, matching
12
+ * `setCursorPosition`. It resets to `null` when the edit session ends.
13
+ */
14
+ export declare function useLastFormulaCaretOffset(editorRef: RefObject<HTMLDivElement | null>, editSessionActive: boolean): RefObject<number | null>;