@yoopta/callout 4.0.0-rc.3 → 4.0.0-rc.4
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 +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{UI as e,useBlockData as o,useYooptaEditor as
|
|
1
|
+
import{UI as e,useBlockData as o,useYooptaEditor as t,YooptaPlugin as r}from"@yoopta/editor";import{jsxs as n,jsx as c}from"react/jsx-runtime";import*as l from"react";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,a;function d(){return d=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},d.apply(this,arguments)}var u,p=function(e){return l.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"},e),s||(s=l.createElement("circle",{cx:12,cy:12,r:10})),a||(a=l.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,f,m=function(e){return l.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),u||(u=l.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 y,v,w=function(e){return l.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=l.createElement("circle",{cx:12,cy:12,r:10})),f||(f=l.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 x,j,C=function(e){return l.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),y||(y=l.createElement("circle",{cx:12,cy:12,r:10})),v||(v=l.createElement("path",{d:"m4.9 4.9 14.2 14.2"})))};function O(){return O=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},O.apply(this,arguments)}var _=function(e){return l.createElement("svg",O({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=l.createElement("circle",{cx:12,cy:12,r:10})),j||(j=l.createElement("path",{d:"M12 16v-4M12 8h.01"})))};const{ExtendedBlockActions:E,BlockOptionsMenuGroup:N,BlockOptionsMenuItem:L,BlockOptionsSeparator:B}=e,M=({editor:e,block:o,props:t})=>{const r=t=>{e.blocks.Image.updateElement(o.id,"callout",{theme:t})};null==t||t.theme;const l=e=>(null==t?void 0:t.theme)===e;return n(E,Object.assign({onClick:()=>e.setSelection([o.meta.order])},{children:[c(B,{}),n(N,{children:[c(L,{children:n("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:l("default")?i.default.backgroundColor:void 0}},{children:[c(C,{width:16,height:16,color:i.default.color,className:"w-4 h-4 mr-2"}),"Default"]}))}),c(L,{children:n("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:l("info")?i.info.backgroundColor:void 0}},{children:[c(_,{width:16,height:16,color:i.info.color,className:"w-4 h-4 mr-2"}),"Info"]}))}),c(L,{children:n("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:l("success")?i.success.backgroundColor:void 0}},{children:[c(p,{width:16,height:16,color:i.success.color,className:"w-4 h-4 mr-2"}),"Success"]}))}),c(L,{children:n("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:l("warning")?i.warning.backgroundColor:void 0}},{children:[c(m,{width:16,height:16,color:i.warning.color,className:"w-4 h-4 mr-2"}),"Warning"]}))}),c(L,{children:n("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:l("error")?i.error.backgroundColor:void 0}},{children:[c(w,{width:16,height:16,color:i.error.color,className:"w-4 h-4 mr-2"}),"Error"]}))})]})]}))},W=({element:e,attributes:r,children:l,blockId:s})=>{const a=o(s),d=t(),{theme:u="default"}=e.props||{},p=i[u];return n("div",Object.assign({"data-element-type":e.type},r,{style:p,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:[c(M,{block:a,editor:d,props:e.props}),l]}))};W.displayName="Callout";const P=new r({type:"Callout",elements:{callout:{render:W,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}");export{P as default};
|
|
@@ -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,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/callout",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.4",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/Darginec05/Editor-Yoopta/issues"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "b455dda008a2f7d20bd00783765131668a6a7537"
|
|
38
38
|
}
|