@univerjs/docs-ui 1.0.1 → 1.0.3
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/cjs/index.js +111 -50
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +110 -51
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/index.js +110 -51
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/commands/commands/clipboard.inner.command.d.ts +2 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/locale/en-US.d.ts +1 -0
- package/lib/types/menu/context-menu.d.ts +1 -0
- package/lib/types/services/editor/editor-runtime-config.d.ts +2 -0
- package/lib/types/services/selection/text-range.d.ts +6 -1
- package/lib/umd/index.js +8 -8
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -11
package/lib/index.js
CHANGED
|
@@ -2307,7 +2307,7 @@ function getLineBounding(pointsGroup) {
|
|
|
2307
2307
|
});
|
|
2308
2308
|
}
|
|
2309
2309
|
var TextRange = class {
|
|
2310
|
-
constructor(_scene, _document, _docSkeleton, anchorNodePosition, focusNodePosition, style = NORMAL_TEXT_SELECTION_PLUGIN_STYLE, _segmentId = "", _segmentPage = -1) {
|
|
2310
|
+
constructor(_scene, _document, _docSkeleton, anchorNodePosition, focusNodePosition, style = NORMAL_TEXT_SELECTION_PLUGIN_STYLE, _segmentId = "", _segmentPage = -1, _logicalRange) {
|
|
2311
2311
|
this._scene = _scene;
|
|
2312
2312
|
this._document = _document;
|
|
2313
2313
|
this._docSkeleton = _docSkeleton;
|
|
@@ -2316,6 +2316,7 @@ var TextRange = class {
|
|
|
2316
2316
|
this.style = style;
|
|
2317
2317
|
this._segmentId = _segmentId;
|
|
2318
2318
|
this._segmentPage = _segmentPage;
|
|
2319
|
+
this._logicalRange = _logicalRange;
|
|
2319
2320
|
_defineProperty(this, "rangeType", DOC_RANGE_TYPE.TEXT);
|
|
2320
2321
|
_defineProperty(this, "_current", false);
|
|
2321
2322
|
_defineProperty(this, "_rangeShape", void 0);
|
|
@@ -2345,6 +2346,7 @@ var TextRange = class {
|
|
|
2345
2346
|
}
|
|
2346
2347
|
get startOffset() {
|
|
2347
2348
|
var _this$_docSkeleton$ge;
|
|
2349
|
+
if (this._logicalRange) return Math.min(this._logicalRange.startOffset, this._logicalRange.endOffset);
|
|
2348
2350
|
const { startOffset } = getOneTextSelectionRange(this._cursorList) ?? {};
|
|
2349
2351
|
const body = (_this$_docSkeleton$ge = this._docSkeleton.getViewModel().getDataModel().getSelfOrHeaderFooterModel(this._segmentId)) === null || _this$_docSkeleton$ge === void 0 ? void 0 : _this$_docSkeleton$ge.getBody();
|
|
2350
2352
|
if (startOffset == null || body == null) return startOffset;
|
|
@@ -2353,6 +2355,7 @@ var TextRange = class {
|
|
|
2353
2355
|
}
|
|
2354
2356
|
get endOffset() {
|
|
2355
2357
|
var _this$_docSkeleton$ge2;
|
|
2358
|
+
if (this._logicalRange) return Math.max(this._logicalRange.startOffset, this._logicalRange.endOffset);
|
|
2356
2359
|
const { endOffset } = getOneTextSelectionRange(this._cursorList) ?? {};
|
|
2357
2360
|
const body = (_this$_docSkeleton$ge2 = this._docSkeleton.getViewModel().getDataModel().getSelfOrHeaderFooterModel(this._segmentId)) === null || _this$_docSkeleton$ge2 === void 0 ? void 0 : _this$_docSkeleton$ge2.getBody();
|
|
2358
2361
|
if (endOffset == null || body == null) return endOffset;
|
|
@@ -2376,6 +2379,7 @@ var TextRange = class {
|
|
|
2376
2379
|
return end;
|
|
2377
2380
|
}
|
|
2378
2381
|
get direction() {
|
|
2382
|
+
if (this._logicalRange) return this._logicalRange.startOffset <= this._logicalRange.endOffset ? RANGE_DIRECTION.FORWARD : RANGE_DIRECTION.BACKWARD;
|
|
2379
2383
|
const { collapsed, anchorNodePosition, focusNodePosition } = this;
|
|
2380
2384
|
if (collapsed || anchorNodePosition == null || focusNodePosition == null) return RANGE_DIRECTION.NONE;
|
|
2381
2385
|
return compareNodePositionLogic(anchorNodePosition, focusNodePosition) ? RANGE_DIRECTION.FORWARD : RANGE_DIRECTION.BACKWARD;
|
|
@@ -2462,6 +2466,7 @@ var TextRange = class {
|
|
|
2462
2466
|
}
|
|
2463
2467
|
refresh() {
|
|
2464
2468
|
var _this$_anchorShape6, _this$_rangeShape2;
|
|
2469
|
+
this._refreshLogicalRangePositions();
|
|
2465
2470
|
const { _document, _docSkeleton } = this;
|
|
2466
2471
|
const anchor = this.anchorNodePosition;
|
|
2467
2472
|
const focus = this.focusNodePosition;
|
|
@@ -2484,6 +2489,26 @@ var TextRange = class {
|
|
|
2484
2489
|
this._setCursorList(cursorList);
|
|
2485
2490
|
if (borderBoxPointGroup.length > 0) this._createOrUpdateRange(borderBoxPointGroup, docsLeft, docsTop);
|
|
2486
2491
|
}
|
|
2492
|
+
_refreshLogicalRangePositions() {
|
|
2493
|
+
var _this$_docSkeleton$ge3;
|
|
2494
|
+
const range = this._logicalRange;
|
|
2495
|
+
if (!range) return;
|
|
2496
|
+
const start = Math.min(range.startOffset, range.endOffset);
|
|
2497
|
+
const end = Math.max(range.startOffset, range.endOffset);
|
|
2498
|
+
let first;
|
|
2499
|
+
let last;
|
|
2500
|
+
for (const page of ((_this$_docSkeleton$ge3 = this._docSkeleton.getSkeletonData()) === null || _this$_docSkeleton$ge3 === void 0 ? void 0 : _this$_docSkeleton$ge3.pages) ?? []) {
|
|
2501
|
+
if (page.isLayoutPlaceholder || page.isMaterializationPlaceholder || page.ed < start || page.st >= end) continue;
|
|
2502
|
+
const positions = findDocRangeNodePositions(this._docSkeleton, Math.max(start, page.st), Math.min(end - 1, page.ed), this._segmentId, this._segmentPage);
|
|
2503
|
+
if (positions) {
|
|
2504
|
+
first ??= positions.startPosition;
|
|
2505
|
+
last = positions.endPosition;
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
const forward = range.startOffset <= range.endOffset;
|
|
2509
|
+
this.anchorNodePosition = forward ? first : last;
|
|
2510
|
+
this.focusNodePosition = forward ? last : first;
|
|
2511
|
+
}
|
|
2487
2512
|
_isEmpty() {
|
|
2488
2513
|
return this.anchorNodePosition == null && this.focusNodePosition == null;
|
|
2489
2514
|
}
|
|
@@ -2798,7 +2823,17 @@ function getColumnInputBoundaryCollapsedPosition(anchorPosition, focusPosition,
|
|
|
2798
2823
|
function getTextRangeFromCharIndex(startOffset, endOffset, scene, document, skeleton, style, segmentId, segmentPage, startIsBack = true, endIsBack = true) {
|
|
2799
2824
|
const startNodePosition = skeleton.findNodePositionByCharIndex(startOffset, startIsBack, segmentId, segmentPage);
|
|
2800
2825
|
const endNodePosition = skeleton.findNodePositionByCharIndex(endOffset, endIsBack, segmentId, segmentPage);
|
|
2801
|
-
if (startNodePosition == null || endNodePosition == null)
|
|
2826
|
+
if (startNodePosition == null || endNodePosition == null) {
|
|
2827
|
+
var _skeleton$getSkeleton;
|
|
2828
|
+
const pages = (_skeleton$getSkeleton = skeleton.getSkeletonData()) === null || _skeleton$getSkeleton === void 0 ? void 0 : _skeleton$getSkeleton.pages;
|
|
2829
|
+
const startPage = pages === null || pages === void 0 ? void 0 : pages[skeleton.findBodyPageIndexByCharIndex(startOffset)];
|
|
2830
|
+
const endPage = pages === null || pages === void 0 ? void 0 : pages[skeleton.findBodyPageIndexByCharIndex(endOffset)];
|
|
2831
|
+
if (segmentId === "" && startOffset !== endOffset && startPage && endPage && (startPage.isMaterializationPlaceholder || endPage.isMaterializationPlaceholder)) return new TextRange(scene, document, skeleton, void 0, void 0, style, segmentId, segmentPage, {
|
|
2832
|
+
startOffset: startIsBack ? startOffset : startOffset + 1,
|
|
2833
|
+
endOffset: endIsBack ? endOffset : endOffset + 1
|
|
2834
|
+
});
|
|
2835
|
+
return;
|
|
2836
|
+
}
|
|
2802
2837
|
return new TextRange(scene, document, skeleton, startNodePosition, endNodePosition, style, segmentId, segmentPage);
|
|
2803
2838
|
}
|
|
2804
2839
|
function getRectRangeFromCharIndex(startOffset, endOffset, scene, document, skeleton, style, segmentId, segmentPage) {
|
|
@@ -2810,7 +2845,14 @@ function getRectRangeFromCharIndex(startOffset, endOffset, scene, document, skel
|
|
|
2810
2845
|
function getRangeListFromCharIndex(startOffset, endOffset, scene, document, skeleton, style, segmentId, segmentPage) {
|
|
2811
2846
|
const startNodePosition = skeleton.findNodePositionByCharIndex(startOffset, true, segmentId, segmentPage);
|
|
2812
2847
|
const endNodePosition = skeleton.findNodePositionByCharIndex(endOffset, true, segmentId, segmentPage);
|
|
2813
|
-
if (startNodePosition == null || endNodePosition == null)
|
|
2848
|
+
if (startNodePosition == null || endNodePosition == null) {
|
|
2849
|
+
const textRange = getTextRangeFromCharIndex(startOffset, endOffset, scene, document, skeleton, style, segmentId, segmentPage);
|
|
2850
|
+
if (textRange) return {
|
|
2851
|
+
textRanges: [textRange],
|
|
2852
|
+
rectRanges: []
|
|
2853
|
+
};
|
|
2854
|
+
return;
|
|
2855
|
+
}
|
|
2814
2856
|
return getRangeListFromSelection(startNodePosition, endNodePosition, scene, document, skeleton, style, segmentId, segmentPage);
|
|
2815
2857
|
}
|
|
2816
2858
|
function getRangeListFromSelection(anchorPosition, focusPosition, scene, document, skeleton, style, segmentId, segmentPage) {
|
|
@@ -5119,7 +5161,7 @@ const InnerPasteCommand = {
|
|
|
5119
5161
|
unitId: targetUnitId,
|
|
5120
5162
|
subUnitId: targetUnitId
|
|
5121
5163
|
};
|
|
5122
|
-
const selections = docSelectionManagerService.getTextRanges(selectionParams) ?? [];
|
|
5164
|
+
const selections = params.selections ?? docSelectionManagerService.getTextRanges(selectionParams) ?? [];
|
|
5123
5165
|
const rectRanges = docSelectionManagerService.getRectRanges(selectionParams) ?? [];
|
|
5124
5166
|
const selectionInfo = docSelectionManagerService.getSelectionInfo(selectionParams);
|
|
5125
5167
|
const { body: sourceBody, tableSource, drawings } = doc;
|
|
@@ -13790,6 +13832,10 @@ let DocRenderController = class DocRenderController extends RxDisposable {
|
|
|
13790
13832
|
} finally {
|
|
13791
13833
|
this._docLayoutExecutorService.recordHydrationDuration(this._context.unitId, Tools.now() - hydrationStartedAt);
|
|
13792
13834
|
}
|
|
13835
|
+
this._textSelectionManagerService.refreshSelection({
|
|
13836
|
+
unitId: this._context.unitId,
|
|
13837
|
+
subUnitId: this._context.unitId
|
|
13838
|
+
}, false);
|
|
13793
13839
|
this._markDocumentRenderDirty();
|
|
13794
13840
|
}
|
|
13795
13841
|
}
|
|
@@ -17957,13 +18003,20 @@ function PasteSpecialMenuFactory(accessor) {
|
|
|
17957
18003
|
id: DocPasteSpecialCommand.id,
|
|
17958
18004
|
type: MenuItemType.SELECTOR,
|
|
17959
18005
|
icon: "DocPasteOptionsIcon",
|
|
17960
|
-
title: "docs-ui.pasteOptions.
|
|
17961
|
-
tooltip: "docs-ui.pasteOptions.
|
|
18006
|
+
title: "docs-ui.pasteOptions.special",
|
|
18007
|
+
tooltip: "docs-ui.pasteOptions.special",
|
|
17962
18008
|
selections: DOC_PASTE_OPTIONS.map((option) => ({ ...option })),
|
|
17963
18009
|
disabled$: disableMenuWithoutDocumentUnitPermission(accessor, UnitAction.Edit),
|
|
17964
18010
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC)
|
|
17965
18011
|
};
|
|
17966
18012
|
}
|
|
18013
|
+
function PasteRibbonMenuFactory(accessor) {
|
|
18014
|
+
return {
|
|
18015
|
+
...PasteSpecialMenuFactory(accessor),
|
|
18016
|
+
title: "docs-ui.rightClick.paste",
|
|
18017
|
+
hidden$: combineLatest([getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC), accessor.get(IContextService).subscribeContextValue$(FOCUSING_SHAPE_TEXT_EDITOR).pipe(startWith(false))]).pipe(map(([hidden, editing]) => hidden || editing))
|
|
18018
|
+
};
|
|
18019
|
+
}
|
|
17967
18020
|
|
|
17968
18021
|
//#endregion
|
|
17969
18022
|
//#region src/views/paragraph-menu/theme-color.ts
|
|
@@ -18566,28 +18619,26 @@ const floatToolbarMenuSchema = { [FLOAT_TOOLBAR_MENU_POSITION]: { [FLOAT_TEXT_ST
|
|
|
18566
18619
|
} } };
|
|
18567
18620
|
const menuSchema = {
|
|
18568
18621
|
...floatToolbarMenuSchema,
|
|
18569
|
-
[RibbonStartGroup.
|
|
18570
|
-
|
|
18571
|
-
|
|
18572
|
-
|
|
18573
|
-
|
|
18574
|
-
|
|
18575
|
-
|
|
18576
|
-
showLabel: true
|
|
18577
|
-
},
|
|
18578
|
-
menuItemFactory: PasteSpecialMenuFactory
|
|
18622
|
+
[RibbonStartGroup.HISTORY]: { [DocPasteSpecialCommand.id]: {
|
|
18623
|
+
order: 4,
|
|
18624
|
+
gridLayout: {
|
|
18625
|
+
row: 1,
|
|
18626
|
+
column: 3,
|
|
18627
|
+
rowSpan: 2,
|
|
18628
|
+
showLabel: true
|
|
18579
18629
|
},
|
|
18580
|
-
|
|
18581
|
-
|
|
18582
|
-
|
|
18583
|
-
|
|
18584
|
-
|
|
18585
|
-
|
|
18586
|
-
|
|
18587
|
-
|
|
18588
|
-
|
|
18589
|
-
}
|
|
18590
|
-
|
|
18630
|
+
menuItemFactory: PasteRibbonMenuFactory
|
|
18631
|
+
} },
|
|
18632
|
+
[RibbonStartGroup.OTHERS]: { [OpenDocPermissionPanelOperation.id]: {
|
|
18633
|
+
order: 0,
|
|
18634
|
+
gridLayout: {
|
|
18635
|
+
row: 1,
|
|
18636
|
+
column: 1,
|
|
18637
|
+
rowSpan: 2,
|
|
18638
|
+
showLabel: true
|
|
18639
|
+
},
|
|
18640
|
+
menuItemFactory: DocPermissionMenuItemFactory
|
|
18641
|
+
} },
|
|
18591
18642
|
[RibbonStartGroup.FORMAT]: {
|
|
18592
18643
|
[SetInlineFormatBoldCommand.id]: {
|
|
18593
18644
|
order: 0,
|
|
@@ -18835,16 +18886,18 @@ const menuSchema = {
|
|
|
18835
18886
|
[DocPasteCommand.id]: {
|
|
18836
18887
|
order: 2,
|
|
18837
18888
|
menuItemFactory: PasteMenuFactory
|
|
18838
|
-
}
|
|
18889
|
+
}
|
|
18890
|
+
},
|
|
18891
|
+
[ContextMenuGroup.FORMAT]: {
|
|
18839
18892
|
[DocPasteSpecialCommand.id]: {
|
|
18840
|
-
order:
|
|
18893
|
+
order: -1,
|
|
18841
18894
|
menuItemFactory: PasteSpecialMenuFactory
|
|
18895
|
+
},
|
|
18896
|
+
[DeleteLeftCommand.id]: {
|
|
18897
|
+
order: 0,
|
|
18898
|
+
menuItemFactory: DeleteMenuFactory
|
|
18842
18899
|
}
|
|
18843
18900
|
},
|
|
18844
|
-
[ContextMenuGroup.FORMAT]: { [DeleteLeftCommand.id]: {
|
|
18845
|
-
order: 0,
|
|
18846
|
-
menuItemFactory: DeleteMenuFactory
|
|
18847
|
-
} },
|
|
18848
18901
|
[ContextMenuGroup.LAYOUT]: {
|
|
18849
18902
|
[DocParagraphSettingPanelOperation.id]: {
|
|
18850
18903
|
order: 0,
|
|
@@ -20831,7 +20884,7 @@ function resolveDocsCustomBlockRenderViewport(params) {
|
|
|
20831
20884
|
//#endregion
|
|
20832
20885
|
//#region package.json
|
|
20833
20886
|
var name = "@univerjs/docs-ui";
|
|
20834
|
-
var version = "1.0.
|
|
20887
|
+
var version = "1.0.3";
|
|
20835
20888
|
|
|
20836
20889
|
//#endregion
|
|
20837
20890
|
//#region src/commands/commands/doc-paragraph-setting.command.ts
|
|
@@ -21541,6 +21594,7 @@ let DocMoveCursorController = class DocMoveCursorController extends Disposable {
|
|
|
21541
21594
|
if (granularity !== "character") {
|
|
21542
21595
|
const nextOffset = this._getCursorOffsetByGranularity(skeleton, focusOffset, direction, granularity, normalizedSegmentId, normalizedSegmentPage, dataStreamLength, body.dataStream);
|
|
21543
21596
|
if (nextOffset == null || nextOffset === focusOffset) return;
|
|
21597
|
+
if (this._deferUnmaterializedCursorMove(docDataModel, skeleton, nextOffset, normalizedSegmentId, () => this._handleShiftMoveSelection(direction, granularity))) return;
|
|
21544
21598
|
const normalizedNextOffset = this._normalizeRenderableCursorOffset(skeleton, body.dataStream, customRanges, nextOffset, direction, normalizedSegmentId, normalizedSegmentPage);
|
|
21545
21599
|
if (normalizedNextOffset == null || normalizedNextOffset === focusOffset) return;
|
|
21546
21600
|
this._textSelectionManagerService.replaceDocRanges([{
|
|
@@ -24114,25 +24168,30 @@ const mobileMenuSchema = {
|
|
|
24114
24168
|
menuItemFactory: SelectAllMenuFactory
|
|
24115
24169
|
}
|
|
24116
24170
|
} },
|
|
24117
|
-
[DOC_CARET_MENU_ID]: {
|
|
24118
|
-
|
|
24119
|
-
|
|
24120
|
-
|
|
24121
|
-
|
|
24122
|
-
|
|
24123
|
-
|
|
24124
|
-
|
|
24125
|
-
|
|
24171
|
+
[DOC_CARET_MENU_ID]: {
|
|
24172
|
+
[ContextMenuGroup.QUICK]: {
|
|
24173
|
+
quickLayout: "tile",
|
|
24174
|
+
[DocPasteCommand.id]: {
|
|
24175
|
+
order: 0,
|
|
24176
|
+
menuItemFactory: PasteMenuFactory
|
|
24177
|
+
},
|
|
24178
|
+
[DocSelectWordCommand.id]: {
|
|
24179
|
+
order: 1,
|
|
24180
|
+
menuItemFactory: SelectWordMenuFactory
|
|
24181
|
+
},
|
|
24182
|
+
[DocSelectAllCommand.id]: {
|
|
24183
|
+
order: 2,
|
|
24184
|
+
menuItemFactory: SelectAllMenuFactory
|
|
24185
|
+
}
|
|
24126
24186
|
},
|
|
24127
|
-
[
|
|
24187
|
+
[ContextMenuGroup.FORMAT]: {
|
|
24128
24188
|
order: 1,
|
|
24129
|
-
|
|
24130
|
-
|
|
24131
|
-
|
|
24132
|
-
|
|
24133
|
-
menuItemFactory: SelectAllMenuFactory
|
|
24189
|
+
[DocPasteSpecialCommand.id]: {
|
|
24190
|
+
order: 0,
|
|
24191
|
+
menuItemFactory: PasteSpecialMenuFactory
|
|
24192
|
+
}
|
|
24134
24193
|
}
|
|
24135
|
-
}
|
|
24194
|
+
}
|
|
24136
24195
|
};
|
|
24137
24196
|
|
|
24138
24197
|
//#endregion
|
|
@@ -31160,4 +31219,4 @@ function MobileRichTextEditor(props) {
|
|
|
31160
31219
|
}
|
|
31161
31220
|
|
|
31162
31221
|
//#endregion
|
|
31163
|
-
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, 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, 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, getEmptyTableCell, getEmptyTableRow, getLineBounding, getListMarkerFallbackBound, getListParagraphContextMenuHit, getOneTextSelectionRange, getStyleInTextRange, getTableColumn, getTextRangeFromCharIndex, hasParagraphInTable, hideMenuWhenSelectionInBlockRange, isInSameTableCell, isTextRangeInAnyBlockRange, isValidRectRange, neoGetDocObject, normalizeDocFitToWidthOptions, removeClipboardHtmlImages, resolveDocCustomRangeChromeTheme, resolveDocFitBaseWidth, resolveDocViewScale, resolveDocsCustomBlockRenderViewport, resolveDocsTableLikeCustomBlockBleedViewport, resolveDocsTableLikeCustomBlockContentHeight, resolveDocsTableLikeCustomBlockContentWidth, scrollDocsTableLikeCustomBlockLive, shouldRefreshDocsCustomBlockSizeForCommand, useEditor, useEditorClickOutside, useIsFocusing, useKeyboardEvent, useLeftAndRightArrow, useOnChange, useResize, whenDocAndEditorFocused };
|
|
31222
|
+
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, 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, 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 };
|
package/lib/locale/ar-SA.js
CHANGED
package/lib/locale/ca-ES.js
CHANGED
package/lib/locale/de-DE.js
CHANGED
package/lib/locale/en-US.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
package/lib/locale/fa-IR.js
CHANGED
package/lib/locale/fr-FR.js
CHANGED
package/lib/locale/id-ID.js
CHANGED
package/lib/locale/it-IT.js
CHANGED
package/lib/locale/ja-JP.js
CHANGED
package/lib/locale/ko-KR.js
CHANGED
package/lib/locale/pl-PL.js
CHANGED
package/lib/locale/pt-BR.js
CHANGED
package/lib/locale/ru-RU.js
CHANGED
package/lib/locale/sk-SK.js
CHANGED
package/lib/locale/vi-VN.js
CHANGED
package/lib/locale/zh-CN.js
CHANGED
package/lib/locale/zh-HK.js
CHANGED
package/lib/locale/zh-TW.js
CHANGED
|
@@ -20,6 +20,8 @@ export interface IInnerPasteCommandParams {
|
|
|
20
20
|
unitId?: string;
|
|
21
21
|
segmentId: string;
|
|
22
22
|
doc: Partial<IDocumentData>;
|
|
23
|
+
/** Ranges to replace, without changing the selection recorded for undo. */
|
|
24
|
+
selections?: ITextRangeWithStyle[];
|
|
23
25
|
textRanges: ITextRangeWithStyle[];
|
|
24
26
|
customRangeMappings?: IDocClipboardPasteCustomRangeMapping[];
|
|
25
27
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ export { DocsRenderService } from './services/docs-render.service';
|
|
|
116
116
|
export { Editor } from './services/editor/editor';
|
|
117
117
|
export { EditorService, IEditorService } from './services/editor/editor-manager.service';
|
|
118
118
|
export type { IEditorRuntimeConfig } from './services/editor/editor-runtime-config';
|
|
119
|
+
export { getEditorRuntimeConfig, registerEditorRuntimeConfig } from './services/editor/editor-runtime-config';
|
|
119
120
|
export { DocFloatMenuService } from './services/float-menu.service';
|
|
120
121
|
export { isInSameTableCell, isValidRectRange, NodePositionConvertToRectRange, } from './services/selection/convert-rect-range';
|
|
121
122
|
export { findDocRangeNodePositions } from './services/selection/convert-text-range';
|
|
@@ -36,3 +36,4 @@ export declare function DeleteRowsMenuItemFactory(accessor: IAccessor): IMenuBut
|
|
|
36
36
|
export declare function DeleteColumnsMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
37
37
|
export declare function DeleteTableMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
38
38
|
export declare function PasteSpecialMenuFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
|
|
39
|
+
export declare function PasteRibbonMenuFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
|
|
@@ -19,6 +19,8 @@ export interface IEditorRuntimeConfig {
|
|
|
19
19
|
layout?: IDocumentLayoutPresentation;
|
|
20
20
|
inheritParagraphStartStyle?: boolean;
|
|
21
21
|
disableSelectionAutoScroll?: boolean;
|
|
22
|
+
/** The host editor provides its own hyperlink menus and pointer interaction. */
|
|
23
|
+
customHyperLinkUI?: boolean;
|
|
22
24
|
}
|
|
23
25
|
export declare function registerEditorRuntimeConfig(model: DocumentDataModel, config: IEditorRuntimeConfig): IDisposable;
|
|
24
26
|
export declare function getEditorRuntimeConfig(model: DocumentDataModel): IEditorRuntimeConfig | undefined;
|
|
@@ -41,6 +41,7 @@ export declare class TextRange implements IDocRange {
|
|
|
41
41
|
style: ITextSelectionStyle;
|
|
42
42
|
private _segmentId;
|
|
43
43
|
private _segmentPage;
|
|
44
|
+
private _logicalRange?;
|
|
44
45
|
rangeType: DOC_RANGE_TYPE;
|
|
45
46
|
private _current;
|
|
46
47
|
private _rangeShape;
|
|
@@ -48,7 +49,10 @@ export declare class TextRange implements IDocRange {
|
|
|
48
49
|
private _cursorList;
|
|
49
50
|
private _anchorBlinkTimer;
|
|
50
51
|
private _anchorActiveStroke;
|
|
51
|
-
constructor(_scene: Scene, _document: Documents, _docSkeleton: DocumentSkeleton, anchorNodePosition?: Nullable<INodePosition>, focusNodePosition?: Nullable<INodePosition>, style?: ITextSelectionStyle, _segmentId?: string, _segmentPage?: number
|
|
52
|
+
constructor(_scene: Scene, _document: Documents, _docSkeleton: DocumentSkeleton, anchorNodePosition?: Nullable<INodePosition>, focusNodePosition?: Nullable<INodePosition>, style?: ITextSelectionStyle, _segmentId?: string, _segmentPage?: number, _logicalRange?: {
|
|
53
|
+
startOffset: number;
|
|
54
|
+
endOffset: number;
|
|
55
|
+
} | undefined);
|
|
52
56
|
private _anchorBlink;
|
|
53
57
|
get startOffset(): number | undefined;
|
|
54
58
|
get endOffset(): number | undefined;
|
|
@@ -73,6 +77,7 @@ export declare class TextRange implements IDocRange {
|
|
|
73
77
|
dispose(): void;
|
|
74
78
|
isIntersection(compareRange: TextRange): boolean;
|
|
75
79
|
refresh(): void;
|
|
80
|
+
private _refreshLogicalRangePositions;
|
|
76
81
|
private _isEmpty;
|
|
77
82
|
private _isCollapsed;
|
|
78
83
|
private _createOrUpdateRange;
|