@media-quest/builder 0.0.39 → 0.0.41

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 (42) hide show
  1. package/dist/public-api.d.ts +82 -100
  2. package/dist/public-api.js +68 -128
  3. package/dist/public-api.js.map +1 -1
  4. package/package.json +29 -29
  5. package/src/{theme → ARKIV}/button-bar/button-text-utils.ts +233 -233
  6. package/src/{theme → ARKIV}/button-bar/text-utils.spec.ts +105 -105
  7. package/src/Builder-option.ts +77 -62
  8. package/src/Builder-question.spec.ts +1 -0
  9. package/src/Builder-question.ts +97 -98
  10. package/src/Builder-schema.spec.ts +348 -348
  11. package/src/Builder-schema.ts +308 -306
  12. package/src/builder-compiler.ts +14 -20
  13. package/src/code-book/codebook-variable.ts +27 -27
  14. package/src/code-book/codebook.ts +89 -89
  15. package/src/media-files.ts +28 -32
  16. package/src/page/Builder-page-collection.spec.ts +224 -219
  17. package/src/page/Builder-page-collection.ts +129 -129
  18. package/src/page/Builder-page.spec.ts +177 -177
  19. package/src/page/Builder-page.ts +250 -250
  20. package/src/primitives/ID.ts +135 -135
  21. package/src/public-api.ts +29 -30
  22. package/src/rulebuilder/RuleAction.ts +105 -105
  23. package/src/schema-config.ts +25 -26
  24. package/src/sum-score/sum-score-variable-collection.spec.ts +68 -68
  25. package/src/sum-score/sum-score-variable-collection.ts +101 -101
  26. package/src/sum-score/sum-score-variable.ts +0 -1
  27. package/src/sum-score/sum-score.ts +166 -167
  28. package/src/tag/BuilderTag.ts +45 -45
  29. package/src/tag/Tag-Collection.ts +53 -53
  30. package/src/theme/Default-theme.ts +173 -188
  31. package/src/theme/IDefault-theme.ts +124 -125
  32. package/src/theme/ThemeCompiler.ts +10 -11
  33. package/src/theme/default-theme-compiler.spec.ts +31 -31
  34. package/src/theme/default-theme-compiler.ts +660 -652
  35. package/src/theme/icon-urls.ts +29 -29
  36. package/src/theme/icons.ts +117 -117
  37. package/src/theme/theme-utils.spec.ts +52 -52
  38. package/src/theme/theme-utils.ts +56 -56
  39. package/src/theme/theme2.ts +399 -386
  40. package/tsconfig.json +19 -19
  41. package/src/Builder-schema-dto.spec.ts +0 -155
  42. package/src/Builder-schema-dto.ts +0 -86
@@ -1,31 +1,31 @@
1
- import { DefaultThemeCompiler } from "./default-theme-compiler";
2
- import { BuilderSchema } from "../Builder-schema";
3
- import { SchemaID } from "../primitives/ID";
4
- import { SchemaPrefix } from "../primitives/schema-prefix";
5
- import { Theme2 } from "./theme2";
6
-
7
- let builder = BuilderSchema.create(
8
- SchemaID.create(),
9
- "test-schema",
10
- SchemaPrefix.fromValueOrThrow("prefix").value,
11
- );
12
-
13
- beforeEach(() => {
14
- builder = BuilderSchema.create(
15
- SchemaID.create(),
16
- "test-schema",
17
- SchemaPrefix.fromValueOrThrow("prefix").value,
18
- );
19
- });
20
- describe("Default Theme compiler works", () => {
21
- test("Dimensions from theme is used.", () => {
22
- const compiler = new DefaultThemeCompiler();
23
- compiler.setTheme(Theme2);
24
- builder.baseHeight = 100;
25
- builder.baseWidth = 100;
26
-
27
- const compiledSchema = compiler.compile(builder.toJson());
28
- expect(compiledSchema.baseHeight).toBe(Theme2.dimensions.baseHeight);
29
- expect(compiledSchema.baseWidth).toBe(Theme2.dimensions.baseWidth);
30
- });
31
- });
1
+ import { DefaultThemeCompiler } from "./default-theme-compiler";
2
+ import { BuilderSchema } from "../Builder-schema";
3
+ import { SchemaID } from "../primitives/ID";
4
+ import { SchemaPrefix } from "../primitives/schema-prefix";
5
+ import { Theme2 } from "./theme2";
6
+
7
+ let builder = BuilderSchema.create(
8
+ SchemaID.create(),
9
+ "test-schema",
10
+ SchemaPrefix.fromValueOrThrow("prefix").value,
11
+ );
12
+
13
+ beforeEach(() => {
14
+ builder = BuilderSchema.create(
15
+ SchemaID.create(),
16
+ "test-schema",
17
+ SchemaPrefix.fromValueOrThrow("prefix").value,
18
+ );
19
+ });
20
+ describe("Default Theme compiler works", () => {
21
+ test("Dimensions from theme is used.", () => {
22
+ const compiler = new DefaultThemeCompiler();
23
+ compiler.setTheme(Theme2);
24
+ builder.baseHeight = 100;
25
+ builder.baseWidth = 100;
26
+
27
+ const compiledSchema = compiler.compile(builder.toJson());
28
+ expect(compiledSchema.baseHeight).toBe(Theme2.dimensions.baseHeight);
29
+ expect(compiledSchema.baseWidth).toBe(Theme2.dimensions.baseWidth);
30
+ });
31
+ });