pptx-svelte-viewer 4.51.0 → 4.52.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/dist/index.d.ts CHANGED
@@ -223,6 +223,16 @@ interface PowerPointViewerProps extends ViewportFitOptions {
223
223
  * invalid `baseUrl` disables the fallback (with a console warning).
224
224
  */
225
225
  googleFonts?: GoogleFontsOption;
226
+ /**
227
+ * Host switch for content a deck links from another server (http(s)
228
+ * relationship targets): pictures, picture fills and bullets, video, audio
229
+ * and poster frames. `false`: none of it is fetched. `true`: it is allowed.
230
+ * Either value locks File > Options > Trust Center > "Allow external
231
+ * content" to match; unset keeps the user's choice there. Google Fonts
232
+ * requests are separate (see `googleFonts`).
233
+ * A change applies from the next load.
234
+ */
235
+ allowExternalContent?: boolean;
226
236
  /** Show the thumbnail sidebar. Default true. */
227
237
  showThumbnails?: boolean;
228
238
  /** Show the navigation/zoom toolbar. Default true. */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as o, c as s, l as r, o as t, s as S, t as a, y as i } from "./export-DmRFHsQq.js";
1
+ import { a as o, c as s, l as r, o as t, s as S, t as a, y as i } from "./export-BH2tsoL2.js";
2
2
  import { i as T } from "./translator-2U8GG-ce.js";
3
3
  import "./i18n.js";
4
4
  import { BACKSTAGE_CARD_IDS as n, BACKSTAGE_PAGE_IDS as E, CANVAS_CONTEXT_MENU_COMMAND_IDS as O, EDITOR_SHORTCUT_ACTION_IDS as D, ELEMENT_CONTEXT_MENU_COMMAND_IDS as N, OPTIONS_PAGE_IDS as A, OPTIONS_SECTION_IDS as m, OPTIONS_SETTING_IDS as C, PPTX_OPEN_ACCEPT as P, PRESENTATION_OPEN_EXTENSIONS as d, RIBBON_CONTROL_IDS as R, RIBBON_GROUP_IDS as p, RIBBON_TAB_IDS as v, TOOLBAR_BUTTON_IDS as B, VIEWER_DIALOG_IDS as g, VIEWER_EXPORT_FORMAT_IDS as h, VIEWER_FEATURE_IDS as c, VIEWER_PANEL_IDS as u, createImageElementFromFile as L, defaultCssVars as M, defaultRadius as V, defaultThemeColors as f, deleteAutosaveSnapshot as k, describeCollaborationShellState as G, forgetSessionDeck as b, getAutosaveSnapshot as x, getSessionTabId as F, isLegacyBinaryPresentation as U, isSupportedPresentationFile as X, listAutosaveSnapshots as W, loadPresentationDeck as y, loadSessionDeck as w, parsePresentationSessionId as K, presentationBaseName as H, rememberSessionDeck as j, restoreSessionDeck as q, savedPresentationFileName as z, themeToCssVars as J, vermilionDarkColors as Q, vermilionDarkTheme as Y, vermilionLightColors as Z, vermilionLightTheme as $, vermilionRadius as ee } from "ooxml-ui/pptx";
