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 +1 -1
- package/dist/{index-CjnPdoJN.js → batch-dirty-paths-CZqHWmdq.js} +59 -33
- package/dist/core.js +96 -2616
- package/dist/create-editor-BP4gf1UN.js +2585 -0
- package/dist/dom.d.ts +4 -7
- package/dist/dom.js +44 -44
- package/dist/history.d.ts +3 -4
- package/dist/history.js +2 -2
- package/dist/{hotkeys-CFtX6lwM.js → hotkeys-1OnMQ7H6.js} +41 -41
- package/dist/hyperscript.d.ts +1753 -0
- package/dist/hyperscript.js +251 -0
- package/dist/index.d.ts +12 -24
- package/dist/index.js +3 -6
- package/package.json +7 -2
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1366
|
+
var Uint8Array = root.Uint8Array;
|
|
1364
1367
|
function cloneArrayBuffer(arrayBuffer) {
|
|
1365
1368
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
1366
|
-
new
|
|
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
|
-
|
|
2370
|
+
Scrubber as S,
|
|
2352
2371
|
Text as T,
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
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
|
};
|