@yoopta/headings 4.9.9 → 6.0.0-beta.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/commands/index.d.ts +2 -2
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/index.d.ts +4 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/heading-one/plugin.d.ts +4 -0
- package/dist/plugin/heading-one/plugin.d.ts.map +1 -0
- package/dist/plugin/heading-one/render.d.ts +3 -0
- package/dist/plugin/heading-one/render.d.ts.map +1 -0
- package/dist/plugin/heading-three/plugin.d.ts +4 -0
- package/dist/plugin/heading-three/plugin.d.ts.map +1 -0
- package/dist/plugin/heading-three/render.d.ts +3 -0
- package/dist/plugin/heading-three/render.d.ts.map +1 -0
- package/dist/plugin/heading-two/plugin.d.ts +4 -0
- package/dist/plugin/heading-two/plugin.d.ts.map +1 -0
- package/dist/plugin/heading-two/render.d.ts +3 -0
- package/dist/plugin/heading-two/render.d.ts.map +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/plugin/HeadingOne.d.ts +0 -5
- package/dist/plugin/HeadingOne.d.ts.map +0 -1
- package/dist/plugin/HeadingThree.d.ts +0 -5
- package/dist/plugin/HeadingThree.d.ts.map +0 -1
- package/dist/plugin/HeadingTwo.d.ts +0 -5
- package/dist/plugin/HeadingTwo.d.ts.map +0 -1
package/dist/commands/index.d.ts
CHANGED
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE1F,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,CACvB,MAAM,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KACrC,iBAAiB,CAAC;IACvB,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,kBAehC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uBAAuB,EAAE,CACvB,MAAM,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KACrC,iBAAiB,CAAC;IACvB,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,kBAehC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,yBAAyB,EAAE,CACzB,MAAM,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KACrC,mBAAmB,CAAC;IACzB,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,oBAelC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
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
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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'>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,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": "
|
|
3
|
+
"version": "6.0.0-beta.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",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"dist/"
|
|
15
15
|
],
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@yoopta/editor": ">=4.
|
|
18
|
-
"react": ">=
|
|
19
|
-
"react-dom": ">=
|
|
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": "
|
|
43
|
+
"gitHead": "ff6a5ae2937a56e0d1820df29fdfd6356171786c"
|
|
43
44
|
}
|
|
@@ -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 +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"}
|