Commit c8c6e912 authored by gxkai's avatar gxkai

chore: ace

parent 69ee2021
...@@ -55,7 +55,7 @@ const Editor = require('./app/editor/editor') ...@@ -55,7 +55,7 @@ const Editor = require('./app/editor/editor')
const Terminal = require('./app/panels/terminal') const Terminal = require('./app/panels/terminal')
const ContextualListener = require('./app/editor/contextualListener') const ContextualListener = require('./app/editor/contextualListener')
const _paq = window._paq = window._paq || [] const _paq = window._paq = window._paq || []
process.versions ={node: '11.2.0'} // process.versions ={node: '11.2.0'}
const css = csjs` const css = csjs`
html { box-sizing: border-box; } html { box-sizing: border-box; }
...@@ -481,8 +481,7 @@ class App { ...@@ -481,8 +481,7 @@ class App {
await appManager.activatePlugin(['sidePanel']) // activating host plugin separately await appManager.activatePlugin(['sidePanel']) // activating host plugin separately
await appManager.activatePlugin(['home']) await appManager.activatePlugin(['home'])
await appManager.activatePlugin(['settings']) await appManager.activatePlugin(['settings'])
await appManager.activatePlugin(['pluginManager']) await appManager.activatePlugin(['hiddenPanel', 'pluginManager', 'contextualListener', 'terminal', 'blockchain', 'fetchAndCompile', 'contentImport'])
await appManager.activatePlugin(['hiddenPanel', 'contextualListener', 'terminal', 'blockchain', 'fetchAndCompile', 'contentImport'])
appManager.on('filePanel', 'workspaceInitializationCompleted', async () => { appManager.on('filePanel', 'workspaceInitializationCompleted', async () => {
await appManager.registerContextMenuItems() await appManager.registerContextMenuItems()
...@@ -519,10 +518,7 @@ class App { ...@@ -519,10 +518,7 @@ class App {
}).catch(console.error) }).catch(console.error)
} else { } else {
// activate solidity plugin // activate solidity plugin
appManager.activatePlugin(['udapp']) appManager.activatePlugin(['solidity', 'udapp', 'debugger'])
appManager.activatePlugin(['solidity'])
// appManager.activatePlugin(['optimism-compiler'])
appManager.activatePlugin(['debugger'])
} }
}) })
......
...@@ -22,13 +22,13 @@ export class WalkthroughService { ...@@ -22,13 +22,13 @@ export class WalkthroughService {
tooltipClass: 'bg-light text-dark', tooltipClass: 'bg-light text-dark',
position: 'right' position: 'right'
}, },
// { {
// title: 'Deploy your contract', title: 'Deploy your contract',
// element: document.querySelector('#runIcons'), element: document.querySelector('#runIcons'),
// intro: 'Choose a chain, deploy a contract and play with your functions.', intro: 'Choose a chain, deploy a contract and play with your functions.',
// tooltipClass: 'bg-light text-dark', tooltipClass: 'bg-light text-dark',
// position: 'right' position: 'right'
// } }
] ]
}).onafterchange((targetElement) => { }).onafterchange((targetElement) => {
const header = document.getElementsByClassName('introjs-tooltip-header')[0] const header = document.getElementsByClassName('introjs-tooltip-header')[0]
......
...@@ -81,7 +81,7 @@ export const EditorUI = (props: EditorUIProps) => { ...@@ -81,7 +81,7 @@ export const EditorUI = (props: EditorUIProps) => {
const [currentMarkers, setCurrentMarkers] = useState({}) const [currentMarkers, setCurrentMarkers] = useState({})
const editorRef = useRef<Ace.Editor>(null) const editorRef = useRef<Ace.Editor>(null)
const currentFileRef = useRef('') const currentFileRef = useRef('')
const aceRef = useRef(null) const aceRef = useRef<typeof AceBuilds>(null)
const [editorModelsState, dispatch] = useReducer(reducerActions, initialState) const [editorModelsState, dispatch] = useReducer(reducerActions, initialState)
...@@ -166,13 +166,6 @@ export const EditorUI = (props: EditorUIProps) => { ...@@ -166,13 +166,6 @@ export const EditorUI = (props: EditorUIProps) => {
} }
} }
// props.editorAPI.getCursorPosition = () => {
// // if (!monacoRef.current) return
// const model = editorModelsState[currentFileRef.current]?.model
// if (model) {
// return model.getOffsetAt(editorRef.current.getPosition())
// }
// }
props.editorAPI.getCursorPosition = () => { props.editorAPI.getCursorPosition = () => {
if (!aceRef.current) return if (!aceRef.current) return
const model = editorModelsState[currentFileRef.current]?.model const model = editorModelsState[currentFileRef.current]?.model
...@@ -191,11 +184,12 @@ export const EditorUI = (props: EditorUIProps) => { ...@@ -191,11 +184,12 @@ export const EditorUI = (props: EditorUIProps) => {
if (!editorRef.current) return if (!editorRef.current) return
return Number(editorRef.current.getFontSize()) return Number(editorRef.current.getFontSize())
} }
function onLoad(editor: Ace.Editor) { function onLoad(editor: Ace.Editor) {
editorRef.current = editor editorRef.current = editor
reducerListener(props.plugin, dispatch, aceRef.current, editorRef.current, props.events) reducerListener(props.plugin, dispatch, aceRef.current, editorRef.current, props.events)
setTimeout(()=> {
props.events.onEditorMounted() props.events.onEditorMounted()
}, 1000)
// @ts-ignore // @ts-ignore
editor.on('guttermousedown', e => { editor.on('guttermousedown', e => {
const row = e.getDocumentPosition().row const row = e.getDocumentPosition().row
......
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