presenter 0.8.2 → 0.8.4
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/README.md +43 -1
- package/dist/navigator/openNavigator.d.ts +24 -2
- package/dist/presenter.js +2 -2
- package/dist/presenter.js.map +1 -1
- package/dist/presenter.mjs +1412 -1229
- package/dist/presenter.mjs.map +1 -1
- package/dist/renderer/browser-canvas/BrowserCanvasRenderer.d.ts +9 -0
- package/dist/utils/dom/hasModifierKey.d.ts +1 -0
- package/dist/utils/dom/isInteractiveElement.d.ts +1 -0
- package/dist/utils/presentation/setupKeyEventListeners.d.ts +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,4 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
Presenter.js is a presentation tool for programmatically building animated visual slides.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[View Documentation](https://presenter.js.org)
|
|
6
|
+
|
|
7
|
+
## Get Started
|
|
8
|
+
|
|
9
|
+
Start a new project by creating a Presenter.js presentation:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm create presenter
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or add Presenter.js to an existing project with `npm install presenter`.
|
|
16
|
+
|
|
17
|
+
## Presentation Structure
|
|
18
|
+
|
|
19
|
+
A presentation is a JavaScript object that includes an array of slides to render in order.
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
export const presentation = Presentation({
|
|
23
|
+
title: "Presentation",
|
|
24
|
+
slides: [TitleSlide],
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
A slide specifies objects on the slide, plus any animations for those objects.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { Anchor, Slide, Text } from "presenter";
|
|
32
|
+
import { position } from "../size";
|
|
33
|
+
|
|
34
|
+
const title = Text("Welcome to Presenter.js!", {
|
|
35
|
+
anchor: Anchor.CENTER,
|
|
36
|
+
fontSize: 150,
|
|
37
|
+
...position(0.5, 0.5),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const TitleSlide = Slide({
|
|
41
|
+
objects: [title],
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Notes
|
|
46
|
+
|
|
47
|
+
This library is still in development and its API may change in the future.
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
import { Presentation } from '../types/Presentation';
|
|
2
|
+
import { ShortcutState } from '../types/ShortcutState';
|
|
3
|
+
export declare let navigatorWindowBounds: {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
left: number;
|
|
7
|
+
top: number;
|
|
8
|
+
};
|
|
2
9
|
interface Args {
|
|
3
10
|
readonly presentation: Presentation;
|
|
11
|
+
readonly shortcutState: ShortcutState;
|
|
4
12
|
readonly onNavigateToSlide: (slideIndex: number) => void;
|
|
13
|
+
readonly onRenderSlide: (slideIndex: number | null, buildIndex: number) => void;
|
|
14
|
+
readonly onNext: (skipIntermediateBuilds?: boolean) => void;
|
|
15
|
+
readonly onPrevious: (skipIntermediateBuilds?: boolean) => void;
|
|
5
16
|
}
|
|
6
|
-
export
|
|
7
|
-
|
|
17
|
+
export interface NavigatorApi {
|
|
18
|
+
readonly currentCanvas: HTMLCanvasElement;
|
|
19
|
+
readonly nextCanvas: HTMLCanvasElement;
|
|
20
|
+
readonly currentLabel: HTMLDivElement;
|
|
21
|
+
readonly nextLabel: HTMLDivElement;
|
|
22
|
+
readonly isOpen: () => boolean;
|
|
23
|
+
readonly update: (slideIndex: number, buildIndex: number, nextSlideIndex: number | null, nextBuildIndex: number) => void;
|
|
24
|
+
}
|
|
25
|
+
type NavigatorElementApi = NavigatorApi & {
|
|
26
|
+
readonly element: HTMLDivElement;
|
|
27
|
+
};
|
|
28
|
+
export declare function openNavigator({ presentation, shortcutState, onNavigateToSlide, onRenderSlide, onNext, onPrevious, }: Args): NavigatorApi | null;
|
|
29
|
+
export declare function createNavigatorElement(presentation: Presentation, onNavigateToSlide: (slideIndex: number) => void, onNext: () => void): NavigatorElementApi;
|
|
8
30
|
export {};
|