pptx-glimpse 3.1.1 → 3.2.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.
@@ -2,7 +2,7 @@ import { a as ConvertOptions, d as SlideSvg, P as PngConversionReport } from './
2
2
  export { C as ConversionDiagnostic, D as DEFAULT_FONT_MAPPING, F as FontBuffer, b as FontMapping, L as LogLevel, O as OpentypeSetup, S as SlideImage, c as SlideSupportCoverage, e as SupportCoverage, f as SupportCoverageCounts, g as SvgConversionReport, U as UsedFonts, W as WarningEntry, h as WarningSummary, i as clearFontCache, j as collectUsedFonts, m as convertPptxToSvg, n as createFontMapping, o as createOpentypeSetupFromBuffers, p as createOpentypeTextMeasurerFromBuffers, q as getMappedFont, r as getWarningEntries, s as getWarningSummary, u as renderPptxSourceModelToSvg } from './font-collector-BYuaCG-o.cjs';
3
3
  import { ResvgWasmInput } from '@pptx-glimpse/renderer/png/browser';
4
4
  export { ResvgWasmInput } from '@pptx-glimpse/renderer/png/browser';
5
- import { SourceHandle, EditableTextRunProperties, EditableTextRunProperty, Emu, AddTextBoxInput, AddConnectorInput, AddEmptySlideFromLayoutInput, SourceShapeNode, PptxSourceModel } from '@pptx-glimpse/document';
5
+ import { SourceHandle, EditableTextRunProperties, EditableTextRunProperty, EditableParagraphProperties, EditableParagraphProperty, Emu, EditableShapeFill, EditableShapeOutline, AddTextBoxInput, AddConnectorInput, AddEmptySlideFromLayoutInput, MoveSlideInput, SourceShapeNode, PptxSourceModel } from '@pptx-glimpse/document';
6
6
  export { PptxSourceModel, SourceHandle } from '@pptx-glimpse/document';
7
7
 
