pptx-svelte-viewer 4.4.0 → 4.6.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
@@ -1805,6 +1805,15 @@ interface TextStyle {
1805
1805
  textInnerShadowOffsetX?: number;
1806
1806
  /** Text inner shadow vertical offset in px. */
1807
1807
  textInnerShadowOffsetY?: number;
1808
+ /**
1809
+ * Original inner-shadow colour-choice XML (`a:innerShdw`'s
1810
+ * `a:prstClr`/`a:schemeClr`/`a:srgbClr`/… child), preserved verbatim so an
1811
+ * authored preset or theme colour round-trips instead of always being
1812
+ * re-serialized as a resolved `a:srgbClr`. Mirrors {@link textGlowColorXml}.
1813
+ */
1814
+ textInnerShadowColorXml?: XmlObject;
1815
+ /** Theme colour slot the inner shadow colour resolved from, when it is `a:schemeClr`. */
1816
+ textInnerShadowColorRef?: PptxThemeColorRef;
1808
1817
  /** Preset shadow type from `a:prstShdw/@prst` (e.g. "shdw1"..."shdw20"). */
1809
1818
  textPresetShadowName?: string;
1810
1819
  /** Preset shadow colour as hex string. */
@@ -1817,6 +1826,18 @@ interface TextStyle {
1817
1826
  textPresetShadowDirection?: number;
1818
1827
  /** Text blur effect radius in px (`a:blur`). */
1819
1828
  textBlurRadius?: number;
1829
+ /**
1830
+ * Text soft-edge radius in px (`a:softEdge/@rad`).
1831
+ *
1832
+ * Feathers the glyph's own edges (a uniform blur of the alpha silhouette,
1833
+ * the same effect a shape's `a:softEdge` gives its fill), unrelated to
1834
+ * `a:blur` (which blurs the whole run, colour included) or a shadow. Never
1835
+ * parsed before this field existed, so `a:softEdge` on a run was silently
1836
+ * dropped: PowerPoint fades the glyphs to near-transparent at their
1837
+ * outline (COM-verified, `audit-text` slide 14's "SOFTEDGE" run), while
1838
+ * the viewer painted them fully crisp.
1839
+ */
1840
+ textSoftEdgeRadius?: number;
1820
1841
  /**
1821
1842
  * Raw `a:effectDag` XML node from `a:rPr`, preserved verbatim for
1822
1843
  * round-trip serialisation. Mirrors the shape-level
@@ -3449,6 +3470,15 @@ interface PptxChartHistogramOptions {
3449
3470
  intervalClosed?: 'l' | 'r';
3450
3471
  underflow?: number | 'auto';
3451
3472
  overflow?: number | 'auto';
3473
+ /**
3474
+ * `c:layoutPr/cx:aggregation` was authored instead of `cx:binning`: the
3475
+ * raw rows are CATEGORICAL (a Pareto chart's `clusteredColumn` series
3476
+ * counting occurrences of each authored category, COM-verified against
3477
+ * charts-com.pptx slide 31 / chartEx6.xml), not a numeric range to bin.
3478
+ * Mutually exclusive with `binSize`/`binCount`/`intervalClosed`, which
3479
+ * only apply to a true numeric-value histogram.
3480
+ */
3481
+ aggregateByCategory?: boolean;
3452
3482
  }
3453
3483
  /** Office 2016 ChartEx waterfall series layout options. */
3454
3484
  interface PptxChartWaterfallOptions {
@@ -4113,6 +4143,18 @@ interface PptxChartData {
4113
4143
  * the source" and callers should treat it as `true`. Surface only.
4114
4144
  */
4115
4145
  wireframe?: boolean;
4146
+ /**
4147
+ * Whether the surface chart is the 2-D "top view" projection
4148
+ * (`c:surfaceChart`, PowerPoint's "Contour" / "Wireframe Contour" types)
4149
+ * rather than the 3-D isometric one (`c:surface3DChart`, "3-D Surface" /
4150
+ * "3-D Surface (Wireframe)"). Both element names map to chart type
4151
+ * `"surface"`; this bit is the only thing that tells the renderer which
4152
+ * of the two projections PowerPoint actually drew, since a top-view
4153
+ * surface has no Z-axis at all (only category and series axes) while the
4154
+ * 3-D one draws all three. Surface only; `undefined` for every other
4155
+ * chart type.
4156
+ */
4157
+ surfaceTopView?: boolean;
4116
4158
  /**
4117
4159
  * Scatter presentation mode (`c:scatterChart/c:scatterStyle/@val`).
4118
4160
  *
@@ -12369,6 +12411,27 @@ declare function forgetSessionDeck(): Promise<void>;
12369
12411
  declare function restoreSessionDeck(): Promise<SessionDeck | null>;
12370
12412
  declare function parsePresentationSessionId(hash: string): string | null;
12371
12413
  declare function loadPresentationDeck(sessionId: string): Promise<Uint8Array | null>;
12414
+ /** A logical editor command produced by one key press. */
12415
+ type EditorKeyActionName = 'undo' | 'redo' | 'copy' | 'cut' | 'paste' | 'duplicate' | 'delete' | 'selectAll' | 'group' | 'ungroup' | 'nudge' | 'prevSlide' | 'nextSlide' | 'escape' | 'find' | 'findReplace' | 'toggleShortcuts' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'increaseFontSize' | 'decreaseFontSize' | 'copyFormat' | 'pasteFormat' | 'newSlide' | 'hyperlink' | 'clearFormatting' | 'cycleSelectionNext' | 'cycleSelectionPrev' | 'pasteSpecial';
12416
+ /** Every command a canvas context menu can offer, in no particular order. */
12417
+ type ContextMenuCommandId = 'copy' | 'cut' | 'paste' | 'duplicate' | 'edit-text' | 'bring-forward' | 'send-backward' | 'bring-front' | 'send-back' | 'ai-ask' | 'ai-fix' | 'comment' | 'hyperlink' | 'table-insert-row-above' | 'table-insert-row-below' | 'table-delete-row' | 'table-insert-col-left' | 'table-insert-col-right' | 'table-delete-col' | 'table-merge-selected' | 'table-merge-right' | 'table-merge-down' | 'table-split' | 'group' | 'ungroup' | 'save-as-picture' | 'edit-alt-text' | 'size-and-position' | 'format-shape' | 'delete';
12418
+ //#endregion
12419
+ //#region src/render/canvas-context-menu-commands.d.ts
12420
+ /**
12421
+ * The right-click menu for the empty slide canvas (no element under the
12422
+ * cursor), as distinct from {@link ./context-menu-commands}'s per-element menu.
12423
+ *
12424
+ * Right-clicking empty canvas used to do nothing at all in every binding: React
12425
+ * and Vue both bailed out early (`getElementIdFromEvent` returns `null`, so the
12426
+ * handler just returns) rather than opening a menu, and the other three never
12427
+ * wired a handler for it either. PowerPoint offers Paste, Layout, Reset,
12428
+ * Format Background and view toggles (Grid and Guides, Ruler) from this menu;
12429
+ * this module is the one list every binding renders instead of five omissions.
12430
+ *
12431
+ * @module render/canvas-context-menu-commands
12432
+ */
12433
+ /** Every command the empty-canvas context menu can offer, in no particular order. */
12434
+ type CanvasContextMenuCommandId = 'paste' | 'layout' | 'reset-slide' | 'format-background' | 'grid-and-guides' | 'ruler';
12372
12435
  //#endregion
12373
12436
  //#region src/render/image-file-insertion.d.ts
12374
12437
  /**
@@ -12403,6 +12466,21 @@ declare function listAutosaveSnapshots(): Promise<Array<{
12403
12466
  }>>;
12404
12467
  /** Delete a snapshot, rejecting when IndexedDB cannot commit the transaction. */
12405
12468
  declare function deleteAutosaveSnapshot(filePath: string): Promise<boolean>;
12469
+ type BackstagePage = 'home' | 'new' | 'open' | 'info' | 'save' | 'saveAs' | 'print' | 'share' | 'export' | 'close' | 'account' | 'options';
12470
+ //#endregion
12471
+ //#region src/render/backstage-cards.d.ts
12472
+ /**
12473
+ * Every action card the File-tab backstage can show, keyed by the operation it
12474
+ * triggers rather than by its wording.
12475
+ *
12476
+ * The five bindings used to hardcode a title and a body string each, which made
12477
+ * the whole backstage untranslatable and let the copy drift: the same card
12478
+ * carried four different descriptions depending on which binding you opened it
12479
+ * in. Both halves now live here as a dictionary key plus an English fallback,
12480
+ * so a wording change lands everywhere at once and a translator only has to
12481
+ * translate it once.
12482
+ */
12483
+ type BackstageCardId = 'protect' | 'inspect' | 'embedFonts' | 'signatures' | 'versionHistory' | 'saveAsPptx' | 'saveAsPpsx' | 'saveAsPptm' | 'saveAsPpt' | 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage' | 'print' | 'share';
12406
12484
  /**
12407
12485
  * Optional hook point for hosts that want to wire a real sign-in flow into
12408
12486
  * File > Account. Disabled by default: the Account page renders nothing
@@ -12445,6 +12523,165 @@ type ToolbarButtonId = 'share' | 'broadcast' | 'export' | 'undo' | 'redo' | 'rec
12445
12523
  type ToolbarTabId = 'file' | 'home' | 'insert' | 'draw' | 'design' | 'transitions' | 'animations' | 'slideShow' | 'record' | 'review' | 'view' | 'help';
12446
12524
  type ToolbarActionId = ToolbarButtonId | ToolbarTabId;
12447
12525
  //#endregion
12526
+ //#region src/render/options/viewer-options.d.ts
12527
+ /**
12528
+ * Full PowerPoint "File > Options" parity model.
12529
+ *
12530
+ * Groups mirror the ten categories of PowerPoint's Options dialog. Values are
12531
+ * flat primitives per group so the dialog panes can be rendered generically
12532
+ * from `VIEWER_OPTIONS_SCHEMA` in every binding. The legacy six-toggle
12533
+ * `ViewerPreferences` surface stays supported via the mapping helpers below.
12534
+ */
12535
+ type ScreenTipStyle = 'descriptions' | 'plain' | 'off';
12536
+ type DisplayOptimization = 'appearance' | 'compatibility';
12537
+ type ImageResolutionPreset = 'highFidelity' | 'ppi330' | 'ppi220' | 'ppi150' | 'ppi96';
12538
+ type OpenDocumentsView = 'savedView' | 'normal' | 'outline' | 'slideSorter' | 'notes';
12539
+ type DefaultExportFormat = 'pptx' | 'pdf' | 'png';
12540
+ type QuickAccessPosition = 'above' | 'below';
12541
+ type FeedbackSoundScheme = 'modern' | 'classic';
12542
+ type OptionsPrintWhat = 'slides' | 'handouts' | 'notes' | 'outline';
12543
+ type OptionsPrintColorMode = 'color' | 'grayscale' | 'blackAndWhite';
12544
+ interface ViewerGeneralOptions {
12545
+ displayOptimization: DisplayOptimization;
12546
+ showMiniToolbar: boolean;
12547
+ enableLivePreview: boolean;
12548
+ collapseRibbonAutomatically: boolean;
12549
+ collapseSearchByDefault: boolean;
12550
+ screenTipStyle: ScreenTipStyle;
12551
+ userName: string;
12552
+ userInitials: string;
12553
+ showStartScreen: boolean;
12554
+ /**
12555
+ * Lets the user hand a local font file to the viewer so decks authored
12556
+ * with a font the browser lacks render with the real face.
12557
+ *
12558
+ * Off by default. The registration reads a file the user picks and adds it
12559
+ * to the page's font set for the session, which is a capability a host
12560
+ * embedding the viewer should opt into rather than inherit.
12561
+ */
12562
+ enableCustomFontUpload: boolean;
12563
+ }
12564
+ interface ViewerProofingOptions {
12565
+ autoCorrectTwoInitialCapitals: boolean;
12566
+ autoCorrectCapitalizeFirstLetter: boolean;
12567
+ autoCorrectCapitalizeDayNames: boolean;
12568
+ autoCorrectSmartQuotes: boolean;
12569
+ autoCorrectHyphensToDash: boolean;
12570
+ autoCorrectFractions: boolean;
12571
+ autoCorrectOrdinals: boolean;
12572
+ ignoreUppercase: boolean;
12573
+ ignoreWordsWithNumbers: boolean;
12574
+ ignoreInternetAddresses: boolean;
12575
+ flagRepeatedWords: boolean;
12576
+ checkSpellingAsYouType: boolean;
12577
+ hideSpellingErrors: boolean;
12578
+ }
12579
+ /**
12580
+ * File > Options > Save.
12581
+ *
12582
+ * Font embedding deliberately has NO entry here. It is owned by the File >
12583
+ * Fonts panel, whose toggle is the one the save path reads (see
12584
+ * `render/font-embedding`: `describeFontEmbedding` decides the toggle's start
12585
+ * position and whether it can do anything at all, `embeddedFontSaveOptions`
12586
+ * turns it into the `PptxHandler.save()` slice). This group used to carry a
12587
+ * second `embedFonts` boolean, plus an `embedAllFontCharacters` companion, and
12588
+ * neither was read by anything: the pane moved a switch that changed no saved
12589
+ * byte, while the panel next door moved the real one. Two switches for one
12590
+ * setting, one of them lying, is worse than one switch in a less
12591
+ * PowerPoint-shaped place.
12592
+ */
12593
+ interface ViewerSaveOptions {
12594
+ autoSave: boolean;
12595
+ autoRecoverIntervalMinutes: number;
12596
+ keepLastAutoRecoveredVersion: boolean;
12597
+ defaultExportFormat: DefaultExportFormat;
12598
+ cacheRetentionDays: number;
12599
+ clearCacheOnClose: boolean;
12600
+ }
12601
+ interface ViewerAccessibilityOptions {
12602
+ showAccessibilityStatus: boolean;
12603
+ feedbackWithSound: boolean;
12604
+ soundScheme: FeedbackSoundScheme;
12605
+ showShortcutKeysInScreenTips: boolean;
12606
+ reducedMotion: boolean;
12607
+ }
12608
+ interface ViewerAdvancedOptions {
12609
+ autoSelectEntireWord: boolean;
12610
+ allowTextDragAndDrop: boolean;
12611
+ maximumUndoSteps: number;
12612
+ useSmartCutAndPaste: boolean;
12613
+ showPasteOptionsButton: boolean;
12614
+ imageDefaultResolution: ImageResolutionPreset;
12615
+ doNotCompressImages: boolean;
12616
+ chartPropertiesFollowDataPoint: boolean;
12617
+ recentPresentationsCount: number;
12618
+ showVerticalRuler: boolean;
12619
+ showGrid: boolean;
12620
+ snapToGrid: boolean;
12621
+ disableHardwareAcceleration: boolean;
12622
+ /**
12623
+ * Force every opt-in interactive 3D scene (SmartArt, bar/line/area/pie/
12624
+ * surface charts) to fall back to its flat 2D rendering, even when the
12625
+ * host has enabled that scene via its own `smartArt3D`/`*Chart3D` prop.
12626
+ * A host opting in says "this deck may want 3D"; this is the viewer
12627
+ * user's own override for when the WebGL scenes it renders are too much
12628
+ * for their machine. See `resolve3DRenderingFlags`.
12629
+ */
12630
+ disable3DRendering: boolean;
12631
+ /**
12632
+ * `p:animEffect/@filter="pixelate"` defaults to snapping the element to
12633
+ * its end state (`cutIn`/`cutOut`), matching PowerPoint's own behaviour
12634
+ * (COM `CreateVideo` frame-diffing shows PowerPoint performs no animation
12635
+ * at all for this filter value). This turns on the blocky mosaic reveal
12636
+ * this renderer can build instead, for a viewer that would rather show
12637
+ * something animating than PowerPoint's own instant swap. See
12638
+ * `resolveFilterEffect` in `animation-filter-effects.ts` and
12639
+ * `docs/guide/visual-effects.md`.
12640
+ */
12641
+ pixelateMosaicAnimation: boolean;
12642
+ openDocumentsView: OpenDocumentsView;
12643
+ slideShowShowMenuOnRightClick: boolean;
12644
+ slideShowShowPopupToolbar: boolean;
12645
+ slideShowPromptKeepInkAnnotations: boolean;
12646
+ slideShowEndWithBlackSlide: boolean;
12647
+ printInBackground: boolean;
12648
+ printHighQuality: boolean;
12649
+ printUseMostRecentSettings: boolean;
12650
+ printWhat: OptionsPrintWhat;
12651
+ printColorMode: OptionsPrintColorMode;
12652
+ printHiddenSlides: boolean;
12653
+ printScaleToFit: boolean;
12654
+ printFrameSlides: boolean;
12655
+ }
12656
+ interface ViewerRibbonOptions {
12657
+ /** Ribbon tabs unticked in Customize Ribbon. The File tab can never be hidden. */
12658
+ hiddenTabIds: ToolbarTabId[];
12659
+ }
12660
+ interface ViewerQuickAccessOptions {
12661
+ visible: boolean;
12662
+ position: QuickAccessPosition;
12663
+ showCommandLabels: boolean;
12664
+ /** Ordered ids from `QUICK_ACCESS_COMMAND_CATALOG`. */
12665
+ commandIds: string[];
12666
+ }
12667
+ interface ViewerTrustOptions {
12668
+ openInProtectedView: boolean;
12669
+ allowExternalContent: boolean;
12670
+ confirmExternalHyperlinks: boolean;
12671
+ }
12672
+ interface ViewerOptions {
12673
+ general: ViewerGeneralOptions;
12674
+ proofing: ViewerProofingOptions;
12675
+ save: ViewerSaveOptions;
12676
+ accessibility: ViewerAccessibilityOptions;
12677
+ advanced: ViewerAdvancedOptions;
12678
+ ribbon: ViewerRibbonOptions;
12679
+ quickAccess: ViewerQuickAccessOptions;
12680
+ trust: ViewerTrustOptions;
12681
+ }
12682
+ type ViewerOptionsGroupId = keyof ViewerOptions;
12683
+ type ViewerOptionPrimitive = boolean | number | string;
12684
+ //#endregion
12448
12685
  //#region src/export/handout-layout.d.ts
12449
12686
  /**
12450
12687
  * Pure handout layout calculations, shared by every binding's print path.
@@ -12488,6 +12725,226 @@ interface PrintSettings {
12488
12725
  scaleToFit?: boolean;
12489
12726
  }
12490
12727
  //#endregion
12728
+ //#region src/render/options/viewer-options-controls.d.ts
12729
+ /**
12730
+ * Control/section/tab descriptor types for the File > Options schema, plus
12731
+ * the terse constructors the tab-definition modules build panes with.
12732
+ */
12733
+ type ViewerOptionsTabId = 'general' | 'proofing' | 'save' | 'language' | 'accessibility' | 'advanced' | 'ribbon' | 'quickAccess' | 'addIns' | 'trust';
12734
+ //#endregion
12735
+ //#region src/render/customization/customization-types.d.ts
12736
+ /** Keys of an options group whose value is a primitive (not an array). */
12737
+ type PrimitiveKeys<T> = { [K in keyof T]: T[K] extends ViewerOptionPrimitive ? K : never; }[keyof T] & string;
12738
+ /**
12739
+ * One File > Options setting, addressed as `<group>.<key>`, for example
12740
+ * `general.userName` or `advanced.showGrid`. The union is derived from the
12741
+ * `ViewerOptions` model itself, so a typo is a compile error.
12742
+ */
12743
+ type OptionsSettingId = { [G in ViewerOptionsGroupId]: `${G}.${PrimitiveKeys<ViewerOptions[G]>}`; }[ViewerOptionsGroupId];
12744
+ /**
12745
+ * A File > Options page: the ten PowerPoint categories plus `ai`, the AI
12746
+ * assistant page a binding adds when the host configured an assistant.
12747
+ */
12748
+ type OptionsPageId = ViewerOptionsTabId | 'ai';
12749
+ /**
12750
+ * One section of an Options page, addressed as `<page>.<section>`, for
12751
+ * example `general.personalize` or `advanced.print`. The full list is
12752
+ * `OPTIONS_SECTION_IDS` (derived from the schema at runtime).
12753
+ */
12754
+ type OptionsSectionId = `${ViewerOptionsTabId}.${string}`;
12755
+ /** Values a host forces onto settings. */
12756
+ type OptionsSettingValues = Partial<Record<OptionsSettingId, ViewerOptionPrimitive>>;
12757
+ /** Ribbon and toolbar customisation. */
12758
+ interface RibbonCustomization {
12759
+ /** Ribbon tabs to remove (the File tab included, unlike Customize Ribbon). */
12760
+ hiddenTabs?: readonly ToolbarTabId[];
12761
+ /** Top-level toolbar buttons / control clusters to remove. */
12762
+ hiddenButtons?: readonly ToolbarButtonId[];
12763
+ }
12764
+ /** File > Options (the Settings dialog) customisation. */
12765
+ interface OptionsCustomization {
12766
+ /** Whole pages to remove from the dialog's category rail. */
12767
+ hiddenPages?: readonly OptionsPageId[];
12768
+ /** Sections (`<page>.<section>`) to remove from their page. */
12769
+ hiddenSections?: readonly OptionsSectionId[];
12770
+ /** Individual settings (`<group>.<key>`) to remove wherever they appear. */
12771
+ hiddenSettings?: readonly OptionsSettingId[];
12772
+ /**
12773
+ * Settings pinned to a fixed value. The value is forced into the options
12774
+ * store, user edits to it are ignored, and the control renders read-only.
12775
+ * Add the id to `hiddenSettings` too to lock it invisibly.
12776
+ */
12777
+ locked?: OptionsSettingValues;
12778
+ /**
12779
+ * Host defaults: the value a setting starts at when the user has not saved
12780
+ * a choice of their own. "Reset" returns to these, not to the built-ins.
12781
+ */
12782
+ defaults?: OptionsSettingValues;
12783
+ }
12784
+ /** File tab (backstage) customisation. */
12785
+ interface BackstageCustomization {
12786
+ /** Navigation entries (pages) to remove from the File tab. */
12787
+ hiddenPages?: readonly BackstagePage[];
12788
+ /** Action cards to remove from the pages that show them. */
12789
+ hiddenCards?: readonly BackstageCardId[];
12790
+ }
12791
+ /** Right-click menu customisation. */
12792
+ interface ContextMenuCustomization {
12793
+ /** Entries to remove from the element (right-click on a shape) menu. */
12794
+ hiddenElementCommands?: readonly ContextMenuCommandId[];
12795
+ /** Entries to remove from the empty-canvas menu. */
12796
+ hiddenCanvasCommands?: readonly CanvasContextMenuCommandId[];
12797
+ /** Remove the element context menu entirely. */
12798
+ disableElementMenu?: boolean;
12799
+ /** Remove the empty-canvas context menu entirely. */
12800
+ disableCanvasMenu?: boolean;
12801
+ }
12802
+ /**
12803
+ * A shortcut chord in the form `Mod+Shift+D`: modifiers `Mod` (Ctrl on
12804
+ * Windows/Linux, Cmd on macOS), `Ctrl`, `Meta`, `Alt`, `Shift`, joined by `+`,
12805
+ * followed by a `KeyboardEvent.key` value (`D`, `Delete`, `ArrowLeft`, `F2`).
12806
+ */
12807
+ type ShortcutChord = string;
12808
+ /** Editor keyboard-shortcut customisation. */
12809
+ interface KeyboardCustomization {
12810
+ /** Turn every editor shortcut off (the host owns the keyboard). */
12811
+ disableAll?: boolean;
12812
+ /** Editor commands whose shortcut is turned off. */
12813
+ disabled?: readonly EditorKeyActionName[];
12814
+ /**
12815
+ * Replacement chords per command. A remapped command no longer answers to
12816
+ * its built-in chord; it answers to the chord(s) given here instead.
12817
+ */
12818
+ remap?: Partial<Record<EditorKeyActionName, ShortcutChord | readonly ShortcutChord[]>>;
12819
+ }
12820
+ /**
12821
+ * Chrome regions a host can remove. Each id maps onto one region in every
12822
+ * binding; see `VIEWER_PANEL_IDS` for the catalogue.
12823
+ */
12824
+ type ViewerPanelId = 'statusBar' | 'slidesPane' | 'inspector' | 'notes' | 'quickAccessToolbar' | 'titleBar';
12825
+ /** Feature areas that can be switched off as a whole. */
12826
+ type ViewerFeatureId = 'ai' | 'collaboration' | 'comments' | 'presentMode';
12827
+ /** Dialogs (and the entry points that open them) a host can remove. */
12828
+ type ViewerDialogId = 'options' | 'share' | 'broadcast' | 'print' | 'export';
12829
+ /** Export formats offered by the File > Export page. */
12830
+ type ViewerExportFormatId = 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage';
12831
+ /**
12832
+ * The whole customisation object. Every field is optional; omitted fields hide
12833
+ * nothing and lock nothing.
12834
+ */
12835
+ interface ViewerCustomization {
12836
+ ribbon?: RibbonCustomization;
12837
+ options?: OptionsCustomization;
12838
+ backstage?: BackstageCustomization;
12839
+ contextMenu?: ContextMenuCustomization;
12840
+ keyboard?: KeyboardCustomization;
12841
+ /** Chrome regions to remove (`true` hides). */
12842
+ hiddenPanels?: readonly ViewerPanelId[];
12843
+ /** Feature areas to switch off (their buttons, menus, pages and panels). */
12844
+ disabledFeatures?: readonly ViewerFeatureId[];
12845
+ /** Dialogs to remove, along with every entry point that opens them. */
12846
+ hiddenDialogs?: readonly ViewerDialogId[];
12847
+ /** Export formats to remove from File > Export. */
12848
+ hiddenExportFormats?: readonly ViewerExportFormatId[];
12849
+ }
12850
+ //#endregion
12851
+ //#region src/render/customization/customization-catalog.d.ts
12852
+ declare const RIBBON_TAB_IDS: readonly ToolbarTabId[];
12853
+ declare const TOOLBAR_BUTTON_IDS: readonly ["share", "broadcast", "export", "undo", "redo", "record", "notes", "fullscreen", "zoom", "navigation"];
12854
+ declare const OPTIONS_PAGE_IDS: readonly OptionsPageId[];
12855
+ declare const OPTIONS_SECTION_IDS: readonly OptionsSectionId[];
12856
+ declare const OPTIONS_SETTING_IDS: readonly OptionsSettingId[];
12857
+ declare const BACKSTAGE_PAGE_IDS: readonly BackstagePage[];
12858
+ declare const BACKSTAGE_CARD_IDS: readonly BackstageCardId[];
12859
+ declare const ELEMENT_CONTEXT_MENU_COMMAND_IDS: readonly ["copy", "cut", "paste", "duplicate", "edit-text", "bring-forward", "send-backward", "bring-front", "send-back", "ai-ask", "ai-fix", "comment", "hyperlink", "table-insert-row-above", "table-insert-row-below", "table-delete-row", "table-insert-col-left", "table-insert-col-right", "table-delete-col", "table-merge-selected", "table-merge-right", "table-merge-down", "table-split", "group", "ungroup", "save-as-picture", "edit-alt-text", "size-and-position", "format-shape", "delete"];
12860
+ declare const CANVAS_CONTEXT_MENU_COMMAND_IDS: readonly ["paste", "layout", "reset-slide", "format-background", "grid-and-guides", "ruler"];
12861
+ declare const EDITOR_SHORTCUT_ACTION_IDS: readonly ["undo", "redo", "copy", "cut", "paste", "duplicate", "delete", "selectAll", "group", "ungroup", "nudge", "prevSlide", "nextSlide", "escape", "find", "findReplace", "toggleShortcuts", "alignLeft", "alignCenter", "alignRight", "alignJustify", "increaseFontSize", "decreaseFontSize", "copyFormat", "pasteFormat", "newSlide", "hyperlink", "clearFormatting", "cycleSelectionNext", "cycleSelectionPrev", "pasteSpecial"];
12862
+ declare const VIEWER_PANEL_IDS: readonly ["statusBar", "slidesPane", "inspector", "notes", "quickAccessToolbar", "titleBar"];
12863
+ declare const VIEWER_FEATURE_IDS: readonly ["ai", "collaboration", "comments", "presentMode"];
12864
+ declare const VIEWER_DIALOG_IDS: readonly ["options", "share", "broadcast", "print", "export"];
12865
+ declare const VIEWER_EXPORT_FORMAT_IDS: readonly ["pdf", "png", "video", "gif", "json", "copyImage"];
12866
+ //#endregion
12867
+ //#region src/render/customization/customization-keymap.d.ts
12868
+ /** A parsed `Mod+Shift+D` chord. */
12869
+ interface ParsedShortcutChord {
12870
+ key: string;
12871
+ mod: boolean;
12872
+ ctrl: boolean;
12873
+ meta: boolean;
12874
+ alt: boolean;
12875
+ shift: boolean;
12876
+ }
12877
+ /** The normalised keyboard slice of a resolved customisation. */
12878
+ interface ResolvedKeyboardCustomization {
12879
+ disableAll: boolean;
12880
+ disabled: ReadonlySet<EditorKeyActionName>;
12881
+ remap: ReadonlyMap<EditorKeyActionName, readonly ParsedShortcutChord[]>;
12882
+ }
12883
+ //#endregion
12884
+ //#region src/render/customization/customization-resolve.d.ts
12885
+ /** The normalised, set-based view of a customisation. Treat as immutable. */
12886
+ interface ResolvedCustomization {
12887
+ hiddenActions: ReadonlySet<ToolbarActionId>;
12888
+ hiddenOptionsPages: ReadonlySet<OptionsPageId>;
12889
+ hiddenOptionsSections: ReadonlySet<OptionsSectionId>;
12890
+ hiddenSettings: ReadonlySet<OptionsSettingId>;
12891
+ lockedSettings: OptionsSettingValues;
12892
+ defaultSettings: OptionsSettingValues;
12893
+ hiddenBackstagePages: ReadonlySet<BackstagePage>;
12894
+ hiddenBackstageCards: ReadonlySet<BackstageCardId>;
12895
+ hiddenElementCommands: ReadonlySet<ContextMenuCommandId>;
12896
+ hiddenCanvasCommands: ReadonlySet<CanvasContextMenuCommandId>;
12897
+ elementMenuEnabled: boolean;
12898
+ canvasMenuEnabled: boolean;
12899
+ hiddenPanels: ReadonlySet<ViewerPanelId>;
12900
+ disabledFeatures: ReadonlySet<ViewerFeatureId>;
12901
+ hiddenDialogs: ReadonlySet<ViewerDialogId>;
12902
+ keyboard: ResolvedKeyboardCustomization;
12903
+ }
12904
+ //#endregion
12905
+ //#region src/render/customization/customization-controller.d.ts
12906
+ /** The imperative methods every binding's component handle exposes. */
12907
+ interface ViewerCustomizationApi {
12908
+ /** The current customisation object (a snapshot; do not mutate). */
12909
+ getCustomization(): ViewerCustomization;
12910
+ /** Replace the whole customisation. */
12911
+ setCustomization(next: ViewerCustomization): void;
12912
+ /** Merge a partial customisation (see `mergeCustomization`). */
12913
+ updateCustomization(patch: ViewerCustomization): void;
12914
+ /** Drop every customisation, back to the stock UI. */
12915
+ resetCustomization(): void;
12916
+ hideRibbonTab(tab: ToolbarTabId): void;
12917
+ showRibbonTab(tab: ToolbarTabId): void;
12918
+ hideToolbarButton(button: ToolbarButtonId): void;
12919
+ showToolbarButton(button: ToolbarButtonId): void;
12920
+ hideOptionsPage(page: OptionsPageId): void;
12921
+ showOptionsPage(page: OptionsPageId): void;
12922
+ hideOptionsSection(section: OptionsSectionId): void;
12923
+ showOptionsSection(section: OptionsSectionId): void;
12924
+ hideSetting(setting: OptionsSettingId): void;
12925
+ showSetting(setting: OptionsSettingId): void;
12926
+ /** Pin a setting to `value`; `hidden` also removes it from the dialog. */
12927
+ lockSetting(setting: OptionsSettingId, value: ViewerOptionPrimitive, hidden?: boolean): void;
12928
+ unlockSetting(setting: OptionsSettingId): void;
12929
+ /** Set (or with `undefined`, clear) the host default for a setting. */
12930
+ setSettingDefault(setting: OptionsSettingId, value: ViewerOptionPrimitive | undefined): void;
12931
+ hideBackstagePage(page: BackstagePage): void;
12932
+ showBackstagePage(page: BackstagePage): void;
12933
+ hideBackstageCard(card: BackstageCardId): void;
12934
+ showBackstageCard(card: BackstageCardId): void;
12935
+ hideContextMenuCommand(command: ContextMenuCommandId): void;
12936
+ showContextMenuCommand(command: ContextMenuCommandId): void;
12937
+ hideCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
12938
+ showCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
12939
+ disableShortcut(action: EditorKeyActionName): void;
12940
+ enableShortcut(action: EditorKeyActionName): void;
12941
+ /** Move a command onto new chord(s); `undefined` restores the built-in chord. */
12942
+ remapShortcut(action: EditorKeyActionName, chords: ShortcutChord | readonly ShortcutChord[] | undefined): void;
12943
+ setPanelVisible(panel: ViewerPanelId, visible: boolean): void;
12944
+ setFeatureEnabled(feature: ViewerFeatureId, enabled: boolean): void;
12945
+ setDialogAvailable(dialog: ViewerDialogId, available: boolean): void;
12946
+ }
12947
+ //#endregion
12491
12948
  //#region src/render/viewport-fit.d.ts
12492
12949
  /** Unscaled CSS pixels reserved on each side of the ordinary viewer viewport. */
12493
12950
  type ViewportFitPadding = number | {
@@ -12969,6 +13426,18 @@ interface PowerPointViewerProps extends ViewportFitOptions {
12969
13426
  * hidden, matching the pre-existing always-visible behaviour.
12970
13427
  */
12971
13428
  hiddenActions?: ToolbarActionId[];
13429
+ /**
13430
+ * Framework-neutral UI customisation. See docs/guide/customization.md.
13431
+ *
13432
+ * Hides ribbon tabs, toolbar buttons, Options pages / sections / settings,
13433
+ * File tab pages and cards, context-menu entries, panels, features and
13434
+ * dialogs; locks settings and sets host defaults; disables or remaps editor
13435
+ * shortcuts. Unioned with `hiddenActions`. Passing a NEW object replaces the
13436
+ * whole customisation, discarding edits made through the imperative
13437
+ * helpers (`hideRibbonTab`, `lockSetting`, ...) on the component instance;
13438
+ * mutating the same object in place is not observed.
13439
+ */
13440
+ customization?: ViewerCustomization;
12972
13441
  /**
12973
13442
  * Show the speaker-notes panel and its toolbar toggle. Default true. The
12974
13443
  * panel is plain-text only and reads the active slide's notes; pass
@@ -13159,9 +13628,10 @@ interface PowerPointViewerProps extends ViewportFitOptions {
13159
13628
  /**
13160
13629
  * Imperative editing API exposed on the `<PowerPointViewer>` component
13161
13630
  * instance (via `bind:this`). Mirrors the vanilla binding's `EditorController`
13162
- * surface subset the host drives directly.
13631
+ * surface subset the host drives directly, plus the shared UI-customisation
13632
+ * helpers (`ViewerCustomizationApi`: `hideRibbonTab`, `lockSetting`, ...).
13163
13633
  */
13164
- interface PowerPointViewerApi extends PowerPointViewerAPI {
13634
+ interface PowerPointViewerApi extends PowerPointViewerAPI, ViewerCustomizationApi {
13165
13635
  /** Undo the last committed edit. */
13166
13636
  undo(): void;
13167
13637
  /** Redo the last undone edit. */
@@ -13264,5 +13734,5 @@ declare const PowerPointViewer: Component<PowerPointViewerProps, PowerPointViewe
13264
13734
  */
13265
13735
  type AutosaveStatus = 'idle' | 'disabled' | 'saving' | 'saved' | 'error';
13266
13736
 
13267
- export { PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, PowerPointViewer, createImageElementFromFile, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, describeCollaborationShellState, exportAllSlidesToSvg, exportAllSlidesToSvgBlobs, exportSlideAsSvg, exportSlideToSvg, exportSlideToSvgBlob, forgetSessionDeck, getAutosaveSnapshot, getSessionTabId, isLegacyBinaryPresentation, isSupportedPresentationFile, listAutosaveSnapshots, loadPresentationDeck, loadSessionDeck, parsePresentationSessionId, presentationBaseName, registerTranslations, rememberSessionDeck, renderToCanvas, restoreSessionDeck, savedPresentationFileName, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius };
13268
- export type { AutosaveRecord, AutosaveStatus, CanvasSize, CollaborationConfig, CollaborationRole, CollaborationShellState, CollaborationTransport, ConnectionStatus, ElementUpdate, ElementUpdateOptions, ExportGifOptions, ExportPdfOptions, ExportVideoOptions, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, PowerPointViewerApi, PowerPointViewerProps, PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiUIMessage, PptxAiWritePolicy, PrintOptions, RemoteCursor, SanitizedPresence, SavedPresentationFormat, SessionDeck, SvgExportAllOptions, SvgExportSingleSlideOptions, TranslationDictionary, Translator, ViewerLoadDetail, ViewerTheme, ViewerThemeColors, ViewportFitOptions, ViewportFitPadding };
13737
+ export { BACKSTAGE_CARD_IDS, BACKSTAGE_PAGE_IDS, CANVAS_CONTEXT_MENU_COMMAND_IDS, EDITOR_SHORTCUT_ACTION_IDS, ELEMENT_CONTEXT_MENU_COMMAND_IDS, OPTIONS_PAGE_IDS, OPTIONS_SECTION_IDS, OPTIONS_SETTING_IDS, PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, PowerPointViewer, RIBBON_TAB_IDS, TOOLBAR_BUTTON_IDS, VIEWER_DIALOG_IDS, VIEWER_EXPORT_FORMAT_IDS, VIEWER_FEATURE_IDS, VIEWER_PANEL_IDS, createImageElementFromFile, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, describeCollaborationShellState, exportAllSlidesToSvg, exportAllSlidesToSvgBlobs, exportSlideAsSvg, exportSlideToSvg, exportSlideToSvgBlob, forgetSessionDeck, getAutosaveSnapshot, getSessionTabId, isLegacyBinaryPresentation, isSupportedPresentationFile, listAutosaveSnapshots, loadPresentationDeck, loadSessionDeck, parsePresentationSessionId, presentationBaseName, registerTranslations, rememberSessionDeck, renderToCanvas, restoreSessionDeck, savedPresentationFileName, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius };
13738
+ export type { AutosaveRecord, AutosaveStatus, BackstageCustomization, CanvasSize, CollaborationConfig, CollaborationRole, CollaborationShellState, CollaborationTransport, ConnectionStatus, ContextMenuCustomization, ElementUpdate, ElementUpdateOptions, ExportGifOptions, ExportPdfOptions, ExportVideoOptions, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, KeyboardCustomization, OptionsCustomization, OptionsPageId, OptionsSectionId, OptionsSettingId, OptionsSettingValues, PowerPointViewerApi, PowerPointViewerProps, PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiUIMessage, PptxAiWritePolicy, PrintOptions, RemoteCursor, ResolvedCustomization, RibbonCustomization, SanitizedPresence, SavedPresentationFormat, SessionDeck, ShortcutChord, SvgExportAllOptions, SvgExportSingleSlideOptions, TranslationDictionary, Translator, ViewerCustomization, ViewerCustomizationApi, ViewerDialogId, ViewerExportFormatId, ViewerFeatureId, ViewerLoadDetail, ViewerPanelId, ViewerTheme, ViewerThemeColors, ViewportFitOptions, ViewportFitPadding };
package/dist/index.js CHANGED
@@ -1,41 +1,55 @@
1
- import { $t as e, Ah as a, Al as o, Bl as r, Bo as t, El as i, Ic as l, Il as n, Mh as S, Nh as m, Tp as d, Wu as p, Zd as h, _p as T, as as v, cs as c, hc as g, in as P, jh as u, kh as A, ls as C, nh as E, os as N, ps as k, rc as f, sd as D, zl as I } from "./transition-overlay-CfsPqlES.js";
2
- import { i as x } from "./translator-Dn-ANCp2.js";
3
- import { M as _, a as F, c as O, l as L, o as R, s as V, t as w } from "./export-BUx-Kmlc.js";
1
+ import { As as a, Bc as e, Ih as o, Ls as r, M as t, Ms as i, Nn as S, Ns as T, Oc as _, P as l, R as n, Xt as E, Yt as I, Zp as A, Zt as N, _r as D, _t as O, am as m, as as d, bt as P, cn as p, dg as C, eu as g, fg as v, fu as R, gu as u, hu as c, ir as h, kf as B, ks as M, lg as f, ou as k, pg as x, pn as L, sl as V, ug as b, vr as F, xd as G, xr as X, yr as U, zd as W } from "./transition-overlay-Dkooknvn.js";
2
+ import { i as w } from "./translator-DC6tH5v7.js";
3
+ import { M as Z, a as z, c as H, l as Y, o as j, s as q, t as J } from "./export-zzqiDncO.js";
4
4
  import "./i18n.js";
5
5
  export {
6
- e as PPTX_OPEN_ACCEPT,
7
- P as PRESENTATION_OPEN_EXTENSIONS,
8
- w as PowerPointViewer,
9
- t as createImageElementFromFile,
10
- v as defaultCssVars,
11
- N as defaultRadius,
12
- c as defaultThemeColors,
13
- C as deleteAutosaveSnapshot,
14
- k as describeCollaborationShellState,
15
- F as exportAllSlidesToSvg,
16
- R as exportAllSlidesToSvgBlobs,
17
- V as exportSlideAsSvg,
18
- O as exportSlideToSvg,
19
- L as exportSlideToSvgBlob,
20
- f as forgetSessionDeck,
21
- g as getAutosaveSnapshot,
22
- l as getSessionTabId,
23
- i as isLegacyBinaryPresentation,
24
- o as isSupportedPresentationFile,
25
- n as listAutosaveSnapshots,
26
- I as loadPresentationDeck,
27
- r as loadSessionDeck,
28
- p as parsePresentationSessionId,
29
- D as presentationBaseName,
30
- x as registerTranslations,
31
- h as rememberSessionDeck,
32
- _ as renderToCanvas,
33
- T as restoreSessionDeck,
34
- d as savedPresentationFileName,
35
- E as themeToCssVars,
36
- A as vermilionDarkColors,
37
- a as vermilionDarkTheme,
38
- u as vermilionLightColors,
39
- S as vermilionLightTheme,
40
- m as vermilionRadius
6
+ t as BACKSTAGE_CARD_IDS,
7
+ l as BACKSTAGE_PAGE_IDS,
8
+ n as CANVAS_CONTEXT_MENU_COMMAND_IDS,
9
+ O as EDITOR_SHORTCUT_ACTION_IDS,
10
+ P as ELEMENT_CONTEXT_MENU_COMMAND_IDS,
11
+ I as OPTIONS_PAGE_IDS,
12
+ E as OPTIONS_SECTION_IDS,
13
+ N as OPTIONS_SETTING_IDS,
14
+ p as PPTX_OPEN_ACCEPT,
15
+ L as PRESENTATION_OPEN_EXTENSIONS,
16
+ J as PowerPointViewer,
17
+ S as RIBBON_TAB_IDS,
18
+ h as TOOLBAR_BUTTON_IDS,
19
+ D as VIEWER_DIALOG_IDS,
20
+ F as VIEWER_EXPORT_FORMAT_IDS,
21
+ U as VIEWER_FEATURE_IDS,
22
+ X as VIEWER_PANEL_IDS,
23
+ d as createImageElementFromFile,
24
+ M as defaultCssVars,
25
+ a as defaultRadius,
26
+ i as defaultThemeColors,
27
+ T as deleteAutosaveSnapshot,
28
+ r as describeCollaborationShellState,
29
+ z as exportAllSlidesToSvg,
30
+ j as exportAllSlidesToSvgBlobs,
31
+ q as exportSlideAsSvg,
32
+ H as exportSlideToSvg,
33
+ Y as exportSlideToSvgBlob,
34
+ _ as forgetSessionDeck,
35
+ e as getAutosaveSnapshot,
36
+ V as getSessionTabId,
37
+ g as isLegacyBinaryPresentation,
38
+ k as isSupportedPresentationFile,
39
+ R as listAutosaveSnapshots,
40
+ c as loadPresentationDeck,
41
+ u as loadSessionDeck,
42
+ G as parsePresentationSessionId,
43
+ W as presentationBaseName,
44
+ w as registerTranslations,
45
+ B as rememberSessionDeck,
46
+ Z as renderToCanvas,
47
+ A as restoreSessionDeck,
48
+ m as savedPresentationFileName,
49
+ o as themeToCssVars,
50
+ f as vermilionDarkColors,
51
+ b as vermilionDarkTheme,
52
+ C as vermilionLightColors,
53
+ v as vermilionLightTheme,
54
+ x as vermilionRadius
41
55
  };