taleem-player 1.0.6 → 1.0.8

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 CHANGED
@@ -1,31 +1,36 @@
1
1
  # Taleem Player
2
2
 
3
- <img src="./docs/images/taleem.webp"
4
- alt="Taleem Player — JSON to Web Presentations"
5
- width="100%" />
6
-
7
3
  **Taleem Player** converts **Taleem JSON slide data** into **web-based presentations**.
8
4
 
9
- It renders the _same taleem JSON_ in multiple ways using different display modes.
5
+ It renders the **same Taleem JSON** in multiple display modes using a single, stable rendering engine.
10
6
 
11
- > **Stable 1.0 API frozen.**
7
+ > **Stable · deck-v1 frozen**
8
+ > The slide language, schema, and registry are complete.
12
9
  > Internal improvements may continue without breaking public contracts.
13
10
 
14
11
  ---
15
-
16
- ## Demo & Documentation
17
-
12
+ Demo & Documentation
18
13
  👉 https://bilza2023.github.io/taleem/
19
14
 
20
15
  The live demo shows:
21
16
 
22
- - Browser Mode (index-based rendering)
23
- - Player Mode (time-based rendering)
24
- - Real production Taleem JSON
25
- - Shared CSS across all modes
17
+ - Browser Mode (index-based rendering)
18
+ - Player Mode (time-based rendering)
19
+ - Real production Taleem JSON
20
+ - Shared CSS across all modes
21
+ - No screenshots. No mock data.
22
+ - What you see is the real engine running in the browser.
23
+ ---
24
+
25
+ ## What this project is
26
+
27
+ Taleem Player is a **presentation engine**, not a slide editor.
26
28
 
27
- **No screenshots. No mock data.
28
- What you see is the real engine running in the browser.**
29
+ It takes **validated Taleem decks** and turns them into:
30
+ - index-based presentations
31
+ - time-based presentations
32
+
33
+ The system is **declarative**, **predictable**, and **CSS-driven**.
29
34
 
30
35
  ---
31
36
 
@@ -33,15 +38,15 @@ What you see is the real engine running in the browser.**
33
38
 
34
39
  ```bash
35
40
  npm install taleem-player
36
- ```
41
+ ````
37
42
 
38
43
  ---
39
44
 
40
45
  ## Display Modes
41
46
 
42
- ### Browser Mode (Index-based)
47
+ ### Browser Mode (index-based)
43
48
 
44
- Use when you want **direct access to slides**.
49
+ Use when you want **direct control over which slide is shown**.
45
50
 
46
51
  ```js
47
52
  import { createTaleemBrowser } from "taleem-player";
@@ -55,18 +60,18 @@ browser.render(0);
55
60
  browser.getTotal();
56
61
  ```
57
62
 
58
- **Ideal for**
63
+ **Best for**
59
64
 
60
- - previews
61
- - galleries
62
- - editors
63
- - syllabus pages
65
+ * previews
66
+ * editors
67
+ * galleries
68
+ * syllabus pages
64
69
 
65
70
  ---
66
71
 
67
- ### Player Mode (Time-based)
72
+ ### Player Mode (time-based)
68
73
 
69
- Use when slides must change **progressively over time**.
74
+ Use when slides should progress according to **external timing**.
70
75
 
71
76
  ```js
72
77
  import { createTaleemPlayer } from "taleem-player";
@@ -75,32 +80,43 @@ const player = createTaleemPlayer({ mount: "#app" });
75
80
  player.renderAt(12.5);
76
81
  ```
77
82
 
78
- **Ideal for**
83
+ **Best for**
79
84
 
80
- - narrated lessons
81
- - video / audio sync
82
- - recorded presentations
85
+ * narrated lessons
86
+ * recorded explanations
87
+ * audio / video synchronization
83
88
 
84
89
  ---
85
90
 
86
- ## Browser vs Player (Quick Comparison)
91
+ ## Browser vs Player
87
92
 
