pptx-svelte-viewer 1.0.0 → 1.2.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.
@@ -3,6 +3,6 @@
3
3
  * framework-agnostic `ViewerTheme` system (types, defaults, CSS-variable
4
4
  * helpers, and the Vermilion presets), mirroring the Vue package.
5
5
  */
6
- export type { ViewerTheme, ViewerThemeColors } from 'pptx-viewer-shared';
7
- export { defaultCssVars, defaultRadius, defaultThemeColors, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, } from 'pptx-viewer-shared';
6
+ export type { ThemeCatalogEntry, ViewerTheme, ViewerThemeColors } from 'pptx-viewer-shared';
7
+ export { defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, THEME_CATALOG, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, } from 'pptx-viewer-shared';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EACN,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,GACf,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EACN,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,GACf,MAAM,oBAAoB,CAAC"}
@@ -2397,14 +2397,38 @@ Item 3`,
2397
2397
  function n(e) {
2398
2398
  return (e.split(".").pop() ?? e).replace(/(?<lower>[a-z])(?<upper>[A-Z])/gu, "$<lower> $<upper>").replace(/^./u, (t) => t.toUpperCase());
2399
2399
  }
2400
- var i = /* @__PURE__ */ new Map([["en", a]]);
2401
- function x(e, t) {
2400
+ var x = [
2401
+ {
2402
+ code: "en",
2403
+ label: "English",
2404
+ nativeLabel: "English"
2405
+ },
2406
+ {
2407
+ code: "fr",
2408
+ label: "French",
2409
+ nativeLabel: "Français"
2410
+ },
2411
+ {
2412
+ code: "es",
2413
+ label: "Spanish",
2414
+ nativeLabel: "Español"
2415
+ },
2416
+ {
2417
+ code: "de",
2418
+ label: "German",
2419
+ nativeLabel: "Deutsch"
2420
+ }
2421
+ ], i = /* @__PURE__ */ new Map([["en", a]]);
2422
+ function d(e, t) {
2402
2423
  const p = i.get(e);
2403
2424
  i.set(e, p ? {
2404
2425
  ...p,
2405
2426
  ...t
2406
2427
  } : { ...t });
2407
2428
  }
2429
+ function c() {
2430
+ return [...i.keys()];
2431
+ }
2408
2432
  function s(e, t) {
2409
2433
  return t ? e.replace(/\{\{(?<name>\w+)\}\}/gu, (p, r) => {
2410
2434
  const o = t[r];
@@ -2415,14 +2439,16 @@ function l(e, t, p) {
2415
2439
  const r = e.split("-")[0], o = i.get(e)?.[t] ?? i.get(r)?.[t] ?? a[t];
2416
2440
  return o !== void 0 ? s(o, p) : n(t);
2417
2441
  }
2418
- function d(e) {
2442
+ function m(e) {
2419
2443
  return (t, p) => l(e(), t, p);
2420
2444
  }
2421
2445
  export {
2422
- n as a,
2423
- l as i,
2424
- s as n,
2425
- a as o,
2426
- x as r,
2427
- d as t
2446
+ l as a,
2447
+ a as c,
2448
+ d as i,
2449
+ c as n,
2450
+ x as o,
2451
+ s as r,
2452
+ n as s,
2453
+ m as t
2428
2454
  };
@@ -1,9 +1,10 @@
1
1
  import { PptxSlide } from 'pptx-viewer-core';
2
- import { CanvasSize, ToolbarActionId, ViewerPreferences, ViewerTheme } from 'pptx-viewer-shared';
2
+ import { AccountAuthConfig, CanvasSize, ToolbarActionId, ViewerPreferences, ViewerTheme } from 'pptx-viewer-shared';
3
3
  import { FindReplaceState } from '../../editor/editor-find-replace.svelte';
4
4
  import { EditorState } from '../../editor/editor-state.svelte';
5
5
  import { ExportUiState } from '../../export/export-ui.svelte';
6
6
  import { AutosaveStatus } from '../../state/autosave.svelte';
7
+ import { ChromeUiState } from '../../state/chrome-ui.svelte';
7
8
  /**
8
9
  * Prop contracts for the ribbon shell and its tabs. Kept in a plain `.ts`
9
10
  * module per repo convention: SFCs stay thin presentation, types live in
@@ -43,10 +44,14 @@ export interface RibbonProps {
43
44
  isPasswordProtected: boolean;
44
45
  autosaveStatus?: AutosaveStatus;
45
46
  autosaveDirty?: boolean;
46
- /** Collaboration entry points, kept in the primary row like React's chrome. */
47
+ /** Collaboration entry points: Share on the tab row, broadcast in the Present dropdown (React parity). */
47
48
  onshare?: () => void;
48
49
  onbroadcast?: () => void;
49
50
  collabActive?: boolean;
51
+ /** Side-panel (slides rail / inspector) open state + toggles for the primary row. */
52
+ chromeUi?: ChromeUiState;
53
+ /** Whether live subtitles are currently enabled (Present dropdown checkmark). */
54
+ subtitlesEnabled?: boolean;
50
55
  /** Toolbar buttons/ribbon tabs to hide; see `PowerPointViewerProps.hiddenActions`. */
51
56
  hiddenActions?: ToolbarActionId[];
52
57
  /** Slide Show tab actions: enter presentation from slide 0 or the current slide. */
@@ -98,5 +103,7 @@ export interface RibbonProps {
98
103
  */
99
104
  theme: ViewerTheme | undefined;
100
105
  onsettheme: (theme: ViewerTheme | undefined) => void;
106
+ /** File tab > Account: disabled-by-default sign-in hook point. */
107
+ accountAuth?: AccountAuthConfig;
101
108
  }
102
109
  //# sourceMappingURL=ribbon-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"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Record<string, string>;
7849
7849
  }
7850
7850
 
7851
+ /** One selectable entry in the viewer chrome's built-in theme picker (File > Options > Appearance). */
7852
+ interface ThemeCatalogEntry {
7853
+ /** Stable identifier persisted to storage and passed to `onThemeChange`. */
7854
+ key: string;
7855
+ /** `pptx.*` translation key for the entry's display label. */
7856
+ labelKey: string;
7857
+ /** The theme to apply, or `undefined` to reset to the built-in default. */
7858
+ theme: ViewerTheme | undefined;
7859
+ }
7860
+
7851
7861
  /**
7852
7862
  * Framework-agnostic public types shared by the viewer bindings.
7853
7863
  *
@@ -8037,6 +8047,21 @@ interface ViewerFontSource {
8037
8047
  weight?: string | number;
8038
8048
  style?: 'normal' | 'italic';
8039
8049
  }
8050
+ /**
8051
+ * Optional hook point for hosts that want to wire a real sign-in flow into
8052
+ * File > Account. Disabled by default: the Account page renders nothing
8053
+ * extra unless a host explicitly opts in by passing `enabled: true`.
8054
+ * See docs/guide for wiring instructions.
8055
+ */
8056
+ interface AccountAuthConfig {
8057
+ enabled: boolean;
8058
+ onSignIn: () => void;
8059
+ signedInUser?: {
8060
+ name: string;
8061
+ email?: string;
8062
+ avatarUrl?: string;
8063
+ };
8064
+ }
8040
8065
 
8041
8066
  /**
8042
8067
  * Toolbar action / ribbon-tab visibility: a single, framework-agnostic
@@ -8107,6 +8132,16 @@ interface PrintSettings {
8107
8132
  customRangeTo: number;
8108
8133
  }
8109
8134
 
8135
+ /** One selectable entry in the viewer chrome's built-in language picker (File > Options > Language). */
8136
+ interface LocaleCatalogEntry {
8137
+ /** BCP-47-ish locale code, e.g. `'en'`, `'fr'`. Matches `pptx-viewer-locales`' exports. */
8138
+ code: string;
8139
+ /** English display name, used before a translation dictionary for the target locale is loaded. */
8140
+ label: string;
8141
+ /** The locale's own name for itself, e.g. `'Français'` for `fr`. */
8142
+ nativeLabel: string;
8143
+ }
8144
+
8110
8145
  /**
8111
8146
  * Animated-GIF export capture/encode pipeline. All the pure logic is shared:
8112
8147
  * `planGifFrames` derives the per-slide frame delays (default duration +
@@ -8232,6 +8267,49 @@ interface PowerPointViewerProps {
8232
8267
  theme?: ViewerTheme;
8233
8268
  /** UI locale (BCP 47). English ships built in; register others via `pptx-svelte-viewer/i18n`. */
8234
8269
  locale?: string;
8270
+ /**
8271
+ * Initial File > Options > Appearance selection: a key into `availableThemes`
8272
+ * (or the built-in `THEME_CATALOG` when unset). Falls back to a value
8273
+ * persisted in `localStorage` (see `pptx-viewer-shared`'s
8274
+ * `readStoredViewerPrefs`), then `'default'`. Once the user picks a theme
8275
+ * from the Design tab or Options, that choice (`themeKey`) is the single
8276
+ * source of truth for `effectiveTheme` for the rest of the session; the
8277
+ * `theme` prop above still wins whenever the resolved key is `'default'`
8278
+ * (its entry maps to `undefined`), preserving prior host-prop precedence.
8279
+ */
8280
+ defaultThemeKey?: string;
8281
+ /** Theme choices offered by File > Options > Appearance. Defaults to the built-in `THEME_CATALOG`. */
8282
+ availableThemes?: readonly ThemeCatalogEntry[];
8283
+ /**
8284
+ * Fired when the user picks a theme (Design tab or File > Options >
8285
+ * Appearance) with the selected catalog key. Supplying this hands
8286
+ * persistence to the host; without it, the choice is written to
8287
+ * `localStorage` automatically.
8288
+ */
8289
+ onThemeChange?: (themeKey: string) => void;
8290
+ /**
8291
+ * Initial File > Options > Language selection (locale code). Falls back to
8292
+ * a value persisted in `localStorage`, then the `locale` prop. Once the
8293
+ * user picks a language from Options, that choice always wins over `locale`
8294
+ * for the rest of the session: unlike `theme`, there is no "host forces
8295
+ * this language no matter what" case in this binding.
8296
+ */
8297
+ defaultLocale?: string;
8298
+ /** Language choices offered by File > Options > Language. Defaults to every locale registered via `pptx-svelte-viewer/i18n`'s `registerTranslations`, labelled from the shared `LOCALE_CATALOG`. */
8299
+ availableLocales?: readonly LocaleCatalogEntry[];
8300
+ /**
8301
+ * Fired when the user picks a language from File > Options > Language with
8302
+ * the selected locale code. Supplying this hands persistence to the host;
8303
+ * without it, the choice is written to `localStorage` automatically. Note
8304
+ * this only switches which registered dictionary is read; registering the
8305
+ * dictionary itself is a separate step (`registerTranslations`).
8306
+ */
8307
+ onLocaleChange?: (locale: string) => void;
8308
+ /**
8309
+ * Optional hook point for a real sign-in flow in File > Account. Disabled
8310
+ * by default (renders nothing extra) unless `enabled: true`.
8311
+ */
8312
+ accountAuth?: AccountAuthConfig;
8235
8313
  /** Slide shown after load (0-based, clamped). Default 0. */
8236
8314
  initialSlide?: number;
8237
8315
  /** Show the thumbnail sidebar. Default true. */
@@ -8476,6 +8554,8 @@ declare class PresentationLoader {
8476
8554
  /** Whether the loaded package contains a VBA project. */
8477
8555
  hasMacros: boolean;
8478
8556
  notesCanvasSize: CanvasSize | undefined;
8557
+ /** Packaged theme parts (`ppt/theme/*.xml`) selectable in the inspector. */
8558
+ themeOptions: PptxThemeOption[];
8479
8559
  /** Slide canvas size in pixels. */
