@yoopta/headings 4.7.1-rc.3 → 4.7.1-rc.6

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,Blocks as n,buildBlockData as a,YooptaPlugin as i}from"@yoopta/editor";function r(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 d={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:o}=t,s=d.buildHeadingOneElements(e,{text:o});n.insertBlock(e,a({value:[s],type:"HeadingOne"}),{at:i,focus:r})},deleteHeadingOne:(e,t)=>{n.deleteBlock(e,{blockId:t})}},o={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,s=o.buildHeadingTwoElements(e,{text:d});n.insertBlock(e,a({value:[s],type:"HeadingTwo"}),{at:i,focus:r})},deleteHeadingTwo:(e,t)=>{n.deleteBlock(e,{blockId:t})}},s={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=s.buildHeadingThreeElements(e,{text:d});n.insertBlock(e,a({value:[o],type:"HeadingThree"}),{at:i,focus:r})},deleteHeadingThree:(e,t)=>{n.deleteBlock(e,{blockId:t})}},l=t=>{var{extendRender:n}=t,a=r(t,["extendRender"]);const{element:i,HTMLAttributes:d={},attributes:o,children:s}=a,{className:l=""}=d,m=r(d,["className"]);return n?n(a):e("h2",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-two ${l}`},m,o,{children:s}))};l.displayName="HeadingTwo";const m=new i({type:"HeadingTwo",elements:{"heading-two":{render:l,props:{nodeType:"block"}}},commands:o,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: ${a}px; text-align: ${i}">${t}</h2>`}},markdown:{serialize:(e,t)=>`## ${t}\n`}}}),c=t=>{var{extendRender:n}=t,a=r(t,["extendRender"]);const{element:i,HTMLAttributes:d={},attributes:o,children:s}=a,{className:l=""}=d,m=r(d,["className"]);return n?n(a):e("h1",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-one ${l}`},m,o,{children:s}))};c.displayName="HeadingOne";const g=new i({type:"HeadingOne",elements:{"heading-one":{render:c,props:{nodeType:"block"}}},commands:d,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: ${a}px; text-align: ${i}">${t}</h1>`}},markdown:{serialize:(e,t)=>`# ${t}\n`}}}),h=t=>{var{extendRender:n}=t,a=r(t,["extendRender"]);const{element:i,HTMLAttributes:d={},attributes:o,children:s}=a,{className:l=""}=d,m=r(d,["className"]);return n?n(a):e("h3",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-three ${l}`},m,o,{children:s}))};h.displayName="HeadingThree";const p=new i({type:"HeadingThree",elements:{"heading-three":{render:h,props:{nodeType:"block"}}},commands:s,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: ${a}px; text-align: ${i}">${t}</h3>`}},markdown:{serialize:(e,t)=>`### ${t}\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 u={HeadingOne:g,HeadingTwo:m,HeadingThree:p};export{g as HeadingOne,d as HeadingOneCommands,p as HeadingThree,s as HeadingThreeCommands,m as HeadingTwo,o as HeadingTwoCommands,u as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{generateId as t,Blocks as n,buildBlockData as i,YooptaPlugin as a,serializeTextNodesIntoMarkdown as r}from"@yoopta/editor";function d(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}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:a,focus:r,text:d}=t,s=o.buildHeadingOneElements(e,{text:d});n.insertBlock(e,i({value:[s],type:"HeadingOne"}),{at:a,focus:r})},deleteHeadingOne:(e,t)=>{n.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:a,focus:r,text:d}=t,o=s.buildHeadingTwoElements(e,{text:d});n.insertBlock(e,i({value:[o],type:"HeadingTwo"}),{at:a,focus:r})},deleteHeadingTwo:(e,t)=>{n.deleteBlock(e,{blockId:t})}},l={buildHeadingThreeElements:(e,n)=>({id:t(),type:"heading-three",children:[{text:(null==n?void 0:n.text)||""}]}),insertHeadingThree:(e,t={})=>{const{at:a,focus:r,text:d}=t,o=l.buildHeadingThreeElements(e,{text:d});n.insertBlock(e,i({value:[o],type:"HeadingThree"}),{at:a,focus:r})},deleteHeadingThree:(e,t)=>{n.deleteBlock(e,{blockId:t})}},c=t=>{var{extendRender:n}=t,i=d(t,["extendRender"]);const{element:a,HTMLAttributes:r={},attributes:o,children:s}=i,{className:l=""}=r,c=d(r,["className"]);return n?n(i):e("h2",Object.assign({id:a.id,draggable:!1,className:`yoopta-heading-two ${l}`},c,o,{children:s}))};c.displayName="HeadingTwo";const m=new a({type:"HeadingTwo",elements:{"heading-two":{render:c,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:i=0,align:a="left"}=n||{};return`<h2 data-meta-align="${a}" data-meta-depth="${i}" style="margin-left: ${i}px; text-align: ${a}">${t}</h2>`}},markdown:{serialize:(e,t)=>`## ${r(e.children)}\n`}}}),g=t=>{var{extendRender:n}=t,i=d(t,["extendRender"]);const{element:a,HTMLAttributes:r={},attributes:o,children:s}=i,{className:l=""}=r,c=d(r,["className"]);return n?n(i):e("h1",Object.assign({id:a.id,draggable:!1,className:`yoopta-heading-one ${l}`},c,o,{children:s}))};g.displayName="HeadingOne";const h=new a({type:"HeadingOne",elements:{"heading-one":{render:g,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:i=0,align:a="left"}=n||{};return`<h1 data-meta-align="${a}" data-meta-depth="${i}" style="margin-left: ${i}px; text-align: ${a}">${t}</h1>`}},markdown:{serialize:(e,t)=>`# ${r(e.children)}\n`}}}),p=t=>{var{extendRender:n}=t,i=d(t,["extendRender"]);const{element:a,HTMLAttributes:r={},attributes:o,children:s}=i,{className:l=""}=r,c=d(r,["className"]);return n?n(i):e("h3",Object.assign({id:a.id,draggable:!1,className:`yoopta-heading-three ${l}`},c,o,{children:s}))};p.displayName="HeadingThree";const u=new a({type:"HeadingThree",elements:{"heading-three":{render:p,props:{nodeType:"block"}}},commands:l,options:{display:{title:"Heading 3",description:"Small section heading"},shortcuts:["h3","###"]},parsers:{html:{deserialize:{nodeNames:["H3"]},serialize:(e,t,n)=>{const{depth:i=0,align:a="left"}=n||{};return`<h3 data-meta-align="${a}" data-meta-depth="${i}" style="margin-left: ${i}px; text-align: ${a}">${t}</h3>`}},markdown:{serialize:(e,t)=>`### ${r(e.children)}\n`}}});!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.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 y={HeadingOne:h,HeadingTwo:m,HeadingThree:u};export{h as HeadingOne,o as HeadingOneCommands,u as HeadingThree,l as HeadingThreeCommands,m as HeadingTwo,s as HeadingTwoCommands,y as default};
@@ -1 +1 @@
1
- {"version":3,"file":"HeadingOne.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingOne.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA4B,MAAM,gBAAgB,CAAC;AAkBxE,QAAA,MAAM,UAAU;;;;;;EAmCd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"HeadingOne.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingOne.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA4D,MAAM,gBAAgB,CAAC;AAkBxG,QAAA,MAAM,UAAU;;;;;;EAmCd,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,EAA4B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwBxE,QAAA,MAAM,YAAY;;;;;;EAmChB,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"HeadingThree.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingThree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4D,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwBxG,QAAA,MAAM,YAAY;;;;;;EAmChB,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,EAA4B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAkBxE,QAAA,MAAM,UAAU;;;;;;EAmCd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"HeadingTwo.d.ts","sourceRoot":"","sources":["../../src/plugin/HeadingTwo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4D,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAkBxG,QAAA,MAAM,UAAU;;;;;;EAmCd,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.7.1-rc.3",
3
+ "version": "4.7.1-rc.6",
4
4
  "description": "Headings plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -39,5 +39,5 @@
39
39
  "bugs": {
40
40
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
41
41
  },
42
- "gitHead": "a1f011f8eb2319801b2486a86b09d8ce93265e3c"
42
+ "gitHead": "352f23c5d2d9345c213633d79686c3764a043479"
43
43
  }