diff --git a/apps/remix-ide-e2e/src/tests/solidityImport_group1.spec.ts b/apps/remix-ide-e2e/src/tests/solidityImport_group1.spec.ts deleted file mode 100644 index eda1e433aa..0000000000 --- a/apps/remix-ide-e2e/src/tests/solidityImport_group1.spec.ts +++ /dev/null @@ -1,6 +0,0 @@ -'use strict' -import * as test from './solidityImport.test' -import buildGroupTest from '../helpers/buildgrouptest' -const group = 'group1' - -module.exports = buildGroupTest(group, test) diff --git a/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts b/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts index 0fcbcfe2ee..63a98743a6 100644 --- a/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts +++ b/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts @@ -27,6 +27,6 @@ module.exports = { .click('*[id="menuitemdeactivate"]') .click('*[data-id="verticalIconsKindsettings"]') .click('*[data-id="verticalIconsKindpluginManager"]') - .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugPlugin"]') + .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]') } } diff --git a/apps/remix-ide/src/app/tabs/plugin-tab.js b/apps/remix-ide/src/app/tabs/plugin-tab.js deleted file mode 100644 index 66402117bc..0000000000 --- a/apps/remix-ide/src/app/tabs/plugin-tab.js +++ /dev/null @@ -1,22 +0,0 @@ -var yo = require('yo-yo') -var css = require('./styles/plugin-tab-styles') - -class PluginTab { - constructor (json) { - this.el = null - this.data = { json } - } - - render () { - if (this.el) return this.el - - this.el = yo` -
- -
` - - return this.el - } -} - -module.exports = PluginTab diff --git a/libs/remix-ui/editor-context-view/src/index.ts b/libs/remix-ui/editor-context-view/src/index.ts index b595accc41..d6a5ef0beb 100644 --- a/libs/remix-ui/editor-context-view/src/index.ts +++ b/libs/remix-ui/editor-context-view/src/index.ts @@ -1 +1 @@ -export * from './lib/remix-ui-editor-context-view'; +export * from './lib/remix-ui-editor-context-view' diff --git a/libs/remix-ui/editor-context-view/src/lib/remix-ui-editor-context-view.tsx b/libs/remix-ui/editor-context-view/src/lib/remix-ui-editor-context-view.tsx index e0c0898868..d2668d57d3 100644 --- a/libs/remix-ui/editor-context-view/src/lib/remix-ui-editor-context-view.tsx +++ b/libs/remix-ui/editor-context-view/src/lib/remix-ui-editor-context-view.tsx @@ -38,15 +38,13 @@ export interface RemixUiEditorContextViewProps { function isDefinition (node: any) { return node.nodeType === 'ContractDefinition' || - node.nodeType === 'FunctionDefinition' || - node.nodeType === 'ModifierDefinition' || - node.nodeType === 'VariableDeclaration' || - node.nodeType === 'StructDefinition' || - node.nodeType === 'EventDefinition' + node.nodeType === 'FunctionDefinition' || + node.nodeType === 'ModifierDefinition' || + node.nodeType === 'VariableDeclaration' || + node.nodeType === 'StructDefinition' || + node.nodeType === 'EventDefinition' } - - type nullableAstNode = astNode | null export function RemixUiEditorContextView (props: RemixUiEditorContextViewProps) { @@ -68,7 +66,7 @@ export function RemixUiEditorContextView (props: RemixUiEditorContextViewProps) currentNode: null, gasEstimation: { executionCost: '', codeDepositCost: '' } }) - + useEffect(() => { props.onContextListenerChanged(async (nodes: Array) => { if (gotoLineDisableRef.current) { @@ -88,9 +86,9 @@ export function RemixUiEditorContextView (props: RemixUiEditorContextViewProps) references = await props.referencesOf(currentNode) if (currentNode.nodeType === 'FunctionDefinition') { gasEstimation = await props.gasEstimation(currentNode) - } + } } - let activeHighlights = await props.getActiveHighlights() + const activeHighlights = await props.getActiveHighlights() setState(prevState => { return { ...prevState, nodes, references, activeHighlights, currentNode, gasEstimation } }) diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.css b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.css index 74b88d8b76..02a4b1f9fa 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.css +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.css @@ -202,6 +202,7 @@ element.style { bottom : 1em; border-width : 4px; left : 2em; + overflow-y : scroll; } .autoCompleteItem { diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index 5a7c7295b5..132196724b 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -367,6 +367,12 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { } } + const handleClickSelect = (item: string) => { + const result: string = getKeyOf(item) as string || getValueOf(item) as string + setAutoCompleteState(prevState => ({ ...prevState, showSuggestions: false, userInput: result })) + inputEl.current.focus() + } + const handleSelect = (event) => { const suggestionCount = autoCompletState.activeSuggestion if (event.keyCode === 38) { @@ -402,11 +408,11 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { } const handleAutoComplete = () => ( -
0 ? 'block' : 'none' }}> +
2)) && autoCompletState.data._options.length > 0 ? 'block' : 'none' }}>
{autoCompletState.data._options.map((item, index) => { return ( -
+
handleClickSelect(item)}>
{getKeyOf(item)}
diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx index 010aa20366..c78610052b 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx @@ -26,31 +26,31 @@ function RequiredSection ({ verticalIconsPlugin, itemContextAction, addActive, r removeActive={removeActive} itemContextAction={itemContextAction} /> - - - - - clientHeight) scrollState = true + return { scrollHeight, clientHeight, scrollState } + } + return prevState +} diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx index 3496f468d9..cdf4cab889 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx @@ -3,7 +3,9 @@ import React, { Fragment, useEffect, - useRef + useReducer, + useRef, + useState } from 'react' import './remix-ui-vertical-icons-panel.css' @@ -12,17 +14,44 @@ import { VerticalIcons } from '../../types/vertical-icons-panel' import Home from './components/Home' import Settings from './components/Settings' import { RequiredSection } from './components/RequiredSection' +import { verticalScrollReducer } from './reducers/verticalScrollReducer' export interface RemixUiVerticalIconsPanelProps { verticalIconsPlugin: VerticalIcons } let scrollHeight: any +const initialState = { + scrollHeight: 0, + clientHeight: 0, + scrollState: false +} + export function RemixUiVerticalIconsPanel ({ verticalIconsPlugin }: RemixUiVerticalIconsPanelProps) { const scrollableRef = useRef() const iconPanelRef = useRef() + const [activateScroll, dispatchScrollAction] = useReducer(verticalScrollReducer, initialState) + + useEffect(() => { + const evaluateScrollability = (evt: any) => { + console.log('resize event answered by dispatch!') + dispatchScrollAction({ + type: 'resize', + payload: { + scrollHeight: document.querySelector('#remixuiScrollable')?.scrollHeight, + clientHeight: document.querySelector('#remixuiScrollable')?.clientHeight, + scrollState: false + } + }) + } + addEventListener('resize', evaluateScrollability) + + return () => { + removeEventListener('resize', evaluateScrollability) + } + }) function onThemeChanged (themeType: any) { const invert = themeType === 'dark' ? 1 : 0 @@ -51,6 +80,7 @@ export function RemixUiVerticalIconsPanel ({ } function addActive (name: string) { + console.log('addactive has been called now.') if (name === 'home') return const themeType = verticalIconsPlugin.registry.get('themeModule').api.currentTheme().quality const invert = themeType === 'dark' ? 1 : 0 @@ -98,7 +128,7 @@ export function RemixUiVerticalIconsPanel ({
scrollableRef.current.clientHeight - ? 'remixui_default-icons-container remixui_requiredSection' : 'remixui_requiredSection'}> + ? 'remixui_default-icons-container remixui_requiredSection' : activateScroll && activateScroll.scrollState ? 'remixui_default-icons-container remixui_requiredSection' : 'remixui_requiredSection'}> scrollableRef.current.clientHeight ? 'remixui_default-icons-container remixui_scrollable-container remixui_scrollbar remixui_hide-scroll' - : 'remixui_scrollable-container remixui_scrollbar remixui_hide-scroll'} + : activateScroll && activateScroll.scrollState ? 'remixui_default-icons-container remixui_scrollable-container remixui_scrollbar remixui_hide-scroll' : 'remixui_scrollable-container remixui_scrollbar remixui_hide-scroll'} ref={scrollableRef} >