@lexical/markdown 0.6.2 → 0.6.3
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/LexicalMarkdown.dev.js
CHANGED
|
@@ -1057,8 +1057,8 @@ const LINK = {
|
|
|
1057
1057
|
return linkContent;
|
|
1058
1058
|
}
|
|
1059
1059
|
},
|
|
1060
|
-
importRegExp: /(?:\[([^[]+)\])(?:\(([^(]+)\))/,
|
|
1061
|
-
regExp: /(?:\[([^[]+)\])(?:\(([^(]+)\))$/,
|
|
1060
|
+
importRegExp: /(?:\[([^[]+)\])(?:\(([^()]+)\))/,
|
|
1061
|
+
regExp: /(?:\[([^[]+)\])(?:\(([^()]+)\))$/,
|
|
1062
1062
|
replace: (textNode, match) => {
|
|
1063
1063
|
const [, linkText, linkUrl] = match;
|
|
1064
1064
|
const linkNode = link.$createLinkNode(linkUrl);
|
package/LexicalMarkdown.prod.js
CHANGED
|
@@ -23,7 +23,7 @@ let W=a=>(b,c,d)=>{d=a(d);d.append(...c);b.replace(d);d.select(0,0)},X=a=>(b,c,d
|
|
|
23
23
|
export:(a,b)=>{if(!F.$isQuoteNode(a))return null;a=b(a).split("\n");b=[];for(const c of a)b.push("> "+c);return b.join("\n")},regExp:/^>\s/,replace:(a,b,c,d)=>{if(d&&(c=a.getPreviousSibling(),F.$isQuoteNode(c))){c.splice(c.getChildrenSize(),0,[k.$createLineBreakNode(),...b]);c.select(0,0);a.remove();return}c=F.$createQuoteNode();c.append(...b);a.replace(c);c.select(0,0)},type:"element"},la={dependencies:[t.CodeNode],export:a=>{if(!t.$isCodeNode(a))return null;const b=a.getTextContent();return"```"+
|
|
24
24
|
(a.getLanguage()||"")+(b?"\n"+b:"")+"\n```"},regExp:/^```(\w{1,10})?\s/,replace:W(a=>t.$createCodeNode(a?a[1]:void 0)),type:"element"},ma={dependencies:[A.ListNode,A.ListItemNode],export:(a,b)=>A.$isListNode(a)?Y(a,b,0):null,regExp:/^(\s*)[-*+]\s/,replace:X("bullet"),type:"element"},na={dependencies:[A.ListNode,A.ListItemNode],export:(a,b)=>A.$isListNode(a)?Y(a,b,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:X("check"),type:"element"},oa={dependencies:[A.ListNode,A.ListItemNode],export:(a,
|
|
25
25
|
b)=>A.$isListNode(a)?Y(a,b,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:X("number"),type:"element"},pa={format:["code"],tag:"`",type:"text-format"},qa={format:["bold","italic"],tag:"***",type:"text-format"},ra={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},ta={format:["bold"],tag:"**",type:"text-format"},ua={format:["bold"],intraword:!1,tag:"__",type:"text-format"},va={format:["strikethrough"],tag:"~~",type:"text-format"},wa={format:["italic"],tag:"*",type:"text-format"},xa={format:["italic"],
|
|
26
|
-
intraword:!1,tag:"_",type:"text-format"},ya={dependencies:[G.LinkNode],export:(a,b,c)=>{if(!G.$isLinkNode(a))return null;b=`[${a.getTextContent()}](${a.getURL()})`;const d=a.getFirstChild();return 1===a.getChildrenSize()&&k.$isTextNode(d)?c(d,b):b},importRegExp:/(?:\[([^[]+)\])(?:\(([^(]+)\))/,regExp:/(?:\[([^[]+)\])(?:\(([^(]+)\))$/,replace:(a,b)=>{const [,c,d]=b;b=G.$createLinkNode(d);const e=k.$createTextNode(c);e.setFormat(a.getFormat());b.append(e);a.replace(b)},trigger:")",type:"text-match"},
|
|
26
|
+
intraword:!1,tag:"_",type:"text-format"},ya={dependencies:[G.LinkNode],export:(a,b,c)=>{if(!G.$isLinkNode(a))return null;b=`[${a.getTextContent()}](${a.getURL()})`;const d=a.getFirstChild();return 1===a.getChildrenSize()&&k.$isTextNode(d)?c(d,b):b},importRegExp:/(?:\[([^[]+)\])(?:\(([^()]+)\))/,regExp:/(?:\[([^[]+)\])(?:\(([^()]+)\))$/,replace:(a,b)=>{const [,c,d]=b;b=G.$createLinkNode(d);const e=k.$createTextNode(c);e.setFormat(a.getFormat());b.append(e);a.replace(b)},trigger:")",type:"text-match"},
|
|
27
27
|
za=[ja,ka,la,ma,oa],Aa=[pa,qa,ra,ta,ua,wa,xa,va],Ba=[ya],Z=[...za,...Aa,...Ba];exports.$convertFromMarkdownString=function(a,b=Z){return fa(b)(a)};exports.$convertToMarkdownString=function(a=Z){return ba(a)()};exports.BOLD_ITALIC_STAR=qa;exports.BOLD_ITALIC_UNDERSCORE=ra;exports.BOLD_STAR=ta;exports.BOLD_UNDERSCORE=ua;exports.CHECK_LIST=na;exports.CODE=la;exports.ELEMENT_TRANSFORMERS=za;exports.HEADING=ja;exports.INLINE_CODE=pa;exports.ITALIC_STAR=wa;exports.ITALIC_UNDERSCORE=xa;exports.LINK=ya;
|
|
28
28
|
exports.ORDERED_LIST=oa;exports.QUOTE=ka;exports.STRIKETHROUGH=va;exports.TEXT_FORMAT_TRANSFORMERS=Aa;exports.TEXT_MATCH_TRANSFORMERS=Ba;exports.TRANSFORMERS=Z;exports.UNORDERED_LIST=ma;
|
|
29
29
|
exports.registerMarkdownShortcuts=function(a,b=Z){let c=I(b),d=H(c.textFormat,({tag:f})=>f[f.length-1]),e=H(c.textMatch,({trigger:f})=>f);for(let f of b)if(b=f.type,("element"===b||"text-match"===b)&&!a.hasNodes(f.dependencies))throw Error("Minified Lexical error #79; visit https://lexical.dev/docs/error?code=79 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");return a.registerUpdateListener(({tags:f,dirtyLeaves:l,editorState:h,prevEditorState:p})=>
|
package/package.json
CHANGED
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
"markdown"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.6.
|
|
11
|
+
"version": "0.6.3",
|
|
12
12
|
"main": "LexicalMarkdown.js",
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"lexical": "0.6.
|
|
14
|
+
"lexical": "0.6.3"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lexical/utils": "0.6.
|
|
18
|
-
"@lexical/code": "0.6.
|
|
19
|
-
"@lexical/text": "0.6.
|
|
20
|
-
"@lexical/rich-text": "0.6.
|
|
21
|
-
"@lexical/list": "0.6.
|
|
22
|
-
"@lexical/link": "0.6.
|
|
17
|
+
"@lexical/utils": "0.6.3",
|
|
18
|
+
"@lexical/code": "0.6.3",
|
|
19
|
+
"@lexical/text": "0.6.3",
|
|
20
|
+
"@lexical/rich-text": "0.6.3",
|
|
21
|
+
"@lexical/list": "0.6.3",
|
|
22
|
+
"@lexical/link": "0.6.3"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|