@univerjs/docs-ui 1.3.1 → 1.5.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/README.md +7 -75
- package/lib/cjs/facade.js +1 -3
- package/lib/cjs/index.js +384 -523
- 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 +384 -522
- 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.css +4 -21
- package/lib/index.js +384 -522
- 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.157.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,28 +274,25 @@ function _typeof(o) {
|
|
|
280
274
|
}, _typeof(o);
|
|
281
275
|
}
|
|
282
276
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
function toPrimitive(t, r) {
|
|
277
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
278
|
+
function toPrimitive(t, e) {
|
|
286
279
|
if ("object" != _typeof(t) || !t) return t;
|
|
287
|
-
var
|
|
288
|
-
if (void 0 !==
|
|
289
|
-
var i =
|
|
280
|
+
var r;
|
|
281
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
282
|
+
var i = r.call(t, e || "default");
|
|
290
283
|
if ("object" != _typeof(i)) return i;
|
|
291
284
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
292
285
|
}
|
|
293
|
-
return ("string" ===
|
|
286
|
+
return ("string" === e ? 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.157.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.157.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.157.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.157.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.5.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;
|
|
@@ -23193,7 +23055,7 @@ function MobileDocPasteOptions({ popup }) {
|
|
|
23193
23055
|
if (!state || state.unitId !== unitId) return null;
|
|
23194
23056
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
23195
23057
|
"aria-label": localeService.t("docs-ui.pasteOptions.title"),
|
|
23196
|
-
className: "
|
|
23058
|
+
className: "[&_svg]:! univer-min-w-11 univer-shadow-sm",
|
|
23197
23059
|
style: keyboard.visible ? {
|
|
23198
23060
|
position: "fixed",
|
|
23199
23061
|
bottom: keyboard.inset + 56,
|
|
@@ -23203,6 +23065,7 @@ function MobileDocPasteOptions({ popup }) {
|
|
|
23203
23065
|
selection === null || selection === void 0 || selection.suspendMobileEditingInput();
|
|
23204
23066
|
setOpen(true);
|
|
23205
23067
|
},
|
|
23068
|
+
size: "icon",
|
|
23206
23069
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.DocPasteOptionsIcon, { "aria-hidden": "true" })
|
|
23207
23070
|
}), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23208
23071
|
className: "univer-pointer-events-none univer-fixed univer-inset-x-0 univer-top-0",
|
|
@@ -23220,8 +23083,8 @@ function MobileDocPasteOptions({ popup }) {
|
|
|
23220
23083
|
className: "univer-flex univer-w-full univer-items-center univer-justify-between univer-gap-2 univer-px-4",
|
|
23221
23084
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("docs-ui.pasteOptions.title") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
23222
23085
|
variant: "text",
|
|
23223
|
-
className: "univer-min-h-11",
|
|
23224
23086
|
onClick: () => setOpen(false),
|
|
23087
|
+
size: "middle",
|
|
23225
23088
|
children: localeService.t("docs-ui.mobile.done")
|
|
23226
23089
|
})]
|
|
23227
23090
|
}),
|
|
@@ -23234,8 +23097,9 @@ function MobileDocPasteOptions({ popup }) {
|
|
|
23234
23097
|
"aria-checked": state.mode === option.value,
|
|
23235
23098
|
disabled: busy,
|
|
23236
23099
|
variant: "text",
|
|
23237
|
-
className: "
|
|
23100
|
+
className: "univer-justify-start univer-whitespace-normal univer-text-start",
|
|
23238
23101
|
onClick: () => changeMode(option.value),
|
|
23102
|
+
size: "middle",
|
|
23239
23103
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
23240
23104
|
className: "univer-inline-flex univer-size-5 univer-shrink-0 univer-items-center",
|
|
23241
23105
|
children: state.mode === option.value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CheckMarkIcon, {})
|
|
@@ -23246,8 +23110,7 @@ function MobileDocPasteOptions({ popup }) {
|
|
|
23246
23110
|
})] });
|
|
23247
23111
|
}
|
|
23248
23112
|
|
|
23249
|
-
|
|
23250
|
-
//#region src/views/header-footer/panel/use-header-footer-options.ts
|
|
23113
|
+
// src/views/header-footer/panel/use-header-footer-options.ts
|
|
23251
23114
|
function getSegmentId(documentStyle, editArea, pageIndex, page) {
|
|
23252
23115
|
const { useFirstPageHeaderFooter, evenAndOddHeaders, defaultHeaderId, defaultFooterId, firstPageHeaderId, firstPageFooterId, evenPageHeaderId, evenPageFooterId } = documentStyle;
|
|
23253
23116
|
const isFirstPage = page ? page.pageNumber === page.pageNumberStart : pageIndex === 0;
|
|
@@ -23407,8 +23270,7 @@ function getHeaderFooterVariant(documentStyle, pageIndex, page) {
|
|
|
23407
23270
|
return "default";
|
|
23408
23271
|
}
|
|
23409
23272
|
|
|
23410
|
-
|
|
23411
|
-
//#region src/views/header-footer/panel/DocHeaderFooterOptions.tsx
|
|
23273
|
+
// src/views/header-footer/panel/DocHeaderFooterOptions.tsx
|
|
23412
23274
|
const DocHeaderFooterOptions = (props) => {
|
|
23413
23275
|
const docSelectionRenderService = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(props.unitId).with(DocSelectionRenderService);
|
|
23414
23276
|
const segmentContext = (0, _univerjs_ui.useObservable)(docSelectionRenderService.segmentContext$, {
|
|
@@ -23448,9 +23310,9 @@ function DocHeaderFooterOptionsContent({ unitId }) {
|
|
|
23448
23310
|
}) })]
|
|
23449
23311
|
}),
|
|
23450
23312
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23451
|
-
className: "univer-mb-1 univer-
|
|
23313
|
+
className: "univer-mb-1 univer-grid univer-grid-cols-2 univer-items-end univer-gap-4",
|
|
23452
23314
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("docs-ui.headerFooter.headerTopMargin") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.InputNumber, {
|
|
23453
|
-
className: "univer-mt-1.5 univer-w-
|
|
23315
|
+
className: "univer-mt-1.5 univer-w-full",
|
|
23454
23316
|
min: 0,
|
|
23455
23317
|
max: 200,
|
|
23456
23318
|
precision: 1,
|
|
@@ -23459,7 +23321,7 @@ function DocHeaderFooterOptionsContent({ unitId }) {
|
|
|
23459
23321
|
handleMarginChange(val ?? 0, "marginHeader");
|
|
23460
23322
|
}
|
|
23461
23323
|
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("docs-ui.headerFooter.footerBottomMargin") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.InputNumber, {
|
|
23462
|
-
className: "univer-mt-1.5 univer-w-
|
|
23324
|
+
className: "univer-mt-1.5 univer-w-full",
|
|
23463
23325
|
min: 0,
|
|
23464
23326
|
max: 200,
|
|
23465
23327
|
precision: 1,
|
|
@@ -23480,8 +23342,7 @@ function DocHeaderFooterOptionsContent({ unitId }) {
|
|
|
23480
23342
|
});
|
|
23481
23343
|
}
|
|
23482
23344
|
|
|
23483
|
-
|
|
23484
|
-
//#region src/views/header-footer/panel/DocHeaderFooterPanel.tsx
|
|
23345
|
+
// src/views/header-footer/panel/DocHeaderFooterPanel.tsx
|
|
23485
23346
|
const DocHeaderFooterPanel = (props) => {
|
|
23486
23347
|
var _renderManagerService;
|
|
23487
23348
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
@@ -23501,8 +23362,7 @@ const DocHeaderFooterPanel = (props) => {
|
|
|
23501
23362
|
});
|
|
23502
23363
|
};
|
|
23503
23364
|
|
|
23504
|
-
|
|
23505
|
-
//#region src/views/paragraph-setting/line-spacing.ts
|
|
23365
|
+
// src/views/paragraph-setting/line-spacing.ts
|
|
23506
23366
|
const AUTO_LINE_SPACING_CONFIG = {
|
|
23507
23367
|
min: 1,
|
|
23508
23368
|
max: 5,
|
|
@@ -23564,8 +23424,7 @@ function convertLineSpacingForRuleChange(currentStoredValue, currentRule, nextRu
|
|
|
23564
23424
|
return round(_univerjs_core.DEFAULT_STYLES.fs * currentStoredValue, 4);
|
|
23565
23425
|
}
|
|
23566
23426
|
|
|
23567
|
-
|
|
23568
|
-
//#region src/views/paragraph-setting/hook/utils.ts
|
|
23427
|
+
// src/views/paragraph-setting/hook/utils.ts
|
|
23569
23428
|
const PARAGRAPH_LAYOUT_BLOCK_TYPES = /* @__PURE__ */ new Set([
|
|
23570
23429
|
_univerjs_core.DocumentBlockRangeType.CALLOUT,
|
|
23571
23430
|
_univerjs_core.DocumentBlockRangeType.CODE,
|
|
@@ -23767,8 +23626,59 @@ const useFirstParagraphLineSpacing = (paragraph) => {
|
|
|
23767
23626
|
};
|
|
23768
23627
|
};
|
|
23769
23628
|
|
|
23770
|
-
|
|
23771
|
-
|
|
23629
|
+
// src/views/paragraph-setting/ParagraphWordWrapSetting.tsx
|
|
23630
|
+
function ParagraphWordWrapSetting() {
|
|
23631
|
+
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
23632
|
+
const instanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
23633
|
+
const selectionService = (0, _univerjs_ui.useDependency)(_univerjs_docs.DocSelectionManagerService);
|
|
23634
|
+
const label = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService).t("docs-ui.doc.paragraphSetting.wordWrap");
|
|
23635
|
+
const readState = (0, react.useCallback)(() => {
|
|
23636
|
+
var _document$getSelfOrHe, _ranges$;
|
|
23637
|
+
const document = instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
23638
|
+
const ranges = selectionService.getDocRanges();
|
|
23639
|
+
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();
|
|
23640
|
+
const paragraphs = body && ranges.length ? _univerjs_core.BuildTextUtils.range.getParagraphsInRanges(ranges, body.paragraphs ?? [], body.dataStream) ?? [] : [];
|
|
23641
|
+
const values = paragraphs.map((paragraph) => (0, _univerjs_core.resolveDocumentParagraphWordWrap)(document.getSnapshot(), paragraph));
|
|
23642
|
+
return {
|
|
23643
|
+
checked: values[0] === _univerjs_core.BooleanNumber.TRUE,
|
|
23644
|
+
mixed: values.some((value) => value !== values[0]),
|
|
23645
|
+
disabled: paragraphs.length === 0
|
|
23646
|
+
};
|
|
23647
|
+
}, [instanceService, selectionService]);
|
|
23648
|
+
const [state, setState] = (0, react.useState)(readState);
|
|
23649
|
+
const refresh = (0, react.useCallback)(() => setState(readState()), [readState]);
|
|
23650
|
+
(0, react.useEffect)(() => {
|
|
23651
|
+
const selection = selectionService.textSelection$.subscribe(refresh);
|
|
23652
|
+
const mutation = commandService.onCommandExecuted((command) => {
|
|
23653
|
+
if (command.id === _univerjs_docs.RichTextEditingMutation.id) refresh();
|
|
23654
|
+
});
|
|
23655
|
+
return () => {
|
|
23656
|
+
selection.unsubscribe();
|
|
23657
|
+
mutation.dispose();
|
|
23658
|
+
};
|
|
23659
|
+
}, [
|
|
23660
|
+
commandService,
|
|
23661
|
+
refresh,
|
|
23662
|
+
selectionService
|
|
23663
|
+
]);
|
|
23664
|
+
const apply = async (checked) => {
|
|
23665
|
+
await commandService.executeCommand(DocParagraphSettingCommand.id, { paragraph: { wordWrap: checked ? _univerjs_core.BooleanNumber.TRUE : _univerjs_core.BooleanNumber.FALSE } });
|
|
23666
|
+
refresh();
|
|
23667
|
+
};
|
|
23668
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23669
|
+
"data-u-editor-interaction-boundary": "true",
|
|
23670
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
23671
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, {
|
|
23672
|
+
checked: state.checked && !state.mixed,
|
|
23673
|
+
indeterminate: state.mixed,
|
|
23674
|
+
disabled: state.disabled,
|
|
23675
|
+
onChange: (checked) => apply(checked === true),
|
|
23676
|
+
children: label
|
|
23677
|
+
})
|
|
23678
|
+
});
|
|
23679
|
+
}
|
|
23680
|
+
|
|
23681
|
+
// src/views/paragraph-setting/Setting.tsx
|
|
23772
23682
|
const ALIGNMENT_OPTIONS = [
|
|
23773
23683
|
{
|
|
23774
23684
|
label: "docs-ui.toolbar.alignLeft",
|
|
@@ -23972,13 +23882,16 @@ function ParagraphSetting({ RowComponent = ParagraphSettingRow, NumberComponent
|
|
|
23972
23882
|
})
|
|
23973
23883
|
]
|
|
23974
23884
|
})
|
|
23885
|
+
}),
|
|
23886
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23887
|
+
className: "univer-mt-5",
|
|
23888
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ParagraphWordWrapSetting, {})
|
|
23975
23889
|
})
|
|
23976
23890
|
]
|
|
23977
23891
|
});
|
|
23978
23892
|
}
|
|
23979
23893
|
|
|
23980
|
-
|
|
23981
|
-
//#region src/views/paragraph-setting/index.tsx
|
|
23894
|
+
// src/views/paragraph-setting/index.tsx
|
|
23982
23895
|
const isRangesEqual = (oldRanges, ranges) => {
|
|
23983
23896
|
return ranges.length === oldRanges.length && oldRanges.some((oldRange) => ranges.some((range) => range.startOffset === oldRange.startOffset && range.endOffset === oldRange.endOffset));
|
|
23984
23897
|
};
|
|
@@ -24014,8 +23927,7 @@ function ParagraphSettingIndex(props) {
|
|
|
24014
23927
|
});
|
|
24015
23928
|
}
|
|
24016
23929
|
|
|
24017
|
-
|
|
24018
|
-
//#region src/views/permission/DocObjectPermissionEntry.tsx
|
|
23930
|
+
// src/views/permission/DocObjectPermissionEntry.tsx
|
|
24019
23931
|
function DocObjectPermissionEntry({ unitId, id, objectType, segmentId = "" }) {
|
|
24020
23932
|
const injector = (0, _univerjs_ui.useInjector)();
|
|
24021
23933
|
const instances = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
@@ -24054,8 +23966,7 @@ function DocObjectPermissionEntry({ unitId, id, objectType, segmentId = "" }) {
|
|
|
24054
23966
|
});
|
|
24055
23967
|
}
|
|
24056
23968
|
|
|
24057
|
-
|
|
24058
|
-
//#region src/views/section-setting/use-section-setting.ts
|
|
23969
|
+
// src/views/section-setting/use-section-setting.ts
|
|
24059
23970
|
const DEFAULT_SECTION_COLUMN_GAP = 18;
|
|
24060
23971
|
function getCommonValue(values) {
|
|
24061
23972
|
const first = values[0];
|
|
@@ -24226,8 +24137,7 @@ function useSectionSetting() {
|
|
|
24226
24137
|
};
|
|
24227
24138
|
}
|
|
24228
24139
|
|
|
24229
|
-
|
|
24230
|
-
//#region src/views/section-setting/Setting.tsx
|
|
24140
|
+
// src/views/section-setting/Setting.tsx
|
|
24231
24141
|
function SettingRow(props) {
|
|
24232
24142
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
24233
24143
|
className: "univer-grid univer-min-h-8 univer-items-center univer-gap-3",
|
|
@@ -24490,8 +24400,7 @@ function SectionSetting({ RowComponent = SettingRow, InputNumberComponent = _uni
|
|
|
24490
24400
|
});
|
|
24491
24401
|
}
|
|
24492
24402
|
|
|
24493
|
-
|
|
24494
|
-
//#region src/views/section-setting/index.tsx
|
|
24403
|
+
// src/views/section-setting/index.tsx
|
|
24495
24404
|
function SectionSettingIndex(props) {
|
|
24496
24405
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
24497
24406
|
const [key, setKey] = (0, react.useState)(() => (0, _univerjs_core.generateRandomId)(4));
|
|
@@ -24509,8 +24418,7 @@ function SectionSettingIndex(props) {
|
|
|
24509
24418
|
});
|
|
24510
24419
|
}
|
|
24511
24420
|
|
|
24512
|
-
|
|
24513
|
-
//#region src/views/mobile/MobileDocSettings.tsx
|
|
24421
|
+
// src/views/mobile/MobileDocSettings.tsx
|
|
24514
24422
|
function MobileSettingRow({ label, unit, children }) {
|
|
24515
24423
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
24516
24424
|
className: "univer-flex univer-min-h-12 univer-flex-col univer-gap-2",
|
|
@@ -24526,13 +24434,16 @@ function MobileSettingRow({ label, unit, children }) {
|
|
|
24526
24434
|
const MobileSettingNumber = (0, react.forwardRef)((props, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.InputNumber, {
|
|
24527
24435
|
...props,
|
|
24528
24436
|
ref,
|
|
24529
|
-
className: (0, _univerjs_design.clsx)(props.className, "univer-
|
|
24530
|
-
inputClassName: (0, _univerjs_design.clsx)(props.inputClassName, "
|
|
24437
|
+
className: (0, _univerjs_design.clsx)(props.className, "univer-w-full"),
|
|
24438
|
+
inputClassName: (0, _univerjs_design.clsx)(props.inputClassName, ""),
|
|
24439
|
+
size: "small",
|
|
24440
|
+
controls: false
|
|
24531
24441
|
}));
|
|
24532
24442
|
function MobileSettingSelect(props) {
|
|
24533
24443
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.MobileSelect, {
|
|
24534
24444
|
...props,
|
|
24535
|
-
className: (0, _univerjs_design.clsx)(props.className, "univer-
|
|
24445
|
+
className: (0, _univerjs_design.clsx)(props.className, "univer-w-full"),
|
|
24446
|
+
size: "small"
|
|
24536
24447
|
});
|
|
24537
24448
|
}
|
|
24538
24449
|
function MobileParagraphNumber({ min = 0, max = 100, step = .1, precision = 1, onChange, ...props }) {
|
|
@@ -24551,8 +24462,9 @@ function MobileParagraphAlignmentButton({ label, selected, onClick, children })
|
|
|
24551
24462
|
variant: "text",
|
|
24552
24463
|
"aria-label": label,
|
|
24553
24464
|
"aria-pressed": selected,
|
|
24554
|
-
className: (0, _univerjs_design.clsx)("univer-
|
|
24465
|
+
className: (0, _univerjs_design.clsx)("univer-w-full", { "!univer-bg-gray-200 dark:!univer-bg-gray-700": selected }),
|
|
24555
24466
|
onClick,
|
|
24467
|
+
size: "middle",
|
|
24556
24468
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
24557
24469
|
className: "univer-flex univer-size-5 univer-items-center univer-justify-center univer-text-lg",
|
|
24558
24470
|
children
|
|
@@ -24653,8 +24565,9 @@ function MobileHeaderFooterOptions({ unitId }) {
|
|
|
24653
24565
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
24654
24566
|
className: "univer-flex",
|
|
24655
24567
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
24656
|
-
className: "univer-
|
|
24568
|
+
className: "univer-w-full",
|
|
24657
24569
|
onClick: closeHeaderFooter,
|
|
24570
|
+
size: "middle",
|
|
24658
24571
|
children: localeService.t("docs-ui.headerFooter.closeHeaderFooter")
|
|
24659
24572
|
})
|
|
24660
24573
|
})
|
|
@@ -24662,8 +24575,7 @@ function MobileHeaderFooterOptions({ unitId }) {
|
|
|
24662
24575
|
});
|
|
24663
24576
|
}
|
|
24664
24577
|
|
|
24665
|
-
|
|
24666
|
-
//#region src/views/table/create/TableCreate.tsx
|
|
24578
|
+
// src/views/table/create/TableCreate.tsx
|
|
24667
24579
|
const DocCreateTableConfirm = ({ handleRowColChange, tableCreateParams }) => {
|
|
24668
24580
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
24669
24581
|
const [rowCount, setRowCount] = (0, react.useState)(3);
|
|
@@ -24707,8 +24619,7 @@ const DocCreateTableConfirm = ({ handleRowColChange, tableCreateParams }) => {
|
|
|
24707
24619
|
});
|
|
24708
24620
|
};
|
|
24709
24621
|
|
|
24710
|
-
|
|
24711
|
-
//#region src/controllers/mobile/components.controller.ts
|
|
24622
|
+
// src/controllers/mobile/components.controller.ts
|
|
24712
24623
|
/**
|
|
24713
24624
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
24714
24625
|
*
|
|
@@ -24730,14 +24641,8 @@ let MobileComponentsController = class MobileComponentsController extends _unive
|
|
|
24730
24641
|
this._componentManager = _componentManager;
|
|
24731
24642
|
this._iconManager = _iconManager;
|
|
24732
24643
|
this._registerComponents();
|
|
24733
|
-
this._registerParts();
|
|
24734
24644
|
this._registerIcons();
|
|
24735
24645
|
}
|
|
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
24646
|
_registerIcons() {
|
|
24742
24647
|
this.disposeWithMe(this._iconManager.register({
|
|
24743
24648
|
DocPasteOptionsIcon: _univerjs_icons.DocPasteOptionsIcon,
|
|
@@ -24834,12 +24739,14 @@ let MobileComponentsController = class MobileComponentsController extends _unive
|
|
|
24834
24739
|
this.disposeWithMe(this._componentManager.register(BULLET_LIST_TYPE_COMPONENT, BulletListTypePicker));
|
|
24835
24740
|
this.disposeWithMe(this._componentManager.register(ORDER_LIST_TYPE_COMPONENT, OrderListTypePicker));
|
|
24836
24741
|
this.disposeWithMe(this._componentManager.register(DOC_LAYOUT_RECOVERY_COMPONENT, DocLayoutRecovery));
|
|
24742
|
+
const componentManager = this._componentManager;
|
|
24743
|
+
this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
|
|
24744
|
+
this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, MobileDocPasteOptions));
|
|
24837
24745
|
}
|
|
24838
24746
|
};
|
|
24839
24747
|
MobileComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.IconManager))], MobileComponentsController);
|
|
24840
24748
|
|
|
24841
|
-
|
|
24842
|
-
//#region src/consts/mobile-context.ts
|
|
24749
|
+
// src/consts/mobile-context.ts
|
|
24843
24750
|
/**
|
|
24844
24751
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
24845
24752
|
*
|
|
@@ -24858,8 +24765,7 @@ MobileComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.I
|
|
|
24858
24765
|
const DOC_CARET_MENU_ID = "docs.contextMenu.caret";
|
|
24859
24766
|
const MOBILE_DOC_PINCH_ZOOMING = "MOBILE_DOC_PINCH_ZOOMING";
|
|
24860
24767
|
|
|
24861
|
-
|
|
24862
|
-
//#region src/menu/mobile-schema.ts
|
|
24768
|
+
// src/menu/mobile-schema.ts
|
|
24863
24769
|
const mobileMenuSchema = {
|
|
24864
24770
|
[_univerjs_ui.ContextMenuPosition.MAIN_AREA]: { [_univerjs_ui.ContextMenuGroup.QUICK]: {
|
|
24865
24771
|
[DocSelectWordCommand.id]: {
|
|
@@ -24897,8 +24803,7 @@ const mobileMenuSchema = {
|
|
|
24897
24803
|
}
|
|
24898
24804
|
};
|
|
24899
24805
|
|
|
24900
|
-
|
|
24901
|
-
//#region src/views/mobile-doc-toolbar/MobileDocToolbar.tsx
|
|
24806
|
+
// src/views/mobile-doc-toolbar/MobileDocToolbar.tsx
|
|
24902
24807
|
const MOBILE_DOC_INSERT_GROUP = "doc.mobile.insert";
|
|
24903
24808
|
const MOBILE_DOC_FORMAT_QUICK_GROUP = "doc.mobile.format.quick";
|
|
24904
24809
|
const MOBILE_DOC_FORMAT_DETAIL_GROUP = "doc.mobile.format.detail";
|
|
@@ -24981,6 +24886,7 @@ function useMobileDocEditState() {
|
|
|
24981
24886
|
const unitId = currentDoc === null || currentDoc === void 0 ? void 0 : currentDoc.getUnitId();
|
|
24982
24887
|
const selectionService = unitId ? (_renderManagerService = renderManagerService.getRenderUnitById(unitId)) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.with(DocSelectionRenderService) : void 0;
|
|
24983
24888
|
return {
|
|
24889
|
+
unitId,
|
|
24984
24890
|
isEditing: (0, _univerjs_ui.useObservable)(selectionService === null || selectionService === void 0 ? void 0 : selectionService.mobileEditMode$, (selectionService === null || selectionService === void 0 ? void 0 : selectionService.isMobileEditMode) ?? false),
|
|
24985
24891
|
isReadOnly: unitId ? ((_editorService$getEdi = editorService.getEditor(unitId)) === null || _editorService$getEdi === void 0 ? void 0 : _editorService$getEdi.isReadOnly()) === true : true,
|
|
24986
24892
|
selectionService
|
|
@@ -25004,7 +24910,10 @@ function MobileDocToolbar() {
|
|
|
25004
24910
|
const menuManagerService = (0, _univerjs_ui.useDependency)(_univerjs_ui.IMenuManagerService);
|
|
25005
24911
|
const workbenchService = (0, _univerjs_ui.useDependency)(_univerjs_ui.IWorkbenchService);
|
|
25006
24912
|
const rootUnitType = (0, _univerjs_ui.useObservable)(workbenchService.rootUnitType$, null, true);
|
|
25007
|
-
const { isEditing, isReadOnly, selectionService } = useMobileDocEditState();
|
|
24913
|
+
const { unitId, isEditing, isReadOnly, selectionService } = useMobileDocEditState();
|
|
24914
|
+
const injector = (0, _univerjs_ui.useDependency)(_univerjs_core.Injector);
|
|
24915
|
+
const focusCoordinator = injector.has(IDocEmbedRuntimeFocusCoordinator) ? injector.get(IDocEmbedRuntimeFocusCoordinator) : void 0;
|
|
24916
|
+
const embeddedDocActive = (0, _univerjs_ui.useObservable)(() => (focusCoordinator === null || focusCoordinator === void 0 ? void 0 : focusCoordinator.runtimeSessionChanged$.pipe((0, rxjs.startWith)(void 0), (0, rxjs.map)(() => focusCoordinator.isChildUnitInActiveSession(unitId)))) ?? (0, rxjs.of)(false), (focusCoordinator === null || focusCoordinator === void 0 ? void 0 : focusCoordinator.isChildUnitInActiveSession(unitId)) ?? false, false, [focusCoordinator, unitId]);
|
|
25008
24917
|
const keyboardState = (0, _univerjs_ui.useObservable)(selectionService === null || selectionService === void 0 ? void 0 : selectionService.mobileKeyboardState$, {
|
|
25009
24918
|
visible: false,
|
|
25010
24919
|
inset: 0
|
|
@@ -25032,13 +24941,13 @@ function MobileDocToolbar() {
|
|
|
25032
24941
|
return () => subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
|
|
25033
24942
|
}, [selectionService, closeDrawer]);
|
|
25034
24943
|
const drawerSchemas = (0, react.useMemo)(() => drawer ? menuSchemas[drawer] : [], [drawer, menuSchemas]);
|
|
25035
|
-
if (rootUnitType !== _univerjs_core.UniverInstanceType.UNIVER_DOC) return null;
|
|
24944
|
+
if (rootUnitType !== _univerjs_core.UniverInstanceType.UNIVER_DOC && !embeddedDocActive) return null;
|
|
25036
24945
|
if (!isEditing) {
|
|
25037
24946
|
if (isReadOnly) return null;
|
|
25038
24947
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
25039
24948
|
type: "button",
|
|
25040
24949
|
"aria-label": localeService.t("docs-ui.mobile.edit"),
|
|
25041
|
-
className: (0, _univerjs_design.clsx)(_univerjs_design.resetButtonClassName, "univer-pointer-events-auto univer-absolute univer-bottom-4 univer-z-
|
|
24950
|
+
className: (0, _univerjs_design.clsx)(_univerjs_design.resetButtonClassName, "univer-pointer-events-auto univer-absolute univer-bottom-4 univer-z-50 univer-flex univer-size-14 univer-items-center univer-justify-center univer-rounded-full univer-bg-primary-600 univer-text-2xl univer-text-white univer-shadow-lg active:univer-scale-95 active:univer-bg-primary-700 dark:!univer-bg-primary-500 dark:active:!univer-bg-primary-600"),
|
|
25042
24951
|
style: {
|
|
25043
24952
|
insetInlineEnd: "1rem",
|
|
25044
24953
|
marginBottom: "env(safe-area-inset-bottom, 0px)"
|
|
@@ -25084,7 +24993,7 @@ function MobileDocToolbar() {
|
|
|
25084
24993
|
const quickMenuType = quickMenu === "block" ? DOC_PARAGRAPH_T_EDIT_MENU_ID : DOC_PARAGRAPH_T_ALIGN_MENU_ID;
|
|
25085
24994
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
25086
24995
|
keyboardVisible && quickMenu && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
25087
|
-
className: "univer-pointer-events-auto univer-absolute univer-inset-x-3 univer-z-
|
|
24996
|
+
className: "univer-pointer-events-auto univer-absolute univer-inset-x-3 univer-z-50 univer-overflow-hidden",
|
|
25088
24997
|
style: { bottom: `${keyboardState.inset + 48}px` },
|
|
25089
24998
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_ui.MobileMenu, {
|
|
25090
24999
|
menuType: quickMenuType,
|
|
@@ -25093,7 +25002,7 @@ function MobileDocToolbar() {
|
|
|
25093
25002
|
})
|
|
25094
25003
|
}),
|
|
25095
25004
|
keyboardVisible && !drawer && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
25096
|
-
className: "univer-pointer-events-auto univer-absolute univer-inset-x-0 univer-z-
|
|
25005
|
+
className: "univer-pointer-events-auto univer-absolute univer-inset-x-0 univer-z-50 univer-box-border univer-flex univer-h-12 univer-items-center univer-gap-0.5 univer-border-0 univer-border-t univer-border-solid univer-border-gray-200 univer-bg-gray-0 univer-px-1 dark:!univer-border-gray-700 dark:!univer-bg-gray-800",
|
|
25097
25006
|
style: {
|
|
25098
25007
|
bottom: `${keyboardState.inset}px`,
|
|
25099
25008
|
paddingBottom: "env(safe-area-inset-bottom, 0px)"
|
|
@@ -25185,8 +25094,7 @@ function MobileDocToolbar() {
|
|
|
25185
25094
|
] });
|
|
25186
25095
|
}
|
|
25187
25096
|
|
|
25188
|
-
|
|
25189
|
-
//#region src/services/doc-mobile-element-menu.service.ts
|
|
25097
|
+
// src/services/doc-mobile-element-menu.service.ts
|
|
25190
25098
|
let DocMobileElementMenuService = class DocMobileElementMenuService extends _univerjs_core.Disposable {
|
|
25191
25099
|
constructor(_popupService, instanceService) {
|
|
25192
25100
|
super();
|
|
@@ -25261,8 +25169,7 @@ let DocMobileElementMenuService = class DocMobileElementMenuService extends _uni
|
|
|
25261
25169
|
};
|
|
25262
25170
|
DocMobileElementMenuService = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(DocCanvasPopManagerService)), __decorateParam(1, _univerjs_core.IUniverInstanceService)], DocMobileElementMenuService);
|
|
25263
25171
|
|
|
25264
|
-
|
|
25265
|
-
//#region src/views/mobile/MobileDocCanvasViewport.tsx
|
|
25172
|
+
// src/views/mobile/MobileDocCanvasViewport.tsx
|
|
25266
25173
|
function MobileDocCanvasViewport({ containerRef, canvasRef }) {
|
|
25267
25174
|
const instances = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
25268
25175
|
const renders = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService);
|
|
@@ -25322,8 +25229,7 @@ function MobileDocCanvasViewport({ containerRef, canvasRef }) {
|
|
|
25322
25229
|
return null;
|
|
25323
25230
|
}
|
|
25324
25231
|
|
|
25325
|
-
|
|
25326
|
-
//#region src/controllers/mobile/ui.controller.ts
|
|
25232
|
+
// src/controllers/mobile/ui.controller.ts
|
|
25327
25233
|
/**
|
|
25328
25234
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
25329
25235
|
*
|
|
@@ -25384,8 +25290,7 @@ DocMobileUIController = __decorate([
|
|
|
25384
25290
|
__decorateParam(4, _univerjs_ui.IUIPartsService)
|
|
25385
25291
|
], DocMobileUIController);
|
|
25386
25292
|
|
|
25387
|
-
|
|
25388
|
-
//#region src/controllers/render-controllers/doc-canvas-popup-layout-interaction.controller.ts
|
|
25293
|
+
// src/controllers/render-controllers/doc-canvas-popup-layout-interaction.controller.ts
|
|
25389
25294
|
let DocCanvasPopupLayoutInteractionController = class DocCanvasPopupLayoutInteractionController extends _univerjs_core.Disposable {
|
|
25390
25295
|
constructor(_context, _canvasPopupManagerService, _docLayoutInteractionService) {
|
|
25391
25296
|
super();
|
|
@@ -25410,8 +25315,7 @@ let DocCanvasPopupLayoutInteractionController = class DocCanvasPopupLayoutIntera
|
|
|
25410
25315
|
};
|
|
25411
25316
|
DocCanvasPopupLayoutInteractionController = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(DocCanvasPopManagerService)), __decorateParam(2, (0, _univerjs_core.Inject)(DocLayoutInteractionService))], DocCanvasPopupLayoutInteractionController);
|
|
25412
25317
|
|
|
25413
|
-
|
|
25414
|
-
//#region src/controllers/render-controllers/doc-checklist.render-controller.ts
|
|
25318
|
+
// src/controllers/render-controllers/doc-checklist.render-controller.ts
|
|
25415
25319
|
let DocChecklistRenderController = class DocChecklistRenderController extends _univerjs_core.Disposable {
|
|
25416
25320
|
constructor(_context, _docSkeletonManagerService, _commandService, _docEventManagerService, _textSelectionManagerService) {
|
|
25417
25321
|
super();
|
|
@@ -25453,8 +25357,7 @@ DocChecklistRenderController = __decorate([
|
|
|
25453
25357
|
__decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_docs.DocSelectionManagerService))
|
|
25454
25358
|
], DocChecklistRenderController);
|
|
25455
25359
|
|
|
25456
|
-
|
|
25457
|
-
//#region src/controllers/render-controllers/doc-clipboard.controller.ts
|
|
25360
|
+
// src/controllers/render-controllers/doc-clipboard.controller.ts
|
|
25458
25361
|
let DocClipboardController = class DocClipboardController extends _univerjs_core.RxDisposable {
|
|
25459
25362
|
constructor(_context, _commandService, _docClipboardService, _docSelectionRenderService, _contextService, _editorService) {
|
|
25460
25363
|
super();
|
|
@@ -25499,8 +25402,7 @@ DocClipboardController = __decorate([
|
|
|
25499
25402
|
__decorateParam(5, IEditorService)
|
|
25500
25403
|
], DocClipboardController);
|
|
25501
25404
|
|
|
25502
|
-
|
|
25503
|
-
//#region src/controllers/render-controllers/doc-contextmenu.render-controller.ts
|
|
25405
|
+
// src/controllers/render-controllers/doc-contextmenu.render-controller.ts
|
|
25504
25406
|
const SKIP_UNIT_IDS = [
|
|
25505
25407
|
_univerjs_core.DEFAULT_EMPTY_DOCUMENT_VALUE,
|
|
25506
25408
|
_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,
|
|
@@ -25571,8 +25473,7 @@ function isRangeIntersectingBlock(range, startIndex, endIndex) {
|
|
|
25571
25473
|
return Math.max(range.startOffset, startIndex) <= Math.min(range.endOffset, endIndex);
|
|
25572
25474
|
}
|
|
25573
25475
|
|
|
25574
|
-
|
|
25575
|
-
//#region src/controllers/render-controllers/doc-editor-bridge.controller.ts
|
|
25476
|
+
// src/controllers/render-controllers/doc-editor-bridge.controller.ts
|
|
25576
25477
|
let DocEditorBridgeController = class DocEditorBridgeController extends _univerjs_core.Disposable {
|
|
25577
25478
|
constructor(_context, _univerInstanceService, _editorService, _commandService, _docSelectionRenderService, _docSkeletonManagerService, _renderManagerService) {
|
|
25578
25479
|
super();
|
|
@@ -25684,8 +25585,7 @@ DocEditorBridgeController = __decorate([
|
|
|
25684
25585
|
__decorateParam(6, _univerjs_engine_render.IRenderManagerService)
|
|
25685
25586
|
], DocEditorBridgeController);
|
|
25686
25587
|
|
|
25687
|
-
|
|
25688
|
-
//#region src/controllers/render-controllers/doc-ime-input.controller.ts
|
|
25588
|
+
// src/controllers/render-controllers/doc-ime-input.controller.ts
|
|
25689
25589
|
let DocIMEInputController = class DocIMEInputController extends _univerjs_core.Disposable {
|
|
25690
25590
|
constructor(_context, _docSelectionRenderService, _docImeInputManagerService, _docSkeletonManagerService, _docStateEmitService, _docSelectionManagerService, _commandService) {
|
|
25691
25591
|
super();
|
|
@@ -25816,8 +25716,7 @@ DocIMEInputController = __decorate([
|
|
|
25816
25716
|
__decorateParam(6, _univerjs_core.ICommandService)
|
|
25817
25717
|
], DocIMEInputController);
|
|
25818
25718
|
|
|
25819
|
-
|
|
25820
|
-
//#region src/controllers/render-controllers/doc-input.controller.ts
|
|
25719
|
+
// src/controllers/render-controllers/doc-input.controller.ts
|
|
25821
25720
|
let DocInputController = class DocInputController extends _univerjs_core.Disposable {
|
|
25822
25721
|
constructor(_context, _docSelectionRenderService, _docSkeletonManagerService, _commandService, _docMenuStyleService, _embedInteractionBoundaryService, _embedRuntimeFocusCoordinator) {
|
|
25823
25722
|
super();
|
|
@@ -25907,8 +25806,7 @@ DocInputController = __decorate([
|
|
|
25907
25806
|
__decorateParam(6, (0, _univerjs_core.Optional)(IDocEmbedRuntimeFocusCoordinator))
|
|
25908
25807
|
], DocInputController);
|
|
25909
25808
|
|
|
25910
|
-
|
|
25911
|
-
//#region src/controllers/render-controllers/doc-layout-progress.render-controller.ts
|
|
25809
|
+
// src/controllers/render-controllers/doc-layout-progress.render-controller.ts
|
|
25912
25810
|
const DOC_LAYOUT_PROGRESS_DELAY_MS = 2e3;
|
|
25913
25811
|
const DOC_LAYOUT_PROGRESS_CANCEL_GRACE_MS = 1e3;
|
|
25914
25812
|
function resolveDocLayoutProgressPercent(progress) {
|
|
@@ -26003,8 +25901,7 @@ let DocLayoutProgressRenderController = class DocLayoutProgressRenderController
|
|
|
26003
25901
|
};
|
|
26004
25902
|
DocLayoutProgressRenderController = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_docs.DocSkeletonManagerService)), __decorateParam(2, (0, _univerjs_core.Inject)(DocLayoutProgressService))], DocLayoutProgressRenderController);
|
|
26005
25903
|
|
|
26006
|
-
|
|
26007
|
-
//#region src/controllers/render-controllers/doc-layout-recovery.render-controller.ts
|
|
25904
|
+
// src/controllers/render-controllers/doc-layout-recovery.render-controller.ts
|
|
26008
25905
|
function acquireDocLayoutRecoveryInteractionLock(canvas, shortcutService, blurSelection) {
|
|
26009
25906
|
const previousPointerEvents = canvas.style.pointerEvents;
|
|
26010
25907
|
const previousOpacity = canvas.style.opacity;
|
|
@@ -26084,8 +25981,7 @@ DocLayoutRecoveryRenderController = __decorate([
|
|
|
26084
25981
|
__decorateParam(4, _univerjs_ui.IShortcutService)
|
|
26085
25982
|
], DocLayoutRecoveryRenderController);
|
|
26086
25983
|
|
|
26087
|
-
|
|
26088
|
-
//#region src/controllers/render-controllers/doc-paste-options.render-controller.ts
|
|
25984
|
+
// src/controllers/render-controllers/doc-paste-options.render-controller.ts
|
|
26089
25985
|
let DocPasteOptionsRenderController = class DocPasteOptionsRenderController extends _univerjs_core.Disposable {
|
|
26090
25986
|
constructor(_context, _clipboard, selection, popupManager, contextService) {
|
|
26091
25987
|
super();
|
|
@@ -26148,8 +26044,7 @@ DocPasteOptionsRenderController = __decorate([
|
|
|
26148
26044
|
__decorateParam(4, _univerjs_core.IContextService)
|
|
26149
26045
|
], DocPasteOptionsRenderController);
|
|
26150
26046
|
|
|
26151
|
-
|
|
26152
|
-
//#region src/controllers/render-controllers/doc-resize.render-controller.ts
|
|
26047
|
+
// src/controllers/render-controllers/doc-resize.render-controller.ts
|
|
26153
26048
|
function hasRenderableDocSkeleton(component) {
|
|
26154
26049
|
if (typeof component !== "object" || component == null || !("getSkeleton" in component) || typeof component.getSkeleton !== "function") return false;
|
|
26155
26050
|
const skeleton = component.getSkeleton();
|
|
@@ -26192,8 +26087,7 @@ DocResizeRenderController = __decorate([
|
|
|
26192
26087
|
__decorateParam(3, _univerjs_ui.ISidebarService)
|
|
26193
26088
|
], DocResizeRenderController);
|
|
26194
26089
|
|
|
26195
|
-
|
|
26196
|
-
//#region src/controllers/render-controllers/mobile/back-scroll.render-controller.ts
|
|
26090
|
+
// src/controllers/render-controllers/mobile/back-scroll.render-controller.ts
|
|
26197
26091
|
const MOBILE_CARET_MARGIN = 32;
|
|
26198
26092
|
const MOBILE_TOOLBAR_HEIGHT = 48;
|
|
26199
26093
|
const MOBILE_CARET_VIEWPORT_RATIO = .4;
|
|
@@ -26233,8 +26127,7 @@ MobileDocBackScrollRenderController = __decorate([
|
|
|
26233
26127
|
__decorateParam(5, (0, _univerjs_core.Inject)(DocPageLayoutService))
|
|
26234
26128
|
], MobileDocBackScrollRenderController);
|
|
26235
26129
|
|
|
26236
|
-
|
|
26237
|
-
//#region src/controllers/render-controllers/doc-selection-render.util.ts
|
|
26130
|
+
// src/controllers/render-controllers/doc-selection-render.util.ts
|
|
26238
26131
|
function isEmbedInteractionEvent(evt) {
|
|
26239
26132
|
var _document$elementFrom;
|
|
26240
26133
|
const target = evt.target;
|
|
@@ -26265,8 +26158,7 @@ function getEventClientPoint(evt, target) {
|
|
|
26265
26158
|
};
|
|
26266
26159
|
}
|
|
26267
26160
|
|
|
26268
|
-
|
|
26269
|
-
//#region src/controllers/render-controllers/mobile/doc-selection-render.controller.ts
|
|
26161
|
+
// src/controllers/render-controllers/mobile/doc-selection-render.controller.ts
|
|
26270
26162
|
const DOUBLE_TAP_INTERVAL = 450;
|
|
26271
26163
|
const DOUBLE_TAP_DISTANCE = 28;
|
|
26272
26164
|
const DRAG_THRESHOLD = 12;
|
|
@@ -26761,8 +26653,7 @@ function calculateInertiaVelocity(history, duration, displacement) {
|
|
|
26761
26653
|
};
|
|
26762
26654
|
}
|
|
26763
26655
|
|
|
26764
|
-
|
|
26765
|
-
//#region src/controllers/render-controllers/mobile/doc.render-controller.ts
|
|
26656
|
+
// src/controllers/render-controllers/mobile/doc.render-controller.ts
|
|
26766
26657
|
const MOBILE_DOC_OUTER_MARGIN = 12;
|
|
26767
26658
|
let MobileDocRenderController = class MobileDocRenderController extends DocRenderController {
|
|
26768
26659
|
constructor(context, commandService, docSelectionRenderService, docSkeletonManagerService, editorService, renderManagerService, univerInstanceService, docPageLayoutService, textSelectionManagerService, docViewScaleService, themeService, docLayoutExecutorService, docLayoutInteractionService, logService) {
|
|
@@ -26822,8 +26713,7 @@ MobileDocRenderController = __decorate([
|
|
|
26822
26713
|
__decorateParam(13, _univerjs_core.ILogService)
|
|
26823
26714
|
], MobileDocRenderController);
|
|
26824
26715
|
|
|
26825
|
-
|
|
26826
|
-
//#region src/controllers/render-controllers/zoom.render-controller.ts
|
|
26716
|
+
// src/controllers/render-controllers/zoom.render-controller.ts
|
|
26827
26717
|
function shouldHandleDocWheelZoom(event, focusingDoc, _documentFlavor) {
|
|
26828
26718
|
return focusingDoc && (event.ctrlKey || event.metaKey);
|
|
26829
26719
|
}
|
|
@@ -26949,8 +26839,7 @@ DocZoomRenderController = __decorate([
|
|
|
26949
26839
|
__decorateParam(10, (0, _univerjs_core.Optional)(IDocEmbedInteractionBoundaryService))
|
|
26950
26840
|
], DocZoomRenderController);
|
|
26951
26841
|
|
|
26952
|
-
|
|
26953
|
-
//#region src/controllers/render-controllers/mobile/doc-pinch-zoom.ts
|
|
26842
|
+
// src/controllers/render-controllers/mobile/doc-pinch-zoom.ts
|
|
26954
26843
|
const MOBILE_DOC_ZOOM_MIN = .5;
|
|
26955
26844
|
const MOBILE_DOC_ZOOM_MAX = 3;
|
|
26956
26845
|
function resolveMobileDocPinchZoomRatio(initialZoomRatio, initialDistance, currentDistance) {
|
|
@@ -27048,8 +26937,7 @@ var MobileDocPinchZoomGesture = class extends _univerjs_core.Disposable {
|
|
|
27048
26937
|
}
|
|
27049
26938
|
};
|
|
27050
26939
|
|
|
27051
|
-
|
|
27052
|
-
//#region src/controllers/render-controllers/mobile/zoom.render-controller.ts
|
|
26940
|
+
// src/controllers/render-controllers/mobile/zoom.render-controller.ts
|
|
27053
26941
|
let MobileDocZoomRenderController = class MobileDocZoomRenderController extends DocZoomRenderController {
|
|
27054
26942
|
constructor(context, contextService, docSkeletonManagerService, univerInstanceService, commandService, textSelectionManagerService, editorService, docPageLayoutService, renderManagerService, docViewScaleService, embedInteractionBoundaryService) {
|
|
27055
26943
|
super(context, contextService, docSkeletonManagerService, univerInstanceService, commandService, textSelectionManagerService, editorService, docPageLayoutService, renderManagerService, docViewScaleService, embedInteractionBoundaryService);
|
|
@@ -27104,8 +26992,7 @@ MobileDocZoomRenderController = __decorate([
|
|
|
27104
26992
|
__decorateParam(10, (0, _univerjs_core.Optional)(IDocEmbedInteractionBoundaryService))
|
|
27105
26993
|
], MobileDocZoomRenderController);
|
|
27106
26994
|
|
|
27107
|
-
|
|
27108
|
-
//#region src/services/doc-ime-state-change-interceptor.service.ts
|
|
26995
|
+
// src/services/doc-ime-state-change-interceptor.service.ts
|
|
27109
26996
|
let DocIMEStateChangeInterceptorService = class DocIMEStateChangeInterceptorService {
|
|
27110
26997
|
constructor(_renderManagerService) {
|
|
27111
26998
|
this._renderManagerService = _renderManagerService;
|
|
@@ -27141,8 +27028,7 @@ let DocIMEStateChangeInterceptorService = class DocIMEStateChangeInterceptorServ
|
|
|
27141
27028
|
};
|
|
27142
27029
|
DocIMEStateChangeInterceptorService = __decorate([__decorateParam(0, _univerjs_engine_render.IRenderManagerService)], DocIMEStateChangeInterceptorService);
|
|
27143
27030
|
|
|
27144
|
-
|
|
27145
|
-
//#region src/services/doc-print-interceptor.service.ts
|
|
27031
|
+
// src/services/doc-print-interceptor.service.ts
|
|
27146
27032
|
const PRINTING_COMPONENT_COLLECT = (0, _univerjs_core.createInterceptorKey)("PRINTING_COMPONENT_COLLECT");
|
|
27147
27033
|
const PRINTING_DOM_COLLECT = (0, _univerjs_core.createInterceptorKey)("PRINTING_DOM_COLLECT");
|
|
27148
27034
|
var DocPrintInterceptorService = class extends _univerjs_core.Disposable {
|
|
@@ -27203,8 +27089,7 @@ function collectPageDrawingIds(page, drawingIds) {
|
|
|
27203
27089
|
for (const table of page.skeTables.values()) for (const row of table.rows) for (const cell of row.cells) collectPageDrawingIds(cell, drawingIds);
|
|
27204
27090
|
}
|
|
27205
27091
|
|
|
27206
|
-
|
|
27207
|
-
//#region src/services/docs-render.service.ts
|
|
27092
|
+
// src/services/docs-render.service.ts
|
|
27208
27093
|
const DOC_MAIN_CANVAS_ID = "univer-doc-main-canvas";
|
|
27209
27094
|
function getDocsCanvasBackgroundColor(documentFlavor, canvasColorService, editorBackgroundColor, isEditor) {
|
|
27210
27095
|
return resolveDocRenderBackground({
|
|
@@ -27255,8 +27140,7 @@ let DocsRenderService = class DocsRenderService extends _univerjs_core.RxDisposa
|
|
|
27255
27140
|
};
|
|
27256
27141
|
DocsRenderService = __decorate([__decorateParam(0, _univerjs_core.IUniverInstanceService), __decorateParam(1, _univerjs_engine_render.IRenderManagerService)], DocsRenderService);
|
|
27257
27142
|
|
|
27258
|
-
|
|
27259
|
-
//#region src/views/float-toolbar/FloatToolbar.tsx
|
|
27143
|
+
// src/views/float-toolbar/FloatToolbar.tsx
|
|
27260
27144
|
const FLOAT_MENU_COMPONENT_KEY = "univer.doc.float-menu";
|
|
27261
27145
|
const DEFAULT_AVALIABLE_MENUS = [
|
|
27262
27146
|
FLOAT_TEXT_STYLE_MENU_ID,
|
|
@@ -27382,8 +27266,7 @@ function FloatToolbar(props) {
|
|
|
27382
27266
|
});
|
|
27383
27267
|
}
|
|
27384
27268
|
|
|
27385
|
-
|
|
27386
|
-
//#region src/services/float-menu.service.ts
|
|
27269
|
+
// src/services/float-menu.service.ts
|
|
27387
27270
|
const SKIP_SYMBOLS = [_univerjs_core.DataStreamTreeTokenType.CUSTOM_BLOCK, _univerjs_core.DataStreamTreeTokenType.PARAGRAPH];
|
|
27388
27271
|
let DocFloatMenuService = class DocFloatMenuService extends _univerjs_core.Disposable {
|
|
27389
27272
|
constructor(_context, _docSelectionManagerService, _docCanvasPopManagerService, _univerInstanceService, _docSelectionRenderService, _contextService, _contextMenuService, _permissionService, _docLayoutInteractionService, _embedRuntimeFocusCoordinator) {
|
|
@@ -27554,8 +27437,7 @@ function isRangeInCodeBlock(documentDataModel, range) {
|
|
|
27554
27437
|
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
27438
|
}
|
|
27556
27439
|
|
|
27557
|
-
|
|
27558
|
-
//#region src/services/mobile/mobile-text-selection-visuals.ts
|
|
27440
|
+
// src/services/mobile/mobile-text-selection-visuals.ts
|
|
27559
27441
|
const MOBILE_HANDLE_TOUCH_SIZE = 32;
|
|
27560
27442
|
const MOBILE_HANDLE_VISUAL_SIZE = 12;
|
|
27561
27443
|
const MOBILE_HANDLE_STEM_WIDTH = 2;
|
|
@@ -27687,8 +27569,7 @@ var MobileTextSelectionVisuals = class {
|
|
|
27687
27569
|
}
|
|
27688
27570
|
};
|
|
27689
27571
|
|
|
27690
|
-
|
|
27691
|
-
//#region src/services/mobile/doc-selection-render.service.ts
|
|
27572
|
+
// src/services/mobile/doc-selection-render.service.ts
|
|
27692
27573
|
const MOBILE_KEYBOARD_THRESHOLD = 80;
|
|
27693
27574
|
const MOBILE_INPUT_VIEWPORT_INSET = 1;
|
|
27694
27575
|
let MobileDocSelectionRenderService = class MobileDocSelectionRenderService extends DocSelectionRenderService {
|
|
@@ -27919,8 +27800,7 @@ MobileDocSelectionRenderService = __decorate([
|
|
|
27919
27800
|
__decorateParam(8, (0, _univerjs_core.Optional)(IDocEmbedRuntimeFocusCoordinator))
|
|
27920
27801
|
], MobileDocSelectionRenderService);
|
|
27921
27802
|
|
|
27922
|
-
|
|
27923
|
-
//#region src/services/mobile/doc-view-scale.ts
|
|
27803
|
+
// src/services/mobile/doc-view-scale.ts
|
|
27924
27804
|
/**
|
|
27925
27805
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
27926
27806
|
*
|
|
@@ -27943,8 +27823,7 @@ var MobileDocViewScaleService = class extends DocViewScaleService {
|
|
|
27943
27823
|
}
|
|
27944
27824
|
};
|
|
27945
27825
|
|
|
27946
|
-
|
|
27947
|
-
//#region src/services/mobile/float-menu.service.ts
|
|
27826
|
+
// src/services/mobile/float-menu.service.ts
|
|
27948
27827
|
var MobileDocFloatMenuService = class extends DocFloatMenuService {
|
|
27949
27828
|
_openSelectionMenu(unitId, range) {
|
|
27950
27829
|
const [anchor] = this._docCanvasPopManagerService.getRangeBounds(range, unitId) ?? [];
|
|
@@ -27966,8 +27845,7 @@ var MobileDocFloatMenuService = class extends DocFloatMenuService {
|
|
|
27966
27845
|
}
|
|
27967
27846
|
};
|
|
27968
27847
|
|
|
27969
|
-
|
|
27970
|
-
//#region src/mobile-plugin.ts
|
|
27848
|
+
// src/mobile-plugin.ts
|
|
27971
27849
|
let UniverDocsMobileUIPlugin = class UniverDocsMobileUIPlugin extends _univerjs_core.Plugin {
|
|
27972
27850
|
constructor(_config = defaultPluginMobileConfig, _injector, _renderManagerSrv, _commandService, _configService) {
|
|
27973
27851
|
super();
|
|
@@ -28188,8 +28066,7 @@ UniverDocsMobileUIPlugin = __decorate([
|
|
|
28188
28066
|
__decorateParam(4, _univerjs_core.IConfigService)
|
|
28189
28067
|
], UniverDocsMobileUIPlugin);
|
|
28190
28068
|
|
|
28191
|
-
|
|
28192
|
-
//#region src/views/header-footer/panel/DocHeaderFooterFields.tsx
|
|
28069
|
+
// src/views/header-footer/panel/DocHeaderFooterFields.tsx
|
|
28193
28070
|
function DocHeaderFooterFields({ unitId, disabled }) {
|
|
28194
28071
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
28195
28072
|
(0, _univerjs_ui.useObservable)(localeService.currentLocale$);
|
|
@@ -28368,8 +28245,7 @@ function DocHeaderFooterFields({ unitId, disabled }) {
|
|
|
28368
28245
|
});
|
|
28369
28246
|
}
|
|
28370
28247
|
|
|
28371
|
-
|
|
28372
|
-
//#region src/views/header-footer/panel/DocHeaderFooterRibbonControl.tsx
|
|
28248
|
+
// src/views/header-footer/panel/DocHeaderFooterRibbonControl.tsx
|
|
28373
28249
|
function DocHeaderFooterRibbonControl(props) {
|
|
28374
28250
|
const instances = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
|
|
28375
28251
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
@@ -28501,8 +28377,7 @@ function HeaderFooterRibbonControl({ kind, unitId }) {
|
|
|
28501
28377
|
});
|
|
28502
28378
|
}
|
|
28503
28379
|
|
|
28504
|
-
|
|
28505
|
-
//#region src/views/paragraph-menu/component-keys.ts
|
|
28380
|
+
// src/views/paragraph-menu/component-keys.ts
|
|
28506
28381
|
/**
|
|
28507
28382
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28508
28383
|
*
|
|
@@ -28521,8 +28396,7 @@ function HeaderFooterRibbonControl({ kind, unitId }) {
|
|
|
28521
28396
|
const DOC_PARAGRAPH_MENU_COMPONENT_KEY = "doc.paragraph.menu";
|
|
28522
28397
|
const DOC_TABLE_BLOCK_MENU_COMPONENT_KEY = "doc.table-block.menu";
|
|
28523
28398
|
|
|
28524
|
-
|
|
28525
|
-
//#region src/services/doc-paragraph-menu.service.ts
|
|
28399
|
+
// src/services/doc-paragraph-menu.service.ts
|
|
28526
28400
|
const BLOCK_RANGE_ICON_MAP = {
|
|
28527
28401
|
code: "CodeBlockIcon",
|
|
28528
28402
|
quote: "QuoteIcon",
|
|
@@ -29339,8 +29213,7 @@ function getBlockRangeAnchorRect(docEventManagerService, blockRange, fallbackPar
|
|
|
29339
29213
|
};
|
|
29340
29214
|
}
|
|
29341
29215
|
|
|
29342
|
-
|
|
29343
|
-
//#region src/views/paragraph-menu/paragraph-menu-position.ts
|
|
29216
|
+
// src/views/paragraph-menu/paragraph-menu-position.ts
|
|
29344
29217
|
function observeParagraphMenuPosition(element, popup, targets$) {
|
|
29345
29218
|
let anchor;
|
|
29346
29219
|
let table = false;
|
|
@@ -29407,8 +29280,7 @@ function observeParagraphMenuPosition(element, popup, targets$) {
|
|
|
29407
29280
|
};
|
|
29408
29281
|
}
|
|
29409
29282
|
|
|
29410
|
-
|
|
29411
|
-
//#region src/views/ParagraphMenu.tsx
|
|
29283
|
+
// src/views/ParagraphMenu.tsx
|
|
29412
29284
|
function getParagraphMenuPopupDirection(anchorLeft, menuWidth = 212, viewportPadding = 8, options = {}) {
|
|
29413
29285
|
const { anchorRight = anchorLeft, direction = "ltr", viewportWidth = Number.POSITIVE_INFINITY } = options;
|
|
29414
29286
|
const hasLeftSpace = anchorLeft - menuWidth >= viewportPadding;
|
|
@@ -30487,8 +30359,7 @@ function DragHandleDotsIcon() {
|
|
|
30487
30359
|
});
|
|
30488
30360
|
}
|
|
30489
30361
|
|
|
30490
|
-
|
|
30491
|
-
//#region src/controllers/components.controller.ts
|
|
30362
|
+
// src/controllers/components.controller.ts
|
|
30492
30363
|
/**
|
|
30493
30364
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
30494
30365
|
*
|
|
@@ -30511,14 +30382,8 @@ let ComponentsController = class ComponentsController extends _univerjs_core.Dis
|
|
|
30511
30382
|
this._componentManager = _componentManager;
|
|
30512
30383
|
this._iconManager = _iconManager;
|
|
30513
30384
|
this._registerComponents();
|
|
30514
|
-
this._registerParts();
|
|
30515
30385
|
this._registerIcons();
|
|
30516
30386
|
}
|
|
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
30387
|
_registerIcons() {
|
|
30523
30388
|
this.disposeWithMe(this._iconManager.register({
|
|
30524
30389
|
AlignTextBothIcon: _univerjs_icons.AlignTextBothIcon,
|
|
@@ -30623,12 +30488,14 @@ let ComponentsController = class ComponentsController extends _univerjs_core.Dis
|
|
|
30623
30488
|
].forEach(([key, comp]) => {
|
|
30624
30489
|
this.disposeWithMe(this._componentManager.register(key, comp));
|
|
30625
30490
|
});
|
|
30491
|
+
const componentManager = this._componentManager;
|
|
30492
|
+
this.disposeWithMe(componentManager.register(DOC_PASTE_OPTIONS_COMPONENT, DocPasteOptions));
|
|
30493
|
+
this.disposeWithMe(componentManager.register(COMPONENT_DOC_CREATE_TABLE_CONFIRM, DocCreateTableConfirm));
|
|
30626
30494
|
}
|
|
30627
30495
|
};
|
|
30628
30496
|
ComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.IconManager))], ComponentsController);
|
|
30629
30497
|
|
|
30630
|
-
|
|
30631
|
-
//#region src/controllers/doc-header-footer-ribbon.controller.ts
|
|
30498
|
+
// src/controllers/doc-header-footer-ribbon.controller.ts
|
|
30632
30499
|
let DocHeaderFooterRibbonController = class DocHeaderFooterRibbonController extends _univerjs_core.Disposable {
|
|
30633
30500
|
constructor(_context, skeletonManager, _instanceService, _ribbonService, _renderManager) {
|
|
30634
30501
|
super();
|
|
@@ -30664,8 +30531,7 @@ DocHeaderFooterRibbonController = __decorate([
|
|
|
30664
30531
|
__decorateParam(4, _univerjs_engine_render.IRenderManagerService)
|
|
30665
30532
|
], DocHeaderFooterRibbonController);
|
|
30666
30533
|
|
|
30667
|
-
|
|
30668
|
-
//#region src/controllers/format-painter.controller.ts
|
|
30534
|
+
// src/controllers/format-painter.controller.ts
|
|
30669
30535
|
let DocFormatPainterController = class DocFormatPainterController extends _univerjs_core.Disposable {
|
|
30670
30536
|
constructor(session, selections, styles, instances, context, permissions, editors, commands) {
|
|
30671
30537
|
super();
|
|
@@ -30731,8 +30597,7 @@ DocFormatPainterController = __decorate([
|
|
|
30731
30597
|
__decorateParam(7, _univerjs_core.ICommandService)
|
|
30732
30598
|
], DocFormatPainterController);
|
|
30733
30599
|
|
|
30734
|
-
|
|
30735
|
-
//#region src/controllers/render-controllers/doc-field.render-controller.ts
|
|
30600
|
+
// src/controllers/render-controllers/doc-field.render-controller.ts
|
|
30736
30601
|
let DocFieldRenderController = class DocFieldRenderController extends _univerjs_core.Disposable {
|
|
30737
30602
|
constructor(_context, _events, _selections, theme, _instances) {
|
|
30738
30603
|
super();
|
|
@@ -30808,8 +30673,7 @@ DocFieldRenderController = __decorate([
|
|
|
30808
30673
|
__decorateParam(4, _univerjs_core.IUniverInstanceService)
|
|
30809
30674
|
], DocFieldRenderController);
|
|
30810
30675
|
|
|
30811
|
-
|
|
30812
|
-
//#region src/controllers/render-controllers/doc-selection-render.controller.ts
|
|
30676
|
+
// src/controllers/render-controllers/doc-selection-render.controller.ts
|
|
30813
30677
|
let DocSelectionRenderController = class DocSelectionRenderController extends _univerjs_core.Disposable {
|
|
30814
30678
|
constructor(_context, _commandService, _editorService, _instanceSrv, _docSelectionRenderService, _docSkeletonManagerService, _docSelectionManagerService, _embedInteractionBoundaryService, _embedRuntimeFocusCoordinator) {
|
|
30815
30679
|
super();
|
|
@@ -31020,8 +30884,7 @@ DocSelectionRenderController = __decorate([
|
|
|
31020
30884
|
__decorateParam(8, (0, _univerjs_core.Optional)(IDocEmbedRuntimeFocusCoordinator))
|
|
31021
30885
|
], DocSelectionRenderController);
|
|
31022
30886
|
|
|
31023
|
-
|
|
31024
|
-
//#region src/controllers/render-controllers/format-painter.render-controller.ts
|
|
30887
|
+
// src/controllers/render-controllers/format-painter.render-controller.ts
|
|
31025
30888
|
let DocFormatPainterRenderController = class DocFormatPainterRenderController extends _univerjs_core.Disposable {
|
|
31026
30889
|
constructor(context, session, selections, instances) {
|
|
31027
30890
|
super();
|
|
@@ -31052,8 +30915,7 @@ DocFormatPainterRenderController = __decorate([
|
|
|
31052
30915
|
__decorateParam(3, _univerjs_core.IUniverInstanceService)
|
|
31053
30916
|
], DocFormatPainterRenderController);
|
|
31054
30917
|
|
|
31055
|
-
|
|
31056
|
-
//#region src/services/doc-contextual-ribbon.service.ts
|
|
30918
|
+
// src/services/doc-contextual-ribbon.service.ts
|
|
31057
30919
|
/**
|
|
31058
30920
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
31059
30921
|
*
|
|
@@ -31105,8 +30967,7 @@ let DocContextualRibbonService = class DocContextualRibbonService extends _unive
|
|
|
31105
30967
|
};
|
|
31106
30968
|
DocContextualRibbonService = __decorate([__decorateParam(0, _univerjs_ui.IRibbonService)], DocContextualRibbonService);
|
|
31107
30969
|
|
|
31108
|
-
|
|
31109
|
-
//#region src/views/heading-collapse-shape.ts
|
|
30970
|
+
// src/views/heading-collapse-shape.ts
|
|
31110
30971
|
var HeadingCollapseShape = class extends _univerjs_engine_render.Shape {
|
|
31111
30972
|
constructor(key, colors, activate) {
|
|
31112
30973
|
super(key, {
|
|
@@ -31224,8 +31085,7 @@ var HeadingCollapseShape = class extends _univerjs_engine_render.Shape {
|
|
|
31224
31085
|
}
|
|
31225
31086
|
};
|
|
31226
31087
|
|
|
31227
|
-
|
|
31228
|
-
//#region src/services/doc-heading-collapse.service.ts
|
|
31088
|
+
// src/services/doc-heading-collapse.service.ts
|
|
31229
31089
|
let DocHeadingCollapseService = class DocHeadingCollapseService extends _univerjs_core.Disposable {
|
|
31230
31090
|
constructor(_context, _skeletonManager, _eventManager, _selections, _commandService, _layoutService, themeService, localeService) {
|
|
31231
31091
|
super();
|
|
@@ -31388,8 +31248,7 @@ DocHeadingCollapseService = __decorate([
|
|
|
31388
31248
|
__decorateParam(7, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService))
|
|
31389
31249
|
], DocHeadingCollapseService);
|
|
31390
31250
|
|
|
31391
|
-
|
|
31392
|
-
//#region src/shortcuts/core-editing.shortcut.ts
|
|
31251
|
+
// src/shortcuts/core-editing.shortcut.ts
|
|
31393
31252
|
const BreakLineShortcut = {
|
|
31394
31253
|
id: EnterCommand.id,
|
|
31395
31254
|
preconditions: whenDocAndEditorFocusedWithBreakLine,
|
|
@@ -31442,8 +31301,7 @@ const DeleteLineEndShortcut = {
|
|
|
31442
31301
|
staticParameters: { granularity: "line" }
|
|
31443
31302
|
};
|
|
31444
31303
|
|
|
31445
|
-
|
|
31446
|
-
//#region src/shortcuts/cursor.shortcut.ts
|
|
31304
|
+
// src/shortcuts/cursor.shortcut.ts
|
|
31447
31305
|
function moveCursorShortcut(direction, granularity, binding, mac = binding, win = binding, linux = binding) {
|
|
31448
31306
|
return {
|
|
31449
31307
|
id: MoveCursorOperation.id,
|
|
@@ -31542,8 +31400,7 @@ const SelectAllShortcut = {
|
|
|
31542
31400
|
preconditions: (contextService) => contextService.getContextValue(_univerjs_core.FOCUSING_UNIVER_EDITOR) && (contextService.getContextValue(_univerjs_core.FOCUSING_DOC) || contextService.getContextValue(_univerjs_core.EDITOR_ACTIVATED))
|
|
31543
31401
|
};
|
|
31544
31402
|
|
|
31545
|
-
|
|
31546
|
-
//#region src/shortcuts/heading.shortcut.ts
|
|
31403
|
+
// src/shortcuts/heading.shortcut.ts
|
|
31547
31404
|
function headingShortcut(id, key) {
|
|
31548
31405
|
const binding = key | _univerjs_ui.MetaKeys.CTRL_COMMAND | _univerjs_ui.MetaKeys.ALT;
|
|
31549
31406
|
return {
|
|
@@ -31562,8 +31419,7 @@ const H3HeadingShortcut = headingShortcut(H3HeadingCommand.id, _univerjs_ui.KeyC
|
|
|
31562
31419
|
const H4HeadingShortcut = headingShortcut(H4HeadingCommand.id, _univerjs_ui.KeyCode.Digit4);
|
|
31563
31420
|
const H5HeadingShortcut = headingShortcut(H5HeadingCommand.id, _univerjs_ui.KeyCode.Digit5);
|
|
31564
31421
|
|
|
31565
|
-
|
|
31566
|
-
//#region src/plugin.ts
|
|
31422
|
+
// src/plugin.ts
|
|
31567
31423
|
let UniverDocsUIPlugin = class UniverDocsUIPlugin extends _univerjs_core.Plugin {
|
|
31568
31424
|
constructor(_config = defaultPluginConfig, _injector, _renderManagerSrv, _commandService, _configService) {
|
|
31569
31425
|
super();
|
|
@@ -31840,8 +31696,7 @@ UniverDocsUIPlugin = __decorate([
|
|
|
31840
31696
|
__decorateParam(4, _univerjs_core.IConfigService)
|
|
31841
31697
|
], UniverDocsUIPlugin);
|
|
31842
31698
|
|
|
31843
|
-
|
|
31844
|
-
//#region src/services/clipboard/rtf-to-plain-text.ts
|
|
31699
|
+
// src/services/clipboard/rtf-to-plain-text.ts
|
|
31845
31700
|
/**
|
|
31846
31701
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
31847
31702
|
*
|
|
@@ -32001,8 +31856,7 @@ function decodeWindows1252(code) {
|
|
|
32001
31856
|
}[code] ?? String.fromCharCode(code);
|
|
32002
31857
|
}
|
|
32003
31858
|
|
|
32004
|
-
|
|
32005
|
-
//#region src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
|
|
31859
|
+
// src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
|
|
32006
31860
|
const COLOR_TOKENS = [
|
|
32007
31861
|
"gray.900",
|
|
32008
31862
|
"red.500",
|
|
@@ -32083,10 +31937,8 @@ function MobileRichTextToolbar({ editorId, className }) {
|
|
|
32083
31937
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
32084
31938
|
"data-u-comp": "mobile-rich-text-toolbar",
|
|
32085
31939
|
className: (0, _univerjs_design.clsx)("univer-box-border univer-bg-gray-0 univer-shadow-[0_1px_0_rgba(0,0,0,0.06)] dark:!univer-bg-gray-800", className),
|
|
32086
|
-
onPointerDown: (event) =>
|
|
32087
|
-
|
|
32088
|
-
event.stopPropagation();
|
|
32089
|
-
},
|
|
31940
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
31941
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
32090
31942
|
children: !colorsVisible ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
32091
31943
|
className: "univer-grid univer-h-11 univer-grid-cols-7 univer-gap-1 univer-px-2",
|
|
32092
31944
|
children: [
|
|
@@ -32176,7 +32028,7 @@ function MobileRichTextToolbar({ editorId, className }) {
|
|
|
32176
32028
|
variant: "text",
|
|
32177
32029
|
size: "icon",
|
|
32178
32030
|
"aria-label": localeService.t("docs-ui.toolbar.textColor.main"),
|
|
32179
|
-
className: "univer-
|
|
32031
|
+
className: "univer-justify-self-center",
|
|
32180
32032
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.ColorWheelMultiIcon, { className: "!univer-size-6" })
|
|
32181
32033
|
})
|
|
32182
32034
|
})
|
|
@@ -32198,8 +32050,7 @@ function FormatButton(props) {
|
|
|
32198
32050
|
});
|
|
32199
32051
|
}
|
|
32200
32052
|
|
|
32201
|
-
|
|
32202
|
-
//#region src/views/rich-text-editor/hooks/editor-undo-redo-keyboard.ts
|
|
32053
|
+
// src/views/rich-text-editor/hooks/editor-undo-redo-keyboard.ts
|
|
32203
32054
|
function isSheetFormulaEditor(editorUnitId, univerInstanceService) {
|
|
32204
32055
|
var _documentModel$getBod;
|
|
32205
32056
|
if (editorUnitId !== _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY && editorUnitId !== _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) return false;
|
|
@@ -32279,8 +32130,7 @@ function createEditorUndoRedoKeyboardConfig(options) {
|
|
|
32279
32130
|
};
|
|
32280
32131
|
}
|
|
32281
32132
|
|
|
32282
|
-
|
|
32283
|
-
//#region src/views/rich-text-editor/hooks/use-editor.ts
|
|
32133
|
+
// src/views/rich-text-editor/hooks/use-editor.ts
|
|
32284
32134
|
function useEditor(opts) {
|
|
32285
32135
|
const { autoFocus: _autoFocus, cancelDefaultResizeListener, canvasStyle, container, disableBackScroll, documentLayoutSize, emitSelectionWhileDragging, editorId, initialValue, isSingle, pixelRatio, preserveHostFocus, renderConfig } = opts;
|
|
32286
32136
|
const autoFocus = (0, react.useMemo)(() => _autoFocus ?? false, []);
|
|
@@ -32346,8 +32196,7 @@ function useEditor(opts) {
|
|
|
32346
32196
|
return editor;
|
|
32347
32197
|
}
|
|
32348
32198
|
|
|
32349
|
-
|
|
32350
|
-
//#region src/views/rich-text-editor/hooks/use-editor-click-outside.ts
|
|
32199
|
+
// src/views/rich-text-editor/hooks/use-editor-click-outside.ts
|
|
32351
32200
|
const useEditorClickOutside = (editorId, containerRef, onClickOutside) => {
|
|
32352
32201
|
const editorService = (0, _univerjs_ui.useDependency)(IEditorService);
|
|
32353
32202
|
(0, react.useEffect)(() => {
|
|
@@ -32372,8 +32221,7 @@ const useEditorClickOutside = (editorId, containerRef, onClickOutside) => {
|
|
|
32372
32221
|
]);
|
|
32373
32222
|
};
|
|
32374
32223
|
|
|
32375
|
-
|
|
32376
|
-
//#region src/views/rich-text-editor/hooks/use-is-focusing.ts
|
|
32224
|
+
// src/views/rich-text-editor/hooks/use-is-focusing.ts
|
|
32377
32225
|
/**
|
|
32378
32226
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
32379
32227
|
*
|
|
@@ -32396,8 +32244,7 @@ function useIsFocusing(editorId) {
|
|
|
32396
32244
|
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
32245
|
}
|
|
32398
32246
|
|
|
32399
|
-
|
|
32400
|
-
//#region src/views/rich-text-editor/hooks/use-keyboard-event.ts
|
|
32247
|
+
// src/views/rich-text-editor/hooks/use-keyboard-event.ts
|
|
32401
32248
|
function useKeyboardEvent(isNeed, config, editor) {
|
|
32402
32249
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
32403
32250
|
const shortcutService = (0, _univerjs_ui.useDependency)(_univerjs_ui.IShortcutService);
|
|
@@ -32445,8 +32292,7 @@ function useKeyboardEvent(isNeed, config, editor) {
|
|
|
32445
32292
|
]);
|
|
32446
32293
|
}
|
|
32447
32294
|
|
|
32448
|
-
|
|
32449
|
-
//#region src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
|
|
32295
|
+
// src/views/rich-text-editor/hooks/use-left-and-right-arrow.ts
|
|
32450
32296
|
const useLeftAndRightArrow = (isNeed, selectingMode, editor, onMoveInEditor) => {
|
|
32451
32297
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
32452
32298
|
const shortcutService = (0, _univerjs_ui.useDependency)(_univerjs_ui.IShortcutService);
|
|
@@ -32526,8 +32372,7 @@ const useLeftAndRightArrow = (isNeed, selectingMode, editor, onMoveInEditor) =>
|
|
|
32526
32372
|
]);
|
|
32527
32373
|
};
|
|
32528
32374
|
|
|
32529
|
-
|
|
32530
|
-
//#region src/views/rich-text-editor/hooks/use-on-change.ts
|
|
32375
|
+
// src/views/rich-text-editor/hooks/use-on-change.ts
|
|
32531
32376
|
function useOnChange(editor, onChange) {
|
|
32532
32377
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
32533
32378
|
(0, react.useEffect)(() => {
|
|
@@ -32550,11 +32395,12 @@ function useOnChange(editor, onChange) {
|
|
|
32550
32395
|
]);
|
|
32551
32396
|
}
|
|
32552
32397
|
|
|
32553
|
-
|
|
32554
|
-
//#region src/views/rich-text-editor/hooks/use-resize.ts
|
|
32398
|
+
// src/views/rich-text-editor/hooks/use-resize.ts
|
|
32555
32399
|
function resizeEditor(editor, isSingle, layoutSize, pixelRatio, documentLayoutSize) {
|
|
32556
32400
|
var _editor$render$compon;
|
|
32557
32401
|
if (editor.render.isDisposed()) return;
|
|
32402
|
+
const selection = editor.docSelectionRenderService;
|
|
32403
|
+
const restoreSelection = selection.isFocusing || selection.getAllTextRanges().length > 0 || selection.getAllRectRanges().length > 0;
|
|
32558
32404
|
const { scene, mainComponent } = editor.render;
|
|
32559
32405
|
const docSkeletonManagerService = editor.render.with(_univerjs_docs.DocSkeletonManagerService);
|
|
32560
32406
|
const { width, height } = layoutSize ?? editor.getBoundingClientRect();
|
|
@@ -32570,7 +32416,7 @@ function resizeEditor(editor, isSingle, layoutSize, pixelRatio, documentLayoutSi
|
|
|
32570
32416
|
mainComponent === null || mainComponent === void 0 || mainComponent.translate(0, 0);
|
|
32571
32417
|
(_editor$render$compon = editor.render.components.get("__Document_Render_Background__")) === null || _editor$render$compon === void 0 || _editor$render$compon.translate(0, 0);
|
|
32572
32418
|
const selectionRanges = editor.getSelectionRanges();
|
|
32573
|
-
if (selectionRanges.length > 0) editor.setSelectionRanges(selectionRanges, false);
|
|
32419
|
+
if (restoreSelection && selectionRanges.length > 0) editor.setSelectionRanges(selectionRanges, false);
|
|
32574
32420
|
}
|
|
32575
32421
|
const useResize = (editor, isSingle = true, autoScrollbar, autoScroll, layoutSize, pixelRatio, documentLayoutSize) => {
|
|
32576
32422
|
const resize = (0, react.useCallback)(() => {
|
|
@@ -32710,8 +32556,7 @@ const useResize = (editor, isSingle = true, autoScrollbar, autoScroll, layoutSiz
|
|
|
32710
32556
|
};
|
|
32711
32557
|
};
|
|
32712
32558
|
|
|
32713
|
-
|
|
32714
|
-
//#region src/views/RichTextEditor.tsx
|
|
32559
|
+
// src/views/RichTextEditor.tsx
|
|
32715
32560
|
const RichTextEditor = (props) => {
|
|
32716
32561
|
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
32562
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
@@ -32828,8 +32673,22 @@ const RichTextEditor = (props) => {
|
|
|
32828
32673
|
});
|
|
32829
32674
|
};
|
|
32830
32675
|
|
|
32831
|
-
|
|
32832
|
-
|
|
32676
|
+
// src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx
|
|
32677
|
+
/**
|
|
32678
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
32679
|
+
*
|
|
32680
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
32681
|
+
* you may not use this file except in compliance with the License.
|
|
32682
|
+
* You may obtain a copy of the License at
|
|
32683
|
+
*
|
|
32684
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
32685
|
+
*
|
|
32686
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
32687
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
32688
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
32689
|
+
* See the License for the specific language governing permissions and
|
|
32690
|
+
* limitations under the License.
|
|
32691
|
+
*/
|
|
32833
32692
|
/** Compact object text input; expanding keeps the same document editor mounted. */
|
|
32834
32693
|
function MobileRichTextEditor(props) {
|
|
32835
32694
|
var _props$canvasStyle;
|
|
@@ -32854,7 +32713,7 @@ function MobileRichTextEditor(props) {
|
|
|
32854
32713
|
if (keyboardWasVisibleRef.current && !visible) confirmOnDismiss();
|
|
32855
32714
|
keyboardWasVisibleRef.current = visible;
|
|
32856
32715
|
}, [confirmOnDismiss, keyboardInset]);
|
|
32857
|
-
const buttonClassName = (0, _univerjs_design.clsx)("univer-
|
|
32716
|
+
const buttonClassName = (0, _univerjs_design.clsx)("univer-shrink-0", expanded ? "univer-flex-1" : "univer-w-10");
|
|
32858
32717
|
const expandButton = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
32859
32718
|
variant: "ghost",
|
|
32860
32719
|
className: buttonClassName,
|
|
@@ -32862,6 +32721,7 @@ function MobileRichTextEditor(props) {
|
|
|
32862
32721
|
"aria-expanded": expanded,
|
|
32863
32722
|
onPointerDown: (event) => event.preventDefault(),
|
|
32864
32723
|
onClick: () => onExpandedChange(!expanded),
|
|
32724
|
+
size: "middle",
|
|
32865
32725
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.DownIcon, { className: (0, _univerjs_design.clsx)("univer-size-5", !expanded && "univer-rotate-180") })
|
|
32866
32726
|
});
|
|
32867
32727
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
@@ -32901,6 +32761,7 @@ function MobileRichTextEditor(props) {
|
|
|
32901
32761
|
"aria-label": labels.cancel,
|
|
32902
32762
|
onPointerDown: (event) => event.preventDefault(),
|
|
32903
32763
|
onClick: onCancel,
|
|
32764
|
+
size: "middle",
|
|
32904
32765
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CloseIcon, {})
|
|
32905
32766
|
}),
|
|
32906
32767
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
@@ -32909,6 +32770,7 @@ function MobileRichTextEditor(props) {
|
|
|
32909
32770
|
"aria-label": labels.confirm,
|
|
32910
32771
|
onPointerDown: (event) => event.preventDefault(),
|
|
32911
32772
|
onClick: onConfirm,
|
|
32773
|
+
size: "middle",
|
|
32912
32774
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CheckMarkIcon, {})
|
|
32913
32775
|
}),
|
|
32914
32776
|
expanded && expandButton
|
|
@@ -32943,7 +32805,6 @@ function MobileRichTextEditor(props) {
|
|
|
32943
32805
|
});
|
|
32944
32806
|
}
|
|
32945
32807
|
|
|
32946
|
-
//#endregion
|
|
32947
32808
|
exports.AfterSpaceCommand = AfterSpaceCommand;
|
|
32948
32809
|
exports.AlignCenterCommand = AlignCenterCommand;
|
|
32949
32810
|
exports.AlignJustifyCommand = AlignJustifyCommand;
|