pptx-svelte-viewer 2.13.2 → 2.14.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/AiChatPanel-CxiPgWT5.js +1269 -0
  3. package/dist/{export-Oh-2dcFv.js → export-XXVZWCfW.js} +35610 -28444
  4. package/dist/i18n.js +1 -1
  5. package/dist/index.d.ts +44 -2
  6. package/dist/index.js +17 -17
  7. package/dist/pptx-svelte-viewer.css +1 -1
  8. package/dist/{translator-DqUAMimH.js → translator-CUlfH48o.js} +73 -2
  9. package/dist/viewer/ai/ai-chat-history.svelte.d.ts +32 -0
  10. package/dist/viewer/ai/ai-chat-history.svelte.d.ts.map +1 -0
  11. package/dist/viewer/ai/chat.svelte.d.ts +2 -0
  12. package/dist/viewer/ai/chat.svelte.d.ts.map +1 -1
  13. package/dist/viewer/collab/collaboration-presence.svelte.d.ts.map +1 -1
  14. package/dist/viewer/components/props-elements.d.ts +9 -0
  15. package/dist/viewer/components/props-elements.d.ts.map +1 -1
  16. package/dist/viewer/components/props-stage.d.ts +14 -1
  17. package/dist/viewer/components/props-stage.d.ts.map +1 -1
  18. package/dist/viewer/components/viewer-body-props.d.ts +9 -3
  19. package/dist/viewer/components/viewer-body-props.d.ts.map +1 -1
  20. package/dist/viewer/editor/editor-insert-chart.d.ts +7 -3
  21. package/dist/viewer/editor/editor-insert-chart.d.ts.map +1 -1
  22. package/dist/viewer/editor/editor-slide-ops.d.ts +11 -0
  23. package/dist/viewer/editor/editor-slide-ops.d.ts.map +1 -1
  24. package/dist/viewer/editor/editor-slides-controller.d.ts +10 -0
  25. package/dist/viewer/editor/editor-slides-controller.d.ts.map +1 -1
  26. package/dist/viewer/export/export-controller.svelte.d.ts +11 -1
  27. package/dist/viewer/export/export-controller.svelte.d.ts.map +1 -1
  28. package/dist/viewer/export/export-ui.svelte.d.ts +5 -0
  29. package/dist/viewer/export/export-ui.svelte.d.ts.map +1 -1
  30. package/dist/viewer/export/export-wiring.svelte.d.ts +5 -1
  31. package/dist/viewer/export/export-wiring.svelte.d.ts.map +1 -1
  32. package/dist/viewer/index.d.ts +103 -4
  33. package/dist/viewer/index.js +15 -15
  34. package/dist/viewer/render/chart-view.d.ts +8 -2
  35. package/dist/viewer/render/chart-view.d.ts.map +1 -1
  36. package/dist/viewer/state/create-viewer-state-export-notes.svelte.d.ts +2 -0
  37. package/dist/viewer/state/create-viewer-state-export-notes.svelte.d.ts.map +1 -1
  38. package/dist/viewer/state/create-viewer-state.svelte.d.ts.map +1 -1
  39. package/dist/viewer/state/deck-export-data.d.ts +11 -0
  40. package/dist/viewer/state/deck-export-data.d.ts.map +1 -0
  41. package/dist/viewer/state/render-context.d.ts +10 -1
  42. package/dist/viewer/state/render-context.d.ts.map +1 -1
  43. package/dist/viewer/state/viewer-state.svelte.d.ts +4 -2
  44. package/dist/viewer/state/viewer-state.svelte.d.ts.map +1 -1
  45. package/dist/viewer/state/viewer-store.svelte.d.ts +12 -0
  46. package/dist/viewer/state/viewer-store.svelte.d.ts.map +1 -0
  47. package/dist/viewer/style/element-style.d.ts.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/AiChatPanel-DhIVPoPf.js +0 -1109
  50. package/dist/viewer/ai/ai-chat-persistence.svelte.d.ts +0 -23
  51. package/dist/viewer/ai/ai-chat-persistence.svelte.d.ts.map +0 -1
  52. package/dist/viewer/ai/ai-history-persist.d.ts +0 -13
  53. package/dist/viewer/ai/ai-history-persist.d.ts.map +0 -1
