Merge branch 'master' into indexdbwfcircle

pull/5370/head
bunsenstraat 3 years ago committed by GitHub
commit 7018da0436
  1. 27
      .github/workflows/publish-action.yml
  2. 5
      apps/remix-ide/ci/publishIpfs
  3. 5
      apps/remix-ide/src/app.js
  4. 1
      apps/remix-ide/src/app/editor/editor.js
  5. 10
      apps/remix-ide/src/assets/css/themes/remix-black_undtds.css
  6. 8
      apps/remix-ide/src/assets/css/themes/remix-candy_ikhg4m.css
  7. 10
      apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css
  8. 4
      apps/remix-ide/src/assets/css/themes/remix-light_powaqg.css
  9. 6
      apps/remix-ide/src/assets/css/themes/remix-midcentury_hrzph3.css
  10. 12
      apps/remix-ide/webpack.config.js
  11. 1
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/assembly-items.tsx
  12. 53
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  13. 4
      libs/remix-ui/editor/src/lib/syntax.ts
  14. 2
      libs/remix-ui/workspace/src/lib/actions/workspace.ts
  15. 5
      package-lock.json
  16. 1
      package.json

@ -0,0 +1,27 @@
name: remix-publish-action
on:
pull_request:
types: [ labeled ]
jobs:
build:
if: ${{ github.event.label.name == 'publish' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: npm install
- run: ls
- run: pwd
- run: npm run downloadsolc_assets
- run: npm run build:production
- run: echo "action_state=$('./apps/remix-ide/ci/publishIpfs')" >> $GITHUB_ENV
- uses: mshick/add-pr-comment@v1
with:
message: |
ipfs://${{ env.action_state }}
https://ipfs.remixproject.org/ipfs/${{ env.action_state }}
https://gateway.ipfs.io/ipfs/${{ env.action_state }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: false # This is the default

@ -2,7 +2,6 @@
const IpfsHttpClient = require('ipfs-http-client')
const { globSource } = IpfsHttpClient
console.log('current folder', process.cwd())
const folder = process.cwd() + '/dist/apps/remix-ide';
(async () => {
@ -11,9 +10,7 @@ const folder = process.cwd() + '/dist/apps/remix-ide';
try {
let result = await ipfs.add(globSource(folder, { recursive: true}), { pin: false })
const hash = result.cid.toString()
console.log('ipfs://' + hash)
console.log('https://ipfs.remixproject.org/ipfs/' + hash)
console.log('https://gateway.ipfs.io/ipfs/' + hash)
console.log(hash)
} catch (e) {
console.log(e)
}

@ -498,11 +498,10 @@ class App {
}
}
}).catch(console.error)
} else {
// activate solidity plugin
appManager.activatePlugin(['solidity', 'udapp'])
}
})
// activate solidity plugin
appManager.activatePlugin(['solidity', 'udapp'])
// Load and start the service who manager layout and frame
const framingService = new FramingService(sidePanel, menuicons, mainview, this._components.resizeFeature)

