@lexical/hashtag 0.9.0 → 0.9.2
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/LexicalHashtag.dev.js +12 -0
- package/LexicalHashtagNode.d.ts +10 -0
- package/package.json +3 -3
package/LexicalHashtag.dev.js
CHANGED
|
@@ -61,9 +61,21 @@ class HashtagNode extends lexical.TextNode {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Generates a HashtagNode, which is a string following the format of a # followed by some text, eg. #lexical.
|
|
66
|
+
* @param text - The text used inside the HashtagNode.
|
|
67
|
+
* @returns - The HashtagNode with the embedded text.
|
|
68
|
+
*/
|
|
69
|
+
|
|
64
70
|
function $createHashtagNode(text = '') {
|
|
65
71
|
return lexical.$applyNodeReplacement(new HashtagNode(text));
|
|
66
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Determines if node is a HashtagNode.
|
|
75
|
+
* @param node - The node to be checked.
|
|
76
|
+
* @returns true if node is a HashtagNode, false otherwise.
|
|
77
|
+
*/
|
|
78
|
+
|
|
67
79
|
function $isHashtagNode(node) {
|
|
68
80
|
return node instanceof HashtagNode;
|
|
69
81
|
}
|
package/LexicalHashtagNode.d.ts
CHANGED
|
@@ -18,5 +18,15 @@ export declare class HashtagNode extends TextNode {
|
|
|
18
18
|
canInsertTextBefore(): boolean;
|
|
19
19
|
isTextEntity(): true;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Generates a HashtagNode, which is a string following the format of a # followed by some text, eg. #lexical.
|
|
23
|
+
* @param text - The text used inside the HashtagNode.
|
|
24
|
+
* @returns - The HashtagNode with the embedded text.
|
|
25
|
+
*/
|
|
21
26
|
export declare function $createHashtagNode(text?: string): HashtagNode;
|
|
27
|
+
/**
|
|
28
|
+
* Determines if node is a HashtagNode.
|
|
29
|
+
* @param node - The node to be checked.
|
|
30
|
+
* @returns true if node is a HashtagNode, false otherwise.
|
|
31
|
+
*/
|
|
22
32
|
export declare function $isHashtagNode(node: LexicalNode | null | undefined): node is HashtagNode;
|
package/package.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"hashtag"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.9.
|
|
11
|
+
"version": "0.9.2",
|
|
12
12
|
"main": "LexicalHashtag.js",
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"lexical": "0.9.
|
|
14
|
+
"lexical": "0.9.2"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lexical/utils": "0.9.
|
|
17
|
+
"@lexical/utils": "0.9.2"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|