pptx-svelte-viewer 3.0.2 → 3.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{AiChatPanel-DlAHbsyI.js → AiChatPanel-nB6eEd7u.js} +1 -1
  3. package/dist/{export-Bdkc32jU.js → export-DHNhKSg6.js} +34251 -31129
  4. package/dist/i18n.js +1 -1
  5. package/dist/index.d.ts +196 -6
  6. package/dist/index.js +2 -2
  7. package/dist/pptx-svelte-viewer.css +1 -1
  8. package/dist/{translator-CAcsC5k6.js → translator-Dkvcrdba.js} +24 -0
  9. package/dist/viewer/components/props-elements.d.ts +13 -0
  10. package/dist/viewer/components/props-elements.d.ts.map +1 -1
  11. package/dist/viewer/components/props-stage.d.ts +4 -0
  12. package/dist/viewer/components/props-stage.d.ts.map +1 -1
  13. package/dist/viewer/components/ribbon/anchored-popup.d.ts.map +1 -1
  14. package/dist/viewer/components/ribbon/animations/animation-timeline-editing.d.ts +9 -7
  15. package/dist/viewer/components/ribbon/animations/animation-timeline-editing.d.ts.map +1 -1
  16. package/dist/viewer/editor/editor-ink-controller.svelte.d.ts +5 -2
  17. package/dist/viewer/editor/editor-ink-controller.svelte.d.ts.map +1 -1
  18. package/dist/viewer/editor/editor-ink-gesture.d.ts.map +1 -1
  19. package/dist/viewer/editor/editor-transition-controller.d.ts +8 -1
  20. package/dist/viewer/editor/editor-transition-controller.d.ts.map +1 -1
  21. package/dist/viewer/export/export-wiring.svelte.d.ts +4 -0
  22. package/dist/viewer/export/export-wiring.svelte.d.ts.map +1 -1
  23. package/dist/viewer/export/rasterize-slide.d.ts +20 -0
  24. package/dist/viewer/export/rasterize-slide.d.ts.map +1 -1
  25. package/dist/viewer/index.d.ts +223 -8
  26. package/dist/viewer/index.js +1 -1
  27. package/dist/viewer/render/ole-view.d.ts.map +1 -1
  28. package/dist/viewer/state/area-chart-3d-context.d.ts +19 -0
  29. package/dist/viewer/state/area-chart-3d-context.d.ts.map +1 -0
  30. package/dist/viewer/state/bar-chart-3d-context.d.ts +19 -0
  31. package/dist/viewer/state/bar-chart-3d-context.d.ts.map +1 -0
  32. package/dist/viewer/state/create-viewer-state-export-notes.svelte.d.ts +4 -0
  33. package/dist/viewer/state/create-viewer-state-export-notes.svelte.d.ts.map +1 -1
  34. package/dist/viewer/state/create-viewer-state-types.d.ts +4 -0
  35. package/dist/viewer/state/create-viewer-state-types.d.ts.map +1 -1
  36. package/dist/viewer/state/create-viewer-state.svelte.d.ts.map +1 -1
  37. package/dist/viewer/state/index.d.ts +4 -0
  38. package/dist/viewer/state/index.d.ts.map +1 -1
  39. package/dist/viewer/state/line-chart-3d-context.d.ts +19 -0
  40. package/dist/viewer/state/line-chart-3d-context.d.ts.map +1 -0
  41. package/dist/viewer/state/pie-chart-3d-context.d.ts +19 -0
  42. package/dist/viewer/state/pie-chart-3d-context.d.ts.map +1 -0
  43. package/dist/viewer/state/viewer-state-options.d.ts.map +1 -1
  44. package/dist/viewer/types.d.ts +43 -0
  45. package/dist/viewer/types.d.ts.map +1 -1
  46. package/package.json +4 -4