8480
8560
  canvasSize: CanvasSize;
8481
8561
  /** Archive-path -> displayable URL map for media + poster frames. */
@@ -1,4 +1,4 @@
1
- import { a as o, c as a, d as s, f as t, i as r, l, n as i, o as S, p as d, r as n, s as p, t as v, u as x } from "../export-tBg928r6.js";
1
+ import { a as o, c as a, d as s, f as t, i as r, l, n as i, o as S, p as d, r as n, s as p, t as v, u as x } from "../export-CalS6VEm.js";
2
2
  export {
3
3
  v as PowerPointViewer,
4
4
  a as PresentationLoader,
@@ -0,0 +1,25 @@
1
+ /**
2
+ * ChromeUiState: reactive open/collapsed state for the editing chrome's side
3
+ * panels, mirroring React's `useViewerState` flags (`isSidebarCollapsed`,
4
+ * `isInspectorPaneOpen`, `inspectorTab`). Owned by `PowerPointViewer` and
5
+ * threaded to both the ribbon's primary row (the toggle buttons) and
6
+ * `ViewerBody` (which gates the thumbnail rail and inspector pane on it).
7
+ */
8
+ /** The inspector pane's tab strip, matching React's `InspectorTab`. */
9
+ export type InspectorTabId = 'elements' | 'properties' | 'comments';
10
+ export declare class ChromeUiState {
11
+ /** Left thumbnail rail visibility (React: `isSidebarCollapsed`). */
12
+ sidebarCollapsed: boolean;
13
+ /** Right inspector pane visibility (React: `isInspectorPaneOpen`). */
14
+ inspectorOpen: boolean;
15
+ /** Active inspector tab (React defaults to Properties). */
16
+ inspectorTab: InspectorTabId;
17
+ toggleSidebar(): void;
18
+ toggleInspector(): void;
19
+ setInspectorTab(tab: InspectorTabId): void;
20
+ /** Comments toolbar button: toggle the inspector's Comments tab. */
21
+ toggleComments(): void;
22
+ /** True when the inspector is showing the Comments tab. */
23
+ get commentsOpen(): boolean;
24
+ }
25
+ //# sourceMappingURL=chrome-ui.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome-ui.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/chrome-ui.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAEpE,qBAAa,aAAa;IACzB,oEAAoE;IACpE,gBAAgB,UAAiB;IACjC,sEAAsE;IACtE,aAAa,UAAgB;IAC7B,2DAA2D;IAC3D,YAAY,iBAAwC;IAEpD,aAAa,IAAI,IAAI;IAIrB,eAAe,IAAI,IAAI;IAIvB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAI1C,oEAAoE;IACpE,cAAc,IAAI,IAAI;IAStB,2DAA2D;IAC3D,IAAI,YAAY,IAAI,OAAO,CAE1B;CACD"}
@@ -3,6 +3,8 @@ export type { NavigationAction } from './navigation';
3
3
  export { enterFullscreen, exitFullscreen, isFullscreenActive, isFullscreenSupported, toggleFullscreen, } from './fullscreen';
4
4
  export { resolveLazyImages, resolveMediaUrls, revokeBlobUrls } from './loader-helpers';
5
5
  export type { ResolvedMedia } from './loader-helpers';
6
+ export { ChromeUiState } from './chrome-ui.svelte';
7
+ export type { InspectorTabId } from './chrome-ui.svelte';
6
8
  export { PresentationLoader } from './presentation-loader.svelte';
7
9
  export { ViewerState } from './viewer-state.svelte';
8
10
  export { provideSmartArt3D, useSmartArt3D } from './smart-art-3d-context';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,GACd,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACN,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvF,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,GACd,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACN,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvF,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxPresentationProperties, PptxThemeOption } from 'pptx-viewer-core';
