taleem-player 0.5.0 β 0.7.0-rc
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 +169 -146
- package/dist/css/taleem.css +347 -0
- package/dist/css/themes/dark.css +6 -0
- package/dist/css/themes/light.css +6 -0
- package/dist/css/themes/paper.css +6 -0
- package/dist/taleem-player.esm.js +221 -14372
- package/dist/taleem-player.umd.js +221 -14366
- package/package.json +11 -8
- package/dist/taleem-player.esm.css +0 -181
- package/dist/taleem-player.umd.css +0 -181
package/README.md
CHANGED
|
@@ -1,240 +1,263 @@
|
|
|
1
1
|
|
|
2
|
-
#
|
|
2
|
+
# Taleem Player
|
|
3
3
|
|
|
4
|
-
**taleem-player** is a **headless, time-driven playback engine** for Taleem slide decks.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
<img src="https://raw.githubusercontent.com/bilza2023/taleem-player/main/docs/images/taleem.webp" alt="Taleem Player β JSON to Web Presentations" />
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
* narrated lessons
|
|
10
|
-
* audio / videoβsynced slides
|
|
11
|
-
* external playback control
|
|
7
|
+
**Taleem Player** is a JavaScript library that converts **JSON slide data** into **web-based presentations**.
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
It provides multiple **modes** to display the same JSON presentation in different ways on the web.
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
---
|
|
12
|
+
###### Work in progress. Expect minor bugs, but no API breakages.
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
It does **not** define layouts.
|
|
19
|
-
It does **not** ship CSS.
|
|
14
|
+
Demo and Documentation
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
See Taleem Player in action:
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
π https://bilza2023.github.io/taleem/
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
This live demo lets you explore:
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
Browser Mode β instant, index-based slide rendering
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
known interval:
|
|
24
|
+
Player Mode β time-driven, progressive presentations
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
Real Taleem slide JSON used in production
|
|
27
|
+
|
|
28
|
+
Shared CSS system powering all display modes
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
No screenshots. No mock data.
|
|
31
|
+
What you see is the real engine running in the browser.
|
|
32
|
+
---
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
* or no slide (before / after the timeline)
|
|
34
|
+
## What it does
|
|
40
35
|
|
|
41
|
-
|
|
36
|
+
* Takes **Taleem slide JSON**
|
|
37
|
+
* Renders it as a **web presentation**
|
|
38
|
+
* Supports **multiple display modes**
|
|
39
|
+
* Ships **ready-to-use CSS**
|
|
40
|
+
* Includes **utilities** for real-world usage
|
|
42
41
|
|
|
43
42
|
---
|
|
44
43
|
|
|
45
|
-
##
|
|
44
|
+
## Installation
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
```bash
|
|
47
|
+
npm install taleem-player
|
|
48
|
+
```
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Display Modes
|
|
53
|
+
|
|
54
|
+
### 1. Browser Mode
|
|
55
|
+
|
|
56
|
+
**Index-based slide viewer**.
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
Use this when you want:
|
|
59
|
+
|
|
60
|
+
* manual navigation
|
|
61
|
+
* previews
|
|
62
|
+
* galleries
|
|
63
|
+
* syllabus / editor views
|
|
64
|
+
|
|
65
|
+
#### API
|
|
58
66
|
|
|
59
67
|
```js
|
|
60
|
-
player
|
|
61
|
-
|
|
68
|
+
import { createTaleemBrowser } from "taleem-player";
|
|
69
|
+
|
|
70
|
+
const browser = createTaleemBrowser({
|
|
71
|
+
mount: "#app",
|
|
72
|
+
deck
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
browser.render(0); // render slide by index
|
|
76
|
+
browser.getTotal(); // total number of slides
|
|
62
77
|
```
|
|
63
78
|
|
|
64
|
-
|
|
79
|
+
Characteristics:
|
|
80
|
+
|
|
81
|
+
* slide index driven
|
|
82
|
+
* no timing
|
|
83
|
+
* deterministic rendering
|
|
84
|
+
* same slide JSON as other modes
|
|
65
85
|
|
|
66
86
|
---
|
|
67
87
|
|
|
68
|
-
|
|
88
|
+
### 2. Player Mode
|
|
69
89
|
|
|
70
|
-
|
|
90
|
+
**Time-based slide player**.
|
|
71
91
|
|
|
72
|
-
|
|
92
|
+
Use this when you want:
|
|
73
93
|
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* interpret slide content
|
|
78
|
-
* infer or auto-fix timings
|
|
79
|
-
* manage audio or narration
|
|
80
|
-
* expose internal state
|
|
81
|
-
* depend on any framework
|
|
94
|
+
* narrated lessons
|
|
95
|
+
* video / audio sync
|
|
96
|
+
* timed presentations
|
|
82
97
|
|
|
83
|
-
|
|
84
|
-
If rendering looks wrong, the renderer is responsible.
|
|
98
|
+
#### API
|
|
85
99
|
|
|
86
|
-
|
|
100
|
+
```js
|
|
101
|
+
import { createTaleemPlayer } from "taleem-player";
|
|
87
102
|
|
|
88
|
-
|
|
103
|
+
const player = createTaleemPlayer({
|
|
104
|
+
mount: "#app",
|
|
105
|
+
deckDemo and Documentation
|
|
89
106
|
|
|
90
|
-
|
|
107
|
+
Live demo and documentation are available here:
|
|
91
108
|
|
|
92
|
-
|
|
109
|
+
π https://bilza2023.github.io/taleem/
|
|
93
110
|
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
"start": number,
|
|
97
|
-
"end": number
|
|
98
|
-
}
|
|
99
|
-
```
|
|
111
|
+
The demo showcases:
|
|
100
112
|
|
|
101
|
-
|
|
113
|
+
browser mode rendering
|
|
102
114
|
|
|
103
|
-
|
|
104
|
-
* `end` must be greater than `start`
|
|
105
|
-
* No implicit inheritance
|
|
106
|
-
* No auto-injection
|
|
107
|
-
* No browser-style forgiveness
|
|
115
|
+
player mode rendering
|
|
108
116
|
|
|
109
|
-
|
|
117
|
+
real Taleem slide JSON
|
|
110
118
|
|
|
111
|
-
|
|
119
|
+
shared CSS across modes
|
|
120
|
+
});
|
|
112
121
|
|
|
113
|
-
|
|
122
|
+
player.renderAt(12.5); // render slide at time (seconds)
|
|
123
|
+
player.destroy();
|
|
124
|
+
```
|
|
114
125
|
|
|
115
|
-
|
|
126
|
+
Characteristics:
|
|
116
127
|
|
|
117
|
-
|
|
128
|
+
* time driven
|
|
129
|
+
* external clock control
|
|
130
|
+
* no play / pause logic
|
|
131
|
+
* one active slide at a time
|
|
118
132
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
mount, // HTMLElement
|
|
122
|
-
slide, // full slide JSON
|
|
123
|
-
time // absolute time (seconds)
|
|
124
|
-
})
|
|
125
|
-
```
|
|
133
|
+
---
|
|
134
|
+
## Browser Mode vs Player Mode
|
|
126
135
|
|
|
127
|
-
|
|
136
|
+
Both modes render the same JSON presentation, but they serve very different purposes.
|
|
128
137
|
|
|
129
|
-
|
|
138
|
+
| Feature | Browser Mode | Player Mode |
|
|
139
|
+
|-------|-------------|-------------|
|
|
140
|
+
| Rendering model | Index-based | Time-based |
|
|
141
|
+
| Navigation | Manual (by slide index) | Progressive (by time) |
|
|
142
|
+
| Timing required | No | Yes (required) |
|
|
143
|
+
| Rendering behavior | One slide at a time | Slides change over time |
|
|
144
|
+
| Control source | Application-driven | External clock / media |
|
|
145
|
+
| Best suited for | Previews, galleries, editors | Narration, video, audio sync |
|
|
130
146
|
|
|
131
147
|
---
|
|
132
148
|
|
|
133
|
-
|
|
149
|
+
### Browser Mode
|
|
150
|
+
|
|
151
|
+
Use Browser Mode when you want direct access to slides.
|
|
152
|
+
|
|
153
|
+
**Characteristics**
|
|
154
|
+
- Index-based rendering
|
|
155
|
+
- No timing data required
|
|
156
|
+
- Deterministic output
|
|
157
|
+
|
|
158
|
+
**Ideal for**
|
|
159
|
+
- previews
|
|
160
|
+
- galleries
|
|
161
|
+
- editors
|
|
162
|
+
- syllabus pages
|
|
134
163
|
|
|
135
|
-
`taleem-player` is part of a **layered system**.
|
|
136
164
|
|
|
137
|
-
|
|
165
|
+
β οΈ Important:
|
|
166
|
+
In Player Mode, the user must provide valid and ordered timings (start, end).
|
|
167
|
+
The library does not auto-fix or guess timings.
|
|
138
168
|
|
|
139
|
-
|
|
140
|
-
Pure slide renderer.
|
|
141
|
-
Converts slide JSON into HTML + CSS.
|
|
169
|
+
---
|
|
142
170
|
|
|
143
|
-
|
|
171
|
+
## Utilities
|
|
144
172
|
|
|
145
|
-
|
|
146
|
-
Wires together:
|
|
173
|
+
Taleem Player includes small helper utilities for preparing decks.
|
|
147
174
|
|
|
148
|
-
|
|
149
|
-
* `taleem-slides`
|
|
150
|
-
* playback controls
|
|
151
|
-
* UI
|
|
175
|
+
### assignMockTimings
|
|
152
176
|
|
|
153
|
-
|
|
177
|
+
Convert a non-timed deck into a player-ready deck.
|
|
154
178
|
|
|
155
|
-
|
|
156
|
-
|
|
179
|
+
```js
|
|
180
|
+
import { assignMockTimings } from "taleem-player";
|
|
157
181
|
|
|
158
|
-
|
|
159
|
-
|
|
182
|
+
const timedDeck = assignMockTimings(deck, 5);
|
|
183
|
+
```
|
|
160
184
|
|
|
161
185
|
---
|
|
162
186
|
|
|
163
|
-
|
|
187
|
+
### resolveAssetPaths
|
|
164
188
|
|
|
165
|
-
|
|
166
|
-
`taleem-player` treats slides as a **timeline**.
|
|
189
|
+
Resolve image paths for deployment.
|
|
167
190
|
|
|
168
|
-
|
|
191
|
+
```js
|
|
192
|
+
import { resolveAssetPaths } from "taleem-player";
|
|
169
193
|
|
|
170
|
-
|
|
194
|
+
resolveAssetPaths(deck, "/images/");
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
171
198
|
|
|
172
|
-
|
|
173
|
-
* rendering does not pollute playback logic
|
|
174
|
-
* decks remain portable JSON documents
|
|
199
|
+
### resolveBackground
|
|
175
200
|
|
|
176
|
-
|
|
201
|
+
Normalize and resolve background configuration.
|
|
177
202
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
* adaptive playback
|
|
181
|
-
* multiple renderers
|
|
203
|
+
```js
|
|
204
|
+
import { resolveBackground } from "taleem-player";
|
|
182
205
|
|
|
183
|
-
|
|
206
|
+
resolveBackground(deck, "/images/");
|
|
207
|
+
```
|
|
184
208
|
|
|
185
209
|
---
|
|
186
210
|
|
|
187
|
-
##
|
|
211
|
+
## CSS
|
|
188
212
|
|
|
189
|
-
|
|
190
|
-
import { createTaleemPlayer } from "taleem-player";
|
|
191
|
-
import { createSlidesRenderer } from "taleem-slides";
|
|
192
|
-
import "taleem-slides/dist/taleem.css";
|
|
213
|
+
Taleem Player ships with built-in styles.
|
|
193
214
|
|
|
194
|
-
|
|
215
|
+
### Base styles
|
|
195
216
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
renderer
|
|
200
|
-
});
|
|
217
|
+
```js
|
|
218
|
+
import "taleem-player/css";
|
|
219
|
+
```
|
|
201
220
|
|
|
202
|
-
|
|
203
|
-
|
|
221
|
+
### Themes
|
|
222
|
+
|
|
223
|
+
```js
|
|
224
|
+
import "taleem-player/css/dark";
|
|
225
|
+
import "taleem-player/css/light";
|
|
226
|
+
import "taleem-player/css/paper";
|
|
204
227
|
```
|
|
205
228
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
The **app** composes them.
|
|
229
|
+
CSS controls layout, visibility, and visual behavior.
|
|
230
|
+
Modes share the same CSS.
|
|
209
231
|
|
|
210
232
|
---
|
|
211
233
|
|
|
212
|
-
##
|
|
234
|
+
## Input format
|
|
213
235
|
|
|
214
|
-
|
|
215
|
-
* Rendering is replaceable
|
|
216
|
-
* Strictness beats convenience
|
|
217
|
-
* Libraries stay small
|
|
218
|
-
* Composition happens at the edge
|
|
236
|
+
Taleem Player does **not** define slide structure.
|
|
219
237
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
238
|
+
It renders JSON produced for **taleem-slides**.
|
|
239
|
+
|
|
240
|
+
* Player Mode requires slides with `start` / `end`
|
|
241
|
+
* Browser Mode only needs ordered slides
|
|
223
242
|
|
|
224
243
|
---
|
|
225
244
|
|
|
226
|
-
##
|
|
245
|
+
## What Taleem Player does NOT do
|
|
246
|
+
|
|
247
|
+
* create slides
|
|
248
|
+
* edit JSON
|
|
249
|
+
* validate schemas
|
|
250
|
+
* manage time or playback
|
|
251
|
+
* handle audio or narration
|
|
252
|
+
* provide UI controls
|
|
227
253
|
|
|
228
|
-
**
|
|
254
|
+
Those belong to the **application**, not the library.
|
|
229
255
|
|
|
230
|
-
|
|
256
|
+
---
|
|
231
257
|
|
|
232
|
-
|
|
233
|
-
* playback UI layers
|
|
234
|
-
* renderers
|
|
235
|
-
* authoring tools
|
|
258
|
+
## Status
|
|
236
259
|
|
|
237
|
-
|
|
260
|
+
**Release Candidate (API stable)**
|
|
238
261
|
|
|
239
262
|
---
|
|
240
263
|
|