Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 1431a84

Browse files
feat(#37): add slot to allow editor to add notes
1 parent ad5e62a commit 1431a84

File tree

15 files changed

+76
-5
lines changed

15 files changed

+76
-5
lines changed

doc/slides/slides.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ The "Title" slide's Web Component could be integrated using the tag `<deckgo-sli
9191

9292
Both slots `title` and `content` are optional. Without providing one of them, the page will remain empty.
9393

94+
##### Notes
95+
96+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
97+
98+
```
99+
<deckgo-deck>
100+
<deckgo-slide-title>
101+
<h1 slot="title">My presentation title</h1>
102+
<div slot="notes">A note regarding this particular slide</div>
103+
</deckgo-slide-title>
104+
</deckgo-deck>
105+
```
106+
94107
#### Attributes
95108

96109
This component offers the following options which could be set using attributes:
@@ -158,6 +171,10 @@ The "Content" slide's Web Component could be integrated using the tag `<deckgo-s
158171

159172
Both slots `title` and `content` are optional. Without providing one of them, the page will remain empty.
160173

174+
##### Notes
175+
176+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
177+
161178
#### Attributes
162179

163180
This component offers the following options which could be set using attributes:
@@ -229,6 +246,10 @@ The `start` slot is the content of the left pane respectively the slot `end` is
229246

230247
Note: The slot `title` is per default hidden even if you provide it. See attributes below if you wish to display it.
231248

249+
##### Notes
250+
251+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
252+
232253
#### Attributes
233254

234255
This component offers the following options which could be set using attributes:
@@ -272,7 +293,7 @@ The "Gif" slide let you add easily a gif, like those provided by [Giphy](https:/
272293

273294
<img src="https://github.com/fluster/deckdeckgo/blob/master/doc/slides/deckdeckgo-slide-gif-layout.gif" width="450px">
274295

275-
#### Note
296+
#### For images too
276297

277298
The slide Gif is useful for Gifs but could be use for any images too, in case you would like for example to display an image fullscreen.
278299

@@ -292,6 +313,10 @@ The "Gif" slide's Web Component could be integrated using the tag `<deckgo-slide
292313

293314
The slots `title`, `header` and `footer` are both optional. `header` and `footer` would be displayed over the gif.
294315

316+
##### Notes
317+
318+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
319+
295320
#### Gif component
296321

297322
The slide "Gif" relies on the component `<deckgo-gif/>` which is described in the components [documentation](https://github.com/fluster/deckdeckgo/blob/master/doc/components/components.md).
@@ -344,6 +369,10 @@ The "Chart" slide's Web Component could be integrated using the tag `<deckgo-sli
344369

345370
The slot `title` is optional.
346371

372+
##### Notes
373+
374+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
375+
347376
#### Chart components
348377

349378
The slide "Chart" relies on the charts components `<deckgo-pie-chart/>`, `<deckgo-line-chart/>` and `<deckgo-bar-chart/>` which are described in the components [documentation](https://github.com/fluster/deckdeckgo/blob/master/doc/components/components.md).
@@ -404,6 +433,10 @@ The "Youtube" slide's Web Component could be integrated using the tag `<deckgo-s
404433

405434
The slot `title` is optional.
406435

436+
##### Notes
437+
438+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
439+
407440
##### Youtube component
408441

409442
The slide "Youtube" relies on the component `<deckgo-youtube/>` which is described in the components [documentation](https://github.com/fluster/deckdeckgo/blob/master/doc/components/components.md).
@@ -492,6 +525,10 @@ You could provide a file URI to the code you want to display or provide it with
492525

493526
The slots `title` and `code` are optional.
494527

528+
##### Notes
529+
530+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
531+
495532
#### Code components
496533

497534
The slide "Code" relies on the code component `<deckgo-highlight-code/>` which is described in the components [documentation](https://github.com/fluster/deckdeckgo/blob/master/doc/components/components.md).
@@ -588,6 +625,10 @@ Notes:
588625

589626
* You could provide up to six `social-link` slots. Each of these could be your custom code or you could use the component `<deckgo-social/>` to easily provide a link to an external URI.
590627

628+
##### Notes
629+
630+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
631+
591632
##### Social components
592633

593634
The details of the component `<deckgo-social/>` is described in the components [documentation](https://github.com/fluster/deckdeckgo/blob/master/doc/components/components.md).
@@ -704,6 +745,10 @@ The "QR code" slide's Web Component could be integrated using the tag `<deckgo-s
704745

705746
The slots `title` and `content` are optional.
706747

748+
##### Notes
749+
750+
Optionally a slot `notes` could be use to add some notes regarding the particular slide. These will `not` be displayed in the presentation but `displayed` in the [remote control](https://deckdeckgo.app).
751+
707752
#### Code components
708753

709754
The slide "QR Code" relies on the code component `<deckgo-qrcode/>` which is described in the components [documentation](https://github.com/fluster/deckdeckgo/blob/master/doc/components/components.md).

src/components.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export namespace Components {
3333
'onSlidePrevDidChange'?: (event: CustomEvent<number>) => void;
3434
'onSlideToChange'?: (event: CustomEvent<number>) => void;
3535
'onSlideWillChange'?: (event: CustomEvent<number>) => void;
36-
'onSlidesDidLoad'?: (event: CustomEvent<string[]>) => void;
36+
'onSlidesDidLoad'?: (event: CustomEvent<DeckdeckgoSlideDefinition[]>) => void;
3737
'pager'?: boolean;
3838
'pagerPercentage'?: boolean;
3939
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface DeckdeckgoSlideDefinition {
2+
name: string;
3+
notes?: string;
4+
}

src/components/deck/deckdeckgo-deck/deckdeckgo-deck.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class DeckdeckgoDeck {
3434
@State()
3535
private length: number = 0;
3636

37-
@Event() slidesDidLoad: EventEmitter<string[]>;
37+
@Event() slidesDidLoad: EventEmitter<DeckdeckgoSlideDefinition[]>;
3838
@Event() slideNextDidChange: EventEmitter<number>;
3939
@Event() slidePrevDidChange: EventEmitter<number>;
4040
@Event() slideToChange: EventEmitter<number>;
@@ -257,9 +257,17 @@ export class DeckdeckgoDeck {
257257

258258
// Are all slides loaded?
259259
if (definedSlides && loadedSlides && loadedSlides.length === definedSlidesLength && definedSlidesLength === this.length) {
260-
const orderedSlidesTagNames: string[] = Array.from(loadedSlides).map((slide: HTMLElement) => {
261-
return slide.tagName
260+
const orderedSlidesTagNames: DeckdeckgoSlideDefinition[] = [];
261+
262+
Array.from(loadedSlides).forEach((slide: HTMLElement) => {
263+
const notes: HTMLElement = slide.querySelector('[slot=\'notes\']');
264+
265+
orderedSlidesTagNames.push({
266+
name: slide.tagName,
267+
notes: notes ? notes.innerHTML : null
268+
});
262269
});
270+
263271
this.slidesDidLoad.emit(orderedSlidesTagNames);
264272

265273
await this.lazyLoadFirstSlides();

src/components/slides/deckdeckgo-slide-author/deckdeckgo-slide-author.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class DeckdeckgoSlideAuthor implements DeckdeckgoSlide {
5757
<slot name="social-link"></slot>
5858
</div>
5959
</div>
60+
<slot name="notes"></slot>
6061
</div>;
6162
}
6263

src/components/slides/deckdeckgo-slide-chart/deckdeckgo-slide-chart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export class DeckdeckgoSlideChart implements DeckdeckgoSlide {
118118
<div class="deckgo-chart-container">
119119
{this.renderChart()}
120120
</div>
121+
<slot name="notes"></slot>
121122
</div>
122123
}
123124

src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export class DeckdeckgoSlideCode implements DeckdeckgoSlide {
163163
<deckgo-highlight-code src={this.src} anchor={this.anchor} anchorZoom={this.anchorZoom} hideAnchor={this.hideAnchor} language={this.language}></deckgo-highlight-code>
164164
</div>
165165
<slot name="code"></slot>
166+
<slot name="notes"></slot>
166167
</div>;
167168
}
168169

src/components/slides/deckdeckgo-slide-content/deckdeckgo-slide-content.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class DeckdeckgoSlideContent implements DeckdeckgoSlide {
4646
return <div class="deckgo-slide">
4747
<slot name="title"></slot>
4848
<slot name="content"></slot>
49+
<slot name="notes"></slot>
4950
</div>;
5051
}
5152

src/components/slides/deckdeckgo-slide-gif/deckdeckgo-slide-gif.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export class DeckdeckgoSlideGif implements DeckdeckgoSlide {
7272
<slot name="header"></slot>
7373
<deckgo-gif src={this.src} alt={this.alt} fullscreen={this.fullscreen}></deckgo-gif>
7474
<slot name="footer"></slot>
75+
<slot name="notes"></slot>
7576
</div>
7677
</div>
7778
}

src/components/slides/deckdeckgo-slide-qrcode/deckdeckgo-slide-qrcode.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export class DeckdeckgoSlideQrcode implements DeckdeckgoSlide {
9191
<slot name="content"></slot>
9292
<deckgo-qrcode content={this.content}></deckgo-qrcode>
9393
</div>
94+
<slot name="notes"></slot>
9495
</div>;
9596
}
9697

0 commit comments

Comments
 (0)