@fileverse-dev/dsheet 4.1.23-stabilise-package-8 → 4.1.24-stabilise-package-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/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from './editor/constants/share
23
23
  export { TEMPLATES } from '@fileverse-dev/dsheets-templates/template-metadata-list';
24
24
  export { handleCSVUpload } from './editor/utils/csv-import';
25
25
  export { importSpreadsheetFile, type ImportSpreadsheetFileOptions, type ImportSpreadsheetFileResult, type SpreadsheetImportFileType, } from './editor/utils/spreadsheet-import';
26
- export { handleExportToXLSX, handleExportToODS } from './editor/utils/xlsx-export';
26
+ export { handleExportToXLSX, handleExportToODS, exportToXLSXBytes, } from './editor/utils/xlsx-export';
27
27
  export { handleExportToCSV } from './editor/utils/csv-export';
28
28
  export { handleExportToJSON } from './editor/utils/json-export';
29
29
  export { useXLSXImport } from './editor/hooks/use-xlsx-import';
package/dist/index.es.js CHANGED
@@ -1,65 +1,66 @@
1
- import { C as s, f as o, g as t, S as r, h as l, j as n, k as d, T as S, l as c, n as i, o as h, p as m, q as p, t as C, u, v as F, w as E, x, z as g, A as R, B as f, D as A, E as I, F as L, G as w, H as y, I as T, J as v, K as D, L as M, M as b, N as k, O as K, P as O, Q as P } from "./index-Dbl7Dh2_.js";
2
- import { cI as z, cJ as J, cK as U, cQ as X, by as _, e as B, f as G, l as H, a as j, dv as q, dw as N, bh as Q, dx as Y, dy as Z, dC as W, dD as $, dF as ee, J as ae, dS as se, eq as oe, ba as te } from "./executeStringFunction-CN6ZZqZM.js";
3
- import { FLVURL as le } from "@fileverse-dev/formulajs";
4
- import { E as de, S as Se } from "./constants-8Ij49Lxv.js";
1
+ import { C as s, f as o, g as t, S as r, h as l, j as n, k as d, T as S, l as c, n as i, o as h, p as m, q as p, t as C, u, v as E, w as F, x, z as R, A as g, B as L, D as A, E as T, F as f, G as I, H as v, I as w, J as y, K as D, L as M, M as X, N as b, O as k, P as z, Q as B, R as O } from "./index-CfRtF9ry.js";
2
+ import { cL as V, cM as G, cN as H, cT as J, bD as K, e as U, f as _, l as N, a as j, dz as q, dA as Q, bh as Y, dB as Z, dC as W, dG as $, dH as ee, dJ as ae, J as se, dX as oe, ev as te, ba as re } from "./executeStringFunction-CT-4of9q.js";
3
+ import { FLVURL as ne } from "@fileverse-dev/formulajs";
4
+ import { E as Se, S as ce } from "./constants-8Ij49Lxv.js";
5
5
  export {
6
6
  s as CommentAction,
7
7
  o as CommentCellUI,
8
8
  t as CommentsContent,
9
9
  r as DSheetEditor,
10
10
  l as DSheetSkeleton,
11
- de as ERROR_MESSAGES_FLAG,
12
- le as FLVURL,
11
+ Se as ERROR_MESSAGES_FLAG,
12
+ ne as FLVURL,
13
13
  n as FortuneCore,
14
- Se as SERVICES_API_KEY,
14
+ ce as SERVICES_API_KEY,
15
15
  d as SupportedChain,
16
16
  S as TEMPLATES,
17
17
  c as api,
18
- z as clearColumnsCellsFormat,
18
+ V as clearColumnsCellsFormat,
19
19
  i as clearFilter,
20
- J as clearRowsCellsFormat,
21
- U as clearSelectedCellFormat,
20
+ G as clearRowsCellsFormat,
21
+ H as clearSelectedCellFormat,
22
22
  h as createFilter,
23
23
  m as decryptForRoomKey,
24
- X as deleteRowCol,
25
- _ as deleteSelectedCellText,
24
+ J as deleteRowCol,
25
+ K as deleteSelectedCellText,
26
26
  p as describeMatchedShortcut,
27
27
  C as encryptForRoomKey,
28
- B as executeStringFunction,
29
- u as fetchSessionState,
30
- G as formulaResponseUiSync,
31
- H as getFlowdata,
28
+ U as executeStringFunction,
29
+ u as exportToXLSXBytes,
30
+ E as fetchSessionState,
31
+ _ as formulaResponseUiSync,
32
+ N as getFlowdata,
32
33
  F as getRemoveDuplicatesErrorMessage,
33
- E as getRemoveDuplicatesPreview,
34
+ x as getRemoveDuplicatesPreview,
34
35
  j as getSheetIndex,
35
- x as handleCSVUpload,
36
+ R as handleCSVUpload,
36
37
  g as handleCopy,
37
- R as handleExportToCSV,
38
- f as handleExportToJSON,
39
- A as handleExportToODS,
40
- I as handleExportToXLSX,
38
+ L as handleExportToCSV,
39
+ A as handleExportToJSON,
40
+ T as handleExportToODS,
41
+ f as handleExportToXLSX,
41
42
  q as handleFreeze,
42
- N as handleHorizontalAlign,
43
- Q as handleLink,
44
- Y as handleMerge,
45
- L as handlePasteByClick,
46
- Z as handleSort,
47
- W as handleTextSize,
48
- $ as handleVerticalAlign,
49
- w as importSpreadsheetFile,
50
- ee as insertRowCol,
51
- y as isBrowserZoomShortcut,
52
- T as isFormulaListShortcut,
53
- v as isOpenShortcutsModalShortcut,
54
- ae as jfrefreshgrid,
55
- se as loadLocale,
56
- D as remapCommentAnchors,
57
- M as removeActiveImage,
43
+ Q as handleHorizontalAlign,
44
+ Y as handleLink,
45
+ Z as handleMerge,
46
+ I as handlePasteByClick,
47
+ W as handleSort,
48
+ $ as handleTextSize,
49
+ ee as handleVerticalAlign,
50
+ v as importSpreadsheetFile,
51
+ ae as insertRowCol,
52
+ w as isBrowserZoomShortcut,
53
+ y as isFormulaListShortcut,
54
+ D as isOpenShortcutsModalShortcut,
55
+ se as jfrefreshgrid,
56
+ oe as loadLocale,
57
+ M as remapCommentAnchors,
58
+ X as removeActiveImage,
58
59
  b as removeDuplicates,
59
60
  k as seedSession,
60
- K as showImgChooser,
61
- oe as toolbarItemClickHandler,
62
- te as updateFormat,
63
- O as useEnsStatus,
64
- P as useXLSXImport
61
+ z as showImgChooser,
62
+ te as toolbarItemClickHandler,
63
+ re as updateFormat,
64
+ B as useEnsStatus,
65
+ O as useXLSXImport
65
66
  };
