@lexical/overflow 0.12.2 → 0.12.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/LexicalOverflow.dev.js +2 -14
- package/package.json +2 -2
package/LexicalOverflow.dev.js
CHANGED
|
@@ -9,60 +9,48 @@
|
|
|
9
9
|
var lexical = require('lexical');
|
|
10
10
|
|
|
11
11
|
/** @module @lexical/overflow */
|
|
12
|
-
|
|
13
12
|
/** @noInheritDoc */
|
|
14
13
|
class OverflowNode extends lexical.ElementNode {
|
|
15
14
|
static getType() {
|
|
16
15
|
return 'overflow';
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
static clone(node) {
|
|
20
18
|
return new OverflowNode(node.__key);
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
static importJSON(serializedNode) {
|
|
24
21
|
return $createOverflowNode();
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
static importDOM() {
|
|
28
24
|
return null;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
constructor(key) {
|
|
32
27
|
super(key);
|
|
33
28
|
this.__type = 'overflow';
|
|
34
29
|
}
|
|
35
|
-
|
|
36
30
|
exportJSON() {
|
|
37
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
...super.exportJSON(),
|
|
38
33
|
type: 'overflow'
|
|
39
34
|
};
|
|
40
35
|
}
|
|
41
|
-
|
|
42
36
|
createDOM(config) {
|
|
43
37
|
const div = document.createElement('span');
|
|
44
38
|
const className = config.theme.characterLimit;
|
|
45
|
-
|
|
46
39
|
if (typeof className === 'string') {
|
|
47
40
|
div.className = className;
|
|
48
41
|
}
|
|
49
|
-
|
|
50
42
|
return div;
|
|
51
43
|
}
|
|
52
|
-
|
|
53
44
|
updateDOM(prevNode, dom) {
|
|
54
45
|
return false;
|
|
55
46
|
}
|
|
56
|
-
|
|
57
47
|
insertNewAfter(selection, restoreSelection = true) {
|
|
58
48
|
const parent = this.getParentOrThrow();
|
|
59
49
|
return parent.insertNewAfter(selection, restoreSelection);
|
|
60
50
|
}
|
|
61
|
-
|
|
62
51
|
excludeFromCopy() {
|
|
63
52
|
return true;
|
|
64
53
|
}
|
|
65
|
-
|
|
66
54
|
}
|
|
67
55
|
function $createOverflowNode() {
|
|
68
56
|
return lexical.$applyNodeReplacement(new OverflowNode());
|
package/package.json
CHANGED