@mhmo91/schmancy 0.2.192 → 0.2.194
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/area.md +125 -0
- package/ai/autocomplete.md +135 -0
- package/ai/avatar.md +178 -0
- package/ai/badge.md +100 -0
- package/ai/busy.md +195 -0
- package/ai/button.md +112 -0
- package/ai/card.md +155 -0
- package/ai/checkbox.md +108 -0
- package/ai/chips.md +180 -0
- package/ai/component-relationships.md +93 -0
- package/ai/dialog.md +109 -0
- package/ai/dropdown.md +238 -0
- package/ai/form.md +148 -0
- package/ai/icons.md +147 -0
- package/ai/index.md +71 -0
- package/ai/input.md +167 -0
- package/ai/layout.md +166 -0
- package/ai/list.md +145 -0
- package/ai/menu.md +217 -0
- package/ai/notification.md +93 -0
- package/ai/radio-group.md +176 -0
- package/ai/select.md +174 -0
- package/ai/sheet.md +122 -0
- package/ai/store.md +235 -0
- package/ai/surface.md +221 -0
- package/ai/table.md +236 -0
- package/ai/tabs.md +71 -0
- package/ai/template.md +144 -0
- package/ai/textarea.md +147 -0
- package/ai/tooltip.md +149 -0
- package/ai/tree.md +279 -0
- package/ai/typography.md +170 -0
- package/dist/ai/area.md +125 -0
- package/dist/ai/autocomplete.md +135 -0
- package/dist/ai/avatar.md +178 -0
- package/dist/ai/badge.md +100 -0
- package/dist/ai/busy.md +195 -0
- package/dist/ai/button.md +112 -0
- package/dist/ai/card.md +155 -0
- package/dist/ai/checkbox.md +108 -0
- package/dist/ai/chips.md +180 -0
- package/dist/ai/component-relationships.md +93 -0
- package/dist/ai/dialog.md +109 -0
- package/dist/ai/dropdown.md +238 -0
- package/dist/ai/form.md +148 -0
- package/dist/ai/icons.md +147 -0
- package/dist/ai/index.md +71 -0
- package/dist/ai/input.md +167 -0
- package/dist/ai/layout.md +166 -0
- package/dist/ai/list.md +145 -0
- package/dist/ai/menu.md +217 -0
- package/dist/ai/notification.md +93 -0
- package/dist/ai/radio-group.md +176 -0
- package/dist/ai/select.md +174 -0
- package/dist/ai/sheet.md +122 -0
- package/dist/ai/store.md +235 -0
- package/dist/ai/surface.md +221 -0
- package/dist/ai/table.md +236 -0
- package/dist/ai/tabs.md +71 -0
- package/dist/ai/template.md +144 -0
- package/dist/ai/textarea.md +147 -0
- package/dist/ai/tooltip.md +149 -0
- package/dist/ai/tree.md +279 -0
- package/dist/ai/typography.md +170 -0
- package/dist/{animated-text-DU8PPnsu.cjs → animated-text-9AM64DHd.cjs} +2 -2
- package/dist/{animated-text-DU8PPnsu.cjs.map → animated-text-9AM64DHd.cjs.map} +1 -1
- package/dist/{animated-text-CRlnEvtJ.js → animated-text-CVStWn5N.js} +3 -3
- package/dist/{animated-text-CRlnEvtJ.js.map → animated-text-CVStWn5N.js.map} +1 -1
- package/dist/animated-text.cjs +1 -1
- package/dist/animated-text.js +1 -1
- package/dist/area.cjs +1 -1
- package/dist/area.component-CzFJM7Y4.js +143 -0
- package/dist/area.component-CzFJM7Y4.js.map +1 -0
- package/dist/area.component-WxccFh1z.cjs +8 -0
- package/dist/area.component-WxccFh1z.cjs.map +1 -0
- package/dist/area.js +1 -1
- package/dist/autocomplete-DBXvIJgc.cjs +56 -0
- package/dist/autocomplete-DBXvIJgc.cjs.map +1 -0
- package/dist/{autocomplete-BYVrh34v.js → autocomplete-ih92pPkb.js} +23 -17
- package/dist/autocomplete-ih92pPkb.js.map +1 -0
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/{avatar-Da4jaDOV.cjs → avatar-Bmg5TXj9.cjs} +2 -2
- package/dist/{avatar-Da4jaDOV.cjs.map → avatar-Bmg5TXj9.cjs.map} +1 -1
- package/dist/{avatar-CZJwWLSE.js → avatar-CgP1tBZq.js} +40 -40
- package/dist/{avatar-CZJwWLSE.js.map → avatar-CgP1tBZq.js.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-JoeyCVVx.cjs → checkbox-DtnX5sT6.cjs} +2 -2
- package/dist/{checkbox-JoeyCVVx.cjs.map → checkbox-DtnX5sT6.cjs.map} +1 -1
- package/dist/{checkbox-2zE3U2CA.js → checkbox-Jxxbjxp0.js} +2 -2
- package/dist/{checkbox-2zE3U2CA.js.map → checkbox-Jxxbjxp0.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-BkXSfa41.cjs → chips-CVDnpVUM.cjs} +2 -2
- package/dist/{chips-BkXSfa41.cjs.map → chips-CVDnpVUM.cjs.map} +1 -1
- package/dist/{chips-DBx_2dFJ.js → chips-lP7ohQep.js} +3 -3
- package/dist/{chips-DBx_2dFJ.js.map → chips-lP7ohQep.js.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{date-range-sbuFYvFc.js → date-range-Ca9WLI4Q.js} +3 -3
- package/dist/{date-range-sbuFYvFc.js.map → date-range-Ca9WLI4Q.js.map} +1 -1
- package/dist/{date-range-TqPcxDV6.cjs → date-range-DbPA5Y-t.cjs} +2 -2
- package/dist/{date-range-TqPcxDV6.cjs.map → date-range-DbPA5Y-t.cjs.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-B1vg8_Gp.js → delay-5cCl7ji3.js} +2 -2
- package/dist/{delay-B1vg8_Gp.js.map → delay-5cCl7ji3.js.map} +1 -1
- package/dist/{delay-rMaXv8P_.cjs → delay-BgNgQV2G.cjs} +2 -2
- package/dist/{delay-rMaXv8P_.cjs.map → delay-BgNgQV2G.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{dialog-content-H5JNHI4z.js → dialog-content-9pumpyLD.js} +3 -3
- package/dist/{dialog-content-H5JNHI4z.js.map → dialog-content-9pumpyLD.js.map} +1 -1
- package/dist/{dialog-content-BOJ4BpEr.cjs → dialog-content-qj1E8aye.cjs} +2 -2
- package/dist/{dialog-content-BOJ4BpEr.cjs.map → dialog-content-qj1E8aye.cjs.map} +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-D9xov_XO.cjs → divider-CHckHGEQ.cjs} +2 -2
- package/dist/{divider-D9xov_XO.cjs.map → divider-CHckHGEQ.cjs.map} +1 -1
- package/dist/{divider-BxeCR4pP.js → divider-r8-9eNnl.js} +3 -3
- package/dist/{divider-BxeCR4pP.js.map → divider-r8-9eNnl.js.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{dropdown-content-ltAuKAq_.cjs → dropdown-content-B41MDDRG.cjs} +2 -2
- package/dist/{dropdown-content-ltAuKAq_.cjs.map → dropdown-content-B41MDDRG.cjs.map} +1 -1
- package/dist/{dropdown-content-QrlJDJj9.js → dropdown-content-D-TddflQ.js} +3 -3
- package/dist/{dropdown-content-QrlJDJj9.js.map → dropdown-content-D-TddflQ.js.map} +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-DT3XHFSb.js → flex-Bf0zNqji.js} +2 -2
- package/dist/{flex-DT3XHFSb.js.map → flex-Bf0zNqji.js.map} +1 -1
- package/dist/{flex-CRTV1yz3.cjs → flex-CFv-Zb76.cjs} +2 -2
- package/dist/{flex-CRTV1yz3.cjs.map → flex-CFv-Zb76.cjs.map} +1 -1
- package/dist/{form-D6n2UP9B.cjs → form-BN75s0PI.cjs} +2 -2
- package/dist/{form-D6n2UP9B.cjs.map → form-BN75s0PI.cjs.map} +1 -1
- package/dist/{form-DfCknx7Y.js → form-uYcr1RLJ.js} +2 -2
- package/dist/{form-DfCknx7Y.js.map → form-uYcr1RLJ.js.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-BmJGenTZ.js → icon-BR-jE0Y2.js} +3 -3
- package/dist/{icon-BmJGenTZ.js.map → icon-BR-jE0Y2.js.map} +1 -1
- package/dist/{icon-Xqq_eMXt.cjs → icon-Cu-imayV.cjs} +2 -2
- package/dist/{icon-Xqq_eMXt.cjs.map → icon-Cu-imayV.cjs.map} +1 -1
- package/dist/{icon-button-DpxC8WQP.js → icon-button-1tZaicyb.js} +3 -3
- package/dist/{icon-button-DpxC8WQP.js.map → icon-button-1tZaicyb.js.map} +1 -1
- package/dist/{icon-button-UiEHOmmk.cjs → icon-button-D0BbHnDL.cjs} +2 -2
- package/dist/{icon-button-UiEHOmmk.cjs.map → icon-button-D0BbHnDL.cjs.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +38 -38
- package/dist/{input-o74ZxIRk.cjs → input-B2oV6Hck.cjs} +2 -2
- package/dist/{input-o74ZxIRk.cjs.map → input-B2oV6Hck.cjs.map} +1 -1
- package/dist/{input-DnEvTRuh.js → input-kiz5O3dY.js} +2 -2
- package/dist/{input-DnEvTRuh.js.map → input-kiz5O3dY.js.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/{list-ChRCTc9A.cjs → list-CMHoPfX9.cjs} +2 -2
- package/dist/{list-ChRCTc9A.cjs.map → list-CMHoPfX9.cjs.map} +1 -1
- package/dist/{list-CPRV9D4J.js → list-wT4DLXCh.js} +2 -2
- package/dist/{list-CPRV9D4J.js.map → list-wT4DLXCh.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-CifwP6Gy.js → litElement.mixin-B9Qdq5S_.js} +2 -2
- package/dist/{litElement.mixin-CifwP6Gy.js.map → litElement.mixin-B9Qdq5S_.js.map} +1 -1
- package/dist/{litElement.mixin-BrC_tdrr.cjs → litElement.mixin-CHvyxfxf.cjs} +2 -2
- package/dist/{litElement.mixin-BrC_tdrr.cjs.map → litElement.mixin-CHvyxfxf.cjs.map} +1 -1
- package/dist/{menu-D08kPl8X.cjs → menu-BcSplMNh.cjs} +2 -2
- package/dist/{menu-D08kPl8X.cjs.map → menu-BcSplMNh.cjs.map} +1 -1
- package/dist/{menu-DZtTU6cT.js → menu-Dl1QU86K.js} +3 -3
- package/dist/{menu-DZtTU6cT.js.map → menu-Dl1QU86K.js.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/{notification-service-zNn5My79.cjs → notification-service-BV9ybQBu.cjs} +2 -2
- package/dist/{notification-service-zNn5My79.cjs.map → notification-service-BV9ybQBu.cjs.map} +1 -1
- package/dist/{notification-service-jcW6LcD9.js → notification-service-CC698xHg.js} +3 -3
- package/dist/{notification-service-jcW6LcD9.js.map → notification-service-CC698xHg.js.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-BeSO48Ou.cjs → option-CkLBgH71.cjs} +2 -2
- package/dist/{option-BeSO48Ou.cjs.map → option-CkLBgH71.cjs.map} +1 -1
- package/dist/{option-XmhVdbQ0.js → option-DDxxXwwc.js} +2 -2
- package/dist/{option-XmhVdbQ0.js.map → option-DDxxXwwc.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-xPdGrSUi.js → payment-card-form-DDTO5_AA.js} +3 -3
- package/dist/{payment-card-form-xPdGrSUi.js.map → payment-card-form-DDTO5_AA.js.map} +1 -1
- package/dist/{payment-card-form-Cs_Kjcge.cjs → payment-card-form-UWbAYNPR.cjs} +2 -2
- package/dist/{payment-card-form-Cs_Kjcge.cjs.map → payment-card-form-UWbAYNPR.cjs.map} +1 -1
- package/dist/{radio-button-BFwFYicE.cjs → radio-button-BykiVxTD.cjs} +2 -2
- package/dist/{radio-button-BFwFYicE.cjs.map → radio-button-BykiVxTD.cjs.map} +1 -1
- package/dist/{radio-button-fAQpF9XC.js → radio-button-wWoxPDfq.js} +2 -2
- package/dist/{radio-button-fAQpF9XC.js.map → radio-button-wWoxPDfq.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{schmancy-steps-container-CNCQfw48.cjs → schmancy-steps-container-B1mIGa9M.cjs} +2 -2
- package/dist/{schmancy-steps-container-CNCQfw48.cjs.map → schmancy-steps-container-B1mIGa9M.cjs.map} +1 -1
- package/dist/{schmancy-steps-container-Cd6wx804.js → schmancy-steps-container-ByO98z7L.js} +2 -2
- package/dist/{schmancy-steps-container-Cd6wx804.js.map → schmancy-steps-container-ByO98z7L.js.map} +1 -1
- package/dist/{select-ujdAxZ6K.js → select-BIOhocL7.js} +3 -3
- package/dist/{select-ujdAxZ6K.js.map → select-BIOhocL7.js.map} +1 -1
- package/dist/{select-CzHttZpN.cjs → select-DE57Nios.cjs} +2 -2
- package/dist/{select-CzHttZpN.cjs.map → select-DE57Nios.cjs.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{sheet-CX5mgzlz.js → sheet-Dh4MLVsU.js} +3 -3
- package/dist/{sheet-CX5mgzlz.js.map → sheet-Dh4MLVsU.js.map} +1 -1
- package/dist/{sheet-ABpUdDjY.cjs → sheet-fZYAWGsm.cjs} +2 -2
- package/dist/{sheet-ABpUdDjY.cjs.map → sheet-fZYAWGsm.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-Drp85D_v.cjs → slider-CejrdmPF.cjs} +2 -2
- package/dist/{slider-Drp85D_v.cjs.map → slider-CejrdmPF.cjs.map} +1 -1
- package/dist/{slider-C4cTmjLY.js → slider-DVlJoDgU.js} +3 -3
- package/dist/{slider-C4cTmjLY.js.map → slider-DVlJoDgU.js.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-fGK3FMoM.js → spinner-DbTnai_Q.js} +3 -3
- package/dist/{spinner-fGK3FMoM.js.map → spinner-DbTnai_Q.js.map} +1 -1
- package/dist/{spinner-Bmopv8Vn.cjs → spinner-DxVJ7QJZ.cjs} +2 -2
- package/dist/{spinner-Bmopv8Vn.cjs.map → spinner-DxVJ7QJZ.cjs.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/{surface-BTpQe1mC.cjs → surface-BTuzKmT2.cjs} +2 -2
- package/dist/{surface-BTpQe1mC.cjs.map → surface-BTuzKmT2.cjs.map} +1 -1
- package/dist/{surface-BgYWVNyL.js → surface-DXx1bJN4.js} +2 -2
- package/dist/{surface-BgYWVNyL.js.map → surface-DXx1bJN4.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-BVojeUhT.cjs → table-CBhyHINV.cjs} +2 -2
- package/dist/{table-BVojeUhT.cjs.map → table-CBhyHINV.cjs.map} +1 -1
- package/dist/{table-COmozyPk.js → table-CqUv1TOC.js} +2 -2
- package/dist/{table-COmozyPk.js.map → table-CqUv1TOC.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-compatibility-DU2bf7Xr.cjs → tabs-compatibility-DPD6jfGF.cjs} +2 -2
- package/dist/{tabs-compatibility-DU2bf7Xr.cjs.map → tabs-compatibility-DPD6jfGF.cjs.map} +1 -1
- package/dist/{tabs-compatibility-BdcN_IDz.js → tabs-compatibility-DUo2f_sV.js} +2 -2
- package/dist/{tabs-compatibility-BdcN_IDz.js.map → tabs-compatibility-DUo2f_sV.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{tailwind.mixin-D-kkSKp-.js → tailwind.mixin-Di7KWye7.js} +2 -2
- package/dist/{tailwind.mixin-D-kkSKp-.js.map → tailwind.mixin-Di7KWye7.js.map} +1 -1
- package/dist/{tailwind.mixin-BAGuwQKs.cjs → tailwind.mixin-Dm5QDZav.cjs} +2 -2
- package/dist/{tailwind.mixin-BAGuwQKs.cjs.map → tailwind.mixin-Dm5QDZav.cjs.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-CPyQvAWI.cjs → textarea-CesFdBkm.cjs} +2 -2
- package/dist/{textarea-CPyQvAWI.cjs.map → textarea-CesFdBkm.cjs.map} +1 -1
- package/dist/{textarea-CztnQryA.js → textarea-Dbz18REy.js} +2 -2
- package/dist/{textarea-CztnQryA.js.map → textarea-Dbz18REy.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-DRACAw64.cjs → theme-button-Bt2OV4iu.cjs} +2 -2
- package/dist/{theme-button-DRACAw64.cjs.map → theme-button-Bt2OV4iu.cjs.map} +1 -1
- package/dist/{theme-button-DaEkh8la.js → theme-button-lqbT2_LL.js} +2 -2
- package/dist/{theme-button-DaEkh8la.js.map → theme-button-lqbT2_LL.js.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/{theme.component-Hb2RlmAN.cjs → theme.component-BlBaN7d6.cjs} +2 -2
- package/dist/{theme.component-Hb2RlmAN.cjs.map → theme.component-BlBaN7d6.cjs.map} +1 -1
- package/dist/{theme.component-DkFe9fpE.js → theme.component-xarFSe8p.js} +2 -2
- package/dist/{theme.component-DkFe9fpE.js.map → theme.component-xarFSe8p.js.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-UKEAXQcC.js → timezone-DwT_pQrj.js} +3 -3
- package/dist/{timezone-UKEAXQcC.js.map → timezone-DwT_pQrj.js.map} +1 -1
- package/dist/{timezone-DpzKnPVI.cjs → timezone-VUMRmZaJ.cjs} +2 -2
- package/dist/{timezone-DpzKnPVI.cjs.map → timezone-VUMRmZaJ.cjs.map} +1 -1
- package/dist/{tooltip-CmvJQPh0.js → tooltip-BKOHVCMK.js} +2 -2
- package/dist/{tooltip-CmvJQPh0.js.map → tooltip-BKOHVCMK.js.map} +1 -1
- package/dist/{tooltip-BuZzFSoa.cjs → tooltip-Cvoroe7w.cjs} +2 -2
- package/dist/{tooltip-BuZzFSoa.cjs.map → tooltip-Cvoroe7w.cjs.map} +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-ChJhwwCs.cjs → tree-Cyp2AZ8g.cjs} +2 -2
- package/dist/{tree-ChJhwwCs.cjs.map → tree-Cyp2AZ8g.cjs.map} +1 -1
- package/dist/{tree-BEYMdPfY.js → tree-_FJnHVmP.js} +2 -2
- package/dist/{tree-BEYMdPfY.js.map → tree-_FJnHVmP.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-CQj9HK5k.cjs → typewriter-BIm2tOe4.cjs} +2 -2
- package/dist/{typewriter-CQj9HK5k.cjs.map → typewriter-BIm2tOe4.cjs.map} +1 -1
- package/dist/{typewriter-CFYwWJfp.js → typewriter-DWfXPBni.js} +4 -4
- package/dist/{typewriter-CFYwWJfp.js.map → typewriter-DWfXPBni.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-C8sf8eaH.js → typography-DaKLzjFB.js} +2 -2
- package/dist/{typography-C8sf8eaH.js.map → typography-DaKLzjFB.js.map} +1 -1
- package/dist/{typography-CMvzZ9Ec.cjs → typography-OpLt6LNd.cjs} +2 -2
- package/dist/{typography-CMvzZ9Ec.cjs.map → typography-OpLt6LNd.cjs.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +2 -1
- package/types/src/area/area.service.d.ts +53 -4
- package/types/src/area/router.types.d.ts +41 -2
- package/types/src/autocomplete/autocomplete.d.ts +7 -0
- package/dist/area.component-BoR212xW.cjs +0 -8
- package/dist/area.component-BoR212xW.cjs.map +0 -1
- package/dist/area.component-CRk-Eoq4.js +0 -107
- package/dist/area.component-CRk-Eoq4.js.map +0 -1
- package/dist/autocomplete-BYVrh34v.js.map +0 -1
- package/dist/autocomplete-C7HIgBT5.cjs +0 -56
- package/dist/autocomplete-C7HIgBT5.cjs.map +0 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Schmancy Typography - AI Reference
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
// Basic Typography
|
|
5
|
+
<schmancy-typography
|
|
6
|
+
variant="h1|h2|h3|h4|h5|h6|subtitle1|subtitle2|body1|body2|button|caption|overline"
|
|
7
|
+
color="primary|secondary|tertiary|error|text-primary|text-secondary|text-disabled"
|
|
8
|
+
align="left|center|right|justify"
|
|
9
|
+
weight="thin|light|regular|medium|bold"
|
|
10
|
+
transform="none|uppercase|lowercase|capitalize"
|
|
11
|
+
truncate?
|
|
12
|
+
no-wrap?
|
|
13
|
+
gutter-bottom?>
|
|
14
|
+
Text content goes here
|
|
15
|
+
</schmancy-typography>
|
|
16
|
+
|
|
17
|
+
// Typography heading variants
|
|
18
|
+
<schmancy-typography variant="h1">Heading 1</schmancy-typography>
|
|
19
|
+
<schmancy-typography variant="h2">Heading 2</schmancy-typography>
|
|
20
|
+
<schmancy-typography variant="h3">Heading 3</schmancy-typography>
|
|
21
|
+
<schmancy-typography variant="h4">Heading 4</schmancy-typography>
|
|
22
|
+
<schmancy-typography variant="h5">Heading 5</schmancy-typography>
|
|
23
|
+
<schmancy-typography variant="h6">Heading 6</schmancy-typography>
|
|
24
|
+
|
|
25
|
+
// Typography body variants
|
|
26
|
+
<schmancy-typography variant="subtitle1">Subtitle 1</schmancy-typography>
|
|
27
|
+
<schmancy-typography variant="subtitle2">Subtitle 2</schmancy-typography>
|
|
28
|
+
<schmancy-typography variant="body1">Body 1 text</schmancy-typography>
|
|
29
|
+
<schmancy-typography variant="body2">Body 2 text</schmancy-typography>
|
|
30
|
+
<schmancy-typography variant="button">Button text</schmancy-typography>
|
|
31
|
+
<schmancy-typography variant="caption">Caption text</schmancy-typography>
|
|
32
|
+
<schmancy-typography variant="overline">Overline text</schmancy-typography>
|
|
33
|
+
|
|
34
|
+
// Typography Properties
|
|
35
|
+
variant: string // Text style variant
|
|
36
|
+
color: string // Text color
|
|
37
|
+
align: string // Text alignment
|
|
38
|
+
weight: string // Font weight
|
|
39
|
+
transform: string // Text transformation
|
|
40
|
+
truncate: boolean // Truncate overflow with ellipsis
|
|
41
|
+
noWrap: boolean // Prevent text wrapping
|
|
42
|
+
gutterBottom: boolean // Add margin at the bottom
|
|
43
|
+
italic: boolean // Italic style
|
|
44
|
+
underline: boolean // Underline text
|
|
45
|
+
lineHeight: string // Line height
|
|
46
|
+
letterSpacing: string // Letter spacing
|
|
47
|
+
fontFamily: string // Font family
|
|
48
|
+
size: string // Custom font size (overrides variant)
|
|
49
|
+
responsive: boolean // Apply responsive sizing
|
|
50
|
+
|
|
51
|
+
// Examples
|
|
52
|
+
// Basic usage
|
|
53
|
+
<schmancy-typography variant="h2" color="primary">
|
|
54
|
+
Welcome to Our Application
|
|
55
|
+
</schmancy-typography>
|
|
56
|
+
|
|
57
|
+
<schmancy-typography variant="body1">
|
|
58
|
+
This is a paragraph of text that demonstrates the body1 typography variant.
|
|
59
|
+
It's commonly used for the main content text on a page.
|
|
60
|
+
</schmancy-typography>
|
|
61
|
+
|
|
62
|
+
// Styled text
|
|
63
|
+
<schmancy-typography
|
|
64
|
+
variant="subtitle1"
|
|
65
|
+
weight="bold"
|
|
66
|
+
color="secondary"
|
|
67
|
+
transform="uppercase">
|
|
68
|
+
Important Notice
|
|
69
|
+
</schmancy-typography>
|
|
70
|
+
|
|
71
|
+
// Truncated text
|
|
72
|
+
<schmancy-typography
|
|
73
|
+
variant="body2"
|
|
74
|
+
truncate
|
|
75
|
+
style="max-width: 200px;">
|
|
76
|
+
This is a very long text that will be truncated with an ellipsis when it exceeds the container width.
|
|
77
|
+
</schmancy-typography>
|
|
78
|
+
|
|
79
|
+
// Responsive headings
|
|
80
|
+
<schmancy-typography
|
|
81
|
+
variant="h1"
|
|
82
|
+
responsive
|
|
83
|
+
align="center"
|
|
84
|
+
gutter-bottom>
|
|
85
|
+
Responsive Heading
|
|
86
|
+
</schmancy-typography>
|
|
87
|
+
|
|
88
|
+
// Text with custom styling
|
|
89
|
+
<schmancy-typography
|
|
90
|
+
variant="body1"
|
|
91
|
+
italic
|
|
92
|
+
letter-spacing="0.5px"
|
|
93
|
+
line-height="1.8">
|
|
94
|
+
This text has custom letter spacing and line height, with italic styling.
|
|
95
|
+
</schmancy-typography>
|
|
96
|
+
|
|
97
|
+
// Text with different weights
|
|
98
|
+
<div>
|
|
99
|
+
<schmancy-typography variant="body1" weight="thin">
|
|
100
|
+
This text has thin weight.
|
|
101
|
+
</schmancy-typography>
|
|
102
|
+
|
|
103
|
+
<schmancy-typography variant="body1" weight="light">
|
|
104
|
+
This text has light weight.
|
|
105
|
+
</schmancy-typography>
|
|
106
|
+
|
|
107
|
+
<schmancy-typography variant="body1" weight="regular">
|
|
108
|
+
This text has regular weight.
|
|
109
|
+
</schmancy-typography>
|
|
110
|
+
|
|
111
|
+
<schmancy-typography variant="body1" weight="medium">
|
|
112
|
+
This text has medium weight.
|
|
113
|
+
</schmancy-typography>
|
|
114
|
+
|
|
115
|
+
<schmancy-typography variant="body1" weight="bold">
|
|
116
|
+
This text has bold weight.
|
|
117
|
+
</schmancy-typography>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
// Typography in a card
|
|
121
|
+
<schmancy-card>
|
|
122
|
+
<schmancy-card-content>
|
|
123
|
+
<schmancy-typography variant="h4" gutter-bottom>
|
|
124
|
+
Card Title
|
|
125
|
+
</schmancy-typography>
|
|
126
|
+
|
|
127
|
+
<schmancy-typography variant="body2" color="text-secondary" gutter-bottom>
|
|
128
|
+
Posted on January 1, 2023
|
|
129
|
+
</schmancy-typography>
|
|
130
|
+
|
|
131
|
+
<schmancy-typography variant="body1">
|
|
132
|
+
This is the main content of the card. It uses the body1 typography variant
|
|
133
|
+
which is suitable for longer text content.
|
|
134
|
+
</schmancy-typography>
|
|
135
|
+
</schmancy-card-content>
|
|
136
|
+
|
|
137
|
+
<schmancy-card-actions>
|
|
138
|
+
<schmancy-button>
|
|
139
|
+
<schmancy-typography variant="button">
|
|
140
|
+
Read More
|
|
141
|
+
</schmancy-typography>
|
|
142
|
+
</schmancy-button>
|
|
143
|
+
</schmancy-card-actions>
|
|
144
|
+
</schmancy-card>
|
|
145
|
+
|
|
146
|
+
// Error message
|
|
147
|
+
<schmancy-typography
|
|
148
|
+
variant="body2"
|
|
149
|
+
color="error"
|
|
150
|
+
gutter-bottom>
|
|
151
|
+
The username or password you entered is incorrect.
|
|
152
|
+
</schmancy-typography>
|
|
153
|
+
|
|
154
|
+
// Caption with custom size
|
|
155
|
+
<schmancy-typography
|
|
156
|
+
variant="caption"
|
|
157
|
+
color="text-secondary"
|
|
158
|
+
size="10px">
|
|
159
|
+
* Terms and conditions apply
|
|
160
|
+
</schmancy-typography>
|
|
161
|
+
|
|
162
|
+
// Paragraph with custom font family
|
|
163
|
+
<schmancy-typography
|
|
164
|
+
variant="body1"
|
|
165
|
+
font-family="'Georgia', serif"
|
|
166
|
+
line-height="1.7">
|
|
167
|
+
This paragraph uses a serif font for a more traditional typographic style.
|
|
168
|
+
Custom font families can be specified when needed for special sections.
|
|
169
|
+
</schmancy-typography>
|
|
170
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const h=require("./litElement.mixin-
|
|
1
|
+
"use strict";const e=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const h=require("./litElement.mixin-CHvyxfxf.cjs");require("./tailwind.mixin-Dm5QDZav.cjs");const c=require("lit"),r=require("lit/decorators.js");var d=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=(i,a,p,n)=>{for(var l,o=n>1?void 0:n?u(a,p):a,y=i.length-1;y>=0;y--)(l=i[y])&&(o=(n?l(a,p,o):l(o))||o);return n&&o&&d(a,p,o),o};let t=class extends h.$LitElement(c.css`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: inherit;
|
|
4
4
|
display: block;
|
|
@@ -34,4 +34,4 @@
|
|
|
34
34
|
</span>
|
|
35
35
|
</span>
|
|
36
36
|
`}};s([r.property({type:String})],t.prototype,"ease",2),s([r.property({type:Number})],t.prototype,"delay",2),s([r.property({type:Number})],t.prototype,"stagger",2),s([r.property({type:Number})],t.prototype,"duration",2),s([r.property({type:Array})],t.prototype,"scale",2),s([r.property({type:Array})],t.prototype,"opacity",2),s([r.property({type:Array})],t.prototype,"translateX",2),s([r.property({type:Array})],t.prototype,"translateY",2),s([r.property({type:Array})],t.prototype,"translateZ",2),s([r.property({type:Array})],t.prototype,"rotateZ",2),s([r.property({type:Boolean})],t.prototype,"resetOnScroll",2),s([r.queryAssignedNodes()],t.prototype,"defaultSlot",2),s([r.query(".letters")],t.prototype,"letters",2),s([r.query(".ml7")],t.prototype,"ml7",2),t=s([r.customElement("schmancy-animated-text")],t);
|
|
37
|
-
//# sourceMappingURL=animated-text-
|
|
37
|
+
//# sourceMappingURL=animated-text-9AM64DHd.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated-text-DU8PPnsu.cjs","sources":["../src/animated-text/animated-text.ts"],"sourcesContent":["// Removed: import { createTimeline, stagger } from '@packages/anime-beta-master'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedNodes } from 'lit/decorators.js'\nimport {\n\tconcat,\n\tdistinctUntilChanged,\n\tfilter,\n\tfromEvent,\n\tinterval,\n\tmap,\n\tstartWith,\n\ttake,\n\ttap,\n\tthrottleTime,\n} from 'rxjs'\n\n/**\n * @element schmancy-animated-text\n * Inspired by https://tobiasahlin.com/moving-letters/#1\n */\n@customElement('schmancy-animated-text')\nexport default class SchmancyAnimatedText extends $LitElement(css`\n\t:host {\n\t\tfont-family: inherit;\n\t\tdisplay: block;\n\t}\n\t.ml7 {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t}\n\t.ml7 .text-wrapper {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\toverflow: hidden;\n\t}\n\t.ml7 .letter {\n\t\ttransform-origin: 0 100%;\n\t\tdisplay: inline-block;\n\t\topacity: 0;\n\t}\n`) {\n\t@property({ type: String }) ease = 'outExpo' // not a built-in string for Web Animations\n\t@property({ type: Number }) delay = 0\n\t@property({ type: Number }) stagger = 50\n\t@property({ type: Number }) duration = 750\n\t@property({ type: Array }) scale = [0, 1]\n\t@property({ type: Array }) opacity = [0, 1]\n\t@property({ type: Array }) translateX = ['0.55em', '0em']\n\t@property({ type: Array }) translateY = ['1.1em', '0em']\n\t@property({ type: Array }) translateZ = [0, 0]\n\t@property({ type: Array }) rotateZ = [180, 0]\n\t@property({ type: Boolean }) resetOnScroll = true\n\n\t@queryAssignedNodes() defaultSlot!: HTMLElement[]\n\t@query('.letters') letters!: HTMLElement\n\t@query('.ml7') ml7!: HTMLElement\n\n\t// Function to check if an element is in the viewport\n\tisInViewport(element: HTMLElement) {\n\t\tconst rect = element.getBoundingClientRect()\n\t\treturn (\n\t\t\trect.top >= 0 &&\n\t\t\trect.left >= 0 &&\n\t\t\trect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n\t\t\trect.right <= (window.innerWidth || document.documentElement.clientWidth)\n\t\t)\n\t}\n\n\tasync firstUpdated() {\n\t\t// Split the text into <span class=\"letter\"> ... </span> elements\n\t\tthis.letters.innerHTML = this.defaultSlot[0].textContent!.replace(/\\S/g, `<span class=\"letter\">$&</span>`)\n\n\t\t// Observe viewport + initial readiness\n\t\tconcat(\n\t\t\t// 1) Wait until the element is rendered (width/height > 0)\n\t\t\tinterval(10).pipe(\n\t\t\t\tstartWith(true),\n\t\t\t\tfilter(() => {\n\t\t\t\t\tconst rect = this.getBoundingClientRect()\n\t\t\t\t\treturn rect.width > 0 && rect.height > 0\n\t\t\t\t}),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) Then handle scroll events, throttled\n\t\t\tfromEvent(window, 'scroll').pipe(\n\t\t\t\tthrottleTime(0, undefined, {\n\t\t\t\t\tleading: true,\n\t\t\t\t\ttrailing: true,\n\t\t\t\t}),\n\t\t\t\tstartWith(true),\n\t\t\t\tmap(() => this.isInViewport(this)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap(inViewport => {\n\t\t\t\t\t// If leaving viewport and `resetOnScroll` is true, reset letters to opacity 0\n\t\t\t\t\tif (!inViewport && this.resetOnScroll) {\n\t\t\t\t\t\tArray.from(this.letters.children).forEach((letter: HTMLElement) => {\n\t\t\t\t\t\t\tletter.style.opacity = '0'\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tfilter(isInViewport => isInViewport),\n\t\t\t\t// If resetOnScroll = false, animate only the first time inView. If true, repeat.\n\t\t\t\tthis.resetOnScroll ? tap() : take(1),\n\t\t\t\ttap({\n\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t// Animate letters with the native Web Animations API\n\t\t\t\t\t\tconst letters = this.shadowRoot!.querySelectorAll<HTMLElement>('.ml7 .letter')\n\n\t\t\t\t\t\tletters.forEach((letter, i) => {\n\t\t\t\t\t\t\t// Combine all transforms into one CSS transform string\n\t\t\t\t\t\t\t// From\n\t\t\t\t\t\t\tconst fromTransform = `\n translate3d(${this.translateX[0]}, ${this.translateY[0]}, ${this.translateZ[0]}px)\n rotateZ(${this.rotateZ[0]}deg)\n scale(${this.scale[0]})\n `\n\t\t\t\t\t\t\t// To\n\t\t\t\t\t\t\tconst toTransform = `\n translate3d(${this.translateX[1]}, ${this.translateY[1]}, ${this.translateZ[1]}px)\n rotateZ(${this.rotateZ[1]}deg)\n scale(${this.scale[1]})\n `\n\t\t\t\t\t\t\t// Approximate `outExpo` or pick a standard easing (like 'ease-out'):\n\t\t\t\t\t\t\t// outExpo often approximated by cubic-bezier(0.19, 1, 0.22, 1)\n\t\t\t\t\t\t\tconst easingMap: Record<string, string> = {\n\t\t\t\t\t\t\t\toutExpo: 'cubic-bezier(0.19, 1, 0.22, 1)',\n\t\t\t\t\t\t\t\t// add more if you want\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst keyframes: Keyframe[] = [\n\t\t\t\t\t\t\t\t{ transform: fromTransform, opacity: String(this.opacity[0]) },\n\t\t\t\t\t\t\t\t{ transform: toTransform, opacity: String(this.opacity[1]) },\n\t\t\t\t\t\t\t]\n\n\t\t\t\t\t\t\tletter.animate(keyframes, {\n\t\t\t\t\t\t\t\tduration: this.duration,\n\t\t\t\t\t\t\t\teasing: easingMap[this.ease] || 'ease-out',\n\t\t\t\t\t\t\t\tdelay: this.delay + i * this.stagger, // staggered start\n\t\t\t\t\t\t\t\tfill: 'forwards', // so the letters remain visible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t),\n\t\t).subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<span class=\"ml7\">\n\t\t\t\t<span class=\"text-wrapper\">\n\t\t\t\t\t<span class=\"letters\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-animated-text': SchmancyAnimatedText\n\t}\n}\n"],"names":["SchmancyAnimatedText","$LitElement","css","super","arguments","this","ease","delay","stagger","duration","scale","opacity","translateX","translateY","translateZ","rotateZ","resetOnScroll","element","rect","getBoundingClientRect","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","firstUpdated","letters","innerHTML","defaultSlot","textContent","replace","concat","interval","pipe","startWith","filter","width","height","take","fromEvent","throttleTime","leading","trailing","map","isInViewport","distinctUntilChanged","tap","inViewport","Array","from","children","forEach","letter","style","next","shadowRoot","querySelectorAll","i","fromTransform","toTransform","keyframes","transform","String","animate","easing","outExpo","fill","subscribe","html","__decorateClass","property","type","prototype","Number","Boolean","queryAssignedNodes","query","customElement"],"mappings":"qcAsBA,IAAqBA,EAArB,cAAkDC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAA9D,CAAA,CAAA,aAAAC,CAAAA,MAAAA,GAAAC,SAoBoCC,EAAAA,KAAAC,KAAA,UACCD,KAAAE,MAAA,EACEF,KAAAG,QAAA,GACCH,KAAAI,SAAA,IACJJ,KAAAK,MAAA,CAAC,EAAG,CACFL,EAAAA,KAAAM,QAAA,CAAC,EAAG,CAAA,EACDN,KAAAO,WAAA,CAAC,SAAU,OACXP,KAAAQ,WAAA,CAAC,QAAS,KACVR,EAAAA,KAAAS,WAAA,CAAC,EAAG,CAAA,EACPT,KAAAU,QAAA,CAAC,IAAK,CACEV,EAAAA,KAAAW,gBAAA,CAO7C,aAAaC,EACN,CAAA,MAAAC,EAAOD,EAAQE,sBACrB,EAAA,OACCD,EAAKE,KAAO,GACZF,EAAKG,MAAQ,GACbH,EAAKI,SAAWC,OAAOC,aAAeC,SAASC,gBAAgBC,eAC/DT,EAAKU,QAAUL,OAAOM,YAAcJ,SAASC,gBAAgBI,YAAA,CAI/D,MAAMC,cAAAA,CAEA1B,KAAA2B,QAAQC,UAAY5B,KAAK6B,YAAY,CAAGC,EAAAA,YAAaC,QAAQ,MAAO,gCAGzEC,EAAAA,EAAAA,OAECC,EAAAA,SAAS,EAAA,EAAIC,KACZC,EAAAA,YACAC,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GACAH,EAAA,CAA1BC,WAAS,CAAEC,KAAMvB,KAAAA,CAAAA,CAAAA,EA5BEtD,EA4BO8E,UAAA,aAAA,CACAH,EAAAA,EAAA,CAA1BC,WAAS,CAAEC,KAAMvB,KA7BEtD,CAAAA,CAAAA,EAAAA,EA6BO8E,UAAA,UAAA,CAAA,EACEH,EAAA,CAA5BC,WAAS,CAAEC,KAAMG,OAAAA,CAAAA,CAAAA,EA9BEhF,EA8BS8E,UAAA,gBAAA,CAAA,EAEPH,EAAA,CAArBM,EAAmBA,mBAhCAjF,CAAAA,EAAAA,EAgCE8E,UAAA,cAAA,CAAA,EACHH,EAAA,CAAlBO,EAAAA,MAAM,UAAA,CAAA,EAjCalF,EAiCD8E,UAAA,UAAA,CACJH,EAAAA,EAAA,CAAdO,EAAAA,MAAM,MAlCalF,CAAAA,EAAAA,EAkCL8E,UAAA,MAAA,GAlCK9E,EAArB2E,EAAA,CADCQ,EAAAA,cAAc,wBACMnF,CAAAA,EAAAA,CAAAA"}
|
|
1
|
+
{"version":3,"file":"animated-text-9AM64DHd.cjs","sources":["../src/animated-text/animated-text.ts"],"sourcesContent":["// Removed: import { createTimeline, stagger } from '@packages/anime-beta-master'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedNodes } from 'lit/decorators.js'\nimport {\n\tconcat,\n\tdistinctUntilChanged,\n\tfilter,\n\tfromEvent,\n\tinterval,\n\tmap,\n\tstartWith,\n\ttake,\n\ttap,\n\tthrottleTime,\n} from 'rxjs'\n\n/**\n * @element schmancy-animated-text\n * Inspired by https://tobiasahlin.com/moving-letters/#1\n */\n@customElement('schmancy-animated-text')\nexport default class SchmancyAnimatedText extends $LitElement(css`\n\t:host {\n\t\tfont-family: inherit;\n\t\tdisplay: block;\n\t}\n\t.ml7 {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t}\n\t.ml7 .text-wrapper {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\toverflow: hidden;\n\t}\n\t.ml7 .letter {\n\t\ttransform-origin: 0 100%;\n\t\tdisplay: inline-block;\n\t\topacity: 0;\n\t}\n`) {\n\t@property({ type: String }) ease = 'outExpo' // not a built-in string for Web Animations\n\t@property({ type: Number }) delay = 0\n\t@property({ type: Number }) stagger = 50\n\t@property({ type: Number }) duration = 750\n\t@property({ type: Array }) scale = [0, 1]\n\t@property({ type: Array }) opacity = [0, 1]\n\t@property({ type: Array }) translateX = ['0.55em', '0em']\n\t@property({ type: Array }) translateY = ['1.1em', '0em']\n\t@property({ type: Array }) translateZ = [0, 0]\n\t@property({ type: Array }) rotateZ = [180, 0]\n\t@property({ type: Boolean }) resetOnScroll = true\n\n\t@queryAssignedNodes() defaultSlot!: HTMLElement[]\n\t@query('.letters') letters!: HTMLElement\n\t@query('.ml7') ml7!: HTMLElement\n\n\t// Function to check if an element is in the viewport\n\tisInViewport(element: HTMLElement) {\n\t\tconst rect = element.getBoundingClientRect()\n\t\treturn (\n\t\t\trect.top >= 0 &&\n\t\t\trect.left >= 0 &&\n\t\t\trect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n\t\t\trect.right <= (window.innerWidth || document.documentElement.clientWidth)\n\t\t)\n\t}\n\n\tasync firstUpdated() {\n\t\t// Split the text into <span class=\"letter\"> ... </span> elements\n\t\tthis.letters.innerHTML = this.defaultSlot[0].textContent!.replace(/\\S/g, `<span class=\"letter\">$&</span>`)\n\n\t\t// Observe viewport + initial readiness\n\t\tconcat(\n\t\t\t// 1) Wait until the element is rendered (width/height > 0)\n\t\t\tinterval(10).pipe(\n\t\t\t\tstartWith(true),\n\t\t\t\tfilter(() => {\n\t\t\t\t\tconst rect = this.getBoundingClientRect()\n\t\t\t\t\treturn rect.width > 0 && rect.height > 0\n\t\t\t\t}),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) Then handle scroll events, throttled\n\t\t\tfromEvent(window, 'scroll').pipe(\n\t\t\t\tthrottleTime(0, undefined, {\n\t\t\t\t\tleading: true,\n\t\t\t\t\ttrailing: true,\n\t\t\t\t}),\n\t\t\t\tstartWith(true),\n\t\t\t\tmap(() => this.isInViewport(this)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap(inViewport => {\n\t\t\t\t\t// If leaving viewport and `resetOnScroll` is true, reset letters to opacity 0\n\t\t\t\t\tif (!inViewport && this.resetOnScroll) {\n\t\t\t\t\t\tArray.from(this.letters.children).forEach((letter: HTMLElement) => {\n\t\t\t\t\t\t\tletter.style.opacity = '0'\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tfilter(isInViewport => isInViewport),\n\t\t\t\t// If resetOnScroll = false, animate only the first time inView. If true, repeat.\n\t\t\t\tthis.resetOnScroll ? tap() : take(1),\n\t\t\t\ttap({\n\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t// Animate letters with the native Web Animations API\n\t\t\t\t\t\tconst letters = this.shadowRoot!.querySelectorAll<HTMLElement>('.ml7 .letter')\n\n\t\t\t\t\t\tletters.forEach((letter, i) => {\n\t\t\t\t\t\t\t// Combine all transforms into one CSS transform string\n\t\t\t\t\t\t\t// From\n\t\t\t\t\t\t\tconst fromTransform = `\n translate3d(${this.translateX[0]}, ${this.translateY[0]}, ${this.translateZ[0]}px)\n rotateZ(${this.rotateZ[0]}deg)\n scale(${this.scale[0]})\n `\n\t\t\t\t\t\t\t// To\n\t\t\t\t\t\t\tconst toTransform = `\n translate3d(${this.translateX[1]}, ${this.translateY[1]}, ${this.translateZ[1]}px)\n rotateZ(${this.rotateZ[1]}deg)\n scale(${this.scale[1]})\n `\n\t\t\t\t\t\t\t// Approximate `outExpo` or pick a standard easing (like 'ease-out'):\n\t\t\t\t\t\t\t// outExpo often approximated by cubic-bezier(0.19, 1, 0.22, 1)\n\t\t\t\t\t\t\tconst easingMap: Record<string, string> = {\n\t\t\t\t\t\t\t\toutExpo: 'cubic-bezier(0.19, 1, 0.22, 1)',\n\t\t\t\t\t\t\t\t// add more if you want\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst keyframes: Keyframe[] = [\n\t\t\t\t\t\t\t\t{ transform: fromTransform, opacity: String(this.opacity[0]) },\n\t\t\t\t\t\t\t\t{ transform: toTransform, opacity: String(this.opacity[1]) },\n\t\t\t\t\t\t\t]\n\n\t\t\t\t\t\t\tletter.animate(keyframes, {\n\t\t\t\t\t\t\t\tduration: this.duration,\n\t\t\t\t\t\t\t\teasing: easingMap[this.ease] || 'ease-out',\n\t\t\t\t\t\t\t\tdelay: this.delay + i * this.stagger, // staggered start\n\t\t\t\t\t\t\t\tfill: 'forwards', // so the letters remain visible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t),\n\t\t).subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<span class=\"ml7\">\n\t\t\t\t<span class=\"text-wrapper\">\n\t\t\t\t\t<span class=\"letters\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-animated-text': SchmancyAnimatedText\n\t}\n}\n"],"names":["SchmancyAnimatedText","$LitElement","css","super","arguments","this","ease","delay","stagger","duration","scale","opacity","translateX","translateY","translateZ","rotateZ","resetOnScroll","element","rect","getBoundingClientRect","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","firstUpdated","letters","innerHTML","defaultSlot","textContent","replace","concat","interval","pipe","startWith","filter","width","height","take","fromEvent","throttleTime","leading","trailing","map","isInViewport","distinctUntilChanged","tap","inViewport","Array","from","children","forEach","letter","style","next","shadowRoot","querySelectorAll","i","fromTransform","toTransform","keyframes","transform","String","animate","easing","outExpo","fill","subscribe","html","__decorateClass","property","type","prototype","Number","Boolean","queryAssignedNodes","query","customElement"],"mappings":"qcAsBA,IAAqBA,EAArB,cAAkD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AA,EAEPH,EAAA,CAArBM,EAAmBA,mBAhCAjF,CAAAA,EAAAA,EAgCE8E,UAAA,cAAA,CAAA,EACHH,EAAA,CAAlBO,EAAAA,MAAM,UAAA,CAAA,EAjCalF,EAiCD8E,UAAA,UAAA,CACJH,EAAAA,EAAA,CAAdO,EAAAA,MAAM,MAlCalF,CAAAA,EAAAA,EAkCL8E,UAAA,MAAA,GAlCK9E,EAArB2E,EAAA,CADCQ,EAAAA,cAAc,wBACMnF,CAAAA,EAAAA,CAAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { concat as u, interval as g, startWith as y, filter as h, take as d, fromEvent as f, throttleTime as w, map as b, distinctUntilChanged as $, tap as c } from "rxjs";
|
|
2
2
|
import "lit/directives/class-map.js";
|
|
3
3
|
import "lit/directives/style-map.js";
|
|
4
|
-
import { $ as x } from "./litElement.mixin-
|
|
5
|
-
import "./tailwind.mixin-
|
|
4
|
+
import { $ as x } from "./litElement.mixin-B9Qdq5S_.js";
|
|
5
|
+
import "./tailwind.mixin-Di7KWye7.js";
|
|
6
6
|
import { css as S, html as Z } from "lit";
|
|
7
7
|
import { property as a, queryAssignedNodes as v, query as m, customElement as A } from "lit/decorators.js";
|
|
8
8
|
var E = Object.defineProperty, O = Object.getOwnPropertyDescriptor, e = (r, s, n, i) => {
|
|
@@ -72,4 +72,4 @@ let t = class extends x(S`
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
e([a({ type: String })], t.prototype, "ease", 2), e([a({ type: Number })], t.prototype, "delay", 2), e([a({ type: Number })], t.prototype, "stagger", 2), e([a({ type: Number })], t.prototype, "duration", 2), e([a({ type: Array })], t.prototype, "scale", 2), e([a({ type: Array })], t.prototype, "opacity", 2), e([a({ type: Array })], t.prototype, "translateX", 2), e([a({ type: Array })], t.prototype, "translateY", 2), e([a({ type: Array })], t.prototype, "translateZ", 2), e([a({ type: Array })], t.prototype, "rotateZ", 2), e([a({ type: Boolean })], t.prototype, "resetOnScroll", 2), e([v()], t.prototype, "defaultSlot", 2), e([m(".letters")], t.prototype, "letters", 2), e([m(".ml7")], t.prototype, "ml7", 2), t = e([A("schmancy-animated-text")], t);
|
|
75
|
-
//# sourceMappingURL=animated-text-
|
|
75
|
+
//# sourceMappingURL=animated-text-CVStWn5N.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated-text-CRlnEvtJ.js","sources":["../src/animated-text/animated-text.ts"],"sourcesContent":["// Removed: import { createTimeline, stagger } from '@packages/anime-beta-master'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedNodes } from 'lit/decorators.js'\nimport {\n\tconcat,\n\tdistinctUntilChanged,\n\tfilter,\n\tfromEvent,\n\tinterval,\n\tmap,\n\tstartWith,\n\ttake,\n\ttap,\n\tthrottleTime,\n} from 'rxjs'\n\n/**\n * @element schmancy-animated-text\n * Inspired by https://tobiasahlin.com/moving-letters/#1\n */\n@customElement('schmancy-animated-text')\nexport default class SchmancyAnimatedText extends $LitElement(css`\n\t:host {\n\t\tfont-family: inherit;\n\t\tdisplay: block;\n\t}\n\t.ml7 {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t}\n\t.ml7 .text-wrapper {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\toverflow: hidden;\n\t}\n\t.ml7 .letter {\n\t\ttransform-origin: 0 100%;\n\t\tdisplay: inline-block;\n\t\topacity: 0;\n\t}\n`) {\n\t@property({ type: String }) ease = 'outExpo' // not a built-in string for Web Animations\n\t@property({ type: Number }) delay = 0\n\t@property({ type: Number }) stagger = 50\n\t@property({ type: Number }) duration = 750\n\t@property({ type: Array }) scale = [0, 1]\n\t@property({ type: Array }) opacity = [0, 1]\n\t@property({ type: Array }) translateX = ['0.55em', '0em']\n\t@property({ type: Array }) translateY = ['1.1em', '0em']\n\t@property({ type: Array }) translateZ = [0, 0]\n\t@property({ type: Array }) rotateZ = [180, 0]\n\t@property({ type: Boolean }) resetOnScroll = true\n\n\t@queryAssignedNodes() defaultSlot!: HTMLElement[]\n\t@query('.letters') letters!: HTMLElement\n\t@query('.ml7') ml7!: HTMLElement\n\n\t// Function to check if an element is in the viewport\n\tisInViewport(element: HTMLElement) {\n\t\tconst rect = element.getBoundingClientRect()\n\t\treturn (\n\t\t\trect.top >= 0 &&\n\t\t\trect.left >= 0 &&\n\t\t\trect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n\t\t\trect.right <= (window.innerWidth || document.documentElement.clientWidth)\n\t\t)\n\t}\n\n\tasync firstUpdated() {\n\t\t// Split the text into <span class=\"letter\"> ... </span> elements\n\t\tthis.letters.innerHTML = this.defaultSlot[0].textContent!.replace(/\\S/g, `<span class=\"letter\">$&</span>`)\n\n\t\t// Observe viewport + initial readiness\n\t\tconcat(\n\t\t\t// 1) Wait until the element is rendered (width/height > 0)\n\t\t\tinterval(10).pipe(\n\t\t\t\tstartWith(true),\n\t\t\t\tfilter(() => {\n\t\t\t\t\tconst rect = this.getBoundingClientRect()\n\t\t\t\t\treturn rect.width > 0 && rect.height > 0\n\t\t\t\t}),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) Then handle scroll events, throttled\n\t\t\tfromEvent(window, 'scroll').pipe(\n\t\t\t\tthrottleTime(0, undefined, {\n\t\t\t\t\tleading: true,\n\t\t\t\t\ttrailing: true,\n\t\t\t\t}),\n\t\t\t\tstartWith(true),\n\t\t\t\tmap(() => this.isInViewport(this)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap(inViewport => {\n\t\t\t\t\t// If leaving viewport and `resetOnScroll` is true, reset letters to opacity 0\n\t\t\t\t\tif (!inViewport && this.resetOnScroll) {\n\t\t\t\t\t\tArray.from(this.letters.children).forEach((letter: HTMLElement) => {\n\t\t\t\t\t\t\tletter.style.opacity = '0'\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tfilter(isInViewport => isInViewport),\n\t\t\t\t// If resetOnScroll = false, animate only the first time inView. If true, repeat.\n\t\t\t\tthis.resetOnScroll ? tap() : take(1),\n\t\t\t\ttap({\n\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t// Animate letters with the native Web Animations API\n\t\t\t\t\t\tconst letters = this.shadowRoot!.querySelectorAll<HTMLElement>('.ml7 .letter')\n\n\t\t\t\t\t\tletters.forEach((letter, i) => {\n\t\t\t\t\t\t\t// Combine all transforms into one CSS transform string\n\t\t\t\t\t\t\t// From\n\t\t\t\t\t\t\tconst fromTransform = `\n translate3d(${this.translateX[0]}, ${this.translateY[0]}, ${this.translateZ[0]}px)\n rotateZ(${this.rotateZ[0]}deg)\n scale(${this.scale[0]})\n `\n\t\t\t\t\t\t\t// To\n\t\t\t\t\t\t\tconst toTransform = `\n translate3d(${this.translateX[1]}, ${this.translateY[1]}, ${this.translateZ[1]}px)\n rotateZ(${this.rotateZ[1]}deg)\n scale(${this.scale[1]})\n `\n\t\t\t\t\t\t\t// Approximate `outExpo` or pick a standard easing (like 'ease-out'):\n\t\t\t\t\t\t\t// outExpo often approximated by cubic-bezier(0.19, 1, 0.22, 1)\n\t\t\t\t\t\t\tconst easingMap: Record<string, string> = {\n\t\t\t\t\t\t\t\toutExpo: 'cubic-bezier(0.19, 1, 0.22, 1)',\n\t\t\t\t\t\t\t\t// add more if you want\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst keyframes: Keyframe[] = [\n\t\t\t\t\t\t\t\t{ transform: fromTransform, opacity: String(this.opacity[0]) },\n\t\t\t\t\t\t\t\t{ transform: toTransform, opacity: String(this.opacity[1]) },\n\t\t\t\t\t\t\t]\n\n\t\t\t\t\t\t\tletter.animate(keyframes, {\n\t\t\t\t\t\t\t\tduration: this.duration,\n\t\t\t\t\t\t\t\teasing: easingMap[this.ease] || 'ease-out',\n\t\t\t\t\t\t\t\tdelay: this.delay + i * this.stagger, // staggered start\n\t\t\t\t\t\t\t\tfill: 'forwards', // so the letters remain visible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t),\n\t\t).subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<span class=\"ml7\">\n\t\t\t\t<span class=\"text-wrapper\">\n\t\t\t\t\t<span class=\"letters\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-animated-text': SchmancyAnimatedText\n\t}\n}\n"],"names":["SchmancyAnimatedText","$LitElement","css","super","arguments","this","ease","delay","stagger","duration","scale","opacity","translateX","translateY","translateZ","rotateZ","resetOnScroll","element","rect","getBoundingClientRect","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","firstUpdated","letters","innerHTML","defaultSlot","textContent","replace","concat","interval","pipe","startWith","filter","width","height","take","fromEvent","throttleTime","leading","trailing","map","isInViewport","distinctUntilChanged","tap","inViewport","Array","from","children","forEach","letter","style","next","shadowRoot","querySelectorAll","i","fromTransform","toTransform","keyframes","transform","String","animate","easing","outExpo","fill","subscribe","html","__decorateClass","property","type","prototype","Number","Boolean","queryAssignedNodes","query","customElement"],"mappings":";;;;;;;;;;;AAsBA,IAAqBA,IAArB,cAAkDC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAA9D,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAoBoCC,GAAAA,KAAAC,OAAA,WACCD,KAAAE,QAAA,GACEF,KAAAG,UAAA,IACCH,KAAAI,WAAA,KACJJ,KAAAK,QAAA,CAAC,GAAG,CAAA,GACFL,KAAAM,UAAA,CAAC,GAAG,CACDN,GAAAA,KAAAO,aAAA,CAAC,UAAU,KAAA,G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-text-CVStWn5N.js","sources":["../src/animated-text/animated-text.ts"],"sourcesContent":["// Removed: import { createTimeline, stagger } from '@packages/anime-beta-master'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedNodes } from 'lit/decorators.js'\nimport {\n\tconcat,\n\tdistinctUntilChanged,\n\tfilter,\n\tfromEvent,\n\tinterval,\n\tmap,\n\tstartWith,\n\ttake,\n\ttap,\n\tthrottleTime,\n} from 'rxjs'\n\n/**\n * @element schmancy-animated-text\n * Inspired by https://tobiasahlin.com/moving-letters/#1\n */\n@customElement('schmancy-animated-text')\nexport default class SchmancyAnimatedText extends $LitElement(css`\n\t:host {\n\t\tfont-family: inherit;\n\t\tdisplay: block;\n\t}\n\t.ml7 {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t}\n\t.ml7 .text-wrapper {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\toverflow: hidden;\n\t}\n\t.ml7 .letter {\n\t\ttransform-origin: 0 100%;\n\t\tdisplay: inline-block;\n\t\topacity: 0;\n\t}\n`) {\n\t@property({ type: String }) ease = 'outExpo' // not a built-in string for Web Animations\n\t@property({ type: Number }) delay = 0\n\t@property({ type: Number }) stagger = 50\n\t@property({ type: Number }) duration = 750\n\t@property({ type: Array }) scale = [0, 1]\n\t@property({ type: Array }) opacity = [0, 1]\n\t@property({ type: Array }) translateX = ['0.55em', '0em']\n\t@property({ type: Array }) translateY = ['1.1em', '0em']\n\t@property({ type: Array }) translateZ = [0, 0]\n\t@property({ type: Array }) rotateZ = [180, 0]\n\t@property({ type: Boolean }) resetOnScroll = true\n\n\t@queryAssignedNodes() defaultSlot!: HTMLElement[]\n\t@query('.letters') letters!: HTMLElement\n\t@query('.ml7') ml7!: HTMLElement\n\n\t// Function to check if an element is in the viewport\n\tisInViewport(element: HTMLElement) {\n\t\tconst rect = element.getBoundingClientRect()\n\t\treturn (\n\t\t\trect.top >= 0 &&\n\t\t\trect.left >= 0 &&\n\t\t\trect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n\t\t\trect.right <= (window.innerWidth || document.documentElement.clientWidth)\n\t\t)\n\t}\n\n\tasync firstUpdated() {\n\t\t// Split the text into <span class=\"letter\"> ... </span> elements\n\t\tthis.letters.innerHTML = this.defaultSlot[0].textContent!.replace(/\\S/g, `<span class=\"letter\">$&</span>`)\n\n\t\t// Observe viewport + initial readiness\n\t\tconcat(\n\t\t\t// 1) Wait until the element is rendered (width/height > 0)\n\t\t\tinterval(10).pipe(\n\t\t\t\tstartWith(true),\n\t\t\t\tfilter(() => {\n\t\t\t\t\tconst rect = this.getBoundingClientRect()\n\t\t\t\t\treturn rect.width > 0 && rect.height > 0\n\t\t\t\t}),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) Then handle scroll events, throttled\n\t\t\tfromEvent(window, 'scroll').pipe(\n\t\t\t\tthrottleTime(0, undefined, {\n\t\t\t\t\tleading: true,\n\t\t\t\t\ttrailing: true,\n\t\t\t\t}),\n\t\t\t\tstartWith(true),\n\t\t\t\tmap(() => this.isInViewport(this)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap(inViewport => {\n\t\t\t\t\t// If leaving viewport and `resetOnScroll` is true, reset letters to opacity 0\n\t\t\t\t\tif (!inViewport && this.resetOnScroll) {\n\t\t\t\t\t\tArray.from(this.letters.children).forEach((letter: HTMLElement) => {\n\t\t\t\t\t\t\tletter.style.opacity = '0'\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tfilter(isInViewport => isInViewport),\n\t\t\t\t// If resetOnScroll = false, animate only the first time inView. If true, repeat.\n\t\t\t\tthis.resetOnScroll ? tap() : take(1),\n\t\t\t\ttap({\n\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t// Animate letters with the native Web Animations API\n\t\t\t\t\t\tconst letters = this.shadowRoot!.querySelectorAll<HTMLElement>('.ml7 .letter')\n\n\t\t\t\t\t\tletters.forEach((letter, i) => {\n\t\t\t\t\t\t\t// Combine all transforms into one CSS transform string\n\t\t\t\t\t\t\t// From\n\t\t\t\t\t\t\tconst fromTransform = `\n translate3d(${this.translateX[0]}, ${this.translateY[0]}, ${this.translateZ[0]}px)\n rotateZ(${this.rotateZ[0]}deg)\n scale(${this.scale[0]})\n `\n\t\t\t\t\t\t\t// To\n\t\t\t\t\t\t\tconst toTransform = `\n translate3d(${this.translateX[1]}, ${this.translateY[1]}, ${this.translateZ[1]}px)\n rotateZ(${this.rotateZ[1]}deg)\n scale(${this.scale[1]})\n `\n\t\t\t\t\t\t\t// Approximate `outExpo` or pick a standard easing (like 'ease-out'):\n\t\t\t\t\t\t\t// outExpo often approximated by cubic-bezier(0.19, 1, 0.22, 1)\n\t\t\t\t\t\t\tconst easingMap: Record<string, string> = {\n\t\t\t\t\t\t\t\toutExpo: 'cubic-bezier(0.19, 1, 0.22, 1)',\n\t\t\t\t\t\t\t\t// add more if you want\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst keyframes: Keyframe[] = [\n\t\t\t\t\t\t\t\t{ transform: fromTransform, opacity: String(this.opacity[0]) },\n\t\t\t\t\t\t\t\t{ transform: toTransform, opacity: String(this.opacity[1]) },\n\t\t\t\t\t\t\t]\n\n\t\t\t\t\t\t\tletter.animate(keyframes, {\n\t\t\t\t\t\t\t\tduration: this.duration,\n\t\t\t\t\t\t\t\teasing: easingMap[this.ease] || 'ease-out',\n\t\t\t\t\t\t\t\tdelay: this.delay + i * this.stagger, // staggered start\n\t\t\t\t\t\t\t\tfill: 'forwards', // so the letters remain visible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t),\n\t\t).subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<span class=\"ml7\">\n\t\t\t\t<span class=\"text-wrapper\">\n\t\t\t\t\t<span class=\"letters\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-animated-text': SchmancyAnimatedText\n\t}\n}\n"],"names":["SchmancyAnimatedText","$LitElement","css","super","arguments","this","ease","delay","stagger","duration","scale","opacity","translateX","translateY","translateZ","rotateZ","resetOnScroll","element","rect","getBoundingClientRect","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","firstUpdated","letters","innerHTML","defaultSlot","textContent","replace","concat","interval","pipe","startWith","filter","width","height","take","fromEvent","throttleTime","leading","trailing","map","isInViewport","distinctUntilChanged","tap","inViewport","Array","from","children","forEach","letter","style","next","shadowRoot","querySelectorAll","i","fromTransform","toTransform","keyframes","transform","String","animate","easing","outExpo","fill","subscribe","html","__decorateClass","property","type","prototype","Number","Boolean","queryAssignedNodes","query","customElement"],"mappings":";;;;;;;;;;;AAsBA,IAAqBA,IAArB,cAAkDC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAA9D,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAoBoCC,GAAAA,KAAAC,OAAA,WACCD,KAAAE,QAAA,GACEF,KAAAG,UAAA,IACCH,KAAAI,WAAA,KACJJ,KAAAK,QAAA,CAAC,GAAG,CAAA,GACFL,KAAAM,UAAA,CAAC,GAAG,CACDN,GAAAA,KAAAO,aAAA,CAAC,UAAU,KAAA,GACXP,KAAAQ,aAAA,CAAC,SAAS,KACVR,GAAAA,KAAAS,aAAA,CAAC,GAAG,CAAA,GACPT,KAAAU,UAAA,CAAC,KAAK,CACEV,GAAAA,KAAAW,gBAAA;AAAA,EAAA;AAAA,EAO7C,aAAaC,GAAAA;AACN,UAAAC,IAAOD,EAAQE,sBAAAA;AACrB,WACCD,EAAKE,OAAO,KAC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,CAA1BC,EAAS,EAAEC,MAAMvB,MAxBEtD,CAAAA,CAAAA,GAAAA,EAwBO8E,WAAA,SAAA,CAAA,GACAH,EAAA,CAA1BC,EAAS,EAAEC,MAAMvB,MAAAA,CAAAA,CAAAA,GAzBEtD,EAyBO8E,WAAA,WAAA,CACAH,GAAAA,EAAA,CAA1BC,EAAS,EAAEC,MAAMvB,WA1BEtD,EA0BO8E,WAAA,cAAA,CAAA,GACAH,EAAA,CAA1BC,EAAS,EAAEC,MAAMvB,MAAAA,CAAAA,CAAAA,GA3BEtD,EA2BO8E,WAAA,cAAA,CAAA,GACAH,EAAA,CAA1BC,EAAS,EAAEC,MAAMvB,MA5BEtD,CAAAA,CAAAA,GAAAA,EA4BO8E,WAAA,cAAA,CACAH,GAAAA,EAAA,CAA1BC,EAAS,EAAEC,MAAMvB,MAAAA,CAAAA,CAAAA,GA7BEtD,EA6BO8E,WAAA,WAAA,CAAA,GACEH,EAAA,CAA5BC,EAAS,EAAEC,MAAMG,QA9BEhF,CAAAA,CAAAA,GAAAA,EA8BS8E,WAAA,iBAAA,IAEPH,EAAA,CAArBM,EAhCmBjF,CAAAA,GAAAA,EAgCE8E,WAAA,eAAA,CACHH,GAAAA,EAAA,CAAlBO,EAAM,UAAA,CAAA,GAjCalF,EAiCD8E,WAAA,WAAA,CAAA,GACJH,EAAA,CAAdO,EAAM,MAlCalF,CAAAA,GAAAA,EAkCL8E,WAAA,OAAA,CAlCK9E,GAAAA,IAArB2E,EAAA,CADCQ,EAAc,wBACMnF,CAAAA,GAAAA,CAAAA;"}
|
package/dist/animated-text.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./animated-text-
|
|
1
|
+
"use strict";require("./animated-text-9AM64DHd.cjs");
|
|
2
2
|
//# sourceMappingURL=animated-text.cjs.map
|
package/dist/animated-text.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./animated-text-
|
|
1
|
+
import "./animated-text-CVStWn5N.js";
|
|
2
2
|
//# sourceMappingURL=animated-text.js.map
|
package/dist/area.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./area.component-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./area.component-WxccFh1z.cjs");exports.FINDING_MORTIES=e.FINDING_MORTIES,exports.HERE_RICKY=e.HERE_RICKY,exports.HISTORY_STRATEGY=e.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>e.SchmancyArea}),exports.area=e.area,exports.routerHistory=e.routerHistory;
|
|
2
2
|
//# sourceMappingURL=area.cjs.map
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { Subject as R, ReplaySubject as d, skip as b, map as o, filter as c, zip as I, fromEvent as w, of as i, bufferTime as P, tap as u, timeout as O, catchError as E, EMPTY as j, merge as U, switchMap as f, take as N, takeUntil as y, distinctUntilChanged as v, from as $ } from "rxjs";
|
|
2
|
+
import "lit/directives/class-map.js";
|
|
3
|
+
import "lit/directives/style-map.js";
|
|
4
|
+
import { $ as x } from "./litElement.mixin-B9Qdq5S_.js";
|
|
5
|
+
import "./tailwind.mixin-Di7KWye7.js";
|
|
6
|
+
import { css as F, html as T } from "lit";
|
|
7
|
+
import { property as C, customElement as A } from "lit/decorators.js";
|
|
8
|
+
import { l as L } from "./index-CuY8m6ta.js";
|
|
9
|
+
const V = new R(), M = "FINDING_MORTIES", J = "HERE_RICKY";
|
|
10
|
+
class p {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.prettyURL = !1, this.mode = "HISTORY", this.request = new d(1), this.current = /* @__PURE__ */ new Map(), this.$current = new d(1), this.areaSubjects = /* @__PURE__ */ new Map(), this.enableHistoryMode = !0, this.findingMortiesEvent = new CustomEvent(M), this.$current.next(this.current), this.$current.subscribe((t) => {
|
|
13
|
+
t.forEach((e, n) => {
|
|
14
|
+
this.getOrCreateAreaSubject(n).next(e);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
getOrCreateAreaSubject(t) {
|
|
19
|
+
if (!this.areaSubjects.has(t)) {
|
|
20
|
+
const n = new d(1);
|
|
21
|
+
this.areaSubjects.set(t, n);
|
|
22
|
+
const s = this.current.get(t);
|
|
23
|
+
s && n.next({ ...s, state: s.state || {}, params: s.params || {} });
|
|
24
|
+
}
|
|
25
|
+
const e = this.areaSubjects.get(t);
|
|
26
|
+
if (!e) throw new Error(`Failed to create or retrieve subject for area: ${t}`);
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
on(t, e = !1) {
|
|
30
|
+
const n = this.getOrCreateAreaSubject(t);
|
|
31
|
+
return e ? n.pipe(b(1)) : n.asObservable();
|
|
32
|
+
}
|
|
33
|
+
all(t = !1) {
|
|
34
|
+
return t ? this.$current.pipe(b(1)) : this.$current.asObservable();
|
|
35
|
+
}
|
|
36
|
+
getState(t) {
|
|
37
|
+
return this.on(t).pipe(o((e) => e.state), c((e) => e !== void 0), o((e) => e));
|
|
38
|
+
}
|
|
39
|
+
params(t) {
|
|
40
|
+
return this.on(t).pipe(o((e) => e.params), c((e) => e !== void 0), o((e) => e));
|
|
41
|
+
}
|
|
42
|
+
param(t, e) {
|
|
43
|
+
return this.params(t).pipe(o((n) => n[e]), c((n) => n !== void 0), o((n) => n));
|
|
44
|
+
}
|
|
45
|
+
find() {
|
|
46
|
+
return I([w(window, J).pipe(o((t) => t.detail), P(0), u(console.log)), i(1).pipe(u(() => window.dispatchEvent(this.findingMortiesEvent)))]).pipe(o(([t]) => t), O(1));
|
|
47
|
+
}
|
|
48
|
+
push(t) {
|
|
49
|
+
const e = { ...t, state: t.state || {}, params: t.params || {} };
|
|
50
|
+
this.request.next(e), this.dispatchAreaEvent(e.area, e);
|
|
51
|
+
}
|
|
52
|
+
dispatchAreaEvent(t, e) {
|
|
53
|
+
const n = new CustomEvent(`schmancy-area-${t}-changed`, { detail: { area: t, component: e.component, state: e.state, params: e.params, historyStrategy: e.historyStrategy }, bubbles: !0, composed: !0 });
|
|
54
|
+
window.dispatchEvent(n);
|
|
55
|
+
}
|
|
56
|
+
pop(t) {
|
|
57
|
+
const e = JSON.parse(JSON.stringify(m.state));
|
|
58
|
+
delete e[t], history.replaceState(null, "", encodeURIComponent(JSON.stringify(e)));
|
|
59
|
+
}
|
|
60
|
+
static getInstance() {
|
|
61
|
+
return p.instance || (p.instance = new p()), p.instance;
|
|
62
|
+
}
|
|
63
|
+
get state() {
|
|
64
|
+
const t = location.pathname.split("/").pop();
|
|
65
|
+
let e = {};
|
|
66
|
+
try {
|
|
67
|
+
e = t ? JSON.parse(decodeURIComponent(t)) : {};
|
|
68
|
+
} catch {
|
|
69
|
+
e = {};
|
|
70
|
+
}
|
|
71
|
+
return e;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const m = p.getInstance();
|
|
75
|
+
var S = ((a) => (a.push = "push", a.replace = "replace", a.pop = "pop", a.silent = "silent", a))(S || {}), k = Object.defineProperty, q = Object.getOwnPropertyDescriptor, g = (a, t, e, n) => {
|
|
76
|
+
for (var s, r = n > 1 ? void 0 : n ? q(t, e) : t, l = a.length - 1; l >= 0; l--) (s = a[l]) && (r = (n ? s(t, e, r) : s(r)) || r);
|
|
77
|
+
return n && r && k(t, e, r), r;
|
|
78
|
+
};
|
|
79
|
+
let h = class extends x(F`
|
|
80
|
+
:host {
|
|
81
|
+
position: relative;
|
|
82
|
+
display: block;
|
|
83
|
+
inset: 0;
|
|
84
|
+
}
|
|
85
|
+
`) {
|
|
86
|
+
getComponentFromPathname(a, t) {
|
|
87
|
+
return i(a).pipe(o((e) => e.split("/").pop() ?? ""), o((e) => decodeURIComponent(e)), o((e) => JSON.parse(e)), o((e) => e[this.name]), o((e) => !e && this.default ? { component: this.default, state: void 0 } : e), c((e) => L.isPresent(e)), o((e) => ({ area: this.name, component: e.component ?? this.default, state: e.state, historyStrategy: t })), o((e) => e), E(() => this.default ? i({ area: this.name, component: this.default, historyStrategy: t }) : j));
|
|
88
|
+
}
|
|
89
|
+
firstUpdated() {
|
|
90
|
+
if (!this.name) throw new Error("Area name or default component not set");
|
|
91
|
+
U(i(location.pathname).pipe(f((a) => this.getComponentFromPathname(a, S.silent)), o((a) => a), N(1)), m.request.pipe(c(({ area: a }) => a === this.name)), w(window, "popstate").pipe(o((a) => a.target.location.pathname), f((a) => this.getComponentFromPathname(a, S.silent)), o((a) => a))).pipe(c((a) => !!a.component), y(this.disconnecting), v((a, t) => {
|
|
92
|
+
let e, n;
|
|
93
|
+
return typeof a.component != "function" && (typeof a.component == "string" && (e = a.component), typeof t.component != "function" && (typeof t.component == "string" && (n = t.component), (n == null ? void 0 : n.replaceAll("-", "").toLowerCase()) === (e == null ? void 0 : e.replaceAll("-", "").toLowerCase())));
|
|
94
|
+
})).pipe(f((a) => {
|
|
95
|
+
const t = a.component;
|
|
96
|
+
return t instanceof Promise ? $(t).pipe(o((e) => ({ component: e.exports.default, route: a }))) : i({ component: t, route: a });
|
|
97
|
+
}), o(({ component: a, route: t }) => typeof a == "string" ? { component: document.createElement(a), route: t } : a instanceof HTMLElement ? { component: a, route: t } : typeof a == "function" ? { component: new a(), route: t } : void 0), v((a, t) => a.component.tagName === t.component.tagName), o(({ component: a, route: t }) => {
|
|
98
|
+
var s, r;
|
|
99
|
+
const e = (s = this.shadowRoot) == null ? void 0 : s.children[0], n = !!e;
|
|
100
|
+
return e.remove(), a.classList.add("opacity-0"), (r = this.shadowRoot) == null || r.append(a), a.animate([{ opacity: 0 }, { opacity: 1 }], { duration: n ? 150 : 100, easing: "cubic-bezier(0.25, 0.8, 0.25, 1)", fill: "forwards" }), { component: a, route: t };
|
|
101
|
+
}), u(({ component: a, route: t }) => {
|
|
102
|
+
t.historyStrategy === void 0 || t.historyStrategy === "push" ? history.pushState(t.state, "", this.newPath(a.tagName, t)) : t.historyStrategy && ["replace", "pop"].includes(t.historyStrategy) && history.replaceState(t.state, "", this.newPath(a.tagName, t)), m.current.set(this.name, { component: a.tagName, state: t.state || {}, area: this.name, params: t.params || {} }), m.$current.next(m.current);
|
|
103
|
+
}), y(this.disconnecting)).subscribe();
|
|
104
|
+
}
|
|
105
|
+
newPath(a, t) {
|
|
106
|
+
const e = location.pathname.split("/").pop();
|
|
107
|
+
let n = {};
|
|
108
|
+
try {
|
|
109
|
+
n = e ? JSON.parse(decodeURIComponent(e)) : {};
|
|
110
|
+
} catch {
|
|
111
|
+
n = {};
|
|
112
|
+
}
|
|
113
|
+
t.state = t.state ?? {};
|
|
114
|
+
const s = t.clearQueryParams ? this.queryParamClear(t.clearQueryParams) : document.location.search;
|
|
115
|
+
return encodeURIComponent(JSON.stringify({ ...n, [this.name]: { component: a.toLowerCase(), state: t.state, params: t.params } })).concat(`${s}`);
|
|
116
|
+
}
|
|
117
|
+
queryParamClear(a) {
|
|
118
|
+
if (!a) return "";
|
|
119
|
+
const t = new URLSearchParams(location.search);
|
|
120
|
+
return a.forEach((e) => t.delete(e)), t.toString() === "" ? "" : `?${t.toString()}`;
|
|
121
|
+
}
|
|
122
|
+
checkForTeleportationRequests() {
|
|
123
|
+
return w(window, "FLIP_REQUEST").pipe(o((a) => a.detail), P(0), u(() => {
|
|
124
|
+
this.dispatchEvent(new CustomEvent("FLIP_STARTED"));
|
|
125
|
+
}), y(this.disconnecting), O(0), E(() => i(null)));
|
|
126
|
+
}
|
|
127
|
+
disconnectedCallback() {
|
|
128
|
+
super.disconnectedCallback(), this.disconnecting.next(!0);
|
|
129
|
+
}
|
|
130
|
+
render() {
|
|
131
|
+
return T` <slot> </slot> `;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
g([C()], h.prototype, "name", 2), g([C()], h.prototype, "default", 2), h = g([A("schmancy-area")], h);
|
|
135
|
+
export {
|
|
136
|
+
M as F,
|
|
137
|
+
J as H,
|
|
138
|
+
h as S,
|
|
139
|
+
m as a,
|
|
140
|
+
S as b,
|
|
141
|
+
V as r
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=area.component-CzFJM7Y4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area.component-CzFJM7Y4.js","sources":["../src/area/area.service.ts","../src/area/router.types.ts","../src/area/area.component.ts"],"sourcesContent":["import { Observable, ReplaySubject, Subject, bufferTime, filter, fromEvent, map, of, skip, tap, timeout, zip } from 'rxjs'\nimport { SchmancyTeleportation } from '../teleport'\nimport { ActiveRoute, AreaSubscription, RouteAction } from './router.types'\n\nexport const routerHistory = new Subject<RouteAction>()\n\nexport const FINDING_MORTIES = 'FINDING_MORTIES'\nexport const HERE_RICKY = 'HERE_RICKY'\nexport type HERE_RICKY_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\nexport type FINDING_MORTIES_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\n\nclass AreaService implements AreaSubscription {\n\tprivate static instance: AreaService\n\tpublic prettyURL = false\n\tpublic mode: 'SILENT' | 'HISTORY' = 'HISTORY'\n\tpublic request = new ReplaySubject<RouteAction>(1)\n\tpublic current = new Map<string, ActiveRoute>()\n\tpublic $current = new ReplaySubject<Map<string, ActiveRoute>>(1)\n\t\n\t// Create a dictionary of ReplaySubjects for area-specific subscriptions\n\tprivate areaSubjects = new Map<string, ReplaySubject<ActiveRoute>>()\n\t\n\tpublic enableHistoryMode = true\n\tprivate findingMortiesEvent = new CustomEvent<FINDING_MORTIES_EVENT['detail']>(FINDING_MORTIES)\n\n\tconstructor() {\n\t\tthis.$current.next(this.current)\n\t\t\n\t\t// Subscribe to current changes to update area-specific subjects\n\t\tthis.$current.subscribe(currentAreas => {\n\t\t\t// For each area in the current map\n\t\t\tcurrentAreas.forEach((route, areaName) => {\n\t\t\t\t// Get or create a subject for this area\n\t\t\t\tconst areaSubject = this.getOrCreateAreaSubject(areaName)\n\t\t\t\t// Emit the updated route to area-specific subscribers\n\t\t\t\tareaSubject.next(route)\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Get or create a ReplaySubject for a specific area\n\t * @param areaName The name of the area\n\t * @returns ReplaySubject for the specified area\n\t */\n\tprivate getOrCreateAreaSubject(areaName: string): ReplaySubject<ActiveRoute> {\n\t\tif (!this.areaSubjects.has(areaName)) {\n\t\t\tconst subject = new ReplaySubject<ActiveRoute>(1)\n\t\t\tthis.areaSubjects.set(areaName, subject)\n\t\t\t\n\t\t\t// If the area already exists in current, emit it immediately\n\t\t\tconst currentRoute = this.current.get(areaName)\n\t\t\tif (currentRoute) {\n\t\t\t\tsubject.next({\n\t\t\t\t\t...currentRoute,\n\t\t\t\t\t// Ensure state and params are initialized if undefined\n\t\t\t\t\tstate: currentRoute.state || {},\n\t\t\t\t\tparams: currentRoute.params || {}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\t\n\t\tconst subject = this.areaSubjects.get(areaName)\n\t\tif (!subject) {\n\t\t\tthrow new Error(`Failed to create or retrieve subject for area: ${areaName}`)\n\t\t}\n\t\t\n\t\treturn subject\n\t}\n\n\t/**\n\t * Subscribe to a specific area\n\t * @param areaName Name of the area to subscribe to\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of the active route for the specified area\n\t */\n\ton(areaName: string, skipCurrent = false): Observable<ActiveRoute> {\n\t\tconst areaSubject = this.getOrCreateAreaSubject(areaName)\n\t\t\n\t\treturn skipCurrent ? areaSubject.pipe(skip(1)) : areaSubject.asObservable()\n\t}\n\t\n\t/**\n\t * Subscribe to all areas\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of all active routes\n\t */\n\tall(skipCurrent = false): Observable<Map<string, ActiveRoute>> {\n\t\treturn skipCurrent ? this.$current.pipe(skip(1)) : this.$current.asObservable()\n\t}\n\t\n\t/**\n\t * Get state from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's state\n\t */\n\tgetState<T = unknown>(areaName: string): Observable<T> {\n\t\treturn this.on(areaName).pipe(\n\t\t\tmap(route => route.state as unknown),\n\t\t\tfilter((state): state is NonNullable<unknown> => state !== undefined),\n\t\t\tmap(state => state as T)\n\t\t)\n\t}\n\t\n\t/**\n\t * Get params from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's params\n\t */\n\tparams<T extends Record<string, unknown> = Record<string, unknown>>(areaName: string): Observable<T> {\n\t\treturn this.on(areaName).pipe(\n\t\t\tmap(route => route.params as unknown),\n\t\t\tfilter((params): params is NonNullable<unknown> => params !== undefined),\n\t\t\tmap(params => params as T)\n\t\t)\n\t}\n\t\n\t/**\n\t * Get a specific param from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @param key Key of the param to select\n\t * @returns Observable of the param value\n\t */\n\tparam<T = unknown>(areaName: string, key: string): Observable<T> {\n\t\treturn this.params<Record<string, unknown>>(areaName).pipe(\n\t\t\tmap(params => params[key] as unknown),\n\t\t\tfilter((value): value is NonNullable<unknown> => value !== undefined),\n\t\t\tmap(value => value as T)\n\t\t)\n\t}\n\n\tfind() {\n\t\treturn zip([\n\t\t\tfromEvent<HERE_RICKY_EVENT>(window, HERE_RICKY).pipe(\n\t\t\t\tmap(e => e.detail),\n\t\t\t\tbufferTime(0),\n\t\t\t\ttap(console.log),\n\t\t\t),\n\t\t\tof(1).pipe(tap(() => window.dispatchEvent(this.findingMortiesEvent))),\n\t\t]).pipe(\n\t\t\tmap(([component]) => component),\n\t\t\ttimeout(1),\n\t\t)\n\t}\n\n\t/**\n\t * Push a new route action\n\t * @param r Route action to push\n\t */\n\tpush(r: RouteAction) {\n\t\t// Ensure state and params are initialized\n\t\tconst routeAction = {\n\t\t\t...r,\n\t\t\tstate: r.state || {},\n\t\t\tparams: r.params || {}\n\t\t}\n\t\t\n\t\tthis.request.next(routeAction)\n\t\t// Emit an area-specific event for those who want to listen directly to DOM events\n\t\tthis.dispatchAreaEvent(routeAction.area, routeAction)\n\t}\n\t\n\t/**\n\t * Dispatch a DOM event for a specific area change\n\t * @param areaName Name of the area that changed\n\t * @param routeAction The route action that was pushed\n\t */\n\tprivate dispatchAreaEvent(areaName: string, routeAction: RouteAction) {\n\t\tconst eventName = `schmancy-area-${areaName}-changed`\n\t\tconst event = new CustomEvent(eventName, { \n\t\t\tdetail: { \n\t\t\t\tarea: areaName,\n\t\t\t\tcomponent: routeAction.component,\n\t\t\t\tstate: routeAction.state,\n\t\t\t\tparams: routeAction.params,\n\t\t\t\thistoryStrategy: routeAction.historyStrategy\n\t\t\t},\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t})\n\t\twindow.dispatchEvent(event)\n\t}\n\n\tpop(name: string) {\n\t\tconst newState = JSON.parse(JSON.stringify(area.state))\n\t\tdelete newState[name]\n\t\tconsole.log(area.state, newState)\n\t\thistory.replaceState(null, '', encodeURIComponent(JSON.stringify(newState)))\n\t}\n\t\n\tstatic getInstance() {\n\t\tif (!AreaService.instance) {\n\t\t\tAreaService.instance = new AreaService()\n\t\t}\n\t\treturn AreaService.instance\n\t}\n\n\tget state() {\n\t\tconst pathname = location.pathname.split('/').pop()\n\t\tlet areaState = {}\n\t\ttry {\n\t\t\tareaState = pathname ? JSON.parse(decodeURIComponent(pathname)) : {}\n\t\t} catch {\n\t\t\tareaState = {}\n\t\t}\n\t\treturn areaState\n\t}\n}\n\nexport const area = AreaService.getInstance()\nexport default area\n","export type RouteAction = {\n\tcomponent: CustomElementConstructor | string | HTMLElement\n\tarea: string\n\tstate?: Record<string, unknown>\n\tparams?: Record<string, unknown>\n\thistoryStrategy?: THistoryStrategy\n\tclearQueryParams?: string[] | null\n}\n\nexport type ActiveRoute = {\n\tcomponent: string\n\tarea: string\n\tstate?: Record<string, unknown>\n\tparams?: Record<string, unknown>\n}\n\n/**\n * Interface for subscribing to area changes\n */\nexport interface AreaSubscription {\n\t/**\n\t * Subscribe to a specific area\n\t * @param areaName Name of the area to subscribe to\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of the active route for the specified area\n\t */\n\ton(areaName: string, skipCurrent?: boolean): import('rxjs').Observable<ActiveRoute>\n\t\n\t/**\n\t * Subscribe to all areas\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of all active routes\n\t */\n\tall(skipCurrent?: boolean): import('rxjs').Observable<Map<string, ActiveRoute>>\n\t\n\t/**\n\t * Get state from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's state\n\t */\n\tgetState<T = unknown>(areaName: string): import('rxjs').Observable<T>\n\t\n\t/**\n\t * Get params from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's params\n\t */\n\tparams<T extends Record<string, unknown> = Record<string, unknown>>(areaName: string): import('rxjs').Observable<T>\n\t\n\t/**\n\t * Get a specific param from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @param key Key of the param to select\n\t * @returns Observable of the param value\n\t */\n\tparam<T = unknown>(areaName: string, key: string): import('rxjs').Observable<T>\n}\n\nexport type THistoryStrategy = 'push' | 'replace' | 'pop' | 'silent'\n\nexport enum HISTORY_STRATEGY {\n\tpush = 'push',\n\treplace = 'replace',\n\tpop = 'pop',\n\tsilent = 'silent',\n}\n","import { $LitElement } from '@mixins/index'\nimport { TemplateResult, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport {\n\tEMPTY,\n\tbufferTime,\n\tcatchError,\n\tdistinctUntilChanged,\n\tfilter,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tof,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimeout,\n} from 'rxjs'\nimport { isPresent } from 'ts-is-present'\nimport area from './area.service'\nimport { HISTORY_STRATEGY, RouteAction } from './router.types'\n\ntype TRouteArea = {\n\tcomponent: string\n\tstate: object | undefined\n}\n\n@customElement('schmancy-area')\nexport class SchmancyArea extends $LitElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: block;\n\t\tinset: 0;\n\t}\n`) {\n\t/**\n\t * The name of the router outlet\n\t * @attr\n\t * @type {string}\n\t * @public\n\t * @required\n\t */\n\t@property() name!: string\n\n\t@property() default!: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\n\t/**\n\t *\n\t * @param pathname pathname from the browser location API\n\t * @param historyStrategy the history strategy to use for the route like PUSH, REPLACE, or SILENT\n\t * @returns rxjs pipes that will return the component to render and the history strategy to use\n\t */\n\tgetComponentFromPathname(pathname: string, historyStrategy: HISTORY_STRATEGY) {\n\t\treturn of(pathname).pipe(\n\t\t\tmap(path => path.split('/').pop() ?? ''),\n\t\t\tmap(path => decodeURIComponent(path)),\n\t\t\tmap(path => JSON.parse(path)),\n\t\t\tmap(routes => routes[this.name] as TRouteArea),\n\t\t\tmap(component =>\n\t\t\t\t!component && this.default\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\tstate: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: component,\n\t\t\t),\n\t\t\tfilter(x => isPresent(x)),\n\t\t\tmap((component: TRouteArea) => ({\n\t\t\t\tarea: this.name,\n\t\t\t\tcomponent: component.component ?? this.default,\n\t\t\t\tstate: component.state,\n\t\t\t\thistoryStrategy,\n\t\t\t})),\n\t\t\tmap(x => x as RouteAction),\n\t\t\tcatchError(() => {\n\t\t\t\treturn this.default\n\t\t\t\t\t? of({\n\t\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\thistoryStrategy,\n\t\t\t\t\t\t} as RouteAction)\n\t\t\t\t\t: EMPTY\n\t\t\t}),\n\t\t)\n\t}\n\n\tprotected firstUpdated(): void {\n\t\tif (!this.name) {\n\t\t\t// TOOD: maybe enforce this to be unique\n\t\t\tthrow new Error('Area name or default component not set')\n\t\t}\n\n\t\t// active outlet changes\n\t\tmerge(\n\t\t\t// 1) initial load from location.pathname\n\t\t\tof(location.pathname).pipe(\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) requests to change the route for this area\n\t\t\tarea.request.pipe(filter(({ area }) => area === this.name)),\n\t\t\t// 3) popstate events (back, forward)\n\t\t\tfromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\t\tmap(e => (e.target as Window).location.pathname),\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(\n\t\t\t\tfilter(request => !!request.component),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\tdistinctUntilChanged((a, b) => {\n\t\t\t\t\tlet aComponent, bComponent\n\t\t\t\t\tif (typeof a.component === 'function') return false\n\t\t\t\t\telse if (typeof a.component === 'string') aComponent = a.component\n\n\t\t\t\t\tif (typeof b.component === 'function') return false\n\t\t\t\t\telse if (typeof b.component === 'string') bComponent = b.component\n\n\t\t\t\t\treturn bComponent?.replaceAll('-', '').toLowerCase() === aComponent?.replaceAll('-', '').toLowerCase()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(route => {\n\t\t\t\t\tconst c = route.component\n\t\t\t\t\tif (c instanceof Promise) {\n\t\t\t\t\t\t// Dynamic import module\n\t\t\t\t\t\treturn from(c).pipe(map(x => ({ component: x.exports.default as CustomElementConstructor, route })))\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Already a string, function, or element\n\t\t\t\t\t\treturn of({ component: c, route })\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tif (typeof component === 'string') {\n\t\t\t\t\t\t// Tag name\n\t\t\t\t\t\treturn { component: document.createElement(component), route }\n\t\t\t\t\t} else if (component instanceof HTMLElement) {\n\t\t\t\t\t\t// Already an element instance\n\t\t\t\t\t\treturn { component, route }\n\t\t\t\t\t} else if (typeof component === 'function') {\n\t\t\t\t\t\t// Custom element constructor\n\t\t\t\t\t\treturn { component: new component(), route }\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tdistinctUntilChanged((prev, curr) => prev.component.tagName === curr.component.tagName),\n\t\t\t\t// create the new view and add it to the DOM\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tconst oldView = this.shadowRoot?.children[0]\n\t\t\t\t\tconst oldViewExists = !!oldView\n\n\t\t\t\t\t// Remove the old view (if any)\n\t\t\t\t\toldView.remove()\n\t\t\t\t\t// Native Web Animations API - fade in\n\t\t\t\t\t// \"ease: cubic-bezier(0.25, 0.8, 0.25, 1)\" was used in the old code\n\t\t\t\t\tcomponent.classList.add('opacity-0')\n\t\t\t\t\tthis.shadowRoot?.append(component)\n\t\t\t\t\tcomponent.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\t\t\tduration: oldViewExists ? 150 : 100,\n\t\t\t\t\t\teasing: 'cubic-bezier(0.25, 0.8, 0.25, 1)',\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t})\n\n\t\t\t\t\t// Insert the new view\n\n\t\t\t\t\treturn { component, route }\n\t\t\t\t}),\n\t\t\t\ttap(({ component, route }) => {\n\t\t\t\t\t// Handle history updates\n\t\t\t\t\tif (typeof route.historyStrategy === 'undefined' || route.historyStrategy === 'push') {\n\t\t\t\t\t\thistory.pushState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t} else if (route.historyStrategy && ['replace', 'pop'].includes(route.historyStrategy)) {\n\t\t\t\t\t\thistory.replaceState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t}\n\t\t\t\t\tarea.current.set(this.name, {\n\t\t\t\t\t\tcomponent: component.tagName,\n\t\t\t\t\t\tstate: route.state || {},\n\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\tparams: route.params || {},\n\t\t\t\t\t})\n\n\t\t\t\t\tarea.$current.next(area.current)\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tnewPath(tag: string, route: RouteAction) {\n\t\tconst oldPathname = location.pathname.split('/').pop()\n\t\tlet oldAreaState = {}\n\t\ttry {\n\t\t\toldAreaState = oldPathname ? JSON.parse(decodeURIComponent(oldPathname)) : {}\n\t\t} catch {\n\t\t\toldAreaState = {}\n\t\t}\n\t\troute.state = route.state ?? {}\n\t\tconst queryParams = route.clearQueryParams ? this.queryParamClear(route.clearQueryParams) : document.location.search\n\n\t\treturn encodeURIComponent(\n\t\t\tJSON.stringify({\n\t\t\t\t...oldAreaState,\n\t\t\t\t[this.name]: { component: tag.toLowerCase(), state: route.state, params: route.params },\n\t\t\t}),\n\t\t).concat(`${queryParams}`)\n\t}\n\n\tqueryParamClear(params?: string[]) {\n\t\tif (!params) {\n\t\t\treturn ''\n\t\t}\n\t\t// get query params from url\n\t\tconst urlParams = new URLSearchParams(location.search)\n\t\t// remove query params\n\t\tparams.forEach(param => urlParams.delete(param))\n\t\t// update url\n\t\tif (urlParams.toString() === '') return ''\n\t\treturn `?${urlParams.toString()}`\n\t}\n\n\tcheckForTeleportationRequests() {\n\t\treturn fromEvent<CustomEvent>(window, 'FLIP_REQUEST').pipe(\n\t\t\tmap(e => e.detail),\n\t\t\tbufferTime(0),\n\t\t\ttap(() => {\n\t\t\t\tthis.dispatchEvent(new CustomEvent('FLIP_STARTED'))\n\t\t\t}),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t\ttimeout(0),\n\t\t\tcatchError(() => of(null)),\n\t\t)\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\trender() {\n\t\treturn html` <slot> </slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-area': SchmancyArea\n\t}\n}"],"names":["routerHistory","Subject","FINDING_MORTIES","HERE_RICKY","AreaService","constructor","this","prettyURL","mode","request","ReplaySubject","current","Map","$current","areaSubjects","enableHistoryMode","findingMortiesEvent","CustomEvent","next","subscribe","currentAreas","forEach","route","areaName","getOrCreateAreaSubject","has","subject","set","currentRoute","get","state","params","Error","skipCurrent","areaSubject","pipe","skip","asObservable","on","map","filter","key","value","zip","fromEvent","window","e","detail","bufferTime","tap","console","log","of","dispatchEvent","component","timeout","r","routeAction","dispatchAreaEvent","area","event","historyStrategy","bubbles","composed","name","newState","JSON","parse","stringify","history","replaceState","encodeURIComponent","instance","pathname","location","split","pop","areaState","decodeURIComponent","getInstance","HISTORY_STRATEGY","SchmancyArea","$LitElement","css","path","routes","default","x","isPresent","catchError","EMPTY","firstUpdated","merge","switchMap","getComponentFromPathname","silent","take","target","takeUntil","disconnecting","distinctUntilChanged","a","b","aComponent","bComponent","replaceAll","toLowerCase","c","Promise","from","exports","t","document","createElement","HTMLElement","prev","curr","tagName","oldView","shadowRoot","children","oldViewExists","remove","classList","add","append","animate","opacity","duration","easing","fill","pushState","newPath","includes","tag","oldPathname","oldAreaState","queryParams","clearQueryParams","queryParamClear","search","concat","urlParams","URLSearchParams","param","delete","toString","checkForTeleportationRequests","disconnectedCallback","super","render","html","__decorateClass","property","prototype","customElement"],"mappings":";;;;;;;;AAIa,MAAAA,IAAgB,IAAIC,KAEpBC,IAAkB,mBAClBC,IAAa;AAQ1B,MAAMC,EAAAA;AAAAA,EAcL,cAAAC;AAZAC,SAAOC,YAAAA,IACPD,KAAOE,OAA6B,WAC7BF,KAAAG,UAAU,IAAIC,EAA2B,CACzCJ,GAAAA,KAAAK,8BAAcC,OACdN,KAAAO,WAAW,IAAIH,EAAwC,CAGtDJ,GAAAA,KAAAQ,mCAAmBF,OAE3BN,KAAOS,oBAAoB,IACnBT,KAAAU,sBAAsB,IAAIC,YAA6Cf,CAGzEI,GAAAA,KAAAO,SAASK,KAAKZ,KAAKK,OAAAA,GAGnBL,KAAAO,SAASM,UAA0BC,OAAAA;AAE1BA,QAAAC,QAAQ,CAACC,GAAOC,MAERjB;AAAAA,aAAKkB,uBAAuBD,CA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lit/directives/class-map.js"),require("lit/directives/style-map.js");const y=require("./litElement.mixin-CHvyxfxf.cjs");require("./tailwind.mixin-Dm5QDZav.cjs");const l=require("lit"),h=require("lit/decorators.js"),g=require("./index-DyJ0oDpR.cjs"),S=new a.Subject,d="FINDING_MORTIES",f="HERE_RICKY";class p{constructor(){this.prettyURL=!1,this.mode="HISTORY",this.request=new a.ReplaySubject(1),this.current=new Map,this.$current=new a.ReplaySubject(1),this.areaSubjects=new Map,this.enableHistoryMode=!0,this.findingMortiesEvent=new CustomEvent(d),this.$current.next(this.current),this.$current.subscribe(t=>{t.forEach((e,r)=>{this.getOrCreateAreaSubject(r).next(e)})})}getOrCreateAreaSubject(t){if(!this.areaSubjects.has(t)){const r=new a.ReplaySubject(1);this.areaSubjects.set(t,r);const o=this.current.get(t);o&&r.next({...o,state:o.state||{},params:o.params||{}})}const e=this.areaSubjects.get(t);if(!e)throw new Error(`Failed to create or retrieve subject for area: ${t}`);return e}on(t,e=!1){const r=this.getOrCreateAreaSubject(t);return e?r.pipe(a.skip(1)):r.asObservable()}all(t=!1){return t?this.$current.pipe(a.skip(1)):this.$current.asObservable()}getState(t){return this.on(t).pipe(a.map(e=>e.state),a.filter(e=>e!==void 0),a.map(e=>e))}params(t){return this.on(t).pipe(a.map(e=>e.params),a.filter(e=>e!==void 0),a.map(e=>e))}param(t,e){return this.params(t).pipe(a.map(r=>r[e]),a.filter(r=>r!==void 0),a.map(r=>r))}find(){return a.zip([a.fromEvent(window,f).pipe(a.map(t=>t.detail),a.bufferTime(0),a.tap(console.log)),a.of(1).pipe(a.tap(()=>window.dispatchEvent(this.findingMortiesEvent)))]).pipe(a.map(([t])=>t),a.timeout(1))}push(t){const e={...t,state:t.state||{},params:t.params||{}};this.request.next(e),this.dispatchAreaEvent(e.area,e)}dispatchAreaEvent(t,e){const r=new CustomEvent(`schmancy-area-${t}-changed`,{detail:{area:t,component:e.component,state:e.state,params:e.params,historyStrategy:e.historyStrategy},bubbles:!0,composed:!0});window.dispatchEvent(r)}pop(t){const e=JSON.parse(JSON.stringify(i.state));delete e[t],history.replaceState(null,"",encodeURIComponent(JSON.stringify(e)))}static getInstance(){return p.instance||(p.instance=new p),p.instance}get state(){const t=location.pathname.split("/").pop();let e={};try{e=t?JSON.parse(decodeURIComponent(t)):{}}catch{e={}}return e}}const i=p.getInstance();var c=(n=>(n.push="push",n.replace="replace",n.pop="pop",n.silent="silent",n))(c||{}),w=Object.defineProperty,E=Object.getOwnPropertyDescriptor,u=(n,t,e,r)=>{for(var o,s=r>1?void 0:r?E(t,e):t,m=n.length-1;m>=0;m--)(o=n[m])&&(s=(r?o(t,e,s):o(s))||s);return r&&s&&w(t,e,s),s};exports.SchmancyArea=class extends y.$LitElement(l.css`
|
|
2
|
+
:host {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: block;
|
|
5
|
+
inset: 0;
|
|
6
|
+
}
|
|
7
|
+
`){getComponentFromPathname(n,t){return a.of(n).pipe(a.map(e=>e.split("/").pop()??""),a.map(e=>decodeURIComponent(e)),a.map(e=>JSON.parse(e)),a.map(e=>e[this.name]),a.map(e=>!e&&this.default?{component:this.default,state:void 0}:e),a.filter(e=>g.libExports.isPresent(e)),a.map(e=>({area:this.name,component:e.component??this.default,state:e.state,historyStrategy:t})),a.map(e=>e),a.catchError(()=>this.default?a.of({area:this.name,component:this.default,historyStrategy:t}):a.EMPTY))}firstUpdated(){if(!this.name)throw new Error("Area name or default component not set");a.merge(a.of(location.pathname).pipe(a.switchMap(n=>this.getComponentFromPathname(n,c.silent)),a.map(n=>n),a.take(1)),i.request.pipe(a.filter(({area:n})=>n===this.name)),a.fromEvent(window,"popstate").pipe(a.map(n=>n.target.location.pathname),a.switchMap(n=>this.getComponentFromPathname(n,c.silent)),a.map(n=>n))).pipe(a.filter(n=>!!n.component),a.takeUntil(this.disconnecting),a.distinctUntilChanged((n,t)=>{let e,r;return typeof n.component!="function"&&(typeof n.component=="string"&&(e=n.component),typeof t.component!="function"&&(typeof t.component=="string"&&(r=t.component),(r==null?void 0:r.replaceAll("-","").toLowerCase())===(e==null?void 0:e.replaceAll("-","").toLowerCase())))})).pipe(a.switchMap(n=>{const t=n.component;return t instanceof Promise?a.from(t).pipe(a.map(e=>({component:e.exports.default,route:n}))):a.of({component:t,route:n})}),a.map(({component:n,route:t})=>typeof n=="string"?{component:document.createElement(n),route:t}:n instanceof HTMLElement?{component:n,route:t}:typeof n=="function"?{component:new n,route:t}:void 0),a.distinctUntilChanged((n,t)=>n.component.tagName===t.component.tagName),a.map(({component:n,route:t})=>{var o,s;const e=(o=this.shadowRoot)==null?void 0:o.children[0],r=!!e;return e.remove(),n.classList.add("opacity-0"),(s=this.shadowRoot)==null||s.append(n),n.animate([{opacity:0},{opacity:1}],{duration:r?150:100,easing:"cubic-bezier(0.25, 0.8, 0.25, 1)",fill:"forwards"}),{component:n,route:t}}),a.tap(({component:n,route:t})=>{t.historyStrategy===void 0||t.historyStrategy==="push"?history.pushState(t.state,"",this.newPath(n.tagName,t)):t.historyStrategy&&["replace","pop"].includes(t.historyStrategy)&&history.replaceState(t.state,"",this.newPath(n.tagName,t)),i.current.set(this.name,{component:n.tagName,state:t.state||{},area:this.name,params:t.params||{}}),i.$current.next(i.current)}),a.takeUntil(this.disconnecting)).subscribe()}newPath(n,t){const e=location.pathname.split("/").pop();let r={};try{r=e?JSON.parse(decodeURIComponent(e)):{}}catch{r={}}t.state=t.state??{};const o=t.clearQueryParams?this.queryParamClear(t.clearQueryParams):document.location.search;return encodeURIComponent(JSON.stringify({...r,[this.name]:{component:n.toLowerCase(),state:t.state,params:t.params}})).concat(`${o}`)}queryParamClear(n){if(!n)return"";const t=new URLSearchParams(location.search);return n.forEach(e=>t.delete(e)),t.toString()===""?"":`?${t.toString()}`}checkForTeleportationRequests(){return a.fromEvent(window,"FLIP_REQUEST").pipe(a.map(n=>n.detail),a.bufferTime(0),a.tap(()=>{this.dispatchEvent(new CustomEvent("FLIP_STARTED"))}),a.takeUntil(this.disconnecting),a.timeout(0),a.catchError(()=>a.of(null)))}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}render(){return l.html` <slot> </slot> `}},u([h.property()],exports.SchmancyArea.prototype,"name",2),u([h.property()],exports.SchmancyArea.prototype,"default",2),exports.SchmancyArea=u([h.customElement("schmancy-area")],exports.SchmancyArea),exports.FINDING_MORTIES=d,exports.HERE_RICKY=f,exports.HISTORY_STRATEGY=c,exports.area=i,exports.routerHistory=S;
|
|
8
|
+
//# sourceMappingURL=area.component-WxccFh1z.cjs.map
|