@ydesign/react-editor 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/app.css +2 -2
  2. package/dist/app.d.ts +4 -4
  3. package/dist/app.js +1 -1
  4. package/dist/canvas/workspace-canvas.js +1 -1
  5. package/dist/canvas/workspace.js +1 -1
  6. package/dist/{chunk-TNBL7KOG.js → chunk-2A3HHQ7X.js} +1 -1
  7. package/dist/{chunk-OA7Z7HNL.js → chunk-2T3O5ZZ2.js} +1 -1
  8. package/dist/{chunk-QX7ZGRSR.js → chunk-5OA2JYPB.js} +1 -1
  9. package/dist/chunk-5X6VER6G.js +1 -0
  10. package/dist/{chunk-HD2T2D4D.js → chunk-62YF5KTO.js} +1 -1
  11. package/dist/{chunk-HQSM4X2M.js → chunk-7YLSIB43.js} +1 -1
  12. package/dist/{chunk-2XCWXNZD.js → chunk-A7SUGNOW.js} +1 -1
  13. package/dist/{chunk-4WITBL6X.js → chunk-AC6CCGZH.js} +1 -1
  14. package/dist/{chunk-OFA6JIQB.js → chunk-DGCF2GDA.js} +1 -1
  15. package/dist/{chunk-FGCLY24Q.js → chunk-HHYPIHAP.js} +1 -1
  16. package/dist/chunk-IV52R7D7.js +27 -0
  17. package/dist/{chunk-INRJE7VS.js → chunk-J6PYM4EV.js} +1 -1
  18. package/dist/{chunk-NQYSJ5MN.js → chunk-JPIYZYMQ.js} +1 -1
  19. package/dist/chunk-JUVJJS4T.js +54 -0
  20. package/dist/chunk-KKA7WASQ.js +16 -0
  21. package/dist/{chunk-4BG4CHIB.js → chunk-KVT25LDU.js} +1 -1
  22. package/dist/chunk-NDZKXZQ2.js +3 -0
  23. package/dist/chunk-O56ZNYGR.js +1 -0
  24. package/dist/{chunk-TWH7TO5J.js → chunk-O73AAP2K.js} +1 -1
  25. package/dist/chunk-OPXS6VQ6.js +151 -0
  26. package/dist/{chunk-FOMWIGAQ.js → chunk-POCSL7OS.js} +1 -1
  27. package/dist/chunk-POWRXH5R.js +1 -0
  28. package/dist/{chunk-XXR5YN2B.js → chunk-PSO4W6J7.js} +1 -1
  29. package/dist/{chunk-IPOZDTK2.js → chunk-QWM7VMLQ.js} +1 -1
  30. package/dist/{chunk-2PAJLUQH.js → chunk-RSKWMPST.js} +1 -1
  31. package/dist/chunk-SGK2XN5D.js +1 -0
  32. package/dist/{chunk-KCNKLCD5.js → chunk-T3TEB73P.js} +1 -1
  33. package/dist/{chunk-R452ARGU.js → chunk-TS5CKDHH.js} +1 -1
  34. package/dist/chunk-TTHQXTIX.js +1 -0
  35. package/dist/{chunk-TYHXQPZQ.js → chunk-TTK5Z2Z6.js} +1 -1
  36. package/dist/{chunk-DCGJ6RKU.js → chunk-TZ6B7XDS.js} +1 -1
  37. package/dist/chunk-XA2G4P2Q.js +1 -0
  38. package/dist/{chunk-ARZMBVXU.js → chunk-YCFED7XQ.js} +1 -1
  39. package/dist/chunk-YCJBBRRT.js +1 -0
  40. package/dist/{chunk-YOQ663QO.js → chunk-YVBVDUVA.js} +1 -1
  41. package/dist/config.d.ts +1 -0
  42. package/dist/config.js +1 -1
  43. package/dist/model/store.d.ts +27 -17
  44. package/dist/model/store.js +1 -1
  45. package/dist/project.d.ts +5 -0
  46. package/dist/project.js +1 -1
  47. package/dist/side-panel/background-panel.js +1 -1
  48. package/dist/side-panel/images-grid.js +1 -1
  49. package/dist/side-panel/index.js +1 -1
  50. package/dist/side-panel/layers-panel.js +1 -1
  51. package/dist/side-panel/photos-panel.js +1 -1
  52. package/dist/side-panel/shapes-panel.js +1 -1
  53. package/dist/side-panel/side-panel.js +1 -1
  54. package/dist/side-panel/size-panel.js +1 -1
  55. package/dist/side-panel/templates-panel.js +1 -1
  56. package/dist/side-panel/text-panel.js +1 -1
  57. package/dist/side-panel/upload-panel.js +1 -1
  58. package/dist/toolbar/default-toolbar.js +1 -1
  59. package/dist/toolbar/download-button.js +1 -1
  60. package/dist/toolbar/duplicate-button.js +1 -1
  61. package/dist/toolbar/figure-toolbar.js +1 -1
  62. package/dist/toolbar/filters-picker.js +1 -1
  63. package/dist/toolbar/flip-button.js +1 -1
  64. package/dist/toolbar/group-button.js +1 -1
  65. package/dist/toolbar/history-buttons.js +1 -1
  66. package/dist/toolbar/image-eraser-pen.js +1 -1
  67. package/dist/toolbar/image-remove-background.js +1 -1
  68. package/dist/toolbar/image-toolbar.js +1 -1
  69. package/dist/toolbar/lock-button.js +1 -1
  70. package/dist/toolbar/opacity-picker.js +1 -1
  71. package/dist/toolbar/position-picker.js +1 -1
  72. package/dist/toolbar/remove-button.js +1 -1
  73. package/dist/toolbar/text-ai-write.js +1 -1
  74. package/dist/toolbar/text-toolbar.js +1 -1
  75. package/dist/toolbar/toolbar.d.ts +2 -2
  76. package/dist/toolbar/toolbar.js +1 -1
  77. package/dist/topbar/create-design.d.ts +4 -1
  78. package/dist/topbar/create-design.js +1 -1
  79. package/dist/topbar/file-menu.js +1 -1
  80. package/dist/topbar/topbar.js +5 -5
  81. package/dist/utils/api.d.ts +14 -0
  82. package/dist/utils/api.js +1 -0
  83. package/dist/utils/l10n.d.ts +4 -0
  84. package/dist/utils/l10n.js +1 -1
  85. package/dist/utils/use-api.d.ts +2 -0
  86. package/dist/utils/use-api.js +0 -0
  87. package/dist/utils/use-axios.d.ts +5 -0
  88. package/dist/utils/use-axios.js +1 -0
  89. package/package.json +15 -9
  90. package/dist/chunk-EN72YNS7.js +0 -151
  91. package/dist/chunk-ISNCNIFJ.js +0 -27
  92. package/dist/chunk-LFWKF4C4.js +0 -3
  93. package/dist/chunk-N5KI6CPA.js +0 -1
  94. package/dist/chunk-OBJ5NZSC.js +0 -1
  95. package/dist/chunk-OG4HUTJF.js +0 -16
  96. package/dist/chunk-ONY3GLGA.js +0 -1
  97. package/dist/chunk-PBQY5UTI.js +0 -1
  98. package/dist/chunk-WHYEXY5V.js +0 -54
  99. package/dist/chunk-YLXPQ2GI.js +0 -1
