-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
43a01e5
commit 1a920f8
Showing
15 changed files
with
302 additions
and
385 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,21 +1 @@ | ||
Paper | ||
|
||
### Contributors | ||
|
||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): | ||
|
||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
<!-- prettier-ignore-start --> | ||
<!-- markdownlint-disable --> | ||
<table> | ||
<tr> | ||
<td align="center"><a href="https://github.com/Raathigesh"><img src="https://avatars.githubusercontent.com/u/3108160?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Raathi Kugarajan</b></sub></a><br /><a href="https://github.com/Raathigesh/Jest tools/commits?author=Raathigesh" title="Code">💻</a> <a href="https://github.com/Raathigesh/Jest tools/commits?author=Raathigesh" title="Documentation">📖</a> <a href="#ideas-Raathigesh" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-Raathigesh" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-Raathigesh" title="Maintenance">🚧</a></td> | ||
</tr> | ||
</table> | ||
|
||
<!-- markdownlint-restore --> | ||
<!-- prettier-ignore-end --> | ||
|
||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
|
||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Tooltip, Button } from '@chakra-ui/react'; | ||
import React from 'react'; | ||
|
||
interface Props { | ||
onClick: () => void; | ||
tooltip: string; | ||
icon: any; | ||
} | ||
|
||
export function EditorFloatingButton({ onClick, tooltip, icon }: Props) { | ||
return ( | ||
<Tooltip label={tooltip}> | ||
<Button | ||
size="xs" | ||
backgroundColor="#2F2E31" | ||
color="#f1f0ee" | ||
_hover={{ backgroundColor: '#090909' }} | ||
onClick={onClick} | ||
> | ||
{icon} | ||
</Button> | ||
</Tooltip> | ||
); | ||
} |
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,87 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { NodeViewWrapper } from '@tiptap/react'; | ||
import { | ||
Input, | ||
Box, | ||
IconButton, | ||
Flex, | ||
Modal, | ||
ModalOverlay, | ||
ModalContent, | ||
ModalHeader, | ||
ModalCloseButton, | ||
ModalBody, | ||
ModalFooter, | ||
Button, | ||
} from '@chakra-ui/react'; | ||
import { Edit, Check, Edit2, Trash } from 'react-feather'; | ||
import './styles.css'; | ||
|
||
const API_URL = `http://localhost:${(window as any).port || '4545'}`; | ||
|
||
export default (props: any) => { | ||
const setPath = (bookmark: string) => { | ||
props.updateAttributes({ | ||
path: bookmark, | ||
}); | ||
}; | ||
|
||
const getActivePath = async () => { | ||
if (props.node.attrs.path === '') { | ||
const response = await fetch(`${API_URL}/activeFilePath`); | ||
const data = await response.json(); | ||
if (data.activeFilePath) { | ||
setPath(data.activeFilePath); | ||
} | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
getActivePath(); | ||
}, []); | ||
|
||
const openFile = (path: string) => { | ||
fetch(`${API_URL}/open-file`, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
filePath: path, | ||
}), | ||
}); | ||
}; | ||
|
||
return ( | ||
<NodeViewWrapper className="bookmarkRenderer"> | ||
<Flex | ||
display="inline-flex" | ||
backgroundColor="#0087FF" | ||
borderRadius="3px" | ||
paddingLeft="5px" | ||
fontSize="13px" | ||
cursor="pointer" | ||
_hover={{ backgroundColor: '#0074da' }} | ||
minHeight="25px" | ||
alignItems="center" | ||
onClick={() => openFile(props.node.attrs.path)} | ||
> | ||
<Flex marginLeft="5px">{props.node.attrs.path}</Flex> | ||
<Flex | ||
_hover={{ backgroundColor: '#0074da' }} | ||
padding="6px" | ||
borderRadius="0px 3px 3px 0px" | ||
onClick={e => { | ||
e.stopPropagation(); | ||
props.deleteNode(); | ||
}} | ||
marginLeft="5px" | ||
height="100%" | ||
alignItems="center" | ||
> | ||
<Trash size="12px" strokeWidth="2px" /> | ||
</Flex> | ||
</Flex> | ||
</NodeViewWrapper> | ||
); | ||
}; |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.