@@ -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, finishFullFormulaPass, resetFormulaDependencyIndexes, 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, deleteCellsShift, insertCellsShift, } 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, finishFullFormulaPass, resetFormulaDependencyIndexes, 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, deleteCellsShift, insertCellsShift, } 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';
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Pure (DOM-free, ctx-free) logic that decides what an arrow key does while a
3
+ * formula is being edited.
4
+ *
5
+ * GRID - not editing: arrows move the grid selection
6
+ * TEXT_EDIT - arrows move the text caret
7
+ * REFERENCE_READY - next arrow inserts a new cell reference at the caret
8
+ * REFERENCE_ACTIVE - arrows move/extend the reference that was just inserted
9
+ */
10
+ export type FormulaArrowMode = 'GRID' | 'TEXT_EDIT' | 'REFERENCE_READY' | 'REFERENCE_ACTIVE';
11
+ /** Sticky, user-controlled (F2). `null` = automatic behavior. */
12
+ export type FormulaArrowOverride = null | 'TEXT_EDIT' | 'REFERENCE';
13
+ export type TokenKind = 'EQ' | 'SPACE' | 'STRING' | 'REF' | 'NAME' | 'NUMBER' | 'FUNC_NAME' | 'LPAREN' | 'RPAREN' | 'COMMA' | 'OPERATOR' | 'POSTFIX' | 'UNKNOWN';
14
+ export type Token = {
15
+ kind: TokenKind;
16
+ start: number;
17
+ end: number;
18
+ text: string;
19
+ /** STRING / quoted sheet name: closing quote present. */
20
+ terminated?: boolean;
21
+ /** REF that is not (yet) a complete reference, e.g. `A1:A`, `A1:`. */
22
+ partial?: boolean;
23
+ };
24
+ /** Never throws. Offsets index into `text` as given. */
25
+ export declare function tokenizeFormula(text: string): Token[];
26
+ export type CaretContext = {
27
+ inString: boolean;
28
+ /** Caret strictly inside a non-string token (e.g. `A|1`, `SU|M(`). */
29
+ insideToken: Token | null;
30
+ /** REF token the caret is inside or right after (start < caret <= end). */
31
+ touchingRef: Token | null;
32
+ prevSig: Token | null;
33
+ nextSig: Token | null;
34
+ };
35
+ export declare function getCaretContext(tokens: Token[], caret: number): CaretContext;
36
+ /**
37
+ * True when a new operand (cell reference) can be entered at the caret:
38
+ * the previous significant token wants an operand, the caret is not inside a
39
+ * string or token, and no operand sits immediately to the right.
40
+ */
41
+ export declare function isOperandSlot(ctx: CaretContext): boolean;
42
+ export type ArrowModeInput = {
43
+ editing: boolean;
44
+ /** Full editor text (offsets of `caretOffset` index into it). */
45
+ text: string;
46
+ /** null when the caret is not inside the editor. */
47
+ caretOffset: number | null;
48
+ override: FormulaArrowOverride;
49
+ /** false for sessions opened on an existing formula (F2 / dblclick / bar). */
50
+ autoAllowed: boolean;
51
+ /**
52
+ * The engine is driving a reference right now (mouse drag, or a reference the
53
+ * keyboard just inserted and the caret is still on).
54
+ */
55
+ refActive: boolean;
56
+ };
57
+ /** Decision priority from the product spec, evaluated in this exact order. */
58
+ export declare function resolveArrowMode(input: ArrowModeInput): FormulaArrowMode;
59
+ /**
60
+ * F2 while editing a formula: flip between caret and reference selection.
61
+ *
62
+ * Toggles the stored override once one exists, so a second press always undoes
63
+ * the first, even at a caret where the derived mode cannot change (e.g. after
64
+ * `)`). With no stored override, flips from the mode the user is looking at.
65
+ */
66
+ export declare function overrideAfterF2(mode: FormulaArrowMode, current?: FormulaArrowOverride): FormulaArrowOverride;
67
+ /**
68
+ * Rule 4: keys typed while a reference is active end the arrow-driven
69
+ * reference. The next mode is then derived from the caret position
70
+ * (operator or `,` -> READY, `)` or anything else -> TEXT_EDIT).
71
+ * keyCode based because it is called from keyup/keydown handlers.
72
+ */
73
+ export declare function isTextChangingKeyCode(kcode: number): boolean;
74
+ /**
75
+ * Keys that edit characters *inside* a reference token (letters, digits incl.
76
+ * numpad digits, Backspace/Delete). Typing them over an arrow-inserted
77
+ * reference makes it a hand-edited token, so its highlight must be dropped.
78
+ * Operators, commas and spaces are not here: they end the reference but leave
79
+ * its highlight alone (see `isTextChangingKeyCode`).
80
+ */
81
+ export declare function isReferenceDirtyingKeyCode(kcode: number): boolean;
@@ -1,5 +1,6 @@
1
1
  import { Cell, CellMatrix, Rect, Selection } from '../types';
