Skip to content

Commit 78ab1fc

Browse files
authored
Fix: Migrating every theme to TypeScript. (#2474)
* Dark theme to typescript * Theme deuteranopia to typescript * Theme hackermode to typescript * Theme highcontrast to typescript * Theme modern to typescript * Theme tritanopia to typescript * Make eslink happy + Prettier on every theme :p * fix: Removed all self-dependcies * chores: Reverting to coloour_block * fix(themes): Fixed every theme with non-camelcase names. * chores(package.json): Reverted all commits for package.json and package-lock.json
1 parent 99940c3 commit 78ab1fc

File tree

12 files changed

+206
-106
lines changed

12 files changed

+206
-106
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import * as Blockly from 'blockly/core';
1414
* Dark theme.
1515
*/
1616
export default Blockly.Theme.defineTheme('dark', {
17+
name: 'dark',
1718
base: Blockly.Themes.Classic,
1819
componentStyles: {
1920
workspaceBackgroundColour: '#1e1e1e',
20-
toolboxBackgroundColour: 'blackBackground',
21+
toolboxBackgroundColour: '#333',
2122
toolboxForegroundColour: '#fff',
2223
flyoutBackgroundColour: '#252526',
2324
flyoutForegroundColour: '#ccc',
@@ -27,6 +28,5 @@ export default Blockly.Theme.defineTheme('dark', {
2728
insertionMarkerOpacity: 0.3,
2829
scrollbarOpacity: 0.4,
2930
cursorColour: '#d0d0d0',
30-
blackBackground: '#333',
3131
},
3232
});

plugins/theme-dark/tsconfig.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"outDir": "dist",
5+
"declaration": true,
6+
"declarationMap": true,
7+
"sourceMap": true,
8+
"module": "es2015",
9+
"moduleResolution": "bundler",
10+
"target": "es6",
11+
"strict": true
12+
},
13+
// NOTE: `test/**/*` is automatically included in `blockly-scripts start`.
14+
// Only src matters for production builds.
15+
"include": ["src"]
16+
}
Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,79 +11,79 @@
1111
import * as Blockly from 'blockly/core';
1212

1313
const defaultBlockStyles = {
14-
colour_blocks: {
14+
colour_blocks: { // eslint-disable-line camelcase
1515
colourPrimary: '#f2a72c',
1616
colourSecondary: '#f1c172',
1717
colourTertiary: '#da921c',
1818
},
19-
list_blocks: {
19+
list_blocks: { // eslint-disable-line camelcase
2020
colourPrimary: '#7d65ab',
2121
colourSecondary: '#a88be0',
2222
colourTertiary: '#66518e',
2323
},
24-
logic_blocks: {
24+
logic_blocks: { // eslint-disable-line camelcase
2525
colourPrimary: '#9fd2f1',
2626
colourSecondary: '#c0e0f4',
2727
colourTertiary: '#74bae5',
2828
},
29-
loop_blocks: {
29+
loop_blocks: { // eslint-disable-line camelcase
3030
colourPrimary: '#795a07',
3131
colourSecondary: '#ac8726',
3232
colourTertiary: '#c4a03f',
3333
},
34-
math_blocks: {
34+
math_blocks: { // eslint-disable-line camelcase
3535
colourPrimary: '#e6da39',
3636
colourSecondary: '#f3ec8e',
3737
colourTertiary: '#f2eeb7',
3838
},
39-
procedure_blocks: {
39+
procedure_blocks: { // eslint-disable-line camelcase
4040
colourPrimary: '#590721',
4141
colourSecondary: '#8c475d',
4242
colourTertiary: '#885464',
4343
},
44-
text_blocks: {
44+
text_blocks: { // eslint-disable-line camelcase
4545
colourPrimary: '#058863',
4646
colourSecondary: '#5ecfaf',
4747
colourTertiary: '#04684c',
4848
},
49-
variable_blocks: {
49+
variable_blocks: { // eslint-disable-line camelcase
5050
colourPrimary: '#47025a',
5151
colourSecondary: '#820fa1',
5252
colourTertiary: '#8e579d',
5353
},
54-
variable_dynamic_blocks: {
54+
variable_dynamic_blocks: { // eslint-disable-line camelcase
5555
colourPrimary: '#47025a',
5656
colourSecondary: '#820fa1',
5757
colourTertiary: '#8e579d',
5858
},
5959
};
6060

6161
const categoryStyles = {
62-
colour_category: {
62+
colour_category: { // eslint-disable-line camelcase
6363
colour: '#f2a72c',
6464
},
65-
list_category: {
65+
list_category: { // eslint-disable-line camelcase
6666
colour: '#7d65ab',
6767
},
68-
logic_category: {
68+
logic_category: { // eslint-disable-line camelcase
6969
colour: '#9fd2f1',
7070
},
71-
loop_category: {
71+
loop_category: { // eslint-disable-line camelcase
7272
colour: '#795a07',
7373
},
74-
math_category: {
74+
math_category: { // eslint-disable-line camelcase
7575
colour: '#e6da39',
7676
},
77-
procedure_category: {
77+
procedure_category: { // eslint-disable-line camelcase
7878
colour: '#590721',
7979
},
80-
text_category: {
80+
text_category: { // eslint-disable-line camelcase
8181
colour: '#058863',
8282
},
83-
variable_category: {
83+
variable_category: { // eslint-disable-line camelcase
8484
colour: '#47025a',
8585
},
86-
variable_dynamic_category: {
86+
variable_dynamic_category: { // eslint-disable-line camelcase
8787
colour: '#47025a',
8888
},
8989
};
@@ -95,10 +95,11 @@ const categoryStyles = {
9595
* inability to perceive red light).
9696
*/
9797
export default Blockly.Theme.defineTheme('deuteranopia', {
98+
name: 'deuteranopia',
9899
base: Blockly.Themes.Classic,
99100
blockStyles: defaultBlockStyles,
100101
categoryStyles: categoryStyles,
101102
componentStyles: {},
102103
fontStyle: {},
103-
startHats: null,
104+
startHats: undefined,
104105
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"outDir": "dist",
5+
"declaration": true,
6+
"declarationMap": true,
7+
"sourceMap": true,
8+
"module": "es2015",
9+
"moduleResolution": "bundler",
10+
"target": "es6",
11+
"strict": true
12+
},
13+
// NOTE: `test/**/*` is automatically included in `blockly-scripts start`.
14+
// Only src matters for production builds.
15+
"include": ["src"]
16+
}
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,90 +12,91 @@
1212
import * as Blockly from 'blockly/core';
1313

1414
const defaultBlockStyles = {
15-
colour_blocks: {
15+
colour_blocks: { // eslint-disable-line camelcase
1616
colourPrimary: '#0c0d0d',
1717
colourSecondary: '#0c0d0d',
1818
colourTertiary: '#edf2f2',
1919
},
20-
list_blocks: {
20+
list_blocks: { // eslint-disable-line camelcase
2121
colourPrimary: '#0c0d0d',
2222
colourSecondary: '#0c0d0d',
2323
colourTertiary: '#edf2f2',
2424
},
25-
logic_blocks: {
25+
logic_blocks: { // eslint-disable-line camelcase
2626
colourPrimary: '#0c0d0d',
2727
colourSecondary: '#0c0d0d',
2828
colourTertiary: '#edf2f2',
2929
},
30-
loop_blocks: {
30+
loop_blocks: { // eslint-disable-line camelcase
3131
colourPrimary: '#0c0d0d',
3232
colourSecondary: '#0c0d0d',
3333
colourTertiary: '#edf2f2',
3434
},
35-
math_blocks: {
35+
math_blocks: { // eslint-disable-line camelcase
3636
colourPrimary: '#0c0d0d',
3737
colourSecondary: '#0c0d0d',
3838
colourTertiary: '#edf2f2',
3939
},
40-
procedure_blocks: {
40+
procedure_blocks: { // eslint-disable-line camelcase
4141
colourPrimary: '#0c0d0d',
4242
colourSecondary: '#0c0d0d',
4343
colourTertiary: '#edf2f2',
4444
},
45-
text_blocks: {
45+
text_blocks: { // eslint-disable-line camelcase
4646
colourPrimary: '#0c0d0d',
4747
colourSecondary: '#0c0d0d',
4848
colourTertiary: '#edf2f2',
4949
},
50-
variable_blocks: {
50+
variable_blocks: { // eslint-disable-line camelcase
5151
colourPrimary: '#0c0d0d',
5252
colourSecondary: '#0c0d0d',
5353
colourTertiary: '#edf2f2',
5454
},
55-
variable_dynamic_blocks: {
55+
variable_dynamic_blocks: { // eslint-disable-line camelcase
5656
colourPrimary: '#0c0d0d',
5757
colourSecondary: '#0c0d0d',
5858
colourTertiary: '#edf2f2',
5959
},
6060
};
6161

6262
const categoryStyles = {
63-
colour_category: {
63+
colour_category: { // eslint-disable-line camelcase
6464
colour: '#0c0d0d',
6565
},
66-
list_category: {
66+
list_category: { // eslint-disable-line camelcase
6767
colour: '#0c0d0d',
6868
},
69-
logic_category: {
69+
logic_category: { // eslint-disable-line camelcase
7070
colour: '#0c0d0d',
7171
},
72-
loop_category: {
72+
loop_category: { // eslint-disable-line camelcase
7373
colour: '#0c0d0d',
7474
},
75-
math_category: {
75+
math_category: { // eslint-disable-line camelcase
7676
colour: '#0c0d0d',
7777
},
78-
procedure_category: {
78+
procedure_category: { // eslint-disable-line camelcase
7979
colour: '#0c0d0d',
8080
},
81-
text_category: {
81+
text_category: { // eslint-disable-line camelcase
8282
colour: '#0c0d0d',
8383
},
84-
variable_category: {
84+
variable_category: { // eslint-disable-line camelcase
8585
colour: '#0c0d0d',
8686
},
87-
variable_dynamic_category: {
87+
variable_dynamic_category: { // eslint-disable-line camelcase
8888
colour: '#0c0d0d',
8989
},
9090
};
9191

9292
export default Blockly.Theme.defineTheme('hackermode', {
93+
name: 'hackermode',
9394
base: Blockly.Themes.Classic,
9495
blockStyles: defaultBlockStyles,
9596
categoryStyles: categoryStyles,
9697
componentStyles: {
9798
workspaceBackgroundColour: '#1e1e1e',
98-
toolboxBackgroundColour: 'blackBackground',
99+
toolboxBackgroundColour: '#333',
99100
toolboxForegroundColour: '#73ed58',
100101
flyoutBackgroundColour: '#252526',
101102
flyoutForegroundColour: '#73ed58',
@@ -105,12 +106,11 @@ export default Blockly.Theme.defineTheme('hackermode', {
105106
insertionMarkerOpacity: 0.3,
106107
scrollbarOpacity: 0.4,
107108
cursorColour: '#d0d0d0',
108-
blackBackground: '#333',
109109
},
110110
fontStyle: {
111111
family: 'monospace',
112-
weight: null,
113-
size: null,
112+
weight: undefined,
113+
size: undefined,
114114
},
115-
startHats: null,
115+
startHats: undefined,
116116
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"outDir": "dist",
5+
"declaration": true,
6+
"declarationMap": true,
7+
"sourceMap": true,
8+
"module": "es2015",
9+
"moduleResolution": "bundler",
10+
"target": "es6",
11+
"strict": true
12+
},
13+
// NOTE: `test/**/*` is automatically included in `blockly-scripts start`.
14+
// Only src matters for production builds.
15+
"include": ["src"]
16+
}

0 commit comments

Comments
 (0)