@mhmo91/schmancy 0.2.139 → 0.2.142
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-D5Ki7KHu.js → animated-text-CWRnkzJa.js} +3 -3
- package/dist/{animated-text-D5Ki7KHu.js.map → animated-text-CWRnkzJa.js.map} +1 -1
- package/dist/{animated-text-BNbldkLi.cjs → animated-text-UjA34w-f.cjs} +2 -2
- package/dist/{animated-text-BNbldkLi.cjs.map → animated-text-UjA34w-f.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-Bm6rP9MT.cjs → area.component-BEDtgjNb.cjs} +2 -2
- package/dist/{area.component-Bm6rP9MT.cjs.map → area.component-BEDtgjNb.cjs.map} +1 -1
- package/dist/{area.component-D8b2RJic.js → area.component-BzuHoeHG.js} +3 -3
- package/dist/{area.component-D8b2RJic.js.map → area.component-BzuHoeHG.js.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-BAvxzIpj.js → autocomplete-B3W-MX_R.js} +3 -3
- package/dist/{autocomplete-BAvxzIpj.js.map → autocomplete-B3W-MX_R.js.map} +1 -1
- package/dist/{autocomplete-nZaZaU-s.cjs → autocomplete-CtqM8VN6.cjs} +2 -2
- package/dist/{autocomplete-nZaZaU-s.cjs.map → autocomplete-CtqM8VN6.cjs.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.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-yuvdefd4.cjs → checkbox-CGAbsupz.cjs} +2 -2
- package/dist/{checkbox-yuvdefd4.cjs.map → checkbox-CGAbsupz.cjs.map} +1 -1
- package/dist/{checkbox-BPXqV2sc.js → checkbox-gDmmaU-i.js} +2 -2
- package/dist/{checkbox-BPXqV2sc.js.map → checkbox-gDmmaU-i.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-B8bgmplU.js → chips-DtYGQiRe.js} +12 -12
- package/dist/{chips-B8bgmplU.js.map → chips-DtYGQiRe.js.map} +1 -1
- package/dist/{chips-CPmmFVGK.cjs → chips-FOChglMy.cjs} +2 -2
- package/dist/{chips-CPmmFVGK.cjs.map → chips-FOChglMy.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/context-array-BrljBA5R.cjs +2 -0
- package/dist/context-array-BrljBA5R.cjs.map +1 -0
- package/dist/context-array-CSGdoQ1W.js +923 -0
- package/dist/context-array-CSGdoQ1W.js.map +1 -0
- package/dist/{date-range-Mh7mi060.cjs → date-range-CCBukS6w.cjs} +2 -2
- package/dist/{date-range-Mh7mi060.cjs.map → date-range-CCBukS6w.cjs.map} +1 -1
- package/dist/{date-range-XD3eHmKe.js → date-range-CKocQ00P.js} +3 -3
- package/dist/{date-range-XD3eHmKe.js.map → date-range-CKocQ00P.js.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-BEh5HtKm.js → delay-Byk3BNTS.js} +11 -11
- package/dist/{delay-BEh5HtKm.js.map → delay-Byk3BNTS.js.map} +1 -1
- package/dist/{delay-Bz8DPPRF.cjs → delay-DoQ_jIcq.cjs} +2 -2
- package/dist/{delay-Bz8DPPRF.cjs.map → delay-DoQ_jIcq.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{divider-BBy32B6r.js → divider-DW1XYPUt.js} +3 -3
- package/dist/{divider-BBy32B6r.js.map → divider-DW1XYPUt.js.map} +1 -1
- package/dist/{divider-Dxmbn2j0.cjs → divider-Wh-OY6OR.cjs} +2 -2
- package/dist/{divider-Dxmbn2j0.cjs.map → divider-Wh-OY6OR.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-BbafQvop.js → flex-BCcCTIEB.js} +2 -2
- package/dist/{flex-BbafQvop.js.map → flex-BCcCTIEB.js.map} +1 -1
- package/dist/{flex-C64fxWPl.cjs → flex-BaRE9ffF.cjs} +2 -2
- package/dist/{flex-C64fxWPl.cjs.map → flex-BaRE9ffF.cjs.map} +1 -1
- package/dist/{form-WOoGhjQx.cjs → form-B0CyaQwH.cjs} +2 -2
- package/dist/{form-WOoGhjQx.cjs.map → form-B0CyaQwH.cjs.map} +1 -1
- package/dist/{form-CjB8ReAw.js → form-DvQXRrGJ.js} +2 -2
- package/dist/{form-CjB8ReAw.js.map → form-DvQXRrGJ.js.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-D3FyfFuy.cjs → icon-BqQnZfcC.cjs} +2 -2
- package/dist/{icon-D3FyfFuy.cjs.map → icon-BqQnZfcC.cjs.map} +1 -1
- package/dist/{icon-1L_noI_n.js → icon-CoTwcGO7.js} +3 -3
- package/dist/{icon-1L_noI_n.js.map → icon-CoTwcGO7.js.map} +1 -1
- package/dist/{icon-button-Bfd0mfs9.cjs → icon-button-B3LSOKYP.cjs} +2 -2
- package/dist/{icon-button-Bfd0mfs9.cjs.map → icon-button-B3LSOKYP.cjs.map} +1 -1
- package/dist/{icon-button-Dji1Ck9p.js → icon-button-BMkOl7zP.js} +3 -3
- package/dist/{icon-button-Dji1Ck9p.js.map → icon-button-BMkOl7zP.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 +136 -123
- package/dist/index.js.map +1 -1
- package/dist/{input-leV-sK9y.cjs → input-A8mZ7r9Z.cjs} +2 -2
- package/dist/{input-leV-sK9y.cjs.map → input-A8mZ7r9Z.cjs.map} +1 -1
- package/dist/{input-DIgPPDf4.js → input-FLgsuB5g.js} +2 -2
- package/dist/{input-DIgPPDf4.js.map → input-FLgsuB5g.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-8U7mFDmR.cjs → list-4_krEg2r.cjs} +2 -2
- package/dist/{list-8U7mFDmR.cjs.map → list-4_krEg2r.cjs.map} +1 -1
- package/dist/{list-DiARM4rT.js → list-DxHWsB3z.js} +2 -2
- package/dist/{list-DiARM4rT.js.map → list-DxHWsB3z.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-DBsn92pk.cjs → litElement.mixin-CssoQifr.cjs} +2 -2
- package/dist/{litElement.mixin-DBsn92pk.cjs.map → litElement.mixin-CssoQifr.cjs.map} +1 -1
- package/dist/{litElement.mixin-BOOn7U5Z.js → litElement.mixin-fACDhe7J.js} +2 -2
- package/dist/{litElement.mixin-BOOn7U5Z.js.map → litElement.mixin-fACDhe7J.js.map} +1 -1
- package/dist/{menu-Br6X3wmF.cjs → menu-fEUIZGXJ.cjs} +2 -2
- package/dist/{menu-Br6X3wmF.cjs.map → menu-fEUIZGXJ.cjs.map} +1 -1
- package/dist/{menu-xQx6N8LO.js → menu-rWt1jKex.js} +3 -3
- package/dist/{menu-xQx6N8LO.js.map → menu-rWt1jKex.js.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins/tailwind.css +5 -0
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/notification-container-DKLh7Vt2.js +447 -0
- package/dist/notification-container-DKLh7Vt2.js.map +1 -0
- package/dist/notification-container-DdUjZ0bi.cjs +124 -0
- package/dist/notification-container-DdUjZ0bi.cjs.map +1 -0
- package/dist/notification-service-DWeUoHi2.js +29 -0
- package/dist/notification-service-DWeUoHi2.js.map +1 -0
- package/dist/notification-service-DXXrRCmK.cjs +2 -0
- package/dist/notification-service-DXXrRCmK.cjs.map +1 -0
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +7 -4
- package/dist/notification.js.map +1 -1
- package/dist/{option-C1ZeDVrC.cjs → option-CpmK20dy.cjs} +2 -2
- package/dist/{option-C1ZeDVrC.cjs.map → option-CpmK20dy.cjs.map} +1 -1
- package/dist/{option-Dx2AWiaj.js → option-ztBnKZ_w.js} +2 -2
- package/dist/{option-Dx2AWiaj.js.map → option-ztBnKZ_w.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-CJ4YDbUJ.js → payment-card-form-CUgTRvBS.js} +3 -3
- package/dist/{payment-card-form-CJ4YDbUJ.js.map → payment-card-form-CUgTRvBS.js.map} +1 -1
- package/dist/{payment-card-form-liiHN2py.cjs → payment-card-form-DmHX_20B.cjs} +2 -2
- package/dist/{payment-card-form-liiHN2py.cjs.map → payment-card-form-DmHX_20B.cjs.map} +1 -1
- package/dist/{radio-group-C067Z6Sx.js → radio-group-BZMhEi5P.js} +2 -2
- package/dist/{radio-group-C067Z6Sx.js.map → radio-group-BZMhEi5P.js.map} +1 -1
- package/dist/{radio-group-9pg4qU4Q.cjs → radio-group-DOpJu0Pc.cjs} +2 -2
- package/dist/{radio-group-9pg4qU4Q.cjs.map → radio-group-DOpJu0Pc.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rxjs-utils.js +4 -4
- package/dist/{schmancy-steps-container-W8iUrjjQ.cjs → schmancy-steps-container-B5UOYQG8.cjs} +2 -2
- package/dist/{schmancy-steps-container-W8iUrjjQ.cjs.map → schmancy-steps-container-B5UOYQG8.cjs.map} +1 -1
- package/dist/{schmancy-steps-container-CXOh8tn7.js → schmancy-steps-container-srToeIjV.js} +2 -2
- package/dist/{schmancy-steps-container-CXOh8tn7.js.map → schmancy-steps-container-srToeIjV.js.map} +1 -1
- package/dist/{select-Ebp9Y6T_.cjs → select-0NLmJErW.cjs} +2 -2
- package/dist/{select-Ebp9Y6T_.cjs.map → select-0NLmJErW.cjs.map} +1 -1
- package/dist/{select-CbiLYVGN.js → select-Dx6IF984.js} +3 -3
- package/dist/{select-CbiLYVGN.js.map → select-Dx6IF984.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/selector-hook-0691Losv.js +323 -0
- package/dist/selector-hook-0691Losv.js.map +1 -0
- package/dist/selector-hook-SzNTYQII.cjs +2 -0
- package/dist/selector-hook-SzNTYQII.cjs.map +1 -0
- package/dist/{sheet-BZ4d5wLR.js → sheet-Bl64wfBe.js} +3 -3
- package/dist/{sheet-BZ4d5wLR.js.map → sheet-Bl64wfBe.js.map} +1 -1
- package/dist/{sheet-DoWympTj.cjs → sheet-BwsspKto.cjs} +2 -2
- package/dist/{sheet-DoWympTj.cjs.map → sheet-BwsspKto.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-BGzs57Nd.cjs → slider-9zdabbA2.cjs} +2 -2
- package/dist/{slider-BGzs57Nd.cjs.map → slider-9zdabbA2.cjs.map} +1 -1
- package/dist/{slider-Bwt5zt67.js → slider-nyTR0hyw.js} +3 -3
- package/dist/{slider-Bwt5zt67.js.map → slider-nyTR0hyw.js.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-B6Yx9jX1.js → spinner-37Y-o4jr.js} +3 -3
- package/dist/{spinner-B6Yx9jX1.js.map → spinner-37Y-o4jr.js.map} +1 -1
- package/dist/{spinner-vlXVxDki.cjs → spinner-D46_Vbxf.cjs} +2 -2
- package/dist/{spinner-vlXVxDki.cjs.map → spinner-D46_Vbxf.cjs.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.js +33 -23
- package/dist/{surface-CXwP49Mi.cjs → surface-DFXFQBBC.cjs} +2 -2
- package/dist/{surface-CXwP49Mi.cjs.map → surface-DFXFQBBC.cjs.map} +1 -1
- package/dist/{surface-C2lcwsKJ.js → surface-RtVWZEdq.js} +2 -2
- package/dist/{surface-C2lcwsKJ.js.map → surface-RtVWZEdq.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-2-DnKwRo.cjs → table-BG1_ofOE.cjs} +2 -2
- package/dist/{table-2-DnKwRo.cjs.map → table-BG1_ofOE.cjs.map} +1 -1
- package/dist/{table-CWfF0shQ.js → table-CGdNPIeN.js} +2 -2
- package/dist/{table-CWfF0shQ.js.map → table-CGdNPIeN.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-group-CPUDkhJ_.cjs → tabs-group-BVsNqqN1.cjs} +2 -2
- package/dist/{tabs-group-CPUDkhJ_.cjs.map → tabs-group-BVsNqqN1.cjs.map} +1 -1
- package/dist/{tabs-group-DXMbbWuO.js → tabs-group-CvHe90C_.js} +2 -2
- package/dist/{tabs-group-DXMbbWuO.js.map → tabs-group-CvHe90C_.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-1drvGQKC.cjs +2 -0
- package/dist/{tailwind.mixin-CWsvBayE.cjs.map → tailwind.mixin-1drvGQKC.cjs.map} +1 -1
- package/dist/tailwind.mixin-C7U3gr3P.js +43 -0
- package/dist/{tailwind.mixin-C8nuH8uq.js.map → tailwind.mixin-C7U3gr3P.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-tDzioCA7.js → teleport.component-Du14Yyxz.js} +63 -63
- package/dist/{teleport.component-tDzioCA7.js.map → teleport.component-Du14Yyxz.js.map} +1 -1
- package/dist/{teleport.component-BMTMnjJi.cjs → teleport.component-Vicu2fPa.cjs} +2 -2
- package/dist/{teleport.component-BMTMnjJi.cjs.map → teleport.component-Vicu2fPa.cjs.map} +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-08VY-gi0.cjs → textarea-D1nov2H8.cjs} +2 -2
- package/dist/{textarea-08VY-gi0.cjs.map → textarea-D1nov2H8.cjs.map} +1 -1
- package/dist/{textarea-KY-H0XE9.js → textarea-Ddi7wWLs.js} +2 -2
- package/dist/{textarea-KY-H0XE9.js.map → textarea-Ddi7wWLs.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-Cp3y37Mz.js → theme-button-84n-IAL1.js} +2 -2
- package/dist/{theme-button-Cp3y37Mz.js.map → theme-button-84n-IAL1.js.map} +1 -1
- package/dist/{theme-button-TChFwWi6.cjs → theme-button-C-g9a2ZF.cjs} +2 -2
- package/dist/{theme-button-TChFwWi6.cjs.map → theme-button-C-g9a2ZF.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-Bgh-j4WN.cjs → theme.component-C61DdKLT.cjs} +2 -2
- package/dist/{theme.component-Bgh-j4WN.cjs.map → theme.component-C61DdKLT.cjs.map} +1 -1
- package/dist/{theme.component-tcsmGB6n.js → theme.component-Dk0d_7Og.js} +47 -47
- package/dist/{theme.component-tcsmGB6n.js.map → theme.component-Dk0d_7Og.js.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-DwTl04Fb.cjs → timezone-2Eb26kSx.cjs} +2 -4
- package/dist/timezone-2Eb26kSx.cjs.map +1 -0
- package/dist/{timezone-Cob3Zs1V.js → timezone-C8cbkh7P.js} +3 -5
- package/dist/timezone-C8cbkh7P.js.map +1 -0
- package/dist/{tree-CBYb1k5W.cjs → tree-CsKV00BK.cjs} +2 -2
- package/dist/{tree-CBYb1k5W.cjs.map → tree-CsKV00BK.cjs.map} +1 -1
- package/dist/{tree-DR5qkGYr.js → tree-_dvGG1Dk.js} +2 -2
- package/dist/{tree-DR5qkGYr.js.map → tree-_dvGG1Dk.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-DKXGVYPg.cjs → typewriter-BTKJ8mPR.cjs} +2 -2
- package/dist/{typewriter-DKXGVYPg.cjs.map → typewriter-BTKJ8mPR.cjs.map} +1 -1
- package/dist/{typewriter-BJk9hiPU.js → typewriter-D1rGUZyO.js} +4 -4
- package/dist/{typewriter-BJk9hiPU.js.map → typewriter-D1rGUZyO.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-Czz5ZTwN.cjs → typography-BJzp77zk.cjs} +2 -2
- package/dist/{typography-Czz5ZTwN.cjs.map → typography-BJzp77zk.cjs.map} +1 -1
- package/dist/{typography-B3-y3gWb.js → typography-C3AU6NFt.js} +2 -2
- package/dist/{typography-B3-y3gWb.js.map → typography-C3AU6NFt.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +2 -1
- package/types/src/notification/index.d.ts +6 -3
- package/types/src/notification/notification-audio-generator.d.ts +45 -0
- package/types/src/notification/notification-audio.d.ts +70 -0
- package/types/src/notification/notification-container.d.ts +44 -0
- package/types/src/notification/notification-service.d.ts +60 -0
- package/types/src/notification/notification.d.ts +33 -4
- package/types/src/store/context-array.d.ts +83 -0
- package/types/src/store/context-collection.d.ts +20 -41
- package/types/src/store/context-create.d.ts +31 -9
- package/types/src/store/context-object.d.ts +14 -43
- package/types/src/store/filter-directive.d.ts +62 -5
- package/types/src/store/immer-integration.d.ts +60 -0
- package/types/src/store/selector-hook.d.ts +4 -0
- package/types/src/store/selectors.d.ts +29 -20
- package/types/src/store/store.class.d.ts +67 -0
- package/types/src/store/types.d.ts +102 -0
- package/dist/context-object-BDXZ5EKJ.js +0 -306
- package/dist/context-object-BDXZ5EKJ.js.map +0 -1
- package/dist/context-object-BIywslrO.cjs +0 -2
- package/dist/context-object-BIywslrO.cjs.map +0 -1
- package/dist/outlet-CI05jyjr.cjs +0 -61
- package/dist/outlet-CI05jyjr.cjs.map +0 -1
- package/dist/outlet-CScugbm9.js +0 -128
- package/dist/outlet-CScugbm9.js.map +0 -1
- package/dist/selector-hook-C6VCezv7.js +0 -273
- package/dist/selector-hook-C6VCezv7.js.map +0 -1
- package/dist/selector-hook-DDaYMsHs.cjs +0 -2
- package/dist/selector-hook-DDaYMsHs.cjs.map +0 -1
- package/dist/tailwind.mixin-C8nuH8uq.js +0 -43
- package/dist/tailwind.mixin-CWsvBayE.cjs +0 -2
- package/dist/timezone-Cob3Zs1V.js.map +0 -1
- package/dist/timezone-DwTl04Fb.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-
|
|
1
|
+
{"version":3,"file":"menu-fEUIZGXJ.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":"qUAMA,IAAqBA,EAArB,cAA8CC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,CAAA,CAAA,mBACCC,CAAAA,MAAMC,kBACIC,EAAAA,EAAAA,UAAAC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C,GAAKA,EAAEC,gBAAAA,CAAAA,EACXJ,EAAAA,UAAUF,KAAKG,aAAAA,CAAAA,EAEfC,UAAU,IAAA,CACVJ,KAAKsD,SAAAA,CAAS,GAGNvD,YAAAwD,SAAU,OAAA,EAClBtD,KACAuD,EAAAA,OAAQnD,GAAAA,CAAcL,KAAKyD,SAASpD,EAAEqD,MAAAA,CAAAA,EACtCxD,EAAAA,UAAUF,KAAKG,aAAAA,EACfiD,EAAAA,IAAI,IACmC,CAAlCpD,KAAK4B,YAAYY,QAAQC,OAAS,QACrCzC,KAAKsD,SAAAA,CAAS,CAIhBlD,CAAAA,EAAAA,UAAAA,CAAU,CAGb,QACQ,CAAA,OAAAO,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAA,CAzHRgD,EAAAA,EAAA,CADCC,EAAAA,sBAAsB,CAAEC,QAAS,GAAMC,KAAM,QAAA,CAAA,CAAA,EAd1BjD,EAepBkD,UAAA,gBAAA,CAAA,EAEgBJ,EAAA,CAAfK,EAAAA,MAAM,OAjBanD,CAAAA,EAAAA,EAiBJkD,UAAA,cAAA,CAjBIlD,EAAAA,EAArB8C,EAAA,CADC/C,EAAAA,cAAc,eACMC,CAAAA,EAAAA,CAAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fromEvent as l, takeUntil as r, tap as c, filter as f } from "rxjs";
|
|
2
2
|
import "lit/directives/class-map.js";
|
|
3
3
|
import "lit/directives/style-map.js";
|
|
4
|
-
import { $ as g } from "./litElement.mixin-
|
|
5
|
-
import { T as E } from "./tailwind.mixin-
|
|
4
|
+
import { $ as g } from "./litElement.mixin-fACDhe7J.js";
|
|
5
|
+
import { T as E } from "./tailwind.mixin-C7U3gr3P.js";
|
|
6
6
|
import { css as d, html as b } from "lit";
|
|
7
7
|
import { customElement as y, queryAssignedElements as w, query as v } from "lit/decorators.js";
|
|
8
8
|
import { offset as x, flip as k, shift as M, size as P, computePosition as p, autoUpdate as O } from "@floating-ui/dom";
|
|
@@ -96,4 +96,4 @@ let m = class extends E(d`
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
u([w({ flatten: !0, slot: "button" })], m.prototype, "buttonElement", 2), u([v("#menu")], m.prototype, "menuElement", 2), m = u([y("schmancy-menu")], m);
|
|
99
|
-
//# sourceMappingURL=menu-
|
|
99
|
+
//# sourceMappingURL=menu-rWt1jKex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-
|
|
1
|
+
{"version":3,"file":"menu-rWt1jKex.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":";;;;;;;;;AAMA,IAAqBA,IAArB,cAA8CC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,EAAA;AAAA,EAAA,oBACCC;AAAAA,UAAMC,kBACIC,GAAAA,EAAAC,MAAM,OAAA,EACdC,KAAKC,EAAUF,KAAKG,aAAAA,CAAAA,EACpBC,UAAeC,OAAAA;AACfA,QAAEC,gBAAAA,GACGN,KAAAO,cACJ,IAAIC,YAAY,4BAA4B,EAC3CC,SAAS,IACTC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A,IAAS,IAGNxD,EAAAyD,UAAU,OAClBvD,EAAAA,KACAwD,EAAQpD,OAAAA,CAAcL,KAAK0D,SAASrD,EAAEsD,MAAAA,CAAAA,GACtCzD,EAAUF,KAAKG,aACfkD,GAAAA,EAAI,MACmC;AAAA,MAAlCrD,KAAK6B,YAAYW,QAAQC,SAAS,UACrCzC,KAAKuD,SAAAA;AAAAA,IAAS,CAIhBnD,CAAAA,EAAAA,UAAAA;AAAAA,EAAU;AAAA,EAGb,SACQ;AAAA,WAAAQ;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAAA;AAzHRgD;AAAAA,EAAA,CADCC,EAAsB,EAAEC,SAAAA,IAAeC,MAAM,SAAA,CAAA,CAAA,GAd1BjD,EAepBkD,WAAA,iBAAA,CAAA,GAEgBJ,EAAA,CAAfK,EAAM,OAjBanD,CAAAA,GAAAA,EAiBJkD,WAAA,eAAA,IAjBIlD,IAArB8C,EAAA,CADC/C,EAAc,eACMC,CAAAA,GAAAA,CAAAA;"}
|
package/dist/menu.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./menu-
|
|
1
|
+
"use strict";require("./menu-fEUIZGXJ.cjs");
|
|
2
2
|
//# sourceMappingURL=menu.cjs.map
|
package/dist/menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./menu-
|
|
1
|
+
import "./menu-rWt1jKex.js";
|
|
2
2
|
//# sourceMappingURL=menu.js.map
|
package/dist/mixins/tailwind.css
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
--color-scrim: var(--schmancy-sys-color-scrim);
|
|
16
16
|
--color-outline: var(--schmancy-sys-color-outline);
|
|
17
17
|
--color-outlineVariant: var(--schmancy-sys-color-outlineVariant);
|
|
18
|
+
--color-outline-variant: var(--schmancy-sys-color-outlineVariant);
|
|
18
19
|
--color-surface-default: var(--schmancy-sys-color-surface-default);
|
|
19
20
|
--color-surface-dim: var(--schmancy-sys-color-surface-dim);
|
|
20
21
|
--color-surface-bright: var(--schmancy-sys-color-surface-bright);
|
|
@@ -25,10 +26,12 @@
|
|
|
25
26
|
--color-surface-lowest: var(--schmancy-sys-color-surface-lowest);
|
|
26
27
|
--color-surface-on: var(--schmancy-sys-color-surface-on);
|
|
27
28
|
--color-surface-onVariant: var(--schmancy-sys-color-surface-onVariant);
|
|
29
|
+
--color-surface-on-variant: var(--schmancy-sys-color-surface-onVariant);
|
|
28
30
|
--color-primary-default: var(--schmancy-sys-color-primary-default);
|
|
29
31
|
--color-primary-on: var(--schmancy-sys-color-primary-on);
|
|
30
32
|
--color-primary-container: var(--schmancy-sys-color-primary-container);
|
|
31
33
|
--color-primary-onContainer: var(--schmancy-sys-color-primary-onContainer);
|
|
34
|
+
--color-primary-on-container: var(--schmancy-sys-color-primary-onContainer);
|
|
32
35
|
--color-secondary-default: var(--schmancy-sys-color-secondary-default);
|
|
33
36
|
--color-secondary-on: var(--schmancy-sys-color-secondary-on);
|
|
34
37
|
--color-secondary-container: var(--schmancy-sys-color-secondary-container);
|
|
@@ -41,10 +44,12 @@
|
|
|
41
44
|
--color-error-on: var(--schmancy-sys-color-error-on);
|
|
42
45
|
--color-error-container: var(--schmancy-sys-color-error-container);
|
|
43
46
|
--color-error-onContainer: var(--schmancy-sys-color-error-onContainer);
|
|
47
|
+
--color-error-on-container: var(--schmancy-sys-color-error-onContainer);
|
|
44
48
|
--color-success-default: var(--schmancy-sys-color-success-default);
|
|
45
49
|
--color-success-on: var(--schmancy-sys-color-success-on);
|
|
46
50
|
--color-success-container: var(--schmancy-sys-color-success-container);
|
|
47
51
|
--color-success-onContainer: var(--schmancy-sys-color-success-onContainer);
|
|
52
|
+
--color-success-on-container: var(--schmancy-sys-color-success-onContainer);
|
|
48
53
|
--shadow-0: var(--schmancy-sys-elevation-0);
|
|
49
54
|
--shadow-1: var(--schmancy-sys-elevation-1);
|
|
50
55
|
--shadow-2: var(--schmancy-sys-elevation-2);
|
package/dist/nav-drawer.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-Vicu2fPa.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
|
-
import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-
|
|
1
|
+
import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-Du14Yyxz.js";
|
|
2
2
|
export {
|
|
3
3
|
c as $drawer,
|
|
4
4
|
e as SchmancyDrawerAppbar,
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { fromEvent as A, takeUntil as _ } from "rxjs";
|
|
2
|
+
import { classMap as x } from "lit/directives/class-map.js";
|
|
3
|
+
import { styleMap as S } from "lit/directives/style-map.js";
|
|
4
|
+
import { $ as T } from "./litElement.mixin-fACDhe7J.js";
|
|
5
|
+
import "./tailwind.mixin-C7U3gr3P.js";
|
|
6
|
+
import { c as w } from "./ripple-BumgqsDT.js";
|
|
7
|
+
import { S as h } from "./theme.interface-C5Kj6WjD.js";
|
|
8
|
+
import { html as d } from "lit";
|
|
9
|
+
import { property as p, state as f, customElement as b } from "lit/decorators.js";
|
|
10
|
+
import { repeat as C } from "lit/directives/repeat.js";
|
|
11
|
+
var V = Object.defineProperty, k = Object.getOwnPropertyDescriptor, u = (a, t, e, i) => {
|
|
12
|
+
for (var o, n = i > 1 ? void 0 : i ? k(t, e) : t, s = a.length - 1; s >= 0; s--) (o = a[s]) && (n = (i ? o(t, e, n) : o(n)) || n);
|
|
13
|
+
return i && n && V(t, e, n), n;
|
|
14
|
+
};
|
|
15
|
+
let c = class extends T(":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}") {
|
|
16
|
+
constructor() {
|
|
17
|
+
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;
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
super.connectedCallback(), this.duration > 0 && this._startAutoCloseTimer(), this.playSound && this._playSound();
|
|
21
|
+
}
|
|
22
|
+
disconnectedCallback() {
|
|
23
|
+
this._clearTimers(), super.disconnectedCallback();
|
|
24
|
+
}
|
|
25
|
+
updated(a) {
|
|
26
|
+
super.updated(a), a.has("duration") && this.duration > 0 && (this._clearTimers(), this._startAutoCloseTimer());
|
|
27
|
+
}
|
|
28
|
+
_startAutoCloseTimer() {
|
|
29
|
+
if (this.duration <= 0) return;
|
|
30
|
+
const a = Date.now() + this.duration;
|
|
31
|
+
this._autoCloseTimer = window.setTimeout(() => {
|
|
32
|
+
this.close();
|
|
33
|
+
}, this.duration), this._progressTimer = window.setInterval(() => {
|
|
34
|
+
if (this._hovered) return;
|
|
35
|
+
const t = Date.now(), e = Math.max(0, a - t);
|
|
36
|
+
this._progress = e / this.duration * 100, e <= 0 && this._clearTimers();
|
|
37
|
+
}, 16);
|
|
38
|
+
}
|
|
39
|
+
_clearTimers() {
|
|
40
|
+
this._autoCloseTimer && (clearTimeout(this._autoCloseTimer), this._autoCloseTimer = void 0), this._progressTimer && (clearInterval(this._progressTimer), this._progressTimer = void 0);
|
|
41
|
+
}
|
|
42
|
+
_pauseTimers() {
|
|
43
|
+
this._clearTimers();
|
|
44
|
+
}
|
|
45
|
+
_resumeTimers() {
|
|
46
|
+
if (this.duration > 0) {
|
|
47
|
+
const a = this._progress / 100 * this.duration;
|
|
48
|
+
if (a > 0) {
|
|
49
|
+
this._autoCloseTimer = window.setTimeout(() => {
|
|
50
|
+
this.close();
|
|
51
|
+
}, a);
|
|
52
|
+
const t = Date.now() + a;
|
|
53
|
+
this._progressTimer = window.setInterval(() => {
|
|
54
|
+
if (this._hovered) return;
|
|
55
|
+
const e = Date.now(), i = Math.max(0, t - e);
|
|
56
|
+
this._progress = i / a * 100, i <= 0 && this._clearTimers();
|
|
57
|
+
}, 16);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
_playSound() {
|
|
62
|
+
this.dispatchEvent(new CustomEvent("playsound", { detail: { type: this.type }, bubbles: !0, composed: !0 }));
|
|
63
|
+
}
|
|
64
|
+
_handleMouseEnter() {
|
|
65
|
+
this._hovered = !0, this._pauseTimers();
|
|
66
|
+
}
|
|
67
|
+
_handleMouseLeave() {
|
|
68
|
+
this._hovered = !1, this._resumeTimers();
|
|
69
|
+
}
|
|
70
|
+
close() {
|
|
71
|
+
this._closing || (this._closing = !0, this._clearTimers(), this._visible = !1, setTimeout(() => {
|
|
72
|
+
this.dispatchEvent(new CustomEvent("close", { detail: { id: this.id }, bubbles: !0, composed: !0 }));
|
|
73
|
+
}, 300));
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
if (!this._visible && this._closing) return d``;
|
|
77
|
+
const a = this._getTypeStyles();
|
|
78
|
+
return d`
|
|
79
|
+
<div
|
|
80
|
+
class=${x({ notification: !0, closing: this._closing, [this.type]: !0 })}
|
|
81
|
+
role="alert"
|
|
82
|
+
style=${S({ transform: this._closing ? "translateX(120%)" : "translateX(0)", opacity: this._closing ? "0" : "1" })}
|
|
83
|
+
@mouseenter=${this._handleMouseEnter}
|
|
84
|
+
@mouseleave=${this._handleMouseLeave}
|
|
85
|
+
>
|
|
86
|
+
<div class="notification-content">
|
|
87
|
+
<div class="icon-container" ${w({ color: a.iconColor })}>${a.icon}</div>
|
|
88
|
+
|
|
89
|
+
<div class="content">
|
|
90
|
+
${this.title ? d` <div class="title">${this.title}</div> ` : ""}
|
|
91
|
+
|
|
92
|
+
<div class="message">${this.message}</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
${this.closable ? d`
|
|
96
|
+
<button class="close-button" aria-label="Close notification" @click=${this.close}>
|
|
97
|
+
<svg
|
|
98
|
+
width="16"
|
|
99
|
+
height="16"
|
|
100
|
+
viewBox="0 0 24 24"
|
|
101
|
+
fill="none"
|
|
102
|
+
stroke="currentColor"
|
|
103
|
+
stroke-width="2"
|
|
104
|
+
stroke-linecap="round"
|
|
105
|
+
stroke-linejoin="round"
|
|
106
|
+
>
|
|
107
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
108
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
109
|
+
</svg>
|
|
110
|
+
</button>
|
|
111
|
+
` : ""}
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
${this.duration > 0 ? d`
|
|
115
|
+
<div class="progress-bar-container">
|
|
116
|
+
<div
|
|
117
|
+
class="progress-bar"
|
|
118
|
+
style="width: ${this._progress}%"
|
|
119
|
+
${w({ bgColor: a.progressColor })}
|
|
120
|
+
></div>
|
|
121
|
+
</div>
|
|
122
|
+
` : ""}
|
|
123
|
+
</div>
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
_getTypeStyles() {
|
|
127
|
+
switch (this.type) {
|
|
128
|
+
case "success":
|
|
129
|
+
return { icon: d`
|
|
130
|
+
<svg
|
|
131
|
+
width="20"
|
|
132
|
+
height="20"
|
|
133
|
+
viewBox="0 0 24 24"
|
|
134
|
+
fill="none"
|
|
135
|
+
stroke="currentColor"
|
|
136
|
+
stroke-width="2"
|
|
137
|
+
stroke-linecap="round"
|
|
138
|
+
stroke-linejoin="round"
|
|
139
|
+
>
|
|
140
|
+
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
|
141
|
+
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
|
142
|
+
</svg>
|
|
143
|
+
`, iconColor: h.sys.color.success.default, progressColor: h.sys.color.success.default };
|
|
144
|
+
case "warning":
|
|
145
|
+
return { icon: d`
|
|
146
|
+
<svg
|
|
147
|
+
width="20"
|
|
148
|
+
height="20"
|
|
149
|
+
viewBox="0 0 24 24"
|
|
150
|
+
fill="none"
|
|
151
|
+
stroke="currentColor"
|
|
152
|
+
stroke-width="2"
|
|
153
|
+
stroke-linecap="round"
|
|
154
|
+
stroke-linejoin="round"
|
|
155
|
+
>
|
|
156
|
+
<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>
|
|
157
|
+
<line x1="12" y1="9" x2="12" y2="13"></line>
|
|
158
|
+
<line x1="12" y1="17" x2="12.01" y2="17"></line>
|
|
159
|
+
</svg>
|
|
160
|
+
`, iconColor: h.sys.color.tertiary.default, progressColor: h.sys.color.tertiary.default };
|
|
161
|
+
case "error":
|
|
162
|
+
return { icon: d`
|
|
163
|
+
<svg
|
|
164
|
+
width="20"
|
|
165
|
+
height="20"
|
|
166
|
+
viewBox="0 0 24 24"
|
|
167
|
+
fill="none"
|
|
168
|
+
stroke="currentColor"
|
|
169
|
+
stroke-width="2"
|
|
170
|
+
stroke-linecap="round"
|
|
171
|
+
stroke-linejoin="round"
|
|
172
|
+
>
|
|
173
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
174
|
+
<line x1="15" y1="9" x2="9" y2="15"></line>
|
|
175
|
+
<line x1="9" y1="9" x2="15" y2="15"></line>
|
|
176
|
+
</svg>
|
|
177
|
+
`, iconColor: h.sys.color.error.default, progressColor: h.sys.color.error.default };
|
|
178
|
+
default:
|
|
179
|
+
return { icon: d`
|
|
180
|
+
<svg
|
|
181
|
+
width="20"
|
|
182
|
+
height="20"
|
|
183
|
+
viewBox="0 0 24 24"
|
|
184
|
+
fill="none"
|
|
185
|
+
stroke="currentColor"
|
|
186
|
+
stroke-width="2"
|
|
187
|
+
stroke-linecap="round"
|
|
188
|
+
stroke-linejoin="round"
|
|
189
|
+
>
|
|
190
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
191
|
+
<line x1="12" y1="16" x2="12" y2="12"></line>
|
|
192
|
+
<line x1="12" y1="8" x2="12.01" y2="8"></line>
|
|
193
|
+
</svg>
|
|
194
|
+
`, iconColor: h.sys.color.primary.default, progressColor: h.sys.color.primary.default };
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
u([p({ type: String })], c.prototype, "title", 2), u([p({ type: String })], c.prototype, "message", 2), u([p({ type: String })], c.prototype, "type", 2), u([p({ type: Boolean })], c.prototype, "closable", 2), u([p({ type: Number })], c.prototype, "duration", 2), u([p({ type: String })], c.prototype, "id", 2), u([p({ type: Boolean })], c.prototype, "playSound", 2), u([f()], c.prototype, "_visible", 2), u([f()], c.prototype, "_progress", 2), u([f()], c.prototype, "_hovered", 2), u([f()], c.prototype, "_closing", 2), u([f()], c.prototype, "_autoCloseTimer", 2), u([f()], c.prototype, "_progressTimer", 2), c = u([b("sch-notification")], c);
|
|
199
|
+
class $ {
|
|
200
|
+
constructor() {
|
|
201
|
+
this.audioContext = null;
|
|
202
|
+
}
|
|
203
|
+
getAudioContext() {
|
|
204
|
+
if (!this.audioContext) {
|
|
205
|
+
const t = window.AudioContext || window.webkitAudioContext;
|
|
206
|
+
this.audioContext = new t();
|
|
207
|
+
}
|
|
208
|
+
return this.audioContext;
|
|
209
|
+
}
|
|
210
|
+
playInfoSound(t = 0.2) {
|
|
211
|
+
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createGain(), s = e.createBiquadFilter();
|
|
212
|
+
o.type = "sine", o.frequency.setValueAtTime(392, i), o.frequency.exponentialRampToValueAtTime(523.25, i + 0.25), s.type = "lowpass", s.frequency.value = 1500, n.gain.setValueAtTime(1e-4, i), n.gain.exponentialRampToValueAtTime(t, i + 0.15), n.gain.exponentialRampToValueAtTime(1e-4, i + 0.4), o.connect(s).connect(n).connect(e.destination), o.start(i), o.stop(i + 0.45);
|
|
213
|
+
}
|
|
214
|
+
playSuccessSound(t = 0.2) {
|
|
215
|
+
const e = this.getAudioContext(), i = e.currentTime, o = (n, s, r) => {
|
|
216
|
+
const l = e.createOscillator(), y = e.createGain(), v = e.createBiquadFilter();
|
|
217
|
+
l.type = "sine", l.frequency.setValueAtTime(n, i), v.type = "lowpass", v.frequency.value = 4 * n, y.gain.setValueAtTime(1e-4, i), y.gain.exponentialRampToValueAtTime(t, i + 0.1), y.gain.exponentialRampToValueAtTime(1e-4, i + r), l.connect(v).connect(y).connect(e.destination), l.start(i + s), l.stop(i + r);
|
|
218
|
+
};
|
|
219
|
+
o(659.25, 0, 0.6), o(523.25, 0.05, 0.55);
|
|
220
|
+
}
|
|
221
|
+
playWarningSound(t = 0.25) {
|
|
222
|
+
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createOscillator(), s = e.createGain(), r = e.createBiquadFilter();
|
|
223
|
+
o.type = "sine", n.type = "sine", o.frequency.setValueAtTime(349.23, i), n.frequency.setValueAtTime(440, i), r.type = "lowpass", r.frequency.value = 1e3, s.gain.setValueAtTime(1e-4, i), s.gain.exponentialRampToValueAtTime(t, i + 0.08), s.gain.exponentialRampToValueAtTime(1e-4, i + 0.5), o.connect(r), n.connect(r), r.connect(s).connect(e.destination), o.start(i), n.start(i), o.stop(i + 0.55), n.stop(i + 0.55);
|
|
224
|
+
}
|
|
225
|
+
playErrorSound(t = 0.25) {
|
|
226
|
+
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createGain(), s = e.createBiquadFilter();
|
|
227
|
+
o.type = "triangle", o.frequency.setValueAtTime(220, i), o.frequency.exponentialRampToValueAtTime(1760, i + 0.3), s.type = "lowpass", s.frequency.value = 800, s.Q.value = 0.5, n.gain.setValueAtTime(1e-4, i), n.gain.exponentialRampToValueAtTime(0.8 * t, i + 0.1), n.gain.exponentialRampToValueAtTime(1e-4, i + 0.7), o.connect(s).connect(n).connect(e.destination), o.start(i), o.stop(i + 0.75);
|
|
228
|
+
}
|
|
229
|
+
async generateAudioFiles(t = 0.25) {
|
|
230
|
+
const i = {};
|
|
231
|
+
return i.info = await this.generateAudioFile(async (o) => {
|
|
232
|
+
const n = o.createOscillator();
|
|
233
|
+
n.type = "sine", n.frequency.setValueAtTime(320, 0), n.frequency.exponentialRampToValueAtTime(520, 0.3);
|
|
234
|
+
const s = o.createGain();
|
|
235
|
+
s.gain.setValueAtTime(0, 0), s.gain.linearRampToValueAtTime(t, 0.1), s.gain.linearRampToValueAtTime(0, 0.5), n.connect(s), s.connect(o.destination), n.start(), n.stop(0.5);
|
|
236
|
+
}, 44100, 1), i.success = await this.generateAudioFile(async (o) => {
|
|
237
|
+
const n = o.createOscillator();
|
|
238
|
+
n.type = "sine", n.frequency.setValueAtTime(660, 0);
|
|
239
|
+
const s = o.createOscillator();
|
|
240
|
+
s.type = "sine", s.frequency.setValueAtTime(440, 0);
|
|
241
|
+
const r = o.createGain();
|
|
242
|
+
r.gain.setValueAtTime(0, 0), r.gain.linearRampToValueAtTime(t, 0.1), r.gain.linearRampToValueAtTime(0, 0.5);
|
|
243
|
+
const l = o.createGain();
|
|
244
|
+
l.gain.setValueAtTime(0, 0), l.gain.linearRampToValueAtTime(0.6 * t, 0.15), l.gain.linearRampToValueAtTime(0, 0.7), n.connect(r), r.connect(o.destination), s.connect(l), l.connect(o.destination), n.start(), s.start(0.15), n.stop(0.5), s.stop(0.7);
|
|
245
|
+
}, 44100, 1), i.warning = await this.generateAudioFile(async (o) => {
|
|
246
|
+
const n = o.createOscillator();
|
|
247
|
+
n.type = "sine", n.frequency.setValueAtTime(293.66, 0);
|
|
248
|
+
const s = o.createOscillator();
|
|
249
|
+
s.type = "sine", s.frequency.setValueAtTime(349.23, 0);
|
|
250
|
+
const r = o.createGain();
|
|
251
|
+
r.gain.setValueAtTime(0, 0), r.gain.linearRampToValueAtTime(t, 0.1), r.gain.linearRampToValueAtTime(0.6 * t, 0.2), r.gain.linearRampToValueAtTime(0.8 * t, 0.3), r.gain.linearRampToValueAtTime(0, 0.6), n.connect(r), s.connect(r), r.connect(o.destination), n.start(), s.start(), n.stop(0.6), s.stop(0.6);
|
|
252
|
+
}, 44100, 1), i.error = await this.generateAudioFile(async (o) => {
|
|
253
|
+
const n = o.createOscillator();
|
|
254
|
+
n.type = "sine", n.frequency.setValueAtTime(196, 0);
|
|
255
|
+
const s = o.createGain();
|
|
256
|
+
s.gain.setValueAtTime(0, 0), s.gain.linearRampToValueAtTime(t, 0.1), s.gain.linearRampToValueAtTime(0.4 * t, 0.2), s.gain.linearRampToValueAtTime(0.6 * t, 0.3), s.gain.linearRampToValueAtTime(0, 0.7);
|
|
257
|
+
const r = o.createBiquadFilter();
|
|
258
|
+
r.type = "lowpass", r.frequency.value = 600, r.Q.value = 0.7, n.connect(r), r.connect(s), s.connect(o.destination), n.start(), n.stop(0.7);
|
|
259
|
+
}, 44100, 1), i;
|
|
260
|
+
}
|
|
261
|
+
async generateAudioFile(t, e = 44100, i = 1) {
|
|
262
|
+
const o = new OfflineAudioContext(2, e * i, e);
|
|
263
|
+
await t(o);
|
|
264
|
+
const n = await o.startRendering(), s = this.audioBufferToWav(n);
|
|
265
|
+
return URL.createObjectURL(s);
|
|
266
|
+
}
|
|
267
|
+
audioBufferToWav(t) {
|
|
268
|
+
const e = t.numberOfChannels, i = t.sampleRate, o = 2 * e, n = this.getAudioSamples(t, 16), s = 2 * n.length, r = new ArrayBuffer(44 + s), l = new DataView(r);
|
|
269
|
+
return this.writeString(l, 0, "RIFF"), l.setUint32(4, 36 + s, !0), this.writeString(l, 8, "WAVE"), this.writeString(l, 12, "fmt "), l.setUint32(16, 16, !0), l.setUint16(20, 1, !0), l.setUint16(22, e, !0), l.setUint32(24, i, !0), l.setUint32(28, i * o, !0), l.setUint16(32, o, !0), l.setUint16(34, 16, !0), this.writeString(l, 36, "data"), l.setUint32(40, s, !0), this.writeInt16Samples(l, 44, n), new Blob([r], { type: "audio/wav" });
|
|
270
|
+
}
|
|
271
|
+
getAudioSamples(t, e) {
|
|
272
|
+
const i = t.numberOfChannels, o = t.length, n = [], s = e === 16 ? 32768 : 128;
|
|
273
|
+
for (let r = 0; r < o; r++) for (let l = 0; l < i; l++) {
|
|
274
|
+
const y = t.getChannelData(l)[r], v = Math.max(-1, Math.min(1, y));
|
|
275
|
+
n.push(v * s);
|
|
276
|
+
}
|
|
277
|
+
return n;
|
|
278
|
+
}
|
|
279
|
+
writeInt16Samples(t, e, i) {
|
|
280
|
+
for (let o = 0; o < i.length; o++) t.setInt16(e + 2 * o, i[o], !0);
|
|
281
|
+
}
|
|
282
|
+
writeString(t, e, i) {
|
|
283
|
+
for (let o = 0; o < i.length; o++) t.setUint8(e + o, i.charCodeAt(o));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
class R {
|
|
287
|
+
constructor() {
|
|
288
|
+
this.audioContext = null, this.soundBuffers = /* @__PURE__ */ new Map(), this.volume = 0.5, this.muted = !1, this.soundGenerator = new $(), 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();
|
|
289
|
+
}
|
|
290
|
+
async initializeAudioFiles() {
|
|
291
|
+
try {
|
|
292
|
+
await this.preloadSounds();
|
|
293
|
+
} catch {
|
|
294
|
+
try {
|
|
295
|
+
const e = await this.soundGenerator.generateAudioFiles(this.volume);
|
|
296
|
+
this.soundUrls = e;
|
|
297
|
+
} catch {
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
getAudioContext() {
|
|
302
|
+
if (!this.audioContext) {
|
|
303
|
+
const t = window.AudioContext || window.webkitAudioContext;
|
|
304
|
+
this.audioContext = new t();
|
|
305
|
+
}
|
|
306
|
+
return this.audioContext;
|
|
307
|
+
}
|
|
308
|
+
async preloadSounds() {
|
|
309
|
+
const t = ["info", "success", "warning", "error"];
|
|
310
|
+
for (const e of t) try {
|
|
311
|
+
const i = await this.loadSound(e);
|
|
312
|
+
this.soundBuffers.set(e, i);
|
|
313
|
+
} catch {
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
async loadSound(t) {
|
|
317
|
+
const e = this.soundUrls[t], i = await fetch(e);
|
|
318
|
+
if (!i.ok) throw new Error(`Failed to load sound from ${e}: ${i.statusText}`);
|
|
319
|
+
const o = await i.arrayBuffer();
|
|
320
|
+
return await this.getAudioContext().decodeAudioData(o);
|
|
321
|
+
}
|
|
322
|
+
async playSound(t) {
|
|
323
|
+
if (!this.muted) try {
|
|
324
|
+
const e = this.getAudioContext();
|
|
325
|
+
if (e.state === "suspended" && await e.resume(), this.soundUrls[t].startsWith("blob:")) return void this.playFallbackSound(t);
|
|
326
|
+
if (!this.soundBuffers.has(t)) try {
|
|
327
|
+
const s = await this.loadSound(t);
|
|
328
|
+
this.soundBuffers.set(t, s);
|
|
329
|
+
} catch {
|
|
330
|
+
return void this.playDirectGeneratedSound(t);
|
|
331
|
+
}
|
|
332
|
+
const i = this.soundBuffers.get(t);
|
|
333
|
+
if (!i) throw new Error(`Sound buffer for ${t} not available`);
|
|
334
|
+
const o = e.createBufferSource();
|
|
335
|
+
o.buffer = i;
|
|
336
|
+
const n = e.createGain();
|
|
337
|
+
n.gain.value = this.volume, o.connect(n), n.connect(e.destination), o.start(0);
|
|
338
|
+
} catch {
|
|
339
|
+
this.playDirectGeneratedSound(t);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
playDirectGeneratedSound(t) {
|
|
343
|
+
if (!this.muted) try {
|
|
344
|
+
switch (t) {
|
|
345
|
+
case "info":
|
|
346
|
+
this.soundGenerator.playInfoSound(this.volume);
|
|
347
|
+
break;
|
|
348
|
+
case "success":
|
|
349
|
+
this.soundGenerator.playSuccessSound(this.volume);
|
|
350
|
+
break;
|
|
351
|
+
case "warning":
|
|
352
|
+
this.soundGenerator.playWarningSound(this.volume);
|
|
353
|
+
break;
|
|
354
|
+
case "error":
|
|
355
|
+
this.soundGenerator.playErrorSound(this.volume);
|
|
356
|
+
}
|
|
357
|
+
} catch {
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
playFallbackSound(t) {
|
|
361
|
+
if (!this.muted) try {
|
|
362
|
+
const e = new Audio(this.soundUrls[t]);
|
|
363
|
+
e.volume = this.volume, e.addEventListener("ended", () => {
|
|
364
|
+
e.remove();
|
|
365
|
+
}), e.play().catch((i) => {
|
|
366
|
+
this.playDirectGeneratedSound(t);
|
|
367
|
+
});
|
|
368
|
+
} catch {
|
|
369
|
+
this.playDirectGeneratedSound(t);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
setVolume(t) {
|
|
373
|
+
this.volume = Math.max(0, Math.min(1, t));
|
|
374
|
+
}
|
|
375
|
+
getVolume() {
|
|
376
|
+
return this.volume;
|
|
377
|
+
}
|
|
378
|
+
mute() {
|
|
379
|
+
this.muted = !0;
|
|
380
|
+
}
|
|
381
|
+
unmute() {
|
|
382
|
+
this.muted = !1;
|
|
383
|
+
}
|
|
384
|
+
isMuted() {
|
|
385
|
+
return this.muted;
|
|
386
|
+
}
|
|
387
|
+
setSoundUrl(t, e) {
|
|
388
|
+
this.soundUrls[t] = e, this.soundBuffers.delete(t);
|
|
389
|
+
}
|
|
390
|
+
getSoundUrl(t) {
|
|
391
|
+
return this.soundUrls[t];
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
var B = Object.defineProperty, q = Object.getOwnPropertyDescriptor, g = (a, t, e, i) => {
|
|
395
|
+
for (var o, n = i > 1 ? void 0 : i ? q(t, e) : t, s = a.length - 1; s >= 0; s--) (o = a[s]) && (n = (i ? o(t, e, n) : o(n)) || n);
|
|
396
|
+
return i && n && B(t, e, n), n;
|
|
397
|
+
};
|
|
398
|
+
let m = class extends T(":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}") {
|
|
399
|
+
constructor() {
|
|
400
|
+
super(...arguments), this.position = "top-right", this.maxVisibleNotifications = 5, this.playSound = !1, this.audioVolume = 0.5, this._notifications = [], this._audioService = new R();
|
|
401
|
+
}
|
|
402
|
+
connectedCallback() {
|
|
403
|
+
super.connectedCallback(), this._audioService.setVolume(this.audioVolume), A(window, "schmancy-notification").pipe(_(this.disconnecting)).subscribe((a) => {
|
|
404
|
+
this.addNotification(a.detail);
|
|
405
|
+
}), this.addEventListener("playsound", (a) => {
|
|
406
|
+
this.playSound && this._audioService.playSound(a.detail.type);
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
addNotification(a) {
|
|
410
|
+
const t = a.id || `notification-${Date.now()}-${Math.floor(1e4 * Math.random())}`, e = { id: t, title: a.title || "", message: a.message, type: a.type || "info", duration: a.duration !== void 0 ? a.duration : 5e3, closable: a.closable === void 0 || a.closable, playSound: a.playSound !== void 0 ? a.playSound : this.playSound };
|
|
411
|
+
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;
|
|
412
|
+
}
|
|
413
|
+
removeNotification(a) {
|
|
414
|
+
this._notifications = this._notifications.filter((t) => t.id !== a);
|
|
415
|
+
}
|
|
416
|
+
_handleClose(a) {
|
|
417
|
+
const t = a.detail.id;
|
|
418
|
+
this.removeNotification(t);
|
|
419
|
+
}
|
|
420
|
+
render() {
|
|
421
|
+
return d`
|
|
422
|
+
<div
|
|
423
|
+
class=${x({ "notification-container": !0, [this.position]: !0 })}
|
|
424
|
+
>
|
|
425
|
+
${C(this._notifications, (a) => a.id, (a) => d`
|
|
426
|
+
<sch-notification
|
|
427
|
+
.id=${a.id}
|
|
428
|
+
.title=${a.title}
|
|
429
|
+
.message=${a.message}
|
|
430
|
+
.type=${a.type}
|
|
431
|
+
.duration=${a.duration}
|
|
432
|
+
?closable=${a.closable}
|
|
433
|
+
?playSound=${!1} /* We already played the sound on add */
|
|
434
|
+
@close=${this._handleClose}
|
|
435
|
+
></sch-notification>
|
|
436
|
+
`)}
|
|
437
|
+
</div>
|
|
438
|
+
`;
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
g([p({ type: String })], m.prototype, "position", 2), g([p({ type: Number })], m.prototype, "maxVisibleNotifications", 2), g([p({ type: Boolean })], m.prototype, "playSound", 2), g([p({ type: Number })], m.prototype, "audioVolume", 2), g([f()], m.prototype, "_notifications", 2), m = g([b("sch-notification-container")], m);
|
|
442
|
+
export {
|
|
443
|
+
R as N,
|
|
444
|
+
c as S,
|
|
445
|
+
m as a
|
|
446
|
+
};
|
|
447
|
+
//# sourceMappingURL=notification-container-DKLh7Vt2.js.map
|