@yoopta/callout 1.9.8-rc → 1.9.9-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 -74
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,74 +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 = ".Callout-module_callout{background:#f5f7f9;border-radius:5px;color:inherit;font-size:16px;letter-spacing:-.003em;line-height:28px;margin-bottom:4px;margin-left:0;margin-top:4px;padding:12px 14px;position:relative;width:100%}";
33
- var s = {"callout":"Callout-module_callout"};
34
- styleInject(css_248z);
35
-
36
- const CalloutRender = ({ attributes, children, element, HTMLAttributes }) => {
37
- return (jsx("div", Object.assign({ draggable: false }, HTMLAttributes, { className: getElementClassname({ element, HTMLAttributes, className: s.callout }) }, attributes, { children: children })));
38
- };
39
- CalloutRender.displayName = 'Callout';
40
- const Callout = createYooptaPlugin({
41
- type: 'callout',
42
- renderer: (editor) => CalloutRender,
43
- shortcut: '<',
44
- defineElement: () => ({
45
- id: generateId(),
46
- type: 'callout',
47
- children: [{ text: '' }],
48
- nodeType: 'block',
49
- }),
50
- createElement: (editor, elementData) => {
51
- var _a;
52
- const node = Object.assign(Object.assign({}, Callout.getPlugin.defineElement()), elementData);
53
- Transforms.setNodes(editor, node, {
54
- at: (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor,
55
- });
56
- },
57
- exports: {
58
- markdown: {
59
- serialize: (node, text) => `> ${text}`,
60
- },
61
- html: {
62
- serialize: (node, children) => `<div style="background: #f5f7f9; border-radius: 5px; color: #292929; padding: 12px 14px">${children}</div>`,
63
- deserialize: {
64
- nodeName: 'BLOCKQUOTE',
65
- },
66
- },
67
- },
68
- options: {
69
- searchString: 'callout',
70
- displayLabel: 'Callout',
71
- },
72
- });
73
-
74
- export { Callout as default };
1
+ import{jsx as e}from"react/jsx-runtime";import{createYooptaPlugin as t,generateId as i,getElementClassname as r}from"@yoopta/editor";import{Transforms as a}from"slate";var o="_22OYfqbf";!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("._22OYfqbf{background:#f5f7f9;border-radius:5px;color:inherit;font-size:16px;letter-spacing:-.003em;line-height:28px;margin-bottom:4px;margin-left:0;margin-top:4px;padding:12px 14px;position:relative;width:100%}");const n=({attributes:t,children:i,element:a,HTMLAttributes:n})=>e("div",Object.assign({draggable:!1},n,{className:r({element:a,HTMLAttributes:n,className:o})},t,{children:i}));n.displayName="Callout";const l=t({type:"callout",renderer:e=>n,shortcut:"<",defineElement:()=>({id:i(),type:"callout",children:[{text:""}],nodeType:"block"}),createElement:(e,t)=>{var i;const r=Object.assign(Object.assign({},l.getPlugin.defineElement()),t);a.setNodes(e,r,{at:null===(i=e.selection)||void 0===i?void 0:i.anchor})},exports:{markdown:{serialize:(e,t)=>`> ${t}`},html:{serialize:(e,t)=>`<div style="background: #f5f7f9; border-radius: 5px; color: #292929; padding: 12px 14px">${t}</div>`,deserialize:{nodeName:"BLOCKQUOTE"}}},options:{searchString:"callout",displayLabel:"Callout"}});export{l as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/callout",
3
- "version": "1.9.8-rc",
3
+ "version": "1.9.9-rc",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",