@@ -2155,6 +2155,17 @@ interface PptxChartUserShape {
2155
2155
  * ```
2156
2156
  */
2157
2157
  type PptxChartType = 'bar' | 'line' | 'pie' | 'ofPie' | 'doughnut' | 'area' | 'scatter' | 'bubble' | 'radar' | 'stock' | 'bar3D' | 'line3D' | 'pie3D' | 'area3D' | 'surface' | 'histogram' | 'waterfall' | 'funnel' | 'treemap' | 'sunburst' | 'boxWhisker' | 'regionMap' | 'combo' | 'unknown';
2158
+ /**
2159
+ * Bar series direction (OOXML `ST_BarDir`): `"col"` is a vertical column
2160
+ * chart, `"bar"` a horizontal bar chart.
2161
+ *
2162
+ * @example
2163
+ * ```ts
2164
+ * const dir: PptxChartBarDirection = "col";
2165
+ * // => "col" - one of: "col" | "bar"
2166
+ * ```
2167
+ */
2168
+ type PptxChartBarDirection = 'col' | 'bar';
2158
2169
  /**
2159
2170
  * Supported trendline regression types.
2160
2171
  *
@@ -2814,6 +2825,12 @@ interface PptxChartData {
2814
2825
  * (`c:holeSize/@val`, 10 through 90). Absent uses the renderer default.
2815
2826
  */
2816
2827
  doughnutHoleSize?: number;
2828
+ /**
2829
+ * Bar series direction (`c:barDir/@val`): `"col"` draws vertical columns,
2830
+ * `"bar"` draws horizontal bars. Absent means `"col"` (PowerPoint's own
2831
+ * default), so only horizontal bar charts need to carry the field.
2832
+ */
2833
+ barDirection?: PptxChartBarDirection;
2817
2834
  /**
2818
2835
  * Bar/column gap between category clusters as a percentage of bar width
2819
2836
  * (`c:gapWidth/@val`, 0 through 500). Absent uses the renderer default.
@@ -5188,7 +5205,12 @@ interface PptxNativeAnimation {
5188
5205
  motionPath?: string;
5189
5206
  /** Motion origin: "layout" or "parent". */
5190
5207
  motionOrigin?: string;
5191
- /** Whether the element auto-rotates to follow the motion path tangent (`p:animMotion/@rAng` = "0"). */
5208
+ /**
5209
+ * Whether the element auto-rotates to follow the motion path tangent.
5210
+ * Viewer-authoring-only hint: OOXML has no such flag (`p:animMotion/@rAng`
5211
+ * is a plain rotation angle that PowerPoint writes as "0" on every path),
5212
+ * so the parser never sets this.
5213
+ */
5192
5214
  motionPathRotateAuto?: boolean;
5193
5215
  /** Path edit mode from `p:animMotion/@pathEditMode` (e.g. "relative", "fixed"). */
5194
5216
  motionPathEditMode?: string;
@@ -7103,6 +7125,8 @@ interface ChartInput {
7103
7125
  hasLegend?: boolean;
7104
7126
  legendPosition?: 't' | 'b' | 'l' | 'r' | 'tr';
7105
7127
  grouping?: 'clustered' | 'stacked' | 'percentStacked';
7128
+ /** Bar series direction (`c:barDir`): vertical columns (default) or horizontal bars. */
7129
+ barDirection?: 'col' | 'bar';
7106
7130
  }
7107
7131
  interface ChartOptions extends Partial<ElementPosition> {}
7108
7132
  interface ConnectorOptions extends Partial<ElementPosition> {
@@ -8263,6 +8287,24 @@ declare class PptxHandler extends PptxHandlerCore {
8263
8287
  * ```
8264
8288
  */
8265
8289
  static create(options?: PresentationOptions): Promise<PresentationBuilderResult>;
8290
+ /**
8291
+ * Parse a presentation from an `ArrayBuffer`, accepting both `.pptx`
8292
+ * archives and portable `pptx-viewer-json` documents.
8293
+ *
8294
+ * The buffer is sniffed first: JSON documents (leading `{` plus the
8295
+ * `"pptx-viewer-json"` format marker) are routed to {@link loadFromJson};
8296
+ * everything else goes through the regular ZIP/OLE2 pipeline.
8297
+ */
8298
+ load(data: ArrayBuffer, options?: PptxHandlerLoadOptions): Promise<PptxData>;
8299
+ /**
8300
+ * Load a presentation from `pptx-viewer-json` text.
8301
+ *
8302
+ * A minimal blank package is generated and loaded first so that the
8303
+ * handler keeps a valid in-memory archive (editing and {@link save} keep
8304
+ * working), then the imported model is overlaid on top: imported
8305
+ * presentation fields win, and the slide array is replaced wholesale.
8306
+ */
8307
+ loadFromJson(text: string, options?: PptxHandlerLoadOptions): Promise<PptxData>;
8266
8308
  }
