@univerjs/sheets-ui 0.6.0-nightly.202502111606 → 0.6.0-nightly.202502131606

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +46 -44
  3. package/lib/es/facade.js +88 -97
  4. package/lib/es/index.js +6565 -6564
  5. package/lib/types/common/keys.d.ts +1 -1
  6. package/lib/types/components/border-panel/border-line/icons/BorderDashDot.d.ts +1 -1
  7. package/lib/types/components/border-panel/border-line/icons/BorderDashDotDot.d.ts +1 -1
  8. package/lib/types/components/border-panel/border-line/icons/BorderDashed.d.ts +1 -1
  9. package/lib/types/components/border-panel/border-line/icons/BorderDotted.d.ts +1 -1
  10. package/lib/types/components/border-panel/border-line/icons/BorderHair.d.ts +1 -1
  11. package/lib/types/components/border-panel/border-line/icons/BorderMedium.d.ts +1 -1
  12. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDot.d.ts +1 -1
  13. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDotDot.d.ts +1 -1
  14. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashed.d.ts +1 -1
  15. package/lib/types/components/border-panel/border-line/icons/BorderThick.d.ts +1 -1
  16. package/lib/types/components/border-panel/border-line/icons/BorderThin.d.ts +1 -1
  17. package/lib/types/components/color-picker/index.d.ts +1 -1
  18. package/lib/types/components/color-picker/interface.d.ts +1 -1
  19. package/lib/types/components/const.d.ts +1 -1
  20. package/lib/types/components/font-family/index.d.ts +1 -1
  21. package/lib/types/components/font-family/interface.d.ts +1 -1
  22. package/lib/types/components/font-size/index.d.ts +1 -1
  23. package/lib/types/components/font-size/interface.d.ts +1 -1
  24. package/lib/types/components/menu-item-input/index.d.ts +1 -1
  25. package/lib/types/consts/plugin-name.d.ts +1 -1
  26. package/lib/types/consts/ui-name.d.ts +1 -1
  27. package/lib/types/controllers/clipboard/const.d.ts +1 -1
  28. package/lib/types/controllers/editor/utils/{isEmbeddingFormulaEditor.d.ts → is-embedding-formula-editor.d.ts} +1 -1
  29. package/lib/types/controllers/editor/utils/{isRangeSelector.d.ts → is-range-selector.d.ts} +1 -1
  30. package/lib/types/controllers/utils/cell-tools.d.ts +1 -1
  31. package/lib/types/facade/f-event.d.ts +3 -2
  32. package/lib/types/facade/f-univer.d.ts +4 -6
  33. package/lib/types/facade/index.d.ts +1 -1
  34. package/lib/types/index.d.ts +4 -4
  35. package/lib/types/locale/zh-CN.d.ts +1 -1
  36. package/lib/types/services/editor-bridge.service.d.ts +2 -0
  37. package/lib/types/views/cell-alert/index.d.ts +1 -1
  38. package/lib/types/views/clipboard/ClipboardPopupMenu.d.ts +1 -1
  39. package/lib/types/views/count-bar/CountBar.d.ts +1 -1
  40. package/lib/types/views/count-bar/ZoomSlider.d.ts +1 -1
  41. package/lib/types/views/count-bar/index.d.ts +1 -1
  42. package/lib/types/views/defined-name/DefinedName.d.ts +1 -1
  43. package/lib/types/views/defined-name/DefinedNameContainer.d.ts +1 -1
  44. package/lib/types/views/defined-name/DefinedNameOverlay.d.ts +1 -1
  45. package/lib/types/views/defined-name/component-name.d.ts +1 -1
  46. package/lib/types/views/editor-container/index.d.ts +1 -1
  47. package/lib/types/views/formula-bar/FormulaBar.d.ts +1 -1
  48. package/lib/types/views/formula-bar/index.d.ts +1 -1
  49. package/lib/types/views/mobile/sheet-bar/MobileSheetBar.d.ts +1 -1
  50. package/lib/types/views/operate-container/index.d.ts +1 -1
  51. package/lib/types/views/permission/error-msg-dialog/index.d.ts +1 -1
  52. package/lib/types/views/permission/error-msg-dialog/interface.d.ts +1 -1
  53. package/lib/types/views/permission/extensions/protect-background-img.d.ts +1 -1
  54. package/lib/types/views/permission/index.d.ts +1 -1
  55. package/lib/types/views/permission/panel-list/constant.d.ts +1 -1
  56. package/lib/types/views/permission/panel-list/index.d.ts +1 -1
  57. package/lib/types/views/permission/permission-dialog/index.d.ts +1 -1
  58. package/lib/types/views/permission/user-dialog/constant.d.ts +1 -1
  59. package/lib/types/views/permission/user-dialog/index.d.ts +1 -1
  60. package/lib/types/views/sheet-bar/SheetBar.d.ts +1 -1
  61. package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.d.ts +1 -1
  62. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/animate.d.ts +1 -1
  63. package/lib/types/views/sheet-container/SheetContainer.d.ts +1 -1
  64. package/lib/types/views/status-bar/CopyableStatisticItem.d.ts +1 -1
  65. package/lib/types/views/status-bar/StatusBar.d.ts +1 -1
  66. package/lib/umd/facade.js +1 -1
  67. package/lib/umd/index.js +45 -43
  68. package/package.json +15 -15
  69. /package/lib/types/hooks/{useHighlightRange.d.ts → use-highlight-range.d.ts} +0 -0
