@coco-vexel/coco-office-editor 1.0.0 → 1.0.2

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.
Files changed (52) hide show
  1. package/README.md +33 -1
  2. package/THIRD_PARTY_NOTICES.md +3 -3
  3. package/dist/index.cjs +352 -99
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +5 -4
  6. package/dist/index.d.ts +5 -4
  7. package/dist/index.js +353 -101
  8. package/dist/index.js.map +1 -1
  9. package/dist/{model-DB6aN6uJ.d.cts → model-DNNBhhCB.d.cts} +4 -3
  10. package/dist/{model-DB6aN6uJ.d.ts → model-DNNBhhCB.d.ts} +4 -3
  11. package/dist/{native-B6B649CC.d.ts → native-OrEUvS8p.d.ts} +5 -1
  12. package/dist/native-TMv552dv.d.cts +317 -0
  13. package/dist/native-TMv552dv.d.ts +317 -0
  14. package/dist/{native-Ct9nN06K.d.cts → native-f2y3N8N5.d.cts} +5 -1
  15. package/dist/ppt-native.cjs +129 -59
  16. package/dist/ppt-native.cjs.map +1 -1
  17. package/dist/ppt-native.d.cts +1 -1
  18. package/dist/ppt-native.d.ts +1 -1
  19. package/dist/ppt-native.js +130 -60
  20. package/dist/ppt-native.js.map +1 -1
  21. package/dist/ppt.cjs +129 -58
  22. package/dist/ppt.cjs.map +1 -1
  23. package/dist/ppt.d.cts +3 -306
  24. package/dist/ppt.d.ts +3 -306
  25. package/dist/ppt.js +130 -60
  26. package/dist/ppt.js.map +1 -1
  27. package/dist/read-only-1_LQCO1d.d.cts +7 -0
  28. package/dist/read-only-1_LQCO1d.d.ts +7 -0
  29. package/dist/spreadsheet.cjs +114 -17
  30. package/dist/spreadsheet.cjs.map +1 -1
  31. package/dist/spreadsheet.d.cts +15 -3
  32. package/dist/spreadsheet.d.ts +15 -3
  33. package/dist/spreadsheet.js +114 -18
  34. package/dist/spreadsheet.js.map +1 -1
  35. package/dist/word-editing.d.cts +1 -1
  36. package/dist/word-editing.d.ts +1 -1
  37. package/dist/word-native.cjs +132 -23
  38. package/dist/word-native.cjs.map +1 -1
  39. package/dist/word-native.d.cts +2 -2
  40. package/dist/word-native.d.ts +2 -2
  41. package/dist/word-native.js +132 -23
  42. package/dist/word-native.js.map +1 -1
  43. package/dist/word-prosemirror.d.cts +1 -1
  44. package/dist/word-prosemirror.d.ts +1 -1
  45. package/dist/word.cjs +145 -23
  46. package/dist/word.cjs.map +1 -1
  47. package/dist/word.d.cts +5 -4
  48. package/dist/word.d.ts +5 -4
  49. package/dist/word.js +145 -24
  50. package/dist/word.js.map +1 -1
  51. package/package.json +10 -10
  52. package/src/styles/editor.css +1 -0
@@ -2,6 +2,7 @@ import { StoryId, ParagraphFormat, ParagraphInfo, RevisionInfo, CommentInfo } fr
2
2
 
3
3
  type EditorSegmentKind = 'text' | 'revision' | 'field' | 'placeholder' | 'image' | 'drawing';
4
4
  type EditorSpanKind = 'comment' | 'revision';
