patent-editor 0.1.3 → 0.1.4
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/dist/lib.js +11 -9
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/dist/lib.js
CHANGED
|
@@ -1684,20 +1684,22 @@ const Oe = () => {
|
|
|
1684
1684
|
addKeyboardShortcuts() {
|
|
1685
1685
|
return {
|
|
1686
1686
|
Enter: () => {
|
|
1687
|
-
const { state: e, dispatch: t } = this.editor.view, { $from: n } = e.selection,
|
|
1688
|
-
if (
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1687
|
+
const { state: e, dispatch: t } = this.editor.view, { $from: n, empty: r } = e.selection, a = At(n);
|
|
1688
|
+
if (a === null) return !1;
|
|
1689
|
+
const s = n.node(a), c = n.before(a) + s.nodeSize;
|
|
1690
|
+
if (!r || n.pos !== c - 1) return !1;
|
|
1691
|
+
const l = c;
|
|
1692
|
+
let d = 0;
|
|
1693
|
+
e.doc.descendants((h) => (h.type.name === "claim" && d++, !0));
|
|
1694
|
+
const o = e.schema.nodes.claim.create(
|
|
1693
1695
|
{
|
|
1694
|
-
number:
|
|
1696
|
+
number: d + 1,
|
|
1695
1697
|
claimId: $a(),
|
|
1696
1698
|
dependsOn: [],
|
|
1697
1699
|
dependsOnClaimIds: []
|
|
1698
1700
|
}
|
|
1699
|
-
),
|
|
1700
|
-
return
|
|
1701
|
+
), u = e.tr.insert(l, o), m = l + 1;
|
|
1702
|
+
return u.setSelection(Ie.create(u.doc, m)), t(u), !0;
|
|
1701
1703
|
},
|
|
1702
1704
|
Backspace: () => {
|
|
1703
1705
|
const { state: e, dispatch: t } = this.editor.view, { $from: n, empty: r } = e.selection;
|