88
- | Feature | Browser | Player |
89
- | --------------- | -------------- | -------------- |
90
- | Rendering | Index-based | Time-based |
91
- | Timing required | No | Yes |
92
- | Navigation | Manual | Progressive |
93
- | Control | App-driven | External clock |
94
- | Use case | Preview / Edit | Playback |
93
+ | Feature | Browser Mode | Player Mode |
94
+ | ---------- | ------------ | ----------- |
95
+ | Rendering | Index-based | Time-based |
96
+ | Timing | Optional | Required |
97
+ | Navigation | Manual | Progressive |
98
+ | Control | App-driven | External |
99
+ | Use case | Preview | Playback |
95
100
 
96
- > ⚠️ Player Mode requires **valid, ordered timings**.
97
- > The library does not auto-correct or guess timing errors.
101
+ > ⚠️ Player Mode assumes **valid timings**.
102
+ > The library does not guess, correct, or mutate deck data.
98
103
 
99
104
  ---
100
105
 
101
- ## Utilities (Runtime-safe)
106
+ ## Slide System
102
107
 
103
- These **Utilities (Runtime-safe)** are exported :
108
+ * The core system defines **16 canonical slide types**
109
+ * The slide registry is **stable and frozen**
110
+ * Slides express **visual state**, not interaction
111
+ * All motion and emphasis are **CSS-based**
112
+
113
+ If a deck validates against `deck-v1`, it is correct Taleem data.
114
+
115
+ ---
116
+
117
+ ## Utilities (runtime-safe)
118
+
119
+ The following helpers are exported for **application use**:
104
120
 
105
121
  ```js
106
122
  import {
@@ -111,12 +127,13 @@ import {
111
127
  } from "taleem-player";
112
128
  ```
113
129
 
114
- - `assignMockTimings(deck, seconds)`
115
- - `resolveAssetPaths(deck, basePath)`
116
- - `resolveBackground(deck, basePath)`
117
- - `getDeckEndTime(deck)`
130
+ * `assignMockTimings(deck, seconds)`
131
+ * `resolveAssetPaths(deck, basePath)`
132
+ * `resolveBackground(deck, basePath)`
133
+ * `getDeckEndTime(deck)`
118
134
 
119
- These helpers prepare decks for real usage and runtime playback.
135
+ These functions **prepare** decks for runtime usage.
136
+ They never change slide meaning.
120
137
 
121
138
  ---
122
139
 
@@ -129,31 +146,63 @@ import "taleem-player/css/light";
129
146
  import "taleem-player/css/paper";
