@yoopta/headings 4.9.9 → 6.0.0-beta.2

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,5 +1,5 @@
1
- import { YooEditor, YooptaPathIndex } from '@yoopta/editor';
2
- import { HeadingOneElement, HeadingThreeElement, HeadingTwoElement } from '../types';
1
+ import type { YooEditor, YooptaPathIndex } from '@yoopta/editor';
2
+ import type { HeadingOneElement, HeadingThreeElement, HeadingTwoElement } from '../types';
3
3
  export type HeadingElementOptions = {
4
4
  text?: string;
5
5
  };
@@ -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;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAahC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAA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-1,13 +1,7 @@
1
- import { HeadingTwo } from './plugin/HeadingTwo';
2
- import { HeadingOne } from './plugin/HeadingOne';
3
- import { HeadingThree } from './plugin/HeadingThree';
1
+ import { HeadingOne } from './plugin/heading-one/plugin';
2
+ import { HeadingThree } from './plugin/heading-three/plugin';
3
+ import { HeadingTwo } from './plugin/heading-two/plugin';
4
4
  import { HeadingOneElement, HeadingThreeElement, HeadingTwoElement } from './types';
5
- import './styles.css';
6
- declare module 'slate' {
7
- interface CustomTypes {
8
- Element: HeadingOneElement | HeadingTwoElement | HeadingThreeElement;
9
- }
10
- }
11
5
  declare const Headings: {
12
6
  HeadingOne: import("@yoopta/editor").YooptaPlugin<Record<"heading-one", HeadingOneElement>, Record<string, unknown>>;
13
7
  HeadingTwo: import("@yoopta/editor").YooptaPlugin<Record<"heading-two", HeadingTwoElement>, Record<string, unknown>>;
@@ -15,5 +9,5 @@ declare const Headings: {
15
9
  };
16
10
  export { HeadingOneCommands, HeadingTwoCommands, HeadingThreeCommands } from './commands';
17
11
  export default Headings;
18
- export { HeadingOne, HeadingTwo, HeadingThree, HeadingOneElement, HeadingTwoElement, HeadingThreeElement };
12
+ export { HeadingOne, HeadingTwo, HeadingThree, HeadingOneElement, HeadingTwoElement, HeadingThreeElement, };
19
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;KACtE;CACF;AAED,QAAA,MAAM,QAAQ;;;;CAIb,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE1F,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEpF,QAAA,MAAM,QAAQ;;;;CAIb,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE1F,eAAe,QAAQ,CAAC;AACxB,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GACpB,CAAC"}
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","#"]},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
+ import{jsx as e}from"react/jsx-runtime";import{generateId as t,buildBlockData as n,Blocks as i,YooptaPlugin as a,serializeTextNodes as l,serializeTextNodesIntoMarkdown as d}from"@yoopta/editor";const r={buildHeadingOneElements:(e,n)=>({id:t(),type:"heading-one",children:[{text:(null==n?void 0:n.text)||""}]}),insertHeadingOne:(e,t={})=>{const{at:a,focus:l,text:d}=t,o=r.buildHeadingOneElements(e,{text:d}),s=n({value:[o],type:"HeadingOne"});i.insertBlock(e,s.type,{at:a,focus:l,blockData:s})},deleteHeadingOne:(e,t)=>{i.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:a,focus:l,text:d}=t,r=o.buildHeadingTwoElements(e,{text:d}),s=n({value:[r],type:"HeadingTwo"});i.insertBlock(e,s.type,{at:a,focus:l,blockData:s})},deleteHeadingTwo:(e,t)=>{i.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:a,focus:l,text:d}=t,r=s.buildHeadingThreeElements(e,{text:d}),o=n({value:[r],type:"HeadingThree"});i.insertBlock(e,o.type,{at:a,focus:l,blockData:o})},deleteHeadingThree:(e,t)=>{i.deleteBlock(e,{blockId:t})}},h=e("heading-one",{render:t=>{const{element:n,attributes:i,children:a}=t;return e("h1",Object.assign({id:n.id,draggable:!1},i,{children:a}))},nodeType:"block"}),g=new a({type:"HeadingOne",elements:h,commands:r,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: ${20*i}px; text-align: ${a}">${l(e.children)}</h1>`}},markdown:{serialize:e=>`# ${d(e.children)}\n`},email:{serialize:(e,t,n)=>{const{depth:i=0,align:a="left"}=n||{};return`<table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n ${`<h1 data-meta-align="${a}" data-meta-depth="${i}" 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*i}px; text-align: ${a}">\n ${t}\n </h1>`}\n </td>\n </tr>\n </tbody>\n </table>`}}}}),m=new a({type:"HeadingThree",elements:e("heading-three",{render:t=>{const{element:n,attributes:i,children:a}=t;return e("h3",Object.assign({id:n.id,draggable:!1},i,{children:a}))},props:{withAnchor:!1},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:i=0,align:a="left"}=n||{};return`<h3 data-meta-align="${a}" data-meta-depth="${i}" style="margin-left: ${20*i}px; text-align: ${a}">${l(e.children)}</h3>`}},markdown:{serialize:(e,t)=>`### ${d(e.children)}\n`},email:{serialize:(e,t,n)=>{const{depth:i=0,align:a="left"}=n||{};return`<table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <h3 data-meta-align="${a}" data-meta-depth="${i}" style="margin-left: ${20*i}px; text-align: ${a}; \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 ${l(e.children)}\n </h3>\n </td>\n </tr>\n </tbody>\n </table>`}}}}),c=new a({type:"HeadingTwo",elements:{"heading-two":{render:t=>{const{element:n,attributes:i,children:a}=t;return e("h2",Object.assign({id:n.id,draggable:!1},i,{children:a}))},props:{withAnchor:!1}}},commands:o,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: ${20*i}px; text-align: ${a}">${l(e.children)}</h2>`}},markdown:{serialize:(e,t)=>`## ${d(e.children)}\n`},email:{serialize:(e,t,n)=>{const{depth:i=0,align:a="left"}=n||{};return`<table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n ${`<h2 data-meta-align="${a}" data-meta-depth="${i}" 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*i}px; text-align: ${a}">\n ${t}\n </h2>`}\n </td>\n </tr>\n </tbody>\n </table>`}}}}),p={HeadingOne:g,HeadingTwo:c,HeadingThree:m};export{g as HeadingOne,r as HeadingOneCommands,m as HeadingThree,s as HeadingThreeCommands,c as HeadingTwo,o as HeadingTwoCommands,p as default};
@@ -0,0 +1,4 @@
1
+ import { YooptaPlugin } from '@yoopta/editor';
2
+ import type { HeadingOneElement } from '../../types';
3
+ export declare const HeadingOne: YooptaPlugin<Record<"heading-one", HeadingOneElement>, Record<string, unknown>>;
4
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin/heading-one/plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsD,MAAM,gBAAgB,CAAC;AAIlG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIrD,eAAO,MAAM,UAAU,iFAoDrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { PluginElementRenderProps } from '@yoopta/editor';
2
+ export declare const HeadingOneRender: (props: PluginElementRenderProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/plugin/heading-one/render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,eAAO,MAAM,gBAAgB,UAAW,wBAAwB,4CAQ/D,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { YooptaPlugin } from '@yoopta/editor';
2
+ import type { HeadingThreeElement } from '../../types';
3
+ export declare const HeadingThree: YooptaPlugin<Record<"heading-three", HeadingThreeElement>, Record<string, unknown>>;
4
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin/heading-three/plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsD,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAOvD,eAAO,MAAM,YAAY,qFAsDvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { PluginElementRenderProps } from '@yoopta/editor';
2
+ export declare const HeadingThreeRender: (props: PluginElementRenderProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/plugin/heading-three/render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,eAAO,MAAM,kBAAkB,UAAW,wBAAwB,4CAQjE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { YooptaPlugin } from '@yoopta/editor';
2
+ import type { HeadingTwoElement } from '../../types';
3
+ export declare const HeadingTwo: YooptaPlugin<Record<"heading-two", HeadingTwoElement>, Record<string, unknown>>;
4
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin/heading-two/plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsD,MAAM,gBAAgB,CAAC;AAIlG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMrD,eAAO,MAAM,UAAU,iFA4DrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { PluginElementRenderProps } from '@yoopta/editor';
2
+ export declare const HeadingTwoRender: (props: PluginElementRenderProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/plugin/heading-two/render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,eAAO,MAAM,gBAAgB,UAAW,wBAAwB,4CAQ/D,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SlateElement } from '@yoopta/editor';
1
+ import type { SlateElement } from '@yoopta/editor';
2
2
  export type HeadingOneElement = SlateElement<'heading-one'>;
3
3
  export type HeadingTwoElement = SlateElement<'heading-two'>;
4
4
  export type HeadingThreeElement = SlateElement<'heading-three'>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC5D,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC5D,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/headings",
3
- "version": "4.9.9",
3
+ "version": "6.0.0-beta.2",
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",
@@ -14,9 +14,9 @@
14
14
  "dist/"
15
15
  ],
16
16
  "peerDependencies": {
17
- "@yoopta/editor": ">=4.0.0",
18
- "react": ">=17.0.2",
19
- "react-dom": ">=17.0.2"
17
+ "@yoopta/editor": ">=4.9.9",
18
+ "react": ">=18.2.0",
19
+ "react-dom": ">=18.2.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "autoprefixer": "^10.0.1",
@@ -24,7 +24,8 @@
24
24
  "tailwindcss": "^3.3.0"
25
25
  },
26
26
  "publishConfig": {
27
- "registry": "https://registry.npmjs.org"
27
+ "registry": "https://registry.npmjs.org",
28
+ "access": "public"
28
29
  },
29
30
  "repository": {
30
31
  "type": "git",
@@ -39,5 +40,5 @@
39
40
  "bugs": {
40
41
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
41
42
  },
42
- "gitHead": "e8260945d74e2b26e8c66a3ddf4da8ceb45bc74d"
43
+ "gitHead": "58d2c0e3b3b615017e0adb353b80dc493a571186"
43
44
  }
@@ -1,5 +0,0 @@
1
- import { YooptaPlugin } from '@yoopta/editor';
2
- import { HeadingOneElement } from '../types';
3
- declare const HeadingOne: YooptaPlugin<Record<"heading-one", HeadingOneElement>, Record<string, unknown>>;
4
- export { HeadingOne };
5
- //# sourceMappingURL=HeadingOne.d.ts.map
@@ -1 +0,0 @@
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,5 +0,0 @@
1
- import { YooptaPlugin } from '@yoopta/editor';
2
- import { HeadingThreeElement } from '../types';
3
- declare const HeadingThree: YooptaPlugin<Record<"heading-three", HeadingThreeElement>, Record<string, unknown>>;
4
- export { HeadingThree };
5
- //# sourceMappingURL=HeadingThree.d.ts.map
@@ -1 +0,0 @@
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,5 +0,0 @@
1
- import { YooptaPlugin } from '@yoopta/editor';
2
- import { HeadingTwoElement } from '../types';
3
- declare const HeadingTwo: YooptaPlugin<Record<"heading-two", HeadingTwoElement>, Record<string, unknown>>;
4
- export { HeadingTwo };
5
- //# sourceMappingURL=HeadingTwo.d.ts.map
@@ -1 +0,0 @@
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"}