efficient-office 0.7.0 → 0.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/dist/{Documents-CVV64UEH.js → Documents-ISV66NLW.js} +1 -1
- package/dist/Slides-LJW5C24V.js +1 -0
- package/dist/SlidesEditor-ETCUQVJ7.js +1 -0
- package/dist/{Spreadsheet-55AVNUEA.js → Spreadsheet-I3RO4HSS.js} +1 -1
- package/dist/chunk-3RFDQOTI.js +1 -0
- package/dist/{chunk-QFPW3KLL.js → chunk-6ZFEBY6H.js} +1 -1
- package/dist/chunk-B2X3NIQR.js +1 -0
- package/dist/{chunk-OB4MLAZC.js → chunk-BGAR3P46.js} +1 -1
- package/dist/{chunk-RLNXQG4T.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/deckPdf-4RC7QJ45.js +1 -0
- package/dist/documents/index.js +1 -1
- package/dist/pptxImport-Y7TB6PYP.js +1 -0
- package/dist/slides/index.d.ts +501 -6
- package/dist/slides/index.js +1 -1
- package/dist/slides/slides.css +79 -1
- package/dist/spreadsheet/index.js +1 -1
- package/package.json +1 -1
- package/dist/Slides-JMP36AJH.js +0 -1
- package/dist/SlidesEditor-MZM7IR46.js +0 -1
- package/dist/chunk-2AKHYM66.js +0 -1
- package/dist/chunk-2TZUCKZ7.js +0 -1
- package/dist/chunk-A5KQPSPX.js +0 -1
- package/dist/chunk-X6F3Z4KZ.js +0 -1
- package/dist/deckPdf-Y2RE7MFX.js +0 -1
- package/dist/pptxImport-STLMOUNE.js +0 -1
package/dist/slides/index.d.ts
CHANGED
|
@@ -12,16 +12,58 @@ interface Box {
|
|
|
12
12
|
interface ElementBase extends Box {
|
|
13
13
|
id: string;
|
|
14
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;
|
|
15
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';
|
|
16
47
|
interface TextElement extends ElementBase {
|
|
17
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`). */
|
|
18
51
|
text: string;
|
|
52
|
+
/** The box's own style: every run's default. */
|
|
19
53
|
fontSize: number;
|
|
20
54
|
bold: boolean;
|
|
21
55
|
color: string;
|
|
22
|
-
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;
|
|
23
64
|
}
|
|
24
|
-
|
|
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];
|
|
25
67
|
interface ShapeElement extends ElementBase {
|
|
26
68
|
type: 'shape';
|
|
27
69
|
/** A `line` runs left to right through the middle of its box; `rotation` turns it. */
|
|
@@ -34,20 +76,75 @@ interface ShapeElement extends ElementBase {
|
|
|
34
76
|
arrowEnd?: boolean;
|
|
35
77
|
arrowStart?: boolean;
|
|
36
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
|
+
}
|
|
37
86
|
interface ImageElement extends ElementBase {
|
|
38
87
|
type: 'image';
|
|
39
88
|
src: string;
|
|
40
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;
|
|
41
120
|
}
|
|
42
121
|
interface ChartPoint {
|
|
43
122
|
label: string;
|
|
44
123
|
value: number;
|
|
45
124
|
}
|
|
125
|
+
interface ChartSeries {
|
|
126
|
+
name: string;
|
|
127
|
+
color: string;
|
|
128
|
+
values: number[];
|
|
129
|
+
}
|
|
130
|
+
type ChartKind = 'bar' | 'hbar' | 'line' | 'area' | 'pie' | 'donut';
|
|
46
131
|
interface ChartElement extends ElementBase {
|
|
47
132
|
type: 'chart';
|
|
48
|
-
|
|
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. */
|
|
49
137
|
points: ChartPoint[];
|
|
50
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;
|
|
51
148
|
}
|
|
52
149
|
interface TableElement extends ElementBase {
|
|
53
150
|
type: 'table';
|
|
@@ -63,16 +160,60 @@ interface TableElement extends ElementBase {
|
|
|
63
160
|
/** By row and column; null takes the table's own look. */
|
|
64
161
|
cellFills?: (string | null)[][];
|
|
65
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;
|
|
66
175
|
}
|
|
67
|
-
type
|
|
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;
|
|
188
|
+
}
|
|
189
|
+
type LayoutId = 'title' | 'titleBody' | 'section' | 'twoColumns' | 'titleOnly' | 'blank';
|
|
68
190
|
interface Slide {
|
|
69
191
|
id: string;
|
|
70
192
|
background: string;
|
|
71
193
|
notes: string;
|
|
72
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;
|
|
73
212
|
}
|
|
74
213
|
interface DeckDocument {
|
|
75
214
|
slides: Slide[];
|
|
215
|
+
theme?: DeckTheme;
|
|
216
|
+
slideNumbers?: boolean;
|
|
76
217
|
}
|
|
77
218
|
/** A document that came back from the server with nothing in it yet. */
|
|
78
219
|
declare function asDocument(stored: unknown): DeckDocument;
|
|
@@ -108,6 +249,19 @@ declare class PptxUnreadableError extends Error {
|
|
|
108
249
|
constructor(message?: string);
|
|
109
250
|
}
|
|
110
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
|
+
|
|
111
265
|
/**
|
|
112
266
|
* The Slides app's words: its English, and each language this package carries. A
|
|
113
267
|
* host hands a language in through `SlidesProvider`'s `words`.
|
|
@@ -218,6 +372,198 @@ interface SlidesWords {
|
|
|
218
372
|
fonts: string[];
|
|
219
373
|
}) => string | null;
|
|
220
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])[];
|
|
221
567
|
}
|
|
222
568
|
declare const ENGLISH_WORDS: SlidesWords;
|
|
223
569
|
/** Machine-written and not yet reviewed. */
|
|
@@ -249,8 +595,103 @@ interface SlidesStore {
|
|
|
249
595
|
save: (id: string, document: unknown, version: string) => Promise<string>;
|
|
250
596
|
remove: (id: string) => Promise<void>;
|
|
251
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
|
+
}
|
|
252
682
|
interface SlidesHost {
|
|
253
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[]>;
|
|
254
695
|
/** Absent: a person may. */
|
|
255
696
|
canCreate?: boolean;
|
|
256
697
|
canDelete?: boolean;
|
|
@@ -287,12 +728,66 @@ interface ImportDeckOptions {
|
|
|
287
728
|
}
|
|
288
729
|
declare function importDeckFile(store: SlidesStore, file: File, options?: ImportDeckOptions): Promise<ImportedDeck>;
|
|
289
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
|
+
}
|
|
290
781
|
/** The slide at `width` pixels. `editingId`'s element gives way to `editor`. */
|
|
291
|
-
declare function SlideView({ slide, width, editingId, editor, }: {
|
|
782
|
+
declare function SlideView({ slide, width, editingId, editor, number, motion, options, }: {
|
|
292
783
|
slide: Slide;
|
|
293
784
|
width: number;
|
|
294
785
|
editingId?: string | null;
|
|
295
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;
|
|
296
791
|
}): react.JSX.Element;
|
|
297
792
|
|
|
298
793
|
declare const Slides: ComponentType;
|
|
@@ -319,4 +814,4 @@ declare function importPptx(file: Blob, options: PptxImportOptions): Promise<{
|
|
|
319
814
|
/** A PDF with one page for each slide, drawn as `SlideView` draws it. */
|
|
320
815
|
declare function deckToPdf(document: DeckDocument, options?: PdfOptions): Promise<Blob>;
|
|
321
816
|
|
|
322
|
-
export { ChooseOfficeFile, DeckEditor, type DeckSummary, ENGLISH_WORDS, FileWords, type ImportDeckOptions, type ImportedDeck, 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, importDeckFile, 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-LJW5C24V.js")),d=h(()=>import("../Slides-LJW5C24V.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};
|