@mieweb/ui 0.10.0-dev.4 → 0.10.0-dev.41

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 (811) hide show
  1. package/README.md +4 -4
  2. package/agent/mieweb-ui.instructions.md +90 -1
  3. package/dist/CsvBlock-CFXSDPBI.js +9 -0
  4. package/dist/{CsvBlock-UWPMTLE2.js.map → CsvBlock-CFXSDPBI.js.map} +1 -1
  5. package/dist/CsvBlock-RGO7JXHJ.cjs +18 -0
  6. package/dist/{CsvBlock-ROJCKJDP.cjs.map → CsvBlock-RGO7JXHJ.cjs.map} +1 -1
  7. package/dist/HtmlPreviewBlock-VBYXCXVT.cjs +18 -0
  8. package/dist/{HtmlPreviewBlock-DWFN6EUB.cjs.map → HtmlPreviewBlock-VBYXCXVT.cjs.map} +1 -1
  9. package/dist/HtmlPreviewBlock-Z2GCK325.js +9 -0
  10. package/dist/{HtmlPreviewBlock-ME5U3XNS.js.map → HtmlPreviewBlock-Z2GCK325.js.map} +1 -1
  11. package/dist/MermaidBlock-I2R2BQOX.cjs +18 -0
  12. package/dist/{MermaidBlock-D2UC5M55.cjs.map → MermaidBlock-I2R2BQOX.cjs.map} +1 -1
  13. package/dist/MermaidBlock-XCAK7IA5.js +9 -0
  14. package/dist/{MermaidBlock-2B6CPD6Y.js.map → MermaidBlock-XCAK7IA5.js.map} +1 -1
  15. package/dist/SurveyBlock-KI5JOWCL.js +9 -0
  16. package/dist/{SurveyBlock-4DO62RBT.js.map → SurveyBlock-KI5JOWCL.js.map} +1 -1
  17. package/dist/SurveyBlock-UKSGISRT.cjs +18 -0
  18. package/dist/{SurveyBlock-4CD4AYMJ.cjs.map → SurveyBlock-UKSGISRT.cjs.map} +1 -1
  19. package/dist/ag-grid.d.cts +142 -1
  20. package/dist/ag-grid.d.ts +142 -1
  21. package/dist/brands/bluehive.cjs +3 -3
  22. package/dist/brands/bluehive.css +3 -0
  23. package/dist/brands/bluehive.js +1 -1
  24. package/dist/brands/index.cjs +14 -14
  25. package/dist/brands/index.js +4 -4
  26. package/dist/{chunk-3M7TAXNR.js → chunk-24AFHH4J.js} +3 -3
  27. package/dist/{chunk-3M7TAXNR.js.map → chunk-24AFHH4J.js.map} +1 -1
  28. package/dist/{chunk-JYZW2PZS.cjs → chunk-254QK722.cjs} +7 -7
  29. package/dist/chunk-254QK722.cjs.map +1 -0
  30. package/dist/{chunk-VPIYTQCV.cjs → chunk-2I4IRQQG.cjs} +12 -5
  31. package/dist/chunk-2I4IRQQG.cjs.map +1 -0
  32. package/dist/chunk-2X54ZLT6.js +874 -0
  33. package/dist/chunk-2X54ZLT6.js.map +1 -0
  34. package/dist/{chunk-5MCBWTIF.cjs → chunk-32ZCJOSR.cjs} +4 -4
  35. package/dist/{chunk-5MCBWTIF.cjs.map → chunk-32ZCJOSR.cjs.map} +1 -1
  36. package/dist/chunk-3YBS4WUQ.js +52 -0
  37. package/dist/chunk-3YBS4WUQ.js.map +1 -0
  38. package/dist/{chunk-WNJRS7Y7.cjs → chunk-3ZWCIPFT.cjs} +4 -2
  39. package/dist/chunk-3ZWCIPFT.cjs.map +1 -0
  40. package/dist/chunk-434L5RYF.js +314 -0
  41. package/dist/chunk-434L5RYF.js.map +1 -0
  42. package/dist/{chunk-TPWKM7JH.js → chunk-43K7OQ3E.js} +3 -3
  43. package/dist/{chunk-TPWKM7JH.js.map → chunk-43K7OQ3E.js.map} +1 -1
  44. package/dist/chunk-47P5QLX4.cjs +42 -0
  45. package/dist/chunk-47P5QLX4.cjs.map +1 -0
  46. package/dist/chunk-4IS3QCOQ.cjs +453 -0
  47. package/dist/chunk-4IS3QCOQ.cjs.map +1 -0
  48. package/dist/chunk-4NCDU5IG.cjs +56 -0
  49. package/dist/chunk-4NCDU5IG.cjs.map +1 -0
  50. package/dist/chunk-4ZB7RSMY.cjs +306 -0
  51. package/dist/chunk-4ZB7RSMY.cjs.map +1 -0
  52. package/dist/chunk-522WJIVI.js +99 -0
  53. package/dist/chunk-522WJIVI.js.map +1 -0
  54. package/dist/chunk-56VTM4OX.js +261 -0
  55. package/dist/chunk-56VTM4OX.js.map +1 -0
  56. package/dist/chunk-5HKZR6UG.js +248 -0
  57. package/dist/chunk-5HKZR6UG.js.map +1 -0
  58. package/dist/chunk-6BNZLN4B.cjs +548 -0
  59. package/dist/chunk-6BNZLN4B.cjs.map +1 -0
  60. package/dist/chunk-6N7NMOSV.js +233 -0
  61. package/dist/chunk-6N7NMOSV.js.map +1 -0
  62. package/dist/chunk-6TTCZY3P.cjs +4 -0
  63. package/dist/chunk-6TTCZY3P.cjs.map +1 -0
  64. package/dist/{chunk-YQDA366U.js → chunk-753ENNB6.js} +2 -2
  65. package/dist/{chunk-YQDA366U.js.map → chunk-753ENNB6.js.map} +1 -1
  66. package/dist/{chunk-N6IY47YA.cjs → chunk-7C5W744U.cjs} +8 -8
  67. package/dist/{chunk-N6IY47YA.cjs.map → chunk-7C5W744U.cjs.map} +1 -1
  68. package/dist/chunk-7E46YDOT.cjs +122 -0
  69. package/dist/chunk-7E46YDOT.cjs.map +1 -0
  70. package/dist/chunk-7HUTR6RX.js +178 -0
  71. package/dist/chunk-7HUTR6RX.js.map +1 -0
  72. package/dist/chunk-7IRTD4JT.cjs +61 -0
  73. package/dist/chunk-7IRTD4JT.cjs.map +1 -0
  74. package/dist/{chunk-KZFBQ7GY.js → chunk-7QW6TU4X.js} +3 -3
  75. package/dist/{chunk-KZFBQ7GY.js.map → chunk-7QW6TU4X.js.map} +1 -1
  76. package/dist/{chunk-MWVW4APN.cjs → chunk-7UTBDFFL.cjs} +4 -4
  77. package/dist/{chunk-MWVW4APN.cjs.map → chunk-7UTBDFFL.cjs.map} +1 -1
  78. package/dist/chunk-7WJ6MBF5.cjs +47 -0
  79. package/dist/chunk-7WJ6MBF5.cjs.map +1 -0
  80. package/dist/{chunk-FJ7YPVKV.js → chunk-7X6R3JIA.js} +3 -3
  81. package/dist/{chunk-FJ7YPVKV.js.map → chunk-7X6R3JIA.js.map} +1 -1
  82. package/dist/chunk-A4W5CSK7.cjs +216 -0
  83. package/dist/chunk-A4W5CSK7.cjs.map +1 -0
  84. package/dist/{chunk-2G75X6TS.cjs → chunk-AHHFFXJR.cjs} +3 -3
  85. package/dist/{chunk-2G75X6TS.cjs.map → chunk-AHHFFXJR.cjs.map} +1 -1
  86. package/dist/chunk-AJPFQF3H.cjs +896 -0
  87. package/dist/chunk-AJPFQF3H.cjs.map +1 -0
  88. package/dist/chunk-AMYFRY7K.js +3 -0
  89. package/dist/chunk-AMYFRY7K.js.map +1 -0
  90. package/dist/{chunk-VNYW4C4J.cjs → chunk-ANMX7YDL.cjs} +4 -84
  91. package/dist/chunk-ANMX7YDL.cjs.map +1 -0
  92. package/dist/chunk-ARIJ5OHW.cjs +139 -0
  93. package/dist/chunk-ARIJ5OHW.cjs.map +1 -0
  94. package/dist/{chunk-DVOQ3JNO.js → chunk-B4CKCNWD.js} +16 -8
  95. package/dist/chunk-B4CKCNWD.js.map +1 -0
  96. package/dist/chunk-BJ6ABRSQ.cjs +256 -0
  97. package/dist/chunk-BJ6ABRSQ.cjs.map +1 -0
  98. package/dist/chunk-BM35CACB.js +148 -0
  99. package/dist/chunk-BM35CACB.js.map +1 -0
  100. package/dist/{chunk-G3JX3UAU.cjs → chunk-BWSZ2BHJ.cjs} +6 -6
  101. package/dist/{chunk-G3JX3UAU.cjs.map → chunk-BWSZ2BHJ.cjs.map} +1 -1
  102. package/dist/chunk-BXRQ6HEP.cjs +4 -0
  103. package/dist/chunk-BXRQ6HEP.cjs.map +1 -0
  104. package/dist/{chunk-SGFYA22I.cjs → chunk-C77FAR3F.cjs} +8 -8
  105. package/dist/{chunk-SGFYA22I.cjs.map → chunk-C77FAR3F.cjs.map} +1 -1
  106. package/dist/chunk-CBBKWRLG.js +213 -0
  107. package/dist/chunk-CBBKWRLG.js.map +1 -0
  108. package/dist/{chunk-UAMXCMST.cjs → chunk-CFI3TQMA.cjs} +3 -3
  109. package/dist/{chunk-UAMXCMST.cjs.map → chunk-CFI3TQMA.cjs.map} +1 -1
  110. package/dist/chunk-CLQW724U.cjs +271 -0
  111. package/dist/chunk-CLQW724U.cjs.map +1 -0
  112. package/dist/chunk-CPDNX3LS.cjs +47 -0
  113. package/dist/chunk-CPDNX3LS.cjs.map +1 -0
  114. package/dist/chunk-CVNPNZMX.js +44 -0
  115. package/dist/chunk-CVNPNZMX.js.map +1 -0
  116. package/dist/{chunk-2YCERQWC.js → chunk-CVXESGXJ.js} +10 -9
  117. package/dist/chunk-CVXESGXJ.js.map +1 -0
  118. package/dist/chunk-DGHS5IVD.js +305 -0
  119. package/dist/chunk-DGHS5IVD.js.map +1 -0
  120. package/dist/chunk-DHGCLPFZ.js +91 -0
  121. package/dist/chunk-DHGCLPFZ.js.map +1 -0
  122. package/dist/{chunk-GD7EBGC4.cjs → chunk-DHU3FFC3.cjs} +49 -19
  123. package/dist/chunk-DHU3FFC3.cjs.map +1 -0
  124. package/dist/chunk-DO2YN46R.cjs +201 -0
  125. package/dist/chunk-DO2YN46R.cjs.map +1 -0
  126. package/dist/chunk-DVDT7TX7.js +151 -0
  127. package/dist/chunk-DVDT7TX7.js.map +1 -0
  128. package/dist/chunk-DXEPYK3I.cjs +92 -0
  129. package/dist/chunk-DXEPYK3I.cjs.map +1 -0
  130. package/dist/{chunk-X4XPNTCZ.cjs → chunk-DZ3JTMKM.cjs} +136 -58
  131. package/dist/chunk-DZ3JTMKM.cjs.map +1 -0
  132. package/dist/chunk-EACNRR3C.cjs +4 -0
  133. package/dist/chunk-EACNRR3C.cjs.map +1 -0
  134. package/dist/{chunk-ZGRCSNPK.js → chunk-EEOGIGIA.js} +4 -4
  135. package/dist/{chunk-ZGRCSNPK.js.map → chunk-EEOGIGIA.js.map} +1 -1
  136. package/dist/chunk-EPCUPHEO.js +193 -0
  137. package/dist/chunk-EPCUPHEO.js.map +1 -0
  138. package/dist/{chunk-7ZXAQTV4.cjs → chunk-ERACGSDY.cjs} +8 -8
  139. package/dist/{chunk-7ZXAQTV4.cjs.map → chunk-ERACGSDY.cjs.map} +1 -1
  140. package/dist/{chunk-OD47TTAW.cjs → chunk-F2FOG4EG.cjs} +9 -9
  141. package/dist/{chunk-OD47TTAW.cjs.map → chunk-F2FOG4EG.cjs.map} +1 -1
  142. package/dist/chunk-F3EWRDIT.js +312 -0
  143. package/dist/chunk-F3EWRDIT.js.map +1 -0
  144. package/dist/{chunk-XCP454Q6.js → chunk-F4N67NAF.js} +12 -3
  145. package/dist/chunk-F4N67NAF.js.map +1 -0
  146. package/dist/{chunk-WGPLUCBD.js → chunk-F6W62K4J.js} +4 -4
  147. package/dist/{chunk-WGPLUCBD.js.map → chunk-F6W62K4J.js.map} +1 -1
  148. package/dist/chunk-FBCDYTWM.js +385 -0
  149. package/dist/chunk-FBCDYTWM.js.map +1 -0
  150. package/dist/{chunk-V7D3YGUV.js → chunk-FGLIP6YR.js} +4 -4
  151. package/dist/{chunk-V7D3YGUV.js.map → chunk-FGLIP6YR.js.map} +1 -1
  152. package/dist/{chunk-VU6UTJRM.js → chunk-FIKO4WR6.js} +3 -3
  153. package/dist/{chunk-VU6UTJRM.js.map → chunk-FIKO4WR6.js.map} +1 -1
  154. package/dist/chunk-FSGJXCBG.cjs +318 -0
  155. package/dist/chunk-FSGJXCBG.cjs.map +1 -0
  156. package/dist/chunk-FSWHZY3T.cjs +328 -0
  157. package/dist/chunk-FSWHZY3T.cjs.map +1 -0
  158. package/dist/chunk-FTEZNCRI.js +29 -0
  159. package/dist/chunk-FTEZNCRI.js.map +1 -0
  160. package/dist/{chunk-YVPC65ZJ.cjs → chunk-GF2BE4FB.cjs} +91 -32
  161. package/dist/chunk-GF2BE4FB.cjs.map +1 -0
  162. package/dist/{chunk-JEIW7BSV.cjs → chunk-GKDHMNUA.cjs} +2 -52
  163. package/dist/chunk-GKDHMNUA.cjs.map +1 -0
  164. package/dist/chunk-GM32IDVL.cjs +356 -0
  165. package/dist/chunk-GM32IDVL.cjs.map +1 -0
  166. package/dist/chunk-GVM6DTR5.js +90 -0
  167. package/dist/chunk-GVM6DTR5.js.map +1 -0
  168. package/dist/{chunk-SQHMGT4W.js → chunk-GW4RFJZ5.js} +7 -7
  169. package/dist/chunk-GW4RFJZ5.js.map +1 -0
  170. package/dist/chunk-GY5SP4ST.js +3 -0
  171. package/dist/chunk-GY5SP4ST.js.map +1 -0
  172. package/dist/chunk-H2Y7HZV5.js +3 -0
  173. package/dist/chunk-H2Y7HZV5.js.map +1 -0
  174. package/dist/chunk-H3P7POFC.cjs +337 -0
  175. package/dist/chunk-H3P7POFC.cjs.map +1 -0
  176. package/dist/{chunk-JID7AZTO.cjs → chunk-H3ROMJYI.cjs} +4 -4
  177. package/dist/{chunk-JID7AZTO.cjs.map → chunk-H3ROMJYI.cjs.map} +1 -1
  178. package/dist/{chunk-462XSCP3.cjs → chunk-HCIXGFWR.cjs} +4 -4
  179. package/dist/{chunk-462XSCP3.cjs.map → chunk-HCIXGFWR.cjs.map} +1 -1
  180. package/dist/{chunk-H4ZXMQQW.js → chunk-HDY7YQFX.js} +3 -3
  181. package/dist/{chunk-H4ZXMQQW.js.map → chunk-HDY7YQFX.js.map} +1 -1
  182. package/dist/chunk-HNFFFFYH.cjs +114 -0
  183. package/dist/chunk-HNFFFFYH.cjs.map +1 -0
  184. package/dist/chunk-HNXLLDPN.js +25 -0
  185. package/dist/chunk-HNXLLDPN.js.map +1 -0
  186. package/dist/{chunk-NV2CWBI2.cjs → chunk-IEY3ZJIT.cjs} +12 -3
  187. package/dist/chunk-IEY3ZJIT.cjs.map +1 -0
  188. package/dist/{chunk-3QEVGSFG.cjs → chunk-IGDO62KR.cjs} +5 -5
  189. package/dist/{chunk-3QEVGSFG.cjs.map → chunk-IGDO62KR.cjs.map} +1 -1
  190. package/dist/chunk-IT775BYG.js +179 -0
  191. package/dist/chunk-IT775BYG.js.map +1 -0
  192. package/dist/{chunk-N5O47VGS.cjs → chunk-IVGI353O.cjs} +2 -2
  193. package/dist/{chunk-N5O47VGS.cjs.map → chunk-IVGI353O.cjs.map} +1 -1
  194. package/dist/chunk-IWRBJHO3.cjs +51 -0
  195. package/dist/chunk-IWRBJHO3.cjs.map +1 -0
  196. package/dist/{chunk-VILW53UZ.js → chunk-JMAZ2GKT.js} +3 -3
  197. package/dist/{chunk-VILW53UZ.js.map → chunk-JMAZ2GKT.js.map} +1 -1
  198. package/dist/{chunk-WWJIW2IH.cjs → chunk-JSXIB6EJ.cjs} +4 -4
  199. package/dist/{chunk-WWJIW2IH.cjs.map → chunk-JSXIB6EJ.cjs.map} +1 -1
  200. package/dist/{chunk-KRU6IGV7.js → chunk-JUJGWUAN.js} +28 -6
  201. package/dist/chunk-JUJGWUAN.js.map +1 -0
  202. package/dist/{chunk-FXO5ARBB.cjs → chunk-KDW6BD4O.cjs} +4 -4
  203. package/dist/{chunk-FXO5ARBB.cjs.map → chunk-KDW6BD4O.cjs.map} +1 -1
  204. package/dist/{chunk-Z5V7SAZ4.js → chunk-KFEN2SRZ.js} +3 -3
  205. package/dist/{chunk-Z5V7SAZ4.js.map → chunk-KFEN2SRZ.js.map} +1 -1
  206. package/dist/{chunk-XEAT7XJG.cjs → chunk-KQ6GLYFZ.cjs} +29 -13
  207. package/dist/chunk-KQ6GLYFZ.cjs.map +1 -0
  208. package/dist/chunk-L6K4PRZK.cjs +4 -0
  209. package/dist/chunk-L6K4PRZK.cjs.map +1 -0
  210. package/dist/{chunk-7ZDPD5ZX.cjs → chunk-LC3JL2HB.cjs} +11 -7
  211. package/dist/chunk-LC3JL2HB.cjs.map +1 -0
  212. package/dist/{chunk-P7UMS4E6.cjs → chunk-LC7PVBXH.cjs} +16 -8
  213. package/dist/chunk-LC7PVBXH.cjs.map +1 -0
  214. package/dist/{chunk-Y5HFM7LO.js → chunk-LDBNUJB7.js} +5 -5
  215. package/dist/{chunk-Y5HFM7LO.js.map → chunk-LDBNUJB7.js.map} +1 -1
  216. package/dist/chunk-LRAAJRE7.cjs +2707 -0
  217. package/dist/chunk-LRAAJRE7.cjs.map +1 -0
  218. package/dist/chunk-LUPRGPKP.js +2540 -0
  219. package/dist/chunk-LUPRGPKP.js.map +1 -0
  220. package/dist/chunk-M3VPGJMV.js +283 -0
  221. package/dist/chunk-M3VPGJMV.js.map +1 -0
  222. package/dist/{chunk-VKELAMAZ.js → chunk-N54FYWG6.js} +27 -11
  223. package/dist/chunk-N54FYWG6.js.map +1 -0
  224. package/dist/chunk-N5JDL4VE.js +3 -0
  225. package/dist/chunk-N5JDL4VE.js.map +1 -0
  226. package/dist/{chunk-2QKBTPUC.cjs → chunk-NAH65KPK.cjs} +8 -8
  227. package/dist/{chunk-2QKBTPUC.cjs.map → chunk-NAH65KPK.cjs.map} +1 -1
  228. package/dist/{chunk-PYJDVWXM.js → chunk-NUB5HRKS.js} +3 -3
  229. package/dist/{chunk-PYJDVWXM.js.map → chunk-NUB5HRKS.js.map} +1 -1
  230. package/dist/{chunk-WNZAYBVB.cjs → chunk-O6BJMVGT.cjs} +48 -48
  231. package/dist/{chunk-WNZAYBVB.cjs.map → chunk-O6BJMVGT.cjs.map} +1 -1
  232. package/dist/{chunk-SVSHA7XV.js → chunk-O6XDA3SI.js} +31 -33
  233. package/dist/chunk-O6XDA3SI.js.map +1 -0
  234. package/dist/chunk-OIF34LEN.cjs +425 -0
  235. package/dist/chunk-OIF34LEN.cjs.map +1 -0
  236. package/dist/chunk-OIMXMPH2.cjs +218 -0
  237. package/dist/chunk-OIMXMPH2.cjs.map +1 -0
  238. package/dist/{chunk-J5CSLNCN.cjs → chunk-OODVC2UD.cjs} +2 -2
  239. package/dist/{chunk-J5CSLNCN.cjs.map → chunk-OODVC2UD.cjs.map} +1 -1
  240. package/dist/{chunk-ACCAXVOG.js → chunk-OSTSZDQC.js} +134 -56
  241. package/dist/chunk-OSTSZDQC.js.map +1 -0
  242. package/dist/{chunk-LL6IWKI3.js → chunk-OW3SQJ7P.js} +3 -3
  243. package/dist/{chunk-LL6IWKI3.js.map → chunk-OW3SQJ7P.js.map} +1 -1
  244. package/dist/chunk-P22YCUVM.cjs +4 -0
  245. package/dist/chunk-P22YCUVM.cjs.map +1 -0
  246. package/dist/{chunk-CEQJGUAS.js → chunk-P4E3K3ND.js} +12 -5
  247. package/dist/chunk-P4E3K3ND.js.map +1 -0
  248. package/dist/{chunk-5GUOOLPR.cjs → chunk-P5CMZZRZ.cjs} +5 -5
  249. package/dist/{chunk-5GUOOLPR.cjs.map → chunk-P5CMZZRZ.cjs.map} +1 -1
  250. package/dist/{chunk-TMMVIUUN.js → chunk-P7D7BYFE.js} +4 -4
  251. package/dist/{chunk-TMMVIUUN.js.map → chunk-P7D7BYFE.js.map} +1 -1
  252. package/dist/{chunk-3T7QGLNB.js → chunk-PJEL5ZZV.js} +4 -2
  253. package/dist/chunk-PJEL5ZZV.js.map +1 -0
  254. package/dist/chunk-PYI2IWNX.cjs +281 -0
  255. package/dist/chunk-PYI2IWNX.cjs.map +1 -0
  256. package/dist/chunk-Q3YVLO52.cjs +174 -0
  257. package/dist/chunk-Q3YVLO52.cjs.map +1 -0
  258. package/dist/{chunk-WNM7IZJ7.js → chunk-QJ2L5RU6.js} +7 -7
  259. package/dist/{chunk-WNM7IZJ7.js.map → chunk-QJ2L5RU6.js.map} +1 -1
  260. package/dist/{chunk-X4LBUPJO.cjs → chunk-QX6AAVDE.cjs} +31 -33
  261. package/dist/chunk-QX6AAVDE.cjs.map +1 -0
  262. package/dist/{chunk-UV2FVNWT.cjs → chunk-RIUQP2QS.cjs} +5 -5
  263. package/dist/{chunk-UV2FVNWT.cjs.map → chunk-RIUQP2QS.cjs.map} +1 -1
  264. package/dist/chunk-RLVYWUXG.js +115 -0
  265. package/dist/chunk-RLVYWUXG.js.map +1 -0
  266. package/dist/{chunk-22CYDCXA.js → chunk-RM2HPQIC.js} +105 -14
  267. package/dist/chunk-RM2HPQIC.js.map +1 -0
  268. package/dist/{chunk-DEDN5HAG.js → chunk-RSJGTWLM.js} +3 -3
  269. package/dist/{chunk-DEDN5HAG.js.map → chunk-RSJGTWLM.js.map} +1 -1
  270. package/dist/{chunk-6EN3IQQI.cjs → chunk-RV45J2ZT.cjs} +8 -8
  271. package/dist/{chunk-6EN3IQQI.cjs.map → chunk-RV45J2ZT.cjs.map} +1 -1
  272. package/dist/chunk-RZSSQ7AT.js +333 -0
  273. package/dist/chunk-RZSSQ7AT.js.map +1 -0
  274. package/dist/{chunk-ENKFJJZX.js → chunk-S2JZL4JC.js} +6 -6
  275. package/dist/{chunk-ENKFJJZX.js.map → chunk-S2JZL4JC.js.map} +1 -1
  276. package/dist/{chunk-ELPW32ZI.cjs → chunk-S4XCPDEO.cjs} +60 -59
  277. package/dist/chunk-S4XCPDEO.cjs.map +1 -0
  278. package/dist/{chunk-OE5CKRUC.js → chunk-SACHTD7B.js} +34 -4
  279. package/dist/chunk-SACHTD7B.js.map +1 -0
  280. package/dist/{chunk-U42F3HLE.cjs → chunk-SAGJHL2Z.cjs} +275 -5
  281. package/dist/chunk-SAGJHL2Z.cjs.map +1 -0
  282. package/dist/{chunk-VROIMIHB.cjs → chunk-SHBCUXFS.cjs} +28 -6
  283. package/dist/chunk-SHBCUXFS.cjs.map +1 -0
  284. package/dist/{chunk-RJ6NTJHC.js → chunk-SRMTRD7F.js} +3 -3
  285. package/dist/{chunk-RJ6NTJHC.js.map → chunk-SRMTRD7F.js.map} +1 -1
  286. package/dist/{chunk-IX6KFB3K.cjs → chunk-SW2E7XKY.cjs} +9 -9
  287. package/dist/{chunk-IX6KFB3K.cjs.map → chunk-SW2E7XKY.cjs.map} +1 -1
  288. package/dist/chunk-SZSRGUVO.js +402 -0
  289. package/dist/chunk-SZSRGUVO.js.map +1 -0
  290. package/dist/{chunk-NJ6MY6V5.js → chunk-T5BBZQ66.js} +3 -3
  291. package/dist/{chunk-NJ6MY6V5.js.map → chunk-T5BBZQ66.js.map} +1 -1
  292. package/dist/{chunk-JI244Y7C.js → chunk-T5NOFXOL.js} +275 -5
  293. package/dist/chunk-T5NOFXOL.js.map +1 -0
  294. package/dist/{chunk-2IZLKPUW.js → chunk-THLIL6PY.js} +3 -3
  295. package/dist/{chunk-2IZLKPUW.js.map → chunk-THLIL6PY.js.map} +1 -1
  296. package/dist/{chunk-HZ4MBUC3.js → chunk-TI3TQQ7F.js} +4 -53
  297. package/dist/chunk-TI3TQQ7F.js.map +1 -0
  298. package/dist/chunk-TVU4KB27.cjs +353 -0
  299. package/dist/chunk-TVU4KB27.cjs.map +1 -0
  300. package/dist/{chunk-5JJ2DAE4.js → chunk-TWQSMUE6.js} +7 -3
  301. package/dist/chunk-TWQSMUE6.js.map +1 -0
  302. package/dist/{chunk-TAXD5ADA.cjs → chunk-UEDTZYGI.cjs} +3 -3
  303. package/dist/{chunk-TAXD5ADA.cjs.map → chunk-UEDTZYGI.cjs.map} +1 -1
  304. package/dist/{chunk-3QGS6CXD.js → chunk-UJDWFDKE.js} +3 -3
  305. package/dist/{chunk-3QGS6CXD.js.map → chunk-UJDWFDKE.js.map} +1 -1
  306. package/dist/chunk-UNFDIBKJ.js +258 -0
  307. package/dist/chunk-UNFDIBKJ.js.map +1 -0
  308. package/dist/{chunk-UQ3VVR6A.cjs → chunk-UPWIJC6I.cjs} +3 -3
  309. package/dist/{chunk-UQ3VVR6A.cjs.map → chunk-UPWIJC6I.cjs.map} +1 -1
  310. package/dist/chunk-UTIPENPW.cjs +286 -0
  311. package/dist/chunk-UTIPENPW.cjs.map +1 -0
  312. package/dist/{chunk-S7WCHDBO.js → chunk-VCI2Y7ST.js} +3 -3
  313. package/dist/{chunk-S7WCHDBO.js.map → chunk-VCI2Y7ST.js.map} +1 -1
  314. package/dist/chunk-VEE46VTX.js +166 -0
  315. package/dist/chunk-VEE46VTX.js.map +1 -0
  316. package/dist/chunk-VFFV7EMT.cjs +188 -0
  317. package/dist/chunk-VFFV7EMT.cjs.map +1 -0
  318. package/dist/chunk-VINZZQBD.cjs +323 -0
  319. package/dist/chunk-VINZZQBD.cjs.map +1 -0
  320. package/dist/chunk-VPTASZ2O.cjs +171 -0
  321. package/dist/chunk-VPTASZ2O.cjs.map +1 -0
  322. package/dist/{chunk-P2CA3XGI.js → chunk-VSRO4PAI.js} +23 -5
  323. package/dist/chunk-VSRO4PAI.js.map +1 -0
  324. package/dist/{chunk-L6MDULYB.js → chunk-VU3ZMJBN.js} +2 -2
  325. package/dist/{chunk-L6MDULYB.js.map → chunk-VU3ZMJBN.js.map} +1 -1
  326. package/dist/{chunk-XI34EGK5.cjs → chunk-VV2U36T6.cjs} +9 -9
  327. package/dist/{chunk-XI34EGK5.cjs.map → chunk-VV2U36T6.cjs.map} +1 -1
  328. package/dist/{chunk-VPWJCJCX.cjs → chunk-VXW7D5LR.cjs} +26 -8
  329. package/dist/chunk-VXW7D5LR.cjs.map +1 -0
  330. package/dist/chunk-W3HXHIDO.cjs +2573 -0
  331. package/dist/chunk-W3HXHIDO.cjs.map +1 -0
  332. package/dist/{chunk-GOALNQZ2.js → chunk-WFBUBT54.js} +4 -83
  333. package/dist/chunk-WFBUBT54.js.map +1 -0
  334. package/dist/chunk-WFL4N5PC.js +283 -0
  335. package/dist/chunk-WFL4N5PC.js.map +1 -0
  336. package/dist/chunk-WQHBMZSC.js +295 -0
  337. package/dist/chunk-WQHBMZSC.js.map +1 -0
  338. package/dist/chunk-X3RSNAMX.js +195 -0
  339. package/dist/chunk-X3RSNAMX.js.map +1 -0
  340. package/dist/chunk-X5JOEZVR.js +525 -0
  341. package/dist/chunk-X5JOEZVR.js.map +1 -0
  342. package/dist/chunk-XBAAHOCP.js +3 -0
  343. package/dist/chunk-XBAAHOCP.js.map +1 -0
  344. package/dist/chunk-XDIMTPZU.cjs +202 -0
  345. package/dist/chunk-XDIMTPZU.cjs.map +1 -0
  346. package/dist/chunk-XDU65GLW.js +21 -0
  347. package/dist/chunk-XDU65GLW.js.map +1 -0
  348. package/dist/chunk-XI74P5F2.cjs +424 -0
  349. package/dist/chunk-XI74P5F2.cjs.map +1 -0
  350. package/dist/chunk-XNPDZANN.cjs +238 -0
  351. package/dist/chunk-XNPDZANN.cjs.map +1 -0
  352. package/dist/{chunk-WIAQQNFU.cjs → chunk-XRVMYT5G.cjs} +106 -13
  353. package/dist/chunk-XRVMYT5G.cjs.map +1 -0
  354. package/dist/chunk-XVW5DPPP.js +429 -0
  355. package/dist/chunk-XVW5DPPP.js.map +1 -0
  356. package/dist/chunk-XXA4NZUC.js +3 -0
  357. package/dist/chunk-XXA4NZUC.js.map +1 -0
  358. package/dist/chunk-Y424YL55.js +59 -0
  359. package/dist/chunk-Y424YL55.js.map +1 -0
  360. package/dist/chunk-Y4QNLW7W.js +300 -0
  361. package/dist/chunk-Y4QNLW7W.js.map +1 -0
  362. package/dist/chunk-Y7ZJZLJY.js +2657 -0
  363. package/dist/chunk-Y7ZJZLJY.js.map +1 -0
  364. package/dist/chunk-YGS2TRMP.js +38 -0
  365. package/dist/chunk-YGS2TRMP.js.map +1 -0
  366. package/dist/chunk-YUMOM3KE.js +167 -0
  367. package/dist/chunk-YUMOM3KE.js.map +1 -0
  368. package/dist/chunk-YW2AKBLS.cjs +23 -0
  369. package/dist/chunk-YW2AKBLS.cjs.map +1 -0
  370. package/dist/chunk-ZNUMOJOI.cjs +4 -0
  371. package/dist/chunk-ZNUMOJOI.cjs.map +1 -0
  372. package/dist/chunk-ZSNFL736.cjs +306 -0
  373. package/dist/chunk-ZSNFL736.cjs.map +1 -0
  374. package/dist/components/Accordion/index.cjs +2 -2
  375. package/dist/components/Accordion/index.d.cts +6 -0
  376. package/dist/components/Accordion/index.d.ts +6 -0
  377. package/dist/components/Accordion/index.js +1 -1
  378. package/dist/components/ActionPlan/index.cjs +34 -0
  379. package/dist/components/ActionPlan/index.cjs.map +1 -0
  380. package/dist/components/ActionPlan/index.d.cts +65 -0
  381. package/dist/components/ActionPlan/index.d.ts +65 -0
  382. package/dist/components/ActionPlan/index.js +21 -0
  383. package/dist/components/ActionPlan/index.js.map +1 -0
  384. package/dist/components/ActivityFeed/index.cjs +31 -0
  385. package/dist/components/ActivityFeed/index.cjs.map +1 -0
  386. package/dist/components/ActivityFeed/index.d.cts +99 -0
  387. package/dist/components/ActivityFeed/index.d.ts +99 -0
  388. package/dist/components/ActivityFeed/index.js +18 -0
  389. package/dist/components/ActivityFeed/index.js.map +1 -0
  390. package/dist/components/Alert/index.d.cts +1 -1
  391. package/dist/components/Alert/index.d.ts +1 -1
  392. package/dist/components/AlertDialog/index.cjs +19 -5
  393. package/dist/components/AlertDialog/index.d.cts +94 -16
  394. package/dist/components/AlertDialog/index.d.ts +94 -16
  395. package/dist/components/AlertDialog/index.js +6 -4
  396. package/dist/components/AssociationList/index.cjs +29 -0
  397. package/dist/components/AssociationList/index.cjs.map +1 -0
  398. package/dist/components/AssociationList/index.d.cts +50 -0
  399. package/dist/components/AssociationList/index.d.ts +50 -0
  400. package/dist/components/AssociationList/index.js +16 -0
  401. package/dist/components/AssociationList/index.js.map +1 -0
  402. package/dist/components/AudioRecorder/index.d.cts +2 -2
  403. package/dist/components/AudioRecorder/index.d.ts +2 -2
  404. package/dist/components/Autocomplete/index.d.cts +8 -2
  405. package/dist/components/Autocomplete/index.d.ts +8 -2
  406. package/dist/components/Avatar/index.cjs +9 -7
  407. package/dist/components/Avatar/index.d.cts +46 -15
  408. package/dist/components/Avatar/index.d.ts +46 -15
  409. package/dist/components/Avatar/index.js +3 -1
  410. package/dist/components/AvatarGroup/index.cjs +20 -0
  411. package/dist/components/AvatarGroup/index.cjs.map +1 -0
  412. package/dist/components/AvatarGroup/index.d.cts +57 -0
  413. package/dist/components/AvatarGroup/index.d.ts +57 -0
  414. package/dist/components/AvatarGroup/index.js +7 -0
  415. package/dist/components/AvatarGroup/index.js.map +1 -0
  416. package/dist/components/Badge/index.cjs +3 -3
  417. package/dist/components/Badge/index.d.cts +16 -2
  418. package/dist/components/Badge/index.d.ts +16 -2
  419. package/dist/components/Badge/index.js +1 -1
  420. package/dist/components/BoardView/index.cjs +24 -0
  421. package/dist/components/BoardView/index.cjs.map +1 -0
  422. package/dist/components/BoardView/index.d.cts +41 -0
  423. package/dist/components/BoardView/index.d.ts +41 -0
  424. package/dist/components/BoardView/index.js +7 -0
  425. package/dist/components/BoardView/index.js.map +1 -0
  426. package/dist/components/Button/index.cjs +5 -3
  427. package/dist/components/Button/index.d.cts +2 -1
  428. package/dist/components/Button/index.d.ts +2 -1
  429. package/dist/components/Button/index.js +3 -1
  430. package/dist/components/CalendarHeatmap/index.cjs +18 -0
  431. package/dist/components/CalendarHeatmap/index.cjs.map +1 -0
  432. package/dist/components/CalendarHeatmap/index.d.cts +47 -0
  433. package/dist/components/CalendarHeatmap/index.d.ts +47 -0
  434. package/dist/components/CalendarHeatmap/index.js +5 -0
  435. package/dist/components/CalendarHeatmap/index.js.map +1 -0
  436. package/dist/components/CalendarView/index.cjs +24 -0
  437. package/dist/components/CalendarView/index.cjs.map +1 -0
  438. package/dist/components/CalendarView/index.d.cts +39 -0
  439. package/dist/components/CalendarView/index.d.ts +39 -0
  440. package/dist/components/CalendarView/index.js +11 -0
  441. package/dist/components/CalendarView/index.js.map +1 -0
  442. package/dist/components/Card/index.d.cts +3 -3
  443. package/dist/components/Card/index.d.ts +3 -3
  444. package/dist/components/ClampedText/index.cjs +3 -2
  445. package/dist/components/ClampedText/index.js +2 -1
  446. package/dist/components/CollabStatus/index.cjs +6 -4
  447. package/dist/components/CollabStatus/index.d.cts +11 -0
  448. package/dist/components/CollabStatus/index.d.ts +11 -0
  449. package/dist/components/CollabStatus/index.js +3 -1
  450. package/dist/components/Collapsible/index.cjs +6 -6
  451. package/dist/components/Collapsible/index.d.cts +6 -0
  452. package/dist/components/Collapsible/index.d.ts +6 -0
  453. package/dist/components/Collapsible/index.js +3 -3
  454. package/dist/components/CompletenessMeter/index.cjs +23 -0
  455. package/dist/components/CompletenessMeter/index.cjs.map +1 -0
  456. package/dist/components/CompletenessMeter/index.d.cts +52 -0
  457. package/dist/components/CompletenessMeter/index.d.ts +52 -0
  458. package/dist/components/CompletenessMeter/index.js +6 -0
  459. package/dist/components/CompletenessMeter/index.js.map +1 -0
  460. package/dist/components/CountryCodeDropdown/index.cjs +5 -5
  461. package/dist/components/CountryCodeDropdown/index.js +2 -2
  462. package/dist/components/CustomizableDashboard/index.cjs +12 -10
  463. package/dist/components/CustomizableDashboard/index.js +5 -3
  464. package/dist/components/DateInput/index.d.cts +36 -4
  465. package/dist/components/DateInput/index.d.ts +36 -4
  466. package/dist/components/Dropdown/index.cjs +11 -10
  467. package/dist/components/Dropdown/index.d.cts +2 -1
  468. package/dist/components/Dropdown/index.d.ts +2 -1
  469. package/dist/components/Dropdown/index.js +4 -3
  470. package/dist/components/EmailEditor/index.cjs +67 -0
  471. package/dist/components/EmailEditor/index.cjs.map +1 -0
  472. package/dist/components/EmailEditor/index.d.cts +347 -0
  473. package/dist/components/EmailEditor/index.d.ts +347 -0
  474. package/dist/components/EmailEditor/index.js +26 -0
  475. package/dist/components/EmailEditor/index.js.map +1 -0
  476. package/dist/components/FieldHistory/index.cjs +34 -0
  477. package/dist/components/FieldHistory/index.cjs.map +1 -0
  478. package/dist/components/FieldHistory/index.d.cts +66 -0
  479. package/dist/components/FieldHistory/index.d.ts +66 -0
  480. package/dist/components/FieldHistory/index.js +21 -0
  481. package/dist/components/FieldHistory/index.js.map +1 -0
  482. package/dist/components/FloatingWindow/index.cjs +6 -4
  483. package/dist/components/FloatingWindow/index.js +4 -2
  484. package/dist/components/GanttView/index.cjs +20 -0
  485. package/dist/components/GanttView/index.cjs.map +1 -0
  486. package/dist/components/GanttView/index.d.cts +36 -0
  487. package/dist/components/GanttView/index.d.ts +36 -0
  488. package/dist/components/GanttView/index.js +7 -0
  489. package/dist/components/GanttView/index.js.map +1 -0
  490. package/dist/components/GlossaryTooltip/index.cjs +3 -3
  491. package/dist/components/GlossaryTooltip/index.js +2 -2
  492. package/dist/components/InlineEdit/index.cjs +20 -0
  493. package/dist/components/InlineEdit/index.cjs.map +1 -0
  494. package/dist/components/InlineEdit/index.d.cts +56 -0
  495. package/dist/components/InlineEdit/index.d.ts +56 -0
  496. package/dist/components/InlineEdit/index.js +7 -0
  497. package/dist/components/InlineEdit/index.js.map +1 -0
  498. package/dist/components/KeyboardShortcutsOverlay/index.cjs +5 -5
  499. package/dist/components/KeyboardShortcutsOverlay/index.js +3 -3
  500. package/dist/components/ListView/index.cjs +24 -0
  501. package/dist/components/ListView/index.cjs.map +1 -0
  502. package/dist/components/ListView/index.d.cts +124 -0
  503. package/dist/components/ListView/index.d.ts +124 -0
  504. package/dist/components/ListView/index.js +11 -0
  505. package/dist/components/ListView/index.js.map +1 -0
  506. package/dist/components/LogoUploader/index.cjs +18 -0
  507. package/dist/components/LogoUploader/index.cjs.map +1 -0
  508. package/dist/components/LogoUploader/index.d.cts +49 -0
  509. package/dist/components/LogoUploader/index.d.ts +49 -0
  510. package/dist/components/LogoUploader/index.js +5 -0
  511. package/dist/components/LogoUploader/index.js.map +1 -0
  512. package/dist/components/Markdown/index.cjs +21 -19
  513. package/dist/components/Markdown/index.js +9 -7
  514. package/dist/components/MediaEditor/index.cjs +16 -14
  515. package/dist/components/MediaEditor/index.d.cts +91 -2
  516. package/dist/components/MediaEditor/index.d.ts +91 -2
  517. package/dist/components/MediaEditor/index.js +11 -9
  518. package/dist/components/MediaFeed/index.cjs +29 -0
  519. package/dist/components/MediaFeed/index.cjs.map +1 -0
  520. package/dist/components/MediaFeed/index.d.cts +104 -0
  521. package/dist/components/MediaFeed/index.d.ts +104 -0
  522. package/dist/components/MediaFeed/index.js +20 -0
  523. package/dist/components/MediaFeed/index.js.map +1 -0
  524. package/dist/components/MediaPlayer/index.cjs +8 -6
  525. package/dist/components/MediaPlayer/index.d.cts +19 -1
  526. package/dist/components/MediaPlayer/index.d.ts +19 -1
  527. package/dist/components/MediaPlayer/index.js +5 -3
  528. package/dist/components/MegaMenu/index.cjs +7 -5
  529. package/dist/components/MegaMenu/index.js +4 -2
  530. package/dist/components/Modal/index.cjs +10 -10
  531. package/dist/components/Modal/index.js +2 -2
  532. package/dist/components/Pagination/index.d.cts +1 -1
  533. package/dist/components/Pagination/index.d.ts +1 -1
  534. package/dist/components/PhiMask/index.cjs +18 -0
  535. package/dist/components/PhiMask/index.cjs.map +1 -0
  536. package/dist/components/PhiMask/index.d.cts +45 -0
  537. package/dist/components/PhiMask/index.d.ts +45 -0
  538. package/dist/components/PhiMask/index.js +5 -0
  539. package/dist/components/PhiMask/index.js.map +1 -0
  540. package/dist/components/Progress/index.cjs +6 -6
  541. package/dist/components/Progress/index.d.cts +8 -2
  542. package/dist/components/Progress/index.d.ts +8 -2
  543. package/dist/components/Progress/index.js +1 -1
  544. package/dist/components/PropertyList/index.cjs +25 -0
  545. package/dist/components/PropertyList/index.cjs.map +1 -0
  546. package/dist/components/PropertyList/index.d.cts +87 -0
  547. package/dist/components/PropertyList/index.d.ts +87 -0
  548. package/dist/components/PropertyList/index.js +12 -0
  549. package/dist/components/PropertyList/index.js.map +1 -0
  550. package/dist/components/Q/index.d.cts +2 -2
  551. package/dist/components/Q/index.d.ts +2 -2
  552. package/dist/components/QuickAction/index.d.cts +1 -1
  553. package/dist/components/QuickAction/index.d.ts +1 -1
  554. package/dist/components/RadialExplorer/index.cjs +7 -5
  555. package/dist/components/RadialExplorer/index.js +6 -4
  556. package/dist/components/Rating/index.cjs +28 -0
  557. package/dist/components/Rating/index.cjs.map +1 -0
  558. package/dist/components/Rating/index.d.cts +85 -0
  559. package/dist/components/Rating/index.d.ts +85 -0
  560. package/dist/components/Rating/index.js +7 -0
  561. package/dist/components/Rating/index.js.map +1 -0
  562. package/dist/components/RecordButton/index.d.cts +1 -1
  563. package/dist/components/RecordButton/index.d.ts +1 -1
  564. package/dist/components/RecordHeader/index.cjs +29 -0
  565. package/dist/components/RecordHeader/index.cjs.map +1 -0
  566. package/dist/components/RecordHeader/index.d.cts +96 -0
  567. package/dist/components/RecordHeader/index.d.ts +96 -0
  568. package/dist/components/RecordHeader/index.js +16 -0
  569. package/dist/components/RecordHeader/index.js.map +1 -0
  570. package/dist/components/RecordLayout/index.cjs +21 -0
  571. package/dist/components/RecordLayout/index.cjs.map +1 -0
  572. package/dist/components/RecordLayout/index.d.cts +40 -0
  573. package/dist/components/RecordLayout/index.d.ts +40 -0
  574. package/dist/components/RecordLayout/index.js +8 -0
  575. package/dist/components/RecordLayout/index.js.map +1 -0
  576. package/dist/components/RichTextEditor/index.cjs +11 -8
  577. package/dist/components/RichTextEditor/index.d.cts +12 -2
  578. package/dist/components/RichTextEditor/index.d.ts +12 -2
  579. package/dist/components/RichTextEditor/index.js +8 -5
  580. package/dist/components/ScrollArea/index.d.cts +1 -1
  581. package/dist/components/ScrollArea/index.d.ts +1 -1
  582. package/dist/components/SectionSpyNav/index.cjs +5 -3
  583. package/dist/components/SectionSpyNav/index.js +4 -2
  584. package/dist/components/Select/index.cjs +4 -4
  585. package/dist/components/Select/index.d.cts +2 -2
  586. package/dist/components/Select/index.d.ts +2 -2
  587. package/dist/components/Select/index.js +2 -2
  588. package/dist/components/Skeleton/index.d.cts +1 -1
  589. package/dist/components/Skeleton/index.d.ts +1 -1
  590. package/dist/components/Slider/index.d.cts +2 -2
  591. package/dist/components/Slider/index.d.ts +2 -2
  592. package/dist/components/SliderCalculator/index.cjs +4 -4
  593. package/dist/components/SliderCalculator/index.js +2 -2
  594. package/dist/components/SourceTip/index.cjs +3 -3
  595. package/dist/components/SourceTip/index.js +2 -2
  596. package/dist/components/Spinner/index.d.cts +2 -2
  597. package/dist/components/Spinner/index.d.ts +2 -2
  598. package/dist/components/SuperChat/index.cjs +1300 -713
  599. package/dist/components/SuperChat/index.cjs.map +1 -1
  600. package/dist/components/SuperChat/index.d.cts +126 -8
  601. package/dist/components/SuperChat/index.d.ts +126 -8
  602. package/dist/components/SuperChat/index.js +1404 -817
  603. package/dist/components/SuperChat/index.js.map +1 -1
  604. package/dist/components/SuperChat/plugins/index.cjs +7 -6
  605. package/dist/components/SuperChat/plugins/index.cjs.map +1 -1
  606. package/dist/components/SuperChat/plugins/index.d.cts +2 -3
  607. package/dist/components/SuperChat/plugins/index.d.ts +2 -3
  608. package/dist/components/SuperChat/plugins/index.js +6 -5
  609. package/dist/components/SuperChat/plugins/index.js.map +1 -1
  610. package/dist/components/Tabs/index.cjs +9 -7
  611. package/dist/components/Tabs/index.d.cts +12 -1
  612. package/dist/components/Tabs/index.d.ts +12 -1
  613. package/dist/components/Tabs/index.js +3 -1
  614. package/dist/components/TagEditor/index.cjs +22 -0
  615. package/dist/components/TagEditor/index.cjs.map +1 -0
  616. package/dist/components/TagEditor/index.d.cts +46 -0
  617. package/dist/components/TagEditor/index.d.ts +46 -0
  618. package/dist/components/TagEditor/index.js +9 -0
  619. package/dist/components/TagEditor/index.js.map +1 -0
  620. package/dist/components/Text/index.d.cts +3 -3
  621. package/dist/components/Text/index.d.ts +3 -3
  622. package/dist/components/Textarea/index.d.cts +2 -2
  623. package/dist/components/Textarea/index.d.ts +2 -2
  624. package/dist/components/ThemeProvider/index.cjs +9 -9
  625. package/dist/components/ThemeProvider/index.d.cts +3 -1
  626. package/dist/components/ThemeProvider/index.d.ts +3 -1
  627. package/dist/components/ThemeProvider/index.js +3 -3
  628. package/dist/components/Tooltip/index.cjs +3 -3
  629. package/dist/components/Tooltip/index.js +2 -2
  630. package/dist/components/TranscriptView/index.d.cts +85 -4
  631. package/dist/components/TranscriptView/index.d.ts +85 -4
  632. package/dist/components/UserPicker/index.cjs +24 -0
  633. package/dist/components/UserPicker/index.cjs.map +1 -0
  634. package/dist/components/UserPicker/index.d.cts +60 -0
  635. package/dist/components/UserPicker/index.d.ts +60 -0
  636. package/dist/components/UserPicker/index.js +11 -0
  637. package/dist/components/UserPicker/index.js.map +1 -0
  638. package/dist/components/VideoCard/index.cjs +4 -4
  639. package/dist/components/VideoCard/index.js +2 -2
  640. package/dist/components/ViewSet/index.cjs +25 -0
  641. package/dist/components/ViewSet/index.cjs.map +1 -0
  642. package/dist/components/ViewSet/index.d.cts +201 -0
  643. package/dist/components/ViewSet/index.d.ts +201 -0
  644. package/dist/components/ViewSet/index.js +16 -0
  645. package/dist/components/ViewSet/index.js.map +1 -0
  646. package/dist/components/ViewSwitcher/index.cjs +20 -0
  647. package/dist/components/ViewSwitcher/index.cjs.map +1 -0
  648. package/dist/components/ViewSwitcher/index.d.cts +39 -0
  649. package/dist/components/ViewSwitcher/index.d.ts +39 -0
  650. package/dist/components/ViewSwitcher/index.js +7 -0
  651. package/dist/components/ViewSwitcher/index.js.map +1 -0
  652. package/dist/datavis.cjs +6 -4
  653. package/dist/datavis.cjs.map +1 -1
  654. package/dist/datavis.d.cts +167 -13
  655. package/dist/datavis.d.ts +167 -13
  656. package/dist/datavis.js +4 -2
  657. package/dist/datavis.js.map +1 -1
  658. package/dist/deck.cjs +3360 -0
  659. package/dist/deck.cjs.map +1 -0
  660. package/dist/deck.d.cts +712 -0
  661. package/dist/deck.d.ts +712 -0
  662. package/dist/deck.js +3316 -0
  663. package/dist/deck.js.map +1 -0
  664. package/dist/esheet.cjs +19 -16
  665. package/dist/esheet.cjs.map +1 -1
  666. package/dist/esheet.d.cts +183 -1
  667. package/dist/esheet.d.ts +183 -1
  668. package/dist/esheet.js +16 -13
  669. package/dist/esheet.js.map +1 -1
  670. package/dist/globe.cjs +2 -2
  671. package/dist/globe.js +1 -1
  672. package/dist/hooks/index.cjs +94 -35
  673. package/dist/hooks/index.d.cts +680 -36
  674. package/dist/hooks/index.d.ts +680 -36
  675. package/dist/hooks/index.js +10 -7
  676. package/dist/icons-wBacj6BW.d.cts +142 -0
  677. package/dist/icons-wBacj6BW.d.ts +142 -0
  678. package/dist/index.cjs +2215 -1321
  679. package/dist/index.cjs.map +1 -1
  680. package/dist/index.d.cts +10386 -628
  681. package/dist/index.d.ts +10386 -628
  682. package/dist/index.js +805 -360
  683. package/dist/index.js.map +1 -1
  684. package/dist/kerebron.cjs +58 -19
  685. package/dist/kerebron.cjs.map +1 -1
  686. package/dist/kerebron.css +115 -0
  687. package/dist/kerebron.d.cts +37 -0
  688. package/dist/kerebron.d.ts +37 -0
  689. package/dist/kerebron.js +58 -19
  690. package/dist/kerebron.js.map +1 -1
  691. package/dist/maps.cjs +160 -0
  692. package/dist/maps.cjs.map +1 -0
  693. package/dist/maps.d.cts +42 -0
  694. package/dist/maps.d.ts +42 -0
  695. package/dist/maps.js +138 -0
  696. package/dist/maps.js.map +1 -0
  697. package/dist/motion.cjs +7 -7
  698. package/dist/motion.d.cts +186 -2
  699. package/dist/motion.d.ts +186 -2
  700. package/dist/motion.js +2 -2
  701. package/dist/org-chart.cjs +1302 -0
  702. package/dist/org-chart.cjs.map +1 -0
  703. package/dist/org-chart.d.cts +164 -0
  704. package/dist/org-chart.d.ts +164 -0
  705. package/dist/org-chart.js +1277 -0
  706. package/dist/org-chart.js.map +1 -0
  707. package/dist/q.d.cts +25 -3
  708. package/dist/q.d.ts +25 -3
  709. package/dist/styles/effects.css +133 -0
  710. package/dist/styles/init.css +22 -3
  711. package/dist/styles.css +1 -1
  712. package/dist/tailwind-preset.cjs +4 -4
  713. package/dist/tailwind-preset.js +1 -1
  714. package/dist/templates.cjs +156 -0
  715. package/dist/templates.cjs.map +1 -0
  716. package/dist/templates.d.cts +734 -0
  717. package/dist/templates.d.ts +734 -0
  718. package/dist/templates.js +11 -0
  719. package/dist/templates.js.map +1 -0
  720. package/dist/types-CDeBNZiE.d.cts +92 -0
  721. package/dist/types-CDeBNZiE.d.ts +92 -0
  722. package/dist/types-Cx1FHLq2.d.cts +548 -0
  723. package/dist/types-Cx1FHLq2.d.ts +548 -0
  724. package/dist/types-DsdZvEI1.d.cts +92 -0
  725. package/dist/types-DsdZvEI1.d.ts +92 -0
  726. package/dist/utils/index.cjs +9 -9
  727. package/dist/utils/index.d.cts +13 -2
  728. package/dist/utils/index.d.ts +13 -2
  729. package/dist/utils/index.js +1 -1
  730. package/package.json +82 -13
  731. package/dist/Animated-XmH6k8pZ.d.cts +0 -188
  732. package/dist/Animated-XmH6k8pZ.d.ts +0 -188
  733. package/dist/CsvBlock-ROJCKJDP.cjs +0 -16
  734. package/dist/CsvBlock-UWPMTLE2.js +0 -7
  735. package/dist/HtmlPreviewBlock-DWFN6EUB.cjs +0 -16
  736. package/dist/HtmlPreviewBlock-ME5U3XNS.js +0 -7
  737. package/dist/MedicationEditor-Bp4NLy7y.d.cts +0 -352
  738. package/dist/MedicationEditor-Bp4NLy7y.d.ts +0 -352
  739. package/dist/MermaidBlock-2B6CPD6Y.js +0 -7
  740. package/dist/MermaidBlock-D2UC5M55.cjs +0 -16
  741. package/dist/SurveyBlock-4CD4AYMJ.cjs +0 -16
  742. package/dist/SurveyBlock-4DO62RBT.js +0 -7
  743. package/dist/chunk-22CYDCXA.js.map +0 -1
  744. package/dist/chunk-2YCERQWC.js.map +0 -1
  745. package/dist/chunk-3T7QGLNB.js.map +0 -1
  746. package/dist/chunk-5JJ2DAE4.js.map +0 -1
  747. package/dist/chunk-6HFFWEM3.cjs +0 -22
  748. package/dist/chunk-6HFFWEM3.cjs.map +0 -1
  749. package/dist/chunk-7ZDPD5ZX.cjs.map +0 -1
  750. package/dist/chunk-7ZVTLTJF.js +0 -109
  751. package/dist/chunk-7ZVTLTJF.js.map +0 -1
  752. package/dist/chunk-ACCAXVOG.js.map +0 -1
  753. package/dist/chunk-BMSG4NBH.js +0 -56
  754. package/dist/chunk-BMSG4NBH.js.map +0 -1
  755. package/dist/chunk-CEQJGUAS.js.map +0 -1
  756. package/dist/chunk-DVOQ3JNO.js.map +0 -1
  757. package/dist/chunk-E4IBHYJ7.cjs +0 -80
  758. package/dist/chunk-E4IBHYJ7.cjs.map +0 -1
  759. package/dist/chunk-ELPW32ZI.cjs.map +0 -1
  760. package/dist/chunk-GD7EBGC4.cjs.map +0 -1
  761. package/dist/chunk-GOALNQZ2.js.map +0 -1
  762. package/dist/chunk-HB7C7NB5.js +0 -20
  763. package/dist/chunk-HB7C7NB5.js.map +0 -1
  764. package/dist/chunk-HZ4MBUC3.js.map +0 -1
  765. package/dist/chunk-JEIW7BSV.cjs.map +0 -1
  766. package/dist/chunk-JHULS3EC.js +0 -130
  767. package/dist/chunk-JHULS3EC.js.map +0 -1
  768. package/dist/chunk-JI244Y7C.js.map +0 -1
  769. package/dist/chunk-JYZW2PZS.cjs.map +0 -1
  770. package/dist/chunk-KRU6IGV7.js.map +0 -1
  771. package/dist/chunk-NV2CWBI2.cjs.map +0 -1
  772. package/dist/chunk-OE5CKRUC.js.map +0 -1
  773. package/dist/chunk-P2CA3XGI.js.map +0 -1
  774. package/dist/chunk-P7UMS4E6.cjs.map +0 -1
  775. package/dist/chunk-SQHMGT4W.js.map +0 -1
  776. package/dist/chunk-SVSHA7XV.js.map +0 -1
  777. package/dist/chunk-U42F3HLE.cjs.map +0 -1
  778. package/dist/chunk-VKELAMAZ.js.map +0 -1
  779. package/dist/chunk-VNYW4C4J.cjs.map +0 -1
  780. package/dist/chunk-VOKVG3ER.js +0 -78
  781. package/dist/chunk-VOKVG3ER.js.map +0 -1
  782. package/dist/chunk-VPIYTQCV.cjs.map +0 -1
  783. package/dist/chunk-VPWJCJCX.cjs.map +0 -1
  784. package/dist/chunk-VROIMIHB.cjs.map +0 -1
  785. package/dist/chunk-WIAQQNFU.cjs.map +0 -1
  786. package/dist/chunk-WNAA6CLE.cjs +0 -143
  787. package/dist/chunk-WNAA6CLE.cjs.map +0 -1
  788. package/dist/chunk-WNJRS7Y7.cjs.map +0 -1
  789. package/dist/chunk-X4LBUPJO.cjs.map +0 -1
  790. package/dist/chunk-X4XPNTCZ.cjs.map +0 -1
  791. package/dist/chunk-XCP454Q6.js.map +0 -1
  792. package/dist/chunk-XEAT7XJG.cjs.map +0 -1
  793. package/dist/chunk-YVL3XATO.cjs +0 -79
  794. package/dist/chunk-YVL3XATO.cjs.map +0 -1
  795. package/dist/chunk-YVPC65ZJ.cjs.map +0 -1
  796. package/dist/html-MdxqSzjD.d.cts +0 -13
  797. package/dist/html-MdxqSzjD.d.ts +0 -13
  798. package/dist/orderRows-BUJYgSc7.d.cts +0 -221
  799. package/dist/orderRows-BUJYgSc7.d.ts +0 -221
  800. package/dist/transcript-Cg7uSW-C.d.cts +0 -84
  801. package/dist/transcript-Cg7uSW-C.d.ts +0 -84
  802. package/dist/types-B97JNRNQ.d.cts +0 -251
  803. package/dist/types-CnPEwzlp.d.cts +0 -254
  804. package/dist/types-CnPEwzlp.d.ts +0 -254
  805. package/dist/types-gZXrfLj6.d.ts +0 -251
  806. package/dist/useAnchoredPosition-CKwLSQW8.d.cts +0 -76
  807. package/dist/useAnchoredPosition-CKwLSQW8.d.ts +0 -76
  808. package/dist/useTheme-B9SWu6ui.d.cts +0 -24
  809. package/dist/useTheme-B9SWu6ui.d.ts +0 -24
  810. package/dist/useTranscriptEdits-CGzlemHT.d.cts +0 -182
  811. package/dist/useTranscriptEdits-D32bLs0l.d.ts +0 -182
