@univerjs/docs-ui 0.2.13 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
- import { Disposable, toDisposable, UniverInstanceType, BuildTextUtils, Inject, IUniverInstanceService, TextX, JSONX, TextXActionType, getBodySlice, Tools, UpdateDocsAttributeType, DataStreamTreeTokenType, ObjectRelativeFromH, ObjectRelativeFromV, CommandType, sequenceExecuteAsync, ICommandService, PresetListType, BooleanNumber, normalizeBody, updateAttributeByInsert, TableCellHeightRule, TableSizeType, generateRandomId, TableAlignmentType, TableTextWrapType, MemoryCursor, PositionedObjectLayoutType, getCustomRangeSlice, getCustomDecorationSlice, LRUMap, BaselineOffset, ColorKit, skipParseTagNames, CustomRangeType, DataStreamTreeNodeType, createIdentifier, ILogService, SliceBodyType, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOC_RANGE_TYPE, FOCUSING_DOC, EDITOR_ACTIVATED, RxDisposable, PRESET_LIST_TYPE, GridType, sortRulesFactory, HorizontalAlign, IUndoRedoService, LocaleService, RANGE_DIRECTION, COLORS, Rectangle, useDependency, DocumentFlavor, FOCUSING_UNIVER_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, useObservable, SpacingRule, OnLifecycle, LifecycleStages, ThemeService, connectInjector, Injector, IConfigService, IContextService, QuickListTypeMap, Direction, DisposableCollection, fromEventSubject, DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_ZEN_EDITOR_UNIT_ID_KEY, checkForSubstrings, isInternalEditorID, UndoCommandId, RedoCommandId, Plugin, mergeOverrideWithDependencies } from "@univerjs/core";
5
+ import { Disposable, toDisposable, UniverInstanceType, BuildTextUtils, Inject, IUniverInstanceService, TextX, JSONX, TextXActionType, getBodySlice, Tools, UpdateDocsAttributeType, ObjectRelativeFromH, ObjectRelativeFromV, CommandType, sequenceExecuteAsync, ICommandService, DataStreamTreeTokenType, PresetListType, BooleanNumber, normalizeBody, updateAttributeByInsert, TableCellHeightRule, TableSizeType, generateRandomId, TableAlignmentType, TableTextWrapType, MemoryCursor, PositionedObjectLayoutType, getCustomRangeSlice, getCustomDecorationSlice, LRUMap, BaselineOffset, ColorKit, skipParseTagNames, CustomRangeType, DataStreamTreeNodeType, createIdentifier, ILogService, SliceBodyType, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOC_RANGE_TYPE, FOCUSING_DOC, EDITOR_ACTIVATED, RxDisposable, PRESET_LIST_TYPE, GridType, sortRulesFactory, HorizontalAlign, IUndoRedoService, LocaleService, RANGE_DIRECTION, COLORS, Rectangle, useDependency, DocumentFlavor, FOCUSING_UNIVER_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, useObservable, SpacingRule, OnLifecycle, LifecycleStages, ThemeService, connectInjector, Injector, IConfigService, IContextService, QuickListTypeMap, Direction, DisposableCollection, fromEventSubject, DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_ZEN_EDITOR_UNIT_ID_KEY, checkForSubstrings, isInternalEditorID, UndoCommandId, RedoCommandId, Plugin, mergeOverrideWithDependencies } from "@univerjs/core";
6
6
  import { DocSelectionManagerService, RichTextEditingMutation, DocSkeletonManagerService, SetTextSelectionsOperation, DocStateEmitService, DocInterceptorService } from "@univerjs/docs";
7
7
  import { IRenderManagerService, hasListGlyph, isIndentByGlyph, isFirstGlyph, getParagraphByGlyph, pixelToPt, ptToPixel, parseDataStreamToTree, getCharSpaceApply, getNumberUnitValue, Liquid, GlyphType, DocumentSkeletonPageType, getPageFromPath, getTableIdAndSliceIndex, NORMAL_TEXT_SELECTION_PLUGIN_STYLE, getColor, RegularPolygon, Rect, getOffsetRectForDom, ScrollTimer, CURSOR_TYPE, getSystemHighlightColor, Vector2, PageLayoutType, DocumentEditArea, Shape, Path, Viewport, ScrollBar, Layer, Documents, DocBackground, lineIterator, getLastLine, pxToNum, TRANSFORM_CHANGE_OBSERVABLE_TYPE } from "@univerjs/engine-render";
8
8
  import { IClipboardInterfaceService, PLAIN_TEXT_CLIPBOARD_MIME_TYPE, HTML_CLIPBOARD_MIME_TYPE, CopyCommand, CutCommand, PasteCommand, IConfirmService, ILayoutService, ComponentManager, IEditorService, ISidebarService, KeyCode, MetaKeys, MenuItemType, getMenuHiddenObservable, FONT_FAMILY_LIST, FONT_SIZE_LIST, getHeaderFooterMenuHiddenObservable, RibbonStartGroup, ContextMenuPosition, ContextMenuGroup, FontFamily, FontFamilyItem, FontSize, BuiltInUIPart, IMenuManagerService, IUIPartsService, IShortcutService, ICanvasPopupService, IContextMenuService, SetEditorResizeOperation } from "@univerjs/ui";
@@ -349,47 +349,6 @@ function hasParagraphInTable(paragraph, tables) {
349
349
  return tables.some((table) => paragraph.startIndex > table.startIndex && paragraph.startIndex < table.endIndex);
350
350
  }
351
351
  __name(hasParagraphInTable, "hasParagraphInTable");
