kt-forpro-tools 1.0.24 → 1.1.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/package.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "name": "kt-forpro-tools",
3
- "version": "1.0.24",
4
- "description": "",
5
- "author": "Miguel de Mendoza",
6
- "main": "src/index.ts",
7
- "license": "MIT",
8
- "scripts": {
9
- "build": "kt-build",
10
- "build-tests": "kt-build build-tests",
11
- "debug-build-tests": "kt-build debug-build-tests"
12
- },
13
- "files": [
14
- "src",
15
- "tsconfig.json"
16
- ],
17
- "dependencies": {
18
- "kt-ae-is-checkers": "^1.0.7",
19
- "kt-ae-tools-layers": "^1.0.0",
20
- "kt-ae-tools-project": "^1.0.5",
21
- "kt-core": "*",
22
- "kt-io": "^1.1.0"
23
- },
24
- "devDependencies": {
25
- "kt-extendscript-builder": "*",
26
- "kt-testing-suite-ae": "*",
27
- "kt-testing-suite-core": "^1.7.7",
28
- "prettier": "^3.6.2"
29
- }
30
- }
1
+ {
2
+ "name": "kt-forpro-tools",
3
+ "version": "1.1.0",
4
+ "description": "",
5
+ "author": "Miguel de Mendoza",
6
+ "main": "src/index.ts",
7
+ "license": "MIT",
8
+ "scripts": {
9
+ "build": "kt-build",
10
+ "build-tests": "kt-build build-tests",
11
+ "debug-build-tests": "kt-build debug-build-tests"
12
+ },
13
+ "files": [
14
+ "src",
15
+ "tsconfig.json"
16
+ ],
17
+ "dependencies": {
18
+ "kt-ae-is-checkers": "^1.0.7",
19
+ "kt-ae-tools-layers": "^1.0.0",
20
+ "kt-ae-tools-project": "^1.0.5",
21
+ "kt-core": "*",
22
+ "kt-io": "^1.1.0"
23
+ },
24
+ "devDependencies": {
25
+ "kt-extendscript-builder": "*",
26
+ "kt-testing-suite-ae": "*",
27
+ "kt-testing-suite-core": "^1.7.7",
28
+ "prettier": "^3.6.2"
29
+ }
30
+ }
package/src/freeze.ts CHANGED
@@ -1,17 +1,12 @@
1
- import { KT_Project } from "kt-ae-tools-project";
1
+ import { KTSlidesFreezeConfig } from "./maps";
2
2
 
