@mhmo91/schmancy 0.4.67 → 0.4.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/textarea.md +128 -43
- package/dist/ai/textarea.md +128 -43
- package/dist/{animated-text-Bgciqenw.cjs → animated-text-Bm1G50ol.cjs} +2 -2
- package/dist/{animated-text-Bgciqenw.cjs.map → animated-text-Bm1G50ol.cjs.map} +1 -1
- package/dist/{animated-text-BnE_bSQh.js → animated-text-DhaihRNU.js} +3 -3
- package/dist/{animated-text-BnE_bSQh.js.map → animated-text-DhaihRNU.js.map} +1 -1
- package/dist/animated-text.cjs +1 -1
- package/dist/animated-text.js +1 -1
- package/dist/area.cjs +1 -1
- package/dist/{area.component-4Xj6grAn.js → area.component-Cybfl9fo.js} +10 -10
- package/dist/{area.component-4Xj6grAn.js.map → area.component-Cybfl9fo.js.map} +1 -1
- package/dist/{area.component-jRAVAvAI.cjs → area.component-e7ccHmOi.cjs} +2 -2
- package/dist/{area.component-jRAVAvAI.cjs.map → area.component-e7ccHmOi.cjs.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-CdizrMKV.js → autocomplete-CHPr_eII.js} +3 -3
- package/dist/{autocomplete-CdizrMKV.js.map → autocomplete-CHPr_eII.js.map} +1 -1
- package/dist/{autocomplete-G8K-mb5t.cjs → autocomplete-DhRURo6G.cjs} +2 -2
- package/dist/{autocomplete-G8K-mb5t.cjs.map → autocomplete-DhRURo6G.cjs.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/{avatar-BSGuwqy5.js → avatar-B3rxuPbq.js} +62 -61
- package/dist/{avatar-BSGuwqy5.js.map → avatar-B3rxuPbq.js.map} +1 -1
- package/dist/{avatar-DdQOlXAG.cjs → avatar-BREyQJqy.cjs} +2 -2
- package/dist/{avatar-DdQOlXAG.cjs.map → avatar-BREyQJqy.cjs.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{boat-rC0ERLqn.js → boat-Ch2Dn8n_.js} +2 -2
- package/dist/{boat-rC0ERLqn.js.map → boat-Ch2Dn8n_.js.map} +1 -1
- package/dist/{boat-CA8Wc6Hd.cjs → boat-IQenN8zy.cjs} +2 -2
- package/dist/{boat-CA8Wc6Hd.cjs.map → boat-IQenN8zy.cjs.map} +1 -1
- package/dist/boat.cjs +1 -1
- package/dist/boat.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-xHdrDdwF.js → checkbox-DTtOgNWH.js} +2 -2
- package/dist/{checkbox-xHdrDdwF.js.map → checkbox-DTtOgNWH.js.map} +1 -1
- package/dist/{checkbox-DeYOFxaq.cjs → checkbox-EV_8e4Q9.cjs} +2 -2
- package/dist/{checkbox-DeYOFxaq.cjs.map → checkbox-EV_8e4Q9.cjs.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-DuCD124M.cjs → chips-D9bYHkvu.cjs} +2 -2
- package/dist/{chips-DuCD124M.cjs.map → chips-D9bYHkvu.cjs.map} +1 -1
- package/dist/{chips-Cd1wXy3x.js → chips-xlNsY8Dl.js} +3 -3
- package/dist/{chips-Cd1wXy3x.js.map → chips-xlNsY8Dl.js.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +1 -1
- package/dist/code-highlight.cjs +1 -1
- package/dist/code-highlight.js +1 -1
- package/dist/{code-preview-C2z91M9H.cjs → code-preview-CC_QZwlB.cjs} +2 -2
- package/dist/{code-preview-C2z91M9H.cjs.map → code-preview-CC_QZwlB.cjs.map} +1 -1
- package/dist/{code-preview-BjdXVACE.js → code-preview-Dy4fNmOI.js} +2 -2
- package/dist/{code-preview-BjdXVACE.js.map → code-preview-Dy4fNmOI.js.map} +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{date-range-BS3TwBp1.js → date-range-CEhn7Gvg.js} +4 -4
- package/dist/{date-range-BS3TwBp1.js.map → date-range-CEhn7Gvg.js.map} +1 -1
- package/dist/{date-range-BfIiLrUu.cjs → date-range-XTs2K2Rp.cjs} +2 -2
- package/dist/{date-range-BfIiLrUu.cjs.map → date-range-XTs2K2Rp.cjs.map} +1 -1
- package/dist/{date-range-inline-BEfwxm4K.cjs → date-range-inline-BW6v6aDq.cjs} +2 -2
- package/dist/{date-range-inline-BEfwxm4K.cjs.map → date-range-inline-BW6v6aDq.cjs.map} +1 -1
- package/dist/{date-range-inline-zda6EO9f.js → date-range-inline-D-F8YwDL.js} +3 -3
- package/dist/{date-range-inline-zda6EO9f.js.map → date-range-inline-D-F8YwDL.js.map} +1 -1
- package/dist/date-range-inline.cjs +1 -1
- package/dist/date-range-inline.js +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-BJ-Ce2HT.cjs → delay-BYwpzSYY.cjs} +2 -2
- package/dist/{delay-BJ-Ce2HT.cjs.map → delay-BYwpzSYY.cjs.map} +1 -1
- package/dist/{delay-5re8EU0Q.js → delay-CqcMq7V3.js} +12 -12
- package/dist/{delay-5re8EU0Q.js.map → delay-CqcMq7V3.js.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{details-BeuCI3Tb.cjs → details-C9Vr2c8F.cjs} +2 -2
- package/dist/{details-BeuCI3Tb.cjs.map → details-C9Vr2c8F.cjs.map} +1 -1
- package/dist/{details-BBYG4_kG.js → details-gxjy3noS.js} +2 -2
- package/dist/{details-BBYG4_kG.js.map → details-gxjy3noS.js.map} +1 -1
- package/dist/details.cjs +1 -1
- package/dist/details.js +1 -1
- package/dist/{dialog-content-BHrlCw_t.js → dialog-content-CJ21oAff.js} +4 -4
- package/dist/{dialog-content-BHrlCw_t.js.map → dialog-content-CJ21oAff.js.map} +1 -1
- package/dist/{dialog-content-BYpfUBG3.cjs → dialog-content-DfXB0r6A.cjs} +2 -2
- package/dist/{dialog-content-BYpfUBG3.cjs.map → dialog-content-DfXB0r6A.cjs.map} +1 -1
- package/dist/dialog-service-ClZa-7cE.cjs +2 -0
- package/dist/dialog-service-ClZa-7cE.cjs.map +1 -0
- package/dist/dialog-service-Dwnyl4Gg.js +141 -0
- package/dist/dialog-service-Dwnyl4Gg.js.map +1 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +2 -2
- package/dist/{divider-B0LQxG1L.js → divider-Dw3OYKoH.js} +3 -3
- package/dist/{divider-B0LQxG1L.js.map → divider-Dw3OYKoH.js.map} +1 -1
- package/dist/{divider-Qgqzg8Od.cjs → divider-ZX6UG8fE.cjs} +2 -2
- package/dist/{divider-Qgqzg8Od.cjs.map → divider-ZX6UG8fE.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{dropdown-content-Bh7Uek2_.js → dropdown-content-QWlP1OxV.js} +3 -3
- package/dist/{dropdown-content-Bh7Uek2_.js.map → dropdown-content-QWlP1OxV.js.map} +1 -1
- package/dist/{dropdown-content-B0T9NcP0.cjs → dropdown-content-ULdb1NeW.cjs} +2 -2
- package/dist/{dropdown-content-B0T9NcP0.cjs.map → dropdown-content-ULdb1NeW.cjs.map} +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/email-recipients-DQ36ickQ.js +1358 -0
- package/dist/email-recipients-DQ36ickQ.js.map +1 -0
- package/dist/email-recipients-H9HVkFvE.cjs +851 -0
- package/dist/email-recipients-H9HVkFvE.cjs.map +1 -0
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-wnw8ri9G.js → flex-Cam0G_h7.js} +2 -2
- package/dist/{flex-wnw8ri9G.js.map → flex-Cam0G_h7.js.map} +1 -1
- package/dist/{flex-Cciddlkr.cjs → flex-DEiJ9fDk.cjs} +2 -2
- package/dist/{flex-Cciddlkr.cjs.map → flex-DEiJ9fDk.cjs.map} +1 -1
- package/dist/{form-LhR76UQp.cjs → form-B87v130C.cjs} +2 -2
- package/dist/{form-LhR76UQp.cjs.map → form-B87v130C.cjs.map} +1 -1
- package/dist/{form-Cd1Z72nI.js → form-EPO5N6pI.js} +2 -2
- package/dist/{form-Cd1Z72nI.js.map → form-EPO5N6pI.js.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{formField.mixin-D67_ge3i.js → formField.mixin-B6XjIwKN.js} +2 -2
- package/dist/{formField.mixin-D67_ge3i.js.map → formField.mixin-B6XjIwKN.js.map} +1 -1
- package/dist/{formField.mixin-Dbrz3WX3.cjs → formField.mixin-Dpx2Zk8-.cjs} +2 -2
- package/dist/{formField.mixin-Dbrz3WX3.cjs.map → formField.mixin-Dpx2Zk8-.cjs.map} +1 -1
- package/dist/{icon--ULeGfN_.js → icon-C6CXTo3Z.js} +2 -2
- package/dist/{icon--ULeGfN_.js.map → icon-C6CXTo3Z.js.map} +1 -1
- package/dist/{icon-CZ3mMGdX.cjs → icon-MrlToWLJ.cjs} +2 -2
- package/dist/{icon-CZ3mMGdX.cjs.map → icon-MrlToWLJ.cjs.map} +1 -1
- package/dist/{icon-button-BXMUskpY.cjs → icon-button-BwAStx3H.cjs} +2 -2
- package/dist/{icon-button-BXMUskpY.cjs.map → icon-button-BwAStx3H.cjs.map} +1 -1
- package/dist/{icon-button-PxCZVq78.js → icon-button-Csj8jwj8.js} +3 -3
- package/dist/{icon-button-PxCZVq78.js.map → icon-button-Csj8jwj8.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +171 -165
- package/dist/index.js.map +1 -1
- package/dist/{input-D3cF4qal.js → input-B9PDbNB9.js} +3 -3
- package/dist/{input-D3cF4qal.js.map → input-B9PDbNB9.js.map} +1 -1
- package/dist/{input-DxUZYu34.cjs → input-D4L413yG.cjs} +2 -2
- package/dist/{input-DxUZYu34.cjs.map → input-D4L413yG.cjs.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/{list-BiiXBLxU.js → list-Cdd7ht2E.js} +2 -2
- package/dist/{list-BiiXBLxU.js.map → list-Cdd7ht2E.js.map} +1 -1
- package/dist/{list-nLrSaYiQ.cjs → list-DLUbjS69.cjs} +2 -2
- package/dist/{list-nLrSaYiQ.cjs.map → list-DLUbjS69.cjs.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-C7_rhUMZ.js → litElement.mixin-BYVS1wwl.js} +2 -2
- package/dist/{litElement.mixin-C7_rhUMZ.js.map → litElement.mixin-BYVS1wwl.js.map} +1 -1
- package/dist/{litElement.mixin-PLxdthiY.cjs → litElement.mixin-CbFQ2uxn.cjs} +2 -2
- package/dist/{litElement.mixin-PLxdthiY.cjs.map → litElement.mixin-CbFQ2uxn.cjs.map} +1 -1
- package/dist/mailbox.cjs +2 -0
- package/dist/mailbox.cjs.map +1 -0
- package/dist/mailbox.js +9 -0
- package/dist/mailbox.js.map +1 -0
- package/dist/{map-2DO-_UXg.js → map-DmjQ1Izx.js} +2 -2
- package/dist/{map-2DO-_UXg.js.map → map-DmjQ1Izx.js.map} +1 -1
- package/dist/{map-D_75VnFg.cjs → map-DxUajvGo.cjs} +2 -2
- package/dist/{map-D_75VnFg.cjs.map → map-DxUajvGo.cjs.map} +1 -1
- package/dist/map.cjs +1 -1
- package/dist/map.js +1 -1
- package/dist/{media-CdRUD9xD.cjs → media-DCIVM-cE.cjs} +2 -2
- package/dist/{media-CdRUD9xD.cjs.map → media-DCIVM-cE.cjs.map} +1 -1
- package/dist/{media-D1TDtKlB.js → media-DPurU9FS.js} +2 -2
- package/dist/{media-D1TDtKlB.js.map → media-DPurU9FS.js.map} +1 -1
- package/dist/{menu-9xXJweN3.cjs → menu-CIObvZ7n.cjs} +2 -2
- package/dist/{menu-9xXJweN3.cjs.map → menu-CIObvZ7n.cjs.map} +1 -1
- package/dist/{menu-B06dErqi.js → menu-CwRGjbC-.js} +3 -3
- package/dist/{menu-B06dErqi.js.map → menu-CwRGjbC-.js.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/netlify.toml +366 -0
- package/dist/{notification-service-DklXKZwa.cjs → notification-service-BMnjQVrQ.cjs} +2 -2
- package/dist/{notification-service-DklXKZwa.cjs.map → notification-service-BMnjQVrQ.cjs.map} +1 -1
- package/dist/{notification-service-BfUKN9-l.js → notification-service-DypTYarw.js} +4 -4
- package/dist/{notification-service-BfUKN9-l.js.map → notification-service-DypTYarw.js.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +2 -2
- package/dist/{notify-D2k-BxXf.cjs → notify-CqCSy8Ek.cjs} +2 -2
- package/dist/{notify-D2k-BxXf.cjs.map → notify-CqCSy8Ek.cjs.map} +1 -1
- package/dist/{notify-BMbySVQI.js → notify-DUMaApt7.js} +2 -2
- package/dist/{notify-BMbySVQI.js.map → notify-DUMaApt7.js.map} +1 -1
- package/dist/{option-CXQpOQBl.cjs → option-BuN5MSy7.cjs} +2 -2
- package/dist/{option-CXQpOQBl.cjs.map → option-BuN5MSy7.cjs.map} +1 -1
- package/dist/{option-BS4qufvu.js → option-CvjLp3CB.js} +2 -2
- package/dist/{option-BS4qufvu.js.map → option-CvjLp3CB.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-CYT-w3-T.cjs → payment-card-form-C9VN_H07.cjs} +2 -2
- package/dist/{payment-card-form-CYT-w3-T.cjs.map → payment-card-form-C9VN_H07.cjs.map} +1 -1
- package/dist/{payment-card-form-Dj2YF8_1.js → payment-card-form-CFDdmSH2.js} +3 -3
- package/dist/{payment-card-form-Dj2YF8_1.js.map → payment-card-form-CFDdmSH2.js.map} +1 -1
- package/dist/{progress-J9tCvn5j.js → progress-BeOOCcPN.js} +2 -2
- package/dist/{progress-J9tCvn5j.js.map → progress-BeOOCcPN.js.map} +1 -1
- package/dist/{progress-DfFxDR56.cjs → progress-C-6ieScw.cjs} +2 -2
- package/dist/{progress-DfFxDR56.cjs.map → progress-C-6ieScw.cjs.map} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-button-CKUtPC82.cjs → radio-button-Bi4ywYhW.cjs} +2 -2
- package/dist/{radio-button-CKUtPC82.cjs.map → radio-button-Bi4ywYhW.cjs.map} +1 -1
- package/dist/{radio-button-BxGi5VfV.js → radio-button-D6zvMVQb.js} +3 -3
- package/dist/{radio-button-BxGi5VfV.js.map → radio-button-D6zvMVQb.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{schmancy-steps-container-BFeVc0lq.js → schmancy-steps-container-CfDatUf8.js} +2 -2
- package/dist/{schmancy-steps-container-BFeVc0lq.js.map → schmancy-steps-container-CfDatUf8.js.map} +1 -1
- package/dist/{schmancy-steps-container-DoN92rxe.cjs → schmancy-steps-container-i8rqaPet.cjs} +2 -2
- package/dist/{schmancy-steps-container-DoN92rxe.cjs.map → schmancy-steps-container-i8rqaPet.cjs.map} +1 -1
- package/dist/{select-C426DSrs.cjs → select-BPkJhj-o.cjs} +2 -2
- package/dist/{select-C426DSrs.cjs.map → select-BPkJhj-o.cjs.map} +1 -1
- package/dist/{select-BWQJus8Q.js → select-X7b74OI8.js} +3 -3
- package/dist/{select-BWQJus8Q.js.map → select-X7b74OI8.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{sheet-4oJm8fkG.cjs → sheet-BBT4JQ3Z.cjs} +2 -2
- package/dist/{sheet-4oJm8fkG.cjs.map → sheet-BBT4JQ3Z.cjs.map} +1 -1
- package/dist/{sheet-CD8QHsiF.js → sheet-DvCIJGFo.js} +4 -4
- package/dist/{sheet-CD8QHsiF.js.map → sheet-DvCIJGFo.js.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-Dexp5Nxu.cjs → slider-DWO4L_qC.cjs} +2 -2
- package/dist/{slider-Dexp5Nxu.cjs.map → slider-DWO4L_qC.cjs.map} +1 -1
- package/dist/{slider-Cfy-71n8.js → slider-py-bz6Vv.js} +3 -3
- package/dist/{slider-Cfy-71n8.js.map → slider-py-bz6Vv.js.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-CFBJounC.js → spinner-DpmMO5_E.js} +2 -2
- package/dist/{spinner-CFBJounC.js.map → spinner-DpmMO5_E.js.map} +1 -1
- package/dist/{spinner-Cj8PYiDt.cjs → spinner-Dv1WJaIf.cjs} +2 -2
- package/dist/{spinner-Cj8PYiDt.cjs.map → spinner-Dv1WJaIf.cjs.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/{surface-DfnuU19H.cjs → surface-Bn4-n1lT.cjs} +2 -2
- package/dist/{surface-DfnuU19H.cjs.map → surface-Bn4-n1lT.cjs.map} +1 -1
- package/dist/{surface-CwbyjcPh.js → surface-CFNIITaq.js} +2 -2
- package/dist/{surface-CwbyjcPh.js.map → surface-CFNIITaq.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-Bs4s_UXJ.cjs → table-A_oEWQzm.cjs} +2 -2
- package/dist/{table-Bs4s_UXJ.cjs.map → table-A_oEWQzm.cjs.map} +1 -1
- package/dist/{table-DKcZiidt.js → table-DNUpAcQk.js} +2 -2
- package/dist/{table-DKcZiidt.js.map → table-DNUpAcQk.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-compatibility-CGLNEqTc.js → tabs-compatibility-Bxoz71f7.js} +2 -2
- package/dist/{tabs-compatibility-CGLNEqTc.js.map → tabs-compatibility-Bxoz71f7.js.map} +1 -1
- package/dist/{tabs-compatibility-BNmTv9gA.cjs → tabs-compatibility-DNVqDoQh.cjs} +2 -2
- package/dist/{tabs-compatibility-BNmTv9gA.cjs.map → tabs-compatibility-DNVqDoQh.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-BU9fMdfc.cjs +2 -0
- package/dist/{tailwind.mixin-8-I14rPu.cjs.map → tailwind.mixin-BU9fMdfc.cjs.map} +1 -1
- package/dist/tailwind.mixin-Bpgmqass.js +43 -0
- package/dist/{tailwind.mixin-Bvelb8bX.js.map → tailwind.mixin-Bpgmqass.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/textarea-BE5TqYmx.js +131 -0
- package/dist/textarea-BE5TqYmx.js.map +1 -0
- package/dist/textarea-DTlpsJ-V.cjs +44 -0
- package/dist/textarea-DTlpsJ-V.cjs.map +1 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-C0HcsMoz.js → theme-button-BsojGTM7.js} +2 -2
- package/dist/{theme-button-C0HcsMoz.js.map → theme-button-BsojGTM7.js.map} +1 -1
- package/dist/{theme-button-BVdmrvuO.cjs → theme-button-DG8sPYM-.cjs} +2 -2
- package/dist/{theme-button-BVdmrvuO.cjs.map → theme-button-DG8sPYM-.cjs.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/{theme.component-C5vE2dqN.js → theme.component-BG4oCMuV.js} +4 -4
- package/dist/{theme.component-C5vE2dqN.js.map → theme.component-BG4oCMuV.js.map} +1 -1
- package/dist/{theme.component-B70iwARu.cjs → theme.component-D7TpDD6q.cjs} +3 -3
- package/dist/{theme.component-B70iwARu.cjs.map → theme.component-D7TpDD6q.cjs.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-B-nHxpsM.js → timezone-DtsS7reI.js} +3 -3
- package/dist/{timezone-B-nHxpsM.js.map → timezone-DtsS7reI.js.map} +1 -1
- package/dist/{timezone-C9aeURj9.cjs → timezone-dc6VVlU0.cjs} +2 -2
- package/dist/{timezone-C9aeURj9.cjs.map → timezone-dc6VVlU0.cjs.map} +1 -1
- package/dist/{tooltip-DGcANl1x.js → tooltip-C5C8KN_9.js} +2 -2
- package/dist/{tooltip-DGcANl1x.js.map → tooltip-C5C8KN_9.js.map} +1 -1
- package/dist/{tooltip-DLT2gEm_.cjs → tooltip-CA2yHZN6.cjs} +2 -2
- package/dist/{tooltip-DLT2gEm_.cjs.map → tooltip-CA2yHZN6.cjs.map} +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-OqQirABn.cjs → tree-D7CAcAHa.cjs} +2 -2
- package/dist/{tree-OqQirABn.cjs.map → tree-D7CAcAHa.cjs.map} +1 -1
- package/dist/{tree-Bp3kM_9E.js → tree-jBMmDqPl.js} +2 -2
- package/dist/{tree-Bp3kM_9E.js.map → tree-jBMmDqPl.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-BxVFLdsv.cjs → typewriter-BMfjokvJ.cjs} +2 -2
- package/dist/{typewriter-BxVFLdsv.cjs.map → typewriter-BMfjokvJ.cjs.map} +1 -1
- package/dist/{typewriter-vjeXbFlZ.js → typewriter-DDgmwo1Z.js} +7 -7
- package/dist/{typewriter-vjeXbFlZ.js.map → typewriter-DDgmwo1Z.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-Deoe8ty2.cjs → typography-CeAzj0Al.cjs} +2 -2
- package/dist/{typography-Deoe8ty2.cjs.map → typography-CeAzj0Al.cjs.map} +1 -1
- package/dist/{typography-DvwRgRtf.js → typography-D0JH1nwp.js} +2 -2
- package/dist/{typography-DvwRgRtf.js.map → typography-D0JH1nwp.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +1 -1
- package/types/src/index.d.ts +1 -0
- package/types/src/mailbox/email-editor.d.ts +103 -0
- package/types/src/mailbox/email-layout-selector.d.ts +19 -0
- package/types/src/mailbox/email-recipients.d.ts +118 -0
- package/types/src/mailbox/email-viewer.d.ts +86 -0
- package/types/src/mailbox/index.d.ts +12 -0
- package/types/src/mailbox/mailbox.d.ts +82 -0
- package/types/src/mailbox/types.d.ts +174 -0
- package/types/src/textarea/textarea.d.ts +24 -0
- package/dist/dialog-service-C8W7JHTQ.cjs +0 -2
- package/dist/dialog-service-C8W7JHTQ.cjs.map +0 -1
- package/dist/dialog-service-CQ6UYq9I.js +0 -135
- package/dist/dialog-service-CQ6UYq9I.js.map +0 -1
- package/dist/tailwind.mixin-8-I14rPu.cjs +0 -2
- package/dist/tailwind.mixin-Bvelb8bX.js +0 -43
- package/dist/textarea-Cdl89jnK.cjs +0 -42
- package/dist/textarea-Cdl89jnK.cjs.map +0 -1
- package/dist/textarea-DU0mANOS.js +0 -126
- package/dist/textarea-DU0mANOS.js.map +0 -1
|
@@ -0,0 +1,1358 @@
|
|
|
1
|
+
import "rxjs";
|
|
2
|
+
import "lit/directives/class-map.js";
|
|
3
|
+
import "lit/directives/style-map.js";
|
|
4
|
+
import { $ as E } from "./litElement.mixin-BYVS1wwl.js";
|
|
5
|
+
import { T } from "./tailwind.mixin-Bpgmqass.js";
|
|
6
|
+
import { property as h, state as u, customElement as k } from "lit/decorators.js";
|
|
7
|
+
import { css as A, html as l } from "lit";
|
|
8
|
+
import { when as m } from "lit/directives/when.js";
|
|
9
|
+
import { createRef as R, ref as C } from "lit/directives/ref.js";
|
|
10
|
+
import { repeat as I } from "lit/directives/repeat.js";
|
|
11
|
+
import { $ as v } from "./notification-service-DypTYarw.js";
|
|
12
|
+
import "./dialog-content-CJ21oAff.js";
|
|
13
|
+
import { $ as D } from "./dialog-service-Dwnyl4Gg.js";
|
|
14
|
+
var j = Object.defineProperty, L = Object.getOwnPropertyDescriptor, y = (e, t, i, s) => {
|
|
15
|
+
for (var a, n = s > 1 ? void 0 : s ? L(t, i) : t, c = e.length - 1; c >= 0; c--) (a = e[c]) && (n = (s ? a(t, i, n) : a(n)) || n);
|
|
16
|
+
return s && n && j(t, i, n), n;
|
|
17
|
+
};
|
|
18
|
+
let p = class extends E(A`
|
|
19
|
+
:host {
|
|
20
|
+
display: block;
|
|
21
|
+
height: 100%;
|
|
22
|
+
}
|
|
23
|
+
`) {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments), this.config = {}, this.templates = [], this.importSources = [], this.disabled = !1, this.recipientsTitle = "Recipients", this.recipientsEmptyTitle = "No recipients yet", this.recipientsEmptyMessage = "Import from sources or upload a CSV", this.enableCsvImport = !0, this.enableDragDrop = !0, this.recipients = [], this.selectedRecipients = [], this.subject = "", this.body = "", this.templateId = null, this.attachments = [], this.isSending = !1, this.handleEmailsImported = (e) => {
|
|
26
|
+
const { emails: t } = e.detail, i = [.../* @__PURE__ */ new Set([...this.recipients, ...t])], s = t.filter((a) => !this.recipients.includes(a));
|
|
27
|
+
this.recipients = i, this.selectedRecipients = [.../* @__PURE__ */ new Set([...this.selectedRecipients, ...s])], this.dispatchEvent(new CustomEvent("emails-imported", { detail: { emails: s, source: e.detail.source }, bubbles: !0, composed: !0 }));
|
|
28
|
+
}, this.handleRecipientRemoved = (e) => {
|
|
29
|
+
const { email: t } = e.detail;
|
|
30
|
+
this.recipients = this.recipients.filter((i) => i !== t), this.selectedRecipients = this.selectedRecipients.filter((i) => i !== t), this.dispatchEvent(new CustomEvent("recipient-removed", { detail: { email: t }, bubbles: !0, composed: !0 }));
|
|
31
|
+
}, this.handleRecipientsCleared = () => {
|
|
32
|
+
this.recipients = [], this.selectedRecipients = [], this.dispatchEvent(new CustomEvent("recipients-cleared", { bubbles: !0, composed: !0 }));
|
|
33
|
+
}, this.handleSelectionChanged = (e) => {
|
|
34
|
+
const { selectedEmails: t } = e.detail;
|
|
35
|
+
this.selectedRecipients = t, this.dispatchEvent(new CustomEvent("selection-changed", { detail: { selectedEmails: t }, bubbles: !0, composed: !0 }));
|
|
36
|
+
}, this.handleEditorChange = (e) => {
|
|
37
|
+
const { subject: t, body: i, templateId: s, attachments: a } = e.detail;
|
|
38
|
+
this.subject = t, this.body = i, this.templateId = s, this.attachments = a, this.dispatchEvent(new CustomEvent("compose-changed", { detail: { subject: t, body: i, templateId: s, attachments: a }, bubbles: !0, composed: !0 }));
|
|
39
|
+
}, this.handleSend = async () => {
|
|
40
|
+
if (this.selectedRecipients.length !== 0) if (this.subject.trim()) if (this.body.trim()) {
|
|
41
|
+
this.isSending = !0;
|
|
42
|
+
try {
|
|
43
|
+
const e = { recipients: this.selectedRecipients, subject: this.subject, body: this.body, attachments: this.attachments, templateId: this.templateId };
|
|
44
|
+
this.dispatchEvent(new CustomEvent("send-email", { detail: { request: e }, bubbles: !0, composed: !0 }));
|
|
45
|
+
} catch (e) {
|
|
46
|
+
this.dispatchEvent(new CustomEvent("send-error", { detail: { error: e instanceof Error ? e.message : "Failed to send email" }, bubbles: !0, composed: !0 }));
|
|
47
|
+
} finally {
|
|
48
|
+
this.isSending = !1;
|
|
49
|
+
}
|
|
50
|
+
} else this.dispatchEvent(new CustomEvent("send-error", { detail: { error: "Please enter a message body" }, bubbles: !0, composed: !0 }));
|
|
51
|
+
else this.dispatchEvent(new CustomEvent("send-error", { detail: { error: "Please enter a subject" }, bubbles: !0, composed: !0 }));
|
|
52
|
+
else this.dispatchEvent(new CustomEvent("send-error", { detail: { error: "Please select at least one recipient" }, bubbles: !0, composed: !0 }));
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
super.connectedCallback(), this.setSending(this.disabled);
|
|
57
|
+
}
|
|
58
|
+
updated(e) {
|
|
59
|
+
super.updated(e), e.has("disabled") && this.setSending(this.disabled);
|
|
60
|
+
}
|
|
61
|
+
addRecipients(e) {
|
|
62
|
+
const t = [.../* @__PURE__ */ new Set([...this.recipients, ...e])], i = e.filter((s) => !this.recipients.includes(s));
|
|
63
|
+
this.recipients = t, this.selectedRecipients = [.../* @__PURE__ */ new Set([...this.selectedRecipients, ...i])];
|
|
64
|
+
}
|
|
65
|
+
setSubject(e) {
|
|
66
|
+
this.subject = e;
|
|
67
|
+
}
|
|
68
|
+
setBody(e) {
|
|
69
|
+
this.body = e;
|
|
70
|
+
}
|
|
71
|
+
setTemplate(e) {
|
|
72
|
+
this.templateId = e;
|
|
73
|
+
}
|
|
74
|
+
clearCompose() {
|
|
75
|
+
this.recipients = [], this.selectedRecipients = [], this.subject = "", this.body = "", this.templateId = null, this.attachments = [];
|
|
76
|
+
}
|
|
77
|
+
setSending(e) {
|
|
78
|
+
this.isSending = e;
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
const e = this.selectedRecipients.length > 0 && this.subject.trim() && this.body.trim() && !this.isSending && !this.disabled;
|
|
82
|
+
return l`
|
|
83
|
+
<!-- Main Layout Container -->
|
|
84
|
+
<div class="flex flex-col h-full gap-6 p-6">
|
|
85
|
+
|
|
86
|
+
<!-- Main Content Section: Composer and Preview -->
|
|
87
|
+
<div class="flex flex-col xl:flex-row gap-6 flex-1 min-h-0">
|
|
88
|
+
|
|
89
|
+
<!-- Composer Section - Full width on mobile/tablet, half on large screens -->
|
|
90
|
+
<div class="w-full xl:w-1/2 min-h-0 flex flex-col">
|
|
91
|
+
<schmancy-email-editor
|
|
92
|
+
.subject=${this.subject}
|
|
93
|
+
.body=${this.body}
|
|
94
|
+
.templates=${this.templates}
|
|
95
|
+
.attachments=${this.attachments}
|
|
96
|
+
.disabled=${this.disabled}
|
|
97
|
+
.config=${this.config}
|
|
98
|
+
@editor-change=${this.handleEditorChange}
|
|
99
|
+
class="h-full"
|
|
100
|
+
></schmancy-email-editor>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<!-- Preview Section - Full width on mobile/tablet, half on large screens -->
|
|
104
|
+
<div class="w-full xl:w-1/2 min-h-0 flex flex-col">
|
|
105
|
+
<schmancy-email-viewer
|
|
106
|
+
.subject=${this.subject}
|
|
107
|
+
.body=${this.body}
|
|
108
|
+
.recipients=${this.selectedRecipients}
|
|
109
|
+
.attachments=${this.attachments}
|
|
110
|
+
class="h-full"
|
|
111
|
+
></schmancy-email-viewer>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<!-- Send Section - Sticky bottom bar -->
|
|
117
|
+
<div class="flex-shrink-0">
|
|
118
|
+
<schmancy-surface
|
|
119
|
+
type="container"
|
|
120
|
+
rounded="all"
|
|
121
|
+
class="p-4"
|
|
122
|
+
>
|
|
123
|
+
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
124
|
+
<!-- Send Info -->
|
|
125
|
+
<div class="flex flex-col gap-1">
|
|
126
|
+
<schmancy-typography type="body" token="sm" class="font-medium">
|
|
127
|
+
${this.selectedRecipients.length} recipient${this.selectedRecipients.length === 1 ? "" : "s"} selected
|
|
128
|
+
</schmancy-typography>
|
|
129
|
+
${m(this.attachments.length > 0, () => l`
|
|
130
|
+
<schmancy-typography type="body" token="xs">
|
|
131
|
+
${this.attachments.length} attachment${this.attachments.length === 1 ? "" : "s"}
|
|
132
|
+
</schmancy-typography>
|
|
133
|
+
`)}
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<!-- Send Button -->
|
|
137
|
+
<schmancy-button
|
|
138
|
+
variant="filled"
|
|
139
|
+
?disabled=${!e}
|
|
140
|
+
?loading=${this.isSending}
|
|
141
|
+
@click=${this.handleSend}
|
|
142
|
+
class="w-full sm:w-auto"
|
|
143
|
+
>
|
|
144
|
+
<schmancy-icon slot="prefix" size="18px">send</schmancy-icon>
|
|
145
|
+
${this.isSending ? "Sending..." : "Send Email"}
|
|
146
|
+
</schmancy-button>
|
|
147
|
+
</div>
|
|
148
|
+
</schmancy-surface>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<!-- Recipients Panel as Floating Boat -->
|
|
154
|
+
<schmancy-email-recipients
|
|
155
|
+
.recipients=${this.recipients}
|
|
156
|
+
.selectedRecipients=${this.selectedRecipients}
|
|
157
|
+
.importSources=${this.importSources}
|
|
158
|
+
.disabled=${this.disabled}
|
|
159
|
+
.enableCsvImport=${this.enableCsvImport}
|
|
160
|
+
.enableDragDrop=${this.enableDragDrop}
|
|
161
|
+
.title=${this.recipientsTitle}
|
|
162
|
+
.emptyStateTitle=${this.recipientsEmptyTitle}
|
|
163
|
+
.emptyStateMessage=${this.recipientsEmptyMessage}
|
|
164
|
+
@emails-imported=${this.handleEmailsImported}
|
|
165
|
+
@recipient-removed=${this.handleRecipientRemoved}
|
|
166
|
+
@recipients-cleared=${this.handleRecipientsCleared}
|
|
167
|
+
@selection-changed=${this.handleSelectionChanged}
|
|
168
|
+
></schmancy-email-recipients>
|
|
169
|
+
`;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
y([h({ type: Object })], p.prototype, "config", 2), y([h({ type: Array })], p.prototype, "templates", 2), y([h({ type: Array })], p.prototype, "importSources", 2), y([h({ type: Boolean })], p.prototype, "disabled", 2), y([h({ type: String })], p.prototype, "recipientsTitle", 2), y([h({ type: String })], p.prototype, "recipientsEmptyTitle", 2), y([h({ type: String })], p.prototype, "recipientsEmptyMessage", 2), y([h({ type: Boolean })], p.prototype, "enableCsvImport", 2), y([h({ type: Boolean })], p.prototype, "enableDragDrop", 2), y([u()], p.prototype, "recipients", 2), y([u()], p.prototype, "selectedRecipients", 2), y([u()], p.prototype, "subject", 2), y([u()], p.prototype, "body", 2), y([u()], p.prototype, "templateId", 2), y([u()], p.prototype, "attachments", 2), y([u()], p.prototype, "isSending", 2), p = y([k("schmancy-mailbox")], p);
|
|
173
|
+
var M = Object.getOwnPropertyDescriptor;
|
|
174
|
+
let z = class extends T() {
|
|
175
|
+
constructor() {
|
|
176
|
+
super(...arguments), this.layouts = [{ id: "columns-2", icon: "view_week", label: "2 Col" }, { id: "columns-3", icon: "view_column", label: "3 Col" }, { id: "sidebar-left", icon: "view_sidebar", label: "Left" }, { id: "sidebar-right", icon: "view_sidebar", label: "Right", flipped: !0 }, { id: "image-row", icon: "collections", label: "Images" }];
|
|
177
|
+
}
|
|
178
|
+
selectLayout(e) {
|
|
179
|
+
this.dispatchEvent(new CustomEvent("layout-select", { detail: { layout: e }, bubbles: !0, composed: !0 }));
|
|
180
|
+
}
|
|
181
|
+
render() {
|
|
182
|
+
return l`
|
|
183
|
+
<div class="grid p-3 gap-2">
|
|
184
|
+
${this.layouts.map((e) => l`
|
|
185
|
+
<schmancy-button
|
|
186
|
+
variant="outlined"
|
|
187
|
+
@click=${() => this.selectLayout(e.id)}
|
|
188
|
+
>
|
|
189
|
+
<schmancy-icon
|
|
190
|
+
slot="prefix"
|
|
191
|
+
size="20px"
|
|
192
|
+
class=${e.flipped ? "scale-x-[-1]" : ""}
|
|
193
|
+
>
|
|
194
|
+
${e.icon}
|
|
195
|
+
</schmancy-icon>
|
|
196
|
+
${e.label}
|
|
197
|
+
</schmancy-button>
|
|
198
|
+
`)}
|
|
199
|
+
</div>
|
|
200
|
+
`;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
z = ((e, t, i, s) => {
|
|
204
|
+
for (var a, n = s > 1 ? void 0 : s ? M(t, i) : t, c = e.length - 1; c >= 0; c--) (a = e[c]) && (n = a(n) || n);
|
|
205
|
+
return n;
|
|
206
|
+
})([k("schmancy-email-layout-selector")], z);
|
|
207
|
+
var F = Object.defineProperty, B = Object.getOwnPropertyDescriptor, x = (e, t, i, s) => {
|
|
208
|
+
for (var a, n = s > 1 ? void 0 : s ? B(t, i) : t, c = e.length - 1; c >= 0; c--) (a = e[c]) && (n = (s ? a(t, i, n) : a(n)) || n);
|
|
209
|
+
return s && n && F(t, i, n), n;
|
|
210
|
+
};
|
|
211
|
+
let b = class extends E(A`
|
|
212
|
+
:host {
|
|
213
|
+
display: block;
|
|
214
|
+
height: 100%;
|
|
215
|
+
}
|
|
216
|
+
`) {
|
|
217
|
+
constructor() {
|
|
218
|
+
super(...arguments), this.subject = "", this.body = "", this.templates = [], this.disabled = !1, this.attachments = [], this.config = {}, this.selectedTemplate = null, this.dragOver = !1, this.isUploading = !1, this.subjectInputRef = R(), this.bodyTextAreaRef = R(), this.fileInputRef = R(), this.imageInputRef = R(), this.handleKeyDown = (e) => {
|
|
219
|
+
if (this.disabled) return;
|
|
220
|
+
const t = this.bodyTextAreaRef.value?.shadowRoot?.querySelector("textarea");
|
|
221
|
+
e.key === "Tab" && e.target === t && (e.preventDefault(), this.insertAtCursor(" "));
|
|
222
|
+
}, this.handlePaste = (e) => {
|
|
223
|
+
const t = this.bodyTextAreaRef.value?.shadowRoot?.querySelector("textarea");
|
|
224
|
+
if (this.disabled || document.activeElement !== t) return;
|
|
225
|
+
const i = e.clipboardData?.items;
|
|
226
|
+
if (i) for (let s = 0; s < i.length; s++) {
|
|
227
|
+
const a = i[s];
|
|
228
|
+
if (a.type.indexOf("image") !== -1) {
|
|
229
|
+
e.preventDefault();
|
|
230
|
+
const n = a.getAsFile();
|
|
231
|
+
n && this.uploadImage(n);
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}, this.handleSubjectChange = (e) => {
|
|
236
|
+
const t = e.target;
|
|
237
|
+
this.subject = t.value, this.dispatchChange();
|
|
238
|
+
}, this.handleBodyChange = (e) => {
|
|
239
|
+
this.body = e.detail.value, this.dispatchChange();
|
|
240
|
+
}, this.selectTemplate = (e) => {
|
|
241
|
+
const t = this.templates.find((i) => i.id === e);
|
|
242
|
+
t && (this.subject = t.subject, this.body = t.body, this.selectedTemplate = e, this.dispatchChange());
|
|
243
|
+
}, this.clearTemplate = () => {
|
|
244
|
+
this.subject = "", this.body = "", this.selectedTemplate = null, this.dispatchChange();
|
|
245
|
+
}, this.dispatchChange = () => {
|
|
246
|
+
this.dispatchEvent(new CustomEvent("editor-change", { detail: { subject: this.subject, body: this.body, templateId: this.selectedTemplate, attachments: this.attachments }, bubbles: !0, composed: !0 }));
|
|
247
|
+
}, this.openLayoutDialog = () => {
|
|
248
|
+
D.component(l`
|
|
249
|
+
<schmancy-email-layout-selector
|
|
250
|
+
@layout-select=${(e) => {
|
|
251
|
+
this.applyLayout(e.detail.layout), D.close();
|
|
252
|
+
}}
|
|
253
|
+
></schmancy-email-layout-selector>
|
|
254
|
+
`);
|
|
255
|
+
}, this.applyLayout = (e) => {
|
|
256
|
+
const t = { "columns-2": `
|
|
257
|
+
:::layout columns-2
|
|
258
|
+
<div class="column">
|
|
259
|
+
{height=300px}
|
|
260
|
+
|
|
261
|
+
**Photo Title**
|
|
262
|
+
|
|
263
|
+
Replace the placeholder image above with your own photo. The height=300px ensures both images have equal height while width adjusts automatically.
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
<div class="column">
|
|
267
|
+
{height=300px}
|
|
268
|
+
|
|
269
|
+
**Photo Title**
|
|
270
|
+
|
|
271
|
+
Use the same height value (300px) for both images to keep them aligned perfectly side by side.
|
|
272
|
+
</div>
|
|
273
|
+
:::
|
|
274
|
+
`, "columns-3": `
|
|
275
|
+
:::layout columns-3
|
|
276
|
+
<div class="column">
|
|
277
|
+
{height=200px}
|
|
278
|
+
|
|
279
|
+
**Item Title**
|
|
280
|
+
|
|
281
|
+
Brief description or caption for this item.
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
<div class="column">
|
|
285
|
+
{height=200px}
|
|
286
|
+
|
|
287
|
+
**Item Title**
|
|
288
|
+
|
|
289
|
+
Brief description or caption for this item.
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
<div class="column">
|
|
293
|
+
{height=200px}
|
|
294
|
+
|
|
295
|
+
**Item Title**
|
|
296
|
+
|
|
297
|
+
Brief description or caption for this item.
|
|
298
|
+
</div>
|
|
299
|
+
:::
|
|
300
|
+
`, "sidebar-left": `
|
|
301
|
+
:::layout sidebar-left
|
|
302
|
+
<div class="sidebar">
|
|
303
|
+
**Sidebar Content**
|
|
304
|
+
|
|
305
|
+
* Navigation item 1
|
|
306
|
+
* Navigation item 2
|
|
307
|
+
* Navigation item 3
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<div class="main">
|
|
311
|
+
**Main Content Area**
|
|
312
|
+
|
|
313
|
+
Your primary content goes here. This area takes up most of the width while the sidebar provides supplementary information or navigation.
|
|
314
|
+
</div>
|
|
315
|
+
:::
|
|
316
|
+
`, "sidebar-right": `
|
|
317
|
+
:::layout sidebar-right
|
|
318
|
+
<div class="main">
|
|
319
|
+
**Main Content Area**
|
|
320
|
+
|
|
321
|
+
Your primary content goes here. This area takes up most of the width while the sidebar provides supplementary information or navigation.
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
<div class="sidebar">
|
|
325
|
+
**Sidebar Content**
|
|
326
|
+
|
|
327
|
+
* Quick links
|
|
328
|
+
* Related info
|
|
329
|
+
* Contact details
|
|
330
|
+
</div>
|
|
331
|
+
:::
|
|
332
|
+
`, "image-row": `
|
|
333
|
+
:::layout image-row
|
|
334
|
+
<div class="image">
|
|
335
|
+
{height=250px}
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
<div class="image">
|
|
339
|
+
{height=250px}
|
|
340
|
+
</div>
|
|
341
|
+
|
|
342
|
+
<div class="image">
|
|
343
|
+
{height=250px}
|
|
344
|
+
</div>
|
|
345
|
+
:::
|
|
346
|
+
` }[e];
|
|
347
|
+
t && this.insertAtCursor(t);
|
|
348
|
+
}, this.uploadImage = async (e) => {
|
|
349
|
+
if (!e.type.startsWith("image/")) return void v.error(`File "${e.name}" is not an image`);
|
|
350
|
+
if (e.size > 10485760) v.error(`Image "${e.name}" is too large. Maximum size is 10MB.`);
|
|
351
|
+
else {
|
|
352
|
+
this.isUploading = !0;
|
|
353
|
+
try {
|
|
354
|
+
let t;
|
|
355
|
+
this.config.imageUploadHandler ? t = await this.config.imageUploadHandler(e) : this.config.uploadHandler ? t = await this.config.uploadHandler(e) : (t = await this.createDataUrl(e), v.warning("No upload handler configured. Using local preview."));
|
|
356
|
+
const i = await this.getImageDimensions(e);
|
|
357
|
+
this.insertImageMarkdown(t, e.name, i.width, i.height), v.success("Image uploaded successfully");
|
|
358
|
+
} catch {
|
|
359
|
+
v.error("Failed to upload image");
|
|
360
|
+
} finally {
|
|
361
|
+
this.isUploading = !1;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}, this.createDataUrl = (e) => new Promise((t, i) => {
|
|
365
|
+
const s = new FileReader();
|
|
366
|
+
s.onload = () => t(s.result), s.onerror = i, s.readAsDataURL(e);
|
|
367
|
+
}), this.getImageDimensions = (e) => new Promise((t) => {
|
|
368
|
+
const i = new Image();
|
|
369
|
+
i.onload = () => {
|
|
370
|
+
t({ width: i.width, height: i.height }), URL.revokeObjectURL(i.src);
|
|
371
|
+
}, i.onerror = () => {
|
|
372
|
+
t({ width: 400, height: 300 }), URL.revokeObjectURL(i.src);
|
|
373
|
+
}, i.src = URL.createObjectURL(e);
|
|
374
|
+
}), this.insertImageMarkdown = (e, t, i, s) => {
|
|
375
|
+
const a = this.bodyTextAreaRef.value?.shadowRoot?.querySelector("textarea");
|
|
376
|
+
if (!a) return;
|
|
377
|
+
const n = `{width=${Math.min(i, 600)}px height=auto}`, c = a.selectionStart, r = a.selectionEnd, o = this.body.substring(0, c) + n + this.body.substring(r);
|
|
378
|
+
this.body = o, this.dispatchChange(), this.updateComplete.then(() => {
|
|
379
|
+
const d = this.bodyTextAreaRef.value?.shadowRoot?.querySelector("textarea");
|
|
380
|
+
if (d) {
|
|
381
|
+
const S = c + n.length;
|
|
382
|
+
d.setSelectionRange(S, S), d.focus();
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}, this.handleFileChange = (e) => {
|
|
386
|
+
const t = e.target, i = t.files;
|
|
387
|
+
if (i) for (let s = 0; s < i.length; s++) {
|
|
388
|
+
const a = i[s];
|
|
389
|
+
a.type.startsWith("image/") ? this.uploadImage(a) : this.addFile(a);
|
|
390
|
+
}
|
|
391
|
+
t.value = "";
|
|
392
|
+
}, this.handleImageSelect = (e) => {
|
|
393
|
+
const t = e.target, i = t.files?.[0];
|
|
394
|
+
i && i.type.startsWith("image/") && this.uploadImage(i), t.value = "";
|
|
395
|
+
}, this.handleDrop = (e) => {
|
|
396
|
+
e.preventDefault(), this.dragOver = !1;
|
|
397
|
+
const t = e.dataTransfer?.files;
|
|
398
|
+
if (t) for (let i = 0; i < t.length; i++) {
|
|
399
|
+
const s = t[i];
|
|
400
|
+
s.type.startsWith("image/") ? this.uploadImage(s) : this.addFile(s);
|
|
401
|
+
}
|
|
402
|
+
}, this.handleDragEnter = (e) => {
|
|
403
|
+
e.preventDefault(), this.dragOver = !0;
|
|
404
|
+
}, this.handleDocumentDragLeave = (e) => {
|
|
405
|
+
e.preventDefault(), this.dragOver = !1;
|
|
406
|
+
}, this.handleDocumentDrop = (e) => {
|
|
407
|
+
e.preventDefault(), this.dragOver = !1;
|
|
408
|
+
}, this.handleDragOver = (e) => {
|
|
409
|
+
e.preventDefault();
|
|
410
|
+
}, this.handleDragLeave = (e) => {
|
|
411
|
+
e.preventDefault();
|
|
412
|
+
}, this.addFile = (e) => {
|
|
413
|
+
if (e.size > 10485760) return void v.error(`File "${e.name}" is too large. Maximum size is 10MB.`);
|
|
414
|
+
if (this.attachments.some((i) => i.name === e.name && i.size === e.size)) return void v.warning(`File "${e.name}" is already attached.`);
|
|
415
|
+
const t = { id: crypto.randomUUID(), file: e, name: e.name, size: e.size, type: e.type || "application/octet-stream" };
|
|
416
|
+
this.attachments = [...this.attachments, t], this.dispatchChange();
|
|
417
|
+
}, this.removeAttachment = (e) => {
|
|
418
|
+
this.attachments = this.attachments.filter((t) => t.id !== e), this.dispatchChange();
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
connectedCallback() {
|
|
422
|
+
super.connectedCallback(), this.addKeyboardListeners(), this.addDragListeners();
|
|
423
|
+
}
|
|
424
|
+
disconnectedCallback() {
|
|
425
|
+
super.disconnectedCallback(), document.removeEventListener("paste", this.handlePaste), document.removeEventListener("dragenter", this.handleDragEnter), document.removeEventListener("dragleave", this.handleDocumentDragLeave), document.removeEventListener("drop", this.handleDocumentDrop);
|
|
426
|
+
}
|
|
427
|
+
addKeyboardListeners() {
|
|
428
|
+
this.addEventListener("keydown", this.handleKeyDown), document.addEventListener("paste", this.handlePaste);
|
|
429
|
+
}
|
|
430
|
+
addDragListeners() {
|
|
431
|
+
document.addEventListener("dragenter", this.handleDragEnter), document.addEventListener("dragleave", this.handleDocumentDragLeave), document.addEventListener("drop", this.handleDocumentDrop);
|
|
432
|
+
}
|
|
433
|
+
insertAtCursor(e, t) {
|
|
434
|
+
if (!this.bodyTextAreaRef.value) return;
|
|
435
|
+
const i = this.bodyTextAreaRef.value.shadowRoot?.querySelector("textarea");
|
|
436
|
+
if (!i) return;
|
|
437
|
+
const s = i.selectionStart, a = i.selectionEnd, n = i.value.substring(0, s) + e + i.value.substring(a);
|
|
438
|
+
this.body = n, this.dispatchChange(), this.updateComplete.then(() => {
|
|
439
|
+
const c = this.bodyTextAreaRef.value?.shadowRoot?.querySelector("textarea");
|
|
440
|
+
if (c) if (c.focus(), t) {
|
|
441
|
+
const r = s + e.indexOf(t), o = r + t.length;
|
|
442
|
+
c.setSelectionRange(r, o);
|
|
443
|
+
} else c.setSelectionRange(s + e.length, s + e.length);
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
wrapSelection(e, t, i) {
|
|
447
|
+
if (!this.bodyTextAreaRef.value) return;
|
|
448
|
+
const s = this.bodyTextAreaRef.value.shadowRoot?.querySelector("textarea");
|
|
449
|
+
if (!s) return;
|
|
450
|
+
const a = s.selectionStart, n = s.selectionEnd, c = s.value.substring(a, n), r = e + (c || i) + t, o = s.value.substring(0, a) + r + s.value.substring(n);
|
|
451
|
+
this.body = o, this.dispatchChange(), this.updateComplete.then(() => {
|
|
452
|
+
const d = this.bodyTextAreaRef.value?.shadowRoot?.querySelector("textarea");
|
|
453
|
+
d && (d.focus(), c ? d.setSelectionRange(a + r.length, a + r.length) : d.setSelectionRange(a + e.length, a + e.length + i.length));
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
render() {
|
|
457
|
+
return l`
|
|
458
|
+
<schmancy-surface
|
|
459
|
+
type="surface"
|
|
460
|
+
rounded="all"
|
|
461
|
+
class=${this.classMap({ "border-2 border-dashed border-primary": this.dragOver, "h-full flex flex-col": !0 })}
|
|
462
|
+
@drop=${this.handleDrop}
|
|
463
|
+
@dragover=${this.handleDragOver}
|
|
464
|
+
@dragleave=${this.handleDragLeave}
|
|
465
|
+
>
|
|
466
|
+
<div class="flex flex-col h-full gap-4">
|
|
467
|
+
|
|
468
|
+
<!-- Header Section with Templates and Subject -->
|
|
469
|
+
<div class="flex-shrink-0 p-4 pb-0 space-y-4">
|
|
470
|
+
<!-- Template Selector -->
|
|
471
|
+
${m(this.templates.length > 0, () => l`
|
|
472
|
+
<div class="space-y-3">
|
|
473
|
+
<schmancy-typography type="label" token="md">
|
|
474
|
+
Email Templates
|
|
475
|
+
</schmancy-typography>
|
|
476
|
+
<div class="flex flex-wrap gap-2">
|
|
477
|
+
${I(this.templates, (e) => e.id, (e) => l`
|
|
478
|
+
<schmancy-chip
|
|
479
|
+
?selected=${this.selectedTemplate === e.id}
|
|
480
|
+
@click=${() => this.selectTemplate(e.id)}
|
|
481
|
+
class="text-sm"
|
|
482
|
+
>
|
|
483
|
+
${e.name}
|
|
484
|
+
</schmancy-chip>
|
|
485
|
+
`)}
|
|
486
|
+
${m(this.selectedTemplate, () => l`
|
|
487
|
+
<schmancy-button
|
|
488
|
+
variant="text"
|
|
489
|
+
@click=${this.clearTemplate}
|
|
490
|
+
>
|
|
491
|
+
<schmancy-icon slot="prefix" size="16px">clear</schmancy-icon>
|
|
492
|
+
Clear
|
|
493
|
+
</schmancy-button>
|
|
494
|
+
`)}
|
|
495
|
+
</div>
|
|
496
|
+
</div>
|
|
497
|
+
`)}
|
|
498
|
+
|
|
499
|
+
<!-- Subject Field -->
|
|
500
|
+
<div class="space-y-2">
|
|
501
|
+
<schmancy-typography type="label" token="md">
|
|
502
|
+
Subject *
|
|
503
|
+
</schmancy-typography>
|
|
504
|
+
<schmancy-input
|
|
505
|
+
${C(this.subjectInputRef)}
|
|
506
|
+
.value=${this.subject}
|
|
507
|
+
@input=${this.handleSubjectChange}
|
|
508
|
+
placeholder="Enter email subject..."
|
|
509
|
+
.disabled=${this.disabled}
|
|
510
|
+
class="w-full"
|
|
511
|
+
></schmancy-input>
|
|
512
|
+
</div>
|
|
513
|
+
</div>
|
|
514
|
+
|
|
515
|
+
<!-- Formatting Toolbar -->
|
|
516
|
+
<div class="flex-shrink-0 px-4">
|
|
517
|
+
<schmancy-surface type="container" rounded="all" class="p-3">
|
|
518
|
+
<div class="flex flex-wrap gap-2 items-center">
|
|
519
|
+
<!-- Text Formatting Group -->
|
|
520
|
+
<div class="flex gap-1">
|
|
521
|
+
<schmancy-icon-button
|
|
522
|
+
size="sm"
|
|
523
|
+
variant="text"
|
|
524
|
+
title="Bold"
|
|
525
|
+
?disabled=${this.disabled}
|
|
526
|
+
@click=${() => this.wrapSelection("**", "**", "bold text")}
|
|
527
|
+
>
|
|
528
|
+
<schmancy-icon>format_bold</schmancy-icon>
|
|
529
|
+
</schmancy-icon-button>
|
|
530
|
+
<schmancy-icon-button
|
|
531
|
+
size="sm"
|
|
532
|
+
variant="text"
|
|
533
|
+
title="Italic"
|
|
534
|
+
?disabled=${this.disabled}
|
|
535
|
+
@click=${() => this.wrapSelection("*", "*", "italic text")}
|
|
536
|
+
>
|
|
537
|
+
<schmancy-icon>format_italic</schmancy-icon>
|
|
538
|
+
</schmancy-icon-button>
|
|
539
|
+
<schmancy-icon-button
|
|
540
|
+
size="sm"
|
|
541
|
+
variant="text"
|
|
542
|
+
title="Link"
|
|
543
|
+
?disabled=${this.disabled}
|
|
544
|
+
@click=${() => this.insertAtCursor("[link text](https://example.com)", "link text")}
|
|
545
|
+
>
|
|
546
|
+
<schmancy-icon>link</schmancy-icon>
|
|
547
|
+
</schmancy-icon-button>
|
|
548
|
+
</div>
|
|
549
|
+
|
|
550
|
+
<!-- Divider -->
|
|
551
|
+
<div class="h-6 w-px bg-outline-variant"></div>
|
|
552
|
+
|
|
553
|
+
<!-- Structure Formatting Group -->
|
|
554
|
+
<div class="flex gap-1">
|
|
555
|
+
<schmancy-icon-button
|
|
556
|
+
size="sm"
|
|
557
|
+
variant="text"
|
|
558
|
+
title="Heading"
|
|
559
|
+
?disabled=${this.disabled}
|
|
560
|
+
@click=${() => this.insertAtCursor(`
|
|
561
|
+
# Heading
|
|
562
|
+
`, "Heading")}
|
|
563
|
+
>
|
|
564
|
+
<schmancy-icon>title</schmancy-icon>
|
|
565
|
+
</schmancy-icon-button>
|
|
566
|
+
<schmancy-icon-button
|
|
567
|
+
size="sm"
|
|
568
|
+
variant="text"
|
|
569
|
+
title="Bullet List"
|
|
570
|
+
?disabled=${this.disabled}
|
|
571
|
+
@click=${() => this.insertAtCursor(`
|
|
572
|
+
* List item
|
|
573
|
+
`, "List item")}
|
|
574
|
+
>
|
|
575
|
+
<schmancy-icon>format_list_bulleted</schmancy-icon>
|
|
576
|
+
</schmancy-icon-button>
|
|
577
|
+
</div>
|
|
578
|
+
|
|
579
|
+
<!-- Divider -->
|
|
580
|
+
<div class="h-6 w-px bg-outline-variant"></div>
|
|
581
|
+
|
|
582
|
+
<!-- Media and Layout Group -->
|
|
583
|
+
<div class="flex gap-1">
|
|
584
|
+
<schmancy-icon-button
|
|
585
|
+
size="sm"
|
|
586
|
+
variant="text"
|
|
587
|
+
title="Insert Image"
|
|
588
|
+
?disabled=${this.disabled || this.isUploading}
|
|
589
|
+
@click=${() => this.imageInputRef.value?.click()}
|
|
590
|
+
>
|
|
591
|
+
${m(this.isUploading, () => l`<schmancy-progress size="sm" class="w-4 h-4"></schmancy-progress>`, () => l`<schmancy-icon>image</schmancy-icon>`)}
|
|
592
|
+
</schmancy-icon-button>
|
|
593
|
+
<schmancy-icon-button
|
|
594
|
+
size="sm"
|
|
595
|
+
variant="text"
|
|
596
|
+
title="Insert Layout"
|
|
597
|
+
?disabled=${this.disabled}
|
|
598
|
+
@click=${this.openLayoutDialog}
|
|
599
|
+
>
|
|
600
|
+
<schmancy-icon>view_column</schmancy-icon>
|
|
601
|
+
</schmancy-icon-button>
|
|
602
|
+
</div>
|
|
603
|
+
</div>
|
|
604
|
+
</schmancy-surface>
|
|
605
|
+
</div>
|
|
606
|
+
|
|
607
|
+
<!-- Textarea Container - Takes remaining space -->
|
|
608
|
+
<div class="flex-1 px-4 relative min-h-0">
|
|
609
|
+
<schmancy-textarea
|
|
610
|
+
${C(this.bodyTextAreaRef)}
|
|
611
|
+
.value=${this.body}
|
|
612
|
+
@change=${this.handleBodyChange}
|
|
613
|
+
placeholder="Enter your email message here...
|
|
614
|
+
|
|
615
|
+
Use the toolbar buttons above for formatting, or type markdown directly:
|
|
616
|
+
**bold**, *italic*, [link](url), 
|
|
617
|
+
|
|
618
|
+
Drag & drop images or press Ctrl+V to paste from clipboard.
|
|
619
|
+
Tab key inserts 2 spaces for better formatting."
|
|
620
|
+
.disabled=${this.disabled}
|
|
621
|
+
.required=${!0}
|
|
622
|
+
.rows=${4}
|
|
623
|
+
class="w-full font-mono text-sm"
|
|
624
|
+
></schmancy-textarea>
|
|
625
|
+
|
|
626
|
+
<!-- Upload Progress Overlay -->
|
|
627
|
+
${m(this.isUploading, () => l`
|
|
628
|
+
<div class="absolute top-3 right-3 z-10">
|
|
629
|
+
<schmancy-surface type="container" rounded="all" class="p-2">
|
|
630
|
+
<div class="flex items-center gap-2">
|
|
631
|
+
<schmancy-progress size="sm" class="w-4 h-4"></schmancy-progress>
|
|
632
|
+
<schmancy-typography type="body" token="xs">Uploading...</schmancy-typography>
|
|
633
|
+
</div>
|
|
634
|
+
</schmancy-surface>
|
|
635
|
+
</div>
|
|
636
|
+
`)}
|
|
637
|
+
</div>
|
|
638
|
+
|
|
639
|
+
<!-- Footer Section -->
|
|
640
|
+
<div class="flex-shrink-0 p-4 pt-0 space-y-2">
|
|
641
|
+
<!-- Character/Word Counter -->
|
|
642
|
+
<div class="text-center">
|
|
643
|
+
<schmancy-typography type="body" token="xs">
|
|
644
|
+
${this.body.length} characters • ${this.body.trim() ? this.body.trim().split(/\s+/).length : 0} words
|
|
645
|
+
</schmancy-typography>
|
|
646
|
+
</div>
|
|
647
|
+
|
|
648
|
+
<!-- Attachments Display (if any) -->
|
|
649
|
+
${m(this.attachments.length > 0, () => l`
|
|
650
|
+
<div class="space-y-2">
|
|
651
|
+
<schmancy-typography type="label" token="sm" class="flex items-center gap-2">
|
|
652
|
+
<schmancy-icon size="16px">attach_file</schmancy-icon>
|
|
653
|
+
Attachments (${this.attachments.length})
|
|
654
|
+
</schmancy-typography>
|
|
655
|
+
<div class="flex flex-wrap gap-2">
|
|
656
|
+
${I(this.attachments, (e) => e.id, (e) => l`
|
|
657
|
+
<schmancy-chip class="text-xs">
|
|
658
|
+
<span class="truncate max-w-32">${e.name}</span>
|
|
659
|
+
<button
|
|
660
|
+
@click=${() => this.removeAttachment(e.id)}
|
|
661
|
+
class="ml-2 text-error hover:text-error-container"
|
|
662
|
+
title="Remove attachment"
|
|
663
|
+
>
|
|
664
|
+
<schmancy-icon size="14px">close</schmancy-icon>
|
|
665
|
+
</button>
|
|
666
|
+
</schmancy-chip>
|
|
667
|
+
`)}
|
|
668
|
+
</div>
|
|
669
|
+
</div>
|
|
670
|
+
`)}
|
|
671
|
+
</div>
|
|
672
|
+
|
|
673
|
+
<!-- Hidden File Inputs -->
|
|
674
|
+
<div class="hidden">
|
|
675
|
+
<input
|
|
676
|
+
${C(this.fileInputRef)}
|
|
677
|
+
type="file"
|
|
678
|
+
multiple
|
|
679
|
+
@change=${this.handleFileChange}
|
|
680
|
+
>
|
|
681
|
+
<input
|
|
682
|
+
${C(this.imageInputRef)}
|
|
683
|
+
type="file"
|
|
684
|
+
accept="image/*"
|
|
685
|
+
@change=${this.handleImageSelect}
|
|
686
|
+
>
|
|
687
|
+
</div>
|
|
688
|
+
|
|
689
|
+
</div>
|
|
690
|
+
</schmancy-surface>
|
|
691
|
+
`;
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
x([h({ type: String })], b.prototype, "subject", 2), x([h({ type: String })], b.prototype, "body", 2), x([h({ type: Array })], b.prototype, "templates", 2), x([h({ type: Boolean })], b.prototype, "disabled", 2), x([h({ type: Array })], b.prototype, "attachments", 2), x([h({ type: Object })], b.prototype, "config", 2), x([u()], b.prototype, "selectedTemplate", 2), x([u()], b.prototype, "dragOver", 2), x([u()], b.prototype, "isUploading", 2), b = x([k("schmancy-email-editor")], b);
|
|
695
|
+
var P = Object.defineProperty, O = Object.getOwnPropertyDescriptor, w = (e, t, i, s) => {
|
|
696
|
+
for (var a, n = s > 1 ? void 0 : s ? O(t, i) : t, c = e.length - 1; c >= 0; c--) (a = e[c]) && (n = (s ? a(t, i, n) : a(n)) || n);
|
|
697
|
+
return s && n && P(t, i, n), n;
|
|
698
|
+
};
|
|
699
|
+
let $ = class extends E(A`
|
|
700
|
+
:host {
|
|
701
|
+
display: block;
|
|
702
|
+
}
|
|
703
|
+
`) {
|
|
704
|
+
constructor() {
|
|
705
|
+
super(...arguments), this.subject = "", this.body = "", this.attachments = [], this.recipients = [], this.fromAddress = "sender@example.com", this.toAddress = "recipient@example.com", this.viewMode = "html";
|
|
706
|
+
}
|
|
707
|
+
parseLayoutBlocks(e) {
|
|
708
|
+
return e.replace(/:::layout\s+([a-zA-Z0-9-]+)\n([\s\S]*?)\n:::/g, (t, i, s) => {
|
|
709
|
+
switch (i) {
|
|
710
|
+
case "columns-2":
|
|
711
|
+
return this.parseColumnsLayout(s, 2);
|
|
712
|
+
case "columns-3":
|
|
713
|
+
return this.parseColumnsLayout(s, 3);
|
|
714
|
+
case "sidebar-left":
|
|
715
|
+
return this.parseSidebarLayout(s, "left");
|
|
716
|
+
case "sidebar-right":
|
|
717
|
+
return this.parseSidebarLayout(s, "right");
|
|
718
|
+
case "image-row":
|
|
719
|
+
return this.parseImageRowLayout(s);
|
|
720
|
+
default:
|
|
721
|
+
return s;
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
parseColumnsLayout(e, t) {
|
|
726
|
+
const i = /<div class="column">([\s\S]*?)<\/div>/g, s = [];
|
|
727
|
+
let a;
|
|
728
|
+
for (; (a = i.exec(e)) !== null; ) s.push(a[1].trim());
|
|
729
|
+
if (s.length === 0) return e;
|
|
730
|
+
const n = Math.floor(100 / t), c = "0 10px 0 0";
|
|
731
|
+
let r = "<tr>";
|
|
732
|
+
for (let o = 0; o < t && o < s.length; o++)
|
|
733
|
+
r += `
|
|
734
|
+
<td width="${n}%" style="padding: ${o === t - 1 ? "0" : c}; vertical-align: top; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #333333;">
|
|
735
|
+
${this.parseBasicMarkdown(s[o])}
|
|
736
|
+
</td>`;
|
|
737
|
+
for (let o = s.length; o < t; o++)
|
|
738
|
+
r += `
|
|
739
|
+
<td width="${n}%" style="padding: ${o === t - 1 ? "0" : c}; vertical-align: top;">
|
|
740
|
+
|
|
741
|
+
</td>`;
|
|
742
|
+
return r += "</tr>", `
|
|
743
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin: 16px 0;">
|
|
744
|
+
${r}
|
|
745
|
+
</table>`;
|
|
746
|
+
}
|
|
747
|
+
parseSidebarLayout(e, t) {
|
|
748
|
+
const i = e.match(/<div class="sidebar">([\s\S]*?)<\/div>/), s = e.match(/<div class="main">([\s\S]*?)<\/div>/);
|
|
749
|
+
if (!i || !s) return e;
|
|
750
|
+
const a = `
|
|
751
|
+
<td width="30%" style="padding: 0 16px 0 0; vertical-align: top; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #333333;">
|
|
752
|
+
${this.parseBasicMarkdown(i[1].trim())}
|
|
753
|
+
</td>`, n = `
|
|
754
|
+
<td width="70%" style="padding: 0; vertical-align: top; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #333333;">
|
|
755
|
+
${this.parseBasicMarkdown(s[1].trim())}
|
|
756
|
+
</td>`;
|
|
757
|
+
return `
|
|
758
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin: 16px 0;">
|
|
759
|
+
${t === "left" ? `<tr>${a}${n}</tr>` : `<tr>${n}${a.replace("0 16px 0 0", "0 0 0 16px")}</tr>`}
|
|
760
|
+
</table>`;
|
|
761
|
+
}
|
|
762
|
+
parseImageRowLayout(e) {
|
|
763
|
+
const t = /<div class="image">([\s\S]*?)<\/div>/g, i = [];
|
|
764
|
+
let s;
|
|
765
|
+
for (; (s = t.exec(e)) !== null; ) {
|
|
766
|
+
const c = s[1].trim().match(/!\[([^\]]*)\]\(([^)]+)\)/);
|
|
767
|
+
if (c) {
|
|
768
|
+
const [, r, o] = c;
|
|
769
|
+
i.push(`<img src="${o}" alt="${r || "Image"}" style="display: block; max-width: 100%; height: auto;" border="0">`);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
if (i.length === 0) return e;
|
|
773
|
+
const a = Math.floor(100 / i.length);
|
|
774
|
+
let n = "<tr>";
|
|
775
|
+
return i.forEach((c, r) => {
|
|
776
|
+
const o = r === i.length - 1;
|
|
777
|
+
n += `
|
|
778
|
+
<td width="${a}%" style="padding: ${o ? "0" : "0 8px 0 0"}; vertical-align: top; text-align: center;">
|
|
779
|
+
${c}
|
|
780
|
+
</td>`;
|
|
781
|
+
}), n += "</tr>", `
|
|
782
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin: 16px 0;">
|
|
783
|
+
${n}
|
|
784
|
+
</table>`;
|
|
785
|
+
}
|
|
786
|
+
parseImageAttributes(e) {
|
|
787
|
+
const t = {};
|
|
788
|
+
if (!e) return t;
|
|
789
|
+
const i = e.match(/width=([^\s}]+)/);
|
|
790
|
+
i && (t.width = i[1]);
|
|
791
|
+
const s = e.match(/height=([^\s}]+)/);
|
|
792
|
+
return s && (t.height = s[1]), e.includes("cover") && (t.cover = !0), e.includes("contain") && (t.contain = !0), t;
|
|
793
|
+
}
|
|
794
|
+
generateImageStyles(e, t = !1) {
|
|
795
|
+
let i, s, a = "display: block; margin: 8px 0; border: 0;";
|
|
796
|
+
return e.width ? e.width === "auto" ? a += t ? " max-width: 100%; height: auto;" : " height: auto;" : e.width.endsWith("%") ? (a += ` width: ${e.width}; max-width: 100%;`, e.height || (a += " height: auto;")) : e.width.endsWith("px") && (i = e.width.replace("px", ""), a += " max-width: 100%;", e.height || (a += " height: auto;")) : a += t ? " width: 100%; max-width: 100%; height: auto;" : " max-width: 100%; height: auto;", e.height && (e.height === "auto" ? a += " height: auto;" : e.height.endsWith("px") && (s = e.height.replace("px", ""), e.width || (a += " max-width: 100%;"))), (e.cover || e.contain) && (e.width || e.height || (a += " width: 100%;")), { imgStyle: a, imgWidth: i, imgHeight: s };
|
|
797
|
+
}
|
|
798
|
+
parseBasicMarkdown(e) {
|
|
799
|
+
return e.replace(/!\[([^\]]*)\]\(([^)]+)\)(?:\{([^}]+)\})?/g, (t, i, s, a) => {
|
|
800
|
+
const n = this.parseImageAttributes(a), { imgStyle: c, imgWidth: r, imgHeight: o } = this.generateImageStyles(n, !0);
|
|
801
|
+
let d = `<img src="${s}" alt="${i || "Image"}" style="${c}" border="0"`;
|
|
802
|
+
return r && (d += ` width="${r}"`), o && (d += ` height="${o}"`), d += ">", d;
|
|
803
|
+
}).replace(/\n\n/g, '</p><p style="margin: 0 0 16px 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #333333;">').replace(/\n/g, "<br>").replace(/\*\*(.*?)\*\*/g, '<strong style="font-weight: bold;">$1</strong>').replace(/\*(.*?)\*/g, '<em style="font-style: italic;">$1</em>').replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" style="color: #0066cc; text-decoration: underline;">$1</a>').replace(/^# (.*$)/gim, '<h2 style="margin: 16px 0 8px 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold; color: #1a1a1a;">$1</h2>').replace(/^\* (.*$)/gim, '<li style="margin: 4px 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333;">$1</li>').replace(/^\d+\. (.*$)/gim, '<li style="margin: 4px 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333;">$1</li>').replace(/(<li[^>]*>.*?<\/li>(?:\s*<li[^>]*>.*?<\/li>)*)/gs, (t) => {
|
|
804
|
+
const i = /^\d+\./.test(t.replace(/<[^>]*>/g, "")) ? "ol" : "ul";
|
|
805
|
+
return `<${i} style="margin: 8px 0; padding: 0 0 0 20px; font-family: Arial, Helvetica, sans-serif;">${t}</${i}>`;
|
|
806
|
+
}).replace(/^(?!<[h\d]|<p|<ul|<ol|<li|<img)(.+)$/gim, '<p style="margin: 0 0 16px 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #333333;">$1</p>');
|
|
807
|
+
}
|
|
808
|
+
parseExtendedMarkdown(e) {
|
|
809
|
+
let t = e;
|
|
810
|
+
return t = this.parseLayoutBlocks(t), t = t.replace(/:::images\s+(row|grid(?:=\d+)?)\n((?:!\[.*?\]\(.*?\)(?:\{.*?\})?\s*\n?)*?):::/g, "[Multiple Images - View in web browser]"), t = t.replace(/!\[([^\]]*)\]\(([^)]+)\)(?:\{([^}]+)\})?/g, (i, s, a, n) => {
|
|
811
|
+
const c = this.parseImageAttributes(n), { imgStyle: r, imgWidth: o, imgHeight: d } = this.generateImageStyles(c, !1);
|
|
812
|
+
let S = `<img src="${a}" alt="${s || "Image"}" style="${r}" border="0"`;
|
|
813
|
+
return o && (S += ` width="${o}"`), d && (S += ` height="${d}"`), S += ">", `<table cellpadding="0" cellspacing="0" border="0" style="margin: 16px 0;"><tr><td>${S}</td></tr></table>`;
|
|
814
|
+
}), t = t.replace(/\n\n/g, '</p><p style="margin: 0 0 16px 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #333333;">').replace(/\n/g, "<br>").replace(/\*\*(.*?)\*\*/g, '<strong style="font-weight: bold;">$1</strong>').replace(/\*(.*?)\*/g, '<em style="font-style: italic;">$1</em>').replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" style="color: #0066cc; text-decoration: underline;">$1</a>').replace(/^# (.*$)/gim, '<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin: 24px 0 16px 0;"><tr><td><h1 style="margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 24px; font-weight: bold; color: #1a1a1a;">$1</h1></td></tr></table>').replace(/^\* (.*$)/gim, '<li style="margin: 4px 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333;">$1</li>').replace(/^\d+\. (.*$)/gim, '<li style="margin: 4px 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333;">$1</li>').replace(/^---$/gim, '<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin: 24px 0;"><tr><td style="border-top: 1px solid #e0e0e0; height: 1px; line-height: 1px;"> </td></tr></table>'), t = t.replace(/(<li[^>]*>.*?<\/li>(?:\s*<li[^>]*>.*?<\/li>)*)/gs, (i) => {
|
|
815
|
+
const s = /^\d+\./.test(i.replace(/<[^>]*>/g, "")), a = s ? "ol" : "ul";
|
|
816
|
+
return `<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><${a} style="margin: 16px 0; padding: 0 0 0 20px; font-family: Arial, Helvetica, sans-serif;">${i}</${a}></td></tr></table>`;
|
|
817
|
+
}), t.includes("<table>") || t.includes("<h1>") || (t = `<p style="margin: 0 0 16px 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #333333;">${t}</p>`), t = `<table cellpadding="0" cellspacing="0" border="0" width="100%" style="max-width: 600px; margin: 0 auto;">
|
|
818
|
+
<tr>
|
|
819
|
+
<td style="padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #333333;">
|
|
820
|
+
${t}
|
|
821
|
+
</td>
|
|
822
|
+
</tr>
|
|
823
|
+
</table>`, t;
|
|
824
|
+
}
|
|
825
|
+
convertToPlainText(e) {
|
|
826
|
+
return e.trim().replace(/:::layout\s+([a-zA-Z0-9-]+)\n([\s\S]*?)\n:::/g, (t, i, s) => s.replace(/<div class="(?:column|sidebar|main|image)">/g, `
|
|
827
|
+
`).replace(/<\/div>/g, `
|
|
828
|
+
`).replace(/\n{3,}/g, `
|
|
829
|
+
|
|
830
|
+
`).trim()).replace(/:::images\s+(row|grid(?:=\d+)?)\n((?:!\[.*?\]\(.*?\)(?:\{.*?\})?\s*\n?)*?):::/g, "[Images]").replace(/!\[([^\]]*)\]\(([^)]+)\)(?:\{([^}]+)\})?/g, "[Image: $1]").replace(/\*\*(.*?)\*\*/g, "$1").replace(/\*(.*?)\*/g, "$1").replace(/__(.*?)__/g, "$1").replace(/~~(.*?)~~/g, "$1").replace(/`(.*?)`/g, "$1").replace(/^#{1,3} (.*$)/gim, "$1").replace(/^> (.*$)/gim, "$1").replace(/^\* (.*$)/gim, "• $1").replace(/^\d+\. (.*$)/gim, "$1").replace(/\[([^\]]+)\]\(([^)]+)\)/g, "$1 ($2)").replace(/^---$/gim, "---").replace(/\n\n+/g, `
|
|
831
|
+
|
|
832
|
+
`);
|
|
833
|
+
}
|
|
834
|
+
formatFileSize(e) {
|
|
835
|
+
if (e === 0) return "0 Bytes";
|
|
836
|
+
const t = Math.floor(Math.log(e) / Math.log(1024));
|
|
837
|
+
return parseFloat((e / Math.pow(1024, t)).toFixed(2)) + " " + ["Bytes", "KB", "MB", "GB"][t];
|
|
838
|
+
}
|
|
839
|
+
render() {
|
|
840
|
+
const e = this.parseExtendedMarkdown(this.body), t = this.convertToPlainText(this.body), i = this.recipients[0] || this.toAddress;
|
|
841
|
+
return l`
|
|
842
|
+
<schmancy-surface type="surface" rounded="all" class="h-full flex flex-col">
|
|
843
|
+
|
|
844
|
+
<!-- Header Section -->
|
|
845
|
+
<div class="flex-shrink-0 p-4 border-b border-outline-variant">
|
|
846
|
+
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
847
|
+
<schmancy-typography type="title" token="md" class="flex items-center gap-2">
|
|
848
|
+
<schmancy-icon size="20px">preview</schmancy-icon>
|
|
849
|
+
Email Preview
|
|
850
|
+
</schmancy-typography>
|
|
851
|
+
|
|
852
|
+
<!-- View Mode Toggle -->
|
|
853
|
+
<div class="flex gap-1 bg-surface-container rounded-full p-1">
|
|
854
|
+
<schmancy-chip
|
|
855
|
+
?selected=${this.viewMode === "html"}
|
|
856
|
+
@click=${() => {
|
|
857
|
+
this.viewMode = "html";
|
|
858
|
+
}}
|
|
859
|
+
class="text-xs h-8"
|
|
860
|
+
data-variant=${this.viewMode === "html" ? "filled" : "outlined"}
|
|
861
|
+
>
|
|
862
|
+
<schmancy-icon slot="prefix" size="14px">code</schmancy-icon>
|
|
863
|
+
HTML
|
|
864
|
+
</schmancy-chip>
|
|
865
|
+
<schmancy-chip
|
|
866
|
+
?selected=${this.viewMode === "plaintext"}
|
|
867
|
+
@click=${() => {
|
|
868
|
+
this.viewMode = "plaintext";
|
|
869
|
+
}}
|
|
870
|
+
class="text-xs h-8"
|
|
871
|
+
data-variant=${this.viewMode === "plaintext" ? "filled" : "outlined"}
|
|
872
|
+
>
|
|
873
|
+
<schmancy-icon slot="prefix" size="14px">text_fields</schmancy-icon>
|
|
874
|
+
Text
|
|
875
|
+
</schmancy-chip>
|
|
876
|
+
</div>
|
|
877
|
+
</div>
|
|
878
|
+
</div>
|
|
879
|
+
|
|
880
|
+
<!-- Preview Content Container -->
|
|
881
|
+
<div class="flex-1 flex flex-col min-h-0 p-4 gap-4">
|
|
882
|
+
|
|
883
|
+
<!-- Email Mock Container -->
|
|
884
|
+
<div class="flex-1 flex flex-col min-h-0">
|
|
885
|
+
<schmancy-surface
|
|
886
|
+
type="container"
|
|
887
|
+
rounded="all"
|
|
888
|
+
class="flex-1 flex flex-col overflow-hidden shadow-sm"
|
|
889
|
+
>
|
|
890
|
+
<!-- Email Header -->
|
|
891
|
+
<div class="flex-shrink-0 p-4 bg-surface-containerLow border-b border-outline-variant">
|
|
892
|
+
<div class="space-y-3">
|
|
893
|
+
<!-- From Field -->
|
|
894
|
+
<div class="flex items-start gap-3">
|
|
895
|
+
<div class="flex items-center gap-2 min-w-0 flex-shrink-0 w-16">
|
|
896
|
+
<schmancy-icon size="16px">account_circle</schmancy-icon>
|
|
897
|
+
<schmancy-typography type="body" token="sm" class="font-medium">
|
|
898
|
+
From
|
|
899
|
+
</schmancy-typography>
|
|
900
|
+
</div>
|
|
901
|
+
<schmancy-typography type="body" token="sm" class="break-all flex-1">
|
|
902
|
+
${this.fromAddress}
|
|
903
|
+
</schmancy-typography>
|
|
904
|
+
</div>
|
|
905
|
+
|
|
906
|
+
<!-- To Field -->
|
|
907
|
+
<div class="flex items-start gap-3">
|
|
908
|
+
<div class="flex items-center gap-2 min-w-0 flex-shrink-0 w-16">
|
|
909
|
+
<schmancy-icon size="16px">person</schmancy-icon>
|
|
910
|
+
<schmancy-typography type="body" token="sm" class="font-medium">
|
|
911
|
+
To
|
|
912
|
+
</schmancy-typography>
|
|
913
|
+
</div>
|
|
914
|
+
<schmancy-typography type="body" token="sm" class="break-all flex-1">
|
|
915
|
+
${i}
|
|
916
|
+
</schmancy-typography>
|
|
917
|
+
</div>
|
|
918
|
+
|
|
919
|
+
<!-- Subject Field -->
|
|
920
|
+
<div class="flex items-start gap-3">
|
|
921
|
+
<div class="flex items-center gap-2 min-w-0 flex-shrink-0 w-16">
|
|
922
|
+
<schmancy-icon size="16px">subject</schmancy-icon>
|
|
923
|
+
<schmancy-typography type="body" token="sm" class="font-medium">
|
|
924
|
+
Subject
|
|
925
|
+
</schmancy-typography>
|
|
926
|
+
</div>
|
|
927
|
+
<schmancy-typography type="body" token="sm" class="font-medium flex-1">
|
|
928
|
+
${this.subject || l`<span class="italic text-surface-onVariant">(No subject)</span>`}
|
|
929
|
+
</schmancy-typography>
|
|
930
|
+
</div>
|
|
931
|
+
</div>
|
|
932
|
+
</div>
|
|
933
|
+
|
|
934
|
+
<!-- Email Body Content -->
|
|
935
|
+
<div class="flex-1 overflow-y-auto min-h-0">
|
|
936
|
+
${m(this.body, () => l`
|
|
937
|
+
${m(this.viewMode === "html", () => l`
|
|
938
|
+
<div class="p-6 bg-white" style="color: #333; line-height: 1.6; font-family: system-ui, -apple-system, sans-serif; font-size: 14px;">
|
|
939
|
+
<div .innerHTML=${e}></div>
|
|
940
|
+
</div>
|
|
941
|
+
`, () => l`
|
|
942
|
+
<div class="p-6 bg-white" style="color: #333; line-height: 1.6; font-family: 'Courier New', monospace; font-size: 13px; white-space: pre-wrap;">
|
|
943
|
+
${t}
|
|
944
|
+
</div>
|
|
945
|
+
`)}
|
|
946
|
+
`, () => l`
|
|
947
|
+
<!-- Empty State -->
|
|
948
|
+
<div class="flex-1 flex items-center justify-center p-8">
|
|
949
|
+
<div class="text-center space-y-3">
|
|
950
|
+
<schmancy-icon size="48px" class="text-surface-onVariant opacity-50">mail_outline</schmancy-icon>
|
|
951
|
+
<schmancy-typography type="body" token="md">
|
|
952
|
+
No message content to preview
|
|
953
|
+
</schmancy-typography>
|
|
954
|
+
<schmancy-typography type="body" token="sm" class="text-surface-onVariant">
|
|
955
|
+
Start typing in the composer to see a preview
|
|
956
|
+
</schmancy-typography>
|
|
957
|
+
</div>
|
|
958
|
+
</div>
|
|
959
|
+
`)}
|
|
960
|
+
</div>
|
|
961
|
+
|
|
962
|
+
<!-- Attachments Section -->
|
|
963
|
+
${m(this.attachments.length > 0, () => l`
|
|
964
|
+
<div class="flex-shrink-0 p-4 border-t border-outline-variant bg-surface-containerLowest">
|
|
965
|
+
<div class="space-y-3">
|
|
966
|
+
<!-- Attachments Header -->
|
|
967
|
+
<div class="flex items-center gap-2">
|
|
968
|
+
<schmancy-icon size="18px">attach_file</schmancy-icon>
|
|
969
|
+
<schmancy-typography type="label" token="md" class="font-medium">
|
|
970
|
+
Attachments (${this.attachments.length})
|
|
971
|
+
</schmancy-typography>
|
|
972
|
+
</div>
|
|
973
|
+
|
|
974
|
+
<!-- Attachments List -->
|
|
975
|
+
<div class="grid gap-2 sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2">
|
|
976
|
+
${I(this.attachments, (s) => s.id, (s) => l`
|
|
977
|
+
<schmancy-surface type="container" rounded="all" class="p-3">
|
|
978
|
+
<div class="flex items-center gap-3">
|
|
979
|
+
<!-- File Icon -->
|
|
980
|
+
<schmancy-icon size="20px" class="text-surface-onVariant flex-shrink-0">
|
|
981
|
+
${s.type.startsWith("image/") ? "image" : s.type.includes("pdf") ? "picture_as_pdf" : s.type.includes("text") ? "description" : "attach_file"}
|
|
982
|
+
</schmancy-icon>
|
|
983
|
+
|
|
984
|
+
<!-- File Info -->
|
|
985
|
+
<div class="flex-1 min-w-0">
|
|
986
|
+
<schmancy-typography type="body" token="sm" class="font-medium truncate">
|
|
987
|
+
${s.name}
|
|
988
|
+
</schmancy-typography>
|
|
989
|
+
<schmancy-typography type="body" token="xs" class="text-surface-onVariant">
|
|
990
|
+
${this.formatFileSize(s.size)} • ${s.type}
|
|
991
|
+
</schmancy-typography>
|
|
992
|
+
</div>
|
|
993
|
+
</div>
|
|
994
|
+
</schmancy-surface>
|
|
995
|
+
`)}
|
|
996
|
+
</div>
|
|
997
|
+
</div>
|
|
998
|
+
</div>
|
|
999
|
+
`)}
|
|
1000
|
+
</schmancy-surface>
|
|
1001
|
+
</div>
|
|
1002
|
+
|
|
1003
|
+
<!-- Preview Stats -->
|
|
1004
|
+
${m(this.body, () => l`
|
|
1005
|
+
<div class="flex-shrink-0">
|
|
1006
|
+
<schmancy-surface type="container" rounded="all" class="p-3">
|
|
1007
|
+
<div class="flex items-center justify-center gap-6 text-center">
|
|
1008
|
+
<div>
|
|
1009
|
+
<schmancy-typography type="body" token="xs" class="text-surface-onVariant">
|
|
1010
|
+
Characters
|
|
1011
|
+
</schmancy-typography>
|
|
1012
|
+
<schmancy-typography type="body" token="sm" class="font-medium">
|
|
1013
|
+
${this.body.length}
|
|
1014
|
+
</schmancy-typography>
|
|
1015
|
+
</div>
|
|
1016
|
+
<div class="w-px h-8 bg-outline-variant"></div>
|
|
1017
|
+
<div>
|
|
1018
|
+
<schmancy-typography type="body" token="xs" class="text-surface-onVariant">
|
|
1019
|
+
Words
|
|
1020
|
+
</schmancy-typography>
|
|
1021
|
+
<schmancy-typography type="body" token="sm" class="font-medium">
|
|
1022
|
+
${this.body.trim() ? this.body.trim().split(/\s+/).length : 0}
|
|
1023
|
+
</schmancy-typography>
|
|
1024
|
+
</div>
|
|
1025
|
+
${m(this.attachments.length > 0, () => l`
|
|
1026
|
+
<div class="w-px h-8 bg-outline-variant"></div>
|
|
1027
|
+
<div>
|
|
1028
|
+
<schmancy-typography type="body" token="xs" class="text-surface-onVariant">
|
|
1029
|
+
Attachments
|
|
1030
|
+
</schmancy-typography>
|
|
1031
|
+
<schmancy-typography type="body" token="sm" class="font-medium">
|
|
1032
|
+
${this.attachments.length}
|
|
1033
|
+
</schmancy-typography>
|
|
1034
|
+
</div>
|
|
1035
|
+
`)}
|
|
1036
|
+
</div>
|
|
1037
|
+
</schmancy-surface>
|
|
1038
|
+
</div>
|
|
1039
|
+
`)}
|
|
1040
|
+
|
|
1041
|
+
</div>
|
|
1042
|
+
</schmancy-surface>
|
|
1043
|
+
`;
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
w([h({ type: String })], $.prototype, "subject", 2), w([h({ type: String })], $.prototype, "body", 2), w([h({ type: Array })], $.prototype, "attachments", 2), w([h({ type: Array })], $.prototype, "recipients", 2), w([h({ type: String })], $.prototype, "fromAddress", 2), w([h({ type: String })], $.prototype, "toAddress", 2), w([u()], $.prototype, "viewMode", 2), $ = w([k("schmancy-email-viewer")], $);
|
|
1047
|
+
var H = Object.defineProperty, V = Object.getOwnPropertyDescriptor, f = (e, t, i, s) => {
|
|
1048
|
+
for (var a, n = s > 1 ? void 0 : s ? V(t, i) : t, c = e.length - 1; c >= 0; c--) (a = e[c]) && (n = (s ? a(t, i, n) : a(n)) || n);
|
|
1049
|
+
return s && n && H(t, i, n), n;
|
|
1050
|
+
};
|
|
1051
|
+
let g = class extends E(A`
|
|
1052
|
+
:host {
|
|
1053
|
+
display: block;
|
|
1054
|
+
height: 100%;
|
|
1055
|
+
}
|
|
1056
|
+
`) {
|
|
1057
|
+
constructor() {
|
|
1058
|
+
super(...arguments), this.disabled = !1, this.recipients = [], this.selectedRecipients = [], this.enableCsvImport = !0, this.enableDragDrop = !0, this.title = "Recipients", this.emptyStateTitle = "No recipients yet", this.emptyStateMessage = "Import from sources or upload a CSV", this.dragOver = !1, this.localSelectedRecipients = /* @__PURE__ */ new Set(), this.searchQuery = "", this.filteredRecipients = [], this.boatState = "minimized", this.fileInputRef = R(), this.handleEmailsImported = () => {
|
|
1059
|
+
this.updateFilteredRecipients(), this.requestUpdate();
|
|
1060
|
+
}, this.handleImportFromCSV = () => {
|
|
1061
|
+
this.enableCsvImport && this.fileInputRef.value?.click();
|
|
1062
|
+
}, this.handleFileSelect = (e) => {
|
|
1063
|
+
const t = e.target, i = t.files?.[0];
|
|
1064
|
+
i && this.processCSVFile(i);
|
|
1065
|
+
}, this.handleDrop = (e) => {
|
|
1066
|
+
if (!this.enableDragDrop) return;
|
|
1067
|
+
e.preventDefault(), this.dragOver = !1;
|
|
1068
|
+
const t = e.dataTransfer?.files[0];
|
|
1069
|
+
t && this.processCSVFile(t);
|
|
1070
|
+
}, this.processCSVFile = (e) => {
|
|
1071
|
+
if (!e.name.endsWith(".csv")) return void v.error("Please select a CSV file");
|
|
1072
|
+
const t = new FileReader();
|
|
1073
|
+
t.onload = (i) => {
|
|
1074
|
+
const s = i.target?.result;
|
|
1075
|
+
try {
|
|
1076
|
+
const a = this.parseCSV(s);
|
|
1077
|
+
if (a.length === 0) return void v.error("No valid email addresses found in CSV");
|
|
1078
|
+
this.dispatchEvent(new CustomEvent("emails-imported", { detail: { emails: a, source: "csv" }, bubbles: !0, composed: !0 })), v.success(`Imported ${a.length} emails from CSV file`);
|
|
1079
|
+
} catch {
|
|
1080
|
+
v.error("Failed to parse CSV file");
|
|
1081
|
+
}
|
|
1082
|
+
}, t.readAsText(e);
|
|
1083
|
+
}, this.toggleRecipientSelection = (e) => {
|
|
1084
|
+
this.localSelectedRecipients.has(e) ? this.localSelectedRecipients.delete(e) : this.localSelectedRecipients.add(e), this.localSelectedRecipients = new Set(this.localSelectedRecipients), this.dispatchSelectionChange();
|
|
1085
|
+
}, this.selectAll = () => {
|
|
1086
|
+
this.localSelectedRecipients = new Set(this.filteredRecipients), this.dispatchSelectionChange();
|
|
1087
|
+
}, this.selectNone = () => {
|
|
1088
|
+
this.localSelectedRecipients.clear(), this.localSelectedRecipients = /* @__PURE__ */ new Set(), this.dispatchSelectionChange();
|
|
1089
|
+
}, this.removeRecipient = (e) => {
|
|
1090
|
+
this.dispatchEvent(new CustomEvent("recipient-removed", { detail: { email: e }, bubbles: !0, composed: !0 }));
|
|
1091
|
+
}, this.clearAll = () => {
|
|
1092
|
+
this.dispatchEvent(new CustomEvent("recipients-cleared", { bubbles: !0, composed: !0 }));
|
|
1093
|
+
}, this.updateFilteredRecipients = () => {
|
|
1094
|
+
const e = Array.isArray(this.recipients) ? this.recipients : [];
|
|
1095
|
+
if (this.searchQuery.trim()) {
|
|
1096
|
+
const t = this.searchQuery.toLowerCase();
|
|
1097
|
+
this.filteredRecipients = e.filter((i) => i.toLowerCase().includes(t));
|
|
1098
|
+
} else this.filteredRecipients = [...e];
|
|
1099
|
+
}, this.handleSearchInput = (e) => {
|
|
1100
|
+
const t = e.target;
|
|
1101
|
+
this.searchQuery = t.value;
|
|
1102
|
+
}, this.clearSearch = () => {
|
|
1103
|
+
this.searchQuery = "";
|
|
1104
|
+
}, this.dispatchSelectionChange = () => {
|
|
1105
|
+
this.dispatchEvent(new CustomEvent("selection-changed", { detail: { selectedEmails: Array.from(this.localSelectedRecipients) }, bubbles: !0, composed: !0 }));
|
|
1106
|
+
}, this.handleBoatStateChange = (e) => {
|
|
1107
|
+
this.boatState = e.detail;
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
connectedCallback() {
|
|
1111
|
+
super.connectedCallback(), this.localSelectedRecipients = new Set(this.selectedRecipients), this.updateFilteredRecipients(), this.addEventListener("emails-imported", this.handleEmailsImported);
|
|
1112
|
+
}
|
|
1113
|
+
updated(e) {
|
|
1114
|
+
super.updated(e), e.has("selectedRecipients") && (this.localSelectedRecipients = new Set(this.selectedRecipients)), (e.has("recipients") || e.has("searchQuery")) && this.updateFilteredRecipients(), e.has("recipients") && this.requestUpdate();
|
|
1115
|
+
}
|
|
1116
|
+
parseCSV(e) {
|
|
1117
|
+
const t = [];
|
|
1118
|
+
let i;
|
|
1119
|
+
i = this.csvParser ? this.csvParser.parse(e, { header: !0, skipEmptyLines: !0, dynamicTyping: !0, delimiter: "", transformHeader: (r) => r.trim() }) : this.simpleCSVParse(e);
|
|
1120
|
+
const s = i.data, a = i.meta.fields || [];
|
|
1121
|
+
let n = a.find((r) => r.toLowerCase().includes("email"));
|
|
1122
|
+
if (!n) for (const r of a) {
|
|
1123
|
+
const o = s[0]?.[r]?.toString();
|
|
1124
|
+
if (o && this.isValidEmail(o)) {
|
|
1125
|
+
n = r;
|
|
1126
|
+
break;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
if (!n) throw new Error("No email column found in CSV");
|
|
1130
|
+
const c = /* @__PURE__ */ new Set();
|
|
1131
|
+
for (const r of s) {
|
|
1132
|
+
const o = r[n]?.toString();
|
|
1133
|
+
if (!o) continue;
|
|
1134
|
+
const d = o.toLowerCase().trim();
|
|
1135
|
+
this.isValidEmail(d) && !c.has(d) && (c.add(d), t.push(d));
|
|
1136
|
+
}
|
|
1137
|
+
return t;
|
|
1138
|
+
}
|
|
1139
|
+
simpleCSVParse(e) {
|
|
1140
|
+
const t = e.split(`
|
|
1141
|
+
`).filter((a) => a.trim());
|
|
1142
|
+
if (t.length === 0) return { data: [], meta: {} };
|
|
1143
|
+
const i = t[0].split(",").map((a) => a.trim().replace(/"/g, "")), s = [];
|
|
1144
|
+
for (let a = 1; a < t.length; a++) {
|
|
1145
|
+
const n = t[a].split(",").map((r) => r.trim().replace(/"/g, "")), c = {};
|
|
1146
|
+
i.forEach((r, o) => {
|
|
1147
|
+
c[r] = n[o] || "";
|
|
1148
|
+
}), s.push(c);
|
|
1149
|
+
}
|
|
1150
|
+
return { data: s, meta: { fields: i } };
|
|
1151
|
+
}
|
|
1152
|
+
isValidEmail(e) {
|
|
1153
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim());
|
|
1154
|
+
}
|
|
1155
|
+
addRecipients(e) {
|
|
1156
|
+
if (!e.length) return;
|
|
1157
|
+
const t = [.../* @__PURE__ */ new Set([...this.recipients, ...e])], i = e.filter((s) => !this.recipients.includes(s));
|
|
1158
|
+
this.recipients = t, this.selectedRecipients = [.../* @__PURE__ */ new Set([...this.selectedRecipients, ...i])], this.localSelectedRecipients = new Set(this.selectedRecipients), this.updateFilteredRecipients(), this.requestUpdate();
|
|
1159
|
+
}
|
|
1160
|
+
showBoat() {
|
|
1161
|
+
this.boatState = "minimized";
|
|
1162
|
+
}
|
|
1163
|
+
hideBoat() {
|
|
1164
|
+
this.boatState = "hidden";
|
|
1165
|
+
}
|
|
1166
|
+
expandBoat() {
|
|
1167
|
+
this.boatState = "expanded";
|
|
1168
|
+
}
|
|
1169
|
+
toggleBoat() {
|
|
1170
|
+
this.boatState = this.boatState === "hidden" ? "minimized" : this.boatState === "minimized" ? "expanded" : "hidden";
|
|
1171
|
+
}
|
|
1172
|
+
render() {
|
|
1173
|
+
return this.renderBoatLayout();
|
|
1174
|
+
}
|
|
1175
|
+
renderBoatLayout() {
|
|
1176
|
+
return l`
|
|
1177
|
+
<!-- Hidden file input for CSV import -->
|
|
1178
|
+
${m(this.enableCsvImport, () => l`
|
|
1179
|
+
<input
|
|
1180
|
+
type="file"
|
|
1181
|
+
accept=".csv"
|
|
1182
|
+
${C(this.fileInputRef)}
|
|
1183
|
+
@change=${this.handleFileSelect}
|
|
1184
|
+
class="hidden"
|
|
1185
|
+
/>
|
|
1186
|
+
`)}
|
|
1187
|
+
|
|
1188
|
+
<schmancy-boat
|
|
1189
|
+
.state=${this.boatState}
|
|
1190
|
+
@change=${this.handleBoatStateChange}
|
|
1191
|
+
>
|
|
1192
|
+
<!-- Boat Header -->
|
|
1193
|
+
<div slot="header" class="flex items-center justify-between w-full px-4 py-2">
|
|
1194
|
+
<div class="flex items-center gap-3">
|
|
1195
|
+
<schmancy-icon size="20px">group</schmancy-icon>
|
|
1196
|
+
<schmancy-typography type="title" token="md" class="font-semibold">
|
|
1197
|
+
${this.title}
|
|
1198
|
+
</schmancy-typography>
|
|
1199
|
+
${m(this.recipients.length > 0, () => l`
|
|
1200
|
+
<schmancy-badge>
|
|
1201
|
+
${this.localSelectedRecipients.size}/${this.recipients.length}
|
|
1202
|
+
</schmancy-badge>
|
|
1203
|
+
`)}
|
|
1204
|
+
</div>
|
|
1205
|
+
</div>
|
|
1206
|
+
|
|
1207
|
+
<!-- Boat Content -->
|
|
1208
|
+
<div class="h-full flex flex-col max-h-[70vh]">
|
|
1209
|
+
${this.renderBoatContent()}
|
|
1210
|
+
</div>
|
|
1211
|
+
</schmancy-boat>
|
|
1212
|
+
`;
|
|
1213
|
+
}
|
|
1214
|
+
renderBoatContent() {
|
|
1215
|
+
return l`
|
|
1216
|
+
<!-- Search Bar and CSV Import on one line -->
|
|
1217
|
+
<div class="p-4 flex gap-3">
|
|
1218
|
+
<schmancy-input
|
|
1219
|
+
type="text"
|
|
1220
|
+
placeholder="Search recipients"
|
|
1221
|
+
.value=${this.searchQuery}
|
|
1222
|
+
@input=${this.handleSearchInput}
|
|
1223
|
+
class="flex-1"
|
|
1224
|
+
>
|
|
1225
|
+
${m(this.searchQuery, () => l`
|
|
1226
|
+
<schmancy-button
|
|
1227
|
+
slot="suffix"
|
|
1228
|
+
variant="text"
|
|
1229
|
+
@click=${this.clearSearch}
|
|
1230
|
+
>
|
|
1231
|
+
<schmancy-icon size="16px">close</schmancy-icon>
|
|
1232
|
+
</schmancy-button>
|
|
1233
|
+
`)}
|
|
1234
|
+
</schmancy-input>
|
|
1235
|
+
|
|
1236
|
+
${m(this.enableCsvImport, () => l`
|
|
1237
|
+
<schmancy-button
|
|
1238
|
+
variant="outlined"
|
|
1239
|
+
@click=${this.handleImportFromCSV}
|
|
1240
|
+
?disabled=${this.disabled}
|
|
1241
|
+
>
|
|
1242
|
+
<schmancy-icon slot="prefix" size="16px">upload_file</schmancy-icon>
|
|
1243
|
+
Import
|
|
1244
|
+
</schmancy-button>
|
|
1245
|
+
`)}
|
|
1246
|
+
</div>
|
|
1247
|
+
|
|
1248
|
+
${m(this.recipients.length > 0, () => l`
|
|
1249
|
+
<!-- Bulk Actions -->
|
|
1250
|
+
<div class="px-4 pb-4">
|
|
1251
|
+
<div class="flex items-center gap-3">
|
|
1252
|
+
<schmancy-button
|
|
1253
|
+
variant="outlined"
|
|
1254
|
+
@click=${this.selectAll}
|
|
1255
|
+
?disabled=${this.localSelectedRecipients.size === this.filteredRecipients.length}
|
|
1256
|
+
>
|
|
1257
|
+
<schmancy-icon slot="prefix" size="14px">select_all</schmancy-icon>
|
|
1258
|
+
Select All
|
|
1259
|
+
</schmancy-button>
|
|
1260
|
+
|
|
1261
|
+
<schmancy-button
|
|
1262
|
+
variant="outlined"
|
|
1263
|
+
@click=${this.selectNone}
|
|
1264
|
+
?disabled=${this.localSelectedRecipients.size === 0}
|
|
1265
|
+
>
|
|
1266
|
+
<schmancy-icon slot="prefix" size="14px">deselect</schmancy-icon>
|
|
1267
|
+
Clear Selection
|
|
1268
|
+
</schmancy-button>
|
|
1269
|
+
|
|
1270
|
+
<div class="flex-1"></div>
|
|
1271
|
+
|
|
1272
|
+
<schmancy-button variant="text" @click=${this.clearAll}>
|
|
1273
|
+
<schmancy-icon slot="prefix" size="14px">delete_forever</schmancy-icon>
|
|
1274
|
+
Clear All
|
|
1275
|
+
</schmancy-button>
|
|
1276
|
+
</div>
|
|
1277
|
+
</div>
|
|
1278
|
+
|
|
1279
|
+
<!-- Recipients List -->
|
|
1280
|
+
<div class="flex-1 overflow-y-auto px-4 pb-4">
|
|
1281
|
+
${m(this.filteredRecipients.length > 0, () => l`
|
|
1282
|
+
<div class="flex flex-wrap gap-3">
|
|
1283
|
+
${I(this.filteredRecipients, (e) => e, (e) => l`
|
|
1284
|
+
<schmancy-button
|
|
1285
|
+
variant=${this.localSelectedRecipients.has(e) ? "filled" : "outlined"}
|
|
1286
|
+
@click=${(t) => {
|
|
1287
|
+
t.stopPropagation(), t.preventDefault(), this.toggleRecipientSelection(e);
|
|
1288
|
+
}}
|
|
1289
|
+
class="cursor-pointer flex items-center gap-2"
|
|
1290
|
+
>
|
|
1291
|
+
<span class="truncate flex-1 text-left">${e}</span>
|
|
1292
|
+
<schmancy-icon
|
|
1293
|
+
@click=${(t) => {
|
|
1294
|
+
t.stopPropagation(), this.removeRecipient(e);
|
|
1295
|
+
}}
|
|
1296
|
+
size="16px"
|
|
1297
|
+
class="ml-2"
|
|
1298
|
+
>close</schmancy-icon>
|
|
1299
|
+
</schmancy-button>
|
|
1300
|
+
`)}
|
|
1301
|
+
</div>
|
|
1302
|
+
`, () => l`
|
|
1303
|
+
<div class="text-center py-8">
|
|
1304
|
+
<schmancy-icon size="32px" class="opacity-50 mb-2">search_off</schmancy-icon>
|
|
1305
|
+
<schmancy-typography type="body" token="sm" class="mb-2">
|
|
1306
|
+
No recipients match "${this.searchQuery}"
|
|
1307
|
+
</schmancy-typography>
|
|
1308
|
+
<schmancy-button variant="outlined" @click=${this.clearSearch}>
|
|
1309
|
+
Clear Search
|
|
1310
|
+
</schmancy-button>
|
|
1311
|
+
</div>
|
|
1312
|
+
`)}
|
|
1313
|
+
</div>
|
|
1314
|
+
`, () => l`
|
|
1315
|
+
<!-- Empty State -->
|
|
1316
|
+
<div class="flex-1 flex items-center justify-center p-8">
|
|
1317
|
+
<div class="text-center space-y-4">
|
|
1318
|
+
<schmancy-icon size="48px" class="opacity-30">mail_outline</schmancy-icon>
|
|
1319
|
+
<schmancy-typography type="title" token="md" class="mb-2">
|
|
1320
|
+
${this.emptyStateTitle}
|
|
1321
|
+
</schmancy-typography>
|
|
1322
|
+
<schmancy-typography type="body" token="sm">
|
|
1323
|
+
${this.emptyStateMessage}
|
|
1324
|
+
</schmancy-typography>
|
|
1325
|
+
</div>
|
|
1326
|
+
</div>
|
|
1327
|
+
`)}
|
|
1328
|
+
|
|
1329
|
+
<!-- Drag Overlay -->
|
|
1330
|
+
${m(this.dragOver && this.enableDragDrop, () => l`
|
|
1331
|
+
<div
|
|
1332
|
+
class="absolute inset-4 flex items-center justify-center border-2 border-dashed border-primary rounded-lg z-10"
|
|
1333
|
+
@dragover=${(e) => {
|
|
1334
|
+
e.preventDefault(), this.dragOver = !0;
|
|
1335
|
+
}}
|
|
1336
|
+
@dragleave=${() => this.dragOver = !1}
|
|
1337
|
+
@drop=${this.handleDrop}
|
|
1338
|
+
>
|
|
1339
|
+
<schmancy-surface type="surfaceDim" rounded="all" class="p-6 text-center">
|
|
1340
|
+
<schmancy-icon size="48px" class="mb-2">upload</schmancy-icon>
|
|
1341
|
+
<schmancy-typography type="body" token="md">
|
|
1342
|
+
Drop CSV file here
|
|
1343
|
+
</schmancy-typography>
|
|
1344
|
+
</schmancy-surface>
|
|
1345
|
+
</div>
|
|
1346
|
+
`)}
|
|
1347
|
+
`;
|
|
1348
|
+
}
|
|
1349
|
+
};
|
|
1350
|
+
f([h({ type: Boolean })], g.prototype, "disabled", 2), f([h({ type: Array })], g.prototype, "recipients", 2), f([h({ type: Array })], g.prototype, "selectedRecipients", 2), f([h({ type: Boolean })], g.prototype, "enableCsvImport", 2), f([h({ type: Boolean })], g.prototype, "enableDragDrop", 2), f([h({ type: String })], g.prototype, "title", 2), f([h({ type: String })], g.prototype, "emptyStateTitle", 2), f([h({ type: String })], g.prototype, "emptyStateMessage", 2), f([h({ type: Object })], g.prototype, "csvParser", 2), f([u()], g.prototype, "dragOver", 2), f([u()], g.prototype, "localSelectedRecipients", 2), f([u()], g.prototype, "searchQuery", 2), f([u()], g.prototype, "filteredRecipients", 2), f([u()], g.prototype, "boatState", 2), g = f([k("schmancy-email-recipients")], g);
|
|
1351
|
+
export {
|
|
1352
|
+
p as S,
|
|
1353
|
+
b as a,
|
|
1354
|
+
$ as b,
|
|
1355
|
+
g as c,
|
|
1356
|
+
z as d
|
|
1357
|
+
};
|
|
1358
|
+
//# sourceMappingURL=email-recipients-DQ36ickQ.js.map
|