@mhmo91/schmancy 0.2.126 → 0.2.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{animated-text-CR7nS6VW.js → animated-text-BJXm6krF.js} +3 -3
- package/dist/{animated-text-CR7nS6VW.js.map → animated-text-BJXm6krF.js.map} +1 -1
- package/dist/{animated-text-C7Kwa_OI.cjs → animated-text-rLaot0v2.cjs} +2 -2
- package/dist/{animated-text-C7Kwa_OI.cjs.map → animated-text-rLaot0v2.cjs.map} +1 -1
- package/dist/animated-text.cjs +1 -1
- package/dist/animated-text.js +1 -1
- package/dist/area.cjs +1 -1
- package/dist/{area.component-AypdoH-o.cjs → area.component-CP5oin2j.cjs} +2 -2
- package/dist/{area.component-AypdoH-o.cjs.map → area.component-CP5oin2j.cjs.map} +1 -1
- package/dist/{area.component-DP34t7HX.js → area.component-DlAEUmgd.js} +3 -3
- package/dist/{area.component-DP34t7HX.js.map → area.component-DlAEUmgd.js.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-DtXL-EYa.js → autocomplete-Bbi68nzP.js} +3 -3
- package/dist/{autocomplete-DtXL-EYa.js.map → autocomplete-Bbi68nzP.js.map} +1 -1
- package/dist/{autocomplete-BrXYON3m.cjs → autocomplete-DEUfHcCH.cjs} +2 -2
- package/dist/{autocomplete-BrXYON3m.cjs.map → autocomplete-DEUfHcCH.cjs.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-D9hGlFti.cjs → checkbox-DrrcDAjr.cjs} +2 -2
- package/dist/{checkbox-D9hGlFti.cjs.map → checkbox-DrrcDAjr.cjs.map} +1 -1
- package/dist/{checkbox-C6z4niEj.js → checkbox-N_JVa-1W.js} +2 -2
- package/dist/{checkbox-C6z4niEj.js.map → checkbox-N_JVa-1W.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-wP7Z-qFr.cjs → chips-DrYrCyTG.cjs} +2 -2
- package/dist/{chips-wP7Z-qFr.cjs.map → chips-DrYrCyTG.cjs.map} +1 -1
- package/dist/{chips-De6Vldxt.js → chips-DuSV3Pg2.js} +3 -3
- package/dist/{chips-De6Vldxt.js.map → chips-DuSV3Pg2.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/{context-object-CVqtbNDv.js → context-object-CD26Iary.js} +20 -17
- package/dist/context-object-CD26Iary.js.map +1 -0
- package/dist/context-object-D81PeS3j.cjs +2 -0
- package/dist/context-object-D81PeS3j.cjs.map +1 -0
- package/dist/{date-range-rIm4WhKI.js → date-range-6fQ4ypDJ.js} +3 -3
- package/dist/{date-range-rIm4WhKI.js.map → date-range-6fQ4ypDJ.js.map} +1 -1
- package/dist/{date-range-BHtt61m5.cjs → date-range-DoZNetuD.cjs} +2 -2
- package/dist/{date-range-BHtt61m5.cjs.map → date-range-DoZNetuD.cjs.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-PEhN0JaA.js → delay-CSAsNZ4k.js} +2 -2
- package/dist/{delay-PEhN0JaA.js.map → delay-CSAsNZ4k.js.map} +1 -1
- package/dist/{delay-xd8PmM2r.cjs → delay-WrR6CJK_.cjs} +2 -2
- package/dist/{delay-xd8PmM2r.cjs.map → delay-WrR6CJK_.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{divider-B_GBA6wG.js → divider-ByXACxEQ.js} +3 -3
- package/dist/{divider-B_GBA6wG.js.map → divider-ByXACxEQ.js.map} +1 -1
- package/dist/{divider-CW3prtEN.cjs → divider-Cl2Thq2Y.cjs} +2 -2
- package/dist/{divider-CW3prtEN.cjs.map → divider-Cl2Thq2Y.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-Cmd1vWus.js → flex-BGVyAdBX.js} +2 -2
- package/dist/{flex-Cmd1vWus.js.map → flex-BGVyAdBX.js.map} +1 -1
- package/dist/{flex-CbweZ1uz.cjs → flex-DeB79N0h.cjs} +2 -2
- package/dist/{flex-CbweZ1uz.cjs.map → flex-DeB79N0h.cjs.map} +1 -1
- package/dist/{form-qGZu5wRz.js → form-DATARECy.js} +2 -2
- package/dist/{form-qGZu5wRz.js.map → form-DATARECy.js.map} +1 -1
- package/dist/{form-GwdkWkeq.cjs → form-Dkh-YG_8.cjs} +2 -2
- package/dist/{form-GwdkWkeq.cjs.map → form-Dkh-YG_8.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-DYd0ia3y.cjs → icon-BbqYaRVu.cjs} +2 -2
- package/dist/{icon-DYd0ia3y.cjs.map → icon-BbqYaRVu.cjs.map} +1 -1
- package/dist/{icon-0jYWClYF.js → icon-BdqEZEF8.js} +3 -3
- package/dist/{icon-0jYWClYF.js.map → icon-BdqEZEF8.js.map} +1 -1
- package/dist/{icon-button-CNn-TBQr.cjs → icon-button-BUUtmKnu.cjs} +2 -2
- package/dist/{icon-button-CNn-TBQr.cjs.map → icon-button-BUUtmKnu.cjs.map} +1 -1
- package/dist/{icon-button-Cb9UFHRA.js → icon-button-DlnuclQQ.js} +3 -3
- package/dist/{icon-button-Cb9UFHRA.js.map → icon-button-DlnuclQQ.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +118 -105
- package/dist/{input-BwUKlNLv.js → input-BDUd1ZGs.js} +2 -2
- package/dist/{input-BwUKlNLv.js.map → input-BDUd1ZGs.js.map} +1 -1
- package/dist/{input-BDvmjqzB.cjs → input-B_MWCRet.cjs} +2 -2
- package/dist/{input-BDvmjqzB.cjs.map → input-B_MWCRet.cjs.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-nuLmomtu.js → list-D0J2ndMA.js} +2 -2
- package/dist/{list-nuLmomtu.js.map → list-D0J2ndMA.js.map} +1 -1
- package/dist/{list-DGZ8nQDV.cjs → list-UOeNjOTt.cjs} +2 -2
- package/dist/{list-DGZ8nQDV.cjs.map → list-UOeNjOTt.cjs.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-CsMY3rsN.cjs → litElement.mixin-CfkMd-bR.cjs} +2 -2
- package/dist/{litElement.mixin-CsMY3rsN.cjs.map → litElement.mixin-CfkMd-bR.cjs.map} +1 -1
- package/dist/{litElement.mixin-KVNPHS0h.js → litElement.mixin-PXLBM6N4.js} +2 -2
- package/dist/{litElement.mixin-KVNPHS0h.js.map → litElement.mixin-PXLBM6N4.js.map} +1 -1
- package/dist/{menu-BoAxrHvz.cjs → menu-B4k2_5rl.cjs} +2 -2
- package/dist/{menu-BoAxrHvz.cjs.map → menu-B4k2_5rl.cjs.map} +1 -1
- package/dist/{menu-DCdcWg1Q.js → menu-D7PxtMOz.js} +3 -3
- package/dist/{menu-DCdcWg1Q.js.map → menu-D7PxtMOz.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.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-BOoGEXyd.cjs → option-hsAZB8ji.cjs} +2 -2
- package/dist/{option-BOoGEXyd.cjs.map → option-hsAZB8ji.cjs.map} +1 -1
- package/dist/{option-04xx4j0z.js → option-vV2BM1B_.js} +2 -2
- package/dist/{option-04xx4j0z.js.map → option-vV2BM1B_.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{outlet-C9H_6XOK.cjs → outlet-DMOeEL6g.cjs} +2 -2
- package/dist/{outlet-C9H_6XOK.cjs.map → outlet-DMOeEL6g.cjs.map} +1 -1
- package/dist/{outlet-DlGwFO9i.js → outlet-DRaXjbOY.js} +2 -2
- package/dist/{outlet-DlGwFO9i.js.map → outlet-DRaXjbOY.js.map} +1 -1
- package/dist/{payment-card-form-DtcRjZp8.js → payment-card-form-8oXgNTFN.js} +3 -3
- package/dist/{payment-card-form-DtcRjZp8.js.map → payment-card-form-8oXgNTFN.js.map} +1 -1
- package/dist/{payment-card-form-BaysKg6Z.cjs → payment-card-form-DfbqzyTv.cjs} +2 -2
- package/dist/{payment-card-form-BaysKg6Z.cjs.map → payment-card-form-DfbqzyTv.cjs.map} +1 -1
- package/dist/{radio-group-BV6zZQBP.cjs → radio-group-CLt-d-Ni.cjs} +2 -2
- package/dist/{radio-group-BV6zZQBP.cjs.map → radio-group-CLt-d-Ni.cjs.map} +1 -1
- package/dist/{radio-group-BPFwj4dx.js → radio-group-DRXtgyf5.js} +2 -2
- package/dist/{radio-group-BPFwj4dx.js.map → radio-group-DRXtgyf5.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{schmancy-steps-container-CT4W6h4t.js → schmancy-steps-container-D1k0kjKI.js} +2 -2
- package/dist/{schmancy-steps-container-CT4W6h4t.js.map → schmancy-steps-container-D1k0kjKI.js.map} +1 -1
- package/dist/{schmancy-steps-container-CQp7mdgo.cjs → schmancy-steps-container-DguK5NK4.cjs} +2 -2
- package/dist/{schmancy-steps-container-CQp7mdgo.cjs.map → schmancy-steps-container-DguK5NK4.cjs.map} +1 -1
- package/dist/{select-DUqzjckq.cjs → select-BUUelLow.cjs} +2 -2
- package/dist/{select-DUqzjckq.cjs.map → select-BUUelLow.cjs.map} +1 -1
- package/dist/{select-BqN9V7cw.js → select-By_Pm8TG.js} +3 -3
- package/dist/{select-BqN9V7cw.js.map → select-By_Pm8TG.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/selector-hook-9dSW11-1.js +274 -0
- package/dist/selector-hook-9dSW11-1.js.map +1 -0
- package/dist/selector-hook-CH-z8W2d.cjs +2 -0
- package/dist/selector-hook-CH-z8W2d.cjs.map +1 -0
- package/dist/{sheet-PKhdztII.js → sheet-CHow9LJ8.js} +3 -3
- package/dist/{sheet-PKhdztII.js.map → sheet-CHow9LJ8.js.map} +1 -1
- package/dist/{sheet-RxCJqnwE.cjs → sheet-CyZB5a4W.cjs} +2 -2
- package/dist/{sheet-RxCJqnwE.cjs.map → sheet-CyZB5a4W.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-DKZODC7g.js → slider-BORUoU4I.js} +3 -3
- package/dist/{slider-DKZODC7g.js.map → slider-BORUoU4I.js.map} +1 -1
- package/dist/{slider-Cw5jFlAO.cjs → slider-DCRfwhaP.cjs} +2 -2
- package/dist/{slider-Cw5jFlAO.cjs.map → slider-DCRfwhaP.cjs.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-Cr6ZRUW_.js → spinner-C-rMlbyB.js} +3 -3
- package/dist/{spinner-Cr6ZRUW_.js.map → spinner-C-rMlbyB.js.map} +1 -1
- package/dist/{spinner-BIT7SlWT.cjs → spinner-DeHbns2e.cjs} +2 -2
- package/dist/{spinner-BIT7SlWT.cjs.map → spinner-DeHbns2e.cjs.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.js +30 -17
- package/dist/{surface-BwHzF1Al.js → surface-HAEl5c8W.js} +2 -2
- package/dist/{surface-BwHzF1Al.js.map → surface-HAEl5c8W.js.map} +1 -1
- package/dist/{surface-CU_71bTu.cjs → surface-TpxKBWnD.cjs} +2 -2
- package/dist/{surface-CU_71bTu.cjs.map → surface-TpxKBWnD.cjs.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-CAAYvRWb.js → table-D7KL2FaN.js} +166 -164
- package/dist/table-D7KL2FaN.js.map +1 -0
- package/dist/table-DXPDEHEh.cjs +65 -0
- package/dist/table-DXPDEHEh.cjs.map +1 -0
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-group-DKgFtkF4.cjs → tabs-group-CR2cSCNr.cjs} +2 -2
- package/dist/{tabs-group-DKgFtkF4.cjs.map → tabs-group-CR2cSCNr.cjs.map} +1 -1
- package/dist/{tabs-group-3mMfpHn0.js → tabs-group-Dm_FCj7q.js} +2 -2
- package/dist/{tabs-group-3mMfpHn0.js.map → tabs-group-Dm_FCj7q.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-CjSVtdHt.cjs +2 -0
- package/dist/{tailwind.mixin-BAMa8YNR.cjs.map → tailwind.mixin-CjSVtdHt.cjs.map} +1 -1
- package/dist/tailwind.mixin-Cxj7n9Jd.js +43 -0
- package/dist/{tailwind.mixin-BQyZrGP1.js.map → tailwind.mixin-Cxj7n9Jd.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-CrOAEYhZ.js → teleport.component-CBNKUZwe.js} +38 -38
- package/dist/{teleport.component-CrOAEYhZ.js.map → teleport.component-CBNKUZwe.js.map} +1 -1
- package/dist/{teleport.component-Cmbvbylw.cjs → teleport.component-CplIV2h1.cjs} +2 -2
- package/dist/{teleport.component-Cmbvbylw.cjs.map → teleport.component-CplIV2h1.cjs.map} +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-BX6iD8ez.cjs → textarea-CLlh5-HA.cjs} +2 -2
- package/dist/{textarea-BX6iD8ez.cjs.map → textarea-CLlh5-HA.cjs.map} +1 -1
- package/dist/{textarea-DrtTwsZf.js → textarea-DcSAsR60.js} +2 -2
- package/dist/{textarea-DrtTwsZf.js.map → textarea-DcSAsR60.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-C8uLYaSN.cjs → theme-button-53Mhj3kQ.cjs} +2 -2
- package/dist/{theme-button-C8uLYaSN.cjs.map → theme-button-53Mhj3kQ.cjs.map} +1 -1
- package/dist/{theme-button-BedwumBT.js → theme-button-B7_LXWoe.js} +2 -2
- package/dist/{theme-button-BedwumBT.js.map → theme-button-B7_LXWoe.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-DvlxAH1p.cjs → theme.component-Drmkh4sF.cjs} +2 -2
- package/dist/{theme.component-DvlxAH1p.cjs.map → theme.component-Drmkh4sF.cjs.map} +1 -1
- package/dist/{theme.component-zxDCAaxd.js → theme.component-yFb6vlsT.js} +2 -2
- package/dist/{theme.component-zxDCAaxd.js.map → theme.component-yFb6vlsT.js.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-1BrrQMHz.js → timezone-DxkvIe7V.js} +3 -3
- package/dist/{timezone-1BrrQMHz.js.map → timezone-DxkvIe7V.js.map} +1 -1
- package/dist/{timezone-D14kTMKK.cjs → timezone-enXRjPy1.cjs} +2 -2
- package/dist/{timezone-D14kTMKK.cjs.map → timezone-enXRjPy1.cjs.map} +1 -1
- package/dist/{tree-C_TPLHEo.cjs → tree-Bt4J6QVI.cjs} +2 -2
- package/dist/{tree-C_TPLHEo.cjs.map → tree-Bt4J6QVI.cjs.map} +1 -1
- package/dist/{tree-DuaRuwS9.js → tree-CQccoc9W.js} +2 -2
- package/dist/{tree-DuaRuwS9.js.map → tree-CQccoc9W.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-Fim6s-vF.js → typewriter-DGserMVU.js} +4 -4
- package/dist/{typewriter-Fim6s-vF.js.map → typewriter-DGserMVU.js.map} +1 -1
- package/dist/{typewriter-C2NQzIJ9.cjs → typewriter-WqDo75_3.cjs} +2 -2
- package/dist/{typewriter-C2NQzIJ9.cjs.map → typewriter-WqDo75_3.cjs.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-C4RygG_b.js → typography-D5E46rwN.js} +2 -2
- package/dist/{typography-C4RygG_b.js.map → typography-D5E46rwN.js.map} +1 -1
- package/dist/{typography-f0kdRUDj.cjs → typography-DbNitvGl.cjs} +2 -2
- package/dist/{typography-f0kdRUDj.cjs.map → typography-DbNitvGl.cjs.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +1 -1
- package/types/src/store/context-create.d.ts +15 -2
- package/types/src/store/filter-directive.d.ts +38 -11
- package/types/src/store/selector-hook.d.ts +27 -0
- package/types/src/store/selectors.d.ts +30 -1
- package/types/src/store/storage-manager.d.ts +6 -14
- package/types/src/store/types.d.ts +100 -45
- package/types/src/table/row.d.ts +8 -7
- package/types/src/table/table.d.ts +11 -5
- package/dist/context-object-CVqtbNDv.js.map +0 -1
- package/dist/context-object-CgZ6F8E9.cjs +0 -2
- package/dist/context-object-CgZ6F8E9.cjs.map +0 -1
- package/dist/selector-hook-B5oIBdcJ.cjs +0 -2
- package/dist/selector-hook-B5oIBdcJ.cjs.map +0 -1
- package/dist/selector-hook-BdsJkaE2.js +0 -185
- package/dist/selector-hook-BdsJkaE2.js.map +0 -1
- package/dist/table-B3lX6zue.cjs +0 -80
- package/dist/table-B3lX6zue.cjs.map +0 -1
- package/dist/table-CAAYvRWb.js.map +0 -1
- package/dist/tailwind.mixin-BAMa8YNR.cjs +0 -2
- package/dist/tailwind.mixin-BQyZrGP1.js +0 -43
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ICollectionStore, IStore } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Property descriptor interface
|
|
4
|
+
*/
|
|
2
5
|
type PropertyDescriptor<T> = {
|
|
3
6
|
get?: () => T;
|
|
4
7
|
set?: (value: T) => void;
|
|
@@ -7,9 +10,33 @@ type PropertyDescriptor<T> = {
|
|
|
7
10
|
enumerable?: boolean;
|
|
8
11
|
writable?: boolean;
|
|
9
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Options for selecting from a store
|
|
15
|
+
*/
|
|
10
16
|
interface SelectOptions {
|
|
17
|
+
/** If true, will wait for selector to emit a non-null value before calling connectedCallback */
|
|
11
18
|
required?: boolean;
|
|
19
|
+
/** If true, will only update the component and not set the property value */
|
|
12
20
|
updateOnly?: boolean;
|
|
21
|
+
/** If true, will use structuredClone to deeply clone values (prevents mutations) */
|
|
22
|
+
deepClone?: boolean;
|
|
23
|
+
/** Custom equality function to determine when to update */
|
|
24
|
+
equals?: (a: any, b: any) => boolean;
|
|
13
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Selector decorator that connects a component property to a store selector
|
|
28
|
+
*
|
|
29
|
+
* @param store The store to select from
|
|
30
|
+
* @param selectorFn Optional function to transform the store state
|
|
31
|
+
* @param options Additional options for the selector
|
|
32
|
+
*/
|
|
14
33
|
export declare function select<T, R>(store: IStore<T> | ICollectionStore<T>, selectorFn?: (state: any) => R, options?: SelectOptions): (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<R>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a selector decorator that selects a specific item from a collection store
|
|
36
|
+
*
|
|
37
|
+
* @param store The collection store
|
|
38
|
+
* @param keyGetter Function that returns the key to select
|
|
39
|
+
* @param options Additional options
|
|
40
|
+
*/
|
|
41
|
+
export declare function selectItem<T>(store: ICollectionStore<T>, keyGetter: (component: any) => string, options?: SelectOptions): (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<T | undefined>) => void;
|
|
15
42
|
export {};
|
|
@@ -16,6 +16,13 @@ export declare function createSelector<T, R>(store: IStore<T>, selectorFn: (stat
|
|
|
16
16
|
* @returns An observable of the selected state that only emits when the derived value changes
|
|
17
17
|
*/
|
|
18
18
|
export declare function createCollectionSelector<T, R>(store: ICollectionStore<T>, selectorFn: (state: Map<string, T>) => R): Observable<R>;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a selector that returns all items from a collection as an array
|
|
21
|
+
*
|
|
22
|
+
* @param store The collection store
|
|
23
|
+
* @returns An observable of all items as an array
|
|
24
|
+
*/
|
|
25
|
+
export declare function createItemsSelector<T>(store: ICollectionStore<T>): Observable<T[]>;
|
|
19
26
|
/**
|
|
20
27
|
* Creates a selector that filters items from a collection
|
|
21
28
|
*
|
|
@@ -47,4 +54,26 @@ export declare function createCountSelector<T>(store: ICollectionStore<T>, filte
|
|
|
47
54
|
* @param combinerFn Function that combines all selector results
|
|
48
55
|
* @returns An observable of the combined result
|
|
49
56
|
*/
|
|
50
|
-
export declare function createCompoundSelector<
|
|
57
|
+
export declare function createCompoundSelector<T extends unknown[], R>(selectors: {
|
|
58
|
+
[K in keyof T]: Observable<T[K]>;
|
|
59
|
+
}, combinerFn: (...values: T) => R): Observable<R>;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a selector that returns all keys from a collection
|
|
62
|
+
*/
|
|
63
|
+
export declare function createKeysSelector<T>(store: ICollectionStore<T>): Observable<string[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Creates a selector that returns entries (key-value pairs) from a collection
|
|
66
|
+
*/
|
|
67
|
+
export declare function createEntriesSelector<T>(store: ICollectionStore<T>): Observable<[string, T][]>;
|
|
68
|
+
/**
|
|
69
|
+
* Creates a selector that maps collection values through a transform function
|
|
70
|
+
*/
|
|
71
|
+
export declare function createMapSelector<T, R>(store: ICollectionStore<T>, mapFn: (item: T, key: string) => R): Observable<R[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a selector that sorts collection items
|
|
74
|
+
*/
|
|
75
|
+
export declare function createSortSelector<T>(store: ICollectionStore<T>, compareFn: (a: T, b: T) => number): Observable<T[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a selector that finds the first item matching a predicate
|
|
78
|
+
*/
|
|
79
|
+
export declare function createFindSelector<T>(store: ICollectionStore<T>, predicate: (item: T, key: string) => boolean): Observable<T | undefined>;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import { StorageType } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Storage manager interface with generic typing
|
|
4
|
-
*/
|
|
5
|
-
export interface StorageManager<T> {
|
|
6
|
-
load(): Promise<T | null>;
|
|
7
|
-
save(state: T): Promise<void>;
|
|
8
|
-
clear(): Promise<void>;
|
|
9
|
-
}
|
|
1
|
+
import { IStorageManager, StorageType } from './types';
|
|
10
2
|
/**
|
|
11
3
|
* Memory storage manager implementation
|
|
12
4
|
*/
|
|
13
|
-
export declare class MemoryStorageManager<T> implements
|
|
5
|
+
export declare class MemoryStorageManager<T> implements IStorageManager<T> {
|
|
14
6
|
private data;
|
|
15
7
|
load(): Promise<T | null>;
|
|
16
8
|
save(state: T): Promise<void>;
|
|
@@ -19,7 +11,7 @@ export declare class MemoryStorageManager<T> implements StorageManager<T> {
|
|
|
19
11
|
/**
|
|
20
12
|
* Local storage manager implementation
|
|
21
13
|
*/
|
|
22
|
-
export declare class LocalStorageManager<T> implements
|
|
14
|
+
export declare class LocalStorageManager<T> implements IStorageManager<T> {
|
|
23
15
|
private key;
|
|
24
16
|
constructor(key: string);
|
|
25
17
|
load(): Promise<T | null>;
|
|
@@ -29,7 +21,7 @@ export declare class LocalStorageManager<T> implements StorageManager<T> {
|
|
|
29
21
|
/**
|
|
30
22
|
* Session storage manager implementation
|
|
31
23
|
*/
|
|
32
|
-
export declare class SessionStorageManager<T> implements
|
|
24
|
+
export declare class SessionStorageManager<T> implements IStorageManager<T> {
|
|
33
25
|
private key;
|
|
34
26
|
constructor(key: string);
|
|
35
27
|
load(): Promise<T | null>;
|
|
@@ -39,7 +31,7 @@ export declare class SessionStorageManager<T> implements StorageManager<T> {
|
|
|
39
31
|
/**
|
|
40
32
|
* IndexedDB storage manager implementation with better error typing
|
|
41
33
|
*/
|
|
42
|
-
export declare class IndexedDBStorageManager<T> implements
|
|
34
|
+
export declare class IndexedDBStorageManager<T> implements IStorageManager<T> {
|
|
43
35
|
private key;
|
|
44
36
|
private static DB_NAME;
|
|
45
37
|
private static STORE_NAME;
|
|
@@ -53,4 +45,4 @@ export declare class IndexedDBStorageManager<T> implements StorageManager<T> {
|
|
|
53
45
|
/**
|
|
54
46
|
* Factory function to create the appropriate storage manager
|
|
55
47
|
*/
|
|
56
|
-
export declare function createStorageManager<T>(type: StorageType, key: string):
|
|
48
|
+
export declare function createStorageManager<T>(type: StorageType, key: string): IStorageManager<T>;
|
|
@@ -17,68 +17,123 @@ export interface StoreOptions<T> {
|
|
|
17
17
|
devTools?: boolean;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
export interface Action<T = any> {
|
|
23
|
-
type: string;
|
|
24
|
-
payload?: T;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Type-safe action creator
|
|
28
|
-
*/
|
|
29
|
-
export type ActionCreator<P = void, R = void> = P extends void ? () => R : (payload: P) => R;
|
|
30
|
-
/**
|
|
31
|
-
* Map of action creators with preserved function signatures
|
|
32
|
-
*/
|
|
33
|
-
export type ActionCreatorMap<T> = {
|
|
34
|
-
[K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => R : never;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Reducer function type
|
|
38
|
-
*/
|
|
39
|
-
export type Reducer<T> = (state: T, action: Action) => T;
|
|
40
|
-
/**
|
|
41
|
-
* Middleware function type
|
|
42
|
-
*/
|
|
43
|
-
export type Middleware<T> = (prevState: T, nextState: T, context: {
|
|
44
|
-
type: string;
|
|
45
|
-
payload?: any;
|
|
46
|
-
}) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Selector function type
|
|
49
|
-
*/
|
|
50
|
-
export type Selector<S, R> = (state: S) => R;
|
|
51
|
-
/**
|
|
52
|
-
* Enhanced store error with type information
|
|
20
|
+
* Enhanced store error with type information and better context handling
|
|
53
21
|
*/
|
|
54
22
|
export declare class StoreError<T = unknown> extends Error {
|
|
23
|
+
/** Original error that caused this store error */
|
|
55
24
|
readonly cause?: T;
|
|
25
|
+
/** Additional contextual information */
|
|
56
26
|
readonly context?: Record<string, unknown>;
|
|
27
|
+
/** Timestamp when the error occurred */
|
|
28
|
+
readonly timestamp: Date;
|
|
57
29
|
constructor(message: string, cause?: T, context?: Record<string, unknown>);
|
|
30
|
+
/**
|
|
31
|
+
* Returns a JSON-serializable representation of the error
|
|
32
|
+
*/
|
|
33
|
+
toJSON(): Record<string, unknown>;
|
|
58
34
|
}
|
|
59
35
|
/**
|
|
60
|
-
* Core store interface
|
|
36
|
+
* Core store interface with improved type definitions
|
|
61
37
|
*/
|
|
62
|
-
export interface IStore<T
|
|
63
|
-
value
|
|
64
|
-
|
|
38
|
+
export interface IStore<T extends Record<string, any>> {
|
|
39
|
+
/** Get the current store value */
|
|
40
|
+
readonly value: T;
|
|
41
|
+
/** Observable stream of store values */
|
|
42
|
+
readonly $: BehaviorSubject<T>;
|
|
43
|
+
/** The default/initial value of the store */
|
|
44
|
+
readonly defaultValue: T;
|
|
45
|
+
/** Whether the store is ready (loaded from storage) */
|
|
46
|
+
ready: boolean;
|
|
47
|
+
/** Observable stream of store errors */
|
|
48
|
+
readonly error$: Observable<StoreError | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Update store value with partial data
|
|
51
|
+
* @param value Partial data to update
|
|
52
|
+
* @param merge Whether to merge with existing data (default: true)
|
|
53
|
+
*/
|
|
65
54
|
set(value: Partial<T>, merge?: boolean): void;
|
|
55
|
+
/**
|
|
56
|
+
* Reset store to default value
|
|
57
|
+
*/
|
|
66
58
|
clear(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Replace entire store value
|
|
61
|
+
* @param newValue New value to set
|
|
62
|
+
*/
|
|
67
63
|
replace(newValue: T): void;
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Delete a specific key from the store
|
|
66
|
+
* @param key Key to delete
|
|
67
|
+
*/
|
|
68
|
+
delete<K extends keyof T>(key: K): void;
|
|
69
|
+
/**
|
|
70
|
+
* Clean up resources
|
|
71
|
+
*/
|
|
72
|
+
destroy(): void;
|
|
70
73
|
}
|
|
71
74
|
/**
|
|
72
|
-
* Interface for collection stores
|
|
73
|
-
* No longer extends IStore to avoid method signature conflicts
|
|
75
|
+
* Interface for collection stores with improved typing
|
|
74
76
|
*/
|
|
75
77
|
export interface ICollectionStore<T> {
|
|
76
|
-
value
|
|
77
|
-
|
|
78
|
+
/** Get the current collection value */
|
|
79
|
+
readonly value: Map<string, T>;
|
|
80
|
+
/** Observable stream of collection values */
|
|
81
|
+
readonly $: BehaviorSubject<Map<string, T>>;
|
|
82
|
+
/** The default/initial value of the collection */
|
|
83
|
+
readonly defaultValue: Map<string, T>;
|
|
84
|
+
/** Whether the store is ready (loaded from storage) */
|
|
85
|
+
ready: boolean;
|
|
86
|
+
/** Observable stream of store errors */
|
|
87
|
+
readonly error$: Observable<StoreError | null>;
|
|
88
|
+
/**
|
|
89
|
+
* Set a value in the collection
|
|
90
|
+
* @param key Item key
|
|
91
|
+
* @param value Item value
|
|
92
|
+
*/
|
|
78
93
|
set<V = T>(key: string, value: V): void;
|
|
94
|
+
/**
|
|
95
|
+
* Delete an item from the collection
|
|
96
|
+
* @param key Item key to delete
|
|
97
|
+
*/
|
|
79
98
|
delete(key: string): void;
|
|
99
|
+
/**
|
|
100
|
+
* Clear all items from the collection
|
|
101
|
+
*/
|
|
80
102
|
clear(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Replace the entire collection
|
|
105
|
+
* @param newValue New collection value
|
|
106
|
+
*/
|
|
81
107
|
replace(newValue: Map<string, T>): void;
|
|
82
|
-
|
|
83
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Clean up resources
|
|
110
|
+
*/
|
|
111
|
+
destroy(): void;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Interface for a storage manager
|
|
115
|
+
*/
|
|
116
|
+
export interface IStorageManager<T> {
|
|
117
|
+
/**
|
|
118
|
+
* Load data from storage
|
|
119
|
+
* @returns Promise resolving to stored data or null
|
|
120
|
+
*/
|
|
121
|
+
load(): Promise<T | null>;
|
|
122
|
+
/**
|
|
123
|
+
* Save data to storage
|
|
124
|
+
* @param state Data to save
|
|
125
|
+
*/
|
|
126
|
+
save(state: T): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Clear data from storage
|
|
129
|
+
*/
|
|
130
|
+
clear(): Promise<void>;
|
|
84
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Factory function type for creating stores
|
|
134
|
+
*/
|
|
135
|
+
export type StoreFactory = <T extends Record<string, any>>(initialData: T, storage: StorageType, key: string) => IStore<T>;
|
|
136
|
+
/**
|
|
137
|
+
* Factory function type for creating collection stores
|
|
138
|
+
*/
|
|
139
|
+
export type CollectionStoreFactory = <T>(initialData: Map<string, T>, storage: StorageType, key: string) => ICollectionStore<T>;
|
package/types/src/table/row.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
2
|
import { TableColumn } from './table';
|
|
3
3
|
declare const SchmancyTableRow_base: CustomElementConstructor & import("../../mixins").Constructor<import("lit").LitElement> & import("../../mixins").Constructor<import("../../mixins").IBaseMixin>;
|
|
4
|
-
export declare class SchmancyTableRow extends SchmancyTableRow_base {
|
|
5
|
-
columns: TableColumn[];
|
|
6
|
-
item:
|
|
4
|
+
export declare class SchmancyTableRow<T extends Record<string, any> = any> extends SchmancyTableRow_base {
|
|
5
|
+
columns: TableColumn<T>[];
|
|
6
|
+
item: T;
|
|
7
7
|
cols: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Renders a cell based on column configuration.
|
|
10
|
+
* Uses custom render function if provided, otherwise extracts data from item.
|
|
11
|
+
*/
|
|
12
|
+
private renderCell;
|
|
12
13
|
render(): TemplateResult;
|
|
13
14
|
}
|
|
14
15
|
declare global {
|
|
@@ -7,22 +7,28 @@ export interface TableColumn<T extends Record<string, any> = any> {
|
|
|
7
7
|
align?: 'left' | 'right' | 'center';
|
|
8
8
|
weight?: 'normal' | 'bold';
|
|
9
9
|
render?: (item: T) => TemplateResult | string | number;
|
|
10
|
+
sortable?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export interface RowEventDetail<T> {
|
|
12
13
|
item: T;
|
|
13
14
|
index: number;
|
|
14
15
|
}
|
|
16
|
+
export type SortDirection = 'asc' | 'desc' | null;
|
|
15
17
|
declare const SchmancyDataTable_base: CustomElementConstructor & import("../../mixins").Constructor<import("lit").LitElement> & import("../../mixins").Constructor<import("../../mixins").IBaseMixin>;
|
|
16
18
|
export declare class SchmancyDataTable<T extends Record<string, any> = any> extends SchmancyDataTable_base {
|
|
17
19
|
columns: TableColumn<T>[];
|
|
18
20
|
data: T[];
|
|
19
21
|
keyField: keyof T;
|
|
20
22
|
cols: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
sortable: boolean;
|
|
24
|
+
private sortColumn;
|
|
25
|
+
private sortDirection;
|
|
26
|
+
private filteredData;
|
|
27
|
+
constructor();
|
|
28
|
+
protected willUpdate(changedProperties: Map<PropertyKey, unknown>): void;
|
|
29
|
+
private processData;
|
|
30
|
+
private toggleSort;
|
|
31
|
+
private renderSortIndicator;
|
|
26
32
|
render(): TemplateResult;
|
|
27
33
|
}
|
|
28
34
|
declare global {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-object-CVqtbNDv.js","sources":["../src/store/types.ts","../src/store/storage-manager.ts","../src/store/context-collection.ts","../src/store/context-object.ts"],"sourcesContent":["// src/store/types.ts\nimport { BehaviorSubject, Observable } from 'rxjs'\n\n/**\n * Storage types supported by the store\n */\nexport type StorageType = 'memory' | 'local' | 'session' | 'indexeddb'\n\n/**\n * Base store options\n */\nexport interface StoreOptions<T> {\n\t/** Key used for persistent storage */\n\tkey: string\n\t/** Storage type */\n\tstorage: StorageType\n\t/** Initial state */\n\tinitialState: T\n\t/** Enable dev tools */\n\tdevTools?: boolean\n}\n\n/**\n * Action interface for all store actions\n */\nexport interface Action<T = any> {\n\ttype: string\n\tpayload?: T\n}\n\n/**\n * Type-safe action creator\n */\nexport type ActionCreator<P = void, R = void> = P extends void ? () => R : (payload: P) => R\n\n/**\n * Map of action creators with preserved function signatures\n */\nexport type ActionCreatorMap<T> = {\n\t[K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => R : never\n}\n\n/**\n * Reducer function type\n */\nexport type Reducer<T> = (state: T, action: Action) => T\n\n/**\n * Middleware function type\n */\nexport type Middleware<T> = (prevState: T, nextState: T, context: { type: string; payload?: any }) => void\n\n/**\n * Selector function type\n */\nexport type Selector<S, R> = (state: S) => R\n\n/**\n * Enhanced store error with type information\n */\nexport class StoreError<T = unknown> extends Error {\n\tconstructor(message: string, public readonly cause?: T, public readonly context?: Record<string, unknown>) {\n\t\tsuper(message)\n\t\tthis.name = 'StoreError'\n\t}\n}\n\n/**\n * Core store interface\n */\nexport interface IStore<T> {\n\t// Value getters with strong return types\n\tvalue: T\n\t$: BehaviorSubject<T>\n\n\t// Methods with improved parameter and return types\n\tset(value: Partial<T>, merge?: boolean): void\n\tclear(): void\n\treplace(newValue: T): void\n\n\t// Ready state with correct type\n\tready: boolean\n\n\t// Error handling\n\terror$: Observable<StoreError | null>\n}\n\n/**\n * Interface for collection stores\n * No longer extends IStore to avoid method signature conflicts\n */\nexport interface ICollectionStore<T> {\n\t// Value getters with strong return types\n\tvalue: Map<string, T>\n\t$: BehaviorSubject<Map<string, T>>\n\n\t// Methods specific to collections\n\tset<V = T>(key: string, value: V): void\n\tdelete(key: string): void\n\tclear(): void\n\treplace(newValue: Map<string, T>): void\n\n\t// Ready state with correct type\n\tready: boolean\n\n\t// Error handling\n\terror$: Observable<StoreError | null>\n}\n","import { StorageType, StoreError } from './types'\n\n/**\n * Storage manager interface with generic typing\n */\nexport interface StorageManager<T> {\n\tload(): Promise<T | null>\n\tsave(state: T): Promise<void>\n\tclear(): Promise<void>\n}\n\n/**\n * Memory storage manager implementation\n */\nexport class MemoryStorageManager<T> implements StorageManager<T> {\n\tprivate data: T | null = null\n\n\tasync load(): Promise<T | null> {\n\t\treturn this.data\n\t}\n\n\tasync save(state: T): Promise<void> {\n\t\tthis.data = state\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tthis.data = null\n\t}\n}\n\n/**\n * Local storage manager implementation\n */\nexport class LocalStorageManager<T> implements StorageManager<T> {\n\tconstructor(private key: string) {}\n\n\tasync load(): Promise<T | null> {\n\t\ttry {\n\t\t\tconst data = localStorage.getItem(this.key)\n\t\t\treturn data ? JSON.parse(data) : null\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to load from localStorage (${this.key}):`, err)\n\t\t\treturn null\n\t\t}\n\t}\n\n\tasync save(state: T): Promise<void> {\n\t\ttry {\n\t\t\tlocalStorage.setItem(this.key, JSON.stringify(state))\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to save to localStorage (${this.key}):`, err)\n\t\t\tthrow new StoreError<unknown>(`Failed to save to localStorage (${this.key})`, err)\n\t\t}\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tlocalStorage.removeItem(this.key)\n\t}\n}\n\n/**\n * Session storage manager implementation\n */\nexport class SessionStorageManager<T> implements StorageManager<T> {\n\tconstructor(private key: string) {}\n\n\tasync load(): Promise<T | null> {\n\t\ttry {\n\t\t\tconst data = sessionStorage.getItem(this.key)\n\t\t\treturn data ? JSON.parse(data) : null\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to load from sessionStorage (${this.key}):`, err)\n\t\t\treturn null\n\t\t}\n\t}\n\n\tasync save(state: T): Promise<void> {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.key, JSON.stringify(state))\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to save to sessionStorage (${this.key}):`, err)\n\t\t\tthrow new StoreError<unknown>(`Failed to save to sessionStorage (${this.key})`, err)\n\t\t}\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tsessionStorage.removeItem(this.key)\n\t}\n}\n\n/**\n * IndexedDB storage manager implementation with better error typing\n */\nexport class IndexedDBStorageManager<T> implements StorageManager<T> {\n\tprivate static DB_NAME = 'StoreDB'\n\tprivate static STORE_NAME = 'states'\n\tprivate static DB_VERSION = 1\n\n\tconstructor(private key: string) {}\n\n\tprivate openDB(): Promise<IDBDatabase> {\n\t\treturn new Promise<IDBDatabase>((resolve, reject) => {\n\t\t\tconst request = indexedDB.open(IndexedDBStorageManager.DB_NAME, IndexedDBStorageManager.DB_VERSION)\n\n\t\t\trequest.onupgradeneeded = () => {\n\t\t\t\tconst db = request.result\n\t\t\t\tif (!db.objectStoreNames.contains(IndexedDBStorageManager.STORE_NAME)) {\n\t\t\t\t\tdb.createObjectStore(IndexedDBStorageManager.STORE_NAME)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trequest.onsuccess = () => resolve(request.result)\n\t\t\trequest.onerror = () => reject(request.error)\n\t\t})\n\t}\n\n\tasync load(): Promise<T | null> {\n\t\ttry {\n\t\t\tconst db = await this.openDB()\n\t\t\treturn new Promise<T | null>((resolve, reject) => {\n\t\t\t\tconst transaction = db.transaction(IndexedDBStorageManager.STORE_NAME, 'readonly')\n\t\t\t\tconst store = transaction.objectStore(IndexedDBStorageManager.STORE_NAME)\n\t\t\t\tconst request = store.get(this.key)\n\n\t\t\t\trequest.onsuccess = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\tresolve(request.result || null)\n\t\t\t\t}\n\n\t\t\t\trequest.onerror = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\treject(request.error)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to load from IndexedDB (${this.key}):`, err)\n\t\t\treturn null\n\t\t}\n\t}\n\n\tasync save(state: T): Promise<void> {\n\t\ttry {\n\t\t\tconst db = await this.openDB()\n\t\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\t\tconst transaction = db.transaction(IndexedDBStorageManager.STORE_NAME, 'readwrite')\n\t\t\t\tconst store = transaction.objectStore(IndexedDBStorageManager.STORE_NAME)\n\t\t\t\tconst request = store.put(state, this.key)\n\n\t\t\t\trequest.onsuccess = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\tresolve()\n\t\t\t\t}\n\n\t\t\t\trequest.onerror = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\treject(request.error)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to save to IndexedDB (${this.key}):`, err)\n\t\t\tthrow new StoreError<unknown>(`Failed to save to IndexedDB (${this.key})`, err)\n\t\t}\n\t}\n\n\tasync clear(): Promise<void> {\n\t\ttry {\n\t\t\tconst db = await this.openDB()\n\t\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\t\tconst transaction = db.transaction(IndexedDBStorageManager.STORE_NAME, 'readwrite')\n\t\t\t\tconst store = transaction.objectStore(IndexedDBStorageManager.STORE_NAME)\n\t\t\t\tconst request = store.delete(this.key)\n\n\t\t\t\trequest.onsuccess = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\tresolve()\n\t\t\t\t}\n\n\t\t\t\trequest.onerror = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\treject(request.error)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to clear from IndexedDB (${this.key}):`, err)\n\t\t\tthrow new StoreError<unknown>(`Failed to clear from IndexedDB (${this.key})`, err)\n\t\t}\n\t}\n}\n\n/**\n * Factory function to create the appropriate storage manager\n */\nexport function createStorageManager<T>(type: StorageType, key: string): StorageManager<T> {\n\tswitch (type) {\n\t\tcase 'local':\n\t\t\treturn new LocalStorageManager<T>(key)\n\t\tcase 'session':\n\t\t\treturn new SessionStorageManager<T>(key)\n\t\tcase 'indexeddb':\n\t\t\treturn new IndexedDBStorageManager<T>(key)\n\t\tcase 'memory':\n\t\tdefault:\n\t\t\treturn new MemoryStorageManager<T>()\n\t}\n}\n","import { BehaviorSubject, Subject, throttleTime } from 'rxjs'\nimport { ICollectionStore, StorageType, StoreError } from './types'\nimport { createStorageManager, StorageManager } from './storage-manager'\n\n/**\n * Enhanced collection store with better TypeScript support\n */\nexport default class SchmancyCollectionStore<V = any> implements ICollectionStore<V> {\n\tpublic static type = 'collection'\n\n\t// Static map to hold instances\n\tprivate static instances: Map<string, SchmancyCollectionStore<any>> = new Map()\n\n\t// State management\n\tprivate _ready: boolean = false\n\tprivate _destroy$ = new Subject<void>()\n\n\t// Observable streams - modified to match interface requirements\n\tpublic $: BehaviorSubject<Map<string, V>>\n\tpublic error$ = new BehaviorSubject<StoreError | null>(null)\n\n\t// Default value for the store\n\tpublic readonly defaultValue: Map<string, V>\n\n\t// Storage manager\n\tprivate storage: StorageManager<Map<string, V>>\n\n\t/**\n\t * Get ready state\n\t */\n\tpublic get ready(): boolean {\n\t\treturn this._ready\n\t}\n\n\t/**\n\t * Set ready state\n\t */\n\tpublic set ready(value: boolean) {\n\t\tthis._ready = value\n\t\tthis.updateState(this.$.value)\n\t}\n\n\t/**\n\t * Private constructor to enforce singleton pattern\n\t */\n\tprivate constructor(private storageType: StorageType, private key: string, defaultValue: Map<string, V>) {\n\t\tthis.defaultValue = defaultValue\n\t\tthis.$ = new BehaviorSubject<Map<string, V>>(new Map<string, V>())\n\t\tthis.storage = createStorageManager<Map<string, V>>(storageType, key)\n\n\t\t// Initialize from storage\n\t\tthis.initializeFromStorage()\n\n\t\t// Set up persistence\n\t\tthis.setupPersistence()\n\n\t\t// Setup dev tools in development\n\t\tif (import.meta.env.MODE === 'development') {\n\t\t\tthis.setupDevTools()\n\t\t}\n\t}\n\n\t/**\n\t * Static method to get or create an instance with proper typing\n\t */\n\tpublic static getInstance<V = any>(\n\t\tstorage: StorageType,\n\t\tkey: string,\n\t\tdefaultValue: Map<string, V>,\n\t): SchmancyCollectionStore<V> {\n\t\tconst instanceKey = `${storage}:${key}`\n\t\tif (!this.instances.has(instanceKey)) {\n\t\t\tthis.instances.set(instanceKey, new SchmancyCollectionStore<V>(storage, key, defaultValue))\n\t\t}\n\t\treturn this.instances.get(instanceKey) as SchmancyCollectionStore<V>\n\t}\n\n\t/**\n\t * Get the current value\n\t */\n\tpublic get value(): Map<string, V> {\n\t\treturn this.$.getValue()\n\t}\n\n\t/**\n\t * Set a value in the collection with proper typing\n\t */\n\tpublic set<T = V>(key: string, value: T): void {\n\t\ttry {\n\t\t\tconst currentValue = new Map(this.value)\n\t\t\tcurrentValue.set(key, value as unknown as V)\n\t\t\tthis.updateState(currentValue)\n\t\t\tthis.error$.next(null) // Clear any previous errors\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error setting value for key ${key} in ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Delete a value from the collection\n\t */\n\tpublic delete(key: string): void {\n\t\ttry {\n\t\t\tconst currentValue = new Map(this.value)\n\t\t\tcurrentValue.delete(key)\n\t\t\tthis.updateState(currentValue)\n\t\t\tthis.error$.next(null) // Clear any previous errors\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error deleting key ${key} from ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Clear the collection\n\t */\n\tpublic clear(): void {\n\t\tthis.updateState(new Map<string, V>())\n\t}\n\n\tpublic replace(newValue: Map<string, V>): void {\n\t\tthis.updateState(newValue)\n\t}\n\n\t/**\n\t * Update the state with error handling\n\t */\n\tprivate updateState(newValue: Map<string, V>): void {\n\t\ttry {\n\t\t\tthis.$.next(newValue)\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error updating state in ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Initialize from persistent storage\n\t */\n\tprivate async initializeFromStorage(): Promise<void> {\n\t\tif (this.storageType === 'local' || this.storageType === 'session') {\n\t\t\ttry {\n\t\t\t\tconst storedValue = await this.storage.load()\n\t\t\t\tif (storedValue) {\n\t\t\t\t\tthis.updateState(storedValue)\n\t\t\t\t}\n\t\t\t\tthis._ready = true\n\t\t\t} catch (err) {\n\t\t\t\tconst error = new StoreError<unknown>(`Error loading from ${this.storageType} storage for ${this.key}`, err)\n\t\t\t\tthis.error$.next(error)\n\t\t\t\tconsole.error(error)\n\t\t\t\tthis._ready = true // Mark as ready even if loading fails\n\t\t\t}\n\t\t} else if (this.storageType === 'indexeddb') {\n\t\t\tthis.loadFromIndexedDB()\n\t\t} else {\n\t\t\t// Memory storage doesn't need loading\n\t\t\tthis._ready = true\n\t\t}\n\t}\n\n\t/**\n\t * Load data from IndexedDB with better typing\n\t */\n\tprivate async loadFromIndexedDB(): Promise<void> {\n\t\ttry {\n\t\t\tconst result = await this.storage.load()\n\t\t\tthis.updateState(result || new Map<string, V>())\n\t\t\tthis._ready = true\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error loading from IndexedDB for ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t\tthis._ready = true // Mark as ready even if loading fails\n\t\t}\n\t}\n\n\t/**\n\t * Set up persistence to storage\n\t */\n\tprivate setupPersistence(): void {\n\t\tif (this.storageType === 'memory') return\n\n\t\tthis.$.pipe(throttleTime(100, undefined, { leading: true, trailing: true })).subscribe(currentValue => {\n\t\t\tthis.storage.save(currentValue).catch(err => {\n\t\t\t\tconst error = new StoreError<unknown>(`Error saving to ${this.storageType} storage for ${this.key}`, err)\n\t\t\t\tthis.error$.next(error)\n\t\t\t\tconsole.error(error)\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Setup development tools for debugging\n\t */\n\tprivate setupDevTools(): void {\n\t\tif (typeof window !== 'undefined') {\n\t\t\t// Add to global store registry\n\t\t\t;(window as any).__STORES__ = (window as any).__STORES__ || {}\n\t\t\t;(window as any).__STORES__[this.key] = {\n\t\t\t\tgetState: () => this.value,\n\t\t\t\tset: this.set.bind(this),\n\t\t\t\tdelete: this.delete.bind(this),\n\t\t\t\tclear: this.clear.bind(this),\n\t\t\t\tsubscribe: (callback: (state: Map<string, V>) => void) => {\n\t\t\t\t\tconst subscription = this.$.subscribe(callback)\n\t\t\t\t\treturn () => subscription.unsubscribe()\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clean up resources\n\t */\n\tpublic destroy(): void {\n\t\tthis._destroy$.next()\n\t\tthis._destroy$.complete()\n\t\tthis.$.complete()\n\t\tthis.error$.complete()\n\t}\n}\n","import { BehaviorSubject, Subject } from 'rxjs'\nimport { createStorageManager, StorageManager } from './storage-manager'\nimport { IStore, StorageType, StoreError } from './types'\n\n/**\n * Enhanced store object with better TypeScript support\n */\nexport class SchmancyStoreObject<T extends Record<string, any>> implements IStore<T> {\n\tpublic static type = 'object'\n\n\t// Static map to hold instances with proper typing\n\tprivate static instances: Map<string, SchmancyStoreObject<any>> = new Map()\n\n\t// State tracking\n\tprivate _ready: boolean = false\n\tprivate _destroy$ = new Subject<void>()\n\n\t// Observable streams\n\tpublic $: BehaviorSubject<T>\n\tpublic error$ = new BehaviorSubject<StoreError | null>(null)\n\n\t// Default value for the store\n\tpublic readonly defaultValue: T\n\n\t// Storage manager\n\tprivate storage: StorageManager<T>\n\n\t/**\n\t * Get store ready state\n\t */\n\tpublic get ready(): boolean {\n\t\treturn this._ready\n\t}\n\n\t/**\n\t * Set store ready state\n\t */\n\tpublic set ready(value: boolean) {\n\t\tthis._ready = value\n\t\tthis.updateState(this.$.value)\n\t}\n\n\t/**\n\t * Private constructor to enforce singleton pattern\n\t */\n\tprivate constructor(private storageType: StorageType, private key: string, defaultValue: T) {\n\t\tthis.defaultValue = defaultValue\n\t\tthis.$ = new BehaviorSubject<T>(defaultValue)\n\t\tthis.storage = createStorageManager<T>(storageType, key)\n\n\t\t// Initialize from storage\n\t\tthis.initializeFromStorage()\n\n\t\t// Setup dev tools in development\n\t\tif (import.meta.env.MODE === 'development') {\n\t\t\tthis.setupDevTools()\n\t\t}\n\t}\n\n\t/**\n\t * Static method to get or create an instance with strong typing\n\t */\n\tpublic static getInstance<T extends Record<string, any>>(\n\t\tstorage: StorageType,\n\t\tkey: string,\n\t\tdefaultValue: T,\n\t): SchmancyStoreObject<T> {\n\t\tconst instanceKey = `${storage}:${key}`\n\t\tif (!this.instances.has(instanceKey)) {\n\t\t\tthis.instances.set(instanceKey, new SchmancyStoreObject<T>(storage, key, defaultValue))\n\t\t}\n\t\treturn this.instances.get(instanceKey) as SchmancyStoreObject<T>\n\t}\n\n\t/**\n\t * Get the current value from the store\n\t */\n\tpublic get value(): T {\n\t\treturn this.$.getValue()\n\t}\n\n\t/**\n\t * Set state with proper typing\n\t */\n\tpublic set(value: Partial<T>, merge: boolean = true): void {\n\t\ttry {\n\t\t\tthis.updateState(merge ? { ...this.value, ...value } : (value as T))\n\t\t\tthis.error$.next(null) // Clear any previous errors\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error updating store: ${this.key}`, err, { value, merge })\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Reset the store to its default value\n\t */\n\tpublic clear(): void {\n\t\tthis.set(this.defaultValue, false)\n\t}\n\n\t/**\n\t * Replace the store with a new value\n\t */\n\tpublic replace(newValue: T): void {\n\t\tthis.updateState(newValue)\n\t}\n\n\t/**\n\t * Delete a specific key from the store with type checking\n\t */\n\tpublic delete<K extends keyof T>(key: K): void {\n\t\tconst value = { ...this.value }\n\t\tdelete value[key]\n\t\tthis.updateState(value)\n\t}\n\n\t/**\n\t * Update the state with proper error handling\n\t */\n\tprivate updateState(newValue: T): void {\n\t\ttry {\n\t\t\tthis.$.next(newValue)\n\n\t\t\t// Persist to storage\n\t\t\tif (this.storageType !== 'memory') {\n\t\t\t\tthis.storage.save(newValue).catch(err => {\n\t\t\t\t\tconsole.error(`Error saving to ${this.storageType} storage:`, err)\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error updating state in ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Initialize the store from persistent storage\n\t */\n\tprivate async initializeFromStorage(): Promise<void> {\n\t\ttry {\n\t\t\tconst storedValue = await this.storage.load()\n\t\t\tif (storedValue) {\n\t\t\t\tthis.updateState({ ...this.defaultValue, ...storedValue })\n\t\t\t}\n\t\t\tthis._ready = true\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error loading from ${this.storageType} storage for ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t\tthis._ready = true // Mark as ready even if loading fails\n\t\t}\n\t}\n\n\t/**\n\t * Setup development tools for debugging\n\t */\n\tprivate setupDevTools(): void {\n\t\tif (typeof window !== 'undefined') {\n\t\t\t// Add to global store registry\n\t\t\t;(window as any).__STORES__ = (window as any).__STORES__ || {}\n\t\t\t;(window as any).__STORES__[this.key] = {\n\t\t\t\tgetState: () => this.value,\n\t\t\t\tset: this.set.bind(this),\n\t\t\t\tdelete: this.delete.bind(this),\n\t\t\t\tclear: this.clear.bind(this),\n\t\t\t\tsubscribe: (callback: (state: T) => void) => {\n\t\t\t\t\tconst subscription = this.$.subscribe(callback)\n\t\t\t\t\treturn () => subscription.unsubscribe()\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clean up resources\n\t */\n\tpublic destroy(): void {\n\t\tthis._destroy$.next()\n\t\tthis._destroy$.complete()\n\t\tthis.$.complete()\n\t\tthis.error$.complete()\n\t}\n}\n"],"names":["StoreError","Error","message","cause","context","super","this","name","MemoryStorageManager","constructor","data","state","LocalStorageManager","key","load","localStorage","getItem","JSON","parse","save","setItem","stringify","err","clear","removeItem","SessionStorageManager","sessionStorage","IndexedDBStorageManager","Promise","resolve","reject","request","indexedDB","open","DB_NAME","DB_VERSION","onupgradeneeded","db","result","objectStoreNames","contains","STORE_NAME","createObjectStore","onsuccess","onerror","error","openDB","transaction","objectStore","get","close","put","delete","_a","createStorageManager","type","SchmancyCollectionStore","storageType","defaultValue","_ready","_destroy$","Subject","error$","BehaviorSubject","$","Map","storage","initializeFromStorage","setupPersistence","ready","value","updateState","instanceKey","instances","has","set","getValue","currentValue","next","newValue","storedValue","loadFromIndexedDB","pipe","throttleTime","leading","trailing","subscribe","catch","window","__STORES__","getState","bind","callback","subscription","unsubscribe","destroy","complete","_c","SchmancyStoreObject","merge","setupDevTools","_l"],"mappings":";AA4DO,MAAMA,UAAgCC,MAC5C;AAAA,EAAA,YAAYC,GAAiCC,GAA2BC,GAAAA;AACvEC,UAAMH,CAAAA,GADsCI,KAAAH,QAAAA,GAA2BG,KAAAF,UAAAA,GAEvEE,KAAKC,OAAO;AAAA,EAAA;;ACjDP,MAAMC,EAAAA;AAAAA,EAAN,cAAAC;AACNH,SAAQI,OAAiB;AAAA,EAAA;AAAA,EAEzB,aACC;AAAA,WAAOJ,KAAKI;AAAAA,EAAA;AAAA,EAGb,MAAA,KAAWC,GAAAA;AACVL,SAAKI,OAAOC;AAAAA,EAAA;AAAA,EAGb,MAAA,QACCL;AAAAA,SAAKI,OAAO;AAAA,EAAA;;AAOP,MAAME,EAAAA;AAAAA,EACZ,YAAoBC,GAAAP;AAAAA,SAAAO,MAAAA;AAAAA,EAAA;AAAA,EAEpB,MAAMC,OAAAA;AACD,QACH;AAAA,YAAMJ,IAAOK,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E,KAAKrF,IAAAA,GACvBgF,WAAYM,OAAAA;AACX,YAAMC,IAAevF,KAAK0D,EAAEsB,UAAUM,CAC/B;AAAA,aAAA,MAAMC,EAAaC,YAAY;AAAA,IAAA,EAAA;AAAA,EAGzC;AAAA,EAMM;AACNxF,SAAKsD,UAAUkB,KACfxE,GAAAA,KAAKsD,UAAUoC,SAAAA,GACf1F,KAAK0D,EAAEgC,YACP1F,KAAKwD,OAAOkC,SAAS;AAAA,EAAA;AAAA;AA/KtB1F,EAAciD,OAAO,UAGNjD,EAAAmE,gCAAuDR;AAJhE,IAAMiC,IAANG;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("rxjs");class i extends Error{constructor(t,e,s){super(t),this.cause=e,this.context=s,this.name="StoreError"}}class g{constructor(){this.data=null}async load(){return this.data}async save(t){this.data=t}async clear(){this.data=null}}class w{constructor(t){this.key=t}async load(){try{const t=localStorage.getItem(this.key);return t?JSON.parse(t):null}catch{return null}}async save(t){try{localStorage.setItem(this.key,JSON.stringify(t))}catch(e){throw new i(`Failed to save to localStorage (${this.key})`,e)}}async clear(){localStorage.removeItem(this.key)}}class p{constructor(t){this.key=t}async load(){try{const t=sessionStorage.getItem(this.key);return t?JSON.parse(t):null}catch{return null}}async save(t){try{sessionStorage.setItem(this.key,JSON.stringify(t))}catch(e){throw new i(`Failed to save to sessionStorage (${this.key})`,e)}}async clear(){sessionStorage.removeItem(this.key)}}const a=class a{constructor(t){this.key=t}openDB(){return new Promise((t,e)=>{const s=indexedDB.open(a.DB_NAME,a.DB_VERSION);s.onupgradeneeded=()=>{const r=s.result;r.objectStoreNames.contains(a.STORE_NAME)||r.createObjectStore(a.STORE_NAME)},s.onsuccess=()=>t(s.result),s.onerror=()=>e(s.error)})}async load(){try{const t=await this.openDB();return new Promise((e,s)=>{const r=t.transaction(a.STORE_NAME,"readonly").objectStore(a.STORE_NAME).get(this.key);r.onsuccess=()=>{t.close(),e(r.result||null)},r.onerror=()=>{t.close(),s(r.error)}})}catch{return null}}async save(t){try{const e=await this.openDB();return new Promise((s,r)=>{const d=e.transaction(a.STORE_NAME,"readwrite").objectStore(a.STORE_NAME).put(t,this.key);d.onsuccess=()=>{e.close(),s()},d.onerror=()=>{e.close(),r(d.error)}})}catch(e){throw new i(`Failed to save to IndexedDB (${this.key})`,e)}}async clear(){try{const t=await this.openDB();return new Promise((e,s)=>{const r=t.transaction(a.STORE_NAME,"readwrite").objectStore(a.STORE_NAME).delete(this.key);r.onsuccess=()=>{t.close(),e()},r.onerror=()=>{t.close(),s(r.error)}})}catch(t){throw new i(`Failed to clear from IndexedDB (${this.key})`,t)}}};a.DB_NAME="StoreDB",a.STORE_NAME="states",a.DB_VERSION=1;let l=a;function S(n,t){switch(n){case"local":return new w(t);case"session":return new p(t);case"indexeddb":return new l(t);default:return new g}}const c=class c{constructor(t,e,s){this.storageType=t,this.key=e,this._ready=!1,this._destroy$=new o.Subject,this.error$=new o.BehaviorSubject(null),this.defaultValue=s,this.$=new o.BehaviorSubject(new Map),this.storage=S(t,e),this.initializeFromStorage(),this.setupPersistence()}get ready(){return this._ready}set ready(t){this._ready=t,this.updateState(this.$.value)}static getInstance(t,e,s){const r=`${t}:${e}`;return this.instances.has(r)||this.instances.set(r,new c(t,e,s)),this.instances.get(r)}get value(){return this.$.getValue()}set(t,e){try{const s=new Map(this.value);s.set(t,e),this.updateState(s),this.error$.next(null)}catch(s){const r=new i(`Error setting value for key ${t} in ${this.key}`,s);this.error$.next(r)}}delete(t){try{const e=new Map(this.value);e.delete(t),this.updateState(e),this.error$.next(null)}catch(e){const s=new i(`Error deleting key ${t} from ${this.key}`,e);this.error$.next(s)}}clear(){this.updateState(new Map)}replace(t){this.updateState(t)}updateState(t){try{this.$.next(t)}catch(e){const s=new i(`Error updating state in ${this.key}`,e);this.error$.next(s)}}async initializeFromStorage(){if(this.storageType==="local"||this.storageType==="session")try{const t=await this.storage.load();t&&this.updateState(t),this._ready=!0}catch(t){const e=new i(`Error loading from ${this.storageType} storage for ${this.key}`,t);this.error$.next(e),this._ready=!0}else this.storageType==="indexeddb"?this.loadFromIndexedDB():this._ready=!0}async loadFromIndexedDB(){try{const t=await this.storage.load();this.updateState(t||new Map),this._ready=!0}catch(t){const e=new i(`Error loading from IndexedDB for ${this.key}`,t);this.error$.next(e),this._ready=!0}}setupPersistence(){this.storageType!=="memory"&&this.$.pipe(o.throttleTime(100,void 0,{leading:!0,trailing:!0})).subscribe(t=>{this.storage.save(t).catch(e=>{const s=new i(`Error saving to ${this.storageType} storage for ${this.key}`,e);this.error$.next(s)})})}setupDevTools(){typeof window<"u"&&(window.__STORES__=window.__STORES__||{},window.__STORES__[this.key]={getState:()=>this.value,set:this.set.bind(this),delete:this.delete.bind(this),clear:this.clear.bind(this),subscribe:t=>{const e=this.$.subscribe(t);return()=>e.unsubscribe()}})}destroy(){this._destroy$.next(),this._destroy$.complete(),this.$.complete(),this.error$.complete()}};c.type="collection",c.instances=new Map;let u=c;const h=class h{constructor(t,e,s){this.storageType=t,this.key=e,this._ready=!1,this._destroy$=new o.Subject,this.error$=new o.BehaviorSubject(null),this.defaultValue=s,this.$=new o.BehaviorSubject(s),this.storage=S(t,e),this.initializeFromStorage()}get ready(){return this._ready}set ready(t){this._ready=t,this.updateState(this.$.value)}static getInstance(t,e,s){const r=`${t}:${e}`;return this.instances.has(r)||this.instances.set(r,new h(t,e,s)),this.instances.get(r)}get value(){return this.$.getValue()}set(t,e=!0){try{this.updateState(e?{...this.value,...t}:t),this.error$.next(null)}catch(s){const r=new i(`Error updating store: ${this.key}`,s,{value:t,merge:e});this.error$.next(r)}}clear(){this.set(this.defaultValue,!1)}replace(t){this.updateState(t)}delete(t){const e={...this.value};delete e[t],this.updateState(e)}updateState(t){try{this.$.next(t),this.storageType!=="memory"&&this.storage.save(t).catch(e=>{})}catch(e){const s=new i(`Error updating state in ${this.key}`,e);this.error$.next(s)}}async initializeFromStorage(){try{const t=await this.storage.load();t&&this.updateState({...this.defaultValue,...t}),this._ready=!0}catch(t){const e=new i(`Error loading from ${this.storageType} storage for ${this.key}`,t);this.error$.next(e),this._ready=!0}}setupDevTools(){typeof window<"u"&&(window.__STORES__=window.__STORES__||{},window.__STORES__[this.key]={getState:()=>this.value,set:this.set.bind(this),delete:this.delete.bind(this),clear:this.clear.bind(this),subscribe:t=>{const e=this.$.subscribe(t);return()=>e.unsubscribe()}})}destroy(){this._destroy$.next(),this._destroy$.complete(),this.$.complete(),this.error$.complete()}};h.type="object",h.instances=new Map;let y=h;exports.IndexedDBStorageManager=l,exports.LocalStorageManager=w,exports.MemoryStorageManager=g,exports.SchmancyCollectionStore=u,exports.SchmancyStoreObject=y,exports.SessionStorageManager=p,exports.StoreError=i,exports.createStorageManager=S;
|
|
2
|
-
//# sourceMappingURL=context-object-CgZ6F8E9.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-object-CgZ6F8E9.cjs","sources":["../src/store/types.ts","../src/store/storage-manager.ts","../src/store/context-collection.ts","../src/store/context-object.ts"],"sourcesContent":["// src/store/types.ts\nimport { BehaviorSubject, Observable } from 'rxjs'\n\n/**\n * Storage types supported by the store\n */\nexport type StorageType = 'memory' | 'local' | 'session' | 'indexeddb'\n\n/**\n * Base store options\n */\nexport interface StoreOptions<T> {\n\t/** Key used for persistent storage */\n\tkey: string\n\t/** Storage type */\n\tstorage: StorageType\n\t/** Initial state */\n\tinitialState: T\n\t/** Enable dev tools */\n\tdevTools?: boolean\n}\n\n/**\n * Action interface for all store actions\n */\nexport interface Action<T = any> {\n\ttype: string\n\tpayload?: T\n}\n\n/**\n * Type-safe action creator\n */\nexport type ActionCreator<P = void, R = void> = P extends void ? () => R : (payload: P) => R\n\n/**\n * Map of action creators with preserved function signatures\n */\nexport type ActionCreatorMap<T> = {\n\t[K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => R : never\n}\n\n/**\n * Reducer function type\n */\nexport type Reducer<T> = (state: T, action: Action) => T\n\n/**\n * Middleware function type\n */\nexport type Middleware<T> = (prevState: T, nextState: T, context: { type: string; payload?: any }) => void\n\n/**\n * Selector function type\n */\nexport type Selector<S, R> = (state: S) => R\n\n/**\n * Enhanced store error with type information\n */\nexport class StoreError<T = unknown> extends Error {\n\tconstructor(message: string, public readonly cause?: T, public readonly context?: Record<string, unknown>) {\n\t\tsuper(message)\n\t\tthis.name = 'StoreError'\n\t}\n}\n\n/**\n * Core store interface\n */\nexport interface IStore<T> {\n\t// Value getters with strong return types\n\tvalue: T\n\t$: BehaviorSubject<T>\n\n\t// Methods with improved parameter and return types\n\tset(value: Partial<T>, merge?: boolean): void\n\tclear(): void\n\treplace(newValue: T): void\n\n\t// Ready state with correct type\n\tready: boolean\n\n\t// Error handling\n\terror$: Observable<StoreError | null>\n}\n\n/**\n * Interface for collection stores\n * No longer extends IStore to avoid method signature conflicts\n */\nexport interface ICollectionStore<T> {\n\t// Value getters with strong return types\n\tvalue: Map<string, T>\n\t$: BehaviorSubject<Map<string, T>>\n\n\t// Methods specific to collections\n\tset<V = T>(key: string, value: V): void\n\tdelete(key: string): void\n\tclear(): void\n\treplace(newValue: Map<string, T>): void\n\n\t// Ready state with correct type\n\tready: boolean\n\n\t// Error handling\n\terror$: Observable<StoreError | null>\n}\n","import { StorageType, StoreError } from './types'\n\n/**\n * Storage manager interface with generic typing\n */\nexport interface StorageManager<T> {\n\tload(): Promise<T | null>\n\tsave(state: T): Promise<void>\n\tclear(): Promise<void>\n}\n\n/**\n * Memory storage manager implementation\n */\nexport class MemoryStorageManager<T> implements StorageManager<T> {\n\tprivate data: T | null = null\n\n\tasync load(): Promise<T | null> {\n\t\treturn this.data\n\t}\n\n\tasync save(state: T): Promise<void> {\n\t\tthis.data = state\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tthis.data = null\n\t}\n}\n\n/**\n * Local storage manager implementation\n */\nexport class LocalStorageManager<T> implements StorageManager<T> {\n\tconstructor(private key: string) {}\n\n\tasync load(): Promise<T | null> {\n\t\ttry {\n\t\t\tconst data = localStorage.getItem(this.key)\n\t\t\treturn data ? JSON.parse(data) : null\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to load from localStorage (${this.key}):`, err)\n\t\t\treturn null\n\t\t}\n\t}\n\n\tasync save(state: T): Promise<void> {\n\t\ttry {\n\t\t\tlocalStorage.setItem(this.key, JSON.stringify(state))\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to save to localStorage (${this.key}):`, err)\n\t\t\tthrow new StoreError<unknown>(`Failed to save to localStorage (${this.key})`, err)\n\t\t}\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tlocalStorage.removeItem(this.key)\n\t}\n}\n\n/**\n * Session storage manager implementation\n */\nexport class SessionStorageManager<T> implements StorageManager<T> {\n\tconstructor(private key: string) {}\n\n\tasync load(): Promise<T | null> {\n\t\ttry {\n\t\t\tconst data = sessionStorage.getItem(this.key)\n\t\t\treturn data ? JSON.parse(data) : null\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to load from sessionStorage (${this.key}):`, err)\n\t\t\treturn null\n\t\t}\n\t}\n\n\tasync save(state: T): Promise<void> {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.key, JSON.stringify(state))\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to save to sessionStorage (${this.key}):`, err)\n\t\t\tthrow new StoreError<unknown>(`Failed to save to sessionStorage (${this.key})`, err)\n\t\t}\n\t}\n\n\tasync clear(): Promise<void> {\n\t\tsessionStorage.removeItem(this.key)\n\t}\n}\n\n/**\n * IndexedDB storage manager implementation with better error typing\n */\nexport class IndexedDBStorageManager<T> implements StorageManager<T> {\n\tprivate static DB_NAME = 'StoreDB'\n\tprivate static STORE_NAME = 'states'\n\tprivate static DB_VERSION = 1\n\n\tconstructor(private key: string) {}\n\n\tprivate openDB(): Promise<IDBDatabase> {\n\t\treturn new Promise<IDBDatabase>((resolve, reject) => {\n\t\t\tconst request = indexedDB.open(IndexedDBStorageManager.DB_NAME, IndexedDBStorageManager.DB_VERSION)\n\n\t\t\trequest.onupgradeneeded = () => {\n\t\t\t\tconst db = request.result\n\t\t\t\tif (!db.objectStoreNames.contains(IndexedDBStorageManager.STORE_NAME)) {\n\t\t\t\t\tdb.createObjectStore(IndexedDBStorageManager.STORE_NAME)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trequest.onsuccess = () => resolve(request.result)\n\t\t\trequest.onerror = () => reject(request.error)\n\t\t})\n\t}\n\n\tasync load(): Promise<T | null> {\n\t\ttry {\n\t\t\tconst db = await this.openDB()\n\t\t\treturn new Promise<T | null>((resolve, reject) => {\n\t\t\t\tconst transaction = db.transaction(IndexedDBStorageManager.STORE_NAME, 'readonly')\n\t\t\t\tconst store = transaction.objectStore(IndexedDBStorageManager.STORE_NAME)\n\t\t\t\tconst request = store.get(this.key)\n\n\t\t\t\trequest.onsuccess = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\tresolve(request.result || null)\n\t\t\t\t}\n\n\t\t\t\trequest.onerror = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\treject(request.error)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to load from IndexedDB (${this.key}):`, err)\n\t\t\treturn null\n\t\t}\n\t}\n\n\tasync save(state: T): Promise<void> {\n\t\ttry {\n\t\t\tconst db = await this.openDB()\n\t\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\t\tconst transaction = db.transaction(IndexedDBStorageManager.STORE_NAME, 'readwrite')\n\t\t\t\tconst store = transaction.objectStore(IndexedDBStorageManager.STORE_NAME)\n\t\t\t\tconst request = store.put(state, this.key)\n\n\t\t\t\trequest.onsuccess = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\tresolve()\n\t\t\t\t}\n\n\t\t\t\trequest.onerror = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\treject(request.error)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to save to IndexedDB (${this.key}):`, err)\n\t\t\tthrow new StoreError<unknown>(`Failed to save to IndexedDB (${this.key})`, err)\n\t\t}\n\t}\n\n\tasync clear(): Promise<void> {\n\t\ttry {\n\t\t\tconst db = await this.openDB()\n\t\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\t\tconst transaction = db.transaction(IndexedDBStorageManager.STORE_NAME, 'readwrite')\n\t\t\t\tconst store = transaction.objectStore(IndexedDBStorageManager.STORE_NAME)\n\t\t\t\tconst request = store.delete(this.key)\n\n\t\t\t\trequest.onsuccess = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\tresolve()\n\t\t\t\t}\n\n\t\t\t\trequest.onerror = () => {\n\t\t\t\t\tdb.close()\n\t\t\t\t\treject(request.error)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tconsole.error(`Failed to clear from IndexedDB (${this.key}):`, err)\n\t\t\tthrow new StoreError<unknown>(`Failed to clear from IndexedDB (${this.key})`, err)\n\t\t}\n\t}\n}\n\n/**\n * Factory function to create the appropriate storage manager\n */\nexport function createStorageManager<T>(type: StorageType, key: string): StorageManager<T> {\n\tswitch (type) {\n\t\tcase 'local':\n\t\t\treturn new LocalStorageManager<T>(key)\n\t\tcase 'session':\n\t\t\treturn new SessionStorageManager<T>(key)\n\t\tcase 'indexeddb':\n\t\t\treturn new IndexedDBStorageManager<T>(key)\n\t\tcase 'memory':\n\t\tdefault:\n\t\t\treturn new MemoryStorageManager<T>()\n\t}\n}\n","import { BehaviorSubject, Subject, throttleTime } from 'rxjs'\nimport { ICollectionStore, StorageType, StoreError } from './types'\nimport { createStorageManager, StorageManager } from './storage-manager'\n\n/**\n * Enhanced collection store with better TypeScript support\n */\nexport default class SchmancyCollectionStore<V = any> implements ICollectionStore<V> {\n\tpublic static type = 'collection'\n\n\t// Static map to hold instances\n\tprivate static instances: Map<string, SchmancyCollectionStore<any>> = new Map()\n\n\t// State management\n\tprivate _ready: boolean = false\n\tprivate _destroy$ = new Subject<void>()\n\n\t// Observable streams - modified to match interface requirements\n\tpublic $: BehaviorSubject<Map<string, V>>\n\tpublic error$ = new BehaviorSubject<StoreError | null>(null)\n\n\t// Default value for the store\n\tpublic readonly defaultValue: Map<string, V>\n\n\t// Storage manager\n\tprivate storage: StorageManager<Map<string, V>>\n\n\t/**\n\t * Get ready state\n\t */\n\tpublic get ready(): boolean {\n\t\treturn this._ready\n\t}\n\n\t/**\n\t * Set ready state\n\t */\n\tpublic set ready(value: boolean) {\n\t\tthis._ready = value\n\t\tthis.updateState(this.$.value)\n\t}\n\n\t/**\n\t * Private constructor to enforce singleton pattern\n\t */\n\tprivate constructor(private storageType: StorageType, private key: string, defaultValue: Map<string, V>) {\n\t\tthis.defaultValue = defaultValue\n\t\tthis.$ = new BehaviorSubject<Map<string, V>>(new Map<string, V>())\n\t\tthis.storage = createStorageManager<Map<string, V>>(storageType, key)\n\n\t\t// Initialize from storage\n\t\tthis.initializeFromStorage()\n\n\t\t// Set up persistence\n\t\tthis.setupPersistence()\n\n\t\t// Setup dev tools in development\n\t\tif (import.meta.env.MODE === 'development') {\n\t\t\tthis.setupDevTools()\n\t\t}\n\t}\n\n\t/**\n\t * Static method to get or create an instance with proper typing\n\t */\n\tpublic static getInstance<V = any>(\n\t\tstorage: StorageType,\n\t\tkey: string,\n\t\tdefaultValue: Map<string, V>,\n\t): SchmancyCollectionStore<V> {\n\t\tconst instanceKey = `${storage}:${key}`\n\t\tif (!this.instances.has(instanceKey)) {\n\t\t\tthis.instances.set(instanceKey, new SchmancyCollectionStore<V>(storage, key, defaultValue))\n\t\t}\n\t\treturn this.instances.get(instanceKey) as SchmancyCollectionStore<V>\n\t}\n\n\t/**\n\t * Get the current value\n\t */\n\tpublic get value(): Map<string, V> {\n\t\treturn this.$.getValue()\n\t}\n\n\t/**\n\t * Set a value in the collection with proper typing\n\t */\n\tpublic set<T = V>(key: string, value: T): void {\n\t\ttry {\n\t\t\tconst currentValue = new Map(this.value)\n\t\t\tcurrentValue.set(key, value as unknown as V)\n\t\t\tthis.updateState(currentValue)\n\t\t\tthis.error$.next(null) // Clear any previous errors\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error setting value for key ${key} in ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Delete a value from the collection\n\t */\n\tpublic delete(key: string): void {\n\t\ttry {\n\t\t\tconst currentValue = new Map(this.value)\n\t\t\tcurrentValue.delete(key)\n\t\t\tthis.updateState(currentValue)\n\t\t\tthis.error$.next(null) // Clear any previous errors\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error deleting key ${key} from ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Clear the collection\n\t */\n\tpublic clear(): void {\n\t\tthis.updateState(new Map<string, V>())\n\t}\n\n\tpublic replace(newValue: Map<string, V>): void {\n\t\tthis.updateState(newValue)\n\t}\n\n\t/**\n\t * Update the state with error handling\n\t */\n\tprivate updateState(newValue: Map<string, V>): void {\n\t\ttry {\n\t\t\tthis.$.next(newValue)\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error updating state in ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Initialize from persistent storage\n\t */\n\tprivate async initializeFromStorage(): Promise<void> {\n\t\tif (this.storageType === 'local' || this.storageType === 'session') {\n\t\t\ttry {\n\t\t\t\tconst storedValue = await this.storage.load()\n\t\t\t\tif (storedValue) {\n\t\t\t\t\tthis.updateState(storedValue)\n\t\t\t\t}\n\t\t\t\tthis._ready = true\n\t\t\t} catch (err) {\n\t\t\t\tconst error = new StoreError<unknown>(`Error loading from ${this.storageType} storage for ${this.key}`, err)\n\t\t\t\tthis.error$.next(error)\n\t\t\t\tconsole.error(error)\n\t\t\t\tthis._ready = true // Mark as ready even if loading fails\n\t\t\t}\n\t\t} else if (this.storageType === 'indexeddb') {\n\t\t\tthis.loadFromIndexedDB()\n\t\t} else {\n\t\t\t// Memory storage doesn't need loading\n\t\t\tthis._ready = true\n\t\t}\n\t}\n\n\t/**\n\t * Load data from IndexedDB with better typing\n\t */\n\tprivate async loadFromIndexedDB(): Promise<void> {\n\t\ttry {\n\t\t\tconst result = await this.storage.load()\n\t\t\tthis.updateState(result || new Map<string, V>())\n\t\t\tthis._ready = true\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error loading from IndexedDB for ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t\tthis._ready = true // Mark as ready even if loading fails\n\t\t}\n\t}\n\n\t/**\n\t * Set up persistence to storage\n\t */\n\tprivate setupPersistence(): void {\n\t\tif (this.storageType === 'memory') return\n\n\t\tthis.$.pipe(throttleTime(100, undefined, { leading: true, trailing: true })).subscribe(currentValue => {\n\t\t\tthis.storage.save(currentValue).catch(err => {\n\t\t\t\tconst error = new StoreError<unknown>(`Error saving to ${this.storageType} storage for ${this.key}`, err)\n\t\t\t\tthis.error$.next(error)\n\t\t\t\tconsole.error(error)\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Setup development tools for debugging\n\t */\n\tprivate setupDevTools(): void {\n\t\tif (typeof window !== 'undefined') {\n\t\t\t// Add to global store registry\n\t\t\t;(window as any).__STORES__ = (window as any).__STORES__ || {}\n\t\t\t;(window as any).__STORES__[this.key] = {\n\t\t\t\tgetState: () => this.value,\n\t\t\t\tset: this.set.bind(this),\n\t\t\t\tdelete: this.delete.bind(this),\n\t\t\t\tclear: this.clear.bind(this),\n\t\t\t\tsubscribe: (callback: (state: Map<string, V>) => void) => {\n\t\t\t\t\tconst subscription = this.$.subscribe(callback)\n\t\t\t\t\treturn () => subscription.unsubscribe()\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clean up resources\n\t */\n\tpublic destroy(): void {\n\t\tthis._destroy$.next()\n\t\tthis._destroy$.complete()\n\t\tthis.$.complete()\n\t\tthis.error$.complete()\n\t}\n}\n","import { BehaviorSubject, Subject } from 'rxjs'\nimport { createStorageManager, StorageManager } from './storage-manager'\nimport { IStore, StorageType, StoreError } from './types'\n\n/**\n * Enhanced store object with better TypeScript support\n */\nexport class SchmancyStoreObject<T extends Record<string, any>> implements IStore<T> {\n\tpublic static type = 'object'\n\n\t// Static map to hold instances with proper typing\n\tprivate static instances: Map<string, SchmancyStoreObject<any>> = new Map()\n\n\t// State tracking\n\tprivate _ready: boolean = false\n\tprivate _destroy$ = new Subject<void>()\n\n\t// Observable streams\n\tpublic $: BehaviorSubject<T>\n\tpublic error$ = new BehaviorSubject<StoreError | null>(null)\n\n\t// Default value for the store\n\tpublic readonly defaultValue: T\n\n\t// Storage manager\n\tprivate storage: StorageManager<T>\n\n\t/**\n\t * Get store ready state\n\t */\n\tpublic get ready(): boolean {\n\t\treturn this._ready\n\t}\n\n\t/**\n\t * Set store ready state\n\t */\n\tpublic set ready(value: boolean) {\n\t\tthis._ready = value\n\t\tthis.updateState(this.$.value)\n\t}\n\n\t/**\n\t * Private constructor to enforce singleton pattern\n\t */\n\tprivate constructor(private storageType: StorageType, private key: string, defaultValue: T) {\n\t\tthis.defaultValue = defaultValue\n\t\tthis.$ = new BehaviorSubject<T>(defaultValue)\n\t\tthis.storage = createStorageManager<T>(storageType, key)\n\n\t\t// Initialize from storage\n\t\tthis.initializeFromStorage()\n\n\t\t// Setup dev tools in development\n\t\tif (import.meta.env.MODE === 'development') {\n\t\t\tthis.setupDevTools()\n\t\t}\n\t}\n\n\t/**\n\t * Static method to get or create an instance with strong typing\n\t */\n\tpublic static getInstance<T extends Record<string, any>>(\n\t\tstorage: StorageType,\n\t\tkey: string,\n\t\tdefaultValue: T,\n\t): SchmancyStoreObject<T> {\n\t\tconst instanceKey = `${storage}:${key}`\n\t\tif (!this.instances.has(instanceKey)) {\n\t\t\tthis.instances.set(instanceKey, new SchmancyStoreObject<T>(storage, key, defaultValue))\n\t\t}\n\t\treturn this.instances.get(instanceKey) as SchmancyStoreObject<T>\n\t}\n\n\t/**\n\t * Get the current value from the store\n\t */\n\tpublic get value(): T {\n\t\treturn this.$.getValue()\n\t}\n\n\t/**\n\t * Set state with proper typing\n\t */\n\tpublic set(value: Partial<T>, merge: boolean = true): void {\n\t\ttry {\n\t\t\tthis.updateState(merge ? { ...this.value, ...value } : (value as T))\n\t\t\tthis.error$.next(null) // Clear any previous errors\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error updating store: ${this.key}`, err, { value, merge })\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Reset the store to its default value\n\t */\n\tpublic clear(): void {\n\t\tthis.set(this.defaultValue, false)\n\t}\n\n\t/**\n\t * Replace the store with a new value\n\t */\n\tpublic replace(newValue: T): void {\n\t\tthis.updateState(newValue)\n\t}\n\n\t/**\n\t * Delete a specific key from the store with type checking\n\t */\n\tpublic delete<K extends keyof T>(key: K): void {\n\t\tconst value = { ...this.value }\n\t\tdelete value[key]\n\t\tthis.updateState(value)\n\t}\n\n\t/**\n\t * Update the state with proper error handling\n\t */\n\tprivate updateState(newValue: T): void {\n\t\ttry {\n\t\t\tthis.$.next(newValue)\n\n\t\t\t// Persist to storage\n\t\t\tif (this.storageType !== 'memory') {\n\t\t\t\tthis.storage.save(newValue).catch(err => {\n\t\t\t\t\tconsole.error(`Error saving to ${this.storageType} storage:`, err)\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error updating state in ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t}\n\t}\n\n\t/**\n\t * Initialize the store from persistent storage\n\t */\n\tprivate async initializeFromStorage(): Promise<void> {\n\t\ttry {\n\t\t\tconst storedValue = await this.storage.load()\n\t\t\tif (storedValue) {\n\t\t\t\tthis.updateState({ ...this.defaultValue, ...storedValue })\n\t\t\t}\n\t\t\tthis._ready = true\n\t\t} catch (err) {\n\t\t\tconst error = new StoreError<unknown>(`Error loading from ${this.storageType} storage for ${this.key}`, err)\n\t\t\tthis.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t\tthis._ready = true // Mark as ready even if loading fails\n\t\t}\n\t}\n\n\t/**\n\t * Setup development tools for debugging\n\t */\n\tprivate setupDevTools(): void {\n\t\tif (typeof window !== 'undefined') {\n\t\t\t// Add to global store registry\n\t\t\t;(window as any).__STORES__ = (window as any).__STORES__ || {}\n\t\t\t;(window as any).__STORES__[this.key] = {\n\t\t\t\tgetState: () => this.value,\n\t\t\t\tset: this.set.bind(this),\n\t\t\t\tdelete: this.delete.bind(this),\n\t\t\t\tclear: this.clear.bind(this),\n\t\t\t\tsubscribe: (callback: (state: T) => void) => {\n\t\t\t\t\tconst subscription = this.$.subscribe(callback)\n\t\t\t\t\treturn () => subscription.unsubscribe()\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clean up resources\n\t */\n\tpublic destroy(): void {\n\t\tthis._destroy$.next()\n\t\tthis._destroy$.complete()\n\t\tthis.$.complete()\n\t\tthis.error$.complete()\n\t}\n}\n"],"names":["StoreError","Error","message","cause","context","super","this","name","MemoryStorageManager","data","state","LocalStorageManager","key","load","localStorage","getItem","JSON","parse","err","setItem","stringify","removeItem","SessionStorageManager","sessionStorage","clear","IndexedDBStorageManager","openDB","Promise","resolve","reject","request","indexedDB","open","DB_NAME","DB_VERSION","onupgradeneeded","db","result","objectStoreNames","contains","STORE_NAME","createObjectStore","onsuccess","onerror","error","transaction","objectStore","get","close","put","delete","_h","createStorageManager","type","SchmancyCollectionStore","storageType","defaultValue","_ready","_destroy$","Subject","error$","BehaviorSubject","$","Map","storage","initializeFromStorage","setupPersistence","ready","value","updateState","instanceKey","instances","has","set","getValue","currentValue","next","newValue","storedValue","loadFromIndexedDB","pipe","throttleTime","leading","trailing","subscribe","save","catch","window","__STORES__","getState","bind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EA/KtBxF,EAAc+C,KAAO,SAGN/C,EAAAiE,cAAuDR,IAJhE,IAAMiC,EAANG"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const C=require("./context-object-CgZ6F8E9.cjs"),j=require("lit/decorators.js"),A=require("rxjs"),h=require("rxjs/operators"),L=(i,t)=>t.split(".").reduce((e,n)=>e==null?void 0:e[n],i),O=i=>{const t=[];for(let e=0;e<i.length-1;e++)t.push(i.substring(e,e+2));return t},x=(i,t)=>{const e=i.toLowerCase().trim(),n=t.toLowerCase().trim(),o=e.includes(n)?1:0,p=((a,l)=>{let s=0,r=0;for(;s<a.length&&r<l.length;)a[s]===l[r]&&s++,r++;return s===a.length})(n,e)?.8:0,g=((a,l)=>{const s=b=>b.split("").reduce((m,y)=>(m[y]=(m[y]||0)+1,m),{}),r=s(a),u=s(l);return Object.keys(r).every(b=>(u[b]||0)>=r[b])})(n,e)?.7:0,d=((a,l)=>{if(a.length<2||l.length<2)return 0;const s=O(a),r=O(l);let u=0;const b=new Array(r.length).fill(!1);for(const m of s)for(let y=0;y<r.length;y++)if(!b[y]&&r[y]===m){u++,b[y]=!0;break}return 2*u/(s.length+r.length)})(e,n),c=Math.max(e.length,n.length),f=c?1-((a,l)=>{const s=[];for(let r=0;r<=l.length;r++)s[r]=[r];for(let r=0;r<=a.length;r++)s[0][r]=r;for(let r=1;r<=l.length;r++)for(let u=1;u<=a.length;u++)l.charAt(r-1)===a.charAt(u-1)?s[r][u]=s[r-1][u-1]:s[r][u]=Math.min(s[r-1][u]+1,s[r][u-1]+1,s[r-1][u-1]+1);return s[l.length][a.length]})(e,n)/c:1;return Math.max(o,p,g,d,f)},M=(i,t,e)=>{switch(i){case"==":return t===e;case"!=":return t!==e;case">":return t>e;case"<":return t<e;case">=":return t>=e;case"<=":return t<=e;case"includes":return typeof t=="string"?t.toLowerCase().includes(String(e).toLowerCase()):!!Array.isArray(t)&&t.includes(e);case"notIncludes":return typeof t=="string"?!t.toLowerCase().includes(String(e).toLowerCase()):!!Array.isArray(t)&&!t.includes(e);case"startsWith":return typeof t=="string"&&t.startsWith(String(e));case"endsWith":return typeof t=="string"&&t.endsWith(String(e));case"in":return!!Array.isArray(e)&&e.includes(t);case"notIn":return!!Array.isArray(e)&&!e.includes(t);default:return!1}},w=(i,t=[])=>{const e=Array.from(i.values()).map(n=>{let o=0,p=0,g=!0;for(const d of t){let c,f,a,l=!1;if(Array.isArray(d)?([c,f,a,l=!1]=d,l=!!l):(c=d.key,f=d.operator,a=d.value,l=d.strict||!1),!l&&(a===""||a==null||Array.isArray(a)&&a.length===0))continue;const s=L(n,c);if(l){if(s!==a){g=!1;break}o+=1,p++}else if(f==="any"){if(typeof s!="string"||typeof a!="string"){g=!1;break}const r=x(s,a);if(r<.3){g=!1;break}o+=r,p++}else{if(!M(f,s,a)){g=!1;break}o+=1,p++}}return g?{item:n,score:p>0?o/p:1}:null}).filter(n=>n!==null);return e.sort((n,o)=>o.score-n.score),e.map(n=>n.item)},v=w;function k(i,t){return i.$.pipe(h.map(t),h.distinctUntilChanged((e,n)=>JSON.stringify(e)===JSON.stringify(n)),h.shareReplay(1))}function S(i,t){return i.$.pipe(h.map(t),h.distinctUntilChanged((e,n)=>e instanceof Map&&n instanceof Map?JSON.stringify(Array.from(e.entries()))===JSON.stringify(Array.from(n.entries())):JSON.stringify(e)===JSON.stringify(n)),h.shareReplay(1))}exports.createCollectionSelector=S,exports.createCompoundSelector=function(i,t){return A.combineLatest(i).pipe(h.map(e=>t(...e)),h.distinctUntilChanged((e,n)=>JSON.stringify(e)===JSON.stringify(n)),h.shareReplay(1))},exports.createContext=function(i,t,e){if(function(o){if(o==null||typeof o!="object")return!1;const p=Object.getPrototypeOf(o);return p!==Object.prototype&&p!==null&&typeof o[Symbol.iterator]=="function"}(i)){const o=C.SchmancyCollectionStore.getInstance(t,e,i);return o.value.size||o.$.next(i),o}if(typeof i=="object"&&i!==null){if(t==="indexeddb")throw new Error("IndexedDB storage is not supported for plain objects.");const o=C.SchmancyStoreObject.getInstance(t,e,i);return typeof(n=o.value)=="object"&&n!==null&&Object.keys(n).length===0&&o.$.next(i),o}throw new Error("Initial data must be an object or a Map.");var n},exports.createCountSelector=function(i,t){return S(i,e=>{if(!t)return e.size;let n=0;return e.forEach((o,p)=>{t(o,p)&&n++}),n})},exports.createFilterSelector=function(i,t){return S(i,e=>{const n=[];return e.forEach((o,p)=>{t(o,p)&&n.push(o)}),n})},exports.createItemSelector=function(i,t){return S(i,e=>e.get(t))},exports.createSelector=k,exports.filterMap=v,exports.filterMapItems=w,exports.select=function(i,t=n=>n,e={}){return function(n,o,p){j.property({attribute:!1,type:Object})(n,o);const g=n.connectedCallback,d=n.disconnectedCallback;n.connectedCallback=function(){var l;const c=this;c.t||(c.t={}),c.t[o]||(c.t[o]={subscription:null,initialLoad:!1});const f=c.t[o];!((l=c.disconnecting)!=null&&l.closed)&&c.disconnecting||(c.disconnecting=new A.Subject);const a=function(s){return"set"in s&&typeof s.set=="function"&&s.value instanceof Map}(i)?S(i,t):k(i,t);e.required||f.initialLoad||(g==null||g.call(c),f.initialLoad=!0),f.subscription||(f.subscription=a.pipe(h.takeUntil(c.disconnecting)).subscribe({next:s=>{var u;const r=structuredClone(s);c[o]=r,(u=c.requestUpdate)==null||u.call(c),e.required&&!f.initialLoad&&r&&(g==null||g.call(c),f.initialLoad=!0)},error:s=>{}}))},n.disconnectedCallback=function(){var f;d==null||d.call(this);const c=(f=this.t)==null?void 0:f[o];c!=null&&c.subscription&&(c.subscription.unsubscribe(),c.subscription=null),this.disconnecting&&(this.disconnecting.next(),this.disconnecting.complete())}}};
|
|
2
|
-
//# sourceMappingURL=selector-hook-B5oIBdcJ.cjs.map
|