8267
8309
  //#endregion
8268
8310
  //#region src/converter/SvgExporter.d.ts
@@ -8654,6 +8696,33 @@ interface SectionSlideGroup<TSection extends SectionGroupDescriptor = PptxSectio
8654
8696
  slides: PptxSlide[];
8655
8697
  slideIndexes: number[];
8656
8698
  }
8699
+ //#endregion
8700
+ //#region src/render/slide-templates/slide-template-types.d.ts
8701
+ /** Discriminated id for every built-in slide template. */
8702
+ type SlideTemplateId = 'title' | 'titleAndContent' | 'sectionHeader' | 'agenda' | 'twoContent' | 'comparison' | 'quote' | 'timeline' | 'keyMetrics' | 'titleOnly' | 'blank' | 'closing';
8703
+ /**
8704
+ * Options for building a template's slide content.
8705
+ *
8706
+ * `scheme` maps theme colour keys (accent1, tx1, bg1, ...) to resolved hex
8707
+ * values; pass the loaded deck's `themeColorMap` so inserted slides inherit
8708
+ * the deck look. Missing keys fall back to the Office default scheme.
8709
+ */
8710
+ interface SlideTemplateBuildOptions {
8711
+ /** Target slide width in px (defaults to 1280). */
8712
+ slideWidth?: number;
8713
+ /** Target slide height in px (defaults to 720). */
8714
+ slideHeight?: number;
8715
+ /** Theme colour key to resolved hex map (e.g. `PptxData.themeColorMap`). */
8716
+ scheme?: Record<string, string>;
8717
+ /** Element id factory; index is the element's ordinal within the slide. */
8718
+ idFor?: (index: number) => string;
8719
+ /**
8720
+ * Translator for the placeholder content written onto template slides
8721
+ * (keys under `pptx.slideTemplates.content.*`). Defaults to the canonical
8722
+ * English dictionary so untranslated hosts still get sensible text.
8723
+ */
8724
+ translate?: (key: string) => string;
8725
+ }
8657
8726
  /** A snap alignment line: `axis: 'v'` is a vertical line at x=`position`. */
8658
8727
  interface SnapLine {
8659
8728
  axis: 'h' | 'v';
@@ -9240,7 +9309,7 @@ type PptxAiUIMessage = UIMessage;
9240
9309
  * live deck); the viewer-only tools (navigation, deck outline, element/notes
9241
9310
  * readers, table merge) have no MCP counterpart.
9242
9311
  */
