@media-quest/builder 0.0.22 → 0.0.23

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.
Files changed (56) hide show
  1. package/package.json +1 -1
  2. package/src/Builder-option.ts +66 -66
  3. package/src/Builder-page.spec.ts +320 -320
  4. package/src/Builder-page.ts +257 -257
  5. package/src/Builder-question.spec.ts +68 -68
  6. package/src/Builder-question.ts +101 -101
  7. package/src/Builder-schema.spec.ts +357 -306
  8. package/src/Builder-schema.ts +287 -254
  9. package/src/Builder-text.spec.ts +24 -24
  10. package/src/Builder-text.ts +57 -57
  11. package/src/BuilderMainImageDto.ts +7 -7
  12. package/src/BuilderMainText.ts +81 -81
  13. package/src/BuilderMainVideoDto.ts +10 -10
  14. package/src/BuilderObject.ts +61 -61
  15. package/src/BuilderTag.ts +97 -97
  16. package/src/builder-compiler.ts +14 -0
  17. package/src/codebook.ts +72 -72
  18. package/src/media-files.ts +28 -28
  19. package/src/primitives/page-prefix.ts +58 -58
  20. package/src/primitives/prefix.spec.ts +5 -5
  21. package/src/primitives/schema-prefix.ts +52 -52
  22. package/src/primitives/varID.ts +11 -11
  23. package/src/public-api.ts +3 -1
  24. package/src/rulebuilder/Builder-rule.spec.ts +322 -322
  25. package/src/rulebuilder/Builder-rule.ts +190 -190
  26. package/src/rulebuilder/RuleAction.ts +106 -106
  27. package/src/rulebuilder/RuleBuilder-test-utils.ts +316 -316
  28. package/src/rulebuilder/RuleInput.ts +44 -44
  29. package/src/rulebuilder/RuleVariable.ts +49 -49
  30. package/src/rulebuilder/SingleSelectItem.ts +135 -135
  31. package/src/rulebuilder/condition/Builder-condition-group.spec.ts +47 -47
  32. package/src/rulebuilder/condition/Builder-condition-group.ts +118 -118
  33. package/src/rulebuilder/condition/Builder-condition.spec.ts +195 -195
  34. package/src/rulebuilder/condition/Builder-condition.ts +208 -208
  35. package/src/rulebuilder/condition/Builder-operator.spec.ts +9 -9
  36. package/src/rulebuilder/condition/Builder-operator.ts +31 -31
  37. package/src/rulebuilder/index.ts +22 -22
  38. package/src/rulebuilder/jump-to-action-manager.ts +33 -33
  39. package/src/rulebuilder/multi-select-item.ts +73 -73
  40. package/src/rulebuilder/page-action-manager.ts +31 -31
  41. package/src/rulebuilder/rule2/Rule2.ts +211 -211
  42. package/src/rulebuilder/tag-action-manager.spec.ts +44 -44
  43. package/src/rulebuilder/tag-action-manager.ts +28 -28
  44. package/src/schema-config.ts +25 -25
  45. package/src/theme/AbstractThemeCompiler.ts +7 -7
  46. package/src/theme/IDefaultTheme.ts +226 -226
  47. package/src/theme/css-theme.ts +7 -7
  48. package/src/theme/default-theme-compiler.ts +358 -358
  49. package/src/theme/icon-urls.ts +29 -29
  50. package/src/theme/theme-utils.ts +57 -57
  51. package/src/theme/theme1.spec.ts +52 -52
  52. package/src/variable/mq-variable.spec.ts +91 -0
  53. package/src/{mq-variable.ts → variable/mq-variable.ts} +63 -61
  54. package/src/variable/sum-score-variable.ts +56 -0
  55. package/tsconfig.json +15 -15
  56. package/tsconfig.tsbuildinfo +1 -1
