@yoopta/paragraph 4.9.0 → 4.9.1

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{generateId as e,Blocks as t,YooptaPlugin as r,serializeTextNodes as a,serializeTextNodesIntoMarkdown as n}from"@yoopta/editor";import{jsx as o}from"react/jsx-runtime";const i={buildParagraphElements:(t,r={})=>({id:e(),type:"paragraph",children:[{text:(null==r?void 0:r.text)||""}]}),insertParagraph:(e,r={})=>{const{at:a,focus:n,text:o}=r,p=i.buildParagraphElements(e,{text:o}),l=t.buildBlockData({value:[p],type:"Paragraph"});t.insertBlock(e,l.type,{at:a,focus:n,blockData:l})},deleteParagraph:(e,r)=>{t.deleteBlock(e,{blockId:r})}};function p(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}"function"==typeof SuppressedError&&SuppressedError;const l=new r({type:"Paragraph",elements:{paragraph:{render:e=>{var{extendRender:t}=e,r=p(e,["extendRender"]);const a=r.HTMLAttributes||{},{className:n=""}=a,i=p(a,["className"]);return t?t(r):o("p",Object.assign({className:`yoopta-paragraph ${n}`},i,r.attributes,{children:r.children}))}}},options:{display:{title:"Text",description:"Start writing plain text."},shortcuts:["p","text"]},parsers:{html:{deserialize:{nodeNames:["P"]},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<p data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${o}px; text-align: ${n}">${a(e.children)}</p>`}},markdown:{serialize:(e,t)=>`${n(e.children)}\n`}},commands:i});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoopta-paragraph{font-size:16px;line-height:1.75rem;margin:.5rem 0 0}");export{i as ParagraphCommands,l as default};
1
+ import{generateId as e,Blocks as t,YooptaPlugin as r,serializeTextNodes as a,serializeTextNodesIntoMarkdown as n}from"@yoopta/editor";import{jsx as o}from"react/jsx-runtime";const i={buildParagraphElements:(t,r={})=>({id:e(),type:"paragraph",children:[{text:(null==r?void 0:r.text)||""}]}),insertParagraph:(e,r={})=>{const{at:a,focus:n,text:o}=r,p=i.buildParagraphElements(e,{text:o}),l=t.buildBlockData({value:[p],type:"Paragraph"});t.insertBlock(e,l.type,{at:a,focus:n,blockData:l})},deleteParagraph:(e,r)=>{t.deleteBlock(e,{blockId:r})}};function p(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}"function"==typeof SuppressedError&&SuppressedError;const l=new r({type:"Paragraph",elements:{paragraph:{render:e=>{var{extendRender:t}=e,r=p(e,["extendRender"]);const a=r.HTMLAttributes||{},{className:n=""}=a,i=p(a,["className"]);return t?t(r):o("p",Object.assign({className:`yoopta-paragraph ${n}`},i,r.attributes,{children:r.children}))}}},options:{display:{title:"Text",description:"Start writing plain text."},shortcuts:["p","text"]},parsers:{html:{deserialize:{nodeNames:["P"]},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<p data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}">${a(e.children)}</p>`}},markdown:{serialize:(e,t)=>`${n(e.children)}\n`}},commands:i});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoopta-paragraph{font-size:16px;line-height:1.75rem;margin:.5rem 0 0}");export{i as ParagraphCommands,l as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/paragraph",
3
- "version": "4.9.0",
3
+ "version": "4.9.1",
4
4
  "description": "Paragraph plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
@@ -34,5 +34,5 @@
34
34
  "bugs": {
35
35
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
36
36
  },
37
- "gitHead": "13946b208848f17dce4653e70a4cec89413c0c0a"
37
+ "gitHead": "35395d0531032215038090494c72bc33d2bcc535"
38
38
  }