@yoopta/headings 4.7.0 → 4.7.1-rc.0
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 +28 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/index.d.ts +4 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/HeadingOne.d.ts +1 -3
- package/dist/plugin/HeadingOne.d.ts.map +1 -1
- package/dist/plugin/HeadingThree.d.ts +1 -3
- package/dist/plugin/HeadingThree.d.ts.map +1 -1
- package/dist/plugin/HeadingTwo.d.ts +1 -3
- package/dist/plugin/HeadingTwo.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { YooEditor, YooptaBlockPath } from '@yoopta/editor';
|
|
2
|
+
import { HeadingOneElement, HeadingThreeElement, HeadingTwoElement } from '../types';
|
|
3
|
+
export type HeadingElementOptions = {
|
|
4
|
+
text?: string;
|
|
5
|
+
};
|
|
6
|
+
export type HeadingInsertOptions = HeadingElementOptions & {
|
|
7
|
+
at: YooptaBlockPath;
|
|
8
|
+
focus?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type HeadingOneCommands = {
|
|
11
|
+
buildHeadingOneElements: (editor: YooEditor, options?: Partial<HeadingElementOptions>) => HeadingOneElement;
|
|
12
|
+
insertHeadingOne: (editor: YooEditor, options?: Partial<HeadingInsertOptions>) => void;
|
|
13
|
+
deleteHeadingOne: (editor: YooEditor, blockId: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const HeadingOneCommands: HeadingOneCommands;
|
|
16
|
+
export type HeadingTwoCommands = {
|
|
17
|
+
buildHeadingTwoElements: (editor: YooEditor, options?: Partial<HeadingElementOptions>) => HeadingTwoElement;
|
|
18
|
+
insertHeadingTwo: (editor: YooEditor, options?: Partial<HeadingInsertOptions>) => void;
|
|
19
|
+
deleteHeadingTwo: (editor: YooEditor, blockId: string) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const HeadingTwoCommands: HeadingTwoCommands;
|
|
22
|
+
export type HeadingThreeCommands = {
|
|
23
|
+
buildHeadingThreeElements: (editor: YooEditor, options?: Partial<HeadingElementOptions>) => HeadingThreeElement;
|
|
24
|
+
insertHeadingThree: (editor: YooEditor, options?: Partial<HeadingInsertOptions>) => void;
|
|
25
|
+
deleteHeadingThree: (editor: YooEditor, blockId: string) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare const HeadingThreeCommands: HeadingThreeCommands;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,kBAYhC,CAAC;AAEF,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,kBAYhC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,yBAAyB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,mBAAmB,CAAC;IAChH,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,oBAYlC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,27 +9,21 @@ declare module 'slate' {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
declare const Headings: {
|
|
12
|
-
HeadingOne: import("@yoopta/editor").YooptaPlugin<"
|
|
13
|
-
nodeType: "block";
|
|
14
|
-
}, {
|
|
12
|
+
HeadingOne: import("@yoopta/editor").YooptaPlugin<Record<string, import("@yoopta/editor").SlateElement<string, any>>, {
|
|
15
13
|
display: {
|
|
16
14
|
title: string;
|
|
17
15
|
description: string;
|
|
18
16
|
};
|
|
19
17
|
shortcuts: string[];
|
|
20
18
|
}>;
|
|
21
|
-
HeadingTwo: import("@yoopta/editor").YooptaPlugin<"
|
|
22
|
-
nodeType: "block";
|
|
23
|
-
}, {
|
|
19
|
+
HeadingTwo: import("@yoopta/editor").YooptaPlugin<Record<string, import("@yoopta/editor").SlateElement<string, any>>, {
|
|
24
20
|
display: {
|
|
25
21
|
title: string;
|
|
26
22
|
description: string;
|
|
27
23
|
};
|
|
28
24
|
shortcuts: string[];
|
|
29
25
|
}>;
|
|
30
|
-
HeadingThree: import("@yoopta/editor").YooptaPlugin<"
|
|
31
|
-
nodeType: "block";
|
|
32
|
-
}, {
|
|
26
|
+
HeadingThree: import("@yoopta/editor").YooptaPlugin<Record<string, import("@yoopta/editor").SlateElement<string, any>>, {
|
|
33
27
|
display: {
|
|
34
28
|
title: string;
|
|
35
29
|
description: string;
|
|
@@ -37,6 +31,7 @@ declare const Headings: {
|
|
|
37
31
|
shortcuts: string[];
|
|
38
32
|
}>;
|
|
39
33
|
};
|
|
34
|
+
export { HeadingOneCommands, HeadingTwoCommands, HeadingThreeCommands } from './commands';
|
|
40
35
|
export default Headings;
|
|
41
36
|
export { HeadingOne, HeadingTwo, HeadingThree, HeadingOneElement, HeadingTwoElement, HeadingThreeElement };
|
|
42
37
|
//# 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,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
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{YooptaPlugin as
|
|
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,7 +1,5 @@
|
|
|
1
1
|
import { YooptaPlugin } from '@yoopta/editor';
|
|
2
|
-
declare const HeadingOne: YooptaPlugin<"
|
|
3
|
-
nodeType: "block";
|
|
4
|
-
}, {
|
|
2
|
+
declare const HeadingOne: YooptaPlugin<Record<string, import("@yoopta/editor").SlateElement<string, any>>, {
|
|
5
3
|
display: {
|
|
6
4
|
title: string;
|
|
7
5
|
description: string;
|
|
@@ -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;
|
|
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,7 +1,5 @@
|
|
|
1
1
|
import { YooptaPlugin } from '@yoopta/editor';
|
|
2
|
-
declare const HeadingThree: YooptaPlugin<"
|
|
3
|
-
nodeType: "block";
|
|
4
|
-
}, {
|
|
2
|
+
declare const HeadingThree: YooptaPlugin<Record<string, import("@yoopta/editor").SlateElement<string, any>>, {
|
|
5
3
|
display: {
|
|
6
4
|
title: string;
|
|
7
5
|
description: string;
|
|
@@ -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;
|
|
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,7 +1,5 @@
|
|
|
1
1
|
import { YooptaPlugin } from '@yoopta/editor';
|
|
2
|
-
declare const HeadingTwo: YooptaPlugin<"
|
|
3
|
-
nodeType: "block";
|
|
4
|
-
}, {
|
|
2
|
+
declare const HeadingTwo: YooptaPlugin<Record<string, import("@yoopta/editor").SlateElement<string, any>>, {
|
|
5
3
|
display: {
|
|
6
4
|
title: string;
|
|
7
5
|
description: string;
|
|
@@ -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;
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/headings",
|
|
3
|
-
"version": "4.7.0",
|
|
3
|
+
"version": "4.7.1-rc.0",
|
|
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": "
|
|
42
|
+
"gitHead": "63bfe2afb5f9d7b3a8c49584d0ac8bdc5b2dcf1f"
|
|
43
43
|
}
|