@univerjs/slides-ui 0.25.0 → 1.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/lib/cjs/index.js +214 -181
  2. package/lib/cjs/locale/ru-RU.js +2 -21
  3. package/lib/cjs/locale/vi-VN.js +2 -21
  4. package/lib/cjs/locale/zh-HK.js +2 -21
  5. package/lib/cjs/locale/zh-TW.js +2 -21
  6. package/lib/es/index.js +218 -183
  7. package/lib/es/locale/ru-RU.js +2 -21
  8. package/lib/es/locale/vi-VN.js +2 -21
  9. package/lib/es/locale/zh-HK.js +2 -21
  10. package/lib/es/locale/zh-TW.js +2 -21
  11. package/lib/index.css +0 -4
  12. package/lib/index.js +218 -183
  13. package/lib/locale/ru-RU.js +2 -21
  14. package/lib/locale/vi-VN.js +2 -21
  15. package/lib/locale/zh-HK.js +2 -21
  16. package/lib/locale/zh-TW.js +2 -21
  17. package/lib/types/controllers/components.controller.d.ts +24 -0
  18. package/lib/types/controllers/{slide-ui.controller.d.ts → ui.controller.d.ts} +2 -4
  19. package/lib/types/index.d.ts +1 -3
  20. package/lib/types/locale/ru-RU.d.ts +2 -2
  21. package/lib/types/locale/types.d.ts +18 -0
  22. package/lib/types/locale/vi-VN.d.ts +2 -2
  23. package/lib/types/locale/zh-HK.d.ts +2 -2
  24. package/lib/types/locale/zh-TW.d.ts +2 -2
  25. package/lib/types/menu/image.menu.d.ts +3 -2
  26. package/lib/types/menu/shape.menu.d.ts +4 -3
  27. package/lib/types/menu/text.menu.d.ts +2 -1
  28. package/lib/types/views/editor-container/EditorContainer.d.ts +1 -1
  29. package/lib/types/{components → views}/image-popup-menu/ImagePopupMenu.d.ts +1 -1
  30. package/lib/types/{components → views}/panels/ArrangePanel.d.ts +1 -1
  31. package/lib/types/{components → views}/panels/FillPanel.d.ts +1 -1
  32. package/lib/types/{components → views}/panels/TransformPanel.d.ts +1 -1
  33. package/lib/types/{components → views}/sidebar/Sidebar.d.ts +1 -1
  34. package/lib/types/{components → views}/slide-bar/SlideBar.d.ts +1 -1
  35. package/lib/umd/index.js +1 -1
  36. package/package.json +12 -12
  37. /package/lib/types/{model → models}/info-bar-model.d.ts +0 -0
  38. /package/lib/types/{components → views}/image-popup-menu/component-name.d.ts +0 -0
package/lib/cjs/index.js CHANGED
@@ -12,7 +12,7 @@ let _univerjs_docs_ui = require("@univerjs/docs-ui");
12
12
  let rxjs = require("rxjs");
13
13
  let _univerjs_docs = require("@univerjs/docs");
14
14
 
