@yoopta/callout 4.0.0-rc.9 → 4.0.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.
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"));"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
+ import{UI as o,useBlockData as t,useYooptaEditor as e,useYooptaReadOnly as l,YooptaPlugin as r}from"@yoopta/editor";import{jsxs as a,jsx as c}from"react/jsx-runtime";import*as n from"react";"function"==typeof SuppressedError&&SuppressedError;const i={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,u;function d(){return d=Object.assign?Object.assign.bind():function(o){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(o[l]=e[l])}return o},d.apply(this,arguments)}var y,p=function(o){return n.createElement("svg",d({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"},o),s||(s=n.createElement("circle",{cx:12,cy:12,r:10})),u||(u=n.createElement("path",{d:"m9 12 2 2 4-4"})))};function h(){return h=Object.assign?Object.assign.bind():function(o){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(o[l]=e[l])}return o},h.apply(this,arguments)}var f,g,m=function(o){return n.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"},o),y||(y=n.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(o){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(o[l]=e[l])}return o},b.apply(this,arguments)}var w,v,x=function(o){return n.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"},o),f||(f=n.createElement("circle",{cx:12,cy:12,r:10})),g||(g=n.createElement("path",{d:"m15 9-6 6M9 9l6 6"})))};function k(){return k=Object.assign?Object.assign.bind():function(o){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(o[l]=e[l])}return o},k.apply(this,arguments)}var j,O,_=function(o){return n.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"},o),w||(w=n.createElement("circle",{cx:12,cy:12,r:10})),v||(v=n.createElement("path",{d:"m4.9 4.9 14.2 14.2"})))};function C(){return C=Object.assign?Object.assign.bind():function(o){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(o[l]=e[l])}return o},C.apply(this,arguments)}var N,E=function(o){return n.createElement("svg",C({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"},o),j||(j=n.createElement("circle",{cx:12,cy:12,r:10})),O||(O=n.createElement("path",{d:"M12 16v-4M12 8h.01"})))};function L(){return L=Object.assign?Object.assign.bind():function(o){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(o[l]=e[l])}return o},L.apply(this,arguments)}var B=function(o){return n.createElement("svg",L({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"checkmark_svg__lucide checkmark_svg__lucide-check"},o),N||(N=n.createElement("path",{d:"M20 6 9 17l-5-5"})))};const{ExtendedBlockActions:M,BlockOptionsMenuGroup:P,BlockOptionsMenuItem:S,BlockOptionsSeparator:W}=o,A=({editor:o,block:t,props:e})=>{const l=e=>{o.blocks.Callout.updateElement(t.id,"callout",{theme:e})},r=o=>(null==e?void 0:e.theme)===o;return a(M,Object.assign({onClick:()=>o.setSelection([t.meta.order]),className:"yoopta-callout-options"},{children:[c(W,{}),a(P,{children:[c(S,{children:a("button",Object.assign({type:"button",className:"yoo-callout-rounded-sm yoo-callout-justify-between hover:yoo-callout-bg-[#37352f14] yoo-callout-leading-[120%] yoo-callout-px-2 yoo-callout-py-1.5 yoo-callout-mx-[4px] yoo-callout-cursor-pointer yoo-callout-w-full yoo-callout-flex yoo-callout-justify-start",onClick:()=>l("default"),style:{backgroundColor:r("default")?i.default.backgroundColor:void 0}},{children:[a("span",Object.assign({className:"yoo-callout-flex"},{children:[c(_,{width:16,height:16,color:i.default.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Default"]})),r("default")&&c(B,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))}),c(S,{children:a("button",Object.assign({type:"button",className:"yoo-callout-rounded-sm yoo-callout-justify-between hover:yoo-callout-bg-[#37352f14] yoo-callout-leading-[120%] yoo-callout-px-2 yoo-callout-py-1.5 yoo-callout-mx-[4px] yoo-callout-cursor-pointer yoo-callout-w-full yoo-callout-flex yoo-callout-justify-start",onClick:()=>l("info"),style:{backgroundColor:r("info")?i.info.backgroundColor:void 0}},{children:[a("span",Object.assign({className:"yoo-callout-flex"},{children:[c(E,{width:16,height:16,color:i.info.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Info"]})),r("info")&&c(B,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))}),c(S,{children:a("button",Object.assign({type:"button",className:"yoo-callout-rounded-sm yoo-callout-justify-between hover:yoo-callout-bg-[#37352f14] yoo-callout-leading-[120%] yoo-callout-px-2 yoo-callout-py-1.5 yoo-callout-mx-[4px] yoo-callout-cursor-pointer yoo-callout-w-full yoo-callout-flex yoo-callout-justify-start",onClick:()=>l("success"),style:{backgroundColor:r("success")?i.success.backgroundColor:void 0}},{children:[a("span",Object.assign({className:"yoo-callout-flex"},{children:[c(p,{width:16,height:16,color:i.success.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Success"]})),r("success")&&c(B,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))}),c(S,{children:a("button",Object.assign({type:"button",className:"yoo-callout-rounded-sm yoo-callout-justify-between hover:yoo-callout-bg-[#37352f14] yoo-callout-leading-[120%] yoo-callout-px-2 yoo-callout-py-1.5 yoo-callout-mx-[4px] yoo-callout-cursor-pointer yoo-callout-w-full yoo-callout-flex yoo-callout-justify-start",onClick:()=>l("warning"),style:{backgroundColor:r("warning")?i.warning.backgroundColor:void 0}},{children:[a("span",Object.assign({className:"yoo-callout-flex"},{children:[c(m,{width:16,height:16,color:i.warning.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Warning"]})),r("warning")&&c(B,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))}),c(S,{children:a("button",Object.assign({type:"button",className:"yoo-callout-rounded-sm yoo-callout-justify-between hover:yoo-callout-bg-[#37352f14] yoo-callout-leading-[120%] yoo-callout-px-2 yoo-callout-py-1.5 yoo-callout-mx-[4px] yoo-callout-cursor-pointer yoo-callout-w-full yoo-callout-flex yoo-callout-justify-start",onClick:()=>l("error"),style:{backgroundColor:r("error")?i.error.backgroundColor:void 0}},{children:[a("span",Object.assign({className:"yoo-callout-flex"},{children:[c(x,{width:16,height:16,color:i.error.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Error"]})),r("error")&&c(B,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))})]})]}))},I=({element:o,attributes:r,children:n,blockId:s,HTMLAttributes:u={}})=>{const{className:d=""}=u,y=function(o,t){var e={};for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&t.indexOf(l)<0&&(e[l]=o[l]);if(null!=o&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(l=Object.getOwnPropertySymbols(o);r<l.length;r++)t.indexOf(l[r])<0&&Object.prototype.propertyIsEnumerable.call(o,l[r])&&(e[l[r]]=o[l[r]])}return e}(u,["className"]),p=t(s),h=e(),f=l(),{theme:g="default"}=o.props||{},m=i[g];return a("div",Object.assign({"data-element-type":o.type,style:m,className:`yoo-callout-rounded-md yoo-callout-mt-2 yoo-callout-p-2 yoo-callout-pl-4 yoo-callout-leading-7 yoo-callout-bg-info yoo-callout-text-info-foreground yoo-callout-text-[16px] yoopta-callout-theme-${g} ${d}`},y,r,{children:[!f&&c(A,{block:p,editor:h,props:o.props}),n]}))};I.displayName="Callout";const T=new r({type:"Callout",elements:{callout:{render:I,props:{theme:"default"}}},options:{display:{title:"Callout",description:"Make writing stand out"},shortcuts:["<"]}});!function(o,t){void 0===t&&(t={});var e=t.insertAt;if(o&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===e&&l.firstChild?l.insertBefore(r,l.firstChild):l.appendChild(r),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o))}}("#yoopta-editor .yoo-callout-mx-\\[4px\\]{margin-left:4px;margin-right:4px}#yoopta-editor .yoo-callout-mr-2{margin-right:.5rem}#yoopta-editor .yoo-callout-mt-2{margin-top:.5rem}#yoopta-editor .yoo-callout-flex{display:flex}#yoopta-editor .yoo-callout-h-4{height:1rem}#yoopta-editor .yoo-callout-w-4{width:1rem}#yoopta-editor .yoo-callout-w-full{width:100%}#yoopta-editor .yoo-callout-cursor-pointer{cursor:pointer}#yoopta-editor .yoo-callout-justify-start{justify-content:flex-start}#yoopta-editor .yoo-callout-justify-between{justify-content:space-between}#yoopta-editor .yoo-callout-rounded-md{border-radius:.375rem}#yoopta-editor .yoo-callout-rounded-sm{border-radius:.125rem}#yoopta-editor .yoo-callout-p-2{padding:.5rem}#yoopta-editor .yoo-callout-px-2{padding-left:.5rem;padding-right:.5rem}#yoopta-editor .yoo-callout-py-1{padding-bottom:.25rem;padding-top:.25rem}#yoopta-editor .yoo-callout-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}#yoopta-editor .yoo-callout-pl-4{padding-left:1rem}#yoopta-editor .yoo-callout-text-\\[16px\\]{font-size:16px}#yoopta-editor .yoo-callout-leading-7{line-height:1.75rem}#yoopta-editor .yoo-callout-leading-\\[120\\%\\]{line-height:120%}#yoopta-editor .yoopta-callout .yoopta-callout-options{opacity:0;transition:opacity .15s ease-in-out}#yoopta-editor .yoopta-callout:hover .yoopta-callout-options{opacity:1}#yoopta-editor .hover\\:yoo-callout-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}");export{T as default};
@@ -1,3 +1,5 @@
1
- declare const Callout: any;
1
+ import { YooptaPlugin } from '@yoopta/editor';
2
+ import { CalloutElementProps } from '../types';
3
+ declare const Callout: YooptaPlugin<"callout", CalloutElementProps, Record<string, unknown>>;
2
4
  export { Callout };
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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
+ {"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,3 +1,4 @@
1
+ import { PluginElementRenderProps } from '@yoopta/editor';
1
2
  declare const CalloutRender: {
2
3
  ({ element, attributes, children, blockId, HTMLAttributes }: PluginElementRenderProps): import("react/jsx-runtime").JSX.Element;
3
4
  displayName: string;
@@ -1 +1 @@
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"}
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;iEAAqE,wBAAwB;;CAqB/G,CAAC;AAIF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/CalloutBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,EAAE,mBAAmB,EAA0C,MAAM,UAAU,CAAC;AAKvF,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,mBAAmB,2CAA4C,KAAK,4CA6EzE,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"CalloutBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/CalloutBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAOhE,OAAO,EAAE,mBAAmB,EAA0C,MAAM,UAAU,CAAC;AAKvF,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,mBAAmB,2CAA4C,KAAK,4CA+HzE,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@yoopta/callout",
3
- "version": "4.0.0-rc.9",
4
- "description": "> TODO: description",
3
+ "version": "4.0.0",
4
+ "description": "Callout plugin for Yoopta Editor",
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
9
  "main": "dist/index.js",
10
- "module": "dist/index.es.js",
10
+ "type": "module",
11
+ "module": "dist/index.js",
11
12
  "types": "./dist/index.d.ts",
12
13
  "files": [
13
14
  "dist/"
@@ -32,6 +33,5 @@
32
33
  },
33
34
  "bugs": {
34
35
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
35
- },
36
- "gitHead": "daa226c7a3570b330c6f196f6a19729d72785733"
36
+ }
37
37
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023-present Akhmed Ibragimov
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/dist/index.es.js DELETED
@@ -1 +0,0 @@
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};