8
8
  interface PptxTextBodyProseMirrorDocJson {
@@ -11,9 +11,9 @@ interface PptxTextBodyProseMirrorDocJson {
11
11
  }
12
12
  interface PptxTextBodyProseMirrorParagraphJson {
13
13
  readonly type: "paragraph";
14
- /** Read-only source metadata. Formatting edits are not applied from ProseMirror JSON. */
15
14
  readonly attrs?: {
16
15
  readonly handle?: SourceHandle | null;
16
+ /** Source metadata plus editable paragraph properties. Only align / level / bullet are applied. */
17
17
  readonly properties?: unknown;
18
18
  };
19
19
  readonly content?: readonly PptxTextBodyProseMirrorTextJson[];
@@ -52,6 +52,16 @@ interface ClearTextRunPropertiesCommand {
52
52
  readonly handle: SourceHandle;
53
53
  readonly properties: readonly EditableTextRunProperty[];
54
54
  }
55
+ interface SetParagraphPropertiesCommand {
56
+ readonly kind: "setParagraphProperties";
57
+ readonly handle: SourceHandle;
58
+ readonly properties: EditableParagraphProperties;
59
+ }
60
+ interface ClearParagraphPropertiesCommand {
61
+ readonly kind: "clearParagraphProperties";
62
+ readonly handle: SourceHandle;
63
+ readonly properties: readonly EditableParagraphProperty[];
64
+ }
55
65
  interface MoveShapeCommand {
56
66
  readonly kind: "moveShape";
57
67
  readonly handle: SourceHandle;
@@ -72,6 +82,16 @@ interface SetShapeTransformCommand {
72
82
  readonly width: Emu;
73
83
  readonly height: Emu;
74
84
  }
85
+ interface SetShapeFillCommand {
86
+ readonly kind: "setShapeFill";
87
+ readonly handle: SourceHandle;
88
+ readonly fill: EditableShapeFill;
89
+ }
90
+ interface SetShapeOutlineCommand {
91
+ readonly kind: "setShapeOutline";
92
+ readonly handle: SourceHandle;
93
+ readonly outline: EditableShapeOutline;
94
+ }
75
95
  interface AddTextBoxCommand extends AddTextBoxInput {
76
96
  readonly kind: "addTextBox";
77
97
  readonly slideHandle: SourceHandle;
@@ -96,11 +116,15 @@ interface DuplicateSlideCommand {
96
116
  readonly kind: "duplicateSlide";
97
117
  readonly handle: SourceHandle;
98
118
  }
119
+ interface MoveSlideCommand extends MoveSlideInput {
120
+ readonly kind: "moveSlide";
121
+ readonly handle: SourceHandle;
122
+ }
99
123
  interface DeleteSlideCommand {
100
124
  readonly kind: "deleteSlide";
101
125
  readonly handle: SourceHandle;
102
126
  }
103
- type EditorCommand = ReplaceTextRunPlainTextCommand | ReplaceParagraphPlainTextCommand | SetTextRunPropertiesCommand | ClearTextRunPropertiesCommand | MoveShapeCommand | ResizeShapeCommand | SetShapeTransformCommand | AddTextBoxCommand | AddConnectorCommand | DeleteShapeCommand | ReplaceImageCommand | AddEmptySlideFromLayoutCommand | DuplicateSlideCommand | DeleteSlideCommand;
127
+ type EditorCommand = ReplaceTextRunPlainTextCommand | ReplaceParagraphPlainTextCommand | SetTextRunPropertiesCommand | ClearTextRunPropertiesCommand | SetParagraphPropertiesCommand | ClearParagraphPropertiesCommand | MoveShapeCommand | ResizeShapeCommand | SetShapeTransformCommand | SetShapeFillCommand | SetShapeOutlineCommand | AddTextBoxCommand | AddConnectorCommand | DeleteShapeCommand | ReplaceImageCommand | AddEmptySlideFromLayoutCommand | DuplicateSlideCommand | MoveSlideCommand | DeleteSlideCommand;
104
128
  interface EditorCommandWarning {
105
129
  readonly code: "shared-media-part";
106
130
  readonly message: string;
@@ -159,6 +183,13 @@ interface BrowserEditorAddTextBoxOptions {
159
183
  readonly text?: string;
160
184
  readonly name?: string;
161
185
  }
186
+ interface BrowserEditorAddConnectorOptions {
187
+ readonly x?: number;
188
+ readonly y?: number;
189
+ readonly width?: number;
190
+ readonly height?: number;
191
+ readonly name?: string;
192
+ }
162
193
  interface BrowserEditorSlidesResponse {
163
194
  readonly slides: readonly BrowserEditorSlideSvg[];
164
195
  readonly history: BrowserEditorHistoryState;
@@ -184,6 +215,7 @@ declare class BrowserPptxEditorSession {
184
215
  renderCurrentSlides(): Promise<readonly BrowserEditorSlideSvg[]>;
185
216
  apply(command: EditorCommand): Promise<BrowserEditorSlidesResponse>;
186
217
  addTextBox(slideNumber?: number, options?: BrowserEditorAddTextBoxOptions): Promise<BrowserEditorSlidesResponse>;
218
+ addConnector(slideNumber?: number, options?: BrowserEditorAddConnectorOptions): Promise<BrowserEditorSlidesResponse>;
187
219
  deleteShape(handle: SourceHandle): Promise<BrowserEditorSlidesResponse>;
188
220
  deleteSelectedShape(): Promise<BrowserEditorSlidesResponse>;
189
221
  applyTextBodyDocJson(handle: SourceHandle, docJson: unknown): Promise<BrowserEditorSlidesResponse>;
@@ -197,4 +229,4 @@ declare function createBrowserPptxEditorSession(input: Uint8Array, renderOptions
197
229
  declare function convertPptxToPng(input: Uint8Array, options?: ConvertOptions): Promise<PngConversionReport>;
198
230
  declare function initResvgWasm(wasm: ResvgWasmInput): Promise<void>;
199
231
 
200
- export { type BrowserEditorAddTextBoxOptions, type BrowserEditorHistoryState, type BrowserEditorImageReplacementInfo, type BrowserEditorRenderOptions, type BrowserEditorSaveResponse, type BrowserEditorSelectionInfo, type BrowserEditorShapeBoundsPx, type BrowserEditorShapeInfo, type BrowserEditorSlideSvg, type BrowserEditorSlidesResponse, type BrowserEditorTextBodyInfo, type BrowserEditorTextRunInfo, BrowserPptxEditorSession, ConvertOptions, type EditorCommand, type EditorCommandWarning, PngConversionReport, SlideSvg, convertPptxToPng, createBrowserPptxEditorSession, initResvgWasm };
232
+ export { type BrowserEditorAddConnectorOptions, type BrowserEditorAddTextBoxOptions, type BrowserEditorHistoryState, type BrowserEditorImageReplacementInfo, type BrowserEditorRenderOptions, type BrowserEditorSaveResponse, type BrowserEditorSelectionInfo, type BrowserEditorShapeBoundsPx, type BrowserEditorShapeInfo, type BrowserEditorSlideSvg, type BrowserEditorSlidesResponse, type BrowserEditorTextBodyInfo, type BrowserEditorTextRunInfo, BrowserPptxEditorSession, ConvertOptions, type EditorCommand, type EditorCommandWarning, PngConversionReport, SlideSvg, convertPptxToPng, createBrowserPptxEditorSession, initResvgWasm };
package/dist/browser.d.ts CHANGED
@@ -2,7 +2,7 @@ import { a as ConvertOptions, d as SlideSvg, P as PngConversionReport } from './
2
2
  export { C as ConversionDiagnostic, D as DEFAULT_FONT_MAPPING, F as FontBuffer, b as FontMapping, L as LogLevel, O as OpentypeSetup, S as SlideImage, c as SlideSupportCoverage, e as SupportCoverage, f as SupportCoverageCounts, g as SvgConversionReport, U as UsedFonts, W as WarningEntry, h as WarningSummary, i as clearFontCache, j as collectUsedFonts, m as convertPptxToSvg, n as createFontMapping, o as createOpentypeSetupFromBuffers, p as createOpentypeTextMeasurerFromBuffers, q as getMappedFont, r as getWarningEntries, s as getWarningSummary, u as renderPptxSourceModelToSvg } from './font-collector-BYuaCG-o.js';
3
3
  import { ResvgWasmInput } from '@pptx-glimpse/renderer/png/browser';
4
4
  export { ResvgWasmInput } from '@pptx-glimpse/renderer/png/browser';
5
- import { SourceHandle, EditableTextRunProperties, EditableTextRunProperty, Emu, AddTextBoxInput, AddConnectorInput, AddEmptySlideFromLayoutInput, SourceShapeNode, PptxSourceModel } from '@pptx-glimpse/document';
5
+ import { SourceHandle, EditableTextRunProperties, EditableTextRunProperty, EditableParagraphProperties, EditableParagraphProperty, Emu, EditableShapeFill, EditableShapeOutline, AddTextBoxInput, AddConnectorInput, AddEmptySlideFromLayoutInput, MoveSlideInput, SourceShapeNode, PptxSourceModel } from '@pptx-glimpse/document';
6
6
  export { PptxSourceModel, SourceHandle } from '@pptx-glimpse/document';
7
7
 
8
8
  interface PptxTextBodyProseMirrorDocJson {
@@ -11,9 +11,9 @@ interface PptxTextBodyProseMirrorDocJson {
11
11
  }
12
12
  interface PptxTextBodyProseMirrorParagraphJson {
13
13
  readonly type: "paragraph";
14
- /** Read-only source metadata. Formatting edits are not applied from ProseMirror JSON. */
15
14
  readonly attrs?: {
16
15
  readonly handle?: SourceHandle | null;
16
+ /** Source metadata plus editable paragraph properties. Only align / level / bullet are applied. */
17
17
  readonly properties?: unknown;
18
18
  };
19
19
  readonly content?: readonly PptxTextBodyProseMirrorTextJson[];
@@ -52,6 +52,16 @@ interface ClearTextRunPropertiesCommand {
52
52
  readonly handle: SourceHandle;
53
53
  readonly properties: readonly EditableTextRunProperty[];
54
54
  }
55
+ interface SetParagraphPropertiesCommand {
56
+ readonly kind: "setParagraphProperties";
57
+ readonly handle: SourceHandle;
58
+ readonly properties: EditableParagraphProperties;
59
+ }
60
+ interface ClearParagraphPropertiesCommand {
61
+ readonly kind: "clearParagraphProperties";
62
+ readonly handle: SourceHandle;
63
+ readonly properties: readonly EditableParagraphProperty[];
64
+ }
55
65
  interface MoveShapeCommand {
56
66
  readonly kind: "moveShape";
57
67
  readonly handle: SourceHandle;
@@ -72,6 +82,16 @@ interface SetShapeTransformCommand {
72
82
  readonly width: Emu;
73
83
  readonly height: Emu;
74
84
  }
85
+ interface SetShapeFillCommand {
86
+ readonly kind: "setShapeFill";
87
+ readonly handle: SourceHandle;
88
+ readonly fill: EditableShapeFill;
89
+ }
90
+ interface SetShapeOutlineCommand {
91
+ readonly kind: "setShapeOutline";
92
+ readonly handle: SourceHandle;
93
+ readonly outline: EditableShapeOutline;
94
+ }
75
95
  interface AddTextBoxCommand extends AddTextBoxInput {
76
96
  readonly kind: "addTextBox";
77
97
  readonly slideHandle: SourceHandle;
@@ -96,11 +116,15 @@ interface DuplicateSlideCommand {
96
116
  readonly kind: "duplicateSlide";
97
117
  readonly handle: SourceHandle;
98
118
  }
119
+ interface MoveSlideCommand extends MoveSlideInput {
120
+ readonly kind: "moveSlide";
121
+ readonly handle: SourceHandle;
122
+ }
99
123
  interface DeleteSlideCommand {
100
124
  readonly kind: "deleteSlide";
101
125
  readonly handle: SourceHandle;
102
126
  }
103
- type EditorCommand = ReplaceTextRunPlainTextCommand | ReplaceParagraphPlainTextCommand | SetTextRunPropertiesCommand | ClearTextRunPropertiesCommand | MoveShapeCommand | ResizeShapeCommand | SetShapeTransformCommand | AddTextBoxCommand | AddConnectorCommand | DeleteShapeCommand | ReplaceImageCommand | AddEmptySlideFromLayoutCommand | DuplicateSlideCommand | DeleteSlideCommand;
127
+ type EditorCommand = ReplaceTextRunPlainTextCommand | ReplaceParagraphPlainTextCommand | SetTextRunPropertiesCommand | ClearTextRunPropertiesCommand | SetParagraphPropertiesCommand | ClearParagraphPropertiesCommand | MoveShapeCommand | ResizeShapeCommand | SetShapeTransformCommand | SetShapeFillCommand | SetShapeOutlineCommand | AddTextBoxCommand | AddConnectorCommand | DeleteShapeCommand | ReplaceImageCommand | AddEmptySlideFromLayoutCommand | DuplicateSlideCommand | MoveSlideCommand | DeleteSlideCommand;
104
128
  interface EditorCommandWarning {
105
129
  readonly code: "shared-media-part";
106
130
  readonly message: string;
@@ -159,6 +183,13 @@ interface BrowserEditorAddTextBoxOptions {
159
183
  readonly text?: string;
160
184
  readonly name?: string;
161
185
  }
186
+ interface BrowserEditorAddConnectorOptions {
187
+ readonly x?: number;
188
+ readonly y?: number;
189
+ readonly width?: number;
190
+ readonly height?: number;
191
+ readonly name?: string;
192
+ }
162
193
  interface BrowserEditorSlidesResponse {
163
194
  readonly slides: readonly BrowserEditorSlideSvg[];
164
195
  readonly history: BrowserEditorHistoryState;
@@ -184,6 +215,7 @@ declare class BrowserPptxEditorSession {
184
215
  renderCurrentSlides(): Promise<readonly BrowserEditorSlideSvg[]>;
185
216
  apply(command: EditorCommand): Promise<BrowserEditorSlidesResponse>;
186
217
  addTextBox(slideNumber?: number, options?: BrowserEditorAddTextBoxOptions): Promise<BrowserEditorSlidesResponse>;
218
+ addConnector(slideNumber?: number, options?: BrowserEditorAddConnectorOptions): Promise<BrowserEditorSlidesResponse>;
187
219
  deleteShape(handle: SourceHandle): Promise<BrowserEditorSlidesResponse>;
188
220
  deleteSelectedShape(): Promise<BrowserEditorSlidesResponse>;
189
221
  applyTextBodyDocJson(handle: SourceHandle, docJson: unknown): Promise<BrowserEditorSlidesResponse>;
@@ -197,4 +229,4 @@ declare function createBrowserPptxEditorSession(input: Uint8Array, renderOptions
197
229
  declare function convertPptxToPng(input: Uint8Array, options?: ConvertOptions): Promise<PngConversionReport>;
198
230
  declare function initResvgWasm(wasm: ResvgWasmInput): Promise<void>;
199
231
 
200
- export { type BrowserEditorAddTextBoxOptions, type BrowserEditorHistoryState, type BrowserEditorImageReplacementInfo, type BrowserEditorRenderOptions, type BrowserEditorSaveResponse, type BrowserEditorSelectionInfo, type BrowserEditorShapeBoundsPx, type BrowserEditorShapeInfo, type BrowserEditorSlideSvg, type BrowserEditorSlidesResponse, type BrowserEditorTextBodyInfo, type BrowserEditorTextRunInfo, BrowserPptxEditorSession, ConvertOptions, type EditorCommand, type EditorCommandWarning, PngConversionReport, SlideSvg, convertPptxToPng, createBrowserPptxEditorSession, initResvgWasm };
232
+ export { type BrowserEditorAddConnectorOptions, type BrowserEditorAddTextBoxOptions, type BrowserEditorHistoryState, type BrowserEditorImageReplacementInfo, type BrowserEditorRenderOptions, type BrowserEditorSaveResponse, type BrowserEditorSelectionInfo, type BrowserEditorShapeBoundsPx, type BrowserEditorShapeInfo, type BrowserEditorSlideSvg, type BrowserEditorSlidesResponse, type BrowserEditorTextBodyInfo, type BrowserEditorTextRunInfo, BrowserPptxEditorSession, ConvertOptions, type EditorCommand, type EditorCommandWarning, PngConversionReport, SlideSvg, convertPptxToPng, createBrowserPptxEditorSession, initResvgWasm };