@univerjs/docs-ui 1.3.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +7 -75
  2. package/lib/cjs/facade.js +1 -3
  3. package/lib/cjs/index.js +384 -523
  4. package/lib/cjs/locale/ar-SA.js +2 -2
  5. package/lib/cjs/locale/ca-ES.js +2 -2
  6. package/lib/cjs/locale/de-DE.js +2 -2
  7. package/lib/cjs/locale/en-US.js +2 -2
  8. package/lib/cjs/locale/es-ES.js +2 -2
  9. package/lib/cjs/locale/fa-IR.js +2 -2
  10. package/lib/cjs/locale/fr-FR.js +2 -2
  11. package/lib/cjs/locale/id-ID.js +2 -2
  12. package/lib/cjs/locale/it-IT.js +2 -2
  13. package/lib/cjs/locale/ja-JP.js +2 -2
  14. package/lib/cjs/locale/ko-KR.js +2 -2
  15. package/lib/cjs/locale/pl-PL.js +2 -2
  16. package/lib/cjs/locale/pt-BR.js +2 -2
  17. package/lib/cjs/locale/ru-RU.js +2 -2
  18. package/lib/cjs/locale/sk-SK.js +2 -2
  19. package/lib/cjs/locale/vi-VN.js +2 -2
  20. package/lib/cjs/locale/zh-CN.js +2 -2
  21. package/lib/cjs/locale/zh-HK.js +2 -2
  22. package/lib/cjs/locale/zh-TW.js +2 -2
  23. package/lib/es/facade.js +1 -2
  24. package/lib/es/index.js +384 -522
  25. package/lib/es/locale/ar-SA.js +2 -2
  26. package/lib/es/locale/ca-ES.js +2 -2
  27. package/lib/es/locale/de-DE.js +2 -2
  28. package/lib/es/locale/en-US.js +2 -2
  29. package/lib/es/locale/es-ES.js +2 -2
  30. package/lib/es/locale/fa-IR.js +2 -2
  31. package/lib/es/locale/fr-FR.js +2 -2
  32. package/lib/es/locale/id-ID.js +2 -2
  33. package/lib/es/locale/it-IT.js +2 -2
  34. package/lib/es/locale/ja-JP.js +2 -2
  35. package/lib/es/locale/ko-KR.js +2 -2
  36. package/lib/es/locale/pl-PL.js +2 -2
  37. package/lib/es/locale/pt-BR.js +2 -2
  38. package/lib/es/locale/ru-RU.js +2 -2
  39. package/lib/es/locale/sk-SK.js +2 -2
  40. package/lib/es/locale/vi-VN.js +2 -2
  41. package/lib/es/locale/zh-CN.js +2 -2
  42. package/lib/es/locale/zh-HK.js +2 -2
  43. package/lib/es/locale/zh-TW.js +2 -2
  44. package/lib/facade.js +1 -2
  45. package/lib/index.css +4 -21
  46. package/lib/index.js +384 -522
  47. package/lib/locale/ar-SA.js +2 -2
  48. package/lib/locale/ca-ES.js +2 -2
  49. package/lib/locale/de-DE.js +2 -2
  50. package/lib/locale/en-US.js +2 -2
  51. package/lib/locale/es-ES.js +2 -2
  52. package/lib/locale/fa-IR.js +2 -2
  53. package/lib/locale/fr-FR.js +2 -2
  54. package/lib/locale/id-ID.js +2 -2
  55. package/lib/locale/it-IT.js +2 -2
  56. package/lib/locale/ja-JP.js +2 -2
  57. package/lib/locale/ko-KR.js +2 -2
  58. package/lib/locale/pl-PL.js +2 -2
  59. package/lib/locale/pt-BR.js +2 -2
  60. package/lib/locale/ru-RU.js +2 -2
  61. package/lib/locale/sk-SK.js +2 -2
  62. package/lib/locale/vi-VN.js +2 -2
  63. package/lib/locale/zh-CN.js +2 -2
  64. package/lib/locale/zh-HK.js +2 -2
  65. package/lib/locale/zh-TW.js +2 -2
  66. package/lib/types/commands/commands/doc-paragraph-setting.command.d.ts +1 -1
  67. package/lib/types/commands/commands/table/doc-table-create.command.d.ts +2 -2
  68. package/lib/types/controllers/components.controller.d.ts +0 -1
  69. package/lib/types/controllers/mobile/components.controller.d.ts +0 -1
  70. package/lib/types/locale/en-US.d.ts +1 -0
  71. package/lib/types/menu/mobile-schema.d.ts +5 -4
  72. package/lib/types/menu/paragraph-menu.d.ts +2 -2
  73. package/lib/types/services/clipboard/clipboard.service.d.ts +1 -1
  74. package/lib/types/services/clipboard/doc-paste-mutation-adapter.service.d.ts +1 -1
  75. package/lib/types/services/clipboard/paste-options.d.ts +6 -6
  76. package/lib/types/services/clipboard/udm-to-html/convertor.d.ts +1 -1
  77. package/lib/types/services/doc-render-background.d.ts +1 -1
  78. package/lib/types/services/editor/editor-manager.service.d.ts +1 -1
  79. package/lib/types/services/editor/editor.d.ts +1 -1
  80. package/lib/types/services/selection/text-range.d.ts +2 -2
  81. package/lib/types/views/header-footer/panel/DocHeaderFooterPanel.d.ts +1 -1
  82. package/lib/types/views/header-footer/panel/use-header-footer-options.d.ts +2 -2
  83. package/lib/types/views/paragraph-setting/ParagraphWordWrapSetting.d.ts +16 -0
  84. package/lib/types/views/paragraph-setting/hook/utils.d.ts +2 -2
  85. package/lib/types/views/rich-text-editor/hooks/use-resize.d.ts +1 -1
  86. package/lib/types/views/section-setting/use-section-setting.d.ts +13 -13
  87. package/lib/umd/index.js +16 -16
  88. package/lib/umd/locale/ar-SA.js +1 -1
  89. package/lib/umd/locale/ca-ES.js +1 -1
  90. package/lib/umd/locale/de-DE.js +1 -1
  91. package/lib/umd/locale/en-US.js +1 -1
  92. package/lib/umd/locale/es-ES.js +1 -1
  93. package/lib/umd/locale/fa-IR.js +1 -1
  94. package/lib/umd/locale/fr-FR.js +1 -1
  95. package/lib/umd/locale/id-ID.js +1 -1
  96. package/lib/umd/locale/it-IT.js +1 -1
  97. package/lib/umd/locale/ja-JP.js +1 -1
  98. package/lib/umd/locale/ko-KR.js +1 -1
  99. package/lib/umd/locale/pl-PL.js +1 -1
  100. package/lib/umd/locale/pt-BR.js +1 -1
  101. package/lib/umd/locale/ru-RU.js +1 -1
  102. package/lib/umd/locale/sk-SK.js +1 -1
  103. package/lib/umd/locale/vi-VN.js +1 -1
  104. package/lib/umd/locale/zh-CN.js +1 -1
  105. package/lib/umd/locale/zh-HK.js +1 -1
  106. package/lib/umd/locale/zh-TW.js +1 -1
  107. package/package.json +16 -16
package/lib/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BaselineOffset, BlockType, BooleanNumber, BuildTextUtils, COLORS, ColorKit, ColumnSeparatorType, CommandType, CustomDecorationType, CustomRangeType, DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_ABOVE, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOC_RANGE_TYPE, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, DeleteDirection, DependentOn, Direction, Disposable, DisposableCollection, DocumentBlockRangeType, DocumentBlockType, DocumentFlavor, DrawingTypeEnum, EDITOR_ACTIVATED, ErrorService, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_UNIVER_EDITOR, HorizontalAlign, ICommandService, IConfigService, IConfirmService, IContextService, ILogService, IPermissionService, IUndoRedoService, IUniverInstanceService, ImageSourceType, Inject, Injector, InterceptorManager, JSON1, JSONX, LOCALE_META, LRUMap, ListGlyphType, LocaleService, MODERN_DOCUMENT_DEFAULT_MARGIN, MODERN_DOCUMENT_WIDTH, MemoryCursor, ModernDocumentWidthMode, NAMED_STYLE_MAP, NamedStyleType, ObjectPermissionService, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PAGE_SIZE, PAPER_TYPES, PRESERVE_INSERTED_PARAGRAPH_IDS, PRESET_LIST_TYPE, PageOrientType, Plugin, PositionedObjectLayoutType, PresetListType, QuickListTypeMap, RANGE_DIRECTION, Rectangle, RedoCommand, RegionService, RichTextBuilder, RxDisposable, SHEET_EDITOR_UNITS, SectionType, SliceBodyType, SpacingRule, TableAlignmentType, TableRowHeightRule, TableSizeType, TableTextWrapType, TextX, TextXActionType, ThemeService, Tools, UndoCommand, UniverInstanceType, UpdateDocsAttributeType, VerticalAlign, checkForSubstrings, cloneBodyWithFreshParagraphIds, containsInteriorInsertionOffset, createIdentifier, createInterceptorKey, createInternalEditorID, createParagraphId, createSectionId, debounce, fromEventSubject, generateRandomId, getBlockRangeInterval, getBodySlice, getBodySliceForTextXAction, getColorStyle, getCustomBlockIdsInSelections, getParagraphContentStartOffset, getParagraphContentStartOffsets, getPlainText, getRichTextEditPath, getSectionHeaderFooterReferenceKey, getTableRangeInterval, getTextRunSlice, isCommentEditorID, isInternalEditorID, isSafeUrl, merge, mergeOverrideWithDependencies, normalizeBody, remove, resolveDocumentParagraphStyle, resolveSectionHeaderFooterReference, resolveSectionHeaderFooterReferences, sequenceExecuteAsync, skipParseTagNames, toDisposable, touchDependencies, validateDocBodyStructure } from "@univerjs/core";
1
+ import { BaselineOffset, BlockType, BooleanNumber, BuildTextUtils, COLORS, ColorKit, ColumnSeparatorType, CommandType, CustomDecorationType, CustomRangeType, DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_ABOVE, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOC_RANGE_TYPE, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, DeleteDirection, DependentOn, Direction, Disposable, DisposableCollection, DocumentBlockRangeType, DocumentBlockType, DocumentFlavor, DrawingTypeEnum, EDITOR_ACTIVATED, ErrorService, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_UNIVER_EDITOR, HorizontalAlign, ICommandService, IConfigService, IConfirmService, IContextService, ILogService, IPermissionService, IUndoRedoService, IUniverInstanceService, ImageSourceType, Inject, Injector, InterceptorManager, JSON1, JSONX, LOCALE_META, LRUMap, ListGlyphType, LocaleService, MODERN_DOCUMENT_DEFAULT_MARGIN, MODERN_DOCUMENT_WIDTH, MemoryCursor, ModernDocumentWidthMode, NAMED_STYLE_MAP, NamedStyleType, ObjectPermissionService, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PAGE_SIZE, PAPER_TYPES, PRESERVE_INSERTED_PARAGRAPH_IDS, PRESET_LIST_TYPE, PageOrientType, Plugin, PositionedObjectLayoutType, PresetListType, QuickListTypeMap, RANGE_DIRECTION, Rectangle, RedoCommand, RegionService, RichTextBuilder, RxDisposable, SHEET_EDITOR_UNITS, SectionType, SliceBodyType, SpacingRule, TableAlignmentType, TableRowHeightRule, TableSizeType, TableTextWrapType, TextX, TextXActionType, ThemeService, Tools, UndoCommand, UniverInstanceType, UpdateDocsAttributeType, VerticalAlign, checkForSubstrings, cloneBodyWithFreshParagraphIds, containsInteriorInsertionOffset, createIdentifier, createInterceptorKey, createInternalEditorID, createParagraphId, createSectionId, debounce, fromEventSubject, generateRandomId, getBlockRangeInterval, getBodySlice, getBodySliceForTextXAction, getColorStyle, getCustomBlockIdsInSelections, getParagraphContentStartOffset, getParagraphContentStartOffsets, getPlainText, getRichTextEditPath, getSectionHeaderFooterReferenceKey, getTableRangeInterval, getTextRunSlice, isCommentEditorID, isInternalEditorID, isSafeUrl, merge, mergeOverrideWithDependencies, normalizeBody, remove, resolveDocumentParagraphStyle, resolveDocumentParagraphWordWrap, resolveSectionHeaderFooterReference, resolveSectionHeaderFooterReferences, sequenceExecuteAsync, skipParseTagNames, toDisposable, touchDependencies, validateDocBodyStructure } from "@univerjs/core";
2
2
  import { CreateHeaderFooterCommand, DeleteTextCommand, DocBlockMoveValidatorService, DocContentInsertService, DocHistoryAction, DocInterceptorService, DocLayoutExecutorService, DocLayoutExecutorState, DocLayoutSessionStatus, DocSelectionManagerService, DocSkeletonManagerService, DocStateChangeManagerService, DocStateEmitService, HeaderFooterType, IDocStateChangeInterceptorService, InsertDocumentColumnBreakCommand, InsertDocumentSectionBreakCommand, InsertTextCommand, RichTextEditingMutation, SetDocumentPermissionCommand, SetHeadingCollapsedCommand, SetSectionHeaderFooterLinkCommand, SetTextSelectionsOperation, UniverDocsPlugin, UpdateDocumentSectionCommand, UpdateTextCommand, buildDocTransform, canEditDocumentTargets, consumeContentInsertRange, createSectionColumnProperties, generateParagraphs, getDocumentEditTargetObjectIds, getDocumentParagraphPermissionObjectId, getDocumentPermissionValue, getDocumentSectionPermissionObjectId, getTopLevelSectionBreaks, isSheetLikeDocsCustomBlockChildType, resolveDocsCustomBlockSize, shouldUseInlineTextSelectionForDocsCustomBlockDrawing, transformDocumentTextRanges } from "@univerjs/docs";
3
3
  import * as EngineRender from "@univerjs/engine-render";
4
4
  import { BaseObject, CURSOR_TYPE, DRAWING_OBJECT_UPPER_LAYER_INDEX, DeviceInputEventType, DocBackground, DocumentEditArea, DocumentSkeletonPageType, DocumentViewModel, Documents, GlyphType, IRenderManagerService, Layer, LineType, Liquid, NORMAL_TEXT_SELECTION_PLUGIN_STYLE, PageLayoutType, Path, RENDER_CLASS_TYPE, Rect, RegularPolygon, ScrollBar, ScrollTimer, Shape, TRANSFORM_CHANGE_OBSERVABLE_TYPE, UniverRenderEnginePlugin, Vector2, Viewport, compareDocumentSkeletonNestedPagePathOrder, documentSkeletonLineIterator, documentSkeletonTableIterator, getColor, getDocsTableRenderViewport, getDocsTableViewportLeft, getDocumentSkeletonColumnPagePathInfo, getDocumentSkeletonNestedPageOffset, getLastColumn, getNextWheelZoomRatio, getNumberUnitValue, getOffsetRectForDom, getPageFromPath, getParagraphByGlyph, getSystemHighlightColor, getTableIdAndSliceIndex, getTopmostDocsTableHit, hasListGlyph, isFirstGlyph, isIndentByGlyph, parseDataStreamToTree, pixelToPt, ptToPixel, pxToNum, registerDocumentLayoutPresentation } from "@univerjs/engine-render";
@@ -12,7 +12,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
12
  import { AddImageIcon, AlignTextBothIcon, BoldIcon, CalendarIcon, CatalogueIcon, CheckMarkIcon, CloseIcon, ColorWheelMultiIcon, ColumnIcon, CopyDoubleIcon, CutIcon, DeleteColumnDoubleIcon, DeleteIcon, DeleteRowDoubleIcon, DeleteTableDoubleIcon, DocPasteOptionsIcon, DocSettingIcon, DownIcon, FontColorDoubleIcon, GridIcon, H1Icon, H2Icon, H3Icon, H4Icon, H5Icon, HeaderFooterIcon, HorizontallyIcon, InsertBelowDoubleIcon, InsertDoubleIcon, InsertRowAboveDoubleIcon, InsertRowBelowDoubleIcon, ItalicIcon, KeyboardIcon, LeftInsertColumnDoubleIcon, LeftJustifyingIcon, LineIndentDecreaseIcon, LineIndentIncreaseIcon, LoadingMultiIcon, MenuIcon, MoreDownIcon, MoreHorizontalIcon, MoreLeftIcon, MoreRightIcon, NoColorDoubleIcon, NumberIcon, OrderIcon, PaintBucketDoubleIcon, ParagraphSettingIcon, PasteSpecialDoubleIcon, QuickAddIcon, ReduceDoubleIcon, ReduceIcon, RightInsertColumnDoubleIcon, RightJustifyingIcon, SectionSettingIcon, ShapeIcon, SmileIcon, StatisticalFunctionIcon, StrikethroughIcon, SubscriptIcon, SubtitleTypeIcon, SuperscriptIcon, SymbolsIcon, TextColorSwatchDoubleIcon, TextIcon, TextTypeIcon, TitleTypeIcon, TodoListDoubleIcon, UnderlineIcon, UnorderIcon, WriteIcon, ZoomInIcon } from "@univerjs/icons";
13
13
  import { getDrawingShapeKeyByDrawingSearch } from "@univerjs/drawing";
14
14
 
15
- //#region src/basics/docs-view-key.ts
15
+ // src/basics/docs-view-key.ts
16
16
  /**
17
17
  * Copyright 2023-present DreamNum Co., Ltd.
18
18
  *
@@ -46,8 +46,7 @@ const DOCS_COMPONENT_HEADER_LAYER_INDEX = 4;
46
46
  const DOCS_COMPONENT_DEFAULT_Z_INDEX = 10;
47
47
  const NORMAL_TEXT_SELECTION_PLUGIN_NAME = "normalTextSelectionPluginName";
48
48
 
49
- //#endregion
50
- //#region src/basics/component-tools.ts
49
+ // src/basics/component-tools.ts
51
50
  function neoGetDocObject(renderContext) {
52
51
  const { mainComponent, scene, engine, components } = renderContext;
53
52
  return {
@@ -69,8 +68,7 @@ function getDocObjectById(unitId, renderManagerService) {
69
68
  };
70
69
  }
71
70
 
72
- //#endregion
73
- //#region src/basics/custom-decoration-factory.ts
71
+ // src/basics/custom-decoration-factory.ts
74
72
  function addCustomDecorationFactory(param) {
75
73
  const { unitId, ranges, id, type, segmentId } = param;
76
74
  const doMutation = {
@@ -136,8 +134,7 @@ function deleteCustomDecorationFactory(accessor, params) {
136
134
  return doMutation;
137
135
  }
138
136
 
139
- //#endregion
140
- //#region src/basics/doc-custom-range-chrome.ts
137
+ // src/basics/doc-custom-range-chrome.ts
141
138
  const DOC_CUSTOM_RANGE_CHROME_RADIUS = 1;
142
139
  const DOC_CUSTOM_RANGE_CHROME_BACKGROUND_ALPHA = .07;
143
140
  function resolveDocCustomRangeChromeTheme(themeService) {
@@ -159,8 +156,7 @@ function drawDocCustomRangeChrome(ctx, rect, theme) {
159
156
  ctx.restore();
160
157
  }
161
158
 
162
- //#endregion
163
- //#region src/basics/paragraph.ts
159
+ // src/basics/paragraph.ts
164
160
  function isTopLevelStructuralGap(dataStream, offset) {
165
161
  const previousToken = dataStream[offset - 1];
166
162
  const nextToken = dataStream[offset];
@@ -241,8 +237,7 @@ function getCustomDecorationAtPosition(customDecorations, position) {
241
237
  return customDecorations.filter((customDecoration) => position > customDecoration.startIndex && position <= customDecoration.endIndex);
242
238
  }
243
239
 
244
- //#endregion
245
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
240
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
246
241
  function _typeof(o) {
247
242
  "@babel/helpers - typeof";
248
243
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -252,28 +247,25 @@ function _typeof(o) {
252
247
  }, _typeof(o);
253
248
  }
254
249
 
255
- //#endregion
256
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
257
- function toPrimitive(t, r) {
250
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
251
+ function toPrimitive(t, e) {
258
252
  if ("object" != _typeof(t) || !t) return t;
259
- var e = t[Symbol.toPrimitive];
260
- if (void 0 !== e) {
261
- var i = e.call(t, r || "default");
253
+ var r;
254
+ if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
255
+ var i = r.call(t, e || "default");
262
256
  if ("object" != _typeof(i)) return i;
263
257
  throw new TypeError("@@toPrimitive must return a primitive value.");
264
258
  }
265
- return ("string" === r ? String : Number)(t);
259
+ return ("string" === e ? String : Number)(t);
266
260
  }
267
261
 
268
- //#endregion
269
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
262
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
270
263
  function toPropertyKey(t) {
271
264
  var i = toPrimitive(t, "string");
272
265
  return "symbol" == _typeof(i) ? i : i + "";
273
266
  }
274
267
 
275
- //#endregion
276
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
268
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
277
269
  function _defineProperty(e, r, t) {
278
270
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
279
271
  value: t,
@@ -283,16 +275,14 @@ function _defineProperty(e, r, t) {
283
275
  }) : e[r] = t, e;
284
276
  }
285
277
 
286
- //#endregion
287
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
278
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
288
279
  function __decorateParam(paramIndex, decorator) {
289
280
  return function(target, key) {
290
281
  decorator(target, key, paramIndex);
291
282
  };
292
283
  }
293
284
 
294
- //#endregion
295
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
285
+ // \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
296
286
  function __decorate(decorators, target, key, desc) {
297
287
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
298
288
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -300,8 +290,7 @@ function __decorate(decorators, target, key, desc) {
300
290
  return c > 3 && r && Object.defineProperty(target, key, r), r;
301
291
  }
302
292
 
303
- //#endregion
304
- //#region src/services/doc-auto-format.service.ts
293
+ // src/services/doc-auto-format.service.ts
305
294
  let DocAutoFormatService = class DocAutoFormatService extends Disposable {
306
295
  constructor(_univerInstanceService, _textSelectionManagerService) {
307
296
  super();
@@ -348,8 +337,7 @@ let DocAutoFormatService = class DocAutoFormatService extends Disposable {
348
337
  };
349
338
  DocAutoFormatService = __decorate([__decorateParam(0, IUniverInstanceService), __decorateParam(1, Inject(DocSelectionManagerService))], DocAutoFormatService);
350
339
 
351
- //#endregion
352
- //#region src/commands/commands/auto-format.command.ts
340
+ // src/commands/commands/auto-format.command.ts
353
341
  const TabCommandId = "doc.command.tab";
354
342
  const TabCommand = {
355
343
  id: TabCommandId,
@@ -377,8 +365,7 @@ const EnterCommand = {
377
365
  }
378
366
  };
379
367
 
380
- //#endregion
381
- //#region src/services/doc-menu-style.service.ts
368
+ // src/services/doc-menu-style.service.ts
382
369
  const BODY_DEFAULT_FONTSIZE = 11;
383
370
  const HEADER_FOOTER_DEFAULT_FONTSIZE = 9;
384
371
  const DEFAULT_TEXT_STYLE = {
@@ -463,8 +450,7 @@ const SetDocInputStyleCommand = {
463
450
  }
464
451
  };
465
452
 
466
- //#endregion
467
- //#region src/commands/commands/break-line.command.ts
453
+ // src/commands/commands/break-line.command.ts
468
454
  const BreakLineCommand = {
469
455
  id: "doc.command.break-line",
470
456
  type: CommandType.COMMAND,
@@ -623,8 +609,7 @@ const BreakLineCommand = {
623
609
  }
624
610
  };
625
611
 
626
- //#endregion
627
- //#region src/services/clipboard/doc-paste-mutation-adapter.service.ts
612
+ // src/services/clipboard/doc-paste-mutation-adapter.service.ts
628
613
  const IDocClipboardPasteAdapterService = createIdentifier("doc.clipboard-paste-adapter.service");
629
614
  var DocClipboardPasteAdapterService = class {
630
615
  constructor() {
@@ -653,8 +638,7 @@ var DocClipboardPasteAdapterService = class {
653
638
  }
654
639
  };
655
640
 
656
- //#endregion
657
- //#region src/services/clipboard/internal-fragment.ts
641
+ // src/services/clipboard/internal-fragment.ts
658
642
  const DOC_INTERNAL_FRAGMENT_MIME = "application/x-doc-fragment+json";
659
643
  const DOC_INTERNAL_FRAGMENT_COMMENT_PREFIX = "univer-doc-fragment:";
660
644
  function createInternalClipboardFragment(doc) {
@@ -929,8 +913,7 @@ function decodeBase64(value) {
929
913
  return decodeURIComponent(escape(atob(value)));
930
914
  }
931
915
 
932
- //#endregion
933
- //#region src/services/doc-render-background.ts
916
+ // src/services/doc-render-background.ts
934
917
  const DOC_TRADITIONAL_WORKSPACE_BACKGROUND_COLOR = "var(--univer-gray-100)";
935
918
  const DOC_MODERN_WORKSPACE_BACKGROUND_COLOR = "var(--univer-gray-0)";
936
919
  const DOC_UNSPECIFIED_WORKSPACE_BACKGROUND_COLOR = "var(--univer-gray-100)";
@@ -970,8 +953,7 @@ function getDefaultDocCanvasBackgroundToken(documentFlavor) {
970
953
  return documentFlavor === DocumentFlavor.MODERN ? DOC_MODERN_WORKSPACE_BACKGROUND_TOKEN : DOC_TRADITIONAL_WORKSPACE_BACKGROUND_TOKEN;
971
954
  }
972
955
 
973
- //#endregion
974
- //#region src/commands/util.ts
956
+ // src/commands/util.ts
975
957
  /**
976
958
  * Get the skeleton of the command's target.
977
959
  * @param accessor The injection accessor.
@@ -982,8 +964,7 @@ function getCommandSkeleton(accessor, unitId) {
982
964
  return (_renderManagerService = accessor.get(IRenderManagerService).getRenderUnitById(unitId)) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.with(DocSkeletonManagerService);
983
965
  }
984
966
 
985
- //#endregion
986
- //#region src/commands/commands/replace-content.command.ts
967
+ // src/commands/commands/replace-content.command.ts
987
968
  const ReplaceSnapshotCommand = {
988
969
  id: "doc.command-replace-snapshot",
989
970
  type: CommandType.COMMAND,
@@ -1203,8 +1184,7 @@ const ReplaceTextRunsCommand = {
1203
1184
  }
1204
1185
  };
1205
1186
 
1206
- //#endregion
1207
- //#region src/services/doc-embed-integration.service.ts
1187
+ // src/services/doc-embed-integration.service.ts
1208
1188
  const DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE = "data-embed-interaction-boundary-owner";
1209
1189
  var EmbedInteractionBoundaryService = class {
1210
1190
  constructor() {
@@ -1285,8 +1265,7 @@ var EmbedRuntimeFocusCoordinator = class {
1285
1265
  };
1286
1266
  const IDocEmbedRuntimeFocusCoordinator = EmbedRuntimeFocusCoordinator;
1287
1267
 
1288
- //#endregion
1289
- //#region src/services/editor/editor-runtime-config.ts
1268
+ // src/services/editor/editor-runtime-config.ts
1290
1269
  const configs = /* @__PURE__ */ new WeakMap();
