@yoopta/callout 4.0.0-rc.7 → 4.0.0-rc.8

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 @@
1
+ import{UI as e,useBlockData as o,useYooptaEditor as t,useYooptaReadOnly as r,YooptaPlugin as n}from"@yoopta/editor";import{jsxs as c,jsx as l}from"react/jsx-runtime";import*as i from"react";const s={default:{backgroundColor:"#f5f7f9",color:"#000"},info:{backgroundColor:"#e1f3fe",color:"#08a2e7",borderLeft:"4px solid #08a2e7"},success:{backgroundColor:"#d1fae5",color:"#12b77f",borderLeft:"4px solid #12b77f"},warning:{backgroundColor:"#fef3c9",color:"#f97415",borderLeft:"4px solid #f97415"},error:{backgroundColor:"#fee1e2",color:"#ee4443",borderLeft:"4px solid #ee4443"}};var a,d;function u(){return u=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},u.apply(this,arguments)}var p,h=function(e){return i.createElement("svg",u({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"success_svg__lucide success_svg__lucide-circle-check"},e),a||(a=i.createElement("circle",{cx:12,cy:12,r:10})),d||(d=i.createElement("path",{d:"m9 12 2 2 4-4"})))};function f(){return f=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f.apply(this,arguments)}var g,m,y=function(e){return i.createElement("svg",f({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"warning_svg__lucide warning_svg__lucide-triangle-alert"},e),p||(p=i.createElement("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01"})))};function b(){return b=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},b.apply(this,arguments)}var v,w,k=function(e){return i.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"error_svg__lucide error_svg__lucide-circle-x"},e),g||(g=i.createElement("circle",{cx:12,cy:12,r:10})),m||(m=i.createElement("path",{d:"m15 9-6 6M9 9l6 6"})))};function x(){return x=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},x.apply(this,arguments)}var C,j,O=function(e){return i.createElement("svg",x({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"default_svg__lucide default_svg__lucide-ban"},e),v||(v=i.createElement("circle",{cx:12,cy:12,r:10})),w||(w=i.createElement("path",{d:"m4.9 4.9 14.2 14.2"})))};function _(){return _=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},_.apply(this,arguments)}var N=function(e){return i.createElement("svg",_({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"info_svg__lucide info_svg__lucide-info"},e),C||(C=i.createElement("circle",{cx:12,cy:12,r:10})),j||(j=i.createElement("path",{d:"M12 16v-4M12 8h.01"})))};const{ExtendedBlockActions:E,BlockOptionsMenuGroup:L,BlockOptionsMenuItem:B,BlockOptionsSeparator:M}=e,W=({editor:e,block:o,props:t})=>{const r=t=>{e.blocks.Callout.updateElement(o.id,"callout",{theme:t})},n=e=>(null==t?void 0:t.theme)===e;return c(E,Object.assign({onClick:()=>e.setSelection([o.meta.order]),className:"yoopta-callout-options"},{children:[l(M,{}),c(L,{children:[l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("default"),style:{backgroundColor:n("default")?s.default.backgroundColor:void 0}},{children:[l(O,{width:16,height:16,color:s.default.color,className:"w-4 h-4 mr-2"}),"Default"]}))}),l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("info"),style:{backgroundColor:n("info")?s.info.backgroundColor:void 0}},{children:[l(N,{width:16,height:16,color:s.info.color,className:"w-4 h-4 mr-2"}),"Info"]}))}),l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("success"),style:{backgroundColor:n("success")?s.success.backgroundColor:void 0}},{children:[l(h,{width:16,height:16,color:s.success.color,className:"w-4 h-4 mr-2"}),"Success"]}))}),l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("warning"),style:{backgroundColor:n("warning")?s.warning.backgroundColor:void 0}},{children:[l(y,{width:16,height:16,color:s.warning.color,className:"w-4 h-4 mr-2"}),"Warning"]}))}),l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("error"),style:{backgroundColor:n("error")?s.error.backgroundColor:void 0}},{children:[l(k,{width:16,height:16,color:s.error.color,className:"w-4 h-4 mr-2"}),"Error"]}))})]})]}))},P=({element:e,attributes:n,children:i,blockId:a})=>{const d=o(a),u=t(),p=r(),{theme:h="default"}=e.props||{},f=s[h];return c("div",Object.assign({"data-element-type":e.type},n,{style:f,className:`yoo-c-rounded-md yoo-c-mt-2 yoo-c-p-2 yoo-c-pl-4 yoo-c-leading-7 yoo-c-bg-info yoo-c-text-info-foreground yoo-c-text-[16px] yoopta-callout yoopta-callout-theme-${h}`},{children:[!p&&l(W,{block:d,editor:u,props:e.props}),i]}))};P.displayName="Callout";const S=new n({type:"Callout",elements:{callout:{render:P,props:{theme:"default"}}},options:{display:{title:"Callout",description:"Make writing stand out"},shortcuts:["<"]}});!function(e,o){void 0===o&&(o={});var t=o.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-c-mt-2{margin-top:.5rem}.yoo-c-rounded-md{border-radius:.375rem}.yoo-c-p-2{padding:.5rem}.yoo-c-pl-4{padding-left:1rem}.yoo-c-text-\\[16px\\]{font-size:16px}.yoo-c-leading-7{line-height:1.75rem}.yoopta-callout .yoopta-callout-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-callout:hover .yoopta-callout-options{opacity:1}");export{S as default};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{UI as e,useBlockData as o,useYooptaEditor as t,useYooptaReadOnly as r,YooptaPlugin as n}from"@yoopta/editor";import{jsxs as c,jsx as l}from"react/jsx-runtime";import*as i from"react";const s={default:{backgroundColor:"#f5f7f9",color:"#000"},info:{backgroundColor:"#e1f3fe",color:"#08a2e7",borderLeft:"4px solid #08a2e7"},success:{backgroundColor:"#d1fae5",color:"#12b77f",borderLeft:"4px solid #12b77f"},warning:{backgroundColor:"#fef3c9",color:"#f97415",borderLeft:"4px solid #f97415"},error:{backgroundColor:"#fee1e2",color:"#ee4443",borderLeft:"4px solid #ee4443"}};var a,d;function u(){return u=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},u.apply(this,arguments)}var p,h=function(e){return i.createElement("svg",u({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"success_svg__lucide success_svg__lucide-circle-check"},e),a||(a=i.createElement("circle",{cx:12,cy:12,r:10})),d||(d=i.createElement("path",{d:"m9 12 2 2 4-4"})))};function f(){return f=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f.apply(this,arguments)}var g,m,y=function(e){return i.createElement("svg",f({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"warning_svg__lucide warning_svg__lucide-triangle-alert"},e),p||(p=i.createElement("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01"})))};function b(){return b=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},b.apply(this,arguments)}var v,w,k=function(e){return i.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"error_svg__lucide error_svg__lucide-circle-x"},e),g||(g=i.createElement("circle",{cx:12,cy:12,r:10})),m||(m=i.createElement("path",{d:"m15 9-6 6M9 9l6 6"})))};function x(){return x=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},x.apply(this,arguments)}var C,j,O=function(e){return i.createElement("svg",x({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"default_svg__lucide default_svg__lucide-ban"},e),v||(v=i.createElement("circle",{cx:12,cy:12,r:10})),w||(w=i.createElement("path",{d:"m4.9 4.9 14.2 14.2"})))};function _(){return _=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},_.apply(this,arguments)}var N=function(e){return i.createElement("svg",_({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"info_svg__lucide info_svg__lucide-info"},e),C||(C=i.createElement("circle",{cx:12,cy:12,r:10})),j||(j=i.createElement("path",{d:"M12 16v-4M12 8h.01"})))};const{ExtendedBlockActions:E,BlockOptionsMenuGroup:L,BlockOptionsMenuItem:B,BlockOptionsSeparator:M}=e,W=({editor:e,block:o,props:t})=>{const r=t=>{e.blocks.Callout.updateElement(o.id,"callout",{theme:t})},n=e=>(null==t?void 0:t.theme)===e;return c(E,Object.assign({onClick:()=>e.setSelection([o.meta.order]),className:"yoopta-callout-options"},{children:[l(M,{}),c(L,{children:[l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("default"),style:{backgroundColor:n("default")?s.default.backgroundColor:void 0}},{children:[l(O,{width:16,height:16,color:s.default.color,className:"w-4 h-4 mr-2"}),"Default"]}))}),l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("info"),style:{backgroundColor:n("info")?s.info.backgroundColor:void 0}},{children:[l(N,{width:16,height:16,color:s.info.color,className:"w-4 h-4 mr-2"}),"Info"]}))}),l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("success"),style:{backgroundColor:n("success")?s.success.backgroundColor:void 0}},{children:[l(h,{width:16,height:16,color:s.success.color,className:"w-4 h-4 mr-2"}),"Success"]}))}),l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("warning"),style:{backgroundColor:n("warning")?s.warning.backgroundColor:void 0}},{children:[l(y,{width:16,height:16,color:s.warning.color,className:"w-4 h-4 mr-2"}),"Warning"]}))}),l(B,{children:c("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>r("error"),style:{backgroundColor:n("error")?s.error.backgroundColor:void 0}},{children:[l(k,{width:16,height:16,color:s.error.color,className:"w-4 h-4 mr-2"}),"Error"]}))})]})]}))},P=({element:e,attributes:n,children:i,blockId:a})=>{const d=o(a),u=t(),p=r(),{theme:h="default"}=e.props||{},f=s[h];return c("div",Object.assign({"data-element-type":e.type},n,{style:f,className:`yoo-c-rounded-md yoo-c-mt-2 yoo-c-p-2 yoo-c-pl-4 yoo-c-leading-7 yoo-c-bg-info yoo-c-text-info-foreground yoo-c-text-[16px] yoopta-callout yoopta-callout-theme-${h}`},{children:[!p&&l(W,{block:d,editor:u,props:e.props}),i]}))};P.displayName="Callout";const S=new n({type:"Callout",elements:{callout:{render:P,props:{theme:"default"}}},options:{display:{title:"Callout",description:"Make writing stand out"},shortcuts:["<"]}});!function(e,o){void 0===o&&(o={});var t=o.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-c-mt-2{margin-top:.5rem}.yoo-c-rounded-md{border-radius:.375rem}.yoo-c-p-2{padding:.5rem}.yoo-c-pl-4{padding-left:1rem}.yoo-c-text-\\[16px\\]{font-size:16px}.yoo-c-leading-7{line-height:1.75rem}.yoopta-callout .yoopta-callout-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-callout:hover .yoopta-callout-options{opacity:1}");export{S as default};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@yoopta/editor"),t=require("react/jsx-runtime");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var r=o(require("react"));const n={default:{backgroundColor:"#f5f7f9",color:"#000"},info:{backgroundColor:"#e1f3fe",color:"#08a2e7",borderLeft:"4px solid #08a2e7"},success:{backgroundColor:"#d1fae5",color:"#12b77f",borderLeft:"4px solid #12b77f"},warning:{backgroundColor:"#fef3c9",color:"#f97415",borderLeft:"4px solid #f97415"},error:{backgroundColor:"#fee1e2",color:"#ee4443",borderLeft:"4px solid #ee4443"}};var s,c;function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},l.apply(this,arguments)}var i,a=function(e){return r.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"success_svg__lucide success_svg__lucide-circle-check"},e),s||(s=r.createElement("circle",{cx:12,cy:12,r:10})),c||(c=r.createElement("path",{d:"m9 12 2 2 4-4"})))};function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},u.apply(this,arguments)}var d,p,f=function(e){return r.createElement("svg",u({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"warning_svg__lucide warning_svg__lucide-triangle-alert"},e),i||(i=r.createElement("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01"})))};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},g.apply(this,arguments)}var h,m,y=function(e){return r.createElement("svg",g({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"error_svg__lucide error_svg__lucide-circle-x"},e),d||(d=r.createElement("circle",{cx:12,cy:12,r:10})),p||(p=r.createElement("path",{d:"m15 9-6 6M9 9l6 6"})))};function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},b.apply(this,arguments)}var x,v,w=function(e){return r.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"default_svg__lucide default_svg__lucide-ban"},e),h||(h=r.createElement("circle",{cx:12,cy:12,r:10})),m||(m=r.createElement("path",{d:"m4.9 4.9 14.2 14.2"})))};function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},j.apply(this,arguments)}var k=function(e){return r.createElement("svg",j({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"info_svg__lucide info_svg__lucide-info"},e),x||(x=r.createElement("circle",{cx:12,cy:12,r:10})),v||(v=r.createElement("path",{d:"M12 16v-4M12 8h.01"})))};const{ExtendedBlockActions:O,BlockOptionsMenuGroup:C,BlockOptionsMenuItem:_,BlockOptionsSeparator:E}=e.UI,N=({editor:e,block:o,props:r})=>{const s=t=>{e.blocks.Callout.updateElement(o.id,"callout",{theme:t})},c=e=>(null==r?void 0:r.theme)===e;return t.jsxs(O,Object.assign({onClick:()=>e.setSelection([o.meta.order]),className:"yoopta-callout-options"},{children:[t.jsx(E,{}),t.jsxs(C,{children:[t.jsx(_,{children:t.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>s("default"),style:{backgroundColor:c("default")?n.default.backgroundColor:void 0}},{children:[t.jsx(w,{width:16,height:16,color:n.default.color,className:"w-4 h-4 mr-2"}),"Default"]}))}),t.jsx(_,{children:t.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>s("info"),style:{backgroundColor:c("info")?n.info.backgroundColor:void 0}},{children:[t.jsx(k,{width:16,height:16,color:n.info.color,className:"w-4 h-4 mr-2"}),"Info"]}))}),t.jsx(_,{children:t.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>s("success"),style:{backgroundColor:c("success")?n.success.backgroundColor:void 0}},{children:[t.jsx(a,{width:16,height:16,color:n.success.color,className:"w-4 h-4 mr-2"}),"Success"]}))}),t.jsx(_,{children:t.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>s("warning"),style:{backgroundColor:c("warning")?n.warning.backgroundColor:void 0}},{children:[t.jsx(f,{width:16,height:16,color:n.warning.color,className:"w-4 h-4 mr-2"}),"Warning"]}))}),t.jsx(_,{children:t.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>s("error"),style:{backgroundColor:c("error")?n.error.backgroundColor:void 0}},{children:[t.jsx(y,{width:16,height:16,color:n.error.color,className:"w-4 h-4 mr-2"}),"Error"]}))})]})]}))},L=({element:o,attributes:r,children:s,blockId:c})=>{const l=e.useBlockData(c),i=e.useYooptaEditor(),a=e.useYooptaReadOnly(),{theme:u="default"}=o.props||{},d=n[u];return t.jsxs("div",Object.assign({"data-element-type":o.type},r,{style:d,className:`yoo-c-rounded-md yoo-c-mt-2 yoo-c-p-2 yoo-c-pl-4 yoo-c-leading-7 yoo-c-bg-info yoo-c-text-info-foreground yoo-c-text-[16px] yoopta-callout yoopta-callout-theme-${u}`},{children:[!a&&t.jsx(N,{block:l,editor:i,props:o.props}),s]}))};L.displayName="Callout";const B=new e.YooptaPlugin({type:"Callout",elements:{callout:{render:L,props:{theme:"default"}}},options:{display:{title:"Callout",description:"Make writing stand out"},shortcuts:["<"]}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-c-mt-2{margin-top:.5rem}.yoo-c-rounded-md{border-radius:.375rem}.yoo-c-p-2{padding:.5rem}.yoo-c-pl-4{padding-left:1rem}.yoo-c-text-\\[16px\\]{font-size:16px}.yoo-c-leading-7{line-height:1.75rem}.yoopta-callout .yoopta-callout-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-callout:hover .yoopta-callout-options{opacity:1}"),exports.default=B;
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@yoopta/callout",
3
- "version": "4.0.0-rc.7",
3
+ "version": "4.0.0-rc.8",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
7
7
  "license": "MIT",
8
8
  "private": false,
9
- "type": "module",
10
9
  "main": "dist/index.js",
11
- "module": "dist/index.js",
10
+ "module": "dist/index.es.js",
12
11
  "types": "./dist/index.d.ts",
13
12
  "files": [
14
13
  "dist/"
@@ -34,5 +33,5 @@
34
33
  "bugs": {
35
34
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
36
35
  },
37
- "gitHead": "907dadc1323714e24c3b6d896ae11c72b6d9c754"
36
+ "gitHead": "2ab435c70924d16a80928f05657f0f9db1ff42f0"
38
37
  }