@office-kit/pptx-editor 0.0.0-stage → 0.1.1

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,104 @@
1
+ import { SlideAnimationStep } from "@office-kit/pptx";
2
+
3
+ //#region src/core/animation-player.d.ts
4
+ /** Why a step is not played. */
5
+ type UnsupportedReason = "notInMainSeq" | "notModelled" | "unknownTiming" | "ambiguousTarget";
6
+ interface UnsupportedAnimation {
7
+ readonly step: SlideAnimationStep;
8
+ readonly reason: UnsupportedReason;
9
+ }
10
+ /** What one step does to its target, and when, within its stop. */
11
+ interface AnimationItem {
12
+ readonly step: SlideAnimationStep;
13
+ /**
14
+ * `'emphasis'` animates a shape that is already on the slide and leaves it
15
+ * there, so unlike the other two it never decides whether the shape is shown.
16
+ */
17
+ readonly kind: "entrance" | "exit" | "emphasis";
18
+ /** Milliseconds from the start of the stop. */
19
+ readonly begin: number;
20
+ /** Null when the tree states no length. */
21
+ readonly duration: number | null;
22
+ }
23
+ /** One click's worth of animation. */
24
+ interface AnimationStop {
25
+ readonly items: AnimationItem[];
26
+ /** True when the slide starts it itself, with no click — its first step
27
+ * runs with or after a predecessor it does not have. */
28
+ readonly auto: boolean;
29
+ }
30
+ interface AnimationPlan {
31
+ readonly stops: AnimationStop[];
32
+ readonly unsupported: UnsupportedAnimation[];
33
+ }
34
+ interface AnimationProgress {
35
+ readonly cursor: number;
36
+ readonly stops: number;
37
+ /** How long the stop in hand has been running; null once it has settled. */
38
+ readonly elapsed: number | null;
39
+ /** Bumped by every call that sets where the slide stands. */
40
+ readonly generation: number;
41
+ }
42
+ interface AnimationPlayerOptions {
43
+ /**
44
+ * Where the slide was drawn (a shadow root is fine), or a function returning
45
+ * it. A function is asked again on every query, because a transition draws
46
+ * the slide into a layer of its own and the layer beside it holds a
47
+ * different slide whose shapes may carry the very same ids.
48
+ */
49
+ readonly root: ParentNode | (() => ParentNode);
50
+ readonly steps: readonly SlideAnimationStep[] | null | undefined;
51
+ /**
52
+ * Asked afresh on every advance, so a viewer who turns reduced motion on
53
+ * mid-show gets the rest of the deck without motion — in the same order.
54
+ */
55
+ readonly reducedMotion?: () => boolean;
56
+ /**
57
+ * Called whenever the cursor moves and whenever the slide changes by itself
58
+ * — a delayed effect arriving, an effect finishing — so a view mirroring the
59
+ * slide never lags behind what the audience can see.
60
+ */
61
+ readonly onChange?: (player: AnimationPlayer) => void;
62
+ }
63
+ interface AnimationPlayer {
64
+ readonly cursor: number;
65
+ readonly stopCount: number;
66
+ /** True while a click still has an effect to play on this slide. */
67
+ readonly pending: boolean;
68
+ /** True while an effect already started is still on its way. */
69
+ readonly running: boolean;
70
+ readonly progress: AnimationProgress;
71
+ /**
72
+ * The steps this player does not run, so a caller can say so rather than let
73
+ * a slide look as though it has no animation.
74
+ */
75
+ readonly unsupported: UnsupportedAnimation[];
76
+ reset(): void;
77
+ /** Plays the next stop. False when the slide has none left. */
78
+ advance(): boolean;
79
+ /** Takes one stop back, showing everything before it. False at the start. */
80
+ back(): boolean;
81
+ /** Moves straight to a point in the click order, without motion. */
82
+ jumpTo(next: number): void;
83
+ /**
84
+ * Shows the moment another view of the same slide is showing: the stops
85
+ * before `next` played out, and the one it is on started `elapsed` ago — so
86
+ * an effect waiting on a delay over there has not arrived here either, and
87
+ * one half-way through a fade is half-way through it here.
88
+ */
89
+ resume(next: number, elapsed: number | null): void;
90
+ /** Everything the slide ends with — what a still preview shows. */
91
+ finish(): void;
92
+ dispose(): void;
93
+ }
94
+ /**
95
+ * Groups the steps into the stops the viewer clicks through, with each step's
96
+ * start measured from the beginning of its stop, and lists the steps that are
97
+ * left out with the reason why.
98
+ */
99
+ declare const buildAnimationStops: (steps: readonly SlideAnimationStep[] | null | undefined) => AnimationPlan;
100
+ /** Plays a slide's animations against a rendered SVG. */
101
+ declare const createAnimationPlayer: (options: AnimationPlayerOptions) => AnimationPlayer;
102
+ //#endregion
103
+ export { buildAnimationStops, createAnimationPlayer };
104
+ //# sourceMappingURL=animation-player.d.ts.map
@@ -0,0 +1,2 @@
1
+ import { n as createAnimationPlayer, t as buildAnimationStops } from "../animation-player-D2mt2MI8.js";
2
+ export { buildAnimationStops, createAnimationPlayer };
@@ -0,0 +1,33 @@
1
+ import { i as EditorOptions, n as EditorHandle } from "./index-BFQN6sI6.js";
2
+
3
+ //#region src/core/dev-host.d.ts
4
+ /** What `@office-kit/pptx-editor/internal` adds to a mount for `@office-kit/pptx-dev`. */
5
+ interface DevHostOptions {
6
+ /**
7
+ * The editor runs in the preview's frame, whose page presents slide shows
8
+ * and hosts the Agents pane over `postMessage`.
9
+ */
10
+ readonly previewFrame?: boolean;
11
+ /**
12
+ * Shows Help ▸ Feedback, opening `url` in a new tab. A host that embeds the
13
+ * editor owns its own support channel, so the public `mountEditor` shows no
14
+ * feedback entry point and the editor bundle carries no feedback URL.
15
+ */
16
+ readonly feedback?: {
17
+ readonly url: string;
18
+ };
19
+ }
20
+ //#endregion
21
+ //#region src/internal.d.ts
22
+ /**
23
+ * `mountEditor` for `pptx-dev`'s editor page. Inside the preview's frame
24
+ * (`previewFrame`), Slide Show, Reading View, Rehearse Timings and the Agents
25
+ * pane button talk to that page over `postMessage`, and the editor reports the
26
+ * slide being edited to it. `feedback` adds Help ▸ Feedback, which hosts of the
27
+ * public `mountEditor` never get.
28
+ * @internal
29
+ */
30
+ declare function mountDevEditor(target: HTMLElement, options: EditorOptions, dev: DevHostOptions): EditorHandle;
31
+ //#endregion
32
+ export { type DevHostOptions, mountDevEditor };
33
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { i as devHostOptions, t as mountEditor } from "./src-BrBOgen_.js";
2
+ //#region src/internal.ts
3
+ /**
4
+ * `mountEditor` for `pptx-dev`'s editor page. Inside the preview's frame
5
+ * (`previewFrame`), Slide Show, Reading View, Rehearse Timings and the Agents
6
+ * pane button talk to that page over `postMessage`, and the editor reports the
7
+ * slide being edited to it. `feedback` adds Help ▸ Feedback, which hosts of the
8
+ * public `mountEditor` never get.
9
+ * @internal
10
+ */
11
+ function mountDevEditor(target, options, dev) {
12
+ devHostOptions.set(options, dev);
13
+ return mountEditor(target, options);
14
+ }
15
+ //#endregion
16
+ export { mountDevEditor };
17
+
18
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","names":[],"sources":["../src/internal.ts"],"sourcesContent":["// UNSTABLE, NOT PUBLIC API. `@office-kit/pptx-editor/internal` and\n// `@office-kit/pptx-editor/internal/animation-player` exist only for\n// `@office-kit/pptx-dev`. They change or disappear in any release, without\n// notice. Everything else the dev host needs goes through `mountEditor`.\n\nimport { mountEditor, type EditorHandle, type EditorOptions } from './index.ts';\nimport { devHostOptions, type DevHostOptions } from './core/dev-host.ts';\n\nexport type { DevHostOptions } from './core/dev-host.ts';\n\n/**\n * `mountEditor` for `pptx-dev`'s editor page. Inside the preview's frame\n * (`previewFrame`), Slide Show, Reading View, Rehearse Timings and the Agents\n * pane button talk to that page over `postMessage`, and the editor reports the\n * slide being edited to it. `feedback` adds Help ▸ Feedback, which hosts of the\n * public `mountEditor` never get.\n * @internal\n */\nexport function mountDevEditor(\n target: HTMLElement,\n options: EditorOptions,\n dev: DevHostOptions,\n): EditorHandle {\n devHostOptions.set(options, dev);\n return mountEditor(target, options);\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAgB,eACd,QACA,SACA,KACc;CACd,eAAe,IAAI,SAAS,GAAG;CAC/B,OAAO,YAAY,QAAQ,OAAO;AACpC"}
@@ -0,0 +1,2 @@
1
+ import { a as mergeDecks, i as describeConflict, n as DeckMerge, r as comparablePart, t as DeckConflict } from "./deck-merge-r5VCQNH_.js";
2
+ export { type DeckConflict, type DeckMerge, comparablePart, describeConflict, mergeDecks };
package/dist/merge.js ADDED
@@ -0,0 +1,2 @@
1
+ import { n as describeConflict, r as mergeDecks, t as comparablePart } from "./deck-merge-B_Damj97.js";
2
+ export { comparablePart, describeConflict, mergeDecks };