3
3
  class __KT_SlidesFreeze {
4
- courseTitle = KT_Project.find.comps("titulo-curso")[0];
5
- professorPastilla = KT_Project.find.comps("profesor-pastilla")[0];
6
- logo_in = KT_Project.find.comps("Logotipo")[0];
7
- logosCartela = KT_Project.find.comps("Logotipos-cartela")[0];
8
- logo_out = KT_Project.find.comps("logo_out")[0];
9
- chyrons = KT_Project.find.comps("chyrons")[0];
10
- //find comps named with only two digits
11
- lessons: CompItem[] = KT_Project.find.comps(/^\d{2}$/);
12
- init = () => {
13
- $.writeln("Dummy method to force transpilation");
14
- };
4
+ private config: KTSlidesFreezeConfig | null = null;
5
+
6
+ init(map: KTSlidesFreezeConfig) {
7
+ this.config = map;
8
+ }
9
+
15
10
  private frezzeExpression(property: Property) {
16
11
  if (property.canSetExpression && property.expressionEnabled) {
17
12
  const value = property.value;
@@ -26,27 +21,13 @@ class __KT_SlidesFreeze {
26
21
  }
27
22
  }
28
23
 
29
- private findProperties() {
30
- const properties: Property[] = [
31
- (this.courseTitle.layers.byName("titulo") as TextLayer).text.sourceText,
32
- (this.professorPastilla.layers.byName("profesor") as TextLayer).text.sourceText,
33
- (this.logosCartela.layers[1] as AVLayer).transform.opacity,
34
- (this.logosCartela.layers[2] as AVLayer).transform.opacity,
35
- (this.logo_in.layers[1] as AVLayer).transform.opacity,
36
- (this.logo_in.layers[2] as AVLayer).transform.opacity,
37
- (this.logo_out.layers[1] as AVLayer).transform.opacity,
38
- (this.logo_out.layers[2] as AVLayer).transform.opacity,
39
- (this.chyrons.layers.byName("profesor") as TextLayer).text.sourceText,
40
- (this.chyrons.layers.byName("titulo") as TextLayer).text.sourceText,
41
- (this.logo_out.layers.byName("logo-cat") as AVLayer).transform.opacity,
42
- (this.logo_out.layers.byName("logo-esp") as AVLayer).transform.opacity,
43
- ];
44
-
45
- this.lessons.forEach((comp) => {
46
- properties.push((comp.layers.byName("leccion") as TextLayer).text.sourceText);
47
- });
48
-
49
- return properties;
24
+ private findProperties(): Property[] {
25
+ if (!this.config) {
26
+ throw new Error(
27
+ "KT_SlidesFreeze: call init(map) before using freeze/unfreeze/checkFrozen",
28
+ );
29
+ }
30
+ return this.config.properties;
50
31
  }
51
32
 
52
33
  freeze() {
@@ -76,4 +57,5 @@ class __KT_SlidesFreeze {
76
57
  return allFrozen;
77
58
  }
78
59
  }
60
+
79
61
  export const KT_SlidesFreeze = new __KT_SlidesFreeze();
package/src/index.ts CHANGED
@@ -3,5 +3,14 @@ import { KT_ForproTools } from "./KT_ForproTools";
3
3
  import { KT_Slides } from "./slides";
4
4
  import { type KT_SlidesOptions } from "./slides";
5
5
  import { KT_SlidesFreeze } from "./freeze";
6
+ import { KTSlidesFreezeConfig, DefaultSlidesFreezeMap, OBMap } from "./maps";
6
7
 
7
- export { KT_ForproTools, KT_Slides, type KT_SlidesOptions, KT_SlidesFreeze };
8
+ export {
9
+ KT_ForproTools,
10
+ KT_Slides,
11
+ type KT_SlidesOptions,
12
+ KT_SlidesFreeze,
13
+ KTSlidesFreezeConfig,
14
+ DefaultSlidesFreezeMap,
15
+ OBMap,
16
+ };
@@ -0,0 +1,53 @@
1
+ import { KT_Project } from "kt-ae-tools-project";
2
+
3
+ export abstract class KTSlidesFreezeConfig {
4
+ abstract properties: Property[];
5
+ }
6
+
7
+ export class DefaultSlidesFreezeMap extends KTSlidesFreezeConfig {
8
+ properties: Property[] = [];
9
+ courseTitle = KT_Project.find.comps("titulo-curso")[0];
10
+ professorPastilla = KT_Project.find.comps("profesor-pastilla")[0];
11
+ logo_in = KT_Project.find.comps("Logotipo")[0];
12
+ logosCartela = KT_Project.find.comps("Logotipos-cartela")[0];
13
+ logo_out = KT_Project.find.comps("logo_out")[0];
14
+ chyrons = KT_Project.find.comps("chyrons")[0];
15
+ lessons: CompItem[] = KT_Project.find.comps(/^\d{2}$/);
16
+
17
+ constructor() {
18
+ super();
19
+ this.properties = [
20
+ (this.courseTitle.layers.byName("titulo") as TextLayer).text.sourceText,
21
+ (this.professorPastilla.layers.byName("profesor") as TextLayer).text.sourceText,
22
+ (this.logosCartela.layers[1] as AVLayer).transform.opacity,
23
+ (this.logosCartela.layers[2] as AVLayer).transform.opacity,
24
+ (this.logo_in.layers[1] as AVLayer).transform.opacity,
25
+ (this.logo_in.layers[2] as AVLayer).transform.opacity,
26
+ (this.logo_out.layers[1] as AVLayer).transform.opacity,
27
+ (this.logo_out.layers[2] as AVLayer).transform.opacity,
28
+ (this.chyrons.layers.byName("profesor") as TextLayer).text.sourceText,
29
+ (this.chyrons.layers.byName("titulo") as TextLayer).text.sourceText,
30
+ (this.logo_out.layers.byName("logo-cat") as AVLayer).transform.opacity,
31
+ (this.logo_out.layers.byName("logo-esp") as AVLayer).transform.opacity,
32
+ ];
33
+
34
+ this.lessons.forEach((comp) => {
35
+ this.properties.push((comp.layers.byName("leccion") as TextLayer).text.sourceText);
36
+ });
37
+ }
38
+ }
39
+
40
+ export class OBMap extends KTSlidesFreezeConfig {
41
+ properties: Property[] = [];
42
+ lesons: CompItem[] = KT_Project.find.comps(/^\d{2}$/);
43
+ chyrons: CompItem = KT_Project.find.comps("chyrons_base")[0];
44
+ constructor() {
45
+ super();
46
+ this.properties = [(this.chyrons.layers.byName("profesor") as TextLayer).text.sourceText];
47
+ this.lesons.forEach((comp) => {
48
+ this.properties.push((comp.layers.byName("profesor") as TextLayer).text.sourceText);
49
+ this.properties.push((comp.layers.byName("lesson-title") as TextLayer).text.sourceText);
50
+ this.properties.push((comp.layers.byName("course-title") as TextLayer).text.sourceText);
51
+ });
52
+ }
53
+ }
@@ -0,0 +1,14 @@
1
+ import { expect, describe, it } from "kt-testing-suite-core";
2
+ import { KT_SlidesFreeze } from "../index";
3
+ import { OBMap } from "../index";
4
+
5
+ describe("KTSlidesFreeze Tests", () => {
6
+ it("should initialize and freeze slides", () => {
7
+ const map = new OBMap();
8
+ KT_SlidesFreeze.init(map);
9
+ KT_SlidesFreeze.freeze();
10
+ expect(KT_SlidesFreeze.checkFrozen()).toBe(true);
11
+ KT_SlidesFreeze.unfreeze();
12
+ expect(KT_SlidesFreeze.checkFrozen()).toBe(false);
13
+ });
14
+ });
@@ -9,18 +9,14 @@ import {
9
9
  afterEach,
10
10
  } from "kt-testing-suite-core";
11
11
  import { KT_Slides, KT_ForproTools, KT_SlidesFreeze } from "../index";
12
-
12
+ import "./freezer.test";
13
13
  describe("KtForproTools Tests", () => {
14
14
  it("should import the slides module", () => {
15
15
  const duration = 30;
16
16
  const slideMultiplier = 16;
17
17
  const width = 3840;
18
18
  const height = 2160;
19
- KT_SlidesFreeze.init();
20
- KT_SlidesFreeze.freeze();
21
- expect(KT_SlidesFreeze.checkFrozen()).toBe(true);
22
- KT_SlidesFreeze.unfreeze();
23
- expect(KT_SlidesFreeze.checkFrozen()).toBe(false);
19
+
24
20
  // KT_ForproTools.Cleanup();
25
21
  // KT_ForproTools.utils.cleanNamePrecomp();
26
22
  // KT_ForproTools.utils.sendCleanupToMediaEncoder(["esp", "cat"]);