@mhmo91/schmancy 0.2.179 → 0.2.184
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{animated-text-CkOuJUK9.cjs → animated-text-BAEi04S6.cjs} +2 -2
- package/dist/{animated-text-CkOuJUK9.cjs.map → animated-text-BAEi04S6.cjs.map} +1 -1
- package/dist/{animated-text-Xt-2aEHG.js → animated-text-DhGPJ-G5.js} +3 -3
- package/dist/{animated-text-Xt-2aEHG.js.map → animated-text-DhGPJ-G5.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-DJpavQee.cjs → area.component-BAaqhl3k.cjs} +2 -2
- package/dist/{area.component-DJpavQee.cjs.map → area.component-BAaqhl3k.cjs.map} +1 -1
- package/dist/{area.component-CIz5wQ1b.js → area.component-DNmuUCm9.js} +3 -3
- package/dist/{area.component-CIz5wQ1b.js.map → area.component-DNmuUCm9.js.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-B1QsJ_x-.js → autocomplete-CuiPRSlC.js} +3 -3
- package/dist/{autocomplete-B1QsJ_x-.js.map → autocomplete-CuiPRSlC.js.map} +1 -1
- package/dist/{autocomplete-BeC5nqSA.cjs → autocomplete-DErik5Xw.cjs} +2 -2
- package/dist/{autocomplete-BeC5nqSA.cjs.map → autocomplete-DErik5Xw.cjs.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/{avatar-BF6652TX.cjs → avatar-BYgWyhEZ.cjs} +56 -25
- package/dist/avatar-BYgWyhEZ.cjs.map +1 -0
- package/dist/{avatar-nGtrl569.js → avatar-BwyUTdF_.js} +166 -135
- package/dist/avatar-BwyUTdF_.js.map +1 -0
- package/dist/badge.cjs +1 -1
- package/dist/badge.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-D2rdBv1d.cjs → checkbox-DI4NuFAx.cjs} +2 -2
- package/dist/{checkbox-D2rdBv1d.cjs.map → checkbox-DI4NuFAx.cjs.map} +1 -1
- package/dist/{checkbox-BDBWkxtE.js → checkbox-DcIrn_Wq.js} +2 -2
- package/dist/{checkbox-BDBWkxtE.js.map → checkbox-DcIrn_Wq.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-CEEnmVL5.js → chips-BL-ltDVQ.js} +3 -3
- package/dist/{chips-CEEnmVL5.js.map → chips-BL-ltDVQ.js.map} +1 -1
- package/dist/{chips-SeAzMV_K.cjs → chips-CkgwKojL.cjs} +2 -2
- package/dist/{chips-SeAzMV_K.cjs.map → chips-CkgwKojL.cjs.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +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-CYUXWjf7.js → date-range-SzxBN8Rn.js} +3 -3
- package/dist/{date-range-CYUXWjf7.js.map → date-range-SzxBN8Rn.js.map} +1 -1
- package/dist/{date-range-B6vemmh0.cjs → date-range-YVE-UrJS.cjs} +2 -2
- package/dist/{date-range-B6vemmh0.cjs.map → date-range-YVE-UrJS.cjs.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-D7tikEF6.js → delay-BPbI-RNJ.js} +2 -2
- package/dist/{delay-D7tikEF6.js.map → delay-BPbI-RNJ.js.map} +1 -1
- package/dist/{delay-CAcU-vht.cjs → delay-CH5NYBY7.cjs} +2 -2
- package/dist/{delay-CAcU-vht.cjs.map → delay-CH5NYBY7.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{dialog-service-Dp9n-iYw.js → dialog-service-DmKX7FDG.js} +60 -76
- package/dist/dialog-service-DmKX7FDG.js.map +1 -0
- package/dist/dialog-service-DqApS78r.cjs +49 -0
- package/dist/dialog-service-DqApS78r.cjs.map +1 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-fs54fGfB.cjs → divider-BFD3qlpM.cjs} +2 -2
- package/dist/{divider-fs54fGfB.cjs.map → divider-BFD3qlpM.cjs.map} +1 -1
- package/dist/{divider-6PQ2zS2m.js → divider-BL4lnwZy.js} +3 -3
- package/dist/{divider-6PQ2zS2m.js.map → divider-BL4lnwZy.js.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{dropdown-content-Dxra1QoF.js → dropdown-content-BEiowQZ8.js} +3 -3
- package/dist/{dropdown-content-Dxra1QoF.js.map → dropdown-content-BEiowQZ8.js.map} +1 -1
- package/dist/{dropdown-content-KHVgwXu2.cjs → dropdown-content-DNNtXu16.cjs} +2 -2
- package/dist/{dropdown-content-KHVgwXu2.cjs.map → dropdown-content-DNNtXu16.cjs.map} +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-B_52M97W.cjs → flex-B7APKtrH.cjs} +2 -2
- package/dist/{flex-B_52M97W.cjs.map → flex-B7APKtrH.cjs.map} +1 -1
- package/dist/{flex-Ba1VHord.js → flex-BSL-IFKp.js} +2 -2
- package/dist/{flex-Ba1VHord.js.map → flex-BSL-IFKp.js.map} +1 -1
- package/dist/{form-BT700HyQ.js → form-C94CbzJg.js} +2 -2
- package/dist/{form-BT700HyQ.js.map → form-C94CbzJg.js.map} +1 -1
- package/dist/{form-DJ9KHgsz.cjs → form-IUb8CPsc.cjs} +2 -2
- package/dist/{form-DJ9KHgsz.cjs.map → form-IUb8CPsc.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-0HBHJdBz.js → icon-BxZTVwvU.js} +3 -3
- package/dist/{icon-0HBHJdBz.js.map → icon-BxZTVwvU.js.map} +1 -1
- package/dist/{icon-ByVRi1IP.cjs → icon-D5NFCVL-.cjs} +2 -2
- package/dist/{icon-ByVRi1IP.cjs.map → icon-D5NFCVL-.cjs.map} +1 -1
- package/dist/{icon-button-Bt-ZY_dS.cjs → icon-button-D7AWWFQH.cjs} +2 -2
- package/dist/{icon-button-Bt-ZY_dS.cjs.map → icon-button-D7AWWFQH.cjs.map} +1 -1
- package/dist/{icon-button-YUz9lEvX.js → icon-button-I7gYsJRy.js} +3 -3
- package/dist/{icon-button-YUz9lEvX.js.map → icon-button-I7gYsJRy.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 +38 -38
- package/dist/{input-5LPv7UUL.cjs → input-C2w1MOUz.cjs} +2 -2
- package/dist/{input-5LPv7UUL.cjs.map → input-C2w1MOUz.cjs.map} +1 -1
- package/dist/{input-B_PdFYbP.js → input-ykJRRidv.js} +2 -2
- package/dist/{input-B_PdFYbP.js.map → input-ykJRRidv.js.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-C-r1rTUh.cjs → list-BdqnqwJo.cjs} +2 -2
- package/dist/{list-C-r1rTUh.cjs.map → list-BdqnqwJo.cjs.map} +1 -1
- package/dist/{list-DLxupHod.js → list-CpJuuk0j.js} +2 -2
- package/dist/{list-DLxupHod.js.map → list-CpJuuk0j.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-DLa9lBCo.cjs → litElement.mixin-DiwfL0tu.cjs} +2 -2
- package/dist/{litElement.mixin-DLa9lBCo.cjs.map → litElement.mixin-DiwfL0tu.cjs.map} +1 -1
- package/dist/{litElement.mixin-COog0CXV.js → litElement.mixin-vo7nRHAa.js} +2 -2
- package/dist/{litElement.mixin-COog0CXV.js.map → litElement.mixin-vo7nRHAa.js.map} +1 -1
- package/dist/{menu-DPHp4gMi.js → menu-AIxfPp33.js} +3 -3
- package/dist/{menu-DPHp4gMi.js.map → menu-AIxfPp33.js.map} +1 -1
- package/dist/{menu-EAL2iLY1.cjs → menu-BcTyOQZD.cjs} +2 -2
- package/dist/{menu-EAL2iLY1.cjs.map → menu-BcTyOQZD.cjs.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/{notification-service-MrCfqWvW.js → notification-service-Bv3QP-o4.js} +103 -86
- package/dist/notification-service-Bv3QP-o4.js.map +1 -0
- package/dist/notification-service-m4UPhHgL.cjs +141 -0
- package/dist/notification-service-m4UPhHgL.cjs.map +1 -0
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-DNdHkboR.js → option-Cb9gjwRp.js} +2 -2
- package/dist/{option-DNdHkboR.js.map → option-Cb9gjwRp.js.map} +1 -1
- package/dist/{option-BHrf1jEo.cjs → option-Dzesvfvz.cjs} +2 -2
- package/dist/{option-BHrf1jEo.cjs.map → option-Dzesvfvz.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-BZ8owKyu.cjs → payment-card-form-D9KX1kSR.cjs} +2 -2
- package/dist/{payment-card-form-BZ8owKyu.cjs.map → payment-card-form-D9KX1kSR.cjs.map} +1 -1
- package/dist/{payment-card-form-BidM0Uhz.js → payment-card-form-S1sRlrgq.js} +3 -3
- package/dist/{payment-card-form-BidM0Uhz.js.map → payment-card-form-S1sRlrgq.js.map} +1 -1
- package/dist/{radio-group-ay0sh7ZE.js → radio-group-DdqAPgzK.js} +2 -2
- package/dist/{radio-group-ay0sh7ZE.js.map → radio-group-DdqAPgzK.js.map} +1 -1
- package/dist/{radio-group-BeCwdi7V.cjs → radio-group-l74bQ1Nl.cjs} +2 -2
- package/dist/{radio-group-BeCwdi7V.cjs.map → radio-group-l74bQ1Nl.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{schmancy-steps-container-C7zsS6C6.js → schmancy-steps-container-BiUnWy6H.js} +2 -2
- package/dist/{schmancy-steps-container-C7zsS6C6.js.map → schmancy-steps-container-BiUnWy6H.js.map} +1 -1
- package/dist/{schmancy-steps-container-b2ccybFR.cjs → schmancy-steps-container-CFnGlw1m.cjs} +2 -2
- package/dist/{schmancy-steps-container-b2ccybFR.cjs.map → schmancy-steps-container-CFnGlw1m.cjs.map} +1 -1
- package/dist/{select-BXous56R.js → select-DnXezNTS.js} +3 -3
- package/dist/{select-BXous56R.js.map → select-DnXezNTS.js.map} +1 -1
- package/dist/{select-C6GpEJgA.cjs → select-rBWiHljv.cjs} +2 -2
- package/dist/{select-C6GpEJgA.cjs.map → select-rBWiHljv.cjs.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{sheet-DOkKWfz2.js → sheet-CBEF7EAx.js} +3 -3
- package/dist/{sheet-DOkKWfz2.js.map → sheet-CBEF7EAx.js.map} +1 -1
- package/dist/{sheet-DPkzSrBn.cjs → sheet-DMxlpzAP.cjs} +2 -2
- package/dist/{sheet-DPkzSrBn.cjs.map → sheet-DMxlpzAP.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-B0lO6KRr.cjs → slider-8JuaGGiq.cjs} +2 -2
- package/dist/{slider-B0lO6KRr.cjs.map → slider-8JuaGGiq.cjs.map} +1 -1
- package/dist/{slider-DOEXErC5.js → slider-ChmRrorI.js} +3 -3
- package/dist/{slider-DOEXErC5.js.map → slider-ChmRrorI.js.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-CQOXrtow.js → spinner-Cx-GWgNp.js} +3 -3
- package/dist/{spinner-CQOXrtow.js.map → spinner-Cx-GWgNp.js.map} +1 -1
- package/dist/{spinner-DDvtIu98.cjs → spinner-D9V2GA_A.cjs} +2 -2
- package/dist/{spinner-DDvtIu98.cjs.map → spinner-D9V2GA_A.cjs.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/{surface-Dl4S5qYM.cjs → surface-CV4Khong.cjs} +2 -2
- package/dist/{surface-Dl4S5qYM.cjs.map → surface-CV4Khong.cjs.map} +1 -1
- package/dist/{surface-F1HQR3OS.js → surface-OND0TEqD.js} +2 -2
- package/dist/{surface-F1HQR3OS.js.map → surface-OND0TEqD.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-nUo4-lAM.cjs → table-cYNDiHTJ.cjs} +2 -2
- package/dist/{table-nUo4-lAM.cjs.map → table-cYNDiHTJ.cjs.map} +1 -1
- package/dist/{table-CGsVUEWl.js → table-n1DqMDki.js} +2 -2
- package/dist/{table-CGsVUEWl.js.map → table-n1DqMDki.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-group-C2RLxc1l.cjs → tabs-group-CfRiO3NP.cjs} +2 -2
- package/dist/{tabs-group-C2RLxc1l.cjs.map → tabs-group-CfRiO3NP.cjs.map} +1 -1
- package/dist/{tabs-group-FdbxH4M2.js → tabs-group-R7j5l5H-.js} +2 -2
- package/dist/{tabs-group-FdbxH4M2.js.map → tabs-group-R7j5l5H-.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{tailwind.mixin-qCpNU5bd.js → tailwind.mixin-Bne2X3xd.js} +2 -2
- package/dist/{tailwind.mixin-qCpNU5bd.js.map → tailwind.mixin-Bne2X3xd.js.map} +1 -1
- package/dist/{tailwind.mixin-C1TWeByU.cjs → tailwind.mixin-Dg65LrA_.cjs} +2 -2
- package/dist/{tailwind.mixin-C1TWeByU.cjs.map → tailwind.mixin-Dg65LrA_.cjs.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-Cjez0oFA.cjs → textarea-6qrdQDUV.cjs} +2 -2
- package/dist/{textarea-Cjez0oFA.cjs.map → textarea-6qrdQDUV.cjs.map} +1 -1
- package/dist/{textarea-4PL9LQT_.js → textarea-CXmKiBQx.js} +2 -2
- package/dist/{textarea-4PL9LQT_.js.map → textarea-CXmKiBQx.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-D19t0FIY.js → theme-button-C8LA_gnm.js} +2 -2
- package/dist/{theme-button-D19t0FIY.js.map → theme-button-C8LA_gnm.js.map} +1 -1
- package/dist/{theme-button-B0wpbNVl.cjs → theme-button-CkmIJuH2.cjs} +2 -2
- package/dist/{theme-button-B0wpbNVl.cjs.map → theme-button-CkmIJuH2.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-iEu6bM2h.cjs → theme.component-BRozWeb_.cjs} +2 -2
- package/dist/{theme.component-iEu6bM2h.cjs.map → theme.component-BRozWeb_.cjs.map} +1 -1
- package/dist/{theme.component-C7j176AP.js → theme.component-CznJ2sba.js} +2 -2
- package/dist/{theme.component-C7j176AP.js.map → theme.component-CznJ2sba.js.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-DRyTNStR.cjs → timezone-BpEReA4Q.cjs} +2 -2
- package/dist/{timezone-DRyTNStR.cjs.map → timezone-BpEReA4Q.cjs.map} +1 -1
- package/dist/{timezone-BwvYFc82.js → timezone-C4yDzDx_.js} +3 -3
- package/dist/{timezone-BwvYFc82.js.map → timezone-C4yDzDx_.js.map} +1 -1
- package/dist/{tooltip-BsjGf8jh.cjs → tooltip-BOzRGoik.cjs} +2 -2
- package/dist/{tooltip-BsjGf8jh.cjs.map → tooltip-BOzRGoik.cjs.map} +1 -1
- package/dist/{tooltip-hdpdVnSj.js → tooltip-D8c1qu-0.js} +2 -2
- package/dist/{tooltip-hdpdVnSj.js.map → tooltip-D8c1qu-0.js.map} +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-V6zBBSFp.js → tree-Djtylxg3.js} +2 -2
- package/dist/{tree-V6zBBSFp.js.map → tree-Djtylxg3.js.map} +1 -1
- package/dist/{tree-DM5TVX_j.cjs → tree-PR1A8SwB.cjs} +2 -2
- package/dist/{tree-DM5TVX_j.cjs.map → tree-PR1A8SwB.cjs.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-Bj9qdc_5.js → typewriter-BZHC-sUN.js} +4 -4
- package/dist/{typewriter-Bj9qdc_5.js.map → typewriter-BZHC-sUN.js.map} +1 -1
- package/dist/{typewriter-CYLG1mNR.cjs → typewriter-CmlPmEWp.cjs} +2 -2
- package/dist/{typewriter-CYLG1mNR.cjs.map → typewriter-CmlPmEWp.cjs.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-BRnX9hbT.js → typography-BZIT81T6.js} +2 -2
- package/dist/{typography-BRnX9hbT.js.map → typography-BZIT81T6.js.map} +1 -1
- package/dist/{typography-n-wJY4zw.cjs → typography-CMOaUfF9.cjs} +2 -2
- package/dist/{typography-n-wJY4zw.cjs.map → typography-CMOaUfF9.cjs.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +1 -1
- package/types/src/badge/badge.d.ts +2 -0
- package/types/src/dialog/dailog.d.ts +5 -4
- package/types/src/dialog/dialog-service.d.ts +1 -1
- package/dist/avatar-BF6652TX.cjs.map +0 -1
- package/dist/avatar-nGtrl569.js.map +0 -1
- package/dist/dialog-service-Dp9n-iYw.js.map +0 -1
- package/dist/dialog-service-O39dDHTt.cjs +0 -65
- package/dist/dialog-service-O39dDHTt.cjs.map +0 -1
- package/dist/notification-service-MrCfqWvW.js.map +0 -1
- package/dist/notification-service-PbxB-uRp.cjs +0 -124
- package/dist/notification-service-PbxB-uRp.cjs.map +0 -1
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";require("rxjs"),require("lit/directives/class-map.js");const p=require("lit/directives/style-map.js"),f=require("./litElement.mixin-DLa9lBCo.cjs");require("./tailwind.mixin-C1TWeByU.cjs");const l=require("lit"),m=require("lit/decorators.js"),g=require("lit/directives/when.js");var y=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=(t,i,e,n)=>{for(var o,s=n>1?void 0:n?u(i,e):i,a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n?o(i,e,s):o(s))||s);return n&&s&&y(i,e,s),s};exports.ConfirmDialog=class extends f.$LitElement(l.css`
|
|
2
|
-
:host {
|
|
3
|
-
position: fixed;
|
|
4
|
-
z-index: 10000;
|
|
5
|
-
inset: 0;
|
|
6
|
-
display: none;
|
|
7
|
-
--dialog-width: 360px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:host([active]) {
|
|
11
|
-
display: block;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.overlay {
|
|
15
|
-
position: fixed;
|
|
16
|
-
inset: 0;
|
|
17
|
-
background: rgba(0, 0, 0, 0.4);
|
|
18
|
-
animation: fade-in 150ms ease;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.dialog {
|
|
22
|
-
position: absolute;
|
|
23
|
-
max-width: var(--dialog-width);
|
|
24
|
-
width: max-content;
|
|
25
|
-
animation: pop-in 150ms ease;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@keyframes pop-in {
|
|
29
|
-
from {
|
|
30
|
-
opacity: 0;
|
|
31
|
-
transform: scale(0.9);
|
|
32
|
-
}
|
|
33
|
-
to {
|
|
34
|
-
opacity: 1;
|
|
35
|
-
transform: scale(1);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@keyframes fade-in {
|
|
40
|
-
from {
|
|
41
|
-
opacity: 0;
|
|
42
|
-
}
|
|
43
|
-
to {
|
|
44
|
-
opacity: 1;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`){constructor(){super(...arguments),this.title=void 0,this.message=void 0,this.confirmText="Confirm",this.cancelText="Cancel",this.variant="default",this.position={x:0,y:0}}async show(t){let i,e;if("clientX"in t)i=t.clientX,e=t.clientY;else if("touches"in t&&t.touches.length)i=t.touches[0].clientX,e=t.touches[0].clientY;else{const n=t;i=n.x,e=n.y}return this.position=this.calculatePosition(i,e),this.setAttribute("active",""),new Promise(n=>{this.resolvePromise=n})}hide(t=!1){this.removeAttribute("active"),this.resolvePromise&&(this.resolvePromise(t),this.resolvePromise=void 0)}calculatePosition(t,i){return{x:t,y:i}}firstUpdated(){setTimeout(()=>{var h;const t=(h=this.shadowRoot)==null?void 0:h.querySelector(".dialog");if(!t)return;const i=t.offsetWidth,e=t.offsetHeight,n=window.innerWidth,o=window.innerHeight;let{x:s,y:a}=this.position;s+i>n-16&&(s=Math.max(16,n-i-16)),a+e>o-16&&(a=a>e+32?a-e-16:16),t.style.left=`${s}px`,t.style.top=`${a}px`},0)}handleConfirm(){this.hide(!0),this.dispatchEvent(new CustomEvent("confirm",{bubbles:!0,composed:!0}))}handleCancel(){this.hide(!1),this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))}render(){const t={left:`${this.position.x}px`,top:`${this.position.y}px`},i=this.querySelectorAll('[slot="content"]').length>0;return l.html`
|
|
48
|
-
<div class="overlay" @click=${this.handleCancel}></div>
|
|
49
|
-
|
|
50
|
-
<div class="dialog" style=${p.styleMap(t)} role="alertdialog" aria-modal="true">
|
|
51
|
-
<schmancy-surface rounded="all" elevation="3" type="containerHigh">
|
|
52
|
-
<schmancy-form @submit=${this.handleConfirm} class="p-4">
|
|
53
|
-
${g.when(this.title,()=>l.html` <schmancy-typography type="title" token="md" class="mb-2"> ${this.title} </schmancy-typography>`)}
|
|
54
|
-
${i?l.html`<div class="mb-4"><slot name="content"></slot></div>`:l.html`<schmancy-typography type="body" class="mb-4"> ${this.message} </schmancy-typography>`}
|
|
55
|
-
|
|
56
|
-
<div class="flex justify-end gap-3">
|
|
57
|
-
<schmancy-button variant="outlined" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>
|
|
58
|
-
|
|
59
|
-
<schmancy-button type="submit" variant="filled"> ${this.confirmText} </schmancy-button>
|
|
60
|
-
</div>
|
|
61
|
-
</schmancy-form>
|
|
62
|
-
</schmancy-surface>
|
|
63
|
-
</div>
|
|
64
|
-
`}static async confirm(t){let i=document.querySelector("confirm-dialog");return i||(i=document.createElement("confirm-dialog"),document.body.appendChild(i)),t.title&&(i.title=t.title),t.message&&(i.message=t.message),t.confirmText&&(i.confirmText=t.confirmText),t.cancelText&&(i.cancelText=t.cancelText),t.variant&&(i.variant=t.variant),t.width&&i.style.setProperty("--dialog-width",t.width),i.show(t.position)}static async ask(t,i){return this.confirm({message:i,position:t})}},d([m.property({type:String})],exports.ConfirmDialog.prototype,"title",2),d([m.property({type:String})],exports.ConfirmDialog.prototype,"message",2),d([m.property({type:String,attribute:"confirm-text"})],exports.ConfirmDialog.prototype,"confirmText",2),d([m.property({type:String,attribute:"cancel-text"})],exports.ConfirmDialog.prototype,"cancelText",2),d([m.property({type:String})],exports.ConfirmDialog.prototype,"variant",2),exports.ConfirmDialog=d([m.customElement("confirm-dialog")],exports.ConfirmDialog);const c=class c{constructor(){this.activeDialogs=[]}static getInstance(){return c.instance||(c.instance=new c),c.instance}confirm(i){const e={...c.DEFAULT_OPTIONS,...i};e.position||(e.position=this.getCenteredPosition());let n=document.querySelector("confirm-dialog");if(n||(n=document.createElement("confirm-dialog"),document.body.appendChild(n)),e.title&&(n.title=e.title),e.message&&(n.message=e.message),e.confirmText&&(n.confirmText=e.confirmText),e.cancelText&&(n.cancelText=e.cancelText),e.variant&&(n.variant=e.variant),e.width&&n.style.setProperty("--dialog-width",e.width),e.content){const o=document.createElement("div");if(o.slot="content",typeof e.content=="function"){const s=e.content();s instanceof HTMLElement?o.appendChild(s):l.render(s,o)}else e.content instanceof HTMLElement?o.appendChild(e.content):l.render(e.content,o);n.appendChild(o)}if(e.onConfirm){const o=s=>{e.onConfirm(),n.removeEventListener("confirm",o)};n.addEventListener("confirm",o)}if(e.onCancel){const o=s=>{e.onCancel(),n.removeEventListener("cancel",o)};n.addEventListener("cancel",o)}return this.activeDialogs.push(n),n.show(e.position).finally(()=>{const o=this.activeDialogs.indexOf(n);if(o!==-1&&this.activeDialogs.splice(o,1),e.content){const s=n.querySelector('[slot="content"]');s&&n.removeChild(s)}})}dismiss(){return this.activeDialogs.length===0?!1:(this.activeDialogs[this.activeDialogs.length-1].hide(!1),!0)}ask(i,e){return this.confirm({message:i,position:e||this.getCenteredPosition()})}danger(i){return this.confirm({...i,variant:"danger"})}component(i,e={position:this.getCenteredPosition()}){return this.confirm({...e,content:i,title:void 0,message:void 0})}getCenteredPosition(){return{x:window.innerWidth/2,y:window.innerHeight/2}}};c.DEFAULT_OPTIONS={title:void 0,confirmText:void 0,cancelText:"Cancel",variant:"default",width:"360px"};let r=c;const v={confirm:t=>r.getInstance().confirm(t),ask:(t,i)=>r.getInstance().ask(t,i),danger:t=>r.getInstance().danger(t),component:(t,i)=>r.getInstance().component(t,i),dismiss:()=>r.getInstance().dismiss()};exports.$dialog=v,exports.DialogService=r;
|
|
65
|
-
//# sourceMappingURL=dialog-service-O39dDHTt.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-service-O39dDHTt.cjs","sources":["../src/dialog/dailog.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { when } from 'lit/directives/when.js'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t\tanimation: fade-in 150ms ease;\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tanimation: pop-in 150ms ease;\n\t}\n\n\t@keyframes pop-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.9);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t}\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Set position and make dialog visible\n\t\tthis.position = this.calculatePosition(x, y)\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Calculate optimal position based on click coordinates\n\t */\n\tprivate calculatePosition(x: number, y: number) {\n\t\t// Default to click position\n\t\treturn { x, y }\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\t// Optimize position after first render when we know the size\n\t\tsetTimeout(() => {\n\t\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\t\tif (!dialog) return\n\n\t\t\t// Get dialog dimensions\n\t\t\tconst width = dialog.offsetWidth\n\t\t\tconst height = dialog.offsetHeight\n\n\t\t\t// Get viewport dimensions\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Reposition if needed to keep dialog in viewport\n\t\t\tlet { x, y } = this.position\n\n\t\t\t// Make sure dialog stays within viewport horizontally\n\t\t\tif (x + width > viewportWidth - 16) {\n\t\t\t\tx = Math.max(16, viewportWidth - width - 16)\n\t\t\t}\n\n\t\t\t// Make sure dialog stays within viewport vertically\n\t\t\tif (y + height > viewportHeight - 16) {\n\t\t\t\t// Position above if space available, otherwise at top\n\t\t\t\tif (y > height + 32) {\n\t\t\t\t\ty = y - height - 16\n\t\t\t\t} else {\n\t\t\t\t\ty = 16\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update dialog position\n\t\t\tdialog.style.left = `${x}px`\n\t\t\tdialog.style.top = `${y}px`\n\t\t}, 0)\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\tconst dialogStyles = {\n\t\t\tleft: `${this.position.x}px`,\n\t\t\ttop: `${this.position.y}px`,\n\t\t}\n\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" style=${styleMap(dialogStyles)} role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} class=\"p-4\">\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title,\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\thtml` <schmancy-typography type=\"title\" token=\"md\" class=\"mb-2\"> ${this.title} </schmancy-typography>`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"mb-4\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`}\n\n\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\n\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\"> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass the event and message\n\t */\n\tstatic async ask(event: MouseEvent | TouchEvent, message: string): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { render, TemplateResult } from 'lit'\nimport { ConfirmDialog } from './dailog'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tposition: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: 'Cancel',\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\t// Apply default options\n\t\tconst completeOptions = {\n\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t}\n\n\t\t// If no position is provided, center the dialog\n\t\tif (!completeOptions.position) {\n\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t}\n\n\t\t// Create or find the dialog\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set basic options\n\t\tif (completeOptions.title) dialog.title = completeOptions.title\n\t\tif (completeOptions.message) dialog.message = completeOptions.message\n\t\tif (completeOptions.confirmText) dialog.confirmText = completeOptions.confirmText\n\t\tif (completeOptions.cancelText) dialog.cancelText = completeOptions.cancelText\n\t\tif (completeOptions.variant) dialog.variant = completeOptions.variant\n\t\tif (completeOptions.width) dialog.style.setProperty('--dialog-width', completeOptions.width)\n\n\t\t// Handle custom content if provided\n\t\tif (completeOptions.content) {\n\t\t\tconst contentContainer = document.createElement('div')\n\t\t\tcontentContainer.slot = 'content'\n\n\t\t\tif (typeof completeOptions.content === 'function') {\n\t\t\t\tconst result = completeOptions.content()\n\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t} else {\n\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t}\n\t\t\t} else if (completeOptions.content instanceof HTMLElement) {\n\t\t\t\tcontentContainer.appendChild(completeOptions.content)\n\t\t\t} else {\n\t\t\t\trender(completeOptions.content, contentContainer)\n\t\t\t}\n\n\t\t\tdialog.appendChild(contentContainer)\n\t\t}\n\n\t\t// Set up event listeners for optional callbacks\n\t\tif (completeOptions.onConfirm) {\n\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\tcompleteOptions.onConfirm!()\n\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t}\n\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t}\n\n\t\tif (completeOptions.onCancel) {\n\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\tcompleteOptions.onCancel!()\n\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t}\n\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t}\n\n\t\t// Add this dialog to active dialogs\n\t\tthis.activeDialogs.push(dialog)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(completeOptions.position).finally(() => {\n\t\t\t// Remove from active dialogs when closed\n\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t}\n\n\t\t\t// Clean up the content when dialog closes\n\t\t\tif (completeOptions.content) {\n\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\tif (contentEl) {\n\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\tif (this.activeDialogs.length === 0) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Get the most recently opened dialog (last in the array)\n\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\n\t\t// Hide the dialog (with cancel result)\n\t\tdialog.hide(false)\n\n\t\treturn true\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event || this.getCenteredPosition(),\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = { position: this.getCenteredPosition() },\n\t): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tcontent,\n\t\t\t// Clear message if content is provided\n\t\t\ttitle: undefined,\n\t\t\tmessage: undefined,\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService\n"],"names":["ConfirmDialog","$LitElement","css","constructor","super","arguments","this","title","message","confirmText","cancelText","variant","position","x","y","show","positionOrEvent","clientX","clientY","touches","length","pos","calculatePosition","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","firstUpdated","setTimeout","dialog","shadowRoot","querySelector","width","offsetWidth","height","offsetHeight","viewportWidth","window","innerWidth","viewportHeight","innerHeight","Math","max","style","left","top","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","render","dialogStyles","hasCustomContent","querySelectorAll","html","handleCancel","styleMap","when","options","document","createElement","body","appendChild","setProperty","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","DialogService","activeDialogs","instance","completeOptions","DEFAULT_OPTIONS","getCenteredPosition","content","contentContainer","slot","result","HTMLElement","onConfirm","_e","removeEventListener","addEventListener","onCancel","push","finally","index","indexOf","splice","contentEl","removeChild","dismiss","_r","$dialog","getInstance","ask","danger","component"],"mappings":"meAaaA,QAAAA,cAAN,cAA4BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAxC,aAAAC,CAAAC,MAAAC,GAAAA,SAAAA,EAmDEC,KAAAC,MAAAA,OAMED,KAAAE,QAAA,OAMIF,KAAAG,YAAA,UAMDH,KAAAI,WAAA,SAMmBJ,KAAAK,QAAA,UAKhCL,KAAQM,SAAW,CAAEC,EAAG,EAAGC,EAAG,CAAE,CAAA,CAWhC,MAAMC,KAAKC,GAEV,IAAIH,EAAWC,EAEf,GAAI,YAAaE,EAEhBH,EAAIG,EAAgB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AAAA,EAOjDqC,OAAS3C,GACDe,EAAc0B,YAAAA,EAAcE,OAAO3C,CAAAA,EAO3C4C,UAAW,CACVvB,EACArB,IAEOe,EAAc0B,YAAAA,EAAcG,UAAUvB,EAASrB,CAOvDsC,EAAAA,QAAS,IACDvB,EAAc0B,YAAcH,EAAAA,QAAAA,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-service-MrCfqWvW.js","sources":["../src/notification/notification.ts","../src/notification/notification-audio-generator.ts","../src/notification/notification-audio.ts","../src/notification/notification-container.ts","../src/notification/notification-service.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { color } from '@schmancy/directives'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\nimport { html, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport style from './notification.scss?inline'\n\nexport type NotificationType = 'info' | 'success' | 'warning' | 'error'\n\n/**\n * @fires close - When notification is closed\n */\n@customElement('sch-notification')\nexport default class SchmancyNotification extends $LitElement(style) {\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) message = ''\n\t@property({ type: String }) type: NotificationType = 'info'\n\t@property({ type: Boolean }) closable = true\n\t@property({ type: Number }) duration = 5000 // 0 means no auto-close\n\t@property({ type: String }) id = `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\t@property({ type: Boolean }) playSound = true\n\n\t@state() private _visible = true\n\t@state() private _progress = 100\n\t@state() private _hovered = false\n\t@state() private _closing = false\n\t@state() private _autoCloseTimer?: number\n\t@state() private _progressTimer?: number\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\tif (this.duration > 0) {\n\t\t\tthis._startAutoCloseTimer()\n\t\t}\n\n\t\tif (this.playSound) {\n\t\t\tthis._playSound()\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis._clearTimers()\n\t\tsuper.disconnectedCallback()\n\t}\n\n\tupdated(changedProps: PropertyValues) {\n\t\tsuper.updated(changedProps)\n\n\t\tif (changedProps.has('duration') && this.duration > 0) {\n\t\t\tthis._clearTimers()\n\t\t\tthis._startAutoCloseTimer()\n\t\t}\n\t}\n\n\tprivate _startAutoCloseTimer() {\n\t\tif (this.duration <= 0) return\n\n\t\tconst startTime = Date.now()\n\t\tconst endTime = startTime + this.duration\n\n\t\t// Setup the auto-close timer\n\t\tthis._autoCloseTimer = window.setTimeout(() => {\n\t\t\tthis.close()\n\t\t}, this.duration)\n\n\t\t// Setup the progress timer to update every 16ms (60fps)\n\t\tthis._progressTimer = window.setInterval(() => {\n\t\t\tif (this._hovered) return\n\n\t\t\tconst now = Date.now()\n\t\t\tconst remaining = Math.max(0, endTime - now)\n\t\t\tthis._progress = (remaining / this.duration) * 100\n\n\t\t\tif (remaining <= 0) {\n\t\t\t\tthis._clearTimers()\n\t\t\t}\n\t\t}, 16)\n\t}\n\n\tprivate _clearTimers() {\n\t\tif (this._autoCloseTimer) {\n\t\t\tclearTimeout(this._autoCloseTimer)\n\t\t\tthis._autoCloseTimer = undefined\n\t\t}\n\n\t\tif (this._progressTimer) {\n\t\t\tclearInterval(this._progressTimer)\n\t\t\tthis._progressTimer = undefined\n\t\t}\n\t}\n\n\tprivate _pauseTimers() {\n\t\tthis._clearTimers()\n\t}\n\n\tprivate _resumeTimers() {\n\t\tif (this.duration > 0) {\n\t\t\t// Calculate remaining time based on progress\n\t\t\tconst remainingTime = (this._progress / 100) * this.duration\n\n\t\t\tif (remainingTime > 0) {\n\t\t\t\tthis._autoCloseTimer = window.setTimeout(() => {\n\t\t\t\t\tthis.close()\n\t\t\t\t}, remainingTime)\n\n\t\t\t\tconst startTime = Date.now()\n\t\t\t\tconst endTime = startTime + remainingTime\n\n\t\t\t\tthis._progressTimer = window.setInterval(() => {\n\t\t\t\t\tif (this._hovered) return\n\n\t\t\t\t\tconst now = Date.now()\n\t\t\t\t\tconst remaining = Math.max(0, endTime - now)\n\t\t\t\t\tthis._progress = (remaining / remainingTime) * 100\n\n\t\t\t\t\tif (remaining <= 0) {\n\t\t\t\t\t\tthis._clearTimers()\n\t\t\t\t\t}\n\t\t\t\t}, 16)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _playSound() {\n\t\t// Dispatch event to play sound through audio service\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('playsound', {\n\t\t\t\tdetail: { type: this.type },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _handleMouseEnter() {\n\t\tthis._hovered = true\n\t\tthis._pauseTimers()\n\t}\n\n\tprivate _handleMouseLeave() {\n\t\tthis._hovered = false\n\t\tthis._resumeTimers()\n\t}\n\n\tpublic close() {\n\t\tif (this._closing) return\n\n\t\tthis._closing = true\n\t\tthis._clearTimers()\n\n\t\t// Add closing animation\n\t\tthis._visible = false\n\n\t\t// Dispatch close event\n\t\tsetTimeout(() => {\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('close', {\n\t\t\t\t\tdetail: { id: this.id },\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t}),\n\t\t\t)\n\t\t}, 300) // Match animation duration\n\t}\n\n\trender() {\n\t\tif (!this._visible && this._closing) return html``\n\n\t\tconst typeStyles = this._getTypeStyles()\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=${classMap({\n\t\t\t\t\tnotification: true,\n\t\t\t\t\tclosing: this._closing,\n\t\t\t\t\t[this.type]: true,\n\t\t\t\t})}\n\t\t\t\trole=\"alert\"\n\t\t\t\tstyle=${styleMap({\n\t\t\t\t\ttransform: this._closing ? 'translateX(120%)' : 'translateX(0)',\n\t\t\t\t\topacity: this._closing ? '0' : '1',\n\t\t\t\t})}\n\t\t\t\t@mouseenter=${this._handleMouseEnter}\n\t\t\t\t@mouseleave=${this._handleMouseLeave}\n\t\t\t>\n\t\t\t\t<div class=\"notification-content\">\n\t\t\t\t\t<div class=\"icon-container\" ${color({ color: typeStyles.iconColor })}>${typeStyles.icon}</div>\n\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t${this.title ? html` <div class=\"title\">${this.title}</div> ` : ''}\n\n\t\t\t\t\t\t<div class=\"message\">${this.message}</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t${this.closable\n\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t<button class=\"close-button\" aria-label=\"Close notification\" @click=${this.close}>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n\t\t\t\t\t\t\t\t\t\t<line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t`\n\t\t\t\t\t\t: ''}\n\t\t\t\t</div>\n\n\t\t\t\t${this.duration > 0\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<div class=\"progress-bar-container\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclass=\"progress-bar\"\n\t\t\t\t\t\t\t\t\tstyle=\"width: ${this._progress}%\"\n\t\t\t\t\t\t\t\t\t${color({ bgColor: typeStyles.progressColor })}\n\t\t\t\t\t\t\t\t></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`\n\t\t\t\t\t: ''}\n\t\t\t</div>\n\t\t`\n\t}\n\n\tprivate _getTypeStyles() {\n\t\tswitch (this.type) {\n\t\t\tcase 'success':\n\t\t\t\treturn {\n\t\t\t\t\ticon: html`\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"></path>\n\t\t\t\t\t\t\t<polyline points=\"22 4 12 14.01 9 11.01\"></polyline>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t`,\n\t\t\t\t\ticonColor: SchmancyTheme.sys.color.success.default,\n\t\t\t\t\tprogressColor: SchmancyTheme.sys.color.success.default,\n\t\t\t\t}\n\t\t\tcase 'warning':\n\t\t\t\treturn {\n\t\t\t\t\ticon: html`\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path>\n\t\t\t\t\t\t\t<line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line>\n\t\t\t\t\t\t\t<line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t`,\n\t\t\t\t\ticonColor: SchmancyTheme.sys.color.tertiary.default,\n\t\t\t\t\tprogressColor: SchmancyTheme.sys.color.tertiary.default,\n\t\t\t\t}\n\t\t\tcase 'error':\n\t\t\t\treturn {\n\t\t\t\t\ticon: html`\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n\t\t\t\t\t\t\t<line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line>\n\t\t\t\t\t\t\t<line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t`,\n\t\t\t\t\ticonColor: SchmancyTheme.sys.color.error.default,\n\t\t\t\t\tprogressColor: SchmancyTheme.sys.color.error.default,\n\t\t\t\t}\n\t\t\tcase 'info':\n\t\t\tdefault:\n\t\t\t\treturn {\n\t\t\t\t\ticon: html`\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n\t\t\t\t\t\t\t<line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"></line>\n\t\t\t\t\t\t\t<line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"></line>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t`,\n\t\t\t\t\ticonColor: SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\tprogressColor: SchmancyTheme.sys.color.primary.default,\n\t\t\t\t}\n\t\t}\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sch-notification': SchmancyNotification\n\t}\n}\n","/**\n * Programmatic sound generator for Schmancy notifications\n * Uses Web Audio API to generate gentle, subtle and soft sounds for each notification type\n */\nexport class NotificationSoundGenerator {\n\tprivate audioContext: AudioContext | null = null\n\n\t/**\n\t * Get or create AudioContext\n\t */\n\tprivate getAudioContext(): AudioContext {\n\t\tif (!this.audioContext) {\n\t\t\tconst AudioContextClass = window.AudioContext || (window as any).webkitAudioContext\n\t\t\tthis.audioContext = new AudioContextClass()\n\t\t}\n\t\treturn this.audioContext\n\t}\n\n\tpublic playInfoSound(volume = 0.2): void {\n\t\tconst ctx = this.getAudioContext()\n\t\tconst now = ctx.currentTime\n\n\t\tconst oscillator = ctx.createOscillator()\n\t\tconst gainNode = ctx.createGain()\n\t\tconst filter = ctx.createBiquadFilter()\n\n\t\toscillator.type = 'sine'\n\t\toscillator.frequency.setValueAtTime(392, now) // G4\n\t\toscillator.frequency.exponentialRampToValueAtTime(523.25, now + 0.25) // C5\n\n\t\tfilter.type = 'lowpass'\n\t\tfilter.frequency.value = 1500\n\n\t\tgainNode.gain.setValueAtTime(0.0001, now)\n\t\tgainNode.gain.exponentialRampToValueAtTime(volume, now + 0.15)\n\t\tgainNode.gain.exponentialRampToValueAtTime(0.0001, now + 0.4)\n\n\t\toscillator.connect(filter).connect(gainNode).connect(ctx.destination)\n\t\toscillator.start(now)\n\t\toscillator.stop(now + 0.45)\n\t}\n\n\tpublic playSuccessSound(volume = 0.2): void {\n\t\tconst ctx = this.getAudioContext()\n\t\tconst now = ctx.currentTime\n\n\t\tconst createBell = (freq: number, start: number, duration: number) => {\n\t\t\tconst osc = ctx.createOscillator()\n\t\t\tconst gain = ctx.createGain()\n\t\t\tconst filter = ctx.createBiquadFilter()\n\n\t\t\tosc.type = 'sine'\n\t\t\tosc.frequency.setValueAtTime(freq, now)\n\t\t\tfilter.type = 'lowpass'\n\t\t\tfilter.frequency.value = freq * 4\n\n\t\t\tgain.gain.setValueAtTime(0.0001, now)\n\t\t\tgain.gain.exponentialRampToValueAtTime(volume, now + 0.1)\n\t\t\tgain.gain.exponentialRampToValueAtTime(0.0001, now + duration)\n\n\t\t\tosc.connect(filter).connect(gain).connect(ctx.destination)\n\t\t\tosc.start(now + start)\n\t\t\tosc.stop(now + duration)\n\t\t}\n\n\t\tcreateBell(659.25, 0, 0.6) // E5\n\t\tcreateBell(523.25, 0.05, 0.55) // C5\n\t}\n\n\tpublic playWarningSound(volume = 0.25): void {\n\t\tconst ctx = this.getAudioContext()\n\t\tconst now = ctx.currentTime\n\n\t\tconst osc1 = ctx.createOscillator()\n\t\tconst osc2 = ctx.createOscillator()\n\t\tconst gain = ctx.createGain()\n\t\tconst filter = ctx.createBiquadFilter()\n\n\t\tosc1.type = 'sine'\n\t\tosc2.type = 'sine'\n\t\tosc1.frequency.setValueAtTime(349.23, now) // F4\n\t\tosc2.frequency.setValueAtTime(440, now) // A4\n\n\t\tfilter.type = 'lowpass'\n\t\tfilter.frequency.value = 1000\n\n\t\tgain.gain.setValueAtTime(0.0001, now)\n\t\tgain.gain.exponentialRampToValueAtTime(volume, now + 0.08)\n\t\tgain.gain.exponentialRampToValueAtTime(0.0001, now + 0.5)\n\n\t\tosc1.connect(filter)\n\t\tosc2.connect(filter)\n\t\tfilter.connect(gain).connect(ctx.destination)\n\n\t\tosc1.start(now)\n\t\tosc2.start(now)\n\t\tosc1.stop(now + 0.55)\n\t\tosc2.stop(now + 0.55)\n\t}\n\n\tpublic playErrorSound(volume = 0.25): void {\n\t\tconst ctx = this.getAudioContext()\n\t\tconst now = ctx.currentTime\n\n\t\tconst osc = ctx.createOscillator()\n\t\tconst gain = ctx.createGain()\n\t\tconst filter = ctx.createBiquadFilter()\n\n\t\tosc.type = 'triangle'\n\t\tosc.frequency.setValueAtTime(220, now) // A3\n\t\tosc.frequency.exponentialRampToValueAtTime(1760, now + 0.3) // A6\n\n\t\tfilter.type = 'lowpass'\n\t\tfilter.frequency.value = 800\n\t\tfilter.Q.value = 0.5\n\n\t\tgain.gain.setValueAtTime(0.0001, now)\n\t\tgain.gain.exponentialRampToValueAtTime(volume * 0.8, now + 0.1)\n\t\tgain.gain.exponentialRampToValueAtTime(0.0001, now + 0.7)\n\n\t\tosc.connect(filter).connect(gain).connect(ctx.destination)\n\t\tosc.start(now)\n\t\tosc.stop(now + 0.75)\n\t}\n\n\t/**\n\t * Generate audio blob files for all notification sounds\n\t * Returns a Promise that resolves with URLs to the generated audio files\n\t */\n\tpublic async generateAudioFiles(volume = 0.25): Promise<Record<string, string>> {\n\t\t// Create offline audio context for rendering\n\t\tconst sampleRate = 44100\n\t\tconst duration = 1 // 1 second duration to capture the full sound\n\n\t\tconst audioUrls: Record<string, string> = {}\n\n\t\t// Generate info sound\n\t\taudioUrls.info = await this.generateAudioFile(\n\t\t\tasync ctx => {\n\t\t\t\t// Create oscillator for main tone\n\t\t\t\tconst oscillator = ctx.createOscillator()\n\t\t\t\toscillator.type = 'sine'\n\t\t\t\toscillator.frequency.setValueAtTime(320, 0)\n\t\t\t\toscillator.frequency.exponentialRampToValueAtTime(520, 0.3)\n\n\t\t\t\t// Create gain node for volume control with softer attack/release\n\t\t\t\tconst gainNode = ctx.createGain()\n\t\t\t\tgainNode.gain.setValueAtTime(0, 0)\n\t\t\t\tgainNode.gain.linearRampToValueAtTime(volume, 0.1)\n\t\t\t\tgainNode.gain.linearRampToValueAtTime(0, 0.5)\n\n\t\t\t\t// Connect and play\n\t\t\t\toscillator.connect(gainNode)\n\t\t\t\tgainNode.connect(ctx.destination)\n\t\t\t\toscillator.start()\n\t\t\t\toscillator.stop(0.5)\n\t\t\t},\n\t\t\tsampleRate,\n\t\t\tduration,\n\t\t)\n\n\t\t// Generate success sound\n\t\taudioUrls.success = await this.generateAudioFile(\n\t\t\tasync ctx => {\n\t\t\t\t// Create main oscillator (higher note)\n\t\t\t\tconst osc1 = ctx.createOscillator()\n\t\t\t\tosc1.type = 'sine'\n\t\t\t\tosc1.frequency.setValueAtTime(660, 0)\n\n\t\t\t\t// Create secondary oscillator (lower note)\n\t\t\t\tconst osc2 = ctx.createOscillator()\n\t\t\t\tosc2.type = 'sine'\n\t\t\t\tosc2.frequency.setValueAtTime(440, 0)\n\n\t\t\t\t// Create gain nodes with softer envelope\n\t\t\t\tconst gain1 = ctx.createGain()\n\t\t\t\tgain1.gain.setValueAtTime(0, 0)\n\t\t\t\tgain1.gain.linearRampToValueAtTime(volume, 0.1)\n\t\t\t\tgain1.gain.linearRampToValueAtTime(0, 0.5)\n\n\t\t\t\tconst gain2 = ctx.createGain()\n\t\t\t\tgain2.gain.setValueAtTime(0, 0)\n\t\t\t\tgain2.gain.linearRampToValueAtTime(volume * 0.6, 0.15)\n\t\t\t\tgain2.gain.linearRampToValueAtTime(0, 0.7)\n\n\t\t\t\t// Connect and play\n\t\t\t\tosc1.connect(gain1)\n\t\t\t\tgain1.connect(ctx.destination)\n\n\t\t\t\tosc2.connect(gain2)\n\t\t\t\tgain2.connect(ctx.destination)\n\n\t\t\t\tosc1.start()\n\t\t\t\tosc2.start(0.15)\n\n\t\t\t\tosc1.stop(0.5)\n\t\t\t\tosc2.stop(0.7)\n\t\t\t},\n\t\t\tsampleRate,\n\t\t\tduration,\n\t\t)\n\n\t\t// Generate warning sound\n\t\taudioUrls.warning = await this.generateAudioFile(\n\t\t\tasync ctx => {\n\t\t\t\t// Create oscillators for a two-tone warning\n\t\t\t\tconst osc1 = ctx.createOscillator()\n\t\t\t\tosc1.type = 'sine'\n\t\t\t\tosc1.frequency.setValueAtTime(293.66, 0)\n\n\t\t\t\tconst osc2 = ctx.createOscillator()\n\t\t\t\tosc2.type = 'sine'\n\t\t\t\tosc2.frequency.setValueAtTime(349.23, 0)\n\n\t\t\t\t// Create gain node with softer envelope\n\t\t\t\tconst gain = ctx.createGain()\n\t\t\t\tgain.gain.setValueAtTime(0, 0)\n\t\t\t\tgain.gain.linearRampToValueAtTime(volume, 0.1)\n\t\t\t\tgain.gain.linearRampToValueAtTime(volume * 0.6, 0.2)\n\t\t\t\tgain.gain.linearRampToValueAtTime(volume * 0.8, 0.3)\n\t\t\t\tgain.gain.linearRampToValueAtTime(0, 0.6)\n\n\t\t\t\t// Connect and play\n\t\t\t\tosc1.connect(gain)\n\t\t\t\tosc2.connect(gain)\n\t\t\t\tgain.connect(ctx.destination)\n\n\t\t\t\tosc1.start()\n\t\t\t\tosc2.start()\n\n\t\t\t\tosc1.stop(0.6)\n\t\t\t\tosc2.stop(0.6)\n\t\t\t},\n\t\t\tsampleRate,\n\t\t\tduration,\n\t\t)\n\n\t\t// Generate error sound\n\t\taudioUrls.error = await this.generateAudioFile(\n\t\t\tasync ctx => {\n\t\t\t\t// Create main oscillator\n\t\t\t\tconst osc = ctx.createOscillator()\n\t\t\t\tosc.type = 'sine'\n\t\t\t\tosc.frequency.setValueAtTime(196, 0)\n\n\t\t\t\t// Create gain node with softer envelope\n\t\t\t\tconst gain = ctx.createGain()\n\t\t\t\tgain.gain.setValueAtTime(0, 0)\n\t\t\t\tgain.gain.linearRampToValueAtTime(volume, 0.1)\n\t\t\t\tgain.gain.linearRampToValueAtTime(volume * 0.4, 0.2)\n\t\t\t\tgain.gain.linearRampToValueAtTime(volume * 0.6, 0.3)\n\t\t\t\tgain.gain.linearRampToValueAtTime(0, 0.7)\n\n\t\t\t\t// Additional filter to make it even softer\n\t\t\t\tconst filter = ctx.createBiquadFilter()\n\t\t\t\tfilter.type = 'lowpass'\n\t\t\t\tfilter.frequency.value = 600\n\t\t\t\tfilter.Q.value = 0.7\n\n\t\t\t\t// Connect and play\n\t\t\t\tosc.connect(filter)\n\t\t\t\tfilter.connect(gain)\n\t\t\t\tgain.connect(ctx.destination)\n\n\t\t\t\tosc.start()\n\t\t\t\tosc.stop(0.7)\n\t\t\t},\n\t\t\tsampleRate,\n\t\t\tduration,\n\t\t)\n\n\t\treturn audioUrls\n\t}\n\n\t/**\n\t * Generate an audio file from a sound generation function\n\t * @param renderFunction Function that creates the sound in the provided context\n\t * @param sampleRate Sample rate for the audio\n\t * @param duration Duration in seconds\n\t * @returns Promise that resolves with the URL to the generated audio file\n\t */\n\tprivate async generateAudioFile(\n\t\trenderFunction: (ctx: OfflineAudioContext) => Promise<void>,\n\t\tsampleRate = 44100,\n\t\tduration = 1,\n\t): Promise<string> {\n\t\t// Create offline context\n\t\tconst offlineCtx = new OfflineAudioContext(2, sampleRate * duration, sampleRate)\n\n\t\t// Render the sound\n\t\tawait renderFunction(offlineCtx)\n\n\t\t// Render the audio\n\t\tconst audioBuffer = await offlineCtx.startRendering()\n\n\t\t// Convert to WAV format\n\t\tconst wavBlob = this.audioBufferToWav(audioBuffer)\n\n\t\t// Create URL\n\t\treturn URL.createObjectURL(wavBlob)\n\t}\n\n\t/**\n\t * Convert AudioBuffer to WAV format\n\t * Based on https://github.com/Jam3/audiobuffer-to-wav\n\t */\n\tprivate audioBufferToWav(buffer: AudioBuffer): Blob {\n\t\tconst numChannels = buffer.numberOfChannels\n\t\tconst sampleRate = buffer.sampleRate\n\t\tconst format = 1 // PCM\n\t\tconst bitDepth = 16\n\n\t\tconst bytesPerSample = bitDepth / 8\n\t\tconst blockAlign = numChannels * bytesPerSample\n\n\t\tconst samples = this.getAudioSamples(buffer, bitDepth)\n\t\tconst dataLength = samples.length * bytesPerSample\n\n\t\t// Create WAV header\n\t\tconst headerLength = 44\n\t\tconst wavBuffer = new ArrayBuffer(headerLength + dataLength)\n\t\tconst view = new DataView(wavBuffer)\n\n\t\t// RIFF identifier\n\t\tthis.writeString(view, 0, 'RIFF')\n\t\t// File length minus RIFF identifier and file size\n\t\tview.setUint32(4, 36 + dataLength, true)\n\t\t// RIFF type\n\t\tthis.writeString(view, 8, 'WAVE')\n\t\t// Format chunk identifier\n\t\tthis.writeString(view, 12, 'fmt ')\n\t\t// Format chunk length\n\t\tview.setUint32(16, 16, true)\n\t\t// Sample format (PCM)\n\t\tview.setUint16(20, format, true)\n\t\t// Channel count\n\t\tview.setUint16(22, numChannels, true)\n\t\t// Sample rate\n\t\tview.setUint32(24, sampleRate, true)\n\t\t// Byte rate (sample rate * block align)\n\t\tview.setUint32(28, sampleRate * blockAlign, true)\n\t\t// Block align (channel count * bytes per sample)\n\t\tview.setUint16(32, blockAlign, true)\n\t\t// Bits per sample\n\t\tview.setUint16(34, bitDepth, true)\n\t\t// Data chunk identifier\n\t\tthis.writeString(view, 36, 'data')\n\t\t// Data chunk length\n\t\tview.setUint32(40, dataLength, true)\n\n\t\t// Write the audio data\n\t\tif (bitDepth === 16) {\n\t\t\tthis.writeInt16Samples(view, headerLength, samples)\n\t\t} else {\n\t\t\tthrow new Error('Only 16-bit audio is supported')\n\t\t}\n\n\t\treturn new Blob([wavBuffer], { type: 'audio/wav' })\n\t}\n\n\t/**\n\t * Get audio samples from an AudioBuffer\n\t */\n\tprivate getAudioSamples(buffer: AudioBuffer, bitDepth: number): number[] {\n\t\tconst numChannels = buffer.numberOfChannels\n\t\tconst length = buffer.length\n\t\tconst samples: number[] = []\n\t\tconst scale = bitDepth === 16 ? 32768 : 128\n\n\t\t// Get samples from all channels\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tfor (let channel = 0; channel < numChannels; channel++) {\n\t\t\t\tconst sample = buffer.getChannelData(channel)[i]\n\t\t\t\t// Convert float32 to int16 or int8\n\t\t\t\tconst intSample = Math.max(-1, Math.min(1, sample))\n\t\t\t\tsamples.push(intSample * scale)\n\t\t\t}\n\t\t}\n\n\t\treturn samples\n\t}\n\n\t/**\n\t * Write 16-bit samples to a DataView\n\t */\n\tprivate writeInt16Samples(view: DataView, offset: number, samples: number[]): void {\n\t\tfor (let i = 0; i < samples.length; i++) {\n\t\t\tview.setInt16(offset + i * 2, samples[i], true)\n\t\t}\n\t}\n\n\t/**\n\t * Write a string to a DataView\n\t */\n\tprivate writeString(view: DataView, offset: number, string: string): void {\n\t\tfor (let i = 0; i < string.length; i++) {\n\t\t\tview.setUint8(offset + i, string.charCodeAt(i))\n\t\t}\n\t}\n}\n","import { NotificationType } from './notification'\nimport { NotificationSoundGenerator } from './notification-audio-generator'\n\n/**\n * Audio service for playing notification sounds.\n * Uses Web Audio API with fallback to HTML5 Audio.\n */\nexport class NotificationAudioService {\n\tprivate audioContext: AudioContext | null = null\n\tprivate soundBuffers: Map<NotificationType, AudioBuffer> = new Map()\n\tprivate volume: number = 0.5\n\tprivate muted: boolean = false\n\tprivate soundGenerator = new NotificationSoundGenerator()\n\n\t// Default sound URLs (will be generated programmatically as fallback)\n\tprivate soundUrls: Record<NotificationType, string> = {\n\t\tinfo: '/assets/sounds/notification-info.mp3',\n\t\tsuccess: '/assets/sounds/notification-success.mp3',\n\t\twarning: '/assets/sounds/notification-warning.mp3',\n\t\terror: '/assets/sounds/notification-error.mp3',\n\t}\n\n\tconstructor() {\n\t\t// Initialize audio context when first needed\n\t\tthis.initializeAudioFiles()\n\t}\n\n\t/**\n\t * Initialize audio files - generate programmatically if needed\n\t */\n\tprivate async initializeAudioFiles(): Promise<void> {\n\t\ttry {\n\t\t\t// Try to load from default URLs\n\t\t\tawait this.preloadSounds()\n\t\t} catch (err) {\n\t\t\tconsole.log('Generating programmatic notification sounds')\n\n\t\t\t// If loading fails, generate programmatically\n\t\t\ttry {\n\t\t\t\tconst generatedUrls = await this.soundGenerator.generateAudioFiles(this.volume)\n\t\t\t\tthis.soundUrls = generatedUrls\n\t\t\t} catch (genErr) {\n\t\t\t\tconsole.warn('Failed to generate notification sounds:', genErr)\n\t\t\t\t// Will fall back to direct playback when needed\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Lazy-initialize the audio context\n\t */\n\tprivate getAudioContext(): AudioContext {\n\t\tif (!this.audioContext) {\n\t\t\t// Use AudioContext with webkit prefix fallback for Safari\n\t\t\tconst AudioContextClass = window.AudioContext || (window as any).webkitAudioContext\n\t\t\tthis.audioContext = new AudioContextClass()\n\t\t}\n\n\t\treturn this.audioContext\n\t}\n\n\t/**\n\t * Preload all notification sounds\n\t */\n\tprivate async preloadSounds(): Promise<void> {\n\t\tconst types: NotificationType[] = ['info', 'success', 'warning', 'error']\n\n\t\tfor (const type of types) {\n\t\t\ttry {\n\t\t\t\tconst buffer = await this.loadSound(type)\n\t\t\t\tthis.soundBuffers.set(type, buffer)\n\t\t\t} catch (err) {\n\t\t\t\tconsole.warn(`Failed to preload ${type} sound:`, err)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Load a sound file and decode it\n\t */\n\tprivate async loadSound(type: NotificationType): Promise<AudioBuffer> {\n\t\tconst url = this.soundUrls[type]\n\t\tconst response = await fetch(url)\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`Failed to load sound from ${url}: ${response.statusText}`)\n\t\t}\n\n\t\tconst arrayBuffer = await response.arrayBuffer()\n\t\treturn await this.getAudioContext().decodeAudioData(arrayBuffer)\n\t}\n\n\t/**\n\t * Play a notification sound\n\t */\n\tpublic async playSound(type: NotificationType): Promise<void> {\n\t\tif (this.muted) return\n\n\t\ttry {\n\t\t\t// Try to use Web Audio API first\n\t\t\tconst context = this.getAudioContext()\n\n\t\t\t// Ensure audio context is resumed (needed due to autoplay policy)\n\t\t\tif (context.state === 'suspended') {\n\t\t\t\tawait context.resume()\n\t\t\t}\n\n\t\t\t// Try to use programmatically generated sound first\n\t\t\tif (this.soundUrls[type].startsWith('blob:')) {\n\t\t\t\tthis.playFallbackSound(type)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Load sound if not already cached\n\t\t\tif (!this.soundBuffers.has(type)) {\n\t\t\t\ttry {\n\t\t\t\t\tconst buffer = await this.loadSound(type)\n\t\t\t\t\tthis.soundBuffers.set(type, buffer)\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// Fall back to direct generator\n\t\t\t\t\tthis.playDirectGeneratedSound(type)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst buffer = this.soundBuffers.get(type)\n\t\t\tif (!buffer) {\n\t\t\t\tthrow new Error(`Sound buffer for ${type} not available`)\n\t\t\t}\n\n\t\t\t// Create source and gain nodes\n\t\t\tconst source = context.createBufferSource()\n\t\t\tsource.buffer = buffer\n\n\t\t\tconst gainNode = context.createGain()\n\t\t\tgainNode.gain.value = this.volume\n\n\t\t\t// Connect and play\n\t\t\tsource.connect(gainNode)\n\t\t\tgainNode.connect(context.destination)\n\t\t\tsource.start(0)\n\t\t} catch (err) {\n\t\t\tconsole.warn(`Web Audio API buffer playback failed, trying direct generation:`, err)\n\t\t\tthis.playDirectGeneratedSound(type)\n\t\t}\n\t}\n\n\t/**\n\t * Play a directly generated sound when other methods fail\n\t */\n\tprivate playDirectGeneratedSound(type: NotificationType): void {\n\t\tif (this.muted) return\n\n\t\ttry {\n\t\t\tswitch (type) {\n\t\t\t\tcase 'info':\n\t\t\t\t\tthis.soundGenerator.playInfoSound(this.volume)\n\t\t\t\t\tbreak\n\t\t\t\tcase 'success':\n\t\t\t\t\tthis.soundGenerator.playSuccessSound(this.volume)\n\t\t\t\t\tbreak\n\t\t\t\tcase 'warning':\n\t\t\t\t\tthis.soundGenerator.playWarningSound(this.volume)\n\t\t\t\t\tbreak\n\t\t\t\tcase 'error':\n\t\t\t\t\tthis.soundGenerator.playErrorSound(this.volume)\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to play generated sound for ${type}:`, err)\n\t\t}\n\t}\n\n\t/**\n\t * Play sound using HTML5 Audio as a fallback\n\t */\n\tprivate playFallbackSound(type: NotificationType): void {\n\t\tif (this.muted) return\n\n\t\ttry {\n\t\t\tconst audio = new Audio(this.soundUrls[type])\n\t\t\taudio.volume = this.volume\n\n\t\t\t// Add event listener to clean up after playback\n\t\t\taudio.addEventListener('ended', () => {\n\t\t\t\taudio.remove()\n\t\t\t})\n\n\t\t\taudio.play().catch(err => {\n\t\t\t\tconsole.error(`Failed to play fallback sound for ${type}:`, err)\n\t\t\t\tthis.playDirectGeneratedSound(type)\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tconsole.error('HTML5 Audio fallback failed:', err)\n\t\t\tthis.playDirectGeneratedSound(type)\n\t\t}\n\t}\n\n\t/**\n\t * Set volume for notification sounds (0.0 to 1.0)\n\t */\n\tpublic setVolume(volume: number): void {\n\t\tthis.volume = Math.max(0, Math.min(1, volume))\n\t}\n\n\t/**\n\t * Get current volume level\n\t */\n\tpublic getVolume(): number {\n\t\treturn this.volume\n\t}\n\n\t/**\n\t * Mute notification sounds\n\t */\n\tpublic mute(): void {\n\t\tthis.muted = true\n\t}\n\n\t/**\n\t * Unmute notification sounds\n\t */\n\tpublic unmute(): void {\n\t\tthis.muted = false\n\t}\n\n\t/**\n\t * Check if notification sounds are muted\n\t */\n\tpublic isMuted(): boolean {\n\t\treturn this.muted\n\t}\n\n\t/**\n\t * Set custom sound URL for a notification type\n\t */\n\tpublic setSoundUrl(type: NotificationType, url: string): void {\n\t\tthis.soundUrls[type] = url\n\n\t\t// Clear cached buffer to force reload\n\t\tthis.soundBuffers.delete(type)\n\t}\n\n\t/**\n\t * Get the current sound URL for a notification type\n\t */\n\tpublic getSoundUrl(type: NotificationType): string {\n\t\treturn this.soundUrls[type]\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { fromEvent, takeUntil } from 'rxjs'\nimport { NotificationType } from './notification'\nimport { NotificationAudioService } from './notification-audio'\nimport style from './notification-container.scss?inline'\n\nexport interface NotificationItem {\n\tid: string\n\ttitle: string\n\tmessage: string\n\ttype: NotificationType\n\tduration: number\n\tclosable: boolean\n\tplaySound: boolean\n}\n\nexport interface NotificationOptions {\n\tid?: string\n\ttitle?: string\n\tmessage: string\n\ttype?: NotificationType\n\tduration?: number\n\tclosable?: boolean\n\tplaySound?: boolean\n}\n\n/**\n * Container component for displaying stacked notifications.\n *\n * @element sch-notification-container\n */\n@customElement('sch-notification-container')\nexport default class SchmancyNotificationContainer extends $LitElement(style) {\n\t@property({ type: String }) position:\n\t\t| 'top-right'\n\t\t| 'top-left'\n\t\t| 'bottom-right'\n\t\t| 'bottom-left'\n\t\t| 'top-center'\n\t\t| 'bottom-center' = 'top-right'\n\t@property({ type: Number }) maxVisibleNotifications = 2\n\t@property({ type: Boolean }) playSound = false\n\t@property({ type: Number }) audioVolume = 0.1\n\n\t@state() private _notifications: NotificationItem[] = []\n\n\t// Audio service\n\tprivate _audioService = new NotificationAudioService()\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Set audio volume\n\t\tthis._audioService.setVolume(this.audioVolume)\n\n\t\t// Listen for notification events\n\t\tfromEvent<CustomEvent<NotificationOptions>>(window, 'schmancy-notification')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(event => {\n\t\t\t\tthis.addNotification(event.detail)\n\t\t\t})\n\n\t\t// Listen for play sound events from child notifications\n\t\tthis.addEventListener('playsound', ((event: CustomEvent) => {\n\t\t\tif (this.playSound) {\n\t\t\t\tthis._audioService.playSound(event.detail.type)\n\t\t\t}\n\t\t}) as EventListener)\n\t}\n\n\t// Public API to add notifications\n\tpublic addNotification(options: NotificationOptions): string {\n\t\tconst id = options.id || `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\n\t\tconst notification: NotificationItem = {\n\t\t\tid,\n\t\t\ttitle: options.title || '',\n\t\t\tmessage: options.message,\n\t\t\ttype: options.type || 'info',\n\t\t\tduration: options.duration !== undefined ? options.duration : 750,\n\t\t\tclosable: options.closable !== undefined ? options.closable : true,\n\t\t\tplaySound: options.playSound !== undefined ? options.playSound : this.playSound,\n\t\t}\n\n\t\t// Add new notification (top for top-* positions, bottom for bottom-* positions)\n\t\tif (this.position.startsWith('top')) {\n\t\t\tthis._notifications = [...this._notifications, notification]\n\t\t} else {\n\t\t\tthis._notifications = [notification, ...this._notifications]\n\t\t}\n\n\t\t// Enforce max visible notifications\n\t\tif (this._notifications.length > this.maxVisibleNotifications) {\n\t\t\tthis._notifications = this._notifications.slice(-this.maxVisibleNotifications)\n\t\t}\n\n\t\t// Play sound if enabled\n\t\tif (notification.playSound) {\n\t\t\tthis._audioService.playSound(notification.type)\n\t\t}\n\n\t\treturn id\n\t}\n\n\tpublic removeNotification(id: string) {\n\t\tthis._notifications = this._notifications.filter(n => n.id !== id)\n\t}\n\n\tprivate _handleClose(e: CustomEvent) {\n\t\tconst id = e.detail.id\n\t\tthis.removeNotification(id)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=${classMap({\n\t\t\t\t\t'notification-container': true,\n\t\t\t\t\t[this.position]: true,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t${repeat(\n\t\t\t\t\tthis._notifications,\n\t\t\t\t\tnotification => notification.id,\n\t\t\t\t\tnotification => html`\n <sch-notification\n .id=${notification.id}\n .title=${notification.title}\n .message=${notification.message}\n .type=${notification.type}\n .duration=${notification.duration}\n ?closable=${notification.closable}\n ?playSound=${false} /* We already played the sound on add */\n @close=${this._handleClose}\n ></sch-notification>\n `,\n\t\t\t\t)}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sch-notification-container': SchmancyNotificationContainer\n\t}\n}\n","import { NotificationOptions } from './notification-container'\n\n/**\n * Notification service for centralized notification management.\n * Provides a simple API for showing notifications.\n */\nexport class NotificationService {\n\tprivate static instance: NotificationService\n\n\t// Default notification options\n\tprivate static DEFAULT_OPTIONS: Partial<NotificationOptions> = {\n\t\tduration: 1000, // 1 seconds - long enough to be readable\n\t\tclosable: true,\n\t\tplaySound: true,\n\t}\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): NotificationService {\n\t\tif (!NotificationService.instance) {\n\t\t\tNotificationService.instance = new NotificationService()\n\t\t}\n\t\treturn NotificationService.instance\n\t}\n\n\t/**\n\t * Show a notification\n\t * @returns The ID of the created notification\n\t */\n\tpublic notify(options: NotificationOptions): string {\n\t\t// Apply default options\n\t\tconst completeOptions = {\n\t\t\t...NotificationService.DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t\t// Override with duraton from options if provided, otherwise use default\n\t\t\tduration: options.duration ?? NotificationService.DEFAULT_OPTIONS.duration,\n\t\t}\n\n\t\tconst id = completeOptions.id || `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\n\t\t// Create and dispatch event\n\t\tconst event = new CustomEvent('schmancy-notification', {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t\tdetail: {\n\t\t\t\t...completeOptions,\n\t\t\t\tid,\n\t\t\t},\n\t\t})\n\n\t\twindow.dispatchEvent(event)\n\t\treturn id\n\t}\n\n\t/**\n\t * Show an info notification\n\t */\n\tpublic info(message: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string {\n\t\treturn this.notify({\n\t\t\tmessage,\n\t\t\ttype: 'info',\n\t\t\t...options,\n\t\t})\n\t}\n\n\t/**\n\t * Show a success notification\n\t */\n\tpublic success(message: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string {\n\t\treturn this.notify({\n\t\t\tmessage,\n\t\t\ttype: 'success',\n\t\t\t...options,\n\t\t})\n\t}\n\n\t/**\n\t * Show a warning notification\n\t */\n\tpublic warning(message: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string {\n\t\treturn this.notify({\n\t\t\tmessage,\n\t\t\ttype: 'warning',\n\t\t\t...options,\n\t\t})\n\t}\n\n\t/**\n\t * Show an error notification\n\t */\n\tpublic error(message: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string {\n\t\treturn this.notify({\n\t\t\tmessage,\n\t\t\ttype: 'error',\n\t\t\t...options,\n\t\t})\n\t}\n\n\t/**\n\t * Show a notification with a custom duration\n\t */\n\tpublic customDuration(\n\t\tmessage: string,\n\t\tduration: number,\n\t\toptions: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {},\n\t): string {\n\t\treturn this.notify({\n\t\t\tmessage,\n\t\t\tduration,\n\t\t\t...options,\n\t\t})\n\t}\n\n\t/**\n\t * Show a persistent notification (won't auto-dismiss)\n\t */\n\tpublic persistent(message: string, options: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {}): string {\n\t\treturn this.notify({\n\t\t\tmessage,\n\t\t\tduration: 0, // Zero duration means no auto-close\n\t\t\t...options,\n\t\t})\n\t}\n}\n\n/**\n * Global notification utility - provides a quick way to show notifications\n */\nexport const $notify = {\n\t/**\n\t * Show a notification\n\t */\n\tshow: (options: NotificationOptions): string => {\n\t\treturn NotificationService.getInstance().notify(options)\n\t},\n\n\t/**\n\t * Show an info notification\n\t */\n\tinfo: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string => {\n\t\treturn NotificationService.getInstance().info(message, options)\n\t},\n\n\t/**\n\t * Show a success notification\n\t */\n\tsuccess: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string => {\n\t\treturn NotificationService.getInstance().success(message, options)\n\t},\n\n\t/**\n\t * Show a warning notification\n\t */\n\twarning: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string => {\n\t\treturn NotificationService.getInstance().warning(message, options)\n\t},\n\n\t/**\n\t * Show an error notification\n\t */\n\terror: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string => {\n\t\treturn NotificationService.getInstance().error(message, options)\n\t},\n\n\t/**\n\t * Show a notification with a custom duration\n\t * @param message The notification message\n\t * @param duration Duration in milliseconds before auto-dismissing (0 for no auto-dismiss)\n\t * @param options Additional notification options\n\t */\n\tcustomDuration: (\n\t\tmessage: string,\n\t\tduration: number,\n\t\toptions: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {},\n\t): string => {\n\t\treturn NotificationService.getInstance().customDuration(message, duration, options)\n\t},\n\n\t/**\n\t * Show a persistent notification that won't auto-dismiss\n\t */\n\tpersistent: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {}): string => {\n\t\treturn NotificationService.getInstance().persistent(message, options)\n\t},\n}\n\nexport default NotificationService\n"],"names":["SchmancyNotification","$LitElement","super","arguments","this","title","message","type","closable","duration","id","Date","now","Math","floor","random","playSound","_visible","_progress","_hovered","_closing","connectedCallback","_startAutoCloseTimer","_playSound","disconnectedCallback","_clearTimers","changedProps","updated","has","endTime","_autoCloseTimer","window","setTimeout","close","_progressTimer","setInterval","remaining","max","clearTimeout","clearInterval","_pauseTimers","remainingTime","dispatchEvent","CustomEvent","detail","bubbles","composed","_resumeTimers","html","typeStyles","_getTypeStyles","classMap","notification","closing","styleMap","transform","opacity","_handleMouseEnter","_handleMouseLeave","color","iconColor","icon","bgColor","progressColor","SchmancyTheme","sys","success","default","tertiary","error","primary","__decorateClass","property","String","prototype","Boolean","Number","state","customElement","NotificationSoundGenerator","audioContext","getAudioContext","AudioContextClass","AudioContext","webkitAudioContext","volume","ctx","currentTime","oscillator","createOscillator","gainNode","createGain","filter","createBiquadFilter","frequency","setValueAtTime","exponentialRampToValueAtTime","value","gain","connect","destination","start","stop","createBell","freq","osc","osc1","osc2","Q","generateAudioFiles","audioUrls","info","generateAudioFile","async","linearRampToValueAtTime","sampleRate","gain1","gain2","warning","renderFunction","offlineCtx","OfflineAudioContext","audioBuffer","startRendering","wavBlob","audioBufferToWav","URL","createObjectURL","buffer","numChannels","numberOfChannels","blockAlign","bitDepth","samples","getAudioSamples","dataLength","length","wavBuffer","ArrayBuffer","view","DataView","writeString","setUint32","setUint16","writeInt16Samples","Blob","scale","i","channel","sample","getChannelData","intSample","min","push","offset","setInt16","string","setUint8","charCodeAt","NotificationAudioService","constructor","soundBuffers","Map","muted","soundGenerator","soundUrls","initializeAudioFiles","preloadSounds","err","generatedUrls","types","loadSound","set","url","response","fetch","ok","Error","statusText","arrayBuffer","decodeAudioData","context","resume","startsWith","playFallbackSound","playDirectGeneratedSound","get","source","createBufferSource","playInfoSound","playSuccessSound","playWarningSound","playErrorSound","audio","Audio","addEventListener","remove","play","catch","mute","unmute","delete","SchmancyNotificationContainer","position","maxVisibleNotifications","audioVolume","_notifications","_audioService","setVolume","fromEvent","pipe","takeUntil","disconnecting","subscribe","event","addNotification","options","slice","n","e","removeNotification","repeat","_handleClose","NotificationService","instance","completeOptions","DEFAULT_OPTIONS","s","notify","_k","$notify","show","getInstance","customDuration","persistent"],"mappings":";;;;;;;;;;;;;;AAeA,IAAqBA,IAArB,cAAkDC;EAAlD,cAAAC;AAAAA,UAAAA,GAAAC,YACqCC,KAAAC,QAAA,IACED,KAAAE,UAAA,IACeF,KAAAG,OAAA,QACbH,KAAAI,WAAA,IACDJ,KAAAK,WAAA,KACNL,KAAAM,KAAA,gBAAgBC,KAAKC,IAASC,CAAAA,IAAAA,KAAKC,MAAsB,MAAhBD,KAAKE,aACtCX,KAAAY,YAAAA,IAEhCZ,KAAQa,WAAAA,IACRb,KAAQc,YAAY,KACpBd,KAAQe,WAAAA,IACRf,KAAQgB,WAAAA;AAAAA,EAAW;AAAA,EAI5B;AACClB,UAAMmB,kBAAAA,GAEFjB,KAAKK,WAAW,KACnBL,KAAKkB,qBAGFlB,GAAAA,KAAKY,aACRZ,KAAKmB,WAAAA;AAAAA,EACN;AAAA,EAGD,uBAAAC;AACCpB,SAAKq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AoBS,YAAcJ,EAAAA,OAAOZ,CAMjDzG,GAAAA,MAAM,CAACzG,GAAiBkN,IAAkE,OAClFO,EAAoBS,YAAAA,EAAczH,KAAKzG,GAASkN,CAMxDtJ,GAAAA,SAAS,CAAC5D,GAAiBkN,IAAkE,OACrFO,EAAoBS,YAAAA,EAActK,QAAQ5D,GAASkN,IAM3DlG,SAAS,CAAChH,GAAiBkN,IAAkE,OACrFO,EAAoBS,YAAclH,EAAAA,QAAQhH,GAASkN,CAM3DnJ,GAAAA,OAAO,CAAC/D,GAAiBkN,IAAkE,OACnFO,EAAoBS,cAAcnK,MAAM/D,GAASkN,CASzDiB,GAAAA,gBAAgB,CACfnO,GACAG,GACA+M,IAAsE,CAAA,MAE/DO,EAAoBS,YAAAA,EAAcC,eAAenO,GAASG,GAAU+M,CAAAA,GAM5EkB,YAAY,CAACpO,GAAiBkN,IAAsE,OAC5FO,EAAoBS,cAAcE,WAAWpO,GAASkN;"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";const w=require("rxjs"),v=require("lit/directives/class-map.js"),b=require("lit/directives/style-map.js"),x=require("./litElement.mixin-DLa9lBCo.cjs");require("./tailwind.mixin-C1TWeByU.cjs");const T=require("./ripple-C2BHbhcS.cjs"),m=require("./theme.interface-Xg5Zi46a.cjs"),d=require("lit"),l=require("lit/decorators.js"),A=require("lit/directives/repeat.js");var _=Object.defineProperty,C=Object.getOwnPropertyDescriptor,u=(s,t,e,i)=>{for(var o,n=i>1?void 0:i?C(t,e):t,a=s.length-1;a>=0;a--)(o=s[a])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&_(t,e,n),n};exports.SchmancyNotification=class extends x.$LitElement(":host{display:block;margin-bottom:10px}:host:last-child{margin-bottom:0}.notification{width:100%;max-width:400px;border-radius:8px;box-shadow:var(--schmancy-sys-elevation-2);overflow:hidden;transform:translate(0);opacity:1;transition:transform .3s ease-out,opacity .3s ease-out;background-color:var(--schmancy-sys-color-surface-container);color:var(--schmancy-sys-color-surface-on)}.notification.info{border-left:4px solid var(--schmancy-sys-color-primary-default)}.notification.success{border-left:4px solid var(--schmancy-sys-color-success-default)}.notification.warning{border-left:4px solid var(--schmancy-sys-color-tertiary-default)}.notification.error{border-left:4px solid var(--schmancy-sys-color-error-default)}.notification.closing{transform:translate(120%);opacity:0}.notification .notification-content{display:flex;padding:16px;align-items:flex-start;position:relative}.notification .icon-container{flex-shrink:0;margin-right:12px;display:flex;align-items:center;justify-content:center}.notification .content{flex:1;min-width:0;display:flex;flex-direction:column}.notification .title{font-weight:600;font-size:16px;margin-bottom:4px;word-break:break-word}.notification .message{font-size:14px;word-break:break-word}.notification .close-button{background:transparent;border:none;cursor:pointer;color:var(--schmancy-sys-color-surface-onVariant);padding:4px;margin-left:8px;border-radius:4px;display:flex;align-items:center;justify-content:center}.notification .close-button:hover{background-color:#0000000d}.notification .close-button:focus{outline:none;box-shadow:0 0 0 2px var(--schmancy-sys-color-primary-default)}.notification .progress-bar-container{height:4px;width:100%;background-color:#0000001a;overflow:hidden}.notification .progress-bar{height:100%;width:100%;transition:width .1s linear}"){constructor(){super(...arguments),this.title="",this.message="",this.type="info",this.closable=!0,this.duration=5e3,this.id=`notification-${Date.now()}-${Math.floor(1e4*Math.random())}`,this.playSound=!0,this._visible=!0,this._progress=100,this._hovered=!1,this._closing=!1}connectedCallback(){super.connectedCallback(),this.duration>0&&this._startAutoCloseTimer(),this.playSound&&this._playSound()}disconnectedCallback(){this._clearTimers(),super.disconnectedCallback()}updated(s){super.updated(s),s.has("duration")&&this.duration>0&&(this._clearTimers(),this._startAutoCloseTimer())}_startAutoCloseTimer(){if(this.duration<=0)return;const s=Date.now()+this.duration;this._autoCloseTimer=window.setTimeout(()=>{this.close()},this.duration),this._progressTimer=window.setInterval(()=>{if(this._hovered)return;const t=Date.now(),e=Math.max(0,s-t);this._progress=e/this.duration*100,e<=0&&this._clearTimers()},16)}_clearTimers(){this._autoCloseTimer&&(clearTimeout(this._autoCloseTimer),this._autoCloseTimer=void 0),this._progressTimer&&(clearInterval(this._progressTimer),this._progressTimer=void 0)}_pauseTimers(){this._clearTimers()}_resumeTimers(){if(this.duration>0){const s=this._progress/100*this.duration;if(s>0){this._autoCloseTimer=window.setTimeout(()=>{this.close()},s);const t=Date.now()+s;this._progressTimer=window.setInterval(()=>{if(this._hovered)return;const e=Date.now(),i=Math.max(0,t-e);this._progress=i/s*100,i<=0&&this._clearTimers()},16)}}}_playSound(){this.dispatchEvent(new CustomEvent("playsound",{detail:{type:this.type},bubbles:!0,composed:!0}))}_handleMouseEnter(){this._hovered=!0,this._pauseTimers()}_handleMouseLeave(){this._hovered=!1,this._resumeTimers()}close(){this._closing||(this._closing=!0,this._clearTimers(),this._visible=!1,setTimeout(()=>{this.dispatchEvent(new CustomEvent("close",{detail:{id:this.id},bubbles:!0,composed:!0}))},300))}render(){if(!this._visible&&this._closing)return d.html``;const s=this._getTypeStyles();return d.html`
|
|
2
|
-
<div
|
|
3
|
-
class=${v.classMap({notification:!0,closing:this._closing,[this.type]:!0})}
|
|
4
|
-
role="alert"
|
|
5
|
-
style=${b.styleMap({transform:this._closing?"translateX(120%)":"translateX(0)",opacity:this._closing?"0":"1"})}
|
|
6
|
-
@mouseenter=${this._handleMouseEnter}
|
|
7
|
-
@mouseleave=${this._handleMouseLeave}
|
|
8
|
-
>
|
|
9
|
-
<div class="notification-content">
|
|
10
|
-
<div class="icon-container" ${T.color({color:s.iconColor})}>${s.icon}</div>
|
|
11
|
-
|
|
12
|
-
<div class="content">
|
|
13
|
-
${this.title?d.html` <div class="title">${this.title}</div> `:""}
|
|
14
|
-
|
|
15
|
-
<div class="message">${this.message}</div>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
${this.closable?d.html`
|
|
19
|
-
<button class="close-button" aria-label="Close notification" @click=${this.close}>
|
|
20
|
-
<svg
|
|
21
|
-
width="16"
|
|
22
|
-
height="16"
|
|
23
|
-
viewBox="0 0 24 24"
|
|
24
|
-
fill="none"
|
|
25
|
-
stroke="currentColor"
|
|
26
|
-
stroke-width="2"
|
|
27
|
-
stroke-linecap="round"
|
|
28
|
-
stroke-linejoin="round"
|
|
29
|
-
>
|
|
30
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
31
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
32
|
-
</svg>
|
|
33
|
-
</button>
|
|
34
|
-
`:""}
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
${this.duration>0?d.html`
|
|
38
|
-
<div class="progress-bar-container">
|
|
39
|
-
<div
|
|
40
|
-
class="progress-bar"
|
|
41
|
-
style="width: ${this._progress}%"
|
|
42
|
-
${T.color({bgColor:s.progressColor})}
|
|
43
|
-
></div>
|
|
44
|
-
</div>
|
|
45
|
-
`:""}
|
|
46
|
-
</div>
|
|
47
|
-
`}_getTypeStyles(){switch(this.type){case"success":return{icon:d.html`
|
|
48
|
-
<svg
|
|
49
|
-
width="20"
|
|
50
|
-
height="20"
|
|
51
|
-
viewBox="0 0 24 24"
|
|
52
|
-
fill="none"
|
|
53
|
-
stroke="currentColor"
|
|
54
|
-
stroke-width="2"
|
|
55
|
-
stroke-linecap="round"
|
|
56
|
-
stroke-linejoin="round"
|
|
57
|
-
>
|
|
58
|
-
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
|
59
|
-
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
|
60
|
-
</svg>
|
|
61
|
-
`,iconColor:m.SchmancyTheme.sys.color.success.default,progressColor:m.SchmancyTheme.sys.color.success.default};case"warning":return{icon:d.html`
|
|
62
|
-
<svg
|
|
63
|
-
width="20"
|
|
64
|
-
height="20"
|
|
65
|
-
viewBox="0 0 24 24"
|
|
66
|
-
fill="none"
|
|
67
|
-
stroke="currentColor"
|
|
68
|
-
stroke-width="2"
|
|
69
|
-
stroke-linecap="round"
|
|
70
|
-
stroke-linejoin="round"
|
|
71
|
-
>
|
|
72
|
-
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path>
|
|
73
|
-
<line x1="12" y1="9" x2="12" y2="13"></line>
|
|
74
|
-
<line x1="12" y1="17" x2="12.01" y2="17"></line>
|
|
75
|
-
</svg>
|
|
76
|
-
`,iconColor:m.SchmancyTheme.sys.color.tertiary.default,progressColor:m.SchmancyTheme.sys.color.tertiary.default};case"error":return{icon:d.html`
|
|
77
|
-
<svg
|
|
78
|
-
width="20"
|
|
79
|
-
height="20"
|
|
80
|
-
viewBox="0 0 24 24"
|
|
81
|
-
fill="none"
|
|
82
|
-
stroke="currentColor"
|
|
83
|
-
stroke-width="2"
|
|
84
|
-
stroke-linecap="round"
|
|
85
|
-
stroke-linejoin="round"
|
|
86
|
-
>
|
|
87
|
-
<circle cx="12" cy="12" r="10"></circle>
|
|
88
|
-
<line x1="15" y1="9" x2="9" y2="15"></line>
|
|
89
|
-
<line x1="9" y1="9" x2="15" y2="15"></line>
|
|
90
|
-
</svg>
|
|
91
|
-
`,iconColor:m.SchmancyTheme.sys.color.error.default,progressColor:m.SchmancyTheme.sys.color.error.default};default:return{icon:d.html`
|
|
92
|
-
<svg
|
|
93
|
-
width="20"
|
|
94
|
-
height="20"
|
|
95
|
-
viewBox="0 0 24 24"
|
|
96
|
-
fill="none"
|
|
97
|
-
stroke="currentColor"
|
|
98
|
-
stroke-width="2"
|
|
99
|
-
stroke-linecap="round"
|
|
100
|
-
stroke-linejoin="round"
|
|
101
|
-
>
|
|
102
|
-
<circle cx="12" cy="12" r="10"></circle>
|
|
103
|
-
<line x1="12" y1="16" x2="12" y2="12"></line>
|
|
104
|
-
<line x1="12" y1="8" x2="12.01" y2="8"></line>
|
|
105
|
-
</svg>
|
|
106
|
-
`,iconColor:m.SchmancyTheme.sys.color.primary.default,progressColor:m.SchmancyTheme.sys.color.primary.default}}}},u([l.property({type:String})],exports.SchmancyNotification.prototype,"title",2),u([l.property({type:String})],exports.SchmancyNotification.prototype,"message",2),u([l.property({type:String})],exports.SchmancyNotification.prototype,"type",2),u([l.property({type:Boolean})],exports.SchmancyNotification.prototype,"closable",2),u([l.property({type:Number})],exports.SchmancyNotification.prototype,"duration",2),u([l.property({type:String})],exports.SchmancyNotification.prototype,"id",2),u([l.property({type:Boolean})],exports.SchmancyNotification.prototype,"playSound",2),u([l.state()],exports.SchmancyNotification.prototype,"_visible",2),u([l.state()],exports.SchmancyNotification.prototype,"_progress",2),u([l.state()],exports.SchmancyNotification.prototype,"_hovered",2),u([l.state()],exports.SchmancyNotification.prototype,"_closing",2),u([l.state()],exports.SchmancyNotification.prototype,"_autoCloseTimer",2),u([l.state()],exports.SchmancyNotification.prototype,"_progressTimer",2),exports.SchmancyNotification=u([l.customElement("sch-notification")],exports.SchmancyNotification);class V{constructor(){this.audioContext=null}getAudioContext(){if(!this.audioContext){const t=window.AudioContext||window.webkitAudioContext;this.audioContext=new t}return this.audioContext}playInfoSound(t=.2){const e=this.getAudioContext(),i=e.currentTime,o=e.createOscillator(),n=e.createGain(),a=e.createBiquadFilter();o.type="sine",o.frequency.setValueAtTime(392,i),o.frequency.exponentialRampToValueAtTime(523.25,i+.25),a.type="lowpass",a.frequency.value=1500,n.gain.setValueAtTime(1e-4,i),n.gain.exponentialRampToValueAtTime(t,i+.15),n.gain.exponentialRampToValueAtTime(1e-4,i+.4),o.connect(a).connect(n).connect(e.destination),o.start(i),o.stop(i+.45)}playSuccessSound(t=.2){const e=this.getAudioContext(),i=e.currentTime,o=(n,a,r)=>{const c=e.createOscillator(),y=e.createGain(),g=e.createBiquadFilter();c.type="sine",c.frequency.setValueAtTime(n,i),g.type="lowpass",g.frequency.value=4*n,y.gain.setValueAtTime(1e-4,i),y.gain.exponentialRampToValueAtTime(t,i+.1),y.gain.exponentialRampToValueAtTime(1e-4,i+r),c.connect(g).connect(y).connect(e.destination),c.start(i+a),c.stop(i+r)};o(659.25,0,.6),o(523.25,.05,.55)}playWarningSound(t=.25){const e=this.getAudioContext(),i=e.currentTime,o=e.createOscillator(),n=e.createOscillator(),a=e.createGain(),r=e.createBiquadFilter();o.type="sine",n.type="sine",o.frequency.setValueAtTime(349.23,i),n.frequency.setValueAtTime(440,i),r.type="lowpass",r.frequency.value=1e3,a.gain.setValueAtTime(1e-4,i),a.gain.exponentialRampToValueAtTime(t,i+.08),a.gain.exponentialRampToValueAtTime(1e-4,i+.5),o.connect(r),n.connect(r),r.connect(a).connect(e.destination),o.start(i),n.start(i),o.stop(i+.55),n.stop(i+.55)}playErrorSound(t=.25){const e=this.getAudioContext(),i=e.currentTime,o=e.createOscillator(),n=e.createGain(),a=e.createBiquadFilter();o.type="triangle",o.frequency.setValueAtTime(220,i),o.frequency.exponentialRampToValueAtTime(1760,i+.3),a.type="lowpass",a.frequency.value=800,a.Q.value=.5,n.gain.setValueAtTime(1e-4,i),n.gain.exponentialRampToValueAtTime(.8*t,i+.1),n.gain.exponentialRampToValueAtTime(1e-4,i+.7),o.connect(a).connect(n).connect(e.destination),o.start(i),o.stop(i+.75)}async generateAudioFiles(t=.25){const i={};return i.info=await this.generateAudioFile(async o=>{const n=o.createOscillator();n.type="sine",n.frequency.setValueAtTime(320,0),n.frequency.exponentialRampToValueAtTime(520,.3);const a=o.createGain();a.gain.setValueAtTime(0,0),a.gain.linearRampToValueAtTime(t,.1),a.gain.linearRampToValueAtTime(0,.5),n.connect(a),a.connect(o.destination),n.start(),n.stop(.5)},44100,1),i.success=await this.generateAudioFile(async o=>{const n=o.createOscillator();n.type="sine",n.frequency.setValueAtTime(660,0);const a=o.createOscillator();a.type="sine",a.frequency.setValueAtTime(440,0);const r=o.createGain();r.gain.setValueAtTime(0,0),r.gain.linearRampToValueAtTime(t,.1),r.gain.linearRampToValueAtTime(0,.5);const c=o.createGain();c.gain.setValueAtTime(0,0),c.gain.linearRampToValueAtTime(.6*t,.15),c.gain.linearRampToValueAtTime(0,.7),n.connect(r),r.connect(o.destination),a.connect(c),c.connect(o.destination),n.start(),a.start(.15),n.stop(.5),a.stop(.7)},44100,1),i.warning=await this.generateAudioFile(async o=>{const n=o.createOscillator();n.type="sine",n.frequency.setValueAtTime(293.66,0);const a=o.createOscillator();a.type="sine",a.frequency.setValueAtTime(349.23,0);const r=o.createGain();r.gain.setValueAtTime(0,0),r.gain.linearRampToValueAtTime(t,.1),r.gain.linearRampToValueAtTime(.6*t,.2),r.gain.linearRampToValueAtTime(.8*t,.3),r.gain.linearRampToValueAtTime(0,.6),n.connect(r),a.connect(r),r.connect(o.destination),n.start(),a.start(),n.stop(.6),a.stop(.6)},44100,1),i.error=await this.generateAudioFile(async o=>{const n=o.createOscillator();n.type="sine",n.frequency.setValueAtTime(196,0);const a=o.createGain();a.gain.setValueAtTime(0,0),a.gain.linearRampToValueAtTime(t,.1),a.gain.linearRampToValueAtTime(.4*t,.2),a.gain.linearRampToValueAtTime(.6*t,.3),a.gain.linearRampToValueAtTime(0,.7);const r=o.createBiquadFilter();r.type="lowpass",r.frequency.value=600,r.Q.value=.7,n.connect(r),r.connect(a),a.connect(o.destination),n.start(),n.stop(.7)},44100,1),i}async generateAudioFile(t,e=44100,i=1){const o=new OfflineAudioContext(2,e*i,e);await t(o);const n=await o.startRendering(),a=this.audioBufferToWav(n);return URL.createObjectURL(a)}audioBufferToWav(t){const e=t.numberOfChannels,i=t.sampleRate,o=2*e,n=this.getAudioSamples(t,16),a=2*n.length,r=new ArrayBuffer(44+a),c=new DataView(r);return this.writeString(c,0,"RIFF"),c.setUint32(4,36+a,!0),this.writeString(c,8,"WAVE"),this.writeString(c,12,"fmt "),c.setUint32(16,16,!0),c.setUint16(20,1,!0),c.setUint16(22,e,!0),c.setUint32(24,i,!0),c.setUint32(28,i*o,!0),c.setUint16(32,o,!0),c.setUint16(34,16,!0),this.writeString(c,36,"data"),c.setUint32(40,a,!0),this.writeInt16Samples(c,44,n),new Blob([r],{type:"audio/wav"})}getAudioSamples(t,e){const i=t.numberOfChannels,o=t.length,n=[],a=e===16?32768:128;for(let r=0;r<o;r++)for(let c=0;c<i;c++){const y=t.getChannelData(c)[r],g=Math.max(-1,Math.min(1,y));n.push(g*a)}return n}writeInt16Samples(t,e,i){for(let o=0;o<i.length;o++)t.setInt16(e+2*o,i[o],!0)}writeString(t,e,i){for(let o=0;o<i.length;o++)t.setUint8(e+o,i.charCodeAt(o))}}class S{constructor(){this.audioContext=null,this.soundBuffers=new Map,this.volume=.5,this.muted=!1,this.soundGenerator=new V,this.soundUrls={info:"/assets/sounds/notification-info.mp3",success:"/assets/sounds/notification-success.mp3",warning:"/assets/sounds/notification-warning.mp3",error:"/assets/sounds/notification-error.mp3"},this.initializeAudioFiles()}async initializeAudioFiles(){try{await this.preloadSounds()}catch{try{const e=await this.soundGenerator.generateAudioFiles(this.volume);this.soundUrls=e}catch{}}}getAudioContext(){if(!this.audioContext){const t=window.AudioContext||window.webkitAudioContext;this.audioContext=new t}return this.audioContext}async preloadSounds(){const t=["info","success","warning","error"];for(const e of t)try{const i=await this.loadSound(e);this.soundBuffers.set(e,i)}catch{}}async loadSound(t){const e=this.soundUrls[t],i=await fetch(e);if(!i.ok)throw new Error(`Failed to load sound from ${e}: ${i.statusText}`);const o=await i.arrayBuffer();return await this.getAudioContext().decodeAudioData(o)}async playSound(t){if(!this.muted)try{const e=this.getAudioContext();if(e.state==="suspended"&&await e.resume(),this.soundUrls[t].startsWith("blob:"))return void this.playFallbackSound(t);if(!this.soundBuffers.has(t))try{const a=await this.loadSound(t);this.soundBuffers.set(t,a)}catch{return void this.playDirectGeneratedSound(t)}const i=this.soundBuffers.get(t);if(!i)throw new Error(`Sound buffer for ${t} not available`);const o=e.createBufferSource();o.buffer=i;const n=e.createGain();n.gain.value=this.volume,o.connect(n),n.connect(e.destination),o.start(0)}catch{this.playDirectGeneratedSound(t)}}playDirectGeneratedSound(t){if(!this.muted)try{switch(t){case"info":this.soundGenerator.playInfoSound(this.volume);break;case"success":this.soundGenerator.playSuccessSound(this.volume);break;case"warning":this.soundGenerator.playWarningSound(this.volume);break;case"error":this.soundGenerator.playErrorSound(this.volume)}}catch{}}playFallbackSound(t){if(!this.muted)try{const e=new Audio(this.soundUrls[t]);e.volume=this.volume,e.addEventListener("ended",()=>{e.remove()}),e.play().catch(i=>{this.playDirectGeneratedSound(t)})}catch{this.playDirectGeneratedSound(t)}}setVolume(t){this.volume=Math.max(0,Math.min(1,t))}getVolume(){return this.volume}mute(){this.muted=!0}unmute(){this.muted=!1}isMuted(){return this.muted}setSoundUrl(t,e){this.soundUrls[t]=e,this.soundBuffers.delete(t)}getSoundUrl(t){return this.soundUrls[t]}}var k=Object.defineProperty,N=Object.getOwnPropertyDescriptor,f=(s,t,e,i)=>{for(var o,n=i>1?void 0:i?N(t,e):t,a=s.length-1;a>=0;a--)(o=s[a])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&k(t,e,n),n};exports.SchmancyNotificationContainer=class extends x.$LitElement(":host{display:block}.notification-container{position:fixed;z-index:9999;padding:12px;pointer-events:none;width:100%;max-width:424px}.notification-container sch-notification{pointer-events:auto}.notification-container.top-right{top:0;right:0;display:flex;flex-direction:column-reverse}.notification-container.top-left{top:0;left:0;display:flex;flex-direction:column-reverse}.notification-container.bottom-right{bottom:0;right:0;display:flex;flex-direction:column}.notification-container.bottom-left{bottom:0;left:0;display:flex;flex-direction:column}.notification-container.top-center{top:0;left:50%;transform:translate(-50%);display:flex;flex-direction:column-reverse}.notification-container.bottom-center{bottom:0;left:50%;transform:translate(-50%);display:flex;flex-direction:column}"){constructor(){super(...arguments),this.position="top-right",this.maxVisibleNotifications=2,this.playSound=!1,this.audioVolume=.1,this._notifications=[],this._audioService=new S}connectedCallback(){super.connectedCallback(),this._audioService.setVolume(this.audioVolume),w.fromEvent(window,"schmancy-notification").pipe(w.takeUntil(this.disconnecting)).subscribe(s=>{this.addNotification(s.detail)}),this.addEventListener("playsound",s=>{this.playSound&&this._audioService.playSound(s.detail.type)})}addNotification(s){const t=s.id||`notification-${Date.now()}-${Math.floor(1e4*Math.random())}`,e={id:t,title:s.title||"",message:s.message,type:s.type||"info",duration:s.duration!==void 0?s.duration:750,closable:s.closable===void 0||s.closable,playSound:s.playSound!==void 0?s.playSound:this.playSound};return this.position.startsWith("top")?this._notifications=[...this._notifications,e]:this._notifications=[e,...this._notifications],this._notifications.length>this.maxVisibleNotifications&&(this._notifications=this._notifications.slice(-this.maxVisibleNotifications)),e.playSound&&this._audioService.playSound(e.type),t}removeNotification(s){this._notifications=this._notifications.filter(t=>t.id!==s)}_handleClose(s){const t=s.detail.id;this.removeNotification(t)}render(){return d.html`
|
|
107
|
-
<div
|
|
108
|
-
class=${v.classMap({"notification-container":!0,[this.position]:!0})}
|
|
109
|
-
>
|
|
110
|
-
${A.repeat(this._notifications,s=>s.id,s=>d.html`
|
|
111
|
-
<sch-notification
|
|
112
|
-
.id=${s.id}
|
|
113
|
-
.title=${s.title}
|
|
114
|
-
.message=${s.message}
|
|
115
|
-
.type=${s.type}
|
|
116
|
-
.duration=${s.duration}
|
|
117
|
-
?closable=${s.closable}
|
|
118
|
-
?playSound=${!1} /* We already played the sound on add */
|
|
119
|
-
@close=${this._handleClose}
|
|
120
|
-
></sch-notification>
|
|
121
|
-
`)}
|
|
122
|
-
</div>
|
|
123
|
-
`}},f([l.property({type:String})],exports.SchmancyNotificationContainer.prototype,"position",2),f([l.property({type:Number})],exports.SchmancyNotificationContainer.prototype,"maxVisibleNotifications",2),f([l.property({type:Boolean})],exports.SchmancyNotificationContainer.prototype,"playSound",2),f([l.property({type:Number})],exports.SchmancyNotificationContainer.prototype,"audioVolume",2),f([l.state()],exports.SchmancyNotificationContainer.prototype,"_notifications",2),exports.SchmancyNotificationContainer=f([l.customElement("sch-notification-container")],exports.SchmancyNotificationContainer);const p=class p{constructor(){}static getInstance(){return p.instance||(p.instance=new p),p.instance}notify(t){const e={...p.DEFAULT_OPTIONS,...t,duration:t.duration??p.DEFAULT_OPTIONS.duration},i=e.id||`notification-${Date.now()}-${Math.floor(1e4*Math.random())}`,o=new CustomEvent("schmancy-notification",{bubbles:!0,composed:!0,detail:{...e,id:i}});return window.dispatchEvent(o),i}info(t,e={}){return this.notify({message:t,type:"info",...e})}success(t,e={}){return this.notify({message:t,type:"success",...e})}warning(t,e={}){return this.notify({message:t,type:"warning",...e})}error(t,e={}){return this.notify({message:t,type:"error",...e})}customDuration(t,e,i={}){return this.notify({message:t,duration:e,...i})}persistent(t,e={}){return this.notify({message:t,duration:0,...e})}};p.DEFAULT_OPTIONS={duration:1e3,closable:!0,playSound:!0};let h=p;const $={show:s=>h.getInstance().notify(s),info:(s,t={})=>h.getInstance().info(s,t),success:(s,t={})=>h.getInstance().success(s,t),warning:(s,t={})=>h.getInstance().warning(s,t),error:(s,t={})=>h.getInstance().error(s,t),customDuration:(s,t,e={})=>h.getInstance().customDuration(s,t,e),persistent:(s,t={})=>h.getInstance().persistent(s,t)};exports.$notify=$,exports.NotificationAudioService=S;
|
|
124
|
-
//# sourceMappingURL=notification-service-PbxB-uRp.cjs.map
|