slate-vue3 0.0.37 → 0.0.39

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/README.md CHANGED
@@ -118,7 +118,7 @@ export interface RenderPlaceholderProps {
118
118
  ## Editable
119
119
  > customize style of editablearea, you can inherient other HTMLAttribute on it
120
120
  ```typescript
121
- export interface EditableProps extends HTMLAttributes {
121
+ interface EditableProps extends HTMLAttributes {
122
122
  role?: string
123
123
  readOnly: boolean
124
124
  placeholder?: string
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
1
  import { isProxy, toRaw } from "vue";
5
2
  /*!
6
3
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
@@ -23,41 +20,47 @@ function isPlainObject(o) {
23
20
  }
24
21
  return true;
25
22
  }
26
- class toRawWeakMap {
23
+ class toRawWeakMap extends WeakMap {
27
24
  constructor() {
28
- __publicField(this, "weak");
29
- this.weak = /* @__PURE__ */ new WeakMap();
25
+ super();
30
26
  }
31
27
  /**
32
28
  * Removes the specified element from the toRawWeakMap.
33
29
  * @returns true if the element was successfully removed, or false if it was not present.
34
30
  */
35
31
  delete(key) {
36
- return this.weak.delete(isProxy(key) ? toRaw(key) : key);
32
+ return super.delete(isProxy(key) ? toRaw(key) : key);
37
33
  }
38
34
  /**
39
35
  * @returns a specified element.
40
36
  */
41
37
  get(key) {
42
- return this.weak.get(isProxy(key) ? toRaw(key) : key);
38
+ return super.get(isProxy(key) ? toRaw(key) : key);
43
39
  }
44
40
  /**
45
41
  * @returns a boolean indicating whether an element with the specified key exists or not.
46
42
  */
47
43
  has(key) {
48
- return this.weak.has(isProxy(key) ? toRaw(key) : key);
44
+ return super.has(isProxy(key) ? toRaw(key) : key);
49
45
  }
50
46
  /**
51
47
  * Adds a new element with a specified key and value.
52
48
  * @param key Must be an object or symbol.
53
49
  */
54
50
  set(key, value) {
55
- return this.weak.set(
51
+ return super.set(
56
52
  isProxy(key) ? toRaw(key) : key,
57
53
  isProxy(value) ? toRaw(value) : value
58
54
  );
59
55
  }
60
56
  }
57
+ const DIRTY_PATHS = new toRawWeakMap();
58
+ const DIRTY_PATH_KEYS = new toRawWeakMap();
59
+ const FLUSHING = new toRawWeakMap();
60
+ const NORMALIZING = new toRawWeakMap();
61
+ const PATH_REFS = new toRawWeakMap();
62
+ const POINT_REFS = new toRawWeakMap();
63
+ const RANGE_REFS = new toRawWeakMap();
61
64
  const Path = {
62
65
  ancestors(path, options = {}) {
63
66
  const { reverse = false } = options;
@@ -1264,7 +1267,7 @@ function baseAssignIn(object, source) {
1264
1267
  var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
1265
1268
  var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
1266
1269
  var moduleExports = freeModule && freeModule.exports === freeExports;
1267
- var Buffer2 = moduleExports ? root.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
1270
+ var Buffer = moduleExports ? root.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
1268
1271
  function cloneBuffer(buffer, isDeep) {
1269
1272
  if (isDeep) {
1270
1273
  return buffer.slice();
@@ -1360,10 +1363,10 @@ function initCloneArray(array) {
1360
1363
  }
1361
1364
  return result;
1362
1365
  }
1363
- var Uint8Array2 = root.Uint8Array;
1366
+ var Uint8Array = root.Uint8Array;
1364
1367
  function cloneArrayBuffer(arrayBuffer) {
1365
1368
  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1366
- new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
1369
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
1367
1370
  return result;
1368
1371
  }
1369
1372
  function cloneDataView(dataView, isDeep) {
@@ -2341,32 +2344,55 @@ const Transforms = {
2341
2344
  ...SelectionTransforms,
2342
2345
  ...TextTransforms
2343
2346
  };
2347
+ const BATCHING_DIRTY_PATHS = new toRawWeakMap();
2348
+ const isBatchingDirtyPaths = (editor) => {
2349
+ return BATCHING_DIRTY_PATHS.get(editor) || false;
2350
+ };
2351
+ const batchDirtyPaths = (editor, fn, update) => {
2352
+ const value = BATCHING_DIRTY_PATHS.get(editor) || false;
2353
+ BATCHING_DIRTY_PATHS.set(editor, true);
2354
+ try {
2355
+ fn();
2356
+ update();
2357
+ } finally {
2358
+ BATCHING_DIRTY_PATHS.set(editor, value);
2359
+ }
2360
+ };
2344
2361
  export {
2362
+ DIRTY_PATHS as D,
2345
2363
  Editor as E,
2364
+ FLUSHING as F,
2346
2365
  MapCache as M,
2347
2366
  Node as N,
2348
2367
  Operation as O,
2349
2368
  Path as P,
2350
2369
  Range as R,
2351
- Symbol$1 as S,
2370
+ Scrubber as S,
2352
2371
  Text as T,
2353
- isArray as a,
2354
- baseGetTag as b,
2355
- isArguments as c,
2356
- defineProperty as d,
2357
- arrayPush as e,
2358
- copyObject as f,
2359
- getPrototype as g,
2360
- getAllKeysIn as h,
2361
- isObjectLike as i,
2362
- baseClone as j,
2363
- Scrubber as k,
2364
- Element as l,
2365
- Transforms as m,
2366
- Point as n,
2367
- cloneDeep as o,
2368
- getDefaultInsertLocation as p,
2369
- isEditor as q,
2370
- isPlainObject as r,
2371
- toRawWeakMap as t
2372
+ Element as a,
2373
+ Point as b,
2374
+ Transforms as c,
2375
+ isPlainObject as d,
2376
+ isObjectLike as e,
2377
+ baseGetTag as f,
2378
+ Symbol$1 as g,
2379
+ isArray as h,
2380
+ isEditor as i,
2381
+ defineProperty as j,
2382
+ isArguments as k,
2383
+ arrayPush as l,
2384
+ getPrototype as m,
2385
+ copyObject as n,
2386
+ getAllKeysIn as o,
2387
+ baseClone as p,
2388
+ DIRTY_PATH_KEYS as q,
2389
+ isBatchingDirtyPaths as r,
2390
+ NORMALIZING as s,
2391
+ toRawWeakMap as t,
2392
+ PATH_REFS as u,
2393
+ POINT_REFS as v,
2394
+ RANGE_REFS as w,
2395
+ cloneDeep as x,
2396
+ getDefaultInsertLocation as y,
2397
+ batchDirtyPaths as z
2372
2398
  };