15
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
15
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
16
16
  function _typeof(o) {
17
17
  "@babel/helpers - typeof";
18
18
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -23,7 +23,7 @@ function _typeof(o) {
23
23
  }
24
24
 
25
25
  //#endregion
26
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
26
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
27
27
  function toPrimitive(t, r) {
28
28
  if ("object" != _typeof(t) || !t) return t;
29
29
  var e = t[Symbol.toPrimitive];
@@ -36,14 +36,14 @@ function toPrimitive(t, r) {
36
36
  }
37
37
 
38
38
  //#endregion
39
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
39
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
40
40
  function toPropertyKey(t) {
41
41
  var i = toPrimitive(t, "string");
42
42
  return "symbol" == _typeof(i) ? i : i + "";
43
43
  }
44
44
 
45
45
  //#endregion
46
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
46
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
47
47
  function _defineProperty(e, r, t) {
48
48
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
49
49
  value: t,
@@ -54,7 +54,7 @@ function _defineProperty(e, r, t) {
54
54
  }
55
55
 
56
56
  //#endregion
57
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
57
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
58
58
  function __decorateParam(paramIndex, decorator) {
59
59
  return function(target, key) {
60
60
  decorator(target, key, paramIndex);
@@ -62,7 +62,7 @@ function __decorateParam(paramIndex, decorator) {
62
62
  }
63
63
 
64
64
  //#endregion
65
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
65
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
66
66
  function __decorate(decorators, target, key, desc) {
67
67
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
68
68
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -525,7 +525,7 @@ const UpdateSlideElementOperation = {
525
525
  };
526
526
 
527
527
  //#endregion
528
- //#region src/components/panels/ArrangePanel.tsx
528
+ //#region src/views/panels/ArrangePanel.tsx
529
529
  function ArrangePanel$1(props) {
530
530
  const { pageId, unitId } = props;
531
531
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
@@ -622,7 +622,7 @@ function ArrangePanel$1(props) {
622
622
  }
623
623
 
624
624
  //#endregion
625
- //#region src/components/panels/FillPanel.tsx
625
+ //#region src/views/panels/FillPanel.tsx
626
626
  /**
627
627
  *
628
628
  * @param props
@@ -688,7 +688,7 @@ function ArrangePanel(props) {
688
688
  }
689
689
 
690
690
  //#endregion
691
- //#region src/components/panels/TransformPanel.tsx
691
+ //#region src/views/panels/TransformPanel.tsx
692
692
  function TransformPanel(props) {
693
693
  const { pageId, unitId } = props;
694
694
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
@@ -837,7 +837,7 @@ function TransformPanel(props) {
837
837
  }
838
838
 
839
839
  //#endregion
840
- //#region src/components/sidebar/Sidebar.tsx
840
+ //#region src/views/sidebar/Sidebar.tsx
841
841
  const COMPONENT_SLIDE_SIDEBAR = "COMPONENT_SLIDE_SIDEBAR";
842
842
  function RectSidebar() {
843
843
  var _currentSlide$getActi, _univerInstanceServic, _page$scene;
@@ -1059,84 +1059,6 @@ const SetSlidePageThumbOperation = {
1059
1059
  }
1060
1060
  };
1061
1061
 
1062
- //#endregion
1063
- //#region src/components/slide-bar/SlideBar.tsx
1064
- /**
1065
- * This components works as the root component of the left Sidebar of Slide.
1066
- */
1067
- function SlideSideBar() {
1068
- var _currentSlide$getActi, _currentSlide$getActi2;
1069
- const univerInstanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
1070
- const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
1071
- const renderManagerService = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService);
1072
- const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
1073
- const slideBarRef = (0, react.useRef)(null);
1074
- const currentSlide = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SLIDE);
1075
- const pages = currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getPages();
1076
- const pageOrder = currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getPageOrder();
1077
- if (!pages || !pageOrder) return null;
1078
- const slideList = pageOrder.map((id) => pages[id]);
1079
- const [activatePageId, setActivatePageId] = (0, react.useState)((_currentSlide$getActi = currentSlide === null || currentSlide === void 0 || (_currentSlide$getActi2 = currentSlide.getActivePage()) === null || _currentSlide$getActi2 === void 0 ? void 0 : _currentSlide$getActi2.id) !== null && _currentSlide$getActi !== void 0 ? _currentSlide$getActi : null);
1080
- const divRefs = (0, react.useMemo)(() => slideList.map(() => (0, react.createRef)()), [slideList]);
1081
- (0, react.useEffect)(() => {
1082
- const subscriber = currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.activePage$.subscribe((page) => {
1083
- var _page$id;
1084
- const id = (_page$id = page === null || page === void 0 ? void 0 : page.id) !== null && _page$id !== void 0 ? _page$id : null;
1085
- id && setActivatePageId(id);
1086
- });
1087
- return () => {
1088
- subscriber === null || subscriber === void 0 || subscriber.unsubscribe();
1089
- };
1090
- }, []);
1091
- (0, react.useEffect)(() => {
1092
- divRefs.forEach((ref, index) => {
1093
- if (ref.current) {
1094
- var _renderManagerService;
1095
- const slide = slideList[index];
1096
- (_renderManagerService = renderManagerService.getRenderById(slide.id)) === null || _renderManagerService === void 0 || _renderManagerService.engine.setContainer(ref.current);
1097
- }
1098
- });
1099
- if (divRefs.length > 0) commandService.syncExecuteCommand(SetSlidePageThumbOperation.id, { unitId: currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getUnitId() });
1100
- }, [
1101
- divRefs,
1102
- slideList,
1103
- renderManagerService,
1104
- commandService,
1105
- currentSlide
1106
- ]);
1107
- const activatePage = (0, react.useCallback)((page) => {
1108
- commandService.syncExecuteCommand(ActivateSlidePageOperation.id, {
1109
- id: page,
1110
- unitId: currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getUnitId()
1111
- });
1112
- }, [commandService, currentSlide]);
1113
- const handleAppendSlide = (0, react.useCallback)(() => {
1114
- commandService.syncExecuteCommand(AppendSlideOperation.id, { unitId: currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getUnitId() });
1115
- }, [commandService, currentSlide]);
1116
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
1117
- ref: slideBarRef,
1118
- className: (0, _univerjs_design.clsx)("univer-flex univer-h-full univer-w-64 univer-flex-col univer-overflow-y-auto univer-overflow-x-hidden", _univerjs_design.scrollbarClassName),
1119
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1120
- className: "univer-px-4",
1121
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
1122
- className: "univer-flex univer-justify-center univer-pt-4",
1123
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1124
- className: (0, _univerjs_design.clsx)("univer-box-border univer-block univer-h-8 univer-w-full univer-cursor-pointer univer-rounded-md univer-bg-white univer-text-center univer-text-sm univer-leading-8 univer-transition-colors", _univerjs_design.borderClassName),
1125
- onClick: handleAppendSlide,
1126
- children: localeService.t("slides-ui.append")
1127
- })
1128
- }), slideList.map((item, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1129
- className: (0, _univerjs_design.clsx)("univer-my-4 univer-flex univer-gap-2", { "[&>div]:univer-border-primary-600 [&>span]:univer-text-primary-600": item.id === activatePageId }),
1130
- onClick: () => activatePage(item.id),
1131
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: index + 1 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1132
- ref: divRefs[index],
1133
- className: (0, _univerjs_design.clsx)("univer-relative univer-box-border univer-h-32 univer-w-52 univer-bg-white hover:univer-border-primary-600", _univerjs_design.borderClassName)
1134
- })]
1135
- }, item.id))]
1136
- })
1137
- });
1138
- }
1139
-
1140
1062
  //#endregion