352
- const getPlainText = /* @__PURE__ */ __name((text) => text.replaceAll(DataStreamTreeTokenType.CUSTOM_RANGE_START, "").replaceAll(DataStreamTreeTokenType.CUSTOM_RANGE_END, ""), "getPlainText"), getPlainTextFormBody = /* @__PURE__ */ __name((body) => {
353
- let str = body.dataStream;
354
- return body.dataStream.endsWith(`\r
355
- `) && (str = body.dataStream.slice(0, -2)), getPlainText(str);
356
- }, "getPlainTextFormBody"), getPlainTextFormDocument = /* @__PURE__ */ __name((data) => data.body ? getPlainTextFormBody(data.body) : "", "getPlainTextFormDocument"), tags = [
357
- DataStreamTreeTokenType.PARAGRAPH,
358
- // 段落
359
- DataStreamTreeTokenType.SECTION_BREAK,
360
- // 章节
361
- DataStreamTreeTokenType.TABLE_START,
362
- // 表格开始
363
- DataStreamTreeTokenType.TABLE_ROW_START,
364
- // 表格开始
365
- DataStreamTreeTokenType.TABLE_CELL_START,
366
- // 表格开始
367
- DataStreamTreeTokenType.TABLE_CELL_END,
368
- // 表格开始
369
- DataStreamTreeTokenType.TABLE_ROW_END,
370
- // 表格开始
371
- DataStreamTreeTokenType.TABLE_END,
372
- // 表格结束
373
- DataStreamTreeTokenType.CUSTOM_RANGE_START,
374
- // 自定义范围开始
375
- DataStreamTreeTokenType.CUSTOM_RANGE_END,
376
- // 自定义范围结束
377
- DataStreamTreeTokenType.COLUMN_BREAK,
378
- // 换列
379
- DataStreamTreeTokenType.PAGE_BREAK,
380
- // 换页
381
- DataStreamTreeTokenType.DOCS_END,
382
- // 文档结尾
383
- DataStreamTreeTokenType.TAB,
384
- // 制表符
385
- DataStreamTreeTokenType.CUSTOM_BLOCK
386
- // 图片 mention 等不参与文档流的场景
387
- ];
388
- function getSelectionText(dataStream, start, end) {
389
- const text = dataStream.slice(start, end);
390
- return tags.reduce((res, curr) => res.replaceAll(curr, ""), text);
391
- }
392
- __name(getSelectionText, "getSelectionText");
393
352
  function replaceSelectionFactory(accessor, params) {
394
353
  var _a28, _b, _c, _d;
395
354
  const { unitId, body: insertBody, doc } = params;
@@ -2311,7 +2270,7 @@ let DocClipboardService = (_a2 = class extends Disposable {
2311
2270
  const partDocData = this._genDocDataFromHtmlAndText(html, text);
2312
2271
  if (((_a28 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_DOC)) == null ? void 0 : _a28.getUnitId()) === DOCS_NORMAL_EDITOR_UNIT_ID_KEY)
2313
2272
  if (text) {
2314
- const textDocData = this._generateBody(text);
2273
+ const textDocData = BuildTextUtils.transform.fromPlainText(text);
2315
2274
  return this._paste({ body: textDocData });
2316
2275
  } else
2317
2276
  partDocData.body.textRuns = [];
@@ -2460,38 +2419,10 @@ let DocClipboardService = (_a2 = class extends Disposable {
2460
2419
  return Promise.reject(e);
2461
2420
  }
2462
2421
  }
2463
- _generateBody(text) {
2464
- const dataStream = text.replace(/\n/g, "\r").replaceAll(DataStreamTreeTokenType.CUSTOM_RANGE_START, "").replaceAll(DataStreamTreeTokenType.CUSTOM_RANGE_END, ""), paragraphs = [], customRanges = [];
2465
- let cursor = 0, newDataStream = "", linkCount = 0;
2466
- const loopParagraph = /* @__PURE__ */ __name((i, insertP = !0) => {
2467
- const paragraphText = dataStream.slice(cursor, i);
2468
- if (Tools.isLegalUrl(paragraphText)) {
2469
- const id = generateRandomId(), urlText = `${DataStreamTreeTokenType.CUSTOM_RANGE_START}${paragraphText}${DataStreamTreeTokenType.CUSTOM_RANGE_END}`, range = {
2470
- startIndex: cursor + linkCount * 2,
2471
- endIndex: cursor + linkCount * 2 + urlText.length - 1,
2472
- rangeId: id,
2473
- rangeType: CustomRangeType.HYPERLINK,
2474
- properties: {
2475
- url: text
2476
- }
2477
- };
2478
- customRanges.push(range), newDataStream += urlText, cursor = i + 1, linkCount++, insertP && (newDataStream += "\r", paragraphs.push({ startIndex: i + linkCount * 2 }));
2479
- } else
2480
- newDataStream += dataStream.slice(cursor, i + 1), cursor = i + 1, insertP && paragraphs.push({ startIndex: i + linkCount * 2 });
2481
- }, "loopParagraph");
2482
- let end = 0;
2483
- for (let i = 0; i < dataStream.length; i++)
2484
- dataStream[i] === "\r" && (loopParagraph(i), end = i);
2485
- return end !== dataStream.length - 1 && loopParagraph(dataStream.length, !1), {
2486
- dataStream: newDataStream,
2487
- paragraphs,
2488
- customRanges
2489
- };
2490
- }
2491
2422
  _genDocDataFromHtmlAndText(html, text) {
2492
2423
  if (!html) {
2493
2424
  if (text)
2494
- return { body: this._generateBody(text) };
2425
+ return { body: BuildTextUtils.transform.fromPlainText(text) };
2495
2426
  throw new Error("[DocClipboardService] html and text cannot be both empty!");
2496
2427
  }
2497
2428
  const copyId = extractId(html);
@@ -5103,7 +5034,6 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5103
5034
  __publicField(this, "_currentSegmentId", "");
5104
5035
  __publicField(this, "_currentSegmentPage", -1);
5105
5036
  __publicField(this, "_selectionStyle", NORMAL_TEXT_SELECTION_PLUGIN_STYLE);
5106
- __publicField(this, "_isSelectionEnabled", !0);
5107
5037
  __publicField(this, "_viewPortObserverMap", /* @__PURE__ */ new Map());
5108
5038
  __publicField(this, "_isIMEInputApply", !1);
5109
5039
  __publicField(this, "_scenePointerMoveSubs", []);
@@ -5126,18 +5056,9 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5126
5056
  getSegmentPage() {
5127
5057
  return this._currentSegmentPage;
5128
5058
  }
5129
- setStyle(style = NORMAL_TEXT_SELECTION_PLUGIN_STYLE) {
5059
+ _setRangeStyle(style = NORMAL_TEXT_SELECTION_PLUGIN_STYLE) {
5130
5060
  this._selectionStyle = style;
5131
5061
  }
5132
- resetStyle() {
5133
- this.setStyle();
5134
- }
5135
- enableSelection() {
5136
- this._isSelectionEnabled = !0;
5137
- }
5138
- disableSelection() {
5139
- this._isSelectionEnabled = !1;
5140
- }
5141
5062
  addDocRanges(ranges, isEditing = !0, options) {
5142
5063
  const {
5143
5064
  _currentSegmentId: segmentId,
@@ -5246,9 +5167,7 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5246
5167
  this._container.style.left = "0px", this._container.style.top = "0px";
5247
5168
  }
5248
5169
  // Handler double click.
5249
- handleDblClick(evt) {
5250
- if (!this._isSelectionEnabled)
5251
- return;
5170
+ __handleDblClick(evt) {
5252
5171
  const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt, startNode = this._findNodeByCoord(evtOffsetX, evtOffsetY, {
5253
5172
  strict: !1,
5254
5173
  segmentId: this._currentSegmentId,
@@ -5280,9 +5199,7 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5280
5199
  this.addDocRanges(textRanges, !1, { forceFocus: !0 });
5281
5200
  }
5282
5201
  }
5283
- handleTripleClick(evt) {
5284
- if (!this._isSelectionEnabled)
5285
- return;
5202
+ __handleTripleClick(evt) {
5286
5203
  const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt, startNode = this._findNodeByCoord(evtOffsetX, evtOffsetY, {
5287
5204
  strict: !1,
5288
5205
  segmentId: this._currentSegmentId,
@@ -5304,10 +5221,8 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5304
5221
  }
5305
5222
  // Handle pointer down.
5306
5223
  // eslint-disable-next-line max-lines-per-function, complexity
5307
- onPointDown(evt) {
5224
+ __onPointDown(evt) {
5308
5225
  var _a28, _b;
5309
- if (!this._isSelectionEnabled)
5310
- return;
5311
5226
  this._editorFocusing = !0;
5312
5227
  const { scene, mainComponent } = this._context, skeleton = this._docSkeletonManagerService.getSkeleton(), { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt, startNode = this._findNodeByCoord(evtOffsetX, evtOffsetY, {
5313
5228
  strict: !1,
@@ -5332,7 +5247,9 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5332
5247
  let preMoveOffsetX = evtOffsetX, preMoveOffsetY = evtOffsetY;
5333
5248
  this._scenePointerMoveSubs.push(scene.onPointerMove$.subscribeEvent((moveEvt) => {
5334
5249
  const { offsetX: moveOffsetX, offsetY: moveOffsetY } = moveEvt;
5335
- scene.setCursor(CURSOR_TYPE.TEXT), !(Math.sqrt((moveOffsetX - preMoveOffsetX) ** 2 + (moveOffsetY - preMoveOffsetY) ** 2) < 3) && (this._moving(moveOffsetX, moveOffsetY), preMoveOffsetX = moveOffsetX, preMoveOffsetY = moveOffsetY);
5250
+ scene.setCursor(CURSOR_TYPE.TEXT), !(Math.sqrt((moveOffsetX - preMoveOffsetX) ** 2 + (moveOffsetY - preMoveOffsetY) ** 2) < 3) && (this._moving(moveOffsetX, moveOffsetY), scrollTimer.scrolling(moveOffsetX, moveOffsetY, () => {
5251
+ this._moving(moveOffsetX, moveOffsetY);
5252
+ }), preMoveOffsetX = moveOffsetX, preMoveOffsetY = moveOffsetY);
5336
5253
  })), this._scenePointerUpSubs.push(scene.onPointerUp$.subscribeEvent(() => {
5337
5254
  if ([...this._scenePointerMoveSubs, ...this._scenePointerUpSubs].forEach((e) => {
5338
5255
  e.unsubscribe();
@@ -5371,7 +5288,7 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5371
5288
  strokeActive: "rgba(0, 0, 0, 1)",
5372
5289
  fill: `rgba(${r}, ${g}, ${b}, ${a != null ? a : 0.3})`
5373
5290
  };
5374
- this.setStyle(style);
5291
+ this._setRangeStyle(style);
5375
5292
  }
5376
5293
  _getAllTextRanges() {
5377
5294
  return this._rangeList.map(serializeTextRange);
@@ -5578,12 +5495,12 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5578
5495
  const { textRanges, rectRanges } = ranges;
5579
5496
  this._rangeList.length > 0 && textRanges.length > 0 && this._interactTextRanges(textRanges), this._rectRangeList.length > 0 && rectRanges.length > 0 && this._interactRectRanges(rectRanges), this._addTextRangesToCache(textRanges), this._addRectRangesToCache(rectRanges), this.deactivate(), (_b = (_a28 = this._context.scene) == null ? void 0 : _a28.getEngine()) == null || _b.setRemainCapture();
5580
5497
  }
5581
- // TODO: @Jocs make this method as private.
5582
- attachScrollEvent(viewport) {
5583
- if (viewport == null)
5498
+ __attachScrollEvent() {
5499
+ const viewport = this.activeViewPort;
5500
+ if (!viewport)
5584
5501
  return;
5585
- const { unitId } = this._context, key = `${unitId}_${viewport.viewportKey}`;
5586
- if (this._viewPortObserverMap.has(key))
5502
+ const { unitId } = this._context;
5503
+ if (this._viewPortObserverMap.has(unitId))
5587
5504
  return;
5588
5505
  const scrollBefore = viewport.onScrollAfter$.subscribeEvent((param) => {
5589
5506
  if (!param.viewport)
@@ -5606,7 +5523,7 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5606
5523
  this._updateInputPosition();
5607
5524
  }
5608
5525
  });
5609
- this._viewPortObserverMap.set(key, {
5526
+ this._viewPortObserverMap.set(unitId, {
5610
5527
  scrollBefore,
5611
5528
  scrollStop
5612
5529
  });
@@ -5622,11 +5539,13 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5622
5539
  })
5623
5540
  ), this.disposeWithMe(
5624
5541
  fromEvent(this._input, "input").subscribe((e) => {
5625
- if (this._rectRangeList.length > 0)
5626
- return e.stopPropagation(), e.preventDefault();
5627
- this._isIMEInputApply || this._eventHandle(e, (config) => {
5628
- this._onInputBefore$.next(config), this._onInput$.next(config);
5629
- });
5542
+ if (!(e.inputType === "historyUndo" || e.inputType === "historyRedo")) {
5543
+ if (this._rectRangeList.length > 0)
5544
+ return e.stopPropagation(), e.preventDefault();
5545
+ this._isIMEInputApply || this._eventHandle(e, (config) => {
5546
+ this._onInputBefore$.next(config), this._onInput$.next(config);
5547
+ });
5548
+ }
5630
5549
  })
5631
5550
  ), this.disposeWithMe(
5632
5551
  fromEvent(this._input, "compositionstart").subscribe((e) => {
@@ -5711,7 +5630,7 @@ let DocSelectionRenderService = (_a3 = class extends RxDisposable {
5711
5630
  );
5712
5631
  }
5713
5632
  _detachEvent() {
5714
- this._onInputBefore$.complete(), this._onKeydown$.complete(), this._onInput$.complete(), this._onCompositionstart$.complete(), this._onCompositionupdate$.complete(), this._onCompositionend$.complete(), this._onSelectionStart$.complete();
5633
+ this._onInputBefore$.complete(), this._onKeydown$.complete(), this._onInput$.complete(), this._onCompositionstart$.complete(), this._onCompositionupdate$.complete(), this._onCompositionend$.complete(), this._onSelectionStart$.complete(), this._textSelectionInner$.complete(), this._onPaste$.complete(), this._onFocus$.complete(), this._onBlur$.complete(), this._onPointerDown$.complete();
5715
5634
  }
5716
5635
  }, __name(_a3, "DocSelectionRenderService"), _a3);
5717
5636
  DocSelectionRenderService = __decorateClass$o([
@@ -7899,31 +7818,29 @@ var __defProp$k = Object.defineProperty, __getOwnPropDesc$k = Object.getOwnPrope
7899
7818
  const ANCHOR_WIDTH = 1.5;
7900
7819
  var _a7;
7901
7820
  let DocBackScrollRenderController = (_a7 = class extends RxDisposable {
7902
- constructor(_context, _textSelectionManagerService, _editorService, _univerInstanceService, _renderManagerService) {
7903
- super(), this._context = _context, this._textSelectionManagerService = _textSelectionManagerService, this._editorService = _editorService, this._univerInstanceService = _univerInstanceService, this._renderManagerService = _renderManagerService, this._init();
7821
+ constructor(_context, _textSelectionManagerService, _editorService, _docSkeletonManagerService) {
7822
+ super(), this._context = _context, this._textSelectionManagerService = _textSelectionManagerService, this._editorService = _editorService, this._docSkeletonManagerService = _docSkeletonManagerService, this._init();
7904
7823
  }
7905
7824
  _init() {
7906
7825
  this._textSelectionManagerService.textSelection$.pipe(takeUntil(this.dispose$)).subscribe((params) => {
7907
7826
  if (params == null)
7908
7827
  return;
7909
7828
  const { isEditing, unitId } = params;
7910
- isEditing && this._scrollToSelection(unitId);
7829
+ unitId !== this._context.unitId || !isEditing || this._scrollToSelection();
7911
7830
  });
7912
7831
  }
7913
- scrollToRange(unitId, range) {
7914
- var _a28;
7915
- const docSkeletonManagerService = (_a28 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a28.with(DocSkeletonManagerService), skeleton = docSkeletonManagerService == null ? void 0 : docSkeletonManagerService.getSkeleton();
7832
+ scrollToRange(range) {
7833
+ const skeleton = this._docSkeletonManagerService.getSkeleton();
7916
7834
  if (!skeleton)
7917
7835
  return;
7918
7836
  const { startOffset } = range, anchorNodePosition = skeleton.findNodePositionByCharIndex(startOffset);
7919
- this.scrollToNode(unitId, anchorNodePosition);
7837
+ this.scrollToNode(anchorNodePosition);
7920
7838
  }
7921
- scrollToNode(unitId, startNodePosition) {
7922
- var _a28;
7923
- const docObject = this._getDocObject(), docSkeletonManagerService = (_a28 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a28.with(DocSkeletonManagerService), skeleton = docSkeletonManagerService == null ? void 0 : docSkeletonManagerService.getSkeleton();
7924
- if (docObject == null || skeleton == null)
7839
+ scrollToNode(startNodePosition) {
7840
+ const { unitId, scene, mainComponent } = this._context, skeleton = this._docSkeletonManagerService.getSkeleton();
7841
+ if (mainComponent == null || skeleton == null)
7925
7842
  return;
7926
- const documentOffsetConfig = docObject.document.getOffsetConfig(), { docsLeft, docsTop } = documentOffsetConfig, convertor = new NodePositionConvertToCursor(documentOffsetConfig, skeleton), { contentBoxPointGroup } = convertor.getRangePointData(startNodePosition, startNodePosition), { left: aLeft, top: aTop, height } = getAnchorBounding(contentBoxPointGroup), left = aLeft + docsLeft, top = aTop + docsTop, viewportMain = docObject.scene.getViewport(VIEWPORT_KEY.VIEW_MAIN), isEditor = !!this._editorService.getEditor(unitId);
7843
+ const documentOffsetConfig = mainComponent.getOffsetConfig(), { docsLeft, docsTop } = documentOffsetConfig, convertor = new NodePositionConvertToCursor(documentOffsetConfig, skeleton), { contentBoxPointGroup } = convertor.getRangePointData(startNodePosition, startNodePosition), { left: aLeft, top: aTop, height } = getAnchorBounding(contentBoxPointGroup), left = aLeft + docsLeft, top = aTop + docsTop, viewportMain = scene.getViewport(VIEWPORT_KEY.VIEW_MAIN), isEditor = !!this._editorService.getEditor(unitId);
7927
7844
  if (viewportMain == null)
7928
7845
  return;
7929
7846
  const {
@@ -7939,22 +7856,18 @@ let DocBackScrollRenderController = (_a7 = class extends RxDisposable {
7939
7856
  viewportMain.scrollByBarDeltaValue(config);
7940
7857
  }
7941
7858
  // Let the selection show on the current screen.
7942
- _scrollToSelection(unitId) {
7859
+ _scrollToSelection() {
7943
7860
  const activeTextRange = this._textSelectionManagerService.getActiveTextRange();
7944
7861
  if (activeTextRange == null)
7945
7862
  return;
7946
7863
  const { collapsed, startNodePosition } = activeTextRange;
7947
- collapsed && this.scrollToNode(unitId, startNodePosition);
7948
- }
7949
- _getDocObject() {
7950
- return getDocObject(this._univerInstanceService, this._renderManagerService);
7864
+ collapsed && this.scrollToNode(startNodePosition);
7951
7865
  }
7952
7866
  }, __name(_a7, "DocBackScrollRenderController"), _a7);
7953
7867
  DocBackScrollRenderController = __decorateClass$k([
7954
7868
  __decorateParam$k(1, Inject(DocSelectionManagerService)),
7955
7869
  __decorateParam$k(2, IEditorService),
7956
- __decorateParam$k(3, Inject(IUniverInstanceService)),
7957
- __decorateParam$k(4, IRenderManagerService)
7870
+ __decorateParam$k(3, Inject(DocSkeletonManagerService))
7958
7871
  ], DocBackScrollRenderController);
7959
7872
  var __defProp$j = Object.defineProperty, __getOwnPropDesc$j = Object.getOwnPropertyDescriptor, __decorateClass$j = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7960
7873
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
@@ -7962,8 +7875,8 @@ var __defProp$j = Object.defineProperty, __getOwnPropDesc$j = Object.getOwnPrope
7962
7875
  return kind && result && __defProp$j(target, key, result), result;
7963
7876
  }, "__decorateClass$j"), __decorateParam$j = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$j"), _a8;
7964
7877
  let DocRenderController = (_a8 = class extends RxDisposable {
7965
- constructor(_context, _contextService, _commandService, _docSkeletonManagerService, _configService, _editorService, _renderManagerService) {
7966
- super(), this._context = _context, this._contextService = _contextService, this._commandService = _commandService, this._docSkeletonManagerService = _docSkeletonManagerService, this._configService = _configService, this._editorService = _editorService, this._renderManagerService = _renderManagerService, this._addNewRender(), this._initRenderRefresh(), this._initCommandListener();
7878
+ constructor(_context, _contextService, _commandService, _docSelectionRenderService, _docSkeletonManagerService, _editorService, _renderManagerService) {
7879
+ super(), this._context = _context, this._contextService = _contextService, this._commandService = _commandService, this._docSelectionRenderService = _docSelectionRenderService, this._docSkeletonManagerService = _docSkeletonManagerService, this._editorService = _editorService, this._renderManagerService = _renderManagerService, this._addNewRender(), this._initRenderRefresh(), this._initCommandListener();
7967
7880
  }
7968
7881
  reRender(unitId) {
7969
7882
  var _a28, _b;
@@ -7977,7 +7890,7 @@ let DocRenderController = (_a8 = class extends RxDisposable {
7977
7890
  }
7978
7891
  }
7979
7892
  _addNewRender() {
7980
- const { scene, engine, unit } = this._context, viewMain = new Viewport(VIEWPORT_KEY.VIEW_MAIN, scene, {
7893
+ const { scene, engine } = this._context, viewMain = new Viewport(VIEWPORT_KEY.VIEW_MAIN, scene, {
7981
7894
  left: 0,
7982
7895
  top: 0,
7983
7896
  bottom: 0,
@@ -8001,7 +7914,7 @@ let DocRenderController = (_a8 = class extends RxDisposable {
8001
7914
  new Layer(scene, [], DOCS_COMPONENT_HEADER_LAYER_INDEX)
8002
7915
  ), this._addComponent(), engine.runRenderLoop(() => {
8003
7916
  scene.render();
8004
- });
7917
+ }), this._docSelectionRenderService.__attachScrollEvent();
8005
7918
  }
8006
7919
  _addComponent() {
8007
7920
  const { scene, unit: documentModel, components } = this._context, config = {
@@ -8048,8 +7961,8 @@ let DocRenderController = (_a8 = class extends RxDisposable {
8048
7961
  DocRenderController = __decorateClass$j([
8049
7962
  __decorateParam$j(1, IContextService),
8050
7963
  __decorateParam$j(2, ICommandService),
8051
- __decorateParam$j(3, Inject(DocSkeletonManagerService)),
8052
- __decorateParam$j(4, IConfigService),
7964
+ __decorateParam$j(3, Inject(DocSelectionRenderService)),
7965
+ __decorateParam$j(4, Inject(DocSkeletonManagerService)),
8053
7966
  __decorateParam$j(5, IEditorService),
8054
7967
  __decorateParam$j(6, IRenderManagerService)
8055
7968
  ], DocRenderController);
@@ -8404,7 +8317,7 @@ let DocMoveCursorController = (_a12 = class extends Disposable {
8404
8317
  endOffset: focusOffset,
8405
8318
  style
8406
8319
  }
8407
- ], !1);
8320
+ ], !1), this._scrollToFocusNodePosition(docDataModel.getUnitId(), focusOffset);
8408
8321
  } else {
8409
8322
  const focusGlyph = skeleton.findNodeByCharIndex(focusOffset, segmentId, segmentPage), documentOffsetConfig = docObject.document.getOffsetConfig(), focusNodePosition = collapsed ? startNodePosition : rangeDirection === RANGE_DIRECTION.FORWARD ? endNodePosition : startNodePosition, newPos = this._getTopOrBottomPosition(skeleton, focusGlyph, focusNodePosition, direction === Direction.DOWN, !0);
8410
8323
  if (newPos == null) {
@@ -8430,7 +8343,7 @@ let DocMoveCursorController = (_a12 = class extends Disposable {
8430
8343
  endOffset: newActiveRange.endOffset,
8431
8344
  style
8432
8345
  }
8433
- ], !1);
8346
+ ], !1), this._scrollToFocusNodePosition(docDataModel.getUnitId(), newActiveRange.endOffset);
8434
8347
  }
8435
8348
  }
8436
8349
  // eslint-disable-next-line max-lines-per-function, complexity
@@ -8482,7 +8395,7 @@ let DocMoveCursorController = (_a12 = class extends Disposable {
8482
8395
  endOffset: cursor,
8483
8396
  style
8484
8397
  }
8485
- ], !1);
8398
+ ], !1), this._scrollToFocusNodePosition(docDataModel.getUnitId(), cursor);
8486
8399
  } else {
8487
8400
  const startNode = skeleton.findNodeByCharIndex(startOffset, segmentId, segmentPage), endNode = skeleton.findNodeByCharIndex(endOffset, segmentId, segmentPage), documentOffsetConfig = docObject.document.getOffsetConfig(), newPos = this._getTopOrBottomPosition(
8488
8401
  skeleton,
@@ -8510,7 +8423,7 @@ let DocMoveCursorController = (_a12 = class extends Disposable {
8510
8423
  ...newActiveRange,
8511
8424
  style
8512
8425
  }
8513
- ], !1);
8426
+ ], !1), this._scrollToFocusNodePosition(docDataModel.getUnitId(), newActiveRange.endOffset);
8514
8427
  }
8515
8428
  }
8516
8429
  _getTopOrBottomPosition(docSkeleton, glyph, nodePosition, direction, skipCellContent = !1) {
@@ -8622,6 +8535,15 @@ let DocMoveCursorController = (_a12 = class extends Disposable {
8622
8535
  return newLine;
8623
8536
  }
8624
8537
  }
8538
+ _scrollToFocusNodePosition(unitId, offset) {
8539
+ var _a28;
8540
+ const backScrollController = (_a28 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a28.with(DocBackScrollRenderController);
8541
+ backScrollController != null && backScrollController.scrollToRange({
8542
+ startOffset: offset,
8543
+ endOffset: offset,
8544
+ collapsed: !0
8545
+ });
8546
+ }
8625
8547
  _getDocObject() {
8626
8548
  return getDocObject(this._univerInstanceService, this._renderManagerService);
8627
8549
  }
@@ -9065,23 +8987,46 @@ let DocEventManagerService = (_a15 = class extends Disposable {
9065
8987
  );
9066
8988
  }
9067
8989
  _buildBulletBoundsBySegment(segmentId, segmentPage = -1) {
9068
- var _a28, _b;
9069
- const body = (_a28 = this._context.unit.getSelfOrHeaderFooterModel(segmentId)) == null ? void 0 : _a28.getBody(), paragraphs = (_b = body == null ? void 0 : body.paragraphs) != null ? _b : [], bounds = [];
9070
- return paragraphs.forEach((paragraph) => {
9071
- paragraph.bullet && paragraph.bullet.listType.indexOf("CHECK_LIST") === 0 && (/* @__PURE__ */ __name((pageIndex) => {
9072
- var _a29, _b2, _c;
9073
- const node = this._skeleton.findNodeByCharIndex(paragraph.startIndex, segmentId, pageIndex), divide = node == null ? void 0 : node.parent, line = divide == null ? void 0 : divide.parent, column = line == null ? void 0 : line.parent, targetLine = column == null ? void 0 : column.lines.find((l2) => l2.paragraphStart && l2.paragraphIndex === paragraph.startIndex), bulletNode = (_c = (_b2 = (_a29 = targetLine == null ? void 0 : targetLine.divides) == null ? void 0 : _a29[0]) == null ? void 0 : _b2.glyphGroup) == null ? void 0 : _c[0];
9074
- if (!bulletNode || !bulletNode)
9075
- return;
9076
- const rect = calcDocGlyphPosition(bulletNode, this._documents, this._skeleton, pageIndex);
9077
- rect && bounds.push({
9078
- rect,
9079
- segmentId,
9080
- segmentPageIndex: pageIndex,
9081
- paragraph
9082
- });
9083
- }, "calcRect"))(segmentPage);
9084
- }), bounds;
8990
+ var _a28, _b, _c, _d, _e;
8991
+ const body = (_a28 = this._context.unit.getSelfOrHeaderFooterModel(segmentId)) == null ? void 0 : _a28.getBody(), paragraphs = ((_b = body == null ? void 0 : body.paragraphs) != null ? _b : []).filter((p2) => p2.bullet && p2.bullet.listType.indexOf("CHECK_LIST") === 0), bounds = [], skeletonData = this._skeleton.getSkeletonData();
8992
+ if (!skeletonData)
8993
+ return bounds;
8994
+ const calc = /* @__PURE__ */ __name((pages) => {
8995
+ var _a29, _b2, _c2;
8996
+ for (const page of pages) {
8997
+ const sections = [...page.sections];
8998
+ if (page.skeTables) {
8999
+ const tables = Array.from(page.skeTables.values());
9000
+ sections.push(...tables.map((i) => i.rows.map((i2) => i2.cells.map((i3) => i3.sections))).flat(4));
9001
+ }
9002
+ for (const selection of sections)
9003
+ for (const column of selection.columns)
9004
+ for (const line of column.lines)
9005
+ if (line.paragraphStart) {
9006
+ const paragraph = paragraphs.find((p2) => p2.startIndex === line.paragraphIndex);
9007
+ if (paragraph) {
9008
+ const targetLine = line, bulletNode = (_c2 = (_b2 = (_a29 = targetLine == null ? void 0 : targetLine.divides) == null ? void 0 : _a29[0]) == null ? void 0 : _b2.glyphGroup) == null ? void 0 : _c2[0];
9009
+ if (!bulletNode)
9010
+ continue;
9011
+ const rect = calcDocGlyphPosition(bulletNode, this._documents, this._skeleton, segmentPage);
9012
+ if (!rect)
9013
+ continue;
9014
+ bounds.push({
9015
+ rect,
9016
+ segmentId,
9017
+ segmentPageIndex: segmentPage,
9018
+ paragraph
9019
+ });
9020
+ }
9021
+ }
9022
+ }
9023
+ return bounds;
9024
+ }, "calc");
9025
+ if (segmentId) {
9026
+ const page = (_e = (_c = skeletonData.skeFooters.get(segmentId)) == null ? void 0 : _c.values()) != null ? _e : (_d = skeletonData.skeHeaders.get(segmentId)) == null ? void 0 : _d.values();
9027
+ return page ? calc(Array.from(page)) : bounds;
9028
+ }
9029
+ return calc(skeletonData.pages);
9085
9030
  }
9086
9031
  _buildBulletBounds() {
9087
9032
  var _a28;
@@ -9509,7 +9454,7 @@ var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPrope
9509
9454
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
9510
9455
  return kind && result && __defProp$4(target, key, result), result;
9511
9456
  }, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$4"), _a23;
9512
- let DocTextSelectionRenderController = (_a23 = class extends Disposable {
9457
+ let DocSelectionRenderController = (_a23 = class extends Disposable {
9513
9458
  constructor(_context, _commandService, _editorService, _instanceSrv, _docSelectionRenderService, _docSkeletonManagerService, _docSelectionManagerService) {
9514
9459
  super();
9515
9460
  __publicField(this, "_loadedMap", /* @__PURE__ */ new WeakSet());
@@ -9535,7 +9480,7 @@ let DocTextSelectionRenderController = (_a23 = class extends Disposable {
9535
9480
  _syncSelection() {
9536
9481
  this.disposeWithMe(
9537
9482
  this._docSelectionRenderService.textSelectionInner$.subscribe((params) => {
9538
- params != null && this._docSelectionManagerService.replaceTextRangesWithNoRefresh(params);
9483
+ params != null && this._docSelectionManagerService.__replaceTextRangesWithNoRefresh(params);
9539
9484
  })
9540
9485
  );
9541
9486
  }
@@ -9565,18 +9510,18 @@ let DocTextSelectionRenderController = (_a23 = class extends Disposable {
9565
9510
  ), viewModel = this._docSkeletonManagerService.getViewModel(), preEditArea = viewModel.getEditArea();
9566
9511
  preEditArea !== DocumentEditArea.BODY && editArea !== DocumentEditArea.BODY && editArea !== preEditArea && viewModel.setEditArea(editArea);
9567
9512
  }
9568
- if (this._docSelectionRenderService.onPointDown(evt), this._editorService.getEditor(unitId)) {
9513
+ if (this._docSelectionRenderService.__onPointDown(evt), this._editorService.getEditor(unitId)) {
9569
9514
  this._setEditorFocus(unitId);
9570
9515
  const { offsetX: offsetX2, offsetY: offsetY2 } = evt;
9571
9516
  setTimeout(() => {
9572
- this._setEditorFocus(unitId), this._docSelectionRenderService.setCursorManually(offsetX2, offsetY2);
9517
+ unitId !== this._editorService.getFocusId() && (this._setEditorFocus(unitId), this._docSelectionRenderService.setCursorManually(offsetX2, offsetY2));
9573
9518
  }, 0);
9574
9519
  }
9575
9520
  evt.button !== 2 && state.stopPropagation();
9576
9521
  })), this.disposeWithMe(document2.onDblclick$.subscribeEvent((evt) => {
9577
- this._isEditorReadOnly(unitId) || this._docSelectionRenderService.handleDblClick(evt);
9522
+ this._isEditorReadOnly(unitId) || this._docSelectionRenderService.__handleDblClick(evt);
9578
9523
  })), this.disposeWithMe(document2.onTripleClick$.subscribeEvent((evt) => {
9579
- this._isEditorReadOnly(unitId) || this._docSelectionRenderService.handleTripleClick(evt);
9524
+ this._isEditorReadOnly(unitId) || this._docSelectionRenderService.__handleTripleClick(evt);
9580
9525
  }));
9581
9526
  }
9582
9527
  _getTransformCoordForDocumentOffset(evtOffsetX, evtOffsetY) {
@@ -9612,10 +9557,7 @@ let DocTextSelectionRenderController = (_a23 = class extends Disposable {
9612
9557
  this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe((skeleton) => {
9613
9558
  if (!skeleton) return;
9614
9559
  const { unitId } = this._context, isInternalEditor = isInternalEditorID(unitId);
9615
- (init || !isInternalEditorID(this._context.unitId)) && (this._docSelectionRenderService.attachScrollEvent(), this._docSelectionManagerService.setCurrentSelectionNotRefresh({
9616
- unitId,
9617
- subUnitId: unitId
9618
- }), isInternalEditor || this._docSelectionManagerService.replaceTextRanges([
9560
+ (init || !isInternalEditorID(this._context.unitId)) && (isInternalEditor || this._docSelectionManagerService.replaceTextRanges([
9619
9561
  {
9620
9562
  startOffset: 0,
9621
9563
  endOffset: 0
@@ -9623,15 +9565,15 @@ let DocTextSelectionRenderController = (_a23 = class extends Disposable {
9623
9565
  ], !1)), init = !0;
9624
9566
  }));
9625
9567
  }
9626
- }, __name(_a23, "DocTextSelectionRenderController"), _a23);
9627
- DocTextSelectionRenderController = __decorateClass$4([
9568
+ }, __name(_a23, "DocSelectionRenderController"), _a23);
9569
+ DocSelectionRenderController = __decorateClass$4([
9628
9570
  __decorateParam$4(1, ICommandService),
9629
9571
  __decorateParam$4(2, IEditorService),
9630
9572
  __decorateParam$4(3, IUniverInstanceService),
9631
9573
  __decorateParam$4(4, Inject(DocSelectionRenderService)),
9632
9574
  __decorateParam$4(5, Inject(DocSkeletonManagerService)),
9633
9575
  __decorateParam$4(6, Inject(DocSelectionManagerService))
9634
- ], DocTextSelectionRenderController);
9576
+ ], DocSelectionRenderController);
9635
9577
  var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
9636
9578
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
9637
9579
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
@@ -10079,7 +10021,7 @@ let UniverDocsUIPlugin = (_a27 = class extends Plugin {
10079
10021
  [DocEventManagerService],
10080
10022
  // Controllers.
10081
10023
  [DocBackScrollRenderController],
10082
- [DocTextSelectionRenderController],
10024
+ [DocSelectionRenderController],
10083
10025
  [DocHeaderFooterController],
10084
10026
  [DocResizeRenderController],
10085
10027
  [DocContextMenuRenderController],
@@ -10219,11 +10161,7 @@ export {
10219
10161
  getOneTextSelectionRange,
10220
10162
  getParagraphsInRange,
10221
10163
  getParagraphsInRanges,
10222
- getPlainText,
10223
- getPlainTextFormBody,
10224
- getPlainTextFormDocument,
10225
10164
  getRichTextEditPath,
10226
- getSelectionText,
10227
10165
  getTableColumn,
10228
10166
  hasParagraphInTable,
10229
10167
  isInSameTableCell,
@@ -16,5 +16,6 @@ export declare class DocMoveCursorController extends Disposable {
16
16
  private _getGlyphLeftOffsetInLine;
17
17
  private _matchPositionByLeftOffset;
18
18
  private _getNextOrPrevLine;
19
+ private _scrollToFocusNodePosition;
19
20
  private _getDocObject;
20
21
  }
@@ -1,17 +1,15 @@
1
- import { IUniverInstanceService, RxDisposable, DocumentDataModel, ITextRange, Nullable } from '@univerjs/core';
2
- import { DocSelectionManagerService } from '@univerjs/docs';
3
- import { IRenderManagerService, INodePosition, IRenderContext, IRenderModule } from '@univerjs/engine-render';
1
+ import { RxDisposable, DocumentDataModel, ITextRange, Nullable } from '@univerjs/core';
2
+ import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
4
3
  import { IEditorService } from '@univerjs/ui';
4
+ import { INodePosition, IRenderContext, IRenderModule } from '@univerjs/engine-render';
5
5
  export declare class DocBackScrollRenderController extends RxDisposable implements IRenderModule {
6
6
  private readonly _context;
7
7
  private readonly _textSelectionManagerService;
8
8
  private readonly _editorService;
9
- private readonly _univerInstanceService;
10
- private readonly _renderManagerService;
11
- constructor(_context: IRenderContext<DocumentDataModel>, _textSelectionManagerService: DocSelectionManagerService, _editorService: IEditorService, _univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService);
9
+ private readonly _docSkeletonManagerService;
10
+ constructor(_context: IRenderContext<DocumentDataModel>, _textSelectionManagerService: DocSelectionManagerService, _editorService: IEditorService, _docSkeletonManagerService: DocSkeletonManagerService);
12
11
  private _init;
13
- scrollToRange(unitId: string, range: ITextRange): void;
14
- scrollToNode(unitId: string, startNodePosition: Nullable<INodePosition>): void;
12
+ scrollToRange(range: ITextRange): void;
13
+ scrollToNode(startNodePosition: Nullable<INodePosition>): void;
15
14
  private _scrollToSelection;
16
- private _getDocObject;
17
15
  }
@@ -3,7 +3,7 @@ import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs
3
3
  import { IEditorService } from '@univerjs/ui';
4
4
  import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
5
5
  import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
6
- export declare class DocTextSelectionRenderController extends Disposable implements IRenderModule {
6
+ export declare class DocSelectionRenderController extends Disposable implements IRenderModule {
7
7
  private readonly _context;
8
8
  private readonly _commandService;
9
9
  private readonly _editorService;
@@ -1,16 +1,17 @@
1
- import { ICommandService, IConfigService, IContextService, RxDisposable, DocumentDataModel } from '@univerjs/core';
1
+ import { ICommandService, IContextService, RxDisposable, DocumentDataModel } from '@univerjs/core';
2
2
  import { DocSkeletonManagerService } from '@univerjs/docs';
3
3
  import { IRenderManagerService, IRenderContext, IRenderModule } from '@univerjs/engine-render';
4
4
  import { IEditorService } from '@univerjs/ui';
5
+ import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
5
6
  export declare class DocRenderController extends RxDisposable implements IRenderModule {
6
7
  private readonly _context;
7
8
  private readonly _contextService;
8
9
  private readonly _commandService;
10
+ private readonly _docSelectionRenderService;
9
11
  private readonly _docSkeletonManagerService;
10
- private readonly _configService;
11
12
  private readonly _editorService;
12
13
  private readonly _renderManagerService;
13
- constructor(_context: IRenderContext<DocumentDataModel>, _contextService: IContextService, _commandService: ICommandService, _docSkeletonManagerService: DocSkeletonManagerService, _configService: IConfigService, _editorService: IEditorService, _renderManagerService: IRenderManagerService);
14
+ constructor(_context: IRenderContext<DocumentDataModel>, _contextService: IContextService, _commandService: ICommandService, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _editorService: IEditorService, _renderManagerService: IRenderManagerService);
14
15
  reRender(unitId: string): void;
15
16
  private _addNewRender;
16
17
  private _addComponent;
@@ -21,7 +21,6 @@ export { addCustomDecorationBySelectionFactory, addCustomDecorationFactory, dele
21
21
  export { addCustomRangeBySelectionFactory, addCustomRangeFactory, deleteCustomRangeFactory } from './basics/custom-range-factory';
22
22
  export * from './basics/docs-view-key';
23
23
  export { hasParagraphInTable } from './basics/paragraph';
24
- export { getPlainText, getPlainTextFormBody, getPlainTextFormDocument, getSelectionText } from './basics/plain-text';
25
24
  export { replaceSelectionFactory } from './basics/replace';
26
25
  export { docDrawingPositionToTransform, transformToDocDrawingPosition } from './basics/transform-position';
27
26
  export { AfterSpaceCommand, EnterCommand, type ITabCommandParams, TabCommand } from './commands/commands/auto-format.command';
@@ -36,6 +36,5 @@ export declare class DocClipboardService extends Disposable implements IDocClipb
36
36
  addClipboardHook(hook: IDocClipboardHook): IDisposable;
37
37
  private _getDocumentBodyInRanges;
38
38
  private _genDocDataFromClipboardItems;
39
- private _generateBody;
40
39
  private _genDocDataFromHtmlAndText;
41
40
  }