Merge branch 'newFEdesktop' of https://github.com/ethereum/remix-project into desktope2e

pull/4837/head
bunsenstraat 11 months ago
commit beede46799
  1. 1
      .gitignore
  2. 6
      apps/remixdesktop/package.json
  3. 4
      apps/remixdesktop/src/engine.ts
  4. 13
      apps/remixdesktop/src/menus/edit.ts
  5. 33
      apps/remixdesktop/src/menus/file.ts
  6. 4
      apps/remixdesktop/src/plugins/fsPlugin.ts
  7. 4
      libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx
  8. 2
      libs/remix-ui/search/src/lib/components/Search.tsx
  9. 1
      libs/remix-ui/workspace/src/lib/actions/workspace.ts
  10. 3
      libs/remix-ui/workspace/src/lib/components/flat-tree.tsx

1
.gitignore vendored

@ -64,3 +64,4 @@ apps/remixdesktop/release/
apps/remixdesktop/build*/ apps/remixdesktop/build*/
apps/remix-ide/src/assets/list.json apps/remix-ide/src/assets/list.json
apps/remix-ide/src/assets/esbuild.wasm apps/remix-ide/src/assets/esbuild.wasm
apps/remixdesktop/build*

@ -1,6 +1,6 @@
{ {
"name": "remixdesktop", "name": "remixdesktop",
"version": "0.0.8-Alpha", "version": "0.0.9-Alpha",
"main": "build/main.js", "main": "build/main.js",
"license": "MIT", "license": "MIT",
"type": "commonjs", "type": "commonjs",
@ -101,6 +101,7 @@
] ]
} }
], ],
"icon": "assets/icon.png",
"darkModeSupport": true "darkModeSupport": true
}, },
"dmg": { "dmg": {
@ -116,7 +117,8 @@
"win": { "win": {
"target": [ "target": [
"nsis" "nsis"
] ],
"icon": "assets/icon.png"
}, },
"linux": { "linux": {
"target": [ "target": [

@ -36,8 +36,8 @@ ipcMain.handle('manager:activatePlugin', async (event, plugin) => {
return await appManager.call(plugin, 'createClient', event.sender.id) return await appManager.call(plugin, 'createClient', event.sender.id)
}) })
ipcMain.on('fs:openFolder', async (event) => { ipcMain.on('fs:openFolder', async (event, path?) => {
fsPlugin.openFolder(event) fsPlugin.openFolder(event, path)
}) })

@ -33,19 +33,6 @@ export default (
}, },
]; ];
if (process.platform !== 'darwin') {
submenu.push(
{ type: 'separator' },
{
label: 'Preferences...',
accelerator: commandKeys['window:preferences'],
click() {
execCommand('window:preferences');
}
}
);
}
return { return {
label: 'Edit', label: 'Edit',
submenu submenu

@ -1,4 +1,22 @@
import { BrowserWindow, MenuItemConstructorOptions } from 'electron'; import { BrowserWindow, MenuItemConstructorOptions, app, ipcMain } from 'electron';
import fs from 'fs'
import os from 'os'
import path from 'path'
import { cacheDir } from '../utils/config';
let recentFolders: string[] = []
if (fs.existsSync(cacheDir + '/remixdesktop.json')) {
try {
// read the cache file
const cache = fs.readFileSync(cacheDir + '/remixdesktop.json')
const data = JSON.parse(cache.toString())
recentFolders = data && data.recentFolders || []
console.log('recentFolders', recentFolders)
} catch (e) {
}
}
export default ( export default (
commandKeys: Record<string, string>, commandKeys: Record<string, string>,
@ -31,11 +49,16 @@ export default (
}, },
{ {
role: 'recentDocuments', role: 'recentDocuments',
submenu: [ submenu: recentFolders.map((folder) => {
{ return {
role: 'clearRecentDocuments' label: folder,
click(item, focusedWindow) {
if(focusedWindow) {
ipcMain.emit('fs:openFolder', focusedWindow.webContents.id, folder);
}
}
} }
] })
}, },
{ {
role: 'close', role: 'close',

@ -76,10 +76,10 @@ export class FSPlugin extends ElectronBasePlugin {
} }
} }
openFolder(webContentsId: any): void { openFolder(webContentsId: any, path?: string): void {
const client = this.clients.find((c) => c.webContentsId === webContentsId) const client = this.clients.find((c) => c.webContentsId === webContentsId)
if (client) { if (client) {
client.openFolder() client.openFolder(path)
} }
} }
} }

@ -15,7 +15,9 @@ export function CustomTooltip({ children, placement, tooltipId, tooltipClasses,
return ( return (
(!hide ? ( (!hide ? (
<Fragment> <Fragment>
<OverlayTrigger overlay={ <OverlayTrigger
placement={placement}
overlay={
<Popover id={`popover-positioned-${placement}`}> <Popover id={`popover-positioned-${placement}`}>
<Popover.Content <Popover.Content
id={!tooltipId ? `${tooltipText}Tooltip` : tooltipId} id={!tooltipId ? `${tooltipText}Tooltip` : tooltipId}

@ -8,8 +8,6 @@ import {FindContainer} from './FindContainer'
import {Undo} from './Undo' import {Undo} from './Undo'
import { platformContext } from '@remix-ui/app' import { platformContext } from '@remix-ui/app'
export const SearchTab = (props) => { export const SearchTab = (props) => {
const plugin = props.plugin const plugin = props.plugin
const platform = useContext(platformContext) const platform = useContext(platformContext)

@ -88,7 +88,6 @@ export const setPlugin = (filePanelPlugin, reducerDispatch) => {
} }
}) })
plugin.on('fs', 'workingDirChanged', async (dir: string) => { plugin.on('fs', 'workingDirChanged', async (dir: string) => {
console.log('workingDirChanged', dir)
dispatch(setCurrentLocalFilePath(dir)) dispatch(setCurrentLocalFilePath(dir))
await checkGit() await checkGit()
}) })

@ -49,7 +49,6 @@ let mouseTimer: any = {
export const FlatTree = (props: FlatTreeProps) => { export const FlatTree = (props: FlatTreeProps) => {
const { files, flatTree, expandPath, focusEdit, editModeOff, handleTreeClick, moveFile, moveFolder, fileState, focusElement, handleClickFolder } = props const { files, flatTree, expandPath, focusEdit, editModeOff, handleTreeClick, moveFile, moveFolder, fileState, focusElement, handleClickFolder } = props
//const [flatTree, setFlatTree] = useState<{ [x: string]: FileType }>({})
const [hover, setHover] = useState<string>('') const [hover, setHover] = useState<string>('')
const [mouseOverTarget, setMouseOverTarget] = useState<{ const [mouseOverTarget, setMouseOverTarget] = useState<{
path: string, path: string,
@ -297,4 +296,4 @@ export const FlatTree = (props: FlatTreeProps) => {
</div> </div>
</>) </>)
} }

Loading…
Cancel
Save