pptx-svelte-viewer 2.7.1 → 2.9.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 +4 -0
- package/dist/AiChatPanel-CWB7jYUa.js +1108 -0
- package/dist/{export-Dggu1blu.js → export-CAW_l1TQ.js} +44625 -39074
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.js +20 -20
- package/dist/pptx-svelte-viewer.css +1 -1
- package/dist/{translator-DL83W_OP.js → translator-0iRuc5gX.js} +240 -19
- package/dist/viewer/ai/ai-chat-persistence.svelte.d.ts +23 -0
- package/dist/viewer/ai/ai-chat-persistence.svelte.d.ts.map +1 -0
- package/dist/viewer/components/inspector/theme-editor-state.svelte.d.ts +47 -0
- package/dist/viewer/components/inspector/theme-editor-state.svelte.d.ts.map +1 -0
- package/dist/viewer/components/props-chrome.d.ts +104 -0
- package/dist/viewer/components/props-chrome.d.ts.map +1 -0
- package/dist/viewer/components/props-editing.d.ts +86 -0
- package/dist/viewer/components/props-editing.d.ts.map +1 -0
- package/dist/viewer/components/props-elements.d.ts +65 -0
- package/dist/viewer/components/props-elements.d.ts.map +1 -0
- package/dist/viewer/components/props-stage.d.ts +84 -0
- package/dist/viewer/components/props-stage.d.ts.map +1 -0
- package/dist/viewer/components/props.d.ts +10 -283
- package/dist/viewer/components/props.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/insert/equation-latex-preview.d.ts +23 -0
- package/dist/viewer/components/ribbon/insert/equation-latex-preview.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts +2 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts.map +1 -1
- package/dist/viewer/components/viewer-body-commits.d.ts +18 -0
- package/dist/viewer/components/viewer-body-commits.d.ts.map +1 -0
- package/dist/viewer/components/viewer-body-props.d.ts +125 -0
- package/dist/viewer/components/viewer-body-props.d.ts.map +1 -0
- package/dist/viewer/editor/context-menu-dispatch.d.ts +45 -0
- package/dist/viewer/editor/context-menu-dispatch.d.ts.map +1 -0
- package/dist/viewer/editor/deck-api.d.ts +31 -0
- package/dist/viewer/editor/deck-api.d.ts.map +1 -0
- package/dist/viewer/editor/editor-controller-deps.d.ts +21 -1
- package/dist/viewer/editor/editor-controller-deps.d.ts.map +1 -1
- package/dist/viewer/editor/editor-controller-wiring.d.ts +35 -0
- package/dist/viewer/editor/editor-controller-wiring.d.ts.map +1 -0
- package/dist/viewer/editor/editor-controller.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-document-lifecycle.d.ts +68 -0
- package/dist/viewer/editor/editor-document-lifecycle.d.ts.map +1 -0
- package/dist/viewer/editor/editor-document-state.d.ts +3 -1
- package/dist/viewer/editor/editor-document-state.d.ts.map +1 -1
- package/dist/viewer/editor/editor-freeform.d.ts +4 -0
- package/dist/viewer/editor/editor-freeform.d.ts.map +1 -0
- package/dist/viewer/editor/editor-history-state.svelte.d.ts +31 -0
- package/dist/viewer/editor/editor-history-state.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-ink-controller.svelte.d.ts +10 -6
- package/dist/viewer/editor/editor-ink-controller.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-keyboard.d.ts +18 -11
- package/dist/viewer/editor/editor-keyboard.d.ts.map +1 -1
- package/dist/viewer/editor/editor-selection.svelte.d.ts +10 -10
- package/dist/viewer/editor/editor-selection.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-state.svelte.d.ts +26 -19
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-text-body-mutations.d.ts +17 -0
- package/dist/viewer/editor/editor-text-body-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/element-hit.d.ts +8 -26
- package/dist/viewer/editor/element-hit.d.ts.map +1 -1
- package/dist/viewer/editor/index.d.ts +2 -0
- package/dist/viewer/editor/index.d.ts.map +1 -1
- package/dist/viewer/export/export-wiring.svelte.d.ts +8 -1
- package/dist/viewer/export/export-wiring.svelte.d.ts.map +1 -1
- package/dist/viewer/export/rasterize-slide.d.ts +8 -1
- package/dist/viewer/export/rasterize-slide.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +897 -342
- package/dist/viewer/index.js +20 -398
- package/dist/viewer/presentation/animation-media-commands.d.ts +4 -0
- package/dist/viewer/presentation/animation-media-commands.d.ts.map +1 -0
- package/dist/viewer/presentation/animation-playback-helpers.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-ai.svelte.d.ts +42 -0
- package/dist/viewer/state/create-viewer-state-ai.svelte.d.ts.map +1 -0
- package/dist/viewer/state/create-viewer-state-collab.svelte.d.ts +13 -0
- package/dist/viewer/state/create-viewer-state-collab.svelte.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-derived.svelte.d.ts +38 -0
- package/dist/viewer/state/create-viewer-state-derived.svelte.d.ts.map +1 -0
- package/dist/viewer/state/create-viewer-state-editor-ui.svelte.d.ts +21 -13
- package/dist/viewer/state/create-viewer-state-editor-ui.svelte.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-export-notes.svelte.d.ts +6 -1
- package/dist/viewer/state/create-viewer-state-export-notes.svelte.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-presentation.svelte.d.ts +3 -1
- package/dist/viewer/state/create-viewer-state-presentation.svelte.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-presenter.svelte.d.ts +31 -0
- package/dist/viewer/state/create-viewer-state-presenter.svelte.d.ts.map +1 -0
- package/dist/viewer/state/create-viewer-state-types.d.ts +43 -6
- package/dist/viewer/state/create-viewer-state-types.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state.svelte.d.ts +17 -16
- package/dist/viewer/state/create-viewer-state.svelte.d.ts.map +1 -1
- package/dist/viewer/state/field-context.d.ts +38 -0
- package/dist/viewer/state/field-context.d.ts.map +1 -0
- package/dist/viewer/state/index.d.ts +4 -0
- package/dist/viewer/state/index.d.ts.map +1 -1
- package/dist/viewer/state/navigation.d.ts +9 -7
- package/dist/viewer/state/navigation.d.ts.map +1 -1
- package/dist/viewer/state/open-file.d.ts +15 -0
- package/dist/viewer/state/open-file.d.ts.map +1 -0
- package/dist/viewer/state/presentation-loader.svelte.d.ts +3 -1
- package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -1
- package/dist/viewer/state/quick-access-commands.d.ts +19 -0
- package/dist/viewer/state/quick-access-commands.d.ts.map +1 -0
- package/dist/viewer/state/slide-elements.d.ts +51 -0
- package/dist/viewer/state/slide-elements.d.ts.map +1 -0
- package/dist/viewer/state/theme-locale.svelte.d.ts +68 -0
- package/dist/viewer/state/theme-locale.svelte.d.ts.map +1 -0
- package/dist/viewer/state/viewer-effects.svelte.d.ts.map +1 -1
- package/dist/viewer/state/viewer-state-options.d.ts +31 -0
- package/dist/viewer/state/viewer-state-options.d.ts.map +1 -0
- package/dist/viewer/style/element-style.d.ts.map +1 -1
- package/dist/viewer/style/text-style.d.ts +15 -0
- package/dist/viewer/style/text-style.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/AiChatPanel-BbVtEzOo.js +0 -1082
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { PptxHandler, PptxSlide, PptxTheme, TextSegment } from 'pptx-viewer-core';
|
|
2
|
+
import { CanvasSize, RemoteCursor, RulerUnit, SanitizedPresence } from 'pptx-viewer-shared';
|
|
3
|
+
import { AiChangeBatch } from 'pptx-viewer-shared/ai';
|
|
4
|
+
import { Translator } from '../../i18n/translator';
|
|
5
|
+
import { AiCanvasHighlight } from '../ai/ai-panel-controller.svelte';
|
|
6
|
+
import { EditorController } from '../editor/editor-controller.svelte';
|
|
7
|
+
import { EditorState } from '../editor/editor-state.svelte';
|
|
8
|
+
import { TransitionState } from '../presentation';
|
|
9
|
+
import { PresentationAnnotations } from '../presentation/presentation-annotations.svelte';
|
|
10
|
+
import { ChromeUiState } from '../state/chrome-ui.svelte';
|
|
11
|
+
import { StageContextMenu } from './props';
|
|
12
|
+
/**
|
|
13
|
+
* Prop contracts for the viewer body and the sub-views it composes
|
|
14
|
+
* (`ViewerBody` -> `ViewerStage` -> `SlideOverlays`, plus `RulerStrips`).
|
|
15
|
+
*
|
|
16
|
+
* Kept in a plain `.ts` module, like `props.ts`, so the SFCs stay thin
|
|
17
|
+
* presentation: a component that declares its own interfaces is the smell the
|
|
18
|
+
* repo's file-size rule is aimed at. Splitting the body's contract out also
|
|
19
|
+
* lets each sub-view state its slice as a `Pick<>` of one source of truth,
|
|
20
|
+
* instead of three drifting copies of the same twenty props.
|
|
21
|
+
*/
|
|
22
|
+
/** A user-placed drawing guide: `h` is a horizontal line, `v` a vertical one. */
|
|
23
|
+
export interface ViewerGuide {
|
|
24
|
+
axis: 'h' | 'v';
|
|
25
|
+
position: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ViewerBodyProps {
|
|
28
|
+
t: Translator;
|
|
29
|
+
editor: EditorState;
|
|
30
|
+
handler?: PptxHandler | null;
|
|
31
|
+
presentationTheme?: PptxTheme;
|
|
32
|
+
onthemechange?: (theme: PptxTheme) => void;
|
|
33
|
+
chromeVisible: boolean;
|
|
34
|
+
showThumbnails: boolean;
|
|
35
|
+
showNotes: boolean;
|
|
36
|
+
displaySlides: PptxSlide[];
|
|
37
|
+
canvasSize: CanvasSize;
|
|
38
|
+
mediaDataUrls: Map<string, string>;
|
|
39
|
+
current: number;
|
|
40
|
+
onselect: (index: number) => void;
|
|
41
|
+
loading: boolean;
|
|
42
|
+
isEncrypted: boolean;
|
|
43
|
+
error: string | null;
|
|
44
|
+
activeSlide: PptxSlide | undefined;
|
|
45
|
+
scale: number;
|
|
46
|
+
presenting: boolean;
|
|
47
|
+
/** Active slide-transition overlay state (presentation mode), or null. */
|
|
48
|
+
presentationTransition: TransitionState | null;
|
|
49
|
+
/** Called when the transition overlay finishes (host drops the overlay). */
|
|
50
|
+
onTransitionDone: () => void;
|
|
51
|
+
/** Advance the presentation (step animation build, else next slide). */
|
|
52
|
+
onAdvance: () => void;
|
|
53
|
+
editingActive: boolean;
|
|
54
|
+
controller: EditorController;
|
|
55
|
+
onstageresize: (width: number, height: number) => void;
|
|
56
|
+
onstageholder: (el: HTMLDivElement | null) => void;
|
|
57
|
+
notesExpanded: boolean;
|
|
58
|
+
onNotesCommit?: (notes: string, segments?: TextSegment[]) => void;
|
|
59
|
+
onNotesToggle: () => void;
|
|
60
|
+
/** Remote collaborators' cursors on the active slide (unscaled slide px). */
|
|
61
|
+
collabCursors?: RemoteCursor[];
|
|
62
|
+
/** Remote collaborators' presence (drives the remote-selection overlay). */
|
|
63
|
+
collabPresences?: SanitizedPresence[];
|
|
64
|
+
/** Open element menu position + hit table cell, from the editing controller. */
|
|
65
|
+
contextMenu: StageContextMenu | null;
|
|
66
|
+
onContextMenuClose: () => void;
|
|
67
|
+
onmoveSlide?: (fromIndex: number, toIndex: number) => void;
|
|
68
|
+
annotations: PresentationAnnotations;
|
|
69
|
+
guides?: readonly ViewerGuide[];
|
|
70
|
+
onchangeguide?: (index: number, position: number) => void;
|
|
71
|
+
/** Drop a new guide dragged off a ruler strip (View > Rulers must be on). */
|
|
72
|
+
onaddguide?: (axis: 'h' | 'v', position: number) => void;
|
|
73
|
+
/** View > Rulers: paint the tick strips along the top/left of the stage. */
|
|
74
|
+
showRulers?: boolean;
|
|
75
|
+
/** Unit system for the ruler labels. Defaults to inches, as PowerPoint does. */
|
|
76
|
+
rulerUnit?: RulerUnit;
|
|
77
|
+
spellCheck?: boolean;
|
|
78
|
+
/** Side-panel open/collapsed state shared with the ribbon's toggles. */
|
|
79
|
+
chromeUi?: ChromeUiState;
|
|
80
|
+
/** True while the AI panel is picking a slide element (see SlideCanvas). */
|
|
81
|
+
aiPickMode?: boolean;
|
|
82
|
+
/** True while a running AI tool is active (enables the canvas colour tween). */
|
|
83
|
+
aiActive?: boolean;
|
|
84
|
+
/** Rings the AI focus overlay should draw on the active slide. */
|
|
85
|
+
aiHighlights?: readonly AiCanvasHighlight[];
|
|
86
|
+
/** Just-applied AI change batch the canvas should animate (glide/fade/glow). */
|
|
87
|
+
aiChangeBatch?: AiChangeBatch | null;
|
|
88
|
+
/** Route a picked canvas element to the AI focus (pick mode). */
|
|
89
|
+
onaipickelement?: (elementId: string) => void;
|
|
90
|
+
/** "Ask AI about this" from the element context menu (gated on the `ai` prop). */
|
|
91
|
+
onaskai?: () => void;
|
|
92
|
+
/** "Fix with AI" from the element context menu (gated on the `ai` prop). */
|
|
93
|
+
onfixai?: () => void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The slice of the body's contract that the stage area consumes: everything
|
|
97
|
+
* about the slide surface itself, none of the surrounding chrome (thumbnail
|
|
98
|
+
* rail, notes panel, inspector).
|
|
99
|
+
*/
|
|
100
|
+
export type ViewerStageProps = Pick<ViewerBodyProps, 't' | 'editor' | 'controller' | 'canvasSize' | 'mediaDataUrls' | 'current' | 'loading' | 'isEncrypted' | 'error' | 'activeSlide' | 'scale' | 'presenting' | 'presentationTransition' | 'onTransitionDone' | 'onAdvance' | 'editingActive' | 'onstageholder' | 'collabCursors' | 'collabPresences' | 'contextMenu' | 'onContextMenuClose' | 'annotations' | 'guides' | 'onchangeguide' | 'onaddguide' | 'showRulers' | 'rulerUnit' | 'spellCheck' | 'chromeUi' | 'aiPickMode' | 'aiActive' | 'aiHighlights' | 'aiChangeBatch' | 'onaipickelement' | 'onaskai' | 'onfixai'>;
|
|
101
|
+
/**
|
|
102
|
+
* The overlay stack painted inside the scaled stage. Every member is authored
|
|
103
|
+
* in unscaled slide coordinates, so they all take `scale`/`canvasSize` rather
|
|
104
|
+
* than positioning themselves off the DOM.
|
|
105
|
+
*/
|
|
106
|
+
export type SlideOverlaysProps = Pick<ViewerStageProps, 'editor' | 'controller' | 'canvasSize' | 'mediaDataUrls' | 'current' | 'activeSlide' | 'scale' | 'presenting' | 'presentationTransition' | 'onTransitionDone' | 'editingActive' | 'collabCursors' | 'collabPresences' | 'annotations' | 'guides' | 'onchangeguide' | 'spellCheck' | 'aiHighlights' | 'aiChangeBatch'>;
|
|
107
|
+
/** Props of the horizontal + vertical ruler strips drawn around the stage. */
|
|
108
|
+
export interface RulerStripsProps {
|
|
109
|
+
/** Slide dimensions in unscaled CSS px. */
|
|
110
|
+
canvasSize: CanvasSize;
|
|
111
|
+
/** Combined editor scale (fitScale * userZoom) the strips must track. */
|
|
112
|
+
scale: number;
|
|
113
|
+
/** Unit system for the labels. Defaults to inches. */
|
|
114
|
+
unit?: RulerUnit;
|
|
115
|
+
/** Extent of the selected element, highlighted on both strips. */
|
|
116
|
+
selectedBounds?: {
|
|
117
|
+
x: number;
|
|
118
|
+
y: number;
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
} | null;
|
|
122
|
+
/** Drag off a strip to drop a guide; omitted when guides are unavailable. */
|
|
123
|
+
oncreateguide?: (axis: 'h' | 'v', position: number) => void;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=viewer-body-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer-body-props.d.ts","sourceRoot":"","sources":["../../../src/viewer/components/viewer-body-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EA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E;AAC9E,MAAM,WAAW,gBAAgB;IAChC,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAC;IACvB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kEAAkE;IAClE,cAAc,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChF,6EAA6E;IAC7E,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ContextMenuCommandId, ContextMenuEntry } from 'pptx-viewer-shared';
|
|
2
|
+
import { EditorState } from './editor-state.svelte';
|
|
3
|
+
/**
|
|
4
|
+
* What the canvas context menu offers, and what each command does.
|
|
5
|
+
*
|
|
6
|
+
* The item list is deliberately NOT decided here: `buildContextMenuEntries` in
|
|
7
|
+
* `pptx-viewer-shared` owns the command ids, labels, order and separators for
|
|
8
|
+
* all five bindings, so a command added there appears in all five at once. This
|
|
9
|
+
* module only supplies the context (what is selected, which table cell was
|
|
10
|
+
* right-clicked) and routes the chosen id at the editor's existing operations.
|
|
11
|
+
* Svelte's menu used to hand-write its own items, which is exactly how it ended
|
|
12
|
+
* up shipping without Group, Ungroup, Add Comment, Edit Hyperlink, or a single
|
|
13
|
+
* table command.
|
|
14
|
+
*
|
|
15
|
+
* It lives in a plain `.ts` module rather than inside `ElementContextMenu.svelte`
|
|
16
|
+
* so the SFC stays thin presentation (repo convention) and so the dispatch is
|
|
17
|
+
* unit-testable without mounting a component.
|
|
18
|
+
*
|
|
19
|
+
* @module editor/context-menu-dispatch
|
|
20
|
+
*/
|
|
21
|
+
/** The table cell a right-click landed on, in model (unmerged) coordinates. */
|
|
22
|
+
export interface ContextMenuCellTarget {
|
|
23
|
+
rowIndex: number;
|
|
24
|
+
columnIndex: number;
|
|
25
|
+
}
|
|
26
|
+
/** Everything the menu needs to decide its items and to run one. */
|
|
27
|
+
export interface ContextMenuDispatchDeps {
|
|
28
|
+
editor: EditorState;
|
|
29
|
+
/** The right-clicked table cell, or null when the click was not in one. */
|
|
30
|
+
cell?: ContextMenuCellTarget | null;
|
|
31
|
+
/** "Ask AI about this"; presence of either AI callback enables the AI block. */
|
|
32
|
+
onAskAi?: () => void;
|
|
33
|
+
onFixAi?: () => void;
|
|
34
|
+
/** Open the inspector's Comments tab (React's `case 'comment'`). */
|
|
35
|
+
onComment?: () => void;
|
|
36
|
+
/** Open the hyperlink dialog for the selected element. */
|
|
37
|
+
onHyperlink?: () => void;
|
|
38
|
+
}
|
|
39
|
+
/** The table cell under `target`, or null when `target` is not inside one. */
|
|
40
|
+
export declare function readTableCellTarget(target: EventTarget | null): ContextMenuCellTarget | null;
|
|
41
|
+
/** The menu for what is currently selected and right-clicked. */
|
|
42
|
+
export declare function buildEditorContextMenuEntries(deps: ContextMenuDispatchDeps): ContextMenuEntry[];
|
|
43
|
+
/** Route a chosen command id at the editor. Closing the menu is the caller's job. */
|
|
44
|
+
export declare function runContextMenuCommand(id: ContextMenuCommandId, deps: ContextMenuDispatchDeps): void;
|
|
45
|
+
//# sourceMappingURL=context-menu-dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu-dispatch.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/context-menu-dispatch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAYjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;;;;;;;;;;;GAiBG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACvC,MAAM,EAAE,WAAW,CAAC;IACpB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpC,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAYD,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,qBAAqB,GAAG,IAAI,CAa5F;AAiBD,iEAAiE;AACjE,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAmB/F;AA2DD,qFAAqF;AACrF,wBAAgB,qBAAqB,CACpC,EAAE,EAAE,oBAAoB,EACxB,IAAI,EAAE,uBAAuB,GAC3B,IAAI,CAmDN"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PowerPointViewerAPI, ViewerMode } from 'pptx-viewer-shared';
|
|
2
|
+
import { ViewerState } from '../state/viewer-state.svelte';
|
|
3
|
+
import { EditorState } from './editor-state.svelte';
|
|
4
|
+
/**
|
|
5
|
+
* The navigation / zoom / mode / slide / element half of the imperative
|
|
6
|
+
* `PowerPointViewer` instance API. The undo/redo/save half lives in
|
|
7
|
+
* `editing-api.ts` and the export half in `export/exporting-api.ts`.
|
|
8
|
+
*/
|
|
9
|
+
export type DeckApi = Omit<PowerPointViewerAPI, 'getContent' | 'undo' | 'redo' | 'canUndo' | 'canRedo'>;
|
|
10
|
+
/** Live viewer accessors the deck API closes over (all read from viewer runes). */
|
|
11
|
+
export interface DeckApiDeps {
|
|
12
|
+
editor: EditorState;
|
|
13
|
+
viewer: ViewerState;
|
|
14
|
+
/** User-facing zoom percent (rounded), the base every zoom step works from. */
|
|
15
|
+
getZoomPercent(): number;
|
|
16
|
+
/** The viewer's resolved mode, so `getMode()` matches what the chrome shows. */
|
|
17
|
+
getMode(): ViewerMode;
|
|
18
|
+
/** Enter/leave presentation mode (the same handler the ribbon button uses). */
|
|
19
|
+
toggleFullscreen(): void;
|
|
20
|
+
/** Flip the host-facing `editable` flag (`setMode('edit' | 'master')`). */
|
|
21
|
+
setEditable(editable: boolean): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build the deck-level imperative API bound to live `EditorState` /
|
|
25
|
+
* `ViewerState` runes. Extracted from `PowerPointViewer.svelte` so the
|
|
26
|
+
* component only re-exports thin, one-line bindings (Svelte requires the
|
|
27
|
+
* component's own `export`s for its instance API, but the bodies can live
|
|
28
|
+
* elsewhere), matching `createEditingApi` / `createExportingApi`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createDeckApi(deps: DeckApiDeps): DeckApi;
|
|
31
|
+
//# sourceMappingURL=deck-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deck-api.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/deck-api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,IAAI,CACzB,mBAAmB,EACnB,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CACtD,CAAC;AAEF,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,+EAA+E;IAC/E,cAAc,IAAI,MAAM,CAAC;IACzB,gFAAgF;IAChF,OAAO,IAAI,UAAU,CAAC;IACtB,+EAA+E;IAC/E,gBAAgB,IAAI,IAAI,CAAC;IACzB,2EAA2E;IAC3E,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CACrC;AAOD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAmHxD"}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { PptxSlide } from 'pptx-viewer-core';
|
|
2
2
|
import { CollaborationLivePatcher } from 'pptx-viewer-shared';
|
|
3
|
+
import { ContextMenuCellTarget } from './context-menu-dispatch';
|
|
3
4
|
export interface EditorControllerDeps {
|
|
4
5
|
getScale(): number;
|
|
5
6
|
getCurrent(): number;
|
|
6
7
|
getPresenting(): boolean;
|
|
7
8
|
getStageRoot(): Element | null;
|
|
8
9
|
getHolderEl(): HTMLElement | null;
|
|
10
|
+
/**
|
|
11
|
+
* The focusable viewer root. The stage gesture preventDefault()s the click, so
|
|
12
|
+
* focus has to be put back here or the root's keydown listener stops seeing
|
|
13
|
+
* anything (see `armEditorKeyboard`).
|
|
14
|
+
*/
|
|
15
|
+
getRootEl?(): HTMLElement | null;
|
|
9
16
|
onCursorMove?(x: number, y: number): void;
|
|
10
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Open the canvas context menu at viewport `x`/`y`. `cell` is the table cell
|
|
19
|
+
* the right-click landed on (null elsewhere): the menu's row / column /
|
|
20
|
+
* merge commands need a target, and this binding has no cell-selection
|
|
21
|
+
* model, so the cell under the pointer is the target.
|
|
22
|
+
*/
|
|
23
|
+
onContextMenu?(x: number, y: number, cell: ContextMenuCellTarget | null): void;
|
|
11
24
|
getSnapToGrid?(): boolean;
|
|
12
25
|
getSnapToShape?(): boolean;
|
|
13
26
|
getGuides?(): readonly {
|
|
@@ -27,5 +40,12 @@ export interface EditorControllerDeps {
|
|
|
27
40
|
getLivePatcher?(): CollaborationLivePatcher | undefined;
|
|
28
41
|
/** The slide the inline-edited element belongs to (live-preview lookup). */
|
|
29
42
|
getActiveSlide?(): PptxSlide | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Show or hide the keyboard-shortcut cheat sheet ("?"). The panel is parity
|
|
45
|
+
* UI state owned by the shell, so the controller only signals the intent.
|
|
46
|
+
*/
|
|
47
|
+
toggleShortcuts?(): void;
|
|
48
|
+
/** Close the cheat sheet on Escape; true when it was open (Escape consumed). */
|
|
49
|
+
closeShortcuts?(): boolean;
|
|
30
50
|
}
|
|
31
51
|
//# sourceMappingURL=editor-controller-deps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-controller-deps.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-controller-deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,MAAM,WAAW,oBAAoB;IACpC,QAAQ,IAAI,MAAM,CAAC;IACnB,UAAU,IAAI,MAAM,CAAC;IACrB,aAAa,IAAI,OAAO,CAAC;IACzB,YAAY,IAAI,OAAO,GAAG,IAAI,CAAC;IAC/B,WAAW,IAAI,WAAW,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"editor-controller-deps.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-controller-deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,WAAW,oBAAoB;IACpC,QAAQ,IAAI,MAAM,CAAC;IACnB,UAAU,IAAI,MAAM,CAAC;IACrB,aAAa,IAAI,OAAO,CAAC;IACzB,YAAY,IAAI,OAAO,GAAG,IAAI,CAAC;IAC/B,WAAW,IAAI,WAAW,GAAG,IAAI,CAAC;IAClC;;;;OAIG;IACH,SAAS,CAAC,IAAI,WAAW,GAAG,IAAI,CAAC;IACjC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C;;;;;OAKG;IACH,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/E,aAAa,CAAC,IAAI,OAAO,CAAC;IAC1B,cAAc,CAAC,IAAI,OAAO,CAAC;IAC3B,SAAS,CAAC,IAAI,SAAS;QAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/D;;;OAGG;IACH,sBAAsB,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9C;;;;OAIG;IACH,cAAc,CAAC,IAAI,wBAAwB,GAAG,SAAS,CAAC;IACxD,4EAA4E;IAC5E,cAAc,CAAC,IAAI,SAAS,GAAG,SAAS,CAAC;IACzC;;;OAGG;IACH,eAAe,CAAC,IAAI,IAAI,CAAC;IACzB,gFAAgF;IAChF,cAAc,CAAC,IAAI,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { SnapLine } from 'pptx-viewer-shared';
|
|
3
|
+
import { EditorControllerDeps } from './editor-controller-deps';
|
|
4
|
+
import { GestureController } from './editor-gestures';
|
|
5
|
+
import { InkGestureController } from './editor-ink-gesture';
|
|
6
|
+
import { createSelectionGestureController, EditorMarqueeRect } from './editor-selection-gestures';
|
|
7
|
+
import { EditorState } from './editor-state.svelte';
|
|
8
|
+
/**
|
|
9
|
+
* The slice of `EditorController` its sub-controllers need. Passing this
|
|
10
|
+
* instead of the controller itself keeps the wiring below independent of the
|
|
11
|
+
* class (and of its private fields), which is what lets it live outside
|
|
12
|
+
* `editor-controller.svelte.ts` and hold that file within the repo's
|
|
13
|
+
* file-size budget.
|
|
14
|
+
*/
|
|
15
|
+
export interface EditorControllerHost {
|
|
16
|
+
editor: EditorState;
|
|
17
|
+
deps: EditorControllerDeps;
|
|
18
|
+
/** The elements the pointer currently acts on (slide, or master/layout). */
|
|
19
|
+
currentElements(): PptxElement[];
|
|
20
|
+
/** Publish the transient snap-alignment lines to the overlay. */
|
|
21
|
+
setSnapLines(lines: readonly SnapLine[]): void;
|
|
22
|
+
/** Publish the in-progress empty-canvas marquee rectangle. */
|
|
23
|
+
setMarquee(rect: EditorMarqueeRect | null): void;
|
|
24
|
+
/** The element currently open in the inline text editor, or null. */
|
|
25
|
+
getEditingId(): string | null;
|
|
26
|
+
}
|
|
27
|
+
/** Move / resize / rotate gestures, including snapping and history bracketing. */
|
|
28
|
+
export declare function createTransformGestures(host: EditorControllerHost): GestureController;
|
|
29
|
+
/** Pen / highlighter / eraser stroke gestures. */
|
|
30
|
+
export declare function createInkGestures(host: EditorControllerHost): InkGestureController;
|
|
31
|
+
/** The editing keymap (delete / duplicate / nudge / clipboard / undo / group / ...). */
|
|
32
|
+
export declare function createEditorKeydown(host: EditorControllerHost): (event: KeyboardEvent) => void;
|
|
33
|
+
/** Multi-selection drag + the empty-canvas rubber-band marquee. */
|
|
34
|
+
export declare function createSelectionGestures(host: EditorControllerHost): ReturnType<typeof createSelectionGestureController>;
|
|
35
|
+
//# sourceMappingURL=editor-controller-wiring.d.ts.map
|
|
@@ -0,0 +1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AAK,IAAI,CAmC9F;AAED,mEAAmE;AACnE,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,oBAAoB,GACxB,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAmBrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-controller.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-controller.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"editor-controller.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-controller.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAQnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAWrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,qBAAa,gBAAgB;;IAQ5B,SAAS,sBAAmC;IAC5C,SAAS,gBAA+B;IACxC,OAAO,2BAA0C;gBAErC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,oBAAoB;IA6B3D,IAAI,UAAU,wCAKb;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,cAAc,IAAI,WAAW,GAAG,SAAS,CAI5C;IAED,gFAAgF;IAChF,gBAAgB,IAAI,OAAO;IAM3B,kBAAkB,GAAI,OAAO,YAAY,KAAG,IAAI,CA2C9C;IAEF,kBAAkB,GAAI,OAAO,YAAY,KAAG,IAAI,CAa9C;IAEF,eAAe,GAAI,OAAO,UAAU,KAAG,IAAI,CAkBzC;IAEF,yEAAyE;IACzE,kBAAkB,GAAI,OAAO,UAAU,KAAG,IAAI,CA2B5C;IAEF,mBAAmB,GAAI,QAAQ,cAAc,EAAE,OAAO,YAAY,KAAG,IAAI,CAQvE;IAEF,mBAAmB,GAAI,OAAO,YAAY,KAAG,IAAI,CAK/C;IAEF,SAAS,GAAI,OAAO,aAAa,KAAG,IAAI,CAEtC;IAEF,2EAA2E;IAC3E,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAYjC;;;OAGG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAI7C,qEAAqE;IACrE,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAO5C,wDAAwD;IACxD,WAAW,IAAI,IAAI;IAInB,sDAAsD;IACtD,OAAO,IAAI,IAAI;CAKf"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxCustomShow, PptxHandoutMaster, PptxHeaderFooter, PptxNotesMaster, PptxPresentationProperties, PptxSaveFormat, PptxSection, PptxSlide, PptxSlideMaster, PptxTagCollection } from 'pptx-viewer-core';
|
|
2
|
+
import { EditorSnapshot } from './editor-document-state';
|
|
3
|
+
import { EditorState } from './editor-state.svelte';
|
|
4
|
+
/**
|
|
5
|
+
* Deck-level lifecycle for {@link EditorState}: adopting a freshly loaded
|
|
6
|
+
* document, resetting, taking a remote (collaboration) snapshot, restoring an
|
|
7
|
+
* undo snapshot, editing document metadata, and serialising back to bytes.
|
|
8
|
+
*
|
|
9
|
+
* These are free functions over the state rather than methods because
|
|
10
|
+
* `EditorState` is already a facade over thirteen focused controllers, and
|
|
11
|
+
* document lifecycle is simply the fourteenth concern; keeping it here is what
|
|
12
|
+
* holds that file within the repo's file-size budget.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Everything a load hands the editor, in the order `PptxHandler` produces it.
|
|
16
|
+
* Declared once here as a labelled tuple so `EditorState.setSlides` can forward
|
|
17
|
+
* it verbatim without restating eleven parameters (and their defaults).
|
|
18
|
+
*/
|
|
19
|
+
export type LoadDocumentArgs = [
|
|
20
|
+
slides: PptxSlide[],
|
|
21
|
+
slideMasters?: PptxSlideMaster[],
|
|
22
|
+
notesMaster?: PptxNotesMaster,
|
|
23
|
+
handoutMaster?: PptxHandoutMaster,
|
|
24
|
+
sections?: PptxSection[],
|
|
25
|
+
coreProperties?: PptxCoreProperties,
|
|
26
|
+
appProperties?: PptxAppProperties,
|
|
27
|
+
customProperties?: PptxCustomProperty[],
|
|
28
|
+
headerFooter?: PptxHeaderFooter,
|
|
29
|
+
presentationProperties?: PptxPresentationProperties,
|
|
30
|
+
customShows?: PptxCustomShow[]
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* Install a loaded deck as the editor's working document. Everything is
|
|
34
|
+
* deep-cloned so later edits never write through to the loader's parse result,
|
|
35
|
+
* and the editing session (selection, history, dirty flag, ink tool) is reset.
|
|
36
|
+
*/
|
|
37
|
+
export declare function loadEditorDocument(state: EditorState, ...args: LoadDocumentArgs): void;
|
|
38
|
+
/** Clear the editing session (selection, history, dirty flag) without touching content. */
|
|
39
|
+
export declare function resetEditorSession(state: EditorState): void;
|
|
40
|
+
/**
|
|
41
|
+
* Replace the working slides with a remote (collaboration) snapshot without
|
|
42
|
+
* recording an undo step or touching the dirty flag: the granular reconcile
|
|
43
|
+
* already merged the peer's change, and treating an incoming remote edit as
|
|
44
|
+
* a local mutation would both pollute the undo stack and re-broadcast it.
|
|
45
|
+
*
|
|
46
|
+
* Selection is preserved when the selected element still exists so a remote
|
|
47
|
+
* edit does not yank the local user's selection out from under them. Local
|
|
48
|
+
* undo history is intentionally kept (see the collaboration module JSDoc):
|
|
49
|
+
* shared defines no collaborative-undo semantics, so, matching React/Vue,
|
|
50
|
+
* local undo may fight a concurrent remote edit.
|
|
51
|
+
*/
|
|
52
|
+
export declare function applyRemoteEditorSlides(state: EditorState, slides: PptxSlide[]): void;
|
|
53
|
+
/**
|
|
54
|
+
* Restore an undo/redo snapshot. The snapshot is re-cloned on the way in so the
|
|
55
|
+
* stacked entry stays pristine and can be restored again (redo, then undo).
|
|
56
|
+
*/
|
|
57
|
+
export declare function restoreEditorSnapshot(state: EditorState, snapshot: EditorSnapshot | undefined): void;
|
|
58
|
+
/** Replace the document properties (File > Info) as one undoable edit. */
|
|
59
|
+
export declare function updateEditorDocumentProperties(state: EditorState, core: PptxCoreProperties, app: PptxAppProperties, custom: PptxCustomProperty[]): void;
|
|
60
|
+
/** Replace the tag collections as one undoable edit (inspector Tags section). */
|
|
61
|
+
export declare function updateEditorTagCollections(state: EditorState, next: readonly PptxTagCollection[]): void;
|
|
62
|
+
/**
|
|
63
|
+
* Serialise the edited document to `.pptx` bytes. Saves `renderedSlides` (the
|
|
64
|
+
* slides with their inherited template elements folded back in), not the
|
|
65
|
+
* partitioned working array, so master/layout edits persist.
|
|
66
|
+
*/
|
|
67
|
+
export declare function saveEditorState(state: EditorState, format?: PptxSaveFormat): Promise<Uint8Array>;
|
|
68
|
+
//# sourceMappingURL=editor-document-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-document-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-document-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,WAAW,EACX,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAA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AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACpC,KAAK,EAAE,WAAW,EAClB,MAAM,GAAE,cAAuB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAYrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxHandoutMaster, PptxHeaderFooter, PptxHandler, PptxNotesMaster, PptxSaveFormat, PptxSection, PptxSlide, PptxSlideMaster, PptxPresentationProperties, PptxCustomShow } from 'pptx-viewer-core';
|
|
1
|
+
import { PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxHandoutMaster, PptxHeaderFooter, PptxHandler, PptxNotesMaster, PptxSaveFormat, PptxSection, PptxSlide, PptxSlideMaster, PptxPresentationProperties, PptxCustomShow, PptxTagCollection } from 'pptx-viewer-core';
|
|
2
2
|
import { TemplateElementMap } from 'pptx-viewer-shared';
|
|
3
3
|
export interface EditorSnapshot {
|
|
4
4
|
slides: PptxSlide[];
|
|
@@ -13,6 +13,8 @@ export interface EditorSnapshot {
|
|
|
13
13
|
coreProperties: PptxCoreProperties | undefined;
|
|
14
14
|
appProperties: PptxAppProperties | undefined;
|
|
15
15
|
customProperties: PptxCustomProperty[];
|
|
16
|
+
/** `ppt/tags/*.xml` name/value metadata, editable in the inspector. */
|
|
17
|
+
tagCollections: PptxTagCollection[];
|
|
16
18
|
}
|
|
17
19
|
export declare function createEditorSnapshot(snapshot: EditorSnapshot): EditorSnapshot;
|
|
18
20
|
export declare function saveEditorDocument(handler: PptxHandler, snapshot: EditorSnapshot, format?: PptxSaveFormat): Promise<Uint8Array>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-document-state.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-document-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,WAAW,EACX,SAAS,EACT,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAK7D,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,yBAAyB,EAAE,kBAAkB,CAAC;IAC9C,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,WAAW,EAAE,eAAe,GAAG,SAAS,CAAC;IACzC,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,sBAAsB,EAAE,0BAA0B,CAAC;IACnD,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,cAAc,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC/C,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"editor-document-state.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-document-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,WAAW,EACX,SAAS,EACT,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,iBAAiB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAK7D,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,yBAAyB,EAAE,kBAAkB,CAAC;IAC9C,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,WAAW,EAAE,eAAe,GAAG,SAAS,CAAC;IACzC,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,sBAAsB,EAAE,0BAA0B,CAAC;IACnD,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,cAAc,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC/C,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;IACvC,uEAAuE;IACvE,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACpC;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAgB7E;AAED,wBAAsB,kBAAkB,CACvC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,cAAc,EACxB,MAAM,GAAE,cAAuB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAkCrB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ShapePptxElement } from 'pptx-viewer-core';
|
|
2
|
+
import { InkPoint } from 'pptx-viewer-shared';
|
|
3
|
+
export declare function strokeToFreeformShape(points: readonly InkPoint[], color: string, width: number): ShapePptxElement | null;
|
|
4
|
+
//# sourceMappingURL=editor-freeform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-freeform.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-freeform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA6BnD,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,SAAS,QAAQ,EAAE,EAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACX,gBAAgB,GAAG,IAAI,CAqDzB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EditorSnapshot } from './editor-document-state';
|
|
2
|
+
/** PowerPoint's own default for File > Options > Advanced > "maximum number of undos". */
|
|
3
|
+
export declare const MAX_HISTORY_ENTRIES = 100;
|
|
4
|
+
/**
|
|
5
|
+
* The editor's undo/redo stack, wrapped so `canUndo` / `canRedo` are runes the
|
|
6
|
+
* chrome can read directly.
|
|
7
|
+
*
|
|
8
|
+
* The shared {@link EditorHistory} is a plain (non-reactive) structure, so
|
|
9
|
+
* every mutation has to be followed by a flag re-read; doing that in one place
|
|
10
|
+
* here is what stops a missed `#syncHistoryFlags()` call leaving the ribbon's
|
|
11
|
+
* Undo button greyed out after a real edit. Extracted from `EditorState` to
|
|
12
|
+
* keep that file within the repo's file-size budget.
|
|
13
|
+
*/
|
|
14
|
+
export declare class EditorHistoryState {
|
|
15
|
+
#private;
|
|
16
|
+
get canUndo(): boolean;
|
|
17
|
+
get canRedo(): boolean;
|
|
18
|
+
/** Re-read the stack's availability flags onto the reactive mirrors. */
|
|
19
|
+
sync(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Apply the File > Options "maximum number of undos" value. Recreates the
|
|
22
|
+
* stack when the depth changes (PowerPoint likewise applies the new maximum
|
|
23
|
+
* going forward; existing entries are dropped).
|
|
24
|
+
*/
|
|
25
|
+
setDepth(depth: number): void;
|
|
26
|
+
record(snapshot: EditorSnapshot): void;
|
|
27
|
+
clear(): void;
|
|
28
|
+
undo(current: EditorSnapshot): EditorSnapshot | undefined;
|
|
29
|
+
redo(current: EditorSnapshot): EditorSnapshot | undefined;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=editor-history-state.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-history-state.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-history-state.svelte.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;;;;;;;;GASG;AACH,qBAAa,kBAAkB;;IAM9B,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,wEAAwE;IACxE,IAAI,IAAI,IAAI;IAKZ;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAS7B,MAAM,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAKtC,KAAK,IAAI,IAAI;IAKb,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,GAAG,SAAS;IAIzD,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,GAAG,SAAS;CAGzD"}
|
|
@@ -3,10 +3,13 @@ import { EditorState } from './editor-state.svelte';
|
|
|
3
3
|
/**
|
|
4
4
|
* The ribbon Draw tab's active tool. `'select'` means "not drawing": the
|
|
5
5
|
* stage's normal selection/drag/resize gestures own the pointer, matching
|
|
6
|
-
* React's `DrawingTool` / Angular's `DrawTool
|
|
7
|
-
*
|
|
6
|
+
* React's `DrawingTool` / Angular's `DrawTool`.
|
|
7
|
+
*
|
|
8
|
+
* `freeform` shares the pen's gesture but commits a closed custom-geometry
|
|
9
|
+
* SHAPE rather than an ink stroke, so the result is editable/fillable like any
|
|
10
|
+
* other shape; see `editor-freeform.ts`.
|
|
8
11
|
*/
|
|
9
|
-
export type InkDrawTool = 'select' | 'pen' | 'highlighter' | 'eraser';
|
|
12
|
+
export type InkDrawTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'freeform';
|
|
10
13
|
/**
|
|
11
14
|
* EditorInkController: the ribbon Draw tab's tool/colour/width state plus the
|
|
12
15
|
* pure element-factory / erase mutations, split out of `EditorState` to keep
|
|
@@ -45,9 +48,10 @@ export declare class EditorInkController {
|
|
|
45
48
|
/** Update the live preview path while a pen/highlighter stroke is in progress. */
|
|
46
49
|
previewStroke(points: readonly InkPoint[]): void;
|
|
47
50
|
/**
|
|
48
|
-
* Finalise the in-progress stroke
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
+
* Finalise the in-progress stroke (undoable via `EditorState.insertElement`),
|
|
52
|
+
* or discard it silently when too short (a plain tap) or the tool changed
|
|
53
|
+
* mid-gesture. Pen/highlighter commit an `ink` element; freeform commits a
|
|
54
|
+
* closed custom-geometry `shape`.
|
|
51
55
|
*/
|
|
52
56
|
commitStroke(points: readonly InkPoint[]): void;
|
|
53
57
|
/**
|
|
@@ -1 +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;
|
|
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;AAKnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,GAAG,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAC;AAQnF;;;;;;;;;;;;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;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI;IAuB/C;;;OAGG;IACH,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;CAmBrC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Editing keyboard shortcuts,
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Editing keyboard shortcuts, called from the viewer root's keydown before the
|
|
3
|
+
* slideshow navigation handler. Key-to-action resolution is the shared
|
|
4
|
+
* `mapEditorKey`, the one keymap all five bindings resolve against, so this file
|
|
5
|
+
* is only the dispatch table.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
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.
|
|
7
|
+
* Slide paging is deliberately NOT dispatched here: the root handler falls
|
|
8
|
+
* through to `viewer.handleNavigationKey` when this one does not consume the
|
|
9
|
+
* event, so acting on `prevSlide` / `nextSlide` too would advance two slides per
|
|
10
|
+
* press.
|
|
14
11
|
*/
|
|
15
12
|
export interface EditorKeyboardDeps {
|
|
16
13
|
/** False disables everything (not editable, presenting, inline editing). */
|
|
@@ -25,7 +22,17 @@ export interface EditorKeyboardDeps {
|
|
|
25
22
|
copySelected(): void;
|
|
26
23
|
cutSelected(): void;
|
|
27
24
|
paste(): void;
|
|
25
|
+
/** Select every interactive element on the active slide (Ctrl+A). */
|
|
26
|
+
selectAll(): void;
|
|
27
|
+
/** Group the multi-selection into one group element (Ctrl+G). */
|
|
28
|
+
groupSelected(): void;
|
|
29
|
+
/** Ungroup the selected group (Ctrl+Shift+G). */
|
|
30
|
+
ungroupSelected(): void;
|
|
28
31
|
cancelFormatPainter?(): boolean;
|
|
32
|
+
/** Show or hide the keyboard-shortcut cheat sheet ("?"). */
|
|
33
|
+
toggleShortcuts?(): void;
|
|
34
|
+
/** Close the cheat sheet on Escape; true when it was open (Escape consumed). */
|
|
35
|
+
closeShortcuts?(): boolean;
|
|
29
36
|
}
|
|
30
37
|
export declare function createEditorKeydownHandler(deps: EditorKeyboardDeps): (event: KeyboardEvent) => void;
|
|
31
38
|
//# sourceMappingURL=editor-keyboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-keyboard.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-keyboard.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"editor-keyboard.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-keyboard.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;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,qEAAqE;IACrE,SAAS,IAAI,IAAI,CAAC;IAClB,iEAAiE;IACjE,aAAa,IAAI,IAAI,CAAC;IACtB,iDAAiD;IACjD,eAAe,IAAI,IAAI,CAAC;IACxB,mBAAmB,CAAC,IAAI,OAAO,CAAC;IAChC,4DAA4D;IAC5D,eAAe,CAAC,IAAI,IAAI,CAAC;IACzB,gFAAgF;IAChF,cAAc,CAAC,IAAI,OAAO,CAAC;CAC3B;AAED,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,kBAAkB,GACtB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAgEhC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
import { PptxElement } from 'pptx-viewer-core';
|
|
11
2
|
export declare class EditorSelection {
|
|
12
3
|
#private;
|
|
13
4
|
/** All selected ids in selection order (primary last). */
|
|
@@ -29,4 +20,13 @@ export declare class EditorSelection {
|
|
|
29
20
|
/** Drop ids that no longer resolve to an element (after remote/undo edits). */
|
|
30
21
|
prune(exists: (id: string) => boolean): void;
|
|
31
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve selected ids to their elements, preserving selection order.
|
|
25
|
+
*
|
|
26
|
+
* The one- and zero-selection fast paths matter: this runs on every render of
|
|
27
|
+
* the inspector and the selection overlay, and building a lookup map for the
|
|
28
|
+
* overwhelmingly common single selection would allocate a `Map` over every
|
|
29
|
+
* element on the slide for one hit.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveSelectedElements(ids: readonly string[], elements: readonly PptxElement[]): PptxElement[];
|
|
32
32
|
//# sourceMappingURL=editor-selection.svelte.d.ts.map
|
|
@@ -1 +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"}
|
|
1
|
+
{"version":3,"file":"editor-selection.svelte.d.ts","sourceRoot":"","sources":["../../../src/viewer/editor/editor-selection.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,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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