2
+ import { CanvasSize } from 'pptx-viewer-shared';
3
+ import { EditorState } from '../editor/editor-state.svelte';
4
+ import { PresentationLoader } from './presentation-loader.svelte';
5
+ /**
6
+ * Deck-level state and mutations behind the inspector's no-selection
7
+ * Properties tab: the Svelte port of Vue's `useInspectorDeckActions` (itself
8
+ * mirroring the relevant pieces of React's `useThemeHandlers` and the
9
+ * viewer-level canvas-size / document-property setters).
10
+ *
11
+ * Provided from `PowerPointViewer` via Svelte context (see
12
+ * {@link provideInspectorDeck}) so `InspectorPanel` can reach it from any
13
+ * mount point (viewer body, master view, mobile sheets) without threading a
14
+ * prop through every intermediate component.
15
+ */
16
+ export interface InspectorDeckActions {
17
+ /** Packaged theme parts (`ppt/theme/*.xml`) selectable in the THEME card. */
18
+ readonly themeOptions: PptxThemeOption[];
19
+ /** Slide canvas size in px (the loader's reactive value). */
20
+ readonly canvasSize: CanvasSize;
21
+ /** Notes page size in px, when the package declares one. */
22
+ readonly notesCanvasSize: CanvasSize | undefined;
23
+ /** Apply a packaged theme part by archive path (React's `handleApplyTheme`). */
24
+ applyThemeByPath(themePath: string, applyToAllMasters: boolean): void;
25
+ /** Resize the slide canvas (inspector SLIDE SIZE card). */
26
+ updateCanvasSize(size: CanvasSize): void;
27
+ /** Patch deck-wide slide-show / print settings (PRESENTATION card). */
28
+ updatePresentationProperties(patch: Partial<PptxPresentationProperties>): void;
29
+ /** Patch document core properties (Title / Author / ...). */
30
+ updateCoreProperties(patch: Partial<PptxCoreProperties>): void;
31
+ /** Patch application properties (Company / Application). */
32
+ updateAppProperties(patch: Partial<PptxAppProperties>): void;
33
+ /** Replace the custom document-property list. */
34
+ updateCustomProperties(next: PptxCustomProperty[]): void;
35
+ }
36
+ export interface InspectorDeckDeps {
37
+ loader: PresentationLoader;
38
+ editor: EditorState;
39
+ }
40
+ /** Build the deck-action facade over the loader + history-tracked editor. */
41
+ export declare function createInspectorDeckActions(deps: InspectorDeckDeps): InspectorDeckActions;
42
+ /**
43
+ * Context key for the inspector deck actions. Exported so tests (and
44
+ * out-of-tree mounts) can seed it via `mount(Component, { context: new
45
+ * Map([[INSPECTOR_DECK_CONTEXT_KEY, deck]]) })`; mirrors `I18N_CONTEXT_KEY`.
46
+ */
47
+ export declare const INSPECTOR_DECK_CONTEXT_KEY: unique symbol;
48
+ /** Provide the deck actions to the component subtree (root component only). */
49
+ export declare function provideInspectorDeck(deck: InspectorDeckActions): void;
50
+ /** Consume the nearest provided deck actions; undefined in standalone mounts. */
51
+ export declare function useInspectorDeck(): InspectorDeckActions | undefined;
52
+ //# sourceMappingURL=inspector-deck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector-deck.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/inspector-deck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,EAAE,eAAe,EAAE,CAAC;IACzC,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,4DAA4D;IAC5D,QAAQ,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,CAAC;IACjD,gFAAgF;IAChF,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,GAAG,IAAI,CAAC;IACtE,2DAA2D;IAC3D,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACzC,uEAAuE;IACvE,4BAA4B,CAAC,KAAK,EAAE,OAAO,CAAC,0BAA0B,CAAC,GAAG,IAAI,CAAC;IAC/E,6DAA6D;IAC7D,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;IAC/D,4DAA4D;IAC5D,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAC7D,iDAAiD;IACjD,sBAAsB,CAAC,IAAI,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC;CACzD;AAED,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC;CACpB;AAED,6EAA6E;AAC7E,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,iBAAiB,GAAG,oBAAoB,CAmFxF;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,eAAuC,CAAC;AAE/E,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAErE;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,IAAI,oBAAoB,GAAG,SAAS,CAEnE"}
@@ -1,4 +1,4 @@
1
- import { ParsedTableStyleMap, PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxEmbeddedFont, PptxHandoutMaster, PptxHeaderFooter, PptxNotesMaster, PptxPresentationProperties, PptxCustomShow, PptxSection, PptxSlide, PptxSlideMaster, PptxThemeColorScheme, PptxTheme, PptxHandler } from 'pptx-viewer-core';
1
+ import { ParsedTableStyleMap, PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxEmbeddedFont, PptxHandoutMaster, PptxHeaderFooter, PptxNotesMaster, PptxPresentationProperties, PptxCustomShow, PptxSection, PptxSlide, PptxSlideMaster, PptxThemeColorScheme, PptxTheme, PptxThemeOption, PptxHandler } from 'pptx-viewer-core';
2
2
  import { CanvasSize } from 'pptx-viewer-shared';
