@univerjs/sheets-formula-ui 0.15.4 → 0.15.5

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/lib/es/index.js CHANGED
@@ -2,12 +2,12 @@ var Xr = Object.defineProperty;
2
2
  var Qr = (e, t, n) => t in e ? Xr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var j = (e, t, n) => Qr(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { CommandType as be, ICommandService as pe, createIdentifier as Jr, IContextService as hn, IUniverInstanceService as ne, Rectangle as fn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as gn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as ir, DEFAULT_EMPTY_DOCUMENT_VALUE as cr, isRealNum as eo, CellValueType as $n, getCellValueType as to, Inject as q, Disposable as ze, ObjectMatrix as Fe, Range as no, Tools as mn, LocaleService as dt, isICellData as ro, isFormulaString as Ce, isFormulaId as De, generateRandomId as Yt, Direction as de, Injector as It, getEmptyCell as mt, UniverInstanceType as W, ThemeService as Et, ILogService as oo, toDisposable as lr, ColorKit as pn, RxDisposable as so, InterceptorEffectEnum as io, IConfigService as Sn, FOCUSING_DOC as co, FOCUSING_UNIVER_EDITOR as lo, DisposableCollection as Ye, RANGE_TYPE as Ie, getBodySlice as Pn, EDITOR_ACTIVATED as Un, createInternalEditorID as ao, BuildTextUtils as uo, RichTextBuilder as ho, DependentOn as fo, Plugin as go, merge as mo, registerDependencies as po, touchDependencies as So } from "@univerjs/core";
5
- import { ISheetClipboardService as ar, PREDEFINED_HOOK_NAME_COPY as ur, SheetPasteCommand as vo, PREDEFINED_HOOK_NAME_PASTE as lt, IEditorBridgeService as vn, SetCellEditVisibleOperation as dr, HoverManagerService as Co, CellAlertManagerService as _o, CellAlertType as Ro, IAutoFillService as Io, APPLY_TYPE as Eo, DATA_TYPE as Vn, COPY_TYPE as hr, SheetSkeletonManagerService as bt, attachSelectionWithCoord as sn, SelectionControl as fr, SELECTION_SHAPE_DEPTH as bo, useActiveWorkbook as yo, menuClipboardDisabledObservable as To, getCurrentRangeDisable$ as $e, PASTE_SPECIAL_MENU_ID as Oo, COPY_SPECIAL_MENU_ID as No, whenFormulaEditorActivated as yt, whenSheetEditorFocused as Mo, SheetsUIPart as xo, BaseSelectionRenderService as wo, getCoordByOffset as Wn, checkInHeaderRanges as Hn, getAllSelection as ko, genNormalSelectionStyle as gr, getSheetObject as Ao, MoveSelectionCommand as Bn, JumpOver as qn, ExpandSelectionCommand as jn, EMBEDDING_FORMULA_EDITOR as Fo, IMarkSelectionService as Do, RANGE_SELECTOR_COMPONENT_KEY as Lo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as $o } from "@univerjs/sheets-ui";
6
- import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as Tt, LexerTreeBuilder as ye, ErrorType as ue, extractFormulaError as mr, SetFormulaCalculationResultMutation as Po, SetArrayFormulaDataMutation as Uo, SetFormulaCalculationStopMutation as Vo, FunctionType as cn, matchToken as Ge, deserializeRangeWithSheetWithCache as Wo, matchRefDrawToken as Ho, isFormulaLexerToken as Bo, deserializeRangeWithSheet as ht, serializeRangeToRefString as qo, serializeRangeWithSheet as _t, serializeRangeWithSpreadsheet as jo, generateStringWithSequence as Ko, operatorToken as pr } from "@univerjs/engine-formula";
7
- import { Subject as pt, debounceTime as Cn, combineLatestWith as Yo, map as Sr, BehaviorSubject as vr, throttleTime as Go, filter as Cr, distinctUntilChanged as zo, merge as Zo } from "rxjs";
8
- import { IEditorService as Ze, DocSelectionRenderService as _r, ReplaceTextRunsCommand as Kn, MoveSelectionOperation as Xo, MoveCursorOperation as Qo, useKeyboardEvent as Jo, useResize as es, DocBackScrollRenderController as ts, RichTextEditor as ns } from "@univerjs/docs-ui";
9
- import { DeviceInputEventType as xe, IRenderManagerService as Te, ScrollTimerType as en, SHEET_VIEWPORT_KEY as Yn, Vector2 as Gn } from "@univerjs/engine-render";
10
- import { SheetsSelectionsService as _n, getSheetCommandTarget as Rr, getCellAtRowCol as rs, SetSelectionsOperation as Rn, SheetInterceptorService as In, ReorderRangeCommand as os, SetRangeValuesMutation as Lt, SetRangeValuesUndoMutationFactory as ss, BEFORE_CELL_EDIT as is, SetWorksheetRowAutoHeightMutation as cs, INTERCEPTOR_POINT as ls, WorksheetSetCellValuePermission as Xe, WorksheetEditPermission as Qe, RangeProtectionPermissionEditPoint as Je, WorkbookEditablePermission as et, RangeProtectionPermissionViewPoint as as, WorksheetCopyPermission as us, WorkbookCopyPermission as ds, IRefSelectionsService as Gt, SelectionMoveType as tn, convertSelectionDataToRange as hs, setEndForRange as fs, REF_SELECTIONS_ENABLED as zn, SetWorksheetActiveOperation as Zn } from "@univerjs/sheets";
5
+ import { ISheetClipboardService as ar, PREDEFINED_HOOK_NAME_COPY as ur, SheetPasteCommand as vo, PREDEFINED_HOOK_NAME_PASTE as lt, IEditorBridgeService as vn, SetCellEditVisibleOperation as dr, HoverManagerService as Co, CellAlertManagerService as _o, CellAlertType as Ro, COPY_TYPE as hr, SheetSkeletonManagerService as bt, attachSelectionWithCoord as sn, SelectionControl as fr, SELECTION_SHAPE_DEPTH as Io, useActiveWorkbook as Eo, menuClipboardDisabledObservable as bo, getCurrentRangeDisable$ as $e, PASTE_SPECIAL_MENU_ID as yo, COPY_SPECIAL_MENU_ID as To, whenFormulaEditorActivated as yt, whenSheetEditorFocused as Oo, SheetsUIPart as No, BaseSelectionRenderService as Mo, getCoordByOffset as Vn, checkInHeaderRanges as Wn, getAllSelection as xo, genNormalSelectionStyle as gr, getSheetObject as wo, MoveSelectionCommand as Hn, JumpOver as Bn, ExpandSelectionCommand as qn, EMBEDDING_FORMULA_EDITOR as ko, IMarkSelectionService as Ao, RANGE_SELECTOR_COMPONENT_KEY as Fo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Do } from "@univerjs/sheets-ui";
6
+ import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as Tt, LexerTreeBuilder as ye, ErrorType as ue, extractFormulaError as mr, SetFormulaCalculationResultMutation as Lo, SetArrayFormulaDataMutation as $o, SetFormulaCalculationStopMutation as Po, FunctionType as cn, matchToken as Ge, deserializeRangeWithSheetWithCache as Uo, matchRefDrawToken as Vo, isFormulaLexerToken as Wo, deserializeRangeWithSheet as ht, serializeRangeToRefString as Ho, serializeRangeWithSheet as _t, serializeRangeWithSpreadsheet as Bo, generateStringWithSequence as qo, operatorToken as pr } from "@univerjs/engine-formula";
7
+ import { Subject as pt, debounceTime as Cn, combineLatestWith as jo, map as Sr, BehaviorSubject as vr, throttleTime as Ko, filter as Cr, distinctUntilChanged as Yo, merge as Go } from "rxjs";
8
+ import { IEditorService as Ze, DocSelectionRenderService as _r, ReplaceTextRunsCommand as jn, MoveSelectionOperation as zo, MoveCursorOperation as Zo, useKeyboardEvent as Xo, useResize as Qo, DocBackScrollRenderController as Jo, RichTextEditor as es } from "@univerjs/docs-ui";
9
+ import { DeviceInputEventType as xe, IRenderManagerService as Te, ScrollTimerType as en, SHEET_VIEWPORT_KEY as Kn, Vector2 as Yn } from "@univerjs/engine-render";
10
+ import { SheetsSelectionsService as _n, getSheetCommandTarget as Rr, getCellAtRowCol as ts, SetSelectionsOperation as Rn, SheetInterceptorService as In, ReorderRangeCommand as ns, SetRangeValuesMutation as Lt, IAutoFillService as rs, AUTO_FILL_APPLY_TYPE as os, AUTO_FILL_DATA_TYPE as Gn, SetRangeValuesUndoMutationFactory as ss, BEFORE_CELL_EDIT as is, SetWorksheetRowAutoHeightMutation as cs, INTERCEPTOR_POINT as ls, WorksheetSetCellValuePermission as Xe, WorksheetEditPermission as Qe, RangeProtectionPermissionEditPoint as Je, WorkbookEditablePermission as et, RangeProtectionPermissionViewPoint as as, WorksheetCopyPermission as us, WorkbookCopyPermission as ds, IRefSelectionsService as Gt, SelectionMoveType as tn, convertSelectionDataToRange as hs, setEndForRange as fs, REF_SELECTIONS_ENABLED as zn, SetWorksheetActiveOperation as Zn } from "@univerjs/sheets";
11
11
  import { InsertFunctionCommand as gs, TriggerCalculationController as ms, PLUGIN_CONFIG_KEY_BASE as ps, IDescriptionService as zt, QuickSumCommand as Ss, ImageFormulaCellInterceptorController as vs, UniverSheetsFormulaPlugin as Cs } from "@univerjs/sheets-formula";
