@univerjs/docs-ui 0.24.0 → 0.25.0-insiders.20260608-e4336f7

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 (142) hide show
  1. package/lib/cjs/facade.js +23 -152
  2. package/lib/cjs/index.js +4431 -1743
  3. package/lib/cjs/locale/ar-SA.js +124 -0
  4. package/lib/cjs/locale/ca-ES.js +11 -10
  5. package/lib/cjs/locale/de-DE.js +124 -0
  6. package/lib/cjs/locale/en-US.js +11 -10
  7. package/lib/cjs/locale/es-ES.js +11 -10
  8. package/lib/cjs/locale/fa-IR.js +11 -10
  9. package/lib/cjs/locale/fr-FR.js +11 -10
  10. package/lib/cjs/locale/id-ID.js +124 -0
  11. package/lib/cjs/locale/it-IT.js +124 -0
  12. package/lib/cjs/locale/ja-JP.js +11 -10
  13. package/lib/cjs/locale/ko-KR.js +11 -10
  14. package/lib/cjs/locale/pl-PL.js +124 -0
  15. package/lib/cjs/locale/pt-BR.js +124 -0
  16. package/lib/cjs/locale/ru-RU.js +13 -12
  17. package/lib/cjs/locale/sk-SK.js +11 -10
  18. package/lib/cjs/locale/vi-VN.js +22 -21
  19. package/lib/cjs/locale/zh-CN.js +11 -10
  20. package/lib/cjs/locale/zh-HK.js +124 -0
  21. package/lib/cjs/locale/zh-TW.js +22 -21
  22. package/lib/es/facade.js +25 -147
  23. package/lib/es/index.js +4397 -1716
  24. package/lib/es/locale/ar-SA.js +123 -0
  25. package/lib/es/locale/ca-ES.js +11 -10
  26. package/lib/es/locale/de-DE.js +123 -0
  27. package/lib/es/locale/en-US.js +11 -10
  28. package/lib/es/locale/es-ES.js +11 -10
  29. package/lib/es/locale/fa-IR.js +11 -10
  30. package/lib/es/locale/fr-FR.js +11 -10
  31. package/lib/es/locale/id-ID.js +123 -0
  32. package/lib/es/locale/it-IT.js +123 -0
  33. package/lib/es/locale/ja-JP.js +11 -10
  34. package/lib/es/locale/ko-KR.js +11 -10
  35. package/lib/es/locale/pl-PL.js +123 -0
  36. package/lib/es/locale/pt-BR.js +123 -0
  37. package/lib/es/locale/ru-RU.js +13 -12
  38. package/lib/es/locale/sk-SK.js +11 -10
  39. package/lib/es/locale/vi-VN.js +22 -21
  40. package/lib/es/locale/zh-CN.js +11 -10
  41. package/lib/es/locale/zh-HK.js +123 -0
  42. package/lib/es/locale/zh-TW.js +22 -21
  43. package/lib/facade.js +25 -147
  44. package/lib/index.css +240 -26
  45. package/lib/index.js +4397 -1716
  46. package/lib/locale/ar-SA.js +123 -0
  47. package/lib/locale/ca-ES.js +11 -10
  48. package/lib/locale/de-DE.js +123 -0
  49. package/lib/locale/en-US.js +11 -10
  50. package/lib/locale/es-ES.js +11 -10
  51. package/lib/locale/fa-IR.js +11 -10
  52. package/lib/locale/fr-FR.js +11 -10
  53. package/lib/locale/id-ID.js +123 -0
  54. package/lib/locale/it-IT.js +123 -0
  55. package/lib/locale/ja-JP.js +11 -10
  56. package/lib/locale/ko-KR.js +11 -10
  57. package/lib/locale/pl-PL.js +123 -0
  58. package/lib/locale/pt-BR.js +123 -0
  59. package/lib/locale/ru-RU.js +13 -12
  60. package/lib/locale/sk-SK.js +11 -10
  61. package/lib/locale/vi-VN.js +22 -21
  62. package/lib/locale/zh-CN.js +11 -10
  63. package/lib/locale/zh-HK.js +123 -0
  64. package/lib/locale/zh-TW.js +22 -21
  65. package/lib/types/commands/commands/doc-block-move.command.d.ts +40 -0
  66. package/lib/types/commands/commands/doc-delete.command.d.ts +3 -2
  67. package/lib/types/commands/commands/doc-page-setup.command.d.ts +2 -0
  68. package/lib/types/commands/commands/inline-format.command.d.ts +2 -1
  69. package/lib/types/commands/commands/list.command.d.ts +1 -0
  70. package/lib/types/commands/util.d.ts +1 -2
  71. package/lib/types/components/float-toolbar/FloatToolbar.d.ts +1 -1
  72. package/lib/types/components/float-toolbar/FloatToolbar.stories.d.ts +1 -1
  73. package/lib/types/components/list-type-picker/Picker.d.ts +3 -3
  74. package/lib/types/components/paragraph-menu/index.d.ts +24 -2
  75. package/lib/types/components/side-menu/SideMenu.stories.d.ts +4 -4
  76. package/lib/types/controllers/render-controllers/doc-contextmenu.render-controller.d.ts +8 -2
  77. package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +8 -2
  78. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -3
  79. package/lib/types/facade/f-document.d.ts +12 -26
  80. package/lib/types/facade/index.d.ts +2 -3
  81. package/lib/types/index.d.ts +7 -5
  82. package/lib/types/{types/delete-direction.d.ts → locale/ar-SA.d.ts} +3 -4
  83. package/lib/types/locale/de-DE.d.ts +18 -0
  84. package/lib/types/locale/en-US.d.ts +117 -110
  85. package/lib/types/locale/id-ID.d.ts +18 -0
  86. package/lib/types/locale/it-IT.d.ts +18 -0
  87. package/lib/types/locale/pl-PL.d.ts +18 -0
  88. package/lib/types/locale/pt-BR.d.ts +18 -0
  89. package/lib/types/locale/zh-HK.d.ts +18 -0
  90. package/lib/types/menu/menu.d.ts +9 -1
  91. package/lib/types/menu/paragraph-menu.d.ts +21 -2
  92. package/lib/types/menu/schema.d.ts +1 -0
  93. package/lib/types/services/clipboard/clipboard.service.d.ts +5 -1
  94. package/lib/types/services/clipboard/html-to-udm/converter.d.ts +12 -0
  95. package/lib/types/services/clipboard/html-to-udm/paste-plugins/type.d.ts +1 -0
  96. package/lib/types/services/clipboard/internal-fragment.d.ts +30 -0
  97. package/lib/types/services/doc-event-manager.service.d.ts +19 -1
  98. package/lib/types/services/doc-ime-state-change-interceptor.service.d.ts +23 -0
  99. package/lib/types/services/doc-paragraph-menu.service.d.ts +51 -3
  100. package/lib/types/services/doc-popup-manager.service.d.ts +2 -2
  101. package/lib/types/services/docs-render.service.d.ts +2 -1
  102. package/lib/types/services/editor/editor.d.ts +1 -0
  103. package/lib/types/services/selection/convert-text-range.d.ts +1 -0
  104. package/lib/types/services/selection/doc-selection-render.service.d.ts +4 -0
  105. package/lib/types/views/count-bar/CountBar.d.ts +1 -1
  106. package/lib/types/views/count-bar/ZoomSlider.d.ts +1 -1
  107. package/lib/types/views/doc-footer/DocFooter.d.ts +1 -1
  108. package/lib/types/views/header-footer/panel/DocHeaderFooterOptions.d.ts +1 -1
  109. package/lib/types/views/header-footer/panel/DocHeaderFooterPanel.d.ts +1 -1
  110. package/lib/types/views/page-settings/index.d.ts +5 -3
  111. package/lib/types/views/paragraph-setting/Setting.d.ts +1 -1
  112. package/lib/types/views/paragraph-setting/index.d.ts +1 -1
  113. package/lib/types/views/rich-text-editor/hooks/use-editor.d.ts +2 -1
  114. package/lib/types/views/rich-text-editor/index.d.ts +1 -1
  115. package/lib/types/views/side-menu/index.d.ts +1 -1
  116. package/lib/types/views/table/create/TableCreate.d.ts +1 -1
  117. package/lib/umd/facade.js +1 -1
  118. package/lib/umd/index.js +37 -10
  119. package/lib/umd/locale/ar-SA.js +1 -0
  120. package/lib/umd/locale/ca-ES.js +1 -1
  121. package/lib/umd/locale/de-DE.js +1 -0
  122. package/lib/umd/locale/en-US.js +1 -1
  123. package/lib/umd/locale/es-ES.js +1 -1
  124. package/lib/umd/locale/fa-IR.js +1 -1
  125. package/lib/umd/locale/fr-FR.js +1 -1
  126. package/lib/umd/locale/id-ID.js +1 -0
  127. package/lib/umd/locale/it-IT.js +1 -0
  128. package/lib/umd/locale/ja-JP.js +1 -1
  129. package/lib/umd/locale/ko-KR.js +1 -1
  130. package/lib/umd/locale/pl-PL.js +1 -0
  131. package/lib/umd/locale/pt-BR.js +1 -0
  132. package/lib/umd/locale/ru-RU.js +1 -1
  133. package/lib/umd/locale/sk-SK.js +1 -1
  134. package/lib/umd/locale/vi-VN.js +1 -1
  135. package/lib/umd/locale/zh-CN.js +1 -1
  136. package/lib/umd/locale/zh-HK.js +1 -0
  137. package/lib/umd/locale/zh-TW.js +1 -1
  138. package/package.json +13 -13
  139. package/LICENSE +0 -176
  140. package/lib/types/commands/commands/core-editing.command.d.ts +0 -58
  141. package/lib/types/facade/f-univer.d.ts +0 -52
  142. package/lib/types/services/doc-state-change-manager.service.d.ts +0 -50