3
3
  /**
4
4
  * Reactive load pipeline for the Svelte viewer: the runes port of the Vue
@@ -31,6 +31,8 @@ export declare class PresentationLoader {
31
31
  /** Whether the loaded package contains a VBA project. */
32
32
  hasMacros: boolean;
33
33
  notesCanvasSize: CanvasSize | undefined;
34
+ /** Packaged theme parts (`ppt/theme/*.xml`) selectable in the inspector. */
35
+ themeOptions: PptxThemeOption[];
34
36
  /** Slide canvas size in pixels. */
35
37
  canvasSize: CanvasSize;
36
38
  /** Archive-path -> displayable URL map for media + poster frames. */
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-loader.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/presentation-loader.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,WAAW,EACX,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAsB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;;IAC9B,8DAA8D;IAC9D,MAAM,cAA+B;IACrC,wEAAwE;IACxE,YAAY,oBAAqC;IACjD,WAAW,8BAAsD;IACjE,aAAa,gCAAwD;IACrE,QAAQ,gBAAiC;IACzC,YAAY,mBAAoC;IAChD,sBAAsB,6BAA8C;IACpE,WAAW,mBAAoC;IAC/C,cAAc,iCAAyD;IACvE,aAAa,gCAAwD;IACrE,gBAAgB,uBAAwC;IACxD,aAAa,qBAAsC;IACnD,oBAAoB,UAAiB;IACrC,qBAAqB,SAAa;IAClC,mBAAmB,UAAiB;IACpC,yDAAyD;IACzD,SAAS,UAAiB;IAC1B,eAAe,yBAAiD;IAChE,mCAAmC;IACnC,UAAU,aAGP;IACH,qEAAqE;IACrE,aAAa,sBAA8C;IAC3D,4EAA4E;IAC5E,WAAW,mCAA2D;IACtE,iBAAiB,wBAAgD;IACjE,qEAAqE;IACrE,aAAa,kCAA0D;IACvE,sCAAsC;IACtC,OAAO,UAAiB;IACxB,wDAAwD;IACxD,KAAK,gBAA+B;IACpC,wEAAwE;IACxE,WAAW,UAAiB;IAC5B,4DAA4D;IAC5D,OAAO,qBAAwC;IAC/C,wEAAwE;IACxE,SAAS,SAAa;IAKtB,yDAAyD;IACnD,IAAI,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAgFxD,qEAAqE;IACrE,OAAO,IAAI,IAAI;CAQf"}
1
+ {"version":3,"file":"presentation-loader.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/presentation-loader.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,WAAW,EACX,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAsB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;;IAC9B,8DAA8D;IAC9D,MAAM,cAA+B;IACrC,wEAAwE;IACxE,YAAY,oBAAqC;IACjD,WAAW,8BAAsD;IACjE,aAAa,gCAAwD;IACrE,QAAQ,gBAAiC;IACzC,YAAY,mBAAoC;IAChD,sBAAsB,6BAA8C;IACpE,WAAW,mBAAoC;IAC/C,cAAc,iCAAyD;IACvE,aAAa,gCAAwD;IACrE,gBAAgB,uBAAwC;IACxD,aAAa,qBAAsC;IACnD,oBAAoB,UAAiB;IACrC,qBAAqB,SAAa;IAClC,mBAAmB,UAAiB;IACpC,yDAAyD;IACzD,SAAS,UAAiB;IAC1B,eAAe,yBAAiD;IAChE,4EAA4E;IAC5E,YAAY,oBAAqC;IACjD,mCAAmC;IACnC,UAAU,aAGP;IACH,qEAAqE;IACrE,aAAa,sBAA8C;IAC3D,4EAA4E;IAC5E,WAAW,mCAA2D;IACtE,iBAAiB,wBAAgD;IACjE,qEAAqE;IACrE,aAAa,kCAA0D;IACvE,sCAAsC;IACtC,OAAO,UAAiB;IACxB,wDAAwD;IACxD,KAAK,gBAA+B;IACpC,wEAAwE;IACxE,WAAW,UAAiB;IAC5B,4DAA4D;IAC5D,OAAO,qBAAwC;IAC/C,wEAAwE;IACxE,SAAS,SAAa;IAKtB,yDAAyD;IACnD,IAAI,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAqFxD,qEAAqE;IACrE,OAAO,IAAI,IAAI;CAQf"}
@@ -1,5 +1,6 @@
1
1
  import { PptxSaveFormat } from 'pptx-viewer-core';