12
12
  import { ISidebarService as En, IZenZoneService as _s, useDependency as y, useObservable as _e, ProgressBar as Rs, getMenuHiddenObservable as Pe, MenuItemType as Ue, RibbonFormulasGroup as Xn, KeyCode as L, MetaKeys as V, IMenuManagerService as Is, IShortcutService as Zt, IUIPartsService as Ir, ComponentManager as Er, connectInjector as br, useEvent as ee, RectPopup as ln, IContextMenuService as Es, useUpdateEffect as bs, BuiltInUIPart as ys } from "@univerjs/ui";
13
13
  import { jsx as x, jsxs as B, Fragment as Ts } from "react/jsx-runtime";
@@ -282,7 +282,7 @@ const Ps = {
282
282
  return !1;
283
283
  });
284
284
  if (l) {
285
- const E = rs(S, v, i), p = {
285
+ const E = ts(S, v, i), p = {
286
286
  range: fn.clone(l),
287
287
  primary: {
288
288
  startRow: E.startRow,
@@ -428,7 +428,7 @@ let Ut = class extends ze {
428
428
  }
429
429
  _initialize() {
430
430
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
431
- getMutations: (e) => e.id === os.id ? this._reorderFormula(e.params) : {
431
+ getMutations: (e) => e.id === ns.id ? this._reorderFormula(e.params) : {
432
432
  redos: [],
433
433
  undos: []
434
434
  }
@@ -574,12 +574,12 @@ let Vt = class extends ze {
574
574
  }
575
575
  _registerAutoFill() {
576
576
  const e = {
577
- type: Vn.FORMULA,
577
+ type: Gn.FORMULA,
578
578
  priority: 1001,
579
579
  match: (t) => Ce(t == null ? void 0 : t.f) || De(t == null ? void 0 : t.si),
580
- isContinue: (t, n) => t.type === Vn.FORMULA,
580
+ isContinue: (t, n) => t.type === Gn.FORMULA,
581
581
  applyFunctions: {
582
- [Eo.COPY]: (t, n, o, r, s) => {
582
+ [os.COPY]: (t, n, o, r, s) => {
583
583
  const { data: i, index: c } = t;
584
584
  return this._fillCopyFormula(i, n, o, c, r, s);
585
585
  }
@@ -617,7 +617,7 @@ let Vt = class extends ze {
617
617
  }
618
618
  };
619
619
  Vt = Qs([
620
- tr(0, Io),
620
+ tr(0, rs),
621
621
  tr(1, q(ye))
622
622
  ], Vt);
623
623
  function Js(e, t, n, o, r) {
@@ -992,7 +992,7 @@ let Ht = class extends ze {
992
992
  }
993
993
  _commandExecutedListener() {
994
994
  this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
995
- (t.id === Po.id || t.id === Uo.id && n && n.remove) && this._removeArrayFormulaRangeShape();
995
+ (t.id === Lo.id || t.id === $o.id && n && n.remove) && this._removeArrayFormulaRangeShape();
996
996
  })), this.disposeWithMe(
997
997
  this._commandService.beforeCommandExecuted((t) => {
998
998
  cs.id === t.id && requestIdleCallback(() => {
@@ -1032,7 +1032,7 @@ let Ht = class extends ze {
1032
1032
  fill: new pn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
1033
1033
  widgets: {}
1034
1034
  }
1035
- }, c = sn(i, r), { rowHeaderWidth: a, columnHeaderHeight: d } = r, f = new fr(s, bo.FORMULA_EDITOR_SHOW, this._themeService, {
1035
+ }, c = sn(i, r), { rowHeaderWidth: a, columnHeaderHeight: d } = r, f = new fr(s, Io.FORMULA_EDITOR_SHOW, this._themeService, {
1036
1036
  highlightHeader: !1,
1037
1037
  rowHeaderWidth: a,
1038
1038
  columnHeaderHeight: d
@@ -1120,7 +1120,7 @@ Bt = fi([
1120
1120
  ], Bt);
1121
1121
  function mi() {
1122
1122
  const e = y(ms), t = y(pe), n = _e(e.progress$), o = $t(() => {
1123
- t.executeCommand(Vo.id);
1123
+ t.executeCommand(Po.id);
1124
1124
  }, [t]), r = $t(() => {
1125
1125
  e.clearProgress();
1126
1126
  }, [e]);
@@ -1550,7 +1550,7 @@ function Oi(e) {
1550
1550
  ] });
1551
1551
  }
1552
1552
  function Ni() {
1553
- const e = yo(), [t, n] = H(!0), [o, r] = H(!1), [s, i] = H(null);
1553
+ const e = Eo(), [t, n] = H(!0), [o, r] = H(!1), [s, i] = H(null);
1554
1554
  y(vn);
1555
1555
  const c = y(dt), a = y(Ze), d = y(ne), f = y(pe);
1556
1556
  function m() {
@@ -1719,8 +1719,8 @@ function Li(e) {
1719
1719
  id: Tn.id,
1720
1720
  type: Ue.BUTTON,
1721
1721
  title: "formula.operation.pasteFormula",
1722
- disabled$: To(e).pipe(
1723
- Yo($e(e, {
1722
+ disabled$: bo(e).pipe(
1723
+ jo($e(e, {
1724
1724
  workbookTypes: [et],
1725
1725
  rangeTypes: [Je],
1726
1726
  worksheetTypes: [Xe, Qe]
@@ -1759,13 +1759,13 @@ const $i = {
1759
1759
  menuItemFactory: Fi
1760
1760
  }
1761
1761
  },
1762
- [No]: {
1762
+ [To]: {
1763
1763
  [yn.id]: {
1764
1764
  order: 0,
1765
1765
  menuItemFactory: Di
1766
1766
  }
1767
1767
  },
1768
- [Oo]: {
1768
+ [yo]: {
1769
1769
  [Tn.id]: {
1770
1770
  order: 4,
1771
1771
  menuItemFactory: Li
@@ -1863,7 +1863,7 @@ function Ki() {
1863
1863
  const Yi = {
1864
1864
  id: Ss.id,
1865
1865
  binding: V.ALT | L.EQUAL,
1866
- preconditions: Mo,
1866
+ preconditions: Oo,
1867
1867
  mac: V.CTRL_COMMAND | V.ALT | L.EQUAL,
1868
1868
  description: "shortcut.sheets-formula-ui.quick-sum",
1869
1869
  group: "4_sheet-edit"
@@ -1909,7 +1909,7 @@ let qt = class extends ze {
1909
1909
  });
1910
1910
  }
1911
1911
  _registerComponents() {
1912
- this.disposeWithMe(this._uiPartsService.registerComponent(xo.FORMULA_AUX, () => br(mi, this._injector))), this._componentManager.register(Nr, Ni);
1912
+ this.disposeWithMe(this._uiPartsService.registerComponent(No.FORMULA_AUX, () => br(mi, this._injector))), this._componentManager.register(Nr, Ni);
1913
1913
  }
1914
1914
  _registerRenderModules() {
1915
1915
  this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, [Ht]));
@@ -1966,7 +1966,7 @@ var Qi = Object.getOwnPropertyDescriptor, Ji = (e, t, n, o) => {
1966
1966
  (i = e[s]) && (r = i(r) || r);
1967
1967
  return r;
1968
1968
  }, ct = (e, t) => (n, o) => t(n, o, e);
1969
- let Le = class extends wo {
1969
+ let Le = class extends Mo {
1970
1970
  constructor(t, n, o, r, s, i, c) {
1971
1971
  super(
1972
1972
  n,
@@ -2017,16 +2017,16 @@ let Le = class extends wo {
2017
2017
  })), c.add(
2018
2018
  n == null ? void 0 : n.onPointerDown$.subscribeEvent((a, d) => {
2019
2019
  if (!this.inRefSelectionMode()) return;
2020
- const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = Wn(a.offsetX, a.offsetY, i, f);
2021
- Hn(this._workbookSelections.getCurrentSelections(), m, Ie.ROW) || (this._onPointerDown(a, (r.zIndex || 1) + 1, Ie.ROW, this._getActiveViewport(a), en.Y), a.button !== 2 && d.stopPropagation());
2020
+ const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = Vn(a.offsetX, a.offsetY, i, f);
2021
+ Wn(this._workbookSelections.getCurrentSelections(), m, Ie.ROW) || (this._onPointerDown(a, (r.zIndex || 1) + 1, Ie.ROW, this._getActiveViewport(a), en.Y), a.button !== 2 && d.stopPropagation());
2022
2022
  })
2023
2023
  ), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((a, d) => {
2024
2024
  if (!this.inRefSelectionMode()) return;
2025
- const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = Wn(a.offsetX, a.offsetY, i, f);
2026
- Hn(this._workbookSelections.getCurrentSelections(), m, Ie.COLUMN) || (this._onPointerDown(a, (r.zIndex || 1) + 1, Ie.COLUMN, this._getActiveViewport(a), en.X), a.button !== 2 && d.stopPropagation());
2025
+ const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = Vn(a.offsetX, a.offsetY, i, f);
2026
+ Wn(this._workbookSelections.getCurrentSelections(), m, Ie.COLUMN) || (this._onPointerDown(a, (r.zIndex || 1) + 1, Ie.COLUMN, this._getActiveViewport(a), en.X), a.button !== 2 && d.stopPropagation());
2027
2027
  })), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((a, d) => {
2028
2028
  if (this._reset(), !this.inRefSelectionMode()) return;
2029
- const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m = ko(f);
2029
+ const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m = xo(f);
2030
2030
  this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
2031
2031
  const u = i.onPointerUp$.subscribeEvent(() => {
2032
2032
  u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
@@ -2074,7 +2074,7 @@ let Le = class extends wo {
2074
2074
  var i;
2075
2075
  if (!t)
2076
2076
  return;
2077
- const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Yn.VIEW_MAIN);
2077
+ const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Kn.VIEW_MAIN);
2078
2078
  this._skeleton && ((i = this._skeleton.worksheet) == null ? void 0 : i.getSheetId()) !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
2079
2079
  const s = this._workbookSelections.getCurrentSelections();
2080
2080
  this.resetSelectionsByModelData(s);
@@ -2082,10 +2082,10 @@ let Le = class extends wo {
2082
2082
  }
2083
2083
  _getActiveViewport(t) {
2084
2084
  const n = this._getSheetObject();
2085
- return n == null ? void 0 : n.scene.getActiveViewportByCoord(Gn.FromArray([t.offsetX, t.offsetY]));
2085
+ return n == null ? void 0 : n.scene.getActiveViewportByCoord(Yn.FromArray([t.offsetX, t.offsetY]));
2086
2086
  }
2087
2087
  _getSheetObject() {
2088
- return Ao(this._context.unit, this._context);
2088
+ return wo(this._context.unit, this._context);
2089
2089
  }
2090
2090
  /**
2091
2091
  * Handle pointer down event, bind pointermove & pointerup handler.
@@ -2105,9 +2105,9 @@ let Le = class extends wo {
2105
2105
  if (!c || !i)
2106
2106
  return;
2107
2107
  r && (this._activeViewport = r);
2108
- const { offsetX: a, offsetY: d } = t, f = c.getViewport(Yn.VIEW_MAIN);
2108
+ const { offsetX: a, offsetY: d } = t, f = c.getViewport(Kn.VIEW_MAIN);
2109
2109
  if (!f) return;
2110
- const m = c.getCoordRelativeToViewport(Gn.FromArray([a, d])), { x: u, y: h } = m;
2110
+ const m = c.getCoordRelativeToViewport(Yn.FromArray([a, d])), { x: u, y: h } = m;
2111
2111
  this._startViewportPosX = u, this._startViewportPosY = h;
2112
2112
  const l = c.getScrollXYInfoByViewport(m), { scaleX: S, scaleY: v } = c.getAncestorScale(), g = this._skeleton.getCellByOffset(u, h, S, v, l);
2113
2113
  if (!g) return;
@@ -2268,7 +2268,7 @@ function Br(e, t, n) {
2268
2268
  return P(() => {
2269
2269
  t && c();
2270
2270
  }, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), tc(c), P(() => {
2271
- const a = s.scrollEvent$.pipe(Go(100)).subscribe(c);
2271
+ const a = s.scrollEvent$.pipe(Ko(100)).subscribe(c);
2272
2272
  return () => {
2273
2273
  a.unsubscribe();
2274
2274
  };
@@ -2312,7 +2312,7 @@ const rt = (e) => {
2312
2312
  }), v = n.selectionChange$.pipe(
2313
2313
  Cr((g) => g.textRanges.length === 1),
2314
2314
  Sr((g) => g.textRanges[0].startOffset),
2315
- zo()
2315
+ Yo()
2316
2316
  ).subscribe(() => {
2317
2317
  m(!0);
2318
2318
  });
@@ -2503,11 +2503,11 @@ function lc(e) {
2503
2503
  if (!w) return;
2504
2504
  const k = (Y = w == null ? void 0 : w.dataStream) == null ? void 0 : Y.slice(0, -2), $ = ((re = S.sequenceNodesBuilder(k)) != null ? re : []).map((G) => typeof G == "object" ? G.nodeType === Q.REFERENCE ? {
2505
2505
  ...G,
2506
- range: Wo(G.token)
2506
+ range: Uo(G.token)
2507
2507
  } : {
2508
2508
  ...G,
2509
2509
  range: void 0
2510
- } : G), I = k[M - 1], _ = k[M], O = $.find((G) => typeof G == "object" && G.nodeType === Q.REFERENCE && M === G.endIndex + 2), D = I && Ho(I) && (!_ || Bo(_) && _ !== Ge.OPEN_BRACKET), U = !!O;
2510
+ } : G), I = k[M - 1], _ = k[M], O = $.find((G) => typeof G == "object" && G.nodeType === Q.REFERENCE && M === G.endIndex + 2), D = I && Vo(I) && (!_ || Wo(_) && _ !== Ge.OPEN_BRACKET), U = !!O;
2511
2511
  if ((k == null ? void 0 : k.substring(0, 1)) === "=" && (D || U))
2512
2512
  if (U) {
2513
2513
  if (v.current)
@@ -2659,7 +2659,7 @@ function jr(e = "") {
2659
2659
  const h = u.dataStream.slice(0, u.dataStream.length - 2), l = { dataStream: "", ...f.body };
2660
2660
  if (!h.startsWith(e)) return [];
2661
2661
  if (c == null || c.length === 0)
2662
- return l.textRuns = [], o.syncExecuteCommand(Kn.id, {
2662
+ return l.textRuns = [], o.syncExecuteCommand(jn.id, {
2663
2663
  unitId: m,
2664
2664
  body: Pn(l, 0, l.dataStream.length - 2)
2665
2665
  }), [];
@@ -2679,7 +2679,7 @@ function jr(e = "") {
2679
2679
  E.startOffset = Math.max(0, Math.min(E.startOffset, R)), E.endOffset = Math.max(0, Math.min(E.endOffset, R));
2680
2680
  });
2681
2681
  }
2682
- return o.syncExecuteCommand(Kn.id, {
2682
+ return o.syncExecuteCommand(jn.id, {
2683
2683
  unitId: m,
2684
2684
  body: Pn(l, 0, l.dataStream.length - 2),
2685
2685
  textRanges: d != null ? d : C
@@ -2792,26 +2792,26 @@ const gc = (e, t, n, o) => {
2792
2792
  return;
2793
2793
  }
2794
2794
  let v = de.LEFT;
2795
- l === L.ARROW_DOWN ? v = de.DOWN : l === L.ARROW_UP ? v = de.UP : l === L.ARROW_RIGHT && (v = de.RIGHT), S === V.SHIFT ? r.executeCommand(Xo.id, {
2795
+ l === L.ARROW_DOWN ? v = de.DOWN : l === L.ARROW_UP ? v = de.UP : l === L.ARROW_RIGHT && (v = de.RIGHT), S === V.SHIFT ? r.executeCommand(zo.id, {
2796
2796
  direction: v
2797
- }) : r.executeCommand(Qo.id, {
2797
+ }) : r.executeCommand(Zo.id, {
2798
2798
  direction: v
2799
2799
  });
2800
2800
  }, u = (l, S) => {
2801
2801
  let v = de.DOWN;
2802
- l === L.ARROW_DOWN ? v = de.DOWN : l === L.ARROW_UP ? v = de.UP : l === L.ARROW_LEFT ? v = de.LEFT : l === L.ARROW_RIGHT && (v = de.RIGHT), i.current ? S === V.CTRL_COMMAND ? r.executeCommand(Bn.id, {
2802
+ l === L.ARROW_DOWN ? v = de.DOWN : l === L.ARROW_UP ? v = de.UP : l === L.ARROW_LEFT ? v = de.LEFT : l === L.ARROW_RIGHT && (v = de.RIGHT), i.current ? S === V.CTRL_COMMAND ? r.executeCommand(Hn.id, {
2803
2803
  direction: v,
2804
- jumpOver: qn.moveGap,
2804
+ jumpOver: Bn.moveGap,
2805
2805
  extra: "formula-editor",
2806
2806
  fromCurrentSelection: i.current === Me.NEED_ADD || i.current === Me.EDIT_OTHER_SHEET_REFERENCE
2807
- }) : S === V.SHIFT ? r.executeCommand(jn.id, {
2807
+ }) : S === V.SHIFT ? r.executeCommand(qn.id, {
2808
2808
  direction: v,
2809
2809
  extra: "formula-editor"
2810
- }) : S === (V.CTRL_COMMAND | V.SHIFT) ? r.executeCommand(jn.id, {
2810
+ }) : S === (V.CTRL_COMMAND | V.SHIFT) ? r.executeCommand(qn.id, {
2811
2811
  direction: v,
2812
- jumpOver: qn.moveGap,
2812
+ jumpOver: Bn.moveGap,
2813
2813
  extra: "formula-editor"
2814
- }) : r.executeCommand(Bn.id, {
2814
+ }) : r.executeCommand(Hn.id, {
2815
2815
  direction: v,
2816
2816
  extra: "formula-editor",
2817
2817
  fromCurrentSelection: i.current === Me.NEED_ADD || i.current === Me.EDIT_OTHER_SHEET_REFERENCE
@@ -2884,7 +2884,7 @@ const gc = (e, t, n, o) => {
2884
2884
  (c == null ? void 0 : c.getUnitId()) !== t && o.setCurrentUnitForType(t), a && a.getSheetId() === n && r.setSelections(i);
2885
2885
  }
2886
2886
  }, [e, r, n, t, o]);
2887
- }, Sc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), dn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), Ft = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ee(r.range)) : e.map((r) => o ? qo(r) : r.sheetName !== "" && r.sheetName !== n ? _t(r.sheetName, r.range) : Ee(r.range)), vc = (e) => {
2887
+ }, Sc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), dn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), Ft = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ee(r.range)) : e.map((r) => o ? Ho(r) : r.sheetName !== "" && r.sheetName !== n ? _t(r.sheetName, r.range) : Ee(r.range)), vc = (e) => {
2888
2888
  var f, m, u;
2889
2889
  const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
2890
2890
  if ((o == null ? void 0 : o.length) !== 1)
@@ -2936,9 +2936,9 @@ const gc = (e, t, n, o) => {
2936
2936
  const te = D[_];
2937
2937
  if (typeof te == "object" && te.nodeType === Q.REFERENCE) {
2938
2938
  const fe = te.token;
2939
- (p == null ? void 0 : p.getUnitId()) !== o ? te.token = jo((st = p == null ? void 0 : p.getUnitId()) != null ? st : "", C, K) : te.token = C === (R == null ? void 0 : R.getName()) ? Ee(K) : _t(R.getName(), K);
2939
+ (p == null ? void 0 : p.getUnitId()) !== o ? te.token = Bo((st = p == null ? void 0 : p.getUnitId()) != null ? st : "", C, K) : te.token = C === (R == null ? void 0 : R.getName()) ? Ee(K) : _t(R.getName(), K);
2940
2940
  const ae = U + (te.token.length - fe.length);
2941
- d(Ko(D), ae, k);
2941
+ d(qo(D), ae, k);
2942
2942
  }
2943
2943
  } else {
2944
2944
  const K = [...w];
@@ -3019,7 +3019,7 @@ const gc = (e, t, n, o) => {
3019
3019
  })
3020
3020
  );
3021
3021
  });
3022
- }, $ = Zo(
3022
+ }, $ = Go(
3023
3023
  a.input$,
3024
3024
  A.selectionSet$,
3025
3025
  T.selectionMoveEnd$
@@ -3324,7 +3324,7 @@ const Oc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", or = () => {
3324
3324
  Os(t, () => ({
3325
3325
  isClickOutSide: (Z) => N.current ? !N.current.contains(Z.target) : !1
3326
3326
  }));
3327
- const w = ee(S), k = X(null), $ = X(void 0), I = $.current, [_, O] = H(i), D = X(null), U = le(() => h != null ? h : ao(`${Fo}-${Yt(4)}`), []), Y = le(() => n !== void 0, [n]), re = y(ne), he = re.getUnit(U);
3327
+ const w = ee(S), k = X(null), $ = X(void 0), I = $.current, [_, O] = H(i), D = X(null), U = le(() => h != null ? h : ao(`${ko}-${Yt(4)}`), []), Y = le(() => n !== void 0, [n]), re = y(ne), he = re.getUnit(U);
3328
3328
  _e(he == null ? void 0 : he.change$);
3329
3329
  const G = ac(), J = uo.transform.getPlainText((kn = (wn = he == null ? void 0 : he.getBody()) == null ? void 0 : wn.dataStream) != null ? kn : ""), ot = rt(J), st = le(() => Oc(J), [J]), Ot = le(() => G(st), [st, G]), { isSelecting: Oe, isSelectingRef: Nt } = lc({ unitId: r, subUnitId: s, editorId: U, isFocus: _, disableOnClick: p }), K = X(""), fe = y(Te).getRenderById(U), oe = fe == null ? void 0 : fe.with(_r), ae = oe == null ? void 0 : oe.isFocusing, ge = le(() => re.getCurrentTypeOfUnit$(W.UNIVER_DOC), [re]), Se = _e(ge), We = (Se == null ? void 0 : Se.getUnitId()) === U, He = X([]), z = Oe, we = (Fn = (An = y(Sn).getConfig(xr)) == null ? void 0 : An.functionScreenTips) != null ? Fn : !0;
3330
3330
  bs(() => {
@@ -3363,7 +3363,7 @@ const Oc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", or = () => {
3363
3363
  P(() => {
3364
3364
  var Z;
3365
3365
  w(Oe, (Z = oe == null ? void 0 : oe.isFocusing) != null ? Z : !0);
3366
- }, [w, Oe]), Jo(_, v, I), Pt(() => {
3366
+ }, [w, Oe]), Xo(_, v, I), Pt(() => {
3367
3367
  let Z;
3368
3368
  if (D.current) {
3369
3369
  Z = A.register({
@@ -3391,14 +3391,14 @@ const Oc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", or = () => {
3391
3391
  }, []), Pt(() => {
3392
3392
  i ? (O(i), ie()) : (C && (I == null || I.blur(), gt()), O(i));
3393
3393
  }, [i, I, ie, gt, C]);
3394
- const { checkScrollBar: Jt } = es(I, E, R);
3394
+ const { checkScrollBar: Jt } = Qo(I, E, R);
3395
3395
  mc(_, !!(Oe && We), r, U, T), gc(!!(_ && ae && l), z, I, g);
3396
3396
  const Mt = ee((Z, ce, ke) => {
3397
3397
  if (!ae)
3398
3398
  return;
3399
3399
  const Ne = ce !== -1 ? [{ startOffset: ce + 1, endOffset: ce + 1, collapsed: !0 }] : void 0;
3400
3400
  me(`=${Z}`, !0, ke, Ne), ke && (ie(), ce !== -1 && setTimeout(() => {
3401
- const xt = { startOffset: ce + 1, endOffset: ce + 1 }, Ae = I == null ? void 0 : I.render.with(ts);
3401
+ const xt = { startOffset: ce + 1, endOffset: ce + 1 }, Ae = I == null ? void 0 : I.render.with(Jo);
3402
3402
  Ae == null || Ae.scrollToRange({ ...xt, collapsed: !0 });
3403
3403
  }, 50), Jt());
3404
3404
  });
@@ -3475,7 +3475,7 @@ const Oc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", or = () => {
3475
3475
  ] });
3476
3476
  });
3477
3477
  function Mc(e, t, n, o) {
3478
- const r = y(ye), s = jr(""), i = _e(e == null ? void 0 : e.getDocumentDataModel().change$), [c, a] = H([]), d = y(Do), f = X(""), m = y(ne);
3478
+ const r = y(ye), s = jr(""), i = _e(e == null ? void 0 : e.getDocumentDataModel().change$), [c, a] = H([]), d = y(Ao), f = X(""), m = y(ne);
3479
3479
  return P(() => {
3480
3480
  if (!e) return;
3481
3481
  const u = e.getDocumentDataModel().getPlainText();
@@ -3752,7 +3752,7 @@ function Kr(e) {
3752
3752
  };
3753
3753
  }, [E]), /* @__PURE__ */ B(Ts, { children: [
3754
3754
  v ? null : /* @__PURE__ */ x(
3755
- ns,
3755
+ es,
3756
3756
  {
3757
3757
  isSingle: !0,
3758
3758
  ...e,
@@ -3872,7 +3872,7 @@ let Kt = class extends go {
3872
3872
  }
3873
3873
  _initUIPart() {
3874
3874
  const e = this._injector.get(Er);
3875
- this.disposeWithMe(e.register(Lo, Kr)), this.disposeWithMe(e.register($o, Nc)), this.disposeWithMe(this._uiPartsService.registerComponent(ys.GLOBAL, () => br(Dc, this._injector)));
3875
+ this.disposeWithMe(e.register(Fo, Kr)), this.disposeWithMe(e.register(Do, Nc)), this.disposeWithMe(this._uiPartsService.registerComponent(ys.GLOBAL, () => br(Dc, this._injector)));
3876
3876
  }
3877
3877
  };
3878
3878
  Yr(Kt, "pluginName", Or);