@@ -1,6 +1,6 @@
1
1
 
2
2
  //#region src/locale/zh-CN.ts
3
- const locale = {
3
+ const locale = { "docs-ui": {
4
4
  toolbar: {
5
5
  undo: "撤销",
6
6
  redo: "重做",
@@ -12,14 +12,8 @@ const locale = {
12
12
  subscript: "下标",
13
13
  superscript: "上标",
14
14
  underline: "下划线",
15
- textColor: {
16
- main: "文本颜色",
17
- right: "颜色选择"
18
- },
19
- fillColor: {
20
- main: "文本背景色",
21
- right: "背景色选择"
22
- },
15
+ textColor: { main: "文本颜色" },
16
+ fillColor: { main: "文本背景色" },
23
17
  table: {
24
18
  main: "表格",
25
19
  insert: "插入表格",
@@ -91,6 +85,13 @@ const locale = {
91
85
  },
92
86
  "page-settings": {
93
87
  "document-setting": "文档设置",
88
+ mode: "模式",
89
+ "modern-mode": "现代模式",
90
+ "classic-mode": "经典模式",
91
+ "modern-width": "内容宽度",
92
+ "modern-width-narrow": "窄",
93
+ "modern-width-medium": "适中",
94
+ "modern-width-wide": "宽",
94
95
  "page-size": {
95
96
  main: "纸张大小",
96
97
  a4: "A4",
@@ -117,7 +118,7 @@ const locale = {
117
118
  cancel: "取消",
118
119
  confirm: "确认"
119
120
  }
120
- };
121
+ } };
121
122
 
122
123
  //#endregion
123
124
  module.exports = locale;
@@ -0,0 +1,124 @@
1
+
2
+ //#region src/locale/zh-HK.ts
3
+ const locale = { "docs-ui": {
4
+ toolbar: {
5
+ undo: "撤銷",
6
+ redo: "重做",
7
+ font: "字型",
8
+ fontSize: "字號",
9
+ bold: "粗體",
10
+ italic: "斜體",
11
+ strikethrough: "刪除線",
12
+ subscript: "下標",
13
+ superscript: "上標",
14
+ underline: "底線",
15
+ textColor: { main: "文字顏色" },
16
+ fillColor: { main: "文字背景色" },
17
+ table: {
18
+ main: "Table",
19
+ insert: "Insert Table",
20
+ colCount: "Column count",
21
+ rowCount: "Row count"
22
+ },
23
+ resetColor: "重置顏色",
24
+ order: "有序列表",
25
+ unorder: "無序列表",
26
+ checklist: "任務列表",
27
+ documentFlavor: "现代模式",
28
+ alignLeft: "左對齊",
29
+ alignCenter: "居中對齊",
30
+ alignRight: "右對齊",
31
+ alignJustify: "兩端對齊",
32
+ horizontalLine: "Horizontal line",
33
+ headerFooter: "頁眉頁腳",
34
+ pageSetup: "頁面設置"
35
+ },
36
+ table: {
37
+ insert: "Insert",
38
+ insertRowAbove: "Insert row above",
39
+ insertRowBelow: "Insert row below",
40
+ insertColumnLeft: "Insert column left",
41
+ insertColumnRight: "Insert column right",
42
+ delete: "Table delete",
43
+ deleteRows: "Delete row",
44
+ deleteColumns: "Delete column",
45
+ deleteTable: "Delete table"
46
+ },
47
+ headerFooter: {
48
+ header: "頁眉",
49
+ footer: "頁腳",
50
+ panel: "頁眉頁腳設置",
51
+ firstPageCheckBox: "首頁不同",
52
+ oddEvenCheckBox: "奇偶頁不同",
53
+ headerTopMargin: "頁眉頂端距離(px)",
54
+ footerBottomMargin: "頁腳底端距離(px)",
55
+ closeHeaderFooter: "關閉頁眉頁腳",
56
+ disableText: "頁眉頁腳設置不可用"
57
+ },
58
+ doc: {
59
+ menu: { paragraphSetting: "Paragraph Setting" },
60
+ slider: { paragraphSetting: "Paragraph Setting" },
61
+ paragraphSetting: {
62
+ alignment: "Alignment",
63
+ indentation: "Indentation",
64
+ left: "Left",
65
+ right: "Right",
66
+ firstLine: "First Line",
67
+ hanging: "Hanging",
68
+ spacing: "Spacing",
69
+ before: "Before",
70
+ after: "After",
71
+ lineSpace: "Line Space",
72
+ multiSpace: "Multi Space",
73
+ fixedValue: "Fixed Value(px)"
74
+ }
75
+ },
76
+ rightClick: {
77
+ copy: "複製",
78
+ cut: "剪切",
79
+ paste: "貼上",
80
+ delete: "刪除",
81
+ bulletList: "無序列表",
82
+ orderList: "有序列表",
83
+ checkList: "任務列表",
84
+ insertBellow: "在下方插入"
85
+ },
86
+ "page-settings": {
87
+ "document-setting": "文檔設置",
88
+ mode: "模式",
89
+ "modern-mode": "現代模式",
90
+ "classic-mode": "經典模式",
91
+ "modern-width": "內容寬度",
92
+ "modern-width-narrow": "窄",
93
+ "modern-width-medium": "適中",
94
+ "modern-width-wide": "寬",
95
+ "paper-size": "紙張大小",
96
+ "page-size": {
97
+ main: "紙張大小",
98
+ a4: "A4",
99
+ a3: "A3",
100
+ a5: "A5",
101
+ b4: "B4",
102
+ b5: "B5",
103
+ letter: "美式信紙",
104
+ legal: "美式法律用紙",
105
+ tabloid: "小報尺寸",
106
+ statement: "聲明用紙",
107
+ executive: "行政用紙",
108
+ folio: "對開紙"
109
+ },
110
+ orientation: "方向",
111
+ portrait: "縱向",
112
+ landscape: "橫向",
113
+ "custom-paper-size": "自定義紙張大小",
114
+ top: "上",
115
+ bottom: "下",
116
+ left: "左",
117
+ right: "右",
118
+ cancel: "取消",
119
+ confirm: "確認"
120
+ }
121
+ } };
122
+
123
+ //#endregion
124
+ module.exports = locale;
@@ -1,6 +1,6 @@
1
1
 
2
2
  //#region src/locale/zh-TW.ts
3
- const locale = {
3
+ const locale = { "docs-ui": {
4
4
  toolbar: {
5
5
  undo: "撤銷",
6
6
  redo: "重做",
@@ -12,14 +12,8 @@ const locale = {
12
12
  subscript: "下標",
13
13
  superscript: "上標",
14
14
  underline: "底線",
15
- textColor: {
16
- main: "文字顏色",
17
- right: "顏色選擇"
18
- },
19
- fillColor: {
20
- main: "文字背景色",
21
- right: "背景色選擇"
22
- },
15
+ textColor: { main: "文字顏色" },
16
+ fillColor: { main: "文字背景色" },
23
17
  table: {
24
18
  main: "Table",
25
19
  insert: "Insert Table",
@@ -29,26 +23,26 @@ const locale = {
29
23
  resetColor: "重置顏色",
30
24
  order: "有序列表",
31
25
  unorder: "無序列表",
26
+ checklist: "任務列表",
27
+ documentFlavor: "现代模式",
32
28
  alignLeft: "左對齊",
33
29
  alignCenter: "居中對齊",
34
30
  alignRight: "右對齊",
35
31
  alignJustify: "兩端對齊",
36
32
  horizontalLine: "Horizontal line",
37
33
  headerFooter: "頁眉頁腳",
38
- checklist: "任務列表",
39
- documentFlavor: "现代模式",
40
34
  pageSetup: "頁面設置"
41
35
  },
42
36
  table: {
43
- insert: "Insert",
44
- insertRowAbove: "Insert row above",
45
- insertRowBelow: "Insert row below",
46
- insertColumnLeft: "Insert column left",
47
- insertColumnRight: "Insert column right",
48
- delete: "Table delete",
49
- deleteRows: "Delete row",
50
- deleteColumns: "Delete column",
51
- deleteTable: "Delete table"
37
+ insert: "插入",
38
+ insertRowAbove: "在上方插入行",
39
+ insertRowBelow: "在下方插入行",
40
+ insertColumnLeft: "在左側插入列",
41
+ insertColumnRight: "在右側插入列",
42
+ delete: "刪除表格",
43
+ deleteRows: "刪除行",
44
+ deleteColumns: "刪除列",
45
+ deleteTable: "刪除表格"
52
46
  },
53
47
  headerFooter: {
54
48
  header: "頁眉",
@@ -91,6 +85,13 @@ const locale = {
91
85
  },
92
86
  "page-settings": {
93
87
  "document-setting": "文檔設置",
88
+ mode: "模式",
89
+ "modern-mode": "現代模式",
90
+ "classic-mode": "經典模式",
91
+ "modern-width": "內容寬度",
92
+ "modern-width-narrow": "窄",
93
+ "modern-width-medium": "適中",
94
+ "modern-width-wide": "寬",
94
95
  "page-size": {
95
96
  main: "紙張大小",
96
97
  a4: "A4",
@@ -117,7 +118,7 @@ const locale = {
117
118
  cancel: "取消",
118
119
  confirm: "確認"
119
120
  }
120
- };
121
+ } };
121
122
 
122
123
  //#endregion
123
124
  module.exports = locale;
package/lib/es/facade.js CHANGED
@@ -1,134 +1,38 @@
1
- import { DOC_RANGE_TYPE, ICommandService, IResourceManagerService, IUniverInstanceService, Inject, Injector, RedoCommand, UndoCommand, UniverInstanceType } from "@univerjs/core";
2
- import { FUniver } from "@univerjs/core/facade";
3
- import { DocSelectionRenderService, InsertCommand } from "@univerjs/docs-ui";
1
+ import { DOC_RANGE_TYPE } from "@univerjs/core";
2
+ import { DocSelectionRenderService } from "@univerjs/docs-ui";
3
+ import { FDocument } from "@univerjs/docs/facade";
4
4
  import { IRenderManagerService } from "@univerjs/engine-render";
5
5
 
6
- //#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
7
- function _typeof(o) {
8
- "@babel/helpers - typeof";
9
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
10
- return typeof o;
11
- } : function(o) {
12
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
13
- }, _typeof(o);
14
- }
15
-
16
- //#endregion
17
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
18
- function toPrimitive(t, r) {
19
- if ("object" != _typeof(t) || !t) return t;
20
- var e = t[Symbol.toPrimitive];
21
- if (void 0 !== e) {
22
- var i = e.call(t, r || "default");
23
- if ("object" != _typeof(i)) return i;
24
- throw new TypeError("@@toPrimitive must return a primitive value.");
25
- }
26
- return ("string" === r ? String : Number)(t);
27
- }
28
-
29
- //#endregion
30
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
31
- function toPropertyKey(t) {
32
- var i = toPrimitive(t, "string");
33
- return "symbol" == _typeof(i) ? i : i + "";
34
- }
35
-
36
- //#endregion
37
- //#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
38
- function _defineProperty(e, r, t) {
39
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
40
- value: t,
41
- enumerable: !0,
42
- configurable: !0,
43
- writable: !0
44
- }) : e[r] = t, e;
45
- }
46
-
47
- //#endregion
48
- //#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
49
- function __decorateParam(paramIndex, decorator) {
50
- return function(target, key) {
51
- decorator(target, key, paramIndex);
52
- };
53
- }
54
-
55
- //#endregion
56
- //#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
57
- function __decorate(decorators, target, key, desc) {
58
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
59
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
60
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
61
- return c > 3 && r && Object.defineProperty(target, key, r), r;
62
- }
63
-
64
- //#endregion
65
6
  //#region src/facade/f-document.ts
66
- let FDocument = class FDocument {
67
- constructor(_documentDataModel, _injector, _univerInstanceService, _commandService, _resourceManagerService, _renderManagerService) {
68
- this._documentDataModel = _documentDataModel;
69
- this._injector = _injector;
70
- this._univerInstanceService = _univerInstanceService;
71
- this._commandService = _commandService;
72
- this._resourceManagerService = _resourceManagerService;
73
- this._renderManagerService = _renderManagerService;
74
- _defineProperty(this, "id", void 0);
75
- this.id = this._documentDataModel.getUnitId();
76
- }
77
- getId() {
78
- return this._documentDataModel.getUnitId();
79
- }
80
- getName() {
81
- return this.getSnapshot().title || "";
82
- }
83
- getSnapshot() {
84
- const resources = this._resourceManagerService.getResourcesByType(this.id, UniverInstanceType.UNIVER_DOC);
85
- const snapshot = this._documentDataModel.getSnapshot();
86
- snapshot.resources = resources;
87
- return snapshot;
88
- }
89
- undo() {
90
- this._univerInstanceService.focusUnit(this.id);
91
- return this._commandService.executeCommand(UndoCommand.id);
92
- }
93
- redo() {
94
- this._univerInstanceService.focusUnit(this.id);
95
- return this._commandService.executeCommand(RedoCommand.id);
96
- }
97
- /**
98
- * Adds the specified text to the end of this text region.
99
- * @param text - The text to be added to the end of this text region.
100
- */
101
- appendText(text) {
102
- const unitId = this.id;
103
- const { body } = this.getSnapshot();
104
- if (!body) throw new Error("The document body is empty");
105
- const lastPosition = body.dataStream.length - 2;
106
- const activeRange = {
107
- startOffset: lastPosition,
108
- endOffset: lastPosition,
109
- collapsed: true,
110
- segmentId: ""
111
- };
112
- const { segmentId } = activeRange;
113
- return this._commandService.executeCommand(InsertCommand.id, {
114
- unitId,
115
- body: { dataStream: text },
116
- range: activeRange,
117
- segmentId
118
- });
119
- }
7
+ /**
8
+ * Copyright 2023-present DreamNum Co., Ltd.
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ var FDocumentUIMixin = class extends FDocument {
120
23
  /**
121
24
  * Sets the selection to a specified text range in the document.
122
25
  * @param startOffset - The starting offset of the selection in the document.
123
26
  * @param endOffset - The ending offset of the selection in the document.
124
27
  * @example
125
28
  * ```typescript
126
- * document.setSelection(10, 20);
29
+ * const fDocument = univerAPI.getActiveDocument();
30
+ * fDocument.setSelection(10, 20);
127
31
  * ```
128
32
  */
129
33
  setSelection(startOffset, endOffset) {
130
- var _this$_renderManagerS;
131
- const docSelectionRenderService = (_this$_renderManagerS = this._renderManagerService.getRenderById(this.getId())) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(DocSelectionRenderService);
34
+ var _renderManagerService;
35
+ const docSelectionRenderService = (_renderManagerService = this._injector.get(IRenderManagerService).getRenderUnitById(this.getId())) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.with(DocSelectionRenderService);
132
36
  docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.removeAllRanges();
133
37
  docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.addDocRanges([{
134
38
  startOffset,
@@ -137,33 +41,7 @@ let FDocument = class FDocument {
137
41
  }], true);
138
42
  }
139
43
  };
140
- FDocument = __decorate([
141
- __decorateParam(1, Inject(Injector)),
142
- __decorateParam(2, IUniverInstanceService),
143
- __decorateParam(3, ICommandService),
144
- __decorateParam(4, IResourceManagerService),
145
- __decorateParam(5, IRenderManagerService)
146
- ], FDocument);
147
-
148
- //#endregion
149
- //#region src/facade/f-univer.ts
150
- var FUniverDocsUIMixin = class extends FUniver {
151
- createUniverDoc(data) {
152
- const document = this._univerInstanceService.createUnit(UniverInstanceType.UNIVER_DOC, data);
153
- return this._injector.createInstance(FDocument, document);
154
- }
155
- getActiveDocument() {
156
- const document = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);
157
- if (!document) return null;
158
- return this._injector.createInstance(FDocument, document);
159
- }
160
- getUniverDoc(id) {
161
- const document = this._univerInstanceService.getUniverDocInstance(id);
162
- if (!document) return null;
163
- return this._injector.createInstance(FDocument, document);
164
- }
165
- };
166
- FUniver.extend(FUniverDocsUIMixin);
44
+ FDocument.extend(FDocumentUIMixin);
167
45
 
168
46
  //#endregion
169
- export { FDocument };
47
+ export { };