@univerjs/slides-ui 0.2.12 → 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/es/index.js CHANGED
@@ -3,15 +3,16 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
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
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, ITextSelectionRenderManager } from "@univerjs/engine-render";
7
- import { ISidebarService, useObservable, IEditorService, DISABLE_AUTO_FOCUS_KEY, TextEditor, MenuItemType, getMenuHiddenObservable, KeyCode, MetaKeys, RibbonStartGroup, BuiltInUIPart, ComponentManager, IMenuManagerService, IUIPartsService, IShortcutService, ICanvasPopupService, ILayoutService } from "@univerjs/ui";
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, DRAWING_IMAGE_ALLOW_IMAGE_LIST } from "@univerjs/drawing";
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, DocSkeletonManagerService, VIEWPORT_KEY, DOCS_COMPONENT_MAIN_LAYER_INDEX, RichTextEditingMutation, MoveSelectionOperation, MoveCursorOperation, TextSelectionManagerService, DOCS_VIEW_KEY } from "@univerjs/docs";
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
- isRelativeX: !0,
173
- isRelativeY: !0,
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
- isRelativeX: !0,
323
- isRelativeY: !0
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
- }, InsertSlideFloatImageOperation = {
448
- id: "slide.operation.insert-float-image",
449
- type: CommandType.OPERATION,
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 imageIoService = accessor.get(IImageIoService);
453
- if (!((_a11 = params == null ? void 0 : params.files) != null && _a11.length)) return !1;
454
- const imageParam = await imageIoService.saveImage(params.files[0]);
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 || ""), univerInstanceService = accessor.get(IUniverInstanceService), unitId = params.unitId, slideData = univerInstanceService.getUnit(unitId);
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 canvasview = accessor.get(CanvasView), sceneObject = canvasview.createObjectToPage(data, activePage.id, unitId);
480
- return sceneObject && canvasview.setObjectActiveByPage(sceneObject, activePage.id, unitId), !0;
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$5 = {
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$5.imageCommonPanelGrid, children: [
556
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$5.imageCommonPanelColumn, styles$5.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("image-panel.arrange.title") }) }) }),
557
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$5.imageCommonPanelRow, children: [
558
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
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$5.imageCommonPanelInline, children: [
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$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
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$5.imageCommonPanelInline, children: [
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$5.imageCommonPanelRow, children: [
578
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
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$5.imageCommonPanelInline, children: [
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$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
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$5.imageCommonPanelInline, children: [
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$5.imageCommonPanelGrid, styles$5.imageCommonPanelBorder),
693
+ className: clsx(styles$4.imageCommonPanelGrid, styles$4.imageCommonPanelBorder),
688
694
  children: [
689
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$5.imageCommonPanelColumn, styles$5.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("image-panel.transform.title") }) }) }),
690
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$5.imageCommonPanelRow, children: [
691
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
692
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: localeService.t("image-panel.transform.width") }) }),
693
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
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$5.imageCommonPanelInput,
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$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
706
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: localeService.t("image-panel.transform.height") }) }),
707
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
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$5.imageCommonPanelInput,
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$5.imageCommonPanelRow, children: [
721
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
722
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: localeService.t("image-panel.transform.x") }) }),
723
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
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$5.imageCommonPanelInput,
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$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
737
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: localeService.t("image-panel.transform.y") }) }),
738
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
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$5.imageCommonPanelInput,
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$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
752
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: localeService.t("image-panel.transform.rotate") }) }),
753
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
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$5.imageCommonPanelInput,
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$5.imageCommonPanelGrid, styles$5.imageCommonPanelBorder),
799
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$5.imageCommonPanelGrid, children: [
800
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$5.imageCommonPanelColumn, styles$5.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("slide.panel.fill.title") }) }) }),
801
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$5.imageCommonPanelColumn, styles$5.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
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$5.slidePanelColorPicker, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
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$5.uiPluginSheetsBorderPanelButton, children: [
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$5.uiPluginSheetsBorderPanelMoreIcon, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MoreDownSingle, {}) })
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$4 = {
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$4.imageCommonPanel, children: [
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$3 = {
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$3.imagePopupMenu, children: availableMenu.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(
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$3.imagePopupMenuItem,
991
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$3.imagePopupMenuItemTitle, children: localeService.t(item.label) })
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$3.btnContainer, {
1001
- [styles$3.btnContainerExpand]: visible
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", uploadFileMenu = "univer-upload-file-menu", uploadFileMenuInput = "univer-upload-file-menu-input", styles$2 = {
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);
@@ -1240,21 +1219,14 @@ function SlideImageMenuFactory(accessor) {
1240
1219
  icon: IMAGE_UPLOAD_ICON,
1241
1220
  tooltip: "slide.image.insert.title",
1242
1221
  hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SLIDE)
1243
- // disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),
1244
1222
  };
1245
1223
  }
