@univerjs/slides-ui 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +3 -3
- package/lib/es/index.js +138 -154
- package/lib/index.css +1 -1
- package/lib/types/commands/operations/insert-image.operation.d.ts +2 -6
- package/lib/types/controllers/config.schema.d.ts +9 -0
- package/lib/types/controllers/menu.schema.d.ts +2 -0
- package/lib/types/controllers/shortcuts/editor.shortcuts.d.ts +1 -1
- package/lib/types/controllers/slide-editing.render-controller.d.ts +5 -5
- package/lib/types/controllers/slide-ui.controller.d.ts +4 -10
- package/lib/types/controllers/slide.render-controller.d.ts +2 -2
- package/lib/types/index.d.ts +2 -2
- package/lib/types/services/slide-editor-bridge.service.d.ts +1 -1
- package/lib/types/services/slide-editor-manager.service.d.ts +1 -1
- package/lib/types/services/slide-popup-manager.service.d.ts +3 -3
- package/lib/types/slides-ui-plugin.d.ts +4 -3
- package/lib/umd/index.js +3 -3
- package/package.json +23 -21
- package/lib/types/components/upload-component/UploadFile.d.ts +0 -8
- package/lib/types/components/upload-component/component-name.d.ts +0 -20
package/lib/es/index.js
CHANGED
|
@@ -2,16 +2,17 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
-
import { RxDisposable, UniverInstanceType, debounce, getColorStyle, Inject, Injector, IUniverInstanceService, OnLifecycle, LifecycleStages, CommandType, PageElementType, Tools, useDependency, LocaleService, ICommandService, generateRandomId, BasicShapes, createIdentifier, createInternalEditorID, IContextService, DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, FOCUSING_UNIVER_EDITOR, EDITOR_ACTIVATED, FORMULA_EDITOR_ACTIVATED, Disposable, connectInjector, DisposableCollection, toDisposable, FOCUSING_COMMON_DRAWINGS, FOCUSING_EDITOR_STANDALONE, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, DocumentDataModel, VerticalAlign, HorizontalAlign, WrapStrategy, FOCUSING_EDITOR_BUT_HIDDEN, Direction, IUndoRedoService, Plugin, mergeOverrideWithDependencies } from "@univerjs/core";
|
|
6
|
-
import { Viewport, ScrollBar, Slide, Rect, Scene, IRenderManagerService, ObjectType, FIX_ONE_PIXEL_BLUR_OFFSET, DeviceInputEventType, pxToNum, convertTextRotation, fixLineWidthByScale
|
|
7
|
-
import {
|
|
5
|
+
import { RxDisposable, UniverInstanceType, debounce, getColorStyle, Inject, Injector, IUniverInstanceService, OnLifecycle, LifecycleStages, CommandType, PageElementType, Tools, useDependency, LocaleService, ICommandService, generateRandomId, BasicShapes, createIdentifier, createInternalEditorID, IContextService, DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, FOCUSING_UNIVER_EDITOR, EDITOR_ACTIVATED, FORMULA_EDITOR_ACTIVATED, Disposable, connectInjector, DisposableCollection, toDisposable, FOCUSING_COMMON_DRAWINGS, FOCUSING_EDITOR_STANDALONE, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, DocumentDataModel, VerticalAlign, HorizontalAlign, WrapStrategy, FOCUSING_EDITOR_BUT_HIDDEN, Direction, IUndoRedoService, Plugin, mergeOverrideWithDependencies, IConfigService } from "@univerjs/core";
|
|
6
|
+
import { Viewport, ScrollBar, Slide, Rect, Scene, IRenderManagerService, ObjectType, FIX_ONE_PIXEL_BLUR_OFFSET, DeviceInputEventType, pxToNum, convertTextRotation, fixLineWidthByScale } from "@univerjs/engine-render";
|
|
7
|
+
import { ILocalFileService, ISidebarService, IEditorService, useObservable, DISABLE_AUTO_FOCUS_KEY, TextEditor, MenuItemType, getMenuHiddenObservable, KeyCode, MetaKeys, RibbonStartGroup, BuiltInUIPart, ComponentManager, IMenuManagerService, IUIPartsService, IShortcutService, ICanvasPopupService, ILayoutService } from "@univerjs/ui";
|
|
8
8
|
import { ObjectProvider, SLIDE_KEY } from "@univerjs/slides";
|
|
9
|
-
import { IImageIoService, getImageSize
|
|
9
|
+
import { DRAWING_IMAGE_ALLOW_IMAGE_LIST, IImageIoService, getImageSize } from "@univerjs/drawing";
|
|
10
10
|
import React, { forwardRef, useRef, createElement, useState, useEffect, useCallback } from "react";
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
import { Button, InputNumber, Dropdown, ColorPicker, Scrollbar } from "@univerjs/design";
|
|
13
|
-
import { DeleteLeftCommand,
|
|
13
|
+
import { DeleteLeftCommand, DocSelectionRenderService, VIEWPORT_KEY, DOCS_COMPONENT_MAIN_LAYER_INDEX, MoveSelectionOperation, MoveCursorOperation, DOCS_VIEW_KEY } from "@univerjs/docs-ui";
|
|
14
14
|
import { BehaviorSubject, Subject, filter, takeUntil } from "rxjs";
|
|
15
|
+
import { DocSkeletonManagerService, RichTextEditingMutation, DocSelectionManagerService } from "@univerjs/docs";
|
|
15
16
|
var __assign = function() {
|
|
16
17
|
return __assign = Object.assign || function(t) {
|
|
17
18
|
for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
|
|
@@ -169,8 +170,8 @@ let SlideRenderController = (_a = class extends RxDisposable {
|
|
|
169
170
|
top: 0,
|
|
170
171
|
bottom: 0,
|
|
171
172
|
right: 0,
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
explicitViewportWidthSet: !1,
|
|
174
|
+
explicitViewportHeightSet: !1,
|
|
174
175
|
isWheelPreventDefaultX: !0
|
|
175
176
|
});
|
|
176
177
|
scene.attachControl(), scene.onMouseWheel$.subscribeEvent((evt, state) => {
|
|
@@ -319,8 +320,8 @@ let SlideRenderController = (_a = class extends RxDisposable {
|
|
|
319
320
|
top: 0,
|
|
320
321
|
bottom: 0,
|
|
321
322
|
right: 0,
|
|
322
|
-
|
|
323
|
-
|
|
323
|
+
explicitViewportWidthSet: !1,
|
|
324
|
+
explicitViewportHeightSet: !1
|
|
324
325
|
}).closeClip();
|
|
325
326
|
const { pageElements, pageBackgroundFill } = page, objects = this._objectProvider.convertToRenderObjects(pageElements, mainScene);
|
|
326
327
|
if (!objects || !slide) return;
|
|
@@ -444,16 +445,21 @@ const ActivateSlidePageOperation = {
|
|
|
444
445
|
const activePage = slideData.getActivePage();
|
|
445
446
|
return delete activePage.pageElements[params.id], slideData.updatePage(activePage.id, activePage), accessor.get(CanvasView).removeObjectById(params.id, activePage.id, unitId), !0;
|
|
446
447
|
}, "handler")
|
|
447
|
-
},
|
|
448
|
-
id: "slide.
|
|
449
|
-
type: CommandType.
|
|
448
|
+
}, InsertSlideFloatImageCommand = {
|
|
449
|
+
id: "slide.command.insert-float-image",
|
|
450
|
+
type: CommandType.COMMAND,
|
|
450
451
|
handler: /* @__PURE__ */ __name(async (accessor, params) => {
|
|
451
452
|
var _a11;
|
|
452
|
-
const
|
|
453
|
-
if (!
|
|
454
|
-
const
|
|
453
|
+
const univerInstanceService = accessor.get(IUniverInstanceService), unitId = (_a11 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE)) == null ? void 0 : _a11.getUnitId();
|
|
454
|
+
if (!unitId) return !1;
|
|
455
|
+
const files = await accessor.get(ILocalFileService).openFile({
|
|
456
|
+
multiple: !0,
|
|
457
|
+
accept: DRAWING_IMAGE_ALLOW_IMAGE_LIST.map((image2) => `.${image2.replace("image/", "")}`).join(",")
|
|
458
|
+
});
|
|
459
|
+
if (files.length !== 1) return !1;
|
|
460
|
+
const imageParam = await accessor.get(IImageIoService).saveImage(files[0]);
|
|
455
461
|
if (!imageParam) return !1;
|
|
456
|
-
const { imageId, imageSourceType, source, base64Cache } = imageParam, { width, height, image } = await getImageSize(base64Cache || ""),
|
|
462
|
+
const { imageId, imageSourceType, source, base64Cache } = imageParam, { width, height, image } = await getImageSize(base64Cache || ""), slideData = univerInstanceService.getUnit(unitId);
|
|
457
463
|
if (!slideData) return !1;
|
|
458
464
|
const activePage = slideData.getActivePage(), elements = Object.values(activePage.pageElements), maxIndex = elements != null && elements.length ? Math.max(...elements.map((element2) => element2.zIndex)) : 20, data = {
|
|
459
465
|
id: imageId,
|
|
@@ -476,8 +482,8 @@ const ActivateSlidePageOperation = {
|
|
|
476
482
|
}
|
|
477
483
|
};
|
|
478
484
|
activePage.pageElements[imageId] = data, slideData.updatePage(activePage.id, activePage);
|
|
479
|
-
const
|
|
480
|
-
return sceneObject &&
|
|
485
|
+
const canvasView = accessor.get(CanvasView), sceneObject = canvasView.createObjectToPage(data, activePage.id, unitId);
|
|
486
|
+
return sceneObject && canvasView.setObjectActiveByPage(sceneObject, activePage.id, unitId), !0;
|
|
481
487
|
}, "handler")
|
|
482
488
|
};
|
|
483
489
|
var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
|
|
@@ -513,7 +519,7 @@ const UpdateSlideElementOperation = {
|
|
|
513
519
|
const activePage = slideData.getActivePage();
|
|
514
520
|
return activePage.pageElements[oKey] = Tools.deepMerge(activePage.pageElements[oKey], props), slideData.updatePage(activePage.id, activePage), !0;
|
|
515
521
|
}, "handler")
|
|
516
|
-
}, imageCommonPanel$1 = "univer-image-common-panel", imageCommonPanelGrid$1 = "univer-image-common-panel-grid", imageCommonPanelBorder$1 = "univer-image-common-panel-border", imageCommonPanelTitle$1 = "univer-image-common-panel-title", imageCommonPanelSubtitle$1 = "univer-image-common-panel-subtitle", imageCommonPanelRow$1 = "univer-image-common-panel-row", imageCommonPanelRowVertical$1 = "univer-image-common-panel-row-vertical", imageCommonPanelColumn$1 = "univer-image-common-panel-column", imageCommonPanelColumnCenter$1 = "univer-image-common-panel-column-center", imageCommonPanelInline$1 = "univer-image-common-panel-inline", imageCommonPanelSpan2$1 = "univer-image-common-panel-span2", imageCommonPanelSpan3$1 = "univer-image-common-panel-span3", imageCommonPanelInput$1 = "univer-image-common-panel-input", slidePanelColorPicker = "univer-slide-panel-color-picker", styles$
|
|
522
|
+
}, imageCommonPanel$1 = "univer-image-common-panel", imageCommonPanelGrid$1 = "univer-image-common-panel-grid", imageCommonPanelBorder$1 = "univer-image-common-panel-border", imageCommonPanelTitle$1 = "univer-image-common-panel-title", imageCommonPanelSubtitle$1 = "univer-image-common-panel-subtitle", imageCommonPanelRow$1 = "univer-image-common-panel-row", imageCommonPanelRowVertical$1 = "univer-image-common-panel-row-vertical", imageCommonPanelColumn$1 = "univer-image-common-panel-column", imageCommonPanelColumnCenter$1 = "univer-image-common-panel-column-center", imageCommonPanelInline$1 = "univer-image-common-panel-inline", imageCommonPanelSpan2$1 = "univer-image-common-panel-span2", imageCommonPanelSpan3$1 = "univer-image-common-panel-span3", imageCommonPanelInput$1 = "univer-image-common-panel-input", slidePanelColorPicker = "univer-slide-panel-color-picker", styles$4 = {
|
|
517
523
|
imageCommonPanel: imageCommonPanel$1,
|
|
518
524
|
imageCommonPanelGrid: imageCommonPanelGrid$1,
|
|
519
525
|
imageCommonPanelBorder: imageCommonPanelBorder$1,
|
|
@@ -552,44 +558,44 @@ function ArrangePanel$1(props) {
|
|
|
552
558
|
}
|
|
553
559
|
});
|
|
554
560
|
}, "onArrangeBtnClick");
|
|
555
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$
|
|
556
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
557
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$
|
|
558
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
561
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelGrid, children: [
|
|
562
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("image-panel.arrange.title") }) }) }),
|
|
563
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelRow, children: [
|
|
564
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
|
|
559
565
|
onArrangeBtnClick(
|
|
560
566
|
0
|
|
561
567
|
/* forward */
|
|
562
568
|
);
|
|
563
|
-
}, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$
|
|
569
|
+
}, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$4.imageCommonPanelInline, children: [
|
|
564
570
|
/* @__PURE__ */ jsxRuntimeExports.jsx(MoveUpSingle, {}),
|
|
565
571
|
localeService.t("image-panel.arrange.forward")
|
|
566
572
|
] }) }) }),
|
|
567
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
573
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
|
|
568
574
|
onArrangeBtnClick(
|
|
569
575
|
1
|
|
570
576
|
/* backward */
|
|
571
577
|
);
|
|
572
|
-
}, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$
|
|
578
|
+
}, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$4.imageCommonPanelInline, children: [
|
|
573
579
|
/* @__PURE__ */ jsxRuntimeExports.jsx(MoveDownSingle, {}),
|
|
574
580
|
localeService.t("image-panel.arrange.backward")
|
|
575
581
|
] }) }) })
|
|
576
582
|
] }),
|
|
577
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$
|
|
578
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
583
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelRow, children: [
|
|
584
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
|
|
579
585
|
onArrangeBtnClick(
|
|
580
586
|
2
|
|
581
587
|
/* front */
|
|
582
588
|
);
|
|
583
|
-
}, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$
|
|
589
|
+
}, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$4.imageCommonPanelInline, children: [
|
|
584
590
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TopmostSingle, {}),
|
|
585
591
|
localeService.t("image-panel.arrange.front")
|
|
586
592
|
] }) }) }),
|
|
587
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
593
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
|
|
588
594
|
onArrangeBtnClick(
|
|
589
595
|
3
|
|
590
596
|
/* back */
|
|
591
597
|
);
|
|
592
|
-
}, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$
|
|
598
|
+
}, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$4.imageCommonPanelInline, children: [
|
|
593
599
|
/* @__PURE__ */ jsxRuntimeExports.jsx(BottomSingle, {}),
|
|
594
600
|
localeService.t("image-panel.arrange.back")
|
|
595
601
|
] }) }) })
|
|
@@ -684,16 +690,16 @@ function TransformPanel(props) {
|
|
|
684
690
|
return __name(handleChangeRotation, "handleChangeRotation"), /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
685
691
|
"div",
|
|
686
692
|
{
|
|
687
|
-
className: clsx(styles$
|
|
693
|
+
className: clsx(styles$4.imageCommonPanelGrid, styles$4.imageCommonPanelBorder),
|
|
688
694
|
children: [
|
|
689
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
690
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$
|
|
691
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
692
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
693
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
695
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("image-panel.transform.title") }) }) }),
|
|
696
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelRow, children: [
|
|
697
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
698
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.width") }) }),
|
|
699
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
694
700
|
InputNumber,
|
|
695
701
|
{
|
|
696
|
-
className: styles$
|
|
702
|
+
className: styles$4.imageCommonPanelInput,
|
|
697
703
|
min: 1,
|
|
698
704
|
value: width,
|
|
699
705
|
onChange: /* @__PURE__ */ __name((val) => {
|
|
@@ -702,12 +708,12 @@ function TransformPanel(props) {
|
|
|
702
708
|
}
|
|
703
709
|
) }) })
|
|
704
710
|
] }) }),
|
|
705
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
706
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
707
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
711
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
712
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.height") }) }),
|
|
713
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
708
714
|
InputNumber,
|
|
709
715
|
{
|
|
710
|
-
className: styles$
|
|
716
|
+
className: styles$4.imageCommonPanelInput,
|
|
711
717
|
min: 1,
|
|
712
718
|
value: height,
|
|
713
719
|
onChange: /* @__PURE__ */ __name((val) => {
|
|
@@ -717,13 +723,13 @@ function TransformPanel(props) {
|
|
|
717
723
|
) }) })
|
|
718
724
|
] }) })
|
|
719
725
|
] }),
|
|
720
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$
|
|
721
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
722
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
723
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
726
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelRow, children: [
|
|
727
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
728
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.x") }) }),
|
|
729
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
724
730
|
InputNumber,
|
|
725
731
|
{
|
|
726
|
-
className: styles$
|
|
732
|
+
className: styles$4.imageCommonPanelInput,
|
|
727
733
|
precision: 1,
|
|
728
734
|
min: 0,
|
|
729
735
|
value: xPosition,
|
|
@@ -733,12 +739,12 @@ function TransformPanel(props) {
|
|
|
733
739
|
}
|
|
734
740
|
) }) })
|
|
735
741
|
] }) }),
|
|
736
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
737
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
738
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
742
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
743
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.y") }) }),
|
|
744
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
739
745
|
InputNumber,
|
|
740
746
|
{
|
|
741
|
-
className: styles$
|
|
747
|
+
className: styles$4.imageCommonPanelInput,
|
|
742
748
|
precision: 1,
|
|
743
749
|
min: 0,
|
|
744
750
|
value: yPosition,
|
|
@@ -748,12 +754,12 @@ function TransformPanel(props) {
|
|
|
748
754
|
}
|
|
749
755
|
) }) })
|
|
750
756
|
] }) }),
|
|
751
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$
|
|
752
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
753
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
757
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
758
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.rotate") }) }),
|
|
759
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
754
760
|
InputNumber,
|
|
755
761
|
{
|
|
756
|
-
className: styles$
|
|
762
|
+
className: styles$4.imageCommonPanelInput,
|
|
757
763
|
precision: 1,
|
|
758
764
|
value: rotation,
|
|
759
765
|
onChange: handleChangeRotation
|
|
@@ -795,25 +801,25 @@ function ArrangePanel(props) {
|
|
|
795
801
|
return __name(handleChangeColor, "handleChangeColor"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
796
802
|
"div",
|
|
797
803
|
{
|
|
798
|
-
className: clsx(styles$
|
|
799
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$
|
|
800
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
801
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$
|
|
804
|
+
className: clsx(styles$4.imageCommonPanelGrid, styles$4.imageCommonPanelBorder),
|
|
805
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelGrid, children: [
|
|
806
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("slide.panel.fill.title") }) }) }),
|
|
807
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
802
808
|
Dropdown,
|
|
803
809
|
{
|
|
804
810
|
align: {
|
|
805
811
|
offset: [0, 18]
|
|
806
812
|
},
|
|
807
|
-
overlay: /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$
|
|
813
|
+
overlay: /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$4.slidePanelColorPicker, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
808
814
|
ColorPicker,
|
|
809
815
|
{
|
|
810
816
|
color: "#fff",
|
|
811
817
|
onChange: handleChangeColor
|
|
812
818
|
}
|
|
813
819
|
) }),
|
|
814
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { className: styles$
|
|
820
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { className: styles$4.uiPluginSheetsBorderPanelButton, children: [
|
|
815
821
|
/* @__PURE__ */ jsxRuntimeExports.jsx(PaintBucket, { extend: { colorChannel1: color != null ? color : "rgb(var(--primary-color))" } }),
|
|
816
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$
|
|
822
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$4.uiPluginSheetsBorderPanelMoreIcon, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MoreDownSingle, {}) })
|
|
817
823
|
] })
|
|
818
824
|
}
|
|
819
825
|
) }) })
|
|
@@ -822,7 +828,7 @@ function ArrangePanel(props) {
|
|
|
822
828
|
);
|
|
823
829
|
}
|
|
824
830
|
__name(ArrangePanel, "ArrangePanel");
|
|
825
|
-
const imageCommonPanel = "univer-image-common-panel", imageCommonPanelGrid = "univer-image-common-panel-grid", imageCommonPanelBorder = "univer-image-common-panel-border", imageCommonPanelTitle = "univer-image-common-panel-title", imageCommonPanelSubtitle = "univer-image-common-panel-subtitle", imageCommonPanelRow = "univer-image-common-panel-row", imageCommonPanelRowVertical = "univer-image-common-panel-row-vertical", imageCommonPanelColumn = "univer-image-common-panel-column", imageCommonPanelColumnCenter = "univer-image-common-panel-column-center", imageCommonPanelInline = "univer-image-common-panel-inline", imageCommonPanelSpan2 = "univer-image-common-panel-span2", imageCommonPanelSpan3 = "univer-image-common-panel-span3", imageCommonPanelInput = "univer-image-common-panel-input", styles$
|
|
831
|
+
const imageCommonPanel = "univer-image-common-panel", imageCommonPanelGrid = "univer-image-common-panel-grid", imageCommonPanelBorder = "univer-image-common-panel-border", imageCommonPanelTitle = "univer-image-common-panel-title", imageCommonPanelSubtitle = "univer-image-common-panel-subtitle", imageCommonPanelRow = "univer-image-common-panel-row", imageCommonPanelRowVertical = "univer-image-common-panel-row-vertical", imageCommonPanelColumn = "univer-image-common-panel-column", imageCommonPanelColumnCenter = "univer-image-common-panel-column-center", imageCommonPanelInline = "univer-image-common-panel-inline", imageCommonPanelSpan2 = "univer-image-common-panel-span2", imageCommonPanelSpan3 = "univer-image-common-panel-span3", imageCommonPanelInput = "univer-image-common-panel-input", styles$3 = {
|
|
826
832
|
imageCommonPanel,
|
|
827
833
|
imageCommonPanelGrid,
|
|
828
834
|
imageCommonPanelBorder,
|
|
@@ -847,7 +853,7 @@ function RectSidebar() {
|
|
|
847
853
|
if (!object)
|
|
848
854
|
return null;
|
|
849
855
|
const unitId = ((_c = univerInstanceService.getFocusedUnit()) == null ? void 0 : _c.getUnitId()) || "";
|
|
850
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: styles$
|
|
856
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: styles$3.imageCommonPanel, children: [
|
|
851
857
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ArrangePanel$1, { pageId, unitId }),
|
|
852
858
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TransformPanel, { pageId, unitId }),
|
|
853
859
|
object.objectType === ObjectType.RECT && /* @__PURE__ */ jsxRuntimeExports.jsx(ArrangePanel, { pageId, unitId })
|
|
@@ -951,7 +957,7 @@ const InsertSlideShapeRectangleCommand = {
|
|
|
951
957
|
id: "slide.operation.edit-arrow",
|
|
952
958
|
type: CommandType.OPERATION,
|
|
953
959
|
handler: /* @__PURE__ */ __name(() => !0, "handler")
|
|
954
|
-
}, imagePopupMenu = "univer-image-popup-menu", imagePopupMenuItem = "univer-image-popup-menu-item", imagePopupMenuItemIcon = "univer-image-popup-menu-item-icon", imagePopupMenuItemTitle = "univer-image-popup-menu-item-title", imagePopupMenuItemHide = "univer-image-popup-menu-item-hide", btnContainer = "univer-btn-container", btnContainerExpand = "univer-btn-container-expand", styles$
|
|
960
|
+
}, imagePopupMenu = "univer-image-popup-menu", imagePopupMenuItem = "univer-image-popup-menu-item", imagePopupMenuItemIcon = "univer-image-popup-menu-item-icon", imagePopupMenuItemTitle = "univer-image-popup-menu-item-title", imagePopupMenuItemHide = "univer-image-popup-menu-item-hide", btnContainer = "univer-btn-container", btnContainerExpand = "univer-btn-container-expand", styles$2 = {
|
|
955
961
|
imagePopupMenu,
|
|
956
962
|
imagePopupMenuItem,
|
|
957
963
|
imagePopupMenuItemIcon,
|
|
@@ -983,12 +989,12 @@ const InsertSlideShapeRectangleCommand = {
|
|
|
983
989
|
{
|
|
984
990
|
placement: "bottomLeft",
|
|
985
991
|
trigger: ["click"],
|
|
986
|
-
overlay: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles$
|
|
992
|
+
overlay: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles$2.imagePopupMenu, children: availableMenu.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
987
993
|
"li",
|
|
988
994
|
{
|
|
989
995
|
onClick: /* @__PURE__ */ __name(() => handleClick(item), "onClick"),
|
|
990
|
-
className: styles$
|
|
991
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$
|
|
996
|
+
className: styles$2.imagePopupMenuItem,
|
|
997
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$2.imagePopupMenuItemTitle, children: localeService.t(item.label) })
|
|
992
998
|
},
|
|
993
999
|
item.index
|
|
994
1000
|
)) }),
|
|
@@ -997,8 +1003,8 @@ const InsertSlideShapeRectangleCommand = {
|
|
|
997
1003
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
998
1004
|
"div",
|
|
999
1005
|
{
|
|
1000
|
-
className: clsx(styles$
|
|
1001
|
-
[styles$
|
|
1006
|
+
className: clsx(styles$2.btnContainer, {
|
|
1007
|
+
[styles$2.btnContainerExpand]: visible
|
|
1002
1008
|
}),
|
|
1003
1009
|
children: [
|
|
1004
1010
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1016,34 +1022,7 @@ const InsertSlideShapeRectangleCommand = {
|
|
|
1016
1022
|
)
|
|
1017
1023
|
}
|
|
1018
1024
|
);
|
|
1019
|
-
}, "SlideImagePopupMenu"), COMPONENT_SLIDE_IMAGE_POPUP_MENU = "COMPONENT_SLIDE_IMAGE_POPUP_MENU",
|
|
1020
|
-
uploadFileMenu,
|
|
1021
|
-
uploadFileMenuInput
|
|
1022
|
-
}, COMPONENT_UPLOAD_FILE_MENU = "SLIDE_COMPONENT_UPLOAD_FILE_MENU";
|
|
1023
|
-
var UploadFileType = /* @__PURE__ */ ((UploadFileType2) => (UploadFileType2[UploadFileType2.cellImage = 0] = "cellImage", UploadFileType2[UploadFileType2.floatImage = 1] = "floatImage", UploadFileType2))(UploadFileType || {});
|
|
1024
|
-
const UploadFileMenu = /* @__PURE__ */ __name((props) => {
|
|
1025
|
-
const { type } = props, commandService = useDependency(ICommandService), univerInstanceService = useDependency(IUniverInstanceService), focused = useObservable(univerInstanceService.focused$), fileInputRef = useRef(null), handleButtonClick = /* @__PURE__ */ __name(() => {
|
|
1026
|
-
var _a11;
|
|
1027
|
-
(_a11 = fileInputRef.current) == null || _a11.click();
|
|
1028
|
-
}, "handleButtonClick"), imageAccept = DRAWING_IMAGE_ALLOW_IMAGE_LIST.map((image) => `.${image.replace("image/", "")}`).join(","), handleFileChange = /* @__PURE__ */ __name((event) => {
|
|
1029
|
-
const fileList = event.target.files;
|
|
1030
|
-
if (fileList == null)
|
|
1031
|
-
return;
|
|
1032
|
-
const files = Array.from(fileList);
|
|
1033
|
-
type === UploadFileType.floatImage && commandService.executeCommand(InsertSlideFloatImageOperation.id, { files, unitId: focused }), fileInputRef.current && (fileInputRef.current.value = "");
|
|
1034
|
-
}, "handleFileChange");
|
|
1035
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: handleButtonClick, className: styles$2.uploadFileMenu, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1036
|
-
"input",
|
|
1037
|
-
{
|
|
1038
|
-
type: "file",
|
|
1039
|
-
className: styles$2.uploadFileMenuInput,
|
|
1040
|
-
ref: fileInputRef,
|
|
1041
|
-
onChange: handleFileChange,
|
|
1042
|
-
accept: imageAccept,
|
|
1043
|
-
multiple: !0
|
|
1044
|
-
}
|
|
1045
|
-
) });
|
|
1046
|
-
}, "UploadFileMenu"), _SlideEditorManagerService = class _SlideEditorManagerService {
|
|
1025
|
+
}, "SlideImagePopupMenu"), COMPONENT_SLIDE_IMAGE_POPUP_MENU = "COMPONENT_SLIDE_IMAGE_POPUP_MENU", _SlideEditorManagerService = class _SlideEditorManagerService {
|
|
1047
1026
|
constructor() {
|
|
1048
1027
|
__publicField(this, "_state", null);
|
|
1049
1028
|
__publicField(this, "_rect", null);
|
|
@@ -1237,27 +1216,17 @@ function SlideImageMenuFactory(accessor) {
|
|
|
1237
1216
|
return {
|
|
1238
1217
|
id: IMAGE_MENU_ID,
|
|
1239
1218
|
type: MenuItemType.SUBITEMS,
|
|
1240
|
-
positions: [MenuPosition.TOOLBAR_START],
|
|
1241
|
-
group: MenuGroup.TOOLBAR_FORMULAS_INSERT,
|
|
1242
1219
|
icon: IMAGE_UPLOAD_ICON,
|
|
1243
1220
|
tooltip: "slide.image.insert.title",
|
|
1244
1221
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SLIDE)
|
|
1245
|
-
// disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),
|
|
1246
1222
|
};
|
|
1247
1223
|
}
|
|
1248
1224
|
__name(SlideImageMenuFactory, "SlideImageMenuFactory");
|
|
1249
1225
|
function UploadSlideFloatImageMenuFactory(_accessor) {
|
|
1250
1226
|
return {
|
|
1251
|
-
id:
|
|
1227
|
+
id: InsertSlideFloatImageCommand.id,
|
|
1252
1228
|
title: "slide.image.insert.float",
|
|
1253
|
-
type: MenuItemType.
|
|
1254
|
-
label: {
|
|
1255
|
-
name: COMPONENT_UPLOAD_FILE_MENU,
|
|
1256
|
-
props: {
|
|
1257
|
-
type: UploadFileType.floatImage
|
|
1258
|
-
}
|
|
1259
|
-
},
|
|
1260
|
-
positions: [IMAGE_MENU_ID],
|
|
1229
|
+
type: MenuItemType.BUTTON,
|
|
1261
1230
|
hidden$: getMenuHiddenObservable(_accessor, UniverInstanceType.UNIVER_SLIDE)
|
|
1262
1231
|
};
|
|
1263
1232
|
}
|
|
@@ -1267,8 +1236,6 @@ function SlideShapeMenuFactory(accessor) {
|
|
|
1267
1236
|
return {
|
|
1268
1237
|
id: SHAPE_MENU_ID,
|
|
1269
1238
|
type: MenuItemType.SUBITEMS,
|
|
1270
|
-
positions: [MenuPosition.TOOLBAR_START],
|
|
1271
|
-
group: MenuGroup.TOOLBAR_FORMULAS_INSERT,
|
|
1272
1239
|
icon: GRAPH_SINGLE_ICON,
|
|
1273
1240
|
tooltip: "slide.shape.insert.title",
|
|
1274
1241
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SLIDE)
|
|
@@ -1281,7 +1248,6 @@ function UploadSlideFloatShapeMenuFactory(_accessor) {
|
|
|
1281
1248
|
id: InsertSlideShapeRectangleCommand.id,
|
|
1282
1249
|
title: "slide.shape.insert.rectangle",
|
|
1283
1250
|
type: MenuItemType.BUTTON,
|
|
1284
|
-
positions: [SHAPE_MENU_ID],
|
|
1285
1251
|
hidden$: getMenuHiddenObservable(_accessor, UniverInstanceType.UNIVER_SLIDE)
|
|
1286
1252
|
};
|
|
1287
1253
|
}
|
|
@@ -1336,46 +1302,59 @@ const EditorDeleteLeftShortcut = {
|
|
|
1336
1302
|
function SlideAddTextMenuItemFactory(_accessor) {
|
|
1337
1303
|
return {
|
|
1338
1304
|
id: SlideAddTextCommand.id,
|
|
1339
|
-
group: MenuGroup.TOOLBAR_FORMULAS_INSERT,
|
|
1340
1305
|
type: MenuItemType.BUTTON,
|
|
1341
1306
|
icon: TEXT_ICON_ID,
|
|
1342
1307
|
tooltip: "slide.text.insert.title",
|
|
1343
|
-
positions: [MenuPosition.TOOLBAR_START],
|
|
1344
1308
|
hidden$: getMenuHiddenObservable(_accessor, UniverInstanceType.UNIVER_SLIDE)
|
|
1345
1309
|
};
|
|
1346
1310
|
}
|
|
1347
1311
|
__name(SlideAddTextMenuItemFactory, "SlideAddTextMenuItemFactory");
|
|
1312
|
+
const menuSchema = {
|
|
1313
|
+
[RibbonStartGroup.FORMAT]: {
|
|
1314
|
+
[SlideAddTextCommand.id]: {
|
|
1315
|
+
order: 0,
|
|
1316
|
+
menuItemFactory: SlideAddTextMenuItemFactory
|
|
1317
|
+
},
|
|
1318
|
+
[IMAGE_MENU_ID]: {
|
|
1319
|
+
order: 0,
|
|
1320
|
+
menuItemFactory: SlideImageMenuFactory,
|
|
1321
|
+
[InsertSlideFloatImageCommand.id]: {
|
|
1322
|
+
order: 0,
|
|
1323
|
+
menuItemFactory: UploadSlideFloatImageMenuFactory
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1326
|
+
[SHAPE_MENU_ID]: {
|
|
1327
|
+
order: 0,
|
|
1328
|
+
menuItemFactory: SlideShapeMenuFactory,
|
|
1329
|
+
[InsertSlideShapeRectangleCommand.id]: {
|
|
1330
|
+
order: 0,
|
|
1331
|
+
menuItemFactory: UploadSlideFloatShapeMenuFactory
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1348
1336
|
var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
1349
1337
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1350
1338
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
1351
1339
|
return kind && result && __defProp$7(target, key, result), result;
|
|
1352
1340
|
}, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$7"), _a3;
|
|
1353
1341
|
let SlidesUIController = (_a3 = class extends Disposable {
|
|
1354
|
-
constructor(
|
|
1355
|
-
super(), this.
|
|
1342
|
+
constructor(_injector, _menuManagerService, _componentManager, _uiPartsService, _commandService, _shortcutService) {
|
|
1343
|
+
super(), this._injector = _injector, this._menuManagerService = _menuManagerService, this._componentManager = _componentManager, this._uiPartsService = _uiPartsService, this._commandService = _commandService, this._shortcutService = _shortcutService, this._initCommands(), this._initCustomComponents(), this._initUIComponents(), this._initMenus(), this._initShortcuts();
|
|
1356
1344
|
}
|
|
1357
1345
|
_initMenus() {
|
|
1358
|
-
|
|
1359
|
-
[
|
|
1360
|
-
SlideAddTextMenuItemFactory,
|
|
1361
|
-
SlideImageMenuFactory,
|
|
1362
|
-
UploadSlideFloatImageMenuFactory,
|
|
1363
|
-
SlideShapeMenuFactory,
|
|
1364
|
-
UploadSlideFloatShapeMenuFactory
|
|
1365
|
-
].forEach((menuFactory) => {
|
|
1366
|
-
this._menuService.addMenuItem(menuFactory(this._injector), menu);
|
|
1367
|
-
});
|
|
1346
|
+
this._menuManagerService.mergeMenu(menuSchema);
|
|
1368
1347
|
}
|
|
1369
1348
|
_initCustomComponents() {
|
|
1370
1349
|
const componentManager = this._componentManager;
|
|
1371
|
-
this.disposeWithMe(componentManager.register(IMAGE_UPLOAD_ICON, AddImageSingle)), this.disposeWithMe(componentManager.register(TEXT_ICON_ID, TextSingle)), this.disposeWithMe(componentManager.register(GRAPH_SINGLE_ICON, GraphSingle)), this.disposeWithMe(componentManager.register(
|
|
1350
|
+
this.disposeWithMe(componentManager.register(IMAGE_UPLOAD_ICON, AddImageSingle)), this.disposeWithMe(componentManager.register(TEXT_ICON_ID, TextSingle)), this.disposeWithMe(componentManager.register(GRAPH_SINGLE_ICON, GraphSingle)), this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_IMAGE_POPUP_MENU, SlideImagePopupMenu)), this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_SIDEBAR, RectSidebar));
|
|
1372
1351
|
}
|
|
1373
1352
|
_initCommands() {
|
|
1374
1353
|
[
|
|
1375
1354
|
AppendSlideOperation,
|
|
1376
1355
|
ActivateSlidePageOperation,
|
|
1377
1356
|
SetSlidePageThumbOperation,
|
|
1378
|
-
|
|
1357
|
+
InsertSlideFloatImageCommand,
|
|
1379
1358
|
SlideAddTextOperation,
|
|
1380
1359
|
SlideAddTextCommand,
|
|
1381
1360
|
InsertSlideShapeRectangleOperation,
|
|
@@ -1405,12 +1384,12 @@ let SlidesUIController = (_a3 = class extends Disposable {
|
|
|
1405
1384
|
}, __name(_a3, "SlidesUIController"), _a3);
|
|
1406
1385
|
SlidesUIController = __decorateClass$7([
|
|
1407
1386
|
OnLifecycle(LifecycleStages.Ready, SlidesUIController),
|
|
1408
|
-
__decorateParam$7(
|
|
1409
|
-
__decorateParam$7(
|
|
1410
|
-
__decorateParam$7(
|
|
1411
|
-
__decorateParam$7(
|
|
1412
|
-
__decorateParam$7(
|
|
1413
|
-
__decorateParam$7(
|
|
1387
|
+
__decorateParam$7(0, Inject(Injector)),
|
|
1388
|
+
__decorateParam$7(1, IMenuManagerService),
|
|
1389
|
+
__decorateParam$7(2, Inject(ComponentManager)),
|
|
1390
|
+
__decorateParam$7(3, IUIPartsService),
|
|
1391
|
+
__decorateParam$7(4, ICommandService),
|
|
1392
|
+
__decorateParam$7(5, IShortcutService)
|
|
1414
1393
|
], SlidesUIController);
|
|
1415
1394
|
var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
1416
1395
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
@@ -1888,7 +1867,7 @@ var CursorChange = /* @__PURE__ */ ((_CursorChange) => (_CursorChange[_CursorCha
|
|
|
1888
1867
|
const HIDDEN_EDITOR_POSITION = -1e3, EDITOR_INPUT_SELF_EXTEND_GAP = 5, EDITOR_BORDER_SIZE = 2;
|
|
1889
1868
|
var _a8;
|
|
1890
1869
|
let SlideEditingRenderController = (_a8 = class extends Disposable {
|
|
1891
|
-
constructor(_renderContext, _layoutService, _undoRedoService, _contextService, _instanceSrv, _renderManagerService, _editorBridgeService, _cellEditorManagerService,
|
|
1870
|
+
constructor(_renderContext, _layoutService, _undoRedoService, _contextService, _instanceSrv, _renderManagerService, _editorBridgeService, _cellEditorManagerService, _textSelectionManagerService, _commandService, _localService, _editorService) {
|
|
1892
1871
|
super();
|
|
1893
1872
|
/**
|
|
1894
1873
|
* It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
|
|
@@ -1897,7 +1876,7 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
|
|
|
1897
1876
|
/** If the corresponding unit is active and prepared for editing. */
|
|
1898
1877
|
__publicField(this, "_isUnitEditing", !1);
|
|
1899
1878
|
__publicField(this, "_d");
|
|
1900
|
-
this._renderContext = _renderContext, this._layoutService = _layoutService, this._undoRedoService = _undoRedoService, this._contextService = _contextService, this._instanceSrv = _instanceSrv, this._renderManagerService = _renderManagerService, this._editorBridgeService = _editorBridgeService, this._cellEditorManagerService = _cellEditorManagerService, this.
|
|
1879
|
+
this._renderContext = _renderContext, this._layoutService = _layoutService, this._undoRedoService = _undoRedoService, this._contextService = _contextService, this._instanceSrv = _instanceSrv, this._renderManagerService = _renderManagerService, this._editorBridgeService = _editorBridgeService, this._cellEditorManagerService = _cellEditorManagerService, this._textSelectionManagerService = _textSelectionManagerService, this._commandService = _commandService, this._localService = _localService, this._editorService = _editorService, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SLIDE).subscribe((slideDataModel) => {
|
|
1901
1880
|
slideDataModel && slideDataModel.getUnitId() === this._renderContext.unitId ? this._d = this._init() : (this._disposeCurrent(), this._isUnitEditing && (this._handleEditorInvisible({
|
|
1902
1881
|
visible: !1,
|
|
1903
1882
|
eventType: DeviceInputEventType.Keyboard,
|
|
@@ -1939,7 +1918,9 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
|
|
|
1939
1918
|
}
|
|
1940
1919
|
_initialCursorSync(d) {
|
|
1941
1920
|
d.add(this._cellEditorManagerService.focus$.pipe(filter((f2) => !!f2)).subscribe(() => {
|
|
1942
|
-
|
|
1921
|
+
var _a11;
|
|
1922
|
+
const docSelectionRenderManager = (_a11 = this._renderManagerService.getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_DOC)) == null ? void 0 : _a11.with(DocSelectionRenderService);
|
|
1923
|
+
docSelectionRenderManager && docSelectionRenderManager.sync();
|
|
1943
1924
|
}));
|
|
1944
1925
|
}
|
|
1945
1926
|
/**
|
|
@@ -1948,6 +1929,7 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
|
|
|
1948
1929
|
*/
|
|
1949
1930
|
_subscribeToCurrentCell(d) {
|
|
1950
1931
|
d.add(this._editorBridgeService.currentEditRectState$.subscribe((editCellState) => {
|
|
1932
|
+
var _a11;
|
|
1951
1933
|
if (editCellState == null || this._contextService.getContextValue(FOCUSING_EDITOR_STANDALONE) || this._contextService.getContextValue(FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE))
|
|
1952
1934
|
return;
|
|
1953
1935
|
const {
|
|
@@ -1959,7 +1941,9 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
|
|
|
1959
1941
|
documentModel.updateDocumentId(editorUnitId), wrapStrategy === WrapStrategy.WRAP && angle === 0 && documentModel.updateDocumentDataPageSize((endX - startX) / scaleX), this._instanceSrv.changeDoc(editorUnitId, documentModel), this._contextService.setContextValue(FOCUSING_EDITOR_BUT_HIDDEN, !0), this._textSelectionManagerService.replaceTextRanges([{
|
|
1960
1942
|
startOffset: 0,
|
|
1961
1943
|
endOffset: 0
|
|
1962
|
-
}])
|
|
1944
|
+
}]);
|
|
1945
|
+
const docSelectionRenderManager = (_a11 = this._renderManagerService.getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_DOC)) == null ? void 0 : _a11.with(DocSelectionRenderService);
|
|
1946
|
+
docSelectionRenderManager && docSelectionRenderManager.activate(HIDDEN_EDITOR_POSITION, HIDDEN_EDITOR_POSITION);
|
|
1963
1947
|
}));
|
|
1964
1948
|
}
|
|
1965
1949
|
/**
|
|
@@ -2134,8 +2118,6 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
|
|
|
2134
2118
|
* @param d DisposableCollection
|
|
2135
2119
|
*/
|
|
2136
2120
|
_initialKeyboardListener(d) {
|
|
2137
|
-
d.add(this._textSelectionRenderManager.onInputBefore$.subscribe((config) => {
|
|
2138
|
-
}));
|
|
2139
2121
|
}
|
|
2140
2122
|
_showEditorByKeyboard(config) {
|
|
2141
2123
|
}
|
|
@@ -2234,11 +2216,10 @@ SlideEditingRenderController = __decorateClass$2([
|
|
|
2234
2216
|
__decorateParam$2(5, IRenderManagerService),
|
|
2235
2217
|
__decorateParam$2(6, ISlideEditorBridgeService),
|
|
2236
2218
|
__decorateParam$2(7, ISlideEditorManagerService),
|
|
2237
|
-
__decorateParam$2(8,
|
|
2238
|
-
__decorateParam$2(9,
|
|
2239
|
-
__decorateParam$2(10,
|
|
2240
|
-
__decorateParam$2(11,
|
|
2241
|
-
__decorateParam$2(12, IEditorService)
|
|
2219
|
+
__decorateParam$2(8, Inject(DocSelectionManagerService)),
|
|
2220
|
+
__decorateParam$2(9, ICommandService),
|
|
2221
|
+
__decorateParam$2(10, Inject(LocaleService)),
|
|
2222
|
+
__decorateParam$2(11, IEditorService)
|
|
2242
2223
|
], SlideEditingRenderController);
|
|
2243
2224
|
function getEditorObject(unitId, renderManagerService) {
|
|
2244
2225
|
if (unitId == null)
|
|
@@ -2291,6 +2272,7 @@ SlideRenderService = __decorateClass$1([
|
|
|
2291
2272
|
__decorateParam$1(1, IUniverInstanceService),
|
|
2292
2273
|
__decorateParam$1(2, IRenderManagerService)
|
|
2293
2274
|
], SlideRenderService);
|
|
2275
|
+
const PLUGIN_CONFIG_KEY = "slides-ui.config", defaultPluginConfig = {};
|
|
2294
2276
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
2295
2277
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2296
2278
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
@@ -2299,8 +2281,10 @@ var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnProperty
|
|
|
2299
2281
|
const SLIDE_UI_PLUGIN_NAME = "SLIDE_UI";
|
|
2300
2282
|
var _a10;
|
|
2301
2283
|
let UniverSlidesUIPlugin = (_a10 = class extends Plugin {
|
|
2302
|
-
constructor(_config =
|
|
2303
|
-
super(), this._config = _config, this._injector = _injector, this._renderManagerService = _renderManagerService, this._univerInstanceService = _univerInstanceService;
|
|
2284
|
+
constructor(_config = defaultPluginConfig, _injector, _renderManagerService, _univerInstanceService, _configService) {
|
|
2285
|
+
super(), this._config = _config, this._injector = _injector, this._renderManagerService = _renderManagerService, this._univerInstanceService = _univerInstanceService, this._configService = _configService;
|
|
2286
|
+
const { menu, ...rest } = this._config;
|
|
2287
|
+
menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
|
|
2304
2288
|
}
|
|
2305
2289
|
onStarting() {
|
|
2306
2290
|
mergeOverrideWithDependencies([
|
|
@@ -2325,9 +2309,7 @@ let UniverSlidesUIPlugin = (_a10 = class extends Plugin {
|
|
|
2325
2309
|
// [ISlideEditorManagerService, { useClass: SlideEditorManagerService }],
|
|
2326
2310
|
// SlidesUIController controller should be registered in Ready stage.
|
|
2327
2311
|
// SlidesUIController controller would add a new RenderUnit (__INTERNAL_EDITOR__DOCS_NORMAL)
|
|
2328
|
-
[SlidesUIController,
|
|
2329
|
-
useFactory: /* @__PURE__ */ __name(() => this._injector.createInstance(SlidesUIController, this._config), "useFactory")
|
|
2330
|
-
}],
|
|
2312
|
+
[SlidesUIController],
|
|
2331
2313
|
// editor service was create in renderManagerService
|
|
2332
2314
|
[SlideRenderController],
|
|
2333
2315
|
[SlidePopupMenuController]
|
|
@@ -2357,7 +2339,8 @@ let UniverSlidesUIPlugin = (_a10 = class extends Plugin {
|
|
|
2357
2339
|
UniverSlidesUIPlugin = __decorateClass([
|
|
2358
2340
|
__decorateParam(1, Inject(Injector)),
|
|
2359
2341
|
__decorateParam(2, IRenderManagerService),
|
|
2360
|
-
__decorateParam(3, IUniverInstanceService)
|
|
2342
|
+
__decorateParam(3, IUniverInstanceService),
|
|
2343
|
+
__decorateParam(4, IConfigService)
|
|
2361
2344
|
], UniverSlidesUIPlugin);
|
|
2362
2345
|
export {
|
|
2363
2346
|
ActivateSlidePageOperation,
|
|
@@ -2366,7 +2349,7 @@ export {
|
|
|
2366
2349
|
DeleteSlideElementOperation,
|
|
2367
2350
|
IMAGE_MENU_ID,
|
|
2368
2351
|
ISlideEditorBridgeService,
|
|
2369
|
-
|
|
2352
|
+
InsertSlideFloatImageCommand,
|
|
2370
2353
|
InsertSlideShapeRectangleCommand,
|
|
2371
2354
|
InsertSlideShapeRectangleOperation,
|
|
2372
2355
|
SHAPE_MENU_ID,
|
|
@@ -2379,5 +2362,6 @@ export {
|
|
|
2379
2362
|
SlideSideBar,
|
|
2380
2363
|
SlidesUIController,
|
|
2381
2364
|
UniverSlidesUIPlugin,
|
|
2382
|
-
UpdateSlideElementOperation
|
|
2365
|
+
UpdateSlideElementOperation,
|
|
2366
|
+
menuSchema
|
|
2383
2367
|
};
|