@fileverse-dev/dsheet 2.1.2 → 2.1.3-package-cleanup-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.
Files changed (74) hide show
  1. package/dist/editor/components/api-key-modal/api-key-input.d.ts +5 -0
  2. package/dist/editor/components/api-key-modal/api-key-modal.d.ts +7 -0
  3. package/dist/editor/components/api-key-modal/rate-limit-info.d.ts +4 -0
  4. package/dist/editor/components/comments/comment-actions-dropdown.d.ts +19 -0
  5. package/dist/editor/components/comments/comment-cell-popup.d.ts +4 -0
  6. package/dist/editor/components/comments/comment-input.d.ts +4 -0
  7. package/dist/editor/components/comments/comment-item.d.ts +4 -0
  8. package/dist/editor/components/comments/comment-sidebar-empty.d.ts +4 -0
  9. package/dist/editor/components/comments/comment-sidebar.d.ts +4 -0
  10. package/dist/editor/components/comments/ens/ens-cache.d.ts +10 -0
  11. package/dist/editor/components/comments/ens/use-ens-status.d.ts +10 -0
  12. package/dist/editor/components/comments/use-comment-cell-popup.d.ts +12 -0
  13. package/dist/editor/components/comments/use-comment-permissions.d.ts +15 -0
  14. package/dist/editor/components/editor-workbook.d.ts +11 -14
  15. package/dist/editor/components/sidebar/editor-right-sidebar.d.ts +20 -0
  16. package/dist/editor/components/sidebar/right-sidebar.d.ts +14 -0
  17. package/dist/editor/components/sidebar/sidebar-context.d.ts +17 -0
  18. package/dist/editor/components/sidebar/sidebar-portal-registry.d.ts +20 -0
  19. package/dist/editor/components/sidebar/use-right-panels.d.ts +12 -0
  20. package/dist/editor/components/sidebars/conditional-format.d.ts +2 -0
  21. package/dist/editor/components/sidebars/data-verification.d.ts +2 -0
  22. package/dist/editor/components/sidebars/function/function-categories-logic.d.ts +11 -0
  23. package/dist/editor/components/sidebars/function/function-categories.d.ts +6 -0
  24. package/dist/editor/components/sidebars/function/function-metadata.d.ts +7 -0
  25. package/dist/editor/components/sidebars/function/functionList.d.ts +8 -0
  26. package/dist/editor/components/sidebars/function/types.d.ts +24 -0
  27. package/dist/editor/components/sidebars/function/use-functions.d.ts +20 -0
  28. package/dist/editor/components/sidebars/function-content.d.ts +8 -0
  29. package/dist/editor/components/sidebars/template-ui.d.ts +22 -0
  30. package/dist/editor/components/sidebars/templates.d.ts +9 -0
  31. package/dist/editor/contexts/editor-context.d.ts +16 -4
  32. package/dist/editor/dsheet-editor.d.ts +1 -1
  33. package/dist/editor/hooks/live-query/use-live-query.d.ts +4 -2
  34. package/dist/editor/hooks/use-editor-data.d.ts +4 -2
  35. package/dist/editor/types/comments.d.ts +133 -0
  36. package/dist/editor/types.d.ts +36 -29
  37. package/dist/editor/utils/after-update-cell.d.ts +13 -8
  38. package/dist/editor/utils/api-key-storage.d.ts +6 -0
  39. package/dist/editor/utils/api-keys-local-storage.d.ts +19 -0
  40. package/dist/editor/utils/cell-comment-marker.d.ts +29 -0
  41. package/dist/editor/utils/comment-key-utils.d.ts +7 -0
  42. package/dist/editor/utils/data-block-error-handler.d.ts +21 -0
  43. package/dist/editor/utils/datablock-error-utils.d.ts +1 -0
  44. package/dist/editor/utils/sheet-editor-safe.d.ts +26 -0
  45. package/dist/{executeStringFunction-CGbxAbbw.js → executeStringFunction-C26SXUpc.js} +4741 -4363
  46. package/dist/formula.js +1 -1
  47. package/dist/index-DSogq3Tz.js +55498 -0
  48. package/dist/index.d.ts +8 -1
  49. package/dist/index.es.js +55 -51
  50. package/dist/sheet-engine/core/context.d.ts +5 -0
  51. package/dist/sheet-engine/core/index.d.ts +1 -1
  52. package/dist/sheet-engine/core/modules/formula-async-eval.d.ts +53 -0
  53. package/dist/sheet-engine/core/modules/formula-eval.worker.d.ts +1 -0
  54. package/dist/sheet-engine/core/modules/formula-range-cache.d.ts +20 -0
  55. package/dist/sheet-engine/core/modules/formula-snapshot-eval.d.ts +40 -0
  56. package/dist/sheet-engine/core/modules/formula-transitive-deps.d.ts +7 -0
  57. package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +16 -0
  58. package/dist/sheet-engine/core/modules/formula-worker-types.d.ts +24 -0
  59. package/dist/sheet-engine/core/modules/formula.d.ts +26 -1
  60. package/dist/sheet-engine/core/modules/index.d.ts +3 -1
  61. package/dist/sheet-engine/core/theme.d.ts +67 -0
  62. package/dist/sheet-engine/react/components/SheetOverlay/Icon.d.ts +5 -4
  63. package/dist/sheet-engine/react/components/SheetOverlay/LucideIcon.d.ts +4 -4
  64. package/dist/sheet-engine/react/components/SidebarPanelPortals/index.d.ts +17 -0
  65. package/dist/sheet-engine/react/components/Workbook/index.d.ts +6 -0
  66. package/dist/sheet-engine/react/components/index.d.ts +1 -0
  67. package/dist/sheet-engine/react/utils/datepickerStyles.d.ts +1 -1
  68. package/dist/style.css +1 -1
  69. package/dist/{use-xlsx-import-impl-arHLnoR4.js → use-xlsx-import-impl-C-PHnu49.js} +2 -2
  70. package/dist/{xlsx-export-impl-t86QBMF3.js → xlsx-export-impl-BAJCFNh6.js} +2 -2
  71. package/package.json +4 -3
  72. package/dist/index-DzIdZpns.js +0 -52604
  73. package/dist/sheet-engine/react/components/Toolbar/conditionalFormatPortal.d.ts +0 -7
  74. package/dist/sheet-engine/react/components/Toolbar/dataVerificationPortal.d.ts +0 -6