9243
- type PptxAiToolName = 'get_deck_overview' | 'get_slide' | 'get_element' | 'get_speaker_notes' | 'find_text' | 'get_theme' | 'go_to_slide' | 'select_elements' | 'merge_tables' | 'get_metadata' | 'get_layouts' | 'find_placeholders' | 'get_presentation_properties' | 'run_accessibility_check' | 'convert_to_markdown' | 'add_element' | 'update_element' | 'delete_elements' | 'arrange_elements' | 'clone_element' | 'set_element_animation' | 'group_elements' | 'ungroup_elements' | 'batch_update_elements' | 'update_element_style' | 'replace_geometry' | 'set_element_lock' | 'manage_hyperlinks' | 'replace_text' | 'manage_comments' | 'update_table_cells' | 'manage_table_structure' | 'create_chart' | 'update_chart' | 'add_chart_series' | 'remove_chart_series' | 'update_chart_series_data' | 'manage_smart_art' | 'apply_template' | 'add_slide' | 'duplicate_slide' | 'delete_slides' | 'reorder_slides' | 'update_slide_properties' | 'set_slide_transition' | 'apply_theme_preset' | 'update_theme_colors' | 'update_theme_fonts' | 'set_canvas_size' | 'update_metadata' | 'manage_sections' | 'update_presentation_properties' | 'apply_layout';
9312
+ type PptxAiToolName = 'get_deck_overview' | 'get_slide' | 'get_element' | 'get_speaker_notes' | 'find_text' | 'get_theme' | 'go_to_slide' | 'select_elements' | 'merge_tables' | 'get_metadata' | 'get_layouts' | 'find_placeholders' | 'get_presentation_properties' | 'run_accessibility_check' | 'convert_to_markdown' | 'export_to_json' | 'add_element' | 'update_element' | 'delete_elements' | 'arrange_elements' | 'clone_element' | 'set_element_animation' | 'group_elements' | 'ungroup_elements' | 'batch_update_elements' | 'update_element_style' | 'replace_geometry' | 'set_element_lock' | 'manage_hyperlinks' | 'replace_text' | 'manage_comments' | 'update_table_cells' | 'manage_table_structure' | 'create_chart' | 'update_chart' | 'add_chart_series' | 'remove_chart_series' | 'update_chart_series_data' | 'manage_smart_art' | 'apply_template' | 'add_slide' | 'duplicate_slide' | 'delete_slides' | 'reorder_slides' | 'update_slide_properties' | 'set_slide_transition' | 'apply_theme_preset' | 'update_theme_colors' | 'update_theme_fonts' | 'set_canvas_size' | 'update_metadata' | 'manage_sections' | 'update_presentation_properties' | 'import_from_json' | 'apply_layout';
9244
9313
  type Resolvable<T> = T | (() => T | Promise<T>);
9245
9314
  /** How the assistant reaches a language model. */
9246
9315
  type PptxAiConnection =
@@ -9581,6 +9650,10 @@ interface ExportControllerDeps {
9581
9650
  openPrintWindow?: OpenPrintWindow;
9582
9651
  /** Base file name (without extension) for downloads. Defaults to `presentation`. */
9583
9652
  fileName?: string;
9653
+ /** Live presentation data for the deck-JSON export; undefined before a load. */
9654
+ getDeckData?(): PptxData | undefined;
9655
+ /** Source file name for the deck-JSON download (`deck.pptx` -> `deck.json`). */
9656
+ getFileName?(): string | undefined;
9584
9657
  }
9585
9658
  /**
9586
9659
  * Export controller (runes class): render slides to PNG / PDF / animated GIF /
@@ -9606,6 +9679,12 @@ declare class ExportController {
9606
9679
  exportSlidePng(index?: number): Promise<void>;
9607
9680
  /** Copy a slide to the system clipboard as a PNG image. */
9608
9681
  copySlideAsImage(index?: number): Promise<void>;
9682
+ /**
9683
+ * Serialize the live deck to `pptx-viewer-json` and trigger the download.
9684
+ * Pure data serialization (shared `exportDeckJson`): synchronous, no
9685
+ * rasterization pipeline, no progress modal, no `exporting` toggle.
9686
+ */
9687
+ exportJson(): void;
9609
9688
  /** Export every slide as a multi-page PDF download (one slide per page). */
9610
9689
  exportPdf(options?: ExportPdfOptions): Promise<void>;
