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
e95ec46b
Commit
e95ec46b
authored
Jul 02, 2021
by
joseph izang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trying to import react component
parent
2c56adb9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
56 deletions
+43
-56
plugin-manager-component.js
.../remix-ide/src/app/components/plugin-manager-component.js
+23
-2
customTypes.ts
libs/remix-ui/plugin-manager/src/customTypes.ts
+9
-0
remix-ui-plugin-manager.tsx
...mix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx
+8
-1
tsconfig.json
libs/remix-ui/plugin-manager/tsconfig.json
+1
-1
tsconfig.base.json
tsconfig.base.json
+0
-50
tsconfig.json
tsconfig.json
+2
-2
No files found.
apps/remix-ide/src/app/components/plugin-manager-component.js
View file @
e95ec46b
import
{
IframePlugin
,
ViewPlugin
,
WebsocketPlugin
}
from
'@remixproject/engine-web'
import
{
IframePlugin
,
ViewPlugin
,
WebsocketPlugin
}
from
'@remixproject/engine-web'
import
{
PluginManagerSettings
}
from
'./plugin-manager-settings'
import
{
PluginManagerSettings
}
from
'./plugin-manager-settings'
import
React
from
'react'
import
{
ReactDOM
}
from
'react-dom'
import
{
RemixUIPluginManager
}
from
'@remix-ui/plugin-manager'
import
*
as
packageJson
from
'../../../../../package.json'
import
*
as
packageJson
from
'../../../../../package.json'
const
yo
=
require
(
'yo-yo'
)
const
yo
=
require
(
'yo-yo'
)
const
csjs
=
require
(
'csjs-inject'
)
const
csjs
=
require
(
'csjs-inject'
)
...
@@ -96,6 +99,12 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -96,6 +99,12 @@ class PluginManagerComponent extends ViewPlugin {
this
.
appManager
.
event
.
on
(
'deactivate'
,
()
=>
{
this
.
reRender
()
})
this
.
appManager
.
event
.
on
(
'deactivate'
,
()
=>
{
this
.
reRender
()
})
this
.
engine
=
engine
this
.
engine
=
engine
this
.
engine
.
event
.
on
(
'onRegistration'
,
()
=>
{
this
.
reRender
()
})
this
.
engine
.
event
.
on
(
'onRegistration'
,
()
=>
{
this
.
reRender
()
})
this
.
htmlElement
=
document
.
createElement
(
'div'
)
this
.
htmlElement
.
setAttribute
(
'id'
,
'pluginManager'
)
}
onActivation
()
{
this
.
renderComponent
()
}
}
isActive
(
name
)
{
isActive
(
name
)
{
...
@@ -188,6 +197,12 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -188,6 +197,12 @@ class PluginManagerComponent extends ViewPlugin {
}
}
}
}
// return this.htmlElement()
// render () {
// return this.htmlElement()
// }
render
()
{
render
()
{
// Filtering helpers
// Filtering helpers
const
isFiltered
=
(
profile
)
=>
(
profile
.
displayName
?
profile
.
displayName
:
profile
.
name
).
toLowerCase
().
includes
(
this
.
filter
)
const
isFiltered
=
(
profile
)
=>
(
profile
.
displayName
?
profile
.
displayName
:
profile
.
name
).
toLowerCase
().
includes
(
this
.
filter
)
...
@@ -218,14 +233,16 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -218,14 +233,16 @@ class PluginManagerComponent extends ViewPlugin {
<nav class="plugins-list-header justify-content-between navbar navbar-expand-lg bg-light navbar-light align-items-center">
<nav class="plugins-list-header justify-content-between navbar navbar-expand-lg bg-light navbar-light align-items-center">
<span class="navbar-brand plugins-list-title">Active Modules</span>
<span class="navbar-brand plugins-list-title">Active Modules</span>
<span class="badge badge-primary" data-id="pluginManagerComponentActiveTilesCount">
${
actives
.
length
}
</span>
<span class="badge badge-primary" data-id="pluginManagerComponentActiveTilesCount">
${
actives
.
length
}
</span>
</nav>`
</nav>
`
:
''
:
''
const
inactiveTile
=
inactives
.
length
!==
0
const
inactiveTile
=
inactives
.
length
!==
0
?
yo
`
?
yo
`
<nav class="plugins-list-header justify-content-between navbar navbar-expand-lg bg-light navbar-light align-items-center">
<nav class="plugins-list-header justify-content-between navbar navbar-expand-lg bg-light navbar-light align-items-center">
<span class="navbar-brand plugins-list-title h6 mb-0 mr-2">Inactive Modules</span>
<span class="navbar-brand plugins-list-title h6 mb-0 mr-2">Inactive Modules</span>
<span class="badge badge-primary" style = "cursor: default;" data-id="pluginManagerComponentInactiveTilesCount">
${
inactives
.
length
}
</span>
<span class="badge badge-primary" style = "cursor: default;" data-id="pluginManagerComponentInactiveTilesCount">
${
inactives
.
length
}
</span>
</nav>`
</nav>
`
:
''
:
''
const
settings
=
new
PluginManagerSettings
().
render
()
const
settings
=
new
PluginManagerSettings
().
render
()
...
@@ -255,6 +272,10 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -255,6 +272,10 @@ class PluginManagerComponent extends ViewPlugin {
return
rootView
return
rootView
}
}
renderComponent
()
{
ReactDOM
.
render
(
<
RemixUIPluginManager
/>
,
this
.
htmElement
)
}
reRender
()
{
reRender
()
{
if
(
this
.
views
.
root
)
{
if
(
this
.
views
.
root
)
{
yo
.
update
(
this
.
views
.
root
,
this
.
render
())
yo
.
update
(
this
.
views
.
root
,
this
.
render
())
...
...
libs/remix-ui/plugin-manager/src/customTypes.ts
View file @
e95ec46b
...
@@ -18,3 +18,12 @@ export type Profile = {
...
@@ -18,3 +18,12 @@ export type Profile = {
documentation
:
'https://remix-ide.readthedocs.io/en/latest/plugin_manager.html'
,
documentation
:
'https://remix-ide.readthedocs.io/en/latest/plugin_manager.html'
,
version
:
string
version
:
string
}
}
export
type
LocalPlugin
=
{
create
:
()
=>
Profile
updateName
:
(
target
:
string
)
=>
void
updateDisplayName
:
(
displayName
:
string
)
=>
void
updateProfile
:
(
key
:
string
,
e
:
Event
)
=>
void
updateMethods
:
(
target
:
any
)
=>
void
form
:
()
=>
HTMLElement
}
libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx
View file @
e95ec46b
import
React
from
'react'
import
React
from
'react'
import
{
Profile
}
from
'../customTypes'
import
'./remix-ui-plugin-manager.css'
import
'./remix-ui-plugin-manager.css'
/* eslint-disable-next-line */
/* eslint-disable-next-line */
export
interface
RemixUiPluginManagerProps
{
export
interface
RemixUiPluginManagerProps
{
activatePlugin
:
(
name
:
string
)
=>
void
deActivatePlugin
:
(
name
:
string
)
=>
void
isActive
:
()
=>
void
openLocalPlugin
:
()
=>
Promise
<
void
>
filterPlugins
:
()
=>
void
reRender
:
()
=>
void
profile
:
Profile
}
}
export
const
RemixUiPluginManager
=
(
props
:
RemixUiPluginManagerProps
)
=>
{
export
const
RemixUiPluginManager
=
(
props
:
RemixUiPluginManagerProps
)
=>
{
...
...
libs/remix-ui/plugin-manager/tsconfig.json
View file @
e95ec46b
{
{
"extends"
:
"../../../tsconfig.
base.
json"
,
"extends"
:
"../../../tsconfig.json"
,
"compilerOptions"
:
{
"compilerOptions"
:
{
"jsx"
:
"react"
,
"jsx"
:
"react"
,
"allowJs"
:
true
,
"allowJs"
:
true
,
...
...
tsconfig.base.json
deleted
100644 → 0
View file @
2c56adb9
{
"compileOnSave"
:
false
,
"compilerOptions"
:
{
"rootDir"
:
"."
,
"sourceMap"
:
true
,
"declaration"
:
false
,
"moduleResolution"
:
"node"
,
"emitDecoratorMetadata"
:
true
,
"experimentalDecorators"
:
true
,
"importHelpers"
:
true
,
"target"
:
"es2015"
,
"module"
:
"commonjs"
,
"typeRoots"
:
[
"node_modules/@types"
],
"lib"
:
[
"es2017"
,
"es2019"
,
"dom"
],
"skipLibCheck"
:
true
,
"skipDefaultLibCheck"
:
true
,
"baseUrl"
:
"."
,
"paths"
:
{
"@remix-project/remix-analyzer"
:
[
"dist/libs/remix-analyzer/index.js"
],
"@remix-project/remix-astwalker"
:
[
"dist/libs/remix-astwalker/index.js"
],
"@remix-project/remix-debug"
:
[
"dist/libs/remix-debug/src/index.js"
],
"@remix-project/remix-lib"
:
[
"dist/libs/remix-lib/src/index.js"
],
"@remix-project/remix-simulator"
:
[
"dist/libs/remix-simulator/src/index.js"
],
"@remix-project/remix-solidity"
:
[
"dist/libs/remix-solidity/index.js"
],
"@remix-project/remix-tests"
:
[
"dist/libs/remix-tests/src/index.js"
],
"@remix-project/remix-url-resolver"
:
[
"dist/libs/remix-url-resolver/index.js"
],
"@remixproject/debugger-plugin"
:
[
"apps/debugger/src/index.ts"
],
"@remix-project/remixd"
:
[
"dist/libs/remixd/index.js"
],
"@remix-ui/tree-view"
:
[
"libs/remix-ui/tree-view/src/index.ts"
],
"@remix-ui/debugger-ui"
:
[
"libs/remix-ui/debugger-ui/src/index.ts"
],
"@remix-ui/utils"
:
[
"libs/remix-ui/utils/src/index.ts"
],
"@remix-ui/clipboard"
:
[
"libs/remix-ui/clipboard/src/index.ts"
],
"@remix-project/remix-solidity-ts"
:
[
"libs/remix-solidity/src/index.ts"
],
"@remix-ui/modal-dialog"
:
[
"libs/remix-ui/modal-dialog/src/index.ts"
],
"@remix-ui/toaster"
:
[
"libs/remix-ui/toaster/src/index.ts"
],
"@remix-ui/file-explorer"
:
[
"libs/remix-ui/file-explorer/src/index.ts"
],
"@remix-ui/workspace"
:
[
"libs/remix-ui/workspace/src/index.ts"
],
"@remix-ui/static-analyser"
:
[
"libs/remix-ui/static-analyser/src/index.ts"
],
"@remix-ui/checkbox"
:
[
"libs/remix-ui/checkbox/src/index.ts"
],
"@remix-ui/project-manager"
:
[
"libs/remix-ui/plugin-manager/src/index.ts"
]
}
},
"exclude"
:
[
"node_modules"
,
"tmp"
]
}
tsconfig.json
View file @
e95ec46b
...
@@ -39,10 +39,10 @@
...
@@ -39,10 +39,10 @@
"@remix-ui/toaster"
:
[
"libs/remix-ui/toaster/src/index.ts"
],
"@remix-ui/toaster"
:
[
"libs/remix-ui/toaster/src/index.ts"
],
"@remix-ui/file-explorer"
:
[
"libs/remix-ui/file-explorer/src/index.ts"
],
"@remix-ui/file-explorer"
:
[
"libs/remix-ui/file-explorer/src/index.ts"
],
"@remix-ui/workspace"
:
[
"libs/remix-ui/workspace/src/index.ts"
],
"@remix-ui/workspace"
:
[
"libs/remix-ui/workspace/src/index.ts"
],
"@remix-ui/settings"
:
[
"libs/remix-ui/settings/src/index.ts"
],
"@remix-ui/static-analyser"
:
[
"libs/remix-ui/static-analyser/src/index.ts"
],
"@remix-ui/static-analyser"
:
[
"libs/remix-ui/static-analyser/src/index.ts"
],
"@remix-ui/checkbox"
:
[
"libs/remix-ui/checkbox/src/index.ts"
],
"@remix-ui/checkbox"
:
[
"libs/remix-ui/checkbox/src/index.ts"
],
"@remix-ui/settings"
:
[
"libs/remix-ui/settings/src/index.ts"
]
"@remix-ui/settings"
:
[
"libs/remix-ui/settings/src/index.ts"
],
"@remix-ui/plugin-manager"
:
[
"libs/remix-ui/plugin-manager/src/index.ts"
]
}
}
},
},
"exclude"
:
[
"node_modules"
,
"tmp"
]
"exclude"
:
[
"node_modules"
,
"tmp"
]
...
...
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