@yoopta/headings 4.8.4 → 4.8.5-rc.10
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
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { YooEditor,
|
|
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:
|
|
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,gBAAg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,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAahC,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,oBAalC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{generateId as t,
|
|
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.
|
|
3
|
+
"version": "4.8.5-rc.10",
|
|
4
4
|
"description": "Headings plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
|
-
"homepage": "https://github.com/Darginec05/Editor
|
|
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.
|
|
27
|
+
"registry": "https://registry.npmjs.org"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/Darginec05/Editor
|
|
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
|
|
40
|
+
"url": "https://github.com/Darginec05/Yoopta-Editor/issues"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "3182313ed88751f9e847925251811e079e467940"
|
|
43
43
|
}
|