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.
@@ -1187,6 +1187,7 @@ var n = {
1187
1187
  "pptx.compare.noDifferences": "No differences",
1188
1188
  "pptx.compare.summary": "{{added}} added, {{removed}} removed, {{changed}} changed",
1189
1189
  "pptx.compare.title": "Compare",
1190
+ "pptx.canvasContextMenu.ariaLabel": "Canvas context menu",
1190
1191
  "pptx.canvasContextMenu.formatBackground": "Format Background...",
1191
1192
  "pptx.canvasContextMenu.gridAndGuides": "Grid and Guides",
1192
1193
  "pptx.canvasContextMenu.layout": "Layout",
@@ -1467,6 +1468,15 @@ var n = {
1467
1468
  "pptx.slideSorter.contextMenu.hideSlides": "Hide Slides",
1468
1469
  "pptx.slideSorter.contextMenu.paste": "Paste",
1469
1470
  "pptx.slideSorter.contextMenu.showSlides": "Show Slides",
1471
+ "pptx.slidesPane.contextMenu.newSlide": "New Slide",
1472
+ "pptx.slidesPane.contextMenu.duplicate": "Duplicate Slide",
1473
+ "pptx.slidesPane.contextMenu.duplicateCount": "Duplicate {{count}} Slides",
1474
+ "pptx.slidesPane.contextMenu.delete": "Delete Slide",
1475
+ "pptx.slidesPane.contextMenu.deleteCount": "Delete {{count}} Slides",
1476
+ "pptx.slidesPane.contextMenu.layout": "Layout",
1477
+ "pptx.slidesPane.contextMenu.hide": "Hide Slide",
1478
+ "pptx.slidesPane.contextMenu.show": "Show Slide",
1479
+ "pptx.slidesPane.contextMenu.addSection": "Add Section",
1470
1480
  "pptx.smartart.cancel": "Cancel",
1471
1481
  "pptx.smartart.close": "Close",
1472
1482
  "pptx.smartart.insert": "Insert",
@@ -3016,6 +3026,7 @@ Item 3`,
3016
3026
  "pptx.options.screenTipStyle.off": "Don't show ScreenTips",
3017
3027
  "pptx.options.general.personalize": "Personalize your copy of the viewer",
3018
3028
  "pptx.options.general.userName": "User name",
3029
+ "pptx.options.lockedByHost": "This setting is managed by your organization",
3019
3030
  "pptx.options.general.userInitials": "Initials",
3020
3031
  "pptx.options.general.appearance": "Viewer theme",
3021
3032
  "pptx.options.general.fonts": "Fonts",
@@ -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
  *
@@ -12194,7 +12236,7 @@ interface ReflectionWrapperStyle {
12194
12236
  top: string;
12195
12237
  width: string;
12196
12238
  height: string;
12197
- /** Mirror (`scaleY(-1)`) composed with `@sx`/`@sy`/`@kx`/`@ky`/`@rot`. */
12239
+ /** `scale(@sx, @sy)` (the sign of `@sy` IS the mirror) composed with `@kx`/`@ky`/`@rot`. */
12198
12240
  transform: string;
12199
12241
  /** Anchor point for the transform above, from `@algn` (default `center top`). */
12200
12242
  transformOrigin: string;
@@ -13232,6 +13274,27 @@ interface PresentationInkStroke {
13232
13274
  width: number;
13233
13275
  points: PresentationInkPoint[];
13234
13276
  }
13277
+ /** A logical editor command produced by one key press. */
13278
+ 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';
13279
+ /** Every command a canvas context menu can offer, in no particular order. */
13280
+ 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';
13281
+ //#endregion
13282
+ //#region src/render/canvas-context-menu-commands.d.ts
13283
+ /**
13284
+ * The right-click menu for the empty slide canvas (no element under the
13285
+ * cursor), as distinct from {@link ./context-menu-commands}'s per-element menu.
13286
+ *
13287
+ * Right-clicking empty canvas used to do nothing at all in every binding: React
13288
+ * and Vue both bailed out early (`getElementIdFromEvent` returns `null`, so the
13289
+ * handler just returns) rather than opening a menu, and the other three never
13290
+ * wired a handler for it either. PowerPoint offers Paste, Layout, Reset,
13291
+ * Format Background and view toggles (Grid and Guides, Ruler) from this menu;
13292
+ * this module is the one list every binding renders instead of five omissions.
13293
+ *
13294
+ * @module render/canvas-context-menu-commands
13295
+ */
13296
+ /** Every command the empty-canvas context menu can offer, in no particular order. */
13297
+ type CanvasContextMenuCommandId = 'paste' | 'layout' | 'reset-slide' | 'format-background' | 'grid-and-guides' | 'ruler';
13235
13298
  //#endregion
13236
13299
  //#region src/render/paste-special.d.ts
13237
13300
  /** The four paste formats PowerPoint's Paste Options / Paste Special offer. */
@@ -13495,6 +13558,21 @@ interface AutosaveRecoveryPrompt {
13495
13558
  readonly restoreKey: string;
13496
13559
  readonly discardKey: string;
13497
13560
  }
13561
+ type BackstagePage = 'home' | 'new' | 'open' | 'info' | 'save' | 'saveAs' | 'print' | 'share' | 'export' | 'close' | 'account' | 'options';
13562
+ //#endregion
13563
+ //#region src/render/backstage-cards.d.ts
13564
+ /**
13565
+ * Every action card the File-tab backstage can show, keyed by the operation it
13566
+ * triggers rather than by its wording.
13567
+ *
13568
+ * The five bindings used to hardcode a title and a body string each, which made
13569
+ * the whole backstage untranslatable and let the copy drift: the same card
13570
+ * carried four different descriptions depending on which binding you opened it
13571
+ * in. Both halves now live here as a dictionary key plus an English fallback,
13572
+ * so a wording change lands everywhere at once and a translator only has to
13573
+ * translate it once.
13574
+ */
13575
+ type BackstageCardId = 'protect' | 'inspect' | 'embedFonts' | 'signatures' | 'versionHistory' | 'saveAsPptx' | 'saveAsPpsx' | 'saveAsPptm' | 'saveAsPpt' | 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage' | 'print' | 'share';
13498
13576
  //#endregion
13499
13577
  //#region src/render/master-view.d.ts
13500
13578
  /** Which part the master view is currently pointed at. */
@@ -13864,6 +13942,136 @@ interface PrintSettings {
13864
13942
  */
13865
13943
  scaleToFit?: boolean;
13866
13944
  }
13945
+ //#endregion
13946
+ //#region src/render/options/viewer-options-controls.d.ts
13947
+ /**
13948
+ * Control/section/tab descriptor types for the File > Options schema, plus
13949
+ * the terse constructors the tab-definition modules build panes with.
13950
+ */
13951
+ type ViewerOptionsTabId = 'general' | 'proofing' | 'save' | 'language' | 'accessibility' | 'advanced' | 'ribbon' | 'quickAccess' | 'addIns' | 'trust';
13952
+ //#endregion
13953
+ //#region src/render/customization/customization-types.d.ts
13954
+ /** Keys of an options group whose value is a primitive (not an array). */
13955
+ type PrimitiveKeys<T> = { [K in keyof T]: T[K] extends ViewerOptionPrimitive ? K : never; }[keyof T] & string;
13956
+ /**
13957
+ * One File > Options setting, addressed as `<group>.<key>`, for example
13958
+ * `general.userName` or `advanced.showGrid`. The union is derived from the
13959
+ * `ViewerOptions` model itself, so a typo is a compile error.
13960
+ */
13961
+ type OptionsSettingId = { [G in ViewerOptionsGroupId]: `${G}.${PrimitiveKeys<ViewerOptions[G]>}`; }[ViewerOptionsGroupId];
13962
+ /**
13963
+ * A File > Options page: the ten PowerPoint categories plus `ai`, the AI
13964
+ * assistant page a binding adds when the host configured an assistant.
13965
+ */
13966
+ type OptionsPageId = ViewerOptionsTabId | 'ai';
13967
+ /**
13968
+ * One section of an Options page, addressed as `<page>.<section>`, for
13969
+ * example `general.personalize` or `advanced.print`. The full list is
13970
+ * `OPTIONS_SECTION_IDS` (derived from the schema at runtime).
13971
+ */
13972
+ type OptionsSectionId = `${ViewerOptionsTabId}.${string}`;
13973
+ /** Values a host forces onto settings. */
13974
+ type OptionsSettingValues = Partial<Record<OptionsSettingId, ViewerOptionPrimitive>>;
13975
+ /** Ribbon and toolbar customisation. */
13976
+ interface RibbonCustomization {
13977
+ /** Ribbon tabs to remove (the File tab included, unlike Customize Ribbon). */
13978
+ hiddenTabs?: readonly ToolbarTabId[];
13979
+ /** Top-level toolbar buttons / control clusters to remove. */
13980
+ hiddenButtons?: readonly ToolbarButtonId[];
13981
+ }
13982
+ /** File > Options (the Settings dialog) customisation. */
13983
+ interface OptionsCustomization {
13984
+ /** Whole pages to remove from the dialog's category rail. */
13985
+ hiddenPages?: readonly OptionsPageId[];
13986
+ /** Sections (`<page>.<section>`) to remove from their page. */
13987
+ hiddenSections?: readonly OptionsSectionId[];
13988
+ /** Individual settings (`<group>.<key>`) to remove wherever they appear. */
13989
+ hiddenSettings?: readonly OptionsSettingId[];
13990
+ /**
13991
+ * Settings pinned to a fixed value. The value is forced into the options
13992
+ * store, user edits to it are ignored, and the control renders read-only.
13993
+ * Add the id to `hiddenSettings` too to lock it invisibly.
13994
+ */
13995
+ locked?: OptionsSettingValues;
13996
+ /**
13997
+ * Host defaults: the value a setting starts at when the user has not saved
13998
+ * a choice of their own. "Reset" returns to these, not to the built-ins.
13999
+ */
14000
+ defaults?: OptionsSettingValues;
14001
+ }
14002
+ /** File tab (backstage) customisation. */
14003
+ interface BackstageCustomization {
14004
+ /** Navigation entries (pages) to remove from the File tab. */
14005
+ hiddenPages?: readonly BackstagePage[];
14006
+ /** Action cards to remove from the pages that show them. */
14007
+ hiddenCards?: readonly BackstageCardId[];
14008
+ }
14009
+ /** Right-click menu customisation. */
14010
+ interface ContextMenuCustomization {
14011
+ /** Entries to remove from the element (right-click on a shape) menu. */
14012
+ hiddenElementCommands?: readonly ContextMenuCommandId[];
14013
+ /** Entries to remove from the empty-canvas menu. */
14014
+ hiddenCanvasCommands?: readonly CanvasContextMenuCommandId[];
14015
+ /** Remove the element context menu entirely. */
14016
+ disableElementMenu?: boolean;
14017
+ /** Remove the empty-canvas context menu entirely. */
14018
+ disableCanvasMenu?: boolean;
14019
+ }
14020
+ /**
14021
+ * A shortcut chord in the form `Mod+Shift+D`: modifiers `Mod` (Ctrl on
14022
+ * Windows/Linux, Cmd on macOS), `Ctrl`, `Meta`, `Alt`, `Shift`, joined by `+`,
14023
+ * followed by a `KeyboardEvent.key` value (`D`, `Delete`, `ArrowLeft`, `F2`).
14024
+ */
14025
+ type ShortcutChord = string;
14026
+ /** Editor keyboard-shortcut customisation. */
14027
+ interface KeyboardCustomization {
14028
+ /** Turn every editor shortcut off (the host owns the keyboard). */
14029
+ disableAll?: boolean;
14030
+ /** Editor commands whose shortcut is turned off. */
14031
+ disabled?: readonly EditorKeyActionName[];
14032
+ /**
14033
+ * Replacement chords per command. A remapped command no longer answers to
14034
+ * its built-in chord; it answers to the chord(s) given here instead.
14035
+ */
14036
+ remap?: Partial<Record<EditorKeyActionName, ShortcutChord | readonly ShortcutChord[]>>;
14037
+ }
14038
+ /**
14039
+ * Chrome regions a host can remove. Each id maps onto one region in every
14040
+ * binding; see `VIEWER_PANEL_IDS` for the catalogue.
14041
+ */
14042
+ type ViewerPanelId = 'statusBar' | 'slidesPane' | 'inspector' | 'notes' | 'quickAccessToolbar' | 'titleBar';
14043
+ /** Feature areas that can be switched off as a whole. */
14044
+ type ViewerFeatureId = 'ai' | 'collaboration' | 'comments' | 'presentMode';
14045
+ /** Dialogs (and the entry points that open them) a host can remove. */
14046
+ type ViewerDialogId = 'options' | 'share' | 'broadcast' | 'print' | 'export';
14047
+ /** Export formats offered by the File > Export page. */
14048
+ type ViewerExportFormatId = 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage';
14049
+ /**
14050
+ * The whole customisation object. Every field is optional; omitted fields hide
14051
+ * nothing and lock nothing.
14052
+ */
14053
+ interface ViewerCustomization {
14054
+ ribbon?: RibbonCustomization;
14055
+ options?: OptionsCustomization;
14056
+ backstage?: BackstageCustomization;
14057
+ contextMenu?: ContextMenuCustomization;
14058
+ keyboard?: KeyboardCustomization;
14059
+ /** Chrome regions to remove (`true` hides). */
14060
+ hiddenPanels?: readonly ViewerPanelId[];
14061
+ /** Feature areas to switch off (their buttons, menus, pages and panels). */
14062
+ disabledFeatures?: readonly ViewerFeatureId[];
14063
+ /** Dialogs to remove, along with every entry point that opens them. */
14064
+ hiddenDialogs?: readonly ViewerDialogId[];
14065
+ /** Export formats to remove from File > Export. */
14066
+ hiddenExportFormats?: readonly ViewerExportFormatId[];
14067
+ }
14068
+ //#endregion
14069
+ //#region src/render/options/viewer-options-constraints.d.ts
14070
+ /** Locks and host defaults, both keyed `<group>.<key>`. */
14071
+ interface ViewerOptionsConstraints {
14072
+ locked?: OptionsSettingValues;
14073
+ defaults?: OptionsSettingValues;
14074
+ }
13867
14075
  interface ViewerOptionsStoreInit {
13868
14076
  /** Seed values layered over defaults before persisted values are applied. */
13869
14077
  initial?: StoredViewerOptions;
@@ -13871,6 +14079,87 @@ interface ViewerOptionsStoreInit {
13871
14079
  persist?: boolean;
13872
14080
  }
13873
14081
  //#endregion
14082
+ //#region src/render/customization/customization-keymap.d.ts
14083
+ /** A parsed `Mod+Shift+D` chord. */
14084
+ interface ParsedShortcutChord {
14085
+ key: string;
14086
+ mod: boolean;
14087
+ ctrl: boolean;
14088
+ meta: boolean;
14089
+ alt: boolean;
14090
+ shift: boolean;
14091
+ }
14092
+ /** The normalised keyboard slice of a resolved customisation. */
14093
+ interface ResolvedKeyboardCustomization {
14094
+ disableAll: boolean;
14095
+ disabled: ReadonlySet<EditorKeyActionName>;
14096
+ remap: ReadonlyMap<EditorKeyActionName, readonly ParsedShortcutChord[]>;
14097
+ }
14098
+ //#endregion
14099
+ //#region src/render/customization/customization-resolve.d.ts
14100
+ /** The normalised, set-based view of a customisation. Treat as immutable. */
14101
+ interface ResolvedCustomization {
14102
+ hiddenActions: ReadonlySet<ToolbarActionId>;
14103
+ hiddenOptionsPages: ReadonlySet<OptionsPageId>;
14104
+ hiddenOptionsSections: ReadonlySet<OptionsSectionId>;
14105
+ hiddenSettings: ReadonlySet<OptionsSettingId>;
14106
+ lockedSettings: OptionsSettingValues;
14107
+ defaultSettings: OptionsSettingValues;
14108
+ hiddenBackstagePages: ReadonlySet<BackstagePage>;
14109
+ hiddenBackstageCards: ReadonlySet<BackstageCardId>;
14110
+ hiddenElementCommands: ReadonlySet<ContextMenuCommandId>;
14111
+ hiddenCanvasCommands: ReadonlySet<CanvasContextMenuCommandId>;
14112
+ elementMenuEnabled: boolean;
14113
+ canvasMenuEnabled: boolean;
14114
+ hiddenPanels: ReadonlySet<ViewerPanelId>;
14115
+ disabledFeatures: ReadonlySet<ViewerFeatureId>;
14116
+ hiddenDialogs: ReadonlySet<ViewerDialogId>;
14117
+ keyboard: ResolvedKeyboardCustomization;
14118
+ }
14119
+ //#endregion
14120
+ //#region src/render/customization/customization-controller.d.ts
14121
+ /** The imperative methods every binding's component handle exposes. */
14122
+ interface ViewerCustomizationApi {
14123
+ /** The current customisation object (a snapshot; do not mutate). */
14124
+ getCustomization(): ViewerCustomization;
14125
+ /** Replace the whole customisation. */
14126
+ setCustomization(next: ViewerCustomization): void;
14127
+ /** Merge a partial customisation (see `mergeCustomization`). */
14128
+ updateCustomization(patch: ViewerCustomization): void;
14129
+ /** Drop every customisation, back to the stock UI. */
14130
+ resetCustomization(): void;
14131
+ hideRibbonTab(tab: ToolbarTabId): void;
14132
+ showRibbonTab(tab: ToolbarTabId): void;
14133
+ hideToolbarButton(button: ToolbarButtonId): void;
14134
+ showToolbarButton(button: ToolbarButtonId): void;
14135
+ hideOptionsPage(page: OptionsPageId): void;
14136
+ showOptionsPage(page: OptionsPageId): void;
14137
+ hideOptionsSection(section: OptionsSectionId): void;
14138
+ showOptionsSection(section: OptionsSectionId): void;
14139
+ hideSetting(setting: OptionsSettingId): void;
14140
+ showSetting(setting: OptionsSettingId): void;
14141
+ /** Pin a setting to `value`; `hidden` also removes it from the dialog. */
14142
+ lockSetting(setting: OptionsSettingId, value: ViewerOptionPrimitive, hidden?: boolean): void;
14143
+ unlockSetting(setting: OptionsSettingId): void;
14144
+ /** Set (or with `undefined`, clear) the host default for a setting. */
14145
+ setSettingDefault(setting: OptionsSettingId, value: ViewerOptionPrimitive | undefined): void;
14146
+ hideBackstagePage(page: BackstagePage): void;
14147
+ showBackstagePage(page: BackstagePage): void;
14148
+ hideBackstageCard(card: BackstageCardId): void;
14149
+ showBackstageCard(card: BackstageCardId): void;
14150
+ hideContextMenuCommand(command: ContextMenuCommandId): void;
14151
+ showContextMenuCommand(command: ContextMenuCommandId): void;
14152
+ hideCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
14153
+ showCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
14154
+ disableShortcut(action: EditorKeyActionName): void;
14155
+ enableShortcut(action: EditorKeyActionName): void;
14156
+ /** Move a command onto new chord(s); `undefined` restores the built-in chord. */
14157
+ remapShortcut(action: EditorKeyActionName, chords: ShortcutChord | readonly ShortcutChord[] | undefined): void;
14158
+ setPanelVisible(panel: ViewerPanelId, visible: boolean): void;
14159
+ setFeatureEnabled(feature: ViewerFeatureId, enabled: boolean): void;
14160
+ setDialogAvailable(dialog: ViewerDialogId, available: boolean): void;
14161
+ }
14162
+ //#endregion
13874
14163
  //#region src/render/editor-mutations.d.ts
13875
14164
  /**
13876
14165
  * Pure, immutable slide-array mutations for the editor.
@@ -14653,6 +14942,18 @@ interface PowerPointViewerProps extends ViewportFitOptions {
14653
14942
  * hidden, matching the pre-existing always-visible behaviour.
14654
14943
  */
14655
14944
  hiddenActions?: ToolbarActionId[];
14945
+ /**
14946
+ * Framework-neutral UI customisation. See docs/guide/customization.md.
14947
+ *
14948
+ * Hides ribbon tabs, toolbar buttons, Options pages / sections / settings,
14949
+ * File tab pages and cards, context-menu entries, panels, features and
14950
+ * dialogs; locks settings and sets host defaults; disables or remaps editor
14951
+ * shortcuts. Unioned with `hiddenActions`. Passing a NEW object replaces the
14952
+ * whole customisation, discarding edits made through the imperative
14953
+ * helpers (`hideRibbonTab`, `lockSetting`, ...) on the component instance;
14954
+ * mutating the same object in place is not observed.
14955
+ */
14956
+ customization?: ViewerCustomization;
14656
14957
  /**
14657
14958
  * Show the speaker-notes panel and its toolbar toggle. Default true. The
14658
14959
  * panel is plain-text only and reads the active slide's notes; pass
@@ -14843,9 +15144,10 @@ interface PowerPointViewerProps extends ViewportFitOptions {
14843
15144
  /**
14844
15145
  * Imperative editing API exposed on the `<PowerPointViewer>` component
14845
15146
  * instance (via `bind:this`). Mirrors the vanilla binding's `EditorController`
14846
- * surface subset the host drives directly.
15147
+ * surface subset the host drives directly, plus the shared UI-customisation
15148
+ * helpers (`ViewerCustomizationApi`: `hideRibbonTab`, `lockSetting`, ...).
14847
15149
  */
14848
- interface PowerPointViewerApi extends PowerPointViewerAPI {
15150
+ interface PowerPointViewerApi extends PowerPointViewerAPI, ViewerCustomizationApi {
14849
15151
  /** Undo the last committed edit. */
14850
15152
  undo(): void;
14851
15153
  /** Redo the last undone edit. */
@@ -15660,6 +15962,13 @@ declare class EditorSlidesController {
15660
15962
  constructor(editor: EditorState);
15661
15963
  /** Insert a blank slide after the current one. Returns its new index, or null when not editable. */
15662
15964
  insertSlideAfterCurrent(): number | null;
15965
+ /**
15966
+ * Insert a blank slide after `index` (the thumbnail context menu's New
15967
+ * Slide, and Enter on a focused thumbnail, both of which may target a slide
15968
+ * other than the currently active one). Returns the new index, or null
15969
+ * when not editable.
15970
+ */
15971
+ insertSlideAfter(index: number): number | null;
15663
15972
  /**
15664
15973
  * Insert a shared-catalogue template slide after the current one, as one
15665
15974
  * undoable step (Home > Slide Templates gallery). The caller (the gallery
@@ -15688,6 +15997,12 @@ declare class EditorSlidesController {
15688
15997
  deleteSlideAtIndex(index: number): number | null;
15689
15998
  /** Toggle the hidden flag on the slide at `index` (the sorter's context-menu target). */
15690
15999
  toggleSlideHidden(index: number): void;
16000
+ /** Duplicate every selected slide (the thumbnail context menu's multi-select bulk Duplicate). */
16001
+ duplicateSlides(indexes: readonly number[]): void;
16002
+ /** Delete every selected slide (the thumbnail context menu's multi-select bulk Delete). */
16003
+ deleteSlides(indexes: readonly number[]): void;
16004
+ /** Toggle hidden on every selected slide (the thumbnail context menu's multi-select bulk Hide/Show). */
16005
+ toggleSlidesHidden(indexes: readonly number[]): void;
15691
16006
  /**
15692
16007
  * The layouts available for the current slide (its master's layouts),
15693
16008
  * resolved via the core `getAvailableLayoutsForSlide` API. Empty when no
@@ -16168,6 +16483,12 @@ interface EditorControllerDeps {
16168
16483
  * model, so the cell under the pointer is the target.
16169
16484
  */
16170
16485
  onContextMenu?(x: number, y: number, cell: ContextMenuCellTarget | null): void;
16486
+ /**
16487
+ * Open the EMPTY-CANVAS context menu at viewport `x`/`y` (no element under
16488
+ * the cursor). Mutually exclusive with {@link onContextMenu}: opening one
16489
+ * closes the other.
16490
+ */
16491
+ onCanvasContextMenu?(x: number, y: number): void;
16171
16492
  getSnapToGrid?(): boolean;
16172
16493
  /**
16173
16494
  * Grid spacing in CSS px for snap-to-grid, derived from the deck's
@@ -16217,6 +16538,8 @@ interface EditorControllerDeps {
16217
16538
  * `create-viewer-state.svelte.ts`), so a host wires it in once it exists.
16218
16539
  */
16219
16540
  newSlide?(): void;
16541
+ /** Host keyboard customisation (disabled / remapped editor shortcuts). */
16542
+ getKeyboardCustomization?(): ResolvedKeyboardCustomization | undefined;
16220
16543
  }
16221
16544
 
16222
16545
  interface EditorMarqueeRect extends MarqueeRect {
@@ -16358,6 +16681,11 @@ interface StageContextMenu {
16358
16681
  y: number;
16359
16682
  cell: ContextMenuCellTarget | null;
16360
16683
  }
16684
+ /** Where the empty-canvas (no element hit) context menu opened. */
16685
+ interface StageCanvasContextMenu {
16686
+ x: number;
16687
+ y: number;
16688
+ }
16361
16689
 
16362
16690
  /**
16363
16691
  * Reactive Find & Replace panel state for the Home tab's Editing group.
@@ -16490,8 +16818,10 @@ interface RibbonProps {
16490
16818
  onheaderfooter: () => void;
16491
16819
  oncompare: () => void;
16492
16820
  onshortcuts: () => void;
16493
- onsettings: () => void;
16494
- onprintsettings: () => void;
16821
+ /** File > Options; omitted when the host removed the `options` dialog. */
16822
+ onsettings?: () => void;
16823
+ /** The Print dialog; omitted when the host removed the `print` dialog. */
16824
+ onprintsettings?: () => void;
16495
16825
  onrehearse: () => void;
16496
16826
  onrecordfrombeginning: () => void;
16497
16827
  onrecordfromcurrent: () => void;
@@ -17567,6 +17897,10 @@ declare class ViewerOptionsState {
17567
17897
  /** Viewer-root CSS classes reflecting display-affecting options. */
17568
17898
  get rootClasses(): string[];
17569
17899
  setValue(group: ViewerOptionsGroupId, key: string, value: ViewerOptionPrimitive): void;
17900
+ /** Host locks + defaults (from the `customization` prop); see the shared store. */
17901
+ setConstraints(constraints: ViewerOptionsConstraints): void;
17902
+ /** True when the host locked `<group>.<key>`. */
17903
+ isLocked(group: ViewerOptionsGroupId, key: string): boolean;
17570
17904
  /** Restore a snapshot wholesale (the dialog's Cancel semantics). */
17571
17905
  restore(snapshot: ViewerOptions): void;
17572
17906
  setRibbonTabHidden(tabId: ToolbarTabId, hidden: boolean): void;
@@ -17836,6 +18170,11 @@ interface CreateViewerStateOptions {
17836
18170
  getFileName?: () => string | undefined;
17837
18171
  /** Whether the host enabled the AI assistant (the `ai` prop). */
17838
18172
  getAiEnabled?: () => boolean;
18173
+ /**
18174
+ * The resolved host UI customisation (`customization` prop plus imperative
18175
+ * edits). Omitted means "customise nothing".
18176
+ */
18177
+ getCustomization?: () => ResolvedCustomization;
17839
18178
  onload?: (detail: ViewerLoadDetail) => void;
17840
18179
  onerror?: (message: string) => void;
17841
18180
  onslidechange?: (index: number) => void;
@@ -17957,6 +18296,7 @@ interface ViewerStateBag {
17957
18296
  /** `Date.now()` timestamp of the last `enterPresenterView()` call; the presenter view's elapsed-time display. */
17958
18297
  readonly presenterStartedAt: number;
17959
18298
  stageContextMenu: StageContextMenu | null;
18299
+ stageCanvasContextMenu: StageCanvasContextMenu | null;
17960
18300
  readonly activeMobileSheet: MobileSheetKey;
17961
18301
  setActiveMobileSheet(next: MobileSheetKey): void;
17962
18302
  readonly notesExpanded: boolean;
@@ -1,5 +1,5 @@
1
- import { Qh as l, Zh as S } from "../transition-overlay-CfsPqlES.js";
2
- import { A as e, I as a, N as o, P as r, a as n, c as d, d as b, f as p, i as c, j as s, k as t, l as m, n as g, o as x, p as w, r as C, s as P, t as T, u as $ } from "../export-BUx-Kmlc.js";
1
+ import { Mg as l, jg as S } from "../transition-overlay-Dkooknvn.js";
2
+ import { A as e, I as a, N as o, P as r, a as n, c as d, d as b, f as p, i as c, j as s, k as t, l as g, n as m, o as x, p as w, r as C, s as P, t as T, u as $ } from "../export-zzqiDncO.js";
3
3
  var y = a, A = r, V = s, f = e, u = t, R = o;
4
4
  export {
5
5
  f as CollaborationCursors,
@@ -13,12 +13,12 @@ export {
13
13
  A as ViewerToolbar,
14
14
  $ as clampSlideIndex,
15
15
  w as createSvelteAiBridge,
16
- g as createViewerState,
16
+ m as createViewerState,
17
17
  n as exportAllSlidesToSvg,
18
18
  x as exportAllSlidesToSvgBlobs,
19
19
  P as exportSlideAsSvg,
20
20
  d as exportSlideToSvg,
21
- m as exportSlideToSvgBlob,
21
+ g as exportSlideToSvgBlob,
22
22
  b as fitScale,
23
23
  p as resolveNavigationKey,
24
24
  S as zoomInPercent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-svelte-viewer",
3
- "version": "4.4.0",
3
+ "version": "4.6.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",