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