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

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/index.es.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
+ 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";"function"==typeof SuppressedError&&SuppressedError;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,f=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 h(){return h=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},h.apply(this,arguments)}var g,m,y=function(e){return i.createElement("svg",h({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,x=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 k(){return k=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},k.apply(this,arguments)}var O,j,C=function(e){return i.createElement("svg",k({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 E=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),O||(O=i.createElement("circle",{cx:12,cy:12,r:10})),j||(j=i.createElement("path",{d:"M12 16v-4M12 8h.01"})))};const{ExtendedBlockActions:N,BlockOptionsMenuGroup:L,BlockOptionsMenuItem:B,BlockOptionsSeparator:M}=e,S=({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(N,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(C,{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(E,{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(f,{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(x,{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,HTMLAttributes:d={}})=>{const{className:u}=d,p=function(e,o){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)o.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t}(d,["className"]),f=o(a),h=t(),g=r(),{theme:m="default"}=e.props||{},y=s[m];return c("div",Object.assign({"data-element-type":e.type,style:y,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-${m} ${u}`},p,n,{children:[!g&&l(S,{block:f,editor:h,props:e.props}),i]}))};P.displayName="Callout";const W=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{W as default};
package/dist/index.js CHANGED
@@ -1 +1 @@
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;
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"));"function"==typeof SuppressedError&&SuppressedError;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,j=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 w(){return w=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},w.apply(this,arguments)}var k=function(e){return r.createElement("svg",w({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(j,{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,HTMLAttributes:l={}})=>{const{className:i}=l,a=function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]])}return o}(l,["className"]),u=e.useBlockData(c),d=e.useYooptaEditor(),p=e.useYooptaReadOnly(),{theme:f="default"}=o.props||{},g=n[f];return t.jsxs("div",Object.assign({"data-element-type":o.type,style:g,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-${f} ${i}`},a,r,{children:[!p&&t.jsx(N,{block:u,editor:d,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;
@@ -1,5 +1,3 @@
1
- import { YooptaPlugin } from '@yoopta/editor';
2
- import { CalloutElementProps } from '../types';
3
- declare const Callout: YooptaPlugin<"callout", CalloutElementProps, Record<string, unknown>>;
1
+ declare const Callout: any;
4
2
  export { Callout };
5
3
  //# 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;AAC9C,OAAO,EAAE,mBAAmB,EAA4B,MAAM,UAAU,CAAC;AAGzE,QAAA,MAAM,OAAO,uEAiBX,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,OAAO,KAiBX,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,6 +1,5 @@
1
- import { PluginElementRenderProps } from '@yoopta/editor';
2
1
  declare const CalloutRender: {
3
- ({ element, attributes, children, blockId }: PluginElementRenderProps): import("react/jsx-runtime").JSX.Element;
2
+ ({ element, attributes, children, blockId, HTMLAttributes }: PluginElementRenderProps): import("react/jsx-runtime").JSX.Element;
4
3
  displayName: string;
5
4
  };
6
5
  export { CalloutRender };
@@ -1 +1 @@
1
- {"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../src/ui/Callout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAoD,MAAM,gBAAgB,CAAC;AAI5G,QAAA,MAAM,aAAa;iDAAgD,wBAAwB;;CAkB1F,CAAC;AAIF,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../src/ui/Callout.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,aAAa;;;CAqBlB,CAAC;AAIF,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/callout",
3
- "version": "4.0.0-rc.8",
3
+ "version": "4.0.0-rc.9",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -33,5 +33,5 @@
33
33
  "bugs": {
34
34
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
35
35
  },
36
- "gitHead": "2ab435c70924d16a80928f05657f0f9db1ff42f0"
36
+ "gitHead": "daa226c7a3570b330c6f196f6a19729d72785733"
37
37
  }