@yoopta/paragraph 1.9.10-rc → 1.9.11-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.
Files changed (2) hide show
  1. package/dist/index.js +1 -73
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,73 +1 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { createYooptaPlugin, generateId, getElementClassname } from '@yoopta/editor';
3
- import { Transforms } from 'slate';
4
-
5
- function styleInject(css, ref) {
6
- if ( ref === void 0 ) ref = {};
7
- var insertAt = ref.insertAt;
8
-
9
- if (!css || typeof document === 'undefined') { return; }
10
-
11
- var head = document.head || document.getElementsByTagName('head')[0];
12
- var style = document.createElement('style');
13
- style.type = 'text/css';
14
-
15
- if (insertAt === 'top') {
16
- if (head.firstChild) {
17
- head.insertBefore(style, head.firstChild);
18
- } else {
19
- head.appendChild(style);
20
- }
21
- } else {
22
- head.appendChild(style);
23
- }
24
-
25
- if (style.styleSheet) {
26
- style.styleSheet.cssText = css;
27
- } else {
28
- style.appendChild(document.createTextNode(css));
29
- }
30
- }
31
-
32
- var css_248z = ".Paragraph-module_paragraph{color:inherit;font-size:16px;letter-spacing:-.003em;line-height:28px;margin-bottom:1px;margin-top:2px;padding-bottom:2px;padding-top:2px;position:relative}";
33
- var s = {"paragraph":"Paragraph-module_paragraph"};
34
- styleInject(css_248z);
35
-
36
- const ParagraphRender = ({ attributes, children, element, HTMLAttributes, }) => {
37
- return (jsx("p", Object.assign({ draggable: false }, HTMLAttributes, { className: getElementClassname({ element, HTMLAttributes, className: s.paragraph }) }, attributes, { children: children })));
38
- };
39
- ParagraphRender.displayName = 'Paragraph';
40
- const Paragraph = createYooptaPlugin({
41
- type: 'paragraph',
42
- renderer: (editor) => ParagraphRender,
43
- defineElement: () => ({
44
- id: generateId(),
45
- type: 'paragraph',
46
- children: [{ text: '' }],
47
- nodeType: 'block',
48
- }),
49
- createElement: (editor, elementData) => {
50
- var _a;
51
- const node = Object.assign(Object.assign({}, Paragraph.getPlugin.defineElement()), elementData);
52
- Transforms.setNodes(editor, node, {
53
- at: (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor,
54
- });
55
- },
56
- exports: {
57
- markdown: {
58
- serialize: (node, text) => `${text}\n`,
59
- },
60
- html: {
61
- serialize: (node, children) => `<p>${children}</p>`,
62
- deserialize: {
63
- nodeName: 'P',
64
- },
65
- },
66
- },
67
- options: {
68
- searchString: 'text paragraph',
69
- displayLabel: 'Paragraph',
70
- },
71
- });
72
-
73
- export { Paragraph as default };
1
+ import{jsx as e}from"react/jsx-runtime";import{createYooptaPlugin as t,generateId as a,getElementClassname as i}from"@yoopta/editor";import{Transforms as r}from"slate";var n="hwZ8eR7o";!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".hwZ8eR7o{color:inherit;font-size:16px;letter-spacing:-.003em;line-height:28px;margin-bottom:1px;margin-top:2px;padding-bottom:2px;padding-top:2px;position:relative}");const o=({attributes:t,children:a,element:r,HTMLAttributes:o})=>e("p",Object.assign({draggable:!1},o,{className:i({element:r,HTMLAttributes:o,className:n})},t,{children:a}));o.displayName="Paragraph";const s=t({type:"paragraph",renderer:e=>o,defineElement:()=>({id:a(),type:"paragraph",children:[{text:""}],nodeType:"block"}),createElement:(e,t)=>{var a;const i=Object.assign(Object.assign({},s.getPlugin.defineElement()),t);r.setNodes(e,i,{at:null===(a=e.selection)||void 0===a?void 0:a.anchor})},exports:{markdown:{serialize:(e,t)=>`${t}\n`},html:{serialize:(e,t)=>`<p>${t}</p>`,deserialize:{nodeName:"P"}}},options:{searchString:"text paragraph",displayLabel:"Paragraph"}});export{s as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/paragraph",
3
- "version": "1.9.10-rc",
3
+ "version": "1.9.11-rc",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",