package/lib/es/facade.js CHANGED
@@ -1,11 +1,12 @@
1
- import { FUniver as te, ICommandService as P, CanceledError as j, IUniverInstanceService as A, RichTextValue as O, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as W, LifecycleService as F, DisposableCollection as y, LifecycleStages as L, UniverInstanceType as ce, ILogService as D, toDisposable as E, awaitTime as de, InterceptorEffectEnum as he, FEventName as re, generateRandomId as le } from "@univerjs/core";
1
+ import { ICommandService as P, CanceledError as j, IUniverInstanceService as A, RichTextValue as O, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as W, LifecycleService as L, DisposableCollection as y, LifecycleStages as F, UniverInstanceType as ce, ILogService as T, toDisposable as b, awaitTime as de, InterceptorEffectEnum as he, generateRandomId as le } from "@univerjs/core";
2
+ import { FUniver as te, FEventName as re } from "@univerjs/core/facade";
2
3
  import { RichTextEditingMutation as ge } from "@univerjs/docs";
3
4
  import { IRenderManagerService as m, DeviceInputEventType as N, SHEET_VIEWPORT_KEY as ue, sheetContentViewportKeys as ve } from "@univerjs/engine-render";
4
- import { SheetsSelectionsService as Se, COMMAND_LISTENER_SKELETON_CHANGE as Ce, getSkeletonChangedEffectedRange as me, SheetInterceptorService as Ee, INTERCEPTOR_POINT as be, InterceptCellContentPriority as pe } from "@univerjs/sheets";
5
- import { SetCellEditVisibleOperation as k, IEditorBridgeService as H, SetZoomRatioCommand as z, HoverManagerService as w, DragManagerService as U, SheetScrollManagerService as T, SheetPasteShortKeyCommand as V, ISheetClipboardService as ne, SheetSkeletonManagerService as R, SHEET_VIEW_KEY as f, ISheetSelectionRenderService as x, ChangeZoomRatioCommand as we, SheetsScrollRenderController as fe, SetWorksheetColAutoWidthCommand as ke, SetColumnHeaderHeightCommand as Ie, SetRowHeaderWidthCommand as _e, SheetCanvasPopManagerService as Z, CellAlertManagerService as Pe, IMarkSelectionService as Re } from "@univerjs/sheets-ui";
5
+ import { SheetsSelectionsService as Ce, COMMAND_LISTENER_SKELETON_CHANGE as Se, getSkeletonChangedEffectedRange as me, InterceptCellContentPriority as be, SheetInterceptorService as Ee, INTERCEPTOR_POINT as pe } from "@univerjs/sheets";
6
+ import { SetCellEditVisibleOperation as k, IEditorBridgeService as H, SetZoomRatioCommand as z, HoverManagerService as w, DragManagerService as U, SheetScrollManagerService as D, SheetPasteShortKeyCommand as V, ISheetClipboardService as ne, SheetSkeletonManagerService as R, SHEET_VIEW_KEY as f, ISheetSelectionRenderService as x, ChangeZoomRatioCommand as we, SheetsScrollRenderController as fe, SetWorksheetColAutoWidthCommand as ke, SetColumnHeaderHeightCommand as Ie, SetRowHeaderWidthCommand as _e, SheetCanvasPopManagerService as Z, CellAlertManagerService as Pe, IMarkSelectionService as Re } from "@univerjs/sheets-ui";
6
7
  import { FSheetHooks as $, FWorkbook as ie, FWorksheet as oe, FPermission as se, FRange as ae } from "@univerjs/sheets/facade";