2
- import { CanvasSize, CollaborationConfig, CollaborationRole, CollaborationTransport, PowerPointViewerAPI, ToolbarActionId, ViewerFontSource, ViewerTheme } from 'pptx-viewer-shared';
2
+ import { AccountAuthConfig, CanvasSize, CollaborationConfig, CollaborationRole, CollaborationTransport, PowerPointViewerAPI, ThemeCatalogEntry, ToolbarActionId, ViewerFontSource, ViewerTheme } from 'pptx-viewer-shared';
3
+ import { LocaleCatalogEntry } from 'pptx-viewer-shared/i18n';
3
4
  import { ExportGifOptions, ExportPdfOptions, ExportVideoOptions, PrintOptions } from './export';
4
5
  /**
5
6
  * Public component types for the Svelte PowerPoint viewer.
@@ -33,6 +34,49 @@ export interface PowerPointViewerProps {
33
34
  theme?: ViewerTheme;
34
35
  /** UI locale (BCP 47). English ships built in; register others via `pptx-svelte-viewer/i18n`. */
35
36
  locale?: string;
37
+ /**
38
+ * Initial File > Options > Appearance selection: a key into `availableThemes`
39
+ * (or the built-in `THEME_CATALOG` when unset). Falls back to a value
40
+ * persisted in `localStorage` (see `pptx-viewer-shared`'s
41
+ * `readStoredViewerPrefs`), then `'default'`. Once the user picks a theme
42
+ * from the Design tab or Options, that choice (`themeKey`) is the single
43
+ * source of truth for `effectiveTheme` for the rest of the session; the
44
+ * `theme` prop above still wins whenever the resolved key is `'default'`
45
+ * (its entry maps to `undefined`), preserving prior host-prop precedence.
46
+ */
47
+ defaultThemeKey?: string;
48
+ /** Theme choices offered by File > Options > Appearance. Defaults to the built-in `THEME_CATALOG`. */
49
+ availableThemes?: readonly ThemeCatalogEntry[];
50
+ /**
51
+ * Fired when the user picks a theme (Design tab or File > Options >
52
+ * Appearance) with the selected catalog key. Supplying this hands
53
+ * persistence to the host; without it, the choice is written to
54
+ * `localStorage` automatically.
55
+ */
56
+ onThemeChange?: (themeKey: string) => void;
57
+ /**
58
+ * Initial File > Options > Language selection (locale code). Falls back to
59
+ * a value persisted in `localStorage`, then the `locale` prop. Once the
60
+ * user picks a language from Options, that choice always wins over `locale`
61
+ * for the rest of the session: unlike `theme`, there is no "host forces
62
+ * this language no matter what" case in this binding.
63
+ */
64
+ defaultLocale?: string;
65
+ /** Language choices offered by File > Options > Language. Defaults to every locale registered via `pptx-svelte-viewer/i18n`'s `registerTranslations`, labelled from the shared `LOCALE_CATALOG`. */
66
+ availableLocales?: readonly LocaleCatalogEntry[];
67
+ /**
68
+ * Fired when the user picks a language from File > Options > Language with
69
+ * the selected locale code. Supplying this hands persistence to the host;
70
+ * without it, the choice is written to `localStorage` automatically. Note
71
+ * this only switches which registered dictionary is read; registering the
72
+ * dictionary itself is a separate step (`registerTranslations`).
73
+ */
74
+ onLocaleChange?: (locale: string) => void;
75
+ /**
76
+ * Optional hook point for a real sign-in flow in File > Account. Disabled
77
+ * by default (renders nothing extra) unless `enabled: true`.
78
+ */
79
+ accountAuth?: AccountAuthConfig;
36
80
  /** Slide shown after load (0-based, clamped). Default 0. */
37
81
  initialSlide?: number;
38
82
  /** Show the thumbnail sidebar. Default true. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/viewer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EACX,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,MAAM,UAAU,CAAC;AAElB;;;;;;;;;GASG;AACH,YAAY,EACX,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,WAAW,GACX,CAAC;AAEF,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAChC,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,sCAAsC;AACtC,MAAM,WAAW,qBAAqB;IACrC,6DAA6D;IAC7D,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACpD,8DAA8D;IAC9D,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,iGAAiG;IACj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AC,CAAC;IACrE,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,uEAAuE;IACvE,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C;;;;OAIG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,2DAA2D;IAC3D,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD;;;OAGG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD;;;;;OAKG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAChD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-svelte-viewer",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Svelte 5 PowerPoint viewer component: render PPTX slides in the browser.",
5
5
  "keywords": [
6
6
  "office",