From 12faeb7866551ce0d7ec3b0b46ef3f47609ae491 Mon Sep 17 00:00:00 2001 From: emizzle Date: Mon, 6 Aug 2018 15:51:22 +1000 Subject: [PATCH] Swapped editor to Ace --- embark-ui/package-lock.json | 37 ++++++++++++++++++++++++++++++ embark-ui/package.json | 2 ++ embark-ui/public/index.html | 20 +++------------- embark-ui/src/components/Fiddle.js | 23 +++++++++++-------- package-lock.json | 15 ------------ 5 files changed, 55 insertions(+), 42 deletions(-) diff --git a/embark-ui/package-lock.json b/embark-ui/package-lock.json index 744ff594..b57f63d0 100644 --- a/embark-ui/package-lock.json +++ b/embark-ui/package-lock.json @@ -18,6 +18,11 @@ "negotiator": "0.6.1" } }, + "ace-mode-solidity": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ace-mode-solidity/-/ace-mode-solidity-0.1.0.tgz", + "integrity": "sha512-vLhygG5B0ImeDd/+L3vAB3aD3wQ5OE/+AYUD6dyOmvBc2G40K5mO/Lp7li+d04xpzO1LP82bQKN1N/I35K/wgg==" + }, "acorn": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", @@ -1440,6 +1445,11 @@ } } }, + "brace": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/brace/-/brace-0.11.1.tgz", + "integrity": "sha1-SJb8ydVE7vRfS7dmDbMg07N5/lg=" + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2686,6 +2696,11 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, + "diff-match-patch": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.1.tgz", + "integrity": "sha512-A0QEhr4PxGUMEtKxd6X+JLnOTFd3BfIPSDpsc4dMvj+CbSaErDwTpoTo/nFJDMSrjxLW4BiNq+FbNisAAHhWeQ==" + }, "diffie-hellman": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", @@ -6501,6 +6516,16 @@ "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" + }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -8831,6 +8856,18 @@ "prop-types": "^15.6.0" } }, + "react-ace": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/react-ace/-/react-ace-6.1.4.tgz", + "integrity": "sha512-a8/lAsy2bfi7Ho+3Kaj8hBPR+PEiCTG9xFG9LIjCJrv5WQFYFpeFTiPWA96M3t+LgIDFFltwfVTwD2pmdAVOxQ==", + "requires": { + "brace": "^0.11.0", + "diff-match-patch": "^1.0.0", + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.1.1", + "prop-types": "^15.5.8" + } + }, "react-dev-utils": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-5.0.1.tgz", diff --git a/embark-ui/package.json b/embark-ui/package.json index 27d4e9ee..6fc98aba 100644 --- a/embark-ui/package.json +++ b/embark-ui/package.json @@ -3,12 +3,14 @@ "version": "0.1.0", "private": true, "dependencies": { + "ace-mode-solidity": "^0.1.0", "axios": "^0.18.0", "classnames": "^2.2.6", "connected-react-router": "^4.3.0", "history": "^4.7.2", "prop-types": "^15.6.2", "react": "^16.4.1", + "react-ace": "^6.1.4", "react-dom": "^16.4.1", "react-redux": "^5.0.7", "react-router-dom": "^4.3.1", diff --git a/embark-ui/public/index.html b/embark-ui/public/index.html index b4e9f3a8..db40ed7b 100644 --- a/embark-ui/public/index.html +++ b/embark-ui/public/index.html @@ -1,9 +1,9 @@ - - - + + + - - diff --git a/embark-ui/src/components/Fiddle.js b/embark-ui/src/components/Fiddle.js index b364b416..8fd989af 100644 --- a/embark-ui/src/components/Fiddle.js +++ b/embark-ui/src/components/Fiddle.js @@ -1,5 +1,10 @@ import React from 'react'; -import MonacoEditor from 'react-monaco-editor'; +import AceEditor from 'react-ace'; + +import 'brace/mode/javascript'; + +import 'brace/theme/tomorrow_night_blue'; +import 'ace-mode-solidity/build/remix-ide/mode-solidity'; const Fiddle = ({code, options, editorDidMount, onChange}) => { options = options || { @@ -9,15 +14,13 @@ const Fiddle = ({code, options, editorDidMount, onChange}) => {

Fiddle

Play around with contract code and deploy against your running node.

- +
); }; diff --git a/package-lock.json b/package-lock.json index 52fda827..6c195ff7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -756,15 +756,6 @@ "@types/node": "*" } }, - "@types/react": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.4.7.tgz", - "integrity": "sha512-tHpSs7HMyjnpyfzka1G0pYh7rBNdpwGgcIDT4vfV6jUaR69yOHo/vNH2H+d9iYHo9xnX4qDe7UalPe9HiGRkLw==", - "dev": true, - "requires": { - "csstype": "^2.2.0" - } - }, "@types/semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz", @@ -6744,12 +6735,6 @@ "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.7.0.tgz", "integrity": "sha512-WlQNtUlzMRpvLHf8dqeUmNqfdPjGY29KrJF50Ldb4AcL+vQeR8QH3wQcFMgrhTwb1gHjZn9xggho+84tBskLgA==" }, - "monaco-editor": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.13.1.tgz", - "integrity": "sha512-0Kssg/O3cl1tXP0qAIxhrtMbRnzusFUEvFyt5/fpUbmuVeY3z+TnUx13+3kW16pgacFPXGUTEO/hOPlDeFU/dw==", - "dev": true - }, "mout": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mout/-/mout-1.1.0.tgz",