pptx-svelte-viewer 0.5.1 → 0.6.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 +2 -0
- package/README.md +9 -6
- package/dist/{component-B4CAjgjO.js → component-NIMULjW3.js} +20911 -16737
- 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/index.d.ts +765 -605
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/theme/index.d.ts +8 -0
- package/dist/theme/index.d.ts.map +1 -0
- 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/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,29 @@
|
|
|
1
|
+
import { BoxTransform, InteractionBox, ResizeHandleId } from 'pptx-viewer-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Small geometry helpers the shared `element-interaction` module does not
|
|
4
|
+
* cover: Shift-to-lock-aspect on corner resizes and arrow-key nudge steps.
|
|
5
|
+
* Pure math only (mirrors the vanilla binding's `editor-geometry`); no Svelte
|
|
6
|
+
* or DOM dependencies, so it is unit-testable in isolation.
|
|
7
|
+
*/
|
|
8
|
+
/** Arrow-key nudge step in element px (Shift multiplies to the large step). */
|
|
9
|
+
export declare const NUDGE_STEP = 1;
|
|
10
|
+
export declare const NUDGE_STEP_LARGE = 10;
|
|
11
|
+
/** True for the four corner handles (the ones Shift aspect-locks). */
|
|
12
|
+
export declare function isCornerHandle(handle: ResizeHandleId): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Constrain a corner resize (already computed by the shared `applyResize`) to
|
|
15
|
+
* the start box's aspect ratio: the axis with the larger relative change wins
|
|
16
|
+
* and the other follows, keeping the anchored (opposite) corner fixed. Edge
|
|
17
|
+
* handles are returned unchanged; aspect-locking a one-axis handle would
|
|
18
|
+
* fight the drag direction.
|
|
19
|
+
*/
|
|
20
|
+
export declare function lockResizeAspect(resized: BoxTransform, start: InteractionBox, handle: ResizeHandleId, minSize?: number): BoxTransform;
|
|
21
|
+
/**
|
|
22
|
+
* Map an arrow key to a nudge delta in element px, or `null` for other keys.
|
|
23
|
+
* `large` (Shift held) uses the 10px step.
|
|
24
|
+
*/
|
|
25
|
+
export declare function nudgeDelta(key: string, large: boolean): {
|
|
26
|
+
dx: number;
|
|
27
|
+
dy: number;
|
|
28
|
+
} | null;
|
|
29
|
+
//# sourceMappingURL=editor-geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-geometry.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-geometry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvF;;;;;GAKG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAInC,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,MAAyB,GAChC,YAAY,CA0Bd;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAczF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { InteractionBox, ResizeHandleId, SnapLine, SnapSibling } from 'pptx-viewer-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Pointer gesture driver for the editing overlay: move / resize / rotate.
|
|
4
|
+
*
|
|
5
|
+
* All geometry math comes from the shared `element-interaction` helpers
|
|
6
|
+
* (`applyDragDelta`, `applyResize`, `computeRotation`, `snapAngle`) plus the
|
|
7
|
+
* shared `computeSnapToShape` snap model during moves; this module only owns
|
|
8
|
+
* the pointer-event lifecycle (dead-zone, window listeners, cancel). It is
|
|
9
|
+
* framework-agnostic (no Svelte), matching the vanilla binding's driver.
|
|
10
|
+
*/
|
|
11
|
+
export type GestureKind = 'move' | 'resize' | 'rotate';
|
|
12
|
+
/** Live geometry emitted during and at the end of a gesture (element px). */
|
|
13
|
+
export interface GestureTransform {
|
|
14
|
+
id: string;
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
rotation: number;
|
|
20
|
+
}
|
|
21
|
+
export interface GestureDeps {
|
|
22
|
+
/** Current stage scale (screen px per element px). */
|
|
23
|
+
getScale(): number;
|
|
24
|
+
/** Element geometry at gesture start (element px). */
|
|
25
|
+
getElementBox(id: string): InteractionBox | undefined;
|
|
26
|
+
/** Sibling boxes on the same slide, for snap-to-shape during a move. */
|
|
27
|
+
getSiblings(): SnapSibling[];
|
|
28
|
+
/** Overlay origin in client coordinates, for rotation pointer mapping. */
|
|
29
|
+
getStageOrigin(): {
|
|
30
|
+
left: number;
|
|
31
|
+
top: number;
|
|
32
|
+
};
|
|
33
|
+
/** First movement past the dead zone (push history, mark interaction). */
|
|
34
|
+
onStart(id: string, kind: GestureKind): void;
|
|
35
|
+
/** Live preview: apply the geometry and render `lines` as snap guides. */
|
|
36
|
+
onPreview(transform: GestureTransform, lines: readonly SnapLine[]): void;
|
|
37
|
+
/** Gesture finished. `moved` is false for a plain tap (no dead-zone exit). */
|
|
38
|
+
onEnd(transform: GestureTransform | null, moved: boolean, id: string): void;
|
|
39
|
+
}
|
|
40
|
+
export interface GestureController {
|
|
41
|
+
/** Begin a gesture from a `pointerdown`. `handle` only for `resize`. */
|
|
42
|
+
begin(kind: GestureKind, id: string, event: PointerEvent, handle?: ResizeHandleId): void;
|
|
43
|
+
isActive(): boolean;
|
|
44
|
+
/** Abort listeners without emitting an end transform (teardown). */
|
|
45
|
+
dispose(): void;
|
|
46
|
+
}
|
|
47
|
+
export declare function createGestureController(deps: GestureDeps): GestureController;
|
|
48
|
+
//# sourceMappingURL=editor-gestures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-gestures.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-gestures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAYhG;;;;;;;;GAQG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEvD,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,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;AAED,MAAM,WAAW,WAAW;IAC3B,sDAAsD;IACtD,QAAQ,IAAI,MAAM,CAAC;IACnB,sDAAsD;IACtD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IACtD,wEAAwE;IACxE,WAAW,IAAI,WAAW,EAAE,CAAC;IAC7B,0EAA0E;IAC1E,cAAc,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,0EAA0E;IAC1E,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7C,0EAA0E;IAC1E,SAAS,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;IACzE,8EAA8E;IAC9E,KAAK,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5E;AAED,MAAM,WAAW,iBAAiB;IACjC,wEAAwE;IACxE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACzF,QAAQ,IAAI,OAAO,CAAC;IACpB,oEAAoE;IACpE,OAAO,IAAI,IAAI,CAAC;CAChB;AAiBD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,iBAAiB,CA2I5E"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { InkPoint } from 'pptx-viewer-shared';
|
|
2
|
+
import { EditorState } from './editor-state.svelte';
|
|
3
|
+
/**
|
|
4
|
+
* The ribbon Draw tab's active tool. `'select'` means "not drawing": the
|
|
5
|
+
* stage's normal selection/drag/resize gestures own the pointer, matching
|
|
6
|
+
* React's `DrawingTool` / Angular's `DrawTool` conventions (minus `freeform`,
|
|
7
|
+
* out of scope for this wave; see the Draw tab's JSDoc).
|
|
8
|
+
*/
|
|
9
|
+
export type InkDrawTool = 'select' | 'pen' | 'highlighter' | 'eraser';
|
|
10
|
+
/**
|
|
11
|
+
* EditorInkController: the ribbon Draw tab's tool/colour/width state plus the
|
|
12
|
+
* pure element-factory / erase mutations, split out of `EditorState` to keep
|
|
13
|
+
* it under the repo's 300-LOC budget (mirrors `EditorArrangeController` /
|
|
14
|
+
* `EditorBackgroundController`). Instantiated as `EditorState.inkOps`.
|
|
15
|
+
*
|
|
16
|
+
* The actual pointer-event lifecycle (accumulating a stroke's points, driving
|
|
17
|
+
* the live preview) lives in `editor-ink-gesture.ts`, owned by
|
|
18
|
+
* `EditorController`; this class only holds the tool/colour/width state the
|
|
19
|
+
* gesture controller reads and the two mutations it calls into
|
|
20
|
+
* ({@link commitStroke}, {@link eraseElementAt}), both of which route through
|
|
21
|
+
* `EditorState` so they participate in undo/redo like every other edit.
|
|
22
|
+
*/
|
|
23
|
+
export declare class EditorInkController {
|
|
24
|
+
#private;
|
|
25
|
+
/** The active draw tool. `'select'` hands the stage back to normal editing gestures. */
|
|
26
|
+
tool: InkDrawTool;
|
|
27
|
+
/** Stroke colour for new pen/highlighter strokes. */
|
|
28
|
+
color: string;
|
|
29
|
+
/** Stroke width (px, element space) for new pen/highlighter strokes. */
|
|
30
|
+
width: number;
|
|
31
|
+
/** SVG path `d` for the in-progress stroke's live preview, or `''` when idle. */
|
|
32
|
+
livePathD: string;
|
|
33
|
+
constructor(editor: EditorState);
|
|
34
|
+
/** True whenever a tool other than `select` is active: the stage hands pointer gestures to ink drawing. */
|
|
35
|
+
get isDrawing(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Switch the active tool. Clears the current selection when entering a draw
|
|
38
|
+
* tool so the selection overlay's resize/rotate handles (which own their
|
|
39
|
+
* own `pointerdown` and would otherwise race a drawing gesture over the
|
|
40
|
+
* same screen area) are not rendered while drawing.
|
|
41
|
+
*/
|
|
42
|
+
setTool(tool: InkDrawTool): void;
|
|
43
|
+
setColor(color: string): void;
|
|
44
|
+
setWidth(width: number): void;
|
|
45
|
+
/** Update the live preview path while a pen/highlighter stroke is in progress. */
|
|
46
|
+
previewStroke(points: readonly InkPoint[]): void;
|
|
47
|
+
/**
|
|
48
|
+
* Finalise the in-progress stroke into a new `ink` element (undoable via
|
|
49
|
+
* `EditorState.insertElement`), or discard it silently when too short (a
|
|
50
|
+
* plain tap) or the tool changed mid-gesture.
|
|
51
|
+
*/
|
|
52
|
+
commitStroke(points: readonly InkPoint[]): void;
|
|
53
|
+
/**
|
|
54
|
+
* Hit-test `ink` elements on the current slide at `point` (topmost first)
|
|
55
|
+
* and delete the first match, with history. No-op when nothing is hit.
|
|
56
|
+
*/
|
|
57
|
+
eraseElementAt(point: InkPoint): void;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=editor-ink-controller.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-ink-controller.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-ink-controller.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAInD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,GAAG,aAAa,GAAG,QAAQ,CAAC;AAQtE;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAmB;;IAG/B,wFAAwF;IACxF,IAAI,cAAiC;IACrC,qDAAqD;IACrD,KAAK,SAA6B;IAClC,wEAAwE;IACxE,KAAK,SAA6B;IAClC,iFAAiF;IACjF,SAAS,SAAc;gBAEX,MAAM,EAAE,WAAW;IAI/B,2GAA2G;IAC3G,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAQhC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,kFAAkF;IAClF,aAAa,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI;IAIhD;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI;IAgB/C;;;OAGG;IACH,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;CAmBrC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { InkPoint } from 'pptx-viewer-shared';
|
|
2
|
+
import { InkDrawTool } from './editor-ink-controller.svelte';
|
|
3
|
+
/**
|
|
4
|
+
* Pointer gesture driver for freehand ink drawing: pen/highlighter accumulate
|
|
5
|
+
* points into a live stroke and commit it on pointerup; eraser hit-tests on
|
|
6
|
+
* pointerdown alone. Framework-agnostic (no Svelte), mirroring
|
|
7
|
+
* `editor-gestures.ts`'s pure-module + window-listener pattern so a stroke
|
|
8
|
+
* keeps tracking the pointer even when it leaves the stage bounds.
|
|
9
|
+
*/
|
|
10
|
+
export interface InkGestureDeps {
|
|
11
|
+
/** Current stage scale (screen px per element px). */
|
|
12
|
+
getScale(): number;
|
|
13
|
+
/** Stage-holder origin in client coordinates, for pointer-to-slide-space mapping. */
|
|
14
|
+
getStageOrigin(): {
|
|
15
|
+
left: number;
|
|
16
|
+
top: number;
|
|
17
|
+
};
|
|
18
|
+
/** The active draw tool; `'select'` means the gesture controller is idle. */
|
|
19
|
+
getTool(): InkDrawTool;
|
|
20
|
+
/** A pen/highlighter stroke started (first point captured). */
|
|
21
|
+
onStrokeStart(): void;
|
|
22
|
+
/** Live preview: the accumulated points so far (pen/highlighter only). */
|
|
23
|
+
onStrokePreview(points: readonly InkPoint[]): void;
|
|
24
|
+
/** A pen/highlighter stroke finished (pointerup); may be too short to keep. */
|
|
25
|
+
onStrokeEnd(points: readonly InkPoint[]): void;
|
|
26
|
+
/** Eraser: a single point to hit-test against ink elements. */
|
|
27
|
+
onErase(point: InkPoint): void;
|
|
28
|
+
}
|
|
29
|
+
export interface InkGestureController {
|
|
30
|
+
/** Handle a stage `pointerdown` while a draw tool may be active. No-op when the tool is `'select'`. */
|
|
31
|
+
handlePointerDown(event: PointerEvent): void;
|
|
32
|
+
isActive(): boolean;
|
|
33
|
+
/** Abort listeners without emitting an end callback (teardown). */
|
|
34
|
+
dispose(): void;
|
|
35
|
+
}
|
|
36
|
+
export declare function createInkGestureController(deps: InkGestureDeps): InkGestureController;
|
|
37
|
+
//# sourceMappingURL=editor-ink-gesture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-ink-gesture.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-ink-gesture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC9B,sDAAsD;IACtD,QAAQ,IAAI,MAAM,CAAC;IACnB,qFAAqF;IACrF,cAAc,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,6EAA6E;IAC7E,OAAO,IAAI,WAAW,CAAC;IACvB,+DAA+D;IAC/D,aAAa,IAAI,IAAI,CAAC;IACtB,0EAA0E;IAC1E,eAAe,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;IACnD,+EAA+E;IAC/E,WAAW,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC/C,+DAA+D;IAC/D,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACpC,uGAAuG;IACvG,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7C,QAAQ,IAAI,OAAO,CAAC;IACpB,mEAAmE;IACnE,OAAO,IAAI,IAAI,CAAC;CAChB;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,cAAc,GAAG,oBAAoB,CAmErF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize } from 'pptx-viewer-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Pure factory for the Insert > Action Button action: wraps the shared
|
|
5
|
+
* `buildActionButtonElement` (one of the 12 OOXML built-in action-button
|
|
6
|
+
* presets, `action-buttons.ts`) and centres the result on the slide canvas.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Build a new, centred action-button shape from the shared preset catalogue,
|
|
10
|
+
* or `null` when `shapeType` isn't a known action-button preset.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildActionButtonInsertElement(shapeType: string, canvasSize: CanvasSize): PptxElement | null;
|
|
13
|
+
//# sourceMappingURL=editor-insert-action-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-insert-action-button.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-insert-action-button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;;;GAIG;AAEH;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,GACpB,WAAW,GAAG,IAAI,CAOpB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PptxChartType, PptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize } from 'pptx-viewer-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Pure factory for the Insert > Chart action: wraps the shared
|
|
5
|
+
* `createDefaultChartElement` (fully-populated sample data, ready to render)
|
|
6
|
+
* and centres the result on the slide canvas.
|
|
7
|
+
*/
|
|
8
|
+
/** Build a new, centred chart element for the given chart type. */
|
|
9
|
+
export declare function buildChartInsertElement(chartType: PptxChartType, canvasSize: CanvasSize): PptxElement;
|
|
10
|
+
//# sourceMappingURL=editor-insert-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-insert-chart.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-insert-chart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;;;GAIG;AAEH,mEAAmE;AACnE,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,GACpB,WAAW,CAIb"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize } from 'pptx-viewer-shared';
|
|
3
|
+
/** Build a new, centred equation element from an OMML object tree. */
|
|
4
|
+
export declare function buildEquationInsertElement(omml: Record<string, unknown>, canvasSize: CanvasSize): PptxElement;
|
|
5
|
+
//# sourceMappingURL=editor-insert-equation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-insert-equation.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-insert-equation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAgBrD,sEAAsE;AACtE,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,UAAU,EAAE,UAAU,GACpB,WAAW,CAsBb"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize } from 'pptx-viewer-shared';
|
|
3
|
+
/** Current slide-number-aware field context passed to `resolveFieldDisplayText`. */
|
|
4
|
+
export interface FieldInsertContext {
|
|
5
|
+
slideNumber: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolve the display text for a field placeholder via the shared
|
|
9
|
+
* `substituteFieldText` helper (slide number / date-time / header / footer).
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveFieldDisplayText(fieldType: string, ctx: FieldInsertContext): string;
|
|
12
|
+
/**
|
|
13
|
+
* Build a new, centred field-placeholder shape (a text-bearing shape whose
|
|
14
|
+
* single segment carries `fieldType` + a fresh field GUID).
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildFieldInsertElement(fieldType: string, displayText: string, canvasSize: CanvasSize): PptxElement;
|
|
17
|
+
//# sourceMappingURL=editor-insert-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-insert-field.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-insert-field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAgBrD,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IAClC,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAM1F;AAWD;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,GACpB,WAAW,CAiBb"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize } from 'pptx-viewer-shared';
|
|
3
|
+
/** The media kind a chosen file maps to, or `null` for an unsupported type. */
|
|
4
|
+
export declare function mediaTypeOfFile(mimeType: string): 'audio' | 'video' | null;
|
|
5
|
+
/**
|
|
6
|
+
* Build a centred `media` element from a chosen audio/video `File`. Resolves
|
|
7
|
+
* `null` when the file isn't audio/video or can't be read.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildMediaInsertElement(file: File, canvasSize: CanvasSize): Promise<PptxElement | null>;
|
|
10
|
+
//# sourceMappingURL=editor-insert-media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-insert-media.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-insert-media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAkBrD,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAQ1E;AAgCD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC5C,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,GACpB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAwB7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PptxElement, SmartArtLayout } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize } from 'pptx-viewer-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Build a new, centred SmartArt element from a gallery preset (layout +
|
|
5
|
+
* default node texts).
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildSmartArtInsertElement(layout: SmartArtLayout, defaultItems: string[], canvasSize: CanvasSize): PptxElement;
|
|
8
|
+
//# sourceMappingURL=editor-insert-smart-art.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-insert-smart-art.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-insert-smart-art.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAerD;;;GAGG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,MAAM,EAAE,EACtB,UAAU,EAAE,UAAU,GACpB,WAAW,CAab"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PptxElement, PptxSlide } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize, ShapePresetType } from 'pptx-viewer-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Element insertion for the Svelte editor.
|
|
5
|
+
*
|
|
6
|
+
* The element *factories* (`newTextElement`, `newShapeElement`,
|
|
7
|
+
* `newTableElement`) are the shared, framework-agnostic builders from
|
|
8
|
+
* `pptx-viewer-shared` (`render/editor-insert`); every binding uses the same
|
|
9
|
+
* ones so a "Text box" or "Rectangle" is identical across React/Vue/Angular/
|
|
10
|
+
* Svelte. This module adds only the two thin, binding-local pieces the shared
|
|
11
|
+
* factories deliberately leave out: id generation (the factories return
|
|
12
|
+
* `id: ''`) and the pure "append to the current slide" mutation.
|
|
13
|
+
*/
|
|
14
|
+
export { newShapeElement, newTableElement, newTextElement } from 'pptx-viewer-shared';
|
|
15
|
+
/** Generate a fresh, collision-resistant element id (prefixed for clarity). */
|
|
16
|
+
export declare function newElementId(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Build an `image` element from a data URL (the file picker reads a chosen
|
|
19
|
+
* file as a `data:` URI, which the renderer consumes directly via `imageData`).
|
|
20
|
+
*/
|
|
21
|
+
export declare function newImageElement(imageData: string, x: number, y: number, width: number, height: number): PptxElement;
|
|
22
|
+
/**
|
|
23
|
+
* Build a `shape` element for any preset in the shared shape catalogue
|
|
24
|
+
* (`SHAPE_PRESET_DEFS`, 30 presets). The shared `newShapeElement` factory
|
|
25
|
+
* only covers `'rect' | 'ellipse' | 'line'`; core's `shapeType` field is a
|
|
26
|
+
* plain string with no such restriction, so this widens it for the Insert
|
|
27
|
+
* tab's shape gallery without touching the shared factory's narrow contract.
|
|
28
|
+
*/
|
|
29
|
+
export declare function newPresetShapeElement(shapeType: ShapePresetType, x?: number, y?: number): PptxElement;
|
|
30
|
+
/**
|
|
31
|
+
* Centre an element's box on the slide canvas (top-left clamped to >= 0).
|
|
32
|
+
* Used by the "structured" Insert actions (chart / equation / SmartArt /
|
|
33
|
+
* media / action button / field) so a freshly-inserted diagram or media
|
|
34
|
+
* clip lands in the middle of the slide rather than stacking at a fixed
|
|
35
|
+
* corner offset.
|
|
36
|
+
*/
|
|
37
|
+
export declare function centerOnCanvas(el: PptxElement, canvasSize: CanvasSize): void;
|
|
38
|
+
/** Append `element` to the given slide's element list (immutable). */
|
|
39
|
+
export declare function appendElement(slides: readonly PptxSlide[], slideIndex: number, element: PptxElement): PptxSlide[];
|
|
40
|
+
//# sourceMappingURL=editor-insert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-insert.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-insert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAItE;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEtF,+EAA+E;AAC/E,wBAAgB,YAAY,IAAI,MAAM,CAOrC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,SAAS,EAAE,MAAM,EACjB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACZ,WAAW,CAWb;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,eAAe,EAC1B,CAAC,GAAE,MAAY,EACf,CAAC,GAAE,MAAY,GACb,WAAW,CAgBb;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAG5E;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAC5B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,GAClB,SAAS,EAAE,CAEb"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editing keyboard shortcuts, attached to the viewer root alongside (before)
|
|
3
|
+
* the slideshow navigation handler. The navigation is gated off while an
|
|
4
|
+
* element is selected (see `PowerPointViewer`), so arrows nudge instead of
|
|
5
|
+
* changing slides.
|
|
6
|
+
*
|
|
7
|
+
* Keys: Escape deselect; Delete/Backspace delete; Ctrl+D duplicate;
|
|
8
|
+
* Ctrl+C/X/V copy/cut/paste; Ctrl+Z / Ctrl+Shift+Z / Ctrl+Y undo/redo; arrows
|
|
9
|
+
* nudge (Shift = 10px). Mirrors the vanilla binding's `editor-keyboard`.
|
|
10
|
+
*
|
|
11
|
+
* Ctrl+V is intentionally checked before the "a selection is required" guard
|
|
12
|
+
* below (paste targets the current slide regardless of selection, matching
|
|
13
|
+
* the vanilla binding); Ctrl+C/X are gated on a selection like duplicate/delete.
|
|
14
|
+
*/
|
|
15
|
+
export interface EditorKeyboardDeps {
|
|
16
|
+
/** False disables everything (not editable, presenting, inline editing). */
|
|
17
|
+
isActive(): boolean;
|
|
18
|
+
getSelectedId(): string | null;
|
|
19
|
+
deselect(): void;
|
|
20
|
+
deleteSelected(): void;
|
|
21
|
+
duplicateSelected(): void;
|
|
22
|
+
nudgeSelected(dx: number, dy: number): void;
|
|
23
|
+
undo(): void;
|
|
24
|
+
redo(): void;
|
|
25
|
+
copySelected(): void;
|
|
26
|
+
cutSelected(): void;
|
|
27
|
+
paste(): void;
|
|
28
|
+
cancelFormatPainter?(): boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function createEditorKeydownHandler(deps: EditorKeyboardDeps): (event: KeyboardEvent) => void;
|
|
31
|
+
//# sourceMappingURL=editor-keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-keyboard.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-keyboard.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,kBAAkB;IAClC,4EAA4E;IAC5E,QAAQ,IAAI,OAAO,CAAC;IACpB,aAAa,IAAI,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,IAAI,IAAI,CAAC;IACjB,cAAc,IAAI,IAAI,CAAC;IACvB,iBAAiB,IAAI,IAAI,CAAC;IAC1B,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,YAAY,IAAI,IAAI,CAAC;IACrB,WAAW,IAAI,IAAI,CAAC;IACpB,KAAK,IAAI,IAAI,CAAC;IACd,mBAAmB,CAAC,IAAI,OAAO,CAAC;CAChC;AAID,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,kBAAkB,GACtB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAsEhC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PptxElement, PptxSlideMaster } from 'pptx-viewer-core';
|
|
2
|
+
import { EditorState } from './editor-state.svelte';
|
|
3
|
+
export interface MasterViewTarget {
|
|
4
|
+
masterIndex: number;
|
|
5
|
+
layoutIndex: number | null;
|
|
6
|
+
}
|
|
7
|
+
/** Routes the active editing layer into a parsed slide master or layout. */
|
|
8
|
+
export declare class EditorMasterController {
|
|
9
|
+
private readonly editor;
|
|
10
|
+
constructor(editor: EditorState);
|
|
11
|
+
enter(masterIndex?: number, layoutIndex?: number | null): void;
|
|
12
|
+
exit(): void;
|
|
13
|
+
activeElements(): PptxElement[] | null;
|
|
14
|
+
replace(elements: PptxElement[]): boolean;
|
|
15
|
+
cloneMasters(): PptxSlideMaster[];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=editor-master-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-master-controller.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-master-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,4EAA4E;AAC5E,qBAAa,sBAAsB;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD,KAAK,CAAC,WAAW,SAAI,EAAE,WAAW,GAAE,MAAM,GAAG,IAAW,GAAG,IAAI;IAM/D,IAAI,IAAI,IAAI;IAMZ,cAAc,IAAI,WAAW,EAAE,GAAG,IAAI;IAWtC,OAAO,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO;IAsBzC,YAAY,IAAI,eAAe,EAAE;CAGjC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PptxElement, PptxSlide, TextSegment } from 'pptx-viewer-core';
|
|
2
|
+
/**
|
|
3
|
+
* Pure, immutable slide-array mutations for the Svelte editor.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the vanilla binding's `editor-mutations` (in turn the Vue binding's
|
|
6
|
+
* `useEditorOperations` commit helpers), minus the reactivity: every function
|
|
7
|
+
* takes the current `PptxSlide[]` and returns a brand-new array (untouched
|
|
8
|
+
* slides are reused by reference so the render layer can cheaply detect
|
|
9
|
+
* changes). All cloning defers to the core helpers (`cloneSlide`,
|
|
10
|
+
* `cloneElement`, `duplicateElement`); nothing is mutated in place.
|
|
11
|
+
*/
|
|
12
|
+
/** Geometry patch applied by drag / resize / rotate / nudge. */
|
|
13
|
+
export interface ElementBoxPatch {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
rotation: number;
|
|
19
|
+
}
|
|
20
|
+
/** Find a top-level element by id on the given slide (or `undefined`). */
|
|
21
|
+
export declare function findSlideElement(slides: readonly PptxSlide[], slideIndex: number, elementId: string): PptxElement | undefined;
|
|
22
|
+
/** Rebuild one slide's `elements` via `mapElements`; other slides are reused. */
|
|
23
|
+
export declare function mapSlideElements(slides: readonly PptxSlide[], slideIndex: number, mapElements: (elements: PptxElement[]) => PptxElement[]): PptxSlide[];
|
|
24
|
+
/** Shallow-merge `updates` into the element with `elementId` (cloned first). */
|
|
25
|
+
export declare function updateElement(slides: readonly PptxSlide[], slideIndex: number, elementId: string, updates: Partial<PptxElement>): PptxSlide[];
|
|
26
|
+
/** Patch an element's geometry (x/y/width/height/rotation). */
|
|
27
|
+
export declare function patchElementGeometry(slides: readonly PptxSlide[], slideIndex: number, elementId: string, box: ElementBoxPatch): PptxSlide[];
|
|
28
|
+
/** Remove the element with `elementId` from the slide. */
|
|
29
|
+
export declare function removeElement(slides: readonly PptxSlide[], slideIndex: number, elementId: string): PptxSlide[];
|
|
30
|
+
/**
|
|
31
|
+
* Deep-clone an element (fresh ids via core `duplicateElement`, group children
|
|
32
|
+
* included), offset it slightly, and append it to the slide. Returns the new
|
|
33
|
+
* slide array plus the copy's id, or `null` when the source is missing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function duplicateElementOnSlide(slides: readonly PptxSlide[], slideIndex: number, elementId: string): {
|
|
36
|
+
slides: PptxSlide[];
|
|
37
|
+
newId: string;
|
|
38
|
+
} | null;
|
|
39
|
+
/** Deep-clone the whole slide array (history snapshots). */
|
|
40
|
+
export declare function cloneSlides(slides: readonly PptxSlide[]): PptxSlide[];
|
|
41
|
+
/**
|
|
42
|
+
* Replace the plain-text speaker notes on one slide. Mirrors the Vue binding's
|
|
43
|
+
* `onNotesUpdate`: only `notes` is written, `notesSegments` (rich runs loaded
|
|
44
|
+
* from a .pptx) is intentionally left untouched, matching the plain-text
|
|
45
|
+
* commit contract shared by every binding's notes panel.
|
|
46
|
+
*/
|
|
47
|
+
export declare function updateSlideNotes(slides: readonly PptxSlide[], slideIndex: number, notes: string, notesSegments?: TextSegment[]): PptxSlide[];
|
|
48
|
+
/**
|
|
49
|
+
* Shallow-merge `patch` into the slide at `slideIndex` (cloned first). Other
|
|
50
|
+
* slides are reused by reference. Backs the Design tab's Format Background
|
|
51
|
+
* panel and the Transitions tab's single-slide apply.
|
|
52
|
+
*/
|
|
53
|
+
export declare function updateSlide(slides: readonly PptxSlide[], slideIndex: number, patch: Partial<PptxSlide>): PptxSlide[];
|
|
54
|
+
/**
|
|
55
|
+
* Shallow-merge `patch` into every slide. Backs the Transitions tab's
|
|
56
|
+
* "Apply to All Slides" option.
|
|
57
|
+
*/
|
|
58
|
+
export declare function updateAllSlides(slides: readonly PptxSlide[], patch: Partial<PptxSlide>): PptxSlide[];
|
|
59
|
+
//# sourceMappingURL=editor-mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-mutations.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-mutations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG5E;;;;;;;;;GASG;AAEH,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC/B,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;AAKD,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GACf,WAAW,GAAG,SAAS,CAEzB;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,GACrD,SAAS,EAAE,CAIb;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAC5B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,GAC3B,SAAS,EAAE,CAMb;AAED,+DAA+D;AAC/D,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,eAAe,GAClB,SAAS,EAAE,CAQb;AAED,0DAA0D;AAC1D,wBAAgB,aAAa,CAC5B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GACf,SAAS,EAAE,CAIb;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GACf;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAY/C;AAED,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,WAAW,EAAE,GAC3B,SAAS,EAAE,CAMb;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,GACvB,SAAS,EAAE,CAEb;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,GACvB,SAAS,EAAE,CAEb"}
|
|
@@ -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"}
|