pptx-svelte-viewer 0.5.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +9 -6
- package/dist/{component-B4CAjgjO.js → component-BkXbcmvL.js} +22670 -18164
- package/dist/i18n/context.d.ts +20 -0
- package/dist/i18n/context.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/translator.d.ts +30 -0
- package/dist/i18n/translator.d.ts.map +1 -0
- package/dist/i18n.d.ts +56 -62
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +765 -605
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -2
- package/dist/theme/index.d.ts +8 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/{translator-nTmCzaSH.js → translator-BTU8751A.js} +1 -1
- package/dist/viewer/collab/collaboration-dialogs.svelte.d.ts +31 -0
- package/dist/viewer/collab/collaboration-dialogs.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-presence-effects.svelte.d.ts +9 -0
- package/dist/viewer/collab/collaboration-presence-effects.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-presence.svelte.d.ts +20 -0
- package/dist/viewer/collab/collaboration-presence.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-provider.d.ts +35 -0
- package/dist/viewer/collab/collaboration-provider.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-remote-sync.d.ts +12 -0
- package/dist/viewer/collab/collaboration-remote-sync.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-session.d.ts +24 -0
- package/dist/viewer/collab/collaboration-session.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-status.d.ts +14 -0
- package/dist/viewer/collab/collaboration-status.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration.svelte.d.ts +55 -0
- package/dist/viewer/collab/collaboration.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/components/props.d.ts +79 -0
- package/dist/viewer/collab/components/props.d.ts.map +1 -0
- package/dist/viewer/collab/components/share-helpers.d.ts +29 -0
- package/dist/viewer/collab/components/share-helpers.d.ts.map +1 -0
- package/dist/viewer/collab/index.d.ts +15 -0
- package/dist/viewer/collab/index.d.ts.map +1 -0
- package/dist/viewer/component.d.ts +13 -0
- package/dist/viewer/component.d.ts.map +1 -0
- package/dist/viewer/components/index.d.ts +7 -0
- package/dist/viewer/components/index.d.ts.map +1 -0
- package/dist/viewer/components/props.d.ts +185 -0
- package/dist/viewer/components/props.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/animations/animation-categories.d.ts +10 -0
- package/dist/viewer/components/ribbon/animations/animation-categories.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/design/theme-swatches.d.ts +16 -0
- package/dist/viewer/components/ribbon/design/theme-swatches.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/insert/shape-glyphs.d.ts +8 -0
- package/dist/viewer/components/ribbon/insert/shape-glyphs.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/ribbon-tabs.d.ts +17 -0
- package/dist/viewer/components/ribbon/ribbon-tabs.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts +67 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/transitions/transition-presets.d.ts +10 -0
- package/dist/viewer/components/ribbon/transitions/transition-presets.d.ts.map +1 -0
- package/dist/viewer/editor/editing-api.d.ts +20 -0
- package/dist/viewer/editor/editing-api.d.ts.map +1 -0
- package/dist/viewer/editor/editor-animation-controller.d.ts +25 -0
- package/dist/viewer/editor/editor-animation-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-arrange-controller.d.ts +24 -0
- package/dist/viewer/editor/editor-arrange-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-arrange-ops.d.ts +28 -0
- package/dist/viewer/editor/editor-arrange-ops.d.ts.map +1 -0
- package/dist/viewer/editor/editor-background-controller.d.ts +21 -0
- package/dist/viewer/editor/editor-background-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-clipboard-controller.d.ts +18 -0
- package/dist/viewer/editor/editor-clipboard-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-clipboard.d.ts +20 -0
- package/dist/viewer/editor/editor-clipboard.d.ts.map +1 -0
- package/dist/viewer/editor/editor-controller-geometry.d.ts +8 -0
- package/dist/viewer/editor/editor-controller-geometry.d.ts.map +1 -0
- package/dist/viewer/editor/editor-controller.svelte.d.ts +43 -0
- package/dist/viewer/editor/editor-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-element-controller.d.ts +21 -0
- package/dist/viewer/editor/editor-element-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-equation-controller.svelte.d.ts +12 -0
- package/dist/viewer/editor/editor-equation-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-find-replace.svelte.d.ts +39 -0
- package/dist/viewer/editor/editor-find-replace.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-format-mutations.d.ts +39 -0
- package/dist/viewer/editor/editor-format-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/editor-format-painter-controller.svelte.d.ts +13 -0
- package/dist/viewer/editor/editor-format-painter-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-geometry.d.ts +29 -0
- package/dist/viewer/editor/editor-geometry.d.ts.map +1 -0
- package/dist/viewer/editor/editor-gestures.d.ts +48 -0
- package/dist/viewer/editor/editor-gestures.d.ts.map +1 -0
- package/dist/viewer/editor/editor-ink-controller.svelte.d.ts +59 -0
- package/dist/viewer/editor/editor-ink-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-ink-gesture.d.ts +37 -0
- package/dist/viewer/editor/editor-ink-gesture.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-action-button.d.ts +13 -0
- package/dist/viewer/editor/editor-insert-action-button.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-chart.d.ts +10 -0
- package/dist/viewer/editor/editor-insert-chart.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-equation.d.ts +5 -0
- package/dist/viewer/editor/editor-insert-equation.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-field.d.ts +17 -0
- package/dist/viewer/editor/editor-insert-field.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-media.d.ts +10 -0
- package/dist/viewer/editor/editor-insert-media.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-smart-art.d.ts +8 -0
- package/dist/viewer/editor/editor-insert-smart-art.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert.d.ts +40 -0
- package/dist/viewer/editor/editor-insert.d.ts.map +1 -0
- package/dist/viewer/editor/editor-keyboard.d.ts +31 -0
- package/dist/viewer/editor/editor-keyboard.d.ts.map +1 -0
- package/dist/viewer/editor/editor-master-controller.d.ts +17 -0
- package/dist/viewer/editor/editor-master-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-mutations.d.ts +59 -0
- package/dist/viewer/editor/editor-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/editor-paragraph-mutations.d.ts +10 -0
- package/dist/viewer/editor/editor-paragraph-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/editor-selection-gestures.d.ts +24 -0
- package/dist/viewer/editor/editor-selection-gestures.d.ts.map +1 -0
- package/dist/viewer/editor/editor-selection.svelte.d.ts +32 -0
- package/dist/viewer/editor/editor-selection.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-slide-ops.d.ts +23 -0
- package/dist/viewer/editor/editor-slide-ops.d.ts.map +1 -0
- package/dist/viewer/editor/editor-slides-controller.d.ts +22 -0
- package/dist/viewer/editor/editor-slides-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-state.svelte.d.ts +102 -0
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-template-controller.d.ts +12 -0
- package/dist/viewer/editor/editor-template-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-text-extra-mutations.d.ts +18 -0
- package/dist/viewer/editor/editor-text-extra-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/editor-transition-controller.d.ts +22 -0
- package/dist/viewer/editor/editor-transition-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-zorder.d.ts +16 -0
- package/dist/viewer/editor/editor-zorder.d.ts.map +1 -0
- package/dist/viewer/editor/element-hit.d.ts +17 -0
- package/dist/viewer/editor/element-hit.d.ts.map +1 -0
- package/dist/viewer/editor/index.d.ts +45 -0
- package/dist/viewer/editor/index.d.ts.map +1 -0
- package/dist/viewer/editor/inline-text.d.ts +36 -0
- package/dist/viewer/editor/inline-text.d.ts.map +1 -0
- package/dist/viewer/editor/types.d.ts +12 -0
- package/dist/viewer/editor/types.d.ts.map +1 -0
- package/dist/viewer/export/export-controller.svelte.d.ts +77 -0
- package/dist/viewer/export/export-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/export/export-gif.d.ts +42 -0
- package/dist/viewer/export/export-gif.d.ts.map +1 -0
- package/dist/viewer/export/export-print.d.ts +55 -0
- package/dist/viewer/export/export-print.d.ts.map +1 -0
- package/dist/viewer/export/export-ui.svelte.d.ts +45 -0
- package/dist/viewer/export/export-ui.svelte.d.ts.map +1 -0
- package/dist/viewer/export/export-video.d.ts +56 -0
- package/dist/viewer/export/export-video.d.ts.map +1 -0
- package/dist/viewer/export/export-wiring.svelte.d.ts +35 -0
- package/dist/viewer/export/export-wiring.svelte.d.ts.map +1 -0
- package/dist/viewer/export/exporting-api.d.ts +19 -0
- package/dist/viewer/export/exporting-api.d.ts.map +1 -0
- package/dist/viewer/export/index.d.ts +16 -0
- package/dist/viewer/export/index.d.ts.map +1 -0
- package/dist/viewer/export/rasterize-slide.d.ts +44 -0
- package/dist/viewer/export/rasterize-slide.d.ts.map +1 -0
- package/dist/viewer/export/render-to-canvas.d.ts +15 -0
- package/dist/viewer/export/render-to-canvas.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +7536 -7597
- package/dist/viewer/index.d.ts.map +1 -0
- package/dist/viewer/index.js +1 -1
- package/dist/viewer/master/master-view.d.ts +7 -0
- package/dist/viewer/master/master-view.d.ts.map +1 -0
- package/dist/viewer/presentation/animation-playback.svelte.d.ts +57 -0
- package/dist/viewer/presentation/animation-playback.svelte.d.ts.map +1 -0
- package/dist/viewer/presentation/apply-animation-styles.d.ts +8 -0
- package/dist/viewer/presentation/apply-animation-styles.d.ts.map +1 -0
- package/dist/viewer/presentation/index.d.ts +10 -0
- package/dist/viewer/presentation/index.d.ts.map +1 -0
- package/dist/viewer/presentation/keyframes.d.ts +3 -0
- package/dist/viewer/presentation/keyframes.d.ts.map +1 -0
- package/dist/viewer/presentation/presentation-controller.svelte.d.ts +69 -0
- package/dist/viewer/presentation/presentation-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/presentation/presentation-effects.svelte.d.ts +31 -0
- package/dist/viewer/presentation/presentation-effects.svelte.d.ts.map +1 -0
- package/dist/viewer/presentation-swipe.d.ts +11 -0
- package/dist/viewer/presentation-swipe.d.ts.map +1 -0
- package/dist/viewer/render/chart-view.d.ts +35 -0
- package/dist/viewer/render/chart-view.d.ts.map +1 -0
- package/dist/viewer/render/contentpart-view.d.ts +24 -0
- package/dist/viewer/render/contentpart-view.d.ts.map +1 -0
- package/dist/viewer/render/index.d.ts +25 -0
- package/dist/viewer/render/index.d.ts.map +1 -0
- package/dist/viewer/render/ink-view.d.ts +25 -0
- package/dist/viewer/render/ink-view.d.ts.map +1 -0
- package/dist/viewer/render/media-view.d.ts +17 -0
- package/dist/viewer/render/media-view.d.ts.map +1 -0
- package/dist/viewer/render/model3d-view.d.ts +16 -0
- package/dist/viewer/render/model3d-view.d.ts.map +1 -0
- package/dist/viewer/render/ole-view.d.ts +44 -0
- package/dist/viewer/render/ole-view.d.ts.map +1 -0
- package/dist/viewer/render/smart-art-3d-view.d.ts +18 -0
- package/dist/viewer/render/smart-art-3d-view.d.ts.map +1 -0
- package/dist/viewer/render/smartart-view.d.ts +54 -0
- package/dist/viewer/render/smartart-view.d.ts.map +1 -0
- package/dist/viewer/render/table-view.d.ts +39 -0
- package/dist/viewer/render/table-view.d.ts.map +1 -0
- package/dist/viewer/render/zoom-view.d.ts +18 -0
- package/dist/viewer/render/zoom-view.d.ts.map +1 -0
- package/dist/viewer/state/autosave.svelte.d.ts +61 -0
- package/dist/viewer/state/autosave.svelte.d.ts.map +1 -0
- package/dist/viewer/state/fullscreen.d.ts +16 -0
- package/dist/viewer/state/fullscreen.d.ts.map +1 -0
- package/dist/viewer/state/index.d.ts +9 -0
- package/dist/viewer/state/index.d.ts.map +1 -0
- package/dist/viewer/state/layout-state.svelte.d.ts +30 -0
- package/dist/viewer/state/layout-state.svelte.d.ts.map +1 -0
- package/dist/viewer/state/loader-helpers.d.ts +27 -0
- package/dist/viewer/state/loader-helpers.d.ts.map +1 -0
- package/dist/viewer/state/navigation.d.ts +26 -0
- package/dist/viewer/state/navigation.d.ts.map +1 -0
- package/dist/viewer/state/presentation-loader.svelte.d.ts +41 -0
- package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -0
- package/dist/viewer/state/render-context.d.ts +9 -0
- package/dist/viewer/state/render-context.d.ts.map +1 -0
- package/dist/viewer/state/smart-art-3d-context.d.ts +22 -0
- package/dist/viewer/state/smart-art-3d-context.d.ts.map +1 -0
- package/dist/viewer/state/viewer-effects.svelte.d.ts +31 -0
- package/dist/viewer/state/viewer-effects.svelte.d.ts.map +1 -0
- package/dist/viewer/state/viewer-state.svelte.d.ts +36 -0
- package/dist/viewer/state/viewer-state.svelte.d.ts.map +1 -0
- package/dist/viewer/state/viewport-handlers.d.ts +24 -0
- package/dist/viewer/state/viewport-handlers.d.ts.map +1 -0
- package/dist/viewer/style/connector-label.d.ts +13 -0
- package/dist/viewer/style/connector-label.d.ts.map +1 -0
- package/dist/viewer/style/css.d.ts +13 -0
- package/dist/viewer/style/css.d.ts.map +1 -0
- package/dist/viewer/style/element-style.d.ts +26 -0
- package/dist/viewer/style/element-style.d.ts.map +1 -0
- package/dist/viewer/style/index.d.ts +5 -0
- package/dist/viewer/style/index.d.ts.map +1 -0
- package/dist/viewer/style/merge-3d.d.ts +10 -0
- package/dist/viewer/style/merge-3d.d.ts.map +1 -0
- package/dist/viewer/style/text-style.d.ts +4 -0
- package/dist/viewer/style/text-style.d.ts.map +1 -0
- package/dist/viewer/types.d.ts +189 -0
- package/dist/viewer/types.d.ts.map +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PptxElement, TextStyle } from 'pptx-viewer-core';
|
|
2
|
+
/** Toggle the paragraph list type between the given kind and `'none'`. */
|
|
3
|
+
export declare function toggleListTypePatch(el: PptxElement, kind: 'bullet' | 'numbered'): Partial<PptxElement>;
|
|
4
|
+
/** Increase or decrease the paragraph left margin by one indent step. */
|
|
5
|
+
export declare function adjustIndentPatch(el: PptxElement, delta: 1 | -1): Partial<PptxElement>;
|
|
6
|
+
/** Set the paragraph alignment. */
|
|
7
|
+
export declare function setAlignPatch(el: PptxElement, align: TextStyle['align']): Partial<PptxElement>;
|
|
8
|
+
/** Set the line spacing multiplier (e.g. 1.15 = 115%). */
|
|
9
|
+
export declare function setLineSpacingPatch(el: PptxElement, lineSpacing: number): Partial<PptxElement>;
|
|
10
|
+
//# sourceMappingURL=editor-paragraph-mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-paragraph-mutations.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-paragraph-mutations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAiB/D,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAClC,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,QAAQ,GAAG,UAAU,GACzB,OAAO,CAAC,WAAW,CAAC,CAItB;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAItF;AAED,mCAAmC;AACnC,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAE9F;AAED,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAE9F"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { MarqueeRect, ResizeHandleId } from 'pptx-viewer-shared';
|
|
3
|
+
import { ElementBoxPatch } from './editor-mutations';
|
|
4
|
+
export interface EditorMarqueeRect extends MarqueeRect {
|
|
5
|
+
additive: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SelectionGestureDeps {
|
|
8
|
+
getScale(): number;
|
|
9
|
+
getStageRect(): DOMRect | undefined;
|
|
10
|
+
getElements(): readonly PptxElement[];
|
|
11
|
+
getSelectedIds(): readonly string[];
|
|
12
|
+
onStart(): void;
|
|
13
|
+
onPatch(id: string, patch: ElementBoxPatch): void;
|
|
14
|
+
onCommit(): void;
|
|
15
|
+
onSelect(ids: readonly string[]): void;
|
|
16
|
+
onMarquee(rect: EditorMarqueeRect | null): void;
|
|
17
|
+
}
|
|
18
|
+
/** Window-level marquee and collective transform driver for the Svelte stage. */
|
|
19
|
+
export declare function createSelectionGestureController(deps: SelectionGestureDeps): {
|
|
20
|
+
beginMarquee(event: PointerEvent): void;
|
|
21
|
+
beginTransform(kind: "move" | "resize", event: PointerEvent, handle?: ResizeHandleId): boolean;
|
|
22
|
+
dispose(): void;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=editor-selection-gestures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-selection-gestures.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-selection-gestures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AASpD,OAAO,KAAK,EAAkB,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACrD,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACpC,QAAQ,IAAI,MAAM,CAAC;IACnB,YAAY,IAAI,OAAO,GAAG,SAAS,CAAC;IACpC,WAAW,IAAI,SAAS,WAAW,EAAE,CAAC;IACtC,cAAc,IAAI,SAAS,MAAM,EAAE,CAAC;IACpC,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAClD,QAAQ,IAAI,IAAI,CAAC;IACjB,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACvC,SAAS,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;CAChD;AAiBD,iFAAiF;AACjF,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,oBAAoB;wBA2FrD,YAAY,GAAG,IAAI;yBAalB,MAAM,GAAG,QAAQ,SAAS,YAAY,WAAW,cAAc,GAAG,OAAO;eAsBnF,IAAI;EAKhB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EditorSelection: the reactive multi-element selection for the Svelte editor.
|
|
3
|
+
*
|
|
4
|
+
* Holds an ordered list of selected element ids; the LAST id is the primary
|
|
5
|
+
* selection (the one the overlay handles, gestures, and inline editing act
|
|
6
|
+
* on), matching the React binding's `selectedElementIds` + primary convention.
|
|
7
|
+
* Plain clicks call {@link set} (single selection), shift/ctrl clicks call
|
|
8
|
+
* {@link toggle} (additive), and mutations that invalidate ids call
|
|
9
|
+
* {@link prune}.
|
|
10
|
+
*/
|
|
11
|
+
export declare class EditorSelection {
|
|
12
|
+
#private;
|
|
13
|
+
/** All selected ids in selection order (primary last). */
|
|
14
|
+
get ids(): readonly string[];
|
|
15
|
+
/** The primary selected id (last selected), or null when empty. */
|
|
16
|
+
get primary(): string | null;
|
|
17
|
+
/** Number of selected elements. */
|
|
18
|
+
get size(): number;
|
|
19
|
+
/** True when `id` is part of the selection. */
|
|
20
|
+
has(id: string): boolean;
|
|
21
|
+
/** Replace the selection with a single id (or clear it with `null`). */
|
|
22
|
+
set(id: string | null): void;
|
|
23
|
+
/** Replace the selection with an explicit id list (primary = last). */
|
|
24
|
+
setAll(ids: readonly string[]): void;
|
|
25
|
+
/** Additive (shift/ctrl-click) toggle: add `id`, or remove it when present. */
|
|
26
|
+
toggle(id: string): void;
|
|
27
|
+
/** Clear the selection. */
|
|
28
|
+
clear(): void;
|
|
29
|
+
/** Drop ids that no longer resolve to an element (after remote/undo edits). */
|
|
30
|
+
prune(exists: (id: string) => boolean): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=editor-selection.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-selection.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-selection.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,qBAAa,eAAe;;IAG3B,0DAA0D;IAC1D,IAAI,GAAG,IAAI,SAAS,MAAM,EAAE,CAE3B;IAED,mEAAmE;IACnE,IAAI,OAAO,IAAI,MAAM,GAAG,IAAI,CAE3B;IAED,mCAAmC;IACnC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,+CAA+C;IAC/C,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,wEAAwE;IACxE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAI5B,uEAAuE;IACvE,MAAM,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAIpC,+EAA+E;IAC/E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAMxB,2BAA2B;IAC3B,KAAK,IAAI,IAAI;IAIb,+EAA+E;IAC/E,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI;CAK5C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PptxSlide } from 'pptx-viewer-core';
|
|
2
|
+
/** Insert a new blank slide immediately after `afterIndex`. Returns its index. */
|
|
3
|
+
export declare function insertBlankSlideAfter(slides: readonly PptxSlide[], afterIndex: number): {
|
|
4
|
+
slides: PptxSlide[];
|
|
5
|
+
newIndex: number;
|
|
6
|
+
};
|
|
7
|
+
/** Duplicate the slide at `index` (fresh slide + element ids). Returns the new index. */
|
|
8
|
+
export declare function duplicateSlideAt(slides: readonly PptxSlide[], index: number): {
|
|
9
|
+
slides: PptxSlide[];
|
|
10
|
+
newIndex: number;
|
|
11
|
+
} | null;
|
|
12
|
+
/** Delete the slide at `index`. Returns the new active index, or `null` when it was the only slide. */
|
|
13
|
+
export declare function deleteSlideAt(slides: readonly PptxSlide[], index: number): {
|
|
14
|
+
slides: PptxSlide[];
|
|
15
|
+
newIndex: number;
|
|
16
|
+
} | null;
|
|
17
|
+
/**
|
|
18
|
+
* Move a slide to a new order index and renumber the resulting deck. The
|
|
19
|
+
* target index is evaluated against the original list, as native drag/drop
|
|
20
|
+
* targets are: dropping slide 1 onto slide 3 produces [2, 3, 1].
|
|
21
|
+
*/
|
|
22
|
+
export declare function moveSlide(slides: readonly PptxSlide[], fromIndex: number, toIndex: number): PptxSlide[] | null;
|
|
23
|
+
//# sourceMappingURL=editor-slide-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-slide-ops.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-slide-ops.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAkBlD,kFAAkF;AAClF,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,GAChB;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAK3C;AAED,yFAAyF;AACzF,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,KAAK,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAUlD;AAED,uGAAuG;AACvG,wBAAgB,aAAa,CAC5B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,KAAK,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAMlD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACxB,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACb,SAAS,EAAE,GAAG,IAAI,CAcpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EditorState } from './editor-state.svelte';
|
|
2
|
+
/**
|
|
3
|
+
* The Home tab's Slides group (new / duplicate / delete slide), split out of
|
|
4
|
+
* `EditorState` to keep it under the repo's 300-LOC budget. Every method
|
|
5
|
+
* returns the new active slide index (or `null` on a no-op) so the caller
|
|
6
|
+
* (the Slides group, via the host's slide-navigation callback) can move the
|
|
7
|
+
* viewer to it; `EditorState` itself has no concept of "the active slide"
|
|
8
|
+
* beyond the `getCurrent` dependency it already reads for element ops.
|
|
9
|
+
*/
|
|
10
|
+
export declare class EditorSlidesController {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(editor: EditorState);
|
|
13
|
+
/** Insert a blank slide after the current one. Returns its new index, or null when not editable. */
|
|
14
|
+
insertSlideAfterCurrent(): number | null;
|
|
15
|
+
/** Duplicate the current slide. Returns its new index, or null when not editable. */
|
|
16
|
+
duplicateCurrentSlide(): number | null;
|
|
17
|
+
/** Delete the current slide. Returns the new active index, or null (not editable / only slide). */
|
|
18
|
+
deleteCurrentSlide(): number | null;
|
|
19
|
+
/** Move an arbitrary thumbnail slide. Returns the selected target index on success. */
|
|
20
|
+
moveSlide(fromIndex: number, toIndex: number): number | null;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=editor-slides-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-slides-controller.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-slides-controller.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;GAOG;AACH,qBAAa,sBAAsB;;gBAGtB,MAAM,EAAE,WAAW;IAI/B,oGAAoG;IACpG,uBAAuB,IAAI,MAAM,GAAG,IAAI;IAYxC,qFAAqF;IACrF,qBAAqB,IAAI,MAAM,GAAG,IAAI;IAkBtC,mGAAmG;IACnG,kBAAkB,IAAI,MAAM,GAAG,IAAI;IAiBnC,uFAAuF;IACvF,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAY5D"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { PptxElement, PptxHandler, PptxSlide, PptxSlideMaster, TextSegment } from 'pptx-viewer-core';
|
|
2
|
+
import { ElementClipboardPayload, TemplateElementMap } from 'pptx-viewer-shared';
|
|
3
|
+
import { EditorAnimationController } from './editor-animation-controller';
|
|
4
|
+
import { EditorArrangeController } from './editor-arrange-controller';
|
|
5
|
+
import { EditorBackgroundController } from './editor-background-controller';
|
|
6
|
+
import { EditorClipboardController } from './editor-clipboard-controller';
|
|
7
|
+
import { EditorElementController } from './editor-element-controller';
|
|
8
|
+
import { EditorEquationController } from './editor-equation-controller.svelte';
|
|
9
|
+
import { EditorFormatPainterController } from './editor-format-painter-controller.svelte';
|
|
10
|
+
import { EditorInkController } from './editor-ink-controller.svelte';
|
|
11
|
+
import { EditorMasterController, MasterViewTarget } from './editor-master-controller';
|
|
12
|
+
import { ElementBoxPatch } from './editor-mutations';
|
|
13
|
+
import { EditorSelection } from './editor-selection.svelte';
|
|
14
|
+
import { EditorSlidesController } from './editor-slides-controller';
|
|
15
|
+
import { EditorTemplateController } from './editor-template-controller';
|
|
16
|
+
import { EditorTransitionController } from './editor-transition-controller';
|
|
17
|
+
import { ZOrderDirection } from './editor-zorder';
|
|
18
|
+
export interface EditorStateDeps {
|
|
19
|
+
getCurrent(): number;
|
|
20
|
+
getHandler(): PptxHandler | null;
|
|
21
|
+
onChange?: () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare class EditorState {
|
|
24
|
+
#private;
|
|
25
|
+
slides: PptxSlide[];
|
|
26
|
+
templateElementsBySlideId: TemplateElementMap;
|
|
27
|
+
slideMasters: PptxSlideMaster[];
|
|
28
|
+
masterViewTarget: MasterViewTarget | null;
|
|
29
|
+
readonly selection: EditorSelection;
|
|
30
|
+
editable: boolean;
|
|
31
|
+
dirty: boolean;
|
|
32
|
+
editTemplateMode: boolean;
|
|
33
|
+
interactionActive: boolean;
|
|
34
|
+
clipboard: ElementClipboardPayload | null;
|
|
35
|
+
readonly clipboardOps: EditorClipboardController;
|
|
36
|
+
readonly elementOps: EditorElementController;
|
|
37
|
+
readonly templateOps: EditorTemplateController;
|
|
38
|
+
readonly slidesOps: EditorSlidesController;
|
|
39
|
+
readonly arrangeOps: EditorArrangeController;
|
|
40
|
+
readonly backgroundOps: EditorBackgroundController;
|
|
41
|
+
readonly transitionOps: EditorTransitionController;
|
|
42
|
+
readonly animationOps: EditorAnimationController;
|
|
43
|
+
readonly inkOps: EditorInkController;
|
|
44
|
+
readonly masterOps: EditorMasterController;
|
|
45
|
+
readonly formatPainter: EditorFormatPainterController;
|
|
46
|
+
readonly equationOps: EditorEquationController;
|
|
47
|
+
constructor(deps: EditorStateDeps);
|
|
48
|
+
get canUndo(): boolean;
|
|
49
|
+
get canRedo(): boolean;
|
|
50
|
+
get selectedElementId(): string | null;
|
|
51
|
+
get selectedElement(): PptxElement | undefined;
|
|
52
|
+
get selectedElements(): PptxElement[];
|
|
53
|
+
get activeElements(): PptxElement[];
|
|
54
|
+
get renderedSlides(): PptxSlide[];
|
|
55
|
+
get hasClipboard(): boolean;
|
|
56
|
+
get currentSlideIndex(): number;
|
|
57
|
+
setSlides(slides: PptxSlide[], slideMasters?: PptxSlideMaster[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* Replace the working slides with a remote (collaboration) snapshot without
|
|
60
|
+
* recording an undo step or touching the dirty flag: the granular reconcile
|
|
61
|
+
* already merged the peer's change, and treating an incoming remote edit as
|
|
62
|
+
* a local mutation would both pollute the undo stack and re-broadcast it.
|
|
63
|
+
*
|
|
64
|
+
* Selection is preserved when the selected element still exists so a remote
|
|
65
|
+
* edit does not yank the local user's selection out from under them. Local
|
|
66
|
+
* undo history is intentionally kept (see the collaboration module JSDoc):
|
|
67
|
+
* shared defines no collaborative-undo semantics, so, matching React/Vue,
|
|
68
|
+
* local undo may fight a concurrent remote edit.
|
|
69
|
+
*/
|
|
70
|
+
applyRemoteSlides(slides: PptxSlide[]): void;
|
|
71
|
+
reset(): void;
|
|
72
|
+
select(id: string | null): void;
|
|
73
|
+
isElementInteractive(id: string): boolean;
|
|
74
|
+
setTemplateEditing(enabled: boolean): void;
|
|
75
|
+
pushHistory(): void;
|
|
76
|
+
commitChange(): void;
|
|
77
|
+
/** Patch geometry without history for live gesture preview frames. */
|
|
78
|
+
patchGeometry: (id: string, box: ElementBoxPatch) => void;
|
|
79
|
+
replaceActiveElements(elements: PptxElement[]): void;
|
|
80
|
+
/** Commit a replacement active element collection as one undo step. */
|
|
81
|
+
commitActiveElements(elements: PptxElement[]): void;
|
|
82
|
+
/**
|
|
83
|
+
* Replace the whole slide array with history (the generic multi-slide
|
|
84
|
+
* mutation entry point: slide add/duplicate/delete, arrange group ops,
|
|
85
|
+
* and find/replace all route through this so every change is a single
|
|
86
|
+
* undoable step). No-op when not editable.
|
|
87
|
+
*/
|
|
88
|
+
commitSlides(next: PptxSlide[]): void;
|
|
89
|
+
deleteSelected: () => void;
|
|
90
|
+
duplicateSelected: () => string | null;
|
|
91
|
+
applyElementPatch: (id: string, patch: Partial<PptxElement>) => void;
|
|
92
|
+
patchSelected: (patch: Partial<PptxElement>) => void;
|
|
93
|
+
insertElement: (element: PptxElement) => string | null;
|
|
94
|
+
reorderSelected: (direction: ZOrderDirection) => void;
|
|
95
|
+
nudgeSelected: (dx: number, dy: number) => void;
|
|
96
|
+
commitInlineText: (id: string, text: string) => void;
|
|
97
|
+
commitNotes: (notes: string, notesSegments?: TextSegment[]) => void;
|
|
98
|
+
undo(): void;
|
|
99
|
+
redo(): void;
|
|
100
|
+
save(): Promise<Uint8Array>;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=editor-state.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-state.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-state.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,SAAS,EACT,eAAe,EACf,WAAW,EACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAQtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,uB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C,OAAO,EAAE,OAAO,GAAG,IAAI;IAQ1C,WAAW,IAAI,IAAI;IAMnB,YAAY,IAAI,IAAI;IAMpB,sEAAsE;IACtE,aAAa,GAAI,IAAI,MAAM,EAAE,KAAK,eAAe,KAAG,IAAI,CAChB;IAExC,qBAAqB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAIpD,uEAAuE;IACvE,oBAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAInD;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI;IAkCrC,cAAc,QAAO,IAAI,CAAqC;IAC9D,iBAAiB,QAAO,MAAM,GAAG,IAAI,CAAwC;IAC7E,iBAAiB,GAAI,IAAI,MAAM,EAAE,OAAO,OAAO,CAAC,WAAW,CAAC,KAAG,IAAI,CACrB;IAC9C,aAAa,GAAI,OAAO,OAAO,CAAC,WAAW,CAAC,KAAG,IAAI,CAAyC;IAC5F,aAAa,GAAI,SAAS,WAAW,KAAG,MAAM,GAAG,IAAI,CAA2C;IAChG,eAAe,GAAI,WAAW,eAAe,KAAG,IAAI,CACR;IAC5C,aAAa,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,KAAG,IAAI,CAA0C;IACxF,gBAAgB,GAAI,IAAI,MAAM,EAAE,MAAM,MAAM,KAAG,IAAI,CAA+C;IAClG,WAAW,GAAI,OAAO,MAAM,EAAE,gBAAgB,WAAW,EAAE,KAAG,IAAI,CACf;IAEnD,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIN,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CAYjC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PptxElement, PptxSlide } from 'pptx-viewer-core';
|
|
2
|
+
import { EditorState } from './editor-state.svelte';
|
|
3
|
+
/** Active-layer routing for normal slide content versus inherited template elements. */
|
|
4
|
+
export declare class EditorTemplateController {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(editor: EditorState);
|
|
7
|
+
activeElements(): PptxElement[];
|
|
8
|
+
renderedSlides(): PptxSlide[];
|
|
9
|
+
replace(elements: PptxElement[]): void;
|
|
10
|
+
commit(elements: PptxElement[]): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=editor-template-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-template-controller.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-template-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wFAAwF;AACxF,qBAAa,wBAAwB;;gBAGxB,MAAM,EAAE,WAAW;IAI/B,cAAc,IAAI,WAAW,EAAE;IAc/B,cAAc,IAAI,SAAS,EAAE;IAI7B,OAAO,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAoBtC,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;CAQrC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { ChangeCaseMode } from 'pptx-viewer-shared';
|
|
3
|
+
/** Toggle the strikethrough flag. */
|
|
4
|
+
export declare function toggleStrikethroughPatch(el: PptxElement): Partial<PptxElement>;
|
|
5
|
+
/** Set the font family, preserving other text-style fields. */
|
|
6
|
+
export declare function setFontFamilyPatch(el: PptxElement, fontFamily: string): Partial<PptxElement>;
|
|
7
|
+
/** Set the character spacing (1/100 pt, OOXML `spc` units). */
|
|
8
|
+
export declare function setCharacterSpacingPatch(el: PptxElement, spacing: number): Partial<PptxElement>;
|
|
9
|
+
/**
|
|
10
|
+
* Rewrite the element's full text to the given case, via the shared
|
|
11
|
+
* `applyCaseTransformToSegments` (selection-free: transforms every run).
|
|
12
|
+
* Falls back to a `textCaps` style toggle for elements with no `textSegments`
|
|
13
|
+
* (e.g. table cells), matching React's behaviour.
|
|
14
|
+
*/
|
|
15
|
+
export declare function changeCasePatch(el: PptxElement, mode: ChangeCaseMode): Partial<PptxElement>;
|
|
16
|
+
/** Reset bold/italic/underline/strikethrough/highlight to their defaults. */
|
|
17
|
+
export declare function clearFormattingPatch(el: PptxElement): Partial<PptxElement>;
|
|
18
|
+
//# sourceMappingURL=editor-text-extra-mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-text-extra-mutations.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-text-extra-mutations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,kBAAkB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAezD,qCAAqC;AACrC,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAG9E;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAE5F;AAED,+DAA+D;AAC/D,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAE/F;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAY3F;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAW1E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PptxTransitionType } from 'pptx-viewer-core';
|
|
2
|
+
import { EditorState } from './editor-state.svelte';
|
|
3
|
+
/**
|
|
4
|
+
* Slide-transition actions for the ribbon's Transitions tab, split out of
|
|
5
|
+
* `EditorState` to keep it under the repo's 300-LOC budget. Playback already
|
|
6
|
+
* reads `PptxSlide.transition` (see `presentation/presentation-controller.svelte.ts`),
|
|
7
|
+
* so this only needs to write that same field, routed through
|
|
8
|
+
* `EditorState.commitSlides` so it is history-integrated (undoable).
|
|
9
|
+
*
|
|
10
|
+
* `applyTransition` covers both the preset gallery buttons and the duration
|
|
11
|
+
* input (the tab re-applies the currently-selected preset whenever the
|
|
12
|
+
* duration changes), plus the "Apply to All Slides" checkbox: when
|
|
13
|
+
* `applyToAll` is true every slide gets the same fresh `{ type, durationMs }`
|
|
14
|
+
* transition; otherwise only the current slide is patched, preserving any
|
|
15
|
+
* advanced fields (direction, sound, ...) it already carried.
|
|
16
|
+
*/
|
|
17
|
+
export declare class EditorTransitionController {
|
|
18
|
+
#private;
|
|
19
|
+
constructor(editor: EditorState);
|
|
20
|
+
applyTransition(type: PptxTransitionType, durationMs: number, applyToAll: boolean): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=editor-transition-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-transition-controller.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-transition-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,qBAAa,0BAA0B;;gBAG1B,MAAM,EAAE,WAAW;IAI/B,eAAe,CAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI;CAoBxF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PptxSlide } from 'pptx-viewer-core';
|
|
2
|
+
/**
|
|
3
|
+
* Z-order (paint-order) reordering for the Svelte editor.
|
|
4
|
+
*
|
|
5
|
+
* The array-level primitives (`bringToFront`, `sendToBack`, `bringForward`,
|
|
6
|
+
* `sendBackward`) are the shared, framework-agnostic operations from
|
|
7
|
+
* `pptx-viewer-shared` (`render/element-operations`), where array index 0 is
|
|
8
|
+
* the back and the last index is the front. This module only lifts them to the
|
|
9
|
+
* slide-array shape the editor state stores, reusing the same immutable
|
|
10
|
+
* `mapSlideElements` helper as the other mutations.
|
|
11
|
+
*/
|
|
12
|
+
/** Which way to move the selected element through the paint-order stack. */
|
|
13
|
+
export type ZOrderDirection = 'front' | 'back' | 'forward' | 'backward';
|
|
14
|
+
/** Reorder the element with `id` on the given slide (immutable). */
|
|
15
|
+
export declare function reorderElement(slides: readonly PptxSlide[], slideIndex: number, id: string, direction: ZOrderDirection): PptxSlide[];
|
|
16
|
+
//# sourceMappingURL=editor-zorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-zorder.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-zorder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK/D;;;;;;;;;GASG;AAEH,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAYxE,oEAAoE;AACpE,wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,eAAe,GACxB,SAAS,EAAE,CAGb"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hit-testing for the editing layer: map a pointer-event target inside the
|
|
3
|
+
* rendered stage back to the TOP-LEVEL slide element it belongs to.
|
|
4
|
+
*
|
|
5
|
+
* Renderers set `data-element-id` on every element root (groups nest their
|
|
6
|
+
* children's roots inside their own), so the innermost match identifies the
|
|
7
|
+
* hit and the outermost ancestor with the attribute identifies the top-level
|
|
8
|
+
* element the editor selects and transforms. Native DOM hit-testing already
|
|
9
|
+
* gives us the visually topmost node, so z-order comes for free.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the top-level element id for an event target within `stageRoot`,
|
|
13
|
+
* or `null` when the target is not inside a rendered element (empty canvas,
|
|
14
|
+
* chrome, overlay).
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveTopLevelElementId(target: EventTarget | null, stageRoot: Element | null): string | null;
|
|
17
|
+
//# sourceMappingURL=element-hit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-hit.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/element-hit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,SAAS,EAAE,OAAO,GAAG,IAAI,GACvB,MAAM,GAAG,IAAI,CAoBf"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type { EditorControllerDeps } from './editor-controller.svelte';
|
|
2
|
+
export { EditorController } from './editor-controller.svelte';
|
|
3
|
+
export type { EditorStateDeps } from './editor-state.svelte';
|
|
4
|
+
export { EditorState } from './editor-state.svelte';
|
|
5
|
+
export { EditorAnimationController } from './editor-animation-controller';
|
|
6
|
+
export { EditorArrangeController } from './editor-arrange-controller';
|
|
7
|
+
export { alignSelectedOnSlide, distributeSelectedOnSlide, flipSelectedOnSlide, groupSelectedOnSlide, ungroupOnSlide, } from './editor-arrange-ops';
|
|
8
|
+
export { EditorBackgroundController } from './editor-background-controller';
|
|
9
|
+
export { copyElementToClipboard, pasteClipboardElement } from './editor-clipboard';
|
|
10
|
+
export { EditorClipboardController } from './editor-clipboard-controller';
|
|
11
|
+
export type { InkDrawTool } from './editor-ink-controller.svelte';
|
|
12
|
+
export { EditorInkController } from './editor-ink-controller.svelte';
|
|
13
|
+
export type { InkGestureController, InkGestureDeps } from './editor-ink-gesture';
|
|
14
|
+
export { createInkGestureController } from './editor-ink-gesture';
|
|
15
|
+
export { EditorSlidesController } from './editor-slides-controller';
|
|
16
|
+
export { EditorTransitionController } from './editor-transition-controller';
|
|
17
|
+
export { deleteSlideAt, duplicateSlideAt, insertBlankSlideAfter, moveSlide, } from './editor-slide-ops';
|
|
18
|
+
export type { FindReplaceDeps } from './editor-find-replace.svelte';
|
|
19
|
+
export { FindReplaceState } from './editor-find-replace.svelte';
|
|
20
|
+
export { adjustIndentPatch, setAlignPatch, setLineSpacingPatch, toggleListTypePatch, } from './editor-paragraph-mutations';
|
|
21
|
+
export { changeCasePatch, clearFormattingPatch, setCharacterSpacingPatch, setFontFamilyPatch, toggleStrikethroughPatch, } from './editor-text-extra-mutations';
|
|
22
|
+
export type { GestureController, GestureDeps, GestureKind, GestureTransform, } from './editor-gestures';
|
|
23
|
+
export { createGestureController } from './editor-gestures';
|
|
24
|
+
export { isCornerHandle, lockResizeAspect, NUDGE_STEP, NUDGE_STEP_LARGE, nudgeDelta, } from './editor-geometry';
|
|
25
|
+
export type { EditorKeyboardDeps } from './editor-keyboard';
|
|
26
|
+
export { createEditorKeydownHandler } from './editor-keyboard';
|
|
27
|
+
export { appendElement, centerOnCanvas, newElementId, newImageElement, newPresetShapeElement, newShapeElement, newTableElement, newTextElement, } from './editor-insert';
|
|
28
|
+
export { buildChartInsertElement } from './editor-insert-chart';
|
|
29
|
+
export { buildEquationInsertElement } from './editor-insert-equation';
|
|
30
|
+
export { buildActionButtonInsertElement } from './editor-insert-action-button';
|
|
31
|
+
export type { FieldInsertContext } from './editor-insert-field';
|
|
32
|
+
export { buildFieldInsertElement, resolveFieldDisplayText } from './editor-insert-field';
|
|
33
|
+
export { buildMediaInsertElement, mediaTypeOfFile } from './editor-insert-media';
|
|
34
|
+
export { buildSmartArtInsertElement } from './editor-insert-smart-art';
|
|
35
|
+
export type { TextFlag } from './editor-format-mutations';
|
|
36
|
+
export { adjustFontSizePatch, fillOpacityOf, highlightColorOf, setFillColorPatch, setFillOpacityPatch, setFontSizePatch, setHighlightColorPatch, setSolidFillPatch, setStrokeColorPatch, setStrokeOpacityPatch, setStrokeWidthPatch, setTextColorPatch, strokeOpacityOf, strokeWidthOf, toggleTextFlagPatch, } from './editor-format-mutations';
|
|
37
|
+
export type { ElementBoxPatch } from './editor-mutations';
|
|
38
|
+
export { cloneSlides, duplicateElementOnSlide, findSlideElement, mapSlideElements, patchElementGeometry, removeElement, updateAllSlides, updateElement, updateSlide, updateSlideNotes, } from './editor-mutations';
|
|
39
|
+
export type { ZOrderDirection } from './editor-zorder';
|
|
40
|
+
export { reorderElement } from './editor-zorder';
|
|
41
|
+
export { resolveTopLevelElementId } from './element-hit';
|
|
42
|
+
export type { InlineTextSurface } from './inline-text';
|
|
43
|
+
export { canInlineEditElement, readEditableText, remapInlineText, resolveInlineSurface, } from './inline-text';
|
|
44
|
+
export type { OverlayBox } from './types';
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAA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ACN,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACpB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PptxElement, TextSegment } from 'pptx-viewer-core';
|
|
2
|
+
/**
|
|
3
|
+
* Pure helpers for inline text editing. The editable surface itself is a
|
|
4
|
+
* Svelte component (`InlineTextEditor.svelte`); this module only holds the
|
|
5
|
+
* framework-agnostic logic: which elements are editable, remapping edited
|
|
6
|
+
* plain text back onto the original rich segments (via the shared
|
|
7
|
+
* `remapTextToSegments`, so per-run styles and field metadata survive), and
|
|
8
|
+
* reading plain text out of a contenteditable surface.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Only elements that carry text (and are not locked) get the inline editor.
|
|
12
|
+
* Equation-bearing text NEVER enters inline editing: the editor would only see
|
|
13
|
+
* the literal "[Equation]" placeholder and committing would permanently drop
|
|
14
|
+
* the OMML (`textSegments[].equationXml`). Mirrors the vanilla/Vue/React guard.
|
|
15
|
+
*/
|
|
16
|
+
export declare function canInlineEditElement(element: PptxElement | undefined): boolean;
|
|
17
|
+
/** Remap edited plain text back onto the element's original segments. */
|
|
18
|
+
export declare function remapInlineText(element: PptxElement, text: string): {
|
|
19
|
+
text: string;
|
|
20
|
+
textSegments: TextSegment[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Read the plain text of a contenteditable back out, translating `<br>` and
|
|
24
|
+
* block-element boundaries into `\n` (contenteditable normalises Enter into
|
|
25
|
+
* nested blocks or `<br>` depending on the browser).
|
|
26
|
+
*/
|
|
27
|
+
export declare function readEditableText(root: HTMLElement): string;
|
|
28
|
+
/** Initial plain text + optional font style for the inline surface. */
|
|
29
|
+
export interface InlineTextSurface {
|
|
30
|
+
text: string;
|
|
31
|
+
fontSize: number | undefined;
|
|
32
|
+
fontFamily: string | undefined;
|
|
33
|
+
}
|
|
34
|
+
/** Resolve the seed text and font hints for an element's inline editor. */
|
|
35
|
+
export declare function resolveInlineSurface(element: PptxElement): InlineTextSurface;
|
|
36
|
+
//# sourceMappingURL=inline-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-text.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/inline-text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAa,MAAM,kBAAkB,CAAC;AAI5E;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAK9E;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAC9B,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,MAAM,GACV;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,WAAW,EAAE,CAAA;CAAE,CAK/C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAwB1D;AAED,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,iBAAiB,CAO5E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared value types for the Svelte editing layer.
|
|
3
|
+
*/
|
|
4
|
+
/** Box geometry in element (unscaled slide) px. */
|
|
5
|
+
export interface OverlayBox {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
rotation: number;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,mDAAmD;AACnD,MAAM,WAAW,UAAU;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { PptxSlide } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize } from 'pptx-viewer-shared';
|
|
3
|
+
import { ExportGifOptions } from './export-gif';
|
|
4
|
+
import { OpenPrintWindow, PrintOptions } from './export-print';
|
|
5
|
+
import { ExportVideoOptions } from './export-video';
|
|
6
|
+
/** Rasterise the slide at `index` to an `HTMLCanvasElement`. Injected so the
|
|
7
|
+
* controller stays DOM-capture-free and unit-testable. */
|
|
8
|
+
export type RasterizeSlide = (index: number) => Promise<HTMLCanvasElement>;
|
|
9
|
+
/** Per-slide progress callback: `(currentSlideIndex, totalSlides)`. */
|
|
10
|
+
export type ExportProgress = (current: number, total: number) => void;
|
|
11
|
+
/** Options for the multi-slide PDF export (progress + cooperative cancel). */
|
|
12
|
+
export interface ExportPdfOptions {
|
|
13
|
+
/** Capture-phase progress callback: `(currentSlide, totalSlides)`. */
|
|
14
|
+
onProgress?: ExportProgress;
|
|
15
|
+
/** Abort the export early; the loop checks this between slides. */
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
export interface ExportControllerDeps {
|
|
19
|
+
/** Live slide count; read fresh on every call. */
|
|
20
|
+
getSlideCount(): number;
|
|
21
|
+
/** Active slide index (0-based); the PNG export's default target. */
|
|
22
|
+
getCurrent(): number;
|
|
23
|
+
/** Live slide canvas size (px), for the PDF page size. */
|
|
24
|
+
getCanvasSize(): CanvasSize;
|
|
25
|
+
/** Live slide list (print needs slide notes/titles, not just the count). */
|
|
26
|
+
getSlides(): PptxSlide[];
|
|
27
|
+
rasterizeSlide: RasterizeSlide;
|
|
28
|
+
/** Print-surface opener override; see `export-print.ts` for the default. */
|
|
29
|
+
openPrintWindow?: OpenPrintWindow;
|
|
30
|
+
/** Base file name (without extension) for downloads. Defaults to `presentation`. */
|
|
31
|
+
fileName?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Export controller (runes class): render slides to PNG / PDF / animated GIF /
|
|
35
|
+
* WebM video, plus the print flow. Started as a Svelte port of Vue's
|
|
36
|
+
* `useExport` composable (`packages/vue/src/viewer/composables/useExport.ts`)
|
|
37
|
+
* and now also covers React's `useExportHandlers` GIF/video surface (via
|
|
38
|
+
* `export-gif.ts` / `export-video.ts`) and Vue's `usePrint`
|
|
39
|
+
* (`export-print.ts`), reshaped as a `$state`-backed class to match this
|
|
40
|
+
* package's runes-class convention (see `EditorState` in
|
|
41
|
+
* `../editor/editor-state.svelte.ts`) rather than Vue `Ref`s.
|
|
42
|
+
*
|
|
43
|
+
* Rasterisation is delegated to the injected `rasterizeSlide` (the host owns
|
|
44
|
+
* the off-screen `SlideStage` mount + `html2canvas-pro`, see
|
|
45
|
+
* `rasterize-slide.ts`). `jspdf` is loaded lazily so it stays out of the main
|
|
46
|
+
* bundle.
|
|
47
|
+
*/
|
|
48
|
+
export declare class ExportController {
|
|
49
|
+
#private;
|
|
50
|
+
/** True while an export is running (disable UI / show a spinner). */
|
|
51
|
+
exporting: boolean;
|
|
52
|
+
constructor(deps: ExportControllerDeps);
|
|
53
|
+
/** Export a single slide as a PNG download. Defaults to the current slide. */
|
|
54
|
+
exportSlidePng(index?: number): Promise<void>;
|
|
55
|
+
/** Export every slide as a multi-page PDF download (one slide per page). */
|
|
56
|
+
exportPdf(options?: ExportPdfOptions): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Export every slide as an animated GIF download. Frame delays come from
|
|
59
|
+
* the shared `planGifFrames` plan (default duration + per-slide overrides);
|
|
60
|
+
* see `export-gif.ts`. Supports progress + AbortSignal like `exportPdf`.
|
|
61
|
+
*/
|
|
62
|
+
exportGif(options?: ExportGifOptions): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Export every slide as a WebM video download (MediaRecorder over a canvas
|
|
65
|
+
* capture stream, timing from the shared `planVideoSegments` plan); see
|
|
66
|
+
* `export-video.ts`. Supports progress + AbortSignal like `exportPdf`.
|
|
67
|
+
*/
|
|
68
|
+
exportVideo(options?: ExportVideoOptions): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Assemble the shared print document for the given (partial) settings and
|
|
71
|
+
* open it in the print surface (hidden iframe by default; see
|
|
72
|
+
* `export-print.ts` for the popup-blocker caveats of custom openers).
|
|
73
|
+
* Resolves `true` when the print surface opened.
|
|
74
|
+
*/
|
|
75
|
+
print(options?: PrintOptions): Promise<boolean>;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=export-controller.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-controller.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/export/export-controller.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD;0DAC0D;AAC1D,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE3E,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEtE,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAChC,sEAAsE;IACtE,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,mEAAmE;IACnE,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACpC,kDAAkD;IAClD,aAAa,IAAI,MAAM,CAAC;IACxB,qEAAqE;IACrE,UAAU,IAAI,MAAM,CAAC;IACrB,0DAA0D;IAC1D,aAAa,IAAI,UAAU,CAAC;IAC5B,4EAA4E;IAC5E,SAAS,IAAI,SAAS,EAAE,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,4EAA4E;IAC5E,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAUD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gBAAgB;;IAC5B,qEAAqE;IACrE,SAAS,UAAiB;gBAId,IAAI,EAAE,oBAAoB;IAItC,8EAA8E;IACxE,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBnD,4EAA4E;IACtE,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B9D;;;;OAIG;IACG,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB9D;;;;OAIG;IACG,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBlE;;;;;OAKG;IACG,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;CAmBzD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ExportProgress, RasterizeSlide } from './export-controller.svelte';
|
|
2
|
+
/**
|
|
3
|
+
* Animated-GIF export capture/encode pipeline. All the pure logic is shared:
|
|
4
|
+
* `planGifFrames` derives the per-slide frame delays (default duration +
|
|
5
|
+
* per-slide overrides), `clampGifDimensions` bounds the output size, and
|
|
6
|
+
* `encodeGif` (median-cut quantisation + LZW GIF89a) produces the bytes with
|
|
7
|
+
* each frame carrying its own plan delay. This module only owns the
|
|
8
|
+
* DOM-adjacent glue: rasterising each slide via the injected capture callback
|
|
9
|
+
* and normalising every frame onto a uniform-size canvas before pixel
|
|
10
|
+
* extraction. Blob download is left to the caller (`ExportController`).
|
|
11
|
+
*/
|
|
12
|
+
/** Options for the animated-GIF export. */
|
|
13
|
+
export interface ExportGifOptions {
|
|
14
|
+
/** Duration each slide is shown, in milliseconds. Default 2000. */
|
|
15
|
+
slideDurationMs?: number;
|
|
16
|
+
/** Per-slide duration overrides in milliseconds (index maps to slide index). */
|
|
17
|
+
slideTimingsMs?: number[];
|
|
18
|
+
/**
|
|
19
|
+
* Longest allowed output side in pixels; frames are scaled down
|
|
20
|
+
* proportionally. Default 960 (GIF encoding cost grows with pixel count:
|
|
21
|
+
* every pixel is matched against a 256-colour palette per frame).
|
|
22
|
+
*/
|
|
23
|
+
maxDimension?: number;
|
|
24
|
+
/** Capture-phase progress callback: `(currentSlide, totalSlides)`. */
|
|
25
|
+
onProgress?: ExportProgress;
|
|
26
|
+
/** Abort the export early; checked before each slide capture. */
|
|
27
|
+
signal?: AbortSignal;
|
|
28
|
+
}
|
|
29
|
+
/** Injected capture dependencies (kept DOM-free for unit tests). */
|
|
30
|
+
export interface GifCaptureDeps {
|
|
31
|
+
/** Live slide count; read fresh on every call. */
|
|
32
|
+
getSlideCount(): number;
|
|
33
|
+
rasterizeSlide: RasterizeSlide;
|
|
34
|
+
/** Canvas factory override (test seam). Defaults to `document.createElement`. */
|
|
35
|
+
createCanvas?: (width: number, height: number) => HTMLCanvasElement;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Capture every slide and encode the sequence as an animated GIF Blob.
|
|
39
|
+
* Rejects with the shared `AbortError` when `signal` aborts between slides.
|
|
40
|
+
*/
|
|
41
|
+
export declare function exportSlidesToGifBlob(deps: GifCaptureDeps, options?: ExportGifOptions): Promise<Blob>;
|
|
42
|
+
//# sourceMappingURL=export-gif.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-gif.d.ts","sourceRoot":"","sources":["../../../src/viewer/export/export-gif.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjF;;;;;;;;;GASG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAChC,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,iEAAiE;IACjE,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC9B,kDAAkD;IAClD,aAAa,IAAI,MAAM,CAAC;IACxB,cAAc,EAAE,cAAc,CAAC;IAC/B,iFAAiF;IACjF,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,iBAAiB,CAAC;CACpE;AA8BD;;;GAGG;AACH,wBAAsB,qBAAqB,CAC1C,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE,gBAAqB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA8Cf"}
|