1141
1063
  //#region src/const.ts
1142
1064
  /**
@@ -1164,79 +1086,6 @@ const SetTextEditArrowOperation = {
1164
1086
  handler: () => true
1165
1087
  };
1166
1088
 
1167
- //#endregion
1168
- //#region src/components/image-popup-menu/component-name.ts
1169
- /**
1170
- * Copyright 2023-present DreamNum Co., Ltd.
1171
- *
1172
- * Licensed under the Apache License, Version 2.0 (the "License");
1173
- * you may not use this file except in compliance with the License.
1174
- * You may obtain a copy of the License at
1175
- *
1176
- * http://www.apache.org/licenses/LICENSE-2.0
1177
- *
1178
- * Unless required by applicable law or agreed to in writing, software
1179
- * distributed under the License is distributed on an "AS IS" BASIS,
1180
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1181
- * See the License for the specific language governing permissions and
1182
- * limitations under the License.
1183
- */
1184
- const COMPONENT_SLIDE_IMAGE_POPUP_MENU = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
1185
-
1186
- //#endregion
1187
- //#region src/components/image-popup-menu/ImagePopupMenu.tsx
1188
- function SlideImagePopupMenu(props) {
1189
- var _props$popup;
1190
- const menuItems = (_props$popup = props.popup) === null || _props$popup === void 0 || (_props$popup = _props$popup.extraProps) === null || _props$popup === void 0 ? void 0 : _props$popup.menuItems;
1191
- if (!menuItems) return null;
1192
- const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
1193
- const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
1194
- const [visible, setVisible] = (0, react.useState)(false);
1195
- const [isHovered, setHovered] = (0, react.useState)(false);
1196
- const handleMouseEnter = () => {
1197
- setHovered(true);
1198
- };
1199
- const handleMouseLeave = () => {
1200
- setHovered(false);
1201
- };
1202
- const onVisibleChange = (visible) => {
1203
- setVisible(visible);
1204
- };
1205
- const handleClick = (item) => {
1206
- commandService.executeCommand(item.commandId, item.commandParams);
1207
- setVisible(false);
1208
- };
1209
- const showMore = visible || isHovered;
1210
- const availableMenu = menuItems.filter((item) => !item.disable);
1211
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1212
- onMouseEnter: handleMouseEnter,
1213
- onMouseLeave: handleMouseLeave,
1214
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Dropdown, {
1215
- align: "start",
1216
- overlay: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
1217
- className: (0, _univerjs_design.clsx)("univer-m-0 univer-box-border univer-grid univer-list-none univer-items-center univer-gap-1 univer-rounded-lg univer-bg-white univer-p-1.5 univer-text-sm univer-shadow-lg", _univerjs_design.borderClassName),
1218
- children: availableMenu.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
1219
- className: "univer-relative univer-box-border univer-flex univer-h-8 univer-cursor-pointer univer-items-center univer-rounded univer-text-sm univer-transition-colors hover:univer-bg-gray-100",
1220
- onClick: () => handleClick(item),
1221
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1222
- className: "univer-px-2 univer-py-1.5 univer-align-middle",
1223
- children: localeService.t(item.label)
1224
- })
1225
- }, item.index))
1226
- }),
1227
- open: visible,
1228
- onOpenChange: onVisibleChange,
1229
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1230
- className: (0, _univerjs_design.clsx)("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800", _univerjs_design.borderClassName, {
1231
- "univer-bg-gray-100 dark:!univer-bg-gray-800": visible,
1232
- "univer-bg-white dark:!univer-bg-gray-900": !visible
1233
- }),
1234
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.AutofillDoubleIcon, { className: "univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-white" }), showMore && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, { className: "dark:!univer-text-white" })]
1235
- })
1236
- })
1237
- });
1238
- }
1239
-
1240
1089
  //#endregion