1246
1224
  __name(SlideImageMenuFactory, "SlideImageMenuFactory");
1247
1225
  function UploadSlideFloatImageMenuFactory(_accessor) {
1248
1226
  return {
1249
- id: InsertSlideFloatImageOperation.id,
1227
+ id: InsertSlideFloatImageCommand.id,
1250
1228
  title: "slide.image.insert.float",
1251
- type: MenuItemType.SELECTOR,
1252
- label: {
1253
- name: COMPONENT_UPLOAD_FILE_MENU,
1254
- props: {
1255
- type: UploadFileType.floatImage
1256
- }
1257
- },
1229
+ type: MenuItemType.BUTTON,
1258
1230
  hidden$: getMenuHiddenObservable(_accessor, UniverInstanceType.UNIVER_SLIDE)
1259
1231
  };
1260
1232
  }
@@ -1346,7 +1318,7 @@ const menuSchema = {
1346
1318
  [IMAGE_MENU_ID]: {
1347
1319
  order: 0,
1348
1320
  menuItemFactory: SlideImageMenuFactory,
1349
- [InsertSlideFloatImageOperation.id]: {
1321
+ [InsertSlideFloatImageCommand.id]: {
1350
1322
  order: 0,
1351
1323
  menuItemFactory: UploadSlideFloatImageMenuFactory
1352
1324
  }
@@ -1375,14 +1347,14 @@ let SlidesUIController = (_a3 = class extends Disposable {
1375
1347
  }
1376
1348
  _initCustomComponents() {
1377
1349
  const componentManager = this._componentManager;
1378
- 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_UPLOAD_FILE_MENU, UploadFileMenu)), this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_IMAGE_POPUP_MENU, SlideImagePopupMenu)), this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_SIDEBAR, RectSidebar));
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));
1379
1351
  }
