ooxml-ui 1.41.0 → 1.43.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/dist/base.d.ts +1 -0
- package/dist/building-block-styles.d.ts +1 -0
- package/dist/chart/data-sheet-keys.d.ts +1 -0
- package/dist/chart/data-sheet.d.ts +2 -1
- package/dist/chart/format-pane-3d.d.ts +1 -0
- package/dist/chart/format-pane-advanced-space.d.ts +1 -0
- package/dist/chart/format-pane-analysis.d.ts +1 -0
- package/dist/chart/format-pane-common.d.ts +1 -0
- package/dist/chart/format-pane-fields.d.ts +1 -0
- package/dist/chart/format-pane-fill-line.d.ts +1 -0
- package/dist/chart/format-pane-intent.d.ts +1 -0
- package/dist/chart/format-pane-locales/de.d.ts +1 -0
- package/dist/chart/format-pane-locales/en.d.ts +1 -0
- package/dist/chart/format-pane-text.d.ts +1 -0
- package/dist/chart/format-pane-translate.d.ts +1 -0
- package/dist/chrome/account.d.ts +2 -1
- package/dist/chrome/print-preview.d.ts +2 -1
- package/dist/chrome/ruler.d.ts +2 -1
- package/dist/chrome/status-bar.d.ts +4 -1
- package/dist/chrome/status-bar.d.ts.map +1 -1
- package/dist/chrome/tab-drag.d.ts +1 -0
- package/dist/chrome/task-pane.d.ts +2 -1
- package/dist/{chunk-4RFFOPBU.js → chunk-2ZYRZANE.js} +1 -1
- package/dist/{chunk-Y6KY34VD.js → chunk-I57TCM2Q.js} +57 -11
- package/dist/{chunk-TTT5IQBU.js → chunk-JWBWLGEY.js} +2 -2
- package/dist/{chunk-LBIABP4I.js → chunk-M4ARYL3L.js} +1 -1
- package/dist/{chunk-7L4NP4HN.js → chunk-NH5ZSZMI.js} +1 -1
- package/dist/comments/mentions.d.ts +1 -0
- package/dist/comments/types.d.ts +1 -0
- package/dist/controls.d.ts +2 -0
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +1 -1
- package/dist/dialog/chart-picker.d.ts +2 -1
- package/dist/dialog/dialog-footer.d.ts +2 -1
- package/dist/dialog/dialog-session.d.ts +1 -0
- package/dist/dialog/dialog.d.ts +2 -1
- package/dist/dialog/focus.d.ts +1 -0
- package/dist/dialog/message-dialogs.d.ts +1 -0
- package/dist/dialog/message-dialogs.d.ts.map +1 -1
- package/dist/dialog/options-categories.d.ts +1 -0
- package/dist/dialog/options-controls.d.ts +1 -0
- package/dist/dialog/progress-dialog.d.ts +2 -1
- package/dist/dialog/share-dialog-locales.d.ts +1 -0
- package/dist/dialog/share-dialog.d.ts +2 -1
- package/dist/docx/locales/en-app.d.ts +5 -0
- package/dist/docx/locales/en.d.ts +5 -0
- package/dist/docx/localization-strings.d.ts +5 -0
- package/dist/docx/title-bar.d.ts +2 -1
- package/dist/docx.js +40 -11
- package/dist/files/cloud-files-view.d.ts +1 -0
- package/dist/files/connected-services.d.ts +2 -1
- package/dist/files/open-places.d.ts +2 -1
- package/dist/files/save-progress-label.d.ts +23 -0
- package/dist/files/save-progress-label.d.ts.map +1 -0
- package/dist/fonts/availability.d.ts +1 -0
- package/dist/fonts/catalog.d.ts +1 -0
- package/dist/fonts/custom-fonts.d.ts +1 -0
- package/dist/form/checkbox.d.ts +2 -1
- package/dist/form/color-custom.d.ts +2 -1
- package/dist/form/color-grid.d.ts +2 -1
- package/dist/form/color-input/live-color-leaves.d.ts +1 -0
- package/dist/form/radio.d.ts +2 -1
- package/dist/form/search-field.d.ts +2 -1
- package/dist/form/symbol-picker.d.ts +2 -1
- package/dist/form/zoom-slider.d.ts +2 -1
- package/dist/image-native-size.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/menu/command-search.d.ts +2 -1
- package/dist/menu/context-menu.d.ts +2 -1
- package/dist/menu/menu-item.d.ts +2 -1
- package/dist/notices/paste-options.d.ts +2 -1
- package/dist/notices/toasts.d.ts +2 -1
- package/dist/picture-effects.d.ts +1 -0
- package/dist/picture-standard-filter.d.ts +1 -0
- package/dist/picture-view.d.ts +1 -0
- package/dist/pptx/{chunk-JU3ZV73R.mjs → chunk-5BINBXFV.mjs} +2 -2
- package/dist/pptx/{chunk-J6PRXB72.mjs → chunk-7FTP7OOA.mjs} +3198 -2003
- package/dist/pptx/{chunk-IN46QNJE.mjs → chunk-BA4CJI4U.mjs} +35 -3
- package/dist/pptx/{chunk-7XXOLM7H.cjs → chunk-CK6RYGB4.cjs} +37 -2
- package/dist/pptx/{chunk-RN3JVXVN.cjs → chunk-P4NVINSK.cjs} +3226 -2014
- package/dist/pptx/{chunk-4SZSTDER.cjs → chunk-UGSMMZU6.cjs} +47 -47
- package/dist/pptx/{chunk-SF3MYUTD.mjs → chunk-W2QJX2ON.mjs} +5 -0
- package/dist/pptx/{chunk-WNDGU3GQ.cjs → chunk-ZHVKGGLQ.cjs} +5 -0
- package/dist/pptx/dom/elements/connector.d.ts.map +1 -1
- package/dist/pptx/dom/elements/edge-bleed-restore.d.ts +19 -0
- package/dist/pptx/dom/elements/edge-bleed-restore.d.ts.map +1 -0
- package/dist/pptx/dom/elements/shape-filter-defs.d.ts.map +1 -1
- package/dist/pptx/dom/elements/text-shape.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +441 -398
- package/dist/pptx/dom/index.d.ts +1 -0
- package/dist/pptx/dom/index.d.ts.map +1 -1
- package/dist/pptx/dom/index.mjs +58 -17
- package/dist/pptx/export/html2canvas-clone.cjs +6 -6
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3190 -3110
- package/dist/pptx/index.mjs +3 -3
- package/dist/pptx/render/connector-path.d.ts +15 -0
- package/dist/pptx/render/connector-path.d.ts.map +1 -1
- package/dist/pptx/render/connector-style.d.ts +10 -0
- package/dist/pptx/render/connector-style.d.ts.map +1 -1
- package/dist/pptx/render/controller/index.d.ts +2 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- package/dist/pptx/render/controller/save-progress-controller.d.ts +56 -0
- package/dist/pptx/render/controller/save-progress-controller.d.ts.map +1 -0
- package/dist/pptx/render/device-pixel-stroke.d.ts +43 -6
- package/dist/pptx/render/device-pixel-stroke.d.ts.map +1 -1
- package/dist/pptx/render/effect-profile.d.ts +53 -0
- package/dist/pptx/render/effect-profile.d.ts.map +1 -0
- package/dist/pptx/render/embedded-fonts-sheet.d.ts +25 -0
- package/dist/pptx/render/embedded-fonts-sheet.d.ts.map +1 -0
- package/dist/pptx/render/font-line-gap.d.ts +21 -0
- package/dist/pptx/render/font-line-gap.d.ts.map +1 -0
- package/dist/pptx/render/font-settled.d.ts +14 -0
- package/dist/pptx/render/font-settled.d.ts.map +1 -0
- package/dist/pptx/render/index.d.ts +2 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/morph-animation.d.ts +1 -24
- package/dist/pptx/render/morph-animation.d.ts.map +1 -1
- package/dist/pptx/render/morph-body-carry.d.ts +1 -1
- package/dist/pptx/render/morph-body-carry.d.ts.map +1 -1
- package/dist/pptx/render/morph-carry.d.ts.map +1 -1
- package/dist/pptx/render/morph-effect-carry.d.ts +4 -5
- package/dist/pptx/render/morph-effect-carry.d.ts.map +1 -1
- package/dist/pptx/render/morph-flip-turn.d.ts.map +1 -1
- package/dist/pptx/render/morph-line-carry.d.ts +40 -0
- package/dist/pptx/render/morph-line-carry.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan-carry.d.ts +41 -0
- package/dist/pptx/render/morph-plan-carry.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan-channels.d.ts +30 -0
- package/dist/pptx/render/morph-plan-channels.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan-crossfade.d.ts +23 -0
- package/dist/pptx/render/morph-plan-crossfade.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan-css.d.ts +62 -0
- package/dist/pptx/render/morph-plan-css.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan-lift.d.ts +44 -0
- package/dist/pptx/render/morph-plan-lift.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan-overlay.d.ts +62 -0
- package/dist/pptx/render/morph-plan-overlay.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan-types.d.ts +208 -0
- package/dist/pptx/render/morph-plan-types.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan.d.ts +4 -239
- package/dist/pptx/render/morph-plan.d.ts.map +1 -1
- package/dist/pptx/render/morph-rotation.d.ts +30 -0
- package/dist/pptx/render/morph-rotation.d.ts.map +1 -0
- package/dist/pptx/render/morph-shape-carry-strands.d.ts +36 -0
- package/dist/pptx/render/morph-shape-carry-strands.d.ts.map +1 -0
- package/dist/pptx/render/morph-shape-carry.d.ts +5 -0
- package/dist/pptx/render/morph-shape-carry.d.ts.map +1 -1
- package/dist/pptx/render/morph-soft-edge-blend.d.ts +38 -0
- package/dist/pptx/render/morph-soft-edge-blend.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-body.d.ts +1 -1
- package/dist/pptx/render/morph-text-body.d.ts.map +1 -1
- package/dist/pptx/render/morph-text-frame.d.ts +2 -0
- package/dist/pptx/render/morph-text-frame.d.ts.map +1 -1
- package/dist/pptx/render/morph-text-glyph-plan.d.ts +31 -0
- package/dist/pptx/render/morph-text-glyph-plan.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-glyphs.d.ts +27 -0
- package/dist/pptx/render/morph-text-glyphs.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-lines.d.ts +8 -6
- package/dist/pptx/render/morph-text-lines.d.ts.map +1 -1
- package/dist/pptx/render/morph-text-piece-caps.d.ts +36 -0
- package/dist/pptx/render/morph-text-piece-caps.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-pieces.d.ts +6 -1
- package/dist/pptx/render/morph-text-pieces.d.ts.map +1 -1
- package/dist/pptx/render/morph-text-transform.d.ts +2 -0
- package/dist/pptx/render/morph-text-transform.d.ts.map +1 -1
- package/dist/pptx/render/morph-types.d.ts +11 -2
- package/dist/pptx/render/morph-types.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-baseline-settle.d.ts +8 -0
- package/dist/pptx/render/paragraph-baseline-settle.d.ts.map +1 -0
- package/dist/pptx/render/paragraph-baseline.d.ts +82 -13
- package/dist/pptx/render/paragraph-baseline.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-types.d.ts +6 -0
- package/dist/pptx/render/paragraph-types.d.ts.map +1 -1
- package/dist/pptx/render/status-bar-state.d.ts +7 -1
- package/dist/pptx/render/status-bar-state.d.ts.map +1 -1
- package/dist/pptx/render/stroke-outline.d.ts +7 -0
- package/dist/pptx/render/stroke-outline.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/text-body-layout.d.ts.map +1 -1
- package/dist/pptx/render/text-effects.d.ts +6 -11
- package/dist/pptx/render/text-effects.d.ts.map +1 -1
- package/dist/pptx/render/text-field-substitution.d.ts +13 -14
- package/dist/pptx/render/text-field-substitution.d.ts.map +1 -1
- package/dist/pptx/render/text-line-height.d.ts +8 -8
- package/dist/pptx/render/text-line-height.d.ts.map +1 -1
- package/dist/pptx/render/text-paragraph-style.d.ts +13 -0
- package/dist/pptx/render/text-paragraph-style.d.ts.map +1 -1
- package/dist/pptx/render/text-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/text-shrink-block.d.ts +23 -0
- package/dist/pptx/render/text-shrink-block.d.ts.map +1 -0
- package/dist/pptx/render/visual-effects.d.ts +3 -1
- package/dist/pptx/render/visual-effects.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-GA6ELFRB.mjs → smartart-insert-preview-DXFDFDSC.mjs} +4 -4
- package/dist/pptx/{smartart-insert-preview-PQTEVG7C.cjs → smartart-insert-preview-UP6DYY42.cjs} +5 -5
- package/dist/pptx/web-components/status-bar.d.ts.map +1 -1
- package/dist/render-cache.d.ts +1 -0
- package/dist/ribbon/auto-collapse.d.ts +1 -0
- package/dist/ribbon/button.d.ts +2 -1
- package/dist/ribbon/gallery-styles.d.ts +1 -0
- package/dist/ribbon/keytip-run.d.ts +1 -0
- package/dist/ribbon/overflow.d.ts +1 -0
- package/dist/ribbon/ribbon-section.d.ts +2 -1
- package/dist/ribbon/ribbon-stack.d.ts +2 -1
- package/dist/ribbon/safe-svg.d.ts +1 -0
- package/dist/ribbon/scroll-more.d.ts +1 -0
- package/dist/smartart/smartart-picker.d.ts +2 -1
- package/dist/smartart/smartart-text-pane-tools.d.ts +1 -0
- package/dist/teams.js +2 -2
- package/dist/theme-bridge.d.ts +1 -0
- package/dist/theme.d.ts +1 -0
- package/dist/visio/title-bar.d.ts +3 -1
- package/dist/visio/viewer-backstage.d.ts +2 -0
- package/dist/visio/viewer-file-commands.d.ts +2 -2
- package/dist/visio.js +75 -20
- package/dist/xlsx/editor-files.d.ts +1 -1
- package/dist/xlsx/title-bar.d.ts +2 -1
- package/dist/xlsx.js +21 -12
- package/package.json +2 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which incoming shapes the overlay paints above the ghosts instead of leaving
|
|
3
|
+
* them on the live stage (see {@link MorphTransitionPlan.overlayIncomingElements}).
|
|
4
|
+
*
|
|
5
|
+
* @module render/morph-plan-lift
|
|
6
|
+
*/
|
|
7
|
+
import type { PptxElement } from 'ooxml-core/pptx';
|
|
8
|
+
import type { MorphTextMeasure } from './morph-text-frame.js';
|
|
9
|
+
import type { MorphMode, MorphPair } from './morph-types.js';
|
|
10
|
+
/** Everything {@link resolveMorphLiftedIds} reads about the transition. */
|
|
11
|
+
export interface MorphLiftInput {
|
|
12
|
+
readonly mode: MorphMode;
|
|
13
|
+
readonly measureText: MorphTextMeasure | undefined;
|
|
14
|
+
/** Every matched pair. */
|
|
15
|
+
readonly pairs: readonly MorphPair[];
|
|
16
|
+
/** The pairs not carried piece by piece. */
|
|
17
|
+
readonly wholePairs: readonly MorphPair[];
|
|
18
|
+
readonly ghostIds: ReadonlySet<string>;
|
|
19
|
+
readonly flattenedOutgoing: readonly PptxElement[];
|
|
20
|
+
readonly flattenedIncoming: readonly PptxElement[];
|
|
21
|
+
/** Incoming ids of the pairs carried piece by piece. */
|
|
22
|
+
readonly pieceToIds: ReadonlySet<string>;
|
|
23
|
+
/** Incoming ids a body carry raises above the ghosts. */
|
|
24
|
+
readonly risingIds: Iterable<string>;
|
|
25
|
+
/** Whether the plan holds a container animation for an incoming id. */
|
|
26
|
+
readonly animated: (id: string) => boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The incoming ids the overlay paints above the ghosts.
|
|
30
|
+
*
|
|
31
|
+
* Everything the overlay paints hides whatever the live stage is doing
|
|
32
|
+
* underneath, which is wrong for a shape that ARRIVES on top of a ghost:
|
|
33
|
+
* it dissolves in where nobody can see it and appears in one frame when the
|
|
34
|
+
* overlay is torn down (issue #146 - the wheel's centre disc is unchanged,
|
|
35
|
+
* so its opaque ghost sat over the new title, body and button for the whole
|
|
36
|
+
* morph). Those few move up into the overlay, above the ghosts, and the
|
|
37
|
+
* copy on the stage is held invisible so the two never composite.
|
|
38
|
+
*
|
|
39
|
+
* Only a ghost that KEEPS its opacity counts. One that dissolves is out of
|
|
40
|
+
* the way inside the first quarter, long before an arrival begins to appear,
|
|
41
|
+
* so it hides nothing worth moving an animation for.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveMorphLiftedIds(input: MorphLiftInput): Set<string>;
|
|
44
|
+
//# sourceMappingURL=morph-plan-lift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morph-plan-lift.d.ts","sourceRoot":"","sources":["../../../src/pptx/render/morph-plan-lift.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAMnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1D,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACnD,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,iBAAiB,EAAE,SAAS,WAAW,EAAE,CAAC;IACnD,QAAQ,CAAC,iBAAiB,EAAE,SAAS,WAAW,EAAE,CAAC;IACnD,wDAAwD;IACxD,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;CAC3C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,CA0ExE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assemble the overlay of a plan: hand the lifted arrivals and the piece copies
|
|
3
|
+
* their animations, group the cross-dissolving pairs, and stack everything the
|
|
4
|
+
* overlay paints back to front (see {@link MorphTransitionPlan.overlayStack}).
|
|
5
|
+
*
|
|
6
|
+
* @module render/morph-plan-overlay
|
|
7
|
+
*/
|
|
8
|
+
import type { PptxElement } from 'ooxml-core/pptx';
|
|
9
|
+
import type { MorphCrossfadeGroup } from './morph-crossfade-group.js';
|
|
10
|
+
import type { MorphOverlayLayer } from './morph-overlay-layers.js';
|
|
11
|
+
import type { MorphOverlayStackEntry } from './morph-overlay-stack.js';
|
|
12
|
+
import type { MorphGeneratedAnimations } from './morph-plan-channels.js';
|
|
13
|
+
import type { MorphTextPiecePlan } from './morph-text-piece-plan.js';
|
|
14
|
+
import type { MorphPair } from './morph-types.js';
|
|
15
|
+
/** The maps {@link settleMorphLifts} reads and edits in place. */
|
|
16
|
+
export interface MorphSettleInput {
|
|
17
|
+
readonly durationMs: number;
|
|
18
|
+
readonly lifted: ReadonlySet<string>;
|
|
19
|
+
readonly pieces: MorphTextPiecePlan;
|
|
20
|
+
readonly pieceFromIds: ReadonlySet<string>;
|
|
21
|
+
readonly pieceToIds: ReadonlySet<string>;
|
|
22
|
+
readonly incomingAnimations: Map<string, string>;
|
|
23
|
+
readonly outgoingAnimations: Map<string, string>;
|
|
24
|
+
readonly outlineAnimations: Map<string, string>;
|
|
25
|
+
readonly outlineStrandAnimations: Map<string, string[]>;
|
|
26
|
+
readonly customGeometryAnimations: Map<string, string>;
|
|
27
|
+
/** The plan's keyframes; the hold and the pieces' blocks are appended. */
|
|
28
|
+
readonly keyframes: string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Move each lifted arrival's animation to the overlay and hold its stage copy
|
|
32
|
+
* invisible; hold the piece pairs' stage copies too and drop the animations of
|
|
33
|
+
* the ghosts and outlines the pieces replace.
|
|
34
|
+
*
|
|
35
|
+
* @returns The animations of the copies the overlay paints above the ghosts.
|
|
36
|
+
*/
|
|
37
|
+
export declare function settleMorphLifts(input: MorphSettleInput): Map<string, string>;
|
|
38
|
+
/** Everything {@link assembleMorphOverlay} reads. */
|
|
39
|
+
export interface MorphOverlayInput {
|
|
40
|
+
readonly animations: MorphGeneratedAnimations;
|
|
41
|
+
readonly pairs: readonly MorphPair[];
|
|
42
|
+
readonly wholePairs: readonly MorphPair[];
|
|
43
|
+
readonly ghostIds: ReadonlySet<string>;
|
|
44
|
+
readonly ghostElements: readonly PptxElement[];
|
|
45
|
+
readonly flattenedOutgoing: readonly PptxElement[];
|
|
46
|
+
readonly flattenedIncoming: readonly PptxElement[];
|
|
47
|
+
readonly pieces: MorphTextPiecePlan;
|
|
48
|
+
readonly outgoingAnimations: Map<string, string>;
|
|
49
|
+
/** Edited in place: the pieces' incoming animations join it. */
|
|
50
|
+
readonly overlayIncomingAnimations: Map<string, string>;
|
|
51
|
+
}
|
|
52
|
+
/** What the overlay paints and in which order. */
|
|
53
|
+
export interface MorphOverlay {
|
|
54
|
+
crossfadeGroups: MorphCrossfadeGroup[];
|
|
55
|
+
outgoingElements: PptxElement[];
|
|
56
|
+
overlayIncomingElements: PptxElement[];
|
|
57
|
+
overlayLayers: MorphOverlayLayer[];
|
|
58
|
+
overlayStack: MorphOverlayStackEntry[];
|
|
59
|
+
}
|
|
60
|
+
/** Group, filter and stack the overlay's contents. */
|
|
61
|
+
export declare function assembleMorphOverlay(input: MorphOverlayInput): MorphOverlay;
|
|
62
|
+
//# sourceMappingURL=morph-plan-overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morph-plan-overlay.d.ts","sourceRoot":"","sources":["../../../src/pptx/render/morph-plan-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAkB/C,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,QAAQ,CAAC,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACxD,QAAQ,CAAC,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvD,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA+B7E;AAED,qDAAqD;AACrD,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,aAAa,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,WAAW,EAAE,CAAC;IACnD,QAAQ,CAAC,iBAAiB,EAAE,SAAS,WAAW,EAAE,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,gEAAgE;IAChE,QAAQ,CAAC,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxD;AAED,kDAAkD;AAClD,MAAM,WAAW,YAAY;IAC5B,eAAe,EAAE,mBAAmB,EAAE,CAAC;IACvC,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAChC,uBAAuB,EAAE,WAAW,EAAE,CAAC;IACvC,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,YAAY,EAAE,sBAAsB,EAAE,CAAC;CACvC;AAED,sDAAsD;AACtD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAmD3E"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contract of a morph plan: {@link MorphTransitionPlan} (what a binding
|
|
3
|
+
* plays) and {@link MorphPlanOptions} (the per-binding knobs of building one).
|
|
4
|
+
* `morph-plan` re-exports both and holds the entry point; see its header for
|
|
5
|
+
* how a morph is composed.
|
|
6
|
+
*
|
|
7
|
+
* @module render/morph-plan-types
|
|
8
|
+
*/
|
|
9
|
+
import type { PptxElement } from 'ooxml-core/pptx';
|
|
10
|
+
import type { MorphCrossfadeGroup } from './morph-crossfade-group.js';
|
|
11
|
+
import type { MorphViewSize } from './morph-flip-turn.js';
|
|
12
|
+
import type { MorphOverlayLayer } from './morph-overlay-layers.js';
|
|
13
|
+
import type { MorphOverlayStackEntry } from './morph-overlay-stack.js';
|
|
14
|
+
import type { MorphCopyPart } from './morph-text-body.js';
|
|
15
|
+
import type { MorphTextMeasure } from './morph-text-frame.js';
|
|
16
|
+
/** Everything needed to play one morph transition. */
|
|
17
|
+
export interface MorphTransitionPlan {
|
|
18
|
+
/** All `@keyframes` blocks, to inject as a single stylesheet. */
|
|
19
|
+
keyframesCss: string;
|
|
20
|
+
/** Incoming-slide element id -> CSS `animation` shorthand. */
|
|
21
|
+
incomingAnimations: Map<string, string>;
|
|
22
|
+
/** Outgoing-slide element id -> CSS `animation` shorthand. */
|
|
23
|
+
outgoingAnimations: Map<string, string>;
|
|
24
|
+
/**
|
|
25
|
+
* Incoming-slide element id -> CSS `animation` shorthand for the `<img>`
|
|
26
|
+
* INSIDE that element, never for the element's own container.
|
|
27
|
+
*
|
|
28
|
+
* A picture's source crop (`a:srcRect`, which is what PowerPoint's "Scale
|
|
29
|
+
* Height"/"Scale Width" writes) is painted by transforming the img within
|
|
30
|
+
* its frame, and the frame itself is usually identical on both slides - so
|
|
31
|
+
* this is a separate channel rather than another entry in
|
|
32
|
+
* {@link MorphTransitionPlan.incomingAnimations}, which would collide on the
|
|
33
|
+
* same element id. {@link buildMorphScopedCss} emits it as a descendant
|
|
34
|
+
* rule; a binding that applies animations as inline props instead must
|
|
35
|
+
* target the img itself (issue #148).
|
|
36
|
+
*/
|
|
37
|
+
incomingImageAnimations: Map<string, string>;
|
|
38
|
+
/** Outgoing (ghost) counterpart of {@link MorphTransitionPlan.incomingImageAnimations}. */
|
|
39
|
+
outgoingImageAnimations: Map<string, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Element id -> CSS `animation` shorthand for the PATH of the element's
|
|
42
|
+
* outline overlay (the `<svg data-pptx-outline>` every binding paints a
|
|
43
|
+
* centred or gradient outline with), present only when a shape's outline is
|
|
44
|
+
* re-pathed per frame (see `morph-shape-carry`). Like the image channel it is
|
|
45
|
+
* a descendant rule, emitted by {@link buildMorphScopedCss}; the ids may be
|
|
46
|
+
* incoming, outgoing or copy ids, so each half's rules carry all of them.
|
|
47
|
+
*/
|
|
48
|
+
outlineAnimations?: Map<string, string>;
|
|
49
|
+
/**
|
|
50
|
+
* Element id -> the `animation` shorthand of each strand path of a compound
|
|
51
|
+
* outline, in paint order (each strand is re-pathed on its own); emitted
|
|
52
|
+
* next to {@link MorphTransitionPlan.outlineAnimations}.
|
|
53
|
+
*/
|
|
54
|
+
outlineStrandAnimations?: Map<string, string[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Element id -> CSS `animation` shorthand for the paths of a freeform's
|
|
57
|
+
* custom-geometry `<svg data-pptx-custom-geometry>`, which a binding that
|
|
58
|
+
* paints custom geometry as a vector (rather than a clipped box) stamps;
|
|
59
|
+
* emitted next to {@link MorphTransitionPlan.outlineAnimations}.
|
|
60
|
+
*/
|
|
61
|
+
customGeometryAnimations?: Map<string, string>;
|
|
62
|
+
/**
|
|
63
|
+
* Element id -> CSS `animation` shorthand for the painted strand
|
|
64
|
+
* (`[data-pptx-line]`) of a straight connector, which keeps its width while
|
|
65
|
+
* the wrapper's journey scales (see `morph-line-carry`); emitted next to
|
|
66
|
+
* {@link MorphTransitionPlan.outlineAnimations}.
|
|
67
|
+
*/
|
|
68
|
+
lineAnimations?: Map<string, string>;
|
|
69
|
+
/**
|
|
70
|
+
* Incoming-slide element id -> CSS `animation` shorthand for the copy the
|
|
71
|
+
* overlay paints, above every ghost.
|
|
72
|
+
*
|
|
73
|
+
* These are the arriving shapes a ghost would otherwise hide for the whole
|
|
74
|
+
* transition (see {@link MorphTransitionPlan.overlayIncomingElements}). Their
|
|
75
|
+
* entry in {@link MorphTransitionPlan.incomingAnimations} has been replaced
|
|
76
|
+
* by one that holds them invisible, so the stage copy stays out of the way
|
|
77
|
+
* and only this one is seen.
|
|
78
|
+
*/
|
|
79
|
+
overlayIncomingAnimations: Map<string, string>;
|
|
80
|
+
/**
|
|
81
|
+
* The incoming-slide elements to paint in the overlay ON TOP of
|
|
82
|
+
* {@link MorphTransitionPlan.outgoingElements}, in document order.
|
|
83
|
+
*
|
|
84
|
+
* The overlay is one flat layer above the live stage, which is only faithful
|
|
85
|
+
* while every ghost really does belong on top of everything the stage draws.
|
|
86
|
+
* A shape arriving INSIDE a persisting one does not: the wheel deck's centre
|
|
87
|
+
* disc is unchanged between slides, so its ghost is opaque for the whole
|
|
88
|
+
* morph, and the title and body dissolving in within it were invisible until
|
|
89
|
+
* the overlay came down (issue #146). Painting those here restores the order
|
|
90
|
+
* PowerPoint composites in.
|
|
91
|
+
*
|
|
92
|
+
* Usually empty. A binding renders these with the INCOMING slide as their
|
|
93
|
+
* context, applying {@link MorphTransitionPlan.overlayIncomingAnimations}.
|
|
94
|
+
*
|
|
95
|
+
* A lifted half that is one end of a cross-dissolve is NOT here: it moves
|
|
96
|
+
* into {@link MorphTransitionPlan.crossfadeGroups} so it can be composited
|
|
97
|
+
* with its own ghost.
|
|
98
|
+
*/
|
|
99
|
+
overlayIncomingElements: PptxElement[];
|
|
100
|
+
/**
|
|
101
|
+
* Pairs the overlay paints BOTH halves of, to be rendered as one isolated
|
|
102
|
+
* group blending additively (see `morph-crossfade-group`).
|
|
103
|
+
*
|
|
104
|
+
* Their elements are deliberately absent from
|
|
105
|
+
* {@link MorphTransitionPlan.outgoingElements} and
|
|
106
|
+
* {@link MorphTransitionPlan.overlayIncomingElements}: a binding that renders
|
|
107
|
+
* the groups paints each half exactly once, and one that ignored them would
|
|
108
|
+
* drop the pair rather than paint it twice.
|
|
109
|
+
*
|
|
110
|
+
* A pair that dissolves where it stands also has its dissolve moved OFF the
|
|
111
|
+
* two elements and onto {@link MorphCrossfadeGroup.outgoingAnimation} /
|
|
112
|
+
* {@link MorphCrossfadeGroup.incomingAnimation}, for the binding to put on
|
|
113
|
+
* the wrapper it paints each half in; the elements are then absent from
|
|
114
|
+
* `outgoingAnimations` / `overlayIncomingAnimations` too, so no scoped rule
|
|
115
|
+
* animates them. One that MOVES keeps its animations where they were.
|
|
116
|
+
*
|
|
117
|
+
* Painted above {@link MorphTransitionPlan.overlayIncomingElements}, in the
|
|
118
|
+
* incoming slide's document order.
|
|
119
|
+
*/
|
|
120
|
+
crossfadeGroups: MorphCrossfadeGroup[];
|
|
121
|
+
/**
|
|
122
|
+
* The outgoing slide's elements, in document order, for the binding to
|
|
123
|
+
* render in its transition overlay for the duration of the morph. Most carry
|
|
124
|
+
* an entry in {@link MorphTransitionPlan.outgoingAnimations}: they either
|
|
125
|
+
* fade out in place (no counterpart) or glide onto a counterpart, dissolving
|
|
126
|
+
* into it when the appearance changed.
|
|
127
|
+
*
|
|
128
|
+
* A ghost standing in for an INERT pair deliberately has no entry there and
|
|
129
|
+
* is painted statically. Its keyframes would run from itself to itself, and
|
|
130
|
+
* a running animation would put it on its own compositing layer, whose
|
|
131
|
+
* raster the browser snaps to whole device pixels - visibly shifting a shape
|
|
132
|
+
* that is not supposed to move at all (issue #161).
|
|
133
|
+
*
|
|
134
|
+
* This is a SUBSET of the outgoing slide: a shape the live stage already
|
|
135
|
+
* draws identically is left out, because the overlay is opaque above it and
|
|
136
|
+
* would hide the incoming slide's own arrivals. See `resolveMorphGhostIds`.
|
|
137
|
+
*/
|
|
138
|
+
outgoingElements: PptxElement[];
|
|
139
|
+
/** Outgoing ghost id to the incoming text layout it paints while travelling. */
|
|
140
|
+
outgoingTextReplacements?: ReadonlyMap<string, string>;
|
|
141
|
+
/**
|
|
142
|
+
* {@link MorphTransitionPlan.outgoingElements} and
|
|
143
|
+
* {@link MorphTransitionPlan.overlayIncomingElements} together, in the ONE
|
|
144
|
+
* back-to-front order the overlay must paint them in, as runs of
|
|
145
|
+
* consecutive same-slide shapes (see `morph-overlay-layers`).
|
|
146
|
+
*
|
|
147
|
+
* A binding renders each run as its own stacked layer, in this order: an
|
|
148
|
+
* `'outgoing'` run against the outgoing slide inside a
|
|
149
|
+
* `data-pptx-morph-outgoing` scope, an `'incoming'` run against the incoming
|
|
150
|
+
* slide inside a `data-pptx-morph-lifted` scope. Painting every ghost below
|
|
151
|
+
* every lifted arrival instead let a full-slide picture fading in veil the
|
|
152
|
+
* title travelling above it (issue #141).
|
|
153
|
+
*
|
|
154
|
+
* A run is split wherever a crossfade group belongs inside it, and
|
|
155
|
+
* {@link MorphTransitionPlan.overlayStack} says where each group goes.
|
|
156
|
+
*/
|
|
157
|
+
overlayLayers: MorphOverlayLayer[];
|
|
158
|
+
/**
|
|
159
|
+
* Every run of {@link MorphTransitionPlan.overlayLayers} and every
|
|
160
|
+
* {@link MorphTransitionPlan.crossfadeGroups} group, back to front. Read it
|
|
161
|
+
* through `morphOverlayStackSlots` or `morphOverlayElementSlots` (see
|
|
162
|
+
* `morph-overlay-stack`). Painting every group above every run let three
|
|
163
|
+
* dissolving text columns show through the picture bands the incoming slide
|
|
164
|
+
* stacks above them, then vanish from them when the overlay came down
|
|
165
|
+
* (issue #141, slides 6 to 7).
|
|
166
|
+
*/
|
|
167
|
+
overlayStack: MorphOverlayStackEntry[];
|
|
168
|
+
/**
|
|
169
|
+
* Id -> source id for the copies the overlay paints of a text pair that is
|
|
170
|
+
* carried piece by piece (see `morph-text-piece-plan`). Each copy is in
|
|
171
|
+
* {@link MorphTransitionPlan.crossfadeGroups} as an element of its own; a
|
|
172
|
+
* binding that builds its overlay from a clone of the rendered slide instead
|
|
173
|
+
* clones the source's node under the copy's id.
|
|
174
|
+
*/
|
|
175
|
+
textPieceSources?: ReadonlyMap<string, string>;
|
|
176
|
+
/**
|
|
177
|
+
* Copy id -> the part of its source a copy paints, for a shape whose text is
|
|
178
|
+
* carried apart from its body (see `morph-text-body`): `'body'` without the
|
|
179
|
+
* text, `'text'` without the fill and outline. The copy's element already
|
|
180
|
+
* says so; a binding that clones the source's node strips the other part.
|
|
181
|
+
*/
|
|
182
|
+
morphCopyParts?: ReadonlyMap<string, MorphCopyPart>;
|
|
183
|
+
/** Animation duration in ms, echoed for convenience. */
|
|
184
|
+
durationMs: number;
|
|
185
|
+
}
|
|
186
|
+
/** Per-binding knobs for {@link buildMorphTransitionPlan}. */
|
|
187
|
+
export interface MorphPlanOptions {
|
|
188
|
+
/**
|
|
189
|
+
* The z-index the live stage gives the incoming slide's FIRST top-level
|
|
190
|
+
* element. Stacking-order swaps ride z-index journeys written in the
|
|
191
|
+
* stage's real z space, so a binding that paints master/layout shapes
|
|
192
|
+
* beneath the slide (React's presentation stage) passes their count;
|
|
193
|
+
* a stage that starts the slide at 0 leaves it out.
|
|
194
|
+
*/
|
|
195
|
+
readonly zIndexBase?: number;
|
|
196
|
+
/**
|
|
197
|
+
* How text is measured when a pair's unchanged text is carried line for
|
|
198
|
+
* line (see `morph-text-frame`). Defaults to a canvas; tests pass their own.
|
|
199
|
+
*/
|
|
200
|
+
readonly measureText?: MorphTextMeasure;
|
|
201
|
+
/**
|
|
202
|
+
* The slide's size in element pixels: the camera a turning flip is seen
|
|
203
|
+
* through sits over its centre (see `morph-flip-turn`). Defaults to the
|
|
204
|
+
* 16:9 slide, 1280 x 720.
|
|
205
|
+
*/
|
|
206
|
+
readonly slideSize?: MorphViewSize;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=morph-plan-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morph-plan-types.d.ts","sourceRoot":"","sources":["../../../src/pptx/render/morph-plan-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IACnC,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,8DAA8D;IAC9D,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC;;;;;;;;;;;;OAYG;IACH,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,2FAA2F;IAC3F,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChD;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC;;;;;;;;;OASG;IACH,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C;;;;;;;;;;;;;;;;;;OAkBG;IACH,uBAAuB,EAAE,WAAW,EAAE,CAAC;IACvC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,EAAE,mBAAmB,EAAE,CAAC;IACvC;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAChC,gFAAgF;IAChF,wBAAwB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvD;;;;;;;;;;;;;;;OAeG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC;;;;;;;;OAQG;IACH,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACpD,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC;CACnC"}
|
|
@@ -37,195 +37,13 @@
|
|
|
37
37
|
*
|
|
38
38
|
* @module render/morph-plan
|
|
39
39
|
*/
|
|
40
|
-
import type {
|
|
41
|
-
import type {
|
|
42
|
-
import type { MorphViewSize } from './morph-flip-turn.js';
|
|
43
|
-
import type { MorphOverlayLayer } from './morph-overlay-layers.js';
|
|
44
|
-
import type { MorphOverlayStackEntry } from './morph-overlay-stack.js';
|
|
45
|
-
import type { MorphCopyPart } from './morph-text-body.js';
|
|
46
|
-
import type { MorphTextMeasure } from './morph-text-frame.js';
|
|
40
|
+
import type { PptxSlide } from 'ooxml-core/pptx';
|
|
41
|
+
import type { MorphPlanOptions, MorphTransitionPlan } from './morph-plan-types.js';
|
|
47
42
|
import type { MorphMode } from './morph-types.js';
|
|
48
|
-
|
|
49
|
-
export
|
|
50
|
-
/** All `@keyframes` blocks, to inject as a single stylesheet. */
|
|
51
|
-
keyframesCss: string;
|
|
52
|
-
/** Incoming-slide element id -> CSS `animation` shorthand. */
|
|
53
|
-
incomingAnimations: Map<string, string>;
|
|
54
|
-
/** Outgoing-slide element id -> CSS `animation` shorthand. */
|
|
55
|
-
outgoingAnimations: Map<string, string>;
|
|
56
|
-
/**
|
|
57
|
-
* Incoming-slide element id -> CSS `animation` shorthand for the `<img>`
|
|
58
|
-
* INSIDE that element, never for the element's own container.
|
|
59
|
-
*
|
|
60
|
-
* A picture's source crop (`a:srcRect`, which is what PowerPoint's "Scale
|
|
61
|
-
* Height"/"Scale Width" writes) is painted by transforming the img within
|
|
62
|
-
* its frame, and the frame itself is usually identical on both slides - so
|
|
63
|
-
* this is a separate channel rather than another entry in
|
|
64
|
-
* {@link MorphTransitionPlan.incomingAnimations}, which would collide on the
|
|
65
|
-
* same element id. {@link buildMorphScopedCss} emits it as a descendant
|
|
66
|
-
* rule; a binding that applies animations as inline props instead must
|
|
67
|
-
* target the img itself (issue #148).
|
|
68
|
-
*/
|
|
69
|
-
incomingImageAnimations: Map<string, string>;
|
|
70
|
-
/** Outgoing (ghost) counterpart of {@link MorphTransitionPlan.incomingImageAnimations}. */
|
|
71
|
-
outgoingImageAnimations: Map<string, string>;
|
|
72
|
-
/**
|
|
73
|
-
* Element id -> CSS `animation` shorthand for the PATH of the element's
|
|
74
|
-
* outline overlay (the `<svg data-pptx-outline>` every binding paints a
|
|
75
|
-
* centred or gradient outline with), present only when a shape's outline is
|
|
76
|
-
* re-pathed per frame (see `morph-shape-carry`). Like the image channel it is
|
|
77
|
-
* a descendant rule, emitted by {@link buildMorphScopedCss}; the ids may be
|
|
78
|
-
* incoming, outgoing or copy ids, so each half's rules carry all of them.
|
|
79
|
-
*/
|
|
80
|
-
outlineAnimations?: Map<string, string>;
|
|
81
|
-
/**
|
|
82
|
-
* Element id -> CSS `animation` shorthand for the paths of a freeform's
|
|
83
|
-
* custom-geometry `<svg data-pptx-custom-geometry>`, which a binding that
|
|
84
|
-
* paints custom geometry as a vector (rather than a clipped box) stamps;
|
|
85
|
-
* emitted next to {@link MorphTransitionPlan.outlineAnimations}.
|
|
86
|
-
*/
|
|
87
|
-
customGeometryAnimations?: Map<string, string>;
|
|
88
|
-
/**
|
|
89
|
-
* Incoming-slide element id -> CSS `animation` shorthand for the copy the
|
|
90
|
-
* overlay paints, above every ghost.
|
|
91
|
-
*
|
|
92
|
-
* These are the arriving shapes a ghost would otherwise hide for the whole
|
|
93
|
-
* transition (see {@link MorphTransitionPlan.overlayIncomingElements}). Their
|
|
94
|
-
* entry in {@link MorphTransitionPlan.incomingAnimations} has been replaced
|
|
95
|
-
* by one that holds them invisible, so the stage copy stays out of the way
|
|
96
|
-
* and only this one is seen.
|
|
97
|
-
*/
|
|
98
|
-
overlayIncomingAnimations: Map<string, string>;
|
|
99
|
-
/**
|
|
100
|
-
* The incoming-slide elements to paint in the overlay ON TOP of
|
|
101
|
-
* {@link MorphTransitionPlan.outgoingElements}, in document order.
|
|
102
|
-
*
|
|
103
|
-
* The overlay is one flat layer above the live stage, which is only faithful
|
|
104
|
-
* while every ghost really does belong on top of everything the stage draws.
|
|
105
|
-
* A shape arriving INSIDE a persisting one does not: the wheel deck's centre
|
|
106
|
-
* disc is unchanged between slides, so its ghost is opaque for the whole
|
|
107
|
-
* morph, and the title and body dissolving in within it were invisible until
|
|
108
|
-
* the overlay came down (issue #146). Painting those here restores the order
|
|
109
|
-
* PowerPoint composites in.
|
|
110
|
-
*
|
|
111
|
-
* Usually empty. A binding renders these with the INCOMING slide as their
|
|
112
|
-
* context, applying {@link MorphTransitionPlan.overlayIncomingAnimations}.
|
|
113
|
-
*
|
|
114
|
-
* A lifted half that is one end of a cross-dissolve is NOT here: it moves
|
|
115
|
-
* into {@link MorphTransitionPlan.crossfadeGroups} so it can be composited
|
|
116
|
-
* with its own ghost.
|
|
117
|
-
*/
|
|
118
|
-
overlayIncomingElements: PptxElement[];
|
|
119
|
-
/**
|
|
120
|
-
* Pairs the overlay paints BOTH halves of, to be rendered as one isolated
|
|
121
|
-
* group blending additively (see `morph-crossfade-group`).
|
|
122
|
-
*
|
|
123
|
-
* Their elements are deliberately absent from
|
|
124
|
-
* {@link MorphTransitionPlan.outgoingElements} and
|
|
125
|
-
* {@link MorphTransitionPlan.overlayIncomingElements}: a binding that renders
|
|
126
|
-
* the groups paints each half exactly once, and one that ignored them would
|
|
127
|
-
* drop the pair rather than paint it twice.
|
|
128
|
-
*
|
|
129
|
-
* A pair that dissolves where it stands also has its dissolve moved OFF the
|
|
130
|
-
* two elements and onto {@link MorphCrossfadeGroup.outgoingAnimation} /
|
|
131
|
-
* {@link MorphCrossfadeGroup.incomingAnimation}, for the binding to put on
|
|
132
|
-
* the wrapper it paints each half in; the elements are then absent from
|
|
133
|
-
* `outgoingAnimations` / `overlayIncomingAnimations` too, so no scoped rule
|
|
134
|
-
* animates them. One that MOVES keeps its animations where they were.
|
|
135
|
-
*
|
|
136
|
-
* Painted above {@link MorphTransitionPlan.overlayIncomingElements}, in the
|
|
137
|
-
* incoming slide's document order.
|
|
138
|
-
*/
|
|
139
|
-
crossfadeGroups: MorphCrossfadeGroup[];
|
|
140
|
-
/**
|
|
141
|
-
* The outgoing slide's elements, in document order, for the binding to
|
|
142
|
-
* render in its transition overlay for the duration of the morph. Most carry
|
|
143
|
-
* an entry in {@link MorphTransitionPlan.outgoingAnimations}: they either
|
|
144
|
-
* fade out in place (no counterpart) or glide onto a counterpart, dissolving
|
|
145
|
-
* into it when the appearance changed.
|
|
146
|
-
*
|
|
147
|
-
* A ghost standing in for an INERT pair deliberately has no entry there and
|
|
148
|
-
* is painted statically. Its keyframes would run from itself to itself, and
|
|
149
|
-
* a running animation would put it on its own compositing layer, whose
|
|
150
|
-
* raster the browser snaps to whole device pixels - visibly shifting a shape
|
|
151
|
-
* that is not supposed to move at all (issue #161).
|
|
152
|
-
*
|
|
153
|
-
* This is a SUBSET of the outgoing slide: a shape the live stage already
|
|
154
|
-
* draws identically is left out, because the overlay is opaque above it and
|
|
155
|
-
* would hide the incoming slide's own arrivals. See `resolveMorphGhostIds`.
|
|
156
|
-
*/
|
|
157
|
-
outgoingElements: PptxElement[];
|
|
158
|
-
/** Outgoing ghost id to the incoming text layout it paints while travelling. */
|
|
159
|
-
outgoingTextReplacements?: ReadonlyMap<string, string>;
|
|
160
|
-
/**
|
|
161
|
-
* {@link MorphTransitionPlan.outgoingElements} and
|
|
162
|
-
* {@link MorphTransitionPlan.overlayIncomingElements} together, in the ONE
|
|
163
|
-
* back-to-front order the overlay must paint them in, as runs of
|
|
164
|
-
* consecutive same-slide shapes (see `morph-overlay-layers`).
|
|
165
|
-
*
|
|
166
|
-
* A binding renders each run as its own stacked layer, in this order: an
|
|
167
|
-
* `'outgoing'` run against the outgoing slide inside a
|
|
168
|
-
* `data-pptx-morph-outgoing` scope, an `'incoming'` run against the incoming
|
|
169
|
-
* slide inside a `data-pptx-morph-lifted` scope. Painting every ghost below
|
|
170
|
-
* every lifted arrival instead let a full-slide picture fading in veil the
|
|
171
|
-
* title travelling above it (issue #141).
|
|
172
|
-
*
|
|
173
|
-
* A run is split wherever a crossfade group belongs inside it, and
|
|
174
|
-
* {@link MorphTransitionPlan.overlayStack} says where each group goes.
|
|
175
|
-
*/
|
|
176
|
-
overlayLayers: MorphOverlayLayer[];
|
|
177
|
-
/**
|
|
178
|
-
* Every run of {@link MorphTransitionPlan.overlayLayers} and every
|
|
179
|
-
* {@link MorphTransitionPlan.crossfadeGroups} group, back to front. Read it
|
|
180
|
-
* through `morphOverlayStackSlots` or `morphOverlayElementSlots` (see
|
|
181
|
-
* `morph-overlay-stack`). Painting every group above every run let three
|
|
182
|
-
* dissolving text columns show through the picture bands the incoming slide
|
|
183
|
-
* stacks above them, then vanish from them when the overlay came down
|
|
184
|
-
* (issue #141, slides 6 to 7).
|
|
185
|
-
*/
|
|
186
|
-
overlayStack: MorphOverlayStackEntry[];
|
|
187
|
-
/**
|
|
188
|
-
* Id -> source id for the copies the overlay paints of a text pair that is
|
|
189
|
-
* carried piece by piece (see `morph-text-piece-plan`). Each copy is in
|
|
190
|
-
* {@link MorphTransitionPlan.crossfadeGroups} as an element of its own; a
|
|
191
|
-
* binding that builds its overlay from a clone of the rendered slide instead
|
|
192
|
-
* clones the source's node under the copy's id.
|
|
193
|
-
*/
|
|
194
|
-
textPieceSources?: ReadonlyMap<string, string>;
|
|
195
|
-
/**
|
|
196
|
-
* Copy id -> the part of its source a copy paints, for a shape whose text is
|
|
197
|
-
* carried apart from its body (see `morph-text-body`): `'body'` without the
|
|
198
|
-
* text, `'text'` without the fill and outline. The copy's element already
|
|
199
|
-
* says so; a binding that clones the source's node strips the other part.
|
|
200
|
-
*/
|
|
201
|
-
morphCopyParts?: ReadonlyMap<string, MorphCopyPart>;
|
|
202
|
-
/** Animation duration in ms, echoed for convenience. */
|
|
203
|
-
durationMs: number;
|
|
204
|
-
}
|
|
43
|
+
export { buildMorphAnimationRules, buildMorphOutlineRules, buildMorphScopedCss, } from './morph-plan-css.js';
|
|
44
|
+
export type { MorphPlanOptions, MorphTransitionPlan } from './morph-plan-types.js';
|
|
205
45
|
/** Map a parsed `<p159:morph @option>` onto the engine's granularity mode. */
|
|
206
46
|
export declare function morphOptionToMode(option: string | undefined): MorphMode;
|
|
207
|
-
/** Per-binding knobs for {@link buildMorphTransitionPlan}. */
|
|
208
|
-
export interface MorphPlanOptions {
|
|
209
|
-
/**
|
|
210
|
-
* The z-index the live stage gives the incoming slide's FIRST top-level
|
|
211
|
-
* element. Stacking-order swaps ride z-index journeys written in the
|
|
212
|
-
* stage's real z space, so a binding that paints master/layout shapes
|
|
213
|
-
* beneath the slide (React's presentation stage) passes their count;
|
|
214
|
-
* a stage that starts the slide at 0 leaves it out.
|
|
215
|
-
*/
|
|
216
|
-
readonly zIndexBase?: number;
|
|
217
|
-
/**
|
|
218
|
-
* How text is measured when a pair's unchanged text is carried line for
|
|
219
|
-
* line (see `morph-text-frame`). Defaults to a canvas; tests pass their own.
|
|
220
|
-
*/
|
|
221
|
-
readonly measureText?: MorphTextMeasure;
|
|
222
|
-
/**
|
|
223
|
-
* The slide's size in element pixels: the camera a turning flip is seen
|
|
224
|
-
* through sits over its centre (see `morph-flip-turn`). Defaults to the
|
|
225
|
-
* 16:9 slide, 1280 x 720.
|
|
226
|
-
*/
|
|
227
|
-
readonly slideSize?: MorphViewSize;
|
|
228
|
-
}
|
|
229
47
|
/**
|
|
230
48
|
* Build the render plan for morphing `fromSlide` into `toSlide`.
|
|
231
49
|
*
|
|
@@ -233,57 +51,4 @@ export interface MorphPlanOptions {
|
|
|
233
51
|
* nothing to fade), so a caller can fall back to a plain transition.
|
|
234
52
|
*/
|
|
235
53
|
export declare function buildMorphTransitionPlan(fromSlide: PptxSlide | undefined, toSlide: PptxSlide | undefined, durationMs: number, mode?: MorphMode, options?: MorphPlanOptions): MorphTransitionPlan | undefined;
|
|
236
|
-
/**
|
|
237
|
-
* Render a plan as a self-contained stylesheet that drives the morph purely
|
|
238
|
-
* through CSS, with no per-element prop plumbing.
|
|
239
|
-
*
|
|
240
|
-
* Every binding already stamps `data-element-id` on each rendered element, so
|
|
241
|
-
* scoping rules to an ancestor carrying `scopeAttribute` is enough to animate
|
|
242
|
-
* a whole slide. This is what lets Vue / Angular / Svelte / Vanilla play a
|
|
243
|
-
* morph without threading an animation map through their slide-stage
|
|
244
|
-
* components.
|
|
245
|
-
*
|
|
246
|
-
* @param plan - The plan to render.
|
|
247
|
-
* @param scopeAttribute - Attribute (already present on the ancestor) that
|
|
248
|
-
* scopes these rules, e.g. `data-pptx-morph-incoming`. Pass an empty string
|
|
249
|
-
* to emit document-level rules: element ids embed their slide path, so they
|
|
250
|
-
* are unique to the slide being animated and need no ancestor to disambiguate.
|
|
251
|
-
* That is what lets a binding whose incoming slide is rendered OUTSIDE the
|
|
252
|
-
* overlay (Angular, React) still drive it from here.
|
|
253
|
-
* @param which - Which half to emit: the live stage's `incoming` elements, the
|
|
254
|
-
* overlay's `outgoing` ghosts, or the `lifted` copies the overlay paints over
|
|
255
|
-
* those ghosts (see {@link MorphTransitionPlan.overlayIncomingElements}).
|
|
256
|
-
* @returns Keyframes plus the scoped `animation` rules, ready to inject.
|
|
257
|
-
*/
|
|
258
|
-
export declare function buildMorphScopedCss(plan: MorphTransitionPlan, scopeAttribute: string, which?: 'incoming' | 'outgoing' | 'lifted'): string;
|
|
259
|
-
/**
|
|
260
|
-
* Just the `animation` rules of a plan, with no `@keyframes` block.
|
|
261
|
-
*
|
|
262
|
-
* For a binding that already injects {@link MorphTransitionPlan.keyframesCss}
|
|
263
|
-
* itself and applies the element-level animations some other way (React merges
|
|
264
|
-
* them into its per-element animation state), but still needs the descendant
|
|
265
|
-
* rules that {@link MorphTransitionPlan.incomingImageAnimations} cannot be
|
|
266
|
-
* expressed as an inline style for.
|
|
267
|
-
*
|
|
268
|
-
* @param plan - The plan to render.
|
|
269
|
-
* @param scopeAttribute - As {@link buildMorphScopedCss}.
|
|
270
|
-
* @param which - Which half of the transition to emit.
|
|
271
|
-
* @param only - `'image'` emits only the `<img>` descendant rules; omit for all.
|
|
272
|
-
* @returns The newline-joined rules (no trailing newline); `''` when there are none.
|
|
273
|
-
*/
|
|
274
|
-
export declare function buildMorphAnimationRules(plan: MorphTransitionPlan, scopeAttribute: string, which?: 'incoming' | 'outgoing' | 'lifted', only?: 'image'): string;
|
|
275
|
-
/**
|
|
276
|
-
* The outline-path rules of a plan (see
|
|
277
|
-
* {@link MorphTransitionPlan.outlineAnimations}), keyed on `keyAttribute`.
|
|
278
|
-
*
|
|
279
|
-
* {@link buildMorphAnimationRules} keys them on `data-element-id`; a binding
|
|
280
|
-
* whose overlay paints its halves without that attribute (React's overlay
|
|
281
|
-
* wraps each one in a `data-pptx-morph-outgoing` / `data-pptx-morph-lifted`
|
|
282
|
-
* element named after its id instead) passes that attribute. A re-pathed
|
|
283
|
-
* outline animates the CSS `d` property, so the rules sit behind a support
|
|
284
|
-
* check; without it the static path stays, scaled with its box as before.
|
|
285
|
-
*
|
|
286
|
-
* @returns The rules, or `''` when the plan re-paths no outline.
|
|
287
|
-
*/
|
|
288
|
-
export declare function buildMorphOutlineRules(plan: MorphTransitionPlan, keyAttribute: string, prefix?: string): string;
|
|
289
54
|
//# sourceMappingURL=morph-plan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morph-plan.d.ts","sourceRoot":"","sources":["../../../src/pptx/render/morph-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"morph-plan.d.ts","sourceRoot":"","sources":["../../../src/pptx/render/morph-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EACN,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQvE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACvC,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,SAAoB,EAC1B,OAAO,GAAE,gBAAqB,GAC5B,mBAAmB,GAAG,SAAS,CAwKjC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The turn direction of a morph: the short way round, as PowerPoint takes it.
|
|
3
|
+
*
|
|
4
|
+
* @module render/morph-rotation
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The target angle to animate TO so the element turns the short way round.
|
|
8
|
+
*
|
|
9
|
+
* CSS interpolates `rotate(a)` -> `rotate(b)` numerically, so a pair authored
|
|
10
|
+
* at 315deg and 0deg spins -315deg (almost a full turn anti-clockwise) when
|
|
11
|
+
* the shapes are only 45deg apart. PowerPoint always takes the shorter arc.
|
|
12
|
+
* Returns `fromDeg` plus the delta wrapped into (-180, 180], which is the same
|
|
13
|
+
* final orientation modulo 360 but the rotation a viewer expects: the issue
|
|
14
|
+
* #131 deck's wheel points its arrow at the selected wedge by rotating a ring
|
|
15
|
+
* in 45deg steps, so clicking the neighbouring wedge sent the arrow the long
|
|
16
|
+
* way around the dial.
|
|
17
|
+
*
|
|
18
|
+
* An exact half turn has no shorter arc, and PowerPoint's choice there is not
|
|
19
|
+
* a fixed sign: it turns CLOCKWISE when the shape starts anywhere in
|
|
20
|
+
* [90, 270) and ANTI-clockwise otherwise. Measured on PowerPoint 16 by
|
|
21
|
+
* sampling the rendered frames of a half-turn morph, both on the issue #131
|
|
22
|
+
* wheel (0->180 anti, 45->225 anti, 90->270 clock, 135->315 clock, 180->360
|
|
23
|
+
* clock, 270->90 anti) and on a synthetic two-slide deck built for the purpose
|
|
24
|
+
* (0->180 anti, 45->225 anti, 90->270 clock, 270->90 anti), which agrees on
|
|
25
|
+
* every case. Always taking +180 sent the wheel's arrow round the wrong side
|
|
26
|
+
* for the wedge diametrically opposite the one on screen, so one click in
|
|
27
|
+
* seven looked nothing like the others.
|
|
28
|
+
*/
|
|
29
|
+
export declare function shortestRotationTarget(fromDeg: number, toDeg: number): number;
|
|
30
|
+
//# sourceMappingURL=morph-rotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morph-rotation.d.ts","sourceRoot":"","sources":["../../../src/pptx/render/morph-rotation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAY7E"}
|