1241
1090
  //#region src/menu/image.menu.ts
1242
1091
  const SLIDES_IMAGE_MENU_ID = "slide.menu.image";
@@ -1390,7 +1239,7 @@ function SlideEditorContainer() {
1390
1239
  const editorService = (0, _univerjs_ui.useDependency)(_univerjs_docs_ui.IEditorService);
1391
1240
  const contextService = (0, _univerjs_ui.useDependency)(_univerjs_core.IContextService);
1392
1241
  const disableAutoFocus = (0, _univerjs_ui.useObservable)(() => contextService.subscribeContextValue$(_univerjs_ui.DISABLE_AUTO_FOCUS_KEY), false, void 0, [contextService, _univerjs_ui.DISABLE_AUTO_FOCUS_KEY]);
1393
- `${_univerjs_core.DEFAULT_EMPTY_DOCUMENT_VALUE}`, _univerjs_core.DocumentFlavor.UNSPECIFIED;
1242
+ `${_univerjs_core.DEFAULT_EMPTY_DOCUMENT_VALUE}`, (0, _univerjs_core.createParagraphId)(/* @__PURE__ */ new Set()), _univerjs_core.DocumentFlavor.UNSPECIFIED;
1394
1243
  (0, react.useEffect)(() => {
1395
1244
  slideEditorManagerService.state$.subscribe((param) => {
1396
1245
  if (param == null) return;
@@ -1429,6 +1278,84 @@ function SlideEditorContainer() {
1429
1278
  });
1430
1279
  }
1431
1280
 
1281
+ //#endregion
1282
+ //#region src/views/slide-bar/SlideBar.tsx
1283
+ /**
1284
+ * This components works as the root component of the left Sidebar of Slide.
1285
+ */
1286
+ function SlideSideBar() {
1287
+ var _currentSlide$getActi, _currentSlide$getActi2;
1288
+ const univerInstanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
1289
+ const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
1290
+ const renderManagerService = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService);
1291
+ const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
1292
+ const slideBarRef = (0, react.useRef)(null);
1293
+ const currentSlide = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SLIDE);
1294
+ const pages = currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getPages();
1295
+ const pageOrder = currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getPageOrder();
1296
+ if (!pages || !pageOrder) return null;
1297
+ const slideList = pageOrder.map((id) => pages[id]);
1298
+ const [activatePageId, setActivatePageId] = (0, react.useState)((_currentSlide$getActi = currentSlide === null || currentSlide === void 0 || (_currentSlide$getActi2 = currentSlide.getActivePage()) === null || _currentSlide$getActi2 === void 0 ? void 0 : _currentSlide$getActi2.id) !== null && _currentSlide$getActi !== void 0 ? _currentSlide$getActi : null);
1299
+ const divRefs = (0, react.useMemo)(() => slideList.map(() => (0, react.createRef)()), [slideList]);
1300
+ (0, react.useEffect)(() => {
1301
+ const subscriber = currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.activePage$.subscribe((page) => {
1302
+ var _page$id;
1303
+ const id = (_page$id = page === null || page === void 0 ? void 0 : page.id) !== null && _page$id !== void 0 ? _page$id : null;
1304
+ id && setActivatePageId(id);
1305
+ });
1306
+ return () => {
1307
+ subscriber === null || subscriber === void 0 || subscriber.unsubscribe();
1308
+ };
1309
+ }, []);
1310
+ (0, react.useEffect)(() => {
1311
+ divRefs.forEach((ref, index) => {
1312
+ if (ref.current) {
1313
+ var _renderManagerService;
1314
+ const slide = slideList[index];
1315
+ (_renderManagerService = renderManagerService.getRenderById(slide.id)) === null || _renderManagerService === void 0 || _renderManagerService.engine.setContainer(ref.current);
1316
+ }
1317
+ });
1318
+ if (divRefs.length > 0) commandService.syncExecuteCommand(SetSlidePageThumbOperation.id, { unitId: currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getUnitId() });
1319
+ }, [
1320
+ divRefs,
1321
+ slideList,
1322
+ renderManagerService,
1323
+ commandService,
1324
+ currentSlide
1325
+ ]);
1326
+ const activatePage = (0, react.useCallback)((page) => {
1327
+ commandService.syncExecuteCommand(ActivateSlidePageOperation.id, {
1328
+ id: page,
1329
+ unitId: currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getUnitId()
1330
+ });
1331
+ }, [commandService, currentSlide]);
1332
+ const handleAppendSlide = (0, react.useCallback)(() => {
1333
+ commandService.syncExecuteCommand(AppendSlideOperation.id, { unitId: currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getUnitId() });
1334
+ }, [commandService, currentSlide]);
1335
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
1336
+ ref: slideBarRef,
1337
+ className: (0, _univerjs_design.clsx)("univer-flex univer-h-full univer-w-64 univer-flex-col univer-overflow-y-auto univer-overflow-x-hidden", _univerjs_design.scrollbarClassName),
1338
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1339
+ className: "univer-px-4",
1340
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
1341
+ className: "univer-flex univer-justify-center univer-pt-4",
1342
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1343
+ className: (0, _univerjs_design.clsx)("univer-box-border univer-block univer-h-8 univer-w-full univer-cursor-pointer univer-rounded-md univer-bg-white univer-text-center univer-text-sm univer-transition-colors", _univerjs_design.borderClassName),
1344
+ onClick: handleAppendSlide,
1345
+ children: localeService.t("slides-ui.append")
1346
+ })
1347
+ }), slideList.map((item, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1348
+ className: (0, _univerjs_design.clsx)("univer-my-4 univer-flex univer-gap-2", { "[&>div]:univer-border-primary-600 [&>span]:univer-text-primary-600": item.id === activatePageId }),
1349
+ onClick: () => activatePage(item.id),
1350
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: index + 1 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1351
+ ref: divRefs[index],
1352
+ className: (0, _univerjs_design.clsx)("univer-relative univer-box-border univer-h-32 univer-w-52 univer-bg-white hover:univer-border-primary-600", _univerjs_design.borderClassName)
1353
+ })]
1354
+ }, item.id))]
1355
+ })
1356
+ });
1357
+ }
1358
+
1432
1359
  //#endregion
