slate-vue3 0.7.9 → 0.7.11

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/dom.js CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DOMEditor, r as reconcileChildren, E as EDITOR_TO_KEY_TO_ELEMENT, a as EDITOR_TO_USER_MARKS, b as EDITOR_TO_USER_SELECTION, N as NODE_TO_KEY, i as isDOMText, g as getPlainText, c as getSlateFragmentAttribute, d as EDITOR_TO_ON_CHANGE } from "./hotkeys-WTh2lFjJ.js";
2
- import { C, G, J, L, H, F, I, v, M, w, x, O, y, P, A, z, B, K, Q, R, S, T, e, f, h, j, k, l, m, o, p, q, s, t, u, n } from "./hotkeys-WTh2lFjJ.js";
1
+ import { D as DOMEditor, r as reconcileChildren, E as EDITOR_TO_KEY_TO_ELEMENT, a as EDITOR_TO_USER_MARKS, b as EDITOR_TO_USER_SELECTION, N as NODE_TO_KEY, i as isDOMText, g as getPlainText, c as getSlateFragmentAttribute, d as EDITOR_TO_ON_CHANGE } from "./hotkeys-Dgty4eeP.js";
2
+ import { C, G, J, L, H, F, I, v, M, w, x, O, y, P, A, z, B, K, Q, R, S, T, e, f, h, j, k, l, m, o, p, q, s, t, u, n } from "./hotkeys-Dgty4eeP.js";
3
3
  import { E as Editor, R as Range, a as Element, c as Transforms, N as Node, P as Path } from "./batch-dirty-paths-9ixbU5Xv.js";
4
4
  import { reactive } from "vue";
