Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .yarn/install-state
Binary file not shown.
Binary file modified .yarn/install-state.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export function deleteLastCol(
export function changeCellsBackgroundColor(
state: EditorState,
dispatch: (tr: Transaction) => void,
color: string
color: string,
): void

export function toggleTableHeaders(
Expand All @@ -375,7 +375,7 @@ export function getDeleteCommand(
export function isCellColorActive(
state: EditorState,
color: string
)
): boolean

export function getSelectedCellsCoords(
view: EditorView
Expand All @@ -390,7 +390,7 @@ export function getSelectedCellsCoords(

export function setBaseName(
name: string
)
): void

export function fixTables(
state: EditorState,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skiff-org/prosemirror-tables",
"version": "3.5.1",
"version": "3.5.2",
"description": "ProseMirror's rowspan/colspan tables component",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
1 change: 0 additions & 1 deletion src/columnhandles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {setNodeAttrs} from './schema/schema';
import {cellExtraAttrs} from './schema/cellAttrs';
import {CellSelection} from './cellselection';
import {tableHeadersMenuKey} from './columnsTypes/types.config';
import {isCellInFirstRow} from './columnsTypes/utils';

export const key = new PluginKey('tableColumnHandles');

Expand Down
7 changes: 4 additions & 3 deletions src/columnresizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ function currentColWidth(view, cellPos, {colspan, colwidth}) {

function domCellAround(target) {
while (target && target.nodeName != 'TD' && target.nodeName != 'TH')
target = target.classList.contains('ProseMirror')
? null
: target.parentNode;
target =
target.classList && target.classList.contains('ProseMirror')
? null
: target.parentNode;
return target;
}

Expand Down
9 changes: 4 additions & 5 deletions src/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ export const deleteLastRow = (state, dispatch) => {
);

dispatch(tr);
return true;
};

export const deleteLastCol = (state, dispatch) => {
Expand All @@ -941,6 +942,7 @@ export const deleteLastCol = (state, dispatch) => {
);

dispatch(tr);
return true;
};

export const changeCellsBackgroundColor = (state, dispatch, color) => {
Expand All @@ -949,12 +951,9 @@ export const changeCellsBackgroundColor = (state, dispatch, color) => {
const {tr} = state;
state.selection.forEachCell((cell, pos, parent) => {
if (parent.attrs.hidden) return;
tr.setNodeMarkup(
pos,
undefined,
Object.assign({}, cell.attrs, {background: color})
);
tr.setNodeMarkup(pos, undefined, {...cell.attrs, background: color});
});

dispatch(tr);
};

Expand Down
3 changes: 2 additions & 1 deletion src/filters/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ const SelectDropdown = ({
}

setShowDropdown(!showDropdown);
if (!showDropdown) document.addEventListener('click', closeDropdown);
if (!showDropdown)
setTimeout(() => document.addEventListener('click', closeDropdown), 0);
}, [closeDropdown, parentRef, showDropdown]);

const updateValue = useCallback(
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
import {key as tableEditingKey} from './util';
import {drawCellSelection, normalizeSelection} from './cellselection';
import {fixTables, fixTablesKey} from './fixtables';
import tablePopUpMenu, {tablePopUpMenuKey} from './tooltip-menus/index';
import CheckboxNodeView from './columnsTypes/types/Checkbox/NodeView';
import DateComponent from './columnsTypes/types/Date/Component.jsx';
import DateTypeNodeView from './columnsTypes/types/Date/NodeView';
Expand Down Expand Up @@ -128,7 +127,6 @@ export {
insertCells as __insertCells,
clipCells as __clipCells
} from './copypaste';
export {tablePopUpMenu, tablePopUpMenuKey};
export {tableHeadersMenu} from './headers/headers-menu/index';
export {selectionShadowPlugin} from './selectionshadow';
export {typesEnforcer} from './columnsTypes/typesEnforcer';
Expand Down
5 changes: 3 additions & 2 deletions src/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ function endOfTextblockVertical(view, state, dir, selection) {
const coords = view.coordsAtPos($pos.pos, 1);
for (let child = dom.firstChild; child; child = child.nextSibling) {
let boxes;
if (child.nodeType == 1) {
if (child && child.nodeType == 1) {
boxes = child.getClientRects();
} else if (child.nodeType == 3) {
} else if (child && child.nodeType == 3) {
boxes = textRange(child, 0, child.nodeValue.length).getClientRects();
} else {
continue;
Expand Down Expand Up @@ -170,6 +170,7 @@ function endOfTextblockHorizontal(view, state, dir, selection) {
? view.docView.domAfterPos($head.before())
: view.dom;
const result =
!sel.focusNode ||
!parentDOM.contains(
sel.focusNode.nodeType == 1 ? sel.focusNode : sel.focusNode.parentNode
) ||
Expand Down
60 changes: 0 additions & 60 deletions src/tooltip-menus/commands.js

This file was deleted.

18 changes: 0 additions & 18 deletions src/tooltip-menus/index.js

This file was deleted.

114 changes: 0 additions & 114 deletions src/tooltip-menus/items.js

This file was deleted.

Loading