1433
1360
  //#region src/controllers/shortcuts/utils.ts
1434
1361
  function whenEditorActivated(contextService) {
@@ -1493,7 +1420,7 @@ const EditorDeleteLeftShortcut = {
1493
1420
  };
1494
1421
 
1495
1422
  //#endregion
1496
- //#region src/controllers/slide-ui.controller.ts
1423
+ //#region src/controllers/ui.controller.ts
1497
1424
  /**
1498
1425
  * Copyright 2023-present DreamNum Co., Ltd.
1499
1426
  *
@@ -1510,16 +1437,14 @@ const EditorDeleteLeftShortcut = {
1510
1437
  * limitations under the License.
1511
1438
  */
1512
1439
  let SlidesUIController = class SlidesUIController extends _univerjs_core.Disposable {
1513
- constructor(_injector, _menuManagerService, _componentManager, _uiPartsService, _commandService, _shortcutService) {
1440
+ constructor(_injector, _menuManagerService, _uiPartsService, _commandService, _shortcutService) {
1514
1441
  super();
1515
1442
  this._injector = _injector;
1516
1443
  this._menuManagerService = _menuManagerService;
1517
- this._componentManager = _componentManager;
1518
1444
  this._uiPartsService = _uiPartsService;
1519
1445
  this._commandService = _commandService;
1520
1446
  this._shortcutService = _shortcutService;
1521
1447
  this._initCommands();
1522
- this._initCustomComponents();
1523
1448
  this._initUIComponents();
1524
1449
  this._initMenus();
1525
1450
  this._initShortcuts();
@@ -1527,13 +1452,6 @@ let SlidesUIController = class SlidesUIController extends _univerjs_core.Disposa
1527
1452
  _initMenus() {
1528
1453
  this._menuManagerService.mergeMenu(menuSchema);
1529
1454
  }
1530
- _initCustomComponents() {
1531
- const componentManager = this._componentManager;
1532
- this.disposeWithMe(componentManager.register("TextIcon", _univerjs_icons.TextIcon));
1533
- this.disposeWithMe(componentManager.register("GraphIcon", _univerjs_icons.GraphIcon));
1534
- this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_IMAGE_POPUP_MENU, SlideImagePopupMenu));
1535
- this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_SIDEBAR, RectSidebar));
1536
- }
1537
1455
  _initCommands() {
1538
1456
  [
1539
1457
  AppendSlideOperation,
@@ -1565,16 +1483,15 @@ let SlidesUIController = class SlidesUIController extends _univerjs_core.Disposa
1565
1483
  SlidesUIController = __decorate([
1566
1484
  __decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
1567
1485
  __decorateParam(1, _univerjs_ui.IMenuManagerService),
1568
- __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager)),
1569
- __decorateParam(3, _univerjs_ui.IUIPartsService),
1570
- __decorateParam(4, _univerjs_core.ICommandService),
1571
- __decorateParam(5, _univerjs_ui.IShortcutService)
1486
+ __decorateParam(2, _univerjs_ui.IUIPartsService),
1487
+ __decorateParam(3, _univerjs_core.ICommandService),
1488
+ __decorateParam(4, _univerjs_ui.IShortcutService)
1572
1489
  ], SlidesUIController);
