@yoopta/paragraph 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.
@@ -0,0 +1,17 @@
1
+ import { YooEditor, YooptaBlockPath } from '@yoopta/editor';
2
+ import { ParagraphElement } from '../types';
3
+ type ParagraphElementOptions = {
4
+ text?: string;
5
+ };
6
+ type ParagraphInsertOptions = ParagraphElementOptions & {
7
+ at?: YooptaBlockPath;
8
+ focus?: boolean;
9
+ };
10
+ export type ParagraphCommands = {
11
+ buildParagraphElements: (editor: YooEditor, options?: Partial<ParagraphElementOptions>) => ParagraphElement;
12
+ insertParagraph: (editor: YooEditor, options?: Partial<ParagraphInsertOptions>) => void;
13
+ deleteParagraph: (editor: YooEditor, blockId: string) => void;
14
+ };
15
+ export declare const ParagraphCommands: ParagraphCommands;
16
+ export {};
17
+ //# 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,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,KAAK,uBAAuB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,sBAAsB,GAAG,uBAAuB,GAAG;IACtD,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,sBAAsB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,KAAK,gBAAgB,CAAC;IAC5G,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAC;IACxF,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,iBAa/B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ParagraphElement } from './types';
2
2
  import { Paragraph } from './plugin';
3
+ export { ParagraphCommands } from './commands';
3
4
  import './styles.css';
4
5
  declare module 'slate' {
5
6
  interface CustomTypes {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,gBAAgB,CAAC;KAC3B;CACF;AAED,eAAe,SAAS,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,gBAAgB,CAAC;KAC3B;CACF;AAED,eAAe,SAAS,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{YooptaPlugin as e}from"@yoopta/editor";import{jsx as t}from"react/jsx-runtime";function r(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}"function"==typeof SuppressedError&&SuppressedError;const a=new e({type:"Paragraph",elements:{paragraph:{render:e=>{var{extendRender:a}=e,n=r(e,["extendRender"]);const o=n.HTMLAttributes||{},{className:i=""}=o,p=r(o,["className"]);return a?a(n):t("p",Object.assign({className:`yoopta-paragraph ${i}`},p,n.attributes,{children:n.children}))}}},options:{display:{title:"Text",description:"Start writing plain text."},shortcuts:["p","text"]},parsers:{html:{deserialize:{nodeNames:["P"]},serialize:(e,t,r)=>{const{align:a="left",depth:n=0}=r||{};return`<p data-meta-align="${a}" data-meta-depth="${n}" style="margin-left: ${n}px; text-align: ${a}">${t}</p>`}},markdown:{serialize:(e,t)=>`${t}\n`}}});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoopta-paragraph{font-size:16px;line-height:1.75rem;margin:.5rem 0 0}");export{a as default};
1
+ import{generateId as e,Blocks as t,buildBlockData as r,YooptaPlugin as a,serializeTextNodes as n}from"@yoopta/editor";import{jsx as o}from"react/jsx-runtime";const i={buildParagraphElements:(t,r={})=>({id:e(),type:"paragraph",children:[{text:(null==r?void 0:r.text)||""}]}),insertParagraph:(e,a={})=>{const{at:n,focus:o,text:p}=a,s=i.buildParagraphElements(e,{text:p});t.insertBlock(e,r({value:[s],type:"Paragraph"}),{at:n,focus:o})},deleteParagraph:(e,r)=>{t.deleteBlock(e,{blockId:r})}};function p(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}"function"==typeof SuppressedError&&SuppressedError;const s=new a({type:"Paragraph",elements:{paragraph:{render:e=>{var{extendRender:t}=e,r=p(e,["extendRender"]);const a=r.HTMLAttributes||{},{className:n=""}=a,i=p(a,["className"]);return t?t(r):o("p",Object.assign({className:`yoopta-paragraph ${n}`},i,r.attributes,{children:r.children}))}}},options:{display:{title:"Text",description:"Start writing plain text."},shortcuts:["p","text"]},parsers:{html:{deserialize:{nodeNames:["P"]},serialize:(e,t,r)=>{const{align:a="left",depth:o=0}=r||{};return`<p data-meta-align="${a}" data-meta-depth="${o}" style="margin-left: ${o}px; text-align: ${a}">${n(e.children)}</p>`}},markdown:{serialize:(e,t)=>`${t}\n`}},commands:i});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoopta-paragraph{font-size:16px;line-height:1.75rem;margin:.5rem 0 0}");export{i as ParagraphCommands,s as default};
@@ -1,10 +1,5 @@
1
1
  import { YooptaPlugin } from '@yoopta/editor';
2
- declare const Paragraph: YooptaPlugin<"paragraph", import("slate").Descendant, {
3
- display: {
4
- title: string;
5
- description: string;
6
- };
7
- shortcuts: string[];
8
- }>;
2
+ import { ParagraphElementMap } from '../types';
3
+ declare const Paragraph: YooptaPlugin<ParagraphElementMap, Record<string, unknown>>;
9
4
  export { Paragraph };
10
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,QAAA,MAAM,SAAS;;;;;;EA8Bb,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGlE,OAAO,EAAoB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGjE,QAAA,MAAM,SAAS,4DAiCb,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  import { SlateElement } from '@yoopta/editor';
2
2
  export type ParagraphElement = SlateElement<'paragraph'>;
3
+ export type ParagraphElementMap = {
4
+ paragraph: ParagraphElement;
5
+ };
3
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;AACzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/paragraph",
3
- "version": "4.7.0",
3
+ "version": "4.7.1-rc.0",
4
4
  "description": "Paragraph plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -34,5 +34,5 @@
34
34
  "bugs": {
35
35
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
36
36
  },
37
- "gitHead": "4addd117eaf75c456f2e050f84a806945d1f2722"
37
+ "gitHead": "63bfe2afb5f9d7b3a8c49584d0ac8bdc5b2dcf1f"
38
38
  }