@univerjs/docs-ui 0.24.0 → 0.25.0-insiders.20260604-29ebbff
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/facade.js +23 -152
- package/lib/cjs/index.js +4455 -1637
- package/lib/cjs/locale/ar-SA.js +124 -0
- package/lib/cjs/locale/ca-ES.js +11 -10
- package/lib/cjs/locale/de-DE.js +124 -0
- package/lib/cjs/locale/en-US.js +11 -10
- package/lib/cjs/locale/es-ES.js +11 -10
- package/lib/cjs/locale/fa-IR.js +11 -10
- package/lib/cjs/locale/fr-FR.js +11 -10
- package/lib/cjs/locale/id-ID.js +124 -0
- package/lib/cjs/locale/it-IT.js +124 -0
- package/lib/cjs/locale/ja-JP.js +11 -10
- package/lib/cjs/locale/ko-KR.js +11 -10
- package/lib/cjs/locale/pl-PL.js +124 -0
- package/lib/cjs/locale/pt-BR.js +124 -0
- package/lib/cjs/locale/ru-RU.js +13 -12
- package/lib/cjs/locale/sk-SK.js +11 -10
- package/lib/cjs/locale/vi-VN.js +22 -21
- package/lib/cjs/locale/zh-CN.js +11 -10
- package/lib/cjs/locale/zh-HK.js +124 -0
- package/lib/cjs/locale/zh-TW.js +22 -21
- package/lib/es/facade.js +25 -147
- package/lib/es/index.js +4417 -1612
- package/lib/es/locale/ar-SA.js +123 -0
- package/lib/es/locale/ca-ES.js +11 -10
- package/lib/es/locale/de-DE.js +123 -0
- package/lib/es/locale/en-US.js +11 -10
- package/lib/es/locale/es-ES.js +11 -10
- package/lib/es/locale/fa-IR.js +11 -10
- package/lib/es/locale/fr-FR.js +11 -10
- package/lib/es/locale/id-ID.js +123 -0
- package/lib/es/locale/it-IT.js +123 -0
- package/lib/es/locale/ja-JP.js +11 -10
- package/lib/es/locale/ko-KR.js +11 -10
- package/lib/es/locale/pl-PL.js +123 -0
- package/lib/es/locale/pt-BR.js +123 -0
- package/lib/es/locale/ru-RU.js +13 -12
- package/lib/es/locale/sk-SK.js +11 -10
- package/lib/es/locale/vi-VN.js +22 -21
- package/lib/es/locale/zh-CN.js +11 -10
- package/lib/es/locale/zh-HK.js +123 -0
- package/lib/es/locale/zh-TW.js +22 -21
- package/lib/facade.js +25 -147
- package/lib/index.css +240 -26
- package/lib/index.js +4417 -1612
- package/lib/locale/ar-SA.js +123 -0
- package/lib/locale/ca-ES.js +11 -10
- package/lib/locale/de-DE.js +123 -0
- package/lib/locale/en-US.js +11 -10
- package/lib/locale/es-ES.js +11 -10
- package/lib/locale/fa-IR.js +11 -10
- package/lib/locale/fr-FR.js +11 -10
- package/lib/locale/id-ID.js +123 -0
- package/lib/locale/it-IT.js +123 -0
- package/lib/locale/ja-JP.js +11 -10
- package/lib/locale/ko-KR.js +11 -10
- package/lib/locale/pl-PL.js +123 -0
- package/lib/locale/pt-BR.js +123 -0
- package/lib/locale/ru-RU.js +13 -12
- package/lib/locale/sk-SK.js +11 -10
- package/lib/locale/vi-VN.js +22 -21
- package/lib/locale/zh-CN.js +11 -10
- package/lib/locale/zh-HK.js +123 -0
- package/lib/locale/zh-TW.js +22 -21
- package/lib/types/commands/commands/doc-block-move.command.d.ts +40 -0
- package/lib/types/commands/commands/doc-delete.command.d.ts +3 -2
- package/lib/types/commands/commands/doc-page-setup.command.d.ts +2 -0
- package/lib/types/commands/commands/inline-format.command.d.ts +2 -1
- package/lib/types/commands/commands/list.command.d.ts +1 -0
- package/lib/types/commands/util.d.ts +1 -2
- package/lib/types/components/paragraph-menu/index.d.ts +23 -1
- package/lib/types/controllers/render-controllers/doc-contextmenu.render-controller.d.ts +8 -2
- package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +8 -2
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -3
- package/lib/types/facade/f-document.d.ts +12 -26
- package/lib/types/facade/index.d.ts +2 -3
- package/lib/types/index.d.ts +7 -4
- package/lib/types/{types/delete-direction.d.ts → locale/ar-SA.d.ts} +3 -4
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +117 -110
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/menu/menu.d.ts +9 -1
- package/lib/types/menu/paragraph-menu.d.ts +21 -2
- package/lib/types/menu/schema.d.ts +1 -0
- package/lib/types/services/clipboard/clipboard.service.d.ts +5 -1
- package/lib/types/services/clipboard/html-to-udm/converter.d.ts +12 -0
- package/lib/types/services/clipboard/html-to-udm/paste-plugins/type.d.ts +1 -0
- package/lib/types/services/clipboard/internal-fragment.d.ts +30 -0
- package/lib/types/services/doc-event-manager.service.d.ts +19 -1
- package/lib/types/services/doc-paragraph-menu.service.d.ts +51 -3
- package/lib/types/services/doc-popup-manager.service.d.ts +2 -2
- package/lib/types/services/docs-render.service.d.ts +2 -1
- package/lib/types/services/editor/editor.d.ts +1 -0
- package/lib/types/services/selection/convert-text-range.d.ts +1 -0
- package/lib/types/services/selection/doc-selection-render.service.d.ts +4 -0
- package/lib/types/views/page-settings/index.d.ts +4 -2
- package/lib/types/views/rich-text-editor/hooks/use-editor.d.ts +2 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +37 -10
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -0
- 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 -0
- package/lib/umd/locale/it-IT.js +1 -0
- 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 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- 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 -0
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -11
- package/LICENSE +0 -176
- package/lib/types/commands/commands/core-editing.command.d.ts +0 -58
- package/lib/types/facade/f-univer.d.ts +0 -52
package/lib/cjs/facade.js
CHANGED
|
@@ -1,135 +1,38 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
1
|
let _univerjs_core = require("@univerjs/core");
|
|
3
|
-
let _univerjs_core_facade = require("@univerjs/core/facade");
|
|
4
2
|
let _univerjs_docs_ui = require("@univerjs/docs-ui");
|
|
3
|
+
let _univerjs_docs_facade = require("@univerjs/docs/facade");
|
|
5
4
|
let _univerjs_engine_render = require("@univerjs/engine-render");
|
|
6
5
|
|
|
7
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
8
|
-
function _typeof(o) {
|
|
9
|
-
"@babel/helpers - typeof";
|
|
10
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
11
|
-
return typeof o;
|
|
12
|
-
} : function(o) {
|
|
13
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
14
|
-
}, _typeof(o);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
19
|
-
function toPrimitive(t, r) {
|
|
20
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
21
|
-
var e = t[Symbol.toPrimitive];
|
|
22
|
-
if (void 0 !== e) {
|
|
23
|
-
var i = e.call(t, r || "default");
|
|
24
|
-
if ("object" != _typeof(i)) return i;
|
|
25
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
26
|
-
}
|
|
27
|
-
return ("string" === r ? String : Number)(t);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
32
|
-
function toPropertyKey(t) {
|
|
33
|
-
var i = toPrimitive(t, "string");
|
|
34
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
39
|
-
function _defineProperty(e, r, t) {
|
|
40
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
41
|
-
value: t,
|
|
42
|
-
enumerable: !0,
|
|
43
|
-
configurable: !0,
|
|
44
|
-
writable: !0
|
|
45
|
-
}) : e[r] = t, e;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
50
|
-
function __decorateParam(paramIndex, decorator) {
|
|
51
|
-
return function(target, key) {
|
|
52
|
-
decorator(target, key, paramIndex);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
58
|
-
function __decorate(decorators, target, key, desc) {
|
|
59
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
60
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
61
|
-
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;
|
|
62
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
6
|
//#region src/facade/f-document.ts
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
getSnapshot() {
|
|
85
|
-
const resources = this._resourceManagerService.getResourcesByType(this.id, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
86
|
-
const snapshot = this._documentDataModel.getSnapshot();
|
|
87
|
-
snapshot.resources = resources;
|
|
88
|
-
return snapshot;
|
|
89
|
-
}
|
|
90
|
-
undo() {
|
|
91
|
-
this._univerInstanceService.focusUnit(this.id);
|
|
92
|
-
return this._commandService.executeCommand(_univerjs_core.UndoCommand.id);
|
|
93
|
-
}
|
|
94
|
-
redo() {
|
|
95
|
-
this._univerInstanceService.focusUnit(this.id);
|
|
96
|
-
return this._commandService.executeCommand(_univerjs_core.RedoCommand.id);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Adds the specified text to the end of this text region.
|
|
100
|
-
* @param text - The text to be added to the end of this text region.
|
|
101
|
-
*/
|
|
102
|
-
appendText(text) {
|
|
103
|
-
const unitId = this.id;
|
|
104
|
-
const { body } = this.getSnapshot();
|
|
105
|
-
if (!body) throw new Error("The document body is empty");
|
|
106
|
-
const lastPosition = body.dataStream.length - 2;
|
|
107
|
-
const activeRange = {
|
|
108
|
-
startOffset: lastPosition,
|
|
109
|
-
endOffset: lastPosition,
|
|
110
|
-
collapsed: true,
|
|
111
|
-
segmentId: ""
|
|
112
|
-
};
|
|
113
|
-
const { segmentId } = activeRange;
|
|
114
|
-
return this._commandService.executeCommand(_univerjs_docs_ui.InsertCommand.id, {
|
|
115
|
-
unitId,
|
|
116
|
-
body: { dataStream: text },
|
|
117
|
-
range: activeRange,
|
|
118
|
-
segmentId
|
|
119
|
-
});
|
|
120
|
-
}
|
|
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 _univerjs_docs_facade.FDocument {
|
|
121
23
|
/**
|
|
122
24
|
* Sets the selection to a specified text range in the document.
|
|
123
25
|
* @param startOffset - The starting offset of the selection in the document.
|
|
124
26
|
* @param endOffset - The ending offset of the selection in the document.
|
|
125
27
|
* @example
|
|
126
28
|
* ```typescript
|
|
127
|
-
*
|
|
29
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
30
|
+
* fDocument.setSelection(10, 20);
|
|
128
31
|
* ```
|
|
129
32
|
*/
|
|
130
33
|
setSelection(startOffset, endOffset) {
|
|
131
|
-
var
|
|
132
|
-
const docSelectionRenderService = (
|
|
34
|
+
var _renderManagerService;
|
|
35
|
+
const docSelectionRenderService = (_renderManagerService = this._injector.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(this.getId())) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
133
36
|
docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.removeAllRanges();
|
|
134
37
|
docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.addDocRanges([{
|
|
135
38
|
startOffset,
|
|
@@ -138,38 +41,6 @@ let FDocument = class FDocument {
|
|
|
138
41
|
}], true);
|
|
139
42
|
}
|
|
140
43
|
};
|
|
141
|
-
FDocument
|
|
142
|
-
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
143
|
-
__decorateParam(2, _univerjs_core.IUniverInstanceService),
|
|
144
|
-
__decorateParam(3, _univerjs_core.ICommandService),
|
|
145
|
-
__decorateParam(4, _univerjs_core.IResourceManagerService),
|
|
146
|
-
__decorateParam(5, _univerjs_engine_render.IRenderManagerService)
|
|
147
|
-
], FDocument);
|
|
148
|
-
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region src/facade/f-univer.ts
|
|
151
|
-
var FUniverDocsUIMixin = class extends _univerjs_core_facade.FUniver {
|
|
152
|
-
createUniverDoc(data) {
|
|
153
|
-
const document = this._univerInstanceService.createUnit(_univerjs_core.UniverInstanceType.UNIVER_DOC, data);
|
|
154
|
-
return this._injector.createInstance(FDocument, document);
|
|
155
|
-
}
|
|
156
|
-
getActiveDocument() {
|
|
157
|
-
const document = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
158
|
-
if (!document) return null;
|
|
159
|
-
return this._injector.createInstance(FDocument, document);
|
|
160
|
-
}
|
|
161
|
-
getUniverDoc(id) {
|
|
162
|
-
const document = this._univerInstanceService.getUniverDocInstance(id);
|
|
163
|
-
if (!document) return null;
|
|
164
|
-
return this._injector.createInstance(FDocument, document);
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
_univerjs_core_facade.FUniver.extend(FUniverDocsUIMixin);
|
|
44
|
+
_univerjs_docs_facade.FDocument.extend(FDocumentUIMixin);
|
|
168
45
|
|
|
169
|
-
//#endregion
|
|
170
|
-
Object.defineProperty(exports, 'FDocument', {
|
|
171
|
-
enumerable: true,
|
|
172
|
-
get: function () {
|
|
173
|
-
return FDocument;
|
|
174
|
-
}
|
|
175
|
-
});
|
|
46
|
+
//#endregion
|