5
+ type EditorContentRevisionKind = Extract<RevisionInfo['kind'], 'insert' | 'delete'>;
5
6
  interface EditorTextSegment {
6
7
  kind: 'text';
7
8
  from: number;
@@ -22,7 +23,7 @@ interface EditorRevisionSegment {
22
23
  text: string;
23
24
  format?: EditorRunFormat;
24
25
  revisionId: string;
25
- revisionKind: RevisionInfo['kind'];
26
+ revisionKind: EditorContentRevisionKind;
26
27
  author: string;
27
28
  date: string;
28
29
  }
@@ -104,7 +105,7 @@ interface EditorCommentSpan extends EditorTextSpan {
104
105
  interface EditorRevisionSpan extends EditorTextSpan {
105
106
  kind: 'revision';
106
107
  revisionId: string;
107
- revisionKind: RevisionInfo['kind'];
108
+ revisionKind: EditorContentRevisionKind;
108
109
  author: string;
109
110
  date: string;
110
111
  }
@@ -318,4 +319,4 @@ interface EditorDocumentView {
318
319
  detachedRevisions: RevisionInfo[];
319
320
  }
320
321
 
321
- export type { EditorTabStop as A, EditorTableBorder as B, EditorTableBorders as C, EditorTableCellView as D, EditorBlockView as E, EditorTableLayout as F, EditorTableLook as G, EditorTableRowView as H, EditorTableView as I, EditorTextSegment as J, EditorTextSpan as K, EditorBoxEdges as a, EditorCommentSpan as b, EditorContentSegment as c, EditorDocumentDefaults as d, EditorDocumentView as e, EditorDrawingSegment as f, EditorFieldSegment as g, EditorHeaderFooterRef as h, EditorHeaderFooterStoryView as i, EditorHyperlink as j, EditorImageSegment as k, EditorNumberingFormat as l, EditorPageLayout as m, EditorParagraphBorder as n, EditorParagraphBorders as o, EditorParagraphFormat as p, EditorParagraphSpan as q, EditorParagraphView as r, EditorPlaceholderSegment as s, EditorRevisionSegment as t, EditorRevisionSpan as u, EditorRunFormat as v, EditorSectionView as w, EditorSegmentKind as x, EditorShading as y, EditorSpanKind as z };
322
+ export type { EditorSpanKind as A, EditorTabStop as B, EditorTableBorder as C, EditorTableBorders as D, EditorBlockView as E, EditorTableCellView as F, EditorTableLayout as G, EditorTableLook as H, EditorTableRowView as I, EditorTableView as J, EditorTextSegment as K, EditorTextSpan as L, EditorBoxEdges as a, EditorCommentSpan as b, EditorContentRevisionKind as c, EditorContentSegment as d, EditorDocumentDefaults as e, EditorDocumentView as f, EditorDrawingSegment as g, EditorFieldSegment as h, EditorHeaderFooterRef as i, EditorHeaderFooterStoryView as j, EditorHyperlink as k, EditorImageSegment as l, EditorNumberingFormat as m, EditorPageLayout as n, EditorParagraphBorder as o, EditorParagraphBorders as p, EditorParagraphFormat as q, EditorParagraphSpan as r, EditorParagraphView as s, EditorPlaceholderSegment as t, EditorRevisionSegment as u, EditorRevisionSpan as v, EditorRunFormat as w, EditorSectionView as x, EditorSegmentKind as y, EditorShading as z };
@@ -2,6 +2,7 @@ import { StoryId, ParagraphFormat, ParagraphInfo, RevisionInfo, CommentInfo } fr
2
2
 
3
3
  type EditorSegmentKind = 'text' | 'revision' | 'field' | 'placeholder' | 'image' | 'drawing';
4
4
  type EditorSpanKind = 'comment' | 'revision';
5
+ type EditorContentRevisionKind = Extract<RevisionInfo['kind'], 'insert' | 'delete'>;
5
6
  interface EditorTextSegment {
6
7
  kind: 'text';
7
8
  from: number;
@@ -22,7 +23,7 @@ interface EditorRevisionSegment {
22
23
  text: string;
23
24
  format?: EditorRunFormat;
24
25
  revisionId: string;
25
- revisionKind: RevisionInfo['kind'];
26
+ revisionKind: EditorContentRevisionKind;
26
27
  author: string;
27
28
  date: string;
28
29
  }
@@ -104,7 +105,7 @@ interface EditorCommentSpan extends EditorTextSpan {
104
105
  interface EditorRevisionSpan extends EditorTextSpan {
105
106
  kind: 'revision';
106
107
  revisionId: string;
107
- revisionKind: RevisionInfo['kind'];
108
+ revisionKind: EditorContentRevisionKind;
108
109
  author: string;
109
110
  date: string;
110
111
  }
@@ -318,4 +319,4 @@ interface EditorDocumentView {
318
319
  detachedRevisions: RevisionInfo[];
319
320
  }
320
321
 
321
- export type { EditorTabStop as A, EditorTableBorder as B, EditorTableBorders as C, EditorTableCellView as D, EditorBlockView as E, EditorTableLayout as F, EditorTableLook as G, EditorTableRowView as H, EditorTableView as I, EditorTextSegment as J, EditorTextSpan as K, EditorBoxEdges as a, EditorCommentSpan as b, EditorContentSegment as c, EditorDocumentDefaults as d, EditorDocumentView as e, EditorDrawingSegment as f, EditorFieldSegment as g, EditorHeaderFooterRef as h, EditorHeaderFooterStoryView as i, EditorHyperlink as j, EditorImageSegment as k, EditorNumberingFormat as l, EditorPageLayout as m, EditorParagraphBorder as n, EditorParagraphBorders as o, EditorParagraphFormat as p, EditorParagraphSpan as q, EditorParagraphView as r, EditorPlaceholderSegment as s, EditorRevisionSegment as t, EditorRevisionSpan as u, EditorRunFormat as v, EditorSectionView as w, EditorSegmentKind as x, EditorShading as y, EditorSpanKind as z };
322
+ export type { EditorSpanKind as A, EditorTabStop as B, EditorTableBorder as C, EditorTableBorders as D, EditorBlockView as E, EditorTableCellView as F, EditorTableLayout as G, EditorTableLook as H, EditorTableRowView as I, EditorTableView as J, EditorTextSegment as K, EditorTextSpan as L, EditorBoxEdges as a, EditorCommentSpan as b, EditorContentRevisionKind as c, EditorContentSegment as d, EditorDocumentDefaults as e, EditorDocumentView as f, EditorDrawingSegment as g, EditorFieldSegment as h, EditorHeaderFooterRef as i, EditorHeaderFooterStoryView as j, EditorHyperlink as k, EditorImageSegment as l, EditorNumberingFormat as m, EditorPageLayout as n, EditorParagraphBorder as o, EditorParagraphBorders as p, EditorParagraphFormat as q, EditorParagraphSpan as r, EditorParagraphView as s, EditorPlaceholderSegment as t, EditorRevisionSegment as u, EditorRevisionSpan as v, EditorRunFormat as w, EditorSectionView as x, EditorSegmentKind as y, EditorShading as z };
@@ -1,4 +1,4 @@
1
- import { p as EditorParagraphFormat, v as EditorRunFormat, t as EditorRevisionSegment, j as EditorHyperlink, k as EditorImageSegment, f as EditorDrawingSegment, g as EditorFieldSegment, I as EditorTableView, C as EditorTableBorders, D as EditorTableCellView, d as EditorDocumentDefaults, m as EditorPageLayout, e as EditorDocumentView, i as EditorHeaderFooterStoryView, l as EditorNumberingFormat } from './model-DB6aN6uJ.js';
1
+ import { q as EditorParagraphFormat, w as EditorRunFormat, u as EditorRevisionSegment, k as EditorHyperlink, l as EditorImageSegment, g as EditorDrawingSegment, h as EditorFieldSegment, J as EditorTableView, D as EditorTableBorders, F as EditorTableCellView, e as EditorDocumentDefaults, n as EditorPageLayout, f as EditorDocumentView, j as EditorHeaderFooterStoryView, m as EditorNumberingFormat } from './model-DNNBhhCB.js';
2
2
  import { Package } from '@coco-vexel/coco-office/pack';
3
3
  import { PackageIndices } from '@coco-vexel/coco-office/word-view';
4
4
 
@@ -756,6 +756,8 @@ type WordEditorCommand = {
756
756
  interface WordEditorRuntime {
757
757
  readonly kind: WordEditorEngineKind;
758
758
  readonly destroyed: boolean;
759
+ isReadOnly(): boolean;
760
+ setReadOnly(readOnly: boolean): void;
759
761
  destroy(): void;
760
762
  loadDocument(view: EditorDocumentView): void;
761
763
  getSourceView(): EditorDocumentView;
@@ -781,6 +783,8 @@ interface WordEditorRuntime {
781
783
  subscribe<Event extends WordEditorRuntimeEvent>(event: Event, listener: (payload: WordEditorRuntimeEventMap[Event]) => void): () => void;
782
784
  }
783
785
  interface WordEditorRuntimeOptions {
786
+ /** Allows navigation, selection and copy while blocking every document mutation. */
787
+ readOnly?: boolean;
784
788
  onChange?: (event: WordEditorChangeEvent) => void;
785
789
  onSelectionChange?: (event: WordEditorSelectionChangeEvent) => void;
786
790
  contextMenu?: boolean;
@@ -0,0 +1,317 @@
1
+ import { PptSlideSize, PptSlideBackgroundModel, PptShapeKind, PptTextStyle, PptTextParagraph, PptTextBodyProperties, PptImageCropModel, PptChartModel, PptTableModel, PptGradientFillModel, PptShapeStyle, PptCustomGeometryModel, PptShapeModel, PptSlideModel, PptPresentationModel, PptShapeGeometry, Presentation } from '@coco-vexel/coco-office/ppt';
2
+
3
+ type PptSceneNodeKind = PptShapeKind;
4
+ interface PptSceneRect {
5
+ left: number;
6
+ top: number;
7
+ width: number;
8
+ height: number;
9
+ rotation?: number;
10
+ flipHorizontal?: boolean;
11
+ flipVertical?: boolean;
12
+ }
13
+ interface PptSceneNode {
14
+ id: string;
15
+ name?: string;
16
+ kind: PptSceneNodeKind;
17
+ bounds: PptSceneRect;
18
+ text?: string;
19
+ textStyle?: PptTextStyle;
20
+ textParagraphs?: PptTextParagraph[];
21
+ textBody?: PptTextBodyProperties;
22
+ imagePath?: string;
23
+ imageCrop?: PptImageCropModel;
24
+ imageFillRect?: PptImageCropModel;
25
+ imageOpacity?: number;
26
+ chart?: PptChartModel;
27
+ table?: PptTableModel;
28
+ fillColor?: string;
29
+ fillGradient?: PptGradientFillModel;
30
+ opacity?: number;
31
+ lineColor?: string;
32
+ lineGradient?: PptGradientFillModel;
33
+ lineOpacity?: number;
34
+ lineWidth?: number;
35
+ lineCap?: string;
36
+ lineDash?: string;
37
+ lineHeadEnd?: string;
38
+ lineTailEnd?: string;
39
+ shadow?: PptShapeStyle['shadow'];
40
+ presetGeometry?: string;
41
+ presetAdjustments?: Record<string, number>;
42
+ customGeometry?: PptCustomGeometryModel;
43
+ threeD?: NonNullable<PptShapeModel['raw']>['threeD'];
44
+ usesBackgroundFill?: boolean;
45
+ backgroundFill?: PptSlideBackgroundModel;
46
+ locked: boolean;
47
+ editable: boolean;
48
+ capabilities: PptSceneNodeCapabilities;
49
+ groupContext?: PptSceneGroupContext;
50
+ source: PptShapeModel;
51
+ children: PptSceneNode[];
52
+ }
53
+ interface PptSceneGroupContext {
54
+ parentId: string;
55
+ parentName?: string;
56
+ parentBounds: PptSceneRect;
57
+ parentTransform: {
58
+ childLeft: number;
59
+ childTop: number;
60
+ childWidth: number;
61
+ childHeight: number;
62
+ };
63
+ }
64
+ interface PptSceneNodeCapabilities {
65
+ readonly select: boolean;
66
+ readonly editText: boolean;
67
+ readonly editTextStyle: boolean;
68
+ readonly editTableCells: boolean;
69
+ readonly editGeometry: boolean;
70
+ readonly editShapeStyle: boolean;
71
+ readonly reason?: string;
72
+ readonly reasons?: Partial<Record<PptSceneNodeCapability, string>>;
73
+ }
74
+ interface PptSlideScene {
75
+ id: string;
76
+ index: number;
77
+ name?: string;
78
+ title?: string;
79
+ size: PptSlideSize;
80
+ background?: PptSlideBackgroundModel;
81
+ nodes: PptSceneNode[];
82
+ groups: PptSceneNode[];
83
+ source: PptSlideModel;
84
+ }
85
+ interface PptPresentationScene {
86
+ size: PptSlideSize;
87
+ slides: PptSlideScene[];
88
+ }
89
+ type PptSceneNodeCapability = 'editText' | 'editTextStyle' | 'editTableCells' | 'editGeometry' | 'editShapeStyle';
90
+ declare const DEFAULT_PPT_SLIDE_SIZE: PptSlideSize;
91
+ declare function buildPptPresentationScene(model: PptPresentationModel): PptPresentationScene;
92
+ declare function buildPptSlideScene(slide: PptSlideModel, fallbackSize: PptSlideSize): PptSlideScene;
93
+ declare function buildPptSceneNode(shape: PptShapeModel, options?: {
94
+ slideSize?: PptSlideSize;
95
+ index?: number;
96
+ background?: PptSlideBackgroundModel;
97
+ backgroundFill?: PptSlideBackgroundModel;
98
+ }): PptSceneNode;
99
+ declare function isPptShapeEditable(shape: PptShapeModel): boolean;
100
+ declare function pptSceneNodeCapabilities(shape: PptShapeModel): PptSceneNodeCapabilities;
101
+ declare function pptSceneGeometryToSourceGeometry(node: PptSceneNode, geometry: Partial<PptShapeGeometry>): Partial<PptShapeGeometry>;
102
+ declare function normalizePptGeometry(geometry?: PptShapeGeometry): PptSceneRect;
103
+ declare function findPptSceneSlide(scene: PptPresentationScene, slideIdOrIndex: string | number): PptSlideScene | null;
104
+ declare function findPptSceneNode(slide: PptSlideScene, shapeIdOrName: string): PptSceneNode | null;
105
+
106
+ interface PptEditorImageResource {
107
+ url: string;
108
+ contentType: string;
109
+ }
110
+ interface PptEditorImagePreviewRequest {
111
+ path: string;
112
+ contentType: string;
113
+ bytes: Uint8Array;
114
+ }
115
+ interface PptEditorFontResource {
116
+ url: string;
117
+ contentType: string;
118
+ family: string;
119
+ weight?: number;
120
+ style?: 'normal' | 'italic';
121
+ }
122
+ interface PptEditorView {
123
+ presentation: Presentation;
124
+ model: PptPresentationModel;
125
+ scene: PptPresentationScene;
126
+ images: Record<string, PptEditorImageResource>;
127
+ fonts: PptEditorFontResource[];
128
+ }
129
+ interface PptEditorViewOptions {
130
+ presentationId?: string;
131
+ resolveImagePreview?: (image: PptEditorImagePreviewRequest) => Promise<PptEditorImageResource | undefined> | PptEditorImageResource | undefined;
132
+ }
133
+ declare function buildPptEditorViewFromPptx(bytes: Uint8Array | ArrayBuffer, options?: PptEditorViewOptions): Promise<PptEditorView>;
134
+ declare function buildPptEditorViewFromModel(model: PptPresentationModel, options?: PptEditorViewOptions): Promise<PptEditorView>;
135
+ declare function buildPptEditorViewFromPresentation(presentation: Presentation, options?: PptEditorViewOptions): Promise<PptEditorView>;
136
+
137
+ type PptEditorSelection = {
138
+ kind: 'slide';
139
+ slideId: string;
140
+ } | {
141
+ kind: 'shape';
142
+ slideId: string;
143
+ shapeId: string;
144
+ } | null;
145
+ type PptEditorCommand = {
146
+ kind: 'select-slide';
147
+ slideIdOrIndex: string | number;
148
+ } | {
149
+ kind: 'select-shape';
150
+ slideIdOrIndex: string | number;
151
+ shapeIdOrName: string;
152
+ } | {
153
+ kind: 'set-shape-text';
154
+ slideIdOrIndex: string | number;
155
+ shapeIdOrName: string;
156
+ text: string;
157
+ } | {
158
+ kind: 'set-shape-text-style';
159
+ slideIdOrIndex: string | number;
160
+ shapeIdOrName: string;
161
+ style: Partial<PptTextStyle>;
162
+ } | {
163
+ kind: 'set-table-cell-text';
164
+ slideIdOrIndex: string | number;
165
+ shapeIdOrName: string;
166
+ row: number;
167
+ column: number;
168
+ text: string;
169
+ } | {
170
+ kind: 'set-shape-geometry';
171
+ slideIdOrIndex: string | number;
172
+ shapeIdOrName: string;
173
+ geometry: Partial<PptShapeGeometry>;
174
+ preserveTextSizeOnResize?: boolean;
175
+ } | {
176
+ kind: 'set-shape-style';
177
+ slideIdOrIndex: string | number;
178
+ shapeIdOrName: string;
179
+ style: Partial<PptShapeStyle>;
180
+ } | {
181
+ kind: 'delete-shape';
182
+ slideIdOrIndex: string | number;
183
+ shapeIdOrName: string;
184
+ } | {
185
+ kind: 'duplicate-shape';
186
+ slideIdOrIndex: string | number;
187
+ shapeIdOrName: string;
188
+ offset?: Partial<PptShapeGeometry>;
189
+ } | {
190
+ kind: 'paste-shape';
191
+ slideIdOrIndex: string | number;
192
+ shapeIdOrName: string;
193
+ offset?: Partial<PptShapeGeometry>;
194
+ } | {
195
+ kind: 'bring-shape-to-front';
196
+ slideIdOrIndex: string | number;
197
+ shapeIdOrName: string;
198
+ } | {
199
+ kind: 'send-shape-to-back';
200
+ slideIdOrIndex: string | number;
201
+ shapeIdOrName: string;
202
+ };
203
+ type PptEditorRuntimeEvent = 'change' | 'selectionChange';
204
+ interface PptEditorChangeEvent {
205
+ readonly revision: number;
206
+ readonly command: PptEditorCommand;
207
+ readonly model: PptPresentationModel;
208
+ readonly scene: PptPresentationScene;
209
+ }
210
+ interface PptEditorSelectionChangeEvent {
211
+ readonly selection: PptEditorSelection;
212
+ }
213
+ interface PptEditorRuntimeEventMap {
214
+ change: PptEditorChangeEvent;
215
+ selectionChange: PptEditorSelectionChangeEvent;
216
+ }
217
+ interface PptEditorSessionOptions {
218
+ maxHistory?: number;
219
+ readOnly?: boolean;
220
+ }
221
+ type Listener<T> = (event: T) => void;
222
+ declare class PptEditorSession {
223
+ private presentationValue;
224
+ private modelValue;
225
+ private sceneValue;
226
+ private selectionValue;
227
+ private revisionValue;
228
+ private readonly undoStack;
229
+ private readonly redoStack;
230
+ private readonly textBodyOverrides;
231
+ private readonly maxHistory;
232
+ private readOnlyValue;
233
+ private readonly changeListeners;
234
+ private readonly selectionListeners;
235
+ constructor(view: PptEditorView, options?: PptEditorSessionOptions);
236
+ presentation(): Presentation;
237
+ model(): PptPresentationModel;
238
+ scene(): PptPresentationScene;
239
+ selection(): PptEditorSelection;
240
+ revision(): number;
241
+ isReadOnly(): boolean;
242
+ setReadOnly(readOnly: boolean): void;
243
+ canUndo(): boolean;
244
+ canRedo(): boolean;
245
+ subscribe<K extends PptEditorRuntimeEvent>(event: K, listener: Listener<PptEditorRuntimeEventMap[K]>): () => void;
246
+ dispatch(command: PptEditorCommand): Promise<void>;
247
+ undo(): Promise<void>;
248
+ redo(): Promise<void>;
249
+ loadPresentation(bytes: Uint8Array | ArrayBuffer): Promise<void>;
250
+ toPptx(): Promise<Uint8Array>;
251
+ verifyExport(): Promise<PptPresentationModel>;
252
+ destroy(): Promise<void>;
253
+ private assertWritable;
254
+ private applySelectionCommand;
255
+ private applyEditCommand;
256
+ private assertEditableSceneNodeForCommand;
257
+ private applyShapeCollectionCommand;
258
+ private refreshAfterChange;
259
+ private replacePresentation;
260
+ private setSelection;
261
+ private pushUndo;
262
+ private historyEntry;
263
+ private restoreTextBodyOverrides;
264
+ private applyTextBodyOverrides;
265
+ }
266
+
267
+ interface NativePptEditorOptions {
268
+ styleIsolation?: 'shadow' | 'none';
269
+ /** Allows navigation, selection and copy while blocking every presentation mutation. */
270
+ readOnly?: boolean;
271
+ /** Controls the built-in thumbnail rail for hosts that provide their own slide navigation. */
272
+ showSlideList?: boolean;
273
+ onChange?: (event: {
274
+ revision: number;
275
+ bytes: Uint8Array;
276
+ }) => void | Promise<void>;
277
+ onObjectAction?: (event: {
278
+ action: 'blocked-text-edit' | 'cycle-selection' | 'nudge-geometry' | 'snap-geometry' | 'copy-shape' | 'paste-shape' | 'delete-shape' | 'duplicate-shape' | 'bring-shape-to-front' | 'send-shape-to-back';
279
+ slideId: string;
280
+ shapeId: string;
281
+ kind: PptSceneNode['kind'];
282
+ name?: string;
283
+ reason: string;
284
+ candidateIndex?: number;
285
+ candidateCount?: number;
286
+ }) => void;
287
+ onTextEditStateChange?: (event: {
288
+ state: 'start' | 'commit' | 'cancel';
289
+ slideId: string;
290
+ shapeId: string;
291
+ text: string;
292
+ }) => void;
293
+ onTableCellSelectionChange?: (event: {
294
+ slideId: string;
295
+ shapeId: string;
296
+ row: number;
297
+ column: number;
298
+ text: string;
299
+ }) => void;
300
+ }
301
+ interface NativePptEditor {
302
+ session(): PptEditorSession;
303
+ selection(): PptEditorSelection;
304
+ isReadOnly(): boolean;
305
+ setReadOnly(readOnly: boolean): void;
306
+ dispatch(command: PptEditorCommand): Promise<void>;
307
+ loadPresentation(bytes: Uint8Array | ArrayBuffer): Promise<void>;
308
+ toPptx(): Promise<Uint8Array>;
309
+ canUndo(): boolean;
310
+ canRedo(): boolean;
311
+ undo(): Promise<void>;
312
+ redo(): Promise<void>;
313
+ destroy(): Promise<void>;
314
+ }
315
+ declare function renderNativePptEditor(host: HTMLElement, view: PptEditorView, options?: NativePptEditorOptions): NativePptEditor;
316
+
317
+ export { buildPptSlideScene as A, findPptSceneNode as B, findPptSceneSlide as C, DEFAULT_PPT_SLIDE_SIZE as D, isPptShapeEditable as E, normalizePptGeometry as F, pptSceneGeometryToSourceGeometry as G, pptSceneNodeCapabilities as H, renderNativePptEditor as I, type NativePptEditor as N, type PptEditorChangeEvent as P, type NativePptEditorOptions as a, type PptEditorCommand as b, type PptEditorFontResource as c, type PptEditorImagePreviewRequest as d, type PptEditorImageResource as e, type PptEditorRuntimeEvent as f, type PptEditorRuntimeEventMap as g, type PptEditorSelection as h, type PptEditorSelectionChangeEvent as i, PptEditorSession as j, type PptEditorSessionOptions as k, type PptEditorView as l, type PptEditorViewOptions as m, type PptPresentationScene as n, type PptSceneGroupContext as o, type PptSceneNode as p, type PptSceneNodeCapabilities as q, type PptSceneNodeCapability as r, type PptSceneNodeKind as s, type PptSceneRect as t, type PptSlideScene as u, buildPptEditorViewFromModel as v, buildPptEditorViewFromPptx as w, buildPptEditorViewFromPresentation as x, buildPptPresentationScene as y, buildPptSceneNode as z };