-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename addMessage to sendMessage in the chat model, for concistency * Add the selection watcher object, and modify the send button to allow adding selection * Add the selection watcher to the collaborative chat (work only with the side panel widget) * Add a selection watcher to the websocket chat * Automatic application of license header * Change the state of include button on signal * Hide the 'include selection' menu when editing a message or if the tools are not available * Invert the logic to hide the 'include selection' menu * Adopt the same button style for the cancel button * Automatic application of license header * Handle the selected text if the chat is a main area widget * Add the ability to replace the current selection on visible editor * Fixes ui-tests * lint * Fix the selection watcher for a new notebook file * Add tests * update snapshots --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ca4e37b
commit b73f5a8
Showing
33 changed files
with
1,097 additions
and
112 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
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
47 changes: 47 additions & 0 deletions
47
packages/jupyter-chat/src/components/input/cancel-button.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,47 @@ | ||
/* | ||
* Copyright (c) Jupyter Development Team. | ||
* Distributed under the terms of the Modified BSD License. | ||
*/ | ||
|
||
import CancelIcon from '@mui/icons-material/Cancel'; | ||
import React from 'react'; | ||
import { TooltippedButton } from '../mui-extras/tooltipped-button'; | ||
|
||
const CANCEL_BUTTON_CLASS = 'jp-chat-cancel-button'; | ||
|
||
/** | ||
* The cancel button props. | ||
*/ | ||
export type CancelButtonProps = { | ||
inputExists: boolean; | ||
onCancel: () => void; | ||
}; | ||
|
||
/** | ||
* The cancel button. | ||
*/ | ||
export function CancelButton(props: CancelButtonProps): JSX.Element { | ||
const tooltip = 'Cancel edition'; | ||
const disabled = !props.inputExists; | ||
return ( | ||
<TooltippedButton | ||
onClick={props.onCancel} | ||
disabled={disabled} | ||
tooltip={tooltip} | ||
buttonProps={{ | ||
size: 'small', | ||
variant: 'contained', | ||
title: tooltip, | ||
className: CANCEL_BUTTON_CLASS | ||
}} | ||
sx={{ | ||
minWidth: 'unset', | ||
padding: '4px', | ||
borderRadius: '2px 0px 0px 2px', | ||
marginRight: '1px' | ||
}} | ||
> | ||
<CancelIcon /> | ||
</TooltippedButton> | ||
); | ||
} |
Oops, something went wrong.