Unverified Commit c4b9385c authored by David Disu's avatar David Disu Committed by GitHub

Merge pull request #1185 from ethereum/publish-gist-menu

Publish files and folder to gist
parents 0553a65a 7e4e9e33
...@@ -54,9 +54,9 @@ module.exports = { ...@@ -54,9 +54,9 @@ module.exports = {
.click('[data-id="default_workspace-modal-footer-cancel-react"]') .click('[data-id="default_workspace-modal-footer-cancel-react"]')
.executeScript(`remix.loadgist('${gistid}')`) .executeScript(`remix.loadgist('${gistid}')`)
// .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() }) // .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() })
.waitForElementVisible(`[data-id="treeViewLitreeViewItem${gistid}"]`) .waitForElementVisible(`[data-id="treeViewLitreeViewItem/gist-${gistid}"]`)
.click(`[data-id="treeViewLitreeViewItem${gistid}"]`) .click(`[data-id="treeViewLitreeViewItem/gist-${gistid}"]`)
.openFile(`${gistid}/README.txt`) .openFile(`gist-${gistid}/README.txt`)
} }
}) })
}, },
...@@ -118,9 +118,9 @@ module.exports = { ...@@ -118,9 +118,9 @@ module.exports = {
.waitForElementVisible('*[data-id="modalDialogCustomPromptText"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptText"]')
.setValue('*[data-id="modalDialogCustomPromptText"]', testData.validGistId) .setValue('*[data-id="modalDialogCustomPromptText"]', testData.validGistId)
.modalFooterOKClick() .modalFooterOKClick()
.openFile(`${testData.validGistId}/ApplicationRegistry`) .openFile(`gist-${testData.validGistId}/ApplicationRegistry`)
.waitForElementVisible(`div[title='default_workspace/${testData.validGistId}/ApplicationRegistry']`) .waitForElementVisible(`div[title='default_workspace/gist-${testData.validGistId}/ApplicationRegistry']`)
.assert.containsText(`div[title='default_workspace/${testData.validGistId}/ApplicationRegistry'] > span`, 'ApplicationRegistry') .assert.containsText(`div[title='default_workspace/gist-${testData.validGistId}/ApplicationRegistry'] > span`, 'ApplicationRegistry')
.end() .end()
} }
} }
...@@ -54,7 +54,9 @@ function GistHandler (_window) { ...@@ -54,7 +54,9 @@ function GistHandler (_window) {
} }
const obj = {} const obj = {}
Object.keys(data.files).forEach((element) => { Object.keys(data.files).forEach((element) => {
obj['/' + gistId + '/' + element] = data.files[element] const path = element.replace(/\.\.\./g, '/')
obj['/' + 'gist-' + gistId + '/' + path] = data.files[element]
}) })
fileManager.setBatchFiles(obj, 'workspace', true, (errorLoadingFile) => { fileManager.setBatchFiles(obj, 'workspace', true, (errorLoadingFile) => {
if (!errorLoadingFile) { if (!errorLoadingFile) {
......
...@@ -41,14 +41,16 @@ const normalize = (parent, filesList, newInputType?: string): any => { ...@@ -41,14 +41,16 @@ const normalize = (parent, filesList, newInputType?: string): any => {
if (filesList[key].isDirectory) { if (filesList[key].isDirectory) {
folders[extractNameFromKey(key)] = { folders[extractNameFromKey(key)] = {
path, path,
name: extractNameFromKey(path), name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path),
isDirectory: filesList[key].isDirectory isDirectory: filesList[key].isDirectory,
type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder'
} }
} else { } else {
files[extractNameFromKey(key)] = { files[extractNameFromKey(key)] = {
path, path,
name: extractNameFromKey(path), name: extractNameFromKey(path),
isDirectory: filesList[key].isDirectory isDirectory: filesList[key].isDirectory,
type: 'file'
} }
} }
}) })
...@@ -59,7 +61,8 @@ const normalize = (parent, filesList, newInputType?: string): any => { ...@@ -59,7 +61,8 @@ const normalize = (parent, filesList, newInputType?: string): any => {
folders[path] = { folders[path] = {
path: path, path: path,
name: '', name: '',
isDirectory: true isDirectory: true,
type: 'folder'
} }
} else if (newInputType === 'file') { } else if (newInputType === 'file') {
const path = parent + '/blank' const path = parent + '/blank'
...@@ -67,7 +70,8 @@ const normalize = (parent, filesList, newInputType?: string): any => { ...@@ -67,7 +70,8 @@ const normalize = (parent, filesList, newInputType?: string): any => {
files[path] = { files[path] = {
path: path, path: path,
name: '', name: '',
isDirectory: false isDirectory: false,
type: 'file'
} }
} }
......
...@@ -4,7 +4,7 @@ import { FileExplorerContextMenuProps } from './types' ...@@ -4,7 +4,7 @@ import { FileExplorerContextMenuProps } from './types'
import './css/file-explorer-context-menu.css' import './css/file-explorer-context-menu.css'
export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => { export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => {
const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, publishToGist, runScript, emit, pageX, pageY, path, type, ...otherProps } = props const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, pushChangesToGist, publishFileToGist, publishFolderToGist, runScript, emit, pageX, pageY, path, type, ...otherProps } = props
const contextMenuRef = useRef(null) const contextMenuRef = useRef(null)
useEffect(() => { useEffect(() => {
...@@ -50,7 +50,13 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => ...@@ -50,7 +50,13 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
deletePath(path) deletePath(path)
break break
case 'Push changes to gist': case 'Push changes to gist':
publishToGist() pushChangesToGist(path, type)
break
case 'Publish folder to gist':
publishFolderToGist(path, type)
break
case 'Publish file to gist':
publishFileToGist(path, type)
break break
case 'Run': case 'Run':
runScript(path) runScript(path)
......
...@@ -31,14 +31,14 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -31,14 +31,14 @@ export const FileExplorer = (props: FileExplorerProps) => {
actions: [{ actions: [{
id: 'newFile', id: 'newFile',
name: 'New File', name: 'New File',
type: ['folder'], type: ['folder', 'gist'],
path: [], path: [],
extension: [], extension: [],
pattern: [] pattern: []
}, { }, {
id: 'newFolder', id: 'newFolder',
name: 'New Folder', name: 'New Folder',
type: ['folder'], type: ['folder', 'gist'],
path: [], path: [],
extension: [], extension: [],
pattern: [] pattern: []
...@@ -52,17 +52,31 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -52,17 +52,31 @@ export const FileExplorer = (props: FileExplorerProps) => {
}, { }, {
id: 'delete', id: 'delete',
name: 'Delete', name: 'Delete',
type: ['file', 'folder'], type: ['file', 'folder', 'gist'],
path: [], path: [],
extension: [], extension: [],
pattern: [] pattern: []
}, { }, {
id: 'pushChangesToGist', id: 'pushChangesToGist',
name: 'Push changes to gist', name: 'Push changes to gist',
type: [], type: ['gist'],
path: [],
extension: [],
pattern: []
}, {
id: 'publishFolderToGist',
name: 'Publish folder to gist',
type: ['folder'],
path: [], path: [],
extension: [], extension: [],
pattern: ['^browser/gists/([0-9]|[a-z])*$'] pattern: []
}, {
id: 'publishFileToGist',
name: 'Publish file to gist',
type: ['file'],
path: [],
extension: [],
pattern: []
}, { }, {
id: 'run', id: 'run',
name: 'Run', name: 'Run',
...@@ -228,6 +242,15 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -228,6 +242,15 @@ export const FileExplorer = (props: FileExplorerProps) => {
else return false else return false
} }
const getFocusedFolder = () => {
if (state.focusElement[0]) {
if (state.focusElement[0].type === 'folder' && state.focusElement[0].key) return state.focusElement[0].key
else if (state.focusElement[0].type === 'gist' && state.focusElement[0].key) return state.focusElement[0].key
else if (state.focusElement[0].type === 'file' && state.focusElement[0].key) return extractParentFromKey(state.focusElement[0].key) ? extractParentFromKey(state.focusElement[0].key) : name
else return name
}
}
const createNewFile = async (newFilePath: string) => { const createNewFile = async (newFilePath: string) => {
const fileManager = state.fileManager const fileManager = state.fileManager
...@@ -309,7 +332,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -309,7 +332,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
// the files module. Please ask the user here if they want to overwrite // the files module. Please ask the user here if they want to overwrite
// a file and then just use `files.add`. The file explorer will // a file and then just use `files.add`. The file explorer will
// pick that up via the 'fileAdded' event from the files module. // pick that up via the 'fileAdded' event from the files module.
const parentFolder = state.focusElement[0] ? state.focusElement[0].type === 'folder' ? state.focusElement[0].key : extractParentFromKey(state.focusElement[0].key) : name const parentFolder = getFocusedFolder()
const expandPath = [...new Set([...state.expandPath, parentFolder])] const expandPath = [...new Set([...state.expandPath, parentFolder])]
setState(prevState => { setState(prevState => {
...@@ -355,11 +378,23 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -355,11 +378,23 @@ export const FileExplorer = (props: FileExplorerProps) => {
}) })
} }
const publishToGist = () => { const publishToGist = (path?: string, type?: string) => {
modal('Create a public gist', `Are you sure you want to anonymously publish all your files in the ${name} workspace as a public gist on github.com?`, 'OK', toGist, 'Cancel', () => {}) modal('Create a public gist', `Are you sure you want to anonymously publish all your files in the ${name} workspace as a public gist on github.com?`, 'OK', () => toGist(path, type), 'Cancel', () => {})
}
const pushChangesToGist = (path?: string, type?: string) => {
modal('Create a public gist', 'Are you sure you want to push changes to remote gist file on github.com?', 'OK', () => toGist(path, type), 'Cancel', () => {})
}
const publishFolderToGist = (path?: string, type?: string) => {
modal('Create a public gist', `Are you sure you want to anonymously publish all your files in the ${path} folder as a public gist on github.com?`, 'OK', () => toGist(path, type), 'Cancel', () => {})
}
const publishFileToGist = (path?: string, type?: string) => {
modal('Create a public gist', `Are you sure you want to anonymously publish ${path} file as a public gist on github.com?`, 'OK', () => toGist(path, type), 'Cancel', () => {})
} }
const toGist = (id?: string) => { const toGist = (path?: string, type?: string) => {
const filesProvider = fileSystem.provider.provider const filesProvider = fileSystem.provider.provider
const proccedResult = function (error, data) { const proccedResult = function (error, data) {
if (error) { if (error) {
...@@ -393,7 +428,8 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -393,7 +428,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
} }
// If 'id' is not defined, it is not a gist update but a creation so we have to take the files from the browser explorer. // If 'id' is not defined, it is not a gist update but a creation so we have to take the files from the browser explorer.
const folder = id ? '/gists/' + id : '/' const folder = path || '/'
const id = type === 'gist' ? extractNameFromKey(path).split('-')[1] : null
packageFiles(filesProvider, folder, async (error, packaged) => { packageFiles(filesProvider, folder, async (error, packaged) => {
if (error) { if (error) {
...@@ -501,15 +537,15 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -501,15 +537,15 @@ export const FileExplorer = (props: FileExplorerProps) => {
}) })
} }
const handleClickFile = (path: string) => { const handleClickFile = (path: string, type: string) => {
path = path.indexOf(props.name + '/') === 0 ? path.replace(props.name + '/', '') : path path = path.indexOf(props.name + '/') === 0 ? path.replace(props.name + '/', '') : path
state.fileManager.open(path) state.fileManager.open(path)
setState(prevState => { setState(prevState => {
return { ...prevState, focusElement: [{ key: path, type: 'file' }] } return { ...prevState, focusElement: [{ key: path, type }] }
}) })
} }
const handleClickFolder = async (path: string) => { const handleClickFolder = async (path: string, type: string) => {
if (state.ctrlKey) { if (state.ctrlKey) {
if (state.focusElement.findIndex(item => item.key === path) !== -1) { if (state.focusElement.findIndex(item => item.key === path) !== -1) {
setState(prevState => { setState(prevState => {
...@@ -517,7 +553,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -517,7 +553,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
}) })
} else { } else {
setState(prevState => { setState(prevState => {
return { ...prevState, focusElement: [...prevState.focusElement, { key: path, type: 'folder' }] } return { ...prevState, focusElement: [...prevState.focusElement, { key: path, type }] }
}) })
} }
} else { } else {
...@@ -531,22 +567,22 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -531,22 +567,22 @@ export const FileExplorer = (props: FileExplorerProps) => {
} }
setState(prevState => { setState(prevState => {
return { ...prevState, focusElement: [{ key: path, type: 'folder' }], expandPath } return { ...prevState, focusElement: [{ key: path, type }], expandPath }
}) })
} }
} }
const handleContextMenuFile = (pageX: number, pageY: number, path: string, content: string) => { const handleContextMenuFile = (pageX: number, pageY: number, path: string, content: string, type: string) => {
if (!content) return if (!content) return
setState(prevState => { setState(prevState => {
return { ...prevState, focusContext: { element: path, x: pageX, y: pageY, type: 'file' }, focusEdit: { ...prevState.focusEdit, lastEdit: content }, showContextMenu: prevState.focusEdit.element !== path } return { ...prevState, focusContext: { element: path, x: pageX, y: pageY, type }, focusEdit: { ...prevState.focusEdit, lastEdit: content }, showContextMenu: prevState.focusEdit.element !== path }
}) })
} }
const handleContextMenuFolder = (pageX: number, pageY: number, path: string, content: string) => { const handleContextMenuFolder = (pageX: number, pageY: number, path: string, content: string, type: string) => {
if (!content) return if (!content) return
setState(prevState => { setState(prevState => {
return { ...prevState, focusContext: { element: path, x: pageX, y: pageY, type: 'folder' }, focusEdit: { ...prevState.focusEdit, lastEdit: content }, showContextMenu: prevState.focusEdit.element !== path } return { ...prevState, focusContext: { element: path, x: pageX, y: pageY, type }, focusEdit: { ...prevState.focusEdit, lastEdit: content }, showContextMenu: prevState.focusEdit.element !== path }
}) })
} }
...@@ -618,7 +654,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -618,7 +654,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
} }
const handleNewFileInput = async (parentFolder?: string) => { const handleNewFileInput = async (parentFolder?: string) => {
if (!parentFolder) parentFolder = state.focusElement[0] ? state.focusElement[0].type === 'folder' ? state.focusElement[0].key ? state.focusElement[0].key : name : extractParentFromKey(state.focusElement[0].key) ? extractParentFromKey(state.focusElement[0].key) : name : name if (!parentFolder) parentFolder = getFocusedFolder()
const expandPath = [...new Set([...state.expandPath, parentFolder])] const expandPath = [...new Set([...state.expandPath, parentFolder])]
await addInputField(fileSystem.provider.provider, 'file', parentFolder)(dispatch) await addInputField(fileSystem.provider.provider, 'file', parentFolder)(dispatch)
...@@ -629,7 +665,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -629,7 +665,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
} }
const handleNewFolderInput = async (parentFolder?: string) => { const handleNewFolderInput = async (parentFolder?: string) => {
if (!parentFolder) parentFolder = state.focusElement[0] ? state.focusElement[0].type === 'folder' ? state.focusElement[0].key ? state.focusElement[0].key : name : extractParentFromKey(state.focusElement[0].key) ? extractParentFromKey(state.focusElement[0].key) : name : name if (!parentFolder) parentFolder = getFocusedFolder()
else if ((parentFolder.indexOf('.sol') !== -1) || (parentFolder.indexOf('.js') !== -1)) parentFolder = extractParentFromKey(parentFolder) else if ((parentFolder.indexOf('.sol') !== -1) || (parentFolder.indexOf('.js') !== -1)) parentFolder = extractParentFromKey(parentFolder)
const expandPath = [...new Set([...state.expandPath, parentFolder])] const expandPath = [...new Set([...state.expandPath, parentFolder])]
...@@ -705,12 +741,12 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -705,12 +741,12 @@ export const FileExplorer = (props: FileExplorerProps) => {
label={label(file)} label={label(file)}
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
if (state.focusEdit.element !== file.path) handleClickFolder(file.path) if (state.focusEdit.element !== file.path) handleClickFolder(file.path, file.type)
}} }}
onContextMenu={(e) => { onContextMenu={(e) => {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
handleContextMenuFolder(e.pageX, e.pageY, file.path, e.target.textContent) handleContextMenuFolder(e.pageX, e.pageY, file.path, e.target.textContent, file.type)
}} }}
labelClass={labelClass} labelClass={labelClass}
controlBehaviour={ state.ctrlKey } controlBehaviour={ state.ctrlKey }
...@@ -742,12 +778,12 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -742,12 +778,12 @@ export const FileExplorer = (props: FileExplorerProps) => {
label={label(file)} label={label(file)}
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
if (state.focusEdit.element !== file.path) handleClickFile(file.path) if (state.focusEdit.element !== file.path) handleClickFile(file.path, file.type)
}} }}
onContextMenu={(e) => { onContextMenu={(e) => {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
handleContextMenuFile(e.pageX, e.pageY, file.path, e.target.textContent) handleContextMenuFile(e.pageX, e.pageY, file.path, e.target.textContent, file.type)
}} }}
icon={icon} icon={icon}
labelClass={labelClass} labelClass={labelClass}
...@@ -841,6 +877,9 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -841,6 +877,9 @@ export const FileExplorer = (props: FileExplorerProps) => {
e.stopPropagation() e.stopPropagation()
handleMouseOver(state.focusContext.element) handleMouseOver(state.focusContext.element)
}} }}
pushChangesToGist={pushChangesToGist}
publishFolderToGist={publishFolderToGist}
publishFileToGist={publishFileToGist}
/> />
} }
</div> </div>
...@@ -850,12 +889,34 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -850,12 +889,34 @@ export const FileExplorer = (props: FileExplorerProps) => {
export default FileExplorer export default FileExplorer
async function packageFiles (filesProvider, directory, callback) { async function packageFiles (filesProvider, directory, callback) {
const isFile = filesProvider.isFile(directory)
const ret = {} const ret = {}
if (isFile) {
try {
filesProvider.get(directory, (error, content) => {
if (error) throw new Error('An error ocurred while getting file content. ' + directory)
if (/^\s+$/.test(content) || !content.length) {
content = '// this line is added to create a gist. Empty file is not allowed.'
}
directory = directory.replace(/\//g, '...')
ret[directory] = { content }
callback(null, ret)
})
} catch (e) {
return callback(e)
}
} else {
try { try {
await filesProvider.copyFolderToJson(directory, ({ path, content }) => { await filesProvider.copyFolderToJson(directory, ({ path, content }) => {
if (/^\s+$/.test(content) || !content.length) { if (/^\s+$/.test(content) || !content.length) {
content = '// this line is added to create a gist. Empty file is not allowed.' content = '// this line is added to create a gist. Empty file is not allowed.'
} }
if (path.indexOf('gist-') === 0) {
path = path.split('/')
path.shift()
path = path.join('/')
}
path = path.replace(/\//g, '...') path = path.replace(/\//g, '...')
ret[path] = { content } ret[path] = { content }
}) })
...@@ -863,6 +924,7 @@ async function packageFiles (filesProvider, directory, callback) { ...@@ -863,6 +924,7 @@ async function packageFiles (filesProvider, directory, callback) {
} catch (e) { } catch (e) {
return callback(e) return callback(e)
} }
}
} }
function joinPath (...paths) { function joinPath (...paths) {
......
...@@ -258,7 +258,8 @@ const resolveDirectory = (root, path: string, files, content) => { ...@@ -258,7 +258,8 @@ const resolveDirectory = (root, path: string, files, content) => {
files = _.set(files, _path, { files = _.set(files, _path, {
isDirectory: true, isDirectory: true,
path, path,
name: extractNameFromKey(path), name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path),
type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder',
child: { ...content[pathArr[pathArr.length - 1]], ...(prevFiles ? prevFiles.child : {}) } child: { ...content[pathArr[pathArr.length - 1]], ...(prevFiles ? prevFiles.child : {}) }
}) })
...@@ -278,7 +279,8 @@ const removePath = (root, path: string, pathName, files) => { ...@@ -278,7 +279,8 @@ const removePath = (root, path: string, pathName, files) => {
files = _.set(files, _path, { files = _.set(files, _path, {
isDirectory: true, isDirectory: true,
path, path,
name: extractNameFromKey(path), name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path),
type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder',
child: prevFiles ? prevFiles.child : {} child: prevFiles ? prevFiles.child : {}
}) })
...@@ -336,7 +338,8 @@ const fileRenamed = (root, path: string, removePath: string, files, content) => ...@@ -336,7 +338,8 @@ const fileRenamed = (root, path: string, removePath: string, files, content) =>
files = _.set(files, _path, { files = _.set(files, _path, {
isDirectory: true, isDirectory: true,
path, path,
name: extractNameFromKey(path), name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path),
type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder',
child: { ...content[pathArr[pathArr.length - 1]], ...prevFiles.child } child: { ...content[pathArr[pathArr.length - 1]], ...prevFiles.child }
}) })
......
...@@ -15,6 +15,7 @@ export interface File { ...@@ -15,6 +15,7 @@ export interface File {
path: string, path: string,
name: string, name: string,
isDirectory: boolean, isDirectory: boolean,
type: string,
child?: File[] child?: File[]
} }
...@@ -24,7 +25,7 @@ export interface FileExplorerMenuProps { ...@@ -24,7 +25,7 @@ export interface FileExplorerMenuProps {
fileManager: any, fileManager: any,
createNewFile: (folder?: string) => void, createNewFile: (folder?: string) => void,
createNewFolder: (parentFolder?: string) => void, createNewFolder: (parentFolder?: string) => void,
publishToGist: () => void, publishToGist: (path?: string) => void,
uploadFile: (target: EventTarget & HTMLInputElement) => void uploadFile: (target: EventTarget & HTMLInputElement) => void
} }
...@@ -35,7 +36,10 @@ export interface FileExplorerContextMenuProps { ...@@ -35,7 +36,10 @@ export interface FileExplorerContextMenuProps {
deletePath: (path: string) => void, deletePath: (path: string) => void,
renamePath: (path: string, type: string) => void, renamePath: (path: string, type: string) => void,
hideContextMenu: () => void, hideContextMenu: () => void,
publishToGist?: () => void, publishToGist?: (path?: string, type?: string) => void,
pushChangesToGist?: (path?: string, type?: string) => void,
publishFolderToGist?: (path?: string, type?: string) => void,
publishFileToGist?: (path?: string, type?: string) => void,
runScript?: (path: string) => void, runScript?: (path: string) => void,
emit?: (id: string, path: string) => void, emit?: (id: string, path: string) => void,
pageX: number, pageX: number,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment