pptx-svelte-viewer 1.2.0 → 1.3.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.
@@ -0,0 +1,43 @@
1
+ import { PptxElement, PptxElementAnimation } from 'pptx-viewer-core';
2
+ import { EditorState } from '../../editor/editor-state.svelte';
3
+ /**
4
+ * Svelte-side glue for the docked inspector AnimationPanel: the slide-level
5
+ * commit path plus the small pure bits of React's `useAnimationHandlers` that
6
+ * are not yet in `pptx-viewer-shared` (timeline-bar maths, timeline labels,
7
+ * index-based drag reorder). All field/effect mutations themselves come from
8
+ * the shared `animation-authoring` setters; everything here is orchestration.
9
+ */
10
+ /**
11
+ * Write a new `animations` array onto the current slide as a single undoable
12
+ * step (the Svelte equivalent of React's `onUpdateSlide({ animations })`,
13
+ * which routes through the editor history the same way).
14
+ */
15
+ export declare function commitSlideAnimations(editor: EditorState, animations: PptxElementAnimation[]): void;
16
+ /** Animations sorted by their `order` field (React's `sortedAnimations`). */
17
+ export declare function sortAnimations(animations: readonly PptxElementAnimation[]): PptxElementAnimation[];
18
+ /** One proportional bar in the horizontal timeline strip. */
19
+ export interface TimelineBarDatum {
20
+ anim: PptxElementAnimation;
21
+ leftPercent: number;
22
+ widthPercent: number;
23
+ }
24
+ /**
25
+ * Delay/duration of each animation as percentages of the longest end time
26
+ * (React's `timelineBarData` memo, verbatim maths).
27
+ */
28
+ export declare function buildTimelineBarData(sorted: readonly PptxElementAnimation[]): TimelineBarDatum[];
29
+ /**
30
+ * Human label for a timeline row: the element's text when it has any,
31
+ * otherwise its type label, falling back to a truncated id (React's
32
+ * `getTimelineLabel`).
33
+ */
34
+ export declare function timelineLabel(anim: PptxElementAnimation, elements: readonly PptxElement[]): string;
35
+ /** Effect name shown in a bar's tooltip (React's `animationTypeLabel`). */
36
+ export declare function animationTypeLabel(anim: PptxElementAnimation): string;
37
+ /**
38
+ * Move the animation at `sourceIndex` (in `order`-sorted position) to
39
+ * `targetIndex` and re-normalise `order` (React's drag-drop
40
+ * `reorderAnimations`).
41
+ */
42
+ export declare function reorderAnimationsByIndex(animations: readonly PptxElementAnimation[], sourceIndex: number, targetIndex: number): PptxElementAnimation[];
43
+ //# sourceMappingURL=animation-panel-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation-panel-helpers.d.ts","sourceRoot":"","sources":["../../../../src/viewer/components/inspector/animation-panel-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;;;;GAMG;AAEH;;;;GAIG;AACH,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,oBAAoB,EAAE,GAChC,IAAI,CAMN;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAC7B,UAAU,EAAE,SAAS,oBAAoB,EAAE,GACzC,oBAAoB,EAAE,CAExB;AAED,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,GAAG,gBAAgB,EAAE,CAiBhG;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC5B,IAAI,EAAE,oBAAoB,EAC1B,QAAQ,EAAE,SAAS,WAAW,EAAE,GAC9B,MAAM,CAOR;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,UAAU,EAAE,SAAS,oBAAoB,EAAE,EAC3C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GACjB,oBAAoB,EAAE,CAQxB"}
@@ -0,0 +1,42 @@
1
+ import { PptxAnimationDirection, PptxAnimationPreset, PptxAnimationRepeatMode, PptxAnimationSequence, PptxAnimationTimingCurve, PptxAnimationTrigger } from 'pptx-viewer-core';
2
+ /**
3
+ * Option catalogs for the docked inspector AnimationPanel, mirroring React's
4
+ * `animation-panel-constants.ts` exactly: the same preset subsets (the docked
5
+ * panel intentionally offers fewer presets than the ribbon galleries), the
6
+ * same trigger / timing-curve / repeat / direction / sequence options, and
7
+ * the same `pptx.animation.*` label keys. Values come from the shared
8
+ * catalogs' vocabulary; labels resolve through the shared dictionary.
9
+ */
10
+ /** Entrance presets offered by the docked panel (React parity subset). */
11
+ export declare const PANEL_ENTRANCE_PRESETS: readonly PptxAnimationPreset[];
12
+ /** Exit presets offered by the docked panel (React parity subset). */
13
+ export declare const PANEL_EXIT_PRESETS: readonly PptxAnimationPreset[];
14
+ /** Emphasis presets offered by the docked panel (React parity subset). */
15
+ export declare const PANEL_EMPHASIS_PRESETS: readonly PptxAnimationPreset[];
16
+ export declare const PANEL_TRIGGER_OPTIONS: ReadonlyArray<{
17
+ value: PptxAnimationTrigger;
18
+ labelKey: string;
19
+ }>;
20
+ export declare const PANEL_TIMING_CURVE_OPTIONS: ReadonlyArray<{
21
+ value: PptxAnimationTimingCurve;
22
+ labelKey: string;
23
+ }>;
24
+ export declare const PANEL_REPEAT_MODE_OPTIONS: ReadonlyArray<{
25
+ value: 'none' | PptxAnimationRepeatMode;
26
+ labelKey: string;
27
+ }>;
28
+ /**
29
+ * Direction picker options. Like React's icon choice (fromTop renders a
30
+ * down-pointing arrow: the motion direction), each glyph points where the
31
+ * element travels, not where it comes from.
32
+ */
33
+ export declare const PANEL_DIRECTION_OPTIONS: ReadonlyArray<{
34
+ value: PptxAnimationDirection;
35
+ labelKey: string;
36
+ glyph: string;
37
+ }>;
38
+ export declare const PANEL_SEQUENCE_OPTIONS: ReadonlyArray<{
39
+ value: PptxAnimationSequence;
40
+ labelKey: string;
41
+ }>;
42
+ //# sourceMappingURL=animation-panel-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation-panel-options.d.ts","sourceRoot":"","sources":["../../../../src/viewer/components/inspector/animation-panel-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;GAOG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAAkC,CAAC;AAEpG,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,EAAE,SAAS,mBAAmB,EAAqC,CAAC;AAEnG,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAQhE,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC;IACjD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CACjB,CAMA,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,aAAa,CAAC;IACtD,KAAK,EAAE,wBAAwB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CACjB,CAKA,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAAa,CAAC;IACrD,KAAK,EAAE,MAAM,GAAG,uBAAuB,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;CACjB,CAIA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC;IACnD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACd,CAKA,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC;IAClD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CACjB,CAKA,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { PptxElementAnimation } from 'pptx-viewer-core';
2
+ /**
3
+ * Play the animation entry's effect on its canvas element. Cancels any
4
+ * running preview first; cleans itself up when the effect ends.
5
+ */
6
+ export declare function startAnimationPreview(anim: PptxElementAnimation): void;
7
+ /** Stop the running preview (if any) and restore the element's inline style. */
8
+ export declare function stopAnimationPreview(): void;
9
+ //# sourceMappingURL=animation-preview-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation-preview-control.d.ts","sourceRoot":"","sources":["../../../../src/viewer/components/inspector/animation-preview-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAyB7D;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CA2CtE;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,IAAI,IAAI,CAY3C"}
@@ -1,4 +1,4 @@
1
- import { a as o, c as a, d as s, f as t, i as r, l, n as i, o as S, p as d, r as n, s as p, t as v, u as x } from "../export-CalS6VEm.js";
1
+ import { a as o, c as a, d as s, f as t, i as r, l, n as i, o as S, p as d, r as n, s as p, t as v, u as x } from "../export-D7pIn3W2.js";
2
2
  export {
3
3
  v as PowerPointViewer,
4
4
  a as PresentationLoader,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-svelte-viewer",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Svelte 5 PowerPoint viewer component: render PPTX slides in the browser.",
5
5
  "keywords": [
6
6
  "office",
@@ -66,8 +66,10 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@lucide/svelte": "^1.25.0",
69
+ "fast-xml-parser": "^5.10.1",
69
70
  "html2canvas-pro": "^2.2.4",
70
- "jspdf": "^4.2.1"
71
+ "jspdf": "^4.2.1",
72
+ "jszip": "^3.10.1"
71
73
  },
72
74
  "devDependencies": {
73
75
  "@microsoft/api-extractor": "^7.58.11",
@@ -86,8 +88,6 @@
86
88
  "yjs": "^13.6.31"
87
89
  },
88
90
  "peerDependencies": {
89
- "fast-xml-parser": "^5.10.1",
90
- "jszip": "^3.10.1",
91
91
  "svelte": "^5.0.0"
92
92
  },
93
93
  "optionalDependencies": {