2
2
  import { Context } from '../context';
3
+ import { FormulaArrowMode, FormulaArrowOverride } from './formula-arrow-mode';
3
4
  import { FormulaAsyncEvalJob } from './formula-async-eval';
4
5
  import { RangePassCacheEntry } from './formula-range-cache';
5
6
  import { WideRange } from './formula-transitive-deps';
@@ -29,6 +30,9 @@ export declare class FormulaCache {
29
30
  rangedrag_row_start?: boolean;
30
31
  rangeSelectionActive?: boolean | null;
31
32
  keyboardRangeSelectionLock?: boolean;
33
+ arrowOverride?: FormulaArrowOverride;
34
+ arrowAutoAllowed?: boolean;
35
+ arrowSessionCell?: [number, number];
32
36
  /** True after arrow/Shift+arrow moved `func_selectedrange` without updating yellow selection. */
33
37
  formulaKeyboardRefSync?: boolean;
34
38
  formulaEditorOwner?: 'cell' | 'fx' | null;
@@ -180,6 +184,14 @@ export declare function execFunctionGroup(ctx: Context, origin_r: number, origin
180
184
  * without resizing `luckysheet_select_save`.
181
185
  */
182
186
  export declare function seedFormulaFuncSelectedRangeFromLastSelection(ctx: Context): boolean;
187
+ /**
188
+ * Explicit reference selection (F2) with the caret on an existing reference:
189
+ * seed the keyboard range from *that reference*, so the first arrow moves it
190
+ * from where it is (`=SUM(A1|)` + Right -> `=SUM(B1)`), not from the edited
191
+ * cell. Replaces any stale `func_selectedrange`. Returns false when the caret
192
+ * is not on a complete reference on the visible sheet.
193
+ */
194
+ export declare function seedFormulaFuncSelectedRangeFromTouchedReference(ctx: Context): boolean;
183
195
  export declare function createFormulaRangeSelect(ctx: Context, select: {
184
196
  rangeIndex: number;
185
197
  } & Rect): void;
@@ -228,7 +240,7 @@ export declare function isBareCellOrRangeOnlyFormula(formulaText: string): boole
228
240
  * disable sheet-driven range selection until the caret reaches a fresh insertion slot
229
241
  * (comma, open paren, operator, etc.) or the user starts an active range drag.
230
242
  */
231
- export declare function suppressFormulaRangeSelectionForInitialEdit(ctx: Context): void;
243
+ export declare function suppressFormulaRangeSelectionForInitialEdit(ctx: Context, cell?: [number, number]): void;
232
244
  export declare function isCaretAtValidFormulaRangeInsertionPoint(editor: HTMLElement | null): boolean;
233
245
  export declare function markRangeSelectionDirty(ctx: Context): void;
234
246
  /**
@@ -247,6 +259,25 @@ export type FormulaTabs = {
247
259
  /** True while picking a range for a formula (sheet selection drives references). */
248
260
  export declare function isLegacyFormulaRangeMode(ctx: Context): boolean;
249
261
  export declare function israngeseleciton(ctx: Context, istooltip?: boolean): boolean;
262
+ /**
263
+ * Start (or end) an arrow-key session with the defaults: automatic reference
264
+ * selection on, no F2 override. Call when a session opens on a cell that does
265
+ * not hold a formula, and when one ends.
266
+ */
267
+ export declare function resetFormulaArrowSession(ctx: Context): void;
268
+ /** The F2 override / auto flag in effect for the cell being edited right now. */
269
+ export declare function getFormulaArrowSession(ctx: Context): {
270
+ override: FormulaArrowOverride;
271
+ autoAllowed: boolean;
272
+ };
273
+ /** F2 pressed while editing: store the new override for this cell's session. */
274
+ export declare function setFormulaArrowOverride(ctx: Context, override: FormulaArrowOverride): void;
275
+ /**
276
+ * Single source of truth for what an arrow key does while editing.
277
+ * Thin ctx/DOM adapter over the pure `resolveArrowMode`.
278
+ */
279
+ export declare function getFormulaArrowMode(ctx: Context): FormulaArrowMode;
280
+ /** True while arrows should drive a cell reference (READY or ACTIVE). */
250
281
  export declare function isFormulaReferenceInputMode(ctx: Context): boolean;
251
282
  export declare function maybeRecoverDirtyRangeSelection(ctx: Context): boolean;
252
283
  export declare function functionStrChange(txt: string, type: string, rc: 'row' | 'col', orient: string | null, stindex: number, step: number, tabs: FormulaTabs): string;
@@ -4,7 +4,7 @@ export { default as clipboard } from './clipboard';
4
4
  export { moveToEnd, getRangeRectsByCharacterOffset } from './cursor';
5
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
- 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';
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, resetFormulaArrowSession, 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';
9
9
  export type { FormulaAsyncEvalJob } from './formula-async-eval';
10
10
  export { initFreeze } from './freeze';
@@ -0,0 +1 @@
1
+ export {};
@@ -8,6 +8,7 @@ interface ISocketClientConfig {
8
8
  ownerEdSecret?: string;
9
9
  contractAddress?: string;
10
10
  ownerAddress?: string;
11
+ appFileId?: string;
11
12
  editLock?: string;
12
13
  encryptedTitle?: string;
13
14
  identityToken?: string;
@@ -72,6 +73,7 @@ export declare class SocketClient {
72
73
  private collaborationUcan?;
73
74
  private serverClock;
74
75
  private ownerAddress?;
76
+ private appFileId?;
75
77
  private editLock?;
76
78
  private encryptedTitle?;
77
79
  private identityToken?;
@@ -0,0 +1 @@
1
+ export {};
@@ -77,6 +77,8 @@ export interface CollabConnectionConfig {
77
77
  ownerEdSecret?: string;
78
78
  contractAddress?: string;
79
79
  ownerAddress?: string;
80
+ /** Host signal (opaque-link sheets): the on-chain dsheetId, sent to the server as ddocId alongside the public room id. */
81
+ appFileId?: string;
80
82
  roomInfo?: {
81
83
  documentTitle: string;
82
84
  portalAddress: string;
@@ -300,6 +302,7 @@ export interface IAuthArgs {
300
302
  ownerToken?: string;
301
303
  ownerAddress?: string;
302
304
  contractAddress?: string;
305
+ ddocId?: string;
303
306
  sessionDid?: string;
304
307
  roomInfo?: string;
305
308
  identityToken?: string;
@@ -1,10 +1,10 @@
1
1
  import * as BZ from "yjs";
2
- import { i as Yl, a as hl, b as ul, s as eZ, r as Il, y as pl, d as Rl, m as sl } from "./index-Dbl7Dh2_.js";
3
- import { g as al } from "./executeStringFunction-CN6ZZqZM.js";
2
+ import { i as Yl, a as hl, b as ul, s as eZ, r as Il, y as pl, d as Rl, m as sl } from "./index-CfRtF9ry.js";
3
+ import { g as al } from "./executeStringFunction-CT-4of9q.js";
4
4
  import { Workbook as Kl } from "exceljs";
5
5
  import Jl from "luckyexcel";
6
- import { e as xl, b as Ml, n as Sl } from "./xlsx-hyperlink-inline-DjtQMKIL.js";
7
- import { parseDefinedNamesFromXlsxBuffer as Nl, excelEntriesToDefinedNames as OZ } from "./xlsx-defined-names-C6c8LJn5.js";
6
+ import { e as xl, b as Ml, n as Sl } from "./xlsx-hyperlink-inline-DGb-w2IM.js";
7
+ import { parseDefinedNamesFromXlsxBuffer as Nl, excelEntriesToDefinedNames as OZ } from "./xlsx-defined-names-D6d7zKHF.js";
8
8
  import { toast as fZ } from "@fileverse/ui";
9
9
  var Zl = { exports: {} };
10
10
  (function(m) {
@@ -1,5 +1,5 @@
1
- import { i as w } from "./executeStringFunction-CN6ZZqZM.js";
2
- import { J as x } from "./xlsx-hyperlink-inline-DjtQMKIL.js";
1
+ import { i as w } from "./executeStringFunction-CT-4of9q.js";
2
+ import { J as x } from "./xlsx-hyperlink-inline-DGb-w2IM.js";
3
3
  function g(o) {
4
4
  return o.startsWith("_xlnm.");
5
5
  }