slate-vue3 0.2.3 → 0.2.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/dom.js CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DOMEditor, 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-BwRBmDaN.js";
2
- import { C, F, G, J, H, B, I, u, L, v, w, M, x, O, z, y, A, K, P, Q, R, S, e, f, h, j, k, l, m, o, p, q, r, s, t, n } from "./hotkeys-BwRBmDaN.js";
1
+ import { D as DOMEditor, 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-CjSuQvZ2.js";
2
+ import { C, F, G, J, H, B, I, u, L, v, w, M, x, O, z, y, A, K, P, Q, R, S, e, f, h, j, k, l, m, o, p, q, r, s, t, n } from "./hotkeys-CjSuQvZ2.js";
3
3
  import { E as Editor, R as Range, a as Element, c as Transforms, P as Path, N as Node } from "./batch-dirty-paths-X-eP3GRL.js";
4
4
  import "vue";
5
5
  const doRectsIntersect = (rect, compareRect) => {
@@ -211,7 +211,9 @@ function getFirefoxNodeEl([node, offset]) {
211
211
  }
212
212
  if (!el) {
213
213
  throw new Error(
214
- `Compact on Firefox: Failed to find adjacent nodes: ${Scrubber.stringify(node)}`
214
+ `Compact on Firefox: Failed to find adjacent nodes: ${Scrubber.stringify(
215
+ node
216
+ )}`
215
217
  );
216
218
  }
217
219
  return [el, isLeft ? 0 : ((_a2 = el.textContent) == null ? void 0 : _a2.length) || 0];
@@ -373,7 +375,7 @@ const DOMEditor = {
373
375
  const { anchor, focus } = range;
374
376
  return Editor.hasPath(editor, anchor.path) && Editor.hasPath(editor, focus.path);
375
377
  },
376
- hasSelectableTarget: (editor, target) => DOMEditor.hasEditableTarget(editor, target) || DOMEditor.isTargetInsideNonReadonlyVoid(editor, target),
378
+ hasSelectableTarget: (editor, target) => DOMEditor.hasEditableTarget(editor, target) && !DOMEditor.isTargetInsideNonReadonlyVoid(editor, target),
377
379
  hasTarget: (editor, target) => isDOMNode(target) && DOMEditor.hasDOMNode(editor, target),
378
380
  insertData: (editor, data) => {
379
381
  editor.insertData(data);
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, provide, ref, computed, onMounted, onUnmounted, renderSlot, inject, h, watch, renderList, Fragment, useAttrs, reactive } from "vue";
2
2
  import { N as Node, S as Scrubber, R as Range, T as Text, P as Path, E as Editor, a as Element, c as Transforms } from "./batch-dirty-paths-X-eP3GRL.js";
3
3
  import { t } from "./batch-dirty-paths-X-eP3GRL.js";
4
- import { D as DOMEditor, P as MARK_PLACEHOLDER_SYMBOL, d as EDITOR_TO_ON_CHANGE, I as IS_ANDROID, x as IS_IOS, E as EDITOR_TO_KEY_TO_ELEMENT, J as ELEMENT_TO_NODE, Q as NODE_TO_ELEMENT, R as NODE_TO_INDEX, S as NODE_TO_PARENT, p as isDOMNode, y as IS_WEBKIT, e as applyStringDiff, q as isDOMSelection, n as normalizeStringDiff, O as IS_READ_ONLY, h as getDefaultView, G as EDITOR_TO_WINDOW, F as EDITOR_TO_ELEMENT, H as HAS_BEFORE_INPUT_SUPPORT, C as CAN_USE_DOM, f as getActiveElement, j as getSelection, M as IS_FOCUSED, b as EDITOR_TO_USER_SELECTION, L as IS_COMPOSING, o as isDOMElement, w as IS_FIREFOX_LEGACY, A as IS_WECHATBROWSER, z as IS_UC_MOBILE, a as EDITOR_TO_USER_MARKS, v as IS_FIREFOX, B as Hotkeys, u as IS_CHROME, r as isPlainTextOnlyPaste } from "./hotkeys-BwRBmDaN.js";
4
+ import { D as DOMEditor, P as MARK_PLACEHOLDER_SYMBOL, d as EDITOR_TO_ON_CHANGE, I as IS_ANDROID, x as IS_IOS, E as EDITOR_TO_KEY_TO_ELEMENT, J as ELEMENT_TO_NODE, Q as NODE_TO_ELEMENT, R as NODE_TO_INDEX, S as NODE_TO_PARENT, p as isDOMNode, y as IS_WEBKIT, e as applyStringDiff, q as isDOMSelection, n as normalizeStringDiff, O as IS_READ_ONLY, h as getDefaultView, G as EDITOR_TO_WINDOW, F as EDITOR_TO_ELEMENT, H as HAS_BEFORE_INPUT_SUPPORT, C as CAN_USE_DOM, f as getActiveElement, j as getSelection, M as IS_FOCUSED, b as EDITOR_TO_USER_SELECTION, L as IS_COMPOSING, o as isDOMElement, w as IS_FIREFOX_LEGACY, A as IS_WECHATBROWSER, z as IS_UC_MOBILE, a as EDITOR_TO_USER_MARKS, v as IS_FIREFOX, B as Hotkeys, u as IS_CHROME, r as isPlainTextOnlyPaste } from "./hotkeys-CjSuQvZ2.js";
5
5
  const SLATE_USE_EDITOR = Symbol("SLATE_USE_EDITOR");
6
6
  const SLATE_USE_DECORATE = Symbol("SLATE_USE_DECORATE");
7
7
  const SLATE_USE_SELECTED = Symbol("SLATE_USE_SELECTED");
@@ -1359,21 +1359,22 @@ const Editable = defineComponent({
1359
1359
  }
1360
1360
  };
1361
1361
  const onCompositionend = (event) => {
1362
- if (DOMEditor.hasSelectableTarget(editor, event.target)) {
1363
- if (DOMEditor.isComposing(editor)) {
1364
- isComposing.value = false;
1365
- IS_COMPOSING.set(editor, false);
1366
- }
1367
- if (IS_ANDROID || isEventHandled(event, attributes.onCompositionend)) {
1368
- return;
1369
- }
1370
- if (!IS_WEBKIT && !IS_FIREFOX_LEGACY && !IS_IOS && !IS_WECHATBROWSER && !IS_UC_MOBILE && event.data) {
1371
- Editor.insertText(editor, event.data);
1372
- const userMarks = EDITOR_TO_USER_MARKS.get(editor);
1373
- EDITOR_TO_USER_MARKS.delete(editor);
1374
- if (userMarks !== void 0) {
1375
- editor.marks = userMarks;
1376
- }
1362
+ if (!DOMEditor.hasSelectableTarget(editor, event.target)) {
1363
+ return;
1364
+ }
1365
+ if (DOMEditor.isComposing(editor)) {
1366
+ isComposing.value = false;
1367
+ IS_COMPOSING.set(editor, false);
1368
+ }
1369
+ if (IS_ANDROID || isEventHandled(event, attributes.onCompositionend)) {
1370
+ return;
1371
+ }
1372
+ if (!IS_WEBKIT && !IS_FIREFOX_LEGACY && !IS_IOS && !IS_WECHATBROWSER && !IS_UC_MOBILE && event.data) {
1373
+ Editor.insertText(editor, event.data);
1374
+ const userMarks = EDITOR_TO_USER_MARKS.get(editor);
1375
+ EDITOR_TO_USER_MARKS.delete(editor);
1376
+ if (userMarks !== void 0) {
1377
+ editor.marks = userMarks;
1377
1378
  }
1378
1379
  }
1379
1380
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slate-vue3",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",