130
147
  ```
131
148
 
132
- CSS must be imported explicitly by the host app.
133
- All modes share the same styling system.
149
+ CSS is **explicitly imported** by the host application.
150
+
151
+ * No JS-driven interaction
152
+ * No runtime behavior logic
153
+ * Visual changes are handled via **CSS state**
134
154
 
135
155
  ---
136
156
 
137
157
  ## What Taleem Player does NOT do
138
158
 
139
- - create slides
140
- - edit JSON
141
- - manage clocks or media playback
142
- - handle audio or narration
143
- - auto-validate or repair data
159
+ Taleem Player does **not**:
160
+
161
+ * create slides
162
+ * edit JSON
163
+ * manage playback clocks
164
+ * handle audio or narration
165
+ * auto-fix invalid data
166
+ * provide interactive UI controls
144
167
 
145
- Those responsibilities belong to the **application layer**.
168
+ Those responsibilities belong to **application-level projects** or **slide bundles**.
169
+
170
+ ---
171
+
172
+ ## Slide Extensions
173
+
174
+ The core slide language is **closed**.
175
+
176
+ Additional slides should be developed as:
177
+
178
+ * external slide bundles
179
+ * application-specific extensions
180
+
181
+ The core registry supports **additive registration only**.
182
+
183
+ ---
184
+
185
+ ## EQ slide
186
+
187
+ The `eq` slide type is implemented and tested.
188
+
189
+ It represents **structured symbolic content** and intentionally marks the **upper boundary** of the system.
190
+
191
+ Anything more complex than this belongs in a **separate product**, not in the core player.
146
192
 
147
193
  ---
148
194
 
149
195
  ## Status
150
196
 
151
- **Stable Version 1.0**
197
+ **Stable · deck-v1 frozen**
198
+
199
+ The system is complete and production-safe.
200
+
201
+ Future work should focus on:
152
202
 
153
- The `eq` slide type is **experimental**:
154
- - it is implemented but intentionally limited
155
- - it should not be relied on for production math rendering
156
- - its behavior may evolve without breaking the core player API
203
+ * content
204
+ * slide bundles
205
+ * authoring tools
157
206
 
158
207
  ---
159
208
 
@@ -273,9 +273,6 @@
273
273
  }
274
274
 
275
275
 
276
-
277
- /* ///////fixes */
278
-
279
276
  /* -------------------------------
280
277
  Image + Bullets (Side by Side)
281
278
  ------------------------------- */
@@ -346,19 +343,211 @@
346
343
  }
347
344
 
348
345
 
346
+ /* =====================================================
347
+ EQ — Final visual behavior
348
+ ===================================================== */
349
+
350
+ /* EQ should grow from TOP, not vertical center */
351
+ .slide.eq.imageRightBulletsLeft {
352
+ align-items: flex-start;
353
+ }
354
+
355
+ /* ---------- EQ: equation lines as table rows ---------- */
356
+
357
+ .slide.eq.imageRightBulletsLeft .eq-lines {
358
+ flex: 1;
359
+ list-style: none; /* remove bullet visuals */
360
+ padding: 0;
361
+ margin: 0;
362
+
363
+ display: flex;
364
+ flex-direction: column;
365
+ gap: 0;
366
+ }
367
+
368
+ .slide.eq.imageRightBulletsLeft .eq-lines li {
369
+ padding: 14px 18px;
370
+ font-size: 2.6rem;
371
+ line-height: 1.45;
372
+
373
+ border-bottom: 1px solid rgba(255, 255, 255, 0.18);
374
+ background: rgba(255, 255, 255, 0.03);
375
+
376
+ transition: background 0.25s ease, color 0.25s ease;
377
+ }
378
+
379
+ /* selected (latest) line */
380
+ .slide.eq.imageRightBulletsLeft .eq-lines li:last-child {
381
+ background: rgba(245, 197, 66, 0.18); /* soft yellow */
382
+ color: #ffd7a3; /* warm / reddish */
383
+ font-weight: 600;
384
+ }
385
+
386
+ /* ---------- RIGHT: fixed explanation panel ---------- */
387
+
388
+ .slide.eq.imageRightBulletsLeft .eq-side-panel {
389
+ flex: 1;
390
+ height: 75vh; /* FIXED height → no shaking */
391
+ overflow: hidden; /* contain layout */
392
+
393
+ padding: 28px 32px;
394
+
395
+ background: rgba(0, 0, 0, 0.35);
396
+ border: 1px solid rgba(255, 255, 255, 0.18);
397
+ border-radius: 16px;
398
+
399
+ box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
400
+
401
+ display: flex;
402
+ flex-direction: column;
403
+ }
404
+
405
+ /* ---------- Side panel items ---------- */
406
+
407
+ .slide.eq.imageRightBulletsLeft .eq-explain-item {
408
+ font-size: 1.4rem;
409
+ line-height: 1.45;
410
+ text-align: center;
411
+
412
+ word-wrap: break-word;
413
+ overflow-wrap: break-word;
414
+
415
+ background: rgba(255, 255, 255, 0.06);
416
+ padding: 14px 18px;
417
+ border-radius: 12px;
418
+ }
419
+
420
+ /* ---------- Side panel image ---------- */
421
+
422
+ .slide.eq.imageRightBulletsLeft .eq-explain-image img {
423
+ width: 70%;
424
+ margin: 0 auto; /* center image */
425
+ display: block;
426
+
427
+ border-radius: 12px;
428
+ }
429
+
430
+ /* =====================================================
431
+ Bar Chart Slide
432
+ ===================================================== */
433
+
434
+ .slide.barChart {
435
+ justify-content: center;
436
+ align-items: center;
437
+ text-align: left;
438
+ }
439
+
440
+ .slide.barChart .bar-chart {
441
+ width: 100%;
442
+ max-width: 900px;
443
+
444
+ display: flex;
445
+ flex-direction: column;
446
+ gap: 22px;
447
+ }
448
+
449
+ /* one bar row */
450
+ .slide.barChart .bar-row {
451
+ display: flex;
452
+ align-items: center;
453
+ gap: 20px;
454
+ }
455
+
456
+ /* label on the left */
457
+ .slide.barChart .bar-label {
458
+ width: 220px;
459
+ font-size: 2.2rem;
460
+ opacity: 0.9;
461
+ flex-shrink: 0;
462
+ }
463
+
464
+ /* bar background */
465
+ .slide.barChart .bar-track {
466
+ flex: 1;
467
+ height: 26px;
468
+
469
+ background: rgba(255, 255, 255, 0.15);
470
+ border-radius: 13px;
471
+ overflow: hidden;
472
+ }
473
+
474
+ /* actual bar */
475
+ .slide.barChart .bar-fill {
476
+ height: 100%;
477
+ width: 0;
478
+
479
+ background: #ff9900;
480
+ border-radius: 13px;
481
+ }
482
+
483
+ /* numeric value on right */
484
+ .slide.barChart .bar-value {
485
+ width: 48px;
486
+ text-align: right;
487
+ font-size: 2rem;
488
+ opacity: 0.85;
489
+ }
490
+
491
+
492
+ /* -------------------------------
493
+ Progress Bar Slide
494
+ ------------------------------- */
495
+
496
+ .slide.progressbar {
497
+ justify-content: center;
498
+ align-items: center;
499
+ text-align: left;
500
+ }
501
+
502
+ .slide.progressbar .progressbar-item {
503
+ width: 100%;
504
+ max-width: 900px;
505
+
506
+ display: flex;
507
+ flex-direction: column;
508
+ gap: 14px;
509
+
510
+ margin-bottom: 28px;
511
+ }
512
+
513
+ .slide.progressbar .progressbar-label {
514
+ font-size: 2.4rem;
515
+ font-weight: 600;
516
+ opacity: 0.9;
517
+ }
518
+
519
+ .slide.progressbar .progressbar-track {
520
+ width: 100%;
521
+ height: 28px;
522
+
523
+ background: rgba(255, 255, 255, 0.18);
524
+ border-radius: 14px;
525
+ overflow: hidden;
526
+ }
527
+
528
+ .slide.progressbar .progressbar-fill {
529
+ height: 100%;
530
+ width: 0;
531
+
532
+ background: #ff9900;
533
+ border-radius: 14px;
534
+
535
+ transition: width 0.6s ease;
536
+ }
537
+
349
538
  /* -------------------------------
350
- Corner Words Slide (4 Quadrants)
539
+ Key Ideas Slide (Corner Words / 4 Quadrants)
351
540
  ------------------------------- */
352
541
 
353
- .slide.cornerWordsSlide {
542
+ .slide.keyIdeasSlide {
354
543
  position: relative;
355
544
  width: 100%;
356
545
  height: 100vh;
357
546
  padding: 0;
358
547
  }
359
548
 
360
- /* base card */
361
- .cornerWordsSlide .corner-card {
549
+ /* base idea block */
550
+ .slide.keyIdeasSlide .key-idea {
362
551
  position: absolute;
363
552
  width: 45%;
364
553
  height: 45%;
@@ -375,114 +564,36 @@
375
564
  text-align: center;
376
565
  }
377
566
 
378
- /* emoji / icon */
379
- .cornerWordsSlide .corner-card .icon {
567
+ /* icon */
568
+ .slide.keyIdeasSlide .key-idea .icon {
380
569
  font-size: 5.2rem;
381
570
  line-height: 1;
382
571
  }
383
572
 
384
- /* label text */
385
- .cornerWordsSlide .corner-card .label {
573
+ /* label */
574
+ .slide.keyIdeasSlide .key-idea .label {
386
575
  font-size: 3.6rem;
387
576
  font-weight: 600;
388
577
  }
389
578
 
390
579
  /* quadrants */
391
- .cornerWordsSlide .corner-1 {
580
+ .slide.keyIdeasSlide .key-idea:nth-child(1) {
392
581
  top: 0;
393
582
  left: 0;
394
583
  }
395
584
 
396
- .cornerWordsSlide .corner-2 {
585
+ .slide.keyIdeasSlide .key-idea:nth-child(2) {
397
586
  top: 0;
398
587
  right: 0;
399
588
  }
400
589
 
401
- .cornerWordsSlide .corner-3 {
590
+ .slide.keyIdeasSlide .key-idea:nth-child(3) {
402
591
  bottom: 0;
403
592
  left: 0;
404
593
  }
405
594
 
406
- .cornerWordsSlide .corner-4 {
595
+ .slide.keyIdeasSlide .key-idea:nth-child(4) {
407
596
  bottom: 0;
408
597
  right: 0;
409
598
  }
410
-
411
-
412
-
413
- /* =====================================================
414
- EQ — TWO COLUMN (FIXED EXPLANATION PANEL)
415
- ===================================================== */
416
-
417
- .slide.eq.eq-two-column {
418
- display: flex;
419
- flex-direction: row;
420
- align-items: center;
421
- justify-content: center;
422
-
423
- gap: 64px;
424
- text-align: left;
425
- }
426
-
427
- /* LEFT PANEL — explanation (replaces image area) */
428
- .eq-explain-panel {
429
- flex: 1;
430
- max-width: 520px;
431
-
432
- background: rgba(0, 0, 0, 0.35);
433
- border: 1px solid rgba(255, 255, 255, 0.15);
434
- border-radius: 14px;
435
-
436
- padding: 28px 32px;
437
-
438
- display: flex;
439
- flex-direction: column;
440
- gap: 18px;
441
-
442
- box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
443
- }
444
-
445
- /* explanation item */
446
- .eq-explain-item {
447
- font-size: 2.4rem;
448
- line-height: 1.45;
449
- opacity: 0.95;
450
- }
451
-
452
- /* placeholder when nothing active */
453
- .eq-explain-placeholder {
454
- opacity: 0.5;
455
- font-style: italic;
456
- }
457
-
458
- /* RIGHT PANEL — equation lines */
459
- .eq-lines-panel {
460
- flex: 1;
461
- max-width: 520px;
462
-
463
- display: flex;
464
- flex-direction: column;
465
- gap: 16px;
466
- }
467
-
468
- /* equation line */
469
- .eq-line {
470
- background: rgba(255, 255, 255, 0.04);
471
- border: 1px solid rgba(255, 255, 255, 0.18);
472
- border-radius: 10px;
473
-
474
- padding: 14px 18px;
475
-
476
- font-size: 2.6rem;
477
- line-height: 1.5;
478
-
479
- transition:
480
- background 0.25s ease,
481
- border-color 0.25s ease;
482
- }
483
-
484
- /* active line */
485
- .eq-line.active {
486
- background: rgba(255, 255, 255, 0.08);
487
- border-color: rgba(120, 160, 255, 0.65);
488
- }
599
+