@jenesei-software/jenesei-kit-react 1.3.32 → 1.3.34
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/README.md +0 -10
- package/build/{area-BG04bpxi.cjs → area-0BNtBqG8.cjs} +2 -2
- package/build/{area-BG04bpxi.cjs.map → area-0BNtBqG8.cjs.map} +1 -1
- package/build/{area-D4BoNEmX.js → area-B6xxVQ87.js} +3 -3
- package/build/{area-D4BoNEmX.js.map → area-B6xxVQ87.js.map} +1 -1
- package/build/{area-occQcGnD.js → area-B7-4IFQB.js} +3 -3
- package/build/{area-occQcGnD.js.map → area-B7-4IFQB.js.map} +1 -1
- package/build/{area-pCo19R2g.cjs → area-DxKLtDFZ.cjs} +2 -2
- package/build/{area-pCo19R2g.cjs.map → area-DxKLtDFZ.cjs.map} +1 -1
- package/build/area-outside.cjs.js +1 -1
- package/build/area-outside.es.js +1 -1
- package/build/area-preview.cjs.js +1 -1
- package/build/area-preview.es.js +1 -1
- package/build/area-scroll.cjs.js +1 -1
- package/build/area-scroll.d.ts +3 -4
- package/build/area-scroll.es.js +2 -2
- package/build/area-skeleton.cjs.js +1 -1
- package/build/area-skeleton.d.ts +3 -4
- package/build/area-skeleton.es.js +1 -1
- package/build/area-smooth.cjs.js +1 -1
- package/build/area-smooth.es.js +1 -1
- package/build/area.hooks-Bk04M7mk.js.map +1 -1
- package/build/{area.styles-BuceLNra.cjs → area.styles-Cpx4H0gc.cjs} +2 -2
- package/build/{area.styles-BuceLNra.cjs.map → area.styles-Cpx4H0gc.cjs.map} +1 -1
- package/build/{area.styles-BSqCfPE4.js → area.styles-DhCCEhuq.js} +2 -2
- package/build/{area.styles-BSqCfPE4.js.map → area.styles-DhCCEhuq.js.map} +1 -1
- package/build/build-info.txt +3 -3
- package/build/{component-DrTBbu8u.js → component-34--WtCE.js} +8 -8
- package/build/{component-DrTBbu8u.js.map → component-34--WtCE.js.map} +1 -1
- package/build/{component-BybwN9H4.js → component-9fzcSAV7.js} +4 -4
- package/build/{component-BybwN9H4.js.map → component-9fzcSAV7.js.map} +1 -1
- package/build/{component-DNVmU44U.cjs → component-BGAYOt_R.cjs} +2 -2
- package/build/{component-DNVmU44U.cjs.map → component-BGAYOt_R.cjs.map} +1 -1
- package/build/{component-CUiqQLEQ.js → component-BMIqhbpK.js} +3 -3
- package/build/{component-CUiqQLEQ.js.map → component-BMIqhbpK.js.map} +1 -1
- package/build/{component-DbRG0dzX.cjs → component-BPtJjkt0.cjs} +2 -2
- package/build/{component-DbRG0dzX.cjs.map → component-BPtJjkt0.cjs.map} +1 -1
- package/build/{component-CATlnN8o.js → component-BTPma8cy.js} +4 -4
- package/build/{component-CATlnN8o.js.map → component-BTPma8cy.js.map} +1 -1
- package/build/{component-DpX5Qw3i.js → component-BWvIUzNG.js} +3 -3
- package/build/{component-DpX5Qw3i.js.map → component-BWvIUzNG.js.map} +1 -1
- package/build/{component-DAocGHCP.js → component-C6JGm-CG.js} +3 -3
- package/build/{component-DAocGHCP.js.map → component-C6JGm-CG.js.map} +1 -1
- package/build/{component-CGPZf0Mx.js → component-C9Uf5Bc0.js} +3 -3
- package/build/{component-CGPZf0Mx.js.map → component-C9Uf5Bc0.js.map} +1 -1
- package/build/{component-CM4bf3RV.cjs → component-CAWbX2_9.cjs} +2 -2
- package/build/{component-CM4bf3RV.cjs.map → component-CAWbX2_9.cjs.map} +1 -1
- package/build/{component-B8kWtTfs.cjs → component-CEZKgFH6.cjs} +2 -2
- package/build/{component-B8kWtTfs.cjs.map → component-CEZKgFH6.cjs.map} +1 -1
- package/build/{component-DJDXAzlq.js → component-CHp7GYey.js} +4 -4
- package/build/{component-DJDXAzlq.js.map → component-CHp7GYey.js.map} +1 -1
- package/build/{component-C8ueaiSO.cjs → component-COXlMHO8.cjs} +2 -2
- package/build/{component-C8ueaiSO.cjs.map → component-COXlMHO8.cjs.map} +1 -1
- package/build/{component-DIk87lHF.cjs → component-Cao-X0at.cjs} +2 -2
- package/build/{component-DIk87lHF.cjs.map → component-Cao-X0at.cjs.map} +1 -1
- package/build/{component-Cp8VTqb2.js → component-Cfs39n8Q.js} +2 -2
- package/build/{component-Cp8VTqb2.js.map → component-Cfs39n8Q.js.map} +1 -1
- package/build/{component-BzWpboBU.cjs → component-Co53yylj.cjs} +2 -2
- package/build/{component-BzWpboBU.cjs.map → component-Co53yylj.cjs.map} +1 -1
- package/build/{component-5Utdcc2G.cjs → component-CoOTSdM5.cjs} +2 -2
- package/build/{component-5Utdcc2G.cjs.map → component-CoOTSdM5.cjs.map} +1 -1
- package/build/component-Cu2i_-RT.cjs +2 -0
- package/build/{component-Cc8X-Z80.cjs.map → component-Cu2i_-RT.cjs.map} +1 -1
- package/build/{component-DwVvs3yX.cjs → component-CwKwQY3p.cjs} +2 -2
- package/build/{component-DwVvs3yX.cjs.map → component-CwKwQY3p.cjs.map} +1 -1
- package/build/{component-DHM9pbab.js → component-D-HMYzXU.js} +3 -3
- package/build/{component-DHM9pbab.js.map → component-D-HMYzXU.js.map} +1 -1
- package/build/{component-Duwta9MT.js → component-D3jtUpu3.js} +3 -3
- package/build/{component-Duwta9MT.js.map → component-D3jtUpu3.js.map} +1 -1
- package/build/{component-C0354Xwu.js → component-DHwK4xEP.js} +4 -4
- package/build/{component-C0354Xwu.js.map → component-DHwK4xEP.js.map} +1 -1
- package/build/{component-86oA9dYz.cjs → component-DJAq34yj.cjs} +2 -2
- package/build/{component-86oA9dYz.cjs.map → component-DJAq34yj.cjs.map} +1 -1
- package/build/{component-DHXjnBNp.cjs → component-DZbtSeCS.cjs} +2 -2
- package/build/{component-DHXjnBNp.cjs.map → component-DZbtSeCS.cjs.map} +1 -1
- package/build/{component-BD3FCIT8.js → component-DcOrj2ff.js} +4 -4
- package/build/{component-BD3FCIT8.js.map → component-DcOrj2ff.js.map} +1 -1
- package/build/{component-DIA35EVR.js → component-Dcn4OKm7.js} +5 -5
- package/build/{component-DIA35EVR.js.map → component-Dcn4OKm7.js.map} +1 -1
- package/build/{component-CLqcB5mM.cjs → component-DqV_-YxZ.cjs} +2 -2
- package/build/{component-CLqcB5mM.cjs.map → component-DqV_-YxZ.cjs.map} +1 -1
- package/build/{component-CANbSEA3.cjs → component-DsLJSX6q.cjs} +2 -2
- package/build/{component-CANbSEA3.cjs.map → component-DsLJSX6q.cjs.map} +1 -1
- package/build/component-accordion.cjs.js +1 -1
- package/build/component-accordion.d.ts +26 -6
- package/build/component-accordion.es.js +2 -2
- package/build/component-button-group.cjs.js +1 -1
- package/build/component-button-group.es.js +2 -2
- package/build/component-button.cjs.js +1 -1
- package/build/component-button.d.ts +5 -4
- package/build/component-button.es.js +1 -1
- package/build/component-checkbox-group.cjs.js +1 -1
- package/build/component-checkbox-group.es.js +2 -2
- package/build/component-checkbox.cjs.js +1 -1
- package/build/component-checkbox.es.js +2 -2
- package/build/component-date-picker.cjs.js +1 -1
- package/build/component-date-picker.d.ts +9 -8
- package/build/component-date-picker.es.js +2 -2
- package/build/{component-DEZX8aBs.js → component-gcvwlILJ.js} +3 -3
- package/build/{component-DEZX8aBs.js.map → component-gcvwlILJ.js.map} +1 -1
- package/build/component-icon.cjs.js +1 -1
- package/build/component-icon.d.ts +37 -4
- package/build/component-icon.es.js +1 -1
- package/build/component-image-button.cjs.js +1 -1
- package/build/component-image-button.es.js +1 -1
- package/build/component-image-select.cjs.js +1 -1
- package/build/component-image-select.d.ts +8 -6
- package/build/component-image-select.es.js +2 -2
- package/build/component-image-slider.cjs.js +1 -1
- package/build/component-image-slider.d.ts +1 -1
- package/build/component-image-slider.es.js +2 -2
- package/build/component-image.cjs.js +1 -1
- package/build/component-image.es.js +2 -2
- package/build/component-input-otp.cjs.js +1 -1
- package/build/component-input-otp.d.ts +6 -4
- package/build/component-input-otp.es.js +2 -2
- package/build/component-input.cjs.js +1 -1
- package/build/component-input.d.ts +7 -6
- package/build/component-input.es.js +2 -2
- package/build/component-pagination.cjs.js +1 -1
- package/build/component-pagination.es.js +1 -1
- package/build/{component-skAuX4C8.cjs → component-qR0HPUpL.cjs} +2 -2
- package/build/{component-skAuX4C8.cjs.map → component-qR0HPUpL.cjs.map} +1 -1
- package/build/component-range.cjs.js +1 -1
- package/build/component-range.d.ts +6 -4
- package/build/component-range.es.js +5 -5
- package/build/component-ripple.cjs.js +1 -1
- package/build/component-ripple.d.ts +6 -4
- package/build/component-ripple.es.js +2 -2
- package/build/component-select.cjs.js +1 -1
- package/build/component-select.d.ts +115 -32
- package/build/component-select.es.js +17 -18
- package/build/component-separator.cjs.js +1 -1
- package/build/component-separator.d.ts +5 -3
- package/build/component-separator.es.js +1 -1
- package/build/component-stack.cjs.js +1 -1
- package/build/component-stack.d.ts +6 -4
- package/build/component-stack.es.js +1 -1
- package/build/component-textarea.cjs.js +1 -1
- package/build/component-textarea.d.ts +7 -5
- package/build/component-textarea.es.js +5 -5
- package/build/component-toggle.cjs.js +1 -1
- package/build/component-toggle.es.js +4 -4
- package/build/component-tooltip.cjs.js +1 -1
- package/build/component-tooltip.d.ts +71 -9
- package/build/component-tooltip.es.js +9 -9
- package/build/component-typography.cjs.js +1 -1
- package/build/component-typography.d.ts +5 -3
- package/build/component-typography.es.js +6 -6
- package/build/{component.constants-BgV35uxo.cjs → component.constants-CuYFwf5W.cjs} +2 -2
- package/build/{component.constants-BgV35uxo.cjs.map → component.constants-CuYFwf5W.cjs.map} +1 -1
- package/build/{component.constants-C4Du7oRP.cjs → component.constants-D80V6i-m.cjs} +2 -2
- package/build/{component.constants-C4Du7oRP.cjs.map → component.constants-D80V6i-m.cjs.map} +1 -1
- package/build/{component.constants-Be7PPP03.js → component.constants-Dulpp7av.js} +4 -4
- package/build/{component.constants-Be7PPP03.js.map → component.constants-Dulpp7av.js.map} +1 -1
- package/build/{component.constants-DbWj5l8e.js → component.constants-DybDxNgw.js} +7 -7
- package/build/{component.constants-DbWj5l8e.js.map → component.constants-DybDxNgw.js.map} +1 -1
- package/build/{component.styles-Dpg-__rn.cjs → component.styles-BX2Aiqp_.cjs} +2 -2
- package/build/{component.styles-Dpg-__rn.cjs.map → component.styles-BX2Aiqp_.cjs.map} +1 -1
- package/build/{component.styles-B0L4jbOO.js → component.styles-C0oU5oX_.js} +2 -2
- package/build/{component.styles-B0L4jbOO.js.map → component.styles-C0oU5oX_.js.map} +1 -1
- package/build/{component.types-B3IQzYHq.js → component.types-BbfCiww_.js} +19 -18
- package/build/component.types-BbfCiww_.js.map +1 -0
- package/build/component.types-KTSAVZtM.cjs +2 -0
- package/build/component.types-KTSAVZtM.cjs.map +1 -0
- package/build/consts.cjs.js +1 -1
- package/build/consts.cjs.js.map +1 -1
- package/build/consts.d.ts +2 -13
- package/build/consts.es.js +1 -29
- package/build/consts.es.js.map +1 -1
- package/build/{context-q6vhN54o.cjs → context-B1id3uai.cjs} +2 -2
- package/build/{context-q6vhN54o.cjs.map → context-B1id3uai.cjs.map} +1 -1
- package/build/{context-Cr9zS5ai.cjs → context-B8kTBKjt.cjs} +2 -2
- package/build/{context-Cr9zS5ai.cjs.map → context-B8kTBKjt.cjs.map} +1 -1
- package/build/{context-B1DS5U6M.js → context-BkovkNHQ.js} +2 -2
- package/build/{context-B1DS5U6M.js.map → context-BkovkNHQ.js.map} +1 -1
- package/build/context-C0_RNFp_.js +195 -0
- package/build/context-C0_RNFp_.js.map +1 -0
- package/build/context-DyTE2I_6.cjs +4 -0
- package/build/context-DyTE2I_6.cjs.map +1 -0
- package/build/{context-CU_dgoUl.js → context-LBih45kv.js} +3 -3
- package/build/{context-CU_dgoUl.js.map → context-LBih45kv.js.map} +1 -1
- package/build/context-app.cjs.js +1 -1
- package/build/context-app.d.ts +13 -12
- package/build/context-app.es.js +17 -17
- package/build/context-cookie.cjs.js +1 -1
- package/build/context-cookie.es.js +2 -2
- package/build/context-dialog.cjs.js +1 -1
- package/build/context-dialog.d.ts +5 -3
- package/build/context-dialog.es.js +2 -2
- package/build/context-geolocation.cjs.js +1 -1
- package/build/context-geolocation.es.js +2 -2
- package/build/context-local-storage.cjs.js +1 -1
- package/build/context-local-storage.es.js +2 -2
- package/build/context-permission.cjs.js +1 -1
- package/build/context-permission.es.js +1 -1
- package/build/context-screen-width.cjs.js +1 -1
- package/build/context-screen-width.es.js +1 -1
- package/build/context-sonner.cjs.js +1 -1
- package/build/context-sonner.d.ts +8 -7
- package/build/context-sonner.es.js +18 -18
- package/build/context.constants-BWZS-di6.cjs +32 -0
- package/build/context.constants-BWZS-di6.cjs.map +1 -0
- package/build/{context.constants-YlWOZAd7.js → context.constants-Bh-ajJM2.js} +4385 -457
- package/build/context.constants-Bh-ajJM2.js.map +1 -0
- package/build/context.constants-CDgzMcxb.cjs +1742 -0
- package/build/context.constants-CDgzMcxb.cjs.map +1 -0
- package/build/{context.constants-CZykW9B3.js → context.constants-Nfy-8Qzj.js} +39 -5
- package/build/context.constants-Nfy-8Qzj.js.map +1 -0
- package/build/context.functions-B8FDl7nJ.js.map +1 -1
- package/build/{context.functions-Bk5xMi0w.cjs → context.functions-BqeTmcmr.cjs} +2 -2
- package/build/{context.functions-Bk5xMi0w.cjs.map → context.functions-BqeTmcmr.cjs.map} +1 -1
- package/build/{context.functions-54_96FIi.js → context.functions-D2K4Xk47.js} +4 -5
- package/build/{context.functions-54_96FIi.js.map → context.functions-D2K4Xk47.js.map} +1 -1
- package/build/context.functions-Duwzgcga.cjs +2 -0
- package/build/{context.functions-BoRkDnCa.cjs.map → context.functions-Duwzgcga.cjs.map} +1 -1
- package/build/{context.functions-X5gRRpKi.js → context.functions-ObfwvEVG.js} +2 -2
- package/build/{context.functions-X5gRRpKi.js.map → context.functions-ObfwvEVG.js.map} +1 -1
- package/build/{context.hooks-7ydA7mGj.js → context.hooks-B9dsW2kz.js} +2 -2
- package/build/{context.hooks-7ydA7mGj.js.map → context.hooks-B9dsW2kz.js.map} +1 -1
- package/build/{context.hooks-CnqRriMa.js → context.hooks-BG1tp2nc.js} +2 -2
- package/build/{context.hooks-CnqRriMa.js.map → context.hooks-BG1tp2nc.js.map} +1 -1
- package/build/{context.hooks-B1QdI16d.cjs → context.hooks-BIfYPHOA.cjs} +2 -2
- package/build/{context.hooks-B1QdI16d.cjs.map → context.hooks-BIfYPHOA.cjs.map} +1 -1
- package/build/context.hooks-Biv8ZMzm.cjs +2 -0
- package/build/{context.hooks-DDtUqE34.cjs.map → context.hooks-Biv8ZMzm.cjs.map} +1 -1
- package/build/{context.hooks-D23gzlbO.cjs → context.hooks-BpQriPdQ.cjs} +2 -2
- package/build/{context.hooks-D23gzlbO.cjs.map → context.hooks-BpQriPdQ.cjs.map} +1 -1
- package/build/{context.hooks-uRILnzQk.js → context.hooks-CXJ-eM6d.js} +2 -2
- package/build/{context.hooks-uRILnzQk.js.map → context.hooks-CXJ-eM6d.js.map} +1 -1
- package/build/context.hooks-CYJnoIrt.cjs +2 -0
- package/build/{context.hooks-OTo7Znss.cjs.map → context.hooks-CYJnoIrt.cjs.map} +1 -1
- package/build/{context.hooks-BIsapq-0.cjs → context.hooks-DDD8ffJI.cjs} +2 -2
- package/build/{context.hooks-BIsapq-0.cjs.map → context.hooks-DDD8ffJI.cjs.map} +1 -1
- package/build/{context.hooks-D0OtRPb7.js → context.hooks-DGYU76JL.js} +2 -3
- package/build/{context.hooks-D0OtRPb7.js.map → context.hooks-DGYU76JL.js.map} +1 -1
- package/build/{context.hooks-D13tbrva.cjs → context.hooks-DpwnIiRj.cjs} +2 -2
- package/build/{context.hooks-D13tbrva.cjs.map → context.hooks-DpwnIiRj.cjs.map} +1 -1
- package/build/{context.hooks-Bl4gTFVP.js → context.hooks-Dx80dbrI.js} +2 -2
- package/build/{context.hooks-Bl4gTFVP.js.map → context.hooks-Dx80dbrI.js.map} +1 -1
- package/build/{context.hooks-BmwyZ1p3.js → context.hooks-oclt34zD.js} +2 -2
- package/build/{context.hooks-BmwyZ1p3.js.map → context.hooks-oclt34zD.js.map} +1 -1
- package/build/functions.es.js.map +1 -1
- package/build/index.cjs.js +1 -1
- package/build/index.d.ts +71 -212
- package/build/index.es.js +144 -161
- package/build/index.es.js.map +1 -1
- package/build/jsx-runtime-C6yv_9g1.cjs +11 -0
- package/build/jsx-runtime-C6yv_9g1.cjs.map +1 -0
- package/build/{jsx-runtime-BrDlu8eK.js → jsx-runtime-DZS36FSE.js} +16 -20
- package/build/jsx-runtime-DZS36FSE.js.map +1 -0
- package/build/{motion-DgB7M2Hn.cjs → motion-DrSN18V7.cjs} +2 -2
- package/build/{motion-DgB7M2Hn.cjs.map → motion-DrSN18V7.cjs.map} +1 -1
- package/build/{motion-CIQfrLky.js → motion-K7hUU4gL.js} +2 -2
- package/build/{motion-CIQfrLky.js.map → motion-K7hUU4gL.js.map} +1 -1
- package/build/style-error.cjs.js +1 -1
- package/build/style-error.d.ts +5 -3
- package/build/style-error.es.js +4 -4
- package/build/style-motion.cjs.js +1 -1
- package/build/style-motion.es.js +1 -1
- package/build/style-plT9Ah7t.js.map +1 -1
- package/build/style-sx.d.ts +5 -3
- package/build/style-theme.cjs.js +1 -1
- package/build/style-theme.es.js +13 -13
- package/build/use-Bp8UVw4Y.js.map +1 -1
- package/build/{use-JWHe9gP5.js → use-CGZzVbz2.js} +28 -11
- package/build/use-CGZzVbz2.js.map +1 -0
- package/build/use-DEkooQyB.cjs +16 -0
- package/build/use-DEkooQyB.cjs.map +1 -0
- package/build/use-DT0XgvJT.js.map +1 -1
- package/package.json +3 -29
- package/build/component-Cc8X-Z80.cjs +0 -2
- package/build/component-map.cjs.js +0 -2
- package/build/component-map.cjs.js.map +0 -1
- package/build/component-map.d.ts +0 -96
- package/build/component-map.es.js +0 -19
- package/build/component-map.es.js.map +0 -1
- package/build/component.components-83DbC_hw.js +0 -336
- package/build/component.components-83DbC_hw.js.map +0 -1
- package/build/component.components-BjdoMO5R.cjs +0 -2
- package/build/component.components-BjdoMO5R.cjs.map +0 -1
- package/build/component.types-B3IQzYHq.js.map +0 -1
- package/build/component.types-C6Zrax1A.cjs +0 -2
- package/build/component.types-C6Zrax1A.cjs.map +0 -1
- package/build/context-BxU5kwVR.js +0 -98
- package/build/context-BxU5kwVR.js.map +0 -1
- package/build/context-_4lcMeym.cjs +0 -2
- package/build/context-_4lcMeym.cjs.map +0 -1
- package/build/context.constants-BMJ3rLa_.cjs +0 -1748
- package/build/context.constants-BMJ3rLa_.cjs.map +0 -1
- package/build/context.constants-CZykW9B3.js.map +0 -1
- package/build/context.constants-YlWOZAd7.js.map +0 -1
- package/build/context.constants-wztrdG5Q.cjs +0 -32
- package/build/context.constants-wztrdG5Q.cjs.map +0 -1
- package/build/context.functions-BoRkDnCa.cjs +0 -2
- package/build/context.hooks-DDtUqE34.cjs +0 -2
- package/build/context.hooks-OTo7Znss.cjs +0 -2
- package/build/jsx-runtime-BcGej2Kr.cjs +0 -11
- package/build/jsx-runtime-BcGej2Kr.cjs.map +0 -1
- package/build/jsx-runtime-BrDlu8eK.js.map +0 -1
- package/build/style.css +0 -1
- package/build/use-DZU4NdpU.cjs +0 -16
- package/build/use-DZU4NdpU.cjs.map +0 -1
- package/build/use-JWHe9gP5.js.map +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { AnimatePresence, motion } from "framer-motion";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { h as addOutline } from "./style-BfuEu91g.js";
|
|
4
|
-
import { j as jsxRuntimeExports } from "./jsx-runtime-
|
|
5
|
-
import { O as Outside } from "./area-
|
|
4
|
+
import { j as jsxRuntimeExports } from "./jsx-runtime-DZS36FSE.js";
|
|
5
|
+
import { O as Outside } from "./area-B6xxVQ87.js";
|
|
6
6
|
import { createContext, memo, useState, useCallback, useMemo } from "react";
|
|
7
|
-
import "uuid";
|
|
8
7
|
const DialogContext = createContext(null);
|
|
9
8
|
const ProviderDialog = (props) => {
|
|
10
9
|
const [dialogHistory, setDialogHistory] = useState([]);
|
|
@@ -121,6 +120,40 @@ const DialogElement = (props) => {
|
|
|
121
120
|
) });
|
|
122
121
|
};
|
|
123
122
|
const MemoizedDialogElement = memo(DialogElement);
|
|
123
|
+
const byteToHex = [];
|
|
124
|
+
for (let i = 0; i < 256; ++i) {
|
|
125
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
126
|
+
}
|
|
127
|
+
function unsafeStringify(arr, offset = 0) {
|
|
128
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
129
|
+
}
|
|
130
|
+
let getRandomValues;
|
|
131
|
+
const rnds8 = new Uint8Array(16);
|
|
132
|
+
function rng() {
|
|
133
|
+
if (!getRandomValues) {
|
|
134
|
+
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
135
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
136
|
+
}
|
|
137
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
138
|
+
}
|
|
139
|
+
return getRandomValues(rnds8);
|
|
140
|
+
}
|
|
141
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
142
|
+
const native = { randomUUID };
|
|
143
|
+
function v4(options, buf, offset) {
|
|
144
|
+
var _a;
|
|
145
|
+
if (native.randomUUID && true && !options) {
|
|
146
|
+
return native.randomUUID();
|
|
147
|
+
}
|
|
148
|
+
options = options || {};
|
|
149
|
+
const rnds = options.random ?? ((_a = options.rng) == null ? void 0 : _a.call(options)) ?? rng();
|
|
150
|
+
if (rnds.length < 16) {
|
|
151
|
+
throw new Error("Random bytes length must be >= 16");
|
|
152
|
+
}
|
|
153
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
154
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
155
|
+
return unsafeStringify(rnds);
|
|
156
|
+
}
|
|
124
157
|
const DialogLayout = styled(motion.div)`
|
|
125
158
|
position: fixed;
|
|
126
159
|
flex: 1;
|
|
@@ -188,6 +221,7 @@ export {
|
|
|
188
221
|
DEFAULT_PROVIDER_DIALOG_ELEMENT_MAX_WIDTH as g,
|
|
189
222
|
DEFAULT_PROVIDER_DIALOG_ELEMENT_BORDER_RADIUS as h,
|
|
190
223
|
DEFAULT_PROVIDER_DIALOG_ELEMENT_PADDING as i,
|
|
191
|
-
DEFAULT_PROVIDER_DIALOG_ELEMENT_BACKGROUND as j
|
|
224
|
+
DEFAULT_PROVIDER_DIALOG_ELEMENT_BACKGROUND as j,
|
|
225
|
+
v4 as v
|
|
192
226
|
};
|
|
193
|
-
//# sourceMappingURL=context.constants-
|
|
227
|
+
//# sourceMappingURL=context.constants-Nfy-8Qzj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.constants-Nfy-8Qzj.js","sources":["../src/contexts/context-dialog/context.tsx","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js","../src/contexts/context-dialog/context.styles.tsx","../src/contexts/context-dialog/context.constants.ts"],"sourcesContent":["import { Outside } from '@local/areas/outside';\n\nimport { AnimatePresence } from 'framer-motion';\nimport { createContext, FC, memo, useCallback, useMemo, useState } from 'react';\n\nimport {\n DEFAULT_PROVIDER_DIALOG_DURATION_ELEMENT,\n DEFAULT_PROVIDER_DIALOG_DURATION_LAYOUT,\n DialogContentProps,\n DialogContextProps,\n DialogElementProps,\n DialogElementWrapper,\n DialogLayout,\n ProviderDialogProps,\n} from '.';\n\nexport const DialogContext = createContext<DialogContextProps<object> | null>(null);\n\nexport const ProviderDialog: FC<ProviderDialogProps> = (props) => {\n const [dialogHistory, setDialogHistory] = useState<DialogContentProps<object>[]>([]);\n\n const remove: DialogContextProps<object>['remove'] = useCallback((id) => {\n setDialogHistory((prev) => {\n const itemToRemove = prev.find((item) => item.id === id);\n\n if (!itemToRemove) return prev;\n\n const indexToRemove = itemToRemove.index!;\n\n const updatedHistory = prev\n .filter((item) => item.id !== id)\n .map((item) => ({\n ...item,\n index: item.index! > indexToRemove ? item.index! - 1 : item.index,\n }));\n\n return updatedHistory;\n });\n }, []);\n\n const update: DialogContextProps<object>['update'] = useCallback((dialog) => {\n setDialogHistory((prev) => {\n return prev.map((item) => {\n if (item.id === dialog.id) {\n return { ...item, ...dialog };\n }\n return item;\n });\n });\n }, []);\n\n const add: DialogContextProps<object>['add'] = useCallback((dialog) => {\n const id = dialog.id;\n\n setDialogHistory((prev) => {\n const existingIndex = prev.findIndex((item) => item.id === id);\n\n let updatedHistory;\n if (existingIndex !== -1) {\n updatedHistory = [...prev];\n updatedHistory[existingIndex] = { ...dialog, id, index: prev[existingIndex].index };\n } else {\n updatedHistory = prev.map((item) => ({\n ...item,\n index: item.index! + 1,\n }));\n const newContent = { ...dialog, id, index: 0 };\n updatedHistory.unshift(newContent);\n }\n\n return updatedHistory;\n });\n }, []);\n\n const dialogHistoryLength = useMemo(() => dialogHistory.length, [dialogHistory.length]);\n const zIndex = useMemo(() => props.zIndex, [props.zIndex]);\n\n return (\n <DialogContext.Provider value={{ add, remove, update, dialogHistory }}>\n <AnimatePresence>\n {dialogHistoryLength && (\n <DialogLayout\n $zIndex={zIndex}\n initial={{\n opacity: 0,\n }}\n exit={{\n opacity: 0,\n }}\n animate={{\n opacity: 1,\n }}\n transition={{ type: 'spring', duration: DEFAULT_PROVIDER_DIALOG_DURATION_LAYOUT }}\n >\n {dialogHistory.map((dialog) => {\n const index = dialog.index;\n const content = dialog.content;\n const id = dialog.id;\n const props = dialog.props;\n\n return (\n <MemoizedDialogElement\n index={index}\n content={content}\n props={props}\n key={id}\n id={id}\n remove={() => remove(id)}\n />\n );\n })}\n </DialogLayout>\n )}\n </AnimatePresence>\n\n {props.children}\n </DialogContext.Provider>\n );\n};\n\nconst DialogElement = (props: DialogElementProps) => {\n const [isAnimating, setIsAnimating] = useState(true);\n return (\n <Outside onOutsideClick={() => props.remove()}>\n <DialogElementWrapper\n key={props.id}\n initial={{\n opacity: 0,\n scale: 0.8,\n }}\n animate={{\n opacity: 1,\n scale: 1,\n }}\n onAnimationComplete={() => setIsAnimating(false)}\n transition={{\n type: 'spring',\n duration: DEFAULT_PROVIDER_DIALOG_DURATION_ELEMENT,\n delay: DEFAULT_PROVIDER_DIALOG_DURATION_LAYOUT,\n }}\n style={{\n zIndex: -props.index!,\n }}\n $isDisabledOutline={props.props?.propsDialog?.isDisabledOutline}\n $isOutlineBoxShadow={props.props?.propsDialog?.isOutlineBoxShadow}\n $isReadOnly={props.props?.propsDialog?.isReadOnly}\n $propsDialog={props.props?.propsDialog}\n >\n {props.content?.(props.props, props.remove, isAnimating)}\n </DialogElementWrapper>\n </Outside>\n );\n};\nconst MemoizedDialogElement = memo(DialogElement);\n","import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n","import { motion } from 'framer-motion';\nimport styled from 'styled-components';\n\nimport { addOutline } from '@local/styles/add';\n\nimport {\n DEFAULT_PROVIDER_DIALOG_ELEMENT_BACKGROUND,\n DEFAULT_PROVIDER_DIALOG_ELEMENT_BORDER_RADIUS,\n DEFAULT_PROVIDER_DIALOG_ELEMENT_MAX_HEIGHT,\n DEFAULT_PROVIDER_DIALOG_ELEMENT_MAX_WIDTH,\n DEFAULT_PROVIDER_DIALOG_ELEMENT_PADDING,\n DialogElementWrapperProps,\n DialogLayoutProps,\n} from '.';\n\nexport const DialogLayout = styled(motion.div)<DialogLayoutProps>`\n position: fixed;\n flex: 1;\n width: 100%;\n height: 100%;\n background-color: ${(props) => props.theme.palette.black50};\n z-index: ${(props) => props.$zIndex};\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n`;\n\nexport const DialogElementWrapper = styled(motion.dialog)<DialogElementWrapperProps>`\n ${addOutline};\n max-width: ${(props) => props.$propsDialog?.maxWidth || DEFAULT_PROVIDER_DIALOG_ELEMENT_MAX_WIDTH};\n max-height: ${(props) => props.$propsDialog?.maxHeight || DEFAULT_PROVIDER_DIALOG_ELEMENT_MAX_HEIGHT};\n border-radius: ${(props) => props.$propsDialog?.borderRadius || DEFAULT_PROVIDER_DIALOG_ELEMENT_BORDER_RADIUS};\n background: ${(props) =>\n props.$propsDialog?.background\n ? props.theme.palette[props.$propsDialog.background]\n : props.theme.palette[DEFAULT_PROVIDER_DIALOG_ELEMENT_BACKGROUND]};\n padding: ${(props) => props.$propsDialog?.padding || DEFAULT_PROVIDER_DIALOG_ELEMENT_PADDING};\n width: max-content;\n height: max-content;\n border: 0;\n display: flex;\n flex-direction: column;\n gap: 10px;\n align-items: flex-start;\n justify-content: flex-start;\n flex-shrink: 0;\n position: relative;\n box-shadow: 0px 10px 30px 0px rgba(0, 0, 0, 0.2);\n overflow: hidden;\n`;\nexport const DialogContent = styled(motion.div)``;\n","import { IThemePaletteKeys } from '@local/theme';\n\nexport const DEFAULT_PROVIDER_DIALOG_DURATION_ELEMENT = 0.3;\nexport const DEFAULT_PROVIDER_DIALOG_DURATION_LAYOUT = 0.4;\nexport const DEFAULT_PROVIDER_DIALOG_ELEMENT_MAX_HEIGHT: string = 'max-content';\nexport const DEFAULT_PROVIDER_DIALOG_ELEMENT_MAX_WIDTH: string = 'max-content';\nexport const DEFAULT_PROVIDER_DIALOG_ELEMENT_BORDER_RADIUS: string = '12px';\nexport const DEFAULT_PROVIDER_DIALOG_ELEMENT_PADDING: string = '20px';\nexport const DEFAULT_PROVIDER_DIALOG_ELEMENT_BACKGROUND: IThemePaletteKeys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AA,aAC/C,CAAC,UAAU,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9B,MAAM,uBAAuB,OAAO,OAAO,MAAM;AAAA,IACpD,UAAU;AAAA,eACC,CAAC,UAAA;;AAAU,sBAAM,iBAAN,mBAAoB,aAAY;AAAA,CAAyC;AAAA,gBACnF,CAAC,UAAA;;AAAU,sBAAM,iBAAN,mBAAoB,cAAa;AAAA,CAA0C;AAAA,mBACnF,CAAC,UAAA;;AAAU,sBAAM,iBAAN,mBAAoB,iBAAgB;AAAA,CAA6C;AAAA,gBAC/F,CAAC,UAAA;;AACb,sBAAM,iBAAN,mBAAoB,cAChB,MAAM,MAAM,QAAQ,MAAM,aAAa,UAAU,IACjD,MAAM,MAAM,QAAQ,0CAA0C;AAAA,CAAC;AAAA,aAC1D,CAAC,UAAA;;AAAU,sBAAM,iBAAN,mBAAoB,YAAW;AAAA,CAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcvF,MAAM,gBAAgB,OAAO,OAAO,GAAG;ACjDvC,MAAM,2CAA2C;AACjD,MAAM,0CAA0C;AAChD,MAAM,6CAAqD;AAC3D,MAAM,4CAAoD;AAC1D,MAAM,gDAAwD;AAC9D,MAAM,0CAAkD;AACxD,MAAM,6CAAgE;","x_google_ignoreList":[1,2,3,4]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.functions-B8FDl7nJ.js","sources":["../src/contexts/context-permission/context.functions.ts"],"sourcesContent":["export const urlBase64ToUint8Array = (base64String: string) => {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n};\n"],"names":[],"mappings":"AAAO,MAAM,wBAAwB,CAAC,iBAAyB;AAC7D,QAAM,UAAU,IAAI,QAAQ,IAAK,aAAa,SAAS,KAAM,CAAC;AAC9D,QAAM,UAAU,eAAe,SAAS,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,GAAG;AAE5E,QAAM,UAAU,OAAO,KAAK,MAAM;AAClC,QAAM,cAAc,IAAI,WAAW,QAAQ,MAAM;AAEjD,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,EAAE,GAAG;AACvC,gBAAY,CAAC,IAAI,QAAQ,WAAW,CAAC;AAAA,
|
|
1
|
+
{"version":3,"file":"context.functions-B8FDl7nJ.js","sources":["../src/contexts/context-permission/context.functions.ts"],"sourcesContent":["export const urlBase64ToUint8Array = (base64String: string) => {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n};\n"],"names":[],"mappings":"AAAO,MAAM,wBAAwB,CAAC,iBAAyB;AAC7D,QAAM,UAAU,IAAI,QAAQ,IAAK,aAAa,SAAS,KAAM,CAAC;AAC9D,QAAM,UAAU,eAAe,SAAS,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,GAAG;AAE5E,QAAM,UAAU,OAAO,KAAK,MAAM;AAClC,QAAM,cAAc,IAAI,WAAW,QAAQ,MAAM;AAEjD,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,EAAE,GAAG;AACvC,gBAAY,CAAC,IAAI,QAAQ,WAAW,CAAC;AAAA,EACvC;AAEA,SAAO;AACT;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("react"),t=require("./context-
|
|
2
|
-
//# sourceMappingURL=context.functions-
|
|
1
|
+
"use strict";const r=require("react"),t=require("./context-B1id3uai.cjs");exports.getFromLocalStorage=function(r){const t=localStorage.getItem(r);if(t)try{return JSON.parse(t)}catch(e){return console.error(`Error parsing localStorage item "${r}":`,e),null}return null},exports.setToLocalStorage=function(r,t){try{const e=JSON.stringify(t);localStorage.setItem(r,e)}catch(e){console.error(`Error setting localStorage item "${r}":`,e)}},exports.useLocalStorage=()=>{const e=r.useContext(t.LocalStorageContext);if(!e)throw new Error("useLocalStorage must be used within an ProviderLocalStorage");return e};
|
|
2
|
+
//# sourceMappingURL=context.functions-BqeTmcmr.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.functions-
|
|
1
|
+
{"version":3,"file":"context.functions-BqeTmcmr.cjs","sources":["../src/contexts/context-local-storage/context.functions.ts","../src/contexts/context-local-storage/context.hooks.ts"],"sourcesContent":["export function getFromLocalStorage<T>(key: string): T | null {\n const item = localStorage.getItem(key);\n if (item) {\n try {\n return JSON.parse(item) as T;\n } catch (error) {\n console.error(`Error parsing localStorage item \"${key}\":`, error);\n return null;\n }\n }\n return null;\n}\n\nexport function setToLocalStorage<T>(key: string, value: T): void {\n try {\n const item = JSON.stringify(value);\n localStorage.setItem(key, item);\n } catch (error) {\n console.error(`Error setting localStorage item \"${key}\":`, error);\n }\n}\n","import { useContext } from 'react';\n\nimport { LocalStorageContext, LocalStorageContextProps } from '.';\n\n/**\n * Custom hook to access the LocalStorageContext.\n */\nexport const useLocalStorage = (): LocalStorageContextProps => {\n const context = useContext(LocalStorageContext);\n if (!context) {\n throw new Error('useLocalStorage must be used within an ProviderLocalStorage');\n }\n return context;\n};\n"],"names":["key","item","localStorage","getItem","JSON","parse","error","console","value","stringify","setItem","context","useContext","LocalStorageContext","Error"],"mappings":"sGAAO,SAAgCA,GACrC,MAAMC,EAAOC,aAAaC,QAAQH,GAClC,GAAIC,EACF,IACE,OAAOG,KAAKC,MAAMJ,EACpB,OAASK,GAEP,OADAC,QAAQD,MAAM,oCAAoCN,MAASM,GACpD,IACT,CAEF,OAAO,IACT,4BAEO,SAA8BN,EAAaQ,GAChD,IACE,MAAMP,EAAOG,KAAKK,UAAUD,GAC5BN,aAAaQ,QAAQV,EAAKC,EAC5B,OAASK,GACPC,QAAQD,MAAM,oCAAoCN,MAASM,EAC7D,CACF,0BCb+B,KAC7B,MAAMK,EAAUC,EAAAA,WAAWC,uBAC3B,IAAKF,EACH,MAAM,IAAIG,MAAM,+DAElB,OAAOH"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { C as CookieContext } from "./context-
|
|
3
|
-
import Cookies from "js-cookie";
|
|
2
|
+
import { C as CookieContext, a as api } from "./context-C0_RNFp_.js";
|
|
4
3
|
const useCookie = () => {
|
|
5
4
|
const context = useContext(CookieContext);
|
|
6
5
|
if (!context) {
|
|
@@ -9,7 +8,7 @@ const useCookie = () => {
|
|
|
9
8
|
return context;
|
|
10
9
|
};
|
|
11
10
|
function getFromCookie(key) {
|
|
12
|
-
const item =
|
|
11
|
+
const item = api.get(key);
|
|
13
12
|
if (item) {
|
|
14
13
|
try {
|
|
15
14
|
return JSON.parse(item);
|
|
@@ -23,7 +22,7 @@ function getFromCookie(key) {
|
|
|
23
22
|
function setToCookie(key, value, options) {
|
|
24
23
|
try {
|
|
25
24
|
const item = JSON.stringify(value);
|
|
26
|
-
|
|
25
|
+
api.set(key, item, options);
|
|
27
26
|
} catch (error) {
|
|
28
27
|
console.error(`Error setting cookie item "${key}":`, error);
|
|
29
28
|
}
|
|
@@ -33,4 +32,4 @@ export {
|
|
|
33
32
|
setToCookie as s,
|
|
34
33
|
useCookie as u
|
|
35
34
|
};
|
|
36
|
-
//# sourceMappingURL=context.functions-
|
|
35
|
+
//# sourceMappingURL=context.functions-D2K4Xk47.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.functions-
|
|
1
|
+
{"version":3,"file":"context.functions-D2K4Xk47.js","sources":["../src/contexts/context-cookie/context.hooks.ts","../src/contexts/context-cookie/context.functions.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { CookieContext, CookieContextProps } from '.';\n\n/**\n * Custom hook to access the CookieContext.\n *\n * @remarks\n * You should understand which cookies you are changing and whether you have access to them.\n *\n */\nexport const useCookie = (): CookieContextProps => {\n const context = useContext(CookieContext);\n if (!context) {\n throw new Error('useCookie must be used within an ProviderCookie');\n }\n return context;\n};\n","import Cookies from 'js-cookie';\n\nimport { CookieAttributes } from '.';\n\nexport function getFromCookie<T>(key: string): T | null {\n const item = Cookies.get(key);\n if (item) {\n try {\n return JSON.parse(item) as T;\n } catch (error) {\n console.error(`Error parsing cookie item \"${key}\":`, error);\n return null;\n }\n }\n return null;\n}\n\nexport function setToCookie<T>(key: string, value: T, options?: CookieAttributes): void {\n try {\n const item = JSON.stringify(value);\n Cookies.set(key, item, options);\n } catch (error) {\n console.error(`Error setting cookie item \"${key}\":`, error);\n }\n}\n"],"names":["Cookies"],"mappings":";;AAWO,MAAM,YAAY,MAA0B;AACjD,QAAM,UAAU,WAAW,aAAa;AACxC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,iDAAiD;AAAA,EACnE;AACA,SAAO;AACT;ACbO,SAAS,cAAiB,KAAuB;AACtD,QAAM,OAAOA,IAAQ,IAAI,GAAG;AAC5B,MAAI,MAAM;AACR,QAAI;AACF,aAAO,KAAK,MAAM,IAAI;AAAA,IACxB,SAAS,OAAO;AACd,cAAQ,MAAM,8BAA8B,GAAG,MAAM,KAAK;AAC1D,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,YAAe,KAAa,OAAU,SAAkC;AACtF,MAAI;AACF,UAAM,OAAO,KAAK,UAAU,KAAK;AACjCA,QAAQ,IAAI,KAAK,MAAM,OAAO;AAAA,EAChC,SAAS,OAAO;AACd,YAAQ,MAAM,8BAA8B,GAAG,MAAM,KAAK;AAAA,EAC5D;AACF;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react"),o=require("./context-DyTE2I_6.cjs");exports.getFromCookie=function(e){const r=o.api.get(e);if(r)try{return JSON.parse(r)}catch(t){return console.error(`Error parsing cookie item "${e}":`,t),null}return null},exports.setToCookie=function(e,r,t){try{const i=JSON.stringify(r);o.api.set(e,i,t)}catch(i){console.error(`Error setting cookie item "${e}":`,i)}},exports.useCookie=()=>{const r=e.useContext(o.CookieContext);if(!r)throw new Error("useCookie must be used within an ProviderCookie");return r};
|
|
2
|
+
//# sourceMappingURL=context.functions-Duwzgcga.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.functions-
|
|
1
|
+
{"version":3,"file":"context.functions-Duwzgcga.cjs","sources":["../src/contexts/context-cookie/context.functions.ts","../src/contexts/context-cookie/context.hooks.ts"],"sourcesContent":["import Cookies from 'js-cookie';\n\nimport { CookieAttributes } from '.';\n\nexport function getFromCookie<T>(key: string): T | null {\n const item = Cookies.get(key);\n if (item) {\n try {\n return JSON.parse(item) as T;\n } catch (error) {\n console.error(`Error parsing cookie item \"${key}\":`, error);\n return null;\n }\n }\n return null;\n}\n\nexport function setToCookie<T>(key: string, value: T, options?: CookieAttributes): void {\n try {\n const item = JSON.stringify(value);\n Cookies.set(key, item, options);\n } catch (error) {\n console.error(`Error setting cookie item \"${key}\":`, error);\n }\n}\n","import { useContext } from 'react';\n\nimport { CookieContext, CookieContextProps } from '.';\n\n/**\n * Custom hook to access the CookieContext.\n *\n * @remarks\n * You should understand which cookies you are changing and whether you have access to them.\n *\n */\nexport const useCookie = (): CookieContextProps => {\n const context = useContext(CookieContext);\n if (!context) {\n throw new Error('useCookie must be used within an ProviderCookie');\n }\n return context;\n};\n"],"names":["key","item","Cookies","get","JSON","parse","error","console","value","options","stringify","set","context","useContext","CookieContext","Error"],"mappings":"gGAIO,SAA0BA,GAC/B,MAAMC,EAAOC,EAAAA,IAAQC,IAAIH,GACzB,GAAIC,EACF,IACE,OAAOG,KAAKC,MAAMJ,EACpB,OAASK,GAEP,OADAC,QAAQD,MAAM,8BAA8BN,MAASM,GAC9C,IACT,CAEF,OAAO,IACT,sBAEO,SAAwBN,EAAaQ,EAAUC,GACpD,IACE,MAAMR,EAAOG,KAAKM,UAAUF,GAC5BN,EAAAA,IAAQS,IAAIX,EAAKC,EAAMQ,EACzB,OAASH,GACPC,QAAQD,MAAM,8BAA8BN,MAASM,EACvD,CACF,oBCbyB,KACvB,MAAMM,EAAUC,EAAAA,WAAWC,iBAC3B,IAAKF,EACH,MAAM,IAAIG,MAAM,mDAElB,OAAOH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { L as LocalStorageContext } from "./context-
|
|
2
|
+
import { L as LocalStorageContext } from "./context-BkovkNHQ.js";
|
|
3
3
|
const useLocalStorage = () => {
|
|
4
4
|
const context = useContext(LocalStorageContext);
|
|
5
5
|
if (!context) {
|
|
@@ -32,4 +32,4 @@ export {
|
|
|
32
32
|
setToLocalStorage as s,
|
|
33
33
|
useLocalStorage as u
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=context.functions-
|
|
35
|
+
//# sourceMappingURL=context.functions-ObfwvEVG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.functions-
|
|
1
|
+
{"version":3,"file":"context.functions-ObfwvEVG.js","sources":["../src/contexts/context-local-storage/context.hooks.ts","../src/contexts/context-local-storage/context.functions.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { LocalStorageContext, LocalStorageContextProps } from '.';\n\n/**\n * Custom hook to access the LocalStorageContext.\n */\nexport const useLocalStorage = (): LocalStorageContextProps => {\n const context = useContext(LocalStorageContext);\n if (!context) {\n throw new Error('useLocalStorage must be used within an ProviderLocalStorage');\n }\n return context;\n};\n","export function getFromLocalStorage<T>(key: string): T | null {\n const item = localStorage.getItem(key);\n if (item) {\n try {\n return JSON.parse(item) as T;\n } catch (error) {\n console.error(`Error parsing localStorage item \"${key}\":`, error);\n return null;\n }\n }\n return null;\n}\n\nexport function setToLocalStorage<T>(key: string, value: T): void {\n try {\n const item = JSON.stringify(value);\n localStorage.setItem(key, item);\n } catch (error) {\n console.error(`Error setting localStorage item \"${key}\":`, error);\n }\n}\n"],"names":[],"mappings":";;AAOO,MAAM,kBAAkB,MAAgC;AAC7D,QAAM,UAAU,WAAW,mBAAmB;AAC9C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,6DAA6D;AAAA,EAC/E;AACA,SAAO;AACT;ACbO,SAAS,oBAAuB,KAAuB;AAC5D,QAAM,OAAO,aAAa,QAAQ,GAAG;AACrC,MAAI,MAAM;AACR,QAAI;AACF,aAAO,KAAK,MAAM,IAAI;AAAA,IACxB,SAAS,OAAO;AACd,cAAQ,MAAM,oCAAoC,GAAG,MAAM,KAAK;AAChE,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,kBAAqB,KAAa,OAAgB;AAChE,MAAI;AACF,UAAM,OAAO,KAAK,UAAU,KAAK;AACjC,iBAAa,QAAQ,KAAK,IAAI;AAAA,EAChC,SAAS,OAAO;AACd,YAAQ,MAAM,oCAAoC,GAAG,MAAM,KAAK;AAAA,EAClE;AACF;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useState, useEffect, useCallback, useContext } from "react";
|
|
2
|
-
import { j as jsxRuntimeExports } from "./jsx-runtime-
|
|
2
|
+
import { j as jsxRuntimeExports } from "./jsx-runtime-DZS36FSE.js";
|
|
3
3
|
const PermissionContext = createContext(null);
|
|
4
4
|
const ProviderPermission = (props) => {
|
|
5
5
|
const { pushNotificationSupported } = usePushNotificationSupported();
|
|
@@ -114,4 +114,4 @@ export {
|
|
|
114
114
|
ProviderPermission as a,
|
|
115
115
|
usePermission as u
|
|
116
116
|
};
|
|
117
|
-
//# sourceMappingURL=context.hooks-
|
|
117
|
+
//# sourceMappingURL=context.hooks-B9dsW2kz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-B9dsW2kz.js","sources":["../src/contexts/context-permission/context.tsx","../src/contexts/context-permission/context.hooks.ts"],"sourcesContent":["import { createContext, useCallback, useEffect, useState } from 'react';\n\nimport { PermissionContextProps, ProviderPermissionProps } from '.';\n\nexport const PermissionContext = createContext<PermissionContextProps | null>(null);\n\nexport const ProviderPermission = (props: ProviderPermissionProps) => {\n const { pushNotificationSupported } = usePushNotificationSupported();\n const { isBiometricSupported } = useBiometricSupported();\n const { notificationPermission, requestNotificationPermission, isNotificationPermissionLoading } =\n useNotificationPermission();\n const { geolocationPermission, requestGeolocationPermission } = useGeolocationPermission();\n\n return (\n <PermissionContext.Provider\n value={{\n isBiometricSupported,\n geolocationPermission,\n pushNotificationSupported,\n requestGeolocationPermission,\n notificationPermission,\n requestNotificationPermission,\n isNotificationPermissionLoading,\n }}\n >\n {props.children}\n </PermissionContext.Provider>\n );\n};\n\nconst useBiometricSupported = () => {\n const [isBiometricSupported, setIsBiometricSupported] = useState(false);\n\n useEffect(() => {\n const checkBiometricAvailability = async () => {\n try {\n if (\n window.PublicKeyCredential &&\n typeof window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable === 'function'\n ) {\n const available = await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();\n setIsBiometricSupported(available);\n } else {\n setIsBiometricSupported(false);\n }\n } catch (error) {\n console.error('Error checking biometric availability:', error);\n setIsBiometricSupported(false);\n }\n };\n\n checkBiometricAvailability();\n }, []);\n\n return { isBiometricSupported };\n};\n\nconst useGeolocationPermission = () => {\n // eslint-disable-next-line no-undef\n const [geolocationPermission, setGeolocationPermission] = useState<PermissionState | null>(null);\n\n useEffect(() => {\n if ('permissions' in window.navigator) {\n window.navigator.permissions.query({ name: 'geolocation' }).then((permissionStatus) => {\n setGeolocationPermission(permissionStatus.state);\n permissionStatus.onchange = () => {\n setGeolocationPermission(permissionStatus.state);\n };\n });\n }\n }, []);\n\n const requestGeolocationPermission = useCallback(() => {\n if ('geolocation' in window.navigator) {\n window.navigator.geolocation.getCurrentPosition(\n () => setGeolocationPermission('granted'),\n () => setGeolocationPermission('denied'),\n );\n } else {\n console.warn('Provider Permission. Geolocation is not supported in this browser.');\n }\n }, []);\n\n return { geolocationPermission, requestGeolocationPermission };\n};\n\nconst useNotificationPermission = () => {\n // eslint-disable-next-line no-undef\n const [notificationPermission, setNotificationPermission] = useState<NotificationPermission | null>(null);\n const [isNotificationPermissionLoading, setIsNotificationPermissionLoading] = useState<boolean>(false);\n\n const requestNotificationPermission = useCallback(async () => {\n setIsNotificationPermissionLoading(true);\n if ('Notification' in window) {\n try {\n setIsNotificationPermissionLoading(true);\n const permission = await window.Notification.requestPermission();\n setNotificationPermission(permission);\n setIsNotificationPermissionLoading(false);\n return permission;\n } catch (error) {\n console.error('Provider Permission. Failed to request notification permission:', error);\n }\n } else {\n console.warn('Provider Permission. Notifications are not supported in this browser.');\n }\n setIsNotificationPermissionLoading(false);\n }, []);\n\n useEffect(() => {\n if ('Notification' in window) {\n setNotificationPermission(window.Notification.permission);\n }\n }, []);\n\n return { notificationPermission, requestNotificationPermission, isNotificationPermissionLoading };\n};\n\nconst usePushNotificationSupported = () => {\n const [pushNotificationSupported, setPushNotificationSupported] = useState<boolean>(false);\n\n useEffect(() => {\n if ('PushManager' in window) {\n setPushNotificationSupported(true);\n }\n }, []);\n\n return { pushNotificationSupported };\n};\n","import { useContext } from 'react';\n\nimport { PermissionContext, PermissionContextProps } from '.';\n\n/**\n * Custom hook to access the PermissionContext.\n */\nexport const usePermission = (): PermissionContextProps => {\n const context = useContext(PermissionContext);\n if (!context) {\n throw new Error('usePermission must be used within an PermissionProvider');\n }\n return context;\n};\n"],"names":["jsx"],"mappings":";;AAIO,MAAM,oBAAoB,cAA6C,IAAI;AAE3E,MAAM,qBAAqB,CAAC,UAAmC;AACpE,QAAM,EAAE,0BAAA,IAA8B,6BAAA;AACtC,QAAM,EAAE,qBAAA,IAAyB,sBAAA;AAC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IAAI,MAAM,yDAAyD;AAAA,EAC3E;AACA,SAAO;AACT;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { aP as AppContext } from "./context.constants-Bh-ajJM2.js";
|
|
3
3
|
const useApp = () => {
|
|
4
4
|
const context = useContext(AppContext);
|
|
5
5
|
if (!context) {
|
|
@@ -10,4 +10,4 @@ const useApp = () => {
|
|
|
10
10
|
export {
|
|
11
11
|
useApp as u
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=context.hooks-
|
|
13
|
+
//# sourceMappingURL=context.hooks-BG1tp2nc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-BG1tp2nc.js","sources":["../src/contexts/context-app/context.hooks.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { AppContext } from '.';\n\n/**\n * Custom hook to access the AppContext.\n */\nexport const useApp = () => {\n const context = useContext(AppContext);\n if (!context) {\n throw new Error('useApp must be used within an ProviderApp');\n }\n return context;\n};\n"],"names":[],"mappings":";;AAOO,MAAM,SAAS,MAAM;AAC1B,QAAM,UAAU,WAAW,UAAU;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,2CAA2C;AAAA,EAC7D;AACA,SAAO;AACT;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react"),t=require("./context.constants-
|
|
2
|
-
//# sourceMappingURL=context.hooks-
|
|
1
|
+
"use strict";const e=require("react"),t=require("./context.constants-CDgzMcxb.cjs");exports.useApp=()=>{const r=e.useContext(t.AppContext);if(!r)throw new Error("useApp must be used within an ProviderApp");return r};
|
|
2
|
+
//# sourceMappingURL=context.hooks-BIfYPHOA.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-BIfYPHOA.cjs","sources":["../src/contexts/context-app/context.hooks.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { AppContext } from '.';\n\n/**\n * Custom hook to access the AppContext.\n */\nexport const useApp = () => {\n const context = useContext(AppContext);\n if (!context) {\n throw new Error('useApp must be used within an ProviderApp');\n }\n return context;\n};\n"],"names":["context","useContext","AppContext","Error"],"mappings":"mGAOsB,KACpB,MAAMA,EAAUC,EAAAA,WAAWC,cAC3B,IAAKF,EACH,MAAM,IAAIG,MAAM,6CAElB,OAAOH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react"),s=require("./use-C1l0O0Qo.cjs"),t=require("./context.constants-BWZS-di6.cjs"),o=()=>{const s=e.useContext(t.DialogContext);if(!s)throw new Error("useDialogs must be used within an ProviderDialog");return s};exports.useDialog=r=>{const{add:i,remove:u,update:a,dialogHistory:n}=o(),[d,c]=e.useState(null),l=e.useCallback(e=>{const s=n.find(s=>s.id===e.id);if(!d||!s){const s=e.id||t.v4();c(s),i({...e,props:r,id:s})}},[i,n,d,r]),p=e.useCallback(()=>{d&&(u(d),c(null))},[d,u]),g=s.useDeepCompareMemoize(r);return e.useEffect(()=>{d&&a({id:d,props:g})},[d,g,a]),{add:l,remove:p,id:d}},exports.useDialogs=o;
|
|
2
|
+
//# sourceMappingURL=context.hooks-Biv8ZMzm.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-Biv8ZMzm.cjs","sources":["../src/contexts/context-dialog/context.hooks.ts"],"sourcesContent":["import { useCallback, useContext, useEffect, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { useDeepCompareMemoize } from '@local/hooks/use-deep-compare-memoize';\n\nimport { DialogContext, DialogContextItemProps, DialogContextProps, useDialogProps } from '.';\n\nexport const useDialogs = (): DialogContextProps<object> => {\n const context = useContext(DialogContext);\n if (!context) {\n throw new Error('useDialogs must be used within an ProviderDialog');\n }\n return context;\n};\n\nexport const useDialog = <T extends object>(props?: useDialogProps<T>): DialogContextItemProps<T> => {\n const { add, remove, update, dialogHistory } = useDialogs();\n const [id, setId] = useState<string | null>(null);\n\n const localAdd: DialogContextItemProps<T>['add'] = useCallback(\n (dialog) => {\n const find = dialogHistory.find((item) => item.id === dialog.id);\n if (!id || !find) {\n const id = dialog.id || uuidv4();\n setId(id);\n add({ ...(dialog as T), props: props, id });\n }\n },\n [add, dialogHistory, id, props],\n );\n const localRemove = useCallback(() => {\n if (id) {\n remove(id);\n setId(null);\n }\n }, [id, remove]);\n\n const propsMemo = useDeepCompareMemoize(props);\n\n useEffect(() => {\n if (id) {\n update({ id, props: propsMemo });\n }\n }, [id, propsMemo, update]);\n\n return { add: localAdd, remove: localRemove, id };\n};\n"],"names":["useDialogs","context","useContext","DialogContext","Error","props","add","remove","update","dialogHistory","id","setId","useState","localAdd","useCallback","dialog","find","item","uuidv4","localRemove","propsMemo","useDeepCompareMemoize","useEffect"],"mappings":"oHAOaA,EAAa,KACxB,MAAMC,EAAUC,EAAAA,WAAWC,iBAC3B,IAAKF,EACH,MAAM,IAAIG,MAAM,oDAElB,OAAOH,qBAGmCI,IAC1C,MAAMC,IAAEA,EAAAC,OAAKA,EAAAC,OAAQA,EAAAC,cAAQA,GAAkBT,KACxCU,EAAIC,GAASC,EAAAA,SAAwB,MAEtCC,EAA6CC,EAAAA,YAChDC,IACC,MAAMC,EAAOP,EAAcO,KAAMC,GAASA,EAAKP,KAAOK,EAAOL,IAC7D,IAAKA,IAAOM,EAAM,CAChB,MAAMN,EAAKK,EAAOL,IAAMQ,OACxBP,EAAMD,GACNJ,EAAI,IAAMS,EAAcV,QAAcK,GAAAA,GACxC,GAEF,CAACJ,EAAKG,EAAeC,EAAIL,IAErBc,EAAcL,EAAAA,YAAY,KAC1BJ,IACFH,EAAOG,GACPC,EAAM,QAEP,CAACD,EAAIH,IAEFa,EAAYC,EAAAA,sBAAsBhB,GAQxC,OANAiB,EAAAA,UAAU,KACJZ,GACFF,EAAO,CAAEE,KAAIL,MAAOe,KAErB,CAACV,EAAIU,EAAWZ,IAEZ,CAAEF,IAAKO,EAAUN,OAAQY,EAAaT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react"),n=require("./context.constants-
|
|
2
|
-
//# sourceMappingURL=context.hooks-
|
|
1
|
+
"use strict";const e=require("react"),n=require("./context.constants-CDgzMcxb.cjs");exports.useSonner=()=>{const r=e.useContext(n.SonnerContext);if(!r)throw new Error("useSonner must be used within an ProviderSonner");return r};
|
|
2
|
+
//# sourceMappingURL=context.hooks-BpQriPdQ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-BpQriPdQ.cjs","sources":["../src/contexts/context-sonner/context.hooks.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { SonnerContext, SonnerContextProps } from '.';\n\nexport const useSonner = (): SonnerContextProps => {\n const context = useContext(SonnerContext);\n if (!context) {\n throw new Error('useSonner must be used within an ProviderSonner');\n }\n return context;\n};\n"],"names":["context","useContext","SonnerContext","Error"],"mappings":"sGAIyB,KACvB,MAAMA,EAAUC,EAAAA,WAAWC,iBAC3B,IAAKF,EACH,MAAM,IAAIG,MAAM,mDAElB,OAAOH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { G as GeolocationContext } from "./context-
|
|
2
|
+
import { G as GeolocationContext } from "./context-LBih45kv.js";
|
|
3
3
|
const useGeolocation = () => {
|
|
4
4
|
const context = useContext(GeolocationContext);
|
|
5
5
|
if (!context) {
|
|
@@ -10,4 +10,4 @@ const useGeolocation = () => {
|
|
|
10
10
|
export {
|
|
11
11
|
useGeolocation as u
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=context.hooks-
|
|
13
|
+
//# sourceMappingURL=context.hooks-CXJ-eM6d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-CXJ-eM6d.js","sources":["../src/contexts/context-geolocation/context.hooks.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { GeolocationContext, GeolocationContextProps } from '.';\n\nexport const useGeolocation = (): GeolocationContextProps => {\n const context = useContext(GeolocationContext);\n if (!context) {\n throw new Error('useGeolocation must be used within an ProviderGeolocation');\n }\n return context;\n};\n"],"names":[],"mappings":";;AAIO,MAAM,iBAAiB,MAA+B;AAC3D,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AACA,SAAO;AACT;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react"),o=require("./context-B8kTBKjt.cjs");exports.useGeolocation=()=>{const t=e.useContext(o.GeolocationContext);if(!t)throw new Error("useGeolocation must be used within an ProviderGeolocation");return t};
|
|
2
|
+
//# sourceMappingURL=context.hooks-CYJnoIrt.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-CYJnoIrt.cjs","sources":["../src/contexts/context-geolocation/context.hooks.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { GeolocationContext, GeolocationContextProps } from '.';\n\nexport const useGeolocation = (): GeolocationContextProps => {\n const context = useContext(GeolocationContext);\n if (!context) {\n throw new Error('useGeolocation must be used within an ProviderGeolocation');\n }\n return context;\n};\n"],"names":["context","useContext","GeolocationContext","Error"],"mappings":"iGAI8B,KAC5B,MAAMA,EAAUC,EAAAA,WAAWC,sBAC3B,IAAKF,EACH,MAAM,IAAIG,MAAM,6DAElB,OAAOH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react"),r=require("./jsx-runtime-
|
|
2
|
-
//# sourceMappingURL=context.hooks-
|
|
1
|
+
"use strict";const e=require("react"),r=require("./jsx-runtime-C6yv_9g1.cjs"),t=require("styled-components"),n=e.createContext(null);exports.ProviderScreenWidth=s=>{const c=t.useTheme(),[i,o]=e.useState("default"),u=e.useMemo(()=>Object.entries(c.screens).map(([e])=>({isScreen:i===e,value:e})),[i,c.screens]),d=e.useMemo(()=>{const e=u.find(e=>e.isScreen);return(null==e?void 0:e.value)??"default"},[u]);return e.useEffect(()=>{const e=Object.entries(c.screens).map(([e,r])=>({key:e,bp:r.width})).sort((e,r)=>e.bp-r.bp).map(({key:e,bp:r})=>({key:e,mq:window.matchMedia(`(max-width: ${r}px)`)})),r=()=>{for(const{key:r,mq:t}of e)if(t.matches)return void o(r);o("default")};return e.forEach(({mq:e})=>e.addEventListener("change",r)),r(),()=>{e.forEach(({mq:e})=>e.removeEventListener("change",r))}},[c.screens]),r.jsxRuntimeExports.jsx(n.Provider,{value:{screens:u,screenActual:d,screenWidth:i},children:s.children})},exports.ScreenWidthContext=n,exports.useScreenWidth=()=>{const r=e.useContext(n);if(!r)throw new Error("useScreenWidth must be used within an ProviderScreenWidth");return r};
|
|
2
|
+
//# sourceMappingURL=context.hooks-DDD8ffJI.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-DDD8ffJI.cjs","sources":["../src/contexts/context-screen-width/context.tsx","../src/contexts/context-screen-width/context.hooks.ts"],"sourcesContent":["import { FC, createContext, useEffect, useMemo, useState } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ProviderScreenWidthProps, ScreenWidthContextProps, Screens } from '.';\n\nexport const ScreenWidthContext = createContext<ScreenWidthContextProps | null>(null);\n\nexport const ProviderScreenWidth: FC<ProviderScreenWidthProps> = (props) => {\n const theme = useTheme();\n const [screenWidth, setScreenWidth] = useState<Screens>('default');\n\n const screens: ScreenWidthContextProps['screens'] = useMemo(() => {\n const allSizes = Object.entries(theme.screens).map(([key]) => {\n return {\n isScreen: screenWidth === key,\n value: key as Screens,\n };\n });\n return allSizes;\n }, [screenWidth, theme.screens]);\n\n const screenActual: ScreenWidthContextProps['screenActual'] = useMemo(() => {\n const find = screens.find((item) => item.isScreen);\n return find?.value ?? 'default';\n }, [screens]);\n\n useEffect(() => {\n const sortedScreens = Object.entries(theme.screens)\n .map(([key, value]) => ({\n key: key as Screens,\n bp: (value as { width: number }).width,\n }))\n .sort((a, b) => a.bp - b.bp);\n\n const queries = sortedScreens.map(({ key, bp }) => {\n return { key, mq: window.matchMedia(`(max-width: ${bp}px)`) };\n });\n const updateScreen = () => {\n for (const { key, mq } of queries) {\n if (mq.matches) {\n setScreenWidth(key);\n return;\n }\n }\n // На всякий случай fallback\n setScreenWidth('default');\n };\n\n queries.forEach(({ mq }) => mq.addEventListener('change', updateScreen));\n updateScreen();\n\n return () => {\n queries.forEach(({ mq }) => mq.removeEventListener('change', updateScreen));\n };\n }, [theme.screens]);\n return (\n <ScreenWidthContext.Provider\n value={{\n screens,\n screenActual,\n screenWidth,\n }}\n >\n {props.children}\n </ScreenWidthContext.Provider>\n );\n};\n","import { useContext } from 'react';\n\nimport { ScreenWidthContext, ScreenWidthContextProps } from '.';\n\nexport const useScreenWidth = (): ScreenWidthContextProps => {\n const context = useContext(ScreenWidthContext);\n if (!context) {\n throw new Error('useScreenWidth must be used within an ProviderScreenWidth');\n }\n return context;\n};\n"],"names":["ScreenWidthContext","createContext","props","theme","useTheme","screenWidth","setScreenWidth","useState","screens","useMemo","Object","entries","map","key","isScreen","value","screenActual","find","item","useEffect","queries","bp","width","sort","a","b","mq","window","matchMedia","updateScreen","matches","forEach","addEventListener","removeEventListener","jsx","Provider","children","context","useContext","Error"],"mappings":"6GAKaA,EAAqBC,EAAAA,cAA8C,kCAEdC,IAChE,MAAMC,EAAQC,EAAAA,YACPC,EAAaC,GAAkBC,EAAAA,SAAkB,WAElDC,EAA8CC,EAAAA,QAAQ,IACzCC,OAAOC,QAAQR,EAAMK,SAASI,IAAI,EAAEC,MAC5C,CACLC,SAAUT,IAAgBQ,EAC1BE,MAAOF,KAIV,CAACR,EAAaF,EAAMK,UAEjBQ,EAAwDP,EAAAA,QAAQ,KACpE,MAAMQ,EAAOT,EAAQS,KAAMC,GAASA,EAAKJ,UACzC,aAAOG,WAAMF,QAAS,WACrB,CAACP,IA+BJ,OA7BAW,EAAAA,UAAU,KACR,MAOMC,EAPgBV,OAAOC,QAAQR,EAAMK,SACxCI,IAAI,EAAEC,EAAKE,MAAK,CACfF,MACAQ,GAAKN,EAA4BO,SAElCC,KAAK,CAACC,EAAGC,IAAMD,EAAEH,GAAKI,EAAEJ,IAEGT,IAAI,EAAGC,MAAKQ,SACjC,CAAER,MAAKa,GAAIC,OAAOC,WAAW,eAAeP,WAE/CQ,EAAe,KACnB,IAAA,MAAWhB,IAAEA,EAAAa,GAAKA,KAAQN,EACxB,GAAIM,EAAGI,QAEL,YADAxB,EAAeO,GAKnBP,EAAe,YAMjB,OAHAc,EAAQW,QAAQ,EAAGL,QAASA,EAAGM,iBAAiB,SAAUH,IAC1DA,IAEO,KACLT,EAAQW,QAAQ,EAAGL,QAASA,EAAGO,oBAAoB,SAAUJ,MAE9D,CAAC1B,EAAMK,YAER0B,kBAAAA,IAAClC,EAAmBmC,SAAnB,CACCpB,MAAO,CACLP,UACAQ,eACAX,eAGD+B,SAAAlC,EAAMkC,gEC3DiB,KAC5B,MAAMC,EAAUC,EAAAA,WAAWtC,GAC3B,IAAKqC,EACH,MAAM,IAAIE,MAAM,6DAElB,OAAOF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useContext, useState, useCallback, useEffect } from "react";
|
|
2
|
-
import { v4 } from "uuid";
|
|
3
2
|
import { u as useDeepCompareMemoize } from "./use-DT0XgvJT.js";
|
|
4
|
-
import { D as DialogContext } from "./context.constants-
|
|
3
|
+
import { D as DialogContext, v as v4 } from "./context.constants-Nfy-8Qzj.js";
|
|
5
4
|
const useDialogs = () => {
|
|
6
5
|
const context = useContext(DialogContext);
|
|
7
6
|
if (!context) {
|
|
@@ -41,4 +40,4 @@ export {
|
|
|
41
40
|
useDialog as a,
|
|
42
41
|
useDialogs as u
|
|
43
42
|
};
|
|
44
|
-
//# sourceMappingURL=context.hooks-
|
|
43
|
+
//# sourceMappingURL=context.hooks-DGYU76JL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-DGYU76JL.js","sources":["../src/contexts/context-dialog/context.hooks.ts"],"sourcesContent":["import { useCallback, useContext, useEffect, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { useDeepCompareMemoize } from '@local/hooks/use-deep-compare-memoize';\n\nimport { DialogContext, DialogContextItemProps, DialogContextProps, useDialogProps } from '.';\n\nexport const useDialogs = (): DialogContextProps<object> => {\n const context = useContext(DialogContext);\n if (!context) {\n throw new Error('useDialogs must be used within an ProviderDialog');\n }\n return context;\n};\n\nexport const useDialog = <T extends object>(props?: useDialogProps<T>): DialogContextItemProps<T> => {\n const { add, remove, update, dialogHistory } = useDialogs();\n const [id, setId] = useState<string | null>(null);\n\n const localAdd: DialogContextItemProps<T>['add'] = useCallback(\n (dialog) => {\n const find = dialogHistory.find((item) => item.id === dialog.id);\n if (!id || !find) {\n const id = dialog.id || uuidv4();\n setId(id);\n add({ ...(dialog as T), props: props, id });\n }\n },\n [add, dialogHistory, id, props],\n );\n const localRemove = useCallback(() => {\n if (id) {\n remove(id);\n setId(null);\n }\n }, [id, remove]);\n\n const propsMemo = useDeepCompareMemoize(props);\n\n useEffect(() => {\n if (id) {\n update({ id, props: propsMemo });\n }\n }, [id, propsMemo, update]);\n\n return { add: localAdd, remove: localRemove, id };\n};\n"],"names":["id","uuidv4"],"mappings":";;;AAOO,MAAM,aAAa,MAAkC;AAC1D,QAAM,UAAU,WAAW,aAAa;AACxC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO;AACT;AAEO,MAAM,YAAY,CAAmB,UAAyD;AACnG,QAAM,EAAE,KAAK,QAAQ,QAAQ,cAAA,IAAkB,WAAA;AAC/C,QAAM,CAAC,IAAI,KAAK,IAAI,SAAwB,IAAI;AAEhD,QAAM,WAA6C;AAAA,IACjD,CAAC,WAAW;AACV,YAAM,OAAO,cAAc,KAAK,CAAC,SAAS,KAAK,OAAO,OAAO,EAAE;AAC/D,UAAI,CAAC,MAAM,CAAC,MAAM;AAChB,cAAMA,MAAK,OAAO,MAAMC,GAAA;AACxB,cAAMD,GAAE;AACR,YAAI,EAAE,GAAI,QAAc,OAAc,IAAAA,KAAI;AAAA,MAC5C;AAAA,IACF;AAAA,IACA,CAAC,KAAK,eAAe,IAAI,KAAK;AAAA,EAAA;AAEhC,QAAM,cAAc,YAAY,MAAM;AACpC,QAAI,IAAI;AACN,aAAO,EAAE;AACT,YAAM,IAAI;AAAA,IACZ;AAAA,EACF,GAAG,CAAC,IAAI,MAAM,CAAC;AAEf,QAAM,YAAY,sBAAsB,KAAK;AAE7C,YAAU,MAAM;AACd,QAAI,IAAI;AACN,aAAO,EAAE,IAAI,OAAO,UAAA,CAAW;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,IAAI,WAAW,MAAM,CAAC;AAE1B,SAAO,EAAE,KAAK,UAAU,QAAQ,aAAa,GAAA;AAC/C;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const i=require("react"),o=require("./jsx-runtime-
|
|
2
|
-
//# sourceMappingURL=context.hooks-
|
|
1
|
+
"use strict";const i=require("react"),o=require("./jsx-runtime-C6yv_9g1.cjs"),e=i.createContext(null),t=()=>{const[o,e]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{if(window.PublicKeyCredential&&"function"==typeof window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable){const i=await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();e(i)}else e(!1)}catch(i){console.error("Error checking biometric availability:",i),e(!1)}})()},[]),{isBiometricSupported:o}},n=()=>{const[o,e]=i.useState(null);i.useEffect(()=>{"permissions"in window.navigator&&window.navigator.permissions.query({name:"geolocation"}).then(i=>{e(i.state),i.onchange=()=>{e(i.state)}})},[]);return{geolocationPermission:o,requestGeolocationPermission:i.useCallback(()=>{"geolocation"in window.navigator?window.navigator.geolocation.getCurrentPosition(()=>e("granted"),()=>e("denied")):console.warn("Provider Permission. Geolocation is not supported in this browser.")},[])}},s=()=>{const[o,e]=i.useState(null),[t,n]=i.useState(!1),s=i.useCallback(async()=>{if(n(!0),"Notification"in window)try{n(!0);const i=await window.Notification.requestPermission();return e(i),n(!1),i}catch(i){console.error("Provider Permission. Failed to request notification permission:",i)}else console.warn("Provider Permission. Notifications are not supported in this browser.");n(!1)},[]);return i.useEffect(()=>{"Notification"in window&&e(window.Notification.permission)},[]),{notificationPermission:o,requestNotificationPermission:s,isNotificationPermissionLoading:t}},r=()=>{const[o,e]=i.useState(!1);return i.useEffect(()=>{"PushManager"in window&&e(!0)},[]),{pushNotificationSupported:o}};exports.PermissionContext=e,exports.ProviderPermission=i=>{const{pushNotificationSupported:a}=r(),{isBiometricSupported:c}=t(),{notificationPermission:u,requestNotificationPermission:l,isNotificationPermissionLoading:d}=s(),{geolocationPermission:m,requestGeolocationPermission:P}=n();return o.jsxRuntimeExports.jsx(e.Provider,{value:{isBiometricSupported:c,geolocationPermission:m,pushNotificationSupported:a,requestGeolocationPermission:P,notificationPermission:u,requestNotificationPermission:l,isNotificationPermissionLoading:d},children:i.children})},exports.usePermission=()=>{const o=i.useContext(e);if(!o)throw new Error("usePermission must be used within an PermissionProvider");return o};
|
|
2
|
+
//# sourceMappingURL=context.hooks-DpwnIiRj.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-DpwnIiRj.cjs","sources":["../src/contexts/context-permission/context.tsx","../src/contexts/context-permission/context.hooks.ts"],"sourcesContent":["import { createContext, useCallback, useEffect, useState } from 'react';\n\nimport { PermissionContextProps, ProviderPermissionProps } from '.';\n\nexport const PermissionContext = createContext<PermissionContextProps | null>(null);\n\nexport const ProviderPermission = (props: ProviderPermissionProps) => {\n const { pushNotificationSupported } = usePushNotificationSupported();\n const { isBiometricSupported } = useBiometricSupported();\n const { notificationPermission, requestNotificationPermission, isNotificationPermissionLoading } =\n useNotificationPermission();\n const { geolocationPermission, requestGeolocationPermission } = useGeolocationPermission();\n\n return (\n <PermissionContext.Provider\n value={{\n isBiometricSupported,\n geolocationPermission,\n pushNotificationSupported,\n requestGeolocationPermission,\n notificationPermission,\n requestNotificationPermission,\n isNotificationPermissionLoading,\n }}\n >\n {props.children}\n </PermissionContext.Provider>\n );\n};\n\nconst useBiometricSupported = () => {\n const [isBiometricSupported, setIsBiometricSupported] = useState(false);\n\n useEffect(() => {\n const checkBiometricAvailability = async () => {\n try {\n if (\n window.PublicKeyCredential &&\n typeof window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable === 'function'\n ) {\n const available = await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();\n setIsBiometricSupported(available);\n } else {\n setIsBiometricSupported(false);\n }\n } catch (error) {\n console.error('Error checking biometric availability:', error);\n setIsBiometricSupported(false);\n }\n };\n\n checkBiometricAvailability();\n }, []);\n\n return { isBiometricSupported };\n};\n\nconst useGeolocationPermission = () => {\n // eslint-disable-next-line no-undef\n const [geolocationPermission, setGeolocationPermission] = useState<PermissionState | null>(null);\n\n useEffect(() => {\n if ('permissions' in window.navigator) {\n window.navigator.permissions.query({ name: 'geolocation' }).then((permissionStatus) => {\n setGeolocationPermission(permissionStatus.state);\n permissionStatus.onchange = () => {\n setGeolocationPermission(permissionStatus.state);\n };\n });\n }\n }, []);\n\n const requestGeolocationPermission = useCallback(() => {\n if ('geolocation' in window.navigator) {\n window.navigator.geolocation.getCurrentPosition(\n () => setGeolocationPermission('granted'),\n () => setGeolocationPermission('denied'),\n );\n } else {\n console.warn('Provider Permission. Geolocation is not supported in this browser.');\n }\n }, []);\n\n return { geolocationPermission, requestGeolocationPermission };\n};\n\nconst useNotificationPermission = () => {\n // eslint-disable-next-line no-undef\n const [notificationPermission, setNotificationPermission] = useState<NotificationPermission | null>(null);\n const [isNotificationPermissionLoading, setIsNotificationPermissionLoading] = useState<boolean>(false);\n\n const requestNotificationPermission = useCallback(async () => {\n setIsNotificationPermissionLoading(true);\n if ('Notification' in window) {\n try {\n setIsNotificationPermissionLoading(true);\n const permission = await window.Notification.requestPermission();\n setNotificationPermission(permission);\n setIsNotificationPermissionLoading(false);\n return permission;\n } catch (error) {\n console.error('Provider Permission. Failed to request notification permission:', error);\n }\n } else {\n console.warn('Provider Permission. Notifications are not supported in this browser.');\n }\n setIsNotificationPermissionLoading(false);\n }, []);\n\n useEffect(() => {\n if ('Notification' in window) {\n setNotificationPermission(window.Notification.permission);\n }\n }, []);\n\n return { notificationPermission, requestNotificationPermission, isNotificationPermissionLoading };\n};\n\nconst usePushNotificationSupported = () => {\n const [pushNotificationSupported, setPushNotificationSupported] = useState<boolean>(false);\n\n useEffect(() => {\n if ('PushManager' in window) {\n setPushNotificationSupported(true);\n }\n }, []);\n\n return { pushNotificationSupported };\n};\n","import { useContext } from 'react';\n\nimport { PermissionContext, PermissionContextProps } from '.';\n\n/**\n * Custom hook to access the PermissionContext.\n */\nexport const usePermission = (): PermissionContextProps => {\n const context = useContext(PermissionContext);\n if (!context) {\n throw new Error('usePermission must be used within an PermissionProvider');\n }\n return context;\n};\n"],"names":["PermissionContext","createContext","useBiometricSupported","isBiometricSupported","setIsBiometricSupported","useState","useEffect","async","window","PublicKeyCredential","isUserVerifyingPlatformAuthenticatorAvailable","available","error","console","checkBiometricAvailability","useGeolocationPermission","geolocationPermission","setGeolocationPermission","navigator","permissions","query","name","then","permissionStatus","state","onchange","requestGeolocationPermission","useCallback","geolocation","getCurrentPosition","warn","useNotificationPermission","notificationPermission","setNotificationPermission","isNotificationPermissionLoading","setIsNotificationPermissionLoading","requestNotificationPermission","permission","Notification","requestPermission","usePushNotificationSupported","pushNotificationSupported","setPushNotificationSupported","props","jsx","Provider","value","children","context","useContext","Error"],"mappings":"8EAIaA,EAAoBC,EAAAA,cAA6C,MA0BxEC,EAAwB,KAC5B,MAAOC,EAAsBC,GAA2BC,EAAAA,UAAS,GAuBjE,OArBAC,EAAAA,UAAU,KAC2BC,WACjC,IACE,GACEC,OAAOC,qBAC6E,mBAA7ED,OAAOC,oBAAoBC,8CAClC,CACA,MAAMC,QAAkBH,OAAOC,oBAAoBC,gDACnDN,EAAwBO,EAC1B,MACEP,GAAwB,EAE5B,OAASQ,GACPC,QAAQD,MAAM,yCAA0CA,GACxDR,GAAwB,EAC1B,GAGFU,IACC,IAEI,CAAEX,yBAGLY,EAA2B,KAE/B,MAAOC,EAAuBC,GAA4BZ,EAAAA,SAAiC,MAE3FC,EAAAA,UAAU,KACJ,gBAAiBE,OAAOU,WAC1BV,OAAOU,UAAUC,YAAYC,MAAM,CAAEC,KAAM,gBAAiBC,KAAMC,IAChEN,EAAyBM,EAAiBC,OAC1CD,EAAiBE,SAAW,KAC1BR,EAAyBM,EAAiBC,WAI/C,IAaH,MAAO,CAAER,wBAAuBU,6BAXKC,EAAAA,YAAY,KAC3C,gBAAiBnB,OAAOU,UAC1BV,OAAOU,UAAUU,YAAYC,mBAC3B,IAAMZ,EAAyB,WAC/B,IAAMA,EAAyB,WAGjCJ,QAAQiB,KAAK,uEAEd,MAKCC,EAA4B,KAEhC,MAAOC,EAAwBC,GAA6B5B,EAAAA,SAAwC,OAC7F6B,EAAiCC,GAAsC9B,EAAAA,UAAkB,GAE1F+B,EAAgCT,EAAAA,YAAYpB,UAEhD,GADA4B,GAAmC,GAC/B,iBAAkB3B,OACpB,IACE2B,GAAmC,GACnC,MAAME,QAAmB7B,OAAO8B,aAAaC,oBAG7C,OAFAN,EAA0BI,GAC1BF,GAAmC,GAC5BE,CACT,OAASzB,GACPC,QAAQD,MAAM,kEAAmEA,EACnF,MAEAC,QAAQiB,KAAK,yEAEfK,GAAmC,IAClC,IAQH,OANA7B,EAAAA,UAAU,KACJ,iBAAkBE,QACpByB,EAA0BzB,OAAO8B,aAAaD,aAE/C,IAEI,CAAEL,yBAAwBI,gCAA+BF,oCAG5DM,EAA+B,KACnC,MAAOC,EAA2BC,GAAgCrC,EAAAA,UAAkB,GAQpF,OANAC,EAAAA,UAAU,KACJ,gBAAiBE,QACnBkC,GAA6B,IAE9B,IAEI,CAAED,qFAzHwBE,IACjC,MAAMF,0BAAEA,GAA8BD,KAChCrC,qBAAEA,GAAyBD,KAC3B8B,uBAAEA,EAAAI,8BAAwBA,EAAAF,gCAA+BA,GAC7DH,KACIf,sBAAEA,EAAAU,6BAAuBA,GAAiCX,IAEhE,SACE6B,kBAAAA,IAAC5C,EAAkB6C,SAAlB,CACCC,MAAO,CACL3C,uBACAa,wBACAyB,4BACAf,+BACAM,yBACAI,gCACAF,mCAGDa,SAAAJ,EAAMI,kCClBgB,KAC3B,MAAMC,EAAUC,EAAAA,WAAWjD,GAC3B,IAAKgD,EACH,MAAM,IAAIE,MAAM,2DAElB,OAAOF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { b2 as SonnerContext } from "./context.constants-Bh-ajJM2.js";
|
|
3
3
|
const useSonner = () => {
|
|
4
4
|
const context = useContext(SonnerContext);
|
|
5
5
|
if (!context) {
|
|
@@ -10,4 +10,4 @@ const useSonner = () => {
|
|
|
10
10
|
export {
|
|
11
11
|
useSonner as u
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=context.hooks-
|
|
13
|
+
//# sourceMappingURL=context.hooks-Dx80dbrI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-Dx80dbrI.js","sources":["../src/contexts/context-sonner/context.hooks.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { SonnerContext, SonnerContextProps } from '.';\n\nexport const useSonner = (): SonnerContextProps => {\n const context = useContext(SonnerContext);\n if (!context) {\n throw new Error('useSonner must be used within an ProviderSonner');\n }\n return context;\n};\n"],"names":[],"mappings":";;AAIO,MAAM,YAAY,MAA0B;AACjD,QAAM,UAAU,WAAW,aAAa;AACxC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,iDAAiD;AAAA,EACnE;AACA,SAAO;AACT;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useState, useMemo, useEffect, useContext } from "react";
|
|
2
|
-
import { j as jsxRuntimeExports } from "./jsx-runtime-
|
|
2
|
+
import { j as jsxRuntimeExports } from "./jsx-runtime-DZS36FSE.js";
|
|
3
3
|
import { useTheme } from "styled-components";
|
|
4
4
|
const ScreenWidthContext = createContext(null);
|
|
5
5
|
const ProviderScreenWidth = (props) => {
|
|
@@ -65,4 +65,4 @@ export {
|
|
|
65
65
|
ScreenWidthContext as S,
|
|
66
66
|
useScreenWidth as u
|
|
67
67
|
};
|
|
68
|
-
//# sourceMappingURL=context.hooks-
|
|
68
|
+
//# sourceMappingURL=context.hooks-oclt34zD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.hooks-
|
|
1
|
+
{"version":3,"file":"context.hooks-oclt34zD.js","sources":["../src/contexts/context-screen-width/context.tsx","../src/contexts/context-screen-width/context.hooks.ts"],"sourcesContent":["import { FC, createContext, useEffect, useMemo, useState } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ProviderScreenWidthProps, ScreenWidthContextProps, Screens } from '.';\n\nexport const ScreenWidthContext = createContext<ScreenWidthContextProps | null>(null);\n\nexport const ProviderScreenWidth: FC<ProviderScreenWidthProps> = (props) => {\n const theme = useTheme();\n const [screenWidth, setScreenWidth] = useState<Screens>('default');\n\n const screens: ScreenWidthContextProps['screens'] = useMemo(() => {\n const allSizes = Object.entries(theme.screens).map(([key]) => {\n return {\n isScreen: screenWidth === key,\n value: key as Screens,\n };\n });\n return allSizes;\n }, [screenWidth, theme.screens]);\n\n const screenActual: ScreenWidthContextProps['screenActual'] = useMemo(() => {\n const find = screens.find((item) => item.isScreen);\n return find?.value ?? 'default';\n }, [screens]);\n\n useEffect(() => {\n const sortedScreens = Object.entries(theme.screens)\n .map(([key, value]) => ({\n key: key as Screens,\n bp: (value as { width: number }).width,\n }))\n .sort((a, b) => a.bp - b.bp);\n\n const queries = sortedScreens.map(({ key, bp }) => {\n return { key, mq: window.matchMedia(`(max-width: ${bp}px)`) };\n });\n const updateScreen = () => {\n for (const { key, mq } of queries) {\n if (mq.matches) {\n setScreenWidth(key);\n return;\n }\n }\n // На всякий случай fallback\n setScreenWidth('default');\n };\n\n queries.forEach(({ mq }) => mq.addEventListener('change', updateScreen));\n updateScreen();\n\n return () => {\n queries.forEach(({ mq }) => mq.removeEventListener('change', updateScreen));\n };\n }, [theme.screens]);\n return (\n <ScreenWidthContext.Provider\n value={{\n screens,\n screenActual,\n screenWidth,\n }}\n >\n {props.children}\n </ScreenWidthContext.Provider>\n );\n};\n","import { useContext } from 'react';\n\nimport { ScreenWidthContext, ScreenWidthContextProps } from '.';\n\nexport const useScreenWidth = (): ScreenWidthContextProps => {\n const context = useContext(ScreenWidthContext);\n if (!context) {\n throw new Error('useScreenWidth must be used within an ProviderScreenWidth');\n }\n return context;\n};\n"],"names":["jsx"],"mappings":";;;AAKO,MAAM,qBAAqB,cAA8C,IAAI;AAE7E,MAAM,sBAAoD,CAAC,UAAU;AAC1E,QAAM,QAAQ,SAAA;AACd,QAAM,CAAC,aAAa,cAAc,IAAI,SAAkB,SAAS;AAEjE,QAAM,UAA8C,QAAQ,MAAM;AAChE,UAAM,WAAW,OAAO,QAAQ,MAAM,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,MAAM;AAC5D,aAAO;AAAA,QACL,UAAU,gBAAgB;AAAA,QAC1B,OAAO;AAAA,MAAA;AAAA,IAEX,CAAC;AACD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,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AACA,SAAO;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.es.js","sources":["../src/functions.ts"],"sourcesContent":["type EnumOption = {\n value: string;\n label: string;\n placeholder: string;\n search: string;\n};\n\nexport function transformEnumToOptions<T extends Record<string, string>>(enumObj: T): EnumOption[] {\n return Object.entries(enumObj).map(([key, value]) => ({\n value: key,\n label: value,\n placeholder: value,\n search: `${value}, ${key}`,\n }));\n}\n\ntype GenericObject<T> = {\n [key: string]: T;\n};\n\nexport function transformObjectToArray<T>(obj: GenericObject<T>): Array<T> {\n return Object.entries(obj).map(([, value]) => ({\n ...value,\n }));\n}\n\nexport function transformObjectValuesToKeys<T>(obj: GenericObject<T>): GenericObject<string> {\n return Object.keys(obj).reduce(\n (acc, key) => {\n acc[key] = key;\n return acc;\n },\n {} as GenericObject<string>,\n );\n}\n\nexport function getContrastYIQ(hexcolor: string) {\n hexcolor = hexcolor.replace('#', '');\n const r = parseInt(hexcolor.substr(0, 2), 16);\n const g = parseInt(hexcolor.substr(2, 2), 16);\n const b = parseInt(hexcolor.substr(4, 2), 16);\n const yiq = (r * 299 + g * 587 + b * 114) / 1000;\n return yiq >= 128 ? '#000000' : '#FFFFFF';\n}\n\nexport function getScrollbarWidth() {\n const div = document.createElement('div');\n div.style.visibility = 'hidden';\n div.style.overflow = 'scroll';\n div.style.width = '100px';\n div.style.position = 'absolute';\n div.style.top = '-9999px';\n document.body.appendChild(div);\n const scrollBarWidth = div.offsetWidth - div.clientWidth;\n document.body.removeChild(div);\n return scrollBarWidth;\n}\n"],"names":[],"mappings":"AAOO,SAAS,uBAAyD,SAA0B;AACjG,SAAO,OAAO,QAAQ,OAAO,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO;AAAA,IACpD,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,QAAQ,GAAG,KAAK,KAAK,GAAG;AAAA,EAAA,EACxB;AACJ;AAMO,SAAS,uBAA0B,KAAiC;AACzE,SAAO,OAAO,QAAQ,GAAG,EAAE,IAAI,CAAC,CAAA,EAAG,KAAK,OAAO;AAAA,IAC7C,GAAG;AAAA,EAAA,EACH;AACJ;AAEO,SAAS,4BAA+B,KAA8C;AAC3F,SAAO,OAAO,KAAK,GAAG,EAAE;AAAA,IACtB,CAAC,KAAK,QAAQ;AACZ,UAAI,GAAG,IAAI;AACX,aAAO;AAAA,
|
|
1
|
+
{"version":3,"file":"functions.es.js","sources":["../src/functions.ts"],"sourcesContent":["type EnumOption = {\n value: string;\n label: string;\n placeholder: string;\n search: string;\n};\n\nexport function transformEnumToOptions<T extends Record<string, string>>(enumObj: T): EnumOption[] {\n return Object.entries(enumObj).map(([key, value]) => ({\n value: key,\n label: value,\n placeholder: value,\n search: `${value}, ${key}`,\n }));\n}\n\ntype GenericObject<T> = {\n [key: string]: T;\n};\n\nexport function transformObjectToArray<T>(obj: GenericObject<T>): Array<T> {\n return Object.entries(obj).map(([, value]) => ({\n ...value,\n }));\n}\n\nexport function transformObjectValuesToKeys<T>(obj: GenericObject<T>): GenericObject<string> {\n return Object.keys(obj).reduce(\n (acc, key) => {\n acc[key] = key;\n return acc;\n },\n {} as GenericObject<string>,\n );\n}\n\nexport function getContrastYIQ(hexcolor: string) {\n hexcolor = hexcolor.replace('#', '');\n const r = parseInt(hexcolor.substr(0, 2), 16);\n const g = parseInt(hexcolor.substr(2, 2), 16);\n const b = parseInt(hexcolor.substr(4, 2), 16);\n const yiq = (r * 299 + g * 587 + b * 114) / 1000;\n return yiq >= 128 ? '#000000' : '#FFFFFF';\n}\n\nexport function getScrollbarWidth() {\n const div = document.createElement('div');\n div.style.visibility = 'hidden';\n div.style.overflow = 'scroll';\n div.style.width = '100px';\n div.style.position = 'absolute';\n div.style.top = '-9999px';\n document.body.appendChild(div);\n const scrollBarWidth = div.offsetWidth - div.clientWidth;\n document.body.removeChild(div);\n return scrollBarWidth;\n}\n"],"names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