@meowdown/core 0.17.1 → 0.17.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/dist/index.js CHANGED
@@ -19,5 +19,5 @@ import{Priority as e,Priority as t,createMarkBuilders as n,createNodeBuilders as
19
19
  `,t-1)+1,r=0;for(let i=n;i<t;i++)r+=e.charCodeAt(i)===9?4-r%4:1;return r}function Qr(e,t){let n=0,r=0;for(;r<e.length&&n<t;){let t=e.charCodeAt(r);if(t===32)n+=1;else if(t===9)n+=4-n%4;else break;r++}return e.slice(r)}function $r(e,t){return t===0||!e.includes(`
20
20
  `)?e:e.split(`
21
21
  `).map((e,n)=>n===0?e:Qr(e,t)).join(`
22
- `)}function Q(e,t,n){return e.paragraph($r(t,n))}function $(e,t,n){let r=t.from,i=t.to,a=Z(n,r);if(t.firstChild()){let o=``,s=r;do t.type.id===P.QuoteMark&&(o+=n.slice(s,t.from),s=t.to,Dt(n.charCodeAt(s))&&(s+=1));while(t.nextSibling());return t.parent(),o+=n.slice(s,i),Q(e,o,a)}return Q(e,n.slice(r,i),a)}function ei(e,t,n){let r=[];if(t.firstChild()){do{if(t.type.id===P.QuoteMark)continue;r.push(...Y(e,t,n))}while(t.nextSibling());t.parent()}return e.blockquote(r)}function ti(e,t,n,r){let i=[];if(t.firstChild()){do t.type.id===P.ListItem&&i.push(ni(e,t,n,r));while(t.nextSibling());t.parent()}return i}function ni(e,t,n,r){let i=[],a,o,s,c;if(t.firstChild()){do{if(t.type.id===P.ListMark){if(r===`ordered`){let e=n.charCodeAt(t.to-1);e===41?c=`)`:e===46&&(c=`.`);let r=Number.parseInt(n.slice(t.from,t.to),10);s=Number.isFinite(r)?r:1}else{let e=n.charCodeAt(t.from);c=e===42?`*`:e===43?`+`:`-`}continue}if(r===`bullet`&&t.type.id===P.Task){let r=t.from,s=t.to;if(a=!1,t.firstChild()){if(t.type.id===P.TaskMarker){let e=n.charCodeAt(t.from+1);e===120?(a=!0,o=`x`):e===88&&(a=!0,o=`X`),r=t.to}t.parent()}Dt(n.charCodeAt(r))&&(r+=1);let c=n.slice(r,s);i.push(Q(e,c,Z(n,r)));continue}i.push(...Y(e,t,n))}while(t.nextSibling());t.parent()}return e.list({kind:a==null?r:`task`,order:r===`ordered`?s??1:null,checked:a??!1,collapsed:!1,marker:c,taskMarker:o},i)}function ri(e,t,n){let r=``,i=``;if(t.firstChild()){do switch(t.type.id){case P.CodeInfo:r=n.slice(t.from,t.to);break;case P.CodeText:i=n.slice(t.from,t.to);break}while(t.nextSibling());t.parent()}return e.codeBlock({language:r},i)}function ii(e,t,n){let r=0;if(t.firstChild()){do t.type.id===P.TableDelimiter&&(r=ai(n.slice(t.from,t.to)));while(t.nextSibling());t.parent()}let i=[];if(t.firstChild()){do{let a=t.type.id;a===P.TableHeader?i.push(oi(e,t,n,!0,r)):a===P.TableRow&&i.push(oi(e,t,n,!1,r))}while(t.nextSibling());t.parent()}return e.table(i)}function ai(e){return e.split(`|`).filter(e=>e.trim()!==``).length}function oi(e,t,n,r,i){let a=Array(i).fill(``);if(t.firstChild()){let e=t.type.id===P.TableDelimiter,r=0;do if(t.type.id===P.TableDelimiter)r++;else if(t.type.id===P.TableCell){let o=r-+!!e;o>=0&&o<i&&(a[o]=n.slice(t.from,t.to).trim().replaceAll(String.raw`\|`,`|`))}while(t.nextSibling());t.parent()}let o=a.map(t=>{let n=e.paragraph(t);return r?e.tableHeaderCell(n):e.tableCell(n)});return e.tableRow(o)}function si(e){return e.replace(/\n+$/u,``)}function ci(e){return/^[\s>]*$/u.test(e)}function li(e){return e.split(`
22
+ `)}function Q(e,t,n){return e.paragraph($r(t,n))}function $(e,t,n){let r=t.from,i=t.to,a=Z(n,r);if(t.firstChild()){let o=``,s=r;do t.type.id===P.QuoteMark&&(o+=n.slice(s,t.from),s=t.to,Dt(n.charCodeAt(s))&&(s+=1));while(t.nextSibling());return t.parent(),o+=n.slice(s,i),Q(e,o,a)}return Q(e,n.slice(r,i),a)}function ei(e,t,n){let r=[];if(t.firstChild()){do{if(t.type.id===P.QuoteMark)continue;r.push(...Y(e,t,n))}while(t.nextSibling());t.parent()}return e.blockquote(r)}function ti(e,t,n,r){let i=[];if(t.firstChild()){do t.type.id===P.ListItem&&i.push(ni(e,t,n,r));while(t.nextSibling());t.parent()}return i}function ni(e,t,n,r){let i=[],a,o,s,c;if(t.firstChild()){do{if(t.type.id===P.ListMark){if(r===`ordered`){let e=n.charCodeAt(t.to-1);e===41?c=`)`:e===46&&(c=`.`);let r=Number.parseInt(n.slice(t.from,t.to),10);s=Number.isFinite(r)?r:1}else{let e=n.charCodeAt(t.from);c=e===42?`*`:e===43?`+`:`-`}continue}if(r===`bullet`&&t.type.id===P.Task){let r=t.from,s=t.to;if(a=!1,t.firstChild()){if(t.type.id===P.TaskMarker){let e=n.charCodeAt(t.from+1);e===120?(a=!0,o=`x`):e===88&&(a=!0,o=`X`),r=t.to}t.parent()}Dt(n.charCodeAt(r))&&(r+=1);let c=n.slice(r,s);i.push(Q(e,c,Z(n,r)));continue}i.push(...Y(e,t,n))}while(t.nextSibling());t.parent()}return e.list({kind:a==null?r:`task`,order:r===`ordered`?s??1:null,checked:a??!1,collapsed:!1,marker:c,taskMarker:o},i)}function ri(e,t,n){let r=``,i=``;if(t.firstChild()){do switch(t.type.id){case P.CodeInfo:r=n.slice(t.from,t.to);break;case P.CodeText:i+=n.slice(t.from,t.to);break}while(t.nextSibling());t.parent()}return e.codeBlock({language:r},i)}function ii(e,t,n){let r=0;if(t.firstChild()){do t.type.id===P.TableDelimiter&&(r=ai(n.slice(t.from,t.to)));while(t.nextSibling());t.parent()}let i=[];if(t.firstChild()){do{let a=t.type.id;a===P.TableHeader?i.push(oi(e,t,n,!0,r)):a===P.TableRow&&i.push(oi(e,t,n,!1,r))}while(t.nextSibling());t.parent()}return e.table(i)}function ai(e){return e.split(`|`).filter(e=>e.trim()!==``).length}function oi(e,t,n,r,i){let a=Array(i).fill(``);if(t.firstChild()){let e=t.type.id===P.TableDelimiter,r=0;do if(t.type.id===P.TableDelimiter)r++;else if(t.type.id===P.TableCell){let o=r-+!!e;o>=0&&o<i&&(a[o]=n.slice(t.from,t.to).trim().replaceAll(String.raw`\|`,`|`))}while(t.nextSibling());t.parent()}let o=a.map(t=>{let n=e.paragraph(t);return r?e.tableHeaderCell(n):e.tableCell(n)});return e.tableRow(o)}function si(e){return e.replace(/\n+$/u,``)}function ci(e){return/^[\s>]*$/u.test(e)}function li(e){return e.split(`
23
23
  `).filter(e=>!ci(e))}function ui(e,t={}){let n=Pr(qr(e,{frontmatter:t.frontmatter}),{frontmatter:t.frontmatter});if(si(n)===si(e))return`exact`;let r=li(e),i=li(n);return r.length===i.length&&r.every((e,t)=>e.trimEnd()===i[t].trimEnd())?`normalizing`:`lossy`}export{jr as EDITOR_KEY_BINDINGS,e as Priority,ui as checkRoundTrip,Nr as codeBlockLanguages,Ar as defineBulletAfterHeading,Kn as defineEditorExtension,Or as defineEmbedPaste,br as defineImage,Cr as defineImageClickHandler,$n as defineLinkClickHandler,Qe as defineMarkMode,Ke as definePlaceholder,qe as defineReadonly,Xn as defineWikilinkClickHandler,Pr as docToMarkdown,qr as markdownToDoc,oe as withPriority};
package/dist/style.css CHANGED
@@ -359,7 +359,6 @@ img.ProseMirror-separator {
359
359
  .ProseMirror .selectedCell {
360
360
  border: 1px double var(--meowdown-node-outline);
361
361
  background: var(--meowdown-node-selection);
362
- --meowdown-selection: transparent;
363
362
  caret-color: #0000;
364
363
  }
365
364
 
@@ -367,8 +366,12 @@ img.ProseMirror-separator {
367
366
  background: var(--meowdown-selection);
368
367
  }
369
368
 
370
- .ProseMirror .ProseMirror-selectednode {
369
+ .ProseMirror.ProseMirror-hideselection ::selection {
371
370
  --meowdown-selection: transparent;
371
+ caret-color: #0000;
372
+ }
373
+
374
+ .ProseMirror .ProseMirror-selectednode {
372
375
  outline: 1px solid var(--meowdown-node-outline);
373
376
  background: var(--meowdown-node-selection);
374
377
  border-radius: 2px;
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@meowdown/core",
3
3
  "type": "module",
4
- "version": "0.17.1",
4
+ "version": "0.17.3",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/prosekit/meowdown"
8
+ "url": "https://github.com/prosekit/meowdown",
9
+ "directory": "packages/core"
9
10
  },
10
11
  "exports": {
11
12
  ".": "./dist/index.js",