taleem-engine 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taleem-engine",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Deterministic educational presentation engine",
5
5
  "type": "module",
6
6
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  "scripts": {
19
19
  "test": "vitest",
20
- "example": "node examples/golden-dsl.js"
20
+ "example": "node examples/golden-dsl-8-may-26.js"
21
21
  },
22
22
 
23
23
  "keywords": [
@@ -1,50 +1,15 @@
1
1
  // /src/compiler/index.js
2
2
 
3
- import { compileTimings } from "./utils/compileTimings.js";
4
-
5
- import { resolveAssetPaths } from "./utils/resolveAssetPaths.js";
6
3
 
4
+ import { compileTimings } from "./utils/compileTimings.js";
7
5
  import { templates } from "./templates/index.js";
8
-
9
6
  import { runPrimitive } from "./animation-primtives/runPrimitive.js";
10
7
 
11
- export function TaleemCompiler(
12
- builder,
13
- options = {}
14
- ) {
15
- const {
16
- assetBase =
17
- builder.metaData.base || ""
18
- } = options;
19
-
8
+ export function TaleemCompiler(builder) {
20
9
  // --------------------------------------------------
21
10
  // timings
22
11
  // --------------------------------------------------
23
-
24
- compileTimings(
25
- builder.deck,
26
- builder.presentationEnd
27
- );
28
-
29
- // --------------------------------------------------
30
- // preprocess DSL slides
31
- // IMPORTANT:
32
- // resolve BEFORE html compilation
33
- // --------------------------------------------------
34
-
35
- if (assetBase) {
36
- resolveAssetPaths(
37
- {
38
- background:
39
- builder.backgroundData,
40
-
41
- deck: builder.deck
42
- },
43
-
44
- assetBase
45
- );
46
- }
47
-
12
+ compileTimings(builder.deck, builder.presentationEnd );
48
13
  // --------------------------------------------------
49
14
  // compile slides
50
15
  // --------------------------------------------------
@@ -109,14 +74,14 @@ export function TaleemCompiler(
109
74
  // --------------------------------------------------
110
75
  // final presentation
111
76
  // --------------------------------------------------
112
-
113
77
  return {
114
- name:
115
- builder.metaData.name,
116
-
78
+ name: builder.name,
79
+
117
80
  background:
118
- builder.backgroundData,
119
-
120
- deck: compiledDeck
81
+ builder.background,
82
+
83
+ deck:
84
+ compiledDeck
121
85
  };
86
+
122
87
  }
package/src/dsl/Taleem.js CHANGED
@@ -1,73 +1,48 @@
1
1
  // /src/dsl/index.js
2
2
 
3
3
  import TimelineContext from "./TimelineContext.js";
4
-
5
4
  import { TaleemCompiler } from "../compiler/TaleemCompiler.js";
6
-
7
5
  import BulletListBuilder from "./slides/BulletListBuilder.js";
8
-
9
6
  import SkeletonSlideBuilder from "./slides/SkeletonSlideBuilder.js";
10
-
11
7
  import FocusListBuilder from "./slides/FocusListBuilder.js";
12
-
13
8
  import Eq from "./slides/Eq.js";
14
-
15
9
  import Table from "./slides/Table.js";
16
-
17
10
  import BarChart from "./slides/BarChart.js";
18
-
19
11
  import Progressbar from "./slides/Progressbar.js";
20
-
21
12
  import TitleAndSubtitle from "./slides/TitleAndSubtitle.js";
22
-
23
13
  import TitleAndPara from "./slides/TitleAndPara.js";
24
-
25
14
  import TwoColumnText from "./slides/TwoColumnText.js";
26
-
27
15
  import ImageSlide from "./slides/ImageSlide.js";
28
-
29
16
  import ImageWithTitle from "./slides/ImageWithTitle.js";
30
-
31
17
  import ImageWithCaption from "./slides/ImageWithCaption.js";
32
-
33
18
  import ImageLeftBulletsRight from "./slides/ImageLeftBulletsRight.js";
34
-
35
19
  import ImageRightBulletsLeft from "./slides/ImageRightBulletsLeft.js";
36
-
37
20
  import QuoteSlide from "./slides/QuoteSlide.js";
38
-
39
21
  import KeyIdeasSlide from "./slides/KeyIdeasSlide.js";
40
-
41
22
  import FillImage from "./slides/FillImage.js";
42
-
43
23
  import ImageStrip from "./slides/ImageStrip.js";
44
-
45
24
  import ImageGrid from "./slides/ImageGrid.js";
46
-
47
25
  import TextGrid from "./slides/TextGrid.js";
48
-
49
26
  /////////////////////////////////////////////////////
50
27
 
51
28
  export default class Taleem {
52
- constructor() {
53
- this.metaData = {
54
- name: "Untitled Deck",
29
+
55
30
 
56
- base: ""
57
- };
31
+ constructor(name = "Untitled Deck") {
32
+ this.name = name;
58
33
 
59
- this.backgroundData = {
60
- backgroundColor: "#111111",
34
+ this.background = {
35
+ backgroundColor: "#111111",
61
36
 
62
- backgroundImage: null,
37
+ backgroundImage: null,
63
38
 
64
- backgroundImageOpacity: 0.3
65
- };
39
+ backgroundImageOpacity: 0.3
40
+ };
66
41
 
67
- this.deck = [];
42
+ this.deck = [];
68
43
 
69
- this.presentationEnd = null;
70
- }
44
+ this.presentationEnd = null;
45
+ }
71
46
 
72
47
  at(time) {
73
48
  return new TimelineContext(
@@ -390,11 +365,6 @@ export default class Taleem {
390
365
  this
391
366
  );
392
367
  }
393
-
394
- compile() {
395
- return TaleemCompiler(this, {
396
- assetBase:
397
- this.metaData.base
398
- });
399
- }
368
+ /////////////==========> compiler
369
+ compile() {return TaleemCompiler(this);}
400
370
  }
File without changes