pptx-svelte-viewer 4.74.0 → 4.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import * as svelte from 'svelte';
2
2
  import { Component } from 'svelte';
3
3
  import * as ooxml_ui_pptx from 'ooxml-ui/pptx';
4
- import { PrintSettings, CanvasSize, RasterizeElementResult, RasterizeElementTilesResult, ViewportFitOptions, ViewerFontSource, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, GoogleFontsOption, ListConversionScope, PptxLoadLimits, ToolbarActionId, RibbonAddInTab, ViewerCustomization, DocumentStorage, CloudFileProvider, ViewerAutosaveStatus, AutosaveRecord, ConnectionStatus, CollaborationInput, CollaborationConfig, CollaborationState, PowerPointViewerAPI, ViewerCustomizationApi, RemoteCursor, SanitizedPresence, PptxAutosaveStatusKind, DeckSaveIntent, InlineTextDraft, AnimationGroup, AlignEdge, DistributeAxis, MergeShapeOperation, PasteSpecialFormat, CropSession, CropElementUpdate, TemplateElementMap, HistoryTheme, ElementBoxPatch, EditorHistoryController, InkStrokeView, InkPoint, MasterViewCrudAction, MasterViewCrudActionId, FreeformToolKind, EditPointsElementPatch, SlideTemplateId, SlideTemplateBuildOptions, SlidePasteRequest, RibbonTransitionDraft, CellCoord, CellRect, PendingInlineTextEdit, InlineListController, ElementClipboardPayload, TableStyleSaveOptions, FontEmbeddingDescriptor, InlineTextEditSnapshot, SnapGuideInput, CollaborationLivePatcher, InlineTextDraftSink, ResolvedKeyboardCustomization, MarqueeRect, ShapeAdjustmentHandleDescriptor, SnapLine, ResizeHandleId, ConnectorEndpointKind, CollaborationInlineEditor, FindResult, ViewerPreferences, CollaborationTransport, YDocLike, YjsFactories, CollabProviderHandle, CollaborationHistoryTarget, CollabLoadOrigin, BroadcastConfig, ElementAnimationState, AuthoredSlideRange, RunProgramNotice, ZoomNavigationTarget, PresentationSnapshot, AutosaveRecoveryPrompt, CompatibilityWarningToast, SlideSizeEmu, DeckWebfontProgress, LoadLimitTranslate, ReadOnlyRecommendation, ReadOnlyBannerPasswordError, ViewerOptions, ViewerOptionsStoreInit, ToolbarTabId, ViewerOptionsGroupId, ViewerOptionPrimitive, ViewerOptionsConstraints, CompareResult, Guide, DeckViewPreferences, CloudDocumentController, SaveProgressController, ResolvedCustomization, ViewerMode, ViewportFitPadding, CollaborationShellState, AutosaveDisabledReason, MobileSheetKey, FieldSubstitutionContext, SlidesPaneLayoutGalleryRequest } from 'ooxml-ui/pptx';
4
+ import { PrintSettings, CanvasSize, RasterizeElementResult, RasterizeElementTilesResult, ViewportFitOptions, ViewerFontSource, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, GoogleFontsOption, ListConversionScope, PptxLoadLimits, ToolbarActionId, RibbonAddInTab, RibbonDisplayMode, ViewerCustomization, DocumentStorage, CloudFileProvider, ViewerAutosaveStatus, AutosaveRecord, ConnectionStatus, CollaborationInput, CollaborationConfig, CollaborationState, PowerPointViewerAPI, ViewerCustomizationApi, RemoteCursor, SanitizedPresence, PptxAutosaveStatusKind, DeckSaveIntent, InlineTextDraft, AnimationGroup, AlignEdge, DistributeAxis, MergeShapeOperation, PasteSpecialFormat, CropSession, CropElementUpdate, TemplateElementMap, HistoryTheme, ElementBoxPatch, EditorHistoryController, InkStrokeView, InkPoint, MasterViewCrudAction, MasterViewCrudActionId, FreeformToolKind, EditPointsElementPatch, SlideTemplateId, SlideTemplateBuildOptions, SlidePasteRequest, RibbonTransitionDraft, CellCoord, CellRect, PendingInlineTextEdit, InlineListController, ElementClipboardPayload, TableStyleSaveOptions, FontEmbeddingDescriptor, InlineTextEditSnapshot, SnapGuideInput, CollaborationLivePatcher, InlineTextDraftSink, ResolvedKeyboardCustomization, MarqueeRect, ShapeAdjustmentHandleDescriptor, SnapLine, ResizeHandleId, ConnectorEndpointKind, CollaborationInlineEditor, FindResult, RibbonDisplayController, ViewerPreferences, CollaborationTransport, YDocLike, YjsFactories, CollabProviderHandle, CollaborationHistoryTarget, CollabLoadOrigin, BroadcastConfig, PptxSaveSnapshot, PptxSaveAcknowledgement, ElementAnimationState, AuthoredSlideRange, RunProgramNotice, ZoomNavigationTarget, PresentationSnapshot, AutosaveRecoveryPrompt, CompatibilityWarningToast, SlideSizeEmu, DeckWebfontProgress, LoadLimitTranslate, ReadOnlyRecommendation, ReadOnlyBannerPasswordError, ViewerOptions, ViewerOptionsStoreInit, ToolbarTabId, ViewerOptionsGroupId, ViewerOptionPrimitive, ViewerOptionsConstraints, CompareResult, Guide, DeckViewPreferences, CloudDocumentController, SaveProgressController, ResolvedCustomization, ViewerMode, ViewportFitPadding, CollaborationShellState, AutosaveDisabledReason, MobileSheetKey, FieldSubstitutionContext, SlidesPaneLayoutGalleryRequest } from 'ooxml-ui/pptx';
5
5
  export { CanvasSize, CollaborationShellState, CollaborationState, ConnectionStatus, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, InlineListController, InlineListReadResult, InlineTextEditSnapshot, RemoteCursor, SanitizedPresence, SlidesPaneLayoutGalleryRequest, ViewerTheme, zoomInPercent, zoomOutPercent } from 'ooxml-ui/pptx';