package/dist/index.d.ts CHANGED
@@ -4,7 +4,14 @@ 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 } from './editor/types';
7
+ export type { ErrorMessageHandlerReturnType, DataBlockEvent, DataBlockEventType, ApiKeyStorage } from './editor/types';
8
+ export type { PanelConfig, PanelId, BuiltInPanelType } from './editor/types';
9
+ export type { CommentThread, CommentReply, CommentActionParams, CommentsConfig, } from './editor/types/comments';
10
+ export { CommentAction } from './editor/types/comments';
11
+ export { CommentsContent } from './editor/components/comments/comment-sidebar';
12
+ export { CommentCellUI } from './editor/components/comments/comment-cell-popup';
13
+ export { useEnsStatus } from './editor/components/comments/ens/use-ens-status';
14
+ export type { EnsStatus } from './editor/components/comments/ens/ens-cache';
8
15
  export type { WorkbookInstance } from './sheet-engine/react';
9
16
  export type { CollaborationProps, CollabConnectionConfig, CollabSessionMeta, CollabServices, CollabCallbacks, CollabState, CollabStatus, CollabError, CollabErrorCode, CollabUser, } from './sync-local/types';
10
17
  export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from './editor/constants/shared-constants';
package/dist/index.es.js CHANGED
@@ -1,53 +1,57 @@
1
- import { S as s, a as o, i as t, T as r, b as l, d as n, e as d, f as S, g as h, h as i, j as c, k as m, l as p, n as u, o as C, p as E, q as F, r as g, s as x, t as R, u as f, v as L, w, x as A, z as T, A as b, B as v, C as I, D, E as M, F as k, G as V } from "./index-DzIdZpns.js";
2
- import { bQ as P, bR as X, bS as _, ar as y, bh as B, e as G, f as O, h as U, a as j, cf as q, aq as H, cm as J } from "./executeStringFunction-CGbxAbbw.js";
3
- import { FLVURL as N } from "@fileverse-dev/formulajs";
4
- import { E as Y, S as Z } from "./constants-yStXQJiK.js";
1
+ import { C as s, a as t, b as o, S as l, d as r, i as n, T as d, e as i, f as S, g as c, h, j as m, k as C, l as u, n as p, o as E, p as F, q as g, r as x, s as R, t as f, u as A, v as I, w as L, x as w, z as T, A as b, B as v, D, E as M, F as k, G as V, H as X, I as z, J as P, K as U } from "./index-DSogq3Tz.js";
2
+ import { bX as j, bY as y, bZ as B, at as G, bj as H, e as O, f as J, h as K, a as Y, cm as Z, as as q, cu as N } from "./executeStringFunction-C26SXUpc.js";
3
+ import { FLVURL as W } from "@fileverse-dev/formulajs";
4
+ import { E as ee, S as ae } from "./constants-yStXQJiK.js";
5
5
  export {
6
- s as DSheetEditor,
7
- o as DSheetSkeleton,
8
- Y as ERROR_MESSAGES_FLAG,
9
- N as FLVURL,
10
- t as FortuneCore,
11
- Z as SERVICES_API_KEY,
12
- r as TEMPLATES,
13
- l as api,
14
- P as clearColumnsCellsFormat,
15
- n as clearFilter,
16
- X as clearRowsCellsFormat,
17
- _ as clearSelectedCellFormat,
18
- d as createFilter,
19
- y as deleteRowCol,
20
- B as deleteSelectedCellText,
21
- S as describeMatchedShortcut,
22
- G as executeStringFunction,
23
- O as formulaResponseUiSync,
24
- U as getFlowdata,
25
- h as getRemoveDuplicatesErrorMessage,
26
- i as getRemoveDuplicatesPreview,
27
- j as getSheetIndex,
28
- c as handleCSVUpload,
29
- m as handleCopy,
30
- p as handleExportToCSV,
31
- u as handleExportToJSON,
32
- C as handleExportToXLSX,
33
- E as handleFreeze,
34
- F as handleHorizontalAlign,
35
- g as handleLink,
36
- x as handleMerge,
37
- R as handlePasteByClick,
38
- f as handleSort,
39
- L as handleTextSize,
40
- w as handleVerticalAlign,
41
- q as insertRowCol,
42
- A as isBrowserZoomShortcut,
43
- T as isFormulaListShortcut,
44
- b as isOpenShortcutsModalShortcut,
45
- H as jfrefreshgrid,
46
- J as loadLocale,
47
- v as removeActiveImage,
48
- I as removeDuplicates,
49
- D as showImgChooser,
50
- M as toolbarItemClickHandler,
51
- k as updateFormat,
52
- V as useXLSXImport
6
+ s as CommentAction,
7
+ t as CommentCellUI,
8
+ o as CommentsContent,
9
+ l as DSheetEditor,
10
+ r as DSheetSkeleton,
11
+ ee as ERROR_MESSAGES_FLAG,
12
+ W as FLVURL,
13
+ n as FortuneCore,
14
+ ae as SERVICES_API_KEY,
15
+ d as TEMPLATES,
16
+ i as api,
17
+ j as clearColumnsCellsFormat,
18
+ S as clearFilter,
19
+ y as clearRowsCellsFormat,
20
+ B as clearSelectedCellFormat,
21
+ c as createFilter,
22
+ G as deleteRowCol,
23
+ H as deleteSelectedCellText,
24
+ h as describeMatchedShortcut,
25
+ O as executeStringFunction,
26
+ J as formulaResponseUiSync,
27
+ K as getFlowdata,
28
+ m as getRemoveDuplicatesErrorMessage,
29
+ C as getRemoveDuplicatesPreview,
30
+ Y as getSheetIndex,
31
+ u as handleCSVUpload,
32
+ p as handleCopy,
33
+ E as handleExportToCSV,
34
+ F as handleExportToJSON,
35
+ g as handleExportToXLSX,
36
+ x as handleFreeze,
37
+ R as handleHorizontalAlign,
38
+ f as handleLink,
39
+ A as handleMerge,
40
+ I as handlePasteByClick,
41
+ L as handleSort,
42
+ w as handleTextSize,
43
+ T as handleVerticalAlign,
44
+ Z as insertRowCol,
45
+ b as isBrowserZoomShortcut,
46
+ v as isFormulaListShortcut,
47
+ D as isOpenShortcutsModalShortcut,
48
+ q as jfrefreshgrid,
49
+ N as loadLocale,
50
+ M as removeActiveImage,
51
+ k as removeDuplicates,
52
+ V as showImgChooser,
53
+ X as toolbarItemClickHandler,
54
+ z as updateFormat,
55
+ P as useEnsStatus,
56
+ U as useXLSXImport
53
57
  };
