@ydesign/react-editor 0.1.0 → 0.1.2

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 (192) hide show
  1. package/dist/app.css +1 -1
  2. package/dist/app.js +1 -1
  3. package/dist/canvas/workspace.d.ts +6 -4
  4. package/dist/canvas/workspace.js +1 -1
  5. package/dist/chunk-2AZQIJ4K.js +1 -0
  6. package/dist/chunk-45NWLCOP.js +15 -0
  7. package/dist/chunk-63A6RW6Y.js +21 -0
  8. package/dist/chunk-6XGFXDKJ.js +151 -0
  9. package/dist/chunk-EUTDQZKU.js +1 -0
  10. package/dist/chunk-KERQXVBL.js +1 -0
  11. package/dist/chunk-QALZ5CAJ.js +214 -0
  12. package/dist/{chunk-7YLSIB43.js → chunk-RBRSKAZL.js} +1 -1
  13. package/dist/chunk-YBC2DYJX.js +9 -0
  14. package/dist/config.d.ts +228 -3
  15. package/dist/config.js +1 -1
  16. package/dist/model/store.d.ts +5 -364
  17. package/dist/model/store.js +1 -1
  18. package/dist/project.d.ts +12 -4
  19. package/dist/project.js +1 -1
  20. package/dist/side-panel/index.d.ts +2 -5
  21. package/dist/side-panel/index.js +1 -1
  22. package/dist/side-panel/side-panel.d.ts +12 -6
  23. package/dist/side-panel/side-panel.js +1 -1
  24. package/dist/store-DfmY1m2j.d.ts +379 -0
  25. package/dist/toolbar/download-button.d.ts +1 -3
  26. package/dist/toolbar/download-button.js +1 -1
  27. package/dist/toolbar/toolbar.d.ts +1 -3
  28. package/dist/toolbar/toolbar.js +18 -1
  29. package/dist/toolbar/zoom-buttons.d.ts +1 -3
  30. package/dist/topbar/create-design.d.ts +1 -3
  31. package/dist/topbar/create-design.js +1 -1
  32. package/dist/topbar/topbar.d.ts +1 -3
  33. package/dist/topbar/topbar.js +5 -5
  34. package/package.json +2 -2
  35. package/dist/assets/logo.d.ts +0 -7
  36. package/dist/assets/logo.js +0 -1
  37. package/dist/canvas/context-menu/context-menu.d.ts +0 -2
  38. package/dist/canvas/context-menu/context-menu.js +0 -0
  39. package/dist/canvas/hotkeys.d.ts +0 -3
  40. package/dist/canvas/hotkeys.js +0 -1
  41. package/dist/canvas/workspace-canvas.d.ts +0 -19
  42. package/dist/canvas/workspace-canvas.js +0 -1
  43. package/dist/chunk-2A3HHQ7X.js +0 -1
  44. package/dist/chunk-2T3O5ZZ2.js +0 -1
  45. package/dist/chunk-3TO57JPN.js +0 -1
  46. package/dist/chunk-4LUZF4CB.js +0 -2
  47. package/dist/chunk-5CKXOQAT.js +0 -1
  48. package/dist/chunk-5OA2JYPB.js +0 -1
  49. package/dist/chunk-5X6VER6G.js +0 -1
  50. package/dist/chunk-62YF5KTO.js +0 -1
  51. package/dist/chunk-75WC3GVB.js +0 -1
  52. package/dist/chunk-7NNOHYKX.js +0 -15
  53. package/dist/chunk-AC6CCGZH.js +0 -1
  54. package/dist/chunk-BE3YOONJ.js +0 -1
  55. package/dist/chunk-BWST6EER.js +0 -1
  56. package/dist/chunk-CB23VFSC.js +0 -1
  57. package/dist/chunk-DGCF2GDA.js +0 -9
  58. package/dist/chunk-ESNVOB52.js +0 -17
  59. package/dist/chunk-HHYPIHAP.js +0 -45
  60. package/dist/chunk-HOAYYKAZ.js +0 -3
  61. package/dist/chunk-IUFYYEGO.js +0 -1
  62. package/dist/chunk-IV52R7D7.js +0 -27
  63. package/dist/chunk-J6PYM4EV.js +0 -1
  64. package/dist/chunk-JHNSYFB2.js +0 -151
  65. package/dist/chunk-JMIN2XMC.js +0 -1
  66. package/dist/chunk-JPIYZYMQ.js +0 -1
  67. package/dist/chunk-KVT25LDU.js +0 -1
  68. package/dist/chunk-MGTFIE3C.js +0 -1
  69. package/dist/chunk-NLABIDJ5.js +0 -1
  70. package/dist/chunk-O56ZNYGR.js +0 -1
  71. package/dist/chunk-O73AAP2K.js +0 -1
  72. package/dist/chunk-OQ6HU62L.js +0 -1
  73. package/dist/chunk-P5I43V7X.js +0 -1
  74. package/dist/chunk-POCSL7OS.js +0 -50
  75. package/dist/chunk-PSO4W6J7.js +0 -9
  76. package/dist/chunk-QVSJHU2S.js +0 -1
  77. package/dist/chunk-QWM7VMLQ.js +0 -9
  78. package/dist/chunk-SGK2XN5D.js +0 -1
  79. package/dist/chunk-T3TEB73P.js +0 -1
  80. package/dist/chunk-TS5CKDHH.js +0 -1
  81. package/dist/chunk-TTK5Z2Z6.js +0 -1
  82. package/dist/chunk-TZ6B7XDS.js +0 -1
  83. package/dist/chunk-U7TPE4R3.js +0 -54
  84. package/dist/chunk-UCJMXWVT.js +0 -16
  85. package/dist/chunk-WCHGSVUC.js +0 -8
  86. package/dist/chunk-WJT6VPDR.js +0 -9
  87. package/dist/chunk-XA2G4P2Q.js +0 -1
  88. package/dist/chunk-XRRO2RT7.js +0 -1
  89. package/dist/chunk-YCJBBRRT.js +0 -1
  90. package/dist/chunk-YRJUN267.js +0 -14
  91. package/dist/chunk-YVBVDUVA.js +0 -1
  92. package/dist/chunk-Z4QXUZAS.js +0 -1
  93. package/dist/hooks/use-duplicate-element.d.ts +0 -16
  94. package/dist/hooks/use-duplicate-element.js +0 -1
  95. package/dist/hooks/use-lock.d.ts +0 -18
  96. package/dist/hooks/use-lock.js +0 -1
  97. package/dist/hooks/use-remove-element.d.ts +0 -16
  98. package/dist/hooks/use-remove-element.js +0 -1
  99. package/dist/lib/utils.d.ts +0 -5
  100. package/dist/lib/utils.js +0 -1
  101. package/dist/side-panel/background-panel.d.ts +0 -17
  102. package/dist/side-panel/background-panel.js +0 -1
  103. package/dist/side-panel/images-grid.d.ts +0 -27
  104. package/dist/side-panel/images-grid.js +0 -1
  105. package/dist/side-panel/layers-panel.d.ts +0 -16
  106. package/dist/side-panel/layers-panel.js +0 -1
  107. package/dist/side-panel/photos-panel.d.ts +0 -16
  108. package/dist/side-panel/photos-panel.js +0 -1
  109. package/dist/side-panel/shapes-panel.d.ts +0 -16
  110. package/dist/side-panel/shapes-panel.js +0 -1
  111. package/dist/side-panel/size-panel.d.ts +0 -16
  112. package/dist/side-panel/size-panel.js +0 -1
  113. package/dist/side-panel/tab-button.d.ts +0 -12
  114. package/dist/side-panel/tab-button.js +0 -1
  115. package/dist/side-panel/templates-panel.d.ts +0 -16
  116. package/dist/side-panel/templates-panel.js +0 -1
  117. package/dist/side-panel/text-panel.d.ts +0 -16
  118. package/dist/side-panel/text-panel.js +0 -1
  119. package/dist/side-panel/upload-panel.d.ts +0 -17
  120. package/dist/side-panel/upload-panel.js +0 -1
  121. package/dist/toolbar/default-toolbar.d.ts +0 -21
  122. package/dist/toolbar/default-toolbar.js +0 -1
  123. package/dist/toolbar/duplicate-button.d.ts +0 -16
  124. package/dist/toolbar/duplicate-button.js +0 -1
  125. package/dist/toolbar/element-container.d.ts +0 -13
  126. package/dist/toolbar/element-container.js +0 -1
  127. package/dist/toolbar/figure-toolbar.d.ts +0 -33
  128. package/dist/toolbar/figure-toolbar.js +0 -1
  129. package/dist/toolbar/filters-picker.d.ts +0 -18
  130. package/dist/toolbar/filters-picker.js +0 -1
  131. package/dist/toolbar/flip-button.d.ts +0 -18
  132. package/dist/toolbar/flip-button.js +0 -1
  133. package/dist/toolbar/group-button.d.ts +0 -16
  134. package/dist/toolbar/group-button.js +0 -1
  135. package/dist/toolbar/history-buttons.d.ts +0 -16
  136. package/dist/toolbar/history-buttons.js +0 -1
  137. package/dist/toolbar/image-eraser-pen.d.ts +0 -10
  138. package/dist/toolbar/image-eraser-pen.js +0 -1
  139. package/dist/toolbar/image-remove-background.d.ts +0 -10
  140. package/dist/toolbar/image-remove-background.js +0 -1
  141. package/dist/toolbar/image-toolbar.d.ts +0 -36
  142. package/dist/toolbar/image-toolbar.js +0 -1
  143. package/dist/toolbar/lock-button.d.ts +0 -16
  144. package/dist/toolbar/lock-button.js +0 -1
  145. package/dist/toolbar/many-toolbar.d.ts +0 -5
  146. package/dist/toolbar/many-toolbar.js +0 -1
  147. package/dist/toolbar/opacity-picker.d.ts +0 -16
  148. package/dist/toolbar/opacity-picker.js +0 -1
  149. package/dist/toolbar/position-picker.d.ts +0 -16
  150. package/dist/toolbar/position-picker.js +0 -1
  151. package/dist/toolbar/remove-button.d.ts +0 -16
  152. package/dist/toolbar/remove-button.js +0 -1
  153. package/dist/toolbar/text-ai-write.d.ts +0 -7
  154. package/dist/toolbar/text-ai-write.js +0 -1
  155. package/dist/toolbar/text-toolbar.d.ts +0 -19
  156. package/dist/toolbar/text-toolbar.js +0 -1
  157. package/dist/topbar/file-menu.d.ts +0 -19
  158. package/dist/topbar/file-menu.js +0 -1
  159. package/dist/topbar/psd-parser.d.ts +0 -9
  160. package/dist/topbar/psd-parser.js +0 -1
  161. package/dist/utils/api.d.ts +0 -15
  162. package/dist/utils/api.js +0 -1
  163. package/dist/utils/blob.d.ts +0 -5
  164. package/dist/utils/blob.js +0 -1
  165. package/dist/utils/download.d.ts +0 -3
  166. package/dist/utils/download.js +0 -1
  167. package/dist/utils/figure-to-svg.d.ts +0 -36
  168. package/dist/utils/figure-to-svg.js +0 -1
  169. package/dist/utils/file.d.ts +0 -3
  170. package/dist/utils/file.js +0 -1
  171. package/dist/utils/filters.d.ts +0 -2
  172. package/dist/utils/filters.js +0 -0
  173. package/dist/utils/fonts.d.ts +0 -68
  174. package/dist/utils/fonts.js +0 -1
  175. package/dist/utils/image.d.ts +0 -19
  176. package/dist/utils/image.js +0 -1
  177. package/dist/utils/l10n.d.ts +0 -227
  178. package/dist/utils/l10n.js +0 -1
  179. package/dist/utils/loader.d.ts +0 -6
  180. package/dist/utils/loader.js +0 -1
  181. package/dist/utils/screen.d.ts +0 -6
  182. package/dist/utils/screen.js +0 -1
  183. package/dist/utils/svg.d.ts +0 -3
  184. package/dist/utils/svg.js +0 -1
  185. package/dist/utils/text.d.ts +0 -3
  186. package/dist/utils/text.js +0 -1
  187. package/dist/utils/use-api.d.ts +0 -2
  188. package/dist/utils/use-api.js +0 -0
  189. package/dist/utils/use-axios.d.ts +0 -25
  190. package/dist/utils/use-axios.js +0 -1
  191. /package/dist/{chunk-MXZ6RXT3.js → chunk-EWOU5F3O.js} +0 -0
  192. /package/dist/{chunk-YCFED7XQ.js → chunk-WFMCGQ5V.js} +0 -0
