@lexical/hashtag
Advanced tools
Comparing version 0.2.9 to 0.3.0
@@ -9,3 +9,8 @@ /** | ||
import type {EditorConfig, LexicalNode, NodeKey} from 'lexical'; | ||
import type { | ||
EditorConfig, | ||
LexicalNode, | ||
NodeKey, | ||
SerializedTextNode, | ||
} from 'lexical'; | ||
import {TextNode} from 'lexical'; | ||
@@ -20,6 +25,7 @@ | ||
isTextEntity(): true; | ||
static importJSON(serializedNode: SerializedTextNode): HashtagNode; | ||
} | ||
export function $createHashtagNode(text?: string): TextNode; | ||
export function $createHashtagNode(text?: string): HashtagNode; | ||
export function $isHashtagNode( | ||
node: LexicalNode | null | undefined, | ||
): node is HashtagNode; |
@@ -18,3 +18,3 @@ /** | ||
* | ||
* @flow strict | ||
*/ | ||
@@ -40,2 +40,17 @@ class HashtagNode extends lexical.TextNode { | ||
static importJSON(serializedNode) { | ||
const node = $createHashtagNode(serializedNode.text); | ||
node.setFormat(serializedNode.format); | ||
node.setDetail(serializedNode.detail); | ||
node.setMode(serializedNode.mode); | ||
node.setStyle(serializedNode.style); | ||
return node; | ||
} | ||
exportJSON() { | ||
return { ...super.exportJSON(), | ||
type: 'hashtag' | ||
}; | ||
} | ||
canInsertTextBefore() { | ||
@@ -42,0 +57,0 @@ return false; |
@@ -7,2 +7,4 @@ /** | ||
*/ | ||
var b=require("@lexical/utils"),d=require("lexical");class e extends d.TextNode{static getType(){return"hashtag"}static clone(a){return new e(a.__text,a.__key)}constructor(a,c){super(a,c)}createDOM(a){const c=super.createDOM(a);b.addClassNamesToElement(c,a.theme.hashtag);return c}canInsertTextBefore(){return!1}isTextEntity(){return!0}}exports.$createHashtagNode=function(a=""){return new e(a)};exports.$isHashtagNode=function(a){return a instanceof e};exports.HashtagNode=e; | ||
'use strict';var c=require("@lexical/utils"),d=require("lexical"); | ||
class e extends d.TextNode{static getType(){return"hashtag"}static clone(a){return new e(a.__text,a.__key)}constructor(a,b){super(a,b)}createDOM(a){let b=super.createDOM(a);c.addClassNamesToElement(b,a.theme.hashtag);return b}static importJSON(a){let b=f(a.text);b.setFormat(a.format);b.setDetail(a.detail);b.setMode(a.mode);b.setStyle(a.style);return b}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}} | ||
function f(a=""){return new e(a)}exports.$createHashtagNode=f;exports.$isHashtagNode=function(a){return a instanceof e};exports.HashtagNode=e |
@@ -11,9 +11,9 @@ { | ||
"license": "MIT", | ||
"version": "0.2.9", | ||
"version": "0.3.0", | ||
"main": "LexicalHashtag.js", | ||
"peerDependencies": { | ||
"lexical": "0.2.9" | ||
"lexical": "0.3.0" | ||
}, | ||
"dependencies": { | ||
"@lexical/utils": "0.2.9" | ||
"@lexical/utils": "0.3.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6325
105
0
+ Added@lexical/list@0.3.0(transitive)
+ Added@lexical/table@0.3.0(transitive)
+ Added@lexical/utils@0.3.0(transitive)
+ Addedlexical@0.3.0(transitive)
- Removed@lexical/list@0.2.9(transitive)
- Removed@lexical/table@0.2.9(transitive)
- Removed@lexical/utils@0.2.9(transitive)
- Removedlexical@0.2.9(transitive)
Updated@lexical/utils@0.3.0