Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
1a511472
Commit
1a511472
authored
Aug 05, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract types
parent
9084e342
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
14 deletions
+64
-14
workspaceFileProvider.js
apps/remix-ide/src/app/files/workspaceFileProvider.js
+8
-10
index.ts
libs/remix-ui/file-explorer/src/index.ts
+1
-0
file-explorer.tsx
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
+3
-4
index.ts
libs/remix-ui/file-explorer/src/lib/types/index.ts
+1
-0
remix-ui-workspace.tsx
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
+0
-0
index.ts
libs/remix-ui/workspace/src/lib/types/index.ts
+51
-0
No files found.
apps/remix-ide/src/app/files/workspaceFileProvider.js
View file @
1a511472
...
...
@@ -81,16 +81,14 @@ class WorkspaceFileProvider extends FileProvider {
}
async
createWorkspace
(
name
)
{
if
(
!
name
)
name
=
'default_workspace'
this
.
setWorkspace
(
name
)
const
workspacePath
=
'browser/'
+
this
.
workspacesPath
+
'/'
+
name
const
workspaceRootPath
=
'browser/'
+
this
.
workspacesPath
const
workspaceRootPathExists
=
await
super
.
exists
(
workspaceRootPath
)
const
workspacePathExists
=
await
super
.
exists
(
workspacePath
)
if
(
!
workspaceRootPathExists
)
super
.
createDir
(
workspaceRootPath
)
if
(
!
workspacePathExists
)
super
.
createDir
(
workspacePath
)
this
.
event
.
emit
(
'createWorkspace'
,
name
)
try
{
if
(
!
name
)
name
=
'default_workspace'
this
.
setWorkspace
(
name
)
await
super
.
createDir
(
name
)
this
.
event
.
emit
(
'createWorkspace'
,
name
)
}
catch
(
e
)
{
throw
new
Error
(
e
)
}
}
}
...
...
libs/remix-ui/file-explorer/src/index.ts
View file @
1a511472
export
*
from
'./lib/file-explorer'
export
*
from
'./lib/types'
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
View file @
1a511472
...
...
@@ -18,7 +18,7 @@ import './css/file-explorer.css'
const
queryParams
=
new
QueryParams
()
export
const
FileExplorer
=
(
props
:
FileExplorerProps
)
=>
{
const
{
name
,
registry
,
plugin
,
focusRoot
,
contextMenuItems
,
displayInput
,
externalUploads
,
removedContextMenuItems
}
=
props
const
{
name
,
registry
,
plugin
,
focusRoot
,
contextMenuItems
,
displayInput
,
externalUploads
,
removedContextMenuItems
,
resetFocus
}
=
props
const
[
state
,
setState
]
=
useState
({
focusElement
:
[{
key
:
''
,
...
...
@@ -204,7 +204,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
setState
(
prevState
=>
{
return
{
...
prevState
,
focusElement
:
[{
key
:
''
,
type
:
'folder'
}]
}
})
plugin
.
resetFocus
(
false
)
resetFocus
(
false
)
}
},
[
focusRoot
])
...
...
@@ -230,7 +230,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
useEffect
(()
=>
{
if
(
externalUploads
)
{
uploadFile
(
externalUploads
)
plugin
.
resetUploadFile
()
}
},
[
externalUploads
])
...
...
@@ -988,7 +987,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
setState
(
prevState
=>
{
return
{
...
prevState
,
expandPath
}
})
plugin
.
resetFocus
(
true
)
resetFocus
(
true
)
}
}
>
<
FileExplorerMenu
title=
{
''
}
...
...
libs/remix-ui/file-explorer/src/lib/types/index.ts
View file @
1a511472
...
...
@@ -13,6 +13,7 @@ export interface FileExplorerProps {
removedContextMenuItems
:
MenuItems
,
displayInput
?:
boolean
,
externalUploads
?:
EventTarget
&
HTMLInputElement
,
resetFocus
?:
(
value
:
boolean
)
=>
void
}
export
interface
File
{
...
...
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
View file @
1a511472
This diff is collapsed.
Click to expand it.
libs/remix-ui/workspace/src/lib/types/index.ts
0 → 100644
View file @
1a511472
import
{
MenuItems
}
from
'@remix-ui/file-explorer'
export
interface
WorkspaceProps
{
plugin
:
{
setWorkspace
:
({
name
:
string
,
isLocalhost
:
boolean
},
setEvent
:
boolean
)
=>
void
,
createWorkspace
:
(
name
:
string
)
=>
void
,
renameWorkspace
:
(
oldName
:
string
,
newName
:
string
)
=>
void
workspaceRenamed
:
({
name
:
string
})
=>
void
,
workspaceCreated
:
({
name
:
string
})
=>
void
,
workspaceDeleted
:
({
name
:
string
})
=>
void
,
workspace
:
any
// workspace provider,
browser
:
any
// browser provider
localhost
:
any
// localhost provider
fileManager
:
any
registry
:
any
// registry
request
:
{
createWorkspace
:
()
=>
void
,
setWorkspace
:
(
workspaceName
:
string
)
=>
void
,
createNewFile
:
()
=>
void
,
uploadFile
:
(
target
:
EventTarget
&
HTMLInputElement
)
=>
void
,
getCurrentWorkspace
:
()
=>
void
}
// api request,
workspaces
:
any
,
registeredMenuItems
:
MenuItems
// menu items
removedMenuItems
:
MenuItems
initialWorkspace
:
string
,
resetNewFile
:
()
=>
void
,
getWorkspaces
:
()
=>
string
[]
}
}
export
interface
WorkspaceState
{
workspaces
:
string
[]
reset
:
boolean
hideRemixdExplorer
:
boolean
displayNewFile
:
boolean
externalUploads
:
EventTarget
&
HTMLInputElement
uploadFileEvent
:
EventTarget
&
HTMLInputElement
loadingLocalhost
:
boolean
toasterMsg
:
string
}
export
interface
Modal
{
hide
:
boolean
title
:
string
message
:
string
|
JSX
.
Element
okLabel
:
string
okFn
:
()
=>
void
cancelLabel
:
string
cancelFn
:
()
=>
void
handleHide
:
()
=>
void
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment