slate-vue3 0.7.8 → 0.7.10

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-gBPQ1_v6.js";
2
- import { g, D, c, e, f, d, E, b, h, i, j } from "./use-focused-gBPQ1_v6.js";
1
+ import { S as SLATE_USE_ELEMENT, u as useEditor, a as SLATE_USE_SELECTION } from "./use-focused-BxoM78kl.js";
2
+ import { g, D, c, e, f, d, E, b, h, i, j } from "./use-focused-BxoM78kl.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");
@@ -341,8 +341,8 @@ const StringComp = defineComponent({
341
341
  return null;
342
342
  });
343
343
  return () => zeroStringAttrs.value ? h("span", zeroStringAttrs.value, [
344
- !IS_ANDROID || !isLineBreak ? "\uFEFF" : null,
345
- isLineBreak && !IS_FIREFOX ? h("br") : null
344
+ !IS_ANDROID || !isLineBreak.value ? "\uFEFF" : null,
345
+ !IS_FIREFOX && isLineBreak.value ? h("br") : null
346
346
  ]) : h("span", { "data-slate-string": true }, getTextContent.value);
347
347
  }
348
348
  });
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-gBPQ1_v6.js";
6
- import { D as DOMEditor } from "./hotkeys-WTh2lFjJ.js";
5
+ import { u as useEditor, i as useFocused } from "./use-focused-BxoM78kl.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.8",
3
+ "version": "0.7.10",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",