@rowsncolumns/spreadsheet 10.19.6 → 10.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/helpers.d.ts +2 -1
- package/dist/cjs/components/canvas-grid/helpers.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/helpers.js +4 -1
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +6 -2
- package/dist/cjs/components/canvas-grid/typings.d.ts +84 -0
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/components/cell-structured/cell-image.d.ts +7 -0
- package/dist/cjs/components/cell-structured/cell-image.d.ts.map +1 -1
- package/dist/cjs/components/cell-structured/cell-image.js +10 -3
- package/dist/cjs/components/embeds/embed-component.d.ts.map +1 -1
- package/dist/cjs/components/embeds/embed-component.js +6 -1
- package/dist/cjs/components/embeds/linked-picture.d.ts.map +1 -1
- package/dist/cjs/components/embeds/linked-picture.js +2 -1
- package/dist/cjs/components/print-preview/page-block.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/page-block.js +5 -2
- package/dist/cjs/components/sheet-background/index.d.ts +4 -1
- package/dist/cjs/components/sheet-background/index.d.ts.map +1 -1
- package/dist/cjs/components/sheet-background/index.js +3 -1
- package/dist/cjs/components/toolbar/border-color-selector.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/border-color-selector.js +3 -1
- package/dist/cjs/components/toolbar/border-selector.d.ts +1 -1
- package/dist/cjs/components/toolbar/border-selector.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/border-selector.js +3 -4
- package/dist/cjs/hooks/object-clipboard-payload.d.ts +2 -1
- package/dist/cjs/hooks/object-clipboard-payload.d.ts.map +1 -1
- package/dist/cjs/hooks/object-clipboard-payload.js +5 -1
- package/dist/cjs/hooks/use-cell-renderer.d.ts +6 -1
- package/dist/cjs/hooks/use-cell-renderer.d.ts.map +1 -1
- package/dist/cjs/hooks/use-cell-renderer.js +13 -7
- package/dist/cjs/hooks/use-editor-submit.d.ts +30 -7
- package/dist/cjs/hooks/use-editor-submit.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editor-submit.js +234 -68
- package/dist/cjs/hooks/use-keyboard-handler.d.ts.map +1 -1
- package/dist/cjs/hooks/use-keyboard-handler.js +2 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/release-date.js +1 -1
- package/dist/cjs/themes.d.ts +8 -0
- package/dist/cjs/themes.d.ts.map +1 -1
- package/dist/cjs/themes.js +18 -1
- package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/helpers.d.ts +2 -1
- package/dist/esm/components/canvas-grid/helpers.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/helpers.js +4 -1
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +5 -1
- package/dist/esm/components/canvas-grid/typings.d.ts +84 -0
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/components/cell-structured/cell-image.d.ts +7 -0
- package/dist/esm/components/cell-structured/cell-image.d.ts.map +1 -1
- package/dist/esm/components/cell-structured/cell-image.js +9 -2
- package/dist/esm/components/embeds/embed-component.d.ts.map +1 -1
- package/dist/esm/components/embeds/embed-component.js +6 -1
- package/dist/esm/components/embeds/linked-picture.d.ts.map +1 -1
- package/dist/esm/components/embeds/linked-picture.js +2 -1
- package/dist/esm/components/print-preview/page-block.d.ts.map +1 -1
- package/dist/esm/components/print-preview/page-block.js +5 -2
- package/dist/esm/components/sheet-background/index.d.ts +4 -1
- package/dist/esm/components/sheet-background/index.d.ts.map +1 -1
- package/dist/esm/components/sheet-background/index.js +3 -1
- package/dist/esm/components/toolbar/border-color-selector.d.ts.map +1 -1
- package/dist/esm/components/toolbar/border-color-selector.js +4 -2
- package/dist/esm/components/toolbar/border-selector.d.ts +1 -1
- package/dist/esm/components/toolbar/border-selector.d.ts.map +1 -1
- package/dist/esm/components/toolbar/border-selector.js +3 -4
- package/dist/esm/hooks/object-clipboard-payload.d.ts +2 -1
- package/dist/esm/hooks/object-clipboard-payload.d.ts.map +1 -1
- package/dist/esm/hooks/object-clipboard-payload.js +5 -1
- package/dist/esm/hooks/use-cell-renderer.d.ts +6 -1
- package/dist/esm/hooks/use-cell-renderer.d.ts.map +1 -1
- package/dist/esm/hooks/use-cell-renderer.js +12 -8
- package/dist/esm/hooks/use-editor-submit.d.ts +30 -7
- package/dist/esm/hooks/use-editor-submit.d.ts.map +1 -1
- package/dist/esm/hooks/use-editor-submit.js +176 -53
- package/dist/esm/hooks/use-keyboard-handler.d.ts.map +1 -1
- package/dist/esm/hooks/use-keyboard-handler.js +2 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/release-date.js +1 -1
- package/dist/esm/themes.d.ts +8 -0
- package/dist/esm/themes.d.ts.map +1 -1
- package/dist/esm/themes.js +14 -0
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useEditorSubmit = exports.isEntryLimitRefusal = exports.ENTRY_LIMIT_REJECTION_CODES = exports.entryTurnsOnWrap = exports.planArrayFormulaRange = exports.planEntryFill = exports.entryValueForCell = exports.percentEntryValue = void 0;
|
|
3
|
+
exports.useEditorSubmit = exports.entryFillTornArrayWrite = exports.writeEntryFill = exports.isEntryLimitRefusal = exports.ENTRY_LIMIT_REJECTION_CODES = exports.entryTurnsOnWrap = exports.planArrayFormulaRange = exports.planEntryFill = exports.entryValueForCell = exports.percentEntryValue = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var utils_1 = require("@rowsncolumns/utils");
|
|
6
6
|
var react_1 = require("react");
|
|
@@ -176,15 +176,146 @@ var isEntryLimitRefusal = function (result) {
|
|
|
176
176
|
}));
|
|
177
177
|
};
|
|
178
178
|
exports.isEntryLimitRefusal = isEntryLimitRefusal;
|
|
179
|
+
/**
|
|
180
|
+
* Writes a planned entry in the grid's order: the active cell (with its rich-text runs), each
|
|
181
|
+
* rectangle of a Ctrl+Enter fill, then Wrap Text for an entry with a line break. Synchronous, so
|
|
182
|
+
* a caller that runs it inside one history batch has one undo entry for the gesture. The grid
|
|
183
|
+
* writes its own commits through it; a host given a fill by `onFillEntry` writes it through it
|
|
184
|
+
* too, with writers that do not gate again.
|
|
185
|
+
*
|
|
186
|
+
* `false` when the active cell's write was refused past Excel's entry limits
|
|
187
|
+
* ({@link isEntryLimitRefusal}): such an entry is written nowhere, not into the other selected
|
|
188
|
+
* cells and not as a format. It is typed again and committed, which fills them.
|
|
189
|
+
*/
|
|
190
|
+
var writeEntryFill = function (fill, _a) {
|
|
191
|
+
var e_3, _b;
|
|
192
|
+
var onChange = _a.onChange, onChangeBatch = _a.onChangeBatch, onChangeFormatting = _a.onChangeFormatting;
|
|
193
|
+
var result = onChange === null || onChange === void 0 ? void 0 : onChange(fill.sheetId, fill.activeCell, fill.value, fill.textFormatRuns, fill.previousValue, fill.isDirty);
|
|
194
|
+
if ((0, exports.isEntryLimitRefusal)(result)) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
for (var _c = tslib_1.__values(fill.writes), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
199
|
+
var write = _d.value;
|
|
200
|
+
onChangeBatch === null || onChangeBatch === void 0 ? void 0 : onChangeBatch(fill.sheetId, write.range, write.values);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
204
|
+
finally {
|
|
205
|
+
try {
|
|
206
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
207
|
+
}
|
|
208
|
+
finally { if (e_3) throw e_3.error; }
|
|
209
|
+
}
|
|
210
|
+
if (fill.wrapText) {
|
|
211
|
+
// Excel turns Wrap Text on for an entry with a line break, so every line shows and
|
|
212
|
+
// an auto-height row grows to them (the engines refit it on the format change).
|
|
213
|
+
onChangeFormatting === null || onChangeFormatting === void 0 ? void 0 : onChangeFormatting(fill.sheetId, fill.activeCell, fill.selections, "wrapStrategy", "wrap");
|
|
214
|
+
}
|
|
215
|
+
return true;
|
|
216
|
+
};
|
|
217
|
+
exports.writeEntryFill = writeEntryFill;
|
|
218
|
+
/** How many cells the array check of one fill reads at most; past that the engine alone judges. */
|
|
219
|
+
var TORN_ARRAY_CHECK_CELLS = 20000;
|
|
220
|
+
/**
|
|
221
|
+
* The first write of a fill that reaches part of a legacy (Ctrl+Shift+Enter) array without
|
|
222
|
+
* holding it whole, which the engine refuses ("You can't change part of an array"): the active
|
|
223
|
+
* cell's (`"activeCell"`) or one rectangle's. A fill is the active cell's write and one write for
|
|
224
|
+
* each rectangle, and only writes that share one history batch are refused together, so the grid
|
|
225
|
+
* asks before it writes anything. An array a rectangle cuts has a cell on the rectangle's edge:
|
|
226
|
+
* the edges are read, an array found there is stepped over whole, and a fill whose edges are
|
|
227
|
+
* longer than {@link TORN_ARRAY_CHECK_CELLS} is not judged here (`undefined`).
|
|
228
|
+
*/
|
|
229
|
+
var entryFillTornArrayWrite = function (fill, getArrayFormula) {
|
|
230
|
+
var e_4, _a;
|
|
231
|
+
var _b, _c, _d;
|
|
232
|
+
var sheetId = fill.sheetId, activeCell = fill.activeCell;
|
|
233
|
+
var own = (_b = getArrayFormula(sheetId, activeCell.rowIndex, activeCell.columnIndex)) === null || _b === void 0 ? void 0 : _b.range;
|
|
234
|
+
if (own &&
|
|
235
|
+
(own.startRowIndex !== own.endRowIndex ||
|
|
236
|
+
own.startColumnIndex !== own.endColumnIndex)) {
|
|
237
|
+
return "activeCell";
|
|
238
|
+
}
|
|
239
|
+
var left = TORN_ARRAY_CHECK_CELLS;
|
|
240
|
+
var _loop_1 = function (write) {
|
|
241
|
+
var e_5, _g, e_6, _h;
|
|
242
|
+
var range = write.range;
|
|
243
|
+
var holds = function (array) {
|
|
244
|
+
return array.startRowIndex >= range.startRowIndex &&
|
|
245
|
+
array.endRowIndex <= range.endRowIndex &&
|
|
246
|
+
array.startColumnIndex >= range.startColumnIndex &&
|
|
247
|
+
array.endColumnIndex <= range.endColumnIndex;
|
|
248
|
+
};
|
|
249
|
+
var rows = new Set([range.startRowIndex, range.endRowIndex]);
|
|
250
|
+
try {
|
|
251
|
+
for (var rows_1 = (e_5 = void 0, tslib_1.__values(rows)), rows_1_1 = rows_1.next(); !rows_1_1.done; rows_1_1 = rows_1.next()) {
|
|
252
|
+
var row = rows_1_1.value;
|
|
253
|
+
for (var col = range.startColumnIndex; col <= range.endColumnIndex; col++) {
|
|
254
|
+
if (left-- <= 0)
|
|
255
|
+
return { value: undefined };
|
|
256
|
+
var array = (_c = getArrayFormula(sheetId, row, col)) === null || _c === void 0 ? void 0 : _c.range;
|
|
257
|
+
if (array && !holds(array))
|
|
258
|
+
return { value: write };
|
|
259
|
+
col = array ? array.endColumnIndex : col;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
264
|
+
finally {
|
|
265
|
+
try {
|
|
266
|
+
if (rows_1_1 && !rows_1_1.done && (_g = rows_1.return)) _g.call(rows_1);
|
|
267
|
+
}
|
|
268
|
+
finally { if (e_5) throw e_5.error; }
|
|
269
|
+
}
|
|
270
|
+
var cols = new Set([range.startColumnIndex, range.endColumnIndex]);
|
|
271
|
+
try {
|
|
272
|
+
for (var cols_1 = (e_6 = void 0, tslib_1.__values(cols)), cols_1_1 = cols_1.next(); !cols_1_1.done; cols_1_1 = cols_1.next()) {
|
|
273
|
+
var col = cols_1_1.value;
|
|
274
|
+
for (var row = range.startRowIndex + 1; row < range.endRowIndex; row++) {
|
|
275
|
+
if (left-- <= 0)
|
|
276
|
+
return { value: undefined };
|
|
277
|
+
var array = (_d = getArrayFormula(sheetId, row, col)) === null || _d === void 0 ? void 0 : _d.range;
|
|
278
|
+
if (array && !holds(array))
|
|
279
|
+
return { value: write };
|
|
280
|
+
row = array ? array.endRowIndex : row;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
285
|
+
finally {
|
|
286
|
+
try {
|
|
287
|
+
if (cols_1_1 && !cols_1_1.done && (_h = cols_1.return)) _h.call(cols_1);
|
|
288
|
+
}
|
|
289
|
+
finally { if (e_6) throw e_6.error; }
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
try {
|
|
293
|
+
for (var _e = tslib_1.__values(fill.writes), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
294
|
+
var write = _f.value;
|
|
295
|
+
var state_1 = _loop_1(write);
|
|
296
|
+
if (typeof state_1 === "object")
|
|
297
|
+
return state_1.value;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
301
|
+
finally {
|
|
302
|
+
try {
|
|
303
|
+
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
|
304
|
+
}
|
|
305
|
+
finally { if (e_4) throw e_4.error; }
|
|
306
|
+
}
|
|
307
|
+
return undefined;
|
|
308
|
+
};
|
|
309
|
+
exports.entryFillTornArrayWrite = entryFillTornArrayWrite;
|
|
179
310
|
var useEditorSubmit = function (_a) {
|
|
180
|
-
var sheetId = _a.sheetId, onChangeActiveSheet = _a.onChangeActiveSheet, setActiveCell = _a.setActiveCell, onChange = _a.onChange, onComplete = _a.onComplete, getCommitValidation = _a.getCommitValidation, showValidationAlert = _a.showValidationAlert, selections = _a.selections, getSelections = _a.getSelections, onChangeBatch = _a.onChangeBatch, batchHistory = _a.batchHistory, formulaLocale = _a.formulaLocale, referenceStyle = _a.referenceStyle, onChangeArrayFormula = _a.onChangeArrayFormula, getArrayFormula = _a.getArrayFormula, getEffectiveFormat = _a.getEffectiveFormat, onChangeFormatting = _a.onChangeFormatting, autoCorrect = _a.autoCorrect, _b = _a.autoPercentEntry, autoPercentEntry = _b === void 0 ? false : _b, reopenEditor = _a.reopenEditor;
|
|
311
|
+
var sheetId = _a.sheetId, onChangeActiveSheet = _a.onChangeActiveSheet, setActiveCell = _a.setActiveCell, onChange = _a.onChange, onComplete = _a.onComplete, getCommitValidation = _a.getCommitValidation, showValidationAlert = _a.showValidationAlert, selections = _a.selections, getSelections = _a.getSelections, onChangeBatch = _a.onChangeBatch, batchHistory = _a.batchHistory, onFillEntry = _a.onFillEntry, formulaLocale = _a.formulaLocale, referenceStyle = _a.referenceStyle, onChangeArrayFormula = _a.onChangeArrayFormula, getArrayFormula = _a.getArrayFormula, getEffectiveFormat = _a.getEffectiveFormat, onChangeFormatting = _a.onChangeFormatting, autoCorrect = _a.autoCorrect, _b = _a.autoPercentEntry, autoPercentEntry = _b === void 0 ? false : _b, reopenEditor = _a.reopenEditor;
|
|
181
312
|
var _c = tslib_1.__read((0, formula_mode_atom_1.useFormulaMode)(), 2), formulaMode = _c[0], setFormulaMode = _c[1];
|
|
182
313
|
var _d = tslib_1.__read((0, editing_cell_atom_1.useEditingCell)(), 2), _ = _d[0], setEditingCellCoordinate = _d[1];
|
|
183
314
|
var setActiveEditor = (0, atoms_1.useSetActiveEditor)();
|
|
184
315
|
var selectionsRef = (0, react_1.useRef)(selections);
|
|
185
316
|
selectionsRef.current = selections;
|
|
186
317
|
return (0, react_1.useCallback)(function (value, textFormatRuns, previousValue, editingSheetId, activeCell, nextActiveCell, isDirty, options) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
187
|
-
var typedValue, format, showEditingSheet, resetEditorState, commit, pending_1, enforcement, _a, decision, alert_1, request, proceed, _b;
|
|
318
|
+
var typedValue, format, showEditingSheet, resetEditorState, finish, commit, pending_1, enforcement, _a, decision, alert_1, request, proceed, _b, committing;
|
|
188
319
|
var _c, _d, _e;
|
|
189
320
|
return tslib_1.__generator(this, function (_f) {
|
|
190
321
|
switch (_f.label) {
|
|
@@ -231,15 +362,37 @@ var useEditorSubmit = function (_a) {
|
|
|
231
362
|
setFormulaMode(false);
|
|
232
363
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete();
|
|
233
364
|
};
|
|
365
|
+
finish = function (refused) {
|
|
366
|
+
// The typed entry was refused, by Excel's entry limits or by the host for a fill it was
|
|
367
|
+
// handed whole: nothing was written. Stay on the cell and put the typed text back in the
|
|
368
|
+
// editor (after this submit has finished closing it).
|
|
369
|
+
if (refused && typeof typedValue === "string" && reopenEditor) {
|
|
370
|
+
if (editingSheetId !== sheetId) {
|
|
371
|
+
onChangeActiveSheet === null || onChangeActiveSheet === void 0 ? void 0 : onChangeActiveSheet(editingSheetId);
|
|
372
|
+
}
|
|
373
|
+
resetEditorState();
|
|
374
|
+
void Promise.resolve().then(function () {
|
|
375
|
+
return reopenEditor(editingSheetId, activeCell, typedValue);
|
|
376
|
+
});
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
// Switch to active sheet
|
|
380
|
+
// Always change sheet first.
|
|
381
|
+
// Skipped when the submit was triggered *by* a sheet change — the
|
|
382
|
+
// value still lands on `editingSheetId`, but switching back would
|
|
383
|
+
// undo the sheet the user just moved to.
|
|
384
|
+
if (editingSheetId !== sheetId && !(options === null || options === void 0 ? void 0 : options.preserveActiveSheet)) {
|
|
385
|
+
onChangeActiveSheet === null || onChangeActiveSheet === void 0 ? void 0 : onChangeActiveSheet(editingSheetId);
|
|
386
|
+
}
|
|
387
|
+
// Update and scroll to the new active cell
|
|
388
|
+
if (nextActiveCell) {
|
|
389
|
+
setActiveCell(editingSheetId, nextActiveCell);
|
|
390
|
+
}
|
|
391
|
+
resetEditorState();
|
|
392
|
+
};
|
|
234
393
|
commit = function () {
|
|
235
394
|
var _a, _b, _c;
|
|
236
395
|
var selected = (_b = (_a = getSelections === null || getSelections === void 0 ? void 0 : getSelections()) !== null && _a !== void 0 ? _a : selectionsRef.current) !== null && _b !== void 0 ? _b : [];
|
|
237
|
-
var refused = false;
|
|
238
|
-
var writeActiveCell = function () {
|
|
239
|
-
var result = onChange === null || onChange === void 0 ? void 0 : onChange(editingSheetId, activeCell, value, textFormatRuns, previousValue, isDirty);
|
|
240
|
-
if ((0, exports.isEntryLimitRefusal)(result))
|
|
241
|
-
refused = true;
|
|
242
|
-
};
|
|
243
396
|
// Ctrl+Shift+Enter on a formula: ONE legacy array over the selection (or the array being
|
|
244
397
|
// re-entered) — the engine writes and fits every cell of it, so nothing else is written.
|
|
245
398
|
var arrayFormula = (options === null || options === void 0 ? void 0 : options.arrayFormula) && onChangeArrayFormula && isFormulaEntry(value);
|
|
@@ -251,7 +404,7 @@ var useEditorSubmit = function (_a) {
|
|
|
251
404
|
// commits the same way.
|
|
252
405
|
var fillWrites = !arrayFormula &&
|
|
253
406
|
((options === null || options === void 0 ? void 0 : options.fillSelection) || (options === null || options === void 0 ? void 0 : options.arrayFormula)) &&
|
|
254
|
-
onChangeBatch
|
|
407
|
+
(onChangeBatch || onFillEntry)
|
|
255
408
|
? (0, exports.planEntryFill)(value, activeCell, selected)
|
|
256
409
|
: [];
|
|
257
410
|
var wrapLineBreak = onChangeFormatting &&
|
|
@@ -262,71 +415,78 @@ var useEditorSubmit = function (_a) {
|
|
|
262
415
|
});
|
|
263
416
|
if (arrayFormula) {
|
|
264
417
|
onChangeArrayFormula === null || onChangeArrayFormula === void 0 ? void 0 : onChangeArrayFormula(editingSheetId, (0, exports.planArrayFormulaRange)(activeCell, selected, (_c = getArrayFormula === null || getArrayFormula === void 0 ? void 0 : getArrayFormula(editingSheetId, activeCell.rowIndex, activeCell.columnIndex)) === null || _c === void 0 ? void 0 : _c.range), value);
|
|
418
|
+
return finish(false);
|
|
265
419
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
if (fillWrites_1_1 && !fillWrites_1_1.done && (_a = fillWrites_1.return)) _a.call(fillWrites_1);
|
|
289
|
-
}
|
|
290
|
-
finally { if (e_3) throw e_3.error; }
|
|
291
|
-
}
|
|
292
|
-
if (wrapLineBreak) {
|
|
293
|
-
// Excel turns Wrap Text on for an entry with a line break, so every line shows and
|
|
294
|
-
// an auto-height row grows to them (the engines refit it on the format change).
|
|
295
|
-
onChangeFormatting === null || onChangeFormatting === void 0 ? void 0 : onChangeFormatting(editingSheetId, activeCell, fillWrites.length ? selected : [], "wrapStrategy", "wrap");
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
if (batchHistory) {
|
|
299
|
-
batchHistory(writeAll);
|
|
420
|
+
var isFill = fillWrites.length > 0;
|
|
421
|
+
// The commit as planned: the active cell's write, the other cells of a fill, the wrap.
|
|
422
|
+
var entry = {
|
|
423
|
+
sheetId: editingSheetId,
|
|
424
|
+
activeCell: activeCell,
|
|
425
|
+
value: value,
|
|
426
|
+
textFormatRuns: textFormatRuns,
|
|
427
|
+
previousValue: previousValue,
|
|
428
|
+
isDirty: isDirty,
|
|
429
|
+
selections: isFill ? selected : [],
|
|
430
|
+
writes: fillWrites,
|
|
431
|
+
wrapText: Boolean(wrapLineBreak),
|
|
432
|
+
};
|
|
433
|
+
var torn = isFill && getArrayFormula
|
|
434
|
+
? (0, exports.entryFillTornArrayWrite)(entry, getArrayFormula)
|
|
435
|
+
: undefined;
|
|
436
|
+
if (torn) {
|
|
437
|
+
// Excel refuses the whole fill ("You can't change part of an array") and changes
|
|
438
|
+
// nothing. Only the write the engine refuses is sent, so the engine says so in its
|
|
439
|
+
// own words and no other cell of the fill is written; the entry stays open.
|
|
440
|
+
if (torn === "activeCell") {
|
|
441
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(editingSheetId, activeCell, value, textFormatRuns, previousValue, isDirty);
|
|
300
442
|
}
|
|
301
443
|
else {
|
|
302
|
-
|
|
444
|
+
onChangeBatch === null || onChangeBatch === void 0 ? void 0 : onChangeBatch(editingSheetId, torn.range, torn.values);
|
|
303
445
|
}
|
|
446
|
+
return finish(true);
|
|
304
447
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
448
|
+
if (isFill && onFillEntry) {
|
|
449
|
+
// One operation for the host (Athena-Intel/demo-app-monorepo#62479): it is handed the
|
|
450
|
+
// whole fill, judges it (a person's answer included) and writes it itself, in a
|
|
451
|
+
// history batch of its own. Nothing is written from here, whatever it answers: a
|
|
452
|
+
// refusal cannot leave the active cell written and the rest not.
|
|
453
|
+
//
|
|
454
|
+
// A host that throws or rejects has not said the fill was written: for the grid that
|
|
455
|
+
// is a refusal too, so the entry is not left closed with its text gone. The error
|
|
456
|
+
// goes on to the host.
|
|
457
|
+
var failed = function (error) {
|
|
458
|
+
finish(true);
|
|
459
|
+
throw error;
|
|
460
|
+
};
|
|
461
|
+
var answer = void 0;
|
|
462
|
+
try {
|
|
463
|
+
answer = onFillEntry(entry);
|
|
310
464
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
465
|
+
catch (error) {
|
|
466
|
+
return failed(error);
|
|
467
|
+
}
|
|
468
|
+
return answer instanceof Promise
|
|
469
|
+
? answer.then(function (written) { return finish(written === false); }, failed)
|
|
470
|
+
: finish(answer === false);
|
|
316
471
|
}
|
|
317
|
-
//
|
|
318
|
-
//
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
472
|
+
// Read where the write is made, never from what `batchHistory` returns: a host's batcher
|
|
473
|
+
// may run the action and return nothing.
|
|
474
|
+
var written = true;
|
|
475
|
+
var writeAll = function () {
|
|
476
|
+
written = (0, exports.writeEntryFill)(entry, {
|
|
477
|
+
onChange: onChange,
|
|
478
|
+
onChangeBatch: onChangeBatch,
|
|
479
|
+
onChangeFormatting: onChangeFormatting,
|
|
480
|
+
});
|
|
481
|
+
};
|
|
482
|
+
// One gesture, one undo entry: the active cell, every rectangle and the wrap together.
|
|
483
|
+
if (batchHistory && (isFill || wrapLineBreak)) {
|
|
484
|
+
batchHistory(writeAll);
|
|
324
485
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
setActiveCell(editingSheetId, nextActiveCell);
|
|
486
|
+
else {
|
|
487
|
+
writeAll();
|
|
328
488
|
}
|
|
329
|
-
|
|
489
|
+
finish(!written);
|
|
330
490
|
};
|
|
331
491
|
if (!(value !== previousValue && getCommitValidation)) return [3 /*break*/, 7];
|
|
332
492
|
pending_1 = getCommitValidation(editingSheetId, activeCell.rowIndex, activeCell.columnIndex, value, previousValue);
|
|
@@ -372,8 +532,13 @@ var useEditorSubmit = function (_a) {
|
|
|
372
532
|
}
|
|
373
533
|
_f.label = 7;
|
|
374
534
|
case 7:
|
|
375
|
-
commit();
|
|
376
|
-
return [
|
|
535
|
+
committing = commit();
|
|
536
|
+
if (!committing) return [3 /*break*/, 9];
|
|
537
|
+
return [4 /*yield*/, committing];
|
|
538
|
+
case 8:
|
|
539
|
+
_f.sent();
|
|
540
|
+
_f.label = 9;
|
|
541
|
+
case 9: return [2 /*return*/];
|
|
377
542
|
}
|
|
378
543
|
});
|
|
379
544
|
}); }, [
|
|
@@ -391,6 +556,7 @@ var useEditorSubmit = function (_a) {
|
|
|
391
556
|
getSelections,
|
|
392
557
|
onChangeBatch,
|
|
393
558
|
batchHistory,
|
|
559
|
+
onFillEntry,
|
|
394
560
|
formulaLocale,
|
|
395
561
|
referenceStyle,
|
|
396
562
|
onChangeArrayFormula,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-keyboard-handler.d.ts","sourceRoot":"","sources":["../../../hooks/use-keyboard-handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AASvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"use-keyboard-handler.d.ts","sourceRoot":"","sources":["../../../hooks/use-keyboard-handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AASvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EAEV,UAAU,EACV,aAAa,EAEb,KAAK,EACL,UAAU,EACX,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAmCnE,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IACnC,oBAAoB,EAAE,WAAW,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAC3E,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC;IAC3D,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AC,CAAC;IACnD,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACjD,iDAAiD;IACjD,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,uEAAuE;IACvE,iBAAiB,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/D;;;;OAIG;IACH,cAAc,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC;IAC/D;;OAEG;IACH,oBAAoB,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC;IACrE,sEAAsE;IACtE,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACjD,mBAAmB,CAAC,CAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC7B,iBAAiB,CAAC,CAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,KAAK,CAAC,aAAa,CAAC,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,k/BAyEhC,uBAAuB,SAGhB,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,SA21B5C,CAAC"}
|
|
@@ -7,6 +7,7 @@ var utils_1 = require("@rowsncolumns/utils");
|
|
|
7
7
|
var react_1 = require("react");
|
|
8
8
|
var index_ranges_1 = require("../api/index-ranges");
|
|
9
9
|
var platform_1 = require("../platform");
|
|
10
|
+
var themes_1 = require("../themes");
|
|
10
11
|
var use_callback_ref_1 = require("./use-callback-ref");
|
|
11
12
|
/**
|
|
12
13
|
* The computed value of a cell as the constant Excel's Ctrl+Shift+" writes
|
|
@@ -289,7 +290,7 @@ var useKeyboardHandler = function (_a) {
|
|
|
289
290
|
var border = {
|
|
290
291
|
width: 1,
|
|
291
292
|
style: "solid",
|
|
292
|
-
color:
|
|
293
|
+
color: themes_1.AUTOMATIC_BORDER_COLOR,
|
|
293
294
|
};
|
|
294
295
|
if (isMeta) {
|
|
295
296
|
switch (key) {
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./components/fill-series-dialog";
|
|
|
15
15
|
export * from "./components/selection/fill-options-menu";
|
|
16
16
|
export * from "./api/fill-series";
|
|
17
17
|
export { type FillHandleRelease } from "./hooks/use-selection";
|
|
18
|
+
export { entryFillTornArrayWrite, writeEntryFill, } from "./hooks/use-editor-submit";
|
|
18
19
|
export * from "./components/paste-special-dialog";
|
|
19
20
|
export * from "./components/go-to-dialog";
|
|
20
21
|
export * from "./components/move-overwrite-confirm-dialog";
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.tsx"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AACzD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,s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";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useChartClipboard = exports.CHART_PASTE_OFFSET_PIXELS = exports.CHART_CLIPBOARD_MIME = exports.StyledFakeTriggerButton = exports.withTotalRowFunction = exports.TOTAL_ROW_FUNCTIONS = exports.MORE_FUNCTIONS_INITIAL_VALUE = exports.getTotalRowFunctionFromFormula = exports.getTotalRowFunctionFormula = exports.LoadingIndicator = exports.resolveGoToReference = void 0;
|
|
3
|
+
exports.useChartClipboard = exports.CHART_PASTE_OFFSET_PIXELS = exports.CHART_CLIPBOARD_MIME = exports.StyledFakeTriggerButton = exports.withTotalRowFunction = exports.TOTAL_ROW_FUNCTIONS = exports.MORE_FUNCTIONS_INITIAL_VALUE = exports.getTotalRowFunctionFromFormula = exports.getTotalRowFunctionFormula = exports.LoadingIndicator = exports.resolveGoToReference = exports.writeEntryFill = exports.entryFillTornArrayWrite = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
tslib_1.__exportStar(require("./components/canvas-grid"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./components/canvas-grid/typings"), exports);
|
|
@@ -18,6 +18,9 @@ tslib_1.__exportStar(require("./components/sort-range-dialog"), exports);
|
|
|
18
18
|
tslib_1.__exportStar(require("./components/fill-series-dialog"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./components/selection/fill-options-menu"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("./api/fill-series"), exports);
|
|
21
|
+
var use_editor_submit_1 = require("./hooks/use-editor-submit");
|
|
22
|
+
Object.defineProperty(exports, "entryFillTornArrayWrite", { enumerable: true, get: function () { return use_editor_submit_1.entryFillTornArrayWrite; } });
|
|
23
|
+
Object.defineProperty(exports, "writeEntryFill", { enumerable: true, get: function () { return use_editor_submit_1.writeEntryFill; } });
|
|
21
24
|
tslib_1.__exportStar(require("./components/paste-special-dialog"), exports);
|
|
22
25
|
tslib_1.__exportStar(require("./components/go-to-dialog"), exports);
|
|
23
26
|
tslib_1.__exportStar(require("./components/move-overwrite-confirm-dialog"), exports);
|
package/dist/cjs/release-date.js
CHANGED
|
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.releaseDate = void 0;
|
|
5
5
|
exports.releaseDate =
|
|
6
6
|
// @ts-ignore
|
|
7
|
-
(_a = new Date("2026-11-
|
|
7
|
+
(_a = new Date("2026-11-25")) !== null && _a !== void 0 ? _a : new Date("2025-06-18");
|
package/dist/cjs/themes.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ export declare const getThemeColorFromIndex: (theme: SpreadsheetTheme, index: Co
|
|
|
15
15
|
export declare const resolveThemeFontFamily: <T extends string | null | undefined>(family: T, theme: Pick<SpreadsheetTheme, "primaryFontFamily" | "headingFontFamily"> | undefined) => T | string;
|
|
16
16
|
type StringifiedColorValue<T extends Color | string | undefined | null> = T extends undefined ? undefined : string;
|
|
17
17
|
export declare const getStringifiedColor: <T extends Color | undefined | null>(color: T, theme: SpreadsheetTheme) => StringifiedColorValue<T>;
|
|
18
|
+
/**
|
|
19
|
+
* The colour of a border nobody picked a colour for: Excel's "automatic".
|
|
20
|
+
* The stored value is the same in light and dark mode; the grid draws it in
|
|
21
|
+
* its own text colour when the grid is dark. Black from a colour picker is
|
|
22
|
+
* `{ theme: 1 }` (no tint) and is always drawn black.
|
|
23
|
+
*/
|
|
24
|
+
export declare const AUTOMATIC_BORDER_COLOR: Color;
|
|
25
|
+
export declare const isAutomaticBorderColor: (color: Color | undefined | null) => boolean;
|
|
18
26
|
export declare const createColorShades: (color: string, tints: number[]) => string[];
|
|
19
27
|
export declare const colorTintsToDisplay: number[][];
|
|
20
28
|
export {};
|
package/dist/cjs/themes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../themes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAA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AEF,eAAO,MAAM,mBAAmB,YAY/B,CAAC"}
|
package/dist/cjs/themes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colorTintsToDisplay = exports.createColorShades = exports.getStringifiedColor = exports.resolveThemeFontFamily = exports.getThemeColorFromIndex = exports.colorKeys = exports.STANDARD_COLORS = exports.availableThemes = void 0;
|
|
3
|
+
exports.colorTintsToDisplay = exports.createColorShades = exports.isAutomaticBorderColor = exports.AUTOMATIC_BORDER_COLOR = exports.getStringifiedColor = exports.resolveThemeFontFamily = exports.getThemeColorFromIndex = exports.colorKeys = exports.STANDARD_COLORS = exports.availableThemes = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var utils_1 = require("@rowsncolumns/utils");
|
|
6
6
|
var commonDarkColors = {
|
|
@@ -251,6 +251,23 @@ var getStringifiedColor = function (color, theme) {
|
|
|
251
251
|
return (0, exports.getThemeColorFromIndex)(theme, color.theme, color.tint);
|
|
252
252
|
};
|
|
253
253
|
exports.getStringifiedColor = getStringifiedColor;
|
|
254
|
+
/**
|
|
255
|
+
* The colour of a border nobody picked a colour for: Excel's "automatic".
|
|
256
|
+
* The stored value is the same in light and dark mode; the grid draws it in
|
|
257
|
+
* its own text colour when the grid is dark. Black from a colour picker is
|
|
258
|
+
* `{ theme: 1 }` (no tint) and is always drawn black.
|
|
259
|
+
*/
|
|
260
|
+
exports.AUTOMATIC_BORDER_COLOR = Object.freeze({
|
|
261
|
+
theme: 1,
|
|
262
|
+
tint: 0,
|
|
263
|
+
});
|
|
264
|
+
var isAutomaticBorderColor = function (color) {
|
|
265
|
+
return !(0, utils_1.isNil)(color) &&
|
|
266
|
+
typeof color !== "string" &&
|
|
267
|
+
color.theme === 1 &&
|
|
268
|
+
color.tint === 0;
|
|
269
|
+
};
|
|
270
|
+
exports.isAutomaticBorderColor = isAutomaticBorderColor;
|
|
254
271
|
var createColorShades = function (color, tints) {
|
|
255
272
|
return tints.map(function (tint) { return (0, utils_1.applyTint)(tint, color); });
|
|
256
273
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;
|
|
1
|
+
{"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;oBACq4mG,CAAC;qBAAwB,CAAC;;;;;;;;;;;CADh3mG,CAAC"}
|
|
@@ -16,7 +16,8 @@ export declare const getNestedPropertyNames: (obj: any, prefix?: string) => stri
|
|
|
16
16
|
* What a screen reader hears as the value of an `=IMAGE(source, [alt_text], …)` cell, which shows a
|
|
17
17
|
* picture rather than its text: the formula's `alt_text` (Excel: "Alternative text that describes
|
|
18
18
|
* the image for accessibility"), else "Picture"; Excel's `#CONNECT!` when the picture couldn't be
|
|
19
|
-
* retrieved
|
|
19
|
+
* retrieved, `#BLOCKED!` when the image source policy blocks it (the cell shows that error, so
|
|
20
|
+
* that is what it reads). `undefined` for any other cell.
|
|
20
21
|
*/
|
|
21
22
|
export declare const imageCellAccessibleValue: (structuredValue: unknown, loadStatus: string | undefined) => string | undefined;
|
|
22
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,GAAG,EAAE,eAAW,KAAG,MAAM,EA2BpE,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,GAAG,EAAE,eAAW,KAAG,MAAM,EA2BpE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,iBAAiB,OAAO,EACxB,YAAY,MAAM,GAAG,SAAS,KAC7B,MAAM,GAAG,SAWX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,8BAItC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,KAAG,MAMH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KACxE,MAAM,EAcR,CAAC"}
|
|
@@ -38,7 +38,8 @@ export const getNestedPropertyNames = (obj, prefix = "") => {
|
|
|
38
38
|
* What a screen reader hears as the value of an `=IMAGE(source, [alt_text], …)` cell, which shows a
|
|
39
39
|
* picture rather than its text: the formula's `alt_text` (Excel: "Alternative text that describes
|
|
40
40
|
* the image for accessibility"), else "Picture"; Excel's `#CONNECT!` when the picture couldn't be
|
|
41
|
-
* retrieved
|
|
41
|
+
* retrieved, `#BLOCKED!` when the image source policy blocks it (the cell shows that error, so
|
|
42
|
+
* that is what it reads). `undefined` for any other cell.
|
|
42
43
|
*/
|
|
43
44
|
export const imageCellAccessibleValue = (structuredValue, loadStatus) => {
|
|
44
45
|
const image = structuredValue;
|
|
@@ -46,6 +47,8 @@ export const imageCellAccessibleValue = (structuredValue, loadStatus) => {
|
|
|
46
47
|
return undefined;
|
|
47
48
|
if (loadStatus === "failed")
|
|
48
49
|
return "#CONNECT!";
|
|
50
|
+
if (loadStatus === "blocked")
|
|
51
|
+
return "#BLOCKED!";
|
|
49
52
|
return typeof image.altText === "string" && image.altText.trim() !== ""
|
|
50
53
|
? image.altText
|
|
51
54
|
: "Picture";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAqEA,OAAO,KASN,MAAM,OAAO,CAAC;AAoSf,OAAO,KAAK,EAGV,QAAQ,EAcT,MAAM,aAAa,CAAC;AA0DrB,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":"AAqEA,OAAO,KASN,MAAM,OAAO,CAAC;AAoSf,OAAO,KAAK,EAGV,QAAQ,EAcT,MAAM,aAAa,CAAC;AA0DrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;AA6/QnB,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"}
|