1573
1490
 
1574
1491
  //#endregion
1575
1492
  //#region package.json
1576
1493
  var name = "@univerjs/slides-ui";
1577
- var version = "0.25.0";
1494
+ var version = "1.0.0-alpha.0";
1578
1495
 
1579
1496
  //#endregion
1580
1497
  //#region src/config/config.ts
@@ -1582,6 +1499,119 @@ const SLIDES_UI_PLUGIN_CONFIG_KEY = "slides-ui.config";
1582
1499
  const configSymbol = Symbol(SLIDES_UI_PLUGIN_CONFIG_KEY);
1583
1500
  const defaultPluginConfig = {};
1584
1501
 
1502
+ //#endregion
1503
+ //#region src/views/image-popup-menu/component-name.ts
1504
+ /**
1505
+ * Copyright 2023-present DreamNum Co., Ltd.
1506
+ *
1507
+ * Licensed under the Apache License, Version 2.0 (the "License");
1508
+ * you may not use this file except in compliance with the License.
1509
+ * You may obtain a copy of the License at
1510
+ *
1511
+ * http://www.apache.org/licenses/LICENSE-2.0
1512
+ *
1513
+ * Unless required by applicable law or agreed to in writing, software
1514
+ * distributed under the License is distributed on an "AS IS" BASIS,
1515
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1516
+ * See the License for the specific language governing permissions and
1517
+ * limitations under the License.
1518
+ */
1519
+ const COMPONENT_SLIDE_IMAGE_POPUP_MENU = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
1520
+
1521
+ //#endregion
1522
+ //#region src/views/image-popup-menu/ImagePopupMenu.tsx
1523
+ function SlideImagePopupMenu(props) {
1524
+ var _props$popup;
1525
+ const menuItems = (_props$popup = props.popup) === null || _props$popup === void 0 || (_props$popup = _props$popup.extraProps) === null || _props$popup === void 0 ? void 0 : _props$popup.menuItems;
1526
+ if (!menuItems) return null;
1527
+ const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
1528
+ const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
1529
+ const [visible, setVisible] = (0, react.useState)(false);
1530
+ const [isHovered, setHovered] = (0, react.useState)(false);
1531
+ const handleMouseEnter = () => {
1532
+ setHovered(true);
1533
+ };
1534
+ const handleMouseLeave = () => {
1535
+ setHovered(false);
1536
+ };
1537
+ const onVisibleChange = (visible) => {
1538
+ setVisible(visible);
1539
+ };
1540
+ const handleClick = (item) => {
1541
+ commandService.executeCommand(item.commandId, item.commandParams);
1542
+ setVisible(false);
1543
+ };
1544
+ const showMore = visible || isHovered;
1545
+ const availableMenu = menuItems.filter((item) => !item.disable);
1546
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1547
+ onMouseEnter: handleMouseEnter,
1548
+ onMouseLeave: handleMouseLeave,
1549
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Dropdown, {
1550
+ align: "start",
1551
+ overlay: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
1552
+ className: (0, _univerjs_design.clsx)("univer-m-0 univer-box-border univer-grid univer-list-none univer-items-center univer-gap-1 univer-rounded-lg univer-bg-white univer-p-1.5 univer-text-sm univer-shadow-lg", _univerjs_design.borderClassName),
1553
+ children: availableMenu.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
1554
+ className: "univer-relative univer-box-border univer-flex univer-h-8 univer-cursor-pointer univer-items-center univer-rounded univer-text-sm univer-transition-colors hover:univer-bg-gray-100",
1555
+ onClick: () => handleClick(item),
1556
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1557
+ className: "univer-px-2 univer-py-1.5 univer-align-middle",
1558
+ children: localeService.t(item.label)
1559
+ })
1560
+ }, item.index))
1561
+ }),
1562
+ open: visible,
1563
+ onOpenChange: onVisibleChange,
1564
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1565
+ className: (0, _univerjs_design.clsx)("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800", _univerjs_design.borderClassName, {
1566
+ "univer-bg-gray-100 dark:!univer-bg-gray-800": visible,
1567
+ "univer-bg-white dark:!univer-bg-gray-900": !visible
1568
+ }),
1569
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.AutofillDoubleIcon, { className: "univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-white" }), showMore && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, { className: "dark:!univer-text-white" })]
1570
+ })
1571
+ })
1572
+ });
1573
+ }
1574
+
1575
+ //#endregion
1576
+ //#region src/controllers/components.controller.ts
1577
+ /**
1578
+ * Copyright 2023-present DreamNum Co., Ltd.
1579
+ *
1580
+ * Licensed under the Apache License, Version 2.0 (the "License");
1581
+ * you may not use this file except in compliance with the License.
1582
+ * You may obtain a copy of the License at
1583
+ *
1584
+ * http://www.apache.org/licenses/LICENSE-2.0
1585
+ *
1586
+ * Unless required by applicable law or agreed to in writing, software
1587
+ * distributed under the License is distributed on an "AS IS" BASIS,
1588
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1589
+ * See the License for the specific language governing permissions and
1590
+ * limitations under the License.
1591
+ */
1592
+ let ComponentsController = class ComponentsController extends _univerjs_core.Disposable {
1593
+ constructor(_componentManager, _iconManager) {
1594
+ super();
1595
+ this._componentManager = _componentManager;
1596
+ this._iconManager = _iconManager;
1597
+ this._registerParts();
1598
+ this._registerIcons();
1599
+ }
1600
+ _registerParts() {
1601
+ const componentManager = this._componentManager;
1602
+ this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_IMAGE_POPUP_MENU, SlideImagePopupMenu));
1603
+ this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_SIDEBAR, RectSidebar));
1604
+ }
1605
+ _registerIcons() {
1606
+ this.disposeWithMe(this._iconManager.register({
1607
+ AddImageIcon: _univerjs_icons.AddImageIcon,
1608
+ TextIcon: _univerjs_icons.TextIcon,
1609
+ GraphIcon: _univerjs_icons.GraphIcon
1610
+ }));
1611
+ }
1612
+ };
1613
+ ComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.IconManager))], ComponentsController);
1614
+
1585
1615
  //#endregion
