@rowsncolumns/spreadsheet 10.19.3 → 10.19.4
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/api/entry-selections.d.ts +85 -0
- package/dist/cjs/api/entry-selections.d.ts.map +1 -0
- package/dist/cjs/api/entry-selections.js +122 -0
- package/dist/cjs/atoms/entry-selections.atom.d.ts +11 -0
- package/dist/cjs/atoms/entry-selections.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/entry-selections.atom.js +11 -0
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +193 -73
- package/dist/cjs/hooks/use-editable.d.ts +3 -2
- package/dist/cjs/hooks/use-editable.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editor-change.d.ts +7 -3
- package/dist/cjs/hooks/use-editor-change.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editor-change.js +12 -14
- package/dist/cjs/hooks/use-editor-submit.d.ts +4 -2
- package/dist/cjs/hooks/use-editor-submit.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editor-submit.js +5 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/api/entry-selections.d.ts +85 -0
- package/dist/esm/api/entry-selections.d.ts.map +1 -0
- package/dist/esm/api/entry-selections.js +88 -0
- package/dist/esm/atoms/entry-selections.atom.d.ts +11 -0
- package/dist/esm/atoms/entry-selections.atom.d.ts.map +1 -0
- package/dist/esm/atoms/entry-selections.atom.js +8 -0
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +160 -41
- package/dist/esm/hooks/use-editable.d.ts +3 -2
- package/dist/esm/hooks/use-editable.d.ts.map +1 -1
- package/dist/esm/hooks/use-editor-change.d.ts +7 -3
- package/dist/esm/hooks/use-editor-change.d.ts.map +1 -1
- package/dist/esm/hooks/use-editor-change.js +10 -12
- package/dist/esm/hooks/use-editor-submit.d.ts +4 -2
- package/dist/esm/hooks/use-editor-submit.d.ts.map +1 -1
- package/dist/esm/hooks/use-editor-submit.js +5 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ var react_dom_1 = require("react-dom");
|
|
|
18
18
|
var banded_ranges_1 = require("../../api/banded-ranges");
|
|
19
19
|
var split_pane_1 = require("../../api/split-pane");
|
|
20
20
|
var excel_edit_value_1 = require("../../api/excel-edit-value");
|
|
21
|
+
var entry_selections_1 = require("../../api/entry-selections");
|
|
21
22
|
var error_checking_1 = require("../../api/error-checking");
|
|
22
23
|
var formula_bar_editor_value_atom_1 = require("../../atoms/formula-bar-editor-value.atom");
|
|
23
24
|
var insert_options_1 = require("../../api/insert-options");
|
|
@@ -40,6 +41,7 @@ var object_focus_1 = require("../embeds/object-focus");
|
|
|
40
41
|
var enter_key_direction_atom_1 = require("../../atoms/enter-key-direction.atom");
|
|
41
42
|
var formula_bar_editor_value_atom_2 = require("../../atoms/formula-bar-editor-value.atom");
|
|
42
43
|
var formula_selection_state_atom_1 = require("../../atoms/formula-selection-state.atom");
|
|
44
|
+
var entry_selections_atom_1 = require("../../atoms/entry-selections.atom");
|
|
43
45
|
var formula_selections_atom_1 = require("../../atoms/formula-selections.atom");
|
|
44
46
|
var magic_fill_state_atom_1 = require("../../atoms/magic-fill-state.atom");
|
|
45
47
|
var show_formula_help_atom_1 = require("../../atoms/show-formula-help.atom");
|
|
@@ -157,8 +159,6 @@ var VISUALLY_HIDDEN = {
|
|
|
157
159
|
var defaultCellCoords = { rowIndex: 1, columnIndex: 1 };
|
|
158
160
|
/** The grey of Excel's Flash Fill suggestion while typing. */
|
|
159
161
|
var FLASH_FILL_SUGGESTION_COLOR = "#a6a6a6";
|
|
160
|
-
/** No sheet has a range picked for the formula being entered. */
|
|
161
|
-
var NO_FORMULA_PICKS = new Map();
|
|
162
162
|
/**
|
|
163
163
|
* Whether a registered editor's DOM has been removed: an input that unmounted while focused
|
|
164
164
|
* gets no blur from Chromium, so its `activeEditor` registration can outlive it. Such an editor
|
|
@@ -3113,35 +3113,157 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
3113
3113
|
isNoteShown: showAllNotes ? use_shown_notes_1.alwaysTrue : isNoteVisible,
|
|
3114
3114
|
});
|
|
3115
3115
|
/**
|
|
3116
|
-
*
|
|
3117
|
-
*
|
|
3118
|
-
*
|
|
3119
|
-
*
|
|
3120
|
-
*
|
|
3121
|
-
*
|
|
3122
|
-
*/
|
|
3123
|
-
var
|
|
3124
|
-
var
|
|
3116
|
+
* The cell entry now open and what each sheet has selected as far as it is
|
|
3117
|
+
* concerned (`api/entry-selections.ts`): the host's selection for the sheet
|
|
3118
|
+
* with the ranges picked for the entry's formula taken out. The entry acts
|
|
3119
|
+
* on the typing sheet's (the commit key moves the active cell inside it,
|
|
3120
|
+
* Ctrl+Enter fills it), and each sheet a range was picked on gets its own
|
|
3121
|
+
* back when the entry ends.
|
|
3122
|
+
*/
|
|
3123
|
+
var entrySelectionsState = (0, jotai_1.useAtomValue)(entry_selections_atom_1.entrySelectionsAtom);
|
|
3124
|
+
var typingSheetId = editingCellCoordinate === null || editingCellCoordinate === void 0 ? void 0 : editingCellCoordinate.sheetId;
|
|
3125
|
+
var typingRowIndex = editingCellCoordinate === null || editingCellCoordinate === void 0 ? void 0 : editingCellCoordinate.rowIndex;
|
|
3126
|
+
var typingColumnIndex = editingCellCoordinate === null || editingCellCoordinate === void 0 ? void 0 : editingCellCoordinate.columnIndex;
|
|
3127
|
+
/** The cell the open entry is typed in; none while no entry is open. */
|
|
3128
|
+
var typingCell = (0, react_1.useMemo)(function () {
|
|
3129
|
+
return typingSheetId === undefined ||
|
|
3130
|
+
typingRowIndex === undefined ||
|
|
3131
|
+
typingColumnIndex === undefined
|
|
3132
|
+
? undefined
|
|
3133
|
+
: {
|
|
3134
|
+
sheetId: typingSheetId,
|
|
3135
|
+
rowIndex: typingRowIndex,
|
|
3136
|
+
columnIndex: typingColumnIndex,
|
|
3137
|
+
};
|
|
3138
|
+
}, [typingSheetId, typingRowIndex, typingColumnIndex]);
|
|
3139
|
+
var isPickingForCellEntry = formulaMode && canSelectCells && typingCell !== undefined;
|
|
3125
3140
|
// Every selection a gesture on the grid writes goes to the host through
|
|
3126
3141
|
// here (cells, headings, table edges, a drawn selection or its title), so
|
|
3127
|
-
//
|
|
3142
|
+
// each one made while an entry is taking picks is told apart from a
|
|
3143
|
+
// selection the host sets on its own.
|
|
3128
3144
|
var onChangeSelectionsFromGrid = (0, use_callback_ref_1.useCallbackRef)((0, react_1.useCallback)(function (changedSheetId, nextSelections, finishedSelection) {
|
|
3129
|
-
if (isPickingForCellEntry) {
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3145
|
+
if (isPickingForCellEntry && typingCell && changedSheetId === sheetId) {
|
|
3146
|
+
var state = store.get(entry_selections_atom_1.entrySelectionsAtom);
|
|
3147
|
+
var sheets = (0, entry_selections_1.isSameEntryCell)(state === null || state === void 0 ? void 0 : state.cell, typingCell)
|
|
3148
|
+
? state === null || state === void 0 ? void 0 : state.sheets
|
|
3149
|
+
: undefined;
|
|
3150
|
+
store.set(entry_selections_atom_1.entrySelectionsAtom, {
|
|
3151
|
+
cell: typingCell,
|
|
3152
|
+
sheets: new Map(sheets).set(changedSheetId, (0, entry_selections_1.afterPick)(sheets === null || sheets === void 0 ? void 0 : sheets.get(changedSheetId), selections, nextSelections)),
|
|
3134
3153
|
});
|
|
3135
3154
|
}
|
|
3136
3155
|
onChangeSelections === null || onChangeSelections === void 0 ? void 0 : onChangeSelections(changedSheetId, nextSelections, finishedSelection);
|
|
3137
|
-
}, [
|
|
3138
|
-
|
|
3139
|
-
|
|
3156
|
+
}, [
|
|
3157
|
+
store,
|
|
3158
|
+
isPickingForCellEntry,
|
|
3159
|
+
typingCell,
|
|
3160
|
+
sheetId,
|
|
3161
|
+
selections,
|
|
3162
|
+
onChangeSelections,
|
|
3163
|
+
]));
|
|
3164
|
+
/**
|
|
3165
|
+
* Takes the entry's picked ranges out of every sheet's selection: each sheet
|
|
3166
|
+
* a range was picked on gets its own selection back. A sheet nothing was
|
|
3167
|
+
* picked on keeps its selection as it is, whatever references the formula
|
|
3168
|
+
* holds (Excel keeps the selected range through Enter and Escape, and when
|
|
3169
|
+
* the formula is deleted while it is still being typed).
|
|
3170
|
+
*/
|
|
3171
|
+
var putBackEntrySelections = (0, use_callback_ref_1.useCallbackRef)((0, react_1.useCallback)(function (state, finishedSelection) {
|
|
3172
|
+
var sheets = new Map(state.sheets);
|
|
3173
|
+
state.sheets.forEach(function (sheet, pickedSheetId) {
|
|
3174
|
+
if (!sheet.written) {
|
|
3175
|
+
return;
|
|
3176
|
+
}
|
|
3177
|
+
if (finishedSelection === undefined) {
|
|
3178
|
+
onChangeSelections === null || onChangeSelections === void 0 ? void 0 : onChangeSelections(pickedSheetId, sheet.own);
|
|
3179
|
+
}
|
|
3180
|
+
else {
|
|
3181
|
+
onChangeSelections === null || onChangeSelections === void 0 ? void 0 : onChangeSelections(pickedSheetId, sheet.own, finishedSelection);
|
|
3182
|
+
}
|
|
3183
|
+
sheets.set(pickedSheetId, (0, entry_selections_1.afterPutBack)(sheet));
|
|
3184
|
+
});
|
|
3185
|
+
return sheets;
|
|
3186
|
+
}, [onChangeSelections]));
|
|
3187
|
+
// The entry's state follows what the host gives. It runs after every render
|
|
3188
|
+
// that brings another entry, another sheet in view or another selection, so
|
|
3189
|
+
// it reads the host's selection as it is now, including one the host set in
|
|
3190
|
+
// the same tick as it cancelled or reopened the editor (a collaborator's
|
|
3191
|
+
// edit moving the cell being typed in).
|
|
3140
3192
|
(0, use_isomorphic_layout_effect_1.useIsomorphicLayoutEffect)(function () {
|
|
3141
|
-
|
|
3142
|
-
|
|
3193
|
+
var _a;
|
|
3194
|
+
var state = store.get(entry_selections_atom_1.entrySelectionsAtom);
|
|
3195
|
+
var isSameEntry = (0, entry_selections_1.isSameEntryCell)(state === null || state === void 0 ? void 0 : state.cell, typingCell);
|
|
3196
|
+
var kept = isSameEntry ? state === null || state === void 0 ? void 0 : state.sheets : undefined;
|
|
3197
|
+
var sheets = kept;
|
|
3198
|
+
var seeded;
|
|
3199
|
+
if (state && !isSameEntry) {
|
|
3200
|
+
// The entry ended (committed, cancelled, closed by the floating editor)
|
|
3201
|
+
// or another cell's entry took its place: its picks leave the
|
|
3202
|
+
// selections. The sheet in view is read first, as the host has it now.
|
|
3203
|
+
var inView_1 = state.sheets.get(sheetId);
|
|
3204
|
+
seeded = putBackEntrySelections(inView_1
|
|
3205
|
+
? {
|
|
3206
|
+
cell: state.cell,
|
|
3207
|
+
sheets: new Map(state.sheets).set(sheetId, (0, entry_selections_1.afterHostGave)(inView_1, selections)),
|
|
3208
|
+
}
|
|
3209
|
+
: state);
|
|
3143
3210
|
}
|
|
3144
|
-
|
|
3211
|
+
if (!typingCell) {
|
|
3212
|
+
if (state) {
|
|
3213
|
+
store.set(entry_selections_atom_1.entrySelectionsAtom, undefined);
|
|
3214
|
+
}
|
|
3215
|
+
return;
|
|
3216
|
+
}
|
|
3217
|
+
var known = sheets === null || sheets === void 0 ? void 0 : sheets.get(sheetId);
|
|
3218
|
+
var putBack = seeded === null || seeded === void 0 ? void 0 : seeded.get(sheetId);
|
|
3219
|
+
var inView = known;
|
|
3220
|
+
if (known) {
|
|
3221
|
+
inView = (0, entry_selections_1.afterHostGave)(known, selections);
|
|
3222
|
+
}
|
|
3223
|
+
else if (sheetId === typingCell.sheetId && (formulaMode || putBack)) {
|
|
3224
|
+
// The typing sheet is kept from the moment the entry is a formula: only
|
|
3225
|
+
// a formula takes a pick or stays open while another sheet is shown. A
|
|
3226
|
+
// constant reads the selection in view. What was just put back is what
|
|
3227
|
+
// the sheet has; the host shows it on its next render.
|
|
3228
|
+
inView = (0, entry_selections_1.entrySheetSelections)((_a = putBack === null || putBack === void 0 ? void 0 : putBack.own) !== null && _a !== void 0 ? _a : selections, selections);
|
|
3229
|
+
}
|
|
3230
|
+
if (inView !== known) {
|
|
3231
|
+
sheets = new Map(sheets).set(sheetId, inView);
|
|
3232
|
+
}
|
|
3233
|
+
if (sheets && sheets !== kept) {
|
|
3234
|
+
store.set(entry_selections_atom_1.entrySelectionsAtom, { cell: typingCell, sheets: sheets });
|
|
3235
|
+
}
|
|
3236
|
+
else if (state && !isSameEntry) {
|
|
3237
|
+
store.set(entry_selections_atom_1.entrySelectionsAtom, undefined);
|
|
3238
|
+
}
|
|
3239
|
+
}, [
|
|
3240
|
+
store,
|
|
3241
|
+
typingCell,
|
|
3242
|
+
sheetId,
|
|
3243
|
+
selections,
|
|
3244
|
+
formulaMode,
|
|
3245
|
+
putBackEntrySelections,
|
|
3246
|
+
]);
|
|
3247
|
+
/**
|
|
3248
|
+
* What the sheet the entry is typed on has selected, apart from any range
|
|
3249
|
+
* picked for its formula, whatever sheet is in view: during a pick on
|
|
3250
|
+
* another sheet the sheet in view is the referenced one, and its selection
|
|
3251
|
+
* is not the entry's. The grid is handed the selection of the sheet in view
|
|
3252
|
+
* only, so the typing sheet's is what the host last gave for it while it
|
|
3253
|
+
* was in view during this entry; an entry opened on a sheet that has not
|
|
3254
|
+
* been in view since has none.
|
|
3255
|
+
*/
|
|
3256
|
+
var typingSheetSelections = typingSheetId !== undefined &&
|
|
3257
|
+
(0, entry_selections_1.isSameEntryCell)(entrySelectionsState === null || entrySelectionsState === void 0 ? void 0 : entrySelectionsState.cell, typingCell)
|
|
3258
|
+
? entrySelectionsState === null || entrySelectionsState === void 0 ? void 0 : entrySelectionsState.sheets.get(typingSheetId)
|
|
3259
|
+
: undefined;
|
|
3260
|
+
var entrySelections = typingSheetId === undefined
|
|
3261
|
+
? undefined
|
|
3262
|
+
: typingSheetSelections
|
|
3263
|
+
? typingSheetSelections.own
|
|
3264
|
+
: typingSheetId === sheetId
|
|
3265
|
+
? selections
|
|
3266
|
+
: config_1.DEFAULT_ARRAY;
|
|
3145
3267
|
/**
|
|
3146
3268
|
* Selection change handler
|
|
3147
3269
|
*/
|
|
@@ -3691,7 +3813,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
3691
3813
|
/**
|
|
3692
3814
|
* Handle grid selections
|
|
3693
3815
|
*/
|
|
3694
|
-
var
|
|
3816
|
+
var _100 = (0, use_selection_1.useSelection)({
|
|
3695
3817
|
sheetId: sheetId,
|
|
3696
3818
|
merges: merges !== null && merges !== void 0 ? merges : config_1.DEFAULT_ARRAY,
|
|
3697
3819
|
getDataRowCount: getDataRowCount,
|
|
@@ -3746,11 +3868,11 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
3746
3868
|
onInsertTableRow: onInsertTableRow,
|
|
3747
3869
|
isRangeSelectable: getSheetProtection ? isRangeSelectable : undefined,
|
|
3748
3870
|
rightToLeft: rightToLeft,
|
|
3749
|
-
}), onMouseDownSelection =
|
|
3871
|
+
}), onMouseDownSelection = _100.onMouseDown, onPointerDownSelection = _100.onPointerDown, onKeyDownSelection = _100.onKeyDown, fillSelection = _100.fillSelection, fillShrink = _100.fillShrink, onFillHandleMouseDown = _100.onFillHandleMouseDown, onFillHandleDoubleClick = _100.onFillHandleDoubleClick, isDragging = _100.isDragging, isDragCopy = _100.isDragCopy, isFilling = _100.isFilling, isSelectionInProgress = _100.isSelectionInProgress, draggedSelection = _100.draggedSelection, onSelectionMouseDown = _100.onSelectionMouseDown, setActiveCell = _100.setActiveCell, initialDraggedSelection = _100.initialDraggedSelection, updateSelectionStartEndReference = _100.updateSelectionStartEndReference, selectColumn = _100.selectColumn, getContentfulGridRangeAroundCell = _100.getContentfulGridRangeAroundCell, newSelection = _100.newSelection, modifySelection = _100.modifySelection, clearSelections = _100.clearSelections;
|
|
3750
3872
|
/**
|
|
3751
3873
|
* Copy, Paste and Cut hook
|
|
3752
3874
|
*/
|
|
3753
|
-
var
|
|
3875
|
+
var _101 = (0, use_copy_paste_cut_1.useCopyPasteCut)({
|
|
3754
3876
|
activeCell: activeCell,
|
|
3755
3877
|
selections: selections,
|
|
3756
3878
|
sheetId: sheetId,
|
|
@@ -3760,7 +3882,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
3760
3882
|
onCopy: onCopy,
|
|
3761
3883
|
onCut: onCut,
|
|
3762
3884
|
onReapplyPaste: onReapplyPaste,
|
|
3763
|
-
}), copiedSelections =
|
|
3885
|
+
}), copiedSelections = _101.copiedSelections, isCutPending = _101.isCutPending, copiedSheetId = _101.copiedSheetId, cancelCut = _101.cancelCut, clearCopiedSelections = _101.clearCopiedSelections, copy = _101.copy, cut = _101.cut, paste = _101.paste, onInternalCopy = _101.onInternalCopy, onInternalCut = _101.onInternalCut, onInternalPaste = _101.onInternalPaste, choosePasteOption = _101.choosePasteOption;
|
|
3764
3886
|
/**
|
|
3765
3887
|
* Ctrl+C / Ctrl+X / Ctrl+V / Ctrl+D on a selected chart. The focused chart is
|
|
3766
3888
|
* the target of those events (see `EmbedDraggable`); a paste that lands in the
|
|
@@ -3957,28 +4079,25 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
3957
4079
|
};
|
|
3958
4080
|
}, [onRequestGoTo, isGoToDialogMounted]);
|
|
3959
4081
|
/**
|
|
3960
|
-
*
|
|
3961
|
-
*
|
|
3962
|
-
*
|
|
3963
|
-
*
|
|
3964
|
-
* holds (Excel keeps the selected range through Enter and Escape).
|
|
4082
|
+
* The entry stopped being a formula while it is still open: its picked
|
|
4083
|
+
* ranges leave the selections now. An entry that ends (Enter, Tab, Escape,
|
|
4084
|
+
* a click elsewhere) has them taken out by the effect above, once the host
|
|
4085
|
+
* has rendered what it holds.
|
|
3965
4086
|
*/
|
|
3966
4087
|
var restoreSelections = (0, use_callback_ref_1.useCallbackRef)((0, react_1.useCallback)(function () {
|
|
3967
|
-
|
|
4088
|
+
var state = store.get(entry_selections_atom_1.entrySelectionsAtom);
|
|
4089
|
+
if (!state || !(0, entry_selections_1.hasEntryPicks)(state)) {
|
|
3968
4090
|
return;
|
|
3969
4091
|
}
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
setSelectionsBeforeFormulaPicks(NO_FORMULA_PICKS);
|
|
3974
|
-
}, [selectionsBeforeFormulaPicks, onChangeSelections]));
|
|
4092
|
+
var sheets = putBackEntrySelections(state, true);
|
|
4093
|
+
store.set(entry_selections_atom_1.entrySelectionsAtom, { cell: state.cell, sheets: sheets });
|
|
4094
|
+
}, [store, putBackEntrySelections]));
|
|
3975
4095
|
/**
|
|
3976
4096
|
* Callback when editor value changes
|
|
3977
4097
|
*/
|
|
3978
4098
|
var onEditorChange = (0, use_editor_change_1.useEditorChange)({
|
|
3979
|
-
selections: selections,
|
|
3980
4099
|
onChangeActiveCell: onChangeActiveCell,
|
|
3981
|
-
|
|
4100
|
+
restoreSelections: restoreSelections,
|
|
3982
4101
|
getSelectionsFromFormula: getSelectionsFromFormula,
|
|
3983
4102
|
onChangeEditorValue: onChangeEditorValue,
|
|
3984
4103
|
formulaLocale: formulaLocale,
|
|
@@ -4026,11 +4145,12 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4026
4145
|
reopenEditor: reopenEditor,
|
|
4027
4146
|
onChangeActiveSheet: onChangeActiveSheet,
|
|
4028
4147
|
setActiveCell: setActiveCell,
|
|
4029
|
-
onComplete: restoreSelections,
|
|
4030
4148
|
onChange: onChange,
|
|
4031
4149
|
getCommitValidation: getCommitValidation,
|
|
4032
4150
|
showValidationAlert: showValidationAlert,
|
|
4033
|
-
|
|
4151
|
+
// Ctrl+Enter fills what the typing sheet had selected: not a range picked
|
|
4152
|
+
// for the formula, nor what another sheet in view has selected.
|
|
4153
|
+
selections: entrySelections !== null && entrySelections !== void 0 ? entrySelections : selections,
|
|
4034
4154
|
onChangeBatch: onChangeBatch,
|
|
4035
4155
|
batchHistory: batchHistory,
|
|
4036
4156
|
formulaLocale: formulaLocale,
|
|
@@ -4049,7 +4169,6 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4049
4169
|
sheetId: sheetId,
|
|
4050
4170
|
onChangeActiveSheet: onChangeActiveSheet,
|
|
4051
4171
|
setActiveCell: setActiveCell,
|
|
4052
|
-
onComplete: restoreSelections,
|
|
4053
4172
|
});
|
|
4054
4173
|
// The editor callbacks also drive the automatic Flash Fill suggestion: typing plans it, a
|
|
4055
4174
|
// keyboard commit of the same text accepts it, Escape drops it.
|
|
@@ -4194,7 +4313,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4194
4313
|
onChangeSelectionsFromGrid(targetSheetId, [{ range: range }]);
|
|
4195
4314
|
}, [setActiveCell, onChangeSelectionsFromGrid]);
|
|
4196
4315
|
// Excel's table hit zones (header top edge / corner / row left edge).
|
|
4197
|
-
var
|
|
4316
|
+
var _102 = (0, use_table_hit_zones_1.useTableHitZones)({
|
|
4198
4317
|
sheetId: sheetId,
|
|
4199
4318
|
tables: activeTables,
|
|
4200
4319
|
selections: selections,
|
|
@@ -4205,7 +4324,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4205
4324
|
getCellOffsetFromCoords: getCellOffsetFromCoords,
|
|
4206
4325
|
getScrollPosition: getScrollPosition,
|
|
4207
4326
|
onSelectRange: selectRangeFromMenu,
|
|
4208
|
-
}), tableHitCursor =
|
|
4327
|
+
}), tableHitCursor = _102.cursor, onMouseMoveTableHitZones = _102.onMouseMove, onMouseDownTableHitZones = _102.onMouseDown, clearTableHitZone = _102.clearHitZone;
|
|
4209
4328
|
/**
|
|
4210
4329
|
* Get context Menu component
|
|
4211
4330
|
*/
|
|
@@ -4310,7 +4429,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4310
4429
|
* Displays Context menu when user right clicks
|
|
4311
4430
|
* the grid
|
|
4312
4431
|
*/
|
|
4313
|
-
var
|
|
4432
|
+
var _103 = (0, use_context_menu_1.useContextMenu)({
|
|
4314
4433
|
getCellCoordsFromOffset: getCellCoordsFromOffset,
|
|
4315
4434
|
getRelativePositionFromOffset: getRelativePositionFromOffset,
|
|
4316
4435
|
isRowHeader: isRowHeader,
|
|
@@ -4320,7 +4439,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4320
4439
|
getScrollPosition: getScrollPosition,
|
|
4321
4440
|
ContextMenuWrapper: ContextMenuWrapper,
|
|
4322
4441
|
toPhysicalX: rightToLeft ? function (x) { return (0, grid_1.mirrorPointX)(x, width); } : undefined,
|
|
4323
|
-
}), onContextMenu =
|
|
4442
|
+
}), onContextMenu = _103.onContextMenu, contextMenuComponent = _103.contextMenuComponent, onRequestCloseContextMenu = _103.onRequestClose, showContextMenu = _103.showContextMenu;
|
|
4324
4443
|
/**
|
|
4325
4444
|
* Shortcut handlers for formatting
|
|
4326
4445
|
* TODO: Decide on the output
|
|
@@ -4449,7 +4568,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4449
4568
|
/**
|
|
4450
4569
|
* Allow grid to be ediable
|
|
4451
4570
|
*/
|
|
4452
|
-
var
|
|
4571
|
+
var _104 = (0, use_editable_1.useEditable)({
|
|
4453
4572
|
sheetId: sheetId,
|
|
4454
4573
|
enableEditOnEnterKey: enableEditOnEnterKey,
|
|
4455
4574
|
keymap: keymap,
|
|
@@ -4469,9 +4588,10 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4469
4588
|
frozenRows: frozenRows,
|
|
4470
4589
|
activeCell: activeCell,
|
|
4471
4590
|
selections: selections,
|
|
4472
|
-
// The commit key moves the active cell inside the
|
|
4473
|
-
// never inside a range picked for the formula
|
|
4474
|
-
|
|
4591
|
+
// The commit key moves the active cell inside the selection of the sheet
|
|
4592
|
+
// the entry is typed on: never inside a range picked for the formula, nor
|
|
4593
|
+
// inside what another sheet in view has selected.
|
|
4594
|
+
navigationSelections: entrySelections,
|
|
4475
4595
|
getSheetColumnCount: getSheetColumnCount,
|
|
4476
4596
|
getSheetRowCount: getSheetRowCount,
|
|
4477
4597
|
getValue: getEditorDisplayValue,
|
|
@@ -4508,7 +4628,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4508
4628
|
onCut: handleEditorCut,
|
|
4509
4629
|
tables: tables,
|
|
4510
4630
|
onInsertTableRow: onInsertTableRow,
|
|
4511
|
-
}), onMouseDownEditable =
|
|
4631
|
+
}), onMouseDownEditable = _104.onMouseDown, onDoubleClickEditable = _104.onDoubleClick, editorComponent = _104.editorComponent, isEditInProgress = _104.isEditInProgress, makeEditable = _104.makeEditable, editCell = _104.editCell, setEditorValue = _104.setEditorValue, hideEditor = _104.hideEditor, getNextFocusableCell = _104.getNextFocusableCell, submitEditor = _104.submitEditor, cancelEditor = _104.cancelEditor, commit = _104.commit, onKeyDownEditable = _104.onKeyDown;
|
|
4512
4632
|
// A typed entry Excel's limits refused reopens the editor with its text (#49969 FX-18).
|
|
4513
4633
|
// `makeEditable`, not `editCell`: the submit has just closed the editor, and `editCell` would
|
|
4514
4634
|
// still see this render's edit in progress and insert the text into the closed one.
|
|
@@ -4601,7 +4721,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4601
4721
|
/**
|
|
4602
4722
|
* Move rows and columns
|
|
4603
4723
|
*/
|
|
4604
|
-
var
|
|
4724
|
+
var _105 = (0, use_move_columns_rows_1.useMoveColumnsAndRows)({
|
|
4605
4725
|
getCellOffsetFromCoords: getCellOffsetFromCoords,
|
|
4606
4726
|
getCellCoordsFromOffset: getCellCoordsFromOffset,
|
|
4607
4727
|
getRelativePositionFromOffset: getRelativePositionFromOffset,
|
|
@@ -4625,11 +4745,11 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4625
4745
|
sheetId: sheetId,
|
|
4626
4746
|
disabled: isRestricted,
|
|
4627
4747
|
HeaderMoveDragComponent: HeaderMoveDragComponent,
|
|
4628
|
-
}), draggableColumns =
|
|
4748
|
+
}), draggableColumns = _105.draggableColumns, draggableRows = _105.draggableRows, isDraggingRowsAndColumns = _105.isDragging;
|
|
4629
4749
|
/**
|
|
4630
4750
|
* Header actions
|
|
4631
4751
|
*/
|
|
4632
|
-
var
|
|
4752
|
+
var _106 = (0, use_header_actions_1.useHeaderActions)({
|
|
4633
4753
|
activeCell: isSelectionInProgress || isFilling || isDragging ? null : hoveredCell,
|
|
4634
4754
|
getScrollPosition: getHeadingScrollPosition,
|
|
4635
4755
|
getWindowScrollPosition: getScrollPosition,
|
|
@@ -4659,7 +4779,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4659
4779
|
selectedRowHeaders: selectedRowHeaders,
|
|
4660
4780
|
selectedColumnHeaders: selectedColumnHeaders,
|
|
4661
4781
|
enableResizerOverflow: enableResizerOverflow,
|
|
4662
|
-
}), headerMenuComponent =
|
|
4782
|
+
}), headerMenuComponent = _106.headerMenuComponent, isHeaderMenuInFrozenColumn = _106.isHeaderMenuInFrozenColumn, headerResizer = _106.headerResizer, isDraggingHeader = _106.isDragging;
|
|
4663
4783
|
/**
|
|
4664
4784
|
* Close tooltip
|
|
4665
4785
|
*/
|
|
@@ -4706,7 +4826,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4706
4826
|
/**
|
|
4707
4827
|
* Show basicFilter panels
|
|
4708
4828
|
*/
|
|
4709
|
-
var
|
|
4829
|
+
var _107 = (0, use_filter_1.useFilter)({
|
|
4710
4830
|
sheetId: sheetId,
|
|
4711
4831
|
scale: scale,
|
|
4712
4832
|
theme: theme,
|
|
@@ -4731,9 +4851,9 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4731
4851
|
// Live filter state so the open popup tracks Auto-apply spec changes.
|
|
4732
4852
|
basicFilter: basicFilter,
|
|
4733
4853
|
tables: activeTables,
|
|
4734
|
-
}), showFilter =
|
|
4854
|
+
}), showFilter = _107.showFilter, hideFilter = _107.hideFilter, filterComponent = _107.filterComponent;
|
|
4735
4855
|
// Table resize
|
|
4736
|
-
var
|
|
4856
|
+
var _108 = (0, use_table_resizer_1.useTableResizer)({
|
|
4737
4857
|
sheetId: sheetId,
|
|
4738
4858
|
tables: tables !== null && tables !== void 0 ? tables : undefined,
|
|
4739
4859
|
theme: theme,
|
|
@@ -4744,7 +4864,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4744
4864
|
scrollToCell: scrollToCell,
|
|
4745
4865
|
onResizeTable: onResizeTable,
|
|
4746
4866
|
focusSheet: focusSheet,
|
|
4747
|
-
}), tableResizers =
|
|
4867
|
+
}), tableResizers = _108.tableResizers, isResizingTable = _108.isResizingTable;
|
|
4748
4868
|
/**
|
|
4749
4869
|
* Displays resizable/draggable charts
|
|
4750
4870
|
*/
|
|
@@ -4905,7 +5025,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4905
5025
|
var shownCharts = (0, react_1.useMemo)(function () { return shownObjectsBelowFrozenStart(charts); }, [charts, shownObjectsBelowFrozenStart]);
|
|
4906
5026
|
var shownEmbeds = (0, react_1.useMemo)(function () { return shownObjectsBelowFrozenStart(embeds); }, [embeds, shownObjectsBelowFrozenStart]);
|
|
4907
5027
|
var shownSlicers = (0, react_1.useMemo)(function () { return shownObjectsBelowFrozenStart(slicers); }, [slicers, shownObjectsBelowFrozenStart]);
|
|
4908
|
-
var
|
|
5028
|
+
var _109 = (0, use_embeds_charts_1.useEmbedsCharts)({
|
|
4909
5029
|
pageLayout: pageLayout,
|
|
4910
5030
|
getLinkedPictureSource: getLinkedPictureSource,
|
|
4911
5031
|
getSheetName: getSheetName,
|
|
@@ -4954,7 +5074,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
4954
5074
|
backgroundColor: cellBackgroundColor,
|
|
4955
5075
|
disabled: isRestricted,
|
|
4956
5076
|
readonly: readonly,
|
|
4957
|
-
}), chartComponents =
|
|
5077
|
+
}), chartComponents = _109.chartComponents, embedComponents = _109.embedComponents, slicerComponents = _109.slicerComponents, embedContextMenuComponent = _109.contextMenuComponent, onMouseDownCharts = _109.onMouseDown, requestChartContextMenu = _109.requestChartContextMenu, selectAllObjectsUnstable = _109.selectAllObjects;
|
|
4958
5078
|
// Select Objects (Find & Select): stable identity for the imperative handle.
|
|
4959
5079
|
var selectAllObjects = (0, use_callback_ref_1.useCallbackRef)(selectAllObjectsUnstable);
|
|
4960
5080
|
/**
|
|
@@ -5031,7 +5151,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
5031
5151
|
* The totals-function picker a totals cell's in-cell arrow opens (Excel):
|
|
5032
5152
|
* anchored at the cell's bottom-right corner like the filter dropdown.
|
|
5033
5153
|
*/
|
|
5034
|
-
var
|
|
5154
|
+
var _110 = tslib_1.__read((0, react_1.useState)(null), 2), totalsPicker = _110[0], setTotalsPicker = _110[1];
|
|
5035
5155
|
var closeTotalsPicker = (0, react_1.useCallback)(function () { return setTotalsPicker(null); }, []);
|
|
5036
5156
|
var handleTotalsArrowClick = (0, react_1.useCallback)(function (cell) {
|
|
5037
5157
|
var table = activeTables === null || activeTables === void 0 ? void 0 : activeTables.find(function (candidate) {
|
|
@@ -5469,7 +5589,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
5469
5589
|
/**
|
|
5470
5590
|
* Render Cells in the grid
|
|
5471
5591
|
*/
|
|
5472
|
-
var
|
|
5592
|
+
var _111 = tslib_1.__read((0, use_cell_renderer_1.useCellRenderer)({
|
|
5473
5593
|
sheetId: sheetId,
|
|
5474
5594
|
isTableTotalsCell: isTableTotalsCell,
|
|
5475
5595
|
onTotalsArrowClick: handleTotalsArrowClick,
|
|
@@ -5547,7 +5667,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
5547
5667
|
onOverflow: handleOverflow,
|
|
5548
5668
|
isComparing: isComparing,
|
|
5549
5669
|
getCellDiff: getCellDiff,
|
|
5550
|
-
}), 5), cellBackgroundRenderer =
|
|
5670
|
+
}), 5), cellBackgroundRenderer = _111[0], cellRenderer = _111[1], cellOverlayRenderer = _111[2], headerCellRenderer = _111[3], cellBackgroundsRenderer = _111[4];
|
|
5551
5671
|
/**
|
|
5552
5672
|
* When user selects a selection for moving
|
|
5553
5673
|
* If its a table, we select the entire column
|
|
@@ -5589,16 +5709,16 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
5589
5709
|
tokenizer: localeTokenizer,
|
|
5590
5710
|
});
|
|
5591
5711
|
// Selection move: drag a formula reference via its border covers
|
|
5592
|
-
var
|
|
5712
|
+
var _112 = (0, use_selection_move_1.useSelectionMove)({
|
|
5593
5713
|
getCellCoordsFromOffset: getCellCoordsFromOffset,
|
|
5594
5714
|
scrollToCell: scrollToCell,
|
|
5595
5715
|
tokenizer: localeTokenizer,
|
|
5596
|
-
}), onMouseDownMoveSelection =
|
|
5716
|
+
}), onMouseDownMoveSelection = _112.onMouseDownMoveSelection, isDraggingMoveSelection = _112.isDragging;
|
|
5597
5717
|
/**
|
|
5598
5718
|
* Selected chart: outline its source ranges on this sheet and re-bind
|
|
5599
5719
|
* them when a corner handle is dragged (Excel's chart data highlight).
|
|
5600
5720
|
*/
|
|
5601
|
-
var
|
|
5721
|
+
var _113 = (0, use_chart_source_ranges_1.useChartSourceRanges)({
|
|
5602
5722
|
charts: charts,
|
|
5603
5723
|
sheetId: sheetId,
|
|
5604
5724
|
getSheetName: getSheetName,
|
|
@@ -5607,7 +5727,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
5607
5727
|
getCellBounds: getCellBounds,
|
|
5608
5728
|
getCellCoordsFromOffset: getCellCoordsFromOffset,
|
|
5609
5729
|
scrollToCell: scrollToCell,
|
|
5610
|
-
}), chartSourceBorderStyles =
|
|
5730
|
+
}), chartSourceBorderStyles = _113.chartSourceBorderStyles, onMouseDownChartSourceResizeHandle = _113.onMouseDownChartSourceResizeHandle;
|
|
5611
5731
|
/**
|
|
5612
5732
|
* Hide fill handle
|
|
5613
5733
|
* 1. When user is in edit mode
|
|
@@ -5623,9 +5743,9 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
5623
5743
|
/**
|
|
5624
5744
|
* Flashing
|
|
5625
5745
|
*/
|
|
5626
|
-
var
|
|
5746
|
+
var _114 = (0, use_flash_1.useFlash)({
|
|
5627
5747
|
theme: theme,
|
|
5628
|
-
}), flash =
|
|
5748
|
+
}), flash = _114.flash, mark = _114.mark, unmark = _114.unmark, onFlashEnd = _114.onFlashEnd, flashingBorders = _114.flashingBorders;
|
|
5629
5749
|
// Cache hover ids
|
|
5630
5750
|
var cachedHoveredSelectionIds = (0, use_hovered_selection_ids_1.useHoveredSelectionIds)({
|
|
5631
5751
|
selections: selections,
|
|
@@ -5779,7 +5899,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
5779
5899
|
autoCorrectAnchorStyles,
|
|
5780
5900
|
]);
|
|
5781
5901
|
// Hidden column markers
|
|
5782
|
-
var
|
|
5902
|
+
var _115 = tslib_1.__read((0, use_hidden_dimension_markers_1.useHiddenDimensionMarkers)({
|
|
5783
5903
|
sheetId: sheetId,
|
|
5784
5904
|
columnMetadata: columnMetadata,
|
|
5785
5905
|
rowMetadata: rowMetadata,
|
|
@@ -5794,7 +5914,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
5794
5914
|
columnsAboveFrozenStart: columnsAboveFrozenStart,
|
|
5795
5915
|
HiddenRowMarkers: HiddenRowMarkers,
|
|
5796
5916
|
HiddenColumnMarkers: HiddenColumnMarkers,
|
|
5797
|
-
}), 4), hiddenColumnMarkers =
|
|
5917
|
+
}), 4), hiddenColumnMarkers = _115[0], frozenHiddenColumnMarkers = _115[1], hiddenRowMarkers = _115[2], frozenHiddenRowMarkers = _115[3];
|
|
5798
5918
|
// Zoom lister
|
|
5799
5919
|
var onMouseWheel = (0, use_scale_listener_1.useScaleListener)({
|
|
5800
5920
|
zoomSpeed: zoomSpeed,
|
|
@@ -137,8 +137,9 @@ export type UseEditableOptions<T extends CellData> = {
|
|
|
137
137
|
/**
|
|
138
138
|
* The selections a commit key moves the active cell inside
|
|
139
139
|
* (`getNextFocusableCell`). `selections` when omitted. While a formula is
|
|
140
|
-
* taking picks, `selections` holds the range being picked,
|
|
141
|
-
*
|
|
140
|
+
* taking picks, `selections` holds the range being picked, or is another
|
|
141
|
+
* sheet's altogether when the pick is made there; the move belongs inside
|
|
142
|
+
* what the sheet the entry is typed on had selected before any pick.
|
|
142
143
|
*/
|
|
143
144
|
navigationSelections?: SelectionArea[];
|
|
144
145
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-editable.d.ts","sourceRoot":"","sources":["../../../hooks/use-editable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,SAAS,EAIV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAIzE,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,QAAQ,IAAI;IACnD;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,iBA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,cAAc,CAAC;CAyrB1C,CAAC"}
|
|
@@ -3,16 +3,20 @@ import type { TextFormatRun } from "@rowsncolumns/ui";
|
|
|
3
3
|
import { type FormulaLocale, type ReferenceStyle } from "@rowsncolumns/utils";
|
|
4
4
|
import type { CanvasGridProps, SelectionAttributes } from "../components/canvas-grid/typings";
|
|
5
5
|
type UseEditorChangeProps = {
|
|
6
|
-
selections: SelectionArea<SelectionAttributes>[];
|
|
7
6
|
getSelectionsFromFormula(value: string, cell: CellInterface): SelectionArea<SelectionAttributes>[];
|
|
8
7
|
onChangeEditorValue: CanvasGridProps["onChangeEditorValue"];
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Takes the ranges picked for the formula being entered out of the sheets' selections: each
|
|
10
|
+
* sheet one was picked on gets its own selection back. A sheet nothing was picked on is left
|
|
11
|
+
* alone.
|
|
12
|
+
*/
|
|
13
|
+
restoreSelections?(): void;
|
|
10
14
|
onChangeActiveCell?: CanvasGridProps["onChangeActiveCell"];
|
|
11
15
|
/** The formula locale the editor text is written in; `onChangeEditorValue` receives canonical text. */
|
|
12
16
|
formulaLocale?: FormulaLocale;
|
|
13
17
|
/** The reference style the editor text is written in; R1C1 text is read as A1 for the edited cell. */
|
|
14
18
|
referenceStyle?: ReferenceStyle;
|
|
15
19
|
};
|
|
16
|
-
export declare const useEditorChange: ({
|
|
20
|
+
export declare const useEditorChange: ({ getSelectionsFromFormula, onChangeEditorValue, restoreSelections, onChangeActiveCell, formulaLocale, referenceStyle, }: UseEditorChangeProps) => (value: string, textFormatRuns: TextFormatRun[] | undefined | null, editingSheetId: number, activeCell: CellInterface) => void;
|
|
17
21
|
export {};
|
|
18
22
|
//# sourceMappingURL=use-editor-change.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-editor-change.d.ts","sourceRoot":"","sources":["../../../hooks/use-editor-change.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"use-editor-change.d.ts","sourceRoot":"","sources":["../../../hooks/use-editor-change.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,mCAAmC,CAAC;AAE3C,KAAK,oBAAoB,GAAG;IAC1B,wBAAwB,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,aAAa,GAClB,aAAa,CAAC,mBAAmB,CAAC,EAAE,CAAC;IACxC,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC5D;;;;OAIG;IACH,iBAAiB,CAAC,IAAI,IAAI,CAAC;IAC3B,kBAAkB,CAAC,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAC3D,uGAAuG;IACvG,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,sGAAsG;IACtG,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,0HAO7B,oBAAoB,aAUV,MAAM,kBACG,aAAa,EAAE,GAAG,SAAS,GAAG,IAAI,kBAClC,MAAM,cACV,aAAa,SAgF9B,CAAC"}
|