1380
1352
  _initCommands() {
1381
1353
  [
1382
1354
  AppendSlideOperation,
1383
1355
  ActivateSlidePageOperation,
1384
1356
  SetSlidePageThumbOperation,
1385
- InsertSlideFloatImageOperation,
1357
+ InsertSlideFloatImageCommand,
1386
1358
  SlideAddTextOperation,
1387
1359
  SlideAddTextCommand,
1388
1360
  InsertSlideShapeRectangleOperation,
@@ -1895,7 +1867,7 @@ var CursorChange = /* @__PURE__ */ ((_CursorChange) => (_CursorChange[_CursorCha
1895
1867
  const HIDDEN_EDITOR_POSITION = -1e3, EDITOR_INPUT_SELF_EXTEND_GAP = 5, EDITOR_BORDER_SIZE = 2;
1896
1868
  var _a8;
1897
1869
  let SlideEditingRenderController = (_a8 = class extends Disposable {
1898
- constructor(_renderContext, _layoutService, _undoRedoService, _contextService, _instanceSrv, _renderManagerService, _editorBridgeService, _cellEditorManagerService, _textSelectionRenderManager, _textSelectionManagerService, _commandService, _localService, _editorService) {
1870
+ constructor(_renderContext, _layoutService, _undoRedoService, _contextService, _instanceSrv, _renderManagerService, _editorBridgeService, _cellEditorManagerService, _textSelectionManagerService, _commandService, _localService, _editorService) {
1899
1871
  super();
1900
1872
  /**
1901
1873
  * It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
@@ -1904,7 +1876,7 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
1904
1876
  /** If the corresponding unit is active and prepared for editing. */
1905
1877
  __publicField(this, "_isUnitEditing", !1);
1906
1878
  __publicField(this, "_d");
1907
- 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._textSelectionRenderManager = _textSelectionRenderManager, this._textSelectionManagerService = _textSelectionManagerService, this._commandService = _commandService, this._localService = _localService, this._editorService = _editorService, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SLIDE).subscribe((slideDataModel) => {
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) => {
1908
1880
  slideDataModel && slideDataModel.getUnitId() === this._renderContext.unitId ? this._d = this._init() : (this._disposeCurrent(), this._isUnitEditing && (this._handleEditorInvisible({
1909
1881
  visible: !1,
1910
1882
  eventType: DeviceInputEventType.Keyboard,
@@ -1946,7 +1918,9 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
1946
1918
  }
1947
1919
  _initialCursorSync(d) {
1948
1920
  d.add(this._cellEditorManagerService.focus$.pipe(filter((f2) => !!f2)).subscribe(() => {
1949
- this._textSelectionRenderManager.sync();
1921
+ var _a11;
1922
+ const docSelectionRenderManager = (_a11 = this._renderManagerService.getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_DOC)) == null ? void 0 : _a11.with(DocSelectionRenderService);
1923
+ docSelectionRenderManager && docSelectionRenderManager.sync();
1950
1924
  }));
1951
1925
  }
1952
1926
  /**
@@ -1955,6 +1929,7 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
1955
1929
  */
1956
1930
  _subscribeToCurrentCell(d) {
1957
1931
  d.add(this._editorBridgeService.currentEditRectState$.subscribe((editCellState) => {
1932
+ var _a11;
1958
1933
  if (editCellState == null || this._contextService.getContextValue(FOCUSING_EDITOR_STANDALONE) || this._contextService.getContextValue(FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE))
1959
1934
  return;
1960
1935
  const {
@@ -1966,7 +1941,9 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
1966
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([{
1967
1942
  startOffset: 0,
1968
1943
  endOffset: 0
1969
- }]), this._textSelectionRenderManager.activate(HIDDEN_EDITOR_POSITION, HIDDEN_EDITOR_POSITION);
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);
1970
1947
  }));
1971
1948
  }
1972
1949
  /**
@@ -2141,8 +2118,6 @@ let SlideEditingRenderController = (_a8 = class extends Disposable {
2141
2118
  * @param d DisposableCollection
2142
2119
  */
2143
2120
  _initialKeyboardListener(d) {
2144
- d.add(this._textSelectionRenderManager.onInputBefore$.subscribe((config) => {
2145
- }));
2146
2121
  }
2147
2122
  _showEditorByKeyboard(config) {
2148
2123
  }
@@ -2241,11 +2216,10 @@ SlideEditingRenderController = __decorateClass$2([
2241
2216
  __decorateParam$2(5, IRenderManagerService),
2242
2217
  __decorateParam$2(6, ISlideEditorBridgeService),
2243
2218
  __decorateParam$2(7, ISlideEditorManagerService),
2244
- __decorateParam$2(8, ITextSelectionRenderManager),
2245
- __decorateParam$2(9, Inject(TextSelectionManagerService)),
2246
- __decorateParam$2(10, ICommandService),
2247
- __decorateParam$2(11, Inject(LocaleService)),
2248
- __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)
2249
2223
  ], SlideEditingRenderController);
2250
2224
  function getEditorObject(unitId, renderManagerService) {
2251
2225
  if (unitId == null)
@@ -2375,7 +2349,7 @@ export {
2375
2349
  DeleteSlideElementOperation,
2376
2350
  IMAGE_MENU_ID,
2377
2351
  ISlideEditorBridgeService,
2378
- InsertSlideFloatImageOperation,
2352
+ InsertSlideFloatImageCommand,
2379
2353
  InsertSlideShapeRectangleCommand,
2380
2354
  InsertSlideShapeRectangleOperation,
2381
2355
  SHAPE_MENU_ID,
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-slide-panel-color-picker{box-sizing:border-box;margin:0;padding:var(--padding-base);font-size:var(--font-size-xs);list-style:none;background-color:rgb(var(--bg-color-secondary));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-lg);outline:none;box-shadow:var(--box-shadow-base)}.univer-image-common-panel{text-align:center;padding:var(--padding-sm);font-size:var(--font-size-sm)}.univer-image-common-panel-grid{position:relative;width:100%}.univer-image-common-panel-border{border-top:1px solid rgb(var(--border-color));margin-top:20px}.univer-image-common-panel-title{color:rgb(var(--text-color-secondary));text-align:left}.univer-image-common-panel-subtitle{color:rgb(var(--text-color-primary));text-align:left}.univer-image-common-panel-row{position:relative;display:flex;justify-content:flex-start;align-items:flex-start;height:100%;margin-top:10px}.univer-image-common-panel-row-vertical{justify-content:center;align-items:center;height:36px}.univer-image-common-panel-column{width:100%}.univer-image-common-panel-column-center{display:flex;justify-content:center;align-items:center}.univer-image-common-panel-inline{display:flex;align-items:center;gap:var(--margin-xxs)}.univer-image-common-panel-span2{width:50%}.univer-image-common-panel-span3{width:33.33333333%}.univer-image-common-panel-input{width:90%}.univer-image-popup-menu{display:grid;gap:var(--margin-xxs);align-items:center;box-sizing:border-box;margin-top:0;margin-bottom:0;padding:var(--padding-sm);font-size:var(--font-size-base);background-color:rgb(var(--bg-color-secondary));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-lg);box-shadow:var(--box-shadow-lg)}.univer-image-popup-menu li{list-style:none}.univer-image-popup-menu-item{cursor:pointer;position:relative;display:flex;align-items:center;box-sizing:border-box;height:28px;font-size:var(--font-size-base);font-style:normal;line-height:20px;text-align:left;border-radius:4px;border-radius:var(--border-radius-base);transition:background .2s}.univer-image-popup-menu-item:hover{background-color:rgb(var(--bg-color-hover))}.univer-image-popup-menu-item-icon{position:absolute;top:50%;left:var(--padding-xs);transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.univer-image-popup-menu-item-title{padding:var(--padding-xs) var(--padding-xs) var(--padding-xs) 0;vertical-align:middle}.univer-image-popup-menu-item-hide{color:rgb(var(--text-color-secondary))}.univer-image-popup-menu-item:hover{background:rgb(var(--grey-100))}.univer-btn-container{display:flex;align-items:center;justify-content:center;padding:3px;background:#fff;border:1px solid rgb(var(--grey-200, #e5e5e5));border-radius:4px}.univer-btn-container:hover,.univer-btn-container.univer-btn-container-expand{background:rgb(var(--grey-100, #f5f5f5))}.univer-upload-file-menu{position:absolute;height:100%;width:100%;text-align:center}.univer-upload-file-menu-input{display:none}.univer-slide-editor-container{position:absolute;z-index:10;top:200px;left:100px;display:flex;width:100px;height:50px;border:1px solid rgb(var(--primary-color));box-shadow:none;box-sizing:border-box}.univer-slide-editor-container .univer-editor-input{position:relative;display:flex;width:100%;height:100%;background:#aeaeae33}.univer-slide-editor-container .univer-editor-input canvas{position:absolute;top:-1px!important;left:-1px!important}.univer-slide-bar{display:flex;flex-direction:column;height:100%;background:#f5f7f9;border-right:1px solid #eaecf0;width:260px;overflow-x:hidden;overflow-y:auto}.univer-slide-bar .univer-slide-bar-content{padding:0 15px}.univer-slide-bar .univer-slide-bar-content-header{padding-top:var(--padding-lg);display:flex;justify-content:center}.univer-slide-bar .univer-slide-bar-content-header a{width:212px;padding:var(--padding-xs) 0;font-size:var(--font-size-sm);background:rgb(var(--bg-color-secondary));text-align:center;border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-base);display:block;transition:all .25s;cursor:pointer}.univer-slide-bar .univer-slide-bar-content-header a:hover{background:rgb(var(--bg-color-hover))}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item{display:flex;margin:var(--margin-base) 0}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item span{width:15px;font-size:12px}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item .univer-slide-bar-box{position:relative;width:212px;height:120px;margin-left:5px;background:#fff;border:2px solid #c0c0c0}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item .univer-slide-bar-box:hover{border:2px solid #d66a2b}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item-active span{color:#d66a2b}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item-active .univer-slide-bar-box{border:2px solid #d66a2b}.univer-slide-bar .univer-slide-add-button{padding:10px 0;text-align:center}.univer-slide-bar .univer-slide-add-button button{width:45px;height:auto;font-size:24px;line-height:1;border-radius:10px}
1
+ .univer-slide-panel-color-picker{box-sizing:border-box;margin:0;padding:var(--padding-base);font-size:var(--font-size-xs);list-style:none;background-color:rgb(var(--bg-color-secondary));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-lg);outline:none;box-shadow:var(--box-shadow-base)}.univer-image-common-panel{text-align:center;padding:var(--padding-sm);font-size:var(--font-size-sm)}.univer-image-common-panel-grid{position:relative;width:100%}.univer-image-common-panel-border{border-top:1px solid rgb(var(--border-color));margin-top:20px}.univer-image-common-panel-title{color:rgb(var(--text-color-secondary));text-align:left}.univer-image-common-panel-subtitle{color:rgb(var(--text-color-primary));text-align:left}.univer-image-common-panel-row{position:relative;display:flex;justify-content:flex-start;align-items:flex-start;height:100%;margin-top:10px}.univer-image-common-panel-row-vertical{justify-content:center;align-items:center;height:36px}.univer-image-common-panel-column{width:100%}.univer-image-common-panel-column-center{display:flex;justify-content:center;align-items:center}.univer-image-common-panel-inline{display:flex;align-items:center;gap:var(--margin-xxs)}.univer-image-common-panel-span2{width:50%}.univer-image-common-panel-span3{width:33.33333333%}.univer-image-common-panel-input{width:90%}.univer-image-popup-menu{display:grid;gap:var(--margin-xxs);align-items:center;box-sizing:border-box;margin-top:0;margin-bottom:0;padding:var(--padding-sm);font-size:var(--font-size-base);background-color:rgb(var(--bg-color-secondary));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-lg);box-shadow:var(--box-shadow-lg)}.univer-image-popup-menu li{list-style:none}.univer-image-popup-menu-item{cursor:pointer;position:relative;display:flex;align-items:center;box-sizing:border-box;height:28px;font-size:var(--font-size-base);font-style:normal;line-height:20px;text-align:left;border-radius:4px;border-radius:var(--border-radius-base);transition:background .2s}.univer-image-popup-menu-item:hover{background-color:rgb(var(--bg-color-hover))}.univer-image-popup-menu-item-icon{position:absolute;top:50%;left:var(--padding-xs);transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.univer-image-popup-menu-item-title{padding:var(--padding-xs) var(--padding-xs) var(--padding-xs) 0;vertical-align:middle}.univer-image-popup-menu-item-hide{color:rgb(var(--text-color-secondary))}.univer-image-popup-menu-item:hover{background:rgb(var(--grey-100))}.univer-btn-container{display:flex;align-items:center;justify-content:center;padding:3px;background:#fff;border:1px solid rgb(var(--grey-200, #e5e5e5));border-radius:4px}.univer-btn-container:hover,.univer-btn-container.univer-btn-container-expand{background:rgb(var(--grey-100, #f5f5f5))}.univer-slide-editor-container{position:absolute;z-index:10;top:200px;left:100px;display:flex;width:100px;height:50px;border:1px solid rgb(var(--primary-color));box-shadow:none;box-sizing:border-box}.univer-slide-editor-container .univer-editor-input{position:relative;display:flex;width:100%;height:100%;background:#aeaeae33}.univer-slide-editor-container .univer-editor-input canvas{position:absolute;top:-1px!important;left:-1px!important}.univer-slide-bar{display:flex;flex-direction:column;height:100%;background:#f5f7f9;border-right:1px solid #eaecf0;width:260px;overflow-x:hidden;overflow-y:auto}.univer-slide-bar .univer-slide-bar-content{padding:0 15px}.univer-slide-bar .univer-slide-bar-content-header{padding-top:var(--padding-lg);display:flex;justify-content:center}.univer-slide-bar .univer-slide-bar-content-header a{width:212px;padding:var(--padding-xs) 0;font-size:var(--font-size-sm);background:rgb(var(--bg-color-secondary));text-align:center;border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-base);display:block;transition:all .25s;cursor:pointer}.univer-slide-bar .univer-slide-bar-content-header a:hover{background:rgb(var(--bg-color-hover))}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item{display:flex;margin:var(--margin-base) 0}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item span{width:15px;font-size:12px}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item .univer-slide-bar-box{position:relative;width:212px;height:120px;margin-left:5px;background:#fff;border:2px solid #c0c0c0}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item .univer-slide-bar-box:hover{border:2px solid #d66a2b}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item-active span{color:#d66a2b}.univer-slide-bar .univer-slide-bar-content .univer-slide-bar-item-active .univer-slide-bar-box{border:2px solid #d66a2b}.univer-slide-bar .univer-slide-add-button{padding:10px 0;text-align:center}.univer-slide-bar .univer-slide-add-button button{width:45px;height:auto;font-size:24px;line-height:1;border-radius:10px}
@@ -1,6 +1,2 @@
1
- import { ICommand, Nullable } from '@univerjs/core';
2
- export interface IInsertImageOperationParams {
3
- files: Nullable<File[]>;
4
- unitId: string;
5
- }
6
- export declare const InsertSlideFloatImageOperation: ICommand<IInsertImageOperationParams>;
1
+ import { ICommand } from '@univerjs/core';
2
+ export declare const InsertSlideFloatImageCommand: ICommand<{}>;
@@ -1,4 +1,4 @@
1
- import { IShortcutItem, KeyCode } from '@univerjs/ui';
1
+ import { KeyCode, IShortcutItem } from '@univerjs/ui';
2
2
  export declare const ARROW_SELECTION_KEYCODE_LIST: KeyCode[];
3
3
  export declare const MOVE_SELECTION_KEYCODE_LIST: KeyCode[];
4
4
  export declare function generateArrowSelectionShortCutItem(): IShortcutItem<object>[];
@@ -1,7 +1,8 @@
1
- import { Nullable, UnitModel, Disposable, ICommandService, IContextService, IUndoRedoService, IUniverInstanceService, LocaleService } from '@univerjs/core';
2
- import { IDocObjectParam, TextSelectionManagerService } from '@univerjs/docs';
3
- import { IRenderContext, IRenderModule, IRenderManagerService, ITextSelectionRenderManager } from '@univerjs/engine-render';
1
+ import { Disposable, ICommandService, IContextService, IUndoRedoService, IUniverInstanceService, LocaleService, Nullable, UnitModel } from '@univerjs/core';
2
+ import { DocSelectionManagerService } from '@univerjs/docs';
3
+ import { IRenderManagerService, IRenderContext, IRenderModule } from '@univerjs/engine-render';
4
4
  import { IEditorService, ILayoutService } from '@univerjs/ui';
5
+ import { IDocObjectParam } from '@univerjs/docs-ui';
5
6
  import { ISlideEditorBridgeService } from '../services/slide-editor-bridge.service';
6
7
  import { ISlideEditorManagerService } from '../services/slide-editor-manager.service';
7
8
  export declare class SlideEditingRenderController extends Disposable implements IRenderModule {
@@ -13,7 +14,6 @@ export declare class SlideEditingRenderController extends Disposable implements
13
14
  private readonly _renderManagerService;
14
15
  private readonly _editorBridgeService;
15
16
  private readonly _cellEditorManagerService;
16
- private readonly _textSelectionRenderManager;
17
17
  private readonly _textSelectionManagerService;
18
18
  private readonly _commandService;
19
19
  protected readonly _localService: LocaleService;
@@ -25,7 +25,7 @@ export declare class SlideEditingRenderController extends Disposable implements
25
25
  /** If the corresponding unit is active and prepared for editing. */
26
26
  private _isUnitEditing;
27
27
  private _d;
28
- constructor(_renderContext: IRenderContext<UnitModel>, _layoutService: ILayoutService, _undoRedoService: IUndoRedoService, _contextService: IContextService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _editorBridgeService: ISlideEditorBridgeService, _cellEditorManagerService: ISlideEditorManagerService, _textSelectionRenderManager: ITextSelectionRenderManager, _textSelectionManagerService: TextSelectionManagerService, _commandService: ICommandService, _localService: LocaleService, _editorService: IEditorService);
28
+ constructor(_renderContext: IRenderContext<UnitModel>, _layoutService: ILayoutService, _undoRedoService: IUndoRedoService, _contextService: IContextService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _editorBridgeService: ISlideEditorBridgeService, _cellEditorManagerService: ISlideEditorManagerService, _textSelectionManagerService: DocSelectionManagerService, _commandService: ICommandService, _localService: LocaleService, _editorService: IEditorService);
29
29
  dispose(): void;
30
30
  private _disposeCurrent;
31
31
  private _init;
@@ -1,5 +1,5 @@
1
- import { IPageElement, ISlidePage, Nullable, UnitModel, Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
2
- import { BaseObject, IRenderContext, IRenderModule, IRenderManagerService, Scene } from '@univerjs/engine-render';
1
+ import { Injector, IUniverInstanceService, RxDisposable, IPageElement, ISlidePage, Nullable, UnitModel } from '@univerjs/core';
2
+ import { IRenderManagerService, Scene, BaseObject, IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { PageID } from '../type';
4
4
  export declare class SlideRenderController extends RxDisposable implements IRenderModule {
5
5
  private readonly _renderContext;
@@ -23,7 +23,7 @@ export { SHAPE_MENU_ID } from './controllers/shape.menu';
23
23
  export { menuSchema } from './controllers/menu.schema';
24
24
  export { ActivateSlidePageOperation } from './commands/operations/activate.operation';
25
25
  export { DeleteSlideElementOperation } from './commands/operations/delete-element.operation';
26
- export { InsertSlideFloatImageOperation } from './commands/operations/insert-image.operation';
26
+ export { InsertSlideFloatImageCommand } from './commands/operations/insert-image.operation';
27
27
  export { InsertSlideShapeRectangleOperation, InsertSlideShapeRectangleCommand } from './commands/operations/insert-shape.operation';
28
28
  export { SetSlidePageThumbOperation } from './commands/operations/set-thumb.operation';
29
29
  export { AppendSlideOperation } from './commands/operations/append-slide.operation';