Skip to content

Commit

Permalink
Fix formatting issues
Browse files Browse the repository at this point in the history
Signed-off-by: andrewkuryan <[email protected]>
  • Loading branch information
andrewkuryan committed May 21, 2024
1 parent b9e54da commit b3edbcc
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ export const columnHandlerDecoration = (state: EditorState, table: TableNodeLoca
return decorations
}

const handleMouseDown = (col: number, table: TableNodeLocation, event: MouseEvent, editor: Editor, isSelected: boolean): void => {
const handleMouseDown = (
col: number,
table: TableNodeLocation,
event: MouseEvent,
editor: Editor,
isSelected: boolean
): void => {
event.stopPropagation()
event.preventDefault()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,3 @@ export const handleSvg = `<svg width="16" height="16" viewBox="0 0 16 16" fill="
<path d="M1.00012 6C1.00012 5.44771 1.44784 5 2.00012 5C2.55241 5 3.00012 5.44771 3.00012 6C3.00012 6.55228 2.55241 7 2.00012 7C1.44784 7 1.00012 6.55228 1.00012 6Z" fill="currentColor"/>
<path d="M14 5C13.4477 5 13 5.44772 13 6C13 6.55228 13.4477 7 14 7C14.5523 7 15 6.55229 15 6C15 5.44772 14.5523 5 14 5Z" fill="currentColor"/>
</svg>`

export const optionsSvg = `<svg width="16" height="16" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 8C14 9.10457 14.8954 10 16 10C17.1046 10 18 9.10457 18 8C18 6.89543 17.1046 6 16 6C14.8954 6 14 6.89543 14 8Z" fill="currentColor"/>
<path d="M14 16C14 17.1046 14.8954 18 16 18C17.1046 18 18 17.1046 18 16C18 14.8954 17.1046 14 16 14C14.8954 14 14 14.8954 14 16Z" fill="currentColor"/>
<path d="M16 26C14.8954 26 14 25.1046 14 24C14 22.8954 14.8954 22 16 22C17.1046 22 18 22.8954 18 24C18 25.1046 17.1046 26 16 26Z" fill="currentColor"/>
</svg>`
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ export const rowHandlerDecoration = (state: EditorState, table: TableNodeLocatio
return decorations
}

const handleMouseDown = (row: number, table: TableNodeLocation, event: MouseEvent, editor: Editor, isSelected: boolean): void => {
const handleMouseDown = (
row: number,
table: TableNodeLocation,
event: MouseEvent,
editor: Editor,
isSelected: boolean
): void => {
event.stopPropagation()
event.preventDefault()

Expand Down
4 changes: 2 additions & 2 deletions packages/text-editor/src/components/extension/table/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function getSelectedRect (selection: CellSelection, map: TableMap): Rect {
export const getSelectedRows = (selection: Selection, map: TableMap): number[] => {
if (selection instanceof CellSelection && selection.isRowSelection()) {
const selectedRect = getSelectedRect(selection, map)
return [...Array(selectedRect.bottom - selectedRect.top).keys()].map(idx => idx + selectedRect.top)
return [...Array(selectedRect.bottom - selectedRect.top).keys()].map((idx) => idx + selectedRect.top)
}

return []
Expand All @@ -111,7 +111,7 @@ export const getSelectedRows = (selection: Selection, map: TableMap): number[] =
export const getSelectedColumns = (selection: Selection, map: TableMap): number[] => {
if (selection instanceof CellSelection && selection.isColSelection()) {
const selectedRect = getSelectedRect(selection, map)
return [...Array(selectedRect.right - selectedRect.left).keys()].map(idx => idx + selectedRect.left)
return [...Array(selectedRect.right - selectedRect.left).keys()].map((idx) => idx + selectedRect.left)
}

return []
Expand Down
12 changes: 10 additions & 2 deletions packages/text-editor/src/components/icons/table/Duplicate.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
</script>

<svg class="svg-{size}" {fill} viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3C5 1.89543 5.89543 1 7 1H12C13.1046 1 14 1.89543 14 3V10C14 11.1046 13.1046 12 12 12H7C5.89543 12 5 11.1046 5 10V3ZM7 2C6.44772 2 6 2.44772 6 3V10C6 10.5523 6.44772 11 7 11H12C12.5523 11 13 10.5523 13 10V3C13 2.44772 12.5523 2 12 2H7Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 5C3.44772 5 3 5.44772 3 6V13C3 13.5523 3.44772 14 4 14H9C9.55228 14 10 13.5523 10 13V12H11V13C11 14.1046 10.1046 15 9 15H4C2.89543 15 2 14.1046 2 13V6C2 4.89543 2.89543 4 4 4H5V5H4Z" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M5 3C5 1.89543 5.89543 1 7 1H12C13.1046 1 14 1.89543 14 3V10C14 11.1046 13.1046 12 12 12H7C5.89543 12 5 11.1046 5 10V3ZM7 2C6.44772 2 6 2.44772 6 3V10C6 10.5523 6.44772 11 7 11H12C12.5523 11 13 10.5523 13 10V3C13 2.44772 12.5523 2 12 2H7Z"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M4 5C3.44772 5 3 5.44772 3 6V13C3 13.5523 3.44772 14 4 14H9C9.55228 14 10 13.5523 10 13V12H11V13C11 14.1046 10.1046 15 9 15H4C2.89543 15 2 14.1046 2 13V6C2 4.89543 2.89543 4 4 4H5V5H4Z"
/>
</svg>

0 comments on commit b3edbcc

Please sign in to comment.