@rowsncolumns/spreadsheet 10.5.0 → 10.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +19 -2
- package/dist/cjs/components/formula-input/index.d.ts.map +1 -1
- package/dist/cjs/components/formula-input/index.js +28 -1
- package/dist/cjs/components/range-selector/index.d.ts.map +1 -1
- package/dist/cjs/components/range-selector/index.js +54 -34
- package/dist/cjs/hooks/use-fonts.d.ts +23 -2
- package/dist/cjs/hooks/use-fonts.d.ts.map +1 -1
- package/dist/cjs/hooks/use-fonts.js +33 -3
- package/dist/cjs/hooks/use-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection.js +62 -16
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +18 -2
- package/dist/esm/components/formula-input/index.d.ts.map +1 -1
- package/dist/esm/components/formula-input/index.js +26 -1
- package/dist/esm/components/range-selector/index.d.ts.map +1 -1
- package/dist/esm/components/range-selector/index.js +56 -36
- package/dist/esm/hooks/use-fonts.d.ts +23 -2
- package/dist/esm/hooks/use-fonts.d.ts.map +1 -1
- package/dist/esm/hooks/use-fonts.js +28 -2
- package/dist/esm/hooks/use-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection.js +62 -17
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAoDA,OAAO,KASN,MAAM,OAAO,CAAC;AAqNf,OAAO,KAAK,EAGV,QAAQ,EAWT,MAAM,aAAa,CAAC;AAoBrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAoDA,OAAO,KASN,MAAM,OAAO,CAAC;AAqNf,OAAO,KAAK,EAGV,QAAQ,EAWT,MAAM,aAAa,CAAC;AAoBrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;AAm4LnB,eAAO,MAAM,UAAU,EAA4C,CACjE,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,EAEvB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GACvB,wBAAwB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -120,6 +120,17 @@ var helpers_2 = require("./helpers");
|
|
|
120
120
|
*/
|
|
121
121
|
/** Where the grid focuses when no cell is given (A1); mirrors spreadsheet-state's `defaultCellCoords` without importing it — that package depends on this one. */
|
|
122
122
|
var defaultCellCoords = { rowIndex: 1, columnIndex: 1 };
|
|
123
|
+
/**
|
|
124
|
+
* Whether a registered editor's DOM has been removed: an input that unmounted while focused
|
|
125
|
+
* gets no blur from Chromium, so its `activeEditor` registration can outlive it. Such an editor
|
|
126
|
+
* cannot hold focus, so the grid treats it as absent (rowsncolumns/spreadsheet#1131). An editor
|
|
127
|
+
* that exposes no element is trusted as live.
|
|
128
|
+
*/
|
|
129
|
+
function isDetachedEditor(editor) {
|
|
130
|
+
var _a;
|
|
131
|
+
var element = (_a = editor.el) === null || _a === void 0 ? void 0 : _a.call(editor);
|
|
132
|
+
return element != null && !element.isConnected;
|
|
133
|
+
}
|
|
123
134
|
function CanvasGridComponent(props, forwardedRef) {
|
|
124
135
|
var _a, _b, _c, _d;
|
|
125
136
|
var licenseKey = props.licenseKey, sheetId = props.sheetId, sheetType = props.sheetType, _e = props.ChartSheetView, ChartSheetViewComponent = _e === void 0 ? chart_sheet_view_1.ChartSheetView : _e, instanceId = props.instanceId, _f = props.activeCell, activeCell = _f === void 0 ? config_1.DEFAULT_ACTIVE_CELL : _f, _g = props.selections, selections = _g === void 0 ? config_1.DEFAULT_ARRAY : _g, _h = props.frozenColumnCount, frozenColumnCount = _h === void 0 ? 0 : _h, _j = props.frozenRowCount, frozenRowCount = _j === void 0 ? 0 : _j, _k = props.rowCount, rowCount = _k === void 0 ? config_1.DEFAULT_ROW_COUNT : _k, _l = props.columnCount, columnCount = _l === void 0 ? config_1.DEFAULT_COLUMN_COUNT : _l, autoFocus = props.autoFocus, basicFilter = props.basicFilter, tables = props.tables, namedRanges = props.namedRanges, _m = props.bandedRanges, bandedRanges = _m === void 0 ? config_1.DEFAULT_ARRAY : _m, _o = props.tableBorderColor, tableBorderColor = _o === void 0 ? "#008000" : _o, _p = props.filterIconColor, filterIconColor = _p === void 0 ? "#008000" : _p, conditionalFormats = props.conditionalFormats, _q = props.showFilterIcon, showFilterIcon = _q === void 0 ? true : _q, _r = props.showCalculatedColumnIcon, showCalculatedColumnIcon = _r === void 0 ? true : _r, _s = props.showHeaders, showHeaders = _s === void 0 ? true : _s, _t = props.defaultColumnWidth, defaultColumnWidth = _t === void 0 ? config_1.DEFAULT_COLUMN_WIDTH : _t, _u = props.defaultRowHeight, defaultRowHeight = _u === void 0 ? config_1.DEFAULT_ROW_HEIGHT : _u, _v = props.columnHeaderHeight, columnHeaderHeight = _v === void 0 ? config_1.COLUMN_HEADER_HEIGHT : _v, _w = props.rowHeaderWidth, rowHeaderWidth = _w === void 0 ? config_1.ROW_HEADER_WIDTH : _w, _x = props.gridLineColor, gridLineColor = _x === void 0 ? config_1.GRIDLINE_COLOR : _x, _y = props.cellBackgroundColor, cellBackgroundColor = _y === void 0 ? config_1.DEFAULT_CELL_BACKGROUND_COLOR : _y, _z = props.cellColor, cellColor = _z === void 0 ? config_1.DEFAULT_CELL_COLOR : _z, _0 = props.headerBorderColor, headerBorderColor = _0 === void 0 ? config_1.DEFAULT_HEADER_BORDER_COLOR : _0, _1 = props.headerBackgroundColor, headerBackgroundColor = _1 === void 0 ? config_1.DEFAULT_HEADER_BG : _1, _2 = props.headerColor, headerColor = _2 === void 0 ? config_1.DEFAULT_HEADER_COLOR : _2, _3 = props.headerActiveBackgroundColor, headerActiveBackgroundColor = _3 === void 0 ? config_1.DEFAULT_HEADER_ACTIVE_BG : _3, _4 = props.headerSelectedBackgroundColor, headerSelectedBackgroundColor = _4 === void 0 ? config_1.DEFAULT_HEADER_SELECTED_BG : _4, _5 = props.headerSelectedColor, headerSelectedColor = _5 === void 0 ? "white" : _5, _6 = props.headerTableBackgroundColor, headerTableBackgroundColor = _6 === void 0 ? config_1.DEFAULT_HEADER_TABLE_BG : _6, _7 = props.headerTableActiveBackgroundColor, headerTableActiveBackgroundColor = _7 === void 0 ? config_1.DEFAULT_HEADER_ACTIVE_TABLE_BG : _7, _8 = props.headerTableSelectedBackgroundColor, headerTableSelectedBackgroundColor = _8 === void 0 ? config_1.DEFAULT_HEADER_SELECTED_TABLE_BG : _8, _9 = props.frozenShadowColor, frozenShadowColor = _9 === void 0 ? headerBorderColor : _9, _10 = props.frozenShadowThickness, frozenShadowThickness = _10 === void 0 ? 1 : _10, _11 = props.selectionBackgroundColor, selectionBackgroundColor = _11 === void 0 ? config_1.SELECTION_BG : _11, _12 = props.selectionBorderColor, selectionBorderColor = _12 === void 0 ? config_1.SELECTION_BORDER : _12, _13 = props.selectionDragBorderColor, selectionDragBorderColor = _13 === void 0 ? config_1.SELECTION_BORDER : _13, chartSelectedColor = props.chartSelectedColor, _14 = props.chipBackgroundColor, chipBackgroundColor = _14 === void 0 ? config_1.CHIP_COLOR : _14, _15 = props.merges, merges = _15 === void 0 ? config_1.DEFAULT_ARRAY : _15, borderStyles = props.borderStyles, protectedRanges = props.protectedRanges, _16 = props.isWorkbookProtected, isWorkbookProtectedProp = _16 === void 0 ? false : _16, getSheetProtection = props.getSheetProtection, pivotTables = props.pivotTables, charts = props.charts, onUpdateChart = props.onUpdateChart, onChangeZOrder = props.onChangeZOrder, embeds = props.embeds, slicers = props.slicers, _17 = props.rowMetadata, rowMetadata = _17 === void 0 ? config_1.DEFAULT_ARRAY : _17, _18 = props.columnMetadata, columnMetadata = _18 === void 0 ? config_1.DEFAULT_ARRAY : _18, _19 = props.scale, scale = _19 === void 0 ? 1 : _19, _20 = props.zoomSpeed, zoomSpeed = _20 === void 0 ? 1 : _20, _21 = props.overscanCount, overscanCount = _21 === void 0 ? 3 : _21, _22 = props.enableEditOnEnterKey, enableEditOnEnterKey = _22 === void 0 ? true : _22, _23 = props.enableTextOverflow, enableTextOverflow = _23 === void 0 ? true : _23, _showGridLines = props.showGridLines, _24 = props.showFormulas, showFormulas = _24 === void 0 ? false : _24, _25 = props.protectFormulas, protectFormulas = _25 === void 0 ? false : _25, _26 = props.showFrozenSeparator, showFrozenSeparator = _26 === void 0 ? true : _26, _27 = props.HeaderCell, HeaderCell = _27 === void 0 ? header_cell_1.HeaderCell : _27, _28 = props.Cell, Cell = _28 === void 0 ? cell_1.Cell : _28, _29 = props.SelectionTitleComponent, SelectionTitleComponent = _29 === void 0 ? title_1.SelectionTitle : _29, _30 = props.CellEditor, CellEditor = _30 === void 0 ? cell_editor_1.CellEditor : _30, CellTooltip = props.CellTooltip, _31 = props.ContextMenu, ContextMenu = _31 === void 0 ? context_menu_1.ContextMenu : _31, _32 = props.ContextMenuWrapper, ContextMenuWrapper = _32 === void 0 ? use_context_menu_1.DefaultContextMenuWrapper : _32, _33 = props.FilterBox, FilterBox = _33 === void 0 ? filter_box_1.FilterBox : _33, _34 = props.HeaderMoveDragComponent, HeaderMoveDragComponent = _34 === void 0 ? header_move_1.HeaderMoveDragComponent : _34, SuggestionsDropdown = props.SuggestionsDropdown, _35 = props.stickyEditor, stickyEditor = _35 === void 0 ? true : _35, _36 = props.scrollSnap, scrollSnap = _36 === void 0 ? false : _36, scrollThrottleTimeout = props.scrollThrottleTimeout, preventBrowserDefaultScroll = props.preventBrowserDefaultScroll, _37 = props.mouseMoveThrottleTimeout, mouseMoveThrottleTimeout = _37 === void 0 ? 60 : _37, _38 = props.tooltipIntentInterval, tooltipIntentInterval = _38 === void 0 ? 60 : _38, selectionPolicy = props.selectionPolicy, users = props.users, userId = props.userId, renderCollaboratorCursor = props.renderCollaboratorCursor, functionDescriptions = props.functionDescriptions, _39 = props.showHeaderMenuButton, showHeaderMenuButton = _39 === void 0 ? true : _39, _40 = props.scrollbarSize, scrollbarSize = _40 === void 0 ? config_1.SCROLLBAR_SIZE : _40, _41 = props.theme, theme = _41 === void 0 ? config_1.defaultSpreadsheetTheme : _41, _42 = props.showNotes, showNotes = _42 === void 0 ? true : _42, _43 = props.showComments, showComments = _43 === void 0 ? true : _43, locale = props.locale, formulaLocaleProp = props.formulaLocale, agentSuggestions = props.agentSuggestions, onReviewSuggestion = props.onReviewSuggestion, onShowFormulas = props.onShowFormulas, getDataRowCount = props.getDataRowCount, getDataRegion = props.getDataRegion, getChartComponent = props.getChartComponent, getEmbedComponent = props.getEmbedComponent, getSlicerComponent = props.getSlicerComponent, onChange = props.onChange, onChangeBatch = props.onChangeBatch, onExpandCollapse = props.onExpandCollapse, onPivotDrillDown = props.onPivotDrillDown, onDelete = props.onDelete, onChangeEditorValue = props.onChangeEditorValue, onFill = props.onFill, onRequestCalculate = props.onRequestCalculate, onChangeActiveCell = props.onChangeActiveCell, onChangeActiveSheet = props.onChangeActiveSheet, onChangeSelections = props.onChangeSelections, getSheetName = props.getSheetName, getSheetId = props.getSheetId, getCellData = props.getCellData, getNoteProp = props.getNote, getTextFormatRuns = props.getTextFormatRuns, getDataValidation = props.getDataValidation, getEffectiveFormat = props.getEffectiveFormat, getFormattedValueProp = props.getFormattedValue, getTooltipContent = props.getTooltipContent, errorResolutionComponent = props.errorResolutionComponent, getEffectiveValueProp = props.getEffectiveValue, getSparklineGroup = props.getSparklineGroup, getUserEnteredExtendedValue = props.getUserEnteredExtendedValue, getEffectiveExtendedValue = props.getEffectiveExtendedValue, getSheetRowCount = props.getSheetRowCount, getSheetColumnCount = props.getSheetColumnCount, getCellPopoverContent = props.getCellPopoverContent, onScroll = props.onScroll, onViewPortChange = props.onViewPortChange, _44 = props.windowConditionalFormats, windowConditionalFormats = _44 === void 0 ? false : _44, _45 = props.engineConditionalFormatResults, engineConditionalFormatResults = _45 === void 0 ? false : _45, onResize = props.onResize, onAutoResize = props.onAutoResize, onHideColumn = props.onHideColumn, onHideRow = props.onHideRow, onShowColumn = props.onShowColumn, onShowRow = props.onShowRow, onGroupRows = props.onGroupRows, onUngroupRows = props.onUngroupRows, onCollapseRowGroup = props.onCollapseRowGroup, onExpandRowGroup = props.onExpandRowGroup, onGroupColumns = props.onGroupColumns, onUngroupColumns = props.onUngroupColumns, onCollapseColumnGroup = props.onCollapseColumnGroup, onExpandColumnGroup = props.onExpandColumnGroup, onSetOutlineDepth = props.onSetOutlineDepth, onDeleteRow = props.onDeleteRow, onDeleteColumn = props.onDeleteColumn, onInsertRow = props.onInsertRow, onInsertColumn = props.onInsertColumn, onChangeAutoExpandTables = props.onChangeAutoExpandTables, onChangeAutoCalculatedColumns = props.onChangeAutoCalculatedColumns, onInsertCellsShiftDown = props.onInsertCellsShiftDown, onInsertCellsShiftRight = props.onInsertCellsShiftRight, onDeleteCellsShiftLeft = props.onDeleteCellsShiftLeft, onDeleteCellsShiftUp = props.onDeleteCellsShiftUp, onClearContents = props.onClearContents, onMoveColumns = props.onMoveColumns, onMoveRows = props.onMoveRows, onSelectNextSheet = props.onSelectNextSheet, onSelectPreviousSheet = props.onSelectPreviousSheet, onCreateNewSheet = props.onCreateNewSheet, onKeyDown = props.onKeyDown, onChangeFormatting = props.onChangeFormatting, onRepeatFormatting = props.onRepeatFormatting, onClearFormatting = props.onClearFormatting, onRequestEditProtectedRange = props.onRequestEditProtectedRange, onMoveChart = props.onMoveChart, onResizeChart = props.onResizeChart, onDeleteChart = props.onDeleteChart, onCutChart = props.onCutChart, onCopyChart = props.onCopyChart, onMoveEmbed = props.onMoveEmbed, onResizeEmbed = props.onResizeEmbed, onDeleteEmbed = props.onDeleteEmbed, onRequestEditEmbed = props.onRequestEditEmbed, onMoveSlicer = props.onMoveSlicer, onResizeSlicer = props.onResizeSlicer, onDeleteSlicer = props.onDeleteSlicer, onRequestEditSlicer = props.onRequestEditSlicer, onFillRange = props.onFillRange, disableFillRightShortcut = props.disableFillRightShortcut, keymap = props.keymap, onCalculateNow = props.onCalculateNow, onRequestGoTo = props.onRequestGoTo, onMoveSelection = props.onMoveSelection, onInsertCutCells = props.onInsertCutCells, onInsertTime = props.onInsertTime, onInsertDate = props.onInsertDate, onInsertDateTime = props.onInsertDateTime, onInsertAutoSum = props.onInsertAutoSum, onUndo = props.onUndo, onRedo = props.onRedo, onPaste = props.onPaste, onCopy = props.onCopy, onCut = props.onCut, onSortColumn = props.onSortColumn, onSortTable = props.onSortTable, onFilterTable = props.onFilterTable, onFilterPivot = props.onFilterPivot, onResizeTable = props.onResizeTable, onUndoTableAutoExpansion = props.onUndoTableAutoExpansion, onUndoCalculatedColumn = props.onUndoCalculatedColumn, onOverwriteCalculatedColumn = props.onOverwriteCalculatedColumn, onRequestEditTable = props.onRequestEditTable, onRequestEditPivotTable = props.onRequestEditPivotTable, onRequestDeletePivotTable = props.onRequestDeletePivotTable, onRequestCreatePivotChart = props.onRequestCreatePivotChart, onRemoveTable = props.onRemoveTable, onCreateTable = props.onCreateTable, onRequestCreateTable = props.onRequestCreateTable, onInsertTableColumn = props.onInsertTableColumn, onDeleteTableColumn = props.onDeleteTableColumn, onInsertTableRow = props.onInsertTableRow, onDeleteTableRow = props.onDeleteTableRow, onUpdateTable = props.onUpdateTable, onRequestResizeTable = props.onRequestResizeTable, onRequestInsertSlicer = props.onRequestInsertSlicer, onCreateBasicFilter = props.onCreateBasicFilter, onRequestDefineNamedRange = props.onRequestDefineNamedRange, onRequestFormatCells = props.onRequestFormatCells, onRequestConditionalFormat = props.onRequestConditionalFormat, onRequestDataValidation = props.onRequestDataValidation, onRequestInsertComment = props.onRequestInsertComment, onRequestInsertLink = props.onRequestInsertLink, onFreezeColumn = props.onFreezeColumn, onFreezeRow = props.onFreezeRow, onUpdateNote = props.onUpdateNote, onProtectRange = props.onProtectRange, onUnProtectRange = props.onUnProtectRange, onSortRange = props.onSortRange, onRequestSearch = props.onRequestSearch, onRequestReplace = props.onRequestReplace, onRequestResize = props.onRequestResize, _46 = props.getRowHeaderText, getRowHeaderText = _46 === void 0 ? helpers_1.getDefaultRowHeader : _46, _47 = props.getColumnHeaderText, getColumnHeaderText = _47 === void 0 ? helpers_1.getDefaultColumnHeader : _47, getAdditionalCellSpacing = props.getAdditionalCellSpacing, _48 = props.tokenizer, defaultTokenizer = _48 === void 0 ? calculator_1.tokenize : _48, onChangeScale = props.onChangeScale, onRemoveLink = props.onRemoveLink, onSelectLink = props.onSelectLink, onSplitTextToColumns = props.onSplitTextToColumns, onRemoveDuplicates = props.onRemoveDuplicates, onGoalSeek = props.onGoalSeek, onSubtotal = props.onSubtotal, onAdvancedFilter = props.onAdvancedFilter, onRequestExpand = props.onRequestExpand, cellExpandPredicate = props.cellExpandPredicate, _49 = props.StructuredResult, StructuredResult = _49 === void 0 ? cell_structured_1.StructuredResultRenderer : _49, getMentions = props.getMentions, getStructuredPropertiesProp = props.getStructuredProperties, getFunctionParameterSuggestions = props.getFunctionParameterSuggestions, shouldFetchFunctionParameters = props.shouldFetchFunctionParameters, MentionTagComponent = props.MentionTagComponent, MentionDropdownItemComponent = props.MentionDropdownItemComponent, _50 = props.showSelectionResizeHandles, showSelectionResizeHandles = _50 === void 0 ? true : _50, enableMagicFill = props.enableMagicFill, _51 = props.enableQuickEdit, enableQuickEdit = _51 === void 0 ? true : _51, MagicFillComponent = props.MagicFillComponent, MagicFillContent = props.MagicFillContent, QuickEdit = props.QuickEdit, PasteMenu = props.PasteMenu, SuggestionAction = props.SuggestionAction, HiddenRowMarkers = props.HiddenRowMarkers, HiddenColumnMarkers = props.HiddenColumnMarkers, enableResizerOverflow = props.enableResizerOverflow, className = props.className, _52 = props.defaultFontSizePoint, defaultFontSizePoint = _52 === void 0 ? config_1.DEFAULT_FONT_SIZE_PT : _52, defaultCellFormat = props.defaultCellFormat, readonly = props.readonly, _53 = props.isComparing, isComparing = _53 === void 0 ? false : _53, getCellDiff = props.getCellDiff, enableDataBoundaryNavigation = props.enableDataBoundaryNavigation, footerHeight = props.footerHeight, footerComponent = props.footerComponent, arrowComponents = props.arrowComponents,
|
|
@@ -134,7 +145,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
134
145
|
// defaults to `getFormattedValue` inside `useGetValuesFromRange`.
|
|
135
146
|
getValidationSourceValue = props.getValidationSourceValue,
|
|
136
147
|
// Unused props only for api
|
|
137
|
-
onChangeBorder = props.onChangeBorder, onDuplicateSheet = props.onDuplicateSheet, onCreateConditionalFormattingRule = props.onCreateConditionalFormattingRule, onDeleteConditionalFormattingRule = props.onDeleteConditionalFormattingRule, onUpdateConditionalFormattingRule = props.onUpdateConditionalFormattingRule, onCreateDataValidationRule = props.onCreateDataValidationRule, onUpdateDataValidationRule = props.onUpdateDataValidationRule, onDeleteDataValidationRule = props.onDeleteDataValidationRule, onCreateChart = props.onCreateChart, onDeleteSheet = props.onDeleteSheet, onCreateEmbed = props.onCreateEmbed, onDecreaseIndent = props.onDecreaseIndent, onIncreaseIndent = props.onIncreaseIndent, onChangeTheme = props.onChangeTheme, onChangeDecimals = props.onChangeDecimals, onUpdateSheet = props.onUpdateSheet, onChangeBatchStream = props.onChangeBatchStream, onBlur = props.onBlur, rest = tslib_1.__rest(props, ["licenseKey", "sheetId", "sheetType", "ChartSheetView", "instanceId", "activeCell", "selections", "frozenColumnCount", "frozenRowCount", "rowCount", "columnCount", "autoFocus", "basicFilter", "tables", "namedRanges", "bandedRanges", "tableBorderColor", "filterIconColor", "conditionalFormats", "showFilterIcon", "showCalculatedColumnIcon", "showHeaders", "defaultColumnWidth", "defaultRowHeight", "columnHeaderHeight", "rowHeaderWidth", "gridLineColor", "cellBackgroundColor", "cellColor", "headerBorderColor", "headerBackgroundColor", "headerColor", "headerActiveBackgroundColor", "headerSelectedBackgroundColor", "headerSelectedColor", "headerTableBackgroundColor", "headerTableActiveBackgroundColor", "headerTableSelectedBackgroundColor", "frozenShadowColor", "frozenShadowThickness", "selectionBackgroundColor", "selectionBorderColor", "selectionDragBorderColor", "chartSelectedColor", "chipBackgroundColor", "merges", "borderStyles", "protectedRanges", "isWorkbookProtected", "getSheetProtection", "pivotTables", "charts", "onUpdateChart", "onChangeZOrder", "embeds", "slicers", "rowMetadata", "columnMetadata", "scale", "zoomSpeed", "overscanCount", "enableEditOnEnterKey", "enableTextOverflow", "showGridLines", "showFormulas", "protectFormulas", "showFrozenSeparator", "HeaderCell", "Cell", "SelectionTitleComponent", "CellEditor", "CellTooltip", "ContextMenu", "ContextMenuWrapper", "FilterBox", "HeaderMoveDragComponent", "SuggestionsDropdown", "stickyEditor", "scrollSnap", "scrollThrottleTimeout", "preventBrowserDefaultScroll", "mouseMoveThrottleTimeout", "tooltipIntentInterval", "selectionPolicy", "users", "userId", "renderCollaboratorCursor", "functionDescriptions", "showHeaderMenuButton", "scrollbarSize", "theme", "showNotes", "showComments", "locale", "formulaLocale", "agentSuggestions", "onReviewSuggestion", "onShowFormulas", "getDataRowCount", "getDataRegion", "getChartComponent", "getEmbedComponent", "getSlicerComponent", "onChange", "onChangeBatch", "onExpandCollapse", "onPivotDrillDown", "onDelete", "onChangeEditorValue", "onFill", "onRequestCalculate", "onChangeActiveCell", "onChangeActiveSheet", "onChangeSelections", "getSheetName", "getSheetId", "getCellData", "getNote", "getTextFormatRuns", "getDataValidation", "getEffectiveFormat", "getFormattedValue", "getTooltipContent", "errorResolutionComponent", "getEffectiveValue", "getSparklineGroup", "getUserEnteredExtendedValue", "getEffectiveExtendedValue", "getSheetRowCount", "getSheetColumnCount", "getCellPopoverContent", "onScroll", "onViewPortChange", "windowConditionalFormats", "engineConditionalFormatResults", "onResize", "onAutoResize", "onHideColumn", "onHideRow", "onShowColumn", "onShowRow", "onGroupRows", "onUngroupRows", "onCollapseRowGroup", "onExpandRowGroup", "onGroupColumns", "onUngroupColumns", "onCollapseColumnGroup", "onExpandColumnGroup", "onSetOutlineDepth", "onDeleteRow", "onDeleteColumn", "onInsertRow", "onInsertColumn", "onChangeAutoExpandTables", "onChangeAutoCalculatedColumns", "onInsertCellsShiftDown", "onInsertCellsShiftRight", "onDeleteCellsShiftLeft", "onDeleteCellsShiftUp", "onClearContents", "onMoveColumns", "onMoveRows", "onSelectNextSheet", "onSelectPreviousSheet", "onCreateNewSheet", "onKeyDown", "onChangeFormatting", "onRepeatFormatting", "onClearFormatting", "onRequestEditProtectedRange", "onMoveChart", "onResizeChart", "onDeleteChart", "onCutChart", "onCopyChart", "onMoveEmbed", "onResizeEmbed", "onDeleteEmbed", "onRequestEditEmbed", "onMoveSlicer", "onResizeSlicer", "onDeleteSlicer", "onRequestEditSlicer", "onFillRange", "disableFillRightShortcut", "keymap", "onCalculateNow", "onRequestGoTo", "onMoveSelection", "onInsertCutCells", "onInsertTime", "onInsertDate", "onInsertDateTime", "onInsertAutoSum", "onUndo", "onRedo", "onPaste", "onCopy", "onCut", "onSortColumn", "onSortTable", "onFilterTable", "onFilterPivot", "onResizeTable", "onUndoTableAutoExpansion", "onUndoCalculatedColumn", "onOverwriteCalculatedColumn", "onRequestEditTable", "onRequestEditPivotTable", "onRequestDeletePivotTable", "onRequestCreatePivotChart", "onRemoveTable", "onCreateTable", "onRequestCreateTable", "onInsertTableColumn", "onDeleteTableColumn", "onInsertTableRow", "onDeleteTableRow", "onUpdateTable", "onRequestResizeTable", "onRequestInsertSlicer", "onCreateBasicFilter", "onRequestDefineNamedRange", "onRequestFormatCells", "onRequestConditionalFormat", "onRequestDataValidation", "onRequestInsertComment", "onRequestInsertLink", "onFreezeColumn", "onFreezeRow", "onUpdateNote", "onProtectRange", "onUnProtectRange", "onSortRange", "onRequestSearch", "onRequestReplace", "onRequestResize", "getRowHeaderText", "getColumnHeaderText", "getAdditionalCellSpacing", "tokenizer", "onChangeScale", "onRemoveLink", "onSelectLink", "onSplitTextToColumns", "onRemoveDuplicates", "onGoalSeek", "onSubtotal", "onAdvancedFilter", "onRequestExpand", "cellExpandPredicate", "StructuredResult", "getMentions", "getStructuredProperties", "getFunctionParameterSuggestions", "shouldFetchFunctionParameters", "MentionTagComponent", "MentionDropdownItemComponent", "showSelectionResizeHandles", "enableMagicFill", "enableQuickEdit", "MagicFillComponent", "MagicFillContent", "QuickEdit", "PasteMenu", "SuggestionAction", "HiddenRowMarkers", "HiddenColumnMarkers", "enableResizerOverflow", "className", "defaultFontSizePoint", "defaultCellFormat", "readonly", "isComparing", "getCellDiff", "enableDataBoundaryNavigation", "footerHeight", "footerComponent", "arrowComponents", "hostHiddenRowRanges", "getFilterValues", "getFilterColors", "getValidationSourceValue", "onChangeBorder", "onDuplicateSheet", "onCreateConditionalFormattingRule", "onDeleteConditionalFormattingRule", "onUpdateConditionalFormattingRule", "onCreateDataValidationRule", "onUpdateDataValidationRule", "onDeleteDataValidationRule", "onCreateChart", "onDeleteSheet", "onCreateEmbed", "onDecreaseIndent", "onIncreaseIndent", "onChangeTheme", "onChangeDecimals", "onUpdateSheet", "onChangeBatchStream", "onBlur"]);
|
|
148
|
+
getDataColumnCount = props.getDataColumnCount, onDeleteNamedRange = props.onDeleteNamedRange, onChangeBorder = props.onChangeBorder, onDuplicateSheet = props.onDuplicateSheet, onCreateConditionalFormattingRule = props.onCreateConditionalFormattingRule, onDeleteConditionalFormattingRule = props.onDeleteConditionalFormattingRule, onUpdateConditionalFormattingRule = props.onUpdateConditionalFormattingRule, onCreateDataValidationRule = props.onCreateDataValidationRule, onUpdateDataValidationRule = props.onUpdateDataValidationRule, onDeleteDataValidationRule = props.onDeleteDataValidationRule, onCreateChart = props.onCreateChart, onDeleteSheet = props.onDeleteSheet, onCreateEmbed = props.onCreateEmbed, onDecreaseIndent = props.onDecreaseIndent, onIncreaseIndent = props.onIncreaseIndent, onChangeTheme = props.onChangeTheme, onChangeDecimals = props.onChangeDecimals, onUpdateSheet = props.onUpdateSheet, onChangeBatchStream = props.onChangeBatchStream, onBlur = props.onBlur, rest = tslib_1.__rest(props, ["licenseKey", "sheetId", "sheetType", "ChartSheetView", "instanceId", "activeCell", "selections", "frozenColumnCount", "frozenRowCount", "rowCount", "columnCount", "autoFocus", "basicFilter", "tables", "namedRanges", "bandedRanges", "tableBorderColor", "filterIconColor", "conditionalFormats", "showFilterIcon", "showCalculatedColumnIcon", "showHeaders", "defaultColumnWidth", "defaultRowHeight", "columnHeaderHeight", "rowHeaderWidth", "gridLineColor", "cellBackgroundColor", "cellColor", "headerBorderColor", "headerBackgroundColor", "headerColor", "headerActiveBackgroundColor", "headerSelectedBackgroundColor", "headerSelectedColor", "headerTableBackgroundColor", "headerTableActiveBackgroundColor", "headerTableSelectedBackgroundColor", "frozenShadowColor", "frozenShadowThickness", "selectionBackgroundColor", "selectionBorderColor", "selectionDragBorderColor", "chartSelectedColor", "chipBackgroundColor", "merges", "borderStyles", "protectedRanges", "isWorkbookProtected", "getSheetProtection", "pivotTables", "charts", "onUpdateChart", "onChangeZOrder", "embeds", "slicers", "rowMetadata", "columnMetadata", "scale", "zoomSpeed", "overscanCount", "enableEditOnEnterKey", "enableTextOverflow", "showGridLines", "showFormulas", "protectFormulas", "showFrozenSeparator", "HeaderCell", "Cell", "SelectionTitleComponent", "CellEditor", "CellTooltip", "ContextMenu", "ContextMenuWrapper", "FilterBox", "HeaderMoveDragComponent", "SuggestionsDropdown", "stickyEditor", "scrollSnap", "scrollThrottleTimeout", "preventBrowserDefaultScroll", "mouseMoveThrottleTimeout", "tooltipIntentInterval", "selectionPolicy", "users", "userId", "renderCollaboratorCursor", "functionDescriptions", "showHeaderMenuButton", "scrollbarSize", "theme", "showNotes", "showComments", "locale", "formulaLocale", "agentSuggestions", "onReviewSuggestion", "onShowFormulas", "getDataRowCount", "getDataRegion", "getChartComponent", "getEmbedComponent", "getSlicerComponent", "onChange", "onChangeBatch", "onExpandCollapse", "onPivotDrillDown", "onDelete", "onChangeEditorValue", "onFill", "onRequestCalculate", "onChangeActiveCell", "onChangeActiveSheet", "onChangeSelections", "getSheetName", "getSheetId", "getCellData", "getNote", "getTextFormatRuns", "getDataValidation", "getEffectiveFormat", "getFormattedValue", "getTooltipContent", "errorResolutionComponent", "getEffectiveValue", "getSparklineGroup", "getUserEnteredExtendedValue", "getEffectiveExtendedValue", "getSheetRowCount", "getSheetColumnCount", "getCellPopoverContent", "onScroll", "onViewPortChange", "windowConditionalFormats", "engineConditionalFormatResults", "onResize", "onAutoResize", "onHideColumn", "onHideRow", "onShowColumn", "onShowRow", "onGroupRows", "onUngroupRows", "onCollapseRowGroup", "onExpandRowGroup", "onGroupColumns", "onUngroupColumns", "onCollapseColumnGroup", "onExpandColumnGroup", "onSetOutlineDepth", "onDeleteRow", "onDeleteColumn", "onInsertRow", "onInsertColumn", "onChangeAutoExpandTables", "onChangeAutoCalculatedColumns", "onInsertCellsShiftDown", "onInsertCellsShiftRight", "onDeleteCellsShiftLeft", "onDeleteCellsShiftUp", "onClearContents", "onMoveColumns", "onMoveRows", "onSelectNextSheet", "onSelectPreviousSheet", "onCreateNewSheet", "onKeyDown", "onChangeFormatting", "onRepeatFormatting", "onClearFormatting", "onRequestEditProtectedRange", "onMoveChart", "onResizeChart", "onDeleteChart", "onCutChart", "onCopyChart", "onMoveEmbed", "onResizeEmbed", "onDeleteEmbed", "onRequestEditEmbed", "onMoveSlicer", "onResizeSlicer", "onDeleteSlicer", "onRequestEditSlicer", "onFillRange", "disableFillRightShortcut", "keymap", "onCalculateNow", "onRequestGoTo", "onMoveSelection", "onInsertCutCells", "onInsertTime", "onInsertDate", "onInsertDateTime", "onInsertAutoSum", "onUndo", "onRedo", "onPaste", "onCopy", "onCut", "onSortColumn", "onSortTable", "onFilterTable", "onFilterPivot", "onResizeTable", "onUndoTableAutoExpansion", "onUndoCalculatedColumn", "onOverwriteCalculatedColumn", "onRequestEditTable", "onRequestEditPivotTable", "onRequestDeletePivotTable", "onRequestCreatePivotChart", "onRemoveTable", "onCreateTable", "onRequestCreateTable", "onInsertTableColumn", "onDeleteTableColumn", "onInsertTableRow", "onDeleteTableRow", "onUpdateTable", "onRequestResizeTable", "onRequestInsertSlicer", "onCreateBasicFilter", "onRequestDefineNamedRange", "onRequestFormatCells", "onRequestConditionalFormat", "onRequestDataValidation", "onRequestInsertComment", "onRequestInsertLink", "onFreezeColumn", "onFreezeRow", "onUpdateNote", "onProtectRange", "onUnProtectRange", "onSortRange", "onRequestSearch", "onRequestReplace", "onRequestResize", "getRowHeaderText", "getColumnHeaderText", "getAdditionalCellSpacing", "tokenizer", "onChangeScale", "onRemoveLink", "onSelectLink", "onSplitTextToColumns", "onRemoveDuplicates", "onGoalSeek", "onSubtotal", "onAdvancedFilter", "onRequestExpand", "cellExpandPredicate", "StructuredResult", "getMentions", "getStructuredProperties", "getFunctionParameterSuggestions", "shouldFetchFunctionParameters", "MentionTagComponent", "MentionDropdownItemComponent", "showSelectionResizeHandles", "enableMagicFill", "enableQuickEdit", "MagicFillComponent", "MagicFillContent", "QuickEdit", "PasteMenu", "SuggestionAction", "HiddenRowMarkers", "HiddenColumnMarkers", "enableResizerOverflow", "className", "defaultFontSizePoint", "defaultCellFormat", "readonly", "isComparing", "getCellDiff", "enableDataBoundaryNavigation", "footerHeight", "footerComponent", "arrowComponents", "hostHiddenRowRanges", "getFilterValues", "getFilterColors", "getValidationSourceValue", "getDataColumnCount", "onDeleteNamedRange", "onChangeBorder", "onDuplicateSheet", "onCreateConditionalFormattingRule", "onDeleteConditionalFormattingRule", "onUpdateConditionalFormattingRule", "onCreateDataValidationRule", "onUpdateDataValidationRule", "onDeleteDataValidationRule", "onCreateChart", "onDeleteSheet", "onCreateEmbed", "onDecreaseIndent", "onIncreaseIndent", "onChangeTheme", "onChangeDecimals", "onUpdateSheet", "onChangeBatchStream", "onBlur"]);
|
|
138
149
|
/**
|
|
139
150
|
* Fire onBlur only when the cell editor blurs to an element outside the
|
|
140
151
|
* spreadsheet. Routed through `useEditable` so we hook the always-focused
|
|
@@ -817,7 +828,13 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
817
828
|
!gridContainer.contains(activeElement)) {
|
|
818
829
|
return;
|
|
819
830
|
}
|
|
820
|
-
|
|
831
|
+
// An editor whose DOM is gone cannot be the one holding focus: a host that unmounted an
|
|
832
|
+
// input without a blur (Chromium fires none for a removed focused element) can leave a
|
|
833
|
+
// stale `activeEditor` behind, and honouring it would lock the grid out of keyboard input
|
|
834
|
+
// (rowsncolumns/spreadsheet#1131).
|
|
835
|
+
if (!activeEditor ||
|
|
836
|
+
activeEditor === cellEditorInstance ||
|
|
837
|
+
isDetachedEditor(activeEditor)) {
|
|
821
838
|
cellEditorInstance === null || cellEditorInstance === void 0 ? void 0 : cellEditorInstance.focus();
|
|
822
839
|
}
|
|
823
840
|
}, [activeEditor, cellEditorInstance]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/formula-input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAGrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAiB,MAAM,OAAO,CAAC;AActC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,KAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/formula-input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAGrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAiB,MAAM,OAAO,CAAC;AActC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,KAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,sGAuLxB,CAAC"}
|
|
@@ -33,6 +33,9 @@ exports.FormulaInput = (0, react_1.forwardRef)(function (_a, forwardedRef) {
|
|
|
33
33
|
// to be the one to turn it off; otherwise the picked range keeps rendering and the
|
|
34
34
|
// grid stays in formula-selection mode with no editor left to receive the picks.
|
|
35
35
|
var ownsFormulaModeRef = (0, react_2.useRef)(false);
|
|
36
|
+
// Whether this input holds focus (set on focus, cleared on blur): an input that unmounts
|
|
37
|
+
// while focused got no blur, and is the editor `activeEditor` still points at.
|
|
38
|
+
var focusedRef = (0, react_2.useRef)(false);
|
|
36
39
|
var enterFormulaMode = (0, react_1.useCallback)(function (nextValue) {
|
|
37
40
|
var formulaMode = (0, utils_1.isAFormula)(nextValue);
|
|
38
41
|
setFormulaMode(formulaMode);
|
|
@@ -46,13 +49,35 @@ exports.FormulaInput = (0, react_1.forwardRef)(function (_a, forwardedRef) {
|
|
|
46
49
|
}, [onCancel, setFormulaMode, setFormulaSelections]);
|
|
47
50
|
// Layout (not passive) cleanup: when a host re-keys its range inputs ("Add range"),
|
|
48
51
|
// the departing input must release the mode before the new one's autoFocus claims it.
|
|
52
|
+
// The same cleanup releases `activeEditor` when it still points at this input: Chromium
|
|
53
|
+
// fires no blur for a focused element that is removed (a dialog closed with Escape while
|
|
54
|
+
// the input had focus), so `handleBlur` never ran, and CanvasGrid skips focusing its own
|
|
55
|
+
// cell editor for as long as another editor is registered — the grid stops taking
|
|
56
|
+
// keyboard input until something else clears it (rowsncolumns/spreadsheet#1131).
|
|
49
57
|
(0, use_isomorphic_layout_effect_1.useIsomorphicLayoutEffect)(function () { return function () {
|
|
58
|
+
var _a, _b;
|
|
50
59
|
if (ownsFormulaModeRef.current) {
|
|
51
60
|
ownsFormulaModeRef.current = false;
|
|
52
61
|
setFormulaMode(false);
|
|
53
62
|
setFormulaSelections([]);
|
|
54
63
|
}
|
|
55
|
-
|
|
64
|
+
// The registration is CellInput's live handle, which can be a newer object than the one
|
|
65
|
+
// forwarded here at mount, so match on the element too; and an input removed while it
|
|
66
|
+
// still had focus (`focusedRef`) is the registered one even if neither identity matches.
|
|
67
|
+
var editor = editorRef.current;
|
|
68
|
+
var element = (_b = (_a = editor === null || editor === void 0 ? void 0 : editor.el) === null || _a === void 0 ? void 0 : _a.call(editor)) !== null && _b !== void 0 ? _b : null;
|
|
69
|
+
var wasFocused = focusedRef.current;
|
|
70
|
+
focusedRef.current = false;
|
|
71
|
+
setActiveEditor(function (current) {
|
|
72
|
+
var _a;
|
|
73
|
+
if (current === undefined)
|
|
74
|
+
return current;
|
|
75
|
+
var ours = current === editor ||
|
|
76
|
+
(element !== null && ((_a = current.el) === null || _a === void 0 ? void 0 : _a.call(current)) === element) ||
|
|
77
|
+
wasFocused;
|
|
78
|
+
return ours ? undefined : current;
|
|
79
|
+
});
|
|
80
|
+
}; }, [setActiveEditor, setFormulaMode, setFormulaSelections]);
|
|
56
81
|
var handleFocus = (0, react_1.useCallback)(function (e) {
|
|
57
82
|
var _a;
|
|
58
83
|
// Set formula mode
|
|
@@ -64,6 +89,7 @@ exports.FormulaInput = (0, react_1.forwardRef)(function (_a, forwardedRef) {
|
|
|
64
89
|
}
|
|
65
90
|
// Move to end of input
|
|
66
91
|
(_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.moveCursorToEnd();
|
|
92
|
+
focusedRef.current = true;
|
|
67
93
|
// Trigger change
|
|
68
94
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
69
95
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
@@ -82,6 +108,7 @@ exports.FormulaInput = (0, react_1.forwardRef)(function (_a, forwardedRef) {
|
|
|
82
108
|
return;
|
|
83
109
|
}
|
|
84
110
|
closeFormulaMode();
|
|
111
|
+
focusedRef.current = false;
|
|
85
112
|
// Resetting active editor will
|
|
86
113
|
// cause the dropdown to close if open
|
|
87
114
|
setActiveEditor(undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/range-selector/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACd,MAAM,oBAAoB,CAAC;AAiC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/range-selector/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACd,MAAM,oBAAoB,CAAC;AAiC5B,OAAO,KAON,MAAM,OAAO,CAAC;AAef,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAc,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAEhC,KAAK,uBAAuB,CAAC,CAAC,SAAS,KAAK,IAAI;IAC9C,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAAE,CAAC;IAClD,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IACb,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAC5B,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAC1D,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAC1D,mBAAmB,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC7D,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC9D,yBAAyB,CAAC,EAAE,eAAe,CAAC,2BAA2B,CAAC,CAAC;IACzE,yBAAyB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAkRF,iBAAS,sBAAsB,CAAC,CAAC,SAAS,KAAK,EAAE,EAC/C,WAA2B,EAC3B,MAAsB,EACtB,MAAsB,EACtB,MAAM,EACN,UAA0B,EAC1B,UAAU,EACV,QAAwB,EACxB,WAA8B,EAC9B,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,yBAAyB,GAC1B,EAAE,uBAAuB,CAAC,CAAC,CAAC,qBAiN5B;AAED,eAAO,MAAM,aAAa,EAErB,OAAO,sBAAsB,CAAC"}
|
|
@@ -94,21 +94,45 @@ function RangeSelectorContent(_a) {
|
|
|
94
94
|
title));
|
|
95
95
|
})));
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* The Name Box's dropdown, memoised so a cursor move does not re-render it: the
|
|
99
|
+
* Radix `DropdownMenu` root schedules a nested state update on every render even
|
|
100
|
+
* while closed, which — on top of the input-sync re-render — is what pushed a held
|
|
101
|
+
* arrow key past React's nested-update limit (rowsncolumns/spreadsheet#1127).
|
|
102
|
+
*/
|
|
103
|
+
function NameBoxMenuComponent(_a) {
|
|
104
|
+
var isOpen = _a.isOpen, onOpenChange = _a.onOpenChange, namedRanges = _a.namedRanges, tables = _a.tables, sheets = _a.sheets, sheetId = _a.sheetId, activeCell = _a.activeCell, selections = _a.selections, shouldFocusSheetRef = _a.shouldFocusSheetRef, focusSheet = _a.focusSheet, onSelectNamedRange = _a.onSelectNamedRange, onSelectTable = _a.onSelectTable, onRequestUpdateNamedRange = _a.onRequestUpdateNamedRange, onDeleteNamedRange = _a.onDeleteNamedRange, onRequestDefineNamedRange = _a.onRequestDefineNamedRange, onChangeActiveSheet = _a.onChangeActiveSheet;
|
|
105
|
+
return (react_1.default.createElement(ui_1.DropdownMenu, { modal: false, open: isOpen, onOpenChange: onOpenChange },
|
|
106
|
+
react_1.default.createElement(ui_1.DropdownMenuTrigger, { asChild: true },
|
|
107
|
+
react_1.default.createElement(ui_1.IconButton, { className: "rounded-none mr-0", shrink: true },
|
|
108
|
+
react_1.default.createElement(icons_1.TriangleDownIcon, null))),
|
|
109
|
+
react_1.default.createElement(ui_1.DropdownMenuPortal, null,
|
|
110
|
+
react_1.default.createElement(ui_1.DropdownMenuContent, { align: "start", alignOffset: -SELECTOR_WIDTH + ICON_WIDTH, sideOffset: 1, className: "max-h-[300px] overflow-auto", onCloseAutoFocus: function (event) {
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
if (shouldFocusSheetRef.current && !isOpen) {
|
|
113
|
+
focusSheet === null || focusSheet === void 0 ? void 0 : focusSheet();
|
|
114
|
+
}
|
|
115
|
+
} },
|
|
116
|
+
react_1.default.createElement(RangeSelectorContent, { namedRanges: namedRanges, tables: tables, sheets: sheets, sheetId: sheetId, activeCell: activeCell, selections: selections, isOpen: isOpen, shouldFocusSheetRef: shouldFocusSheetRef, onSelectNamedRange: onSelectNamedRange, onSelectTable: onSelectTable, onRequestUpdateNamedRange: onRequestUpdateNamedRange, onDeleteNamedRange: onDeleteNamedRange, onRequestDefineNamedRange: onRequestDefineNamedRange, onChangeActiveSheet: onChangeActiveSheet })))));
|
|
117
|
+
}
|
|
118
|
+
var NameBoxMenu = (0, react_1.memo)(NameBoxMenuComponent);
|
|
97
119
|
function RangeSelectorComponent(_a) {
|
|
98
120
|
var _b = _a.namedRanges, namedRanges = _b === void 0 ? config_1.DEFAULT_ARRAY : _b, _c = _a.tables, tables = _c === void 0 ? config_1.DEFAULT_ARRAY : _c, _d = _a.sheets, sheets = _d === void 0 ? config_1.DEFAULT_ARRAY : _d, merges = _a.merges, _e = _a.selections, selections = _e === void 0 ? config_1.DEFAULT_ARRAY : _e, activeCell = _a.activeCell, _f = _a.rowCount, rowCount = _f === void 0 ? config_1.MAX_ROW_COUNT : _f, _g = _a.columnCount, columnCount = _g === void 0 ? config_1.MAX_COLUMN_COUNT : _g, sheetId = _a.sheetId, onChangeActiveSheet = _a.onChangeActiveSheet, onChangeActiveCell = _a.onChangeActiveCell, onChangeSelections = _a.onChangeSelections, onRequestUpdateNamedRange = _a.onRequestUpdateNamedRange, onDeleteNamedRange = _a.onDeleteNamedRange, onRequestDefineNamedRange = _a.onRequestDefineNamedRange;
|
|
99
121
|
var _h = tslib_1.__read((0, react_1.useState)(false), 2), isOpen = _h[0], setIsOpen = _h[1];
|
|
100
|
-
|
|
122
|
+
// Only what the user is typing into the Name Box; `null` while it just mirrors the
|
|
123
|
+
// selection. The mirrored address is DERIVED during render below — syncing it into
|
|
124
|
+
// state from an effect scheduled one extra synchronous re-render per cursor move,
|
|
125
|
+
// which React's nested-update counter turned into "Maximum update depth exceeded"
|
|
126
|
+
// (#185) under a held arrow key in production builds (rowsncolumns/spreadsheet#1127).
|
|
127
|
+
var _j = tslib_1.__read((0, react_1.useState)(null), 2), draft = _j[0], setDraft = _j[1];
|
|
101
128
|
var inputRef = (0, react_1.useRef)(null);
|
|
102
129
|
var navigateToSheetRange = (0, range_selector_atom_1.useRangeContext)().navigateToSheetRange;
|
|
103
130
|
var isFormulaMode = (0, atoms_1.useFormulaModeValue)();
|
|
104
131
|
var shouldFocusSheetRef = (0, react_1.useRef)(false);
|
|
105
132
|
var focusSheet = (0, atoms_1.useFocusSheet)();
|
|
106
133
|
var getAddressFromSelection = (0, atoms_1.useGetAddressFromSelection)();
|
|
107
|
-
//
|
|
108
|
-
(0, react_1.
|
|
109
|
-
if (isFormulaMode) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
134
|
+
// The address (or named-range name) of the current selection / active cell.
|
|
135
|
+
var derivedAddress = (0, react_1.useMemo)(function () {
|
|
112
136
|
var lastSelection = selections[selections.length - 1];
|
|
113
137
|
var isSelectionInProgress = lastSelection === null || lastSelection === void 0 ? void 0 : lastSelection.inProgress;
|
|
114
138
|
var inputValue = lastSelection
|
|
@@ -122,19 +146,31 @@ function RangeSelectorComponent(_a) {
|
|
|
122
146
|
return (range &&
|
|
123
147
|
(0, grid_1.isAreasEqual)(range, lastSelection ? lastSelection.range : (0, utils_1.convertCellToRange)(activeCell)));
|
|
124
148
|
});
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
149
|
+
return inputValue ? (range ? range.name : inputValue) : undefined;
|
|
150
|
+
// `rowCount` / `columnCount` / `merges` shape the address text through
|
|
151
|
+
// `getAddressFromSelection` without being read here directly.
|
|
152
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
128
153
|
}, [
|
|
129
154
|
rowCount,
|
|
130
155
|
columnCount,
|
|
131
156
|
activeCell,
|
|
132
157
|
selections,
|
|
133
158
|
namedRanges,
|
|
134
|
-
isFormulaMode,
|
|
135
159
|
merges,
|
|
136
160
|
getAddressFromSelection,
|
|
137
161
|
]);
|
|
162
|
+
// Formula mode freezes the box at the address it showed when the formula started
|
|
163
|
+
// (a range picked for the formula must not rename the box); remember the last
|
|
164
|
+
// address shown outside formula mode without scheduling a render.
|
|
165
|
+
var frozenAddressRef = (0, react_1.useRef)("");
|
|
166
|
+
(0, react_1.useEffect)(function () {
|
|
167
|
+
if (!isFormulaMode && derivedAddress !== undefined) {
|
|
168
|
+
frozenAddressRef.current = derivedAddress;
|
|
169
|
+
}
|
|
170
|
+
}, [isFormulaMode, derivedAddress]);
|
|
171
|
+
var value = draft !== null && draft !== void 0 ? draft : (isFormulaMode
|
|
172
|
+
? frozenAddressRef.current
|
|
173
|
+
: derivedAddress !== null && derivedAddress !== void 0 ? derivedAddress : frozenAddressRef.current);
|
|
138
174
|
// Select a range of cells in a sheet
|
|
139
175
|
var onSelectRange = (0, react_1.useCallback)(function (range) {
|
|
140
176
|
navigateToSheetRange === null || navigateToSheetRange === void 0 ? void 0 : navigateToSheetRange(range, { enableFlash: false });
|
|
@@ -156,6 +192,7 @@ function RangeSelectorComponent(_a) {
|
|
|
156
192
|
var _a, _b, _c, _d;
|
|
157
193
|
if (e.key === "Enter") {
|
|
158
194
|
var value_1 = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value;
|
|
195
|
+
setDraft(null);
|
|
159
196
|
if (value_1) {
|
|
160
197
|
// Check for named range
|
|
161
198
|
var namedRange = namedRanges.find(function (range) { return range.name === value_1; });
|
|
@@ -205,13 +242,7 @@ function RangeSelectorComponent(_a) {
|
|
|
205
242
|
else if (e.key === "Escape" && !isFormulaMode) {
|
|
206
243
|
// Revert the Name Box to the current selection/active cell on
|
|
207
244
|
// Escape, then return focus to the grid.
|
|
208
|
-
|
|
209
|
-
var reverted = lastSelection
|
|
210
|
-
? getAddressFromSelection === null || getAddressFromSelection === void 0 ? void 0 : getAddressFromSelection(lastSelection, undefined)
|
|
211
|
-
: (0, utils_1.cellToAddress)(activeCell);
|
|
212
|
-
if (reverted) {
|
|
213
|
-
setValue(reverted);
|
|
214
|
-
}
|
|
245
|
+
setDraft(null);
|
|
215
246
|
(_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.blur();
|
|
216
247
|
focusSheet === null || focusSheet === void 0 ? void 0 : focusSheet();
|
|
217
248
|
return;
|
|
@@ -226,25 +257,14 @@ function RangeSelectorComponent(_a) {
|
|
|
226
257
|
onChangeSelections,
|
|
227
258
|
isFormulaMode,
|
|
228
259
|
focusSheet,
|
|
229
|
-
selections,
|
|
230
|
-
activeCell,
|
|
231
|
-
getAddressFromSelection,
|
|
232
|
-
setValue,
|
|
233
260
|
navigateToSheetRange,
|
|
234
261
|
]);
|
|
235
262
|
return (react_1.default.createElement("div", { className: "flex h-full w-[90px]" },
|
|
236
|
-
react_1.default.createElement(ui_1.Input, { value: value, type: "text", ref: inputRef, onChange: function (e) { return
|
|
237
|
-
react_1.default.createElement(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
react_1.default.createElement(ui_1.DropdownMenuContent, { align: "start", alignOffset: -SELECTOR_WIDTH + ICON_WIDTH, sideOffset: 1, className: "max-h-[300px] overflow-auto", onCloseAutoFocus: function (event) {
|
|
243
|
-
event.preventDefault();
|
|
244
|
-
if (shouldFocusSheetRef.current && !isOpen) {
|
|
245
|
-
focusSheet === null || focusSheet === void 0 ? void 0 : focusSheet();
|
|
246
|
-
}
|
|
247
|
-
} },
|
|
248
|
-
react_1.default.createElement(RangeSelectorContent, { namedRanges: namedRanges, tables: tables, sheets: sheets, sheetId: sheetId, activeCell: activeCell, selections: selections, isOpen: isOpen, shouldFocusSheetRef: shouldFocusSheetRef, onSelectNamedRange: onSelectNamedRange, onSelectTable: onSelectTable, onRequestUpdateNamedRange: onRequestUpdateNamedRange, onDeleteNamedRange: onDeleteNamedRange, onRequestDefineNamedRange: onRequestDefineNamedRange, onChangeActiveSheet: onChangeActiveSheet }))))));
|
|
263
|
+
react_1.default.createElement(ui_1.Input, { value: value, type: "text", ref: inputRef, onChange: function (e) { return setDraft(e.target.value); }, onKeyDown: handleKeyDown, onFocus: function (e) { return e.target.select(); }, onBlur: function () { return setDraft(null); }, className: "text-xs border-none rounded-none outline-none m-0 bg-rnc-background text-rnc-foreground w-full" }),
|
|
264
|
+
react_1.default.createElement(NameBoxMenu, { isOpen: isOpen, onOpenChange: setIsOpen, namedRanges: namedRanges, tables: tables, sheets: sheets, sheetId: sheetId,
|
|
265
|
+
// Only an open menu reads the selection; while closed the props stay
|
|
266
|
+
// put so a cursor move never re-renders the Radix root (it schedules a
|
|
267
|
+
// nested update on every render, see the component note).
|
|
268
|
+
activeCell: isOpen ? activeCell : config_1.DEFAULT_ACTIVE_CELL, selections: isOpen ? selections : config_1.DEFAULT_ARRAY, shouldFocusSheetRef: shouldFocusSheetRef, focusSheet: focusSheet, onSelectNamedRange: onSelectNamedRange, onSelectTable: onSelectTable, onRequestUpdateNamedRange: onRequestUpdateNamedRange, onDeleteNamedRange: onDeleteNamedRange, onRequestDefineNamedRange: onRequestDefineNamedRange, onChangeActiveSheet: onChangeActiveSheet })));
|
|
249
269
|
}
|
|
250
270
|
exports.RangeSelector = (0, react_1.memo)(RangeSelectorComponent);
|
|
@@ -2,7 +2,28 @@ import { FontLoader } from "../api/font-loader";
|
|
|
2
2
|
export type UseFontResults = {
|
|
3
3
|
isFontActive: boolean;
|
|
4
4
|
};
|
|
5
|
+
/** A host-provided font loader: receives `Family:weight` specs, resolves when they are usable. */
|
|
6
|
+
export type WebFontLoader = (fonts: string[]) => Promise<void | undefined>;
|
|
7
|
+
export type WebFontOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the grid may fetch web fonts (a Google Fonts stylesheet appended to
|
|
10
|
+
* `document.head`). Hosts with a strict Content-Security-Policy or that must
|
|
11
|
+
* work offline turn this off; the formula editor then uses whatever
|
|
12
|
+
* `--rnc-formula-font-family` resolves to (rowsncolumns/spreadsheet#1125).
|
|
13
|
+
* Default `true`.
|
|
14
|
+
*/
|
|
15
|
+
loadWebFonts?: boolean;
|
|
16
|
+
/** Load fonts through the host instead of Google Fonts (`onRequestFonts`). */
|
|
17
|
+
onRequestFonts?: WebFontLoader;
|
|
18
|
+
};
|
|
19
|
+
/** Configure web-font loading for every grid on the page (what `useFonts` applies from its options). */
|
|
20
|
+
export declare const configureWebFonts: (options: WebFontOptions | undefined) => void;
|
|
21
|
+
export declare const isWebFontLoadingEnabled: () => boolean;
|
|
5
22
|
export declare const getWebFont: () => FontLoader | undefined;
|
|
6
|
-
|
|
7
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Load `Family:weight` specs — through the host's loader when one is configured,
|
|
25
|
+
* otherwise from Google Fonts; a no-op when web fonts are turned off.
|
|
26
|
+
*/
|
|
27
|
+
export declare const loadWebFont: (fonts: string[]) => Promise<void>;
|
|
28
|
+
export declare const useFonts: (fonts?: string, options?: WebFontOptions) => void;
|
|
8
29
|
//# sourceMappingURL=use-fonts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fonts.d.ts","sourceRoot":"","sources":["../../../hooks/use-fonts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,UAAU,8BAAmD,CAAC;AAE3E,eAAO,MAAM,WAAW,GAAU,OAAO,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"use-fonts.d.ts","sourceRoot":"","sources":["../../../hooks/use-fonts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,kGAAkG;AAClG,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;AAE3E,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,aAAa,CAAC;CAChC,CAAC;AAQF,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,GAAI,SAAS,cAAc,GAAG,SAAS,SAKpE,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAA8B,CAAC;AAEnE,eAAO,MAAM,UAAU,8BAAmD,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,OAAO,MAAM,EAAE,kBAIhD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,QAAQ,MAAM,EAAE,UAAU,cAAc,SAYhE,CAAC"}
|
|
@@ -1,24 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFonts = exports.loadWebFont = exports.getWebFont = void 0;
|
|
3
|
+
exports.useFonts = exports.loadWebFont = exports.getWebFont = exports.isWebFontLoadingEnabled = exports.configureWebFonts = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var grid_1 = require("@rowsncolumns/grid");
|
|
6
6
|
var react_1 = require("react");
|
|
7
7
|
var font_loader_1 = require("../api/font-loader");
|
|
8
|
+
// Page-level: every grid on the page shares one policy, and the paste / import /
|
|
9
|
+
// font-picker fallbacks consult it too, so "off" means no third-party request at all.
|
|
10
|
+
var webFontConfig = { enabled: true };
|
|
11
|
+
/** Configure web-font loading for every grid on the page (what `useFonts` applies from its options). */
|
|
12
|
+
var configureWebFonts = function (options) {
|
|
13
|
+
var _a;
|
|
14
|
+
webFontConfig = {
|
|
15
|
+
enabled: (_a = options === null || options === void 0 ? void 0 : options.loadWebFonts) !== null && _a !== void 0 ? _a : true,
|
|
16
|
+
loader: options === null || options === void 0 ? void 0 : options.onRequestFonts,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
exports.configureWebFonts = configureWebFonts;
|
|
20
|
+
var isWebFontLoadingEnabled = function () { return webFontConfig.enabled; };
|
|
21
|
+
exports.isWebFontLoadingEnabled = isWebFontLoadingEnabled;
|
|
8
22
|
var getWebFont = function () { return (grid_1.canUseDOM ? new font_loader_1.FontLoader() : undefined); };
|
|
9
23
|
exports.getWebFont = getWebFont;
|
|
24
|
+
/**
|
|
25
|
+
* Load `Family:weight` specs — through the host's loader when one is configured,
|
|
26
|
+
* otherwise from Google Fonts; a no-op when web fonts are turned off.
|
|
27
|
+
*/
|
|
10
28
|
var loadWebFont = function (fonts) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
11
29
|
var _a;
|
|
12
30
|
return tslib_1.__generator(this, function (_b) {
|
|
31
|
+
if (!webFontConfig.enabled)
|
|
32
|
+
return [2 /*return*/];
|
|
33
|
+
if (webFontConfig.loader)
|
|
34
|
+
return [2 /*return*/, webFontConfig.loader(fonts)];
|
|
13
35
|
return [2 /*return*/, (_a = (0, exports.getWebFont)()) === null || _a === void 0 ? void 0 : _a.loadFonts(fonts)];
|
|
14
36
|
});
|
|
15
37
|
}); };
|
|
16
38
|
exports.loadWebFont = loadWebFont;
|
|
17
|
-
var useFonts = function (fonts) {
|
|
39
|
+
var useFonts = function (fonts, options) {
|
|
40
|
+
var _a;
|
|
41
|
+
var loadWebFonts = (_a = options === null || options === void 0 ? void 0 : options.loadWebFonts) !== null && _a !== void 0 ? _a : true;
|
|
42
|
+
var onRequestFonts = options === null || options === void 0 ? void 0 : options.onRequestFonts;
|
|
43
|
+
(0, react_1.useEffect)(function () {
|
|
44
|
+
(0, exports.configureWebFonts)({ loadWebFonts: loadWebFonts, onRequestFonts: onRequestFonts });
|
|
45
|
+
}, [loadWebFonts, onRequestFonts]);
|
|
18
46
|
(0, react_1.useEffect)(function () {
|
|
47
|
+
if (!loadWebFonts)
|
|
48
|
+
return;
|
|
19
49
|
var defaultFonts = ["Inconsolata:400"];
|
|
20
50
|
var finalFonts = fonts === null || fonts === void 0 ? void 0 : fonts.split(",").map(function (value) { return String(value).trim(); });
|
|
21
51
|
(0, exports.loadWebFont)(defaultFonts.concat(finalFonts ? finalFonts : []));
|
|
22
|
-
}, [fonts]);
|
|
52
|
+
}, [fonts, loadWebFonts]);
|
|
23
53
|
};
|
|
24
54
|
exports.useFonts = useFonts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-selection.d.ts","sourceRoot":"","sources":["../../../hooks/use-selection.ts"],"names":[],"mappings":"AA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