@yudaocode/univer-slides-ui 0.0.0-stage → 1.6.218

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.
@@ -0,0 +1,4363 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __decorateClass = (decorators, target, key, kind) => {
20
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
21
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
22
+ if (decorator = decorators[i])
23
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
24
+ if (kind && result) __defProp(target, key, result);
25
+ return result;
26
+ };
27
+ var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
28
+
29
+ // src/index.ts
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ AdjustSlidesZoomOperation: () => AdjustSlidesZoomOperation,
33
+ AlignSlideCenterMenuFactory: () => AlignSlideCenterMenuFactory,
34
+ AlignSlideLeftMenuFactory: () => AlignSlideLeftMenuFactory,
35
+ AlignSlideRightMenuFactory: () => AlignSlideRightMenuFactory,
36
+ DeleteSlideElementMenuFactory: () => DeleteSlideElementMenuFactory,
37
+ DuplicateSlideMenuFactory: () => DuplicateSlideMenuFactory,
38
+ ExportPdfMenuFactory: () => ExportPdfMenuFactory,
39
+ ExportPptxMenuFactory: () => ExportPptxMenuFactory,
40
+ ExportSlidesPdfOperation: () => ExportSlidesPdfOperation,
41
+ ExportSlidesPptxOperation: () => ExportSlidesPptxOperation,
42
+ ImportPptxMenuFactory: () => ImportPptxMenuFactory,
43
+ ImportSlidesPptxOperation: () => ImportSlidesPptxOperation,
44
+ InsertSlideChartMenuFactory: () => InsertSlideChartMenuFactory,
45
+ InsertSlideConnectorMenuFactory: () => InsertSlideConnectorMenuFactory,
46
+ InsertSlideImageMenuFactory: () => InsertSlideImageMenuFactory,
47
+ InsertSlideShapeMenuFactory: () => InsertSlideShapeMenuFactory,
48
+ InsertSlideSmartArtMenuFactory: () => InsertSlideSmartArtMenuFactory,
49
+ InsertSlideTableMenuFactory: () => InsertSlideTableMenuFactory,
50
+ InsertSlideTextMenuFactory: () => InsertSlideTextMenuFactory,
51
+ NewSlideMenuFactory: () => NewSlideMenuFactory,
52
+ PlayCurrentMenuFactory: () => PlayCurrentMenuFactory,
53
+ PlayFromStartMenuFactory: () => PlayFromStartMenuFactory,
54
+ PresenterViewMenuFactory: () => PresenterViewMenuFactory,
55
+ SLIDES_INSPECTOR_COMPONENT_KEY: () => SLIDES_INSPECTOR_COMPONENT_KEY,
56
+ SLIDES_INSPECTOR_SIDEBAR_ID: () => SLIDES_INSPECTOR_SIDEBAR_ID,
57
+ SLIDES_RIBBON_SLIDESHOW_GROUP: () => SLIDES_RIBBON_SLIDESHOW_GROUP,
58
+ SLIDES_RIBBON_SLIDESHOW_TAB: () => SLIDES_RIBBON_SLIDESHOW_TAB,
59
+ SLIDE_ICON_MAP: () => SLIDE_ICON_MAP,
60
+ SlideAlignCenterIcon: () => SlideAlignCenterIcon,
61
+ SlideAlignLeftIcon: () => SlideAlignLeftIcon,
62
+ SlideAlignRightIcon: () => SlideAlignRightIcon,
63
+ SlideAnimationIcon: () => SlideAnimationIcon,
64
+ SlideChartIcon: () => SlideChartIcon,
65
+ SlideConnectorIcon: () => SlideConnectorIcon,
66
+ SlideDeleteIcon: () => SlideDeleteIcon,
67
+ SlideDuplicateIcon: () => SlideDuplicateIcon,
68
+ SlideExportIcon: () => SlideExportIcon,
69
+ SlideEyeIcon: () => SlideEyeIcon,
70
+ SlideEyeOffIcon: () => SlideEyeOffIcon,
71
+ SlideFindIcon: () => SlideFindIcon,
72
+ SlideGridIcon: () => SlideGridIcon,
73
+ SlideImageIcon: () => SlideImageIcon,
74
+ SlideImportIcon: () => SlideImportIcon,
75
+ SlideInspectorIcon: () => SlideInspectorIcon,
76
+ SlideLaserIcon: () => SlideLaserIcon,
77
+ SlideLayoutIcon: () => SlideLayoutIcon,
78
+ SlideNewPageIcon: () => SlideNewPageIcon,
79
+ SlideNotesIcon: () => SlideNotesIcon,
80
+ SlidePdfIcon: () => SlidePdfIcon,
81
+ SlidePenIcon: () => SlidePenIcon,
82
+ SlidePlayIcon: () => SlidePlayIcon,
83
+ SlidePresenterIcon: () => SlidePresenterIcon,
84
+ SlideSectionFolderIcon: () => SlideSectionFolderIcon,
85
+ SlideShapeIcon: () => SlideShapeIcon,
86
+ SlideSmartArtIcon: () => SlideSmartArtIcon,
87
+ SlideTableIcon: () => SlideTableIcon,
88
+ SlideTextIcon: () => SlideTextIcon,
89
+ SlideTransitionIcon: () => SlideTransitionIcon,
90
+ SlidesCanvasStage: () => SlidesCanvasStage,
91
+ SlidesInspectorPanel: () => SlidesInspectorPanel,
92
+ SlidesLeftSidebar: () => SlidesLeftSidebar,
93
+ SlidesPresenterAndModalsHost: () => SlidesPresenterAndModalsHost,
94
+ SlidesPresenterModal: () => SlidesPresenterModal,
95
+ SlidesStatusBar: () => SlidesStatusBar,
96
+ SlidesUIController: () => SlidesUIController,
97
+ StartSlideShowOperation: () => StartSlideShowOperation,
98
+ ToggleGridMenuFactory: () => ToggleGridMenuFactory,
99
+ ToggleNotesMenuFactory: () => ToggleNotesMenuFactory,
100
+ ToggleSlidesFindMenuFactory: () => ToggleSlidesFindMenuFactory,
101
+ ToggleSlidesFindReplaceOperation: () => ToggleSlidesFindReplaceOperation,
102
+ ToggleSlidesGridOperation: () => ToggleSlidesGridOperation,
103
+ ToggleSlidesInspectorMenuFactory: () => ToggleSlidesInspectorMenuFactory,
104
+ ToggleSlidesInspectorOperation: () => ToggleSlidesInspectorOperation,
105
+ ToggleSlidesSnapOperation: () => ToggleSlidesSnapOperation,
106
+ ToggleSlidesSpeakerNotesOperation: () => ToggleSlidesSpeakerNotesOperation,
107
+ ToggleSnapMenuFactory: () => ToggleSnapMenuFactory,
108
+ UNIVER_SLIDES_UI_PLUGIN_NAME: () => UNIVER_SLIDES_UI_PLUGIN_NAME,
109
+ UniverSlidesUIPlugin: () => UniverSlidesUIPlugin,
110
+ VERSION: () => VERSION,
111
+ ZoomResetSlidesMenuFactory: () => ZoomResetSlidesMenuFactory,
112
+ openSlidesInspectorSidebar: () => openSlidesInspectorSidebar,
113
+ slidesMenuSchema: () => slidesMenuSchema,
114
+ slidesRootMenuExtension: () => slidesRootMenuExtension,
115
+ triggerBrowserDownload: () => triggerBrowserDownload,
116
+ useActiveSlideUnit: () => useActiveSlideUnit
117
+ });
118
+ module.exports = __toCommonJS(src_exports);
119
+
120
+ // src/icons/slides-icons.tsx
121
+ var import_jsx_runtime = require("react/jsx-runtime");
122
+ function createSvgIcon(children) {
123
+ return ({ className, style, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
124
+ "svg",
125
+ {
126
+ viewBox: "0 0 16 16",
127
+ width: "16",
128
+ height: "16",
129
+ fill: "none",
130
+ stroke: "currentColor",
131
+ className,
132
+ style: { display: "inline-block", verticalAlign: "middle", ...style },
133
+ onClick,
134
+ children
135
+ }
136
+ );
137
+ }
138
+ var SlideNewPageIcon = createSvgIcon(
139
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "3", width: "12", height: "10", rx: "1.5", strokeWidth: "1.35" }),
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 5.5V10.5M5.5 8H10.5", strokeWidth: "1.4", strokeLinecap: "round" })
142
+ ] })
143
+ );
144
+ var SlideDuplicateIcon = createSvgIcon(
145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "4.5", y: "4.5", width: "9", height: "8", rx: "1.2", strokeWidth: "1.3" }),
147
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.5 10V3.5C2.5 2.95 2.95 2.5 3.5 2.5H10.5", strokeWidth: "1.3", strokeLinecap: "round" })
148
+ ] })
149
+ );
150
+ var SlideTextIcon = createSvgIcon(
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
152
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "2.5", width: "12", height: "11", rx: "1.4", strokeWidth: "1.2", strokeDasharray: "2 1.5" }),
153
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5 5.2H11M8 5.2V11.2M6.5 11.2H9.5", strokeWidth: "1.4", strokeLinecap: "round" })
154
+ ] })
155
+ );
156
+ var SlideShapeIcon = createSvgIcon(
157
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
158
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2.2", y: "2.5", width: "6.8", height: "6.8", rx: "1.2", strokeWidth: "1.35" }),
159
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "10.8", cy: "10.5", r: "3.4", strokeWidth: "1.35" })
160
+ ] })
161
+ );
162
+ var SlideConnectorIcon = createSvgIcon(
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
164
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "3.2", cy: "4", r: "1.4", strokeWidth: "1.3" }),
165
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12.8", cy: "12", r: "1.4", strokeWidth: "1.3" }),
166
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.6 4H8.2V12H11.4", strokeWidth: "1.35", strokeLinecap: "round", strokeLinejoin: "round" })
167
+ ] })
168
+ );
169
+ var SlideTableIcon = createSvgIcon(
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "2.5", width: "12", height: "11", rx: "1.3", strokeWidth: "1.35" }),
172
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2 6.2H14M2 9.8H14M6.2 2.5V13.5M10.2 2.5V13.5", strokeWidth: "1.15" })
173
+ ] })
174
+ );
175
+ var SlideChartIcon = createSvgIcon(
176
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
177
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.2 13.5H13.8", strokeWidth: "1.35", strokeLinecap: "round" }),
178
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "3.4", y: "8", width: "2.2", height: "5.5", rx: "0.5", strokeWidth: "1.25" }),
179
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "7", y: "4.8", width: "2.2", height: "8.7", rx: "0.5", strokeWidth: "1.25" }),
180
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "10.6", y: "2.8", width: "2.2", height: "10.7", rx: "0.5", strokeWidth: "1.25" })
181
+ ] })
182
+ );
183
+ var SlideSmartArtIcon = createSvgIcon(
184
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
185
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "5.2", y: "2", width: "5.6", height: "3.4", rx: "0.8", strokeWidth: "1.3" }),
186
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "1.8", y: "10.4", width: "5", height: "3.4", rx: "0.8", strokeWidth: "1.3" }),
187
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "9.2", y: "10.4", width: "5", height: "3.4", rx: "0.8", strokeWidth: "1.3" }),
188
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 5.4V8M4.3 8H11.7M4.3 8V10.4M11.7 8V10.4", strokeWidth: "1.2", strokeLinecap: "round" })
189
+ ] })
190
+ );
191
+ var SlideImageIcon = createSvgIcon(
192
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "2.5", width: "12", height: "11", rx: "1.5", strokeWidth: "1.35" }),
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "5.5", cy: "6", r: "1.2", strokeWidth: "1.2" }),
195
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.5 12L6.2 8.5L9.2 11.2L11.2 9.5L13.5 12", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" })
196
+ ] })
197
+ );
198
+ var SlideLayoutIcon = createSvgIcon(
199
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "2.5", width: "12", height: "11", rx: "1.4", strokeWidth: "1.35" }),
201
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2 6H14M8 6V13.5", strokeWidth: "1.2" })
202
+ ] })
203
+ );
204
+ var SlideTransitionIcon = createSvgIcon(
205
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
206
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "5", y: "3", width: "9", height: "10", rx: "1.3", strokeWidth: "1.35" }),
207
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2 5.5H3.5M1.5 8H3.8M2 10.5H3.5", strokeWidth: "1.35", strokeLinecap: "round" })
208
+ ] })
209
+ );
210
+ var SlideAnimationIcon = createSvgIcon(
211
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
212
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 2.2L9.4 5.5L13 5.9L10.3 8.3L11.1 11.8L8 9.9L4.9 11.8L5.7 8.3L3 5.9L6.6 5.5L8 2.2Z", strokeWidth: "1.3", strokeLinejoin: "round" }),
213
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.2 13.8H6.2", strokeWidth: "1.3", strokeLinecap: "round" })
214
+ ] })
215
+ );
216
+ var SlidePlayIcon = createSvgIcon(
217
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "1.8", y: "2.5", width: "12.4", height: "9.4", rx: "1.4", strokeWidth: "1.35" }),
219
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M6.8 5.2L10.4 7.2L6.8 9.2V5.2Z", fill: "currentColor", stroke: "none" }),
220
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5 14H11", strokeWidth: "1.35", strokeLinecap: "round" })
221
+ ] })
222
+ );
223
+ var SlidePresenterIcon = createSvgIcon(
224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
225
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "1.8", y: "2.5", width: "7.8", height: "6.4", rx: "1", strokeWidth: "1.3" }),
226
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "10.8", y: "2.5", width: "3.4", height: "3", rx: "0.6", strokeWidth: "1.2" }),
227
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10.8 7.5H14.2M10.8 9.5H13.2M2.5 11.8H9.2M2.5 13.6H7.2", strokeWidth: "1.2", strokeLinecap: "round" })
228
+ ] })
229
+ );
230
+ var SlideImportIcon = createSvgIcon(
231
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
232
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 10.5V2.5M8 2.5L5.2 5.3M8 2.5L10.8 5.3", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }),
233
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.5 10.5V12.5C2.5 13.1 2.9 13.5 3.5 13.5H12.5C13.1 13.5 13.5 13.1 13.5 12.5V10.5", strokeWidth: "1.35", strokeLinecap: "round" })
234
+ ] })
235
+ );
236
+ var SlideExportIcon = createSvgIcon(
237
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
238
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 2.5V10.5M8 10.5L5.2 7.7M8 10.5L10.8 7.7", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }),
239
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.5 10.5V12.5C2.5 13.1 2.9 13.5 3.5 13.5H12.5C13.1 13.5 13.5 13.1 13.5 12.5V10.5", strokeWidth: "1.35", strokeLinecap: "round" })
240
+ ] })
241
+ );
242
+ var SlidePdfIcon = createSvgIcon(
243
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
244
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4 2H10L13 5V13.5C13 14.05 12.55 14.5 12 14.5H4C3.45 14.5 3 14.05 3 13.5V3C3 2.45 3.45 2 4 2Z", strokeWidth: "1.3", strokeLinejoin: "round" }),
245
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9.8 2V5.2H13", strokeWidth: "1.2", strokeLinejoin: "round" }),
246
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5.2 9.8H10.8M5.2 12H8.8", strokeWidth: "1.25", strokeLinecap: "round" })
247
+ ] })
248
+ );
249
+ var SlideFindIcon = createSvgIcon(
250
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
251
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "7", cy: "7", r: "4.2", strokeWidth: "1.4" }),
252
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10.2 10.2L13.5 13.5", strokeWidth: "1.5", strokeLinecap: "round" })
253
+ ] })
254
+ );
255
+ var SlideInspectorIcon = createSvgIcon(
256
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
257
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "2.5", width: "12", height: "11", rx: "1.4", strokeWidth: "1.35" }),
258
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 2.5V13.5", strokeWidth: "1.3" })
259
+ ] })
260
+ );
261
+ var SlideAlignLeftIcon = createSvgIcon(
262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.5 2.5V13.5", strokeWidth: "1.4", strokeLinecap: "round" }),
264
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "4.8", y: "4", width: "8.2", height: "3", rx: "0.6", strokeWidth: "1.25" }),
265
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "4.8", y: "9", width: "5.6", height: "3", rx: "0.6", strokeWidth: "1.25" })
266
+ ] })
267
+ );
268
+ var SlideAlignCenterIcon = createSvgIcon(
269
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
270
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 2V14", strokeWidth: "1.3", strokeLinecap: "round", strokeDasharray: "2 1.5" }),
271
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "3.2", y: "4", width: "9.6", height: "3", rx: "0.6", strokeWidth: "1.25" }),
272
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "4.8", y: "9", width: "6.4", height: "3", rx: "0.6", strokeWidth: "1.25" })
273
+ ] })
274
+ );
275
+ var SlideAlignRightIcon = createSvgIcon(
276
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
277
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M13.5 2.5V13.5", strokeWidth: "1.4", strokeLinecap: "round" }),
278
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "3", y: "4", width: "8.2", height: "3", rx: "0.6", strokeWidth: "1.25" }),
279
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "5.6", y: "9", width: "5.6", height: "3", rx: "0.6", strokeWidth: "1.25" })
280
+ ] })
281
+ );
282
+ var SlideDeleteIcon = createSvgIcon(
283
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 4.2H13M6.2 4.2V2.8H9.8V4.2M4.4 4.2L5 13.2H11L11.6 4.2", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round" }) })
284
+ );
285
+ var SlideGridIcon = createSvgIcon(
286
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
287
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2.2", y: "2.2", width: "11.6", height: "11.6", rx: "1.2", strokeWidth: "1.3" }),
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.2 6.1H13.8M2.2 9.9H13.8M6.1 2.2V13.8M9.9 2.2V13.8", strokeWidth: "1.05" })
289
+ ] })
290
+ );
291
+ var SlideNotesIcon = createSvgIcon(
292
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
293
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2.2", y: "2.2", width: "11.6", height: "11.6", rx: "1.4", strokeWidth: "1.3" }),
294
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.2 9.5H13.8M4.5 11.6H9.5", strokeWidth: "1.25", strokeLinecap: "round" })
295
+ ] })
296
+ );
297
+ var SlideEyeIcon = createSvgIcon(
298
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
299
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M1.6 8C2.9 5.1 5.2 3.6 8 3.6C10.8 3.6 13.1 5.1 14.4 8C13.1 10.9 10.8 12.4 8 12.4C5.2 12.4 2.9 10.9 1.6 8Z", strokeWidth: "1.3" }),
300
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "8", cy: "8", r: "2", strokeWidth: "1.3" })
301
+ ] })
302
+ );
303
+ var SlideEyeOffIcon = createSvgIcon(
304
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.2 2.2L13.8 13.8M4.2 4.6C2.9 5.5 2 6.6 1.6 8C2.9 10.9 5.2 12.4 8 12.4C9.4 12.4 10.6 12 11.7 11.3M6.8 3.8C7.2 3.7 7.6 3.6 8 3.6C10.8 3.6 13.1 5.1 14.4 8C13.9 9 13.3 9.9 12.6 10.5", strokeWidth: "1.3", strokeLinecap: "round" }) })
305
+ );
306
+ var SlideSectionFolderIcon = createSvgIcon(
307
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2 4.2C2 3.65 2.45 3.2 3 3.2H6.2L7.6 4.8H13C13.55 4.8 14 5.25 14 5.8V12.2C14 12.75 13.55 13.2 13 13.2H3C2.45 13.2 2 12.75 2 12.2V4.2Z", strokeWidth: "1.3", strokeLinejoin: "round" })
308
+ );
309
+ var SlideLaserIcon = createSvgIcon(
310
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
311
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "8", cy: "8", r: "2.2", fill: "#ef4444", stroke: "#ef4444" }),
312
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "8", cy: "8", r: "5", stroke: "#ef4444", strokeWidth: "1.2", strokeDasharray: "2 2" })
313
+ ] })
314
+ );
315
+ var SlidePenIcon = createSvgIcon(
316
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M11.2 2.5L13.5 4.8L5.8 12.5L2.6 13.4L3.5 10.2L11.2 2.5Z", strokeWidth: "1.35", strokeLinejoin: "round" })
317
+ );
318
+ var SLIDE_ICON_MAP = {
319
+ SlideNewPageIcon,
320
+ SlideDuplicateIcon,
321
+ SlideTextIcon,
322
+ SlideShapeIcon,
323
+ SlideConnectorIcon,
324
+ SlideTableIcon,
325
+ SlideChartIcon,
326
+ SlideSmartArtIcon,
327
+ SlideImageIcon,
328
+ SlideLayoutIcon,
329
+ SlideTransitionIcon,
330
+ SlideAnimationIcon,
331
+ SlidePlayIcon,
332
+ SlidePresenterIcon,
333
+ SlideImportIcon,
334
+ SlideExportIcon,
335
+ SlidePdfIcon,
336
+ SlideFindIcon,
337
+ SlideInspectorIcon,
338
+ SlideAlignLeftIcon,
339
+ SlideAlignCenterIcon,
340
+ SlideAlignRightIcon,
341
+ SlideDeleteIcon,
342
+ SlideGridIcon,
343
+ SlideNotesIcon,
344
+ SlideEyeIcon,
345
+ SlideEyeOffIcon,
346
+ SlideSectionFolderIcon,
347
+ SlideLaserIcon,
348
+ SlidePenIcon
349
+ };
350
+
351
+ // src/operations/slides-ui.operation.ts
352
+ var import_core = require("@univerjs/core");
353
+ var import_ui = require("@univerjs/ui");
354
+ var import_univer_slides = require("@yudaocode/univer-slides");
355
+ var SLIDES_INSPECTOR_SIDEBAR_ID = "univer.slides.inspector.sidebar";
356
+ var SLIDES_INSPECTOR_COMPONENT_KEY = "univer.slides.inspector.component";
357
+ function openSlidesInspectorSidebar(sidebarService) {
358
+ sidebarService.open({
359
+ id: SLIDES_INSPECTOR_SIDEBAR_ID,
360
+ header: { title: "slides.sidebar.inspectorTitle" },
361
+ children: { label: SLIDES_INSPECTOR_COMPONENT_KEY },
362
+ width: 344
363
+ });
364
+ }
365
+ var ToggleSlidesInspectorOperation = {
366
+ id: "slides-ui.operation.toggle-inspector",
367
+ type: import_core.CommandType.OPERATION,
368
+ handler: (accessor) => {
369
+ const sidebarService = accessor.get(import_ui.ISidebarService);
370
+ if (sidebarService.visible && sidebarService.options?.id === SLIDES_INSPECTOR_SIDEBAR_ID) {
371
+ sidebarService.close(SLIDES_INSPECTOR_SIDEBAR_ID);
372
+ } else {
373
+ openSlidesInspectorSidebar(sidebarService);
374
+ }
375
+ return true;
376
+ }
377
+ };
378
+ var ToggleSlidesFindReplaceOperation = {
379
+ id: "slides-ui.operation.toggle-find-replace",
380
+ type: import_core.CommandType.OPERATION,
381
+ handler: (accessor) => {
382
+ const sel = accessor.get(import_univer_slides.ISlideSelectionService);
383
+ sel.setFindReplaceOpen(!sel.getState().findReplaceOpen);
384
+ return true;
385
+ }
386
+ };
387
+ var StartSlideShowOperation = {
388
+ id: "slides-ui.operation.start-slideshow",
389
+ type: import_core.CommandType.OPERATION,
390
+ handler: (accessor, params) => {
391
+ const sel = accessor.get(import_univer_slides.ISlideSelectionService);
392
+ const instanceService = accessor.get(import_core.IUniverInstanceService);
393
+ const unit = instanceService.getCurrentUnitOfType(
394
+ import_core.UniverInstanceType.UNIVER_SLIDE
395
+ );
396
+ const visibleOrder = unit ? unit.getSlidesOrdered().filter((s) => !s.hidden).map((s) => s.id) : [];
397
+ let startIdx = 0;
398
+ if (!params?.fromStart && unit) {
399
+ const curId = sel.getActiveSlideId() ?? unit.getActiveSlideId();
400
+ const found = visibleOrder.indexOf(curId);
401
+ if (found >= 0) startIdx = found;
402
+ }
403
+ sel.openPresenter(params?.mode ?? "presenter", startIdx);
404
+ return true;
405
+ }
406
+ };
407
+ var AdjustSlidesZoomOperation = {
408
+ id: "slides-ui.operation.adjust-zoom",
409
+ type: import_core.CommandType.OPERATION,
410
+ handler: (accessor, params) => {
411
+ const sel = accessor.get(import_univer_slides.ISlideSelectionService);
412
+ if (typeof params?.zoom === "number") {
413
+ sel.setZoom(params.zoom);
414
+ } else if (typeof params?.delta === "number") {
415
+ sel.setZoom(sel.getState().zoom + params.delta);
416
+ } else {
417
+ sel.setZoom(0.85);
418
+ }
419
+ return true;
420
+ }
421
+ };
422
+ var ToggleSlidesGridOperation = {
423
+ id: "slides-ui.operation.toggle-grid",
424
+ type: import_core.CommandType.OPERATION,
425
+ handler: (accessor) => {
426
+ const sel = accessor.get(import_univer_slides.ISlideSelectionService);
427
+ sel.setShowGrid(!sel.getState().showGrid);
428
+ return true;
429
+ }
430
+ };
431
+ var ToggleSlidesSnapOperation = {
432
+ id: "slides-ui.operation.toggle-snap",
433
+ type: import_core.CommandType.OPERATION,
434
+ handler: (accessor) => {
435
+ const sel = accessor.get(import_univer_slides.ISlideSelectionService);
436
+ sel.setSnapEnabled(!sel.getState().snapEnabled);
437
+ return true;
438
+ }
439
+ };
440
+ var ToggleSlidesSpeakerNotesOperation = {
441
+ id: "slides-ui.operation.toggle-speaker-notes",
442
+ type: import_core.CommandType.OPERATION,
443
+ handler: (accessor) => {
444
+ const sel = accessor.get(import_univer_slides.ISlideSelectionService);
445
+ sel.setShowSpeakerNotes(!sel.getState().showSpeakerNotes);
446
+ return true;
447
+ }
448
+ };
449
+ function triggerBrowserDownload(bytes, fileName, mimeType) {
450
+ if (typeof document === "undefined" || typeof URL === "undefined" || typeof URL.createObjectURL !== "function") {
451
+ return;
452
+ }
453
+ const copy = new Uint8Array(bytes.byteLength);
454
+ copy.set(bytes);
455
+ const blob = new Blob([copy.buffer], { type: mimeType });
456
+ const url = URL.createObjectURL(blob);
457
+ const a = document.createElement("a");
458
+ a.href = url;
459
+ a.download = fileName;
460
+ document.body.appendChild(a);
461
+ a.click();
462
+ document.body.removeChild(a);
463
+ setTimeout(() => URL.revokeObjectURL(url), 1e3);
464
+ }
465
+ var ExportSlidesPptxOperation = {
466
+ id: "slides-ui.operation.export-pptx",
467
+ type: import_core.CommandType.OPERATION,
468
+ handler: async (accessor, params) => {
469
+ const instanceService = accessor.get(import_core.IUniverInstanceService);
470
+ const io = accessor.get(import_univer_slides.ISlideIoService);
471
+ const unit = params?.unitId ? instanceService.getUnit(params.unitId, import_core.UniverInstanceType.UNIVER_SLIDE) : instanceService.getCurrentUnitOfType(import_core.UniverInstanceType.UNIVER_SLIDE);
472
+ if (!unit) return false;
473
+ const bytes = await io.exportPptx(unit.save());
474
+ const safeName = (unit.getName() || "presentation").replace(/[\\/:*?"<>|]/g, "_");
475
+ triggerBrowserDownload(
476
+ bytes,
477
+ `${safeName}.pptx`,
478
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation"
479
+ );
480
+ return true;
481
+ }
482
+ };
483
+ var ExportSlidesPdfOperation = {
484
+ id: "slides-ui.operation.export-pdf",
485
+ type: import_core.CommandType.OPERATION,
486
+ handler: async (accessor, params) => {
487
+ const instanceService = accessor.get(import_core.IUniverInstanceService);
488
+ const io = accessor.get(import_univer_slides.ISlideIoService);
489
+ const unit = params?.unitId ? instanceService.getUnit(params.unitId, import_core.UniverInstanceType.UNIVER_SLIDE) : instanceService.getCurrentUnitOfType(import_core.UniverInstanceType.UNIVER_SLIDE);
490
+ if (!unit) return false;
491
+ const bytes = await io.exportPdf(unit.save(), {
492
+ handoutNotesMode: params?.handoutNotesMode,
493
+ includeHiddenSlides: params?.includeHiddenSlides
494
+ });
495
+ const safeName = (unit.getName() || "presentation").replace(/[\\/:*?"<>|]/g, "_");
496
+ const suffix = params?.handoutNotesMode ? "-\u8BB2\u4E49\u5907\u6CE8\u7248" : "";
497
+ triggerBrowserDownload(bytes, `${safeName}${suffix}.pdf`, "application/pdf");
498
+ return true;
499
+ }
500
+ };
501
+ var ImportSlidesPptxOperation = {
502
+ id: "slides-ui.operation.import-pptx",
503
+ type: import_core.CommandType.OPERATION,
504
+ handler: async (accessor, params) => {
505
+ const instanceService = accessor.get(import_core.IUniverInstanceService);
506
+ const commandService = accessor.get(import_core.ICommandService);
507
+ const io = accessor.get(import_univer_slides.ISlideIoService);
508
+ const unit = params?.unitId ? instanceService.getUnit(params.unitId, import_core.UniverInstanceType.UNIVER_SLIDE) : instanceService.getCurrentUnitOfType(import_core.UniverInstanceType.UNIVER_SLIDE);
509
+ if (!unit) return false;
510
+ if (params?.bytes || params?.file) {
511
+ const source = params.bytes ?? params.file;
512
+ const fileName = params.file ? params.file.name.replace(/\.pptx$/i, "") : void 0;
513
+ const imported = await io.importPptx(source, { unitId: unit.getUnitId(), name: fileName });
514
+ return Boolean(
515
+ commandService.syncExecuteCommand(import_univer_slides.ReplaceSlideSnapshotCommand.id, {
516
+ unitId: unit.getUnitId(),
517
+ snapshot: imported
518
+ })
519
+ );
520
+ }
521
+ if (typeof document !== "undefined") {
522
+ const input = document.createElement("input");
523
+ input.type = "file";
524
+ input.accept = ".pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation";
525
+ input.onchange = async () => {
526
+ const picked = input.files?.[0];
527
+ if (!picked) return;
528
+ const imported = await io.importPptx(picked, {
529
+ unitId: unit.getUnitId(),
530
+ name: picked.name.replace(/\.pptx$/i, "")
531
+ });
532
+ commandService.syncExecuteCommand(import_univer_slides.ReplaceSlideSnapshotCommand.id, {
533
+ unitId: unit.getUnitId(),
534
+ snapshot: imported
535
+ });
536
+ };
537
+ input.click();
538
+ return true;
539
+ }
540
+ return false;
541
+ }
542
+ };
543
+
544
+ // src/controllers/menu.schema.ts
545
+ var import_ui2 = require("@univerjs/ui");
546
+ var import_univer_slides2 = require("@yudaocode/univer-slides");
547
+ var import_rxjs = require("rxjs");
548
+ var SLIDES_RIBBON_SLIDESHOW_TAB = "ribbon.slideshow";
549
+ var SLIDES_RIBBON_SLIDESHOW_GROUP = "ribbon.slideshow.play";
550
+ var slidesRootMenuExtension = {
551
+ [import_ui2.MenuManagerPosition.RIBBON]: {
552
+ [SLIDES_RIBBON_SLIDESHOW_TAB]: {
553
+ order: 3,
554
+ title: "slides.ribbon.slideShowTab",
555
+ [SLIDES_RIBBON_SLIDESHOW_GROUP]: {
556
+ order: 0,
557
+ title: "slides.ribbon.slideShowTab"
558
+ }
559
+ }
560
+ }
561
+ };
562
+ function makeBtn(cfg) {
563
+ return () => ({
564
+ id: cfg.id,
565
+ commandId: cfg.commandId ?? cfg.id,
566
+ type: import_ui2.MenuItemType.BUTTON,
567
+ title: cfg.title,
568
+ label: cfg.label,
569
+ tooltip: cfg.title,
570
+ icon: cfg.icon,
571
+ params: cfg.params
572
+ });
573
+ }
574
+ var NewSlideMenuFactory = makeBtn({
575
+ id: "slides-ui.menu.new-slide",
576
+ commandId: import_univer_slides2.AddSlidePageCommand.id,
577
+ title: "slides.ribbon.newSlide",
578
+ label: "slides.ribbon.newSlide",
579
+ icon: "SlideNewPageIcon"
580
+ });
581
+ var DuplicateSlideMenuFactory = makeBtn({
582
+ id: "slides-ui.menu.duplicate-slide",
583
+ commandId: import_univer_slides2.DuplicateSlidePageCommand.id,
584
+ title: "slides.ribbon.duplicateSlide",
585
+ icon: "SlideDuplicateIcon"
586
+ });
587
+ var InsertSlideTextMenuFactory = makeBtn({
588
+ id: "slides-ui.menu.insert-text",
589
+ commandId: import_univer_slides2.AddSlideElementCommand.id,
590
+ title: "slides.ribbon.insertText",
591
+ label: "slides.ribbon.insertText",
592
+ icon: "SlideTextIcon",
593
+ params: { elementType: "text" }
594
+ });
595
+ var InsertSlideShapeMenuFactory = makeBtn({
596
+ id: "slides-ui.menu.insert-shape",
597
+ commandId: import_univer_slides2.AddSlideElementCommand.id,
598
+ title: "slides.ribbon.insertShape",
599
+ label: "slides.ribbon.insertShape",
600
+ icon: "SlideShapeIcon",
601
+ params: { elementType: "shape" }
602
+ });
603
+ var InsertSlideConnectorMenuFactory = makeBtn({
604
+ id: "slides-ui.menu.insert-connector",
605
+ commandId: import_univer_slides2.AddSlideElementCommand.id,
606
+ title: "slides.ribbon.insertConnector",
607
+ icon: "SlideConnectorIcon",
608
+ params: { elementType: "connector" }
609
+ });
610
+ var InsertSlideTableMenuFactory = makeBtn({
611
+ id: "slides-ui.menu.insert-table",
612
+ commandId: import_univer_slides2.AddSlideElementCommand.id,
613
+ title: "slides.ribbon.insertTable",
614
+ label: "slides.ribbon.insertTable",
615
+ icon: "SlideTableIcon",
616
+ params: { elementType: "table" }
617
+ });
618
+ var InsertSlideChartMenuFactory = makeBtn({
619
+ id: "slides-ui.menu.insert-chart",
620
+ commandId: import_univer_slides2.AddSlideElementCommand.id,
621
+ title: "slides.ribbon.insertChart",
622
+ label: "slides.ribbon.insertChart",
623
+ icon: "SlideChartIcon",
624
+ params: { elementType: "chart" }
625
+ });
626
+ var InsertSlideSmartArtMenuFactory = makeBtn({
627
+ id: "slides-ui.menu.insert-smartart",
628
+ commandId: import_univer_slides2.AddSlideElementCommand.id,
629
+ title: "slides.ribbon.insertSmartArt",
630
+ label: "slides.ribbon.insertSmartArt",
631
+ icon: "SlideSmartArtIcon",
632
+ params: { elementType: "smartArt" }
633
+ });
634
+ var InsertSlideImageMenuFactory = makeBtn({
635
+ id: "slides-ui.menu.insert-image",
636
+ commandId: import_univer_slides2.AddSlideElementCommand.id,
637
+ title: "slides.ribbon.insertImage",
638
+ icon: "SlideImageIcon",
639
+ params: { elementType: "image" }
640
+ });
641
+ var AlignSlideLeftMenuFactory = makeBtn({
642
+ id: "slides-ui.menu.align-left",
643
+ commandId: import_univer_slides2.AlignSlideElementsCommand.id,
644
+ title: "slides.ribbon.alignLeft",
645
+ icon: "SlideAlignLeftIcon",
646
+ params: { mode: "left" }
647
+ });
648
+ var AlignSlideCenterMenuFactory = makeBtn({
649
+ id: "slides-ui.menu.align-center",
650
+ commandId: import_univer_slides2.AlignSlideElementsCommand.id,
651
+ title: "slides.ribbon.alignCenter",
652
+ icon: "SlideAlignCenterIcon",
653
+ params: { mode: "center" }
654
+ });
655
+ var AlignSlideRightMenuFactory = makeBtn({
656
+ id: "slides-ui.menu.align-right",
657
+ commandId: import_univer_slides2.AlignSlideElementsCommand.id,
658
+ title: "slides.ribbon.alignRight",
659
+ icon: "SlideAlignRightIcon",
660
+ params: { mode: "right" }
661
+ });
662
+ var DeleteSlideElementMenuFactory = (accessor) => {
663
+ const sel = accessor.get(import_univer_slides2.ISlideSelectionService);
664
+ return {
665
+ id: import_univer_slides2.DeleteSlideElementsCommand.id,
666
+ type: import_ui2.MenuItemType.BUTTON,
667
+ title: "slides.ribbon.deleteElement",
668
+ tooltip: "slides.ribbon.deleteElement",
669
+ icon: "SlideDeleteIcon",
670
+ disabled$: sel.state$.pipe((0, import_rxjs.map)((s) => s.selectedElementIds.length === 0))
671
+ };
672
+ };
673
+ var ImportPptxMenuFactory = makeBtn({
674
+ id: ImportSlidesPptxOperation.id,
675
+ title: "slides.ribbon.importPptx",
676
+ label: "slides.ribbon.importPptx",
677
+ icon: "SlideImportIcon"
678
+ });
679
+ var ExportPptxMenuFactory = makeBtn({
680
+ id: ExportSlidesPptxOperation.id,
681
+ title: "slides.ribbon.exportPptx",
682
+ label: "slides.ribbon.exportPptx",
683
+ icon: "SlideExportIcon"
684
+ });
685
+ var ExportPdfMenuFactory = makeBtn({
686
+ id: ExportSlidesPdfOperation.id,
687
+ title: "slides.ribbon.exportPdf",
688
+ label: "slides.ribbon.exportPdf",
689
+ icon: "SlidePdfIcon"
690
+ });
691
+ var ToggleSlidesInspectorMenuFactory = makeBtn({
692
+ id: ToggleSlidesInspectorOperation.id,
693
+ title: "slides.ribbon.inspector",
694
+ label: "slides.ribbon.inspector",
695
+ icon: "SlideInspectorIcon"
696
+ });
697
+ var ToggleSlidesFindMenuFactory = (accessor) => {
698
+ const sel = accessor.get(import_univer_slides2.ISlideSelectionService);
699
+ return {
700
+ id: ToggleSlidesFindReplaceOperation.id,
701
+ type: import_ui2.MenuItemType.BUTTON,
702
+ title: "slides.ribbon.findReplace",
703
+ label: "slides.ribbon.findReplace",
704
+ tooltip: "slides.ribbon.findReplace",
705
+ icon: "SlideFindIcon",
706
+ activated$: sel.state$.pipe((0, import_rxjs.map)((s) => s.findReplaceOpen))
707
+ };
708
+ };
709
+ var PlayFromStartMenuFactory = makeBtn({
710
+ id: "slides-ui.menu.play-start",
711
+ commandId: StartSlideShowOperation.id,
712
+ title: "slides.ribbon.playFromStart",
713
+ label: "slides.ribbon.playFromStart",
714
+ icon: "SlidePlayIcon",
715
+ params: { mode: "fullscreen", fromStart: true }
716
+ });
717
+ var PlayCurrentMenuFactory = makeBtn({
718
+ id: "slides-ui.menu.play-current",
719
+ commandId: StartSlideShowOperation.id,
720
+ title: "slides.ribbon.playCurrent",
721
+ label: "slides.ribbon.playCurrent",
722
+ icon: "SlidePlayIcon",
723
+ params: { mode: "fullscreen", fromStart: false }
724
+ });
725
+ var PresenterViewMenuFactory = makeBtn({
726
+ id: "slides-ui.menu.presenter-view",
727
+ commandId: StartSlideShowOperation.id,
728
+ title: "slides.ribbon.presenterView",
729
+ label: "slides.ribbon.presenterView",
730
+ icon: "SlidePresenterIcon",
731
+ params: { mode: "presenter", fromStart: false }
732
+ });
733
+ var ToggleGridMenuFactory = (accessor) => {
734
+ const sel = accessor.get(import_univer_slides2.ISlideSelectionService);
735
+ return {
736
+ id: ToggleSlidesGridOperation.id,
737
+ type: import_ui2.MenuItemType.BUTTON,
738
+ title: "slides.ribbon.toggleGrid",
739
+ tooltip: "slides.ribbon.toggleGrid",
740
+ icon: "SlideGridIcon",
741
+ activated$: sel.state$.pipe((0, import_rxjs.map)((s) => s.showGrid))
742
+ };
743
+ };
744
+ var ToggleSnapMenuFactory = (accessor) => {
745
+ const sel = accessor.get(import_univer_slides2.ISlideSelectionService);
746
+ return {
747
+ id: ToggleSlidesSnapOperation.id,
748
+ type: import_ui2.MenuItemType.BUTTON,
749
+ title: "slides.ribbon.toggleSnap",
750
+ tooltip: "slides.ribbon.toggleSnap",
751
+ icon: "SlideAlignCenterIcon",
752
+ activated$: sel.state$.pipe((0, import_rxjs.map)((s) => s.snapEnabled))
753
+ };
754
+ };
755
+ var ToggleNotesMenuFactory = (accessor) => {
756
+ const sel = accessor.get(import_univer_slides2.ISlideSelectionService);
757
+ return {
758
+ id: ToggleSlidesSpeakerNotesOperation.id,
759
+ type: import_ui2.MenuItemType.BUTTON,
760
+ title: "slides.ribbon.toggleNotes",
761
+ tooltip: "slides.ribbon.toggleNotes",
762
+ icon: "SlideNotesIcon",
763
+ activated$: sel.state$.pipe((0, import_rxjs.map)((s) => s.showSpeakerNotes))
764
+ };
765
+ };
766
+ var ZoomResetSlidesMenuFactory = makeBtn({
767
+ id: "slides-ui.menu.zoom-reset",
768
+ commandId: AdjustSlidesZoomOperation.id,
769
+ title: "slides.ribbon.zoomReset",
770
+ icon: "SlidePlayIcon",
771
+ params: { zoom: 0.85 }
772
+ });
773
+ var slidesMenuSchema = {
774
+ [import_ui2.RibbonStartGroup.FORMAT]: {
775
+ ["slides-ui.menu.new-slide"]: { order: 0, menuItemFactory: NewSlideMenuFactory },
776
+ ["slides-ui.menu.duplicate-slide"]: { order: 1, menuItemFactory: DuplicateSlideMenuFactory },
777
+ ["slides-ui.menu.insert-text"]: { order: 2, menuItemFactory: InsertSlideTextMenuFactory },
778
+ ["slides-ui.menu.insert-shape"]: { order: 3, menuItemFactory: InsertSlideShapeMenuFactory },
779
+ ["slides-ui.menu.insert-chart"]: { order: 4, menuItemFactory: InsertSlideChartMenuFactory },
780
+ ["slides-ui.menu.insert-smartart"]: { order: 5, menuItemFactory: InsertSlideSmartArtMenuFactory }
781
+ },
782
+ [import_ui2.RibbonStartGroup.LAYOUT]: {
783
+ ["slides-ui.menu.align-left"]: { order: 1, menuItemFactory: AlignSlideLeftMenuFactory },
784
+ ["slides-ui.menu.align-center"]: { order: 2, menuItemFactory: AlignSlideCenterMenuFactory },
785
+ ["slides-ui.menu.align-right"]: { order: 3, menuItemFactory: AlignSlideRightMenuFactory },
786
+ [import_univer_slides2.DeleteSlideElementsCommand.id]: { order: 4, menuItemFactory: DeleteSlideElementMenuFactory }
787
+ },
788
+ [import_ui2.RibbonStartGroup.OTHERS]: {
789
+ [ImportSlidesPptxOperation.id]: { order: 1, menuItemFactory: ImportPptxMenuFactory },
790
+ [ExportSlidesPptxOperation.id]: { order: 2, menuItemFactory: ExportPptxMenuFactory },
791
+ [ExportSlidesPdfOperation.id]: { order: 3, menuItemFactory: ExportPdfMenuFactory },
792
+ [ToggleSlidesFindReplaceOperation.id]: { order: 4, menuItemFactory: ToggleSlidesFindMenuFactory },
793
+ [ToggleSlidesInspectorOperation.id]: { order: 5, menuItemFactory: ToggleSlidesInspectorMenuFactory }
794
+ },
795
+ [import_ui2.RibbonInsertGroup.EDIT]: {
796
+ ["slides-ui.menu.insert-text-2"]: {
797
+ order: 1,
798
+ menuItemFactory: makeBtn({
799
+ id: "slides-ui.menu.insert-text-2",
800
+ commandId: import_univer_slides2.AddSlideElementCommand.id,
801
+ title: "slides.ribbon.insertText",
802
+ label: "slides.ribbon.insertText",
803
+ icon: "SlideTextIcon",
804
+ params: { elementType: "text" }
805
+ })
806
+ },
807
+ ["slides-ui.menu.insert-table"]: { order: 2, menuItemFactory: InsertSlideTableMenuFactory },
808
+ ["slides-ui.menu.insert-connector"]: { order: 3, menuItemFactory: InsertSlideConnectorMenuFactory }
809
+ },
810
+ [import_ui2.RibbonInsertGroup.MEDIA]: {
811
+ ["slides-ui.menu.insert-image"]: { order: 1, menuItemFactory: InsertSlideImageMenuFactory }
812
+ },
813
+ [SLIDES_RIBBON_SLIDESHOW_GROUP]: {
814
+ ["slides-ui.menu.play-start"]: { order: 1, menuItemFactory: PlayFromStartMenuFactory },
815
+ ["slides-ui.menu.play-current"]: { order: 2, menuItemFactory: PlayCurrentMenuFactory },
816
+ ["slides-ui.menu.presenter-view"]: { order: 3, menuItemFactory: PresenterViewMenuFactory }
817
+ },
818
+ [import_ui2.RibbonViewGroup.DISPLAY]: {
819
+ [ToggleSlidesGridOperation.id]: { order: 1, menuItemFactory: ToggleGridMenuFactory },
820
+ [ToggleSlidesSnapOperation.id]: { order: 2, menuItemFactory: ToggleSnapMenuFactory },
821
+ [ToggleSlidesSpeakerNotesOperation.id]: { order: 3, menuItemFactory: ToggleNotesMenuFactory },
822
+ ["slides-ui.menu.zoom-reset"]: { order: 4, menuItemFactory: ZoomResetSlidesMenuFactory }
823
+ }
824
+ };
825
+
826
+ // src/controllers/slides-ui.controller.ts
827
+ var import_core7 = require("@univerjs/core");
828
+ var import_ui9 = require("@univerjs/ui");
829
+
830
+ // src/views/footer/SlidesStatusBar.tsx
831
+ var import_core3 = require("@univerjs/core");
832
+ var import_ui4 = require("@univerjs/ui");
833
+ var import_univer_slides4 = require("@yudaocode/univer-slides");
834
+
835
+ // src/views/hooks/useActiveSlideUnit.ts
836
+ var import_core2 = require("@univerjs/core");
837
+ var import_ui3 = require("@univerjs/ui");
838
+ var import_univer_slides3 = require("@yudaocode/univer-slides");
839
+ var import_react = require("react");
840
+ function useActiveSlideUnit() {
841
+ const instanceService = (0, import_ui3.useDependency)(import_core2.IUniverInstanceService);
842
+ const selectionService = (0, import_ui3.useDependency)(import_univer_slides3.ISlideSelectionService);
843
+ const initialUnit = instanceService.getCurrentUnitOfType(import_core2.UniverInstanceType.UNIVER_SLIDE) ?? null;
844
+ const [unit, setUnit] = (0, import_react.useState)(initialUnit);
845
+ const [, setRevTick] = (0, import_react.useState)(() => initialUnit?.getRev() ?? 0);
846
+ const [selection, setSelection] = (0, import_react.useState)(
847
+ () => selectionService.getState()
848
+ );
849
+ (0, import_react.useEffect)(() => {
850
+ const unitSub = instanceService.getCurrentTypeOfUnit$(import_core2.UniverInstanceType.UNIVER_SLIDE).subscribe((u) => {
851
+ setUnit(u ?? null);
852
+ setRevTick((t) => t + 1);
853
+ });
854
+ const selSub = selectionService.state$.subscribe((s) => setSelection(s));
855
+ return () => {
856
+ unitSub.unsubscribe();
857
+ selSub.unsubscribe();
858
+ };
859
+ }, [instanceService, selectionService]);
860
+ (0, import_react.useEffect)(() => {
861
+ if (!unit) return;
862
+ const snapSub = unit.snapshotChanged$.subscribe(() => {
863
+ setRevTick((t) => t + 1);
864
+ });
865
+ return () => snapSub.unsubscribe();
866
+ }, [unit]);
867
+ const currentUnit = unit ?? instanceService.getCurrentUnitOfType(import_core2.UniverInstanceType.UNIVER_SLIDE) ?? null;
868
+ const snapshot = currentUnit ? currentUnit.getSnapshot() : null;
869
+ const resolvedSlideId = (selection.activeSlideId && snapshot?.slides[selection.activeSlideId] ? selection.activeSlideId : snapshot?.activeSlideId) ?? snapshot?.slideOrder[0] ?? null;
870
+ const activeSlide = resolvedSlideId && snapshot ? snapshot.slides[resolvedSlideId] ?? null : null;
871
+ const activeSlideIndex = resolvedSlideId && snapshot ? Math.max(0, snapshot.slideOrder.indexOf(resolvedSlideId)) : 0;
872
+ return {
873
+ unit: currentUnit,
874
+ snapshot,
875
+ selection,
876
+ activeSlide,
877
+ activeSlideIndex
878
+ };
879
+ }
880
+
881
+ // src/views/footer/SlidesStatusBar.tsx
882
+ var import_jsx_runtime2 = require("react/jsx-runtime");
883
+ var SlidesStatusBar = () => {
884
+ const commandService = (0, import_ui4.useDependency)(import_core3.ICommandService);
885
+ const selectionService = (0, import_ui4.useDependency)(import_univer_slides4.ISlideSelectionService);
886
+ const { snapshot, selection, activeSlideIndex } = useActiveSlideUnit();
887
+ if (!snapshot) return null;
888
+ const totalSlides = snapshot.slideOrder.length;
889
+ const zoomPct = Math.round(selection.zoom * 100);
890
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "univer-slides-status-bar", children: [
891
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "univer-slides-status-left", children: [
892
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "univer-slides-status-item is-strong", children: [
893
+ "\u5E7B\u706F\u7247 ",
894
+ activeSlideIndex + 1,
895
+ " / ",
896
+ totalSlides
897
+ ] }),
898
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "univer-slides-status-divider" }),
899
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "univer-slides-status-item", children: [
900
+ snapshot.slideSize.preset,
901
+ " (",
902
+ Math.round(snapshot.slideSize.widthPt),
903
+ " \xD7 ",
904
+ Math.round(snapshot.slideSize.heightPt),
905
+ " pt)"
906
+ ] }),
907
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "univer-slides-status-divider" }),
908
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "univer-slides-status-item", children: snapshot.theme.name })
909
+ ] }),
910
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "univer-slides-status-right", children: [
911
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
912
+ "button",
913
+ {
914
+ type: "button",
915
+ className: `univer-slides-status-toggle${selection.showSpeakerNotes ? " is-active" : ""}`,
916
+ onClick: () => commandService.executeCommand(ToggleSlidesSpeakerNotesOperation.id),
917
+ children: "\u6F14\u8BB2\u8005\u5907\u6CE8"
918
+ }
919
+ ),
920
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
921
+ "button",
922
+ {
923
+ type: "button",
924
+ className: `univer-slides-status-toggle${selection.showGrid ? " is-active" : ""}`,
925
+ onClick: () => commandService.executeCommand(ToggleSlidesGridOperation.id),
926
+ children: "\u53C2\u8003\u7F51\u683C"
927
+ }
928
+ ),
929
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
930
+ "button",
931
+ {
932
+ type: "button",
933
+ className: `univer-slides-status-toggle${selection.snapEnabled ? " is-active" : ""}`,
934
+ onClick: () => commandService.executeCommand(ToggleSlidesSnapOperation.id),
935
+ children: "\u5BF9\u9F50\u8F85\u52A9\u7EBF"
936
+ }
937
+ ),
938
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
939
+ "button",
940
+ {
941
+ type: "button",
942
+ className: "univer-slides-status-toggle is-highlight",
943
+ onClick: () => commandService.executeCommand(StartSlideShowOperation.id, {
944
+ mode: "presenter",
945
+ fromStart: false
946
+ }),
947
+ children: "\u6F14\u8BB2\u8005\u89C6\u56FE"
948
+ }
949
+ ),
950
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "univer-slides-zoom-controls", children: [
951
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
952
+ "button",
953
+ {
954
+ type: "button",
955
+ className: "univer-slides-zoom-btn",
956
+ title: "\u7F29\u5C0F",
957
+ onClick: () => selectionService.setZoom(selection.zoom - 0.1),
958
+ children: "-"
959
+ }
960
+ ),
961
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
962
+ "input",
963
+ {
964
+ type: "range",
965
+ min: 30,
966
+ max: 200,
967
+ step: 5,
968
+ value: zoomPct,
969
+ onChange: (e) => selectionService.setZoom(Number(e.target.value) / 100)
970
+ }
971
+ ),
972
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
973
+ "button",
974
+ {
975
+ type: "button",
976
+ className: "univer-slides-zoom-btn",
977
+ title: "\u653E\u5927",
978
+ onClick: () => selectionService.setZoom(selection.zoom + 0.1),
979
+ children: "+"
980
+ }
981
+ ),
982
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
983
+ "button",
984
+ {
985
+ type: "button",
986
+ className: "univer-slides-zoom-pct",
987
+ title: "\u70B9\u51FB\u91CD\u7F6E\u7F29\u653E\u81F3 85%",
988
+ onClick: () => selectionService.setZoom(0.85),
989
+ children: [
990
+ zoomPct,
991
+ "%"
992
+ ]
993
+ }
994
+ )
995
+ ] })
996
+ ] })
997
+ ] });
998
+ };
999
+
1000
+ // src/views/inspector/SlidesInspectorPanel.tsx
1001
+ var import_core4 = require("@univerjs/core");
1002
+ var import_ui5 = require("@univerjs/ui");
1003
+ var import_univer_slides5 = require("@yudaocode/univer-slides");
1004
+ var import_react2 = require("react");
1005
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1006
+ var SAMPLE_DATASET_JSON = JSON.stringify(
1007
+ {
1008
+ meta: { quarter: "2026 Q4" },
1009
+ kpi: { revenue: "6.82 \u4EBF", margin: "+4.6 pct" },
1010
+ quarterlyTrend: [
1011
+ { quarter: "Q1", revenue: 145, profit: 58 },
1012
+ { quarter: "Q2", revenue: 172, profit: 74 },
1013
+ { quarter: "Q3", revenue: 206, profit: 95 },
1014
+ { quarter: "Q4", revenue: 258, profit: 126 }
1015
+ ],
1016
+ sales: [
1017
+ { region: "\u534E\u4E1C\u5927\u533A", owner: "\u6797\u8FDC\u822A", amount: "9,860" },
1018
+ { region: "\u534E\u5357\u5927\u533A", owner: "\u9648\u601D\u6E90", amount: "7,420" },
1019
+ { region: "\u534E\u5317\u5927\u533A", owner: "\u5468\u660E\u54F2", amount: "6,150" }
1020
+ ]
1021
+ },
1022
+ null,
1023
+ 2
1024
+ );
1025
+ var SlidesInspectorPanel = () => {
1026
+ const commandService = (0, import_ui5.useDependency)(import_core4.ICommandService);
1027
+ const selectionService = (0, import_ui5.useDependency)(import_univer_slides5.ISlideSelectionService);
1028
+ const { unit, snapshot, selection, activeSlide } = useActiveSlideUnit();
1029
+ const [datasetJson, setDatasetJson] = (0, import_react2.useState)(SAMPLE_DATASET_JSON);
1030
+ const [maxRowsInput, setMaxRowsInput] = (0, import_react2.useState)(5);
1031
+ const [datasetError, setDatasetError] = (0, import_react2.useState)(null);
1032
+ if (!unit || !snapshot || !activeSlide) {
1033
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-inspector", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-empty", children: "\u672A\u9009\u4E2D\u6D3B\u52A8\u5E7B\u706F\u7247" }) });
1034
+ }
1035
+ const unitId = unit.getUnitId();
1036
+ const tab = selection.inspectorTab;
1037
+ const selectedEl = selection.selectedElementIds.length > 0 ? activeSlide.elements[selection.selectedElementIds[0]] ?? null : null;
1038
+ const patchElement = (patch) => {
1039
+ if (!selectedEl) return;
1040
+ commandService.syncExecuteCommand(import_univer_slides5.UpdateSlideElementsCommand.id, {
1041
+ unitId,
1042
+ slideId: activeSlide.id,
1043
+ updates: [{ id: selectedEl.id, patch }]
1044
+ });
1045
+ };
1046
+ const extractedCodes = (0, import_univer_slides5.extractSlideDatasetCodes)(snapshot);
1047
+ const handleRunTemplateCompile = () => {
1048
+ try {
1049
+ const parsed = JSON.parse(datasetJson);
1050
+ setDatasetError(null);
1051
+ const compiled = (0, import_univer_slides5.compileSlidesWithDataset)(snapshot, parsed, {
1052
+ maxRowsPerSlide: maxRowsInput > 0 ? maxRowsInput : void 0
1053
+ });
1054
+ commandService.syncExecuteCommand(import_univer_slides5.ReplaceSlideSnapshotCommand.id, {
1055
+ unitId,
1056
+ snapshot: compiled
1057
+ });
1058
+ } catch (err) {
1059
+ setDatasetError(err?.message || "JSON \u683C\u5F0F\u89E3\u6790\u5931\u8D25");
1060
+ }
1061
+ };
1062
+ const handleAddAnimation = (category = "entrance", effect = "fadeIn") => {
1063
+ const targetId = selectedEl?.id ?? activeSlide.elementOrder[0];
1064
+ if (!targetId) return;
1065
+ const nextAnims = [
1066
+ ...activeSlide.animations ?? [],
1067
+ {
1068
+ id: `anim-${(0, import_core4.generateRandomId)(6)}`,
1069
+ elementId: targetId,
1070
+ category,
1071
+ effect,
1072
+ trigger: "onClick",
1073
+ durationMs: 500,
1074
+ delayMs: 0
1075
+ }
1076
+ ];
1077
+ commandService.syncExecuteCommand(import_univer_slides5.SetSlideAnimationsCommand.id, {
1078
+ unitId,
1079
+ slideId: activeSlide.id,
1080
+ animations: nextAnims
1081
+ });
1082
+ };
1083
+ const updateAnimationItem = (animId, patch) => {
1084
+ const nextAnims = (activeSlide.animations ?? []).map(
1085
+ (a) => a.id === animId ? { ...a, ...patch } : a
1086
+ );
1087
+ commandService.syncExecuteCommand(import_univer_slides5.SetSlideAnimationsCommand.id, {
1088
+ unitId,
1089
+ slideId: activeSlide.id,
1090
+ animations: nextAnims
1091
+ });
1092
+ };
1093
+ const removeAnimationItem = (animId) => {
1094
+ const nextAnims = (activeSlide.animations ?? []).filter((a) => a.id !== animId);
1095
+ commandService.syncExecuteCommand(import_univer_slides5.SetSlideAnimationsCommand.id, {
1096
+ unitId,
1097
+ slideId: activeSlide.id,
1098
+ animations: nextAnims
1099
+ });
1100
+ };
1101
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-inspector", children: [
1102
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-inspector-tabs", children: [
1103
+ { key: "page", label: "\u9875\u9762\u4E0E\u6BCD\u7248" },
1104
+ { key: "element", label: "\u5143\u7D20\u6837\u5F0F\u4E0E\u6570\u636E" },
1105
+ { key: "animation", label: "\u52A8\u753B\u65F6\u95F4\u8F74" }
1106
+ ].map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1107
+ "button",
1108
+ {
1109
+ type: "button",
1110
+ className: `univer-slides-inspector-tab${tab === item.key ? " is-active" : ""}`,
1111
+ onClick: () => selectionService.setInspectorTab(item.key),
1112
+ children: item.label
1113
+ },
1114
+ item.key
1115
+ )) }),
1116
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-inspector-body", children: [
1117
+ tab === "page" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1118
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1119
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u5E7B\u706F\u7247\u6807\u9898\u4E0E\u5C3A\u5BF8" }),
1120
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1121
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u672C\u9875\u6807\u9898" }),
1122
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1123
+ "input",
1124
+ {
1125
+ className: "univer-slides-input",
1126
+ value: activeSlide.title,
1127
+ onChange: (e) => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1128
+ unitId,
1129
+ slideId: activeSlide.id,
1130
+ patch: { title: e.target.value }
1131
+ })
1132
+ }
1133
+ )
1134
+ ] }),
1135
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-size-pills", children: [
1136
+ { preset: "16:9", label: "\u5BBD\u5C4F 16:9 (960\xD7540)" },
1137
+ { preset: "4:3", label: "\u6807\u51C6 4:3 (960\xD7720)" },
1138
+ { preset: "A4", label: "A4 \u6A2A\u5411\u8BB2\u4E49" }
1139
+ ].map((sp) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1140
+ "button",
1141
+ {
1142
+ type: "button",
1143
+ className: `univer-slides-pill-btn${snapshot.slideSize.preset === sp.preset ? " is-active" : ""}`,
1144
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides5.SetSlideSizeCommand.id, {
1145
+ unitId,
1146
+ preset: sp.preset
1147
+ }),
1148
+ children: sp.label
1149
+ },
1150
+ sp.preset
1151
+ )) })
1152
+ ] }),
1153
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1154
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u4E3B\u9898\u914D\u8272\u65B9\u6848" }),
1155
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-theme-list", children: import_univer_slides5.SLIDE_THEME_PRESETS.map((preset) => {
1156
+ const active = snapshot.theme.name === preset.name;
1157
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1158
+ "button",
1159
+ {
1160
+ type: "button",
1161
+ className: `univer-slides-theme-card${active ? " is-active" : ""}`,
1162
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlideThemeCommand.id, {
1163
+ unitId,
1164
+ theme: preset
1165
+ }),
1166
+ children: [
1167
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "univer-slides-theme-name", children: preset.name }),
1168
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "univer-slides-theme-swatches", children: [
1169
+ preset.colors.primary,
1170
+ preset.colors.accent1,
1171
+ preset.colors.accent2,
1172
+ preset.colors.accent3,
1173
+ preset.colors.accent4
1174
+ ].map((c, idx) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { style: { backgroundColor: c } }, idx)) })
1175
+ ]
1176
+ },
1177
+ preset.name
1178
+ );
1179
+ }) })
1180
+ ] }),
1181
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1182
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u9875\u9762\u80CC\u666F" }),
1183
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1184
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u80CC\u666F\u7C7B\u578B" }),
1185
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1186
+ "select",
1187
+ {
1188
+ className: "univer-slides-select",
1189
+ value: activeSlide.background?.type ?? "solid",
1190
+ onChange: (e) => {
1191
+ const nextType = e.target.value;
1192
+ commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1193
+ unitId,
1194
+ slideId: activeSlide.id,
1195
+ patch: {
1196
+ background: nextType === "gradient" ? {
1197
+ type: "gradient",
1198
+ gradientFrom: "#0f172a",
1199
+ gradientTo: "#1d4ed8",
1200
+ gradientAngleDeg: 135
1201
+ } : nextType === "image" ? { type: "image", imageSrc: activeSlide.background?.imageSrc ?? "" } : { type: "solid", color: snapshot.theme.colors.background }
1202
+ }
1203
+ });
1204
+ },
1205
+ children: [
1206
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "solid", children: "\u7EAF\u8272\u80CC\u666F" }),
1207
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "gradient", children: "\u53CC\u8272\u7EBF\u6027\u6E10\u53D8" }),
1208
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "image", children: "\u80CC\u666F\u56FE\u7247" })
1209
+ ]
1210
+ }
1211
+ )
1212
+ ] }),
1213
+ (activeSlide.background?.type ?? "solid") === "solid" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1214
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u80CC\u666F\u989C\u8272" }),
1215
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1216
+ "input",
1217
+ {
1218
+ type: "color",
1219
+ value: activeSlide.background?.color ?? snapshot.theme.colors.background,
1220
+ onChange: (e) => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1221
+ unitId,
1222
+ slideId: activeSlide.id,
1223
+ patch: { background: { type: "solid", color: e.target.value } }
1224
+ })
1225
+ }
1226
+ )
1227
+ ] }),
1228
+ activeSlide.background?.type === "gradient" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-grid-2", children: [
1229
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1230
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u8D77\u59CB\u8272" }),
1231
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1232
+ "input",
1233
+ {
1234
+ type: "color",
1235
+ value: activeSlide.background.gradientFrom ?? "#0f172a",
1236
+ onChange: (e) => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1237
+ unitId,
1238
+ slideId: activeSlide.id,
1239
+ patch: {
1240
+ background: {
1241
+ ...activeSlide.background,
1242
+ gradientFrom: e.target.value
1243
+ }
1244
+ }
1245
+ })
1246
+ }
1247
+ )
1248
+ ] }),
1249
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1250
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u7ED3\u675F\u8272" }),
1251
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1252
+ "input",
1253
+ {
1254
+ type: "color",
1255
+ value: activeSlide.background.gradientTo ?? "#1d4ed8",
1256
+ onChange: (e) => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1257
+ unitId,
1258
+ slideId: activeSlide.id,
1259
+ patch: {
1260
+ background: {
1261
+ ...activeSlide.background,
1262
+ gradientTo: e.target.value
1263
+ }
1264
+ }
1265
+ })
1266
+ }
1267
+ )
1268
+ ] })
1269
+ ] })
1270
+ ] }),
1271
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1272
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u9875\u9762\u5207\u6362\u52A8\u753B\u4E0E\u81EA\u52A8\u6362\u7247" }),
1273
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1274
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u5207\u6362\u6548\u679C" }),
1275
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1276
+ "select",
1277
+ {
1278
+ className: "univer-slides-select",
1279
+ value: activeSlide.transition?.type ?? "none",
1280
+ onChange: (e) => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1281
+ unitId,
1282
+ slideId: activeSlide.id,
1283
+ patch: {
1284
+ transition: {
1285
+ ...activeSlide.transition ?? { durationMs: 500 },
1286
+ type: e.target.value
1287
+ }
1288
+ }
1289
+ }),
1290
+ children: [
1291
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "none", children: "\u65E0\u5207\u6362" }),
1292
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "fade", children: "\u5E73\u6ED1\u6DE1\u5165 (Fade)" }),
1293
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "push", children: "\u63A8\u5165 (Push)" }),
1294
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "wipe", children: "\u64E6\u9664 (Wipe)" }),
1295
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "split", children: "\u5206\u5272 (Split)" }),
1296
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "zoom", children: "\u7F29\u653E (Zoom)" }),
1297
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "morph", children: "\u53D8\u5F62 (Morph)" })
1298
+ ]
1299
+ }
1300
+ )
1301
+ ] }),
1302
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-grid-2", children: [
1303
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1304
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u65F6\u957F (ms)" }),
1305
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1306
+ "input",
1307
+ {
1308
+ type: "number",
1309
+ className: "univer-slides-input",
1310
+ min: 100,
1311
+ max: 3e3,
1312
+ step: 50,
1313
+ value: activeSlide.transition?.durationMs ?? 500,
1314
+ onChange: (e) => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1315
+ unitId,
1316
+ slideId: activeSlide.id,
1317
+ patch: {
1318
+ transition: {
1319
+ type: activeSlide.transition?.type ?? "fade",
1320
+ ...activeSlide.transition,
1321
+ durationMs: Number(e.target.value) || 500
1322
+ }
1323
+ }
1324
+ })
1325
+ }
1326
+ )
1327
+ ] }),
1328
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1329
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u81EA\u52A8\u6362\u7247(ms)" }),
1330
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1331
+ "input",
1332
+ {
1333
+ type: "number",
1334
+ className: "univer-slides-input",
1335
+ min: 0,
1336
+ step: 500,
1337
+ placeholder: "0 \u4E3A\u624B\u52A8",
1338
+ value: activeSlide.transition?.advanceAfterMs ?? 0,
1339
+ onChange: (e) => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1340
+ unitId,
1341
+ slideId: activeSlide.id,
1342
+ patch: {
1343
+ transition: {
1344
+ type: activeSlide.transition?.type ?? "fade",
1345
+ ...activeSlide.transition,
1346
+ advanceAfterMs: Number(e.target.value) || void 0
1347
+ }
1348
+ }
1349
+ })
1350
+ }
1351
+ )
1352
+ ] })
1353
+ ] }),
1354
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1355
+ "button",
1356
+ {
1357
+ type: "button",
1358
+ className: "univer-slides-secondary-btn",
1359
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides5.UpdateSlidePagePropsCommand.id, {
1360
+ unitId,
1361
+ slideId: activeSlide.id,
1362
+ applyToAllSlides: true,
1363
+ patch: {
1364
+ transition: activeSlide.transition ?? { type: "fade", durationMs: 500 }
1365
+ }
1366
+ }),
1367
+ children: "\u5C06\u5F53\u524D\u5207\u6362\u6548\u679C\u5E94\u7528\u5230\u5168\u90E8\u5E7B\u706F\u7247"
1368
+ }
1369
+ )
1370
+ ] })
1371
+ ] }),
1372
+ tab === "element" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1373
+ !selectedEl ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-field-section", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-hint", children: "\u5728\u753B\u5E03\u4E2D\u70B9\u51FB\u4EFB\u610F\u5143\u7D20\u53EF\u7F16\u8F91\u5176\u51E0\u4F55\u5C3A\u5BF8\u3001\u586B\u5145\u63CF\u8FB9\u3001\u827A\u672F\u5B57\u3001\u56FE\u8868\u6216\u8868\u683C\u6570\u636E\uFF1B\u4E0B\u65B9\u53EF\u6267\u884C\u52A8\u6001\u6570\u636E\u96C6\u6A21\u677F\u7F16\u8BD1\u3002" }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1374
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1375
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u5BF9\u9F50\u4E0E\u56FE\u5C42\u987A\u5E8F" }),
1376
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-align-row", children: [
1377
+ { mode: "left", label: "\u5DE6" },
1378
+ { mode: "center", label: "\u6C34\u5E73\u4E2D" },
1379
+ { mode: "right", label: "\u53F3" },
1380
+ { mode: "top", label: "\u9876" },
1381
+ { mode: "middle", label: "\u5782\u76F4\u4E2D" },
1382
+ { mode: "bottom", label: "\u5E95" }
1383
+ ].map((al) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1384
+ "button",
1385
+ {
1386
+ type: "button",
1387
+ className: "univer-slides-mini-btn",
1388
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides5.AlignSlideElementsCommand.id, {
1389
+ unitId,
1390
+ slideId: activeSlide.id,
1391
+ mode: al.mode
1392
+ }),
1393
+ children: al.label
1394
+ },
1395
+ al.mode
1396
+ )) }),
1397
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-align-row", children: [
1398
+ [
1399
+ { action: "front", label: "\u7F6E\u4E8E\u9876\u5C42" },
1400
+ { action: "forward", label: "\u4E0A\u79FB\u4E00\u5C42" },
1401
+ { action: "backward", label: "\u4E0B\u79FB\u4E00\u5C42" },
1402
+ { action: "back", label: "\u7F6E\u4E8E\u5E95\u5C42" }
1403
+ ].map((ly) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1404
+ "button",
1405
+ {
1406
+ type: "button",
1407
+ className: "univer-slides-mini-btn",
1408
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides5.ReorderSlideElementLayerCommand.id, {
1409
+ unitId,
1410
+ slideId: activeSlide.id,
1411
+ elementId: selectedEl.id,
1412
+ action: ly.action
1413
+ }),
1414
+ children: ly.label
1415
+ },
1416
+ ly.action
1417
+ )),
1418
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1419
+ "button",
1420
+ {
1421
+ type: "button",
1422
+ className: "univer-slides-mini-btn is-danger",
1423
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides5.DeleteSlideElementsCommand.id, {
1424
+ unitId,
1425
+ slideId: activeSlide.id,
1426
+ elementIds: [selectedEl.id]
1427
+ }),
1428
+ children: "\u5220\u9664"
1429
+ }
1430
+ )
1431
+ ] })
1432
+ ] }),
1433
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1434
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u4F4D\u7F6E\u4E0E\u5C3A\u5BF8 (pt)" }),
1435
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-grid-2", children: [
1436
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1437
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "X" }),
1438
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1439
+ "input",
1440
+ {
1441
+ type: "number",
1442
+ className: "univer-slides-input",
1443
+ value: Math.round(selectedEl.x),
1444
+ onChange: (e) => patchElement({ x: Number(e.target.value) || 0 })
1445
+ }
1446
+ )
1447
+ ] }),
1448
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1449
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Y" }),
1450
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1451
+ "input",
1452
+ {
1453
+ type: "number",
1454
+ className: "univer-slides-input",
1455
+ value: Math.round(selectedEl.y),
1456
+ onChange: (e) => patchElement({ y: Number(e.target.value) || 0 })
1457
+ }
1458
+ )
1459
+ ] }),
1460
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1461
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u5BBD" }),
1462
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1463
+ "input",
1464
+ {
1465
+ type: "number",
1466
+ className: "univer-slides-input",
1467
+ value: Math.round(selectedEl.width),
1468
+ onChange: (e) => patchElement({ width: Math.max(16, Number(e.target.value) || 16) })
1469
+ }
1470
+ )
1471
+ ] }),
1472
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1473
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u9AD8" }),
1474
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1475
+ "input",
1476
+ {
1477
+ type: "number",
1478
+ className: "univer-slides-input",
1479
+ value: Math.round(selectedEl.height),
1480
+ onChange: (e) => patchElement({ height: Math.max(16, Number(e.target.value) || 16) })
1481
+ }
1482
+ )
1483
+ ] }),
1484
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1485
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u65CB\u8F6C\xB0" }),
1486
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1487
+ "input",
1488
+ {
1489
+ type: "number",
1490
+ className: "univer-slides-input",
1491
+ value: selectedEl.rotation ?? 0,
1492
+ onChange: (e) => patchElement({ rotation: Number(e.target.value) || 0 })
1493
+ }
1494
+ )
1495
+ ] }),
1496
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1497
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u900F\u660E\u5EA6" }),
1498
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1499
+ "input",
1500
+ {
1501
+ type: "number",
1502
+ step: 0.1,
1503
+ min: 0.1,
1504
+ max: 1,
1505
+ className: "univer-slides-input",
1506
+ value: selectedEl.opacity ?? 1,
1507
+ onChange: (e) => patchElement({ opacity: Math.min(1, Math.max(0.1, Number(e.target.value) || 1)) })
1508
+ }
1509
+ )
1510
+ ] })
1511
+ ] })
1512
+ ] }),
1513
+ selectedEl.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1514
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u6587\u672C\u6392\u7248\u4E0E\u827A\u672F\u5B57 (WordArt)" }),
1515
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-grid-2", children: [
1516
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1517
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u5B57\u53F7" }),
1518
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1519
+ "input",
1520
+ {
1521
+ type: "number",
1522
+ className: "univer-slides-input",
1523
+ value: selectedEl.fontSize ?? 18,
1524
+ onChange: (e) => patchElement({ fontSize: Number(e.target.value) || 18 })
1525
+ }
1526
+ )
1527
+ ] }),
1528
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1529
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u989C\u8272" }),
1530
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1531
+ "input",
1532
+ {
1533
+ type: "color",
1534
+ value: selectedEl.color ?? snapshot.theme.colors.text,
1535
+ onChange: (e) => patchElement({ color: e.target.value })
1536
+ }
1537
+ )
1538
+ ] })
1539
+ ] }),
1540
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-align-row", children: [
1541
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1542
+ "button",
1543
+ {
1544
+ type: "button",
1545
+ className: `univer-slides-mini-btn${selectedEl.fontWeight === "bold" ? " is-active" : ""}`,
1546
+ onClick: () => patchElement({
1547
+ fontWeight: selectedEl.fontWeight === "bold" ? "normal" : "bold"
1548
+ }),
1549
+ children: "\u52A0\u7C97 B"
1550
+ }
1551
+ ),
1552
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1553
+ "button",
1554
+ {
1555
+ type: "button",
1556
+ className: `univer-slides-mini-btn${selectedEl.italic ? " is-active" : ""}`,
1557
+ onClick: () => patchElement({ italic: !selectedEl.italic }),
1558
+ children: "\u659C\u4F53 I"
1559
+ }
1560
+ ),
1561
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1562
+ "button",
1563
+ {
1564
+ type: "button",
1565
+ className: `univer-slides-mini-btn${selectedEl.bullet ? " is-active" : ""}`,
1566
+ onClick: () => patchElement({
1567
+ bullet: selectedEl.bullet ? false : "disc"
1568
+ }),
1569
+ children: "\u9879\u76EE\u7B26\u53F7"
1570
+ }
1571
+ )
1572
+ ] }),
1573
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-checkbox-label", children: [
1574
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1575
+ "input",
1576
+ {
1577
+ type: "checkbox",
1578
+ checked: Boolean(selectedEl.wordArt?.enabled),
1579
+ onChange: (e) => patchElement({
1580
+ wordArt: {
1581
+ enabled: e.target.checked,
1582
+ gradientFrom: selectedEl.wordArt?.gradientFrom ?? "#2563eb",
1583
+ gradientTo: selectedEl.wordArt?.gradientTo ?? "#10b981",
1584
+ shadowColor: "rgba(15,23,42,0.35)",
1585
+ shadowBlur: 5,
1586
+ shadowOffsetY: 3
1587
+ }
1588
+ })
1589
+ }
1590
+ ),
1591
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u542F\u7528\u827A\u672F\u5B57\u6E10\u53D8\u4E0E\u6295\u5F71 (WordArt)" })
1592
+ ] })
1593
+ ] }),
1594
+ selectedEl.type === "shape" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1595
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u51E0\u4F55\u5F62\u72B6\u6837\u5F0F" }),
1596
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1597
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u51E0\u4F55\u7C7B\u578B" }),
1598
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1599
+ "select",
1600
+ {
1601
+ className: "univer-slides-select",
1602
+ value: selectedEl.shapeType,
1603
+ onChange: (e) => patchElement({ shapeType: e.target.value }),
1604
+ children: [
1605
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "rect", children: "\u77E9\u5F62" }),
1606
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "roundRect", children: "\u5706\u89D2\u77E9\u5F62" }),
1607
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "ellipse", children: "\u692D\u5706" }),
1608
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "triangle", children: "\u4E09\u89D2\u5F62" }),
1609
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "diamond", children: "\u83F1\u5F62" }),
1610
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "pentagon", children: "\u4E94\u8FB9\u5F62" }),
1611
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "hexagon", children: "\u516D\u8FB9\u5F62" }),
1612
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "octagon", children: "\u516B\u8FB9\u5F62" }),
1613
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "star5", children: "\u4E94\u89D2\u661F" }),
1614
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "rightArrow", children: "\u53F3\u7BAD\u5934" }),
1615
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "leftArrow", children: "\u5DE6\u7BAD\u5934" }),
1616
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "chevron", children: "\u71D5\u5C3E\u5757" }),
1617
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "callout", children: "\u6C14\u6CE1\u6846" }),
1618
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "cloud", children: "\u4E91\u6735\u6846" }),
1619
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "plus", children: "\u52A0\u53F7" })
1620
+ ]
1621
+ }
1622
+ )
1623
+ ] }),
1624
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-grid-2", children: [
1625
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1626
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u586B\u5145\u8272" }),
1627
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1628
+ "input",
1629
+ {
1630
+ type: "color",
1631
+ value: selectedEl.fillColor || "#2563eb",
1632
+ onChange: (e) => patchElement({ fillColor: e.target.value })
1633
+ }
1634
+ )
1635
+ ] }),
1636
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1637
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u63CF\u8FB9\u8272" }),
1638
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1639
+ "input",
1640
+ {
1641
+ type: "color",
1642
+ value: selectedEl.strokeColor || "#1d4ed8",
1643
+ onChange: (e) => patchElement({ strokeColor: e.target.value })
1644
+ }
1645
+ )
1646
+ ] })
1647
+ ] })
1648
+ ] }),
1649
+ selectedEl.type === "connector" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1650
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u8FDE\u63A5\u7EBF\u5C5E\u6027" }),
1651
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1652
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u8FDE\u63A5\u6587\u672C" }),
1653
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1654
+ "input",
1655
+ {
1656
+ className: "univer-slides-input",
1657
+ value: selectedEl.label ?? "",
1658
+ onChange: (e) => patchElement({ label: e.target.value })
1659
+ }
1660
+ )
1661
+ ] })
1662
+ ] }),
1663
+ selectedEl.type === "chart" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1664
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u56FE\u8868\u7C7B\u578B\u4E0E\u6570\u636E\u96C6\u7ED1\u5B9A" }),
1665
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1666
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u56FE\u8868\u7C7B\u578B" }),
1667
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1668
+ "select",
1669
+ {
1670
+ className: "univer-slides-select",
1671
+ value: selectedEl.chartType,
1672
+ onChange: (e) => patchElement({ chartType: e.target.value }),
1673
+ children: [
1674
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "column", children: "\u7C07\u72B6\u67F1\u5F62\u56FE" }),
1675
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "bar", children: "\u6C34\u5E73\u6761\u5F62\u56FE" }),
1676
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "line", children: "\u6298\u7EBF\u56FE" }),
1677
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "combo", children: "\u67F1\u7EBF\u7EC4\u5408\u56FE" }),
1678
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "pie", children: "\u997C\u56FE" }),
1679
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "doughnut", children: "\u73AF\u5F62\u56FE" }),
1680
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "area", children: "\u9762\u79EF\u56FE" }),
1681
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "radar", children: "\u96F7\u8FBE\u56FE" }),
1682
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "scatter", children: "\u6563\u70B9\u56FE" })
1683
+ ]
1684
+ }
1685
+ )
1686
+ ] }),
1687
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1688
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u56FE\u8868\u6807\u9898" }),
1689
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1690
+ "input",
1691
+ {
1692
+ className: "univer-slides-input",
1693
+ value: selectedEl.title ?? "",
1694
+ onChange: (e) => patchElement({ title: e.target.value })
1695
+ }
1696
+ )
1697
+ ] }),
1698
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1699
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u5206\u7C7B\u8F74(\u9017\u53F7)" }),
1700
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1701
+ "input",
1702
+ {
1703
+ className: "univer-slides-input",
1704
+ value: selectedEl.categories.join(", "),
1705
+ onChange: (e) => patchElement({
1706
+ categories: e.target.value.split(",").map((s) => s.trim())
1707
+ })
1708
+ }
1709
+ )
1710
+ ] }),
1711
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1712
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u6570\u636E\u96C6\u7F16\u7801" }),
1713
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1714
+ "input",
1715
+ {
1716
+ className: "univer-slides-input",
1717
+ placeholder: "\u5982 quarterlyTrend",
1718
+ value: selectedEl.datasetCode ?? "",
1719
+ onChange: (e) => patchElement({ datasetCode: e.target.value })
1720
+ }
1721
+ )
1722
+ ] })
1723
+ ] }),
1724
+ selectedEl.type === "smartArt" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1725
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u667A\u80FD\u56FE\u793A SmartArt \u8282\u70B9" }),
1726
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1727
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u56FE\u793A\u5E03\u5C40" }),
1728
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1729
+ "select",
1730
+ {
1731
+ className: "univer-slides-select",
1732
+ value: selectedEl.layout,
1733
+ onChange: (e) => patchElement({
1734
+ layout: e.target.value
1735
+ }),
1736
+ children: [
1737
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "process", children: "\u9012\u8FDB\u6D41\u7A0B (Process)" }),
1738
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "cycle", children: "\u95ED\u73AF\u5FAA\u73AF (Cycle)" }),
1739
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "hierarchy", children: "\u7EC4\u7EC7\u67B6\u6784 (Hierarchy)" }),
1740
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "list", children: "\u5206\u7EC4\u5217\u8868 (List)" }),
1741
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "pyramid", children: "\u6218\u7565\u91D1\u5B57\u5854 (Pyramid)" })
1742
+ ]
1743
+ }
1744
+ )
1745
+ ] }),
1746
+ selectedEl.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-smartart-row", children: [
1747
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1748
+ "input",
1749
+ {
1750
+ className: "univer-slides-input",
1751
+ value: item.title,
1752
+ onChange: (e) => {
1753
+ const nextItems = import_core4.Tools.deepClone(selectedEl.items);
1754
+ nextItems[idx].title = e.target.value;
1755
+ patchElement({ items: nextItems });
1756
+ }
1757
+ }
1758
+ ),
1759
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1760
+ "input",
1761
+ {
1762
+ className: "univer-slides-input",
1763
+ placeholder: "\u526F\u6807\u9898",
1764
+ value: item.subtitle ?? "",
1765
+ onChange: (e) => {
1766
+ const nextItems = import_core4.Tools.deepClone(selectedEl.items);
1767
+ nextItems[idx].subtitle = e.target.value;
1768
+ patchElement({ items: nextItems });
1769
+ }
1770
+ }
1771
+ )
1772
+ ] }, item.id)),
1773
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1774
+ "button",
1775
+ {
1776
+ type: "button",
1777
+ className: "univer-slides-secondary-btn",
1778
+ onClick: () => {
1779
+ const nextItems = [
1780
+ ...import_core4.Tools.deepClone(selectedEl.items),
1781
+ { id: `sa-${(0, import_core4.generateRandomId)(4)}`, title: "\u65B0\u9636\u6BB5\u8282\u70B9", subtitle: "\u5173\u952E\u52A8\u4F5C" }
1782
+ ];
1783
+ patchElement({ items: nextItems });
1784
+ },
1785
+ children: "+ \u6DFB\u52A0\u56FE\u793A\u8282\u70B9"
1786
+ }
1787
+ )
1788
+ ] }),
1789
+ selectedEl.type === "table" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1790
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-section-heading", children: [
1791
+ "\u8868\u683C\u7ED3\u6784\u4E0E #",
1792
+ " \u5FAA\u73AF\u7ED1\u5B9A"
1793
+ ] }),
1794
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1795
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u5FAA\u73AF\u6570\u636E\u96C6" }),
1796
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1797
+ "input",
1798
+ {
1799
+ className: "univer-slides-input",
1800
+ placeholder: "\u5982 sales\uFF08\u914D\u5408 #{sales.field}\uFF09",
1801
+ value: selectedEl.datasetLoopCode ?? "",
1802
+ onChange: (e) => patchElement({ datasetLoopCode: e.target.value })
1803
+ }
1804
+ )
1805
+ ] }),
1806
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-align-row", children: [
1807
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1808
+ "button",
1809
+ {
1810
+ type: "button",
1811
+ className: "univer-slides-mini-btn",
1812
+ onClick: () => {
1813
+ const tbl = selectedEl;
1814
+ const newCells = [
1815
+ ...import_core4.Tools.deepClone(tbl.cells),
1816
+ Array.from({ length: tbl.cols }, () => ({ text: "" }))
1817
+ ];
1818
+ patchElement({
1819
+ rows: tbl.rows + 1,
1820
+ rowHeights: [...tbl.rowHeights, 40],
1821
+ height: tbl.height + 40,
1822
+ cells: newCells
1823
+ });
1824
+ },
1825
+ children: "+ \u6DFB\u52A0\u884C"
1826
+ }
1827
+ ),
1828
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1829
+ "button",
1830
+ {
1831
+ type: "button",
1832
+ className: "univer-slides-mini-btn",
1833
+ onClick: () => {
1834
+ const tbl = selectedEl;
1835
+ const newCells = import_core4.Tools.deepClone(tbl.cells).map((r, rIdx) => [
1836
+ ...r,
1837
+ { text: rIdx === 0 ? "\u65B0\u5217" : "", bold: rIdx === 0 }
1838
+ ]);
1839
+ patchElement({
1840
+ cols: tbl.cols + 1,
1841
+ colWidths: [...tbl.colWidths, 120],
1842
+ width: tbl.width + 120,
1843
+ cells: newCells
1844
+ });
1845
+ },
1846
+ children: "+ \u6DFB\u52A0\u5217"
1847
+ }
1848
+ )
1849
+ ] })
1850
+ ] })
1851
+ ] }),
1852
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1853
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-section-heading", children: [
1854
+ "\u52A8\u6001\u62A5\u544A\u5F15\u64CE ($",
1855
+ "{}",
1856
+ " / #",
1857
+ "{}",
1858
+ " \u6570\u636E\u96C6\u7ED1\u5B9A)"
1859
+ ] }),
1860
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-hint", children: [
1861
+ "\u5DF2\u8BC6\u522B\u6570\u636E\u96C6\u7F16\u7801\uFF1A",
1862
+ extractedCodes.codes.length > 0 ? extractedCodes.codes.join(", ") : "\u6682\u65E0"
1863
+ ] }),
1864
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1865
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u5355\u9875\u6700\u5927\u884C\u6570" }),
1866
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1867
+ "input",
1868
+ {
1869
+ type: "number",
1870
+ min: 1,
1871
+ max: 50,
1872
+ className: "univer-slides-input",
1873
+ value: maxRowsInput,
1874
+ onChange: (e) => setMaxRowsInput(Number(e.target.value) || 5)
1875
+ }
1876
+ )
1877
+ ] }),
1878
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1879
+ "textarea",
1880
+ {
1881
+ className: "univer-slides-code-textarea",
1882
+ rows: 6,
1883
+ value: datasetJson,
1884
+ onChange: (e) => setDatasetJson(e.target.value)
1885
+ }
1886
+ ),
1887
+ datasetError && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-error-msg", children: datasetError }),
1888
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1889
+ "button",
1890
+ {
1891
+ type: "button",
1892
+ className: "univer-slides-primary-btn is-block",
1893
+ onClick: handleRunTemplateCompile,
1894
+ children: "\u6CE8\u5165\u6570\u636E\u96C6\u5E76\u81EA\u52A8\u5206\u9875\u6E32\u67D3"
1895
+ }
1896
+ )
1897
+ ] })
1898
+ ] }),
1899
+ tab === "animation" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-field-section", children: [
1900
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-section-heading", children: "\u5143\u7D20\u52A8\u753B\u65F6\u95F4\u8F74" }),
1901
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-align-row", children: [
1902
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1903
+ "button",
1904
+ {
1905
+ type: "button",
1906
+ className: "univer-slides-mini-btn",
1907
+ onClick: () => handleAddAnimation("entrance", "fadeIn"),
1908
+ children: "+ \u8FDB\u5165\u52A8\u753B"
1909
+ }
1910
+ ),
1911
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1912
+ "button",
1913
+ {
1914
+ type: "button",
1915
+ className: "univer-slides-mini-btn",
1916
+ onClick: () => handleAddAnimation("emphasis", "pulse"),
1917
+ children: "+ \u5F3A\u8C03\u52A8\u753B"
1918
+ }
1919
+ ),
1920
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1921
+ "button",
1922
+ {
1923
+ type: "button",
1924
+ className: "univer-slides-mini-btn",
1925
+ onClick: () => handleAddAnimation("exit", "fadeOut"),
1926
+ children: "+ \u9000\u51FA\u52A8\u753B"
1927
+ }
1928
+ )
1929
+ ] }),
1930
+ (activeSlide.animations ?? []).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-hint", children: "\u5F53\u524D\u9875\u6682\u65E0\u5143\u7D20\u52A8\u753B\u3002\u9009\u4E2D\u753B\u5E03\u5143\u7D20\u540E\u70B9\u51FB\u4E0A\u65B9\u6309\u94AE\u5373\u53EF\u6DFB\u52A0\u8FDB\u5165\u3001\u5F3A\u8C03\u6216\u9000\u51FA\u65F6\u95F4\u8F74\u6548\u679C\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "univer-slides-anim-list", children: activeSlide.animations.map((anim, idx) => {
1931
+ const target = activeSlide.elements[anim.elementId];
1932
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-anim-card", children: [
1933
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-anim-card-top", children: [
1934
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "univer-slides-thumb-index", children: idx + 1 }),
1935
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "univer-slides-anim-target", children: target?.name || target?.type || anim.elementId }),
1936
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1937
+ "button",
1938
+ {
1939
+ type: "button",
1940
+ className: "univer-slides-icon-btn is-danger",
1941
+ onClick: () => removeAnimationItem(anim.id),
1942
+ children: "\xD7"
1943
+ }
1944
+ )
1945
+ ] }),
1946
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-grid-2", children: [
1947
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1948
+ "select",
1949
+ {
1950
+ className: "univer-slides-select",
1951
+ value: anim.effect,
1952
+ onChange: (e) => updateAnimationItem(anim.id, {
1953
+ effect: e.target.value
1954
+ }),
1955
+ children: [
1956
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "appear", children: "\u76F4\u63A5\u51FA\u73B0 (Appear)" }),
1957
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "fadeIn", children: "\u5E73\u6ED1\u6DE1\u5165 (Fade In)" }),
1958
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "flyIn", children: "\u98DE\u5165 (Fly In)" }),
1959
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "zoomIn", children: "\u7F29\u653E\u8FDB\u5165 (Zoom In)" }),
1960
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "wipe", children: "\u64E6\u9664\u8FDB\u5165 (Wipe)" }),
1961
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "pulse", children: "\u8109\u51B2\u5F3A\u8C03 (Pulse)" }),
1962
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "fadeOut", children: "\u6DE1\u51FA\u6D88\u5931 (Fade Out)" })
1963
+ ]
1964
+ }
1965
+ ),
1966
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1967
+ "select",
1968
+ {
1969
+ className: "univer-slides-select",
1970
+ value: anim.trigger,
1971
+ onChange: (e) => updateAnimationItem(anim.id, {
1972
+ trigger: e.target.value
1973
+ }),
1974
+ children: [
1975
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "onClick", children: "\u5355\u51FB\u65F6" }),
1976
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "withPrevious", children: "\u4E0E\u4E0A\u4E00\u52A8\u753B\u540C\u65F6" }),
1977
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "afterPrevious", children: "\u4E0A\u4E00\u52A8\u753B\u4E4B\u540E" })
1978
+ ]
1979
+ }
1980
+ )
1981
+ ] }),
1982
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "univer-slides-grid-2", children: [
1983
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1984
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u65F6\u957F(ms)" }),
1985
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1986
+ "input",
1987
+ {
1988
+ type: "number",
1989
+ className: "univer-slides-input",
1990
+ value: anim.durationMs,
1991
+ onChange: (e) => updateAnimationItem(anim.id, {
1992
+ durationMs: Number(e.target.value) || 500
1993
+ })
1994
+ }
1995
+ )
1996
+ ] }),
1997
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
1998
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u5EF6\u8FDF(ms)" }),
1999
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2000
+ "input",
2001
+ {
2002
+ type: "number",
2003
+ className: "univer-slides-input",
2004
+ value: anim.delayMs,
2005
+ onChange: (e) => updateAnimationItem(anim.id, {
2006
+ delayMs: Number(e.target.value) || 0
2007
+ })
2008
+ }
2009
+ )
2010
+ ] })
2011
+ ] }),
2012
+ anim.effect === "flyIn" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "univer-slides-field-row", children: [
2013
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u98DE\u5165\u65B9\u5411" }),
2014
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
2015
+ "select",
2016
+ {
2017
+ className: "univer-slides-select",
2018
+ value: anim.direction ?? "up",
2019
+ onChange: (e) => updateAnimationItem(anim.id, {
2020
+ direction: e.target.value
2021
+ }),
2022
+ children: [
2023
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "up", children: "\u81EA\u5E95\u90E8\u5411\u4E0A" }),
2024
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "down", children: "\u81EA\u9876\u90E8\u5411\u4E0B" }),
2025
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "left", children: "\u81EA\u53F3\u4FA7\u5411\u5DE6" }),
2026
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "right", children: "\u81EA\u5DE6\u4FA7\u5411\u53F3" })
2027
+ ]
2028
+ }
2029
+ )
2030
+ ] })
2031
+ ] }, anim.id);
2032
+ }) })
2033
+ ] })
2034
+ ] })
2035
+ ] });
2036
+ };
2037
+
2038
+ // src/views/left-sidebar/SlidesLeftSidebar.tsx
2039
+ var import_core5 = require("@univerjs/core");
2040
+ var import_ui6 = require("@univerjs/ui");
2041
+ var import_univer_slides6 = require("@yudaocode/univer-slides");
2042
+ var import_react3 = require("react");
2043
+ var import_jsx_runtime4 = require("react/jsx-runtime");
2044
+ var LAYOUT_OPTIONS = [
2045
+ { type: "titleAndContent", label: "\u6807\u9898\u548C\u5185\u5BB9", desc: "\u9876\u90E8\u6807\u9898 + \u6B63\u6587\u6838\u5FC3\u533A" },
2046
+ { type: "title", label: "\u6807\u9898\u5E7B\u706F\u7247", desc: "\u5C45\u4E2D\u4E3B\u526F\u6807\u9898\u5C01\u9762" },
2047
+ { type: "sectionHeader", label: "\u8282\u6807\u9898", desc: "\u7AE0\u8282\u8FC7\u6E21\u5BFC\u8BFB\u9875" },
2048
+ { type: "twoColumn", label: "\u4E24\u680F\u5185\u5BB9", desc: "\u5DE6\u53F3\u53CC\u680F\u5E76\u5217\u8981\u70B9" },
2049
+ { type: "comparison", label: "\u5BF9\u6BD4\u7248\u5F0F", desc: "\u5E26\u5B50\u6807\u9898\u7684\u65B9\u6848\u5BF9\u6BD4" },
2050
+ { type: "blank", label: "\u7A7A\u767D\u7248\u5F0F", desc: "\u81EA\u7531\u6392\u5E03\u753B\u5E03" }
2051
+ ];
2052
+ var SlidesLeftSidebar = () => {
2053
+ const commandService = (0, import_ui6.useDependency)(import_core5.ICommandService);
2054
+ const { unit, snapshot, activeSlide } = useActiveSlideUnit();
2055
+ const [layoutMenuOpen, setLayoutMenuOpen] = (0, import_react3.useState)(false);
2056
+ const [editingSecId, setEditingSecId] = (0, import_react3.useState)(null);
2057
+ const [editingSecTitle, setEditingSecTitle] = (0, import_react3.useState)("");
2058
+ if (!unit || !snapshot) {
2059
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "univer-slides-left-sidebar univer-slides-empty", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u6682\u65E0\u6D3B\u52A8\u7684\u5E7B\u706F\u7247\u6587\u7A3F" }) });
2060
+ }
2061
+ const unitId = unit.getUnitId();
2062
+ const totalSlides = snapshot.slideOrder.length;
2063
+ const handleAddSlide = (layoutType = "titleAndContent") => {
2064
+ commandService.syncExecuteCommand(import_univer_slides6.AddSlidePageCommand.id, {
2065
+ unitId,
2066
+ layoutId: layoutType
2067
+ });
2068
+ setLayoutMenuOpen(false);
2069
+ };
2070
+ const handleAddSection = () => {
2071
+ commandService.syncExecuteCommand(import_univer_slides6.AddSlideSectionCommand.id, {
2072
+ unitId,
2073
+ title: `\u7AE0\u8282 ${snapshot.sections.length + 1}`,
2074
+ slideIds: activeSlide ? [activeSlide.id] : []
2075
+ });
2076
+ };
2077
+ const handleToggleSection = (sec) => {
2078
+ commandService.syncExecuteCommand(import_univer_slides6.UpdateSlideSectionCommand.id, {
2079
+ unitId,
2080
+ sectionId: sec.id,
2081
+ patch: { collapsed: !sec.collapsed }
2082
+ });
2083
+ };
2084
+ const commitSectionTitle = (sectionId) => {
2085
+ if (editingSecTitle.trim()) {
2086
+ commandService.syncExecuteCommand(import_univer_slides6.UpdateSlideSectionCommand.id, {
2087
+ unitId,
2088
+ sectionId,
2089
+ patch: { title: editingSecTitle.trim() }
2090
+ });
2091
+ }
2092
+ setEditingSecId(null);
2093
+ };
2094
+ const assignedSet = /* @__PURE__ */ new Set();
2095
+ for (const sec of snapshot.sections) {
2096
+ for (const sid of sec.slideIds) assignedSet.add(sid);
2097
+ }
2098
+ const unassignedIds = snapshot.slideOrder.filter((id) => !assignedSet.has(id));
2099
+ const effectiveSections = snapshot.sections.length > 0 ? snapshot.sections.map(
2100
+ (sec, idx) => idx === snapshot.sections.length - 1 && unassignedIds.length > 0 ? { ...sec, slideIds: [...sec.slideIds, ...unassignedIds] } : sec
2101
+ ) : [{ id: "sec-virtual", title: "\u5168\u90E8\u5E7B\u706F\u7247", slideIds: snapshot.slideOrder, collapsed: false }];
2102
+ const renderSlideCard = (slide) => {
2103
+ const globalIndex = snapshot.slideOrder.indexOf(slide.id);
2104
+ const slideNum = globalIndex + 1;
2105
+ const isActive = activeSlide?.id === slide.id;
2106
+ const svgMarkup = (0, import_univer_slides6.renderSlidePageToSvg)(slide, snapshot, slideNum);
2107
+ const hasTransition = Boolean(slide.transition?.type && slide.transition.type !== "none");
2108
+ const hasNotes = Boolean(slide.speakerNotes && slide.speakerNotes.trim().length > 0);
2109
+ const animCount = slide.animations?.length ?? 0;
2110
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2111
+ "div",
2112
+ {
2113
+ className: `univer-slides-thumb-card${isActive ? " is-active" : ""}${slide.hidden ? " is-hidden" : ""}`,
2114
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides6.SetActiveSlidePageCommand.id, {
2115
+ unitId,
2116
+ slideId: slide.id
2117
+ }),
2118
+ children: [
2119
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "univer-slides-thumb-top", children: [
2120
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "univer-slides-thumb-index", children: slideNum }),
2121
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "univer-slides-thumb-title", title: slide.title, children: slide.title || `\u5E7B\u706F\u7247 ${slideNum}` }),
2122
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "univer-slides-thumb-badges", children: [
2123
+ slide.hidden && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "univer-slides-badge is-muted", title: "\u653E\u6620\u65F6\u9690\u85CF", children: "\u9690\u85CF" }),
2124
+ hasTransition && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "univer-slides-badge is-accent", title: `\u5207\u6362\u52A8\u753B: ${slide.transition?.type}`, children: "\u5207\u6362" }),
2125
+ animCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "univer-slides-badge is-violet", title: `\u5143\u7D20\u52A8\u753B: ${animCount} \u9879`, children: [
2126
+ "\u52A8\u753B ",
2127
+ animCount
2128
+ ] }),
2129
+ hasNotes && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "univer-slides-badge is-emerald", title: "\u542B\u6F14\u8BB2\u8005\u5907\u6CE8", children: "\u5907\u6CE8" })
2130
+ ] })
2131
+ ] }),
2132
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2133
+ "div",
2134
+ {
2135
+ className: "univer-slides-thumb-preview",
2136
+ dangerouslySetInnerHTML: { __html: svgMarkup }
2137
+ }
2138
+ ),
2139
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2140
+ "div",
2141
+ {
2142
+ className: "univer-slides-thumb-actions",
2143
+ onClick: (e) => e.stopPropagation(),
2144
+ children: [
2145
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2146
+ "button",
2147
+ {
2148
+ type: "button",
2149
+ className: "univer-slides-icon-btn",
2150
+ title: "\u590D\u5236\u5E7B\u706F\u7247",
2151
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides6.DuplicateSlidePageCommand.id, {
2152
+ unitId,
2153
+ slideId: slide.id
2154
+ }),
2155
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { viewBox: "0 0 16 16", width: "13", height: "13", fill: "none", stroke: "currentColor", children: [
2156
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "4.5", y: "4.5", width: "9", height: "8", rx: "1.2", strokeWidth: "1.3" }),
2157
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M2.5 10V3.5C2.5 2.9 2.9 2.5 3.5 2.5H10", strokeWidth: "1.3", strokeLinecap: "round" })
2158
+ ] })
2159
+ }
2160
+ ),
2161
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2162
+ "button",
2163
+ {
2164
+ type: "button",
2165
+ className: "univer-slides-icon-btn",
2166
+ title: slide.hidden ? "\u53D6\u6D88\u9690\u85CF" : "\u9690\u85CF\u6B64\u9875",
2167
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides6.UpdateSlidePagePropsCommand.id, {
2168
+ unitId,
2169
+ slideId: slide.id,
2170
+ patch: { hidden: !slide.hidden }
2171
+ }),
2172
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "13", height: "13", fill: "none", stroke: "currentColor", children: slide.hidden ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M2.5 2.5L13.5 13.5M3 8C4.5 5 6.3 4 8 4C10.5 4 12.5 5.5 13.5 8", strokeWidth: "1.3", strokeLinecap: "round" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
2173
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M1.8 8C3 5.2 5.3 3.8 8 3.8C10.7 3.8 13 5.2 14.2 8C13 10.8 10.7 12.2 8 12.2C5.3 12.2 3 10.8 1.8 8Z", strokeWidth: "1.3" }),
2174
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "8", cy: "8", r: "1.8", strokeWidth: "1.3" })
2175
+ ] }) })
2176
+ }
2177
+ ),
2178
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2179
+ "button",
2180
+ {
2181
+ type: "button",
2182
+ className: "univer-slides-icon-btn",
2183
+ title: "\u4E0A\u79FB",
2184
+ disabled: globalIndex <= 0,
2185
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides6.ReorderSlidePagesCommand.id, {
2186
+ unitId,
2187
+ slideId: slide.id,
2188
+ direction: "up"
2189
+ }),
2190
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "13", height: "13", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 12.5V3.5M8 3.5L4.5 7M8 3.5L11.5 7", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
2191
+ }
2192
+ ),
2193
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2194
+ "button",
2195
+ {
2196
+ type: "button",
2197
+ className: "univer-slides-icon-btn",
2198
+ title: "\u4E0B\u79FB",
2199
+ disabled: globalIndex >= totalSlides - 1,
2200
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides6.ReorderSlidePagesCommand.id, {
2201
+ unitId,
2202
+ slideId: slide.id,
2203
+ direction: "down"
2204
+ }),
2205
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "13", height: "13", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 3.5V12.5M8 12.5L4.5 9M8 12.5L11.5 9", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
2206
+ }
2207
+ ),
2208
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2209
+ "button",
2210
+ {
2211
+ type: "button",
2212
+ className: "univer-slides-icon-btn is-danger",
2213
+ title: "\u5220\u9664\u5E7B\u706F\u7247",
2214
+ disabled: totalSlides <= 1,
2215
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides6.DeleteSlidePageCommand.id, {
2216
+ unitId,
2217
+ slideId: slide.id
2218
+ }),
2219
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "13", height: "13", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3.2 4.5H12.8M6.2 4.5V3H9.8V4.5M4.6 4.5L5.2 13H10.8L11.4 4.5", strokeWidth: "1.3", strokeLinecap: "round" }) })
2220
+ }
2221
+ )
2222
+ ]
2223
+ }
2224
+ )
2225
+ ]
2226
+ },
2227
+ slide.id
2228
+ );
2229
+ };
2230
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "univer-slides-left-sidebar", children: [
2231
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "univer-slides-sorter-header", children: [
2232
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "univer-slides-new-btn-group", children: [
2233
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2234
+ "button",
2235
+ {
2236
+ type: "button",
2237
+ className: "univer-slides-primary-btn",
2238
+ onClick: () => handleAddSlide("titleAndContent"),
2239
+ children: [
2240
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 3V13M3 8H13", strokeWidth: "1.6", strokeLinecap: "round" }) }),
2241
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u65B0\u5EFA\u5E7B\u706F\u7247" })
2242
+ ]
2243
+ }
2244
+ ),
2245
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2246
+ "button",
2247
+ {
2248
+ type: "button",
2249
+ className: "univer-slides-split-caret",
2250
+ title: "\u9009\u62E9\u7248\u5F0F\u65B0\u5EFA\u5E7B\u706F\u7247",
2251
+ onClick: () => setLayoutMenuOpen((v) => !v),
2252
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "12", height: "12", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M4 6L8 10L12 6", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2253
+ }
2254
+ )
2255
+ ] }),
2256
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2257
+ "button",
2258
+ {
2259
+ type: "button",
2260
+ className: "univer-slides-sec-add-btn",
2261
+ title: "\u65B0\u5EFA\u7AE0\u8282\u5206\u7EC4",
2262
+ onClick: handleAddSection,
2263
+ children: [
2264
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M2 4.2H6L7.4 5.6H14V12.5H2V4.2Z", strokeWidth: "1.3", strokeLinejoin: "round" }) }),
2265
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7AE0\u8282\u5206\u7EC4" })
2266
+ ]
2267
+ }
2268
+ )
2269
+ ] }),
2270
+ layoutMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "univer-slides-layout-chooser", children: LAYOUT_OPTIONS.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2271
+ "button",
2272
+ {
2273
+ type: "button",
2274
+ className: "univer-slides-layout-option",
2275
+ onClick: () => handleAddSlide(opt.type),
2276
+ children: [
2277
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "univer-slides-layout-option-title", children: opt.label }),
2278
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "univer-slides-layout-option-desc", children: opt.desc })
2279
+ ]
2280
+ },
2281
+ opt.type
2282
+ )) }),
2283
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "univer-slides-sorter-scroll", children: effectiveSections.map((sec) => {
2284
+ const secSlides = sec.slideIds.map((id) => snapshot.slides[id]).filter((s) => Boolean(s));
2285
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "univer-slides-section-group", children: [
2286
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "univer-slides-section-bar", children: [
2287
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2288
+ "button",
2289
+ {
2290
+ type: "button",
2291
+ className: "univer-slides-section-toggle",
2292
+ onClick: () => handleToggleSection(sec),
2293
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "12", height: "12", fill: "none", stroke: "currentColor", children: sec.collapsed ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M6 4L10 8L6 12", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M4 6L8 10L12 6", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2294
+ }
2295
+ ),
2296
+ editingSecId === sec.id ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2297
+ "input",
2298
+ {
2299
+ className: "univer-slides-sec-input",
2300
+ value: editingSecTitle,
2301
+ autoFocus: true,
2302
+ onChange: (e) => setEditingSecTitle(e.target.value),
2303
+ onBlur: () => commitSectionTitle(sec.id),
2304
+ onKeyDown: (e) => {
2305
+ if (e.key === "Enter") commitSectionTitle(sec.id);
2306
+ }
2307
+ }
2308
+ ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2309
+ "span",
2310
+ {
2311
+ className: "univer-slides-section-title",
2312
+ onDoubleClick: () => {
2313
+ setEditingSecId(sec.id);
2314
+ setEditingSecTitle(sec.title);
2315
+ },
2316
+ title: "\u53CC\u51FB\u91CD\u547D\u540D\u7AE0\u8282",
2317
+ children: sec.title
2318
+ }
2319
+ ),
2320
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "univer-slides-section-count", children: secSlides.length }),
2321
+ snapshot.sections.length > 1 && sec.id !== "sec-virtual" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2322
+ "button",
2323
+ {
2324
+ type: "button",
2325
+ className: "univer-slides-icon-btn",
2326
+ title: "\u5220\u9664\u7AE0\u8282\uFF08\u4FDD\u7559\u5E7B\u706F\u7247\uFF09",
2327
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides6.DeleteSlideSectionCommand.id, {
2328
+ unitId,
2329
+ sectionId: sec.id
2330
+ }),
2331
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 16 16", width: "11", height: "11", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M4 4L12 12M12 4L4 12", strokeWidth: "1.4", strokeLinecap: "round" }) })
2332
+ }
2333
+ )
2334
+ ] }),
2335
+ !sec.collapsed && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "univer-slides-section-cards", children: secSlides.map((slide) => renderSlideCard(slide)) })
2336
+ ] }, sec.id);
2337
+ }) })
2338
+ ] });
2339
+ };
2340
+
2341
+ // src/views/presenter/SlidesPresenterModal.tsx
2342
+ var import_ui7 = require("@univerjs/ui");
2343
+ var import_univer_slides7 = require("@yudaocode/univer-slides");
2344
+ var import_react4 = require("react");
2345
+ var import_jsx_runtime5 = require("react/jsx-runtime");
2346
+ function formatElapsed(seconds) {
2347
+ const hrs = Math.floor(seconds / 3600);
2348
+ const mins = Math.floor(seconds % 3600 / 60);
2349
+ const secs = seconds % 60;
2350
+ return [hrs, mins, secs].map((n) => String(n).padStart(2, "0")).join(":");
2351
+ }
2352
+ var SlidesPresenterModal = (props) => {
2353
+ const selectionService = (0, import_ui7.useDependency)(import_univer_slides7.ISlideSelectionService);
2354
+ const ctx = useActiveSlideUnit();
2355
+ const snapshot = props.snapshot ?? ctx.snapshot;
2356
+ const isOpen = Boolean(props.snapshot || ctx.selection.presenterOpen);
2357
+ const mode = props.initialMode ?? ctx.selection.presenterMode;
2358
+ const [slideIdx, setSlideIdx] = (0, import_react4.useState)(
2359
+ props.initialIndex ?? ctx.selection.presenterSlideIndex ?? 0
2360
+ );
2361
+ const [animStep, setAnimStep] = (0, import_react4.useState)(999);
2362
+ const [notesFontSize, setNotesFontSize] = (0, import_react4.useState)(16);
2363
+ const [elapsedSec, setElapsedSec] = (0, import_react4.useState)(0);
2364
+ const [timerPaused, setTimerPaused] = (0, import_react4.useState)(false);
2365
+ const [toolMode, setToolMode] = (0, import_react4.useState)("pointer");
2366
+ const [penColor, setPenColor] = (0, import_react4.useState)("#ef4444");
2367
+ const [laserTrail, setLaserTrail] = (0, import_react4.useState)([]);
2368
+ const [inkBySlide, setInkBySlide] = (0, import_react4.useState)({});
2369
+ const [jumpGridOpen, setJumpGridOpen] = (0, import_react4.useState)(false);
2370
+ const drawingStrokeRef = (0, import_react4.useRef)(null);
2371
+ const stageBoxRef = (0, import_react4.useRef)(null);
2372
+ (0, import_react4.useEffect)(() => {
2373
+ setSlideIdx(props.initialIndex ?? ctx.selection.presenterSlideIndex ?? 0);
2374
+ }, [props.initialIndex, ctx.selection.presenterSlideIndex]);
2375
+ const visibleSlides = snapshot ? snapshot.slideOrder.map((id) => snapshot.slides[id]).filter((s) => Boolean(s && !s.hidden)) : [];
2376
+ const effectiveSlides = visibleSlides.length > 0 ? visibleSlides : snapshot && snapshot.slideOrder[0] && snapshot.slides[snapshot.slideOrder[0]] ? [snapshot.slides[snapshot.slideOrder[0]]] : [];
2377
+ const clampedIdx = Math.max(0, Math.min(effectiveSlides.length - 1, slideIdx));
2378
+ const currentSlide = effectiveSlides[clampedIdx] ?? null;
2379
+ const nextSlide = effectiveSlides[clampedIdx + 1] ?? null;
2380
+ const clickAnimations = (currentSlide?.animations ?? []).filter((a) => a.trigger === "onClick");
2381
+ const handleClose = (0, import_react4.useCallback)(() => {
2382
+ if (props.onExit) props.onExit();
2383
+ else selectionService.closePresenter();
2384
+ }, [props, selectionService]);
2385
+ const goNext = (0, import_react4.useCallback)(() => {
2386
+ if (animStep < clickAnimations.length) {
2387
+ setAnimStep((s) => s + 1);
2388
+ return;
2389
+ }
2390
+ if (clampedIdx < effectiveSlides.length - 1) {
2391
+ const nextIndex = clampedIdx + 1;
2392
+ const nextTarget = effectiveSlides[nextIndex];
2393
+ const nextClickCount = (nextTarget?.animations ?? []).filter(
2394
+ (a) => a.trigger === "onClick"
2395
+ ).length;
2396
+ setSlideIdx(nextIndex);
2397
+ selectionService.setPresenterSlideIndex(nextIndex);
2398
+ setAnimStep(nextClickCount > 0 ? 0 : 999);
2399
+ }
2400
+ }, [animStep, clickAnimations.length, clampedIdx, effectiveSlides, selectionService]);
2401
+ const goPrev = (0, import_react4.useCallback)(() => {
2402
+ if (clampedIdx > 0) {
2403
+ const prevIndex = clampedIdx - 1;
2404
+ setSlideIdx(prevIndex);
2405
+ selectionService.setPresenterSlideIndex(prevIndex);
2406
+ setAnimStep(999);
2407
+ }
2408
+ }, [clampedIdx, selectionService]);
2409
+ (0, import_react4.useEffect)(() => {
2410
+ if (!isOpen || timerPaused) return;
2411
+ const timer = setInterval(() => {
2412
+ setElapsedSec((s) => s + 1);
2413
+ }, 1e3);
2414
+ return () => clearInterval(timer);
2415
+ }, [isOpen, timerPaused]);
2416
+ (0, import_react4.useEffect)(() => {
2417
+ const advMs = currentSlide?.transition?.advanceAfterMs;
2418
+ if (!isOpen || timerPaused || !advMs || advMs <= 0) return;
2419
+ const t = setTimeout(() => {
2420
+ goNext();
2421
+ }, advMs);
2422
+ return () => clearTimeout(t);
2423
+ }, [isOpen, timerPaused, currentSlide?.id, currentSlide?.transition?.advanceAfterMs, goNext]);
2424
+ (0, import_react4.useEffect)(() => {
2425
+ if (!isOpen || typeof window === "undefined") return;
2426
+ const onKeyDown = (e) => {
2427
+ if (e.key === "Escape") {
2428
+ e.preventDefault();
2429
+ handleClose();
2430
+ } else if (e.key === "ArrowRight" || e.key === "ArrowDown" || e.key === " " || e.key === "PageDown") {
2431
+ e.preventDefault();
2432
+ goNext();
2433
+ } else if (e.key === "ArrowLeft" || e.key === "ArrowUp" || e.key === "PageUp") {
2434
+ e.preventDefault();
2435
+ goPrev();
2436
+ }
2437
+ };
2438
+ window.addEventListener("keydown", onKeyDown);
2439
+ return () => window.removeEventListener("keydown", onKeyDown);
2440
+ }, [isOpen, handleClose, goNext, goPrev]);
2441
+ if (!isOpen || !snapshot || !currentSlide) return null;
2442
+ const hiddenByAnimIds = new Set(
2443
+ clickAnimations.slice(animStep).filter((a) => a.category === "entrance").map((a) => a.elementId)
2444
+ );
2445
+ const filteredSlide = hiddenByAnimIds.size > 0 ? {
2446
+ ...currentSlide,
2447
+ elementOrder: currentSlide.elementOrder.filter((id) => !hiddenByAnimIds.has(id))
2448
+ } : currentSlide;
2449
+ const currentSvg = (0, import_univer_slides7.renderSlidePageToSvg)(filteredSlide, snapshot, clampedIdx + 1);
2450
+ const nextSvg = nextSlide ? (0, import_univer_slides7.renderSlidePageToSvg)(nextSlide, snapshot, clampedIdx + 2) : null;
2451
+ const transitionType = currentSlide.transition?.type ?? "fade";
2452
+ const currentStrokes = inkBySlide[currentSlide.id] ?? [];
2453
+ const getNormalizedCoords = (e) => {
2454
+ if (!stageBoxRef.current) return null;
2455
+ const r = stageBoxRef.current.getBoundingClientRect();
2456
+ if (r.width <= 0 || r.height <= 0) return null;
2457
+ return {
2458
+ x: (e.clientX - r.left) / r.width * 1e3,
2459
+ y: (e.clientY - r.top) / r.height * 562.5
2460
+ };
2461
+ };
2462
+ const handleStageMouseMove = (e) => {
2463
+ const pt = getNormalizedCoords(e);
2464
+ if (!pt) return;
2465
+ if (toolMode === "laser") {
2466
+ setLaserTrail((prev) => [...prev.slice(-10), pt]);
2467
+ } else if (toolMode === "pen" && drawingStrokeRef.current) {
2468
+ drawingStrokeRef.current.points.push(pt);
2469
+ setInkBySlide((prev) => ({
2470
+ ...prev,
2471
+ [currentSlide.id]: [...(prev[currentSlide.id] ?? []).slice(0, -1), { ...drawingStrokeRef.current }]
2472
+ }));
2473
+ }
2474
+ };
2475
+ const handleStageMouseDown = (e) => {
2476
+ if (toolMode === "pen") {
2477
+ const pt = getNormalizedCoords(e);
2478
+ if (!pt) return;
2479
+ const stroke = { color: penColor, points: [pt] };
2480
+ drawingStrokeRef.current = stroke;
2481
+ setInkBySlide((prev) => ({
2482
+ ...prev,
2483
+ [currentSlide.id]: [...prev[currentSlide.id] ?? [], stroke]
2484
+ }));
2485
+ } else if (toolMode === "pointer") {
2486
+ goNext();
2487
+ }
2488
+ };
2489
+ const handleStageMouseUp = () => {
2490
+ drawingStrokeRef.current = null;
2491
+ };
2492
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-presenter-overlay", role: "dialog", "aria-label": "\u5E7B\u706F\u7247\u6F14\u793A\u89C6\u56FE", children: [
2493
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-presenter-topbar", children: [
2494
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-presenter-left", children: [
2495
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "univer-slides-presenter-title", children: snapshot.name }),
2496
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "univer-slides-presenter-counter", children: [
2497
+ "\u7B2C ",
2498
+ clampedIdx + 1,
2499
+ " / ",
2500
+ effectiveSlides.length,
2501
+ " \u9875"
2502
+ ] }),
2503
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-timer-pill", children: [
2504
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: [
2505
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "8", cy: "8.5", r: "5.5", strokeWidth: "1.35" }),
2506
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M8 5.5V8.5L10 10M6 1.8H10", strokeWidth: "1.35", strokeLinecap: "round" })
2507
+ ] }),
2508
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "univer-slides-timer-digits", children: formatElapsed(elapsedSec) }),
2509
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2510
+ "button",
2511
+ {
2512
+ type: "button",
2513
+ className: "univer-slides-presenter-btn",
2514
+ onClick: () => setTimerPaused((p) => !p),
2515
+ children: timerPaused ? "\u7EE7\u7EED" : "\u6682\u505C"
2516
+ }
2517
+ ),
2518
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2519
+ "button",
2520
+ {
2521
+ type: "button",
2522
+ className: "univer-slides-presenter-btn",
2523
+ onClick: () => setElapsedSec(0),
2524
+ children: "\u91CD\u7F6E"
2525
+ }
2526
+ )
2527
+ ] })
2528
+ ] }),
2529
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-presenter-tools", children: [
2530
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2531
+ "button",
2532
+ {
2533
+ type: "button",
2534
+ className: `univer-slides-presenter-btn${mode === "presenter" ? " is-active" : ""}`,
2535
+ onClick: () => selectionService.openPresenter(
2536
+ mode === "presenter" ? "fullscreen" : "presenter",
2537
+ clampedIdx
2538
+ ),
2539
+ children: mode === "presenter" ? "\u5207\u6362\u7EAF\u5168\u5C4F\u653E\u6620" : "\u5207\u6362\u6F14\u8BB2\u8005\u53CC\u5C4F\u89C6\u56FE"
2540
+ }
2541
+ ),
2542
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2543
+ "button",
2544
+ {
2545
+ type: "button",
2546
+ className: `univer-slides-presenter-btn${toolMode === "laser" ? " is-laser" : ""}`,
2547
+ onClick: () => {
2548
+ setToolMode(toolMode === "laser" ? "pointer" : "laser");
2549
+ setLaserTrail([]);
2550
+ },
2551
+ children: [
2552
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { viewBox: "0 0 16 16", width: "13", height: "13", fill: "none", stroke: "currentColor", children: [
2553
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "8", cy: "8", r: "2.5", fill: "#ef4444", stroke: "none" }),
2554
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "8", cy: "8", r: "5.5", stroke: "#ef4444", strokeWidth: "1.2", strokeDasharray: "2 2" })
2555
+ ] }),
2556
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u6FC0\u5149\u7B14" })
2557
+ ]
2558
+ }
2559
+ ),
2560
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2561
+ "button",
2562
+ {
2563
+ type: "button",
2564
+ className: `univer-slides-presenter-btn${toolMode === "pen" ? " is-active" : ""}`,
2565
+ onClick: () => setToolMode(toolMode === "pen" ? "pointer" : "pen"),
2566
+ children: [
2567
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { viewBox: "0 0 16 16", width: "13", height: "13", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M11 2.5L13.5 5L5.5 13L2.5 13.8L3.3 10.8L11 2.5Z", strokeWidth: "1.3" }) }),
2568
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u753B\u7B14\u6279\u6CE8" })
2569
+ ]
2570
+ }
2571
+ ),
2572
+ toolMode === "pen" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-pen-colors", children: [
2573
+ ["#ef4444", "#facc15", "#38bdf8", "#34d399"].map((c) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2574
+ "button",
2575
+ {
2576
+ type: "button",
2577
+ className: `univer-slides-color-dot${penColor === c ? " is-active" : ""}`,
2578
+ style: { backgroundColor: c },
2579
+ onClick: () => setPenColor(c)
2580
+ },
2581
+ c
2582
+ )),
2583
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2584
+ "button",
2585
+ {
2586
+ type: "button",
2587
+ className: "univer-slides-presenter-btn",
2588
+ onClick: () => setInkBySlide((prev) => ({
2589
+ ...prev,
2590
+ [currentSlide.id]: []
2591
+ })),
2592
+ children: "\u6E05\u5C4F"
2593
+ }
2594
+ )
2595
+ ] }),
2596
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2597
+ "button",
2598
+ {
2599
+ type: "button",
2600
+ className: "univer-slides-presenter-btn",
2601
+ onClick: () => setJumpGridOpen((v) => !v),
2602
+ children: "\u9875\u9762\u603B\u89C8"
2603
+ }
2604
+ ),
2605
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "univer-slides-presenter-exit", onClick: handleClose, children: "\u7ED3\u675F\u653E\u6620 (Esc)" })
2606
+ ] })
2607
+ ] }),
2608
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `univer-slides-presenter-main is-${mode}`, children: [
2609
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-presenter-stage-col", children: [
2610
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2611
+ "div",
2612
+ {
2613
+ ref: stageBoxRef,
2614
+ className: `univer-slides-presenter-stage anim-transition-${transitionType}`,
2615
+ style: {
2616
+ aspectRatio: `${snapshot.slideSize.widthPt} / ${snapshot.slideSize.heightPt}`,
2617
+ cursor: toolMode === "laser" ? "none" : toolMode === "pen" ? "crosshair" : "pointer"
2618
+ },
2619
+ onMouseMove: handleStageMouseMove,
2620
+ onMouseDown: handleStageMouseDown,
2621
+ onMouseUp: handleStageMouseUp,
2622
+ onMouseLeave: () => {
2623
+ setLaserTrail([]);
2624
+ handleStageMouseUp();
2625
+ },
2626
+ children: [
2627
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2628
+ "div",
2629
+ {
2630
+ className: "univer-slides-presenter-svg-wrap",
2631
+ dangerouslySetInnerHTML: { __html: currentSvg }
2632
+ }
2633
+ ),
2634
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2635
+ "svg",
2636
+ {
2637
+ className: "univer-slides-ink-overlay",
2638
+ viewBox: "0 0 1000 562.5",
2639
+ preserveAspectRatio: "none",
2640
+ children: [
2641
+ currentStrokes.map((st, idx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2642
+ "polyline",
2643
+ {
2644
+ fill: "none",
2645
+ stroke: st.color,
2646
+ strokeWidth: 4,
2647
+ strokeLinecap: "round",
2648
+ strokeLinejoin: "round",
2649
+ points: st.points.map((p) => `${p.x.toFixed(1)},${p.y.toFixed(1)}`).join(" ")
2650
+ },
2651
+ idx
2652
+ )),
2653
+ toolMode === "laser" && laserTrail.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2654
+ laserTrail.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2655
+ "polyline",
2656
+ {
2657
+ fill: "none",
2658
+ stroke: "rgba(239, 68, 68, 0.55)",
2659
+ strokeWidth: 3.5,
2660
+ strokeLinecap: "round",
2661
+ points: laserTrail.map((p) => `${p.x.toFixed(1)},${p.y.toFixed(1)}`).join(" ")
2662
+ }
2663
+ ),
2664
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2665
+ "circle",
2666
+ {
2667
+ cx: laserTrail[laserTrail.length - 1].x,
2668
+ cy: laserTrail[laserTrail.length - 1].y,
2669
+ r: 9,
2670
+ fill: "rgba(239, 68, 68, 0.32)"
2671
+ }
2672
+ ),
2673
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2674
+ "circle",
2675
+ {
2676
+ cx: laserTrail[laserTrail.length - 1].x,
2677
+ cy: laserTrail[laserTrail.length - 1].y,
2678
+ r: 4.5,
2679
+ fill: "#ef4444"
2680
+ }
2681
+ )
2682
+ ] })
2683
+ ]
2684
+ }
2685
+ )
2686
+ ]
2687
+ },
2688
+ `${currentSlide.id}-${transitionType}`
2689
+ ),
2690
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-presenter-nav", children: [
2691
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2692
+ "button",
2693
+ {
2694
+ type: "button",
2695
+ className: "univer-slides-presenter-btn",
2696
+ disabled: clampedIdx <= 0,
2697
+ onClick: goPrev,
2698
+ children: "\u4E0A\u4E00\u9875"
2699
+ }
2700
+ ),
2701
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "univer-slides-presenter-progress", children: [
2702
+ currentSlide.title,
2703
+ clickAnimations.length > 0 && animStep < clickAnimations.length ? ` \xB7 \u5F85\u89E6\u53D1\u52A8\u753B (${animStep}/${clickAnimations.length})` : ""
2704
+ ] }),
2705
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2706
+ "button",
2707
+ {
2708
+ type: "button",
2709
+ className: "univer-slides-presenter-btn",
2710
+ disabled: clampedIdx >= effectiveSlides.length - 1 && animStep >= clickAnimations.length,
2711
+ onClick: goNext,
2712
+ children: "\u4E0B\u4E00\u9875"
2713
+ }
2714
+ )
2715
+ ] })
2716
+ ] }),
2717
+ mode === "presenter" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-presenter-side-col", children: [
2718
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-next-card", children: [
2719
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-next-label", children: [
2720
+ "\u4E0B\u4E00\u9875\u9884\u89C8 ",
2721
+ nextSlide ? `\u2014 ${nextSlide.title}` : "\uFF08\u5DF2\u662F\u6700\u540E\u4E00\u9875\uFF09"
2722
+ ] }),
2723
+ nextSvg ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2724
+ "div",
2725
+ {
2726
+ className: "univer-slides-next-preview",
2727
+ dangerouslySetInnerHTML: { __html: nextSvg }
2728
+ }
2729
+ ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "univer-slides-next-end", children: "\u6F14\u793A\u6587\u7A3F\u653E\u6620\u5373\u5C06\u7ED3\u675F" })
2730
+ ] }),
2731
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-teleprompter-card", children: [
2732
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-teleprompter-header", children: [
2733
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u6F14\u8BB2\u8005\u5907\u6CE8\u63D0\u8BCD\u5668" }),
2734
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "univer-slides-font-btns", children: [
2735
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2736
+ "button",
2737
+ {
2738
+ type: "button",
2739
+ className: "univer-slides-presenter-btn",
2740
+ onClick: () => setNotesFontSize((s) => Math.max(12, s - 2)),
2741
+ children: "A-"
2742
+ }
2743
+ ),
2744
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2745
+ "button",
2746
+ {
2747
+ type: "button",
2748
+ className: "univer-slides-presenter-btn",
2749
+ onClick: () => setNotesFontSize((s) => Math.min(28, s + 2)),
2750
+ children: "A+"
2751
+ }
2752
+ )
2753
+ ] })
2754
+ ] }),
2755
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2756
+ "div",
2757
+ {
2758
+ className: "univer-slides-teleprompter-body",
2759
+ style: { fontSize: `${notesFontSize}px` },
2760
+ children: currentSlide.speakerNotes?.trim() || "\uFF08\u672C\u9875\u6682\u65E0\u6F14\u8BB2\u8005\u5907\u6CE8\uFF09"
2761
+ }
2762
+ )
2763
+ ] })
2764
+ ] })
2765
+ ] }),
2766
+ jumpGridOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "univer-slides-jump-modal", onClick: () => setJumpGridOpen(false), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "univer-slides-jump-grid", onClick: (e) => e.stopPropagation(), children: effectiveSlides.map((s, idx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2767
+ "button",
2768
+ {
2769
+ type: "button",
2770
+ className: `univer-slides-jump-item${idx === clampedIdx ? " is-active" : ""}`,
2771
+ onClick: () => {
2772
+ setSlideIdx(idx);
2773
+ selectionService.setPresenterSlideIndex(idx);
2774
+ setAnimStep(999);
2775
+ setJumpGridOpen(false);
2776
+ },
2777
+ children: [
2778
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2779
+ "div",
2780
+ {
2781
+ className: "univer-slides-jump-thumb",
2782
+ dangerouslySetInnerHTML: {
2783
+ __html: (0, import_univer_slides7.renderSlidePageToSvg)(s, snapshot, idx + 1)
2784
+ }
2785
+ }
2786
+ ),
2787
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
2788
+ idx + 1,
2789
+ ". ",
2790
+ s.title
2791
+ ] })
2792
+ ]
2793
+ },
2794
+ s.id
2795
+ )) }) })
2796
+ ] });
2797
+ };
2798
+ var SlidesPresenterAndModalsHost = () => {
2799
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlidesPresenterModal, {});
2800
+ };
2801
+
2802
+ // src/views/stage/SlidesCanvasStage.tsx
2803
+ var import_core6 = require("@univerjs/core");
2804
+ var import_ui8 = require("@univerjs/ui");
2805
+ var import_univer_slides8 = require("@yudaocode/univer-slides");
2806
+ var import_react5 = require("react");
2807
+ var import_jsx_runtime6 = require("react/jsx-runtime");
2808
+ var SHAPE_CHOICES = [
2809
+ { kind: "rect", label: "\u77E9\u5F62" },
2810
+ { kind: "roundRect", label: "\u5706\u89D2\u77E9\u5F62" },
2811
+ { kind: "ellipse", label: "\u692D\u5706 / \u5706\u5F62" },
2812
+ { kind: "triangle", label: "\u4E09\u89D2\u5F62" },
2813
+ { kind: "diamond", label: "\u83F1\u5F62" },
2814
+ { kind: "parallelogram", label: "\u5E73\u884C\u56DB\u8FB9\u5F62" },
2815
+ { kind: "pentagon", label: "\u4E94\u8FB9\u5F62" },
2816
+ { kind: "hexagon", label: "\u516D\u8FB9\u5F62" },
2817
+ { kind: "octagon", label: "\u516B\u8FB9\u5F62" },
2818
+ { kind: "star5", label: "\u4E94\u89D2\u661F" },
2819
+ { kind: "rightArrow", label: "\u5411\u53F3\u7BAD\u5934" },
2820
+ { kind: "leftArrow", label: "\u5411\u5DE6\u7BAD\u5934" },
2821
+ { kind: "chevron", label: "\u71D5\u5C3E\u6D41\u7A0B\u5757" },
2822
+ { kind: "callout", label: "\u6C14\u6CE1\u6807\u6CE8\u6846" },
2823
+ { kind: "cloud", label: "\u4E91\u6735\u6846" },
2824
+ { kind: "plus", label: "\u5341\u5B57\u52A0\u53F7" }
2825
+ ];
2826
+ var CHART_CHOICES = [
2827
+ { kind: "column", label: "\u7C07\u72B6\u67F1\u5F62\u56FE" },
2828
+ { kind: "bar", label: "\u6C34\u5E73\u6761\u5F62\u56FE" },
2829
+ { kind: "line", label: "\u8D8B\u52BF\u6298\u7EBF\u56FE" },
2830
+ { kind: "combo", label: "\u67F1\u7EBF\u7EC4\u5408\u56FE" },
2831
+ { kind: "pie", label: "\u5360\u6BD4\u997C\u56FE" },
2832
+ { kind: "doughnut", label: "\u73AF\u5F62\u6307\u6807\u56FE" },
2833
+ { kind: "area", label: "\u9762\u79EF\u8D8B\u52BF\u56FE" },
2834
+ { kind: "radar", label: "\u591A\u7EF4\u96F7\u8FBE\u56FE" },
2835
+ { kind: "scatter", label: "\u6563\u70B9\u5206\u5E03\u56FE" }
2836
+ ];
2837
+ var SMARTART_CHOICES = [
2838
+ { kind: "process", label: "\u9012\u8FDB\u6D41\u7A0B\u56FE (Process)" },
2839
+ { kind: "cycle", label: "\u95ED\u73AF\u5FAA\u73AF\u56FE (Cycle)" },
2840
+ { kind: "hierarchy", label: "\u7EC4\u7EC7\u67B6\u6784\u56FE (Hierarchy)" },
2841
+ { kind: "list", label: "\u5206\u7EC4\u5217\u8868\u56FE (List)" },
2842
+ { kind: "pyramid", label: "\u6218\u7565\u91D1\u5B57\u5854 (Pyramid)" }
2843
+ ];
2844
+ var LAYOUT_CHOICES = [
2845
+ { kind: "title", label: "\u6807\u9898\u5E7B\u706F\u7247" },
2846
+ { kind: "titleAndContent", label: "\u6807\u9898\u548C\u5185\u5BB9" },
2847
+ { kind: "sectionHeader", label: "\u8282\u6807\u9898" },
2848
+ { kind: "twoColumn", label: "\u4E24\u680F\u5185\u5BB9" },
2849
+ { kind: "comparison", label: "\u5BF9\u6BD4\u7248\u5F0F" },
2850
+ { kind: "blank", label: "\u7A7A\u767D\u7248\u5F0F" }
2851
+ ];
2852
+ var TRANSITION_CHOICES = [
2853
+ { kind: "none", label: "\u65E0\u5207\u6362" },
2854
+ { kind: "fade", label: "\u5E73\u6ED1\u6DE1\u5165 (Fade)" },
2855
+ { kind: "push", label: "\u63A8\u5165\u5207\u6362 (Push)" },
2856
+ { kind: "wipe", label: "\u64E6\u9664\u5207\u6362 (Wipe)" },
2857
+ { kind: "split", label: "\u5206\u5272\u5C55\u5F00 (Split)" },
2858
+ { kind: "zoom", label: "\u7F29\u653E\u805A\u7126 (Zoom)" },
2859
+ { kind: "morph", label: "\u5E73\u6ED1\u53D8\u5F62 (Morph)" }
2860
+ ];
2861
+ var SlidesCanvasStage = () => {
2862
+ const commandService = (0, import_ui8.useDependency)(import_core6.ICommandService);
2863
+ const selectionService = (0, import_ui8.useDependency)(import_univer_slides8.ISlideSelectionService);
2864
+ const { unit, snapshot, selection, activeSlide, activeSlideIndex } = useActiveSlideUnit();
2865
+ const [openMenu, setOpenMenu] = (0, import_react5.useState)(null);
2866
+ const [snapGuides, setSnapGuides] = (0, import_react5.useState)([]);
2867
+ const [findQuery, setFindQuery] = (0, import_react5.useState)("");
2868
+ const [replaceQuery, setReplaceQuery] = (0, import_react5.useState)("");
2869
+ const [matchCase, setMatchCase] = (0, import_react5.useState)(false);
2870
+ const canvasRef = (0, import_react5.useRef)(null);
2871
+ if (!unit || !snapshot || !activeSlide) {
2872
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "univer-slides-stage-empty", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u8BF7\u65B0\u5EFA\u6216\u6253\u5F00\u5E7B\u706F\u7247\u6587\u7A3F" }) });
2873
+ }
2874
+ const unitId = unit.getUnitId();
2875
+ const slideW = snapshot.slideSize.widthPt || 960;
2876
+ const slideH = snapshot.slideSize.heightPt || 540;
2877
+ const zoom = selection.zoom || 0.85;
2878
+ const selectedSet = new Set(selection.selectedElementIds);
2879
+ const insertElement = (elementType, extra) => {
2880
+ commandService.syncExecuteCommand(import_univer_slides8.AddSlideElementCommand.id, {
2881
+ unitId,
2882
+ slideId: activeSlide.id,
2883
+ elementType,
2884
+ element: extra
2885
+ });
2886
+ setOpenMenu(null);
2887
+ };
2888
+ const handleUploadImage = () => {
2889
+ if (typeof document === "undefined") {
2890
+ insertElement("image");
2891
+ return;
2892
+ }
2893
+ const input = document.createElement("input");
2894
+ input.type = "file";
2895
+ input.accept = "image/*";
2896
+ input.onchange = () => {
2897
+ const file = input.files?.[0];
2898
+ if (!file) return;
2899
+ const reader = new FileReader();
2900
+ reader.onload = () => {
2901
+ if (typeof reader.result === "string") {
2902
+ insertElement("image", {
2903
+ name: file.name,
2904
+ src: reader.result
2905
+ });
2906
+ }
2907
+ };
2908
+ reader.readAsDataURL(file);
2909
+ };
2910
+ input.click();
2911
+ };
2912
+ const startDragMove = (e, targetEl) => {
2913
+ if (targetEl.locked || selection.editingElementId === targetEl.id || selection.editingTableCell?.elementId === targetEl.id) {
2914
+ return;
2915
+ }
2916
+ e.stopPropagation();
2917
+ let nextSelected = selection.selectedElementIds;
2918
+ if (e.shiftKey) {
2919
+ nextSelected = selectedSet.has(targetEl.id) ? nextSelected.filter((id) => id !== targetEl.id) : [...nextSelected, targetEl.id];
2920
+ selectionService.selectElements(nextSelected);
2921
+ } else if (!selectedSet.has(targetEl.id)) {
2922
+ nextSelected = [targetEl.id];
2923
+ selectionService.selectElements(nextSelected);
2924
+ }
2925
+ const startClientX = e.clientX;
2926
+ const startClientY = e.clientY;
2927
+ const movingIds = nextSelected.filter((id) => activeSlide.elements[id] && !activeSlide.elements[id].locked);
2928
+ const initialBoxes = /* @__PURE__ */ new Map();
2929
+ for (const id of movingIds) {
2930
+ const el = activeSlide.elements[id];
2931
+ initialBoxes.set(id, { x: el.x, y: el.y, w: el.width, h: el.height });
2932
+ }
2933
+ const otherElements = Object.values(activeSlide.elements).filter(
2934
+ (el) => !movingIds.includes(el.id) && !el.hidden
2935
+ );
2936
+ const onMove = (ev) => {
2937
+ let dx = (ev.clientX - startClientX) / zoom;
2938
+ let dy = (ev.clientY - startClientY) / zoom;
2939
+ const guides = [];
2940
+ if (selection.snapEnabled && movingIds.length === 1) {
2941
+ const box = initialBoxes.get(movingIds[0]);
2942
+ const candX = box.x + dx;
2943
+ const candY = box.y + dy;
2944
+ const candCx = candX + box.w / 2;
2945
+ const candCy = candY + box.h / 2;
2946
+ const threshold = 6;
2947
+ if (Math.abs(candCx - slideW / 2) <= threshold) {
2948
+ dx = slideW / 2 - box.w / 2 - box.x;
2949
+ guides.push({ axis: "x", posPt: slideW / 2 });
2950
+ }
2951
+ if (Math.abs(candCy - slideH / 2) <= threshold) {
2952
+ dy = slideH / 2 - box.h / 2 - box.y;
2953
+ guides.push({ axis: "y", posPt: slideH / 2 });
2954
+ }
2955
+ for (const other of otherElements) {
2956
+ if (Math.abs(candX - other.x) <= threshold) {
2957
+ dx = other.x - box.x;
2958
+ guides.push({ axis: "x", posPt: other.x });
2959
+ } else if (Math.abs(candCx - (other.x + other.width / 2)) <= threshold) {
2960
+ dx = other.x + other.width / 2 - box.w / 2 - box.x;
2961
+ guides.push({ axis: "x", posPt: other.x + other.width / 2 });
2962
+ }
2963
+ if (Math.abs(candY - other.y) <= threshold) {
2964
+ dy = other.y - box.y;
2965
+ guides.push({ axis: "y", posPt: other.y });
2966
+ } else if (Math.abs(candCy - (other.y + other.height / 2)) <= threshold) {
2967
+ dy = other.y + other.height / 2 - box.h / 2 - box.y;
2968
+ guides.push({ axis: "y", posPt: other.y + other.height / 2 });
2969
+ }
2970
+ }
2971
+ }
2972
+ setSnapGuides(guides);
2973
+ if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5) return;
2974
+ commandService.syncExecuteCommand(import_univer_slides8.UpdateSlideElementsCommand.id, {
2975
+ unitId,
2976
+ slideId: activeSlide.id,
2977
+ updates: movingIds.map((id) => {
2978
+ const init = initialBoxes.get(id);
2979
+ return {
2980
+ id,
2981
+ patch: {
2982
+ x: Math.round(init.x + dx),
2983
+ y: Math.round(init.y + dy)
2984
+ }
2985
+ };
2986
+ })
2987
+ });
2988
+ };
2989
+ const onUp = () => {
2990
+ setSnapGuides([]);
2991
+ window.removeEventListener("mousemove", onMove);
2992
+ window.removeEventListener("mouseup", onUp);
2993
+ };
2994
+ window.addEventListener("mousemove", onMove);
2995
+ window.addEventListener("mouseup", onUp);
2996
+ };
2997
+ const startResize = (e, el, dir) => {
2998
+ e.stopPropagation();
2999
+ e.preventDefault();
3000
+ const startX = e.clientX;
3001
+ const startY = e.clientY;
3002
+ const orig = { x: el.x, y: el.y, w: el.width, h: el.height };
3003
+ const onMove = (ev) => {
3004
+ const dx = (ev.clientX - startX) / zoom;
3005
+ const dy = (ev.clientY - startY) / zoom;
3006
+ let nx = orig.x;
3007
+ let ny = orig.y;
3008
+ let nw = orig.w;
3009
+ let nh = orig.h;
3010
+ if (dir.includes("e")) nw = Math.max(24, orig.w + dx);
3011
+ if (dir.includes("s")) nh = Math.max(24, orig.h + dy);
3012
+ if (dir.includes("w")) {
3013
+ nw = Math.max(24, orig.w - dx);
3014
+ nx = orig.x + (orig.w - nw);
3015
+ }
3016
+ if (dir.includes("n")) {
3017
+ nh = Math.max(24, orig.h - dy);
3018
+ ny = orig.y + (orig.h - nh);
3019
+ }
3020
+ commandService.syncExecuteCommand(import_univer_slides8.UpdateSlideElementsCommand.id, {
3021
+ unitId,
3022
+ slideId: activeSlide.id,
3023
+ updates: [
3024
+ {
3025
+ id: el.id,
3026
+ patch: {
3027
+ x: Math.round(nx),
3028
+ y: Math.round(ny),
3029
+ width: Math.round(nw),
3030
+ height: Math.round(nh)
3031
+ }
3032
+ }
3033
+ ]
3034
+ });
3035
+ };
3036
+ const onUp = () => {
3037
+ window.removeEventListener("mousemove", onMove);
3038
+ window.removeEventListener("mouseup", onUp);
3039
+ };
3040
+ window.addEventListener("mousemove", onMove);
3041
+ window.addEventListener("mouseup", onUp);
3042
+ };
3043
+ const startRotate = (e, el) => {
3044
+ e.stopPropagation();
3045
+ e.preventDefault();
3046
+ if (!canvasRef.current) return;
3047
+ const rect = canvasRef.current.getBoundingClientRect();
3048
+ const centerX = rect.left + (el.x + el.width / 2) * zoom;
3049
+ const centerY = rect.top + (el.y + el.height / 2) * zoom;
3050
+ const onMove = (ev) => {
3051
+ const angleRad = Math.atan2(ev.clientY - centerY, ev.clientX - centerX);
3052
+ const deg = Math.round((angleRad * 180 / Math.PI + 90 + 360) % 360);
3053
+ commandService.syncExecuteCommand(import_univer_slides8.UpdateSlideElementsCommand.id, {
3054
+ unitId,
3055
+ slideId: activeSlide.id,
3056
+ updates: [{ id: el.id, patch: { rotation: deg } }]
3057
+ });
3058
+ };
3059
+ const onUp = () => {
3060
+ window.removeEventListener("mousemove", onMove);
3061
+ window.removeEventListener("mouseup", onUp);
3062
+ };
3063
+ window.addEventListener("mousemove", onMove);
3064
+ window.addEventListener("mouseup", onUp);
3065
+ };
3066
+ const startNotesResize = (e) => {
3067
+ e.preventDefault();
3068
+ const startY = e.clientY;
3069
+ const origH = selection.speakerNotesHeight;
3070
+ const onMove = (ev) => {
3071
+ selectionService.setSpeakerNotesHeight(origH - (ev.clientY - startY));
3072
+ };
3073
+ const onUp = () => {
3074
+ window.removeEventListener("mousemove", onMove);
3075
+ window.removeEventListener("mouseup", onUp);
3076
+ };
3077
+ window.addEventListener("mousemove", onMove);
3078
+ window.addEventListener("mouseup", onUp);
3079
+ };
3080
+ const bg = activeSlide.background ?? snapshot.masters[0]?.background ?? {
3081
+ type: "solid",
3082
+ color: snapshot.theme.colors.background
3083
+ };
3084
+ const slideBgStyle = bg.type === "gradient" && bg.gradientFrom && bg.gradientTo ? {
3085
+ backgroundImage: `linear-gradient(${bg.gradientAngleDeg ?? 135}deg, ${bg.gradientFrom}, ${bg.gradientTo})`
3086
+ } : bg.type === "image" && bg.imageSrc ? {
3087
+ backgroundColor: bg.color || "#ffffff",
3088
+ backgroundImage: `url(${bg.imageSrc})`,
3089
+ backgroundSize: "cover",
3090
+ backgroundPosition: "center"
3091
+ } : {
3092
+ backgroundColor: bg.color || snapshot.theme.colors.background || "#ffffff"
3093
+ };
3094
+ const matchCount = findQuery ? (0, import_univer_slides8.countSlideTextMatches)(snapshot, findQuery, { matchCase }) : 0;
3095
+ const renderElementNode = (el) => {
3096
+ if (el.hidden) return null;
3097
+ const isSelected = selectedSet.has(el.id);
3098
+ const isEditing = selection.editingElementId === el.id;
3099
+ if (el.type === "connector") {
3100
+ const geom = (0, import_univer_slides8.resolveConnectorEndpoints)(el, activeSlide.elements);
3101
+ const markerId = `stage-conn-arrow-${el.id}`;
3102
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3103
+ "svg",
3104
+ {
3105
+ className: `univer-slides-connector-layer${isSelected ? " is-selected" : ""}`,
3106
+ viewBox: `0 0 ${slideW} ${slideH}`,
3107
+ style: {
3108
+ position: "absolute",
3109
+ inset: 0,
3110
+ width: "100%",
3111
+ height: "100%",
3112
+ pointerEvents: "none"
3113
+ },
3114
+ children: [
3115
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("marker", { id: markerId, markerWidth: "8", markerHeight: "8", refX: "7", refY: "4", orient: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M0,0 L8,4 L0,8 Z", fill: el.strokeColor }) }) }),
3116
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3117
+ "path",
3118
+ {
3119
+ d: geom.pathD,
3120
+ fill: "none",
3121
+ stroke: "transparent",
3122
+ strokeWidth: 14,
3123
+ style: { pointerEvents: "stroke", cursor: "pointer" },
3124
+ onClick: (ev) => {
3125
+ ev.stopPropagation();
3126
+ selectionService.selectElements([el.id]);
3127
+ }
3128
+ }
3129
+ ),
3130
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3131
+ "path",
3132
+ {
3133
+ d: geom.pathD,
3134
+ fill: "none",
3135
+ stroke: el.strokeColor,
3136
+ strokeWidth: el.strokeWidth || 2,
3137
+ strokeDasharray: el.strokeDash === "dashed" ? "7 4" : el.strokeDash === "dotted" ? "2 3" : void 0,
3138
+ markerEnd: el.endArrow ? `url(#${markerId})` : void 0
3139
+ }
3140
+ ),
3141
+ el.label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3142
+ "text",
3143
+ {
3144
+ x: geom.midX,
3145
+ y: geom.midY - 6,
3146
+ textAnchor: "middle",
3147
+ fontSize: 12,
3148
+ fontWeight: 600,
3149
+ fill: el.labelColor || el.strokeColor,
3150
+ children: el.label
3151
+ }
3152
+ ),
3153
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
3154
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: geom.x1, cy: geom.y1, r: 4.5, fill: "#ffffff", stroke: "#2563eb", strokeWidth: 2 }),
3155
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: geom.x2, cy: geom.y2, r: 4.5, fill: "#ffffff", stroke: "#2563eb", strokeWidth: 2 })
3156
+ ] })
3157
+ ]
3158
+ },
3159
+ el.id
3160
+ );
3161
+ }
3162
+ const wrapperStyle = {
3163
+ position: "absolute",
3164
+ left: `${el.x}px`,
3165
+ top: `${el.y}px`,
3166
+ width: `${el.width}px`,
3167
+ height: `${el.height}px`,
3168
+ transform: el.rotation ? `rotate(${el.rotation}deg)` : void 0,
3169
+ opacity: el.opacity ?? 1,
3170
+ cursor: isEditing ? "text" : el.locked ? "default" : "move",
3171
+ boxSizing: "border-box"
3172
+ };
3173
+ let content = null;
3174
+ if (el.type === "text") {
3175
+ const textEl = el;
3176
+ const isWordArt = Boolean(textEl.wordArt?.enabled);
3177
+ const lines = (textEl.text || "").split("\n");
3178
+ const vJustify = textEl.verticalAlign === "middle" ? "center" : textEl.verticalAlign === "bottom" ? "flex-end" : "flex-start";
3179
+ if (isEditing) {
3180
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3181
+ "textarea",
3182
+ {
3183
+ className: "univer-slides-inline-textarea",
3184
+ autoFocus: true,
3185
+ value: textEl.text,
3186
+ style: {
3187
+ fontSize: `${textEl.fontSize ?? 18}px`,
3188
+ fontWeight: textEl.fontWeight ?? "normal",
3189
+ fontStyle: textEl.italic ? "italic" : "normal",
3190
+ textAlign: textEl.align ?? "left",
3191
+ color: textEl.color || snapshot.theme.colors.text
3192
+ },
3193
+ onChange: (ev) => commandService.syncExecuteCommand(import_univer_slides8.UpdateSlideElementsCommand.id, {
3194
+ unitId,
3195
+ slideId: activeSlide.id,
3196
+ updates: [{ id: textEl.id, patch: { text: ev.target.value } }]
3197
+ }),
3198
+ onBlur: () => selectionService.setEditingElement(null),
3199
+ onKeyDown: (ev) => {
3200
+ if (ev.key === "Escape") selectionService.setEditingElement(null);
3201
+ }
3202
+ }
3203
+ );
3204
+ } else {
3205
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3206
+ "div",
3207
+ {
3208
+ className: "univer-slides-text-box",
3209
+ style: {
3210
+ width: "100%",
3211
+ height: "100%",
3212
+ display: "flex",
3213
+ flexDirection: "column",
3214
+ justifyContent: vJustify,
3215
+ padding: `${textEl.paddingPt ?? 6}px`,
3216
+ backgroundColor: textEl.fillColor || "transparent",
3217
+ border: textEl.strokeColor && (textEl.strokeWidth ?? 0) > 0 ? `${textEl.strokeWidth}px solid ${textEl.strokeColor}` : "none",
3218
+ borderRadius: `${textEl.borderRadius ?? 4}px`,
3219
+ fontFamily: textEl.fontFamily || snapshot.theme.minorFont,
3220
+ fontSize: `${textEl.fontSize ?? 18}px`,
3221
+ fontWeight: textEl.fontWeight ?? "normal",
3222
+ fontStyle: textEl.italic ? "italic" : "normal",
3223
+ textDecoration: textEl.underline ? "underline" : "none",
3224
+ textAlign: textEl.align ?? "left",
3225
+ lineHeight: textEl.lineHeight ?? 1.4,
3226
+ color: textEl.color || snapshot.theme.colors.text,
3227
+ boxSizing: "border-box",
3228
+ overflow: "hidden"
3229
+ },
3230
+ children: lines.map((line, lIdx) => {
3231
+ const prefix = textEl.bullet ? textEl.bullet === "number" ? `${lIdx + 1}. ` : textEl.bullet === "square" ? "\u25AA " : "\u2022 " : "";
3232
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3233
+ "div",
3234
+ {
3235
+ style: isWordArt && textEl.wordArt ? {
3236
+ backgroundImage: `linear-gradient(${textEl.wordArt.gradientAngleDeg ?? 0}deg, ${textEl.wordArt.gradientFrom}, ${textEl.wordArt.gradientTo})`,
3237
+ WebkitBackgroundClip: "text",
3238
+ WebkitTextFillColor: "transparent",
3239
+ filter: textEl.wordArt.shadowColor ? `drop-shadow(${textEl.wordArt.shadowOffsetX ?? 0}px ${textEl.wordArt.shadowOffsetY ?? 3}px ${textEl.wordArt.shadowBlur ?? 5}px ${textEl.wordArt.shadowColor})` : void 0
3240
+ } : void 0,
3241
+ children: [
3242
+ prefix,
3243
+ line || "\xA0"
3244
+ ]
3245
+ },
3246
+ lIdx
3247
+ );
3248
+ })
3249
+ }
3250
+ );
3251
+ }
3252
+ } else if (el.type === "shape") {
3253
+ const shapeEl = el;
3254
+ const pathD = (0, import_univer_slides8.getShapeSvgPath)(
3255
+ shapeEl.shapeType,
3256
+ shapeEl.width,
3257
+ shapeEl.height,
3258
+ shapeEl.cornerRadius ?? 8
3259
+ );
3260
+ const gradId = `shape-grad-${shapeEl.id}`;
3261
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-shape-box", style: { width: "100%", height: "100%", position: "relative" }, children: [
3262
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3263
+ "svg",
3264
+ {
3265
+ viewBox: `0 0 ${shapeEl.width} ${shapeEl.height}`,
3266
+ width: "100%",
3267
+ height: "100%",
3268
+ style: { position: "absolute", inset: 0, overflow: "visible" },
3269
+ children: [
3270
+ shapeEl.gradientFrom && shapeEl.gradientTo && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("linearGradient", { id: gradId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
3271
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { offset: "0%", stopColor: shapeEl.gradientFrom }),
3272
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { offset: "100%", stopColor: shapeEl.gradientTo })
3273
+ ] }) }),
3274
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3275
+ "path",
3276
+ {
3277
+ d: pathD,
3278
+ fill: shapeEl.gradientFrom && shapeEl.gradientTo ? `url(#${gradId})` : shapeEl.fillColor || snapshot.theme.colors.accent1,
3279
+ stroke: shapeEl.strokeWidth > 0 ? shapeEl.strokeColor : "none",
3280
+ strokeWidth: shapeEl.strokeWidth,
3281
+ strokeDasharray: shapeEl.strokeDash === "dashed" ? "6 4" : shapeEl.strokeDash === "dotted" ? "2 3" : void 0
3282
+ }
3283
+ )
3284
+ ]
3285
+ }
3286
+ ),
3287
+ isEditing ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3288
+ "textarea",
3289
+ {
3290
+ className: "univer-slides-inline-textarea",
3291
+ autoFocus: true,
3292
+ value: shapeEl.text ?? "",
3293
+ style: {
3294
+ position: "relative",
3295
+ zIndex: 2,
3296
+ color: shapeEl.textColor || "#ffffff",
3297
+ fontSize: `${shapeEl.fontSize ?? 15}px`,
3298
+ fontWeight: shapeEl.fontWeight ?? "bold",
3299
+ textAlign: shapeEl.textAlign ?? "center"
3300
+ },
3301
+ onChange: (ev) => commandService.syncExecuteCommand(import_univer_slides8.UpdateSlideElementsCommand.id, {
3302
+ unitId,
3303
+ slideId: activeSlide.id,
3304
+ updates: [{ id: shapeEl.id, patch: { text: ev.target.value } }]
3305
+ }),
3306
+ onBlur: () => selectionService.setEditingElement(null)
3307
+ }
3308
+ ) : shapeEl.text && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3309
+ "div",
3310
+ {
3311
+ style: {
3312
+ position: "relative",
3313
+ zIndex: 1,
3314
+ width: "100%",
3315
+ height: "100%",
3316
+ display: "flex",
3317
+ alignItems: "center",
3318
+ justifyContent: "center",
3319
+ padding: "8px",
3320
+ boxSizing: "border-box",
3321
+ textAlign: shapeEl.textAlign ?? "center",
3322
+ color: shapeEl.textColor || "#ffffff",
3323
+ fontSize: `${shapeEl.fontSize ?? 15}px`,
3324
+ fontWeight: shapeEl.fontWeight ?? "bold",
3325
+ whiteSpace: "pre-line"
3326
+ },
3327
+ children: shapeEl.text
3328
+ }
3329
+ )
3330
+ ] });
3331
+ } else if (el.type === "table") {
3332
+ const tbl = el;
3333
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3334
+ "table",
3335
+ {
3336
+ className: "univer-slides-stage-table",
3337
+ style: {
3338
+ width: "100%",
3339
+ height: "100%",
3340
+ borderCollapse: "collapse",
3341
+ tableLayout: "fixed"
3342
+ },
3343
+ children: [
3344
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("colgroup", { children: Array.from({ length: tbl.cols }, (_, c) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("col", { style: { width: `${tbl.colWidths[c] ?? tbl.width / tbl.cols}px` } }, c)) }),
3345
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("tbody", { children: Array.from({ length: tbl.rows }, (_, r) => {
3346
+ const isHeader = tbl.headerRow !== false && r === 0;
3347
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("tr", { style: { height: `${tbl.rowHeights[r] ?? tbl.height / tbl.rows}px` }, children: Array.from({ length: tbl.cols }, (__, c) => {
3348
+ const cell = tbl.cells[r]?.[c];
3349
+ if (cell?.mergedInto) return null;
3350
+ const isCellEditing = selection.editingTableCell?.elementId === tbl.id && selection.editingTableCell.row === r && selection.editingTableCell.col === c;
3351
+ const bg2 = cell?.bg || (isHeader ? tbl.headerBg || snapshot.theme.colors.primary : r % 2 === 1 ? tbl.zebraBg || "#f8fafc" : "#ffffff");
3352
+ const fg = cell?.color || (isHeader ? tbl.headerColor || "#ffffff" : snapshot.theme.colors.text);
3353
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3354
+ "td",
3355
+ {
3356
+ rowSpan: cell?.rowSpan,
3357
+ colSpan: cell?.colSpan,
3358
+ onDoubleClick: (ev) => {
3359
+ ev.stopPropagation();
3360
+ selectionService.selectElements([tbl.id]);
3361
+ selectionService.setEditingTableCell({ elementId: tbl.id, row: r, col: c });
3362
+ },
3363
+ style: {
3364
+ backgroundColor: bg2,
3365
+ color: fg,
3366
+ border: `1px solid ${tbl.borderColor || "#cbd5e1"}`,
3367
+ padding: "4px 8px",
3368
+ fontSize: `${cell?.fontSize ?? 12}px`,
3369
+ fontWeight: cell?.bold || isHeader ? 700 : 400,
3370
+ fontStyle: cell?.italic ? "italic" : "normal",
3371
+ textAlign: cell?.align ?? "left",
3372
+ verticalAlign: "middle"
3373
+ },
3374
+ children: isCellEditing ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3375
+ "input",
3376
+ {
3377
+ className: "univer-slides-cell-input",
3378
+ autoFocus: true,
3379
+ value: cell?.text ?? "",
3380
+ onChange: (ev) => {
3381
+ const clonedCells = import_core6.Tools.deepClone(tbl.cells);
3382
+ if (!clonedCells[r]) clonedCells[r] = [];
3383
+ clonedCells[r][c] = {
3384
+ ...clonedCells[r][c] ?? {},
3385
+ text: ev.target.value
3386
+ };
3387
+ commandService.syncExecuteCommand(import_univer_slides8.UpdateSlideElementsCommand.id, {
3388
+ unitId,
3389
+ slideId: activeSlide.id,
3390
+ updates: [{ id: tbl.id, patch: { cells: clonedCells } }]
3391
+ });
3392
+ },
3393
+ onBlur: () => selectionService.setEditingTableCell(null),
3394
+ onKeyDown: (ev) => {
3395
+ if (ev.key === "Enter" || ev.key === "Escape") {
3396
+ selectionService.setEditingTableCell(null);
3397
+ }
3398
+ }
3399
+ }
3400
+ ) : cell?.text ?? ""
3401
+ },
3402
+ c
3403
+ );
3404
+ }) }, r);
3405
+ }) })
3406
+ ]
3407
+ }
3408
+ );
3409
+ } else if (el.type === "chart") {
3410
+ const svgMarkup = (0, import_univer_slides8.renderSlideChartToSvg)(el, snapshot.theme);
3411
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3412
+ "div",
3413
+ {
3414
+ className: "univer-slides-vector-host",
3415
+ style: { width: "100%", height: "100%" },
3416
+ dangerouslySetInnerHTML: { __html: svgMarkup }
3417
+ }
3418
+ );
3419
+ } else if (el.type === "smartArt") {
3420
+ const svgMarkup = (0, import_univer_slides8.renderSlideSmartArtToSvg)(el, snapshot.theme);
3421
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3422
+ "div",
3423
+ {
3424
+ className: "univer-slides-vector-host",
3425
+ style: { width: "100%", height: "100%" },
3426
+ dangerouslySetInnerHTML: { __html: svgMarkup }
3427
+ }
3428
+ );
3429
+ } else if (el.type === "image" || el.type === "svg") {
3430
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3431
+ "img",
3432
+ {
3433
+ src: el.src,
3434
+ alt: el.altText || el.name || "slide-media",
3435
+ draggable: false,
3436
+ style: {
3437
+ width: "100%",
3438
+ height: "100%",
3439
+ objectFit: el.fit ?? "contain",
3440
+ borderRadius: `${el.borderRadius ?? 0}px`,
3441
+ pointerEvents: "none"
3442
+ }
3443
+ }
3444
+ );
3445
+ } else if (el.type === "codeBlock") {
3446
+ const dark = el.codeTheme !== "light";
3447
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3448
+ "div",
3449
+ {
3450
+ style: {
3451
+ width: "100%",
3452
+ height: "100%",
3453
+ backgroundColor: dark ? "#0f172a" : "#f8fafc",
3454
+ color: dark ? "#e2e8f0" : "#0f172a",
3455
+ borderRadius: "8px",
3456
+ border: "1px solid #334155",
3457
+ padding: "10px 12px",
3458
+ boxSizing: "border-box",
3459
+ fontFamily: "Menlo, Monaco, Consolas, monospace",
3460
+ fontSize: `${el.fontSize ?? 12}px`,
3461
+ overflow: "hidden"
3462
+ },
3463
+ children: [
3464
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: "10px", fontWeight: 700, color: "#38bdf8", marginBottom: "6px" }, children: el.language.toUpperCase() }),
3465
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("pre", { style: { margin: 0, whiteSpace: "pre-wrap" }, children: el.code })
3466
+ ]
3467
+ }
3468
+ );
3469
+ } else if (el.type === "sheetEmbed") {
3470
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3471
+ "div",
3472
+ {
3473
+ style: {
3474
+ width: "100%",
3475
+ height: "100%",
3476
+ backgroundColor: "#ffffff",
3477
+ border: `1.5px solid ${el.accentColor || "#059669"}`,
3478
+ borderRadius: "6px",
3479
+ overflow: "hidden",
3480
+ display: "flex",
3481
+ flexDirection: "column"
3482
+ },
3483
+ children: [
3484
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3485
+ "div",
3486
+ {
3487
+ style: {
3488
+ backgroundColor: el.accentColor || "#059669",
3489
+ color: "#ffffff",
3490
+ padding: "4px 10px",
3491
+ fontSize: "11px",
3492
+ fontWeight: 700
3493
+ },
3494
+ children: el.title || "\u7535\u5B50\u8868\u683C\u5F15\u7528\u5FEB\u7167"
3495
+ }
3496
+ ),
3497
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("table", { style: { width: "100%", borderCollapse: "collapse", fontSize: "11px", flex: 1 }, children: [
3498
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("tr", { style: { backgroundColor: "#ecfdf5" }, children: el.headers.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("th", { style: { border: "1px solid #d1fae5", padding: "3px 6px" }, children: h }, i)) }) }),
3499
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("tbody", { children: el.rows.map((r, ri) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("tr", { children: r.map((cell, ci) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("td", { style: { border: "1px solid #e2e8f0", padding: "3px 6px", textAlign: ci === 0 ? "left" : "right" }, children: cell }, ci)) }, ri)) })
3500
+ ] })
3501
+ ]
3502
+ }
3503
+ );
3504
+ }
3505
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3506
+ "div",
3507
+ {
3508
+ className: `univer-slides-element-box${isSelected ? " is-selected" : ""}`,
3509
+ style: wrapperStyle,
3510
+ onMouseDown: (ev) => startDragMove(ev, el),
3511
+ onDoubleClick: (ev) => {
3512
+ ev.stopPropagation();
3513
+ if (el.type === "text" || el.type === "shape") {
3514
+ selectionService.selectElements([el.id]);
3515
+ selectionService.setEditingElement(el.id);
3516
+ }
3517
+ },
3518
+ children: [
3519
+ content,
3520
+ isSelected && !isEditing && !el.locked && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
3521
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3522
+ "div",
3523
+ {
3524
+ className: "univer-slides-rotate-handle",
3525
+ title: "\u62D6\u62FD\u65CB\u8F6C\u89D2\u5EA6",
3526
+ onMouseDown: (ev) => startRotate(ev, el)
3527
+ }
3528
+ ),
3529
+ ["nw", "n", "ne", "e", "se", "s", "sw", "w"].map((dir) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3530
+ "div",
3531
+ {
3532
+ className: `univer-slides-resize-handle is-${dir}`,
3533
+ onMouseDown: (ev) => startResize(ev, el, dir)
3534
+ },
3535
+ dir
3536
+ ))
3537
+ ] })
3538
+ ]
3539
+ },
3540
+ el.id
3541
+ );
3542
+ };
3543
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3544
+ "div",
3545
+ {
3546
+ className: "univer-slides-workbench-center",
3547
+ tabIndex: 0,
3548
+ onKeyDown: (e) => {
3549
+ if ((e.key === "Delete" || e.key === "Backspace") && !selection.editingElementId && !selection.editingTableCell && selection.selectedElementIds.length > 0 && e.target?.tagName !== "INPUT" && e.target?.tagName !== "TEXTAREA") {
3550
+ commandService.syncExecuteCommand(import_univer_slides8.DeleteSlideElementsCommand.id, {
3551
+ unitId,
3552
+ slideId: activeSlide.id
3553
+ });
3554
+ }
3555
+ },
3556
+ children: [
3557
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-quick-toolbar", children: [
3558
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-toolbar-group", children: [
3559
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3560
+ "button",
3561
+ {
3562
+ type: "button",
3563
+ className: "univer-slides-tool-btn",
3564
+ onClick: () => insertElement("text"),
3565
+ children: [
3566
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: [
3567
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "2", y: "2.5", width: "12", height: "11", rx: "1.4", strokeWidth: "1.2", strokeDasharray: "2 1.5" }),
3568
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M5 5.2H11M8 5.2V11.2", strokeWidth: "1.4", strokeLinecap: "round" })
3569
+ ] }),
3570
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u6587\u672C\u6846" })
3571
+ ]
3572
+ }
3573
+ ),
3574
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-dropdown-anchor", children: [
3575
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3576
+ "button",
3577
+ {
3578
+ type: "button",
3579
+ className: "univer-slides-tool-btn",
3580
+ onClick: () => setOpenMenu(openMenu === "shape" ? null : "shape"),
3581
+ children: [
3582
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: [
3583
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "2.2", y: "2.5", width: "6.5", height: "6.5", rx: "1", strokeWidth: "1.3" }),
3584
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "10.8", cy: "10.5", r: "3.3", strokeWidth: "1.3" })
3585
+ ] }),
3586
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5F62\u72B6" })
3587
+ ]
3588
+ }
3589
+ ),
3590
+ openMenu === "shape" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "univer-slides-popover is-grid", children: SHAPE_CHOICES.map((sc) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3591
+ "button",
3592
+ {
3593
+ type: "button",
3594
+ className: "univer-slides-popover-item",
3595
+ onClick: () => insertElement("shape", { shapeType: sc.kind, name: sc.label }),
3596
+ children: sc.label
3597
+ },
3598
+ sc.kind
3599
+ )) })
3600
+ ] }),
3601
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-dropdown-anchor", children: [
3602
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3603
+ "button",
3604
+ {
3605
+ type: "button",
3606
+ className: "univer-slides-tool-btn",
3607
+ onClick: () => setOpenMenu(openMenu === "connector" ? null : "connector"),
3608
+ children: [
3609
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: [
3610
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "3.2", cy: "4", r: "1.4", strokeWidth: "1.3" }),
3611
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12.8", cy: "12", r: "1.4", strokeWidth: "1.3" }),
3612
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4.6 4H8.2V12H11.4", strokeWidth: "1.3", strokeLinecap: "round" })
3613
+ ] }),
3614
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u8FDE\u63A5\u7EBF" })
3615
+ ]
3616
+ }
3617
+ ),
3618
+ openMenu === "connector" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "univer-slides-popover", children: [
3619
+ { kind: "straight", label: "\u76F4\u7EBF\u7BAD\u5934\u8FDE\u63A5\u7EBF" },
3620
+ { kind: "elbow", label: "\u76F4\u89D2\u6298\u7EBF\u8FDE\u63A5\u7EBF" },
3621
+ { kind: "curved", label: "\u5E73\u6ED1\u8D1D\u585E\u5C14\u8FDE\u63A5\u7EBF" }
3622
+ ].map((cc) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3623
+ "button",
3624
+ {
3625
+ type: "button",
3626
+ className: "univer-slides-popover-item",
3627
+ onClick: () => insertElement("connector", { connectorType: cc.kind, name: cc.label }),
3628
+ children: cc.label
3629
+ },
3630
+ cc.kind
3631
+ )) })
3632
+ ] }),
3633
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3634
+ "button",
3635
+ {
3636
+ type: "button",
3637
+ className: "univer-slides-tool-btn",
3638
+ onClick: () => insertElement("table"),
3639
+ children: [
3640
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: [
3641
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "2", y: "2.5", width: "12", height: "11", rx: "1.2", strokeWidth: "1.3" }),
3642
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2 6.2H14M2 9.8H14M6.2 2.5V13.5M10.2 2.5V13.5", strokeWidth: "1.1" })
3643
+ ] }),
3644
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u8868\u683C" })
3645
+ ]
3646
+ }
3647
+ ),
3648
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-dropdown-anchor", children: [
3649
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3650
+ "button",
3651
+ {
3652
+ type: "button",
3653
+ className: "univer-slides-tool-btn",
3654
+ onClick: () => setOpenMenu(openMenu === "chart" ? null : "chart"),
3655
+ children: [
3656
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: [
3657
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2.2 13.5H13.8", strokeWidth: "1.3", strokeLinecap: "round" }),
3658
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "3.5", y: "8", width: "2.2", height: "5.5", strokeWidth: "1.2" }),
3659
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "7", y: "4.8", width: "2.2", height: "8.7", strokeWidth: "1.2" }),
3660
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "10.5", y: "2.8", width: "2.2", height: "10.7", strokeWidth: "1.2" })
3661
+ ] }),
3662
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u56FE\u8868" })
3663
+ ]
3664
+ }
3665
+ ),
3666
+ openMenu === "chart" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "univer-slides-popover", children: CHART_CHOICES.map((ch) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3667
+ "button",
3668
+ {
3669
+ type: "button",
3670
+ className: "univer-slides-popover-item",
3671
+ onClick: () => insertElement("chart", { chartType: ch.kind, title: ch.label }),
3672
+ children: ch.label
3673
+ },
3674
+ ch.kind
3675
+ )) })
3676
+ ] }),
3677
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-dropdown-anchor", children: [
3678
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3679
+ "button",
3680
+ {
3681
+ type: "button",
3682
+ className: "univer-slides-tool-btn",
3683
+ onClick: () => setOpenMenu(openMenu === "smartArt" ? null : "smartArt"),
3684
+ children: [
3685
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: [
3686
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "5.2", y: "2", width: "5.6", height: "3.2", rx: "0.7", strokeWidth: "1.25" }),
3687
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "1.8", y: "10.4", width: "5", height: "3.2", rx: "0.7", strokeWidth: "1.25" }),
3688
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "9.2", y: "10.4", width: "5", height: "3.2", rx: "0.7", strokeWidth: "1.25" }),
3689
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 5.2V8M4.3 8H11.7M4.3 8V10.4M11.7 8V10.4", strokeWidth: "1.2" })
3690
+ ] }),
3691
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u667A\u80FD\u56FE\u793A SmartArt" })
3692
+ ]
3693
+ }
3694
+ ),
3695
+ openMenu === "smartArt" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "univer-slides-popover", children: SMARTART_CHOICES.map((sa) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3696
+ "button",
3697
+ {
3698
+ type: "button",
3699
+ className: "univer-slides-popover-item",
3700
+ onClick: () => insertElement("smartArt", { layout: sa.kind, title: sa.label }),
3701
+ children: sa.label
3702
+ },
3703
+ sa.kind
3704
+ )) })
3705
+ ] }),
3706
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3707
+ "button",
3708
+ {
3709
+ type: "button",
3710
+ className: "univer-slides-tool-btn",
3711
+ onClick: handleUploadImage,
3712
+ children: [
3713
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", children: [
3714
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "2", y: "2.5", width: "12", height: "11", rx: "1.4", strokeWidth: "1.3" }),
3715
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "5.5", cy: "6", r: "1.1", strokeWidth: "1.2" }),
3716
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2.5 12L6.2 8.5L9.2 11.2L11.2 9.5L13.5 12", strokeWidth: "1.2", strokeLinecap: "round" })
3717
+ ] }),
3718
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u56FE\u7247" })
3719
+ ]
3720
+ }
3721
+ )
3722
+ ] }),
3723
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "univer-slides-toolbar-sep" }),
3724
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-toolbar-group", children: [
3725
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-dropdown-anchor", children: [
3726
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3727
+ "button",
3728
+ {
3729
+ type: "button",
3730
+ className: "univer-slides-tool-btn",
3731
+ onClick: () => setOpenMenu(openMenu === "layout" ? null : "layout"),
3732
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u6BCD\u7248\u7248\u5F0F" })
3733
+ }
3734
+ ),
3735
+ openMenu === "layout" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "univer-slides-popover", children: LAYOUT_CHOICES.map((lc) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3736
+ "button",
3737
+ {
3738
+ type: "button",
3739
+ className: "univer-slides-popover-item",
3740
+ onClick: () => {
3741
+ commandService.syncExecuteCommand(import_univer_slides8.UpdateSlidePagePropsCommand.id, {
3742
+ unitId,
3743
+ slideId: activeSlide.id,
3744
+ applyLayoutPlaceholders: true,
3745
+ patch: { layoutId: lc.kind }
3746
+ });
3747
+ setOpenMenu(null);
3748
+ },
3749
+ children: lc.label
3750
+ },
3751
+ lc.kind
3752
+ )) })
3753
+ ] }),
3754
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-dropdown-anchor", children: [
3755
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3756
+ "button",
3757
+ {
3758
+ type: "button",
3759
+ className: "univer-slides-tool-btn",
3760
+ onClick: () => setOpenMenu(openMenu === "transition" ? null : "transition"),
3761
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5207\u6362\u52A8\u753B" })
3762
+ }
3763
+ ),
3764
+ openMenu === "transition" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "univer-slides-popover", children: TRANSITION_CHOICES.map((tc) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3765
+ "button",
3766
+ {
3767
+ type: "button",
3768
+ className: "univer-slides-popover-item",
3769
+ onClick: () => {
3770
+ commandService.syncExecuteCommand(import_univer_slides8.UpdateSlidePagePropsCommand.id, {
3771
+ unitId,
3772
+ slideId: activeSlide.id,
3773
+ patch: {
3774
+ transition: {
3775
+ type: tc.kind,
3776
+ durationMs: activeSlide.transition?.durationMs ?? 500
3777
+ }
3778
+ }
3779
+ });
3780
+ setOpenMenu(null);
3781
+ },
3782
+ children: tc.label
3783
+ },
3784
+ tc.kind
3785
+ )) })
3786
+ ] }),
3787
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3788
+ "button",
3789
+ {
3790
+ type: "button",
3791
+ className: `univer-slides-tool-btn${selection.findReplaceOpen ? " is-active" : ""}`,
3792
+ onClick: () => selectionService.setFindReplaceOpen(!selection.findReplaceOpen),
3793
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u67E5\u627E\u66FF\u6362" })
3794
+ }
3795
+ ),
3796
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3797
+ "button",
3798
+ {
3799
+ type: "button",
3800
+ className: "univer-slides-tool-btn",
3801
+ onClick: () => commandService.executeCommand(ToggleSlidesInspectorOperation.id),
3802
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5C5E\u6027\u9762\u677F" })
3803
+ }
3804
+ )
3805
+ ] }),
3806
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "univer-slides-toolbar-sep" }),
3807
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-toolbar-group", children: [
3808
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3809
+ "button",
3810
+ {
3811
+ type: "button",
3812
+ className: "univer-slides-tool-btn",
3813
+ onClick: () => commandService.executeCommand(ImportSlidesPptxOperation.id, { unitId }),
3814
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5BFC\u5165 PPTX" })
3815
+ }
3816
+ ),
3817
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3818
+ "button",
3819
+ {
3820
+ type: "button",
3821
+ className: "univer-slides-tool-btn",
3822
+ onClick: () => commandService.executeCommand(ExportSlidesPptxOperation.id, { unitId }),
3823
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5BFC\u51FA PPTX" })
3824
+ }
3825
+ ),
3826
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-dropdown-anchor", children: [
3827
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3828
+ "button",
3829
+ {
3830
+ type: "button",
3831
+ className: "univer-slides-tool-btn",
3832
+ onClick: () => setOpenMenu(openMenu === "pdf" ? null : "pdf"),
3833
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5BFC\u51FA PDF" })
3834
+ }
3835
+ ),
3836
+ openMenu === "pdf" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-popover", children: [
3837
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3838
+ "button",
3839
+ {
3840
+ type: "button",
3841
+ className: "univer-slides-popover-item",
3842
+ onClick: () => {
3843
+ commandService.executeCommand(ExportSlidesPdfOperation.id, {
3844
+ unitId,
3845
+ handoutNotesMode: false
3846
+ });
3847
+ setOpenMenu(null);
3848
+ },
3849
+ children: "\u6807\u51C6\u5BBD\u5C4F\u77E2\u91CF PDF"
3850
+ }
3851
+ ),
3852
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3853
+ "button",
3854
+ {
3855
+ type: "button",
3856
+ className: "univer-slides-popover-item",
3857
+ onClick: () => {
3858
+ commandService.executeCommand(ExportSlidesPdfOperation.id, {
3859
+ unitId,
3860
+ handoutNotesMode: true
3861
+ });
3862
+ setOpenMenu(null);
3863
+ },
3864
+ children: "A4 \u6F14\u8BB2\u8005\u5907\u6CE8\u8BB2\u4E49 PDF"
3865
+ }
3866
+ )
3867
+ ] })
3868
+ ] }),
3869
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3870
+ "button",
3871
+ {
3872
+ type: "button",
3873
+ className: "univer-slides-tool-btn is-accent",
3874
+ onClick: () => commandService.executeCommand(StartSlideShowOperation.id, {
3875
+ mode: "fullscreen",
3876
+ fromStart: true
3877
+ }),
3878
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u4ECE\u5934\u653E\u6620" })
3879
+ }
3880
+ ),
3881
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3882
+ "button",
3883
+ {
3884
+ type: "button",
3885
+ className: "univer-slides-tool-btn is-primary",
3886
+ onClick: () => commandService.executeCommand(StartSlideShowOperation.id, {
3887
+ mode: "presenter",
3888
+ fromStart: false
3889
+ }),
3890
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5F53\u524D\u9875\u653E\u6620" })
3891
+ }
3892
+ )
3893
+ ] })
3894
+ ] }),
3895
+ selection.findReplaceOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-find-bar", children: [
3896
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3897
+ "input",
3898
+ {
3899
+ className: "univer-slides-input",
3900
+ placeholder: "\u67E5\u627E\u5E7B\u706F\u7247\u4E0E\u5907\u6CE8\u4E2D\u7684\u6587\u672C...",
3901
+ value: findQuery,
3902
+ onChange: (e) => setFindQuery(e.target.value)
3903
+ }
3904
+ ),
3905
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3906
+ "input",
3907
+ {
3908
+ className: "univer-slides-input",
3909
+ placeholder: "\u66FF\u6362\u4E3A...",
3910
+ value: replaceQuery,
3911
+ onChange: (e) => setReplaceQuery(e.target.value)
3912
+ }
3913
+ ),
3914
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "univer-slides-checkbox-label", children: [
3915
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3916
+ "input",
3917
+ {
3918
+ type: "checkbox",
3919
+ checked: matchCase,
3920
+ onChange: (e) => setMatchCase(e.target.checked)
3921
+ }
3922
+ ),
3923
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u533A\u5206\u5927\u5C0F\u5199" })
3924
+ ] }),
3925
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "univer-slides-find-count", children: [
3926
+ "\u5339\u914D ",
3927
+ matchCount,
3928
+ " \u5904"
3929
+ ] }),
3930
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3931
+ "button",
3932
+ {
3933
+ type: "button",
3934
+ className: "univer-slides-primary-btn",
3935
+ disabled: !findQuery || matchCount === 0,
3936
+ onClick: () => commandService.syncExecuteCommand(import_univer_slides8.FindAndReplaceSlideTextCommand.id, {
3937
+ unitId,
3938
+ findText: findQuery,
3939
+ replaceText: replaceQuery,
3940
+ matchCase
3941
+ }),
3942
+ children: "\u5168\u90E8\u66FF\u6362"
3943
+ }
3944
+ ),
3945
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3946
+ "button",
3947
+ {
3948
+ type: "button",
3949
+ className: "univer-slides-icon-btn",
3950
+ onClick: () => selectionService.setFindReplaceOpen(false),
3951
+ children: "\xD7"
3952
+ }
3953
+ )
3954
+ ] }),
3955
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3956
+ "div",
3957
+ {
3958
+ className: "univer-slides-canvas-viewport",
3959
+ onMouseDown: () => {
3960
+ selectionService.selectElements([]);
3961
+ setOpenMenu(null);
3962
+ },
3963
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3964
+ "div",
3965
+ {
3966
+ className: "univer-slides-canvas-scaler",
3967
+ style: {
3968
+ width: `${Math.round(slideW * zoom)}px`,
3969
+ height: `${Math.round(slideH * zoom)}px`
3970
+ },
3971
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
3972
+ "div",
3973
+ {
3974
+ ref: canvasRef,
3975
+ className: `univer-slides-canvas-surface${selection.showGrid ? " has-grid" : ""}`,
3976
+ style: {
3977
+ width: `${slideW}px`,
3978
+ height: `${slideH}px`,
3979
+ transform: `scale(${zoom})`,
3980
+ transformOrigin: "top left",
3981
+ ...slideBgStyle
3982
+ },
3983
+ children: [
3984
+ snapshot.masters[0]?.accentBar && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3985
+ "div",
3986
+ {
3987
+ className: "univer-slides-master-bar",
3988
+ style: { backgroundColor: snapshot.theme.colors.primary }
3989
+ }
3990
+ ),
3991
+ activeSlide.elementOrder.map((elId) => {
3992
+ const el = activeSlide.elements[elId];
3993
+ return el ? renderElementNode(el) : null;
3994
+ }),
3995
+ snapGuides.map(
3996
+ (g, idx) => g.axis === "x" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3997
+ "div",
3998
+ {
3999
+ className: "univer-slides-snap-guide is-vertical",
4000
+ style: { left: `${g.posPt}px` }
4001
+ },
4002
+ idx
4003
+ ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4004
+ "div",
4005
+ {
4006
+ className: "univer-slides-snap-guide is-horizontal",
4007
+ style: { top: `${g.posPt}px` }
4008
+ },
4009
+ idx
4010
+ )
4011
+ ),
4012
+ activeSlide.showSlideNumber !== false && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "univer-slides-page-number", children: activeSlideIndex + 1 })
4013
+ ]
4014
+ }
4015
+ )
4016
+ }
4017
+ )
4018
+ }
4019
+ ),
4020
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-notes-pane", children: [
4021
+ selection.showSpeakerNotes && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4022
+ "div",
4023
+ {
4024
+ className: "univer-slides-notes-resizer",
4025
+ onMouseDown: startNotesResize,
4026
+ title: "\u4E0A\u4E0B\u62D6\u62FD\u8C03\u6574\u5907\u6CE8\u680F\u9AD8\u5EA6"
4027
+ }
4028
+ ),
4029
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "univer-slides-notes-header", children: [
4030
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "univer-slides-notes-label", children: [
4031
+ "\u6F14\u8BB2\u8005\u5907\u6CE8 (Speaker Notes) \u2014 ",
4032
+ activeSlide.title
4033
+ ] }),
4034
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4035
+ "button",
4036
+ {
4037
+ type: "button",
4038
+ className: "univer-slides-notes-toggle",
4039
+ onClick: () => selectionService.setShowSpeakerNotes(!selection.showSpeakerNotes),
4040
+ children: selection.showSpeakerNotes ? "\u6536\u8D77\u5907\u6CE8" : "\u5C55\u5F00\u5907\u6CE8"
4041
+ }
4042
+ )
4043
+ ] }),
4044
+ selection.showSpeakerNotes && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4045
+ "textarea",
4046
+ {
4047
+ className: "univer-slides-notes-textarea",
4048
+ style: { height: `${selection.speakerNotesHeight}px` },
4049
+ placeholder: "\u5728\u6B64\u8F93\u5165\u672C\u9875\u6F14\u8BB2\u8005\u5907\u6CE8\u4E0E\u63D0\u8BCD\u8981\u70B9\uFF08\u53CC\u5411\u540C\u6B65\u81F3 .pptx notesSlide \u4E0E\u6F14\u8BB2\u8005\u89C6\u56FE\u63D0\u8BCD\u5668\uFF09...",
4050
+ value: activeSlide.speakerNotes ?? "",
4051
+ onChange: (e) => commandService.syncExecuteCommand(import_univer_slides8.UpdateSlidePagePropsCommand.id, {
4052
+ unitId,
4053
+ slideId: activeSlide.id,
4054
+ patch: { speakerNotes: e.target.value }
4055
+ })
4056
+ }
4057
+ )
4058
+ ] })
4059
+ ]
4060
+ }
4061
+ );
4062
+ };
4063
+
4064
+ // src/controllers/slides-ui.controller.ts
4065
+ var SlidesUIController = class extends import_core7.Disposable {
4066
+ constructor(_config, _commandService, _menuManagerService, _uiPartsService, _sidebarService, _componentManager, _iconManager) {
4067
+ super();
4068
+ this._config = _config;
4069
+ this._commandService = _commandService;
4070
+ this._menuManagerService = _menuManagerService;
4071
+ this._uiPartsService = _uiPartsService;
4072
+ this._sidebarService = _sidebarService;
4073
+ this._componentManager = _componentManager;
4074
+ this._iconManager = _iconManager;
4075
+ this._openInspectorTimer = null;
4076
+ this._initIcons();
4077
+ this._initComponents();
4078
+ this._initOperations();
4079
+ this._initMenus();
4080
+ this._initWorkbenchParts();
4081
+ if (this._config.defaultOpenInspector) {
4082
+ this._openInspectorTimer = setTimeout(() => {
4083
+ this._openInspectorTimer = null;
4084
+ if (!this._disposed) {
4085
+ openSlidesInspectorSidebar(this._sidebarService);
4086
+ }
4087
+ }, 100);
4088
+ this.disposeWithMe(
4089
+ (0, import_core7.toDisposable)(() => {
4090
+ if (this._openInspectorTimer !== null) {
4091
+ clearTimeout(this._openInspectorTimer);
4092
+ this._openInspectorTimer = null;
4093
+ }
4094
+ })
4095
+ );
4096
+ }
4097
+ }
4098
+ _initIcons() {
4099
+ this.disposeWithMe(this._iconManager.register(SLIDE_ICON_MAP));
4100
+ }
4101
+ _initComponents() {
4102
+ this.disposeWithMe(
4103
+ this._componentManager.register(SLIDES_INSPECTOR_COMPONENT_KEY, SlidesInspectorPanel)
4104
+ );
4105
+ }
4106
+ _initOperations() {
4107
+ const operations = [
4108
+ ToggleSlidesInspectorOperation,
4109
+ ToggleSlidesFindReplaceOperation,
4110
+ StartSlideShowOperation,
4111
+ AdjustSlidesZoomOperation,
4112
+ ToggleSlidesGridOperation,
4113
+ ToggleSlidesSnapOperation,
4114
+ ToggleSlidesSpeakerNotesOperation,
4115
+ ExportSlidesPptxOperation,
4116
+ ExportSlidesPdfOperation,
4117
+ ImportSlidesPptxOperation
4118
+ ];
4119
+ for (const op of operations) {
4120
+ this.disposeWithMe(this._commandService.registerCommand(op));
4121
+ }
4122
+ }
4123
+ _initMenus() {
4124
+ this._menuManagerService.appendRootMenu(slidesRootMenuExtension);
4125
+ this._menuManagerService.mergeMenu(slidesMenuSchema);
4126
+ }
4127
+ _initWorkbenchParts() {
4128
+ this.disposeWithMe(
4129
+ this._uiPartsService.registerComponent(import_ui9.BuiltInUIPart.LEFT_SIDEBAR, () => SlidesLeftSidebar)
4130
+ );
4131
+ this.disposeWithMe(
4132
+ this._uiPartsService.registerComponent(import_ui9.BuiltInUIPart.CONTENT, () => SlidesCanvasStage)
4133
+ );
4134
+ this.disposeWithMe(
4135
+ this._uiPartsService.registerComponent(import_ui9.BuiltInUIPart.FOOTER, () => SlidesStatusBar)
4136
+ );
4137
+ this.disposeWithMe(
4138
+ this._uiPartsService.registerComponent(
4139
+ import_ui9.BuiltInUIPart.GLOBAL,
4140
+ () => SlidesPresenterAndModalsHost
4141
+ )
4142
+ );
4143
+ }
4144
+ };
4145
+ SlidesUIController = __decorateClass([
4146
+ __decorateParam(1, import_core7.ICommandService),
4147
+ __decorateParam(2, import_ui9.IMenuManagerService),
4148
+ __decorateParam(3, import_ui9.IUIPartsService),
4149
+ __decorateParam(4, import_ui9.ISidebarService),
4150
+ __decorateParam(5, (0, import_core7.Inject)(import_ui9.ComponentManager)),
4151
+ __decorateParam(6, (0, import_core7.Inject)(import_ui9.IconManager))
4152
+ ], SlidesUIController);
4153
+
4154
+ // src/plugin.ts
4155
+ var import_core8 = require("@univerjs/core");
4156
+ var import_engine_render = require("@univerjs/engine-render");
4157
+ var import_univer_slides9 = require("@yudaocode/univer-slides");
4158
+
4159
+ // src/locale/en-US.ts
4160
+ var enUS = {
4161
+ slides: {
4162
+ ribbon: {
4163
+ slideShowTab: "Slide Show",
4164
+ newSlide: "New Slide",
4165
+ duplicateSlide: "Duplicate Slide",
4166
+ insertText: "Text Box",
4167
+ insertShape: "Shape",
4168
+ insertConnector: "Connector",
4169
+ insertTable: "Table",
4170
+ insertChart: "Chart",
4171
+ insertSmartArt: "SmartArt",
4172
+ insertImage: "Image",
4173
+ alignLeft: "Align Left",
4174
+ alignCenter: "Align Center",
4175
+ alignRight: "Align Right",
4176
+ deleteElement: "Delete Element",
4177
+ findReplace: "Find & Replace",
4178
+ inspector: "Inspector & Animations",
4179
+ importPptx: "Import PPTX",
4180
+ exportPptx: "Export PPTX",
4181
+ exportPdf: "Export PDF",
4182
+ playFromStart: "From Beginning",
4183
+ playCurrent: "From Current Slide",
4184
+ presenterView: "Presenter View",
4185
+ toggleGrid: "Toggle Grid",
4186
+ toggleSnap: "Smart Guides",
4187
+ toggleNotes: "Speaker Notes",
4188
+ zoomReset: "Reset Zoom"
4189
+ },
4190
+ sidebar: {
4191
+ inspectorTitle: "Slide Properties & Animations",
4192
+ sorterTitle: "Slide Sorter",
4193
+ newSlide: "New Slide",
4194
+ newSection: "Add Section"
4195
+ }
4196
+ }
4197
+ };
4198
+ var en_US_default = enUS;
4199
+
4200
+ // src/locale/zh-CN.ts
4201
+ var zhCN = {
4202
+ slides: {
4203
+ ribbon: {
4204
+ slideShowTab: "\u5E7B\u706F\u7247\u653E\u6620",
4205
+ newSlide: "\u65B0\u5EFA\u5E7B\u706F\u7247",
4206
+ duplicateSlide: "\u590D\u5236\u5E7B\u706F\u7247",
4207
+ insertText: "\u6587\u672C\u6846",
4208
+ insertShape: "\u5F62\u72B6",
4209
+ insertConnector: "\u8FDE\u63A5\u7EBF",
4210
+ insertTable: "\u8868\u683C",
4211
+ insertChart: "\u56FE\u8868",
4212
+ insertSmartArt: "\u667A\u80FD\u56FE\u793A",
4213
+ insertImage: "\u56FE\u7247",
4214
+ alignLeft: "\u5DE6\u5BF9\u9F50",
4215
+ alignCenter: "\u6C34\u5E73\u5C45\u4E2D",
4216
+ alignRight: "\u53F3\u5BF9\u9F50",
4217
+ deleteElement: "\u5220\u9664\u5143\u7D20",
4218
+ findReplace: "\u67E5\u627E\u66FF\u6362",
4219
+ inspector: "\u5C5E\u6027\u4E0E\u52A8\u753B",
4220
+ importPptx: "\u5BFC\u5165 PPTX",
4221
+ exportPptx: "\u5BFC\u51FA PPTX",
4222
+ exportPdf: "\u5BFC\u51FA PDF",
4223
+ playFromStart: "\u4ECE\u5934\u653E\u6620",
4224
+ playCurrent: "\u5F53\u524D\u9875\u653E\u6620",
4225
+ presenterView: "\u6F14\u8BB2\u8005\u89C6\u56FE",
4226
+ toggleGrid: "\u663E\u793A\u7F51\u683C",
4227
+ toggleSnap: "\u667A\u80FD\u5438\u9644",
4228
+ toggleNotes: "\u6F14\u8BB2\u8005\u5907\u6CE8",
4229
+ zoomReset: "\u91CD\u7F6E\u7F29\u653E"
4230
+ },
4231
+ sidebar: {
4232
+ inspectorTitle: "\u5E7B\u706F\u7247\u5C5E\u6027\u4E0E\u52A8\u753B",
4233
+ sorterTitle: "\u5E7B\u706F\u7247\u5BFC\u822A",
4234
+ newSlide: "\u65B0\u5EFA\u5E7B\u706F\u7247",
4235
+ newSection: "\u7AE0\u8282\u5206\u7EC4"
4236
+ }
4237
+ }
4238
+ };
4239
+ var zh_CN_default = zhCN;
4240
+
4241
+ // src/plugin.ts
4242
+ var UNIVER_SLIDES_UI_PLUGIN_NAME = "UNIVER_SLIDES_UI_PLUGIN";
4243
+ var UniverSlidesUIPlugin = class extends import_core8.Plugin {
4244
+ constructor(_config = {}, _injector) {
4245
+ super();
4246
+ this._config = _config;
4247
+ this._injector = _injector;
4248
+ }
4249
+ onStarting() {
4250
+ if (this._injector.has(import_core8.LocaleService)) {
4251
+ this._injector.get(import_core8.LocaleService).load({
4252
+ [import_core8.LocaleType.ZH_CN]: zh_CN_default,
4253
+ [import_core8.LocaleType.EN_US]: en_US_default
4254
+ });
4255
+ }
4256
+ this._injector.add([
4257
+ SlidesUIController,
4258
+ {
4259
+ useFactory: () => this._injector.createInstance(SlidesUIController, this._config)
4260
+ }
4261
+ ]);
4262
+ this._injector.get(SlidesUIController);
4263
+ }
4264
+ };
4265
+ UniverSlidesUIPlugin.pluginName = UNIVER_SLIDES_UI_PLUGIN_NAME;
4266
+ UniverSlidesUIPlugin.packageName = "@yudaocode/univer-slides-ui";
4267
+ UniverSlidesUIPlugin.type = import_core8.UniverInstanceType.UNIVER_SLIDE;
4268
+ UniverSlidesUIPlugin = __decorateClass([
4269
+ (0, import_core8.DependentOn)(import_engine_render.UniverRenderEnginePlugin, import_univer_slides9.UniverSlidesPlugin),
4270
+ __decorateParam(1, (0, import_core8.Inject)(import_core8.Injector))
4271
+ ], UniverSlidesUIPlugin);
4272
+
4273
+ // src/index.ts
4274
+ var VERSION = "1.6.218";
4275
+ // Annotate the CommonJS export names for ESM import in node:
4276
+ 0 && (module.exports = {
4277
+ AdjustSlidesZoomOperation,
4278
+ AlignSlideCenterMenuFactory,
4279
+ AlignSlideLeftMenuFactory,
4280
+ AlignSlideRightMenuFactory,
4281
+ DeleteSlideElementMenuFactory,
4282
+ DuplicateSlideMenuFactory,
4283
+ ExportPdfMenuFactory,
4284
+ ExportPptxMenuFactory,
4285
+ ExportSlidesPdfOperation,
4286
+ ExportSlidesPptxOperation,
4287
+ ImportPptxMenuFactory,
4288
+ ImportSlidesPptxOperation,
4289
+ InsertSlideChartMenuFactory,
4290
+ InsertSlideConnectorMenuFactory,
4291
+ InsertSlideImageMenuFactory,
4292
+ InsertSlideShapeMenuFactory,
4293
+ InsertSlideSmartArtMenuFactory,
4294
+ InsertSlideTableMenuFactory,
4295
+ InsertSlideTextMenuFactory,
4296
+ NewSlideMenuFactory,
4297
+ PlayCurrentMenuFactory,
4298
+ PlayFromStartMenuFactory,
4299
+ PresenterViewMenuFactory,
4300
+ SLIDES_INSPECTOR_COMPONENT_KEY,
4301
+ SLIDES_INSPECTOR_SIDEBAR_ID,
4302
+ SLIDES_RIBBON_SLIDESHOW_GROUP,
4303
+ SLIDES_RIBBON_SLIDESHOW_TAB,
4304
+ SLIDE_ICON_MAP,
4305
+ SlideAlignCenterIcon,
4306
+ SlideAlignLeftIcon,
4307
+ SlideAlignRightIcon,
4308
+ SlideAnimationIcon,
4309
+ SlideChartIcon,
4310
+ SlideConnectorIcon,
4311
+ SlideDeleteIcon,
4312
+ SlideDuplicateIcon,
4313
+ SlideExportIcon,
4314
+ SlideEyeIcon,
4315
+ SlideEyeOffIcon,
4316
+ SlideFindIcon,
4317
+ SlideGridIcon,
4318
+ SlideImageIcon,
4319
+ SlideImportIcon,
4320
+ SlideInspectorIcon,
4321
+ SlideLaserIcon,
4322
+ SlideLayoutIcon,
4323
+ SlideNewPageIcon,
4324
+ SlideNotesIcon,
4325
+ SlidePdfIcon,
4326
+ SlidePenIcon,
4327
+ SlidePlayIcon,
4328
+ SlidePresenterIcon,
4329
+ SlideSectionFolderIcon,
4330
+ SlideShapeIcon,
4331
+ SlideSmartArtIcon,
4332
+ SlideTableIcon,
4333
+ SlideTextIcon,
4334
+ SlideTransitionIcon,
4335
+ SlidesCanvasStage,
4336
+ SlidesInspectorPanel,
4337
+ SlidesLeftSidebar,
4338
+ SlidesPresenterAndModalsHost,
4339
+ SlidesPresenterModal,
4340
+ SlidesStatusBar,
4341
+ SlidesUIController,
4342
+ StartSlideShowOperation,
4343
+ ToggleGridMenuFactory,
4344
+ ToggleNotesMenuFactory,
4345
+ ToggleSlidesFindMenuFactory,
4346
+ ToggleSlidesFindReplaceOperation,
4347
+ ToggleSlidesGridOperation,
4348
+ ToggleSlidesInspectorMenuFactory,
4349
+ ToggleSlidesInspectorOperation,
4350
+ ToggleSlidesSnapOperation,
4351
+ ToggleSlidesSpeakerNotesOperation,
4352
+ ToggleSnapMenuFactory,
4353
+ UNIVER_SLIDES_UI_PLUGIN_NAME,
4354
+ UniverSlidesUIPlugin,
4355
+ VERSION,
4356
+ ZoomResetSlidesMenuFactory,
4357
+ openSlidesInspectorSidebar,
4358
+ slidesMenuSchema,
4359
+ slidesRootMenuExtension,
4360
+ triggerBrowserDownload,
4361
+ useActiveSlideUnit
4362
+ });
4363
+ //# sourceMappingURL=index.js.map