@@ -1,5 +1,6 @@
1
1
  import { SheetConfig, Sheet, Selection, Cell, CommentBox, Rect, Image, Presence, LinkCardProps, FilterOptions, RangeDialogProps, DataRegulationProps, ConditionRulesProps, GlobalCache, CellError } from './types';
2
2
  import { FormulaCache } from './modules';
3
+ import { FormulaAsyncEvalJob } from './modules/formula-async-eval';
3
4
  import { DateBaseLocale, Hooks } from './settings';
4
5
 
5
6
  interface MutableRefObject<T> {
@@ -239,6 +240,10 @@ export type Context = {
239
240
  luckysheetPaintSingle: boolean;
240
241
  defaultCell: Cell;
241
242
  groupValuesRefreshData: any[];
243
+ /** Chunked async formula recalc queue (Step 1 perf). Cleared when job completes. */
244
+ formulaAsyncEval?: FormulaAsyncEvalJob | null;
245
+ /** True while `formulaAsyncEval` is draining on the main thread in chunks. */
246
+ isFormulaCalculating?: boolean;
242
247
  /**
243
248
  * Incremented when formula `func_selectedrange` moves via keyboard (`rangeOfFormula`)
244
249
  * so React re-renders — `FormulaCache` is a class and Immer does not track it.
@@ -7,7 +7,7 @@ export { defaultSettings } from './settings';
7
7
  export type { Settings, Hooks, DateBaseLocale } 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, setCaretPosition, getrangeseleciton, getFormulaEditorOwner, rangeHightlightselected, handleFormulaInput, israngeseleciton, createRangeHightlight, maybeRecoverDirtyRangeSelection, getFormulaRangeIndexAtCaret, isCaretAtValidFormulaRangeInsertionPoint, isLegacyFormulaRangeMode, markRangeSelectionDirty, setFormulaEditorOwner, functionHTMLGenerate, suppressFormulaRangeSelectionForInitialEdit, 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, 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, checkCF, getComputeMap, 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, 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, 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, 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, checkCF, getComputeMap, cancelPaintModel, hideCRCount, getdatabyselection, } from './modules';
11
11
  export type { FilterDate, FilterValue, FilterColor } from './modules';
12
12
  export { getFreezeState, 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,53 @@
1
+ /** Minimum formula count before deferring eval to chunked async (Step 1). */
2
+ export declare const FORMULA_ASYNC_EVAL_THRESHOLD = 15;
3
+ /** Formulas evaluated per animation frame during async recalc. */
4
+ export declare const FORMULA_ASYNC_CHUNK_SIZE = 50;
5
+ /** Use a Web Worker when the async job has at least this many formulas. */
6
+ export declare const FORMULA_WORKER_THRESHOLD = 100;
7
+ /** Formulas evaluated per worker message (larger — runs off main thread). */
8
+ export declare const FORMULA_WORKER_CHUNK_SIZE = 300;
9
+ /** Maximum time to wait for a worker chunk before falling back to the real engine. */
10
+ export declare const FORMULA_WORKER_CHUNK_TIMEOUT_MS = 30000;
11
+ /** localStorage key for the optional formula execution debug panel. */
12
+ export declare const FORMULA_EXEC_DEBUG_STORAGE_KEY = "fortune-formula-execution-debug";
13
+ export declare function isFormulaExecutionDebugEnabled(): boolean;
14
+ export type FormulaEvalDebugMode = 'worker' | 'main-thread' | 'fallback';
15
+ export type FormulaEvalDebug = {
16
+ mode: FormulaEvalDebugMode;
17
+ lastChunkMs: number;
18
+ lastChunkSize: number;
19
+ completedChunks: number;
20
+ fallbackChunks: number;
21
+ workerAvailable: boolean;
22
+ unsafeFormulaCount: number;
23
+ workerFormulaCount: number;
24
+ totalWorkerFormulas: number;
25
+ totalMainThreadFormulas: number;
26
+ lastError: string | null;
27
+ };
28
+ export type FormulaAsyncEvalJob = {
29
+ formulaRunList: Array<{
30
+ r: number;
31
+ c: number;
32
+ id: string;
33
+ calc_funcStr: string;
34
+ level?: number;
35
+ }>;
36
+ calcChainKeys: string[];
37
+ impactedByCircular: string[];
38
+ cycleNodes: string[];
39
+ workerSnapshotKey: string;
40
+ nextIndex: number;
41
+ total: number;
42
+ debug?: FormulaEvalDebug;
43
+ };
44
+ export declare function isFormulaEvalPending(ctx: {
45
+ isFormulaCalculating?: boolean;
46
+ formulaAsyncEval?: FormulaAsyncEvalJob | null;
47
+ }): boolean;
48
+ /**
49
+ * The worker snapshot evaluator intentionally handles only scalar formulas that
50
+ * mirror the main engine well. Dynamic/spill/range-indirection formulas stay on
51
+ * the main thread so `spillSortResult` and special range logic remain authoritative.
52
+ */
53
+ export declare function isFormulaWorkerUnsafe(calcFuncStr: string): boolean;
@@ -0,0 +1,20 @@
1
+ export type RangePassCacheEntry = {
2
+ fragment: any[][];
3
+ cryptoDenomination: string;
4
+ cryptoDecimal: number;
5
+ globalDataKeysFingerprint: string;
6
+ };
7
+ export declare function makeRangePassCacheKey(sheetId: string, startRow: number, endRow: number, startCol: number, endCol: number): string;
8
+ export declare function collectGlobalDataKeysInRange(execFunctionGlobalData: Record<string, unknown>, sheetId: string, startRow: number, endRow: number, startCol: number, endCol: number): string;
9
+ /** Remove the formula origin cell from a full rectangular range fragment. */
10
+ export declare function sliceRangeFragmentForOrigin(full: any[][], startRow: number, startCol: number, originRow: number | null | undefined, originCol: number | null | undefined): any[][];
11
+ type RangeCacheHost = {
12
+ rangeValuePassCache?: Map<string, RangePassCacheEntry>;
13
+ rangeValuePassCacheStats?: {
14
+ hits: number;
15
+ misses: number;
16
+ };
17
+ };
18
+ export declare function beginRangeValuePassCache(cache: RangeCacheHost): void;
19
+ export declare function clearRangeValuePassCache(cache: RangeCacheHost): void;
20
+ export {};
@@ -0,0 +1,40 @@
1
+ import { CellMatrix } from '../types';
2
+
3
+ export type SnapshotSheet = {
4
+ id: string;
5
+ name: string;
6
+ data: CellMatrix | null | undefined;
7
+ };
8
+ export type SnapshotFormulaCell = {
9
+ r: number;
10
+ c: number;
11
+ id: string;
12
+ calc_funcStr: string;
13
+ };
14
+ export type SnapshotFormulaResult = {
15
+ r: number;
16
+ c: number;
17
+ id: string;
18
+ v: unknown;
19
+ f: string;
20
+ spe?: unknown;
21
+ deps: string[];
22
+ isError: boolean;
23
+ };
24
+ export type SnapshotEvalInput = {
25
+ sheets: SnapshotSheet[];
26
+ execFunctionGlobalData: Record<string, {
27
+ v: unknown;
28
+ f: unknown;
29
+ }>;
30
+ formulas: SnapshotFormulaCell[];
31
+ };
32
+ export type SnapshotEvalOutput = {
33
+ execFunctionGlobalData: Record<string, {
34
+ v: unknown;
35
+ f: unknown;
36
+ }>;
37
+ results: SnapshotFormulaResult[];
38
+ };
39
+ /** Worker-safe formula evaluation against plain sheet snapshots (no React/immer). */
40
+ export declare function evalFormulasInSnapshot(input: SnapshotEvalInput): SnapshotEvalOutput;
@@ -0,0 +1,7 @@
1
+ /** Cell / formula key format used in depsByCell and revDepsByCell. */
2
+ export declare function toFormulaDepCellKey(sheetId: string, r: number, c: number): string;
3
+ /**
4
+ * Walk revDepsByCell from a changed cell to collect every formula cell that
5
+ * must recalculate (direct + transitive dependents).
6
+ */
7
+ export declare function collectTransitiveFormulaDependents(originCellKey: string, revDepsByCell: Map<string, Set<string>>): Set<string>;
@@ -0,0 +1,16 @@
1
+ import { Context } from '../context';
2
+ import { SnapshotEvalInput, SnapshotEvalOutput, SnapshotFormulaCell, evalFormulasInSnapshot } from './formula-snapshot-eval';
3
+ import { FORMULA_WORKER_CHUNK_SIZE } from './formula-async-eval';
4
+
5
+ export declare function buildSnapshotEvalInput(ctx: Context, formulas: SnapshotFormulaCell[]): SnapshotEvalInput;
6
+ export declare function buildWorkerEvalInput(ctx: Context, formulas: SnapshotFormulaCell[]): Omit<SnapshotEvalInput, 'sheets'>;
7
+ export declare function initFormulaWorkerSnapshot(ctx: Context, snapshotKey: string): boolean;
8
+ /**
9
+ * Evaluate a formula chunk off the critical UI path when possible.
10
+ * Uses an inline Web Worker. Callers should fall back to the real engine on
11
+ * rejection so the worker cannot silently leave a recalculation job hanging.
12
+ */
13
+ export declare function evalFormulasInBackground(snapshotKey: string, input: Omit<SnapshotEvalInput, 'sheets'>): Promise<SnapshotEvalOutput>;
14
+ /** @deprecated Use evalFormulasInBackground */
15
+ export declare const evalFormulasInWorker: typeof evalFormulasInBackground;
16
+ export { FORMULA_WORKER_CHUNK_SIZE, evalFormulasInSnapshot };
@@ -0,0 +1,24 @@
1
+ import { SnapshotEvalInput, SnapshotEvalOutput, SnapshotSheet } from './formula-snapshot-eval';
2
+
3
+ export type WorkerInitSnapshotRequest = {
4
+ type: 'init-snapshot';
5
+ snapshotKey: string;
6
+ sheets: SnapshotSheet[];
7
+ };
8
+ export type WorkerEvalRequest = {
9
+ type: 'eval';
10
+ requestId: number;
11
+ snapshotKey: string;
12
+ input: Omit<SnapshotEvalInput, 'sheets'>;
13
+ };
14
+ export type WorkerRequest = WorkerInitSnapshotRequest | WorkerEvalRequest;
15
+ export type WorkerEvalResponse = {
16
+ type: 'eval-result';
17
+ requestId: number;
18
+ output: SnapshotEvalOutput;
19
+ };
20
+ export type WorkerEvalError = {
21
+ type: 'eval-error';
22
+ requestId: number;
23
+ message: string;
24
+ };
@@ -1,5 +1,8 @@
1
- import { Cell, Rect, Selection } from '../types';
1
+ import { Cell, CellMatrix, Rect, Selection } from '../types';
2
2
  import { Context } from '../context';
3
+ import { FormulaAsyncEvalJob } from './formula-async-eval';
4
+ import { RangePassCacheEntry } from './formula-range-cache';
5
+ import { SnapshotEvalOutput } from './formula-snapshot-eval';
3
6
 
4
7
  /** True when the formula is only numeric ops on TODAY()/NOW() (incl. unary +/−); used to display serials as dates. */
5
8
  export declare function isTodayNowPureArithmeticDateResult(formula: string, value: number): boolean;
@@ -37,6 +40,12 @@ export declare class FormulaCache {
37
40
  depsByCell: Map<string, Set<string>>;
38
41
  /** Reverse dependency graph: referenced cell -> dependent formula cells. */
39
42
  revDepsByCell: Map<string, Set<string>>;
43
+ /**
44
+ * Formulas that referenced a range too large to fully expand into `revDepsByCell`.
45
+ * These must be included on incremental recalcs because a single-cell edit may
46
+ * affect them even when no precise reverse edge exists.
47
+ */
48
+ formulasWithWideRangeDeps: Set<string>;
40
49
  /**
41
50
  * Dependency collection state for the currently-parsed formula, set by `execfunction`.
42
51
  * When null, dependency recording is disabled.
@@ -44,8 +53,20 @@ export declare class FormulaCache {
44
53
  activeDepCollection: null | {
45
54
  originKey: string;
46
55
  deps: Set<string>;
56
+ hasWideRangeDep: boolean;
57
+ };
58
+ /** Step 2: per execFunctionGroup pass cache for materialized range reads. */
59
+ rangeValuePassCache?: Map<string, RangePassCacheEntry>;
60
+ rangeValuePassCacheStats?: {
61
+ hits: number;
62
+ misses: number;
47
63
  };
48
64
  constructor();
65
+ materializeFullRangeFragment(context: Context, sheetId: string, flowdata: CellMatrix | null | undefined, startRow: number, endRow: number, startCol: number, endCol: number): {
66
+ fragment: any[][];
67
+ cryptoDenomination: string;
68
+ cryptoDecimal: number;
69
+ };
49
70
  tryGetCellAsNumber(cell: Cell): string | number | boolean | undefined;
50
71
  }
51
72
  export declare function iscelldata(txt: string): boolean;
@@ -55,6 +76,10 @@ export declare function delFunctionGroup(ctx: Context, r: number, c: number, id?
55
76
  export declare function insertUpdateFunctionGroup(ctx: Context, r: number, c: number, id?: string, calcChainSet?: Set<string>): void;
56
77
  export declare function execfunction(ctx: Context, txt: string, r: number, c: number, id?: string, calcChainSet?: Set<string>, isrefresh?: boolean, notInsertFunc?: boolean): any[];
57
78
  export declare function groupValuesRefresh(ctx: Context): void;
79
+ /** Apply worker chunk output onto the live context (main thread only). */
80
+ export declare function applyWorkerFormulaChunkResults(ctx: Context, output: SnapshotEvalOutput, impactedByCircular: Set<string>, cycleNodes: Set<string>, calcChainKeys?: string[], data?: CellMatrix | null): void;
81
+ /** Run up to `chunkSize` formulas from an async job. Returns true when job is complete. */
82
+ export declare function runFormulaEvalChunk(ctx: Context, job: FormulaAsyncEvalJob, chunkSize?: number): boolean;
58
83
  export declare function execFunctionGroup(ctx: Context, origin_r: number, origin_c: number, value: any, id?: string, data?: any, isForce?: boolean): void;
59
84
  /**
60
85
  * Before the first `moveHighlightCell/Range(..., "rangeOfFormula")` while editing
@@ -5,6 +5,8 @@ export { moveToEnd, getRangeRectsByCharacterOffset } from './cursor';
5
5
  export { getDateBaseLocale, 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, } from './formula';
8
+ export { FORMULA_ASYNC_CHUNK_SIZE, FORMULA_ASYNC_EVAL_THRESHOLD, FORMULA_WORKER_CHUNK_SIZE, FORMULA_WORKER_THRESHOLD, isFormulaEvalPending, } from './formula-async-eval';
9
+ export type { FormulaAsyncEvalJob } from './formula-async-eval';
8
10
  export { initFreeze } from './freeze';
9
11
  export { isInlineStringCell, getInlineStringNoStyle, applyLinkToSelection, getHyperlinksFromInlineSegments, getUniformLinkFromWindowSelectionInEditor, getHyperlinkAtCaretInContentEditable, } from './inline-string';
10
12
  export { rowLocation, rowLocationByIndex, colLocation, colLocationByIndex, } from './location';
@@ -40,6 +42,6 @@ export { sanitizeDuneUrl, insertDuneChart, onIframeMoveStart, onIframeResizeStar
40
42
  export { setCellError, clearCellError, overShowError, } from './error-state-helpers';
41
43
  export { checkCellIsLocked } from './protection';
42
44
  export { detectDateFormat, isdatatypemulti, diff, isdatetime, isRealNull, isRealNum, isNumericCellType, } from './validation';
43
- export { iscelldata, getcellrange, execfunction, execFunctionGroup, insertUpdateFunctionGroup, functionCopy, } from './formula';
45
+ export { iscelldata, getcellrange, execfunction, execFunctionGroup, runFormulaEvalChunk, applyWorkerFormulaChunkResults, insertUpdateFunctionGroup, functionCopy, } from './formula';
44
46
  export { checkCF, getComputeMap } from './ConditionFormat';
45
47
  export { getdatabyselection, getQKBorder } from './cell';
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Grid (canvas) theming — the single source of truth for the JS-painted grid's per-theme colors.
3
+ *
4
+ * The chrome (toolbar, sidebars, comments) themes passively via `@fileverse/ui` `.color-*`
5
+ * utilities + the `<html>` class. The canvas grid cannot read CSS variables, so `canvas.ts`
6
+ * resolves its colors from `activePalette` here. On theme change the host threads a `theme` prop
7
+ * to the engine, which calls `setActiveGridPalette` and repaints via `jfrefreshgrid`.
8
+ *
9
+ * `ThemeKey` is copied verbatim from `fileverse-ddoc` `package/types.ts` so the dsheet `theme`
10
+ * prop is type-identical to ddoc's and a host app can pass the same value to both editors.
11
+ *
12
+ * See docs/superpowers/specs/2026-06-30-dsheet-canvas-theming-design.md
13
+ */
14
+ export type ThemeKey = 'light' | 'dark' | 'theme-sepia' | 'theme-pink' | 'theme-green';
15
+ export declare const DEFAULT_THEME: ThemeKey;
16
+ /**
17
+ * dsheet selection-accent brand color. Constant across all five themes (readable on every
18
+ * background) — intentionally NOT a per-theme palette slot. Used for the fill handle, selection
19
+ * border, and marching ants.
20
+ */
21
+ export declare const SELECTION_ACCENT = "#EFC703";
22
+ /**
23
+ * One slot per neutral grid-chrome color role painted in `canvas.ts`. User-authored cell colors
24
+ * (cell `bg`/`fc`/border, conditional-format colors) are NOT here — they render literally in every
25
+ * theme and are read straight from cell data.
26
+ */
27
+ export interface GridPalette {
28
+ /** Unset cell background + main-area canvas clear (the `!fillStyle` fallback branch). */
29
+ cellBg: string;
30
+ /** Gridlines. */
31
+ gridLine: string;
32
+ /** Default cell text (cells with no user `fc`). */
33
+ cellText: string;
34
+ /** Row/column header background. */
35
+ headerBg: string;
36
+ /** Row/column header text. */
37
+ headerText: string;
38
+ /** Secondary fill for on-canvas chips (e.g. data-verification dropdown). */
39
+ secondaryFill: string;
40
+ /** Frozen-pane divider line. */
41
+ freezeLine: string;
42
+ }
43
+ /**
44
+ * Per-theme grid palettes.
45
+ *
46
+ * `light` holds the EXACT pre-theming hex from `canvas.ts`, so the default theme renders
47
+ * pixel-identical to before this change (regression guard).
48
+ *
49
+ * [Unverified] The four non-light palettes are reasonable design-guess values derived from each
50
+ * theme's surface swatch — NOT final brand colors; they need design sign-off. The mechanism is
51
+ * independent of the exact values.
52
+ */
53
+ export declare const GRID_THEMES: Record<ThemeKey, GridPalette>;
54
+ export declare const resolveGridPalette: (theme?: ThemeKey) => GridPalette;
55
+ /**
56
+ * The palette the canvas paints from. Module-level so the imperative canvas reads it on every
57
+ * repaint without prop threading inside the engine. `canvas.ts` imports this as a live binding and
58
+ * reads `activePalette.<slot>` at paint time; reassigning it here updates every reader.
59
+ *
60
+ * NOTE: this is a module singleton — multiple workbooks with different themes on one page would
61
+ * share it. dsheet renders one editor per page (like ddoc), so this is acceptable. If multi-instance
62
+ * is ever needed, move the palette onto `sheetCtx`.
63
+ */
64
+ export declare let activePalette: GridPalette;
65
+ /** Swap the active grid palette. Returns true if it actually changed (caller decides to repaint). */
66
+ export declare const setActiveGridPalette: (theme?: ThemeKey) => boolean;
67
+ export declare const getActiveTheme: () => ThemeKey;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { LucideIconProps } from './LucideIcon';
2
3
 
3
4
  export declare const LucideIcons: {
@@ -11,10 +12,10 @@ export declare const LucideIcons: {
11
12
  Farcaster: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
12
13
  Warpcast: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
13
14
  DSheetTextDisabled: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
14
- AddColLeft: () => import("react/jsx-runtime").JSX.Element;
15
- AddColRight: () => import("react/jsx-runtime").JSX.Element;
16
- AddRowBelowLocal: () => import("react/jsx-runtime").JSX.Element;
17
- AddRowAboveLocal: () => import("react/jsx-runtime").JSX.Element;
15
+ AddColLeft: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
16
+ AddColRight: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
17
+ AddRowBelowLocal: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
18
+ AddRowAboveLocal: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
18
19
  DSheetOnlyText: () => import("react/jsx-runtime").JSX.Element;
19
20
  Orb: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
20
21
  Lens: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -11,10 +11,10 @@ export declare const UltimateIcons: {
11
11
  Farcaster: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
12
12
  Warpcast: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
13
13
  DSheetTextDisabled: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
14
- AddColLeft: () => import("react/jsx-runtime").JSX.Element;
15
- AddColRight: () => import("react/jsx-runtime").JSX.Element;
16
- AddRowBelowLocal: () => import("react/jsx-runtime").JSX.Element;
17
- AddRowAboveLocal: () => import("react/jsx-runtime").JSX.Element;
14
+ AddColLeft: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
15
+ AddColRight: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
16
+ AddRowBelowLocal: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
17
+ AddRowAboveLocal: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
18
18
  DSheetOnlyText: () => import("react/jsx-runtime").JSX.Element;
19
19
  Orb: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
20
20
  Lens: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { Context } from '../../../core';
3
+ import { default as WorkbookContext } from '../../context';
4
+
5
+ export type SidebarPortalTargets = Record<string, HTMLElement | undefined>;
6
+ export type SidebarPortalRegistryHandle = {
7
+ getTargets: () => SidebarPortalTargets;
8
+ subscribe: (onStoreChange: () => void) => () => void;
9
+ };
10
+ export type SidebarPortalRenderer = (workbook: React.ContextType<typeof WorkbookContext>) => React.ReactNode;
11
+ interface SidebarPanelPortalsProps {
12
+ activePanel: string | null;
13
+ portalRegistry?: SidebarPortalRegistryHandle | null;
14
+ extraPortals?: Record<string, SidebarPortalRenderer>;
15
+ }
16
+ export declare function SidebarPanelPortals({ activePanel, portalRegistry, extraPortals, }: Readonly<SidebarPanelPortalsProps>): React.ReactPortal | null;
17
+ export type { Context };
@@ -1,12 +1,18 @@
1
1
  import { Settings, Context, CellWithRowAndCol, Sheet as SheetType, Op, CellMatrix, api } from '../../../core';
2
+ import { ThemeKey } from '../../../core/theme';
2
3
  import { default as React } from 'react';
3
4
  import { getCryptoPrice } from '../../utils/cryptoApi';
4
5
  import { SetContextOptions } from '../../context';
5
6
  import { generateAPIs } from './api';
7
+ import { SidebarPortalRegistryHandle, SidebarPortalRenderer } from '../SidebarPanelPortals';
6
8
 
7
9
  export type WorkbookInstance = ReturnType<typeof generateAPIs>;
8
10
  type AdditionalProps = {
9
11
  onOp?: (op: Op[]) => void;
12
+ sidebarActivePanel?: string | null;
13
+ sidebarPortalRegistry?: SidebarPortalRegistryHandle | null;
14
+ sidebarPortalRenderers?: Record<string, SidebarPortalRenderer>;
15
+ theme?: ThemeKey;
10
16
  };
11
17
  declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalProps & React.RefAttributes<{
12
18
  applyOp: (ops: Op[]) => void;
@@ -3,5 +3,6 @@ import { default as Workbook } from './Workbook';
3
3
  export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from '@fileverse-dev/formulajs/crypto-constants';
4
4
  export { Workbook };
5
5
  export type { WorkbookInstance } from './Workbook';
6
+ export type { SidebarPortalRenderer, SidebarPortalRegistryHandle, SidebarPortalTargets, } from './SidebarPanelPortals';
6
7
  export type { Cell, Sheet, LiveQueryData } from '../../core';
7
8
  export { markCellChanged as animateChangedCell } from '../../core';
@@ -1,2 +1,2 @@
1
- export declare const datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
1
+ export declare const datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid hsl(var(--color-border-default));\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: hsl(var(--color-text-default));\n background-color: hsl(var(--color-bg-default));\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #0188fb;\n box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);\n }\n";
2
2
  export declare const injectDatepickerStyles: () => void;