@mhmo91/schmancy 0.10.29 → 0.10.30
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/{mixins-BfazlmLD.js → SchmancyElement-BQ4DFufc.js} +166 -493
- package/dist/SchmancyElement-BQ4DFufc.js.map +1 -0
- package/dist/{mixins-CxGRIPYQ.cjs → SchmancyElement-DhSiMp6Y.cjs} +2 -242
- package/dist/SchmancyElement-DhSiMp6Y.cjs.map +1 -0
- package/dist/agent/{flow-3RrZM-e7.js.map → flow-CvG1fLW5.js.map} +1 -1
- package/dist/agent/schmancy.agent.js +8487 -2979
- package/dist/agent/schmancy.agent.js.map +1 -1
- package/dist/agent/{vendor-material-color-33Mj762T.js.map → vendor-material-color-DcL7ZPxx.js.map} +1 -1
- package/dist/animation-CCOIW4wJ.cjs.map +1 -1
- package/dist/animation-DCznELuT.js.map +1 -1
- package/dist/{area-D5wIy4Fn.js → area-BjpUWvzE.js} +7 -7
- package/dist/{area-D5wIy4Fn.js.map → area-BjpUWvzE.js.map} +1 -1
- package/dist/area-CgTzkxah.cjs +21 -0
- package/dist/{area-HXuLLQnN.cjs.map → area-CgTzkxah.cjs.map} +1 -1
- package/dist/area.cjs +1 -1
- package/dist/area.js +1 -1
- package/dist/{audio-CxO5a2HL.js → audio-CwBJntnB.js} +1 -1
- package/dist/{audio-CxO5a2HL.js.map → audio-CwBJntnB.js.map} +1 -1
- package/dist/{audio-Cvmemu84.cjs → audio-DISBFOaR.cjs} +1 -1
- package/dist/{audio-Cvmemu84.cjs.map → audio-DISBFOaR.cjs.map} +1 -1
- package/dist/audio.cjs +1 -1
- package/dist/audio.js +2 -2
- package/dist/{autocomplete-hj2AQyEF.cjs → autocomplete-DbCUOgWU.cjs} +2 -2
- package/dist/{autocomplete-hj2AQyEF.cjs.map → autocomplete-DbCUOgWU.cjs.map} +1 -1
- package/dist/{autocomplete-DCkkdDON.js → autocomplete-Dy708jem.js} +7 -7
- package/dist/{autocomplete-DCkkdDON.js.map → autocomplete-Dy708jem.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/avatar.cjs +3 -3
- package/dist/avatar.cjs.map +1 -1
- package/dist/avatar.js +5 -5
- package/dist/avatar.js.map +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{boat-B_5F_rFr.cjs → boat-BzZN_iwp.cjs} +11 -11
- package/dist/{boat-B_5F_rFr.cjs.map → boat-BzZN_iwp.cjs.map} +1 -1
- package/dist/{boat-BfgbRnhA.js → boat-Z4Lzl3ai.js} +8 -8
- package/dist/{boat-BfgbRnhA.js.map → boat-Z4Lzl3ai.js.map} +1 -1
- package/dist/boat.cjs +1 -1
- package/dist/boat.js +1 -1
- package/dist/breadcrumb.cjs +4 -4
- package/dist/breadcrumb.cjs.map +1 -1
- package/dist/breadcrumb.js +7 -7
- package/dist/breadcrumb.js.map +1 -1
- package/dist/{busy-D6tAS-kW.js → busy-CRFGPkcP.js} +7 -7
- package/dist/{busy-D6tAS-kW.js.map → busy-CRFGPkcP.js.map} +1 -1
- package/dist/{busy-zIt9bTZn.cjs → busy-Cu-47DfN.cjs} +8 -8
- package/dist/{busy-zIt9bTZn.cjs.map → busy-Cu-47DfN.cjs.map} +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/{button-8oMffyiO.cjs → button-CN_JTjRd.cjs} +15 -15
- package/dist/{button-8oMffyiO.cjs.map → button-CN_JTjRd.cjs.map} +1 -1
- package/dist/{button-D7AejvfK.js → button-D_USF3tt.js} +10 -10
- package/dist/{button-D7AejvfK.js.map → button-D_USF3tt.js.map} +1 -1
- package/dist/button.cjs +19 -19
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +9 -9
- package/dist/button.js.map +1 -1
- package/dist/{card-CTucMMgp.cjs → card-D4P5_gg9.cjs} +10 -10
- package/dist/{card-CTucMMgp.cjs.map → card-D4P5_gg9.cjs.map} +1 -1
- package/dist/{card-CUt9fm_4.js → card-DpN5KIYc.js} +15 -15
- package/dist/{card-CUt9fm_4.js.map → card-DpN5KIYc.js.map} +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-DMmqe2OO.js → checkbox-C8ChypKf.js} +5 -5
- package/dist/{checkbox-DMmqe2OO.js.map → checkbox-C8ChypKf.js.map} +1 -1
- package/dist/{checkbox-DrKsfzC4.cjs → checkbox-hhXVXDV1.cjs} +3 -3
- package/dist/{checkbox-DrKsfzC4.cjs.map → checkbox-hhXVXDV1.cjs.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-DRGsqDMA.js → chips-B8R9q4yl.js} +27 -27
- package/dist/{chips-DRGsqDMA.js.map → chips-B8R9q4yl.js.map} +1 -1
- package/dist/{chips-B1yQgLyW.cjs → chips-BTLlO_Ow.cjs} +18 -18
- package/dist/{chips-B1yQgLyW.cjs.map → chips-BTLlO_Ow.cjs.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +2 -2
- package/dist/connectivity.cjs +7 -7
- package/dist/connectivity.cjs.map +1 -1
- package/dist/connectivity.js +5 -5
- package/dist/connectivity.js.map +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/cursor-glow-Ah7VXSj7.js.map +1 -1
- package/dist/cursor-glow-Bulq-38P.cjs.map +1 -1
- package/dist/{date-range-BeF0dW1W.cjs → date-range-9h6ZSkZb.cjs} +3 -3
- package/dist/{date-range-BeF0dW1W.cjs.map → date-range-9h6ZSkZb.cjs.map} +1 -1
- package/dist/{date-range-TDF-f0ss.js → date-range-CS96dWMh.js} +7 -7
- package/dist/{date-range-TDF-f0ss.js.map → date-range-CS96dWMh.js.map} +1 -1
- package/dist/date-range-inline-CAxnHA-l.cjs +43 -0
- package/dist/{date-range-inline-BnhQZTK0.cjs.map → date-range-inline-CAxnHA-l.cjs.map} +1 -1
- package/dist/{date-range-inline-JLsmcle2.js → date-range-inline-DCXdGeRv.js} +5 -5
- package/dist/{date-range-inline-JLsmcle2.js.map → date-range-inline-DCXdGeRv.js.map} +1 -1
- package/dist/date-range-inline.cjs +1 -1
- package/dist/date-range-inline.js +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/delay.cjs +4 -4
- package/dist/delay.cjs.map +1 -1
- package/dist/delay.js +6 -6
- package/dist/delay.js.map +1 -1
- package/dist/{details-T75tUASO.cjs → details-BC0IObBd.cjs} +2 -2
- package/dist/{details-T75tUASO.cjs.map → details-BC0IObBd.cjs.map} +1 -1
- package/dist/{details-ChMhQpcY.js → details-Pgd0slKn.js} +11 -11
- package/dist/{details-ChMhQpcY.js.map → details-Pgd0slKn.js.map} +1 -1
- package/dist/details.cjs +1 -1
- package/dist/details.js +1 -1
- package/dist/{directives-DgPbz0lQ.js → directives-B-RT9R2u.js} +3 -3
- package/dist/{directives-DgPbz0lQ.js.map → directives-B-RT9R2u.js.map} +1 -1
- package/dist/{directives-BkSqmLBV.cjs → directives-CFWacnWU.cjs} +1 -1
- package/dist/{directives-BkSqmLBV.cjs.map → directives-CFWacnWU.cjs.map} +1 -1
- package/dist/directives.cjs +1 -1
- package/dist/directives.js +2 -2
- package/dist/discovery.service-CIa3Eeuk.cjs.map +1 -1
- package/dist/discovery.service-DZFxtRwW.js.map +1 -1
- package/dist/{divider-D69bhEUY.js → divider-BMzm0lOz.js} +5 -5
- package/dist/{divider-D69bhEUY.js.map → divider-BMzm0lOz.js.map} +1 -1
- package/dist/{divider-DopO0yKi.cjs → divider-D1OzaRAQ.cjs} +3 -3
- package/dist/{divider-DopO0yKi.cjs.map → divider-D1OzaRAQ.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.cjs +4 -4
- package/dist/dropdown.cjs.map +1 -1
- package/dist/dropdown.js +8 -8
- package/dist/dropdown.js.map +1 -1
- package/dist/{expand-KLSx5dea.js → expand-C0Uqxfv0.js} +10 -10
- package/dist/{expand-KLSx5dea.js.map → expand-C0Uqxfv0.js.map} +1 -1
- package/dist/{expand-C386rVT8.cjs → expand-CiQkzth9.cjs} +3 -3
- package/dist/{expand-C386rVT8.cjs.map → expand-CiQkzth9.cjs.map} +1 -1
- package/dist/expand.cjs +1 -1
- package/dist/expand.js +1 -1
- package/dist/float-Bu_IfKRd.cjs +1 -0
- package/dist/{float-DyaPI0qO.cjs.map → float-Bu_IfKRd.cjs.map} +1 -1
- package/dist/{float-BoPLNysg.js → float-DwBMXhek.js} +2 -2
- package/dist/{float-BoPLNysg.js.map → float-DwBMXhek.js.map} +1 -1
- package/dist/float.cjs +1 -1
- package/dist/float.js +1 -1
- package/dist/{form-CYeMWHmy.js → form-B9Je2W_m.js} +7 -7
- package/dist/{form-CYeMWHmy.js.map → form-B9Je2W_m.js.map} +1 -1
- package/dist/{form-CGIJlQyP.cjs → form-BnbAVZyf.cjs} +3 -3
- package/dist/{form-CGIJlQyP.cjs.map → form-BnbAVZyf.cjs.map} +1 -1
- package/dist/form.cjs +6 -6
- package/dist/form.cjs.map +1 -1
- package/dist/form.js +12 -12
- package/dist/form.js.map +1 -1
- package/dist/gravity-6pL6CfIr.cjs.map +1 -1
- package/dist/gravity-sVK3zGBF.js.map +1 -1
- package/dist/handover/agent-runtime-followups.md +1 -1
- package/dist/handover/agent-runtime-v1.md +3 -3
- package/dist/hashContent-BqU6v1Xr.js.map +1 -1
- package/dist/hashContent-iRZJJWtE.cjs.map +1 -1
- package/dist/{icons-CJUA5bfI.cjs → icons-BfWQl5k5.cjs} +6 -6
- package/dist/{icons-CJUA5bfI.cjs.map → icons-BfWQl5k5.cjs.map} +1 -1
- package/dist/{icons-BUQNMhjw.js → icons-DJHPXKgR.js} +4 -4
- package/dist/{icons-BUQNMhjw.js.map → icons-DJHPXKgR.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/{iframe-CbL0jCo1.js → iframe-DLz8ll0s.js} +5 -5
- package/dist/{iframe-CbL0jCo1.js.map → iframe-DLz8ll0s.js.map} +1 -1
- package/dist/{iframe-pn7MIeH8.cjs → iframe-UtczJypj.cjs} +5 -5
- package/dist/{iframe-pn7MIeH8.cjs.map → iframe-UtczJypj.cjs.map} +1 -1
- package/dist/iframe.cjs +1 -1
- package/dist/iframe.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +69 -70
- package/dist/{input-C1h5lLiJ.js → input-AQbBEj2f.js} +15 -15
- package/dist/{input-C1h5lLiJ.js.map → input-AQbBEj2f.js.map} +1 -1
- package/dist/{input-Cmc0IoUP.cjs → input-Pp6A1m3s.cjs} +2 -2
- package/dist/{input-Cmc0IoUP.cjs.map → input-Pp6A1m3s.cjs.map} +1 -1
- package/dist/{input-chip-B0X_CodJ.cjs → input-chip-B5vYNuEm.cjs} +9 -9
- package/dist/{input-chip-B0X_CodJ.cjs.map → input-chip-B5vYNuEm.cjs.map} +1 -1
- package/dist/{input-chip-DqAR4nPD.js → input-chip-Bbs_gXOB.js} +10 -10
- package/dist/{input-chip-DqAR4nPD.js.map → input-chip-Bbs_gXOB.js.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/json.cjs +3 -3
- package/dist/json.cjs.map +1 -1
- package/dist/json.js +5 -5
- package/dist/json.js.map +1 -1
- package/dist/kbd.cjs +2 -2
- package/dist/kbd.cjs.map +1 -1
- package/dist/kbd.js +5 -5
- package/dist/kbd.js.map +1 -1
- package/dist/{layout-DSAjo92m.js → layout-9K1zxhZn.js} +1 -1
- package/dist/{layout-DSAjo92m.js.map → layout-9K1zxhZn.js.map} +1 -1
- package/dist/{layout-eXb9wjDh.cjs → layout-B0dct--7.cjs} +1 -1
- package/dist/{layout-eXb9wjDh.cjs.map → layout-B0dct--7.cjs.map} +1 -1
- package/dist/layout.cjs +2 -2
- package/dist/layout.cjs.map +1 -1
- package/dist/layout.js +7 -7
- package/dist/layout.js.map +1 -1
- package/dist/lazy-CayEFyC3.cjs.map +1 -1
- package/dist/lazy-D-bO2r4m.js.map +1 -1
- package/dist/{lightbox-BiNK_plj.cjs → lightbox-D_EizrG3.cjs} +21 -21
- package/dist/{lightbox-BiNK_plj.cjs.map → lightbox-D_EizrG3.cjs.map} +1 -1
- package/dist/{lightbox-C3zomJ-r.js → lightbox-DmJTs2My.js} +9 -9
- package/dist/{lightbox-C3zomJ-r.js.map → lightbox-DmJTs2My.js.map} +1 -1
- package/dist/lightbox.cjs +1 -1
- package/dist/lightbox.js +1 -1
- package/dist/{list-CbM9w9OM.cjs → list-BSn8czyO.cjs} +5 -5
- package/dist/{list-CbM9w9OM.cjs.map → list-BSn8czyO.cjs.map} +1 -1
- package/dist/{list-Bbmp1uMa.js → list-DjSSRZxF.js} +12 -12
- package/dist/{list-Bbmp1uMa.js.map → list-DjSSRZxF.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/magnetic-B2VKNfDu.js.map +1 -1
- package/dist/magnetic-MQ3HMHJi.cjs.map +1 -1
- package/dist/{menu-Ph2hboJd.js → menu-CCVEde6u.js} +7 -7
- package/dist/{menu-Ph2hboJd.js.map → menu-CCVEde6u.js.map} +1 -1
- package/dist/menu-DTNnq7j_.cjs +23 -0
- package/dist/{menu-Bfay8vF8.cjs.map → menu-DTNnq7j_.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins-BYfSDvbP.js +412 -0
- package/dist/mixins-BYfSDvbP.js.map +1 -0
- package/dist/mixins-YQI9JogS.cjs +245 -0
- package/dist/mixins-YQI9JogS.cjs.map +1 -0
- package/dist/mixins.cjs +1 -1
- package/dist/mixins.js +3 -2
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/navigation-bar.cjs +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/navigation-rail.cjs +10 -10
- package/dist/navigation-rail.cjs.map +1 -1
- package/dist/navigation-rail.js +15 -15
- package/dist/navigation-rail.js.map +1 -1
- package/dist/{notification-Du5FRbYp.js → notification-BNEuu3Q2.js} +7 -7
- package/dist/{notification-Du5FRbYp.js.map → notification-BNEuu3Q2.js.map} +1 -1
- package/dist/notification-RhaYvA1I.cjs +24 -0
- package/dist/{notification-DT_cAi8U.cjs.map → notification-RhaYvA1I.cjs.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-B7y4FhOn.js → option-BLMYRy5C.js} +6 -6
- package/dist/{option-B7y4FhOn.js.map → option-BLMYRy5C.js.map} +1 -1
- package/dist/{option-Cl5Q987d.cjs → option-Dk7UFFlr.cjs} +5 -5
- package/dist/{option-Cl5Q987d.cjs.map → option-Dk7UFFlr.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/overlay-BbntqsVm.cjs +43 -0
- package/dist/{overlay-CRwfhbyi.cjs.map → overlay-BbntqsVm.cjs.map} +1 -1
- package/dist/{overlay-B79m-KXf.js → overlay-CujzmLxg.js} +11 -11
- package/dist/{overlay-B79m-KXf.js.map → overlay-CujzmLxg.js.map} +1 -1
- package/dist/overlay-stack-Bdr9lOqi.cjs.map +1 -1
- package/dist/overlay-stack-D2rgxQLh.js.map +1 -1
- package/dist/overlay.cjs +1 -1
- package/dist/overlay.confirm-body-CMge0LP5.cjs +70 -0
- package/dist/{overlay.confirm-body-CxOomuN6.cjs.map → overlay.confirm-body-CMge0LP5.cjs.map} +1 -1
- package/dist/{overlay.confirm-body-CW_spktW.js → overlay.confirm-body-CRk4MvKh.js} +13 -13
- package/dist/{overlay.confirm-body-CW_spktW.js.map → overlay.confirm-body-CRk4MvKh.js.map} +1 -1
- package/dist/overlay.js +3 -3
- package/dist/{overlay.service-DsBb_UwG.js → overlay.service-DnT4SBlJ.js} +2 -2
- package/dist/{overlay.service-DsBb_UwG.js.map → overlay.service-DnT4SBlJ.js.map} +1 -1
- package/dist/{overlay.service-fb3KaMiP.cjs → overlay.service-Dq5XtSEL.cjs} +1 -1
- package/dist/{overlay.service-fb3KaMiP.cjs.map → overlay.service-Dq5XtSEL.cjs.map} +1 -1
- package/dist/{progress-fnGrmHpm.cjs → progress-Bqd4DdOQ.cjs} +7 -7
- package/dist/{progress-fnGrmHpm.cjs.map → progress-Bqd4DdOQ.cjs.map} +1 -1
- package/dist/{progress-CMwUEDB1.js → progress-Cu_wh6Sl.js} +10 -10
- package/dist/{progress-CMwUEDB1.js.map → progress-Cu_wh6Sl.js.map} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/radio-group-C8rUbYL6.cjs +19 -0
- package/dist/{radio-group-DQRJGMgS.cjs.map → radio-group-C8rUbYL6.cjs.map} +1 -1
- package/dist/{radio-group-Zb0fies1.js → radio-group-Duzgx17I.js} +7 -7
- package/dist/{radio-group-Zb0fies1.js.map → radio-group-Duzgx17I.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/range.cjs +2 -2
- package/dist/range.cjs.map +1 -1
- package/dist/range.js +5 -5
- package/dist/range.js.map +1 -1
- package/dist/reduced-motion-D-L12p7G.js.map +1 -1
- package/dist/reduced-motion-Ds-HjMzn.cjs.map +1 -1
- package/dist/rxjs-utils-Csnks202.cjs.map +1 -1
- package/dist/rxjs-utils-d-ivVN84.js.map +1 -1
- package/dist/search-DPKoC-dT.cjs.map +1 -1
- package/dist/search-MvIBA93K.js.map +1 -1
- package/dist/{select-BJJKYtEi.js → select-CzCv1f1c.js} +6 -6
- package/dist/{select-BJJKYtEi.js.map → select-CzCv1f1c.js.map} +1 -1
- package/dist/{select-C-acFFtV.cjs → select-DdqEsfnG.cjs} +2 -2
- package/dist/{select-C-acFFtV.cjs.map → select-DdqEsfnG.cjs.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.cjs +2 -2
- package/dist/skeleton.cjs.map +1 -1
- package/dist/skeleton.js +5 -5
- package/dist/skeleton.js.map +1 -1
- package/dist/skills/form.md +34 -0
- package/dist/skills/schmancy/form.md +34 -0
- package/dist/slider.cjs +7 -7
- package/dist/slider.cjs.map +1 -1
- package/dist/slider.js +6 -6
- package/dist/slider.js.map +1 -1
- package/dist/{sound.service-v_jqCkos.js → sound.service-BOWTBG16.js} +1 -1
- package/dist/{sound.service-v_jqCkos.js.map → sound.service-BOWTBG16.js.map} +1 -1
- package/dist/{sound.service-DVJZb9ox.cjs → sound.service-BwIzAFQx.cjs} +1 -1
- package/dist/{sound.service-DVJZb9ox.cjs.map → sound.service-BwIzAFQx.cjs.map} +1 -1
- package/dist/{splash-screen-CCDpzGg_.js → splash-screen-Dj-zuGuB.js} +6 -6
- package/dist/{splash-screen-CCDpzGg_.js.map → splash-screen-Dj-zuGuB.js.map} +1 -1
- package/dist/splash-screen-_KhxgneW.cjs +41 -0
- package/dist/{splash-screen-CGnhHDB_.cjs.map → splash-screen-_KhxgneW.cjs.map} +1 -1
- package/dist/splash-screen.cjs +1 -1
- package/dist/splash-screen.js +1 -1
- package/dist/src-BSjgxN07.cjs +263 -0
- package/dist/{src-C0MzzF_S.cjs.map → src-BSjgxN07.cjs.map} +1 -1
- package/dist/{src-CUcUMK0M.js → src-Curgs4Yp.js} +82 -82
- package/dist/{src-CUcUMK0M.js.map → src-Curgs4Yp.js.map} +1 -1
- package/dist/state-BthYuA3T.cjs +1 -0
- package/dist/state-BthYuA3T.cjs.map +1 -0
- package/dist/{state-CHbIt2Dw.js → state-E0bVrZ7q.js} +293 -279
- package/dist/state-E0bVrZ7q.js.map +1 -0
- package/dist/state.cjs +1 -1
- package/dist/state.js +3 -3
- package/dist/steps.cjs +10 -10
- package/dist/steps.cjs.map +1 -1
- package/dist/steps.js +9 -9
- package/dist/steps.js.map +1 -1
- package/dist/{surface-CLcc26d2.js → surface-C2TIedTq.js} +4 -4
- package/dist/{surface-CLcc26d2.js.map → surface-C2TIedTq.js.map} +1 -1
- package/dist/surface-D-GqzyLn.cjs +7 -0
- package/dist/{surface-DPzlMMYX.cjs.map → surface-D-GqzyLn.cjs.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/switch.cjs +2 -2
- package/dist/switch.cjs.map +1 -1
- package/dist/switch.js +6 -6
- package/dist/switch.js.map +1 -1
- package/dist/table.cjs +11 -11
- package/dist/table.cjs.map +1 -1
- package/dist/table.js +10 -10
- package/dist/table.js.map +1 -1
- package/dist/{tabs-BvEal6oS.js → tabs-CLRVe23a.js} +11 -11
- package/dist/{tabs-BvEal6oS.js.map → tabs-CLRVe23a.js.map} +1 -1
- package/dist/{tabs-DEKOKYrn.cjs → tabs-C_493iod.cjs} +4 -4
- package/dist/{tabs-DEKOKYrn.cjs.map → tabs-C_493iod.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-CH62STRD.js → textarea-BWEyOtPy.js} +9 -9
- package/dist/{textarea-CH62STRD.js.map → textarea-BWEyOtPy.js.map} +1 -1
- package/dist/textarea-CICgd2oP.cjs +43 -0
- package/dist/{textarea-Cjlsy3y9.cjs.map → textarea-CICgd2oP.cjs.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-z82BIRuw.js → theme-Bfg_H2AF.js} +12 -12
- package/dist/{theme-z82BIRuw.js.map → theme-Bfg_H2AF.js.map} +1 -1
- package/dist/theme-D7zOJiyg.cjs +181 -0
- package/dist/{theme-CG3Gpne7.cjs.map → theme-D7zOJiyg.cjs.map} +1 -1
- package/dist/{theme-button-oWeOoeSw.js → theme-button-C53GdQER.js} +4 -4
- package/dist/{theme-button-oWeOoeSw.js.map → theme-button-C53GdQER.js.map} +1 -1
- package/dist/theme-button-DgeBcqFm.cjs +8 -0
- package/dist/{theme-button-CEc_Kl54.cjs.map → theme-button-DgeBcqFm.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.interface-CSt7JUBD.cjs.map +1 -1
- package/dist/theme.interface-odQEpZZH.js.map +1 -1
- package/dist/theme.js +3 -3
- package/dist/{theme.service-Bh08uOSJ.js → theme.service-BqDuioYc.js} +1 -1
- package/dist/{theme.service-Bh08uOSJ.js.map → theme.service-BqDuioYc.js.map} +1 -1
- package/dist/{theme.service-Y-e8b331.cjs → theme.service-C3PoISGd.cjs} +1 -1
- package/dist/{theme.service-Y-e8b331.cjs.map → theme.service-C3PoISGd.cjs.map} +1 -1
- package/dist/tooltip.cjs.map +1 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/tree.cjs +3 -3
- package/dist/tree.cjs.map +1 -1
- package/dist/tree.js +4 -4
- package/dist/tree.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typewriter.cjs.map +1 -1
- package/dist/typewriter.js.map +1 -1
- package/dist/{typography-CjAvaB88.cjs → typography-B19fJ5YT.cjs} +4 -4
- package/dist/{typography-CjAvaB88.cjs.map → typography-B19fJ5YT.cjs.map} +1 -1
- package/dist/{typography-DP82e3GJ.js → typography-CzbQv-X0.js} +10 -10
- package/dist/{typography-DP82e3GJ.js.map → typography-CzbQv-X0.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/dist/utils-DTa3QHxk.cjs.map +1 -1
- package/dist/utils-H8wNknWC.js.map +1 -1
- package/dist/visually-hidden.cjs +2 -2
- package/dist/visually-hidden.cjs.map +1 -1
- package/dist/visually-hidden.js +4 -4
- package/dist/visually-hidden.js.map +1 -1
- package/dist/window-DXB53PuA.cjs +59 -0
- package/dist/{window-aVXgfw__.cjs.map → window-DXB53PuA.cjs.map} +1 -1
- package/dist/{window-BkPXY-8m.js → window-DpctMXiy.js} +9 -9
- package/dist/{window-BkPXY-8m.js.map → window-DpctMXiy.js.map} +1 -1
- package/dist/window.cjs +1 -1
- package/dist/window.js +1 -1
- package/package.json +1 -1
- package/skills/schmancy/form.md +34 -0
- package/src/state/active-host.ts +50 -1
- package/src/state/index.ts +50 -11
- package/src/state/schmancy-context.ts +97 -88
- package/src/surface/surface.styles.ts +14 -10
- package/types/src/state/active-host.d.ts +3 -0
- package/types/src/state/index.d.ts +16 -2
- package/types/src/state/schmancy-context.d.ts +2 -2
- package/dist/active-host-BP0zy_Y9.js +0 -63
- package/dist/active-host-BP0zy_Y9.js.map +0 -1
- package/dist/active-host-jH3iloCR.cjs +0 -1
- package/dist/active-host-jH3iloCR.cjs.map +0 -1
- package/dist/agent/overlay.confirm-body-BFYWMa45.js +0 -5518
- package/dist/agent/overlay.confirm-body-BFYWMa45.js.map +0 -1
- package/dist/area-HXuLLQnN.cjs +0 -21
- package/dist/date-range-inline-BnhQZTK0.cjs +0 -43
- package/dist/float-DyaPI0qO.cjs +0 -1
- package/dist/menu-Bfay8vF8.cjs +0 -23
- package/dist/mixins-BfazlmLD.js.map +0 -1
- package/dist/mixins-CxGRIPYQ.cjs.map +0 -1
- package/dist/notification-DT_cAi8U.cjs +0 -24
- package/dist/overlay-CRwfhbyi.cjs +0 -43
- package/dist/overlay.confirm-body-CxOomuN6.cjs +0 -70
- package/dist/radio-group-DQRJGMgS.cjs +0 -19
- package/dist/splash-screen-CGnhHDB_.cjs +0 -41
- package/dist/src-C0MzzF_S.cjs +0 -263
- package/dist/state-CHbIt2Dw.js.map +0 -1
- package/dist/state-DcGj-pJJ.cjs +0 -1
- package/dist/state-DcGj-pJJ.cjs.map +0 -1
- package/dist/surface-DPzlMMYX.cjs +0 -7
- package/dist/textarea-Cjlsy3y9.cjs +0 -43
- package/dist/theme-CG3Gpne7.cjs +0 -181
- package/dist/theme-button-CEc_Kl54.cjs +0 -8
- package/dist/window-aVXgfw__.cjs +0 -59
- /package/dist/agent/{flow-3RrZM-e7.js → flow-CvG1fLW5.js} +0 -0
- /package/dist/agent/{vendor-material-color-33Mj762T.js → vendor-material-color-DcL7ZPxx.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-eXb9wjDh.cjs","names":[],"sources":["../src/directives/layout.ts"],"sourcesContent":["import { directive, ElementPart, PartType } from 'lit/directive.js'\nimport { AsyncDirective } from 'lit/async-directive.js'\nimport { Subject, fromEvent, merge, Observable, EMPTY, timer, combineLatest } from 'rxjs'\nimport { debounceTime, switchMap, takeUntil, distinctUntilChanged, map, tap, startWith, filter } from 'rxjs/operators'\n\n/** Returns true if user is pinch-zoomed (scale !== 1) */\nfunction isZoomed(): boolean {\n\tconst vv = window.visualViewport\n\treturn vv ? Math.abs(vv.scale - 1) > 0.01 : false\n}\nimport { theme } from '../theme/theme.service'\n\n// Shared global update stream (lazy-initialized, cleaned up when no elements use it)\nlet update$: Subject<void> | null = null\nlet updateSub: { unsubscribe: () => void } | null = null\nlet elementCount = 0\n\nfunction getUpdateStream(): Subject<void> {\n\tif (!update$) {\n\t\tupdate$ = new Subject<void>()\n\n\t\tconst windowResize$ = fromEvent(window, 'resize', { passive: true })\n\n\t\tconst viewportEvents$ = window.visualViewport\n\t\t\t? merge(\n\t\t\t\t\tfromEvent(window.visualViewport, 'resize', { passive: true }),\n\t\t\t\t\tfromEvent(window.visualViewport, 'scroll', { passive: true })\n\t\t\t\t)\n\t\t\t: windowResize$\n\n\t\tconst orientation$ = fromEvent(window, 'orientationchange')\n\n\t\t// iOS Safari: force recalc after keyboard dismissal\n\t\tconst focusOut$ = fromEvent(document, 'focusout', { passive: true }).pipe(\n\t\t\tswitchMap(() => timer(100))\n\t\t)\n\n\t\tupdateSub = merge(windowResize$, viewportEvents$, orientation$, focusOut$)\n\t\t\t.pipe(debounceTime(16))\n\t\t\t.subscribe(() => update$!.next())\n\t}\n\treturn update$\n}\n\nfunction cleanup() {\n\tif (elementCount === 0 && updateSub) {\n\t\tupdateSub.unsubscribe()\n\t\tupdateSub = null\n\t\tupdate$ = null\n\t}\n}\n\n\n/**\n * RxJS wrapper for ResizeObserver - auto-cleans on unsubscribe\n */\nexport function fromResizeObserver(element: Element): Observable<ResizeObserverEntry[]> {\n\treturn new Observable(subscriber => {\n\t\tconst observer = new ResizeObserver(entries => subscriber.next(entries))\n\t\tobserver.observe(element)\n\t\treturn () => observer.disconnect()\n\t})\n}\n\n/**\n * fullHeight directive - fills remaining viewport space\n *\n * Reactive sources:\n * - Parent ResizeObserver (layout shifts)\n * - Window resize / visualViewport (viewport changes)\n * - Orientation change (device rotation)\n * - Focus out (mobile keyboard dismiss)\n * - Theme fullscreen toggle\n *\n * Performance:\n * - distinctUntilChanged prevents redundant style writes\n * - debounceTime(16) batches rapid events (~60fps)\n * - Single shared stream for global events\n */\nclass FullHeight extends AsyncDirective {\n\tprivate element: HTMLElement | null = null\n\tprivate disconnecting$ = new Subject<void>()\n\n\tprivate calculateHeight(): number {\n\t\tif (!this.element) return 0\n\t\tconst viewportHeight = window.visualViewport?.height ?? window.innerHeight\n\t\tconst topOffset = this.element.getBoundingClientRect().top\n\t\treturn Math.max(0, viewportHeight - topOffset)\n\t}\n\n\tprivate applyStyles(height: number, bottomPadding: number) {\n\t\tif (this.element) {\n\t\t\tthis.element.style.boxSizing = 'border-box'\n\t\t\tthis.element.style.height = `${height}px`\n\t\t\tthis.element.style.paddingBottom = `${bottomPadding}px`\n\t\t}\n\t}\n\n\tprivate setupHeightStream() {\n\t\tif (!this.element) return\n\n\t\tconst element = this.element\n\n\t\t// Parent resize detects layout shifts (e.g., header rendering after load)\n\t\tconst parentResize$ = element.parentElement\n\t\t\t? fromResizeObserver(element.parentElement)\n\t\t\t: EMPTY\n\n\t\t// Global events (resize, viewport, orientation, fullscreen)\n\t\tconst globalEvents$ = getUpdateStream()\n\n\t\t// Combine all sources, calculate height and padding, dedupe, apply\n\t\t// Skip updates while pinch-zoomed to prevent layout thrashing\n\t\tcombineLatest([\n\t\t\tmerge(parentResize$, globalEvents$).pipe(startWith(null)),\n\t\t\ttheme.bottomOffset$,\n\t\t\ttheme.fullscreen$\n\t\t]).pipe(\n\t\t\tfilter(() => !isZoomed()),\n\t\t\tmap(([, bottomOffset, isFullscreen]) => ({\n\t\t\t\theight: this.calculateHeight(),\n\t\t\t\tpadding: isFullscreen ? 0 : bottomOffset\n\t\t\t})),\n\t\t\tdistinctUntilChanged((a, b) => a.height === b.height && a.padding === b.padding),\n\t\t\ttap(({ height, padding }) => this.applyStyles(height, padding)),\n\t\t\ttakeUntil(this.disconnecting$)\n\t\t).subscribe()\n\n\t}\n\n\trender() {\n\t\treturn\n\t}\n\n\tupdate(part: ElementPart) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('fullHeight directive can only be used on elements')\n\t\t}\n\t\tconst el = part.element as HTMLElement\n\t\tif (this.element !== el) {\n\t\t\tthis.element = el\n\t\t\telementCount++\n\t\t\tthis.setupHeightStream()\n\t\t}\n\t}\n\n\tdisconnected() {\n\t\tthis.disconnecting$.next()\n\t\telementCount--\n\t\tcleanup()\n\t\tthis.element = null\n\t}\n\n\treconnected() {\n\t\tif (this.element) {\n\t\t\telementCount++\n\t\t\tthis.disconnecting$ = new Subject<void>()\n\t\t\tthis.setupHeightStream()\n\t\t}\n\t}\n}\n\nexport const fullHeight = directive(FullHeight)\n\n/**\n * fullWidth directive - fills remaining horizontal viewport space\n *\n * Reactive sources:\n * - Element ResizeObserver (detects when element moves/resizes)\n * - Parent ResizeObserver (layout shifts, e.g., sidebar)\n * - Window resize / visualViewport (viewport changes)\n * - Orientation change (device rotation)\n * - Theme fullscreen toggle (sidebar visibility)\n *\n * Performance:\n * - distinctUntilChanged prevents redundant style writes\n * - debounceTime(16) batches rapid events (~60fps)\n * - Single shared stream for global events\n */\nclass FullWidth extends AsyncDirective {\n\tprivate element: HTMLElement | null = null\n\tprivate disconnecting$ = new Subject<void>()\n\n\tprivate calculateWidth(): number {\n\t\tif (!this.element) return 0\n\t\tconst viewportWidth = window.visualViewport?.width ?? window.innerWidth\n\t\tconst leftOffset = this.element.getBoundingClientRect().left\n\t\treturn Math.max(0, viewportWidth - leftOffset)\n\t}\n\n\tprivate applyStyles(width: number) {\n\t\tif (this.element) {\n\t\t\tthis.element.style.boxSizing = 'border-box'\n\t\t\tthis.element.style.maxWidth = `${width}px`\n\t\t}\n\t}\n\n\tprivate setupWidthStream() {\n\t\tif (!this.element) return\n\n\t\tconst element = this.element\n\n\t\t// Element resize detects when element itself moves (e.g., after layout settles)\n\t\tconst elementResize$ = fromResizeObserver(element)\n\n\t\t// Parent resize detects layout shifts (e.g., sidebar opening/closing)\n\t\tconst parentResize$ = element.parentElement\n\t\t\t? fromResizeObserver(element.parentElement)\n\t\t\t: EMPTY\n\n\t\t// Global events (resize, viewport, orientation)\n\t\tconst globalEvents$ = getUpdateStream()\n\n\t\t// Combine all sources with theme observables for synchronous initial emission\n\t\t// theme.fullscreen$ has shareReplay(1) ensuring immediate emission on subscribe\n\t\t// Skip updates while pinch-zoomed to prevent layout thrashing\n\t\tcombineLatest([\n\t\t\tmerge(elementResize$, parentResize$, globalEvents$).pipe(startWith(null)),\n\t\t\ttheme.fullscreen$\n\t\t]).pipe(\n\t\t\tfilter(() => !isZoomed()),\n\t\t\tmap(() => this.calculateWidth()),\n\t\t\tdistinctUntilChanged(),\n\t\t\ttap(width => this.applyStyles(width)),\n\t\t\ttakeUntil(this.disconnecting$)\n\t\t).subscribe()\n\t}\n\n\trender() {\n\t\treturn\n\t}\n\n\tupdate(part: ElementPart) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('fullWidth directive can only be used on elements')\n\t\t}\n\t\tconst el = part.element as HTMLElement\n\t\tif (this.element !== el) {\n\t\t\tthis.element = el\n\t\t\telementCount++\n\t\t\tthis.setupWidthStream()\n\t\t}\n\t}\n\n\tdisconnected() {\n\t\tthis.disconnecting$.next()\n\t\telementCount--\n\t\tcleanup()\n\t\tthis.element = null\n\t}\n\n\treconnected() {\n\t\tif (this.element) {\n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,QACZ,KAAK,UAAY,IACpB,KAAK,QAAU,EACf,IACA,KAAK,kBAAA,EAIP,cAAA,CACC,KAAK,eAAe,MAAA,CACpB,IACA,GAAA,CACA,KAAK,QAAU,KAGhB,aAAA,CACK,KAAK,UACR,IACA,KAAK,eAAiB,IAAI,EAAA,QAC1B,KAAK,kBAAA,IAKK,GAAA,EAAA,EAAA,WAAsB,EAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"layout-B0dct--7.cjs","names":[],"sources":["../src/directives/layout.ts"],"sourcesContent":["import { directive, ElementPart, PartType } from 'lit/directive.js'\nimport { AsyncDirective } from 'lit/async-directive.js'\nimport { Subject, fromEvent, merge, Observable, EMPTY, timer, combineLatest } from 'rxjs'\nimport { debounceTime, switchMap, takeUntil, distinctUntilChanged, map, tap, startWith, filter } from 'rxjs/operators'\n\n/** Returns true if user is pinch-zoomed (scale !== 1) */\nfunction isZoomed(): boolean {\n\tconst vv = window.visualViewport\n\treturn vv ? Math.abs(vv.scale - 1) > 0.01 : false\n}\nimport { theme } from '../theme/theme.service'\n\n// Shared global update stream (lazy-initialized, cleaned up when no elements use it)\nlet update$: Subject<void> | null = null\nlet updateSub: { unsubscribe: () => void } | null = null\nlet elementCount = 0\n\nfunction getUpdateStream(): Subject<void> {\n\tif (!update$) {\n\t\tupdate$ = new Subject<void>()\n\n\t\tconst windowResize$ = fromEvent(window, 'resize', { passive: true })\n\n\t\tconst viewportEvents$ = window.visualViewport\n\t\t\t? merge(\n\t\t\t\t\tfromEvent(window.visualViewport, 'resize', { passive: true }),\n\t\t\t\t\tfromEvent(window.visualViewport, 'scroll', { passive: true })\n\t\t\t\t)\n\t\t\t: windowResize$\n\n\t\tconst orientation$ = fromEvent(window, 'orientationchange')\n\n\t\t// iOS Safari: force recalc after keyboard dismissal\n\t\tconst focusOut$ = fromEvent(document, 'focusout', { passive: true }).pipe(\n\t\t\tswitchMap(() => timer(100))\n\t\t)\n\n\t\tupdateSub = merge(windowResize$, viewportEvents$, orientation$, focusOut$)\n\t\t\t.pipe(debounceTime(16))\n\t\t\t.subscribe(() => update$!.next())\n\t}\n\treturn update$\n}\n\nfunction cleanup() {\n\tif (elementCount === 0 && updateSub) {\n\t\tupdateSub.unsubscribe()\n\t\tupdateSub = null\n\t\tupdate$ = null\n\t}\n}\n\n\n/**\n * RxJS wrapper for ResizeObserver - auto-cleans on unsubscribe\n */\nexport function fromResizeObserver(element: Element): Observable<ResizeObserverEntry[]> {\n\treturn new Observable(subscriber => {\n\t\tconst observer = new ResizeObserver(entries => subscriber.next(entries))\n\t\tobserver.observe(element)\n\t\treturn () => observer.disconnect()\n\t})\n}\n\n/**\n * fullHeight directive - fills remaining viewport space\n *\n * Reactive sources:\n * - Parent ResizeObserver (layout shifts)\n * - Window resize / visualViewport (viewport changes)\n * - Orientation change (device rotation)\n * - Focus out (mobile keyboard dismiss)\n * - Theme fullscreen toggle\n *\n * Performance:\n * - distinctUntilChanged prevents redundant style writes\n * - debounceTime(16) batches rapid events (~60fps)\n * - Single shared stream for global events\n */\nclass FullHeight extends AsyncDirective {\n\tprivate element: HTMLElement | null = null\n\tprivate disconnecting$ = new Subject<void>()\n\n\tprivate calculateHeight(): number {\n\t\tif (!this.element) return 0\n\t\tconst viewportHeight = window.visualViewport?.height ?? window.innerHeight\n\t\tconst topOffset = this.element.getBoundingClientRect().top\n\t\treturn Math.max(0, viewportHeight - topOffset)\n\t}\n\n\tprivate applyStyles(height: number, bottomPadding: number) {\n\t\tif (this.element) {\n\t\t\tthis.element.style.boxSizing = 'border-box'\n\t\t\tthis.element.style.height = `${height}px`\n\t\t\tthis.element.style.paddingBottom = `${bottomPadding}px`\n\t\t}\n\t}\n\n\tprivate setupHeightStream() {\n\t\tif (!this.element) return\n\n\t\tconst element = this.element\n\n\t\t// Parent resize detects layout shifts (e.g., header rendering after load)\n\t\tconst parentResize$ = element.parentElement\n\t\t\t? fromResizeObserver(element.parentElement)\n\t\t\t: EMPTY\n\n\t\t// Global events (resize, viewport, orientation, fullscreen)\n\t\tconst globalEvents$ = getUpdateStream()\n\n\t\t// Combine all sources, calculate height and padding, dedupe, apply\n\t\t// Skip updates while pinch-zoomed to prevent layout thrashing\n\t\tcombineLatest([\n\t\t\tmerge(parentResize$, globalEvents$).pipe(startWith(null)),\n\t\t\ttheme.bottomOffset$,\n\t\t\ttheme.fullscreen$\n\t\t]).pipe(\n\t\t\tfilter(() => !isZoomed()),\n\t\t\tmap(([, bottomOffset, isFullscreen]) => ({\n\t\t\t\theight: this.calculateHeight(),\n\t\t\t\tpadding: isFullscreen ? 0 : bottomOffset\n\t\t\t})),\n\t\t\tdistinctUntilChanged((a, b) => a.height === b.height && a.padding === b.padding),\n\t\t\ttap(({ height, padding }) => this.applyStyles(height, padding)),\n\t\t\ttakeUntil(this.disconnecting$)\n\t\t).subscribe()\n\n\t}\n\n\trender() {\n\t\treturn\n\t}\n\n\tupdate(part: ElementPart) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('fullHeight directive can only be used on elements')\n\t\t}\n\t\tconst el = part.element as HTMLElement\n\t\tif (this.element !== el) {\n\t\t\tthis.element = el\n\t\t\telementCount++\n\t\t\tthis.setupHeightStream()\n\t\t}\n\t}\n\n\tdisconnected() {\n\t\tthis.disconnecting$.next()\n\t\telementCount--\n\t\tcleanup()\n\t\tthis.element = null\n\t}\n\n\treconnected() {\n\t\tif (this.element) {\n\t\t\telementCount++\n\t\t\tthis.disconnecting$ = new Subject<void>()\n\t\t\tthis.setupHeightStream()\n\t\t}\n\t}\n}\n\nexport const fullHeight = directive(FullHeight)\n\n/**\n * fullWidth directive - fills remaining horizontal viewport space\n *\n * Reactive sources:\n * - Element ResizeObserver (detects when element moves/resizes)\n * - Parent ResizeObserver (layout shifts, e.g., sidebar)\n * - Window resize / visualViewport (viewport changes)\n * - Orientation change (device rotation)\n * - Theme fullscreen toggle (sidebar visibility)\n *\n * Performance:\n * - distinctUntilChanged prevents redundant style writes\n * - debounceTime(16) batches rapid events (~60fps)\n * - Single shared stream for global events\n */\nclass FullWidth extends AsyncDirective {\n\tprivate element: HTMLElement | null = null\n\tprivate disconnecting$ = new Subject<void>()\n\n\tprivate calculateWidth(): number {\n\t\tif (!this.element) return 0\n\t\tconst viewportWidth = window.visualViewport?.width ?? window.innerWidth\n\t\tconst leftOffset = this.element.getBoundingClientRect().left\n\t\treturn Math.max(0, viewportWidth - leftOffset)\n\t}\n\n\tprivate applyStyles(width: number) {\n\t\tif (this.element) {\n\t\t\tthis.element.style.boxSizing = 'border-box'\n\t\t\tthis.element.style.maxWidth = `${width}px`\n\t\t}\n\t}\n\n\tprivate setupWidthStream() {\n\t\tif (!this.element) return\n\n\t\tconst element = this.element\n\n\t\t// Element resize detects when element itself moves (e.g., after layout settles)\n\t\tconst elementResize$ = fromResizeObserver(element)\n\n\t\t// Parent resize detects layout shifts (e.g., sidebar opening/closing)\n\t\tconst parentResize$ = element.parentElement\n\t\t\t? fromResizeObserver(element.parentElement)\n\t\t\t: EMPTY\n\n\t\t// Global events (resize, viewport, orientation)\n\t\tconst globalEvents$ = getUpdateStream()\n\n\t\t// Combine all sources with theme observables for synchronous initial emission\n\t\t// theme.fullscreen$ has shareReplay(1) ensuring immediate emission on subscribe\n\t\t// Skip updates while pinch-zoomed to prevent layout thrashing\n\t\tcombineLatest([\n\t\t\tmerge(elementResize$, parentResize$, globalEvents$).pipe(startWith(null)),\n\t\t\ttheme.fullscreen$\n\t\t]).pipe(\n\t\t\tfilter(() => !isZoomed()),\n\t\t\tmap(() => this.calculateWidth()),\n\t\t\tdistinctUntilChanged(),\n\t\t\ttap(width => this.applyStyles(width)),\n\t\t\ttakeUntil(this.disconnecting$)\n\t\t).subscribe()\n\t}\n\n\trender() {\n\t\treturn\n\t}\n\n\tupdate(part: ElementPart) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('fullWidth directive can only be used on elements')\n\t\t}\n\t\tconst el = part.element as HTMLElement\n\t\tif (this.element !== el) {\n\t\t\tthis.element = el\n\t\t\telementCount++\n\t\t\tthis.setupWidthStream()\n\t\t}\n\t}\n\n\tdisconnected() {\n\t\tthis.disconnecting$.next()\n\t\telementCount--\n\t\tcleanup()\n\t\tthis.element = null\n\t}\n\n\treconnected() {\n\t\tif (this.element) {\n\t\t\telementCount++\n\t\t\tthis.disconnecting$ = new Subject<void>()\n\t\t\tthis.setupWidthStream()\n\t\t}\n\t}\n}\n\nexport const fullWidth = directive(FullWidth)\n"],"mappings":"oMAMA,SAAS,GAAA,CACR,IAAM,EAAK,OAAO,eAClB,MAAA,CAAA,CAAO,GAAK,KAAK,IAAI,EAAG,MAAQ,CAAA,EAAK,GACtC,CAIA,IAAI,EAAgC,KAChC,EAAgD,KAChD,EAAe,EAEnB,SAAS,GAAA,CACR,GAAA,CAAK,EAAS,CACb,EAAU,IAAI,EAAA,QAEd,IAAM,GAAA,EAAA,EAAA,WAA0B,OAAQ,SAAU,CAAE,QAAA,CAAS,CAAA,CAAA,EAgB7D,GAAA,EAAA,EAAA,OAAkB,EAdM,OAAO,gBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,WAElB,OAAO,eAAgB,SAAU,CAAE,QAAA,CAAS,CAAA,CAAA,GAAM,EAAA,EAAA,WAClD,OAAO,eAAgB,SAAU,CAAE,QAAA,CAAS,CAAA,CAAA,CAAA,EAEtD,GAAA,EAAA,EAAA,WAE4B,OAAQ,mBAAA,GAOW,EAAA,EAAA,WAJtB,SAAU,WAAY,CAAE,QAAA,CAAS,CAAA,CAAA,EAAQ,MAAA,EAAA,EAAA,gBAAA,EAAA,EA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|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-DhSiMp6Y.cjs`);require(`./mixins-YQI9JogS.cjs`);let t=require(`rxjs`),n=require(`lit/decorators.js`),r=require(`lit`);var i=class extends e.t{constructor(...e){super(...e),this.hide=!1,this.direction=`both`,this.debounce=10}static{this.styles=[r.css`
|
|
2
2
|
:host {
|
|
3
3
|
/* Flexible sizing for different layout contexts */
|
|
4
4
|
width: 100%;
|
|
@@ -23,4 +23,4 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./ch
|
|
|
23
23
|
:host([hide])::-webkit-scrollbar {
|
|
24
24
|
display: none; /* Chrome, Safari, and Opera */
|
|
25
25
|
}
|
|
26
|
-
`]}get scroller(){return this}scrollTo(e,t){typeof e==`number`?super.scrollTo({top:e,behavior:t?`smooth`:`auto`}):e?super.scrollTo(e):super.scrollTo({top:0,left:0,behavior:`auto`})}scrollToLeft(e,t=`auto`){super.scrollTo({left:e,behavior:t})}connectedCallback(){super.connectedCallback(),this.updateScrollingStyles(),this.updateLayoutContext(),this.setAttribute(`part`,`scroller`)}updateScrollingStyles(){this.direction===`horizontal`?(this.style.setProperty(`overflow-y`,`hidden`),this.style.setProperty(`overflow-x`,`auto`)):this.direction===`vertical`?(this.style.setProperty(`overflow-y`,`auto`),this.style.setProperty(`overflow-x`,`hidden`)):(this.style.setProperty(`overflow-y`,`auto`),this.style.setProperty(`overflow-x`,`auto`))}updateLayoutContext(){requestAnimationFrame(()=>{let e=this.parentElement;if(e){let t=getComputedStyle(e);t.display===`flex`||t.display===`inline-flex`?this.classList.remove(`explicit-height`):this.classList.add(`explicit-height`)}else this.classList.add(`explicit-height`)})}updated(e){super.updated(e),e.has(`direction`)&&this.updateScrollingStyles(),this.updateLayoutContext()}firstUpdated(){(0,
|
|
26
|
+
`]}get scroller(){return this}scrollTo(e,t){typeof e==`number`?super.scrollTo({top:e,behavior:t?`smooth`:`auto`}):e?super.scrollTo(e):super.scrollTo({top:0,left:0,behavior:`auto`})}scrollToLeft(e,t=`auto`){super.scrollTo({left:e,behavior:t})}connectedCallback(){super.connectedCallback(),this.updateScrollingStyles(),this.updateLayoutContext(),this.setAttribute(`part`,`scroller`)}updateScrollingStyles(){this.direction===`horizontal`?(this.style.setProperty(`overflow-y`,`hidden`),this.style.setProperty(`overflow-x`,`auto`)):this.direction===`vertical`?(this.style.setProperty(`overflow-y`,`auto`),this.style.setProperty(`overflow-x`,`hidden`)):(this.style.setProperty(`overflow-y`,`auto`),this.style.setProperty(`overflow-x`,`auto`))}updateLayoutContext(){requestAnimationFrame(()=>{let e=this.parentElement;if(e){let t=getComputedStyle(e);t.display===`flex`||t.display===`inline-flex`?this.classList.remove(`explicit-height`):this.classList.add(`explicit-height`)}else this.classList.add(`explicit-height`)})}updated(e){super.updated(e),e.has(`direction`)&&this.updateScrollingStyles(),this.updateLayoutContext()}firstUpdated(){(0,t.fromEvent)(this.scroller,`scroll`,{passive:!0}).pipe((0,t.debounceTime)(this.debounce),(0,t.takeUntil)(this.disconnecting)).subscribe(e=>{let t=this.scroller.scrollTop,n=this.scroller.scrollHeight,r=this.scroller.clientHeight,i=this.scroller.scrollLeft,a=this.scroller.scrollWidth,o=this.scroller.clientWidth;this.dispatchEvent(new CustomEvent(`scroll`,{detail:{scrollTop:t,scrollHeight:n,clientHeight:r,e,scrollLeft:i,scrollWidth:a,clientWidth:o},bubbles:!0,composed:!0}))}),(0,t.fromEvent)(window,`@schmancy:scrollTo`).pipe((0,t.filter)(e=>this.name!==void 0&&e.detail.name===this.name),(0,t.takeUntil)(this.disconnecting)).subscribe(e=>{if(e.detail.action===`scrollTo`&&typeof e.detail.top==`number`){let t={behavior:`smooth`,top:e.detail.top};typeof e.detail.left==`number`&&(t.left=e.detail.left),this.scrollTo(t)}})}render(){return r.html`<slot></slot>`}};e.p([(0,n.property)({type:Boolean,reflect:!0})],i.prototype,`hide`,void 0),e.p([(0,n.property)({type:String,reflect:!0})],i.prototype,`name`,void 0),e.p([(0,n.property)({type:String,reflect:!0})],i.prototype,`direction`,void 0),e.p([(0,n.property)({type:Number})],i.prototype,`debounce`,void 0),i=e.p([(0,n.customElement)(`schmancy-scroll`)],i),Object.defineProperty(exports,`SchmancyScroll`,{enumerable:!0,get:function(){return i}});
|
package/dist/layout.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.cjs","names":[],"sources":["../src/layout/scroll/scroll.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { debounceTime, filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Custom scroll event interface for the SchmancyScroll component.\n * Contains detailed information about the scroll state.\n */\nexport interface SchmancyScrollEvent\n\textends CustomEvent<{\n\t\t/** Current scroll position from the top */\n\t\tscrollTop: number\n\t\t/** Total scrollable height of the content */\n\t\tscrollHeight: number\n\t\t/** Visible height of the container */\n\t\tclientHeight: number\n\t\t/** Original scroll event */\n\t\te: Event\n\t\t/** Current scroll position from the left (for horizontal scrolling) */\n\t\tscrollLeft?: number\n\t\t/** Total scrollable width of the content (for horizontal scrolling) */\n\t\tscrollWidth?: number\n\t\t/** Visible width of the container (for horizontal scrolling) */\n\t\tclientWidth?: number\n\t}> {}\n\n/**\n * Command event interface for controlling SchmancyScroll components\n */\nexport interface SchmancyScrollCommandEvent\n\textends CustomEvent<{\n\t\t/** Target component name */\n\t\tname: string\n\t\t/** Command action to perform */\n\t\taction: 'scrollTo'\n\t\t/** Scroll position for scrollTo action */\n\t\ttop: number\n\t\t/** Horizontal scroll position for scrollTo action (optional) */\n\t\tleft?: number\n\t}> {}\n\n// Augment the HTMLElementEventMap to include our custom events\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\tscroll: SchmancyScrollEvent\n\t\t'schmancy-scroll-command': SchmancyScrollCommandEvent\n\t}\n}\n\n/**\n * A custom scrollable container with enhanced features.\n *\n * @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)\n * @slot - Default slot for content to be scrolled\n * @csspart scroller - The inner scrollable div element\n *\n * @example\n * ```html\n * <schmancy-scroll hide name=\"main-content\">\n * <div>Scrollable content goes here</div>\n * </schmancy-scroll>\n * ```\n *\n * @example\n * ```html\n * <schmancy-scroll direction=\"horizontal\" hide name=\"image-carousel\">\n * <div class=\"flex\">\n * <img src=\"image1.jpg\" alt=\"Image 1\">\n * <img src=\"image2.jpg\" alt=\"Image 2\">\n * </div>\n * </schmancy-scroll>\n * ```\n *\n * @example Programmatic scroll with Lit ref\n * ```typescript\n * private scrollRef = createRef<HTMLElement>()\n *\n * // In template:\n * html`<schmancy-scroll ${ref(this.scrollRef)}>...</schmancy-scroll>`\n *\n * // Scroll to top (smooth — host has scroll-behavior: smooth):\n * this.scrollRef.value?.scrollTo({ top: 0 })\n * ```\n */\n@customElement('schmancy-scroll')\nexport class SchmancyScroll extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\t/* Flexible sizing for different layout contexts */\n\t\twidth: 100%;\n\t\tmin-height: 0; /* Allow flex shrinking */\n\t\tflex: 1; /* Grow in flex containers */\n\t\tbox-sizing: border-box; /* Ensures proper sizing */\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tscroll-behavior: smooth;\n\t\toverscroll-behavior-x: contain;\n\t\toverscroll-behavior-y: auto;\n\t}\n\t/* Fallback for non-flex contexts */\n\t:host(.explicit-height) {\n\t\theight: 100%;\n\t\tflex: none;\n\t}\n\t:host([hide]) {\n\t\t-ms-overflow-style: none; /* IE and Edge */\n\t\tscrollbar-width: none; /* Firefox */\n\t}\n\t:host([hide])::-webkit-scrollbar {\n\t\tdisplay: none; /* Chrome, Safari, and Opera */\n\t}\n`];\n\t/**\n\t * Determines whether the scrollbar is hidden.\n\t *\n\t * When `hide` is true, the host element's scrollbars are hidden\n\t * in supported browsers using CSS.\n\t *\n\t * @attr hide\n\t * @example <schmancy-scroll hide></schmancy-scroll>\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic hide = false\n\n\t/**\n\t * Optional name identifier for the component.\n\t * Used for targeting this specific component with global events.\n\t *\n\t * @attr name\n\t * @example <schmancy-scroll name=\"main-content\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic name?: string\n\n\t/**\n\t * Direction of scrolling: vertical, horizontal, or both.\n\t * - vertical: Only allows vertical scrolling\n\t * - horizontal: Only allows horizontal scrolling\n\t * - both: Allows both horizontal and vertical scrolling (default)\n\t *\n\t * @attr direction\n\t * @example <schmancy-scroll direction=\"horizontal\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic direction: 'vertical' | 'horizontal' | 'both' = 'both'\n\n\t/**\n\t * Reference to the scrollable element (the host element itself)\n\t * @public\n\t */\n\tget scroller(): HTMLElement {\n\t\treturn this\n\t}\n\n\t/**\n\t * Debounce time in milliseconds for the scroll event.\n\t * Higher values reduce the frequency of scroll events being dispatched.\n\t *\n\t * @attr debounce\n\t * @example <schmancy-scroll debounce=\"50\"></schmancy-scroll>\n\t */\n\t@property({ type: Number })\n\tpublic debounce = 10\n\n\t/**\n\t * Scrolls the container to the specified position\n\t * @param options - ScrollToOptions or a number representing the top position\n\t * @param top - For backward compatibility, if options is a number, this is treated as \"behavior\"\n\t */\n\tpublic override scrollTo(options?: ScrollToOptions | number, top?: number): void {\n\t\tif (typeof options === 'number') {\n\t\t\tsuper.scrollTo({ top: options, behavior: top ? 'smooth' : 'auto' })\n\t\t} else if (options) {\n\t\t\tsuper.scrollTo(options)\n\t\t} else {\n\t\t\tsuper.scrollTo({ top: 0, left: 0, behavior: 'auto' })\n\t\t}\n\t}\n\n\t/**\n\t * Scrolls the container horizontally to the specified position\n\t * @param left - The horizontal position to scroll to (in pixels)\n\t * @param behavior - The scroll behavior ('auto' or 'smooth')\n\t */\n\tpublic scrollToLeft(left: number, behavior: ScrollBehavior = 'auto'): void {\n\t\tsuper.scrollTo({ left, behavior })\n\t}\n\n\t/**\n\t * Called when the component is connected to the DOM\n\t * Applies scrolling styles directly to the host element\n\t * @protected\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.updateScrollingStyles()\n\t\tthis.updateLayoutContext()\n\t\t// Set the part attribute on the host element\n\t\tthis.setAttribute('part', 'scroller')\n\t}\n\n\t/**\n\t * Updates the overflow styles based on the direction property\n\t * @private\n\t */\n\tprivate updateScrollingStyles(): void {\n\t\t// Apply overflow styles based on direction\n\t\tif (this.direction === 'horizontal') {\n\t\t\tthis.style.setProperty('overflow-y', 'hidden')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t} else if (this.direction === 'vertical') {\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'hidden')\n\t\t} else {\n\t\t\t// both\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t}\n\t}\n\n\t/**\n\t * Updates the layout context based on parent container type\n\t * @private\n\t */\n\tprivate updateLayoutContext(): void {\n\t\t// Use requestAnimationFrame to ensure DOM is fully rendered\n\t\trequestAnimationFrame(() => {\n\t\t\t// Check if parent is a flex container\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tconst parentStyles = getComputedStyle(parent)\n\t\t\t\tconst isFlexParent = parentStyles.display === 'flex' || parentStyles.display === 'inline-flex'\n\n\t\t\t\t// For debugging - remove in production\n\t\t\t\tconsole.debug('schmancy-scroll parent detection:', {\n\t\t\t\t\tparent: parent.tagName,\n\t\t\t\t\tdisplay: parentStyles.display,\n\t\t\t\t\tisFlexParent,\n\t\t\t\t})\n\n\t\t\t\t// Apply appropriate class based on parent layout\n\t\t\t\tif (isFlexParent) {\n\t\t\t\t\tthis.classList.remove('explicit-height')\n\t\t\t\t} else {\n\t\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default to explicit height if no parent\n\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Called when properties change\n\t * @protected\n\t */\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\t\t// Update styles if direction changes\n\t\tif (changedProperties.has('direction')) {\n\t\t\tthis.updateScrollingStyles()\n\t\t}\n\t\t// Always update layout context in case parent layout changed\n\t\tthis.updateLayoutContext()\n\t}\n\n\t/**\n\t * Called after the component's first update\n\t * Sets up the scroll event listener with debouncing\n\t * @protected\n\t */\n\tprotected firstUpdated(): void {\n\t\t// Set up scroll event listening with debounce\n\t\tfromEvent(this.scroller, 'scroll', {\n\t\t\tpassive: true,\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tdebounceTime(this.debounce),\n\t\t\t\ttakeUntil(this.disconnecting), // Unsubscribe when the element is destroyed\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\t// Always include the original required properties for backward compatibility\n\t\t\t\tconst scrollTop = this.scroller.scrollTop\n\t\t\t\tconst scrollHeight = this.scroller.scrollHeight\n\t\t\t\tconst clientHeight = this.scroller.clientHeight\n\n\t\t\t\t// Include horizontal scroll information as optional properties\n\t\t\t\tconst scrollLeft = this.scroller.scrollLeft\n\t\t\t\tconst scrollWidth = this.scroller.scrollWidth\n\t\t\t\tconst clientWidth = this.scroller.clientWidth\n\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('scroll', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t// Original required properties first\n\t\t\t\t\t\t\tscrollTop,\n\t\t\t\t\t\t\tscrollHeight,\n\t\t\t\t\t\t\tclientHeight,\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t// New optional properties last\n\t\t\t\t\t\t\tscrollLeft,\n\t\t\t\t\t\t\tscrollWidth,\n\t\t\t\t\t\t\tclientWidth,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}) as SchmancyScrollEvent,\n\t\t\t\t)\n\t\t\t})\n\n\t\t// Set up global command event listener\n\t\tfromEvent<SchmancyScrollCommandEvent>(window, '@schmancy:scrollTo')\n\t\t\t.pipe(\n\t\t\t\t// Only process events targeting this component by name\n\t\t\t\tfilter(e => this.name !== undefined && e.detail.name === this.name),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.detail.action === 'scrollTo' && typeof e.detail.top === 'number') {\n\t\t\t\t\tconst options: ScrollToOptions = {\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\ttop: e.detail.top, // Required for backward compatibility\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add optional left position if provided\n\t\t\t\t\tif (typeof e.detail.left === 'number') {\n\t\t\t\t\t\toptions.left = e.detail.left\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.scrollTo(options)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t/**\n\t * Renders the component template\n\t * @returns {TemplateResult} The template to render\n\t * @protected\n\t */\n\tprotected render() {\n\t\t// Only render the slot, all styling is applied to the host\n\t\treturn html`<slot></slot>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-scroll': SchmancyScroll\n\t}\n}\n"],"mappings":"0PAsFO,IAAA,EAAA,cAA6B,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,EAAA,CAAA,KAAA,KAAA,CAqCrB,EAAA,KAAA,UAsByC,OAAA,KAAA,SAkBrC,GAAA,OAAA,KAAA,OA5EF,CAAC,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;GAgEpB,IAAA,UAAI,CACH,OAAO,KAkBR,SAAyB,EAAoC,EAAA,CACrC,OAAZ,GAAY,SACtB,MAAM,SAAS,CAAE,IAAK,EAAS,S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AA,CAAA,CAAkB,EAAA,CAAA,OAAA,eAAA,QAAA,iBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"layout.cjs","names":[],"sources":["../src/layout/scroll/scroll.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { debounceTime, filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Custom scroll event interface for the SchmancyScroll component.\n * Contains detailed information about the scroll state.\n */\nexport interface SchmancyScrollEvent\n\textends CustomEvent<{\n\t\t/** Current scroll position from the top */\n\t\tscrollTop: number\n\t\t/** Total scrollable height of the content */\n\t\tscrollHeight: number\n\t\t/** Visible height of the container */\n\t\tclientHeight: number\n\t\t/** Original scroll event */\n\t\te: Event\n\t\t/** Current scroll position from the left (for horizontal scrolling) */\n\t\tscrollLeft?: number\n\t\t/** Total scrollable width of the content (for horizontal scrolling) */\n\t\tscrollWidth?: number\n\t\t/** Visible width of the container (for horizontal scrolling) */\n\t\tclientWidth?: number\n\t}> {}\n\n/**\n * Command event interface for controlling SchmancyScroll components\n */\nexport interface SchmancyScrollCommandEvent\n\textends CustomEvent<{\n\t\t/** Target component name */\n\t\tname: string\n\t\t/** Command action to perform */\n\t\taction: 'scrollTo'\n\t\t/** Scroll position for scrollTo action */\n\t\ttop: number\n\t\t/** Horizontal scroll position for scrollTo action (optional) */\n\t\tleft?: number\n\t}> {}\n\n// Augment the HTMLElementEventMap to include our custom events\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\tscroll: SchmancyScrollEvent\n\t\t'schmancy-scroll-command': SchmancyScrollCommandEvent\n\t}\n}\n\n/**\n * A custom scrollable container with enhanced features.\n *\n * @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)\n * @slot - Default slot for content to be scrolled\n * @csspart scroller - The inner scrollable div element\n *\n * @example\n * ```html\n * <schmancy-scroll hide name=\"main-content\">\n * <div>Scrollable content goes here</div>\n * </schmancy-scroll>\n * ```\n *\n * @example\n * ```html\n * <schmancy-scroll direction=\"horizontal\" hide name=\"image-carousel\">\n * <div class=\"flex\">\n * <img src=\"image1.jpg\" alt=\"Image 1\">\n * <img src=\"image2.jpg\" alt=\"Image 2\">\n * </div>\n * </schmancy-scroll>\n * ```\n *\n * @example Programmatic scroll with Lit ref\n * ```typescript\n * private scrollRef = createRef<HTMLElement>()\n *\n * // In template:\n * html`<schmancy-scroll ${ref(this.scrollRef)}>...</schmancy-scroll>`\n *\n * // Scroll to top (smooth — host has scroll-behavior: smooth):\n * this.scrollRef.value?.scrollTo({ top: 0 })\n * ```\n */\n@customElement('schmancy-scroll')\nexport class SchmancyScroll extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\t/* Flexible sizing for different layout contexts */\n\t\twidth: 100%;\n\t\tmin-height: 0; /* Allow flex shrinking */\n\t\tflex: 1; /* Grow in flex containers */\n\t\tbox-sizing: border-box; /* Ensures proper sizing */\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tscroll-behavior: smooth;\n\t\toverscroll-behavior-x: contain;\n\t\toverscroll-behavior-y: auto;\n\t}\n\t/* Fallback for non-flex contexts */\n\t:host(.explicit-height) {\n\t\theight: 100%;\n\t\tflex: none;\n\t}\n\t:host([hide]) {\n\t\t-ms-overflow-style: none; /* IE and Edge */\n\t\tscrollbar-width: none; /* Firefox */\n\t}\n\t:host([hide])::-webkit-scrollbar {\n\t\tdisplay: none; /* Chrome, Safari, and Opera */\n\t}\n`];\n\t/**\n\t * Determines whether the scrollbar is hidden.\n\t *\n\t * When `hide` is true, the host element's scrollbars are hidden\n\t * in supported browsers using CSS.\n\t *\n\t * @attr hide\n\t * @example <schmancy-scroll hide></schmancy-scroll>\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic hide = false\n\n\t/**\n\t * Optional name identifier for the component.\n\t * Used for targeting this specific component with global events.\n\t *\n\t * @attr name\n\t * @example <schmancy-scroll name=\"main-content\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic name?: string\n\n\t/**\n\t * Direction of scrolling: vertical, horizontal, or both.\n\t * - vertical: Only allows vertical scrolling\n\t * - horizontal: Only allows horizontal scrolling\n\t * - both: Allows both horizontal and vertical scrolling (default)\n\t *\n\t * @attr direction\n\t * @example <schmancy-scroll direction=\"horizontal\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic direction: 'vertical' | 'horizontal' | 'both' = 'both'\n\n\t/**\n\t * Reference to the scrollable element (the host element itself)\n\t * @public\n\t */\n\tget scroller(): HTMLElement {\n\t\treturn this\n\t}\n\n\t/**\n\t * Debounce time in milliseconds for the scroll event.\n\t * Higher values reduce the frequency of scroll events being dispatched.\n\t *\n\t * @attr debounce\n\t * @example <schmancy-scroll debounce=\"50\"></schmancy-scroll>\n\t */\n\t@property({ type: Number })\n\tpublic debounce = 10\n\n\t/**\n\t * Scrolls the container to the specified position\n\t * @param options - ScrollToOptions or a number representing the top position\n\t * @param top - For backward compatibility, if options is a number, this is treated as \"behavior\"\n\t */\n\tpublic override scrollTo(options?: ScrollToOptions | number, top?: number): void {\n\t\tif (typeof options === 'number') {\n\t\t\tsuper.scrollTo({ top: options, behavior: top ? 'smooth' : 'auto' })\n\t\t} else if (options) {\n\t\t\tsuper.scrollTo(options)\n\t\t} else {\n\t\t\tsuper.scrollTo({ top: 0, left: 0, behavior: 'auto' })\n\t\t}\n\t}\n\n\t/**\n\t * Scrolls the container horizontally to the specified position\n\t * @param left - The horizontal position to scroll to (in pixels)\n\t * @param behavior - The scroll behavior ('auto' or 'smooth')\n\t */\n\tpublic scrollToLeft(left: number, behavior: ScrollBehavior = 'auto'): void {\n\t\tsuper.scrollTo({ left, behavior })\n\t}\n\n\t/**\n\t * Called when the component is connected to the DOM\n\t * Applies scrolling styles directly to the host element\n\t * @protected\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.updateScrollingStyles()\n\t\tthis.updateLayoutContext()\n\t\t// Set the part attribute on the host element\n\t\tthis.setAttribute('part', 'scroller')\n\t}\n\n\t/**\n\t * Updates the overflow styles based on the direction property\n\t * @private\n\t */\n\tprivate updateScrollingStyles(): void {\n\t\t// Apply overflow styles based on direction\n\t\tif (this.direction === 'horizontal') {\n\t\t\tthis.style.setProperty('overflow-y', 'hidden')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t} else if (this.direction === 'vertical') {\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'hidden')\n\t\t} else {\n\t\t\t// both\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t}\n\t}\n\n\t/**\n\t * Updates the layout context based on parent container type\n\t * @private\n\t */\n\tprivate updateLayoutContext(): void {\n\t\t// Use requestAnimationFrame to ensure DOM is fully rendered\n\t\trequestAnimationFrame(() => {\n\t\t\t// Check if parent is a flex container\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tconst parentStyles = getComputedStyle(parent)\n\t\t\t\tconst isFlexParent = parentStyles.display === 'flex' || parentStyles.display === 'inline-flex'\n\n\t\t\t\t// For debugging - remove in production\n\t\t\t\tconsole.debug('schmancy-scroll parent detection:', {\n\t\t\t\t\tparent: parent.tagName,\n\t\t\t\t\tdisplay: parentStyles.display,\n\t\t\t\t\tisFlexParent,\n\t\t\t\t})\n\n\t\t\t\t// Apply appropriate class based on parent layout\n\t\t\t\tif (isFlexParent) {\n\t\t\t\t\tthis.classList.remove('explicit-height')\n\t\t\t\t} else {\n\t\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default to explicit height if no parent\n\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Called when properties change\n\t * @protected\n\t */\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\t\t// Update styles if direction changes\n\t\tif (changedProperties.has('direction')) {\n\t\t\tthis.updateScrollingStyles()\n\t\t}\n\t\t// Always update layout context in case parent layout changed\n\t\tthis.updateLayoutContext()\n\t}\n\n\t/**\n\t * Called after the component's first update\n\t * Sets up the scroll event listener with debouncing\n\t * @protected\n\t */\n\tprotected firstUpdated(): void {\n\t\t// Set up scroll event listening with debounce\n\t\tfromEvent(this.scroller, 'scroll', {\n\t\t\tpassive: true,\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tdebounceTime(this.debounce),\n\t\t\t\ttakeUntil(this.disconnecting), // Unsubscribe when the element is destroyed\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\t// Always include the original required properties for backward compatibility\n\t\t\t\tconst scrollTop = this.scroller.scrollTop\n\t\t\t\tconst scrollHeight = this.scroller.scrollHeight\n\t\t\t\tconst clientHeight = this.scroller.clientHeight\n\n\t\t\t\t// Include horizontal scroll information as optional properties\n\t\t\t\tconst scrollLeft = this.scroller.scrollLeft\n\t\t\t\tconst scrollWidth = this.scroller.scrollWidth\n\t\t\t\tconst clientWidth = this.scroller.clientWidth\n\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('scroll', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t// Original required properties first\n\t\t\t\t\t\t\tscrollTop,\n\t\t\t\t\t\t\tscrollHeight,\n\t\t\t\t\t\t\tclientHeight,\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t// New optional properties last\n\t\t\t\t\t\t\tscrollLeft,\n\t\t\t\t\t\t\tscrollWidth,\n\t\t\t\t\t\t\tclientWidth,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}) as SchmancyScrollEvent,\n\t\t\t\t)\n\t\t\t})\n\n\t\t// Set up global command event listener\n\t\tfromEvent<SchmancyScrollCommandEvent>(window, '@schmancy:scrollTo')\n\t\t\t.pipe(\n\t\t\t\t// Only process events targeting this component by name\n\t\t\t\tfilter(e => this.name !== undefined && e.detail.name === this.name),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.detail.action === 'scrollTo' && typeof e.detail.top === 'number') {\n\t\t\t\t\tconst options: ScrollToOptions = {\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\ttop: e.detail.top, // Required for backward compatibility\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add optional left position if provided\n\t\t\t\t\tif (typeof e.detail.left === 'number') {\n\t\t\t\t\t\toptions.left = e.detail.left\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.scrollTo(options)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t/**\n\t * Renders the component template\n\t * @returns {TemplateResult} The template to render\n\t * @protected\n\t */\n\tprotected render() {\n\t\t// Only render the slot, all styling is applied to the host\n\t\treturn html`<slot></slot>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-scroll': SchmancyScroll\n\t}\n}\n"],"mappings":"4PAsFO,IAAA,EAAA,cAA6B,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,CAAA,EAAA,KAAA,KAAA,CAqCrB,EAAA,KAAA,UAsByC,OAAA,KAAA,SAkBrC,EAAA,CAAA,OAAA,KAAA,OA5EF,CAAC,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;GAgEpB,IAAA,UAAI,CACH,OAAO,IACR,CAiBA,SAAyB,EAAoC,EAAA,CACrC,OAAZ,GAAY,SACtB,MAAM,SAAS,CAAE,IAAK,EAAS,SAAU,EAAM,SAAW,MAAA,CAAA,EAChD,EACV,MAAM,SAAS,CAAA,EAEf,MAAM,SAAS,CAAE,IAAK,EAAG,KAAM,EAAG,SAAU,MAAA,CAAA,CAE9C,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AA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
package/dist/layout.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { p as e, t } from "./SchmancyElement-BQ4DFufc.js";
|
|
2
|
+
import "./mixins-BYfSDvbP.js";
|
|
3
3
|
import { debounceTime as n, filter as r, fromEvent as i, takeUntil as a } from "rxjs";
|
|
4
4
|
import { customElement as o, property as s } from "lit/decorators.js";
|
|
5
5
|
import { css as c, html as l } from "lit";
|
|
6
|
-
var u = class extends
|
|
6
|
+
var u = class extends t {
|
|
7
7
|
constructor(...e) {
|
|
8
8
|
super(...e), this.hide = !1, this.direction = "both", this.debounce = 10;
|
|
9
9
|
}
|
|
@@ -102,14 +102,14 @@ var u = class extends e {
|
|
|
102
102
|
return l`<slot></slot>`;
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
|
|
105
|
+
e([s({
|
|
106
106
|
type: Boolean,
|
|
107
107
|
reflect: !0
|
|
108
|
-
})], u.prototype, "hide", void 0),
|
|
108
|
+
})], u.prototype, "hide", void 0), e([s({
|
|
109
109
|
type: String,
|
|
110
110
|
reflect: !0
|
|
111
|
-
})], u.prototype, "name", void 0),
|
|
111
|
+
})], u.prototype, "name", void 0), e([s({
|
|
112
112
|
type: String,
|
|
113
113
|
reflect: !0
|
|
114
|
-
})], u.prototype, "direction", void 0),
|
|
114
|
+
})], u.prototype, "direction", void 0), e([s({ type: Number })], u.prototype, "debounce", void 0), u = e([o("schmancy-scroll")], u);
|
|
115
115
|
export { u as SchmancyScroll };
|
package/dist/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","names":[],"sources":["../src/layout/scroll/scroll.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { debounceTime, filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Custom scroll event interface for the SchmancyScroll component.\n * Contains detailed information about the scroll state.\n */\nexport interface SchmancyScrollEvent\n\textends CustomEvent<{\n\t\t/** Current scroll position from the top */\n\t\tscrollTop: number\n\t\t/** Total scrollable height of the content */\n\t\tscrollHeight: number\n\t\t/** Visible height of the container */\n\t\tclientHeight: number\n\t\t/** Original scroll event */\n\t\te: Event\n\t\t/** Current scroll position from the left (for horizontal scrolling) */\n\t\tscrollLeft?: number\n\t\t/** Total scrollable width of the content (for horizontal scrolling) */\n\t\tscrollWidth?: number\n\t\t/** Visible width of the container (for horizontal scrolling) */\n\t\tclientWidth?: number\n\t}> {}\n\n/**\n * Command event interface for controlling SchmancyScroll components\n */\nexport interface SchmancyScrollCommandEvent\n\textends CustomEvent<{\n\t\t/** Target component name */\n\t\tname: string\n\t\t/** Command action to perform */\n\t\taction: 'scrollTo'\n\t\t/** Scroll position for scrollTo action */\n\t\ttop: number\n\t\t/** Horizontal scroll position for scrollTo action (optional) */\n\t\tleft?: number\n\t}> {}\n\n// Augment the HTMLElementEventMap to include our custom events\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\tscroll: SchmancyScrollEvent\n\t\t'schmancy-scroll-command': SchmancyScrollCommandEvent\n\t}\n}\n\n/**\n * A custom scrollable container with enhanced features.\n *\n * @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)\n * @slot - Default slot for content to be scrolled\n * @csspart scroller - The inner scrollable div element\n *\n * @example\n * ```html\n * <schmancy-scroll hide name=\"main-content\">\n * <div>Scrollable content goes here</div>\n * </schmancy-scroll>\n * ```\n *\n * @example\n * ```html\n * <schmancy-scroll direction=\"horizontal\" hide name=\"image-carousel\">\n * <div class=\"flex\">\n * <img src=\"image1.jpg\" alt=\"Image 1\">\n * <img src=\"image2.jpg\" alt=\"Image 2\">\n * </div>\n * </schmancy-scroll>\n * ```\n *\n * @example Programmatic scroll with Lit ref\n * ```typescript\n * private scrollRef = createRef<HTMLElement>()\n *\n * // In template:\n * html`<schmancy-scroll ${ref(this.scrollRef)}>...</schmancy-scroll>`\n *\n * // Scroll to top (smooth — host has scroll-behavior: smooth):\n * this.scrollRef.value?.scrollTo({ top: 0 })\n * ```\n */\n@customElement('schmancy-scroll')\nexport class SchmancyScroll extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\t/* Flexible sizing for different layout contexts */\n\t\twidth: 100%;\n\t\tmin-height: 0; /* Allow flex shrinking */\n\t\tflex: 1; /* Grow in flex containers */\n\t\tbox-sizing: border-box; /* Ensures proper sizing */\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tscroll-behavior: smooth;\n\t\toverscroll-behavior-x: contain;\n\t\toverscroll-behavior-y: auto;\n\t}\n\t/* Fallback for non-flex contexts */\n\t:host(.explicit-height) {\n\t\theight: 100%;\n\t\tflex: none;\n\t}\n\t:host([hide]) {\n\t\t-ms-overflow-style: none; /* IE and Edge */\n\t\tscrollbar-width: none; /* Firefox */\n\t}\n\t:host([hide])::-webkit-scrollbar {\n\t\tdisplay: none; /* Chrome, Safari, and Opera */\n\t}\n`];\n\t/**\n\t * Determines whether the scrollbar is hidden.\n\t *\n\t * When `hide` is true, the host element's scrollbars are hidden\n\t * in supported browsers using CSS.\n\t *\n\t * @attr hide\n\t * @example <schmancy-scroll hide></schmancy-scroll>\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic hide = false\n\n\t/**\n\t * Optional name identifier for the component.\n\t * Used for targeting this specific component with global events.\n\t *\n\t * @attr name\n\t * @example <schmancy-scroll name=\"main-content\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic name?: string\n\n\t/**\n\t * Direction of scrolling: vertical, horizontal, or both.\n\t * - vertical: Only allows vertical scrolling\n\t * - horizontal: Only allows horizontal scrolling\n\t * - both: Allows both horizontal and vertical scrolling (default)\n\t *\n\t * @attr direction\n\t * @example <schmancy-scroll direction=\"horizontal\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic direction: 'vertical' | 'horizontal' | 'both' = 'both'\n\n\t/**\n\t * Reference to the scrollable element (the host element itself)\n\t * @public\n\t */\n\tget scroller(): HTMLElement {\n\t\treturn this\n\t}\n\n\t/**\n\t * Debounce time in milliseconds for the scroll event.\n\t * Higher values reduce the frequency of scroll events being dispatched.\n\t *\n\t * @attr debounce\n\t * @example <schmancy-scroll debounce=\"50\"></schmancy-scroll>\n\t */\n\t@property({ type: Number })\n\tpublic debounce = 10\n\n\t/**\n\t * Scrolls the container to the specified position\n\t * @param options - ScrollToOptions or a number representing the top position\n\t * @param top - For backward compatibility, if options is a number, this is treated as \"behavior\"\n\t */\n\tpublic override scrollTo(options?: ScrollToOptions | number, top?: number): void {\n\t\tif (typeof options === 'number') {\n\t\t\tsuper.scrollTo({ top: options, behavior: top ? 'smooth' : 'auto' })\n\t\t} else if (options) {\n\t\t\tsuper.scrollTo(options)\n\t\t} else {\n\t\t\tsuper.scrollTo({ top: 0, left: 0, behavior: 'auto' })\n\t\t}\n\t}\n\n\t/**\n\t * Scrolls the container horizontally to the specified position\n\t * @param left - The horizontal position to scroll to (in pixels)\n\t * @param behavior - The scroll behavior ('auto' or 'smooth')\n\t */\n\tpublic scrollToLeft(left: number, behavior: ScrollBehavior = 'auto'): void {\n\t\tsuper.scrollTo({ left, behavior })\n\t}\n\n\t/**\n\t * Called when the component is connected to the DOM\n\t * Applies scrolling styles directly to the host element\n\t * @protected\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.updateScrollingStyles()\n\t\tthis.updateLayoutContext()\n\t\t// Set the part attribute on the host element\n\t\tthis.setAttribute('part', 'scroller')\n\t}\n\n\t/**\n\t * Updates the overflow styles based on the direction property\n\t * @private\n\t */\n\tprivate updateScrollingStyles(): void {\n\t\t// Apply overflow styles based on direction\n\t\tif (this.direction === 'horizontal') {\n\t\t\tthis.style.setProperty('overflow-y', 'hidden')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t} else if (this.direction === 'vertical') {\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'hidden')\n\t\t} else {\n\t\t\t// both\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t}\n\t}\n\n\t/**\n\t * Updates the layout context based on parent container type\n\t * @private\n\t */\n\tprivate updateLayoutContext(): void {\n\t\t// Use requestAnimationFrame to ensure DOM is fully rendered\n\t\trequestAnimationFrame(() => {\n\t\t\t// Check if parent is a flex container\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tconst parentStyles = getComputedStyle(parent)\n\t\t\t\tconst isFlexParent = parentStyles.display === 'flex' || parentStyles.display === 'inline-flex'\n\n\t\t\t\t// For debugging - remove in production\n\t\t\t\tconsole.debug('schmancy-scroll parent detection:', {\n\t\t\t\t\tparent: parent.tagName,\n\t\t\t\t\tdisplay: parentStyles.display,\n\t\t\t\t\tisFlexParent,\n\t\t\t\t})\n\n\t\t\t\t// Apply appropriate class based on parent layout\n\t\t\t\tif (isFlexParent) {\n\t\t\t\t\tthis.classList.remove('explicit-height')\n\t\t\t\t} else {\n\t\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default to explicit height if no parent\n\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Called when properties change\n\t * @protected\n\t */\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\t\t// Update styles if direction changes\n\t\tif (changedProperties.has('direction')) {\n\t\t\tthis.updateScrollingStyles()\n\t\t}\n\t\t// Always update layout context in case parent layout changed\n\t\tthis.updateLayoutContext()\n\t}\n\n\t/**\n\t * Called after the component's first update\n\t * Sets up the scroll event listener with debouncing\n\t * @protected\n\t */\n\tprotected firstUpdated(): void {\n\t\t// Set up scroll event listening with debounce\n\t\tfromEvent(this.scroller, 'scroll', {\n\t\t\tpassive: true,\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tdebounceTime(this.debounce),\n\t\t\t\ttakeUntil(this.disconnecting), // Unsubscribe when the element is destroyed\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\t// Always include the original required properties for backward compatibility\n\t\t\t\tconst scrollTop = this.scroller.scrollTop\n\t\t\t\tconst scrollHeight = this.scroller.scrollHeight\n\t\t\t\tconst clientHeight = this.scroller.clientHeight\n\n\t\t\t\t// Include horizontal scroll information as optional properties\n\t\t\t\tconst scrollLeft = this.scroller.scrollLeft\n\t\t\t\tconst scrollWidth = this.scroller.scrollWidth\n\t\t\t\tconst clientWidth = this.scroller.clientWidth\n\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('scroll', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t// Original required properties first\n\t\t\t\t\t\t\tscrollTop,\n\t\t\t\t\t\t\tscrollHeight,\n\t\t\t\t\t\t\tclientHeight,\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t// New optional properties last\n\t\t\t\t\t\t\tscrollLeft,\n\t\t\t\t\t\t\tscrollWidth,\n\t\t\t\t\t\t\tclientWidth,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}) as SchmancyScrollEvent,\n\t\t\t\t)\n\t\t\t})\n\n\t\t// Set up global command event listener\n\t\tfromEvent<SchmancyScrollCommandEvent>(window, '@schmancy:scrollTo')\n\t\t\t.pipe(\n\t\t\t\t// Only process events targeting this component by name\n\t\t\t\tfilter(e => this.name !== undefined && e.detail.name === this.name),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.detail.action === 'scrollTo' && typeof e.detail.top === 'number') {\n\t\t\t\t\tconst options: ScrollToOptions = {\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\ttop: e.detail.top, // Required for backward compatibility\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add optional left position if provided\n\t\t\t\t\tif (typeof e.detail.left === 'number') {\n\t\t\t\t\t\toptions.left = e.detail.left\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.scrollTo(options)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t/**\n\t * Renders the component template\n\t * @returns {TemplateResult} The template to render\n\t * @protected\n\t */\n\tprotected render() {\n\t\t// Only render the slot, all styling is applied to the host\n\t\treturn html`<slot></slot>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-scroll': SchmancyScroll\n\t}\n}\n"],"mappings":";;;;;AAsFO,IAAA,IAAA,cAA6B,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,EAAA,EAAA,KAAA,OAAA,CAqCrB,GAAA,KAAA,YAsByC,QAAA,KAAA,WAkBrC;;CAAA;EAAA,KAAA,SA5EF,CAAC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEpB,IAAA,WAAI;EACH,OAAO;;CAkBR,SAAyB,GAAoC,GAAA;EACrC,AAAA,OAAZ,KAAY,WACtB,MAAM,SAAS;GAAE,KAAK;GAAS,UAAU,IAAM,WAAW;GAAA,CAAA,GAChD,IACV,MAAM,SAAS,EAAA,GAEf,MAAM,SAAS;GAAE,KAAK;GAAG,MAAM;GAAG,UAAU;GAAA,CAAA;;CAS9C,aAAoB,GAAc,IAA2B,QAAA;EAC5D,MAAM,SAAS;GAAE,MAAA;GAAM,UAAA;GAAA,CAAA;;CAQxB,oBAAA;EACC,MAAM,mBAAA,EACN,KAAK,uBAAA,EACL,KAAK,qBAAA,EAEL,KAAK,aAAa,QAAQ,WAAA;;CAO3B,wBAAA;EAEwB,AAAnB,KAAK,cAAc,gBACtB,KAAK,MAAM,YAAY,cAAc,SAAA,EACrC,KAAK,MAAM,YAAY,cAAc,OA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O,OAAQ,UAAU;IACvE,IAAM,IAA2B;KAChC,UAAU;KACV,KAAK,EAAE,OAAO;KAAA;IAIc,AAAA,OAAlB,EAAE,OAAO,QAAS,aAC5B,EAAQ,OAAO,EAAE,OAAO,OAGzB,KAAK,SAAS,EAAA;;IAAA;;CAUlB,SAAA;EAEC,OAAO,CAAI;;;AAAA,EAAA,CA7NX,EAAS;CAAE,MAAM;CAAS,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAU1C,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAYzC,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,aAAA,KAAA,EAAA,EAAA,EAAA,CAkBzC,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CA7E3B,EAAc,kBAAA,CAAA,EAAkB,EAAA;AAAA,SAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"layout.js","names":[],"sources":["../src/layout/scroll/scroll.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { debounceTime, filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Custom scroll event interface for the SchmancyScroll component.\n * Contains detailed information about the scroll state.\n */\nexport interface SchmancyScrollEvent\n\textends CustomEvent<{\n\t\t/** Current scroll position from the top */\n\t\tscrollTop: number\n\t\t/** Total scrollable height of the content */\n\t\tscrollHeight: number\n\t\t/** Visible height of the container */\n\t\tclientHeight: number\n\t\t/** Original scroll event */\n\t\te: Event\n\t\t/** Current scroll position from the left (for horizontal scrolling) */\n\t\tscrollLeft?: number\n\t\t/** Total scrollable width of the content (for horizontal scrolling) */\n\t\tscrollWidth?: number\n\t\t/** Visible width of the container (for horizontal scrolling) */\n\t\tclientWidth?: number\n\t}> {}\n\n/**\n * Command event interface for controlling SchmancyScroll components\n */\nexport interface SchmancyScrollCommandEvent\n\textends CustomEvent<{\n\t\t/** Target component name */\n\t\tname: string\n\t\t/** Command action to perform */\n\t\taction: 'scrollTo'\n\t\t/** Scroll position for scrollTo action */\n\t\ttop: number\n\t\t/** Horizontal scroll position for scrollTo action (optional) */\n\t\tleft?: number\n\t}> {}\n\n// Augment the HTMLElementEventMap to include our custom events\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\tscroll: SchmancyScrollEvent\n\t\t'schmancy-scroll-command': SchmancyScrollCommandEvent\n\t}\n}\n\n/**\n * A custom scrollable container with enhanced features.\n *\n * @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)\n * @slot - Default slot for content to be scrolled\n * @csspart scroller - The inner scrollable div element\n *\n * @example\n * ```html\n * <schmancy-scroll hide name=\"main-content\">\n * <div>Scrollable content goes here</div>\n * </schmancy-scroll>\n * ```\n *\n * @example\n * ```html\n * <schmancy-scroll direction=\"horizontal\" hide name=\"image-carousel\">\n * <div class=\"flex\">\n * <img src=\"image1.jpg\" alt=\"Image 1\">\n * <img src=\"image2.jpg\" alt=\"Image 2\">\n * </div>\n * </schmancy-scroll>\n * ```\n *\n * @example Programmatic scroll with Lit ref\n * ```typescript\n * private scrollRef = createRef<HTMLElement>()\n *\n * // In template:\n * html`<schmancy-scroll ${ref(this.scrollRef)}>...</schmancy-scroll>`\n *\n * // Scroll to top (smooth — host has scroll-behavior: smooth):\n * this.scrollRef.value?.scrollTo({ top: 0 })\n * ```\n */\n@customElement('schmancy-scroll')\nexport class SchmancyScroll extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\t/* Flexible sizing for different layout contexts */\n\t\twidth: 100%;\n\t\tmin-height: 0; /* Allow flex shrinking */\n\t\tflex: 1; /* Grow in flex containers */\n\t\tbox-sizing: border-box; /* Ensures proper sizing */\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tscroll-behavior: smooth;\n\t\toverscroll-behavior-x: contain;\n\t\toverscroll-behavior-y: auto;\n\t}\n\t/* Fallback for non-flex contexts */\n\t:host(.explicit-height) {\n\t\theight: 100%;\n\t\tflex: none;\n\t}\n\t:host([hide]) {\n\t\t-ms-overflow-style: none; /* IE and Edge */\n\t\tscrollbar-width: none; /* Firefox */\n\t}\n\t:host([hide])::-webkit-scrollbar {\n\t\tdisplay: none; /* Chrome, Safari, and Opera */\n\t}\n`];\n\t/**\n\t * Determines whether the scrollbar is hidden.\n\t *\n\t * When `hide` is true, the host element's scrollbars are hidden\n\t * in supported browsers using CSS.\n\t *\n\t * @attr hide\n\t * @example <schmancy-scroll hide></schmancy-scroll>\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic hide = false\n\n\t/**\n\t * Optional name identifier for the component.\n\t * Used for targeting this specific component with global events.\n\t *\n\t * @attr name\n\t * @example <schmancy-scroll name=\"main-content\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic name?: string\n\n\t/**\n\t * Direction of scrolling: vertical, horizontal, or both.\n\t * - vertical: Only allows vertical scrolling\n\t * - horizontal: Only allows horizontal scrolling\n\t * - both: Allows both horizontal and vertical scrolling (default)\n\t *\n\t * @attr direction\n\t * @example <schmancy-scroll direction=\"horizontal\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic direction: 'vertical' | 'horizontal' | 'both' = 'both'\n\n\t/**\n\t * Reference to the scrollable element (the host element itself)\n\t * @public\n\t */\n\tget scroller(): HTMLElement {\n\t\treturn this\n\t}\n\n\t/**\n\t * Debounce time in milliseconds for the scroll event.\n\t * Higher values reduce the frequency of scroll events being dispatched.\n\t *\n\t * @attr debounce\n\t * @example <schmancy-scroll debounce=\"50\"></schmancy-scroll>\n\t */\n\t@property({ type: Number })\n\tpublic debounce = 10\n\n\t/**\n\t * Scrolls the container to the specified position\n\t * @param options - ScrollToOptions or a number representing the top position\n\t * @param top - For backward compatibility, if options is a number, this is treated as \"behavior\"\n\t */\n\tpublic override scrollTo(options?: ScrollToOptions | number, top?: number): void {\n\t\tif (typeof options === 'number') {\n\t\t\tsuper.scrollTo({ top: options, behavior: top ? 'smooth' : 'auto' })\n\t\t} else if (options) {\n\t\t\tsuper.scrollTo(options)\n\t\t} else {\n\t\t\tsuper.scrollTo({ top: 0, left: 0, behavior: 'auto' })\n\t\t}\n\t}\n\n\t/**\n\t * Scrolls the container horizontally to the specified position\n\t * @param left - The horizontal position to scroll to (in pixels)\n\t * @param behavior - The scroll behavior ('auto' or 'smooth')\n\t */\n\tpublic scrollToLeft(left: number, behavior: ScrollBehavior = 'auto'): void {\n\t\tsuper.scrollTo({ left, behavior })\n\t}\n\n\t/**\n\t * Called when the component is connected to the DOM\n\t * Applies scrolling styles directly to the host element\n\t * @protected\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.updateScrollingStyles()\n\t\tthis.updateLayoutContext()\n\t\t// Set the part attribute on the host element\n\t\tthis.setAttribute('part', 'scroller')\n\t}\n\n\t/**\n\t * Updates the overflow styles based on the direction property\n\t * @private\n\t */\n\tprivate updateScrollingStyles(): void {\n\t\t// Apply overflow styles based on direction\n\t\tif (this.direction === 'horizontal') {\n\t\t\tthis.style.setProperty('overflow-y', 'hidden')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t} else if (this.direction === 'vertical') {\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'hidden')\n\t\t} else {\n\t\t\t// both\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t}\n\t}\n\n\t/**\n\t * Updates the layout context based on parent container type\n\t * @private\n\t */\n\tprivate updateLayoutContext(): void {\n\t\t// Use requestAnimationFrame to ensure DOM is fully rendered\n\t\trequestAnimationFrame(() => {\n\t\t\t// Check if parent is a flex container\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tconst parentStyles = getComputedStyle(parent)\n\t\t\t\tconst isFlexParent = parentStyles.display === 'flex' || parentStyles.display === 'inline-flex'\n\n\t\t\t\t// For debugging - remove in production\n\t\t\t\tconsole.debug('schmancy-scroll parent detection:', {\n\t\t\t\t\tparent: parent.tagName,\n\t\t\t\t\tdisplay: parentStyles.display,\n\t\t\t\t\tisFlexParent,\n\t\t\t\t})\n\n\t\t\t\t// Apply appropriate class based on parent layout\n\t\t\t\tif (isFlexParent) {\n\t\t\t\t\tthis.classList.remove('explicit-height')\n\t\t\t\t} else {\n\t\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default to explicit height if no parent\n\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Called when properties change\n\t * @protected\n\t */\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\t\t// Update styles if direction changes\n\t\tif (changedProperties.has('direction')) {\n\t\t\tthis.updateScrollingStyles()\n\t\t}\n\t\t// Always update layout context in case parent layout changed\n\t\tthis.updateLayoutContext()\n\t}\n\n\t/**\n\t * Called after the component's first update\n\t * Sets up the scroll event listener with debouncing\n\t * @protected\n\t */\n\tprotected firstUpdated(): void {\n\t\t// Set up scroll event listening with debounce\n\t\tfromEvent(this.scroller, 'scroll', {\n\t\t\tpassive: true,\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tdebounceTime(this.debounce),\n\t\t\t\ttakeUntil(this.disconnecting), // Unsubscribe when the element is destroyed\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\t// Always include the original required properties for backward compatibility\n\t\t\t\tconst scrollTop = this.scroller.scrollTop\n\t\t\t\tconst scrollHeight = this.scroller.scrollHeight\n\t\t\t\tconst clientHeight = this.scroller.clientHeight\n\n\t\t\t\t// Include horizontal scroll information as optional properties\n\t\t\t\tconst scrollLeft = this.scroller.scrollLeft\n\t\t\t\tconst scrollWidth = this.scroller.scrollWidth\n\t\t\t\tconst clientWidth = this.scroller.clientWidth\n\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('scroll', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t// Original required properties first\n\t\t\t\t\t\t\tscrollTop,\n\t\t\t\t\t\t\tscrollHeight,\n\t\t\t\t\t\t\tclientHeight,\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t// New optional properties last\n\t\t\t\t\t\t\tscrollLeft,\n\t\t\t\t\t\t\tscrollWidth,\n\t\t\t\t\t\t\tclientWidth,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}) as SchmancyScrollEvent,\n\t\t\t\t)\n\t\t\t})\n\n\t\t// Set up global command event listener\n\t\tfromEvent<SchmancyScrollCommandEvent>(window, '@schmancy:scrollTo')\n\t\t\t.pipe(\n\t\t\t\t// Only process events targeting this component by name\n\t\t\t\tfilter(e => this.name !== undefined && e.detail.name === this.name),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.detail.action === 'scrollTo' && typeof e.detail.top === 'number') {\n\t\t\t\t\tconst options: ScrollToOptions = {\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\ttop: e.detail.top, // Required for backward compatibility\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add optional left position if provided\n\t\t\t\t\tif (typeof e.detail.left === 'number') {\n\t\t\t\t\t\toptions.left = e.detail.left\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.scrollTo(options)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t/**\n\t * Renders the component template\n\t * @returns {TemplateResult} The template to render\n\t * @protected\n\t */\n\tprotected render() {\n\t\t// Only render the slot, all styling is applied to the host\n\t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A,CAAA,CAAA,GAAM,EAAA,WAAA,QAAA,KAAA,CAAA,GAAA,EAAA,CAUzC,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;AAAA,CAAA,CAAA,GAAM,EAAA,WAAA,QAAA,KAAA,CAAA,GAAA,EAAA,CAYxC,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;AAAA,CAAA,CAAA,GAAM,EAAA,WAAA,aAAA,KAAA,CAAA,GAAA,EAAA,CAkBxC,EAAS,EAAE,MAAM,OAAA,CAAA,CAAA,GAAQ,EAAA,WAAA,YAAA,KAAA,CAAA,GAAA,IAAA,EAAA,CA7E1B,EAAc,iBAAA,CAAA,GAAiB,CAAA;AAAA,SAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-CayEFyC3.cjs","names":[],"sources":["../src/area/lazy.ts"],"sourcesContent":["/**\r\n * Lazy loading for Schmancy Area components\r\n * Similar to React.lazy() but adapted for Web Components\r\n */\r\n\r\n// Type definition for custom element constructors\r\ntype CustomElementConstructor = typeof HTMLElement\r\n\r\n/**\r\n * LazyComponent interface with preload capability\r\n */\r\nexport interface LazyComponent<T extends CustomElementConstructor = CustomElementConstructor> {\r\n (): Promise<{ default: T }>\r\n preload(): Promise<void>\r\n _promise?: Promise<{ default: T }>\r\n _module?: { default: T }\r\n}\r\n\r\n/**\r\n * Create a lazy-loaded component that will be imported on demand\r\n *\r\n * @example\r\n * ```typescript\r\n * const LazyProfile = lazy(() => import('./profile'))\r\n *\r\n * // Use with area.push\r\n * area.push({\r\n * component: LazyProfile,\r\n * area: 'main'\r\n * })\r\n *\r\n * // Preload on hover\r\n * element.addEventListener('mouseenter', () => LazyProfile.preload())\r\n * ```\r\n *\r\n * @param loader - Dynamic import function that returns a module with default export\r\n * @returns LazyComponent function compatible with area.push()\r\n */\r\nexport function lazy<T extends CustomElementConstructor>(\r\n loader: () => Promise<{ default: T }>\r\n): LazyComponent<T> {\r\n\r\n // Create the lazy component function\r\n const lazyComponent = function(): Promise<{ default: T }> {\r\n // Return cached promise if already loading/loaded\r\n if (lazyComponent._promise) {\r\n return lazyComponent._promise\r\n }\r\n\r\n // Return cached module if already loaded\r\n if (lazyComponent._module) {\r\n return Promise.resolve(lazyComponent._module)\r\n }\r\n\r\n // Start loading and cache the promise\r\n lazyComponent._promise = loader()\r\n .then(module => {\r\n // Cache the loaded module\r\n lazyComponent._module = module\r\n return module\r\n })\r\n .catch(error => {\r\n // Clear promise on error to allow retry\r\n lazyComponent._promise = undefined\r\n throw error\r\n })\r\n\r\n return lazyComponent._promise\r\n } as LazyComponent<T>\r\n\r\n // Add preload method for manual preloading\r\n lazyComponent.preload = async function(): Promise<void> {\r\n try {\r\n await lazyComponent()\r\n } catch (error) {\r\n console.error('Failed to preload component:', error)\r\n }\r\n }\r\n\r\n return lazyComponent\r\n}\r\n\r\n\r\n"],"mappings":"AAsCA,SAAgB,EACd,EAAA,CAIA,IAAM,EAAgB,UAAA,CAEpB,OAAI,EAAc,SACT,EAAc,SAInB,EAAc,QACT,QAAQ,QAAQ,EAAc,
|
|
1
|
+
{"version":3,"file":"lazy-CayEFyC3.cjs","names":[],"sources":["../src/area/lazy.ts"],"sourcesContent":["/**\r\n * Lazy loading for Schmancy Area components\r\n * Similar to React.lazy() but adapted for Web Components\r\n */\r\n\r\n// Type definition for custom element constructors\r\ntype CustomElementConstructor = typeof HTMLElement\r\n\r\n/**\r\n * LazyComponent interface with preload capability\r\n */\r\nexport interface LazyComponent<T extends CustomElementConstructor = CustomElementConstructor> {\r\n (): Promise<{ default: T }>\r\n preload(): Promise<void>\r\n _promise?: Promise<{ default: T }>\r\n _module?: { default: T }\r\n}\r\n\r\n/**\r\n * Create a lazy-loaded component that will be imported on demand\r\n *\r\n * @example\r\n * ```typescript\r\n * const LazyProfile = lazy(() => import('./profile'))\r\n *\r\n * // Use with area.push\r\n * area.push({\r\n * component: LazyProfile,\r\n * area: 'main'\r\n * })\r\n *\r\n * // Preload on hover\r\n * element.addEventListener('mouseenter', () => LazyProfile.preload())\r\n * ```\r\n *\r\n * @param loader - Dynamic import function that returns a module with default export\r\n * @returns LazyComponent function compatible with area.push()\r\n */\r\nexport function lazy<T extends CustomElementConstructor>(\r\n loader: () => Promise<{ default: T }>\r\n): LazyComponent<T> {\r\n\r\n // Create the lazy component function\r\n const lazyComponent = function(): Promise<{ default: T }> {\r\n // Return cached promise if already loading/loaded\r\n if (lazyComponent._promise) {\r\n return lazyComponent._promise\r\n }\r\n\r\n // Return cached module if already loaded\r\n if (lazyComponent._module) {\r\n return Promise.resolve(lazyComponent._module)\r\n }\r\n\r\n // Start loading and cache the promise\r\n lazyComponent._promise = loader()\r\n .then(module => {\r\n // Cache the loaded module\r\n lazyComponent._module = module\r\n return module\r\n })\r\n .catch(error => {\r\n // Clear promise on error to allow retry\r\n lazyComponent._promise = undefined\r\n throw error\r\n })\r\n\r\n return lazyComponent._promise\r\n } as LazyComponent<T>\r\n\r\n // Add preload method for manual preloading\r\n lazyComponent.preload = async function(): Promise<void> {\r\n try {\r\n await lazyComponent()\r\n } catch (error) {\r\n console.error('Failed to preload component:', error)\r\n }\r\n }\r\n\r\n return lazyComponent\r\n}\r\n\r\n\r\n"],"mappings":"AAsCA,SAAgB,EACd,EAAA,CAIA,IAAM,EAAgB,UAAA,CAEpB,OAAI,EAAc,SACT,EAAc,SAInB,EAAc,QACT,QAAQ,QAAQ,EAAc,OAAA,GAIvC,EAAc,SAAW,EAAA,EACtB,KAAK,IAEJ,EAAc,QAAU,EACjB,EAAA,EAER,MAAM,GAAA,CAGL,KADA,GAAc,SAAA,IAAW,GACnB,CAAA,CAAA,EAGH,EAAc,SACvB,EAWA,MARA,GAAc,QAAU,gBAAA,CACtB,GAAA,CAAA,MACQ,EAAA,CACR,MAAS,CAET,CACF,EAEO,CACT,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-D-bO2r4m.js","names":[],"sources":["../src/area/lazy.ts"],"sourcesContent":["/**\r\n * Lazy loading for Schmancy Area components\r\n * Similar to React.lazy() but adapted for Web Components\r\n */\r\n\r\n// Type definition for custom element constructors\r\ntype CustomElementConstructor = typeof HTMLElement\r\n\r\n/**\r\n * LazyComponent interface with preload capability\r\n */\r\nexport interface LazyComponent<T extends CustomElementConstructor = CustomElementConstructor> {\r\n (): Promise<{ default: T }>\r\n preload(): Promise<void>\r\n _promise?: Promise<{ default: T }>\r\n _module?: { default: T }\r\n}\r\n\r\n/**\r\n * Create a lazy-loaded component that will be imported on demand\r\n *\r\n * @example\r\n * ```typescript\r\n * const LazyProfile = lazy(() => import('./profile'))\r\n *\r\n * // Use with area.push\r\n * area.push({\r\n * component: LazyProfile,\r\n * area: 'main'\r\n * })\r\n *\r\n * // Preload on hover\r\n * element.addEventListener('mouseenter', () => LazyProfile.preload())\r\n * ```\r\n *\r\n * @param loader - Dynamic import function that returns a module with default export\r\n * @returns LazyComponent function compatible with area.push()\r\n */\r\nexport function lazy<T extends CustomElementConstructor>(\r\n loader: () => Promise<{ default: T }>\r\n): LazyComponent<T> {\r\n\r\n // Create the lazy component function\r\n const lazyComponent = function(): Promise<{ default: T }> {\r\n // Return cached promise if already loading/loaded\r\n if (lazyComponent._promise) {\r\n return lazyComponent._promise\r\n }\r\n\r\n // Return cached module if already loaded\r\n if (lazyComponent._module) {\r\n return Promise.resolve(lazyComponent._module)\r\n }\r\n\r\n // Start loading and cache the promise\r\n lazyComponent._promise = loader()\r\n .then(module => {\r\n // Cache the loaded module\r\n lazyComponent._module = module\r\n return module\r\n })\r\n .catch(error => {\r\n // Clear promise on error to allow retry\r\n lazyComponent._promise = undefined\r\n throw error\r\n })\r\n\r\n return lazyComponent._promise\r\n } as LazyComponent<T>\r\n\r\n // Add preload method for manual preloading\r\n lazyComponent.preload = async function(): Promise<void> {\r\n try {\r\n await lazyComponent()\r\n } catch (error) {\r\n console.error('Failed to preload component:', error)\r\n }\r\n }\r\n\r\n return lazyComponent\r\n}\r\n\r\n\r\n"],"mappings":"AAsCA,SAAgB,EACd,GAAA;CAIA,IAAM,IAAgB,WAAA;EAEpB,OAAI,EAAc,WACT,EAAc,WAInB,EAAc,UACT,QAAQ,QAAQ,EAAc,
|
|
1
|
+
{"version":3,"file":"lazy-D-bO2r4m.js","names":[],"sources":["../src/area/lazy.ts"],"sourcesContent":["/**\r\n * Lazy loading for Schmancy Area components\r\n * Similar to React.lazy() but adapted for Web Components\r\n */\r\n\r\n// Type definition for custom element constructors\r\ntype CustomElementConstructor = typeof HTMLElement\r\n\r\n/**\r\n * LazyComponent interface with preload capability\r\n */\r\nexport interface LazyComponent<T extends CustomElementConstructor = CustomElementConstructor> {\r\n (): Promise<{ default: T }>\r\n preload(): Promise<void>\r\n _promise?: Promise<{ default: T }>\r\n _module?: { default: T }\r\n}\r\n\r\n/**\r\n * Create a lazy-loaded component that will be imported on demand\r\n *\r\n * @example\r\n * ```typescript\r\n * const LazyProfile = lazy(() => import('./profile'))\r\n *\r\n * // Use with area.push\r\n * area.push({\r\n * component: LazyProfile,\r\n * area: 'main'\r\n * })\r\n *\r\n * // Preload on hover\r\n * element.addEventListener('mouseenter', () => LazyProfile.preload())\r\n * ```\r\n *\r\n * @param loader - Dynamic import function that returns a module with default export\r\n * @returns LazyComponent function compatible with area.push()\r\n */\r\nexport function lazy<T extends CustomElementConstructor>(\r\n loader: () => Promise<{ default: T }>\r\n): LazyComponent<T> {\r\n\r\n // Create the lazy component function\r\n const lazyComponent = function(): Promise<{ default: T }> {\r\n // Return cached promise if already loading/loaded\r\n if (lazyComponent._promise) {\r\n return lazyComponent._promise\r\n }\r\n\r\n // Return cached module if already loaded\r\n if (lazyComponent._module) {\r\n return Promise.resolve(lazyComponent._module)\r\n }\r\n\r\n // Start loading and cache the promise\r\n lazyComponent._promise = loader()\r\n .then(module => {\r\n // Cache the loaded module\r\n lazyComponent._module = module\r\n return module\r\n })\r\n .catch(error => {\r\n // Clear promise on error to allow retry\r\n lazyComponent._promise = undefined\r\n throw error\r\n })\r\n\r\n return lazyComponent._promise\r\n } as LazyComponent<T>\r\n\r\n // Add preload method for manual preloading\r\n lazyComponent.preload = async function(): Promise<void> {\r\n try {\r\n await lazyComponent()\r\n } catch (error) {\r\n console.error('Failed to preload component:', error)\r\n }\r\n }\r\n\r\n return lazyComponent\r\n}\r\n\r\n\r\n"],"mappings":"AAsCA,SAAgB,EACd,GAAA;CAIA,IAAM,IAAgB,WAAA;EAEpB,OAAI,EAAc,WACT,EAAc,WAInB,EAAc,UACT,QAAQ,QAAQ,EAAc,OAAA,KAIvC,EAAc,WAAW,EAAA,EACtB,MAAK,OAEJ,EAAc,UAAU,GACjB,EAAA,EAER,OAAM,MAAA;GAGL,MADA,EAAc,WAAA,KAAW,GACnB;EAAA,CAAA,GAGH,EAAc;CACvB;CAWA,OARA,EAAc,UAAU,iBAAA;EACtB,IAAA;GAAA,MACQ,EAAA;EACR,QAAS,CAET;CACF,GAEO;AACT;AAAA,SAAA"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
require(`./chunk-CncqDLb2.cjs`);const e=require(`./
|
|
1
|
+
require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-DhSiMp6Y.cjs`);require(`./mixins-YQI9JogS.cjs`);const t=require(`./overlay-stack-Bdr9lOqi.cjs`);let n=require(`rxjs`),r=require(`rxjs/operators`),i=require(`lit/directives/style-map.js`),a=require(`lit/decorators.js`),o=require(`lit`),s=require(`lit/directives/ref.js`),c=require(`lit/directives/when.js`),l=require(`lit/async-directive.js`),u=require(`lit/directive.js`);var d=class extends e.t{constructor(...e){super(...e),this.src=``,this.images=[],this.initialIndex=0,this.open=!1,this.currentIndex=0,this.isLoading=!1,this.zIndex=1e4,this.swipeThreshold=50,this.overlayRef=(0,s.createRef)(),this.contentRef=(0,s.createRef)(),this.imageRef=(0,s.createRef)(),this.handleClose=()=>{this.open=!1},this.handlePrevious=()=>{this.isGalleryMode&&this.images.length>1&&(this.isLoading=!0,this.currentIndex=(this.currentIndex-1+this.images.length)%this.images.length,this.dispatchEvent(new CustomEvent(`change`,{detail:{index:this.currentIndex},bubbles:!0,composed:!0})))},this.handleNext=()=>{this.isGalleryMode&&this.images.length>1&&(this.isLoading=!0,this.currentIndex=(this.currentIndex+1)%this.images.length,this.dispatchEvent(new CustomEvent(`change`,{detail:{index:this.currentIndex},bubbles:!0,composed:!0})))},this.handleImageLoad=()=>{this.isLoading=!1},this.handleOverlayClick=e=>{e.target===e.currentTarget&&this.handleClose()}}static{this.styles=[o.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
5
|
-
`]}get isGalleryMode(){return this.images.length>0}get currentImageSrc(){return this.isGalleryMode?this.images[this.currentIndex]||``:this.src}connectedCallback(){super.connectedCallback(),this.currentIndex=this.initialIndex}updated(e){super.updated(e),e.has(`open`)&&(this.open?(this.zIndex=
|
|
5
|
+
`]}get isGalleryMode(){return this.images.length>0}get currentImageSrc(){return this.isGalleryMode?this.images[this.currentIndex]||``:this.src}connectedCallback(){super.connectedCallback(),this.currentIndex=this.initialIndex}updated(e){super.updated(e),e.has(`open`)&&(this.open?(this.zIndex=t.t.getNextZIndex(),document.body.style.overflow=`hidden`,this.animateIn(),this.setupEventListeners()):(document.body.style.overflow=``,this.animateOut())),e.has(`initialIndex`)&&(this.currentIndex=this.initialIndex),e.has(`currentIndex`)&&this.open&&this.animateImageChange()}animateIn(){let e=this.overlayRef.value,t=this.contentRef.value,n=this.imageRef.value;e&&(e.style.backgroundColor=`rgba(0, 0, 0, 0)`,e.style.opacity=`0`,e.animate([{opacity:0},{opacity:1}],{duration:300,easing:`cubic-bezier(0.25, 1, 0.5, 1)`,fill:`forwards`}),requestAnimationFrame(()=>{e.style.backgroundColor=`rgba(0, 0, 0, 0.95)`})),t&&t.animate([{transform:`scale(0.95)`,opacity:0},{transform:`scale(1)`,opacity:1}],{duration:400,delay:100,easing:`cubic-bezier(0.34, 1.56, 0.64, 1)`,fill:`forwards`}),n&&n.animate([{opacity:0,transform:`scale(0.98)`},{opacity:1,transform:`scale(1)`}],{duration:350,delay:150,easing:`cubic-bezier(0.25, 1, 0.5, 1)`,fill:`forwards`})}animateOut(){let e=this.overlayRef.value,n=this.contentRef.value,r=this.imageRef.value;r&&r.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(0.95)`,opacity:0}],{duration:200,easing:`ease-out`,fill:`forwards`}),n&&n.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(0.95)`,opacity:0}],{duration:250,easing:`ease-out`,fill:`forwards`}),e&&(e.animate([{opacity:1},{opacity:0}],{duration:250,delay:50,easing:`ease-out`,fill:`forwards`}).onfinish=()=>{e.style.backgroundColor=`rgba(0, 0, 0, 0)`,t.t.release(),this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))})}animateImageChange(){let e=this.imageRef.value;e&&(e.animate([{opacity:1,transform:`scale(1)`},{opacity:0,transform:`scale(0.98)`}],{duration:150,easing:`ease-out`,fill:`forwards`}).onfinish=()=>{e.animate([{opacity:0,transform:`scale(0.98)`},{opacity:1,transform:`scale(1)`}],{duration:200,easing:`cubic-bezier(0.25, 1, 0.5, 1)`,fill:`forwards`})})}setupEventListeners(){if((0,n.fromEvent)(document,`keydown`).pipe((0,r.filter)(()=>this.open),(0,r.tap)(e=>{switch(e.key){case`Escape`:this.handleClose();break;case`ArrowLeft`:this.handlePrevious();break;case`ArrowRight`:this.handleNext()}}),(0,r.takeUntil)(this.disconnecting)).subscribe(),!this.isGalleryMode||this.images.length<=1)return;let e=this.contentRef.value;if(!e)return;let t=(0,n.fromEvent)(e,`touchstart`),i=(0,n.fromEvent)(e,`touchend`);t.pipe((0,r.switchMap)(e=>{let t=e.touches[0].clientX;return i.pipe((0,r.first)(),(0,r.map)(e=>e.changedTouches[0].clientX-t))}),(0,r.filter)(e=>Math.abs(e)>this.swipeThreshold),(0,r.tap)(e=>e>0?this.handlePrevious():this.handleNext()),(0,r.takeUntil)(this.disconnecting)).subscribe()}render(){return this.open?o.html`
|
|
6
6
|
<div
|
|
7
|
-
${(0,
|
|
7
|
+
${(0,s.ref)(this.overlayRef)}
|
|
8
8
|
class="fixed inset-0 flex items-center justify-center backdrop-blur-sm"
|
|
9
9
|
style="z-index: ${this.zIndex}"
|
|
10
10
|
@click=${this.handleOverlayClick}
|
|
11
11
|
>
|
|
12
12
|
<div
|
|
13
|
-
${(0,
|
|
13
|
+
${(0,s.ref)(this.contentRef)}
|
|
14
14
|
class="relative max-w-[90vw] max-h-[90vh]"
|
|
15
15
|
@click=${e=>e.stopPropagation()}
|
|
16
16
|
>
|
|
@@ -25,7 +25,7 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
25
25
|
</button>
|
|
26
26
|
|
|
27
27
|
<!-- Touch Zones for Gallery Navigation -->
|
|
28
|
-
${(0,
|
|
28
|
+
${(0,c.when)(this.isGalleryMode&&this.images.length>1,()=>o.html`
|
|
29
29
|
<div
|
|
30
30
|
class="absolute top-0 bottom-0 left-0 w-1/3 cursor-pointer z-5"
|
|
31
31
|
@click=${this.handlePrevious}
|
|
@@ -37,7 +37,7 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
37
37
|
`)}
|
|
38
38
|
|
|
39
39
|
<!-- Loading Spinner -->
|
|
40
|
-
${(0,
|
|
40
|
+
${(0,c.when)(this.isLoading,()=>o.html`
|
|
41
41
|
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
|
|
42
42
|
<schmancy-progress indeterminate></schmancy-progress>
|
|
43
43
|
</div>
|
|
@@ -45,7 +45,7 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
45
45
|
|
|
46
46
|
<!-- Main Image -->
|
|
47
47
|
<img
|
|
48
|
-
${(0,
|
|
48
|
+
${(0,s.ref)(this.imageRef)}
|
|
49
49
|
class="max-w-[90vw] max-h-[90vh] object-contain rounded select-none touch-pinch-zoom ${this.isGalleryMode?`cursor-default`:`cursor-pointer`}"
|
|
50
50
|
.src=${this.currentImageSrc}
|
|
51
51
|
alt="Full size image"
|
|
@@ -54,7 +54,7 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
54
54
|
/>
|
|
55
55
|
|
|
56
56
|
<!-- Navigation Controls (Gallery Mode Only) -->
|
|
57
|
-
${(0,
|
|
57
|
+
${(0,c.when)(this.isGalleryMode&&this.images.length>1,()=>o.html`
|
|
58
58
|
<div
|
|
59
59
|
class="absolute bottom-[-3.5rem] md:bottom-[-3.5rem] sm:bottom-[-3rem] left-1/2 -translate-x-1/2 flex items-center gap-4 z-10"
|
|
60
60
|
>
|
|
@@ -83,11 +83,11 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
83
83
|
`)}
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
|
-
`:
|
|
86
|
+
`:o.html``}};function f(e,t,n=`up`,r=.3){let i=(e.x+t.x)/2,a=(e.y+t.y)/2,o=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),s=Math.min(o*r,150);return{x:i,y:n===`up`?a-s:a+s}}e.p([(0,a.property)({type:String})],d.prototype,`src`,void 0),e.p([(0,a.property)({type:Array})],d.prototype,`images`,void 0),e.p([(0,a.property)({type:Number})],d.prototype,`initialIndex`,void 0),e.p([(0,a.property)({type:Boolean})],d.prototype,`open`,void 0),e.p([(0,a.state)()],d.prototype,`currentIndex`,void 0),e.p([(0,a.state)()],d.prototype,`isLoading`,void 0),e.p([(0,a.state)()],d.prototype,`zIndex`,void 0),d=e.p([(0,a.customElement)(`schmancy-lightbox`)],d);var p=class extends l.AsyncDirective{constructor(e){if(super(e),this.hasAnimated=!1,e.type!==u.PartType.ELEMENT)throw Error(`flip directive can only be used on elements`)}render(e){return o.noChange}update(e,[t]){this.element=e.element;let n=t?.sourceElement||t?.position;return!this.hasAnimated&&n&&(this.hasAnimated=!0,this.animateIn(t)),o.noChange}animateIn(e){if(!this.element||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e?.duration??600,n=!1!==e?.scale,r=!1!==e?.blackbird,i=(a=e?.position,a?`clientX`in a?{x:a.clientX,y:a.clientY}:`touches`in a&&a.touches.length?{x:a.touches[0].clientX,y:a.touches[0].clientY}:`x`in a&&`y`in a?{x:a.x,y:a.y}:null:null);var a;let o=e?.sourceElement?.getBoundingClientRect(),s=()=>{let a=this.element.getBoundingClientRect(),s={x:a.left+a.width/2,y:a.top+a.height/2},c,l={x:.1,y:.1};o?(c={x:o.left+o.width/2,y:o.top+o.height/2},n&&(l={x:o.width/a.width,y:o.height/a.height})):c=i||{x:window.innerWidth/2,y:window.innerHeight/2};let u=c.x-s.x,d=c.y-s.y;if(r&&i&&o){let e={x:i.x-s.x,y:i.y-s.y},n=f(c,i,`up`,.4),r=f(i,s,`down`,.3),a={x:n.x-s.x,y:n.y-s.y},o={x:r.x-s.x,y:r.y-s.y},p=.3;this.element.animate([{transform:`translate(${u}px, ${d}px) scale(${l.x}, ${l.y})`,opacity:.6,offset:0},{transform:`translate(${a.x}px, ${a.y}px) scale(${.7*p})`,opacity:.8,offset:.25},{transform:`translate(${e.x}px, ${e.y}px) scale(${p})`,opacity:.9,offset:.5},{transform:`translate(${o.x}px, ${o.y}px) scale(0.6)`,opacity:.95,offset:.75},{transform:`translate(0, 0) scale(1)`,opacity:1,offset:1}],{duration:t,easing:`cubic-bezier(0.34, 1.2, 0.64, 1)`,fill:`forwards`})}else if(r&&i){let e=f(i,s,`down`,.35),n={x:e.x-s.x,y:e.y-s.y};this.element.animate([{transform:`translate(${u}px, ${d}px) scale(0.1)`,opacity:0,offset:0},{transform:`translate(${n.x}px, ${n.y}px) scale(0.5)`,opacity:.8,offset:.5},{transform:`translate(0, 0) scale(1)`,opacity:1,offset:1}],{duration:t,easing:`cubic-bezier(0.34, 1.2, 0.64, 1)`,fill:`forwards`})}else this.element.animate([{transform:`translate(${u}px, ${d}px) scale(${l.x}, ${l.y})`,opacity:0},{transform:`translate(0, 0) scale(1, 1)`,opacity:1}],{duration:t,easing:e?.easing??`cubic-bezier(0.34, 1.56, 0.64, 1)`,fill:`forwards`})};this.element instanceof HTMLImageElement?this.element.complete?requestAnimationFrame(s):this.element.addEventListener(`load`,()=>requestAnimationFrame(s),{once:!0}):requestAnimationFrame(s)}},m=(0,u.directive)(p),h=class extends l.AsyncDirective{constructor(e){if(super(e),this.currentIndex=0,this.images=[],e.type!==u.PartType.ELEMENT)throw Error(`lightbox directive can only be used on elements`)}render(e){return o.noChange}update(e,[t]){return this.element=e.element,this.clickHandler||(this.clickHandler=e=>{if(e.preventDefault(),e.stopPropagation(),`clientX`in e)this.clickPosition={x:e.clientX,y:e.clientY};else if(`touches`in e&&e.touches.length){let t=e.touches[0];this.clickPosition={x:t.clientX,y:t.clientY}}t?.images&&t.images.length>0?(this.images=t.images,this.currentIndex=t.index||0):(this.images=[this.element.src],this.currentIndex=0),this.overlay=t?.overlay,this.open()},this.element.addEventListener(`click`,this.clickHandler),this.element.style.cursor=`pointer`,this.element.classList.add(`hover:opacity-80`,`transition-opacity`)),o.noChange}open(){this.overlayElement=document.createElement(`div`),this.overlayElement.className=`fixed inset-0 flex items-center justify-center opacity-0 bg-black/95 backdrop-blur-sm`,this.overlayElement.style.zIndex=`1000`,(0,o.render)(this.renderLightbox(),this.overlayElement),document.body.appendChild(this.overlayElement),document.body.style.overflow=`hidden`,requestAnimationFrame(()=>{this.overlayElement.animate([{opacity:0},{opacity:1}],{duration:300,easing:`cubic-bezier(0.25, 1, 0.5, 1)`,fill:`forwards`})}),this.keyHandler=e=>{e.key===`Escape`&&this.close(),e.key===`ArrowLeft`&&this.images.length>1&&this.prev(),e.key===`ArrowRight`&&this.images.length>1&&this.next()},document.addEventListener(`keydown`,this.keyHandler),this.overlayElement.addEventListener(`click`,e=>{e.target===this.overlayElement&&this.close()})}close(){if(!this.overlayElement)return;let e=this.overlayElement.querySelector(`[data-lightbox-content]`);if(e&&this.clickPosition){let t=e.getBoundingClientRect(),n=this.clickPosition.x-(t.left+t.width/2),r=this.clickPosition.y-(t.top+t.height/2),i=e.animate([{transform:`translate(0, 0) scale(1)`,opacity:1},{transform:`translate(${n}px, ${r}px) scale(0.1)`,opacity:0}],{duration:300,easing:`cubic-bezier(0.4, 0, 0.2, 1)`,fill:`forwards`});this.overlayElement.animate([{opacity:1},{opacity:0}],{duration:250,easing:`ease-out`,fill:`forwards`}),i.onfinish=()=>{this.overlayElement?.remove(),this.overlayElement=void 0,document.body.style.overflow=``}}else this.overlayElement.animate([{opacity:1},{opacity:0}],{duration:250,easing:`ease-out`,fill:`forwards`}).onfinish=()=>{this.overlayElement?.remove(),this.overlayElement=void 0,document.body.style.overflow=``};this.keyHandler&&=(document.removeEventListener(`keydown`,this.keyHandler),void 0)}prev(){this.currentIndex=(this.currentIndex-1+this.images.length)%this.images.length,this.updateImage()}next(){this.currentIndex=(this.currentIndex+1)%this.images.length,this.updateImage()}updateImage(){this.overlayElement&&(0,o.render)(this.renderLightbox(),this.overlayElement)}renderLightbox(){let e=this.images[this.currentIndex],t=this.images.length>1;return o.html`
|
|
87
87
|
<div
|
|
88
88
|
data-lightbox-content
|
|
89
89
|
class="relative"
|
|
90
|
-
style=${(0,
|
|
90
|
+
style=${(0,i.styleMap)({transformOrigin:`center center`})}
|
|
91
91
|
@click=${e=>e.stopPropagation()}
|
|
92
92
|
>
|
|
93
93
|
<!-- Close button -->
|
|
@@ -103,7 +103,7 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
103
103
|
<div class="relative">
|
|
104
104
|
<img
|
|
105
105
|
src=${e}
|
|
106
|
-
${
|
|
106
|
+
${m({sourceElement:this.element,position:this.clickPosition,duration:600,scale:!0,blackbird:!0})}
|
|
107
107
|
class="object-contain rounded-lg"
|
|
108
108
|
style="max-height: calc(100vh - 40px); max-width: 90vw;"
|
|
109
109
|
@click=${()=>!t&&this.close()}
|
|
@@ -112,7 +112,7 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
112
112
|
</div>
|
|
113
113
|
|
|
114
114
|
<!-- Gallery controls -->
|
|
115
|
-
${t?
|
|
115
|
+
${t?o.html`
|
|
116
116
|
<div class="flex items-center justify-center gap-4 text-white mt-4">
|
|
117
117
|
<button
|
|
118
118
|
class="w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors"
|
|
@@ -134,7 +134,7 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
134
134
|
</div>
|
|
135
135
|
`:``}
|
|
136
136
|
</div>
|
|
137
|
-
`}disconnected(){this.element&&this.clickHandler&&this.element.removeEventListener(`click`,this.clickHandler),this.close()}},
|
|
137
|
+
`}disconnected(){this.element&&this.clickHandler&&this.element.removeEventListener(`click`,this.clickHandler),this.close()}},g=(0,u.directive)(h),_=class r{constructor(){this.pushSubject=new n.Subject,this.dismissSubject=new n.Subject,this.setupLightboxOpeningLogic(),this.setupLightboxDismissLogic()}static getInstance(){return r.instance||=new r,r.instance}setupLightboxOpeningLogic(){this.pushSubject.pipe((0,n.switchMap)(r=>e.b(`schmancy-theme`).pipe((0,n.map)(e=>{let n=e||document.body,i=document.createElement(`div`);return i.className=`fixed inset-0 flex items-center justify-center opacity-0 bg-black/95 backdrop-blur-sm`,i.style.zIndex=String(t.t.getNextZIndex()),n.appendChild(i),document.body.style.overflow=`hidden`,{overlay:i,config:r,container:n}}))),(0,n.tap)(({overlay:e,config:t})=>{let r=[],i=0;t.images&&t.images.length>0?(r=t.images,i=t.index||0):t.image&&(r=[t.image],i=0),this.activeLightbox={element:e,config:t,currentIndex:i,images:r},(0,n.fromEvent)(document,`keydown`).pipe((0,n.takeUntil)(this.dismissSubject),(0,n.filter)(()=>!!this.activeLightbox),(0,n.tap)(e=>{e.key===`Escape`&&this.dismiss(),e.key===`ArrowLeft`&&this.activeLightbox.images.length>1&&this.navigatePrev(),e.key===`ArrowRight`&&this.activeLightbox.images.length>1&&this.navigateNext()})).subscribe(),(0,n.fromEvent)(e,`click`).pipe((0,n.takeUntil)(this.dismissSubject),(0,n.filter)(t=>t.target===e),(0,n.tap)(()=>this.dismiss())).subscribe(),t.component?this.renderComponent(e,t):this.renderLightbox(e,t,r,i),requestAnimationFrame(()=>{e.animate([{opacity:0},{opacity:1}],{duration:300,easing:`cubic-bezier(0.25, 1, 0.5, 1)`,fill:`forwards`})})})).subscribe()}setupLightboxDismissLogic(){this.dismissSubject.pipe((0,n.tap)(()=>{if(!this.activeLightbox)return;let{element:e}=this.activeLightbox;e.animate([{opacity:1},{opacity:0}],{duration:250,easing:`ease-out`,fill:`forwards`}).onfinish=()=>{e.remove(),document.body.style.overflow=``,t.t.release()},this.activeLightbox=void 0})).subscribe()}push(e){this.activeLightbox&&this.dismiss(),this.pushSubject.next(e)}dismiss(){this.dismissSubject.next()}navigatePrev(){if(!this.activeLightbox||this.activeLightbox.images.length<=1)return;let{images:e,config:t,element:n}=this.activeLightbox;this.activeLightbox.currentIndex=(this.activeLightbox.currentIndex-1+e.length)%e.length,this.renderLightbox(n,t,e,this.activeLightbox.currentIndex)}navigateNext(){if(!this.activeLightbox||this.activeLightbox.images.length<=1)return;let{images:e,config:t,element:n}=this.activeLightbox;this.activeLightbox.currentIndex=(this.activeLightbox.currentIndex+1)%e.length,this.renderLightbox(n,t,e,this.activeLightbox.currentIndex)}renderComponent(e,t){if(!t.component)return;let n;n=typeof t.component==`string`?document.createElement(t.component):new t.component,t.props&&Object.entries(t.props).forEach(([e,t])=>{n[e]=t}),(0,o.render)(o.html`
|
|
138
138
|
<div class="relative" @click=${e=>e.stopPropagation()}>
|
|
139
139
|
<!-- Close button -->
|
|
140
140
|
<button
|
|
@@ -148,10 +148,10 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
148
148
|
<!-- Component container -->
|
|
149
149
|
<div id="lightbox-component-container"></div>
|
|
150
150
|
</div>
|
|
151
|
-
`,e);let r=e.querySelector(`#lightbox-component-container`);r&&r.appendChild(n)}renderLightbox(e,t,n,r){let
|
|
151
|
+
`,e);let r=e.querySelector(`#lightbox-component-container`);r&&r.appendChild(n)}renderLightbox(e,t,n,r){let a=n[r],s=n.length>1,c=null;if(t.overlay&&(typeof t.overlay==`string`?c=document.createElement(t.overlay):typeof t.overlay==`function`&&(c=new t.overlay),t.props&&c&&Object.entries(t.props).forEach(([e,t])=>{c[e]=t})),(0,o.render)(o.html`
|
|
152
152
|
<div
|
|
153
153
|
class="relative"
|
|
154
|
-
style=${(0,
|
|
154
|
+
style=${(0,i.styleMap)({maxWidth:`90vw`,maxHeight:`90vh`})}
|
|
155
155
|
@click=${e=>e.stopPropagation()}
|
|
156
156
|
>
|
|
157
157
|
<!-- Close button -->
|
|
@@ -166,18 +166,18 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
166
166
|
<!-- Image container with optional overlay -->
|
|
167
167
|
<div class="relative" id="lightbox-image-container">
|
|
168
168
|
<img
|
|
169
|
-
src=${
|
|
169
|
+
src=${a}
|
|
170
170
|
class="max-w-full object-contain rounded-lg"
|
|
171
|
-
style=${(0,
|
|
172
|
-
@click=${()=>!
|
|
171
|
+
style=${(0,i.styleMap)({maxHeight:`85vh`})}
|
|
172
|
+
@click=${()=>!s&&this.dismiss()}
|
|
173
173
|
/>
|
|
174
174
|
</div>
|
|
175
175
|
|
|
176
176
|
<!-- Gallery controls -->
|
|
177
|
-
${o
|
|
177
|
+
${s?o.html`
|
|
178
178
|
<div
|
|
179
179
|
class="absolute left-1/2 -translate-x-1/2 flex items-center gap-4 text-white"
|
|
180
|
-
style=${(0,
|
|
180
|
+
style=${(0,i.styleMap)({bottom:`-60px`})}
|
|
181
181
|
>
|
|
182
182
|
<button
|
|
183
183
|
class="w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors"
|
|
@@ -199,4 +199,4 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-CxGRIPYQ.cjs`),t=requi
|
|
|
199
199
|
</div>
|
|
200
200
|
`:``}
|
|
201
201
|
</div>
|
|
202
|
-
`,e),c){let t=e.querySelector(`#lightbox-image-container`);if(t){let e=t.querySelector(`[data-lightbox-overlay]`);e&&e.remove(),c.setAttribute(`data-lightbox-overlay`,``),t.appendChild(c)}}}},
|
|
202
|
+
`,e),c){let t=e.querySelector(`#lightbox-image-container`);if(t){let e=t.querySelector(`[data-lightbox-overlay]`);e&&e.remove(),c.setAttribute(`data-lightbox-overlay`,``),t.appendChild(c)}}}},v=Object.assign(e=>g(e),{push:e=>_.getInstance().push(e),dismiss:()=>_.getInstance().dismiss()});Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
|