slate-vue3 0.2.7 → 0.2.8

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.
@@ -2236,7 +2236,7 @@ const Text = {
2236
2236
  return true;
2237
2237
  },
2238
2238
  decorations(node, decorations) {
2239
- let leaves = [cloneDeep(node)];
2239
+ let leaves = [{ ...node }];
2240
2240
  for (const dec of decorations) {
2241
2241
  const { anchor, focus, merge: mergeDecoration, ...rest } = dec;
2242
2242
  const [start, end] = Range.edges(dec);
@@ -2246,9 +2246,8 @@ const Text = {
2246
2246
  const decorationEnd = end.offset;
2247
2247
  const merge = mergeDecoration ?? Object.assign;
2248
2248
  for (const leaf of leaves) {
2249
- const { length } = leaf.text;
2250
2249
  const leafStart = leafEnd;
2251
- leafEnd += length;
2250
+ leafEnd += leaf.text.length;
2252
2251
  if (decorationStart <= leafStart && leafEnd <= decorationEnd) {
2253
2252
  merge(leaf, rest);
2254
2253
  next.push(leaf);
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a6, a7, a8, d, e, f, a, h, aj, c, i, j, k, ap, ak, l, m, o, p, q, g, b, r, t, u, v, w, x, aq, y, a9, z, A, B, C, D, E, F, G, H, I, J, aa, K, ab, al, ac, L, M, N, O, n, P, S, Q, R, V, T, U, W, X, _, Y, Z, $, ad, am, ae, a0, an, ao, a5, s, af, a1, a2, a3, ag, ah, a4, ai } from "./create-editor-C4ZucdMc.js";
2
- import { E as E2, a as a10, N as N2, O as O2, P as P2, b as b2, R as R2, S as S2, T as T2, c as c2, i as i2 } from "./batch-dirty-paths-X-eP3GRL.js";
3
- import { L as L2, S as S3 } from "./location-CeJ1rJSq.js";
1
+ import { a6, a7, a8, d, e, f, a, h, aj, c, i, j, k, ap, ak, l, m, o, p, q, g, b, r, t, u, v, w, x, aq, y, a9, z, A, B, C, D, E, F, G, H, I, J, aa, K, ab, al, ac, L, M, N, O, n, P, S, Q, R, V, T, U, W, X, _, Y, Z, $, ad, am, ae, a0, an, ao, a5, s, af, a1, a2, a3, ag, ah, a4, ai } from "./create-editor-BUkL7rUJ.js";
2
+ import { E as E2, a as a10, N as N2, O as O2, P as P2, b as b2, R as R2, S as S2, T as T2, c as c2, i as i2 } from "./batch-dirty-paths-pvy6IJFh.js";
3
+ import { L as L2, S as S3 } from "./location-Cf-z17XM.js";
4
4
  export {
5
5
  E2 as Editor,
6
6
  a10 as Element,
@@ -1,6 +1,6 @@
1
- import { P as Path, b as Point, R as Range, E as Editor, D as DIRTY_PATHS, e as DIRTY_PATH_KEYS, f as isBatchingDirtyPaths, c as Transforms, F as FLUSHING, T as Text, N as Node, a as Element, g as NORMALIZING, h as PATH_REFS, j as POINT_REFS, k as RANGE_REFS, l as cloneDeep, m as getDefaultInsertLocation, S as Scrubber, n as batchDirtyPaths } from "./batch-dirty-paths-X-eP3GRL.js";
1
+ import { P as Path, b as Point, R as Range, E as Editor, D as DIRTY_PATHS, e as DIRTY_PATH_KEYS, f as isBatchingDirtyPaths, c as Transforms, F as FLUSHING, T as Text, N as Node, a as Element, g as NORMALIZING, h as PATH_REFS, j as POINT_REFS, k as RANGE_REFS, l as cloneDeep, m as getDefaultInsertLocation, S as Scrubber, n as batchDirtyPaths } from "./batch-dirty-paths-pvy6IJFh.js";
2
2
  import { reactive } from "vue";
3
- import { S as Span } from "./location-CeJ1rJSq.js";
3
+ import { S as Span } from "./location-Cf-z17XM.js";
4
4
  const PathRef = {
5
5
  transform(ref, op) {
6
6
  const { current, affinity } = ref;
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, 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-BIY7ppmP.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-BIY7ppmP.js";
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";
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-BMWPBLvH.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-BMWPBLvH.js";
3
+ import { E as Editor, R as Range, a as Element, c as Transforms, P as Path, N as Node } from "./batch-dirty-paths-pvy6IJFh.js";
4
4
  import "vue";
5
5
  const doRectsIntersect = (rect, compareRect) => {
6
6
  const middle = (compareRect.top + compareRect.bottom) / 2;
package/dist/history.js CHANGED
@@ -1,4 +1,4 @@
1
- import { d as isPlainObject, O as Operation, t as toRawWeakMap, E as Editor, c as Transforms, P as Path } from "./batch-dirty-paths-X-eP3GRL.js";
1
+ import { d as isPlainObject, O as Operation, t as toRawWeakMap, E as Editor, c as Transforms, P as Path } from "./batch-dirty-paths-pvy6IJFh.js";
2
2
  import "vue";
3
3
  const History = {
4
4
  /**
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  var _a, _b;
5
- import { t as toRawWeakMap, c as Transforms, a as Element, E as Editor, S as Scrubber, R as Range } from "./batch-dirty-paths-X-eP3GRL.js";
5
+ import { t as toRawWeakMap, c as Transforms, a as Element, E as Editor, S as Scrubber, R as Range } from "./batch-dirty-paths-pvy6IJFh.js";
6
6
  import "vue";
7
7
  const getDefaultView = (value) => {
8
8
  return value && value.ownerDocument && value.ownerDocument.defaultView || null;
@@ -1,8 +1,8 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { t as toRawWeakMap, T as Text, R as Range, N as Node, a as Element, d as isPlainObject } from "./batch-dirty-paths-X-eP3GRL.js";
5
- import { c as createEditor$1 } from "./create-editor-C4ZucdMc.js";
4
+ import { t as toRawWeakMap, T as Text, R as Range, N as Node, a as Element, d as isPlainObject } from "./batch-dirty-paths-pvy6IJFh.js";
5
+ import { c as createEditor$1 } from "./create-editor-BUkL7rUJ.js";
6
6
  import "vue";
7
7
  const ANCHOR = new toRawWeakMap();
8
8
  const FOCUS = new toRawWeakMap();
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, toRaw } from "vue";
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
- 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-BIY7ppmP.js";
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-pvy6IJFh.js";
3
+ import { t } from "./batch-dirty-paths-pvy6IJFh.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-BMWPBLvH.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");
@@ -1,4 +1,4 @@
1
- import { P as Path, b as Point, R as Range } from "./batch-dirty-paths-X-eP3GRL.js";
1
+ import { P as Path, b as Point, R as Range } from "./batch-dirty-paths-pvy6IJFh.js";
2
2
  import "vue";
3
3
  const Location = {
4
4
  isLocation(value) {
package/dist/yjs.js CHANGED
@@ -1,7 +1,7 @@
1
- import { d as isPlainObject, T as Text, N as Node, P as Path, E as Editor, t as toRawWeakMap, c as Transforms } from "./batch-dirty-paths-X-eP3GRL.js";
1
+ import { d as isPlainObject, T as Text, N as Node, P as Path, E as Editor, t as toRawWeakMap, c as Transforms } from "./batch-dirty-paths-pvy6IJFh.js";
2
2
  import { toRaw } from "vue";
3
3
  import * as Y from "yjs";
4
- import { L as Location } from "./location-CeJ1rJSq.js";
4
+ import { L as Location } from "./location-Cf-z17XM.js";
5
5
  function deepEquals(node, another) {
6
6
  for (const key in node) {
7
7
  const a = node[key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slate-vue3",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",