@@ -0,0 +1,2540 @@
1
+ import { Tabs, TabsList, TabsTrigger, TabsContent } from './chunk-B4CKCNWD.js';
2
+ import { RichTextEditor } from './chunk-SACHTD7B.js';
3
+ import { Switch } from './chunk-AQ564XO7.js';
4
+ import { Textarea } from './chunk-H3YO5GBM.js';
5
+ import { Select } from './chunk-VCI2Y7ST.js';
6
+ import { Input } from './chunk-3IMM2PM4.js';
7
+ import { useLiveAnnouncement } from './chunk-HNXLLDPN.js';
8
+ import { Button } from './chunk-WFBUBT54.js';
9
+ import { cn } from './chunk-TQONQSJO.js';
10
+ import * as React3 from 'react';
11
+ import { useSensors, useSensor, PointerSensor, DndContext, closestCenter, DragOverlay, useDraggable, useDroppable } from '@dnd-kit/core';
12
+ import { SortableContext, verticalListSortingStrategy, arrayMove, useSortable } from '@dnd-kit/sortable';
13
+ import { CSS } from '@dnd-kit/utilities';
14
+ import { Undo2, Redo2, Monitor, Smartphone, PanelBottom, Code, Table, Quote, Share2, MoveVertical, Minus, Image, MousePointerClick, Type, Heading, Columns2, Megaphone, GripVertical, ChevronUp, ChevronDown, Copy, Trash2, Plus, Upload, Globe, Github, Youtube, Instagram, Linkedin, Twitter, Facebook } from 'lucide-react';
15
+ import DOMPurify from 'dompurify';
16
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
17
+
18
+ // src/components/EmailEditor/types.ts
19
+ function generateEmailBlockId() {
20
+ return globalThis.crypto?.randomUUID?.() ?? `b${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`;
21
+ }
22
+ function createDefaultDesignSettings() {
23
+ return {
24
+ bodyBackgroundColor: "#f4f4f5",
25
+ contentBackgroundColor: "#ffffff",
26
+ contentWidth: 600,
27
+ textColor: "#374151",
28
+ fontFamily: "Arial, Helvetica, sans-serif",
29
+ headingColor: "#111827",
30
+ linkColor: "#2563eb",
31
+ buttonBackgroundColor: "#2563eb",
32
+ buttonTextColor: "#ffffff",
33
+ buttonBorderRadius: 6
34
+ };
35
+ }
36
+ function resolveDesignSettings(design) {
37
+ const defined = Object.entries(design ?? {}).filter(
38
+ ([, v]) => v !== void 0
39
+ );
40
+ return { ...createDefaultDesignSettings(), ...Object.fromEntries(defined) };
41
+ }
42
+ function createEmailBlock(type) {
43
+ return newBlock(type);
44
+ }
45
+ function newBlock(type) {
46
+ const id = generateEmailBlockId();
47
+ switch (type) {
48
+ case "heading":
49
+ return { id, type, level: 2, text: "Heading", alignment: "left" };
50
+ case "text":
51
+ return { id, type, content: "<p>Write your message here.</p>" };
52
+ case "button":
53
+ return {
54
+ id,
55
+ type,
56
+ text: "Learn more",
57
+ url: "https://",
58
+ alignment: "center"
59
+ };
60
+ case "image":
61
+ return { id, type, src: "", alt: "", alignment: "center" };
62
+ case "divider":
63
+ return { id, type, style: "solid", color: "#e5e7eb" };
64
+ case "spacer":
65
+ return { id, type, height: 24 };
66
+ case "social":
67
+ return {
68
+ id,
69
+ type,
70
+ alignment: "center",
71
+ iconSize: "md",
72
+ links: [
73
+ { platform: "linkedin", url: "https://linkedin.com" },
74
+ { platform: "website", url: "https://" }
75
+ ]
76
+ };
77
+ case "html":
78
+ return { id, type, html: "<p>Custom HTML</p>" };
79
+ case "footer":
80
+ return {
81
+ id,
82
+ type,
83
+ showUnsubscribe: true,
84
+ unsubscribeText: "Unsubscribe from these emails",
85
+ alignment: "center",
86
+ color: "#6b7280"
87
+ };
88
+ case "quote":
89
+ return {
90
+ id,
91
+ type,
92
+ text: "A short testimonial.",
93
+ author: "Name",
94
+ role: "Title"
95
+ };
96
+ case "table":
97
+ return {
98
+ id,
99
+ type,
100
+ headerRow: true,
101
+ rows: [
102
+ ["Item", "Detail"],
103
+ ["", ""]
104
+ ]
105
+ };
106
+ case "hero":
107
+ return {
108
+ id,
109
+ type,
110
+ headline: "Big announcement",
111
+ subtitle: "One line that says why it matters.",
112
+ ctaText: "Read more",
113
+ ctaUrl: "https://",
114
+ backgroundColor: "#1e3a5f",
115
+ textColor: "#ffffff",
116
+ alignment: "center",
117
+ padding: 48
118
+ };
119
+ case "columns":
120
+ return {
121
+ id,
122
+ type,
123
+ columnCount: 2,
124
+ columns: [
125
+ { id: generateEmailBlockId(), width: 50, blocks: [] },
126
+ { id: generateEmailBlockId(), width: 50, blocks: [] }
127
+ ]
128
+ };
129
+ }
130
+ }
131
+ function createEmptyEmailContentTree() {
132
+ return {
133
+ version: "1.0",
134
+ blocks: [
135
+ {
136
+ ...createEmailBlock("heading"),
137
+ level: 1,
138
+ text: "Your email title",
139
+ alignment: "center"
140
+ },
141
+ createEmailBlock("text"),
142
+ createEmailBlock("footer")
143
+ ]
144
+ };
145
+ }
146
+
147
+ // src/components/EmailEditor/renderEmailMjml.ts
148
+ function escapeHtml(value) {
149
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
150
+ }
151
+ function isSafeUrl(value) {
152
+ return /^(https?:|mailto:|tel:|#|\/(?![/\\\s])|\{\{[^{}]*\}\}$)/i.test(
153
+ (value ?? "").trim()
154
+ );
155
+ }
156
+ function safeUrl(value) {
157
+ const url = (value ?? "").trim();
158
+ return isSafeUrl(url) ? escapeHtml(url) : "#";
159
+ }
160
+ var COLOR = /^(#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(rgb|rgba|hsl|hsla)\([\d\s.,%]+\)|[a-z]+)$/i;
161
+ function safeColor(value, fallback) {
162
+ return value && COLOR.test(value.trim()) ? value.trim() : fallback;
163
+ }
164
+ function safeGradient(value) {
165
+ const gradient = value?.trim() ?? "";
166
+ return /^(linear|radial)-gradient\([^;{}<>"()]*(\([^;{}<>"()]*\)[^;{}<>"()]*)*\)$/i.test(
167
+ gradient
168
+ ) && !/url\s*\(/i.test(gradient) ? gradient : null;
169
+ }
170
+ function heroGradient(block) {
171
+ return /^[\w-]+$/.test(block.id) ? safeGradient(block.backgroundGradient) : null;
172
+ }
173
+ function hasHeroCta(block) {
174
+ return Boolean(block.ctaText && block.ctaUrl);
175
+ }
176
+ function align(value, fallback) {
177
+ return value === "left" || value === "center" || value === "right" ? value : fallback;
178
+ }
179
+ function px(value, fallback, max = 2e3) {
180
+ const n = Number(value);
181
+ return Number.isFinite(n) ? Math.min(Math.max(Math.round(n), 0), max) : fallback;
182
+ }
183
+ var SANITIZE_CONFIG = {
184
+ FORBID_TAGS: ["style", "form", "input", "textarea", "select", "button"],
185
+ // Host CSS classes (e.g. `fixed inset-0`) and ids would escape the style
186
+ // allowlist; srcset/xlink:href would escape the URL policy below.
187
+ FORBID_ATTR: ["class", "id", "srcset", "xlink:href"]
188
+ };
189
+ var URL_ATTRIBUTES = /* @__PURE__ */ new Set(["href", "src", "background", "poster"]);
190
+ var SAFE_STYLE_PROPERTY = /^(color|background-color|font(-[a-z]+)?|text-(align|decoration|transform|indent)|line-height|letter-spacing|word-spacing|white-space|vertical-align|(margin|padding)(-(top|right|bottom|left))?|border(-(top|right|bottom|left))?(-(width|style|color))?|border-(collapse|spacing|radius)|(max-|min-)?(width|height)|display|list-style(-type)?)$/;
191
+ function sanitizeInlineStyle(style) {
192
+ return style.split(";").map((declaration) => {
193
+ const colon = declaration.indexOf(":");
194
+ if (colon === -1) return "";
195
+ const property = declaration.slice(0, colon).trim().toLowerCase();
196
+ const value = declaration.slice(colon + 1).trim();
197
+ return SAFE_STYLE_PROPERTY.test(property) && value && !/url\s*\(|expression\s*\(|@import|[<>\\]/i.test(value) && // Negative margins could pull content over the surrounding page.
198
+ !(property.startsWith("margin") && value.includes("-")) ? `${property}: ${value}` : "";
199
+ }).filter(Boolean).join("; ");
200
+ }
201
+ var purifier;
202
+ function installEmailPolicy(instance) {
203
+ instance.addHook("uponSanitizeAttribute", (_node, data) => {
204
+ if (URL_ATTRIBUTES.has(data.attrName)) {
205
+ if (!isSafeUrl(data.attrValue)) data.keepAttr = false;
206
+ return;
207
+ }
208
+ if (data.attrName !== "style") return;
209
+ data.attrValue = sanitizeInlineStyle(data.attrValue);
210
+ if (!data.attrValue) data.keepAttr = false;
211
+ });
212
+ return instance;
213
+ }
214
+ function createEmailHtmlSanitizer(win) {
215
+ const instance = DOMPurify(win);
216
+ if (!instance.isSupported) {
217
+ throw new Error(
218
+ "createEmailHtmlSanitizer: the supplied window cannot run DOMPurify."
219
+ );
220
+ }
221
+ installEmailPolicy(instance);
222
+ return (html) => instance.sanitize(html, SANITIZE_CONFIG);
223
+ }
224
+ function getPurifier() {
225
+ if (purifier !== void 0) return purifier;
226
+ if (typeof window === "undefined") return null;
227
+ const instance = DOMPurify(window);
228
+ if (!instance.isSupported) return purifier = null;
229
+ return purifier = installEmailPolicy(instance);
230
+ }
231
+ function sanitizeEmailHtml(html) {
232
+ return getPurifier()?.sanitize(html, SANITIZE_CONFIG) ?? null;
233
+ }
234
+ function defaultSanitize(html) {
235
+ const clean = sanitizeEmailHtml(html);
236
+ if (clean === null) {
237
+ throw new Error(
238
+ "renderEmailMjml: no DOM is available to sanitise HTML. Pass options.sanitizeHtml."
239
+ );
240
+ }
241
+ return clean;
242
+ }
243
+ var HEADING_SIZES = { 1: 32, 2: 26, 3: 22, 4: 18 };
244
+ var SOCIAL_NAMES = {
245
+ facebook: "facebook-noshare",
246
+ twitter: "twitter-noshare",
247
+ linkedin: "linkedin-noshare",
248
+ instagram: "instagram",
249
+ youtube: "youtube",
250
+ github: "github",
251
+ website: "web"
252
+ };
253
+ var ICON_SIZES = { sm: 20, md: 25, lg: 35 };
254
+ function renderContent(block, ctx, pad, available) {
255
+ const { design } = ctx;
256
+ switch (block.type) {
257
+ case "heading": {
258
+ const level = HEADING_SIZES[block.level] ? block.level : 2;
259
+ const color = safeColor(block.color, design.headingColor);
260
+ const size = HEADING_SIZES[level];
261
+ return `<mj-text align="${align(block.alignment, "left")}" font-size="${size}px" font-weight="bold" color="${color}" padding="${pad}"><h${level} style="font-size: ${size}px; line-height: 1.25;">${escapeHtml(block.text)}</h${level}></mj-text>`;
262
+ }
263
+ case "text": {
264
+ const color = block.color ? ` color="${safeColor(block.color, design.textColor)}"` : "";
265
+ return `<mj-text align="${align(block.alignment, "left")}"${color} padding="${pad}">${ctx.sanitize(block.content)}</mj-text>`;
266
+ }
267
+ case "button": {
268
+ const bg = safeColor(block.backgroundColor, design.buttonBackgroundColor);
269
+ const fg = safeColor(block.textColor, design.buttonTextColor);
270
+ const radius = px(
271
+ block.borderRadius ?? design.buttonBorderRadius,
272
+ 6,
273
+ 100
274
+ );
275
+ const width = block.fullWidth ? ' width="100%"' : "";
276
+ return `<mj-button align="${align(block.alignment, "center")}" background-color="${bg}" color="${fg}" border-radius="${radius}px" href="${safeUrl(block.url)}" font-size="16px" padding="${pad}"${width}>${escapeHtml(block.text)}</mj-button>`;
277
+ }
278
+ case "image": {
279
+ if (!block.src) return "";
280
+ const percent = /^(\d+(?:\.\d+)?|\.\d+)%$/.exec(
281
+ String(block.width ?? "").trim()
282
+ );
283
+ const share = percent ? Math.min(Number(percent[1]), 100) : 0;
284
+ const widthPx = percent ? Math.round(available * share / 100) : parseInt(String(block.width ?? ""), 10);
285
+ const width = Number.isFinite(widthPx) && widthPx > 0 && share !== 100 ? ` width="${px(widthPx, 600)}px"` : "";
286
+ const href = block.href ? ` href="${safeUrl(block.href)}"` : "";
287
+ const radius = block.borderRadius ? ` border-radius="${px(block.borderRadius, 0, 100)}px"` : "";
288
+ return `<mj-image src="${safeUrl(block.src)}" alt="${escapeHtml(block.alt ?? "")}" align="${align(block.alignment, "center")}"${width} padding="${pad}"${href}${radius} />`;
289
+ }
290
+ case "divider": {
291
+ const style = ["solid", "dashed", "dotted"].includes(block.style ?? "") ? block.style : "solid";
292
+ const width = /^\d+(px|%)$/.test(block.width ?? "") ? block.width : "100%";
293
+ return `<mj-divider border-color="${safeColor(block.color, "#e5e7eb")}" border-style="${style}" border-width="1px" width="${width}" padding="${pad}" />`;
294
+ }
295
+ case "spacer":
296
+ return `<mj-spacer height="${px(block.height, 24, 400)}px" />`;
297
+ case "social": {
298
+ const size = ICON_SIZES[block.iconSize ?? "md"] ?? ICON_SIZES.md;
299
+ const items = block.links.filter((link) => SOCIAL_NAMES[link.platform]).map(
300
+ (link) => `<mj-social-element name="${SOCIAL_NAMES[link.platform]}" href="${safeUrl(link.url)}" icon-size="${size}px" />`
301
+ ).join("");
302
+ return `<mj-social align="${align(block.alignment, "center")}" icon-size="${size}px" mode="horizontal" padding="${pad}">${items}</mj-social>`;
303
+ }
304
+ case "html":
305
+ return `<mj-raw>${ctx.sanitize(block.html)}</mj-raw>`;
306
+ case "footer": {
307
+ const color = safeColor(block.color, "#6b7280");
308
+ const lines = [block.companyName, block.address, block.phone].filter((line) => Boolean(line)).map(escapeHtml);
309
+ const links = [];
310
+ if (block.showUnsubscribe) {
311
+ links.push(
312
+ `<a href="${safeUrl(ctx.unsubscribeUrl)}" style="color: ${color};">${escapeHtml(block.unsubscribeText || "Unsubscribe")}</a>`
313
+ );
314
+ }
315
+ if (block.managePreferencesUrl) {
316
+ links.push(
317
+ `<a href="${safeUrl(block.managePreferencesUrl)}" style="color: ${color};">${escapeHtml(block.managePreferencesText || "Manage preferences")}</a>`
318
+ );
319
+ }
320
+ if (links.length) lines.push(links.join(" &nbsp; "));
321
+ return `<mj-text align="${align(block.alignment, "center")}" color="${color}" font-size="12px" padding="${pad}">${lines.join("<br />")}</mj-text>`;
322
+ }
323
+ case "quote": {
324
+ const fg = safeColor(block.textColor, "#1e293b");
325
+ const accent = safeColor(block.accentColor, design.linkColor);
326
+ const bg = safeColor(block.backgroundColor, "#f8fafc");
327
+ let attribution = "";
328
+ if (block.author) {
329
+ attribution = `<p style="margin: 12px 0 0; font-weight: 600;">${escapeHtml(block.author)}</p>`;
330
+ if (block.role) {
331
+ attribution += `<p style="margin: 2px 0 0; font-size: 13px; opacity: 0.75;">${escapeHtml(block.role)}</p>`;
332
+ }
333
+ }
334
+ return `<mj-text align="${align(block.alignment, "left")}" color="${fg}" container-background-color="${bg}" padding="${pad}"><div style="border-left: 4px solid ${accent}; padding: 8px 0 8px 16px;"><p style="font-size: 18px; font-style: italic; line-height: 1.6; margin: 0;">&ldquo;${escapeHtml(block.text)}&rdquo;</p>${attribution}</div></mj-text>`;
335
+ }
336
+ case "table": {
337
+ if (!block.rows.length) return "";
338
+ const border = safeColor(block.borderColor, "#e5e7eb");
339
+ const headBg = safeColor(block.headerBackgroundColor, "#f3f4f6");
340
+ const headFg = safeColor(block.headerTextColor, design.headingColor);
341
+ const textAlign = align(block.alignment, "left");
342
+ const rows = block.rows.map((row, r) => {
343
+ const head = block.headerRow && r === 0;
344
+ const tag = head ? "th" : "td";
345
+ const style = head ? `background-color: ${headBg}; color: ${headFg}; font-weight: 600; ` : "";
346
+ return `<tr>${row.map(
347
+ (cell) => `<${tag} style="${style}padding: 10px 12px; border: 1px solid ${border}; text-align: ${textAlign};">${escapeHtml(cell)}</${tag}>`
348
+ ).join("")}</tr>`;
349
+ }).join("");
350
+ return `<mj-table padding="${pad}" width="100%" cellpadding="0" cellspacing="0" css-class="email-table">${rows}</mj-table>`;
351
+ }
352
+ // Unsupported block types (host-owned blocks in a loaded document) are
353
+ // omitted from the email; the canvas shows a placeholder for them.
354
+ default:
355
+ return "";
356
+ }
357
+ }
358
+ function renderHero(block) {
359
+ const bg = safeColor(block.backgroundColor, "#1e3a5f");
360
+ const fg = safeColor(block.textColor, "#ffffff");
361
+ const a = align(block.alignment, "center");
362
+ const parts = [];
363
+ if (block.categoryText) {
364
+ parts.push(
365
+ `<mj-text align="${a}" color="${fg}" font-size="12px" font-weight="700" letter-spacing="2px" text-transform="uppercase" padding="0 0 8px 0">${escapeHtml(block.categoryText)}</mj-text>`
366
+ );
367
+ }
368
+ parts.push(
369
+ `<mj-text align="${a}" color="${fg}" font-size="32px" font-weight="bold" line-height="1.2" padding="0 0 8px 0"><h1 style="color: ${fg}; margin: 0; font-size: 32px; line-height: 1.2;">${escapeHtml(block.headline)}</h1></mj-text>`
370
+ );
371
+ if (block.subtitle) {
372
+ parts.push(
373
+ `<mj-text align="${a}" color="${fg}" font-size="16px" line-height="1.5" padding="0 0 16px 0">${escapeHtml(block.subtitle)}</mj-text>`
374
+ );
375
+ }
376
+ if (hasHeroCta(block)) {
377
+ parts.push(
378
+ `<mj-button align="${a}" background-color="${safeColor(block.ctaColor, "#ffffff")}" color="${bg}" font-size="16px" font-weight="600" border-radius="6px" padding="8px 0" href="${safeUrl(block.ctaUrl)}">${escapeHtml(block.ctaText ?? "")}</mj-button>`
379
+ );
380
+ }
381
+ const gradient = heroGradient(block) ? ` css-class="hero-gradient-${block.id}"` : "";
382
+ return `<mj-section full-width="full-width" background-color="${bg}" padding="${px(block.padding, 48, 200)}px 25px"${gradient}><mj-column>${parts.join("")}</mj-column></mj-section>`;
383
+ }
384
+ function renderBlock(block, ctx) {
385
+ if (block.type === "hero") return renderHero(block);
386
+ if (block.type === "columns") {
387
+ const bg = block.backgroundColor ? ` background-color="${safeColor(block.backgroundColor, "transparent")}"` : "";
388
+ const columns = block.columns.map((column) => {
389
+ const width = column.width ? ` width="${px(column.width, 50, 100)}%"` : "";
390
+ const colBg = column.backgroundColor ? ` background-color="${safeColor(column.backgroundColor, "transparent")}"` : "";
391
+ const share = px(column.width ?? 100 / block.columns.length, 50, 100);
392
+ const available = Math.round(ctx.design.contentWidth * share / 100) - 24;
393
+ const inner = column.blocks.map((b) => renderContent(b, ctx, "8px 12px", available)).join("");
394
+ return `<mj-column${width}${colBg}>${inner || "<mj-text> </mj-text>"}</mj-column>`;
395
+ }).join("");
396
+ return `<mj-section${bg}>${columns}</mj-section>`;
397
+ }
398
+ const content = renderContent(
399
+ block,
400
+ ctx,
401
+ "10px 25px",
402
+ ctx.design.contentWidth - 50
403
+ );
404
+ return content ? `<mj-section><mj-column>${content}</mj-column></mj-section>` : "";
405
+ }
406
+ function normalizeDesignSettings(design) {
407
+ const defaults = createDefaultDesignSettings();
408
+ const d = resolveDesignSettings(design);
409
+ const color = (key) => safeColor(d[key], defaults[key]);
410
+ return {
411
+ bodyBackgroundColor: color("bodyBackgroundColor"),
412
+ contentBackgroundColor: color("contentBackgroundColor"),
413
+ textColor: color("textColor"),
414
+ headingColor: color("headingColor"),
415
+ linkColor: color("linkColor"),
416
+ buttonBackgroundColor: color("buttonBackgroundColor"),
417
+ buttonTextColor: color("buttonTextColor"),
418
+ buttonBorderRadius: px(d.buttonBorderRadius, 6, 100),
419
+ // The design UI's 320px floor also applies to documents set programmatically.
420
+ contentWidth: Math.max(320, px(d.contentWidth, 600, 1200)),
421
+ fontFamily: typeof d.fontFamily === "string" && /^[\w\s,'-]+$/.test(d.fontFamily) ? d.fontFamily : defaults.fontFamily
422
+ };
423
+ }
424
+ function renderEmailMjml(tree, options = {}) {
425
+ const design = normalizeDesignSettings(options.design);
426
+ const ctx = {
427
+ design,
428
+ sanitize: options.sanitizeHtml ?? defaultSanitize,
429
+ unsubscribeUrl: options.unsubscribeUrl ?? "{{unsubscribe_url}}"
430
+ };
431
+ const gradients = tree.blocks.filter((b) => b.type === "hero").map((b) => {
432
+ const gradient = heroGradient(b);
433
+ return gradient ? `.hero-gradient-${b.id} { background: ${gradient} !important; }` : "";
434
+ }).filter(Boolean).join("\n");
435
+ return `<mjml>
436
+ <mj-head>
437
+ <mj-attributes>
438
+ <mj-all font-family="${escapeHtml(design.fontFamily)}" color="${design.textColor}" />
439
+ <mj-text font-size="16px" line-height="1.6" />
440
+ <mj-section background-color="${design.contentBackgroundColor}" />
441
+ </mj-attributes>
442
+ <mj-style>
443
+ a { color: ${design.linkColor}; }
444
+ h1, h2, h3, h4 { color: inherit; margin: 0; }
445
+ ${gradients}
446
+ </mj-style>
447
+ <mj-style inline="inline">
448
+ .email-table table { border-collapse: collapse; }
449
+ </mj-style>
450
+ </mj-head>
451
+ <mj-body background-color="${design.bodyBackgroundColor}" width="${design.contentWidth}px">
452
+ ${tree.blocks.map((block) => renderBlock(block, ctx)).join("\n ")}
453
+ </mj-body>
454
+ </mjml>`;
455
+ }
456
+ var SOCIAL_ICONS = {
457
+ facebook: Facebook,
458
+ twitter: Twitter,
459
+ linkedin: Linkedin,
460
+ instagram: Instagram,
461
+ youtube: Youtube,
462
+ github: Github,
463
+ website: Globe
464
+ };
465
+ var HEADING_SIZES2 = { 1: 32, 2: 26, 3: 22, 4: 18 };
466
+ function SafeHtml({
467
+ html,
468
+ style
469
+ }) {
470
+ const [clean, setClean] = React3.useState("");
471
+ React3.useEffect(() => setClean(sanitizeEmailHtml(html) ?? ""), [html]);
472
+ return /* @__PURE__ */ jsx(
473
+ "div",
474
+ {
475
+ style,
476
+ className: "[&_a]:underline [&_ol]:list-decimal [&_ol]:ps-6 [&_p]:my-3 [&_ul]:list-disc [&_ul]:ps-6",
477
+ dangerouslySetInnerHTML: { __html: clean }
478
+ }
479
+ );
480
+ }
481
+ function EmailBlockPreview({
482
+ block,
483
+ design,
484
+ renderChild,
485
+ emptyColumnLabel,
486
+ unsupportedBlockLabel,
487
+ platformLabels
488
+ }) {
489
+ const pad = "10px 25px";
490
+ switch (block.type) {
491
+ case "heading": {
492
+ const Tag = `h${block.level}`;
493
+ return /* @__PURE__ */ jsx(
494
+ Tag,
495
+ {
496
+ style: {
497
+ margin: 0,
498
+ padding: pad,
499
+ fontSize: HEADING_SIZES2[block.level],
500
+ fontWeight: 700,
501
+ lineHeight: 1.25,
502
+ textAlign: block.alignment ?? "left",
503
+ color: safeColor(block.color, design.headingColor)
504
+ },
505
+ children: block.text
506
+ }
507
+ );
508
+ }
509
+ case "text":
510
+ return /* @__PURE__ */ jsx(
511
+ SafeHtml,
512
+ {
513
+ html: block.content,
514
+ style: {
515
+ padding: pad,
516
+ textAlign: block.alignment ?? "left",
517
+ color: safeColor(block.color, design.textColor)
518
+ }
519
+ }
520
+ );
521
+ case "button":
522
+ return /* @__PURE__ */ jsx("div", { style: { padding: pad, textAlign: block.alignment ?? "center" }, children: /* @__PURE__ */ jsx(
523
+ "span",
524
+ {
525
+ style: {
526
+ display: block.fullWidth ? "block" : "inline-block",
527
+ padding: "10px 25px",
528
+ background: safeColor(
529
+ block.backgroundColor,
530
+ design.buttonBackgroundColor
531
+ ),
532
+ color: safeColor(block.textColor, design.buttonTextColor),
533
+ borderRadius: block.borderRadius ?? design.buttonBorderRadius,
534
+ fontWeight: 600
535
+ },
536
+ children: block.text
537
+ }
538
+ ) });
539
+ case "image":
540
+ return /* @__PURE__ */ jsx("div", { style: { padding: pad, textAlign: block.alignment ?? "center" }, children: block.src ? /* @__PURE__ */ jsx(
541
+ "img",
542
+ {
543
+ src: block.src,
544
+ alt: block.alt,
545
+ style: {
546
+ display: "inline-block",
547
+ maxWidth: "100%",
548
+ // Zero/invalid widths fall back to full width, matching the
549
+ // omitted width in renderEmailMjml.
550
+ width: parseFloat(String(block.width ?? "")) > 0 ? block.width : "100%",
551
+ borderRadius: block.borderRadius
552
+ }
553
+ }
554
+ ) : /* @__PURE__ */ jsx("div", { className: "border-border text-muted-foreground flex h-32 items-center justify-center rounded-md border-2 border-dashed", children: /* @__PURE__ */ jsx(Image, { className: "h-8 w-8", "aria-hidden": "true" }) }) });
555
+ case "divider":
556
+ return /* @__PURE__ */ jsx("div", { style: { padding: pad }, children: /* @__PURE__ */ jsx(
557
+ "hr",
558
+ {
559
+ style: {
560
+ margin: "0 auto",
561
+ border: 0,
562
+ borderTop: `1px ${block.style ?? "solid"} ${safeColor(block.color, "#e5e7eb")}`,
563
+ width: block.width ?? "100%"
564
+ }
565
+ }
566
+ ) });
567
+ case "spacer":
568
+ return /* @__PURE__ */ jsx("div", { style: { height: block.height } });
569
+ case "social": {
570
+ const size = { sm: 20, md: 25, lg: 35 }[block.iconSize ?? "md"];
571
+ return /* @__PURE__ */ jsx(
572
+ "div",
573
+ {
574
+ style: {
575
+ padding: pad,
576
+ display: "flex",
577
+ gap: 8,
578
+ justifyContent: block.alignment === "left" ? "flex-start" : block.alignment === "right" ? "flex-end" : "center"
579
+ },
580
+ children: block.links.map((link, i) => {
581
+ const Icon = SOCIAL_ICONS[link.platform] ?? Globe;
582
+ return /* @__PURE__ */ jsx(
583
+ Icon,
584
+ {
585
+ width: size,
586
+ height: size,
587
+ role: "img",
588
+ "aria-label": platformLabels[link.platform] ?? link.platform
589
+ },
590
+ i
591
+ );
592
+ })
593
+ }
594
+ );
595
+ }
596
+ case "html":
597
+ return /* @__PURE__ */ jsx(SafeHtml, { html: block.html, style: { padding: pad } });
598
+ case "footer": {
599
+ const color = safeColor(block.color, "#6b7280");
600
+ return /* @__PURE__ */ jsxs(
601
+ "div",
602
+ {
603
+ style: {
604
+ padding: pad,
605
+ fontSize: 12,
606
+ color,
607
+ textAlign: block.alignment ?? "center"
608
+ },
609
+ children: [
610
+ [block.companyName, block.address, block.phone].filter(Boolean).map((line, i) => /* @__PURE__ */ jsx("div", { children: line }, i)),
611
+ /* @__PURE__ */ jsxs("div", { children: [
612
+ block.showUnsubscribe && /* @__PURE__ */ jsx("span", { style: { textDecoration: "underline" }, children: block.unsubscribeText || "Unsubscribe" }),
613
+ block.managePreferencesUrl && /* @__PURE__ */ jsx(
614
+ "span",
615
+ {
616
+ style: { textDecoration: "underline", marginInlineStart: 12 },
617
+ children: block.managePreferencesText || "Manage preferences"
618
+ }
619
+ )
620
+ ] })
621
+ ]
622
+ }
623
+ );
624
+ }
625
+ case "quote":
626
+ return /* @__PURE__ */ jsxs(
627
+ "div",
628
+ {
629
+ style: {
630
+ margin: pad,
631
+ padding: "8px 16px",
632
+ background: safeColor(block.backgroundColor, "#f8fafc"),
633
+ color: safeColor(block.textColor, "#1e293b"),
634
+ borderInlineStart: `4px solid ${safeColor(block.accentColor, design.linkColor)}`,
635
+ textAlign: block.alignment ?? "left"
636
+ },
637
+ children: [
638
+ /* @__PURE__ */ jsxs("p", { style: { margin: 0, fontSize: 18, fontStyle: "italic" }, children: [
639
+ "\u201C",
640
+ block.text,
641
+ "\u201D"
642
+ ] }),
643
+ block.author && /* @__PURE__ */ jsx("p", { style: { margin: "12px 0 0", fontWeight: 600 }, children: block.author }),
644
+ block.author && block.role && /* @__PURE__ */ jsx("p", { style: { margin: "2px 0 0", fontSize: 13, opacity: 0.75 }, children: block.role })
645
+ ]
646
+ }
647
+ );
648
+ case "table": {
649
+ const border = `1px solid ${safeColor(block.borderColor, "#e5e7eb")}`;
650
+ return /* @__PURE__ */ jsx("div", { style: { padding: pad }, children: /* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse" }, children: /* @__PURE__ */ jsx("tbody", { children: block.rows.map((row, r) => {
651
+ const head = block.headerRow && r === 0;
652
+ return /* @__PURE__ */ jsx("tr", { children: row.map((cell, c) => {
653
+ const Cell = head ? "th" : "td";
654
+ return /* @__PURE__ */ jsx(
655
+ Cell,
656
+ {
657
+ style: {
658
+ border,
659
+ padding: "10px 12px",
660
+ textAlign: block.alignment ?? "left",
661
+ ...head && {
662
+ background: safeColor(
663
+ block.headerBackgroundColor,
664
+ "#f3f4f6"
665
+ ),
666
+ color: safeColor(
667
+ block.headerTextColor,
668
+ design.headingColor
669
+ )
670
+ }
671
+ },
672
+ children: cell
673
+ },
674
+ c
675
+ );
676
+ }) }, r);
677
+ }) }) }) });
678
+ }
679
+ case "hero": {
680
+ const color = safeColor(block.textColor, "#ffffff");
681
+ const bg = safeColor(block.backgroundColor, "#1e3a5f");
682
+ return /* @__PURE__ */ jsxs(
683
+ "div",
684
+ {
685
+ style: {
686
+ padding: `${block.padding ?? 48}px 25px`,
687
+ background: safeGradient(block.backgroundGradient) ?? bg,
688
+ color,
689
+ textAlign: block.alignment ?? "center"
690
+ },
691
+ children: [
692
+ block.categoryText && /* @__PURE__ */ jsx(
693
+ "div",
694
+ {
695
+ style: {
696
+ fontSize: 12,
697
+ fontWeight: 700,
698
+ letterSpacing: 2,
699
+ textTransform: "uppercase",
700
+ marginBottom: 8
701
+ },
702
+ children: block.categoryText
703
+ }
704
+ ),
705
+ /* @__PURE__ */ jsx(
706
+ "h1",
707
+ {
708
+ style: { margin: "0 0 8px", fontSize: 32, lineHeight: 1.2, color },
709
+ children: block.headline
710
+ }
711
+ ),
712
+ block.subtitle && /* @__PURE__ */ jsx("p", { style: { margin: "0 0 16px" }, children: block.subtitle }),
713
+ hasHeroCta(block) && /* @__PURE__ */ jsx(
714
+ "span",
715
+ {
716
+ style: {
717
+ display: "inline-block",
718
+ padding: "10px 25px",
719
+ borderRadius: 6,
720
+ fontWeight: 600,
721
+ background: safeColor(block.ctaColor, "#ffffff"),
722
+ color: bg
723
+ },
724
+ children: block.ctaText
725
+ }
726
+ )
727
+ ]
728
+ }
729
+ );
730
+ }
731
+ case "columns":
732
+ return /* @__PURE__ */ jsx(
733
+ "div",
734
+ {
735
+ style: {
736
+ display: "flex",
737
+ flexWrap: "wrap",
738
+ background: block.backgroundColor ? safeColor(block.backgroundColor, "transparent") : void 0
739
+ },
740
+ children: block.columns.map((column) => /* @__PURE__ */ jsx(
741
+ "div",
742
+ {
743
+ style: {
744
+ flex: `1 1 ${column.width ?? 100 / block.columns.length}%`,
745
+ minWidth: 160,
746
+ padding: 4,
747
+ background: column.backgroundColor ? safeColor(column.backgroundColor, "transparent") : void 0
748
+ },
749
+ children: column.blocks.length ? column.blocks.map((child) => /* @__PURE__ */ jsx(React3.Fragment, { children: renderChild(child) }, child.id)) : /* @__PURE__ */ jsx("div", { className: "border-border text-muted-foreground rounded-md border border-dashed p-4 text-center text-xs", children: emptyColumnLabel })
750
+ },
751
+ column.id
752
+ ))
753
+ }
754
+ );
755
+ // Host-owned block types (e.g. Waggleline-only blocks) are kept in the
756
+ // document but rendered as a visible placeholder; `renderEmailMjml` omits them.
757
+ default:
758
+ return /* @__PURE__ */ jsx(
759
+ "div",
760
+ {
761
+ role: "note",
762
+ className: "border-border text-muted-foreground m-2 rounded-md border border-dashed p-4 text-center text-xs",
763
+ children: unsupportedBlockLabel.replace(
764
+ "{type}",
765
+ block.type
766
+ )
767
+ }
768
+ );
769
+ }
770
+ }
771
+ function Button2(props) {
772
+ return /* @__PURE__ */ jsx(Button, { type: "button", ...props });
773
+ }
774
+ function TextField({
775
+ multiline,
776
+ ...props
777
+ }) {
778
+ const Control = multiline ? Textarea : Input;
779
+ return /* @__PURE__ */ jsx(
780
+ Control,
781
+ {
782
+ label: props.label,
783
+ value: props.value ?? "",
784
+ placeholder: props.placeholder,
785
+ onChange: (e) => props.onChange(e.target.value)
786
+ }
787
+ );
788
+ }
789
+ function NumberField({
790
+ label,
791
+ value,
792
+ onChange,
793
+ min = 0,
794
+ max
795
+ }) {
796
+ return /* @__PURE__ */ jsx(
797
+ Input,
798
+ {
799
+ type: "number",
800
+ label,
801
+ min,
802
+ max,
803
+ value: value ?? "",
804
+ onChange: (e) => {
805
+ const n = Number(e.target.value);
806
+ if (e.target.value !== "" && Number.isFinite(n)) onChange(n);
807
+ }
808
+ }
809
+ );
810
+ }
811
+ var HEX6 = /^#[0-9a-f]{6}$/i;
812
+ function ColorField({
813
+ label,
814
+ value,
815
+ onChange,
816
+ fallback = "#000000"
817
+ }) {
818
+ const swatch = value && HEX6.test(value) ? value : fallback;
819
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-2", children: [
820
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(
821
+ Input,
822
+ {
823
+ label,
824
+ value: value ?? "",
825
+ placeholder: fallback,
826
+ onChange: (e) => onChange(e.target.value)
827
+ }
828
+ ) }),
829
+ /* @__PURE__ */ jsx(
830
+ "input",
831
+ {
832
+ type: "color",
833
+ "aria-label": label,
834
+ value: HEX6.test(swatch) ? swatch : "#000000",
835
+ onChange: (e) => onChange(e.target.value),
836
+ className: "border-border bg-background h-10 w-10 shrink-0 cursor-pointer rounded-md border p-1"
837
+ }
838
+ )
839
+ ] });
840
+ }
841
+ function SelectField({
842
+ label,
843
+ value,
844
+ onChange,
845
+ options
846
+ }) {
847
+ return /* @__PURE__ */ jsx(
848
+ Select,
849
+ {
850
+ label,
851
+ value,
852
+ options,
853
+ onValueChange: (v) => onChange(v)
854
+ }
855
+ );
856
+ }
857
+ function SwitchField({ label, value, onChange }) {
858
+ return /* @__PURE__ */ jsx(Switch, { label, checked: Boolean(value), onCheckedChange: onChange });
859
+ }
860
+ var SOCIAL_PLATFORMS = [
861
+ "facebook",
862
+ "twitter",
863
+ "linkedin",
864
+ "instagram",
865
+ "youtube",
866
+ "github",
867
+ "website"
868
+ ];
869
+ var CONTENT_BLOCK_TYPES = [
870
+ "heading",
871
+ "text",
872
+ "button",
873
+ "image",
874
+ "divider",
875
+ "spacer",
876
+ "social",
877
+ "quote",
878
+ "table",
879
+ "html",
880
+ "footer"
881
+ ];
882
+ function resizeColumns(columns, count) {
883
+ const width = Math.floor(100 / count);
884
+ const next = Array.from({ length: count }, (_, i) => ({
885
+ ...columns[i] ?? { id: generateEmailBlockId(), blocks: [] },
886
+ // The last column absorbs the rounding remainder so widths sum to 100.
887
+ width: i === count - 1 ? 100 - width * (count - 1) : width
888
+ }));
889
+ const dropped = columns.slice(count).flatMap((c) => c.blocks);
890
+ next[count - 1] = {
891
+ ...next[count - 1],
892
+ blocks: [...next[count - 1].blocks, ...dropped]
893
+ };
894
+ return next;
895
+ }
896
+ function EmailBlockSettings({
897
+ block,
898
+ design,
899
+ onChange,
900
+ onAddToColumn,
901
+ labels,
902
+ variableGroups,
903
+ onUploadImage
904
+ }) {
905
+ const f = labels.fields;
906
+ const o = labels.options;
907
+ const set = onChange;
908
+ const alignOptions = [
909
+ { value: "left", label: o.left },
910
+ { value: "center", label: o.center },
911
+ { value: "right", label: o.right }
912
+ ];
913
+ const alignment = (value, fallback) => /* @__PURE__ */ jsx(
914
+ SelectField,
915
+ {
916
+ label: f.alignment,
917
+ value: value ?? fallback,
918
+ options: alignOptions,
919
+ onChange: (v) => onChange({ alignment: v })
920
+ }
921
+ );
922
+ const uploadRef = React3.useRef(null);
923
+ const [uploading, setUploading] = React3.useState(false);
924
+ const [uploadFailed, setUploadFailed] = React3.useState(false);
925
+ const emitted = React3.useRef(null);
926
+ switch (block.type) {
927
+ case "heading":
928
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
929
+ /* @__PURE__ */ jsx(
930
+ TextField,
931
+ {
932
+ label: f.text,
933
+ value: block.text,
934
+ onChange: (text) => set({ text })
935
+ }
936
+ ),
937
+ /* @__PURE__ */ jsx(
938
+ SelectField,
939
+ {
940
+ label: f.level,
941
+ value: String(block.level),
942
+ options: ["1", "2", "3", "4"].map((v) => ({
943
+ value: v,
944
+ label: `H${v}`
945
+ })),
946
+ onChange: (v) => set({ level: Number(v) })
947
+ }
948
+ ),
949
+ alignment(block.alignment, "left"),
950
+ /* @__PURE__ */ jsx(
951
+ ColorField,
952
+ {
953
+ label: f.color,
954
+ value: block.color,
955
+ fallback: design.headingColor,
956
+ onChange: (color) => set({ color })
957
+ }
958
+ )
959
+ ] });
960
+ case "text":
961
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
962
+ /* @__PURE__ */ jsx(
963
+ RichTextEditor,
964
+ {
965
+ "aria-label": f.content,
966
+ value: block.content === emitted.current ? block.content : sanitizeEmailHtml(block.content) ?? "",
967
+ onChange: (content) => {
968
+ emitted.current = content;
969
+ set({ content });
970
+ },
971
+ sanitizeHtml: (html) => sanitizeEmailHtml(html) ?? "",
972
+ variableGroups,
973
+ enableDictation: false
974
+ }
975
+ ),
976
+ alignment(block.alignment, "left"),
977
+ /* @__PURE__ */ jsx(
978
+ ColorField,
979
+ {
980
+ label: f.color,
981
+ value: block.color,
982
+ fallback: design.textColor,
983
+ onChange: (color) => set({ color })
984
+ }
985
+ )
986
+ ] });
987
+ case "button":
988
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
989
+ /* @__PURE__ */ jsx(
990
+ TextField,
991
+ {
992
+ label: f.text,
993
+ value: block.text,
994
+ onChange: (text) => set({ text })
995
+ }
996
+ ),
997
+ /* @__PURE__ */ jsx(
998
+ TextField,
999
+ {
1000
+ label: f.url,
1001
+ value: block.url,
1002
+ onChange: (url) => set({ url })
1003
+ }
1004
+ ),
1005
+ alignment(block.alignment, "center"),
1006
+ /* @__PURE__ */ jsx(
1007
+ ColorField,
1008
+ {
1009
+ label: f.backgroundColor,
1010
+ value: block.backgroundColor,
1011
+ fallback: design.buttonBackgroundColor,
1012
+ onChange: (backgroundColor) => set({ backgroundColor })
1013
+ }
1014
+ ),
1015
+ /* @__PURE__ */ jsx(
1016
+ ColorField,
1017
+ {
1018
+ label: f.textColor,
1019
+ value: block.textColor,
1020
+ fallback: design.buttonTextColor,
1021
+ onChange: (textColor) => set({ textColor })
1022
+ }
1023
+ ),
1024
+ /* @__PURE__ */ jsx(
1025
+ NumberField,
1026
+ {
1027
+ label: f.borderRadius,
1028
+ value: block.borderRadius ?? design.buttonBorderRadius,
1029
+ max: 100,
1030
+ onChange: (borderRadius) => set({ borderRadius })
1031
+ }
1032
+ ),
1033
+ /* @__PURE__ */ jsx(
1034
+ SwitchField,
1035
+ {
1036
+ label: f.fullWidth,
1037
+ value: block.fullWidth,
1038
+ onChange: (fullWidth) => set({ fullWidth })
1039
+ }
1040
+ )
1041
+ ] });
1042
+ case "image":
1043
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1044
+ /* @__PURE__ */ jsx(
1045
+ TextField,
1046
+ {
1047
+ label: f.imageUrl,
1048
+ value: block.src,
1049
+ onChange: (src) => set({ src })
1050
+ }
1051
+ ),
1052
+ onUploadImage && /* @__PURE__ */ jsxs(Fragment, { children: [
1053
+ /* @__PURE__ */ jsx(
1054
+ "input",
1055
+ {
1056
+ ref: uploadRef,
1057
+ type: "file",
1058
+ accept: "image/*",
1059
+ className: "sr-only",
1060
+ tabIndex: -1,
1061
+ "aria-hidden": "true",
1062
+ onChange: async (e) => {
1063
+ const file = e.target.files?.[0];
1064
+ e.target.value = "";
1065
+ if (!file) return;
1066
+ setUploading(true);
1067
+ setUploadFailed(false);
1068
+ try {
1069
+ set({ src: await onUploadImage(file) });
1070
+ } catch {
1071
+ setUploadFailed(true);
1072
+ } finally {
1073
+ setUploading(false);
1074
+ }
1075
+ }
1076
+ }
1077
+ ),
1078
+ /* @__PURE__ */ jsx(
1079
+ Button2,
1080
+ {
1081
+ variant: "outline",
1082
+ size: "sm",
1083
+ isLoading: uploading,
1084
+ leftIcon: /* @__PURE__ */ jsx(Upload, { className: "h-4 w-4", "aria-hidden": "true" }),
1085
+ onClick: () => uploadRef.current?.click(),
1086
+ children: f.uploadImage
1087
+ }
1088
+ ),
1089
+ uploadFailed && /* @__PURE__ */ jsx("p", { role: "alert", className: "text-destructive text-sm", children: f.uploadFailed })
1090
+ ] }),
1091
+ /* @__PURE__ */ jsx(
1092
+ TextField,
1093
+ {
1094
+ label: f.altText,
1095
+ value: block.alt,
1096
+ onChange: (alt) => set({ alt })
1097
+ }
1098
+ ),
1099
+ /* @__PURE__ */ jsx(
1100
+ TextField,
1101
+ {
1102
+ label: f.url,
1103
+ value: block.href,
1104
+ onChange: (href) => set({ href })
1105
+ }
1106
+ ),
1107
+ /* @__PURE__ */ jsx(
1108
+ TextField,
1109
+ {
1110
+ label: f.width,
1111
+ value: block.width === void 0 ? "" : String(block.width),
1112
+ placeholder: "100%",
1113
+ onChange: (width) => set({ width: /^\d+$/.test(width) ? Number(width) : width })
1114
+ }
1115
+ ),
1116
+ /* @__PURE__ */ jsx(
1117
+ NumberField,
1118
+ {
1119
+ label: f.borderRadius,
1120
+ value: block.borderRadius,
1121
+ max: 100,
1122
+ onChange: (borderRadius) => set({ borderRadius })
1123
+ }
1124
+ ),
1125
+ alignment(block.alignment, "center")
1126
+ ] });
1127
+ case "divider":
1128
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1129
+ /* @__PURE__ */ jsx(
1130
+ SelectField,
1131
+ {
1132
+ label: f.style,
1133
+ value: block.style ?? "solid",
1134
+ options: ["solid", "dashed", "dotted"].map((v) => ({
1135
+ value: v,
1136
+ label: o[v]
1137
+ })),
1138
+ onChange: (style) => set({ style })
1139
+ }
1140
+ ),
1141
+ /* @__PURE__ */ jsx(
1142
+ ColorField,
1143
+ {
1144
+ label: f.color,
1145
+ value: block.color,
1146
+ onChange: (color) => set({ color })
1147
+ }
1148
+ ),
1149
+ /* @__PURE__ */ jsx(
1150
+ TextField,
1151
+ {
1152
+ label: f.width,
1153
+ value: block.width,
1154
+ placeholder: "100%",
1155
+ onChange: (width) => set({ width })
1156
+ }
1157
+ )
1158
+ ] });
1159
+ case "spacer":
1160
+ return /* @__PURE__ */ jsx(
1161
+ NumberField,
1162
+ {
1163
+ label: f.height,
1164
+ value: block.height,
1165
+ max: 400,
1166
+ onChange: (height) => set({ height })
1167
+ }
1168
+ );
1169
+ case "social":
1170
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1171
+ alignment(block.alignment, "center"),
1172
+ /* @__PURE__ */ jsx(
1173
+ SelectField,
1174
+ {
1175
+ label: f.iconSize,
1176
+ value: block.iconSize ?? "md",
1177
+ options: ["sm", "md", "lg"].map((v) => ({
1178
+ value: v,
1179
+ label: o[v]
1180
+ })),
1181
+ onChange: (iconSize) => set({ iconSize })
1182
+ }
1183
+ ),
1184
+ block.links.map((link, i) => {
1185
+ const update = (patch) => set({
1186
+ links: block.links.map(
1187
+ (l, j) => j === i ? { ...l, ...patch } : l
1188
+ )
1189
+ });
1190
+ return /* @__PURE__ */ jsxs(
1191
+ "fieldset",
1192
+ {
1193
+ className: "border-border space-y-2 rounded-md border p-3",
1194
+ children: [
1195
+ /* @__PURE__ */ jsx("legend", { className: "sr-only", children: f.socialLink.replace("{number}", String(i + 1)) }),
1196
+ /* @__PURE__ */ jsx(
1197
+ SelectField,
1198
+ {
1199
+ label: f.platform,
1200
+ value: link.platform,
1201
+ options: SOCIAL_PLATFORMS.map((p) => ({
1202
+ value: p,
1203
+ label: labels.platforms[p]
1204
+ })),
1205
+ onChange: (platform) => update({ platform })
1206
+ }
1207
+ ),
1208
+ /* @__PURE__ */ jsx(
1209
+ TextField,
1210
+ {
1211
+ label: f.url,
1212
+ value: link.url,
1213
+ onChange: (url) => update({ url })
1214
+ }
1215
+ ),
1216
+ /* @__PURE__ */ jsx(
1217
+ Button2,
1218
+ {
1219
+ variant: "ghost",
1220
+ size: "sm",
1221
+ leftIcon: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" }),
1222
+ onClick: () => set({ links: block.links.filter((_, j) => j !== i) }),
1223
+ children: f.removeLink
1224
+ }
1225
+ )
1226
+ ]
1227
+ },
1228
+ i
1229
+ );
1230
+ }),
1231
+ /* @__PURE__ */ jsx(
1232
+ Button2,
1233
+ {
1234
+ variant: "outline",
1235
+ size: "sm",
1236
+ leftIcon: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" }),
1237
+ onClick: () => set({
1238
+ links: [
1239
+ ...block.links,
1240
+ { platform: "website", url: "https://" }
1241
+ ]
1242
+ }),
1243
+ children: f.addLink
1244
+ }
1245
+ )
1246
+ ] });
1247
+ case "html":
1248
+ return /* @__PURE__ */ jsx(
1249
+ Textarea,
1250
+ {
1251
+ label: f.html,
1252
+ value: block.html,
1253
+ rows: 10,
1254
+ className: "font-mono text-xs",
1255
+ onChange: (e) => set({ html: e.target.value })
1256
+ }
1257
+ );
1258
+ case "footer":
1259
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1260
+ /* @__PURE__ */ jsx(
1261
+ TextField,
1262
+ {
1263
+ label: f.companyName,
1264
+ value: block.companyName,
1265
+ onChange: (companyName) => set({ companyName })
1266
+ }
1267
+ ),
1268
+ /* @__PURE__ */ jsx(
1269
+ TextField,
1270
+ {
1271
+ label: f.address,
1272
+ value: block.address,
1273
+ onChange: (address) => set({ address })
1274
+ }
1275
+ ),
1276
+ /* @__PURE__ */ jsx(
1277
+ TextField,
1278
+ {
1279
+ label: f.phone,
1280
+ value: block.phone,
1281
+ onChange: (phone) => set({ phone })
1282
+ }
1283
+ ),
1284
+ /* @__PURE__ */ jsx(
1285
+ SwitchField,
1286
+ {
1287
+ label: f.showUnsubscribe,
1288
+ value: block.showUnsubscribe,
1289
+ onChange: (showUnsubscribe) => set({ showUnsubscribe })
1290
+ }
1291
+ ),
1292
+ block.showUnsubscribe && /* @__PURE__ */ jsx(
1293
+ TextField,
1294
+ {
1295
+ label: f.unsubscribeText,
1296
+ value: block.unsubscribeText,
1297
+ onChange: (unsubscribeText) => set({ unsubscribeText })
1298
+ }
1299
+ ),
1300
+ /* @__PURE__ */ jsx(
1301
+ TextField,
1302
+ {
1303
+ label: f.managePreferencesUrl,
1304
+ value: block.managePreferencesUrl,
1305
+ onChange: (managePreferencesUrl) => set({ managePreferencesUrl })
1306
+ }
1307
+ ),
1308
+ /* @__PURE__ */ jsx(
1309
+ TextField,
1310
+ {
1311
+ label: f.managePreferencesText,
1312
+ value: block.managePreferencesText,
1313
+ onChange: (managePreferencesText) => set({ managePreferencesText })
1314
+ }
1315
+ ),
1316
+ alignment(block.alignment, "center"),
1317
+ /* @__PURE__ */ jsx(
1318
+ ColorField,
1319
+ {
1320
+ label: f.color,
1321
+ value: block.color,
1322
+ onChange: (color) => set({ color })
1323
+ }
1324
+ )
1325
+ ] });
1326
+ case "quote":
1327
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1328
+ /* @__PURE__ */ jsx(
1329
+ TextField,
1330
+ {
1331
+ multiline: true,
1332
+ label: f.text,
1333
+ value: block.text,
1334
+ onChange: (text) => set({ text })
1335
+ }
1336
+ ),
1337
+ /* @__PURE__ */ jsx(
1338
+ TextField,
1339
+ {
1340
+ label: f.author,
1341
+ value: block.author,
1342
+ onChange: (author) => set({ author })
1343
+ }
1344
+ ),
1345
+ /* @__PURE__ */ jsx(
1346
+ TextField,
1347
+ {
1348
+ label: f.role,
1349
+ value: block.role,
1350
+ onChange: (role) => set({ role })
1351
+ }
1352
+ ),
1353
+ alignment(block.alignment, "left"),
1354
+ /* @__PURE__ */ jsx(
1355
+ ColorField,
1356
+ {
1357
+ label: f.backgroundColor,
1358
+ value: block.backgroundColor,
1359
+ onChange: (backgroundColor) => set({ backgroundColor })
1360
+ }
1361
+ ),
1362
+ /* @__PURE__ */ jsx(
1363
+ ColorField,
1364
+ {
1365
+ label: f.textColor,
1366
+ value: block.textColor,
1367
+ onChange: (textColor) => set({ textColor })
1368
+ }
1369
+ ),
1370
+ /* @__PURE__ */ jsx(
1371
+ ColorField,
1372
+ {
1373
+ label: f.accentColor,
1374
+ value: block.accentColor,
1375
+ fallback: design.linkColor,
1376
+ onChange: (accentColor) => set({ accentColor })
1377
+ }
1378
+ )
1379
+ ] });
1380
+ case "table": {
1381
+ const cols = Math.max(1, ...block.rows.map((r) => r.length));
1382
+ const setCell = (r, c, value) => set({
1383
+ rows: block.rows.map(
1384
+ (row, i) => i === r ? row.map((cell, j) => j === c ? value : cell) : row
1385
+ )
1386
+ });
1387
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1388
+ /* @__PURE__ */ jsx(
1389
+ SwitchField,
1390
+ {
1391
+ label: f.headerRow,
1392
+ value: block.headerRow,
1393
+ onChange: (headerRow) => set({ headerRow })
1394
+ }
1395
+ ),
1396
+ /* @__PURE__ */ jsx(
1397
+ "div",
1398
+ {
1399
+ className: "grid gap-1",
1400
+ style: { gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))` },
1401
+ children: block.rows.map(
1402
+ (row, r) => row.map((cell, c) => /* @__PURE__ */ jsx(
1403
+ "input",
1404
+ {
1405
+ "aria-label": f.cell.replace("{row}", String(r + 1)).replace("{column}", String(c + 1)),
1406
+ value: cell,
1407
+ onChange: (e) => setCell(r, c, e.target.value),
1408
+ className: "border-input bg-background text-foreground focus-visible:ring-ring h-8 min-w-0 rounded-md border px-2 text-sm focus-visible:ring-2 focus-visible:outline-none"
1409
+ },
1410
+ `${r}-${c}`
1411
+ ))
1412
+ )
1413
+ }
1414
+ ),
1415
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
1416
+ /* @__PURE__ */ jsx(
1417
+ Button2,
1418
+ {
1419
+ variant: "outline",
1420
+ size: "sm",
1421
+ onClick: () => set({ rows: [...block.rows, Array(cols).fill("")] }),
1422
+ children: f.addRow
1423
+ }
1424
+ ),
1425
+ /* @__PURE__ */ jsx(
1426
+ Button2,
1427
+ {
1428
+ variant: "outline",
1429
+ size: "sm",
1430
+ onClick: () => set({ rows: block.rows.map((r) => [...r, ""]) }),
1431
+ children: f.addColumn
1432
+ }
1433
+ ),
1434
+ /* @__PURE__ */ jsx(
1435
+ Button2,
1436
+ {
1437
+ variant: "ghost",
1438
+ size: "sm",
1439
+ disabled: block.rows.length <= 1,
1440
+ onClick: () => set({ rows: block.rows.slice(0, -1) }),
1441
+ children: f.removeRow
1442
+ }
1443
+ ),
1444
+ /* @__PURE__ */ jsx(
1445
+ Button2,
1446
+ {
1447
+ variant: "ghost",
1448
+ size: "sm",
1449
+ disabled: cols <= 1,
1450
+ onClick: () => set({ rows: block.rows.map((r) => r.slice(0, -1)) }),
1451
+ children: f.removeColumn
1452
+ }
1453
+ )
1454
+ ] }),
1455
+ alignment(block.alignment, "left"),
1456
+ /* @__PURE__ */ jsx(
1457
+ ColorField,
1458
+ {
1459
+ label: f.borderColor,
1460
+ value: block.borderColor,
1461
+ onChange: (borderColor) => set({ borderColor })
1462
+ }
1463
+ ),
1464
+ /* @__PURE__ */ jsx(
1465
+ ColorField,
1466
+ {
1467
+ label: f.headerBackgroundColor,
1468
+ value: block.headerBackgroundColor,
1469
+ onChange: (headerBackgroundColor) => set({ headerBackgroundColor })
1470
+ }
1471
+ ),
1472
+ /* @__PURE__ */ jsx(
1473
+ ColorField,
1474
+ {
1475
+ label: f.headerTextColor,
1476
+ value: block.headerTextColor,
1477
+ onChange: (headerTextColor) => set({ headerTextColor })
1478
+ }
1479
+ )
1480
+ ] });
1481
+ }
1482
+ case "hero":
1483
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1484
+ /* @__PURE__ */ jsx(
1485
+ TextField,
1486
+ {
1487
+ label: f.categoryText,
1488
+ value: block.categoryText,
1489
+ onChange: (categoryText) => set({ categoryText })
1490
+ }
1491
+ ),
1492
+ /* @__PURE__ */ jsx(
1493
+ TextField,
1494
+ {
1495
+ label: f.headline,
1496
+ value: block.headline,
1497
+ onChange: (headline) => set({ headline })
1498
+ }
1499
+ ),
1500
+ /* @__PURE__ */ jsx(
1501
+ TextField,
1502
+ {
1503
+ multiline: true,
1504
+ label: f.subtitle,
1505
+ value: block.subtitle,
1506
+ onChange: (subtitle) => set({ subtitle })
1507
+ }
1508
+ ),
1509
+ /* @__PURE__ */ jsx(
1510
+ TextField,
1511
+ {
1512
+ label: f.ctaText,
1513
+ value: block.ctaText,
1514
+ onChange: (ctaText) => set({ ctaText })
1515
+ }
1516
+ ),
1517
+ /* @__PURE__ */ jsx(
1518
+ TextField,
1519
+ {
1520
+ label: f.ctaUrl,
1521
+ value: block.ctaUrl,
1522
+ onChange: (ctaUrl) => set({ ctaUrl })
1523
+ }
1524
+ ),
1525
+ alignment(block.alignment, "center"),
1526
+ /* @__PURE__ */ jsx(
1527
+ ColorField,
1528
+ {
1529
+ label: f.backgroundColor,
1530
+ value: block.backgroundColor,
1531
+ onChange: (backgroundColor) => set({ backgroundColor })
1532
+ }
1533
+ ),
1534
+ /* @__PURE__ */ jsx(
1535
+ TextField,
1536
+ {
1537
+ label: f.backgroundGradient,
1538
+ value: block.backgroundGradient,
1539
+ placeholder: "linear-gradient(135deg, #1e3a5f, #2563eb)",
1540
+ onChange: (backgroundGradient) => set({ backgroundGradient })
1541
+ }
1542
+ ),
1543
+ /* @__PURE__ */ jsx(
1544
+ ColorField,
1545
+ {
1546
+ label: f.textColor,
1547
+ value: block.textColor,
1548
+ onChange: (textColor) => set({ textColor })
1549
+ }
1550
+ ),
1551
+ /* @__PURE__ */ jsx(
1552
+ ColorField,
1553
+ {
1554
+ label: f.ctaColor,
1555
+ value: block.ctaColor,
1556
+ onChange: (ctaColor) => set({ ctaColor })
1557
+ }
1558
+ ),
1559
+ /* @__PURE__ */ jsx(
1560
+ NumberField,
1561
+ {
1562
+ label: f.padding,
1563
+ value: block.padding,
1564
+ max: 200,
1565
+ onChange: (padding) => set({ padding })
1566
+ }
1567
+ )
1568
+ ] });
1569
+ case "columns":
1570
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1571
+ /* @__PURE__ */ jsx(
1572
+ SelectField,
1573
+ {
1574
+ label: f.columnCount,
1575
+ value: String(block.columnCount),
1576
+ options: ["1", "2", "3"].map((v) => ({
1577
+ value: v,
1578
+ label: v
1579
+ })),
1580
+ onChange: (v) => {
1581
+ const columnCount = Number(v);
1582
+ set({
1583
+ columnCount,
1584
+ columns: resizeColumns(block.columns, columnCount)
1585
+ });
1586
+ }
1587
+ }
1588
+ ),
1589
+ /* @__PURE__ */ jsx(
1590
+ ColorField,
1591
+ {
1592
+ label: f.backgroundColor,
1593
+ value: block.backgroundColor,
1594
+ onChange: (backgroundColor) => set({ backgroundColor })
1595
+ }
1596
+ ),
1597
+ block.columns.map((column, i) => /* @__PURE__ */ jsx(
1598
+ Select,
1599
+ {
1600
+ label: `${labels.addBlock} \u2014 ${labels.column} ${i + 1}`,
1601
+ placeholder: labels.addBlock,
1602
+ value: "",
1603
+ options: CONTENT_BLOCK_TYPES.map((type) => ({
1604
+ value: type,
1605
+ label: labels.blockTypes[type]
1606
+ })),
1607
+ onValueChange: (type) => onAddToColumn(
1608
+ i,
1609
+ createEmailBlock(
1610
+ type
1611
+ )
1612
+ )
1613
+ },
1614
+ column.id
1615
+ ))
1616
+ ] });
1617
+ }
1618
+ }
1619
+ var FONT_OPTIONS = [
1620
+ "Arial, Helvetica, sans-serif",
1621
+ "Helvetica, Arial, sans-serif",
1622
+ "Verdana, Geneva, sans-serif",
1623
+ "Tahoma, Geneva, sans-serif",
1624
+ "'Trebuchet MS', Helvetica, sans-serif",
1625
+ "Georgia, serif",
1626
+ "'Times New Roman', Times, serif",
1627
+ "'Courier New', Courier, monospace"
1628
+ ];
1629
+ function EmailDesignPanel({
1630
+ design,
1631
+ onChange,
1632
+ labels
1633
+ }) {
1634
+ const f = labels.fields;
1635
+ const fonts = FONT_OPTIONS.includes(design.fontFamily) ? FONT_OPTIONS : [design.fontFamily, ...FONT_OPTIONS];
1636
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1637
+ /* @__PURE__ */ jsx(
1638
+ SelectField,
1639
+ {
1640
+ label: f.fontFamily,
1641
+ value: design.fontFamily,
1642
+ options: fonts.map((font) => ({
1643
+ value: font,
1644
+ label: font.split(",")[0].replace(/'/g, "")
1645
+ })),
1646
+ onChange: (fontFamily) => onChange({ fontFamily })
1647
+ }
1648
+ ),
1649
+ /* @__PURE__ */ jsx(
1650
+ NumberField,
1651
+ {
1652
+ label: f.contentWidth,
1653
+ value: design.contentWidth,
1654
+ min: 320,
1655
+ max: 1200,
1656
+ onChange: (contentWidth) => onChange({ contentWidth })
1657
+ }
1658
+ ),
1659
+ [
1660
+ "bodyBackgroundColor",
1661
+ "contentBackgroundColor",
1662
+ "textColor",
1663
+ "headingColor",
1664
+ "linkColor",
1665
+ "buttonBackgroundColor",
1666
+ "buttonTextColor"
1667
+ ].map((key) => /* @__PURE__ */ jsx(
1668
+ ColorField,
1669
+ {
1670
+ label: f[key],
1671
+ value: design[key],
1672
+ onChange: (v) => onChange({ [key]: v })
1673
+ },
1674
+ key
1675
+ )),
1676
+ /* @__PURE__ */ jsx(
1677
+ NumberField,
1678
+ {
1679
+ label: f.buttonBorderRadius,
1680
+ value: design.buttonBorderRadius,
1681
+ max: 100,
1682
+ onChange: (buttonBorderRadius) => onChange({ buttonBorderRadius })
1683
+ }
1684
+ )
1685
+ ] });
1686
+ }
1687
+
1688
+ // src/components/EmailEditor/labels.ts
1689
+ var defaultEmailEditorLabels = {
1690
+ blocks: "Blocks",
1691
+ design: "Design",
1692
+ blockSettings: "Block settings",
1693
+ undo: "Undo",
1694
+ redo: "Redo",
1695
+ viewport: "Preview width",
1696
+ desktop: "Desktop",
1697
+ mobile: "Mobile",
1698
+ canvas: "Email canvas",
1699
+ moveUp: "Move up",
1700
+ moveDown: "Move down",
1701
+ duplicate: "Duplicate",
1702
+ remove: "Delete",
1703
+ dragHandle: "Drag to reorder",
1704
+ addBlock: "Add block",
1705
+ emptyCanvas: "Drag a block here, or click one in the palette.",
1706
+ emptyColumn: "Empty column",
1707
+ unsupportedBlock: "Unsupported block ({type}). It will not be included in the sent email.",
1708
+ noSelection: "Select a block in the canvas to edit it.",
1709
+ column: "Column",
1710
+ selectBlock: "Select {item}",
1711
+ announceAdded: "{item} added.",
1712
+ announceMoved: "{item} moved to position {position}.",
1713
+ announceDuplicated: "{item} duplicated.",
1714
+ announceRemoved: "{item} deleted.",
1715
+ blockTypes: {
1716
+ heading: "Heading",
1717
+ text: "Text",
1718
+ button: "Button",
1719
+ image: "Image",
1720
+ divider: "Divider",
1721
+ spacer: "Spacer",
1722
+ columns: "Columns",
1723
+ social: "Social links",
1724
+ hero: "Hero banner",
1725
+ html: "Custom HTML",
1726
+ footer: "Footer",
1727
+ quote: "Quote",
1728
+ table: "Table"
1729
+ },
1730
+ platforms: {
1731
+ facebook: "Facebook",
1732
+ twitter: "Twitter",
1733
+ linkedin: "LinkedIn",
1734
+ instagram: "Instagram",
1735
+ youtube: "YouTube",
1736
+ github: "GitHub",
1737
+ website: "Website"
1738
+ },
1739
+ fields: {
1740
+ text: "Text",
1741
+ content: "Content",
1742
+ level: "Level",
1743
+ alignment: "Alignment",
1744
+ color: "Color",
1745
+ textColor: "Text color",
1746
+ backgroundColor: "Background color",
1747
+ backgroundGradient: "Background gradient (CSS)",
1748
+ accentColor: "Accent color",
1749
+ url: "Link URL",
1750
+ borderRadius: "Corner radius (px)",
1751
+ fullWidth: "Full width",
1752
+ imageUrl: "Image URL",
1753
+ uploadImage: "Upload image",
1754
+ uploadFailed: "The image could not be uploaded. Try again.",
1755
+ altText: "Alt text",
1756
+ width: "Width (px or %)",
1757
+ style: "Style",
1758
+ height: "Height (px)",
1759
+ iconSize: "Icon size",
1760
+ platform: "Platform",
1761
+ socialLink: "Link {number}",
1762
+ addLink: "Add link",
1763
+ removeLink: "Remove link",
1764
+ html: "HTML",
1765
+ companyName: "Company name",
1766
+ address: "Address",
1767
+ phone: "Phone",
1768
+ showUnsubscribe: "Show unsubscribe link",
1769
+ unsubscribeText: "Unsubscribe text",
1770
+ managePreferencesUrl: "Preferences URL",
1771
+ managePreferencesText: "Preferences text",
1772
+ author: "Author",
1773
+ role: "Role",
1774
+ headerRow: "First row is a header",
1775
+ headerBackgroundColor: "Header background",
1776
+ headerTextColor: "Header text color",
1777
+ borderColor: "Border color",
1778
+ addRow: "Add row",
1779
+ addColumn: "Add column",
1780
+ removeRow: "Remove last row",
1781
+ removeColumn: "Remove last column",
1782
+ cell: "Row {row}, column {column}",
1783
+ categoryText: "Eyebrow",
1784
+ headline: "Headline",
1785
+ subtitle: "Subtitle",
1786
+ ctaText: "Button text",
1787
+ ctaUrl: "Button URL",
1788
+ ctaColor: "Button color",
1789
+ padding: "Vertical padding (px)",
1790
+ columnCount: "Columns",
1791
+ bodyBackgroundColor: "Page background",
1792
+ contentBackgroundColor: "Content background",
1793
+ contentWidth: "Content width (px)",
1794
+ fontFamily: "Font",
1795
+ headingColor: "Heading color",
1796
+ linkColor: "Link color",
1797
+ buttonBackgroundColor: "Button color",
1798
+ buttonTextColor: "Button text color",
1799
+ buttonBorderRadius: "Button corner radius (px)"
1800
+ },
1801
+ options: {
1802
+ left: "Left",
1803
+ center: "Center",
1804
+ right: "Right",
1805
+ solid: "Solid",
1806
+ dashed: "Dashed",
1807
+ dotted: "Dotted",
1808
+ sm: "Small",
1809
+ md: "Medium",
1810
+ lg: "Large"
1811
+ }
1812
+ };
1813
+ function mergeEmailEditorLabels(overrides) {
1814
+ if (!overrides) return defaultEmailEditorLabels;
1815
+ const d = defaultEmailEditorLabels;
1816
+ return {
1817
+ ...d,
1818
+ ...overrides,
1819
+ blockTypes: { ...d.blockTypes, ...overrides.blockTypes },
1820
+ platforms: { ...d.platforms, ...overrides.platforms },
1821
+ fields: { ...d.fields, ...overrides.fields },
1822
+ options: { ...d.options, ...overrides.options }
1823
+ };
1824
+ }
1825
+
1826
+ // src/components/EmailEditor/tree.ts
1827
+ function editContaining(blocks, id, edit) {
1828
+ const index = blocks.findIndex((b) => b.id === id);
1829
+ if (index !== -1) return edit(blocks, index);
1830
+ let changed = false;
1831
+ const next = blocks.map((block) => {
1832
+ if (block.type !== "columns") return block;
1833
+ let hit = false;
1834
+ const columns = block.columns.map((column) => {
1835
+ const inner = editContaining(column.blocks, id, edit);
1836
+ if (inner === column.blocks) return column;
1837
+ hit = changed = true;
1838
+ return { ...column, blocks: inner };
1839
+ });
1840
+ return hit ? { ...block, columns } : block;
1841
+ });
1842
+ return changed ? next : blocks;
1843
+ }
1844
+ function findEmailBlock(blocks, id) {
1845
+ if (!id) return void 0;
1846
+ for (const block of blocks) {
1847
+ if (block.id === id) return block;
1848
+ if (block.type === "columns") {
1849
+ for (const column of block.columns) {
1850
+ const found = findEmailBlock(column.blocks, id);
1851
+ if (found) return found;
1852
+ }
1853
+ }
1854
+ }
1855
+ return void 0;
1856
+ }
1857
+ function updateEmailBlock(blocks, id, patch) {
1858
+ return editContaining(
1859
+ blocks,
1860
+ id,
1861
+ (list, i) => list.map((b, j) => j === i ? { ...b, ...patch } : b)
1862
+ );
1863
+ }
1864
+ function removeEmailBlock(blocks, id) {
1865
+ return editContaining(
1866
+ blocks,
1867
+ id,
1868
+ (list, i) => list.filter((_, j) => j !== i)
1869
+ );
1870
+ }
1871
+ function moveEmailBlock(blocks, id, delta) {
1872
+ return editContaining(blocks, id, (list, i) => {
1873
+ const target = i + delta;
1874
+ if (target < 0 || target >= list.length) return list;
1875
+ const next = [...list];
1876
+ const [moved] = next.splice(i, 1);
1877
+ next.splice(target, 0, moved);
1878
+ return next;
1879
+ });
1880
+ }
1881
+ function cloneWithNewIds(block) {
1882
+ const copy = { ...block, id: generateEmailBlockId() };
1883
+ if (copy.type === "columns") {
1884
+ copy.columns = copy.columns.map((column) => ({
1885
+ ...column,
1886
+ id: generateEmailBlockId(),
1887
+ blocks: column.blocks.map(cloneWithNewIds)
1888
+ }));
1889
+ }
1890
+ return copy;
1891
+ }
1892
+ function duplicateEmailBlock(blocks, id) {
1893
+ let newId = null;
1894
+ const next = editContaining(blocks, id, (list, i) => {
1895
+ const copy = cloneWithNewIds(list[i]);
1896
+ newId = copy.id;
1897
+ return [...list.slice(0, i + 1), copy, ...list.slice(i + 1)];
1898
+ });
1899
+ return { blocks: next, newId };
1900
+ }
1901
+ function addBlockToColumn(blocks, columnsId, columnIndex, block) {
1902
+ return blocks.map(
1903
+ (b) => b.id === columnsId && b.type === "columns" ? {
1904
+ ...b,
1905
+ columns: b.columns.map(
1906
+ (column, i) => i === columnIndex ? { ...column, blocks: [...column.blocks, block] } : column
1907
+ )
1908
+ } : b
1909
+ );
1910
+ }
1911
+ var BLOCK_ICONS = {
1912
+ hero: Megaphone,
1913
+ columns: Columns2,
1914
+ heading: Heading,
1915
+ text: Type,
1916
+ button: MousePointerClick,
1917
+ image: Image,
1918
+ divider: Minus,
1919
+ spacer: MoveVertical,
1920
+ social: Share2,
1921
+ quote: Quote,
1922
+ table: Table,
1923
+ html: Code,
1924
+ footer: PanelBottom
1925
+ };
1926
+ var EMAIL_BLOCK_TYPES = Object.keys(BLOCK_ICONS);
1927
+ var PALETTE = "palette:";
1928
+ var CANVAS_END = "canvas:end";
1929
+ var MOBILE_WIDTH = 375;
1930
+ function fill(template, values) {
1931
+ return template.replace(
1932
+ /\{(\w+)\}/g,
1933
+ (_, key) => String(values[key] ?? "")
1934
+ );
1935
+ }
1936
+ function BlockFrame({
1937
+ block,
1938
+ selected,
1939
+ labels,
1940
+ onSelect,
1941
+ onMove,
1942
+ onDuplicate,
1943
+ onRemove,
1944
+ isFirst,
1945
+ isLast,
1946
+ dragHandle,
1947
+ children
1948
+ }) {
1949
+ const name = labels.blockTypes[block.type] ?? block.type;
1950
+ const tool = "text-muted-foreground hover:text-foreground h-7 w-7";
1951
+ const own = (action) => (e) => {
1952
+ e.stopPropagation();
1953
+ action();
1954
+ };
1955
+ return /* @__PURE__ */ jsxs(
1956
+ "div",
1957
+ {
1958
+ "data-slot": "email-editor-block",
1959
+ "data-selected": selected || void 0,
1960
+ className: cn(
1961
+ "relative outline-offset-[-2px]",
1962
+ selected ? "outline-primary-500 outline outline-2" : "hover:outline-primary-300 focus-within:outline-primary-300 focus-within:outline-1 focus-within:outline-dashed hover:outline-1 hover:outline-dashed"
1963
+ ),
1964
+ children: [
1965
+ /* @__PURE__ */ jsxs(
1966
+ "div",
1967
+ {
1968
+ "data-slot": "email-editor-block-toolbar",
1969
+ className: cn(
1970
+ "bg-background border-border absolute end-2 -top-3.5 z-10 flex items-center rounded-md border shadow-sm",
1971
+ // Reveal on hover of this frame only, not of a frame nested inside it.
1972
+ !selected && "opacity-0 focus-within:opacity-100 [[data-slot=email-editor-block]:hover:not(:has([data-slot=email-editor-block]:hover))>&]:opacity-100"
1973
+ ),
1974
+ children: [
1975
+ dragHandle,
1976
+ /* @__PURE__ */ jsx(
1977
+ "button",
1978
+ {
1979
+ type: "button",
1980
+ "aria-pressed": selected,
1981
+ "aria-label": fill(labels.selectBlock, { item: name }),
1982
+ onClick: own(onSelect),
1983
+ className: "text-foreground focus-visible:ring-ring rounded px-2 text-xs font-medium focus-visible:ring-2 focus-visible:outline-none",
1984
+ children: name
1985
+ }
1986
+ ),
1987
+ /* @__PURE__ */ jsx(
1988
+ Button2,
1989
+ {
1990
+ variant: "ghost",
1991
+ size: "icon",
1992
+ className: tool,
1993
+ "aria-label": labels.moveUp,
1994
+ disabled: isFirst,
1995
+ onClick: own(() => onMove(-1)),
1996
+ children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4", "aria-hidden": "true" })
1997
+ }
1998
+ ),
1999
+ /* @__PURE__ */ jsx(
2000
+ Button2,
2001
+ {
2002
+ variant: "ghost",
2003
+ size: "icon",
2004
+ className: tool,
2005
+ "aria-label": labels.moveDown,
2006
+ disabled: isLast,
2007
+ onClick: own(() => onMove(1)),
2008
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4", "aria-hidden": "true" })
2009
+ }
2010
+ ),
2011
+ /* @__PURE__ */ jsx(
2012
+ Button2,
2013
+ {
2014
+ variant: "ghost",
2015
+ size: "icon",
2016
+ className: tool,
2017
+ "aria-label": labels.duplicate,
2018
+ onClick: own(onDuplicate),
2019
+ children: /* @__PURE__ */ jsx(Copy, { className: "h-4 w-4", "aria-hidden": "true" })
2020
+ }
2021
+ ),
2022
+ /* @__PURE__ */ jsx(
2023
+ Button2,
2024
+ {
2025
+ variant: "ghost",
2026
+ size: "icon",
2027
+ className: cn(tool, "hover:text-destructive"),
2028
+ "aria-label": labels.remove,
2029
+ onClick: own(onRemove),
2030
+ children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })
2031
+ }
2032
+ )
2033
+ ]
2034
+ }
2035
+ ),
2036
+ /* @__PURE__ */ jsx(
2037
+ "div",
2038
+ {
2039
+ onClick: (e) => {
2040
+ e.stopPropagation();
2041
+ if (e.target.closest("a")) e.preventDefault();
2042
+ onSelect();
2043
+ },
2044
+ className: "cursor-pointer [&_a]:pointer-events-none",
2045
+ children
2046
+ }
2047
+ )
2048
+ ]
2049
+ }
2050
+ );
2051
+ }
2052
+ function SortableBlock({
2053
+ id,
2054
+ children
2055
+ }) {
2056
+ const {
2057
+ setNodeRef,
2058
+ setActivatorNodeRef,
2059
+ listeners,
2060
+ transform,
2061
+ transition,
2062
+ isDragging
2063
+ } = useSortable({ id });
2064
+ const handle = /* @__PURE__ */ jsx(
2065
+ "span",
2066
+ {
2067
+ ref: setActivatorNodeRef,
2068
+ ...listeners,
2069
+ "aria-hidden": "true",
2070
+ className: "text-muted-foreground flex h-7 w-6 cursor-grab touch-none items-center justify-center",
2071
+ children: /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" })
2072
+ }
2073
+ );
2074
+ return /* @__PURE__ */ jsx(
2075
+ "div",
2076
+ {
2077
+ ref: setNodeRef,
2078
+ style: { transform: CSS.Transform.toString(transform), transition },
2079
+ className: cn(isDragging && "relative z-20 opacity-60"),
2080
+ children: children(handle)
2081
+ }
2082
+ );
2083
+ }
2084
+ function PaletteItem({
2085
+ type,
2086
+ label,
2087
+ onAdd
2088
+ }) {
2089
+ const { setNodeRef, listeners } = useDraggable({ id: PALETTE + type });
2090
+ const Icon = BLOCK_ICONS[type];
2091
+ return /* @__PURE__ */ jsxs(
2092
+ "button",
2093
+ {
2094
+ ref: setNodeRef,
2095
+ type: "button",
2096
+ onPointerDown: listeners?.onPointerDown,
2097
+ onClick: onAdd,
2098
+ className: "border-border bg-background hover:bg-muted hover:border-primary-300 text-foreground focus-visible:ring-ring flex w-24 shrink-0 flex-col items-center gap-1 rounded-md border p-2 text-xs focus-visible:ring-2 focus-visible:outline-none lg:w-auto",
2099
+ children: [
2100
+ /* @__PURE__ */ jsx(Icon, { className: "text-muted-foreground h-5 w-5", "aria-hidden": "true" }),
2101
+ label
2102
+ ]
2103
+ }
2104
+ );
2105
+ }
2106
+ function CanvasEnd({ empty, label }) {
2107
+ const { setNodeRef, isOver } = useDroppable({ id: CANVAS_END });
2108
+ return /* @__PURE__ */ jsx(
2109
+ "div",
2110
+ {
2111
+ ref: setNodeRef,
2112
+ className: cn(
2113
+ "text-muted-foreground flex items-center justify-center text-center text-sm",
2114
+ empty ? "border-border m-4 min-h-32 rounded-md border-2 border-dashed p-6" : "min-h-8",
2115
+ isOver && "bg-primary-500/10"
2116
+ ),
2117
+ children: empty && label
2118
+ }
2119
+ );
2120
+ }
2121
+ var EmailEditor = React3.forwardRef(
2122
+ ({
2123
+ value,
2124
+ onChange,
2125
+ design: designProp,
2126
+ onDesignChange,
2127
+ mergeTags,
2128
+ blockTypes = EMAIL_BLOCK_TYPES,
2129
+ onUploadImage,
2130
+ labels: labelOverrides,
2131
+ className
2132
+ }, ref) => {
2133
+ const labels = React3.useMemo(
2134
+ () => mergeEmailEditorLabels(labelOverrides),
2135
+ [labelOverrides]
2136
+ );
2137
+ const design = React3.useMemo(
2138
+ () => normalizeDesignSettings(designProp),
2139
+ [designProp]
2140
+ );
2141
+ const [selectedId, setSelectedId] = React3.useState(null);
2142
+ const [viewport, setViewport] = React3.useState(
2143
+ "desktop"
2144
+ );
2145
+ const [dragging, setDragging] = React3.useState(null);
2146
+ const [past, setPast] = React3.useState([]);
2147
+ const [future, setFuture] = React3.useState([]);
2148
+ const [announcement, announce] = useLiveAnnouncement();
2149
+ const variableGroups = React3.useMemo(() => {
2150
+ if (!mergeTags?.length) return void 0;
2151
+ const groups = /* @__PURE__ */ new Map();
2152
+ for (const tag of mergeTags) {
2153
+ const group = groups.get(tag.group) ?? {
2154
+ label: tag.group,
2155
+ variables: []
2156
+ };
2157
+ group.variables.push({ label: tag.label, value: tag.token });
2158
+ groups.set(tag.group, group);
2159
+ }
2160
+ return [...groups.values()];
2161
+ }, [mergeTags]);
2162
+ const latest = React3.useRef({ value, designProp, onChange });
2163
+ React3.useEffect(() => {
2164
+ latest.current = { value, designProp, onChange };
2165
+ });
2166
+ const present = (changed) => ({
2167
+ tree: value,
2168
+ design: designProp,
2169
+ changed
2170
+ });
2171
+ const commit = (tree, nextDesign) => {
2172
+ const current = latest.current;
2173
+ const changed = {
2174
+ tree: tree !== current.value,
2175
+ design: Boolean(nextDesign)
2176
+ };
2177
+ if (!changed.tree && !changed.design) return;
2178
+ setPast((p) => [
2179
+ ...p.slice(-49),
2180
+ { tree: current.value, design: current.designProp, changed }
2181
+ ]);
2182
+ setFuture([]);
2183
+ if (changed.tree) current.onChange(tree);
2184
+ if (nextDesign) onDesignChange?.(nextDesign);
2185
+ };
2186
+ const setBlocks = (blocks) => commit({ ...value, blocks });
2187
+ const patchBlock = (id, patch) => {
2188
+ const doc = latest.current.value;
2189
+ if (!findEmailBlock(doc.blocks, id)) return;
2190
+ commit({ ...doc, blocks: updateEmailBlock(doc.blocks, id, patch) });
2191
+ };
2192
+ const restore = (snapshot) => {
2193
+ if (snapshot.changed.tree) onChange(snapshot.tree);
2194
+ if (snapshot.changed.design) onDesignChange?.(snapshot.design ?? {});
2195
+ };
2196
+ const undo = () => {
2197
+ const previous = past[past.length - 1];
2198
+ if (!previous) return;
2199
+ setPast((p) => p.slice(0, -1));
2200
+ setFuture((f) => [present(previous.changed), ...f]);
2201
+ restore(previous);
2202
+ };
2203
+ const redo = () => {
2204
+ const next = future[0];
2205
+ if (!next) return;
2206
+ setFuture((f) => f.slice(1));
2207
+ setPast((p) => [...p, present(next.changed)]);
2208
+ restore(next);
2209
+ };
2210
+ const nameOf = (type) => labels.blockTypes[type] ?? type;
2211
+ const insertBlock = (type, index) => {
2212
+ const block = createEmailBlock(type);
2213
+ const blocks = [...value.blocks];
2214
+ const selectedIndex = blocks.findIndex(
2215
+ (b) => Boolean(findEmailBlock([b], selectedId))
2216
+ );
2217
+ const at = index ?? (selectedIndex === -1 ? blocks.length : selectedIndex + 1);
2218
+ blocks.splice(at, 0, block);
2219
+ setBlocks(blocks);
2220
+ setSelectedId(block.id);
2221
+ announce(fill(labels.announceAdded, { item: nameOf(type) }));
2222
+ };
2223
+ const selected = findEmailBlock(value.blocks, selectedId);
2224
+ const frameProps = (block, siblings, index) => ({
2225
+ block,
2226
+ labels,
2227
+ selected: block.id === selectedId,
2228
+ isFirst: index === 0,
2229
+ isLast: index === siblings.length - 1,
2230
+ onSelect: () => setSelectedId(block.id),
2231
+ onMove: (delta) => {
2232
+ setBlocks(moveEmailBlock(value.blocks, block.id, delta));
2233
+ announce(
2234
+ fill(labels.announceMoved, {
2235
+ item: nameOf(block.type),
2236
+ position: index + 1 + delta
2237
+ })
2238
+ );
2239
+ },
2240
+ onDuplicate: () => {
2241
+ const { blocks, newId } = duplicateEmailBlock(value.blocks, block.id);
2242
+ setBlocks(blocks);
2243
+ setSelectedId(newId);
2244
+ announce(fill(labels.announceDuplicated, { item: nameOf(block.type) }));
2245
+ },
2246
+ onRemove: () => {
2247
+ setBlocks(removeEmailBlock(value.blocks, block.id));
2248
+ if (findEmailBlock([block], selectedId)) setSelectedId(null);
2249
+ announce(fill(labels.announceRemoved, { item: nameOf(block.type) }));
2250
+ }
2251
+ });
2252
+ const renderPreview = (block) => /* @__PURE__ */ jsx(
2253
+ EmailBlockPreview,
2254
+ {
2255
+ block,
2256
+ design,
2257
+ emptyColumnLabel: labels.emptyColumn,
2258
+ unsupportedBlockLabel: labels.unsupportedBlock,
2259
+ platformLabels: labels.platforms,
2260
+ renderChild: (child) => {
2261
+ const column = block.type === "columns" ? block.columns.find(
2262
+ (c) => c.blocks.some((b) => b.id === child.id)
2263
+ ) : void 0;
2264
+ const siblings = column?.blocks ?? [];
2265
+ return /* @__PURE__ */ jsx(
2266
+ BlockFrame,
2267
+ {
2268
+ ...frameProps(child, siblings, siblings.indexOf(child)),
2269
+ children: renderPreview(child)
2270
+ }
2271
+ );
2272
+ }
2273
+ }
2274
+ );
2275
+ const sensors = useSensors(
2276
+ useSensor(PointerSensor, { activationConstraint: { distance: 5 } })
2277
+ );
2278
+ const onDragStart = (event) => setDragging(String(event.active.id));
2279
+ const onDragEnd = ({ active, over }) => {
2280
+ setDragging(null);
2281
+ if (!over) return;
2282
+ const activeId = String(active.id);
2283
+ const overId = String(over.id);
2284
+ const overIndex = value.blocks.findIndex((b) => b.id === overId);
2285
+ if (activeId.startsWith(PALETTE)) {
2286
+ insertBlock(
2287
+ activeId.slice(PALETTE.length),
2288
+ overIndex === -1 ? value.blocks.length : overIndex
2289
+ );
2290
+ return;
2291
+ }
2292
+ const from = value.blocks.findIndex((b) => b.id === activeId);
2293
+ const to = overId === CANVAS_END ? value.blocks.length - 1 : overIndex;
2294
+ if (from === -1 || to === -1 || from === to) return;
2295
+ setBlocks(arrayMove(value.blocks, from, to));
2296
+ announce(
2297
+ fill(labels.announceMoved, {
2298
+ item: nameOf(value.blocks[from].type),
2299
+ position: to + 1
2300
+ })
2301
+ );
2302
+ };
2303
+ const onKeyDown = (event) => {
2304
+ const target = event.target;
2305
+ if (target.closest('input, textarea, select, [contenteditable="true"]'))
2306
+ return;
2307
+ if (!(event.metaKey || event.ctrlKey) || event.key.toLowerCase() !== "z")
2308
+ return;
2309
+ event.preventDefault();
2310
+ if (event.shiftKey) redo();
2311
+ else undo();
2312
+ };
2313
+ const draggingType = dragging?.startsWith(PALETTE) ? dragging.slice(PALETTE.length) : value.blocks.find((b) => b.id === dragging)?.type ?? null;
2314
+ const panel = "border-border bg-background flex min-h-0 flex-col";
2315
+ const panelBody = "flex flex-col gap-3 overflow-y-auto p-4";
2316
+ return /* @__PURE__ */ jsxs(
2317
+ DndContext,
2318
+ {
2319
+ sensors,
2320
+ collisionDetection: closestCenter,
2321
+ onDragStart,
2322
+ onDragEnd,
2323
+ onDragCancel: () => setDragging(null),
2324
+ children: [
2325
+ /* @__PURE__ */ jsxs(
2326
+ "div",
2327
+ {
2328
+ ref,
2329
+ "data-slot": "email-editor",
2330
+ onKeyDown,
2331
+ className: cn(
2332
+ "border-border bg-muted/30 text-foreground flex min-h-[640px] flex-col overflow-hidden rounded-lg border lg:flex-row",
2333
+ className
2334
+ ),
2335
+ children: [
2336
+ /* @__PURE__ */ jsx(
2337
+ "aside",
2338
+ {
2339
+ "data-slot": "email-editor-palette",
2340
+ className: cn(panel, "border-b lg:w-64 lg:border-e lg:border-b-0"),
2341
+ children: /* @__PURE__ */ jsxs(
2342
+ Tabs,
2343
+ {
2344
+ defaultValue: "blocks",
2345
+ className: "flex min-h-0 flex-1 flex-col",
2346
+ children: [
2347
+ /* @__PURE__ */ jsxs(TabsList, { className: "px-2", children: [
2348
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "blocks", children: labels.blocks }),
2349
+ onDesignChange && /* @__PURE__ */ jsx(TabsTrigger, { value: "design", children: labels.design })
2350
+ ] }),
2351
+ /* @__PURE__ */ jsx(TabsContent, { value: "blocks", className: "overflow-y-auto p-3", children: /* @__PURE__ */ jsx(
2352
+ "div",
2353
+ {
2354
+ className: "flex gap-2 overflow-x-auto pb-1 lg:grid lg:grid-cols-2 lg:overflow-visible lg:pb-0",
2355
+ "aria-label": labels.addBlock,
2356
+ role: "group",
2357
+ children: blockTypes.map((type) => /* @__PURE__ */ jsx(
2358
+ PaletteItem,
2359
+ {
2360
+ type,
2361
+ label: nameOf(type),
2362
+ onAdd: () => insertBlock(type)
2363
+ },
2364
+ type
2365
+ ))
2366
+ }
2367
+ ) }),
2368
+ onDesignChange && /* @__PURE__ */ jsx(TabsContent, { value: "design", className: panelBody, children: /* @__PURE__ */ jsx(
2369
+ EmailDesignPanel,
2370
+ {
2371
+ design: resolveDesignSettings(designProp),
2372
+ labels,
2373
+ onChange: (patch) => commit(value, { ...designProp, ...patch })
2374
+ }
2375
+ ) })
2376
+ ]
2377
+ }
2378
+ )
2379
+ }
2380
+ ),
2381
+ /* @__PURE__ */ jsxs(
2382
+ "section",
2383
+ {
2384
+ "data-slot": "email-editor-canvas",
2385
+ "aria-label": labels.canvas,
2386
+ className: "flex min-w-0 flex-1 flex-col",
2387
+ children: [
2388
+ /* @__PURE__ */ jsxs("div", { className: "border-border bg-background flex items-center gap-1 border-b px-3 py-2", children: [
2389
+ /* @__PURE__ */ jsx(
2390
+ Button2,
2391
+ {
2392
+ variant: "ghost",
2393
+ size: "icon",
2394
+ "aria-label": labels.undo,
2395
+ title: labels.undo,
2396
+ disabled: !past.length,
2397
+ onClick: undo,
2398
+ children: /* @__PURE__ */ jsx(Undo2, { className: "h-4 w-4", "aria-hidden": "true" })
2399
+ }
2400
+ ),
2401
+ /* @__PURE__ */ jsx(
2402
+ Button2,
2403
+ {
2404
+ variant: "ghost",
2405
+ size: "icon",
2406
+ "aria-label": labels.redo,
2407
+ title: labels.redo,
2408
+ disabled: !future.length,
2409
+ onClick: redo,
2410
+ children: /* @__PURE__ */ jsx(Redo2, { className: "h-4 w-4", "aria-hidden": "true" })
2411
+ }
2412
+ ),
2413
+ /* @__PURE__ */ jsx(
2414
+ "div",
2415
+ {
2416
+ role: "group",
2417
+ "aria-label": labels.viewport,
2418
+ className: "ms-auto flex gap-1",
2419
+ children: [
2420
+ ["desktop", Monitor, labels.desktop],
2421
+ ["mobile", Smartphone, labels.mobile]
2422
+ ].map(([mode, Icon, label]) => /* @__PURE__ */ jsx(
2423
+ Button2,
2424
+ {
2425
+ variant: viewport === mode ? "secondary" : "ghost",
2426
+ size: "icon",
2427
+ "aria-label": label,
2428
+ title: label,
2429
+ "aria-pressed": viewport === mode,
2430
+ onClick: () => setViewport(mode),
2431
+ children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4", "aria-hidden": "true" })
2432
+ },
2433
+ mode
2434
+ ))
2435
+ }
2436
+ )
2437
+ ] }),
2438
+ /* @__PURE__ */ jsx(
2439
+ "div",
2440
+ {
2441
+ className: "flex-1 overflow-auto px-2 py-8 sm:px-6",
2442
+ style: { background: design.bodyBackgroundColor },
2443
+ onClick: (e) => e.target === e.currentTarget && setSelectedId(null),
2444
+ children: /* @__PURE__ */ jsxs(
2445
+ "div",
2446
+ {
2447
+ dir: "ltr",
2448
+ className: "mx-auto shadow-sm transition-[width]",
2449
+ style: {
2450
+ width: viewport === "mobile" ? MOBILE_WIDTH : design.contentWidth,
2451
+ maxWidth: "100%",
2452
+ background: design.contentBackgroundColor,
2453
+ color: design.textColor,
2454
+ fontFamily: design.fontFamily,
2455
+ fontSize: 16,
2456
+ lineHeight: 1.6
2457
+ },
2458
+ children: [
2459
+ /* @__PURE__ */ jsx(
2460
+ SortableContext,
2461
+ {
2462
+ items: value.blocks.map((b) => b.id),
2463
+ strategy: verticalListSortingStrategy,
2464
+ children: value.blocks.map((block, index) => /* @__PURE__ */ jsx(SortableBlock, { id: block.id, children: (handle) => /* @__PURE__ */ jsx(
2465
+ BlockFrame,
2466
+ {
2467
+ ...frameProps(block, value.blocks, index),
2468
+ dragHandle: handle,
2469
+ children: renderPreview(block)
2470
+ }
2471
+ ) }, block.id))
2472
+ }
2473
+ ),
2474
+ /* @__PURE__ */ jsx(
2475
+ CanvasEnd,
2476
+ {
2477
+ empty: !value.blocks.length,
2478
+ label: labels.emptyCanvas
2479
+ }
2480
+ )
2481
+ ]
2482
+ }
2483
+ )
2484
+ }
2485
+ )
2486
+ ]
2487
+ }
2488
+ ),
2489
+ /* @__PURE__ */ jsxs(
2490
+ "aside",
2491
+ {
2492
+ "data-slot": "email-editor-settings",
2493
+ "aria-label": labels.blockSettings,
2494
+ className: cn(panel, "border-t lg:w-80 lg:border-s lg:border-t-0"),
2495
+ children: [
2496
+ /* @__PURE__ */ jsx("h2", { className: "border-border border-b px-4 py-3 text-sm font-semibold", children: selected ? nameOf(selected.type) : labels.blockSettings }),
2497
+ /* @__PURE__ */ jsx("div", { className: panelBody, children: selected ? /* @__PURE__ */ jsx(
2498
+ EmailBlockSettings,
2499
+ {
2500
+ block: selected,
2501
+ design,
2502
+ labels,
2503
+ variableGroups,
2504
+ onUploadImage,
2505
+ onChange: (patch) => patchBlock(selected.id, patch),
2506
+ onAddToColumn: (columnIndex, block) => {
2507
+ setBlocks(
2508
+ addBlockToColumn(
2509
+ value.blocks,
2510
+ selected.id,
2511
+ columnIndex,
2512
+ block
2513
+ )
2514
+ );
2515
+ setSelectedId(block.id);
2516
+ announce(
2517
+ fill(labels.announceAdded, { item: nameOf(block.type) })
2518
+ );
2519
+ }
2520
+ },
2521
+ selected.id
2522
+ ) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: labels.noSelection }) })
2523
+ ]
2524
+ }
2525
+ ),
2526
+ /* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "sr-only", children: announcement })
2527
+ ]
2528
+ }
2529
+ ),
2530
+ /* @__PURE__ */ jsx(DragOverlay, { dropAnimation: null, children: draggingType && dragging?.startsWith(PALETTE) ? /* @__PURE__ */ jsx("div", { className: "bg-background border-primary-500 text-foreground rounded-md border px-3 py-2 text-xs font-medium shadow-lg", children: nameOf(draggingType) }) : null })
2531
+ ]
2532
+ }
2533
+ );
2534
+ }
2535
+ );
2536
+ EmailEditor.displayName = "EmailEditor";
2537
+
2538
+ export { EMAIL_BLOCK_TYPES, EmailEditor, createDefaultDesignSettings, createEmailBlock, createEmailHtmlSanitizer, createEmptyEmailContentTree, defaultEmailEditorLabels, generateEmailBlockId, renderEmailMjml };
2539
+ //# sourceMappingURL=chunk-LUPRGPKP.js.map
2540
+ //# sourceMappingURL=chunk-LUPRGPKP.js.map