@ -155,6 +155,7 @@ class Editor extends Plugin {
}
_switchSession (path) {
if (path === this.currentFile) return
this.triggerEvent('sessionSwitched', [])
this.currentFile = path
this.renderComponent()

@ -2,12 +2,12 @@
:root {
--blue: #28282D;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
--purple: #9e77f6;
--pink: #f38abb;
--red: #823a3a;
--orange: #8a5026;
--orange: #e46b15;
--yellow: #ffc107;
--green: #366a57;
--green: #065337;
--teal: #20c997;
--cyan: #053c64;
--white: #d5d5d5;
@ -17,7 +17,7 @@
--secondary: #3d3e44;
--success: #366a57;
--info: #086CB5;
--warning: #8a5026;
--warning: #c26829;
--danger: #823a3a;
--light: #1f2020;
--dark: #1a1a1a;

@ -5,8 +5,8 @@
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--green: #28a745;
--yellow: #cdae02;
--green: #0c8a29;
--teal: #20c997;
--cyan: #17a2b8;
--white: #fff;
@ -14,9 +14,9 @@
--gray-dark: #343a40;
--primary: #fc58a3;
--secondary: #e2f5f2;
--success: #84e5c2;
--success: #24b882;
--info: #69c7e9;
--warning: #fbdf9f;
--warning: #fabe33;
--danger: #f80b0b;
--light: #fff;
--dark: #645fb5;

@ -2,12 +2,12 @@
:root {
--blue: #007aa6;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
--purple: #9e77f6;
--pink: #f38abb;
--red: #b84040;
--orange: #c97539;
--orange: #e46b15;
--yellow: #ffc107;
--green: #32ba89;
--green: #219451;
--teal: #20c997;
--cyan: #355f7d;
--white: #fff;
@ -5651,7 +5651,7 @@ button.bg-success:hover {
background-color: #27926b !important;
}
.bg-info {
background-color: #355f7d !important;
background-color: #274458 !important;
}
a.bg-info:focus,
a.bg-info:hover,

@ -1,11 +1,11 @@
:root {
--blue: #007bff;
--indigo: #6610f2;
--purple: #d145a7;
--purple: #7c47b9;
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--yellow: #cdae02;
--green: #28a745;
--teal: #20c997;
--cyan: #17a2b8;

@ -4,8 +4,8 @@
--purple: #6f42c1;
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--orange: #fd7e17;
--yellow: #cdae02;
--green: #28a745;
--teal: #20c997;
--cyan: #17a2b8;
@ -16,7 +16,7 @@
--secondary: #e2f5f2;
--success: #01670f;
--info: #69c7e9;
--warning: #edc464;
--warning: #f5ba30;
--danger: #E64F29;
--light: #eeede9;
--dark: #01414E;

@ -1,5 +1,7 @@
const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = config => {
const nxWebpackConfig = nxWebpack(config)
@ -12,7 +14,15 @@ module.exports = config => {
net: 'empty',
module: 'empty',
child_process: 'empty'
}
},
plugins: [
...nxWebpackConfig.plugins,
new CopyWebpackPlugin({
patterns: [
{ from: "../../../node_modules/monaco-editor/dev/vs/", to: "assets/js/monaco-editor/dev/vs" },
].filter(Boolean)
})
]
}
if (process.env.NODE_ENV === 'production') {

@ -98,7 +98,6 @@ export const AssemblyItems = ({ registerEvent }) => {
const currentItem = codeView.children[index]
if (currentItem) {
currentItem.style.setProperty('border-color', 'var(--warning)')
currentItem.style.setProperty('border-style', 'dotted')
currentItem.setAttribute('selected', 'selected')
}

@ -1,7 +1,7 @@
import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line
import Editor from '@monaco-editor/react'
import Editor, { loader } from '@monaco-editor/react'
import { reducerActions, reducerListener, initialState } from './actions/editor'
import { language } from './syntax'
import { language, conf } from './syntax'
import './remix-ui-editor.css'
@ -44,6 +44,8 @@ type sourceMarkerMap = {
[key: string]: [sourceMarker];
}
loader.config({ paths: { vs: 'assets/js/monaco-editor/dev/vs' } })
/* eslint-disable-next-line */
export interface EditorUIProps {
activated: boolean
@ -102,8 +104,11 @@ export const EditorUI = (props: EditorUIProps) => {
const yellowColor = formatColor('--yellow')
const pinkColor = formatColor('--pink')
const locationColor = '#9e7e08'
const purpleColor = formatColor('--purple')
// const purpleColor = formatColor('--purple')
const dangerColor = formatColor('--danger')
const greenColor = formatColor('--green')
const orangeColor = formatColor('--orange')
const grayColor = formatColor('--gray')
monaco.editor.defineTheme(themeName, {
base: themeType,
@ -137,25 +142,23 @@ export const EditorUI = (props: EditorUIProps) => {
// specials
{ token: 'keyword.super', foreground: infoColor },
{ token: 'keyword.this', foreground: infoColor },
{ token: 'keyword.virtual', foreground: infoColor },
// for state variables
{ token: 'keyword.constants', foreground: warningColor },
{ token: 'keyword.override', foreground: warningColor },
{ token: 'keyword.immutable', foreground: warningColor },
{ token: 'keyword.constants', foreground: grayColor },
{ token: 'keyword.override', foreground: grayColor },
{ token: 'keyword.immutable', foreground: grayColor },
// data location
{ token: 'keyword.memory', foreground: locationColor },
{ token: 'keyword.storage', foreground: locationColor },
{ token: 'keyword.calldata', foreground: locationColor },
// // forf functions and modifiers
{ token: 'keyword.virtual', foreground: purpleColor },
// // for Events
// for Events
{ token: 'keyword.indexed', foreground: yellowColor },
{ token: 'keyword.anonymous', foreground: yellowColor },
// // for functions
// for functions
{ token: 'keyword.external', foreground: successColor },
{ token: 'keyword.internal', foreground: successColor },
{ token: 'keyword.private', foreground: successColor },
@ -172,7 +175,26 @@ export const EditorUI = (props: EditorUIProps) => {
// special functions
{ token: 'keyword.fallback', foreground: pinkColor },
{ token: 'keyword.receive', foreground: pinkColor },
{ token: 'keyword.constructor', foreground: pinkColor }
{ token: 'keyword.constructor', foreground: pinkColor },
// identifiers
{ token: 'keyword.identifier', foreground: warningColor },
{ token: 'keyword.for', foreground: warningColor },
{ token: 'keyword.break', foreground: warningColor },
{ token: 'keyword.continue', foreground: warningColor },
{ token: 'keyword.while', foreground: warningColor },
{ token: 'keyword.do', foreground: warningColor },
{ token: 'keyword.if', foreground: yellowColor },
{ token: 'keyword.else', foreground: yellowColor },
{ token: 'keyword.throw', foreground: orangeColor },
{ token: 'keyword.catch', foreground: orangeColor },
{ token: 'keyword.try', foreground: orangeColor },
// returns
{ token: 'keyword.returns', foreground: greenColor },
{ token: 'keyword.return', foreground: greenColor }
],
colors: {
@ -288,7 +310,7 @@ export const EditorUI = (props: EditorUIProps) => {
props.editorAPI.getFontSize = () => {
if (!editorRef.current) return
return editorRef.current.getOption(42).fontSize
return editorRef.current.getOption(43).fontSize
}
(window as any).addRemixBreakpoint = (position) => { // make it available from e2e testing...
@ -329,10 +351,10 @@ export const EditorUI = (props: EditorUIProps) => {
}
})
editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_EQUAL, () => {
editor.updateOptions({ fontSize: editor.getOption(42).fontSize + 1 })
editor.updateOptions({ fontSize: editor.getOption(43).fontSize + 1 })
})
editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_MINUS, () => {
editor.updateOptions({ fontSize: editor.getOption(42).fontSize - 1 })
editor.updateOptions({ fontSize: editor.getOption(43).fontSize - 1 })
})
}
@ -342,6 +364,7 @@ export const EditorUI = (props: EditorUIProps) => {
monacoRef.current.languages.register({ id: 'remix-solidity' })
// Register a tokens provider for the language
monacoRef.current.languages.setMonarchTokensProvider('remix-solidity', language)
monacoRef.current.languages.setLanguageConfiguration('remix-solidity', conf)
}
return (

@ -12,6 +12,7 @@ export const conf = {
],
autoClosingPairs: [
{ open: '"', close: '"', notIn: ['string', 'comment'] },
{ open: "'", close: "'", notIn: ['string', 'comment'] },
{ open: '{', close: '}', notIn: ['string', 'comment'] },
{ open: '[', close: ']', notIn: ['string', 'comment'] },
{ open: '(', close: ')', notIn: ['string', 'comment'] }
@ -1224,7 +1225,6 @@ export const language = {
'internal',
'indexed',
'anonymous',
'isOwner',
'view',
'pure',
'inherited',
@ -1269,8 +1269,6 @@ export const language = {
'if',
'else',
'for',
'else',
'for',
'while',
'do',
'break',

@ -223,7 +223,7 @@ export const switchToWorkspace = async (name: string) => {
} else {
const isActive = await plugin.call('manager', 'isActive', 'remixd')
if (isActive) plugin.call('manager', 'deactivatePlugin', 'remixd')
if (isActive) await plugin.call('manager', 'deactivatePlugin', 'remixd')
await plugin.fileProviders.workspace.setWorkspace(name)
await plugin.setWorkspace({ name, isLocalhost: false })
dispatch(setMode('browser'))

5
package-lock.json generated

@ -30338,6 +30338,11 @@
}
}
},
"monaco-editor": {
"version": "0.30.1",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.30.1.tgz",
"integrity": "sha512-B/y4+b2O5G2gjuxIFtCE2EkM17R2NM7/3F8x0qcPsqy4V83bitJTIO4TIeZpYlzu/xy6INiY/+84BEm6+7Cmzg=="
},
"morphdom": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/morphdom/-/morphdom-2.6.1.tgz",

@ -180,6 +180,7 @@
"jszip": "^3.6.0",
"latest-version": "^5.1.0",
"merge": "^2.1.1",
"monaco-editor": "^0.30.1",
"npm-install-version": "^6.0.2",
"react": "^17.0.2",
"react-beautiful-dnd": "^13.1.0",

Loading…
Cancel
Save