@@ -310,6 +310,16 @@ interface PowerPointViewerProps extends ViewportFitOptions {
310
310
  * invalid `baseUrl` disables the fallback (with a console warning).
311
311
  */
312
312
  googleFonts?: GoogleFontsOption;
313
+ /**
314
+ * Host switch for content a deck links from another server (http(s)
315
+ * relationship targets): pictures, picture fills and bullets, video, audio
316
+ * and poster frames. `false`: none of it is fetched. `true`: it is allowed.
317
+ * Either value locks File > Options > Trust Center > "Allow external
318
+ * content" to match; unset keeps the user's choice there. Google Fonts
319
+ * requests are separate (see `googleFonts`).
320
+ * A change applies from the next load.
321
+ */
322
+ allowExternalContent?: boolean;
313
323
  /** Show the thumbnail sidebar. Default true. */
314
324
  showThumbnails?: boolean;
315
325
  /** Show the navigation/zoom toolbar. Default true. */
@@ -1194,6 +1204,13 @@ declare class EditorElementController {
1194
1204
  constructor(editor: EditorState);
1195
1205
  resetNudge(): void;
1196
1206
  patchGeometry(id: string, box: ElementBoxPatch): void;
1207
+ /**
1208
+ * Merge `patch` into `id` WITHOUT history, the dirty flag or a change event:
1209
+ * a live frame its caller commits later as one undo step (a gesture frame, or
1210
+ * a shade of a colour picker drag, which shared `createLiveColorInput` puts
1211
+ * back before its one committed edit).
1212
+ */
1213
+ previewElement(id: string, patch: Partial<PptxElement>): void;
1197
1214
  deleteSelected(): void;
1198
1215
  duplicateSelected(): string | null;
1199
1216
  applyElementPatch(id: string, patch: Partial<PptxElement>): void;
@@ -1971,6 +1988,8 @@ declare class EditorState {
1971
1988
  commitChange(): void;
1972
1989
  /** Patch geometry without history for live gesture preview frames. */
1973
1990
  patchGeometry: (id: string, box: ElementBoxPatch) => void;
1991
+ /** Merge a live frame into an element without history (a colour picker drag's shade). */
1992
+ previewElement: (id: string, patch: Partial<PptxElement>) => void;
1974
1993
  replaceActiveElements(elements: PptxElement[]): void;
1975
1994
  /** Commit a replacement active element collection as one undo step. */
1976
1995
  commitActiveElements(elements: PptxElement[]): void;
@@ -2303,41 +2322,50 @@ interface StageCanvasContextMenu {
2303
2322
 
2304
2323
  /**
2305
2324
  * Reactive Find & Replace panel state for the Home tab's Editing group.
2306
- * Wraps the shared, framework-agnostic `render/find-replace` functions
2307
- * (pure slide-array search/replace); this class owns only the panel's UI
2308
- * state (query, current match, open/closed) and routes every replace through
2309
- * the host's history-tracked commit so undo/redo cover it.
2325
+ * The session (matches, current match, replace plans, the search after a
2326
+ * replace) is the shared `find-replace-session` model, kept here in
2327
+ * `$state.raw`; this class adds the panel's open flag and routes every replace
2328
+ * through the host's history-tracked commit so undo/redo cover it.
2310
2329
  */
2311
2330
  interface FindReplaceDeps {
2312
2331
  getSlides(): readonly PptxSlide[];
2313
2332
  /** Commit a fully-replaced slide array (pushes history, marks dirty). */
2314
2333
  commitSlides(next: PptxSlide[]): void;
2315
- /** Called with the match's slide/element so the host can navigate to it. */
2316
- onNavigate?(slideIndex: number, elementId: string): void;
2334
+ /** Called with the match's slide and element (null for a speaker-notes match). */
2335
+ onNavigate?(slideIndex: number, elementId: string | null): void;
2317
2336
  }
2318
2337
  declare class FindReplaceState {
2319
2338
  #private;
2320
2339
  open: boolean;
2321
- query: string;
2322
- replacement: string;
2323
- matchCase: boolean;
2324
- includeNotes: boolean;
2325
- includeChartTitles: boolean;
2326
- includeChartData: boolean;
2327
- results: FindResult[];
2328
- index: number;
2329
2340
  constructor(deps: FindReplaceDeps);
2341
+ /** The query; setting it searches. */
2342
+ get query(): string;
2343
+ set query(query: string);
2344
+ get replacement(): string;
2345
+ set replacement(replacement: string);
2346
+ get matchCase(): boolean;
2347
+ set matchCase(matchCase: boolean);
2348
+ get includeNotes(): boolean;
2349
+ set includeNotes(includeNotes: boolean);
2350
+ get includeChartTitles(): boolean;
2351
+ set includeChartTitles(includeChartTitles: boolean);
2352
+ get includeChartData(): boolean;
2353
+ set includeChartData(includeChartData: boolean);
2354
+ get results(): readonly FindResult[];
2355
+ /** Zero-based current match; -1 when there is none. */
2356
+ get index(): number;
2330
2357
  get hasResults(): boolean;
2331
2358
  get matchCount(): number;
2332
2359
  toggle(): void;
2360
+ /** Close the panel; its matches go with it. */
2333
2361
  close(): void;
2334
- /** Re-run the search from the current query/matchCase and jump to the first match. */
2362
+ /** Re-run the search from the current query and scopes and jump to the first match. */
2335
2363
  search(): void;
2336
2364
  next(): void;
2337
2365
  prev(): void;
2338
- /** Replace the current match, then refresh the result set. */
2366
+ /** Replace the current match, then move on to the next one. */
2339
2367
  replaceCurrent(): void;
2340
- /** Replace every match of the current query, then refresh the result set. */
2368
+ /** Replace every match of the current query, then search again. */
2341
2369
  replaceAll(): void;
2342
2370
  }
2343
2371
 
@@ -2763,6 +2791,16 @@ declare class ViewerState {
2763
2791
  /** Keep navigation bounds aligned when editor operations change the deck. */
2764
2792
  setSlideCount(slideCount: number): void;
2765
2793
  goTo(index: number): void;
2794
+ /**
2795
+ * Go to `index` for a selection the caller makes there straight away: the slide-change effect
2796
+ * keeps that selection instead of dropping it.
2797
+ */
2798
+ goToWithSelection(index: number): void;
2799
+ /**
2800
+ * Whether the slide change that landed on `index` came with its own selection (see
2801
+ * {@link goToWithSelection}). Asking drops the note, so it holds for one slide change only.
2802
+ */
2803
+ takeSelectionSlide(index: number): boolean;
2766
2804
  next(): void;
2767
2805
  prev(): void;
2768
2806
  first(): void;
@@ -3564,7 +3602,12 @@ declare class CompareController {
3564
3602
  open: boolean;
3565
3603
  accepted: Set<number>;
3566
3604
  rejected: Set<number>;
3567
- constructor(editor: EditorState);
3605
+ /**
3606
+ * @param allowExternalImages Read on each Compare: whether the incoming deck
3607
+ * may reference linked http(s) content (the resolved host switch or Trust
3608
+ * Center option). Off when omitted.
3609
+ */
3610
+ constructor(editor: EditorState, allowExternalImages?: () => boolean);
3568
3611
  chooseFile(): Promise<void>;
3569
3612
  accept(index: number): void;
3570
3613
  reject(index: number): void;
@@ -3729,7 +3772,13 @@ declare class ViewerParityUiState {
3729
3772
  * `viewPropertiesPatchFromPreferences` later read back) a single object.
3730
3773
  */
3731
3774
  preferences: DeckViewPreferences;
3732
- constructor(editor: EditorState);
3775
+ /**
3776
+ * Whether a deck this viewer opens besides the main one (Compare, Reuse
3777
+ * Slides) may reference linked http(s) content: the resolved host
3778
+ * `allowExternalContent` switch or Trust Center option, read on each use.
3779
+ */
3780
+ readonly allowExternalImages: () => boolean;
3781
+ constructor(editor: EditorState, allowExternalImages?: () => boolean);
3733
3782
  syncAutosave(enabled: boolean): void;
3734
3783
  updatePreferences(next: DeckViewPreferences, onAutosaveChange: (enabled: boolean) => void): void;
3735
3784
  }
@@ -3764,6 +3813,8 @@ interface CreateViewerStateOptions {
3764
3813
  getInitialSlide: () => number;
3765
3814
  /** Host `googleFonts` prop: the Google Fonts fallback policy. */
3766
3815
  getGoogleFonts?: () => GoogleFontsOption | undefined;
3816
+ /** Host `allowExternalContent` prop: overrides the Trust Center setting for every load when set. */
3817
+ getAllowExternalContent?: () => boolean | undefined;
3767
3818
  /** Already locale-bound translator; propagated to descendants via context. */
3768
3819
  t: Translator;
3769
3820
  getSmartArt3D: () => boolean;
@@ -1,5 +1,5 @@
1
1
  import "../transition-overlay-BgsFZeU8.js";
2
- import { S as e, _ as a, a as S, b as o, c as v, d as n, f as d, g as r, h as b, i as p, l as c, m, n as g, o as x, p as w, r as C, s as T, t as $, u as y, v as s, x as t } from "../export-DmRFHsQq.js";
2
+ import { S as e, _ as a, a as S, b as o, c as v, d as n, f as d, g as r, h as b, i as p, l as c, m, n as g, o as x, p as w, r as C, s as T, t as $, u as y, v as s, x as t } from "../export-BH2tsoL2.js";
3
3
  var P = e, V = t, u = s, A = a, R = r, f = o;
4
4
  export {
5
5
  A as CollaborationCursors,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-svelte-viewer",
3
- "version": "4.51.0",
3
+ "version": "4.52.0",
4
4
  "description": "pptx-viewer for Svelte 5: a PowerPoint viewer and editor component to render, edit, present, and export PPTX slides in the browser.",
5
5
  "keywords": [
6
6
  "office",
@@ -116,8 +116,8 @@
116
116
  "html2canvas-pro": "^2.5.2",
117
117
  "jspdf": "^4.2.1",
118
118
  "jszip": "^3.10.2",
119
- "ooxml-core": "^1.26.0",
120
- "ooxml-ui": "^1.27.0",
119
+ "ooxml-core": "^1.27.0",
120
+ "ooxml-ui": "^1.28.0",
121
121
  "opentype.js": "^2.0.0"
122
122
  },
123
123
  "devDependencies": {