efficient-office 0.6.0 → 0.8.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/Documents-ISV66NLW.js +1 -0
- package/dist/Slides-JI73C3NW.js +1 -0
- package/dist/SlidesEditor-5WCXE27J.js +1 -0
- package/dist/Spreadsheet-I3RO4HSS.js +1 -0
- package/dist/chunk-3RFDQOTI.js +1 -0
- package/dist/chunk-4NKXNXKY.js +1 -0
- package/dist/chunk-6ZFEBY6H.js +1 -0
- package/dist/chunk-7K7AY3V3.js +1 -0
- package/dist/chunk-B2X3NIQR.js +1 -0
- package/dist/chunk-B32ASXHM.js +1 -0
- package/dist/chunk-B6JN7D6G.js +1 -0
- package/dist/{chunk-QSM7NWZ2.js → chunk-BGAR3P46.js} +1 -1
- package/dist/chunk-COXKOQPZ.js +1 -0
- package/dist/chunk-GLT7O6TV.js +1 -0
- package/dist/{chunk-E4N3DBYM.js → chunk-HU4RI2OM.js} +1 -1
- package/dist/chunk-I3AC6PYR.js +1 -0
- package/dist/chunk-JCSB2PHB.js +1 -0
- package/dist/{chunk-USKJW3BA.js → chunk-MDG2ADZ7.js} +1 -1
- package/dist/chunk-PMGQ5GUH.js +1 -0
- package/dist/chunk-PXOQN7D6.js +1 -0
- package/dist/chunk-Q7NVDOCX.js +1 -0
- package/dist/chunk-XYVQTQ6N.js +1 -0
- package/dist/{deckPdf-Q4OXQ7HV.js → deckPdf-4RC7QJ45.js} +1 -1
- package/dist/documents/documents.css +4 -0
- package/dist/documents/index.d.ts +22 -7
- package/dist/documents/index.js +1 -1
- package/dist/docxPdf-EW5I5JR3.js +1 -0
- package/dist/importDocument-274VK7OM.js +1 -0
- package/dist/importSpreadsheet-4U3KEJ76.js +1 -0
- package/dist/pptxImport-Y7TB6PYP.js +1 -0
- package/dist/slides/index.d.ts +534 -7
- package/dist/slides/index.js +1 -1
- package/dist/slides/slides.css +102 -0
- package/dist/spreadsheet/index.d.ts +62 -44
- package/dist/spreadsheet/index.js +1 -1
- package/dist/spreadsheet/spreadsheet.css +4 -0
- package/dist/words-DK_ajpEa.d.ts +67 -0
- package/dist/workbookPdf-C5SSN226.js +1 -0
- package/package.json +2 -2
- package/dist/Documents-HT324TAY.js +0 -1
- package/dist/Slides-EUDBOA5K.js +0 -1
- package/dist/SlidesEditor-6KDRHX4H.js +0 -1
- package/dist/Spreadsheet-SOF7NDLP.js +0 -1
- package/dist/chunk-2AKHYM66.js +0 -1
- package/dist/chunk-2PIEDEY5.js +0 -1
- package/dist/chunk-2TZUCKZ7.js +0 -1
- package/dist/chunk-3SRMKGQW.js +0 -1
- package/dist/chunk-AVUZSUQD.js +0 -1
- package/dist/chunk-SB3YS3LH.js +0 -1
- package/dist/chunk-XKOHIZO5.js +0 -1
- package/dist/chunk-YYHJJIA4.js +0 -1
- package/dist/docxPdf-NCSEKI4J.js +0 -1
- package/dist/options-Djr917yc.d.ts +0 -10
- package/dist/pptxImport-QEKBZWT2.js +0 -1
- package/dist/workbookPdf-OJDSHKRR.js +0 -1
package/dist/slides/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { P as PdfOptions } from '../
|
|
3
|
+
import { F as FileWords, C as ChooseOfficeFile, P as PdfOptions } from '../words-DK_ajpEa.js';
|
|
4
|
+
export { E as ENGLISH_FILE_WORDS, O as OfficeFileChoice, a as OfficeFileRequest, Z as ZH_HANS_FILE_WORDS, h as hasExtension } from '../words-DK_ajpEa.js';
|
|
4
5
|
|
|
5
6
|
interface Box {
|
|
6
7
|
x: number;
|
|
@@ -11,16 +12,58 @@ interface Box {
|
|
|
11
12
|
interface ElementBase extends Box {
|
|
12
13
|
id: string;
|
|
13
14
|
rotation: number;
|
|
15
|
+
/** Elements sharing one are selected, moved and copied together. */
|
|
16
|
+
groupId?: string;
|
|
17
|
+
/** Not selected by a click or a marquee, so it can't be moved by accident. */
|
|
18
|
+
locked?: boolean;
|
|
14
19
|
}
|
|
20
|
+
type TextAlign = 'left' | 'center' | 'right';
|
|
21
|
+
type ParagraphAlign = TextAlign | 'justify';
|
|
22
|
+
/** A stretch of a paragraph in one style. Absent fields take the box's own. */
|
|
23
|
+
interface TextRun {
|
|
24
|
+
text: string;
|
|
25
|
+
bold?: boolean;
|
|
26
|
+
italic?: boolean;
|
|
27
|
+
underline?: boolean;
|
|
28
|
+
strike?: boolean;
|
|
29
|
+
color?: string;
|
|
30
|
+
highlight?: string;
|
|
31
|
+
size?: number;
|
|
32
|
+
font?: string;
|
|
33
|
+
/** `https://`, `http://`, `mailto:`, or `#slide=<id>` for another slide. */
|
|
34
|
+
link?: string;
|
|
35
|
+
}
|
|
36
|
+
interface Paragraph {
|
|
37
|
+
runs: TextRun[];
|
|
38
|
+
align?: ParagraphAlign;
|
|
39
|
+
list?: 'bullet' | 'number';
|
|
40
|
+
/** Indent steps, 0 to 4. */
|
|
41
|
+
level?: number;
|
|
42
|
+
/** A multiple of the font size. */
|
|
43
|
+
lineHeight?: number;
|
|
44
|
+
}
|
|
45
|
+
/** What a layout's text box is for, so a theme can restyle it. */
|
|
46
|
+
type PlaceholderRole = 'title' | 'subtitle' | 'body';
|
|
15
47
|
interface TextElement extends ElementBase {
|
|
16
48
|
type: 'text';
|
|
49
|
+
/** The words with no styling: what old readers draw, and what search and
|
|
50
|
+
* thumbnails read. Kept in step with `paragraphs` (./richText `withParagraphs`). */
|
|
17
51
|
text: string;
|
|
52
|
+
/** The box's own style: every run's default. */
|
|
18
53
|
fontSize: number;
|
|
19
54
|
bold: boolean;
|
|
20
55
|
color: string;
|
|
21
|
-
align:
|
|
56
|
+
align: TextAlign;
|
|
57
|
+
font?: string;
|
|
58
|
+
/** The words with their styles. Absent: `text` in the box's style. */
|
|
59
|
+
paragraphs?: Paragraph[];
|
|
60
|
+
anchor?: 'top' | 'middle' | 'bottom';
|
|
61
|
+
/** Shrink the type until the words fit the box. */
|
|
62
|
+
autofit?: boolean;
|
|
63
|
+
placeholder?: PlaceholderRole;
|
|
22
64
|
}
|
|
23
|
-
|
|
65
|
+
declare const SHAPE_KINDS: readonly ["rect", "roundRect", "ellipse", "triangle", "rightTriangle", "diamond", "pentagon", "hexagon", "octagon", "star", "heart", "cloud", "bolt", "parallelogram", "trapezoid", "cylinder", "plus", "arrowRight", "arrowLeft", "arrowUp", "arrowDown", "arrowLeftRight", "chevron", "callout", "calloutRound", "line"];
|
|
66
|
+
type ShapeKind = (typeof SHAPE_KINDS)[number];
|
|
24
67
|
interface ShapeElement extends ElementBase {
|
|
25
68
|
type: 'shape';
|
|
26
69
|
/** A `line` runs left to right through the middle of its box; `rotation` turns it. */
|
|
@@ -33,20 +76,75 @@ interface ShapeElement extends ElementBase {
|
|
|
33
76
|
arrowEnd?: boolean;
|
|
34
77
|
arrowStart?: boolean;
|
|
35
78
|
}
|
|
79
|
+
/** A share of each side cut away, each 0 to below 1. */
|
|
80
|
+
interface Crop {
|
|
81
|
+
left: number;
|
|
82
|
+
top: number;
|
|
83
|
+
right: number;
|
|
84
|
+
bottom: number;
|
|
85
|
+
}
|
|
36
86
|
interface ImageElement extends ElementBase {
|
|
37
87
|
type: 'image';
|
|
38
88
|
src: string;
|
|
39
89
|
alt: string;
|
|
90
|
+
crop?: Crop;
|
|
91
|
+
/** 0 to 1; absent is 1. */
|
|
92
|
+
opacity?: number;
|
|
93
|
+
}
|
|
94
|
+
interface VideoElement extends ElementBase {
|
|
95
|
+
type: 'video';
|
|
96
|
+
/** A YouTube or Vimeo page, or a video file's address. */
|
|
97
|
+
src: string;
|
|
98
|
+
alt: string;
|
|
99
|
+
}
|
|
100
|
+
type ConnectorSide = 'n' | 'e' | 's' | 'w';
|
|
101
|
+
interface ConnectorEnd {
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
/** The element and side it is held to; its `x` and `y` follow that element. */
|
|
105
|
+
attach?: {
|
|
106
|
+
id: string;
|
|
107
|
+
side: ConnectorSide;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
interface ConnectorElement extends ElementBase {
|
|
111
|
+
type: 'connector';
|
|
112
|
+
/** The box is the ends' bounds, worked out from them (./connectors). */
|
|
113
|
+
start: ConnectorEnd;
|
|
114
|
+
end: ConnectorEnd;
|
|
115
|
+
route: 'straight' | 'elbow' | 'curved';
|
|
116
|
+
stroke: string;
|
|
117
|
+
strokeWidth: number;
|
|
118
|
+
arrowStart?: boolean;
|
|
119
|
+
arrowEnd?: boolean;
|
|
40
120
|
}
|
|
41
121
|
interface ChartPoint {
|
|
42
122
|
label: string;
|
|
43
123
|
value: number;
|
|
44
124
|
}
|
|
125
|
+
interface ChartSeries {
|
|
126
|
+
name: string;
|
|
127
|
+
color: string;
|
|
128
|
+
values: number[];
|
|
129
|
+
}
|
|
130
|
+
type ChartKind = 'bar' | 'hbar' | 'line' | 'area' | 'pie' | 'donut';
|
|
45
131
|
interface ChartElement extends ElementBase {
|
|
46
132
|
type: 'chart';
|
|
47
|
-
|
|
133
|
+
/** `bar` is upright columns, `hbar` lies down. */
|
|
134
|
+
kind: ChartKind;
|
|
135
|
+
/** The first series, as a deck before several series held it; kept in step
|
|
136
|
+
* (./chart `withSeries`) so an older reader still draws something. */
|
|
48
137
|
points: ChartPoint[];
|
|
49
138
|
color: string;
|
|
139
|
+
categories?: string[];
|
|
140
|
+
series?: ChartSeries[];
|
|
141
|
+
legend?: 'bottom' | 'right' | 'none';
|
|
142
|
+
}
|
|
143
|
+
interface CellMerge {
|
|
144
|
+
row: number;
|
|
145
|
+
col: number;
|
|
146
|
+
rows: number;
|
|
147
|
+
cols: number;
|
|
50
148
|
}
|
|
51
149
|
interface TableElement extends ElementBase {
|
|
52
150
|
type: 'table';
|
|
@@ -62,16 +160,60 @@ interface TableElement extends ElementBase {
|
|
|
62
160
|
/** By row and column; null takes the table's own look. */
|
|
63
161
|
cellFills?: (string | null)[][];
|
|
64
162
|
cellColors?: (string | null)[][];
|
|
163
|
+
/** Cells drawn as one, each named by its top-left cell. */
|
|
164
|
+
merges?: CellMerge[];
|
|
165
|
+
borderColor?: string;
|
|
166
|
+
/** In slide pixels; 0 draws none. */
|
|
167
|
+
borderWidth?: number;
|
|
168
|
+
}
|
|
169
|
+
type SlideElement = TextElement | ShapeElement | ImageElement | VideoElement | ConnectorElement | ChartElement | TableElement;
|
|
170
|
+
type TransitionKind = 'fade' | 'slide' | 'push' | 'zoom' | 'flip';
|
|
171
|
+
interface Transition {
|
|
172
|
+
kind: TransitionKind;
|
|
173
|
+
/** Seconds. */
|
|
174
|
+
duration: number;
|
|
175
|
+
}
|
|
176
|
+
type AnimationEffect = 'appear' | 'fadeIn' | 'flyIn' | 'zoomIn' | 'fadeOut';
|
|
177
|
+
interface Animation {
|
|
178
|
+
id: string;
|
|
179
|
+
elementId: string;
|
|
180
|
+
effect: AnimationEffect;
|
|
181
|
+
/** Where a fly-in comes from. */
|
|
182
|
+
from?: 'left' | 'right' | 'top' | 'bottom';
|
|
183
|
+
start: 'click' | 'withPrevious' | 'afterPrevious';
|
|
184
|
+
/** Seconds. */
|
|
185
|
+
duration: number;
|
|
186
|
+
/** A text box's paragraphs one after another. */
|
|
187
|
+
byParagraph?: boolean;
|
|
65
188
|
}
|
|
66
|
-
type
|
|
189
|
+
type LayoutId = 'title' | 'titleBody' | 'section' | 'twoColumns' | 'titleOnly' | 'blank';
|
|
67
190
|
interface Slide {
|
|
68
191
|
id: string;
|
|
69
192
|
background: string;
|
|
70
193
|
notes: string;
|
|
71
194
|
elements: SlideElement[];
|
|
195
|
+
layout?: LayoutId;
|
|
196
|
+
/** Left out of the show, kept in the deck. */
|
|
197
|
+
skip?: boolean;
|
|
198
|
+
transition?: Transition;
|
|
199
|
+
/** In the order they play. */
|
|
200
|
+
animations?: Animation[];
|
|
201
|
+
}
|
|
202
|
+
interface DeckTheme {
|
|
203
|
+
id: string;
|
|
204
|
+
name: string;
|
|
205
|
+
background: string;
|
|
206
|
+
text: string;
|
|
207
|
+
heading: string;
|
|
208
|
+
/** Six, for charts, shapes and the colour pickers. */
|
|
209
|
+
accents: string[];
|
|
210
|
+
headingFont: string;
|
|
211
|
+
bodyFont: string;
|
|
72
212
|
}
|
|
73
213
|
interface DeckDocument {
|
|
74
214
|
slides: Slide[];
|
|
215
|
+
theme?: DeckTheme;
|
|
216
|
+
slideNumbers?: boolean;
|
|
75
217
|
}
|
|
76
218
|
/** A document that came back from the server with nothing in it yet. */
|
|
77
219
|
declare function asDocument(stored: unknown): DeckDocument;
|
|
@@ -107,10 +249,24 @@ declare class PptxUnreadableError extends Error {
|
|
|
107
249
|
constructor(message?: string);
|
|
108
250
|
}
|
|
109
251
|
|
|
252
|
+
/**
|
|
253
|
+
* A deck's look: its theme (colours and two fonts), the layouts a new slide can
|
|
254
|
+
* start from, and the starter decks a new deck can be. Pure apart from
|
|
255
|
+
* `ensureFonts`, and tested in slidesTheme.test.ts.
|
|
256
|
+
*
|
|
257
|
+
* A theme is applied, not referenced: choosing one rewrites the slide backgrounds
|
|
258
|
+
* that were the old theme's and restyles the layouts' text boxes (`placeholder`).
|
|
259
|
+
* Anything somebody coloured by hand keeps its colour, and a deck reads the same
|
|
260
|
+
* in a reader that knows nothing of themes.
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
type StarterId = 'blank' | 'simple' | 'midnight' | 'editorial' | 'dealerPitch' | 'monthlyReport';
|
|
264
|
+
|
|
110
265
|
/**
|
|
111
266
|
* The Slides app's words: its English, and each language this package carries. A
|
|
112
267
|
* host hands a language in through `SlidesProvider`'s `words`.
|
|
113
268
|
*/
|
|
269
|
+
|
|
114
270
|
interface SlidesWords {
|
|
115
271
|
decks: string;
|
|
116
272
|
newDeck: string;
|
|
@@ -205,6 +361,209 @@ interface SlidesWords {
|
|
|
205
361
|
pptxTooManySlides: (count: number, limit: number) => string;
|
|
206
362
|
pptxTooLarge: (size: string, limit: number) => string;
|
|
207
363
|
pdfSlideFailed: (slide: number) => string;
|
|
364
|
+
/** The file list's shared words: Open, Rename and the rest. */
|
|
365
|
+
files: FileWords;
|
|
366
|
+
/** The kind of file Open takes, as the drive names it. */
|
|
367
|
+
fileKind: string;
|
|
368
|
+
/** What a PowerPoint file had that its deck doesn't, or `null` when nothing is missing. */
|
|
369
|
+
importNotes: (left: {
|
|
370
|
+
skipped: number;
|
|
371
|
+
animations: number;
|
|
372
|
+
fonts: string[];
|
|
373
|
+
}) => string | null;
|
|
374
|
+
dismiss: string;
|
|
375
|
+
newSlide: string;
|
|
376
|
+
layouts: string;
|
|
377
|
+
layoutTitle: string;
|
|
378
|
+
layoutTitleBody: string;
|
|
379
|
+
layoutSection: string;
|
|
380
|
+
layoutTwoColumns: string;
|
|
381
|
+
layoutTitleOnly: string;
|
|
382
|
+
layoutBlank: string;
|
|
383
|
+
placeholderTitle: string;
|
|
384
|
+
placeholderSubtitle: string;
|
|
385
|
+
placeholderBody: string;
|
|
386
|
+
addVideo: string;
|
|
387
|
+
addLine: string;
|
|
388
|
+
elementVideo: string;
|
|
389
|
+
elementConnector: string;
|
|
390
|
+
lineStraight: string;
|
|
391
|
+
lineArrow: string;
|
|
392
|
+
lineDoubleArrow: string;
|
|
393
|
+
connectorElbow: string;
|
|
394
|
+
connectorCurved: string;
|
|
395
|
+
arrange: string;
|
|
396
|
+
theme: string;
|
|
397
|
+
motion: string;
|
|
398
|
+
comments: string;
|
|
399
|
+
versionHistory: string;
|
|
400
|
+
font: string;
|
|
401
|
+
fontSize: string;
|
|
402
|
+
smaller: string;
|
|
403
|
+
larger: string;
|
|
404
|
+
italic: string;
|
|
405
|
+
underline: string;
|
|
406
|
+
strikethrough: string;
|
|
407
|
+
textColour: string;
|
|
408
|
+
highlight: string;
|
|
409
|
+
link: string;
|
|
410
|
+
linkPrompt: string;
|
|
411
|
+
removeLink: string;
|
|
412
|
+
badLink: string;
|
|
413
|
+
alignJustify: string;
|
|
414
|
+
bulletList: string;
|
|
415
|
+
numberedList: string;
|
|
416
|
+
indentLess: string;
|
|
417
|
+
indentMore: string;
|
|
418
|
+
lineSpacing: string;
|
|
419
|
+
verticalAlign: string;
|
|
420
|
+
top: string;
|
|
421
|
+
middle: string;
|
|
422
|
+
bottom: string;
|
|
423
|
+
shrinkToFit: string;
|
|
424
|
+
cut: string;
|
|
425
|
+
copy: string;
|
|
426
|
+
paste: string;
|
|
427
|
+
duplicate: string;
|
|
428
|
+
copyStyle: string;
|
|
429
|
+
pasteStyle: string;
|
|
430
|
+
order: string;
|
|
431
|
+
bringToFront: string;
|
|
432
|
+
sendBackward: string;
|
|
433
|
+
sendToBack: string;
|
|
434
|
+
alignTop: string;
|
|
435
|
+
alignMiddle: string;
|
|
436
|
+
alignBottom: string;
|
|
437
|
+
distributeAcross: string;
|
|
438
|
+
distributeDown: string;
|
|
439
|
+
distribute: string;
|
|
440
|
+
group: string;
|
|
441
|
+
ungroup: string;
|
|
442
|
+
lock: string;
|
|
443
|
+
unlock: string;
|
|
444
|
+
locked: string;
|
|
445
|
+
comment: string;
|
|
446
|
+
grid: string;
|
|
447
|
+
crop: string;
|
|
448
|
+
cropLeft: string;
|
|
449
|
+
cropTop: string;
|
|
450
|
+
cropRight: string;
|
|
451
|
+
cropBottom: string;
|
|
452
|
+
opacity: string;
|
|
453
|
+
replaceImage: string;
|
|
454
|
+
videoAddress: string;
|
|
455
|
+
videoHint: string;
|
|
456
|
+
chooseVideo: string;
|
|
457
|
+
videoUnsupported: string;
|
|
458
|
+
route: string;
|
|
459
|
+
routeStraight: string;
|
|
460
|
+
routeElbow: string;
|
|
461
|
+
routeCurved: string;
|
|
462
|
+
arrowStart: string;
|
|
463
|
+
arrowEnd: string;
|
|
464
|
+
lineWidth: string;
|
|
465
|
+
fill: string;
|
|
466
|
+
noFill: string;
|
|
467
|
+
outline: string;
|
|
468
|
+
chartBar: string;
|
|
469
|
+
chartHbar: string;
|
|
470
|
+
chartArea: string;
|
|
471
|
+
chartPie: string;
|
|
472
|
+
chartDonut: string;
|
|
473
|
+
legend: string;
|
|
474
|
+
legendBottom: string;
|
|
475
|
+
legendRight: string;
|
|
476
|
+
legendNone: string;
|
|
477
|
+
addSeries: string;
|
|
478
|
+
addCategory: string;
|
|
479
|
+
seriesName: string;
|
|
480
|
+
borders: string;
|
|
481
|
+
borderColour: string;
|
|
482
|
+
borderWidth: string;
|
|
483
|
+
insertRowAbove: string;
|
|
484
|
+
insertRowBelow: string;
|
|
485
|
+
insertColumnLeft: string;
|
|
486
|
+
insertColumnRight: string;
|
|
487
|
+
deleteRow: string;
|
|
488
|
+
deleteColumn: string;
|
|
489
|
+
mergeCells: string;
|
|
490
|
+
unmergeCells: string;
|
|
491
|
+
cellEditHint: string;
|
|
492
|
+
colours: string;
|
|
493
|
+
headingFont: string;
|
|
494
|
+
bodyFont: string;
|
|
495
|
+
slideNumbers: string;
|
|
496
|
+
skipSlide: string;
|
|
497
|
+
unskipSlide: string;
|
|
498
|
+
skipped: string;
|
|
499
|
+
transition: string;
|
|
500
|
+
transitionNone: string;
|
|
501
|
+
transitionFade: string;
|
|
502
|
+
transitionSlide: string;
|
|
503
|
+
transitionPush: string;
|
|
504
|
+
transitionZoom: string;
|
|
505
|
+
transitionFlip: string;
|
|
506
|
+
duration: string;
|
|
507
|
+
applyToAll: string;
|
|
508
|
+
play: string;
|
|
509
|
+
animations: string;
|
|
510
|
+
addAnimation: string;
|
|
511
|
+
removeAnimation: string;
|
|
512
|
+
selectToAnimate: string;
|
|
513
|
+
noAnimations: string;
|
|
514
|
+
effectAppear: string;
|
|
515
|
+
effectFadeIn: string;
|
|
516
|
+
effectFlyIn: string;
|
|
517
|
+
effectZoomIn: string;
|
|
518
|
+
effectFadeOut: string;
|
|
519
|
+
startClick: string;
|
|
520
|
+
startWithPrevious: string;
|
|
521
|
+
startAfterPrevious: string;
|
|
522
|
+
fromLeft: string;
|
|
523
|
+
fromRight: string;
|
|
524
|
+
fromTop: string;
|
|
525
|
+
fromBottom: string;
|
|
526
|
+
byParagraph: string;
|
|
527
|
+
moveEarlier: string;
|
|
528
|
+
moveLater: string;
|
|
529
|
+
commentPlaceholder: string;
|
|
530
|
+
replyPlaceholder: string;
|
|
531
|
+
post: string;
|
|
532
|
+
reply: string;
|
|
533
|
+
resolve: string;
|
|
534
|
+
reopen: string;
|
|
535
|
+
showResolved: string;
|
|
536
|
+
noComments: string;
|
|
537
|
+
editComment: string;
|
|
538
|
+
deleteComment: string;
|
|
539
|
+
save: string;
|
|
540
|
+
cancel: string;
|
|
541
|
+
commentFailed: string;
|
|
542
|
+
onSlide: string;
|
|
543
|
+
objectGone: string;
|
|
544
|
+
resolvedBy: string;
|
|
545
|
+
nameVersion: string;
|
|
546
|
+
versionName: string;
|
|
547
|
+
restore: string;
|
|
548
|
+
previewVersion: string;
|
|
549
|
+
noVersions: string;
|
|
550
|
+
restoreFailed: string;
|
|
551
|
+
closePreview: string;
|
|
552
|
+
versionsFailed: string;
|
|
553
|
+
startFrom: string;
|
|
554
|
+
exportPptx: string;
|
|
555
|
+
exportPdf: string;
|
|
556
|
+
exporting: string;
|
|
557
|
+
merged: string;
|
|
558
|
+
editingNow: (names: string) => string;
|
|
559
|
+
commentCount: (n: number) => string;
|
|
560
|
+
restoreConfirm: (when: string) => string;
|
|
561
|
+
shapeName: (kind: ShapeKind) => string;
|
|
562
|
+
starterName: (id: StarterId) => string;
|
|
563
|
+
themeName: (id: string) => string;
|
|
564
|
+
presenterStep: (n: number, total: number) => string;
|
|
565
|
+
dealerPitch: readonly (readonly [string, string])[];
|
|
566
|
+
monthlyReport: readonly (readonly [string, string])[];
|
|
208
567
|
}
|
|
209
568
|
declare const ENGLISH_WORDS: SlidesWords;
|
|
210
569
|
/** Machine-written and not yet reviewed. */
|
|
@@ -236,14 +595,115 @@ interface SlidesStore {
|
|
|
236
595
|
save: (id: string, document: unknown, version: string) => Promise<string>;
|
|
237
596
|
remove: (id: string) => Promise<void>;
|
|
238
597
|
}
|
|
598
|
+
/** One comment on a deck, as the host keeps it (efficient-backend `DeckComment`). */
|
|
599
|
+
interface DeckComment {
|
|
600
|
+
id: string;
|
|
601
|
+
/** The first comment of the thread this one answers; null for a thread's first. */
|
|
602
|
+
parent: string | null;
|
|
603
|
+
slideId: string;
|
|
604
|
+
/** The object it is pinned to; empty for the slide itself. */
|
|
605
|
+
elementId: string;
|
|
606
|
+
body: string;
|
|
607
|
+
authorId: string;
|
|
608
|
+
authorName: string;
|
|
609
|
+
createdAt: string;
|
|
610
|
+
resolvedAt: string | null;
|
|
611
|
+
resolvedByName: string;
|
|
612
|
+
}
|
|
613
|
+
interface CommentsStore {
|
|
614
|
+
list: (deckId: string) => Promise<DeckComment[]>;
|
|
615
|
+
add: (deckId: string, comment: {
|
|
616
|
+
slideId: string;
|
|
617
|
+
elementId: string;
|
|
618
|
+
body: string;
|
|
619
|
+
parent: string | null;
|
|
620
|
+
mentions: string[];
|
|
621
|
+
}) => Promise<DeckComment>;
|
|
622
|
+
update: (deckId: string, id: string, change: {
|
|
623
|
+
body?: string;
|
|
624
|
+
resolved?: boolean;
|
|
625
|
+
}) => Promise<DeckComment>;
|
|
626
|
+
remove: (deckId: string, id: string) => Promise<void>;
|
|
627
|
+
}
|
|
628
|
+
interface DeckVersionSummary {
|
|
629
|
+
id: string;
|
|
630
|
+
name: string;
|
|
631
|
+
createdAt: string;
|
|
632
|
+
editorNames: string[];
|
|
633
|
+
}
|
|
634
|
+
interface VersionsStore {
|
|
635
|
+
list: (deckId: string) => Promise<DeckVersionSummary[]>;
|
|
636
|
+
/** One version's document, to preview or restore. */
|
|
637
|
+
get: (deckId: string, id: string) => Promise<unknown>;
|
|
638
|
+
/** Keeps the deck as it is now under `name`. */
|
|
639
|
+
name: (deckId: string, name: string) => Promise<DeckVersionSummary>;
|
|
640
|
+
rename: (deckId: string, id: string, name: string) => Promise<DeckVersionSummary>;
|
|
641
|
+
}
|
|
642
|
+
interface Person {
|
|
643
|
+
id: string;
|
|
644
|
+
name: string;
|
|
645
|
+
}
|
|
646
|
+
/** What another editor's socket says (efficient-backend `utility.consumers`). */
|
|
647
|
+
type LiveEvent = {
|
|
648
|
+
event: 'hello' | 'presence';
|
|
649
|
+
payload: {
|
|
650
|
+
user: Person;
|
|
651
|
+
key: string;
|
|
652
|
+
slide: string | null;
|
|
653
|
+
selected: string[];
|
|
654
|
+
};
|
|
655
|
+
} | {
|
|
656
|
+
event: 'bye';
|
|
657
|
+
payload: {
|
|
658
|
+
user: Person;
|
|
659
|
+
key: string;
|
|
660
|
+
};
|
|
661
|
+
} | {
|
|
662
|
+
event: 'saved';
|
|
663
|
+
payload: {
|
|
664
|
+
version: string;
|
|
665
|
+
by: string;
|
|
666
|
+
};
|
|
667
|
+
} | {
|
|
668
|
+
event: 'comments';
|
|
669
|
+
payload: {
|
|
670
|
+
by: string;
|
|
671
|
+
};
|
|
672
|
+
};
|
|
673
|
+
interface LiveChannel {
|
|
674
|
+
/** This editor's presence: the slide it shows and what it has selected. */
|
|
675
|
+
send: (message: {
|
|
676
|
+
type: 'hello' | 'presence';
|
|
677
|
+
slide: string;
|
|
678
|
+
selected: string[];
|
|
679
|
+
}) => void;
|
|
680
|
+
close: () => void;
|
|
681
|
+
}
|
|
239
682
|
interface SlidesHost {
|
|
240
683
|
store: SlidesStore;
|
|
684
|
+
/** Absent: decks have no comments. */
|
|
685
|
+
comments?: CommentsStore;
|
|
686
|
+
/** Absent: no version history. */
|
|
687
|
+
versions?: VersionsStore;
|
|
688
|
+
/** The live room of one open deck. Absent: editors meet only when a save is
|
|
689
|
+
* refused, and are merged then. */
|
|
690
|
+
live?: (deckId: string, onEvent: (event: LiveEvent) => void) => LiveChannel;
|
|
691
|
+
/** Who is signed in, so the editor knows its own comments and saves. */
|
|
692
|
+
currentUser?: Person;
|
|
693
|
+
/** People an @-mention can name. */
|
|
694
|
+
people?: (query: string) => Promise<Person[]>;
|
|
241
695
|
/** Absent: a person may. */
|
|
242
696
|
canCreate?: boolean;
|
|
243
697
|
canDelete?: boolean;
|
|
244
698
|
/** Choose an image for a slide, answering its address. Absent: the image field
|
|
245
699
|
* takes a typed address. */
|
|
246
700
|
pickImage?: () => Promise<string | null>;
|
|
701
|
+
/** Keep one picture from an opened PowerPoint file, answering the address a slide
|
|
702
|
+
* names it by. Absent: pictures are kept in the deck itself, as data. */
|
|
703
|
+
storeImage?: (image: Blob, name: string) => Promise<string>;
|
|
704
|
+
/** Choose a PowerPoint file from the host's drive (../files/choose.ts). Absent:
|
|
705
|
+
* Open takes a file from this computer only. */
|
|
706
|
+
chooseFile?: ChooseOfficeFile;
|
|
247
707
|
/** The app's words in the host's language. Absent: English. */
|
|
248
708
|
words?: SlidesWords;
|
|
249
709
|
}
|
|
@@ -255,12 +715,79 @@ declare function SlidesProvider({ value, children }: {
|
|
|
255
715
|
children: ReactNode;
|
|
256
716
|
}): react.JSX.Element;
|
|
257
717
|
|
|
718
|
+
interface ImportedDeck {
|
|
719
|
+
id: string;
|
|
720
|
+
title: string;
|
|
721
|
+
notes: PptxImportNotes;
|
|
722
|
+
}
|
|
723
|
+
interface ImportDeckOptions {
|
|
724
|
+
/** Where each picture goes. Absent: kept in the deck as a data address. */
|
|
725
|
+
storeImage?: (image: Blob, name: string) => Promise<string>;
|
|
726
|
+
onProgress?: (fraction: number) => void;
|
|
727
|
+
signal?: AbortSignal;
|
|
728
|
+
}
|
|
729
|
+
declare function importDeckFile(store: SlidesStore, file: File, options?: ImportDeckOptions): Promise<ImportedDeck>;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Two people's edits to one deck, put together object by object: option A of
|
|
733
|
+
* the 2026-11-05 Slides parity work ("everyone edits at once"). Pure; tested in
|
|
734
|
+
* slidesMerge.test.ts.
|
|
735
|
+
*
|
|
736
|
+
* `base` is the document both started from (what this editor last saved or
|
|
737
|
+
* fetched), `mine` is this editor's, `theirs` is what the store now holds. For
|
|
738
|
+
* every slide and every object: whoever changed it wins; when both did, mine
|
|
739
|
+
* wins, because mine is the save being made now, the later one. Deleting beats
|
|
740
|
+
* editing, so a slide somebody removed doesn't come back because somebody else
|
|
741
|
+
* nudged an object on it. The same rule holds for each of a slide's own fields
|
|
742
|
+
* (background, notes, motion) and the deck's (theme, slide numbers).
|
|
743
|
+
*
|
|
744
|
+
* Order: mine if I reordered, else theirs, with the other side's additions put
|
|
745
|
+
* after what they followed there.
|
|
746
|
+
*/
|
|
747
|
+
|
|
748
|
+
declare function mergeDecks(base: DeckDocument, mine: DeckDocument, theirs: DeckDocument): DeckDocument;
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Motion: how a slide comes in (its transition) and how its objects appear on it
|
|
752
|
+
* (its animations), turned into what the presenter needs, which is a list of
|
|
753
|
+
* click steps per slide and, at each step, which objects show and which animate.
|
|
754
|
+
* Pure; tested in slidesMotion.test.ts. ./SlideView plays the keyframes.
|
|
755
|
+
*
|
|
756
|
+
* The rules are PowerPoint's and Google's: an object with an entrance is hidden
|
|
757
|
+
* until its step; `withPrevious` and `afterPrevious` join the step before them,
|
|
758
|
+
* starting with it or once it ends; the first animation, if it isn't on a click,
|
|
759
|
+
* plays as the slide arrives (step 0).
|
|
760
|
+
*/
|
|
761
|
+
|
|
762
|
+
/** One animation as it plays within its step: when it starts, in seconds. */
|
|
763
|
+
interface Played {
|
|
764
|
+
animation: Animation;
|
|
765
|
+
delay: number;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
interface ElementBodyOptions {
|
|
769
|
+
/** Labels' colour, read from the slide's background (`inkFor`). */
|
|
770
|
+
ink?: string;
|
|
771
|
+
/** A show: videos play, links follow. */
|
|
772
|
+
live?: boolean;
|
|
773
|
+
onLink?: (href: string) => void;
|
|
774
|
+
/** A table cell's editor, in place of its words. */
|
|
775
|
+
cellEditor?: (row: number, col: number) => ReactNode;
|
|
776
|
+
}
|
|
777
|
+
interface SlideMotion {
|
|
778
|
+
hidden: ReadonlySet<string>;
|
|
779
|
+
playing: readonly Played[];
|
|
780
|
+
}
|
|
258
781
|
/** The slide at `width` pixels. `editingId`'s element gives way to `editor`. */
|
|
259
|
-
declare function SlideView({ slide, width, editingId, editor, }: {
|
|
782
|
+
declare function SlideView({ slide, width, editingId, editor, number, motion, options, }: {
|
|
260
783
|
slide: Slide;
|
|
261
784
|
width: number;
|
|
262
785
|
editingId?: string | null;
|
|
263
786
|
editor?: ReactNode;
|
|
787
|
+
/** Its number in the deck, drawn in the corner when the deck shows numbers. */
|
|
788
|
+
number?: number;
|
|
789
|
+
motion?: SlideMotion;
|
|
790
|
+
options?: ElementBodyOptions;
|
|
264
791
|
}): react.JSX.Element;
|
|
265
792
|
|
|
266
793
|
declare const Slides: ComponentType;
|
|
@@ -287,4 +814,4 @@ declare function importPptx(file: Blob, options: PptxImportOptions): Promise<{
|
|
|
287
814
|
/** A PDF with one page for each slide, drawn as `SlideView` draws it. */
|
|
288
815
|
declare function deckToPdf(document: DeckDocument, options?: PdfOptions): Promise<Blob>;
|
|
289
816
|
|
|
290
|
-
export { DeckEditor, type DeckSummary, ENGLISH_WORDS, PdfOptions, type PptxImportNotes, type PptxImportOptions, PptxPasswordError, PptxUnreadableError, SlideView, Slides, SlidesConflict, type SlidesHost, SlidesProvider, type SlidesStore, type SlidesWords, type StoredDeck, ZH_HANS_WORDS, asDocument, browserSlidesStore, deckToPdf, importPptx, slidesApps };
|
|
817
|
+
export { ChooseOfficeFile, type CommentsStore, type DeckComment, DeckEditor, type DeckSummary, type DeckVersionSummary, ENGLISH_WORDS, FileWords, type ImportDeckOptions, type ImportedDeck, type LiveChannel, type LiveEvent, PdfOptions, type Person, type PptxImportNotes, type PptxImportOptions, PptxPasswordError, PptxUnreadableError, SlideView, Slides, SlidesConflict, type SlidesHost, SlidesProvider, type SlidesStore, type SlidesWords, type StoredDeck, type VersionsStore, ZH_HANS_WORDS, asDocument, browserSlidesStore, deckToPdf, importDeckFile, importPptx, mergeDecks, slidesApps };
|
package/dist/slides/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{mergeDecks as o}from"../chunk-3RFDQOTI.js";import{importDeckFile as t}from"../chunk-6ZFEBY6H.js";import{PptxPasswordError as r,PptxUnreadableError as m}from"../chunk-MDG2ADZ7.js";import{SlidesConflict as i,SlidesProvider as p,browserSlidesStore as s}from"../chunk-BGAR3P46.js";import{SlideView as n}from"../chunk-B2X3NIQR.js";import{ENGLISH_WORDS as c,ZH_HANS_WORDS as e,asDocument as f}from"../chunk-PXOQN7D6.js";import{ENGLISH_FILE_WORDS as u,ZH_HANS_FILE_WORDS as a}from"../chunk-B32ASXHM.js";import{hasExtension as j}from"../chunk-XYVQTQ6N.js";import{lazy as h}from"react";var k=h(()=>import("../Slides-JI73C3NW.js")),d=h(()=>import("../Slides-JI73C3NW.js").then(o=>({default:o.OpenDeck}))),l={"/slides":{component:k,label:"Slides",size:"3xl",appStyle:!0,flushBody:!0,autoHeight:!1}};async function P(o,t){const{importPptx:r}=await(import("../pptxImport-Y7TB6PYP.js"));return r(o,t)}async function B(o,t){const{deckToPdf:r}=await(import("../deckPdf-4RC7QJ45.js"));return r(o,t)}export{d as DeckEditor,u as ENGLISH_FILE_WORDS,c as ENGLISH_WORDS,r as PptxPasswordError,m as PptxUnreadableError,n as SlideView,k as Slides,i as SlidesConflict,p as SlidesProvider,a as ZH_HANS_FILE_WORDS,e as ZH_HANS_WORDS,f as asDocument,s as browserSlidesStore,B as deckToPdf,j as hasExtension,t as importDeckFile,P as importPptx,o as mergeDecks,l as slidesApps};
|