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
7c763777
Commit
7c763777
authored
Oct 13, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix passing events to react
parent
77810a86
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
editor.ts
libs/remix-ui/editor/src/lib/actions/editor.ts
+3
-3
remix-ui-editor.tsx
libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
+1
-1
No files found.
libs/remix-ui/editor/src/lib/actions/editor.ts
View file @
7c763777
...
@@ -17,7 +17,7 @@ export const reducerActions = (models = initialState, action: Action) => {
...
@@ -17,7 +17,7 @@ export const reducerActions = (models = initialState, action: Action) => {
const
readOnly
=
action
.
payload
.
readOnly
const
readOnly
=
action
.
payload
.
readOnly
if
(
models
[
uri
])
return
models
// already existing
if
(
models
[
uri
])
return
models
// already existing
const
model
=
monaco
.
editor
.
createModel
(
value
,
language
,
monaco
.
Uri
.
parse
(
uri
))
const
model
=
monaco
.
editor
.
createModel
(
value
,
language
,
monaco
.
Uri
.
parse
(
uri
))
model
.
onDidChangeContent
(()
=>
action
.
payload
.
onDidChangeContent
(
uri
))
model
.
onDidChangeContent
(()
=>
action
.
payload
.
events
.
onDidChangeContent
(
uri
))
models
[
uri
]
=
{
language
,
uri
,
readOnly
,
model
}
models
[
uri
]
=
{
language
,
uri
,
readOnly
,
model
}
return
models
return
models
}
}
...
@@ -66,11 +66,11 @@ export const reducerActions = (models = initialState, action: Action) => {
...
@@ -66,11 +66,11 @@ export const reducerActions = (models = initialState, action: Action) => {
}
}
}
}
export
const
reducerListener
=
(
plugin
,
dispatch
,
monaco
)
=>
{
export
const
reducerListener
=
(
plugin
,
dispatch
,
monaco
,
events
)
=>
{
plugin
.
on
(
'editor'
,
'addModel'
,
(
value
,
language
,
uri
,
readOnly
)
=>
{
plugin
.
on
(
'editor'
,
'addModel'
,
(
value
,
language
,
uri
,
readOnly
)
=>
{
dispatch
({
dispatch
({
type
:
'ADD_MODEL'
,
type
:
'ADD_MODEL'
,
payload
:
{
uri
,
value
,
language
,
readOnly
},
payload
:
{
uri
,
value
,
language
,
readOnly
,
events
},
monaco
monaco
})
})
})
})
...
...
libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
View file @
7c763777
...
@@ -216,7 +216,7 @@ export const EditorUI = (props: EditorUIProps) => {
...
@@ -216,7 +216,7 @@ export const EditorUI = (props: EditorUIProps) => {
function
handleEditorWillMount
(
monaco
)
{
function
handleEditorWillMount
(
monaco
)
{
monacoRef
.
current
=
monaco
monacoRef
.
current
=
monaco
reducerListener
(
props
.
plugin
,
dispatch
,
monacoRef
.
current
)
reducerListener
(
props
.
plugin
,
dispatch
,
monacoRef
.
current
,
props
.
events
)
// see https://microsoft.github.io/monaco-editor/playground.html#customizing-the-appearence-exposed-colors
// see https://microsoft.github.io/monaco-editor/playground.html#customizing-the-appearence-exposed-colors
const
backgroundColor
=
window
.
getComputedStyle
(
document
.
documentElement
).
getPropertyValue
(
'--light'
).
trim
()
const
backgroundColor
=
window
.
getComputedStyle
(
document
.
documentElement
).
getPropertyValue
(
'--light'
).
trim
()
const
infoColor
=
window
.
getComputedStyle
(
document
.
documentElement
).
getPropertyValue
(
'--info'
).
trim
()
const
infoColor
=
window
.
getComputedStyle
(
document
.
documentElement
).
getPropertyValue
(
'--info'
).
trim
()
...
...
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