Merge branch 'master' into remixd_terminal

pull/1342/head
David Zagi 3 years ago committed by GitHub
commit a11ef97f20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/remix-ide/src/app.js
  2. 8
      apps/remix-ide/src/app/ui/landing-page/landing-page.js
  3. 5
      libs/remix-core-plugin/src/lib/compiler-content-imports.ts
  4. 12
      libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx
  5. 44
      package-lock.json
  6. 2
      package.json

@ -339,7 +339,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const hiddenPanel = new HiddenPanel() const hiddenPanel = new HiddenPanel()
const pluginManagerComponent = new PluginManagerComponent(appManager, engine) const pluginManagerComponent = new PluginManagerComponent(appManager, engine)
const filePanel = new FilePanel(appManager) const filePanel = new FilePanel(appManager)
const landingPage = new LandingPage(appManager, menuicons, fileManager, filePanel) const landingPage = new LandingPage(appManager, menuicons, fileManager, filePanel, contentImport)
const settings = new SettingsTab( const settings = new SettingsTab(
registry.get('config').api, registry.get('config').api,
editor, editor,

@ -1,7 +1,6 @@
import * as packageJson from '../../../../../../package.json' import * as packageJson from '../../../../../../package.json'
import { ViewPlugin } from '@remixproject/engine-web' import { ViewPlugin } from '@remixproject/engine-web'
import { migrateToWorkspace } from '../../../migrateFileSystem' import { migrateToWorkspace } from '../../../migrateFileSystem'
import { CompilerImports } from '@remix-project/core-plugin'
import JSZip from 'jszip' import JSZip from 'jszip'
const yo = require('yo-yo') const yo = require('yo-yo')
@ -119,11 +118,12 @@ const profile = {
} }
export class LandingPage extends ViewPlugin { export class LandingPage extends ViewPlugin {
constructor (appManager, verticalIcons, fileManager, filePanel) { constructor (appManager, verticalIcons, fileManager, filePanel, contentImport) {
super(profile) super(profile)
this.profile = profile this.profile = profile
this.fileManager = fileManager this.fileManager = fileManager
this.filePanel = filePanel this.filePanel = filePanel
this.contentImport = contentImport
this.appManager = appManager this.appManager = appManager
this.verticalIcons = verticalIcons this.verticalIcons = verticalIcons
this.gistHandler = new GistHandler() this.gistHandler = new GistHandler()
@ -240,7 +240,7 @@ export class LandingPage extends ViewPlugin {
render () { render () {
const load = (service, item, examples, info) => { const load = (service, item, examples, info) => {
const compilerImport = new CompilerImports() const contentImport = this.contentImport
const fileProviders = globalRegistry.get('fileproviders').api const fileProviders = globalRegistry.get('fileproviders').api
const msg = yo` const msg = yo`
<div class="p-2"> <div class="p-2">
@ -252,7 +252,7 @@ export class LandingPage extends ViewPlugin {
const title = `Import from ${service}` const title = `Import from ${service}`
modalDialogCustom.prompt(title, msg, null, (target) => { modalDialogCustom.prompt(title, msg, null, (target) => {
if (target !== '') { if (target !== '') {
compilerImport.import( contentImport.import(
target, target,
(loadingMsg) => { tooltip(loadingMsg) }, (loadingMsg) => { tooltip(loadingMsg) },
(error, content, cleanUrl, type, url) => { (error, content, cleanUrl, type, url) => {

@ -21,9 +21,14 @@ export class CompilerImports extends Plugin {
} }
async setToken () { async setToken () {
try {
const protocol = typeof window !== 'undefined' && window.location.protocol const protocol = typeof window !== 'undefined' && window.location.protocol
const token = await this.call('settings', 'get', 'settings/gist-access-token') const token = await this.call('settings', 'get', 'settings/gist-access-token')
this.urlResolver.setGistToken(token, protocol) this.urlResolver.setGistToken(token, protocol)
} catch (error) {
console.log(error)
}
} }
isRelativeImport (url) { isRelativeImport (url) {

@ -4,6 +4,13 @@ import { action, FileExplorerContextMenuProps } from './types'
import './css/file-explorer-context-menu.css' import './css/file-explorer-context-menu.css'
import { customAction } from '@remixproject/plugin-api/lib/file-system/file-panel' import { customAction } from '@remixproject/plugin-api/lib/file-system/file-panel'
declare global {
interface Window {
_paq: any
}
}
const _paq = window._paq = window._paq || [] //eslint-disable-line
export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => { export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => {
const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, pushChangesToGist, publishFileToGist, publishFolderToGist, copy, paste, runScript, emit, pageX, pageY, path, type, focus, ...otherProps } = props const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, pushChangesToGist, publishFileToGist, publishFolderToGist, copy, paste, runScript, emit, pageX, pageY, path, type, focus, ...otherProps } = props
const contextMenuRef = useRef(null) const contextMenuRef = useRef(null)
@ -76,15 +83,19 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
deletePath(getPath()) deletePath(getPath())
break break
case 'Push changes to gist': case 'Push changes to gist':
_paq.push(['trackEvent', 'fileExplorer', 'pushToChangesoGist'])
pushChangesToGist(path, type) pushChangesToGist(path, type)
break break
case 'Publish folder to gist': case 'Publish folder to gist':
_paq.push(['trackEvent', 'fileExplorer', 'publishFolderToGist'])
publishFolderToGist(path, type) publishFolderToGist(path, type)
break break
case 'Publish file to gist': case 'Publish file to gist':
_paq.push(['trackEvent', 'fileExplorer', 'publishFileToGist'])
publishFileToGist(path, type) publishFileToGist(path, type)
break break
case 'Run': case 'Run':
_paq.push(['trackEvent', 'fileExplorer', 'runScript'])
runScript(path) runScript(path)
break break
case 'Copy': case 'Copy':
@ -97,6 +108,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
deletePath(getPath()) deletePath(getPath())
break break
default: default:
_paq.push(['trackEvent', 'fileExplorer', 'customAction', item.name])
emit && emit({ ...item, path: [path] } as customAction) emit && emit({ ...item, path: [path] } as customAction)
break break
} }

44
package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "remix-project", "name": "remix-project",
"version": "0.16.1", "version": "0.17.0-dev",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -11385,6 +11385,17 @@
} }
} }
}, },
"fsevents": {
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
"glob-parent": { "glob-parent": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
@ -12197,6 +12208,16 @@
"to-regex-range": "^2.1.0" "to-regex-range": "^2.1.0"
} }
}, },
"fsevents": {
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
"glob-parent": { "glob-parent": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
@ -17676,16 +17697,6 @@
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
}, },
"fsevents": {
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
"fstream": { "fstream": {
"version": "1.0.11", "version": "1.0.11",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
@ -30261,6 +30272,17 @@
} }
} }
}, },
"fsevents": {
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
"glob-parent": { "glob-parent": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",

@ -1,6 +1,6 @@
{ {
"name": "remix-project", "name": "remix-project",
"version": "0.16.1", "version": "0.17.0-dev",
"license": "MIT", "license": "MIT",
"description": "Ethereum Remix Monorepo", "description": "Ethereum Remix Monorepo",
"keywords": [ "keywords": [

Loading…
Cancel
Save