@mhmo91/schmancy 0.2.197 → 0.2.198
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-jv1yAwLh.js → animated-text-Cb07SP6h.js} +3 -3
- package/dist/{animated-text-jv1yAwLh.js.map → animated-text-Cb07SP6h.js.map} +1 -1
- package/dist/{animated-text-DnX2TopW.cjs → animated-text-DML1qmmR.cjs} +2 -2
- package/dist/{animated-text-DnX2TopW.cjs.map → animated-text-DML1qmmR.cjs.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-DMD20wqd.js → area.component-CdFovqHE.js} +3 -3
- package/dist/{area.component-DMD20wqd.js.map → area.component-CdFovqHE.js.map} +1 -1
- package/dist/{area.component-Vs2WGXgk.cjs → area.component-Psgv50Lq.cjs} +2 -2
- package/dist/{area.component-Vs2WGXgk.cjs.map → area.component-Psgv50Lq.cjs.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-BrAxEJJq.cjs → autocomplete-B36XAOQm.cjs} +2 -2
- package/dist/{autocomplete-BrAxEJJq.cjs.map → autocomplete-B36XAOQm.cjs.map} +1 -1
- package/dist/{autocomplete-OS61ngsy.js → autocomplete-BD8oV6Se.js} +3 -3
- package/dist/{autocomplete-OS61ngsy.js.map → autocomplete-BD8oV6Se.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/{avatar-CFcVZgL9.cjs → avatar-COYuuamy.cjs} +2 -2
- package/dist/{avatar-CFcVZgL9.cjs.map → avatar-COYuuamy.cjs.map} +1 -1
- package/dist/{avatar-gkzmu5FJ.js → avatar-CTMclGHR.js} +41 -41
- package/dist/{avatar-gkzmu5FJ.js.map → avatar-CTMclGHR.js.map} +1 -1
- 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-Chd-COYm.cjs → checkbox-C80YxaCN.cjs} +2 -2
- package/dist/{checkbox-Chd-COYm.cjs.map → checkbox-C80YxaCN.cjs.map} +1 -1
- package/dist/{checkbox-CVXRiSWP.js → checkbox-Cntlr_eV.js} +2 -2
- package/dist/{checkbox-CVXRiSWP.js.map → checkbox-Cntlr_eV.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-Bx9gSvN1.cjs → chips-CI-fsAqX.cjs} +2 -2
- package/dist/{chips-Bx9gSvN1.cjs.map → chips-CI-fsAqX.cjs.map} +1 -1
- package/dist/{chips-Dx_erk55.js → chips-vMtInVGX.js} +3 -3
- package/dist/{chips-Dx_erk55.js.map → chips-vMtInVGX.js.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +1 -1
- package/dist/{circular-progress-BQnGvbss.js → circular-progress-8LR4RVjD.js} +3 -3
- package/dist/{circular-progress-BQnGvbss.js.map → circular-progress-8LR4RVjD.js.map} +1 -1
- package/dist/{circular-progress-CNBah5dz.cjs → circular-progress-CSWSAcU6.cjs} +2 -2
- package/dist/{circular-progress-CNBah5dz.cjs.map → circular-progress-CSWSAcU6.cjs.map} +1 -1
- package/dist/circular-progress.cjs +1 -1
- package/dist/circular-progress.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-BW4YaNoF.cjs → date-range-BkVCslGl.cjs} +2 -2
- package/dist/{date-range-BW4YaNoF.cjs.map → date-range-BkVCslGl.cjs.map} +1 -1
- package/dist/{date-range-CtXGl9uE.js → date-range-ChsdVWRV.js} +3 -3
- package/dist/{date-range-CtXGl9uE.js.map → date-range-ChsdVWRV.js.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-BzkhDhs0.cjs → delay-D6UmIwSa.cjs} +2 -2
- package/dist/{delay-BzkhDhs0.cjs.map → delay-D6UmIwSa.cjs.map} +1 -1
- package/dist/{delay-Ds5suSsc.js → delay-DJMIbnvL.js} +2 -2
- package/dist/{delay-Ds5suSsc.js.map → delay-DJMIbnvL.js.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{dialog-content-DFJnYzff.js → dialog-content-CWvxqVsr.js} +3 -3
- package/dist/{dialog-content-DFJnYzff.js.map → dialog-content-CWvxqVsr.js.map} +1 -1
- package/dist/{dialog-content-CJY69qfC.cjs → dialog-content-Cw1Al_Re.cjs} +2 -2
- package/dist/{dialog-content-CJY69qfC.cjs.map → dialog-content-Cw1Al_Re.cjs.map} +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-C3w1_-N1.js → divider-BGo7hglJ.js} +3 -3
- package/dist/{divider-C3w1_-N1.js.map → divider-BGo7hglJ.js.map} +1 -1
- package/dist/{divider-CFzbCFsr.cjs → divider-Cp6EXlTN.cjs} +2 -2
- package/dist/{divider-CFzbCFsr.cjs.map → divider-Cp6EXlTN.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{dropdown-content-BGFYBXcx.js → dropdown-content-CTWWDRgy.js} +3 -3
- package/dist/{dropdown-content-BGFYBXcx.js.map → dropdown-content-CTWWDRgy.js.map} +1 -1
- package/dist/{dropdown-content-PaMOJphI.cjs → dropdown-content-CmCumNjC.cjs} +2 -2
- package/dist/{dropdown-content-PaMOJphI.cjs.map → dropdown-content-CmCumNjC.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-Cy4Stl_1.js → flex-CKtJkkxU.js} +2 -2
- package/dist/{flex-Cy4Stl_1.js.map → flex-CKtJkkxU.js.map} +1 -1
- package/dist/{flex-DP5O5644.cjs → flex-Dyfn6mxF.cjs} +2 -2
- package/dist/{flex-DP5O5644.cjs.map → flex-Dyfn6mxF.cjs.map} +1 -1
- package/dist/{form-BQamcLFL.js → form-BZdw3XUt.js} +2 -2
- package/dist/{form-BQamcLFL.js.map → form-BZdw3XUt.js.map} +1 -1
- package/dist/{form-CG3kns69.cjs → form-BbQRONBu.cjs} +2 -2
- package/dist/{form-CG3kns69.cjs.map → form-BbQRONBu.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-CilwMTXB.cjs → icon-CNkK3oMH.cjs} +2 -2
- package/dist/{icon-CilwMTXB.cjs.map → icon-CNkK3oMH.cjs.map} +1 -1
- package/dist/{icon-Cd4p9jRB.js → icon-PZTHZSsC.js} +3 -3
- package/dist/{icon-Cd4p9jRB.js.map → icon-PZTHZSsC.js.map} +1 -1
- package/dist/{icon-button-By17is4V.js → icon-button-5_uidIo2.js} +3 -3
- package/dist/{icon-button-By17is4V.js.map → icon-button-5_uidIo2.js.map} +1 -1
- package/dist/{icon-button-C4Hf63hY.cjs → icon-button-L6UzTqIn.cjs} +2 -2
- package/dist/{icon-button-C4Hf63hY.cjs.map → icon-button-L6UzTqIn.cjs.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 +39 -39
- package/dist/{input-BIi0rS2t.cjs → input-GETorvfT.cjs} +2 -2
- package/dist/{input-BIi0rS2t.cjs.map → input-GETorvfT.cjs.map} +1 -1
- package/dist/{input-C8OAokVe.js → input-cvO-mD1t.js} +2 -2
- package/dist/{input-C8OAokVe.js.map → input-cvO-mD1t.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-jFsCubuy.cjs → list-BPQwn2ZD.cjs} +2 -2
- package/dist/{list-jFsCubuy.cjs.map → list-BPQwn2ZD.cjs.map} +1 -1
- package/dist/{list-BC3OE3Pu.js → list-CjVW-XS-.js} +2 -2
- package/dist/{list-BC3OE3Pu.js.map → list-CjVW-XS-.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-Cypiq-N-.cjs → litElement.mixin-0pIFA8ru.cjs} +2 -2
- package/dist/{litElement.mixin-Cypiq-N-.cjs.map → litElement.mixin-0pIFA8ru.cjs.map} +1 -1
- package/dist/{litElement.mixin-C6PzcPXd.js → litElement.mixin-BKgKxczr.js} +2 -2
- package/dist/{litElement.mixin-C6PzcPXd.js.map → litElement.mixin-BKgKxczr.js.map} +1 -1
- package/dist/{menu-n_Doj-bW.js → menu-Bj9xX6Hn.js} +3 -3
- package/dist/{menu-n_Doj-bW.js.map → menu-Bj9xX6Hn.js.map} +1 -1
- package/dist/{menu-CDjqdEd6.cjs → menu-BpjaKAXC.cjs} +2 -2
- package/dist/{menu-CDjqdEd6.cjs.map → menu-BpjaKAXC.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--VLqOJJg.cjs → notification-service-BFAKagab.cjs} +12 -12
- package/dist/{notification-service--VLqOJJg.cjs.map → notification-service-BFAKagab.cjs.map} +1 -1
- package/dist/{notification-service-DHIhgWQr.js → notification-service-ITb5rmvM.js} +7 -7
- package/dist/{notification-service-DHIhgWQr.js.map → notification-service-ITb5rmvM.js.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-oyyjCwnL.js → option-_DZj4_on.js} +2 -2
- package/dist/{option-oyyjCwnL.js.map → option-_DZj4_on.js.map} +1 -1
- package/dist/{option-B359EBiZ.cjs → option-vszqrPbH.cjs} +2 -2
- package/dist/{option-B359EBiZ.cjs.map → option-vszqrPbH.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-BSueaw97.js → payment-card-form-CxhMa60Q.js} +3 -3
- package/dist/{payment-card-form-BSueaw97.js.map → payment-card-form-CxhMa60Q.js.map} +1 -1
- package/dist/{payment-card-form-B-ZAsSED.cjs → payment-card-form-DgFUnANa.cjs} +2 -2
- package/dist/{payment-card-form-B-ZAsSED.cjs.map → payment-card-form-DgFUnANa.cjs.map} +1 -1
- package/dist/{radio-button-BO6mIWCi.cjs → radio-button-ChM1WZDg.cjs} +2 -2
- package/dist/{radio-button-BO6mIWCi.cjs.map → radio-button-ChM1WZDg.cjs.map} +1 -1
- package/dist/{radio-button-84TD7rpH.js → radio-button-svaVfPn8.js} +2 -2
- package/dist/{radio-button-84TD7rpH.js.map → radio-button-svaVfPn8.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{schmancy-steps-container-Lo4d27n3.js → schmancy-steps-container-9fHGNLHd.js} +2 -2
- package/dist/{schmancy-steps-container-Lo4d27n3.js.map → schmancy-steps-container-9fHGNLHd.js.map} +1 -1
- package/dist/{schmancy-steps-container-Cfq8OsWt.cjs → schmancy-steps-container-C_-PFkRy.cjs} +2 -2
- package/dist/{schmancy-steps-container-Cfq8OsWt.cjs.map → schmancy-steps-container-C_-PFkRy.cjs.map} +1 -1
- package/dist/{select-B-zgP_v6.js → select-CWulYSxd.js} +3 -3
- package/dist/{select-B-zgP_v6.js.map → select-CWulYSxd.js.map} +1 -1
- package/dist/{select-DhEVsWh6.cjs → select-DEd1YJF0.cjs} +2 -2
- package/dist/{select-DhEVsWh6.cjs.map → select-DEd1YJF0.cjs.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{sheet-BEWq40cN.cjs → sheet-BhKQmvCN.cjs} +2 -2
- package/dist/{sheet-BEWq40cN.cjs.map → sheet-BhKQmvCN.cjs.map} +1 -1
- package/dist/{sheet-DDY4pbD4.js → sheet-C2f1XwT3.js} +3 -3
- package/dist/{sheet-DDY4pbD4.js.map → sheet-C2f1XwT3.js.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-De-H5fe8.cjs → slider-CetPyN3J.cjs} +2 -2
- package/dist/{slider-De-H5fe8.cjs.map → slider-CetPyN3J.cjs.map} +1 -1
- package/dist/{slider--irxEv_B.js → slider-CmJGqDDU.js} +3 -3
- package/dist/{slider--irxEv_B.js.map → slider-CmJGqDDU.js.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-DNz1IjmL.cjs → spinner-CLfAy0cd.cjs} +2 -2
- package/dist/{spinner-DNz1IjmL.cjs.map → spinner-CLfAy0cd.cjs.map} +1 -1
- package/dist/{spinner-Bl9n09Z5.js → spinner-CmJk8fIO.js} +3 -3
- package/dist/{spinner-Bl9n09Z5.js.map → spinner-CmJk8fIO.js.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/{surface-h9dLHMTm.js → surface-BnlEKr-d.js} +2 -2
- package/dist/{surface-h9dLHMTm.js.map → surface-BnlEKr-d.js.map} +1 -1
- package/dist/{surface-BAEUiWcq.cjs → surface-ChxX03-I.cjs} +2 -2
- package/dist/{surface-BAEUiWcq.cjs.map → surface-ChxX03-I.cjs.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-CxazXBjI.js → table-CZJ14ZEI.js} +2 -2
- package/dist/{table-CxazXBjI.js.map → table-CZJ14ZEI.js.map} +1 -1
- package/dist/{table-Dn07ykGG.cjs → table-CzD7rJ5o.cjs} +2 -2
- package/dist/{table-Dn07ykGG.cjs.map → table-CzD7rJ5o.cjs.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-compatibility-BrTxeSS-.cjs → tabs-compatibility-BviE0FdA.cjs} +2 -2
- package/dist/{tabs-compatibility-BrTxeSS-.cjs.map → tabs-compatibility-BviE0FdA.cjs.map} +1 -1
- package/dist/{tabs-compatibility-B8I0vg7Y.js → tabs-compatibility-DHkghYmL.js} +2 -2
- package/dist/{tabs-compatibility-B8I0vg7Y.js.map → tabs-compatibility-DHkghYmL.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{tailwind.mixin-qyIcoDLk.cjs → tailwind.mixin-DFxMrwgk.cjs} +2 -2
- package/dist/{tailwind.mixin-qyIcoDLk.cjs.map → tailwind.mixin-DFxMrwgk.cjs.map} +1 -1
- package/dist/{tailwind.mixin-Du4i6vQR.js → tailwind.mixin-k9HTphsu.js} +2 -2
- package/dist/{tailwind.mixin-Du4i6vQR.js.map → tailwind.mixin-k9HTphsu.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-DibCLxC2.js → textarea-kTwx4MAh.js} +2 -2
- package/dist/{textarea-DibCLxC2.js.map → textarea-kTwx4MAh.js.map} +1 -1
- package/dist/{textarea-pMec4Wpg.cjs → textarea-qNzKErHX.cjs} +2 -2
- package/dist/{textarea-pMec4Wpg.cjs.map → textarea-qNzKErHX.cjs.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-irLEczd5.js → theme-button-CCwPpArv.js} +2 -2
- package/dist/{theme-button-irLEczd5.js.map → theme-button-CCwPpArv.js.map} +1 -1
- package/dist/{theme-button-CG1w_waw.cjs → theme-button-Dt3WQdd4.cjs} +2 -2
- package/dist/{theme-button-CG1w_waw.cjs.map → theme-button-Dt3WQdd4.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-CMM8Xws2.js → theme.component-CJHr6wNa.js} +2 -2
- package/dist/{theme.component-CMM8Xws2.js.map → theme.component-CJHr6wNa.js.map} +1 -1
- package/dist/{theme.component-CpRuySmd.cjs → theme.component-Drq675ta.cjs} +2 -2
- package/dist/{theme.component-CpRuySmd.cjs.map → theme.component-Drq675ta.cjs.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-DIrmlnD6.js → timezone-B53HOn4a.js} +3 -3
- package/dist/{timezone-DIrmlnD6.js.map → timezone-B53HOn4a.js.map} +1 -1
- package/dist/{timezone-n5GflDRe.cjs → timezone-oZ1r5Z54.cjs} +2 -2
- package/dist/{timezone-n5GflDRe.cjs.map → timezone-oZ1r5Z54.cjs.map} +1 -1
- package/dist/{tooltip-N_B-vsDa.js → tooltip-Bfcu9uoC.js} +2 -2
- package/dist/{tooltip-N_B-vsDa.js.map → tooltip-Bfcu9uoC.js.map} +1 -1
- package/dist/{tooltip-0vIcVm5-.cjs → tooltip-DrLzz4rf.cjs} +2 -2
- package/dist/{tooltip-0vIcVm5-.cjs.map → tooltip-DrLzz4rf.cjs.map} +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-Q8AMxJxP.cjs → tree-Buf-0IQD.cjs} +2 -2
- package/dist/{tree-Q8AMxJxP.cjs.map → tree-Buf-0IQD.cjs.map} +1 -1
- package/dist/{tree-2Hf2X0Hv.js → tree-n0KxiiWX.js} +2 -2
- package/dist/{tree-2Hf2X0Hv.js.map → tree-n0KxiiWX.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-CsL-NfYC.cjs → typewriter-DSUU_7wv.cjs} +2 -2
- package/dist/{typewriter-CsL-NfYC.cjs.map → typewriter-DSUU_7wv.cjs.map} +1 -1
- package/dist/{typewriter-bqbNKczJ.js → typewriter-W7Rj384X.js} +4 -4
- package/dist/{typewriter-bqbNKczJ.js.map → typewriter-W7Rj384X.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-Hlts-hzc.cjs → typography-DaN7dGA2.cjs} +2 -2
- package/dist/typography-DaN7dGA2.cjs.map +1 -0
- package/dist/{typography-CbrvouLo.js → typography-XkeTnrP9.js} +6 -6
- package/dist/typography-XkeTnrP9.js.map +1 -0
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +1 -1
- package/types/src/notification/notification-service.d.ts +8 -8
- package/types/src/typography/typography.d.ts +2 -2
- package/dist/typography-CbrvouLo.js.map +0 -1
- package/dist/typography-Hlts-hzc.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-
|
|
1
|
+
{"version":3,"file":"menu-Bj9xX6Hn.js","sources":["../src/menu/menu-item.ts","../src/menu/menu.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n@customElement('schmancy-menu-item')\nexport default class SchmancyMenuItem extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('schmancy-menu-item-click', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-list-item>\n\t\t\t\t<slot></slot>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu-item': SchmancyMenuItem\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, tap } from 'rxjs'\n\n@customElement('schmancy-menu')\nexport default class SchmancyMenu extends TailwindElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t}\n\n\t#menu {\n\t\tdisplay: none;\n\t}\n\n\t#menu[data-show='true'] {\n\t\tdisplay: block;\n\t}\n`) {\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\tprivate cleanup?: any\n\n\tprivate getMiddleware() {\n\t\treturn [\n\t\t\toffset(5),\n\t\t\tflip(),\n\t\t\tshift({ padding: 5 }),\n\t\t\tsize({\n\t\t\t\tapply({ availableHeight, elements }) {\n\t\t\t\t\telements.floating.style.maxHeight = `${availableHeight}px`\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t}\n\n\tasync updatePosition() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) {\n\t\t\treturn\n\t\t}\n\n\t\tawait computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: this.getMiddleware(),\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate showMenu() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) return\n\n\t\tthis.menuElement.dataset.show = 'true'\n\n\t\tthis.cleanup = autoUpdate(this.buttonElement[0], this.menuElement, () => {\n\t\t\tcomputePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: this.getMiddleware(),\n\t\t\t}).then(({ x, y, strategy }) => {\n\t\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y}px`,\n\t\t\t\t\tposition: strategy,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 100,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\n\t\tanimation.onfinish = () => {}\n\t}\n\n\tprivate async hideMenu() {\n\t\t// Make hideMenu async\n\t\tif (this.cleanup) {\n\t\t\tawait this.cleanup() // Await the cleanup!\n\t\t\tthis.cleanup = undefined\n\t\t}\n\t\tthis.menuElement.dataset.show = 'false'\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 75,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\t\tanimation.onfinish = () => {} // No need for a promise now\n\t}\n\n\tfirstUpdated(): void {\n\t\tfromEvent(this.buttonElement, 'click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.showMenu()\n\t\t\t})\n\n\t\tfromEvent(this, 'schmancy-menu-item-click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.hideMenu()\n\t\t\t})\n\n\t\tfromEvent(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((e: Event) => !this.contains(e.target as Node)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\ttap(() => {\n\t\t\t\t\tif (this.menuElement.dataset.show === 'true') {\n\t\t\t\t\t\tthis.hideMenu()\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<slot name=\"button\">\n\t\t\t\t<schmancy-icon-button> more_vert </schmancy-icon-button>\n\t\t\t</slot>\n\t\t\t<ul\n\t\t\t\tid=\"menu\"\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md min-w-[160px] max-w-[320px] w-max bg-surface-default max-h-[90vh] shadow-1 overflow-y-auto\"\n\t\t\t\trole=\"menu\"\n\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\taria-labelledby=\"options-menu-4-button\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu': SchmancyMenu\n\t}\n}\n"],"names":["SchmancyMenuItem","$LitElement","css","super","connectedCallback","fromEvent","this","pipe","takeUntil","disconnecting","subscribe","e","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","render","html","customElement","SchmancyMenu","TailwindElement","getMiddleware","offset","flip","shift","padding","size","availableHeight","elements","floating","style","maxHeight","updatePosition","buttonElement","menuElement","computePosition","placement","middleware","then","x","y","Object","assign","left","top","dataset","show","cleanup","autoUpdate","strategy","position","animate","opacity","transform","duration","easing","onfinish","firstUpdated","tap","showMenu","hideMenu","document","filter","contains","target","__decorateClass","queryAssignedElements","flatten","slot","prototype","query"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const d=require("./litElement.mixin-
|
|
1
|
+
"use strict";const i=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const d=require("./litElement.mixin-0pIFA8ru.cjs"),b=require("./tailwind.mixin-DFxMrwgk.cjs"),u=require("lit"),c=require("lit/decorators.js"),l=require("@floating-ui/dom");var y=Object.getOwnPropertyDescriptor;let p=class extends d.$LitElement(u.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
@@ -33,4 +33,4 @@
|
|
|
33
33
|
<slot></slot>
|
|
34
34
|
</ul>
|
|
35
35
|
`}};h([c.queryAssignedElements({flatten:!0,slot:"button"})],m.prototype,"buttonElement",2),h([c.query("#menu")],m.prototype,"menuElement",2),m=h([c.customElement("schmancy-menu")],m);
|
|
36
|
-
//# sourceMappingURL=menu-
|
|
36
|
+
//# sourceMappingURL=menu-BpjaKAXC.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-
|
|
1
|
+
{"version":3,"file":"menu-BpjaKAXC.cjs","sources":["../src/menu/menu-item.ts","../src/menu/menu.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n@customElement('schmancy-menu-item')\nexport default class SchmancyMenuItem extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('schmancy-menu-item-click', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-list-item>\n\t\t\t\t<slot></slot>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu-item': SchmancyMenuItem\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, tap } from 'rxjs'\n\n@customElement('schmancy-menu')\nexport default class SchmancyMenu extends TailwindElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t}\n\n\t#menu {\n\t\tdisplay: none;\n\t}\n\n\t#menu[data-show='true'] {\n\t\tdisplay: block;\n\t}\n`) {\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\tprivate cleanup?: any\n\n\tprivate getMiddleware() {\n\t\treturn [\n\t\t\toffset(5),\n\t\t\tflip(),\n\t\t\tshift({ padding: 5 }),\n\t\t\tsize({\n\t\t\t\tapply({ availableHeight, elements }) {\n\t\t\t\t\telements.floating.style.maxHeight = `${availableHeight}px`\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t}\n\n\tasync updatePosition() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) {\n\t\t\treturn\n\t\t}\n\n\t\tawait computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: this.getMiddleware(),\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate showMenu() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) return\n\n\t\tthis.menuElement.dataset.show = 'true'\n\n\t\tthis.cleanup = autoUpdate(this.buttonElement[0], this.menuElement, () => {\n\t\t\tcomputePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: this.getMiddleware(),\n\t\t\t}).then(({ x, y, strategy }) => {\n\t\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y}px`,\n\t\t\t\t\tposition: strategy,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 100,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\n\t\tanimation.onfinish = () => {}\n\t}\n\n\tprivate async hideMenu() {\n\t\t// Make hideMenu async\n\t\tif (this.cleanup) {\n\t\t\tawait this.cleanup() // Await the cleanup!\n\t\t\tthis.cleanup = undefined\n\t\t}\n\t\tthis.menuElement.dataset.show = 'false'\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 75,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\t\tanimation.onfinish = () => {} // No need for a promise now\n\t}\n\n\tfirstUpdated(): void {\n\t\tfromEvent(this.buttonElement, 'click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.showMenu()\n\t\t\t})\n\n\t\tfromEvent(this, 'schmancy-menu-item-click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.hideMenu()\n\t\t\t})\n\n\t\tfromEvent(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((e: Event) => !this.contains(e.target as Node)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\ttap(() => {\n\t\t\t\t\tif (this.menuElement.dataset.show === 'true') {\n\t\t\t\t\t\tthis.hideMenu()\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<slot name=\"button\">\n\t\t\t\t<schmancy-icon-button> more_vert </schmancy-icon-button>\n\t\t\t</slot>\n\t\t\t<ul\n\t\t\t\tid=\"menu\"\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md min-w-[160px] max-w-[320px] w-max bg-surface-default max-h-[90vh] shadow-1 overflow-y-auto\"\n\t\t\t\trole=\"menu\"\n\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\taria-labelledby=\"options-menu-4-button\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu': SchmancyMenu\n\t}\n}\n"],"names":["SchmancyMenuItem","$LitElement","css","super","connectedCallback","fromEvent","this","pipe","takeUntil","disconnecting","subscribe","e","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","html","customElement","SchmancyMenu","TailwindElement","offset","flip","shift","padding","size","apply","availableHeight","elements","floating","style","maxHeight","updatePosition","buttonElement","menuElement","computePosition","placement","middleware","getMiddleware","then","x","y","Object","assign","left","top","dataset","show","cleanup","autoUpdate","strategy","position","animate","opacity","transform","duration","easing","onfinish","tap","showMenu","hideMenu","document","filter","contains","target","__decorateClass","queryAssignedElements","flatten","slot","prototype","query"],"mappings":"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"}
|
package/dist/menu.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./menu-
|
|
1
|
+
"use strict";require("./menu-BpjaKAXC.cjs");
|
|
2
2
|
//# sourceMappingURL=menu.cjs.map
|
package/dist/menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./menu-
|
|
1
|
+
import "./menu-Bj9xX6Hn.js";
|
|
2
2
|
//# sourceMappingURL=menu.js.map
|
package/dist/nav-drawer.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-COYuuamy.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
|
|
2
2
|
//# sourceMappingURL=nav-drawer.cjs.map
|
package/dist/nav-drawer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const v=require("rxjs"),T=require("lit/directives/class-map.js"),b=require("lit/directives/style-map.js"),w=require("./litElement.mixin-
|
|
1
|
+
"use strict";const v=require("rxjs"),T=require("lit/directives/class-map.js"),b=require("lit/directives/style-map.js"),w=require("./litElement.mixin-0pIFA8ru.cjs");require("./tailwind.mixin-DFxMrwgk.cjs");const x=require("./ripple-C2BHbhcS.cjs"),l=require("./theme.interface-Xg5Zi46a.cjs"),h=require("lit"),u=require("lit/decorators.js"),A=require("lit/directives/repeat.js");var C=Object.defineProperty,_=Object.getOwnPropertyDescriptor,d=(s,t,e,i)=>{for(var o,n=i>1?void 0:i?_(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&&C(t,e,n),n};exports.SchmancyNotification=class extends w.$LitElement(':host{display:block;margin-bottom:10px}:host:last-child{margin-bottom:0}.notification{width:100%;max-width:400px;box-shadow:var(--schmancy-sys-elevation-2);overflow:hidden;transform:translate(0);opacity:1;transition:transform .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1);background-color:var(--schmancy-sys-color-surface-container);color:var(--schmancy-sys-color-surface-on);border-radius:16px;position:relative}.notification:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none;background:linear-gradient(180deg,#ffffff14,#fff0);z-index:1}.notification.info{border-left:4px solid var(--schmancy-sys-color-primary-default);background-color:color-mix(in srgb,var(--schmancy-sys-color-surface-container) 90%,var(--schmancy-sys-color-primary-container) 10%)}.notification.success{border-left:4px solid var(--schmancy-sys-color-success-default);background-color:color-mix(in srgb,var(--schmancy-sys-color-surface-container) 90%,var(--schmancy-sys-color-success-container) 10%)}.notification.warning{border-left:4px solid var(--schmancy-sys-color-tertiary-default);background-color:color-mix(in srgb,var(--schmancy-sys-color-surface-container) 90%,var(--schmancy-sys-color-tertiary-container) 10%)}.notification.error{border-left:4px solid var(--schmancy-sys-color-error-default);background-color:color-mix(in srgb,var(--schmancy-sys-color-surface-container) 90%,var(--schmancy-sys-color-error-container) 10%)}.notification.closing{transform:translate(120%);opacity:0}.notification .notification-content{display:flex;padding:18px 20px;align-items:flex-start;position:relative;z-index:2}.notification .icon-container{flex-shrink:0;margin-right:14px;display:flex;align-items:center;justify-content:center;border-radius:50%;width:28px;height:28px;position:relative}.notification .content{flex:1;min-width:0;display:flex;flex-direction:column}.notification .title{font-weight:500;font-size:16px;line-height:1.5;margin-bottom:2px;word-break:break-word;letter-spacing:.15px}.notification .message{font-size:14px;line-height:1.5;word-break:break-word;letter-spacing:.25px;opacity:.92}.notification .close-button{background:transparent;border:none;cursor:pointer;color:var(--schmancy-sys-color-surface-onVariant);padding:8px;margin-left:8px;margin-right:-4px;margin-top:-4px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,transform .2s ease}.notification .close-button:hover{background-color:color-mix(in srgb,var(--schmancy-sys-color-surface-onVariant) 8%,transparent);transform:scale(1.05)}.notification .close-button:active{transform:scale(.95)}.notification .close-button:focus-visible{outline:none;box-shadow:0 0 0 2px var(--schmancy-sys-color-primary-default)}.notification .progress-bar-container{height:4px;width:100%;background-color:color-mix(in srgb,currentColor 8%,transparent);overflow:hidden;position:relative;z-index:2}.notification .progress-bar{height:100%;width:100%;transition:width .1s linear;border-radius:0 0 0 4px;background-image:linear-gradient(to right,currentColor 70%,color-mix(in srgb,currentColor 80%,white) 100%);opacity:.9}'){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 h.html``;const s=this._getTypeStyles(),t=this._hovered?"3":"2";return h.html`
|
|
2
2
|
<div
|
|
3
3
|
class=${T.classMap({notification:!0,closing:this._closing,[this.type]:!0})}
|
|
4
4
|
role="alert"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
<div class="content">
|
|
18
|
-
${this.title?
|
|
18
|
+
${this.title?h.html`
|
|
19
19
|
<div
|
|
20
20
|
class="title"
|
|
21
21
|
style=${b.styleMap({color:this.type==="info"?`color-mix(in srgb, ${l.SchmancyTheme.sys.color.primary.default} 90%, ${l.SchmancyTheme.sys.color.surface.on} 10%)`:this.type==="success"?`color-mix(in srgb, ${l.SchmancyTheme.sys.color.success.default} 90%, ${l.SchmancyTheme.sys.color.surface.on} 10%)`:this.type==="warning"?`color-mix(in srgb, ${l.SchmancyTheme.sys.color.tertiary.default} 90%, ${l.SchmancyTheme.sys.color.surface.on} 10%)`:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.error.default} 90%, ${l.SchmancyTheme.sys.color.surface.on} 10%)`})}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<div class="message">${this.message}</div>
|
|
28
28
|
</div>
|
|
29
29
|
|
|
30
|
-
${this.closable?
|
|
30
|
+
${this.closable?h.html`
|
|
31
31
|
<button
|
|
32
32
|
class="close-button"
|
|
33
33
|
aria-label="Close notification"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
`:""}
|
|
52
52
|
</div>
|
|
53
53
|
|
|
54
|
-
${this.duration>0?
|
|
54
|
+
${this.duration>0?h.html`
|
|
55
55
|
<div class="progress-bar-container">
|
|
56
56
|
<div
|
|
57
57
|
class="progress-bar"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
`:""}
|
|
63
63
|
</div>
|
|
64
|
-
`}_getTypeStyles(){switch(this.type){case"success":return{icon:
|
|
64
|
+
`}_getTypeStyles(){switch(this.type){case"success":return{icon:h.html`
|
|
65
65
|
<svg
|
|
66
66
|
width="20"
|
|
67
67
|
height="20"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
|
76
76
|
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
|
77
77
|
</svg>
|
|
78
|
-
`,iconColor:l.SchmancyTheme.sys.color.success.default,progressColor:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.success.default} 95%, ${l.SchmancyTheme.sys.color.success.container} 5%)`};case"warning":return{icon:
|
|
78
|
+
`,iconColor:l.SchmancyTheme.sys.color.success.default,progressColor:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.success.default} 95%, ${l.SchmancyTheme.sys.color.success.container} 5%)`};case"warning":return{icon:h.html`
|
|
79
79
|
<svg
|
|
80
80
|
width="20"
|
|
81
81
|
height="20"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<line x1="12" y1="9" x2="12" y2="13"></line>
|
|
91
91
|
<line x1="12" y1="17" x2="12.01" y2="17"></line>
|
|
92
92
|
</svg>
|
|
93
|
-
`,iconColor:l.SchmancyTheme.sys.color.tertiary.default,progressColor:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.tertiary.default} 90%, ${l.SchmancyTheme.sys.color.tertiary.container} 10%)`};case"error":return{icon:
|
|
93
|
+
`,iconColor:l.SchmancyTheme.sys.color.tertiary.default,progressColor:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.tertiary.default} 90%, ${l.SchmancyTheme.sys.color.tertiary.container} 10%)`};case"error":return{icon:h.html`
|
|
94
94
|
<svg
|
|
95
95
|
width="20"
|
|
96
96
|
height="20"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
<line x1="15" y1="9" x2="9" y2="15"></line>
|
|
106
106
|
<line x1="9" y1="9" x2="15" y2="15"></line>
|
|
107
107
|
</svg>
|
|
108
|
-
`,iconColor:l.SchmancyTheme.sys.color.error.default,progressColor:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.error.default} 92%, ${l.SchmancyTheme.sys.color.error.container} 8%)`};default:return{icon:
|
|
108
|
+
`,iconColor:l.SchmancyTheme.sys.color.error.default,progressColor:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.error.default} 92%, ${l.SchmancyTheme.sys.color.error.container} 8%)`};default:return{icon:h.html`
|
|
109
109
|
<svg
|
|
110
110
|
width="20"
|
|
111
111
|
height="20"
|
|
@@ -120,11 +120,11 @@
|
|
|
120
120
|
<line x1="12" y1="16" x2="12" y2="12"></line>
|
|
121
121
|
<line x1="12" y1="8" x2="12.01" y2="8"></line>
|
|
122
122
|
</svg>
|
|
123
|
-
`,iconColor:l.SchmancyTheme.sys.color.primary.default,progressColor:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.primary.default} 94%, ${l.SchmancyTheme.sys.color.primary.container} 6%)`}}}},h([u.property({type:String})],exports.SchmancyNotification.prototype,"title",2),h([u.property({type:String})],exports.SchmancyNotification.prototype,"message",2),h([u.property({type:String})],exports.SchmancyNotification.prototype,"type",2),h([u.property({type:Boolean})],exports.SchmancyNotification.prototype,"closable",2),h([u.property({type:Number})],exports.SchmancyNotification.prototype,"duration",2),h([u.property({type:String})],exports.SchmancyNotification.prototype,"id",2),h([u.property({type:Boolean})],exports.SchmancyNotification.prototype,"playSound",2),h([u.state()],exports.SchmancyNotification.prototype,"_visible",2),h([u.state()],exports.SchmancyNotification.prototype,"_progress",2),h([u.state()],exports.SchmancyNotification.prototype,"_hovered",2),h([u.state()],exports.SchmancyNotification.prototype,"_closing",2),h([u.state()],exports.SchmancyNotification.prototype,"_autoCloseTimer",2),h([u.state()],exports.SchmancyNotification.prototype,"_progressTimer",2),exports.SchmancyNotification=h([u.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 $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,f=(s,t,e,i)=>{for(var o,n=i>1?void 0:i?k(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.SchmancyNotificationContainer=class extends w.$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),v.fromEvent(window,"schmancy-notification").pipe(v.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`
|
|
123
|
+
`,iconColor:l.SchmancyTheme.sys.color.primary.default,progressColor:`color-mix(in srgb, ${l.SchmancyTheme.sys.color.primary.default} 94%, ${l.SchmancyTheme.sys.color.primary.container} 6%)`}}}},d([u.property({type:String})],exports.SchmancyNotification.prototype,"title",2),d([u.property({type:String})],exports.SchmancyNotification.prototype,"message",2),d([u.property({type:String})],exports.SchmancyNotification.prototype,"type",2),d([u.property({type:Boolean})],exports.SchmancyNotification.prototype,"closable",2),d([u.property({type:Number})],exports.SchmancyNotification.prototype,"duration",2),d([u.property({type:String})],exports.SchmancyNotification.prototype,"id",2),d([u.property({type:Boolean})],exports.SchmancyNotification.prototype,"playSound",2),d([u.state()],exports.SchmancyNotification.prototype,"_visible",2),d([u.state()],exports.SchmancyNotification.prototype,"_progress",2),d([u.state()],exports.SchmancyNotification.prototype,"_hovered",2),d([u.state()],exports.SchmancyNotification.prototype,"_closing",2),d([u.state()],exports.SchmancyNotification.prototype,"_autoCloseTimer",2),d([u.state()],exports.SchmancyNotification.prototype,"_progressTimer",2),exports.SchmancyNotification=d([u.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 $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,f=(s,t,e,i)=>{for(var o,n=i>1?void 0:i?k(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.SchmancyNotificationContainer=class extends w.$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),v.fromEvent(window,"schmancy-notification").pipe(v.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 h.html`
|
|
124
124
|
<div
|
|
125
125
|
class=${T.classMap({"notification-container":!0,[this.position]:!0})}
|
|
126
126
|
>
|
|
127
|
-
${A.repeat(this._notifications,s=>s.id,s=>
|
|
127
|
+
${A.repeat(this._notifications,s=>s.id,s=>h.html`
|
|
128
128
|
<sch-notification
|
|
129
129
|
.id=${s.id}
|
|
130
130
|
.title=${s.title}
|
|
@@ -137,5 +137,5 @@
|
|
|
137
137
|
></sch-notification>
|
|
138
138
|
`)}
|
|
139
139
|
</div>
|
|
140
|
-
`}},f([u.property({type:String})],exports.SchmancyNotificationContainer.prototype,"position",2),f([u.property({type:Number})],exports.SchmancyNotificationContainer.prototype,"maxVisibleNotifications",2),f([u.property({type:Boolean})],exports.SchmancyNotificationContainer.prototype,"playSound",2),f([u.property({type:Number})],exports.SchmancyNotificationContainer.prototype,"audioVolume",2),f([u.state()],exports.SchmancyNotificationContainer.prototype,"_notifications",2),exports.SchmancyNotificationContainer=f([u.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 m=p;const N={show:s=>m.getInstance().notify(s),info:(s,t={})=>m.getInstance().info(s,t),success:(s,t={})=>m.getInstance().success(s,t),warning:(s,t={})=>m.getInstance().warning(s,t),error:(s,t={})=>m.getInstance().error(s,t),customDuration:(s,t,e={})=>m.getInstance().customDuration(s,t,e),persistent:(s,t={})=>m.getInstance().persistent(s,t)};exports.$notify=N,exports.NotificationAudioService=S;
|
|
141
|
-
//# sourceMappingURL=notification-service
|
|
140
|
+
`}},f([u.property({type:String})],exports.SchmancyNotificationContainer.prototype,"position",2),f([u.property({type:Number})],exports.SchmancyNotificationContainer.prototype,"maxVisibleNotifications",2),f([u.property({type:Boolean})],exports.SchmancyNotificationContainer.prototype,"playSound",2),f([u.property({type:Number})],exports.SchmancyNotificationContainer.prototype,"audioVolume",2),f([u.state()],exports.SchmancyNotificationContainer.prototype,"_notifications",2),exports.SchmancyNotificationContainer=f([u.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",duration:t?e.duration:1,...e})}success(t,e={}){return this.notify({message:t??"",type:"success",duration:t?e.duration:1,...e})}warning(t,e={}){return this.notify({message:t??"",type:"warning",duration:t?e.duration:1,...e})}error(t,e={}){return this.notify({message:t??"",type:"error",duration:t?e.duration:1,...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 m=p;const N={show:s=>m.getInstance().notify(s),info:(s,t={})=>m.getInstance().info(s,t),success:(s,t={})=>m.getInstance().success(s,t),warning:(s,t={})=>m.getInstance().warning(s,t),error:(s,t={})=>m.getInstance().error(s,t),customDuration:(s,t,e={})=>m.getInstance().customDuration(s,t,e),persistent:(s,t={})=>m.getInstance().persistent(s,t)};exports.$notify=N,exports.NotificationAudioService=S;
|
|
141
|
+
//# sourceMappingURL=notification-service-BFAKagab.cjs.map
|