-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1116 from geyserfund/feat/markdown-tables
Feat/markdown tables
- Loading branch information
Showing
30 changed files
with
983 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { popoverAnatomy } from '@chakra-ui/anatomy' | ||
import { createMultiStyleConfigHelpers } from '@chakra-ui/react' | ||
|
||
const { definePartsStyle, defineMultiStyleConfig } = | ||
createMultiStyleConfigHelpers(popoverAnatomy.keys) | ||
|
||
const baseStyle = definePartsStyle({ | ||
body: { | ||
bg: 'neutral.0', | ||
borderRadius: '8px', | ||
}, | ||
}) | ||
|
||
export const popOverTheme = defineMultiStyleConfig({ baseStyle }) |
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,69 @@ | ||
import { ChevronDownIcon } from '@chakra-ui/icons' | ||
import { | ||
IconButton, | ||
Menu, | ||
MenuButton, | ||
MenuItem, | ||
MenuItemProps, | ||
MenuList, | ||
VStack, | ||
} from '@chakra-ui/react' | ||
import { useCommands } from '@remirror/react' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
export const TableCellMenuComponent = () => { | ||
const { t } = useTranslation() | ||
const commands = useCommands() | ||
|
||
return ( | ||
<Menu> | ||
<MenuButton | ||
mr="5px" | ||
size="sm" | ||
as={IconButton} | ||
icon={<ChevronDownIcon />} | ||
border="1px solid" | ||
borderRadius="4px" | ||
borderColor="neutral.200" | ||
_hover={{ color: 'primary.400', borderColor: 'primary.400' }} | ||
/> | ||
<MenuList | ||
as={VStack} | ||
bg="neutral.0" | ||
border="1px solid" | ||
borderColor="neutral.200" | ||
borderRadius={'4px'} | ||
> | ||
<ModifiedMenuItem onClick={() => commands.addTableRowBefore()}> | ||
{t('Add row above')} | ||
</ModifiedMenuItem> | ||
<ModifiedMenuItem onClick={() => commands.addTableRowAfter()}> | ||
{t('Add row below')} | ||
</ModifiedMenuItem> | ||
<ModifiedMenuItem onClick={() => commands.addTableColumnBefore()}> | ||
{t('Add column left')} | ||
</ModifiedMenuItem> | ||
<ModifiedMenuItem onClick={() => commands.addTableColumnAfter()}> | ||
{t('Add column right')} | ||
</ModifiedMenuItem> | ||
<ModifiedMenuItem onClick={() => commands.deleteTableColumn()}> | ||
{t('Remove column')} | ||
</ModifiedMenuItem> | ||
<ModifiedMenuItem onClick={() => commands.deleteTableRow()}> | ||
{t('Remove row')} | ||
</ModifiedMenuItem> | ||
</MenuList> | ||
</Menu> | ||
) | ||
} | ||
|
||
const ModifiedMenuItem = (props: MenuItemProps) => { | ||
return ( | ||
<MenuItem | ||
paddingX="10px" | ||
paddingY="5px" | ||
_hover={{ bg: 'neutral.200' }} | ||
{...props} | ||
/> | ||
) | ||
} |
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
Oops, something went wrong.