pptx-glimpse 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +14329 -0
- package/dist/browser.d.cts +131 -0
- package/dist/browser.d.ts +131 -0
- package/dist/browser.js +3180 -0
- package/dist/chunk-2AYNMYMC.js +1554 -0
- package/dist/chunk-KMSN55AE.js +9629 -0
- package/dist/chunk-MWMHSSAD.js +124 -0
- package/dist/chunk-QPT6BMN5.js +25 -0
- package/dist/font-collector-DYooJP6L.d.cts +1345 -0
- package/dist/font-collector-DYooJP6L.d.ts +1345 -0
- package/dist/index.cjs +8965 -8685
- package/dist/index.d.cts +4 -538
- package/dist/index.d.ts +4 -538
- package/dist/index.js +57 -10660
- package/dist/node-6KTAWUIB.js +9 -0
- package/dist/node-font-loader-274G445U.js +45 -0
- package/dist/png-IONMVVDQ.js +53 -0
- package/package.json +10 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { f as SourceHandle, E as Emu, a as ConvertOptions, g as SourceShapeNode, e as SlideSvg, c as PptxSourceModel, P as PngConversionReport } from './font-collector-DYooJP6L.cjs';
|
|
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, d as SlideSupportCoverage, h as SupportCoverage, i as SupportCoverageCounts, j as SvgConversionReport, U as UsedFonts, W as WarningEntry, k as WarningSummary, l as clearFontCache, m as collectUsedFonts, o as convertPptxToSvg, q as createFontMapping, r as createOpentypeSetupFromBuffers, s as createOpentypeTextMeasurerFromBuffers, t as getMappedFont, u as getWarningEntries, v as getWarningSummary } from './font-collector-DYooJP6L.cjs';
|
|
3
|
+
import { ResvgWasmInput } from '@pptx-glimpse/renderer/png/browser';
|
|
4
|
+
export { ResvgWasmInput } from '@pptx-glimpse/renderer/png/browser';
|
|
5
|
+
|
|
6
|
+
interface PptxTextBodyProseMirrorDocJson {
|
|
7
|
+
readonly type: "doc";
|
|
8
|
+
readonly content?: readonly PptxTextBodyProseMirrorParagraphJson[];
|
|
9
|
+
}
|
|
10
|
+
interface PptxTextBodyProseMirrorParagraphJson {
|
|
11
|
+
readonly type: "paragraph";
|
|
12
|
+
/** Read-only source metadata. Formatting edits are not applied from ProseMirror JSON. */
|
|
13
|
+
readonly attrs?: {
|
|
14
|
+
readonly handle?: SourceHandle | null;
|
|
15
|
+
readonly properties?: unknown;
|
|
16
|
+
};
|
|
17
|
+
readonly content?: readonly PptxTextBodyProseMirrorTextJson[];
|
|
18
|
+
}
|
|
19
|
+
interface PptxTextBodyProseMirrorTextJson {
|
|
20
|
+
readonly type: "text";
|
|
21
|
+
readonly text: string;
|
|
22
|
+
readonly marks?: readonly PptxTextBodyProseMirrorRunMarkJson[];
|
|
23
|
+
}
|
|
24
|
+
interface PptxTextBodyProseMirrorRunMarkJson {
|
|
25
|
+
readonly type: "pptxRun";
|
|
26
|
+
/** Read-only source metadata. Formatting edits are not applied from ProseMirror JSON. */
|
|
27
|
+
readonly attrs?: {
|
|
28
|
+
readonly handle?: SourceHandle | null;
|
|
29
|
+
readonly properties?: unknown;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface ReplaceTextRunPlainTextCommand {
|
|
34
|
+
readonly kind: "replaceTextRunPlainText";
|
|
35
|
+
readonly handle: SourceHandle;
|
|
36
|
+
readonly text: string;
|
|
37
|
+
}
|
|
38
|
+
interface ReplaceParagraphPlainTextCommand {
|
|
39
|
+
readonly kind: "replaceParagraphPlainText";
|
|
40
|
+
readonly handle: SourceHandle;
|
|
41
|
+
readonly text: string;
|
|
42
|
+
}
|
|
43
|
+
interface MoveShapeCommand {
|
|
44
|
+
readonly kind: "moveShape";
|
|
45
|
+
readonly handle: SourceHandle;
|
|
46
|
+
readonly offsetX: Emu;
|
|
47
|
+
readonly offsetY: Emu;
|
|
48
|
+
}
|
|
49
|
+
interface ResizeShapeCommand {
|
|
50
|
+
readonly kind: "resizeShape";
|
|
51
|
+
readonly handle: SourceHandle;
|
|
52
|
+
readonly width: Emu;
|
|
53
|
+
readonly height: Emu;
|
|
54
|
+
}
|
|
55
|
+
interface SetShapeTransformCommand {
|
|
56
|
+
readonly kind: "setShapeTransform";
|
|
57
|
+
readonly handle: SourceHandle;
|
|
58
|
+
readonly offsetX: Emu;
|
|
59
|
+
readonly offsetY: Emu;
|
|
60
|
+
readonly width: Emu;
|
|
61
|
+
readonly height: Emu;
|
|
62
|
+
}
|
|
63
|
+
type EditorCommand = ReplaceTextRunPlainTextCommand | ReplaceParagraphPlainTextCommand | MoveShapeCommand | ResizeShapeCommand | SetShapeTransformCommand;
|
|
64
|
+
|
|
65
|
+
interface BrowserEditorHistoryState {
|
|
66
|
+
readonly canUndo: boolean;
|
|
67
|
+
readonly canRedo: boolean;
|
|
68
|
+
readonly undoDepth: number;
|
|
69
|
+
readonly redoDepth: number;
|
|
70
|
+
}
|
|
71
|
+
interface BrowserEditorSelectionInfo {
|
|
72
|
+
readonly shapeHandle: SourceHandle;
|
|
73
|
+
}
|
|
74
|
+
interface BrowserEditorTextRunInfo {
|
|
75
|
+
readonly text: string;
|
|
76
|
+
readonly handle: SourceHandle;
|
|
77
|
+
}
|
|
78
|
+
interface BrowserEditorTextBodyInfo {
|
|
79
|
+
readonly docJson: PptxTextBodyProseMirrorDocJson;
|
|
80
|
+
}
|
|
81
|
+
interface BrowserEditorShapeBoundsPx {
|
|
82
|
+
readonly x: number;
|
|
83
|
+
readonly y: number;
|
|
84
|
+
readonly width: number;
|
|
85
|
+
readonly height: number;
|
|
86
|
+
}
|
|
87
|
+
interface BrowserEditorShapeInfo {
|
|
88
|
+
readonly id: string;
|
|
89
|
+
readonly kind: SourceShapeNode["kind"];
|
|
90
|
+
readonly name?: string;
|
|
91
|
+
readonly handle?: SourceHandle;
|
|
92
|
+
readonly bounds?: BrowserEditorShapeBoundsPx;
|
|
93
|
+
readonly editableTransform?: boolean;
|
|
94
|
+
readonly textRuns?: readonly BrowserEditorTextRunInfo[];
|
|
95
|
+
readonly editableTextBody?: BrowserEditorTextBodyInfo;
|
|
96
|
+
}
|
|
97
|
+
interface BrowserEditorSlidesResponse {
|
|
98
|
+
readonly slides: readonly SlideSvg[];
|
|
99
|
+
readonly history: BrowserEditorHistoryState;
|
|
100
|
+
readonly selection?: BrowserEditorSelectionInfo;
|
|
101
|
+
}
|
|
102
|
+
interface BrowserEditorSaveResponse {
|
|
103
|
+
readonly ok: true;
|
|
104
|
+
readonly pptx: Uint8Array;
|
|
105
|
+
readonly history: BrowserEditorHistoryState;
|
|
106
|
+
}
|
|
107
|
+
type BrowserEditorRenderOptions = Omit<ConvertOptions, "slides">;
|
|
108
|
+
declare class BrowserPptxEditorSession {
|
|
109
|
+
#private;
|
|
110
|
+
private constructor();
|
|
111
|
+
static create(input: Uint8Array, renderOptions?: BrowserEditorRenderOptions): Promise<BrowserPptxEditorSession>;
|
|
112
|
+
get document(): PptxSourceModel;
|
|
113
|
+
get slides(): readonly SlideSvg[];
|
|
114
|
+
get history(): BrowserEditorHistoryState;
|
|
115
|
+
get selection(): BrowserEditorSelectionInfo | undefined;
|
|
116
|
+
response(): BrowserEditorSlidesResponse;
|
|
117
|
+
shapes(slideNumber: number): readonly BrowserEditorShapeInfo[];
|
|
118
|
+
renderCurrentSlides(): Promise<readonly SlideSvg[]>;
|
|
119
|
+
apply(command: EditorCommand): Promise<BrowserEditorSlidesResponse>;
|
|
120
|
+
applyTextBodyDocJson(handle: SourceHandle, docJson: unknown): Promise<BrowserEditorSlidesResponse>;
|
|
121
|
+
selectShape(handle: SourceHandle): BrowserEditorSlidesResponse;
|
|
122
|
+
undo(): Promise<BrowserEditorSlidesResponse>;
|
|
123
|
+
redo(): Promise<BrowserEditorSlidesResponse>;
|
|
124
|
+
save(): BrowserEditorSaveResponse;
|
|
125
|
+
}
|
|
126
|
+
declare function createBrowserPptxEditorSession(input: Uint8Array, renderOptions?: BrowserEditorRenderOptions): Promise<BrowserPptxEditorSession>;
|
|
127
|
+
|
|
128
|
+
declare function convertPptxToPng(input: Uint8Array, options?: ConvertOptions): Promise<PngConversionReport>;
|
|
129
|
+
declare function initResvgWasm(wasm: ResvgWasmInput): Promise<void>;
|
|
130
|
+
|
|
131
|
+
export { type BrowserEditorHistoryState, type BrowserEditorRenderOptions, type BrowserEditorSaveResponse, type BrowserEditorSelectionInfo, type BrowserEditorShapeBoundsPx, type BrowserEditorShapeInfo, type BrowserEditorSlidesResponse, type BrowserEditorTextBodyInfo, type BrowserEditorTextRunInfo, BrowserPptxEditorSession, ConvertOptions, type EditorCommand, PngConversionReport, SlideSvg, SourceHandle, convertPptxToPng, createBrowserPptxEditorSession, initResvgWasm };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { f as SourceHandle, E as Emu, a as ConvertOptions, g as SourceShapeNode, e as SlideSvg, c as PptxSourceModel, P as PngConversionReport } from './font-collector-DYooJP6L.js';
|
|
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, d as SlideSupportCoverage, h as SupportCoverage, i as SupportCoverageCounts, j as SvgConversionReport, U as UsedFonts, W as WarningEntry, k as WarningSummary, l as clearFontCache, m as collectUsedFonts, o as convertPptxToSvg, q as createFontMapping, r as createOpentypeSetupFromBuffers, s as createOpentypeTextMeasurerFromBuffers, t as getMappedFont, u as getWarningEntries, v as getWarningSummary } from './font-collector-DYooJP6L.js';
|
|
3
|
+
import { ResvgWasmInput } from '@pptx-glimpse/renderer/png/browser';
|
|
4
|
+
export { ResvgWasmInput } from '@pptx-glimpse/renderer/png/browser';
|
|
5
|
+
|
|
6
|
+
interface PptxTextBodyProseMirrorDocJson {
|
|
7
|
+
readonly type: "doc";
|
|
8
|
+
readonly content?: readonly PptxTextBodyProseMirrorParagraphJson[];
|
|
9
|
+
}
|
|
10
|
+
interface PptxTextBodyProseMirrorParagraphJson {
|
|
11
|
+
readonly type: "paragraph";
|
|
12
|
+
/** Read-only source metadata. Formatting edits are not applied from ProseMirror JSON. */
|
|
13
|
+
readonly attrs?: {
|
|
14
|
+
readonly handle?: SourceHandle | null;
|
|
15
|
+
readonly properties?: unknown;
|
|
16
|
+
};
|
|
17
|
+
readonly content?: readonly PptxTextBodyProseMirrorTextJson[];
|
|
18
|
+
}
|
|
19
|
+
interface PptxTextBodyProseMirrorTextJson {
|
|
20
|
+
readonly type: "text";
|
|
21
|
+
readonly text: string;
|
|
22
|
+
readonly marks?: readonly PptxTextBodyProseMirrorRunMarkJson[];
|
|
23
|
+
}
|
|
24
|
+
interface PptxTextBodyProseMirrorRunMarkJson {
|
|
25
|
+
readonly type: "pptxRun";
|
|
26
|
+
/** Read-only source metadata. Formatting edits are not applied from ProseMirror JSON. */
|
|
27
|
+
readonly attrs?: {
|
|
28
|
+
readonly handle?: SourceHandle | null;
|
|
29
|
+
readonly properties?: unknown;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface ReplaceTextRunPlainTextCommand {
|
|
34
|
+
readonly kind: "replaceTextRunPlainText";
|
|
35
|
+
readonly handle: SourceHandle;
|
|
36
|
+
readonly text: string;
|
|
37
|
+
}
|
|
38
|
+
interface ReplaceParagraphPlainTextCommand {
|
|
39
|
+
readonly kind: "replaceParagraphPlainText";
|
|
40
|
+
readonly handle: SourceHandle;
|
|
41
|
+
readonly text: string;
|
|
42
|
+
}
|
|
43
|
+
interface MoveShapeCommand {
|
|
44
|
+
readonly kind: "moveShape";
|
|
45
|
+
readonly handle: SourceHandle;
|
|
46
|
+
readonly offsetX: Emu;
|
|
47
|
+
readonly offsetY: Emu;
|
|
48
|
+
}
|
|
49
|
+
interface ResizeShapeCommand {
|
|
50
|
+
readonly kind: "resizeShape";
|
|
51
|
+
readonly handle: SourceHandle;
|
|
52
|
+
readonly width: Emu;
|
|
53
|
+
readonly height: Emu;
|
|
54
|
+
}
|
|
55
|
+
interface SetShapeTransformCommand {
|
|
56
|
+
readonly kind: "setShapeTransform";
|
|
57
|
+
readonly handle: SourceHandle;
|
|
58
|
+
readonly offsetX: Emu;
|
|
59
|
+
readonly offsetY: Emu;
|
|
60
|
+
readonly width: Emu;
|
|
61
|
+
readonly height: Emu;
|
|
62
|
+
}
|
|
63
|
+
type EditorCommand = ReplaceTextRunPlainTextCommand | ReplaceParagraphPlainTextCommand | MoveShapeCommand | ResizeShapeCommand | SetShapeTransformCommand;
|
|
64
|
+
|
|
65
|
+
interface BrowserEditorHistoryState {
|
|
66
|
+
readonly canUndo: boolean;
|
|
67
|
+
readonly canRedo: boolean;
|
|
68
|
+
readonly undoDepth: number;
|
|
69
|
+
readonly redoDepth: number;
|
|
70
|
+
}
|
|
71
|
+
interface BrowserEditorSelectionInfo {
|
|
72
|
+
readonly shapeHandle: SourceHandle;
|
|
73
|
+
}
|
|
74
|
+
interface BrowserEditorTextRunInfo {
|
|
75
|
+
readonly text: string;
|
|
76
|
+
readonly handle: SourceHandle;
|
|
77
|
+
}
|
|
78
|
+
interface BrowserEditorTextBodyInfo {
|
|
79
|
+
readonly docJson: PptxTextBodyProseMirrorDocJson;
|
|
80
|
+
}
|
|
81
|
+
interface BrowserEditorShapeBoundsPx {
|
|
82
|
+
readonly x: number;
|
|
83
|
+
readonly y: number;
|
|
84
|
+
readonly width: number;
|
|
85
|
+
readonly height: number;
|
|
86
|
+
}
|
|
87
|
+
interface BrowserEditorShapeInfo {
|
|
88
|
+
readonly id: string;
|
|
89
|
+
readonly kind: SourceShapeNode["kind"];
|
|
90
|
+
readonly name?: string;
|
|
91
|
+
readonly handle?: SourceHandle;
|
|
92
|
+
readonly bounds?: BrowserEditorShapeBoundsPx;
|
|
93
|
+
readonly editableTransform?: boolean;
|
|
94
|
+
readonly textRuns?: readonly BrowserEditorTextRunInfo[];
|
|
95
|
+
readonly editableTextBody?: BrowserEditorTextBodyInfo;
|
|
96
|
+
}
|
|
97
|
+
interface BrowserEditorSlidesResponse {
|
|
98
|
+
readonly slides: readonly SlideSvg[];
|
|
99
|
+
readonly history: BrowserEditorHistoryState;
|
|
100
|
+
readonly selection?: BrowserEditorSelectionInfo;
|
|
101
|
+
}
|
|
102
|
+
interface BrowserEditorSaveResponse {
|
|
103
|
+
readonly ok: true;
|
|
104
|
+
readonly pptx: Uint8Array;
|
|
105
|
+
readonly history: BrowserEditorHistoryState;
|
|
106
|
+
}
|
|
107
|
+
type BrowserEditorRenderOptions = Omit<ConvertOptions, "slides">;
|
|
108
|
+
declare class BrowserPptxEditorSession {
|
|
109
|
+
#private;
|
|
110
|
+
private constructor();
|
|
111
|
+
static create(input: Uint8Array, renderOptions?: BrowserEditorRenderOptions): Promise<BrowserPptxEditorSession>;
|
|
112
|
+
get document(): PptxSourceModel;
|
|
113
|
+
get slides(): readonly SlideSvg[];
|
|
114
|
+
get history(): BrowserEditorHistoryState;
|
|
115
|
+
get selection(): BrowserEditorSelectionInfo | undefined;
|
|
116
|
+
response(): BrowserEditorSlidesResponse;
|
|
117
|
+
shapes(slideNumber: number): readonly BrowserEditorShapeInfo[];
|
|
118
|
+
renderCurrentSlides(): Promise<readonly SlideSvg[]>;
|
|
119
|
+
apply(command: EditorCommand): Promise<BrowserEditorSlidesResponse>;
|
|
120
|
+
applyTextBodyDocJson(handle: SourceHandle, docJson: unknown): Promise<BrowserEditorSlidesResponse>;
|
|
121
|
+
selectShape(handle: SourceHandle): BrowserEditorSlidesResponse;
|
|
122
|
+
undo(): Promise<BrowserEditorSlidesResponse>;
|
|
123
|
+
redo(): Promise<BrowserEditorSlidesResponse>;
|
|
124
|
+
save(): BrowserEditorSaveResponse;
|
|
125
|
+
}
|
|
126
|
+
declare function createBrowserPptxEditorSession(input: Uint8Array, renderOptions?: BrowserEditorRenderOptions): Promise<BrowserPptxEditorSession>;
|
|
127
|
+
|
|
128
|
+
declare function convertPptxToPng(input: Uint8Array, options?: ConvertOptions): Promise<PngConversionReport>;
|
|
129
|
+
declare function initResvgWasm(wasm: ResvgWasmInput): Promise<void>;
|
|
130
|
+
|
|
131
|
+
export { type BrowserEditorHistoryState, type BrowserEditorRenderOptions, type BrowserEditorSaveResponse, type BrowserEditorSelectionInfo, type BrowserEditorShapeBoundsPx, type BrowserEditorShapeInfo, type BrowserEditorSlidesResponse, type BrowserEditorTextBodyInfo, type BrowserEditorTextRunInfo, BrowserPptxEditorSession, ConvertOptions, type EditorCommand, PngConversionReport, SlideSvg, SourceHandle, convertPptxToPng, createBrowserPptxEditorSession, initResvgWasm };
|