@lexical/overflow 0.32.2-nightly.20250620.0 → 0.32.2-nightly.20250623.0
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 +10 -27
- package/LexicalOverflow.dev.mjs +10 -27
- package/LexicalOverflow.prod.js +1 -1
- package/LexicalOverflow.prod.mjs +1 -1
- package/index.d.ts +5 -5
- package/package.json +2 -2
package/LexicalOverflow.dev.js
CHANGED
|
@@ -18,25 +18,18 @@ var lexical = require('lexical');
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
// Do not require this module directly! Use normal `invariant` calls.
|
|
22
|
-
|
|
23
|
-
function formatDevErrorMessage(message) {
|
|
24
|
-
throw new Error(message);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
21
|
/** @noInheritDoc */
|
|
28
22
|
class OverflowNode extends lexical.ElementNode {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return null;
|
|
23
|
+
/** @internal */
|
|
24
|
+
$config() {
|
|
25
|
+
return this.config('overflow', {
|
|
26
|
+
$transform(node) {
|
|
27
|
+
if (node.isEmpty()) {
|
|
28
|
+
node.remove();
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
extends: lexical.ElementNode
|
|
32
|
+
});
|
|
40
33
|
}
|
|
41
34
|
createDOM(config) {
|
|
42
35
|
const div = document.createElement('span');
|
|
@@ -56,16 +49,6 @@ class OverflowNode extends lexical.ElementNode {
|
|
|
56
49
|
excludeFromCopy() {
|
|
57
50
|
return true;
|
|
58
51
|
}
|
|
59
|
-
static transform() {
|
|
60
|
-
return node => {
|
|
61
|
-
if (!$isOverflowNode(node)) {
|
|
62
|
-
formatDevErrorMessage(`node is not a OverflowNode`);
|
|
63
|
-
}
|
|
64
|
-
if (node.isEmpty()) {
|
|
65
|
-
node.remove();
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
52
|
}
|
|
70
53
|
function $createOverflowNode() {
|
|
71
54
|
return lexical.$applyNodeReplacement(new OverflowNode());
|
package/LexicalOverflow.dev.mjs
CHANGED
|
@@ -16,25 +16,18 @@ import { ElementNode, $applyNodeReplacement } from 'lexical';
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
// Do not require this module directly! Use normal `invariant` calls.
|
|
20
|
-
|
|
21
|
-
function formatDevErrorMessage(message) {
|
|
22
|
-
throw new Error(message);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
19
|
/** @noInheritDoc */
|
|
26
20
|
class OverflowNode extends ElementNode {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return null;
|
|
21
|
+
/** @internal */
|
|
22
|
+
$config() {
|
|
23
|
+
return this.config('overflow', {
|
|
24
|
+
$transform(node) {
|
|
25
|
+
if (node.isEmpty()) {
|
|
26
|
+
node.remove();
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
extends: ElementNode
|
|
30
|
+
});
|
|
38
31
|
}
|
|
39
32
|
createDOM(config) {
|
|
40
33
|
const div = document.createElement('span');
|
|
@@ -54,16 +47,6 @@ class OverflowNode extends ElementNode {
|
|
|
54
47
|
excludeFromCopy() {
|
|
55
48
|
return true;
|
|
56
49
|
}
|
|
57
|
-
static transform() {
|
|
58
|
-
return node => {
|
|
59
|
-
if (!$isOverflowNode(node)) {
|
|
60
|
-
formatDevErrorMessage(`node is not a OverflowNode`);
|
|
61
|
-
}
|
|
62
|
-
if (node.isEmpty()) {
|
|
63
|
-
node.remove();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
50
|
}
|
|
68
51
|
function $createOverflowNode() {
|
|
69
52
|
return $applyNodeReplacement(new OverflowNode());
|
package/LexicalOverflow.prod.js
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
"use strict";var e=require("lexical");class r extends e.ElementNode{
|
|
9
|
+
"use strict";var e=require("lexical");class r extends e.ElementNode{$config(){return this.config("overflow",{$transform(e){e.isEmpty()&&e.remove()},extends:e.ElementNode})}createDOM(e){const r=document.createElement("span"),t=e.theme.characterLimit;return"string"==typeof t&&(r.className=t),r}updateDOM(e,r){return!1}insertNewAfter(e,r=!0){return this.getParentOrThrow().insertNewAfter(e,r)}excludeFromCopy(){return!0}}exports.$createOverflowNode=function(){return e.$applyNodeReplacement(new r)},exports.$isOverflowNode=function(e){return e instanceof r},exports.OverflowNode=r;
|
package/LexicalOverflow.prod.mjs
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import{ElementNode as e,$applyNodeReplacement as
|
|
9
|
+
import{ElementNode as e,$applyNodeReplacement as t}from"lexical";class r extends e{$config(){return this.config("overflow",{$transform(e){e.isEmpty()&&e.remove()},extends:e})}createDOM(e){const t=document.createElement("span"),r=e.theme.characterLimit;return"string"==typeof r&&(t.className=r),t}updateDOM(e,t){return!1}insertNewAfter(e,t=!0){return this.getParentOrThrow().insertNewAfter(e,t)}excludeFromCopy(){return!0}}function n(){return t(new r)}function o(e){return e instanceof r}export{n as $createOverflowNode,o as $isOverflowNode,r as OverflowNode};
|
package/index.d.ts
CHANGED
|
@@ -10,15 +10,15 @@ import { ElementNode } from 'lexical';
|
|
|
10
10
|
export type SerializedOverflowNode = SerializedElementNode;
|
|
11
11
|
/** @noInheritDoc */
|
|
12
12
|
export declare class OverflowNode extends ElementNode {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/** @internal */
|
|
14
|
+
$config(): import("lexical").StaticNodeConfigRecord<"overflow", {
|
|
15
|
+
$transform(node: OverflowNode): void;
|
|
16
|
+
extends: typeof ElementNode;
|
|
17
|
+
}>;
|
|
17
18
|
createDOM(config: EditorConfig): HTMLElement;
|
|
18
19
|
updateDOM(prevNode: this, dom: HTMLElement): boolean;
|
|
19
20
|
insertNewAfter(selection: RangeSelection, restoreSelection?: boolean): null | LexicalNode;
|
|
20
21
|
excludeFromCopy(): boolean;
|
|
21
|
-
static transform(): (node: LexicalNode) => void;
|
|
22
22
|
}
|
|
23
23
|
export declare function $createOverflowNode(): OverflowNode;
|
|
24
24
|
export declare function $isOverflowNode(node: LexicalNode | null | undefined): node is OverflowNode;
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"overflow"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.32.2-nightly.
|
|
11
|
+
"version": "0.32.2-nightly.20250623.0",
|
|
12
12
|
"main": "LexicalOverflow.js",
|
|
13
13
|
"types": "index.d.ts",
|
|
14
14
|
"repository": {
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"lexical": "0.32.2-nightly.
|
|
39
|
+
"lexical": "0.32.2-nightly.20250623.0"
|
|
40
40
|
}
|
|
41
41
|
}
|