pptx-svelte-viewer 4.74.0 → 4.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/{export-BSqJw7u_.js → export-CVudgvaM.js} +10072 -9903
- package/dist/i18n/de.cjs +5 -0
- package/dist/i18n/de.mjs +5 -0
- package/dist/i18n/es.cjs +5 -0
- package/dist/i18n/es.mjs +5 -0
- package/dist/i18n/fr.cjs +5 -0
- package/dist/i18n/fr.mjs +5 -0
- package/dist/i18n/zh-CN.cjs +5 -0
- package/dist/i18n/zh-CN.mjs +5 -0
- package/dist/index.d.ts +137 -5
- package/dist/index.js +621 -57
- package/dist/pptx-svelte-viewer.css +1 -1
- package/dist/viewer/index.d.ts +23 -2
- package/dist/viewer/index.js +23 -23
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,60 +1,624 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as I } from "./translator-2U8GG-ce.js";
|
|
1
|
+
import { A as L, B as z, F as V, I as q, L as M, M as U, N as xe, O as H, P as G, R as K, _ as Fe, b as Le, c as ze, d as Ve, f as W, j as X, k as j, m as Q, p as J, s as qe, t as Y, u as Z, v as Me, x as Ue, y as He, z as $ } from "./export-CVudgvaM.js";
|
|
3
2
|
import "./i18n.js";
|
|
4
|
-
import {
|
|
3
|
+
import { i as We, t as ee } from "./translator-2U8GG-ce.js";
|
|
4
|
+
import { p as te } from "./transition-overlay-SNUzj4xJ.js";
|
|
5
|
+
import { BACKSTAGE_CARD_IDS as Qe, BACKSTAGE_PAGE_IDS as Je, BUILDING_BLOCK_OK as O, CANVAS_CONTEXT_MENU_COMMAND_IDS as Ye, EDITOR_SHORTCUT_ACTION_IDS as Ze, ELEMENT_CONTEXT_MENU_COMMAND_IDS as $e, OPTIONS_PAGE_IDS as et, OPTIONS_SECTION_IDS as tt, OPTIONS_SETTING_IDS as ot, PPTX_OPEN_ACCEPT as rt, PRESENTATION_OPEN_EXTENSIONS as it, RIBBON_CONTROL_IDS as nt, RIBBON_GROUP_IDS as at, RIBBON_TAB_IDS as st, TOOLBAR_BUTTON_IDS as lt, VIEWER_DIALOG_IDS as dt, VIEWER_EXPORT_FORMAT_IDS as ct, VIEWER_FEATURE_IDS as ut, VIEWER_PANEL_IDS as gt, buildingBlockFailure as P, collectUsedFonts as oe, createImageElementFromFile as pt, createPptxBuildingBlockSession as re, defaultCssVars as mt, defaultRadius as vt, defaultThemeColors as St, deleteAutosaveSnapshot as ht, describeBuildingBlockToolbar as ie, describeCollaborationShellState as ft, findHighlightTargets as ne, forgetSessionDeck as bt, getAutosaveSnapshot as _t, getSessionTabId as yt, hyperlinkEditPatch as ae, isLegacyBinaryPresentation as Ct, isSupportedPresentationFile as Pt, listAutosaveSnapshots as kt, loadPresentationDeck as Et, loadSessionDeck as wt, markFindHighlights as A, parsePresentationSessionId as Tt, presentationBaseName as It, registerBuildingBlockGroups as se, rememberSessionDeck as Ot, resetSlideLayoutPath as le, resolveAuthoredCustomShowId as de, resolveBuildingBlockMode as ce, restoreSessionDeck as At, runBuildingBlockToolbarControl as ue, savedPresentationFileName as Bt, scopeLayoutOptionsToSlide as ge, selectionEquation as pe, themeToCssVars as Nt, themeToCssVars as me, vermilionDarkColors as Rt, vermilionDarkTheme as Dt, vermilionLightColors as xt, vermilionLightTheme as Ft, vermilionRadius as Lt } from "ooxml-ui/pptx";
|
|
6
|
+
import "svelte/internal/disclose-version";
|
|
7
|
+
import * as e from "svelte/internal/client";
|
|
8
|
+
import { onDestroy as ve, tick as Se, untrack as E } from "svelte";
|
|
9
|
+
function he(r) {
|
|
10
|
+
const { state: t } = r, { editor: i, loader: o, parityUi: n } = t, d = () => {
|
|
11
|
+
i.dirty = !0;
|
|
12
|
+
}, p = (a) => i.updateDocumentProperties(a.core ?? i.coreProperties ?? {}, a.app ?? i.appProperties ?? {}, a.custom ?? i.customProperties, a.core ?? null);
|
|
13
|
+
return {
|
|
14
|
+
passwordProtection: {
|
|
15
|
+
input: () => ({
|
|
16
|
+
openPasswordSet: r.openPasswordSet(),
|
|
17
|
+
recommendation: { kind: t.readOnlyRec.recommendation.kind },
|
|
18
|
+
hasModifyVerifier: o.modifyVerifier !== void 0,
|
|
19
|
+
customProperties: i.customProperties
|
|
20
|
+
}),
|
|
21
|
+
customProperties: () => i.customProperties,
|
|
22
|
+
applyOpenPassword: (a) => {
|
|
23
|
+
a === null ? i.clearSavePassword() : i.setSavePassword(a), r.setOpenPasswordSet(a !== null);
|
|
24
|
+
},
|
|
25
|
+
applyCustomProperties: (a) => p({ custom: a }),
|
|
26
|
+
markDirty: d
|
|
27
|
+
},
|
|
28
|
+
documentProperties: {
|
|
29
|
+
current: () => ({
|
|
30
|
+
core: i.coreProperties ?? {},
|
|
31
|
+
custom: i.customProperties,
|
|
32
|
+
app: i.appProperties ?? {}
|
|
33
|
+
}),
|
|
34
|
+
applyUpdate: (a) => p({
|
|
35
|
+
...a.core ? { core: {
|
|
36
|
+
...i.coreProperties,
|
|
37
|
+
...a.core
|
|
38
|
+
} } : {},
|
|
39
|
+
...a.app ? { app: {
|
|
40
|
+
...i.appProperties,
|
|
41
|
+
...a.app
|
|
42
|
+
} } : {},
|
|
43
|
+
...a.custom ? { custom: a.custom } : {}
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
fontEmbedding: {
|
|
47
|
+
input: () => ({
|
|
48
|
+
embedFonts: i.embedFonts,
|
|
49
|
+
embeddedFamilies: [...i.embeddedFontFamilies],
|
|
50
|
+
usedFamilies: oe(i.slides),
|
|
51
|
+
descriptor: i.fontEmbedding
|
|
52
|
+
}),
|
|
53
|
+
apply: (a) => {
|
|
54
|
+
i.embedFonts = a;
|
|
55
|
+
},
|
|
56
|
+
markDirty: d
|
|
57
|
+
},
|
|
58
|
+
digitalSignatures: {
|
|
59
|
+
signed: () => o.hasDigitalSignatures,
|
|
60
|
+
count: () => o.digitalSignatureCount,
|
|
61
|
+
content: () => r.content(),
|
|
62
|
+
markDirty: d
|
|
63
|
+
},
|
|
64
|
+
setUpSlideShow: {
|
|
65
|
+
presentationProperties: () => i.presentationProperties,
|
|
66
|
+
slideCount: () => i.slides.length,
|
|
67
|
+
customShows: () => i.customShows,
|
|
68
|
+
save: (a) => {
|
|
69
|
+
i.presentationMetadata.updatePresentationProperties(a), n.activeCustomShowId = de(a, i.customShows) ?? null;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
customShows: {
|
|
73
|
+
customShows: () => i.customShows,
|
|
74
|
+
slides: () => i.slides,
|
|
75
|
+
activeId: () => n.activeCustomShowId,
|
|
76
|
+
commit: (a, g) => {
|
|
77
|
+
i.presentationMetadata.updateCustomShows(a), g && i.commitSlides([...g]);
|
|
78
|
+
},
|
|
79
|
+
start: (a) => {
|
|
80
|
+
n.activeCustomShowId = a, t.presentation.firstSlide(), t.onFullscreenToggle();
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
shortcuts: {
|
|
84
|
+
open: () => n.shortcutsOpen,
|
|
85
|
+
setOpen: (a) => {
|
|
86
|
+
n.shortcutsOpen = a;
|
|
87
|
+
},
|
|
88
|
+
toggle: () => {
|
|
89
|
+
n.shortcutsOpen = !n.shortcutsOpen;
|
|
90
|
+
},
|
|
91
|
+
translate: (a) => t.t(a)
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function B(r, t) {
|
|
96
|
+
e.user_effect(() => {
|
|
97
|
+
r() && E(t);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function f(r) {
|
|
101
|
+
return r.editor.selectedElements[0] ?? null;
|
|
102
|
+
}
|
|
103
|
+
function N(r, t) {
|
|
104
|
+
return ge([...t], r.editor.slides[r.viewer.current]?.layoutPath);
|
|
105
|
+
}
|
|
106
|
+
function R(r) {
|
|
107
|
+
return r.editable && !r.collab.readOnly && !r.readOnlyRec.locked;
|
|
108
|
+
}
|
|
109
|
+
function fe(r) {
|
|
110
|
+
const { state: t } = r, i = f(t), o = t.editor.slides[t.viewer.current];
|
|
111
|
+
return {
|
|
112
|
+
ready: !t.loader.loading && !t.loader.error,
|
|
113
|
+
hasActiveSlide: o !== void 0,
|
|
114
|
+
canEdit: R(t),
|
|
115
|
+
editing: t.editingActive && !t.editor.masterViewTarget,
|
|
116
|
+
canInsert: !t.protectedViewActive && !t.readOnlyRec.locked,
|
|
117
|
+
hasSelection: i !== null,
|
|
118
|
+
selectionHasHyperlink: !!i?.actionClick,
|
|
119
|
+
selectionHasEquation: pe(i) !== null,
|
|
120
|
+
layoutCount: N(t, r.layouts()).length,
|
|
121
|
+
hasCurrentLayout: le(o) !== void 0,
|
|
122
|
+
hasHandler: t.loader.handler !== null
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function be(r) {
|
|
126
|
+
return {
|
|
127
|
+
open: r.open,
|
|
128
|
+
setOpen: (t) => {
|
|
129
|
+
t !== r.open && r.toggle();
|
|
130
|
+
},
|
|
131
|
+
query: r.query,
|
|
132
|
+
replacement: r.replacement,
|
|
133
|
+
options: {
|
|
134
|
+
matchCase: r.matchCase,
|
|
135
|
+
includeNotes: r.includeNotes,
|
|
136
|
+
includeChartTitles: r.includeChartTitles,
|
|
137
|
+
includeChartData: r.includeChartData
|
|
138
|
+
},
|
|
139
|
+
matches: r.results,
|
|
140
|
+
currentIndex: r.index,
|
|
141
|
+
setQuery: (t) => {
|
|
142
|
+
r.query = t;
|
|
143
|
+
},
|
|
144
|
+
setReplacement: (t) => {
|
|
145
|
+
r.replacement = t;
|
|
146
|
+
},
|
|
147
|
+
setOptions: (t) => {
|
|
148
|
+
t.matchCase !== void 0 && (r.matchCase = t.matchCase), t.includeNotes !== void 0 && (r.includeNotes = t.includeNotes), t.includeChartTitles !== void 0 && (r.includeChartTitles = t.includeChartTitles), t.includeChartData !== void 0 && (r.includeChartData = t.includeChartData);
|
|
149
|
+
},
|
|
150
|
+
find: () => r.search(),
|
|
151
|
+
navigate: (t) => t > 0 ? r.next() : r.prev(),
|
|
152
|
+
replaceCurrent: () => r.replaceCurrent(),
|
|
153
|
+
replaceAll: () => r.replaceAll()
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function _e(r) {
|
|
157
|
+
const { state: t } = r, { editor: i } = t, o = (n) => {
|
|
158
|
+
const d = f(t);
|
|
159
|
+
return d ? (i.applyElementPatch(d.id, n), O) : P("no-selection");
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
availabilityInput: () => fe(r),
|
|
163
|
+
onCancel: () => {
|
|
164
|
+
t.parityUi.shortcutsOpen = !1;
|
|
165
|
+
},
|
|
166
|
+
fileLimits: () => r.options().fileLimits,
|
|
167
|
+
onRequest: (n) => r.options().onRequest?.(n),
|
|
168
|
+
target: () => ({
|
|
169
|
+
deck: t.loader.handler,
|
|
170
|
+
slideId: i.slides[t.viewer.current]?.id,
|
|
171
|
+
slideIndex: t.viewer.current
|
|
172
|
+
}),
|
|
173
|
+
canvasSize: () => t.loader.canvasSize,
|
|
174
|
+
selectedElement: () => f(t),
|
|
175
|
+
slideCount: () => i.slides.length,
|
|
176
|
+
activeSlide: () => i.slides[t.viewer.current],
|
|
177
|
+
scopedLayouts: () => N(t, r.layouts()),
|
|
178
|
+
addElement: (n) => {
|
|
179
|
+
i.insertElement(n);
|
|
180
|
+
},
|
|
181
|
+
insertMediaFile: async (n, d) => {
|
|
182
|
+
const p = await M(n, t.loader.canvasSize);
|
|
183
|
+
return p ? d() ? (i.insertElement(p), O) : P("stale-target") : P("decode-failed");
|
|
184
|
+
},
|
|
185
|
+
applyHyperlink: (n) => {
|
|
186
|
+
const d = ae(n);
|
|
187
|
+
return d.ok ? o({ actionClick: d.actionClick }) : d;
|
|
188
|
+
},
|
|
189
|
+
removeHyperlink: () => {
|
|
190
|
+
const n = f(t);
|
|
191
|
+
return n && !n.actionClick ? P("no-hyperlink") : o({ actionClick: void 0 });
|
|
192
|
+
},
|
|
193
|
+
insertSmartArt: (n, d) => {
|
|
194
|
+
i.insertElement(q(n, d, t.loader.canvasSize));
|
|
195
|
+
},
|
|
196
|
+
insertChart: (n, d) => {
|
|
197
|
+
i.insertElement($(n, t.loader.canvasSize, d));
|
|
198
|
+
},
|
|
199
|
+
insertEquation: (n) => {
|
|
200
|
+
i.insertElement(K(n, t.loader.canvasSize));
|
|
201
|
+
},
|
|
202
|
+
updateEquation: (n) => {
|
|
203
|
+
const d = f(t);
|
|
204
|
+
d && (i.equationOps.editingId = d.id, i.equationOps.apply(n));
|
|
205
|
+
},
|
|
206
|
+
findReplace: () => be(t.findReplace),
|
|
207
|
+
applyLayout: async (n) => {
|
|
208
|
+
if (await i.slidesOps.applyLayout(n) === null) throw new Error(`Layout ${n} was not applied`);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function ye(r) {
|
|
213
|
+
const t = e.derived(() => r().content), i = e.derived(() => r().canEdit === !0), o = (n) => r()[n];
|
|
214
|
+
return {
|
|
215
|
+
get source() {
|
|
216
|
+
return e.get(t);
|
|
217
|
+
},
|
|
218
|
+
get editable() {
|
|
219
|
+
return e.get(i);
|
|
220
|
+
},
|
|
221
|
+
get autosave() {
|
|
222
|
+
return o("autosave") === !0;
|
|
223
|
+
},
|
|
224
|
+
get fileName() {
|
|
225
|
+
return o("fileName");
|
|
226
|
+
},
|
|
227
|
+
get filePath() {
|
|
228
|
+
return o("filePath");
|
|
229
|
+
},
|
|
230
|
+
get initialSlide() {
|
|
231
|
+
return o("initialSlide");
|
|
232
|
+
},
|
|
233
|
+
get googleFonts() {
|
|
234
|
+
return o("googleFonts");
|
|
235
|
+
},
|
|
236
|
+
get listConversionScope() {
|
|
237
|
+
return o("listConversionScope");
|
|
238
|
+
},
|
|
239
|
+
get allowExternalContent() {
|
|
240
|
+
return o("allowExternalContent");
|
|
241
|
+
},
|
|
242
|
+
get limits() {
|
|
243
|
+
return o("limits");
|
|
244
|
+
},
|
|
245
|
+
get collaboration() {
|
|
246
|
+
return o("collaboration");
|
|
247
|
+
},
|
|
248
|
+
get fitPadding() {
|
|
249
|
+
return o("fitPadding");
|
|
250
|
+
},
|
|
251
|
+
get maxFitScale() {
|
|
252
|
+
return o("maxFitScale");
|
|
253
|
+
},
|
|
254
|
+
get authorName() {
|
|
255
|
+
return o("authorName") ?? o("userName");
|
|
256
|
+
},
|
|
257
|
+
get onload() {
|
|
258
|
+
return o("onLoad");
|
|
259
|
+
},
|
|
260
|
+
get onerror() {
|
|
261
|
+
return o("onError");
|
|
262
|
+
},
|
|
263
|
+
get onslidechange() {
|
|
264
|
+
return o("onSlideChange");
|
|
265
|
+
},
|
|
266
|
+
get ondirtychange() {
|
|
267
|
+
return o("onDirtyChange");
|
|
268
|
+
},
|
|
269
|
+
get oncontentchange() {
|
|
270
|
+
return o("onContentChange");
|
|
271
|
+
},
|
|
272
|
+
get onselectionchange() {
|
|
273
|
+
return o("onSelectionChange");
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
var Ce = (r) => r instanceof ArrayBuffer || r instanceof Uint8Array ? r : null;
|
|
278
|
+
function qt(r) {
|
|
279
|
+
let t = e.state(void 0), i = e.state(void 0), o = e.state(0), n = e.state(0), d = e.state([]), p = e.state(!1);
|
|
280
|
+
const a = ee(() => r().locale ?? "en"), g = ye(r), s = Q(J(() => g, {
|
|
281
|
+
t: a,
|
|
282
|
+
getStageHolderEl: () => e.get(i),
|
|
283
|
+
getRootEl: () => e.get(t),
|
|
284
|
+
getViewportWidth: () => e.get(o),
|
|
285
|
+
getViewportHeight: () => e.get(n),
|
|
286
|
+
getMasterScale: () => 1
|
|
287
|
+
})), { editor: c } = s, m = re(_e({
|
|
288
|
+
state: s,
|
|
289
|
+
options: r,
|
|
290
|
+
layouts: () => e.get(d)
|
|
291
|
+
}));
|
|
292
|
+
se(m, he({
|
|
293
|
+
state: s,
|
|
294
|
+
content: () => Ce(r().content),
|
|
295
|
+
openPasswordSet: () => e.get(p),
|
|
296
|
+
setOpenPasswordSet: (l) => {
|
|
297
|
+
e.set(p, l, !0);
|
|
298
|
+
}
|
|
299
|
+
}));
|
|
300
|
+
const S = z(m.requests);
|
|
301
|
+
e.user_effect(() => {
|
|
302
|
+
const l = s.loader.handler;
|
|
303
|
+
let y = !1;
|
|
304
|
+
return l ? E(() => c.slidesOps.availableLayouts()).then((k) => {
|
|
305
|
+
y || e.set(d, k);
|
|
306
|
+
}).catch(() => {
|
|
307
|
+
}) : e.set(d, []), () => {
|
|
308
|
+
y = !0;
|
|
309
|
+
};
|
|
310
|
+
}), e.user_effect(() => {
|
|
311
|
+
e.set(p, s.loader.isPasswordProtected, !0);
|
|
312
|
+
}), B(() => s.controller.hyperlinkOpen, () => {
|
|
313
|
+
s.controller.hyperlinkOpen = !1, m.request({ kind: "hyperlink" });
|
|
314
|
+
}), B(() => !!c.equationOps.editingId, () => {
|
|
315
|
+
const l = c.equationOps.omml;
|
|
316
|
+
c.equationOps.close(), m.request({
|
|
317
|
+
kind: "equation",
|
|
318
|
+
existingOmml: l
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
let b = !1;
|
|
322
|
+
e.user_effect(() => {
|
|
323
|
+
const l = s.parityUi.shortcutsOpen;
|
|
324
|
+
l !== b && (b = l, E(() => m.announce({
|
|
325
|
+
kind: "shortcuts",
|
|
326
|
+
open: l
|
|
327
|
+
}, l)));
|
|
328
|
+
});
|
|
329
|
+
let _ = !1;
|
|
330
|
+
const u = () => {
|
|
331
|
+
_ || (_ = !0, s.destroy());
|
|
332
|
+
};
|
|
333
|
+
ve(u);
|
|
334
|
+
const v = () => ({
|
|
335
|
+
mode: ce(s.viewerMode, R(s)),
|
|
336
|
+
loading: s.loader.loading,
|
|
337
|
+
error: s.loader.error,
|
|
338
|
+
slideIndex: c.slides.length ? s.viewer.current : -1,
|
|
339
|
+
slideCount: c.slides.length,
|
|
340
|
+
canUndo: c.canUndo,
|
|
341
|
+
canRedo: c.canRedo,
|
|
342
|
+
dirty: c.dirty
|
|
343
|
+
});
|
|
344
|
+
return {
|
|
345
|
+
get actions() {
|
|
346
|
+
return S.current, m.actions();
|
|
347
|
+
},
|
|
348
|
+
get state() {
|
|
349
|
+
return v();
|
|
350
|
+
},
|
|
351
|
+
get toolbar() {
|
|
352
|
+
const l = v();
|
|
353
|
+
return ie({
|
|
354
|
+
availability: m.actions().availability,
|
|
355
|
+
canUndo: l.canUndo,
|
|
356
|
+
canRedo: l.canRedo,
|
|
357
|
+
findOpen: s.findReplace.open,
|
|
358
|
+
slideIndex: l.slideIndex,
|
|
359
|
+
slideCount: l.slideCount,
|
|
360
|
+
hiddenActions: r().hiddenActions
|
|
361
|
+
});
|
|
362
|
+
},
|
|
363
|
+
runToolbarControl(l) {
|
|
364
|
+
ue(l, m, {
|
|
365
|
+
undo: () => c.undo(),
|
|
366
|
+
redo: () => c.redo(),
|
|
367
|
+
toggleFind: () => s.findReplace.toggle(),
|
|
368
|
+
zoomOut: () => s.deck.zoomOut(),
|
|
369
|
+
zoomIn: () => s.deck.zoomIn(),
|
|
370
|
+
zoomToFit: () => {
|
|
371
|
+
s.viewer.zoomPercent = null;
|
|
372
|
+
},
|
|
373
|
+
previousSlide: () => s.deck.goPrev(),
|
|
374
|
+
nextSlide: () => s.deck.goNext()
|
|
375
|
+
});
|
|
376
|
+
},
|
|
377
|
+
slidesPaneProps: Y(s, { onopenlayoutgallery: (l) => r().onOpenLayoutGallery?.(l) }),
|
|
378
|
+
get findHighlights() {
|
|
379
|
+
return ne(s.findReplace.results, s.findReplace.index, s.viewer.current);
|
|
380
|
+
},
|
|
381
|
+
t: (l) => a(l),
|
|
382
|
+
viewerState: s,
|
|
383
|
+
session: m,
|
|
384
|
+
canvas: {
|
|
385
|
+
setRoot(l) {
|
|
386
|
+
e.set(t, l);
|
|
387
|
+
},
|
|
388
|
+
setStageHolder(l) {
|
|
389
|
+
e.set(i, l);
|
|
390
|
+
},
|
|
391
|
+
setViewportSize(l) {
|
|
392
|
+
e.set(o, l.width, !0), e.set(n, l.height, !0);
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
destroy: u
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
var Pe = e.from_html('<p role="alert"> </p>'), ke = e.from_html("<!> <!> <!>", 1), Ee = e.from_html('<div data-pptx-block="canvas" data-pptx-theme-root="" data-pptx-editor-chrome="" role="application" tabindex="0"><!> <!> <div class="pptx-svelte-blocks-viewport svelte-uasggf" data-pptx-viewport=""><!> <!></div></div>');
|
|
399
|
+
function we(r, t) {
|
|
400
|
+
e.push(t, !0);
|
|
401
|
+
const i = e.prop(t, "class", 3, ""), o = e.derived(() => t.blocks.viewerState), n = e.derived(() => j(e.get(o).editor)), d = e.derived(() => t.theme ? te(me(t.theme)) : void 0);
|
|
402
|
+
let p = e.state(void 0);
|
|
403
|
+
function a(u) {
|
|
404
|
+
return t.blocks.canvas.setRoot(u), { destroy: () => t.blocks.canvas.setRoot(void 0) };
|
|
405
|
+
}
|
|
406
|
+
e.user_effect(() => {
|
|
407
|
+
const u = t.blocks.findHighlights;
|
|
408
|
+
if (e.get(o).activeSlide, !e.get(p) || u.length === 0) return;
|
|
409
|
+
const v = e.get(p);
|
|
410
|
+
let l = !1;
|
|
411
|
+
return Se().then(() => {
|
|
412
|
+
l || A(v, u);
|
|
413
|
+
}), () => {
|
|
414
|
+
l = !0, A(v, []);
|
|
415
|
+
};
|
|
416
|
+
});
|
|
417
|
+
var g = Ee(), s = e.child(g);
|
|
418
|
+
W(s, {});
|
|
419
|
+
var c = e.sibling(s, 2);
|
|
420
|
+
H(c, {});
|
|
421
|
+
var m = e.sibling(c, 2), S = e.child(m), b = (u) => {
|
|
422
|
+
var v = Pe(), l = e.only_child(v, !0);
|
|
423
|
+
e.template_effect(() => e.set_text(l, e.get(o).loader.error)), e.append(u, v);
|
|
424
|
+
};
|
|
425
|
+
e.if(S, (u) => {
|
|
426
|
+
e.get(o).loader.error && u(b);
|
|
427
|
+
});
|
|
428
|
+
var _ = e.sibling(S, 2);
|
|
429
|
+
{
|
|
430
|
+
let u = e.derived(() => e.get(o).editingActive ? e.get(n).commitTableCell : void 0), v = e.derived(() => e.get(o).editingActive ? e.get(n).commitSmartArtNode : void 0), l = e.derived(() => e.get(o).editingActive ? e.get(n).commitSmartArtFill : void 0), y = e.derived(() => e.get(o).editingActive ? e.get(n).commitChartPoint : void 0), k = e.derived(() => e.get(o).editingActive ? e.get(n).commitTableResizeColumns : void 0), D = e.derived(() => e.get(o).editingActive ? e.get(n).commitTableResizeRow : void 0);
|
|
431
|
+
U(_, {
|
|
432
|
+
get slide() {
|
|
433
|
+
return e.get(o).activeSlide;
|
|
434
|
+
},
|
|
435
|
+
get canvasSize() {
|
|
436
|
+
return e.get(o).loader.canvasSize;
|
|
437
|
+
},
|
|
438
|
+
get mediaDataUrls() {
|
|
439
|
+
return e.get(o).loader.mediaDataUrls;
|
|
440
|
+
},
|
|
441
|
+
get scale() {
|
|
442
|
+
return e.get(o).scale;
|
|
443
|
+
},
|
|
444
|
+
get editingActive() {
|
|
445
|
+
return e.get(o).editingActive;
|
|
446
|
+
},
|
|
447
|
+
get editTemplateMode() {
|
|
448
|
+
return e.get(o).editor.editTemplateMode;
|
|
449
|
+
},
|
|
450
|
+
get editingElementId() {
|
|
451
|
+
return e.get(o).controller.editingId;
|
|
452
|
+
},
|
|
453
|
+
get selectedElementIds() {
|
|
454
|
+
return e.get(o).editor.selection.ids;
|
|
455
|
+
},
|
|
456
|
+
get ontablecellcommit() {
|
|
457
|
+
return e.get(u);
|
|
458
|
+
},
|
|
459
|
+
get onsmartartnodecommit() {
|
|
460
|
+
return e.get(v);
|
|
461
|
+
},
|
|
462
|
+
get onsmartartnodefill() {
|
|
463
|
+
return e.get(l);
|
|
464
|
+
},
|
|
465
|
+
get onchartpointcommit() {
|
|
466
|
+
return e.get(y);
|
|
467
|
+
},
|
|
468
|
+
get ontableresizecolumns() {
|
|
469
|
+
return e.get(k);
|
|
470
|
+
},
|
|
471
|
+
get ontableresizerow() {
|
|
472
|
+
return e.get(D);
|
|
473
|
+
},
|
|
474
|
+
onstageholder: (C) => {
|
|
475
|
+
e.set(p, C ?? void 0), t.blocks.canvas.setStageHolder(C ?? void 0);
|
|
476
|
+
},
|
|
477
|
+
get onstagepointerdown() {
|
|
478
|
+
return e.get(o).controller.onStagePointerDown;
|
|
479
|
+
},
|
|
480
|
+
get onstagepointermove() {
|
|
481
|
+
return e.get(o).controller.onStagePointerMove;
|
|
482
|
+
},
|
|
483
|
+
get onstagedblclick() {
|
|
484
|
+
return e.get(o).controller.onStageDblClick;
|
|
485
|
+
},
|
|
486
|
+
get onstageclick() {
|
|
487
|
+
return e.get(o).controller.onStageClick;
|
|
488
|
+
},
|
|
489
|
+
children: (C, Re) => {
|
|
490
|
+
var w = ke(), T = e.first_child(w), x = (h) => {
|
|
491
|
+
V(h, {
|
|
492
|
+
get controller() {
|
|
493
|
+
return e.get(o).controller;
|
|
494
|
+
},
|
|
495
|
+
get scale() {
|
|
496
|
+
return e.get(o).scale;
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
e.if(T, (h) => {
|
|
501
|
+
e.get(o).editingActive && h(x);
|
|
502
|
+
});
|
|
503
|
+
var I = e.sibling(T, 2);
|
|
504
|
+
{
|
|
505
|
+
let h = e.derived(() => e.get(o).activeSlide?.elements ?? []);
|
|
506
|
+
L(I, {
|
|
507
|
+
get presences() {
|
|
508
|
+
return e.get(o).collab.remotePresences;
|
|
509
|
+
},
|
|
510
|
+
get elements() {
|
|
511
|
+
return e.get(h);
|
|
512
|
+
},
|
|
513
|
+
get activeSlideIndex() {
|
|
514
|
+
return e.get(o).viewer.current;
|
|
515
|
+
},
|
|
516
|
+
get zoom() {
|
|
517
|
+
return e.get(o).scale;
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
var F = e.sibling(I, 2);
|
|
522
|
+
X(F, {
|
|
523
|
+
get cursors() {
|
|
524
|
+
return e.get(o).collab.cursors;
|
|
525
|
+
},
|
|
526
|
+
get zoom() {
|
|
527
|
+
return e.get(o).scale;
|
|
528
|
+
}
|
|
529
|
+
}), e.append(C, w);
|
|
530
|
+
},
|
|
531
|
+
$$slots: { default: !0 }
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
e.reset(m), e.action(m, (u, v) => G?.(u, v), () => t.blocks.canvas.setViewportSize), e.reset(g), e.action(g, (u) => a?.(u)), e.template_effect((u) => {
|
|
535
|
+
e.set_class(g, 1, `pptx-svelte-viewer pptx-svelte-blocks-canvas ${i()}`, "svelte-uasggf"), e.set_style(g, e.get(d)), e.set_attribute(g, "aria-label", u), e.set_attribute(g, "aria-busy", e.get(o).loader.loading);
|
|
536
|
+
}, [() => t.blocks.t("pptx.titleBar.defaultFileName")]), e.delegated("keydown", g, function(...u) {
|
|
537
|
+
e.get(o).onKeydown?.apply(this, u);
|
|
538
|
+
}), e.append(r, g), e.pop();
|
|
539
|
+
}
|
|
540
|
+
e.delegate(["keydown"]);
|
|
541
|
+
var Te = e.from_html('<div data-pptx-block="slides-pane"><!></div>');
|
|
542
|
+
function Ie(r, t) {
|
|
543
|
+
e.push(t, !0);
|
|
544
|
+
const i = e.prop(t, "class", 3, "");
|
|
545
|
+
var o = Te(), n = e.child(o);
|
|
546
|
+
Z(n, e.spread_props(() => t.blocks.slidesPaneProps)), e.reset(o), e.template_effect(() => e.set_class(o, 1, `pptx-svelte-viewer pptx-svelte-bb-slides-pane ${i()}`, "svelte-1ouyhsr")), e.append(r, o), e.pop();
|
|
547
|
+
}
|
|
548
|
+
var Oe = e.from_html('<button type="button"> </button>'), Ae = e.from_html('<span role="group" class="svelte-14vg6om"></span>'), Be = e.from_html('<div data-pptx-block="toolbar" role="toolbar"></div>');
|
|
549
|
+
function Ne(r, t) {
|
|
550
|
+
e.push(t, !0);
|
|
551
|
+
const i = e.prop(t, "class", 3, ""), o = e.derived(() => t.blocks.toolbar.filter((d) => !t.include || t.include.includes(d.id)));
|
|
552
|
+
var n = Be();
|
|
553
|
+
e.each(n, 21, () => e.get(o), (d) => d.id, (d, p) => {
|
|
554
|
+
var a = Ae();
|
|
555
|
+
e.each(a, 21, () => e.get(p).controls, (g) => g.id, (g, s) => {
|
|
556
|
+
var c = Oe(), m = e.only_child(c, !0);
|
|
557
|
+
e.template_effect((S) => {
|
|
558
|
+
e.set_attribute(c, "data-control", e.get(s).id), c.disabled = e.get(s).disabled, e.set_attribute(c, "aria-pressed", e.get(s).pressed === void 0 ? void 0 : e.get(s).pressed), e.set_text(m, S);
|
|
559
|
+
}, [() => t.blocks.t(e.get(s).labelKey)]), e.delegated("click", c, () => t.blocks.runToolbarControl(e.get(s).id)), e.append(g, c);
|
|
560
|
+
}), e.reset(a), e.template_effect(() => e.set_attribute(a, "data-group", e.get(p).id)), e.append(d, a);
|
|
561
|
+
}), e.reset(n), e.template_effect(() => e.set_class(n, 1, `pptx-svelte-bb-toolbar ${i()}`, "svelte-14vg6om")), e.append(r, n), e.pop();
|
|
562
|
+
}
|
|
563
|
+
e.delegate(["click"]);
|
|
564
|
+
var Mt = we, Ut = Ne, Ht = Ie;
|
|
5
565
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
566
|
+
Qe as BACKSTAGE_CARD_IDS,
|
|
567
|
+
Je as BACKSTAGE_PAGE_IDS,
|
|
568
|
+
Mt as BuildingBlocksCanvas,
|
|
569
|
+
Ht as BuildingBlocksSlidesPane,
|
|
570
|
+
Ut as BuildingBlocksToolbar,
|
|
571
|
+
Ye as CANVAS_CONTEXT_MENU_COMMAND_IDS,
|
|
572
|
+
Ze as EDITOR_SHORTCUT_ACTION_IDS,
|
|
573
|
+
$e as ELEMENT_CONTEXT_MENU_COMMAND_IDS,
|
|
574
|
+
et as OPTIONS_PAGE_IDS,
|
|
575
|
+
tt as OPTIONS_SECTION_IDS,
|
|
576
|
+
ot as OPTIONS_SETTING_IDS,
|
|
577
|
+
rt as PPTX_OPEN_ACCEPT,
|
|
578
|
+
it as PRESENTATION_OPEN_EXTENSIONS,
|
|
579
|
+
Ve as PowerPointViewer,
|
|
580
|
+
nt as RIBBON_CONTROL_IDS,
|
|
581
|
+
at as RIBBON_GROUP_IDS,
|
|
582
|
+
st as RIBBON_TAB_IDS,
|
|
583
|
+
qe as SlideThumbnail,
|
|
584
|
+
ze as SlidesPane,
|
|
585
|
+
lt as TOOLBAR_BUTTON_IDS,
|
|
586
|
+
dt as VIEWER_DIALOG_IDS,
|
|
587
|
+
ct as VIEWER_EXPORT_FORMAT_IDS,
|
|
588
|
+
ut as VIEWER_FEATURE_IDS,
|
|
589
|
+
gt as VIEWER_PANEL_IDS,
|
|
590
|
+
pt as createImageElementFromFile,
|
|
591
|
+
Y as createSlidesPaneProps,
|
|
592
|
+
qt as createViewerBuildingBlocks,
|
|
593
|
+
mt as defaultCssVars,
|
|
594
|
+
vt as defaultRadius,
|
|
595
|
+
St as defaultThemeColors,
|
|
596
|
+
ht as deleteAutosaveSnapshot,
|
|
597
|
+
ft as describeCollaborationShellState,
|
|
598
|
+
Fe as exportAllSlidesToSvg,
|
|
599
|
+
Me as exportAllSlidesToSvgBlobs,
|
|
600
|
+
He as exportSlideAsSvg,
|
|
601
|
+
Le as exportSlideToSvg,
|
|
602
|
+
Ue as exportSlideToSvgBlob,
|
|
603
|
+
bt as forgetSessionDeck,
|
|
604
|
+
_t as getAutosaveSnapshot,
|
|
605
|
+
yt as getSessionTabId,
|
|
606
|
+
Ct as isLegacyBinaryPresentation,
|
|
607
|
+
Pt as isSupportedPresentationFile,
|
|
608
|
+
kt as listAutosaveSnapshots,
|
|
609
|
+
Et as loadPresentationDeck,
|
|
610
|
+
wt as loadSessionDeck,
|
|
611
|
+
Tt as parsePresentationSessionId,
|
|
612
|
+
It as presentationBaseName,
|
|
613
|
+
We as registerTranslations,
|
|
614
|
+
Ot as rememberSessionDeck,
|
|
615
|
+
xe as renderToCanvas,
|
|
616
|
+
At as restoreSessionDeck,
|
|
617
|
+
Bt as savedPresentationFileName,
|
|
618
|
+
Nt as themeToCssVars,
|
|
619
|
+
Rt as vermilionDarkColors,
|
|
620
|
+
Dt as vermilionDarkTheme,
|
|
621
|
+
xt as vermilionLightColors,
|
|
622
|
+
Ft as vermilionLightTheme,
|
|
623
|
+
Lt as vermilionRadius
|
|
60
624
|
};
|