@testgorilla/tgo-coding-test 0.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.
Files changed (163) hide show
  1. package/.eslintrc.json +45 -0
  2. package/README.md +257 -0
  3. package/jest.config.ts +21 -0
  4. package/ng-package.json +14 -0
  5. package/package.json +33 -0
  6. package/project.json +36 -0
  7. package/src/assets/i18n/en.json +124 -0
  8. package/src/index.ts +30 -0
  9. package/src/lib/components/.gitkeep +0 -0
  10. package/src/lib/components/code-editor/code-editor.component.html +10 -0
  11. package/src/lib/components/code-editor/code-editor.component.scss +21 -0
  12. package/src/lib/components/code-editor/code-editor.component.spec.ts +136 -0
  13. package/src/lib/components/code-editor/code-editor.component.ts +369 -0
  14. package/src/lib/components/code-editor/code-editor.mocks.ts +28 -0
  15. package/src/lib/components/code-editor/code-editor.service.spec.ts +160 -0
  16. package/src/lib/components/code-editor/code-editor.service.ts +94 -0
  17. package/src/lib/components/code-editor/helpers/c-helper.spec.ts +39 -0
  18. package/src/lib/components/code-editor/helpers/c-helper.ts +51 -0
  19. package/src/lib/components/code-editor/helpers/code-editor-helper.base.spec.ts +30 -0
  20. package/src/lib/components/code-editor/helpers/code-editor-helper.base.ts +16 -0
  21. package/src/lib/components/code-editor/helpers/code-editor-helper.mocks.ts +24 -0
  22. package/src/lib/components/code-editor/helpers/code-editor-helper.model.ts +67 -0
  23. package/src/lib/components/code-editor/helpers/cpp-helper.spec.ts +40 -0
  24. package/src/lib/components/code-editor/helpers/cpp-helper.ts +52 -0
  25. package/src/lib/components/code-editor/helpers/csharp-helper.spec.ts +42 -0
  26. package/src/lib/components/code-editor/helpers/csharp-helper.ts +55 -0
  27. package/src/lib/components/code-editor/helpers/go-helper.spec.ts +41 -0
  28. package/src/lib/components/code-editor/helpers/go-helper.ts +54 -0
  29. package/src/lib/components/code-editor/helpers/index.ts +15 -0
  30. package/src/lib/components/code-editor/helpers/java-helper.spec.ts +41 -0
  31. package/src/lib/components/code-editor/helpers/java-helper.ts +54 -0
  32. package/src/lib/components/code-editor/helpers/javascript-helper.spec.ts +39 -0
  33. package/src/lib/components/code-editor/helpers/javascript-helper.ts +32 -0
  34. package/src/lib/components/code-editor/helpers/kotlin-helper.spec.ts +41 -0
  35. package/src/lib/components/code-editor/helpers/kotlin-helper.ts +54 -0
  36. package/src/lib/components/code-editor/helpers/php-helper.spec.ts +39 -0
  37. package/src/lib/components/code-editor/helpers/php-helper.ts +32 -0
  38. package/src/lib/components/code-editor/helpers/python-helper.spec.ts +39 -0
  39. package/src/lib/components/code-editor/helpers/python-helper.ts +32 -0
  40. package/src/lib/components/code-editor/helpers/r-helper.spec.ts +39 -0
  41. package/src/lib/components/code-editor/helpers/r-helper.ts +32 -0
  42. package/src/lib/components/code-editor/helpers/ruby-helper.spec.ts +39 -0
  43. package/src/lib/components/code-editor/helpers/ruby-helper.ts +32 -0
  44. package/src/lib/components/code-editor/helpers/scala-helper.spec.ts +41 -0
  45. package/src/lib/components/code-editor/helpers/scala-helper.ts +53 -0
  46. package/src/lib/components/code-editor/helpers/sql-helper.spec.ts +87 -0
  47. package/src/lib/components/code-editor/helpers/sql-helper.ts +44 -0
  48. package/src/lib/components/code-editor/helpers/swift-helper.spec.ts +40 -0
  49. package/src/lib/components/code-editor/helpers/swift-helper.ts +51 -0
  50. package/src/lib/components/code-editor/helpers/typescript-helper.spec.ts +40 -0
  51. package/src/lib/components/code-editor/helpers/typescript-helper.ts +52 -0
  52. package/src/lib/components/code-editor/models/code-editor.model.ts +9 -0
  53. package/src/lib/components/code-editor/models/coding-snapshot.model.ts +4 -0
  54. package/src/lib/components/coding-question/coding-question.component.html +78 -0
  55. package/src/lib/components/coding-question/coding-question.component.scss +76 -0
  56. package/src/lib/components/coding-question/coding-question.component.spec.ts +85 -0
  57. package/src/lib/components/coding-question/coding-question.component.ts +102 -0
  58. package/src/lib/components/coding-section/coding-section.component.html +82 -0
  59. package/src/lib/components/coding-section/coding-section.component.scss +64 -0
  60. package/src/lib/components/coding-section/coding-section.component.spec.ts +257 -0
  61. package/src/lib/components/coding-section/coding-section.component.ts +187 -0
  62. package/src/lib/components/coding-test.module.ts +124 -0
  63. package/src/lib/components/common/truncated-text/truncated-text.component.html +6 -0
  64. package/src/lib/components/common/truncated-text/truncated-text.component.scss +18 -0
  65. package/src/lib/components/common/truncated-text/truncated-text.component.spec.ts +84 -0
  66. package/src/lib/components/common/truncated-text/truncated-text.component.ts +37 -0
  67. package/src/lib/components/configurations/configurations.component.html +57 -0
  68. package/src/lib/components/configurations/configurations.component.scss +42 -0
  69. package/src/lib/components/configurations/configurations.component.spec.ts +186 -0
  70. package/src/lib/components/configurations/configurations.component.ts +98 -0
  71. package/src/lib/components/instructions/instructions.component.html +41 -0
  72. package/src/lib/components/instructions/instructions.component.scss +167 -0
  73. package/src/lib/components/instructions/instructions.component.spec.ts +106 -0
  74. package/src/lib/components/instructions/instructions.component.ts +138 -0
  75. package/src/lib/components/panel/panel.component.html +19 -0
  76. package/src/lib/components/panel/panel.component.scss +41 -0
  77. package/src/lib/components/panel/panel.component.spec.ts +40 -0
  78. package/src/lib/components/panel/panel.component.ts +34 -0
  79. package/src/lib/components/runnable-editor/runnable-editor.component.html +75 -0
  80. package/src/lib/components/runnable-editor/runnable-editor.component.scss +55 -0
  81. package/src/lib/components/runnable-editor/runnable-editor.component.spec.ts +124 -0
  82. package/src/lib/components/runnable-editor/runnable-editor.component.ts +155 -0
  83. package/src/lib/components/tests/test-cases/test-cases.component.html +135 -0
  84. package/src/lib/components/tests/test-cases/test-cases.component.scss +220 -0
  85. package/src/lib/components/tests/test-cases/test-cases.component.spec.ts +401 -0
  86. package/src/lib/components/tests/test-cases/test-cases.component.ts +205 -0
  87. package/src/lib/components/tests/test-cases-content/test-cases-content.component.html +94 -0
  88. package/src/lib/components/tests/test-cases-content/test-cases-content.component.scss +103 -0
  89. package/src/lib/components/tests/test-cases-content/test-cases-content.component.spec.ts +122 -0
  90. package/src/lib/components/tests/test-cases-content/test-cases-content.component.ts +102 -0
  91. package/src/lib/components/tests/test-cases-status/test-cases-status.component.html +16 -0
  92. package/src/lib/components/tests/test-cases-status/test-cases-status.component.scss +49 -0
  93. package/src/lib/components/tests/test-cases-status/test-cases-status.component.spec.ts +22 -0
  94. package/src/lib/components/tests/test-cases-status/test-cases-status.component.ts +18 -0
  95. package/src/lib/components/tests/test-results.component.html +119 -0
  96. package/src/lib/components/tests/test-results.component.scss +189 -0
  97. package/src/lib/components/tests/test-results.component.spec.ts +140 -0
  98. package/src/lib/components/tests/test-results.component.ts +98 -0
  99. package/src/lib/components/tgo-coding-test/tgo-coding-test.component.html +96 -0
  100. package/src/lib/components/tgo-coding-test/tgo-coding-test.component.scss +6 -0
  101. package/src/lib/components/tgo-coding-test/tgo-coding-test.component.spec.ts +599 -0
  102. package/src/lib/components/tgo-coding-test/tgo-coding-test.component.ts +279 -0
  103. package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.html +36 -0
  104. package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.scss +183 -0
  105. package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.spec.ts +883 -0
  106. package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.ts +575 -0
  107. package/src/lib/config/index.ts +3 -0
  108. package/src/lib/config/tgo-coding-test.config.ts +26 -0
  109. package/src/lib/config/tgo-coding-test.provider.ts +38 -0
  110. package/src/lib/config/tgo-coding-test.token.ts +21 -0
  111. package/src/lib/models/.gitkeep +0 -0
  112. package/src/lib/models/auto-saved-data.ts +51 -0
  113. package/src/lib/models/code-event.ts +17 -0
  114. package/src/lib/models/coderunner-execution-results.ts +58 -0
  115. package/src/lib/models/coding-lib.mocks.ts +246 -0
  116. package/src/lib/models/configs.ts +18 -0
  117. package/src/lib/models/language-change-action.ts +4 -0
  118. package/src/lib/models/lat-languages.ts +12 -0
  119. package/src/lib/models/mixpanel-events.ts +3 -0
  120. package/src/lib/models/mode.ts +5 -0
  121. package/src/lib/models/paste-data.ts +4 -0
  122. package/src/lib/models/programming-language.ts +9 -0
  123. package/src/lib/models/test-cases.ts +74 -0
  124. package/src/lib/models/theme.ts +5 -0
  125. package/src/lib/models/translations.ts +1 -0
  126. package/src/lib/models/view-mode.ts +6 -0
  127. package/src/lib/pipes/memoize-func.pipe.ts +34 -0
  128. package/src/lib/services/.gitkeep +0 -0
  129. package/src/lib/services/candidate-coding-test-services/candidature-api.service.spec.ts +40 -0
  130. package/src/lib/services/candidate-coding-test-services/candidature-api.service.ts +15 -0
  131. package/src/lib/services/candidate-coding-test-services/coderunner-api.service.spec.ts +134 -0
  132. package/src/lib/services/candidate-coding-test-services/coderunner-api.service.ts +105 -0
  133. package/src/lib/services/candidate-coding-test-services/coding-test-tour.service.spec.ts +161 -0
  134. package/src/lib/services/candidate-coding-test-services/coding-test-tour.service.ts +100 -0
  135. package/src/lib/services/candidate-coding-test-services/coding-test.service.spec.ts +1524 -0
  136. package/src/lib/services/candidate-coding-test-services/coding-test.service.ts +843 -0
  137. package/src/lib/services/candidate-coding-test-services/index.ts +4 -0
  138. package/src/lib/services/coding-test-config.service.ts +48 -0
  139. package/src/lib/services/configurations.service.mocks.ts +77 -0
  140. package/src/lib/services/configurations.service.spec.ts +79 -0
  141. package/src/lib/services/configurations.service.ts +111 -0
  142. package/src/lib/services/index.ts +0 -0
  143. package/src/lib/services/lib-coding-test.service.spec.ts +265 -0
  144. package/src/lib/services/lib-coding-test.service.ts +157 -0
  145. package/src/lib/services/local-storage.service.mocks.ts +22 -0
  146. package/src/lib/services/storage.service.spec.ts +1120 -0
  147. package/src/lib/services/storage.service.ts +729 -0
  148. package/src/lib/services/test-cases.service.spec.ts +53 -0
  149. package/src/lib/services/test-cases.service.ts +29 -0
  150. package/src/lib/services/theme.service.spec.ts +76 -0
  151. package/src/lib/services/theme.service.ts +34 -0
  152. package/src/lib/styles/mixins.scss +86 -0
  153. package/src/lib/styles/styles.scss +112 -0
  154. package/src/lib/styles/variables.scss +105 -0
  155. package/src/lib/utils/.gitkeep +0 -0
  156. package/src/lib/utils/additional-languages/erlang.ts +115 -0
  157. package/src/lib/utils/resize-element.ts +15 -0
  158. package/src/lib/utils/time-to-ms.util.ts +10 -0
  159. package/src/test-setup.ts +1 -0
  160. package/tsconfig.json +16 -0
  161. package/tsconfig.lib.json +12 -0
  162. package/tsconfig.lib.prod.json +9 -0
  163. package/tsconfig.spec.json +13 -0
