@yoopta/headings 4.9.1 → 4.9.2-rc.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.
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 o(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 l={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,o=l.buildHeadingOneElements(e,{text:d}),s=n({value:[o],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,o=s.buildHeadingTwoElements(e,{text:d}),l=n({value:[o],type:"HeadingTwo"});a.insertBlock(e,l.type,{at:i,focus:r,blockData:l})},deleteHeadingTwo:(e,t)=>{a.deleteBlock(e,{blockId:t})}},c={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,o=c.buildHeadingThreeElements(e,{text:d}),l=n({value:[o],type:"HeadingThree"});a.insertBlock(e,l.type,{at:i,focus:r,blockData:l})},deleteHeadingThree:(e,t)=>{a.deleteBlock(e,{blockId:t})}},m=t=>{var{extendRender:n}=t,a=o(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:d,children:l}=a,{className:s=""}=r,c=o(r,["className"]);return n?n(a):e("h2",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-two ${s}`},c,d,{children:l}))};m.displayName="HeadingTwo";const h=new i({type:"HeadingTwo",elements:{"heading-two":{render:m,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`}}}),g=t=>{var{extendRender:n}=t,a=o(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:d,children:l}=a,{className:s=""}=r,c=o(r,["className"]);return n?n(a):e("h1",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-one ${s}`},c,d,{children:l}))};g.displayName="HeadingOne";const p=new i({type:"HeadingOne",elements:{"heading-one":{render:g,props:{nodeType:"block"}}},commands:l,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`}}}),u=t=>{var{extendRender:n}=t,a=o(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:d,children:l}=a,{className:s=""}=r,c=o(r,["className"]);return n?n(a):e("h3",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-three ${s}`},c,d,{children:l}))};u.displayName="HeadingThree";const y=new i({type:"HeadingThree",elements:{"heading-three":{render:u,props:{nodeType:"block"}}},commands:c,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`}}});!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 f={HeadingOne:p,HeadingTwo:h,HeadingThree:y};export{p as HeadingOne,l as HeadingOneCommands,y as HeadingThree,c as HeadingThreeCommands,h as HeadingTwo,s as HeadingTwoCommands,f as default};
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};
@@ -1 +1 @@
1
- {"version":3,"file":"HeadingOne.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingOne.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAiB7C,QAAA,MAAM,UAAU,iFAqCd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"HeadingOne.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingOne.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAiB7C,QAAA,MAAM,UAAU,iFA6Dd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"HeadingThree.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingThree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAuB/C,QAAA,MAAM,YAAY,qFAqChB,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"HeadingThree.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingThree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAuB/C,QAAA,MAAM,YAAY,qFA+DhB,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"HeadingTwo.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingTwo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAiB7C,QAAA,MAAM,UAAU,iFAqCd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"HeadingTwo.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingTwo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAiB7C,QAAA,MAAM,UAAU,iFAgEd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/headings",
3
- "version": "4.9.1",
3
+ "version": "4.9.2-rc.1",
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": "35395d0531032215038090494c72bc33d2bcc535"
42
+ "gitHead": "7d156fb39b0c0a2fccaa8658e7333454ac6be286"
43
43
  }