6
6
  import { PptxAiConfig, PptxAiBridge } from 'ooxml-ui/pptx/ai';
7
7
  export { PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiUIMessage, PptxAiWritePolicy } from 'ooxml-ui/pptx/ai';
@@ -370,6 +370,13 @@ interface PowerPointViewerProps extends ViewportFitOptions {
370
370
  * drawn as its items. The desktop ribbon shows them; the phone chrome does not.
371
371
  */
372
372
  ribbonAddIns?: readonly RibbonAddInTab[];
373
+ /**
374
+ * Starting Ribbon Display Options mode: `always` (Always show Ribbon, the
375
+ * default), `tabs` (Show tabs only) or `fullScreen` (Full-screen mode).
376
+ * Changing it from the host applies the mode; the user's own choices are
377
+ * reported through `onribbondisplaychange`.
378
+ */
379
+ ribbonDisplay?: RibbonDisplayMode;
373
380
  /**
374
381
  * Framework-neutral UI customisation. See docs/guide/customization.md.
375
382
  *
@@ -501,6 +508,12 @@ interface PowerPointViewerProps extends ViewportFitOptions {
501
508
  /** Fired before following a link; return false to cancel its default action. */
502
509
  onhyperlinkclick?: ooxml_ui_pptx.HyperlinkClickHandler;
503
510
  onzoomchange?: (zoom: number) => void;
511
+ /**
512
+ * Fired when the user picks a Ribbon Display Options mode (the menu on the
513
+ * tab row, Ctrl+F1, or a double click on a tab). Not fired when the host
514
+ * changes `ribbonDisplay`.
515
+ */
516
+ onribbondisplaychange?: (mode: RibbonDisplayMode) => void;
504
517
  onselectionchange?: (elementIds: string[]) => void;
505
518
  onslidecountchange?: (count: number) => void;
506
519
  /** Host override for the File > Open action. */
@@ -2452,6 +2465,8 @@ declare class ChromeUiState {
2452
2465
  */
2453
2466
  interface RibbonProps {
2454
2467
  fileName?: string;
2468
+ /** Ribbon Display Options: the viewer's one controller (menu, peek, collapse). */
2469
+ ribbonDisplay: RibbonDisplayController;
2455
2470
  /** History-tracked editor state; Home/Insert tab groups read/write it directly. */
2456
2471
  editor: EditorState;
2457
2472
  /** Reactive Find & Replace panel state, owned by the host so it can navigate the viewer. */
@@ -2752,7 +2767,7 @@ declare class ViewerState {
2752
2767
  * `PowerPointViewer` instance API. The undo/redo/save half lives in
2753
2768
  * `editing-api.ts` and the export half in `export/exporting-api.ts`.
2754
2769
  */
2755
- type DeckApi = Omit<PowerPointViewerAPI, 'getContent' | 'undo' | 'redo' | 'canUndo' | 'canRedo'>;
2770
+ type DeckApi = Omit<PowerPointViewerAPI, 'getContent' | 'undo' | 'redo' | 'canUndo' | 'canRedo' | 'getSaveRevision' | 'getSaveSnapshot' | 'acknowledgeSave'>;
2756
2771
 
2757
2772
  /** The imperative editing API exposed on the `PowerPointViewer` instance. */
2758
2773
  interface EditingApi {
@@ -2767,6 +2782,12 @@ interface EditingApi {
2767
2782
  downloadAs(format: PptxSaveFormat, fileName?: string): Promise<void>;
2768
2783
  /** File > Save as `.pptx` (reported to host storage as `save`). */
2769
2784
  downloadPptx(fileName?: string): Promise<void>;
2785
+ /** The revision of the document as it is now (see `createSaveRevisionController`). */
2786
+ getSaveRevision(): number;
2787
+ /** Serialise for a host that persists the deck itself; leaves the document dirty. */
2788
+ getSaveSnapshot(): Promise<PptxSaveSnapshot>;
2789
+ /** The host persisted `revision`: clean only if it is still current. */
2790
+ acknowledgeSave(revision: number): PptxSaveAcknowledgement;
2770
2791
  }
2771
2792
 
2772
2793
  /**
@@ -1,28 +1,28 @@
1
- import { C as a, S as o, _ as s, a as r, b as i, c as t, d as l, f as S, g as n, h as d, i as p, l as v, m as c, n as m, o as b, p as g, r as x, s as P, t as w, u as T, v as u, w as y, x as A, y as C } from "../export-BSqJw7u_.js";
1
+ import { C as a, D as o, E as s, S as r, T as i, _ as t, a as l, b as S, c as n, d, g as v, h as p, i as c, l as m, m as b, n as g, o as x, r as P, s as T, t as w, v as y, w as A, x as C, y as V } from "../export-CVudgvaM.js";
2
2
  import "../transition-overlay-SNUzj4xJ.js";
3
3
  export {
4
- m as CollaborationCursors,
5
- x as EditorLayer,
6
- T as PowerPointViewer,
7
- g as PresentationLoader,
8
- p as RemoteSelectionOverlay,
9
- r as Ribbon,
10
- b as SlideCanvas,
11
- P as SlideThumbnail,
12
- t as SlidesPane,
13
- S as ViewerState,
14
- v as ViewerToolbar,
15
- C as clampSlideIndex,
4
+ g as CollaborationCursors,
5
+ P as EditorLayer,
6
+ d as PowerPointViewer,
7
+ v as PresentationLoader,
8
+ c as RemoteSelectionOverlay,
9
+ l as Ribbon,
10
+ x as SlideCanvas,
11
+ T as SlideThumbnail,
12
+ n as SlidesPane,
13
+ p as ViewerState,
14
+ m as ViewerToolbar,
15
+ r as clampSlideIndex,
16
16
  w as createSlidesPaneProps,
17
- y as createSvelteAiBridge,
18
- l as createViewerState,
19
- c as exportAllSlidesToSvg,
20
- d as exportAllSlidesToSvgBlobs,
21
- n as exportSlideAsSvg,
22
- s as exportSlideToSvg,
23
- u as exportSlideToSvgBlob,
24
- i as fitScale,
17
+ o as createSvelteAiBridge,
18
+ b as createViewerState,
19
+ t as exportAllSlidesToSvg,
20
+ y as exportAllSlidesToSvgBlobs,
21
+ V as exportSlideAsSvg,
22
+ S as exportSlideToSvg,
23
+ C as exportSlideToSvgBlob,
24
+ a as fitScale,
25
25
  A as resolveNavigationKey,
26
- o as zoomInPercent,
27
- a as zoomOutPercent
26
+ i as zoomInPercent,
27
+ s as zoomOutPercent
28
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-svelte-viewer",
3
- "version": "4.74.0",
3
+ "version": "4.75.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",
@@ -121,8 +121,8 @@
121
121
  "html2canvas-pro": "^2.6.3",
122
122
  "jspdf": "^4.2.1",
123
123
  "jszip": "^3.10.2",
124
- "ooxml-core": "^1.49.0",
125
- "ooxml-ui": "^1.49.1",
124
+ "ooxml-core": "^1.50.0",
125
+ "ooxml-ui": "^1.50.0",
126
126
  "opentype.js": "^2.0.0"
127
127
  },
128
128
  "devDependencies": {