@@ -0,0 +1,53 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { TestCasesService } from './test-cases.service';
4
+
5
+ describe('TestCasesService', () => {
6
+ let service: TestCasesService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(TestCasesService);
11
+ });
12
+
13
+ describe('when setActiveTestCase is called', () => {
14
+ it('should emit index to activeTestCaseIndex$', done => {
15
+ service.setActiveTestCase(3);
16
+
17
+ service.activeTestCaseIndex$.subscribe(index => {
18
+ expect(index).toBe(3);
19
+ done();
20
+ });
21
+ });
22
+ });
23
+
24
+ describe('when createTestCaseLocalId is called', () => {
25
+ it('should increment lastTestCaseLocalId by 1 and return it', () => {
26
+ service.createTestCaseLocalId();
27
+ const result = service.createTestCaseLocalId();
28
+
29
+ expect(result).toBe(2);
30
+ });
31
+ });
32
+
33
+ describe('when resetLastTestCaseLocalId is called', () => {
34
+ it('should reset lastTestCaseLocalId to 0', () => {
35
+ service.createTestCaseLocalId();
36
+ service.createTestCaseLocalId();
37
+ service.createTestCaseLocalId();
38
+
39
+ service.resetLastTestCaseLocalId();
40
+
41
+ expect(service.createTestCaseLocalId()).toBe(1);
42
+ });
43
+ });
44
+
45
+ describe('when updateTestCaseLocalId is called', () => {
46
+ it('should update lastTestCaseLocalId to passed value', () => {
47
+ const localId = 3;
48
+ service.updateTestCaseLocalId(localId);
49
+
50
+ expect(service.createTestCaseLocalId()).toBe(localId + 1);
51
+ });
52
+ });
53
+ });
@@ -0,0 +1,29 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+
4
+ @Injectable({
5
+ providedIn: 'root',
6
+ })
7
+ export class TestCasesService {
8
+ private lastTestCaseLocalId = 0;
9
+
10
+ private activeTestCaseIndexSubj$ = new BehaviorSubject<number | null>(0);
11
+ activeTestCaseIndex$ = this.activeTestCaseIndexSubj$.asObservable();
12
+
13
+ setActiveTestCase(index: number | null): void {
14
+ this.activeTestCaseIndexSubj$.next(index);
15
+ }
16
+
17
+ createTestCaseLocalId(): number {
18
+ this.lastTestCaseLocalId += 1;
19
+ return this.lastTestCaseLocalId;
20
+ }
21
+
22
+ updateTestCaseLocalId(value: number): void {
23
+ this.lastTestCaseLocalId = value;
24
+ }
25
+
26
+ resetLastTestCaseLocalId(): void {
27
+ this.lastTestCaseLocalId = 0;
28
+ }
29
+ }
@@ -0,0 +1,76 @@
1
+ import { ThemeService } from './theme.service';
2
+ import { LibCodingTestService } from './lib-coding-test.service';
3
+ import { Themes } from '../models/theme';
4
+ import { BehaviorSubject } from 'rxjs';
5
+ import { TestBed } from '@angular/core/testing';
6
+
7
+ describe('ThemeService', () => {
8
+ let service: ThemeService;
9
+ let libCodingTestServiceMock: Partial<LibCodingTestService>;
10
+ let themeSubject: BehaviorSubject<Themes>;
11
+
12
+ beforeEach(() => {
13
+ themeSubject = new BehaviorSubject<Themes>(Themes.Default);
14
+ libCodingTestServiceMock = {
15
+ themeChanged$: themeSubject.asObservable(),
16
+ };
17
+ TestBed.configureTestingModule({
18
+ providers: [ThemeService, { provide: LibCodingTestService, useValue: libCodingTestServiceMock }],
19
+ });
20
+ service = TestBed.inject(ThemeService);
21
+ });
22
+
23
+ describe('when theme is dark', () => {
24
+ describe('AND rebranded company color', () => {
25
+ it('should emit companyColor = PINK + themeSpecificColor = WHITE', done => {
26
+ service.companyColor = '#D410AA';
27
+ themeSubject.next(Themes.Dark);
28
+
29
+ service.themeColors$.subscribe(({ companyColor, themeSpecificColor }) => {
30
+ expect(companyColor).toBe('#D410AA');
31
+ expect(themeSpecificColor).toBe('#FFFFFF');
32
+ done();
33
+ });
34
+ });
35
+ });
36
+
37
+ describe('AND default company color', () => {
38
+ it('should emit companyColor + themeSpecificColor = TEAL', done => {
39
+ themeSubject.next(Themes.Dark);
40
+
41
+ service.themeColors$.subscribe(({ companyColor, themeSpecificColor }) => {
42
+ expect(companyColor).toBe('#46a997');
43
+ expect(themeSpecificColor).toBe('#46a997');
44
+ done();
45
+ });
46
+ });
47
+ });
48
+ });
49
+
50
+ describe('when theme is light', () => {
51
+ describe('AND rebranded company color', () => {
52
+ it('should emit companyColor + themeSpecificColor = PINK', done => {
53
+ service.companyColor = '#D410AA';
54
+ themeSubject.next(Themes.Default);
55
+
56
+ service.themeColors$.subscribe(({ companyColor, themeSpecificColor }) => {
57
+ expect(companyColor).toBe('#D410AA');
58
+ expect(themeSpecificColor).toBe('#D410AA');
59
+ done();
60
+ });
61
+ });
62
+ });
63
+
64
+ describe('AND default company color', () => {
65
+ it('should emit companyColor + themeSpecificColor = TEAL', done => {
66
+ themeSubject.next(Themes.Default);
67
+
68
+ service.themeColors$.subscribe(({ companyColor, themeSpecificColor }) => {
69
+ expect(companyColor).toBe('#46a997');
70
+ expect(themeSpecificColor).toBe('#46a997');
71
+ done();
72
+ });
73
+ });
74
+ });
75
+ });
76
+ });
@@ -0,0 +1,34 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { LibCodingTestService } from './lib-coding-test.service';
3
+ import { Themes } from '../models/theme';
4
+ import { BehaviorSubject, combineLatest, map } from 'rxjs';
5
+
6
+ @Injectable({
7
+ providedIn: 'root',
8
+ })
9
+ export class ThemeService {
10
+ private defaultCompanyColor = '#46a997';
11
+ private companyColorSubject = new BehaviorSubject<string>(this.defaultCompanyColor);
12
+ private themeSubject = new BehaviorSubject<Themes>(Themes.Default);
13
+
14
+ themeColors$ = combineLatest([this.themeSubject, this.companyColorSubject]).pipe(
15
+ map(([theme, companyColor]) => {
16
+ const themeSpecificColor = this.getAdjustedColorForTheme(theme, companyColor);
17
+ return { companyColor, themeSpecificColor };
18
+ })
19
+ );
20
+
21
+ constructor(private libCodingService: LibCodingTestService) {
22
+ this.libCodingService.themeChanged$.subscribe(theme => {
23
+ this.themeSubject.next(theme);
24
+ });
25
+ }
26
+
27
+ set companyColor(color: string) {
28
+ this.companyColorSubject.next(color);
29
+ }
30
+
31
+ private getAdjustedColorForTheme(theme: Themes, color: string): string {
32
+ return theme === Themes.Dark && color.toUpperCase() === '#D410AA' ? '#FFFFFF' : color;
33
+ }
34
+ }
@@ -0,0 +1,86 @@
1
+ @mixin as-split-styles() {
2
+ .as-split {
3
+ min-height: 500px;
4
+
5
+ ::ng-deep .as-split-gutter {
6
+ position: relative;
7
+ background-color: #D9D9D9 !important;
8
+ transition: background 200ms ease-in-out;
9
+
10
+ &-icon {
11
+ background-image: none !important;
12
+
13
+ position: absolute;
14
+ border-radius: 5px;
15
+ background: #D9D9D9;
16
+ transition: background 200ms ease-in-out;
17
+
18
+ &::before, &::after {
19
+ content: "";
20
+ position: absolute;
21
+ }
22
+ }
23
+
24
+ &:hover, &.as-dragged {
25
+ background-color: var(--company-color, #46A997) !important;
26
+
27
+ .as-split-gutter-icon {
28
+ background: var(--company-color, #46A997);
29
+ }
30
+ }
31
+ }
32
+
33
+ &.as-horizontal {
34
+ ::ng-deep > .as-split-gutter {
35
+ .as-split-gutter-icon {
36
+ height: 34px !important;
37
+ width: 12px !important;
38
+ z-index: 1;
39
+
40
+ &::before, &::after {
41
+ top: 9px;
42
+ bottom: 9px;
43
+ background-color: var(--bg-mat-card);
44
+ width: 2px;
45
+ border-radius: 5px;
46
+ }
47
+
48
+ &::before {
49
+ left: 2px;
50
+ }
51
+
52
+ &::after {
53
+ right: 2px;
54
+ }
55
+ }
56
+ }
57
+ }
58
+
59
+ &.as-vertical {
60
+ ::ng-deep > .as-split-gutter {
61
+ .as-split-gutter-icon {
62
+ height: 12px !important;
63
+ width: 34px !important;
64
+
65
+ &::before, &::after {
66
+ left: 9px;
67
+ right: 9px;
68
+ background-color: var(--bg-mat-card);
69
+ height: 2px;
70
+ width: auto;
71
+ border-radius: 5px;
72
+ }
73
+
74
+ &::before {
75
+ top: 2px;
76
+ }
77
+
78
+ &::after {
79
+ top: auto;
80
+ bottom: 2px;
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,112 @@
1
+ @import "@testgorilla/tgo-ui/projects/tgo-canopy-ui/theme/typography";
2
+ @import "@testgorilla/tgo-ui/projects/tgo-canopy-ui/theme/input";
3
+ @import "variables";
4
+
5
+ lib-coding-test .theme-default {
6
+ --page-bg: var(--color-accent-10);
7
+ --bg-mat-card: #ffffff;
8
+ --icon-bg-color: #323232;
9
+ --icon-bg-hover-color: #f6f6f6;
10
+ --icon-secondary-bg-color: #000000;
11
+ --petrol-text-color: #276678;
12
+ --status-bg-color: #f6f6f6;
13
+ --button-bg-color: #ededed;
14
+ --info-panel-color: #c8d7de;
15
+ --code-editor-background: #fffffe;
16
+ --select-chosen-text-color: #888888;
17
+ --select-chosen-bg-color: #e9f0f1;
18
+ --select-hovered-bg-color: rgba(0, 0, 0, 0.04);
19
+ --select-options-text-color: #000000;
20
+ --select-bg-color: #ffffff;
21
+ --select-bg-color-light: #ffffff;
22
+ --select-border-color: #eeeeee;
23
+ --select-border-color-light: rgba(0, 0, 0, 0.12);
24
+ --select-shadow-color: #cccccc;
25
+ --select-arrow-color: rgba(0, 0, 0, 0.54);
26
+ --drawer-bg-color: #ffffff;
27
+ --toggle-thumb-bg-color: #ffffff;
28
+ --toggle-body-bg-color: #ededed;
29
+ --main-text-color: rgba(0, 0, 0, 0.87);
30
+ --secondary-text-color: #000000;
31
+ --status-empty-color: #888888;
32
+ --border-bg-color: #e0e0e0;
33
+ --teal-disabled-color: #B5DDD5;
34
+ }
35
+
36
+ lib-coding-test .theme-dark {
37
+ --page-bg: #181818;
38
+ --bg-mat-card: #2d2d2d;
39
+ --icon-bg-color: #f6f6f6;
40
+ --icon-bg-hover-color: #1e1e1e;
41
+ --icon-secondary-bg-color: #f6f6f6;
42
+ --petrol-text-color: #6894A0;
43
+ --status-bg-color: #3c3c3c;
44
+ --button-bg-color: #2d2d2d;
45
+ --info-panel-color: #c8d7de;
46
+ --code-editor-background: #1e1e1e;
47
+ --select-chosen-text-color: #f6f6f6;
48
+ --select-chosen-bg-color: #2d2d2d;
49
+ --select-hovered-bg-color: rgba(45, 45, 45, 0.5);
50
+ --select-options-text-color: #f6f6f6;
51
+ --select-bg-color: #000000;
52
+ --select-bg-color-light: #2D2D2D;
53
+ --select-border-color: #2d2d2d;
54
+ --select-border-color-light: #888888;
55
+ --select-shadow-color: #2d2d2d;
56
+ --select-arrow-color: #ffffff;
57
+ --drawer-bg-color: #181818;
58
+ --toggle-thumb-bg-color: #000000;
59
+ --toggle-body-bg-color: #888888;
60
+ --main-text-color: #ffffff;
61
+ --secondary-text-color: #ffffff;
62
+ --status-empty-color: #E0E0E0;
63
+ --border-bg-color: #888888;
64
+ --teal-disabled-color: #888888;
65
+ --mdc-plain-tooltip-supporting-text-color: #000000;
66
+
67
+ &.coding-question-fullscreen {
68
+ --bg-mat-card: #181818;
69
+ }
70
+ }
71
+
72
+ lib-coding-test {
73
+ .themed-button {
74
+ button:not(.tertiary) mat-icon svg {
75
+ color: var(--icon-bg-color);
76
+ fill: var(--icon-bg-color);
77
+ }
78
+
79
+ button.tertiary mat-icon svg {
80
+ color: var(--company-color, #46A997);
81
+ fill: var(--company-color, #46A997);
82
+ }
83
+
84
+ .button-wrapper {
85
+ .icon-button:hover,
86
+ .mdc-button:hover {
87
+ // needed temporarily until mat-themes are defined in the main app, so ui-button colors can be defined globally
88
+ background-color: var(--icon-bg-hover-color) !important;
89
+ }
90
+ }
91
+ }
92
+
93
+ // todo: remove when the ui-icon has these styles for mat-icon, not only svg
94
+ mat-icon.size-24 {
95
+ min-width: 24px;
96
+ min-height: 24px;
97
+ width: 24px;
98
+ height: 24px;
99
+ }
100
+
101
+ mat-icon.size-16 {
102
+ min-width: 16px;
103
+ min-height: 16px;
104
+ width: 16px;
105
+ height: 16px;
106
+ }
107
+
108
+ ui-toggle.config-toggle mat-icon {
109
+ width: auto;
110
+ height: auto;
111
+ }
112
+ }
@@ -0,0 +1,105 @@
1
+ /*
2
+ * COLORS
3
+ */
4
+ :root {
5
+ // Brand
6
+ --color-primary-10: #FFF2FC;
7
+ --color-primary-20: #FFE6FA;
8
+ --color-primary-30: #FFB3EE;
9
+ --color-primary-40: #FF54DA;
10
+ --color-primary-50: #D410AA;
11
+ --color-primary-60: #A90686;
12
+
13
+ // Accent
14
+ --color-accent-10: #FFFAF6;
15
+ --color-accent-20: #FFF5ED;
16
+
17
+ // Base
18
+ --color-black: #242424;
19
+ --color-black-opa-70: rgba(36, 36, 36, 0.70);
20
+ --color-white: #FFFFFF;
21
+
22
+ // Greyscale
23
+ --color-grey-10: #F4F4F4;
24
+ --color-grey-20: #E9E9E9;
25
+ --color-grey-30: #D3D3D3;
26
+ --color-grey-40: #919191;
27
+ --color-grey-50: #666666;
28
+
29
+ // Informative
30
+ --color-info-10: #D9E8FF;
31
+ --color-info-20: #99C1FE;
32
+ --color-info-30: #277CFD;
33
+ --color-info-40: #0165FC;
34
+ --color-info-50: #1447AA;
35
+
36
+ // Success
37
+ --color-success-10: #F5FAE3;
38
+ --color-success-20: #E2F4B3;
39
+ --color-success-30: #C6E866;
40
+ --color-success-40: #A0D90D;
41
+ --color-success-50: #88B901;
42
+
43
+ // Error
44
+ --color-error-10: #FFEAE6;
45
+ --color-error-20: #FFAC9A;
46
+ --color-error-30: #FF6E4F;
47
+ --color-error-40: #FF3003;
48
+ --color-error-50: #E02800;
49
+
50
+ // Warning
51
+ --color-warning-10: #FFF5E6;
52
+ --color-warning-20: #FFE1B3;
53
+ --color-warning-30: #FFC268;
54
+ --color-warning-40: #FF9A03;
55
+ --color-warning-50: #D07D00;
56
+ }
57
+ /*
58
+ * FONTS
59
+ */
60
+ :root {
61
+ --font-family-main: "Modern Gothic", sans-serif;
62
+ --font-h1: 900 40px/52px var(--font-family-main);
63
+ --font-h2: 900 24px/30px var(--font-family-main);
64
+ --font-h3: 700 20px/26px var(--font-family-main);
65
+ --font-h4: 700 16px/20px var(--font-family-main);
66
+ --font-h5: 700 14px/18px var(--font-family-main);
67
+ --font-body-large: 400 16px/24px var(--font-family-main);
68
+ --font-body-default: 400 14px/22px var(--font-family-main);
69
+ --font-body-small: 400 12px/16px var(--font-family-main);
70
+ --font-hyperlink-large: 500 16px/24px var(--font-family-main);
71
+ --font-hyperlink-default: 500 14px/22px var(--font-family-main);
72
+ --font-hyperlink-small: 500 12px/16px var(--font-family-main);
73
+ --font-button-label: 500 14px/1.4 var(--font-family-main);
74
+ --font-label: 400 14px/1.4 var(--font-family-main);
75
+ }
76
+ /*
77
+ * BORDER RADIUS
78
+ */
79
+ :root {
80
+ --border-radius-none: 0px;
81
+ --border-radius-small: 4px;
82
+ --border-radius-small-top: var(--border-radius-small) var(--border-radius-small) 0 0;
83
+ --border-radius-small-bottom: 0 0 var(--border-radius-small) var(--border-radius-small);
84
+ --border-radius-default: 10px;
85
+ --border-radius-default-top: var(--border-radius-default) var(--border-radius-default) 0 0;
86
+ --border-radius-default-bottom: 0 0 var(--border-radius-default) var(--border-radius-default);
87
+ --border-radius-large: 36px;
88
+ --border-radius-round: 50%;
89
+ --color-grey-border: #DDDDDD;
90
+ --color-grey-border-hover: #F6F6F6;
91
+ }
92
+ /*
93
+ * BOX-SHADOWS
94
+ */
95
+ :root {
96
+ --box-shadow-hover: 0px 4px 16px 0px rgba(36,36,36,0.08);
97
+ --box-shadow-card: 0px 4px 100px 0px rgba(36,36,36,0.04);
98
+ --box-shadow-notification: 0px 4px 16px 0px rgba(36,36,36,0.04);
99
+ }
100
+ /*
101
+ * OTHERS
102
+ */
103
+ :root {
104
+ --viewport-width: 1312px;
105
+ }
File without changes
@@ -0,0 +1,115 @@
1
+ export const erlangLanguage = {
2
+ // Define default token
3
+ defaultToken: '',
4
+
5
+ // Define keywords
6
+ keywords: [
7
+ 'after',
8
+ 'and',
9
+ 'andalso',
10
+ 'band',
11
+ 'begin',
12
+ 'bnot',
13
+ 'bor',
14
+ 'bsl',
15
+ 'bsr',
16
+ 'bxor',
17
+ 'case',
18
+ 'catch',
19
+ 'cond',
20
+ 'div',
21
+ 'end',
22
+ 'fun',
23
+ 'if',
24
+ 'let',
25
+ 'not',
26
+ 'of',
27
+ 'or',
28
+ 'orelse',
29
+ 'query',
30
+ 'receive',
31
+ 'rem',
32
+ 'try',
33
+ 'when',
34
+ 'xor',
35
+ 'define',
36
+ 'elif',
37
+ 'else',
38
+ 'endif',
39
+ 'error',
40
+ 'ifdef',
41
+ 'ifndef',
42
+ 'include',
43
+ 'include_lib',
44
+ 'undef',
45
+ ],
46
+
47
+ // Define type and function patterns
48
+ typeKeywords: [
49
+ 'atom',
50
+ 'binary',
51
+ 'bitstring',
52
+ 'boolean',
53
+ 'byte',
54
+ 'char',
55
+ 'float',
56
+ 'integer',
57
+ 'list',
58
+ 'number',
59
+ 'pid',
60
+ 'port',
61
+ 'reference',
62
+ 'term',
63
+ 'tuple',
64
+ ],
65
+
66
+ // Define operators
67
+ operators: ['+', '-', '*', '/', '>', '<', '=', '==', '/=', '=:=', '=/=', '=<', '=>', '&&', '||', '!'],
68
+
69
+ // Define symbols and delimiters
70
+ symbols: /[=><!~?:&|+\-*/^%]+/,
71
+
72
+ // The main tokenizer for Erlang
73
+ tokenizer: {
74
+ root: [
75
+ // Identifiers and keywords
76
+ [/[a-z][\w$]*/, { cases: { '@keywords': 'keyword', '@default': 'identifier' } }],
77
+ [/[A-Z][\w$]*/, 'type.identifier'], // to handle the type and module names
78
+
79
+ // Whitespace
80
+ { include: '@whitespace' },
81
+
82
+ // Delimiters and operators
83
+ [/[{}()[\]\\]]/, '@brackets'],
84
+ [/@symbols/, { cases: { '@operators': 'operator', '@default': '' } }],
85
+
86
+ // Numbers
87
+ [/\d+\.\d*([eE][-+]?\d+)?/, 'number.float'],
88
+ [/\d+/, 'number'],
89
+
90
+ // Strings
91
+ [/"/, { token: 'string', bracket: '@open', next: '@string' }],
92
+
93
+ // Atoms
94
+ [/'([^'\\]|\\.)*$/, 'string.invalid'], // non-terminated atom
95
+ [/'/, { token: 'string', bracket: '@open', next: '@atom' }],
96
+ ],
97
+
98
+ string: [
99
+ [/[^\\"]+/, 'string'],
100
+ [/\\./, 'string.escape'],
101
+ [/"/, { token: 'string', bracket: '@close', next: '@pop' }],
102
+ ],
103
+
104
+ atom: [
105
+ [/[^\\']+/, 'string'],
106
+ [/\\./, 'string.escape'],
107
+ [/'/, { token: 'string', bracket: '@close', next: '@pop' }],
108
+ ],
109
+
110
+ whitespace: [
111
+ [/[ \t\r\n]+/, 'white'],
112
+ [/%.*$/, 'comment'], // Single line comment
113
+ ],
114
+ },
115
+ };
@@ -0,0 +1,15 @@
1
+ import { Observable, Subscriber } from 'rxjs';
2
+
3
+ export function resizeElement(element: Element): Observable<ResizeObserverEntry> {
4
+ return new Observable((observer: Subscriber<ResizeObserverEntry>) => {
5
+ const resizeObserver = new ResizeObserver(([entry]) => {
6
+ observer.next(entry);
7
+ });
8
+
9
+ resizeObserver.observe(element);
10
+
11
+ return () => {
12
+ resizeObserver.disconnect();
13
+ };
14
+ });
15
+ }
@@ -0,0 +1,10 @@
1
+ export function timeToMs(time: number, type: 'days' | 'hours' = 'days'): number {
2
+ switch (type) {
3
+ case 'hours':
4
+ return time * 60 * 60 * 1000;
5
+ case 'days':
6
+ return time * 24 * 60 * 60 * 1000;
7
+ default:
8
+ throw new Error('Invalid type. Use "hours" or "days".');
9
+ }
10
+ }
@@ -0,0 +1 @@
1
+ import 'jest-preset-angular/setup-jest';
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2022"
4
+ },
5
+ "files": [],
6
+ "include": [],
7
+ "references": [
8
+ {
9
+ "path": "./tsconfig.lib.json"
10
+ },
11
+ {
12
+ "path": "./tsconfig.spec.json"
13
+ }
14
+ ],
15
+ "extends": "../../tsconfig.base.json"
16
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "inlineSources": true,
8
+ "types": []
9
+ },
10
+ "exclude": ["src/**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "src/**/*.test.ts"],
11
+ "include": ["src/**/*.ts"]
12
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.lib.json",
3
+ "compilerOptions": {
4
+ "declarationMap": false
5
+ },
6
+ "angularCompilerOptions": {
7
+ "compilationMode": "partial"
8
+ }
9
+ }