5
5
  const doRectsIntersect = (rect, compareRect) => {
@@ -164,7 +164,8 @@ const IS_FIREFOX_LEGACY = typeof navigator !== "undefined" && /^(?!.*Seamonkey)(
164
164
  navigator.userAgent
165
165
  );
166
166
  const IS_UC_MOBILE = typeof navigator !== "undefined" && /.*UCBrowser/.test(navigator.userAgent);
167
- const IS_WECHATBROWSER = typeof navigator !== "undefined" && /.*Wechat/.test(navigator.userAgent) && !/.*MacWechat/.test(navigator.userAgent);
167
+ const IS_WECHATBROWSER = typeof navigator !== "undefined" && /.*Wechat/.test(navigator.userAgent) && !/.*MacWechat/.test(navigator.userAgent) && // avoid lookbehind (buggy in safari < 16.4)
168
+ (!IS_CHROME || IS_CHROME_LEGACY);
168
169
  const CAN_USE_DOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
169
170
  typeof navigator !== "undefined" && /Safari/.test(navigator.userAgent) && /Version\/(\d+)/.test(navigator.userAgent) && (navigator.userAgent.match(/Version\/(\d+)/)?.[1] ? parseInt(navigator.userAgent.match(/Version\/(\d+)/)?.[1], 10) < 17 : false);
170
171
  const HAS_BEFORE_INPUT_SUPPORT = (!IS_CHROME_LEGACY || !IS_ANDROID_CHROME_LEGACY) && !IS_EDGE_LEGACY && // globalThis is undefined in older browsers
@@ -323,6 +324,9 @@ const DOMEditor = {
323
324
  if (IS_FOCUSED.get(editor)) {
324
325
  return;
325
326
  }
327
+ if (!EDITOR_TO_ELEMENT.get(editor)) {
328
+ return;
329
+ }
326
330
  const el = DOMEditor.toDOMNode(editor, editor);
327
331
  const root = DOMEditor.findDocumentOrShadowRoot(editor);
328
332
  if (root.activeElement !== el) {
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { S as SLATE_USE_ELEMENT, u as useEditor, a as SLATE_USE_SELECTION } from "./use-focused-BSO-C7iP.js";
2
- import { g, D, c, e, f, d, E, b, h, i, j } from "./use-focused-BSO-C7iP.js";
1
+ import { S as SLATE_USE_ELEMENT, u as useEditor, a as SLATE_USE_SELECTION } from "./use-focused-CraHtVJq.js";
2
+ import { g, D, c, e, f, d, E, b, h, i, j } from "./use-focused-CraHtVJq.js";
3
3
  import { E as Editor, R as Range } from "./batch-dirty-paths-9ixbU5Xv.js";
4
4
  import { t } from "./batch-dirty-paths-9ixbU5Xv.js";
5
5
  import { inject, computed } from "vue";
6
- import { D as DOMEditor } from "./hotkeys-WTh2lFjJ.js";
6
+ import { D as DOMEditor } from "./hotkeys-Dgty4eeP.js";
7
7
  const useElement = () => {
8
8
  const element = inject(SLATE_USE_ELEMENT);
9
9
  if (element === void 0) {
@@ -1,6 +1,6 @@
1
1
  import { h, defineComponent, provide, ref, computed, onMounted, onUnmounted, renderSlot, inject, watch, renderList, onUpdated, reactive, useAttrs, toRaw } from "vue";
2
2
  import { R as Range, N as Node, S as Scrubber, T as Text, P as Path, E as Editor, a as Element, c as Transforms } from "./batch-dirty-paths-9ixbU5Xv.js";
3
- import { I as IS_ANDROID, p as isDOMNode, D as DOMEditor, Q as MARK_PLACEHOLDER_SYMBOL, d as EDITOR_TO_ON_CHANGE, w as IS_FIREFOX, z as IS_WEBKIT, E as EDITOR_TO_KEY_TO_ELEMENT, L as ELEMENT_TO_NODE, R as NODE_TO_ELEMENT, S as NODE_TO_INDEX, T as NODE_TO_PARENT, r as reconcileChildren, e as applyStringDiff, q as isDOMSelection, n as normalizeStringDiff, P as IS_READ_ONLY, h as getDefaultView, J as EDITOR_TO_WINDOW, G as EDITOR_TO_ELEMENT, H as HAS_BEFORE_INPUT_SUPPORT, C as CAN_USE_DOM, f as getActiveElement, j as getSelection, O as IS_FOCUSED, s as isPlainTextOnlyPaste, M as IS_COMPOSING, F as Hotkeys, v as IS_CHROME, x as IS_FIREFOX_LEGACY, y as IS_IOS, B as IS_WECHATBROWSER, A as IS_UC_MOBILE, a as EDITOR_TO_USER_MARKS, o as isDOMElement, b as EDITOR_TO_USER_SELECTION } from "./hotkeys-WTh2lFjJ.js";
3
+ import { I as IS_ANDROID, p as isDOMNode, D as DOMEditor, Q as MARK_PLACEHOLDER_SYMBOL, d as EDITOR_TO_ON_CHANGE, w as IS_FIREFOX, z as IS_WEBKIT, E as EDITOR_TO_KEY_TO_ELEMENT, L as ELEMENT_TO_NODE, R as NODE_TO_ELEMENT, S as NODE_TO_INDEX, T as NODE_TO_PARENT, r as reconcileChildren, e as applyStringDiff, q as isDOMSelection, n as normalizeStringDiff, P as IS_READ_ONLY, h as getDefaultView, J as EDITOR_TO_WINDOW, G as EDITOR_TO_ELEMENT, H as HAS_BEFORE_INPUT_SUPPORT, C as CAN_USE_DOM, f as getActiveElement, j as getSelection, O as IS_FOCUSED, s as isPlainTextOnlyPaste, M as IS_COMPOSING, F as Hotkeys, v as IS_CHROME, x as IS_FIREFOX_LEGACY, y as IS_IOS, B as IS_WECHATBROWSER, A as IS_UC_MOBILE, a as EDITOR_TO_USER_MARKS, o as isDOMElement, b as EDITOR_TO_USER_SELECTION } from "./hotkeys-Dgty4eeP.js";
4
4
  const SLATE_USE_EDITOR = Symbol("SLATE_USE_EDITOR");
5
5
  const SLATE_USE_ELEMENT = Symbol("SLATE_USE_ELEMENT");
6
6
  const SLATE_USE_FOCUSED = Symbol("SLATE_USE_FOCUSED");
@@ -1059,20 +1059,7 @@ const useAndroidManager = (editableRef) => {
1059
1059
  insertPositionHint = false;
1060
1060
  }
1061
1061
  if (canStoreDiff) {
1062
- const currentSelection = editor.selection;
1063
1062
  storeDiff(start.path, diff);
1064
- if (currentSelection) {
1065
- const newPoint = {
1066
- path: start.path,
1067
- offset: start.offset + text.length
1068
- };
1069
- scheduleAction(() => {
1070
- Transforms.select(editor, {
1071
- anchor: newPoint,
1072
- focus: newPoint
1073
- });
1074
- });
1075
- }
1076
1063
  return;
1077
1064
  }
1078
1065
  }
package/dist/yjs.js CHANGED
@@ -2,8 +2,8 @@ import { d as isObject, T as Text, N as Node, P as Path, E as Editor, t as toRaw
2
2
  import { toRaw, ref, onMounted, onUnmounted, watch, onUpdated, computed } from "vue";
3
3
  import { XmlText, YTextEvent, createRelativePositionFromTypeIndex, createAbsolutePositionFromRelativePosition, createRelativePositionFromJSON, decodeRelativePosition, encodeRelativePosition, UndoManager, compareRelativePositions } from "yjs";
4
4
  import { L as Location } from "./location-Df07ugyf.js";
5
- import { u as useEditor, i as useFocused } from "./use-focused-BSO-C7iP.js";
6
- import { D as DOMEditor } from "./hotkeys-WTh2lFjJ.js";
5
+ import { u as useEditor, i as useFocused } from "./use-focused-CraHtVJq.js";
6
+ import { D as DOMEditor } from "./hotkeys-Dgty4eeP.js";
7
7
  function deepEquals(node, another) {
8
8
  for (const key in node) {
9
9
  const a = node[key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slate-vue3",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -67,15 +67,15 @@
67
67
  "vue": "^3.0.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@faker-js/faker": "^9.8.0",
71
- "@liveblocks/client": "^3.0.0",
72
- "@liveblocks/yjs": "^3.0.0",
73
- "@playwright/test": "^1.53.1",
70
+ "@faker-js/faker": "^9.9.0",
71
+ "@liveblocks/client": "^3.1.4",
72
+ "@liveblocks/yjs": "^3.1.4",
73
+ "@playwright/test": "^1.54.1",
74
74
  "@testing-library/vue": "^8.1.0",
75
75
  "@types/is-hotkey": "^0.1.10",
76
76
  "@types/is-url": "^1.2.32",
77
77
  "@types/lodash-es": "^4.17.12",
78
- "@types/node": "^24.0.4",
78
+ "@types/node": "^24.0.15",
79
79
  "@types/prismjs": "^1.26.5",
80
80
  "@vitejs/plugin-vue": "^6.0.0",
81
81
  "babel-plugin-transform-regex": "^6.0.1",
@@ -88,8 +88,8 @@
88
88
  "remark-slate-transformer": "^0.9.0",
89
89
  "typescript": "~5.8.3",
90
90
  "unified": "^11.0.5",
91
- "vite": "^7.0.0",
92
- "vite-plugin-babel": "^1.3.1",
91
+ "vite": "^7.0.5",
92
+ "vite-plugin-babel": "^1.3.2",
93
93
  "vite-plugin-dts": "^4.5.4",
94
94
  "vitest": "^3.2.4",
95
95
  "vue-router": "^4.5.1",