@yoopta/headings 4.8.4 → 4.8.5-rc.4

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.
@@ -1,10 +1,10 @@
1
- import { YooEditor, YooptaBlockPath } from '@yoopta/editor';
1
+ import { YooEditor, YooptaPathIndex } from '@yoopta/editor';
2
2
  import { HeadingOneElement, HeadingThreeElement, HeadingTwoElement } from '../types';
3
3
  export type HeadingElementOptions = {
4
4
  text?: string;
5
5
  };
6
6
  export type HeadingInsertOptions = HeadingElementOptions & {
7
- at: YooptaBlockPath;
7
+ at: YooptaPathIndex;
8
8
  focus?: boolean;
9
9
  };
10
10
  export type HeadingOneCommands = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErF,MAAM,MAAM,qBAAqB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACtD,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG;IAAE,EAAE,EAAE,eAAe,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpG,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uBAAuB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,iBAAiB,CAAC;IAC5G,gBAAgB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;IACvF,gBAAgB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChE,CAAC;A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,eAAO,MAAM,oBAAoB,EAAE,oBAalC,CAAC"}
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 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
+ import{jsx as e}from"react/jsx-runtime";import{generateId as t,buildBlockData as n,Blocks as a,YooptaPlugin as i,serializeTextNodesIntoMarkdown as r}from"@yoopta/editor";function d(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})}},l={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=l.buildHeadingTwoElements(e,{text:d}),s=n({value:[o],type:"HeadingTwo"});a.insertBlock(e,s.type,{at:i,focus:r,blockData:s})},deleteHeadingTwo:(e,t)=>{a.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}),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})}},c=t=>{var{extendRender:n}=t,a=d(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:o,children:l}=a,{className:s=""}=r,c=d(r,["className"]);return n?n(a):e("h2",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-two ${s}`},c,o,{children:l}))};c.displayName="HeadingTwo";const m=new i({type:"HeadingTwo",elements:{"heading-two":{render:c,props:{nodeType:"block"}}},commands:l,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)=>`## ${r(e.children)}\n`}}}),g=t=>{var{extendRender:n}=t,a=d(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:o,children:l}=a,{className:s=""}=r,c=d(r,["className"]);return n?n(a):e("h1",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-one ${s}`},c,o,{children:l}))};g.displayName="HeadingOne";const h=new i({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: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)=>`# ${r(e.children)}\n`}}}),p=t=>{var{extendRender:n}=t,a=d(t,["extendRender"]);const{element:i,HTMLAttributes:r={},attributes:o,children:l}=a,{className:s=""}=r,c=d(r,["className"]);return n?n(a):e("h3",Object.assign({id:i.id,draggable:!1,className:`yoopta-heading-three ${s}`},c,o,{children:l}))};p.displayName="HeadingThree";const u=new i({type:"HeadingThree",elements:{"heading-three":{render:p,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)=>`### ${r(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 y={HeadingOne:h,HeadingTwo:m,HeadingThree:u};export{h as HeadingOne,o as HeadingOneCommands,u as HeadingThree,s as HeadingThreeCommands,m as HeadingTwo,l as HeadingTwoCommands,y as default};
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@yoopta/headings",
3
- "version": "4.8.4",
3
+ "version": "4.8.5-rc.4",
4
4
  "description": "Headings plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
- "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
6
+ "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
7
7
  "license": "MIT",
8
8
  "private": false,
9
9
  "main": "dist/index.js",
@@ -24,11 +24,11 @@
24
24
  "tailwindcss": "^3.3.0"
25
25
  },
26
26
  "publishConfig": {
27
- "registry": "https://registry.yarnpkg.com"
27
+ "registry": "https://registry.npmjs.org"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
31
- "url": "git+https://github.com/Darginec05/Editor-Yoopta.git"
31
+ "url": "git+https://github.com/Darginec05/Yoopta-Editor.git"
32
32
  },
33
33
  "scripts": {
34
34
  "test": "node ./__tests__/@yoopta/paragraph.test.js",
@@ -37,7 +37,7 @@
37
37
  "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production"
38
38
  },
39
39
  "bugs": {
40
- "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
40
+ "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
41
41
  },
42
- "gitHead": "630fbe31ee28664decb3880d96d29d800340a5b9"
42
+ "gitHead": "398f458507c17a5a5b9e21be939172d48244e3e0"
43
43
  }