@univerjs/docs-ui 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -3
- package/lib/cjs/index.js +327 -495
- package/lib/cjs/locale/ar-SA.js +2 -2
- package/lib/cjs/locale/ca-ES.js +2 -2
- package/lib/cjs/locale/de-DE.js +2 -2
- package/lib/cjs/locale/en-US.js +2 -2
- package/lib/cjs/locale/es-ES.js +2 -2
- package/lib/cjs/locale/fa-IR.js +2 -2
- package/lib/cjs/locale/fr-FR.js +2 -2
- package/lib/cjs/locale/id-ID.js +2 -2
- package/lib/cjs/locale/it-IT.js +2 -2
- package/lib/cjs/locale/ja-JP.js +2 -2
- package/lib/cjs/locale/ko-KR.js +2 -2
- package/lib/cjs/locale/pl-PL.js +2 -2
- package/lib/cjs/locale/pt-BR.js +2 -2
- package/lib/cjs/locale/ru-RU.js +2 -2
- package/lib/cjs/locale/sk-SK.js +2 -2
- package/lib/cjs/locale/vi-VN.js +2 -2
- package/lib/cjs/locale/zh-CN.js +2 -2
- package/lib/cjs/locale/zh-HK.js +2 -2
- package/lib/cjs/locale/zh-TW.js +2 -2
- package/lib/es/facade.js +1 -2
- package/lib/es/index.js +327 -494
- package/lib/es/locale/ar-SA.js +2 -2
- package/lib/es/locale/ca-ES.js +2 -2
- package/lib/es/locale/de-DE.js +2 -2
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/es-ES.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/id-ID.js +2 -2
- package/lib/es/locale/it-IT.js +2 -2
- package/lib/es/locale/ja-JP.js +2 -2
- package/lib/es/locale/ko-KR.js +2 -2
- package/lib/es/locale/pl-PL.js +2 -2
- package/lib/es/locale/pt-BR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/sk-SK.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-HK.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/facade.js +1 -2
- package/lib/index.js +327 -494
- package/lib/locale/ar-SA.js +2 -2
- package/lib/locale/ca-ES.js +2 -2
- package/lib/locale/de-DE.js +2 -2
- package/lib/locale/en-US.js +2 -2
- package/lib/locale/es-ES.js +2 -2
- package/lib/locale/fa-IR.js +2 -2
- package/lib/locale/fr-FR.js +2 -2
- package/lib/locale/id-ID.js +2 -2
- package/lib/locale/it-IT.js +2 -2
- package/lib/locale/ja-JP.js +2 -2
- package/lib/locale/ko-KR.js +2 -2
- package/lib/locale/pl-PL.js +2 -2
- package/lib/locale/pt-BR.js +2 -2
- package/lib/locale/ru-RU.js +2 -2
- package/lib/locale/sk-SK.js +2 -2
- package/lib/locale/vi-VN.js +2 -2
- package/lib/locale/zh-CN.js +2 -2
- package/lib/locale/zh-HK.js +2 -2
- package/lib/locale/zh-TW.js +2 -2
- package/lib/types/commands/commands/doc-paragraph-setting.command.d.ts +1 -1
- package/lib/types/commands/commands/table/doc-table-create.command.d.ts +2 -2
- package/lib/types/controllers/components.controller.d.ts +0 -1
- package/lib/types/controllers/mobile/components.controller.d.ts +0 -1
- package/lib/types/locale/en-US.d.ts +1 -0
- package/lib/types/menu/mobile-schema.d.ts +5 -4
- package/lib/types/menu/paragraph-menu.d.ts +2 -2
- package/lib/types/services/clipboard/clipboard.service.d.ts +1 -1
- package/lib/types/services/clipboard/doc-paste-mutation-adapter.service.d.ts +1 -1
- package/lib/types/services/clipboard/paste-options.d.ts +6 -6
- package/lib/types/services/clipboard/udm-to-html/convertor.d.ts +1 -1
- package/lib/types/services/doc-render-background.d.ts +1 -1
- package/lib/types/services/editor/editor-manager.service.d.ts +1 -1
- package/lib/types/services/editor/editor.d.ts +1 -1
- package/lib/types/services/selection/text-range.d.ts +2 -2
- package/lib/types/views/header-footer/panel/DocHeaderFooterPanel.d.ts +1 -1
- package/lib/types/views/header-footer/panel/use-header-footer-options.d.ts +2 -2
- package/lib/types/views/paragraph-setting/ParagraphWordWrapSetting.d.ts +16 -0
- package/lib/types/views/paragraph-setting/hook/utils.d.ts +2 -2
- package/lib/types/views/rich-text-editor/hooks/use-resize.d.ts +1 -1
- package/lib/types/views/section-setting/use-section-setting.d.ts +13 -13
- package/lib/umd/index.js +16 -16
- 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 +16 -16
package/lib/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -25,7 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
enumerable: true
|
|
26
26
|
}) : target, mod));
|
|
27
27
|
|
|
28
|
-
//#endregion
|
|
29
28
|
let _univerjs_core = require("@univerjs/core");
|
|
30
29
|
let _univerjs_docs = require("@univerjs/docs");
|
|
31
30
|
let _univerjs_engine_render = require("@univerjs/engine-render");
|
|
@@ -40,7 +39,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
40
39
|
let _univerjs_icons = require("@univerjs/icons");
|
|
41
40
|
let _univerjs_drawing = require("@univerjs/drawing");
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
// src/basics/docs-view-key.ts
|
|
44
43
|
/**
|
|
45
44
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
46
45
|
*
|
|
@@ -74,8 +73,7 @@ const DOCS_COMPONENT_HEADER_LAYER_INDEX = 4;
|
|
|
74
73
|
const DOCS_COMPONENT_DEFAULT_Z_INDEX = 10;
|
|
75
74
|
const NORMAL_TEXT_SELECTION_PLUGIN_NAME = "normalTextSelectionPluginName";
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
//#region src/basics/component-tools.ts
|
|
76
|
+
// src/basics/component-tools.ts
|
|
79
77
|
function neoGetDocObject(renderContext) {
|
|
80
78
|
const { mainComponent, scene, engine, components } = renderContext;
|
|
81
79
|
return {
|
|
@@ -97,8 +95,7 @@ function getDocObjectById(unitId, renderManagerService) {
|
|
|
97
95
|
};
|
|
98
96
|
}
|
|
99
97
|
|
|
100
|
-
|
|
101
|
-
//#region src/basics/custom-decoration-factory.ts
|
|
98
|
+
// src/basics/custom-decoration-factory.ts
|
|
102
99
|
function addCustomDecorationFactory(param) {
|
|
103
100
|
const { unitId, ranges, id, type, segmentId } = param;
|
|
104
101
|
const doMutation = {
|
|
@@ -164,8 +161,7 @@ function deleteCustomDecorationFactory(accessor, params) {
|
|
|
164
161
|
return doMutation;
|
|
165
162
|
}
|
|
166
163
|
|
|
167
|
-
|
|
168
|
-
//#region src/basics/doc-custom-range-chrome.ts
|
|
164
|
+
// src/basics/doc-custom-range-chrome.ts
|
|
169
165
|
const DOC_CUSTOM_RANGE_CHROME_RADIUS = 1;
|
|
170
166
|
const DOC_CUSTOM_RANGE_CHROME_BACKGROUND_ALPHA = .07;
|
|
171
167
|
function resolveDocCustomRangeChromeTheme(themeService) {
|
|
@@ -187,8 +183,7 @@ function drawDocCustomRangeChrome(ctx, rect, theme) {
|
|
|
187
183
|
ctx.restore();
|
|
188
184
|
}
|
|
189
185
|
|
|
190
|
-
|
|
191
|
-
//#region src/basics/paragraph.ts
|
|
186
|
+
// src/basics/paragraph.ts
|
|
192
187
|
function isTopLevelStructuralGap(dataStream, offset) {
|
|
193
188
|
const previousToken = dataStream[offset - 1];
|
|
194
189
|
const nextToken = dataStream[offset];
|
|
@@ -269,8 +264,7 @@ function getCustomDecorationAtPosition(customDecorations, position) {
|
|
|
269
264
|
return customDecorations.filter((customDecoration) => position > customDecoration.startIndex && position <= customDecoration.endIndex);
|
|
270
265
|
}
|
|
271
266
|
|
|
272
|
-
|
|
273
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
267
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
274
268
|
function _typeof(o) {
|
|
275
269
|
"@babel/helpers - typeof";
|
|
276
270
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -280,8 +274,7 @@ function _typeof(o) {
|
|
|
280
274
|
}, _typeof(o);
|
|
281
275
|
}
|
|
282
276
|
|
|
283
|
-
|
|
284
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
277
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
285
278
|
function toPrimitive(t, r) {
|
|
286
279
|
if ("object" != _typeof(t) || !t) return t;
|
|
287
280
|
var e = t[Symbol.toPrimitive];
|
|
@@ -293,15 +286,13 @@ function toPrimitive(t, r) {
|
|
|
293
286
|
return ("string" === r ? String : Number)(t);
|
|
294
287
|
}
|
|
295
288
|
|
|
296
|
-
|
|
297
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
289
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
298
290
|
function toPropertyKey(t) {
|
|
299
291
|
var i = toPrimitive(t, "string");
|
|
300
292
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
301
293
|
}
|
|
302
294
|
|
|
303
|
-
|
|
304
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
295
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
305
296
|
function _defineProperty(e, r, t) {
|
|
306
297
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
307
298
|
value: t,
|
|
@@ -311,16 +302,14 @@ function _defineProperty(e, r, t) {
|
|
|
311
302
|
}) : e[r] = t, e;
|
|
312
303
|
}
|
|
313
304
|
|
|
314
|
-
|
|
315
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
305
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
316
306
|
function __decorateParam(paramIndex, decorator) {
|
|
317
307
|
return function(target, key) {
|
|
318
308
|
decorator(target, key, paramIndex);
|
|
319
309
|
};
|
|
320
310
|
}
|
|
321
311
|
|
|
322
|
-
|
|
323
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
312
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
324
313
|
function __decorate(decorators, target, key, desc) {
|
|
325
314
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
326
315
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -328,8 +317,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
328
317
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
329
318
|
}
|
|
330
319
|
|
|
331
|
-
|
|
332
|
-
//#region src/services/doc-auto-format.service.ts
|
|
320
|
+
// src/services/doc-auto-format.service.ts
|
|
333
321
|
let DocAutoFormatService = class DocAutoFormatService extends _univerjs_core.Disposable {
|
|
334
322
|
constructor(_univerInstanceService, _textSelectionManagerService) {
|
|
335
323
|
super();
|
|
@@ -376,8 +364,7 @@ let DocAutoFormatService = class DocAutoFormatService extends _univerjs_core.Dis
|
|
|
376
364
|
};
|
|
377
365
|
DocAutoFormatService = __decorate([__decorateParam(0, _univerjs_core.IUniverInstanceService), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_docs.DocSelectionManagerService))], DocAutoFormatService);
|
|
378
366
|
|
|
379
|
-
|
|
380
|
-
//#region src/commands/commands/auto-format.command.ts
|
|
367
|
+
// src/commands/commands/auto-format.command.ts
|
|
381
368
|
const TabCommandId = "doc.command.tab";
|
|
382
369
|
const TabCommand = {
|
|
383
370
|
id: TabCommandId,
|
|
@@ -405,8 +392,7 @@ const EnterCommand = {
|
|
|
405
392
|
}
|
|
406
393
|
};
|
|
407
394
|
|
|
408
|
-
|
|
409
|
-
//#region src/services/doc-menu-style.service.ts
|
|
395
|
+
// src/services/doc-menu-style.service.ts
|
|
410
396
|
const BODY_DEFAULT_FONTSIZE = 11;
|
|
411
397
|
const HEADER_FOOTER_DEFAULT_FONTSIZE = 9;
|
|
412
398
|
const DEFAULT_TEXT_STYLE = {
|
|
@@ -491,8 +477,7 @@ const SetDocInputStyleCommand = {
|
|
|
491
477
|
}
|
|
492
478
|
};
|
|
493
479
|
|
|
494
|
-
|
|
495
|
-
//#region src/commands/commands/break-line.command.ts
|
|
480
|
+
// src/commands/commands/break-line.command.ts
|
|
496
481
|
const BreakLineCommand = {
|
|
497
482
|
id: "doc.command.break-line",
|
|
498
483
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -651,8 +636,7 @@ const BreakLineCommand = {
|
|
|
651
636
|
}
|
|
652
637
|
};
|
|
653
638
|
|
|
654
|
-
|
|
655
|
-
//#region src/services/clipboard/doc-paste-mutation-adapter.service.ts
|
|
639
|
+
// src/services/clipboard/doc-paste-mutation-adapter.service.ts
|
|
656
640
|
const IDocClipboardPasteAdapterService = (0, _univerjs_core.createIdentifier)("doc.clipboard-paste-adapter.service");
|
|
657
641
|
var DocClipboardPasteAdapterService = class {
|
|
658
642
|
constructor() {
|
|
@@ -681,8 +665,7 @@ var DocClipboardPasteAdapterService = class {
|
|
|
681
665
|
}
|
|
682
666
|
};
|
|
683
667
|
|
|
684
|
-
|
|
685
|
-
//#region src/services/clipboard/internal-fragment.ts
|
|
668
|
+
// src/services/clipboard/internal-fragment.ts
|
|
686
669
|
const DOC_INTERNAL_FRAGMENT_MIME = "application/x-doc-fragment+json";
|
|
687
670
|
const DOC_INTERNAL_FRAGMENT_COMMENT_PREFIX = "univer-doc-fragment:";
|
|
688
671
|
function createInternalClipboardFragment(doc) {
|
|
@@ -957,8 +940,7 @@ function decodeBase64(value) {
|
|
|
957
940
|
return decodeURIComponent(escape(atob(value)));
|
|
958
941
|
}
|
|
959
942
|
|
|
960
|
-
|
|
961
|
-
//#region src/services/doc-render-background.ts
|
|
943
|
+
// src/services/doc-render-background.ts
|
|
962
944
|
const DOC_TRADITIONAL_WORKSPACE_BACKGROUND_COLOR = "var(--univer-gray-100)";
|
|
963
945
|
const DOC_MODERN_WORKSPACE_BACKGROUND_COLOR = "var(--univer-gray-0)";
|
|
964
946
|
const DOC_UNSPECIFIED_WORKSPACE_BACKGROUND_COLOR = "var(--univer-gray-100)";
|
|
@@ -998,8 +980,7 @@ function getDefaultDocCanvasBackgroundToken(documentFlavor) {
|
|
|
998
980
|
return documentFlavor === _univerjs_core.DocumentFlavor.MODERN ? DOC_MODERN_WORKSPACE_BACKGROUND_TOKEN : DOC_TRADITIONAL_WORKSPACE_BACKGROUND_TOKEN;
|
|
999
981
|
}
|
|
1000
982
|
|
|
1001
|
-
|
|
1002
|
-
//#region src/commands/util.ts
|
|
983
|
+
// src/commands/util.ts
|
|
1003
984
|
/**
|
|
1004
985
|
* Get the skeleton of the command's target.
|
|
1005
986
|
* @param accessor The injection accessor.
|
|
@@ -1010,8 +991,7 @@ function getCommandSkeleton(accessor, unitId) {
|
|
|
1010
991
|
return (_renderManagerService = accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(unitId)) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.with(_univerjs_docs.DocSkeletonManagerService);
|
|
1011
992
|
}
|
|
1012
993
|
|
|
1013
|
-
|
|
1014
|
-
//#region src/commands/commands/replace-content.command.ts
|
|
994
|
+
// src/commands/commands/replace-content.command.ts
|
|
1015
995
|
const ReplaceSnapshotCommand = {
|
|
1016
996
|
id: "doc.command-replace-snapshot",
|
|
1017
997
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -1231,8 +1211,7 @@ const ReplaceTextRunsCommand = {
|
|
|
1231
1211
|
}
|
|
1232
1212
|
};
|
|
1233
1213
|
|
|
1234
|
-
|
|
1235
|
-
//#region src/services/doc-embed-integration.service.ts
|
|
1214
|
+
// src/services/doc-embed-integration.service.ts
|
|
1236
1215
|
const DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE = "data-embed-interaction-boundary-owner";
|
|
1237
1216
|
var EmbedInteractionBoundaryService = class {
|
|
1238
1217
|
constructor() {
|
|
@@ -1313,8 +1292,7 @@ var EmbedRuntimeFocusCoordinator = class {
|
|
|
1313
1292
|
};
|
|
1314
1293
|
const IDocEmbedRuntimeFocusCoordinator = EmbedRuntimeFocusCoordinator;
|
|
1315
1294
|
|
|
1316
|
-
|
|
1317
|
-
//#region src/services/editor/editor-runtime-config.ts
|
|
1295
|
+
// src/services/editor/editor-runtime-config.ts
|
|
1318
1296
|
const configs = /* @__PURE__ */ new WeakMap();
|
|
1319
1297
|
function registerEditorRuntimeConfig(model, config) {
|
|
1320
1298
|
const registration = { config };
|
|
@@ -1330,8 +1308,7 @@ function getEditorRuntimeConfig(model) {
|
|
|
1330
1308
|
return (_configs$get = configs.get(model)) === null || _configs$get === void 0 ? void 0 : _configs$get.config;
|
|
1331
1309
|
}
|
|
1332
1310
|
|
|
1333
|
-
|
|
1334
|
-
//#region src/services/selection/convert-text-range.ts
|
|
1311
|
+
// src/services/selection/convert-text-range.ts
|
|
1335
1312
|
function findDocRangeNodePositions(skeleton, startIndex, endIndex, segmentId = "", pageIndex = -1) {
|
|
1336
1313
|
var _skeleton$getViewMode, _skeleton$getViewMode2, _skeleton$getViewMode3, _skeleton$getViewMode4, _skeleton$getViewMode5, _skeleton$getViewMode6;
|
|
1337
1314
|
const dataStream = (_skeleton$getViewMode = skeleton.getViewModel) === null || _skeleton$getViewMode === void 0 || (_skeleton$getViewMode3 = (_skeleton$getViewMode2 = _skeleton$getViewMode.call(skeleton)).getDataModel) === null || _skeleton$getViewMode3 === void 0 || (_skeleton$getViewMode5 = (_skeleton$getViewMode4 = _skeleton$getViewMode3.call(_skeleton$getViewMode2)).getSelfOrHeaderFooterModel) === null || _skeleton$getViewMode5 === void 0 || (_skeleton$getViewMode5 = _skeleton$getViewMode5.call(_skeleton$getViewMode4, segmentId)) === null || _skeleton$getViewMode5 === void 0 || (_skeleton$getViewMode6 = _skeleton$getViewMode5.getBody) === null || _skeleton$getViewMode6 === void 0 || (_skeleton$getViewMode6 = _skeleton$getViewMode6.call(_skeleton$getViewMode5)) === null || _skeleton$getViewMode6 === void 0 ? void 0 : _skeleton$getViewMode6.dataStream;
|
|
@@ -1896,8 +1873,7 @@ function getDocumentUnitId$1(docSkeleton) {
|
|
|
1896
1873
|
return ((_viewModel$getDataMod = viewModel.getDataModel) === null || _viewModel$getDataMod === void 0 || (_viewModel$getDataMod3 = (_viewModel$getDataMod2 = _viewModel$getDataMod.call(viewModel)).getUnitId) === null || _viewModel$getDataMod3 === void 0 ? void 0 : _viewModel$getDataMod3.call(_viewModel$getDataMod2)) ?? "";
|
|
1897
1874
|
}
|
|
1898
1875
|
|
|
1899
|
-
|
|
1900
|
-
//#region src/services/selection/convert-rect-range.ts
|
|
1876
|
+
// src/services/selection/convert-rect-range.ts
|
|
1901
1877
|
function isValidRectRange(anchorNodePosition, focusNodePosition) {
|
|
1902
1878
|
const { path: anchorPath } = anchorNodePosition;
|
|
1903
1879
|
const { path: focusPath } = focusNodePosition;
|
|
@@ -2306,8 +2282,7 @@ function rangesEqual(left, right) {
|
|
|
2306
2282
|
return left.startRowIndex === right.startRowIndex && left.endRowIndex === right.endRowIndex && left.startColumnIndex === right.startColumnIndex && left.endColumnIndex === right.endColumnIndex;
|
|
2307
2283
|
}
|
|
2308
2284
|
|
|
2309
|
-
|
|
2310
|
-
//#region src/services/selection/text-range.ts
|
|
2285
|
+
// src/services/selection/text-range.ts
|
|
2311
2286
|
const TEXT_RANGE_KEY_PREFIX = "__TestSelectionRange__";
|
|
2312
2287
|
const TEXT_ANCHOR_KEY_PREFIX = "__TestSelectionAnchor__";
|
|
2313
2288
|
const ID_LENGTH$2 = 6;
|
|
@@ -2662,8 +2637,7 @@ var TextRange = class {
|
|
|
2662
2637
|
}
|
|
2663
2638
|
};
|
|
2664
2639
|
|
|
2665
|
-
|
|
2666
|
-
//#region src/services/selection/rect-range.ts
|
|
2640
|
+
// src/services/selection/rect-range.ts
|
|
2667
2641
|
const RECT_RANGE_KEY_PREFIX = "__DocTableRectRange__";
|
|
2668
2642
|
const ID_LENGTH$1 = 6;
|
|
2669
2643
|
function convertPositionsToRectRanges(scene, document, docSkeleton, anchorNodePosition, focusNodePosition, style = _univerjs_engine_render.NORMAL_TEXT_SELECTION_PLUGIN_STYLE, segmentId = "", segmentPage = -1) {
|
|
@@ -2832,8 +2806,7 @@ var RectRange = class {
|
|
|
2832
2806
|
}
|
|
2833
2807
|
};
|
|
2834
2808
|
|
|
2835
|
-
|
|
2836
|
-
//#region src/services/selection/selection-utils.ts
|
|
2809
|
+
// src/services/selection/selection-utils.ts
|
|
2837
2810
|
function disposeRangeList({ textRanges, rectRanges }) {
|
|
2838
2811
|
textRanges.forEach((range) => range.dispose());
|
|
2839
2812
|
rectRanges.forEach((range) => range.dispose());
|
|
@@ -3183,8 +3156,7 @@ function serializeRectRange(rectRange) {
|
|
|
3183
3156
|
};
|
|
3184
3157
|
}
|
|
3185
3158
|
|
|
3186
|
-
|
|
3187
|
-
//#region src/services/selection/word-boundary.ts
|
|
3159
|
+
// src/services/selection/word-boundary.ts
|
|
3188
3160
|
/**
|
|
3189
3161
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3190
3162
|
*
|
|
@@ -3247,8 +3219,7 @@ function getNextWordBoundaryOffset(content, nodeIndex, paragraphStartOffset, dir
|
|
|
3247
3219
|
return null;
|
|
3248
3220
|
}
|
|
3249
3221
|
|
|
3250
|
-
|
|
3251
|
-
//#region src/services/selection/doc-selection-render.service.ts
|
|
3222
|
+
// src/services/selection/doc-selection-render.service.ts
|
|
3252
3223
|
let DocSelectionRenderService = class DocSelectionRenderService extends _univerjs_core.RxDisposable {
|
|
3253
3224
|
get hasPendingSelection() {
|
|
3254
3225
|
return this._getPendingSelection() != null;
|
|
@@ -3565,6 +3536,7 @@ let DocSelectionRenderService = class DocSelectionRenderService extends _univerj
|
|
|
3565
3536
|
return this._getOwnerDocument().activeElement === this._input;
|
|
3566
3537
|
}
|
|
3567
3538
|
focus() {
|
|
3539
|
+
this._ensureHostContainer();
|
|
3568
3540
|
if (!this._input.hasAttribute("tabindex")) this._input.tabIndex = -1;
|
|
3569
3541
|
this._input.focus({ preventScroll: true });
|
|
3570
3542
|
}
|
|
@@ -4348,8 +4320,7 @@ DocSelectionRenderService = __decorate([
|
|
|
4348
4320
|
__decorateParam(8, (0, _univerjs_core.Optional)(IDocEmbedRuntimeFocusCoordinator))
|
|
4349
4321
|
], DocSelectionRenderService);
|
|
4350
4322
|
|
|
4351
|
-
|
|
4352
|
-
//#region src/services/editor/editor.ts
|
|
4323
|
+
// src/services/editor/editor.ts
|
|
4353
4324
|
var Editor = class extends _univerjs_core.Disposable {
|
|
4354
4325
|
constructor(_param, _univerInstanceService, _docSelectionManagerService, _commandService, _undoRedoService, _injector) {
|
|
4355
4326
|
super();
|
|
@@ -4578,8 +4549,7 @@ var Editor = class extends _univerjs_core.Disposable {
|
|
|
4578
4549
|
}
|
|
4579
4550
|
};
|
|
4580
4551
|
|
|
4581
|
-
|
|
4582
|
-
//#region src/services/editor/editor-manager.service.ts
|
|
4552
|
+
// src/services/editor/editor-manager.service.ts
|
|
4583
4553
|
/**
|
|
4584
4554
|
* Not these elements will be considered as editor blur.
|
|
4585
4555
|
*/
|
|
@@ -4812,8 +4782,7 @@ EditorService = __decorate([
|
|
|
4812
4782
|
], EditorService);
|
|
4813
4783
|
const IEditorService = (0, _univerjs_core.createIdentifier)("univer.editor.service");
|
|
4814
4784
|
|
|
4815
|
-
|
|
4816
|
-
//#region src/commands/commands/table/table.ts
|
|
4785
|
+
// src/commands/commands/table/table.ts
|
|
4817
4786
|
function genEmptyTable(rowCount, colCount) {
|
|
4818
4787
|
let dataStream = _univerjs_core.DataStreamTreeTokenType.TABLE_START;
|
|
4819
4788
|
const paragraphs = [];
|
|
@@ -5226,8 +5195,7 @@ function getCellOffsets(viewModel, range, position) {
|
|
|
5226
5195
|
}
|
|
5227
5196
|
}
|
|
5228
5197
|
|
|
5229
|
-
|
|
5230
|
-
//#region src/commands/commands/clipboard.inner.command.ts
|
|
5198
|
+
// src/commands/commands/clipboard.inner.command.ts
|
|
5231
5199
|
function hasRangeInTable(ranges) {
|
|
5232
5200
|
return ranges.some((range) => {
|
|
5233
5201
|
const { startNodePosition } = range;
|
|
@@ -5790,15 +5758,13 @@ const CutContentCommand = {
|
|
|
5790
5758
|
}
|
|
5791
5759
|
};
|
|
5792
5760
|
|
|
5793
|
-
|
|
5794
|
-
//#region src/utils/horizontal-line.ts
|
|
5761
|
+
// src/utils/horizontal-line.ts
|
|
5795
5762
|
function isHorizontalLineParagraph(dataStream, paragraph) {
|
|
5796
5763
|
const paragraphStyle = paragraph === null || paragraph === void 0 ? void 0 : paragraph.paragraphStyle;
|
|
5797
5764
|
return Array.from(dataStream).every((token) => token === _univerjs_core.DataStreamTreeTokenType.PARAGRAPH || token === _univerjs_core.DataStreamTreeTokenType.SECTION_BREAK) && (paragraphStyle === null || paragraphStyle === void 0 ? void 0 : paragraphStyle.borderBottom) != null && paragraphStyle.borderTop == null && paragraphStyle.borderLeft == null && paragraphStyle.borderRight == null && paragraphStyle.borderBetween == null;
|
|
5798
5765
|
}
|
|
5799
5766
|
|
|
5800
|
-
|
|
5801
|
-
//#region src/commands/operations/doc-cursor.operation.ts
|
|
5767
|
+
// src/commands/operations/doc-cursor.operation.ts
|
|
5802
5768
|
/**
|
|
5803
5769
|
* The operation to move cursor in the current document.
|
|
5804
5770
|
*/
|
|
@@ -5822,8 +5788,7 @@ const MoveSelectionOperation = {
|
|
|
5822
5788
|
}
|
|
5823
5789
|
};
|
|
5824
5790
|
|
|
5825
|
-
|
|
5826
|
-
//#region src/commands/commands/format-painter.command.ts
|
|
5791
|
+
// src/commands/commands/format-painter.command.ts
|
|
5827
5792
|
function captureTextFormat(body, range, defaultStyle = {}, lists = {}, document = { documentStyle: {} }) {
|
|
5828
5793
|
var _body$paragraphs, _document$documentSty;
|
|
5829
5794
|
const offset = range.startOffset === range.endOffset ? Math.max(0, range.startOffset - 1) : range.startOffset;
|
|
@@ -5989,8 +5954,7 @@ const ApplyTextFormatPainterCommand = {
|
|
|
5989
5954
|
}
|
|
5990
5955
|
};
|
|
5991
5956
|
|
|
5992
|
-
|
|
5993
|
-
//#region src/commands/commands/util.ts
|
|
5957
|
+
// src/commands/commands/util.ts
|
|
5994
5958
|
function getCurrentParagraph(accessor) {
|
|
5995
5959
|
var _doc$getBody, _doc$getBody2;
|
|
5996
5960
|
const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
@@ -6000,8 +5964,7 @@ function getCurrentParagraph(accessor) {
|
|
|
6000
5964
|
return _univerjs_core.BuildTextUtils.range.getParagraphsInRange(range, ((_doc$getBody = doc.getBody()) === null || _doc$getBody === void 0 ? void 0 : _doc$getBody.paragraphs) ?? [], ((_doc$getBody2 = doc.getBody()) === null || _doc$getBody2 === void 0 ? void 0 : _doc$getBody2.dataStream) ?? "")[0];
|
|
6001
5965
|
}
|
|
6002
5966
|
|
|
6003
|
-
|
|
6004
|
-
//#region src/commands/commands/doc-delete.command.ts
|
|
5967
|
+
// src/commands/commands/doc-delete.command.ts
|
|
6005
5968
|
const DeleteCustomBlockCommand = {
|
|
6006
5969
|
id: "doc.command.delete-custom-block",
|
|
6007
5970
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -6634,8 +6597,7 @@ const DeleteCurrentParagraphCommand = {
|
|
|
6634
6597
|
}
|
|
6635
6598
|
};
|
|
6636
6599
|
|
|
6637
|
-
|
|
6638
|
-
//#region src/commands/commands/inline-format.command.ts
|
|
6600
|
+
// src/commands/commands/inline-format.command.ts
|
|
6639
6601
|
function handleInlineFormat(preCommandId, params, commandService) {
|
|
6640
6602
|
return commandService.executeCommand(SetInlineFormatCommand.id, {
|
|
6641
6603
|
preCommandId,
|
|
@@ -6987,8 +6949,7 @@ function getReverseFormatValueInSelection(textStyle, preCommandId) {
|
|
|
6987
6949
|
return getReverseFormatValue(textStyle, key, preCommandId);
|
|
6988
6950
|
}
|
|
6989
6951
|
|
|
6990
|
-
|
|
6991
|
-
//#region src/services/clipboard/copy-content-cache.ts
|
|
6952
|
+
// src/services/clipboard/copy-content-cache.ts
|
|
6992
6953
|
const COPY_CONTENT_CACHE_LIMIT = 10;
|
|
6993
6954
|
function extractId(html) {
|
|
6994
6955
|
const match = html.match(/data-copy-id="([^\s]+)"/);
|
|
@@ -7011,8 +6972,7 @@ var CopyContentCache = class {
|
|
|
7011
6972
|
};
|
|
7012
6973
|
const copyContentCache = new CopyContentCache();
|
|
7013
6974
|
|
|
7014
|
-
|
|
7015
|
-
//#region src/services/clipboard/html-to-udm/parse-node-style.ts
|
|
6975
|
+
// src/services/clipboard/html-to-udm/parse-node-style.ts
|
|
7016
6976
|
function extractNodeStyle(node) {
|
|
7017
6977
|
const styles = node.style;
|
|
7018
6978
|
const docStyles = {};
|
|
@@ -7078,8 +7038,7 @@ function extractNodeStyle(node) {
|
|
|
7078
7038
|
return docStyles;
|
|
7079
7039
|
}
|
|
7080
7040
|
|
|
7081
|
-
|
|
7082
|
-
//#region src/services/clipboard/html-to-udm/parse-to-dom.ts
|
|
7041
|
+
// src/services/clipboard/html-to-udm/parse-to-dom.ts
|
|
7083
7042
|
/**
|
|
7084
7043
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
7085
7044
|
*
|
|
@@ -7101,8 +7060,7 @@ function parseToDom(rawHtml) {
|
|
|
7101
7060
|
return parser.parseFromString(html, "text/html").querySelector("#univer-root");
|
|
7102
7061
|
}
|
|
7103
7062
|
|
|
7104
|
-
|
|
7105
|
-
//#region src/services/clipboard/html-to-udm/converter.ts
|
|
7063
|
+
// src/services/clipboard/html-to-udm/converter.ts
|
|
7106
7064
|
function matchFilter(node, filter) {
|
|
7107
7065
|
const tagName = node.tagName.toLowerCase();
|
|
7108
7066
|
if (typeof filter === "string") return tagName === filter;
|
|
@@ -7846,8 +7804,7 @@ function stripListMarkerFromCurrentParagraph(body) {
|
|
|
7846
7804
|
return length;
|
|
7847
7805
|
}
|
|
7848
7806
|
|
|
7849
|
-
|
|
7850
|
-
//#region src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
|
|
7807
|
+
// src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
|
|
7851
7808
|
const LarkPastePlugin = {
|
|
7852
7809
|
name: "univer-doc-paste-plugin-lark",
|
|
7853
7810
|
checkPasteType(html) {
|
|
@@ -7879,8 +7836,7 @@ const LarkPastePlugin = {
|
|
|
7879
7836
|
}]
|
|
7880
7837
|
};
|
|
7881
7838
|
|
|
7882
|
-
|
|
7883
|
-
//#region src/services/clipboard/html-to-udm/utils.ts
|
|
7839
|
+
// src/services/clipboard/html-to-udm/utils.ts
|
|
7884
7840
|
function getParagraphStyle(el) {
|
|
7885
7841
|
const styles = el.style;
|
|
7886
7842
|
const paragraphStyle = {};
|
|
@@ -7921,8 +7877,7 @@ function getHorizontalAlign(value) {
|
|
|
7921
7877
|
}
|
|
7922
7878
|
}
|
|
7923
7879
|
|
|
7924
|
-
|
|
7925
|
-
//#region src/services/clipboard/html-to-udm/paste-plugins/plugin-univer.ts
|
|
7880
|
+
// src/services/clipboard/html-to-udm/paste-plugins/plugin-univer.ts
|
|
7926
7881
|
const UniverPastePlugin = {
|
|
7927
7882
|
name: "univer-doc-paste-plugin-univer",
|
|
7928
7883
|
checkPasteType(html) {
|
|
@@ -7948,8 +7903,7 @@ const UniverPastePlugin = {
|
|
|
7948
7903
|
}]
|
|
7949
7904
|
};
|
|
7950
7905
|
|
|
7951
|
-
|
|
7952
|
-
//#region src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
|
|
7906
|
+
// src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
|
|
7953
7907
|
const WORD_SPACE_PLACEHOLDER_ENTITY = "";
|
|
7954
7908
|
const WORD_TAB_WIDTH = 4;
|
|
7955
7909
|
const WordPastePlugin = {
|
|
@@ -8011,8 +7965,7 @@ function countWordSpaces(content) {
|
|
|
8011
7965
|
return ((_text$replace$match = text.replace(/\r?\n/g, "").match(/ /g)) === null || _text$replace$match === void 0 ? void 0 : _text$replace$match.length) ?? 0;
|
|
8012
7966
|
}
|
|
8013
7967
|
|
|
8014
|
-
|
|
8015
|
-
//#region src/services/clipboard/paste-options.ts
|
|
7968
|
+
// src/services/clipboard/paste-options.ts
|
|
8016
7969
|
const DOC_PASTE_OPTIONS = [
|
|
8017
7970
|
{
|
|
8018
7971
|
value: "source",
|
|
@@ -8078,8 +8031,7 @@ function applyDocPasteMode(source, mode, style, text) {
|
|
|
8078
8031
|
return doc;
|
|
8079
8032
|
}
|
|
8080
8033
|
|
|
8081
|
-
|
|
8082
|
-
//#region src/services/clipboard/udm-to-html/convertor.ts
|
|
8034
|
+
// src/services/clipboard/udm-to-html/convertor.ts
|
|
8083
8035
|
const DEFAULT_CLIPBOARD_FONT_FAMILY = "Arial";
|
|
8084
8036
|
function stripFieldBoundaryMarkers(value) {
|
|
8085
8037
|
return value.replaceAll("", "").replaceAll("", "");
|
|
@@ -8519,8 +8471,7 @@ var UDMToHtmlService = class {
|
|
|
8519
8471
|
}
|
|
8520
8472
|
};
|
|
8521
8473
|
|
|
8522
|
-
|
|
8523
|
-
//#region src/services/clipboard/udm-to-html/doc-html-export.service.ts
|
|
8474
|
+
// src/services/clipboard/udm-to-html/doc-html-export.service.ts
|
|
8524
8475
|
var DocHtmlExportService = class extends _univerjs_core.Disposable {
|
|
8525
8476
|
constructor(..._args) {
|
|
8526
8477
|
super(..._args);
|
|
@@ -8535,8 +8486,7 @@ var DocHtmlExportService = class extends _univerjs_core.Disposable {
|
|
|
8535
8486
|
}
|
|
8536
8487
|
};
|
|
8537
8488
|
|
|
8538
|
-
|
|
8539
|
-
//#region src/services/clipboard/clipboard.service.ts
|
|
8489
|
+
// src/services/clipboard/clipboard.service.ts
|
|
8540
8490
|
HtmlToUDMService.use(LarkPastePlugin);
|
|
8541
8491
|
HtmlToUDMService.use(UniverPastePlugin);
|
|
8542
8492
|
HtmlToUDMService.use(WordPastePlugin);
|
|
@@ -9329,8 +9279,7 @@ function dataUrlToFile(dataUrl, fallbackName) {
|
|
|
9329
9279
|
return new File([bytes], `${fallbackName}.${extension}`, { type: mimeType });
|
|
9330
9280
|
}
|
|
9331
9281
|
|
|
9332
|
-
|
|
9333
|
-
//#region src/commands/commands/clipboard.command.ts
|
|
9282
|
+
// src/commands/commands/clipboard.command.ts
|
|
9334
9283
|
function whenDocOrEditor(contextService) {
|
|
9335
9284
|
return contextService.getContextValue(_univerjs_core.FOCUSING_DOC) || contextService.getContextValue(_univerjs_core.EDITOR_ACTIVATED);
|
|
9336
9285
|
}
|
|
@@ -9441,8 +9390,7 @@ const DocChangePasteModeCommand = {
|
|
|
9441
9390
|
}
|
|
9442
9391
|
};
|
|
9443
9392
|
|
|
9444
|
-
|
|
9445
|
-
//#region src/commands/commands/doc-block-move.command.ts
|
|
9393
|
+
// src/commands/commands/doc-block-move.command.ts
|
|
9446
9394
|
const DOC_BLOCK_MOVE_BODY_PATCH_KEYS = [
|
|
9447
9395
|
"paragraphs",
|
|
9448
9396
|
"sectionBreaks",
|
|
@@ -9713,8 +9661,7 @@ function clamp$1(value, min, max) {
|
|
|
9713
9661
|
return Math.min(Math.max(value, min), max);
|
|
9714
9662
|
}
|
|
9715
9663
|
|
|
9716
|
-
|
|
9717
|
-
//#region src/commands/commands/doc-horizontal-line.command.ts
|
|
9664
|
+
// src/commands/commands/doc-horizontal-line.command.ts
|
|
9718
9665
|
const HorizontalLineCommand = {
|
|
9719
9666
|
id: "doc.command.horizontal-line",
|
|
9720
9667
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -9759,8 +9706,7 @@ const InsertHorizontalLineBellowCommand = {
|
|
|
9759
9706
|
}
|
|
9760
9707
|
};
|
|
9761
9708
|
|
|
9762
|
-
|
|
9763
|
-
//#region src/commands/commands/doc-select-all.command.ts
|
|
9709
|
+
// src/commands/commands/doc-select-all.command.ts
|
|
9764
9710
|
const DocSelectAllCommand = {
|
|
9765
9711
|
id: "doc.command.select-all",
|
|
9766
9712
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -9992,8 +9938,7 @@ function getRangeType(range) {
|
|
|
9992
9938
|
return range.rangeType ?? _univerjs_core.DOC_RANGE_TYPE.TEXT;
|
|
9993
9939
|
}
|
|
9994
9940
|
|
|
9995
|
-
|
|
9996
|
-
//#region src/services/doc-ime-input-manager.service.ts
|
|
9941
|
+
// src/services/doc-ime-input-manager.service.ts
|
|
9997
9942
|
var DocIMEInputManagerService = class extends _univerjs_core.RxDisposable {
|
|
9998
9943
|
constructor(_context) {
|
|
9999
9944
|
super();
|
|
@@ -10090,8 +10035,7 @@ var DocIMEInputManagerService = class extends _univerjs_core.RxDisposable {
|
|
|
10090
10035
|
}
|
|
10091
10036
|
};
|
|
10092
10037
|
|
|
10093
|
-
|
|
10094
|
-
//#region src/commands/commands/ime-input.command.ts
|
|
10038
|
+
// src/commands/commands/ime-input.command.ts
|
|
10095
10039
|
const IMEInputCommand = {
|
|
10096
10040
|
id: "doc.command.ime-input",
|
|
10097
10041
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -10244,8 +10188,7 @@ function isRectRange(range) {
|
|
|
10244
10188
|
return "tableId" in range;
|
|
10245
10189
|
}
|
|
10246
10190
|
|
|
10247
|
-
|
|
10248
|
-
//#region src/commands/commands/insert-custom-range.command.ts
|
|
10191
|
+
// src/commands/commands/insert-custom-range.command.ts
|
|
10249
10192
|
const InsertCustomRangeCommand = {
|
|
10250
10193
|
id: "doc.command.insert-custom-range",
|
|
10251
10194
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -10273,8 +10216,7 @@ const InsertCustomRangeCommand = {
|
|
|
10273
10216
|
}
|
|
10274
10217
|
};
|
|
10275
10218
|
|
|
10276
|
-
|
|
10277
|
-
//#region src/commands/commands/list.command.ts
|
|
10219
|
+
// src/commands/commands/list.command.ts
|
|
10278
10220
|
const ListOperationCommand = {
|
|
10279
10221
|
id: "doc.command.list-operation",
|
|
10280
10222
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -10648,8 +10590,7 @@ const InsertCheckListBellowCommand = {
|
|
|
10648
10590
|
}
|
|
10649
10591
|
};
|
|
10650
10592
|
|
|
10651
|
-
|
|
10652
|
-
//#region src/commands/commands/paragraph-align.command.ts
|
|
10593
|
+
// src/commands/commands/paragraph-align.command.ts
|
|
10653
10594
|
const AlignOperationCommand = {
|
|
10654
10595
|
id: "doc.command.align-action",
|
|
10655
10596
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -10746,8 +10687,7 @@ const AlignJustifyCommand = {
|
|
|
10746
10687
|
}
|
|
10747
10688
|
};
|
|
10748
10689
|
|
|
10749
|
-
|
|
10750
|
-
//#region src/commands/operations/set-doc-zoom-ratio.operation.ts
|
|
10690
|
+
// src/commands/operations/set-doc-zoom-ratio.operation.ts
|
|
10751
10691
|
const SetDocZoomRatioUndoMutationFactory = (accessor, params) => {
|
|
10752
10692
|
const documentModel = accessor.get(_univerjs_core.IUniverInstanceService).getUnit(params.unitId, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
10753
10693
|
documentModel === null || documentModel === void 0 || documentModel.setZoomRatio(params.zoomRatio);
|
|
@@ -10764,8 +10704,7 @@ const SetDocZoomRatioOperation = {
|
|
|
10764
10704
|
}
|
|
10765
10705
|
};
|
|
10766
10706
|
|
|
10767
|
-
|
|
10768
|
-
//#region src/commands/commands/set-doc-zoom-ratio.command.ts
|
|
10707
|
+
// src/commands/commands/set-doc-zoom-ratio.command.ts
|
|
10769
10708
|
const SetDocZoomRatioCommand = {
|
|
10770
10709
|
type: _univerjs_core.CommandType.COMMAND,
|
|
10771
10710
|
id: "doc.command.set-zoom-ratio",
|
|
@@ -10800,8 +10739,7 @@ const SetDocZoomRatioCommand = {
|
|
|
10800
10739
|
}
|
|
10801
10740
|
};
|
|
10802
10741
|
|
|
10803
|
-
|
|
10804
|
-
//#region src/commands/commands/set-heading.command.ts
|
|
10742
|
+
// src/commands/commands/set-heading.command.ts
|
|
10805
10743
|
function namedStyleToOutlineLevel(namedStyleType) {
|
|
10806
10744
|
if (namedStyleType >= _univerjs_core.NamedStyleType.HEADING_1 && namedStyleType <= _univerjs_core.NamedStyleType.HEADING_5) return namedStyleType - _univerjs_core.NamedStyleType.HEADING_1;
|
|
10807
10745
|
}
|
|
@@ -11022,8 +10960,7 @@ const SubtitleHeadingCommand = {
|
|
|
11022
10960
|
}
|
|
11023
10961
|
};
|
|
11024
10962
|
|
|
11025
|
-
|
|
11026
|
-
//#region src/commands/commands/switch-doc-mode.command.ts
|
|
10963
|
+
// src/commands/commands/switch-doc-mode.command.ts
|
|
11027
10964
|
const SwitchDocModeCommand = {
|
|
11028
10965
|
id: "doc.command.switch-mode",
|
|
11029
10966
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -11102,8 +11039,7 @@ const SwitchDocModeCommand = {
|
|
|
11102
11039
|
}
|
|
11103
11040
|
};
|
|
11104
11041
|
|
|
11105
|
-
|
|
11106
|
-
//#region src/commands/commands/table/doc-table-create.command.ts
|
|
11042
|
+
// src/commands/commands/table/doc-table-create.command.ts
|
|
11107
11043
|
const CreateDocTableCommandId = "doc.command.create-table";
|
|
11108
11044
|
function buildDocTableInsertBody(params) {
|
|
11109
11045
|
const { tableDataStream, tableParagraphs, sectionBreaks, tableId, textRun } = params;
|
|
@@ -11248,8 +11184,7 @@ const CreateDocTableCommand = {
|
|
|
11248
11184
|
}
|
|
11249
11185
|
};
|
|
11250
11186
|
|
|
11251
|
-
|
|
11252
|
-
//#region src/commands/commands/table/doc-table-delete.command.ts
|
|
11187
|
+
// src/commands/commands/table/doc-table-delete.command.ts
|
|
11253
11188
|
const DocTableDeleteRowsCommand = {
|
|
11254
11189
|
id: "doc.table.delete-rows",
|
|
11255
11190
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -11462,8 +11397,7 @@ const DocTableDeleteTableCommand = {
|
|
|
11462
11397
|
}
|
|
11463
11398
|
};
|
|
11464
11399
|
|
|
11465
|
-
|
|
11466
|
-
//#region src/commands/commands/table/doc-table-insert.command.ts
|
|
11400
|
+
// src/commands/commands/table/doc-table-insert.command.ts
|
|
11467
11401
|
const DocTableInsertRowCommandId = "doc.command.table-insert-row";
|
|
11468
11402
|
const DocTableInsertColumnCommandId = "doc.command.table-insert-column";
|
|
11469
11403
|
const DocTableInsertRowAboveCommandId = "doc.command.table-insert-row-above";
|
|
@@ -11675,8 +11609,7 @@ const DocTableInsertColumnCommand = {
|
|
|
11675
11609
|
}
|
|
11676
11610
|
};
|
|
11677
11611
|
|
|
11678
|
-
|
|
11679
|
-
//#region src/commands/commands/table/doc-table-tab.command.ts
|
|
11612
|
+
// src/commands/commands/table/doc-table-tab.command.ts
|
|
11680
11613
|
const DocTableTabCommand = {
|
|
11681
11614
|
id: "doc.table.tab-in-table",
|
|
11682
11615
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -11711,8 +11644,7 @@ const DocTableTabCommand = {
|
|
|
11711
11644
|
}
|
|
11712
11645
|
};
|
|
11713
11646
|
|
|
11714
|
-
|
|
11715
|
-
//#region src/views/table/create/component-name.ts
|
|
11647
|
+
// src/views/table/create/component-name.ts
|
|
11716
11648
|
/**
|
|
11717
11649
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
11718
11650
|
*
|
|
@@ -11730,8 +11662,7 @@ const DocTableTabCommand = {
|
|
|
11730
11662
|
*/
|
|
11731
11663
|
const COMPONENT_DOC_CREATE_TABLE_CONFIRM = "COMPONENT_DOC_CREATE_TABLE_CONFIRM";
|
|
11732
11664
|
|
|
11733
|
-
|
|
11734
|
-
//#region src/commands/operations/doc-create-table.operation.ts
|
|
11665
|
+
// src/commands/operations/doc-create-table.operation.ts
|
|
11735
11666
|
const COMPONENT_DOC_CREATE_TABLE_CONFIRM_ID = "doc.component.create-table-confirm";
|
|
11736
11667
|
const DocCreateTableOperation = {
|
|
11737
11668
|
id: "doc.operation.create-table",
|
|
@@ -11771,8 +11702,7 @@ const DocCreateTableOperation = {
|
|
|
11771
11702
|
}
|
|
11772
11703
|
};
|
|
11773
11704
|
|
|
11774
|
-
|
|
11775
|
-
//#region src/config/config.ts
|
|
11705
|
+
// src/config/config.ts
|
|
11776
11706
|
const DOCS_UI_PLUGIN_CONFIG_KEY = "docs-ui.config";
|
|
11777
11707
|
const DOCS_UI_PLUGIN_NAME = "DOC_UI_PLUGIN";
|
|
11778
11708
|
const configSymbol = Symbol(DOCS_UI_PLUGIN_CONFIG_KEY);
|
|
@@ -11801,8 +11731,7 @@ const defaultPluginMobileConfig = {
|
|
|
11801
11731
|
}
|
|
11802
11732
|
};
|
|
11803
11733
|
|
|
11804
|
-
|
|
11805
|
-
//#region src/controllers/render-controllers/back-scroll.render-controller.ts
|
|
11734
|
+
// src/controllers/render-controllers/back-scroll.render-controller.ts
|
|
11806
11735
|
const ANCHOR_WIDTH = 1.5;
|
|
11807
11736
|
const MAX_SELECTION_SCROLL_RETRY_FRAMES = 6e3;
|
|
11808
11737
|
let DocBackScrollRenderController = class DocBackScrollRenderController extends _univerjs_core.RxDisposable {
|
|
@@ -12027,8 +11956,7 @@ DocBackScrollRenderController = __decorate([
|
|
|
12027
11956
|
__decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_docs.DocSkeletonManagerService))
|
|
12028
11957
|
], DocBackScrollRenderController);
|
|
12029
11958
|
|
|
12030
|
-
|
|
12031
|
-
//#region src/controllers/render-controllers/doc-paragraph-placeholder.render-controller.ts
|
|
11959
|
+
// src/controllers/render-controllers/doc-paragraph-placeholder.render-controller.ts
|
|
12032
11960
|
const PLACEHOLDER_COLOR = "gray.300";
|
|
12033
11961
|
const DEFAULT_PLACEHOLDER_FONT_SIZE = 12;
|
|
12034
11962
|
const MIN_BODY_TEXT_PLACEHOLDER_FONT_SIZE = 16;
|
|
@@ -12234,8 +12162,7 @@ function drawParagraphPlaceholders(ctx, placeholders, color = PLACEHOLDER_COLOR)
|
|
|
12234
12162
|
ctx.restore();
|
|
12235
12163
|
}
|
|
12236
12164
|
|
|
12237
|
-
|
|
12238
|
-
//#region src/components/doc-page-render-component.ts
|
|
12165
|
+
// src/components/doc-page-render-component.ts
|
|
12239
12166
|
/** Full document pages let whitespace select drawings behind the text. */
|
|
12240
12167
|
var DocPageRenderComponent = class extends _univerjs_engine_render.Documents {
|
|
12241
12168
|
isHit(coord) {
|
|
@@ -12275,8 +12202,7 @@ var DocPageRenderComponent = class extends _univerjs_engine_render.Documents {
|
|
|
12275
12202
|
}
|
|
12276
12203
|
};
|
|
12277
12204
|
|
|
12278
|
-
|
|
12279
|
-
//#region src/services/doc-layout-coordinator.service.ts
|
|
12205
|
+
// src/services/doc-layout-coordinator.service.ts
|
|
12280
12206
|
const FOREGROUND_BUDGET_MS = 8;
|
|
12281
12207
|
const WORKER_FOREGROUND_BUDGET_MS = 32;
|
|
12282
12208
|
const WORKER_BACKGROUND_BUDGET_MS = 128;
|
|
@@ -12794,8 +12720,7 @@ var DocLayoutCoordinatorService = class extends _univerjs_core.Disposable {
|
|
|
12794
12720
|
}
|
|
12795
12721
|
};
|
|
12796
12722
|
|
|
12797
|
-
|
|
12798
|
-
//#region src/services/doc-layout-interaction.service.ts
|
|
12723
|
+
// src/services/doc-layout-interaction.service.ts
|
|
12799
12724
|
/**
|
|
12800
12725
|
* Coordinates render-scoped interactions that require the current document
|
|
12801
12726
|
* skeleton to stay stable until the interaction ends.
|
|
@@ -12834,8 +12759,7 @@ var DocLayoutInteractionService = class extends _univerjs_core.Disposable {
|
|
|
12834
12759
|
}
|
|
12835
12760
|
};
|
|
12836
12761
|
|
|
12837
|
-
|
|
12838
|
-
//#region src/services/doc-zoom.ts
|
|
12762
|
+
// src/services/doc-zoom.ts
|
|
12839
12763
|
const DEFAULT_DOC_ZOOM_RATIO = 1;
|
|
12840
12764
|
const DEFAULT_MODERN_DOC_ZOOM_RATIO = 1;
|
|
12841
12765
|
const DOC_ZOOM_SHORTCUTS = [
|
|
@@ -12868,8 +12792,7 @@ function getDocZoomRatio$(commandService, instanceService) {
|
|
|
12868
12792
|
}), (0, rxjs.distinctUntilChanged)());
|
|
12869
12793
|
}
|
|
12870
12794
|
|
|
12871
|
-
|
|
12872
|
-
//#region src/services/doc-view-scale.ts
|
|
12795
|
+
// src/services/doc-view-scale.ts
|
|
12873
12796
|
function normalizeDocFitToWidthOptions(options) {
|
|
12874
12797
|
return {
|
|
12875
12798
|
...DEFAULT_DOC_FIT_TO_WIDTH_OPTIONS,
|
|
@@ -12956,8 +12879,7 @@ let DocViewScaleService = class DocViewScaleService extends _univerjs_core.Dispo
|
|
|
12956
12879
|
};
|
|
12957
12880
|
DocViewScaleService = __decorate([__decorateParam(1, _univerjs_core.IConfigService)], DocViewScaleService);
|
|
12958
12881
|
|
|
12959
|
-
|
|
12960
|
-
//#region src/services/doc-page-layout.service.ts
|
|
12882
|
+
// src/services/doc-page-layout.service.ts
|
|
12961
12883
|
let DocPageLayoutService = class DocPageLayoutService extends _univerjs_core.Disposable {
|
|
12962
12884
|
constructor(_context, _docViewScaleService) {
|
|
12963
12885
|
super();
|
|
@@ -13021,8 +12943,7 @@ let DocPageLayoutService = class DocPageLayoutService extends _univerjs_core.Dis
|
|
|
13021
12943
|
};
|
|
13022
12944
|
DocPageLayoutService = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(DocViewScaleService))], DocPageLayoutService);
|
|
13023
12945
|
|
|
13024
|
-
|
|
13025
|
-
//#region src/controllers/render-controllers/doc-mutation-layout.ts
|
|
12946
|
+
// src/controllers/render-controllers/doc-mutation-layout.ts
|
|
13026
12947
|
const BODY_RANGE_COLLECTIONS = /* @__PURE__ */ new Set([
|
|
13027
12948
|
"blockRanges",
|
|
13028
12949
|
"columnGroups",
|
|
@@ -13317,8 +13238,7 @@ function mapCurrentOffsetToPrevious(offset, invalidation) {
|
|
|
13317
13238
|
return offset - (invalidation.newEnd - invalidation.oldEnd);
|
|
13318
13239
|
}
|
|
13319
13240
|
|
|
13320
|
-
|
|
13321
|
-
//#region src/controllers/render-controllers/doc.render-controller.ts
|
|
13241
|
+
// src/controllers/render-controllers/doc.render-controller.ts
|
|
13322
13242
|
const DOC_PAGE_MARGIN = 20;
|
|
13323
13243
|
function getTextXActionLength(action) {
|
|
13324
13244
|
if (typeof action !== "object" || action == null || !("t" in action) || !("len" in action)) return;
|
|
@@ -14416,8 +14336,7 @@ function getPageSizeInModernMode(page) {
|
|
|
14416
14336
|
};
|
|
14417
14337
|
}
|
|
14418
14338
|
|
|
14419
|
-
|
|
14420
|
-
//#region src/basics/selection.ts
|
|
14339
|
+
// src/basics/selection.ts
|
|
14421
14340
|
function findFirstCursorOffset(snapshot) {
|
|
14422
14341
|
const { dataStream } = snapshot.body ?? {};
|
|
14423
14342
|
const EXCLUDE_TOKENS = [
|
|
@@ -14440,8 +14359,7 @@ function findFirstCursorOffset(snapshot) {
|
|
|
14440
14359
|
return 0;
|
|
14441
14360
|
}
|
|
14442
14361
|
|
|
14443
|
-
|
|
14444
|
-
//#region src/utils/section-header-footer.ts
|
|
14362
|
+
// src/utils/section-header-footer.ts
|
|
14445
14363
|
function getDocPageSectionContext(snapshot, page) {
|
|
14446
14364
|
const sections = snapshot.body ? (0, _univerjs_docs.getTopLevelSectionBreaks)(snapshot.body) : [];
|
|
14447
14365
|
const sectionIndex = (page === null || page === void 0 ? void 0 : page.sectionId) == null ? -1 : sections.findIndex((item) => item.sectionId === page.sectionId);
|
|
@@ -14488,8 +14406,7 @@ function getHeaderFooterTarget(viewModel, editArea, segmentPage, page) {
|
|
|
14488
14406
|
};
|
|
14489
14407
|
}
|
|
14490
14408
|
|
|
14491
|
-
|
|
14492
|
-
//#region src/views/header-footer/panel/component-name.ts
|
|
14409
|
+
// src/views/header-footer/panel/component-name.ts
|
|
14493
14410
|
/**
|
|
14494
14411
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
14495
14412
|
*
|
|
@@ -14509,8 +14426,7 @@ const COMPONENT_DOC_HEADER_FOOTER_PANEL = "COMPONENT_DOC_HEADER_FOOTER_PANEL";
|
|
|
14509
14426
|
const DOC_HEADER_FOOTER_RIBBON_TAB = "docs-ui.ribbon.header-footer";
|
|
14510
14427
|
const DOC_HEADER_FOOTER_RIBBON_CONTROL = "DocHeaderFooterRibbonControl";
|
|
14511
14428
|
|
|
14512
|
-
|
|
14513
|
-
//#region src/commands/operations/doc-header-footer-panel.operation.ts
|
|
14429
|
+
// src/commands/operations/doc-header-footer-panel.operation.ts
|
|
14514
14430
|
const SidebarDocHeaderFooterPanelOperation = {
|
|
14515
14431
|
id: "sidebar.operation.doc-header-footer-panel",
|
|
14516
14432
|
type: _univerjs_core.CommandType.OPERATION,
|
|
@@ -14532,8 +14448,7 @@ const SidebarDocHeaderFooterPanelOperation = {
|
|
|
14532
14448
|
}
|
|
14533
14449
|
};
|
|
14534
14450
|
|
|
14535
|
-
|
|
14536
|
-
//#region src/commands/commands/doc-header-footer.command.ts
|
|
14451
|
+
// src/commands/commands/doc-header-footer.command.ts
|
|
14537
14452
|
const CoreHeaderFooterCommandId = "doc.command.core-header-footer";
|
|
14538
14453
|
/**
|
|
14539
14454
|
* The command to update header and footer or create them.
|
|
@@ -14680,8 +14595,7 @@ const CloseHeaderFooterCommand = {
|
|
|
14680
14595
|
}
|
|
14681
14596
|
};
|
|
14682
14597
|
|
|
14683
|
-
|
|
14684
|
-
//#region src/utils/date-time-field.ts
|
|
14598
|
+
// src/utils/date-time-field.ts
|
|
14685
14599
|
function createDateTimeField(format, locale, date) {
|
|
14686
14600
|
const options = format === "time" ? {
|
|
14687
14601
|
hour: "2-digit",
|
|
@@ -14731,8 +14645,7 @@ function resolveDateTimeField(instruction, locale, date) {
|
|
|
14731
14645
|
}
|
|
14732
14646
|
}
|
|
14733
14647
|
|
|
14734
|
-
|
|
14735
|
-
//#region src/commands/commands/insert-header-footer-field.command.ts
|
|
14648
|
+
// src/commands/commands/insert-header-footer-field.command.ts
|
|
14736
14649
|
const InsertHeaderFooterFieldCommand = {
|
|
14737
14650
|
id: "doc.command.insert-header-footer-field",
|
|
14738
14651
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -14825,8 +14738,7 @@ const InsertHeaderFooterFieldCommand = {
|
|
|
14825
14738
|
}
|
|
14826
14739
|
};
|
|
14827
14740
|
|
|
14828
|
-
|
|
14829
|
-
//#region src/commands/commands/refresh-header-footer-fields.command.ts
|
|
14741
|
+
// src/commands/commands/refresh-header-footer-fields.command.ts
|
|
14830
14742
|
const RefreshHeaderFooterFieldsCommand = {
|
|
14831
14743
|
id: "doc.command.refresh-header-footer-fields",
|
|
14832
14744
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -14914,8 +14826,7 @@ function refreshDateTimeFields(body, locale, date, canEdit) {
|
|
|
14914
14826
|
return textX.serialize();
|
|
14915
14827
|
}
|
|
14916
14828
|
|
|
14917
|
-
|
|
14918
|
-
//#region src/commands/operations/doc-header-footer-ribbon.operation.ts
|
|
14829
|
+
// src/commands/operations/doc-header-footer-ribbon.operation.ts
|
|
14919
14830
|
const DocHeaderFooterRibbonOperation = {
|
|
14920
14831
|
id: SidebarDocHeaderFooterPanelOperation.id,
|
|
14921
14832
|
type: SidebarDocHeaderFooterPanelOperation.type,
|
|
@@ -14927,8 +14838,7 @@ const DocHeaderFooterRibbonOperation = {
|
|
|
14927
14838
|
}
|
|
14928
14839
|
};
|
|
14929
14840
|
|
|
14930
|
-
|
|
14931
|
-
//#region src/types/const/padding.ts
|
|
14841
|
+
// src/types/const/padding.ts
|
|
14932
14842
|
/**
|
|
14933
14843
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
14934
14844
|
*
|
|
@@ -14946,8 +14856,7 @@ const DocHeaderFooterRibbonOperation = {
|
|
|
14946
14856
|
*/
|
|
14947
14857
|
const DOC_VERTICAL_PADDING = 4;
|
|
14948
14858
|
|
|
14949
|
-
|
|
14950
|
-
//#region src/services/doc-popup-manager.service.ts
|
|
14859
|
+
// src/services/doc-popup-manager.service.ts
|
|
14951
14860
|
function transformBound2OffsetBound(originBound, scene) {
|
|
14952
14861
|
const topLeft = transformPosition2Offset(originBound.left, originBound.top, scene);
|
|
14953
14862
|
const bottomRight = transformPosition2Offset(originBound.right, originBound.bottom, scene);
|
|
@@ -15301,8 +15210,7 @@ DocCanvasPopManagerService = __decorate([
|
|
|
15301
15210
|
__decorateParam(3, _univerjs_core.ICommandService)
|
|
15302
15211
|
], DocCanvasPopManagerService);
|
|
15303
15212
|
|
|
15304
|
-
|
|
15305
|
-
//#region src/services/doc-event-manager.service.ts
|
|
15213
|
+
// src/services/doc-event-manager.service.ts
|
|
15306
15214
|
const calcDocRangePositions$1 = (range, documents, skeleton, pageIndex) => {
|
|
15307
15215
|
const skeletonData = skeleton.getSkeletonData();
|
|
15308
15216
|
let end = range.collapsed ? range.startOffset : range.endOffset - 1;
|
|
@@ -16165,8 +16073,7 @@ function clipRectHorizontally(rect, visibleLeft, visibleRight) {
|
|
|
16165
16073
|
};
|
|
16166
16074
|
}
|
|
16167
16075
|
|
|
16168
|
-
|
|
16169
|
-
//#region src/commands/operations/paragraph-permission.operation.ts
|
|
16076
|
+
// src/commands/operations/paragraph-permission.operation.ts
|
|
16170
16077
|
const OpenDocParagraphPermissionOperation = {
|
|
16171
16078
|
id: "doc.operation.open-paragraph-permission",
|
|
16172
16079
|
type: _univerjs_core.CommandType.OPERATION,
|
|
@@ -16194,8 +16101,7 @@ const OpenDocParagraphPermissionOperation = {
|
|
|
16194
16101
|
}
|
|
16195
16102
|
};
|
|
16196
16103
|
|
|
16197
|
-
|
|
16198
|
-
//#region src/commands/operations/permission-panel.operation.ts
|
|
16104
|
+
// src/commands/operations/permission-panel.operation.ts
|
|
16199
16105
|
const OpenDocPermissionPanelOperation = {
|
|
16200
16106
|
id: "doc.operation.open-permission-panel",
|
|
16201
16107
|
type: _univerjs_core.CommandType.OPERATION,
|
|
@@ -16246,8 +16152,7 @@ const OpenDocPermissionPanelOperation = {
|
|
|
16246
16152
|
}
|
|
16247
16153
|
};
|
|
16248
16154
|
|
|
16249
|
-
|
|
16250
|
-
//#region src/commands/commands/insert-special-character.command.ts
|
|
16155
|
+
// src/commands/commands/insert-special-character.command.ts
|
|
16251
16156
|
const InsertSpecialCharacterCommand = {
|
|
16252
16157
|
id: "doc.command.insert-special-character",
|
|
16253
16158
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -16294,8 +16199,7 @@ const InsertSpecialCharacterCommand = {
|
|
|
16294
16199
|
}
|
|
16295
16200
|
};
|
|
16296
16201
|
|
|
16297
|
-
|
|
16298
|
-
//#region src/commands/operations/insert-break.operation.ts
|
|
16202
|
+
// src/commands/operations/insert-break.operation.ts
|
|
16299
16203
|
function getCollapsedBodyOffset(selectionManager) {
|
|
16300
16204
|
const range = selectionManager.getActiveTextRange();
|
|
16301
16205
|
if (!(range === null || range === void 0 ? void 0 : range.collapsed) || range.segmentId || !Number.isInteger(range.startOffset)) return null;
|
|
@@ -16340,8 +16244,7 @@ const InsertDocumentSectionBreakOperation = {
|
|
|
16340
16244
|
}
|
|
16341
16245
|
};
|
|
16342
16246
|
|
|
16343
|
-
|
|
16344
|
-
//#region src/views/PageSettings.tsx
|
|
16247
|
+
// src/views/PageSettings.tsx
|
|
16345
16248
|
const MODERN_WIDTH_OPTIONS = [
|
|
16346
16249
|
_univerjs_core.ModernDocumentWidthMode.NARROW,
|
|
16347
16250
|
_univerjs_core.ModernDocumentWidthMode.MEDIUM,
|
|
@@ -16517,8 +16420,7 @@ function PageSettings(props) {
|
|
|
16517
16420
|
}
|
|
16518
16421
|
const PAGE_SETTING_COMPONENT_ID = "docs.component.page-setting";
|
|
16519
16422
|
|
|
16520
|
-
|
|
16521
|
-
//#region src/commands/commands/doc-page-setup.command.ts
|
|
16423
|
+
// src/commands/commands/doc-page-setup.command.ts
|
|
16522
16424
|
const PAGE_FILL_TABLE_TOLERANCE = 2;
|
|
16523
16425
|
function getPageContentWidth(config) {
|
|
16524
16426
|
var _config$pageSize;
|
|
@@ -16684,8 +16586,7 @@ const DocPageSetupCommand = {
|
|
|
16684
16586
|
}
|
|
16685
16587
|
};
|
|
16686
16588
|
|
|
16687
|
-
|
|
16688
|
-
//#region src/commands/operations/open-page-setting.operation.ts
|
|
16589
|
+
// src/commands/operations/open-page-setting.operation.ts
|
|
16689
16590
|
const DocOpenPageSettingCommand = {
|
|
16690
16591
|
id: "docs.operation.open-page-setting",
|
|
16691
16592
|
type: _univerjs_core.CommandType.OPERATION,
|
|
@@ -16724,8 +16625,7 @@ const DocOpenPageSettingCommand = {
|
|
|
16724
16625
|
}
|
|
16725
16626
|
};
|
|
16726
16627
|
|
|
16727
|
-
|
|
16728
|
-
//#region src/views/EditorColorPicker.tsx
|
|
16628
|
+
// src/views/EditorColorPicker.tsx
|
|
16729
16629
|
function EditorColorPicker(props) {
|
|
16730
16630
|
const containerRef = (0, react.useRef)(null);
|
|
16731
16631
|
const ColorPickerComponent = (0, _univerjs_ui.useDependency)(_univerjs_ui.ComponentManager).get(_univerjs_ui.COLOR_PICKER_COMPONENT);
|
|
@@ -16746,8 +16646,7 @@ function EditorColorPicker(props) {
|
|
|
16746
16646
|
}
|
|
16747
16647
|
EditorColorPicker.componentKey = "docs.editor-color-picker";
|
|
16748
16648
|
|
|
16749
|
-
|
|
16750
|
-
//#region src/views/const.ts
|
|
16649
|
+
// src/views/const.ts
|
|
16751
16650
|
/**
|
|
16752
16651
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
16753
16652
|
*
|
|
@@ -16765,8 +16664,7 @@ EditorColorPicker.componentKey = "docs.editor-color-picker";
|
|
|
16765
16664
|
*/
|
|
16766
16665
|
const COMPONENT_PREFIX = "UI_PLUGIN_DOCS";
|
|
16767
16666
|
|
|
16768
|
-
|
|
16769
|
-
//#region src/views/list-type-picker/Picker.tsx
|
|
16667
|
+
// src/views/list-type-picker/Picker.tsx
|
|
16770
16668
|
/**
|
|
16771
16669
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
16772
16670
|
*
|
|
@@ -16872,8 +16770,7 @@ const BulletListTypePicker = (props) => /* @__PURE__ */ (0, react_jsx_runtime.js
|
|
|
16872
16770
|
options: bulletOptions
|
|
16873
16771
|
});
|
|
16874
16772
|
|
|
16875
|
-
|
|
16876
|
-
//#region src/views/list-type-picker/index.ts
|
|
16773
|
+
// src/views/list-type-picker/index.ts
|
|
16877
16774
|
/**
|
|
16878
16775
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
16879
16776
|
*
|
|
@@ -16892,8 +16789,7 @@ const BulletListTypePicker = (props) => /* @__PURE__ */ (0, react_jsx_runtime.js
|
|
|
16892
16789
|
const ORDER_LIST_TYPE_COMPONENT = `${COMPONENT_PREFIX}_ORDER_LIST_TYPE_COMPONENT`;
|
|
16893
16790
|
const BULLET_LIST_TYPE_COMPONENT = `${COMPONENT_PREFIX}_BULLET_LIST_TYPE_COMPONENT`;
|
|
16894
16791
|
|
|
16895
|
-
|
|
16896
|
-
//#region src/menu/menu.ts
|
|
16792
|
+
// src/menu/menu.ts
|
|
16897
16793
|
function shouldSuppressDocMenuStateRefresh(accessor) {
|
|
16898
16794
|
let univerInstanceService;
|
|
16899
16795
|
let focusCoordinator;
|
|
@@ -18102,8 +17998,7 @@ function PageSettingMenuItemFactory(accessor) {
|
|
|
18102
17998
|
};
|
|
18103
17999
|
}
|
|
18104
18000
|
|
|
18105
|
-
|
|
18106
|
-
//#region src/menu/header-footer-ribbon.ts
|
|
18001
|
+
// src/menu/header-footer-ribbon.ts
|
|
18107
18002
|
const headerFooterRibbonSchema = {
|
|
18108
18003
|
[_univerjs_ui.ContextMenuPosition.MAIN_AREA]: { [_univerjs_ui.ContextMenuGroup.FORMAT]: { [UpdateSelectedDocFieldsCommand.id]: {
|
|
18109
18004
|
order: 1,
|
|
@@ -18176,8 +18071,7 @@ const headerFooterRibbonSchema = {
|
|
|
18176
18071
|
} }
|
|
18177
18072
|
};
|
|
18178
18073
|
|
|
18179
|
-
|
|
18180
|
-
//#region src/controllers/doc-paragraph-setting.controller.ts
|
|
18074
|
+
// src/controllers/doc-paragraph-setting.controller.ts
|
|
18181
18075
|
/**
|
|
18182
18076
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
18183
18077
|
*
|
|
@@ -18216,8 +18110,7 @@ let DocParagraphSettingController = class DocParagraphSettingController extends
|
|
|
18216
18110
|
};
|
|
18217
18111
|
DocParagraphSettingController = __decorate([__decorateParam(0, _univerjs_core.ICommandService), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.ISidebarService))], DocParagraphSettingController);
|
|
18218
18112
|
|
|
18219
|
-
|
|
18220
|
-
//#region src/commands/operations/doc-paragraph-setting-panel.operation.ts
|
|
18113
|
+
// src/commands/operations/doc-paragraph-setting-panel.operation.ts
|
|
18221
18114
|
const DocParagraphSettingPanelOperation = {
|
|
18222
18115
|
id: "sidebar.operation.doc-paragraph-setting-panel",
|
|
18223
18116
|
type: _univerjs_core.CommandType.OPERATION,
|
|
@@ -18227,8 +18120,7 @@ const DocParagraphSettingPanelOperation = {
|
|
|
18227
18120
|
}
|
|
18228
18121
|
};
|
|
18229
18122
|
|
|
18230
|
-
|
|
18231
|
-
//#region src/views/section-setting/component-name.ts
|
|
18123
|
+
// src/views/section-setting/component-name.ts
|
|
18232
18124
|
/**
|
|
18233
18125
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
18234
18126
|
*
|
|
@@ -18246,8 +18138,7 @@ const DocParagraphSettingPanelOperation = {
|
|
|
18246
18138
|
*/
|
|
18247
18139
|
const DOC_SECTION_SETTING_COMPONENT = "doc_ui_section-setting-panel";
|
|
18248
18140
|
|
|
18249
|
-
|
|
18250
|
-
//#region src/controllers/doc-section-setting.controller.ts
|
|
18141
|
+
// src/controllers/doc-section-setting.controller.ts
|
|
18251
18142
|
/**
|
|
18252
18143
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
18253
18144
|
*
|
|
@@ -18295,8 +18186,7 @@ let DocSectionSettingController = class DocSectionSettingController extends _uni
|
|
|
18295
18186
|
};
|
|
18296
18187
|
DocSectionSettingController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ISidebarService)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_docs.DocSelectionManagerService))], DocSectionSettingController);
|
|
18297
18188
|
|
|
18298
|
-
|
|
18299
|
-
//#region src/commands/operations/doc-section-setting-panel.operation.ts
|
|
18189
|
+
// src/commands/operations/doc-section-setting-panel.operation.ts
|
|
18300
18190
|
const DocSectionSettingPanelOperation = {
|
|
18301
18191
|
id: "sidebar.operation.doc-section-setting-panel",
|
|
18302
18192
|
type: _univerjs_core.CommandType.OPERATION,
|
|
@@ -18306,8 +18196,7 @@ const DocSectionSettingPanelOperation = {
|
|
|
18306
18196
|
}
|
|
18307
18197
|
};
|
|
18308
18198
|
|
|
18309
|
-
|
|
18310
|
-
//#region src/menu/context-menu.ts
|
|
18199
|
+
// src/menu/context-menu.ts
|
|
18311
18200
|
const getDisableOnCollapsedObservable = (accessor) => {
|
|
18312
18201
|
const docSelectionManagerService = accessor.get(_univerjs_docs.DocSelectionManagerService);
|
|
18313
18202
|
return new rxjs.Observable((subscriber) => {
|
|
@@ -18589,8 +18478,7 @@ function PasteRibbonMenuFactory(accessor) {
|
|
|
18589
18478
|
};
|
|
18590
18479
|
}
|
|
18591
18480
|
|
|
18592
|
-
|
|
18593
|
-
//#region src/menu/display.menu.ts
|
|
18481
|
+
// src/menu/display.menu.ts
|
|
18594
18482
|
const DOC_ZOOM_RATIO_MENU_ID = "doc.menu.zoom-ratio";
|
|
18595
18483
|
function DocZoomRatioMenuItemFactory(accessor) {
|
|
18596
18484
|
const commandService = accessor.get(_univerjs_core.ICommandService);
|
|
@@ -18629,8 +18517,7 @@ function DocFullscreenMenuItemFactory(accessor) {
|
|
|
18629
18517
|
};
|
|
18630
18518
|
}
|
|
18631
18519
|
|
|
18632
|
-
|
|
18633
|
-
//#region src/views/paragraph-menu/theme-color.ts
|
|
18520
|
+
// src/views/paragraph-menu/theme-color.ts
|
|
18634
18521
|
function getHighlightBackgroundColor(themeService, index) {
|
|
18635
18522
|
const tokenPath = `highlight.background.${index + 1}`;
|
|
18636
18523
|
const token = themeService.getColorFromTheme(tokenPath);
|
|
@@ -18639,8 +18526,7 @@ function getHighlightBackgroundColor(themeService, index) {
|
|
|
18639
18526
|
return new _univerjs_core.ColorKit(color).setAlpha(token.alpha).toRgbString();
|
|
18640
18527
|
}
|
|
18641
18528
|
|
|
18642
|
-
|
|
18643
|
-
//#region src/menu/paragraph-menu.ts
|
|
18529
|
+
// src/menu/paragraph-menu.ts
|
|
18644
18530
|
const TEXT_COLORS = [
|
|
18645
18531
|
"#FE4B4B",
|
|
18646
18532
|
"#FF8C51",
|
|
@@ -19210,8 +19096,7 @@ const ParagraphMenuBackgroundColorSwatchMenuItemFactories = BACKGROUND_COLOR_SWA
|
|
|
19210
19096
|
return items;
|
|
19211
19097
|
}, {});
|
|
19212
19098
|
|
|
19213
|
-
|
|
19214
|
-
//#region src/menu/permission.menu.ts
|
|
19099
|
+
// src/menu/permission.menu.ts
|
|
19215
19100
|
function DocPermissionMenuItemFactory(accessor) {
|
|
19216
19101
|
return (0, _univerjs_ui.objectPermissionMenuItemFactory)(accessor, OpenDocPermissionPanelOperation.id, _univerjs_core.UniverInstanceType.UNIVER_DOC, _univerjs_protocol.UnitObject.DocumentSection);
|
|
19217
19102
|
}
|
|
@@ -19222,8 +19107,7 @@ function DocParagraphPermissionMenuItemFactory(accessor) {
|
|
|
19222
19107
|
};
|
|
19223
19108
|
}
|
|
19224
19109
|
|
|
19225
|
-
|
|
19226
|
-
//#region src/menu/schema.ts
|
|
19110
|
+
// src/menu/schema.ts
|
|
19227
19111
|
const floatToolbarMenuSchema = { [FLOAT_TOOLBAR_MENU_POSITION]: { [FLOAT_TEXT_STYLE_MENU_ID]: {
|
|
19228
19112
|
order: 0,
|
|
19229
19113
|
menuItemFactory: FloatTextStyleMenuItemFactory
|
|
@@ -19256,7 +19140,8 @@ const menuSchema = {
|
|
|
19256
19140
|
gridLayout: {
|
|
19257
19141
|
row: 2,
|
|
19258
19142
|
column: 1,
|
|
19259
|
-
width: 44
|
|
19143
|
+
width: 44,
|
|
19144
|
+
minWidth: 28
|
|
19260
19145
|
},
|
|
19261
19146
|
menuItemFactory: BoldMenuItemFactory
|
|
19262
19147
|
},
|
|
@@ -19265,7 +19150,8 @@ const menuSchema = {
|
|
|
19265
19150
|
gridLayout: {
|
|
19266
19151
|
row: 2,
|
|
19267
19152
|
column: 2,
|
|
19268
|
-
width: 44
|
|
19153
|
+
width: 44,
|
|
19154
|
+
minWidth: 28
|
|
19269
19155
|
},
|
|
19270
19156
|
menuItemFactory: ItalicMenuItemFactory
|
|
19271
19157
|
},
|
|
@@ -19274,7 +19160,8 @@ const menuSchema = {
|
|
|
19274
19160
|
gridLayout: {
|
|
19275
19161
|
row: 2,
|
|
19276
19162
|
column: 3,
|
|
19277
|
-
width: 44
|
|
19163
|
+
width: 44,
|
|
19164
|
+
minWidth: 28
|
|
19278
19165
|
},
|
|
19279
19166
|
menuItemFactory: UnderlineMenuItemFactory
|
|
19280
19167
|
},
|
|
@@ -19283,7 +19170,8 @@ const menuSchema = {
|
|
|
19283
19170
|
gridLayout: {
|
|
19284
19171
|
row: 2,
|
|
19285
19172
|
column: 4,
|
|
19286
|
-
width: 44
|
|
19173
|
+
width: 44,
|
|
19174
|
+
minWidth: 28
|
|
19287
19175
|
},
|
|
19288
19176
|
menuItemFactory: StrikeThroughMenuItemFactory
|
|
19289
19177
|
},
|
|
@@ -19292,7 +19180,8 @@ const menuSchema = {
|
|
|
19292
19180
|
gridLayout: {
|
|
19293
19181
|
row: 2,
|
|
19294
19182
|
column: 6,
|
|
19295
|
-
width: 44
|
|
19183
|
+
width: 44,
|
|
19184
|
+
minWidth: 28
|
|
19296
19185
|
},
|
|
19297
19186
|
menuItemFactory: SubscriptMenuItemFactory
|
|
19298
19187
|
},
|
|
@@ -19301,7 +19190,8 @@ const menuSchema = {
|
|
|
19301
19190
|
gridLayout: {
|
|
19302
19191
|
row: 2,
|
|
19303
19192
|
column: 5,
|
|
19304
|
-
width: 44
|
|
19193
|
+
width: 44,
|
|
19194
|
+
minWidth: 28
|
|
19305
19195
|
},
|
|
19306
19196
|
menuItemFactory: SuperscriptMenuItemFactory
|
|
19307
19197
|
},
|
|
@@ -19311,7 +19201,8 @@ const menuSchema = {
|
|
|
19311
19201
|
row: 1,
|
|
19312
19202
|
column: 1,
|
|
19313
19203
|
columnSpan: 2,
|
|
19314
|
-
width: 96
|
|
19204
|
+
width: 96,
|
|
19205
|
+
minWidth: 72
|
|
19315
19206
|
},
|
|
19316
19207
|
menuItemFactory: HeadingSelectorMenuItemFactory
|
|
19317
19208
|
},
|
|
@@ -19321,7 +19212,8 @@ const menuSchema = {
|
|
|
19321
19212
|
row: 1,
|
|
19322
19213
|
column: 7,
|
|
19323
19214
|
columnSpan: 2,
|
|
19324
|
-
width:
|
|
19215
|
+
width: 112,
|
|
19216
|
+
minWidth: 108
|
|
19325
19217
|
},
|
|
19326
19218
|
menuItemFactory: FontSizeSelectorMenuItemFactory
|
|
19327
19219
|
},
|
|
@@ -19331,7 +19223,8 @@ const menuSchema = {
|
|
|
19331
19223
|
row: 1,
|
|
19332
19224
|
column: 3,
|
|
19333
19225
|
columnSpan: 4,
|
|
19334
|
-
width: 200
|
|
19226
|
+
width: 200,
|
|
19227
|
+
minWidth: 124
|
|
19335
19228
|
},
|
|
19336
19229
|
menuItemFactory: FontFamilySelectorMenuItemFactory
|
|
19337
19230
|
},
|
|
@@ -19340,7 +19233,7 @@ const menuSchema = {
|
|
|
19340
19233
|
gridLayout: {
|
|
19341
19234
|
row: 2,
|
|
19342
19235
|
column: 8,
|
|
19343
|
-
width:
|
|
19236
|
+
width: 52
|
|
19344
19237
|
},
|
|
19345
19238
|
menuItemFactory: TextColorSelectorMenuItemFactory,
|
|
19346
19239
|
[ResetInlineFormatTextColorCommand.id]: {
|
|
@@ -19353,7 +19246,7 @@ const menuSchema = {
|
|
|
19353
19246
|
gridLayout: {
|
|
19354
19247
|
row: 2,
|
|
19355
19248
|
column: 7,
|
|
19356
|
-
width:
|
|
19249
|
+
width: 52
|
|
19357
19250
|
},
|
|
19358
19251
|
menuItemFactory: BackgroundColorSelectorMenuItemFactory,
|
|
19359
19252
|
[ResetInlineFormatTextBackgroundColorCommand.id]: {
|
|
@@ -20128,8 +20021,7 @@ const menuSchema = {
|
|
|
20128
20021
|
}
|
|
20129
20022
|
};
|
|
20130
20023
|
|
|
20131
|
-
|
|
20132
|
-
//#region src/shortcuts/utils.ts
|
|
20024
|
+
// src/shortcuts/utils.ts
|
|
20133
20025
|
function whenTextEditorFocused(contextService) {
|
|
20134
20026
|
return contextService.getContextValue(_univerjs_core.FOCUSING_UNIVER_EDITOR) && !contextService.getContextValue(_univerjs_core.FOCUSING_COMMON_DRAWINGS) && (contextService.getContextValue(_univerjs_core.FOCUSING_DOC) || contextService.getContextValue(_univerjs_core.EDITOR_ACTIVATED) || contextService.getContextValue(_univerjs_core.FOCUSING_FX_BAR_EDITOR));
|
|
20135
20027
|
}
|
|
@@ -20140,8 +20032,7 @@ function whenDocAndEditorFocusedWithBreakLine(contextService) {
|
|
|
20140
20032
|
return contextService.getContextValue(_univerjs_core.FOCUSING_DOC) && contextService.getContextValue(_univerjs_core.FOCUSING_UNIVER_EDITOR) && !contextService.getContextValue(_univerjs_core.FOCUSING_COMMON_DRAWINGS);
|
|
20141
20033
|
}
|
|
20142
20034
|
|
|
20143
|
-
|
|
20144
|
-
//#region src/shortcuts/format.shortcut.ts
|
|
20035
|
+
// src/shortcuts/format.shortcut.ts
|
|
20145
20036
|
const TabShortCut = {
|
|
20146
20037
|
id: TabCommand.id,
|
|
20147
20038
|
binding: _univerjs_ui.KeyCode.TAB,
|
|
@@ -20159,8 +20050,7 @@ const ShiftTabShortCut = {
|
|
|
20159
20050
|
staticParameters: { shift: true }
|
|
20160
20051
|
};
|
|
20161
20052
|
|
|
20162
|
-
|
|
20163
|
-
//#region src/shortcuts/toolbar.shortcut.ts
|
|
20053
|
+
// src/shortcuts/toolbar.shortcut.ts
|
|
20164
20054
|
const BoldShortCut = {
|
|
20165
20055
|
id: SetInlineFormatBoldCommand.id,
|
|
20166
20056
|
binding: _univerjs_ui.KeyCode.B | _univerjs_ui.MetaKeys.CTRL_COMMAND,
|
|
@@ -20222,8 +20112,7 @@ const BulletListShortCut = {
|
|
|
20222
20112
|
preconditions: whenDocAndEditorFocused
|
|
20223
20113
|
};
|
|
20224
20114
|
|
|
20225
|
-
|
|
20226
|
-
//#region src/views/count-bar/ZoomSlider.tsx
|
|
20115
|
+
// src/views/count-bar/ZoomSlider.tsx
|
|
20227
20116
|
const DOC_ZOOM_RANGE = [10, 400];
|
|
20228
20117
|
function ZoomSlider() {
|
|
20229
20118
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
@@ -20245,8 +20134,7 @@ function ZoomSlider() {
|
|
|
20245
20134
|
});
|
|
20246
20135
|
}
|
|
20247
20136
|
|
|
20248
|
-
|
|
20249
|
-
//#region src/views/count-bar/CountBar.tsx
|
|
20137
|
+
// src/views/count-bar/CountBar.tsx
|
|
20250
20138
|
/**
|
|
20251
20139
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
20252
20140
|
*
|
|
@@ -20269,8 +20157,7 @@ function CountBar(_props) {
|
|
|
20269
20157
|
});
|
|
20270
20158
|
}
|
|
20271
20159
|
|
|
20272
|
-
|
|
20273
|
-
//#region src/views/doc-statistics/DocPageStatus.tsx
|
|
20160
|
+
// src/views/doc-statistics/DocPageStatus.tsx
|
|
20274
20161
|
const SCROLL_SETTLE_DELAY = 120;
|
|
20275
20162
|
const DRAG_TOOLTIP_HIDE_DELAY = 500;
|
|
20276
20163
|
const EMPTY_DOC_PAGE_STATUS = {
|
|
@@ -20427,8 +20314,7 @@ function DocPageStatus() {
|
|
|
20427
20314
|
})] });
|
|
20428
20315
|
}
|
|
20429
20316
|
|
|
20430
|
-
|
|
20431
|
-
//#region src/views/doc-statistics/use-doc-statistics.ts
|
|
20317
|
+
// src/views/doc-statistics/use-doc-statistics.ts
|
|
20432
20318
|
const STATISTICS_DEBOUNCE_TIME = 200;
|
|
20433
20319
|
const EMPTY_STATISTICS = {
|
|
20434
20320
|
words: 0,
|
|
@@ -20608,8 +20494,7 @@ function useDocStatistics(calculateLayout = false) {
|
|
|
20608
20494
|
};
|
|
20609
20495
|
}
|
|
20610
20496
|
|
|
20611
|
-
|
|
20612
|
-
//#region src/views/doc-statistics/DocStatistics.tsx
|
|
20497
|
+
// src/views/doc-statistics/DocStatistics.tsx
|
|
20613
20498
|
const STATISTIC_ROW_GROUPS = [
|
|
20614
20499
|
[{
|
|
20615
20500
|
key: "pages",
|
|
@@ -20733,8 +20618,7 @@ function DocStatistics() {
|
|
|
20733
20618
|
});
|
|
20734
20619
|
}
|
|
20735
20620
|
|
|
20736
|
-
|
|
20737
|
-
//#region src/services/doc-layout-progress.service.ts
|
|
20621
|
+
// src/services/doc-layout-progress.service.ts
|
|
20738
20622
|
let DocLayoutProgressService = class DocLayoutProgressService extends _univerjs_core.RxDisposable {
|
|
20739
20623
|
constructor(_univerInstanceService) {
|
|
20740
20624
|
super();
|
|
@@ -20770,8 +20654,7 @@ let DocLayoutProgressService = class DocLayoutProgressService extends _univerjs_
|
|
|
20770
20654
|
};
|
|
20771
20655
|
DocLayoutProgressService = __decorate([__decorateParam(0, _univerjs_core.IUniverInstanceService)], DocLayoutProgressService);
|
|
20772
20656
|
|
|
20773
|
-
|
|
20774
|
-
//#region src/views/DocLayoutProgress.tsx
|
|
20657
|
+
// src/views/DocLayoutProgress.tsx
|
|
20775
20658
|
function DocLayoutProgress() {
|
|
20776
20659
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
20777
20660
|
const progressState = (0, _univerjs_ui.useObservable)((0, _univerjs_ui.useDependency)(DocLayoutProgressService).currentProgress$, null);
|
|
@@ -20805,8 +20688,7 @@ function DocLayoutProgress() {
|
|
|
20805
20688
|
});
|
|
20806
20689
|
}
|
|
20807
20690
|
|
|
20808
|
-
|
|
20809
|
-
//#region src/views/doc-footer/DocFooter.tsx
|
|
20691
|
+
// src/views/doc-footer/DocFooter.tsx
|
|
20810
20692
|
function DocFooterContent() {
|
|
20811
20693
|
const config = (0, _univerjs_ui.useConfigValue)(DOCS_UI_PLUGIN_CONFIG_KEY);
|
|
20812
20694
|
return ((config === null || config === void 0 ? void 0 : config.footer) ?? true) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -20824,8 +20706,7 @@ function DocFooter() {
|
|
|
20824
20706
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DocFooterContent, {});
|
|
20825
20707
|
}
|
|
20826
20708
|
|
|
20827
|
-
|
|
20828
|
-
//#region src/views/doc-side-menu-layout.ts
|
|
20709
|
+
// src/views/doc-side-menu-layout.ts
|
|
20829
20710
|
function isDocSideMenuTableOverlapping(outline, table, viewport) {
|
|
20830
20711
|
if (table.bottom <= outline.top || table.top >= outline.bottom) return false;
|
|
20831
20712
|
let left = table.left;
|
|
@@ -20838,8 +20719,7 @@ function isDocSideMenuTableOverlapping(outline, table, viewport) {
|
|
|
20838
20719
|
return right > left && left < outline.right && right > outline.left;
|
|
20839
20720
|
}
|
|
20840
20721
|
|
|
20841
|
-
|
|
20842
|
-
//#region src/views/SideMenu.tsx
|
|
20722
|
+
// src/views/SideMenu.tsx
|
|
20843
20723
|
const SideMenu = (0, react.forwardRef)((props, ref) => {
|
|
20844
20724
|
const { label, menus, onClick, className, style, mode = "side-bar", maxHeight, activeId, open: controlledOpen, onOpenChange, maxWidth, wrapperClass, wrapperStyle, iconClass, iconStyle } = props;
|
|
20845
20725
|
const [expanded, setExpanded] = (0, react.useState)(mode === "side-bar");
|
|
@@ -20993,8 +20873,7 @@ const SideMenu = (0, react.forwardRef)((props, ref) => {
|
|
|
20993
20873
|
});
|
|
20994
20874
|
});
|
|
20995
20875
|
|
|
20996
|
-
|
|
20997
|
-
//#region src/views/DocSideMenu.tsx
|
|
20876
|
+
// src/views/DocSideMenu.tsx
|
|
20998
20877
|
const transformNamedStyleTypeToLevel = (type) => {
|
|
20999
20878
|
switch (type) {
|
|
21000
20879
|
case _univerjs_core.NamedStyleType.HEADING_1: return 1;
|
|
@@ -21192,8 +21071,7 @@ function DocSideMenuContent({ toc }) {
|
|
|
21192
21071
|
});
|
|
21193
21072
|
}
|
|
21194
21073
|
|
|
21195
|
-
|
|
21196
|
-
//#region src/controllers/ui.controller.ts
|
|
21074
|
+
// src/controllers/ui.controller.ts
|
|
21197
21075
|
let DocUIController = class DocUIController extends _univerjs_core.Disposable {
|
|
21198
21076
|
constructor(_injector, _commandService, _layoutService, _menuManagerService, _uiPartsService, _univerInstanceService, _shortcutService, _configService, _embedInteractionBoundaryService, _embedRuntimeFocusCoordinator) {
|
|
21199
21077
|
super();
|
|
@@ -21260,13 +21138,14 @@ let DocUIController = class DocUIController extends _univerjs_core.Disposable {
|
|
|
21260
21138
|
_initDateTimeFields() {
|
|
21261
21139
|
const refreshed = /* @__PURE__ */ new WeakSet();
|
|
21262
21140
|
this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(_univerjs_core.UniverInstanceType.UNIVER_DOC).subscribe((model) => {
|
|
21263
|
-
if (model
|
|
21264
|
-
|
|
21265
|
-
|
|
21266
|
-
|
|
21267
|
-
|
|
21268
|
-
|
|
21269
|
-
|
|
21141
|
+
if (!model || refreshed.has(model)) return;
|
|
21142
|
+
const unitId = model.getUnitId();
|
|
21143
|
+
if (!(0, _univerjs_docs.getDocumentPermissionValue)(this._injector.get(_univerjs_core.IPermissionService), unitId, unitId, _univerjs_protocol.UnitAction.Edit)) return;
|
|
21144
|
+
refreshed.add(model);
|
|
21145
|
+
this._commandService.syncExecuteCommand(RefreshHeaderFooterFieldsCommand.id, {
|
|
21146
|
+
unitId,
|
|
21147
|
+
onOpen: true
|
|
21148
|
+
});
|
|
21270
21149
|
}));
|
|
21271
21150
|
}
|
|
21272
21151
|
_initFocusHandler() {
|
|
@@ -21296,8 +21175,7 @@ DocUIController = __decorate([
|
|
|
21296
21175
|
__decorateParam(9, (0, _univerjs_core.Optional)(IDocEmbedRuntimeFocusCoordinator))
|
|
21297
21176
|
], DocUIController);
|
|
21298
21177
|
|
|
21299
|
-
|
|
21300
|
-
//#region src/embed-docs-custom-block-bleed.ts
|
|
21178
|
+
// src/embed-docs-custom-block-bleed.ts
|
|
21301
21179
|
/**
|
|
21302
21180
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
21303
21181
|
*
|
|
@@ -21408,8 +21286,7 @@ function hasClippingOverflow(value) {
|
|
|
21408
21286
|
return value === "hidden" || value === "auto" || value === "scroll" || value === "clip";
|
|
21409
21287
|
}
|
|
21410
21288
|
|
|
21411
|
-
|
|
21412
|
-
//#region src/embed-docs-custom-block-refresh.ts
|
|
21289
|
+
// src/embed-docs-custom-block-refresh.ts
|
|
21413
21290
|
function collectDocsTableLikeEmbedChildUnitIds(drawings, resolveChildUnitId) {
|
|
21414
21291
|
const childUnitIds = /* @__PURE__ */ new Set();
|
|
21415
21292
|
Object.values(drawings ?? {}).forEach((drawing) => {
|
|
@@ -21472,8 +21349,7 @@ function createDocsCustomBlockSizeRefreshScheduler(refresh) {
|
|
|
21472
21349
|
};
|
|
21473
21350
|
}
|
|
21474
21351
|
|
|
21475
|
-
|
|
21476
|
-
//#region src/embed-docs-custom-block-scroll.ts
|
|
21352
|
+
// src/embed-docs-custom-block-scroll.ts
|
|
21477
21353
|
function scrollDocsTableLikeCustomBlockLive(event, live, options = {}) {
|
|
21478
21354
|
if (event.defaultPrevented || event.ctrlKey || event.metaKey) return false;
|
|
21479
21355
|
const deltaX = event.deltaX || (event.shiftKey ? event.deltaY : 0);
|
|
@@ -21500,8 +21376,7 @@ function resolveMaxScrollLeft(element, requestedMaxScrollLeft) {
|
|
|
21500
21376
|
return clampScroll(requestedMaxScrollLeft ?? nativeMaxScrollLeft, 0, nativeMaxScrollLeft);
|
|
21501
21377
|
}
|
|
21502
21378
|
|
|
21503
|
-
|
|
21504
|
-
//#region src/embed-host-anchor.ts
|
|
21379
|
+
// src/embed-host-anchor.ts
|
|
21505
21380
|
const MODERN_DOCS_CUSTOM_BLOCK_VIEWPORT_INSET = 10;
|
|
21506
21381
|
function resolveDocsCustomBlockRenderViewport(params) {
|
|
21507
21382
|
const defaultSize = (0, _univerjs_docs.resolveDocsCustomBlockSize)(params.childType);
|
|
@@ -21563,13 +21438,11 @@ function resolveDocsCustomBlockRenderViewport(params) {
|
|
|
21563
21438
|
};
|
|
21564
21439
|
}
|
|
21565
21440
|
|
|
21566
|
-
|
|
21567
|
-
//#region package.json
|
|
21441
|
+
// package.json
|
|
21568
21442
|
var name = "@univerjs/docs-ui";
|
|
21569
|
-
var version = "1.
|
|
21443
|
+
var version = "1.4.0";
|
|
21570
21444
|
|
|
21571
|
-
|
|
21572
|
-
//#region src/commands/commands/doc-paragraph-setting.command.ts
|
|
21445
|
+
// src/commands/commands/doc-paragraph-setting.command.ts
|
|
21573
21446
|
const DocParagraphSettingCommand = {
|
|
21574
21447
|
id: "doc-paragraph-setting.command",
|
|
21575
21448
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -21603,6 +21476,10 @@ const DocParagraphSettingCommand = {
|
|
|
21603
21476
|
const jsonX = _univerjs_core.JSONX.getInstance();
|
|
21604
21477
|
for (const paragraph of paragraphs) {
|
|
21605
21478
|
const { startIndex } = paragraph;
|
|
21479
|
+
const paragraphStyle = {
|
|
21480
|
+
...paragraph.paragraphStyle,
|
|
21481
|
+
...config.paragraph
|
|
21482
|
+
};
|
|
21606
21483
|
textX.push({
|
|
21607
21484
|
t: _univerjs_core.TextXActionType.RETAIN,
|
|
21608
21485
|
len: startIndex - memoryCursor.cursor
|
|
@@ -21614,10 +21491,7 @@ const DocParagraphSettingCommand = {
|
|
|
21614
21491
|
dataStream: "",
|
|
21615
21492
|
paragraphs: [{
|
|
21616
21493
|
...paragraph,
|
|
21617
|
-
paragraphStyle
|
|
21618
|
-
...paragraph.paragraphStyle,
|
|
21619
|
-
...config.paragraph
|
|
21620
|
-
},
|
|
21494
|
+
paragraphStyle,
|
|
21621
21495
|
startIndex: 0
|
|
21622
21496
|
}]
|
|
21623
21497
|
},
|
|
@@ -21631,8 +21505,7 @@ const DocParagraphSettingCommand = {
|
|
|
21631
21505
|
}
|
|
21632
21506
|
};
|
|
21633
21507
|
|
|
21634
|
-
|
|
21635
|
-
//#region src/controllers/doc-auto-format.controller.ts
|
|
21508
|
+
// src/controllers/doc-auto-format.controller.ts
|
|
21636
21509
|
function hasQuickListType(text) {
|
|
21637
21510
|
return Object.prototype.hasOwnProperty.call(_univerjs_core.QuickListTypeMap, text);
|
|
21638
21511
|
}
|
|
@@ -21772,8 +21645,7 @@ let DocAutoFormatController = class DocAutoFormatController extends _univerjs_co
|
|
|
21772
21645
|
};
|
|
21773
21646
|
DocAutoFormatController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(DocAutoFormatService)), __decorateParam(1, _univerjs_engine_render.IRenderManagerService)], DocAutoFormatController);
|
|
21774
21647
|
|
|
21775
|
-
|
|
21776
|
-
//#region src/views/header-footer/content-cover.ts
|
|
21648
|
+
// src/views/header-footer/content-cover.ts
|
|
21777
21649
|
/** A paint-only overlay. It never participates in hit testing or selection. */
|
|
21778
21650
|
var HeaderFooterContentCover = class extends _univerjs_engine_render.BaseObject {
|
|
21779
21651
|
constructor(key, _documents, _scene) {
|
|
@@ -21908,8 +21780,7 @@ var HeaderFooterContentCover = class extends _univerjs_engine_render.BaseObject
|
|
|
21908
21780
|
}
|
|
21909
21781
|
};
|
|
21910
21782
|
|
|
21911
|
-
|
|
21912
|
-
//#region src/views/header-footer/text-bubble.ts
|
|
21783
|
+
// src/views/header-footer/text-bubble.ts
|
|
21913
21784
|
const COLLAB_CURSOR_LABEL_HEIGHT = 18;
|
|
21914
21785
|
const COLLAB_CURSOR_LABEL_MAX_WIDTH = 200;
|
|
21915
21786
|
const COLLAB_CURSOR_LABEL_TEXT_PADDING_LR = 6;
|
|
@@ -21986,8 +21857,7 @@ var TextBubbleShape = class TextBubbleShape extends _univerjs_engine_render.Shap
|
|
|
21986
21857
|
}
|
|
21987
21858
|
};
|
|
21988
21859
|
|
|
21989
|
-
|
|
21990
|
-
//#region src/controllers/doc-header-footer.controller.ts
|
|
21860
|
+
// src/controllers/doc-header-footer.controller.ts
|
|
21991
21861
|
const INACTIVE_AREA_OPACITY = .5;
|
|
21992
21862
|
const HEADER_FOOTER_LABEL_ALPHA = .08;
|
|
21993
21863
|
let DocHeaderFooterController = class DocHeaderFooterController extends _univerjs_core.Disposable {
|
|
@@ -22181,8 +22051,7 @@ DocHeaderFooterController = __decorate([
|
|
|
22181
22051
|
__decorateParam(6, (0, _univerjs_core.Inject)(_univerjs_core.ThemeService))
|
|
22182
22052
|
], DocHeaderFooterController);
|
|
22183
22053
|
|
|
22184
|
-
|
|
22185
|
-
//#region src/basics/table.ts
|
|
22054
|
+
// src/basics/table.ts
|
|
22186
22055
|
function findTableAfterLine(line, page) {
|
|
22187
22056
|
const { ed } = line;
|
|
22188
22057
|
const { skeTables } = page;
|
|
@@ -22211,8 +22080,7 @@ function lastLineInCell(cell) {
|
|
|
22211
22080
|
return lastColumn.lines[lastColumn.lines.length - 1];
|
|
22212
22081
|
}
|
|
22213
22082
|
|
|
22214
|
-
|
|
22215
|
-
//#region src/controllers/doc-move-cursor.controller.ts
|
|
22083
|
+
// src/controllers/doc-move-cursor.controller.ts
|
|
22216
22084
|
let DocMoveCursorController = class DocMoveCursorController extends _univerjs_core.Disposable {
|
|
22217
22085
|
constructor(_univerInstanceService, _renderManagerService, _textSelectionManagerService, _commandService) {
|
|
22218
22086
|
super();
|
|
@@ -22916,8 +22784,7 @@ DocMoveCursorController = __decorate([
|
|
|
22916
22784
|
__decorateParam(3, _univerjs_core.ICommandService)
|
|
22917
22785
|
], DocMoveCursorController);
|
|
22918
22786
|
|
|
22919
|
-
|
|
22920
|
-
//#region src/controllers/doc-table.controller.ts
|
|
22787
|
+
// src/controllers/doc-table.controller.ts
|
|
22921
22788
|
/**
|
|
22922
22789
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
22923
22790
|
*
|
|
@@ -22950,8 +22817,7 @@ let DocTableController = class DocTableController extends _univerjs_core.Disposa
|
|
|
22950
22817
|
};
|
|
22951
22818
|
DocTableController = __decorate([__decorateParam(0, _univerjs_core.ICommandService)], DocTableController);
|
|
22952
22819
|
|
|
22953
|
-
|
|
22954
|
-
//#region src/views/DocLayoutRecovery.tsx
|
|
22820
|
+
// src/views/DocLayoutRecovery.tsx
|
|
22955
22821
|
const DOC_LAYOUT_RECOVERY_COMPONENT = "DOC_LAYOUT_RECOVERY_COMPONENT";
|
|
22956
22822
|
function DocLayoutRecovery() {
|
|
22957
22823
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
@@ -22966,8 +22832,7 @@ function DocLayoutRecovery() {
|
|
|
22966
22832
|
});
|
|
22967
22833
|
}
|
|
22968
22834
|
|
|
22969
|
-
|
|
22970
|
-
//#region src/views/DocPasteOptions.tsx
|
|
22835
|
+
// src/views/DocPasteOptions.tsx
|
|
22971
22836
|
const DOC_PASTE_OPTIONS_COMPONENT = "docs-ui.paste-options";
|
|
22972
22837
|
function DocPasteOptions() {
|
|
22973
22838
|
const clipboard = (0, _univerjs_ui.useDependency)(IDocClipboardService);
|
|
@@ -23043,8 +22908,7 @@ function DocPasteOptions() {
|
|
|
23043
22908
|
});
|
|
23044
22909
|
}
|
|
23045
22910
|
|
|
23046
|
-
|
|
23047
|
-
//#region src/views/Icon.tsx
|
|
22911
|
+
// src/views/Icon.tsx
|
|
23048
22912
|
function BackgroundColorSwatchIcon({ className, style, onClick, color }) {
|
|
23049
22913
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
23050
22914
|
className,
|
|
@@ -23129,8 +22993,7 @@ const DocParagraphBackgroundColorSwatchIcon13 = createBackgroundColorSwatchIcon(
|
|
|
23129
22993
|
const DocParagraphBackgroundColorSwatchIcon14 = createBackgroundColorSwatchIcon(14);
|
|
23130
22994
|
const DocParagraphBackgroundColorSwatchIcon15 = createBackgroundColorSwatchIcon(15);
|
|
23131
22995
|
|
|
23132
|
-
|
|
23133
|
-
//#region src/views/mobile-element-menu/MobileDocElementMenu.tsx
|
|
22996
|
+
// src/views/mobile-element-menu/MobileDocElementMenu.tsx
|
|
23134
22997
|
const MOBILE_DOC_ELEMENT_MENU = "docs-ui.mobile-element-menu";
|
|
23135
22998
|
const schemas = [{
|
|
23136
22999
|
key: "edit",
|
|
@@ -23163,8 +23026,7 @@ function MobileDocElementMenuPopup({ popup }) {
|
|
|
23163
23026
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileDocElementMenu, { ...popup.extraProps });
|
|
23164
23027
|
}
|
|
23165
23028
|
|
|
23166
|
-
|
|
23167
|
-
//#region src/views/mobile/MobileDocPasteOptions.tsx
|
|
23029
|
+
// src/views/mobile/MobileDocPasteOptions.tsx
|
|
23168
23030
|
function MobileDocPasteOptions({ popup }) {
|
|
23169
23031
|
var _renders$getRenderUni;
|
|
23170
23032
|
const { unitId } = popup.extraProps;
|
|
@@ -23246,8 +23108,7 @@ function MobileDocPasteOptions({ popup }) {
|
|
|
23246
23108
|
})] });
|
|
23247
23109
|
}
|
|
23248
23110
|
|
|
23249
|
-
|
|
23250
|
-
//#region src/views/header-footer/panel/use-header-footer-options.ts
|
|
23111
|
+
// src/views/header-footer/panel/use-header-footer-options.ts
|
|
23251
23112
|
function getSegmentId(documentStyle, editArea, pageIndex, page) {
|
|
23252
23113
|
const { useFirstPageHeaderFooter, evenAndOddHeaders, defaultHeaderId, defaultFooterId, firstPageHeaderId, firstPageFooterId, evenPageHeaderId, evenPageFooterId } = documentStyle;
|
|
23253
23114
|
const isFirstPage = page ? page.pageNumber === page.pageNumberStart : pageIndex === 0;
|
|
@@ -23407,8 +23268,7 @@ function getHeaderFooterVariant(documentStyle, pageIndex, page) {
|
|
|
23407
23268
|
return "default";
|
|
23408
23269
|
}
|
|
23409
23270
|
|
|
23410
|
-
|
|
23411
|
-
//#region src/views/header-footer/panel/DocHeaderFooterOptions.tsx
|
|
23271
|
+
// src/views/header-footer/panel/DocHeaderFooterOptions.tsx
|
|
23412
23272
|
const DocHeaderFooterOptions = (props) => {
|
|
23413
23273
|
const docSelectionRenderService = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(props.unitId).with(DocSelectionRenderService);
|
|
23414
23274
|
const segmentContext = (0, _univerjs_ui.useObservable)(docSelectionRenderService.segmentContext$, {
|
|
@@ -23480,8 +23340,7 @@ function DocHeaderFooterOptionsContent({ unitId }) {
|
|
|
23480
23340
|
});
|
|
23481
23341
|
}
|
|
23482
23342
|
|
|
23483
|
-
|
|
23484
|
-
//#region src/views/header-footer/panel/DocHeaderFooterPanel.tsx
|
|
23343
|
+
// src/views/header-footer/panel/DocHeaderFooterPanel.tsx
|
|
23485
23344
|
const DocHeaderFooterPanel = (props) => {
|
|
23486
23345
|
var _renderManagerService;
|
|
23487
23346
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
@@ -23501,8 +23360,7 @@ const DocHeaderFooterPanel = (props) => {
|
|
|
23501
23360
|
});
|
|
23502
23361
|
};
|
|
23503
23362
|
|
|
23504
|
-
|
|
23505
|
-
//#region src/views/paragraph-setting/line-spacing.ts
|
|
23363
|
+
// src/views/paragraph-setting/line-spacing.ts
|
|
23506
23364
|
const AUTO_LINE_SPACING_CONFIG = {
|
|
23507
23365
|
min: 1,
|
|
23508
23366
|
max: 5,
|
|
@@ -23564,8 +23422,7 @@ function convertLineSpacingForRuleChange(currentStoredValue, currentRule, nextRu
|
|
|
23564
23422
|
return round(_univerjs_core.DEFAULT_STYLES.fs * currentStoredValue, 4);
|
|
23565
23423
|
}
|
|
23566
23424
|
|
|
23567
|
-
|
|
23568
|
-
//#region src/views/paragraph-setting/hook/utils.ts
|
|
23425
|
+
// src/views/paragraph-setting/hook/utils.ts
|
|
23569
23426
|
const PARAGRAPH_LAYOUT_BLOCK_TYPES = /* @__PURE__ */ new Set([
|
|
23570
23427
|
_univerjs_core.DocumentBlockRangeType.CALLOUT,
|
|
23571
23428
|
_univerjs_core.DocumentBlockRangeType.CODE,
|
|
@@ -23767,8 +23624,59 @@ const useFirstParagraphLineSpacing = (paragraph) => {
|
|
|
23767
23624
|
};
|
|
23768
23625
|
};
|
|
23769
23626
|
|
|
23770
|
-
|
|
23771
|
-
|
|
23627
|
+
// src/views/paragraph-setting/ParagraphWordWrapSetting.tsx
|
|
23628
|
+
function ParagraphWordWrapSetting() {
|
|
23629
|
+
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
23630
|
+
const instanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
23631
|
+
const selectionService = (0, _univerjs_ui.useDependency)(_univerjs_docs.DocSelectionManagerService);
|
|
23632
|
+
const label = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService).t("docs-ui.doc.paragraphSetting.wordWrap");
|
|
23633
|
+
const readState = (0, react.useCallback)(() => {
|
|
23634
|
+
var _document$getSelfOrHe, _ranges$;
|
|
23635
|
+
const document = instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
23636
|
+
const ranges = selectionService.getDocRanges();
|
|
23637
|
+
const body = document === null || document === void 0 || (_document$getSelfOrHe = document.getSelfOrHeaderFooterModel((_ranges$ = ranges[0]) === null || _ranges$ === void 0 ? void 0 : _ranges$.segmentId)) === null || _document$getSelfOrHe === void 0 ? void 0 : _document$getSelfOrHe.getBody();
|
|
23638
|
+
const paragraphs = body && ranges.length ? _univerjs_core.BuildTextUtils.range.getParagraphsInRanges(ranges, body.paragraphs ?? [], body.dataStream) ?? [] : [];
|
|
23639
|
+
const values = paragraphs.map((paragraph) => (0, _univerjs_core.resolveDocumentParagraphWordWrap)(document.getSnapshot(), paragraph));
|
|
23640
|
+
return {
|
|
23641
|
+
checked: values[0] === _univerjs_core.BooleanNumber.TRUE,
|
|
23642
|
+
mixed: values.some((value) => value !== values[0]),
|
|
23643
|
+
disabled: paragraphs.length === 0
|
|
23644
|
+
};
|
|
23645
|
+
}, [instanceService, selectionService]);
|
|
23646
|
+
const [state, setState] = (0, react.useState)(readState);
|
|
23647
|
+
const refresh = (0, react.useCallback)(() => setState(readState()), [readState]);
|
|
23648
|
+
(0, react.useEffect)(() => {
|
|
23649
|
+
const selection = selectionService.textSelection$.subscribe(refresh);
|
|
23650
|
+
const mutation = commandService.onCommandExecuted((command) => {
|
|
23651
|
+
if (command.id === _univerjs_docs.RichTextEditingMutation.id) refresh();
|
|
23652
|
+
});
|
|
23653
|
+
return () => {
|
|
23654
|
+
selection.unsubscribe();
|
|
23655
|
+
mutation.dispose();
|
|
23656
|
+
};
|
|
23657
|
+
}, [
|
|
23658
|
+
commandService,
|
|
23659
|
+
refresh,
|
|
23660
|
+
selectionService
|
|
23661
|
+
]);
|
|
23662
|
+
const apply = async (checked) => {
|
|
23663
|
+
await commandService.executeCommand(DocParagraphSettingCommand.id, { paragraph: { wordWrap: checked ? _univerjs_core.BooleanNumber.TRUE : _univerjs_core.BooleanNumber.FALSE } });
|
|
23664
|
+
refresh();
|
|
23665
|
+
};
|
|
23666
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23667
|
+
"data-u-editor-interaction-boundary": "true",
|
|
23668
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
23669
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, {
|
|
23670
|
+
checked: state.checked && !state.mixed,
|
|
23671
|
+
indeterminate: state.mixed,
|
|
23672
|
+
disabled: state.disabled,
|
|
23673
|
+
onChange: (checked) => apply(checked === true),
|
|
23674
|
+
children: label
|
|
23675
|
+
})
|
|
23676
|
+
});
|
|
23677
|
+
}
|
|
23678
|
+
|
|
23679
|
+
// src/views/paragraph-setting/Setting.tsx
|
|
23772
23680
|
const ALIGNMENT_OPTIONS = [
|
|
23773
23681
|
{
|
|
23774
23682
|
label: "docs-ui.toolbar.alignLeft",
|
|
@@ -23972,13 +23880,16 @@ function ParagraphSetting({ RowComponent = ParagraphSettingRow, NumberComponent
|
|
|
23972
23880
|
})
|
|
23973
23881
|
]
|
|
23974
23882
|
})
|
|
23883
|
+
}),
|
|
23884
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23885
|
+
className: "univer-mt-5",
|
|
23886
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ParagraphWordWrapSetting, {})
|
|
23975
23887
|
})
|
|
23976
23888
|
]
|
|
23977
23889
|
});
|
|
23978
23890
|
}
|
|
23979
23891
|
|
|
23980
|
-
|
|
23981
|
-
//#region src/views/paragraph-setting/index.tsx
|
|
23892
|
+
// src/views/paragraph-setting/index.tsx
|
|
23982
23893
|
const isRangesEqual = (oldRanges, ranges) => {
|
|
23983
23894
|
return ranges.length === oldRanges.length && oldRanges.some((oldRange) => ranges.some((range) => range.startOffset === oldRange.startOffset && range.endOffset === oldRange.endOffset));
|
|
23984
23895
|
};
|
|
@@ -24014,8 +23925,7 @@ function ParagraphSettingIndex(props) {
|
|
|
24014
23925
|
});
|
|
24015
23926
|
}
|
|
24016
23927
|
|
|
24017
|
-
|
|
24018
|
-
//#region src/views/permission/DocObjectPermissionEntry.tsx
|
|
23928
|
+
// src/views/permission/DocObjectPermissionEntry.tsx
|
|
24019
23929
|
function DocObjectPermissionEntry({ unitId, id, objectType, segmentId = "" }) {
|
|
24020
23930
|
const injector = (0, _univerjs_ui.useInjector)();
|
|
24021
23931
|
const instances = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
@@ -24054,8 +23964,7 @@ function DocObjectPermissionEntry({ unitId, id, objectType, segmentId = "" }) {
|
|
|
24054
23964
|
});
|
|
24055
23965
|
}
|
|
24056
23966
|
|
|
24057
|
-
|
|
24058
|
-
//#region src/views/section-setting/use-section-setting.ts
|
|
23967
|
+
// src/views/section-setting/use-section-setting.ts
|
|
24059
23968
|
const DEFAULT_SECTION_COLUMN_GAP = 18;
|
|
24060
23969
|
function getCommonValue(values) {
|
|
24061
23970
|
const first = values[0];
|
|
@@ -24226,8 +24135,7 @@ function useSectionSetting() {
|
|
|
24226
24135
|
};
|
|
24227
24136
|
}
|
|
24228
24137
|
|
|
24229
|
-
|
|
24230
|
-
//#region src/views/section-setting/Setting.tsx
|
|
24138
|
+
// src/views/section-setting/Setting.tsx
|
|
24231
24139
|
function SettingRow(props) {
|
|
24232
24140
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
24233
24141
|
className: "univer-grid univer-min-h-8 univer-items-center univer-gap-3",
|
|
@@ -24490,8 +24398,7 @@ function SectionSetting({ RowComponent = SettingRow, InputNumberComponent = _uni
|
|
|
24490
24398
|
});
|
|
24491
24399
|
}
|
|
24492
24400
|
|
|
24493
|
-
|
|
24494
|
-
//#region src/views/section-setting/index.tsx
|
|
24401
|
+
// src/views/section-setting/index.tsx
|
|
24495
24402
|
function SectionSettingIndex(props) {
|
|
24496
24403
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
24497
24404
|
const [key, setKey] = (0, react.useState)(() => (0, _univerjs_core.generateRandomId)(4));
|
|
@@ -24509,8 +24416,7 @@ function SectionSettingIndex(props) {
|
|
|
24509
24416
|
});
|
|
24510
24417
|
}
|
|
24511
24418
|
|
|
24512
|
-
|
|
24513
|
-
//#region src/views/mobile/MobileDocSettings.tsx
|
|
24419
|
+
// src/views/mobile/MobileDocSettings.tsx
|
|
24514
24420
|
function MobileSettingRow({ label, unit, children }) {
|
|
24515
24421
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
24516
24422
|
className: "univer-flex univer-min-h-12 univer-flex-col univer-gap-2",
|
|
@@ -24662,8 +24568,7 @@ function MobileHeaderFooterOptions({ unitId }) {
|
|
|
24662
24568
|
});
|
|
24663
24569
|
}
|
|
24664
24570
|
|
|
24665
|
-
|
|
24666
|
-
//#region src/views/table/create/TableCreate.tsx
|
|
24571
|
+
// src/views/table/create/TableCreate.tsx
|
|
24667
24572
|
const DocCreateTableConfirm = ({ handleRowColChange, tableCreateParams }) => {
|
|
24668
24573
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
24669
24574
|
const [rowCount, setRowCount] = (0, react.useState)(3);
|
|
@@ -24707,8 +24612,7 @@ const DocCreateTableConfirm = ({ handleRowColChange, tableCreateParams }) => {
|
|
|
24707
24612
|
});
|
|
24708
24613
|
};
|
|
24709
24614
|
|
|
24710
|
-
|
|
24711
|
-
//#region src/controllers/mobile/components.controller.ts
|
|
24615
|
+
// src/controllers/mobile/components.controller.ts
|
|
24712
24616
|
/**
|
|
24713
24617
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
24714
24618
|
*
|
|
@@ -24730,14 +24634,8 @@ let MobileComponentsController = class MobileComponentsController extends _unive
|
|
|
24730
24634
|
this._componentManager = _componentManager;
|
|
24731
24635
|
this._iconManager = _iconManager;
|
|
24732
24636
|
this._registerComponents();
|
|
24733
|
-
this._registerParts();
|
|
24734
24637
|
this._registerIcons();
|
|
24735
24638
|
}
|
|
24736
|
-
_registerParts() {
|
|
24737
|
-
const componentManager = this._componentManager;
|
|
24738
|
-
this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
|
|
24739
|
-
this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, MobileDocPasteOptions));
|
|
24740
|
-
}
|
|
24741
24639
|
_registerIcons() {
|
|
24742
24640
|
this.disposeWithMe(this._iconManager.register({
|
|
24743
24641
|
DocPasteOptionsIcon: _univerjs_icons.DocPasteOptionsIcon,
|
|
@@ -24834,12 +24732,14 @@ let MobileComponentsController = class MobileComponentsController extends _unive
|
|
|
24834
24732
|
this.disposeWithMe(this._componentManager.register(BULLET_LIST_TYPE_COMPONENT, BulletListTypePicker));
|
|
24835
24733
|
this.disposeWithMe(this._componentManager.register(ORDER_LIST_TYPE_COMPONENT, OrderListTypePicker));
|
|
24836
24734
|
this.disposeWithMe(this._componentManager.register(DOC_LAYOUT_RECOVERY_COMPONENT, DocLayoutRecovery));
|
|
24735
|
+
const componentManager = this._componentManager;
|
|
24736
|
+
this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
|
|
24737
|
+
this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, MobileDocPasteOptions));
|
|
24837
24738
|
}
|
|
24838
24739
|
};
|
|
24839
24740
|
MobileComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.IconManager))], MobileComponentsController);
|
|
24840
24741
|
|
|
24841
|
-
|
|
24842
|
-
//#region src/consts/mobile-context.ts
|
|
24742
|
+
// src/consts/mobile-context.ts
|
|
24843
24743
|
/**
|
|
24844
24744
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
24845
24745
|
*
|
|
@@ -24858,8 +24758,7 @@ MobileComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.I
|
|
|
24858
24758
|
const DOC_CARET_MENU_ID = "docs.contextMenu.caret";
|
|
24859
24759
|
const MOBILE_DOC_PINCH_ZOOMING = "MOBILE_DOC_PINCH_ZOOMING";
|
|
24860
24760
|
|
|
24861
|
-
|
|
24862
|
-
//#region src/menu/mobile-schema.ts
|
|
24761
|
+
// src/menu/mobile-schema.ts
|
|
24863
24762
|
const mobileMenuSchema = {
|
|
24864
24763
|
[_univerjs_ui.ContextMenuPosition.MAIN_AREA]: { [_univerjs_ui.ContextMenuGroup.QUICK]: {
|
|
24865
24764
|
[DocSelectWordCommand.id]: {
|
|
@@ -24897,8 +24796,7 @@ const mobileMenuSchema = {
|
|
|
24897
24796
|
}
|
|
24898
24797
|
};
|
|
24899
24798
|
|
|
24900
|
-
|
|
24901
|
-
//#region src/views/mobile-doc-toolbar/MobileDocToolbar.tsx
|
|
24799
|
+
// src/views/mobile-doc-toolbar/MobileDocToolbar.tsx
|
|
24902
24800
|
const MOBILE_DOC_INSERT_GROUP = "doc.mobile.insert";
|
|
24903
24801
|
const MOBILE_DOC_FORMAT_QUICK_GROUP = "doc.mobile.format.quick";
|
|
24904
24802
|
const MOBILE_DOC_FORMAT_DETAIL_GROUP = "doc.mobile.format.detail";
|
|
@@ -25185,8 +25083,7 @@ function MobileDocToolbar() {
|
|
|
25185
25083
|
] });
|
|
25186
25084
|
}
|
|
25187
25085
|
|
|
25188
|
-
|
|
25189
|
-
//#region src/services/doc-mobile-element-menu.service.ts
|
|
25086
|
+
// src/services/doc-mobile-element-menu.service.ts
|
|
25190
25087
|
let DocMobileElementMenuService = class DocMobileElementMenuService extends _univerjs_core.Disposable {
|
|
25191
25088
|
constructor(_popupService, instanceService) {
|
|
25192
25089
|
super();
|
|
@@ -25261,8 +25158,7 @@ let DocMobileElementMenuService = class DocMobileElementMenuService extends _uni
|
|
|
25261
25158
|
};
|
|
25262
25159
|
DocMobileElementMenuService = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(DocCanvasPopManagerService)), __decorateParam(1, _univerjs_core.IUniverInstanceService)], DocMobileElementMenuService);
|
|
25263
25160
|
|
|
25264
|
-
|
|
25265
|
-
//#region src/views/mobile/MobileDocCanvasViewport.tsx
|
|
25161
|
+
// src/views/mobile/MobileDocCanvasViewport.tsx
|
|
25266
25162
|
function MobileDocCanvasViewport({ containerRef, canvasRef }) {
|
|
25267
25163
|
const instances = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
25268
25164
|
const renders = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService);
|
|
@@ -25322,8 +25218,7 @@ function MobileDocCanvasViewport({ containerRef, canvasRef }) {
|
|
|
25322
25218
|
return null;
|
|
25323
25219
|
}
|
|
25324
25220
|
|
|
25325
|
-
|
|
25326
|
-
//#region src/controllers/mobile/ui.controller.ts
|
|
25221
|
+
// src/controllers/mobile/ui.controller.ts
|
|
25327
25222
|
/**
|
|
25328
25223
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
25329
25224
|
*
|
|
@@ -25384,8 +25279,7 @@ DocMobileUIController = __decorate([
|
|
|
25384
25279
|
__decorateParam(4, _univerjs_ui.IUIPartsService)
|
|
25385
25280
|
], DocMobileUIController);
|
|
25386
25281
|
|
|
25387
|
-
|
|
25388
|
-
//#region src/controllers/render-controllers/doc-canvas-popup-layout-interaction.controller.ts
|
|
25282
|
+
// src/controllers/render-controllers/doc-canvas-popup-layout-interaction.controller.ts
|
|
25389
25283
|
let DocCanvasPopupLayoutInteractionController = class DocCanvasPopupLayoutInteractionController extends _univerjs_core.Disposable {
|
|
25390
25284
|
constructor(_context, _canvasPopupManagerService, _docLayoutInteractionService) {
|
|
25391
25285
|
super();
|
|
@@ -25410,8 +25304,7 @@ let DocCanvasPopupLayoutInteractionController = class DocCanvasPopupLayoutIntera
|
|
|
25410
25304
|
};
|
|
25411
25305
|
DocCanvasPopupLayoutInteractionController = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(DocCanvasPopManagerService)), __decorateParam(2, (0, _univerjs_core.Inject)(DocLayoutInteractionService))], DocCanvasPopupLayoutInteractionController);
|
|
25412
25306
|
|
|
25413
|
-
|
|
25414
|
-
//#region src/controllers/render-controllers/doc-checklist.render-controller.ts
|
|
25307
|
+
// src/controllers/render-controllers/doc-checklist.render-controller.ts
|
|
25415
25308
|
let DocChecklistRenderController = class DocChecklistRenderController extends _univerjs_core.Disposable {
|
|
25416
25309
|
constructor(_context, _docSkeletonManagerService, _commandService, _docEventManagerService, _textSelectionManagerService) {
|
|
25417
25310
|
super();
|
|
@@ -25453,8 +25346,7 @@ DocChecklistRenderController = __decorate([
|
|
|
25453
25346
|
__decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_docs.DocSelectionManagerService))
|
|
25454
25347
|
], DocChecklistRenderController);
|
|
25455
25348
|
|
|
25456
|
-
|
|
25457
|
-
//#region src/controllers/render-controllers/doc-clipboard.controller.ts
|
|
25349
|
+
// src/controllers/render-controllers/doc-clipboard.controller.ts
|
|
25458
25350
|
let DocClipboardController = class DocClipboardController extends _univerjs_core.RxDisposable {
|
|
25459
25351
|
constructor(_context, _commandService, _docClipboardService, _docSelectionRenderService, _contextService, _editorService) {
|
|
25460
25352
|
super();
|
|
@@ -25499,8 +25391,7 @@ DocClipboardController = __decorate([
|
|
|
25499
25391
|
__decorateParam(5, IEditorService)
|
|
25500
25392
|
], DocClipboardController);
|
|
25501
25393
|
|
|
25502
|
-
|
|
25503
|
-
//#region src/controllers/render-controllers/doc-contextmenu.render-controller.ts
|
|
25394
|
+
// src/controllers/render-controllers/doc-contextmenu.render-controller.ts
|
|
25504
25395
|
const SKIP_UNIT_IDS = [
|
|
25505
25396
|
_univerjs_core.DEFAULT_EMPTY_DOCUMENT_VALUE,
|
|
25506
25397
|
_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,
|
|
@@ -25571,8 +25462,7 @@ function isRangeIntersectingBlock(range, startIndex, endIndex) {
|
|
|
25571
25462
|
return Math.max(range.startOffset, startIndex) <= Math.min(range.endOffset, endIndex);
|
|
25572
25463
|
}
|
|
25573
25464
|
|
|
25574
|
-
|
|
25575
|
-
//#region src/controllers/render-controllers/doc-editor-bridge.controller.ts
|
|
25465
|
+
// src/controllers/render-controllers/doc-editor-bridge.controller.ts
|
|
25576
25466
|
let DocEditorBridgeController = class DocEditorBridgeController extends _univerjs_core.Disposable {
|
|
25577
25467
|
constructor(_context, _univerInstanceService, _editorService, _commandService, _docSelectionRenderService, _docSkeletonManagerService, _renderManagerService) {
|
|
25578
25468
|
super();
|
|
@@ -25684,8 +25574,7 @@ DocEditorBridgeController = __decorate([
|
|
|
25684
25574
|
__decorateParam(6, _univerjs_engine_render.IRenderManagerService)
|
|
25685
25575
|
], DocEditorBridgeController);
|
|
25686
25576
|
|
|
25687
|
-
|
|
25688
|
-
//#region src/controllers/render-controllers/doc-ime-input.controller.ts
|
|
25577
|
+
// src/controllers/render-controllers/doc-ime-input.controller.ts
|
|
25689
25578
|
let DocIMEInputController = class DocIMEInputController extends _univerjs_core.Disposable {
|
|
25690
25579
|
constructor(_context, _docSelectionRenderService, _docImeInputManagerService, _docSkeletonManagerService, _docStateEmitService, _docSelectionManagerService, _commandService) {
|
|
25691
25580
|
super();
|
|
@@ -25816,8 +25705,7 @@ DocIMEInputController = __decorate([
|
|
|
25816
25705
|
__decorateParam(6, _univerjs_core.ICommandService)
|
|
25817
25706
|
], DocIMEInputController);
|
|
25818
25707
|
|
|
25819
|
-
|
|
25820
|
-
//#region src/controllers/render-controllers/doc-input.controller.ts
|
|
25708
|
+
// src/controllers/render-controllers/doc-input.controller.ts
|
|
25821
25709
|
let DocInputController = class DocInputController extends _univerjs_core.Disposable {
|
|
25822
25710
|
constructor(_context, _docSelectionRenderService, _docSkeletonManagerService, _commandService, _docMenuStyleService, _embedInteractionBoundaryService, _embedRuntimeFocusCoordinator) {
|
|
25823
25711
|
super();
|
|
@@ -25907,8 +25795,7 @@ DocInputController = __decorate([
|
|
|
25907
25795
|
__decorateParam(6, (0, _univerjs_core.Optional)(IDocEmbedRuntimeFocusCoordinator))
|
|
25908
25796
|
], DocInputController);
|
|
25909
25797
|
|
|
25910
|
-
|
|
25911
|
-
//#region src/controllers/render-controllers/doc-layout-progress.render-controller.ts
|
|
25798
|
+
// src/controllers/render-controllers/doc-layout-progress.render-controller.ts
|
|
25912
25799
|
const DOC_LAYOUT_PROGRESS_DELAY_MS = 2e3;
|
|
25913
25800
|
const DOC_LAYOUT_PROGRESS_CANCEL_GRACE_MS = 1e3;
|
|
25914
25801
|
function resolveDocLayoutProgressPercent(progress) {
|
|
@@ -26003,8 +25890,7 @@ let DocLayoutProgressRenderController = class DocLayoutProgressRenderController
|
|
|
26003
25890
|
};
|
|
26004
25891
|
DocLayoutProgressRenderController = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_docs.DocSkeletonManagerService)), __decorateParam(2, (0, _univerjs_core.Inject)(DocLayoutProgressService))], DocLayoutProgressRenderController);
|
|
26005
25892
|
|
|
26006
|
-
|
|
26007
|
-
//#region src/controllers/render-controllers/doc-layout-recovery.render-controller.ts
|
|
25893
|
+
// src/controllers/render-controllers/doc-layout-recovery.render-controller.ts
|
|
26008
25894
|
function acquireDocLayoutRecoveryInteractionLock(canvas, shortcutService, blurSelection) {
|
|
26009
25895
|
const previousPointerEvents = canvas.style.pointerEvents;
|
|
26010
25896
|
const previousOpacity = canvas.style.opacity;
|
|
@@ -26084,8 +25970,7 @@ DocLayoutRecoveryRenderController = __decorate([
|
|
|
26084
25970
|
__decorateParam(4, _univerjs_ui.IShortcutService)
|
|
26085
25971
|
], DocLayoutRecoveryRenderController);
|
|
26086
25972
|
|
|
26087
|
-
|
|
26088
|
-
//#region src/controllers/render-controllers/doc-paste-options.render-controller.ts
|
|
25973
|
+
// src/controllers/render-controllers/doc-paste-options.render-controller.ts
|
|
26089
25974
|
let DocPasteOptionsRenderController = class DocPasteOptionsRenderController extends _univerjs_core.Disposable {
|
|
26090
25975
|
constructor(_context, _clipboard, selection, popupManager, contextService) {
|
|
26091
25976
|
super();
|
|
@@ -26148,8 +26033,7 @@ DocPasteOptionsRenderController = __decorate([
|
|
|
26148
26033
|
__decorateParam(4, _univerjs_core.IContextService)
|
|
26149
26034
|
], DocPasteOptionsRenderController);
|
|
26150
26035
|
|
|
26151
|
-
|
|
26152
|
-
//#region src/controllers/render-controllers/doc-resize.render-controller.ts
|
|
26036
|
+
// src/controllers/render-controllers/doc-resize.render-controller.ts
|
|
26153
26037
|
function hasRenderableDocSkeleton(component) {
|
|
26154
26038
|
if (typeof component !== "object" || component == null || !("getSkeleton" in component) || typeof component.getSkeleton !== "function") return false;
|
|
26155
26039
|
const skeleton = component.getSkeleton();
|
|
@@ -26192,8 +26076,7 @@ DocResizeRenderController = __decorate([
|
|
|
26192
26076
|
__decorateParam(3, _univerjs_ui.ISidebarService)
|
|
26193
26077
|
], DocResizeRenderController);
|
|
26194
26078
|
|
|
26195
|
-
|
|
26196
|
-
//#region src/controllers/render-controllers/mobile/back-scroll.render-controller.ts
|
|
26079
|
+
// src/controllers/render-controllers/mobile/back-scroll.render-controller.ts
|
|
26197
26080
|
const MOBILE_CARET_MARGIN = 32;
|
|
26198
26081
|
const MOBILE_TOOLBAR_HEIGHT = 48;
|
|
26199
26082
|
const MOBILE_CARET_VIEWPORT_RATIO = .4;
|
|
@@ -26233,8 +26116,7 @@ MobileDocBackScrollRenderController = __decorate([
|
|
|
26233
26116
|
__decorateParam(5, (0, _univerjs_core.Inject)(DocPageLayoutService))
|
|
26234
26117
|
], MobileDocBackScrollRenderController);
|
|
26235
26118
|
|
|
26236
|
-
|
|
26237
|
-
//#region src/controllers/render-controllers/doc-selection-render.util.ts
|
|
26119
|
+
// src/controllers/render-controllers/doc-selection-render.util.ts
|
|
26238
26120
|
function isEmbedInteractionEvent(evt) {
|
|
26239
26121
|
var _document$elementFrom;
|
|
26240
26122
|
const target = evt.target;
|
|
@@ -26265,8 +26147,7 @@ function getEventClientPoint(evt, target) {
|
|
|
26265
26147
|
};
|
|
26266
26148
|
}
|
|
26267
26149
|
|
|
26268
|
-
|
|
26269
|
-
//#region src/controllers/render-controllers/mobile/doc-selection-render.controller.ts
|
|
26150
|
+
// src/controllers/render-controllers/mobile/doc-selection-render.controller.ts
|
|
26270
26151
|
const DOUBLE_TAP_INTERVAL = 450;
|
|
26271
26152
|
const DOUBLE_TAP_DISTANCE = 28;
|
|
26272
26153
|
const DRAG_THRESHOLD = 12;
|
|
@@ -26761,8 +26642,7 @@ function calculateInertiaVelocity(history, duration, displacement) {
|
|
|
26761
26642
|
};
|
|
26762
26643
|
}
|
|
26763
26644
|
|
|
26764
|
-
|
|
26765
|
-
//#region src/controllers/render-controllers/mobile/doc.render-controller.ts
|
|
26645
|
+
// src/controllers/render-controllers/mobile/doc.render-controller.ts
|
|
26766
26646
|
const MOBILE_DOC_OUTER_MARGIN = 12;
|
|
26767
26647
|
let MobileDocRenderController = class MobileDocRenderController extends DocRenderController {
|
|
26768
26648
|
constructor(context, commandService, docSelectionRenderService, docSkeletonManagerService, editorService, renderManagerService, univerInstanceService, docPageLayoutService, textSelectionManagerService, docViewScaleService, themeService, docLayoutExecutorService, docLayoutInteractionService, logService) {
|
|
@@ -26822,8 +26702,7 @@ MobileDocRenderController = __decorate([
|
|
|
26822
26702
|
__decorateParam(13, _univerjs_core.ILogService)
|
|
26823
26703
|
], MobileDocRenderController);
|
|
26824
26704
|
|
|
26825
|
-
|
|
26826
|
-
//#region src/controllers/render-controllers/zoom.render-controller.ts
|
|
26705
|
+
// src/controllers/render-controllers/zoom.render-controller.ts
|
|
26827
26706
|
function shouldHandleDocWheelZoom(event, focusingDoc, _documentFlavor) {
|
|
26828
26707
|
return focusingDoc && (event.ctrlKey || event.metaKey);
|
|
26829
26708
|
}
|
|
@@ -26949,8 +26828,7 @@ DocZoomRenderController = __decorate([
|
|
|
26949
26828
|
__decorateParam(10, (0, _univerjs_core.Optional)(IDocEmbedInteractionBoundaryService))
|
|
26950
26829
|
], DocZoomRenderController);
|
|
26951
26830
|
|
|
26952
|
-
|
|
26953
|
-
//#region src/controllers/render-controllers/mobile/doc-pinch-zoom.ts
|
|
26831
|
+
// src/controllers/render-controllers/mobile/doc-pinch-zoom.ts
|
|
26954
26832
|
const MOBILE_DOC_ZOOM_MIN = .5;
|
|
26955
26833
|
const MOBILE_DOC_ZOOM_MAX = 3;
|
|
26956
26834
|
function resolveMobileDocPinchZoomRatio(initialZoomRatio, initialDistance, currentDistance) {
|
|
@@ -27048,8 +26926,7 @@ var MobileDocPinchZoomGesture = class extends _univerjs_core.Disposable {
|
|
|
27048
26926
|
}
|
|
27049
26927
|
};
|
|
27050
26928
|
|
|
27051
|
-
|
|
27052
|
-
//#region src/controllers/render-controllers/mobile/zoom.render-controller.ts
|
|
26929
|
+
// src/controllers/render-controllers/mobile/zoom.render-controller.ts
|
|
27053
26930
|
let MobileDocZoomRenderController = class MobileDocZoomRenderController extends DocZoomRenderController {
|
|
27054
26931
|
constructor(context, contextService, docSkeletonManagerService, univerInstanceService, commandService, textSelectionManagerService, editorService, docPageLayoutService, renderManagerService, docViewScaleService, embedInteractionBoundaryService) {
|
|
27055
26932
|
super(context, contextService, docSkeletonManagerService, univerInstanceService, commandService, textSelectionManagerService, editorService, docPageLayoutService, renderManagerService, docViewScaleService, embedInteractionBoundaryService);
|
|
@@ -27104,8 +26981,7 @@ MobileDocZoomRenderController = __decorate([
|
|
|
27104
26981
|
__decorateParam(10, (0, _univerjs_core.Optional)(IDocEmbedInteractionBoundaryService))
|
|
27105
26982
|
], MobileDocZoomRenderController);
|
|
27106
26983
|
|
|
27107
|
-
|
|
27108
|
-
//#region src/services/doc-ime-state-change-interceptor.service.ts
|
|
26984
|
+
// src/services/doc-ime-state-change-interceptor.service.ts
|
|
27109
26985
|
let DocIMEStateChangeInterceptorService = class DocIMEStateChangeInterceptorService {
|
|
27110
26986
|
constructor(_renderManagerService) {
|
|
27111
26987
|
this._renderManagerService = _renderManagerService;
|
|
@@ -27141,8 +27017,7 @@ let DocIMEStateChangeInterceptorService = class DocIMEStateChangeInterceptorServ
|
|
|
27141
27017
|
};
|
|
27142
27018
|
DocIMEStateChangeInterceptorService = __decorate([__decorateParam(0, _univerjs_engine_render.IRenderManagerService)], DocIMEStateChangeInterceptorService);
|
|
27143
27019
|
|
|
27144
|
-
|
|
27145
|
-
//#region src/services/doc-print-interceptor.service.ts
|
|
27020
|
+
// src/services/doc-print-interceptor.service.ts
|
|
27146
27021
|
const PRINTING_COMPONENT_COLLECT = (0, _univerjs_core.createInterceptorKey)("PRINTING_COMPONENT_COLLECT");
|
|
27147
27022
|
const PRINTING_DOM_COLLECT = (0, _univerjs_core.createInterceptorKey)("PRINTING_DOM_COLLECT");
|
|
27148
27023
|
var DocPrintInterceptorService = class extends _univerjs_core.Disposable {
|
|
@@ -27203,8 +27078,7 @@ function collectPageDrawingIds(page, drawingIds) {
|
|
|
27203
27078
|
for (const table of page.skeTables.values()) for (const row of table.rows) for (const cell of row.cells) collectPageDrawingIds(cell, drawingIds);
|
|
27204
27079
|
}
|
|
27205
27080
|
|
|
27206
|
-
|
|
27207
|
-
//#region src/services/docs-render.service.ts
|
|
27081
|
+
// src/services/docs-render.service.ts
|
|
27208
27082
|
const DOC_MAIN_CANVAS_ID = "univer-doc-main-canvas";
|
|
27209
27083
|
function getDocsCanvasBackgroundColor(documentFlavor, canvasColorService, editorBackgroundColor, isEditor) {
|
|
27210
27084
|
return resolveDocRenderBackground({
|
|
@@ -27255,8 +27129,7 @@ let DocsRenderService = class DocsRenderService extends _univerjs_core.RxDisposa
|
|
|
27255
27129
|
};
|
|
27256
27130
|
DocsRenderService = __decorate([__decorateParam(0, _univerjs_core.IUniverInstanceService), __decorateParam(1, _univerjs_engine_render.IRenderManagerService)], DocsRenderService);
|
|
27257
27131
|
|
|
27258
|
-
|
|
27259
|
-
//#region src/views/float-toolbar/FloatToolbar.tsx
|
|
27132
|
+
// src/views/float-toolbar/FloatToolbar.tsx
|
|
27260
27133
|
const FLOAT_MENU_COMPONENT_KEY = "univer.doc.float-menu";
|
|
27261
27134
|
const DEFAULT_AVALIABLE_MENUS = [
|
|
27262
27135
|
FLOAT_TEXT_STYLE_MENU_ID,
|
|
@@ -27382,8 +27255,7 @@ function FloatToolbar(props) {
|
|
|
27382
27255
|
});
|
|
27383
27256
|
}
|
|
27384
27257
|
|
|
27385
|
-
|
|
27386
|
-
//#region src/services/float-menu.service.ts
|
|
27258
|
+
// src/services/float-menu.service.ts
|
|
27387
27259
|
const SKIP_SYMBOLS = [_univerjs_core.DataStreamTreeTokenType.CUSTOM_BLOCK, _univerjs_core.DataStreamTreeTokenType.PARAGRAPH];
|
|
27388
27260
|
let DocFloatMenuService = class DocFloatMenuService extends _univerjs_core.Disposable {
|
|
27389
27261
|
constructor(_context, _docSelectionManagerService, _docCanvasPopManagerService, _univerInstanceService, _docSelectionRenderService, _contextService, _contextMenuService, _permissionService, _docLayoutInteractionService, _embedRuntimeFocusCoordinator) {
|
|
@@ -27554,8 +27426,7 @@ function isRangeInCodeBlock(documentDataModel, range) {
|
|
|
27554
27426
|
return (((_documentDataModel$ge3 = documentDataModel.getBody()) === null || _documentDataModel$ge3 === void 0 ? void 0 : _documentDataModel$ge3.blockRanges) ?? []).some((blockRange) => blockRange.blockType === _univerjs_core.DocumentBlockRangeType.CODE && Math.max(range.startOffset, blockRange.startIndex) <= Math.min(range.endOffset, blockRange.endIndex));
|
|
27555
27427
|
}
|
|
27556
27428
|
|
|
27557
|
-
|
|
27558
|
-
//#region src/services/mobile/mobile-text-selection-visuals.ts
|
|
27429
|
+
// src/services/mobile/mobile-text-selection-visuals.ts
|
|
27559
27430
|
const MOBILE_HANDLE_TOUCH_SIZE = 32;
|
|
27560
27431
|
const MOBILE_HANDLE_VISUAL_SIZE = 12;
|
|
27561
27432
|
const MOBILE_HANDLE_STEM_WIDTH = 2;
|
|
@@ -27687,8 +27558,7 @@ var MobileTextSelectionVisuals = class {
|
|
|
27687
27558
|
}
|
|
27688
27559
|
};
|
|
27689
27560
|
|
|
27690
|
-
|
|
27691
|
-
//#region src/services/mobile/doc-selection-render.service.ts
|
|
27561
|
+
// src/services/mobile/doc-selection-render.service.ts
|
|
27692
27562
|
const MOBILE_KEYBOARD_THRESHOLD = 80;
|
|
27693
27563
|
const MOBILE_INPUT_VIEWPORT_INSET = 1;
|
|
27694
27564
|
let MobileDocSelectionRenderService = class MobileDocSelectionRenderService extends DocSelectionRenderService {
|
|
@@ -27919,8 +27789,7 @@ MobileDocSelectionRenderService = __decorate([
|
|
|
27919
27789
|
__decorateParam(8, (0, _univerjs_core.Optional)(IDocEmbedRuntimeFocusCoordinator))
|
|
27920
27790
|
], MobileDocSelectionRenderService);
|
|
27921
27791
|
|
|
27922
|
-
|
|
27923
|
-
//#region src/services/mobile/doc-view-scale.ts
|
|
27792
|
+
// src/services/mobile/doc-view-scale.ts
|
|
27924
27793
|
/**
|
|
27925
27794
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
27926
27795
|
*
|
|
@@ -27943,8 +27812,7 @@ var MobileDocViewScaleService = class extends DocViewScaleService {
|
|
|
27943
27812
|
}
|
|
27944
27813
|
};
|
|
27945
27814
|
|
|
27946
|
-
|
|
27947
|
-
//#region src/services/mobile/float-menu.service.ts
|
|
27815
|
+
// src/services/mobile/float-menu.service.ts
|
|
27948
27816
|
var MobileDocFloatMenuService = class extends DocFloatMenuService {
|
|
27949
27817
|
_openSelectionMenu(unitId, range) {
|
|
27950
27818
|
const [anchor] = this._docCanvasPopManagerService.getRangeBounds(range, unitId) ?? [];
|
|
@@ -27966,8 +27834,7 @@ var MobileDocFloatMenuService = class extends DocFloatMenuService {
|
|
|
27966
27834
|
}
|
|
27967
27835
|
};
|
|
27968
27836
|
|
|
27969
|
-
|
|
27970
|
-
//#region src/mobile-plugin.ts
|
|
27837
|
+
// src/mobile-plugin.ts
|
|
27971
27838
|
let UniverDocsMobileUIPlugin = class UniverDocsMobileUIPlugin extends _univerjs_core.Plugin {
|
|
27972
27839
|
constructor(_config = defaultPluginMobileConfig, _injector, _renderManagerSrv, _commandService, _configService) {
|
|
27973
27840
|
super();
|
|
@@ -28188,8 +28055,7 @@ UniverDocsMobileUIPlugin = __decorate([
|
|
|
28188
28055
|
__decorateParam(4, _univerjs_core.IConfigService)
|
|
28189
28056
|
], UniverDocsMobileUIPlugin);
|
|
28190
28057
|
|
|
28191
|
-
|
|
28192
|
-
//#region src/views/header-footer/panel/DocHeaderFooterFields.tsx
|
|
28058
|
+
// src/views/header-footer/panel/DocHeaderFooterFields.tsx
|
|
28193
28059
|
function DocHeaderFooterFields({ unitId, disabled }) {
|
|
28194
28060
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
28195
28061
|
(0, _univerjs_ui.useObservable)(localeService.currentLocale$);
|
|
@@ -28368,8 +28234,7 @@ function DocHeaderFooterFields({ unitId, disabled }) {
|
|
|
28368
28234
|
});
|
|
28369
28235
|
}
|
|
28370
28236
|
|
|
28371
|
-
|
|
28372
|
-
//#region src/views/header-footer/panel/DocHeaderFooterRibbonControl.tsx
|
|
28237
|
+
// src/views/header-footer/panel/DocHeaderFooterRibbonControl.tsx
|
|
28373
28238
|
function DocHeaderFooterRibbonControl(props) {
|
|
28374
28239
|
const instances = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
28375
28240
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
@@ -28501,8 +28366,7 @@ function HeaderFooterRibbonControl({ kind, unitId }) {
|
|
|
28501
28366
|
});
|
|
28502
28367
|
}
|
|
28503
28368
|
|
|
28504
|
-
|
|
28505
|
-
//#region src/views/paragraph-menu/component-keys.ts
|
|
28369
|
+
// src/views/paragraph-menu/component-keys.ts
|
|
28506
28370
|
/**
|
|
28507
28371
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28508
28372
|
*
|
|
@@ -28521,8 +28385,7 @@ function HeaderFooterRibbonControl({ kind, unitId }) {
|
|
|
28521
28385
|
const DOC_PARAGRAPH_MENU_COMPONENT_KEY = "doc.paragraph.menu";
|
|
28522
28386
|
const DOC_TABLE_BLOCK_MENU_COMPONENT_KEY = "doc.table-block.menu";
|
|
28523
28387
|
|
|
28524
|
-
|
|
28525
|
-
//#region src/services/doc-paragraph-menu.service.ts
|
|
28388
|
+
// src/services/doc-paragraph-menu.service.ts
|
|
28526
28389
|
const BLOCK_RANGE_ICON_MAP = {
|
|
28527
28390
|
code: "CodeBlockIcon",
|
|
28528
28391
|
quote: "QuoteIcon",
|
|
@@ -29339,8 +29202,7 @@ function getBlockRangeAnchorRect(docEventManagerService, blockRange, fallbackPar
|
|
|
29339
29202
|
};
|
|
29340
29203
|
}
|
|
29341
29204
|
|
|
29342
|
-
|
|
29343
|
-
//#region src/views/paragraph-menu/paragraph-menu-position.ts
|
|
29205
|
+
// src/views/paragraph-menu/paragraph-menu-position.ts
|
|
29344
29206
|
function observeParagraphMenuPosition(element, popup, targets$) {
|
|
29345
29207
|
let anchor;
|
|
29346
29208
|
let table = false;
|
|
@@ -29407,8 +29269,7 @@ function observeParagraphMenuPosition(element, popup, targets$) {
|
|
|
29407
29269
|
};
|
|
29408
29270
|
}
|
|
29409
29271
|
|
|
29410
|
-
|
|
29411
|
-
//#region src/views/ParagraphMenu.tsx
|
|
29272
|
+
// src/views/ParagraphMenu.tsx
|
|
29412
29273
|
function getParagraphMenuPopupDirection(anchorLeft, menuWidth = 212, viewportPadding = 8, options = {}) {
|
|
29413
29274
|
const { anchorRight = anchorLeft, direction = "ltr", viewportWidth = Number.POSITIVE_INFINITY } = options;
|
|
29414
29275
|
const hasLeftSpace = anchorLeft - menuWidth >= viewportPadding;
|
|
@@ -30487,8 +30348,7 @@ function DragHandleDotsIcon() {
|
|
|
30487
30348
|
});
|
|
30488
30349
|
}
|
|
30489
30350
|
|
|
30490
|
-
|
|
30491
|
-
//#region src/controllers/components.controller.ts
|
|
30351
|
+
// src/controllers/components.controller.ts
|
|
30492
30352
|
/**
|
|
30493
30353
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
30494
30354
|
*
|
|
@@ -30511,14 +30371,8 @@ let ComponentsController = class ComponentsController extends _univerjs_core.Dis
|
|
|
30511
30371
|
this._componentManager = _componentManager;
|
|
30512
30372
|
this._iconManager = _iconManager;
|
|
30513
30373
|
this._registerComponents();
|
|
30514
|
-
this._registerParts();
|
|
30515
30374
|
this._registerIcons();
|
|
30516
30375
|
}
|
|
30517
|
-
_registerParts() {
|
|
30518
|
-
const componentManager = this._componentManager;
|
|
30519
|
-
this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, DocPasteOptions));
|
|
30520
|
-
this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
|
|
30521
|
-
}
|
|
30522
30376
|
_registerIcons() {
|
|
30523
30377
|
this.disposeWithMe(this._iconManager.register({
|
|
30524
30378
|
AlignTextBothIcon: _univerjs_icons.AlignTextBothIcon,
|
|
@@ -30623,12 +30477,14 @@ let ComponentsController = class ComponentsController extends _univerjs_core.Dis
|
|
|
30623
30477
|
].forEach(([key, comp]) => {
|
|
30624
30478
|
this.disposeWithMe(this._componentManager.register(key, comp));
|
|
30625
30479
|
});
|
|
30480
|
+
const componentManager = this._componentManager;
|
|
30481
|
+
this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, DocPasteOptions));
|
|
30482
|
+
this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
|
|
30626
30483
|
}
|
|
30627
30484
|
};
|
|
30628
30485
|
ComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.IconManager))], ComponentsController);
|
|
30629
30486
|
|
|
30630
|
-
|
|
30631
|
-
//#region src/controllers/doc-header-footer-ribbon.controller.ts
|
|
30487
|
+
// src/controllers/doc-header-footer-ribbon.controller.ts
|
|
30632
30488
|
let DocHeaderFooterRibbonController = class DocHeaderFooterRibbonController extends _univerjs_core.Disposable {
|
|
30633
30489
|
constructor(_context, skeletonManager, _instanceService, _ribbonService, _renderManager) {
|
|
30634
30490
|
super();
|
|
@@ -30664,8 +30520,7 @@ DocHeaderFooterRibbonController = __decorate([
|
|
|
30664
30520
|
__decorateParam(4, _univerjs_engine_render.IRenderManagerService)
|
|
30665
30521
|
], DocHeaderFooterRibbonController);
|
|
30666
30522
|
|
|
30667
|
-
|
|
30668
|
-
//#region src/controllers/format-painter.controller.ts
|
|
30523
|
+
// src/controllers/format-painter.controller.ts
|
|
30669
30524
|
let DocFormatPainterController = class DocFormatPainterController extends _univerjs_core.Disposable {
|
|
30670
30525
|
constructor(session, selections, styles, instances, context, permissions, editors, commands) {
|
|
30671
30526
|
super();
|
|
@@ -30731,8 +30586,7 @@ DocFormatPainterController = __decorate([
|
|
|
30731
30586
|
__decorateParam(7, _univerjs_core.ICommandService)
|
|
30732
30587
|
], DocFormatPainterController);
|
|
30733
30588
|
|
|
30734
|
-
|
|
30735
|
-
//#region src/controllers/render-controllers/doc-field.render-controller.ts
|
|
30589
|
+
// src/controllers/render-controllers/doc-field.render-controller.ts
|
|
30736
30590
|
let DocFieldRenderController = class DocFieldRenderController extends _univerjs_core.Disposable {
|
|
30737
30591
|
constructor(_context, _events, _selections, theme, _instances) {
|
|
30738
30592
|
super();
|
|
@@ -30808,8 +30662,7 @@ DocFieldRenderController = __decorate([
|
|
|
30808
30662
|
__decorateParam(4, _univerjs_core.IUniverInstanceService)
|
|
30809
30663
|
], DocFieldRenderController);
|
|
30810
30664
|
|
|
30811
|
-
|
|
30812
|
-
//#region src/controllers/render-controllers/doc-selection-render.controller.ts
|
|
30665
|
+
// src/controllers/render-controllers/doc-selection-render.controller.ts
|
|
30813
30666
|
let DocSelectionRenderController = class DocSelectionRenderController extends _univerjs_core.Disposable {
|
|
30814
30667
|
constructor(_context, _commandService, _editorService, _instanceSrv, _docSelectionRenderService, _docSkeletonManagerService, _docSelectionManagerService, _embedInteractionBoundaryService, _embedRuntimeFocusCoordinator) {
|
|
30815
30668
|
super();
|
|
@@ -31020,8 +30873,7 @@ DocSelectionRenderController = __decorate([
|
|
|
31020
30873
|
__decorateParam(8, (0, _univerjs_core.Optional)(IDocEmbedRuntimeFocusCoordinator))
|
|
31021
30874
|
], DocSelectionRenderController);
|
|
31022
30875
|
|
|
31023
|
-
|
|
31024
|
-
//#region src/controllers/render-controllers/format-painter.render-controller.ts
|
|
30876
|
+
// src/controllers/render-controllers/format-painter.render-controller.ts
|
|
31025
30877
|
let DocFormatPainterRenderController = class DocFormatPainterRenderController extends _univerjs_core.Disposable {
|
|
31026
30878
|
constructor(context, session, selections, instances) {
|
|
31027
30879
|
super();
|
|
@@ -31052,8 +30904,7 @@ DocFormatPainterRenderController = __decorate([
|
|
|
31052
30904
|
__decorateParam(3, _univerjs_core.IUniverInstanceService)
|
|
31053
30905
|
], DocFormatPainterRenderController);
|
|
31054
30906
|
|
|
31055
|
-
|
|
31056
|
-
//#region src/services/doc-contextual-ribbon.service.ts
|
|
30907
|
+
// src/services/doc-contextual-ribbon.service.ts
|
|
31057
30908
|
/**
|
|
31058
30909
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
31059
30910
|
*
|
|
@@ -31105,8 +30956,7 @@ let DocContextualRibbonService = class DocContextualRibbonService extends _unive
|
|
|
31105
30956
|
};
|
|
31106
30957
|
DocContextualRibbonService = __decorate([__decorateParam(0, _univerjs_ui.IRibbonService)], DocContextualRibbonService);
|
|
31107
30958
|
|
|
31108
|
-
|
|
31109
|
-
//#region src/views/heading-collapse-shape.ts
|
|
30959
|
+
// src/views/heading-collapse-shape.ts
|
|
31110
30960
|
var HeadingCollapseShape = class extends _univerjs_engine_render.Shape {
|
|
31111
30961
|
constructor(key, colors, activate) {
|
|
31112
30962
|
super(key, {
|
|
@@ -31224,8 +31074,7 @@ var HeadingCollapseShape = class extends _univerjs_engine_render.Shape {
|
|
|
31224
31074
|
}
|
|
31225
31075
|
};
|
|
31226
31076
|
|
|
31227
|
-
|
|
31228
|
-
//#region src/services/doc-heading-collapse.service.ts
|
|
31077
|
+
// src/services/doc-heading-collapse.service.ts
|
|
31229
31078
|
let DocHeadingCollapseService = class DocHeadingCollapseService extends _univerjs_core.Disposable {
|
|
31230
31079
|
constructor(_context, _skeletonManager, _eventManager, _selections, _commandService, _layoutService, themeService, localeService) {
|
|
31231
31080
|
super();
|
|
@@ -31388,8 +31237,7 @@ DocHeadingCollapseService = __decorate([
|
|
|
31388
31237
|
__decorateParam(7, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService))
|
|
31389
31238
|
], DocHeadingCollapseService);
|
|
31390
31239
|
|
|
31391
|
-
|
|
31392
|
-
//#region src/shortcuts/core-editing.shortcut.ts
|
|
31240
|
+
// src/shortcuts/core-editing.shortcut.ts
|
|
31393
31241
|
const BreakLineShortcut = {
|
|
31394
31242
|
id: EnterCommand.id,
|
|
31395
31243
|
preconditions: whenDocAndEditorFocusedWithBreakLine,
|
|
@@ -31442,8 +31290,7 @@ const DeleteLineEndShortcut = {
|
|
|
31442
31290
|
staticParameters: { granularity: "line" }
|
|
31443
31291
|
};
|
|
31444
31292
|
|
|
31445
|
-
|
|
31446
|
-
//#region src/shortcuts/cursor.shortcut.ts
|
|
31293
|
+
// src/shortcuts/cursor.shortcut.ts
|
|
31447
31294
|
function moveCursorShortcut(direction, granularity, binding, mac = binding, win = binding, linux = binding) {
|
|
31448
31295
|
return {
|
|
31449
31296
|
id: MoveCursorOperation.id,
|
|
@@ -31542,8 +31389,7 @@ const SelectAllShortcut = {
|
|
|
31542
31389
|
preconditions: (contextService) => contextService.getContextValue(_univerjs_core.FOCUSING_UNIVER_EDITOR) && (contextService.getContextValue(_univerjs_core.FOCUSING_DOC) || contextService.getContextValue(_univerjs_core.EDITOR_ACTIVATED))
|
|
31543
31390
|
};
|
|
31544
31391
|
|
|
31545
|
-
|
|
31546
|
-
//#region src/shortcuts/heading.shortcut.ts
|
|
31392
|
+
// src/shortcuts/heading.shortcut.ts
|
|
31547
31393
|
function headingShortcut(id, key) {
|
|
31548
31394
|
const binding = key | _univerjs_ui.MetaKeys.CTRL_COMMAND | _univerjs_ui.MetaKeys.ALT;
|
|
31549
31395
|
return {
|
|
@@ -31562,8 +31408,7 @@ const H3HeadingShortcut = headingShortcut(H3HeadingCommand.id, _univerjs_ui.KeyC
|
|
|
31562
31408
|
const H4HeadingShortcut = headingShortcut(H4HeadingCommand.id, _univerjs_ui.KeyCode.Digit4);
|
|
31563
31409
|
const H5HeadingShortcut = headingShortcut(H5HeadingCommand.id, _univerjs_ui.KeyCode.Digit5);
|
|
31564
31410
|
|
|
31565
|
-
|
|
31566
|
-
//#region src/plugin.ts
|
|
31411
|
+
// src/plugin.ts
|
|
31567
31412
|
let UniverDocsUIPlugin = class UniverDocsUIPlugin extends _univerjs_core.Plugin {
|
|
31568
31413
|
constructor(_config = defaultPluginConfig, _injector, _renderManagerSrv, _commandService, _configService) {
|
|
31569
31414
|
super();
|
|
@@ -31840,8 +31685,7 @@ UniverDocsUIPlugin = __decorate([
|
|
|
31840
31685
|
__decorateParam(4, _univerjs_core.IConfigService)
|
|
31841
31686
|
], UniverDocsUIPlugin);
|
|
31842
31687
|
|
|
31843
|
-
|
|
31844
|
-
//#region src/services/clipboard/rtf-to-plain-text.ts
|
|
31688
|
+
// src/services/clipboard/rtf-to-plain-text.ts
|
|
31845
31689
|
/**
|
|
31846
31690
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
31847
31691
|
*
|
|
@@ -32001,8 +31845,7 @@ function decodeWindows1252(code) {
|
|
|
32001
31845
|
}[code] ?? String.fromCharCode(code);
|
|
32002
31846
|
}
|
|
32003
31847
|
|
|
32004
|
-
|
|
32005
|
-
//#region src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
|
|
31848
|
+
// src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
|
|
32006
31849
|
const COLOR_TOKENS = [
|
|
32007
31850
|
"gray.900",
|
|
32008
31851
|
"red.500",
|
|
@@ -32198,8 +32041,7 @@ function FormatButton(props) {
|
|
|
32198
32041
|
});
|
|
32199
32042
|
}
|
|
32200
32043
|
|
|
32201
|
-
|
|
32202
|
-
//#region src/views/rich-text-editor/hooks/editor-undo-redo-keyboard.ts
|
|
32044
|
+
// src/views/rich-text-editor/hooks/editor-undo-redo-keyboard.ts
|
|
32203
32045
|
function isSheetFormulaEditor(editorUnitId, univerInstanceService) {
|
|
32204
32046
|
var _documentModel$getBod;
|
|
32205
32047
|
if (editorUnitId !== _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY && editorUnitId !== _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) return false;
|
|
@@ -32279,8 +32121,7 @@ function createEditorUndoRedoKeyboardConfig(options) {
|
|
|
32279
32121
|
};
|
|
32280
32122
|
}
|
|
32281
32123
|
|
|
32282
|
-
|
|
32283
|
-
//#region src/views/rich-text-editor/hooks/use-editor.ts
|
|
32124
|
+
// src/views/rich-text-editor/hooks/use-editor.ts
|
|
32284
32125
|
function useEditor(opts) {
|
|
32285
32126
|
const { autoFocus: _autoFocus, cancelDefaultResizeListener, canvasStyle, container, disableBackScroll, documentLayoutSize, emitSelectionWhileDragging, editorId, initialValue, isSingle, pixelRatio, preserveHostFocus, renderConfig } = opts;
|
|
32286
32127
|
const autoFocus = (0, react.useMemo)(() => _autoFocus ?? false, []);
|
|
@@ -32346,8 +32187,7 @@ function useEditor(opts) {
|
|
|
32346
32187
|
return editor;
|
|
32347
32188
|
}
|
|
32348
32189
|
|
|
32349
|
-
|
|
32350
|
-
//#region src/views/rich-text-editor/hooks/use-editor-click-outside.ts
|
|
32190
|
+
// src/views/rich-text-editor/hooks/use-editor-click-outside.ts
|
|
32351
32191
|
const useEditorClickOutside = (editorId, containerRef, onClickOutside) => {
|
|
32352
32192
|
const editorService = (0, _univerjs_ui.useDependency)(IEditorService);
|
|
32353
32193
|
(0, react.useEffect)(() => {
|
|
@@ -32372,8 +32212,7 @@ const useEditorClickOutside = (editorId, containerRef, onClickOutside) => {
|
|
|
32372
32212
|
]);
|
|
32373
32213
|
};
|
|
32374
32214
|
|
|
32375
|
-
|
|
32376
|
-
//#region src/views/rich-text-editor/hooks/use-is-focusing.ts
|
|
32215
|
+
// src/views/rich-text-editor/hooks/use-is-focusing.ts
|
|
32377
32216
|
/**
|
|
32378
32217
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
32379
32218
|
*
|
|
@@ -32396,8 +32235,7 @@ function useIsFocusing(editorId) {
|
|
|
32396
32235
|
return Boolean(((docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing) ?? false) && (selections === null || selections === void 0 ? void 0 : selections.textRanges.some((r) => r.collapsed)));
|
|
32397
32236
|
}
|
|
32398
32237
|
|
|
32399
|
-
|
|
32400
|
-
//#region src/views/rich-text-editor/hooks/use-keyboard-event.ts
|
|
32238
|
+
// src/views/rich-text-editor/hooks/use-keyboard-event.ts
|
|
32401
32239
|
function useKeyboardEvent(isNeed, config, editor) {
|
|
32402
32240
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
32403
32241
|
const shortcutService = (0, _univerjs_ui.useDependency)(_univerjs_ui.IShortcutService);
|
|
@@ -32445,8 +32283,7 @@ function useKeyboardEvent(isNeed, config, editor) {
|
|
|
32445
32283
|
]);
|
|
32446
32284
|
}
|
|
32447
32285
|
|
|
32448
|
-
|
|
32449
|
-
//#region src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
|
|
32286
|
+
// src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
|
|
32450
32287
|
const useLeftAndRightArrow = (isNeed, selectingMode, editor, onMoveInEditor) => {
|
|
32451
32288
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
32452
32289
|
const shortcutService = (0, _univerjs_ui.useDependency)(_univerjs_ui.IShortcutService);
|
|
@@ -32526,8 +32363,7 @@ const useLeftAndRightArrow = (isNeed, selectingMode, editor, onMoveInEditor) =>
|
|
|
32526
32363
|
]);
|
|
32527
32364
|
};
|
|
32528
32365
|
|
|
32529
|
-
|
|
32530
|
-
//#region src/views/rich-text-editor/hooks/use-on-change.ts
|
|
32366
|
+
// src/views/rich-text-editor/hooks/use-on-change.ts
|
|
32531
32367
|
function useOnChange(editor, onChange) {
|
|
32532
32368
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
32533
32369
|
(0, react.useEffect)(() => {
|
|
@@ -32550,8 +32386,7 @@ function useOnChange(editor, onChange) {
|
|
|
32550
32386
|
]);
|
|
32551
32387
|
}
|
|
32552
32388
|
|
|
32553
|
-
|
|
32554
|
-
//#region src/views/rich-text-editor/hooks/use-resize.ts
|
|
32389
|
+
// src/views/rich-text-editor/hooks/use-resize.ts
|
|
32555
32390
|
function resizeEditor(editor, isSingle, layoutSize, pixelRatio, documentLayoutSize) {
|
|
32556
32391
|
var _editor$render$compon;
|
|
32557
32392
|
if (editor.render.isDisposed()) return;
|
|
@@ -32710,8 +32545,7 @@ const useResize = (editor, isSingle = true, autoScrollbar, autoScroll, layoutSiz
|
|
|
32710
32545
|
};
|
|
32711
32546
|
};
|
|
32712
32547
|
|
|
32713
|
-
|
|
32714
|
-
//#region src/views/RichTextEditor.tsx
|
|
32548
|
+
// src/views/RichTextEditor.tsx
|
|
32715
32549
|
const RichTextEditor = (props) => {
|
|
32716
32550
|
const { className, autoFocus, onFocusChange: _onFocusChange, initialValue, onClickOutside: _onClickOutside, preserveHostFocus, cancelDefaultResizeListener, documentLayoutSize, autoScroll = true, autoScrollbar = true, emitSelectionWhileDragging, keyboardEventsOnSelection = false, keyboardEventConfig, layoutSize, pixelRatio, moveCursor = true, style, isSingle, editorId: propsEditorId, onHeightChange, onChange: _onChange, defaultHeight = 32, maxHeight = 32, icon, editorRef, placeholder, noStyle, canvasStyle, renderConfig } = props;
|
|
32717
32551
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
@@ -32828,8 +32662,7 @@ const RichTextEditor = (props) => {
|
|
|
32828
32662
|
});
|
|
32829
32663
|
};
|
|
32830
32664
|
|
|
32831
|
-
|
|
32832
|
-
//#region src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx
|
|
32665
|
+
// src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx
|
|
32833
32666
|
/** Compact object text input; expanding keeps the same document editor mounted. */
|
|
32834
32667
|
function MobileRichTextEditor(props) {
|
|
32835
32668
|
var _props$canvasStyle;
|
|
@@ -32943,7 +32776,6 @@ function MobileRichTextEditor(props) {
|
|
|
32943
32776
|
});
|
|
32944
32777
|
}
|
|
32945
32778
|
|
|
32946
|
-
//#endregion
|
|
32947
32779
|
exports.AfterSpaceCommand = AfterSpaceCommand;
|
|
32948
32780
|
exports.AlignCenterCommand = AlignCenterCommand;
|
|
32949
32781
|
exports.AlignJustifyCommand = AlignJustifyCommand;
|