7
8
  import { KeyCode as B, CutCommand as K, CopyCommand as Y, PasteCommand as X, IClipboardInterfaceService as He, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as J, HTML_CLIPBOARD_MIME_TYPE as G, supportClipboardAPI as q, ISidebarService as Me, IDialogService as ye, ComponentManager as Q } from "@univerjs/ui";
8
- import { filter as S, combineLatest as Ue } from "rxjs";
9
+ import { filter as C, combineLatest as Ue } from "rxjs";
9
10
  class xe extends te {
10
11
  // eslint-disable-next-line max-lines-per-function
11
12
  _initSheetUIEvent(e) {
@@ -16,12 +17,12 @@ class xe extends te {
16
17
  if (t.id !== k.id) return;
17
18
  const n = this.getActiveSheet();
18
19
  if (!n) return;
19
- const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
20
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: S } = g, v = c.getEditLocation();
20
21
  if (u) {
21
22
  const h = {
22
23
  row: v.row,
23
24
  column: v.column,
24
- eventType: C,
25
+ eventType: S,
25
26
  keycode: l,
26
27
  workbook: o,
27
28
  worksheet: s,
@@ -37,18 +38,18 @@ class xe extends te {
37
38
  if (t.id !== k.id) return;
38
39
  const n = this.getActiveSheet();
39
40
  if (!n) return;
40
- const { workbook: o, worksheet: s } = n, c = e.get(H), g = e.get(A), u = t.params, { visible: l, keycode: C, eventType: v } = u, h = c.getEditLocation();
41
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = e.get(A), u = t.params, { visible: l, keycode: S, eventType: v } = u, h = c.getEditLocation();
41
42
  if (!l) {
42
43
  const I = {
43
44
  row: h.row,
44
45
  column: h.column,
45
46
  eventType: v,
46
- keycode: C,
47
+ keycode: S,
47
48
  workbook: o,
48
49
  worksheet: s,
49
50
  isZenEditor: !1,
50
51
  value: O.create(g.getUnit(W).getSnapshot()),
51
- isConfirm: C !== B.ESC
52
+ isConfirm: S !== B.ESC
52
53
  };
53
54
  if (this.fireEvent(this.Event.BeforeSheetEditEnd, I), I.cancel)
54
55
  throw new j();
@@ -60,12 +61,12 @@ class xe extends te {
60
61
  if (t.id !== k.id) return;
61
62
  const n = this.getCommandSheetTarget(t);
62
63
  if (!n) return;
63
- const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
64
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: S } = g, v = c.getEditLocation();
64
65
  if (u) {
65
66
  const h = {
66
67
  row: v.row,
67
68
  column: v.column,
68
- eventType: C,
69
+ eventType: S,
69
70
  keycode: l,
70
71
  workbook: o,
71
72
  worksheet: s,
@@ -80,12 +81,12 @@ class xe extends te {
80
81
  if (t.id !== k.id) return;
81
82
  const n = this.getCommandSheetTarget(t);
82
83
  if (!n) return;
83
- const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
84
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: S } = g, v = c.getEditLocation();
84
85
  if (!u) {
85
86
  const h = {
86
87
  row: v.row,
87
88
  column: v.column,
88
- eventType: C,
89
+ eventType: S,
89
90
  keycode: l,
90
91
  workbook: o,
91
92
  worksheet: s,
@@ -105,10 +106,10 @@ class xe extends te {
105
106
  if (!c.isVisible().visible) return;
106
107
  const { unitId: l } = u;
107
108
  if (l === W) {
108
- const { row: C, column: v } = c.getEditLocation(), h = {
109
+ const { row: S, column: v } = c.getEditLocation(), h = {
109
110
  workbook: o,
110
111
  worksheet: s,
111
- row: C,
112
+ row: S,
112
113
  column: v,
113
114
  value: O.create(g.getUnit(W).getSnapshot()),
114
115
  isZenEditor: !1
@@ -144,23 +145,20 @@ class xe extends te {
144
145
  })
145
146
  );
146
147
  }
147
- /**
148
- * @ignore
149
- */
150
148
  // eslint-disable-next-line max-lines-per-function
151
149
  _initObserverListener(e) {
152
150
  const t = e.get(A).getFocusedUnit(), n = t == null ? void 0 : t.getUnitId(), o = e.get(m);
153
151
  if (n) {
154
- const l = e.get(F), C = new y();
152
+ const l = e.get(L), S = new y();
155
153
  this.disposeWithMe(l.lifecycle$.subscribe((v) => {
156
- if (v < L.Rendered) return;
157
- C.dispose();
154
+ if (v < F.Rendered) return;
155
+ S.dispose();
158
156
  const h = e.get(w), I = e.get(U);
159
157
  h && (this.registerEventHandler(
160
158
  this.Event.CellClicked,
161
159
  () => {
162
160
  var d;
163
- return (d = h.currentClickedCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
161
+ return (d = h.currentClickedCell$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
164
162
  const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
165
163
  a && this.fireEvent(this.Event.CellClicked, {
166
164
  ...a,
@@ -174,7 +172,7 @@ class xe extends te {
174
172
  this.Event.CellHover,
175
173
  () => {
176
174
  var d;
177
- return (d = h.currentRichText$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
175
+ return (d = h.currentRichText$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
178
176
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
179
177
  a && this.fireEvent(this.Event.CellHover, {
180
178
  ...a,
@@ -188,7 +186,7 @@ class xe extends te {
188
186
  this.Event.CellPointerDown,
189
187
  () => {
190
188
  var d;
191
- return (d = h.currentPointerDownCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
189
+ return (d = h.currentPointerDownCell$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
192
190
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
193
191
  a && this.fireEvent(this.Event.CellPointerDown, {
194
192
  ...a,
@@ -202,7 +200,7 @@ class xe extends te {
202
200
  this.Event.CellPointerUp,
203
201
  () => {
204
202
  var d;
205
- return (d = h.currentPointerUpCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
203
+ return (d = h.currentPointerUpCell$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
206
204
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
207
205
  a && this.fireEvent(this.Event.CellPointerUp, {
208
206
  ...a,
@@ -216,7 +214,7 @@ class xe extends te {
216
214
  this.Event.CellPointerMove,
217
215
  () => {
218
216
  var d;
219
- return (d = h.currentCellPosWithEvent$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
217
+ return (d = h.currentCellPosWithEvent$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
220
218
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
221
219
  a && this.fireEvent(this.Event.CellPointerMove, {
222
220
  ...a,
@@ -230,7 +228,7 @@ class xe extends te {
230
228
  this.Event.DragOver,
231
229
  () => {
232
230
  var d;
233
- return (d = I.currentCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
231
+ return (d = I.currentCell$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
234
232
  const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
235
233
  a && this.fireEvent(this.Event.DragOver, {
236
234
  ...a,
@@ -244,7 +242,7 @@ class xe extends te {
244
242
  this.Event.Drop,
245
243
  () => {
246
244
  var d;
247
- return (d = I.endCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
245
+ return (d = I.endCell$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
248
246
  const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
249
247
  a && this.fireEvent(this.Event.Drop, {
250
248
  ...a,
@@ -258,7 +256,7 @@ class xe extends te {
258
256
  this.Event.RowHeaderClick,
259
257
  () => {
260
258
  var d;
261
- return (d = h.currentRowHeaderClick$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
259
+ return (d = h.currentRowHeaderClick$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
262
260
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
263
261
  a && this.fireEvent(this.Event.RowHeaderClick, {
264
262
  ...a,
@@ -270,7 +268,7 @@ class xe extends te {
270
268
  this.Event.RowHeaderPointerDown,
271
269
  () => {
272
270
  var d;
273
- return (d = h.currentRowHeaderPointerDown$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
271
+ return (d = h.currentRowHeaderPointerDown$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
274
272
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
275
273
  a && this.fireEvent(this.Event.RowHeaderPointerDown, {
276
274
  ...a,
@@ -282,7 +280,7 @@ class xe extends te {
282
280
  this.Event.RowHeaderPointerUp,
283
281
  () => {
284
282
  var d;
285
- return (d = h.currentRowHeaderPointerUp$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
283
+ return (d = h.currentRowHeaderPointerUp$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
286
284
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
287
285
  a && this.fireEvent(this.Event.RowHeaderPointerUp, {
288
286
  ...a,
@@ -294,7 +292,7 @@ class xe extends te {
294
292
  this.Event.RowHeaderHover,
295
293
  () => {
296
294
  var d;
297
- return (d = h.currentHoveredRowHeader$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
295
+ return (d = h.currentHoveredRowHeader$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
298
296
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
299
297
  a && this.fireEvent(this.Event.RowHeaderHover, {
300
298
  ...a,
@@ -306,7 +304,7 @@ class xe extends te {
306
304
  this.Event.ColumnHeaderClick,
307
305
  () => {
308
306
  var d;
309
- return (d = h.currentColHeaderClick$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
307
+ return (d = h.currentColHeaderClick$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
310
308
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
311
309
  a && this.fireEvent(this.Event.ColumnHeaderClick, {
312
310
  ...a,
@@ -318,7 +316,7 @@ class xe extends te {
318
316
  this.Event.ColumnHeaderPointerDown,
319
317
  () => {
320
318
  var d;
321
- return (d = h.currentColHeaderPointerDown$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
319
+ return (d = h.currentColHeaderPointerDown$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
322
320
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
323
321
  a && this.fireEvent(this.Event.ColumnHeaderPointerDown, {
324
322
  ...a,
@@ -330,7 +328,7 @@ class xe extends te {
330
328
  this.Event.ColumnHeaderPointerUp,
331
329
  () => {
332
330
  var d;
333
- return (d = h.currentColHeaderPointerUp$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
331
+ return (d = h.currentColHeaderPointerUp$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
334
332
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
335
333
  a && this.fireEvent(this.Event.ColumnHeaderPointerUp, {
336
334
  ...a,
@@ -342,7 +340,7 @@ class xe extends te {
342
340
  this.Event.ColumnHeaderHover,
343
341
  () => {
344
342
  var d;
345
- return (d = h.currentHoveredColHeader$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
343
+ return (d = h.currentHoveredColHeader$) == null ? void 0 : d.pipe(C((i) => !!i)).subscribe((i) => {
346
344
  const a = this.getSheetTarget(i.unitId, i.subUnitId);
347
345
  a && this.fireEvent(this.Event.ColumnHeaderHover, {
348
346
  ...a,
@@ -351,23 +349,23 @@ class xe extends te {
351
349
  });
352
350
  }
353
351
  ));
354
- })), this.disposeWithMe(C);
352
+ })), this.disposeWithMe(S);
355
353
  }
356
354
  const s = /* @__PURE__ */ new Map();
357
355
  let c;
358
- const g = e.get(F), u = Ue([
356
+ const g = e.get(L), u = Ue([
359
357
  o.created$,
360
358
  g.lifecycle$
361
359
  ]);
362
- this.disposeWithMe(u.subscribe(([l, C]) => {
360
+ this.disposeWithMe(u.subscribe(([l, S]) => {
363
361
  var i;
364
- if (l.type === ce.UNIVER_SHEET && (c = l), C <= L.Rendered) return;
362
+ if (l.type === ce.UNIVER_SHEET && (c = l), S <= F.Rendered) return;
365
363
  const v = new y();
366
364
  if (!c) return;
367
365
  const h = this.getWorkbook(c.unitId);
368
366
  if (!h) return;
369
367
  s.get(c.unitId) && ((i = s.get(c.unitId)) == null || i.dispose()), s.set(c.unitId, v);
370
- const I = c.with(T), d = c.with(Se);
368
+ const I = c.with(D), d = c.with(Ce);
371
369
  v.add(this.registerEventHandler(
372
370
  this.Event.Scroll,
373
371
  () => I.validViewportScrollInfo$.subscribe((a) => {
@@ -380,47 +378,47 @@ class xe extends te {
380
378
  )), v.add(this.registerEventHandler(
381
379
  this.Event.SelectionMoveStart,
382
380
  () => d.selectionMoveStart$.subscribe((a) => {
383
- var b;
381
+ var E;
384
382
  this.fireEvent(this.Event.SelectionMoveStart, {
385
383
  workbook: h,
386
384
  worksheet: h.getActiveSheet(),
387
- selections: (b = a == null ? void 0 : a.map((_) => _.range)) != null ? b : []
385
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
388
386
  });
389
387
  })
390
388
  )), v.add(this.registerEventHandler(
391
389
  this.Event.SelectionMoving,
392
390
  () => d.selectionMoving$.subscribe((a) => {
393
- var b;
391
+ var E;
394
392
  this.fireEvent(this.Event.SelectionMoving, {
395
393
  workbook: h,
396
394
  worksheet: h.getActiveSheet(),
397
- selections: (b = a == null ? void 0 : a.map((_) => _.range)) != null ? b : []
395
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
398
396
  });
399
397
  })
400
398
  )), v.add(this.registerEventHandler(
401
399
  this.Event.SelectionMoveEnd,
402
400
  () => d.selectionMoveEnd$.subscribe((a) => {
403
- var b;
401
+ var E;
404
402
  this.fireEvent(this.Event.SelectionMoveEnd, {
405
403
  workbook: h,
406
404
  worksheet: h.getActiveSheet(),
407
- selections: (b = a == null ? void 0 : a.map((_) => _.range)) != null ? b : []
405
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
408
406
  });
409
407
  })
410
408
  )), v.add(this.registerEventHandler(
411
409
  this.Event.SelectionChanged,
412
410
  () => d.selectionChanged$.subscribe((a) => {
413
- var b;
411
+ var E;
414
412
  this.fireEvent(this.Event.SelectionChanged, {
415
413
  workbook: h,
416
414
  worksheet: h.getActiveSheet(),
417
- selections: (b = a == null ? void 0 : a.map((_) => _.range)) != null ? b : []
415
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
418
416
  });
419
417
  })
420
418
  )), c = null, this.disposeWithMe(v);
421
419
  })), this.disposeWithMe(o.disposed$.subscribe((l) => {
422
- var C;
423
- (C = s.get(l)) == null || C.dispose(), s.delete(l);
420
+ var S;
421
+ (S = s.get(l)) == null || S.dispose(), s.delete(l);
424
422
  })), this.disposeWithMe(() => {
425
423
  s.forEach((l) => {
426
424
  l.dispose();
@@ -432,7 +430,7 @@ class xe extends te {
432
430
  */
433
431
  // eslint-disable-next-line max-lines-per-function
434
432
  _initialize(e) {
435
- this._initSheetUIEvent(e);
433
+ this._initSheetUIEvent(e), this._initObserverListener(e);
436
434
  const r = e.get(P);
437
435
  this.registerEventHandler(
438
436
  this.Event.BeforeClipboardChange,
@@ -470,10 +468,10 @@ class xe extends te {
470
468
  ), t;
471
469
  }
472
470
  ), this.disposeWithMe(r.onCommandExecuted((t) => {
473
- if (Ce.indexOf(t.id) > -1) {
471
+ if (Se.indexOf(t.id) > -1) {
474
472
  const n = this.getActiveSheet();
475
473
  if (!n) return;
476
- const o = me(t).map((s) => {
474
+ const o = me(t, n.worksheet.getMaxColumns()).map((s) => {
477
475
  var c, g;
478
476
  return (g = (c = this.getWorkbook(s.unitId)) == null ? void 0 : c.getSheetBySheetId(s.subUnitId)) == null ? void 0 : g.getRange(s.range);
479
477
  }).filter(Boolean);
@@ -577,7 +575,7 @@ class xe extends te {
577
575
  }
578
576
  async _beforeClipboardPasteAsync() {
579
577
  if (!q()) {
580
- this._injector.get(D).warn("[Facade]: The navigator object only supports the browser environment");
578
+ this._injector.get(T).warn("[Facade]: The navigator object only supports the browser environment");
581
579
  return;
582
580
  }
583
581
  const e = await this._generateClipboardPasteParamAsync();
@@ -586,7 +584,7 @@ class xe extends te {
586
584
  }
587
585
  async _clipboardPasteAsync() {
588
586
  if (!q()) {
589
- this._injector.get(D).warn("[Facade]: The navigator object only supports the browser environment");
587
+ this._injector.get(T).warn("[Facade]: The navigator object only supports the browser environment");
590
588
  return;
591
589
  }
592
590
  const e = await this._generateClipboardPasteParamAsync();
@@ -614,19 +612,19 @@ class xe extends te {
614
612
  }
615
613
  registerSheetRowHeaderExtension(e, ...r) {
616
614
  const t = this._getSheetRenderComponent(e, f.ROW), n = t.register(...r);
617
- return E(() => {
615
+ return b(() => {
618
616
  n.dispose(), t.makeDirty(!0);
619
617
  });
620
618
  }
621
619
  registerSheetColumnHeaderExtension(e, ...r) {
622
620
  const t = this._getSheetRenderComponent(e, f.COLUMN), n = t.register(...r);
623
- return E(() => {
621
+ return b(() => {
624
622
  n.dispose(), t.makeDirty(!0);
625
623
  });
626
624
  }
627
625
  registerSheetMainExtension(e, ...r) {
628
626
  const t = this._getSheetRenderComponent(e, f.MAIN), n = t.register(...r);
629
- return E(() => {
627
+ return b(() => {
630
628
  n.dispose(), t.makeDirty(!0);
631
629
  });
632
630
  }
@@ -655,7 +653,7 @@ class xe extends te {
655
653
  }
656
654
  }
657
655
  te.extend(xe);
658
- class De extends ie {
656
+ class Te extends ie {
659
657
  openSiderbar(e) {
660
658
  return this._logDeprecation("openSiderbar"), this._injector.get(Me).open(e);
661
659
  }
@@ -670,7 +668,7 @@ class De extends ie {
670
668
  return t;
671
669
  }
672
670
  _logDeprecation(e) {
673
- this._injector.get(D).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
671
+ this._injector.get(T).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
674
672
  }
675
673
  generateCellParams(e) {
676
674
  const r = this.getActiveSheet();
@@ -683,50 +681,50 @@ class De extends ie {
683
681
  }
684
682
  onCellClick(e) {
685
683
  const r = this._injector.get(w);
686
- return E(
687
- r.currentClickedCell$.pipe(S((t) => !!t)).subscribe((t) => {
684
+ return b(
685
+ r.currentClickedCell$.pipe(C((t) => !!t)).subscribe((t) => {
688
686
  e(t);
689
687
  })
690
688
  );
691
689
  }
692
690
  onCellHover(e) {
693
691
  const r = this._injector.get(w);
694
- return E(
695
- r.currentRichText$.pipe(S((t) => !!t)).subscribe(e)
692
+ return b(
693
+ r.currentRichText$.pipe(C((t) => !!t)).subscribe(e)
696
694
  );
697
695
  }
698
696
  onCellPointerDown(e) {
699
697
  const r = this._injector.get(w);
700
- return E(
698
+ return b(
701
699
  r.currentPointerDownCell$.subscribe(e)
702
700
  );
703
701
  }
704
702
  onCellPointerUp(e) {
705
703
  const r = this._injector.get(w);
706
- return E(
704
+ return b(
707
705
  r.currentPointerUpCell$.subscribe(e)
708
706
  );
709
707
  }
710
708
  onCellPointerMove(e) {
711
709
  const r = this._injector.get(w);
712
- return E(
713
- r.currentCellPosWithEvent$.pipe(S((t) => !!t)).subscribe((t) => {
710
+ return b(
711
+ r.currentCellPosWithEvent$.pipe(C((t) => !!t)).subscribe((t) => {
714
712
  e(t, t.event);
715
713
  })
716
714
  );
717
715
  }
718
716
  onDragOver(e) {
719
717
  const r = this._injector.get(U);
720
- return E(
721
- r.currentCell$.pipe(S((t) => !!t)).subscribe((t) => {
718
+ return b(
719
+ r.currentCell$.pipe(C((t) => !!t)).subscribe((t) => {
722
720
  e(t);
723
721
  })
724
722
  );
725
723
  }
726
724
  onDrop(e) {
727
725
  const r = this._injector.get(U);
728
- return E(
729
- r.endCell$.pipe(S((t) => !!t)).subscribe((t) => {
726
+ return b(
727
+ r.endCell$.pipe(C((t) => !!t)).subscribe((t) => {
730
728
  e(t);
731
729
  })
732
730
  );
@@ -760,7 +758,7 @@ class De extends ie {
760
758
  */
761
759
  getScrollStateBySheetId(e) {
762
760
  const r = this._workbook.getUnitId(), n = this._injector.get(m).getRenderById(r);
763
- return n ? n.with(T).getScrollStateByParam({ unitId: r, sheetId: e }) : null;
761
+ return n ? n.with(D).getScrollStateByParam({ unitId: r, sheetId: e }) : null;
764
762
  }
765
763
  disableSelection() {
766
764
  const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
@@ -779,8 +777,8 @@ class De extends ie {
779
777
  return t && t.with(x).showSelection(), this;
780
778
  }
781
779
  }
782
- ie.extend(De);
783
- class Te extends oe {
780
+ ie.extend(Te);
781
+ class De extends oe {
784
782
  refreshCanvas() {
785
783
  const e = this._injector.get(m), r = this._fWorkbook.id, t = e.getRenderById(r);
786
784
  if (!t)
@@ -830,18 +828,18 @@ class Te extends oe {
830
828
  sheetViewStartColumn: 0,
831
829
  sheetViewStartRow: 0
832
830
  }, r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(m).getRenderById(r);
833
- return o && o.with(T).getScrollStateByParam({ unitId: r, sheetId: t }) || e;
831
+ return o && o.with(D).getScrollStateByParam({ unitId: r, sheetId: t }) || e;
834
832
  }
835
833
  onScroll(e) {
836
834
  var o;
837
- const r = this._workbook.getUnitId(), n = (o = this._injector.get(m).getRenderById(r)) == null ? void 0 : o.with(T);
835
+ const r = this._workbook.getUnitId(), n = (o = this._injector.get(m).getRenderById(r)) == null ? void 0 : o.with(D);
838
836
  if (n) {
839
837
  const s = n.validViewportScrollInfo$.subscribe((c) => {
840
838
  e(c);
841
839
  });
842
- return E(s);
840
+ return b(s);
843
841
  }
844
- return E(() => {
842
+ return b(() => {
845
843
  });
846
844
  }
847
845
  getSkeleton() {
@@ -910,7 +908,7 @@ class Te extends oe {
910
908
  return s;
911
909
  }
912
910
  }
913
- oe.extend(Te);
911
+ oe.extend(De);
914
912
  class Be extends se {
915
913
  setPermissionDialogVisible(e) {
916
914
  this._permissionService.setShowComponents(e);
@@ -919,19 +917,19 @@ class Be extends se {
919
917
  se.extend(Be);
920
918
  class Ae extends $ {
921
919
  onCellPointerMove(e) {
922
- return E(this._injector.get(w).currentPosition$.subscribe(e));
920
+ return b(this._injector.get(w).currentPosition$.subscribe(e));
923
921
  }
924
922
  onCellPointerOver(e) {
925
- return E(this._injector.get(w).currentCell$.subscribe(e));
923
+ return b(this._injector.get(w).currentCell$.subscribe(e));
926
924
  }
927
925
  onCellDragOver(e) {
928
- return E(this._injector.get(U).currentCell$.subscribe(e));
926
+ return b(this._injector.get(U).currentCell$.subscribe(e));
929
927
  }
930
928
  onCellDrop(e) {
931
- return E(this._injector.get(U).endCell$.subscribe(e));
929
+ return b(this._injector.get(U).endCell$.subscribe(e));
932
930
  }
933
- onCellRender(e, r = he.Style, t = pe.DATA_VALIDATION) {
934
- return this._injector.get(Ee).intercept(be.CELL_CONTENT, {
931
+ onCellRender(e, r = he.Style, t = be.DATA_VALIDATION) {
932
+ return this._injector.get(Ee).intercept(pe.CELL_CONTENT, {
935
933
  effect: r,
936
934
  handler: (n, o, s) => s({
937
935
  ...n,
@@ -962,14 +960,7 @@ const M = {
962
960
  CellPointerDown: "CellPointerDown",
963
961
  CellPointerUp: "CellPointerUp",
964
962
  CellPointerMove: "CellPointerMove",
965
- CellHover: "CellHover",
966
- DragOver: "DragOver",
967
- Drop: "Drop",
968
- Scroll: "Scroll",
969
- SelectionMoveStart: "SelectionMoveStart",
970
- SelectionMoving: "SelectionMoving",
971
- SelectionMoveEnd: "SelectionMoveEnd",
972
- SelectionChanged: "SelectionChanged"
963
+ CellHover: "CellHover"
973
964
  };
974
965
  class We extends re {
975
966
  get BeforeClipboardChange() {
@@ -1067,7 +1058,7 @@ re.extend(We);
1067
1058
  class $e extends ae {
1068
1059
  getCell() {
1069
1060
  var c;
1070
- const e = this._injector.get(m), r = this._injector.get(D), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), o = e.getRenderById(t), s = (c = o == null ? void 0 : o.with(R).getSkeletonParam(n)) == null ? void 0 : c.skeleton;
1061
+ const e = this._injector.get(m), r = this._injector.get(T), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), o = e.getRenderById(t), s = (c = o == null ? void 0 : o.with(R).getSkeletonParam(n)) == null ? void 0 : c.skeleton;
1071
1062
  if (!s)
1072
1063
  throw r.error("[Facade]: `FRange.getCell` can only be called in current worksheet"), new Error("`FRange.getCell` can only be called in current worksheet");
1073
1064
  return s.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn);
@@ -1142,7 +1133,7 @@ class $e extends ae {
1142
1133
  const t = this._injector.get(Re), n = t.addShape({ range: this._range, style: e, primary: r });
1143
1134
  if (!n)
1144
1135
  throw new Error("Failed to highlight current range");
1145
- return E(() => {
1136
+ return b(() => {
1146
1137
  t.removeShape(n);
1147
1138
  });
1148
1139
  }