@@ -1,44 +1,44 @@
1
- import type { ExcludeByTagAction } from "./RuleAction";
2
- import { TagActionManager } from "./tag-action-manager";
3
-
4
- const opt = (tag: string): ExcludeByTagAction => {
5
- return { kind: "exclude-by-tag", tag, pageCount: 2, description: "" };
6
- };
7
-
8
- const t1 = opt("tag1");
9
- const t2 = opt("tag2");
10
- const t3 = opt("tag3");
11
- const t4 = opt("tag4");
12
- const t5 = opt("tag5");
13
- const t6 = opt("tag6");
14
- const allOptions = [t1, t2, t3, t4, t5, t6];
15
- describe("Builder Rule Tag ", () => {
16
- test("Can initialize ExcludeByTagCollection, and filter invalid tags.", () => {
17
- const collection = new TagActionManager(allOptions, [t1.tag, "__invalid__tag"]);
18
-
19
- expect(collection).toBeInstanceOf(TagActionManager);
20
- const initialTags = collection.getCurrentSelection();
21
- const initialTag0 = initialTags[0];
22
- expect(initialTag0).toBe(t1.tag);
23
- expect(collection.getCurrentSelection().length).toBe(1);
24
- });
25
-
26
- test("Will remove duplicate selections.", () => {
27
- const initialSelection = [t1.tag, t1.tag, t6.tag];
28
- const collection = new TagActionManager(allOptions, initialSelection);
29
-
30
- const initialTags = collection.getCurrentSelection();
31
- expect(initialTags[0]).toBe(t1.tag);
32
- expect(collection.getCurrentSelection().length).toBe(2);
33
- });
34
- test("Can update selection.", () => {
35
- const initialSelection = [t1.tag, t6.tag];
36
- const collection = new TagActionManager(allOptions, initialSelection);
37
-
38
- const initialTags = collection.getCurrentSelection();
39
- expect(initialTags[0]).toBe(t1.tag);
40
- expect(collection.getCurrentSelection().length).toBe(2);
41
- // collection.setTags([t1.tag, t2.tag, t3.tag]);
42
- // expect(collection.getTags().length).toBe(3);
43
- });
44
- });
1
+ import type { ExcludeByTagAction } from "./RuleAction";
2
+ import { TagActionManager } from "./tag-action-manager";
3
+
4
+ const opt = (tag: string): ExcludeByTagAction => {
5
+ return { kind: "exclude-by-tag", tag, pageCount: 2, description: "" };
6
+ };
7
+
8
+ const t1 = opt("tag1");
9
+ const t2 = opt("tag2");
10
+ const t3 = opt("tag3");
11
+ const t4 = opt("tag4");
12
+ const t5 = opt("tag5");
13
+ const t6 = opt("tag6");
14
+ const allOptions = [t1, t2, t3, t4, t5, t6];
15
+ describe("Builder Rule Tag ", () => {
16
+ test("Can initialize ExcludeByTagCollection, and filter invalid tags.", () => {
17
+ const collection = new TagActionManager(allOptions, [t1.tag, "__invalid__tag"]);
18
+
19
+ expect(collection).toBeInstanceOf(TagActionManager);
20
+ const initialTags = collection.getCurrentSelection();
21
+ const initialTag0 = initialTags[0];
22
+ expect(initialTag0).toBe(t1.tag);
23
+ expect(collection.getCurrentSelection().length).toBe(1);
24
+ });
25
+
26
+ test("Will remove duplicate selections.", () => {
27
+ const initialSelection = [t1.tag, t1.tag, t6.tag];
28
+ const collection = new TagActionManager(allOptions, initialSelection);
29
+
30
+ const initialTags = collection.getCurrentSelection();
31
+ expect(initialTags[0]).toBe(t1.tag);
32
+ expect(collection.getCurrentSelection().length).toBe(2);
33
+ });
34
+ test("Can update selection.", () => {
35
+ const initialSelection = [t1.tag, t6.tag];
36
+ const collection = new TagActionManager(allOptions, initialSelection);
37
+
38
+ const initialTags = collection.getCurrentSelection();
39
+ expect(initialTags[0]).toBe(t1.tag);
40
+ expect(collection.getCurrentSelection().length).toBe(2);
41
+ // collection.setTags([t1.tag, t2.tag, t3.tag]);
42
+ // expect(collection.getTags().length).toBe(3);
43
+ });
44
+ });
@@ -1,28 +1,28 @@
1
- import type { RuleInput } from "./RuleInput";
2
- import { ExcludeByTagSelectItem } from "./multi-select-item";
3
- import { ExcludeByTagAction } from "./RuleAction";
4
-
5
- export class TagActionManager {
6
- private readonly _initialSelection: Set<string>;
7
- readonly selectItems: ReadonlyArray<ExcludeByTagSelectItem>;
8
- constructor(
9
- readonly validOptions: RuleInput["_tagActions"],
10
- readonly initialSelection: ReadonlyArray<string>,
11
- ) {
12
- this._initialSelection = new Set([...initialSelection]);
13
- this.selectItems = validOptions.map((opt) => {
14
- const isSelected = this._initialSelection.has(opt.tag);
15
- return ExcludeByTagSelectItem.create(opt, isSelected);
16
- });
17
- }
18
- getCurrentSelection(): ReadonlyArray<string> {
19
- const selected = this.selectItems.filter((item) => item.isSelected).map((itm) => itm.data.tag);
20
- return selected;
21
- }
22
-
23
- getEngineActions(): ReadonlyArray<ExcludeByTagAction> {
24
- const selected = this.selectItems.filter((item) => item.isSelected);
25
- const tagActions = selected.map((s) => s.data);
26
- return [...tagActions];
27
- }
28
- }
1
+ import type { RuleInput } from "./RuleInput";
2
+ import { ExcludeByTagSelectItem } from "./multi-select-item";
3
+ import { ExcludeByTagAction } from "./RuleAction";
4
+
5
+ export class TagActionManager {
6
+ private readonly _initialSelection: Set<string>;
7
+ readonly selectItems: ReadonlyArray<ExcludeByTagSelectItem>;
8
+ constructor(
9
+ readonly validOptions: RuleInput["_tagActions"],
10
+ readonly initialSelection: ReadonlyArray<string>,
11
+ ) {
12
+ this._initialSelection = new Set([...initialSelection]);
13
+ this.selectItems = validOptions.map((opt) => {
14
+ const isSelected = this._initialSelection.has(opt.tag);
15
+ return ExcludeByTagSelectItem.create(opt, isSelected);
16
+ });
17
+ }
18
+ getCurrentSelection(): ReadonlyArray<string> {
19
+ const selected = this.selectItems.filter((item) => item.isSelected).map((itm) => itm.data.tag);
20
+ return selected;
21
+ }
22
+
23
+ getEngineActions(): ReadonlyArray<ExcludeByTagAction> {
24
+ const selected = this.selectItems.filter((item) => item.isSelected);
25
+ const tagActions = selected.map((s) => s.data);
26
+ return [...tagActions];
27
+ }
28
+ }
@@ -1,25 +1,25 @@
1
- import { PredefinedVariable } from "./mq-variable";
2
- import { BuilderSchemaDto } from "./Builder-schema";
3
-
4
- /**
5
- * This interface is ment to define all information that a schema-admin app
6
- * needs to generate a dynamic form for setting values for predefined variables.
7
- */
8
- export interface SchemaConfig {
9
- readonly schemaName: string;
10
- readonly schemaId: string;
11
- readonly schemaPrefix: string;
12
- readonly variables: ReadonlyArray<Readonly<PredefinedVariable>>;
13
- }
14
-
15
- export const SchemaConfig = {
16
- fromSchema: (schema: BuilderSchemaDto): SchemaConfig => {
17
- const variables = schema.predefinedVariables ?? [];
18
- return {
19
- schemaId: schema.id,
20
- schemaName: schema.name,
21
- schemaPrefix: schema.prefix,
22
- variables,
23
- };
24
- },
25
- } as const;
1
+ import { PredefinedVariable } from "./variable/mq-variable";
2
+ import { BuilderSchemaDto } from "./Builder-schema";
3
+
4
+ /**
5
+ * This interface is ment to define all information that a schema-admin app
6
+ * needs to generate a dynamic form for setting values for predefined variables.
7
+ */
8
+ export interface SchemaConfig {
9
+ readonly schemaName: string;
10
+ readonly schemaId: string;
11
+ readonly schemaPrefix: string;
12
+ readonly variables: ReadonlyArray<Readonly<PredefinedVariable>>;
13
+ }
14
+
15
+ export const SchemaConfig = {
16
+ fromSchema: (schema: BuilderSchemaDto): SchemaConfig => {
17
+ const variables = schema.predefinedVariables ?? [];
18
+ return {
19
+ schemaId: schema.id,
20
+ schemaName: schema.name,
21
+ schemaPrefix: schema.prefix,
22
+ variables,
23
+ };
24
+ },
25
+ } as const;
@@ -1,7 +1,7 @@
1
- import type { BuilderSchemaDto } from "../Builder-schema";
2
- import { SchemaDto } from "@media-quest/engine";
3
-
4
- export abstract class AbstractThemeCompiler<ThemeSchema> {
5
- protected constructor(protected readonly theme: ThemeSchema) {}
6
- abstract compile(schema: BuilderSchemaDto): SchemaDto;
7
- }
1
+ import type { BuilderSchemaDto } from "../Builder-schema";
2
+ import { SchemaDto } from "@media-quest/engine";
3
+
4
+ export abstract class AbstractThemeCompiler<ThemeSchema> {
5
+ protected constructor(protected readonly theme: ThemeSchema) {}
6
+ abstract compile(schema: BuilderSchemaDto): SchemaDto;
7
+ }
@@ -1,226 +1,226 @@
1
- import type { CssTheme } from "./css-theme";
2
- import { DStyle, DCss } from "@media-quest/engine";
3
- import { IconUrls } from "./icon-urls";
4
-
5
- type PStyle = Partial<DStyle>;
6
- export interface IDefaultTheme {
7
- name: string;
8
- image: { style: PStyle };
9
- videoPlayer: {
10
- playButton: {
11
- iconUrl: string;
12
- css: PStyle;
13
- cssDisabled: PStyle;
14
- cssEnabled: PStyle;
15
- };
16
- pauseButton: {
17
- iconUrl: string;
18
- css: PStyle;
19
- cssDisabled: PStyle;
20
- cssEnabled: PStyle;
21
- };
22
- videoElement: {
23
- css: PStyle;
24
- };
25
- };
26
- mainText: {
27
- noMedia: {
28
- text: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle };
29
- audio: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle };
30
- };
31
- withMedia: {
32
- text: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle };
33
- audio: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle };
34
- };
35
- };
36
- // mainTextTheme: BuilderTextTheme;
37
- responseButtons: BuilderOptionTheme;
38
- nextButtonTheme: BuilderOptionTheme;
39
- // mainQuestionText: BuilderTextTheme;
40
- // dontKnowButtonTheme: BuilderOptionTheme;
41
- buttonThemes?: Array<BuilderOptionTheme>;
42
- }
43
-
44
- export interface BuilderOptionTheme {
45
- name: string;
46
- normal: ButtonTheme;
47
- dontKnow: ButtonTheme;
48
- }
49
-
50
- interface ButtonTheme {
51
- btn: CssTheme;
52
- divider: PStyle;
53
- text1: PStyle;
54
- text2: PStyle;
55
- }
56
-
57
- namespace BuilderOptionTheme {
58
- const GREEN = "#70AD47";
59
- const YELLOW = "#FFC000";
60
- const ORANGE = "#F4902C";
61
- const RED = "#FF0000";
62
- const LIGHT_BLUE = "#42719C";
63
- const WHITE = "#ffffff";
64
- const BLUE = "#2F5597";
65
- const BTN_WIDTH = 18.5;
66
- const BTN_BORDER_WIDTH = 3;
67
- const BTN_BORDER_RADIUS = 10;
68
- const BTN_BORDER_STYLE: DStyle["borderStyle"] = "solid";
69
- const BTN_HEIGHT = 9.2;
70
- const BTN_SHORT_WIDTH = 13.7;
71
- const FONT_WEIGHT: DStyle["fontWeight"] = 600;
72
- const FONT_SIZE: DCss.Px["value"] = 35;
73
-
74
- export const blueButton = (): BuilderOptionTheme => {
75
- const optionTheme: BuilderOptionTheme = {
76
- name: "blue-button-theme",
77
- normal: {
78
- btn: {
79
- css: {
80
- backgroundColor: BLUE,
81
- borderColor: BLUE,
82
- textColor: WHITE,
83
- fontSize: { _unit: "px", value: FONT_SIZE },
84
- borderWidth: { _unit: "px", value: BTN_BORDER_WIDTH },
85
- borderStyle: BTN_BORDER_STYLE,
86
- borderRadius: { value: BTN_BORDER_RADIUS, _unit: "px" },
87
- padding: { _unit: "px", value: 40 },
88
- h: BTN_HEIGHT,
89
- w: BTN_WIDTH,
90
- x: 10,
91
- y: 8,
92
- textAlign: "center",
93
- },
94
- cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
95
- cssEnabled: { opacity: 1, cursor: "pointer" },
96
- },
97
- divider: {},
98
- text1: {
99
- y: 50,
100
- transform: "translate(0%, 50%)",
101
- textColor: WHITE,
102
- fontSize: { _unit: "px", value: FONT_SIZE },
103
- w: 84,
104
- x: 8,
105
- fontWeight: FONT_WEIGHT,
106
- textAlign: "center",
107
- },
108
- text2: {},
109
- },
110
-
111
- dontKnow: {
112
- btn: {
113
- css: {
114
- backgroundColor: WHITE,
115
- borderColor: LIGHT_BLUE,
116
- textColor: BLUE,
117
- fontSize: { _unit: "px", value: FONT_SIZE },
118
- borderWidth: { _unit: "px", value: BTN_BORDER_WIDTH },
119
- borderStyle: BTN_BORDER_STYLE,
120
- borderRadius: { value: BTN_BORDER_RADIUS, _unit: "px" },
121
- padding: { _unit: "px", value: 40 },
122
- h: BTN_HEIGHT,
123
- w: BTN_SHORT_WIDTH,
124
- x: 10,
125
- y: 8,
126
- textAlign: "center",
127
- },
128
- cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
129
- cssEnabled: { opacity: 1, cursor: "pointer" },
130
- },
131
- text1: {
132
- y: 50,
133
- transform: "translate(0%, 50%)",
134
- textColor: BLUE,
135
- fontSize: { _unit: "px", value: FONT_SIZE },
136
- w: 84,
137
- x: 8,
138
- fontWeight: FONT_WEIGHT,
139
- textAlign: "center",
140
- },
141
- text2: {},
142
- divider: {},
143
- },
144
- };
145
-
146
- return optionTheme;
147
- };
148
- }
149
-
150
- export const DefaultTheme: IDefaultTheme = {
151
- name: "default-theme",
152
- videoPlayer: {
153
- playButton: {
154
- iconUrl: IconUrls.playCircleRegular,
155
- css: { w: 5, h: 5, y: 48, x: 4 },
156
- cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
157
- cssEnabled: { opacity: 0.8, cursor: "pointer" },
158
- },
159
- pauseButton: {
160
- iconUrl: IconUrls.pauseSvg,
161
- css: { w: 5, h: 5, y: 48, x: 4 },
162
- cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
163
- cssEnabled: { opacity: 0.8, cursor: "pointer" },
164
- },
165
- videoElement: { css: { w: 100, h: 45, y: 55, x: 0 } },
166
- },
167
- image: { style: { h: 50, w: 100, x: 0 } },
168
- mainText: {
169
- noMedia: {
170
- text: {
171
- css: {
172
- w: 80,
173
- y: 65,
174
- x: 10,
175
- textAlign: "center",
176
- textColor: "black",
177
- fontSize: { _unit: "px", value: 40 },
178
- },
179
- cssDisabled: {},
180
- cssEnabled: {},
181
- },
182
- audio: {
183
- css: {
184
- h: 6,
185
- w: 6,
186
- x: 4,
187
- y: 32,
188
- cursor: "pointer",
189
- opacity: 0.8,
190
- visibility: "visible",
191
- },
192
- cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
193
- cssEnabled: { opacity: 0.8, cursor: "pointer" },
194
- },
195
- },
196
- withMedia: {
197
- text: {
198
- css: {
199
- w: 80,
200
- y: 27,
201
- x: 10,
202
- textAlign: "center",
203
- textColor: "black",
204
- fontSize: { _unit: "px", value: 30 },
205
- },
206
- cssDisabled: {},
207
- cssEnabled: {},
208
- },
209
- audio: {
210
- css: {
211
- h: 6,
212
- w: 6,
213
- x: 4,
214
- y: 32,
215
- cursor: "pointer",
216
- opacity: 0.8,
217
- visibility: "visible",
218
- },
219
- cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
220
- cssEnabled: { opacity: 0.8, cursor: "pointer" },
221
- },
222
- },
223
- },
224
- nextButtonTheme: BuilderOptionTheme.blueButton(),
225
- responseButtons: BuilderOptionTheme.blueButton(),
226
- };
1
+ import type { CssTheme } from "./css-theme";
2
+ import { DStyle, DCss } from "@media-quest/engine";
3
+ import { IconUrls } from "./icon-urls";
4
+
5
+ type PStyle = Partial<DStyle>;
6
+ export interface IDefaultTheme {
7
+ name: string;
8
+ image: { style: PStyle };
9
+ videoPlayer: {
10
+ playButton: {
11
+ iconUrl: string;
12
+ css: PStyle;
13
+ cssDisabled: PStyle;
14
+ cssEnabled: PStyle;
15
+ };
16
+ pauseButton: {
17
+ iconUrl: string;
18
+ css: PStyle;
19
+ cssDisabled: PStyle;
20
+ cssEnabled: PStyle;
21
+ };
22
+ videoElement: {
23
+ css: PStyle;
24
+ };
25
+ };
26
+ mainText: {
27
+ noMedia: {
28
+ text: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle };
29
+ audio: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle };
30
+ };
31
+ withMedia: {
32
+ text: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle };
33
+ audio: { css: PStyle; cssDisabled: PStyle; cssEnabled: PStyle };
34
+ };
35
+ };
36
+ // mainTextTheme: BuilderTextTheme;
37
+ responseButtons: BuilderOptionTheme;
38
+ nextButtonTheme: BuilderOptionTheme;
39
+ // mainQuestionText: BuilderTextTheme;
40
+ // dontKnowButtonTheme: BuilderOptionTheme;
41
+ buttonThemes?: Array<BuilderOptionTheme>;
42
+ }
43
+
44
+ export interface BuilderOptionTheme {
45
+ name: string;
46
+ normal: ButtonTheme;
47
+ dontKnow: ButtonTheme;
48
+ }
49
+
50
+ interface ButtonTheme {
51
+ btn: CssTheme;
52
+ divider: PStyle;
53
+ text1: PStyle;
54
+ text2: PStyle;
55
+ }
56
+
57
+ namespace BuilderOptionTheme {
58
+ const GREEN = "#70AD47";
59
+ const YELLOW = "#FFC000";
60
+ const ORANGE = "#F4902C";
61
+ const RED = "#FF0000";
62
+ const LIGHT_BLUE = "#42719C";
63
+ const WHITE = "#ffffff";
64
+ const BLUE = "#2F5597";
65
+ const BTN_WIDTH = 18.5;
66
+ const BTN_BORDER_WIDTH = 3;
67
+ const BTN_BORDER_RADIUS = 10;
68
+ const BTN_BORDER_STYLE: DStyle["borderStyle"] = "solid";
69
+ const BTN_HEIGHT = 9.2;
70
+ const BTN_SHORT_WIDTH = 13.7;
71
+ const FONT_WEIGHT: DStyle["fontWeight"] = 600;
72
+ const FONT_SIZE: DCss.Px["value"] = 35;
73
+
74
+ export const blueButton = (): BuilderOptionTheme => {
75
+ const optionTheme: BuilderOptionTheme = {
76
+ name: "blue-button-theme",
77
+ normal: {
78
+ btn: {
79
+ css: {
80
+ backgroundColor: BLUE,
81
+ borderColor: BLUE,
82
+ textColor: WHITE,
83
+ fontSize: { _unit: "px", value: FONT_SIZE },
84
+ borderWidth: { _unit: "px", value: BTN_BORDER_WIDTH },
85
+ borderStyle: BTN_BORDER_STYLE,
86
+ borderRadius: { value: BTN_BORDER_RADIUS, _unit: "px" },
87
+ padding: { _unit: "px", value: 40 },
88
+ h: BTN_HEIGHT,
89
+ w: BTN_WIDTH,
90
+ x: 10,
91
+ y: 8,
92
+ textAlign: "center",
93
+ },
94
+ cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
95
+ cssEnabled: { opacity: 1, cursor: "pointer" },
96
+ },
97
+ divider: {},
98
+ text1: {
99
+ y: 50,
100
+ transform: "translate(0%, 50%)",
101
+ textColor: WHITE,
102
+ fontSize: { _unit: "px", value: FONT_SIZE },
103
+ w: 84,
104
+ x: 8,
105
+ fontWeight: FONT_WEIGHT,
106
+ textAlign: "center",
107
+ },
108
+ text2: {},
109
+ },
110
+
111
+ dontKnow: {
112
+ btn: {
113
+ css: {
114
+ backgroundColor: WHITE,
115
+ borderColor: LIGHT_BLUE,
116
+ textColor: BLUE,
117
+ fontSize: { _unit: "px", value: FONT_SIZE },
118
+ borderWidth: { _unit: "px", value: BTN_BORDER_WIDTH },
119
+ borderStyle: BTN_BORDER_STYLE,
120
+ borderRadius: { value: BTN_BORDER_RADIUS, _unit: "px" },
121
+ padding: { _unit: "px", value: 40 },
122
+ h: BTN_HEIGHT,
123
+ w: BTN_SHORT_WIDTH,
124
+ x: 10,
125
+ y: 8,
126
+ textAlign: "center",
127
+ },
128
+ cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
129
+ cssEnabled: { opacity: 1, cursor: "pointer" },
130
+ },
131
+ text1: {
132
+ y: 50,
133
+ transform: "translate(0%, 50%)",
134
+ textColor: BLUE,
135
+ fontSize: { _unit: "px", value: FONT_SIZE },
136
+ w: 84,
137
+ x: 8,
138
+ fontWeight: FONT_WEIGHT,
139
+ textAlign: "center",
140
+ },
141
+ text2: {},
142
+ divider: {},
143
+ },
144
+ };
145
+
146
+ return optionTheme;
147
+ };
148
+ }
149
+
150
+ export const DefaultTheme: IDefaultTheme = {
151
+ name: "default-theme",
152
+ videoPlayer: {
153
+ playButton: {
154
+ iconUrl: IconUrls.playCircleRegular,
155
+ css: { w: 5, h: 5, y: 48, x: 4 },
156
+ cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
157
+ cssEnabled: { opacity: 0.8, cursor: "pointer" },
158
+ },
159
+ pauseButton: {
160
+ iconUrl: IconUrls.pauseSvg,
161
+ css: { w: 5, h: 5, y: 48, x: 4 },
162
+ cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
163
+ cssEnabled: { opacity: 0.8, cursor: "pointer" },
164
+ },
165
+ videoElement: { css: { w: 100, h: 45, y: 55, x: 0 } },
166
+ },
167
+ image: { style: { h: 50, w: 100, x: 0 } },
168
+ mainText: {
169
+ noMedia: {
170
+ text: {
171
+ css: {
172
+ w: 80,
173
+ y: 65,
174
+ x: 10,
175
+ textAlign: "center",
176
+ textColor: "black",
177
+ fontSize: { _unit: "px", value: 40 },
178
+ },
179
+ cssDisabled: {},
180
+ cssEnabled: {},
181
+ },
182
+ audio: {
183
+ css: {
184
+ h: 6,
185
+ w: 6,
186
+ x: 4,
187
+ y: 32,
188
+ cursor: "pointer",
189
+ opacity: 0.8,
190
+ visibility: "visible",
191
+ },
192
+ cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
193
+ cssEnabled: { opacity: 0.8, cursor: "pointer" },
194
+ },
195
+ },
196
+ withMedia: {
197
+ text: {
198
+ css: {
199
+ w: 80,
200
+ y: 27,
201
+ x: 10,
202
+ textAlign: "center",
203
+ textColor: "black",
204
+ fontSize: { _unit: "px", value: 30 },
205
+ },
206
+ cssDisabled: {},
207
+ cssEnabled: {},
208
+ },
209
+ audio: {
210
+ css: {
211
+ h: 6,
212
+ w: 6,
213
+ x: 4,
214
+ y: 32,
215
+ cursor: "pointer",
216
+ opacity: 0.8,
217
+ visibility: "visible",
218
+ },
219
+ cssDisabled: { opacity: 0.3, cursor: "not-allowed" },
220
+ cssEnabled: { opacity: 0.8, cursor: "pointer" },
221
+ },
222
+ },
223
+ },
224
+ nextButtonTheme: BuilderOptionTheme.blueButton(),
225
+ responseButtons: BuilderOptionTheme.blueButton(),
226
+ };