slate-vue3 0.13.0 → 0.13.2

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/core.js CHANGED
@@ -1,5 +1,5 @@
1
- import { P, a, R, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, Q, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq } from "./create-editor-DAXIS6Lk.js";
2
- import { E as E2, a as a10, L as L2, N as N2, O as O2, P as P2, b as b2, R as R2, S as S2, c as c2, T as T2, d as d2, i as i2, e as e2 } from "./index-C2VZD0rk.js";
1
+ import { P, a, R, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, Q, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq } from "./create-editor-z7CFqjGE.js";
2
+ import { E as E2, a as a10, L as L2, N as N2, O as O2, P as P2, b as b2, R as R2, S as S2, c as c2, T as T2, d as d2, i as i2, e as e2 } from "./index-B_A1dZu-.js";
3
3
  export {
4
4
  E2 as Editor,
5
5
  a10 as Element,
@@ -1,4 +1,4 @@
1
- import { P as Path, b as Point, R as Range, E as Editor, d as Transforms, N as Node, T as Text, L as Location, g as getDefaultInsertLocation, S as Scrubber } from "./index-C2VZD0rk.js";
1
+ import { P as Path, b as Point, R as Range, E as Editor, d as Transforms, N as Node, T as Text, L as Location, g as getDefaultInsertLocation, S as Scrubber } from "./index-B_A1dZu-.js";
2
2
  import { shallowReactive, ref } from "vue";
3
3
  const PathRef = {
4
4
  transform(ref2, op) {
@@ -49,7 +49,7 @@ const getCharacterDistance = (str, isRTL = false) => {
49
49
  let left = 0;
50
50
  let right = 0;
51
51
  let distance = 0;
52
- let gb11 = null;
52
+ let gb11;
53
53
  let gb12Or13 = null;
54
54
  for (const char of codepoints) {
55
55
  const code = char.codePointAt(0);
@@ -181,7 +181,7 @@ const reV = /^[\u1160-\u11A7\uD7B0-\uD7C6]$/u;
181
181
  const reT = /^[\u11A8-\u11FF\uD7CB-\uD7FB]$/u;
182
182
  const reLV = /^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/u;
183
183
  const reLVT = /^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/u;
184
- const reExtPict = new RegExp("^\\p{ExtPict}$", "u");
184
+ const reExtPict = new RegExp("^(?:\\p{ExtPict}|\\u2701)$", "u");
185
185
  const getCodepointType = (char, code) => {
186
186
  let type = 2048;
187
187
  if (char.search(reExtend) !== -1) {
@@ -277,7 +277,7 @@ function isBoundaryPair(left, right) {
277
277
  (r) => intersects(left, r[0]) && intersects(right, r[1])
278
278
  ) === -1;
279
279
  }
280
- const endingEmojiZWJ = new RegExp("\\p{ExtPict}[\\p{Gr_Ext}\\p{EMod}]*\\u200D$", "u");
280
+ const endingEmojiZWJ = new RegExp("(?:\\p{ExtPict}|\\u2701)[\\p{Gr_Ext}\\p{EMod}]*\\u200D$", "u");
281
281
  const endsWithEmojiZWJ = (str) => {
282
282
  return str.search(endingEmojiZWJ) !== -1;
283
283
  };
@@ -976,7 +976,7 @@ const normalize = (editor, options = {}) => {
976
976
  const entry = Editor.node(editor, dirtyPath);
977
977
  const [node2, _] = entry;
978
978
  if (Node.isElement(node2) && node2.children.length === 0) {
979
- editor.normalizeNode(entry, { operation });
979
+ editor.normalizeNode(entry, { operation, force });
980
980
  }
981
981
  }
982
982
  }
@@ -995,7 +995,7 @@ const normalize = (editor, options = {}) => {
995
995
  const dirtyPath = popDirtyPath(editor);
996
996
  if (Node.has(editor, dirtyPath)) {
997
997
  const entry = Editor.node(editor, dirtyPath);
998
- editor.normalizeNode(entry, { operation });
998
+ editor.normalizeNode(entry, { operation, force });
999
999
  }
1000
1000
  iteration++;
1001
1001
  dirtyPaths = getDirtyPaths2(editor);
@@ -2870,7 +2870,7 @@ const setNodes = (editor, props, options = {}) => {
2870
2870
  }
2871
2871
  if (compare(props[k], node2[k])) {
2872
2872
  hasChanges = true;
2873
- if (Object.prototype.hasOwnProperty.call(node2, k))
2873
+ if (Object.hasOwn(node2, k))
2874
2874
  properties[k] = node2[k];
2875
2875
  if (merge) {
2876
2876
  if (props[k] != null)
package/dist/dom.js CHANGED
@@ -1,6 +1,6 @@
1
- import { D as DOMEditor, E as EDITOR_TO_KEY_TO_ELEMENT, a as EDITOR_TO_USER_MARKS, g as getChunkTreeForNode, b as EDITOR_TO_USER_SELECTION, N as NODE_TO_KEY, i as isDOMText, c as getPlainText, d as getSlateFragmentAttribute, e as EDITOR_TO_ON_CHANGE } from "./hotkeys-Bed0jOgK.js";
2
- import { C, f, h, j, H, k, I, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, K, A, M, B, F, G, J, L, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4 } from "./hotkeys-Bed0jOgK.js";
3
- import { E as Editor, R as Range, N as Node, d as Transforms, P as Path } from "./index-C2VZD0rk.js";
1
+ import { D as DOMEditor, E as EDITOR_TO_KEY_TO_ELEMENT, a as EDITOR_TO_USER_MARKS, g as getChunkTreeForNode, b as EDITOR_TO_USER_SELECTION, N as NODE_TO_KEY, i as isDOMText, c as getPlainText, d as getSlateFragmentAttribute, e as EDITOR_TO_ON_CHANGE } from "./hotkeys-BEBL6MB3.js";
2
+ import { C, f, h, j, H, k, I, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, K, A, M, B, F, G, J, L, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4 } from "./hotkeys-BEBL6MB3.js";
3
+ import { E as Editor, R as Range, N as Node, d as Transforms, P as Path } from "./index-B_A1dZu-.js";
4
4
  import "vue";
5
5
  const doRectsIntersect = (rect, compareRect) => {
6
6
  const middle = (compareRect.top + compareRect.bottom) / 2;
@@ -256,7 +256,7 @@ const getMatches = (e, path) => {
256
256
  return matches;
257
257
  };
258
258
  const shallowCompare = (obj1, obj2) => Object.keys(obj1).length === Object.keys(obj2).length && Object.keys(obj1).every(
259
- (key) => Object.prototype.hasOwnProperty.call(obj2, key) && obj1[key] === obj2[key]
259
+ (key) => Object.hasOwn(obj2, key) && obj1[key] === obj2[key]
260
260
  );
261
261
  const isDecorationFlagsEqual = (range, other) => {
262
262
  const { anchor: rangeAnchor, focus: rangeFocus, ...rangeOwnProps } = range;
package/dist/history.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e as isObject, O as Operation, E as Editor, d as Transforms, P as Path } from "./index-C2VZD0rk.js";
1
+ import { e as isObject, O as Operation, E as Editor, d as Transforms, P as Path } from "./index-B_A1dZu-.js";
2
2
  import { shallowReactive } from "vue";
3
3
  const History = {
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { toRaw } from "vue";
2
- import { S as Scrubber, R as Range, E as Editor, N as Node, d as Transforms, P as Path } from "./index-C2VZD0rk.js";
2
+ import { S as Scrubber, R as Range, E as Editor, N as Node, d as Transforms, P as Path } from "./index-B_A1dZu-.js";
3
3
  import { t as toRawWeakMap } from "./index-Ban80MbP.js";
4
4
  const getDefaultView = (value) => {
5
5
  return value && value.ownerDocument && value.ownerDocument.defaultView || null;
@@ -553,11 +553,12 @@ const DOMEditor = {
553
553
  return node;
554
554
  },
555
555
  toSlatePoint: (editor, domPoint, options) => {
556
- const { exactMatch, suppressThrow, searchDirection } = options;
556
+ const { exactMatch, suppressThrow } = options;
557
557
  const [nearestNode, nearestOffset] = compatEmptyNode(
558
558
  exactMatch ? domPoint : normalizeDOMPoint(domPoint)
559
559
  );
560
560
  const parentNode = nearestNode.parentNode;
561
+ let searchDirection = options.searchDirection;
561
562
  let textNode = null;
562
563
  let offset = 0;
563
564
  if (parentNode) {
@@ -631,6 +632,9 @@ const DOMEditor = {
631
632
  ...getLeafNodes(elementNode)
632
633
  ];
633
634
  leafNode = leafNodes.findLast((leaf) => isBefore(nonEditableNode, leaf)) ?? null;
635
+ if (leafNode) {
636
+ searchDirection = "backward";
637
+ }
634
638
  }
635
639
  if (searchDirection === "forward" || !searchDirection) {
636
640
  const leafNodes = [
@@ -638,6 +642,9 @@ const DOMEditor = {
638
642
  ...getLeafNodes(elementNode?.nextElementSibling)
639
643
  ];
640
644
  leafNode = leafNodes.find((leaf) => isAfter(nonEditableNode, leaf)) ?? null;
645
+ if (leafNode) {
646
+ searchDirection = "forward";
647
+ }
641
648
  }
642
649
  if (leafNode) {
643
650
  textNode = leafNode.closest('[data-slate-node="text"]');
@@ -670,10 +677,16 @@ const DOMEditor = {
670
677
  const node = parentNode.hasAttribute("data-slate-node") ? parentNode : parentNode.closest("[data-slate-node]");
671
678
  if (node && DOMEditor.hasDOMNode(editor, node, { editable: true })) {
672
679
  const slateNode2 = DOMEditor.toSlateNode(editor, node);
673
- const start = Editor.start(
674
- editor,
675
- DOMEditor.findPath(editor, slateNode2)
676
- );
680
+ let nodePath;
681
+ try {
682
+ nodePath = DOMEditor.findPath(editor, slateNode2);
683
+ } catch (e) {
684
+ if (suppressThrow) {
685
+ return null;
686
+ }
687
+ throw e;
688
+ }
689
+ const start = Editor.start(editor, nodePath);
677
690
  const { path: path2 } = start;
678
691
  let { offset: offset2 } = start;
679
692
  if (!node.querySelector("[data-slate-leaf]")) {
@@ -691,7 +704,15 @@ const DOMEditor = {
691
704
  );
692
705
  }
693
706
  const slateNode = DOMEditor.toSlateNode(editor, textNode);
694
- const path = DOMEditor.findPath(editor, slateNode);
707
+ let path;
708
+ try {
709
+ path = DOMEditor.findPath(editor, slateNode);
710
+ } catch (e) {
711
+ if (suppressThrow) {
712
+ return null;
713
+ }
714
+ throw e;
715
+ }
695
716
  return { path, offset };
696
717
  },
697
718
  toSlateRange: (editor, domRange, options) => {
@@ -1,5 +1,5 @@
1
- import { R as Range, N as Node, T as Text, a as Element, e as isObject } from "./index-C2VZD0rk.js";
2
- import { h as createEditor$1 } from "./create-editor-DAXIS6Lk.js";
1
+ import { R as Range, N as Node, T as Text, a as Element, e as isObject } from "./index-B_A1dZu-.js";
2
+ import { h as createEditor$1 } from "./create-editor-z7CFqjGE.js";
3
3
  import "vue";
4
4
  import { t as toRawWeakMap } from "./index-Ban80MbP.js";
5
5
  const ANCHOR = new toRawWeakMap();
@@ -382,7 +382,7 @@ const GeneralTransforms = {
382
382
  }
383
383
  }
384
384
  for (const key in properties) {
385
- if (!Object.prototype.hasOwnProperty.call(newProperties, key)) {
385
+ if (!Object.hasOwn(newProperties, key)) {
386
386
  delete node[key];
387
387
  }
388
388
  }
@@ -847,6 +847,9 @@ const Node = {
847
847
  let node = root;
848
848
  for (let i = 0; i < path.length; i++) {
849
849
  const p = path[i];
850
+ if (typeof p !== "number") {
851
+ throw new TypeError("Got non-numeric path index");
852
+ }
850
853
  if (Node.isText(node) || !node.children[p]) {
851
854
  return;
852
855
  }
@@ -1417,7 +1420,7 @@ const Text = {
1417
1420
  if (key === "text") {
1418
1421
  continue;
1419
1422
  }
1420
- if (!Object.prototype.hasOwnProperty.call(text, key) || text[key] !== props[key]) {
1423
+ if (!Object.hasOwn(text, key) || text[key] !== props[key]) {
1421
1424
  return false;
1422
1425
  }
1423
1426
  }
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { u as useElementIf, a as useEditor, S as SLATE_USE_SELECTION } from "./use-focused-DLAk187V.js";
2
- import { D, b, c, d, e, f, g, E, h, i, j, k, l, m, n, o, p } from "./use-focused-DLAk187V.js";
3
- import { E as Editor, R as Range } from "./index-C2VZD0rk.js";
1
+ import { u as useElementIf, a as useEditor, S as SLATE_USE_SELECTION } from "./use-focused-C_oKuppP.js";
2
+ import { D, b, c, d, e, f, g, E, h, i, j, k, l, m, n, o, p } from "./use-focused-C_oKuppP.js";
3
+ import { E as Editor, R as Range } from "./index-B_A1dZu-.js";
4
4
  import { computed, inject } from "vue";
5
- import { D as DOMEditor } from "./hotkeys-Bed0jOgK.js";
5
+ import { D as DOMEditor } from "./hotkeys-BEBL6MB3.js";
6
6
  import { t } from "./index-Ban80MbP.js";
7
7
  const useSelected = () => {
8
8
  const element = useElementIf();
@@ -21,6 +21,7 @@ export interface BaseEditor {
21
21
  normalizeNode: (entry: NodeEntry, options?: {
22
22
  operation?: Operation;
23
23
  fallbackElement?: () => Element;
24
+ force?: boolean;
24
25
  }) => void;
25
26
  onChange: (options?: {
26
27
  operation?: Operation;
@@ -1,6 +1,6 @@
1
1
  import { h, inject, provide, computed, defineComponent, ref, onMounted, onUnmounted, renderSlot, renderList, watch, onUpdated, useAttrs, reactive, toRaw } from "vue";
2
- import { R as Range, N as Node, S as Scrubber, T as Text, E as Editor, P as Path, d as Transforms, a as Element } from "./index-C2VZD0rk.js";
3
- import { I as IS_ANDROID, _ as isDOMNode, D as DOMEditor, M as MARK_PLACEHOLDER_SYMBOL, e as EDITOR_TO_ON_CHANGE, y as IS_WEBKIT, E as EDITOR_TO_KEY_TO_ELEMENT, j as ELEMENT_TO_NODE, B as NODE_TO_ELEMENT, F as NODE_TO_INDEX, G as NODE_TO_PARENT, r as IS_FIREFOX, g as getChunkTreeForNode, a4 as reconcileChildren, J as applyStringDiff, $ as isDOMSelection, a3 as normalizeStringDiff, v as IS_READ_ONLY, R as getDefaultView, h as EDITOR_TO_WINDOW, f as EDITOR_TO_ELEMENT, U as getSelection, H as HAS_BEFORE_INPUT_SUPPORT, C as CAN_USE_DOM, O as containsShadowAware, P as getActiveElement, t as IS_FOCUSED, a0 as isPlainTextOnlyPaste, p as IS_COMPOSING, k as Hotkeys, n as IS_CHROME, s as IS_FIREFOX_LEGACY, u as IS_IOS, z as IS_WECHATBROWSER, x as IS_UC_MOBILE, a as EDITOR_TO_USER_MARKS, Z as isDOMElement, b as EDITOR_TO_USER_SELECTION } from "./hotkeys-Bed0jOgK.js";
2
+ import { R as Range, N as Node, S as Scrubber, T as Text, E as Editor, P as Path, d as Transforms, a as Element } from "./index-B_A1dZu-.js";
3
+ import { I as IS_ANDROID, _ as isDOMNode, D as DOMEditor, M as MARK_PLACEHOLDER_SYMBOL, e as EDITOR_TO_ON_CHANGE, y as IS_WEBKIT, E as EDITOR_TO_KEY_TO_ELEMENT, j as ELEMENT_TO_NODE, B as NODE_TO_ELEMENT, F as NODE_TO_INDEX, G as NODE_TO_PARENT, r as IS_FIREFOX, g as getChunkTreeForNode, a4 as reconcileChildren, J as applyStringDiff, $ as isDOMSelection, a3 as normalizeStringDiff, v as IS_READ_ONLY, R as getDefaultView, h as EDITOR_TO_WINDOW, f as EDITOR_TO_ELEMENT, U as getSelection, H as HAS_BEFORE_INPUT_SUPPORT, C as CAN_USE_DOM, O as containsShadowAware, P as getActiveElement, t as IS_FOCUSED, a0 as isPlainTextOnlyPaste, p as IS_COMPOSING, k as Hotkeys, n as IS_CHROME, s as IS_FIREFOX_LEGACY, u as IS_IOS, z as IS_WECHATBROWSER, x as IS_UC_MOBILE, a as EDITOR_TO_USER_MARKS, Z as isDOMElement, b as EDITOR_TO_USER_SELECTION } from "./hotkeys-BEBL6MB3.js";
4
4
  const SLATE_USE_EDITOR = /* @__PURE__ */ Symbol("SLATE_USE_EDITOR");
5
5
  const SLATE_USE_ELEMENT = /* @__PURE__ */ Symbol("SLATE_USE_ELEMENT");
6
6
  const SLATE_USE_FOCUSED = /* @__PURE__ */ Symbol("SLATE_USE_FOCUSED");
package/dist/yjs.js CHANGED
@@ -1,8 +1,8 @@
1
- import { e as isObject, N as Node, P as Path, E as Editor, L as Location, d as Transforms, R as Range } from "./index-C2VZD0rk.js";
1
+ import { e as isObject, N as Node, P as Path, E as Editor, L as Location, d as Transforms, R as Range } from "./index-B_A1dZu-.js";
2
2
  import { ref, onMounted, onUnmounted, watch, onUpdated, computed } from "vue";
3
3
  import { XmlText, YTextEvent, createAbsolutePositionFromRelativePosition, createRelativePositionFromTypeIndex, createRelativePositionFromJSON, decodeRelativePosition, encodeRelativePosition, UndoManager, compareRelativePositions } from "yjs";
4
- import { a as useEditor, o as useFocused } from "./use-focused-DLAk187V.js";
5
- import { D as DOMEditor } from "./hotkeys-Bed0jOgK.js";
4
+ import { a as useEditor, o as useFocused } from "./use-focused-C_oKuppP.js";
5
+ import { D as DOMEditor } from "./hotkeys-BEBL6MB3.js";
6
6
  function deepEquals(node, another) {
7
7
  for (const key in node) {
8
8
  const a = node[key];
@@ -791,7 +791,7 @@ function setNode(sharedRoot, slateRoot, op) {
791
791
  yTarget.setAttribute(key, value);
792
792
  });
793
793
  return Object.entries(op.properties).forEach(([key]) => {
794
- if (!Object.prototype.hasOwnProperty.call(op.newProperties, key)) {
794
+ if (!Object.hasOwn(op.newProperties, key)) {
795
795
  yTarget.removeAttribute(key);
796
796
  }
797
797
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slate-vue3",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -77,42 +77,42 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "@actions/core": "^3.0.0",
80
- "@eslint/js": "^9.39.2",
81
- "@faker-js/faker": "^10.2.0",
82
- "@liveblocks/client": "^3.13.3",
83
- "@liveblocks/yjs": "^3.13.3",
84
- "@playwright/test": "^1.58.0",
80
+ "@eslint/js": "^10.0.1",
81
+ "@faker-js/faker": "^10.3.0",
82
+ "@liveblocks/client": "^3.15.0",
83
+ "@liveblocks/yjs": "^3.15.0",
84
+ "@playwright/test": "^1.58.2",
85
85
  "@testing-library/vue": "^8.1.0",
86
86
  "@types/is-hotkey": "^0.1.10",
87
87
  "@types/is-url": "^1.2.32",
88
88
  "@types/lodash-es": "^4.17.12",
89
- "@types/node": "^25.1.0",
90
- "@types/prismjs": "^1.26.5",
91
- "@vitejs/plugin-vue": "^6.0.3",
89
+ "@types/node": "^25.3.5",
90
+ "@types/prismjs": "^1.26.6",
91
+ "@vitejs/plugin-vue": "^6.0.4",
92
92
  "@vue/eslint-config-prettier": "^10.2.0",
93
93
  "babel-plugin-transform-regex": "^6.1.0",
94
- "eslint": "^9.39.2",
95
- "eslint-plugin-vue": "^10.7.0",
96
- "globals": "^17.2.0",
94
+ "eslint": "^10.0.3",
95
+ "eslint-plugin-vue": "^10.8.0",
96
+ "globals": "^17.4.0",
97
97
  "husky": "^9.1.7",
98
98
  "image-extensions": "^1.1.0",
99
99
  "is-url": "^1.2.4",
100
100
  "jiti": "^2.6.1",
101
- "jsdom": "^27.4.0",
102
- "lint-staged": "^16.2.7",
101
+ "jsdom": "^28.1.0",
102
+ "lint-staged": "^16.3.2",
103
103
  "prismjs": "^1.30.0",
104
104
  "remark-gfm": "^4.0.1",
105
105
  "remark-parse": "^11.0.0",
106
106
  "remark-slate-transformer": "^0.9.0",
107
107
  "typescript": "~5.9.3",
108
- "typescript-eslint": "^8.54.0",
108
+ "typescript-eslint": "^8.56.1",
109
109
  "unified": "^11.0.5",
110
110
  "vite": "^7.3.1",
111
- "vite-plugin-babel": "^1.4.1",
111
+ "vite-plugin-babel": "^1.5.1",
112
112
  "vite-plugin-dts": "^4.5.4",
113
113
  "vite-plugin-eslint": "^1.8.1",
114
114
  "vitest": "^4.0.18",
115
- "vue-router": "^5.0.1",
115
+ "vue-router": "^5.0.3",
116
116
  "yjs": "^13.6.29"
117
117
  },
118
118
  "publishConfig": {