@meta-1/editor 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +29 -29
- package/src/components/tiptap-node/paragraph-node/paragraph-node.css +12 -4
- package/src/components/tiptap-node/table-node/lib/tiptap-table-utils.ts +412 -499
- package/src/components/tiptap-node/table-node/ui/table-duplicate-row-column-button/use-table-duplicate-row-column.ts +2 -0
- package/src/lib/tiptap-advanced-utils.ts +1 -1
- package/src/lib/tiptap-utils.ts +1 -1
|
@@ -119,6 +119,7 @@ function duplicateRow({ editor, index, tablePos }: { editor: Editor; index: numb
|
|
|
119
119
|
const state = selectCellsByCoords(editor, tablePos, sourceCoords, {
|
|
120
120
|
mode: "state",
|
|
121
121
|
});
|
|
122
|
+
if (!state) return false;
|
|
122
123
|
addSuccess = addRowAfter(state, editor.view.dispatch);
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -191,6 +192,7 @@ function duplicateColumn({ editor, index, tablePos }: { editor: Editor; index: n
|
|
|
191
192
|
const state = selectCellsByCoords(editor, tablePos, sourceCoords, {
|
|
192
193
|
mode: "state",
|
|
193
194
|
});
|
|
195
|
+
if (!state) return false;
|
|
194
196
|
addSuccess = addColumnAfter(state, editor.view.dispatch);
|
|
195
197
|
}
|
|
196
198
|
|
|
@@ -247,7 +247,7 @@ export function getAllMatchingNodes(
|
|
|
247
247
|
|
|
248
248
|
const { selection } = editor.state
|
|
249
249
|
const { nodeName, isBlock = true, predicate } = options || {}
|
|
250
|
-
const matches = []
|
|
250
|
+
const matches: Array<{ node: Node; pos: number; depth: number }> = []
|
|
251
251
|
|
|
252
252
|
const nodeMatches = (node: Node) => {
|
|
253
253
|
const matchesName = !nodeName || node.type.name === nodeName
|
package/src/lib/tiptap-utils.ts
CHANGED
|
@@ -528,7 +528,7 @@ export function selectCurrentBlockContent(editor: Editor) {
|
|
|
528
528
|
if (!selection.empty) return
|
|
529
529
|
|
|
530
530
|
const $pos = selection.$from
|
|
531
|
-
let blockNode = null
|
|
531
|
+
let blockNode: PMNode | null = null
|
|
532
532
|
let blockPos = -1
|
|
533
533
|
|
|
534
534
|
for (let depth = $pos.depth; depth >= 0; depth--) {
|