pptx-svelte-viewer 1.4.0 → 2.1.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/CHANGELOG.md +470 -0
- package/README.md +175 -17
- package/dist/AiChatPanel-CkC2py3J.js +1082 -0
- package/dist/__vite-browser-external-DOmiXdGM.js +7 -0
- package/dist/{dist-DZ-fjucV.js → dist-AHWCPEmj.js} +44226 -40236
- package/dist/export-CtfwVh4-.js +97263 -0
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +2193 -99
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -22
- package/dist/pptx-svelte-viewer.css +1 -1
- package/dist/rolldown-runtime--_vEcKDh.js +29 -0
- package/dist/{translator-D4a_pxY4.js → translator-Ddi-liGk.js} +251 -7
- package/dist/viewer/ai/ai-bridge.d.ts +61 -0
- package/dist/viewer/ai/ai-bridge.d.ts.map +1 -0
- package/dist/viewer/ai/ai-history-persist.d.ts +13 -0
- package/dist/viewer/ai/ai-history-persist.d.ts.map +1 -0
- package/dist/viewer/ai/ai-log-export.d.ts +71 -0
- package/dist/viewer/ai/ai-log-export.d.ts.map +1 -0
- package/dist/viewer/ai/ai-panel-controller.svelte.d.ts +77 -0
- package/dist/viewer/ai/ai-panel-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/ai/chat.svelte.d.ts +43 -0
- package/dist/viewer/ai/chat.svelte.d.ts.map +1 -0
- package/dist/viewer/ai/focus-targets.d.ts +36 -0
- package/dist/viewer/ai/focus-targets.d.ts.map +1 -0
- package/dist/viewer/ai/index.d.ts +11 -0
- package/dist/viewer/ai/index.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-deps.d.ts +23 -0
- package/dist/viewer/collab/collaboration-deps.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-effects.svelte.d.ts +17 -0
- package/dist/viewer/collab/collaboration-effects.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-provider.d.ts.map +1 -1
- package/dist/viewer/collab/collaboration-remote-sync.d.ts +32 -1
- package/dist/viewer/collab/collaboration-remote-sync.d.ts.map +1 -1
- package/dist/viewer/collab/collaboration.svelte.d.ts +12 -22
- package/dist/viewer/collab/collaboration.svelte.d.ts.map +1 -1
- package/dist/viewer/collab/components/props.d.ts +12 -0
- package/dist/viewer/collab/components/props.d.ts.map +1 -1
- package/dist/viewer/collab/components/remote-selection.d.ts +29 -0
- package/dist/viewer/collab/components/remote-selection.d.ts.map +1 -0
- package/dist/viewer/collab/components/share-helpers.d.ts +7 -28
- package/dist/viewer/collab/components/share-helpers.d.ts.map +1 -1
- package/dist/viewer/collab/index.d.ts +1 -1
- package/dist/viewer/collab/index.d.ts.map +1 -1
- package/dist/viewer/components/props.d.ts +68 -2
- package/dist/viewer/components/props.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/ribbon-types.d.ts +7 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts.map +1 -1
- package/dist/viewer/components/typed-exports.d.ts +19 -0
- package/dist/viewer/components/typed-exports.d.ts.map +1 -0
- package/dist/viewer/editor/editor-controller-deps.d.ts +15 -0
- package/dist/viewer/editor/editor-controller-deps.d.ts.map +1 -1
- package/dist/viewer/editor/editor-controller.svelte.d.ts +5 -0
- package/dist/viewer/editor/editor-controller.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-state.svelte.d.ts +6 -0
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
- package/dist/viewer/export/export-ui.svelte.d.ts +5 -0
- package/dist/viewer/export/export-ui.svelte.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +2816 -22
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +392 -14
- package/dist/viewer/presentation/animation-playback-helpers.d.ts +43 -0
- package/dist/viewer/presentation/animation-playback-helpers.d.ts.map +1 -0
- package/dist/viewer/presentation/animation-playback.svelte.d.ts +50 -40
- package/dist/viewer/presentation/animation-playback.svelte.d.ts.map +1 -1
- package/dist/viewer/presentation/animation-sound.d.ts +20 -0
- package/dist/viewer/presentation/animation-sound.d.ts.map +1 -0
- package/dist/viewer/presentation/apply-animation-styles.d.ts +6 -5
- package/dist/viewer/presentation/apply-animation-styles.d.ts.map +1 -1
- package/dist/viewer/presentation/index.d.ts +2 -1
- package/dist/viewer/presentation/index.d.ts.map +1 -1
- package/dist/viewer/presentation/keyframes.d.ts +9 -0
- package/dist/viewer/presentation/keyframes.d.ts.map +1 -1
- package/dist/viewer/presentation/presentation-controller.svelte.d.ts +32 -10
- package/dist/viewer/presentation/presentation-controller.svelte.d.ts.map +1 -1
- package/dist/viewer/presentation/presentation-effects.svelte.d.ts +6 -2
- package/dist/viewer/presentation/presentation-effects.svelte.d.ts.map +1 -1
- package/dist/viewer/presentation/presentation-triggers.d.ts +18 -0
- package/dist/viewer/presentation/presentation-triggers.d.ts.map +1 -0
- package/dist/viewer/presentation/transition-overlay.d.ts +23 -0
- package/dist/viewer/presentation/transition-overlay.d.ts.map +1 -0
- package/dist/viewer/render/smartart-view.d.ts +7 -2
- package/dist/viewer/render/smartart-view.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-collab.svelte.d.ts +37 -0
- package/dist/viewer/state/create-viewer-state-collab.svelte.d.ts.map +1 -0
- package/dist/viewer/state/create-viewer-state-editor-ui.svelte.d.ts +42 -0
- package/dist/viewer/state/create-viewer-state-editor-ui.svelte.d.ts.map +1 -0
- package/dist/viewer/state/create-viewer-state-export-notes.svelte.d.ts +36 -0
- package/dist/viewer/state/create-viewer-state-export-notes.svelte.d.ts.map +1 -0
- package/dist/viewer/state/create-viewer-state-presentation.svelte.d.ts +30 -0
- package/dist/viewer/state/create-viewer-state-presentation.svelte.d.ts.map +1 -0
- package/dist/viewer/state/create-viewer-state-types.d.ts +134 -0
- package/dist/viewer/state/create-viewer-state-types.d.ts.map +1 -0
- package/dist/viewer/state/create-viewer-state.svelte.d.ts +30 -0
- package/dist/viewer/state/create-viewer-state.svelte.d.ts.map +1 -0
- package/dist/viewer/state/index.d.ts +2 -0
- package/dist/viewer/state/index.d.ts.map +1 -1
- package/dist/viewer/state/presentation-element-states-context.d.ts +37 -0
- package/dist/viewer/state/presentation-element-states-context.d.ts.map +1 -0
- package/dist/viewer/state/render-context.d.ts +3 -1
- package/dist/viewer/state/render-context.d.ts.map +1 -1
- package/dist/viewer/state/viewer-effects.svelte.d.ts +8 -0
- package/dist/viewer/state/viewer-effects.svelte.d.ts.map +1 -1
- package/dist/viewer/state/viewer-options-context.d.ts +10 -0
- package/dist/viewer/state/viewer-options-context.d.ts.map +1 -0
- package/dist/viewer/state/viewer-options-wiring.svelte.d.ts +31 -0
- package/dist/viewer/state/viewer-options-wiring.svelte.d.ts.map +1 -0
- package/dist/viewer/state/viewer-options.svelte.d.ts +55 -0
- package/dist/viewer/state/viewer-options.svelte.d.ts.map +1 -0
- package/dist/viewer/style/element-style.d.ts +3 -3
- package/dist/viewer/style/element-style.d.ts.map +1 -1
- package/dist/viewer/types.d.ts +16 -5
- package/dist/viewer/types.d.ts.map +1 -1
- package/dist/{y-webrtc-BdH40MC6.js → y-webrtc-BiViqyU2.js} +1079 -1101
- package/package.json +18 -5
- package/dist/export-N-hrLHrd.js +0 -38592
package/dist/viewer/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import * as svelte from 'svelte';
|
|
1
2
|
import { Component } from 'svelte';
|
|
3
|
+
import { LanguageModel, ChatTransport, UIMessage, ToolSet } from 'ai';
|
|
2
4
|
|
|
3
5
|
//#region src/core/types/actions.d.ts
|
|
4
6
|
/**
|
|
@@ -204,6 +206,13 @@ interface PptxShapeLocks {
|
|
|
204
206
|
noAdjustHandles?: boolean;
|
|
205
207
|
noChangeArrowheads?: boolean;
|
|
206
208
|
noChangeShapeType?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Text-box flag from `p:cNvSpPr/@txBox`. Not a lock in the strict sense,
|
|
211
|
+
* but it lives on the same non-visual-properties node as `a:spLocks`, so
|
|
212
|
+
* it is captured here to round-trip through the model. When `true` the
|
|
213
|
+
* shape is a plain text box (no fill/line by default).
|
|
214
|
+
*/
|
|
215
|
+
txBox?: boolean;
|
|
207
216
|
}
|
|
208
217
|
/**
|
|
209
218
|
* A drawing guide parsed from OOXML extension lists.
|
|
@@ -793,6 +802,15 @@ interface ShapeStyle {
|
|
|
793
802
|
r: number;
|
|
794
803
|
b: number;
|
|
795
804
|
};
|
|
805
|
+
/** Raw tileRect LTRB values (0..1 fractions, may be negative) from
|
|
806
|
+
* `a:gradFill/a:tileRect`. Defines the rectangle the gradient tile occupies
|
|
807
|
+
* before any flip/tiling is applied. */
|
|
808
|
+
fillGradientTileRect?: {
|
|
809
|
+
l: number;
|
|
810
|
+
t: number;
|
|
811
|
+
r: number;
|
|
812
|
+
b: number;
|
|
813
|
+
};
|
|
796
814
|
/** Gradient tile flip mode (`a:gradFill/@flip`).
|
|
797
815
|
* `none` = no tiling flip (default), `x|y|xy` = mirror in the named axis. */
|
|
798
816
|
fillGradientFlip?: 'none' | 'x' | 'y' | 'xy';
|
|
@@ -810,6 +828,20 @@ interface ShapeStyle {
|
|
|
810
828
|
* round-trip serialisation. See {@link fillColorXml} for the rationale.
|
|
811
829
|
*/
|
|
812
830
|
strokeColorXml?: XmlObject;
|
|
831
|
+
/**
|
|
832
|
+
* Kind of fill painted on the outline (`a:ln` child). Distinguishes a solid
|
|
833
|
+
* outline from a gradient/pattern/none outline so save can emit the correct
|
|
834
|
+
* single line fill instead of collapsing every outline to `a:solidFill`
|
|
835
|
+
* (which, alongside a preserved `a:gradFill`/`a:pattFill`, produces an
|
|
836
|
+
* invalid dual-fill `<a:ln>`).
|
|
837
|
+
*/
|
|
838
|
+
strokeFillMode?: 'solid' | 'gradient' | 'pattern' | 'none';
|
|
839
|
+
/** Raw `a:ln/a:gradFill` XML preserved for round-trip when the outline is
|
|
840
|
+
* gradient-filled. Re-emitted verbatim as the line's single fill on save. */
|
|
841
|
+
strokeGradientXml?: XmlObject;
|
|
842
|
+
/** Raw `a:ln/a:pattFill` XML preserved for round-trip when the outline is
|
|
843
|
+
* pattern-filled. Re-emitted verbatim as the line's single fill on save. */
|
|
844
|
+
strokePatternXml?: XmlObject;
|
|
813
845
|
strokeWidth?: number;
|
|
814
846
|
strokeOpacity?: number;
|
|
815
847
|
strokeDash?: StrokeDashType;
|
|
@@ -991,6 +1023,14 @@ interface ShapeStyle {
|
|
|
991
1023
|
};
|
|
992
1024
|
/** Fill overlay blend mode from effectDag `a:fillOverlay/@blend`. */
|
|
993
1025
|
dagFillOverlayBlend?: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
|
|
1026
|
+
/**
|
|
1027
|
+
* Fill overlay tint colour (hex `#RRGGBB`) from effectDag `a:fillOverlay`'s
|
|
1028
|
+
* `a:solidFill`/`a:gradFill`. Painted as a blended overlay layer over the
|
|
1029
|
+
* element; the blend mode comes from {@link dagFillOverlayBlend}.
|
|
1030
|
+
*/
|
|
1031
|
+
dagFillOverlayColor?: string;
|
|
1032
|
+
/** Fill overlay tint opacity (0-1), from the overlay fill colour's alpha. */
|
|
1033
|
+
dagFillOverlayOpacity?: number;
|
|
994
1034
|
/** `<a:lnRef @idx>` — 1-based index into the theme's lnStyleLst. */
|
|
995
1035
|
lnRefIdx?: number;
|
|
996
1036
|
/** Raw XML colour child of `<a:lnRef>` (e.g. `<a:schemeClr>` with transforms). */
|
|
@@ -1118,6 +1158,13 @@ interface TextStyle {
|
|
|
1118
1158
|
kerning?: number;
|
|
1119
1159
|
/** Text highlight colour as hex string (`a:highlight`). */
|
|
1120
1160
|
highlightColor?: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* Raw colour-choice XML preserved from `a:highlight` so a themed highlight
|
|
1163
|
+
* (`a:schemeClr` / `a:sysClr` / `a:prstClr`) re-emits with its original
|
|
1164
|
+
* identity rather than being flattened to `<a:srgbClr/>` on save. On save we
|
|
1165
|
+
* re-emit verbatim when the resolved {@link highlightColor} still matches.
|
|
1166
|
+
*/
|
|
1167
|
+
highlightColorXml?: XmlObject;
|
|
1121
1168
|
/** Text-level gradient fill CSS string (from `a:rPr > a:gradFill`). */
|
|
1122
1169
|
textFillGradient?: string;
|
|
1123
1170
|
/** Structured gradient stops for text fill round-trip serialization. */
|
|
@@ -1229,10 +1276,36 @@ interface TextStyle {
|
|
|
1229
1276
|
eastAsiaFont?: string;
|
|
1230
1277
|
/** Complex Script font family from `a:cs`. */
|
|
1231
1278
|
complexScriptFont?: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* Theme-font token (`+mj-lt` / `+mn-lt` / ...) authored on `a:latin`, when
|
|
1281
|
+
* present. {@link fontFamily} holds the resolved concrete face for
|
|
1282
|
+
* rendering; this preserves the token linkage so the writer re-emits the
|
|
1283
|
+
* token rather than the flattened face (see #84).
|
|
1284
|
+
*/
|
|
1285
|
+
latinFontThemeToken?: string;
|
|
1286
|
+
/** Theme-font token authored on `a:ea` (e.g. `+mn-ea`), when present. */
|
|
1287
|
+
eastAsiaFontThemeToken?: string;
|
|
1288
|
+
/** Theme-font token authored on `a:cs` (e.g. `+mn-cs`), when present. */
|
|
1289
|
+
complexScriptFontThemeToken?: string;
|
|
1290
|
+
/**
|
|
1291
|
+
* Automatic per-script fallback face resolved from the theme's
|
|
1292
|
+
* `<a:font script="...">` overrides for a run whose text is dominantly
|
|
1293
|
+
* CJK / Arabic / Hebrew / Thai (see #83). A rendering hint only: it is not
|
|
1294
|
+
* serialised back on save, so it never disturbs the round-trip typefaces.
|
|
1295
|
+
*/
|
|
1296
|
+
scriptFallbackFont?: string;
|
|
1232
1297
|
/** Text language from `a:rPr/@lang`. */
|
|
1233
1298
|
language?: string;
|
|
1234
1299
|
/** Hyperlink mouse-over target from `a:hlinkMouseOver`. */
|
|
1235
1300
|
hyperlinkMouseOver?: string;
|
|
1301
|
+
/**
|
|
1302
|
+
* Raw `a:snd` (embedded WAV audio) child of `a:hlinkClick`, preserved
|
|
1303
|
+
* verbatim (carries `@r:embed` + `@name`). Round-tripped on save so the
|
|
1304
|
+
* click sound survives instead of being dropped.
|
|
1305
|
+
*/
|
|
1306
|
+
hyperlinkSoundXml?: XmlObject;
|
|
1307
|
+
/** Raw `a:snd` child of `a:hlinkMouseOver`, preserved verbatim for round-trip. */
|
|
1308
|
+
hyperlinkMouseOverSoundXml?: XmlObject;
|
|
1236
1309
|
/** Hyperlink invalidUrl attribute (`a:hlinkClick/@invalidUrl`). */
|
|
1237
1310
|
hyperlinkInvalidUrl?: string;
|
|
1238
1311
|
/** Hyperlink target frame (`a:hlinkClick/@tgtFrame`). */
|
|
@@ -1576,6 +1649,15 @@ interface TextSegment {
|
|
|
1576
1649
|
* on the first segment of a paragraph.
|
|
1577
1650
|
*/
|
|
1578
1651
|
endParaRunProperties?: Record<string, unknown>;
|
|
1652
|
+
/**
|
|
1653
|
+
* Per-paragraph properties (alignment, spacing, margins, indent, tab stops,
|
|
1654
|
+
* rtl) authored on this paragraph's own `a:pPr` (#69). Only meaningful on
|
|
1655
|
+
* the first segment of a paragraph. When present, the writer emits these
|
|
1656
|
+
* per paragraph instead of collapsing one shape-level pPr onto every
|
|
1657
|
+
* paragraph. Only the paragraph-geometry keys of {@link TextStyle} are
|
|
1658
|
+
* populated; unrelated fields fall back to the shape-level style.
|
|
1659
|
+
*/
|
|
1660
|
+
paragraphProperties?: TextStyle;
|
|
1579
1661
|
/**
|
|
1580
1662
|
* Phonetic annotation text from `a:ruby > a:rt` (e.g. furigana, pinyin).
|
|
1581
1663
|
* When present, the renderer should wrap the base text with an HTML `<ruby>` tag.
|
|
@@ -1881,6 +1963,75 @@ interface PptxChartProtection {
|
|
|
1881
1963
|
rawXml?: XmlObject;
|
|
1882
1964
|
}
|
|
1883
1965
|
//#endregion
|
|
1966
|
+
//#region src/core/types/chart-user-shapes.d.ts
|
|
1967
|
+
/**
|
|
1968
|
+
* Types for chart drawing-overlay shapes (`c:userShapes`).
|
|
1969
|
+
*
|
|
1970
|
+
* A chart's `c:userShapes` element carries an `r:id` that references a
|
|
1971
|
+
* separate drawing part (`ppt/drawings/drawingN.xml`) whose root is a
|
|
1972
|
+
* `c:userShapes` element populated with `cdr:relSizeAnchor` /
|
|
1973
|
+
* `cdr:absSizeAnchor` wrappers around `sp` / `pic` / `cxnSp` shapes drawn on
|
|
1974
|
+
* top of the chart plot. These interfaces describe the parsed, renderable
|
|
1975
|
+
* overlay model. The raw reference is preserved separately on
|
|
1976
|
+
* {@link PptxChartData.userShapesXml} for verbatim round-trip save; this model
|
|
1977
|
+
* is render-only.
|
|
1978
|
+
*
|
|
1979
|
+
* @module pptx-types/chart-user-shapes
|
|
1980
|
+
*/
|
|
1981
|
+
/** A single paragraph of overlay-shape text with light formatting. */
|
|
1982
|
+
interface PptxChartUserShapeParagraph {
|
|
1983
|
+
/** Joined run text of the paragraph. */
|
|
1984
|
+
text: string;
|
|
1985
|
+
/** Font size in points (`a:rPr/@sz` divided by 100), when present. */
|
|
1986
|
+
fontSize?: number;
|
|
1987
|
+
/** Whether the first run is bold (`a:rPr/@b`). */
|
|
1988
|
+
bold?: boolean;
|
|
1989
|
+
/** Whether the first run is italic (`a:rPr/@i`). */
|
|
1990
|
+
italic?: boolean;
|
|
1991
|
+
/** Resolved run colour hex (e.g. `"#FF0000"`), when present. */
|
|
1992
|
+
color?: string;
|
|
1993
|
+
/** Paragraph alignment (`a:pPr/@algn`): left / centre / right. */
|
|
1994
|
+
align?: 'l' | 'ctr' | 'r';
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* A parsed chart-overlay shape positioned by a drawing anchor.
|
|
1998
|
+
*
|
|
1999
|
+
* Position is expressed as chart-relative fractions in {@link from}. For a
|
|
2000
|
+
* `relSizeAnchor` the opposite corner is {@link to} (also fractional); for an
|
|
2001
|
+
* `absSizeAnchor` the extent is {@link ext} in EMU.
|
|
2002
|
+
*/
|
|
2003
|
+
interface PptxChartUserShape {
|
|
2004
|
+
/** Shape kind: text/preset shape, connector, or picture. */
|
|
2005
|
+
kind: 'sp' | 'cxnSp' | 'pic';
|
|
2006
|
+
/** Anchor kind that positioned the shape. */
|
|
2007
|
+
anchor: 'rel' | 'abs';
|
|
2008
|
+
/** Top-left corner as chart-relative fractions (0-1). */
|
|
2009
|
+
from: {
|
|
2010
|
+
x: number;
|
|
2011
|
+
y: number;
|
|
2012
|
+
};
|
|
2013
|
+
/** Bottom-right corner as chart-relative fractions (0-1); relSizeAnchor only. */
|
|
2014
|
+
to?: {
|
|
2015
|
+
x: number;
|
|
2016
|
+
y: number;
|
|
2017
|
+
};
|
|
2018
|
+
/** Extent in EMU (cx, cy); absSizeAnchor only. */
|
|
2019
|
+
ext?: {
|
|
2020
|
+
cx: number;
|
|
2021
|
+
cy: number;
|
|
2022
|
+
};
|
|
2023
|
+
/** Preset geometry name (`a:prstGeom/@prst`), defaulting to `"rect"`. */
|
|
2024
|
+
prst?: string;
|
|
2025
|
+
/** Resolved solid-fill hex colour, when present. */
|
|
2026
|
+
fill?: string;
|
|
2027
|
+
/** Resolved line/stroke hex colour, when present. */
|
|
2028
|
+
stroke?: string;
|
|
2029
|
+
/** Line width in points (`a:ln/@w` divided by 12700), when present. */
|
|
2030
|
+
strokeWidth?: number;
|
|
2031
|
+
/** Text paragraphs of the shape's `txBody`, when present. */
|
|
2032
|
+
paragraphs?: PptxChartUserShapeParagraph[];
|
|
2033
|
+
}
|
|
2034
|
+
//#endregion
|
|
1884
2035
|
//#region src/core/types/chart.d.ts
|
|
1885
2036
|
/**
|
|
1886
2037
|
* Supported chart type discriminators.
|
|
@@ -2214,6 +2365,15 @@ interface PptxChartTreemapOptions {
|
|
|
2214
2365
|
interface PptxChartSeries {
|
|
2215
2366
|
name: string;
|
|
2216
2367
|
values: number[];
|
|
2368
|
+
/**
|
|
2369
|
+
* Blank-value mask aligned index-for-index with {@link values}: `true` marks
|
|
2370
|
+
* a category whose numeric cache point (`c:numCache/c:pt`) was absent or
|
|
2371
|
+
* empty, i.e. a genuine blank rather than a real `0`. Present only when the
|
|
2372
|
+
* source series actually contains blanks; when set, blank slots in
|
|
2373
|
+
* {@link values} carry `0` as a placeholder. Renderers honour
|
|
2374
|
+
* `c:dispBlanksAs` (gap / zero / span) using this mask.
|
|
2375
|
+
*/
|
|
2376
|
+
blanks?: boolean[];
|
|
2217
2377
|
color?: string;
|
|
2218
2378
|
trendlines?: PptxChartTrendline[];
|
|
2219
2379
|
errBars?: PptxChartErrBars[];
|
|
@@ -2221,6 +2381,18 @@ interface PptxChartSeries {
|
|
|
2221
2381
|
marker?: PptxChartMarker;
|
|
2222
2382
|
dataLabels?: PptxChartDataLabel[];
|
|
2223
2383
|
explosion?: number;
|
|
2384
|
+
/**
|
|
2385
|
+
* Series-level `c:invertIfNegative`: when true, bar/column data points with a
|
|
2386
|
+
* negative value are drawn with an inverted (lightened) fill. A per-point
|
|
2387
|
+
* `c:dPt/c:invertIfNegative` overrides this for that point. Absent when the
|
|
2388
|
+
* source XML omits the flag.
|
|
2389
|
+
*/
|
|
2390
|
+
invertIfNegative?: boolean;
|
|
2391
|
+
/**
|
|
2392
|
+
* Whether this line/scatter series is drawn with bezier smoothing
|
|
2393
|
+
* (`c:ser/c:smooth/@val`). Absent when the source XML omits `c:smooth`.
|
|
2394
|
+
*/
|
|
2395
|
+
smooth?: boolean;
|
|
2224
2396
|
/** Axis ID this series is plotted against (links to PptxChartAxisFormatting.axisId). */
|
|
2225
2397
|
axisId?: number;
|
|
2226
2398
|
/**
|
|
@@ -2423,6 +2595,14 @@ interface PptxChartManualLayout {
|
|
|
2423
2595
|
y?: number;
|
|
2424
2596
|
width?: number;
|
|
2425
2597
|
height?: number;
|
|
2598
|
+
/**
|
|
2599
|
+
* Raw `c:extLst` (CT_ExtensionList) of the `c:manualLayout`, captured
|
|
2600
|
+
* verbatim so it round-trips through the typed model. Without this, a dirty
|
|
2601
|
+
* write of an edited layout would drop the extension list (the manual node
|
|
2602
|
+
* is rebuilt from the typed fields). Emitted as the trailing child, matching
|
|
2603
|
+
* the CT_ManualLayout schema order.
|
|
2604
|
+
*/
|
|
2605
|
+
ext?: XmlObject;
|
|
2426
2606
|
}
|
|
2427
2607
|
/**
|
|
2428
2608
|
* Typed manual layouts for chart regions that accept `c:layout`.
|
|
@@ -2487,6 +2667,33 @@ interface PptxChartData {
|
|
|
2487
2667
|
style?: PptxChartStyle;
|
|
2488
2668
|
/** Grouping mode for bar/area/line charts: 'clustered' | 'stacked' | 'percentStacked' */
|
|
2489
2669
|
grouping?: 'clustered' | 'stacked' | 'percentStacked';
|
|
2670
|
+
/**
|
|
2671
|
+
* Whether the first (or only) series varies its point colours
|
|
2672
|
+
* (`c:varyColors/@val`). Pie/doughnut default this on; single-series
|
|
2673
|
+
* bar/column honour it by giving each point a distinct palette colour.
|
|
2674
|
+
* Absent when the source XML omits `c:varyColors`.
|
|
2675
|
+
*/
|
|
2676
|
+
varyColors?: boolean;
|
|
2677
|
+
/**
|
|
2678
|
+
* Pie/doughnut start angle in degrees clockwise from 12 o'clock
|
|
2679
|
+
* (`c:firstSliceAng/@val`, 0 through 360). Absent uses the default 0.
|
|
2680
|
+
*/
|
|
2681
|
+
firstSliceAngle?: number;
|
|
2682
|
+
/**
|
|
2683
|
+
* Doughnut hole diameter as a percentage of the outer diameter
|
|
2684
|
+
* (`c:holeSize/@val`, 10 through 90). Absent uses the renderer default.
|
|
2685
|
+
*/
|
|
2686
|
+
doughnutHoleSize?: number;
|
|
2687
|
+
/**
|
|
2688
|
+
* Bar/column gap between category clusters as a percentage of bar width
|
|
2689
|
+
* (`c:gapWidth/@val`, 0 through 500). Absent uses the renderer default.
|
|
2690
|
+
*/
|
|
2691
|
+
barGapWidth?: number;
|
|
2692
|
+
/**
|
|
2693
|
+
* Clustered bar/column overlap between series within a category as a
|
|
2694
|
+
* percentage (`c:overlap/@val`, -100 through 100). Absent uses 0.
|
|
2695
|
+
*/
|
|
2696
|
+
barOverlap?: number;
|
|
2490
2697
|
/** Internal: path to the chart XML part in the PPTX archive (for round-trip save). */
|
|
2491
2698
|
chartPartPath?: string;
|
|
2492
2699
|
/** Internal: relationship ID linking the graphic frame to the chart part. */
|
|
@@ -2587,6 +2794,15 @@ interface PptxChartData {
|
|
|
2587
2794
|
* attempting to parse the nested drawing tree.
|
|
2588
2795
|
*/
|
|
2589
2796
|
userShapesXml?: unknown;
|
|
2797
|
+
/**
|
|
2798
|
+
* Parsed, renderable drawing-overlay shapes resolved from the separate
|
|
2799
|
+
* drawing part referenced by `c:userShapes/@r:id`
|
|
2800
|
+
* (`ppt/drawings/drawingN.xml`). Each entry carries chart-relative anchor
|
|
2801
|
+
* geometry plus light shape/text formatting so the viewer can render an
|
|
2802
|
+
* overlay on top of the chart plot. Render-only: {@link userShapesXml}
|
|
2803
|
+
* remains the source of truth for round-trip save.
|
|
2804
|
+
*/
|
|
2805
|
+
userShapes?: PptxChartUserShape[];
|
|
2590
2806
|
/**
|
|
2591
2807
|
* Raw `c:pivotFmts` XML subtree preserved verbatim.
|
|
2592
2808
|
*
|
|
@@ -3294,6 +3510,18 @@ interface PptxSmartArtColorTransform extends PptxSmartArtDefinitionMetadata {
|
|
|
3294
3510
|
fillColors: string[];
|
|
3295
3511
|
/** Ordered resolved line colors for rendering. */
|
|
3296
3512
|
lineColors: string[];
|
|
3513
|
+
/** Ordered resolved text-fill colors (primary styleLbl `txFillClrLst`). */
|
|
3514
|
+
textFillColors?: string[];
|
|
3515
|
+
/** Ordered resolved text-line colors (primary styleLbl `txLinClrLst`). */
|
|
3516
|
+
textLineColors?: string[];
|
|
3517
|
+
/** Ordered resolved effect colors (primary styleLbl `effectClrLst`). */
|
|
3518
|
+
effectColors?: string[];
|
|
3519
|
+
/** Ordered resolved text-effect colors (primary styleLbl `txEffectClrLst`). */
|
|
3520
|
+
textEffectColors?: string[];
|
|
3521
|
+
/** Fill-list span/cycle + hue-direction interpolation of the primary styleLbl. */
|
|
3522
|
+
fillInterpolation?: PptxSmartArtColorListMetadata;
|
|
3523
|
+
/** Line-list span/cycle + hue-direction interpolation of the primary styleLbl. */
|
|
3524
|
+
lineInterpolation?: PptxSmartArtColorListMetadata;
|
|
3297
3525
|
/** Ordered CT_CTStyleLabel metadata. */
|
|
3298
3526
|
labels?: PptxSmartArtColorStyleLabel[];
|
|
3299
3527
|
}
|
|
@@ -3414,6 +3642,40 @@ interface PptxSmartArtDrawingShape extends PptxCustomPathProperties {
|
|
|
3414
3642
|
skewY?: number;
|
|
3415
3643
|
/** Solid fill colour (hex). */
|
|
3416
3644
|
fillColor?: string;
|
|
3645
|
+
/**
|
|
3646
|
+
* Gradient fill stops when the cached shape uses `a:gradFill`. Positions are
|
|
3647
|
+
* 0..100 (percent). Renderers emit an SVG/CSS gradient instead of a flat box.
|
|
3648
|
+
*/
|
|
3649
|
+
fillGradientStops?: Array<{
|
|
3650
|
+
color: string;
|
|
3651
|
+
position: number;
|
|
3652
|
+
opacity?: number;
|
|
3653
|
+
}>;
|
|
3654
|
+
/** Gradient geometry type (`linear` for `a:lin`, `radial` for `a:path`). */
|
|
3655
|
+
fillGradientType?: 'linear' | 'radial';
|
|
3656
|
+
/** Linear gradient angle in degrees (0..360). */
|
|
3657
|
+
fillGradientAngle?: number;
|
|
3658
|
+
/** Pattern fill preset name from `a:pattFill/@prst` (e.g. "pct50", "cross"). */
|
|
3659
|
+
fillPatternPreset?: string;
|
|
3660
|
+
/** Pattern fill foreground colour (hex) from `a:pattFill/a:fgClr`. */
|
|
3661
|
+
fillPatternForegroundColor?: string;
|
|
3662
|
+
/** Pattern fill background colour (hex) from `a:pattFill/a:bgClr`. */
|
|
3663
|
+
fillPatternBackgroundColor?: string;
|
|
3664
|
+
/**
|
|
3665
|
+
* Relationship id of a picture (blip) fill's embedded image, from
|
|
3666
|
+
* `a:blipFill/a:blip/@r:embed`. The image bytes are resolved separately; see
|
|
3667
|
+
* {@link fillImageUrl}.
|
|
3668
|
+
*/
|
|
3669
|
+
fillBlipEmbedId?: string;
|
|
3670
|
+
/**
|
|
3671
|
+
* Resolved data-URI/URL for a picture (blip) fill, when the embedded image
|
|
3672
|
+
* part could be resolved. Absent when only {@link fillBlipEmbedId} is known.
|
|
3673
|
+
*/
|
|
3674
|
+
fillImageUrl?: string;
|
|
3675
|
+
/** Whether the cached shape carries an outer-shadow effect (`a:effectLst`). */
|
|
3676
|
+
hasShadow?: boolean;
|
|
3677
|
+
/** Resolved outer-shadow colour (hex), when present. */
|
|
3678
|
+
shadowColor?: string;
|
|
3417
3679
|
/** Stroke colour (hex). */
|
|
3418
3680
|
strokeColor?: string;
|
|
3419
3681
|
/** Stroke width in points. */
|
|
@@ -3448,6 +3710,40 @@ interface PptxSmartArtChrome {
|
|
|
3448
3710
|
/** Outline stroke width in points. */
|
|
3449
3711
|
outlineWidth?: number;
|
|
3450
3712
|
}
|
|
3713
|
+
/**
|
|
3714
|
+
* Presentation layout variables from `dgm:prSet/dgm:presLayoutVars` (data model)
|
|
3715
|
+
* or `dgm:varLst` (layout definition defaults).
|
|
3716
|
+
*
|
|
3717
|
+
* These drive how the DiagramML layout interpreter arranges points: flow
|
|
3718
|
+
* direction, hierarchy branch style, org-chart mode, and child count limits.
|
|
3719
|
+
* The fallback layout engine can consult them for direction/org-chart hints.
|
|
3720
|
+
*
|
|
3721
|
+
* @example
|
|
3722
|
+
* ```ts
|
|
3723
|
+
* const vars: PptxSmartArtPresLayoutVars = { direction: "rev", orgChart: true };
|
|
3724
|
+
* // => satisfies PptxSmartArtPresLayoutVars
|
|
3725
|
+
* ```
|
|
3726
|
+
*/
|
|
3727
|
+
interface PptxSmartArtPresLayoutVars {
|
|
3728
|
+
/** Flow direction (`dgm:dir`): "norm" (default) or "rev" (reversed/RTL). */
|
|
3729
|
+
direction?: 'norm' | 'rev';
|
|
3730
|
+
/** Hierarchy branch style (`dgm:hierBranch`): std/init/l/r/hang. */
|
|
3731
|
+
hierarchyBranch?: 'std' | 'init' | 'l' | 'r' | 'hang';
|
|
3732
|
+
/** Org-chart mode enabled (`dgm:orgChart`). */
|
|
3733
|
+
orgChart?: boolean;
|
|
3734
|
+
/** Maximum children per node (`dgm:chMax`, -1 = unbounded). */
|
|
3735
|
+
childMax?: number;
|
|
3736
|
+
/** Preferred children per node (`dgm:chPref`, -1 = unbounded). */
|
|
3737
|
+
childPreferred?: number;
|
|
3738
|
+
/** Whether bullets are enabled (`dgm:bulletEnabled`). */
|
|
3739
|
+
bulletEnabled?: boolean;
|
|
3740
|
+
/** Animation-by-level setting (`dgm:animLvl`). */
|
|
3741
|
+
animationLevel?: string;
|
|
3742
|
+
/** Animate-one setting (`dgm:animOne`). */
|
|
3743
|
+
animateOne?: string;
|
|
3744
|
+
/** Allowed resize handles (`dgm:resizeHandles`). */
|
|
3745
|
+
resizeHandles?: string;
|
|
3746
|
+
}
|
|
3451
3747
|
/**
|
|
3452
3748
|
* Complete parsed SmartArt data for a {@link SmartArtPptxElement}.
|
|
3453
3749
|
*
|
|
@@ -3489,6 +3785,12 @@ interface PptxSmartArtData {
|
|
|
3489
3785
|
quickStyle?: PptxSmartArtQuickStyle;
|
|
3490
3786
|
/** Editable metadata from the related DiagramML layout definition. */
|
|
3491
3787
|
layoutDefinition?: PptxSmartArtLayoutDefinition;
|
|
3788
|
+
/**
|
|
3789
|
+
* Presentation layout variables (direction, hierarchy branch, org-chart,
|
|
3790
|
+
* child limits, bullets) from `dgm:presLayoutVars` / layout `dgm:varLst`.
|
|
3791
|
+
* Consulted by the fallback layout engine for direction/org-chart hints.
|
|
3792
|
+
*/
|
|
3793
|
+
presLayoutVars?: PptxSmartArtPresLayoutVars;
|
|
3492
3794
|
/** Relationship ID for the diagram data part (for round-trip save). */
|
|
3493
3795
|
dataRelId?: string;
|
|
3494
3796
|
/** Relationship ID for the diagram layout part. */
|
|
@@ -3521,7 +3823,7 @@ interface PptxSmartArtData {
|
|
|
3521
3823
|
/**
|
|
3522
3824
|
* Per-cell visual style for a table cell.
|
|
3523
3825
|
*
|
|
3524
|
-
* All fields are optional
|
|
3826
|
+
* All fields are optional - unset values inherit from the table style.
|
|
3525
3827
|
*
|
|
3526
3828
|
* @example
|
|
3527
3829
|
* ```ts
|
|
@@ -3649,6 +3951,52 @@ interface PptxTableCellStyle {
|
|
|
3649
3951
|
patternFillForeground?: string;
|
|
3650
3952
|
/** Pattern fill background colour. */
|
|
3651
3953
|
patternFillBackground?: string;
|
|
3954
|
+
/**
|
|
3955
|
+
* Cell 3D bevel + lighting from `a:tcPr/a:cell3D` (CT_Cell3D,
|
|
3956
|
+
* ECMA-376 §21.1.3.1). Rendered as a CSS bevel treatment.
|
|
3957
|
+
*/
|
|
3958
|
+
cell3D?: PptxTableCell3D;
|
|
3959
|
+
/**
|
|
3960
|
+
* `a:tcPr/@anchorCtr` - centre the text block in the direction
|
|
3961
|
+
* perpendicular to the text flow (horizontal centring for horizontal text).
|
|
3962
|
+
*/
|
|
3963
|
+
anchorCtr?: boolean;
|
|
3964
|
+
/**
|
|
3965
|
+
* `a:tcPr/@horzOverflow` (ST_TextHorzOverflowType): `clip` clips text at
|
|
3966
|
+
* the cell edge, `overflow` (the default) lets it spill.
|
|
3967
|
+
*/
|
|
3968
|
+
horzOverflow?: 'clip' | 'overflow';
|
|
3969
|
+
}
|
|
3970
|
+
/**
|
|
3971
|
+
* Cell 3D bevel + lighting parsed from `a:tcPr/a:cell3D` (CT_Cell3D).
|
|
3972
|
+
*
|
|
3973
|
+
* Only the fields needed to render a plausible bevel treatment are captured;
|
|
3974
|
+
* verbatim round-trip of the full node is handled separately by the save path.
|
|
3975
|
+
*
|
|
3976
|
+
* @example
|
|
3977
|
+
* ```ts
|
|
3978
|
+
* const c3d: PptxTableCell3D = {
|
|
3979
|
+
* bevelWidth: 8,
|
|
3980
|
+
* bevelHeight: 8,
|
|
3981
|
+
* bevelPreset: 'circle',
|
|
3982
|
+
* material: 'plastic',
|
|
3983
|
+
* };
|
|
3984
|
+
* // => satisfies PptxTableCell3D
|
|
3985
|
+
* ```
|
|
3986
|
+
*/
|
|
3987
|
+
interface PptxTableCell3D {
|
|
3988
|
+
/** Bevel width in px (from `a:bevel@w`, EMU converted). */
|
|
3989
|
+
bevelWidth?: number;
|
|
3990
|
+
/** Bevel height in px (from `a:bevel@h`, EMU converted). */
|
|
3991
|
+
bevelHeight?: number;
|
|
3992
|
+
/** Bevel preset name (`a:bevel@prst`, e.g. `circle`, `relaxedInset`). */
|
|
3993
|
+
bevelPreset?: string;
|
|
3994
|
+
/** Preset material (`a:cell3D@prstMaterial`, e.g. `plastic`, `metal`). */
|
|
3995
|
+
material?: string;
|
|
3996
|
+
/** Light rig type (`a:lightRig@rig`, e.g. `threePt`, `soft`). */
|
|
3997
|
+
lightRig?: string;
|
|
3998
|
+
/** Light rig direction (`a:lightRig@dir`, e.g. `tl`, `t`, `tr`). */
|
|
3999
|
+
lightRigDirection?: string;
|
|
3652
4000
|
}
|
|
3653
4001
|
/**
|
|
3654
4002
|
* A single table cell with text content, optional style, and merge info.
|
|
@@ -3761,12 +4109,50 @@ interface PptxTableData {
|
|
|
3761
4109
|
* ```
|
|
3762
4110
|
*/
|
|
3763
4111
|
interface ParsedTableStyleFill {
|
|
3764
|
-
/**
|
|
4112
|
+
/**
|
|
4113
|
+
* Theme colour key (e.g. `accent1`, `dk1`). Empty string when the fill is a
|
|
4114
|
+
* non-scheme fill (explicit sRGB, gradient, pattern, or none) that carries
|
|
4115
|
+
* no theme colour reference; the renderer then resolves {@link color},
|
|
4116
|
+
* {@link gradient}, {@link pattern}, or {@link noFill} instead.
|
|
4117
|
+
*/
|
|
3765
4118
|
schemeColor: string;
|
|
3766
4119
|
/** Tint value (0-100 000). */
|
|
3767
4120
|
tint?: number;
|
|
3768
4121
|
/** Shade value (0-100 000). */
|
|
3769
4122
|
shade?: number;
|
|
4123
|
+
/** Explicit sRGB hex colour (e.g. `#FF8800`) from `a:srgbClr`. */
|
|
4124
|
+
color?: string;
|
|
4125
|
+
/** The fill was `a:noFill`: renders transparent and clears lower layers. */
|
|
4126
|
+
noFill?: boolean;
|
|
4127
|
+
/** Gradient fill parsed from `a:gradFill`. */
|
|
4128
|
+
gradient?: ParsedTableStyleGradient;
|
|
4129
|
+
/** Preset pattern fill parsed from `a:pattFill`. */
|
|
4130
|
+
pattern?: ParsedTableStylePattern;
|
|
4131
|
+
}
|
|
4132
|
+
/** A single colour stop within a {@link ParsedTableStyleGradient}. */
|
|
4133
|
+
interface ParsedTableStyleGradientStop {
|
|
4134
|
+
/** Stop position as a percentage (0-100). */
|
|
4135
|
+
position: number;
|
|
4136
|
+
/** Stop colour (scheme or explicit sRGB). */
|
|
4137
|
+
fill: ParsedTableStyleFill;
|
|
4138
|
+
}
|
|
4139
|
+
/** A gradient fill parsed from a table style section's `a:gradFill`. */
|
|
4140
|
+
interface ParsedTableStyleGradient {
|
|
4141
|
+
/** Ordered colour stops. */
|
|
4142
|
+
stops: ParsedTableStyleGradientStop[];
|
|
4143
|
+
/** Linear gradient angle in degrees (from `a:lin@ang`, 60000ths -> deg). */
|
|
4144
|
+
angle?: number;
|
|
4145
|
+
/** Gradient family: linear (`a:lin`) or radial (`a:path`). */
|
|
4146
|
+
type: 'linear' | 'radial';
|
|
4147
|
+
}
|
|
4148
|
+
/** A preset pattern fill parsed from a table style section's `a:pattFill`. */
|
|
4149
|
+
interface ParsedTableStylePattern {
|
|
4150
|
+
/** OOXML preset name (e.g. `ltDnDiag`) from `a:pattFill@prst`. */
|
|
4151
|
+
preset: string;
|
|
4152
|
+
/** Foreground colour (`a:fgClr`). */
|
|
4153
|
+
foreground?: ParsedTableStyleFill;
|
|
4154
|
+
/** Background colour (`a:bgClr`). */
|
|
4155
|
+
background?: ParsedTableStyleFill;
|
|
3770
4156
|
}
|
|
3771
4157
|
/**
|
|
3772
4158
|
* A single entry in the parsed table style map.
|
|
@@ -3793,12 +4179,67 @@ interface ParsedTableStyleText {
|
|
|
3793
4179
|
bold?: boolean;
|
|
3794
4180
|
/** Font italic. */
|
|
3795
4181
|
italic?: boolean;
|
|
4182
|
+
/** Font underline (from `a:tcTxStyle@u`, any value other than `none`). */
|
|
4183
|
+
underline?: boolean;
|
|
3796
4184
|
/** Font colour as theme scheme key. */
|
|
3797
4185
|
fontSchemeColor?: string;
|
|
3798
4186
|
/** Font colour tint (0-100 000). */
|
|
3799
4187
|
fontTint?: number;
|
|
3800
4188
|
/** Font colour shade (0-100 000). */
|
|
3801
4189
|
fontShade?: number;
|
|
4190
|
+
/** Explicit sRGB hex font colour (e.g. `#FF0000`) from `a:srgbClr`. */
|
|
4191
|
+
fontColor?: string;
|
|
4192
|
+
/** Typeface from `a:font@typeface` (latin font). */
|
|
4193
|
+
fontFace?: string;
|
|
4194
|
+
/** Font-collection index from `a:fontRef@idx` (`minor`, `major`, `none`). */
|
|
4195
|
+
fontRefIdx?: string;
|
|
4196
|
+
}
|
|
4197
|
+
/**
|
|
4198
|
+
* A single border side within a table style's `a:tcStyle/a:tcBdr`.
|
|
4199
|
+
*
|
|
4200
|
+
* Corresponds to one of `a:left`, `a:right`, `a:top`, `a:bottom`,
|
|
4201
|
+
* `a:insideH`, `a:insideV`, `a:tl2br`, `a:bl2tr` (each a
|
|
4202
|
+
* `CT_ThemeableLineStyle` wrapping an `a:ln`).
|
|
4203
|
+
*
|
|
4204
|
+
* @example
|
|
4205
|
+
* ```ts
|
|
4206
|
+
* const side: ParsedTableStyleBorder = {
|
|
4207
|
+
* width: 1,
|
|
4208
|
+
* dash: 'solid',
|
|
4209
|
+
* fill: { schemeColor: 'lt1' },
|
|
4210
|
+
* };
|
|
4211
|
+
* // => satisfies ParsedTableStyleBorder
|
|
4212
|
+
* ```
|
|
4213
|
+
*/
|
|
4214
|
+
interface ParsedTableStyleBorder {
|
|
4215
|
+
/** Line width in px (converted from the `a:ln@w` EMU value). */
|
|
4216
|
+
width?: number;
|
|
4217
|
+
/** OOXML `a:prstDash@val` (e.g. `solid`, `dash`, `sysDot`). */
|
|
4218
|
+
dash?: string;
|
|
4219
|
+
/** Border colour as a theme scheme fill (from `a:ln/a:solidFill/a:schemeClr`). */
|
|
4220
|
+
fill?: ParsedTableStyleFill;
|
|
4221
|
+
/** Explicit hex colour when the line used `a:srgbClr` (e.g. `#808080`). */
|
|
4222
|
+
color?: string;
|
|
4223
|
+
/** The line was `a:noFill` - an explicit "no border" that clears lower layers. */
|
|
4224
|
+
noFill?: boolean;
|
|
4225
|
+
}
|
|
4226
|
+
/**
|
|
4227
|
+
* The set of border sides parsed from a table style section's
|
|
4228
|
+
* `a:tcStyle/a:tcBdr` element.
|
|
4229
|
+
*/
|
|
4230
|
+
interface ParsedTableStyleBorders {
|
|
4231
|
+
left?: ParsedTableStyleBorder;
|
|
4232
|
+
right?: ParsedTableStyleBorder;
|
|
4233
|
+
top?: ParsedTableStyleBorder;
|
|
4234
|
+
bottom?: ParsedTableStyleBorder;
|
|
4235
|
+
/** Interior horizontal borders between rows in the region. */
|
|
4236
|
+
insideH?: ParsedTableStyleBorder;
|
|
4237
|
+
/** Interior vertical borders between columns in the region. */
|
|
4238
|
+
insideV?: ParsedTableStyleBorder;
|
|
4239
|
+
/** Top-left to bottom-right diagonal. */
|
|
4240
|
+
tl2br?: ParsedTableStyleBorder;
|
|
4241
|
+
/** Bottom-left to top-right diagonal. */
|
|
4242
|
+
bl2tr?: ParsedTableStyleBorder;
|
|
3802
4243
|
}
|
|
3803
4244
|
/**
|
|
3804
4245
|
* Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
|
|
@@ -3834,6 +4275,24 @@ interface ParsedTableStyleEntry {
|
|
|
3834
4275
|
swCellFill?: ParsedTableStyleFill;
|
|
3835
4276
|
neCellFill?: ParsedTableStyleFill;
|
|
3836
4277
|
nwCellFill?: ParsedTableStyleFill;
|
|
4278
|
+
/**
|
|
4279
|
+
* Per-role border styling from `a:tcStyle/a:tcBdr`. These supply the
|
|
4280
|
+
* gridlines/edges a styled table inherits from its table style when the
|
|
4281
|
+
* cells carry no explicit per-cell `a:lnX` overrides.
|
|
4282
|
+
*/
|
|
4283
|
+
wholeTblBorders?: ParsedTableStyleBorders;
|
|
4284
|
+
firstRowBorders?: ParsedTableStyleBorders;
|
|
4285
|
+
lastRowBorders?: ParsedTableStyleBorders;
|
|
4286
|
+
firstColBorders?: ParsedTableStyleBorders;
|
|
4287
|
+
lastColBorders?: ParsedTableStyleBorders;
|
|
4288
|
+
band1HBorders?: ParsedTableStyleBorders;
|
|
4289
|
+
band2HBorders?: ParsedTableStyleBorders;
|
|
4290
|
+
band1VBorders?: ParsedTableStyleBorders;
|
|
4291
|
+
band2VBorders?: ParsedTableStyleBorders;
|
|
4292
|
+
seCellBorders?: ParsedTableStyleBorders;
|
|
4293
|
+
swCellBorders?: ParsedTableStyleBorders;
|
|
4294
|
+
neCellBorders?: ParsedTableStyleBorders;
|
|
4295
|
+
nwCellBorders?: ParsedTableStyleBorders;
|
|
3837
4296
|
/** Per-role text styling from a:tcTxStyle. */
|
|
3838
4297
|
wholeTblText?: ParsedTableStyleText;
|
|
3839
4298
|
firstRowText?: ParsedTableStyleText;
|
|
@@ -4399,6 +4858,16 @@ interface PptxHandoutMaster {
|
|
|
4399
4858
|
/** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
|
|
4400
4859
|
clrMap?: Record<string, string>;
|
|
4401
4860
|
}
|
|
4861
|
+
/**
|
|
4862
|
+
* Active tab within the master view sidebar.
|
|
4863
|
+
*
|
|
4864
|
+
* @example
|
|
4865
|
+
* ```ts
|
|
4866
|
+
* const tab: MasterViewTab = "slides";
|
|
4867
|
+
* // => "slides" — one of: "slides" | "notes" | "handout"
|
|
4868
|
+
* ```
|
|
4869
|
+
*/
|
|
4870
|
+
type MasterViewTab = 'slides' | 'notes' | 'handout';
|
|
4402
4871
|
/**
|
|
4403
4872
|
* Structured slide master data.
|
|
4404
4873
|
*
|
|
@@ -4631,10 +5100,30 @@ interface PptxNativeAnimation {
|
|
|
4631
5100
|
presetClass?: 'entr' | 'exit' | 'emph' | 'path';
|
|
4632
5101
|
/** Effect preset sub-type identifier. */
|
|
4633
5102
|
presetId?: number;
|
|
5103
|
+
/**
|
|
5104
|
+
* Effect preset direction/variant code from `p:cTn/@presetSubtype`
|
|
5105
|
+
* (ECMA-376 CT_TLCommonTimeNodeData). For Fly In/Out this encodes the
|
|
5106
|
+
* edge/corner the object travels from as a bitmask (1=top, 2=right,
|
|
5107
|
+
* 4=bottom, 8=left; corners combine bits). Absent means the preset default.
|
|
5108
|
+
*/
|
|
5109
|
+
presetSubtype?: number;
|
|
4634
5110
|
/** Duration in milliseconds. */
|
|
4635
5111
|
durationMs?: number;
|
|
4636
5112
|
/** Delay in milliseconds. */
|
|
4637
5113
|
delayMs?: number;
|
|
5114
|
+
/**
|
|
5115
|
+
* Acceleration fraction in the range 0..1, parsed from `p:cTn/@accel`
|
|
5116
|
+
* (ST_PositiveFixedPercentage, stored as 1000ths of a percent). A non-zero
|
|
5117
|
+
* value means the effect eases in (starts slow). Absent means no easing-in.
|
|
5118
|
+
*/
|
|
5119
|
+
accel?: number;
|
|
5120
|
+
/**
|
|
5121
|
+
* Deceleration fraction in the range 0..1, parsed from `p:cTn/@decel`.
|
|
5122
|
+
* A non-zero value means the effect eases out (ends slow). Absent means no
|
|
5123
|
+
* easing-out. When both {@link accel} and {@link decel} are set, the effect
|
|
5124
|
+
* eases in and out.
|
|
5125
|
+
*/
|
|
5126
|
+
decel?: number;
|
|
4638
5127
|
/** Trigger delay in milliseconds (for afterDelay). */
|
|
4639
5128
|
triggerDelayMs?: number;
|
|
4640
5129
|
/** SVG path string for motion path animations (`p:animMotion/@path`). */
|
|
@@ -4727,6 +5216,14 @@ interface PptxNativeAnimation {
|
|
|
4727
5216
|
* that aren't OLE charts).
|
|
4728
5217
|
*/
|
|
4729
5218
|
graphicBuild?: string;
|
|
5219
|
+
/**
|
|
5220
|
+
* OLE-embedded chart build attribute (`p:bldOleChart/@bld`) when this
|
|
5221
|
+
* animation stages an OLE chart graphic frame. Values follow
|
|
5222
|
+
* ST_TLOleChartBuildType: `allAtOnce`, `series`, `category`, `seriesEl`,
|
|
5223
|
+
* `categoryEl`. Lets a staged-reveal renderer build the chart by series /
|
|
5224
|
+
* category / element to match PowerPoint, rather than as one whole element.
|
|
5225
|
+
*/
|
|
5226
|
+
oleChartBuild?: string;
|
|
4730
5227
|
/** Schema-accurate `p:bldGraphic/p:bldAsOne|p:bldSub` representation. */
|
|
4731
5228
|
graphicBuildProperties?: PptxGraphicBuild;
|
|
4732
5229
|
/**
|
|
@@ -5216,6 +5713,18 @@ interface PptxAppProperties {
|
|
|
5216
5713
|
template?: string;
|
|
5217
5714
|
/** Hyperlink base URL. */
|
|
5218
5715
|
hyperlinkBase?: string;
|
|
5716
|
+
/** Document security bitmask (`<DocSecurity>`). */
|
|
5717
|
+
docSecurity?: number;
|
|
5718
|
+
/** Number of multimedia clips (`<MMClips>`). */
|
|
5719
|
+
mmClips?: number;
|
|
5720
|
+
/** Whether thumbnail images were scaled to fit (`<ScaleCrop>`). */
|
|
5721
|
+
scaleCrop?: boolean;
|
|
5722
|
+
/** Whether hyperlinks are current (`<LinksUpToDate>`). */
|
|
5723
|
+
linksUpToDate?: boolean;
|
|
5724
|
+
/** Whether the document is shared (`<SharedDoc>`). */
|
|
5725
|
+
sharedDoc?: boolean;
|
|
5726
|
+
/** Whether hyperlinks changed since last save (`<HyperlinksChanged>`). */
|
|
5727
|
+
hyperlinksChanged?: boolean;
|
|
5219
5728
|
}
|
|
5220
5729
|
//#endregion
|
|
5221
5730
|
//#region src/core/types/presentation-print-properties.d.ts
|
|
@@ -5506,7 +6015,7 @@ interface PptxTheme {
|
|
|
5506
6015
|
* // => "morph" — one of 40+ transition effects
|
|
5507
6016
|
* ```
|
|
5508
6017
|
*/
|
|
5509
|
-
type PptxTransitionType = 'none' | 'cut' | 'fade' | 'push' | 'wipe' | 'split' | 'randomBar' | 'blinds' | 'checker' | 'circle' | 'comb' | 'cover' | 'diamond' | 'dissolve' | 'plus' | 'pull' | 'random' | 'strips' | 'uncover' | 'wedge' | 'wheel' | 'zoom' | 'newsflash' | 'morph' | 'conveyor' | 'doors' | 'ferris' | 'flash' | 'flythrough' | 'gallery' | 'glitter' | 'honeycomb' | 'pan' | 'prism' | 'reveal' | 'ripple' | 'shred' | 'switch' | 'vortex' | 'warp' | 'wheelReverse' | 'window' | 'cube' | 'flip' | 'rotate' | 'orbit';
|
|
6018
|
+
type PptxTransitionType = 'none' | 'cut' | 'fade' | 'push' | 'wipe' | 'split' | 'randomBar' | 'blinds' | 'checker' | 'circle' | 'comb' | 'cover' | 'diamond' | 'dissolve' | 'plus' | 'pull' | 'random' | 'strips' | 'uncover' | 'wedge' | 'wheel' | 'zoom' | 'newsflash' | 'morph' | 'conveyor' | 'doors' | 'ferris' | 'flash' | 'flythrough' | 'gallery' | 'glitter' | 'honeycomb' | 'pan' | 'prism' | 'reveal' | 'ripple' | 'shred' | 'switch' | 'vortex' | 'warp' | 'wheelReverse' | 'window' | 'cube' | 'flip' | 'rotate' | 'orbit' | 'fallOver' | 'drape' | 'curtains' | 'wind' | 'prestige' | 'fracture' | 'crush' | 'peelOff' | 'pageCurlDouble' | 'pageCurlSingle' | 'airplane' | 'origami';
|
|
5510
6019
|
/** Split orientation from OOXML `@_orient`. */
|
|
5511
6020
|
type PptxSplitOrientation = 'horz' | 'vert';
|
|
5512
6021
|
/** Schema-defined `ST_TransitionSpeed` values. */
|
|
@@ -5720,6 +6229,21 @@ interface PptxActiveXControl {
|
|
|
5720
6229
|
name?: string;
|
|
5721
6230
|
/** Shape ID this control is linked to (from @spid). */
|
|
5722
6231
|
shapeId?: string;
|
|
6232
|
+
/** X position (px) of the control's fallback picture, if present. */
|
|
6233
|
+
x?: number;
|
|
6234
|
+
/** Y position (px) of the control's fallback picture, if present. */
|
|
6235
|
+
y?: number;
|
|
6236
|
+
/** Width (px) of the control's fallback picture, if present. */
|
|
6237
|
+
width?: number;
|
|
6238
|
+
/** Height (px) of the control's fallback picture, if present. */
|
|
6239
|
+
height?: number;
|
|
6240
|
+
/**
|
|
6241
|
+
* Relationship ID of the control's static fallback picture
|
|
6242
|
+
* (`mc:AlternateContent > mc:Fallback > p:pic > p:blipFill > a:blip@r:embed`).
|
|
6243
|
+
* Renderers resolve this to an image so a control shows its last static
|
|
6244
|
+
* frame instead of a blank area (the live ActiveX cannot run in a viewer).
|
|
6245
|
+
*/
|
|
6246
|
+
fallbackImageRelId?: string;
|
|
5723
6247
|
/** Raw XML for round-trip preservation. */
|
|
5724
6248
|
rawXml?: XmlObject;
|
|
5725
6249
|
}
|
|
@@ -5846,6 +6370,13 @@ interface PptxSlide {
|
|
|
5846
6370
|
customerData?: PptxCustomerData[];
|
|
5847
6371
|
/** ActiveX control references from `p:controls` on this slide. */
|
|
5848
6372
|
activeXControls?: PptxActiveXControl[];
|
|
6373
|
+
/**
|
|
6374
|
+
* Shapes parsed from a referenced legacy VML drawing part
|
|
6375
|
+
* (`ppt/drawings/vmlDrawing*.vml`, linked via a `legacyDrawing`
|
|
6376
|
+
* relationship). These are read-only render hints: the VML part itself is
|
|
6377
|
+
* preserved verbatim on save, so this field is not re-serialized.
|
|
6378
|
+
*/
|
|
6379
|
+
legacyVmlElements?: PptxElement[];
|
|
5849
6380
|
/** Per-slide header/footer flags from `<p:hf>` (P-H3). */
|
|
5850
6381
|
headerFooterFlags?: PptxHeaderFooterFlags;
|
|
5851
6382
|
/** Server-backed slide synchronization metadata stored in a related OPC part. */
|
|
@@ -5954,12 +6485,6 @@ interface PptxPresentationProperties {
|
|
|
5954
6485
|
showSubtitles?: boolean;
|
|
5955
6486
|
/** Typed `p:prnPr` settings. Set to null during save to remove the element. */
|
|
5956
6487
|
printProperties?: PptxPresentationPrintProperties | null;
|
|
5957
|
-
/** @deprecated Use `printProperties.printWhat`; retained as a handout compatibility alias. */
|
|
5958
|
-
printSlidesPerPage?: number;
|
|
5959
|
-
/** @deprecated Use `printProperties.frameSlides`. */
|
|
5960
|
-
printFrameSlides?: boolean;
|
|
5961
|
-
/** @deprecated Use `printProperties.colorMode`. */
|
|
5962
|
-
printColorMode?: 'clr' | 'gray' | 'bw';
|
|
5963
6488
|
/** Most-recently-used colours from the presentation palette. */
|
|
5964
6489
|
mruColors?: string[];
|
|
5965
6490
|
/** Grid spacing in EMUs (cx, cy). Default is 914400 / 8 = 114300. */
|
|
@@ -7911,6 +8436,291 @@ interface CollaborationConfig {
|
|
|
7911
8436
|
*/
|
|
7912
8437
|
writeBackDebounceMs?: number;
|
|
7913
8438
|
}
|
|
8439
|
+
//#endregion
|
|
8440
|
+
//#region src/render/animation-authoring.d.ts
|
|
8441
|
+
/** One of the three animation buckets a preset can occupy on an element. */
|
|
8442
|
+
type AnimationGroup = 'entrance' | 'emphasis' | 'exit';
|
|
8443
|
+
/**
|
|
8444
|
+
* Normalized staged-reveal mode for a chart graphic frame, derived from the
|
|
8445
|
+
* OOXML `a:bldChart/@bld` (or `p:bldOleChart/@bld`) token:
|
|
8446
|
+
* - `asOne` the whole chart appears at once (`allAtOnce`).
|
|
8447
|
+
* - `bySeries` one data series is revealed per stage (`series`).
|
|
8448
|
+
* - `byCategory` one category is revealed per stage (`category`).
|
|
8449
|
+
* - `byElement` one series/category ELEMENT is revealed per stage
|
|
8450
|
+
* (`seriesElement` / `categoryElement`).
|
|
8451
|
+
*/
|
|
8452
|
+
type ChartBuildMode = 'asOne' | 'bySeries' | 'byCategory' | 'byElement';
|
|
8453
|
+
/**
|
|
8454
|
+
* Normalized staged-reveal mode for a SmartArt diagram, derived from the OOXML
|
|
8455
|
+
* `a:bldDgm/@bld` or `p:bldDgm/@bld` token:
|
|
8456
|
+
* - `asOne` the whole diagram appears at once (`whole` / `allAtOnce`).
|
|
8457
|
+
* - `byOne` one node is revealed per stage (`one`, and the assorted
|
|
8458
|
+
* `depthBy*` / `breadthBy*` / directional traversals).
|
|
8459
|
+
* - `byLvl` levels are revealed one element at a time (`lvlOne`).
|
|
8460
|
+
* - `byLvlAtOnce` a whole level is revealed per stage (`lvlAtOnce`).
|
|
8461
|
+
*/
|
|
8462
|
+
type DiagramBuildMode = 'asOne' | 'byOne' | 'byLvl' | 'byLvlAtOnce';
|
|
8463
|
+
/**
|
|
8464
|
+
* Playback-time staged-build state surfaced on {@link ElementAnimationState}.
|
|
8465
|
+
* `progress` is the 0..1 fraction of the build revealed at the current playback
|
|
8466
|
+
* time; a consumer maps it to its own item COUNT (see `revealedStageCount`).
|
|
8467
|
+
*/
|
|
8468
|
+
type ElementBuildState = {
|
|
8469
|
+
kind: 'chart';
|
|
8470
|
+
mode: ChartBuildMode;
|
|
8471
|
+
progress: number;
|
|
8472
|
+
} | {
|
|
8473
|
+
kind: 'diagram';
|
|
8474
|
+
mode: DiagramBuildMode;
|
|
8475
|
+
progress: number;
|
|
8476
|
+
};
|
|
8477
|
+
/** Snapshot of a single element's animation state at a point in the timeline. */
|
|
8478
|
+
interface ElementAnimationState {
|
|
8479
|
+
/** Whether the element should be visible. */
|
|
8480
|
+
visible: boolean;
|
|
8481
|
+
/** CSS animation shorthand to apply (undefined = no active animation). */
|
|
8482
|
+
cssAnimation: string | undefined;
|
|
8483
|
+
/**
|
|
8484
|
+
* Staged-build reveal state, present only when the active animation builds a
|
|
8485
|
+
* chart or SmartArt diagram in stages (`p:bldChart` / `p:bldDgm`) rather than
|
|
8486
|
+
* revealing the whole element at once. A staged renderer multiplies
|
|
8487
|
+
* `build.progress` (0..1) by its own series / category / level COUNT to
|
|
8488
|
+
* decide how many stages are revealed at the current playback time; see
|
|
8489
|
+
* {@link import('./animation-build').revealedStageCount}. Absent for ordinary
|
|
8490
|
+
* whole-element entrances, so existing renderers are unaffected.
|
|
8491
|
+
*/
|
|
8492
|
+
build?: ElementBuildState;
|
|
8493
|
+
/**
|
|
8494
|
+
* True when an active `p:animClr` color animation targets this shape's fill.
|
|
8495
|
+
* A vector renderer should then paint the fill with `fill: inherit` so the
|
|
8496
|
+
* wrapper-level colour keyframes cascade to the SVG path. Absent/false means
|
|
8497
|
+
* no active fill-colour animation.
|
|
8498
|
+
*/
|
|
8499
|
+
animatesFill?: boolean;
|
|
8500
|
+
/**
|
|
8501
|
+
* True when an active `p:animClr` color animation targets this shape's
|
|
8502
|
+
* stroke. A vector renderer should then paint the stroke with
|
|
8503
|
+
* `stroke: inherit`. Absent/false means no active stroke-colour animation.
|
|
8504
|
+
*/
|
|
8505
|
+
animatesStroke?: boolean;
|
|
8506
|
+
}
|
|
8507
|
+
//#endregion
|
|
8508
|
+
//#region src/render/element-align.d.ts
|
|
8509
|
+
/**
|
|
8510
|
+
* Pure geometry helpers for the align / distribute editor operations.
|
|
8511
|
+
*
|
|
8512
|
+
* These functions operate over a list of slide elements (anything carrying the
|
|
8513
|
+
* `{ id, x, y, width, height }` bounding-box fields of {@link PptxElement}) and
|
|
8514
|
+
* return a `Map` keyed by element `id` describing the *new* position(s) for the
|
|
8515
|
+
* elements that need to move. Elements that already sit on the target edge (or
|
|
8516
|
+
* the two outer-most elements during distribution) are still included with
|
|
8517
|
+
* their unchanged coordinate so callers can apply the whole map uniformly — the
|
|
8518
|
+
* map only ever contains the axis that the operation touches.
|
|
8519
|
+
*
|
|
8520
|
+
* The helpers are deliberately framework-agnostic: no DOM, no Vue reactivity,
|
|
8521
|
+
* no side effects. The host wires them into the editor by feeding the current
|
|
8522
|
+
* selection in and applying the returned `Map` via its element-transform
|
|
8523
|
+
* operation (one batched history entry per call).
|
|
8524
|
+
*/
|
|
8525
|
+
/** Edge / centre that {@link alignElements} can snap a selection to. */
|
|
8526
|
+
type AlignEdge = 'left' | 'centerH' | 'right' | 'top' | 'middle' | 'bottom';
|
|
8527
|
+
/** Axis along which {@link distributeElements} evenly spaces a selection. */
|
|
8528
|
+
type DistributeAxis = 'horizontal' | 'vertical';
|
|
8529
|
+
/** The eight resize handles, named by compass direction. */
|
|
8530
|
+
type ResizeHandleId = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w';
|
|
8531
|
+
/** A marquee drag described by its start and current corner (any order). */
|
|
8532
|
+
interface MarqueeRect {
|
|
8533
|
+
startX: number;
|
|
8534
|
+
startY: number;
|
|
8535
|
+
currentX: number;
|
|
8536
|
+
currentY: number;
|
|
8537
|
+
}
|
|
8538
|
+
/** Minimum section metadata needed to build sidebar groups. */
|
|
8539
|
+
interface SectionGroupDescriptor {
|
|
8540
|
+
id: string;
|
|
8541
|
+
name: string;
|
|
8542
|
+
collapsed?: boolean;
|
|
8543
|
+
color?: string;
|
|
8544
|
+
}
|
|
8545
|
+
/** A declared section paired with its slides, or the trailing ungrouped slides. */
|
|
8546
|
+
interface SectionSlideGroup<TSection extends SectionGroupDescriptor = PptxSection> {
|
|
8547
|
+
section: TSection | undefined;
|
|
8548
|
+
slides: PptxSlide[];
|
|
8549
|
+
slideIndexes: number[];
|
|
8550
|
+
}
|
|
8551
|
+
/** A snap alignment line: `axis: 'v'` is a vertical line at x=`position`. */
|
|
8552
|
+
interface SnapLine {
|
|
8553
|
+
axis: 'h' | 'v';
|
|
8554
|
+
position: number;
|
|
8555
|
+
}
|
|
8556
|
+
//#endregion
|
|
8557
|
+
//#region src/render/collaboration-presence.d.ts
|
|
8558
|
+
/** Connection lifecycle states for the Yjs WebSocket provider. */
|
|
8559
|
+
type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
8560
|
+
/** A single remote collaborator's cursor, in unscaled slide coordinates. */
|
|
8561
|
+
interface RemoteCursor {
|
|
8562
|
+
/** Stable id for the remote client (awareness clientId or peer id). */
|
|
8563
|
+
clientId: number | string;
|
|
8564
|
+
/** Display name shown in the label chip. */
|
|
8565
|
+
userName: string;
|
|
8566
|
+
/** Cursor + chip colour (any CSS colour string). */
|
|
8567
|
+
color: string;
|
|
8568
|
+
/** Unscaled slide-space X coordinate (px). */
|
|
8569
|
+
x: number;
|
|
8570
|
+
/** Unscaled slide-space Y coordinate (px). */
|
|
8571
|
+
y: number;
|
|
8572
|
+
/** Optional ids of elements this user has selected. */
|
|
8573
|
+
selectionIds?: string[];
|
|
8574
|
+
}
|
|
8575
|
+
/**
|
|
8576
|
+
* Presence data for a remote collaborator, sanitised from the awareness
|
|
8577
|
+
* protocol. Returned by {@link sanitizePresence}; coordinates are in unscaled
|
|
8578
|
+
* slide pixels, clamped to the supplied canvas bounds.
|
|
8579
|
+
*/
|
|
8580
|
+
interface SanitizedPresence {
|
|
8581
|
+
clientId: number;
|
|
8582
|
+
userName: string;
|
|
8583
|
+
userAvatar?: string;
|
|
8584
|
+
userColor: string;
|
|
8585
|
+
activeSlideIndex: number;
|
|
8586
|
+
cursorX: number;
|
|
8587
|
+
cursorY: number;
|
|
8588
|
+
lastUpdated: string;
|
|
8589
|
+
selectedElementId?: string;
|
|
8590
|
+
role?: CollaborationRole;
|
|
8591
|
+
}
|
|
8592
|
+
//#endregion
|
|
8593
|
+
//#region src/render/collaboration-presence-publisher.d.ts
|
|
8594
|
+
/**
|
|
8595
|
+
* Structural interface for the lazily-imported Yjs awareness surface. Every
|
|
8596
|
+
* binding's live `y-protocols/awareness` `Awareness` instance satisfies this.
|
|
8597
|
+
*/
|
|
8598
|
+
interface AwarenessLike {
|
|
8599
|
+
clientID?: number;
|
|
8600
|
+
setLocalStateField: (field: string, value: unknown) => void;
|
|
8601
|
+
getStates: () => Map<number, Record<string, unknown>>;
|
|
8602
|
+
on: (event: string, cb: () => void) => void;
|
|
8603
|
+
off?: (event: string, cb: () => void) => void;
|
|
8604
|
+
}
|
|
8605
|
+
//#endregion
|
|
8606
|
+
//#region src/render/collaboration-text-codec.d.ts
|
|
8607
|
+
/**
|
|
8608
|
+
* collaboration-text-codec.ts: TextSegment[] <-> Y.Text delta codec used by the
|
|
8609
|
+
* collaboration sync layer. Split out of collaboration-sync.ts to keep both
|
|
8610
|
+
* modules focused.
|
|
8611
|
+
*
|
|
8612
|
+
* Exports:
|
|
8613
|
+
* - DeltaOp / YTextLike: structural Yjs text interfaces (no yjs import)
|
|
8614
|
+
* - encodeTextBody: write TextSegment[] into a live YTextLike
|
|
8615
|
+
* - encodeSegmentsToDelta: pure simulation of the delta Y.Text would produce
|
|
8616
|
+
* - decodeDelta / decodeTextBody: delta -> TextSegment[]
|
|
8617
|
+
* - isYTextLike: runtime guard
|
|
8618
|
+
*/
|
|
8619
|
+
interface DeltaOp {
|
|
8620
|
+
insert?: unknown;
|
|
8621
|
+
attributes?: Record<string, unknown>;
|
|
8622
|
+
}
|
|
8623
|
+
interface YTextLike {
|
|
8624
|
+
insert: (index: number, text: string, attrs?: Record<string, string>) => void;
|
|
8625
|
+
toDelta: () => DeltaOp[];
|
|
8626
|
+
toString: () => string;
|
|
8627
|
+
}
|
|
8628
|
+
//#endregion
|
|
8629
|
+
//#region src/render/collaboration-sync.d.ts
|
|
8630
|
+
interface YMapLike {
|
|
8631
|
+
get: (key: string) => unknown;
|
|
8632
|
+
set: (key: string, value: unknown) => void;
|
|
8633
|
+
delete: (key: string) => void;
|
|
8634
|
+
forEach: (cb: (value: unknown, key: string) => void) => void;
|
|
8635
|
+
}
|
|
8636
|
+
/** Shape of the Yjs transaction passed to (deep) observers. */
|
|
8637
|
+
interface YTransactionLike {
|
|
8638
|
+
origin?: unknown;
|
|
8639
|
+
}
|
|
8640
|
+
type YDeepObserver = (events?: unknown, transaction?: YTransactionLike) => void;
|
|
8641
|
+
interface YArrayLike {
|
|
8642
|
+
readonly length: number;
|
|
8643
|
+
get: (index: number) => unknown;
|
|
8644
|
+
push: (items: unknown[]) => void;
|
|
8645
|
+
delete: (index: number, length?: number) => void;
|
|
8646
|
+
insert: (index: number, items: unknown[]) => void;
|
|
8647
|
+
toArray: () => unknown[];
|
|
8648
|
+
observe: (handler: () => void) => void;
|
|
8649
|
+
unobserve: (handler: () => void) => void;
|
|
8650
|
+
observeDeep: (handler: YDeepObserver) => void;
|
|
8651
|
+
unobserveDeep: (handler: YDeepObserver) => void;
|
|
8652
|
+
}
|
|
8653
|
+
interface YDocLike {
|
|
8654
|
+
getMap: (name: string) => YMapLike;
|
|
8655
|
+
getArray: (name: string) => YArrayLike;
|
|
8656
|
+
transact: (fn: () => void, origin?: unknown) => void;
|
|
8657
|
+
}
|
|
8658
|
+
interface YjsFactories {
|
|
8659
|
+
createMap: () => YMapLike;
|
|
8660
|
+
createArray: () => YArrayLike;
|
|
8661
|
+
createText: () => YTextLike;
|
|
8662
|
+
}
|
|
8663
|
+
//#endregion
|
|
8664
|
+
//#region src/render/collaboration-live-patch-target.d.ts
|
|
8665
|
+
/** Interim geometry for an element mid-gesture. All fields optional. */
|
|
8666
|
+
interface LiveGeometryPatch {
|
|
8667
|
+
x?: number;
|
|
8668
|
+
y?: number;
|
|
8669
|
+
width?: number;
|
|
8670
|
+
height?: number;
|
|
8671
|
+
rotation?: number;
|
|
8672
|
+
}
|
|
8673
|
+
/** The element's pre-edit rich text, used to remap the interim plain text. */
|
|
8674
|
+
interface LiveTextSource {
|
|
8675
|
+
textSegments?: TextSegment[];
|
|
8676
|
+
textStyle?: TextStyle;
|
|
8677
|
+
}
|
|
8678
|
+
interface CollaborationLivePatcher {
|
|
8679
|
+
/** Attach a live doc (or `null` to go dormant). Pending patches are dropped. */
|
|
8680
|
+
configure: (doc: YDocLike | null, factories: YjsFactories | null) => void;
|
|
8681
|
+
/** True when a doc + factories are attached, i.e. patches will be written. */
|
|
8682
|
+
isActive: () => boolean;
|
|
8683
|
+
/** Queue interim geometry for an element. */
|
|
8684
|
+
patchGeometry: (slideId: string | undefined, elementId: string, geometry: LiveGeometryPatch) => void;
|
|
8685
|
+
/** Queue interim text for an element (remapped over `source`'s segments). */
|
|
8686
|
+
patchText: (slideId: string | undefined, elementId: string, text: string, source?: LiveTextSource) => void;
|
|
8687
|
+
/** Write everything queued right now (call on gesture end / edit commit). */
|
|
8688
|
+
flush: () => void;
|
|
8689
|
+
/** Drop pending work, cancel timers and detach the doc. */
|
|
8690
|
+
dispose: () => void;
|
|
8691
|
+
}
|
|
8692
|
+
//#endregion
|
|
8693
|
+
//#region src/render/slide-compare.d.ts
|
|
8694
|
+
type SlideDiffStatus = 'added' | 'removed' | 'changed' | 'unchanged';
|
|
8695
|
+
type ElementChangeKind = 'added' | 'removed' | 'moved' | 'resized' | 'textChanged';
|
|
8696
|
+
interface ElementChange {
|
|
8697
|
+
elementId: string;
|
|
8698
|
+
label: string;
|
|
8699
|
+
kind: ElementChangeKind;
|
|
8700
|
+
description: string;
|
|
8701
|
+
}
|
|
8702
|
+
interface SlideDiff {
|
|
8703
|
+
status: SlideDiffStatus;
|
|
8704
|
+
/** Index in the base (current) presentation, or -1 for added slides. */
|
|
8705
|
+
baseIndex: number;
|
|
8706
|
+
/** Index in the compare (other) presentation, or -1 for removed slides. */
|
|
8707
|
+
compareIndex: number;
|
|
8708
|
+
/** The base slide data (undefined for added slides). */
|
|
8709
|
+
baseSlide?: PptxSlide;
|
|
8710
|
+
/** The compare slide data (undefined for removed slides). */
|
|
8711
|
+
compareSlide?: PptxSlide;
|
|
8712
|
+
/** Per-element changes when status is `changed`. */
|
|
8713
|
+
changes: ElementChange[];
|
|
8714
|
+
}
|
|
8715
|
+
interface CompareResult {
|
|
8716
|
+
diffs: SlideDiff[];
|
|
8717
|
+
baseSlideCount: number;
|
|
8718
|
+
compareSlideCount: number;
|
|
8719
|
+
addedCount: number;
|
|
8720
|
+
removedCount: number;
|
|
8721
|
+
changedCount: number;
|
|
8722
|
+
unchangedCount: number;
|
|
8723
|
+
}
|
|
7914
8724
|
/**
|
|
7915
8725
|
* A font supplied by the host application. The package never ships fonts:
|
|
7916
8726
|
* applications provide a licensed URL, data URL, or blob URL for their users.
|
|
@@ -7922,6 +8732,105 @@ interface ViewerFontSource {
|
|
|
7922
8732
|
weight?: string | number;
|
|
7923
8733
|
style?: 'normal' | 'italic';
|
|
7924
8734
|
}
|
|
8735
|
+
/** The configuration emitted when a broadcast starts. */
|
|
8736
|
+
interface BroadcastConfig {
|
|
8737
|
+
roomId: string;
|
|
8738
|
+
serverUrl: string;
|
|
8739
|
+
/** Derived from serverUrl: empty server means peer-to-peer (webrtc). */
|
|
8740
|
+
transport?: CollaborationTransport;
|
|
8741
|
+
}
|
|
8742
|
+
//#endregion
|
|
8743
|
+
//#region src/render/presentation-session-types.d.ts
|
|
8744
|
+
interface PresentationSnapshot {
|
|
8745
|
+
slideIndex: number;
|
|
8746
|
+
buildStep: number;
|
|
8747
|
+
sequence: number;
|
|
8748
|
+
blackout: 'none' | 'black' | 'white';
|
|
8749
|
+
paused: boolean;
|
|
8750
|
+
elapsedMs: number;
|
|
8751
|
+
zoom?: PresentationZoomState;
|
|
8752
|
+
pointer?: PresentationPointerState;
|
|
8753
|
+
inkStrokes?: PresentationInkStroke[];
|
|
8754
|
+
caption?: string;
|
|
8755
|
+
subtitlesVisible?: boolean;
|
|
8756
|
+
}
|
|
8757
|
+
interface PresentationZoomState {
|
|
8758
|
+
scale: number;
|
|
8759
|
+
originX: number;
|
|
8760
|
+
originY: number;
|
|
8761
|
+
}
|
|
8762
|
+
type PresentationPointerTool = 'none' | 'laser' | 'pen' | 'highlighter' | 'eraser';
|
|
8763
|
+
interface PresentationPointerState {
|
|
8764
|
+
tool: PresentationPointerTool;
|
|
8765
|
+
x: number;
|
|
8766
|
+
y: number;
|
|
8767
|
+
color: string;
|
|
8768
|
+
}
|
|
8769
|
+
interface PresentationInkPoint {
|
|
8770
|
+
x: number;
|
|
8771
|
+
y: number;
|
|
8772
|
+
}
|
|
8773
|
+
interface PresentationInkStroke {
|
|
8774
|
+
id: string;
|
|
8775
|
+
slideIndex: number;
|
|
8776
|
+
tool: 'pen' | 'highlighter';
|
|
8777
|
+
color: string;
|
|
8778
|
+
width: number;
|
|
8779
|
+
points: PresentationInkPoint[];
|
|
8780
|
+
}
|
|
8781
|
+
//#endregion
|
|
8782
|
+
//#region src/render/find-replace.d.ts
|
|
8783
|
+
/** Identifies a single match of the find query at segment-level precision. */
|
|
8784
|
+
interface FindResult {
|
|
8785
|
+
/** Zero-based index of the slide in the slides array. */
|
|
8786
|
+
slideIndex: number;
|
|
8787
|
+
/** Id of the element that contains the match. */
|
|
8788
|
+
elementId: string;
|
|
8789
|
+
/** Zero-based index of the text segment within the element's `textSegments`. */
|
|
8790
|
+
segmentIndex: number;
|
|
8791
|
+
/** Character offset of the match start within the segment text. */
|
|
8792
|
+
startOffset: number;
|
|
8793
|
+
/** Number of characters matched (equals `query.length`). */
|
|
8794
|
+
length: number;
|
|
8795
|
+
}
|
|
8796
|
+
//#endregion
|
|
8797
|
+
//#region src/render/ink-drawing.d.ts
|
|
8798
|
+
/** A 2D point in stage-local coordinates. */
|
|
8799
|
+
interface InkPoint {
|
|
8800
|
+
x: number;
|
|
8801
|
+
y: number;
|
|
8802
|
+
}
|
|
8803
|
+
//#endregion
|
|
8804
|
+
//#region src/render/mobile-chrome.d.ts
|
|
8805
|
+
/**
|
|
8806
|
+
* Pure helper logic for mobile chrome state, shared by every binding.
|
|
8807
|
+
*
|
|
8808
|
+
* These helpers capture the sheet open/close state machine that governs which
|
|
8809
|
+
* sheet is visible at any given time and which bottom-bar button appears active.
|
|
8810
|
+
* Keeping this logic as pure functions makes it straightforward to test and
|
|
8811
|
+
* trivial to adapt when each binding wires the components together.
|
|
8812
|
+
*/
|
|
8813
|
+
/** All mobile sheets that can be open at one time. */
|
|
8814
|
+
type MobileSheetKey = 'slides' | 'menu' | 'insert' | 'inspector' | 'comments' | 'notes' | null;
|
|
8815
|
+
/** In-memory clipboard payload stored when an element is copied or cut. */
|
|
8816
|
+
interface ElementClipboardPayload {
|
|
8817
|
+
element: PptxElement;
|
|
8818
|
+
isTemplate: boolean;
|
|
8819
|
+
}
|
|
8820
|
+
//#endregion
|
|
8821
|
+
//#region src/render/template-editing.d.ts
|
|
8822
|
+
type TemplateElementMap = Record<string, PptxElement[]>;
|
|
8823
|
+
//#endregion
|
|
8824
|
+
//#region src/render/viewer-preferences.d.ts
|
|
8825
|
+
/** Framework-neutral viewer preferences surfaced by Settings dialogs. */
|
|
8826
|
+
interface ViewerPreferences {
|
|
8827
|
+
autoSave: boolean;
|
|
8828
|
+
spellCheck: boolean;
|
|
8829
|
+
showGrid: boolean;
|
|
8830
|
+
showRulers: boolean;
|
|
8831
|
+
snapToGrid: boolean;
|
|
8832
|
+
reducedMotion: boolean;
|
|
8833
|
+
}
|
|
7925
8834
|
/**
|
|
7926
8835
|
* Optional hook point for hosts that want to wire a real sign-in flow into
|
|
7927
8836
|
* File > Account. Disabled by default: the Account page renders nothing
|
|
@@ -7997,12 +8906,233 @@ interface PrintSettings {
|
|
|
7997
8906
|
}
|
|
7998
8907
|
|
|
7999
8908
|
//#endregion
|
|
8000
|
-
//#region src/
|
|
8001
|
-
/**
|
|
8002
|
-
interface
|
|
8003
|
-
/**
|
|
8004
|
-
|
|
8005
|
-
/**
|
|
8909
|
+
//#region src/ai/change-animator.d.ts
|
|
8910
|
+
/** Host-tunable options for how AI edits are animated on the canvas. */
|
|
8911
|
+
interface AiChangeAnimationConfig {
|
|
8912
|
+
/** Master switch. Default true. */
|
|
8913
|
+
enabled?: boolean;
|
|
8914
|
+
/** How long the motion + glow plays, in ms. Default 900. */
|
|
8915
|
+
durationMs?: number;
|
|
8916
|
+
/** Draw the pulsing glow highlight on changed elements. Default true. */
|
|
8917
|
+
glow?: boolean;
|
|
8918
|
+
/** Glide old->new bounds and cross-fade colours. Default true. */
|
|
8919
|
+
tween?: boolean;
|
|
8920
|
+
/** Accent colour (any CSS colour) for the glow/ghosts. Default a blue. */
|
|
8921
|
+
color?: string;
|
|
8922
|
+
}
|
|
8923
|
+
//#endregion
|
|
8924
|
+
//#region src/ai/config.d.ts
|
|
8925
|
+
/** The UI message shape exchanged with the assistant. Alias of the SDK type. */
|
|
8926
|
+
type PptxAiUIMessage = UIMessage;
|
|
8927
|
+
/**
|
|
8928
|
+
* Canonical name of every tool the assistant can call. Document tools mirror the
|
|
8929
|
+
* `pptx-viewer-mcp` server exactly (they ARE the same functions, run against the
|
|
8930
|
+
* live deck); the viewer-only tools (navigation, deck outline, element/notes
|
|
8931
|
+
* readers, table merge) have no MCP counterpart.
|
|
8932
|
+
*/
|
|
8933
|
+
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';
|
|
8934
|
+
type Resolvable<T> = T | (() => T | Promise<T>);
|
|
8935
|
+
/** How the assistant reaches a language model. */
|
|
8936
|
+
type PptxAiConnection =
|
|
8937
|
+
/**
|
|
8938
|
+
* Post messages to a host backend route (recommended for production so the
|
|
8939
|
+
* provider API key stays server-side). Maps to `DefaultChatTransport`.
|
|
8940
|
+
*/
|
|
8941
|
+
{
|
|
8942
|
+
kind: 'endpoint';
|
|
8943
|
+
api: string;
|
|
8944
|
+
headers?: Resolvable<Record<string, string>>;
|
|
8945
|
+
body?: Resolvable<Record<string, unknown>>;
|
|
8946
|
+
credentials?: RequestCredentials;
|
|
8947
|
+
fetch?: typeof globalThis.fetch;
|
|
8948
|
+
} |
|
|
8949
|
+
/**
|
|
8950
|
+
* Run a language model in-process in the browser (bring-your-own key /
|
|
8951
|
+
* local model). Maps to a `ToolLoopAgent` behind a `DirectChatTransport`.
|
|
8952
|
+
*/
|
|
8953
|
+
{
|
|
8954
|
+
kind: 'model';
|
|
8955
|
+
model: LanguageModel;
|
|
8956
|
+
system?: string;
|
|
8957
|
+
maxSteps?: number;
|
|
8958
|
+
} |
|
|
8959
|
+
/** Provide a fully-constructed transport (advanced / testing escape hatch). */
|
|
8960
|
+
{
|
|
8961
|
+
kind: 'transport';
|
|
8962
|
+
transport: ChatTransport<PptxAiUIMessage>;
|
|
8963
|
+
};
|
|
8964
|
+
/** How writes proposed by the assistant reach the document. */
|
|
8965
|
+
type PptxAiWritePolicy = 'stage' | 'approve' | 'auto';
|
|
8966
|
+
/** Which deck context is fed to the model with each turn. */
|
|
8967
|
+
type PptxAiContextStrategy = 'outline' | 'current-slide' | 'none';
|
|
8968
|
+
/** Optional per-session history persistence hooks. */
|
|
8969
|
+
interface PptxAiHistoryHooks {
|
|
8970
|
+
load?(id: string): Promise<PptxAiUIMessage[]>;
|
|
8971
|
+
save?(id: string, messages: PptxAiUIMessage[]): Promise<void>;
|
|
8972
|
+
}
|
|
8973
|
+
/** Complete host configuration for an AI chat session. */
|
|
8974
|
+
interface PptxAiConfig {
|
|
8975
|
+
connection: PptxAiConnection;
|
|
8976
|
+
/** Extra host instructions appended to the base system prompt. */
|
|
8977
|
+
systemPromptExtras?: string;
|
|
8978
|
+
tools?: {
|
|
8979
|
+
/** Allowlist. When set, only these tools are exposed. */
|
|
8980
|
+
enabled?: PptxAiToolName[];
|
|
8981
|
+
/** Denylist, applied after `enabled`. */
|
|
8982
|
+
disabled?: PptxAiToolName[];
|
|
8983
|
+
/** Additional host-defined tools merged into the tool set. */
|
|
8984
|
+
extra?: ToolSet;
|
|
8985
|
+
};
|
|
8986
|
+
/** Default `'stage'`. */
|
|
8987
|
+
writePolicy?: PptxAiWritePolicy;
|
|
8988
|
+
/** Default `'outline'`. */
|
|
8989
|
+
contextStrategy?: PptxAiContextStrategy;
|
|
8990
|
+
history?: PptxAiHistoryHooks;
|
|
8991
|
+
/**
|
|
8992
|
+
* How AI edits are animated on the canvas so the user can watch them land
|
|
8993
|
+
* (glide old->new, fade/scale in-out, glow-pulse). Omit for the defaults;
|
|
8994
|
+
* set `{ enabled: false }` to turn it off.
|
|
8995
|
+
*/
|
|
8996
|
+
changeAnimation?: AiChangeAnimationConfig;
|
|
8997
|
+
onError?(error: Error): void;
|
|
8998
|
+
}
|
|
8999
|
+
//#endregion
|
|
9000
|
+
//#region src/ai/bridge.d.ts
|
|
9001
|
+
/** Lightweight, model-friendly summary of the whole deck. */
|
|
9002
|
+
interface PptxAiDeckMeta {
|
|
9003
|
+
/** Total number of slides. */
|
|
9004
|
+
slideCount: number;
|
|
9005
|
+
/** Zero-based index of the currently active slide. */
|
|
9006
|
+
activeSlideIndex: number;
|
|
9007
|
+
/** Deck title, when known (first slide title / core properties). */
|
|
9008
|
+
title?: string;
|
|
9009
|
+
/** Slide canvas width in CSS pixels. */
|
|
9010
|
+
width: number;
|
|
9011
|
+
/** Slide canvas height in CSS pixels. */
|
|
9012
|
+
height: number;
|
|
9013
|
+
}
|
|
9014
|
+
/** Severity hint for {@link PptxAiBridge.notify}. */
|
|
9015
|
+
type PptxAiNotifyLevel = 'info' | 'success' | 'warning' | 'error';
|
|
9016
|
+
/**
|
|
9017
|
+
* A target the user has scoped the assistant to: either a whole slide or a
|
|
9018
|
+
* single element on a slide. Returned by {@link PptxAiBridge.getFocusedTargets}
|
|
9019
|
+
* so the context builder can tell the model exactly what to focus on.
|
|
9020
|
+
*/
|
|
9021
|
+
type PptxAiFocusedTarget = {
|
|
9022
|
+
kind: 'slide';
|
|
9023
|
+
slideIndex: number;
|
|
9024
|
+
} | {
|
|
9025
|
+
kind: 'element';
|
|
9026
|
+
slideIndex: number;
|
|
9027
|
+
elementId: string;
|
|
9028
|
+
};
|
|
9029
|
+
/**
|
|
9030
|
+
* A pure updater over the deck's slides. It receives a deep clone of the
|
|
9031
|
+
* current slides (mutation-safe) and returns the next slides array. The bridge
|
|
9032
|
+
* commits the returned array as ONE history entry.
|
|
9033
|
+
*/
|
|
9034
|
+
type PptxAiSlidesUpdater = (slides: PptxSlide[]) => PptxSlide[];
|
|
9035
|
+
/**
|
|
9036
|
+
* A pure updater over the whole parsed deck ({@link PptxData}). Mirrors the
|
|
9037
|
+
* `pptx-viewer-mcp` tool model (data in, mutated data out) so presentation-level
|
|
9038
|
+
* MCP tools (metadata, sections, canvas size, presentation properties, layouts)
|
|
9039
|
+
* can be committed as ONE undoable history entry through {@link
|
|
9040
|
+
* PptxAiBridge.applyDeckData}. Optional: bindings that only track slide/theme
|
|
9041
|
+
* state can omit it, in which case those presentation-level tools report that
|
|
9042
|
+
* they are unavailable in this viewer while every slide/theme tool still works.
|
|
9043
|
+
*/
|
|
9044
|
+
type PptxAiDataUpdater = (data: PptxData) => PptxData;
|
|
9045
|
+
/** Field-level updates for a single element, mirroring the MCP update vocab. */
|
|
9046
|
+
interface PptxAiElementUpdate {
|
|
9047
|
+
x?: number;
|
|
9048
|
+
y?: number;
|
|
9049
|
+
width?: number;
|
|
9050
|
+
height?: number;
|
|
9051
|
+
rotation?: number;
|
|
9052
|
+
opacity?: number;
|
|
9053
|
+
hidden?: boolean;
|
|
9054
|
+
flipHorizontal?: boolean;
|
|
9055
|
+
flipVertical?: boolean;
|
|
9056
|
+
text?: string;
|
|
9057
|
+
fontSize?: number;
|
|
9058
|
+
fontFamily?: string;
|
|
9059
|
+
fontColor?: string;
|
|
9060
|
+
bold?: boolean;
|
|
9061
|
+
italic?: boolean;
|
|
9062
|
+
underline?: boolean;
|
|
9063
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
9064
|
+
fillColor?: string;
|
|
9065
|
+
strokeColor?: string;
|
|
9066
|
+
strokeWidth?: number;
|
|
9067
|
+
}
|
|
9068
|
+
/**
|
|
9069
|
+
* Implemented by each binding to expose its live editor to the AI core.
|
|
9070
|
+
*
|
|
9071
|
+
* Read methods must be cheap and synchronous. Write methods must route through
|
|
9072
|
+
* the binding's editor-history layer so AI edits are undoable like manual ones.
|
|
9073
|
+
*/
|
|
9074
|
+
interface PptxAiBridge {
|
|
9075
|
+
/** Return a summary of the whole deck. */
|
|
9076
|
+
getDeckMeta(): PptxAiDeckMeta;
|
|
9077
|
+
/** Return the deck's slides. Callers must not mutate the returned array. */
|
|
9078
|
+
getSlides(): PptxSlide[];
|
|
9079
|
+
/** Return the zero-based index of the active slide. */
|
|
9080
|
+
getActiveSlideIndex(): number;
|
|
9081
|
+
/** Return the resolved presentation theme, when available. */
|
|
9082
|
+
getTheme(): PptxTheme | undefined;
|
|
9083
|
+
/** Return the underlying core handler, when the binding exposes one. */
|
|
9084
|
+
getHandler(): PptxHandler | undefined;
|
|
9085
|
+
/** Navigate the viewer to a slide by zero-based index. */
|
|
9086
|
+
goToSlide(index: number): void;
|
|
9087
|
+
/** Select the given elements on a slide (empty array clears selection). */
|
|
9088
|
+
selectElements(slideIndex: number, elementIds: string[]): void;
|
|
9089
|
+
/**
|
|
9090
|
+
* Apply a slides updater as a single, atomic, undoable history entry. The
|
|
9091
|
+
* binding is responsible for cloning current slides before calling
|
|
9092
|
+
* `updater` and for installing the result.
|
|
9093
|
+
*/
|
|
9094
|
+
applySlidesUpdate(updater: PptxAiSlidesUpdater, label: string): void;
|
|
9095
|
+
/** Apply field updates to one element as a single history entry. */
|
|
9096
|
+
updateElement(slideIndex: number, elementId: string, updates: PptxAiElementUpdate): void;
|
|
9097
|
+
/** Apply partial theme updates as a single history entry. */
|
|
9098
|
+
applyTheme(updates: Partial<PptxTheme>): void;
|
|
9099
|
+
/**
|
|
9100
|
+
* Return the full parsed {@link PptxData} for the open deck, with the live
|
|
9101
|
+
* (edited) slides and theme overlaid. Enables `pptx-viewer-mcp` tools that
|
|
9102
|
+
* read presentation-level state (metadata, sections, layouts, presentation
|
|
9103
|
+
* properties). Optional: when absent, the AI core synthesises a minimal
|
|
9104
|
+
* PptxData from slides + dimensions, which is enough for every slide/theme
|
|
9105
|
+
* tool but not for presentation-level reads.
|
|
9106
|
+
*/
|
|
9107
|
+
getDeckData?(): PptxData | undefined;
|
|
9108
|
+
/**
|
|
9109
|
+
* Commit a whole-deck {@link PptxData} mutation as one undoable history entry.
|
|
9110
|
+
* Used to apply presentation-level MCP tool results (metadata, sections,
|
|
9111
|
+
* canvas size, presentation properties, layouts). Optional: when absent,
|
|
9112
|
+
* those tools report they are not supported in this viewer; slide/theme tools
|
|
9113
|
+
* are unaffected (they route through {@link PptxAiBridge.applySlidesUpdate}
|
|
9114
|
+
* and {@link PptxAiBridge.applyTheme}).
|
|
9115
|
+
*/
|
|
9116
|
+
applyDeckData?(updater: PptxAiDataUpdater, label: string): void;
|
|
9117
|
+
/**
|
|
9118
|
+
* Return the slides / elements the user has scoped the assistant to, if any.
|
|
9119
|
+
* When present and non-empty, the context builder tells the model to focus on
|
|
9120
|
+
* exactly these targets. Optional so existing bridges satisfy the contract
|
|
9121
|
+
* without change; a bridge that does not implement it behaves as before (no
|
|
9122
|
+
* focus scoping).
|
|
9123
|
+
*/
|
|
9124
|
+
getFocusedTargets?(): PptxAiFocusedTarget[];
|
|
9125
|
+
/** Surface a transient message in the host UI (toast / status line). */
|
|
9126
|
+
notify?(message: string, level?: PptxAiNotifyLevel): void;
|
|
9127
|
+
}
|
|
9128
|
+
|
|
9129
|
+
//#endregion
|
|
9130
|
+
//#region src/i18n/locale-catalog.d.ts
|
|
9131
|
+
/** One selectable entry in the viewer chrome's built-in language picker (File > Options > Language). */
|
|
9132
|
+
interface LocaleCatalogEntry {
|
|
9133
|
+
/** BCP-47-ish locale code, e.g. `'en'`, `'fr'`. Matches `pptx-viewer-locales`' exports. */
|
|
9134
|
+
code: string;
|
|
9135
|
+
/** English display name, used before a translation dictionary for the target locale is loaded. */
|
|
8006
9136
|
label: string;
|
|
8007
9137
|
/** The locale's own name for itself, e.g. `'Français'` for `fr`. */
|
|
8008
9138
|
nativeLabel: string;
|
|
@@ -8059,6 +9189,12 @@ interface ExportGifOptions {
|
|
|
8059
9189
|
*/
|
|
8060
9190
|
/** Options for the print flow: any subset of the shared print settings. */
|
|
8061
9191
|
type PrintOptions = Partial<PrintSettings>;
|
|
9192
|
+
/**
|
|
9193
|
+
* Render a complete HTML document into a print surface and trigger printing.
|
|
9194
|
+
* Returns `false` when the surface could not be opened (e.g. a custom
|
|
9195
|
+
* `window.open`-based opener hit a popup blocker).
|
|
9196
|
+
*/
|
|
9197
|
+
type OpenPrintWindow = (htmlDocument: string) => boolean;
|
|
8062
9198
|
|
|
8063
9199
|
/**
|
|
8064
9200
|
* Video (WebM) export driven by the shared `video-plan` maths: segment timing
|
|
@@ -8089,6 +9225,9 @@ interface ExportVideoOptions {
|
|
|
8089
9225
|
signal?: AbortSignal;
|
|
8090
9226
|
}
|
|
8091
9227
|
|
|
9228
|
+
/** Rasterise the slide at `index` to an `HTMLCanvasElement`. Injected so the
|
|
9229
|
+
* controller stays DOM-capture-free and unit-testable. */
|
|
9230
|
+
type RasterizeSlide = (index: number) => Promise<HTMLCanvasElement>;
|
|
8092
9231
|
/** Per-slide progress callback: `(currentSlideIndex, totalSlides)`. */
|
|
8093
9232
|
type ExportProgress = (current: number, total: number) => void;
|
|
8094
9233
|
/** Options for the multi-slide PDF export (progress + cooperative cancel). */
|
|
@@ -8098,6 +9237,77 @@ interface ExportPdfOptions {
|
|
|
8098
9237
|
/** Abort the export early; the loop checks this between slides. */
|
|
8099
9238
|
signal?: AbortSignal;
|
|
8100
9239
|
}
|
|
9240
|
+
interface ExportControllerDeps {
|
|
9241
|
+
/** Live slide count; read fresh on every call. */
|
|
9242
|
+
getSlideCount(): number;
|
|
9243
|
+
/** Active slide index (0-based); the PNG export's default target. */
|
|
9244
|
+
getCurrent(): number;
|
|
9245
|
+
/** Live slide canvas size (px), for the PDF page size. */
|
|
9246
|
+
getCanvasSize(): CanvasSize;
|
|
9247
|
+
/** Live slide list (print needs slide notes/titles, not just the count). */
|
|
9248
|
+
getSlides(): PptxSlide[];
|
|
9249
|
+
rasterizeSlide: RasterizeSlide;
|
|
9250
|
+
/** Print-surface opener override; see `export-print.ts` for the default. */
|
|
9251
|
+
openPrintWindow?: OpenPrintWindow;
|
|
9252
|
+
/** Base file name (without extension) for downloads. Defaults to `presentation`. */
|
|
9253
|
+
fileName?: string;
|
|
9254
|
+
}
|
|
9255
|
+
/**
|
|
9256
|
+
* Export controller (runes class): render slides to PNG / PDF / animated GIF /
|
|
9257
|
+
* WebM video, plus the print flow. Started as a Svelte port of Vue's
|
|
9258
|
+
* `useExport` composable (`packages/vue/src/viewer/composables/useExport.ts`)
|
|
9259
|
+
* and now also covers React's `useExportHandlers` GIF/video surface (via
|
|
9260
|
+
* `export-gif.ts` / `export-video.ts`) and Vue's `usePrint`
|
|
9261
|
+
* (`export-print.ts`), reshaped as a `$state`-backed class to match this
|
|
9262
|
+
* package's runes-class convention (see `EditorState` in
|
|
9263
|
+
* `../editor/editor-state.svelte.ts`) rather than Vue `Ref`s.
|
|
9264
|
+
*
|
|
9265
|
+
* Rasterisation is delegated to the injected `rasterizeSlide` (the host owns
|
|
9266
|
+
* the off-screen `SlideStage` mount + `html2canvas-pro`, see
|
|
9267
|
+
* `rasterize-slide.ts`). `jspdf` is loaded lazily so it stays out of the main
|
|
9268
|
+
* bundle.
|
|
9269
|
+
*/
|
|
9270
|
+
declare class ExportController {
|
|
9271
|
+
#private;
|
|
9272
|
+
/** True while an export is running (disable UI / show a spinner). */
|
|
9273
|
+
exporting: boolean;
|
|
9274
|
+
constructor(deps: ExportControllerDeps);
|
|
9275
|
+
/** Export a single slide as a PNG download. Defaults to the current slide. */
|
|
9276
|
+
exportSlidePng(index?: number): Promise<void>;
|
|
9277
|
+
/** Copy a slide to the system clipboard as a PNG image. */
|
|
9278
|
+
copySlideAsImage(index?: number): Promise<void>;
|
|
9279
|
+
/** Export every slide as a multi-page PDF download (one slide per page). */
|
|
9280
|
+
exportPdf(options?: ExportPdfOptions): Promise<void>;
|
|
9281
|
+
/**
|
|
9282
|
+
* Export every slide as an animated GIF download. Frame delays come from
|
|
9283
|
+
* the shared `planGifFrames` plan (default duration + per-slide overrides);
|
|
9284
|
+
* see `export-gif.ts`. Supports progress + AbortSignal like `exportPdf`.
|
|
9285
|
+
*/
|
|
9286
|
+
exportGif(options?: ExportGifOptions): Promise<void>;
|
|
9287
|
+
/**
|
|
9288
|
+
* Export every slide as a WebM video download (MediaRecorder over a canvas
|
|
9289
|
+
* capture stream, timing from the shared `planVideoSegments` plan); see
|
|
9290
|
+
* `export-video.ts`. Supports progress + AbortSignal like `exportPdf`.
|
|
9291
|
+
*/
|
|
9292
|
+
exportVideo(options?: ExportVideoOptions): Promise<void>;
|
|
9293
|
+
/**
|
|
9294
|
+
* Assemble the shared print document for the given (partial) settings and
|
|
9295
|
+
* open it in the print surface (hidden iframe by default; see
|
|
9296
|
+
* `export-print.ts` for the popup-blocker caveats of custom openers).
|
|
9297
|
+
* Resolves `true` when the print surface opened.
|
|
9298
|
+
*/
|
|
9299
|
+
print(options?: PrintOptions): Promise<boolean>;
|
|
9300
|
+
}
|
|
9301
|
+
|
|
9302
|
+
/** Translate `key`, interpolating `{{name}}` placeholders from `params`. */
|
|
9303
|
+
type Translator = (key: string, params?: Record<string, string | number>) => string;
|
|
9304
|
+
|
|
9305
|
+
interface ExportWiring {
|
|
9306
|
+
/** The reactive PNG/PDF export controller (`exporting` drives a spinner). */
|
|
9307
|
+
controller: ExportController;
|
|
9308
|
+
/** Tear down the off-screen capture stage (component destroy). */
|
|
9309
|
+
destroy(): void;
|
|
9310
|
+
}
|
|
8101
9311
|
|
|
8102
9312
|
type SvgExportSingleSlideOptions = SvgExportOptions;
|
|
8103
9313
|
type SvgExportAllOptions = SvgExportOptions;
|
|
@@ -8112,6 +9322,16 @@ declare function exportAllSlidesToSvg(data: PptxData, options?: SvgExportAllOpti
|
|
|
8112
9322
|
/** Export the selected presentation slides as SVG Blobs. */
|
|
8113
9323
|
declare function exportAllSlidesToSvgBlobs(data: PptxData, options?: SvgExportAllOptions): Blob[];
|
|
8114
9324
|
|
|
9325
|
+
/** The imperative export API exposed on the `PowerPointViewer` instance. */
|
|
9326
|
+
interface ExportingApi {
|
|
9327
|
+
exportSlidePng(index?: number): Promise<void>;
|
|
9328
|
+
copySlideAsImage(index?: number): Promise<void>;
|
|
9329
|
+
exportPdf(options?: ExportPdfOptions): Promise<void>;
|
|
9330
|
+
exportGif(options?: ExportGifOptions): Promise<void>;
|
|
9331
|
+
exportVideo(options?: ExportVideoOptions): Promise<void>;
|
|
9332
|
+
print(options?: PrintOptions): Promise<boolean>;
|
|
9333
|
+
}
|
|
9334
|
+
|
|
8115
9335
|
/** Payload for the `onload` callback. */
|
|
8116
9336
|
interface ViewerLoadDetail {
|
|
8117
9337
|
/** Number of slides in the loaded presentation. */
|
|
@@ -8198,11 +9418,11 @@ interface PowerPointViewerProps {
|
|
|
8198
9418
|
*/
|
|
8199
9419
|
showNotes?: boolean;
|
|
8200
9420
|
/**
|
|
8201
|
-
* Opt in to the
|
|
8202
|
-
*
|
|
8203
|
-
*
|
|
8204
|
-
*
|
|
8205
|
-
*
|
|
9421
|
+
* Opt in to the Three.js (WebGL) SmartArt renderer for `smartArt` elements,
|
|
9422
|
+
* in place of the default SVG renderer. Requires the optional `three` peer
|
|
9423
|
+
* dependency; when it is unavailable, or a diagram has no renderable nodes,
|
|
9424
|
+
* or the WebGL mount fails, the SVG renderer is used automatically. Default
|
|
9425
|
+
* false.
|
|
8206
9426
|
*/
|
|
8207
9427
|
smartArt3D?: boolean;
|
|
8208
9428
|
/**
|
|
@@ -8291,6 +9511,15 @@ interface PowerPointViewerProps {
|
|
|
8291
9511
|
userName?: string;
|
|
8292
9512
|
serverUrl?: string;
|
|
8293
9513
|
};
|
|
9514
|
+
/**
|
|
9515
|
+
* Optional AI assistant configuration. When provided, a Sparkles toggle
|
|
9516
|
+
* appears in the ribbon's command row and opens a right-side chat panel that
|
|
9517
|
+
* can read the open deck and propose edits through the viewer's undo history.
|
|
9518
|
+
* The panel (and the optional `@ai-sdk/svelte` + `ai` peers it needs) is
|
|
9519
|
+
* lazily loaded only when first opened; leaving this undefined ships no AI UI
|
|
9520
|
+
* and never pulls the SDK. See `pptx-viewer-shared/ai`'s `PptxAiConfig`.
|
|
9521
|
+
*/
|
|
9522
|
+
ai?: PptxAiConfig;
|
|
8294
9523
|
}
|
|
8295
9524
|
/**
|
|
8296
9525
|
* Imperative editing API exposed on the `<PowerPointViewer>` component
|
|
@@ -8366,6 +9595,1012 @@ interface PowerPointViewerApi extends PowerPointViewerAPI {
|
|
|
8366
9595
|
*/
|
|
8367
9596
|
declare const PowerPointViewer: Component<PowerPointViewerProps, PowerPointViewerApi>;
|
|
8368
9597
|
|
|
9598
|
+
/**
|
|
9599
|
+
* Shared value types for the Svelte editing layer.
|
|
9600
|
+
*/
|
|
9601
|
+
/** Box geometry in element (unscaled slide) px. */
|
|
9602
|
+
interface OverlayBox {
|
|
9603
|
+
x: number;
|
|
9604
|
+
y: number;
|
|
9605
|
+
width: number;
|
|
9606
|
+
height: number;
|
|
9607
|
+
rotation: number;
|
|
9608
|
+
}
|
|
9609
|
+
|
|
9610
|
+
interface EditorControllerDeps {
|
|
9611
|
+
getScale(): number;
|
|
9612
|
+
getCurrent(): number;
|
|
9613
|
+
getPresenting(): boolean;
|
|
9614
|
+
getStageRoot(): Element | null;
|
|
9615
|
+
getHolderEl(): HTMLElement | null;
|
|
9616
|
+
onCursorMove?(x: number, y: number): void;
|
|
9617
|
+
onContextMenu?(x: number, y: number): void;
|
|
9618
|
+
getSnapToGrid?(): boolean;
|
|
9619
|
+
getSnapToShape?(): boolean;
|
|
9620
|
+
getGuides?(): readonly {
|
|
9621
|
+
axis: 'h' | 'v';
|
|
9622
|
+
position: number;
|
|
9623
|
+
}[];
|
|
9624
|
+
/**
|
|
9625
|
+
* Transform inline-editor text at commit time (File > Options > Proofing
|
|
9626
|
+
* AutoCorrect); identity when unset.
|
|
9627
|
+
*/
|
|
9628
|
+
transformCommittedText?(text: string): string;
|
|
9629
|
+
/**
|
|
9630
|
+
* Collaboration live-preview channel. Inline text only reaches the slides
|
|
9631
|
+
* state on commit, so peers saw nothing while a peer typed; each keystroke is
|
|
9632
|
+
* published through this instead. Omit outside a collaborative viewer.
|
|
9633
|
+
*/
|
|
9634
|
+
getLivePatcher?(): CollaborationLivePatcher | undefined;
|
|
9635
|
+
/** The slide the inline-edited element belongs to (live-preview lookup). */
|
|
9636
|
+
getActiveSlide?(): PptxSlide | undefined;
|
|
9637
|
+
}
|
|
9638
|
+
|
|
9639
|
+
/**
|
|
9640
|
+
* Pure, immutable slide-array mutations for the Svelte editor.
|
|
9641
|
+
*
|
|
9642
|
+
* Mirrors the vanilla binding's `editor-mutations` (in turn the Vue binding's
|
|
9643
|
+
* `useEditorOperations` commit helpers), minus the reactivity: every function
|
|
9644
|
+
* takes the current `PptxSlide[]` and returns a brand-new array (untouched
|
|
9645
|
+
* slides are reused by reference so the render layer can cheaply detect
|
|
9646
|
+
* changes). All cloning defers to the core helpers (`cloneSlide`,
|
|
9647
|
+
* `cloneElement`, `duplicateElement`); nothing is mutated in place.
|
|
9648
|
+
*/
|
|
9649
|
+
/** Geometry patch applied by drag / resize / rotate / nudge. */
|
|
9650
|
+
interface ElementBoxPatch {
|
|
9651
|
+
x: number;
|
|
9652
|
+
y: number;
|
|
9653
|
+
width: number;
|
|
9654
|
+
height: number;
|
|
9655
|
+
rotation: number;
|
|
9656
|
+
}
|
|
9657
|
+
|
|
9658
|
+
interface EditorMarqueeRect extends MarqueeRect {
|
|
9659
|
+
additive: boolean;
|
|
9660
|
+
}
|
|
9661
|
+
|
|
9662
|
+
/**
|
|
9663
|
+
* Element-animation actions for the ribbon's Animations tab, split out of
|
|
9664
|
+
* `EditorState` to keep it under the repo's 300-LOC budget.
|
|
9665
|
+
*
|
|
9666
|
+
* Animation data lives on the SLIDE (`PptxSlide.animations`, keyed by
|
|
9667
|
+
* `elementId`), not on the element itself, matching how the presentation
|
|
9668
|
+
* playback state machine reads it (`buildClickGroups` in
|
|
9669
|
+
* `presentation/animation-playback.svelte.ts`). Both actions target the
|
|
9670
|
+
* currently selected element and route through the shared
|
|
9671
|
+
* `animation-authoring.ts` "coarse group preset" model (`applyAnimationPreset`
|
|
9672
|
+
* / `removeElementAnimation`), the same one the Vue/vanilla ribbons use:
|
|
9673
|
+
* applying a preset sets one of entrance/emphasis/exit without touching the
|
|
9674
|
+
* others; remove drops the whole entry. Both mutations go through
|
|
9675
|
+
* `EditorState.commitSlides`, so they are history-integrated (undoable).
|
|
9676
|
+
*/
|
|
9677
|
+
declare class EditorAnimationController {
|
|
9678
|
+
#private;
|
|
9679
|
+
constructor(editor: EditorState);
|
|
9680
|
+
addAnimation(group: AnimationGroup, preset: PptxAnimationPreset): void;
|
|
9681
|
+
removeAnimation(): void;
|
|
9682
|
+
}
|
|
9683
|
+
|
|
9684
|
+
/**
|
|
9685
|
+
* The Home tab's multi-select-aware Arrange group (align / distribute /
|
|
9686
|
+
* flip / group / ungroup), split out of `EditorState` to keep it under the
|
|
9687
|
+
* repo's 300-LOC budget. Reads `editor.selection.ids` (the ordered
|
|
9688
|
+
* multi-selection) rather than just the primary id, matching React's
|
|
9689
|
+
* `selectedElementIds` semantics.
|
|
9690
|
+
*/
|
|
9691
|
+
declare class EditorArrangeController {
|
|
9692
|
+
#private;
|
|
9693
|
+
constructor(editor: EditorState);
|
|
9694
|
+
/** Align every selected element to `edge` (needs >= 2 selected). */
|
|
9695
|
+
alignSelected(edge: AlignEdge): void;
|
|
9696
|
+
/** Distribute the selected elements evenly along `axis` (needs >= 3 selected). */
|
|
9697
|
+
distributeSelected(axis: DistributeAxis): void;
|
|
9698
|
+
/** Flip every selected element across `axis`. */
|
|
9699
|
+
flipSelected(axis: 'horizontal' | 'vertical'): void;
|
|
9700
|
+
/** Group the selected elements (needs >= 2 selected). Selects the new group. */
|
|
9701
|
+
groupSelected(): void;
|
|
9702
|
+
/** Ungroup the primary selected group element. Selects the ungrouped children. */
|
|
9703
|
+
ungroupSelected(): void;
|
|
9704
|
+
}
|
|
9705
|
+
|
|
9706
|
+
/**
|
|
9707
|
+
* Slide-background actions for the ribbon's Design tab "Format Background"
|
|
9708
|
+
* panel, split out of `EditorState` to keep it under the repo's 300-LOC
|
|
9709
|
+
* budget (mirrors `EditorSlidesController` / `EditorArrangeController`).
|
|
9710
|
+
*
|
|
9711
|
+
* Solid-colour fill only (matches the docked panel's scope: a single colour
|
|
9712
|
+
* input); clearing removes every background field so the slide falls back to
|
|
9713
|
+
* its layout/master background. Both mutations route through
|
|
9714
|
+
* `EditorState.commitSlides`, so they are history-integrated (undoable) like
|
|
9715
|
+
* every other ribbon mutation.
|
|
9716
|
+
*/
|
|
9717
|
+
declare class EditorBackgroundController {
|
|
9718
|
+
#private;
|
|
9719
|
+
constructor(editor: EditorState);
|
|
9720
|
+
/** Set the current slide's background to a solid colour. */
|
|
9721
|
+
setSlideBackgroundColor(color: string): void;
|
|
9722
|
+
/** Clear every background field on the current slide (fall back to layout/master). */
|
|
9723
|
+
clearSlideBackground(): void;
|
|
9724
|
+
}
|
|
9725
|
+
|
|
9726
|
+
/**
|
|
9727
|
+
* Ctrl+C/X/V and the Home tab's Clipboard group, split out of `EditorState`
|
|
9728
|
+
* to keep it under the repo's 300-LOC budget. Operates entirely through
|
|
9729
|
+
* `EditorState`'s public surface (`slides`, `selection`, `currentSlideIndex`,
|
|
9730
|
+
* `commitSlides`), the same contract a component would use.
|
|
9731
|
+
*/
|
|
9732
|
+
declare class EditorClipboardController {
|
|
9733
|
+
#private;
|
|
9734
|
+
constructor(editor: EditorState);
|
|
9735
|
+
/** Copy the primary selected element to the clipboard (works read-only, like React). */
|
|
9736
|
+
copySelected(): void;
|
|
9737
|
+
/** Copy the primary selected element then delete it (with history). */
|
|
9738
|
+
cutSelected(): void;
|
|
9739
|
+
/** Paste the clipboard payload onto the current slide (fresh id, offset, selects it). */
|
|
9740
|
+
pasteClipboard(): string | null;
|
|
9741
|
+
}
|
|
9742
|
+
|
|
9743
|
+
/**
|
|
9744
|
+
* Z-order (paint-order) reordering for the Svelte editor.
|
|
9745
|
+
*
|
|
9746
|
+
* The array-level primitives (`bringToFront`, `sendToBack`, `bringForward`,
|
|
9747
|
+
* `sendBackward`) are the shared, framework-agnostic operations from
|
|
9748
|
+
* `pptx-viewer-shared` (`render/element-operations`), where array index 0 is
|
|
9749
|
+
* the back and the last index is the front. This module only lifts them to the
|
|
9750
|
+
* slide-array shape the editor state stores, reusing the same immutable
|
|
9751
|
+
* `mapSlideElements` helper as the other mutations.
|
|
9752
|
+
*/
|
|
9753
|
+
/** Which way to move the selected element through the paint-order stack. */
|
|
9754
|
+
type ZOrderDirection = 'front' | 'back' | 'forward' | 'backward';
|
|
9755
|
+
|
|
9756
|
+
/** History-integrated element and notes mutations for {@link EditorState}. */
|
|
9757
|
+
declare class EditorElementController {
|
|
9758
|
+
#private;
|
|
9759
|
+
constructor(editor: EditorState);
|
|
9760
|
+
resetNudge(): void;
|
|
9761
|
+
patchGeometry(id: string, box: ElementBoxPatch): void;
|
|
9762
|
+
deleteSelected(): void;
|
|
9763
|
+
duplicateSelected(): string | null;
|
|
9764
|
+
applyElementPatch(id: string, patch: Partial<PptxElement>): void;
|
|
9765
|
+
patchSelected(patch: Partial<PptxElement>): void;
|
|
9766
|
+
insertElement(element: PptxElement): string | null;
|
|
9767
|
+
reorderSelected(direction: ZOrderDirection): void;
|
|
9768
|
+
nudgeSelected(dx: number, dy: number): void;
|
|
9769
|
+
commitInlineText(id: string, text: string): void;
|
|
9770
|
+
commitNotes(notes: string, notesSegments?: TextSegment[]): void;
|
|
9771
|
+
}
|
|
9772
|
+
|
|
9773
|
+
/** Existing-equation edit state with history-integrated OMML replacement. */
|
|
9774
|
+
declare class EditorEquationController {
|
|
9775
|
+
private readonly editor;
|
|
9776
|
+
editingId: string | null;
|
|
9777
|
+
constructor(editor: EditorState);
|
|
9778
|
+
open(id: string): boolean;
|
|
9779
|
+
get omml(): Record<string, unknown> | null;
|
|
9780
|
+
apply(omml: Record<string, unknown>): void;
|
|
9781
|
+
close(): void;
|
|
9782
|
+
}
|
|
9783
|
+
|
|
9784
|
+
/** One-shot Format Painter state and history-integrated application. */
|
|
9785
|
+
declare class EditorFormatPainterController {
|
|
9786
|
+
#private;
|
|
9787
|
+
private readonly editor;
|
|
9788
|
+
constructor(editor: EditorState);
|
|
9789
|
+
get active(): boolean;
|
|
9790
|
+
get enabled(): boolean;
|
|
9791
|
+
toggle(): void;
|
|
9792
|
+
applyTo(id: string): boolean;
|
|
9793
|
+
cancel(): void;
|
|
9794
|
+
}
|
|
9795
|
+
|
|
9796
|
+
/**
|
|
9797
|
+
* The ribbon Draw tab's active tool. `'select'` means "not drawing": the
|
|
9798
|
+
* stage's normal selection/drag/resize gestures own the pointer, matching
|
|
9799
|
+
* React's `DrawingTool` / Angular's `DrawTool` conventions (minus `freeform`,
|
|
9800
|
+
* out of scope for this wave; see the Draw tab's JSDoc).
|
|
9801
|
+
*/
|
|
9802
|
+
type InkDrawTool = 'select' | 'pen' | 'highlighter' | 'eraser';
|
|
9803
|
+
/**
|
|
9804
|
+
* EditorInkController: the ribbon Draw tab's tool/colour/width state plus the
|
|
9805
|
+
* pure element-factory / erase mutations, split out of `EditorState` to keep
|
|
9806
|
+
* it under the repo's 300-LOC budget (mirrors `EditorArrangeController` /
|
|
9807
|
+
* `EditorBackgroundController`). Instantiated as `EditorState.inkOps`.
|
|
9808
|
+
*
|
|
9809
|
+
* The actual pointer-event lifecycle (accumulating a stroke's points, driving
|
|
9810
|
+
* the live preview) lives in `editor-ink-gesture.ts`, owned by
|
|
9811
|
+
* `EditorController`; this class only holds the tool/colour/width state the
|
|
9812
|
+
* gesture controller reads and the two mutations it calls into
|
|
9813
|
+
* ({@link commitStroke}, {@link eraseElementAt}), both of which route through
|
|
9814
|
+
* `EditorState` so they participate in undo/redo like every other edit.
|
|
9815
|
+
*/
|
|
9816
|
+
declare class EditorInkController {
|
|
9817
|
+
#private;
|
|
9818
|
+
/** The active draw tool. `'select'` hands the stage back to normal editing gestures. */
|
|
9819
|
+
tool: InkDrawTool;
|
|
9820
|
+
/** Stroke colour for new pen/highlighter strokes. */
|
|
9821
|
+
color: string;
|
|
9822
|
+
/** Stroke width (px, element space) for new pen/highlighter strokes. */
|
|
9823
|
+
width: number;
|
|
9824
|
+
/** SVG path `d` for the in-progress stroke's live preview, or `''` when idle. */
|
|
9825
|
+
livePathD: string;
|
|
9826
|
+
constructor(editor: EditorState);
|
|
9827
|
+
/** True whenever a tool other than `select` is active: the stage hands pointer gestures to ink drawing. */
|
|
9828
|
+
get isDrawing(): boolean;
|
|
9829
|
+
/**
|
|
9830
|
+
* Switch the active tool. Clears the current selection when entering a draw
|
|
9831
|
+
* tool so the selection overlay's resize/rotate handles (which own their
|
|
9832
|
+
* own `pointerdown` and would otherwise race a drawing gesture over the
|
|
9833
|
+
* same screen area) are not rendered while drawing.
|
|
9834
|
+
*/
|
|
9835
|
+
setTool(tool: InkDrawTool): void;
|
|
9836
|
+
setColor(color: string): void;
|
|
9837
|
+
setWidth(width: number): void;
|
|
9838
|
+
/** Update the live preview path while a pen/highlighter stroke is in progress. */
|
|
9839
|
+
previewStroke(points: readonly InkPoint[]): void;
|
|
9840
|
+
/**
|
|
9841
|
+
* Finalise the in-progress stroke into a new `ink` element (undoable via
|
|
9842
|
+
* `EditorState.insertElement`), or discard it silently when too short (a
|
|
9843
|
+
* plain tap) or the tool changed mid-gesture.
|
|
9844
|
+
*/
|
|
9845
|
+
commitStroke(points: readonly InkPoint[]): void;
|
|
9846
|
+
/**
|
|
9847
|
+
* Hit-test `ink` elements on the current slide at `point` (topmost first)
|
|
9848
|
+
* and delete the first match, with history. No-op when nothing is hit.
|
|
9849
|
+
*/
|
|
9850
|
+
eraseElementAt(point: InkPoint): void;
|
|
9851
|
+
}
|
|
9852
|
+
|
|
9853
|
+
interface MasterViewTarget {
|
|
9854
|
+
tab: MasterViewTab;
|
|
9855
|
+
masterIndex: number;
|
|
9856
|
+
layoutIndex: number | null;
|
|
9857
|
+
}
|
|
9858
|
+
/** Routes the active editing layer into a parsed slide master or layout. */
|
|
9859
|
+
declare class EditorMasterController {
|
|
9860
|
+
private readonly editor;
|
|
9861
|
+
constructor(editor: EditorState);
|
|
9862
|
+
enter(masterIndex?: number, layoutIndex?: number | null): void;
|
|
9863
|
+
enterTab(tab: MasterViewTab): void;
|
|
9864
|
+
exit(): void;
|
|
9865
|
+
activeElements(): PptxElement[] | null;
|
|
9866
|
+
replace(elements: PptxElement[]): boolean;
|
|
9867
|
+
cloneMasters(): PptxSlideMaster[];
|
|
9868
|
+
cloneNotesMaster(): PptxNotesMaster | undefined;
|
|
9869
|
+
cloneHandoutMaster(): PptxHandoutMaster | undefined;
|
|
9870
|
+
setHandoutSlidesPerPage(slidesPerPage: number): void;
|
|
9871
|
+
setBackgroundColor(backgroundColor: string): void;
|
|
9872
|
+
}
|
|
9873
|
+
|
|
9874
|
+
interface PresentationMetadataHost {
|
|
9875
|
+
readonly editable: boolean;
|
|
9876
|
+
pushHistory(): void;
|
|
9877
|
+
commitChange(): void;
|
|
9878
|
+
}
|
|
9879
|
+
/** Owns presentation-level metadata and its undoable editor mutations. */
|
|
9880
|
+
declare class EditorPresentationMetadata {
|
|
9881
|
+
private readonly host;
|
|
9882
|
+
headerFooter: PptxHeaderFooter;
|
|
9883
|
+
presentationProperties: PptxPresentationProperties;
|
|
9884
|
+
customShows: PptxCustomShow[];
|
|
9885
|
+
constructor(host: PresentationMetadataHost);
|
|
9886
|
+
set(headerFooter?: PptxHeaderFooter, presentationProperties?: PptxPresentationProperties, customShows?: PptxCustomShow[]): void;
|
|
9887
|
+
updatePresentationProperties(next: PptxPresentationProperties): void;
|
|
9888
|
+
updateHeaderFooter(next: PptxHeaderFooter): void;
|
|
9889
|
+
updateCustomShows(next: PptxCustomShow[]): void;
|
|
9890
|
+
private commit;
|
|
9891
|
+
}
|
|
9892
|
+
|
|
9893
|
+
/** History-aware section CRUD and grouping for the Svelte editor. */
|
|
9894
|
+
declare class EditorSectionController {
|
|
9895
|
+
private readonly editor;
|
|
9896
|
+
constructor(editor: EditorState);
|
|
9897
|
+
get groups(): SectionSlideGroup<PptxSection>[];
|
|
9898
|
+
add(name: string, afterSlideIndex?: number): string | null;
|
|
9899
|
+
rename(sectionId: string, name: string): void;
|
|
9900
|
+
delete(sectionId: string): void;
|
|
9901
|
+
moveUp(sectionId: string): void;
|
|
9902
|
+
moveDown(sectionId: string): void;
|
|
9903
|
+
moveSlides(slideIndexes: number[], targetSectionId: string): void;
|
|
9904
|
+
toggle(sectionId: string): void;
|
|
9905
|
+
private commit;
|
|
9906
|
+
}
|
|
9907
|
+
|
|
9908
|
+
/**
|
|
9909
|
+
* EditorSelection: the reactive multi-element selection for the Svelte editor.
|
|
9910
|
+
*
|
|
9911
|
+
* Holds an ordered list of selected element ids; the LAST id is the primary
|
|
9912
|
+
* selection (the one the overlay handles, gestures, and inline editing act
|
|
9913
|
+
* on), matching the React binding's `selectedElementIds` + primary convention.
|
|
9914
|
+
* Plain clicks call {@link set} (single selection), shift/ctrl clicks call
|
|
9915
|
+
* {@link toggle} (additive), and mutations that invalidate ids call
|
|
9916
|
+
* {@link prune}.
|
|
9917
|
+
*/
|
|
9918
|
+
declare class EditorSelection {
|
|
9919
|
+
#private;
|
|
9920
|
+
/** All selected ids in selection order (primary last). */
|
|
9921
|
+
get ids(): readonly string[];
|
|
9922
|
+
/** The primary selected id (last selected), or null when empty. */
|
|
9923
|
+
get primary(): string | null;
|
|
9924
|
+
/** Number of selected elements. */
|
|
9925
|
+
get size(): number;
|
|
9926
|
+
/** True when `id` is part of the selection. */
|
|
9927
|
+
has(id: string): boolean;
|
|
9928
|
+
/** Replace the selection with a single id (or clear it with `null`). */
|
|
9929
|
+
set(id: string | null): void;
|
|
9930
|
+
/** Replace the selection with an explicit id list (primary = last). */
|
|
9931
|
+
setAll(ids: readonly string[]): void;
|
|
9932
|
+
/** Additive (shift/ctrl-click) toggle: add `id`, or remove it when present. */
|
|
9933
|
+
toggle(id: string): void;
|
|
9934
|
+
/** Clear the selection. */
|
|
9935
|
+
clear(): void;
|
|
9936
|
+
/** Drop ids that no longer resolve to an element (after remote/undo edits). */
|
|
9937
|
+
prune(exists: (id: string) => boolean): void;
|
|
9938
|
+
}
|
|
9939
|
+
|
|
9940
|
+
/**
|
|
9941
|
+
* The Home tab's Slides group (new / duplicate / delete slide), split out of
|
|
9942
|
+
* `EditorState` to keep it under the repo's 300-LOC budget. Every method
|
|
9943
|
+
* returns the new active slide index (or `null` on a no-op) so the caller
|
|
9944
|
+
* (the Slides group, via the host's slide-navigation callback) can move the
|
|
9945
|
+
* viewer to it; `EditorState` itself has no concept of "the active slide"
|
|
9946
|
+
* beyond the `getCurrent` dependency it already reads for element ops.
|
|
9947
|
+
*/
|
|
9948
|
+
declare class EditorSlidesController {
|
|
9949
|
+
#private;
|
|
9950
|
+
constructor(editor: EditorState);
|
|
9951
|
+
/** Insert a blank slide after the current one. Returns its new index, or null when not editable. */
|
|
9952
|
+
insertSlideAfterCurrent(): number | null;
|
|
9953
|
+
/** Duplicate the current slide. Returns its new index, or null when not editable. */
|
|
9954
|
+
duplicateCurrentSlide(): number | null;
|
|
9955
|
+
/** Delete the current slide. Returns the new active index, or null (not editable / only slide). */
|
|
9956
|
+
deleteCurrentSlide(): number | null;
|
|
9957
|
+
/**
|
|
9958
|
+
* The layouts available for the current slide (its master's layouts),
|
|
9959
|
+
* resolved via the core `getAvailableLayoutsForSlide` API. Empty when no
|
|
9960
|
+
* deck is loaded. Backs the Home tab's Layout dropdown (React parity).
|
|
9961
|
+
*/
|
|
9962
|
+
availableLayouts(): Promise<PptxLayoutOption[]>;
|
|
9963
|
+
/** Re-map the current slide onto `layoutPath`. Returns its index, or null when not editable. */
|
|
9964
|
+
applyLayout(layoutPath: string): Promise<number | null>;
|
|
9965
|
+
/**
|
|
9966
|
+
* Reset the current slide by re-applying its own layout, restoring inherited
|
|
9967
|
+
* placeholder geometry/formatting (React's Home > Reset). Returns the slide
|
|
9968
|
+
* index, or null when the slide has no known layout path.
|
|
9969
|
+
*/
|
|
9970
|
+
resetSlide(): Promise<number | null>;
|
|
9971
|
+
/** Move an arbitrary thumbnail slide. Returns the selected target index on success. */
|
|
9972
|
+
moveSlide(fromIndex: number, toIndex: number): number | null;
|
|
9973
|
+
}
|
|
9974
|
+
|
|
9975
|
+
/** Active-layer routing for normal slide content versus inherited template elements. */
|
|
9976
|
+
declare class EditorTemplateController {
|
|
9977
|
+
#private;
|
|
9978
|
+
constructor(editor: EditorState);
|
|
9979
|
+
activeElements(): PptxElement[];
|
|
9980
|
+
renderedSlides(): PptxSlide[];
|
|
9981
|
+
replace(elements: PptxElement[]): void;
|
|
9982
|
+
commit(elements: PptxElement[]): void;
|
|
9983
|
+
}
|
|
9984
|
+
|
|
9985
|
+
/**
|
|
9986
|
+
* Slide-transition actions for the ribbon's Transitions tab, split out of
|
|
9987
|
+
* `EditorState` to keep it under the repo's 300-LOC budget. Playback already
|
|
9988
|
+
* reads `PptxSlide.transition` (see `presentation/presentation-controller.svelte.ts`),
|
|
9989
|
+
* so this only needs to write that same field, routed through
|
|
9990
|
+
* `EditorState.commitSlides` so it is history-integrated (undoable).
|
|
9991
|
+
*
|
|
9992
|
+
* `applyTransition` covers both the preset gallery buttons and the duration
|
|
9993
|
+
* input (the tab re-applies the currently-selected preset whenever the
|
|
9994
|
+
* duration changes), plus the "Apply to All Slides" checkbox: when
|
|
9995
|
+
* `applyToAll` is true every slide gets the same fresh `{ type, durationMs }`
|
|
9996
|
+
* transition; otherwise only the current slide is patched, preserving any
|
|
9997
|
+
* advanced fields (direction, sound, ...) it already carried.
|
|
9998
|
+
*/
|
|
9999
|
+
declare class EditorTransitionController {
|
|
10000
|
+
#private;
|
|
10001
|
+
constructor(editor: EditorState);
|
|
10002
|
+
applyTransition(type: PptxTransitionType, durationMs: number, applyToAll: boolean): void;
|
|
10003
|
+
}
|
|
10004
|
+
|
|
10005
|
+
interface EditorStateDeps {
|
|
10006
|
+
getCurrent(): number;
|
|
10007
|
+
getHandler(): PptxHandler | null;
|
|
10008
|
+
onChange?: () => void;
|
|
10009
|
+
}
|
|
10010
|
+
declare class EditorState {
|
|
10011
|
+
#private;
|
|
10012
|
+
slides: PptxSlide[];
|
|
10013
|
+
templateElementsBySlideId: TemplateElementMap;
|
|
10014
|
+
slideMasters: PptxSlideMaster[];
|
|
10015
|
+
notesMaster: PptxNotesMaster | undefined;
|
|
10016
|
+
handoutMaster: PptxHandoutMaster | undefined;
|
|
10017
|
+
sections: PptxSection[];
|
|
10018
|
+
readonly presentationMetadata: EditorPresentationMetadata;
|
|
10019
|
+
coreProperties: PptxCoreProperties | undefined;
|
|
10020
|
+
appProperties: PptxAppProperties | undefined;
|
|
10021
|
+
customProperties: PptxCustomProperty[];
|
|
10022
|
+
masterViewTarget: MasterViewTarget | null;
|
|
10023
|
+
readonly selection: EditorSelection;
|
|
10024
|
+
editable: boolean;
|
|
10025
|
+
dirty: boolean;
|
|
10026
|
+
editTemplateMode: boolean;
|
|
10027
|
+
interactionActive: boolean;
|
|
10028
|
+
clipboard: ElementClipboardPayload | null;
|
|
10029
|
+
readonly clipboardOps: EditorClipboardController;
|
|
10030
|
+
readonly elementOps: EditorElementController;
|
|
10031
|
+
readonly templateOps: EditorTemplateController;
|
|
10032
|
+
readonly slidesOps: EditorSlidesController;
|
|
10033
|
+
readonly sectionOps: EditorSectionController;
|
|
10034
|
+
readonly arrangeOps: EditorArrangeController;
|
|
10035
|
+
readonly backgroundOps: EditorBackgroundController;
|
|
10036
|
+
readonly transitionOps: EditorTransitionController;
|
|
10037
|
+
readonly animationOps: EditorAnimationController;
|
|
10038
|
+
readonly inkOps: EditorInkController;
|
|
10039
|
+
readonly masterOps: EditorMasterController;
|
|
10040
|
+
readonly formatPainter: EditorFormatPainterController;
|
|
10041
|
+
readonly equationOps: EditorEquationController;
|
|
10042
|
+
constructor(deps: EditorStateDeps);
|
|
10043
|
+
get canUndo(): boolean;
|
|
10044
|
+
get headerFooter(): PptxHeaderFooter;
|
|
10045
|
+
get presentationProperties(): PptxPresentationProperties;
|
|
10046
|
+
get customShows(): PptxCustomShow[];
|
|
10047
|
+
get canRedo(): boolean;
|
|
10048
|
+
get selectedElementId(): string | null;
|
|
10049
|
+
get selectedElement(): PptxElement | undefined;
|
|
10050
|
+
get selectedElements(): PptxElement[];
|
|
10051
|
+
get activeElements(): PptxElement[];
|
|
10052
|
+
get renderedSlides(): PptxSlide[];
|
|
10053
|
+
get hasClipboard(): boolean;
|
|
10054
|
+
get currentSlideIndex(): number;
|
|
10055
|
+
/** The loaded core handler, or null before a deck is open. Used by the
|
|
10056
|
+
* Slides group for layout switching (`applyLayoutToSlide`). */
|
|
10057
|
+
getHandler(): PptxHandler | null;
|
|
10058
|
+
setSlides(slides: PptxSlide[], slideMasters?: PptxSlideMaster[], notesMaster?: PptxNotesMaster, handoutMaster?: PptxHandoutMaster, sections?: PptxSection[], coreProperties?: PptxCoreProperties, appProperties?: PptxAppProperties, customProperties?: PptxCustomProperty[], headerFooter?: PptxHeaderFooter, presentationProperties?: PptxPresentationProperties, customShows?: PptxCustomShow[]): void;
|
|
10059
|
+
/**
|
|
10060
|
+
* Replace the working slides with a remote (collaboration) snapshot without
|
|
10061
|
+
* recording an undo step or touching the dirty flag: the granular reconcile
|
|
10062
|
+
* already merged the peer's change, and treating an incoming remote edit as
|
|
10063
|
+
* a local mutation would both pollute the undo stack and re-broadcast it.
|
|
10064
|
+
*
|
|
10065
|
+
* Selection is preserved when the selected element still exists so a remote
|
|
10066
|
+
* edit does not yank the local user's selection out from under them. Local
|
|
10067
|
+
* undo history is intentionally kept (see the collaboration module JSDoc):
|
|
10068
|
+
* shared defines no collaborative-undo semantics, so, matching React/Vue,
|
|
10069
|
+
* local undo may fight a concurrent remote edit.
|
|
10070
|
+
*/
|
|
10071
|
+
applyRemoteSlides(slides: PptxSlide[]): void;
|
|
10072
|
+
reset(): void;
|
|
10073
|
+
select(id: string | null): void;
|
|
10074
|
+
isElementInteractive(id: string): boolean;
|
|
10075
|
+
setTemplateEditing(enabled: boolean): void;
|
|
10076
|
+
/**
|
|
10077
|
+
* Apply the File > Options "maximum number of undos" value. Recreates the
|
|
10078
|
+
* history stack when the depth changes (PowerPoint likewise applies the new
|
|
10079
|
+
* maximum going forward; existing entries are dropped).
|
|
10080
|
+
*/
|
|
10081
|
+
setHistoryDepth(depth: number): void;
|
|
10082
|
+
pushHistory(): void;
|
|
10083
|
+
commitChange(): void;
|
|
10084
|
+
/** Patch geometry without history for live gesture preview frames. */
|
|
10085
|
+
patchGeometry: (id: string, box: ElementBoxPatch) => void;
|
|
10086
|
+
replaceActiveElements(elements: PptxElement[]): void;
|
|
10087
|
+
/** Commit a replacement active element collection as one undo step. */
|
|
10088
|
+
commitActiveElements(elements: PptxElement[]): void;
|
|
10089
|
+
/**
|
|
10090
|
+
* Replace the whole slide array with history (the generic multi-slide
|
|
10091
|
+
* mutation entry point: slide add/duplicate/delete, arrange group ops,
|
|
10092
|
+
* and find/replace all route through this so every change is a single
|
|
10093
|
+
* undoable step). No-op when not editable.
|
|
10094
|
+
*/
|
|
10095
|
+
commitSlides(next: PptxSlide[]): void;
|
|
10096
|
+
deleteSelected: () => void;
|
|
10097
|
+
duplicateSelected: () => string | null;
|
|
10098
|
+
applyElementPatch: (id: string, patch: Partial<PptxElement>) => void;
|
|
10099
|
+
patchSelected: (patch: Partial<PptxElement>) => void;
|
|
10100
|
+
insertElement: (element: PptxElement) => string | null;
|
|
10101
|
+
reorderSelected: (direction: ZOrderDirection) => void;
|
|
10102
|
+
nudgeSelected: (dx: number, dy: number) => void;
|
|
10103
|
+
commitInlineText: (id: string, text: string) => void;
|
|
10104
|
+
commitNotes: (notes: string, notesSegments?: TextSegment[]) => void;
|
|
10105
|
+
updateDocumentProperties(core: PptxCoreProperties, app: PptxAppProperties, custom: PptxCustomProperty[]): void;
|
|
10106
|
+
undo(): void;
|
|
10107
|
+
redo(): void;
|
|
10108
|
+
save(format?: PptxSaveFormat): Promise<Uint8Array>;
|
|
10109
|
+
}
|
|
10110
|
+
|
|
10111
|
+
declare class EditorController {
|
|
10112
|
+
#private;
|
|
10113
|
+
snapLines: readonly SnapLine[];
|
|
10114
|
+
editingId: string | null;
|
|
10115
|
+
marquee: EditorMarqueeRect | null;
|
|
10116
|
+
constructor(editor: EditorState, deps: EditorControllerDeps);
|
|
10117
|
+
get overlayBox(): OverlayBox | null;
|
|
10118
|
+
get editing(): boolean;
|
|
10119
|
+
get selectionCount(): number;
|
|
10120
|
+
get editingElement(): PptxElement | undefined;
|
|
10121
|
+
/** True when editing owns the keyboard (a selection or inline edit is live). */
|
|
10122
|
+
capturesKeyboard(): boolean;
|
|
10123
|
+
onStagePointerDown: (event: PointerEvent) => void;
|
|
10124
|
+
onStagePointerMove: (event: PointerEvent) => void;
|
|
10125
|
+
onStageDblClick: (event: MouseEvent) => void;
|
|
10126
|
+
/** Select the right-clicked element and expose the edit context menu. */
|
|
10127
|
+
onStageContextMenu: (event: MouseEvent) => void;
|
|
10128
|
+
onHandlePointerDown: (handle: ResizeHandleId, event: PointerEvent) => void;
|
|
10129
|
+
onRotatePointerDown: (event: PointerEvent) => void;
|
|
10130
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
10131
|
+
/** Open the inline text editor over `id` when the element carries text. */
|
|
10132
|
+
enterInlineEdit(id: string): void;
|
|
10133
|
+
/**
|
|
10134
|
+
* Mirror the in-progress inline text to collaborators. Touches no editor
|
|
10135
|
+
* state or history: the commit path stays the single source of truth.
|
|
10136
|
+
*/
|
|
10137
|
+
previewInline(id: string, text: string): void;
|
|
10138
|
+
/** Commit the inline editor's text onto the element and close it. */
|
|
10139
|
+
commitInline(id: string, text: string): void;
|
|
10140
|
+
/** Close the inline editor without further mutation. */
|
|
10141
|
+
closeInline(): void;
|
|
10142
|
+
/** Tear down window listeners (component destroy). */
|
|
10143
|
+
destroy(): void;
|
|
10144
|
+
}
|
|
10145
|
+
|
|
10146
|
+
/**
|
|
10147
|
+
* ExportUiState: reactive state behind the toolbar `ExportMenu` and the
|
|
10148
|
+
* `ExportProgressModal`. Svelte port of Vue's `useExportProgress` composable:
|
|
10149
|
+
* it owns the modal state (open / title / progress / status), the
|
|
10150
|
+
* `AbortController` the export loops check between slides, and wraps each
|
|
10151
|
+
* multi-slide export (PDF / GIF / WebM) in a `begin -> run -> end` envelope.
|
|
10152
|
+
* All percentage maths + status labels come from `pptx-viewer-shared`
|
|
10153
|
+
* (`export-progress.ts`) so every binding shows identical progress.
|
|
10154
|
+
*
|
|
10155
|
+
* PNG (single slide, fast) and print (opens its own surface) run without the
|
|
10156
|
+
* modal; the menu trigger still disables via {@link exporting} while they run.
|
|
10157
|
+
*/
|
|
10158
|
+
interface ExportUiDeps {
|
|
10159
|
+
controller: ExportController;
|
|
10160
|
+
getTranslator(): Translator;
|
|
10161
|
+
/**
|
|
10162
|
+
* Fired after an export completes successfully (Options > Accessibility
|
|
10163
|
+
* "feedback with sound" hook); not called on abort or failure.
|
|
10164
|
+
*/
|
|
10165
|
+
onComplete?(): void;
|
|
10166
|
+
}
|
|
10167
|
+
declare class ExportUiState {
|
|
10168
|
+
#private;
|
|
10169
|
+
/** Whether the progress modal is visible. */
|
|
10170
|
+
open: boolean;
|
|
10171
|
+
/** Modal heading (e.g. "Export as PDF"). */
|
|
10172
|
+
title: string;
|
|
10173
|
+
/** Current progress, 0-100. */
|
|
10174
|
+
progress: number;
|
|
10175
|
+
/** Status line under the bar (e.g. "Rendering slide 3 of 10..."). */
|
|
10176
|
+
status: string;
|
|
10177
|
+
constructor(deps: ExportUiDeps);
|
|
10178
|
+
/** True while any export runs (disables the menu trigger). */
|
|
10179
|
+
get exporting(): boolean;
|
|
10180
|
+
/** Export the current slide as PNG (no modal; quick single capture). */
|
|
10181
|
+
runPng(): void;
|
|
10182
|
+
/** Copy the current slide to the system image clipboard. */
|
|
10183
|
+
runCopyImage(): void;
|
|
10184
|
+
/** Run the PDF export with the progress modal wired. */
|
|
10185
|
+
runPdf(): Promise<void>;
|
|
10186
|
+
/** Run the animated-GIF export with the progress modal wired. */
|
|
10187
|
+
runGif(): Promise<void>;
|
|
10188
|
+
/** Run the WebM video export with the progress modal wired. */
|
|
10189
|
+
runVideo(): Promise<void>;
|
|
10190
|
+
/** Run the print flow (no modal; the print surface takes over). */
|
|
10191
|
+
runPrint(options?: PrintOptions): void;
|
|
10192
|
+
/** Cancel the in-flight export (aborts the loop, closes the modal). */
|
|
10193
|
+
cancel(): void;
|
|
10194
|
+
}
|
|
10195
|
+
|
|
10196
|
+
/**
|
|
10197
|
+
* autosave.svelte.ts: debounced crash-recovery autosave for the Svelte viewer.
|
|
10198
|
+
*
|
|
10199
|
+
* A runes port that fuses the two shared semantics the other bindings use:
|
|
10200
|
+
* - React's persistence target: each successful save writes the serialized
|
|
10201
|
+
* `.pptx` bytes to the shared IndexedDB recovery store
|
|
10202
|
+
* (`saveAutosaveSnapshot`, keyed by `filePath`), so a host can offer
|
|
10203
|
+
* restore-on-load with `getAutosaveSnapshot` / `listAutosaveSnapshots`
|
|
10204
|
+
* (both re-exported from this package). This binding does NOT auto-restore;
|
|
10205
|
+
* matching React/Vue, recovery is a host concern.
|
|
10206
|
+
* - Vue's debounce-on-edit trigger: an edit marks the document dirty and
|
|
10207
|
+
* (re)arms a debounce timer instead of polling on a fixed interval.
|
|
10208
|
+
*
|
|
10209
|
+
* The controller registers its own edit-watching `$effect` in the constructor,
|
|
10210
|
+
* so the SFC only has to construct it once during setup and read its reactive
|
|
10211
|
+
* `status` / `isDirty` for the toolbar indicator.
|
|
10212
|
+
*/
|
|
10213
|
+
/**
|
|
10214
|
+
* Autosave status, surfaced for the toolbar status pill.
|
|
10215
|
+
*
|
|
10216
|
+
* - `idle` : nothing has been saved yet (or no edits since mount).
|
|
10217
|
+
* - `disabled` : autosave is inactive (off, not editable, or no file path).
|
|
10218
|
+
* - `saving` : a save is currently in flight.
|
|
10219
|
+
* - `saved` : the most recent save succeeded.
|
|
10220
|
+
* - `error` : the most recent save threw.
|
|
10221
|
+
*/
|
|
10222
|
+
type AutosaveStatus = 'idle' | 'disabled' | 'saving' | 'saved' | 'error';
|
|
10223
|
+
interface AutosaveDeps {
|
|
10224
|
+
/** Master on/off: host `autosave` prop AND editing allowed. */
|
|
10225
|
+
getEnabled: () => boolean;
|
|
10226
|
+
/** Debounce window in milliseconds. */
|
|
10227
|
+
getIntervalMs: () => number;
|
|
10228
|
+
/** IndexedDB record key (host `filePath`); autosave is disabled without one. */
|
|
10229
|
+
getFilePath: () => string | undefined;
|
|
10230
|
+
/** The current editable slides (watched for edits). */
|
|
10231
|
+
getSlides: () => PptxSlide[];
|
|
10232
|
+
getSlideMasters?: () => PptxSlideMaster[];
|
|
10233
|
+
getNotesMaster?: () => PptxNotesMaster | undefined;
|
|
10234
|
+
getHandoutMaster?: () => PptxHandoutMaster | undefined;
|
|
10235
|
+
getSections?: () => PptxSection[];
|
|
10236
|
+
/** The live core handler used to serialize slides to `.pptx` bytes. */
|
|
10237
|
+
getHandler: () => PptxHandler | null;
|
|
10238
|
+
/**
|
|
10239
|
+
* Monotonic load counter: a change means a fresh presentation was seeded (not
|
|
10240
|
+
* a user edit), so the watcher clears dirty instead of arming a save.
|
|
10241
|
+
*/
|
|
10242
|
+
getLoadCount: () => number;
|
|
10243
|
+
/** Host callback with the freshly-serialized bytes on each successful save. */
|
|
10244
|
+
onSaved?: (bytes: Uint8Array) => void;
|
|
10245
|
+
}
|
|
10246
|
+
declare class AutosaveController {
|
|
10247
|
+
#private;
|
|
10248
|
+
/** Current autosave lifecycle status (reactive). */
|
|
10249
|
+
status: AutosaveStatus;
|
|
10250
|
+
/** Whether there are unsaved edits pending (reactive). */
|
|
10251
|
+
isDirty: boolean;
|
|
10252
|
+
/** Epoch ms of the last successful save, or null (reactive). */
|
|
10253
|
+
lastSavedAt: number | null;
|
|
10254
|
+
constructor(deps: AutosaveDeps);
|
|
10255
|
+
/** Force an immediate save, bypassing the debounce window. */
|
|
10256
|
+
save(): Promise<void>;
|
|
10257
|
+
}
|
|
10258
|
+
|
|
10259
|
+
interface SlideCanvasProps {
|
|
10260
|
+
slide: PptxSlide | undefined;
|
|
10261
|
+
canvasSize: CanvasSize;
|
|
10262
|
+
mediaDataUrls: Map<string, string>;
|
|
10263
|
+
/** Effective scale (fit-to-viewport x user zoom), pre-computed by the host. */
|
|
10264
|
+
scale: number;
|
|
10265
|
+
/** True only on the live presentation stage; see `SlideStageProps.presenting`. */
|
|
10266
|
+
presenting?: boolean;
|
|
10267
|
+
/** True while in-place editing is available; gates the pointer handlers and the editing cursor/class. */
|
|
10268
|
+
editingActive?: boolean;
|
|
10269
|
+
editTemplateMode?: boolean;
|
|
10270
|
+
ontablecellcommit?: (elementId: string, rowIndex: number, cellIndex: number, text: string) => void;
|
|
10271
|
+
onsmartartnodecommit?: (elementId: string, nodeId: string, text: string) => void;
|
|
10272
|
+
onsmartartnodefill?: (elementId: string, nodeId: string, fill: string) => void;
|
|
10273
|
+
/** Reports the stage-holder node to the host on mount/teardown (editing hit-surface, export capture anchor). */
|
|
10274
|
+
onstageholder?: (el: HTMLDivElement | null) => void;
|
|
10275
|
+
onstagepointerdown?: (event: PointerEvent) => void;
|
|
10276
|
+
onstagepointermove?: (event: PointerEvent) => void;
|
|
10277
|
+
onstagedblclick?: (event: MouseEvent) => void;
|
|
10278
|
+
onstagecontextmenu?: (event: MouseEvent) => void;
|
|
10279
|
+
/** Fired on any stage click; the host wires this to advance presentation playback. */
|
|
10280
|
+
onstageclick?: (event: MouseEvent) => void;
|
|
10281
|
+
/**
|
|
10282
|
+
* True while the AI panel is picking an element: the next element click(s)
|
|
10283
|
+
* become the assistant's focus (highlighted) instead of selecting / editing.
|
|
10284
|
+
*/
|
|
10285
|
+
aiPickMode?: boolean;
|
|
10286
|
+
/**
|
|
10287
|
+
* True while a running AI tool is active: the stage marks itself
|
|
10288
|
+
* `data-pptx-ai-active` so element colour changes tween while the assistant
|
|
10289
|
+
* works (see AiFocusHighlightOverlay's tween rule).
|
|
10290
|
+
*/
|
|
10291
|
+
aiActive?: boolean;
|
|
10292
|
+
/** Route a picked canvas element to the AI focus (pick mode only). */
|
|
10293
|
+
onaipickelement?: (elementId: string) => void;
|
|
10294
|
+
/**
|
|
10295
|
+
* Overlay content layered above the slide (selection/editor layer, ink
|
|
10296
|
+
* drawing, alignment guides, presentation annotations, collaboration
|
|
10297
|
+
* cursors, transition overlay, ...). Rendered inside the same
|
|
10298
|
+
* fixed-size, scaled stage-holder as the slide itself. Kept out of this
|
|
10299
|
+
* component's own props (rather than a fixed list of overlay slots) so it
|
|
10300
|
+
* stays free of the live editor/controller instances those overlays need.
|
|
10301
|
+
*/
|
|
10302
|
+
children?: svelte.Snippet;
|
|
10303
|
+
}
|
|
10304
|
+
interface ViewerToolbarProps {
|
|
10305
|
+
/** Active slide (0-based). */
|
|
10306
|
+
current: number;
|
|
10307
|
+
total: number;
|
|
10308
|
+
/** Currently-effective zoom percent (rounded). */
|
|
10309
|
+
zoomPercent: number;
|
|
10310
|
+
isFullscreen: boolean;
|
|
10311
|
+
onprev: () => void;
|
|
10312
|
+
onnext: () => void;
|
|
10313
|
+
onzoomin: () => void;
|
|
10314
|
+
onzoomout: () => void;
|
|
10315
|
+
onzoomfit: () => void;
|
|
10316
|
+
onfullscreen: () => void;
|
|
10317
|
+
/** Whether the Notes toggle button is shown (host has a notes panel). */
|
|
10318
|
+
showNotes?: boolean;
|
|
10319
|
+
/** Whether the notes panel is currently expanded (drives the pressed state). */
|
|
10320
|
+
notesExpanded?: boolean;
|
|
10321
|
+
onnotestoggle?: () => void;
|
|
10322
|
+
/** Show the editing action group (Undo / Redo / Save). Default false. */
|
|
10323
|
+
editable?: boolean;
|
|
10324
|
+
/** Whether an undo step is available (drives the Undo button's disabled state). */
|
|
10325
|
+
canUndo?: boolean;
|
|
10326
|
+
/** Whether a redo step is available (drives the Redo button's disabled state). */
|
|
10327
|
+
canRedo?: boolean;
|
|
10328
|
+
/** Whether there are unsaved edits (drives the Save button's emphasis). */
|
|
10329
|
+
dirty?: boolean;
|
|
10330
|
+
onundo?: () => void;
|
|
10331
|
+
onredo?: () => void;
|
|
10332
|
+
onsave?: () => void;
|
|
10333
|
+
ondownload?: () => void;
|
|
10334
|
+
/**
|
|
10335
|
+
* Autosave lifecycle status; when set (host opted into `autosave`) a small
|
|
10336
|
+
* status pill renders in the editing group. Omit to hide the pill entirely.
|
|
10337
|
+
*/
|
|
10338
|
+
autosaveStatus?: AutosaveStatus;
|
|
10339
|
+
/** Whether there are unsaved autosave edits (drives the pill's "dirty" tone). */
|
|
10340
|
+
autosaveDirty?: boolean;
|
|
10341
|
+
/**
|
|
10342
|
+
* Export menu state (PNG / PDF / GIF / video / print). When set, the
|
|
10343
|
+
* toolbar renders the `ExportMenu` dropdown in its right-hand group,
|
|
10344
|
+
* matching the export affordance the React/Vue/Angular chrome exposes.
|
|
10345
|
+
* Omit to hide the menu (e.g. while no presentation is loaded).
|
|
10346
|
+
*/
|
|
10347
|
+
exportUi?: ExportUiState;
|
|
10348
|
+
/** Opens the Share (collaboration) dialog. Omit to hide the button. */
|
|
10349
|
+
onshare?: () => void;
|
|
10350
|
+
/** Opens the Broadcast dialog. Omit to hide the button. */
|
|
10351
|
+
onbroadcast?: () => void;
|
|
10352
|
+
/** Whether a collaboration session is currently active (highlights the Share button). */
|
|
10353
|
+
collabActive?: boolean;
|
|
10354
|
+
/** Toolbar buttons to hide; see `PowerPointViewerProps.hiddenActions`. Default undefined: nothing hidden. */
|
|
10355
|
+
hiddenActions?: ToolbarActionId[];
|
|
10356
|
+
}
|
|
10357
|
+
|
|
10358
|
+
/**
|
|
10359
|
+
* Reactive Find & Replace panel state for the Home tab's Editing group.
|
|
10360
|
+
* Wraps the shared, framework-agnostic `render/find-replace` functions
|
|
10361
|
+
* (pure slide-array search/replace); this class owns only the panel's UI
|
|
10362
|
+
* state (query, current match, open/closed) and routes every replace through
|
|
10363
|
+
* the host's history-tracked commit so undo/redo cover it.
|
|
10364
|
+
*/
|
|
10365
|
+
interface FindReplaceDeps {
|
|
10366
|
+
getSlides(): readonly PptxSlide[];
|
|
10367
|
+
/** Commit a fully-replaced slide array (pushes history, marks dirty). */
|
|
10368
|
+
commitSlides(next: PptxSlide[]): void;
|
|
10369
|
+
/** Called with the match's slide/element so the host can navigate to it. */
|
|
10370
|
+
onNavigate?(slideIndex: number, elementId: string): void;
|
|
10371
|
+
}
|
|
10372
|
+
declare class FindReplaceState {
|
|
10373
|
+
#private;
|
|
10374
|
+
open: boolean;
|
|
10375
|
+
query: string;
|
|
10376
|
+
replacement: string;
|
|
10377
|
+
matchCase: boolean;
|
|
10378
|
+
results: FindResult[];
|
|
10379
|
+
index: number;
|
|
10380
|
+
constructor(deps: FindReplaceDeps);
|
|
10381
|
+
get hasResults(): boolean;
|
|
10382
|
+
get matchCount(): number;
|
|
10383
|
+
toggle(): void;
|
|
10384
|
+
close(): void;
|
|
10385
|
+
/** Re-run the search from the current query/matchCase and jump to the first match. */
|
|
10386
|
+
search(): void;
|
|
10387
|
+
next(): void;
|
|
10388
|
+
prev(): void;
|
|
10389
|
+
/** Replace the current match, then refresh the result set. */
|
|
10390
|
+
replaceCurrent(): void;
|
|
10391
|
+
/** Replace every match of the current query, then refresh the result set. */
|
|
10392
|
+
replaceAll(): void;
|
|
10393
|
+
}
|
|
10394
|
+
|
|
10395
|
+
/**
|
|
10396
|
+
* ChromeUiState: reactive open/collapsed state for the editing chrome's side
|
|
10397
|
+
* panels, mirroring React's `useViewerState` flags (`isSidebarCollapsed`,
|
|
10398
|
+
* `isInspectorPaneOpen`, `inspectorTab`). Owned by `PowerPointViewer` and
|
|
10399
|
+
* threaded to both the ribbon's primary row (the toggle buttons) and
|
|
10400
|
+
* `ViewerBody` (which gates the thumbnail rail and inspector pane on it).
|
|
10401
|
+
*/
|
|
10402
|
+
/** The inspector pane's tab strip, matching React's `InspectorTab`. */
|
|
10403
|
+
type InspectorTabId = 'elements' | 'properties' | 'comments';
|
|
10404
|
+
declare class ChromeUiState {
|
|
10405
|
+
/** Left thumbnail rail visibility (React: `isSidebarCollapsed`). */
|
|
10406
|
+
sidebarCollapsed: boolean;
|
|
10407
|
+
/** Right inspector pane visibility (React: `isInspectorPaneOpen`). */
|
|
10408
|
+
inspectorOpen: boolean;
|
|
10409
|
+
/** Active inspector tab (React defaults to Properties). */
|
|
10410
|
+
inspectorTab: InspectorTabId;
|
|
10411
|
+
toggleSidebar(): void;
|
|
10412
|
+
toggleInspector(): void;
|
|
10413
|
+
setInspectorTab(tab: InspectorTabId): void;
|
|
10414
|
+
/** Comments toolbar button: toggle the inspector's Comments tab. */
|
|
10415
|
+
toggleComments(): void;
|
|
10416
|
+
/** True when the inspector is showing the Comments tab. */
|
|
10417
|
+
get commentsOpen(): boolean;
|
|
10418
|
+
}
|
|
10419
|
+
|
|
10420
|
+
/**
|
|
10421
|
+
* Prop contracts for the ribbon shell and its tabs. Kept in a plain `.ts`
|
|
10422
|
+
* module per repo convention: SFCs stay thin presentation, types live in
|
|
10423
|
+
* lintable TypeScript files.
|
|
10424
|
+
*/
|
|
10425
|
+
interface RibbonProps {
|
|
10426
|
+
fileName?: string;
|
|
10427
|
+
/** History-tracked editor state; Home/Insert tab groups read/write it directly. */
|
|
10428
|
+
editor: EditorState;
|
|
10429
|
+
/** Reactive Find & Replace panel state, owned by the host so it can navigate the viewer. */
|
|
10430
|
+
findReplace: FindReplaceState;
|
|
10431
|
+
/** Slide canvas size (px); the Insert tab centres new charts/media/SmartArt/etc. on it. */
|
|
10432
|
+
canvasSize: CanvasSize;
|
|
10433
|
+
/** Read-only deck: the full ribbon still renders (React parity) but a
|
|
10434
|
+
read-only badge shows in the primary row and edits are inert. */
|
|
10435
|
+
readOnly?: boolean;
|
|
10436
|
+
/** Compact nav row (always visible): active slide (0-based) / total. */
|
|
10437
|
+
current: number;
|
|
10438
|
+
total: number;
|
|
10439
|
+
onprev: () => void;
|
|
10440
|
+
onnext: () => void;
|
|
10441
|
+
/** Move the viewer to a specific slide index (the Home tab's Slides group). */
|
|
10442
|
+
onnavigateslide: (index: number) => void;
|
|
10443
|
+
/** Primary row: undo/redo/save/download + autosave pill. */
|
|
10444
|
+
canUndo: boolean;
|
|
10445
|
+
canRedo: boolean;
|
|
10446
|
+
dirty: boolean;
|
|
10447
|
+
onundo: () => void;
|
|
10448
|
+
onredo: () => void;
|
|
10449
|
+
onsave: () => void;
|
|
10450
|
+
ondownload: () => void;
|
|
10451
|
+
ondownloadppsx: () => void;
|
|
10452
|
+
ondownloadpptm: () => void;
|
|
10453
|
+
onpackage: () => void;
|
|
10454
|
+
onversionhistory: () => void;
|
|
10455
|
+
hasMacros: boolean;
|
|
10456
|
+
embeddedFontNames: string[];
|
|
10457
|
+
hasDigitalSignatures: boolean;
|
|
10458
|
+
digitalSignatureCount: number;
|
|
10459
|
+
isPasswordProtected: boolean;
|
|
10460
|
+
autosaveStatus?: AutosaveStatus;
|
|
10461
|
+
autosaveDirty?: boolean;
|
|
10462
|
+
/** Collaboration entry points: Share on the tab row, broadcast in the Present dropdown (React parity). */
|
|
10463
|
+
onshare?: () => void;
|
|
10464
|
+
onbroadcast?: () => void;
|
|
10465
|
+
collabActive?: boolean;
|
|
10466
|
+
/** Side-panel (slides rail / inspector) open state + toggles for the primary row. */
|
|
10467
|
+
chromeUi?: ChromeUiState;
|
|
10468
|
+
/** Whether live subtitles are currently enabled (Present dropdown checkmark). */
|
|
10469
|
+
subtitlesEnabled?: boolean;
|
|
10470
|
+
/** Toggle the AI assistant panel. Only wired when the viewer's `ai` prop is set. */
|
|
10471
|
+
onai?: () => void;
|
|
10472
|
+
/** Whether the AI assistant panel is currently open (primary-row toggle state). */
|
|
10473
|
+
aiActive?: boolean;
|
|
10474
|
+
/** Toolbar buttons/ribbon tabs to hide; see `PowerPointViewerProps.hiddenActions`. */
|
|
10475
|
+
hiddenActions?: ToolbarActionId[];
|
|
10476
|
+
/** Slide Show tab actions: enter presentation from slide 0 or the current slide. */
|
|
10477
|
+
onfrombeginning: () => void;
|
|
10478
|
+
onfromcurrent: () => void;
|
|
10479
|
+
onpresenter: () => void;
|
|
10480
|
+
onsetupslideshow: () => void;
|
|
10481
|
+
onheaderfooter: () => void;
|
|
10482
|
+
oncompare: () => void;
|
|
10483
|
+
onshortcuts: () => void;
|
|
10484
|
+
onsettings: () => void;
|
|
10485
|
+
onprintsettings: () => void;
|
|
10486
|
+
onrehearse: () => void;
|
|
10487
|
+
onrecordfrombeginning: () => void;
|
|
10488
|
+
onrecordfromcurrent: () => void;
|
|
10489
|
+
onsubtitles: () => void;
|
|
10490
|
+
oncustomshows: () => void;
|
|
10491
|
+
onselectionpane: () => void;
|
|
10492
|
+
onslidesorter: () => void;
|
|
10493
|
+
preferences: ViewerPreferences;
|
|
10494
|
+
onpreferenceschange: (preferences: ViewerPreferences) => void;
|
|
10495
|
+
showGuides: boolean;
|
|
10496
|
+
onshowguideschange: (show: boolean) => void;
|
|
10497
|
+
snapToShape: boolean;
|
|
10498
|
+
onsnapToShapechange: (enabled: boolean) => void;
|
|
10499
|
+
onaddguide: (axis: 'h' | 'v') => void;
|
|
10500
|
+
/** Review tab: presentation-wide accessibility audit and issue navigation. */
|
|
10501
|
+
slides: readonly PptxSlide[];
|
|
10502
|
+
onnavigatetoissue: (slideIndex: number, elementId?: string) => void;
|
|
10503
|
+
/** View tab: zoom / fullscreen / notes toggle. */
|
|
10504
|
+
zoomPercent: number;
|
|
10505
|
+
onzoomin: () => void;
|
|
10506
|
+
onzoomout: () => void;
|
|
10507
|
+
onzoomfit: () => void;
|
|
10508
|
+
isFullscreen: boolean;
|
|
10509
|
+
onfullscreen: () => void;
|
|
10510
|
+
showNotes?: boolean;
|
|
10511
|
+
notesExpanded?: boolean;
|
|
10512
|
+
onnotestoggle?: () => void;
|
|
10513
|
+
/** Opens the dedicated slide-master and layout navigation workspace. */
|
|
10514
|
+
onentermasterview?: () => void;
|
|
10515
|
+
/** File tab: export menu (PNG / PDF / GIF / video / print). */
|
|
10516
|
+
exportUi?: ExportUiState;
|
|
10517
|
+
onopenfile?: () => void;
|
|
10518
|
+
onopenrecent?: (key: string) => void;
|
|
10519
|
+
/**
|
|
10520
|
+
* Design tab: the current effective viewer-chrome theme (for highlighting
|
|
10521
|
+
* the active swatch) and the setter its gallery calls to switch presets.
|
|
10522
|
+
*/
|
|
10523
|
+
theme: ViewerTheme | undefined;
|
|
10524
|
+
onsettheme: (theme: ViewerTheme | undefined) => void;
|
|
10525
|
+
/** File tab > Account: disabled-by-default sign-in hook point. */
|
|
10526
|
+
accountAuth?: AccountAuthConfig;
|
|
10527
|
+
}
|
|
10528
|
+
|
|
10529
|
+
/**
|
|
10530
|
+
* Explicitly-typed public exports of the standalone view components.
|
|
10531
|
+
*
|
|
10532
|
+
* Same rationale as `PowerPointViewer` in `../component.ts`: `svelte-check`
|
|
10533
|
+
* types `.svelte` imports precisely, but the plain TypeScript pass that emits
|
|
10534
|
+
* the published declaration files resolves `.svelte` modules through a loose
|
|
10535
|
+
* ambient shim (`src/shims-svelte.d.ts`), and the post-build Rollup
|
|
10536
|
+
* declaration bundling cannot resolve a raw `.svelte` specifier at all (no
|
|
10537
|
+
* `.svelte.d.ts` is emitted, which broke the library build on CI). Re-export
|
|
10538
|
+
* through annotated constants so the published `.d.ts` is fully typed and
|
|
10539
|
+
* free of `.svelte` specifiers.
|
|
10540
|
+
*/
|
|
10541
|
+
declare const Ribbon: Component<RibbonProps>;
|
|
10542
|
+
declare const ViewerToolbar: Component<ViewerToolbarProps>;
|
|
10543
|
+
declare const SlideCanvas: Component<SlideCanvasProps>;
|
|
10544
|
+
|
|
10545
|
+
/** Live editor accessors the bridge closes over (all read from viewer runes). */
|
|
10546
|
+
interface SvelteAiBridgeDeps {
|
|
10547
|
+
/** The editable slides array (the single source of truth the AI mutates). */
|
|
10548
|
+
getSlides(): PptxSlide[];
|
|
10549
|
+
/** Zero-based index of the active slide. */
|
|
10550
|
+
getActiveSlideIndex(): number;
|
|
10551
|
+
/** Slide canvas size in CSS pixels. */
|
|
10552
|
+
getCanvasSize(): {
|
|
10553
|
+
width: number;
|
|
10554
|
+
height: number;
|
|
10555
|
+
};
|
|
10556
|
+
/** The resolved presentation theme, when available. */
|
|
10557
|
+
getTheme(): PptxTheme | undefined;
|
|
10558
|
+
/** The loaded core handler, or null before a deck is open. */
|
|
10559
|
+
getHandler(): PptxHandler | null;
|
|
10560
|
+
/** Optional display file name, used as a friendly deck title. */
|
|
10561
|
+
getFileName(): string | undefined;
|
|
10562
|
+
/** Navigate the viewer to a slide by zero-based index. */
|
|
10563
|
+
goToSlide(index: number): void;
|
|
10564
|
+
/** Select elements on a slide (navigates first when off-slide). */
|
|
10565
|
+
selectElements(slideIndex: number, elementIds: string[]): void;
|
|
10566
|
+
/**
|
|
10567
|
+
* Install a new slides array as ONE undoable history entry. The
|
|
10568
|
+
* implementation is responsible for ensuring the editor is editable (so the
|
|
10569
|
+
* commit is not silently dropped) before recording the step.
|
|
10570
|
+
*/
|
|
10571
|
+
commitSlides(next: PptxSlide[], label: string): void;
|
|
10572
|
+
/** Apply partial theme updates (colour/font scheme) and re-render. */
|
|
10573
|
+
applyTheme(updates: Partial<PptxTheme>): void;
|
|
10574
|
+
/** Optional host notification sink (status line / toast / console). */
|
|
10575
|
+
notify?(message: string, level?: PptxAiNotifyLevel): void;
|
|
10576
|
+
/** Deck sections (editor-tracked, undoable). */
|
|
10577
|
+
getSections(): PptxSection[];
|
|
10578
|
+
/** Deck-wide slide-show / print settings (editor-tracked, undoable). */
|
|
10579
|
+
getPresentationProperties(): PptxPresentationProperties;
|
|
10580
|
+
/** Document core properties (Title / Author / ...), when present. */
|
|
10581
|
+
getCoreProperties(): PptxCoreProperties | undefined;
|
|
10582
|
+
/** Application properties (Company / Application), when present. */
|
|
10583
|
+
getAppProperties(): PptxAppProperties | undefined;
|
|
10584
|
+
/** Custom document-property list (editor-tracked, undoable). */
|
|
10585
|
+
getCustomProperties(): PptxCustomProperty[];
|
|
10586
|
+
/** Resize the slide canvas (loader value + editor history entry). */
|
|
10587
|
+
setCanvasSize(size: {
|
|
10588
|
+
width: number;
|
|
10589
|
+
height: number;
|
|
10590
|
+
}): void;
|
|
10591
|
+
/** Replace the section list. */
|
|
10592
|
+
setSections(sections: PptxSection[]): void;
|
|
10593
|
+
/** Replace the deck-wide presentation properties. */
|
|
10594
|
+
setPresentationProperties(props: PptxPresentationProperties): void;
|
|
10595
|
+
/**
|
|
10596
|
+
* Replace the document properties as one unit. Svelte's editor commits
|
|
10597
|
+
* core / app / custom together, so the bridge fans all three through here.
|
|
10598
|
+
*/
|
|
10599
|
+
setDocumentProperties(core: PptxCoreProperties, app: PptxAppProperties, custom: PptxCustomProperty[]): void;
|
|
10600
|
+
}
|
|
10601
|
+
/** Build the AI bridge that exposes the live Svelte viewer to the AI core. */
|
|
10602
|
+
declare function createSvelteAiBridge(deps: SvelteAiBridgeDeps): PptxAiBridge;
|
|
10603
|
+
|
|
8369
10604
|
/**
|
|
8370
10605
|
* Pure slide-navigation and zoom-step helpers for the Svelte viewer.
|
|
8371
10606
|
* Kept framework-free so they are trivially unit-testable.
|
|
@@ -8483,5 +10718,564 @@ declare class ViewerState {
|
|
|
8483
10718
|
handleNavigationKey(key: string): boolean;
|
|
8484
10719
|
}
|
|
8485
10720
|
|
|
8486
|
-
|
|
8487
|
-
|
|
10721
|
+
/** A transport-agnostic view of a live Yjs provider. */
|
|
10722
|
+
interface CollabProviderHandle {
|
|
10723
|
+
/** The provider's awareness instance (local/remote presence). */
|
|
10724
|
+
awareness: AwarenessLike;
|
|
10725
|
+
/**
|
|
10726
|
+
* Subscribe to connection-status changes. The callback receives whether the
|
|
10727
|
+
* transport currently reports a connection. Only meaningful for websocket;
|
|
10728
|
+
* webrtc callers rely on {@link connectedNow} instead.
|
|
10729
|
+
*/
|
|
10730
|
+
onStatus: (cb: (connected: boolean) => void) => void;
|
|
10731
|
+
/** Whether the transport reports a connection immediately after creation. */
|
|
10732
|
+
connectedNow: boolean;
|
|
10733
|
+
/**
|
|
10734
|
+
* Subscribe to the provider's initial-document-sync confirmation. Websocket
|
|
10735
|
+
* fires reliably once the server sync completes; webrtc only fires when a
|
|
10736
|
+
* peer syncs with us (a lone fresh-room peer never receives one, so callers
|
|
10737
|
+
* pair this with a grace timer, see the shared createSyncGate).
|
|
10738
|
+
*/
|
|
10739
|
+
onSynced: (cb: () => void) => void;
|
|
10740
|
+
/** Whether the provider already reports its initial sync as complete. */
|
|
10741
|
+
syncedNow: boolean;
|
|
10742
|
+
/** Tear the provider down (disconnect + destroy). */
|
|
10743
|
+
destroy: () => void;
|
|
10744
|
+
}
|
|
10745
|
+
|
|
10746
|
+
/** A fully-wired collaboration session: the doc, its factories, and transport. */
|
|
10747
|
+
interface CollabSession {
|
|
10748
|
+
/** The live Y.Doc (structural view used by the shared reconcile helpers). */
|
|
10749
|
+
ydoc: YDocLike;
|
|
10750
|
+
/** Factories the shared reconcile helpers use to build Y.Map/Array/Text. */
|
|
10751
|
+
factories: YjsFactories;
|
|
10752
|
+
/** The normalised transport provider handle. */
|
|
10753
|
+
provider: CollabProviderHandle;
|
|
10754
|
+
/** Tear down the provider and destroy the doc. */
|
|
10755
|
+
destroy: () => void;
|
|
10756
|
+
}
|
|
10757
|
+
/**
|
|
10758
|
+
* Build a live session for the given transport + config. Injectable so tests
|
|
10759
|
+
* can substitute an in-memory fake (see `collaboration.svelte.ts`).
|
|
10760
|
+
*/
|
|
10761
|
+
type CollabSessionFactory = (transport: CollaborationTransport, config: CollaborationConfig) => Promise<CollabSession>;
|
|
10762
|
+
|
|
10763
|
+
interface CollaborationDeps {
|
|
10764
|
+
/** Read the current local slides (broadcast granularly on change). */
|
|
10765
|
+
getSlides: () => PptxSlide[];
|
|
10766
|
+
/** Apply a remote peer's slide snapshot into the editable slides. */
|
|
10767
|
+
applyRemoteSlides: (slides: PptxSlide[]) => void;
|
|
10768
|
+
/** Live host `collaboration` config; watched to auto start/stop a session. */
|
|
10769
|
+
getConfig: () => CollaborationConfig | undefined;
|
|
10770
|
+
/** Return the loaded source bytes for elected-writer (role 'owner') write-back. */
|
|
10771
|
+
getSourceBytes?: () => Uint8Array | null;
|
|
10772
|
+
/** Slide canvas width/height (unscaled px), used to clamp incoming cursor coordinates. */
|
|
10773
|
+
getCanvasWidth?: () => number | undefined;
|
|
10774
|
+
getCanvasHeight?: () => number | undefined;
|
|
10775
|
+
/** Fired when a session starts (host observability). */
|
|
10776
|
+
onStart?: (config: CollaborationConfig) => void;
|
|
10777
|
+
/** Fired when a session stops (host observability). */
|
|
10778
|
+
onStop?: () => void;
|
|
10779
|
+
/** Session factory seam (defaults to the real yjs + transport wiring). */
|
|
10780
|
+
createSession?: CollabSessionFactory;
|
|
10781
|
+
}
|
|
10782
|
+
|
|
10783
|
+
/**
|
|
10784
|
+
* The collaboration controller. Construct it once during component setup: it
|
|
10785
|
+
* registers the two effects (auto start/stop from the config, granular publish
|
|
10786
|
+
* of local edits) itself, so no further wiring is needed in the SFC.
|
|
10787
|
+
*/
|
|
10788
|
+
declare class CollaborationController {
|
|
10789
|
+
#private;
|
|
10790
|
+
/** Live connection status (reactive). */
|
|
10791
|
+
status: ConnectionStatus;
|
|
10792
|
+
/** Interim Y.Doc channel for in-flight inline text (dormant when stopped). */
|
|
10793
|
+
readonly livePatcher: CollaborationLivePatcher;
|
|
10794
|
+
constructor(deps: CollaborationDeps);
|
|
10795
|
+
/** Whether a session is live (reactive). */
|
|
10796
|
+
get active(): boolean;
|
|
10797
|
+
/** Read-only participant (session live with the `viewer` role) - cannot select/drag/mutate. */
|
|
10798
|
+
get readOnly(): boolean;
|
|
10799
|
+
/** Remote cursors on the current slide (reactive). */
|
|
10800
|
+
get cursors(): RemoteCursor[];
|
|
10801
|
+
/** Remote collaborators in the session (reactive). */
|
|
10802
|
+
get remotePresences(): SanitizedPresence[];
|
|
10803
|
+
/** Followed peer's client id, or null when free (reactive). */
|
|
10804
|
+
get followedClientId(): number | null;
|
|
10805
|
+
/** Publish a cursor move (slide-space px); no-op when no session is active. */
|
|
10806
|
+
setCursor(x: number, y: number, activeSlideIndex?: number): void;
|
|
10807
|
+
/** Publish the local selection; no-op when no session is active. */
|
|
10808
|
+
setSelection(selectedElementId: string | undefined, activeSlideIndex?: number): void;
|
|
10809
|
+
/** Publish the local active-slide index (drives peer follow-along). */
|
|
10810
|
+
setActiveSlide(index: number): void;
|
|
10811
|
+
/** Follow the given peer's active slide, or `null` to stop following. */
|
|
10812
|
+
followUser(clientId: number | null): void;
|
|
10813
|
+
/**
|
|
10814
|
+
* Re-adopt the shared doc's slides after a local content load committed a
|
|
10815
|
+
* parsed deck to viewer state (see `adoptDocSlidesAfterLoad`). The load
|
|
10816
|
+
* pipeline calls this synchronously right after it applies, i.e. before the
|
|
10817
|
+
* publish effect can flush the freshly loaded slides into the doc, so a
|
|
10818
|
+
* late joiner's bootstrap deck never clobbers the room's synced content.
|
|
10819
|
+
*/
|
|
10820
|
+
adoptDocAfterLoad(): void;
|
|
10821
|
+
/** Start (or restart) a session with the given config (dialog-driven). */
|
|
10822
|
+
start(config: CollaborationConfig): Promise<void>;
|
|
10823
|
+
stop(): void;
|
|
10824
|
+
}
|
|
10825
|
+
|
|
10826
|
+
/** Prefilled values for the Share dialog's form (Broadcast reuses `serverUrl`). */
|
|
10827
|
+
interface ShareDefaultsInput {
|
|
10828
|
+
roomId?: string;
|
|
10829
|
+
userName?: string;
|
|
10830
|
+
serverUrl?: string;
|
|
10831
|
+
}
|
|
10832
|
+
declare class CollaborationDialogsState {
|
|
10833
|
+
#private;
|
|
10834
|
+
shareOpen: boolean;
|
|
10835
|
+
broadcastOpen: boolean;
|
|
10836
|
+
constructor(collab: CollaborationController, getShareDefaults: () => ShareDefaultsInput | undefined);
|
|
10837
|
+
/** Number of connected participants (including the local user), when active. */
|
|
10838
|
+
get connectedCount(): number;
|
|
10839
|
+
/** The shareable follow link for the current (or last) broadcast, once known. */
|
|
10840
|
+
get broadcastViewerUrl(): string | undefined;
|
|
10841
|
+
openShare(): void;
|
|
10842
|
+
openBroadcast(): void;
|
|
10843
|
+
readonly onShareStart: (config: CollaborationConfig) => void;
|
|
10844
|
+
readonly onShareStop: () => void;
|
|
10845
|
+
readonly onBroadcastStart: (config: BroadcastConfig) => void;
|
|
10846
|
+
readonly onBroadcastStop: () => void;
|
|
10847
|
+
/**
|
|
10848
|
+
* Retry the active session after a connection error: prefers the host's
|
|
10849
|
+
* live `collaboration` prop, falling back to whatever config either dialog
|
|
10850
|
+
* last started (since a dialog-started session has no corresponding prop).
|
|
10851
|
+
*/
|
|
10852
|
+
retry(propConfig: CollaborationConfig | undefined): void;
|
|
10853
|
+
}
|
|
10854
|
+
|
|
10855
|
+
/** The imperative editing API exposed on the `PowerPointViewer` instance. */
|
|
10856
|
+
interface EditingApi {
|
|
10857
|
+
undo(): void;
|
|
10858
|
+
redo(): void;
|
|
10859
|
+
canUndo(): boolean;
|
|
10860
|
+
canRedo(): boolean;
|
|
10861
|
+
deleteSelected(): void;
|
|
10862
|
+
getSelectedElementId(): string | null;
|
|
10863
|
+
save(format?: PptxSaveFormat): Promise<Uint8Array>;
|
|
10864
|
+
downloadAs(format: PptxSaveFormat, fileName?: string): Promise<void>;
|
|
10865
|
+
downloadPptx(fileName?: string): Promise<void>;
|
|
10866
|
+
packageForSharing(fileName?: string): Promise<void>;
|
|
10867
|
+
}
|
|
10868
|
+
|
|
10869
|
+
/**
|
|
10870
|
+
* `AnimationPlayback`: native-timing (`p:timing`) animation playback for the
|
|
10871
|
+
* Svelte binding's presentation mode, driven by the shared, framework-agnostic
|
|
10872
|
+
* {@link PresentationAnimationController}. The runes analogue of the Vue
|
|
10873
|
+
* `useAnimationPlayback` composable, kept out of the SFC so it is unit-testable.
|
|
10874
|
+
*
|
|
10875
|
+
* This replaces the older preset (`PptxElementAnimation`) click-group model for
|
|
10876
|
+
* the slide show: the controller builds a timeline engine from the slide's
|
|
10877
|
+
* `nativeAnimations` (expanding staged text builds), which can represent native
|
|
10878
|
+
* staged chart / SmartArt builds (`p:bldChart` / `p:bldDgm`) and colour
|
|
10879
|
+
* animations (`p:animClr`) that the preset model could not. It mirrors the Vue /
|
|
10880
|
+
* React bindings.
|
|
10881
|
+
*
|
|
10882
|
+
* The class owns the reactive per-element state map, the keyframes CSS, and the
|
|
10883
|
+
* interactive / hover trigger-shape id sets; the controller stays pure. The
|
|
10884
|
+
* clock (timers, requestAnimationFrame) + DOM effects live in
|
|
10885
|
+
* {@link module:presentation/animation-playback-helpers}.
|
|
10886
|
+
*
|
|
10887
|
+
* NOTE: the editor / inspector animation PREVIEW still uses the older shared
|
|
10888
|
+
* `buildClickGroups` model (see `AnimationsTab` / `editor-animation-controller`);
|
|
10889
|
+
* this class is only the running slide show.
|
|
10890
|
+
*/
|
|
10891
|
+
interface AnimationPlaybackDeps {
|
|
10892
|
+
/** The current slide to build the native-animation timeline for. */
|
|
10893
|
+
getSlide(): PptxSlide | undefined;
|
|
10894
|
+
/** Presentation-level switch parsed from `p:showPr`. */
|
|
10895
|
+
getShowWithAnimation?(): boolean | undefined;
|
|
10896
|
+
/** Host-provided action-sound player (resolves + plays embedded sounds). */
|
|
10897
|
+
onPlayActionSound?: (soundPath: string) => void;
|
|
10898
|
+
/** Root element to scope media-command (`p:cmd`) target lookups to. */
|
|
10899
|
+
frameRoot?: () => HTMLElement | null;
|
|
10900
|
+
}
|
|
10901
|
+
declare class AnimationPlayback {
|
|
10902
|
+
#private;
|
|
10903
|
+
constructor(deps: AnimationPlaybackDeps);
|
|
10904
|
+
/** Reactive per-element native-animation state (visibility, build, colour). */
|
|
10905
|
+
get elementStates(): Map<string, ElementAnimationState>;
|
|
10906
|
+
/** The per-slide `@keyframes` CSS to inject once per slide. */
|
|
10907
|
+
get keyframesCss(): string;
|
|
10908
|
+
/** Shape ids that trigger an interactive (`onShapeClick`) sequence. */
|
|
10909
|
+
get interactiveTriggerShapeIds(): ReadonlySet<string>;
|
|
10910
|
+
/** Shape ids that trigger a hover (`onHover`) sequence. */
|
|
10911
|
+
get hoverTriggerShapeIds(): ReadonlySet<string>;
|
|
10912
|
+
/** True once every main-timeline click-group has been revealed. */
|
|
10913
|
+
get isComplete(): boolean;
|
|
10914
|
+
/** Clear all pending timers + the in-flight staged-build RAF. */
|
|
10915
|
+
clearTimers(): void;
|
|
10916
|
+
/**
|
|
10917
|
+
* Rebuild the controller for the current slide and replay from the start. The
|
|
10918
|
+
* controller builds the timeline engine (expanding text-build animations) and
|
|
10919
|
+
* derives keyframes CSS, trigger-shape ids, and the tracked element id list.
|
|
10920
|
+
*/
|
|
10921
|
+
reset(): void;
|
|
10922
|
+
/**
|
|
10923
|
+
* Reveal the next click-group. Returns `true` if a group was revealed, `false`
|
|
10924
|
+
* when playback is complete or animations are disabled (so the caller can fall
|
|
10925
|
+
* through to slide navigation).
|
|
10926
|
+
*/
|
|
10927
|
+
advance(): boolean;
|
|
10928
|
+
/** Play an interactive shape's sequence; `true` when it triggered one. */
|
|
10929
|
+
handleInteractiveShapeClick(shapeId: string): boolean;
|
|
10930
|
+
/** Play a hover shape's sequence; `true` when it triggered one. */
|
|
10931
|
+
handleHoverStart(shapeId: string): boolean;
|
|
10932
|
+
/** Reset a hover shape's sequence so the next hover replays it. */
|
|
10933
|
+
handleHoverEnd(shapeId: string): void;
|
|
10934
|
+
}
|
|
10935
|
+
|
|
10936
|
+
/**
|
|
10937
|
+
* `PresentationController`: the runes state machine wiring the Svelte viewer's
|
|
10938
|
+
* fullscreen (presentation) mode to the framework-agnostic animation and
|
|
10939
|
+
* slide-transition helpers in `pptx-viewer-shared`.
|
|
10940
|
+
*
|
|
10941
|
+
* It owns:
|
|
10942
|
+
* - an {@link AnimationPlayback} for the current slide's click-stepped element
|
|
10943
|
+
* builds, and
|
|
10944
|
+
* - the transient slide-transition state (outgoing + incoming slide + the
|
|
10945
|
+
* resolved transition) rendered by `PresentationTransitionOverlay`.
|
|
10946
|
+
*
|
|
10947
|
+
* `advance()` implements the on-click contract: reveal the next animation build
|
|
10948
|
+
* first, and only advance the slide once the slide's builds are exhausted.
|
|
10949
|
+
* `onSlideChange` / `start` / `stop` are driven from a `$effect` in the viewer
|
|
10950
|
+
* (see `usePresentationEffects`) as the fullscreen flag and current slide move.
|
|
10951
|
+
*
|
|
10952
|
+
* Matches the Vue binding's presentation-mode behaviour (its parity bar):
|
|
10953
|
+
* click-stepped element animations, CSS-driven slide transitions on every slide
|
|
10954
|
+
* change, entrance elements hidden until revealed. Since the native-timing
|
|
10955
|
+
* migration it also drives staged chart / SmartArt builds (`p:bldChart` /
|
|
10956
|
+
* `p:bldDgm`), `p:animClr` colour animations, withPrevious / afterPrevious
|
|
10957
|
+
* auto-advance, and interactive / hover trigger sequences. Still no presenter
|
|
10958
|
+
* view (React-only).
|
|
10959
|
+
*/
|
|
10960
|
+
interface TransitionState {
|
|
10961
|
+
/** The outgoing (previous) slide, rendered in the exit layer. */
|
|
10962
|
+
outgoing: PptxSlide | undefined;
|
|
10963
|
+
/** The incoming (new) slide, rendered in the entrance layer. */
|
|
10964
|
+
incoming: PptxSlide | undefined;
|
|
10965
|
+
/** The incoming slide's transition (drives the CSS animation shorthands). */
|
|
10966
|
+
transition: PptxSlideTransition;
|
|
10967
|
+
}
|
|
10968
|
+
interface PresentationControllerDeps {
|
|
10969
|
+
/** The live, editable slide array (single source of truth). */
|
|
10970
|
+
getSlides(): PptxSlide[];
|
|
10971
|
+
/** The active slide index (0-based). */
|
|
10972
|
+
getCurrentIndex(): number;
|
|
10973
|
+
/** Navigate to a slide index (clamped by the caller's viewer state). */
|
|
10974
|
+
navigate(index: number): void;
|
|
10975
|
+
/** Presentation-level switch parsed from `p:showPr`. */
|
|
10976
|
+
getShowWithAnimation?(): boolean | undefined;
|
|
10977
|
+
/** Host-provided action-sound player (resolves + plays embedded sounds). */
|
|
10978
|
+
onPlayActionSound?: (soundPath: string) => void;
|
|
10979
|
+
/** The live presentation stage root, to scope media-command lookups to. */
|
|
10980
|
+
getFrameRoot?(): HTMLElement | null;
|
|
10981
|
+
}
|
|
10982
|
+
declare class PresentationController {
|
|
10983
|
+
#private;
|
|
10984
|
+
readonly playback: AnimationPlayback;
|
|
10985
|
+
constructor(deps: PresentationControllerDeps);
|
|
10986
|
+
/** The active slide-transition overlay state, or `null` when none is playing. */
|
|
10987
|
+
get transition(): TransitionState | null;
|
|
10988
|
+
/** Reactive per-element native-animation state (visibility, build, colour). */
|
|
10989
|
+
get elementStates(): Map<string, ElementAnimationState>;
|
|
10990
|
+
/** The per-slide native-animation `@keyframes` CSS to inject. */
|
|
10991
|
+
get keyframesCss(): string;
|
|
10992
|
+
/** Shape ids that trigger an interactive (`onShapeClick`) sequence. */
|
|
10993
|
+
get interactiveTriggerShapeIds(): ReadonlySet<string>;
|
|
10994
|
+
/** Shape ids that trigger a hover (`onHover`) sequence. */
|
|
10995
|
+
get hoverTriggerShapeIds(): ReadonlySet<string>;
|
|
10996
|
+
/** Play an interactive shape's sequence; `true` when it triggered one. */
|
|
10997
|
+
handleInteractiveShapeClick(shapeId: string): boolean;
|
|
10998
|
+
/** Play a hover shape's sequence; `true` when it triggered one. */
|
|
10999
|
+
handleHoverStart(shapeId: string): boolean;
|
|
11000
|
+
/** Reset a hover shape's sequence so the next hover replays it. */
|
|
11001
|
+
handleHoverEnd(shapeId: string): void;
|
|
11002
|
+
/**
|
|
11003
|
+
* The on-click advance contract: reveal the next element-animation build if
|
|
11004
|
+
* one remains, otherwise advance to the next slide.
|
|
11005
|
+
*
|
|
11006
|
+
* `fromClick` marks a click/tap/swipe on the slide, which is PowerPoint's
|
|
11007
|
+
* "on mouse click" advance: it still steps the remaining animation builds,
|
|
11008
|
+
* but once they are exhausted it advances the slide only when the current
|
|
11009
|
+
* slide's transition allows it (advanceOnClick !== false). Keyboard and the
|
|
11010
|
+
* on-screen next button pass `fromClick = false` and are never gated.
|
|
11011
|
+
*/
|
|
11012
|
+
advance(fromClick?: boolean): void;
|
|
11013
|
+
/** Entering presentation: seed builds for the current slide, drop any overlay. */
|
|
11014
|
+
start(): void;
|
|
11015
|
+
/** Leaving presentation: clear timers, reset builds, drop any overlay. */
|
|
11016
|
+
stop(): void;
|
|
11017
|
+
/**
|
|
11018
|
+
* The presented slide changed: reset the new slide's builds and, when the
|
|
11019
|
+
* incoming slide carries a real transition, play it over the frame.
|
|
11020
|
+
*/
|
|
11021
|
+
onSlideChange(previousIndex: number, nextIndex: number): void;
|
|
11022
|
+
/** The transition overlay finished its animation: drop it. */
|
|
11023
|
+
endTransition(): void;
|
|
11024
|
+
}
|
|
11025
|
+
|
|
11026
|
+
interface PresenterSessionOptions {
|
|
11027
|
+
getSource: () => Uint8Array | ArrayBuffer | null | undefined;
|
|
11028
|
+
getSlideIndex: () => number;
|
|
11029
|
+
onAudienceSlide: (index: number) => void;
|
|
11030
|
+
onAudienceExit: () => void;
|
|
11031
|
+
}
|
|
11032
|
+
declare class PresenterSession {
|
|
11033
|
+
private readonly options;
|
|
11034
|
+
audienceOpen: boolean;
|
|
11035
|
+
snapshot: PresentationSnapshot;
|
|
11036
|
+
readonly audienceSessionId: string | null;
|
|
11037
|
+
readonly isAudience: boolean;
|
|
11038
|
+
private channel;
|
|
11039
|
+
private audienceWindow;
|
|
11040
|
+
private presenterSessionId;
|
|
11041
|
+
private sequence;
|
|
11042
|
+
constructor(options: PresenterSessionOptions);
|
|
11043
|
+
connect(): void;
|
|
11044
|
+
openAudience(): boolean;
|
|
11045
|
+
sync(slideIndex?: number): void;
|
|
11046
|
+
updateSnapshot(patch: Partial<PresentationSnapshot>): void;
|
|
11047
|
+
closeAudience(): void;
|
|
11048
|
+
dispose(): void;
|
|
11049
|
+
private getChannel;
|
|
11050
|
+
}
|
|
11051
|
+
|
|
11052
|
+
declare class CompareController {
|
|
11053
|
+
#private;
|
|
11054
|
+
result: CompareResult | null;
|
|
11055
|
+
open: boolean;
|
|
11056
|
+
accepted: Set<number>;
|
|
11057
|
+
rejected: Set<number>;
|
|
11058
|
+
constructor(editor: EditorState);
|
|
11059
|
+
chooseFile(): Promise<void>;
|
|
11060
|
+
accept(index: number): void;
|
|
11061
|
+
reject(index: number): void;
|
|
11062
|
+
acceptAll(): void;
|
|
11063
|
+
}
|
|
11064
|
+
|
|
11065
|
+
type PresentationInkTool = 'none' | 'pen' | 'highlighter' | 'eraser' | 'laser';
|
|
11066
|
+
interface PresentationStroke {
|
|
11067
|
+
id: string;
|
|
11068
|
+
points: InkPoint[];
|
|
11069
|
+
color: string;
|
|
11070
|
+
width: number;
|
|
11071
|
+
tool: 'pen' | 'highlighter';
|
|
11072
|
+
}
|
|
11073
|
+
declare class PresentationAnnotations {
|
|
11074
|
+
#private;
|
|
11075
|
+
tool: PresentationInkTool;
|
|
11076
|
+
color: string;
|
|
11077
|
+
current: PresentationStroke | null;
|
|
11078
|
+
bySlide: Map<number, PresentationStroke[]>;
|
|
11079
|
+
laser: InkPoint | null;
|
|
11080
|
+
get count(): number;
|
|
11081
|
+
get slideCount(): number;
|
|
11082
|
+
strokes(index: number): PresentationStroke[];
|
|
11083
|
+
pointerDown(index: number, point: InkPoint): void;
|
|
11084
|
+
pointerMove(index: number, point: InkPoint): void;
|
|
11085
|
+
pointerUp(index: number): void;
|
|
11086
|
+
erase(index: number, point: InkPoint): void;
|
|
11087
|
+
clear(): void;
|
|
11088
|
+
keep(editor: EditorState): void;
|
|
11089
|
+
}
|
|
11090
|
+
|
|
11091
|
+
declare class RehearseState {
|
|
11092
|
+
#private;
|
|
11093
|
+
active: boolean;
|
|
11094
|
+
paused: boolean;
|
|
11095
|
+
summaryOpen: boolean;
|
|
11096
|
+
times: Map<number, number>;
|
|
11097
|
+
current: number;
|
|
11098
|
+
elapsedMs: number;
|
|
11099
|
+
start(index: number): void;
|
|
11100
|
+
tick(): void;
|
|
11101
|
+
move(index: number): void;
|
|
11102
|
+
togglePause(): void;
|
|
11103
|
+
finish(): void;
|
|
11104
|
+
record(): void;
|
|
11105
|
+
save(editor: EditorState): void;
|
|
11106
|
+
discard(): void;
|
|
11107
|
+
get totalMs(): number;
|
|
11108
|
+
}
|
|
11109
|
+
|
|
11110
|
+
/** Reactive state for the optional parity dialogs and presentation tools. */
|
|
11111
|
+
declare class ViewerParityUiState {
|
|
11112
|
+
readonly compare: CompareController;
|
|
11113
|
+
readonly annotations: PresentationAnnotations;
|
|
11114
|
+
readonly rehearse: RehearseState;
|
|
11115
|
+
setupSlideShowOpen: boolean;
|
|
11116
|
+
headerFooterOpen: boolean;
|
|
11117
|
+
settingsOpen: boolean;
|
|
11118
|
+
shortcutsOpen: boolean;
|
|
11119
|
+
keepAnnotationsOpen: boolean;
|
|
11120
|
+
printSettingsOpen: boolean;
|
|
11121
|
+
subtitlesEnabled: boolean;
|
|
11122
|
+
customShowsOpen: boolean;
|
|
11123
|
+
selectionPaneOpen: boolean;
|
|
11124
|
+
slideSorterOpen: boolean;
|
|
11125
|
+
showGuides: boolean;
|
|
11126
|
+
snapToShape: boolean;
|
|
11127
|
+
guides: {
|
|
11128
|
+
axis: "h" | "v";
|
|
11129
|
+
position: number;
|
|
11130
|
+
}[];
|
|
11131
|
+
preferences: ViewerPreferences;
|
|
11132
|
+
constructor(editor: EditorState);
|
|
11133
|
+
syncAutosave(enabled: boolean): void;
|
|
11134
|
+
updatePreferences(next: ViewerPreferences, onAutosaveChange: (enabled: boolean) => void): void;
|
|
11135
|
+
}
|
|
11136
|
+
|
|
11137
|
+
/**
|
|
11138
|
+
* Options accepted by {@link createViewerState}. Mirrors the subset of
|
|
11139
|
+
* `PowerPointViewerProps` the extracted construction block (formerly
|
|
11140
|
+
* inlined at the top of `PowerPointViewer.svelte`'s `<script>`) closes
|
|
11141
|
+
* over, plus getter callbacks for the handful of DOM-bound values
|
|
11142
|
+
* (`bind:this` / `bind:clientWidth` targets) that must stay owned by
|
|
11143
|
+
* whichever component renders the actual markup.
|
|
11144
|
+
*/
|
|
11145
|
+
interface CreateViewerStateOptions {
|
|
11146
|
+
getSource: () => Uint8Array | ArrayBuffer | null | undefined;
|
|
11147
|
+
collaboration?: CollaborationConfig;
|
|
11148
|
+
shareDefaults?: ShareDefaultsInput;
|
|
11149
|
+
/** Host `autosave` prop (post-effect value the caller keeps in sync). */
|
|
11150
|
+
getAutosave: () => boolean;
|
|
11151
|
+
autosaveIntervalMs?: number;
|
|
11152
|
+
getFilePath: () => string | undefined;
|
|
11153
|
+
getInitialSlide: () => number;
|
|
11154
|
+
/** Already locale-bound translator; propagated to descendants via context. */
|
|
11155
|
+
t: Translator;
|
|
11156
|
+
getSmartArt3D: () => boolean;
|
|
11157
|
+
/** Whether in-place editing is enabled (host `editable` prop, post-effect value). */
|
|
11158
|
+
getEditable: () => boolean;
|
|
11159
|
+
onload?: (detail: ViewerLoadDetail) => void;
|
|
11160
|
+
onerror?: (message: string) => void;
|
|
11161
|
+
onslidechange?: (index: number) => void;
|
|
11162
|
+
onnotesupdate?: (notes: string) => void;
|
|
11163
|
+
onchange?: () => void;
|
|
11164
|
+
ondirtychange?: (dirty: boolean) => void;
|
|
11165
|
+
oncontentchange?: (content: Uint8Array) => void;
|
|
11166
|
+
onmodechange?: (mode: ViewerMode) => void;
|
|
11167
|
+
onzoomchange?: (zoom: number) => void;
|
|
11168
|
+
onselectionchange?: (elementIds: string[]) => void;
|
|
11169
|
+
onslidecountchange?: (count: number) => void;
|
|
11170
|
+
onautosave?: (bytes: Uint8Array) => void;
|
|
11171
|
+
/** Fired when the host toggles AutoSave (title bar / Settings dialog). */
|
|
11172
|
+
onautosavetoggle?: (enabled: boolean) => void;
|
|
11173
|
+
onstartcollaboration?: (config: CollaborationConfig) => void;
|
|
11174
|
+
onstopcollaboration?: () => void;
|
|
11175
|
+
/** DOM-bound getters, supplied by the component that owns the markup. */
|
|
11176
|
+
getStageHolderEl: () => HTMLDivElement | undefined;
|
|
11177
|
+
getRootEl: () => HTMLDivElement | undefined;
|
|
11178
|
+
getViewportWidth: () => number;
|
|
11179
|
+
getViewportHeight: () => number;
|
|
11180
|
+
/** Master/layout workspace zoom, assigned by `MasterViewBody`. */
|
|
11181
|
+
getMasterScale: () => number;
|
|
11182
|
+
}
|
|
11183
|
+
/**
|
|
11184
|
+
* Everything the ribbon, toolbar, and canvas need, returned from
|
|
11185
|
+
* {@link createViewerState}. Reactive/derived fields are exposed as
|
|
11186
|
+
* getters (some paired with setters for the plain local UI flags) so reads
|
|
11187
|
+
* anywhere, not just inside an `$effect`, stay live.
|
|
11188
|
+
*/
|
|
11189
|
+
interface ViewerStateBag {
|
|
11190
|
+
readonly loader: PresentationLoader;
|
|
11191
|
+
readonly viewer: ViewerState;
|
|
11192
|
+
readonly editor: EditorState;
|
|
11193
|
+
readonly controller: EditorController;
|
|
11194
|
+
readonly parityUi: ViewerParityUiState;
|
|
11195
|
+
readonly chromeUi: ChromeUiState;
|
|
11196
|
+
readonly findReplace: FindReplaceState;
|
|
11197
|
+
readonly collab: CollaborationController;
|
|
11198
|
+
readonly dialogs: CollaborationDialogsState;
|
|
11199
|
+
readonly autosaveCtl: AutosaveController;
|
|
11200
|
+
readonly presentation: PresentationController;
|
|
11201
|
+
readonly presenterSession: PresenterSession;
|
|
11202
|
+
readonly exportWiring: ExportWiring;
|
|
11203
|
+
readonly exportUi: ExportUiState;
|
|
11204
|
+
readonly t: Translator;
|
|
11205
|
+
/** Imperative undo/redo/save/download API, matching `PowerPointViewerApi`'s editing subset. */
|
|
11206
|
+
readonly editingApi: EditingApi;
|
|
11207
|
+
/** Imperative PNG/PDF/GIF/video/print API, matching `PowerPointViewerApi`'s export subset. */
|
|
11208
|
+
readonly exportingApi: ExportingApi;
|
|
11209
|
+
/** Effective scale (fit-to-viewport x user zoom), matching the main canvas. */
|
|
11210
|
+
readonly scale: number;
|
|
11211
|
+
/** User-facing zoom percent (rounded, never below 1). */
|
|
11212
|
+
readonly effectivePercent: number;
|
|
11213
|
+
readonly displaySlides: EditorState['renderedSlides'];
|
|
11214
|
+
readonly activeSlide: EditorState['renderedSlides'][number] | undefined;
|
|
11215
|
+
readonly chromeVisible: boolean;
|
|
11216
|
+
/** True when in-place editing is actually available (editable, not presenting, not read-only). */
|
|
11217
|
+
readonly editingActive: boolean;
|
|
11218
|
+
/** True once the ribbon (vs. the compact `ViewerToolbar`) should be shown. */
|
|
11219
|
+
readonly showRibbon: boolean;
|
|
11220
|
+
readonly viewerMode: ViewerMode;
|
|
11221
|
+
/** True while the autosave debounce/write cycle is armed. */
|
|
11222
|
+
readonly autosaveActive: boolean;
|
|
11223
|
+
/** Read-only: mutate via {@link setAutosaveEnabled}, which also fires `onautosavetoggle`. */
|
|
11224
|
+
readonly autosaveEnabled: boolean;
|
|
11225
|
+
setAutosaveEnabled(enabled: boolean): void;
|
|
11226
|
+
presenterMode: boolean;
|
|
11227
|
+
/** `Date.now()` timestamp of the last `enterPresenterView()` call; the presenter view's elapsed-time display. */
|
|
11228
|
+
readonly presenterStartedAt: number;
|
|
11229
|
+
stageContextMenu: {
|
|
11230
|
+
x: number;
|
|
11231
|
+
y: number;
|
|
11232
|
+
} | null;
|
|
11233
|
+
readonly activeMobileSheet: MobileSheetKey;
|
|
11234
|
+
setActiveMobileSheet(next: MobileSheetKey): void;
|
|
11235
|
+
readonly notesExpanded: boolean;
|
|
11236
|
+
versionHistoryOpen: boolean;
|
|
11237
|
+
readonly signatureWarningOpen: boolean;
|
|
11238
|
+
enterPresenterView(): void;
|
|
11239
|
+
closeSignatureWarning(): void;
|
|
11240
|
+
onNotesToggle(): void;
|
|
11241
|
+
onNotesCommit(notes: string, segments?: TextSegment[]): void;
|
|
11242
|
+
onFullscreenToggle(): void;
|
|
11243
|
+
onFullscreenChange(): void;
|
|
11244
|
+
onKeydown(event: KeyboardEvent): void;
|
|
11245
|
+
downloadPptx(fileName?: string): Promise<void>;
|
|
11246
|
+
downloadAs(format: PptxSaveFormat, fileName?: string): Promise<void>;
|
|
11247
|
+
/** Tear down every constructed controller (call from the host's `onDestroy`). */
|
|
11248
|
+
destroy(): void;
|
|
11249
|
+
}
|
|
11250
|
+
|
|
11251
|
+
/**
|
|
11252
|
+
* Builds every reactive controller the ribbon, toolbar, and slide canvas
|
|
11253
|
+
* need: the runes port of `PowerPointViewer.svelte`'s own construction block
|
|
11254
|
+
* (originally inlined at the top of its `<script>`), extracted so a host can
|
|
11255
|
+
* compose its own viewer shell out of `Ribbon` / `ViewerToolbar` / the state
|
|
11256
|
+
* classes without pulling in the whole `PowerPointViewer` component.
|
|
11257
|
+
*
|
|
11258
|
+
* MUST be called synchronously from a `.svelte` component's own script body
|
|
11259
|
+
* (top level, not inside a callback or after an `await`): it registers
|
|
11260
|
+
* `onMount` / `onDestroy` hooks and Svelte context (`setContext`) via
|
|
11261
|
+
* `provideTranslator` / `provideSmartArt3D` / `provideRenderContext` /
|
|
11262
|
+
* `provideZoomNavigation` (inside the editor-ui cluster) / `provideInspectorDeck`,
|
|
11263
|
+
* all of which require an active component-initialisation context. Svelte's
|
|
11264
|
+
* lifecycle context stays active for the whole synchronous execution of a
|
|
11265
|
+
* component's script, not just its top-level statements, so calling this
|
|
11266
|
+
* from a component's script works exactly like inlining the same code would.
|
|
11267
|
+
*
|
|
11268
|
+
* Construction is split across a few `create-viewer-state-*.svelte.ts`
|
|
11269
|
+
* helpers purely to stay under the repo's file-size budget; the ORDER those
|
|
11270
|
+
* helpers are invoked in below mirrors the original inline code (later
|
|
11271
|
+
* clusters close over earlier ones), with one deliberate reordering: the
|
|
11272
|
+
* collaboration cluster is now built right after `editor` (it doesn't need
|
|
11273
|
+
* the editing-chrome cluster), which lets `controller` close over the real
|
|
11274
|
+
* `collab.setCursor` instead of a forward reference.
|
|
11275
|
+
*
|
|
11276
|
+
* Call the returned `destroy()` from the host component's own `onDestroy`.
|
|
11277
|
+
*/
|
|
11278
|
+
declare function createViewerState(options: CreateViewerStateOptions): ViewerStateBag;
|
|
11279
|
+
|
|
11280
|
+
export { PowerPointViewer, PresentationLoader, Ribbon, SlideCanvas, ViewerState, ViewerToolbar, clampSlideIndex, createSvelteAiBridge, createViewerState, exportAllSlidesToSvg, exportAllSlidesToSvgBlobs, exportSlideAsSvg, exportSlideToSvg, exportSlideToSvgBlob, fitScale, resolveNavigationKey, zoomInPercent, zoomOutPercent };
|
|
11281
|
+
export type { CanvasSize, CreateViewerStateOptions, ExportGifOptions, ExportPdfOptions, ExportVideoOptions, NavigationAction, PowerPointViewerApi, PowerPointViewerProps, PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiUIMessage, PptxAiWritePolicy, PrintOptions, RibbonProps, SlideCanvasProps, SvelteAiBridgeDeps, SvgExportAllOptions, SvgExportSingleSlideOptions, ViewerLoadDetail, ViewerStateBag, ViewerTheme, ViewerToolbarProps };
|