@yoopta/headings 4.9.8 → 4.9.9
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 +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{generateId as t,buildBlockData as n,Blocks as a,YooptaPlugin as i,serializeTextNodes as r,serializeTextNodesIntoMarkdown as d}from"@yoopta/editor";function l(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]])}return n}"function"==typeof SuppressedError&&SuppressedError;const o={buildHeadingOneElements:(e,n)=>({id:t(),type:"heading-one",children:[{text:(null==n?void 0:n.text)||""}]}),insertHeadingOne:(e,t={})=>{const{at:i,focus:r,text:d}=t,l=o.buildHeadingOneElements(e,{text:d}),s=n({value:[l],type:"HeadingOne"});a.insertBlock(e,s.type,{at:i,focus:r,blockData:s})},deleteHeadingOne:(e,t)=>{a.deleteBlock(e,{blockId:t})}},s={buildHeadingTwoElements:(e,n)=>({id:t(),type:"heading-two",children:[{text:(null==n?void 0:n.text)||""}]}),insertHeadingTwo:(e,t={})=>{const{at:i,focus:r,text:d}=t,l=s.buildHeadingTwoElements(e,{text:d}),o=n({value:[l],type:"HeadingTwo"});a.insertBlock(e,o.type,{at:i,focus:r,blockData:o})},deleteHeadingTwo:(e,t)=>{a.deleteBlock(e,{blockId:t})}},m={buildHeadingThreeElements:(e,n)=>({id:t(),type:"heading-three",children:[{text:(null==n?void 0:n.text)||""}]}),insertHeadingThree:(e,t={})=>{const{at:i,focus:r,text:d}=t,l=m.buildHeadingThreeElements(e,{text:d}),o=n({value:[l],type:"HeadingThree"});a.insertBlock(e,o.type,{at:i,focus:r,blockData:o})},deleteHeadingThree:(e,t)=>{a.deleteBlock(e,{blockId:t})}},g=t=>{var{extendRender:n}=t,a=l(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:d,children:o}=a,{className:s=""}=r,m=l(r,["className"]);return n?n(a):e("h2",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-two ${s}`},m,d,{children:o}))};g.displayName="HeadingTwo";const h=new i({type:"HeadingTwo",elements:{"heading-two":{render:g,props:{nodeType:"block"}}},commands:s,options:{display:{title:"Heading 2",description:"Medium section heading"},shortcuts:["h2","##"]},parsers:{html:{deserialize:{nodeNames:["H2"]},serialize:(e,t,n)=>{const{depth:a=0,align:i="left"}=n||{};return`<h2 data-meta-align="${i}" data-meta-depth="${a}" style="margin-left: ${20*a}px; text-align: ${i}">${r(e.children)}</h2>`}},markdown:{serialize:(e,t)=>`## ${d(e.children)}\n`},email:{serialize:(e,t,n)=>{const{depth:a=0,align:i="left"}=n||{};return`<table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n ${`<h2 data-meta-align="${i}" data-meta-depth="${a}" style="\n font-size: 1.875rem;\n font-weight: 600;\n line-height: 2.25rem;\n letter-spacing: -.025em;\n margin-bottom: .5rem;\n scroll-margin: 5rem;\n margin-top: 1rem;\n margin-left: ${20*a}px; text-align: ${i}">\n ${t}\n </h2>`}\n </td>\n </tr>\n </tbody>\n </table>`}}}}),c=t=>{var{extendRender:n}=t,a=l(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:d,children:o}=a,{className:s=""}=r,m=l(r,["className"]);return n?n(a):e("h1",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-one ${s}`},m,d,{children:o}))};c.displayName="HeadingOne";const p=new i({type:"HeadingOne",elements:{"heading-one":{render:c,props:{nodeType:"block"}}},commands:o,options:{display:{title:"Heading 1",description:"Big section heading"},shortcuts:["h1","#"
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{generateId as t,buildBlockData as n,Blocks as a,YooptaPlugin as i,serializeTextNodes as r,serializeTextNodesIntoMarkdown as d}from"@yoopta/editor";function l(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]])}return n}"function"==typeof SuppressedError&&SuppressedError;const o={buildHeadingOneElements:(e,n)=>({id:t(),type:"heading-one",children:[{text:(null==n?void 0:n.text)||""}]}),insertHeadingOne:(e,t={})=>{const{at:i,focus:r,text:d}=t,l=o.buildHeadingOneElements(e,{text:d}),s=n({value:[l],type:"HeadingOne"});a.insertBlock(e,s.type,{at:i,focus:r,blockData:s})},deleteHeadingOne:(e,t)=>{a.deleteBlock(e,{blockId:t})}},s={buildHeadingTwoElements:(e,n)=>({id:t(),type:"heading-two",children:[{text:(null==n?void 0:n.text)||""}]}),insertHeadingTwo:(e,t={})=>{const{at:i,focus:r,text:d}=t,l=s.buildHeadingTwoElements(e,{text:d}),o=n({value:[l],type:"HeadingTwo"});a.insertBlock(e,o.type,{at:i,focus:r,blockData:o})},deleteHeadingTwo:(e,t)=>{a.deleteBlock(e,{blockId:t})}},m={buildHeadingThreeElements:(e,n)=>({id:t(),type:"heading-three",children:[{text:(null==n?void 0:n.text)||""}]}),insertHeadingThree:(e,t={})=>{const{at:i,focus:r,text:d}=t,l=m.buildHeadingThreeElements(e,{text:d}),o=n({value:[l],type:"HeadingThree"});a.insertBlock(e,o.type,{at:i,focus:r,blockData:o})},deleteHeadingThree:(e,t)=>{a.deleteBlock(e,{blockId:t})}},g=t=>{var{extendRender:n}=t,a=l(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:d,children:o}=a,{className:s=""}=r,m=l(r,["className"]);return n?n(a):e("h2",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-two ${s}`},m,d,{children:o}))};g.displayName="HeadingTwo";const h=new i({type:"HeadingTwo",elements:{"heading-two":{render:g,props:{nodeType:"block"}}},commands:s,options:{display:{title:"Heading 2",description:"Medium section heading"},shortcuts:["h2","##"]},parsers:{html:{deserialize:{nodeNames:["H2"]},serialize:(e,t,n)=>{const{depth:a=0,align:i="left"}=n||{};return`<h2 data-meta-align="${i}" data-meta-depth="${a}" style="margin-left: ${20*a}px; text-align: ${i}">${r(e.children)}</h2>`}},markdown:{serialize:(e,t)=>`## ${d(e.children)}\n`},email:{serialize:(e,t,n)=>{const{depth:a=0,align:i="left"}=n||{};return`<table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n ${`<h2 data-meta-align="${i}" data-meta-depth="${a}" style="\n font-size: 1.875rem;\n font-weight: 600;\n line-height: 2.25rem;\n letter-spacing: -.025em;\n margin-bottom: .5rem;\n scroll-margin: 5rem;\n margin-top: 1rem;\n margin-left: ${20*a}px; text-align: ${i}">\n ${t}\n </h2>`}\n </td>\n </tr>\n </tbody>\n </table>`}}}}),c=t=>{var{extendRender:n}=t,a=l(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:d,children:o}=a,{className:s=""}=r,m=l(r,["className"]);return n?n(a):e("h1",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-one ${s}`},m,d,{children:o}))};c.displayName="HeadingOne";const p=new i({type:"HeadingOne",elements:{"heading-one":{render:c,props:{nodeType:"block"}}},commands:o,options:{display:{title:"Heading 1",description:"Big section heading"},shortcuts:["h1","#"]},parsers:{html:{deserialize:{nodeNames:["H1"]},serialize:(e,t,n)=>{const{depth:a=0,align:i="left"}=n||{};return`<h1 data-meta-align="${i}" data-meta-depth="${a}" style="margin-left: ${20*a}px; text-align: ${i}">${r(e.children)}</h1>`}},markdown:{serialize:(e,t)=>`# ${d(e.children)}\n`},email:{serialize:(e,t,n)=>{const{depth:a=0,align:i="left"}=n||{};return`<table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n ${`<h1 data-meta-align="${i}" data-meta-depth="${a}" style="\n margin-bottom: .5rem;\n scroll-margin: 5rem; font-size: 2.25rem;\n font-weight: 700;\n line-height: 2.5rem;\n margin-top: 1.5rem; margin-left: ${20*a}px; text-align: ${i}">\n ${t}\n </h1>`}\n </td>\n </tr>\n </tbody>\n </table>`}}}}),y=t=>{var{extendRender:n}=t,a=l(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:d,children:o}=a,{className:s=""}=r,m=l(r,["className"]);return n?n(a):e("h3",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-three ${s}`},m,d,{children:o}))};y.displayName="HeadingThree";const u=new i({type:"HeadingThree",elements:{"heading-three":{render:y,props:{nodeType:"block"}}},commands:m,options:{display:{title:"Heading 3",description:"Small section heading"},shortcuts:["h3","###"]},parsers:{html:{deserialize:{nodeNames:["H3"]},serialize:(e,t,n)=>{const{depth:a=0,align:i="left"}=n||{};return`<h3 data-meta-align="${i}" data-meta-depth="${a}" style="margin-left: ${20*a}px; text-align: ${i}">${r(e.children)}</h3>`}},markdown:{serialize:(e,t)=>`### ${d(e.children)}\n`},email:{serialize:(e,t,n)=>{const{depth:a=0,align:i="left"}=n||{};return`<table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <h3 data-meta-align="${i}" data-meta-depth="${a}" style="margin-left: ${20*a}px; text-align: ${i}; \n font-size: 1.5rem;\n font-weight: 600;\n letter-spacing: -.025em;\n line-height: 2rem;\n margin-bottom: .25rem;\n margin-top: .5rem;\n scroll-margin: 5rem;">\n ${r(e.children)}\n </h3>\n </td>\n </tr>\n </tbody>\n </table>`}}}});!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".yoopta-heading-one{font-size:2.25rem;font-weight:700;line-height:2.5rem;margin-top:1.5rem}.yoopta-heading-one,.yoopta-heading-two{letter-spacing:-.025em;margin-bottom:.5rem;scroll-margin:5rem}.yoopta-heading-two{font-size:1.875rem;font-weight:600;line-height:2.25rem;margin-top:1rem}.yoopta-heading-three{font-size:1.5rem;font-weight:600;letter-spacing:-.025em;line-height:2rem;margin-bottom:.25rem;margin-top:.5rem;scroll-margin:5rem}");const b={HeadingOne:p,HeadingTwo:h,HeadingThree:u};export{p as HeadingOne,o as HeadingOneCommands,u as HeadingThree,m as HeadingThreeCommands,h as HeadingTwo,s as HeadingTwoCommands,b as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/headings",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.9",
|
|
4
4
|
"description": "Headings plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"bugs": {
|
|
40
40
|
"url": "https://github.com/Darginec05/Yoopta-Editor/issues"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "e8260945d74e2b26e8c66a3ddf4da8ceb45bc74d"
|
|
43
43
|
}
|