Commit c8c6e912 authored by gxkai's avatar gxkai

chore: ace

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