package/dist/i18n.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as s, c as e, i as t, n as r, o, r as n, s as i, t as l } from "./translator-CAcsC5k6.js";
1
+ import { a as s, c as e, i as t, n as r, o, r as n, s as i, t as l } from "./translator-Dkvcrdba.js";
2
2
  export {
3
3
  o as LOCALE_CATALOG,
4
4
  l as createTranslator,
package/dist/index.d.ts CHANGED
@@ -1678,6 +1678,32 @@ interface TextStyle {
1678
1678
  textReflectionEndOpacity?: number;
1679
1679
  /** Text reflection offset distance in px. */
1680
1680
  textReflectionOffset?: number;
1681
+ /**
1682
+ * Text reflection fade direction (`a:rPr/a:effectLst/a:reflection/@fadeDir`)
1683
+ * in degrees. Mirrors `ShapeStyle.reflectionFadeDirection`.
1684
+ */
1685
+ textReflectionFadeDirection?: number;
1686
+ /**
1687
+ * Text reflection horizontal scaling (`@sx`), same units as
1688
+ * `ShapeStyle.reflectionScaleX` (1000ths of a percent, e.g. 100000 = 100%).
1689
+ */
1690
+ textReflectionScaleX?: number;
1691
+ /** Text reflection vertical scaling (`@sy`). See `ShapeStyle.reflectionScaleY`. */
1692
+ textReflectionScaleY?: number;
1693
+ /**
1694
+ * Text reflection horizontal skew (`@kx`) in 60000ths of a degree. See
1695
+ * `ShapeStyle.reflectionSkewX`.
1696
+ */
1697
+ textReflectionSkewX?: number;
1698
+ /** Text reflection vertical skew (`@ky`). See `ShapeStyle.reflectionSkewY`. */
1699
+ textReflectionSkewY?: number;
1700
+ /**
1701
+ * Text reflection independent rotation (`@rot`) in degrees. See
1702
+ * `ShapeStyle.reflectionRotation`.
1703
+ */
1704
+ textReflectionRotation?: number;
1705
+ /** Text reflection anchor (`@algn`). See `ShapeStyle.reflectionAlignment`. */
1706
+ textReflectionAlignment?: 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
1681
1707
  /** 3D extrusion/bevel settings on the text body. */
1682
1708
  text3d?: Text3DStyle;
1683
1709
  /** 3D scene (camera + light rig) settings on the text body (`a:bodyPr/a:scene3d`). */
@@ -5379,6 +5405,21 @@ interface ContentPartInkStroke {
5379
5405
  * variable-width strokes that reflect stylus/pen pressure.
5380
5406
  */
5381
5407
  pressures?: number[];
5408
+ /**
5409
+ * Per-point pen-tilt lean direction (radians), decoded from the source
5410
+ * InkML's `OTx`/`OTy` tilt-offset channels or its `AZIMUTH` channel.
5411
+ *
5412
+ * When present (paired with {@link tiltMagnitudes}), the renderer widens
5413
+ * each point perpendicular to the lean direction, approximating a
5414
+ * calligraphic (chisel-tip) nib. Absent when the source declared no tilt
5415
+ * channel, in which case rendering is unaffected.
5416
+ */
5417
+ tiltAngles?: number[];
5418
+ /**
5419
+ * Per-point pen-tilt strength (0 upright, 1 maximally leaned), paired with
5420
+ * {@link tiltAngles}.
5421
+ */
5422
+ tiltMagnitudes?: number[];
5382
5423
  }
5383
5424
  /**
5384
5425
  * A content-part element wrapped in `mc:AlternateContent`.
@@ -5937,6 +5978,19 @@ interface PptxNativeAnimation {
5937
5978
  scaleZoomContents?: boolean;
5938
5979
  /** Parsed `p:tav` keyframes from `p:tavLst` (CT_TLAnimVariantList). */
5939
5980
  keyframes?: PptxAnimationKeyframe[];
5981
+ /**
5982
+ * The attribute {@link keyframes} drives, from the SAME node's
5983
+ * `p:cBhvr/p:attrNameLst/p:attrName` (ECMA-376 S19.5.4). `p:tavLst` is
5984
+ * schema-generic: without this, playback could see a numeric ramp but not
5985
+ * know whether it targeted opacity, position, colour, or something with
5986
+ * no CSS mapping. Lowercased and trimmed; common values seen in the wild
5987
+ * (and written by this codebase's own animation writer) include
5988
+ * `"style.opacity"`, `"style.color"`, `"style.visibility"`, `"fillcolor"`,
5989
+ * `"stroke.color"`, `"r"` (rotation, only meaningful on `p:animRot`), and
5990
+ * `"ppt_x"` / `"ppt_y"` (position, normally driven via `p:animMotion`
5991
+ * instead). Absent when the behaviour carries no `p:attrNameLst`.
5992
+ */
5993
+ attrName?: string;
5940
5994
  /** Repeat count (e.g. `2`, `Infinity` for indefinite). */
5941
5995
  repeatCount?: number;
5942
5996
  /** Whether the animation plays in reverse after completion. */
@@ -6038,6 +6092,17 @@ interface PptxNativeAnimation {
6038
6092
  textTarget?: PptxTextAnimationTarget;
6039
6093
  /** Whether this animation is inside an exclusive container (`p:excl`). */
6040
6094
  exclusive?: boolean;
6095
+ /**
6096
+ * Identifies which `p:excl` container this animation belongs to, when
6097
+ * {@link exclusive} is set. ECMA-376 S19.5.24 CT_TLExclusiveTimeNode: at
6098
+ * most one direct child of an exclusive container may be active at a
6099
+ * time, so starting one child stops any other currently-playing child of
6100
+ * the SAME container. Two different `p:excl` containers on the same slide
6101
+ * are independent groups; this id (assigned per container encountered
6102
+ * during parsing, stable only within one parse's animation list) lets
6103
+ * playback tell them apart. Absent when {@link exclusive} is unset.
6104
+ */
6105
+ exclGroupId?: number;
6041
6106
  /** Command type from `p:cmd` (@_type: call/evt/verb). */
6042
6107
  commandType?: string;
6043
6108
  /** Command string from `p:cmd` (@_cmd). */
@@ -6321,6 +6386,52 @@ interface PptxElementAnimation {
6321
6386
  soundPath?: string;
6322
6387
  /** Whether to stop any currently playing sound (`p:endSnd`). */
6323
6388
  stopSound?: boolean;
6389
+ /**
6390
+ * Pending, not-yet-embedded sound chosen in the authoring UI, as a
6391
+ * `data:audio/...;base64,...` URL. Mirrors the `imageData` /
6392
+ * `mediaData` pending-embed convention used elsewhere in the typed model:
6393
+ * on save, the writer converts this to real bytes under `ppt/media/`,
6394
+ * mints a relationship, and replaces this field with the resolved
6395
+ * {@link soundRId} / {@link soundPath}. Cleared once embedded.
6396
+ */
6397
+ soundData?: string;
6398
+ /**
6399
+ * Display name for the chosen sound (e.g. the uploaded file's name),
6400
+ * shown by the authoring UI's sound picker. Purely cosmetic; has no
6401
+ * OOXML equivalent and is not required for playback.
6402
+ */
6403
+ soundFileName?: string;
6404
+ }
6405
+ /**
6406
+ * A read-only anchor representing one of the deck's own effect groups: a
6407
+ * top-level click group (`p:par` under `p:timing`'s main sequence) that this
6408
+ * app did not author, so it is never exposed as an editable
6409
+ * {@link PptxElementAnimation}.
6410
+ *
6411
+ * The authoring UI merges these anchors alongside `PptxSlide.animations` to
6412
+ * render the FULL animation sequence (editor-authored and deck-native
6413
+ * effects together) and lets an editor-authored entry be dragged to any
6414
+ * position relative to them. `order` is the anchor's position among ALL
6415
+ * top-level click groups (editor-owned and native) at load time, in the same
6416
+ * numbering space as {@link PptxElementAnimation.order}, so the two
6417
+ * populations sort into one coherent timeline.
6418
+ *
6419
+ * Anchors are never written back: on save, an untouched anchor's own click
6420
+ * group is repositioned (if an editor-authored effect was dragged past it)
6421
+ * but never mutated, so the deck's own effect stays byte-identical apart
6422
+ * from its position in the sequence.
6423
+ */
6424
+ interface PptxAnimationTimelineAnchor {
6425
+ /**
6426
+ * Position of this group among all top-level click groups in the main
6427
+ * animation sequence at load time (dense, shared with editor entries'
6428
+ * `order`).
6429
+ */
6430
+ order: number;
6431
+ /** Shape id(s) this group's effects target, for a readable UI label. */
6432
+ targetIds: string[];
6433
+ /** Effect preset classes present in the group (entr/exit/emph/path). */
6434
+ presetClasses: Array<'entr' | 'exit' | 'emph' | 'path'>;
6324
6435
  }
6325
6436
  //#endregion
6326
6437
  //#region src/core/types/embedded-font.d.ts
@@ -7024,8 +7135,19 @@ interface PptxSlideTransition {
7024
7135
  soundLoop?: boolean;
7025
7136
  /** Resolved transition sound media path within the package. */
7026
7137
  soundPath?: string;
7027
- /** Human-readable sound file name (extracted from soundPath). */
7138
+ /** Human-readable sound file name (extracted from soundPath, or set by the
7139
+ * UI when a new file is picked, before it has a soundPath at all). */
7028
7140
  soundFileName?: string;
7141
+ /**
7142
+ * A newly-picked local sound file awaiting embedding, as a `data:` URL.
7143
+ * Set by the transitions ribbon's Sound picker (`applyTransitionSoundFile`
7144
+ * in `pptx-viewer-shared`) when the user chooses a file that is not yet
7145
+ * part of the package; mirrors `imageData`/`mediaData` on picture and media
7146
+ * elements. The save pipeline (`embedTransitionSound`) writes the bytes to
7147
+ * `ppt/media/`, mints a relationship, sets `soundRId`/`soundPath`, and
7148
+ * clears this field so a later save does not re-embed the same bytes.
7149
+ */
7150
+ soundData?: string;
7029
7151
  /**
7030
7152
  * When true, the transition stops the currently-playing sound (OOXML `p:sndAc/p:endSnd`).
7031
7153
  * Mutually exclusive with `soundRId`/`soundPath` (which use `p:stSnd`).
@@ -7299,17 +7421,29 @@ interface PptxSlide {
7299
7421
  backgroundPattern?: PptxSlideBackgroundPattern;
7300
7422
  /**
7301
7423
  * `<p:bgPr/@shadeToTitle>`: boolean flag instructing the renderer to
7302
- * shade the background toward the title placeholder colour. Captured
7303
- * for lossless round-trip only; no renderer applies the visual effect.
7304
- * Documented as a known no-op in `docs/guide/limitations.md` (legacy
7305
- * PowerPoint 97-2003 hint, not observed in any real-world corpus file
7306
- * and not settable from any modern PowerPoint UI).
7424
+ * shade the background gradient toward the title placeholder's text
7425
+ * colour. Parsed and round-tripped here on the core model; the actual
7426
+ * visual effect is applied by `pptx-viewer-shared`'s
7427
+ * `getSlideBackgroundStyle` (see `render/background-shade-to-title.ts`),
7428
+ * consumed by all five bindings, not by core itself. That module's
7429
+ * docstring explains the approximation: no published ECMA-376 or
7430
+ * MS-ODRAWXML text documents the exact legacy blend. Legacy PowerPoint
7431
+ * 97-2003 hint, not observed in any real-world corpus file this project
7432
+ * has collected and not settable from any modern PowerPoint UI; see
7433
+ * `docs/guide/limitations.md`.
7307
7434
  *
7308
7435
  * ECMA-376 §19.3.1.2 (CT_BackgroundProperties).
7309
7436
  */
7310
7437
  backgroundShadeToTitle?: boolean;
7311
7438
  transition?: PptxSlideTransition;
7312
7439
  animations?: PptxElementAnimation[];
7440
+ /**
7441
+ * Read-only anchors for the deck's own (non-editor-authored) effect
7442
+ * groups, merged with `animations` by the authoring UI so drag-to-reorder
7443
+ * can target any position in the full sequence. See
7444
+ * {@link PptxAnimationTimelineAnchor}.
7445
+ */
7446
+ animationTimelineAnchors?: PptxAnimationTimelineAnchor[];
7313
7447
  /** Native OOXML animation data parsed from `p:timing`. */
7314
7448
  nativeAnimations?: PptxNativeAnimation[];
7315
7449
  /** Preserved raw `p:timing` XML for lossless round-trip of native animations. */
@@ -8701,12 +8835,25 @@ interface IPptxHandlerRuntimeFactory {
8701
8835
  */
8702
8836
  /** Supported encryption algorithms. */
8703
8837
  type EncryptionAlgorithm = 'AES128' | 'AES256';
8838
+ /**
8839
+ * Which OOXML encryption scheme to write when creating a password-protected
8840
+ * file. Real PowerPoint can write and open either scheme; this library
8841
+ * defaults to 'agile' (Office 2010+), matching PowerPoint's own default.
8842
+ */
8843
+ type EncryptionScheme = 'agile' | 'standard';
8704
8844
  /** Encryption options for creating encrypted files. */
8705
8845
  interface EncryptionOptions {
8706
8846
  /** The encryption algorithm to use (defaults to AES256). */
8707
8847
  algorithm?: EncryptionAlgorithm;
8708
8848
  /** Number of hash iterations for key derivation (defaults to 100000). Lower values speed up tests. */
8709
8849
  spinCount?: number;
8850
+ /**
8851
+ * Which encryption scheme to write (defaults to 'agile'). 'standard'
8852
+ * writes the ECMA-376 Standard scheme (Office 2007-compatible: a single
8853
+ * password-derived AES-CBC key with a zero IV over the whole package),
8854
+ * mirroring the scheme this library already knows how to decrypt.
8855
+ */
8856
+ encryptionScheme?: EncryptionScheme;
8710
8857
  }
8711
8858
  //#endregion
8712
8859
  //#region src/core/PptxHandlerCore.d.ts
@@ -10321,6 +10468,49 @@ interface PowerPointViewerProps {
10321
10468
  * to the SVG surface renderer. Default `false`.
10322
10469
  */
10323
10470
  surfaceChart3D?: boolean;
10471
+ /**
10472
+ * Opt in to the interactive Three.js bar3D-chart renderer. When `true`,
10473
+ * `bar3D` charts render as camera-orbitable real box meshes (drag to
10474
+ * rotate, scroll to zoom) instead of the flat SVG oblique-projection
10475
+ * illusion. Chart marks are not selectable/draggable in this mode.
10476
+ * Requires the optional `three` peer dependency; when it is not installed
10477
+ * (or the chart has no plottable grid, or it is a horizontal 3-D Bar), the
10478
+ * viewer transparently falls back to the flat SVG bar3D renderer. Default
10479
+ * `false`.
10480
+ */
10481
+ barChart3D?: boolean;
10482
+ /**
10483
+ * Opt in to the interactive Three.js line3D-chart renderer. When `true`,
10484
+ * `line3D` charts render as a camera-orbitable real tube-path mesh per
10485
+ * series, one per depth ("series") plane (drag to rotate, scroll to zoom),
10486
+ * instead of the flat SVG oblique-projection illusion. Chart marks are not
10487
+ * selectable/draggable in this mode. Requires the optional `three` peer
10488
+ * dependency; when it is not installed (or the chart has no plottable
10489
+ * grid), the viewer transparently falls back to the flat SVG line3D
10490
+ * renderer. Default `false`.
10491
+ */
10492
+ lineChart3D?: boolean;
10493
+ /**
10494
+ * Opt in to the interactive Three.js area3D-chart renderer. When `true`,
10495
+ * `area3D` charts render as a camera-orbitable real tube path + filled
10496
+ * ribbon mesh per series, one per depth ("series") plane (drag to rotate,
10497
+ * scroll to zoom), instead of the flat SVG oblique-projection illusion.
10498
+ * Chart marks are not selectable/draggable in this mode. Requires the
10499
+ * optional `three` peer dependency; when it is not installed (or the chart
10500
+ * has no plottable grid), the viewer transparently falls back to the flat
10501
+ * SVG area3D renderer. Default `false`.
10502
+ */
10503
+ areaChart3D?: boolean;
10504
+ /**
10505
+ * Opt in to the interactive Three.js pie3D-chart renderer. When `true`,
10506
+ * `pie3D` charts render as camera-orbitable real wedge meshes (drag to
10507
+ * rotate, scroll to zoom) instead of the flat SVG oblique-projection
10508
+ * illusion. Chart marks are not selectable/draggable in this mode.
10509
+ * Requires the optional `three` peer dependency; when it is not installed
10510
+ * (or the chart has no plottable series), the viewer transparently falls
10511
+ * back to the flat SVG pie3D renderer. Default `false`.
10512
+ */
10513
+ pieChart3D?: boolean;
10324
10514
  /**
10325
10515
  * Enable in-place editing: click to select an element, drag to move, use the
10326
10516
  * 8 handles to resize (Shift locks aspect) and the rotate handle to rotate,
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as e, G as a, J as t, K as o, Q as i, W as r, X as n, Y as l, Z as S, a as d, at as m, c as p, ct as T, dt as v, et as P, ft as g, it as u, l as h, lt as c, mt as A, nt as C, o as N, ot as f, pt as k, q as D, rt as E, s as x, st as b, t as B, tt as I, u as O, ut as _ } from "./export-Bdkc32jU.js";
2
- import { i as R } from "./translator-CAcsC5k6.js";
1
+ import { $ as e, G as a, J as t, K as o, Q as i, W as r, X as n, Y as l, Z as S, a as d, at as m, c as p, ct as T, dt as v, et as P, ft as g, it as u, l as h, lt as c, mt as A, nt as C, o as N, ot as f, pt as k, q as D, rt as E, s as x, st as b, t as B, tt as I, u as O, ut as _ } from "./export-DHNhKSg6.js";
2
+ import { i as R } from "./translator-Dkvcrdba.js";
3
3
  import "./i18n.js";
4
4
  export {
5
5
  r as PPTX_OPEN_ACCEPT,