1291
1270
  function registerEditorRuntimeConfig(model, config) {
1292
1271
  const registration = { config };
@@ -1302,8 +1281,7 @@ function getEditorRuntimeConfig(model) {
1302
1281
  return (_configs$get = configs.get(model)) === null || _configs$get === void 0 ? void 0 : _configs$get.config;
1303
1282
  }
1304
1283
 
1305
- //#endregion
1306
- //#region src/services/selection/convert-text-range.ts
1284
+ // src/services/selection/convert-text-range.ts
1307
1285
  function findDocRangeNodePositions(skeleton, startIndex, endIndex, segmentId = "", pageIndex = -1) {
1308
1286
  var _skeleton$getViewMode, _skeleton$getViewMode2, _skeleton$getViewMode3, _skeleton$getViewMode4, _skeleton$getViewMode5, _skeleton$getViewMode6;
1309
1287
  const dataStream = (_skeleton$getViewMode = skeleton.getViewModel) === null || _skeleton$getViewMode === void 0 || (_skeleton$getViewMode3 = (_skeleton$getViewMode2 = _skeleton$getViewMode.call(skeleton)).getDataModel) === null || _skeleton$getViewMode3 === void 0 || (_skeleton$getViewMode5 = (_skeleton$getViewMode4 = _skeleton$getViewMode3.call(_skeleton$getViewMode2)).getSelfOrHeaderFooterModel) === null || _skeleton$getViewMode5 === void 0 || (_skeleton$getViewMode5 = _skeleton$getViewMode5.call(_skeleton$getViewMode4, segmentId)) === null || _skeleton$getViewMode5 === void 0 || (_skeleton$getViewMode6 = _skeleton$getViewMode5.getBody) === null || _skeleton$getViewMode6 === void 0 || (_skeleton$getViewMode6 = _skeleton$getViewMode6.call(_skeleton$getViewMode5)) === null || _skeleton$getViewMode6 === void 0 ? void 0 : _skeleton$getViewMode6.dataStream;
@@ -1868,8 +1846,7 @@ function getDocumentUnitId$1(docSkeleton) {
1868
1846
  return ((_viewModel$getDataMod = viewModel.getDataModel) === null || _viewModel$getDataMod === void 0 || (_viewModel$getDataMod3 = (_viewModel$getDataMod2 = _viewModel$getDataMod.call(viewModel)).getUnitId) === null || _viewModel$getDataMod3 === void 0 ? void 0 : _viewModel$getDataMod3.call(_viewModel$getDataMod2)) ?? "";
1869
1847
  }
1870
1848
 
1871
- //#endregion
1872
- //#region src/services/selection/convert-rect-range.ts
1849
+ // src/services/selection/convert-rect-range.ts
1873
1850
  function isValidRectRange(anchorNodePosition, focusNodePosition) {
1874
1851
  const { path: anchorPath } = anchorNodePosition;
1875
1852
  const { path: focusPath } = focusNodePosition;
@@ -2278,8 +2255,7 @@ function rangesEqual(left, right) {
2278
2255
  return left.startRowIndex === right.startRowIndex && left.endRowIndex === right.endRowIndex && left.startColumnIndex === right.startColumnIndex && left.endColumnIndex === right.endColumnIndex;
2279
2256
  }
2280
2257
 
2281
- //#endregion
2282
- //#region src/services/selection/text-range.ts
2258
+ // src/services/selection/text-range.ts
2283
2259
  const TEXT_RANGE_KEY_PREFIX = "__TestSelectionRange__";
2284
2260
  const TEXT_ANCHOR_KEY_PREFIX = "__TestSelectionAnchor__";
2285
2261
  const ID_LENGTH$2 = 6;
@@ -2634,8 +2610,7 @@ var TextRange = class {
2634
2610
  }
2635
2611
  };
2636
2612
 
2637
- //#endregion
2638
- //#region src/services/selection/rect-range.ts
2613
+ // src/services/selection/rect-range.ts
2639
2614
  const RECT_RANGE_KEY_PREFIX = "__DocTableRectRange__";
2640
2615
  const ID_LENGTH$1 = 6;
2641
2616
  function convertPositionsToRectRanges(scene, document, docSkeleton, anchorNodePosition, focusNodePosition, style = NORMAL_TEXT_SELECTION_PLUGIN_STYLE, segmentId = "", segmentPage = -1) {
@@ -2804,8 +2779,7 @@ var RectRange = class {
2804
2779
  }
2805
2780
  };
2806
2781
 
2807
- //#endregion
2808
- //#region src/services/selection/selection-utils.ts
2782
+ // src/services/selection/selection-utils.ts
2809
2783
  function disposeRangeList({ textRanges, rectRanges }) {
2810
2784
  textRanges.forEach((range) => range.dispose());
2811
2785
  rectRanges.forEach((range) => range.dispose());
@@ -3155,8 +3129,7 @@ function serializeRectRange(rectRange) {
3155
3129
  };
3156
3130
  }
3157
3131
 
3158
- //#endregion
3159
- //#region src/services/selection/word-boundary.ts
3132
+ // src/services/selection/word-boundary.ts
3160
3133
  /**
3161
3134
  * Copyright 2023-present DreamNum Co., Ltd.
3162
3135
  *
@@ -3219,8 +3192,7 @@ function getNextWordBoundaryOffset(content, nodeIndex, paragraphStartOffset, dir
3219
3192
  return null;
3220
3193
  }
3221
3194
 
3222
- //#endregion
3223
- //#region src/services/selection/doc-selection-render.service.ts
3195
+ // src/services/selection/doc-selection-render.service.ts
3224
3196
  let DocSelectionRenderService = class DocSelectionRenderService extends RxDisposable {
3225
3197
  get hasPendingSelection() {
3226
3198
  return this._getPendingSelection() != null;
@@ -3537,6 +3509,7 @@ let DocSelectionRenderService = class DocSelectionRenderService extends RxDispos
3537
3509
  return this._getOwnerDocument().activeElement === this._input;
3538
3510
  }
3539
3511
  focus() {
3512
+ this._ensureHostContainer();
3540
3513
  if (!this._input.hasAttribute("tabindex")) this._input.tabIndex = -1;
3541
3514
  this._input.focus({ preventScroll: true });
3542
3515
  }
@@ -4320,8 +4293,7 @@ DocSelectionRenderService = __decorate([
4320
4293
  __decorateParam(8, Optional(IDocEmbedRuntimeFocusCoordinator))
4321
4294
  ], DocSelectionRenderService);
4322
4295
 
4323
- //#endregion
4324
- //#region src/services/editor/editor.ts
4296
+ // src/services/editor/editor.ts
4325
4297
  var Editor = class extends Disposable {
4326
4298
  constructor(_param, _univerInstanceService, _docSelectionManagerService, _commandService, _undoRedoService, _injector) {
4327
4299
  super();
@@ -4550,8 +4522,7 @@ var Editor = class extends Disposable {
4550
4522
  }
4551
4523
  };
4552
4524
 
4553
- //#endregion
4554
- //#region src/services/editor/editor-manager.service.ts
4525
+ // src/services/editor/editor-manager.service.ts
4555
4526
  /**
4556
4527
  * Not these elements will be considered as editor blur.
4557
4528
  */
@@ -4784,8 +4755,7 @@ EditorService = __decorate([
4784
4755
  ], EditorService);
4785
4756
  const IEditorService = createIdentifier("univer.editor.service");
4786
4757
 
4787
- //#endregion
4788
- //#region src/commands/commands/table/table.ts
4758
+ // src/commands/commands/table/table.ts
4789
4759
  function genEmptyTable(rowCount, colCount) {
4790
4760
  let dataStream = DataStreamTreeTokenType.TABLE_START;
4791
4761
  const paragraphs = [];
@@ -5198,8 +5168,7 @@ function getCellOffsets(viewModel, range, position) {
5198
5168
  }
5199
5169
  }
5200
5170
 
5201
- //#endregion
5202
- //#region src/commands/commands/clipboard.inner.command.ts
5171
+ // src/commands/commands/clipboard.inner.command.ts
5203
5172
  function hasRangeInTable(ranges) {
5204
5173
  return ranges.some((range) => {
5205
5174
  const { startNodePosition } = range;
@@ -5762,15 +5731,13 @@ const CutContentCommand = {
5762
5731
  }
5763
5732
  };
5764
5733
 
5765
- //#endregion
5766
- //#region src/utils/horizontal-line.ts
5734
+ // src/utils/horizontal-line.ts
5767
5735
  function isHorizontalLineParagraph(dataStream, paragraph) {
5768
5736
  const paragraphStyle = paragraph === null || paragraph === void 0 ? void 0 : paragraph.paragraphStyle;
5769
5737
  return Array.from(dataStream).every((token) => token === DataStreamTreeTokenType.PARAGRAPH || token === DataStreamTreeTokenType.SECTION_BREAK) && (paragraphStyle === null || paragraphStyle === void 0 ? void 0 : paragraphStyle.borderBottom) != null && paragraphStyle.borderTop == null && paragraphStyle.borderLeft == null && paragraphStyle.borderRight == null && paragraphStyle.borderBetween == null;
5770
5738
  }
5771
5739
 
5772
- //#endregion
5773
- //#region src/commands/operations/doc-cursor.operation.ts
5740
+ // src/commands/operations/doc-cursor.operation.ts
5774
5741
  /**
5775
5742
  * The operation to move cursor in the current document.
5776
5743
  */
@@ -5794,8 +5761,7 @@ const MoveSelectionOperation = {
5794
5761
  }
5795
5762
  };
5796
5763
 
5797
- //#endregion
5798
- //#region src/commands/commands/format-painter.command.ts
5764
+ // src/commands/commands/format-painter.command.ts
5799
5765
  function captureTextFormat(body, range, defaultStyle = {}, lists = {}, document = { documentStyle: {} }) {
5800
5766
  var _body$paragraphs, _document$documentSty;
5801
5767
  const offset = range.startOffset === range.endOffset ? Math.max(0, range.startOffset - 1) : range.startOffset;
@@ -5961,8 +5927,7 @@ const ApplyTextFormatPainterCommand = {
5961
5927
  }
5962
5928
  };
5963
5929
 
5964
- //#endregion
5965
- //#region src/commands/commands/util.ts
5930
+ // src/commands/commands/util.ts
5966
5931
  function getCurrentParagraph(accessor) {
5967
5932
  var _doc$getBody, _doc$getBody2;
5968
5933
  const instanceService = accessor.get(IUniverInstanceService);
@@ -5972,8 +5937,7 @@ function getCurrentParagraph(accessor) {
5972
5937
  return BuildTextUtils.range.getParagraphsInRange(range, ((_doc$getBody = doc.getBody()) === null || _doc$getBody === void 0 ? void 0 : _doc$getBody.paragraphs) ?? [], ((_doc$getBody2 = doc.getBody()) === null || _doc$getBody2 === void 0 ? void 0 : _doc$getBody2.dataStream) ?? "")[0];
5973
5938
  }
5974
5939
 
5975
- //#endregion
5976
- //#region src/commands/commands/doc-delete.command.ts
5940
+ // src/commands/commands/doc-delete.command.ts
5977
5941
  const DeleteCustomBlockCommand = {
5978
5942
  id: "doc.command.delete-custom-block",
5979
5943
  type: CommandType.COMMAND,
@@ -6606,8 +6570,7 @@ const DeleteCurrentParagraphCommand = {
6606
6570
  }
6607
6571
  };
6608
6572
 
6609
- //#endregion
6610
- //#region src/commands/commands/inline-format.command.ts
6573
+ // src/commands/commands/inline-format.command.ts
6611
6574
  function handleInlineFormat(preCommandId, params, commandService) {
6612
6575
  return commandService.executeCommand(SetInlineFormatCommand.id, {
6613
6576
  preCommandId,
@@ -6959,8 +6922,7 @@ function getReverseFormatValueInSelection(textStyle, preCommandId) {
6959
6922
  return getReverseFormatValue(textStyle, key, preCommandId);
6960
6923
  }
6961
6924
 
6962
- //#endregion
6963
- //#region src/services/clipboard/copy-content-cache.ts
6925
+ // src/services/clipboard/copy-content-cache.ts
6964
6926
  const COPY_CONTENT_CACHE_LIMIT = 10;
6965
6927
  function extractId(html) {
6966
6928
  const match = html.match(/data-copy-id="([^\s]+)"/);
@@ -6983,8 +6945,7 @@ var CopyContentCache = class {
6983
6945
  };
6984
6946
  const copyContentCache = new CopyContentCache();
6985
6947
 
6986
- //#endregion
6987
- //#region src/services/clipboard/html-to-udm/parse-node-style.ts
6948
+ // src/services/clipboard/html-to-udm/parse-node-style.ts
6988
6949
  function extractNodeStyle(node) {
6989
6950
  const styles = node.style;
6990
6951
  const docStyles = {};
@@ -7050,8 +7011,7 @@ function extractNodeStyle(node) {
7050
7011
  return docStyles;
7051
7012
  }
7052
7013
 
7053
- //#endregion
7054
- //#region src/services/clipboard/html-to-udm/parse-to-dom.ts
7014
+ // src/services/clipboard/html-to-udm/parse-to-dom.ts
7055
7015
  /**
7056
7016
  * Copyright 2023-present DreamNum Co., Ltd.
7057
7017
  *
@@ -7073,8 +7033,7 @@ function parseToDom(rawHtml) {
7073
7033
  return parser.parseFromString(html, "text/html").querySelector("#univer-root");
7074
7034
  }
7075
7035
 
7076
- //#endregion
7077
- //#region src/services/clipboard/html-to-udm/converter.ts
7036
+ // src/services/clipboard/html-to-udm/converter.ts
7078
7037
  function matchFilter(node, filter) {
7079
7038
  const tagName = node.tagName.toLowerCase();
7080
7039
  if (typeof filter === "string") return tagName === filter;
@@ -7818,8 +7777,7 @@ function stripListMarkerFromCurrentParagraph(body) {
7818
7777
  return length;
7819
7778
  }
7820
7779
 
7821
- //#endregion
7822
- //#region src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
7780
+ // src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
7823
7781
  const LarkPastePlugin = {
7824
7782
  name: "univer-doc-paste-plugin-lark",
7825
7783
  checkPasteType(html) {
@@ -7851,8 +7809,7 @@ const LarkPastePlugin = {
7851
7809
  }]
7852
7810
  };
7853
7811
 
7854
- //#endregion
7855
- //#region src/services/clipboard/html-to-udm/utils.ts
7812
+ // src/services/clipboard/html-to-udm/utils.ts
7856
7813
  function getParagraphStyle(el) {
7857
7814
  const styles = el.style;
7858
7815
  const paragraphStyle = {};
@@ -7893,8 +7850,7 @@ function getHorizontalAlign(value) {
7893
7850
  }
7894
7851
  }
7895
7852
 
7896
- //#endregion
7897
- //#region src/services/clipboard/html-to-udm/paste-plugins/plugin-univer.ts
7853
+ // src/services/clipboard/html-to-udm/paste-plugins/plugin-univer.ts
7898
7854
  const UniverPastePlugin = {
7899
7855
  name: "univer-doc-paste-plugin-univer",
7900
7856
  checkPasteType(html) {
@@ -7920,8 +7876,7 @@ const UniverPastePlugin = {
7920
7876
  }]
7921
7877
  };
7922
7878
 
7923
- //#endregion
7924
- //#region src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
7879
+ // src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
7925
7880
  const WORD_SPACE_PLACEHOLDER_ENTITY = "&#57344;";
7926
7881
  const WORD_TAB_WIDTH = 4;
7927
7882
  const WordPastePlugin = {
@@ -7983,8 +7938,7 @@ function countWordSpaces(content) {
7983
7938
  return ((_text$replace$match = text.replace(/\r?\n/g, "").match(/ /g)) === null || _text$replace$match === void 0 ? void 0 : _text$replace$match.length) ?? 0;
7984
7939
  }
7985
7940
 
7986
- //#endregion
7987
- //#region src/services/clipboard/paste-options.ts
7941
+ // src/services/clipboard/paste-options.ts
7988
7942
  const DOC_PASTE_OPTIONS = [
7989
7943
  {
7990
7944
  value: "source",
@@ -8050,8 +8004,7 @@ function applyDocPasteMode(source, mode, style, text) {
8050
8004
  return doc;
8051
8005
  }
8052
8006
 
8053
- //#endregion
8054
- //#region src/services/clipboard/udm-to-html/convertor.ts
8007
+ // src/services/clipboard/udm-to-html/convertor.ts
8055
8008
  const DEFAULT_CLIPBOARD_FONT_FAMILY = "Arial";
8056
8009
  function stripFieldBoundaryMarkers(value) {
8057
8010
  return value.replaceAll("", "").replaceAll("", "");
@@ -8491,8 +8444,7 @@ var UDMToHtmlService = class {
8491
8444
  }
8492
8445
  };
8493
8446
 
8494
- //#endregion
8495
- //#region src/services/clipboard/udm-to-html/doc-html-export.service.ts
8447
+ // src/services/clipboard/udm-to-html/doc-html-export.service.ts
8496
8448
  var DocHtmlExportService = class extends Disposable {
8497
8449
  constructor(..._args) {
8498
8450
  super(..._args);
@@ -8507,8 +8459,7 @@ var DocHtmlExportService = class extends Disposable {
8507
8459
  }
8508
8460
  };
8509
8461
 
8510
- //#endregion
8511
- //#region src/services/clipboard/clipboard.service.ts
8462
+ // src/services/clipboard/clipboard.service.ts
8512
8463
  HtmlToUDMService.use(LarkPastePlugin);
8513
8464
  HtmlToUDMService.use(UniverPastePlugin);
8514
8465
  HtmlToUDMService.use(WordPastePlugin);
@@ -9301,8 +9252,7 @@ function dataUrlToFile(dataUrl, fallbackName) {
9301
9252
  return new File([bytes], `${fallbackName}.${extension}`, { type: mimeType });
9302
9253
  }
9303
9254
 
9304
- //#endregion
9305
- //#region src/commands/commands/clipboard.command.ts
9255
+ // src/commands/commands/clipboard.command.ts
9306
9256
  function whenDocOrEditor(contextService) {
9307
9257
  return contextService.getContextValue(FOCUSING_DOC) || contextService.getContextValue(EDITOR_ACTIVATED);
9308
9258
  }
@@ -9413,8 +9363,7 @@ const DocChangePasteModeCommand = {
9413
9363
  }
9414
9364
  };
9415
9365
 
9416
- //#endregion
9417
- //#region src/commands/commands/doc-block-move.command.ts
9366
+ // src/commands/commands/doc-block-move.command.ts
9418
9367
  const DOC_BLOCK_MOVE_BODY_PATCH_KEYS = [
9419
9368
  "paragraphs",
9420
9369
  "sectionBreaks",
@@ -9685,8 +9634,7 @@ function clamp$1(value, min, max) {
9685
9634
  return Math.min(Math.max(value, min), max);
9686
9635
  }
9687
9636
 
9688
- //#endregion
9689
- //#region src/commands/commands/doc-horizontal-line.command.ts
9637
+ // src/commands/commands/doc-horizontal-line.command.ts
9690
9638
  const HorizontalLineCommand = {
9691
9639
  id: "doc.command.horizontal-line",
9692
9640
  type: CommandType.COMMAND,
@@ -9731,8 +9679,7 @@ const InsertHorizontalLineBellowCommand = {
9731
9679
  }
9732
9680
  };
9733
9681
 
9734
- //#endregion
9735
- //#region src/commands/commands/doc-select-all.command.ts
9682
+ // src/commands/commands/doc-select-all.command.ts
9736
9683
  const DocSelectAllCommand = {
9737
9684
  id: "doc.command.select-all",
9738
9685
  type: CommandType.COMMAND,
@@ -9964,8 +9911,7 @@ function getRangeType(range) {
9964
9911
  return range.rangeType ?? DOC_RANGE_TYPE.TEXT;
9965
9912
  }
9966
9913
 
9967
- //#endregion
9968
- //#region src/services/doc-ime-input-manager.service.ts
9914
+ // src/services/doc-ime-input-manager.service.ts
9969
9915
  var DocIMEInputManagerService = class extends RxDisposable {
9970
9916
  constructor(_context) {
9971
9917
  super();
@@ -10062,8 +10008,7 @@ var DocIMEInputManagerService = class extends RxDisposable {
10062
10008
  }
10063
10009
  };
10064
10010
 
10065
- //#endregion
10066
- //#region src/commands/commands/ime-input.command.ts
10011
+ // src/commands/commands/ime-input.command.ts
10067
10012
  const IMEInputCommand = {
10068
10013
  id: "doc.command.ime-input",
10069
10014
  type: CommandType.COMMAND,
@@ -10216,8 +10161,7 @@ function isRectRange(range) {
10216
10161
  return "tableId" in range;
10217
10162
  }
10218
10163
 
10219
- //#endregion
10220
- //#region src/commands/commands/insert-custom-range.command.ts
10164
+ // src/commands/commands/insert-custom-range.command.ts
10221
10165
  const InsertCustomRangeCommand = {
10222
10166
  id: "doc.command.insert-custom-range",
10223
10167
  type: CommandType.COMMAND,
@@ -10245,8 +10189,7 @@ const InsertCustomRangeCommand = {
10245
10189
  }
10246
10190
  };
10247
10191
 
10248
- //#endregion
10249
- //#region src/commands/commands/list.command.ts
10192
+ // src/commands/commands/list.command.ts
10250
10193
  const ListOperationCommand = {
10251
10194
  id: "doc.command.list-operation",
10252
10195
  type: CommandType.COMMAND,
@@ -10620,8 +10563,7 @@ const InsertCheckListBellowCommand = {
10620
10563
  }
10621
10564
  };
10622
10565
 
10623
- //#endregion
10624
- //#region src/commands/commands/paragraph-align.command.ts
10566
+ // src/commands/commands/paragraph-align.command.ts
10625
10567
  const AlignOperationCommand = {
10626
10568
  id: "doc.command.align-action",
10627
10569
  type: CommandType.COMMAND,
@@ -10718,8 +10660,7 @@ const AlignJustifyCommand = {
10718
10660
  }
10719
10661
  };
10720
10662
 
10721
- //#endregion
10722
- //#region src/commands/operations/set-doc-zoom-ratio.operation.ts
10663
+ // src/commands/operations/set-doc-zoom-ratio.operation.ts
10723
10664
  const SetDocZoomRatioUndoMutationFactory = (accessor, params) => {
10724
10665
  const documentModel = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_DOC);
10725
10666
  documentModel === null || documentModel === void 0 || documentModel.setZoomRatio(params.zoomRatio);
@@ -10736,8 +10677,7 @@ const SetDocZoomRatioOperation = {
10736
10677
  }
10737
10678
  };
10738
10679
 
10739
- //#endregion
10740
- //#region src/commands/commands/set-doc-zoom-ratio.command.ts
10680
+ // src/commands/commands/set-doc-zoom-ratio.command.ts
10741
10681
  const SetDocZoomRatioCommand = {
10742
10682
  type: CommandType.COMMAND,
10743
10683
  id: "doc.command.set-zoom-ratio",
@@ -10772,8 +10712,7 @@ const SetDocZoomRatioCommand = {
10772
10712
  }
10773
10713
  };
10774
10714
 
10775
- //#endregion
10776
- //#region src/commands/commands/set-heading.command.ts
10715
+ // src/commands/commands/set-heading.command.ts
10777
10716
  function namedStyleToOutlineLevel(namedStyleType) {
10778
10717
  if (namedStyleType >= NamedStyleType.HEADING_1 && namedStyleType <= NamedStyleType.HEADING_5) return namedStyleType - NamedStyleType.HEADING_1;
10779
10718
  }
@@ -10994,8 +10933,7 @@ const SubtitleHeadingCommand = {
10994
10933
  }
10995
10934
  };
10996
10935
 
10997
- //#endregion
10998
- //#region src/commands/commands/switch-doc-mode.command.ts
10936
+ // src/commands/commands/switch-doc-mode.command.ts
10999
10937
  const SwitchDocModeCommand = {
11000
10938
  id: "doc.command.switch-mode",
11001
10939
  type: CommandType.COMMAND,
@@ -11074,8 +11012,7 @@ const SwitchDocModeCommand = {
11074
11012
  }
11075
11013
  };
11076
11014
 
11077
- //#endregion
11078
- //#region src/commands/commands/table/doc-table-create.command.ts
11015
+ // src/commands/commands/table/doc-table-create.command.ts
11079
11016
  const CreateDocTableCommandId = "doc.command.create-table";
11080
11017
  function buildDocTableInsertBody(params) {
11081
11018
  const { tableDataStream, tableParagraphs, sectionBreaks, tableId, textRun } = params;
@@ -11220,8 +11157,7 @@ const CreateDocTableCommand = {
11220
11157
  }
11221
11158
  };
11222
11159
 
11223
- //#endregion
11224
- //#region src/commands/commands/table/doc-table-delete.command.ts
11160
+ // src/commands/commands/table/doc-table-delete.command.ts
11225
11161
  const DocTableDeleteRowsCommand = {
11226
11162
  id: "doc.table.delete-rows",
11227
11163
  type: CommandType.COMMAND,
@@ -11434,8 +11370,7 @@ const DocTableDeleteTableCommand = {
11434
11370
  }
11435
11371
  };
11436
11372
 
11437
- //#endregion
11438
- //#region src/commands/commands/table/doc-table-insert.command.ts
11373
+ // src/commands/commands/table/doc-table-insert.command.ts
11439
11374
  const DocTableInsertRowCommandId = "doc.command.table-insert-row";
11440
11375
  const DocTableInsertColumnCommandId = "doc.command.table-insert-column";
11441
11376
  const DocTableInsertRowAboveCommandId = "doc.command.table-insert-row-above";
@@ -11647,8 +11582,7 @@ const DocTableInsertColumnCommand = {
11647
11582
  }
11648
11583
  };
11649
11584
 
11650
- //#endregion
11651
- //#region src/commands/commands/table/doc-table-tab.command.ts
11585
+ // src/commands/commands/table/doc-table-tab.command.ts
11652
11586
  const DocTableTabCommand = {
11653
11587
  id: "doc.table.tab-in-table",
11654
11588
  type: CommandType.COMMAND,
@@ -11683,8 +11617,7 @@ const DocTableTabCommand = {
11683
11617
  }
11684
11618
  };
11685
11619
 
11686
- //#endregion
11687
- //#region src/views/table/create/component-name.ts
11620
+ // src/views/table/create/component-name.ts
11688
11621
  /**
11689
11622
  * Copyright 2023-present DreamNum Co., Ltd.
11690
11623
  *
@@ -11702,8 +11635,7 @@ const DocTableTabCommand = {
11702
11635
  */
11703
11636
  const COMPONENT_DOC_CREATE_TABLE_CONFIRM = "COMPONENT_DOC_CREATE_TABLE_CONFIRM";
11704
11637
 
11705
- //#endregion
11706
- //#region src/commands/operations/doc-create-table.operation.ts
11638
+ // src/commands/operations/doc-create-table.operation.ts
11707
11639
  const COMPONENT_DOC_CREATE_TABLE_CONFIRM_ID = "doc.component.create-table-confirm";
11708
11640
  const DocCreateTableOperation = {
11709
11641
  id: "doc.operation.create-table",
@@ -11743,8 +11675,7 @@ const DocCreateTableOperation = {
11743
11675
  }
11744
11676
  };
11745
11677
 
11746
- //#endregion
11747
- //#region src/config/config.ts
11678
+ // src/config/config.ts
11748
11679
  const DOCS_UI_PLUGIN_CONFIG_KEY = "docs-ui.config";
11749
11680
  const DOCS_UI_PLUGIN_NAME = "DOC_UI_PLUGIN";
11750
11681
  const configSymbol = Symbol(DOCS_UI_PLUGIN_CONFIG_KEY);
@@ -11773,8 +11704,7 @@ const defaultPluginMobileConfig = {
11773
11704
  }
11774
11705
  };
11775
11706
 
11776
- //#endregion
11777
- //#region src/controllers/render-controllers/back-scroll.render-controller.ts
11707
+ // src/controllers/render-controllers/back-scroll.render-controller.ts
11778
11708
  const ANCHOR_WIDTH = 1.5;
11779
11709
  const MAX_SELECTION_SCROLL_RETRY_FRAMES = 6e3;
11780
11710
  let DocBackScrollRenderController = class DocBackScrollRenderController extends RxDisposable {
@@ -11999,8 +11929,7 @@ DocBackScrollRenderController = __decorate([
11999
11929
  __decorateParam(3, Inject(DocSkeletonManagerService))
12000
11930
  ], DocBackScrollRenderController);
12001
11931
 
12002
- //#endregion
12003
- //#region src/controllers/render-controllers/doc-paragraph-placeholder.render-controller.ts
11932
+ // src/controllers/render-controllers/doc-paragraph-placeholder.render-controller.ts
12004
11933
  const PLACEHOLDER_COLOR = "gray.300";
12005
11934
  const DEFAULT_PLACEHOLDER_FONT_SIZE = 12;
12006
11935
  const MIN_BODY_TEXT_PLACEHOLDER_FONT_SIZE = 16;
@@ -12206,8 +12135,7 @@ function drawParagraphPlaceholders(ctx, placeholders, color = PLACEHOLDER_COLOR)
12206
12135
  ctx.restore();
12207
12136
  }
12208
12137
 
12209
- //#endregion
12210
- //#region src/components/doc-page-render-component.ts
12138
+ // src/components/doc-page-render-component.ts
12211
12139
  /** Full document pages let whitespace select drawings behind the text. */
12212
12140
  var DocPageRenderComponent = class extends Documents {
12213
12141
  isHit(coord) {
@@ -12247,8 +12175,7 @@ var DocPageRenderComponent = class extends Documents {
12247
12175
  }
12248
12176
  };
12249
12177
 
12250
- //#endregion
12251
- //#region src/services/doc-layout-coordinator.service.ts
12178
+ // src/services/doc-layout-coordinator.service.ts
12252
12179
  const FOREGROUND_BUDGET_MS = 8;
12253
12180
  const WORKER_FOREGROUND_BUDGET_MS = 32;
12254
12181
  const WORKER_BACKGROUND_BUDGET_MS = 128;
@@ -12766,8 +12693,7 @@ var DocLayoutCoordinatorService = class extends Disposable {
12766
12693
  }
12767
12694
  };
12768
12695
 
12769
- //#endregion
12770
- //#region src/services/doc-layout-interaction.service.ts
12696
+ // src/services/doc-layout-interaction.service.ts
12771
12697
  /**
12772
12698
  * Coordinates render-scoped interactions that require the current document
12773
12699
  * skeleton to stay stable until the interaction ends.
@@ -12806,8 +12732,7 @@ var DocLayoutInteractionService = class extends Disposable {
12806
12732
  }
12807
12733
  };
12808
12734
 
12809
- //#endregion
12810
- //#region src/services/doc-zoom.ts
12735
+ // src/services/doc-zoom.ts
12811
12736
  const DEFAULT_DOC_ZOOM_RATIO = 1;
12812
12737
  const DEFAULT_MODERN_DOC_ZOOM_RATIO = 1;
12813
12738
  const DOC_ZOOM_SHORTCUTS = [
@@ -12840,8 +12765,7 @@ function getDocZoomRatio$(commandService, instanceService) {
12840
12765
  }), distinctUntilChanged());
12841
12766
  }
12842
12767
 
12843
- //#endregion
12844
- //#region src/services/doc-view-scale.ts
12768
+ // src/services/doc-view-scale.ts
12845
12769
  function normalizeDocFitToWidthOptions(options) {
12846
12770
  return {
12847
12771
  ...DEFAULT_DOC_FIT_TO_WIDTH_OPTIONS,
@@ -12928,8 +12852,7 @@ let DocViewScaleService = class DocViewScaleService extends Disposable {
12928
12852
  };
12929
12853
  DocViewScaleService = __decorate([__decorateParam(1, IConfigService)], DocViewScaleService);
12930
12854
 
12931
- //#endregion
12932
- //#region src/services/doc-page-layout.service.ts
12855
+ // src/services/doc-page-layout.service.ts
12933
12856
  let DocPageLayoutService = class DocPageLayoutService extends Disposable {
12934
12857
  constructor(_context, _docViewScaleService) {
12935
12858
  super();
@@ -12993,8 +12916,7 @@ let DocPageLayoutService = class DocPageLayoutService extends Disposable {
12993
12916
  };
12994
12917
  DocPageLayoutService = __decorate([__decorateParam(1, Inject(DocViewScaleService))], DocPageLayoutService);
12995
12918
 
12996
- //#endregion
12997
- //#region src/controllers/render-controllers/doc-mutation-layout.ts
12919
+ // src/controllers/render-controllers/doc-mutation-layout.ts
12998
12920
  const BODY_RANGE_COLLECTIONS = /* @__PURE__ */ new Set([
12999
12921
  "blockRanges",
13000
12922
  "columnGroups",
@@ -13289,8 +13211,7 @@ function mapCurrentOffsetToPrevious(offset, invalidation) {
13289
13211
  return offset - (invalidation.newEnd - invalidation.oldEnd);
13290
13212
  }
13291
13213
 
13292
- //#endregion
13293
- //#region src/controllers/render-controllers/doc.render-controller.ts
13214
+ // src/controllers/render-controllers/doc.render-controller.ts
13294
13215
  const DOC_PAGE_MARGIN = 20;
13295
13216
  function getTextXActionLength(action) {
13296
13217
  if (typeof action !== "object" || action == null || !("t" in action) || !("len" in action)) return;
@@ -14388,8 +14309,7 @@ function getPageSizeInModernMode(page) {
14388
14309
  };
14389
14310
  }
14390
14311
 
14391
- //#endregion
14392
- //#region src/basics/selection.ts
14312
+ // src/basics/selection.ts
14393
14313
  function findFirstCursorOffset(snapshot) {
14394
14314
  const { dataStream } = snapshot.body ?? {};
14395
14315
  const EXCLUDE_TOKENS = [
@@ -14412,8 +14332,7 @@ function findFirstCursorOffset(snapshot) {
14412
14332
  return 0;
14413
14333
  }
14414
14334
 
14415
- //#endregion
14416
- //#region src/utils/section-header-footer.ts
14335
+ // src/utils/section-header-footer.ts
14417
14336
  function getDocPageSectionContext(snapshot, page) {
14418
14337
  const sections = snapshot.body ? getTopLevelSectionBreaks(snapshot.body) : [];
14419
14338
  const sectionIndex = (page === null || page === void 0 ? void 0 : page.sectionId) == null ? -1 : sections.findIndex((item) => item.sectionId === page.sectionId);
@@ -14460,8 +14379,7 @@ function getHeaderFooterTarget(viewModel, editArea, segmentPage, page) {
14460
14379
  };
14461
14380
  }
14462
14381
 
14463
- //#endregion
14464
- //#region src/views/header-footer/panel/component-name.ts
14382
+ // src/views/header-footer/panel/component-name.ts
14465
14383
  /**
14466
14384
  * Copyright 2023-present DreamNum Co., Ltd.
14467
14385
  *
@@ -14481,8 +14399,7 @@ const COMPONENT_DOC_HEADER_FOOTER_PANEL = "COMPONENT_DOC_HEADER_FOOTER_PANEL";
14481
14399
  const DOC_HEADER_FOOTER_RIBBON_TAB = "docs-ui.ribbon.header-footer";
14482
14400
  const DOC_HEADER_FOOTER_RIBBON_CONTROL = "DocHeaderFooterRibbonControl";
14483
14401
 
14484
- //#endregion
14485
- //#region src/commands/operations/doc-header-footer-panel.operation.ts
14402
+ // src/commands/operations/doc-header-footer-panel.operation.ts
14486
14403
  const SidebarDocHeaderFooterPanelOperation = {
14487
14404
  id: "sidebar.operation.doc-header-footer-panel",
14488
14405
  type: CommandType.OPERATION,
@@ -14504,8 +14421,7 @@ const SidebarDocHeaderFooterPanelOperation = {
14504
14421
  }
14505
14422
  };
14506
14423
 
14507
- //#endregion
14508
- //#region src/commands/commands/doc-header-footer.command.ts
14424
+ // src/commands/commands/doc-header-footer.command.ts
14509
14425
  const CoreHeaderFooterCommandId = "doc.command.core-header-footer";
14510
14426
  /**
14511
14427
  * The command to update header and footer or create them.
@@ -14652,8 +14568,7 @@ const CloseHeaderFooterCommand = {
14652
14568
  }
14653
14569
  };
14654
14570
 
14655
- //#endregion
14656
- //#region src/utils/date-time-field.ts
14571
+ // src/utils/date-time-field.ts
14657
14572
  function createDateTimeField(format, locale, date) {
14658
14573
  const options = format === "time" ? {
14659
14574
  hour: "2-digit",
@@ -14703,8 +14618,7 @@ function resolveDateTimeField(instruction, locale, date) {
14703
14618
  }
14704
14619
  }
14705
14620
 
14706
- //#endregion
14707
- //#region src/commands/commands/insert-header-footer-field.command.ts
14621
+ // src/commands/commands/insert-header-footer-field.command.ts
14708
14622
  const InsertHeaderFooterFieldCommand = {
14709
14623
  id: "doc.command.insert-header-footer-field",
14710
14624
  type: CommandType.COMMAND,
@@ -14797,8 +14711,7 @@ const InsertHeaderFooterFieldCommand = {
14797
14711
  }
14798
14712
  };
14799
14713
 
14800
- //#endregion
14801
- //#region src/commands/commands/refresh-header-footer-fields.command.ts
14714
+ // src/commands/commands/refresh-header-footer-fields.command.ts
14802
14715
  const RefreshHeaderFooterFieldsCommand = {
14803
14716
  id: "doc.command.refresh-header-footer-fields",
14804
14717
  type: CommandType.COMMAND,
@@ -14886,8 +14799,7 @@ function refreshDateTimeFields(body, locale, date, canEdit) {
14886
14799
  return textX.serialize();
14887
14800
  }
14888
14801
 
14889
- //#endregion
14890
- //#region src/commands/operations/doc-header-footer-ribbon.operation.ts
14802
+ // src/commands/operations/doc-header-footer-ribbon.operation.ts
14891
14803
  const DocHeaderFooterRibbonOperation = {
14892
14804
  id: SidebarDocHeaderFooterPanelOperation.id,
14893
14805
  type: SidebarDocHeaderFooterPanelOperation.type,
@@ -14899,8 +14811,7 @@ const DocHeaderFooterRibbonOperation = {
14899
14811
  }
14900
14812
  };
14901
14813
 
14902
- //#endregion
14903
- //#region src/types/const/padding.ts
14814
+ // src/types/const/padding.ts
14904
14815
  /**
14905
14816
  * Copyright 2023-present DreamNum Co., Ltd.
14906
14817
  *
@@ -14918,8 +14829,7 @@ const DocHeaderFooterRibbonOperation = {
14918
14829
  */
14919
14830
  const DOC_VERTICAL_PADDING = 4;
14920
14831
 
14921
- //#endregion
14922
- //#region src/services/doc-popup-manager.service.ts
14832
+ // src/services/doc-popup-manager.service.ts
14923
14833
  function transformBound2OffsetBound(originBound, scene) {
14924
14834
  const topLeft = transformPosition2Offset(originBound.left, originBound.top, scene);
14925
14835
  const bottomRight = transformPosition2Offset(originBound.right, originBound.bottom, scene);
@@ -15273,8 +15183,7 @@ DocCanvasPopManagerService = __decorate([
15273
15183
  __decorateParam(3, ICommandService)
15274
15184
  ], DocCanvasPopManagerService);
15275
15185
 
15276
- //#endregion
15277
- //#region src/services/doc-event-manager.service.ts
15186
+ // src/services/doc-event-manager.service.ts
15278
15187
  const calcDocRangePositions$1 = (range, documents, skeleton, pageIndex) => {
15279
15188
  const skeletonData = skeleton.getSkeletonData();
15280
15189
  let end = range.collapsed ? range.startOffset : range.endOffset - 1;
@@ -16137,8 +16046,7 @@ function clipRectHorizontally(rect, visibleLeft, visibleRight) {
16137
16046
  };
16138
16047
  }
16139
16048
 
16140
- //#endregion
16141
- //#region src/commands/operations/paragraph-permission.operation.ts
16049
+ // src/commands/operations/paragraph-permission.operation.ts
16142
16050
  const OpenDocParagraphPermissionOperation = {
16143
16051
  id: "doc.operation.open-paragraph-permission",
16144
16052
  type: CommandType.OPERATION,
@@ -16166,8 +16074,7 @@ const OpenDocParagraphPermissionOperation = {
16166
16074
  }
16167
16075
  };
16168
16076
 
16169
- //#endregion
16170
- //#region src/commands/operations/permission-panel.operation.ts
16077
+ // src/commands/operations/permission-panel.operation.ts
16171
16078
  const OpenDocPermissionPanelOperation = {
16172
16079
  id: "doc.operation.open-permission-panel",
16173
16080
  type: CommandType.OPERATION,
@@ -16218,8 +16125,7 @@ const OpenDocPermissionPanelOperation = {
16218
16125
  }
16219
16126
  };
16220
16127
 
16221
- //#endregion
16222
- //#region src/commands/commands/insert-special-character.command.ts
16128
+ // src/commands/commands/insert-special-character.command.ts
16223
16129
  const InsertSpecialCharacterCommand = {
16224
16130
  id: "doc.command.insert-special-character",
16225
16131
  type: CommandType.COMMAND,
@@ -16266,8 +16172,7 @@ const InsertSpecialCharacterCommand = {
16266
16172
  }
16267
16173
  };
16268
16174
 
16269
- //#endregion
16270
- //#region src/commands/operations/insert-break.operation.ts
16175
+ // src/commands/operations/insert-break.operation.ts
16271
16176
  function getCollapsedBodyOffset(selectionManager) {
16272
16177
  const range = selectionManager.getActiveTextRange();
16273
16178
  if (!(range === null || range === void 0 ? void 0 : range.collapsed) || range.segmentId || !Number.isInteger(range.startOffset)) return null;
@@ -16312,8 +16217,7 @@ const InsertDocumentSectionBreakOperation = {
16312
16217
  }
16313
16218
  };
16314
16219
 
16315
- //#endregion
16316
- //#region src/views/PageSettings.tsx
16220
+ // src/views/PageSettings.tsx
16317
16221
  const MODERN_WIDTH_OPTIONS = [
16318
16222
  ModernDocumentWidthMode.NARROW,
16319
16223
  ModernDocumentWidthMode.MEDIUM,
@@ -16489,8 +16393,7 @@ function PageSettings(props) {
16489
16393
  }
16490
16394
  const PAGE_SETTING_COMPONENT_ID = "docs.component.page-setting";
16491
16395
 
16492
- //#endregion
16493
- //#region src/commands/commands/doc-page-setup.command.ts
16396
+ // src/commands/commands/doc-page-setup.command.ts
16494
16397
  const PAGE_FILL_TABLE_TOLERANCE = 2;
16495
16398
  function getPageContentWidth(config) {
16496
16399
  var _config$pageSize;
@@ -16656,8 +16559,7 @@ const DocPageSetupCommand = {
16656
16559
  }
16657
16560
  };
16658
16561
 
16659
- //#endregion
16660
- //#region src/commands/operations/open-page-setting.operation.ts
16562
+ // src/commands/operations/open-page-setting.operation.ts
16661
16563
  const DocOpenPageSettingCommand = {
16662
16564
  id: "docs.operation.open-page-setting",
16663
16565
  type: CommandType.OPERATION,
@@ -16696,8 +16598,7 @@ const DocOpenPageSettingCommand = {
16696
16598
  }
16697
16599
  };
16698
16600
 
16699
- //#endregion
16700
- //#region src/views/EditorColorPicker.tsx
16601
+ // src/views/EditorColorPicker.tsx
16701
16602
  function EditorColorPicker(props) {
16702
16603
  const containerRef = useRef(null);
16703
16604
  const ColorPickerComponent = useDependency(ComponentManager).get(COLOR_PICKER_COMPONENT);
@@ -16718,8 +16619,7 @@ function EditorColorPicker(props) {
16718
16619
  }
16719
16620
  EditorColorPicker.componentKey = "docs.editor-color-picker";
16720
16621
 
16721
- //#endregion
16722
- //#region src/views/const.ts
16622
+ // src/views/const.ts
16723
16623
  /**
16724
16624
  * Copyright 2023-present DreamNum Co., Ltd.
16725
16625
  *
@@ -16737,8 +16637,7 @@ EditorColorPicker.componentKey = "docs.editor-color-picker";
16737
16637
  */
16738
16638
  const COMPONENT_PREFIX = "UI_PLUGIN_DOCS";
16739
16639
 
16740
- //#endregion
16741
- //#region src/views/list-type-picker/Picker.tsx
16640
+ // src/views/list-type-picker/Picker.tsx
16742
16641
  /**
16743
16642
  * Copyright 2023-present DreamNum Co., Ltd.
16744
16643
  *
@@ -16844,8 +16743,7 @@ const BulletListTypePicker = (props) => /* @__PURE__ */ jsx(ListTypePicker, {
16844
16743
  options: bulletOptions
16845
16744
  });
16846
16745
 
16847
- //#endregion
16848
- //#region src/views/list-type-picker/index.ts
16746
+ // src/views/list-type-picker/index.ts
16849
16747
  /**
16850
16748
  * Copyright 2023-present DreamNum Co., Ltd.
16851
16749
  *
@@ -16864,8 +16762,7 @@ const BulletListTypePicker = (props) => /* @__PURE__ */ jsx(ListTypePicker, {
16864
16762
  const ORDER_LIST_TYPE_COMPONENT = `${COMPONENT_PREFIX}_ORDER_LIST_TYPE_COMPONENT`;
16865
16763
  const BULLET_LIST_TYPE_COMPONENT = `${COMPONENT_PREFIX}_BULLET_LIST_TYPE_COMPONENT`;
16866
16764
 
16867
- //#endregion
16868
- //#region src/menu/menu.ts
16765
+ // src/menu/menu.ts
16869
16766
  function shouldSuppressDocMenuStateRefresh(accessor) {
16870
16767
  let univerInstanceService;
16871
16768
  let focusCoordinator;
@@ -18074,8 +17971,7 @@ function PageSettingMenuItemFactory(accessor) {
18074
17971
  };
18075
17972
  }
18076
17973
 
18077
- //#endregion
18078
- //#region src/menu/header-footer-ribbon.ts
17974
+ // src/menu/header-footer-ribbon.ts
18079
17975
  const headerFooterRibbonSchema = {
18080
17976
  [ContextMenuPosition.MAIN_AREA]: { [ContextMenuGroup.FORMAT]: { [UpdateSelectedDocFieldsCommand.id]: {
18081
17977
  order: 1,
@@ -18148,8 +18044,7 @@ const headerFooterRibbonSchema = {
18148
18044
  } }
18149
18045
  };
18150
18046
 
18151
- //#endregion
18152
- //#region src/controllers/doc-paragraph-setting.controller.ts
18047
+ // src/controllers/doc-paragraph-setting.controller.ts
18153
18048
  /**
18154
18049
  * Copyright 2023-present DreamNum Co., Ltd.
18155
18050
  *
@@ -18188,8 +18083,7 @@ let DocParagraphSettingController = class DocParagraphSettingController extends
18188
18083
  };
18189
18084
  DocParagraphSettingController = __decorate([__decorateParam(0, ICommandService), __decorateParam(1, Inject(ISidebarService))], DocParagraphSettingController);
18190
18085
 
18191
- //#endregion
18192
- //#region src/commands/operations/doc-paragraph-setting-panel.operation.ts
18086
+ // src/commands/operations/doc-paragraph-setting-panel.operation.ts
18193
18087
  const DocParagraphSettingPanelOperation = {
18194
18088
  id: "sidebar.operation.doc-paragraph-setting-panel",
18195
18089
  type: CommandType.OPERATION,
@@ -18199,8 +18093,7 @@ const DocParagraphSettingPanelOperation = {
18199
18093
  }
18200
18094
  };
18201
18095
 
18202
- //#endregion
18203
- //#region src/views/section-setting/component-name.ts
18096
+ // src/views/section-setting/component-name.ts
18204
18097
  /**
18205
18098
  * Copyright 2023-present DreamNum Co., Ltd.
18206
18099
  *
@@ -18218,8 +18111,7 @@ const DocParagraphSettingPanelOperation = {
18218
18111
  */
18219
18112
  const DOC_SECTION_SETTING_COMPONENT = "doc_ui_section-setting-panel";
18220
18113
 
18221
- //#endregion
18222
- //#region src/controllers/doc-section-setting.controller.ts
18114
+ // src/controllers/doc-section-setting.controller.ts
18223
18115
  /**
18224
18116
  * Copyright 2023-present DreamNum Co., Ltd.
18225
18117
  *
@@ -18267,8 +18159,7 @@ let DocSectionSettingController = class DocSectionSettingController extends Disp
18267
18159
  };
18268
18160
  DocSectionSettingController = __decorate([__decorateParam(0, Inject(ISidebarService)), __decorateParam(1, Inject(DocSelectionManagerService))], DocSectionSettingController);
18269
18161
 
18270
- //#endregion
18271
- //#region src/commands/operations/doc-section-setting-panel.operation.ts
18162
+ // src/commands/operations/doc-section-setting-panel.operation.ts
18272
18163
  const DocSectionSettingPanelOperation = {
18273
18164
  id: "sidebar.operation.doc-section-setting-panel",
18274
18165
  type: CommandType.OPERATION,
@@ -18278,8 +18169,7 @@ const DocSectionSettingPanelOperation = {
18278
18169
  }
18279
18170
  };
18280
18171
 
18281
- //#endregion
18282
- //#region src/menu/context-menu.ts
18172
+ // src/menu/context-menu.ts
18283
18173
  const getDisableOnCollapsedObservable = (accessor) => {
18284
18174
  const docSelectionManagerService = accessor.get(DocSelectionManagerService);
18285
18175
  return new Observable((subscriber) => {
@@ -18561,8 +18451,7 @@ function PasteRibbonMenuFactory(accessor) {
18561
18451
  };
18562
18452
  }
18563
18453
 
18564
- //#endregion
18565
- //#region src/menu/display.menu.ts
18454
+ // src/menu/display.menu.ts
18566
18455
  const DOC_ZOOM_RATIO_MENU_ID = "doc.menu.zoom-ratio";
18567
18456
  function DocZoomRatioMenuItemFactory(accessor) {
18568
18457
  const commandService = accessor.get(ICommandService);
@@ -18601,8 +18490,7 @@ function DocFullscreenMenuItemFactory(accessor) {
18601
18490
  };
18602
18491
  }
18603
18492
 
18604
- //#endregion
18605
- //#region src/views/paragraph-menu/theme-color.ts
18493
+ // src/views/paragraph-menu/theme-color.ts
18606
18494
  function getHighlightBackgroundColor(themeService, index) {
18607
18495
  const tokenPath = `highlight.background.${index + 1}`;
18608
18496
  const token = themeService.getColorFromTheme(tokenPath);
@@ -18611,8 +18499,7 @@ function getHighlightBackgroundColor(themeService, index) {
18611
18499
  return new ColorKit(color).setAlpha(token.alpha).toRgbString();
18612
18500
  }
18613
18501
 
18614
- //#endregion
18615
- //#region src/menu/paragraph-menu.ts
18502
+ // src/menu/paragraph-menu.ts
18616
18503
  const TEXT_COLORS = [
18617
18504
  "#FE4B4B",
18618
18505
  "#FF8C51",
@@ -19182,8 +19069,7 @@ const ParagraphMenuBackgroundColorSwatchMenuItemFactories = BACKGROUND_COLOR_SWA
19182
19069
  return items;
19183
19070
  }, {});
19184
19071
 
19185
- //#endregion
19186
- //#region src/menu/permission.menu.ts
19072
+ // src/menu/permission.menu.ts
19187
19073
  function DocPermissionMenuItemFactory(accessor) {
19188
19074
  return objectPermissionMenuItemFactory(accessor, OpenDocPermissionPanelOperation.id, UniverInstanceType.UNIVER_DOC, UnitObject.DocumentSection);
19189
19075
  }
@@ -19194,8 +19080,7 @@ function DocParagraphPermissionMenuItemFactory(accessor) {
19194
19080
  };
19195
19081
  }
19196
19082
 
19197
- //#endregion
19198
- //#region src/menu/schema.ts
19083
+ // src/menu/schema.ts
19199
19084
  const floatToolbarMenuSchema = { [FLOAT_TOOLBAR_MENU_POSITION]: { [FLOAT_TEXT_STYLE_MENU_ID]: {
19200
19085
  order: 0,
19201
19086
  menuItemFactory: FloatTextStyleMenuItemFactory
@@ -19228,7 +19113,8 @@ const menuSchema = {
19228
19113
  gridLayout: {
19229
19114
  row: 2,
19230
19115
  column: 1,
19231
- width: 44
19116
+ width: 44,
19117
+ minWidth: 28
19232
19118
  },
19233
19119
  menuItemFactory: BoldMenuItemFactory
19234
19120
  },
@@ -19237,7 +19123,8 @@ const menuSchema = {
19237
19123
  gridLayout: {
19238
19124
  row: 2,
19239
19125
  column: 2,
19240
- width: 44
19126
+ width: 44,
19127
+ minWidth: 28
19241
19128
  },
19242
19129
  menuItemFactory: ItalicMenuItemFactory
19243
19130
  },
@@ -19246,7 +19133,8 @@ const menuSchema = {
19246
19133
  gridLayout: {
19247
19134
  row: 2,
19248
19135
  column: 3,
19249
- width: 44
19136
+ width: 44,
19137
+ minWidth: 28
19250
19138
  },
19251
19139
  menuItemFactory: UnderlineMenuItemFactory
19252
19140
  },
@@ -19255,7 +19143,8 @@ const menuSchema = {
19255
19143
  gridLayout: {
19256
19144
  row: 2,
19257
19145
  column: 4,
19258
- width: 44
19146
+ width: 44,
19147
+ minWidth: 28
19259
19148
  },
19260
19149
  menuItemFactory: StrikeThroughMenuItemFactory
19261
19150
  },
@@ -19264,7 +19153,8 @@ const menuSchema = {
19264
19153
  gridLayout: {
19265
19154
  row: 2,
19266
19155
  column: 6,
19267
- width: 44
19156
+ width: 44,
19157
+ minWidth: 28
19268
19158
  },
19269
19159
  menuItemFactory: SubscriptMenuItemFactory
19270
19160
  },
@@ -19273,7 +19163,8 @@ const menuSchema = {
19273
19163
  gridLayout: {
19274
19164
  row: 2,
19275
19165
  column: 5,
19276
- width: 44
19166
+ width: 44,
19167
+ minWidth: 28
19277
19168
  },
19278
19169
  menuItemFactory: SuperscriptMenuItemFactory
19279
19170
  },
@@ -19283,7 +19174,8 @@ const menuSchema = {
19283
19174
  row: 1,
19284
19175
  column: 1,
19285
19176
  columnSpan: 2,
19286
- width: 96
19177
+ width: 96,
19178
+ minWidth: 72
19287
19179
  },
19288
19180
  menuItemFactory: HeadingSelectorMenuItemFactory
19289
19181
  },
@@ -19293,7 +19185,8 @@ const menuSchema = {
19293
19185
  row: 1,
19294
19186
  column: 7,
19295
19187
  columnSpan: 2,
19296
- width: 96
19188
+ width: 112,
19189
+ minWidth: 108
19297
19190
  },
19298
19191
  menuItemFactory: FontSizeSelectorMenuItemFactory
19299
19192
  },
@@ -19303,7 +19196,8 @@ const menuSchema = {
19303
19196
  row: 1,
19304
19197
  column: 3,
19305
19198
  columnSpan: 4,
19306
- width: 200
19199
+ width: 200,
19200
+ minWidth: 124
19307
19201
  },
19308
19202
  menuItemFactory: FontFamilySelectorMenuItemFactory
19309
19203
  },
@@ -19312,7 +19206,7 @@ const menuSchema = {
19312
19206
  gridLayout: {
19313
19207
  row: 2,
19314
19208
  column: 8,
19315
- width: 44
19209
+ width: 52
19316
19210
  },
19317
19211
  menuItemFactory: TextColorSelectorMenuItemFactory,
19318
19212
  [ResetInlineFormatTextColorCommand.id]: {
@@ -19325,7 +19219,7 @@ const menuSchema = {
19325
19219
  gridLayout: {
19326
19220
  row: 2,
19327
19221
  column: 7,
19328
- width: 44
19222
+ width: 52
19329
19223
  },
19330
19224
  menuItemFactory: BackgroundColorSelectorMenuItemFactory,
19331
19225
  [ResetInlineFormatTextBackgroundColorCommand.id]: {
@@ -20100,8 +19994,7 @@ const menuSchema = {
20100
19994
  }
20101
19995
  };
20102
19996
 
20103
- //#endregion
20104
- //#region src/shortcuts/utils.ts
19997
+ // src/shortcuts/utils.ts
20105
19998
  function whenTextEditorFocused(contextService) {
20106
19999
  return contextService.getContextValue(FOCUSING_UNIVER_EDITOR) && !contextService.getContextValue(FOCUSING_COMMON_DRAWINGS) && (contextService.getContextValue(FOCUSING_DOC) || contextService.getContextValue(EDITOR_ACTIVATED) || contextService.getContextValue(FOCUSING_FX_BAR_EDITOR));
20107
20000
  }
@@ -20112,8 +20005,7 @@ function whenDocAndEditorFocusedWithBreakLine(contextService) {
20112
20005
  return contextService.getContextValue(FOCUSING_DOC) && contextService.getContextValue(FOCUSING_UNIVER_EDITOR) && !contextService.getContextValue(FOCUSING_COMMON_DRAWINGS);
20113
20006
  }
20114
20007
 
20115
- //#endregion
20116
- //#region src/shortcuts/format.shortcut.ts
20008
+ // src/shortcuts/format.shortcut.ts
20117
20009
  const TabShortCut = {
20118
20010
  id: TabCommand.id,
20119
20011
  binding: KeyCode.TAB,
@@ -20131,8 +20023,7 @@ const ShiftTabShortCut = {
20131
20023
  staticParameters: { shift: true }
20132
20024
  };
20133
20025
 
20134
- //#endregion
20135
- //#region src/shortcuts/toolbar.shortcut.ts
20026
+ // src/shortcuts/toolbar.shortcut.ts
20136
20027
  const BoldShortCut = {
20137
20028
  id: SetInlineFormatBoldCommand.id,
20138
20029
  binding: KeyCode.B | MetaKeys.CTRL_COMMAND,
@@ -20194,8 +20085,7 @@ const BulletListShortCut = {
20194
20085
  preconditions: whenDocAndEditorFocused
20195
20086
  };
20196
20087
 
20197
- //#endregion
20198
- //#region src/views/count-bar/ZoomSlider.tsx
20088
+ // src/views/count-bar/ZoomSlider.tsx
20199
20089
  const DOC_ZOOM_RANGE = [10, 400];
20200
20090
  function ZoomSlider() {
20201
20091
  const commandService = useDependency(ICommandService);
@@ -20217,8 +20107,7 @@ function ZoomSlider() {
20217
20107
  });
20218
20108
  }
20219
20109
 
20220
- //#endregion
20221
- //#region src/views/count-bar/CountBar.tsx
20110
+ // src/views/count-bar/CountBar.tsx
20222
20111
  /**
20223
20112
  * Copyright 2023-present DreamNum Co., Ltd.
20224
20113
  *
@@ -20241,8 +20130,7 @@ function CountBar(_props) {
20241
20130
  });
20242
20131
  }
20243
20132
 
20244
- //#endregion
20245
- //#region src/views/doc-statistics/DocPageStatus.tsx
20133
+ // src/views/doc-statistics/DocPageStatus.tsx
20246
20134
  const SCROLL_SETTLE_DELAY = 120;
20247
20135
  const DRAG_TOOLTIP_HIDE_DELAY = 500;
20248
20136
  const EMPTY_DOC_PAGE_STATUS = {
@@ -20399,8 +20287,7 @@ function DocPageStatus() {
20399
20287
  })] });
20400
20288
  }
20401
20289
 
20402
- //#endregion
20403
- //#region src/views/doc-statistics/use-doc-statistics.ts
20290
+ // src/views/doc-statistics/use-doc-statistics.ts
20404
20291
  const STATISTICS_DEBOUNCE_TIME = 200;
20405
20292
  const EMPTY_STATISTICS = {
20406
20293
  words: 0,
@@ -20580,8 +20467,7 @@ function useDocStatistics(calculateLayout = false) {
20580
20467
  };
20581
20468
  }
20582
20469
 
20583
- //#endregion
20584
- //#region src/views/doc-statistics/DocStatistics.tsx
20470
+ // src/views/doc-statistics/DocStatistics.tsx
20585
20471
  const STATISTIC_ROW_GROUPS = [
20586
20472
  [{
20587
20473
  key: "pages",
@@ -20705,8 +20591,7 @@ function DocStatistics() {
20705
20591
  });
20706
20592
  }
20707
20593
 
20708
- //#endregion
20709
- //#region src/services/doc-layout-progress.service.ts
20594
+ // src/services/doc-layout-progress.service.ts
20710
20595
  let DocLayoutProgressService = class DocLayoutProgressService extends RxDisposable {
20711
20596
  constructor(_univerInstanceService) {
20712
20597
  super();
@@ -20742,8 +20627,7 @@ let DocLayoutProgressService = class DocLayoutProgressService extends RxDisposab
20742
20627
  };
20743
20628
  DocLayoutProgressService = __decorate([__decorateParam(0, IUniverInstanceService)], DocLayoutProgressService);
20744
20629
 
20745
- //#endregion
20746
- //#region src/views/DocLayoutProgress.tsx
20630
+ // src/views/DocLayoutProgress.tsx
20747
20631
  function DocLayoutProgress() {
20748
20632
  const localeService = useDependency(LocaleService);
20749
20633
  const progressState = useObservable(useDependency(DocLayoutProgressService).currentProgress$, null);
@@ -20777,8 +20661,7 @@ function DocLayoutProgress() {
20777
20661
  });
20778
20662
  }
20779
20663
 
20780
- //#endregion
20781
- //#region src/views/doc-footer/DocFooter.tsx
20664
+ // src/views/doc-footer/DocFooter.tsx
20782
20665
  function DocFooterContent() {
20783
20666
  const config = useConfigValue(DOCS_UI_PLUGIN_CONFIG_KEY);
20784
20667
  return ((config === null || config === void 0 ? void 0 : config.footer) ?? true) && /* @__PURE__ */ jsxs("div", {
@@ -20796,8 +20679,7 @@ function DocFooter() {
20796
20679
  return /* @__PURE__ */ jsx(DocFooterContent, {});
20797
20680
  }
20798
20681
 
20799
- //#endregion
20800
- //#region src/views/doc-side-menu-layout.ts
20682
+ // src/views/doc-side-menu-layout.ts
20801
20683
  function isDocSideMenuTableOverlapping(outline, table, viewport) {
20802
20684
  if (table.bottom <= outline.top || table.top >= outline.bottom) return false;
20803
20685
  let left = table.left;
@@ -20810,8 +20692,7 @@ function isDocSideMenuTableOverlapping(outline, table, viewport) {
20810
20692
  return right > left && left < outline.right && right > outline.left;
20811
20693
  }
20812
20694
 
20813
- //#endregion
20814
- //#region src/views/SideMenu.tsx
20695
+ // src/views/SideMenu.tsx
20815
20696
  const SideMenu = forwardRef((props, ref) => {
20816
20697
  const { label, menus, onClick, className, style, mode = "side-bar", maxHeight, activeId, open: controlledOpen, onOpenChange, maxWidth, wrapperClass, wrapperStyle, iconClass, iconStyle } = props;
20817
20698
  const [expanded, setExpanded] = useState(mode === "side-bar");
@@ -20965,8 +20846,7 @@ const SideMenu = forwardRef((props, ref) => {
20965
20846
  });
20966
20847
  });
20967
20848
 
20968
- //#endregion
20969
- //#region src/views/DocSideMenu.tsx
20849
+ // src/views/DocSideMenu.tsx
20970
20850
  const transformNamedStyleTypeToLevel = (type) => {
20971
20851
  switch (type) {
20972
20852
  case NamedStyleType.HEADING_1: return 1;
@@ -21164,8 +21044,7 @@ function DocSideMenuContent({ toc }) {
21164
21044
  });
21165
21045
  }
21166
21046
 
21167
- //#endregion
21168
- //#region src/controllers/ui.controller.ts
21047
+ // src/controllers/ui.controller.ts
21169
21048
  let DocUIController = class DocUIController extends Disposable {
21170
21049
  constructor(_injector, _commandService, _layoutService, _menuManagerService, _uiPartsService, _univerInstanceService, _shortcutService, _configService, _embedInteractionBoundaryService, _embedRuntimeFocusCoordinator) {
21171
21050
  super();
@@ -21232,13 +21111,14 @@ let DocUIController = class DocUIController extends Disposable {
21232
21111
  _initDateTimeFields() {
21233
21112
  const refreshed = /* @__PURE__ */ new WeakSet();
21234
21113
  this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_DOC).subscribe((model) => {
21235
- if (model && !refreshed.has(model)) {
21236
- refreshed.add(model);
21237
- this._commandService.syncExecuteCommand(RefreshHeaderFooterFieldsCommand.id, {
21238
- unitId: model.getUnitId(),
21239
- onOpen: true
21240
- });
21241
- }
21114
+ if (!model || refreshed.has(model)) return;
21115
+ const unitId = model.getUnitId();
21116
+ if (!getDocumentPermissionValue(this._injector.get(IPermissionService), unitId, unitId, UnitAction.Edit)) return;
21117
+ refreshed.add(model);
21118
+ this._commandService.syncExecuteCommand(RefreshHeaderFooterFieldsCommand.id, {
21119
+ unitId,
21120
+ onOpen: true
21121
+ });
21242
21122
  }));
21243
21123
  }
21244
21124
  _initFocusHandler() {
@@ -21268,8 +21148,7 @@ DocUIController = __decorate([
21268
21148
  __decorateParam(9, Optional(IDocEmbedRuntimeFocusCoordinator))
21269
21149
  ], DocUIController);
21270
21150
 
21271
- //#endregion
21272
- //#region src/embed-docs-custom-block-bleed.ts
21151
+ // src/embed-docs-custom-block-bleed.ts
21273
21152
  /**
21274
21153
  * Copyright 2023-present DreamNum Co., Ltd.
21275
21154
  *
@@ -21380,8 +21259,7 @@ function hasClippingOverflow(value) {
21380
21259
  return value === "hidden" || value === "auto" || value === "scroll" || value === "clip";
21381
21260
  }
21382
21261
 
21383
- //#endregion
21384
- //#region src/embed-docs-custom-block-refresh.ts
21262
+ // src/embed-docs-custom-block-refresh.ts
21385
21263
  function collectDocsTableLikeEmbedChildUnitIds(drawings, resolveChildUnitId) {
21386
21264
  const childUnitIds = /* @__PURE__ */ new Set();
21387
21265
  Object.values(drawings ?? {}).forEach((drawing) => {
@@ -21444,8 +21322,7 @@ function createDocsCustomBlockSizeRefreshScheduler(refresh) {
21444
21322
  };
21445
21323
  }
21446
21324
 
21447
- //#endregion
21448
- //#region src/embed-docs-custom-block-scroll.ts
21325
+ // src/embed-docs-custom-block-scroll.ts
21449
21326
  function scrollDocsTableLikeCustomBlockLive(event, live, options = {}) {
21450
21327
  if (event.defaultPrevented || event.ctrlKey || event.metaKey) return false;
21451
21328
  const deltaX = event.deltaX || (event.shiftKey ? event.deltaY : 0);
@@ -21472,8 +21349,7 @@ function resolveMaxScrollLeft(element, requestedMaxScrollLeft) {
21472
21349
  return clampScroll(requestedMaxScrollLeft ?? nativeMaxScrollLeft, 0, nativeMaxScrollLeft);
21473
21350
  }
21474
21351
 
21475
- //#endregion
21476
- //#region src/embed-host-anchor.ts
21352
+ // src/embed-host-anchor.ts
21477
21353
  const MODERN_DOCS_CUSTOM_BLOCK_VIEWPORT_INSET = 10;
21478
21354
  function resolveDocsCustomBlockRenderViewport(params) {
21479
21355
  const defaultSize = resolveDocsCustomBlockSize(params.childType);
@@ -21535,13 +21411,11 @@ function resolveDocsCustomBlockRenderViewport(params) {
21535
21411
  };
21536
21412
  }
21537
21413
 
21538
- //#endregion
21539
- //#region package.json
21414
+ // package.json
21540
21415
  var name = "@univerjs/docs-ui";
21541
- var version = "1.3.1";
21416
+ var version = "1.5.0";
21542
21417
 
21543
- //#endregion
21544
- //#region src/commands/commands/doc-paragraph-setting.command.ts
21418
+ // src/commands/commands/doc-paragraph-setting.command.ts
21545
21419
  const DocParagraphSettingCommand = {
21546
21420
  id: "doc-paragraph-setting.command",
21547
21421
  type: CommandType.COMMAND,
@@ -21575,6 +21449,10 @@ const DocParagraphSettingCommand = {
21575
21449
  const jsonX = JSONX.getInstance();
21576
21450
  for (const paragraph of paragraphs) {
21577
21451
  const { startIndex } = paragraph;
21452
+ const paragraphStyle = {
21453
+ ...paragraph.paragraphStyle,
21454
+ ...config.paragraph
21455
+ };
21578
21456
  textX.push({
21579
21457
  t: TextXActionType.RETAIN,
21580
21458
  len: startIndex - memoryCursor.cursor
@@ -21586,10 +21464,7 @@ const DocParagraphSettingCommand = {
21586
21464
  dataStream: "",
21587
21465
  paragraphs: [{
21588
21466
  ...paragraph,
21589
- paragraphStyle: {
21590
- ...paragraph.paragraphStyle,
21591
- ...config.paragraph
21592
- },
21467
+ paragraphStyle,
21593
21468
  startIndex: 0
21594
21469
  }]
21595
21470
  },
@@ -21603,8 +21478,7 @@ const DocParagraphSettingCommand = {
21603
21478
  }
21604
21479
  };
21605
21480
 
21606
- //#endregion
21607
- //#region src/controllers/doc-auto-format.controller.ts
21481
+ // src/controllers/doc-auto-format.controller.ts
21608
21482
  function hasQuickListType(text) {
21609
21483
  return Object.prototype.hasOwnProperty.call(QuickListTypeMap, text);
21610
21484
  }
@@ -21744,8 +21618,7 @@ let DocAutoFormatController = class DocAutoFormatController extends Disposable {
21744
21618
  };
21745
21619
  DocAutoFormatController = __decorate([__decorateParam(0, Inject(DocAutoFormatService)), __decorateParam(1, IRenderManagerService)], DocAutoFormatController);
21746
21620
 
21747
- //#endregion
21748
- //#region src/views/header-footer/content-cover.ts
21621
+ // src/views/header-footer/content-cover.ts
21749
21622
  /** A paint-only overlay. It never participates in hit testing or selection. */
21750
21623
  var HeaderFooterContentCover = class extends BaseObject {
21751
21624
  constructor(key, _documents, _scene) {
@@ -21880,8 +21753,7 @@ var HeaderFooterContentCover = class extends BaseObject {
21880
21753
  }
21881
21754
  };
21882
21755
 
21883
- //#endregion
21884
- //#region src/views/header-footer/text-bubble.ts
21756
+ // src/views/header-footer/text-bubble.ts
21885
21757
  const COLLAB_CURSOR_LABEL_HEIGHT = 18;
21886
21758
  const COLLAB_CURSOR_LABEL_MAX_WIDTH = 200;
21887
21759
  const COLLAB_CURSOR_LABEL_TEXT_PADDING_LR = 6;
@@ -21958,8 +21830,7 @@ var TextBubbleShape = class TextBubbleShape extends Shape {
21958
21830
  }
21959
21831
  };
21960
21832
 
21961
- //#endregion
21962
- //#region src/controllers/doc-header-footer.controller.ts
21833
+ // src/controllers/doc-header-footer.controller.ts
21963
21834
  const INACTIVE_AREA_OPACITY = .5;
21964
21835
  const HEADER_FOOTER_LABEL_ALPHA = .08;
21965
21836
  let DocHeaderFooterController = class DocHeaderFooterController extends Disposable {
@@ -22153,8 +22024,7 @@ DocHeaderFooterController = __decorate([
22153
22024
  __decorateParam(6, Inject(ThemeService))
22154
22025
  ], DocHeaderFooterController);
22155
22026
 
22156
- //#endregion
22157
- //#region src/basics/table.ts
22027
+ // src/basics/table.ts
22158
22028
  function findTableAfterLine(line, page) {
22159
22029
  const { ed } = line;
22160
22030
  const { skeTables } = page;
@@ -22183,8 +22053,7 @@ function lastLineInCell(cell) {
22183
22053
  return lastColumn.lines[lastColumn.lines.length - 1];
22184
22054
  }
22185
22055
 
22186
- //#endregion
22187
- //#region src/controllers/doc-move-cursor.controller.ts
22056
+ // src/controllers/doc-move-cursor.controller.ts
22188
22057
  let DocMoveCursorController = class DocMoveCursorController extends Disposable {
22189
22058
  constructor(_univerInstanceService, _renderManagerService, _textSelectionManagerService, _commandService) {
22190
22059
  super();
@@ -22888,8 +22757,7 @@ DocMoveCursorController = __decorate([
22888
22757
  __decorateParam(3, ICommandService)
22889
22758
  ], DocMoveCursorController);
22890
22759
 
22891
- //#endregion
22892
- //#region src/controllers/doc-table.controller.ts
22760
+ // src/controllers/doc-table.controller.ts
22893
22761
  /**
22894
22762
  * Copyright 2023-present DreamNum Co., Ltd.
22895
22763
  *
@@ -22922,8 +22790,7 @@ let DocTableController = class DocTableController extends Disposable {
22922
22790
  };
22923
22791
  DocTableController = __decorate([__decorateParam(0, ICommandService)], DocTableController);
22924
22792
 
22925
- //#endregion
22926
- //#region src/views/DocLayoutRecovery.tsx
22793
+ // src/views/DocLayoutRecovery.tsx
22927
22794
  const DOC_LAYOUT_RECOVERY_COMPONENT = "DOC_LAYOUT_RECOVERY_COMPONENT";
22928
22795
  function DocLayoutRecovery() {
22929
22796
  const localeService = useDependency(LocaleService);
@@ -22938,8 +22805,7 @@ function DocLayoutRecovery() {
22938
22805
  });
22939
22806
  }
22940
22807
 
22941
- //#endregion
22942
- //#region src/views/DocPasteOptions.tsx
22808
+ // src/views/DocPasteOptions.tsx
22943
22809
  const DOC_PASTE_OPTIONS_COMPONENT = "docs-ui.paste-options";
22944
22810
  function DocPasteOptions() {
22945
22811
  const clipboard = useDependency(IDocClipboardService);
@@ -23015,8 +22881,7 @@ function DocPasteOptions() {
23015
22881
  });
23016
22882
  }
23017
22883
 
23018
- //#endregion
23019
- //#region src/views/Icon.tsx
22884
+ // src/views/Icon.tsx
23020
22885
  function BackgroundColorSwatchIcon({ className, style, onClick, color }) {
23021
22886
  return /* @__PURE__ */ jsx("svg", {
23022
22887
  className,
@@ -23101,8 +22966,7 @@ const DocParagraphBackgroundColorSwatchIcon13 = createBackgroundColorSwatchIcon(
23101
22966
  const DocParagraphBackgroundColorSwatchIcon14 = createBackgroundColorSwatchIcon(14);
23102
22967
  const DocParagraphBackgroundColorSwatchIcon15 = createBackgroundColorSwatchIcon(15);
23103
22968
 
23104
- //#endregion
23105
- //#region src/views/mobile-element-menu/MobileDocElementMenu.tsx
22969
+ // src/views/mobile-element-menu/MobileDocElementMenu.tsx
23106
22970
  const MOBILE_DOC_ELEMENT_MENU = "docs-ui.mobile-element-menu";
23107
22971
  const schemas = [{
23108
22972
  key: "edit",
@@ -23135,8 +22999,7 @@ function MobileDocElementMenuPopup({ popup }) {
23135
22999
  return /* @__PURE__ */ jsx(MobileDocElementMenu, { ...popup.extraProps });
23136
23000
  }
23137
23001
 
23138
- //#endregion
23139
- //#region src/views/mobile/MobileDocPasteOptions.tsx
23002
+ // src/views/mobile/MobileDocPasteOptions.tsx
23140
23003
  function MobileDocPasteOptions({ popup }) {
23141
23004
  var _renders$getRenderUni;
23142
23005
  const { unitId } = popup.extraProps;
@@ -23165,7 +23028,7 @@ function MobileDocPasteOptions({ popup }) {
23165
23028
  if (!state || state.unitId !== unitId) return null;
23166
23029
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
23167
23030
  "aria-label": localeService.t("docs-ui.pasteOptions.title"),
23168
- className: "univer-min-h-11 univer-min-w-11 univer-shadow-sm [&_svg]:!univer-size-6",
23031
+ className: "[&_svg]:! univer-min-w-11 univer-shadow-sm",
23169
23032
  style: keyboard.visible ? {
23170
23033
  position: "fixed",
23171
23034
  bottom: keyboard.inset + 56,
@@ -23175,6 +23038,7 @@ function MobileDocPasteOptions({ popup }) {
23175
23038
  selection === null || selection === void 0 || selection.suspendMobileEditingInput();
23176
23039
  setOpen(true);
23177
23040
  },
23041
+ size: "icon",
23178
23042
  children: /* @__PURE__ */ jsx(DocPasteOptionsIcon, { "aria-hidden": "true" })
23179
23043
  }), open && /* @__PURE__ */ jsx("div", {
23180
23044
  className: "univer-pointer-events-none univer-fixed univer-inset-x-0 univer-top-0",
@@ -23192,8 +23056,8 @@ function MobileDocPasteOptions({ popup }) {
23192
23056
  className: "univer-flex univer-w-full univer-items-center univer-justify-between univer-gap-2 univer-px-4",
23193
23057
  children: [/* @__PURE__ */ jsx("span", { children: localeService.t("docs-ui.pasteOptions.title") }), /* @__PURE__ */ jsx(Button, {
23194
23058
  variant: "text",
23195
- className: "univer-min-h-11",
23196
23059
  onClick: () => setOpen(false),
23060
+ size: "middle",
23197
23061
  children: localeService.t("docs-ui.mobile.done")
23198
23062
  })]
23199
23063
  }),
@@ -23206,8 +23070,9 @@ function MobileDocPasteOptions({ popup }) {
23206
23070
  "aria-checked": state.mode === option.value,
23207
23071
  disabled: busy,
23208
23072
  variant: "text",
23209
- className: "!univer-h-auto univer-min-h-11 univer-justify-start univer-whitespace-normal univer-py-3 univer-text-start",
23073
+ className: "univer-justify-start univer-whitespace-normal univer-text-start",
23210
23074
  onClick: () => changeMode(option.value),
23075
+ size: "middle",
23211
23076
  children: [/* @__PURE__ */ jsx("span", {
23212
23077
  className: "univer-inline-flex univer-size-5 univer-shrink-0 univer-items-center",
23213
23078
  children: state.mode === option.value && /* @__PURE__ */ jsx(CheckMarkIcon, {})
@@ -23218,8 +23083,7 @@ function MobileDocPasteOptions({ popup }) {
23218
23083
  })] });
23219
23084
  }
23220
23085
 
23221
- //#endregion
23222
- //#region src/views/header-footer/panel/use-header-footer-options.ts
23086
+ // src/views/header-footer/panel/use-header-footer-options.ts
23223
23087
  function getSegmentId(documentStyle, editArea, pageIndex, page) {
23224
23088
  const { useFirstPageHeaderFooter, evenAndOddHeaders, defaultHeaderId, defaultFooterId, firstPageHeaderId, firstPageFooterId, evenPageHeaderId, evenPageFooterId } = documentStyle;
23225
23089
  const isFirstPage = page ? page.pageNumber === page.pageNumberStart : pageIndex === 0;
@@ -23379,8 +23243,7 @@ function getHeaderFooterVariant(documentStyle, pageIndex, page) {
23379
23243
  return "default";
23380
23244
  }
23381
23245
 
23382
- //#endregion
23383
- //#region src/views/header-footer/panel/DocHeaderFooterOptions.tsx
23246
+ // src/views/header-footer/panel/DocHeaderFooterOptions.tsx
23384
23247
  const DocHeaderFooterOptions = (props) => {
23385
23248
  const docSelectionRenderService = useDependency(IRenderManagerService).getRenderUnitById(props.unitId).with(DocSelectionRenderService);
23386
23249
  const segmentContext = useObservable(docSelectionRenderService.segmentContext$, {
@@ -23420,9 +23283,9 @@ function DocHeaderFooterOptionsContent({ unitId }) {
23420
23283
  }) })]
23421
23284
  }),
23422
23285
  /* @__PURE__ */ jsxs("div", {
23423
- className: "univer-mb-1 univer-flex",
23286
+ className: "univer-mb-1 univer-grid univer-grid-cols-2 univer-items-end univer-gap-4",
23424
23287
  children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("docs-ui.headerFooter.headerTopMargin") }), /* @__PURE__ */ jsx(InputNumber, {
23425
- className: "univer-mt-1.5 univer-w-4/5",
23288
+ className: "univer-mt-1.5 univer-w-full",
23426
23289
  min: 0,
23427
23290
  max: 200,
23428
23291
  precision: 1,
@@ -23431,7 +23294,7 @@ function DocHeaderFooterOptionsContent({ unitId }) {
23431
23294
  handleMarginChange(val ?? 0, "marginHeader");
23432
23295
  }
23433
23296
  })] }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("docs-ui.headerFooter.footerBottomMargin") }), /* @__PURE__ */ jsx(InputNumber, {
23434
- className: "univer-mt-1.5 univer-w-4/5",
23297
+ className: "univer-mt-1.5 univer-w-full",
23435
23298
  min: 0,
23436
23299
  max: 200,
23437
23300
  precision: 1,
@@ -23452,8 +23315,7 @@ function DocHeaderFooterOptionsContent({ unitId }) {
23452
23315
  });
23453
23316
  }
23454
23317
 
23455
- //#endregion
23456
- //#region src/views/header-footer/panel/DocHeaderFooterPanel.tsx
23318
+ // src/views/header-footer/panel/DocHeaderFooterPanel.tsx
23457
23319
  const DocHeaderFooterPanel = (props) => {
23458
23320
  var _renderManagerService;
23459
23321
  const localeService = useDependency(LocaleService);
@@ -23473,8 +23335,7 @@ const DocHeaderFooterPanel = (props) => {
23473
23335
  });
23474
23336
  };
23475
23337
 
23476
- //#endregion
23477
- //#region src/views/paragraph-setting/line-spacing.ts
23338
+ // src/views/paragraph-setting/line-spacing.ts
23478
23339
  const AUTO_LINE_SPACING_CONFIG = {
23479
23340
  min: 1,
23480
23341
  max: 5,
@@ -23536,8 +23397,7 @@ function convertLineSpacingForRuleChange(currentStoredValue, currentRule, nextRu
23536
23397
  return round(DEFAULT_STYLES.fs * currentStoredValue, 4);
23537
23398
  }
23538
23399
 
23539
- //#endregion
23540
- //#region src/views/paragraph-setting/hook/utils.ts
23400
+ // src/views/paragraph-setting/hook/utils.ts
23541
23401
  const PARAGRAPH_LAYOUT_BLOCK_TYPES = /* @__PURE__ */ new Set([
23542
23402
  DocumentBlockRangeType.CALLOUT,
23543
23403
  DocumentBlockRangeType.CODE,
@@ -23739,8 +23599,59 @@ const useFirstParagraphLineSpacing = (paragraph) => {
23739
23599
  };
23740
23600
  };
23741
23601
 
23742
- //#endregion
23743
- //#region src/views/paragraph-setting/Setting.tsx
23602
+ // src/views/paragraph-setting/ParagraphWordWrapSetting.tsx
23603
+ function ParagraphWordWrapSetting() {
23604
+ const commandService = useDependency(ICommandService);
23605
+ const instanceService = useDependency(IUniverInstanceService);
23606
+ const selectionService = useDependency(DocSelectionManagerService);
23607
+ const label = useDependency(LocaleService).t("docs-ui.doc.paragraphSetting.wordWrap");
23608
+ const readState = useCallback(() => {
23609
+ var _document$getSelfOrHe, _ranges$;
23610
+ const document = instanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);
23611
+ const ranges = selectionService.getDocRanges();
23612
+ const body = document === null || document === void 0 || (_document$getSelfOrHe = document.getSelfOrHeaderFooterModel((_ranges$ = ranges[0]) === null || _ranges$ === void 0 ? void 0 : _ranges$.segmentId)) === null || _document$getSelfOrHe === void 0 ? void 0 : _document$getSelfOrHe.getBody();
23613
+ const paragraphs = body && ranges.length ? BuildTextUtils.range.getParagraphsInRanges(ranges, body.paragraphs ?? [], body.dataStream) ?? [] : [];
23614
+ const values = paragraphs.map((paragraph) => resolveDocumentParagraphWordWrap(document.getSnapshot(), paragraph));
23615
+ return {
23616
+ checked: values[0] === BooleanNumber.TRUE,
23617
+ mixed: values.some((value) => value !== values[0]),
23618
+ disabled: paragraphs.length === 0
23619
+ };
23620
+ }, [instanceService, selectionService]);
23621
+ const [state, setState] = useState(readState);
23622
+ const refresh = useCallback(() => setState(readState()), [readState]);
23623
+ useEffect(() => {
23624
+ const selection = selectionService.textSelection$.subscribe(refresh);
23625
+ const mutation = commandService.onCommandExecuted((command) => {
23626
+ if (command.id === RichTextEditingMutation.id) refresh();
23627
+ });
23628
+ return () => {
23629
+ selection.unsubscribe();
23630
+ mutation.dispose();
23631
+ };
23632
+ }, [
23633
+ commandService,
23634
+ refresh,
23635
+ selectionService
23636
+ ]);
23637
+ const apply = async (checked) => {
23638
+ await commandService.executeCommand(DocParagraphSettingCommand.id, { paragraph: { wordWrap: checked ? BooleanNumber.TRUE : BooleanNumber.FALSE } });
23639
+ refresh();
23640
+ };
23641
+ return /* @__PURE__ */ jsx("div", {
23642
+ "data-u-editor-interaction-boundary": "true",
23643
+ onMouseDown: (event) => event.preventDefault(),
23644
+ children: /* @__PURE__ */ jsx(Checkbox, {
23645
+ checked: state.checked && !state.mixed,
23646
+ indeterminate: state.mixed,
23647
+ disabled: state.disabled,
23648
+ onChange: (checked) => apply(checked === true),
23649
+ children: label
23650
+ })
23651
+ });
23652
+ }
23653
+
23654
+ // src/views/paragraph-setting/Setting.tsx
23744
23655
  const ALIGNMENT_OPTIONS = [
23745
23656
  {
23746
23657
  label: "docs-ui.toolbar.alignLeft",
@@ -23944,13 +23855,16 @@ function ParagraphSetting({ RowComponent = ParagraphSettingRow, NumberComponent
23944
23855
  })
23945
23856
  ]
23946
23857
  })
23858
+ }),
23859
+ /* @__PURE__ */ jsx("div", {
23860
+ className: "univer-mt-5",
23861
+ children: /* @__PURE__ */ jsx(ParagraphWordWrapSetting, {})
23947
23862
  })
23948
23863
  ]
23949
23864
  });
23950
23865
  }
23951
23866
 
23952
- //#endregion
23953
- //#region src/views/paragraph-setting/index.tsx
23867
+ // src/views/paragraph-setting/index.tsx
23954
23868
  const isRangesEqual = (oldRanges, ranges) => {
23955
23869
  return ranges.length === oldRanges.length && oldRanges.some((oldRange) => ranges.some((range) => range.startOffset === oldRange.startOffset && range.endOffset === oldRange.endOffset));
23956
23870
  };
@@ -23986,8 +23900,7 @@ function ParagraphSettingIndex(props) {
23986
23900
  });
23987
23901
  }
23988
23902
 
23989
- //#endregion
23990
- //#region src/views/permission/DocObjectPermissionEntry.tsx
23903
+ // src/views/permission/DocObjectPermissionEntry.tsx
23991
23904
  function DocObjectPermissionEntry({ unitId, id, objectType, segmentId = "" }) {
23992
23905
  const injector = useInjector();
23993
23906
  const instances = useDependency(IUniverInstanceService);
@@ -24026,8 +23939,7 @@ function DocObjectPermissionEntry({ unitId, id, objectType, segmentId = "" }) {
24026
23939
  });
24027
23940
  }
24028
23941
 
24029
- //#endregion
24030
- //#region src/views/section-setting/use-section-setting.ts
23942
+ // src/views/section-setting/use-section-setting.ts
24031
23943
  const DEFAULT_SECTION_COLUMN_GAP = 18;
24032
23944
  function getCommonValue(values) {
24033
23945
  const first = values[0];
@@ -24198,8 +24110,7 @@ function useSectionSetting() {
24198
24110
  };
24199
24111
  }
24200
24112
 
24201
- //#endregion
24202
- //#region src/views/section-setting/Setting.tsx
24113
+ // src/views/section-setting/Setting.tsx
24203
24114
  function SettingRow(props) {
24204
24115
  return /* @__PURE__ */ jsxs("div", {
24205
24116
  className: "univer-grid univer-min-h-8 univer-items-center univer-gap-3",
@@ -24462,8 +24373,7 @@ function SectionSetting({ RowComponent = SettingRow, InputNumberComponent = Inpu
24462
24373
  });
24463
24374
  }
24464
24375
 
24465
- //#endregion
24466
- //#region src/views/section-setting/index.tsx
24376
+ // src/views/section-setting/index.tsx
24467
24377
  function SectionSettingIndex(props) {
24468
24378
  const commandService = useDependency(ICommandService);
24469
24379
  const [key, setKey] = useState(() => generateRandomId(4));
@@ -24481,8 +24391,7 @@ function SectionSettingIndex(props) {
24481
24391
  });
24482
24392
  }
24483
24393
 
24484
- //#endregion
24485
- //#region src/views/mobile/MobileDocSettings.tsx
24394
+ // src/views/mobile/MobileDocSettings.tsx
24486
24395
  function MobileSettingRow({ label, unit, children }) {
24487
24396
  return /* @__PURE__ */ jsxs("div", {
24488
24397
  className: "univer-flex univer-min-h-12 univer-flex-col univer-gap-2",
@@ -24498,13 +24407,16 @@ function MobileSettingRow({ label, unit, children }) {
24498
24407
  const MobileSettingNumber = forwardRef((props, ref) => /* @__PURE__ */ jsx(InputNumber, {
24499
24408
  ...props,
24500
24409
  ref,
24501
- className: clsx(props.className, "univer-h-12 univer-w-full"),
24502
- inputClassName: clsx(props.inputClassName, "univer-text-base")
24410
+ className: clsx(props.className, "univer-w-full"),
24411
+ inputClassName: clsx(props.inputClassName, ""),
24412
+ size: "small",
24413
+ controls: false
24503
24414
  }));
24504
24415
  function MobileSettingSelect(props) {
24505
24416
  return /* @__PURE__ */ jsx(MobileSelect, {
24506
24417
  ...props,
24507
- className: clsx(props.className, "univer-h-12 univer-w-full")
24418
+ className: clsx(props.className, "univer-w-full"),
24419
+ size: "small"
24508
24420
  });
24509
24421
  }
24510
24422
  function MobileParagraphNumber({ min = 0, max = 100, step = .1, precision = 1, onChange, ...props }) {
@@ -24523,8 +24435,9 @@ function MobileParagraphAlignmentButton({ label, selected, onClick, children })
24523
24435
  variant: "text",
24524
24436
  "aria-label": label,
24525
24437
  "aria-pressed": selected,
24526
- className: clsx("univer-h-12 univer-w-full", { "!univer-bg-gray-200 dark:!univer-bg-gray-700": selected }),
24438
+ className: clsx("univer-w-full", { "!univer-bg-gray-200 dark:!univer-bg-gray-700": selected }),
24527
24439
  onClick,
24440
+ size: "middle",
24528
24441
  children: /* @__PURE__ */ jsx("span", {
24529
24442
  className: "univer-flex univer-size-5 univer-items-center univer-justify-center univer-text-lg",
24530
24443
  children
@@ -24625,8 +24538,9 @@ function MobileHeaderFooterOptions({ unitId }) {
24625
24538
  /* @__PURE__ */ jsx("div", {
24626
24539
  className: "univer-flex",
24627
24540
  children: /* @__PURE__ */ jsx(Button, {
24628
- className: "univer-h-12 univer-w-full",
24541
+ className: "univer-w-full",
24629
24542
  onClick: closeHeaderFooter,
24543
+ size: "middle",
24630
24544
  children: localeService.t("docs-ui.headerFooter.closeHeaderFooter")
24631
24545
  })
24632
24546
  })
@@ -24634,8 +24548,7 @@ function MobileHeaderFooterOptions({ unitId }) {
24634
24548
  });
24635
24549
  }
24636
24550
 
24637
- //#endregion
24638
- //#region src/views/table/create/TableCreate.tsx
24551
+ // src/views/table/create/TableCreate.tsx
24639
24552
  const DocCreateTableConfirm = ({ handleRowColChange, tableCreateParams }) => {
24640
24553
  const localeService = useDependency(LocaleService);
24641
24554
  const [rowCount, setRowCount] = useState(3);
@@ -24679,8 +24592,7 @@ const DocCreateTableConfirm = ({ handleRowColChange, tableCreateParams }) => {
24679
24592
  });
24680
24593
  };
24681
24594
 
24682
- //#endregion
24683
- //#region src/controllers/mobile/components.controller.ts
24595
+ // src/controllers/mobile/components.controller.ts
24684
24596
  /**
24685
24597
  * Copyright 2023-present DreamNum Co., Ltd.
24686
24598
  *
@@ -24702,14 +24614,8 @@ let MobileComponentsController = class MobileComponentsController extends Dispos
24702
24614
  this._componentManager = _componentManager;
24703
24615
  this._iconManager = _iconManager;
24704
24616
  this._registerComponents();
24705
- this._registerParts();
24706
24617
  this._registerIcons();
24707
24618
  }
24708
- _registerParts() {
24709
- const componentManager = this._componentManager;
24710
- this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
24711
- this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, MobileDocPasteOptions));
24712
- }
24713
24619
  _registerIcons() {
24714
24620
  this.disposeWithMe(this._iconManager.register({
24715
24621
  DocPasteOptionsIcon,
@@ -24806,12 +24712,14 @@ let MobileComponentsController = class MobileComponentsController extends Dispos
24806
24712
  this.disposeWithMe(this._componentManager.register(BULLET_LIST_TYPE_COMPONENT, BulletListTypePicker));
24807
24713
  this.disposeWithMe(this._componentManager.register(ORDER_LIST_TYPE_COMPONENT, OrderListTypePicker));
24808
24714
  this.disposeWithMe(this._componentManager.register(DOC_LAYOUT_RECOVERY_COMPONENT, DocLayoutRecovery));
24715
+ const componentManager = this._componentManager;
24716
+ this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
24717
+ this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, MobileDocPasteOptions));
24809
24718
  }
24810
24719
  };
24811
24720
  MobileComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager)), __decorateParam(1, Inject(IconManager))], MobileComponentsController);
24812
24721
 
24813
- //#endregion
24814
- //#region src/consts/mobile-context.ts
24722
+ // src/consts/mobile-context.ts
24815
24723
  /**
24816
24724
  * Copyright 2023-present DreamNum Co., Ltd.
24817
24725
  *
@@ -24830,8 +24738,7 @@ MobileComponentsController = __decorate([__decorateParam(0, Inject(ComponentMana
24830
24738
  const DOC_CARET_MENU_ID = "docs.contextMenu.caret";
24831
24739
  const MOBILE_DOC_PINCH_ZOOMING = "MOBILE_DOC_PINCH_ZOOMING";
24832
24740
 
24833
- //#endregion
24834
- //#region src/menu/mobile-schema.ts
24741
+ // src/menu/mobile-schema.ts
24835
24742
  const mobileMenuSchema = {
24836
24743
  [ContextMenuPosition.MAIN_AREA]: { [ContextMenuGroup.QUICK]: {
24837
24744
  [DocSelectWordCommand.id]: {
@@ -24869,8 +24776,7 @@ const mobileMenuSchema = {
24869
24776
  }
24870
24777
  };
24871
24778
 
24872
- //#endregion
24873
- //#region src/views/mobile-doc-toolbar/MobileDocToolbar.tsx
24779
+ // src/views/mobile-doc-toolbar/MobileDocToolbar.tsx
24874
24780
  const MOBILE_DOC_INSERT_GROUP = "doc.mobile.insert";
24875
24781
  const MOBILE_DOC_FORMAT_QUICK_GROUP = "doc.mobile.format.quick";
24876
24782
  const MOBILE_DOC_FORMAT_DETAIL_GROUP = "doc.mobile.format.detail";
@@ -24953,6 +24859,7 @@ function useMobileDocEditState() {
24953
24859
  const unitId = currentDoc === null || currentDoc === void 0 ? void 0 : currentDoc.getUnitId();
24954
24860
  const selectionService = unitId ? (_renderManagerService = renderManagerService.getRenderUnitById(unitId)) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.with(DocSelectionRenderService) : void 0;
24955
24861
  return {
24862
+ unitId,
24956
24863
  isEditing: useObservable(selectionService === null || selectionService === void 0 ? void 0 : selectionService.mobileEditMode$, (selectionService === null || selectionService === void 0 ? void 0 : selectionService.isMobileEditMode) ?? false),
24957
24864
  isReadOnly: unitId ? ((_editorService$getEdi = editorService.getEditor(unitId)) === null || _editorService$getEdi === void 0 ? void 0 : _editorService$getEdi.isReadOnly()) === true : true,
24958
24865
  selectionService
@@ -24976,7 +24883,10 @@ function MobileDocToolbar() {
24976
24883
  const menuManagerService = useDependency(IMenuManagerService);
24977
24884
  const workbenchService = useDependency(IWorkbenchService);
24978
24885
  const rootUnitType = useObservable(workbenchService.rootUnitType$, null, true);
24979
- const { isEditing, isReadOnly, selectionService } = useMobileDocEditState();
24886
+ const { unitId, isEditing, isReadOnly, selectionService } = useMobileDocEditState();
24887
+ const injector = useDependency(Injector);
24888
+ const focusCoordinator = injector.has(IDocEmbedRuntimeFocusCoordinator) ? injector.get(IDocEmbedRuntimeFocusCoordinator) : void 0;
24889
+ const embeddedDocActive = useObservable(() => (focusCoordinator === null || focusCoordinator === void 0 ? void 0 : focusCoordinator.runtimeSessionChanged$.pipe(startWith(void 0), map(() => focusCoordinator.isChildUnitInActiveSession(unitId)))) ?? of(false), (focusCoordinator === null || focusCoordinator === void 0 ? void 0 : focusCoordinator.isChildUnitInActiveSession(unitId)) ?? false, false, [focusCoordinator, unitId]);
24980
24890
  const keyboardState = useObservable(selectionService === null || selectionService === void 0 ? void 0 : selectionService.mobileKeyboardState$, {
24981
24891
  visible: false,
24982
24892
  inset: 0
@@ -25004,13 +24914,13 @@ function MobileDocToolbar() {
25004
24914
  return () => subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
25005
24915
  }, [selectionService, closeDrawer]);
25006
24916
  const drawerSchemas = useMemo(() => drawer ? menuSchemas[drawer] : [], [drawer, menuSchemas]);
25007
- if (rootUnitType !== UniverInstanceType.UNIVER_DOC) return null;
24917
+ if (rootUnitType !== UniverInstanceType.UNIVER_DOC && !embeddedDocActive) return null;
25008
24918
  if (!isEditing) {
25009
24919
  if (isReadOnly) return null;
25010
24920
  return /* @__PURE__ */ jsx("button", {
25011
24921
  type: "button",
25012
24922
  "aria-label": localeService.t("docs-ui.mobile.edit"),
25013
- className: clsx(resetButtonClassName, "univer-pointer-events-auto univer-absolute univer-bottom-4 univer-z-30 univer-flex univer-size-14 univer-items-center univer-justify-center univer-rounded-full univer-bg-primary-600 univer-text-2xl univer-text-white univer-shadow-lg active:univer-scale-95 active:univer-bg-primary-700 dark:!univer-bg-primary-500 dark:active:!univer-bg-primary-600"),
24923
+ className: clsx(resetButtonClassName, "univer-pointer-events-auto univer-absolute univer-bottom-4 univer-z-50 univer-flex univer-size-14 univer-items-center univer-justify-center univer-rounded-full univer-bg-primary-600 univer-text-2xl univer-text-white univer-shadow-lg active:univer-scale-95 active:univer-bg-primary-700 dark:!univer-bg-primary-500 dark:active:!univer-bg-primary-600"),
25014
24924
  style: {
25015
24925
  insetInlineEnd: "1rem",
25016
24926
  marginBottom: "env(safe-area-inset-bottom, 0px)"
@@ -25056,7 +24966,7 @@ function MobileDocToolbar() {
25056
24966
  const quickMenuType = quickMenu === "block" ? DOC_PARAGRAPH_T_EDIT_MENU_ID : DOC_PARAGRAPH_T_ALIGN_MENU_ID;
25057
24967
  return /* @__PURE__ */ jsxs(Fragment, { children: [
25058
24968
  keyboardVisible && quickMenu && /* @__PURE__ */ jsx("div", {
25059
- className: "univer-pointer-events-auto univer-absolute univer-inset-x-3 univer-z-30 univer-overflow-hidden",
24969
+ className: "univer-pointer-events-auto univer-absolute univer-inset-x-3 univer-z-50 univer-overflow-hidden",
25060
24970
  style: { bottom: `${keyboardState.inset + 48}px` },
25061
24971
  children: /* @__PURE__ */ jsx(MobileMenu, {
25062
24972
  menuType: quickMenuType,
@@ -25065,7 +24975,7 @@ function MobileDocToolbar() {
25065
24975
  })
25066
24976
  }),
25067
24977
  keyboardVisible && !drawer && /* @__PURE__ */ jsxs("div", {
25068
- className: "univer-pointer-events-auto univer-absolute univer-inset-x-0 univer-z-30 univer-box-border univer-flex univer-h-12 univer-items-center univer-gap-0.5 univer-border-0 univer-border-t univer-border-solid univer-border-gray-200 univer-bg-gray-0 univer-px-1 dark:!univer-border-gray-700 dark:!univer-bg-gray-800",
24978
+ className: "univer-pointer-events-auto univer-absolute univer-inset-x-0 univer-z-50 univer-box-border univer-flex univer-h-12 univer-items-center univer-gap-0.5 univer-border-0 univer-border-t univer-border-solid univer-border-gray-200 univer-bg-gray-0 univer-px-1 dark:!univer-border-gray-700 dark:!univer-bg-gray-800",
25069
24979
  style: {
25070
24980
  bottom: `${keyboardState.inset}px`,
25071
24981
  paddingBottom: "env(safe-area-inset-bottom, 0px)"
@@ -25157,8 +25067,7 @@ function MobileDocToolbar() {
25157
25067
  ] });
25158
25068
  }
25159
25069
 
25160
- //#endregion
25161
- //#region src/services/doc-mobile-element-menu.service.ts
25070
+ // src/services/doc-mobile-element-menu.service.ts
25162
25071
  let DocMobileElementMenuService = class DocMobileElementMenuService extends Disposable {
25163
25072
  constructor(_popupService, instanceService) {
25164
25073
  super();
@@ -25233,8 +25142,7 @@ let DocMobileElementMenuService = class DocMobileElementMenuService extends Disp
25233
25142
  };
25234
25143
  DocMobileElementMenuService = __decorate([__decorateParam(0, Inject(DocCanvasPopManagerService)), __decorateParam(1, IUniverInstanceService)], DocMobileElementMenuService);
25235
25144
 
25236
- //#endregion
25237
- //#region src/views/mobile/MobileDocCanvasViewport.tsx
25145
+ // src/views/mobile/MobileDocCanvasViewport.tsx
25238
25146
  function MobileDocCanvasViewport({ containerRef, canvasRef }) {
25239
25147
  const instances = useDependency(IUniverInstanceService);
25240
25148
  const renders = useDependency(IRenderManagerService);
@@ -25294,8 +25202,7 @@ function MobileDocCanvasViewport({ containerRef, canvasRef }) {
25294
25202
  return null;
25295
25203
  }
25296
25204
 
25297
- //#endregion
25298
- //#region src/controllers/mobile/ui.controller.ts
25205
+ // src/controllers/mobile/ui.controller.ts
25299
25206
  /**
25300
25207
  * Copyright 2023-present DreamNum Co., Ltd.
25301
25208
  *
@@ -25356,8 +25263,7 @@ DocMobileUIController = __decorate([
25356
25263
  __decorateParam(4, IUIPartsService)
25357
25264
  ], DocMobileUIController);
25358
25265
 
25359
- //#endregion
25360
- //#region src/controllers/render-controllers/doc-canvas-popup-layout-interaction.controller.ts
25266
+ // src/controllers/render-controllers/doc-canvas-popup-layout-interaction.controller.ts
25361
25267
  let DocCanvasPopupLayoutInteractionController = class DocCanvasPopupLayoutInteractionController extends Disposable {
25362
25268
  constructor(_context, _canvasPopupManagerService, _docLayoutInteractionService) {
25363
25269
  super();
@@ -25382,8 +25288,7 @@ let DocCanvasPopupLayoutInteractionController = class DocCanvasPopupLayoutIntera
25382
25288
  };
25383
25289
  DocCanvasPopupLayoutInteractionController = __decorate([__decorateParam(1, Inject(DocCanvasPopManagerService)), __decorateParam(2, Inject(DocLayoutInteractionService))], DocCanvasPopupLayoutInteractionController);
25384
25290
 
25385
- //#endregion
25386
- //#region src/controllers/render-controllers/doc-checklist.render-controller.ts
25291
+ // src/controllers/render-controllers/doc-checklist.render-controller.ts
25387
25292
  let DocChecklistRenderController = class DocChecklistRenderController extends Disposable {
25388
25293
  constructor(_context, _docSkeletonManagerService, _commandService, _docEventManagerService, _textSelectionManagerService) {
25389
25294
  super();
@@ -25425,8 +25330,7 @@ DocChecklistRenderController = __decorate([
25425
25330
  __decorateParam(4, Inject(DocSelectionManagerService))
25426
25331
  ], DocChecklistRenderController);
25427
25332
 
25428
- //#endregion
25429
- //#region src/controllers/render-controllers/doc-clipboard.controller.ts
25333
+ // src/controllers/render-controllers/doc-clipboard.controller.ts
25430
25334
  let DocClipboardController = class DocClipboardController extends RxDisposable {
25431
25335
  constructor(_context, _commandService, _docClipboardService, _docSelectionRenderService, _contextService, _editorService) {
25432
25336
  super();
@@ -25471,8 +25375,7 @@ DocClipboardController = __decorate([
25471
25375
  __decorateParam(5, IEditorService)
25472
25376
  ], DocClipboardController);
25473
25377
 
25474
- //#endregion
25475
- //#region src/controllers/render-controllers/doc-contextmenu.render-controller.ts
25378
+ // src/controllers/render-controllers/doc-contextmenu.render-controller.ts
25476
25379
  const SKIP_UNIT_IDS = [
25477
25380
  DEFAULT_EMPTY_DOCUMENT_VALUE,
25478
25381
  DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,
@@ -25543,8 +25446,7 @@ function isRangeIntersectingBlock(range, startIndex, endIndex) {
25543
25446
  return Math.max(range.startOffset, startIndex) <= Math.min(range.endOffset, endIndex);
25544
25447
  }
25545
25448
 
25546
- //#endregion
25547
- //#region src/controllers/render-controllers/doc-editor-bridge.controller.ts
25449
+ // src/controllers/render-controllers/doc-editor-bridge.controller.ts
25548
25450
  let DocEditorBridgeController = class DocEditorBridgeController extends Disposable {
25549
25451
  constructor(_context, _univerInstanceService, _editorService, _commandService, _docSelectionRenderService, _docSkeletonManagerService, _renderManagerService) {
25550
25452
  super();
@@ -25656,8 +25558,7 @@ DocEditorBridgeController = __decorate([
25656
25558
  __decorateParam(6, IRenderManagerService)
25657
25559
  ], DocEditorBridgeController);
25658
25560
 
25659
- //#endregion
25660
- //#region src/controllers/render-controllers/doc-ime-input.controller.ts
25561
+ // src/controllers/render-controllers/doc-ime-input.controller.ts
25661
25562
  let DocIMEInputController = class DocIMEInputController extends Disposable {
25662
25563
  constructor(_context, _docSelectionRenderService, _docImeInputManagerService, _docSkeletonManagerService, _docStateEmitService, _docSelectionManagerService, _commandService) {
25663
25564
  super();
@@ -25788,8 +25689,7 @@ DocIMEInputController = __decorate([
25788
25689
  __decorateParam(6, ICommandService)
25789
25690
  ], DocIMEInputController);
25790
25691
 
25791
- //#endregion
25792
- //#region src/controllers/render-controllers/doc-input.controller.ts
25692
+ // src/controllers/render-controllers/doc-input.controller.ts
25793
25693
  let DocInputController = class DocInputController extends Disposable {
25794
25694
  constructor(_context, _docSelectionRenderService, _docSkeletonManagerService, _commandService, _docMenuStyleService, _embedInteractionBoundaryService, _embedRuntimeFocusCoordinator) {
25795
25695
  super();
@@ -25879,8 +25779,7 @@ DocInputController = __decorate([
25879
25779
  __decorateParam(6, Optional(IDocEmbedRuntimeFocusCoordinator))
25880
25780
  ], DocInputController);
25881
25781
 
25882
- //#endregion
25883
- //#region src/controllers/render-controllers/doc-layout-progress.render-controller.ts
25782
+ // src/controllers/render-controllers/doc-layout-progress.render-controller.ts
25884
25783
  const DOC_LAYOUT_PROGRESS_DELAY_MS = 2e3;
25885
25784
  const DOC_LAYOUT_PROGRESS_CANCEL_GRACE_MS = 1e3;
25886
25785
  function resolveDocLayoutProgressPercent(progress) {
@@ -25975,8 +25874,7 @@ let DocLayoutProgressRenderController = class DocLayoutProgressRenderController
25975
25874
  };
25976
25875
  DocLayoutProgressRenderController = __decorate([__decorateParam(1, Inject(DocSkeletonManagerService)), __decorateParam(2, Inject(DocLayoutProgressService))], DocLayoutProgressRenderController);
25977
25876
 
25978
- //#endregion
25979
- //#region src/controllers/render-controllers/doc-layout-recovery.render-controller.ts
25877
+ // src/controllers/render-controllers/doc-layout-recovery.render-controller.ts
25980
25878
  function acquireDocLayoutRecoveryInteractionLock(canvas, shortcutService, blurSelection) {
25981
25879
  const previousPointerEvents = canvas.style.pointerEvents;
25982
25880
  const previousOpacity = canvas.style.opacity;
@@ -26056,8 +25954,7 @@ DocLayoutRecoveryRenderController = __decorate([
26056
25954
  __decorateParam(4, IShortcutService)
26057
25955
  ], DocLayoutRecoveryRenderController);
26058
25956
 
26059
- //#endregion
26060
- //#region src/controllers/render-controllers/doc-paste-options.render-controller.ts
25957
+ // src/controllers/render-controllers/doc-paste-options.render-controller.ts
26061
25958
  let DocPasteOptionsRenderController = class DocPasteOptionsRenderController extends Disposable {
26062
25959
  constructor(_context, _clipboard, selection, popupManager, contextService) {
26063
25960
  super();
@@ -26120,8 +26017,7 @@ DocPasteOptionsRenderController = __decorate([
26120
26017
  __decorateParam(4, IContextService)
26121
26018
  ], DocPasteOptionsRenderController);
26122
26019
 
26123
- //#endregion
26124
- //#region src/controllers/render-controllers/doc-resize.render-controller.ts
26020
+ // src/controllers/render-controllers/doc-resize.render-controller.ts
26125
26021
  function hasRenderableDocSkeleton(component) {
26126
26022
  if (typeof component !== "object" || component == null || !("getSkeleton" in component) || typeof component.getSkeleton !== "function") return false;
26127
26023
  const skeleton = component.getSkeleton();
@@ -26164,8 +26060,7 @@ DocResizeRenderController = __decorate([
26164
26060
  __decorateParam(3, ISidebarService)
26165
26061
  ], DocResizeRenderController);
26166
26062
 
26167
- //#endregion
26168
- //#region src/controllers/render-controllers/mobile/back-scroll.render-controller.ts
26063
+ // src/controllers/render-controllers/mobile/back-scroll.render-controller.ts
26169
26064
  const MOBILE_CARET_MARGIN = 32;
26170
26065
  const MOBILE_TOOLBAR_HEIGHT = 48;
26171
26066
  const MOBILE_CARET_VIEWPORT_RATIO = .4;
@@ -26205,8 +26100,7 @@ MobileDocBackScrollRenderController = __decorate([
26205
26100
  __decorateParam(5, Inject(DocPageLayoutService))
26206
26101
  ], MobileDocBackScrollRenderController);
26207
26102
 
26208
- //#endregion
26209
- //#region src/controllers/render-controllers/doc-selection-render.util.ts
26103
+ // src/controllers/render-controllers/doc-selection-render.util.ts
26210
26104
  function isEmbedInteractionEvent(evt) {
26211
26105
  var _document$elementFrom;
26212
26106
  const target = evt.target;
@@ -26237,8 +26131,7 @@ function getEventClientPoint(evt, target) {
26237
26131
  };
26238
26132
  }
26239
26133
 
26240
- //#endregion
26241
- //#region src/controllers/render-controllers/mobile/doc-selection-render.controller.ts
26134
+ // src/controllers/render-controllers/mobile/doc-selection-render.controller.ts
26242
26135
  const DOUBLE_TAP_INTERVAL = 450;
26243
26136
  const DOUBLE_TAP_DISTANCE = 28;
26244
26137
  const DRAG_THRESHOLD = 12;
@@ -26733,8 +26626,7 @@ function calculateInertiaVelocity(history, duration, displacement) {
26733
26626
  };
26734
26627
  }
26735
26628
 
26736
- //#endregion
26737
- //#region src/controllers/render-controllers/mobile/doc.render-controller.ts
26629
+ // src/controllers/render-controllers/mobile/doc.render-controller.ts
26738
26630
  const MOBILE_DOC_OUTER_MARGIN = 12;
26739
26631
  let MobileDocRenderController = class MobileDocRenderController extends DocRenderController {
26740
26632
  constructor(context, commandService, docSelectionRenderService, docSkeletonManagerService, editorService, renderManagerService, univerInstanceService, docPageLayoutService, textSelectionManagerService, docViewScaleService, themeService, docLayoutExecutorService, docLayoutInteractionService, logService) {
@@ -26794,8 +26686,7 @@ MobileDocRenderController = __decorate([
26794
26686
  __decorateParam(13, ILogService)
26795
26687
  ], MobileDocRenderController);
26796
26688
 
26797
- //#endregion
26798
- //#region src/controllers/render-controllers/zoom.render-controller.ts
26689
+ // src/controllers/render-controllers/zoom.render-controller.ts
26799
26690
  function shouldHandleDocWheelZoom(event, focusingDoc, _documentFlavor) {
26800
26691
  return focusingDoc && (event.ctrlKey || event.metaKey);
26801
26692
  }
@@ -26921,8 +26812,7 @@ DocZoomRenderController = __decorate([
26921
26812
  __decorateParam(10, Optional(IDocEmbedInteractionBoundaryService))
26922
26813
  ], DocZoomRenderController);
26923
26814
 
26924
- //#endregion
26925
- //#region src/controllers/render-controllers/mobile/doc-pinch-zoom.ts
26815
+ // src/controllers/render-controllers/mobile/doc-pinch-zoom.ts
26926
26816
  const MOBILE_DOC_ZOOM_MIN = .5;
26927
26817
  const MOBILE_DOC_ZOOM_MAX = 3;
26928
26818
  function resolveMobileDocPinchZoomRatio(initialZoomRatio, initialDistance, currentDistance) {
@@ -27020,8 +26910,7 @@ var MobileDocPinchZoomGesture = class extends Disposable {
27020
26910
  }
27021
26911
  };
27022
26912
 
27023
- //#endregion
27024
- //#region src/controllers/render-controllers/mobile/zoom.render-controller.ts
26913
+ // src/controllers/render-controllers/mobile/zoom.render-controller.ts
27025
26914
  let MobileDocZoomRenderController = class MobileDocZoomRenderController extends DocZoomRenderController {
27026
26915
  constructor(context, contextService, docSkeletonManagerService, univerInstanceService, commandService, textSelectionManagerService, editorService, docPageLayoutService, renderManagerService, docViewScaleService, embedInteractionBoundaryService) {
27027
26916
  super(context, contextService, docSkeletonManagerService, univerInstanceService, commandService, textSelectionManagerService, editorService, docPageLayoutService, renderManagerService, docViewScaleService, embedInteractionBoundaryService);
@@ -27076,8 +26965,7 @@ MobileDocZoomRenderController = __decorate([
27076
26965
  __decorateParam(10, Optional(IDocEmbedInteractionBoundaryService))
27077
26966
  ], MobileDocZoomRenderController);
27078
26967
 
27079
- //#endregion
27080
- //#region src/services/doc-ime-state-change-interceptor.service.ts
26968
+ // src/services/doc-ime-state-change-interceptor.service.ts
27081
26969
  let DocIMEStateChangeInterceptorService = class DocIMEStateChangeInterceptorService {
27082
26970
  constructor(_renderManagerService) {
27083
26971
  this._renderManagerService = _renderManagerService;
@@ -27113,8 +27001,7 @@ let DocIMEStateChangeInterceptorService = class DocIMEStateChangeInterceptorServ
27113
27001
  };
27114
27002
  DocIMEStateChangeInterceptorService = __decorate([__decorateParam(0, IRenderManagerService)], DocIMEStateChangeInterceptorService);
27115
27003
 
27116
- //#endregion
27117
- //#region src/services/doc-print-interceptor.service.ts
27004
+ // src/services/doc-print-interceptor.service.ts
27118
27005
  const PRINTING_COMPONENT_COLLECT = createInterceptorKey("PRINTING_COMPONENT_COLLECT");
27119
27006
  const PRINTING_DOM_COLLECT = createInterceptorKey("PRINTING_DOM_COLLECT");
27120
27007
  var DocPrintInterceptorService = class extends Disposable {
@@ -27175,8 +27062,7 @@ function collectPageDrawingIds(page, drawingIds) {
27175
27062
  for (const table of page.skeTables.values()) for (const row of table.rows) for (const cell of row.cells) collectPageDrawingIds(cell, drawingIds);
27176
27063
  }
27177
27064
 
27178
- //#endregion
27179
- //#region src/services/docs-render.service.ts
27065
+ // src/services/docs-render.service.ts
27180
27066
  const DOC_MAIN_CANVAS_ID = "univer-doc-main-canvas";
27181
27067
  function getDocsCanvasBackgroundColor(documentFlavor, canvasColorService, editorBackgroundColor, isEditor) {
27182
27068
  return resolveDocRenderBackground({
@@ -27227,8 +27113,7 @@ let DocsRenderService = class DocsRenderService extends RxDisposable {
27227
27113
  };
27228
27114
  DocsRenderService = __decorate([__decorateParam(0, IUniverInstanceService), __decorateParam(1, IRenderManagerService)], DocsRenderService);
27229
27115
 
27230
- //#endregion
27231
- //#region src/views/float-toolbar/FloatToolbar.tsx
27116
+ // src/views/float-toolbar/FloatToolbar.tsx
27232
27117
  const FLOAT_MENU_COMPONENT_KEY = "univer.doc.float-menu";
27233
27118
  const DEFAULT_AVALIABLE_MENUS = [
27234
27119
  FLOAT_TEXT_STYLE_MENU_ID,
@@ -27354,8 +27239,7 @@ function FloatToolbar(props) {
27354
27239
  });
27355
27240
  }
27356
27241
 
27357
- //#endregion
27358
- //#region src/services/float-menu.service.ts
27242
+ // src/services/float-menu.service.ts
27359
27243
  const SKIP_SYMBOLS = [DataStreamTreeTokenType.CUSTOM_BLOCK, DataStreamTreeTokenType.PARAGRAPH];
27360
27244
  let DocFloatMenuService = class DocFloatMenuService extends Disposable {
27361
27245
  constructor(_context, _docSelectionManagerService, _docCanvasPopManagerService, _univerInstanceService, _docSelectionRenderService, _contextService, _contextMenuService, _permissionService, _docLayoutInteractionService, _embedRuntimeFocusCoordinator) {
@@ -27526,8 +27410,7 @@ function isRangeInCodeBlock(documentDataModel, range) {
27526
27410
  return (((_documentDataModel$ge3 = documentDataModel.getBody()) === null || _documentDataModel$ge3 === void 0 ? void 0 : _documentDataModel$ge3.blockRanges) ?? []).some((blockRange) => blockRange.blockType === DocumentBlockRangeType.CODE && Math.max(range.startOffset, blockRange.startIndex) <= Math.min(range.endOffset, blockRange.endIndex));
27527
27411
  }
27528
27412
 
27529
- //#endregion
27530
- //#region src/services/mobile/mobile-text-selection-visuals.ts
27413
+ // src/services/mobile/mobile-text-selection-visuals.ts
27531
27414
  const MOBILE_HANDLE_TOUCH_SIZE = 32;
27532
27415
  const MOBILE_HANDLE_VISUAL_SIZE = 12;
27533
27416
  const MOBILE_HANDLE_STEM_WIDTH = 2;
@@ -27659,8 +27542,7 @@ var MobileTextSelectionVisuals = class {
27659
27542
  }
27660
27543
  };
27661
27544
 
27662
- //#endregion
27663
- //#region src/services/mobile/doc-selection-render.service.ts
27545
+ // src/services/mobile/doc-selection-render.service.ts
27664
27546
  const MOBILE_KEYBOARD_THRESHOLD = 80;
27665
27547
  const MOBILE_INPUT_VIEWPORT_INSET = 1;
27666
27548
  let MobileDocSelectionRenderService = class MobileDocSelectionRenderService extends DocSelectionRenderService {
@@ -27891,8 +27773,7 @@ MobileDocSelectionRenderService = __decorate([
27891
27773
  __decorateParam(8, Optional(IDocEmbedRuntimeFocusCoordinator))
27892
27774
  ], MobileDocSelectionRenderService);
27893
27775
 
27894
- //#endregion
27895
- //#region src/services/mobile/doc-view-scale.ts
27776
+ // src/services/mobile/doc-view-scale.ts
27896
27777
  /**
27897
27778
  * Copyright 2023-present DreamNum Co., Ltd.
27898
27779
  *
@@ -27915,8 +27796,7 @@ var MobileDocViewScaleService = class extends DocViewScaleService {
27915
27796
  }
27916
27797
  };
27917
27798
 
27918
- //#endregion
27919
- //#region src/services/mobile/float-menu.service.ts
27799
+ // src/services/mobile/float-menu.service.ts
27920
27800
  var MobileDocFloatMenuService = class extends DocFloatMenuService {
27921
27801
  _openSelectionMenu(unitId, range) {
27922
27802
  const [anchor] = this._docCanvasPopManagerService.getRangeBounds(range, unitId) ?? [];
@@ -27938,8 +27818,7 @@ var MobileDocFloatMenuService = class extends DocFloatMenuService {
27938
27818
  }
27939
27819
  };
27940
27820
 
27941
- //#endregion
27942
- //#region src/mobile-plugin.ts
27821
+ // src/mobile-plugin.ts
27943
27822
  let UniverDocsMobileUIPlugin = class UniverDocsMobileUIPlugin extends Plugin {
27944
27823
  constructor(_config = defaultPluginMobileConfig, _injector, _renderManagerSrv, _commandService, _configService) {
27945
27824
  super();
@@ -28160,8 +28039,7 @@ UniverDocsMobileUIPlugin = __decorate([
28160
28039
  __decorateParam(4, IConfigService)
28161
28040
  ], UniverDocsMobileUIPlugin);
28162
28041
 
28163
- //#endregion
28164
- //#region src/views/header-footer/panel/DocHeaderFooterFields.tsx
28042
+ // src/views/header-footer/panel/DocHeaderFooterFields.tsx
28165
28043
  function DocHeaderFooterFields({ unitId, disabled }) {
28166
28044
  const localeService = useDependency(LocaleService);
28167
28045
  useObservable(localeService.currentLocale$);
@@ -28340,8 +28218,7 @@ function DocHeaderFooterFields({ unitId, disabled }) {
28340
28218
  });
28341
28219
  }
28342
28220
 
28343
- //#endregion
28344
- //#region src/views/header-footer/panel/DocHeaderFooterRibbonControl.tsx
28221
+ // src/views/header-footer/panel/DocHeaderFooterRibbonControl.tsx
28345
28222
  function DocHeaderFooterRibbonControl(props) {
28346
28223
  const instances = useDependency(IUniverInstanceService);
28347
28224
  const localeService = useDependency(LocaleService);
@@ -28473,8 +28350,7 @@ function HeaderFooterRibbonControl({ kind, unitId }) {
28473
28350
  });
28474
28351
  }
28475
28352
 
28476
- //#endregion
28477
- //#region src/views/paragraph-menu/component-keys.ts
28353
+ // src/views/paragraph-menu/component-keys.ts
28478
28354
  /**
28479
28355
  * Copyright 2023-present DreamNum Co., Ltd.
28480
28356
  *
@@ -28493,8 +28369,7 @@ function HeaderFooterRibbonControl({ kind, unitId }) {
28493
28369
  const DOC_PARAGRAPH_MENU_COMPONENT_KEY = "doc.paragraph.menu";
28494
28370
  const DOC_TABLE_BLOCK_MENU_COMPONENT_KEY = "doc.table-block.menu";
28495
28371
 
28496
- //#endregion
28497
- //#region src/services/doc-paragraph-menu.service.ts
28372
+ // src/services/doc-paragraph-menu.service.ts
28498
28373
  const BLOCK_RANGE_ICON_MAP = {
28499
28374
  code: "CodeBlockIcon",
28500
28375
  quote: "QuoteIcon",
@@ -29311,8 +29186,7 @@ function getBlockRangeAnchorRect(docEventManagerService, blockRange, fallbackPar
29311
29186
  };
29312
29187
  }
29313
29188
 
29314
- //#endregion
29315
- //#region src/views/paragraph-menu/paragraph-menu-position.ts
29189
+ // src/views/paragraph-menu/paragraph-menu-position.ts
29316
29190
  function observeParagraphMenuPosition(element, popup, targets$) {
29317
29191
  let anchor;
29318
29192
  let table = false;
@@ -29379,8 +29253,7 @@ function observeParagraphMenuPosition(element, popup, targets$) {
29379
29253
  };
29380
29254
  }
29381
29255
 
29382
- //#endregion
29383
- //#region src/views/ParagraphMenu.tsx
29256
+ // src/views/ParagraphMenu.tsx
29384
29257
  function getParagraphMenuPopupDirection(anchorLeft, menuWidth = 212, viewportPadding = 8, options = {}) {
29385
29258
  const { anchorRight = anchorLeft, direction = "ltr", viewportWidth = Number.POSITIVE_INFINITY } = options;
29386
29259
  const hasLeftSpace = anchorLeft - menuWidth >= viewportPadding;
@@ -30459,8 +30332,7 @@ function DragHandleDotsIcon() {
30459
30332
  });
30460
30333
  }
30461
30334
 
30462
- //#endregion
30463
- //#region src/controllers/components.controller.ts
30335
+ // src/controllers/components.controller.ts
30464
30336
  /**
30465
30337
  * Copyright 2023-present DreamNum Co., Ltd.
30466
30338
  *
@@ -30483,14 +30355,8 @@ let ComponentsController = class ComponentsController extends Disposable {
30483
30355
  this._componentManager = _componentManager;
30484
30356
  this._iconManager = _iconManager;
30485
30357
  this._registerComponents();
30486
- this._registerParts();
30487
30358
  this._registerIcons();
30488
30359
  }
30489
- _registerParts() {
30490
- const componentManager = this._componentManager;
30491
- this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, DocPasteOptions));
30492
- this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
30493
- }
30494
30360
  _registerIcons() {
30495
30361
  this.disposeWithMe(this._iconManager.register({
30496
30362
  AlignTextBothIcon,
@@ -30595,12 +30461,14 @@ let ComponentsController = class ComponentsController extends Disposable {
30595
30461
  ].forEach(([key, comp]) => {
30596
30462
  this.disposeWithMe(this._componentManager.register(key, comp));
30597
30463
  });
30464
+ const componentManager = this._componentManager;
30465
+ this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, DocPasteOptions));
30466
+ this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
30598
30467
  }
30599
30468
  };
30600
30469
  ComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager)), __decorateParam(1, Inject(IconManager))], ComponentsController);
30601
30470
 
30602
- //#endregion
30603
- //#region src/controllers/doc-header-footer-ribbon.controller.ts
30471
+ // src/controllers/doc-header-footer-ribbon.controller.ts
30604
30472
  let DocHeaderFooterRibbonController = class DocHeaderFooterRibbonController extends Disposable {
30605
30473
  constructor(_context, skeletonManager, _instanceService, _ribbonService, _renderManager) {
30606
30474
  super();
@@ -30636,8 +30504,7 @@ DocHeaderFooterRibbonController = __decorate([
30636
30504
  __decorateParam(4, IRenderManagerService)
30637
30505
  ], DocHeaderFooterRibbonController);
30638
30506
 
30639
- //#endregion
30640
- //#region src/controllers/format-painter.controller.ts
30507
+ // src/controllers/format-painter.controller.ts
30641
30508
  let DocFormatPainterController = class DocFormatPainterController extends Disposable {
30642
30509
  constructor(session, selections, styles, instances, context, permissions, editors, commands) {
30643
30510
  super();
@@ -30703,8 +30570,7 @@ DocFormatPainterController = __decorate([
30703
30570
  __decorateParam(7, ICommandService)
30704
30571
  ], DocFormatPainterController);
30705
30572
 
30706
- //#endregion
30707
- //#region src/controllers/render-controllers/doc-field.render-controller.ts
30573
+ // src/controllers/render-controllers/doc-field.render-controller.ts
30708
30574
  let DocFieldRenderController = class DocFieldRenderController extends Disposable {
30709
30575
  constructor(_context, _events, _selections, theme, _instances) {
30710
30576
  super();
@@ -30780,8 +30646,7 @@ DocFieldRenderController = __decorate([
30780
30646
  __decorateParam(4, IUniverInstanceService)
30781
30647
  ], DocFieldRenderController);
30782
30648
 
30783
- //#endregion
30784
- //#region src/controllers/render-controllers/doc-selection-render.controller.ts
30649
+ // src/controllers/render-controllers/doc-selection-render.controller.ts
30785
30650
  let DocSelectionRenderController = class DocSelectionRenderController extends Disposable {
30786
30651
  constructor(_context, _commandService, _editorService, _instanceSrv, _docSelectionRenderService, _docSkeletonManagerService, _docSelectionManagerService, _embedInteractionBoundaryService, _embedRuntimeFocusCoordinator) {
30787
30652
  super();
@@ -30992,8 +30857,7 @@ DocSelectionRenderController = __decorate([
30992
30857
  __decorateParam(8, Optional(IDocEmbedRuntimeFocusCoordinator))
30993
30858
  ], DocSelectionRenderController);
30994
30859
 
30995
- //#endregion
30996
- //#region src/controllers/render-controllers/format-painter.render-controller.ts
30860
+ // src/controllers/render-controllers/format-painter.render-controller.ts
30997
30861
  let DocFormatPainterRenderController = class DocFormatPainterRenderController extends Disposable {
30998
30862
  constructor(context, session, selections, instances) {
30999
30863
  super();
@@ -31024,8 +30888,7 @@ DocFormatPainterRenderController = __decorate([
31024
30888
  __decorateParam(3, IUniverInstanceService)
31025
30889
  ], DocFormatPainterRenderController);
31026
30890
 
31027
- //#endregion
31028
- //#region src/services/doc-contextual-ribbon.service.ts
30891
+ // src/services/doc-contextual-ribbon.service.ts
31029
30892
  /**
31030
30893
  * Copyright 2023-present DreamNum Co., Ltd.
31031
30894
  *
@@ -31077,8 +30940,7 @@ let DocContextualRibbonService = class DocContextualRibbonService extends Dispos
31077
30940
  };
31078
30941
  DocContextualRibbonService = __decorate([__decorateParam(0, IRibbonService)], DocContextualRibbonService);
31079
30942
 
31080
- //#endregion
31081
- //#region src/views/heading-collapse-shape.ts
30943
+ // src/views/heading-collapse-shape.ts
31082
30944
  var HeadingCollapseShape = class extends Shape {
31083
30945
  constructor(key, colors, activate) {
31084
30946
  super(key, {
@@ -31196,8 +31058,7 @@ var HeadingCollapseShape = class extends Shape {
31196
31058
  }
31197
31059
  };
31198
31060
 
31199
- //#endregion
31200
- //#region src/services/doc-heading-collapse.service.ts
31061
+ // src/services/doc-heading-collapse.service.ts
31201
31062
  let DocHeadingCollapseService = class DocHeadingCollapseService extends Disposable {
31202
31063
  constructor(_context, _skeletonManager, _eventManager, _selections, _commandService, _layoutService, themeService, localeService) {
31203
31064
  super();
@@ -31360,8 +31221,7 @@ DocHeadingCollapseService = __decorate([
31360
31221
  __decorateParam(7, Inject(LocaleService))
31361
31222
  ], DocHeadingCollapseService);
31362
31223
 
31363
- //#endregion
31364
- //#region src/shortcuts/core-editing.shortcut.ts
31224
+ // src/shortcuts/core-editing.shortcut.ts
31365
31225
  const BreakLineShortcut = {
31366
31226
  id: EnterCommand.id,
31367
31227
  preconditions: whenDocAndEditorFocusedWithBreakLine,
@@ -31414,8 +31274,7 @@ const DeleteLineEndShortcut = {
31414
31274
  staticParameters: { granularity: "line" }
31415
31275
  };
31416
31276
 
31417
- //#endregion
31418
- //#region src/shortcuts/cursor.shortcut.ts
31277
+ // src/shortcuts/cursor.shortcut.ts
31419
31278
  function moveCursorShortcut(direction, granularity, binding, mac = binding, win = binding, linux = binding) {
31420
31279
  return {
31421
31280
  id: MoveCursorOperation.id,
@@ -31514,8 +31373,7 @@ const SelectAllShortcut = {
31514
31373
  preconditions: (contextService) => contextService.getContextValue(FOCUSING_UNIVER_EDITOR) && (contextService.getContextValue(FOCUSING_DOC) || contextService.getContextValue(EDITOR_ACTIVATED))
31515
31374
  };
31516
31375
 
31517
- //#endregion
31518
- //#region src/shortcuts/heading.shortcut.ts
31376
+ // src/shortcuts/heading.shortcut.ts
31519
31377
  function headingShortcut(id, key) {
31520
31378
  const binding = key | MetaKeys.CTRL_COMMAND | MetaKeys.ALT;
31521
31379
  return {
@@ -31534,8 +31392,7 @@ const H3HeadingShortcut = headingShortcut(H3HeadingCommand.id, KeyCode.Digit3);
31534
31392
  const H4HeadingShortcut = headingShortcut(H4HeadingCommand.id, KeyCode.Digit4);
31535
31393
  const H5HeadingShortcut = headingShortcut(H5HeadingCommand.id, KeyCode.Digit5);
31536
31394
 
31537
- //#endregion
31538
- //#region src/plugin.ts
31395
+ // src/plugin.ts
31539
31396
  let UniverDocsUIPlugin = class UniverDocsUIPlugin extends Plugin {
31540
31397
  constructor(_config = defaultPluginConfig, _injector, _renderManagerSrv, _commandService, _configService) {
31541
31398
  super();
@@ -31812,8 +31669,7 @@ UniverDocsUIPlugin = __decorate([
31812
31669
  __decorateParam(4, IConfigService)
31813
31670
  ], UniverDocsUIPlugin);
31814
31671
 
31815
- //#endregion
31816
- //#region src/services/clipboard/rtf-to-plain-text.ts
31672
+ // src/services/clipboard/rtf-to-plain-text.ts
31817
31673
  /**
31818
31674
  * Copyright 2023-present DreamNum Co., Ltd.
31819
31675
  *
@@ -31973,8 +31829,7 @@ function decodeWindows1252(code) {
31973
31829
  }[code] ?? String.fromCharCode(code);
31974
31830
  }
31975
31831
 
31976
- //#endregion
31977
- //#region src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
31832
+ // src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
31978
31833
  const COLOR_TOKENS = [
31979
31834
  "gray.900",
31980
31835
  "red.500",
@@ -32055,10 +31910,8 @@ function MobileRichTextToolbar({ editorId, className }) {
32055
31910
  return /* @__PURE__ */ jsx("div", {
32056
31911
  "data-u-comp": "mobile-rich-text-toolbar",
32057
31912
  className: clsx("univer-box-border univer-bg-gray-0 univer-shadow-[0_1px_0_rgba(0,0,0,0.06)] dark:!univer-bg-gray-800", className),
32058
- onPointerDown: (event) => {
32059
- event.preventDefault();
32060
- event.stopPropagation();
32061
- },
31913
+ onPointerDown: (event) => event.stopPropagation(),
31914
+ onMouseDown: (event) => event.preventDefault(),
32062
31915
  children: !colorsVisible ? /* @__PURE__ */ jsxs("div", {
32063
31916
  className: "univer-grid univer-h-11 univer-grid-cols-7 univer-gap-1 univer-px-2",
32064
31917
  children: [
@@ -32148,7 +32001,7 @@ function MobileRichTextToolbar({ editorId, className }) {
32148
32001
  variant: "text",
32149
32002
  size: "icon",
32150
32003
  "aria-label": localeService.t("docs-ui.toolbar.textColor.main"),
32151
- className: "univer-size-7 univer-justify-self-center",
32004
+ className: "univer-justify-self-center",
32152
32005
  children: /* @__PURE__ */ jsx(ColorWheelMultiIcon, { className: "!univer-size-6" })
32153
32006
  })
32154
32007
  })
@@ -32170,8 +32023,7 @@ function FormatButton(props) {
32170
32023
  });
32171
32024
  }
32172
32025
 
32173
- //#endregion
32174
- //#region src/views/rich-text-editor/hooks/editor-undo-redo-keyboard.ts
32026
+ // src/views/rich-text-editor/hooks/editor-undo-redo-keyboard.ts
32175
32027
  function isSheetFormulaEditor(editorUnitId, univerInstanceService) {
32176
32028
  var _documentModel$getBod;
32177
32029
  if (editorUnitId !== DOCS_NORMAL_EDITOR_UNIT_ID_KEY && editorUnitId !== DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) return false;
@@ -32251,8 +32103,7 @@ function createEditorUndoRedoKeyboardConfig(options) {
32251
32103
  };
32252
32104
  }
32253
32105
 
32254
- //#endregion
32255
- //#region src/views/rich-text-editor/hooks/use-editor.ts
32106
+ // src/views/rich-text-editor/hooks/use-editor.ts
32256
32107
  function useEditor(opts) {
32257
32108
  const { autoFocus: _autoFocus, cancelDefaultResizeListener, canvasStyle, container, disableBackScroll, documentLayoutSize, emitSelectionWhileDragging, editorId, initialValue, isSingle, pixelRatio, preserveHostFocus, renderConfig } = opts;
32258
32109
  const autoFocus = useMemo(() => _autoFocus ?? false, []);
@@ -32318,8 +32169,7 @@ function useEditor(opts) {
32318
32169
  return editor;
32319
32170
  }
32320
32171
 
32321
- //#endregion
32322
- //#region src/views/rich-text-editor/hooks/use-editor-click-outside.ts
32172
+ // src/views/rich-text-editor/hooks/use-editor-click-outside.ts
32323
32173
  const useEditorClickOutside = (editorId, containerRef, onClickOutside) => {
32324
32174
  const editorService = useDependency(IEditorService);
32325
32175
  useEffect(() => {
@@ -32344,8 +32194,7 @@ const useEditorClickOutside = (editorId, containerRef, onClickOutside) => {
32344
32194
  ]);
32345
32195
  };
32346
32196
 
32347
- //#endregion
32348
- //#region src/views/rich-text-editor/hooks/use-is-focusing.ts
32197
+ // src/views/rich-text-editor/hooks/use-is-focusing.ts
32349
32198
  /**
32350
32199
  * Copyright 2023-present DreamNum Co., Ltd.
32351
32200
  *
@@ -32368,8 +32217,7 @@ function useIsFocusing(editorId) {
32368
32217
  return Boolean(((docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing) ?? false) && (selections === null || selections === void 0 ? void 0 : selections.textRanges.some((r) => r.collapsed)));
32369
32218
  }
32370
32219
 
32371
- //#endregion
32372
- //#region src/views/rich-text-editor/hooks/use-keyboard-event.ts
32220
+ // src/views/rich-text-editor/hooks/use-keyboard-event.ts
32373
32221
  function useKeyboardEvent(isNeed, config, editor) {
32374
32222
  const commandService = useDependency(ICommandService);
32375
32223
  const shortcutService = useDependency(IShortcutService);
@@ -32417,8 +32265,7 @@ function useKeyboardEvent(isNeed, config, editor) {
32417
32265
  ]);
32418
32266
  }
32419
32267
 
32420
- //#endregion
32421
- //#region src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
32268
+ // src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
32422
32269
  const useLeftAndRightArrow = (isNeed, selectingMode, editor, onMoveInEditor) => {
32423
32270
  const commandService = useDependency(ICommandService);
32424
32271
  const shortcutService = useDependency(IShortcutService);
@@ -32498,8 +32345,7 @@ const useLeftAndRightArrow = (isNeed, selectingMode, editor, onMoveInEditor) =>
32498
32345
  ]);
32499
32346
  };
32500
32347
 
32501
- //#endregion
32502
- //#region src/views/rich-text-editor/hooks/use-on-change.ts
32348
+ // src/views/rich-text-editor/hooks/use-on-change.ts
32503
32349
  function useOnChange(editor, onChange) {
32504
32350
  const commandService = useDependency(ICommandService);
32505
32351
  useEffect(() => {
@@ -32522,11 +32368,12 @@ function useOnChange(editor, onChange) {
32522
32368
  ]);
32523
32369
  }
32524
32370
 
32525
- //#endregion
32526
- //#region src/views/rich-text-editor/hooks/use-resize.ts
32371
+ // src/views/rich-text-editor/hooks/use-resize.ts
32527
32372
  function resizeEditor(editor, isSingle, layoutSize, pixelRatio, documentLayoutSize) {
32528
32373
  var _editor$render$compon;
32529
32374
  if (editor.render.isDisposed()) return;
32375
+ const selection = editor.docSelectionRenderService;
32376
+ const restoreSelection = selection.isFocusing || selection.getAllTextRanges().length > 0 || selection.getAllRectRanges().length > 0;
32530
32377
  const { scene, mainComponent } = editor.render;
32531
32378
  const docSkeletonManagerService = editor.render.with(DocSkeletonManagerService);
32532
32379
  const { width, height } = layoutSize ?? editor.getBoundingClientRect();
@@ -32542,7 +32389,7 @@ function resizeEditor(editor, isSingle, layoutSize, pixelRatio, documentLayoutSi
32542
32389
  mainComponent === null || mainComponent === void 0 || mainComponent.translate(0, 0);
32543
32390
  (_editor$render$compon = editor.render.components.get("__Document_Render_Background__")) === null || _editor$render$compon === void 0 || _editor$render$compon.translate(0, 0);
32544
32391
  const selectionRanges = editor.getSelectionRanges();
32545
- if (selectionRanges.length > 0) editor.setSelectionRanges(selectionRanges, false);
32392
+ if (restoreSelection && selectionRanges.length > 0) editor.setSelectionRanges(selectionRanges, false);
32546
32393
  }
32547
32394
  const useResize = (editor, isSingle = true, autoScrollbar, autoScroll, layoutSize, pixelRatio, documentLayoutSize) => {
32548
32395
  const resize = useCallback(() => {
@@ -32682,8 +32529,7 @@ const useResize = (editor, isSingle = true, autoScrollbar, autoScroll, layoutSiz
32682
32529
  };
32683
32530
  };
32684
32531
 
32685
- //#endregion
32686
- //#region src/views/RichTextEditor.tsx
32532
+ // src/views/RichTextEditor.tsx
32687
32533
  const RichTextEditor = (props) => {
32688
32534
  const { className, autoFocus, onFocusChange: _onFocusChange, initialValue, onClickOutside: _onClickOutside, preserveHostFocus, cancelDefaultResizeListener, documentLayoutSize, autoScroll = true, autoScrollbar = true, emitSelectionWhileDragging, keyboardEventsOnSelection = false, keyboardEventConfig, layoutSize, pixelRatio, moveCursor = true, style, isSingle, editorId: propsEditorId, onHeightChange, onChange: _onChange, defaultHeight = 32, maxHeight = 32, icon, editorRef, placeholder, noStyle, canvasStyle, renderConfig } = props;
32689
32535
  const commandService = useDependency(ICommandService);
@@ -32800,8 +32646,22 @@ const RichTextEditor = (props) => {
32800
32646
  });
32801
32647
  };
32802
32648
 
32803
- //#endregion
32804
- //#region src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx
32649
+ // src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx
32650
+ /**
32651
+ * Copyright 2023-present DreamNum Co., Ltd.
32652
+ *
32653
+ * Licensed under the Apache License, Version 2.0 (the "License");
32654
+ * you may not use this file except in compliance with the License.
32655
+ * You may obtain a copy of the License at
32656
+ *
32657
+ * http://www.apache.org/licenses/LICENSE-2.0
32658
+ *
32659
+ * Unless required by applicable law or agreed to in writing, software
32660
+ * distributed under the License is distributed on an "AS IS" BASIS,
32661
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32662
+ * See the License for the specific language governing permissions and
32663
+ * limitations under the License.
32664
+ */
32805
32665
  /** Compact object text input; expanding keeps the same document editor mounted. */
32806
32666
  function MobileRichTextEditor(props) {
32807
32667
  var _props$canvasStyle;
@@ -32826,7 +32686,7 @@ function MobileRichTextEditor(props) {
32826
32686
  if (keyboardWasVisibleRef.current && !visible) confirmOnDismiss();
32827
32687
  keyboardWasVisibleRef.current = visible;
32828
32688
  }, [confirmOnDismiss, keyboardInset]);
32829
- const buttonClassName = clsx("univer-h-12 univer-shrink-0 univer-text-lg", expanded ? "univer-flex-1" : "univer-w-10");
32689
+ const buttonClassName = clsx("univer-shrink-0", expanded ? "univer-flex-1" : "univer-w-10");
32830
32690
  const expandButton = /* @__PURE__ */ jsx(Button, {
32831
32691
  variant: "ghost",
32832
32692
  className: buttonClassName,
@@ -32834,6 +32694,7 @@ function MobileRichTextEditor(props) {
32834
32694
  "aria-expanded": expanded,
32835
32695
  onPointerDown: (event) => event.preventDefault(),
32836
32696
  onClick: () => onExpandedChange(!expanded),
32697
+ size: "middle",
32837
32698
  children: /* @__PURE__ */ jsx(DownIcon, { className: clsx("univer-size-5", !expanded && "univer-rotate-180") })
32838
32699
  });
32839
32700
  return /* @__PURE__ */ jsxs("section", {
@@ -32873,6 +32734,7 @@ function MobileRichTextEditor(props) {
32873
32734
  "aria-label": labels.cancel,
32874
32735
  onPointerDown: (event) => event.preventDefault(),
32875
32736
  onClick: onCancel,
32737
+ size: "middle",
32876
32738
  children: /* @__PURE__ */ jsx(CloseIcon, {})
32877
32739
  }),
32878
32740
  /* @__PURE__ */ jsx(Button, {
@@ -32881,6 +32743,7 @@ function MobileRichTextEditor(props) {
32881
32743
  "aria-label": labels.confirm,
32882
32744
  onPointerDown: (event) => event.preventDefault(),
32883
32745
  onClick: onConfirm,
32746
+ size: "middle",
32884
32747
  children: /* @__PURE__ */ jsx(CheckMarkIcon, {})
32885
32748
  }),
32886
32749
  expanded && expandButton
@@ -32915,5 +32778,4 @@ function MobileRichTextEditor(props) {
32915
32778
  });
32916
32779
  }
32917
32780
 
32918
- //#endregion
32919
32781
  export { AfterSpaceCommand, AlignCenterCommand, AlignJustifyCommand, AlignLeftCommand, AlignMenuItemFactory, AlignOperationCommand, AlignRightCommand, BackgroundColorSelectorMenuItemFactory, BoldMenuItemFactory, BreakLineCommand, BulletListCommand, BulletListTypePicker, ChangeListNestingLevelCommand, ChangeListNestingLevelType, ChangeListTypeCommand, CheckListCommand, CoverContentCommand, CreateDocTableCommand, CutContentCommand, DEFAULT_DOC_FIT_TO_WIDTH_OPTIONS, DOCS_COMPONENT_BACKGROUND_LAYER_INDEX, DOCS_COMPONENT_DEFAULT_Z_INDEX, DOCS_COMPONENT_HEADER_LAYER_INDEX, DOCS_COMPONENT_MAIN_LAYER_INDEX, DOCS_UI_PLUGIN_CONFIG_KEY, DOCS_VIEW_KEY, DOC_CONTENT_INSERT_MENU_ID, DOC_CUSTOM_RANGE_CHROME_BACKGROUND_ALPHA, DOC_CUSTOM_RANGE_CHROME_RADIUS, DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE, DOC_PARAGRAPH_T_ALIGN_MENU_ID, DOC_PARAGRAPH_T_COLORS_MENU_ID, DOC_PARAGRAPH_T_DIVIDER_MENU_ID, DOC_PARAGRAPH_T_EDIT_MENU_ID, DOC_PARAGRAPH_T_INSERT_BELOW_MENU_ID, DOC_PARAGRAPH_T_INSERT_MENU_ID, DOC_TABLE_BLOCK_MENU_ID, DOC_VERTICAL_PADDING, DeleteCurrentParagraphCommand, DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, DocAutoFormatService, DocBackScrollRenderController, DocCanvasPopManagerService, DocClipboardPasteAdapterService, DocContextualRibbonService, DocCopyCommand, DocCreateTableOperation, DocCutCommand, DocEventManagerService, DocFloatMenuService, DocHtmlExportService, DocIMEInputManagerService, DocLayoutInteractionService, DocMobileElementMenuService, DocPageLayoutService, DocParagraphMenuService, DocParagraphPlaceholderRenderController, DocPasteCommand, DocPrintInterceptorService, DocRenderController, DocSelectAllCommand, DocSelectionRenderService, DocTableDeleteColumnsCommand, DocTableDeleteRowsCommand, DocTableDeleteTableCommand, DocTableInsertColumnCommand, DocTableInsertColumnLeftCommand, DocTableInsertColumnRightCommand, DocTableInsertRowAboveCommand, DocTableInsertRowBellowCommand, DocTableInsertRowCommand, DocTableTabCommand, DocUIController, DocViewScaleService, DocsRenderService, menuSchema as DocsUIMenuSchema, EMPTY_PARAGRAPH_MENU_ID, Editor, EditorColorPicker, EditorService, EnterCommand, FLOAT_TEXT_STYLE_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, FloatTextStyleMenuItemFactory, FontFamilySelectorMenuItemFactory, FontSizeSelectorMenuItemFactory, HorizontalLineCommand, IDocClipboardPasteAdapterService, IDocClipboardService, IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator, IEditorService, IMEInputCommand, INSERT_BELLOW_MENU_ID, InnerPasteCommand, InsertCustomRangeCommand, ItalicMenuItemFactory, ListOperationCommand, MOBILE_DOC_ELEMENT_MENU, MergeTwoParagraphCommand, MobileDocElementMenu, MobileRichTextEditor, MobileRichTextToolbar, MoveCursorOperation, MoveDocBlockCommand, MoveSelectionOperation, NORMAL_TEXT_SELECTION_PLUGIN_NAME, NodePositionConvertToCursor, NodePositionConvertToRectRange, OrderListCommand, OrderListTypePicker, ParagraphMenuInsertBelowSubmenuItemFactory, ParagraphSettingMenuFactory, LarkPastePlugin as PastePluginLark, UniverPastePlugin as PastePluginUniver, WordPastePlugin as PastePluginWord, QuickListCommand, RectRange, ReplaceSelectionCommand, ReplaceSnapshotCommand, ReplaceTextRunsCommand, ResetInlineFormatTextBackgroundColorCommand, ResetInlineFormatTextColorCommand, RichTextEditor, SetDocInputStyleCommand, SetDocZoomRatioCommand, SetDocZoomRatioOperation, SetInlineFormatBoldCommand, SetInlineFormatCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatFontSizeCommand, SetInlineFormatItalicCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatTextBackgroundColorCommand, SetInlineFormatTextColorCommand, SetInlineFormatTextFillCommand, SetInlineFormatUnderlineCommand, SetParagraphNamedStyleCommand, StrikeThroughMenuItemFactory, SwitchDocModeCommand, TEXT_RANGE_LAYER_INDEX, TabCommand, TextColorSelectorMenuItemFactory, TextRange, ToggleCheckListCommand, UnderlineMenuItemFactory, UniverDocsMobileUIPlugin, UniverDocsUIPlugin, VIEWPORT_KEY, addCustomDecorationBySelectionFactory, addCustomDecorationFactory, buildMoveDocBlockActions, calcDocFitToWidthScale, calcDocRangePositions, captureTextFormat, collectDocsTableLikeEmbedChildUnitIds, convertBodyToHtml, convertClipboardHtmlToDocumentData, convertClipboardRtfToPlainText, convertPositionsToRectRanges, createDefaultDocsTableLikeCustomBlockBleedViewport, createDocsCustomBlockSizeRefreshScheduler, createEditorUndoRedoKeyboardConfig, deleteCustomDecorationFactory, disableMenuWhenHeaderFooterEditing, disableMenuWithoutDocumentUnitPermission, drawDocCustomRangeChrome, executeEditorUndoRedoCommand, findDocRangeNodePositions, genTableSource, generateParagraphs, getAnchorBounding, getCanvasOffsetByEngine, getCommandSkeleton, getCursorWhenDelete, getCutActionsFromDocRanges, getDocBlockRangeMenuId, getDocObjectById, getEditorRuntimeConfig, getEmptyTableCell, getEmptyTableRow, getLineBounding, getListMarkerFallbackBound, getListParagraphContextMenuHit, getOneTextSelectionRange, getStyleInTextRange, getTableColumn, getTextRangeFromCharIndex, hasParagraphInTable, hideMenuWhenSelectionInBlockRange, isInSameTableCell, isTextRangeInAnyBlockRange, isValidRectRange, neoGetDocObject, normalizeDocFitToWidthOptions, registerEditorRuntimeConfig, removeClipboardHtmlImages, resolveDocCustomRangeChromeTheme, resolveDocFitBaseWidth, resolveDocViewScale, resolveDocsCustomBlockRenderViewport, resolveDocsTableLikeCustomBlockBleedViewport, resolveDocsTableLikeCustomBlockContentHeight, resolveDocsTableLikeCustomBlockContentWidth, scrollDocsTableLikeCustomBlockLive, shouldRefreshDocsCustomBlockSizeForCommand, useEditor, useEditorClickOutside, useIsFocusing, useKeyboardEvent, useLeftAndRightArrow, useOnChange, useResize, whenDocAndEditorFocused };