1586
1616
  //#region src/services/slide-editor-bridge.service.ts
1587
1617
  const ISlideEditorBridgeService = (0, _univerjs_core.createIdentifier)("univer.slide-editor-bridge.service");
@@ -2080,7 +2110,10 @@ let SlideEditingRenderController = class SlideEditingRenderController extends _u
2080
2110
  body.textRuns[0].ed = 1;
2081
2111
  } else body.textRuns = void 0;
2082
2112
  if (body.paragraphs != null) if (body.paragraphs.length === 1) body.paragraphs[0].startIndex = 0;
2083
- else body.paragraphs = [{ startIndex: 0 }];
2113
+ else body.paragraphs = [{
2114
+ startIndex: 0,
2115
+ paragraphId: (0, _univerjs_core.createParagraphId)(/* @__PURE__ */ new Set())
2116
+ }];
2084
2117
  if (body.sectionBreaks != null) body.sectionBreaks = void 0;
2085
2118
  if (body.tables != null) body.tables = void 0;
2086
2119
  if (body.customRanges != null) body.customRanges = void 0;
@@ -2631,6 +2664,8 @@ let UniverSlidesUIPlugin = class UniverSlidesUIPlugin extends _univerjs_core.Plu
2631
2664
  this._configService.setConfig(SLIDES_UI_PLUGIN_CONFIG_KEY, rest);
