@sheetxl/react 0.7.22 → 0.7.23-beta.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/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +1 -0
- package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +156 -0
- package/browser/cjs/index.cjs +24 -24
- package/browser/esm/E9rKWgbrtweBguqR.mjs +6286 -0
- package/browser/esm/index.mjs +19252 -4911
- package/licenses/dependencies.txt +42 -214
- package/node/esm/CmChqiPvaotX5mCV.mjs +9 -0
- package/node/esm/index.mjs +17028 -3691
- package/package.json +10 -11
- package/resources/contents.json +60 -0
- package/resources/locales/contents.json +114 -0
- package/resources/locales/de/clipboard.cmd.json +36 -0
- package/resources/locales/de/editor.cmd.json +128 -0
- package/resources/locales/de/movable.cmd.json +123 -0
- package/resources/locales/de/selection.cmd.json +373 -0
- package/resources/locales/de/sheet.cmd.json +1563 -0
- package/resources/locales/de/table.cmd.json +83 -0
- package/resources/locales/de/ui.msg.json +166 -0
- package/resources/locales/de/workbook.cmd.json +282 -0
- package/resources/locales/en/clipboard.cmd.json +36 -0
- package/resources/locales/en/editor.cmd.json +128 -0
- package/resources/locales/en/movable.cmd.json +123 -0
- package/resources/locales/en/selection.cmd.json +373 -0
- package/resources/locales/en/sheet.cmd.json +1563 -0
- package/resources/locales/en/table.cmd.json +83 -0
- package/resources/locales/en/ui.msg.json +166 -0
- package/resources/locales/en/workbook.cmd.json +282 -0
- package/types/index.d.ts +2 -1767
- package/types/src/border/StaticBorderRenderer.d.ts +32 -0
- package/types/src/border/StaticBorderRenderer.d.ts.map +1 -0
- package/types/src/border/StyledStrokePath.d.ts +14 -0
- package/types/src/border/StyledStrokePath.d.ts.map +1 -0
- package/types/src/border/index.d.ts +4 -0
- package/types/src/border/index.d.ts.map +1 -0
- package/types/src/border/useBorders.d.ts +87 -0
- package/types/src/border/useBorders.d.ts.map +1 -0
- package/types/src/cell/ColumnButton.d.ts +45 -0
- package/types/src/cell/ColumnButton.d.ts.map +1 -0
- package/types/src/cell/CornerTriangle.d.ts +27 -0
- package/types/src/cell/CornerTriangle.d.ts.map +1 -0
- package/types/src/cell/FormulaCellRenderer.d.ts +34 -0
- package/types/src/cell/FormulaCellRenderer.d.ts.map +1 -0
- package/types/src/cell/SheetCellRenderer.d.ts +52 -0
- package/types/src/cell/SheetCellRenderer.d.ts.map +1 -0
- package/types/src/cell/SheetHeaderRenderer.d.ts +37 -0
- package/types/src/cell/SheetHeaderRenderer.d.ts.map +1 -0
- package/types/src/cell/index.d.ts +7 -0
- package/types/src/cell/index.d.ts.map +1 -0
- package/types/src/cell/useFormulaViewAnchor.d.ts +42 -0
- package/types/src/cell/useFormulaViewAnchor.d.ts.map +1 -0
- package/types/src/chart/ChartEditor.d.ts +17 -0
- package/types/src/chart/ChartEditor.d.ts.map +1 -0
- package/types/src/chart/PresetChartTypeDescriptors.d.ts +35 -0
- package/types/src/chart/PresetChartTypeDescriptors.d.ts.map +1 -0
- package/types/src/chart/index.d.ts +3 -0
- package/types/src/chart/index.d.ts.map +1 -0
- package/types/src/chart/templates/area-stacked-percent-template.json.d.ts +10 -0
- package/types/src/chart/templates/area-stacked-template.json.d.ts +10 -0
- package/types/src/chart/templates/area-template.json.d.ts +9 -0
- package/types/src/chart/templates/bar-stacked-percent-template.json.d.ts +10 -0
- package/types/src/chart/templates/bar-stacked-template.json.d.ts +10 -0
- package/types/src/chart/templates/bar-template.json.d.ts +9 -0
- package/types/src/chart/templates/column-stacked-percent-template.json.d.ts +10 -0
- package/types/src/chart/templates/column-stacked-template.json.d.ts +10 -0
- package/types/src/chart/templates/column-template.json.d.ts +9 -0
- package/types/src/chart/templates/line-markers-template.json.d.ts +10 -0
- package/types/src/chart/templates/line-stacked-markers-template.json.d.ts +11 -0
- package/types/src/chart/templates/line-stacked-percent-markers-template.json.d.ts +11 -0
- package/types/src/chart/templates/line-stacked-percent-template.json.d.ts +10 -0
- package/types/src/chart/templates/line-stacked-template.json.d.ts +10 -0
- package/types/src/chart/templates/line-template.json.d.ts +9 -0
- package/types/src/chart/templates/pie-doughnut-template.json.d.ts +10 -0
- package/types/src/chart/templates/pie-template.json.d.ts +9 -0
- package/types/src/chart/templates/scatter-lines-markers-smooth-template.json.d.ts +10 -0
- package/types/src/chart/templates/scatter-lines-markers-template.json.d.ts +10 -0
- package/types/src/chart/templates/scatter-lines-smooth-template.json.d.ts +10 -0
- package/types/src/chart/templates/scatter-lines-template.json.d.ts +10 -0
- package/types/src/chart/templates/scatter-markers-template.json.d.ts +10 -0
- package/types/src/clipboard/ClipboardCommands.d.ts +68 -0
- package/types/src/clipboard/ClipboardCommands.d.ts.map +1 -0
- package/types/src/clipboard/SheetClipboardLayer.d.ts +22 -0
- package/types/src/clipboard/SheetClipboardLayer.d.ts.map +1 -0
- package/types/src/clipboard/index.d.ts +3 -0
- package/types/src/clipboard/index.d.ts.map +1 -0
- package/types/src/commands/Catalog.d.ts +8 -0
- package/types/src/commands/Catalog.d.ts.map +1 -0
- package/types/src/commands/CommandRootProvider.d.ts +36 -0
- package/types/src/commands/CommandRootProvider.d.ts.map +1 -0
- package/types/src/commands/InputClipboardCommands.d.ts +41 -0
- package/types/src/commands/InputClipboardCommands.d.ts.map +1 -0
- package/types/src/commands/InputClipboardInjector.d.ts +16 -0
- package/types/src/commands/InputClipboardInjector.d.ts.map +1 -0
- package/types/src/commands/MainFocusContext.d.ts +13 -0
- package/types/src/commands/MainFocusContext.d.ts.map +1 -0
- package/types/src/commands/PaneScopeProvider.d.ts +40 -0
- package/types/src/commands/PaneScopeProvider.d.ts.map +1 -0
- package/types/src/commands/createTransactionalMiddleware.d.ts +49 -0
- package/types/src/commands/createTransactionalMiddleware.d.ts.map +1 -0
- package/types/src/commands/index.d.ts +7 -0
- package/types/src/commands/index.d.ts.map +1 -0
- package/types/src/context/SheetContext.d.ts +18 -0
- package/types/src/context/SheetContext.d.ts.map +1 -0
- package/types/src/context/WorkbookContext.d.ts +20 -0
- package/types/src/context/WorkbookContext.d.ts.map +1 -0
- package/types/src/context/index.d.ts +3 -0
- package/types/src/context/index.d.ts.map +1 -0
- package/types/src/editableLabel/EditableLabel.d.ts +28 -0
- package/types/src/editableLabel/EditableLabel.d.ts.map +1 -0
- package/types/src/editableLabel/index.d.ts +2 -0
- package/types/src/editableLabel/index.d.ts.map +1 -0
- package/types/src/editor/EditorCommands.d.ts +98 -0
- package/types/src/editor/EditorCommands.d.ts.map +1 -0
- package/types/src/editor/FunctionPreviewPanel.d.ts +166 -0
- package/types/src/editor/FunctionPreviewPanel.d.ts.map +1 -0
- package/types/src/editor/NamedHintPanel.d.ts +38 -0
- package/types/src/editor/NamedHintPanel.d.ts.map +1 -0
- package/types/src/editor/NamedItemsPanel.d.ts +59 -0
- package/types/src/editor/NamedItemsPanel.d.ts.map +1 -0
- package/types/src/editor/SheetCellEditorLayer.d.ts +40 -0
- package/types/src/editor/SheetCellEditorLayer.d.ts.map +1 -0
- package/types/src/editor/SheetCellInput.d.ts +99 -0
- package/types/src/editor/SheetCellInput.d.ts.map +1 -0
- package/types/src/editor/SheetEditable.d.ts +53 -0
- package/types/src/editor/SheetEditable.d.ts.map +1 -0
- package/types/src/editor/SheetReferenceHeaderLayer.d.ts +46 -0
- package/types/src/editor/SheetReferenceHeaderLayer.d.ts.map +1 -0
- package/types/src/editor/SheetReferenceLayer.d.ts +55 -0
- package/types/src/editor/SheetReferenceLayer.d.ts.map +1 -0
- package/types/src/editor/formulaCaret.d.ts +84 -0
- package/types/src/editor/formulaCaret.d.ts.map +1 -0
- package/types/src/editor/formulaEval.d.ts +202 -0
- package/types/src/editor/formulaEval.d.ts.map +1 -0
- package/types/src/editor/formulaPresentation.d.ts +136 -0
- package/types/src/editor/formulaPresentation.d.ts.map +1 -0
- package/types/src/editor/formulaText.d.ts +80 -0
- package/types/src/editor/formulaText.d.ts.map +1 -0
- package/types/src/editor/functionArgs.d.ts +111 -0
- package/types/src/editor/functionArgs.d.ts.map +1 -0
- package/types/src/editor/functionHint.d.ts +37 -0
- package/types/src/editor/functionHint.d.ts.map +1 -0
- package/types/src/editor/index.d.ts +18 -0
- package/types/src/editor/index.d.ts.map +1 -0
- package/types/src/editor/referencePointNav.d.ts +39 -0
- package/types/src/editor/referencePointNav.d.ts.map +1 -0
- package/types/src/editor/useFormulaHints.d.ts +126 -0
- package/types/src/editor/useFormulaHints.d.ts.map +1 -0
- package/types/src/editor/useFormulaInput.d.ts +326 -0
- package/types/src/editor/useFormulaInput.d.ts.map +1 -0
- package/types/src/editor/useProtectedEditNotice.d.ts +14 -0
- package/types/src/editor/useProtectedEditNotice.d.ts.map +1 -0
- package/types/src/editor/useReferenceMode.d.ts +177 -0
- package/types/src/editor/useReferenceMode.d.ts.map +1 -0
- package/types/src/form/FormulaInput.d.ts +86 -0
- package/types/src/form/FormulaInput.d.ts.map +1 -0
- package/types/src/form/FormulaInputParts.d.ts +94 -0
- package/types/src/form/FormulaInputParts.d.ts.map +1 -0
- package/types/src/form/index.d.ts +5 -0
- package/types/src/form/index.d.ts.map +1 -0
- package/types/src/form/useEditCommit.d.ts +174 -0
- package/types/src/form/useEditCommit.d.ts.map +1 -0
- package/types/src/form/useInputField.d.ts +86 -0
- package/types/src/form/useInputField.d.ts.map +1 -0
- package/types/src/frame/CommandContext.d.ts +179 -0
- package/types/src/frame/CommandContext.d.ts.map +1 -0
- package/types/src/frame/IFrame.d.ts +17 -0
- package/types/src/frame/IFrame.d.ts.map +1 -0
- package/types/src/frame/index.d.ts +3 -0
- package/types/src/frame/index.d.ts.map +1 -0
- package/types/src/icons/LogoNoPaddingIcon.d.ts +3 -0
- package/types/src/icons/LogoNoPaddingIcon.d.ts.map +1 -0
- package/types/src/icons/LogoTextNoPaddingIcon.d.ts +4 -0
- package/types/src/icons/LogoTextNoPaddingIcon.d.ts.map +1 -0
- package/types/src/icons/WaterMark.d.ts +12 -0
- package/types/src/icons/WaterMark.d.ts.map +1 -0
- package/types/src/icons/chart/ChartAreaIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartAreaIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartAreaStackedIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartAreaStackedIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartAreaStackedPercentIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartAreaStackedPercentIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartBarIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBarIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartBarStackedIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBarStackedIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartBarStackedPercentIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBarStackedPercentIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartBubble3DIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBubble3DIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartBubbleIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBubbleIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartColumnIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartColumnIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartColumnStackedIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartColumnStackedIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartColumnStackedPercentIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartColumnStackedPercentIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartLineIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartLineMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineMarkersIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartLineStackedIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineStackedIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartLineStackedMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineStackedMarkersIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartLineStackedPercentIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineStackedPercentIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartLineStackedPercentMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineStackedPercentMarkersIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartPieDoughnutIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartPieDoughnutIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartPieIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartPieIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartScatterLinesIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterLinesIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartScatterLinesMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterLinesMarkersIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartScatterLinesMarkersSmoothIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterLinesMarkersSmoothIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartScatterLinesSmoothIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterLinesSmoothIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartScatterMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterMarkersIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ChartWaterfallIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartWaterfallIcon.d.ts.map +1 -0
- package/types/src/icons/chart/ThemedChartIcon.d.ts +20 -0
- package/types/src/icons/chart/ThemedChartIcon.d.ts.map +1 -0
- package/types/src/icons/chart/index.d.ts +50 -0
- package/types/src/icons/chart/index.d.ts.map +1 -0
- package/types/src/icons/index.d.ts +4 -0
- package/types/src/icons/index.d.ts.map +1 -0
- package/types/src/index.d.ts +27 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/io/WorkbookIO.d.ts +50 -0
- package/types/src/io/WorkbookIO.d.ts.map +1 -0
- package/types/src/io/index.d.ts +2 -0
- package/types/src/io/index.d.ts.map +1 -0
- package/types/src/layer/BorderLayer.d.ts +14 -0
- package/types/src/layer/BorderLayer.d.ts.map +1 -0
- package/types/src/layer/CellErrorLayer.d.ts +49 -0
- package/types/src/layer/CellErrorLayer.d.ts.map +1 -0
- package/types/src/layer/CellFillLayer.d.ts +15 -0
- package/types/src/layer/CellFillLayer.d.ts.map +1 -0
- package/types/src/layer/ConditionalBarLayer.d.ts +41 -0
- package/types/src/layer/ConditionalBarLayer.d.ts.map +1 -0
- package/types/src/layer/ConditionalIcons.d.ts +34 -0
- package/types/src/layer/ConditionalIcons.d.ts.map +1 -0
- package/types/src/layer/ConditionalIconsLayer.d.ts +31 -0
- package/types/src/layer/ConditionalIconsLayer.d.ts.map +1 -0
- package/types/src/layer/ContextMenuLayer.d.ts +27 -0
- package/types/src/layer/ContextMenuLayer.d.ts.map +1 -0
- package/types/src/layer/HeaderResizerLayer.d.ts +28 -0
- package/types/src/layer/HeaderResizerLayer.d.ts.map +1 -0
- package/types/src/layer/HeaderSelectionLayer.d.ts +89 -0
- package/types/src/layer/HeaderSelectionLayer.d.ts.map +1 -0
- package/types/src/layer/ResizeIndicator.d.ts +19 -0
- package/types/src/layer/ResizeIndicator.d.ts.map +1 -0
- package/types/src/layer/SheetBackgroundLayer.d.ts +22 -0
- package/types/src/layer/SheetBackgroundLayer.d.ts.map +1 -0
- package/types/src/layer/SheetCellLayer.d.ts +49 -0
- package/types/src/layer/SheetCellLayer.d.ts.map +1 -0
- package/types/src/layer/SheetColumnButtonLayer.d.ts +23 -0
- package/types/src/layer/SheetColumnButtonLayer.d.ts.map +1 -0
- package/types/src/layer/SheetGridLineLayer.d.ts +22 -0
- package/types/src/layer/SheetGridLineLayer.d.ts.map +1 -0
- package/types/src/layer/SheetHeaderCellLayer.d.ts +30 -0
- package/types/src/layer/SheetHeaderCellLayer.d.ts.map +1 -0
- package/types/src/layer/SheetMovableLayer.d.ts +26 -0
- package/types/src/layer/SheetMovableLayer.d.ts.map +1 -0
- package/types/src/layer/SheetTableCommandLayer.d.ts +16 -0
- package/types/src/layer/SheetTableCommandLayer.d.ts.map +1 -0
- package/types/src/layer/SpillLayer.d.ts +22 -0
- package/types/src/layer/SpillLayer.d.ts.map +1 -0
- package/types/src/layer/TableLayer.d.ts +22 -0
- package/types/src/layer/TableLayer.d.ts.map +1 -0
- package/types/src/layer/ValidationIndicatorLayer.d.ts +41 -0
- package/types/src/layer/ValidationIndicatorLayer.d.ts.map +1 -0
- package/types/src/layer/index.d.ts +25 -0
- package/types/src/layer/index.d.ts.map +1 -0
- package/types/src/layer/resizeIndicatorState.d.ts +26 -0
- package/types/src/layer/resizeIndicatorState.d.ts.map +1 -0
- package/types/src/layer/useSheetFeatureRegions.d.ts +21 -0
- package/types/src/layer/useSheetFeatureRegions.d.ts.map +1 -0
- package/types/src/layer/useSheetVisibleCells.d.ts +60 -0
- package/types/src/layer/useSheetVisibleCells.d.ts.map +1 -0
- package/types/src/layer/useSheetVisibleDecorations.d.ts +42 -0
- package/types/src/layer/useSheetVisibleDecorations.d.ts.map +1 -0
- package/types/src/layer/useTableHeaderCells.d.ts +22 -0
- package/types/src/layer/useTableHeaderCells.d.ts.map +1 -0
- package/types/src/layer/useVisibleTables.d.ts +27 -0
- package/types/src/layer/useVisibleTables.d.ts.map +1 -0
- package/types/src/listener/index.d.ts +3 -0
- package/types/src/listener/index.d.ts.map +1 -0
- package/types/src/listener/useModelListener.d.ts +67 -0
- package/types/src/listener/useModelListener.d.ts.map +1 -0
- package/types/src/listener/useRangeListener.d.ts +15 -0
- package/types/src/listener/useRangeListener.d.ts.map +1 -0
- package/types/src/movable/EmptyFrame.d.ts +16 -0
- package/types/src/movable/EmptyFrame.d.ts.map +1 -0
- package/types/src/movable/IMovableArea.d.ts +34 -0
- package/types/src/movable/IMovableArea.d.ts.map +1 -0
- package/types/src/movable/MovableCommands.d.ts +22 -0
- package/types/src/movable/MovableCommands.d.ts.map +1 -0
- package/types/src/movable/MovableFrame.d.ts +48 -0
- package/types/src/movable/MovableFrame.d.ts.map +1 -0
- package/types/src/movable/MovableLayer.d.ts +77 -0
- package/types/src/movable/MovableLayer.d.ts.map +1 -0
- package/types/src/movable/MoveableBundle.d.ts +4 -0
- package/types/src/movable/MoveableBundle.d.ts.map +1 -0
- package/types/src/movable/index.d.ts +4 -0
- package/types/src/movable/index.d.ts.map +1 -0
- package/types/src/picture/IPictureEditor.d.ts +39 -0
- package/types/src/picture/IPictureEditor.d.ts.map +1 -0
- package/types/src/picture/PictureEditor.d.ts +4 -0
- package/types/src/picture/PictureEditor.d.ts.map +1 -0
- package/types/src/picture/index.d.ts +3 -0
- package/types/src/picture/index.d.ts.map +1 -0
- package/types/src/selection/SelectionCommands.d.ts +23 -0
- package/types/src/selection/SelectionCommands.d.ts.map +1 -0
- package/types/src/selection/SheetSelection.d.ts +53 -0
- package/types/src/selection/SheetSelection.d.ts.map +1 -0
- package/types/src/selection/SheetSelectionLayer.d.ts +30 -0
- package/types/src/selection/SheetSelectionLayer.d.ts.map +1 -0
- package/types/src/selection/index.d.ts +4 -0
- package/types/src/selection/index.d.ts.map +1 -0
- package/types/src/shape/ShapeEditor.d.ts +16 -0
- package/types/src/shape/ShapeEditor.d.ts.map +1 -0
- package/types/src/shape/index.d.ts +2 -0
- package/types/src/shape/index.d.ts.map +1 -0
- package/types/src/sheet/ConditionalFormatPresets.d.ts +56 -0
- package/types/src/sheet/ConditionalFormatPresets.d.ts.map +1 -0
- package/types/src/sheet/ISheetElement.d.ts +233 -0
- package/types/src/sheet/ISheetElement.d.ts.map +1 -0
- package/types/src/sheet/ISheetHeaderElement.d.ts +138 -0
- package/types/src/sheet/ISheetHeaderElement.d.ts.map +1 -0
- package/types/src/sheet/NotImplemented.d.ts +3 -0
- package/types/src/sheet/NotImplemented.d.ts.map +1 -0
- package/types/src/sheet/SheetCommandProvider.d.ts +57 -0
- package/types/src/sheet/SheetCommandProvider.d.ts.map +1 -0
- package/types/src/sheet/SheetCommands.d.ts +75 -0
- package/types/src/sheet/SheetCommands.d.ts.map +1 -0
- package/types/src/sheet/SheetElement.d.ts +15 -0
- package/types/src/sheet/SheetElement.d.ts.map +1 -0
- package/types/src/sheet/SheetHeaderElement.d.ts +4 -0
- package/types/src/sheet/SheetHeaderElement.d.ts.map +1 -0
- package/types/src/sheet/SheetScrollbar.d.ts +28 -0
- package/types/src/sheet/SheetScrollbar.d.ts.map +1 -0
- package/types/src/sheet/TopLeftCorner.d.ts +17 -0
- package/types/src/sheet/TopLeftCorner.d.ts.map +1 -0
- package/types/src/sheet/index.d.ts +7 -0
- package/types/src/sheet/index.d.ts.map +1 -0
- package/types/src/slicer/SlicerEditor.d.ts +16 -0
- package/types/src/slicer/SlicerEditor.d.ts.map +1 -0
- package/types/src/slicer/index.d.ts +2 -0
- package/types/src/slicer/index.d.ts.map +1 -0
- package/types/src/tabStrip/SheetTab.d.ts +41 -0
- package/types/src/tabStrip/SheetTab.d.ts.map +1 -0
- package/types/src/tabStrip/Sortable.d.ts +66 -0
- package/types/src/tabStrip/Sortable.d.ts.map +1 -0
- package/types/src/tabStrip/Tab.d.ts +19 -0
- package/types/src/tabStrip/Tab.d.ts.map +1 -0
- package/types/src/tabStrip/TabStrip.d.ts +41 -0
- package/types/src/tabStrip/TabStrip.d.ts.map +1 -0
- package/types/src/tabStrip/TabStripItem.d.ts +36 -0
- package/types/src/tabStrip/TabStripItem.d.ts.map +1 -0
- package/types/src/tabStrip/TabStripRow.d.ts +9 -0
- package/types/src/tabStrip/TabStripRow.d.ts.map +1 -0
- package/types/src/tabStrip/index.d.ts +7 -0
- package/types/src/tabStrip/index.d.ts.map +1 -0
- package/types/src/table/TableCommands.d.ts +16 -0
- package/types/src/table/TableCommands.d.ts.map +1 -0
- package/types/src/taskPane/ITaskPane.d.ts +72 -0
- package/types/src/taskPane/ITaskPane.d.ts.map +1 -0
- package/types/src/taskPane/TaskPaneArea.d.ts +144 -0
- package/types/src/taskPane/TaskPaneArea.d.ts.map +1 -0
- package/types/src/taskPane/TaskPaneFrame.d.ts +48 -0
- package/types/src/taskPane/TaskPaneFrame.d.ts.map +1 -0
- package/types/src/taskPane/TaskPaneRegistry.d.ts +108 -0
- package/types/src/taskPane/TaskPaneRegistry.d.ts.map +1 -0
- package/types/src/taskPane/TaskPaneStrip.d.ts +33 -0
- package/types/src/taskPane/TaskPaneStrip.d.ts.map +1 -0
- package/types/src/taskPane/TaskPaneTitle.d.ts +24 -0
- package/types/src/taskPane/TaskPaneTitle.d.ts.map +1 -0
- package/types/src/taskPane/index.d.ts +7 -0
- package/types/src/taskPane/index.d.ts.map +1 -0
- package/types/src/taskPane/useTaskPane.d.ts +29 -0
- package/types/src/taskPane/useTaskPane.d.ts.map +1 -0
- package/types/src/theme/DocThemesContext.d.ts +3 -0
- package/types/src/theme/DocThemesContext.d.ts.map +1 -0
- package/types/src/theme/DocThemesProvider.d.ts +15 -0
- package/types/src/theme/DocThemesProvider.d.ts.map +1 -0
- package/types/src/theme/ThemeState.d.ts +19 -0
- package/types/src/theme/ThemeState.d.ts.map +1 -0
- package/types/src/theme/buildDocThemeCSS.d.ts +16 -0
- package/types/src/theme/buildDocThemeCSS.d.ts.map +1 -0
- package/types/src/theme/buildOOXMLThemeCSS.d.ts +13 -0
- package/types/src/theme/buildOOXMLThemeCSS.d.ts.map +1 -0
- package/types/src/theme/createCSSSystemLookup.d.ts +51 -0
- package/types/src/theme/createCSSSystemLookup.d.ts.map +1 -0
- package/types/src/theme/index.d.ts +11 -0
- package/types/src/theme/index.d.ts.map +1 -0
- package/types/src/theme/useAppColorScheme.d.ts +15 -0
- package/types/src/theme/useAppColorScheme.d.ts.map +1 -0
- package/types/src/theme/useDocThemes.d.ts +3 -0
- package/types/src/theme/useDocThemes.d.ts.map +1 -0
- package/types/src/theme/useGridColorScheme.d.ts +20 -0
- package/types/src/theme/useGridColorScheme.d.ts.map +1 -0
- package/types/src/theme/useSystemColors.d.ts +44 -0
- package/types/src/theme/useSystemColors.d.ts.map +1 -0
- package/types/src/undo/UndoCommands.d.ts +28 -0
- package/types/src/undo/UndoCommands.d.ts.map +1 -0
- package/types/src/undo/UndoManagerContext.d.ts +14 -0
- package/types/src/undo/UndoManagerContext.d.ts.map +1 -0
- package/types/src/undo/index.d.ts +3 -0
- package/types/src/undo/index.d.ts.map +1 -0
- package/types/src/workbook/DefaultRenderers.d.ts +14 -0
- package/types/src/workbook/DefaultRenderers.d.ts.map +1 -0
- package/types/src/workbook/GlobalWorkbookElement.d.ts +10 -0
- package/types/src/workbook/GlobalWorkbookElement.d.ts.map +1 -0
- package/types/src/workbook/IWorkbookElement.d.ts +178 -0
- package/types/src/workbook/IWorkbookElement.d.ts.map +1 -0
- package/types/src/workbook/WindowChrome.d.ts +61 -0
- package/types/src/workbook/WindowChrome.d.ts.map +1 -0
- package/types/src/workbook/WorkbookCommandContributor.d.ts +24 -0
- package/types/src/workbook/WorkbookCommandContributor.d.ts.map +1 -0
- package/types/src/workbook/WorkbookCommands.d.ts +97 -0
- package/types/src/workbook/WorkbookCommands.d.ts.map +1 -0
- package/types/src/workbook/WorkbookElement.d.ts +9 -0
- package/types/src/workbook/WorkbookElement.d.ts.map +1 -0
- package/types/src/workbook/WorkbookStrip.d.ts +73 -0
- package/types/src/workbook/WorkbookStrip.d.ts.map +1 -0
- package/types/src/workbook/index.d.ts +17 -0
- package/types/src/workbook/index.d.ts.map +1 -0
- package/types/src/workbook/resolveWorkbookInput.d.ts +27 -0
- package/types/src/workbook/resolveWorkbookInput.d.ts.map +1 -0
- package/types/src/workbook/useResolvedWorkbook.d.ts +31 -0
- package/types/src/workbook/useResolvedWorkbook.d.ts.map +1 -0
- package/types/src/workbook/useWindowChrome.d.ts +24 -0
- package/types/src/workbook/useWindowChrome.d.ts.map +1 -0
- package/types/src/workbook/useWorkbookApp.d.ts +47 -0
- package/types/src/workbook/useWorkbookApp.d.ts.map +1 -0
- package/types/src/workbook/useWorkbookEncrypted.d.ts +15 -0
- package/types/src/workbook/useWorkbookEncrypted.d.ts.map +1 -0
- package/types/src/workbook/useWorkbookFormat.d.ts +18 -0
- package/types/src/workbook/useWorkbookFormat.d.ts.map +1 -0
- package/types/src/workbook/useWorkbookName.d.ts +13 -0
- package/types/src/workbook/useWorkbookName.d.ts.map +1 -0
- package/types/src/workbook/useWorkbookSaveState.d.ts +29 -0
- package/types/src/workbook/useWorkbookSaveState.d.ts.map +1 -0
- package/browser/cjs/DE4tB6-rHLjtcP1D.cjs +0 -16
- package/browser/cjs/DfFvH5gp0fyrdVBe.cjs +0 -7
- package/browser/cjs/IsZqO9D9KfIS8rJK.cjs +0 -161
- package/browser/esm/B-FEg36883DAwV11.mjs +0 -1377
- package/browser/esm/C07OMiF-GZT09DE8.mjs +0 -394
- package/browser/esm/DpetxHCqcdvCcpAe.mjs +0 -3905
- package/node/assets/style.css +0 -1
- package/node/esm/BzmGjDsMnAeW7Hwa.mjs +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetReferenceHeaderLayer.d.ts","sourceRoot":"","sources":["../../../../src/editor/SheetReferenceHeaderLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAStD;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,UAAU;IAChE,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;IAClB;;;OAGG;IACH,YAAY,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,8BAA8B,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAkD1G;yBAlDe,yBAAyB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet, ISheetView } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
import { SheetSelection } from '../selection';
|
|
5
|
+
/**
|
|
6
|
+
* Draws the current **reference selection** over the grid (Excel-style colored rectangles), highlighting
|
|
7
|
+
* the active reference. A pane layer (mounted per pane by `SheetElement`), it reads the app-wide
|
|
8
|
+
* reference-mode bus ({@link useReferenceMode}) — not any edit session — so it renders whenever a
|
|
9
|
+
* reference selection is present, regardless of what produced it: a formula edit (via `SheetCellInput`)
|
|
10
|
+
* or, later, a selected chart showing its source data with no active input at all.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* The bus's `IRangeSelection` can hold a **multi-sheet** set of ranges (a formula's references, each
|
|
14
|
+
* with its own `RangeCoords.scope`) — e.g. editing `=B1+Sheet2!C1` on Sheet1: `B1` and `Sheet2!C1` are
|
|
15
|
+
* both ranges in the ONE shared selection, but only `B1` belongs on Sheet1's pane. The MODEL handed to
|
|
16
|
+
* `RangesPickerLayer` is the shared selection **unfiltered** (a plain `SheetSelection`, same one every
|
|
17
|
+
* pane uses) — each pane instead filters what it *draws* via `getRangeStyle`, returning `null` for a
|
|
18
|
+
* range whose scope isn't this pane's `sheet`. This is a per-instance render filter, not a data split
|
|
19
|
+
* (see `RangesPickerLayer.getRangeStyle`'s doc): writes still land at the range's real, unfiltered index
|
|
20
|
+
* with no remapping, and every committed write is stamped with the committing pane's sheet by
|
|
21
|
+
* `scopeDrawnRanges` (always-scoped reporting — the consumer localizes; `commitRange`'s
|
|
22
|
+
* `{...range, ...box}` spread preserves an existing range's `scope` mid-gesture either way).
|
|
23
|
+
*/
|
|
24
|
+
export interface SheetReferenceLayerProps extends LayerProps {
|
|
25
|
+
/** The sheet this pane renders — ranges belonging to a different sheet are filtered out of this pane. */
|
|
26
|
+
sheet: ISheet;
|
|
27
|
+
/**
|
|
28
|
+
* The sheet view — enables the **formula-view** fallback: while `isShowFormulas()` and no
|
|
29
|
+
* reference-mode state is on the bus, the selection anchor's formula (when it IS a formula)
|
|
30
|
+
* has its references outlined read-only (same palette as the anchor's colored formula text —
|
|
31
|
+
* see {@link useFormulaViewAnchor}). Omit for a host with no formula view.
|
|
32
|
+
*/
|
|
33
|
+
sheetView?: ISheetView;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Wrap a selection so a range **committed through this pane** is stamped with this pane's sheet.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* Applies to the range at `rangeIndex` — the ONE the picker just wrote — for **both** of its gestures, since
|
|
40
|
+
* a gesture on this pane places the range on this sheet either way:
|
|
41
|
+
* - **insert** (append past the current length) — a brand-new reference drawn here;
|
|
42
|
+
* - **re-scope** (replace in place) — dragging the ACTIVE reference here moves it to this sheet, which is how
|
|
43
|
+
* `=A1` (Sheet1's) becomes `=Sheet2!A1` when you drag it while viewing Sheet2.
|
|
44
|
+
*
|
|
45
|
+
* Guarded on the range having actually CHANGED (identity compare against the current one), so a bare
|
|
46
|
+
* activation — `setActive` merely moving `rangeIndex` to a different reference, reusing the same range
|
|
47
|
+
* objects — never re-homes anything. That distinction is what keeps *selecting* a reference from silently
|
|
48
|
+
* moving it: only a geometry write re-homes, never a change of which reference is active.
|
|
49
|
+
*/
|
|
50
|
+
export declare const scopeDrawnRanges: (base: SheetSelection, scope: string) => SheetSelection;
|
|
51
|
+
export declare function SheetReferenceLayer(props: SheetReferenceLayerProps): React.ReactElement | null;
|
|
52
|
+
export declare namespace SheetReferenceLayer {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=SheetReferenceLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetReferenceLayer.d.ts","sourceRoot":"","sources":["../../../../src/editor/SheetReferenceLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAA6D,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,yGAAyG;IACzG,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,cAAc,EAAE,OAAO,MAAM,KAAG,cAkBtE,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAsL9F;yBAtLe,mBAAmB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ICalculation } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The token whose right edge the `caret` rests at (right-edge ownership: `pos < caret <= pos+len`, so a
|
|
4
|
+
* boundary belongs to the token just LEFT of the caret — the one being typed into), plus that token's
|
|
5
|
+
* `start` offset. Offsets start after the leading formula prefix (`base`): `1` for a stripped `=`, `0`
|
|
6
|
+
* for a `+`/`-` lead the tokenizer keeps as a `prefix` token. `null` when no token owns the caret (e.g.
|
|
7
|
+
* caret before the first token). This is the single "which token is the caret on?" primitive the editor
|
|
8
|
+
* dispatches on — {@link resolveFunctionContext} applies the same rule.
|
|
9
|
+
*/
|
|
10
|
+
export declare const caretOwnerToken: (tokens: readonly ICalculation.FormulaToken[], caret: number, base?: number) => {
|
|
11
|
+
token: ICalculation.FormulaToken;
|
|
12
|
+
start: number;
|
|
13
|
+
} | null;
|
|
14
|
+
/**
|
|
15
|
+
* The character span of the name being **completed** at the caret, or `null` when nothing is.
|
|
16
|
+
*
|
|
17
|
+
* A candidate is an `isLookup` token (a function name, a named reference, or a partial identifier the
|
|
18
|
+
* recoverer split off a broken tail) that is **not already a call** — i.e. no `(` immediately follows it
|
|
19
|
+
* in `text`. That second half is the whole point: a name that already has its paren is finished work, and
|
|
20
|
+
* clicking back into it (to read it, to fix an argument) is a navigation gesture, not a request to complete
|
|
21
|
+
* it — re-popping the autocomplete list there covers the very formula you came back to look at. Excel
|
|
22
|
+
* behaves the same way.
|
|
23
|
+
*
|
|
24
|
+
* Typing is unaffected: `=SU` has no trailing paren, so the list still appears as you type, and accepting a
|
|
25
|
+
* row parks the caret INSIDE the parens where the signature preview takes over.
|
|
26
|
+
*
|
|
27
|
+
* The editor shares this between the list and the signature preview so the two can never both claim the
|
|
28
|
+
* caret — exactly one shows, and suppressing the list here is what lets the preview show the enclosing
|
|
29
|
+
* call's signature instead.
|
|
30
|
+
*
|
|
31
|
+
* `text` is the full editor string and the returned offsets index into it (not into the token stream).
|
|
32
|
+
*/
|
|
33
|
+
export declare const completionSpanAtCaret: (tokens: readonly ICalculation.FormulaToken[], caret: number, base: number, text: string) => {
|
|
34
|
+
start: number;
|
|
35
|
+
end: number;
|
|
36
|
+
} | null;
|
|
37
|
+
/** The function + argument the caret is currently in. */
|
|
38
|
+
export interface FunctionCaretContext {
|
|
39
|
+
/** The (canonical) function name. */
|
|
40
|
+
name: string;
|
|
41
|
+
/** Zero-based index of the argument the caret is in. */
|
|
42
|
+
argIndex: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolve which function + argument the caret sits in, from a formula's token stream.
|
|
46
|
+
*
|
|
47
|
+
* Offsets start after the leading formula prefix (`base`; `1` for a stripped `=`, `0` for a `+`/`-` lead
|
|
48
|
+
* kept as a `prefix` token), matching how `FormulaToken.text` concatenates back to the source (after that
|
|
49
|
+
* prefix). The SDK stamps each token's enclosing function
|
|
50
|
+
* `context` (name + argIndex): the `(`/`)` get argIndex `-1`, each argument's tokens their index, and
|
|
51
|
+
* the separator `,` after argument *i* gets index *i* (it belongs to the argument BEFORE it).
|
|
52
|
+
*
|
|
53
|
+
* We resolve with **right-edge ownership**: the token whose right edge the caret rests at owns it
|
|
54
|
+
* (`pos < caret <= pos+len`), so a boundary belongs to the token just LEFT of the caret — the one just
|
|
55
|
+
* typed into — and every caret position is owned by exactly one token. Per token type:
|
|
56
|
+
* - **function name** → that function, argument 0 (its own `context` is the ENCLOSING call, for nesting);
|
|
57
|
+
* - **separator `,`** → the NEXT argument (the caret is past the comma);
|
|
58
|
+
* - **closing `)`** → `null` (the caret is just outside the call) — without this the `)`'s argIndex `-1`
|
|
59
|
+
* snaps the LAST argument back to arg 0 (the `=PV(…,0)` bug);
|
|
60
|
+
* - otherwise the token's own `context` (inside an argument, or just inside `(` where `-1` clamps to 0).
|
|
61
|
+
*
|
|
62
|
+
* Returns `null` when the caret is not inside any function call.
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* The argument index to light in the function preview for the token being **hovered** (`ti`), or `null`
|
|
66
|
+
* when the hover shouldn't move it.
|
|
67
|
+
*
|
|
68
|
+
* While the pointer is over a formula, the preview panel follows it instead of the caret: hovering an
|
|
69
|
+
* argument of the previewed call lights that argument. Same rule the paren emphasis follows — a hover is a
|
|
70
|
+
* transient "tell me about THIS", so the panel answers about what you're pointing at, not what you last
|
|
71
|
+
* clicked, and reverts when you leave.
|
|
72
|
+
*
|
|
73
|
+
* Resolved by asking {@link resolveFunctionContext} at the hovered token's END offset — "as if the caret
|
|
74
|
+
* were here" — rather than reading `token.context` raw. That way hovering a `)` (outside the call) or a
|
|
75
|
+
* separator (which belongs to the argument BEFORE it) behaves exactly as the caret does in the same spot;
|
|
76
|
+
* re-deriving those edge rules here is how the two would drift apart.
|
|
77
|
+
*
|
|
78
|
+
* `hintName` gates it to the call actually being previewed, so pointing at an argument of a DIFFERENT
|
|
79
|
+
* function doesn't relabel the panel. Nested calls of the same name (`=SUM(SUM(1,2),3)`) can't be told
|
|
80
|
+
* apart by name alone — the innermost wins, which is the one under the pointer.
|
|
81
|
+
*/
|
|
82
|
+
export declare const hoveredArgIndex: (tokens: readonly ICalculation.FormulaToken[], ti: number, base: number, hintName: string) => number | null;
|
|
83
|
+
export declare const resolveFunctionContext: (tokens: readonly ICalculation.FormulaToken[], caret: number, base?: number) => FunctionCaretContext | null;
|
|
84
|
+
//# sourceMappingURL=formulaCaret.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formulaCaret.d.ts","sourceRoot":"","sources":["../../../../src/editor/formulaCaret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAC5C,OAAO,MAAM,EACb,OAAM,MAAU,KACf;IAAE,KAAK,EAAE,YAAY,CAAC,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAQxD,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAC5C,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,MAAM,MAAM,KACX;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAMnC,CAAC;AAEF,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAC5C,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,MAAM,GAAG,IAOX,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAC5C,OAAO,MAAM,EACb,OAAM,MAAU,KACf,oBAAoB,GAAG,IAqBzB,CAAC"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ICalculation } from '@sheetxl/sdk';
|
|
3
|
+
/** Gap (px) between the top of a hovered segment and the bottom of its eval tip. */
|
|
4
|
+
export declare const EVAL_TIP_GAP = 6;
|
|
5
|
+
/**
|
|
6
|
+
* The hover eval tip bubble — a small, non-interactive card showing a segment's evaluated value.
|
|
7
|
+
* Shared by every formula-hosting input (the cell editor, the reference field) so the tip reads the
|
|
8
|
+
* same everywhere; the host supplies `left`/`top` (viewport coords — the style is `position: fixed`,
|
|
9
|
+
* anchored bottom-center via the translate).
|
|
10
|
+
*/
|
|
11
|
+
export declare const EVAL_TIP_STYLE: CSSProperties;
|
|
12
|
+
/** {@link useSelectDrag}'s handle. */
|
|
13
|
+
export interface SelectDrag {
|
|
14
|
+
/** `true` while a pointer-driven text selection is in progress. */
|
|
15
|
+
isDragging: () => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* `true` while a pointer press OWNS the input — during the drag, and afterwards until the pointer
|
|
18
|
+
* actually moves ({@link HOVER_WAKE_DISTANCE}). The second half is what makes a click *dismiss*:
|
|
19
|
+
* the press leaves the pointer parked over the very text it just acted on, so without it the next
|
|
20
|
+
* stray `mousemove` re-arms a hover tip in the same place — indistinguishable from the tip the user
|
|
21
|
+
* clicked to get rid of. Moving the pointer at all is a deliberate hover and wakes it back up.
|
|
22
|
+
*/
|
|
23
|
+
blocksHover: (e: {
|
|
24
|
+
clientX: number;
|
|
25
|
+
clientY: number;
|
|
26
|
+
}) => boolean;
|
|
27
|
+
/** Call from the input's `pointerdown`/`mousedown` — non-primary buttons are ignored. */
|
|
28
|
+
begin: (e?: {
|
|
29
|
+
button?: number;
|
|
30
|
+
clientX?: number;
|
|
31
|
+
clientY?: number;
|
|
32
|
+
}) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Tracks a **text-selection drag** inside an input/textarea: `true` from the pointerdown that starts
|
|
36
|
+
* one until the pointer is released — which routinely happens OUTSIDE the input, hence the window
|
|
37
|
+
* listeners rather than a local `mouseup`.
|
|
38
|
+
*
|
|
39
|
+
* The hover eval tip has to yield to it. The tip is a *hover* affordance, but a drag-select is a
|
|
40
|
+
* mousemove with the button down, so it armed the tip on the very gesture meant to select text — and
|
|
41
|
+
* an armed tip both bands its run in the selection tint AND (in the cell editor) clears the input's
|
|
42
|
+
* own `::selection` tint so the two don't stack. Net effect: dragging over a formula painted a
|
|
43
|
+
* highlight that looked like, but wasn't, the selection, and the real selection was invisible
|
|
44
|
+
* underneath — reading as "this field can't select text". So hosts `begin()` on pointerdown and gate
|
|
45
|
+
* their hover handler on `isDragging()`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const useSelectDrag: (onBegin?: () => void, onEnd?: () => void) => SelectDrag;
|
|
48
|
+
/**
|
|
49
|
+
* Whether `el` holds a NON-COLLAPSED selection — the other half of the rule above: once the drag ends
|
|
50
|
+
* the user is *looking at* a selection, and re-arming the tip on the next stray mousemove would wipe
|
|
51
|
+
* its tint again. The tip returns as soon as the selection collapses (a plain click).
|
|
52
|
+
*/
|
|
53
|
+
export declare const hasTextSelection: (el: HTMLInputElement | HTMLTextAreaElement | null) => boolean;
|
|
54
|
+
/**
|
|
55
|
+
* A hovered formula **segment**: the token range `[lo, hi]` (inclusive, into the full token list) that
|
|
56
|
+
* makes up one evaluable sub-expression, plus the `evalIndex` to evaluate it with. See
|
|
57
|
+
* {@link evalSegmentAt}.
|
|
58
|
+
*/
|
|
59
|
+
export interface EvalSegment {
|
|
60
|
+
/** First token of the segment (inclusive). */
|
|
61
|
+
lo: number;
|
|
62
|
+
/** Last token of the segment (inclusive). */
|
|
63
|
+
hi: number;
|
|
64
|
+
/** The subtree-root eval index — pass to `IFormula.evaluate({ evalIndex })`. */
|
|
65
|
+
evalIndex: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The evaluable segment (AST subtree) that the token at `i` belongs to — the contiguous run of tokens
|
|
69
|
+
* whose `evalIndex` stays **≥** the hovered token's, bounded on each side by an enclosing token with a
|
|
70
|
+
* smaller `evalIndex` (or the ends of the array).
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* `evalIndex` is BFS-assigned (root = 0, descendants strictly larger), so a subtree's tokens are
|
|
74
|
+
* contiguous in source order and every descendant carries a larger index than its subtree root. Two
|
|
75
|
+
* sibling subtrees are always parted by a parent-owned token (an operator, separator, or paren) that
|
|
76
|
+
* carries the *smaller* parent index — which is exactly where the ≥ scan stops. So hovering an
|
|
77
|
+
* operator/function token yields the whole call it heads.
|
|
78
|
+
*
|
|
79
|
+
* A range reference (`A1:A3`) reads as ONE unit here because the SDK gives every token of a reference
|
|
80
|
+
* literal the reference root's `evalIndex` (mirroring how they share one `referenceIndex`) — so hovering a
|
|
81
|
+
* corner evaluates the whole range, not the lone corner cell. That merge is the SDK's job, not this scan's.
|
|
82
|
+
*
|
|
83
|
+
* Returns `null` for a token with no `evalIndex` (whitespace in an unparsed tail, punctuation the engine
|
|
84
|
+
* couldn't place) — nothing to evaluate there.
|
|
85
|
+
*/
|
|
86
|
+
export declare const evalSegmentAt: (tokens: readonly ICalculation.FormulaToken[], i: number) => EvalSegment | null;
|
|
87
|
+
/** What a text selection resolves to — see {@link evalTargetForSelection}. */
|
|
88
|
+
export interface SelectionTarget {
|
|
89
|
+
/** First token of the resolved run (inclusive) — what the host outlines. */
|
|
90
|
+
lo: number;
|
|
91
|
+
/** Last token of the resolved run (inclusive). */
|
|
92
|
+
hi: number;
|
|
93
|
+
/** Character span of `[lo, hi]` in the text — what F9 replaces. */
|
|
94
|
+
start: number;
|
|
95
|
+
end: number;
|
|
96
|
+
/**
|
|
97
|
+
* The run's text, to evaluate as a **standalone expression** (`=<fragment>`), or `null` to evaluate
|
|
98
|
+
* {@link evalIndex} on the whole formula instead. Set only when the run is a valid expression that
|
|
99
|
+
* ISN'T a subtree of the formula — see the note on {@link evalTargetForSelection}.
|
|
100
|
+
*/
|
|
101
|
+
fragment: string | null;
|
|
102
|
+
/** The subtree to evaluate when {@link fragment} is `null`. */
|
|
103
|
+
evalIndex: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* What a **text selection** in a formula resolves to — the eval tip's target, and F9's.
|
|
107
|
+
*
|
|
108
|
+
* Three rules, in order, because no single one is right:
|
|
109
|
+
*
|
|
110
|
+
* 1. **Exactly a subtree** → evaluate it in place (`evalIndex`). The common case: selecting
|
|
111
|
+
* `SUM(A1:A5)` inside `=SUM(A1:A5)*2`.
|
|
112
|
+
*
|
|
113
|
+
* 2. **A whole-token run that parses on its own** → evaluate that TEXT as its own expression. The
|
|
114
|
+
* subtree rule alone is not enough, because an operator chain is left-nested: `=1+1+1+1` is
|
|
115
|
+
* `(((1+1)+1)+1)`, so the middle `1+1` is *not* any node — its two operands live in different
|
|
116
|
+
* subtrees. Rule 1 would widen to `1+1+1` and answer 3 for a selection that plainly reads as 2.
|
|
117
|
+
* Excel's F9 works this way throughout (it evaluates the selected text, not a node), and this is
|
|
118
|
+
* where that shows.
|
|
119
|
+
*
|
|
120
|
+
* Whole-token alignment is what keeps this honest: `1*2` inside `=A1*2` parses, but it starts
|
|
121
|
+
* mid-token (`A1`), so it never reaches this rule and can't invent a value out of a coincidence.
|
|
122
|
+
*
|
|
123
|
+
* 3. **Otherwise** → snap OUTWARD to the smallest evaluable segment containing the selection. A drag
|
|
124
|
+
* that lands mid-token (`UM(A1:A5` in `=SUM(A1:A5)*2`) still answers — for `SUM(A1:A5)` — and the
|
|
125
|
+
* host's outline shows that it widened. Requiring a clean selection instead would leave the tip
|
|
126
|
+
* silent most of the time a human made the selection by hand.
|
|
127
|
+
*
|
|
128
|
+
* `null` when the selection touches nothing evaluable (whitespace only, an unparsed tail, or a
|
|
129
|
+
* selection past the tokens).
|
|
130
|
+
*
|
|
131
|
+
* @param base The offset of the first token within the text (`formulaPrefixLen` — a stripped `=`).
|
|
132
|
+
* @param isFragment Whether a run of text compiles as a standalone expression. Supplied by the host
|
|
133
|
+
* (it owns the calc engine); rule 2 is skipped entirely without it.
|
|
134
|
+
*/
|
|
135
|
+
export declare const evalTargetForSelection: (tokens: readonly ICalculation.FormulaToken[] | null, base: number, text: string, start: number, end: number, isFragment?: (fragment: string) => boolean) => SelectionTarget | null;
|
|
136
|
+
/**
|
|
137
|
+
* The ROOT segment — the whole expression, `evalIndex` 0. Any trailing tokens the engine couldn't
|
|
138
|
+
* place (the `unparsed` tail of an in-progress formula, e.g. the `+` in `=SUM(A1)+`) are EXCLUDED:
|
|
139
|
+
* the root eval is the valid prefix, so the broken tail isn't part of what's evaluated. `null` when
|
|
140
|
+
* nothing parsed at all.
|
|
141
|
+
*/
|
|
142
|
+
export declare const rootEvalSegment: (tokens: readonly ICalculation.FormulaToken[] | null) => EvalSegment | null;
|
|
143
|
+
/** The character span of tokens `[lo, hi]` within the text (`base` = the offset of token 0). */
|
|
144
|
+
export declare const charSpanOfTokens: (tokens: readonly ICalculation.FormulaToken[], base: number, lo: number, hi: number) => {
|
|
145
|
+
start: number;
|
|
146
|
+
end: number;
|
|
147
|
+
};
|
|
148
|
+
/** The separators {@link formatEvalLiteral} images a value with. */
|
|
149
|
+
export interface LiteralSeparators {
|
|
150
|
+
/** Decimal point within a number. */
|
|
151
|
+
decimal: string;
|
|
152
|
+
/** Between array COLUMNS. */
|
|
153
|
+
column: string;
|
|
154
|
+
/** Between array ROWS. */
|
|
155
|
+
row: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The formula separators a user of this locale types, keyed off the locale's decimal point — Excel's
|
|
159
|
+
* rule: a comma decimal pushes the argument/column separator to `;` and rows to the one remaining
|
|
160
|
+
* character.
|
|
161
|
+
*
|
|
162
|
+
* @remarks
|
|
163
|
+
* Mirrors the SDK's `formulaSeparatorsForDecimal` (`calculation/compiler/FormulaSeparators`), which is
|
|
164
|
+
* internal to the engine. This is the presentation side of the same rule, and it is only ever used to
|
|
165
|
+
* BUILD text that is then re-parsed and validated before it replaces anything (see
|
|
166
|
+
* {@link formatEvalLiteral}'s note) — so a drift between the two degrades F9 to a no-op rather than
|
|
167
|
+
* writing a formula the engine can't read.
|
|
168
|
+
*/
|
|
169
|
+
export declare const literalSeparatorsForDecimal: (decimal: string) => LiteralSeparators;
|
|
170
|
+
/**
|
|
171
|
+
* An evaluated value as formula **source** — what F9 (evaluate-in-place) splices back into the text.
|
|
172
|
+
*
|
|
173
|
+
* The counterpart to {@link formatEvalValue}, and deliberately NOT the same function: that one
|
|
174
|
+
* produces DISPLAY text for a tip bubble (a string shows unquoted, a big range collapses to
|
|
175
|
+
* `{rows×cols}`), while this has to produce something the parser reads back as the same value —
|
|
176
|
+
* strings quoted, booleans as literals, arrays as real array syntax with this locale's separators.
|
|
177
|
+
*
|
|
178
|
+
* `null` (⇒ the host leaves the text alone) for anything that can't round-trip: a parse error, a
|
|
179
|
+
* non-finite number, an empty or oversized array ({@link MAX_LITERAL_CELLS}).
|
|
180
|
+
*
|
|
181
|
+
* @remarks
|
|
182
|
+
* Callers must re-parse the spliced result and abandon the edit if it doesn't compile. The locale
|
|
183
|
+
* surface here (separators, boolean words) is a mirror of the engine's, and a mismatch must cost the
|
|
184
|
+
* user nothing more than an F9 that didn't fire.
|
|
185
|
+
*/
|
|
186
|
+
export declare const formatEvalLiteral: (v: unknown, seps: LiteralSeparators, booleans?: {
|
|
187
|
+
t: string;
|
|
188
|
+
f: string;
|
|
189
|
+
}) => string | null;
|
|
190
|
+
/**
|
|
191
|
+
* Human-readable text for a segment's evaluated value — the body of the hover eval tip — or `null` to show
|
|
192
|
+
* **nothing**. A scalar renders directly; a range renders as an Excel-style array literal (`{a, b; c, d}`,
|
|
193
|
+
* comma between columns, semicolon between rows) up to {@link MAX_TIP_CELLS} cells, then collapses to its
|
|
194
|
+
* `{rows×cols}` shape so a whole-column result can't blow up the tip.
|
|
195
|
+
*
|
|
196
|
+
* A **parse** error returns `null` (no tip): while typing, a segment is often a partial (unparsed) formula,
|
|
197
|
+
* and flashing `#…!` at the pointer is noise, not information. Genuine evaluation errors (`#DIV/0!`, `#REF!`,
|
|
198
|
+
* …) still render their code — those are real results worth showing. (Error cells inside an otherwise-valid
|
|
199
|
+
* array result likewise keep their code via {@link scalarText}.)
|
|
200
|
+
*/
|
|
201
|
+
export declare const formatEvalValue: (v: unknown) => string | null;
|
|
202
|
+
//# sourceMappingURL=formulaEval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formulaEval.d.ts","sourceRoot":"","sources":["../../../../src/editor/formulaEval.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAgB,KAAK,YAAY,EAAe,MAAM,cAAc,CAAC;AAE5E,oFAAoF;AACpF,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,aAkB5B,CAAC;AAQF,sCAAsC;AACtC,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,WAAW,EAAE,CAAC,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;IAClE,yFAAyF;IACzF,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9E;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,IAAI,EAAE,QAAQ,MAAM,IAAI,KAAG,UAgDxE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,IAAI,gBAAgB,GAAG,mBAAmB,GAAG,IAAI,KAAG,OACoB,CAAC;AAE1G;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAC5C,GAAG,MAAM,KACR,WAAW,GAAG,IAgBhB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,GAAG,IAAI,EACnD,MAAM,MAAM,EACZ,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,KAAK,MAAM,EACX,aAAa,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,KACzC,eAAe,GAAG,IAiDpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,GAAG,IAAI,KAClD,WAAW,GAAG,IAKhB,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAC5C,MAAM,MAAM,EACZ,IAAI,MAAM,EACV,IAAI,MAAM,KACT;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAS9B,CAAC;AAEF,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,GAAI,SAAS,MAAM,KAAG,iBAGhB,CAAC;AAoB/C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,GAC5B,GAAG,OAAO,EACV,MAAM,iBAAiB,EACvB,WAAU;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAA8B,KAC7D,MAAM,GAAG,IAsBX,CAAC;AAYF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAI,GAAG,OAAO,KAAG,MAAM,GAAG,IAwBrD,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
import { ICalculation } from '@sheetxl/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Shared **formula presentation** — what a formula LOOKS like while hosted in any editor chrome:
|
|
5
|
+
* paren pair matching (rainbow depth colors, caret/hover emphasis, orphan-close errors), the hover
|
|
6
|
+
* eval-run band, and the trailing "input expected" marker. Pure computations + tiny presentational
|
|
7
|
+
* pieces over `(tokens, caret, hover)` — no sessions, no DOM measurement, no component state.
|
|
8
|
+
*
|
|
9
|
+
* Consumed by BOTH editor tiers: the session stack's `SheetCellInput` (the in-grid editor + formula
|
|
10
|
+
* bar mirror) and the session-less field widgets (`useFormulaInputParts` → the plain `FormulaInput`,
|
|
11
|
+
* the MUI `FormulaField`). One home means a formula reads identically everywhere by construction.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Footprint of the trailing "input expected" marker, shared by the marker itself and the measurement
|
|
15
|
+
* mirror. The marker is real painted content that sits PAST the last character, so a host that sizes
|
|
16
|
+
* to its text has to reserve the same space — otherwise the reported natural width is short by this
|
|
17
|
+
* much and the box clips the end of the formula (the marker pushes the text out from under the
|
|
18
|
+
* visible box).
|
|
19
|
+
*/
|
|
20
|
+
export declare const INPUT_EXPECTED_WIDTH = "0.6em";
|
|
21
|
+
export declare const INPUT_EXPECTED_MARGIN_LEFT = "1px";
|
|
22
|
+
/** The marker's total horizontal footprint — the space a text-sized host reserves while it shows. */
|
|
23
|
+
export declare const INPUT_EXPECTED_FOOTPRINT = "calc(0.6em + 1px)";
|
|
24
|
+
/**
|
|
25
|
+
* The "input expected" marker.
|
|
26
|
+
*
|
|
27
|
+
* Painted where an operand/argument is expected at the caret (`isInputExpectedAt`) — TRAILING after
|
|
28
|
+
* the last character (`=A1+|`), or mid-text in a cleared argument's slot (`=SUM(|,A1:C3)`), where it
|
|
29
|
+
* rides zero-width inside the caret's token span. Modeled on the marker Google Sheets shows.
|
|
30
|
+
*
|
|
31
|
+
* Takes ZERO in-flow width — the glyph overflows a 0-width anchor and paints into the
|
|
32
|
+
* {@link INPUT_EXPECTED_FOOTPRINT} of `paddingRight` a text-sized host reserves while it shows. The
|
|
33
|
+
* marker lives only in an overlay (a textarea/input can't hold elements), so any in-flow width here
|
|
34
|
+
* would shift the overlay's glyphs relative to the real control's under a right/center alignment —
|
|
35
|
+
* parking the caret visually AFTER the marker. Zero width + shared padding keeps the two layers'
|
|
36
|
+
* text layout (positions AND wrap points) identical in every alignment, with the caret before the
|
|
37
|
+
* marker.
|
|
38
|
+
*/
|
|
39
|
+
export declare const InputExpectedMarker: React.FC;
|
|
40
|
+
/** Token types whose value equals what's typed — no eval tip for a lone literal (self-evident). */
|
|
41
|
+
export declare const SELF_EVIDENT_LITERAL: ReadonlySet<string>;
|
|
42
|
+
/**
|
|
43
|
+
* The hovered eval run's box style — background + a rounded 1px outline — applied to a SINGLE
|
|
44
|
+
* wrapper element around the run's tokens. Because it's one element rather than a per-token
|
|
45
|
+
* reconstruction, it styles like any ordinary box: swap these constants, target the
|
|
46
|
+
* `.formula-eval-run` class, or hoist this to a prop/theme token. The outline is an INSET box-shadow
|
|
47
|
+
* rather than a `border` so it adds no inline box and never shifts the overlaid text off the control.
|
|
48
|
+
*/
|
|
49
|
+
export declare const EVAL_RUN_STYLE: CSSProperties;
|
|
50
|
+
/**
|
|
51
|
+
* The eval run as an OUTLINE only — the {@link EVAL_RUN_STYLE} box minus its fill.
|
|
52
|
+
*
|
|
53
|
+
* Used when the run was named by a text SELECTION rather than the pointer. There the control is
|
|
54
|
+
* already painting the native selection tint, and this band is the same color by design (see
|
|
55
|
+
* {@link EVAL_RUN_BG}), so filling it too would stack two identical highlights and blur the boundary
|
|
56
|
+
* of what the user actually selected. The outline alone says "this is the expression being
|
|
57
|
+
* evaluated" — and because the selection snaps outward to the enclosing expression, it will often
|
|
58
|
+
* enclose MORE than the tinted text, which is exactly the thing worth showing.
|
|
59
|
+
*/
|
|
60
|
+
export declare const EVAL_RUN_OUTLINE_STYLE: CSSProperties;
|
|
61
|
+
/**
|
|
62
|
+
* The hue for a paren at `depth` (0 = outermost), cycling once the palette is exhausted.
|
|
63
|
+
* Theme-adaptive: emits `light-dark(light, dark)` so the browser re-picks from the subtree's
|
|
64
|
+
* `color-scheme` with no re-render — no `darkMode` flag needed (see `IColor.CSSMode`'s `'adaptive'`).
|
|
65
|
+
*/
|
|
66
|
+
export declare const parenDepthColor: (depth: number) => string;
|
|
67
|
+
/**
|
|
68
|
+
* The zero-width slot the enlarged copy is painted from — the reason emphasis costs no layout.
|
|
69
|
+
*
|
|
70
|
+
* The overlay is painted over a TRANSPARENT-TEXT control, so its glyphs must stay metrically
|
|
71
|
+
* identical to the real ones: scaling or bolding anything in flow would slide every following
|
|
72
|
+
* character off the text it covers. So the real glyph stays in flow (transparent — it still owns the
|
|
73
|
+
* advance width and the hit-test box the hover eval tip measures) and the visible, scaled copy is
|
|
74
|
+
* painted from this box, which takes up no width and lets its content overflow. `inline-block` is
|
|
75
|
+
* what makes it exact: the copy is baseline-aligned to the surrounding text automatically, so it
|
|
76
|
+
* lands dead-on the glyph it replaces without any absolute-positioning arithmetic. `transform` never
|
|
77
|
+
* affects layout, so the scale is free.
|
|
78
|
+
*/
|
|
79
|
+
export declare const PAREN_EMPHASIS_SLOT: CSSProperties;
|
|
80
|
+
export declare const parenEmphasisGlyph: (hue: string) => CSSProperties;
|
|
81
|
+
/** An unbalanced paren (no partner) — reuses the reference red so it reads as an error. */
|
|
82
|
+
export declare const PAREN_ERROR_COLOR = "var(--sxl-color-error, #d93025)";
|
|
83
|
+
/** The paren pairing of a token stream — see {@link computeParenMatch}. */
|
|
84
|
+
export interface ParenMatch {
|
|
85
|
+
/** Pairs each `(`/`)` token index with its partner (both directions). */
|
|
86
|
+
matchOf: ReadonlyMap<number, number>;
|
|
87
|
+
/** Each paren's nesting depth (0 = outermost) — drives the pair's color. */
|
|
88
|
+
depthOf: ReadonlyMap<number, number>;
|
|
89
|
+
/** Orphan CLOSE parens only — a `)` with no `(` (rendered red). */
|
|
90
|
+
unmatched: ReadonlySet<number>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* One stack pass over the tokens: `matchOf` pairs each `(`/`)` token index with its partner;
|
|
94
|
+
* `depthOf` records each paren's nesting depth (0 = outermost), which drives the pair's color;
|
|
95
|
+
* `unmatched` holds only an ORPHAN CLOSE — a `)` with no `(` (rendered red). A still-open `(` is NOT
|
|
96
|
+
* flagged: mid-typing a formula is unbalanced by nature (`=sum(` isn't an error yet), and reddening
|
|
97
|
+
* the open paren would make normal editing read as broken. Round parens only — braces/brackets later.
|
|
98
|
+
*
|
|
99
|
+
* An unclosed `(` still gets a depth, so a pair being typed picks up its color immediately rather
|
|
100
|
+
* than popping into one only once the `)` lands. An orphan `)` gets none — it renders as an error.
|
|
101
|
+
*/
|
|
102
|
+
export declare const computeParenMatch: (tokens: readonly ICalculation.FormulaToken[] | null) => ParenMatch;
|
|
103
|
+
/**
|
|
104
|
+
* The round-paren `(`/`)` pair to emphasize when the caret is adjacent to one — prefers the paren
|
|
105
|
+
* just LEFT of the caret (the just-typed case), else the one just right. Returns the pair token
|
|
106
|
+
* indices sorted, or `null` (caret not next to a paren, or the paren is unbalanced — those render
|
|
107
|
+
* red instead).
|
|
108
|
+
*/
|
|
109
|
+
export declare const parenPairAtCaret: (tokens: readonly ICalculation.FormulaToken[], matchOf: ReadonlyMap<number, number>, caret: number, base: number) => readonly [number, number] | null;
|
|
110
|
+
export declare const isSamePair: (a: readonly [number, number] | null, b: readonly [number, number] | null) => boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Which parens paint EMPHASIZED (bigger + bolder). **Exactly one pair at a time** — in a formula
|
|
113
|
+
* with a dozen nested calls, two loud pairs read as two answers to "which pair is active?" and the
|
|
114
|
+
* emphasis stops meaning anything. So the two sources are a PRIORITY, not a union:
|
|
115
|
+
*
|
|
116
|
+
* 1. HOVER WINS. While the eval tip is up it owns the emphasis: the pair BOUNDING the hovered run.
|
|
117
|
+
* The band already says "this is the sub-expression"; its outer pair says which parens delimit
|
|
118
|
+
* it — the part that's genuinely hard to see when nested. Transient, so it overrides the caret
|
|
119
|
+
* and reverts.
|
|
120
|
+
* 2. Otherwise the caret's pair.
|
|
121
|
+
*
|
|
122
|
+
* "Bounding" = the first COMPLETE pair at the run's minimum depth (a close paren whose partner sits
|
|
123
|
+
* outside the run is skipped — it bounds something larger, not this). A run holding siblings —
|
|
124
|
+
* `(A1)+(B1)` — therefore lights the first pair only, keeping the one-pair rule.
|
|
125
|
+
*
|
|
126
|
+
* A hover owns the emphasis WHETHER OR NOT it lands on a pair: hovering a bare reference emphasizes
|
|
127
|
+
* nothing, rather than falling back to the caret's pair. The state you're pointing at is the state
|
|
128
|
+
* being described — a pair still lit somewhere else while you inspect a plain token is the same
|
|
129
|
+
* "which one is active?" ambiguity, just spread across two gestures instead of two pairs.
|
|
130
|
+
* Orphan `)` has no depth, so an error never emphasizes.
|
|
131
|
+
*/
|
|
132
|
+
export declare const pickEmphasizedParens: (hoverRun: {
|
|
133
|
+
lo: number;
|
|
134
|
+
hi: number;
|
|
135
|
+
} | null, caretPair: readonly [number, number] | null, parenMatch: ParenMatch) => ReadonlySet<number>;
|
|
136
|
+
//# sourceMappingURL=formulaPresentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formulaPresentation.d.ts","sourceRoot":"","sources":["../../../../src/editor/formulaPresentation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAuB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD;;;;;;;;;GASG;AAIH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAChD,qGAAqG;AACrG,eAAO,MAAM,wBAAwB,sBAAkE,CAAC;AAExG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAsBvC,CAAC;AAIF,mGAAmG;AACnG,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAA4C,CAAC;AAelG;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,aAI5B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAC;AAcF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,KAAG,MAG/C,CAAC;AAWF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAKjC,CAAC;AAUF,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,aAO/C,CAAC;AAEH,2FAA2F;AAC3F,eAAO,MAAM,iBAAiB,oCAAoC,CAAC;AAEnE,2EAA2E;AAC3E,MAAM,WAAW,UAAU;IACzB,yEAAyE;IACzE,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,4EAA4E;IAC5E,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mEAAmE;IACnE,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAChC;AAID;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,GAAG,IAAI,KAAG,UAiBvF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAC5C,SAAS,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,OAAO,MAAM,EACb,MAAM,MAAM,KACX,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAkB9B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAAG,OAC3C,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EAC3C,WAAW,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAC3C,YAAY,UAAU,KACrB,WAAW,CAAC,MAAM,CAqBpB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ICalculation, IRange } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Characters after which an operand/argument is expected — the binary operators plus what can only
|
|
4
|
+
* PRECEDE an operand: the formula lead / unary `+` `-`, a group/call `(`, and the intersection
|
|
5
|
+
* operator ` `.
|
|
6
|
+
*
|
|
7
|
+
* Used to determine if we may enter 'point' mode (and whether a picked reference needs a `,`
|
|
8
|
+
* separator before it — see `SheetCellInput.insertReferenceToText`).
|
|
9
|
+
*/
|
|
10
|
+
export declare const INPUT_EXPECTED_CHAR: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether an operand/argument is expected AT `caret` — the gate for the "input expected" marker and
|
|
13
|
+
* for insert-arming the reference picker at the caret.
|
|
14
|
+
*
|
|
15
|
+
* True when the character before the caret opens an operand slot ({@link INPUT_EXPECTED_CHAR}) AND
|
|
16
|
+
* nothing after the caret already fills it: the caret is at the end of the text (the classic trailing
|
|
17
|
+
* case — `=A1+|`), or the next non-space character still leaves the slot empty
|
|
18
|
+
* ({@link OPERAND_STILL_MISSING_CHAR}) — the mid-formula case a cleared argument leaves behind
|
|
19
|
+
* (`=SUM(|,A1:C3)`). A next character that STARTS an operand (`=|SUM(A1)`, `=SUM(1,|-2)`) means the
|
|
20
|
+
* slot is taken: the caret is doing text work there, and splicing a reference in would corrupt the
|
|
21
|
+
* token after it.
|
|
22
|
+
*
|
|
23
|
+
* (The caller decides what the text IS — a formula, a reference segment; this is the pure caret rule.)
|
|
24
|
+
*/
|
|
25
|
+
export declare const isInputExpectedAt: (text: string, caret: number) => boolean;
|
|
26
|
+
/** Whether `value` is a formula being typed — Excel starts one with `=`, `+`, or `-`. */
|
|
27
|
+
export declare const isFormulaText: (value: string) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* How many leading characters of a formula the tokenizer leaves uncovered — the offset at which the SDK's
|
|
30
|
+
* tokens begin. `createFormula` strips a leading `=` (its tokens then start at offset 1), but
|
|
31
|
+
* keeps a leading `+`/`-` as a `prefix` token (tokens start at offset 0). Every caret↔token walk and every
|
|
32
|
+
* text-reassembly keys off this instead of assuming a bare `=`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const formulaPrefixLen: (value: string) => number;
|
|
35
|
+
/**
|
|
36
|
+
* Syntax color for a formula token, or `undefined` to inherit the cell's font color (operators, parens,
|
|
37
|
+
* separators, whitespace). Reference-literal tokens (`token.isReference` — cells AND the range operators
|
|
38
|
+
* that bind them, e.g. `:`) rotate through `PICKER_COLORS` by `referenceIndex`, so co-referenced ranges
|
|
39
|
+
* share a hue — LITERALLY the same color expressions the range picker draws its rectangles with, so text
|
|
40
|
+
* and on-grid rectangle always match, both follow light/dark for free, AND a field OUTSIDE any themed
|
|
41
|
+
* workbook surface (a standalone dialog/panel — no `--sxl-color-series-*` definitions in scope) still
|
|
42
|
+
* colors through the palette's built-in literal fallbacks. (A bare `var()` with no fallback computes to
|
|
43
|
+
* *nothing* there — references silently rendered in the plain text color.) Keying off the SDK's
|
|
44
|
+
* `isReference` (not a hardcoded type list) keeps the whole span, operators included, one color while a
|
|
45
|
+
* function that merely returns a reference stays function-colored.
|
|
46
|
+
*/
|
|
47
|
+
export declare const tokenColor: (token: ICalculation.FormulaToken) => string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Index of the token whose span contains `caret` (offsets start after the leading prefix — `base`; see
|
|
50
|
+
* {@link formulaPrefixLen}). At a boundary the LEFT token wins — the one just typed into — so the caret
|
|
51
|
+
* adopts the color of the character behind it. `-1` when the caret is in the prefix or past the end.
|
|
52
|
+
*/
|
|
53
|
+
export declare const tokenIndexAtCaret: (tokens: readonly ICalculation.FormulaToken[], caret: number, base: number) => number;
|
|
54
|
+
/**
|
|
55
|
+
* Character span (after the leading prefix — `base`; see {@link formulaPrefixLen}) of the reference at
|
|
56
|
+
* `refIndex` — `start` = its first token's start, `end` = its last token's end. `null` if that reference
|
|
57
|
+
* isn't present. Walks the ORIGINAL tokens (faithful `text`); used to tell whether the caret is on a
|
|
58
|
+
* reference the picker rewrote, and to park it at that reference's end.
|
|
59
|
+
*/
|
|
60
|
+
export declare const referenceSpan: (tokens: readonly ICalculation.FormulaToken[], refIndex: number, base: number) => {
|
|
61
|
+
start: number;
|
|
62
|
+
end: number;
|
|
63
|
+
} | null;
|
|
64
|
+
/**
|
|
65
|
+
* F4 — cycle `$` (relative ⇄ absolute) on the reference under the caret, as a PURE text rewrite.
|
|
66
|
+
* Tokenizes `value` (a formula string — `=`/`+`/`-` lead), reads the caret cell token's `refSide`
|
|
67
|
+
* (`self` / `left` / `right` — the range corner, provided by the SDK), cycles that corner on a
|
|
68
|
+
* throwaway formula (no commit), and returns the rewritten text plus the caret position at the END of
|
|
69
|
+
* the cell that was toggled (so the caret stays roughly in place rather than jumping mid-reference,
|
|
70
|
+
* and a repeat F4 stays on the same range). `null` when the caret isn't on a reference cell, the text
|
|
71
|
+
* isn't a formula, or the rewrite fails — the caller leaves the edit untouched.
|
|
72
|
+
*
|
|
73
|
+
* Shared by the cell editor's caret handle (`SheetCellInput`) and the reference field
|
|
74
|
+
* (`useFormulaInput`'s reference grammar, which runs it per comma-segment) so F4 behaves identically in both.
|
|
75
|
+
*/
|
|
76
|
+
export declare const toggleReferenceInFormula: (calc: ICalculation, value: string, caret: number, home?: Partial<IRange.CellCoords>) => {
|
|
77
|
+
value: string;
|
|
78
|
+
caret: number;
|
|
79
|
+
} | null;
|
|
80
|
+
//# sourceMappingURL=formulaText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formulaText.d.ts","sourceRoot":"","sources":["../../../../src/editor/formulaText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAmB9D;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,QAAgC,CAAC;AAWjE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,OAM/D,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,OAAuD,CAAC;AAEtG;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,MAAoC,CAAC;AAEtF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,YAAY,CAAC,YAAY,KAAG,MAAM,GAAG,SAetE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAAE,OAAO,MAAM,EAAE,MAAM,MAAM,KAAG,MAQ7G,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,SAAS,YAAY,CAAC,YAAY,EAAE,EAC5C,UAAU,MAAM,EAChB,MAAM,MAAM,KACX;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAUnC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GACnC,MAAM,YAAY,EAClB,OAAO,MAAM,EACb,OAAO,MAAM,EACb,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,KAChC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAiCrC,CAAC"}
|