@ydesign/react-editor 0.0.4 → 0.0.5
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/app.css +1 -1
- package/dist/app.js +1 -1
- package/dist/chunk-2PAJLUQH.js +1 -0
- package/dist/chunk-2SA3ZNHH.js +9 -0
- package/dist/chunk-4BG4CHIB.js +1 -0
- package/dist/{chunk-VXTF2OL2.js → chunk-4HH3B3W3.js} +2 -1
- package/dist/chunk-4WITBL6X.js +1 -0
- package/dist/chunk-ARZMBVXU.js +1 -0
- package/dist/chunk-BDQSWJYF.js +1 -0
- package/dist/{chunk-MQZE5LZU.js → chunk-DCGJ6RKU.js} +1 -1
- package/dist/{chunk-OV74NBJ5.js → chunk-FGCLY24Q.js} +2 -2
- package/dist/chunk-FOMWIGAQ.js +50 -0
- package/dist/chunk-H6GI5LUP.js +54 -0
- package/dist/chunk-HD2T2D4D.js +1 -0
- package/dist/chunk-HQSM4X2M.js +1 -0
- package/dist/chunk-INRJE7VS.js +1 -0
- package/dist/chunk-ISNCNIFJ.js +27 -0
- package/dist/chunk-KCNKLCD5.js +1 -0
- package/dist/chunk-N5KI6CPA.js +1 -0
- package/dist/chunk-NQYSJ5MN.js +1 -0
- package/dist/chunk-OA7Z7HNL.js +1 -0
- package/dist/chunk-OBJ5NZSC.js +1 -0
- package/dist/chunk-OFA6JIQB.js +9 -0
- package/dist/chunk-ONY3GLGA.js +1 -0
- package/dist/chunk-QX7ZGRSR.js +1 -0
- package/dist/chunk-R452ARGU.js +1 -0
- package/dist/chunk-RUVPKBI5.js +3 -0
- package/dist/chunk-TNBL7KOG.js +1 -0
- package/dist/chunk-TWH7TO5J.js +1 -0
- package/dist/chunk-TYHXQPZQ.js +1 -0
- package/dist/chunk-XXR5YN2B.js +9 -0
- package/dist/chunk-Y7RXJ3FI.js +16 -0
- package/dist/chunk-YLXPQ2GI.js +1 -0
- package/dist/chunk-YOQ663QO.js +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/project.d.ts +9 -2
- package/dist/project.js +1 -1
- package/dist/side-panel/background-panel.js +1 -1
- package/dist/side-panel/images-grid.d.ts +3 -1
- package/dist/side-panel/images-grid.js +1 -1
- package/dist/side-panel/index.js +1 -1
- package/dist/side-panel/layers-panel.js +1 -1
- package/dist/side-panel/photos-panel.d.ts +4 -2
- package/dist/side-panel/photos-panel.js +1 -1
- package/dist/side-panel/shapes-panel.d.ts +4 -2
- package/dist/side-panel/shapes-panel.js +1 -1
- package/dist/side-panel/side-panel.js +1 -1
- package/dist/side-panel/size-panel.js +1 -1
- package/dist/side-panel/tab-button.js +1 -1
- package/dist/side-panel/templates-panel.js +1 -1
- package/dist/side-panel/text-panel.js +1 -1
- package/dist/side-panel/upload-panel.d.ts +6 -3
- package/dist/side-panel/upload-panel.js +1 -1
- package/dist/toolbar/default-toolbar.js +1 -1
- package/dist/toolbar/download-button.d.ts +4 -2
- package/dist/toolbar/download-button.js +1 -1
- package/dist/toolbar/duplicate-button.js +1 -1
- package/dist/toolbar/figure-toolbar.js +1 -1
- package/dist/toolbar/filters-picker.js +1 -1
- package/dist/toolbar/flip-button.d.ts +4 -2
- package/dist/toolbar/flip-button.js +1 -1
- package/dist/toolbar/group-button.js +1 -1
- package/dist/toolbar/history-buttons.js +1 -1
- package/dist/toolbar/image-eraser-pen.d.ts +4 -2
- package/dist/toolbar/image-eraser-pen.js +1 -1
- package/dist/toolbar/image-remove-background.d.ts +4 -2
- package/dist/toolbar/image-remove-background.js +1 -1
- package/dist/toolbar/image-toolbar.d.ts +4 -2
- package/dist/toolbar/image-toolbar.js +1 -1
- package/dist/toolbar/lock-button.js +1 -1
- package/dist/toolbar/opacity-picker.js +1 -1
- package/dist/toolbar/position-picker.js +1 -1
- package/dist/toolbar/remove-button.js +1 -1
- package/dist/toolbar/text-ai-write.js +1 -1
- package/dist/toolbar/text-toolbar.js +1 -1
- package/dist/toolbar/toolbar.js +1 -1
- package/dist/topbar/file-menu.d.ts +7 -2
- package/dist/topbar/file-menu.js +1 -1
- package/dist/topbar/topbar.js +5 -5
- package/dist/utils/l10n.d.ts +205 -3
- package/dist/utils/l10n.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-3TTTJUTT.js +0 -1
- package/dist/chunk-4FFLRF6N.js +0 -1
- package/dist/chunk-4HEMGHOQ.js +0 -1
- package/dist/chunk-53KFBGJB.js +0 -16
- package/dist/chunk-AGNRQAPA.js +0 -1
- package/dist/chunk-APQPKBER.js +0 -1
- package/dist/chunk-B35ZYWID.js +0 -1
- package/dist/chunk-CMH73CYQ.js +0 -27
- package/dist/chunk-COQ4GO5N.js +0 -1
- package/dist/chunk-CS6Z4TQU.js +0 -1
- package/dist/chunk-DBQHEZPG.js +0 -1
- package/dist/chunk-DJBTBRPS.js +0 -1
- package/dist/chunk-EOBIVNFF.js +0 -1
- package/dist/chunk-FXO52BV7.js +0 -1
- package/dist/chunk-GYDTKPW5.js +0 -1
- package/dist/chunk-H67HTXU4.js +0 -1
- package/dist/chunk-IQ7O55C5.js +0 -42
- package/dist/chunk-KLZXBPXI.js +0 -1
- package/dist/chunk-LCE6Z46D.js +0 -3
- package/dist/chunk-M4S26KQG.js +0 -1
- package/dist/chunk-MNACXCF5.js +0 -1
- package/dist/chunk-PSXS4WMN.js +0 -1
- package/dist/chunk-Q2L6VKFI.js +0 -9
- package/dist/chunk-R6Z6F447.js +0 -1
- package/dist/chunk-WGX437MN.js +0 -9
- package/dist/chunk-XK24AOVW.js +0 -54
- package/dist/chunk-XM3RPIUS.js +0 -9
- package/dist/chunk-XPAHGJGK.js +0 -1
package/dist/chunk-Q2L6VKFI.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as T,b as w,c as m}from"./chunk-5C2MNUBC.js";import{useState as h,useEffect as z,useRef as N}from"react";import{observer as U}from"mobx-react-lite";import{Button as b,Switch as A,Tooltip as L,InputNumber as M,Select as R}from"antd";import{Info as W,Instagram as y,Linkedin as v,Twitter as g,Video as u,Printer as a}from"lucide-react";import{jsx as i,jsxs as n}from"react/jsx-runtime";var E=[{name:"Instagram",icon:i(y,{size:16}),sizes:[["Post",1080,1080,"px",i(y,{})],["Story",1080,1920,"px",i(y,{})],["Ad",1080,1080,"px",i(y,{})]]},{name:"LinkedIn",icon:i(v,{size:16}),sizes:[["Post",1200,627,"px",i(v,{})],["Banner",1584,396,"px",i(v,{})],["Square",1080,1080,"px",i(v,{})]]},{name:"Twitter",icon:i(g,{size:16}),sizes:[["Post",1600,900,"px",i(g,{})],["Header",1500,500,"px",i(g,{})],["Square",1080,1080,"px",i(g,{})]]},{name:"Video",icon:i(u,{size:16}),sizes:[["Full HD",1920,1080,"px",i(u,{})],["4K UHD",3840,2160,"px",i(u,{})],["Vertical HD",1080,1920,"px",i(u,{})],["Square HD",1080,1080,"px",i(u,{})]]},{name:"Print",icon:i(a,{size:16}),sizes:[["Invitation",14,14,"cm",i(a,{})],["A4 Portrait",21,29.7,"cm",i(a,{})],["A4 Landscape",29.7,21,"cm",i(a,{})],["A3",29.7,42,"cm",i(a,{})],["Letter Portrait",8.5,11,"in",i(a,{})],["Letter Landscape",11,8.5,"in",i(a,{})],["Business card",3.5,2,"in",i(a,{})],["Poster",18,24,"in",i(a,{})]]}],P=t=>{let{value:d,onChange:x}=t;console.log(t,";213");let[o,p]=h(d),s=N(d);s.current=o;let c=()=>{x(Math.max(t.min||0,parseFloat(s.current)))};return z(()=>{p(d)},[d]),i(M,{...t,value:o,onChange:l=>{Number.isNaN(l)||p(l)},onBlur:c,onKeyDown:l=>{l.key==="Enter"&&c()}})},G=U(({store:t})=>{let[d,x]=h(!0),[o,p]=h(t.width),[s,c]=h(t.height),l=T({px:10,unit:t.unit,dpi:t.dpi}),S=t.width,k=t.height;return z(()=>{p(w({px:S,unit:t.unit,dpi:t.dpi}))},[S,t.unit,t.dpi]),z(()=>{c(w({px:k,unit:t.unit,dpi:t.dpi}))},[k,t.unit,t.dpi]),n("div",{className:"no-scrollbar",style:{height:"100%",overflow:"auto",paddingRight:"3px"},children:[i("style",{children:`
|
|
2
|
-
.no-scrollbar::-webkit-scrollbar {
|
|
3
|
-
display: none;
|
|
4
|
-
}
|
|
5
|
-
.no-scrollbar {
|
|
6
|
-
-ms-overflow-style: none;
|
|
7
|
-
scrollbar-width: none;
|
|
8
|
-
}
|
|
9
|
-
`}),n("div",{style:{paddingBottom:"15px"},children:[n("div",{style:{display:"flex",alignItems:"center",marginTop:8,marginBottom:25,justifyContent:"space-between"},children:[n("div",{style:{display:"flex",alignItems:"center"},children:[i("span",{children:"Use magic resize"}),i(L,{title:"Magic resize will automatically resize and move all elements on the canvas",placement:"bottom",children:i(b,{type:"text",styles:{root:{padding:"0 7px"}},children:i(W,{size:16})})})]}),i(A,{checked:d,onChange:x})]}),n("div",{style:{width:"50%",display:"inline-block"},children:["Width",` (${t.unit})`]}),i("div",{style:{width:"50%",display:"inline-block"},children:i(P,{min:l,max:1e4,value:o,style:{width:"100%"},styles:{actions:{opacity:1,width:24}},onChange:e=>{e||(e=o),p(e)}})})]}),n("div",{style:{paddingBottom:"15px"},children:[n("div",{style:{width:"50%",display:"inline-block"},children:["Height",` (${t.unit})`]}),i("div",{style:{width:"50%",display:"inline-block"},children:i(P,{min:l,max:1e4,value:s,style:{width:"100%"},styles:{actions:{opacity:1,width:24}},onChange:e=>{e||(e=s),c(e)}})})]}),n("div",{style:{paddingBottom:"15px"},children:[i("div",{style:{width:"50%",display:"inline-block"},children:"Units"}),i("div",{style:{width:"50%",display:"inline-block"},children:i(R,{value:t.unit,style:{width:"100%"},onChange:e=>{t.setUnit({unit:e,dpi:t.dpi})},options:[{label:"px",value:"px"},{label:"cm",value:"cm"},{label:"in",value:"in"}]})})]}),i("div",{style:{paddingBottom:"15px"},children:i(b,{type:"primary",onClick:()=>{let e=m({unitVal:o,dpi:t.dpi,unit:t.unit}),f=m({unitVal:s,dpi:t.dpi,unit:t.unit});t.setSize({width:e,height:f,useMagic:d})},block:!0,children:"Resize"})}),E.map(e=>n("div",{children:[n("div",{style:{paddingBottom:"15px",paddingTop:"15px",fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[e.icon,e.name]}),i("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"8px",marginBottom:"10px"},children:e.sizes.map(f=>{let[B,C,I,r,H]=f;return n(b,{type:"text",style:{height:"80px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"13px",maxWidth:103},styles:{root:{padding:"0 10px",gap:0}},onClick:()=>{let V=m({unitVal:C,dpi:t.dpi,unit:r}),D=m({unitVal:I,dpi:t.dpi,unit:r});t.setUnit({unit:r,dpi:t.dpi}),t.setSize({width:V,height:D,useMagic:d})},children:[i("div",{style:{fontSize:"22px",marginBottom:"4px"},children:H}),i("div",{style:{fontSize:"12px"},children:B}),n("div",{style:{fontSize:"0.7rem",opacity:.7},children:[C,"x",I," ",r]})]},B)})})]},e.name))]})});export{G as a};
|
package/dist/chunk-R6Z6F447.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-IUFYYEGO.js";import{Trash2 as p}from"lucide-react";import{Tooltip as i,Button as s}from"antd";import{observer as l}from"mobx-react-lite";import{jsx as o}from"react/jsx-runtime";var T=l(({store:e})=>{let{disabled:r,remove:m}=t({store:e});return o(i,{title:"Remove",placement:"bottom",children:o(s,{type:"text",styles:{root:{padding:"0 7px"}},disabled:r,onClick:()=>{m()},children:o(p,{size:16})})})});export{T as a};
|
package/dist/chunk-WGX437MN.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-APQPKBER.js";import{a as w}from"./chunk-IQ7O55C5.js";import{observable as f}from"mobx";import{observer as a}from"mobx-react-lite";import M from"styled-components";import{jsx as o,jsxs as s}from"react/jsx-runtime";var l=["https://images.unsplash.com/photo-1579546929518-9e396f3cc809?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxfHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1635776062360-af423602aff3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyfHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1604079628040-94301bb21b91?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwzfHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1604076913837-52ab5629fba9?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw0fHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1579547621706-1a9c79d5c9f1?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw1fHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1635776062127-d379bfcba9f8?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw2fHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1508614999368-9260051292e5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw3fHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1620641788421-7a1c342ea42e?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw4fHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1579546928937-641f7ac9bced?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw5fHxncmFkaWVudHxlbnwwfHx8fDE3NjAwMzAwMjJ8MA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1604076850742-4c7221f3101b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxMHx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1618397746666-63405ce5d015?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxMXx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1557683316-973673baf926?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxMnx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxM3x8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1579548122080-c35fd6820ecb?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1523821741446-edb2b68bb7a0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxNXx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1644426358812-879f02d1d867?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxNnx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1550859492-d5da9d8e45f3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxN3x8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1579546929662-711aa81148cf?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxOHx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1589810264340-0ce27bfbf751?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxOXx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400","https://images.unsplash.com/photo-1569982175971-d92b01cf8694?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyMHx8Z3JhZGllbnR8ZW58MHx8fHwxNzYwMDMwMDIyfDA&ixlib=rb-4.1.0&q=80&w=400"],r=f(["white","rgb(82, 113, 255)","rgb(255, 145, 77)","rgb(126, 217, 87)","rgb(255, 222, 89)","rgb(203, 108, 230)","rgba(0, 0, 0, 0)"]),n=M.div`
|
|
2
|
-
display: inline-block;
|
|
3
|
-
width: 30px;
|
|
4
|
-
height: 30px;
|
|
5
|
-
border-radius: 3px;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
box-shadow: 0 0 2px rgba(16, 22, 26, 0.3);
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
`,e=x=>{let{color:i,children:p}=x;return o(n,{...x,style:{background:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 8 8'%3E%3Cg fill='rgba(112, 112, 116, 1)' fill-opacity='1'%3E%3Cpath fill-rule='evenodd' d='M0 0h4v4H0V0zm4 4h4v4H4V4z'/%3E%3C/g%3E%3C/svg%3E")`},children:o("div",{style:{width:"100%",height:"100%",background:i},children:p})})},h=x=>{r.replace(x)},d=a(({store:x})=>s("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[s("div",{style:{display:"flex",justifyContent:"space-around",paddingBottom:10,alignItems:"center"},children:[o(t,{store:x}),r.map(i=>o(e,{color:i,onClick:()=>{}},i))]}),o(w,{images:l,isLoading:!1,getPreview:i=>i,loadMore:!1,onSelect:i=>{console.log(i)}})]}));export{h as a,d as b};
|
package/dist/chunk-XK24AOVW.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import{a as T}from"./chunk-XM3RPIUS.js";import{a as x}from"./chunk-Q2L6VKFI.js";import{a as o}from"./chunk-VXTF2OL2.js";import{a as P}from"./chunk-OV74NBJ5.js";import{a as u}from"./chunk-CMH73CYQ.js";import{a as h}from"./chunk-DBQHEZPG.js";import{b as S}from"./chunk-WGX437MN.js";import{c as l,d as m}from"./chunk-WCHGSVUC.js";import{a as y}from"./chunk-AGNRQAPA.js";import{a as f}from"./chunk-DJBTBRPS.js";import a from"styled-components";import{useRef as g,useLayoutEffect as C}from"react";import{observer as i}from"mobx-react-lite";import{LayoutTemplate as z,TypeOutline as L,Image as N,Shapes as M,Upload as B,Wallpaper as H,Layers as I,ImageUpscale as E}from"lucide-react";import{clsx as R}from"clsx";import{jsx as n,jsxs as p}from"react/jsx-runtime";var U=a.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100% !important;
|
|
4
|
-
padding: 0px !important;
|
|
5
|
-
position: relative;
|
|
6
|
-
|
|
7
|
-
&.bp5-navbar {
|
|
8
|
-
box-shadow: none;
|
|
9
|
-
}
|
|
10
|
-
`,$=a.div`
|
|
11
|
-
@media screen and (min-width: 501px) {
|
|
12
|
-
overflow-y: auto;
|
|
13
|
-
overflow-x: hidden;
|
|
14
|
-
min-width: 72px;
|
|
15
|
-
}
|
|
16
|
-
`,D=a.div`
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
`,F=a.div`
|
|
20
|
-
padding: 10px 10px 0px 10px !important;
|
|
21
|
-
height: 100% !important;
|
|
22
|
-
|
|
23
|
-
&.bp5-navbar {
|
|
24
|
-
width: 350px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&.bp5-navbar.collapsed {
|
|
28
|
-
width: 0px;
|
|
29
|
-
}
|
|
30
|
-
`,O=a.div`
|
|
31
|
-
display: none;
|
|
32
|
-
${l(`
|
|
33
|
-
position: absolute;
|
|
34
|
-
bottom: 72px;
|
|
35
|
-
display: block;
|
|
36
|
-
width: 100vw;
|
|
37
|
-
height: 100vh;
|
|
38
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
39
|
-
`)}
|
|
40
|
-
`,W=a.div`
|
|
41
|
-
position: absolute;
|
|
42
|
-
right: 1px;
|
|
43
|
-
top: 50%;
|
|
44
|
-
height: 96px;
|
|
45
|
-
width: 15px;
|
|
46
|
-
fill: white;
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
z-index: 10;
|
|
49
|
-
transform: translate(100%, -50%);
|
|
50
|
-
|
|
51
|
-
${l(`
|
|
52
|
-
display: none;
|
|
53
|
-
`)}
|
|
54
|
-
`,A=({onClick:e})=>n(W,{onClick:e,children:n("div",{children:p("button",{className:"grid relative justify-center arrow cursor-pointer",children:[p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 96",width:"13",height:"96",fill:"none",children:[n("path",{d:"M0,0 h1 c0,20,12,12,12,32 v32 c0,20,-12,12,-12,32 H0 z",className:"fill-white dark:fill-[#0b0809]"}),n("path",{d:"M0.5,0 c0,20,12,12,12,32 v32 c0,20,-12,12,-12,32",className:"fill-white stroke-gray-200 dark:fill-[#0b0809] dark:stroke-[#0b0809]"})]}),n("div",{className:"absolute self-center",children:n("span",{className:"w-3 h-3 text-block inline-flex items-center box-border dark:text-white",children:n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",children:n("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.25",d:"M7 3.17 4.88 5.3a1 1 0 0 0 0 1.42L7 8.83"})})})})]})})}),_={name:"templates",Tab:i(e=>n(o,{name:"templates",...e,children:n(z,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(P,{store:e})},j={name:"text",Tab:i(e=>n(o,{name:"text",...e,children:n(L,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(u,{store:e})},q={name:"photos",Tab:i(e=>n(o,{name:"photos",...e,children:n(N,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(f,{store:e})},G={name:"shapes",Tab:i(e=>n(o,{name:"shapes",...e,children:n(M,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(T,{store:e})},J={name:"upload",Tab:i(e=>n(o,{name:"upload",...e,children:n(B,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(h,{store:e})},K={name:"background",Tab:i(e=>n(o,{name:"background",...e,children:n(H,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(S,{store:e})},Q={name:"layers",Tab:i(e=>n(o,{name:"layers",...e,children:n(I,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(y,{store:e})},V={name:"size",Tab:i(e=>n(o,{name:"size",...e,children:n(E,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(x,{store:e})},X=[_,j,q,G,J,K,Q,V],Y=i(({store:e,sections:v,defaultSection:c="templates"})=>{(()=>{let t=g(!0);t.current&&(t.current=!1,e.openSidePanel(c))})();let r=m();C(()=>{r?e.openSidePanel(""):e.openSidePanel(c)},[r]);let d=[...v||X].filter(t=>t.visibleInList!==!1),b=d.find(t=>t.name===e.openedSidePanel)?.Panel,k=g(null);return p(U,{className:`bp5-navbar design-side-panel ${e.openedSidePanel?"":"collapsed"}`,children:[n($,{className:"design-side-tabs-container border-r-1 border-gray-200 dark:border-gray-800",ref:k,children:n(D,{className:"design-side-tabs-inner",children:d.map(({name:t,Tab:s})=>n(s,{name:t,onClick:()=>{t===e.openedSidePanel?e.openSidePanel(""):e.openSidePanel(t)},active:e.openedSidePanel===t},t))})}),b&&n(F,{className:R("bp5-navbar design-panel-container","border-r-1 border-gray-200 dark:border-gray-800"),onClick:t=>{let s=t.target.closest(".design-close-panel"),w=t.target.closest(".design-mobile");s&&(r||w)&&e.openSidePanel("")},children:n(b,{store:e})}),e.openedSidePanel&&n(O,{onClick:()=>e.openSidePanel("")}),e.openedSidePanel&&n(A,{onClick:()=>e.openSidePanel("")})]})}),Pe=Y;export{_ as a,j as b,q as c,G as d,J as e,K as f,Q as g,V as h,X as i,Y as j,Pe as k};
|
package/dist/chunk-XM3RPIUS.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-MXZ6RXT3.js";import{b as l}from"./chunk-MQZE5LZU.js";import{jsx as e,jsxs as s}from"react/jsx-runtime";var h=({store:r})=>{let i=t=>{r.editor?.objectsHandler.createPathElement(t.path)},n=t=>{r.editor?.objectsHandler.createShapeElement(t.type)};return s("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"},className:"no-scrollbar",children:[e("style",{children:`
|
|
2
|
-
.no-scrollbar::-webkit-scrollbar {
|
|
3
|
-
display: none;
|
|
4
|
-
}
|
|
5
|
-
.no-scrollbar {
|
|
6
|
-
-ms-overflow-style: none;
|
|
7
|
-
scrollbar-width: none;
|
|
8
|
-
}
|
|
9
|
-
`}),l.map((t,c)=>s("div",{className:"category",children:[e("div",{className:a("category-name","text-base px-2 mt-2"),children:t.name},t.name),e("div",{className:a("shape-list","flex flex-wrap content-start mb-2"),children:t.children.map((o,m)=>e("div",{className:a("shape-item","w-[25%] h-0 pb-[25%] relative cursor-pointer shrink-0 mb-[1.2%]"),onClick:()=>{o.type?n(o):i(o)},children:e("div",{className:a("shape-content","absolute inset-0 flex justify-center items-center"),children:e("svg",{overflow:"visible",width:"50",height:"50",children:e("g",{transform:`scale(${50/o.viewBox[0]}, ${50/o.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`,children:e("path",{className:"shape-path",d:o.path,fill:"#ccc",strokeMiterlimit:8,strokeLinecap:"butt"})})})})},m))})]},c))]})};export{h as a};
|
package/dist/chunk-XPAHGJGK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as w}from"./chunk-4HEMGHOQ.js";import{a as C,b as m}from"./chunk-YRJUN267.js";import{a as u}from"./chunk-RVXI723F.js";import{cssGradient2FabricGradient as W}from"@ydesign/core";import{observer as y}from"mobx-react-lite";import{useState as F,useRef as k,useMemo as P}from"react";import{ColorPicker as S,Popover as B,Button as g,InputNumber as x,Slider as b}from"antd";import{Logs as j,Ban as A}from"lucide-react";import{Fragment as _,jsx as e,jsxs as h}from"react/jsx-runtime";var n=r=>r?typeof r=="string"?r:r.colorStops?JSON.stringify(r.colorStops):JSON.stringify(r):"",D=y(({store:r,elements:t})=>{let o=t[0],[c,d]=F(()=>u(o.fill)),a=k(!1),s=k(n(o.fill)),p=n(o.fill);p!==s.current&&!a.current&&(s.current=p,d(u(o.fill)));let f=P(()=>c,[n(c)]);return e(S,{value:f,allowClear:!0,mode:["single","gradient"],onOpenChange:i=>{a.current=i,i||(s.current=n(o.fill))},onChange:i=>{d(i)},onChangeComplete:i=>{let l=i.toCssString();if(l.includes("gradient")){let v=W(l);r.editor?.objectsHandler.update({fill:v})}else r.editor?.objectsHandler.update({fill:l})}})}),H=y(({store:r,element:t})=>(console.log("element ---> ",t),e(B,{trigger:"click",content:h("div",{style:{width:270},children:[h("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:15},children:[e(g,{color:t?.strokeWidth===0?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeWidth:0}),r._triggerUpdate()},children:e(A,{size:16})}),e(g,{color:t?.strokeWidth&&t?.strokeDashArray?.length===0?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeDashArray:[],strokeWidth:t?.strokeWidth||10,stroke:t?.stroke||"#000000"}),r._triggerUpdate()},children:e("svg",{width:16,height:16,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x2:24,y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})})}),e(g,{color:t?.strokeWidth&&Array.isArray(t.strokeDashArray)&&t.strokeDashArray[0]===4?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeDashArray:[4,1],strokeWidth:t?.strokeWidth||10,stroke:t?.stroke||"#000000"}),r._triggerUpdate()},children:e("svg",{width:16,height:16,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})})}),e(g,{color:t?.strokeWidth&&Array.isArray(t.strokeDashArray)&&t.strokeDashArray[0]===2?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeDashArray:[2,1],strokeWidth:t?.strokeWidth||10,stroke:t?.stroke||"#000000"}),r._triggerUpdate()},children:e("svg",{width:16,height:16,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})})}),e(g,{color:t?.strokeWidth&&Array.isArray(t.strokeDashArray)&&t.strokeDashArray[0]===1?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeDashArray:[1,1],strokeWidth:t?.strokeWidth||10,stroke:t?.stroke||"#000000"}),r._triggerUpdate()},children:e("svg",{width:16,height:16,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]}),h("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:5},children:[e("div",{children:"Stroke Width"}),e("div",{children:e(x,{value:t?.strokeWidth,style:{width:60},min:0,max:Math.round(Math.min(t?.width,t?.height)/2),onChange:o=>{r.editor?.objectsHandler.update({strokeWidth:o}),r._triggerUpdate()}})})]}),e(b,{value:t?.strokeWidth,onChange:o=>{r.editor?.objectsHandler.update({strokeWidth:o}),r._triggerUpdate()},min:0,max:Math.round(Math.min(t?.width,t?.height)/2)}),t?.type==="rect"&&h(_,{children:[h("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:15,paddingBottom:5},children:[e("div",{children:"Corner Radius"}),e("div",{children:e(x,{value:t?.rx,style:{width:60},min:0,max:Math.round(Math.min(t?.width,t?.height)/2),onChange:o=>{r.editor?.objectsHandler.update({rx:o,ry:o}),r._triggerUpdate()}})})]}),e(b,{value:t?.rx,onChange:o=>{r.editor?.objectsHandler.update({rx:o,ry:o}),r._triggerUpdate()},min:0,max:Math.round(Math.min(t?.width,t?.height)/2)})]})]}),children:e(g,{type:"text",styles:{root:{padding:"0 7px"}},icon:e(j,{size:16,style:{display:"flex"}}),children:"Stroke settings"})}))),R=y(({store:r,elements:t})=>{let o=t[0],[c,d]=F(()=>u(o?.stroke)),a=k(!1),s=k(n(o?.stroke)),p=n(o?.stroke);p!==s.current&&!a.current&&(s.current=p,d(u(o?.stroke)));let f=P(()=>c,[n(c)]);return o?.strokeWidth?e(S,{value:f,allowClear:!0,mode:["single","gradient"],onOpenChange:i=>{a.current=i,i||(s.current=n(o.stroke))},onChange:i=>{d(i)},onChangeComplete:i=>{let l=i.toCssString();if(l.includes("gradient")){let v=W(l);r.editor?.objectsHandler.update({stroke:v})}else r.editor?.objectsHandler.update({stroke:l})}}):null}),M={FigureFill:D,FigureStroke:R,FigureSettings:H,FigureFilters:w},L=y(({store:r,components:t})=>{let o=r.selectedElements[0],d=C({type:"figure",usedItems:["FigureFill","FigureStroke","FigureSettings","FigureFilters"],components:t});return e(m,{items:d,itemRender:a=>{let s=t[a]||M[a];return s&&e(s,{elements:r.selectedElements,element:o,store:r},a)}})});export{n as a,D as b,H as c,R as d,L as e};
|