|
|
@ -7,27 +7,49 @@ import { MenuItems } from 'libs/remix-ui/file-explorer/src/lib/types' |
|
|
|
|
|
|
|
|
|
|
|
/* eslint-disable-next-line */ |
|
|
|
/* eslint-disable-next-line */ |
|
|
|
export interface WorkspaceProps { |
|
|
|
export interface WorkspaceProps { |
|
|
|
setWorkspace: ({ name: string, isLocalhost: boolean }, setEvent: boolean) => void, |
|
|
|
plugin: { |
|
|
|
createWorkspace: (name: string) => void, |
|
|
|
setWorkspace: ({ name: string, isLocalhost: boolean }, setEvent: boolean) => void, |
|
|
|
renameWorkspace: (oldName: string, newName: string) => void |
|
|
|
createWorkspace: (name: string) => void, |
|
|
|
workspaceRenamed: ({ name: string }) => void, |
|
|
|
renameWorkspace: (oldName: string, newName: string) => void |
|
|
|
workspaceCreated: ({ name: string }) => void, |
|
|
|
workspaceRenamed: ({ name: string }) => void, |
|
|
|
workspaceDeleted: ({ name: string }) => void, |
|
|
|
workspaceCreated: ({ name: string }) => void, |
|
|
|
workspace: any // workspace provider,
|
|
|
|
workspaceDeleted: ({ name: string }) => void, |
|
|
|
browser: any // browser provider
|
|
|
|
workspace: any // workspace provider,
|
|
|
|
localhost: any // localhost provider
|
|
|
|
browser: any // browser provider
|
|
|
|
fileManager : any |
|
|
|
localhost: any // localhost provider
|
|
|
|
registry: any // registry
|
|
|
|
fileManager : any |
|
|
|
plugin: any // plugin call and resetFocus
|
|
|
|
registry: any // registry
|
|
|
|
request: any // api request,
|
|
|
|
request: any // api request,
|
|
|
|
workspaces: any, |
|
|
|
workspaces: any, |
|
|
|
registeredMenuItems: MenuItems // menu items
|
|
|
|
registeredMenuItems: MenuItems // menu items
|
|
|
|
removedMenuItems: MenuItems |
|
|
|
removedMenuItems: MenuItems |
|
|
|
initialWorkspace: string |
|
|
|
initialWorkspace: string |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var canUpload = window.File || window.FileReader || window.FileList || window.Blob |
|
|
|
var canUpload = window.File || window.FileReader || window.FileList || window.Blob |
|
|
|
export const Workspace = (props: WorkspaceProps) => { |
|
|
|
export const Workspace = (props: WorkspaceProps) => { |
|
|
|
|
|
|
|
const { |
|
|
|
|
|
|
|
plugin, |
|
|
|
|
|
|
|
plugin: { |
|
|
|
|
|
|
|
setWorkspace, |
|
|
|
|
|
|
|
createWorkspace, |
|
|
|
|
|
|
|
renameWorkspace, |
|
|
|
|
|
|
|
workspaceRenamed, |
|
|
|
|
|
|
|
workspaceCreated, |
|
|
|
|
|
|
|
workspaceDeleted, |
|
|
|
|
|
|
|
workspace, |
|
|
|
|
|
|
|
browser, |
|
|
|
|
|
|
|
localhost, |
|
|
|
|
|
|
|
fileManager, |
|
|
|
|
|
|
|
registry, |
|
|
|
|
|
|
|
request, |
|
|
|
|
|
|
|
workspaces, |
|
|
|
|
|
|
|
registeredMenuItems, |
|
|
|
|
|
|
|
removedMenuItems, |
|
|
|
|
|
|
|
initialWorkspace |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} = props |
|
|
|
const LOCALHOST = ' - connect to localhost - ' |
|
|
|
const LOCALHOST = ' - connect to localhost - ' |
|
|
|
const NO_WORKSPACE = ' - none - ' |
|
|
|
const NO_WORKSPACE = ' - none - ' |
|
|
|
|
|
|
|
|
|
|
@ -409,7 +431,7 @@ export const Workspace = (props: WorkspaceProps) => { |
|
|
|
registry={props.registry} |
|
|
|
registry={props.registry} |
|
|
|
filesProvider={props.workspace} |
|
|
|
filesProvider={props.workspace} |
|
|
|
menuItems={['createNewFile', 'createNewFolder', 'publishToGist', canUpload ? 'uploadFile' : '']} |
|
|
|
menuItems={['createNewFile', 'createNewFolder', 'publishToGist', canUpload ? 'uploadFile' : '']} |
|
|
|
plugin={props.plugin} |
|
|
|
plugin={plugin} |
|
|
|
focusRoot={state.reset} |
|
|
|
focusRoot={state.reset} |
|
|
|
contextMenuItems={props.registeredMenuItems} |
|
|
|
contextMenuItems={props.registeredMenuItems} |
|
|
|
removedContextMenuItems={props.removedMenuItems} |
|
|
|
removedContextMenuItems={props.removedMenuItems} |
|
|
@ -427,7 +449,7 @@ export const Workspace = (props: WorkspaceProps) => { |
|
|
|
registry={props.registry} |
|
|
|
registry={props.registry} |
|
|
|
filesProvider={props.localhost} |
|
|
|
filesProvider={props.localhost} |
|
|
|
menuItems={['createNewFile', 'createNewFolder']} |
|
|
|
menuItems={['createNewFile', 'createNewFolder']} |
|
|
|
plugin={props.plugin} |
|
|
|
plugin={plugin} |
|
|
|
focusRoot={state.reset} |
|
|
|
focusRoot={state.reset} |
|
|
|
contextMenuItems={props.registeredMenuItems} |
|
|
|
contextMenuItems={props.registeredMenuItems} |
|
|
|
removedContextMenuItems={props.removedMenuItems} |
|
|
|
removedContextMenuItems={props.removedMenuItems} |
|
|
|