-
-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
739 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "selenium-ide", | ||
"version": "4.0.1-alpha.74", | ||
"version": "4.0.1-alpha.75", | ||
"private": false, | ||
"description": "Selenium IDE electron app", | ||
"author": "Todd <[email protected]>", | ||
|
@@ -111,7 +111,7 @@ | |
"@seleniumhq/code-export-python-pytest": "^4.0.0-alpha.4", | ||
"@seleniumhq/code-export-ruby-rspec": "^4.0.0-alpha.3", | ||
"@seleniumhq/get-driver": "^4.0.0-alpha.3", | ||
"@seleniumhq/side-api": "^4.0.0-alpha.42", | ||
"@seleniumhq/side-api": "^4.0.0-alpha.43", | ||
"@seleniumhq/side-commons": "^4.0.0-alpha.2", | ||
"@seleniumhq/side-model": "^4.0.0-alpha.5", | ||
"@seleniumhq/side-runtime": "^4.0.0-alpha.35", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/selenium-ide/src/browser/windows/ProjectEditor/components/PlaybackTabBar/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import Paper from '@mui/material/Paper' | ||
import React from 'react' | ||
import PlaybackTab, { TabShape } from './tab' | ||
|
||
const { | ||
windows: { | ||
onPlaybackWindowChanged, | ||
onPlaybackWindowClosed, | ||
onPlaybackWindowOpened, | ||
}, | ||
} = window.sideAPI | ||
console.log(onPlaybackWindowChanged, onPlaybackWindowClosed, onPlaybackWindowOpened) | ||
|
||
const PlaybackTabBar: React.FC = () => { | ||
const [tabs, setTabs] = React.useState<TabShape[]>([]) | ||
React.useEffect(() => { | ||
onPlaybackWindowChanged.addListener((id, partialTab) => { | ||
setTabs((tabs) => { | ||
const tab = tabs.find((tab) => tab.id === id) | ||
if (!tab) return tabs | ||
return tabs.map((tab) => { | ||
if (tab.id !== id) return tab | ||
return { | ||
...tab, | ||
...partialTab, | ||
} | ||
}) | ||
}) | ||
}); | ||
onPlaybackWindowOpened.addListener((id, {title}) => { | ||
setTabs((tabs) => [...tabs, { id, focused: false, title }]) | ||
}); | ||
onPlaybackWindowClosed.addListener((id) => { | ||
setTabs((tabs) => tabs.filter((tab) => tab.id !== id)) | ||
}); | ||
}, []); | ||
return ( | ||
<Paper | ||
className="flex flex-initial flex-row px-3 width-100" | ||
elevation={5} | ||
square | ||
sx={{ | ||
height: 40, | ||
}} | ||
> | ||
{tabs.map((tab) => ( | ||
<PlaybackTab key={tab.id} {...tab} /> | ||
))} | ||
</Paper> | ||
) | ||
} | ||
|
||
export default PlaybackTabBar |
52 changes: 52 additions & 0 deletions
52
packages/selenium-ide/src/browser/windows/ProjectEditor/components/PlaybackTabBar/tab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import Clear from '@mui/icons-material/Clear' | ||
import Box from '@mui/material/Box' | ||
import IconButton from '@mui/material/IconButton' | ||
import Paper from '@mui/material/Paper' | ||
import Typography from '@mui/material/Typography' | ||
import React from 'react' | ||
|
||
const { | ||
windows: { closePlaybackWindow, focusPlaybackWindow }, | ||
} = window.sideAPI | ||
|
||
export type TabShape = { | ||
id: number | ||
title: string | ||
focused: boolean | ||
} | ||
|
||
const PlaybackTab: React.FC<TabShape> = ({ focused, id, title }) => { | ||
return ( | ||
<Paper | ||
className="flex flex-1 flex-row mw-200 mx-2 ps-3" | ||
elevation={10} | ||
onClick={() => { | ||
focusPlaybackWindow(id) | ||
}} | ||
square | ||
sx={{ | ||
marginBottom: focused ? 0 : 0.25, | ||
}} | ||
> | ||
<Box className="flex-1 text-overflow"> | ||
<Box className="flex flex-col height-100" justifyContent="center"> | ||
<Typography variant="subtitle1">{title}</Typography> | ||
</Box> | ||
</Box> | ||
<Box className="flex flex-initial"> | ||
<IconButton | ||
onClick={(e) => { | ||
e.preventDefault() | ||
e.stopPropagation() | ||
closePlaybackWindow(id) | ||
}} | ||
sx={{ borderRadius: 0.5 }} | ||
> | ||
<Clear /> | ||
</IconButton> | ||
</Box> | ||
</Paper> | ||
) | ||
} | ||
|
||
export default PlaybackTab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.