~statianzo/slate-edit-table

ce7b520a4073e3b709892b26f80a413ae666a5a2 — Jason Staten 3 years ago a06775d
revert some unexpected changes
2 files changed, 1 insertions(+), 11 deletions(-)

M src/utils/TablePosition.js
M src/validation/schema.js
M src/utils/TablePosition.js => src/utils/TablePosition.js +1 -6
@@ 33,12 33,7 @@ class TablePosition extends Record({
        key: string,
    ): TablePosition {
        const node = containerNode.getDescendant(key);
        let ancestors = containerNode.getAncestors(key);
        if (!ancestors) {
          return new TablePosition();
        } else {
          ancestors = ancestors.push(node);
        }
        const ancestors = containerNode.getAncestors(key).push(node);
        const tableBlock = ancestors.findLast(p => p.type === opts.typeTable);
        const rowBlock = ancestors.findLast(p => p.type === opts.typeRow);


M src/validation/schema.js => src/validation/schema.js +0 -5
@@ 23,7 23,6 @@ function schema(opts: Options): Object {
                    editor.insertText(node.text);
                    editor.removeNodeByKey(node.key);
                  }
                  return undefined;
                }
            },
            [opts.typeRow]: {


@@ 35,8 34,6 @@ function schema(opts: Options): Object {
                            return onlyCellsInRow(opts, change, error);
                        case PARENT_TYPE_INVALID:
                            return rowOnlyInTable(opts, change, error);
                        default:
                            return undefined;
                    }
                },
            },


@@ 49,8 46,6 @@ function schema(opts: Options): Object {
                            return onlyBlocksInCell(opts, change, error.node);
                        case PARENT_TYPE_INVALID:
                            return cellOnlyInRow(opts, change, error);
                        default:
                            return undefined;
                    }
                },
            },