@@ -1,151 +0,0 @@
1
- import{a as _}from"./chunk-5CKXOQAT.js";import{a as V}from"./chunk-NLABIDJ5.js";import{b as M,c as m}from"./chunk-5C2MNUBC.js";import{a as b}from"./chunk-MXZ6RXT3.js";import{h as H}from"./chunk-BE3YOONJ.js";import{Modal as ue,Button as fe,ColorPicker as ye,InputNumber as O,Select as ve,Tooltip as j,App as be}from"antd";import{Grid2X2 as we,Star as ze,ShoppingBag as ke,FileText as Ce,Presentation as Se,Share2 as Pe,Printer as Ie,ImagePlus as Ne,FolderPlus as t,LockKeyholeOpen as Be,LockKeyhole as Te}from"lucide-react";import{useRef as Me,useState as l,useMemo as X,useCallback as g}from"react";import k from"styled-components";import{Fragment as De,jsx as e,jsxs as o}from"react/jsx-runtime";var Ue=[{key:"all",label:"\u5168\u90E8",icon:we},{key:"common",label:"\u5E38\u7528\u5C3A\u5BF8",icon:ze},{key:"ecommerce",label:"\u7535\u5546\u7269\u6599",icon:ke},{key:"office",label:"\u884C\u653F\u529E\u516C",icon:Ce},{key:"presentation",label:"\u6F14\u793A\u6587\u7A3F",icon:Se},{key:"social",label:"\u793E\u4EA4\u5A92\u4F53",icon:Pe},{key:"print",label:"\u5370\u5237\u7269\u6599",icon:Ie}],K=[{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"}]}],Z=k.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
- `,Le=k.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
- `,Re=k.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: rgba(0, 0, 0, 0.05);
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
- `,We=k.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
- `,p=72,w=20,z=8e3,Xe=({project:C,visible:q,onClose:G,onConfirm:J})=>{let{message:x,modal:Q}=be.useApp(),[U,Y]=l("all"),L=Me(null),[s,S]=l(null),[a,P]=l(null),[r,ee]=l("px"),[d,ie]=l(!1),[u,te]=l(1),[f,ne]=l("#ffffff"),[oe,R]=l(!1),I=X(()=>s?m({unitVal:s,dpi:p,unit:r}):0,[s,r]),N=X(()=>a?m({unitVal:a,dpi:p,unit:r}):0,[a,r]),B=s!=null&&a!=null&&s>0&&a>0,y=B&&(I>z||N>z),v=B&&(I<w||N<w),T=!B||y||v,W=y?`\u8D85\u51FA\u753B\u5E03\u5C3A\u5BF8\u9650\u5236\uFF1A${z} * ${z} px`:v?`\u4F4E\u4E8E\u753B\u5E03\u5C3A\u5BF8\u9650\u5236\uFF1A${w} * ${w} px`:"",se=g(i=>{S(i),d&&i&&i>0&&P(Math.round(i/u))},[d,u]),ae=g(i=>{P(i),d&&i&&i>0&&S(Math.round(i*u))},[d,u]),re=g(()=>{!d&&s&&a&&s>0&&a>0&&te(s/a),ie(i=>!i)},[d,s,a]),ce=g(i=>{if(s){let n=m({unitVal:s,dpi:p,unit:r});S(Math.round(M({px:n,dpi:p,unit:i,precious:0})))}if(a){let n=m({unitVal:a,dpi:p,unit:r});P(Math.round(M({px:n,dpi:p,unit:i,precious:0})))}ee(i)},[s,a,r]),le=g(()=>{if(T)return;let i=JSON.stringify({bg:{backgroundColor:f}}),n=new URLSearchParams({create:"",createEmptyPoster:"true",createInfo:i,height:String(a),unit:r,width:String(s)});console.log("params \u7684\u53C2\u6570 ---> ",n.toString()),console.log("project ",C.urls.editorUrl),window.open(`${C.urls.editorUrl}?${n.toString()}`,"_blank")},[T,f,N,I,r]),de=i=>{Y(i);let n=L.current;if(!n)return;let c=n.querySelector(`[data-category-id="${i}"]`);c&&n.scrollTo({top:c.offsetTop,behavior:"smooth"})},[pe,he]=l(()=>{let i={};return K.forEach(n=>{i[n.key]=n.sizes.length>6}),i});return o(De,{children:[o(ue,{title:"\u521B\u5EFA\u8BBE\u8BA1",open:q,onCancel:G,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:Ue.map(i=>o("div",{"data-active":i.key===U,className:b("createrSideBarItem","flex h-[40px] px-2 mb-2 cursor-pointer rounded-md items-center hover:bg-[#1677ff4d]",{"bg-[#1677ff4d] hover:bg-[#1677ff4d]":i.key===U}),onClick:()=>de(i.key),children:[e(i.icon,{size:16,className:"ml-2"}),e("span",{className:"ml-2",children:i.label})]},i.key))}),e(Le,{children:e("div",{className:"scrollbars",style:{position:"relative",overflow:"hidden",width:"100%",height:"100%"},children:e("div",{ref:L,style:{position:"absolute",inset:0,overflow:"scroll"},children:o("div",{className:"createrContentInner",children:[e("div",{"data-category-id":"all"}),o("div",{className:"openBtns flex",children:[o(Z,{onClick:()=>{let i=document.createElement("input");i.type="file",i.accept="image/*",i.onchange=async()=>{let n=i.files?.[0];if(n)try{x.loading("\u6B63\u5728\u4E0A\u4F20...",0);let c=H(),h=new FormData;h.append("file",n);let D=await V.post(c,h,{headers:{"Content-Type":"multipart/form-data"}});console.log("res",D);let{url:$,width:E,height:A}=D.result;console.log("url",$,E,A);let me=encodeURIComponent(encodeURIComponent($)),ge=new URLSearchParams({createEmptyPoster:"true",width:String(E),height:String(A),unit:"px"});x.destroy();let xe=`${C.urls.editorUrl}/?${ge.toString()}&open=${me}`,F=window.open(xe,"_blank");(!F||F.closed)&&Q.info({title:"\u5141\u8BB8\u663E\u793A\u5F39\u51FA\u7A97\u53E3",width:480,content:o("div",{style:{padding:"16px 0"},children:[e("p",{style:{marginBottom:8,color:"#666"},children:"\u4F60\u9700\u8981\u6388\u6743\u672C\u7AD9\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u591A\u4E2A\u7A97\u53E3\u3002"}),o("div",{style:{marginBottom:12},children:[e("p",{children:e("b",{children:"\u7B2C1\u6B65"})}),e("p",{children:"\u70B9\u51FB\u6D4F\u89C8\u5668\u53F3\u4FA7\u9876\u90E8\u5F39\u51FA\u7684\u963B\u6B62\u7A0B\u5E8F\u56FE\u6807\u3002"})]}),o("div",{style:{marginBottom:12},children:[e("p",{children:e("b",{children:"\u7B2C2\u6B65"})}),e("p",{children:"\u70B9\u51FB\u59CB\u7EC8\u5141\u8BB8\u663E\u793A\u5F39\u51FA\u5F0F\u7A97\u53E3\u548C\u8FDB\u884C\u91CD\u5B9A\u5411\u3002"})]}),o("div",{style:{marginBottom:12},children:[e("p",{children:e("b",{children:"\u7B2C3\u6B65"})}),e("p",{children:"\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u5373\u53EF\u6B63\u5E38\u4F7F\u7528\u529F\u80FD\u5566~"})]})]}),okText:"\u6211\u77E5\u9053\u5566"})}catch(c){x.destroy();let h=c?.message||"\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5";x.error(h),console.error("\u4E0A\u4F20\u5931\u8D25:",h,c)}},i.click()},children:[e(Ne,{style:{color:"#1677ff"}}),e("span",{children:"\u6253\u5F00\u56FE\u7247"})]}),e(j,{title:"\u4EC5\u652F\u6301psd\u683C\u5F0F\u6587\u4EF6",children:o(Z,{style:{marginLeft:12},onClick:()=>{R(!0),console.log("\u70B9\u51FB")},children:[e(t,{style:{color:"#1677ff"}}),e("span",{children:"\u6253\u5F00PSD"})]})})]}),K.map(i=>o("div",{className:b("Widget categorySection","mt-6"),"data-category-id":i.key,"data-is-folded":pe[i.key]??!1,"data-is-multi-row":i.sizes.length>6,children:[o("div",{className:b("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:()=>he(n=>({...n,[i.key]:!1})),children:e("span",{className:"text-[#616366]",children:"\u67E5\u770B\u66F4\u591A"})})]}),i.key==="common"&&o(We,{children:[W&&e("div",{className:"sizeWarning",children:W}),o("div",{className:"Widget sizeInpueBox",children:[e("div",{className:"sizeInput",children:e(O,{prefix:"\u5BBD",value:s,min:0,precision:0,status:y||v?"error":void 0,onChange:se,styles:{actions:{opacity:1,width:24}},style:{width:"100%"}})}),e(j,{title:d?"\u89E3\u9501\u6BD4\u4F8B":"\u9501\u5B9A\u6BD4\u4F8B",children:e("div",{className:"linkIcon",style:{cursor:"pointer"},onClick:re,children:d?e(Te,{size:16}):e(Be,{size:16})})}),e("div",{className:"sizeInput",children:e(O,{prefix:"\u9AD8",value:a,min:0,precision:0,status:y||v?"error":void 0,onChange:ae,styles:{actions:{opacity:1,width:24}},style:{width:"100%"}})}),e("div",{className:"sizeUnitSelect",style:{width:98,marginLeft:12},children:e(ve,{value:r,style:{width:98},onChange:ce,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(ye,{mode:"single",format:"hex",value:f,onChange:n=>ne(n.toHexString()),styles:{root:{width:98},body:{width:92}}})}),e(fe,{type:"primary",disabled:T,style:{width:98,marginLeft:12},onClick:le,children:"\u521B\u5EFA"})]}),e("ul",{className:"flex mt-4 flex-wrap gap-3",children:i.sizes.map((n,c)=>e("li",{style:{width:"calc((100% - 60px) / 6)",height:97},children:o(Re,{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:()=>{J({...n,bgColor:f})},children:e("button",{type:"button",children:"\u521B\u5EFA"})})]})},c))})]},i.key))]})})})})]}),e(_,{visible:oe,onClose:()=>R(!1)})]})};export{Xe as a};
@@ -1 +0,0 @@
1
- import{useCallback as s}from"react";var m=({store:e})=>{let t=e.selectedElements.length>0,l=e.selectedElements.every(n=>n?.locked===!0),c=!t||l,o=s(()=>{e.clone()},[e]);return{disabled:c,duplicate:o}};export{m as a};
@@ -1 +0,0 @@
1
- import{a as m}from"./chunk-OQ6HU62L.js";import{a as u}from"./chunk-POCSL7OS.js";import{c as a}from"./chunk-YCFED7XQ.js";import{Button as g}from"antd";import{useRef as w,useState as y}from"react";import{Plus as F,Trash as L}from"lucide-react";import{observer as P}from"mobx-react-lite";import{jsx as e,jsxs as p}from"react/jsx-runtime";var v=async t=>m(t);function z(t){v=t}var O=[];function S(t){let{type:o}=t;return o.indexOf("svg")>=0?"svg":o.indexOf("gif")>=0?"gif":o.indexOf("image")>=0?"image":o.indexOf("video")>=0?"video":o.indexOf("audio")>=0?"audio":"image"}var b=P(({store:t})=>{let[o,d]=y(O),[f,c]=y(!1),s=w(null);return p("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[e("div",{style:{height:"45px",paddingTop:"5px"},children:a("sidePanel.uploadTip")}),e("div",{style:{marginBottom:"15px"},children:p("label",{htmlFor:"input-file",children:[p(g,{loading:f,block:!0,onClick:()=>{s.current&&s.current.click()},children:[e(F,{size:16}),a("sidePanel.uploadImage")]}),e("input",{type:"file",ref:s,style:{display:"none"},onChange:async i=>{let{target:l}=i;console.log(l),c(!0);try{if(l.files)for(let n of l.files){let r=await v(n),x=S(n),h=r;d(T=>T.concat([{url:r,type:x,preview:h,id:String(Math.random()*1e3)}]))}}catch(n){console.error(n)}c(!1),l.value=""},multiple:!0})]})}),e(u,{images:o,isLoading:f,getPreview:i=>i.preview,loadMore:!1,onSelect:i=>{console.log("item ---> ",t,i)},getCredit:i=>e("div",{children:e(g,{type:"text",style:{color:"white"},onClick:l=>{l.stopPropagation(),d(n=>n.filter(r=>r.id!==i.id))},children:e(L,{size:16})})})})]})}),D=b;export{z as a,b,D as c};
@@ -1 +0,0 @@
1
- import{a as N}from"./chunk-2T3O5ZZ2.js";import{a as A}from"./chunk-YVBVDUVA.js";import{a as b,c as j}from"./chunk-RVXI723F.js";import{a as I,b as B}from"./chunk-YRJUN267.js";import{c as g}from"./chunk-YCFED7XQ.js";import{a as P}from"./chunk-WJT6VPDR.js";import{observer as x}from"mobx-react-lite";import{useEffect as T,useState as m,useCallback as O,useRef as L,useMemo as W}from"react";import{ColorPicker as E,Popover as M,Button as f,Input as V,InputNumber as k,Space as R,Slider as G,Tooltip as u}from"antd";import{cssGradient2FabricGradient as _}from"@ydesign/core";import{ChevronDown as J,TextAlignStart as K,TextAlignCenter as U,TextAlignEnd as D,TextAlignJustify as $,Bold as q,Italic as Q,Underline as X,Strikethrough as Y,ListChevronsUpDown as Z,TextWrap as tt}from"lucide-react";import{FixedSizeList as et}from"react-window";import{jsx as t,jsxs as S}from"react/jsx-runtime";var{Search:nt}=V,ot=({fontFamily:o,handleClick:i,modifiers:n,store:r,isCustom:c})=>{let[s,a]=m(!c);if(console.log("FontItem ---> ",a),T(()=>{s||r.loadFont(o)},[o,s]),o==="_divider")return t("div",{style:{width:"100%",height:1,background:"#e8e8e8"}});let d=o;return t(f,{type:n.active?"primary":"text",block:!0,style:{justifyContent:"start"},onClick:()=>i(o),disabled:n.disabled,styles:{root:{fontFamily:'"'+o+'"'},content:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},children:d})},it=({onChange:o,defaultValue:i})=>t(nt,{placeholder:i,allowClear:!0,onChange:n=>{o(n.target.value)},style:{width:210}}),lt=({store:o,fonts:i,activeFont:n,activeFontLabel:r,onFontSelect:c})=>{let[s,a]=m(""),d=i.filter(y=>y.toLowerCase().includes(s.toLowerCase()));return t(M,{content:S("div",{children:[t(it,{defaultValue:"\u641C\u7D22\u5B57\u4F53",onChange:y=>a(y??"")}),t("div",{style:{paddingTop:5},children:t(et,{itemCount:d.length,itemSize:28,width:210,height:Math.min(400,28*d.length)+10,children:({index:y,style:l})=>{let e=d[y];return t("div",{style:{...l,display:"flex",alignItems:"center",justifyContent:"center"},children:t(ot,{fontFamily:e,modifiers:{active:n===e},handleClick:()=>c(e),store:o,isCustom:o.fonts.find(p=>p.fontFamily===e)||P.find(p=>p.fontFamily===e)},e)})}})})]}),trigger:"click",children:t(f,{type:"text",style:{marginRight:5,fontFamily:'"'+n+'"',overflow:"hidden",whiteSpace:"nowrap",maxHeight:30,padding:"0 10px"},icon:t(J,{size:16,style:{display:"flex"}}),iconPlacement:"end",children:r})})},F=["left","center","right","justify"],rt=x(({elements:o,store:i})=>{let n=i.fonts.concat(P).map(a=>a.fontFamily),r=o[0].fontFamily;r.length>15&&(r=r.slice(0,15)+"...");let c=j(i.objects),s=[...new Set(c.concat("_divider").concat(n))];return t(lt,{fonts:s,activeFont:o[0].fontFamily,activeFontLabel:r,store:i,onFontSelect:a=>{i.editor?.objectsHandler.setTextStyle({fontFamily:a})}})}),h=o=>o?typeof o=="string"?o:o.colorStops?JSON.stringify(o.colorStops):JSON.stringify(o):"",st=x(({elements:o,store:i})=>{let n=o[0],r=O(()=>{let{selectionStart:l,selectionEnd:e}=n;if(l!==e&&l!==void 0){let p=n.getSelectionStyles(l,l+1);if(p.length>0&&p[0].fill!==void 0)return p[0].fill}return n.fill},[n]),[c,s]=m(()=>b(r())),a=L(!1),d=L(h(r()));T(()=>{let l=i.editor?.customCanvas?.canvas;if(!l)return;let e=()=>{if(!a.current){let p=r();d.current=h(p),s(b(p))}};return l.on("text:selection:changed",e),l.on("text:editing:entered",e),l.on("text:editing:exited",e),()=>{l.off("text:selection:changed",e),l.off("text:editing:entered",e),l.off("text:editing:exited",e)}},[i.editor?.customCanvas?.canvas,r]),T(()=>{if(!a.current){let l=r(),e=h(l);e!==d.current&&(d.current=e,s(b(l)))}},[n,r]);let y=W(()=>c,[h(c)]);return t(E,{value:y,allowClear:!0,mode:["single","gradient"],onOpenChange:l=>{if(a.current=l,!l){let e=r();d.current=h(e)}},onChange:l=>{s(l)},onChangeComplete:l=>{let e=l.toCssString();if(e.includes("gradient")){let p=_(e);i.editor?.objectsHandler.setTextStyle({fill:p})}else i.editor?.objectsHandler.setTextStyle({fill:e})}})}),at=x(({elements:o,store:i})=>{let[n,r]=m(o[0].fontSize);T(()=>{r(o[0].fontSize)},[o[0]?.fontSize,i._updateFontSize]);let c=s=>{Number.isNaN(s)||(i.editor?.objectsHandler.setTextStyle({fontSize:Number(s)}),r(Number(s)))};return t(k,{min:5,max:4*i.height,value:Math.round(n),onChange:c,style:{width:75},styles:{actions:{opacity:1,width:24}}})}),ct=x(({elements:o,store:i})=>{let n=o[0],[r,c]=m(n.textAlign),[s,a]=m(n.fontWeight),[d,y]=m(n.fontStyle),[l,e]=m(n.underline),[p,w]=m(n.linethrough),[v,z]=m(n.splitByGrapheme);return T(()=>{c(n.textAlign),a(n.fontWeight),y(n.fontStyle),e(n.underline),w(n.linethrough),z(n.splitByGrapheme)},[n]),S(R.Compact,{children:[t(u,{placement:"bottom",title:g(`toolbar.text${r}`),children:t(f,{type:"text",icon:r==="left"?t(K,{size:16,style:{display:"flex"}}):r==="center"?t(U,{size:16,style:{display:"flex"}}):r==="right"?t(D,{size:16,style:{display:"flex"}}):t($,{size:16,style:{display:"flex"}}),onClick:()=>{let C=(F.indexOf(r)+1+F.length)%F.length,H=F[C];i.editor?.objectsHandler.setTextStyle({textAlign:H}),c(H)}})}),t(u,{placement:"bottom",title:g("toolbar.textBold"),children:t(f,{type:s==="bold"||s==="700"?"primary":"text",icon:t(q,{size:16,style:{display:"flex"}}),onClick:()=>{s==="bold"||s==="700"?(i.editor?.objectsHandler.setTextStyle({fontWeight:"normal"}),a("normal")):(i.editor?.objectsHandler.setTextStyle({fontWeight:"bold"}),a("bold"))}})}),t(u,{placement:"bottom",title:g("toolbar.textItalic"),children:t(f,{type:d==="italic"?"primary":"text",icon:t(Q,{size:16,style:{display:"flex"}}),onClick:()=>{d==="italic"?(i.editor?.objectsHandler.setTextStyle({fontStyle:"normal"}),y("normal")):(i.editor?.objectsHandler.setTextStyle({fontStyle:"italic"}),y("italic"))}})}),t(u,{placement:"bottom",title:g("toolbar.textUnderline"),children:t(f,{type:l?"primary":"text",icon:t(X,{size:16,style:{display:"flex"}}),onClick:()=>{i.editor?.objectsHandler.setTextStyle({underline:!l}),e(!l)}})}),t(u,{placement:"bottom",title:g("toolbar.textStrikethrough"),children:t(f,{type:p?"primary":"text",icon:t(Y,{size:16,style:{display:"flex"}}),onClick:()=>{i.editor?.objectsHandler.setTextStyle({linethrough:!p}),w(!p)}})}),t(u,{placement:"bottom",title:g("toolbar.splitByGrapheme"),children:t(f,{type:v?"primary":"text",icon:t(tt,{size:16,style:{display:"flex"}}),onClick:()=>{i.editor?.objectsHandler.setTextStyle({splitByGrapheme:!v}),z(!v)}})})]})}),dt=x(({elements:o,store:i})=>{let n=o[0],r={display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},c=typeof n.lineHeight=="number"?100*n.lineHeight:120,[s,a]=m(c),[d,y]=m(n.charSpacing),l=e=>{i.editor?.objectsHandler.setTextStyle(e)};return t(M,{trigger:"click",content:S("div",{style:{padding:"0 6px",width:"230px"},children:[S("div",{style:r,children:[t("div",{children:g("toolbar.lineHeight")}),t("div",{children:t(k,{min:50,max:250,value:Math.round(s),style:{width:80},onChange:e=>{l({lineHeight:e/100}),a(e)}})})]}),t(G,{value:Math.round(s),min:50,max:250,step:1,onChange:e=>{l({lineHeight:e/100}),a(e)}}),S("div",{style:r,children:[t("div",{children:g("toolbar.letterSpacing")}),t("div",{children:t(k,{min:-50,max:250,value:Math.round(d/10),style:{width:80},onChange:e=>{l({charSpacing:(e??0)*10}),y((e??0)*10)}})})]}),t(G,{value:Math.round(d/10),min:-50,max:250,step:1,onChange:e=>{l({charSpacing:(e??0)*10}),y((e??0)*10)}})]}),children:t(f,{type:"text",icon:t(Z,{size:16,style:{display:"flex"}})})})}),pt={TextFill:st,TextFontFamily:rt,TextFontSize:at,TextFontVariant:ct,TextSpacing:dt,TextFilters:A,TextAiWrite:N},yt=x(({store:o,components:i})=>{let n=o.selectedElements,c=I({type:"text",usedItems:["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextFilters","TextAiWrite"],components:i});return t(B,{items:c,itemRender:s=>{let a=i[s]||pt[s];return a&&t(a,{elements:n,element:n[0],store:o},s)}})}),kt=yt;export{F as a,yt as b,kt as c};
@@ -1 +0,0 @@
1
- var d="https://pub-d7c4dca6f69c4b329766184b707dc826.r2.dev/images/2026-03-17/e406e8b1-eb6d-4d8a-8c22-ddd100a0a40e/1b04fb1b-7275-4123-b495-d205197c21d4/ddc303f2-0cda-4d34-9864-76df19a9e7d6.png";export{d as a};
@@ -1 +0,0 @@
1
- import{d as n}from"./chunk-QVSJHU2S.js";import a from"axios";var s=a.create({timeout:6e4});s.interceptors.request.use(r=>{let e=n();return e.value&&(r.headers.Authorization=`Bearer ${e.value}`),r},r=>Promise.reject(r));s.interceptors.response.use(r=>{let{data:e}=r,t=e?.statusCode??e?.status;if(t!=null){if(t>=200&&t<=201)return e;let i=e?.result?.message||e?.message||"An error occurred";return Promise.reject(new Error(i))}if(r.status>=200&&r.status<300&&e)return e;let o=new Error(e?.message||"An error occurred");return Promise.reject(o)},r=>{let e=r?.response?.data,t=e?.result?.message||e?.message||r.message||"An error occurred";return Promise.reject(new Error(t))});var m=s;export{m as a};
@@ -1 +0,0 @@
1
- import{a as u,b as P}from"./chunk-RVXI723F.js";import{a as y,b as C}from"./chunk-YRJUN267.js";import{a as k}from"./chunk-OQ6HU62L.js";import{c}from"./chunk-YCFED7XQ.js";import{ColorPicker as h,Tooltip as F,Button as x,message as g}from"antd";import{CirclePlus as b}from"lucide-react";import{useState as A,useRef as T,useMemo as B}from"react";import{cssGradient2FabricGradient as I}from"@ydesign/core";import{observer as f}from"mobx-react-lite";import{jsx as o,jsxs as m}from"react/jsx-runtime";var R=async e=>k(e),d=e=>e?typeof e=="string"?e:e.colorStops?JSON.stringify(e.colorStops):JSON.stringify(e):"",D=f(({store:e})=>{let t=e.backgroundColor,[s,r]=A(()=>u(t)),n=T(!1),i=T(d(t)),a=d(t);a!==i.current&&!n.current&&(i.current=a,r(u(t)));let v=B(()=>s,[d(s)]);return o(F,{title:c("toolbar.backgroundColor"),children:o("div",{style:{height:32},children:o(h,{value:v,allowClear:!0,mode:["single","gradient"],onOpenChange:l=>{n.current=l,l||(i.current=d(t))},onChange:l=>{r(l)},onChangeComplete:l=>{let p=l.toCssString();if(p.includes("gradient")){let S=I(p);e.setBackgroundColor(S)}else e.setBackgroundColor(p)}})})})}),E=f(({store:e})=>{let t=async s=>{let{target:r}=s;if(!(!r.files||r.files.length===0)){g.loading("\u56FE\u7247\u4E0A\u4F20\u4E2D...",0);for(let n of r.files){let a={type:"image",src:await R(n)};e.editor?.objectsHandler.add(a)}r.value="",g.destroy(),g.success("\u56FE\u7247\u4E0A\u4F20\u6210\u529F")}};return o("div",{children:m("label",{htmlFor:"input-file",children:[m(x,{type:"text",styles:{root:{padding:"0 8px"}},onClick:()=>{document.querySelector("#input-file")?.click()},children:[o(b,{size:16})," ",c("toolbar.addImage")]}),o("input",{type:"file",id:"input-file",style:{display:"none"},onChange:t,multiple:!0,accept:"image/*"})]})})}),H=f(({store:e})=>o("div",{children:m(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:[o(b,{size:16}),c("toolbar.addText")]})})),G={DefaultBackgroundPicker:D,DefaultAddImage:E,DefaultAddText:H},L=({store:e,components:t})=>{let r=y({type:"text",usedItems:["DefaultBackgroundPicker","DefaultAddImage","DefaultAddText"],components:t});return o(C,{items:r,itemRender:n=>{let i=t[n]||G[n];return i&&o(i,{store:e},n)}})},U=L;export{D as a,L as b,U as c};
@@ -1 +0,0 @@
1
- import{c as o}from"./chunk-YCFED7XQ.js";import{Button as c,Modal as m}from"antd";import{Eraser as p}from"lucide-react";import{useState as s,useEffect as d}from"react";import{observer as n}from"mobx-react-lite";import{Fragment as g,jsx as t,jsxs as x}from"react/jsx-runtime";var f=n(({isOpen:a,onClose:r,element:e})=>{let[l,i]=s(e.getSrc());return d(()=>{i(e.getSrc())},[e.id]),t(m,{title:o("toolbar.eraserPenTitle"),open:a,onOk:r,onCancel:r,width:{xs:"90%",sm:"80%",md:"70%",lg:"60%",xl:"50%",xxl:"40%"},styles:{body:{padding:"35px 0"}},okText:o("toolbar.confirmEraserPen"),cancelText:o("toolbar.cancelEraserPen"),children:t("img",{src:l,style:{width:"100%",maxHeight:"400px",objectFit:"contain"}})})}),I=n(({element:a})=>{let[r,e]=s(!1);return x(g,{children:[t(c,{type:"text",icon:t(p,{size:16,style:{display:"flex"}}),styles:{root:{padding:"0 7px"}},onClick:()=>e(!0),children:o("toolbar.eraserPen")}),t(f,{isOpen:r,onClose:()=>e(!1),element:a})]})});export{I as a};
@@ -1 +0,0 @@
1
- async function l(n){return new Promise((o,r)=>{let e=new FileReader;e.readAsDataURL(n),e.onload=()=>o(e.result),e.onerror=a=>r(a)})}export{l as a};
@@ -1 +0,0 @@
1
- async function c(n,t){let e=document.createElement("a"),o=URL.createObjectURL(n);e.href=o,e.download=t,document.body.appendChild(e),e.click(),setTimeout(function(){document.body.removeChild(e),window.URL.revokeObjectURL(o)},0)}export{c as a};
@@ -1,50 +0,0 @@
1
- import{c as x}from"./chunk-WCHGSVUC.js";import{c as u}from"./chunk-YCFED7XQ.js";import a from"styled-components";import{useRef as I,useEffect as P}from"react";import{Spin as D}from"antd";import{observer as W}from"mobx-react-lite";import{jsx as o,jsxs as y}from"react/jsx-runtime";var j=a.div`
2
- height: 100%;
3
- overflow: auto;
4
- `,z=a.div`
5
- width: 33%;
6
- float: left;
7
- `,F=a.div`
8
- padding: 4px;
9
- width: 100%;
10
- &:hover .credit {
11
- opacity: 1;
12
- }
13
- ${x(".credit {opacity: 1;}")}
14
- `,H=a.div`
15
- border-radius: 5px;
16
- position: relative;
17
- overflow: hidden;
18
- box-shadow: ${e=>e.$dataShadowenabled?"0 0 5px rgba(16, 22, 26, 0.3)":""};
19
- padding: ${e=>e.$spacing?e.$spacing+"px":"0px"};
20
- `,G=a.img`
21
- width: 100%;
22
- cursor: pointer;
23
- display: block;
24
- max-height: 300px;
25
- min-height: 50px;
26
- object-fit: contain;
27
- `,M=a.div`
28
- position: absolute;
29
- bottom: 0px;
30
- left: 0px;
31
- font-size: 10px;
32
- padding: 3px;
33
- padding-top: 10px;
34
- text-align: center;
35
- background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
36
- width: 100%;
37
- opacity: 0;
38
- color: white;
39
- `,N=a.p`
40
- text-align: center;
41
- padding: 30px;
42
- `,q=({url:e,onSelect:d,shadowEnabled:t,className:g,itemHeight:r,crossOrigin:s,onLoad:p,credit:l,spacing:m})=>o(F,{className:"ydesign-close-panel",onClick:d,children:y(H,{$spacing:m,$dataShadowenabled:t,className:"border-1 border-gray-200",children:[o(G,{className:g,style:{height:r??"auto "},src:e,draggable:!0,loading:"lazy",crossOrigin:s,onLoad:p}),l&&o(M,{className:"credit",children:l})]})}),V=W(({images:e,rowsNumber:d,isLoading:t,getPreview:g,getCredit:r,getImageClassName:s,onSelect:p,crossOrigin:l="anonymous",shadowEnabled:m,itemHeight:S,error:f,hideNoResults:$=!1,spacing:R})=>{let c=d||2,T=I(null),h=[];for(let i=0;i<c;i++)h.push((e||[]).filter((v,n)=>n%c===i));let b=I(null),w=()=>{},C=()=>{w()};return P(()=>(w(),()=>{b.current&&(window.clearTimeout(b.current),b.current=null)}),[e?.length,t]),y(j,{className:"no-scrollbar",ref:T,onScroll:()=>{},children:[o("style",{children:`
43
- .no-scrollbar::-webkit-scrollbar {
44
- display: none;
45
- }
46
- .no-scrollbar {
47
- -ms-overflow-style: none;
48
- scrollbar-width: none;
49
- }
50
- `}),h.map((i,v)=>y(z,{style:{width:100/c+"%"},children:[i.map((n,k)=>o(q,{image:n,url:g(n),onSelect:(E,L,O)=>{p(n,E,L,O)},credit:r&&r(n),crossOrigin:l,shadowEnabled:m,itemHeight:S,className:s&&s(n),onLoad:C,spacing:R},k)),t&&o("div",{style:{padding:30},children:o(D,{})})]},v)),!t&&(!e||!e.length)&&!f&&!$&&o(N,{children:u("sidePanel.noResults")}),f&&o(N,{children:u("sidePanel.error")})]})});export{V as a};
@@ -1,9 +0,0 @@
1
- import{a as s}from"./chunk-O56ZNYGR.js";import{a as w}from"./chunk-POCSL7OS.js";import{c as x}from"./chunk-YCFED7XQ.js";import{observable as f}from"mobx";import{observer as l}from"mobx-react-lite";import M from"styled-components";import{Input as n}from"antd";import{jsx as o,jsxs as r}from"react/jsx-runtime";var{Search:e}=n,m=["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"],p=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)"]),c=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
- `,b=t=>{let{color:i,children:a}=t;return o(c,{...t,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:a})})},Y=t=>{p.replace(t)},N=l(({store:t})=>r("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[r("div",{style:{display:"flex",justifyContent:"space-around",paddingBottom:10,alignItems:"center"},children:[o(s,{store:t}),p.map(i=>o(b,{color:i,onClick:()=>{}},i))]}),o("div",{style:{padding:"0 4px",marginBottom:10},children:o(e,{placeholder:x("sidePanel.searchPlaceholder")})}),o(w,{images:m,isLoading:!1,getPreview:i=>i,loadMore:!1,onSelect:i=>{console.log(i)}})]}));export{Y as a,N as b};
@@ -1 +0,0 @@
1
- import{a as u}from"./chunk-P5I43V7X.js";import{a as l,h as g,i as m,m as p}from"./chunk-WJT6VPDR.js";import{types as i,cast as b,flow as f,destroy as h,getSnapshot as E,onSnapshot as x}from"mobx-state-tree";import{observable as S,toJS as j}from"mobx";import{isEqual as F}from"es-toolkit/compat";var c=(e,t)=>{if(e?.objects)for(let r of e.objects){if(t(r)===!0)break;c(r,t)}},v=i.model("Font",{fontFamily:i.string,name:i.optional(i.string,""),url:i.optional(i.string,""),img:i.optional(i.string,""),styles:i.frozen()}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontFamily:e.fontFamily||e.name})),O=i.model("Store",{name:"yitu-design",token:"",width:1080,height:1080,scale:1,scaleToFit:1,unit:"px",dpi:72,bleed:0,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",selectedElementsIds:i.array(i.string),backgroundColor:i.optional(i.union(i.string,i.frozen()),"#fff"),fonts:i.array(v),editor:i.frozen(null),custom:i.frozen(),objects:i.array(i.frozen()),_key:"",_updateTrigger:0,_updateFontSize:0}).views(e=>({get selectedElements(){let t=e._updateTrigger;return console.log("_trigger\u90FD\u53D8\u5316\u662F\u89E6\u53D1\u805A\u7126\u5143\u7D20\u7684\u5237\u65B0 ---> ",t),e.selectedElementsIds.map(r=>e.editor?.objectsHandler.findOneById(r))}})).views(e=>({get selectedShapes(){let t=[];return c({objects:e.selectedElements},r=>{r?.type!=="group"&&t.push(r)}),t},find(t){let r,a=e.editor?.customCanvas.canvas.getObjects();if(a)return c({objects:a},o=>{if(!r&&t(o))return r=o,!0}),r},getElementById(t){return e.editor?.objectsHandler.findOneById(t)}})).actions(e=>({_setEditor(t){e.editor=t},_triggerUpdate(){e._updateTrigger=e._updateTrigger+1},_fontSizeUpdate(){e._updateFontSize=e._updateFontSize+1},_syncBackgroundColor(t){e.backgroundColor=t}})).actions(e=>({setBackgroundColor(t,r){e.backgroundColor=t,e.editor?.workareaHandler.setWorkareaBgColor(t,r)},set(t,r){e.editor?.objectsHandler.update(t,r?.id)},setUnit({unit:t,dpi:r}){e.unit=t||e.unit,e.dpi=r||e.dpi},setObjects(t){e.objects=t},selectElements(t){e.selectedElementsIds=b(t)},openSidePanel(t){e.openedSidePanel!==t&&(e.openedSidePanel=t)},deleteElements(t){t.forEach(r=>{e.editor?.objectsHandler.remove(r)})},setScale(t){e.scale=t},clone(){e.editor?.objectsHandler.clone()},addElement(t,r){return console.log("\u6DFB\u52A0json\u6570\u636E",t),e.editor?.objectsHandler.addJson(t,r)},setSize({width:t,height:r}){e.width=t,e.height=r,e.editor?.workareaHandler.setSize({width:t,height:r})},setupEditorListeners(){e.editor&&(e.editor.on("object:modified",()=>{e._triggerUpdate()}),e.editor.on("textbox:modified",()=>{e._fontSizeUpdate()}),e.editor.on("history:changed",t=>{t?.backgroundColor!==void 0&&e._syncBackgroundColor(t.backgroundColor)}))}})).actions(e=>({_forEachElementUp(t,r){if(!e.editor)return;let a=e.editor.layerHandler.getEffectiveLayers(),o=t.map(n=>({id:n,index:a.findIndex(d=>d.id===n)}));o.sort((n,d)=>d.index-n.index);for(let{index:n}of o){if(n==-1)continue;let d=n<a.length-1&&a[n+1],s=t.indexOf(d?.id)>=0;n===a.length-1||s||r(n)}},_forEachElementDown(t,r){if(!e.editor)return;let a=e.editor.layerHandler.getEffectiveLayers(),o=t.map(n=>({id:n,index:a.findIndex(d=>d.id===n)}));o.sort((n,d)=>d.index-n.index);for(let{index:n}of o){if(n==-1)continue;let d=n>0&&a[n-1],s=t.indexOf(d?.id)>=0;n===0||s||r(n)}return!1}})).actions(e=>({canMoveElementsUp(t){let r=!1;return e._forEachElementUp(t,()=>{r=!0}),r},moveElementsUp(t){if(!e.editor)return;let r=e.editor.layerHandler.getEffectiveLayers();[...t].map(o=>({id:o,index:r.findIndex(n=>n.id===o)})).filter(o=>o.index!==-1).sort((o,n)=>n.index-o.index).map(o=>o.id).forEach(o=>{e.editor?.layerHandler.bringForward(o)}),e._triggerUpdate()},canMoveElementsTop(t){return this.canMoveElementsUp(t)},moveElementsTop(t){e.editor&&(t.forEach(r=>{e.editor?.layerHandler.bringToFront(r)}),e._triggerUpdate())},canMoveElementsDown(t){let r=!1;return e._forEachElementDown(t,()=>{r=!0}),r},moveElementsDown(t){if(!e.editor)return;let r=e.editor.layerHandler.getEffectiveLayers();[...t].map(o=>({id:o,index:r.findIndex(n=>n.id===o)})).filter(o=>o.index!==-1).sort((o,n)=>o.index-n.index).map(o=>o.id).forEach(o=>{e.editor?.layerHandler.sendBackwards(o)}),e._triggerUpdate()},canMoveElementsBottom(t){return this.canMoveElementsDown(t)},moveElementsBottom(t){e.editor&&(t.forEach(r=>{e.editor?.layerHandler.sendToBack(r)}),e._triggerUpdate())},setElementZIndex(){}})).actions(e=>({async toDataURL(t){return e.editor?.rendererHandler.toDataURL(t)},async toBlob(t){return e.editor?.rendererHandler.toBlob(t)},async saveAsImage(t){if(!e.editor)return;let{fileName:r,...a}=t||{multiplier:1},o=await e.editor.rendererHandler.toBlob(a);o&&u(o,r||"yitu."+a.format)},toJSON(){return e.editor?.rendererHandler.toJSON()},toObject(){return e.editor?.rendererHandler.toObject()},loadJSON:f(function*(t){if(!e.editor)return;let r=yield e.editor.sceneHandler.importFromJSON(t);r&&(e.width=r.width,e.height=r.height,e.backgroundColor=r.fill)}),clear(){}})).actions(e=>({removeFont(t){e.fonts.filter(r=>r.fontFamily===t).forEach(r=>{h(r)})},addFont(t){this.removeFont(t.fontFamily),e.fonts.push(t),this.loadFont(t.fontFamily)},async loadFont(t){let r=e.fonts.find(n=>n.fontFamily===t)||l.find(n=>n.fontFamily===t),o=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return r?(r.styles&&(o=r.styles.map(n=>({fontStyle:n.fontStyle||"normal",fontWeight:n.fontWeight||"normal"}))),m(r)):p(t),Promise.all(o.map(n=>g(t,n.fontStyle,n.fontWeight)))}})).actions(e=>({on(t,r){if(t==="change"){let a=E(e.objects);return x(e.objects,o=>{let n=o;F(a,n)||(a=n,r(n))})}}})),y=S({value:""}),C=()=>j(y);function _({key:e,token:t}){return y={value:t??""},O.create({_key:e,token:t??""})}var T=_;export{c as a,v as b,O as c,C as d,_ as e,T as f};
@@ -1,9 +0,0 @@
1
- import{a as T,b,c as u}from"./chunk-5C2MNUBC.js";import{c as l}from"./chunk-YCFED7XQ.js";import{useState as x,useEffect as S,useRef as R}from"react";import{observer as A}from"mobx-react-lite";import{Button as z,Switch as L,Tooltip as M,InputNumber as E,Select as U}from"antd";import{Info as W,Instagram as v,Linkedin as g,Twitter as h,Video as r,Printer as a}from"lucide-react";import{jsx as i,jsxs as n}from"react/jsx-runtime";var $=[{name:"Instagram",icon:i(v,{size:16}),sizes:[["Post",1080,1080,"px",i(v,{})],["Story",1080,1920,"px",i(v,{})],["Ad",1080,1080,"px",i(v,{})]]},{name:"LinkedIn",icon:i(g,{size:16}),sizes:[["Post",1200,627,"px",i(g,{})],["Banner",1584,396,"px",i(g,{})],["Square",1080,1080,"px",i(g,{})]]},{name:"Twitter",icon:i(h,{size:16}),sizes:[["Post",1600,900,"px",i(h,{})],["Header",1500,500,"px",i(h,{})],["Square",1080,1080,"px",i(h,{})]]},{name:"Video",icon:i(r,{size:16}),sizes:[["Full HD",1920,1080,"px",i(r,{})],["4K UHD",3840,2160,"px",i(r,{})],["Vertical HD",1080,1920,"px",i(r,{})],["Square HD",1080,1080,"px",i(r,{})]]},{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,{})]]}],D=t=>{let{value:d,onChange:f}=t,[o,c]=x(d),p=R(d);p.current=o;let m=()=>{f(Math.max(t.min||0,parseFloat(p.current)))};return S(()=>{c(d)},[d]),i(E,{...t,value:o,onChange:s=>{Number.isNaN(s)||c(s)},onBlur:m,onKeyDown:s=>{s.key==="Enter"&&m()}})},Z=A(({store:t})=>{let[d,f]=x(!0),[o,c]=x(t.width),[p,m]=x(t.height),s=T({px:10,unit:t.unit,dpi:t.dpi}),k=t.width,P=t.height;return S(()=>{c(b({px:k,unit:t.unit,dpi:t.dpi,precious:0}))},[k,t.unit,t.dpi]),S(()=>{m(b({px:P,unit:t.unit,dpi:t.dpi,precious:0}))},[P,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:l("sidePanel.useMagicResize")}),i(M,{title:l("sidePanel.magicResizeDescription"),placement:"bottom",children:i(z,{type:"text",styles:{root:{padding:"0 7px"}},children:i(W,{size:16})})})]}),i(L,{checked:d,onChange:f})]}),i("div",{style:{width:"50%",display:"inline-block"},children:`${l("sidePanel.width")} (${t.unit})`}),i("div",{style:{width:"50%",display:"inline-block"},children:i(D,{min:s,max:1e4,value:o,style:{width:"100%"},styles:{actions:{opacity:1,width:24}},onChange:e=>{e||(e=o),c(e)}})})]}),n("div",{style:{paddingBottom:"15px"},children:[i("div",{style:{width:"50%",display:"inline-block"},children:`${l("sidePanel.height")} (${t.unit})`}),i("div",{style:{width:"50%",display:"inline-block"},children:i(D,{min:s,max:1e4,value:p,style:{width:"100%"},styles:{actions:{opacity:1,width:24}},onChange:e=>{e||(e=p),m(e)}})})]}),n("div",{style:{paddingBottom:"15px"},children:[i("div",{style:{width:"50%",display:"inline-block"},children:l("sidePanel.units")}),i("div",{style:{width:"50%",display:"inline-block"},children:i(U,{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:"mm",value:"mm"}]})})]}),i("div",{style:{paddingBottom:"15px"},children:i(z,{type:"primary",onClick:()=>{let e=u({unitVal:o,dpi:t.dpi,unit:t.unit}),w=u({unitVal:p,dpi:t.dpi,unit:t.unit});t.setSize({width:e,height:w,useMagic:d})},block:!0,children:l("sidePanel.resize")})}),$.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(w=>{let[B,C,I,y,H]=w;return n(z,{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=u({unitVal:C,dpi:t.dpi,unit:y}),N=u({unitVal:I,dpi:t.dpi,unit:y});t.setUnit({unit:y,dpi:t.dpi}),t.setSize({width:V,height:N,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," ",y]})]},B)})})]},e.name))]})});export{Z as a};
@@ -1 +0,0 @@
1
- import{d as a}from"./chunk-WJT6VPDR.js";import{a as e}from"./chunk-O2XFH626.js";import*as n from"mobx";import{createContext as i,useContext as l}from"react";var c=s=>{try{return localStorage.getItem(s)}catch{return null}},u=(s,t)=>{try{localStorage.setItem(s,t)}catch{}},r=class{constructor({store:t}){e(this,"saveTimeout",null);e(this,"isOne",!1);e(this,"store");e(this,"id","");e(this,"name","");e(this,"user",{});e(this,"skipSaving",!1);e(this,"cloudEnabled",!1);e(this,"status","loading");e(this,"language",c("ydesign-language")||navigator.language||"en");e(this,"designsLength",0);e(this,"urls",{editorUrl:"/design"});n.makeAutoObservable(this),this.store=t,t.on("change",()=>{if(!this.isOne){this.isOne=!0;return}this.requestSave()})}setLanguage(t){this.language=t,u("ydesign-language",t)}requestSave(){this.status="has-changes",console.log("---> ",this.status),!this.saveTimeout&&(this.saveTimeout=setTimeout(()=>{this.saveTimeout=null,this.save()},5e3))}async firstLoad(t){this.store.loadJSON(t)}async loadById(t){console.log("loadById",t)}updateUrlWithProjectId(){if(!this.id||this.id==="local"){window.history.replaceState({},"","/");return}let t=new URL(window.location.href);new URLSearchParams(t.search).set("id",this.id),window.history.replaceState({},"",`/design/${this.id}`)}async save(){this.status="saving",console.log("---> ",this.status);let t=this.store.toJSON();console.log("storeJSON",t);try{await new Promise(o=>setTimeout(o,2e3))}catch(o){console.error("save error",o)}this.status="saved",console.log("---> ",this.status)}async getGlobalFont(t){return t?.length?(a(t),t):[]}},g=i(null),m=()=>{let s=l(g);if(!s)throw new Error("useProject must be used within a ProjectProvider");return s},h=s=>new r(s),y=h;export{g as a,m as b,h as c,y as d};
@@ -1 +0,0 @@
1
- import{c as e}from"./chunk-YCFED7XQ.js";import{Button as o}from"antd";import{observer as l}from"mobx-react-lite";import{Fragment as u,jsx as r,jsxs as s}from"react/jsx-runtime";var d=l(({store:t})=>{let n=t.selectedElements.length>1,p=t.selectedElements.length===1&&t.selectedElements[0]?.type==="group";return s(u,{children:[n&&r(o,{type:"text",onClick:()=>{t.editor?.objectsHandler.group()},children:e("toolbar.groupElements")}),p&&r(o,{type:"text",onClick:()=>{t.editor?.objectsHandler.ungroup()},children:e("toolbar.ungroupElements")})]})});export{d as a};
@@ -1 +0,0 @@
1
- import{a as t}from"./chunk-POCSL7OS.js";import{c as o}from"./chunk-YCFED7XQ.js";import{Input as a}from"antd";import{observer as p}from"mobx-react-lite";import{jsx as x,jsxs as l}from"react/jsx-runtime";var{Search:f}=a,w=[{urls:{raw:"https://images.unsplash.com/photo-1756142752432-a8f0c44be6f4?ixid=M3wxMTY5OTZ8MXwxfGFsbHwxfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1756142752432-a8f0c44be6f4?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHwxfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1756142752432-a8f0c44be6f4?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHwxfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1756142752432-a8f0c44be6f4?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHwxfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1756142752432-a8f0c44be6f4?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHwxfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1756142752432-a8f0c44be6f4"},links:{self:"https://api.unsplash.com/photos/man-crouching-with-mountains-in-background-gxOKFEIGjbk",html:"https://unsplash.com/photos/man-crouching-with-mountains-in-background-gxOKFEIGjbk",download:"https://unsplash.com/photos/gxOKFEIGjbk/download?ixid=M3wxMTY5OTZ8MXwxfGFsbHwxfHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/gxOKFEIGjbk/download?ixid=M3wxMTY5OTZ8MXwxfGFsbHwxfHx8fHx8fHwxNzYyOTUxNDE1fA"},width:8192,height:5464},{urls:{raw:"https://images.unsplash.com/photo-1762930163317-01b67347b1bf?ixid=M3wxMTY5OTZ8MHwxfGFsbHwyfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762930163317-01b67347b1bf?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwyfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762930163317-01b67347b1bf?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwyfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762930163317-01b67347b1bf?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwyfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762930163317-01b67347b1bf?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwyfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762930163317-01b67347b1bf"},links:{self:"https://api.unsplash.com/photos/abstract-pattern-of-ice-with-bubbles-t-tT-HdUYGg",html:"https://unsplash.com/photos/abstract-pattern-of-ice-with-bubbles-t-tT-HdUYGg",download:"https://unsplash.com/photos/t-tT-HdUYGg/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwyfHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/t-tT-HdUYGg/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwyfHx8fHx8fHwxNzYyOTUxNDE1fA"},width:6720,height:4480},{urls:{raw:"https://images.unsplash.com/photo-1762544968153-b9b47435fefd?ixid=M3wxMTY5OTZ8MHwxfGFsbHwzfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762544968153-b9b47435fefd?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwzfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762544968153-b9b47435fefd?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwzfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762544968153-b9b47435fefd?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwzfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762544968153-b9b47435fefd?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwzfHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762544968153-b9b47435fefd"},links:{self:"https://api.unsplash.com/photos/modern-living-room-with-tan-leather-chairs-and-fireplace-CCQi3pV95k0",html:"https://unsplash.com/photos/modern-living-room-with-tan-leather-chairs-and-fireplace-CCQi3pV95k0",download:"https://unsplash.com/photos/CCQi3pV95k0/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwzfHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/CCQi3pV95k0/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwzfHx8fHx8fHwxNzYyOTUxNDE1fA"},width:3400,height:2267},{urls:{raw:"https://images.unsplash.com/photo-1762926949860-32a256c3bfe1?ixid=M3wxMTY5OTZ8MHwxfGFsbHw0fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762926949860-32a256c3bfe1?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw0fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762926949860-32a256c3bfe1?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw0fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762926949860-32a256c3bfe1?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw0fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762926949860-32a256c3bfe1?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw0fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762926949860-32a256c3bfe1"},links:{self:"https://api.unsplash.com/photos/cowgirl-rides-horse-with-american-flag-on-beach-YWm271YMI_I",html:"https://unsplash.com/photos/cowgirl-rides-horse-with-american-flag-on-beach-YWm271YMI_I",download:"https://unsplash.com/photos/YWm271YMI_I/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw0fHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/YWm271YMI_I/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw0fHx8fHx8fHwxNzYyOTUxNDE1fA"},width:3661,height:5490},{urls:{raw:"https://images.unsplash.com/photo-1762803733564-fecc7669a91a?ixid=M3wxMTY5OTZ8MHwxfGFsbHw1fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762803733564-fecc7669a91a?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw1fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762803733564-fecc7669a91a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw1fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762803733564-fecc7669a91a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw1fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762803733564-fecc7669a91a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw1fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762803733564-fecc7669a91a"},links:{self:"https://api.unsplash.com/photos/modern-bedroom-with-a-unique-brown-bed-and-chair-0pgXqbEDyuY",html:"https://unsplash.com/photos/modern-bedroom-with-a-unique-brown-bed-and-chair-0pgXqbEDyuY",download:"https://unsplash.com/photos/0pgXqbEDyuY/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw1fHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/0pgXqbEDyuY/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw1fHx8fHx8fHwxNzYyOTUxNDE1fA"},width:8320,height:12480},{urls:{raw:"https://images.unsplash.com/photo-1711322352942-cda9aeed0641?ixid=M3wxMTY5OTZ8MHwxfGFsbHw2fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1711322352942-cda9aeed0641?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw2fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1711322352942-cda9aeed0641?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw2fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1711322352942-cda9aeed0641?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw2fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1711322352942-cda9aeed0641?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw2fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1711322352942-cda9aeed0641"},links:{self:"https://api.unsplash.com/photos/a-large-building-with-two-towers-lit-up-at-night-dZi1XjHlC9w",html:"https://unsplash.com/photos/a-large-building-with-two-towers-lit-up-at-night-dZi1XjHlC9w",download:"https://unsplash.com/photos/dZi1XjHlC9w/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw2fHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/dZi1XjHlC9w/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw2fHx8fHx8fHwxNzYyOTUxNDE1fA"},width:2642,height:3301},{urls:{raw:"https://images.unsplash.com/photo-1762877211579-928eb9e9bb70?ixid=M3wxMTY5OTZ8MHwxfGFsbHw3fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762877211579-928eb9e9bb70?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw3fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762877211579-928eb9e9bb70?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw3fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762877211579-928eb9e9bb70?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw3fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762877211579-928eb9e9bb70?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw3fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762877211579-928eb9e9bb70"},links:{self:"https://api.unsplash.com/photos/yellow-ginkgo-leaves-against-a-blue-sky-djPI6C0i7ag",html:"https://unsplash.com/photos/yellow-ginkgo-leaves-against-a-blue-sky-djPI6C0i7ag",download:"https://unsplash.com/photos/djPI6C0i7ag/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw3fHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/djPI6C0i7ag/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw3fHx8fHx8fHwxNzYyOTUxNDE1fA"},width:4e3,height:6e3},{urls:{raw:"https://images.unsplash.com/photo-1761839257287-3030c9300ece?ixid=M3wxMTY5OTZ8MXwxfGFsbHw4fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1761839257287-3030c9300ece?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHw4fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1761839257287-3030c9300ece?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHw4fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1761839257287-3030c9300ece?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHw4fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1761839257287-3030c9300ece?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHw4fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1761839257287-3030c9300ece"},links:{self:"https://api.unsplash.com/photos/man-petting-a-dog-with-boxes-in-background-TXdLi87NmJQ",html:"https://unsplash.com/photos/man-petting-a-dog-with-boxes-in-background-TXdLi87NmJQ",download:"https://unsplash.com/photos/TXdLi87NmJQ/download?ixid=M3wxMTY5OTZ8MXwxfGFsbHw4fHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/TXdLi87NmJQ/download?ixid=M3wxMTY5OTZ8MXwxfGFsbHw4fHx8fHx8fHwxNzYyOTUxNDE1fA"},width:5472,height:3648},{urls:{raw:"https://images.unsplash.com/photo-1762877211603-0e764c23cf92?ixid=M3wxMTY5OTZ8MHwxfGFsbHw5fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762877211603-0e764c23cf92?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw5fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762877211603-0e764c23cf92?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw5fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762877211603-0e764c23cf92?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw5fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762877211603-0e764c23cf92?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHw5fHx8fHx8fHwxNzYyOTUxNDE1fA&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762877211603-0e764c23cf92"},links:{self:"https://api.unsplash.com/photos/tall-tree-with-yellow-leaves-and-sunburst-V-5rjLD3LEc",html:"https://unsplash.com/photos/tall-tree-with-yellow-leaves-and-sunburst-V-5rjLD3LEc",download:"https://unsplash.com/photos/V-5rjLD3LEc/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw5fHx8fHx8fHwxNzYyOTUxNDE1fA",download_location:"https://api.unsplash.com/photos/V-5rjLD3LEc/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHw5fHx8fHx8fHwxNzYyOTUxNDE1fA"},width:4e3,height:6e3},{urls:{raw:"https://images.unsplash.com/photo-1762545112336-646c69e4888b?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762545112336-646c69e4888b?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762545112336-646c69e4888b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762545112336-646c69e4888b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762545112336-646c69e4888b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762545112336-646c69e4888b"},links:{self:"https://api.unsplash.com/photos/modern-living-room-with-fireplace-and-forest-view-WZqmoZrQ1vU",html:"https://unsplash.com/photos/modern-living-room-with-fireplace-and-forest-view-WZqmoZrQ1vU",download:"https://unsplash.com/photos/WZqmoZrQ1vU/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMHx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/WZqmoZrQ1vU/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMHx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:3400,height:2267},{urls:{raw:"https://images.unsplash.com/photo-1762862064886-72a3dcc25230?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762862064886-72a3dcc25230?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762862064886-72a3dcc25230?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762862064886-72a3dcc25230?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762862064886-72a3dcc25230?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762862064886-72a3dcc25230"},links:{self:"https://api.unsplash.com/photos/bright-orange-moon-rising-over-silhouetted-trees-at-night-SY1yaSaTIQ8",html:"https://unsplash.com/photos/bright-orange-moon-rising-over-silhouetted-trees-at-night-SY1yaSaTIQ8",download:"https://unsplash.com/photos/SY1yaSaTIQ8/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMXx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/SY1yaSaTIQ8/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMXx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:6195,height:3485},{urls:{raw:"https://images.unsplash.com/photo-1710994140598-a35ce9ed17be?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1710994140598-a35ce9ed17be?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1710994140598-a35ce9ed17be?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1710994140598-a35ce9ed17be?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710994140598-a35ce9ed17be?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710994140598-a35ce9ed17be"},links:{self:"https://api.unsplash.com/photos/a-black-and-white-photo-of-a-tall-building-9w9MX3VNwGc",html:"https://unsplash.com/photos/a-black-and-white-photo-of-a-tall-building-9w9MX3VNwGc",download:"https://unsplash.com/photos/9w9MX3VNwGc/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMnx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/9w9MX3VNwGc/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxMnx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:4672,height:7008},{urls:{raw:"https://images.unsplash.com/photo-1762795116942-1faf2ae6cf84?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxM3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762795116942-1faf2ae6cf84?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxM3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762795116942-1faf2ae6cf84?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxM3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762795116942-1faf2ae6cf84?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxM3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762795116942-1faf2ae6cf84?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxM3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762795116942-1faf2ae6cf84"},links:{self:"https://api.unsplash.com/photos/a-young-woman-looks-up-thoughtfully-against-dark-background-QVdYS6SGmFQ",html:"https://unsplash.com/photos/a-young-woman-looks-up-thoughtfully-against-dark-background-QVdYS6SGmFQ",download:"https://unsplash.com/photos/QVdYS6SGmFQ/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxM3x8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/QVdYS6SGmFQ/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxM3x8fHx8fHx8MTc2Mjk1MTQxNXw"},width:5304,height:7952},{urls:{raw:"https://images.unsplash.com/photo-1762794320130-675e00cd989a?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762794320130-675e00cd989a?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762794320130-675e00cd989a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762794320130-675e00cd989a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762794320130-675e00cd989a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762794320130-675e00cd989a"},links:{self:"https://api.unsplash.com/photos/abstract-pattern-of-many-small-and-large-spheres-ErvMRa30SCk",html:"https://unsplash.com/photos/abstract-pattern-of-many-small-and-large-spheres-ErvMRa30SCk",download:"https://unsplash.com/photos/ErvMRa30SCk/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNHx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/ErvMRa30SCk/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNHx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:3500,height:2500},{urls:{raw:"https://images.unsplash.com/photo-1761864294727-3c9f6b3e7425?ixid=M3wxMTY5OTZ8MXwxfGFsbHwxNXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1761864294727-3c9f6b3e7425?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHwxNXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1761864294727-3c9f6b3e7425?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHwxNXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1761864294727-3c9f6b3e7425?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHwxNXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1761864294727-3c9f6b3e7425?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MXwxfGFsbHwxNXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1761864294727-3c9f6b3e7425"},links:{self:"https://api.unsplash.com/photos/teal-pendant-light-hangs-above-modern-dining-set-rlofFP9uhi0",html:"https://unsplash.com/photos/teal-pendant-light-hangs-above-modern-dining-set-rlofFP9uhi0",download:"https://unsplash.com/photos/rlofFP9uhi0/download?ixid=M3wxMTY5OTZ8MXwxfGFsbHwxNXx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/rlofFP9uhi0/download?ixid=M3wxMTY5OTZ8MXwxfGFsbHwxNXx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:4096,height:4096},{urls:{raw:"https://images.unsplash.com/photo-1762789291015-51c5a710c73c?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762789291015-51c5a710c73c?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762789291015-51c5a710c73c?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762789291015-51c5a710c73c?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762789291015-51c5a710c73c?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNnx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762789291015-51c5a710c73c"},links:{self:"https://api.unsplash.com/photos/a-dense-star-cluster-in-the-night-sky-DgflnSWtono",html:"https://unsplash.com/photos/a-dense-star-cluster-in-the-night-sky-DgflnSWtono",download:"https://unsplash.com/photos/DgflnSWtono/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNnx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/DgflnSWtono/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxNnx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:3e3,height:2e3},{urls:{raw:"https://images.unsplash.com/photo-1762792049412-7bf096c0f016?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxN3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762792049412-7bf096c0f016?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxN3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762792049412-7bf096c0f016?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxN3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762792049412-7bf096c0f016?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxN3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762792049412-7bf096c0f016?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxN3x8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762792049412-7bf096c0f016"},links:{self:"https://api.unsplash.com/photos/modern-office-buildings-in-a-bustling-city-square-Js1SSug0Dpg",html:"https://unsplash.com/photos/modern-office-buildings-in-a-bustling-city-square-Js1SSug0Dpg",download:"https://unsplash.com/photos/Js1SSug0Dpg/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxN3x8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/Js1SSug0Dpg/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxN3x8fHx8fHx8MTc2Mjk1MTQxNXw"},width:5084,height:3813},{urls:{raw:"https://images.unsplash.com/photo-1762763954800-c77f92354aff?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762763954800-c77f92354aff?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762763954800-c77f92354aff?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762763954800-c77f92354aff?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762763954800-c77f92354aff?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762763954800-c77f92354aff"},links:{self:"https://api.unsplash.com/photos/hexagonal-basalt-columns-with-water-pools-IuXpGuPErns",html:"https://unsplash.com/photos/hexagonal-basalt-columns-with-water-pools-IuXpGuPErns",download:"https://unsplash.com/photos/IuXpGuPErns/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOHx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/IuXpGuPErns/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOHx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:6336,height:9520},{urls:{raw:"https://images.unsplash.com/photo-1762710940358-e3351cc9ff34?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762710940358-e3351cc9ff34?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762710940358-e3351cc9ff34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762710940358-e3351cc9ff34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762710940358-e3351cc9ff34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOXx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762710940358-e3351cc9ff34"},links:{self:"https://api.unsplash.com/photos/full-moon-rising-over-a-dark-silhouetted-mountain-ridge-4CFLle2o910",html:"https://unsplash.com/photos/full-moon-rising-over-a-dark-silhouetted-mountain-ridge-4CFLle2o910",download:"https://unsplash.com/photos/4CFLle2o910/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOXx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/4CFLle2o910/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwxOXx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:4e3,height:6e3},{urls:{raw:"https://images.unsplash.com/photo-1762709781475-14fb1c385eac?ixid=M3wxMTY5OTZ8MHwxfGFsbHwyMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0",full:"https://images.unsplash.com/photo-1762709781475-14fb1c385eac?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwyMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=85",regular:"https://images.unsplash.com/photo-1762709781475-14fb1c385eac?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwyMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=1080",small:"https://images.unsplash.com/photo-1762709781475-14fb1c385eac?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwyMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=400",thumb:"https://images.unsplash.com/photo-1762709781475-14fb1c385eac?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfGFsbHwyMHx8fHx8fHx8MTc2Mjk1MTQxNXw&ixlib=rb-4.1.0&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1762709781475-14fb1c385eac"},links:{self:"https://api.unsplash.com/photos/runners-embrace-after-a-race-possibly-cold-competition-eA9lsojLOog",html:"https://unsplash.com/photos/runners-embrace-after-a-race-possibly-cold-competition-eA9lsojLOog",download:"https://unsplash.com/photos/eA9lsojLOog/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwyMHx8fHx8fHx8MTc2Mjk1MTQxNXw",download_location:"https://api.unsplash.com/photos/eA9lsojLOog/download?ixid=M3wxMTY5OTZ8MHwxfGFsbHwyMHx8fHx8fHx8MTc2Mjk1MTQxNXw"},width:4672,height:7008}],n=p(({store:i})=>l("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[x("div",{style:{padding:"0 4px",marginBottom:10},children:x(f,{placeholder:o("sidePanel.searchPlaceholder")})}),x(t,{shadowEnabled:!1,images:w,getPreview:s=>s.urls.regular,isLoading:!1,error:!1,onSelect:s=>{console.log("args ---> ",i,s)}})]}));export{n as a};
@@ -1 +0,0 @@
1
- import{c as e}from"./chunk-YCFED7XQ.js";import{Popover as c,Button as p}from"antd";import{Rotate3d as n,FlipHorizontal as y,FlipVertical as d}from"lucide-react";import{useState as b,useEffect as m,useCallback as f}from"react";import{observer as u}from"mobx-react-lite";import{jsx as i,jsxs as x}from"react/jsx-runtime";var F=u(({element:o,store:l})=>{let[t,r]=b({flipX:!1,flipY:!1}),a=f(()=>{l.editor?.objectsHandler.update({flipX:!t.flipX}),r({...t,flipX:!t.flipX})},[l.editor,t]),s=f(()=>{l.editor?.objectsHandler.update({flipY:!t.flipY}),r({...t,flipY:!t.flipY})},[l.editor,t]);return m(()=>{o&&r({flipX:o.flipX,flipY:o.flipY})},[o]),i(c,{trigger:"click",content:x("div",{style:{width:165},children:[i(p,{type:"text",block:!0,style:{justifyContent:"start"},icon:i(y,{size:16,style:{display:"flex"}}),onClick:a,children:e("toolbar.flipHorizontally")}),i(p,{type:"text",block:!0,style:{justifyContent:"start"},icon:i(d,{size:16,style:{display:"flex"}}),onClick:s,children:e("toolbar.flipVertically")})]}),children:i(p,{type:"text",icon:i(n,{size:16,style:{display:"flex"}}),styles:{root:{padding:"0 7px"}},children:e("toolbar.flip")})})});export{F as a};
@@ -1 +0,0 @@
1
- import{b as t,c as e,d as a,e as i,f as o,g as h,h as p,i as x,j as r}from"./chunk-7NNOHYKX.js";var n=(L=>(L.ROUND_RECT="roundRect",L.ROUND_RECT_DIAGONAL="roundRectDiagonal",L.ROUND_RECT_SINGLE="roundRectSingle",L.ROUND_RECT_SAMESIDE="roundRectSameSide",L.CUT_RECT_DIAGONAL="cutRectDiagonal",L.CUT_RECT_SINGLE="cutRectSingle",L.CUT_RECT_SAMESIDE="cutRectSameSide",L.MESSAGE="message",L.ROUND_MESSAGE="roundMessage",L.L="L",L.RING_RECT="ringRect",L.PLUS="plus",L.TRIANGLE="triangle",L.PARALLELOGRAM_LEFT="parallelogramLeft",L.PARALLELOGRAM_RIGHT="parallelogramRight",L.TRAPEZOID="trapezoid",L.BULLET="bullet",L.INDICATOR="indicator",L))(n||{}),v=[{name:"\u57FA\u7840",children:[{viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",type:"rect"},{viewBox:[200,200],path:t({width:200,height:200}),type:"circle"},{viewBox:[200,200],path:"M 0,100 A 100,50 0 1 1 200,100 A 100,50 0 1 1 0,100 Z",type:"ellipse"},{viewBox:[200,200],path:"M 100,50 L 200,150 L 0,150 Z",type:"triangle"}]},{name:"\u77E9\u5F62",children:[{viewBox:[200,200],path:"M 50 0 L 150 0 Q 200 0 200 50 L 200 150 Q 200 200 150 200 L 50 200 Q 0 200 0 150 L 0 50 Q 0 0 50 0 Z"},{viewBox:[200,200],path:"M 0 150 L 0 0 L 150 0 L 200 50 L 200 200 L 50 200 Z"},{viewBox:[200,200],path:"M 0 200 L 0 0 L 150 0 L 200 50 L 200 200 Z"},{viewBox:[200,200],path:"M 0 50 L 50 0 L 150 0 L 200 50 L 200 200 L 0 200 Z"},{viewBox:[200,200],path:"M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 50 200 Q 0 200 0 150 L 0 0 Z"},{viewBox:[200,200],path:"M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 0 50 Q 0 0 50 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 Z"}]},{name:"\u5E38\u89C4\u5F62\u72B6",children:[{viewBox:[200,200],path:e({width:200,height:200})},{viewBox:[200,200],path:a({width:200,height:200})},{viewBox:[200,200],path:i({width:200,height:200})},{viewBox:[200,200],path:o({width:200,height:200})},{viewBox:[200,200],path:h({width:200,height:200})},{viewBox:[200,200],path:p({width:200,height:200})},{viewBox:[200,200],path:x({width:200,height:200})},{viewBox:[200,200],path:r({width:200,height:200})}]},{name:"\u5E38\u7528\u5F62\u72B6",children:[{viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 200 L 200 200 L 100 0 Z",pathFormula:"triangle"},{viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z"},{viewBox:[200,200],path:"M 50 0 L 200 0 L 150 200 L 0 200 L 50 0 Z",pathFormula:"parallelogramLeft"},{viewBox:[200,200],path:"M 0 0 L 150 0 L 200 200 L 50 200 L 0 0 Z",pathFormula:"parallelogramRight"},{viewBox:[200,200],path:"M 50 0 L 150 0 L 200 200 L 0 200 L 50 0 Z",pathFormula:"trapezoid"},{viewBox:[200,200],path:"M 100 0 L 0 100 L 100 200 L 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 50 L 0 200 L 200 200 L 200 50 L 100 0 Z",pathFormula:"bullet"},{viewBox:[200,200],path:"M 200 100 L 150 0 L 0 0 L 50 100 L 0 200 L 150 200 L 200 100 Z",pathFormula:"indicator"},{viewBox:[200,200],path:"M 0 200 A 50 100 0 1 1 200 200 L 0 200 Z"},{viewBox:[200,200],path:"M 40 20 A 100 100 0 1 0 200 100 L 100 100 L 40 20 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 100 100 L 100 0 Z"},{viewBox:[200,200],path:"M 160 20 A 100 100 0 1 0 200 100 L 100 100 L 160 20 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 200 0 L 100 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 0 Q 200 200 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 90 L 50 200 L 150 200 L 200 90 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 60 L 0 140 L 100 200 L 200 140 L 200 60 L 100 0 Z"},{viewBox:[200,200],path:"M 60 0 L 140 0 L 200 60 L 200 140 L 140 200 L 60 200 L 0 140 L 0 60 L 60 0 Z"},{viewBox:[200,200],path:"M 75 0 L 125 0 L 175 25 L 200 75 L 200 125 L 175 175 L 125 200 L 75 200 L 25 175 L 0 125 L 0 75 L 25 25 L 75 0 Z"},{viewBox:[200,200],path:"M 150 0 A 50 100 0 1 1 150 200 L 0 200 L 0 0 L 150 0 Z"},{viewBox:[200,200],path:"M 50 0 A 25 50 0 1 0 50 200 L 150 200 A 25 50 0 1 0 150 0 L 50 0 Z"},{viewBox:[200,200],path:"M 150 0 A 50 100 0 1 1 150 200 L 0 200 A 50 100 0 0 0 0 0 L 150 0 Z"},{viewBox:[200,200],path:"M 200 0 L 200 200 L 0 200 L 0 100 L 200 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 100 L 200 200 L 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 200 0 L 100 0 L 0 100 L 0 200 L 200 0 Z"},{viewBox:[200,200],path:"M 50 0 L 150 0 L 150 50 L 200 50 L 200 150 L 150 150 L 150 200 L 50 200 L 50 150 L 0 150 L 0 50 L 50 50 L 50 0 Z"},{viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 L 200 140 L 60 140 L 60 0 L 0 0 Z",pathFormula:"L"},{viewBox:[200,200],path:"M0 0 L200 0 L200 200 L0 200 L0 0 Z M50 50 L50 150 L150 150 L150 50 Z",pathFormula:"ringRect"},{viewBox:[200,200],path:"M0 100 A100 100 0 1 1 0 101 Z M150 100 A50 50 0 1 0 150 101 Z"},{viewBox:[200,200],path:"M 70 0 L 70 70 L 0 70 L 0 130 L 70 130 L 70 200 L 130 200 L 130 130 L 200 130 L 200 70 L 130 70 L 130 0 L 70 0 Z",pathFormula:"plus"},{viewBox:[200,200],path:"M 40 0 L 0 40 L 60 100 L 0 160 L 40 200 L 100 140 L 160 200 L 200 160 L 140 100 L 200 40 L 160 0 L 100 60 L 40 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 0 L 200 160 L 100 160 L 60 200 L 60 160 L 0 160 Z",pathFormula:"message"},{viewBox:[200,200],path:"M 0 40 Q 0 0 40 0 L 160 0 Q 200 0 200 40 L 200 120 Q 200 160 160 160 L 100 160 L 60 200 L 60 160 L 40 160 Q 0 160 0 120 L 0 40 Z",pathFormula:"roundMessage"},{viewBox:[200,200],path:"M 180 160 A 100 100 0 1 0 100 200 L 200 200 L 200 160 L 180 160 Z"},{viewBox:[200,200],path:"M 200 0 L 0 0 L 200 200 L 0 200 L 200 0 Z"},{viewBox:[200,200],path:"M 0 20 C 60 60 140 -40 200 20 L 200 180 C 140 140 60 240 0 180 L 0 20 Z"},{viewBox:[200,200],path:"M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z"},{viewBox:[200,200],path:"M 100 0 Q 0 50 0 175 Q 100 225 200 175 Q 200 50 100 0 Z"},{viewBox:[200,200],path:"M 0 100 A 50 50 0 1 1 200 100 L 100 200 L 0 100 Z"},{viewBox:[200,200],path:"M 100 0 L 60 60 L 0 100 L 60 140 L 100 200 L 140 140 L 200 100 L 140 60 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 80 40 L 20 20 L 40 80 L 0 100 L 40 120 L 20 180 L 80 160 L 100 200 L 120 160 L 180 180 L 160 120 L 200 100 L 160 80 L 180 20 L 120 40 L 100 0 Z"}]}],s=[{path:"M 0 0 L 20 20",style:"solid",points:["",""],data:[{x:0,y:0},{x:200,y:0}]}],Z=[{name:"\u76F4\u7EBF",children:[{path:"M 0 0 L 20 20",style:"solid",points:["",""],data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 L 20 20",style:"dashed",points:["",""],data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 L 20 20",style:"solid",points:["","arrow"],data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 L 20 20",style:"dashed",points:["","arrow"],data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 L 20 20",style:"solid",points:["","dot"],data:[{x:0,y:0},{x:200,y:0}]}]},{name:"\u6298\u7EBF\u3001\u66F2\u7EBF",children:[{path:"M 0 0 L 0 20 L 20 20",style:"solid",points:["","arrow"],isBroken:!0,data:[{x:0,y:0},{x:0,y:100},{x:200,y:100}]},{path:"M 0 0 Q 0 20 20 20",style:"solid",points:["","arrow"],isCurve:!0,data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 C 20 0 0 20 20 20",style:"solid",points:["","arrow"],isCubic:!0,data:[{x:0,y:0},{x:200,y:0}]}]}];export{n as a,v as b,s as c,Z as d};
@@ -1,54 +0,0 @@
1
- import{a as T}from"./chunk-TS5CKDHH.js";import{a as x}from"./chunk-DGCF2GDA.js";import{a as v}from"./chunk-QWM7VMLQ.js";import{a as t}from"./chunk-ESNVOB52.js";import{a as f}from"./chunk-HHYPIHAP.js";import{a as h}from"./chunk-IV52R7D7.js";import{b as y}from"./chunk-JPIYZYMQ.js";import{b as u}from"./chunk-PSO4W6J7.js";import{c,d as P}from"./chunk-WCHGSVUC.js";import{a as g}from"./chunk-5X6VER6G.js";import{c as i}from"./chunk-YCFED7XQ.js";import r from"styled-components";import{useRef as k,useLayoutEffect as L}from"react";import{observer as a}from"mobx-react-lite";import{LayoutTemplate as B,TypeOutline as N,Image as M,Shapes as H,Upload as I,Wallpaper as R,Layers as E,ImageUpscale as U}from"lucide-react";import{clsx as $}from"clsx";import{theme as D}from"antd";import{jsx as n,jsxs as d}from"react/jsx-runtime";var F=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
- `,O=r.div`
11
- @media screen and (min-width: 501px) {
12
- overflow-y: auto;
13
- overflow-x: hidden;
14
- min-width: 72px;
15
- }
16
- `,W=r.div`
17
- display: flex;
18
- flex-direction: column;
19
- `,A=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
- `,_=r.div`
31
- display: none;
32
- ${c(`
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
- `,j=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
- ${c(`
52
- display: none;
53
- `)}
54
- `,q=({onClick:e})=>n(j,{onClick:e,children:n("div",{children:d("button",{className:"grid relative justify-center arrow cursor-pointer",children:[d("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"})})})})]})})}),G={name:"templates",Tab:a(e=>n(t,{name:i("sidePanel.templates"),...e,children:n(B,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(f,{store:e})},J={name:"text",Tab:a(e=>n(t,{name:i("sidePanel.text"),...e,children:n(N,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(h,{store:e})},K={name:"photos",Tab:a(e=>n(t,{name:i("sidePanel.photos"),...e,children:n(M,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(T,{store:e})},Q={name:"shapes",Tab:a(e=>n(t,{name:i("sidePanel.shapes"),...e,children:n(H,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(x,{store:e})},V={name:"upload",Tab:a(e=>n(t,{name:i("sidePanel.upload"),...e,children:n(I,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(y,{store:e})},X={name:"background",Tab:a(e=>n(t,{name:i("sidePanel.background"),...e,children:n(R,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(u,{store:e})},Y={name:"layers",Tab:a(e=>n(t,{name:i("sidePanel.layers"),...e,children:n(E,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(g,{store:e})},Z={name:"size",Tab:a(e=>n(t,{name:i("sidePanel.resize"),...e,children:n(U,{style:{display:"inline-block"},size:20})})),Panel:({store:e})=>n(v,{store:e})},ee=[G,J,K,Q,V,X,Y,Z],ne=a(({store:e,sections:w,defaultSection:m="templates"})=>{(()=>{let o=k(!0);o.current&&(o.current=!1,e.openSidePanel(m))})();let{token:l}=D.useToken(),s=P();L(()=>{s?e.openSidePanel(""):e.openSidePanel(m)},[s]);let b=[...w||ee].filter(o=>o.visibleInList!==!1),S=b.find(o=>o.name===e.openedSidePanel)?.Panel,C=k(null);return d(F,{className:`bp5-navbar design-side-panel ${e.openedSidePanel?"":"collapsed"}`,style:{backgroundColor:l.colorBgContainer,color:l.colorText},children:[n(O,{className:"design-side-tabs-container",ref:C,style:{borderRight:`1px solid ${l.colorBorder}`},children:n(W,{className:"design-side-tabs-inner",children:b.map(({name:o,Tab:p})=>n(p,{active:e.openedSidePanel===o,onClick:()=>{o===e.openedSidePanel?e.openSidePanel(""):e.openSidePanel(o)}},o))})}),S&&n(A,{className:$("bp5-navbar design-panel-container"),style:{borderRight:`1px solid ${l.colorBorder}`},onClick:o=>{let p=o.target.closest(".design-close-panel"),z=o.target.closest(".design-mobile");p&&(s||z)&&e.openSidePanel("")},children:n(S,{store:e})}),e.openedSidePanel&&n(_,{onClick:()=>e.openSidePanel("")}),e.openedSidePanel&&n(q,{onClick:()=>e.openSidePanel("")})]})}),xe=ne;export{G as a,J as b,K as c,Q as d,V as e,X as f,Y as g,Z as h,ee as i,ne as j,xe as k};
@@ -1,16 +0,0 @@
1
- import{a as H}from"./chunk-2A3HHQ7X.js";import{c as R}from"./chunk-KVT25LDU.js";import{d as D}from"./chunk-HOAYYKAZ.js";import{a as w}from"./chunk-Z4QXUZAS.js";import{a as G}from"./chunk-XRRO2RT7.js";import{a as N}from"./chunk-YCJBBRRT.js";import{a as S}from"./chunk-5OA2JYPB.js";import{b as k}from"./chunk-7YLSIB43.js";import{a as x}from"./chunk-J6PYM4EV.js";import{e as a}from"./chunk-62YF5KTO.js";import{a as E}from"./chunk-T3TEB73P.js";import{b as B}from"./chunk-O56ZNYGR.js";import{c as f}from"./chunk-YCFED7XQ.js";import g from"styled-components";import{useRef as Y}from"react";import{Tooltip as P,Button as z}from"antd";import{Undo2 as q,Redo2 as J}from"lucide-react";import{observer as K}from"mobx-react-lite";import{useEffect as Q,useState as V}from"react";import{jsx as p,jsxs as W}from"react/jsx-runtime";var O=K(({store:o})=>{let[i,n]=V({hasUndo:!1,hasRedo:!1});return Q(()=>{let l=o.editor,c=s=>{n(s)};return l&&l.on("history:changed",c),()=>{l&&l.off("history:changed",c)}},[o.editor]),W(b,{style:{float:"left",paddingRight:10},children:[p(P,{title:f("toolbar.undo"),placement:"bottom",children:p(z,{type:"text",disabled:!i.hasUndo,styles:{root:{padding:"0 7px"}},onClick:()=>{o.editor?.historyHandler.undo()},children:p(q,{size:16})})}),p(P,{title:f("toolbar.redo"),placement:"bottom",children:p(z,{type:"text",disabled:!i.hasRedo,styles:{root:{padding:"0 7px"}},onClick:()=>{o.editor?.historyHandler.redo()},children:p(J,{size:16})})})]})});import{observer as Z}from"mobx-react-lite";import{Button as I,Divider as _,Space as $,theme as oo}from"antd";import{Check as to,X as eo}from"lucide-react";import{Fragment as so,jsx as e,jsxs as m}from"react/jsx-runtime";var ro=g.div`
2
- white-space: nowrap;
3
-
4
- height: 50px;
5
- padding: 0 15px;
6
- position: relative;
7
- width: 100%;
8
- z-index: 10;
9
- `,no=g.div`
10
- width: 100%;
11
- height: 100%;
12
- `,b=g.div`
13
- align-items: center;
14
- display: flex;
15
- height: 50px;
16
- `,io=({store:o})=>m($,{style:{height:50},children:[m(I,{onClick:()=>{o.editor?.imageCropHandler.cropImg.onDeselectEvent()},children:[e(to,{size:16}),"\u5B8C\u6210"]}),m(I,{onClick:()=>{o.editor?.imageCropHandler.cropCancel()},children:[e(eo,{size:16}),"\u53D6\u6D88"]})]}),y={textbox:R,image:D,path:a,rect:a,circle:a,ellipse:a,triangle:a,cropimage:io,many:G};function Oo(o,i){y[o]=i}var lo=Z(({store:o,downloadButtonEnabled:i,components:n={}})=>{let l=new Set(o.selectedElements.map(r=>r?.type)).size===1,c=o.selectedElements.length===1,s=o.selectedElements[0],h=o.selectedElements.length&&o.selectedElements.every(r=>r?.locked),v=c&&s?.isCropping,{token:T}=oo.useToken(),d=c&&y[s?.type];l?d=y[s?.type]:o.selectedElements.length>1&&(d=y.many);let u=Y(n);(Object.keys(n).some(r=>n[r]!==u.current[r])||Object.keys(u.current).some(r=>!(r in n)))&&(u.current=Object.assign({},n));let t=u.current,C=t?.ActionControls||(i?k:null),L=t?.Position||S,U=t?.Opacity||N,j=t?.Lock||w,A=t?.Duplicate||x,F=t?.Remove||H,M=t?.History||O,X=t?.Group||E;return e(ro,{className:"bp5-navbar design-toolbar",style:{backgroundColor:T.colorBgContainer,color:T.colorText},children:m(no,{children:[!v&&e(M,{store:o}),!s&&e(B,{store:o,components:t}),d&&!h&&e(d,{store:o,components:t}),!v&&m(b,{style:{float:"right"},children:[e(X,{store:o}),e(L,{store:o}),!h&&e(U,{store:o}),e(j,{store:o}),e(A,{store:o}),e(F,{store:o}),C&&m(so,{children:[e(_,{orientation:"vertical",style:{margin:"0 15px"}}),e(C,{store:o})]})]})]})})}),Io=lo;export{b as a,Oo as b,lo as c,Io as d,O as e};
@@ -1,8 +0,0 @@
1
- import{useState as s,useEffect as r}from"react";var o=768,i=()=>window.innerWidth<=o,l=e=>`
2
- @media (max-width: ${o}px) {
3
- ${e}
4
- .ydesign-editor-mobile & {
5
- ${e}
6
- }
7
- }
8
- `,a=()=>{let[e,n]=s(i());return r(()=>{let t=()=>{n(i())};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),e};export{o as a,i as b,l as c,a as d};
@@ -1,9 +0,0 @@
1
- import*as A from"mobx";var u=A.observable([]);function S(t){u.push(t)}function I(t){let e=u.findIndex(n=>n.fontFamily===t);e!==-1&&u.splice(e,1)}function O(t){u.replace(t)}var E="Some test text;?#D-\u041F\u0420\u0418\u0412\u0415\u0422!1230o9u8i7y6t5r4e3w2q1",g=null;function i(t,e="Arial",n="normal",s="normal"){g||(g=document.createElement("canvas"));let o=g.getContext("2d");return o.font=`${n} ${s} 40px '${t}', ${e}`,o.measureText(E).width}var c={Arial:!0},N=t=>!!c[t],v=6e3,p=60,y=()=>{},R=t=>{y=t},$=()=>v,W=t=>{$=t};async function M(t,e="normal",n="normal"){if(c[t])return;let s=!!document.fonts?.load,o=i("Arial","Arial",e,n);if(s)try{if(await document.fonts.load(`${n} ${e} 16px '${t}'`),i(t,"Arial",e,n)!==o){c[t]=!0;return}}catch{}let l=i("Times","Times",e,n),a=i(t,"Arial",e,n),d=Math.min(v,$())/p;for(let m=0;m<d;m++){let x=i(t,"Arial",e,n),C=i(t,"Times",e,n);if(x!==a||x!==o||C!==l){await T(p),c[t]=!0;return}await T(p)}let f=`Timeout for loading font "${t}". Is it a correct font family?`;console.warn(f),y(f)}function T(t){return new Promise(e=>setTimeout(e,t))}var F={},r=null;function w(){return r||(r=document.getElementById("custom-font-style"),r||(r=document.createElement("style"),r.id="custom-font-style",document.head.appendChild(r))),r.sheet}function P(t){let{fontFamily:e,url:n,styles:s}=t;if(F[e]||!n&&!s)return;let o=s||(n?[{src:`url("${n}")`}]:[]),l=w();o.forEach(a=>{let d=`
2
- @font-face {
3
- font-family: '${e}';
4
- src: ${a.src};
5
- font-style: ${a.fontStyle||"normal"};
6
- font-weight: ${a.fontWeight||"normal"};
7
- font-display: swap;
8
- }
9
- `;l.insertRule(d,l.cssRules.length)}),F[e]=!0}var b={},h="400,400italic,700,700italic";function j(t){h=t}function V(){return h}function L(t){return`https://fonts.googleapis.com/css?family=${t.replace(/ /g,"+")}:${h}`}function k(t){if(b[t])return;let e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=L(t),document.head.appendChild(e),b[t]=!0}export{u as a,S as b,I as c,O as d,N as e,R as f,W as g,M as h,P as i,j,V as k,L as l,k as m};
@@ -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 i,jsxs as v}from"react/jsx-runtime";var p=({store:e})=>{let o=c.useRef(null);return r(()=>{let s=o.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,()=>{t.destroy()}},[]),v("div",{id:"canvas_container",ref:o,style:{flex:1,position:"relative",overflow:"hidden"},className:"bg-[#ecf0f1] dark:bg-[#92969d]",children:[i("div",{className:"inside-shadow w-full h-full shadow-inner",style:{position:"absolute",zIndex:2,pointerEvents:"none"}}),i("div",{style:{position:"absolute",height:"100%",width:"100%"},children:i("canvas",{id:"canvas"})})]})},b=l(p);export{p as a,b};
@@ -1 +0,0 @@
1
- import{jsx as d}from"react/jsx-runtime";var o=()=>d("div",{}),r=o;export{o as a,r as b};
@@ -1 +0,0 @@
1
- import{c as r}from"./chunk-YCFED7XQ.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 m=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=l=>{let p=Math.max(0,Math.min(l,100));i(p),o.set({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:!m,styles:{root:{padding:"0 7px"}},children:t(d,{size:16})})})})});export{M as a};