diff --git a/package-lock.json b/package-lock.json index 479f19e0..127a7350 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8277,7 +8277,7 @@ } }, "node_modules/debug": { - "resolved": "https://github.com/ngokevin/debug.git#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a" + "resolved": "git+ssh://git@github.com/ngokevin/debug.git#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a" }, "node_modules/decamelize": { "version": "1.2.0", @@ -8771,7 +8771,7 @@ } }, "node_modules/document-register-element": { - "resolved": "https://github.com/dmarcos/document-register-element.git#8ccc532b7f3744be954574caf3072a5fd260ca90" + "resolved": "git+ssh://git@github.com/dmarcos/document-register-element.git#8ccc532b7f3744be954574caf3072a5fd260ca90" }, "node_modules/dom-converter": { "version": "0.2.0", @@ -25608,7 +25608,7 @@ }, "node_modules/three-bmfont-text": { "version": "2.4.0", - "resolved": "https://github.com/dmarcos/three-bmfont-text.git#21d017046216e318362c48abd1a48bddfb6e0733", + "resolved": "git+ssh://git@github.com/dmarcos/three-bmfont-text.git#21d017046216e318362c48abd1a48bddfb6e0733", "integrity": "sha512-lIMa1n+QKNU1f/LZgtS1oUGpoop3MuVXrUr5ybZOUR3+Jk//zjqScnQpHml6MWyvZzL8A5/1Hd8Tsqd3M1kudA==", "license": "MIT", "dependencies": { @@ -25623,7 +25623,7 @@ }, "node_modules/three-buffer-vertex-data": { "version": "1.1.0", - "resolved": "https://github.com/dmarcos/three-buffer-vertex-data.git#69378fc58daf27d3b1d930df9f233473e4a4818c", + "resolved": "git+ssh://git@github.com/dmarcos/three-buffer-vertex-data.git#69378fc58daf27d3b1d930df9f233473e4a4818c", "integrity": "sha512-ZPCCbGfueRzd2/YwH136UnVN+N11Mvxu7uPaEzIdtuk0m5HPs1LGXOM5hOkpxamjvqSC6MDJ3nd11grGi7sMKw==", "license": "MIT", "dependencies": { @@ -34724,7 +34724,7 @@ } }, "debug": { - "version": "https://github.com/ngokevin/debug.git#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a", + "version": "git+ssh://git@github.com/ngokevin/debug.git#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a", "from": "debug@github:ngokevin/debug#noTimestamp" }, "decamelize": { @@ -35129,7 +35129,7 @@ } }, "document-register-element": { - "version": "https://github.com/dmarcos/document-register-element.git#8ccc532b7f3744be954574caf3072a5fd260ca90", + "version": "git+ssh://git@github.com/dmarcos/document-register-element.git#8ccc532b7f3744be954574caf3072a5fd260ca90", "from": "document-register-element@github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90" }, "dom-converter": { @@ -48643,7 +48643,7 @@ "integrity": "sha512-eOEXnZeE1FDV0XgL1u08auIP13jxdN9LQBAEmlErYzMxtIIfuGIAZbijOyookALUhqVzVOx0Tywj6n192VM+nQ==" }, "three-bmfont-text": { - "version": "https://github.com/dmarcos/three-bmfont-text.git#21d017046216e318362c48abd1a48bddfb6e0733", + "version": "git+ssh://git@github.com/dmarcos/three-bmfont-text.git#21d017046216e318362c48abd1a48bddfb6e0733", "integrity": "sha512-lIMa1n+QKNU1f/LZgtS1oUGpoop3MuVXrUr5ybZOUR3+Jk//zjqScnQpHml6MWyvZzL8A5/1Hd8Tsqd3M1kudA==", "from": "three-bmfont-text@github:dmarcos/three-bmfont-text#21d017046216e318362c48abd1a48bddfb6e0733", "requires": { @@ -48657,7 +48657,7 @@ } }, "three-buffer-vertex-data": { - "version": "https://github.com/dmarcos/three-buffer-vertex-data.git#69378fc58daf27d3b1d930df9f233473e4a4818c", + "version": "git+ssh://git@github.com/dmarcos/three-buffer-vertex-data.git#69378fc58daf27d3b1d930df9f233473e4a4818c", "integrity": "sha512-ZPCCbGfueRzd2/YwH136UnVN+N11Mvxu7uPaEzIdtuk0m5HPs1LGXOM5hOkpxamjvqSC6MDJ3nd11grGi7sMKw==", "from": "three-buffer-vertex-data@dmarcos/three-buffer-vertex-data#69378fc58daf27d3b1d930df9f233473e4a4818c", "requires": { diff --git a/src/actions/userActions.js b/src/actions/userActions.js index 6c9be3ba..951d6437 100644 --- a/src/actions/userActions.js +++ b/src/actions/userActions.js @@ -6,6 +6,10 @@ export function updateFontSize(fontSize){ return{ type: types.UPDATE_FONT_SIZE, fontSize }; } +export function updateTheme(theme) { + return { type: types.UPDATE_THEME, theme }; +} + export function updateUserSettings(id,settings){ return ()=>{ if(id){ @@ -43,5 +47,6 @@ export default { updateFontSize, asyncUserSettings, syncUserSettings, - updateUserSettings + updateUserSettings, + updateTheme }; \ No newline at end of file diff --git a/src/components/editor/Editor.js b/src/components/editor/Editor.js index 842f512b..627bb1dd 100644 --- a/src/components/editor/Editor.js +++ b/src/components/editor/Editor.js @@ -2,6 +2,12 @@ import React, { Component } from "react"; import AceEditor from "react-ace"; import "brace/mode/javascript"; import "brace/theme/github"; +import "brace/theme/monokai"; +import "brace/theme/eclipse"; +import "brace/theme/xcode"; +import "brace/theme/dracula"; +import "brace/theme/gruvbox"; + import "brace/ext/searchbox"; import "brace/ext/language_tools"; @@ -10,6 +16,7 @@ import KeyboardShortcut from "./KeyboardShortcut.js"; import { browserType } from "../../utils/browserType"; import FontSize from "./FontSize.js"; import copy from "copy-to-clipboard"; +import ThemeSelector from "./Theme.js"; /** * Editor is a React Component that create the Ace Editor in the DOM. @@ -101,7 +108,8 @@ class Editor extends Component { name="ace-editor" // eslint-disable-next-line ref="aceEditor" - theme="github" + theme={this.props.settings.theme} + background="black" commands={[{ name: "copyLine", bindKey: {win: "Ctrl-L", mac: "Command-L"}, @@ -121,8 +129,13 @@ class Editor extends Component { enableLiveAutocompletion={true} onLoad={this.onLoad} /> - { browserType() === "desktop" ?