@@ -1,151 +0,0 @@
1
- import{b as I,c as p}from"./chunk-5C2MNUBC.js";import{a as y}from"./chunk-MXZ6RXT3.js";import{Modal as Q,Button as Y,ColorPicker as ee,InputNumber as L,Select as ie,Tooltip as te}from"antd";import{Grid2X2 as ne,Star as oe,ShoppingBag as se,FileText as ae,Presentation as ce,Share2 as de,Printer as le,ImagePlus as re,FolderPlus as t,LockKeyholeOpen as pe,LockKeyhole as he}from"lucide-react";import{useRef as me,useState as l,useMemo as W,useCallback as h}from"react";import z from"styled-components";import{jsx as e,jsxs as a}from"react/jsx-runtime";var xe=[{key:"all",label:"\u5168\u90E8",icon:ne},{key:"common",label:"\u5E38\u7528\u5C3A\u5BF8",icon:oe},{key:"ecommerce",label:"\u7535\u5546\u7269\u6599",icon:se},{key:"office",label:"\u884C\u653F\u529E\u516C",icon:ae},{key:"presentation",label:"\u6F14\u793A\u6587\u7A3F",icon:ce},{key:"social",label:"\u793E\u4EA4\u5A92\u4F53",icon:de},{key:"print",label:"\u5370\u5237\u7269\u6599",icon:le}],R=[{key:"common",label:"\u5E38\u7528\u5C3A\u5BF8",sizes:[{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",desc:"1440x1440px",width:1440,height:1440,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",desc:"800x800px",width:800,height:800,unit:"px"},{icon:e(t,{size:24}),name:"\u624B\u673A\u6D77\u62A5",desc:"1242x2208px",width:1242,height:2208,unit:"px"},{icon:e(t,{size:24}),name:"\u5C0F\u7EA2\u4E66\u5C01\u9762",desc:"1242x1656px",width:1242,height:1656,unit:"px"},{icon:e(t,{size:24}),name:"\u7AD6\u7248\u89C6\u9891\u5C01\u9762",desc:"1080x1920px",width:1080,height:1920,unit:"px"},{icon:e(t,{size:24}),name:"PPT\uFF0816:9\uFF09",desc:"1920x1080px",width:1920,height:1080,unit:"px"}]},{key:"ecommerce",label:"\u7535\u5546\u7269\u6599",sizes:[{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",desc:"1440x1440px",width:1440,height:1440,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",desc:"800x800px",width:800,height:800,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF083:4\uFF09",desc:"1440x1920px",width:1440,height:1920,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF083:4\uFF09",desc:"750x1000px",width:750,height:1e3,unit:"px"},{icon:e(t,{size:24}),name:"\u76F4\u64AD\u95F4\u80CC\u666F",desc:"1242x2690px",width:1242,height:2690,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u8BE6\u60C5\u9875",desc:"750x1000px",width:750,height:1e3,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u7AD6\u7248\u6D77\u62A5",desc:"1200x1920px",width:1200,height:1920,unit:"px"}]},{key:"office",label:"\u884C\u653F\u529E\u516C",sizes:[{icon:e(t,{size:24}),name:"\u7B80\u5386",desc:"2480x3507px",width:2480,height:3507,unit:"px"},{icon:e(t,{size:24}),name:"\u5DE5\u724C\u5DE5\u4F5C\u8BC1",desc:"709x1087px",width:709,height:1087,unit:"px"},{icon:e(t,{size:24}),name:"\u5956\u72B6\u8BC1\u4E66",desc:"3437x2550px",width:3437,height:2550,unit:"px"}]},{key:"presentation",label:"\u6F14\u793A\u6587\u7A3F",sizes:[{icon:e(t,{size:24}),name:"PPT\uFF0816:9\uFF09",desc:"1920x1080px",width:1920,height:1080,unit:"px"},{icon:e(t,{size:24}),name:"PPT\uFF084:3\uFF09",desc:"1024x768px",width:1024,height:768,unit:"px"}]},{key:"social",label:"\u793E\u4EA4\u5A92\u4F53",sizes:[{icon:e(t,{size:24}),name:"\u624B\u673A\u6D77\u62A5",desc:"1242x2208px",width:1242,height:2208,unit:"px"},{icon:e(t,{size:24}),name:"\u624B\u673A\u5168\u5C4F\u6D77\u62A5",desc:"1242x2688px",width:1242,height:2688,unit:"px"},{icon:e(t,{size:24}),name:"\u7AD6\u7248\u89C6\u9891\u5C01\u9762",desc:"1080x1920px",width:1080,height:1920,unit:"px"},{icon:e(t,{size:24}),name:"\u6A2A\u7248\u89C6\u9891\u5C01\u9762",desc:"1920x1080px",width:1920,height:1080,unit:"px"},{icon:e(t,{size:24}),name:"\u5C0F\u7EA2\u4E66\u5C01\u9762",desc:"1242x1656px",width:1242,height:1656,unit:"px"},{icon:e(t,{size:24}),name:"\u6296\u97F3\u56FE\u6587\u5E26\u8D27",desc:"1242x1656px",width:1242,height:1656,unit:"px"},{icon:e(t,{size:24}),name:"\u516C\u4F17\u53F7\u9996\u56FE",desc:"900x383px",width:900,height:383,unit:"px"},{icon:e(t,{size:24}),name:"\u516C\u4F17\u53F7\u6B21\u56FE",desc:"900x800px",width:900,height:800,unit:"px"},{icon:e(t,{size:24}),name:"\u957F\u56FE\u6D77\u62A5",desc:"800x2000px",width:800,height:2e3,unit:"px"}]},{key:"print",label:"\u5370\u5237\u7269\u6599",sizes:[{icon:e(t,{size:24}),name:"\u4E00\u5BF8\u8BC1\u4EF6\u7167",desc:"23x35mm",width:25,height:35,unit:"mm"},{icon:e(t,{size:24}),name:"\u4E8C\u5BF8\u8BC1\u4EF6\u7167",desc:"35x53mm",width:35,height:53,unit:"mm"},{icon:e(t,{size:24}),name:"1.8\u7C73\u5C55\u67B6",desc:"80x180cm",width:80,height:180,unit:"cm"},{icon:e(t,{size:24}),name:"2m\u6613\u62C9\u5B9D",desc:"80x200cm",width:80,height:200,unit:"cm"},{icon:e(t,{size:24}),name:"\u540D\u7247",desc:"96x60mm",width:96,height:60,unit:"mm"},{icon:e(t,{size:24}),name:"\u4F18\u60E0\u5238",desc:"186x66mm",width:186,height:66,unit:"mm"},{icon:e(t,{size:24}),name:"\u4F20\u5355",desc:"216x291cm",width:216,height:291,unit:"cm"}]}],D=z.div`
2
- padding: 16px 24px;
3
- height: 60px;
4
- flex: 1;
5
- display: flex;
6
- cursor: pointer;
7
- align-items: center;
8
- border-radius: 8px;
9
- border: 1px dashed #d0d2d6;
10
- &:hover {
11
- background-color: rgba(0, 31, 92, 0.06);
12
- }
13
- span {
14
- margin-left: 8px;
15
- }
16
- `,ge=z.div`
17
- flex: 1;
18
- margin-left: 14px;
19
- height: 100%;
20
-
21
- .createrContentInner {
22
- margin-bottom: 16px;
23
- }
24
-
25
- .scrollbars div:first-child {
26
- scroll-behavior: smooth;
27
- }
28
-
29
- .Widget.categorySection[data-is-folded='false'] .categoryFoldBtn,
30
- .Widget.categorySection[data-is-multi-row='false'] .categoryFoldBtn {
31
- display: none;
32
- }
33
-
34
- .Widget.categorySection[data-is-folded='true'] ul {
35
- height: 97px;
36
- overflow: hidden;
37
- }
38
- `,ue=z.div`
39
- width: 100%;
40
- height: 100%;
41
- position: relative;
42
- padding-top: 16px;
43
- overflow: hidden;
44
-
45
- display: flex;
46
- flex-direction: column;
47
- align-items: center;
48
-
49
- border-radius: 8px;
50
- background-color: #f6f7fa;
51
-
52
- .canvasSizeName {
53
- color: #616366;
54
- font-size: 12px;
55
- font-weight: 600;
56
- line-height: 16px;
57
- margin-top: 8px;
58
- }
59
-
60
- .canvasSizeSize {
61
- height: 14px;
62
- overflow: hidden;
63
- width: 100%;
64
- margin-top: 4px;
65
-
66
- span {
67
- color: #abadb2;
68
- display: block;
69
- font-size: 20px;
70
- font-weight: 400;
71
- height: 200%;
72
- line-height: 26px;
73
- text-align: center;
74
- -webkit-transform: scale(0.5);
75
- transform: scale(0.5);
76
- -webkit-transform-origin: top left;
77
- transform-origin: top left;
78
- width: 200%;
79
- }
80
- }
81
-
82
- .canvasSizeMask {
83
- background: rgba(0, 0, 0, 0.25);
84
- display: none;
85
- height: 100%;
86
- left: 0;
87
- position: absolute;
88
- top: 0;
89
- width: 100%;
90
- }
91
- .canvasSizeMask,
92
- .canvasSizeMask button {
93
- justify-content: center;
94
- align-items: center;
95
- }
96
-
97
- .canvasSizeMask button {
98
- background-color: #fff;
99
- width: 66px;
100
- height: 26px;
101
- display: flex;
102
- padding: 0 8px;
103
- outline: none;
104
- line-height: 16px;
105
- font-size: 12px;
106
- cursor: pointer;
107
- color: #1c1d1f;
108
- border-radius: 6px;
109
- }
110
- .canvasSizeMask button:active {
111
- background-color: #f2f2f2;
112
- }
113
-
114
- &:hover .canvasSizeMask {
115
- display: flex;
116
- }
117
- `,fe=z.div`
118
- display: flex;
119
- margin-top: 20px;
120
- flex-wrap: wrap;
121
- align-items: center;
122
- position: relative;
123
-
124
- .sizeWarning {
125
- width: 100%;
126
- margin-bottom: 8px;
127
- padding: 4px 8px;
128
- font-size: 12px;
129
- color: #ff4d4f;
130
- background-color: #fff2f0;
131
- border: 1px solid #ffccc7;
132
- border-radius: 4px;
133
- }
134
-
135
- .Widget.sizeInpueBox {
136
- display: flex;
137
- align-items: center;
138
-
139
- flex: 1;
140
- }
141
-
142
- .Widget.sizeInpueBox .sizeInput {
143
- flex: 1;
144
- }
145
- .Widget.sizeInpueBox .linkIcon {
146
- padding: 8px;
147
- background-color: #001f5c0f;
148
- border-radius: 8px;
149
- margin: 0 4px;
150
- }
151
- `,r=72,v=20,b=8e3,Ce=({visible:E,onClose:F,onConfirm:H})=>{let[M,_]=l("all"),B=me(null),[o,w]=l(null),[s,k]=l(null),[c,$]=l("px"),[d,O]=l(!1),[m,U]=l(1),[x,V]=l("#ffffff"),C=W(()=>o?p({unitVal:o,dpi:r,unit:c}):0,[o,c]),S=W(()=>s?p({unitVal:s,dpi:r,unit:c}):0,[s,c]),N=o!=null&&s!=null&&o>0&&s>0,g=N&&(C>b||S>b),u=N&&(C<v||S<v),P=!N||g||u,T=g?`\u8D85\u51FA\u753B\u5E03\u5C3A\u5BF8\u9650\u5236\uFF1A${b} * ${b} px`:u?`\u4F4E\u4E8E\u753B\u5E03\u5C3A\u5BF8\u9650\u5236\uFF1A${v} * ${v} px`:"",A=h(i=>{w(i),d&&i&&i>0&&k(Math.round(i/m))},[d,m]),X=h(i=>{k(i),d&&i&&i>0&&w(Math.round(i*m))},[d,m]),K=h(()=>{!d&&o&&s&&o>0&&s>0&&U(o/s),O(i=>!i)},[d,o,s]),Z=h(i=>{if(o){let n=p({unitVal:o,dpi:r,unit:c});w(Math.round(I({px:n,dpi:r,unit:i,precious:0})))}if(s){let n=p({unitVal:s,dpi:r,unit:c});k(Math.round(I({px:n,dpi:r,unit:i,precious:0})))}$(i)},[o,s,c]),j=h(()=>{if(P)return;let i=JSON.stringify({bg:{backgroundColor:x}}),n=new URLSearchParams({create:"",createEmptyPoster:"true",createInfo:i,height:String(s),unit:c,width:String(o)});window.open(`/?${n.toString()}`,"_blank")},[P,x,S,C,c]),q=i=>{_(i);let n=B.current;if(!n)return;let f=n.querySelector(`[data-category-id="${i}"]`);f&&n.scrollTo({top:f.offsetTop,behavior:"smooth"})},[G,J]=l(()=>{let i={};return R.forEach(n=>{i[n.key]=n.sizes.length>6}),i});return a(Q,{title:"\u521B\u5EFA\u8BBE\u8BA1",open:E,onCancel:F,footer:null,width:880,mask:{closable:!1},styles:{body:{display:"flex",flex:1,padding:"20px 0",height:"100%"},container:{height:550}},children:[e("div",{className:"createrSideBar",style:{width:140},children:xe.map(i=>a("div",{"data-active":i.key===M,className:y("createrSideBarItem","flex h-[40px] px-2 mb-2 cursor-pointer rounded-md items-center hover:bg-[#f2f2f2] text-[#333]",{"bg-[#1677ff4d] hover:bg-[#1677ff4d]":i.key===M}),onClick:()=>q(i.key),children:[e(i.icon,{size:16,className:"ml-2"}),e("span",{className:"ml-2",children:i.label})]},i.key))}),e(ge,{children:e("div",{className:"scrollbars",style:{position:"relative",overflow:"hidden",width:"100%",height:"100%"},children:e("div",{ref:B,style:{position:"absolute",inset:0,overflow:"scroll"},children:a("div",{className:"createrContentInner",children:[e("div",{"data-category-id":"all"}),a("div",{className:"openBtns flex",children:[a(D,{onClick:()=>{alert("\u56FE\u7247\u6A21\u5F0F\u5F00\u53D1\u4E2D...")},children:[e(re,{style:{color:"#1677ff"}}),e("span",{children:"\u6253\u5F00\u56FE\u7247"})]}),a(D,{style:{marginLeft:12},onClick:()=>{alert("psd\u5F00\u53D1\u4E2D")},children:[e(t,{style:{color:"#1677ff"}}),e("span",{children:"\u6253\u5F00PSD"})]})]}),R.map(i=>a("div",{className:y("Widget categorySection","mt-6"),"data-category-id":i.key,"data-is-folded":G[i.key]??!1,"data-is-multi-row":i.sizes.length>6,children:[a("div",{className:y("categoryHeader","flex items-center justify-between"),children:[e("div",{className:"categoryTitle text-sm font-semibold",children:i.label}),e("div",{className:"categoryFoldBtn flex items-center cursor-pointer",onClick:()=>J(n=>({...n,[i.key]:!1})),children:e("span",{className:"text-[#616366]",children:"\u67E5\u770B\u66F4\u591A"})})]}),i.key==="common"&&a(fe,{children:[T&&e("div",{className:"sizeWarning",children:T}),a("div",{className:"Widget sizeInpueBox",children:[e("div",{className:"sizeInput",children:e(L,{prefix:"\u5BBD",value:o,min:0,precision:0,status:g||u?"error":void 0,onChange:A,styles:{actions:{opacity:1,width:24}},style:{width:"100%"}})}),e(te,{title:d?"\u89E3\u9501\u6BD4\u4F8B":"\u9501\u5B9A\u6BD4\u4F8B",children:e("div",{className:"linkIcon",style:{cursor:"pointer"},onClick:K,children:d?e(he,{size:16}):e(pe,{size:16})})}),e("div",{className:"sizeInput",children:e(L,{prefix:"\u9AD8",value:s,min:0,precision:0,status:g||u?"error":void 0,onChange:X,styles:{actions:{opacity:1,width:24}},style:{width:"100%"}})}),e("div",{className:"sizeUnitSelect",style:{width:98,marginLeft:12},children:e(ie,{value:c,style:{width:98},onChange:Z,options:[{label:"px \u50CF\u7D20",value:"px"},{label:"cm \u5398\u7C73",value:"cm"},{label:"mm \u6BEB\u7C73",value:"mm"}]})})]}),e("div",{className:"widgets-color-picker",style:{width:98,marginLeft:12},children:e(ee,{mode:"single",format:"hex",value:x,onChange:n=>V(n.toHexString()),styles:{root:{width:98},body:{width:92}}})}),e(Y,{type:"primary",disabled:P,style:{width:98,marginLeft:12},onClick:j,children:"\u521B\u5EFA"})]}),e("ul",{className:"flex mt-4 flex-wrap gap-3",children:i.sizes.map((n,f)=>e("li",{style:{width:"calc((100% - 60px) / 6)",height:97},children:a(ue,{children:[n.icon,e("div",{className:"canvasSizeName",children:n.name}),e("div",{className:"canvasSizeSize",children:e("span",{children:n.desc})}),e("div",{className:"canvasSizeMask",onClick:()=>{H({...n,bgColor:x})},children:e("button",{type:"button",children:"\u521B\u5EFA"})})]})},f))})]},i.key))]})})})})]})};export{Ce as a};
@@ -1,27 +0,0 @@
1
- import{a as u}from"./chunk-FOMWIGAQ.js";import{c as l}from"./chunk-ARZMBVXU.js";import{useEffect as k,useState as w}from"react";import{Tabs as Y,Button as m}from"antd";import d from"styled-components";import{Upload as X,Trash as v}from"lucide-react";import{observer as b}from"mobx-react-lite";import{jsx as o,jsxs as p}from"react/jsx-runtime";var C=[{url:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/6160feaaba8103014b0b53b5/81b623c61f379f8b6b59d6e3f63c10c8.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"5.4.2",originX:"center",originY:"center",left:450.5,top:123,width:900,height:245,fill:"rgba(255, 255, 255, 0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,rx:0,ry:0,id:"workarea"},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:450.5,top:192.5,width:886,height:80,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:26,name:"\u5F62\u72B6 1 \u62F7\u8D1D 7",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/df58054a-786a-4882-8436-f5ffed9c9528.png",crossOrigin:"anonymous",filters:[]},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:448.43054900000004,top:88.84094399999998,width:880,height:124.3,fill:"rgba(0, 0, 0, 1)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"SourceHanSansCN-Heavy",fontWeight:"normal",fontSize:110,text:"\u7206\u7B11\u6B63\u5728\u52A0\u8F7D\u4E2D\u2026",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:.14184705951538149,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:27,name:"\u7206\u7B11\u6B63\u5728\u52A0\u8F7D\u4E2D\u2026"}],width:900,height:245}},{url:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/6160feaaba8103014b0b53b5/03d45f72dbd9530e6cdfc2fb063e3b49.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"5.4.2",originX:"center",originY:"center",left:469.5,top:108.5,width:938,height:216,fill:"rgba(255, 255, 255, 0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,rx:0,ry:0,id:"workarea"},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:830,top:110.5,width:171,height:190,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:23,name:"\u5F62\u72B6 1",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/cb0c6b84-25e4-45e5-8d6c-d646e45bd265.png",crossOrigin:"anonymous",filters:[]},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:831.238644,top:98.25498600000003,width:147.76459,height:124.3,fill:"rgba(255, 255, 255, 1)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1.044109,scaleY:1.044109,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"SourceHanSansCN-Heavy",fontWeight:"normal",fontSize:110,text:"+1",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:1,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:24,name:"+1"},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:360.5,top:102,width:719.390864,height:203.227919,fill:"rgba(0, 0, 0, 1)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"SourceHanSansCN-Heavy",fontWeight:"normal",fontSize:179.84771592471296,text:"\u5904\u7406\u6280\u5DE7",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:1,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:25,name:"\u5904\u7406\u6280\u5DE7"}],width:938,height:216}},{url:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/6160feaaba8103014b0b53b5/f8e4c5bfb5bd330058f70c4043c09e6b.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"5.4.2",originX:"center",originY:"center",left:529,top:130.5,width:1057,height:260,fill:"rgba(255, 255, 255, 0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,rx:0,ry:0,id:"workarea"},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:638.5,top:132,width:804,height:227,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:10,name:"\u56FE\u5C42 3",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/43641401-44b3-45f8-96c2-1fcab4030c17.png",crossOrigin:"anonymous",filters:[]},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:124,top:132.5,width:225,height:222,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:12,name:"\u56FE\u5C42 4",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/e34eb0b4-0f90-4370-ab17-8e5dc56004f9.png",crossOrigin:"anonymous",filters:[]},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:129.73850000000004,top:137.67086099999995,width:185.9375,height:158.2,fill:"rgba(0, 0, 0, 1)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"sucaijishi-kft",fontWeight:"normal",fontSize:140,text:"01",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:1,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:13,name:"01"},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:621.209607,top:146.58432800000003,width:640,height:180.8,fill:"rgba(0, 0, 0, 1)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"sucaijishi-kft",fontWeight:"normal",fontSize:160,text:"\u88C5\u4FEE\u653B\u7565",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:1,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:14,name:"\u88C5\u4FEE\u653B\u7565"}],width:1057,height:260}},{url:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/6160feaaba8103014b0b53b5/3cf5e63e6fb22ea8c1dc2178667468e4.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"5.4.2",originX:"center",originY:"center",left:430,top:120,width:859,height:239,fill:"rgba(255, 255, 255, 0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,rx:0,ry:0,id:"workarea"},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:519.5,top:121.5,width:670,height:170,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:105,name:"\u77E9\u5F62 5",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/b293e875-d051-4c57-b0f3-eadebd23ef43.png",crossOrigin:"anonymous",filters:[]},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:122.5,top:120,width:242,height:239,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:98,name:"\u77E9\u5F62 41",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/8ccee46c-474f-4a72-8084-a92e3cf5cf4a.png",crossOrigin:"anonymous",filters:[]},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:505.27964199999997,top:127.623694,width:480,height:135.6,fill:"rgba(1.989, 1.989, 1.989, 1)",stroke:null,strokeWidth:0,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"Chusung",fontWeight:"normal",fontSize:120,text:"\u4ECA\u65E5\u5FC3\u60C5",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:1,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:106,name:"\u4ECA\u65E5\u5FC3\u60C5"}],width:859,height:239}},{url:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/6160feaaba8103014b0b53b5/5faf22fa36d4eb06d46d687b5ac9084c.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"5.4.2",originX:"center",originY:"center",left:555,top:89,width:1109,height:177,fill:"rgba(255, 255, 255, 0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,rx:0,ry:0,id:"workarea"},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:77.5,top:84.5,width:142,height:138,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:757,name:"\u5F62\u72B6 1",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/5c409304-a874-49b0-a8f7-aea1bfb4d328.png",crossOrigin:"anonymous",filters:[]},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:621.1910109999999,top:99.545797,width:938.019295,height:151.423115,fill:"rgba(255, 255, 255, 1)",stroke:"rgba(0, 0, 0, 1)",strokeWidth:5,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"TsangerYuYangT-W05",fontWeight:"normal",fontSize:134.002756467618,text:"\u56DB\u516D\u7EA7\u9AD8\u6548\u5907\u8003",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:.6959459459459459,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:755,name:"\u56DB\u516D\u7EA7\u9AD8\u6548\u5907\u8003"}],width:1109,height:177}},{url:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/6160feaaba8103014b0b53b5/5bf739287bc1b2f2279709e93453c753.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"5.4.2",originX:"center",originY:"center",left:597.5,top:260.5,width:1194,height:520,fill:"rgba(255, 255, 255, 0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,rx:0,ry:0,id:"workarea"},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:132,top:277,width:243,height:419,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:761,name:"\u56FE\u5C42 8",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/25561fa8-4af2-498a-805c-9cd1f85b001c.png",crossOrigin:"anonymous",filters:[]},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:1060.5,top:277,width:244,height:419,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:762,name:"\u56FE\u5C42 9",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/de0e0cbe-900c-43c3-b8bd-55a4080fd8c1.png",crossOrigin:"anonymous",filters:[]},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:594,top:277.5,width:809.75799,height:428.27,fill:"rgba(0, 0, 0, 1)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"SourceHanSerifCN-Bold",fontWeight:"normal",fontSize:113,text:`BEST
2
- OF THE YEAR
3
- -2024-`,underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:1.176991150442478,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:763,name:"BEST OF THE YEAR -2024-"}],width:1194,height:520}},{url:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/6160feaaba8103014b0b53b5/0d1c4158adb5b365cfdc07e874a3a8ff.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"5.4.2",originX:"center",originY:"center",left:474.5,top:172,width:948,height:343,fill:"rgba(255, 255, 255, 0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,rx:0,ry:0,id:"workarea"},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:504,top:197,width:841,height:239,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:948,name:"\u77E9\u5F62 1",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/bbac0b0e-0a17-4182-be4b-16f4fc1f3545.png",crossOrigin:"anonymous",filters:[]},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:97.5,top:90,width:212,height:211,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:961,name:"\u77E9\u5F62 2 \u62F7\u8D1D",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/c17d7ced-0b31-41d9-9987-7028658dbef2.png",crossOrigin:"anonymous",filters:[]},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:503.5,top:197,width:708,height:200.01,fill:"rgba(0, 0, 0, 1)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"TsangerYuYangT-W05",fontWeight:"normal",fontSize:177,text:"\u5E72\u8D27\u5206\u4EAB",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:.08135593220338984,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:962,name:"\u5E72\u8D27\u5206\u4EAB"}],width:948,height:343}},{url:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/6160feaaba8103014b0b53b5/3ecefb713c4ef1e0aba8a39c1d4890c0.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"5.4.2",originX:"center",originY:"center",left:436.5,top:100.0000005,width:872,height:199,fill:"rgba(255, 255, 255, 0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,rx:0,ry:0,id:"workarea"},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:486,top:94.0000005,width:767,height:163,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:973,name:"\u77E9\u5F62 3",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/42611a3a-c771-4d7f-aca7-823e52f2da72.png",crossOrigin:"anonymous",filters:[]},{type:"image",version:"5.4.2",originX:"center",originY:"center",left:100,top:100.0000005,width:199,height:199,fill:"rgb(0,0,0)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:970,name:"\u56FE\u5C42 2",src:"https://zh.gtimg.com/m-1/atom-parser/psd/new-upload-parse-only/6160feaaba8103014b0b53b5/workflow/58f14952-740b-4c7c-9930-398e1f74ff72.png",crossOrigin:"anonymous",filters:[]},{type:"textbox",version:"5.4.2",originX:"center",originY:"center",left:527,top:97.0000005,width:640.840645,height:90.518741,fill:"rgba(0, 0, 0, 1)",stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,fontFamily:"tsanger-yumoW04",fontWeight:"normal",fontSize:80.1050805676651,text:"\u9047\u5230\u8FD9\u4E9B\u8D76\u7D27\u56E4\uFF01",underline:!1,overline:!1,linethrough:!1,textAlign:"center",fontStyle:"normal",lineHeight:.23225806451612904,textBackgroundColor:"",charSpacing:0,styles:[],direction:"ltr",path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",minWidth:20,splitByGrapheme:!1,id:971,name:"\u9047\u5230\u8FD9\u4E9B\u8D76\u7D27\u56E4\uFF01"}],width:872,height:199}}],x=d.div`
4
- height: calc(100vh - 125px);
5
- display: flex;
6
- flex-direction: column;
7
-
8
- .bp5-dark & .polotno-text-preview-plain {
9
- filter: invert(1);
10
- }
11
- `,L=d.div`
12
- height: 100px;
13
- cursor: pointer;
14
- box-shadow: 0 0 5px rgba(16, 22, 26, 0.3);
15
- border-radius: 6px;
16
- background-color: rgba(0, 0, 0, 0.4);
17
- position: relative;
18
- font-size: 25px;
19
- display: flex;
20
- justify-content: center;
21
- align-content: center;
22
- flex-direction: column;
23
- text-align: center;
24
- color: white;
25
- margin-bottom: 10px;
26
- user-select: none;
27
- `,O=t=>new Promise((n,s)=>{let i=new FileReader;i.readAsDataURL(t),i.onload=()=>{n(i.result)},i.onerror=a=>{s(a)}}),S=b(({font:t,onSelect:n,onRemove:s})=>(console.log("font",t),p(L,{style:{fontFamily:t.fontFamily},className:"polotno-font-item",onClick:n,children:[t.fontFamily+" text",o(m,{type:"text",style:{position:"absolute",right:0,bottom:0},onClick:i=>{i.stopPropagation(),s()},children:o(v,{size:16,style:{color:"white"}})})]}))),h=t=>{let{onSelect:n,children:s,...i}=t;return o(m,{type:"text",block:!0,className:"polotno-close-panel",onClick:()=>{n&&n()},...i,children:s})},B=b(({store:t})=>{let[n,s]=w("text");k(()=>{t.loadFont("Roboto")},[]),k(()=>{t.fonts.forEach(e=>t.loadFont(e.fontFamily))},[t.fonts]);let i=e=>{s(e)},a=e=>{let f=e.width||t.width/2,r=e.left||t.width/2-f/2,g=e.top||t.height/2-e.fontSize/2,c=(t.width+t.height)/2160;t.addElement(Object.assign(Object.assign({type:"textbox",fontFamily:"Roboto"},e),{left:r,top:g,width:f,fontSize:e.fontSize*c,splitByGrapheme:!0}))},y=[{key:"text",label:l("sidePanel.text"),children:p(x,{children:[o(h,{style:{marginBottom:"5px",width:"100%",fontSize:"25px",fontFamily:"Roboto",padding:"20px 0"},onSelect:e=>{console.log("e ---> Header",e),a({text:l("sidePanel.headerText"),fontSize:76,fontFamily:"Roboto"})},children:l("sidePanel.createHeader")}),o(h,{style:{marginBottom:"5px",width:"100%",fontSize:"18px",fontFamily:"Roboto",padding:"20px 0"},onSelect:e=>{console.log("e ---> Sub Header",e),a({text:l("sidePanel.subHeaderText"),fontSize:44,fontFamily:"Roboto"})},children:l("sidePanel.createSubHeader")}),o(h,{style:{marginBottom:"5px",width:"100%",fontSize:"14px",fontFamily:"Roboto",padding:"20px 0"},onSelect:e=>{console.log("e ---> Body Text",e),a({text:l("sidePanel.bodyText"),fontSize:30,fontFamily:"Roboto"})},children:l("sidePanel.createBody")}),o(u,{shadowEnabled:!1,images:C,getPreview:e=>e.url,isLoading:!1,error:!1,onSelect:(...e)=>{console.log("args ---> ",e)},itemHeight:150,spacing:10})]})},{key:"myFonts",label:l("sidePanel.myFonts"),children:p("div",{style:{display:"flex",flexDirection:"column",height:"calc(100% - 50px)"},children:[p("label",{htmlFor:"polotno-font-upload",children:[p(m,{block:!0,onClick:()=>{let e=document.querySelector("#polotno-font-upload");e&&e.click()},children:[o(X,{size:16}),l("sidePanel.uploadFont")]}),o("input",{type:"file",accept:".ttf, .otf, .woff, .woff2, .eot",id:"polotno-font-upload",style:{display:"none"},onChange:async e=>{let{target:f}=e,r=f.files?.[0];if(r){console.log(r);let g=await O(r),c=r.name.split(".")[0];t.addFont({fontFamily:c,name:c,url:g})}}})]}),o("div",{style:{paddingTop:"20px",overflow:"auto",height:"100%"},children:t.fonts.map((e,f)=>o(S,{font:e,onSelect:()=>{a({fontSize:80,text:"Cool text",fontFamily:e.fontFamily})},onRemove:()=>{t.find(r=>(r.type==="textbox"&&r.fontFamily===e.fontFamily&&t.set(r,{fontFamily:"Roboto"}),!1)),t.removeFont(e.fontFamily)}},f))})]})}];return o("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:o(Y,{defaultActiveKey:"text",activeKey:n,items:y,onChange:i,styles:{content:{height:"100%"}}})})});export{B as a};
@@ -1,3 +0,0 @@
1
- import{a as C}from"./chunk-TWH7TO5J.js";import{a as k}from"./chunk-4WITBL6X.js";import{a as I}from"./chunk-YOQ663QO.js";import{a as x}from"./chunk-TYHXQPZQ.js";import{b as v}from"./chunk-3TO57JPN.js";import{a as b}from"./chunk-CB23VFSC.js";import{a as l}from"./chunk-MXZ6RXT3.js";import{a as u,b as f}from"./chunk-YRJUN267.js";import{b as y}from"./chunk-DCGJ6RKU.js";import{k as d,l as h}from"./chunk-7NNOHYKX.js";import{c}from"./chunk-ARZMBVXU.js";import{observer as m}from"mobx-react-lite";import{Button as p,Tooltip as P,Popover as S}from"antd";import{Crop as w}from"lucide-react";import F from"styled-components";import{jsx as o}from"react/jsx-runtime";var B=Object.keys(d),E=[{width:300,height:300,fill:"lightgray",stroke:"#0c0c0c",strokeWidth:0,url:""}],T=[];B.forEach(t=>{E.forEach(e=>{T.push(Object.assign({subType:t},e))})});T.forEach(t=>{t.url=b(h(t))});var R=F.div`
2
- height: 220px;
3
- `,g={root:{padding:"0 7px"}},H=m(({element:t,store:e})=>o(p,{type:"text",styles:g,onClick:async()=>{let i=e.width+2*e.bleed,s=e.height+2*e.bleed,r=t.getOriginalSize(),a={width:r.width,height:r.height},n=v({width:i,height:s},a);t.set({cropX:n.cropX,cropY:n.cropY,width:n.width,height:n.height,scaleX:i/n.width,scaleY:s/n.height,left:-e.bleed,top:-e.bleed}),t.setCoords(),e.editor?.customCanvas?.canvas?.requestRenderAll()},children:c("toolbar.fitToBackground")})),U=m(({element:t,store:e})=>o(P,{title:c("toolbar.crop"),children:o(p,{type:"text",styles:{root:{padding:"0 7px"}},onClick:()=>{let i=e.editor?.layerHandler.getLayer();e.editor?.imageCropHandler.cropStart(t,i,t.getSrc())},children:o(w,{size:16})})})),L=m(({element:t,store:e})=>{let i=y.reduce((r,a)=>r.concat(a.children),[]),s=Math.ceil(i.length/4)||1;return t.clipPath?o(p,{type:"text",styles:g,onClick:()=>{t.set({clipPath:null}),e.editor?.customCanvas?.canvas?.requestRenderAll(),e._triggerUpdate()},children:c("toolbar.removeClip")}):o(S,{styles:{container:{padding:"5px 10px"}},content:o("div",{style:{maxHeight:313,overflowY:"auto"},children:o(R,{style:{height:80*s,width:300},children:o("div",{className:l("shape-list","flex flex-wrap content-start mb-2"),children:i.map((r,a)=>o("div",{className:l("shape-item","w-[25%] h-0 pb-[25%] relative cursor-pointer shrink-0 mb-[1.2%]"),onClick:()=>{e.editor?.objectsHandler.createMaskElement(t,r),e._triggerUpdate()},children:o("div",{className:l("shape-content","absolute inset-0 flex justify-center items-center"),children:o("svg",{overflow:"visible",width:"50",height:"50",children:o("g",{transform:`scale(${50/r.viewBox[0]}, ${50/r.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`,children:o("path",{className:"shape-path",d:r.path,fill:"#ccc",strokeMiterlimit:8,strokeLinecap:"butt"})})})})},a))})})}),trigger:"click",children:o(p,{type:"text",styles:g,children:c("toolbar.clip")})})}),Y={ImageFlip:x,ImageFilters:I,ImageFitToBackground:H,ImageCrop:U,ImageClip:L,ImageRemoveBackground:k,ImageEraserPen:C},A=m(({store:t,components:e})=>{let i=t.selectedElements,r=u({type:"text",usedItems:["ImageFlip","ImageFilters","ImageFitToBackground","ImageClip","ImageCrop","ImageRemoveBackground","ImageEraserPen"],components:e});return o(f,{items:r,itemRender:a=>{let n=e[a]||Y[a];return n&&o(n,{elements:i,element:i[0],store:t},a)}})}),V=A;export{H as a,U as b,L as c,A as d,V as e};
@@ -1 +0,0 @@
1
- import{a as y,b as k}from"./chunk-YRJUN267.js";import{a as u,b as P}from"./chunk-RVXI723F.js";import{a as C}from"./chunk-OQ6HU62L.js";import{c}from"./chunk-ARZMBVXU.js";import{ColorPicker as h,Tooltip as F,Button as x}from"antd";import{CirclePlus as b}from"lucide-react";import{useState as w,useRef as T,useMemo as A}from"react";import{cssGradient2FabricGradient as B}from"@ydesign/core";import{observer as g}from"mobx-react-lite";import{jsx as t,jsxs as f}from"react/jsx-runtime";var H=async e=>C(e),d=e=>e?typeof e=="string"?e:e.colorStops?JSON.stringify(e.colorStops):JSON.stringify(e):"",I=g(({store:e})=>{let r=e.editor?.workareaHandler.workarea?.fill,[o,n]=w(()=>u(r)),i=T(!1),s=T(d(r)),m=d(r);m!==s.current&&!i.current&&(s.current=m,n(u(r)));let v=A(()=>o,[d(o)]);return t(F,{title:c("toolbar.backgroundColor"),children:t("div",{style:{height:32},children:t(h,{value:v,allowClear:!0,mode:["single","gradient"],onOpenChange:l=>{i.current=l,l||(s.current=d(r))},onChange:l=>{n(l)},onChangeComplete:l=>{let p=l.toCssString();if(p.includes("gradient")){let S=B(p);e.editor?.workareaHandler.setWorkareaBgColor(S)}else e.editor?.workareaHandler.setWorkareaBgColor(p)}})})})}),R=g(({store:e})=>{let a=async r=>{let{target:o}=r;if(!(!o.files||o.files.length===0)){for(let n of o.files){let s={type:"image",src:await H(n)};e.editor?.objectsHandler.add(s)}o.value=""}};return t("div",{children:f("label",{htmlFor:"input-file",children:[f(x,{type:"text",styles:{root:{padding:"0 8px"}},onClick:()=>{document.querySelector("#input-file")?.click()},children:[t(b,{size:16})," ",c("toolbar.addImage")]}),t("input",{type:"file",id:"input-file",style:{display:"none"},onChange:a,multiple:!0,accept:"image/*"})]})})}),D=g(({store:e})=>t("div",{children:f(x,{type:"text",styles:{root:{padding:"0 8px"}},onClick:()=>{e.editor?.objectsHandler.add({originX:"left",originY:"top",fontSize:100,textAlign:"left",fill:P(),text:"Hello World",type:"textbox"})},children:[t(b,{size:16}),c("toolbar.addText")]})})),E={DefaultBackgroundPicker:I,DefaultAddImage:R,DefaultAddText:D},G=({store:e,components:a})=>{let o=y({type:"text",usedItems:["DefaultBackgroundPicker","DefaultAddImage","DefaultAddText"],components:a});return t(k,{items:o,itemRender:n=>{let i=a[n]||E[n];return i&&t(i,{store:e},n)}})},q=G;export{I as a,G as b,q as c};
@@ -1 +0,0 @@
1
- import{c as r}from"./chunk-ARZMBVXU.js";import{Blend as d}from"lucide-react";import{Popover as c,Tooltip as y,Button as u,InputNumber as h,Slider as v}from"antd";import{observer as g}from"mobx-react-lite";import{useState as f,useEffect as b}from"react";import{jsx as t,jsxs as s}from"react/jsx-runtime";var M=g(({store:o})=>{let l=o.selectedShapes.length>0,e=o.selectedShapes[0],[n,i]=f(()=>Math.round(100*(e?.opacity??1)));b(()=>{e&&i(Math.round(100*(e.opacity??1)))},[e,e?.opacity]);let a=m=>{let p=Math.max(0,Math.min(m,100));i(p),o.editor?.objectsHandler.update({opacity:p/100})};return t(y,{title:r("toolbar.transparency"),placement:"bottom",children:t(c,{content:s("div",{children:[t("div",{style:{textAlign:"center",marginBottom:10},children:r("toolbar.transparency")}),s("div",{style:{display:"flex"},children:[t("div",{style:{width:170,paddingRight:20},children:t(v,{min:0,max:100,onChange:a,value:n})}),t(h,{min:0,max:100,value:n,onChange:a,size:"small",styles:{root:{width:65}}})]})]}),trigger:"click",children:t(u,{type:"text",disabled:!l,styles:{root:{padding:"0 7px"}},children:t(d,{size:16})})})})});export{M as a};
@@ -1,16 +0,0 @@
1
- import{a as E}from"./chunk-QX7ZGRSR.js";import{a as R}from"./chunk-TNBL7KOG.js";import{c as k}from"./chunk-4BG4CHIB.js";import{a as x}from"./chunk-KCNKLCD5.js";import{d as S}from"./chunk-LFWKF4C4.js";import{a as N}from"./chunk-2PAJLUQH.js";import{a as w}from"./chunk-XRRO2RT7.js";import{a as H}from"./chunk-OBJ5NZSC.js";import{a as B}from"./chunk-INRJE7VS.js";import{e as n}from"./chunk-HD2T2D4D.js";import{b as h}from"./chunk-HQSM4X2M.js";import{b as C}from"./chunk-N5KI6CPA.js";import{c as u}from"./chunk-ARZMBVXU.js";import f from"styled-components";import{useRef as Q}from"react";import{Tooltip as D,Button as G}from"antd";import{Undo2 as X,Redo2 as _}from"lucide-react";import{observer as q}from"mobx-react-lite";import{useEffect as J}from"react";import{jsx as i,jsxs as K}from"react/jsx-runtime";var P=q(({store:o})=>(J(()=>{},[o._updateHistory]),K(y,{style:{float:"left",paddingRight:10},children:[i(D,{title:u("toolbar.undo"),placement:"bottom",children:i(G,{type:"text",disabled:!o.editor?.historyHandler.canUndo(),styles:{root:{padding:"0 7px"}},onClick:()=>{o.editor?.historyHandler.undo()},children:i(X,{size:16})})}),i(D,{title:u("toolbar.redo"),placement:"bottom",children:i(G,{type:"text",disabled:!o.editor?.historyHandler.canRedo(),styles:{root:{padding:"0 7px"}},onClick:()=>{o.editor?.historyHandler.redo()},children:i(_,{size:16})})})]})));import{observer as V}from"mobx-react-lite";import{Button as z,Divider as W,Space as Y}from"antd";import{Check as Z,X as $}from"lucide-react";import{Fragment as no,jsx as e,jsxs as l}from"react/jsx-runtime";var oo=f.div`
2
- white-space: nowrap;
3
-
4
- height: 50px;
5
- padding: 0 15px;
6
- position: relative;
7
- width: 100%;
8
- z-index: 10;
9
- `,to=f.div`
10
- width: 100%;
11
- height: 100%;
12
- `,y=f.div`
13
- align-items: center;
14
- display: flex;
15
- height: 50px;
16
- `,eo=({store:o})=>l(Y,{style:{height:50},children:[l(z,{onClick:()=>{o.editor?.imageCropHandler.cropImg.onDeselectEvent()},children:[e(Z,{size:16}),"\u5B8C\u6210"]}),l(z,{onClick:()=>{o.editor?.imageCropHandler.cropCancel()},children:[e($,{size:16}),"\u53D6\u6D88"]})]}),c={textbox:k,image:S,path:n,rect:n,circle:n,ellipse:n,triangle:n,cropimage:eo,many:w};function Go(o,d){c[o]=d}var ro=V(({store:o,downloadButtonEnabled:d,components:p={}})=>{let O=new Set(o.selectedElements.map(r=>r?.type)).size===1,b=o.selectedElements.length===1,a=o.selectedElements[0],g=o.selectedElements.length&&o.selectedElements.every(r=>r?.locked),v=b&&a?.isCropping,s=b&&c[a?.type];O?s=c[a?.type]:o.selectedElements.length>1&&(s=c.many);let m=Q(p);(Object.keys(p).some(r=>p[r]!==m.current[r])||Object.keys(m.current).some(r=>!(r in p)))&&(m.current=Object.assign({},p));let t=m.current,T=t?.ActionControls||(d?h:null),I=t?.Position||E,L=t?.Opacity||H,j=t?.Lock||N,A=t?.Duplicate||B,F=t?.Remove||R,U=t?.History||P,M=t?.Group||x;return e(oo,{className:"bp5-navbar design-toolbar",children:l(to,{children:[!v&&e(U,{store:o}),!a&&e(C,{store:o,components:t}),s&&!g&&e(s,{store:o,components:t}),!v&&l(y,{style:{float:"right"},children:[e(M,{store:o}),e(I,{store:o}),!g&&e(L,{store:o}),e(j,{store:o}),e(A,{store:o}),e(F,{store:o}),T&&l(no,{children:[e(W,{orientation:"vertical",style:{margin:"0 15px"}}),e(T,{store:o})]})]})]})})}),Po=ro;export{y as a,Go as b,ro as c,Po as d,P as e};
@@ -1 +0,0 @@
1
- import{d as a}from"./chunk-WJT6VPDR.js";import{a as t}from"./chunk-O2XFH626.js";import*as s from"mobx";import{createContext as i,useContext as c}from"react";var l=r=>{try{return localStorage.getItem(r)}catch{return null}},g=(r,e)=>{try{localStorage.setItem(r,e)}catch{}},o=class{constructor({store:e}){t(this,"store");t(this,"id","");t(this,"name","");t(this,"user",{});t(this,"skipSaving",!1);t(this,"cloudEnabled",!1);t(this,"status","saved");t(this,"language",l("ydesign-language")||navigator.language||"en");t(this,"designsLength",0);s.makeAutoObservable(this),this.store=e}setLanguage(e){this.language=e,g("ydesign-language",e)}requestSave(){}async firstLoad(e){this.store.loadJSON(e)}async loadById(e){console.log("loadById",e)}updateUrlWithProjectId(){if(!this.id||this.id==="local"){window.history.replaceState({},"","/");return}let e=new URL(window.location.href);new URLSearchParams(e.search).set("id",this.id),window.history.replaceState({},"",`/design/${this.id}`)}async save(){}async getGlobalFont(e){return e?.length?(a(e),e):[]}},u=i(null),m=()=>{let r=c(u);if(!r)throw new Error("useProject must be used within a ProjectProvider");return r},p=r=>new o(r),h=p;export{u as a,m as b,p as c,h as d};
@@ -1 +0,0 @@
1
- import c,{useEffect as r}from"react";import{Editor as d}from"@ydesign/core";import{observer as l}from"mobx-react-lite";import{jsx as o,jsxs as v}from"react/jsx-runtime";var p=({store:e})=>{let i=c.useRef(null);return r(()=>{let s=i.current,{clientHeight:n,clientWidth:a}=s,t=new d({id:"canvas",config:{size:{width:a,height:n},workareaConfig:{width:e.width,height:e.height,background:"rgba(255,255,255,1)"}},container:s,state:{editor:e.editor,activeObject:e.selectedElements,objects:e.objects,zoomRatio:e.scale,setEditor:e._setEditor,setActiveObject:e.selectElements,setObjects:e.setObjects,setZoomRatio:e.setScale}});return e._setEditor(t),e.setupEditorListeners(),window._c=t,()=>{console.log("\u66F4\u65B0 canvas"),t.destroy()}},[]),v("div",{id:"canvas_container",ref:i,style:{flex:1,position:"relative",overflow:"hidden"},className:"bg-[#ecf0f1] dark:bg-[#92969d]",children:[o("div",{className:"inside-shadow w-full h-full shadow-inner",style:{position:"absolute",zIndex:2,pointerEvents:"none"}}),o("div",{style:{position:"absolute",height:"100%",width:"100%"},children:o("canvas",{id:"canvas"})})]})},b=l(p);export{p as a,b};
@@ -1,54 +0,0 @@
1
- import{a as f}from"./chunk-ISNCNIFJ.js";import{b as y}from"./chunk-NQYSJ5MN.js";import{a as x}from"./chunk-YLXPQ2GI.js";import{a as T}from"./chunk-R452ARGU.js";import{a as h}from"./chunk-OFA6JIQB.js";import{a as g}from"./chunk-IPOZDTK2.js";import{a as o}from"./chunk-4HH3B3W3.js";import{a as u}from"./chunk-FGCLY24Q.js";import{b as P}from"./chunk-XXR5YN2B.js";import{c as p,d as S}from"./chunk-WCHGSVUC.js";import{c as i}from"./chunk-ARZMBVXU.js";import r from"styled-components";import{useRef as v,useLayoutEffect as z}from"react";import{observer as a}from"mobx-react-lite";import{LayoutTemplate as L,TypeOutline as N,Image as M,Shapes as B,Upload as H,Wallpaper as I,Layers as E,ImageUpscale as R}from"lucide-react";import{clsx as U}from"clsx";import{jsx as n,jsxs as c}from"react/jsx-runtime";var $=r.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
- `,D=r.div`
11
- @media screen and (min-width: 501px) {
12
- overflow-y: auto;
13
- overflow-x: hidden;
14
- min-width: 72px;
15
- }
16
- `,F=r.div`
17
- display: flex;
18
- flex-direction: column;
19
- `,O=r.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
- `,W=r.div`
31
- display: none;
32
- ${p(`
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
- `,A=r.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
- ${p(`
52
- display: none;
53
- `)}
54
- `,_=({onClick:e})=>n(A,{onClick:e,children:n("div",{children:c("button",{className:"grid relative justify-center arrow cursor-pointer",children:[c("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"})})})})]})})}),j={name:"templates",Tab:a(e=>n(o,{name:i("sidePanel.templates"),...e,children:n(L,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(u,{store:e})},q={name:"text",Tab:a(e=>n(o,{name:i("sidePanel.text"),...e,children:n(N,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(f,{store:e})},G={name:"photos",Tab:a(e=>n(o,{name:i("sidePanel.photos"),...e,children:n(M,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(T,{store:e})},J={name:"shapes",Tab:a(e=>n(o,{name:i("sidePanel.shapes"),...e,children:n(B,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(h,{store:e})},K={name:"upload",Tab:a(e=>n(o,{name:i("sidePanel.upload"),...e,children:n(H,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(y,{store:e})},Q={name:"background",Tab:a(e=>n(o,{name:i("sidePanel.background"),...e,children:n(I,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(P,{store:e})},V={name:"layers",Tab:a(e=>n(o,{name:i("sidePanel.layers"),...e,children:n(E,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(x,{store:e})},X={name:"size",Tab:a(e=>n(o,{name:i("sidePanel.resize"),...e,children:n(R,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(g,{store:e})},Y=[j,q,G,J,K,Q,V,X],Z=a(({store:e,sections:k,defaultSection:d="templates"})=>{(()=>{let t=v(!0);t.current&&(t.current=!1,e.openSidePanel(d))})();let s=S();z(()=>{s?e.openSidePanel(""):e.openSidePanel(d)},[s]);let m=[...k||Y].filter(t=>t.visibleInList!==!1),b=m.find(t=>t.name===e.openedSidePanel)?.Panel,w=v(null);return c($,{className:`bp5-navbar design-side-panel ${e.openedSidePanel?"":"collapsed"}`,children:[n(D,{className:"design-side-tabs-container border-r-1 border-gray-200 dark:border-gray-800",ref:w,children:n(F,{className:"design-side-tabs-inner",children:m.map(({name:t,Tab:l})=>n(l,{active:e.openedSidePanel===t,onClick:()=>{t===e.openedSidePanel?e.openSidePanel(""):e.openSidePanel(t)}},t))})}),b&&n(O,{className:U("bp5-navbar design-panel-container","border-r-1 border-gray-200 dark:border-gray-800"),onClick:t=>{let l=t.target.closest(".design-close-panel"),C=t.target.closest(".design-mobile");l&&(s||C)&&e.openSidePanel("")},children:n(b,{store:e})}),e.openedSidePanel&&n(W,{onClick:()=>e.openSidePanel("")}),e.openedSidePanel&&n(_,{onClick:()=>e.openSidePanel("")})]})}),fe=Z;export{j as a,q as b,G as c,J as d,K as e,Q as f,V as g,X as h,Y as i,Z as j,fe as k};
@@ -1 +0,0 @@
1
- import{a as v}from"./chunk-4LUZF4CB.js";import{c as l}from"./chunk-ARZMBVXU.js";import{observer as m}from"mobx-react-lite";import{ReactSortable as f}from"react-sortablejs";import{useState as u}from"react";import{findIndex as g}from"es-toolkit/compat";import{Button as y,Card as h,Input as x}from"antd";import{GripVertical as b,Eye as k,EyeClosed as C,LockKeyholeOpen as j,LockKeyhole as E,Trash as H}from"lucide-react";import{jsx as t,jsxs as n}from"react/jsx-runtime";var T=m(({element:e,store:i})=>{let[r,o]=u(!1),a=g(i.selectedElements,d=>d?.id===e?.id)>=0,c=r?e.name||"":e.name||v(e.text)||`#${e.id||"\u7A7A"}`;return t(h,{className:a?"selected":"",style:{marginBottom:6,backgroundColor:a?"rgba(22, 119, 255, 0.3)":""},styles:{body:{padding:"8px 5px"}},onMouseDown:d=>{let s=d.ctrlKey||d.metaKey||d.shiftKey?[...i.selectedElements]:[];g(s,p=>p.id===e.id)<0&&(s.push(e),i.selectElements(s.map(p=>p.id)),i.editor?.objectsHandler.selectElements(s))},children:n("div",{style:{display:"flex",justifyContent:"space-between"},children:[n("div",{style:{lineHeight:"30px",display:"flex"},children:[t("div",{className:"drag-handle",style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"move",height:30},children:t(b,{size:16})}),t("div",{style:{padding:"0 7px",opacity:.5,width:65},children:e.type}),t("div",{style:{maxWidth:138},children:t(x,{style:{minWidth:130},placeholder:l("sidePanel.namePlaceholder"),value:c,onFocus:()=>{o(!0)},onBlur:()=>{o(!1)},onChange:d=>{i.editor?.objectsHandler.update({name:d.target.value},e.id),i._triggerUpdate()}})})]}),n("div",{children:[t(y,{type:"text",styles:{root:{padding:"0 7px"}},onClick:()=>{i.editor?.objectsHandler.update({visible:!e.visible},e.id),i._triggerUpdate()},children:e.visible?t(k,{size:16}):t(C,{size:16})}),t(y,{type:"text",styles:{root:{padding:"0 7px"}},onClick:()=>{e?.lockMovementX?i.editor?.lockHandler.unlock(e.id):i.editor?.lockHandler.lock(e.id)},children:e.lockMovementX?t(E,{size:16}):t(j,{size:16})}),t(y,{type:"text",styles:{root:{padding:"0 7px"}},onClick:()=>{i.editor?.objectsHandler.remove(e.id)},children:t(H,{size:16})})]})]})})}),M=m(({store:e})=>{let r=e.objects.filter(o=>o?.id!=="workarea").reverse();return n("div",{style:{height:"100%",overflow:"auto"},children:[t("div",{style:{height:40,paddingTop:5},children:l("sidePanel.layersTip")}),t("div",{children:r.length===0?t("div",{children:l("sidePanel.noLayers")}):null}),t(f,{list:r,direction:"horizontal",setList:o=>{o.forEach((a,c)=>{let d=o.length-c;e.objects.indexOf(a)!==d&&(e.editor?.layerHandler.updateLayerOrderByTargetIndex(d,!0,a),e._triggerUpdate())})},children:r.map(o=>t(T,{element:o,store:e},o.id))})]})});export{M as a};