2632
2665
  }
2633
2666
  onStarting() {
2667
+ this._injector.add([ComponentsController]);
2668
+ this._injector.get(ComponentsController);
2634
2669
  (0, _univerjs_core.mergeOverrideWithDependencies)([
2635
2670
  [SlideRenderService],
2636
2671
  [ISlideEditorBridgeService, { useClass: SlideEditorBridgeService }],
@@ -2710,8 +2745,6 @@ Object.defineProperty(exports, 'SlideCanvasPopMangerService', {
2710
2745
  return SlideCanvasPopMangerService;
2711
2746
  }
2712
2747
  });
2713
- exports.SlideEditorContainer = SlideEditorContainer;
2714
- exports.SlideSideBar = SlideSideBar;
2715
2748
  Object.defineProperty(exports, 'SlidesUIController', {
2716
2749
  enumerable: true,
2717
2750
  get: function () {
@@ -1,21 +1,6 @@
1
1
 
2
- //#region src/locale/en-US.ts
3
- /**
4
- * Copyright 2023-present DreamNum Co., Ltd.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- const locale$1 = { "slides-ui": {
2
+ //#region src/locale/ru-RU.ts
3
+ const locale = { "slides-ui": {
19
4
  append: "Append Slide",
20
5
  text: { insert: { title: "Insert Text" } },
21
6
  shape: { insert: {
@@ -56,9 +41,5 @@ const locale$1 = { "slides-ui": {
56
41
  panel: { fill: { title: "Fill Color" } }
57
42
  } };
58
43
 
59
- //#endregion
60
- //#region src/locale/ru-RU.ts
61
- const locale = locale$1;
62
-
63
44
  //#endregion
64
45
  module.exports = locale;
@@ -1,21 +1,6 @@
1
1
 
2
- //#region src/locale/en-US.ts
3
- /**
4
- * Copyright 2023-present DreamNum Co., Ltd.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- const locale$1 = { "slides-ui": {
2
+ //#region src/locale/vi-VN.ts
3
+ const locale = { "slides-ui": {
19
4
  append: "Append Slide",
20
5
  text: { insert: { title: "Insert Text" } },
21
6
  shape: { insert: {
@@ -56,9 +41,5 @@ const locale$1 = { "slides-ui": {
56
41
  panel: { fill: { title: "Fill Color" } }
57
42
  } };
58
43
 
59
- //#endregion
60
- //#region src/locale/vi-VN.ts
61
- const locale = locale$1;
62
-
63
44
  //#endregion
64
45
  module.exports = locale;
@@ -1,21 +1,6 @@
1
1
 
2
- //#region src/locale/en-US.ts
3
- /**
4
- * Copyright 2023-present DreamNum Co., Ltd.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- const locale$1 = { "slides-ui": {
2
+ //#region src/locale/zh-HK.ts
3
+ const locale = { "slides-ui": {
19
4
  append: "Append Slide",
20
5
  text: { insert: { title: "Insert Text" } },
21
6
  shape: { insert: {
@@ -56,9 +41,5 @@ const locale$1 = { "slides-ui": {
56
41
  panel: { fill: { title: "Fill Color" } }
57
42
  } };
58
43
 
59
- //#endregion
60
- //#region src/locale/zh-HK.ts
61
- const locale = locale$1;
62
-
63
44
  //#endregion
64
45
  module.exports = locale;