taleem-slides 0.4.0 β 0.5.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/README.md +126 -10
- package/package.json +1 -1
- package/src/index.js +1 -0
- package/src/resolveBackground.js +10 -0
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
2
3
|
# π¦ taleem-slides
|
|
3
4
|
|
|
4
|
-
## β οΈ
|
|
5
|
+
## β οΈ Warning: Work in Progress β expect breaking changes
|
|
5
6
|
|
|
6
7
|
> **Pure slide template library for Taleem decks**
|
|
7
8
|
|
|
@@ -21,11 +22,13 @@ It does **not** manage time, indexes, playback, or decks.
|
|
|
21
22
|
π **Official live display & reference implementation**
|
|
22
23
|
**[https://bilza2023.github.io/taleem/](https://bilza2023.github.io/taleem/)**
|
|
23
24
|
|
|
24
|
-
This is **not a mock demo**.
|
|
25
|
+
This is **not a mock demo**.
|
|
26
|
+
This link is the **active display center** where:
|
|
27
|
+
|
|
28
|
+
* slide templates are rendered in real browsers
|
|
29
|
+
* visual behavior is validated
|
|
30
|
+
* browser / player integration is tested
|
|
25
31
|
|
|
26
|
-
- slide templates are rendered in real browsers
|
|
27
|
-
- visual behavior is validated
|
|
28
|
-
- browser/player integration is tested
|
|
29
32
|
---
|
|
30
33
|
|
|
31
34
|
## β¨ Taleem.help Philosophy
|
|
@@ -38,7 +41,7 @@ The goal of the `taleem-*` libraries is simple:
|
|
|
38
41
|
> Enable educators to create **JSON-based presentations**
|
|
39
42
|
> and display them online using **free, open tools**.
|
|
40
43
|
|
|
41
|
-
Key ideas
|
|
44
|
+
### Key ideas
|
|
42
45
|
|
|
43
46
|
* Slides already encode *layout + structure*
|
|
44
47
|
* Users provide **content only**
|
|
@@ -239,9 +242,122 @@ Both projects:
|
|
|
239
242
|
|
|
240
243
|
---
|
|
241
244
|
|
|
242
|
-
|
|
245
|
+
## π³ Deck Background Support (NEW)
|
|
246
|
+
|
|
247
|
+
`taleem-slides` also defines **how deck backgrounds are resolved**, while remaining fully **DOM-agnostic**.
|
|
248
|
+
|
|
249
|
+
A deck background is **optional** and applies to the **entire deck**, not individual slides.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
### Background responsibility split
|
|
254
|
+
|
|
255
|
+
#### taleem-slides
|
|
256
|
+
|
|
257
|
+
* decides **what background should be used**
|
|
258
|
+
* exposes a **pure resolver function**
|
|
259
|
+
* returns **plain background data**
|
|
260
|
+
|
|
261
|
+
#### player / browser
|
|
262
|
+
|
|
263
|
+
* renders the background into the DOM
|
|
264
|
+
* applies styles and layout
|
|
265
|
+
* handles mounting and lifecycle
|
|
266
|
+
|
|
267
|
+
This keeps slide rendering **pure and portable**.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## π¨ Background Resolution API
|
|
272
|
+
|
|
273
|
+
`taleem-slides` exports a small helper:
|
|
274
|
+
|
|
275
|
+
```js
|
|
276
|
+
import { resolveBackground } from "taleem-slides";
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Purpose
|
|
280
|
+
|
|
281
|
+
`resolveBackground` answers one question only:
|
|
282
|
+
|
|
283
|
+
> **βWhat background should be used for this deck?β**
|
|
284
|
+
|
|
285
|
+
It does **not**:
|
|
286
|
+
|
|
287
|
+
* touch the DOM
|
|
288
|
+
* inject styles
|
|
289
|
+
* manage themes
|
|
290
|
+
* animate or time anything
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
### Input (conceptual)
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
{
|
|
298
|
+
deckBackground?: {
|
|
299
|
+
backgroundColor?: string
|
|
300
|
+
backgroundImage?: string
|
|
301
|
+
backgroundImageOpacity?: number
|
|
302
|
+
},
|
|
303
|
+
themeSurfaceColor?: string
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
### Output
|
|
310
|
+
|
|
311
|
+
```ts
|
|
312
|
+
{
|
|
313
|
+
backgroundColor?: string
|
|
314
|
+
backgroundImage?: string
|
|
315
|
+
backgroundImageOpacity?: number
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
### Resolution rules (locked)
|
|
322
|
+
|
|
323
|
+
* If the deck defines a background β **use it**
|
|
324
|
+
* Otherwise β **fall back to the themeβs surface color**
|
|
325
|
+
|
|
326
|
+
These rules are **format-level guarantees**, not rendering behavior.
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## π§ Mental Model (Updated)
|
|
243
331
|
|
|
244
|
-
|
|
245
|
-
|
|
332
|
+
```
|
|
333
|
+
deck JSON + render state + theme surface
|
|
334
|
+
β
|
|
335
|
+
taleem-slides
|
|
336
|
+
β
|
|
337
|
+
HTML + resolved background data
|
|
338
|
+
β
|
|
339
|
+
player / browser
|
|
340
|
+
β
|
|
341
|
+
DOM
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
`taleem-slides` decides **what exists**.
|
|
345
|
+
The player / browser decides **how it appears**.
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## π Design Principle (Extended)
|
|
350
|
+
|
|
351
|
+
> **taleem-slides renders HTML and resolves deck-level intent.
|
|
352
|
+
> It never touches the DOM and never manages playback.**
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## β
What this achieves
|
|
246
357
|
|
|
247
|
-
|
|
358
|
+
* background rules are centralized
|
|
359
|
+
* players remain simple
|
|
360
|
+
* browsers stay dumb
|
|
361
|
+
* future renderers (CLI, SSR, export) stay possible
|
|
362
|
+
|
|
363
|
+
---
|
package/package.json
CHANGED
package/src/index.js
CHANGED