@yoopta/lists 1.9.1-rc → 1.9.3-rc
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 +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{createYooptaPlugin as i,generateId as n,getElementByPath as s,cx as r}from"@yoopta/editor";import{Editor as a,Element as l,Transforms as o,Path as d}from"slate";import{ReactEditor as c}from"slate-react";function p(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}var h="mfUTTw6O";p(".mfUTTw6O{color:#292929;font-size:16px;letter-spacing:-.003em;line-height:24px;list-style-position:inside;padding-bottom:2px;padding-left:0;padding-top:2px;position:relative}.qvO-1a-q{align-items:center;display:flex;flex-grow:0;flex-shrink:0;justify-content:center;margin-right:2px;min-height:calc(1.5em + 6px);user-select:none;width:24px}.xPshFZ5Y{box-sizing:border-box;color:#000;display:inline;flex-shrink:0;font-size:16px;font-style:normal;font-weight:400;line-height:24px;min-width:28px;padding:0 6px 0 4px;word-break:break-word}");const m=({attributes:t,children:i})=>e("li",Object.assign({className:h,draggable:!1},t,{children:i}));m.displayName="ListItem";const g="list-item",u=i({type:g,renderer:e=>m,shortcut:"-",defineElement:()=>({id:n(),type:"list-item",children:[{text:""}],nodeType:"block"}),placeholder:null,events:{onKeyDown:(e,{hotkeys:t,defaultNode:i})=>r=>{if(!e.selection)return;if(s(e,e.selection.anchor.path,"lowest").type!==g)return;const c=a.above(e,{at:e.selection.anchor,match:e=>l.isElement(e)&&e.type===g});if(!c)return;const{anchor:p}=e.selection,[h,m]=c,[f,v]=a.parent(e,m),y=a.string(e,m),x=a.isEnd(e,p,m),b=a.isStart(e,p,m),k=m.length-1,E=2===k,N=1===k;if(t.isShiftEnter(r))return r.preventDefault(),void e.insertText("\n");if(t.isEnter(r)){if(r.preventDefault(),""===y.trim()){o.unwrapNodes(e,{match:e=>!a.isEditor(e)&&l.isElement(e)&&e.type===f.type,split:!0});const t=k>1?{id:n(),type:g,children:[{text:""}]}:i;return void o.setNodes(e,t,{at:e.selection})}if(!x&&!b)return o.splitNodes(e),void o.setNodes(e,{id:n()});const t=Object.assign(Object.assign({},h),{id:n(),children:[{text:""}]});o.insertNodes(e,t)}else if(t.isBackspace(r)){const[,t]=a.first(e,v),n=0===d.compare(e.selection.anchor.path,t);b&&n&&(r.preventDefault(),o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===f.type,split:!0}),o.setNodes(e,i,{at:e.selection}))}else{if(t.isTab(r)){if(r.preventDefault(),E)return;const t=Object.assign(Object.assign({},f),{id:n(),type:f.type,children:[u.getPlugin.defineElement()]});return o.wrapNodes(e,t,{at:m}),void o.setNodes(e,{data:{depth:k+1,skipDrag:!0}},{match:e=>l.isElement(e)&&e.type===f.type})}if(t.isShiftTab(r)){if(r.preventDefault(),N)return;return o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===f.type,split:!0}),void o.setNodes(e,{data:{depth:k-1,skipDrag:!0}},{match:e=>l.isElement(e)&&e.type===f.type})}}}},exports:{markdown:{serialize:(e,t)=>`- ${t}`},html:{serialize:(e,t)=>(console.log("children",t),`<li>${t}</li>`),deserialize:{nodeName:"LI"}}}});var f="cN2XzHcO";p(".cN2XzHcO{margin:2px 0;padding-left:18px}");const v=({attributes:t,children:i})=>e("ol",Object.assign({draggable:!1},t,{className:f},{children:i})),y=i({type:"numbered-list",renderer:e=>v,childPlugin:u,shortcut:"1.",defineElement:()=>({id:n(),type:"numbered-list",children:[u.getPlugin.defineElement()],nodeType:"block",data:{depth:1,skipDrag:!0,skipSettings:!0}}),createElement:e=>{var t,i;const n=u.getPlugin.defineElement();o.unwrapNodes(e,{match:e=>{var t;return!a.isEditor(e)&&l.isElement(e)&&"list-item"!==e.type&&"todo-list-item"!==e.type&&(null===(t=e.data)||void 0===t?void 0:t.depth)>=1},split:!0}),o.setNodes(e,n,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor});const s=y.getPlugin.defineElement();o.wrapNodes(e,s,{at:null===(i=e.selection)||void 0===i?void 0:i.anchor})},exports:{markdown:{serialize:(e,t)=>`${t}\n`},html:{serialize:(e,t)=>{var i;return`<ol style="padding-left: ${(null===(i=e.data)||void 0===i?void 0:i.depth)?15*e.data.depth:15}px;">${t}</ol>`},deserialize:{nodeName:"OL"}}}});var x="wVFRrWWa";p(".wVFRrWWa{margin:2px 0;padding-left:18px}");const b=({attributes:t,children:i,element:n})=>e("ul",Object.assign({draggable:!1},t,{className:x},{children:i})),k=i({type:"bulleted-list",renderer:e=>b,shortcut:"-",childPlugin:u,defineElement:()=>({id:n(),type:"bulleted-list",children:[u.getPlugin.defineElement()],nodeType:"block",data:{depth:1,skipDrag:!0,skipSettings:!0}}),createElement:e=>{var t,i;const n=u.getPlugin.defineElement();o.unwrapNodes(e,{match:e=>{var t;return!a.isEditor(e)&&l.isElement(e)&&"list-item"!==e.type&&"todo-list-item"!==e.type&&(null===(t=e.data)||void 0===t?void 0:t.depth)>=1},split:!0}),o.setNodes(e,n,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor});const s=k.getPlugin.defineElement();o.wrapNodes(e,s,{at:null===(i=e.selection)||void 0===i?void 0:i.anchor})},exports:{markdown:{serialize:(e,t)=>`- ${t}`},html:{serialize:(e,t)=>{var i;return`<ul style="padding-left: ${(null===(i=e.data)||void 0===i?void 0:i.depth)?15*e.data.depth:15}px;">${t}</ul>`},deserialize:{nodeName:"UL"}}}});var E="Mzo1TbSt";p(".Mzo1TbSt{padding-left:18px}");var N="zLPFpe0C",w="cJeUAnzK",T="YT2kDg7r",z="GzvUWhTl",D="YiyH9UVU";p('.zLPFpe0C{fill:inherit;align-items:flex-start;color:#292929;color:inherit;display:flex;font-size:16px;letter-spacing:-.003em;line-height:24px;margin-bottom:1px;margin-top:1px;padding-bottom:2px;padding-left:2px;padding-top:2px;width:100%}.cJeUAnzK{text-decoration:line-through}.YT2kDg7r{align-items:center;display:flex;flex-grow:0;flex-shrink:0;justify-content:center;margin-right:2px;min-height:30px;user-select:none;width:24px}.YT2kDg7r+.YT2kDg7r{margin-top:1em}.GzvUWhTl{align-items:center;-webkit-appearance:none;appearance:none;border:.1em solid;color:currentColor;cursor:pointer;display:flex;flex-grow:0;flex-shrink:0;height:1.15em;height:16px;place-content:center;justify-content:center;position:relative;transition:background .2s ease-out 0s;width:1.15em;width:16px}.GzvUWhTl:before{background-color:CanvasText;clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0,43% 62%);color:inherit;content:"";height:.65em;transform:scale(0);transform-origin:bottom left;transition:transform .12s ease-in-out;width:.65em}.GzvUWhTl:checked:before{transform:scale(1)}.YiyH9UVU{caret-color:#37352f;max-width:100%;min-width:1px;opacity:1;padding:3px 2px;text-align:left;white-space:pre-wrap;word-break:break-word}');const O="todo-list-item",j=i({type:O,renderer:i=>function({attributes:n,children:s,element:a}){const d=a.data.checked;return t("div",Object.assign({draggable:!1},n,{className:r(N,{[w]:d})},{children:[e("label",Object.assign({className:T,contentEditable:!1,style:{userSelect:"none"}},{children:e("input",{type:"checkbox",checked:d,className:z,onChange:e=>{const t=c.findPath(i,a);o.setNodes(i,{data:{checked:e.target.checked}},{at:t,match:e=>l.isElement(e)&&e.type===O})}})})),e("span",Object.assign({className:D},{children:s}))]}))},placeholder:null,defineElement:()=>({id:n(),type:"todo-list-item",children:[{text:""}],nodeType:"block",data:{checked:!1}}),events:{onKeyDown:(e,{hotkeys:t,defaultNode:i})=>r=>{var c;if(!e.selection)return;if(s(e,e.selection.anchor.path,"lowest").type!==O)return;const p=a.above(e,{at:null===(c=e.selection)||void 0===c?void 0:c.anchor.path,match:e=>l.isElement(e)&&e.type===O});if(!p)return;const[h,m]=p,[g,u]=a.parent(e,m),f=a.string(e,m),v=a.isEnd(e,e.selection.anchor,m),y=a.isStart(e,e.selection.anchor,m),x=m.length-1,b=2===x,k=1===x;if(t.isShiftEnter(r))return r.preventDefault(),void e.insertText("\n");if(t.isEnter(r)){if(r.preventDefault(),""===f.trim()){o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===g.type,split:!0});const t=x>1?{id:n(),type:O,children:[{text:""}],options:{checked:!1}}:i;return void o.setNodes(e,t,{at:e.selection})}if(!v&&!y)return o.splitNodes(e),void o.setNodes(e,{id:n(),data:{checked:!1}},{match:e=>l.isElement(e)&&e.type===O});const t=Object.assign(Object.assign({},h),{id:n(),children:[{text:""}],data:{checked:!1}});o.insertNodes(e,t,{select:!0})}else{if(t.isCmdEnter(r))return r.preventDefault(),void o.setNodes(e,{data:{checked:!h.data.checked}},{at:m,match:e=>l.isElement(e)&&e.type===O});if(t.isBackspace(r)){const[,t]=a.first(e,u),n=0===d.compare(e.selection.anchor.path,t);y&&n&&(r.preventDefault(),o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===g.type,split:!0}),o.setNodes(e,i,{at:e.selection}))}else if(t.isTab(r)){if(r.preventDefault(),b)return;const t=Object.assign(Object.assign({},g),{id:n(),type:g.type,children:[j.getPlugin.defineElement()]});o.wrapNodes(e,t,{at:m})}else if(t.isShiftTab(r)){if(r.preventDefault(),k)return;o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===g.type,split:!0})}else;}}},options:{checked:!1},exports:{markdown:{serialize:(e,t)=>`[${e.data.checked?"x":" "}] ${t}\n`},html:{serialize:(e,t)=>`<div>[${e.data.checked?"x":" "}] ${t}</div>`}}}),P=({attributes:t,children:i})=>e("div",Object.assign({draggable:!1},t,{className:E},{children:i})),$=i({type:"todo-list",renderer:e=>P,childPlugin:j,shortcut:"[]",defineElement:()=>({id:n(),type:"todo-list",children:[j.getPlugin.defineElement()],nodeType:"block",data:{depth:1,skipDrag:!0,skipSettings:!0}}),extendEditor:e=>e,createElement:e=>{var t,i;const n=j.getPlugin.defineElement();o.unwrapNodes(e,{match:e=>{var t;return!a.isEditor(e)&&l.isElement(e)&&"list-item"!==e.type&&"todo-list-item"!==e.type&&(null===(t=e.data)||void 0===t?void 0:t.depth)>=1},split:!0}),o.setNodes(e,n,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor});const s=$.getPlugin.defineElement();o.wrapNodes(e,s,{at:null===(i=e.selection)||void 0===i?void 0:i.anchor})},exports:{markdown:{serialize:(e,t)=>`${t}`},html:{serialize:(e,t)=>{var i;return`<div style="padding-left: ${(null===(i=e.data)||void 0===i?void 0:i.depth)?15*e.data.depth:15}px;">${t}</div>`}}}}),S={NumberedList:y,BulletedList:k,TodoList:$};export{k as BulletedList,y as NumberedList,$ as TodoList,S as default};
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{createYooptaPlugin as i,generateId as n,getElementByPath as s,cx as r}from"@yoopta/editor";import{Editor as a,Element as l,Transforms as o,Path as d}from"slate";import{ReactEditor as c}from"slate-react";function p(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}var h="mfUTTw6O";p(".mfUTTw6O{color:inherit;font-size:16px;letter-spacing:-.003em;line-height:28px;list-style-position:inside;padding-bottom:2px;padding-left:0;padding-top:2px;position:relative}.qvO-1a-q{align-items:center;display:flex;flex-grow:0;flex-shrink:0;justify-content:center;margin-right:2px;min-height:calc(1.5em + 6px);user-select:none;width:24px}.xPshFZ5Y{box-sizing:border-box;color:#000;display:inline;flex-shrink:0;font-size:16px;font-style:normal;font-weight:400;line-height:28px;min-width:28px;padding:0 6px 0 4px;word-break:break-word}");const m=({attributes:t,children:i,HTMLAttributes:n})=>e("li",Object.assign({className:h,draggable:!1},n,t,{children:i}));m.displayName="ListItem";const u="list-item",g=i({type:u,renderer:e=>m,shortcut:"-",defineElement:()=>({id:n(),type:"list-item",children:[{text:""}],nodeType:"block"}),placeholder:null,events:{onKeyDown:(e,{hotkeys:t,defaultNode:i})=>r=>{if(!e.selection)return;if(s(e,e.selection.anchor.path,"lowest").type!==u)return;const c=a.above(e,{at:e.selection.anchor,match:e=>l.isElement(e)&&e.type===u});if(!c)return;const{anchor:p}=e.selection,[h,m]=c,[f,v]=a.parent(e,m),y=a.string(e,m),x=a.isEnd(e,p,m),b=a.isStart(e,p,m),k=m.length-1,E=2===k,N=1===k;if(t.isShiftEnter(r))return r.preventDefault(),void e.insertText("\n");if(t.isEnter(r)){if(r.preventDefault(),""===y.trim()){o.unwrapNodes(e,{match:e=>!a.isEditor(e)&&l.isElement(e)&&e.type===f.type,split:!0});const t=k>1?{id:n(),type:u,children:[{text:""}]}:i;return void o.setNodes(e,t,{at:e.selection})}if(!x&&!b)return o.splitNodes(e),void o.setNodes(e,{id:n()});const t=Object.assign(Object.assign({},h),{id:n(),children:[{text:""}]});o.insertNodes(e,t)}else if(t.isBackspace(r)){const[,t]=a.first(e,v),n=0===d.compare(e.selection.anchor.path,t);b&&n&&(r.preventDefault(),o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===f.type,split:!0}),o.setNodes(e,i,{at:e.selection}))}else{if(t.isTab(r)){if(r.preventDefault(),E)return;const t=Object.assign(Object.assign({},f),{id:n(),type:f.type,children:[g.getPlugin.defineElement()]});return o.wrapNodes(e,t,{at:m}),void o.setNodes(e,{data:{depth:k+1,skipDrag:!0}},{match:e=>l.isElement(e)&&e.type===f.type})}if(t.isShiftTab(r)){if(r.preventDefault(),N)return;return o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===f.type,split:!0}),void o.setNodes(e,{data:{depth:k-1,skipDrag:!0}},{match:e=>l.isElement(e)&&e.type===f.type})}}}},exports:{markdown:{serialize:(e,t)=>`- ${t}`},html:{serialize:(e,t)=>(console.log("children",t),`<li>${t}</li>`),deserialize:{nodeName:"LI"}}}});var f="cN2XzHcO";p(".cN2XzHcO{margin:2px 0;padding-left:18px}");const v=({attributes:t,children:i,HTMLAttributes:n})=>e("ol",Object.assign({draggable:!1},n,t,{className:f},{children:i})),y=i({type:"numbered-list",renderer:e=>v,childPlugin:g,shortcut:"1.",defineElement:()=>({id:n(),type:"numbered-list",children:[g.getPlugin.defineElement()],nodeType:"block",data:{depth:1,skipDrag:!0,skipSettings:!0}}),createElement:e=>{var t,i;const n=g.getPlugin.defineElement();o.unwrapNodes(e,{match:e=>{var t;return!a.isEditor(e)&&l.isElement(e)&&"list-item"!==e.type&&"todo-list-item"!==e.type&&(null===(t=e.data)||void 0===t?void 0:t.depth)>=1},split:!0}),o.setNodes(e,n,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor});const s=y.getPlugin.defineElement();o.wrapNodes(e,s,{at:null===(i=e.selection)||void 0===i?void 0:i.anchor})},exports:{markdown:{serialize:(e,t)=>`${t}\n`},html:{serialize:(e,t)=>{var i;return`<ol style="padding-left: ${(null===(i=e.data)||void 0===i?void 0:i.depth)?15*e.data.depth:15}px;">${t}</ol>`},deserialize:{nodeName:"OL"}}}});var x="wVFRrWWa";p(".wVFRrWWa{margin:2px 0;padding-left:18px}");const b=({attributes:t,children:i,element:n,HTMLAttributes:s})=>e("ul",Object.assign({draggable:!1,className:x},s,t,{children:i})),k=i({type:"bulleted-list",renderer:e=>b,shortcut:"-",childPlugin:g,defineElement:()=>({id:n(),type:"bulleted-list",children:[g.getPlugin.defineElement()],nodeType:"block",data:{depth:1,skipDrag:!0,skipSettings:!0}}),createElement:e=>{var t,i;const n=g.getPlugin.defineElement();o.unwrapNodes(e,{match:e=>{var t;return!a.isEditor(e)&&l.isElement(e)&&"list-item"!==e.type&&"todo-list-item"!==e.type&&(null===(t=e.data)||void 0===t?void 0:t.depth)>=1},split:!0}),o.setNodes(e,n,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor});const s=k.getPlugin.defineElement();o.wrapNodes(e,s,{at:null===(i=e.selection)||void 0===i?void 0:i.anchor})},exports:{markdown:{serialize:(e,t)=>`- ${t}`},html:{serialize:(e,t)=>{var i;return`<ul style="padding-left: ${(null===(i=e.data)||void 0===i?void 0:i.depth)?15*e.data.depth:15}px;">${t}</ul>`},deserialize:{nodeName:"UL"}}}});var E="Mzo1TbSt";p(".Mzo1TbSt{padding-left:18px}");var N="zLPFpe0C",w="cJeUAnzK",T="YT2kDg7r",z="GzvUWhTl",D="YiyH9UVU";p('.zLPFpe0C{fill:inherit;align-items:flex-start;color:#292929;color:inherit;display:flex;font-size:16px;letter-spacing:-.003em;line-height:28px;margin-bottom:1px;margin-top:1px;padding-bottom:2px;padding-left:2px;padding-top:2px;width:100%}.cJeUAnzK{text-decoration:line-through}.YT2kDg7r{align-items:center;display:flex;flex-grow:0;flex-shrink:0;justify-content:center;margin-right:2px;min-height:30px;user-select:none;width:24px}.YT2kDg7r+.YT2kDg7r{margin-top:1em}.GzvUWhTl{align-items:center;-webkit-appearance:none;appearance:none;border:.1em solid;color:currentColor;cursor:pointer;display:flex;flex-grow:0;flex-shrink:0;height:1.15em;height:16px;place-content:center;justify-content:center;position:relative;transition:background .2s ease-out 0s;width:1.15em;width:16px}.GzvUWhTl:before{background-color:CanvasText;clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0,43% 62%);color:inherit;content:"";height:.65em;transform:scale(0);transform-origin:bottom left;transition:transform .12s ease-in-out;width:.65em}.GzvUWhTl:checked:before{transform:scale(1)}.YiyH9UVU{caret-color:#37352f;max-width:100%;min-width:1px;opacity:1;padding:3px 2px;text-align:left;white-space:pre-wrap;word-break:break-word}');const O="todo-list-item",j=i({type:O,renderer:i=>function({attributes:n,children:s,element:a,HTMLAttributes:d}){const p=a.data.checked;return t("div",Object.assign({draggable:!1},n,d,{className:r(N,{[w]:p})},{children:[e("label",Object.assign({className:T,contentEditable:!1,style:{userSelect:"none"}},{children:e("input",{type:"checkbox",checked:p,className:z,onChange:e=>{const t=c.findPath(i,a);o.setNodes(i,{data:{checked:e.target.checked}},{at:t,match:e=>l.isElement(e)&&e.type===O})}})})),e("span",Object.assign({className:D},{children:s}))]}))},placeholder:null,defineElement:()=>({id:n(),type:"todo-list-item",children:[{text:""}],nodeType:"block",data:{checked:!1}}),events:{onKeyDown:(e,{hotkeys:t,defaultNode:i})=>r=>{var c;if(!e.selection)return;if(s(e,e.selection.anchor.path,"lowest").type!==O)return;const p=a.above(e,{at:null===(c=e.selection)||void 0===c?void 0:c.anchor.path,match:e=>l.isElement(e)&&e.type===O});if(!p)return;const[h,m]=p,[u,g]=a.parent(e,m),f=a.string(e,m),v=a.isEnd(e,e.selection.anchor,m),y=a.isStart(e,e.selection.anchor,m),x=m.length-1,b=2===x,k=1===x;if(t.isShiftEnter(r))return r.preventDefault(),void e.insertText("\n");if(t.isEnter(r)){if(r.preventDefault(),""===f.trim()){o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===u.type,split:!0});const t=x>1?{id:n(),type:O,children:[{text:""}],options:{checked:!1}}:i;return void o.setNodes(e,t,{at:e.selection})}if(!v&&!y)return o.splitNodes(e),void o.setNodes(e,{id:n(),data:{checked:!1}},{match:e=>l.isElement(e)&&e.type===O});const t=Object.assign(Object.assign({},h),{id:n(),children:[{text:""}],data:{checked:!1}});o.insertNodes(e,t,{select:!0})}else{if(t.isCmdEnter(r))return r.preventDefault(),void o.setNodes(e,{data:{checked:!h.data.checked}},{at:m,match:e=>l.isElement(e)&&e.type===O});if(t.isBackspace(r)){const[,t]=a.first(e,g),n=0===d.compare(e.selection.anchor.path,t);y&&n&&(r.preventDefault(),o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===u.type,split:!0}),o.setNodes(e,i,{at:e.selection}))}else if(t.isTab(r)){if(r.preventDefault(),b)return;const t=Object.assign(Object.assign({},u),{id:n(),type:u.type,children:[j.getPlugin.defineElement()]});o.wrapNodes(e,t,{at:m})}else if(t.isShiftTab(r)){if(r.preventDefault(),k)return;o.unwrapNodes(e,{match:e=>l.isElement(e)&&e.type===u.type,split:!0})}else;}}},options:{checked:!1},exports:{markdown:{serialize:(e,t)=>`[${e.data.checked?"x":" "}] ${t}\n`},html:{serialize:(e,t)=>`<div>[${e.data.checked?"x":" "}] ${t}</div>`}}}),P=({attributes:t,children:i,HTMLAttributes:n})=>e("div",Object.assign({draggable:!1},n,t,{className:E},{children:i})),$=i({type:"todo-list",renderer:e=>P,childPlugin:j,shortcut:"[]",defineElement:()=>({id:n(),type:"todo-list",children:[j.getPlugin.defineElement()],nodeType:"block",data:{depth:1,skipDrag:!0,skipSettings:!0}}),extendEditor:e=>e,createElement:e=>{var t,i;const n=j.getPlugin.defineElement();o.unwrapNodes(e,{match:e=>{var t;return!a.isEditor(e)&&l.isElement(e)&&"list-item"!==e.type&&"todo-list-item"!==e.type&&(null===(t=e.data)||void 0===t?void 0:t.depth)>=1},split:!0}),o.setNodes(e,n,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor});const s=$.getPlugin.defineElement();o.wrapNodes(e,s,{at:null===(i=e.selection)||void 0===i?void 0:i.anchor})},exports:{markdown:{serialize:(e,t)=>`${t}`},html:{serialize:(e,t)=>{var i;return`<div style="padding-left: ${(null===(i=e.data)||void 0===i?void 0:i.depth)?15*e.data.depth:15}px;">${t}</div>`}}}}),L={NumberedList:y,BulletedList:k,TodoList:$};export{k as BulletedList,y as NumberedList,$ as TodoList,L as default};
|