9611
9690
  /**
@@ -9939,6 +10018,10 @@ interface SlideCanvasProps {
9939
10018
  ontablecellcommit?: (elementId: string, rowIndex: number, cellIndex: number, text: string) => void;
9940
10019
  onsmartartnodecommit?: (elementId: string, nodeId: string, text: string) => void;
9941
10020
  onsmartartnodefill?: (elementId: string, nodeId: string, fill: string) => void;
10021
+ /** Passed through to `SlideStage`; see {@link SlideStageProps.comments}. */
10022
+ comments?: readonly PptxComment[];
10023
+ /** Passed through to `SlideStage`; see {@link SlideStageProps.oncommentmarkerclick}. */
10024
+ oncommentmarkerclick?: (commentId: string) => void;
9942
10025
  /** Reports the stage-holder node to the host on mount/teardown (editing hit-surface, export capture anchor). */
9943
10026
  onstageholder?: (el: HTMLDivElement | null) => void;
9944
10027
  onstagepointerdown?: (event: PointerEvent) => void;
@@ -10007,6 +10090,11 @@ declare class ExportUiState {
10007
10090
  get exporting(): boolean;
10008
10091
  /** Export the current slide as PNG (no modal; quick single capture). */
10009
10092
  runPng(): void;
10093
+ /**
10094
+ * Export the deck as a `pptx-viewer-json` download (no modal; a pure,
10095
+ * synchronous serialization with no capture pipeline).
10096
+ */
10097
+ runJson(): void;
10010
10098
  /** Copy the current slide to the system image clipboard. */
10011
10099
  runCopyImage(): void;
10012
10100
  /** Run the PDF export with the progress modal wired. */
@@ -10537,6 +10625,15 @@ declare class EditorSlidesController {
10537
10625
  constructor(editor: EditorState);
10538
10626
  /** Insert a blank slide after the current one. Returns its new index, or null when not editable. */
10539
10627
  insertSlideAfterCurrent(): number | null;
10628
+ /**
10629
+ * Insert a shared-catalogue template slide after the current one, as one
10630
+ * undoable step (Home > Slide Templates gallery). The caller (the gallery
10631
+ * launcher, which can read the render context) passes the deck's scheme and
10632
+ * canvas size in `options` so the slide inherits the theme; without them
10633
+ * the shared builder falls back to the Office default scheme at 1280x720.
10634
+ * Returns the new index, or null when not editable.
10635
+ */
10636
+ insertSlideFromTemplate(templateId: SlideTemplateId, options?: SlideTemplateBuildOptions): number | null;
10540
10637
  /** Duplicate the current slide. Returns its new index, or null when not editable. */
10541
10638
  duplicateCurrentSlide(): number | null;
10542
10639
  /** Delete the current slide. Returns the new active index, or null (not editable / only slide). */
@@ -11177,14 +11274,16 @@ declare class PresentationLoader {
11177
11274
  * essentials, kept out of the SFC so it is unit-testable without a DOM.
11178
11275
  */
11179
11276
  declare class ViewerState {
11277
+ #private;
11180
11278
  /** Number of slides in the loaded presentation. */
11181
11279
  slideCount: number;
11182
11280
  /** Active slide index (0-based). */
11183
11281
  current: number;
11184
- /** Manual zoom percent, or `null` for fit-to-viewport. */
11185
- zoomPercent: number | null;
11186
11282
  /** True while the viewer root is the fullscreen element. */
11187
11283
  isFullscreen: boolean;
11284
+ /** Manual zoom percent, or `null` for fit-to-viewport. */
11285
+ get zoomPercent(): number | null;
11286
+ set zoomPercent(percent: number | null);
11188
11287
  /** Reset for a freshly-loaded presentation. */
11189
11288
  reset(slideCount: number, initialSlide?: number): void;
11190
11289
  goTo(index: number): void;
@@ -1,22 +1,22 @@
1
- import { $ as s, D as e, O as a, a as i, c as t, d as l, et as S, f as n, g as v, i as d, k as o, l as b, n as g, o as p, r as c, s as x, t as w, u as T } from "../export-Oh-2dcFv.js";
2
- var m = o, P = a, V = e;
1
+ import { A as e, O as a, a as s, c as t, d as i, f as l, g as S, i as n, k as o, l as v, n as d, nt as b, o as g, r as p, rt as c, s as x, t as w, u as T } from "../export-XXVZWCfW.js";
2
+ var m = e, A = o, P = a;
3
3
  export {
4
4
  w as PowerPointViewer,
5
- d as PresentationLoader,
5
+ n as PresentationLoader,
6
6
  m as Ribbon,
7
- V as SlideCanvas,
8
- c as ViewerState,
9
- P as ViewerToolbar,
7
+ P as SlideCanvas,
8
+ p as ViewerState,
9
+ A as ViewerToolbar,
10
10
  T as clampSlideIndex,
11
- v as createSvelteAiBridge,
12
- g as createViewerState,
13
- i as exportAllSlidesToSvg,
14
- p as exportAllSlidesToSvgBlobs,
11
+ S as createSvelteAiBridge,
12
+ d as createViewerState,
13
+ s as exportAllSlidesToSvg,
14
+ g as exportAllSlidesToSvgBlobs,
15
15
  x as exportSlideAsSvg,
16
16
  t as exportSlideToSvg,
17
- b as exportSlideToSvgBlob,
18
- l as fitScale,
19
- n as resolveNavigationKey,
20
- s as zoomInPercent,
21
- S as zoomOutPercent
17
+ v as exportSlideToSvgBlob,
18
+ i as fitScale,
19
+ l as resolveNavigationKey,
20
+ b as zoomInPercent,
21
+ c as zoomOutPercent
22
22
  };
@@ -15,8 +15,14 @@ export type ChartView = {
15
15
  * (which itself falls back to the default chart palette).
16
16
  */
17
17
  export declare function resolveChartPalette(chartData: PptxChartData): string[];
18
- /** Build the renderable view (or placeholder) for a chart element. */
19
- export declare function buildChartView(element: ChartPptxElement): ChartView;
18
+ /**
19
+ * Build the renderable view (or placeholder) for a chart element.
20
+ *
21
+ * @param translate - The binding's translator, used for the placeholder
22
+ * caption. It is optional so the pure unit tests can call this without an
23
+ * i18n context; a viewer always passes one.
24
+ */
25
+ export declare function buildChartView(element: ChartPptxElement, translate?: (key: string, params?: Record<string, string>) => string): ChartView;
20
26
  /** One positioned legend entry (swatch + label). */
21
27
  export interface ChartLegendItem {
22
28
  key: string;
@@ -1 +1 @@
1
- {"version":3,"file":"chart-view.d.ts","sourceRoot":"","sources":["../../../src/viewer/render/chart-view.ts"],"names":[],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AAE,cAAc,CAAC;IAAC,mBAAmB,EAAE,MAAM,GAAG,eAAe,CAAA;CAAE,GACpF;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,EAAE,CAKtE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC7B,OAAO,EAAE,gBAAgB,EACzB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,GAClE,SAAS,CA8BX;AAED,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,cAAc,GAAG,eAAe,EAAE,CActE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEhF"}
@@ -20,6 +20,8 @@ export interface ExportNotesClusterDeps {
20
20
  * slide-number / date / footer runs exactly like the on-screen stage does.
21
21
  */
22
22
  getFieldContext?(): FieldSubstitutionContext;
23
+ /** Host-supplied source file name, used to name the deck-JSON download. */
24
+ getFileName?(): string | undefined;
23
25
  onnotesupdate?: (notes: string) => void;
24
26
  }
25
27
  export interface ExportNotesCluster {
@@ -1 +1 @@
1
- {"version":3,"file":"create-viewer-state-export-notes.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/create-viewer-state-export-notes.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,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AoDxF"}
1
+ {"version":3,"file":"create-viewer-state-export-notes.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/create-viewer-state-export-notes.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,WAAW,sBAAsB;IACtC,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,CAAC,EAAE,UAAU,CAAC;IACd,aAAa,IAAI,OAAO,CAAC;IACzB,SAAS,IAAI,cAAc,GAAG,SAAS,CAAC;IACxC,sFAAsF;IACtF,WAAW,IAAI,OAAO,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,IAAI,wBAAwB,CAAC;IAC7C,2EAA2E;IAC3E,WAAW,CAAC,IAAI,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,cAAc,CAAC;IAC3C,aAAa,IAAI,IAAI,CAAC;IACtB,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IACjD,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;CAC7D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,sBAAsB,GAAG,kBAAkB,CAsDxF"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-viewer-state.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/create-viewer-state.svelte.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAU5F;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,cAAc,CAoPnF"}
1
+ {"version":3,"file":"create-viewer-state.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/create-viewer-state.svelte.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAU5F;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,cAAc,CAsPnF"}
@@ -0,0 +1,11 @@
1
+ import { PptxData } from 'pptx-viewer-core';
2
+ import { EditorState } from '../editor/editor-state.svelte';
3
+ import { PresentationLoader } from './presentation-loader.svelte';
4
+ /**
5
+ * Assemble the live {@link PptxData} for the deck-JSON export (the "Export as
6
+ * JSON" backstage card). Reads come off the same seams the AI bridge's deck
7
+ * tools use: undoable document state from the editor, parse-time presentation
8
+ * parts from the loader.
9
+ */
10
+ export declare function buildDeckExportData(editor: EditorState, loader: PresentationLoader): PptxData;
11
+ //# sourceMappingURL=deck-export-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deck-export-data.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/deck-export-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,GAAG,QAAQ,CAyB7F"}
@@ -1,11 +1,20 @@
1
1
  import { ParsedTableStyleMap, PptxThemeColorScheme, PptxThemeFontScheme } from 'pptx-viewer-core';
2
- import { TableStyleContext } from 'pptx-viewer-shared';
2
+ import { CanvasSize, TableStyleContext } from 'pptx-viewer-shared';
3
3
  export interface RenderContextSource {
4
4
  getColorScheme: () => PptxThemeColorScheme | undefined;
5
5
  getTableStyleMap: () => ParsedTableStyleMap | undefined;
6
6
  /** Theme font scheme, so band/header cell text can resolve major/minor fonts. */
7
7
  getFontScheme?: () => PptxThemeFontScheme | undefined;
8
+ /** Deck canvas size, so template insertion can target the real slide surface. */
9
+ getCanvasSize?: () => CanvasSize | undefined;
8
10
  }
9
11
  export declare function provideRenderContext(source: RenderContextSource): void;
12
+ /**
13
+ * The raw render-context source, for chrome that needs the deck's colour
14
+ * scheme or canvas size outside a table (e.g. the Slide Templates gallery).
15
+ * Must be called during component init; invoke the getters lazily so reads
16
+ * stay live against the loader's runes state.
17
+ */
18
+ export declare function getRenderContextSource(): RenderContextSource | undefined;
10
19
  export declare function useTableStyleContext(): TableStyleContext | undefined;
11
20
  //# sourceMappingURL=render-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-context.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/render-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAK5D,MAAM,WAAW,mBAAmB;IACnC,cAAc,EAAE,MAAM,oBAAoB,GAAG,SAAS,CAAC;IACvD,gBAAgB,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAC;IACxD,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAC;CACtD;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAEtE;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,SAAS,CAWpE"}
1
+ {"version":3,"file":"render-context.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/render-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAKxE,MAAM,WAAW,mBAAmB;IACnC,cAAc,EAAE,MAAM,oBAAoB,GAAG,SAAS,CAAC;IACvD,gBAAgB,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAC;IACxD,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAC;IACtD,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,UAAU,GAAG,SAAS,CAAC;CAC7C;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,mBAAmB,GAAG,SAAS,CAExE;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,SAAS,CAWpE"}
@@ -4,14 +4,16 @@
4
4
  * essentials, kept out of the SFC so it is unit-testable without a DOM.
5
5
  */
6
6
  export declare class ViewerState {
7
+ #private;
7
8
  /** Number of slides in the loaded presentation. */
8
9
  slideCount: number;
9
10
  /** Active slide index (0-based). */
10
11
  current: number;
11
- /** Manual zoom percent, or `null` for fit-to-viewport. */
12
- zoomPercent: number | null;
13
12
  /** True while the viewer root is the fullscreen element. */
14
13
  isFullscreen: boolean;
14
+ /** Manual zoom percent, or `null` for fit-to-viewport. */
15
+ get zoomPercent(): number | null;
16
+ set zoomPercent(percent: number | null);
15
17
  /** Reset for a freshly-loaded presentation. */
16
18
  reset(slideCount: number, initialSlide?: number): void;
17
19
  goTo(index: number): void;
@@ -1 +1 @@
1
- {"version":3,"file":"viewer-state.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/viewer-state.svelte.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,qBAAa,WAAW;IACvB,mDAAmD;IACnD,UAAU,SAAa;IACvB,oCAAoC;IACpC,OAAO,SAAa;IACpB,0DAA0D;IAC1D,WAAW,gBAA+B;IAC1C,4DAA4D;IAC5D,YAAY,UAAiB;IAE7B,+CAA+C;IAC/C,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,SAAI,GAAG,IAAI;IAMjD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzB,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIZ,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI;IAItC,OAAO,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI;IAIvC,SAAS,IAAI,IAAI;IAIjB;;;OAGG;IACH,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAqBzC"}
1
+ {"version":3,"file":"viewer-state.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/viewer-state.svelte.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,qBAAa,WAAW;;IACvB,mDAAmD;IACnD,UAAU,SAAa;IACvB,oCAAoC;IACpC,OAAO,SAAa;IAUpB,4DAA4D;IAC5D,YAAY,UAAiB;IAE7B,0DAA0D;IAC1D,IAAI,WAAW,IAAI,MAAM,GAAG,IAAI,CAG/B;IAED,IAAI,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAMrC;IAED,+CAA+C;IAC/C,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,SAAI,GAAG,IAAI;IAMjD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzB,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIZ,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI;IAStC,OAAO,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI;IAOvC,SAAS,IAAI,IAAI;IAIjB;;;OAGG;IACH,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAqBzC"}
@@ -0,0 +1,12 @@
1
+ import { ViewerStore, ViewerStoreEquality } from 'pptx-viewer-shared';
2
+ export declare class ViewerStoreSelection<T> {
3
+ #private;
4
+ constructor(subscribe: (set: (value: T) => void) => () => void, initial: T);
5
+ /** The selected value. Reading this inside an effect tracks it. */
6
+ get value(): T;
7
+ /** Tear down the subscription. */
8
+ destroy(): void;
9
+ }
10
+ /** Subscribe to one projection of a viewer store as reactive Svelte state. */
11
+ export declare function viewerStoreSelection<S, T>(store: ViewerStore<S>, selector: (state: S) => T, isEqual?: ViewerStoreEquality<T>): ViewerStoreSelection<T>;
12
+ //# sourceMappingURL=viewer-store.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewer-store.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/state/viewer-store.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,oBAAoB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,wBAAgB,WAAW,CAC1B,EAAE,EAAE,WAAW,EACf,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,MAAM,GAAG,SAAS,CAEpB"}
1
+ {"version":3,"file":"element-style.d.ts","sourceRoot":"","sources":["../../../src/viewer/style/element-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAkBtD;;;;;GAKG;AAEH,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACtC,EAAE,EAAE,WAAW,EACf,eAAe,CAAC,EAAE,UAAU,EAK5B,YAAY,CAAC,EAAE,OAAO,EACtB,cAAc,CAAC,EAAE,OAAO,GACtB,WAAW,CA6Ib;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,UAAU,EAC5B,YAAY,CAAC,EAAE,OAAO,EACtB,cAAc,CAAC,EAAE,OAAO,GACtB,WAAW,CAQb;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAC1B,EAAE,EAAE,WAAW,EACf,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,MAAM,GAAG,SAAS,CAEpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-svelte-viewer",
3
- "version": "2.13.2",
3
+ "version": "2.14.0",
4
4
  "description": "Svelte 5 PowerPoint viewer and editor component: render, edit, present, and export PPTX slides in the browser.",
5
5
  "keywords": [
6
6
  "office",