@yoopta/headings 1.9.0-rc
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/README.md +11 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/ui/HeadingOne.d.ts +3 -0
- package/dist/ui/HeadingThree.d.ts +3 -0
- package/dist/ui/HeadingTwo.d.ts +3 -0
- package/dist/utils/getText.d.ts +2 -0
- package/package.json +36 -0
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HeadingOne } from './ui/HeadingOne';
|
|
2
|
+
import { HeadingTwo } from './ui/HeadingTwo';
|
|
3
|
+
import { HeadingThree } from './ui/HeadingThree';
|
|
4
|
+
import { YoEditor } from '@yoopta/editor';
|
|
5
|
+
import { HeadingOneElement, HeadingThreeElement, HeadingTwoElement } from './types';
|
|
6
|
+
declare module 'slate' {
|
|
7
|
+
interface CustomTypes {
|
|
8
|
+
Editor: YoEditor;
|
|
9
|
+
Element: HeadingOneElement | HeadingTwoElement | HeadingThreeElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare const Headings: {
|
|
13
|
+
HeadingOne: import("@yoopta/editor").YoptaPlugin<import("./types").HeadingOptions, HeadingOneElement>;
|
|
14
|
+
HeadingTwo: import("@yoopta/editor").YoptaPlugin<import("./types").HeadingOptions, HeadingTwoElement>;
|
|
15
|
+
HeadingThree: import("@yoopta/editor").YoptaPlugin<import("./types").HeadingOptions, HeadingThreeElement>;
|
|
16
|
+
};
|
|
17
|
+
export default Headings;
|
|
18
|
+
export { HeadingOne, HeadingTwo, HeadingThree, HeadingOneElement, HeadingTwoElement, HeadingThreeElement };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{createYoptaPlugin as t,generateId as i}from"@yoopta/editor";import{Transforms as n}from"slate";function o(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var r="w88lsSKp";o('.w88lsSKp{color:#292929;font-size:30px;font-weight:600;letter-spacing:0;line-height:39px;margin-bottom:1px;margin-top:30px;padding-bottom:2px;padding-top:2px;position:relative;white-space:pre-wrap;word-break:break-word}.w88lsSKp:hover .bxI8aAgg{opacity:1}.bxI8aAgg{align-items:center;color:#007aff;cursor:pointer;display:inline-flex;opacity:0;padding-left:.5rem}.bxI8aAgg:hover{text-decoration:underline}.bxI8aAgg:before{content:"#"}');const a=({attributes:t,children:i,element:n})=>e("h1",Object.assign({id:n.id,draggable:!1,className:r},t,{children:i}));a.displayName="HeadingOne";const d=t({type:"heading-one",renderer:e=>a,shortcut:["title","h1","heading one","#"],placeholder:"Heading 1",defineElement:()=>({id:i(),type:"heading-one",children:[{text:""}],nodeType:"block"}),createElement:e=>{var t;const i=d.getPlugin.defineElement();n.setNodes(e,i,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor})},exports:{markdown:{serialize:(e,t)=>`# ${t}`},html:{serialize:(e,t)=>`<h1>${t}</h1>`,deserialize:{nodeName:"H1"}}},options:{anchor:"#"}});var l="Lv0jMMCW";o('.Lv0jMMCW{color:#292929;font-size:24px;font-weight:600;line-height:31px;margin-bottom:4px;margin-top:20px;padding-bottom:2px;padding-top:2px;position:relative;white-space:pre-wrap;word-break:break-word}.Lv0jMMCW:hover .Vt-SkjEH{opacity:1}.Vt-SkjEH{color:#007aff;opacity:0;padding-left:.5rem;transition:opacity .2s;user-select:none}.Vt-SkjEH:hover{text-decoration:underline}.Vt-SkjEH:before{content:"#"}');const s=({attributes:t,children:i,element:n})=>e("h2",Object.assign({id:n.id,draggable:!1,className:l},t,{children:i}));s.displayName="HeadingTwo";const p=t({type:"heading-two",renderer:e=>s,shortcut:["h2","subtitle","##"],placeholder:"Heading 2",defineElement:()=>({id:i(),type:"heading-two",children:[{text:""}],nodeType:"block"}),createElement:function(e){var t;const i=p.getPlugin.defineElement();n.setNodes(e,i,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor})},exports:{markdown:{serialize:(e,t)=>`## ${t}`},html:{serialize:(e,t)=>`<h2>${t}</h2>`,deserialize:{nodeName:"H2"}}},options:{anchor:"#"}});var c="K-i6DlWD";o('.K-i6DlWD{color:#292929;font-size:20px;font-weight:600;line-height:26px;margin-bottom:4px;margin-top:16px;padding-bottom:2px;padding-top:2px;position:relative;white-space:pre-wrap;word-break:break-word}.K-i6DlWD:hover .ur9rRlYI{opacity:1}.ur9rRlYI{color:#007aff;opacity:0;padding-left:.5rem;transition:opacity .2s;user-select:none}.ur9rRlYI:hover{text-decoration:underline}.ur9rRlYI:before{content:"#"}');const h=({attributes:t,children:i,element:n})=>e("h3",Object.assign({id:n.id,draggable:!1,className:c},t,{children:i}));h.displayName="HeadingThree";const g=t({type:"heading-three",renderer:e=>h,shortcut:["h3","subsubtitle","###"],placeholder:"Heading 3",defineElement:()=>({id:i(),type:"heading-three",children:[{text:""}],nodeType:"block"}),createElement:function(e){var t;const i=g.getPlugin.defineElement();n.setNodes(e,i,{at:null===(t=e.selection)||void 0===t?void 0:t.anchor})},exports:{markdown:{serialize:(e,t)=>`### ${t}`},html:{serialize:(e,t)=>`<h3>${t}</h3>`,deserialize:{nodeName:["H3","H4","H5","H6"]}}},options:{anchor:"#"}}),m={HeadingOne:d,HeadingTwo:p,HeadingThree:g};export{d as HeadingOne,g as HeadingThree,p as HeadingTwo,m as default};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { YoptaBaseElement } from '@yoopta/editor';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type HeadingOptions = {
|
|
4
|
+
anchor?: ReactNode | null | false;
|
|
5
|
+
};
|
|
6
|
+
export type HeadingOneElement = YoptaBaseElement<'heading-one'>;
|
|
7
|
+
export type HeadingTwoElement = YoptaBaseElement<'heading-two'>;
|
|
8
|
+
export type HeadingThreeElement = YoptaBaseElement<'heading-three'>;
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yoopta/headings",
|
|
3
|
+
"version": "1.9.0-rc",
|
|
4
|
+
"description": "> TODO: description",
|
|
5
|
+
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/Darginec05/Editor-Yopta#readme",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"private": false,
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/"
|
|
15
|
+
],
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@yoopta/editor": "1.9.0-rc",
|
|
18
|
+
"react": ">=17.0.2",
|
|
19
|
+
"react-dom": ">=17.0.2",
|
|
20
|
+
"slate": ">=0.72.3",
|
|
21
|
+
"slate-react": ">=0.72.4"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"registry": "https://registry.yarnpkg.com"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/Darginec05/Editor-Yopta.git"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "node ./__tests__/@yoopta/paragraph.test.js"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/Darginec05/Editor-Yopta/issues"
|
|
35
|
+
}
|
|
36
|
+
}
|