@univerjs/docs-ui 0.15.2-insiders.20260124-12fc7f0 → 0.15.3-insiders.20260131-b9b8805

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/index.js CHANGED
@@ -1,22 +1,22 @@
1
1
  var Bc = Object.defineProperty;
2
2
  var Mc = (n, e, t) => e in n ? Bc(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var O = (n, e, t) => Mc(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { IUniverInstanceService as Q, Inject as W, Disposable as me, toDisposable as Mn, UniverInstanceType as _, BuildTextUtils as re, JSONX as V, ObjectRelativeFromV as ft, ObjectRelativeFromH as Ro, CommandType as D, sequenceExecuteAsync as Pr, ICommandService as T, DataStreamTreeTokenType as k, TextX as Ie, TextXActionType as G, PresetListType as xe, UpdateDocsAttributeType as nn, Tools as de, generateRandomId as ge, TableRowHeightRule as _c, TableSizeType as Yi, TableTextWrapType as Dc, TableAlignmentType as wc, MemoryCursor as Nt, SHEET_EDITOR_UNITS as En, PositionedObjectLayoutType as bo, BlockType as Pc, LRUMap as Nc, BaselineOffset as Ve, BooleanNumber as z, ColorKit as Qs, DrawingTypeEnum as Nr, skipParseTagNames as Lc, CustomRangeType as Lr, DataStreamTreeNodeType as sn, createIdentifier as Ki, ILogService as Qr, SliceBodyType as ar, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as xo, DOC_RANGE_TYPE as He, normalizeBody as Qc, getBodySlice as qi, FOCUSING_DOC as _n, EDITOR_ACTIVATED as eo, DashStyleType as Uc, RxDisposable as Rt, ThemeService as Ur, IUndoRedoService as yo, PRESET_LIST_TYPE as Fc, HorizontalAlign as Ue, NamedStyleType as K, RANGE_DIRECTION as De, COLORS as gn, Rectangle as Hc, DocumentFlavor as Pe, LocaleService as Ye, IConfirmService as Xi, isInternalEditorID as at, IContextService as Fr, Injector as Dn, FOCUSING_EDITOR_STANDALONE as Us, FOCUSING_COMMENT_EDITOR as Fs, isCommentEditorID as kc, VerticalAlign as Vc, DEFAULT_EMPTY_DOCUMENT_VALUE as Zi, PageOrientType as Wc, PAPER_TYPES as zc, PAGE_SIZE as to, DOCS_ZEN_EDITOR_UNIT_ID_KEY as nt, DEFAULT_STYLES as Oo, NAMED_STYLE_MAP as jc, DisposableCollection as In, fromEventSubject as Mt, deepCompare as Gc, FOCUSING_UNIVER_EDITOR as Hr, FOCUSING_COMMON_DRAWINGS as Ji, getPlainText as no, debounce as kr, SpacingRule as Xt, IConfigService as Vr, QuickListTypeMap as jo, Direction as ie, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yc, checkForSubstrings as Kc, createInterceptorKey as $i, InterceptorManager as qc, UndoCommandId as Hs, RedoCommandId as ks, DependentOn as Xc, Plugin as Zc, merge as Jc, touchDependencies as Vs, mergeOverrideWithDependencies as $c, createInternalEditorID as el } from "@univerjs/core";
4
+ import { Inject as W, Disposable as Ee, toDisposable as Mn, UniverInstanceType as _, BuildTextUtils as re, IUniverInstanceService as Q, JSONX as V, ObjectRelativeFromV as ft, ObjectRelativeFromH as Ro, CommandType as D, sequenceExecuteAsync as Pr, ICommandService as T, DataStreamTreeTokenType as k, TextX as Ie, TextXActionType as G, PresetListType as xe, UpdateDocsAttributeType as nn, Tools as de, generateRandomId as ge, TableRowHeightRule as _c, TableSizeType as Yi, TableTextWrapType as Dc, TableAlignmentType as wc, MemoryCursor as Nt, SHEET_EDITOR_UNITS as En, PositionedObjectLayoutType as bo, BlockType as Pc, LRUMap as Nc, BaselineOffset as Ve, BooleanNumber as z, ColorKit as Qs, DrawingTypeEnum as Nr, skipParseTagNames as Lc, CustomRangeType as Lr, DataStreamTreeNodeType as sn, createIdentifier as Ki, SliceBodyType as ar, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as xo, DOC_RANGE_TYPE as He, normalizeBody as Qc, getBodySlice as qi, ILogService as Qr, FOCUSING_DOC as _n, EDITOR_ACTIVATED as eo, DashStyleType as Uc, RxDisposable as Rt, IUndoRedoService as yo, ThemeService as Ur, PRESET_LIST_TYPE as Fc, HorizontalAlign as Ue, NamedStyleType as K, RANGE_DIRECTION as _e, COLORS as gn, Rectangle as Hc, DocumentFlavor as Pe, LocaleService as Ye, IConfirmService as Xi, isInternalEditorID as it, Injector as Dn, FOCUSING_EDITOR_STANDALONE as Us, FOCUSING_COMMENT_EDITOR as Fs, isCommentEditorID as kc, VerticalAlign as Vc, DEFAULT_EMPTY_DOCUMENT_VALUE as Zi, IContextService as Fr, PageOrientType as Wc, PAPER_TYPES as zc, PAGE_SIZE as to, DOCS_ZEN_EDITOR_UNIT_ID_KEY as tt, DEFAULT_STYLES as Oo, NAMED_STYLE_MAP as jc, DisposableCollection as In, fromEventSubject as Mt, deepCompare as Gc, FOCUSING_UNIVER_EDITOR as Hr, FOCUSING_COMMON_DRAWINGS as Ji, getPlainText as no, debounce as kr, SpacingRule as Xt, IConfigService as Vr, QuickListTypeMap as jo, Direction as ie, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yc, checkForSubstrings as Kc, createInterceptorKey as $i, InterceptorManager as qc, UndoCommandId as Hs, RedoCommandId as ks, DependentOn as Xc, Plugin as Zc, merge as Jc, touchDependencies as Vs, mergeOverrideWithDependencies as $c, createInternalEditorID as el } from "@univerjs/core";
5
5
  import { DocSelectionManagerService as Y, RichTextEditingMutation as J, DocSkeletonManagerService as ce, SetTextSelectionsOperation as Le, DocStateEmitService as tl, DocInterceptorService as nl } from "@univerjs/docs";
6
- import { IRenderManagerService as ue, DocumentEditArea as ve, hasListGlyph as ol, isIndentByGlyph as rl, isFirstGlyph as sl, getParagraphByGlyph as il, pixelToPt as al, ptToPixel as Ws, parseDataStreamToTree as cl, Liquid as ea, GlyphType as ta, DocumentSkeletonPageType as Oe, getPageFromPath as cr, getTableIdAndSliceIndex as zs, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as Sn, getColor as fn, RegularPolygon as na, Rect as Kn, getOffsetRectForDom as ll, ScrollTimer as dl, CURSOR_TYPE as Dt, getSystemHighlightColor as Al, Vector2 as vn, PageLayoutType as Cn, Shape as ul, Path as js, pxToNum as oa, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ra, getNumberUnitValue as on, Viewport as hl, ScrollBar as lr, Layer as Gs, Documents as gl, DocBackground as fl, getLastLine as pl, lineIterator as ml, getLastColumn as El, UniverRenderEnginePlugin as Il, DeviceInputEventType as sa } from "@univerjs/engine-render";
7
- import { IClipboardInterfaceService as ia, FILE_PNG_CLIPBOARD_MIME_TYPE as Sl, FILE__WEBP_CLIPBOARD_MIME_TYPE as vl, FILE__JPEG_CLIPBOARD_MIME_TYPE as Cl, FILE__BMP_CLIPBOARD_MIME_TYPE as Rl, HTML_CLIPBOARD_MIME_TYPE as aa, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as ca, CopyCommand as bl, CutCommand as xl, PasteCommand as yl, ILayoutService as To, KeyCode as X, useDependency as Z, ComponentManager as rn, ISidebarService as la, getMenuHiddenObservable as oe, MenuItemType as $, COLOR_PICKER_COMPONENT as da, FONT_FAMILY_ITEM_COMPONENT as Ol, FONT_FAMILY_COMPONENT as Tl, FONT_SIZE_LIST as Bl, FONT_SIZE_COMPONENT as Ml, HEADING_LIST as Ys, COMMON_LABEL_COMPONENT as _l, HEADING_ITEM_COMPONENT as Dl, ICanvasPopupService as wl, IMenuManagerService as Aa, ToolbarItem as Pl, MenuManagerPosition as Nl, useObservable as tt, RectPopup as Ll, DesktopMenu as Ql, ContextMenuPosition as oo, MetaKeys as te, Slider as Ul, useConfigValue as ua, useEvent as mn, ContextMenuGroup as an, RibbonInsertGroup as Fl, RibbonStartGroup as Ks, IUIPartsService as Hl, IShortcutService as Bo, BuiltInUIPart as qs, connectInjector as Xs, imageMimeTypeSet as kl, IContextMenuService as Vl } from "@univerjs/ui";
6
+ import { DocumentEditArea as Ce, IRenderManagerService as ue, hasListGlyph as ol, isIndentByGlyph as rl, isFirstGlyph as sl, getParagraphByGlyph as il, pixelToPt as al, ptToPixel as Ws, parseDataStreamToTree as cl, Liquid as ea, GlyphType as ta, DocumentSkeletonPageType as Oe, getPageFromPath as cr, getTableIdAndSliceIndex as zs, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as Sn, getColor as fn, RegularPolygon as na, Rect as Kn, getOffsetRectForDom as ll, ScrollTimer as dl, CURSOR_TYPE as Dt, getSystemHighlightColor as Al, Vector2 as vn, PageLayoutType as Cn, Shape as ul, Path as js, pxToNum as oa, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ra, getNumberUnitValue as on, Viewport as hl, ScrollBar as lr, Layer as Gs, Documents as gl, DocBackground as fl, getLastLine as pl, lineIterator as ml, getLastColumn as El, UniverRenderEnginePlugin as Il, DeviceInputEventType as sa } from "@univerjs/engine-render";
7
+ import { FILE_PNG_CLIPBOARD_MIME_TYPE as Sl, FILE__WEBP_CLIPBOARD_MIME_TYPE as vl, FILE__JPEG_CLIPBOARD_MIME_TYPE as Cl, FILE__BMP_CLIPBOARD_MIME_TYPE as Rl, HTML_CLIPBOARD_MIME_TYPE as ia, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as aa, IClipboardInterfaceService as ca, CopyCommand as bl, CutCommand as xl, PasteCommand as yl, KeyCode as X, ILayoutService as To, useDependency as Z, ComponentManager as rn, ISidebarService as la, MenuItemType as $, getMenuHiddenObservable as oe, COLOR_PICKER_COMPONENT as da, FONT_FAMILY_ITEM_COMPONENT as Ol, FONT_FAMILY_COMPONENT as Tl, FONT_SIZE_LIST as Bl, FONT_SIZE_COMPONENT as Ml, HEADING_LIST as Ys, COMMON_LABEL_COMPONENT as _l, HEADING_ITEM_COMPONENT as Dl, ICanvasPopupService as wl, IMenuManagerService as Aa, ToolbarItem as Pl, MenuManagerPosition as Nl, useObservable as at, RectPopup as Ll, DesktopMenu as Ql, ContextMenuPosition as oo, MetaKeys as te, Slider as Ul, useConfigValue as ua, useEvent as mn, ContextMenuGroup as an, RibbonInsertGroup as Fl, RibbonStartGroup as Ks, BuiltInUIPart as qs, connectInjector as Xs, IUIPartsService as Hl, IShortcutService as Bo, imageMimeTypeSet as kl, IContextMenuService as Vl } from "@univerjs/ui";
8
8
  import { ImageSourceType as Wr } from "@univerjs/drawing";
9
9
  import { Subject as be, BehaviorSubject as Fe, merge as ha, filter as ro, takeUntil as pt, fromEvent as je, Observable as fe, map as wn, combineLatest as Pn, distinctUntilChanged as Wt, throttleTime as Rn, switchMap as Wl, take as zl, first as jl, of as Gl, animationFrameScheduler as Yl } from "rxjs";
10
- import { useRef as ke, createElement as Be, forwardRef as Me, useState as Ee, useEffect as Ce, useMemo as Te, useCallback as ga, useImperativeHandle as Kl, useLayoutEffect as fa } from "react";
10
+ import { useRef as ke, createElement as Te, forwardRef as Be, useState as me, useEffect as ve, useMemo as De, useCallback as ga, useImperativeHandle as Kl, useLayoutEffect as fa } from "react";
11
11
  import { filter as dr, bufferTime as ql, map as Xl } from "rxjs/operators";
12
12
  import { jsxs as ne, jsx as U, Fragment as Zl } from "react/jsx-runtime";
13
- import { Checkbox as Zs, InputNumber as it, Button as Jl, clsx as Ge, borderClassName as Nn, Select as pa, scrollbarClassName as $l, Tooltip as ed } from "@univerjs/design";
13
+ import { Checkbox as Zs, InputNumber as st, Button as Jl, clsx as Ge, borderClassName as Nn, Select as pa, scrollbarClassName as $l, Tooltip as ed } from "@univerjs/design";
14
14
  var td = Object.getOwnPropertyDescriptor, nd = (n, e, t, o) => {
15
15
  for (var r = o > 1 ? void 0 : o ? td(e, t) : e, s = n.length - 1, i; s >= 0; s--)
16
16
  (i = n[s]) && (r = i(r) || r);
17
17
  return r;
18
18
  }, Js = (n, e) => (t, o) => e(t, o, n);
19
- let wt = class extends me {
19
+ let wt = class extends Ee {
20
20
  constructor(e, t) {
21
21
  super();
22
22
  O(this, "_matches", /* @__PURE__ */ new Map());
@@ -287,7 +287,7 @@ const gd = 11, fd = 9, kn = {
287
287
  */
288
288
  fs: gd
289
289
  };
290
- let ct = class extends me {
290
+ let ct = class extends Ee {
291
291
  constructor(e, t, o) {
292
292
  super();
293
293
  O(this, "_cacheStyle", null);
@@ -316,7 +316,7 @@ let ct = class extends me {
316
316
  const t = e == null ? void 0 : e.getUnitId(), o = (i = this._renderManagerService.getRenderById(t)) == null ? void 0 : i.with(ce), r = o == null ? void 0 : o.getViewModel();
317
317
  return r == null ? {
318
318
  ...kn
319
- } : r.getEditArea() === ve.BODY ? {
319
+ } : r.getEditArea() === Ce.BODY ? {
320
320
  ...kn
321
321
  } : {
322
322
  ...kn,
@@ -2283,7 +2283,7 @@ function ri(n, e, t) {
2283
2283
  }), o;
2284
2284
  }
2285
2285
  const Lt = Ki("doc.clipboard-service");
2286
- let ur = class extends me {
2286
+ let ur = class extends Ee {
2287
2287
  constructor(e, t, o, r, s) {
2288
2288
  super();
2289
2289
  O(this, "_clipboardHooks", []);
@@ -2477,11 +2477,11 @@ let ur = class extends me {
2477
2477
  for (const s of e)
2478
2478
  for (const i of s.types)
2479
2479
  switch (i) {
2480
- case ca: {
2480
+ case aa: {
2481
2481
  o = await s.getType(i).then((a) => a && a.text());
2482
2482
  break;
2483
2483
  }
2484
- case aa: {
2484
+ case ia: {
2485
2485
  t = await s.getType(i).then((a) => a && a.text());
2486
2486
  break;
2487
2487
  }
@@ -2582,7 +2582,7 @@ ur = Gd([
2582
2582
  cn(0, Q),
2583
2583
  cn(1, Qr),
2584
2584
  cn(2, T),
2585
- cn(3, ia),
2585
+ cn(3, ca),
2586
2586
  cn(4, W(Y))
2587
2587
  ], ur);
2588
2588
  function Po(n) {
@@ -2640,7 +2640,7 @@ const ns = 999, so = {
2640
2640
  priority: ns,
2641
2641
  preconditions: Po,
2642
2642
  handler: async (n) => {
2643
- const e = n.get(Lt), o = await n.get(ia).read();
2643
+ const e = n.get(Lt), o = await n.get(ca).read();
2644
2644
  return o.length === 0 ? !1 : e.paste(o);
2645
2645
  }
2646
2646
  }, No = {
@@ -4444,7 +4444,7 @@ class Zt {
4444
4444
  }
4445
4445
  get direction() {
4446
4446
  const { collapsed: e, anchorNodePosition: t, focusNodePosition: o } = this;
4447
- return e || t == null || o == null ? De.NONE : ms(t, o) ? De.FORWARD : De.BACKWARD;
4447
+ return e || t == null || o == null ? _e.NONE : ms(t, o) ? _e.FORWARD : _e.BACKWARD;
4448
4448
  }
4449
4449
  get segmentId() {
4450
4450
  return this._segmentId;
@@ -4682,7 +4682,7 @@ class Wa {
4682
4682
  }
4683
4683
  get direction() {
4684
4684
  const { anchorNodePosition: e, focusNodePosition: t } = this;
4685
- return Zo(e, t) ? De.FORWARD : De.BACKWARD;
4685
+ return Zo(e, t) ? _e.FORWARD : _e.BACKWARD;
4686
4686
  }
4687
4687
  isActive() {
4688
4688
  return this._current === !0;
@@ -4794,7 +4794,7 @@ function Er(n, e, t, o, r, s, i, a) {
4794
4794
  const A = r.getViewModel().getSelfOrHeaderFooterViewModel(i), h = r.findCharIndexByPosition(n), u = r.findCharIndexByPosition(e);
4795
4795
  if (h == null || u == null)
4796
4796
  return;
4797
- const g = h <= u ? De.FORWARD : De.BACKWARD, f = Math.min(h, u), p = Math.max(h, u);
4797
+ const g = h <= u ? _e.FORWARD : _e.BACKWARD, f = Math.min(h, u), p = Math.max(h, u);
4798
4798
  let m = f, I = p;
4799
4799
  for (const S of A.getChildren())
4800
4800
  for (const C of S.children) {
@@ -4810,13 +4810,13 @@ function Er(n, e, t, o, r, s, i, a) {
4810
4810
  N = r.findNodePositionByCharIndex(M + 3, !0, i, a), L = r.findNodePositionByCharIndex(j.endIndex - 3, !0, i, a), I = M - 1, y = !0;
4811
4811
  else if (M > f && w < p) {
4812
4812
  if (N = r.findNodePositionByCharIndex(M + 3, !0, i, a), L = r.findNodePositionByCharIndex(w - 4, !0, i, a), m <= M - 1) {
4813
- const P = r.findNodePositionByCharIndex(m, !0, i, a), F = r.findNodePositionByCharIndex(M - 1, !1, i, a), q = g === De.FORWARD ? P : F, se = g === De.FORWARD ? F : P;
4813
+ const P = r.findNodePositionByCharIndex(m, !0, i, a), F = r.findNodePositionByCharIndex(M - 1, !1, i, a), q = g === _e.FORWARD ? P : F, se = g === _e.FORWARD ? F : P;
4814
4814
  c.push(new Zt(t, o, r, q, se, s, i, a));
4815
4815
  }
4816
4816
  m = w + 1;
4817
4817
  }
4818
4818
  if (N && L) {
4819
- const P = g === De.FORWARD ? N : L, F = g === De.FORWARD ? L : N;
4819
+ const P = g === _e.FORWARD ? N : L, F = g === _e.FORWARD ? L : N;
4820
4820
  d.push(...$o(
4821
4821
  t,
4822
4822
  o,
@@ -4830,7 +4830,7 @@ function Er(n, e, t, o, r, s, i, a) {
4830
4830
  }
4831
4831
  }
4832
4832
  if (I === E + 1 && !y && v && v.children.length && (I = E, y = !0), I >= R && I <= E || y) {
4833
- const M = r.findNodePositionByCharIndex(m, !0, i, a), w = r.findNodePositionByCharIndex(I, !y, i, a), H = g === De.FORWARD ? M : w, N = g === De.FORWARD ? w : M;
4833
+ const M = r.findNodePositionByCharIndex(m, !0, i, a), w = r.findNodePositionByCharIndex(I, !y, i, a), H = g === _e.FORWARD ? M : w, N = g === _e.FORWARD ? w : M;
4834
4834
  if (d.length && de.diffValue(H, N))
4835
4835
  continue;
4836
4836
  c.push(new Zt(t, o, r, H, N, s, i, a));
@@ -5114,7 +5114,14 @@ let Re = class extends Rt {
5114
5114
  * @deprecated
5115
5115
  */
5116
5116
  activate(e, t, o = !1) {
5117
- this._container.style.left = `${e}px`, this._container.style.top = `${t}px`, this._container.style.zIndex = "1000", (this.canFocusing || o) && this.focus();
5117
+ this._ensureHostContainer();
5118
+ let r = e, s = t;
5119
+ const i = this._container.parentElement;
5120
+ if (i) {
5121
+ const a = i.getBoundingClientRect();
5122
+ r -= a.left, s -= a.top;
5123
+ }
5124
+ this._container.style.left = `${r}px`, this._container.style.top = `${s}px`, this._container.style.zIndex = "1000", (this.canFocusing || o) && this.focus();
5118
5125
  }
5119
5126
  hasFocus() {
5120
5127
  return document.activeElement === this._input;
@@ -5291,7 +5298,9 @@ let Re = class extends Rt {
5291
5298
  const { unitId: e } = this._context, t = document.createElement("div");
5292
5299
  t.style.position = "fixed", t.style.left = "0px", t.style.top = "0px", t.id = `univer-doc-selection-container-${e}`;
5293
5300
  const o = document.createElement("div"), r = document.createElement("div");
5294
- o.appendChild(r), t.appendChild(o), this._container = t, this._inputParent = o, this._input = r, this._initInput(), this._initInputEvents(), document.body.appendChild(t);
5301
+ o.appendChild(r), t.appendChild(o), this._container = t, this._inputParent = o, this._input = r, this._initInput(), this._initInputEvents();
5302
+ const s = this._layoutService.rootContainerElement;
5303
+ (s != null && s.isConnected ? s : document.body).appendChild(t);
5295
5304
  }
5296
5305
  _registerContainer() {
5297
5306
  this.disposeWithMe(
@@ -5318,6 +5327,14 @@ let Re = class extends Rt {
5318
5327
  user-select: text;
5319
5328
  `;
5320
5329
  }
5330
+ _ensureHostContainer() {
5331
+ const e = this._layoutService.rootContainerElement;
5332
+ if (e != null && e.isConnected) {
5333
+ this._container.parentElement !== e && e.appendChild(this._container);
5334
+ return;
5335
+ }
5336
+ this._container.parentElement !== document.body && document.body.appendChild(this._container);
5337
+ }
5321
5338
  _getNodePosition(e) {
5322
5339
  if (e == null)
5323
5340
  return;
@@ -6062,7 +6079,7 @@ const Vo = {
6062
6079
  type: D.OPERATION,
6063
6080
  handler: (n, e) => !!e
6064
6081
  };
6065
- function _e({ ref: n, ...e }) {
6082
+ function Me({ ref: n, ...e }) {
6066
6083
  const { icon: t, id: o, className: r, extend: s, ...i } = e, a = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), c = ke(`_${RA()}`);
6067
6084
  return Ka(t, `${o}`, {
6068
6085
  defIds: t.defIds,
@@ -6074,7 +6091,7 @@ function _e({ ref: n, ...e }) {
6074
6091
  }, s);
6075
6092
  }
6076
6093
  function Ka(n, e, t, o, r) {
6077
- return Be(n.tag, {
6094
+ return Te(n.tag, {
6078
6095
  key: e,
6079
6096
  ...vA(n, t, r),
6080
6097
  ...o
@@ -6107,7 +6124,7 @@ function CA(n, e) {
6107
6124
  function RA() {
6108
6125
  return Math.random().toString(36).substring(2, 8);
6109
6126
  }
6110
- _e.displayName = "UniverIcon";
6127
+ Me.displayName = "UniverIcon";
6111
6128
  const bA = {
6112
6129
  tag: "svg",
6113
6130
  attrs: {
@@ -6147,8 +6164,8 @@ const bA = {
6147
6164
  }
6148
6165
  }
6149
6166
  ]
6150
- }, qa = Me(function(e, t) {
6151
- return Be(_e, Object.assign({}, e, {
6167
+ }, qa = Be(function(e, t) {
6168
+ return Te(Me, Object.assign({}, e, {
6152
6169
  id: "align-text-both-icon",
6153
6170
  ref: t,
6154
6171
  icon: bA
@@ -6187,8 +6204,8 @@ const xA = {
6187
6204
  }
6188
6205
  }
6189
6206
  ]
6190
- }, Xa = Me(function(e, t) {
6191
- return Be(_e, Object.assign({}, e, {
6207
+ }, Xa = Be(function(e, t) {
6208
+ return Te(Me, Object.assign({}, e, {
6192
6209
  id: "catalogue-icon",
6193
6210
  ref: t,
6194
6211
  icon: xA
@@ -6236,8 +6253,8 @@ const yA = {
6236
6253
  }
6237
6254
  }
6238
6255
  ]
6239
- }, Za = Me(function(e, t) {
6240
- return Be(_e, Object.assign({}, e, {
6256
+ }, Za = Be(function(e, t) {
6257
+ return Te(Me, Object.assign({}, e, {
6241
6258
  id: "delete-icon",
6242
6259
  ref: t,
6243
6260
  icon: yA
@@ -6292,8 +6309,8 @@ const OA = {
6292
6309
  }
6293
6310
  }
6294
6311
  ]
6295
- }, Ja = Me(function(e, t) {
6296
- return Be(_e, Object.assign({}, e, {
6312
+ }, Ja = Be(function(e, t) {
6313
+ return Te(Me, Object.assign({}, e, {
6297
6314
  id: "doc-setting-icon",
6298
6315
  ref: t,
6299
6316
  icon: OA
@@ -6316,8 +6333,8 @@ const TA = {
6316
6333
  d: "M10.5547 14.1884C10.2599 14.5214 9.74019 14.5214 9.4454 14.1884L3.71321 7.71335C3.29002 7.23532 3.6294 6.48161 4.26784 6.48161L15.7322 6.48161C16.3707 6.48161 16.7101 7.23532 16.2869 7.71335L10.5547 14.1884Z"
6317
6334
  }
6318
6335
  }]
6319
- }, $a = Me(function(e, t) {
6320
- return Be(_e, Object.assign({}, e, {
6336
+ }, $a = Be(function(e, t) {
6337
+ return Te(Me, Object.assign({}, e, {
6321
6338
  id: "down-icon",
6322
6339
  ref: t,
6323
6340
  icon: TA
@@ -6346,8 +6363,8 @@ const BA = {
6346
6363
  d: "M14.0999 6.33879C14.0999 6.09377 13.9509 5.87336 13.7236 5.78203C13.4962 5.6907 13.2362 5.74679 13.0667 5.92373L11.4753 7.58486C11.2461 7.82415 11.2542 8.20396 11.4935 8.43319C11.7328 8.66243 12.1126 8.65427 12.3419 8.41499L12.8999 7.83245V13.3333C12.8999 13.6646 13.1686 13.9333 13.4999 13.9333C13.8313 13.9333 14.0999 13.6646 14.0999 13.3333V6.33879Z"
6347
6364
  }
6348
6365
  }]
6349
- }, ec = Me(function(e, t) {
6350
- return Be(_e, Object.assign({}, e, {
6366
+ }, ec = Be(function(e, t) {
6367
+ return Te(Me, Object.assign({}, e, {
6351
6368
  id: "h1-icon",
6352
6369
  ref: t,
6353
6370
  icon: BA
@@ -6376,8 +6393,8 @@ const MA = {
6376
6393
  d: "M11.2667 8.33356C11.2667 7.67245 11.8201 7.26689 12.3333 7.26689C12.8465 7.26689 13.4 7.67244 13.4 8.33356C13.4 8.62807 13.2712 8.94814 12.9954 9.32391C12.7183 9.70153 12.3394 10.0744 11.9174 10.4803L11.8355 10.559C11.4524 10.9268 11.0365 11.3263 10.7149 11.7373C10.3718 12.1759 10.0667 12.7122 10.0667 13.3336C10.0667 13.6649 10.3353 13.9336 10.6667 13.9336H14C14.3314 13.9336 14.6 13.6649 14.6 13.3336C14.6 13.0022 14.3314 12.7336 14 12.7336H11.4782C11.5286 12.6531 11.5889 12.5676 11.6601 12.4767C11.9269 12.1355 12.2843 11.792 12.6877 11.4043L12.7492 11.3452C13.1606 10.9496 13.615 10.5079 13.9629 10.0338C14.3122 9.55787 14.6 8.98906 14.6 8.33356C14.6 6.88362 13.3757 6.06689 12.3333 6.06689C11.291 6.06689 10.0667 6.88361 10.0667 8.33356C10.0667 8.66493 10.3353 8.93356 10.6667 8.93356C10.998 8.93356 11.2667 8.66493 11.2667 8.33356Z"
6377
6394
  }
6378
6395
  }]
6379
- }, tc = Me(function(e, t) {
6380
- return Be(_e, Object.assign({}, e, {
6396
+ }, tc = Be(function(e, t) {
6397
+ return Te(Me, Object.assign({}, e, {
6381
6398
  id: "h2-icon",
6382
6399
  ref: t,
6383
6400
  icon: MA
@@ -6406,8 +6423,8 @@ const _A = {
6406
6423
  d: "M10.6667 6.06689C10.3353 6.06689 10.0667 6.33552 10.0667 6.66689C10.0667 6.99827 10.3353 7.26689 10.6667 7.26689H12.7732L11.193 9.29853C11.0524 9.47942 11.027 9.72465 11.1277 9.93051C11.2283 10.1364 11.4375 10.2669 11.6667 10.2669C12.2418 10.2669 12.6786 10.4115 12.9585 10.6354C13.2204 10.845 13.4 11.166 13.4 11.6669C13.4 12.1622 13.2254 12.3937 13.0567 12.5202C12.8588 12.6686 12.5829 12.7336 12.3333 12.7336C11.7271 12.7336 11.3432 12.4858 11.1106 12.23C10.8877 11.9848 10.5082 11.9667 10.2631 12.1896C10.0179 12.4125 9.99979 12.792 10.2227 13.0372C10.6568 13.5147 11.3522 13.9336 12.3333 13.9336C12.7504 13.9336 13.3078 13.8319 13.7767 13.4802C14.2746 13.1068 14.6 12.5049 14.6 11.6669C14.6 10.8345 14.2796 10.1555 13.7081 9.69837C13.4342 9.47923 13.117 9.32231 12.7746 9.21971L14.4736 7.03526C14.6143 6.85437 14.6397 6.60914 14.539 6.40328C14.4383 6.19743 14.2291 6.06689 14 6.06689H10.6667Z"
6407
6424
  }
6408
6425
  }]
6409
- }, nc = Me(function(e, t) {
6410
- return Be(_e, Object.assign({}, e, {
6426
+ }, nc = Be(function(e, t) {
6427
+ return Te(Me, Object.assign({}, e, {
6411
6428
  id: "h3-icon",
6412
6429
  ref: t,
6413
6430
  icon: _A
@@ -6438,8 +6455,8 @@ const DA = {
6438
6455
  clipRule: "evenodd"
6439
6456
  }
6440
6457
  }]
6441
- }, oc = Me(function(e, t) {
6442
- return Be(_e, Object.assign({}, e, {
6458
+ }, oc = Be(function(e, t) {
6459
+ return Te(Me, Object.assign({}, e, {
6443
6460
  id: "h4-icon",
6444
6461
  ref: t,
6445
6462
  icon: DA
@@ -6468,8 +6485,8 @@ const wA = {
6468
6485
  d: "M10.6669 6.40332C10.3355 6.40332 10.0669 6.67195 10.0669 7.00332V9.34492C10.0669 9.67629 10.3355 9.94492 10.6669 9.94492C10.7822 9.94492 10.8899 9.91238 10.9814 9.85599C10.9901 9.85195 11.0027 9.84632 11.0192 9.83936C11.0764 9.81533 11.1692 9.78033 11.2927 9.74447C11.5397 9.67268 11.8996 9.60022 12.3336 9.60022C12.4975 9.60022 12.5978 9.63412 12.6624 9.67167C12.7263 9.70877 12.79 9.76953 12.8503 9.87834C12.983 10.1181 13.0669 10.5337 13.0669 11.1669C13.0669 11.8061 12.9802 12.1936 12.8338 12.414C12.7252 12.5775 12.5275 12.7336 12.0002 12.7336C11.6445 12.7336 11.4936 12.622 11.4192 12.5328C11.3289 12.4245 11.2669 12.2453 11.2669 12.0028C11.2669 11.6714 10.9983 11.4028 10.6669 11.4028C10.3355 11.4028 10.0669 11.6714 10.0669 12.0028C10.0669 12.4244 10.1716 12.9106 10.4979 13.3016C10.8401 13.7118 11.356 13.9336 12.0002 13.9336C12.8063 13.9336 13.4419 13.6673 13.8334 13.0779C14.1869 12.5456 14.2669 11.8497 14.2669 11.1669C14.2669 10.4781 14.1841 9.81027 13.9002 9.29724C13.7521 9.02964 13.545 8.79662 13.2651 8.63403C12.986 8.4719 12.6697 8.40022 12.3336 8.40022C11.9239 8.40022 11.5627 8.44957 11.2669 8.51389V7.60332H13.3336C13.6649 7.60332 13.9336 7.33469 13.9336 7.00332C13.9336 6.67195 13.6649 6.40332 13.3336 6.40332H10.6669Z"
6469
6486
  }
6470
6487
  }]
6471
- }, rc = Me(function(e, t) {
6472
- return Be(_e, Object.assign({}, e, {
6488
+ }, rc = Be(function(e, t) {
6489
+ return Te(Me, Object.assign({}, e, {
6473
6490
  id: "h5-icon",
6474
6491
  ref: t,
6475
6492
  icon: wA
@@ -6515,8 +6532,8 @@ const PA = {
6515
6532
  }
6516
6533
  }
6517
6534
  ]
6518
- }, sc = Me(function(e, t) {
6519
- return Be(_e, Object.assign({}, e, {
6535
+ }, sc = Be(function(e, t) {
6536
+ return Te(Me, Object.assign({}, e, {
6520
6537
  id: "horizontally-icon",
6521
6538
  ref: t,
6522
6539
  icon: PA
@@ -6541,8 +6558,8 @@ const NA = {
6541
6558
  clipRule: "evenodd"
6542
6559
  }
6543
6560
  }]
6544
- }, ic = Me(function(e, t) {
6545
- return Be(_e, Object.assign({}, e, {
6561
+ }, ic = Be(function(e, t) {
6562
+ return Te(Me, Object.assign({}, e, {
6546
6563
  id: "left-icon",
6547
6564
  ref: t,
6548
6565
  icon: NA
@@ -6588,8 +6605,8 @@ const LA = {
6588
6605
  }
6589
6606
  }
6590
6607
  ]
6591
- }, ac = Me(function(e, t) {
6592
- return Be(_e, Object.assign({}, e, {
6608
+ }, ac = Be(function(e, t) {
6609
+ return Te(Me, Object.assign({}, e, {
6593
6610
  id: "left-justifying-icon",
6594
6611
  ref: t,
6595
6612
  icon: LA
@@ -6635,8 +6652,8 @@ const QA = {
6635
6652
  }
6636
6653
  }
6637
6654
  ]
6638
- }, cc = Me(function(e, t) {
6639
- return Be(_e, Object.assign({}, e, {
6655
+ }, cc = Be(function(e, t) {
6656
+ return Te(Me, Object.assign({}, e, {
6640
6657
  id: "right-justifying-icon",
6641
6658
  ref: t,
6642
6659
  icon: QA
@@ -6659,8 +6676,8 @@ const UA = {
6659
6676
  d: "M2.06641 1.9999C2.06641 1.66853 2.33504 1.3999 2.66641 1.3999H13.3331C13.6644 1.3999 13.9331 1.66853 13.9331 1.9999V3.64434C13.9331 3.97571 13.6644 4.24434 13.3331 4.24434C13.0017 4.24434 12.7331 3.97571 12.7331 3.64434V2.5999H8.59966V13.3999H10.6665C10.9979 13.3999 11.2665 13.6685 11.2665 13.9999C11.2665 14.3313 10.9979 14.5999 10.6665 14.5999L7.99966 14.5999L5.33315 14.5999C5.00178 14.5999 4.73315 14.3313 4.73315 13.9999C4.73315 13.6685 5.00178 13.3999 5.33315 13.3999H7.39966V2.5999H3.26641V3.64434C3.26641 3.97571 2.99778 4.24434 2.66641 4.24434C2.33504 4.24434 2.06641 3.97571 2.06641 3.64434V1.9999Z"
6660
6677
  }
6661
6678
  }]
6662
- }, pn = Me(function(e, t) {
6663
- return Be(_e, Object.assign({}, e, {
6679
+ }, pn = Be(function(e, t) {
6680
+ return Te(Me, Object.assign({}, e, {
6664
6681
  id: "text-type-icon",
6665
6682
  ref: t,
6666
6683
  icon: UA
@@ -6724,8 +6741,8 @@ const FA = {
6724
6741
  }
6725
6742
  }
6726
6743
  ]
6727
- }, lc = Me(function(e, t) {
6728
- return Be(_e, Object.assign({}, e, {
6744
+ }, lc = Be(function(e, t) {
6745
+ return Te(Me, Object.assign({}, e, {
6729
6746
  id: "todo-list-double-icon",
6730
6747
  ref: t,
6731
6748
  icon: FA
@@ -6755,7 +6772,7 @@ function dc(n) {
6755
6772
  }
6756
6773
  return 0;
6757
6774
  }
6758
- class HA extends me {
6775
+ class HA extends Ee {
6759
6776
  constructor(t, o, r, s, i, a) {
6760
6777
  super();
6761
6778
  // Emit change event when editor lose focus.
@@ -6963,7 +6980,7 @@ class HA extends me {
6963
6980
  return (o = this._injector.get(ue).getRenderById(this._getEditorId())) == null ? void 0 : o.with(ce).getSkeleton();
6964
6981
  }
6965
6982
  isSheetEditor() {
6966
- return at(this._getEditorId());
6983
+ return it(this._getEditorId());
6967
6984
  }
6968
6985
  /**
6969
6986
  * @deprecated use getDocumentData.
@@ -7019,7 +7036,7 @@ const WA = [
7019
7036
  // 'univer-range-selector-editor',
7020
7037
  // 'univer-text-editor-container-placeholder',
7021
7038
  ];
7022
- let Sr = class extends me {
7039
+ let Sr = class extends Ee {
7023
7040
  constructor(e, t, o, r, s, i, a) {
7024
7041
  super();
7025
7042
  O(this, "_editors", /* @__PURE__ */ new Map());
@@ -7075,7 +7092,7 @@ let Sr = class extends me {
7075
7092
  return;
7076
7093
  this._univerInstanceService.setCurrentUnitForType(e);
7077
7094
  const o = t.getValue().length;
7078
- this._contextService.setContextValue(eo, !0), at(e) || this._contextService.setContextValue(Us, !0), kc(e) && this._contextService.setContextValue(Fs, !0), t.focus(), this._setFocusId(e), this._focus$.next({
7095
+ this._contextService.setContextValue(eo, !0), it(e) || this._contextService.setContextValue(Us, !0), kc(e) && this._contextService.setContextValue(Fs, !0), t.focus(), this._setFocusId(e), this._focus$.next({
7079
7096
  startOffset: o,
7080
7097
  endOffset: o
7081
7098
  });
@@ -7166,10 +7183,10 @@ function zA(n, e, t) {
7166
7183
  evenPageHeaderId: d,
7167
7184
  evenPageFooterId: l
7168
7185
  } = n;
7169
- return e === ve.HEADER ? o === z.TRUE ? t === 0 ? a : r === z.TRUE && t % 2 === 1 ? d : s : r === z.TRUE && t % 2 === 1 ? d : s : o === z.TRUE ? t === 0 ? c : r === z.TRUE && t % 2 === 1 ? l : i : r === z.TRUE && t % 2 === 1 ? l : i;
7186
+ return e === Ce.HEADER ? o === z.TRUE ? t === 0 ? a : r === z.TRUE && t % 2 === 1 ? d : s : r === z.TRUE && t % 2 === 1 ? d : s : o === z.TRUE ? t === 0 ? c : r === z.TRUE && t % 2 === 1 ? l : i : r === z.TRUE && t % 2 === 1 ? l : i;
7170
7187
  }
7171
7188
  const jA = (n) => {
7172
- const e = Z(Ye), t = Z(Q), o = Z(ue), r = Z(T), s = Z(To), { unitId: i } = n, a = o.getRenderById(i).with(Re), [c, d] = Ee({}), l = (u, g) => {
7189
+ const e = Z(Ye), t = Z(Q), o = Z(ue), r = Z(T), s = Z(To), { unitId: i } = n, a = o.getRenderById(i).with(Re), [c, d] = me({}), l = (u, g) => {
7173
7190
  var b;
7174
7191
  d((x) => ({
7175
7192
  ...x,
@@ -7182,7 +7199,7 @@ const jA = (n) => {
7182
7199
  let C = !1;
7183
7200
  const R = a.getSegmentPage();
7184
7201
  let E = !1;
7185
- if (g === "useFirstPageHeaderFooter" && u === !0 && ((S === ve.HEADER && !p.firstPageHeaderId || S === ve.FOOTER && !p.firstPageFooterId) && (C = !0), C && R === 0 && (E = !0)), g === "evenAndOddHeaders" && u === !0 && ((S === ve.HEADER && !p.evenPageHeaderId || S === ve.FOOTER && !p.evenPageFooterId) && (C = !0), C && R % 2 === 1 && (E = !0)), C) {
7202
+ if (g === "useFirstPageHeaderFooter" && u === !0 && ((S === Ce.HEADER && !p.firstPageHeaderId || S === Ce.FOOTER && !p.firstPageFooterId) && (C = !0), C && R === 0 && (E = !0)), g === "evenAndOddHeaders" && u === !0 && ((S === Ce.HEADER && !p.evenPageHeaderId || S === Ce.FOOTER && !p.evenPageFooterId) && (C = !0), C && R % 2 === 1 && (E = !0)), C) {
7186
7203
  const v = ge(6);
7187
7204
  E && a.setSegment(v), r.executeCommand($n, {
7188
7205
  unitId: i,
@@ -7223,7 +7240,7 @@ const jA = (n) => {
7223
7240
  unitId: i
7224
7241
  });
7225
7242
  };
7226
- return Ce(() => {
7243
+ return ve(() => {
7227
7244
  const u = t.getUniverDocInstance(i), g = u == null ? void 0 : u.getSnapshot().documentStyle;
7228
7245
  if (g) {
7229
7246
  const {
@@ -7266,7 +7283,7 @@ const jA = (n) => {
7266
7283
  /* @__PURE__ */ ne("div", { children: [
7267
7284
  /* @__PURE__ */ U("span", { children: e.t("headerFooter.headerTopMargin") }),
7268
7285
  /* @__PURE__ */ U(
7269
- it,
7286
+ st,
7270
7287
  {
7271
7288
  className: "univer-mt-1.5 univer-w-4/5",
7272
7289
  min: 0,
@@ -7282,7 +7299,7 @@ const jA = (n) => {
7282
7299
  /* @__PURE__ */ ne("div", { children: [
7283
7300
  /* @__PURE__ */ U("span", { children: e.t("headerFooter.footerBottomMargin") }),
7284
7301
  /* @__PURE__ */ U(
7285
- it,
7302
+ st,
7286
7303
  {
7287
7304
  className: "univer-mt-1.5 univer-w-4/5",
7288
7305
  min: 0,
@@ -7300,12 +7317,12 @@ const jA = (n) => {
7300
7317
  ] });
7301
7318
  }, GA = () => {
7302
7319
  var d;
7303
- const n = Z(Ye), e = Z(ue), r = Z(Q).getCurrentUniverDocInstance().getUnitId(), i = ((d = e.getRenderById(r)) == null ? void 0 : d.with(ce)).getViewModel(), [a, c] = Ee(!0);
7304
- return Ce(() => {
7320
+ const n = Z(Ye), e = Z(ue), r = Z(Q).getCurrentUniverDocInstance().getUnitId(), i = ((d = e.getRenderById(r)) == null ? void 0 : d.with(ce)).getViewModel(), [a, c] = me(!0);
7321
+ return ve(() => {
7305
7322
  const l = i.getEditArea();
7306
- c(l !== ve.BODY);
7323
+ c(l !== Ce.BODY);
7307
7324
  const A = i.editAreaChange$.subscribe((h) => {
7308
- h != null && c(h !== ve.BODY);
7325
+ h != null && c(h !== Ce.BODY);
7309
7326
  });
7310
7327
  return () => {
7311
7328
  A.unsubscribe();
@@ -7378,12 +7395,12 @@ function ZA(n, e, t) {
7378
7395
  useFirstPageHeaderFooter: A
7379
7396
  } = o;
7380
7397
  switch (e) {
7381
- case ve.BODY:
7398
+ case Ce.BODY:
7382
7399
  return {
7383
7400
  createType: null,
7384
7401
  headerFooterId: null
7385
7402
  };
7386
- case ve.HEADER:
7403
+ case Ce.HEADER:
7387
7404
  return A === z.TRUE && !c ? {
7388
7405
  createType: 0,
7389
7406
  headerFooterId: null
@@ -7397,7 +7414,7 @@ function ZA(n, e, t) {
7397
7414
  createType: 2,
7398
7415
  headerFooterId: null
7399
7416
  };
7400
- case ve.FOOTER:
7417
+ case Ce.FOOTER:
7401
7418
  return A === z.TRUE && !d ? {
7402
7419
  createType: 1,
7403
7420
  headerFooterId: null
@@ -7415,7 +7432,7 @@ function ZA(n, e, t) {
7415
7432
  throw new Error(`Invalid editArea: ${e}`);
7416
7433
  }
7417
7434
  }
7418
- let Cr = class extends me {
7435
+ let Cr = class extends Ee {
7419
7436
  constructor(e, t, o, r, s, i, a, c, d) {
7420
7437
  super();
7421
7438
  O(this, "_loadedMap", /* @__PURE__ */ new WeakSet());
@@ -7433,7 +7450,7 @@ let Cr = class extends me {
7433
7450
  this._commandService.onCommandExecuted((e) => {
7434
7451
  if (J.id === e.id) {
7435
7452
  const t = this._context.unit, r = this._docSkeletonManagerService.getViewModel().getEditArea(), s = t.getSnapshot().documentStyle.documentFlavor;
7436
- r !== ve.BODY && s === Pe.MODERN && this._commandService.executeCommand(Ms.id, {
7453
+ r !== Ce.BODY && s === Pe.MODERN && this._commandService.executeCommand(Ms.id, {
7437
7454
  unitId: this._context.unitId
7438
7455
  });
7439
7456
  }
@@ -7469,7 +7486,7 @@ let Cr = class extends me {
7469
7486
  return;
7470
7487
  A.setEditArea(g);
7471
7488
  const { createType: p, headerFooterId: m } = ZA(A, g, f);
7472
- if (g === ve.BODY)
7489
+ if (g === Ce.BODY)
7473
7490
  this._docSelectionRenderService.setSegment(""), this._docSelectionRenderService.setSegmentPage(-1), this._docSelectionRenderService.setCursorManually(s, i);
7474
7491
  else if (p != null) {
7475
7492
  const S = ge(6);
@@ -7505,7 +7522,7 @@ let Cr = class extends me {
7505
7522
  i.pageRender$.subscribe((a) => {
7506
7523
  if (this._editorService.isEditor(o) || !this._isTraditionalMode())
7507
7524
  return;
7508
- const l = this._docSkeletonManagerService.getViewModel().getEditArea() === ve.BODY, { page: A, pageLeft: h, pageTop: u, ctx: g } = a, { pageWidth: f, pageHeight: p, marginTop: m, marginBottom: I } = A;
7525
+ const l = this._docSkeletonManagerService.getViewModel().getEditArea() === Ce.BODY, { page: A, pageLeft: h, pageTop: u, ctx: g } = a, { pageWidth: f, pageHeight: p, marginTop: m, marginBottom: I } = A;
7509
7526
  if (g.save(), g.translate(h - 0.5, u - 0.5), l ? (Kn.drawWith(g, {
7510
7527
  left: 0,
7511
7528
  top: 0,
@@ -7697,10 +7714,10 @@ const $n = "doc.command.core-header-footer", Ac = {
7697
7714
  return;
7698
7715
  let x;
7699
7716
  if (b === void 0 ? x = m.insertOp(["documentStyle", R], E) : x = m.replaceOp(["documentStyle", R], b, E), I.push(x), R === "useFirstPageHeaderFooter" && E === z.TRUE && !u.firstPageHeaderId) {
7700
- const v = h === ve.HEADER ? Qe.FIRST_PAGE_HEADER : Qe.FIRST_PAGE_FOOTER;
7717
+ const v = h === Ce.HEADER ? Qe.FIRST_PAGE_HEADER : Qe.FIRST_PAGE_FOOTER;
7701
7718
  nr(i, v, u, I);
7702
7719
  } else if (R === "evenAndOddHeaders" && E === z.TRUE && !u.evenPageHeaderId) {
7703
- const v = h === ve.HEADER ? Qe.EVEN_PAGE_HEADER : Qe.EVEN_PAGE_FOOTER;
7720
+ const v = h === Ce.HEADER ? Qe.EVEN_PAGE_HEADER : Qe.EVEN_PAGE_FOOTER;
7704
7721
  nr(i, v, u, I);
7705
7722
  }
7706
7723
  }), I.length === 0 ? !1 : (p.params.actions = I.reduce((R, E) => V.compose(R, E), null), !!t.syncExecuteCommand(p.id, p.params));
@@ -7718,7 +7735,7 @@ const $n = "doc.command.core-header-footer", Ac = {
7718
7735
  if (a == null)
7719
7736
  return !1;
7720
7737
  const { scene: c } = a, d = c.getTransformerByCreate(), l = a.with(ce), A = a.with(Re), h = l == null ? void 0 : l.getSkeleton(), u = l == null ? void 0 : l.getViewModel();
7721
- return u == null || h == null ? !1 : (r.replaceDocRanges([]), d.clearSelectedObjects(), A.setSegment(""), A.setSegmentPage(-1), u.setEditArea(ve.BODY), h.calculate(), (g = a.mainComponent) == null || g.makeDirty(!0), queueMicrotask(() => {
7738
+ return u == null || h == null ? !1 : (r.replaceDocRanges([]), d.clearSelectedObjects(), A.setSegment(""), A.setSegmentPage(-1), u.setEditArea(Ce.BODY), h.calculate(), (g = a.mainComponent) == null || g.makeDirty(!0), queueMicrotask(() => {
7722
7739
  const f = s.getUnit(i), p = f == null ? void 0 : f.getSnapshot();
7723
7740
  if (p == null)
7724
7741
  return;
@@ -7823,7 +7840,7 @@ const $n = "doc.command.core-header-footer", Ac = {
7823
7840
  return t != null ? t : "A4";
7824
7841
  };
7825
7842
  function ou(n) {
7826
- const { hooks: e } = n, r = Z(Q).getCurrentUnitOfType(_.UNIVER_DOC).getDocumentStyle(), s = Z(Ye), [i, a] = Ee(() => {
7843
+ const { hooks: e } = n, r = Z(Q).getCurrentUnitOfType(_.UNIVER_DOC).getDocumentStyle(), s = Z(Ye), [i, a] = me(() => {
7827
7844
  var l, A, h, u, g, f, p, m, I;
7828
7845
  return {
7829
7846
  paperSize: nu(r.pageSize),
@@ -7840,7 +7857,7 @@ function ou(n) {
7840
7857
  }
7841
7858
  };
7842
7859
  });
7843
- Ce(() => {
7860
+ ve(() => {
7844
7861
  e.beforeClose = () => i, e.beforeConfirm = () => i;
7845
7862
  }, [i]);
7846
7863
  const c = (l) => {
@@ -7888,7 +7905,7 @@ function ou(n) {
7888
7905
  /* @__PURE__ */ ne("div", { className: "univer-flex univer-flex-1 univer-flex-col univer-gap-2", children: [
7889
7906
  /* @__PURE__ */ U("label", { className: "univer-text-sm univer-font-medium univer-text-gray-500", children: s.t("page-settings.top") }),
7890
7907
  /* @__PURE__ */ U(
7891
- it,
7908
+ st,
7892
7909
  {
7893
7910
  precision: 2,
7894
7911
  max: i.pageSise.height / 2,
@@ -7900,7 +7917,7 @@ function ou(n) {
7900
7917
  /* @__PURE__ */ ne("div", { className: "univer-flex univer-flex-1 univer-flex-col univer-gap-2", children: [
7901
7918
  /* @__PURE__ */ U("label", { className: "univer-text-sm univer-font-medium univer-text-gray-500", children: s.t("page-settings.bottom") }),
7902
7919
  /* @__PURE__ */ U(
7903
- it,
7920
+ st,
7904
7921
  {
7905
7922
  precision: 2,
7906
7923
  max: i.pageSise.height / 2,
@@ -7914,7 +7931,7 @@ function ou(n) {
7914
7931
  /* @__PURE__ */ ne("div", { className: "univer-flex univer-flex-1 univer-flex-col univer-gap-2", children: [
7915
7932
  /* @__PURE__ */ U("label", { className: "univer-text-sm univer-font-medium univer-text-gray-500", children: s.t("page-settings.left") }),
7916
7933
  /* @__PURE__ */ U(
7917
- it,
7934
+ st,
7918
7935
  {
7919
7936
  precision: 2,
7920
7937
  max: i.pageSise.width / 2,
@@ -7926,7 +7943,7 @@ function ou(n) {
7926
7943
  /* @__PURE__ */ ne("div", { className: "univer-flex univer-flex-1 univer-flex-col univer-gap-2", children: [
7927
7944
  /* @__PURE__ */ U("label", { className: "univer-text-sm univer-font-medium univer-text-gray-500", children: s.t("page-settings.right") }),
7928
7945
  /* @__PURE__ */ U(
7929
- it,
7946
+ st,
7930
7947
  {
7931
7948
  precision: 2,
7932
7949
  max: i.pageSise.width / 2,
@@ -8052,7 +8069,7 @@ function ru(n) {
8052
8069
  if (a == null)
8053
8070
  return o.next(!0);
8054
8071
  a.with(ce).getViewModel().editAreaChange$.subscribe((d) => {
8055
- o.next(d === ve.HEADER || d === ve.FOOTER);
8072
+ o.next(d === Ce.HEADER || d === Ce.FOOTER);
8056
8073
  });
8057
8074
  });
8058
8075
  return () => r.unsubscribe();
@@ -8158,7 +8175,7 @@ function au(n) {
8158
8175
  activated$: new fe((t) => {
8159
8176
  const o = () => {
8160
8177
  var a;
8161
- const s = ot(n);
8178
+ const s = nt(n);
8162
8179
  if (s == null) {
8163
8180
  t.next(!1);
8164
8181
  return;
@@ -8186,7 +8203,7 @@ function cu(n) {
8186
8203
  activated$: new fe((t) => {
8187
8204
  const o = () => {
8188
8205
  var a;
8189
- const s = ot(n);
8206
+ const s = nt(n);
8190
8207
  if (s == null) {
8191
8208
  t.next(!1);
8192
8209
  return;
@@ -8214,7 +8231,7 @@ function lu(n) {
8214
8231
  activated$: new fe((t) => {
8215
8232
  const o = () => {
8216
8233
  var a;
8217
- const s = ot(n);
8234
+ const s = nt(n);
8218
8235
  if (s == null) {
8219
8236
  t.next(!1);
8220
8237
  return;
@@ -8242,7 +8259,7 @@ function du(n) {
8242
8259
  activated$: new fe((t) => {
8243
8260
  const o = () => {
8244
8261
  var a;
8245
- const s = ot(n);
8262
+ const s = nt(n);
8246
8263
  if (s == null) {
8247
8264
  t.next(!1);
8248
8265
  return;
@@ -8269,7 +8286,7 @@ function Au(n) {
8269
8286
  activated$: new fe((t) => {
8270
8287
  const o = () => {
8271
8288
  var a;
8272
- const s = ot(n);
8289
+ const s = nt(n);
8273
8290
  if (s == null) {
8274
8291
  t.next(!1);
8275
8292
  return;
@@ -8296,7 +8313,7 @@ function uu(n) {
8296
8313
  activated$: new fe((t) => {
8297
8314
  const o = () => {
8298
8315
  var a;
8299
- const s = ot(n);
8316
+ const s = nt(n);
8300
8317
  if (s == null) {
8301
8318
  t.next(!1);
8302
8319
  return;
@@ -8334,7 +8351,7 @@ function hu(n) {
8334
8351
  value$: new fe((t) => {
8335
8352
  const o = Oo.ff, r = () => {
8336
8353
  var c;
8337
- const i = ot(n);
8354
+ const i = nt(n);
8338
8355
  if (i == null) {
8339
8356
  t.next(o);
8340
8357
  return;
@@ -8370,7 +8387,7 @@ function gu(n) {
8370
8387
  value$: new fe((t) => {
8371
8388
  const o = Oo.fs, r = () => {
8372
8389
  var c;
8373
- const i = ot(n);
8390
+ const i = nt(n);
8374
8391
  if (i == null) {
8375
8392
  t.next(o);
8376
8393
  return;
@@ -8446,7 +8463,7 @@ function pu(n) {
8446
8463
  value$: new fe((o) => {
8447
8464
  const r = Oo.cl.rgb, s = () => {
8448
8465
  var d, l;
8449
- const a = ot(n);
8466
+ const a = nt(n);
8450
8467
  if (!a) {
8451
8468
  o.next(r);
8452
8469
  return;
@@ -8480,7 +8497,7 @@ function mu(n) {
8480
8497
  type: $.BUTTON,
8481
8498
  icon: "HeaderFooterIcon",
8482
8499
  tooltip: "toolbar.headerFooter",
8483
- hidden$: Pn(oe(n, _.UNIVER_DOC, void 0, nt), su(n), (e, t) => e || t)
8500
+ hidden$: Pn(oe(n, _.UNIVER_DOC, void 0, tt), su(n), (e, t) => e || t)
8484
8501
  };
8485
8502
  }
8486
8503
  const Eu = "GridIcon", mc = "doc.menu.table";
@@ -8492,7 +8509,7 @@ function Iu(n) {
8492
8509
  tooltip: "toolbar.table.main",
8493
8510
  disabled$: iu(n),
8494
8511
  // Do not show header footer menu and insert table at zen mode.
8495
- hidden$: Pn(oe(n, _.UNIVER_DOC, void 0, nt), ru(n), (e, t) => e || t)
8512
+ hidden$: Pn(oe(n, _.UNIVER_DOC, void 0, tt), ru(n), (e, t) => e || t)
8496
8513
  };
8497
8514
  }
8498
8515
  function Su(n) {
@@ -8525,7 +8542,7 @@ function vu(n) {
8525
8542
  });
8526
8543
  return t.next(!1), o.dispose;
8527
8544
  }),
8528
- hidden$: oe(n, _.UNIVER_DOC, void 0, nt)
8545
+ hidden$: oe(n, _.UNIVER_DOC, void 0, tt)
8529
8546
  };
8530
8547
  }
8531
8548
  function Cu(n) {
@@ -8550,7 +8567,7 @@ function Cu(n) {
8550
8567
  return t.next(!1), o.dispose;
8551
8568
  }),
8552
8569
  disabled$: ye(n),
8553
- hidden$: oe(n, _.UNIVER_DOC, void 0, nt)
8570
+ hidden$: oe(n, _.UNIVER_DOC, void 0, tt)
8554
8571
  };
8555
8572
  }
8556
8573
  function Ru(n) {
@@ -8575,7 +8592,7 @@ function Ru(n) {
8575
8592
  return t.next(!1), o.dispose;
8576
8593
  }),
8577
8594
  disabled$: ye(n),
8578
- hidden$: oe(n, _.UNIVER_DOC, void 0, nt)
8595
+ hidden$: oe(n, _.UNIVER_DOC, void 0, tt)
8579
8596
  };
8580
8597
  }
8581
8598
  function bu(n) {
@@ -8600,7 +8617,7 @@ function bu(n) {
8600
8617
  return t.next(!1), o.dispose;
8601
8618
  }),
8602
8619
  disabled$: ye(n),
8603
- hidden$: oe(n, _.UNIVER_DOC, void 0, nt)
8620
+ hidden$: oe(n, _.UNIVER_DOC, void 0, tt)
8604
8621
  };
8605
8622
  }
8606
8623
  function xu(n) {
@@ -8610,7 +8627,7 @@ function xu(n) {
8610
8627
  icon: "ReduceIcon",
8611
8628
  tooltip: "toolbar.horizontalLine",
8612
8629
  disabled$: ye(n),
8613
- hidden$: oe(n, _.UNIVER_DOC, void 0, nt)
8630
+ hidden$: oe(n, _.UNIVER_DOC, void 0, tt)
8614
8631
  };
8615
8632
  }
8616
8633
  const Tn = (n) => new fe((e) => {
@@ -8703,7 +8720,7 @@ function yu(n) {
8703
8720
  type: $.BUTTON,
8704
8721
  icon: "KeyboardIcon",
8705
8722
  tooltip: "toolbar.documentFlavor",
8706
- hidden$: oe(n, _.UNIVER_DOC, void 0, nt),
8723
+ hidden$: oe(n, _.UNIVER_DOC, void 0, tt),
8707
8724
  activated$: new fe((o) => {
8708
8725
  var i;
8709
8726
  const r = e.onCommandExecuted((a) => {
@@ -8742,7 +8759,7 @@ function Tu(n) {
8742
8759
  value$: new fe((o) => {
8743
8760
  const r = Oo.bg.rgb, s = () => {
8744
8761
  var d, l;
8745
- const a = ot(n);
8762
+ const a = nt(n);
8746
8763
  if (!a) {
8747
8764
  o.next(r);
8748
8765
  return;
@@ -8769,7 +8786,7 @@ function Tu(n) {
8769
8786
  hidden$: oe(n, _.UNIVER_DOC)
8770
8787
  };
8771
8788
  }
8772
- function ot(n) {
8789
+ function nt(n) {
8773
8790
  var g, f, p, m;
8774
8791
  const e = n.get(Q), t = n.get(Y), o = n.get(ct), r = e.getCurrentUnitForType(_.UNIVER_DOC), s = t.getDocRanges(), i = (g = s.find((I) => I.isActive)) != null ? g : s[0], a = o.getDefaultStyle(), c = (f = o.getStyleCache()) != null ? f : {}, d = Vt(n), l = (p = d == null ? void 0 : d.paragraphStyle) != null && p.namedStyleType ? jc[(m = d == null ? void 0 : d.paragraphStyle) == null ? void 0 : m.namedStyleType] : null;
8775
8792
  if (r == null || i == null)
@@ -8970,7 +8987,7 @@ const or = (n, e) => {
8970
8987
  bottom: (B.bottom + h * R) * S + p
8971
8988
  }));
8972
8989
  };
8973
- let Bn = class extends me {
8990
+ let Bn = class extends Ee {
8974
8991
  constructor(n, e, t, o) {
8975
8992
  super(), this._globalPopupManagerService = n, this._renderManagerService = e, this._univerInstanceService = t, this._commandService = o;
8976
8993
  }
@@ -9191,7 +9208,7 @@ function Tt(n, e, t) {
9191
9208
  const { left: o, right: r, top: s, bottom: i } = t;
9192
9209
  return n >= o && n <= r && e >= s && e <= i;
9193
9210
  }
9194
- let Pt = class extends me {
9211
+ let Pt = class extends Ee {
9195
9212
  constructor(e, t) {
9196
9213
  super();
9197
9214
  O(this, "_hoverCustomRanges$", new Fe([]));
@@ -9553,8 +9570,8 @@ const Ju = [
9553
9570
  It.id
9554
9571
  ];
9555
9572
  function $u(n) {
9556
- const { avaliableMenus: e = Ju } = n, t = Z(Aa), [o, r] = Ee([]);
9557
- return Ce(() => {
9573
+ const { avaliableMenus: e = Ju } = n, t = Z(Aa), [o, r] = me([]);
9574
+ return ve(() => {
9558
9575
  function s() {
9559
9576
  const a = t.getFlatMenuByPositionKey(Nl.RIBBON), c = [];
9560
9577
  for (const d of e) {
@@ -9592,11 +9609,11 @@ const oh = [
9592
9609
  k.CUSTOM_BLOCK,
9593
9610
  k.PARAGRAPH
9594
9611
  ];
9595
- let lo = class extends me {
9612
+ let lo = class extends Ee {
9596
9613
  constructor(e, t, o, r, s, i) {
9597
9614
  super();
9598
9615
  O(this, "_floatMenu", null);
9599
- this._context = e, this._docSelectionManagerService = t, this._docCanvasPopManagerService = o, this._componentManager = r, this._univerInstanceService = s, this._docSelectionRenderService = i, !at(this._context.unitId) && (this._registerFloatMenu(), this._initSelectionChange(), this.disposeWithMe(() => {
9616
+ this._context = e, this._docSelectionManagerService = t, this._docCanvasPopManagerService = o, this._componentManager = r, this._univerInstanceService = s, this._docSelectionRenderService = i, !it(this._context.unitId) && (this._registerFloatMenu(), this._initSelectionChange(), this.disposeWithMe(() => {
9600
9617
  this._hideFloatMenu();
9601
9618
  }));
9602
9619
  }
@@ -9665,11 +9682,11 @@ var rh = Object.getOwnPropertyDescriptor, sh = (n, e, t, o) => {
9665
9682
  (i = n[s]) && (r = i(r) || r);
9666
9683
  return r;
9667
9684
  }, dn = (n, e) => (t, o) => e(t, o, n);
9668
- let Ao = class extends me {
9685
+ let Ao = class extends Ee {
9669
9686
  constructor(e, t, o, r, s, i) {
9670
9687
  super();
9671
9688
  O(this, "_paragrahMenu", null);
9672
- this._context = e, this._docSelectionManagerService = t, this._docEventManagerService = o, this._docPopupManagerService = r, this._docSkeletonManagerService = s, this._floatMenuService = i, !at(this._context.unitId) && this._init();
9689
+ this._context = e, this._docSelectionManagerService = t, this._docEventManagerService = o, this._docPopupManagerService = r, this._docSkeletonManagerService = s, this._floatMenuService = i, !it(this._context.unitId) && this._init();
9673
9690
  }
9674
9691
  get activeParagraph() {
9675
9692
  var e;
@@ -9690,7 +9707,7 @@ let Ao = class extends me {
9690
9707
  _init() {
9691
9708
  const e = (o) => {
9692
9709
  var s;
9693
- if (this._docSkeletonManagerService.getViewModel().getEditArea() === ve.BODY && !this._floatMenuService.floatMenu && !this._context.unit.getDisabled()) {
9710
+ if (this._docSkeletonManagerService.getViewModel().getEditArea() === Ce.BODY && !this._floatMenuService.floatMenu && !this._context.unit.getDisabled()) {
9694
9711
  if ((s = this._paragrahMenu) != null && s.active)
9695
9712
  return;
9696
9713
  if (o) {
@@ -9754,10 +9771,10 @@ Ao = sh([
9754
9771
  ], Ao);
9755
9772
  const ih = ({ popup: n }) => {
9756
9773
  var E, b;
9757
- const [e, t] = Ee(!1), o = ke(null), r = Z(T), s = Z(To), i = ke(null), a = ke(!1), c = Z(ue), d = Z(Q), l = c.getRenderById(n.unitId), A = d.getUnit(n.unitId, _.UNIVER_DOC), h = l == null ? void 0 : l.with(Ao), u = l == null ? void 0 : l.with(Pt), g = tt(u == null ? void 0 : u.hoverParagraph$), f = tt(u == null ? void 0 : u.hoverParagraphLeft$), p = (E = g != null ? g : f) == null ? void 0 : E.startIndex, m = Te(() => {
9774
+ const [e, t] = me(!1), o = ke(null), r = Z(T), s = Z(To), i = ke(null), a = ke(!1), c = Z(ue), d = Z(Q), l = c.getRenderById(n.unitId), A = d.getUnit(n.unitId, _.UNIVER_DOC), h = l == null ? void 0 : l.with(Ao), u = l == null ? void 0 : l.with(Pt), g = at(u == null ? void 0 : u.hoverParagraph$), f = at(u == null ? void 0 : u.hoverParagraphLeft$), p = (E = g != null ? g : f) == null ? void 0 : E.startIndex, m = De(() => {
9758
9775
  var x, v;
9759
9776
  return (v = (x = A == null ? void 0 : A.getBody()) == null ? void 0 : x.paragraphs) == null ? void 0 : v.find((B) => B.startIndex === p);
9760
- }, [A, g]), I = (b = m == null ? void 0 : m.paragraphStyle) == null ? void 0 : b.namedStyleType, S = Ec[I != null ? I : K.NORMAL_TEXT], C = Te(() => new Fe({
9777
+ }, [A, g]), I = (b = m == null ? void 0 : m.paragraphStyle) == null ? void 0 : b.namedStyleType, S = Ec[I != null ? I : K.NORMAL_TEXT], C = De(() => new Fe({
9761
9778
  left: 0,
9762
9779
  right: 0,
9763
9780
  top: 0,
@@ -9917,24 +9934,31 @@ const ch = {
9917
9934
  }
9918
9935
  }, Ch = [50, 80, 100, 130, 150, 170, 200, 400], Rh = [10, 400];
9919
9936
  function bh() {
9920
- const n = Z(T), e = Z(Q), t = Te(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), []), o = tt(t), r = ga(() => {
9937
+ const n = Z(T), e = Z(Q), [t, o] = me(null), [r, s] = me(100), i = ga(() => {
9921
9938
  var d, l;
9922
- if (!o) return 100;
9923
- const c = ((l = (d = o.getSettings()) == null ? void 0 : d.zoomRatio) != null ? l : 1) * 100;
9939
+ if (!t) return 100;
9940
+ const c = ((l = (d = t.getSettings()) == null ? void 0 : d.zoomRatio) != null ? l : 1) * 100;
9924
9941
  return Math.round(c);
9925
- }, [o]), [s, i] = Ee(100);
9926
- Ce(() => (i(r()), n.onCommandExecuted((d) => {
9942
+ }, [t]);
9943
+ ve(() => {
9944
+ const d = e.getCurrentTypeOfUnit$(_.UNIVER_DOC).subscribe((l) => {
9945
+ l && (o(l), s(i()));
9946
+ });
9947
+ return () => {
9948
+ d.unsubscribe();
9949
+ };
9950
+ }, [e, i]), ve(() => n.onCommandExecuted((d) => {
9927
9951
  if (d.id === et.id) {
9928
- const l = r();
9929
- i(l);
9952
+ const l = i();
9953
+ s(l);
9930
9954
  }
9931
- }).dispose), [n, r]);
9955
+ }).dispose, [n, i]);
9932
9956
  function a(c) {
9933
- if (i(c), o == null)
9957
+ if (s(c), t == null)
9934
9958
  return;
9935
9959
  const d = c / 100;
9936
9960
  n.executeCommand(et.id, {
9937
- unitId: o.getUnitId(),
9961
+ unitId: t.getUnitId(),
9938
9962
  zoomRatio: d
9939
9963
  });
9940
9964
  }
@@ -9942,7 +9966,7 @@ function bh() {
9942
9966
  Ul,
9943
9967
  {
9944
9968
  min: Rh[0],
9945
- value: s,
9969
+ value: r,
9946
9970
  shortcuts: Ch,
9947
9971
  onChange: a
9948
9972
  }
@@ -9953,7 +9977,7 @@ function xh(n) {
9953
9977
  }
9954
9978
  function yh() {
9955
9979
  var r, s, i;
9956
- const n = Z(Q), e = ua(Wo), t = tt(() => n.getCurrentTypeOfUnit$(_.UNIVER_SHEET), void 0, void 0, []), o = (i = (s = (r = e == null ? void 0 : e.layout) == null ? void 0 : r.docContainerConfig) == null ? void 0 : s.footer) != null ? i : !0;
9980
+ const n = Z(Q), e = ua(Wo), t = at(() => n.getCurrentTypeOfUnit$(_.UNIVER_SHEET), void 0, void 0, []), o = (i = (s = (r = e == null ? void 0 : e.layout) == null ? void 0 : r.docContainerConfig) == null ? void 0 : s.footer) != null ? i : !0;
9957
9981
  return t ? null : o && /* @__PURE__ */ ne(
9958
9982
  "div",
9959
9983
  {
@@ -9965,10 +9989,10 @@ function yh() {
9965
9989
  }
9966
9990
  );
9967
9991
  }
9968
- const Oh = "univer-font-[500] univer-truncate univer-h-[24px] univer-mb-2 univer-leading-[24px] univer-cursor-pointer univer-pr-1 ", Th = "univer-text-base univer-font-semibold", Bh = "univer-text-sm univer-font-semibold", Mh = "univer-text-sm", _h = Me((n, e) => {
9992
+ const Oh = "univer-font-[500] univer-truncate univer-h-[24px] univer-mb-2 univer-leading-[24px] univer-cursor-pointer univer-pr-1 ", Th = "univer-text-base univer-font-semibold", Bh = "univer-text-sm univer-font-semibold", Mh = "univer-text-sm", _h = Be((n, e) => {
9969
9993
  const { menus: t, onClick: o, className: r, style: s, mode: i, maxHeight: a, activeId: c, open: d, onOpenChange: l, maxWidth: A, wrapperClass: h, wrapperStyle: u, iconClass: g, iconStyle: f } = n, p = i === "side-bar", m = ke(null), I = ke(t);
9970
9994
  I.current = t;
9971
- const S = Te(() => ({
9995
+ const S = De(() => ({
9972
9996
  scrollTo: (C) => {
9973
9997
  var y;
9974
9998
  if (!I.current || I.current.findIndex((M) => M.id === C) === -1 || !m.current) return;
@@ -9981,14 +10005,14 @@ const Oh = "univer-font-[500] univer-truncate univer-h-[24px] univer-mb-2 univer
9981
10005
  });
9982
10006
  }
9983
10007
  }), []);
9984
- return Kl(e, () => S), Ce(() => {
10008
+ return Kl(e, () => S), ve(() => {
9985
10009
  c && S.scrollTo(c);
9986
10010
  }, [c, S]), /* @__PURE__ */ ne("div", { className: Ge("univer-relative", h), style: u, children: [
9987
10011
  /* @__PURE__ */ U(
9988
10012
  "div",
9989
10013
  {
9990
10014
  onClick: () => l == null ? void 0 : l(!d),
9991
- className: Ge("univer-absolute univer-left-5 univer-top-4 univer-z-[100] univer-flex univer-h-8 univer-w-8 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-full univer-bg-white univer-text-gray-800 univer-shadow-sm dark:!univer-bg-gray-600 dark:!univer-text-gray-200", g),
10015
+ className: Ge("univer-absolute univer-left-5 univer-top-4 univer-z-[100] univer-flex univer-size-8 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-full univer-bg-white univer-text-gray-800 univer-shadow-sm dark:!univer-bg-gray-600 dark:!univer-text-gray-200", g),
9992
10016
  style: f,
9993
10017
  children: d ? /* @__PURE__ */ U(ic, {}) : /* @__PURE__ */ U(Xa, {})
9994
10018
  }
@@ -10092,13 +10116,13 @@ function Ph() {
10092
10116
  }
10093
10117
  function Nh() {
10094
10118
  var B, y, M, w, H, N, L, ee, j;
10095
- const n = Z(T), e = Z(Q), t = tt(Te(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), [])), o = Z(ue), r = (y = (B = t == null ? void 0 : t.getBody()) == null ? void 0 : B.dataStream) != null ? y : "", [s, i] = Ee(0), [a, c] = Ee(void 0), d = (M = t == null ? void 0 : t.getUnitId()) != null ? M : "", l = o.getRenderById(d), A = t == null ? void 0 : t.getTitle(), h = l == null ? void 0 : l.with(Pt), u = h == null ? void 0 : h.paragraphBounds, g = (H = (w = l == null ? void 0 : l.mainComponent) == null ? void 0 : w.left) != null ? H : 0, f = (N = l == null ? void 0 : l.engine.height) != null ? N : 0, p = (L = l == null ? void 0 : l.scene.scaleY) != null ? L : 1, m = (j = (ee = t == null ? void 0 : t.getBody()) == null ? void 0 : ee.paragraphs) != null ? j : [], I = Te(() => {
10119
+ const n = Z(T), e = Z(Q), t = at(De(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), [])), o = Z(ue), r = (y = (B = t == null ? void 0 : t.getBody()) == null ? void 0 : B.dataStream) != null ? y : "", [s, i] = me(0), [a, c] = me(void 0), d = (M = t == null ? void 0 : t.getUnitId()) != null ? M : "", l = o.getRenderById(d), A = t == null ? void 0 : t.getTitle(), h = l == null ? void 0 : l.with(Pt), u = h == null ? void 0 : h.paragraphBounds, g = (H = (w = l == null ? void 0 : l.mainComponent) == null ? void 0 : w.left) != null ? H : 0, f = (N = l == null ? void 0 : l.engine.height) != null ? N : 0, p = (L = l == null ? void 0 : l.scene.scaleY) != null ? L : 1, m = (j = (ee = t == null ? void 0 : t.getBody()) == null ? void 0 : ee.paragraphs) != null ? j : [], I = De(() => {
10096
10120
  const P = /* @__PURE__ */ new Map();
10097
10121
  return m.forEach((F) => {
10098
10122
  P.set(F.startIndex, F);
10099
10123
  }), P;
10100
10124
  }, [m]);
10101
- tt(Te(() => l != null && l.engine.onTransformChange$ ? Mt(l == null ? void 0 : l.engine.onTransformChange$).pipe(Rn(33)) : Gl(null), [l == null ? void 0 : l.engine.onTransformChange$]));
10125
+ at(De(() => l != null && l.engine.onTransformChange$ ? Mt(l == null ? void 0 : l.engine.onTransformChange$).pipe(Rn(33)) : Gl(null), [l == null ? void 0 : l.engine.onTransformChange$]));
10102
10126
  const S = g < 180 ? "float" : "side-bar", C = m == null ? void 0 : m.filter(
10103
10127
  (P) => {
10104
10128
  var F;
@@ -10126,15 +10150,15 @@ function Nh() {
10126
10150
  isTitle: !0
10127
10151
  }] : [],
10128
10152
  ...C != null ? C : []
10129
- ].filter(Boolean), [b, x] = Ee(!0);
10130
- Ce(() => {
10153
+ ].filter(Boolean), [b, x] = me(!0);
10154
+ ve(() => {
10131
10155
  const P = kr(i, 100), F = n.onCommandExecuted((q) => {
10132
10156
  q.id === J.id && q.params.unitId === (t == null ? void 0 : t.getUnitId()) && P((pe) => pe + 1);
10133
10157
  });
10134
10158
  return () => {
10135
10159
  F.dispose();
10136
10160
  };
10137
- }, [n, t]), Ce(() => {
10161
+ }, [n, t]), ve(() => {
10138
10162
  const P = l == null ? void 0 : l.scene.getViewport(We.VIEW_MAIN);
10139
10163
  if (!P)
10140
10164
  return;
@@ -10160,7 +10184,7 @@ function Nh() {
10160
10184
  const se = u == null ? void 0 : u.get(q.startIndex);
10161
10185
  se && (F.scrollToViewportPos({ viewportScrollY: se.rect.top }), c(P.id));
10162
10186
  });
10163
- return !t || at(d) || !(E != null && E.length) ? null : /* @__PURE__ */ U(
10187
+ return !t || it(d) || !(E != null && E.length) ? null : /* @__PURE__ */ U(
10164
10188
  "div",
10165
10189
  {
10166
10190
  className: "univer-absolute univer-bottom-0 univer-left-0 univer-top-0 univer-z-[100] univer-w-[0px]",
@@ -10181,7 +10205,7 @@ function Nh() {
10181
10205
  }
10182
10206
  );
10183
10207
  }
10184
- const rt = {
10208
+ const ot = {
10185
10209
  id: "doc-paragraph-setting.command",
10186
10210
  type: D.COMMAND,
10187
10211
  handler: async (n, e) => {
@@ -10229,8 +10253,8 @@ const rt = {
10229
10253
  return u.params.actions = p.editOp(f.serialize(), m), !!r.syncExecuteCommand(u.id, u.params);
10230
10254
  }
10231
10255
  }, Lh = () => {
10232
- const n = Z(Y), e = Z(tn), t = Te(() => n.getDocRanges(), []);
10233
- return Ce(() => {
10256
+ const n = Z(Y), e = Z(tn), t = De(() => n.getDocRanges(), []);
10257
+ return ve(() => {
10234
10258
  t.length || e.closePanel();
10235
10259
  }, [t]), t;
10236
10260
  }, Qh = () => {
@@ -10241,79 +10265,79 @@ const rt = {
10241
10265
  const o = t[0].segmentId, r = e.getSelfOrHeaderFooterModel(o), s = (d = (c = r.getBody()) == null ? void 0 : c.paragraphs) != null ? d : [], i = (A = (l = r.getBody()) == null ? void 0 : l.dataStream) != null ? A : "";
10242
10266
  return (h = re.range.getParagraphsInRanges(t, s, i)) != null ? h : [];
10243
10267
  }, Uh = (n, e) => {
10244
- const t = Z(T), [o, r] = Ee(() => {
10268
+ const t = Z(T), [o, r] = me(() => {
10245
10269
  var a, c;
10246
10270
  const i = n[0];
10247
10271
  return i ? String((c = (a = i.paragraphStyle) == null ? void 0 : a.horizontalAlign) != null ? c : e) : e;
10248
10272
  });
10249
- return [o, (i) => (r(i), t.executeCommand(rt.id, {
10273
+ return [o, (i) => (r(i), t.executeCommand(ot.id, {
10250
10274
  paragraph: { horizontalAlign: Number(i) }
10251
10275
  }))];
10252
10276
  }, Fh = (n) => {
10253
- const e = Z(T), [t, o] = Ee(() => {
10277
+ const e = Z(T), [t, o] = me(() => {
10254
10278
  var i;
10255
10279
  const s = n[0];
10256
10280
  return s ? on((i = s.paragraphStyle) == null ? void 0 : i.indentStart, 0) : 0;
10257
10281
  });
10258
- return [t, (s) => (o(s), e.executeCommand(rt.id, {
10282
+ return [t, (s) => (o(s), e.executeCommand(ot.id, {
10259
10283
  paragraph: { indentStart: { v: s } }
10260
10284
  }))];
10261
10285
  }, Hh = (n) => {
10262
- const e = Z(T), [t, o] = Ee(() => {
10286
+ const e = Z(T), [t, o] = me(() => {
10263
10287
  var i;
10264
10288
  const s = n[0];
10265
10289
  return s ? on((i = s.paragraphStyle) == null ? void 0 : i.indentEnd, 0) : 0;
10266
10290
  });
10267
- return [t, (s) => (o(s), e.executeCommand(rt.id, {
10291
+ return [t, (s) => (o(s), e.executeCommand(ot.id, {
10268
10292
  paragraph: { indentEnd: { v: s } }
10269
10293
  }))];
10270
10294
  }, kh = (n) => {
10271
- const e = Z(T), [t, o] = Ee(() => {
10295
+ const e = Z(T), [t, o] = me(() => {
10272
10296
  var i;
10273
10297
  const s = n[0];
10274
10298
  return s ? on((i = s.paragraphStyle) == null ? void 0 : i.indentFirstLine, 0) : 0;
10275
10299
  });
10276
- return [t, (s) => (o(s), e.executeCommand(rt.id, {
10300
+ return [t, (s) => (o(s), e.executeCommand(ot.id, {
10277
10301
  paragraph: { indentFirstLine: { v: s } }
10278
10302
  }))];
10279
10303
  }, Vh = (n) => {
10280
- const e = Z(T), [t, o] = Ee(() => {
10304
+ const e = Z(T), [t, o] = me(() => {
10281
10305
  var i;
10282
10306
  const s = n[0];
10283
10307
  return s ? on((i = s.paragraphStyle) == null ? void 0 : i.hanging, 0) : 0;
10284
10308
  });
10285
- return [t, (s) => (o(s), e.executeCommand(rt.id, {
10309
+ return [t, (s) => (o(s), e.executeCommand(ot.id, {
10286
10310
  paragraph: { hanging: { v: s } }
10287
10311
  }))];
10288
10312
  }, Wh = (n) => {
10289
- const e = Z(T), [t, o] = Ee(() => {
10313
+ const e = Z(T), [t, o] = me(() => {
10290
10314
  var i;
10291
10315
  const s = n[0];
10292
10316
  return s ? on((i = s.paragraphStyle) == null ? void 0 : i.spaceAbove, 0) : 0;
10293
10317
  });
10294
- return [t, (s) => (o(s), e.executeCommand(rt.id, {
10318
+ return [t, (s) => (o(s), e.executeCommand(ot.id, {
10295
10319
  paragraph: { spaceAbove: { v: s } }
10296
10320
  }))];
10297
10321
  }, zh = (n) => {
10298
- const e = Z(T), [t, o] = Ee(() => {
10322
+ const e = Z(T), [t, o] = me(() => {
10299
10323
  var i;
10300
10324
  const s = n[0];
10301
10325
  return s ? on((i = s.paragraphStyle) == null ? void 0 : i.spaceBelow, 0) : 0;
10302
10326
  });
10303
- return [t, (s) => (o(s), e.executeCommand(rt.id, {
10327
+ return [t, (s) => (o(s), e.executeCommand(ot.id, {
10304
10328
  paragraph: { spaceBelow: { v: s } }
10305
10329
  }))];
10306
10330
  }, jh = (n) => {
10307
- const e = Z(T), t = Z(ue), o = Z(Q), r = Te(() => {
10331
+ const e = Z(T), t = Z(ue), o = Z(Q), r = De(() => {
10308
10332
  var g;
10309
10333
  const u = o.getCurrentUnitForType(_.UNIVER_DOC);
10310
10334
  if (u)
10311
10335
  return (g = t.getRenderById(u == null ? void 0 : u.getUnitId())) == null ? void 0 : g.with(ce).getSkeleton();
10312
- }, []), s = Te(() => new Fe({}), []), [i, a] = Ee(() => {
10336
+ }, []), s = De(() => new Fe({}), []), [i, a] = me(() => {
10313
10337
  var g, f;
10314
10338
  const u = n[0];
10315
10339
  return u && (f = (g = u.paragraphStyle) == null ? void 0 : g.lineSpacing) != null ? f : 1;
10316
- }), c = ke(i), [d, l] = Ee(() => {
10340
+ }), c = ke(i), [d, l] = me(() => {
10317
10341
  var g, f;
10318
10342
  const u = n[0];
10319
10343
  return u ? (f = (g = u.paragraphStyle) == null ? void 0 : g.spacingRule) != null ? f : Xt.AUTO : Xt.AUTO;
@@ -10330,7 +10354,7 @@ const rt = {
10330
10354
  c.current = i, A(g), l(u), s.next({ spacingRule: u });
10331
10355
  }
10332
10356
  };
10333
- return Ce(() => {
10357
+ return ve(() => {
10334
10358
  const u = s.pipe(
10335
10359
  dr((g) => !!Object.keys(g).length),
10336
10360
  ql(16),
@@ -10338,7 +10362,7 @@ const rt = {
10338
10362
  Xl((g) => g.reduce((f, p) => (Object.keys(p).forEach((m) => {
10339
10363
  f[m] = p[m];
10340
10364
  }), f), {}))
10341
- ).subscribe((g) => e.executeCommand(rt.id, {
10365
+ ).subscribe((g) => e.executeCommand(ot.id, {
10342
10366
  paragraph: { ...g }
10343
10367
  }));
10344
10368
  return () => u.unsubscribe();
@@ -10349,7 +10373,7 @@ const rt = {
10349
10373
  }, Bt = (n) => {
10350
10374
  const { value: e, onChange: t, className: o = "", min: r = 0, max: s = 100, step: i = 1 } = n, a = ke(null);
10351
10375
  return /* @__PURE__ */ U(
10352
- it,
10376
+ st,
10353
10377
  {
10354
10378
  step: i,
10355
10379
  ref: a,
@@ -10369,12 +10393,12 @@ const rt = {
10369
10393
  );
10370
10394
  };
10371
10395
  function Gh() {
10372
- const n = Z(Ye), e = Te(() => [
10396
+ const n = Z(Ye), e = De(() => [
10373
10397
  { label: n.t("toolbar.alignLeft"), value: String(Ue.LEFT), icon: /* @__PURE__ */ U(ac, {}) },
10374
10398
  { label: n.t("toolbar.alignCenter"), value: String(Ue.CENTER), icon: /* @__PURE__ */ U(sc, {}) },
10375
10399
  { label: n.t("toolbar.alignRight"), value: String(Ue.RIGHT), icon: /* @__PURE__ */ U(cc, {}) },
10376
10400
  { label: n.t("toolbar.alignJustify"), value: String(Ue.JUSTIFIED), icon: /* @__PURE__ */ U(qa, {}) }
10377
- ], []), t = Qh(), [o, r] = Uh(t, e[0].value), [s, i] = Fh(t), [a, c] = Hh(t), [d, l] = kh(t), [A, h] = Vh(t), [u, g] = Wh(t), [f, p] = zh(t), { lineSpacing: [m, I], spacingRule: [S, C] } = jh(t), R = Te(() => S === Xt.AUTO ? { min: 1, max: 5, step: m < 2 ? 0.5 : 1 } : { min: 1, max: 100 }, [S, m]);
10401
+ ], []), t = Qh(), [o, r] = Uh(t, e[0].value), [s, i] = Fh(t), [a, c] = Hh(t), [d, l] = kh(t), [A, h] = Vh(t), [u, g] = Wh(t), [f, p] = zh(t), { lineSpacing: [m, I], spacingRule: [S, C] } = jh(t), R = De(() => S === Xt.AUTO ? { min: 1, max: 5, step: m < 2 ? 0.5 : 1 } : { min: 1, max: 100 }, [S, m]);
10378
10402
  return /* @__PURE__ */ ne("div", { children: [
10379
10403
  /* @__PURE__ */ U("div", { className: "univer-t-4 univer-text-sm univer-font-medium", children: n.t("doc.paragraphSetting.alignment") }),
10380
10404
  /* @__PURE__ */ U(
@@ -10475,19 +10499,19 @@ function Gh() {
10475
10499
  }
10476
10500
  const Yh = (n, e) => e.length === n.length && n.some((t) => e.some((o) => o.startOffset === t.startOffset && o.endOffset === t.endOffset));
10477
10501
  function Kh() {
10478
- const n = Z(T), e = Z(Ye), t = tt(e.currentLocale$), [o, r] = Ee(""), s = Te(() => kr(() => r(ge(4)), 300), []), i = ke([]);
10479
- return Ce(() => {
10502
+ const n = Z(T), e = Z(Ye), t = at(e.currentLocale$), [o, r] = me(""), s = De(() => kr(() => r(ge(4)), 300), []), i = ke([]);
10503
+ return ve(() => {
10480
10504
  const a = n.onCommandExecuted((c) => {
10481
10505
  if (Le.id === c.id) {
10482
10506
  const d = c.params.ranges;
10483
10507
  Yh(d, i.current) || r(ge(4)), i.current = d;
10484
10508
  }
10485
- J.id === c.id && c.params.trigger !== rt.id && s();
10509
+ J.id === c.id && c.params.trigger !== ot.id && s();
10486
10510
  });
10487
10511
  return () => a.dispose();
10488
- }, [s]), Ce(() => {
10512
+ }, [s]), ve(() => {
10489
10513
  r(ge(4));
10490
- }, [t]), Ce(() => () => s.cancel(), [s]), /* @__PURE__ */ U(Gh, {}, o);
10514
+ }, [t]), ve(() => () => s.cancel(), [s]), /* @__PURE__ */ U(Gh, {}, o);
10491
10515
  }
10492
10516
  var qh = Object.getOwnPropertyDescriptor, Xh = (n, e, t, o) => {
10493
10517
  for (var r = o > 1 ? void 0 : o ? qh(e, t) : e, s = n.length - 1, i; s >= 0; s--)
@@ -10495,7 +10519,7 @@ var qh = Object.getOwnPropertyDescriptor, Xh = (n, e, t, o) => {
10495
10519
  return r;
10496
10520
  }, rr = (n, e) => (t, o) => e(t, o, n);
10497
10521
  const Ni = "doc_ui_paragraph-setting-panel";
10498
- let tn = class extends me {
10522
+ let tn = class extends Ee {
10499
10523
  constructor(e, t, o) {
10500
10524
  super();
10501
10525
  O(this, "_id");
@@ -10944,8 +10968,8 @@ var hg = Object.getOwnPropertyDescriptor, gg = (n, e, t, o) => {
10944
10968
  for (var r = o > 1 ? void 0 : o ? hg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
10945
10969
  (i = n[s]) && (r = i(r) || r);
10946
10970
  return r;
10947
- }, st = (n, e) => (t, o) => e(t, o, n);
10948
- let uo = class extends me {
10971
+ }, rt = (n, e) => (t, o) => e(t, o, n);
10972
+ let uo = class extends Ee {
10949
10973
  constructor(n, e, t, o, r, s, i, a, c) {
10950
10974
  super(), this._injector = n, this._componentManager = e, this._commandService = t, this._layoutService = o, this._menuManagerService = r, this._uiPartsService = s, this._univerInstanceService = i, this._shortcutService = a, this._configService = c, this._init();
10951
10975
  }
@@ -11008,15 +11032,15 @@ let uo = class extends me {
11008
11032
  }
11009
11033
  };
11010
11034
  uo = gg([
11011
- st(0, W(Dn)),
11012
- st(1, W(rn)),
11013
- st(2, T),
11014
- st(3, To),
11015
- st(4, Aa),
11016
- st(5, Hl),
11017
- st(6, Q),
11018
- st(7, Bo),
11019
- st(8, Vr)
11035
+ rt(0, W(Dn)),
11036
+ rt(1, W(rn)),
11037
+ rt(2, T),
11038
+ rt(3, To),
11039
+ rt(4, Aa),
11040
+ rt(5, Hl),
11041
+ rt(6, Q),
11042
+ rt(7, Bo),
11043
+ rt(8, Vr)
11020
11044
  ], uo);
11021
11045
  var fg = Object.getOwnPropertyDescriptor, pg = (n, e, t, o) => {
11022
11046
  for (var r = o > 1 ? void 0 : o ? fg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
@@ -11271,7 +11295,7 @@ var xg = Object.getOwnPropertyDescriptor, yg = (n, e, t, o) => {
11271
11295
  (i = n[s]) && (r = i(r) || r);
11272
11296
  return r;
11273
11297
  }, Ui = (n, e) => (t, o) => e(t, o, n);
11274
- let fo = class extends me {
11298
+ let fo = class extends Ee {
11275
11299
  constructor(n, e) {
11276
11300
  super(), this._docAutoFormatService = n, this._renderManagerService = e, this._initListTabAutoFormat(), this._initSpaceAutoFormat(), this._initDefaultEnterFormat(), this._initExitListAutoFormat();
11277
11301
  }
@@ -11517,7 +11541,7 @@ var wg = Object.getOwnPropertyDescriptor, Pg = (n, e, t, o) => {
11517
11541
  (i = n[s]) && (r = i(r) || r);
11518
11542
  return r;
11519
11543
  }, zn = (n, e) => (t, o) => e(t, o, n);
11520
- let po = class extends me {
11544
+ let po = class extends Ee {
11521
11545
  constructor(e, t, o, r) {
11522
11546
  super();
11523
11547
  O(this, "_onInputSubscription");
@@ -11578,8 +11602,8 @@ let po = class extends me {
11578
11602
  ], !1);
11579
11603
  return;
11580
11604
  }
11581
- const p = l || A === De.FORWARD ? a : c;
11582
- let m = l || A === De.FORWARD ? c : a;
11605
+ const p = l || A === _e.FORWARD ? a : c;
11606
+ let m = l || A === _e.FORWARD ? c : a;
11583
11607
  const I = (C = r.getSelfOrHeaderFooterModel(h).getBody().dataStream.length) != null ? C : Number.POSITIVE_INFINITY;
11584
11608
  if (e === ie.LEFT || e === ie.RIGHT) {
11585
11609
  const E = s.findNodeByCharIndex(m - 1, h, f), b = s.findNodeByCharIndex(m, h, f);
@@ -11591,7 +11615,7 @@ let po = class extends me {
11591
11615
  }
11592
11616
  ], !1), this._scrollToFocusNodePosition(r.getUnitId(), m);
11593
11617
  } else {
11594
- const E = s.findNodeByCharIndex(m, h, f), b = i.document.getOffsetConfig(), x = l ? u : A === De.FORWARD ? g : u, v = this._getTopOrBottomPosition(s, E, x, e === ie.DOWN, !0);
11618
+ const E = s.findNodeByCharIndex(m, h, f), b = i.document.getOffsetConfig(), x = l ? u : A === _e.FORWARD ? g : u, v = this._getTopOrBottomPosition(s, E, x, e === ie.DOWN, !0);
11595
11619
  if (v == null) {
11596
11620
  const y = e === ie.UP ? 0 : I - 2;
11597
11621
  if (y === m)
@@ -11850,17 +11874,17 @@ const Ng = ({
11850
11874
  handleRowColChange: n,
11851
11875
  tableCreateParams: e
11852
11876
  }) => {
11853
- const t = Z(Ye), [o, r] = Ee(3), [s, i] = Ee(5);
11877
+ const t = Z(Ye), [o, r] = me(3), [s, i] = me(5);
11854
11878
  function a(c, d) {
11855
11879
  r(c), i(d), n(c, d);
11856
11880
  }
11857
- return Ce(() => {
11881
+ return ve(() => {
11858
11882
  r(e.rowCount), i(e.colCount);
11859
11883
  }, [e]), /* @__PURE__ */ ne("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
11860
11884
  /* @__PURE__ */ ne("div", { className: "univer-flex univer-items-center univer-gap-2", children: [
11861
11885
  /* @__PURE__ */ U("span", { children: t.t("toolbar.table.rowCount") }),
11862
11886
  /* @__PURE__ */ U(
11863
- it,
11887
+ st,
11864
11888
  {
11865
11889
  className: "univer-w-28",
11866
11890
  min: 1,
@@ -11876,7 +11900,7 @@ const Ng = ({
11876
11900
  /* @__PURE__ */ ne("div", { className: "univer-flex univer-items-center univer-gap-2", children: [
11877
11901
  /* @__PURE__ */ U("span", { children: t.t("toolbar.table.colCount") }),
11878
11902
  /* @__PURE__ */ U(
11879
- it,
11903
+ st,
11880
11904
  {
11881
11905
  className: "univer-w-28",
11882
11906
  min: 1,
@@ -11896,7 +11920,7 @@ var Lg = Object.getOwnPropertyDescriptor, Qg = (n, e, t, o) => {
11896
11920
  (i = n[s]) && (r = i(r) || r);
11897
11921
  return r;
11898
11922
  }, ki = (n, e) => (t, o) => e(t, o, n);
11899
- let mo = class extends me {
11923
+ let mo = class extends Ee {
11900
11924
  constructor(n, e) {
11901
11925
  super(), this._commandService = n, this._componentManager = e, this._initialize();
11902
11926
  }
@@ -11924,7 +11948,7 @@ var Ug = Object.getOwnPropertyDescriptor, Fg = (n, e, t, o) => {
11924
11948
  (i = n[s]) && (r = i(r) || r);
11925
11949
  return r;
11926
11950
  }, jn = (n, e) => (t, o) => e(t, o, n);
11927
- let yr = class extends me {
11951
+ let yr = class extends Ee {
11928
11952
  constructor(n, e, t, o, r) {
11929
11953
  super(), this._context = n, this._docSkeletonManagerService = e, this._commandService = t, this._docEventManagerService = o, this._textSelectionManagerService = r, this._initPointerDownObserver(), this._initHoverCursor();
11930
11954
  }
@@ -11977,8 +12001,8 @@ let Eo = class extends Rt {
11977
12001
  return;
11978
12002
  e.event.preventDefault();
11979
12003
  const t = e.event;
11980
- let o = (a = t.clipboardData) == null ? void 0 : a.getData(aa);
11981
- const r = (c = t.clipboardData) == null ? void 0 : c.getData(ca), s = [...((d = t.clipboardData) == null ? void 0 : d.items) || []].filter((l) => kl.has(l.type)).map((l) => l.getAsFile()).filter((l) => !!l);
12004
+ let o = (a = t.clipboardData) == null ? void 0 : a.getData(ia);
12005
+ const r = (c = t.clipboardData) == null ? void 0 : c.getData(aa), s = [...((d = t.clipboardData) == null ? void 0 : d.items) || []].filter((l) => kl.has(l.type)).map((l) => l.getAsFile()).filter((l) => !!l);
11982
12006
  this._editorService.getEditor(this._context.unitId) && (o != null ? o : "").indexOf("</table>") > -1 && (o = ""), this._docClipboardService.legacyPaste({ html: o, text: r, files: s });
11983
12007
  });
11984
12008
  }
@@ -11999,9 +12023,9 @@ const zg = [
11999
12023
  Zi,
12000
12024
  Yc,
12001
12025
  xo,
12002
- nt
12026
+ tt
12003
12027
  ];
12004
- let Or = class extends me {
12028
+ let Or = class extends Ee {
12005
12029
  constructor(n, e, t) {
12006
12030
  super(), this._context = n, this._contextMenuService = e, this._commandService = t, zg.includes(this._context.unitId) || (this._initPointerDown(), this._initEditChange());
12007
12031
  }
@@ -12029,7 +12053,7 @@ var jg = Object.getOwnPropertyDescriptor, Gg = (n, e, t, o) => {
12029
12053
  (i = n[s]) && (r = i(r) || r);
12030
12054
  return r;
12031
12055
  }, Gt = (n, e) => (t, o) => e(t, o, n);
12032
- let Io = class extends me {
12056
+ let Io = class extends Ee {
12033
12057
  constructor(e, t, o, r, s, i, a) {
12034
12058
  super();
12035
12059
  O(this, "_initialEditors", /* @__PURE__ */ new Set());
@@ -12134,7 +12158,7 @@ var Yg = Object.getOwnPropertyDescriptor, Kg = (n, e, t, o) => {
12134
12158
  (i = n[s]) && (r = i(r) || r);
12135
12159
  return r;
12136
12160
  }, Gn = (n, e) => (t, o) => e(t, o, n);
12137
- let Tr = class extends me {
12161
+ let Tr = class extends Ee {
12138
12162
  constructor(e, t, o, r, s) {
12139
12163
  super();
12140
12164
  O(this, "_previousIMEContent", "");
@@ -12200,7 +12224,7 @@ var qg = Object.getOwnPropertyDescriptor, Xg = (n, e, t, o) => {
12200
12224
  (i = n[s]) && (r = i(r) || r);
12201
12225
  return r;
12202
12226
  }, Yn = (n, e) => (t, o) => e(t, o, n);
12203
- let Br = class extends me {
12227
+ let Br = class extends Ee {
12204
12228
  constructor(e, t, o, r, s) {
12205
12229
  super();
12206
12230
  O(this, "_onInputSubscription");
@@ -12256,7 +12280,7 @@ Br = Xg([
12256
12280
  Yn(3, T),
12257
12281
  Yn(4, W(ct))
12258
12282
  ], Br);
12259
- class Ps extends me {
12283
+ class Ps extends Ee {
12260
12284
  constructor(e) {
12261
12285
  super(), this._context = e;
12262
12286
  }
@@ -12280,11 +12304,11 @@ var Zg = Object.getOwnPropertyDescriptor, Jg = (n, e, t, o) => {
12280
12304
  (i = n[s]) && (r = i(r) || r);
12281
12305
  return r;
12282
12306
  }, Wi = (n, e) => (t, o) => e(t, o, n);
12283
- let Mr = class extends me {
12307
+ let Mr = class extends Ee {
12284
12308
  constructor(n, e, t) {
12285
12309
  super(), this._context = n, this._docPageLayoutService = e, this._textSelectionManagerService = t;
12286
12310
  const o = this._context.unitId;
12287
- if (at(o) && o !== nt) return this;
12311
+ if (it(o) && o !== tt) return this;
12288
12312
  this._initResize();
12289
12313
  }
12290
12314
  _initResize() {
@@ -12307,7 +12331,7 @@ var $g = Object.getOwnPropertyDescriptor, ef = (n, e, t, o) => {
12307
12331
  (i = n[s]) && (r = i(r) || r);
12308
12332
  return r;
12309
12333
  }, Yt = (n, e) => (t, o) => e(t, o, n);
12310
- let _r = class extends me {
12334
+ let _r = class extends Ee {
12311
12335
  constructor(e, t, o, r, s, i, a) {
12312
12336
  super();
12313
12337
  O(this, "_loadedMap", /* @__PURE__ */ new WeakSet());
@@ -12364,7 +12388,7 @@ let _r = class extends me {
12364
12388
  u,
12365
12389
  g
12366
12390
  ), p = this._docSkeletonManagerService.getViewModel(), m = p.getEditArea();
12367
- m !== ve.BODY && f !== ve.BODY && f !== m && p.setEditArea(f);
12391
+ m !== Ce.BODY && f !== Ce.BODY && f !== m && p.setEditArea(f);
12368
12392
  }
12369
12393
  if (this._docSelectionRenderService.__onPointDown(s), this._editorService.getEditor(e)) {
12370
12394
  this._setEditorFocus(e);
@@ -12412,7 +12436,7 @@ let _r = class extends me {
12412
12436
  this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
12413
12437
  if (!e) return;
12414
12438
  const { unitId: t } = this._context;
12415
- if (!at(t)) {
12439
+ if (!it(t)) {
12416
12440
  this._docSelectionRenderService.focus();
12417
12441
  const s = this._context.unit.getSnapshot(), i = dc(s);
12418
12442
  this._docSelectionManagerService.replaceDocRanges([
@@ -12441,7 +12465,7 @@ var tf = Object.getOwnPropertyDescriptor, nf = (n, e, t, o) => {
12441
12465
  (i = n[s]) && (r = i(r) || r);
12442
12466
  return r;
12443
12467
  }, gt = (n, e) => (t, o) => e(t, o, n);
12444
- let Dr = class extends me {
12468
+ let Dr = class extends Ee {
12445
12469
  constructor(e, t, o, r, s, i, a, c, d) {
12446
12470
  super();
12447
12471
  O(this, "_isSheetEditor", !1);
@@ -12449,7 +12473,7 @@ let Dr = class extends me {
12449
12473
  O(this, "_updateTimer");
12450
12474
  this._context = e, this._contextService = t, this._docSkeletonManagerService = o, this._univerInstanceService = r, this._commandService = s, this._textSelectionManagerService = i, this._editorService = a, this._docPageLayoutService = c, this._renderManagerService = d, this._initSkeletonListener(), this._initCommandExecutedListener(), this._initRenderRefresher(), this._isSheetEditor = this._context.unitId === xo;
12451
12475
  const l = this._univerInstanceService.getCurrentUnitOfType(_.UNIVER_SHEET), A = l && this._renderManagerService.getRenderById(l.getUnitId());
12452
- this._initTimer = window.setTimeout(() => this.updateViewZoom(A && this._isSheetEditor ? A.scene.scaleX : 1, !0), 20), at(this._context.unitId) || this._initZoomEventListener();
12476
+ this._initTimer = window.setTimeout(() => this.updateViewZoom(A && this._isSheetEditor ? A.scene.scaleX : 1, !0), 20), it(this._context.unitId) || this._initZoomEventListener();
12453
12477
  }
12454
12478
  dispose() {
12455
12479
  window.clearTimeout(this._initTimer), window.clearTimeout(this._updateTimer);
@@ -12510,7 +12534,7 @@ let Dr = class extends me {
12510
12534
  updateViewZoom(e, t = !0) {
12511
12535
  var r;
12512
12536
  const o = mt(this._context);
12513
- o.scene.scale(e, e), this._editorService.isEditor(this._context.unitId) || this._docPageLayoutService.calculatePagePosition(), t && !this._editorService.isEditor(this._context.unitId) && this._textSelectionManagerService.refreshSelection(), !at(this._context.unitId) && ((r = o.scene.getTransformer()) == null || r.clearSelectedObjects());
12537
+ o.scene.scale(e, e), this._editorService.isEditor(this._context.unitId) || this._docPageLayoutService.calculatePagePosition(), t && !this._editorService.isEditor(this._context.unitId) && this._textSelectionManagerService.refreshSelection(), !it(this._context.unitId) && ((r = o.scene.getTransformer()) == null || r.clearSelectedObjects());
12514
12538
  }
12515
12539
  _initZoomEventListener() {
12516
12540
  const e = this._context.scene;
@@ -12543,7 +12567,7 @@ Dr = nf([
12543
12567
  gt(8, ue)
12544
12568
  ], Dr);
12545
12569
  const of = $i("PRINTING_COMPONENT_COLLECT"), rf = $i("PRINTING_DOM_COLLECT");
12546
- class sf extends me {
12570
+ class sf extends Ee {
12547
12571
  constructor() {
12548
12572
  super();
12549
12573
  O(this, "_printComponentMap", /* @__PURE__ */ new Map());
@@ -12892,7 +12916,7 @@ let wr = class extends Zc {
12892
12916
  La,
12893
12917
  Ba,
12894
12918
  Vo,
12895
- rt,
12919
+ ot,
12896
12920
  va,
12897
12921
  $t,
12898
12922
  qd,
@@ -13025,7 +13049,7 @@ wr = yf([
13025
13049
  hn(5, Vr)
13026
13050
  ], wr);
13027
13051
  function Tf(n) {
13028
- const { editorId: e, initialValue: t, container: o, autoFocus: r, isSingle: s } = n, i = Te(() => r != null ? r : !1, []), [a, c] = Ee(), d = Z(ze);
13052
+ const { editorId: e, initialValue: t, container: o, autoFocus: r, isSingle: s } = n, i = De(() => r != null ? r : !1, []), [a, c] = me(), d = Z(ze);
13029
13053
  return fa(() => {
13030
13054
  var l, A;
13031
13055
  if (o.current) {
@@ -13072,7 +13096,7 @@ function Tf(n) {
13072
13096
  }
13073
13097
  const Bf = (n, e, t) => {
13074
13098
  const o = Z(ze);
13075
- Ce(() => {
13099
+ ve(() => {
13076
13100
  const r = (i) => {
13077
13101
  var c, d;
13078
13102
  o.getFocusId() !== n || ((d = (c = i.target) == null ? void 0 : c.dataset) == null ? void 0 : d.editorid) === n || e.current && !e.current.contains(i.target) && (t == null || t());
@@ -13086,12 +13110,12 @@ const Bf = (n, e, t) => {
13086
13110
  };
13087
13111
  function Mf(n) {
13088
13112
  var s;
13089
- const t = Z(ue).getRenderById(n), o = t == null ? void 0 : t.with(Re), r = tt(o == null ? void 0 : o.textSelectionInner$);
13113
+ const t = Z(ue).getRenderById(n), o = t == null ? void 0 : t.with(Re), r = at(o == null ? void 0 : o.textSelectionInner$);
13090
13114
  return !!((s = o == null ? void 0 : o.isFocusing) != null && s && (r != null && r.textRanges.some((i) => i.collapsed)));
13091
13115
  }
13092
13116
  function _f(n, e, t) {
13093
- const o = Z(T), r = Z(Bo), s = Te(() => ge(4), []);
13094
- Ce(() => {
13117
+ const o = Z(T), r = Z(Bo), s = De(() => ge(4), []);
13118
+ ve(() => {
13095
13119
  if (!t || !n || !e)
13096
13120
  return;
13097
13121
  const a = `sheet.operation.editor-${t.getEditorId()}-keyboard-${s}`, c = new In();
@@ -13123,7 +13147,7 @@ const Df = (n, e, t, o) => {
13123
13147
  const r = Z(T), s = Z(Bo), i = ke(e);
13124
13148
  i.current = e;
13125
13149
  const a = ke(o);
13126
- a.current = o, Ce(() => {
13150
+ a.current = o, ve(() => {
13127
13151
  if (!t || !n)
13128
13152
  return;
13129
13153
  const d = `sheet.formula-embedding-editor.${t.getEditorId()}`, l = new In(), A = (u, g) => {
@@ -13180,7 +13204,7 @@ const Df = (n, e, t, o) => {
13180
13204
  };
13181
13205
  function wf(n, e) {
13182
13206
  const t = Z(T);
13183
- Ce(() => {
13207
+ ve(() => {
13184
13208
  if (!n) return;
13185
13209
  const o = t.onCommandExecuted((r) => {
13186
13210
  var s, i;
@@ -13204,7 +13228,7 @@ const Pf = (n, e = !0, t, o) => {
13204
13228
  height: l
13205
13229
  }), a == null || a.resize(d, l);
13206
13230
  }
13207
- }, [n, e]), s = Te(() => kr(() => {
13231
+ }, [n, e]), s = De(() => kr(() => {
13208
13232
  var I, S;
13209
13233
  if (!t || !n || !t)
13210
13234
  return;
@@ -13226,7 +13250,7 @@ const Pf = (n, e = !0, t, o) => {
13226
13250
  minThumbSizeV: 8
13227
13251
  })) : l == null || l.resetCanvasSizeAndUpdateScroll(), o && (l == null || l.scrollToBarPos({ x: 0, y: 1 / 0 }))) : (f = null, l == null || l.scrollToBarPos({ x: 0, y: 0 }), (I = l == null ? void 0 : l.getScrollBar()) == null || I.dispose());
13228
13252
  }, 30), [n, t, e, o]);
13229
- return Ce(() => {
13253
+ return ve(() => {
13230
13254
  if (t && n) {
13231
13255
  const i = setTimeout(() => {
13232
13256
  r(), s();
@@ -13235,7 +13259,7 @@ const Pf = (n, e = !0, t, o) => {
13235
13259
  clearTimeout(i);
13236
13260
  };
13237
13261
  }
13238
- }, [n, t, r, s]), Ce(() => {
13262
+ }, [n, t, r, s]), ve(() => {
13239
13263
  if (t && n) {
13240
13264
  const i = n.input$.subscribe(() => {
13241
13265
  s();
@@ -13267,13 +13291,13 @@ const Pf = (n, e = !0, t, o) => {
13267
13291
  noStyle: I
13268
13292
  } = n;
13269
13293
  Z(ze);
13270
- const S = mn(o), C = mn(s), [R, E] = Ee(u), b = ke(null), x = Te(() => l != null ? l : el(`RICH_TEXT_EDITOR-${ge(4)}`), [l]), v = Tf({
13294
+ const S = mn(o), C = mn(s), [R, E] = me(u), b = ke(null), x = De(() => l != null ? l : el(`RICH_TEXT_EDITOR-${ge(4)}`), [l]), v = Tf({
13271
13295
  editorId: x,
13272
13296
  initialValue: r,
13273
13297
  container: b,
13274
13298
  autoFocus: t,
13275
13299
  isSingle: d
13276
- }), y = Z(ue).getRenderById(x), M = Mf(x), w = ke(null), [H, N] = Ee(() => {
13300
+ }), y = Z(ue).getRenderById(x), M = Mf(x), w = ke(null), [H, N] = me(() => {
13277
13301
  var j, P;
13278
13302
  return !re.transform.getPlainText((P = (j = v == null ? void 0 : v.getDocumentData().body) == null ? void 0 : j.dataStream) != null ? P : "");
13279
13303
  }), { checkScrollBar: L } = Pf(v, d, !0, !0);
@@ -13291,7 +13315,7 @@ const Pf = (n, e = !0, t, o) => {
13291
13315
  const P = y == null ? void 0 : y.with(ce), F = P == null ? void 0 : P.getSkeleton().getActualSize();
13292
13316
  F && (A == null || A(F.actualHeight), E(Math.max(u, Math.min(F.actualHeight + 10, g)))), h == null || h(j, no((se = (q = j.body) == null ? void 0 : q.dataStream) != null ? se : "")), L();
13293
13317
  });
13294
- return Ce(() => {
13318
+ return ve(() => {
13295
13319
  var P, F;
13296
13320
  N(!re.transform.getPlainText((F = (P = v == null ? void 0 : v.getDocumentData().body) == null ? void 0 : P.dataStream) != null ? F : ""));
13297
13321
  const j = v == null ? void 0 : v.selectionChange$.subscribe(() => {
@@ -13299,7 +13323,7 @@ const Pf = (n, e = !0, t, o) => {
13299
13323
  N(!re.transform.getPlainText((se = (q = v == null ? void 0 : v.getDocumentData().body) == null ? void 0 : q.dataStream) != null ? se : ""));
13300
13324
  });
13301
13325
  return () => j == null ? void 0 : j.unsubscribe();
13302
- }, [v]), tt(v == null ? void 0 : v.blur$), tt(v == null ? void 0 : v.focus$), Ce(() => {
13326
+ }, [v]), at(v == null ? void 0 : v.blur$), at(v == null ? void 0 : v.focus$), ve(() => {
13303
13327
  var P, F;
13304
13328
  const j = v == null ? void 0 : v.getDocumentData();
13305
13329
  S == null || S(M, no((F = (P = j == null ? void 0 : j.body) == null ? void 0 : P.dataStream) != null ? F : ""));
@@ -13310,7 +13334,7 @@ const Pf = (n, e = !0, t, o) => {
13310
13334
  {
13311
13335
  "univer-border-primary-500": M && !I,
13312
13336
  "\n univer-relative univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center\n univer-justify-around univer-gap-2 univer-rounded-md univer-pb-0.5 univer-pl-1.5 univer-pr-2\n univer-pt-1.5\n ": !I,
13313
- "univer-h-full univer-w-full": I,
13337
+ "univer-size-full": I,
13314
13338
  [Nn]: !I
13315
13339
  }
13316
13340
  ),