@strapi/admin 5.0.0-beta.10 → 5.0.0-beta.12
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/admin/{AdminSeatInfo-Bbq8UNek.mjs → AdminSeatInfo-88MFOtJf.mjs} +3 -3
- package/dist/admin/{AdminSeatInfo-Bbq8UNek.mjs.map → AdminSeatInfo-88MFOtJf.mjs.map} +1 -1
- package/dist/admin/{AdminSeatInfo-pe7_J25t.js → AdminSeatInfo-bN561B3v.js} +4 -4
- package/dist/admin/{AdminSeatInfo-pe7_J25t.js.map → AdminSeatInfo-bN561B3v.js.map} +1 -1
- package/dist/admin/{ApplicationInfoPage-S_AoXyUe.js → ApplicationInfoPage-KQETt-ON.js} +15 -15
- package/dist/admin/{ApplicationInfoPage-S_AoXyUe.js.map → ApplicationInfoPage-KQETt-ON.js.map} +1 -1
- package/dist/admin/{ApplicationInfoPage-bfXW7lrq.mjs → ApplicationInfoPage-uasiyWB5.mjs} +5 -5
- package/dist/admin/{ApplicationInfoPage-bfXW7lrq.mjs.map → ApplicationInfoPage-uasiyWB5.mjs.map} +1 -1
- package/dist/admin/{AuthResponse-BJbG4S2h.js → AuthResponse-PxLid1A-.js} +4 -4
- package/dist/admin/{AuthResponse-BJbG4S2h.js.map → AuthResponse-PxLid1A-.js.map} +1 -1
- package/dist/admin/{AuthResponse-CTQ0fh3I.mjs → AuthResponse-pxi-Fo2T.mjs} +2 -2
- package/dist/admin/{AuthResponse-CTQ0fh3I.mjs.map → AuthResponse-pxi-Fo2T.mjs.map} +1 -1
- package/dist/admin/{AuthenticatedLayout-s7jnYVG9.js → AuthenticatedLayout-Vvio5wiC.js} +30 -29
- package/dist/admin/{AuthenticatedLayout-s7jnYVG9.js.map → AuthenticatedLayout-Vvio5wiC.js.map} +1 -1
- package/dist/admin/{AuthenticatedLayout-lXbF2KKJ.mjs → AuthenticatedLayout-WgDErBPS.mjs} +13 -12
- package/dist/admin/{AuthenticatedLayout-lXbF2KKJ.mjs.map → AuthenticatedLayout-WgDErBPS.mjs.map} +1 -1
- package/dist/admin/{CreatePage-6pIItf4z.mjs → CreatePage-Jtbg4Axr.mjs} +4 -4
- package/dist/admin/{CreatePage-6pIItf4z.mjs.map → CreatePage-Jtbg4Axr.mjs.map} +1 -1
- package/dist/admin/{CreatePage-uWZ7dxp6.js → CreatePage-QPlhxPWu.js} +11 -11
- package/dist/admin/{CreatePage-uWZ7dxp6.js.map → CreatePage-QPlhxPWu.js.map} +1 -1
- package/dist/admin/{CreatePage-s23BIVXe.js → CreatePage-c1UAG1Pz.js} +5 -5
- package/dist/admin/{CreatePage-s23BIVXe.js.map → CreatePage-c1UAG1Pz.js.map} +1 -1
- package/dist/admin/{CreatePage-4gOQVUMq.mjs → CreatePage-qO5Fsd73.mjs} +3 -3
- package/dist/admin/{CreatePage-4gOQVUMq.mjs.map → CreatePage-qO5Fsd73.mjs.map} +1 -1
- package/dist/admin/{CreateView-3cLNRlgO.mjs → CreateView-6X8zrDa4.mjs} +3 -3
- package/dist/admin/{CreateView-3cLNRlgO.mjs.map → CreateView-6X8zrDa4.mjs.map} +1 -1
- package/dist/admin/{CreateView-aMz4KfSZ.mjs → CreateView-I_AcEctc.mjs} +3 -3
- package/dist/admin/{CreateView-aMz4KfSZ.mjs.map → CreateView-I_AcEctc.mjs.map} +1 -1
- package/dist/admin/CreateView-df0oOgwH.js +17 -0
- package/dist/admin/{CreateView-DNHRcJsj.js.map → CreateView-df0oOgwH.js.map} +1 -1
- package/dist/admin/CreateView-tz9mjAr8.js +17 -0
- package/dist/admin/{CreateView-JQYIo77z.js.map → CreateView-tz9mjAr8.js.map} +1 -1
- package/dist/admin/{EditPage-Wpz4YmVY.js → EditPage-CJfjdfkV.js} +16 -16
- package/dist/admin/{EditPage-Wpz4YmVY.js.map → EditPage-CJfjdfkV.js.map} +1 -1
- package/dist/admin/{EditPage-24cGvUbV.js → EditPage-H0_OHPE-.js} +12 -12
- package/dist/admin/{EditPage-24cGvUbV.js.map → EditPage-H0_OHPE-.js.map} +1 -1
- package/dist/admin/{EditPage-JPZ7c-8x.mjs → EditPage-UjhP-c39.mjs} +5 -5
- package/dist/admin/{EditPage-JPZ7c-8x.mjs.map → EditPage-UjhP-c39.mjs.map} +1 -1
- package/dist/admin/{EditPage-tUvaZzFe.mjs → EditPage-lvtguw64.mjs} +7 -7
- package/dist/admin/{EditPage-tUvaZzFe.mjs.map → EditPage-lvtguw64.mjs.map} +1 -1
- package/dist/admin/{EditPage-tmpterlY.mjs → EditPage-qz3ag7b-.mjs} +5 -5
- package/dist/admin/{EditPage-tmpterlY.mjs.map → EditPage-qz3ag7b-.mjs.map} +1 -1
- package/dist/admin/{EditPage-wGJLuMsP.js → EditPage-xdwfsmQu.js} +11 -11
- package/dist/admin/{EditPage-wGJLuMsP.js.map → EditPage-xdwfsmQu.js.map} +1 -1
- package/dist/admin/{EditView-ul5nHrFh.js → EditView-j6KW3gjS.js} +14 -14
- package/dist/admin/{EditView-ul5nHrFh.js.map → EditView-j6KW3gjS.js.map} +1 -1
- package/dist/admin/{EditView-HjYkw6Y_.mjs → EditView-qzOuPJuV.mjs} +4 -4
- package/dist/admin/{EditView-HjYkw6Y_.mjs.map → EditView-qzOuPJuV.mjs.map} +1 -1
- package/dist/admin/{EditViewPage-c3DI4uzU.js → EditViewPage-I1YFzBeC.js} +14 -14
- package/dist/admin/{EditViewPage-c3DI4uzU.js.map → EditViewPage-I1YFzBeC.js.map} +1 -1
- package/dist/admin/{EditViewPage-bnTbQJ_O.mjs → EditViewPage-UidswFpY.mjs} +4 -4
- package/dist/admin/{EditViewPage-bnTbQJ_O.mjs.map → EditViewPage-UidswFpY.mjs.map} +1 -1
- package/dist/admin/{EventsTable-XUKqJdnX.mjs → EventsTable-0L1CjkJZ.mjs} +2 -2
- package/dist/admin/{EventsTable-XUKqJdnX.mjs.map → EventsTable-0L1CjkJZ.mjs.map} +1 -1
- package/dist/admin/{EventsTable-7--SHloR.js → EventsTable-QX2atcfm.js} +2 -2
- package/dist/admin/{EventsTable-7--SHloR.js.map → EventsTable-QX2atcfm.js.map} +1 -1
- package/dist/admin/{HomePage-Xrg1dR_D.js → HomePage-58hB6NEL.js} +11 -11
- package/dist/admin/{HomePage-Xrg1dR_D.js.map → HomePage-58hB6NEL.js.map} +1 -1
- package/dist/admin/{HomePage-ppJpMP9G.mjs → HomePage-OEhCzFU1.mjs} +3 -3
- package/dist/admin/{HomePage-ppJpMP9G.mjs.map → HomePage-OEhCzFU1.mjs.map} +1 -1
- package/dist/admin/{HomePage-fBY17m1h.js → HomePage-Z1bBkdZd.js} +3 -3
- package/dist/admin/{HomePage-fBY17m1h.js.map → HomePage-Z1bBkdZd.js.map} +1 -1
- package/dist/admin/{HomePage--Mskxb9Z.mjs → HomePage-l0hSTO83.mjs} +4 -4
- package/dist/admin/{HomePage--Mskxb9Z.mjs.map → HomePage-l0hSTO83.mjs.map} +1 -1
- package/dist/admin/{InstalledPluginsPage-alfcy8jO.js → InstalledPluginsPage-ToVkNeOW.js} +10 -10
- package/dist/admin/{InstalledPluginsPage-alfcy8jO.js.map → InstalledPluginsPage-ToVkNeOW.js.map} +1 -1
- package/dist/admin/{InstalledPluginsPage-EtnkMG0G.mjs → InstalledPluginsPage-mjDk7bIy.mjs} +4 -4
- package/dist/admin/{InstalledPluginsPage-EtnkMG0G.mjs.map → InstalledPluginsPage-mjDk7bIy.mjs.map} +1 -1
- package/dist/admin/{Layout-9EvJq4Gc.mjs → Layout-JfZEpoAi.mjs} +5 -5
- package/dist/admin/Layout-JfZEpoAi.mjs.map +1 -0
- package/dist/admin/{Layout-RKjEsOtu.js → Layout-rLCApf8n.js} +11 -11
- package/dist/admin/Layout-rLCApf8n.js.map +1 -0
- package/dist/admin/{ListPage-D8Ih2axK.js → ListPage-0d14kKi_.js} +14 -14
- package/dist/admin/{ListPage-D8Ih2axK.js.map → ListPage-0d14kKi_.js.map} +1 -1
- package/dist/admin/{ListPage-TkJa9Qcz.js → ListPage-3yawwYZy.js} +12 -12
- package/dist/admin/{ListPage-TkJa9Qcz.js.map → ListPage-3yawwYZy.js.map} +1 -1
- package/dist/admin/{ListPage-Ur-kwyVv.mjs → ListPage-7oDmaO8D.mjs} +6 -6
- package/dist/admin/{ListPage-Ur-kwyVv.mjs.map → ListPage-7oDmaO8D.mjs.map} +1 -1
- package/dist/admin/{ListPage-gl3tUWS8.mjs → ListPage-L2QuM7UE.mjs} +3 -3
- package/dist/admin/{ListPage-gl3tUWS8.mjs.map → ListPage-L2QuM7UE.mjs.map} +1 -1
- package/dist/admin/{ListPage-xQbMtUpV.mjs → ListPage-N0O1Hqdf.mjs} +5 -5
- package/dist/admin/{ListPage-xQbMtUpV.mjs.map → ListPage-N0O1Hqdf.mjs.map} +1 -1
- package/dist/admin/{ListPage-MJlQ5gGq.js → ListPage-UY_3K2Wy.js} +14 -14
- package/dist/admin/{ListPage-MJlQ5gGq.js.map → ListPage-UY_3K2Wy.js.map} +1 -1
- package/dist/admin/{ListPage-CRyM6NXF.js → ListPage-gxijeg53.js} +17 -17
- package/dist/admin/{ListPage-CRyM6NXF.js.map → ListPage-gxijeg53.js.map} +1 -1
- package/dist/admin/{ListPage-nbTQdpBX.mjs → ListPage-hpSHo1FU.mjs} +3 -3
- package/dist/admin/{ListPage-nbTQdpBX.mjs.map → ListPage-hpSHo1FU.mjs.map} +1 -1
- package/dist/admin/{ListPage-Z0mmlysk.js → ListPage-kmWRcYle.js} +3 -3
- package/dist/admin/{ListPage-Z0mmlysk.js.map → ListPage-kmWRcYle.js.map} +1 -1
- package/dist/admin/{ListPage-21q8_YN7.mjs → ListPage-rAGFOcI3.mjs} +3 -3
- package/dist/admin/{ListPage-21q8_YN7.mjs.map → ListPage-rAGFOcI3.mjs.map} +1 -1
- package/dist/admin/{ListView-geMTlhDN.mjs → ListView-0PnKwTDf.mjs} +4 -4
- package/dist/admin/{ListView-geMTlhDN.mjs.map → ListView-0PnKwTDf.mjs.map} +1 -1
- package/dist/admin/{ListView-qAX3ZO28.js → ListView-GCE-p1AU.js} +13 -13
- package/dist/admin/{ListView-qAX3ZO28.js.map → ListView-GCE-p1AU.js.map} +1 -1
- package/dist/admin/{ListView-nRGxAwIh.js → ListView-OorXxSB4.js} +13 -13
- package/dist/admin/{ListView-nRGxAwIh.js.map → ListView-OorXxSB4.js.map} +1 -1
- package/dist/admin/{ListView-Drn22JZ1.mjs → ListView-vcKS-Zmc.mjs} +4 -4
- package/dist/admin/{ListView-Drn22JZ1.mjs.map → ListView-vcKS-Zmc.mjs.map} +1 -1
- package/dist/admin/{Login-Hn_q1QSn.js → Login-7l3x6yOV.js} +4 -4
- package/dist/admin/{Login-Hn_q1QSn.js.map → Login-7l3x6yOV.js.map} +1 -1
- package/dist/admin/{Login-ngKWBSD4.mjs → Login-eQL_RQXm.mjs} +3 -3
- package/dist/admin/{Login-ngKWBSD4.mjs.map → Login-eQL_RQXm.mjs.map} +1 -1
- package/dist/admin/{MagicLinkEE-JWmJRiBS.mjs → MagicLinkEE-PMO2aXgs.mjs} +3 -3
- package/dist/admin/{MagicLinkEE-JWmJRiBS.mjs.map → MagicLinkEE-PMO2aXgs.mjs.map} +1 -1
- package/dist/admin/{MagicLinkEE-B5NOEO47.js → MagicLinkEE-qzoFCgd6.js} +3 -3
- package/dist/admin/{MagicLinkEE-B5NOEO47.js.map → MagicLinkEE-qzoFCgd6.js.map} +1 -1
- package/dist/admin/{MarketplacePage-Pk9USes6.mjs → MarketplacePage-d1n38TCm.mjs} +3 -3
- package/dist/admin/{MarketplacePage-Pk9USes6.mjs.map → MarketplacePage-d1n38TCm.mjs.map} +1 -1
- package/dist/admin/{MarketplacePage-vQaaicxu.js → MarketplacePage-fqRuZ5tH.js} +17 -17
- package/dist/admin/{MarketplacePage-vQaaicxu.js.map → MarketplacePage-fqRuZ5tH.js.map} +1 -1
- package/dist/admin/{Permissions-2GKZ2IjP.mjs → Permissions-SH6iTLMt.mjs} +3 -3
- package/dist/admin/{Permissions-2GKZ2IjP.mjs.map → Permissions-SH6iTLMt.mjs.map} +1 -1
- package/dist/admin/{Permissions-GCSY8mIm.js → Permissions-ZLekr37e.js} +7 -7
- package/dist/admin/{Permissions-GCSY8mIm.js.map → Permissions-ZLekr37e.js.map} +1 -1
- package/dist/admin/{PrivateRoute-KfrFibGN.js → PrivateRoute-SKQvazOx.js} +3 -3
- package/dist/admin/{PrivateRoute-KfrFibGN.js.map → PrivateRoute-SKQvazOx.js.map} +1 -1
- package/dist/admin/{PrivateRoute-xkGBbDbU.mjs → PrivateRoute-nUWu4Q7I.mjs} +2 -2
- package/dist/admin/{PrivateRoute-xkGBbDbU.mjs.map → PrivateRoute-nUWu4Q7I.mjs.map} +1 -1
- package/dist/admin/{ProfilePage-o028o7JD.js → ProfilePage-NTjed70Z.js} +18 -18
- package/dist/admin/{ProfilePage-o028o7JD.js.map → ProfilePage-NTjed70Z.js.map} +1 -1
- package/dist/admin/{ProfilePage-Q5UpeDjs.mjs → ProfilePage-XBXtSTmT.mjs} +4 -4
- package/dist/admin/{ProfilePage-Q5UpeDjs.mjs.map → ProfilePage-XBXtSTmT.mjs.map} +1 -1
- package/dist/admin/{PurchaseAuditLogs-Vur69JZB.js → PurchaseAuditLogs-jB1NOXg4.js} +2 -2
- package/dist/admin/{PurchaseAuditLogs-Vur69JZB.js.map → PurchaseAuditLogs-jB1NOXg4.js.map} +1 -1
- package/dist/admin/{PurchaseAuditLogs-tpXbhCx-.mjs → PurchaseAuditLogs-nEBPLzVm.mjs} +2 -2
- package/dist/admin/{PurchaseAuditLogs-tpXbhCx-.mjs.map → PurchaseAuditLogs-nEBPLzVm.mjs.map} +1 -1
- package/dist/admin/{PurchaseSingleSignOn-6VTPjJVO.mjs → PurchaseSingleSignOn-O1zGlyVf.mjs} +2 -2
- package/dist/admin/{PurchaseSingleSignOn-6VTPjJVO.mjs.map → PurchaseSingleSignOn-O1zGlyVf.mjs.map} +1 -1
- package/dist/admin/{PurchaseSingleSignOn-7NMcihzT.js → PurchaseSingleSignOn-u10-YAGx.js} +2 -2
- package/dist/admin/{PurchaseSingleSignOn-7NMcihzT.js.map → PurchaseSingleSignOn-u10-YAGx.js.map} +1 -1
- package/dist/admin/{SelectRoles-q8vaxqfL.js → SelectRoles-GlWRf-Tw.js} +5 -5
- package/dist/admin/{SelectRoles-q8vaxqfL.js.map → SelectRoles-GlWRf-Tw.js.map} +1 -1
- package/dist/admin/{SelectRoles-BtQp5Va-.mjs → SelectRoles-heQJxEhL.mjs} +4 -4
- package/dist/admin/{SelectRoles-BtQp5Va-.mjs.map → SelectRoles-heQJxEhL.mjs.map} +1 -1
- package/dist/admin/{SingleSignOnPage-_l9MyJvN.js → SingleSignOnPage-QIOJcuMR.js} +15 -15
- package/dist/admin/{SingleSignOnPage-_l9MyJvN.js.map → SingleSignOnPage-QIOJcuMR.js.map} +1 -1
- package/dist/admin/{SingleSignOnPage-X1OAuyhO.mjs → SingleSignOnPage-mmKAZ8mV.mjs} +4 -4
- package/dist/admin/{SingleSignOnPage-X1OAuyhO.mjs.map → SingleSignOnPage-mmKAZ8mV.mjs.map} +1 -1
- package/dist/admin/{Table-z6l5BFoH.js → Table-F1obCnqD.js} +5 -5
- package/dist/admin/{Table-z6l5BFoH.js.map → Table-F1obCnqD.js.map} +1 -1
- package/dist/admin/{Table-V5-qnRte.mjs → Table-vPXGhBll.mjs} +3 -3
- package/dist/admin/{Table-V5-qnRte.mjs.map → Table-vPXGhBll.mjs.map} +1 -1
- package/dist/admin/{rbac-c6QPc6s7.js → Theme-QO8ntQqL.js} +25 -25
- package/dist/admin/Theme-QO8ntQqL.js.map +1 -0
- package/dist/admin/{rbac-A_QIXvpC.mjs → Theme-vNSAMTAv.mjs} +26 -26
- package/dist/admin/Theme-vNSAMTAv.mjs.map +1 -0
- package/dist/admin/{TokenTypeSelect-2iXEz7zs.js → TokenTypeSelect-LAWTFkRA.js} +7 -7
- package/dist/admin/{TokenTypeSelect-2iXEz7zs.js.map → TokenTypeSelect-LAWTFkRA.js.map} +1 -1
- package/dist/admin/{TokenTypeSelect-crPtoLFc.mjs → TokenTypeSelect-i78k2gg3.mjs} +3 -3
- package/dist/admin/{TokenTypeSelect-crPtoLFc.mjs.map → TokenTypeSelect-i78k2gg3.mjs.map} +1 -1
- package/dist/admin/{UseCasePage-26Y6U1DU.js → UseCasePage-JvS8byfE.js} +6 -6
- package/dist/admin/{UseCasePage-26Y6U1DU.js.map → UseCasePage-JvS8byfE.js.map} +1 -1
- package/dist/admin/{UseCasePage-QsvlJAQD.mjs → UseCasePage-gVGjn6p2.mjs} +4 -4
- package/dist/admin/{UseCasePage-QsvlJAQD.mjs.map → UseCasePage-gVGjn6p2.mjs.map} +1 -1
- package/dist/admin/{constants-Maq_tQvu.js → constants-9azy3JJD.js} +4 -4
- package/dist/admin/{constants-Maq_tQvu.js.map → constants-9azy3JJD.js.map} +1 -1
- package/dist/admin/{constants-ThodPHfR.mjs → constants-mR-6yeoL.mjs} +3 -3
- package/dist/admin/{constants-ThodPHfR.mjs.map → constants-mR-6yeoL.mjs.map} +1 -1
- package/dist/admin/{index-Ncrnmg5a.js → index-HH_X-3kJ.js} +1468 -1300
- package/dist/admin/index-HH_X-3kJ.js.map +1 -0
- package/dist/admin/{index-jwAq-BX-.mjs → index-wHs6nj5s.mjs} +1326 -1158
- package/dist/admin/index-wHs6nj5s.mjs.map +1 -0
- package/dist/admin/index.js +12 -12
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/selectors-RspXIUtJ.js +8 -0
- package/dist/admin/{selectors-yGCxM4Rk.js.map → selectors-RspXIUtJ.js.map} +1 -1
- package/dist/admin/{selectors-s8oNaHXK.mjs → selectors-jiFpk43E.mjs} +2 -2
- package/dist/admin/{selectors-s8oNaHXK.mjs.map → selectors-jiFpk43E.mjs.map} +1 -1
- package/dist/admin/src/StrapiApp.d.ts +17 -45
- package/dist/admin/src/components/Form.d.ts +6 -1
- package/dist/admin/src/constants.d.ts +1 -1
- package/dist/admin/src/core/apis/router.d.ts +73 -0
- package/dist/admin/src/features/StrapiApp.d.ts +2 -1
- package/dist/admin/src/hooks/useSettingsMenu.d.ts +1 -1
- package/dist/admin/src/index.d.ts +2 -1
- package/dist/admin/src/render.d.ts +1 -0
- package/dist/admin/src/router.d.ts +7 -0
- package/dist/admin/src/services/admin.d.ts +5 -5
- package/dist/admin/test.js +9 -9
- package/dist/admin/test.js.map +1 -1
- package/dist/admin/test.mjs +1 -1
- package/dist/admin/{useAdminRoles-gMNUnVWO.mjs → useAdminRoles-1-9TqGqM.mjs} +2 -2
- package/dist/admin/{useAdminRoles-gMNUnVWO.mjs.map → useAdminRoles-1-9TqGqM.mjs.map} +1 -1
- package/dist/admin/{useAdminRoles-zEk0tBhE.js → useAdminRoles-XzbtItdy.js} +2 -2
- package/dist/admin/{useAdminRoles-zEk0tBhE.js.map → useAdminRoles-XzbtItdy.js.map} +1 -1
- package/dist/admin/{useLicenseLimitNotification-AUg5DyS9.mjs → useLicenseLimitNotification-Nh_v-hN2.mjs} +2 -2
- package/dist/admin/{useLicenseLimitNotification-AUg5DyS9.mjs.map → useLicenseLimitNotification-Nh_v-hN2.mjs.map} +1 -1
- package/dist/admin/{useLicenseLimitNotification-ItNGgex2.js → useLicenseLimitNotification-ZwMojvCa.js} +3 -3
- package/dist/admin/{useLicenseLimitNotification-ItNGgex2.js.map → useLicenseLimitNotification-ZwMojvCa.js.map} +1 -1
- package/dist/admin/{validation-F0JMLUkr.mjs → validation-10a7k3aM.mjs} +2 -2
- package/dist/admin/{validation-F0JMLUkr.mjs.map → validation-10a7k3aM.mjs.map} +1 -1
- package/dist/admin/{validation-cP2hBbZm.js → validation-nRSf_5UG.js} +2 -2
- package/dist/admin/{validation-cP2hBbZm.js.map → validation-nRSf_5UG.js.map} +1 -1
- package/dist/package.json.d.ts +8 -7
- package/package.json +9 -8
- package/dist/admin/CreateView-DNHRcJsj.js +0 -17
- package/dist/admin/CreateView-JQYIo77z.js +0 -17
- package/dist/admin/Layout-9EvJq4Gc.mjs.map +0 -1
- package/dist/admin/Layout-RKjEsOtu.js.map +0 -1
- package/dist/admin/index-Ncrnmg5a.js.map +0 -1
- package/dist/admin/index-jwAq-BX-.mjs.map +0 -1
- package/dist/admin/rbac-A_QIXvpC.mjs.map +0 -1
- package/dist/admin/rbac-c6QPc6s7.js.map +0 -1
- package/dist/admin/selectors-yGCxM4Rk.js +0 -8
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { createRoot } from 'react-dom/client';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
4
|
-
import { useEffect, Suspense, useCallback, useMemo, useState, forwardRef, memo } from 'react';
|
|
5
|
-
import { Link, Alert, Typography, Main, Flex, Button, useCallbackRef, useComposedRefs, Dialog, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Box, Portal, IconButton, VisuallyHidden, Grid, EmptyStateLayout, LinkButton, lightTheme, darkTheme, Popover, Tag, Pagination as Pagination$1, PreviousLink, PageLink, Dots, NextLink, SearchForm, Searchbar, Table as Table$1, Thead, Tr, Th, Tooltip, Tbody, Td, Loader } from '@strapi/design-system';
|
|
3
|
+
import { Link, Alert, Typography, Main, Flex, Button, Box, useCallbackRef, EmptyStateLayout, LinkButton, useComposedRefs, Dialog, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Portal, IconButton, VisuallyHidden, Grid, lightTheme, darkTheme, Popover, Tag, Pagination as Pagination$1, PreviousLink, PageLink, Dots, NextLink, SearchForm, Searchbar, Table as Table$1, Thead, Tr, Th, Tooltip, Tbody, Td, Loader } from '@strapi/design-system';
|
|
6
4
|
import invariant from 'invariant';
|
|
7
5
|
import isFunction from 'lodash/isFunction';
|
|
8
6
|
import merge from 'lodash/merge';
|
|
9
7
|
import pick from 'lodash/pick';
|
|
8
|
+
import { NavLink, useLocation, useNavigate, Outlet, useRouteError, Link as Link$1, useBlocker, useMatch, Navigate, createMemoryRouter, createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
9
|
+
import { t as createContext, S as StrapiAppProvider, A as AuthProvider, L as LanguageProvider, T as Theme, N as NotificationsProvider, v as TrackingProvider, w as ConfigurationProvider, x as LANGUAGE_LOCAL_STORAGE_KEY, P as Page, o as useConfiguration, b as useTypedSelector, e as useTypedDispatch, y as setLocale, u as useAuth, f as useAPIErrorHandler, z as useForgotPasswordMutation, a as useNotification, m as useAppInfo, d as useTracking, B as useGetRegistrationInfoQuery, D as useRegisterAdminMutation, E as useRegisterUserMutation, F as useResetPasswordMutation, r as reducer$3, R as RBAC, G as THEME_LOCAL_STORAGE_KEY, H as useTypedStore } from './Theme-vNSAMTAv.mjs';
|
|
10
10
|
import { Provider as Provider$1 } from 'react-redux';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import { useEffect, Suspense, useCallback, useMemo, useState, forwardRef, memo } from 'react';
|
|
13
13
|
import { QueryClient, QueryClientProvider } from 'react-query';
|
|
14
|
-
import { ArrowLeft, WarningCircle, Duplicate, Eye, EyeStriked, Cross,
|
|
14
|
+
import { ArrowLeft, WarningCircle, Duplicate, ArrowRight, Eye, EyeStriked, Cross, Filter, Plus, Search, CaretDown } from '@strapi/icons';
|
|
15
15
|
import { produce } from 'immer';
|
|
16
16
|
import { useIntl } from 'react-intl';
|
|
17
17
|
import get from 'lodash/get';
|
|
18
18
|
import set from 'lodash/set';
|
|
19
19
|
import { styled } from 'styled-components';
|
|
20
|
-
import {
|
|
21
|
-
import { b as adminApi, i as isBaseQueryError, e as useInitQuery, j as createAbsoluteUrl, k as getFetchClient } from './admin-B6AW0Kov.mjs';
|
|
20
|
+
import { EmptyPictures, EmptyDocuments } from '@strapi/icons/symbols';
|
|
22
21
|
import { u as useEnterprise } from './useEnterprise-jpsYZWzn.mjs';
|
|
22
|
+
import { i as isBaseQueryError, e as useInitQuery, b as adminApi, j as createAbsoluteUrl, k as getFetchClient } from './admin-B6AW0Kov.mjs';
|
|
23
23
|
import camelCase from 'lodash/camelCase';
|
|
24
24
|
import * as yup from 'yup';
|
|
25
25
|
import { ValidationError } from 'yup';
|
|
@@ -27,9 +27,10 @@ import { generateNKeysBetween } from 'fractional-indexing';
|
|
|
27
27
|
import isEqual from 'lodash/isEqual';
|
|
28
28
|
import clone from 'lodash/clone';
|
|
29
29
|
import toPath from 'lodash/toPath';
|
|
30
|
+
import { getLocalTimeZone, parseAbsolute, toCalendarDate } from '@internationalized/date';
|
|
30
31
|
import omit from 'lodash/omit';
|
|
31
32
|
import { Formik, Form as Form$1 } from 'formik';
|
|
32
|
-
import {
|
|
33
|
+
import { configureStore, combineReducers } from '@reduxjs/toolkit';
|
|
33
34
|
import throttle from 'lodash/throttle';
|
|
34
35
|
import { parse, stringify } from 'qs';
|
|
35
36
|
|
|
@@ -68,7 +69,7 @@ const getEERoutes$1 = () => window.strapi.isEE ? [
|
|
|
68
69
|
{
|
|
69
70
|
path: "auth/login/:authResponse",
|
|
70
71
|
lazy: async () => {
|
|
71
|
-
const { AuthResponse } = await import('./AuthResponse-
|
|
72
|
+
const { AuthResponse } = await import('./AuthResponse-pxi-Fo2T.mjs');
|
|
72
73
|
return {
|
|
73
74
|
Component: AuthResponse
|
|
74
75
|
};
|
|
@@ -103,243 +104,519 @@ const constants = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
|
|
|
103
104
|
getEERoutes: getEERoutes$1
|
|
104
105
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
105
106
|
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
const StrapiLogo = "data:image/svg+xml,%3csvg%20width='800'%20height='800'%20viewBox='0%200%20800%20800'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M39%20282c0-118%200-176.9%2036.6-213.5C112.2%2032%20171.1%2032%20288.9%2032h221.2c117.8%200%20176.7%200%20213.3%2036.6C760%20105.2%20760%20164.1%20760%20281.9v221.2c0%20117.8%200%20176.7-36.6%20213.3C686.8%20753%20627.9%20753%20510.1%20753H288.9c-117.8%200-176.7%200-213.3-36.6C39%20679.8%2039%20620.9%2039%20503.1V281.9Z'%20fill='%234945FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M536.4%20250.7H293.7v123.8h123.8v123.7h123.8V255.5c0-2.6-2.2-4.8-4.9-4.8Z'%20fill='%23fff'/%3e%3cpath%20fill='%23fff'%20d='M412.7%20374.5h4.8v4.8h-4.8z'/%3e%3cpath%20d='M293.8%20374.5h119c2.6%200%204.8%202.1%204.8%204.8v119h-119a4.8%204.8%200%200%201-4.8-4.9v-119Z'%20fill='%239593FF'/%3e%3cpath%20d='M417.5%20498.2h123.8L421.6%20618a2.4%202.4%200%200%201-4-1.7v-118ZM293.8%20374.5h-118a2.4%202.4%200%200%201-1.7-4.1l119.7-119.7v123.8Z'%20fill='%239593FF'/%3e%3c/svg%3e";
|
|
108
|
+
|
|
109
|
+
const ADMIN_PERMISSIONS_CE = {
|
|
110
|
+
contentManager: {
|
|
111
|
+
main: [],
|
|
112
|
+
collectionTypesConfigurations: [
|
|
113
|
+
{
|
|
114
|
+
action: "plugin::content-manager.collection-types.configure-view",
|
|
115
|
+
subject: null
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
lazy: async () => {
|
|
122
|
-
const { ProtectedSSO } = await import('./SingleSignOnPage-X1OAuyhO.mjs');
|
|
123
|
-
return {
|
|
124
|
-
Component: ProtectedSSO
|
|
125
|
-
};
|
|
117
|
+
],
|
|
118
|
+
componentsConfigurations: [
|
|
119
|
+
{
|
|
120
|
+
action: "plugin::content-manager.components.configure-layout",
|
|
121
|
+
subject: null
|
|
126
122
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
history: [],
|
|
133
|
-
currentLocationIndex: 0,
|
|
134
|
-
currentLocation: "",
|
|
135
|
-
canGoBack: false,
|
|
136
|
-
pushState: () => {
|
|
137
|
-
throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
|
|
138
|
-
},
|
|
139
|
-
goBack: () => {
|
|
140
|
-
throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
const HistoryProvider = ({ children }) => {
|
|
144
|
-
const location = useLocation();
|
|
145
|
-
const navigate = useNavigate();
|
|
146
|
-
const [state, dispatch] = React.useReducer(reducer$2, {
|
|
147
|
-
history: [],
|
|
148
|
-
currentLocationIndex: 0,
|
|
149
|
-
currentLocation: "",
|
|
150
|
-
canGoBack: false
|
|
151
|
-
});
|
|
152
|
-
const isGoingBack = React.useRef(false);
|
|
153
|
-
const pushState = React.useCallback((path) => {
|
|
154
|
-
dispatch({
|
|
155
|
-
type: "PUSH_STATE",
|
|
156
|
-
payload: typeof path === "string" ? { to: path, search: "" } : path
|
|
157
|
-
});
|
|
158
|
-
}, []);
|
|
159
|
-
const goBack = React.useCallback(() => {
|
|
160
|
-
navigate(-1);
|
|
161
|
-
dispatch({ type: "GO_BACK" });
|
|
162
|
-
isGoingBack.current = true;
|
|
163
|
-
}, [navigate]);
|
|
164
|
-
const prevIndex = React.useRef(state.currentLocationIndex);
|
|
165
|
-
React.useEffect(() => {
|
|
166
|
-
if (state.currentLocationIndex !== prevIndex.current) {
|
|
167
|
-
dispatch({
|
|
168
|
-
type: "SET_CAN_GO_BACK",
|
|
169
|
-
payload: state.currentLocationIndex > 1 && state.history.length > 1
|
|
170
|
-
});
|
|
171
|
-
prevIndex.current = state.currentLocationIndex;
|
|
172
|
-
}
|
|
173
|
-
}, [prevIndex, state.currentLocationIndex, state.history.length]);
|
|
174
|
-
React.useLayoutEffect(() => {
|
|
175
|
-
if (isGoingBack.current) {
|
|
176
|
-
isGoingBack.current = false;
|
|
177
|
-
} else {
|
|
178
|
-
dispatch({
|
|
179
|
-
type: "PUSH_STATE",
|
|
180
|
-
payload: { to: location.pathname, search: location.search }
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}, [dispatch, location.pathname, location.search]);
|
|
184
|
-
return /* @__PURE__ */ jsx(Provider, { pushState, goBack, ...state, children });
|
|
185
|
-
};
|
|
186
|
-
const reducer$2 = (state, action) => produce(state, (draft) => {
|
|
187
|
-
switch (action.type) {
|
|
188
|
-
case "PUSH_STATE": {
|
|
189
|
-
const path = `${action.payload.to}${action.payload.search}`;
|
|
190
|
-
if (state.currentLocationIndex === state.history.length) {
|
|
191
|
-
draft.history = [...state.history, path];
|
|
192
|
-
} else {
|
|
193
|
-
draft.history = [...state.history.slice(0, state.currentLocationIndex), path];
|
|
123
|
+
],
|
|
124
|
+
singleTypesConfigurations: [
|
|
125
|
+
{
|
|
126
|
+
action: "plugin::content-manager.single-types.configure-view",
|
|
127
|
+
subject: null
|
|
194
128
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
marketplace: {
|
|
132
|
+
main: [{ action: "admin::marketplace.read", subject: null }],
|
|
133
|
+
read: [{ action: "admin::marketplace.read", subject: null }]
|
|
134
|
+
},
|
|
135
|
+
settings: {
|
|
136
|
+
roles: {
|
|
137
|
+
main: [
|
|
138
|
+
{ action: "admin::roles.create", subject: null },
|
|
139
|
+
{ action: "admin::roles.update", subject: null },
|
|
140
|
+
{ action: "admin::roles.read", subject: null },
|
|
141
|
+
{ action: "admin::roles.delete", subject: null }
|
|
142
|
+
],
|
|
143
|
+
create: [{ action: "admin::roles.create", subject: null }],
|
|
144
|
+
delete: [{ action: "admin::roles.delete", subject: null }],
|
|
145
|
+
read: [{ action: "admin::roles.read", subject: null }],
|
|
146
|
+
update: [{ action: "admin::roles.update", subject: null }]
|
|
147
|
+
},
|
|
148
|
+
users: {
|
|
149
|
+
main: [
|
|
150
|
+
{ action: "admin::users.create", subject: null },
|
|
151
|
+
{ action: "admin::users.read", subject: null },
|
|
152
|
+
{ action: "admin::users.update", subject: null },
|
|
153
|
+
{ action: "admin::users.delete", subject: null }
|
|
154
|
+
],
|
|
155
|
+
create: [{ action: "admin::users.create", subject: null }],
|
|
156
|
+
delete: [{ action: "admin::users.delete", subject: null }],
|
|
157
|
+
read: [{ action: "admin::users.read", subject: null }],
|
|
158
|
+
update: [{ action: "admin::users.update", subject: null }]
|
|
159
|
+
},
|
|
160
|
+
webhooks: {
|
|
161
|
+
main: [
|
|
162
|
+
{ action: "admin::webhooks.create", subject: null },
|
|
163
|
+
{ action: "admin::webhooks.read", subject: null },
|
|
164
|
+
{ action: "admin::webhooks.update", subject: null },
|
|
165
|
+
{ action: "admin::webhooks.delete", subject: null }
|
|
166
|
+
],
|
|
167
|
+
create: [{ action: "admin::webhooks.create", subject: null }],
|
|
168
|
+
delete: [{ action: "admin::webhooks.delete", subject: null }],
|
|
169
|
+
read: [
|
|
170
|
+
{ action: "admin::webhooks.read", subject: null },
|
|
171
|
+
// NOTE: We need to check with the API
|
|
172
|
+
{ action: "admin::webhooks.update", subject: null },
|
|
173
|
+
{ action: "admin::webhooks.delete", subject: null }
|
|
174
|
+
],
|
|
175
|
+
update: [{ action: "admin::webhooks.update", subject: null }]
|
|
176
|
+
},
|
|
177
|
+
"api-tokens": {
|
|
178
|
+
main: [{ action: "admin::api-tokens.access", subject: null }],
|
|
179
|
+
create: [{ action: "admin::api-tokens.create", subject: null }],
|
|
180
|
+
delete: [{ action: "admin::api-tokens.delete", subject: null }],
|
|
181
|
+
read: [{ action: "admin::api-tokens.read", subject: null }],
|
|
182
|
+
update: [{ action: "admin::api-tokens.update", subject: null }],
|
|
183
|
+
regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
|
|
184
|
+
},
|
|
185
|
+
"transfer-tokens": {
|
|
186
|
+
main: [{ action: "admin::transfer.tokens.access", subject: null }],
|
|
187
|
+
create: [{ action: "admin::transfer.tokens.create", subject: null }],
|
|
188
|
+
delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
|
|
189
|
+
read: [{ action: "admin::transfer.tokens.read", subject: null }],
|
|
190
|
+
update: [{ action: "admin::transfer.tokens.update", subject: null }],
|
|
191
|
+
regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
|
|
192
|
+
},
|
|
193
|
+
"project-settings": {
|
|
194
|
+
read: [{ action: "admin::project-settings.read", subject: null }],
|
|
195
|
+
update: [{ action: "admin::project-settings.update", subject: null }]
|
|
208
196
|
}
|
|
209
197
|
}
|
|
210
|
-
}
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
198
|
+
};
|
|
199
|
+
const HOOKS = {
|
|
200
|
+
/**
|
|
201
|
+
* Hook that allows to mutate the displayed headers of the list view table
|
|
202
|
+
* @constant
|
|
203
|
+
* @type {string}
|
|
204
|
+
*/
|
|
205
|
+
INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
|
|
206
|
+
/**
|
|
207
|
+
* Hook that allows to mutate the CM's collection types links pre-set filters
|
|
208
|
+
* @constant
|
|
209
|
+
* @type {string}
|
|
210
|
+
*/
|
|
211
|
+
MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
|
|
212
|
+
/**
|
|
213
|
+
* Hook that allows to mutate the CM's edit view layout
|
|
214
|
+
* @constant
|
|
215
|
+
* @type {string}
|
|
216
|
+
*/
|
|
217
|
+
MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
|
|
218
|
+
/**
|
|
219
|
+
* Hook that allows to mutate the CM's single types links pre-set filters
|
|
220
|
+
* @constant
|
|
221
|
+
* @type {string}
|
|
222
|
+
*/
|
|
223
|
+
MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
|
|
224
|
+
};
|
|
225
|
+
const SETTINGS_LINKS_CE = () => ({
|
|
226
|
+
global: [
|
|
222
227
|
{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
const previousSteps = sectionArray.slice(0, currentStepIndex);
|
|
251
|
-
const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
|
|
252
|
-
if (isStepAlreadyDone || isSkipped || !isStepToShow) {
|
|
253
|
-
return null;
|
|
228
|
+
intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
|
|
229
|
+
to: "/settings/application-infos",
|
|
230
|
+
id: "000-application-infos"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
|
|
234
|
+
to: "/settings/webhooks",
|
|
235
|
+
id: "webhooks"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
|
|
239
|
+
to: "/settings/api-tokens?sort=name:ASC",
|
|
240
|
+
id: "api-tokens"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
|
|
244
|
+
to: "/settings/transfer-tokens?sort=name:ASC",
|
|
245
|
+
id: "transfer-tokens"
|
|
246
|
+
},
|
|
247
|
+
// If the Enterprise/Cloud feature is not enabled and if the config doesn't disable it, we promote the Enterprise/Cloud feature by displaying them in the settings menu.
|
|
248
|
+
// Disable this by adding "promoteEE: false" to your `./config/admin.js` file
|
|
249
|
+
...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
|
|
250
|
+
{
|
|
251
|
+
intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
|
|
252
|
+
to: "/settings/purchase-single-sign-on",
|
|
253
|
+
id: "sso-purchase-page",
|
|
254
|
+
licenseOnly: true
|
|
254
255
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
256
|
+
] : []
|
|
257
|
+
],
|
|
258
|
+
admin: [
|
|
259
|
+
{
|
|
260
|
+
intlLabel: { id: "global.roles", defaultMessage: "Roles" },
|
|
261
|
+
to: "/settings/roles",
|
|
262
|
+
id: "roles"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
intlLabel: { id: "global.users", defaultMessage: "Users" },
|
|
266
|
+
// Init the search params directly
|
|
267
|
+
to: "/settings/users?pageSize=10&page=1&sort=firstname",
|
|
268
|
+
id: "users"
|
|
269
|
+
},
|
|
270
|
+
...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
|
|
271
|
+
{
|
|
272
|
+
intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
|
|
273
|
+
to: "/settings/purchase-audit-logs",
|
|
274
|
+
id: "auditLogs-purchase-page",
|
|
275
|
+
licenseOnly: true
|
|
276
|
+
}
|
|
277
|
+
] : []
|
|
278
|
+
]
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
const ALLOWED_TYPES = [
|
|
282
|
+
"biginteger",
|
|
283
|
+
"boolean",
|
|
284
|
+
"date",
|
|
285
|
+
"datetime",
|
|
286
|
+
"decimal",
|
|
287
|
+
"email",
|
|
288
|
+
"enumeration",
|
|
289
|
+
"float",
|
|
290
|
+
"integer",
|
|
291
|
+
"json",
|
|
292
|
+
"password",
|
|
293
|
+
"richtext",
|
|
294
|
+
"string",
|
|
295
|
+
"text",
|
|
296
|
+
"time",
|
|
297
|
+
"uid"
|
|
298
|
+
];
|
|
299
|
+
const ALLOWED_ROOT_LEVEL_OPTIONS = [
|
|
300
|
+
"min",
|
|
301
|
+
"minLength",
|
|
302
|
+
"max",
|
|
303
|
+
"maxLength",
|
|
304
|
+
"required",
|
|
305
|
+
"regex",
|
|
306
|
+
"enum",
|
|
307
|
+
"unique",
|
|
308
|
+
"private",
|
|
309
|
+
"default"
|
|
310
|
+
];
|
|
311
|
+
class CustomFields {
|
|
312
|
+
customFields;
|
|
313
|
+
constructor() {
|
|
314
|
+
this.customFields = {};
|
|
315
|
+
}
|
|
316
|
+
register = (customFields) => {
|
|
317
|
+
if (Array.isArray(customFields)) {
|
|
318
|
+
customFields.forEach((customField) => {
|
|
319
|
+
this.register(customField);
|
|
320
|
+
});
|
|
321
|
+
} else {
|
|
322
|
+
const { name, pluginId, type, intlLabel, intlDescription, components, options } = customFields;
|
|
323
|
+
invariant(name, "A name must be provided");
|
|
324
|
+
invariant(type, "A type must be provided");
|
|
325
|
+
invariant(intlLabel, "An intlLabel must be provided");
|
|
326
|
+
invariant(intlDescription, "An intlDescription must be provided");
|
|
327
|
+
invariant(components, "A components object must be provided");
|
|
328
|
+
invariant(components.Input, "An Input component must be provided");
|
|
329
|
+
invariant(
|
|
330
|
+
ALLOWED_TYPES.includes(type),
|
|
331
|
+
`Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
|
|
284
332
|
);
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
333
|
+
const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
|
|
334
|
+
invariant(
|
|
335
|
+
isValidObjectKey.test(name),
|
|
336
|
+
`Custom field name: '${name}' is not a valid object key`
|
|
337
|
+
);
|
|
338
|
+
const allFormOptions = [...options?.base || [], ...options?.advanced || []];
|
|
339
|
+
if (allFormOptions.length) {
|
|
340
|
+
const optionPathValidations = allFormOptions.reduce(optionsValidationReducer, []);
|
|
341
|
+
optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
|
|
342
|
+
invariant(isValidOptionPath, errorMessage);
|
|
343
|
+
});
|
|
289
344
|
}
|
|
345
|
+
const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
|
|
346
|
+
const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
|
|
347
|
+
invariant(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
|
|
348
|
+
this.customFields[uid] = customFields;
|
|
290
349
|
}
|
|
291
350
|
};
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
dispatch({
|
|
295
|
-
type: "SET_SKIPPED",
|
|
296
|
-
value
|
|
297
|
-
});
|
|
351
|
+
getAll = () => {
|
|
352
|
+
return this.customFields;
|
|
298
353
|
};
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
354
|
+
get = (uid) => {
|
|
355
|
+
return this.customFields[uid];
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
const optionsValidationReducer = (acc, option) => {
|
|
359
|
+
if ("items" in option) {
|
|
360
|
+
return option.items.reduce(optionsValidationReducer, acc);
|
|
361
|
+
}
|
|
362
|
+
if (!option.name) {
|
|
363
|
+
acc.push({
|
|
364
|
+
isValidOptionPath: false,
|
|
365
|
+
errorMessage: "The 'name' property is required on an options object"
|
|
366
|
+
});
|
|
367
|
+
} else {
|
|
368
|
+
acc.push({
|
|
369
|
+
isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
|
|
370
|
+
errorMessage: `'${option.name}' must be prefixed with 'options.'`
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
return acc;
|
|
314
374
|
};
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
375
|
+
|
|
376
|
+
class Plugin {
|
|
377
|
+
apis;
|
|
378
|
+
initializer;
|
|
379
|
+
injectionZones;
|
|
380
|
+
isReady;
|
|
381
|
+
name;
|
|
382
|
+
pluginId;
|
|
383
|
+
constructor(pluginConf) {
|
|
384
|
+
this.apis = pluginConf.apis || {};
|
|
385
|
+
this.initializer = pluginConf.initializer || null;
|
|
386
|
+
this.injectionZones = pluginConf.injectionZones || {};
|
|
387
|
+
this.isReady = pluginConf.isReady !== void 0 ? pluginConf.isReady : true;
|
|
388
|
+
this.name = pluginConf.name;
|
|
389
|
+
this.pluginId = pluginConf.id;
|
|
390
|
+
}
|
|
391
|
+
getInjectedComponents(containerName, blockName) {
|
|
392
|
+
try {
|
|
393
|
+
return this.injectionZones[containerName][blockName] || [];
|
|
394
|
+
} catch (err) {
|
|
395
|
+
console.error("Cannot get injected component", err);
|
|
396
|
+
return [];
|
|
333
397
|
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
398
|
+
}
|
|
399
|
+
injectComponent(containerName, blockName, component) {
|
|
400
|
+
try {
|
|
401
|
+
this.injectionZones[containerName][blockName].push(component);
|
|
402
|
+
} catch (err) {
|
|
403
|
+
console.error("Cannot inject component", err);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const [Provider, useHistory] = createContext("History", {
|
|
409
|
+
history: [],
|
|
410
|
+
currentLocationIndex: 0,
|
|
411
|
+
currentLocation: "",
|
|
412
|
+
canGoBack: false,
|
|
413
|
+
pushState: () => {
|
|
414
|
+
throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
|
|
415
|
+
},
|
|
416
|
+
goBack: () => {
|
|
417
|
+
throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
const HistoryProvider = ({ children }) => {
|
|
421
|
+
const location = useLocation();
|
|
422
|
+
const navigate = useNavigate();
|
|
423
|
+
const [state, dispatch] = React.useReducer(reducer$2, {
|
|
424
|
+
history: [],
|
|
425
|
+
currentLocationIndex: 0,
|
|
426
|
+
currentLocation: "",
|
|
427
|
+
canGoBack: false
|
|
428
|
+
});
|
|
429
|
+
const isGoingBack = React.useRef(false);
|
|
430
|
+
const pushState = React.useCallback((path) => {
|
|
431
|
+
dispatch({
|
|
432
|
+
type: "PUSH_STATE",
|
|
433
|
+
payload: typeof path === "string" ? { to: path, search: "" } : path
|
|
434
|
+
});
|
|
435
|
+
}, []);
|
|
436
|
+
const goBack = React.useCallback(() => {
|
|
437
|
+
navigate(-1);
|
|
438
|
+
dispatch({ type: "GO_BACK" });
|
|
439
|
+
isGoingBack.current = true;
|
|
440
|
+
}, [navigate]);
|
|
441
|
+
const prevIndex = React.useRef(state.currentLocationIndex);
|
|
442
|
+
React.useEffect(() => {
|
|
443
|
+
if (state.currentLocationIndex !== prevIndex.current) {
|
|
444
|
+
dispatch({
|
|
445
|
+
type: "SET_CAN_GO_BACK",
|
|
446
|
+
payload: state.currentLocationIndex > 1 && state.history.length > 1
|
|
447
|
+
});
|
|
448
|
+
prevIndex.current = state.currentLocationIndex;
|
|
449
|
+
}
|
|
450
|
+
}, [prevIndex, state.currentLocationIndex, state.history.length]);
|
|
451
|
+
React.useLayoutEffect(() => {
|
|
452
|
+
if (isGoingBack.current) {
|
|
453
|
+
isGoingBack.current = false;
|
|
454
|
+
} else {
|
|
455
|
+
dispatch({
|
|
456
|
+
type: "PUSH_STATE",
|
|
457
|
+
payload: { to: location.pathname, search: location.search }
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
}, [dispatch, location.pathname, location.search]);
|
|
461
|
+
return /* @__PURE__ */ jsx(Provider, { pushState, goBack, ...state, children });
|
|
462
|
+
};
|
|
463
|
+
const reducer$2 = (state, action) => produce(state, (draft) => {
|
|
464
|
+
switch (action.type) {
|
|
465
|
+
case "PUSH_STATE": {
|
|
466
|
+
const path = `${action.payload.to}${action.payload.search}`;
|
|
467
|
+
if (state.currentLocationIndex === state.history.length) {
|
|
468
|
+
draft.history = [...state.history, path];
|
|
469
|
+
} else {
|
|
470
|
+
draft.history = [...state.history.slice(0, state.currentLocationIndex), path];
|
|
471
|
+
}
|
|
472
|
+
draft.currentLocation = path;
|
|
473
|
+
draft.currentLocationIndex += 1;
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
case "GO_BACK": {
|
|
477
|
+
const newIndex = state.currentLocationIndex - 1;
|
|
478
|
+
draft.currentLocation = state.history[newIndex - 1];
|
|
479
|
+
draft.currentLocationIndex = newIndex;
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
case "SET_CAN_GO_BACK": {
|
|
483
|
+
draft.canGoBack = action.payload;
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
const BackButton = React.forwardRef(({ disabled }, ref) => {
|
|
489
|
+
const { formatMessage } = useIntl();
|
|
490
|
+
const canGoBack = useHistory("BackButton", (state) => state.canGoBack);
|
|
491
|
+
const goBack = useHistory("BackButton", (state) => state.goBack);
|
|
492
|
+
const history = useHistory("BackButton", (state) => state.history);
|
|
493
|
+
const handleClick = (e) => {
|
|
494
|
+
e.preventDefault();
|
|
495
|
+
goBack();
|
|
496
|
+
};
|
|
497
|
+
return /* @__PURE__ */ jsx(
|
|
498
|
+
Link,
|
|
499
|
+
{
|
|
500
|
+
ref,
|
|
501
|
+
tag: NavLink,
|
|
502
|
+
to: history.at(-1) ?? "",
|
|
503
|
+
onClick: handleClick,
|
|
504
|
+
disabled: disabled || !canGoBack,
|
|
505
|
+
"aria-disabled": disabled || !canGoBack,
|
|
506
|
+
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
507
|
+
children: formatMessage({
|
|
508
|
+
id: "global.back",
|
|
509
|
+
defaultMessage: "Back"
|
|
510
|
+
})
|
|
511
|
+
}
|
|
512
|
+
);
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
const GUIDED_TOUR_COMPLETED_STEPS = "GUIDED_TOUR_COMPLETED_STEPS";
|
|
516
|
+
const GUIDED_TOUR_CURRENT_STEP = "GUIDED_TOUR_CURRENT_STEP";
|
|
517
|
+
const GUIDED_TOUR_SKIPPED = "GUIDED_TOUR_SKIPPED";
|
|
518
|
+
const [GuidedTourProviderImpl, useGuidedTour] = createContext("GuidedTour");
|
|
519
|
+
const GuidedTourProvider = ({ children }) => {
|
|
520
|
+
const [{ currentStep, guidedTourState, isGuidedTourVisible, isSkipped }, dispatch] = React.useReducer(reducer$1, initialState, initialiseState);
|
|
521
|
+
const setCurrentStep = (step) => {
|
|
522
|
+
if (step !== null) {
|
|
523
|
+
const isStepAlreadyDone = get(guidedTourState, step);
|
|
524
|
+
const [sectionName, stepName] = step.split(".");
|
|
525
|
+
const sectionArray = Object.entries(guidedTourState[sectionName]);
|
|
526
|
+
const currentStepIndex = sectionArray.findIndex(([key]) => key === stepName);
|
|
527
|
+
const previousSteps = sectionArray.slice(0, currentStepIndex);
|
|
528
|
+
const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
|
|
529
|
+
if (isStepAlreadyDone || isSkipped || !isStepToShow) {
|
|
530
|
+
return null;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
window.localStorage.setItem(GUIDED_TOUR_CURRENT_STEP, JSON.stringify(null));
|
|
534
|
+
return dispatch({
|
|
535
|
+
type: "SET_CURRENT_STEP",
|
|
536
|
+
step
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
const setGuidedTourVisibility = (value) => {
|
|
540
|
+
dispatch({
|
|
541
|
+
type: "SET_GUIDED_TOUR_VISIBILITY",
|
|
542
|
+
value
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
const setStepState = (currentStep2, value) => {
|
|
546
|
+
addCompletedStep(currentStep2);
|
|
547
|
+
dispatch({
|
|
548
|
+
type: "SET_STEP_STATE",
|
|
549
|
+
currentStep: currentStep2,
|
|
550
|
+
value
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
const startSection = (sectionName) => {
|
|
554
|
+
const sectionSteps = guidedTourState[sectionName];
|
|
555
|
+
if (sectionSteps) {
|
|
556
|
+
const guidedTourArray = Object.entries(guidedTourState);
|
|
557
|
+
const currentSectionIndex = guidedTourArray.findIndex(([key]) => key === sectionName);
|
|
558
|
+
const previousSections = guidedTourArray.slice(0, currentSectionIndex);
|
|
559
|
+
const isSectionToShow = previousSections.every(
|
|
560
|
+
([, sectionValue]) => Object.values(sectionValue).every(Boolean)
|
|
561
|
+
);
|
|
562
|
+
const [firstStep] = Object.keys(sectionSteps);
|
|
563
|
+
const isFirstStepDone = sectionSteps[firstStep];
|
|
564
|
+
if (isSectionToShow && !currentStep && !isFirstStepDone) {
|
|
565
|
+
setCurrentStep(`${sectionName}.${firstStep}`);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
const setSkipped = (value) => {
|
|
570
|
+
window.localStorage.setItem(GUIDED_TOUR_SKIPPED, JSON.stringify(value));
|
|
571
|
+
dispatch({
|
|
572
|
+
type: "SET_SKIPPED",
|
|
573
|
+
value
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
return /* @__PURE__ */ jsx(
|
|
577
|
+
GuidedTourProviderImpl,
|
|
578
|
+
{
|
|
579
|
+
guidedTourState,
|
|
580
|
+
currentStep,
|
|
581
|
+
setCurrentStep,
|
|
582
|
+
setGuidedTourVisibility,
|
|
583
|
+
setSkipped,
|
|
584
|
+
setStepState,
|
|
585
|
+
startSection,
|
|
586
|
+
isGuidedTourVisible,
|
|
587
|
+
isSkipped,
|
|
588
|
+
children
|
|
589
|
+
}
|
|
590
|
+
);
|
|
591
|
+
};
|
|
592
|
+
const initialState = {
|
|
593
|
+
currentStep: null,
|
|
594
|
+
guidedTourState: {
|
|
595
|
+
contentTypeBuilder: {
|
|
596
|
+
create: false,
|
|
597
|
+
success: false
|
|
598
|
+
},
|
|
599
|
+
contentManager: {
|
|
600
|
+
create: false,
|
|
601
|
+
success: false
|
|
602
|
+
},
|
|
603
|
+
apiTokens: {
|
|
604
|
+
create: false,
|
|
605
|
+
success: false
|
|
606
|
+
},
|
|
607
|
+
transferTokens: {
|
|
608
|
+
create: false,
|
|
609
|
+
success: false
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
isGuidedTourVisible: false,
|
|
613
|
+
isSkipped: false
|
|
614
|
+
};
|
|
615
|
+
const reducer$1 = (state = initialState, action) => produce(state, (draftState) => {
|
|
616
|
+
switch (action.type) {
|
|
617
|
+
case "SET_CURRENT_STEP": {
|
|
618
|
+
draftState.currentStep = action.step;
|
|
619
|
+
break;
|
|
343
620
|
}
|
|
344
621
|
case "SET_STEP_STATE": {
|
|
345
622
|
const [section, step] = action.currentStep.split(".");
|
|
@@ -416,7 +693,7 @@ const Providers = ({ children, strapi, store }) => {
|
|
|
416
693
|
components: strapi.library.components,
|
|
417
694
|
customFields: strapi.customFields,
|
|
418
695
|
fields: strapi.library.fields,
|
|
419
|
-
menu: strapi.menu,
|
|
696
|
+
menu: strapi.router.menu,
|
|
420
697
|
getAdminInjectedComponents: strapi.getAdminInjectedComponents,
|
|
421
698
|
getPlugin: strapi.getPlugin,
|
|
422
699
|
plugins: strapi.plugins,
|
|
@@ -424,7 +701,7 @@ const Providers = ({ children, strapi, store }) => {
|
|
|
424
701
|
runHookParallel: strapi.runHookParallel,
|
|
425
702
|
runHookWaterfall: (name, initialValue) => strapi.runHookWaterfall(name, initialValue, store),
|
|
426
703
|
runHookSeries: strapi.runHookSeries,
|
|
427
|
-
settings: strapi.settings,
|
|
704
|
+
settings: strapi.router.settings,
|
|
428
705
|
children: /* @__PURE__ */ jsx(Provider$1, { store, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(AuthProvider, { children: /* @__PURE__ */ jsx(HistoryProvider, { children: /* @__PURE__ */ jsx(LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsx(NotificationsProvider, { children: /* @__PURE__ */ jsx(TrackingProvider, { children: /* @__PURE__ */ jsx(GuidedTourProvider, { children: /* @__PURE__ */ jsx(
|
|
429
706
|
ConfigurationProvider,
|
|
430
707
|
{
|
|
@@ -449,8 +726,6 @@ const App = ({ strapi, store }) => {
|
|
|
449
726
|
return /* @__PURE__ */ jsx(Providers, { strapi, store, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Outlet, {}) }) });
|
|
450
727
|
};
|
|
451
728
|
|
|
452
|
-
const StrapiLogo = "data:image/svg+xml,%3csvg%20width='800'%20height='800'%20viewBox='0%200%20800%20800'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M39%20282c0-118%200-176.9%2036.6-213.5C112.2%2032%20171.1%2032%20288.9%2032h221.2c117.8%200%20176.7%200%20213.3%2036.6C760%20105.2%20760%20164.1%20760%20281.9v221.2c0%20117.8%200%20176.7-36.6%20213.3C686.8%20753%20627.9%20753%20510.1%20753H288.9c-117.8%200-176.7%200-213.3-36.6C39%20679.8%2039%20620.9%2039%20503.1V281.9Z'%20fill='%234945FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M536.4%20250.7H293.7v123.8h123.8v123.7h123.8V255.5c0-2.6-2.2-4.8-4.9-4.8Z'%20fill='%23fff'/%3e%3cpath%20fill='%23fff'%20d='M412.7%20374.5h4.8v4.8h-4.8z'/%3e%3cpath%20d='M293.8%20374.5h119c2.6%200%204.8%202.1%204.8%204.8v119h-119a4.8%204.8%200%200%201-4.8-4.9v-119Z'%20fill='%239593FF'/%3e%3cpath%20d='M417.5%20498.2h123.8L421.6%20618a2.4%202.4%200%200%201-4-1.7v-118ZM293.8%20374.5h-118a2.4%202.4%200%200%201-1.7-4.1l119.7-119.7v123.8Z'%20fill='%239593FF'/%3e%3c/svg%3e";
|
|
453
|
-
|
|
454
729
|
const useClipboard = () => {
|
|
455
730
|
const copy = useCallback(async (value) => {
|
|
456
731
|
try {
|
|
@@ -552,390 +827,245 @@ const ErrorType = styled(Typography)`
|
|
|
552
827
|
color: ${({ theme }) => theme.colors.danger600};
|
|
553
828
|
`;
|
|
554
829
|
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
collectionTypesConfigurations: [
|
|
559
|
-
{
|
|
560
|
-
action: "plugin::content-manager.collection-types.configure-view",
|
|
561
|
-
subject: null
|
|
562
|
-
}
|
|
563
|
-
],
|
|
564
|
-
componentsConfigurations: [
|
|
565
|
-
{
|
|
566
|
-
action: "plugin::content-manager.components.configure-layout",
|
|
567
|
-
subject: null
|
|
568
|
-
}
|
|
569
|
-
],
|
|
570
|
-
singleTypesConfigurations: [
|
|
571
|
-
{
|
|
572
|
-
action: "plugin::content-manager.single-types.configure-view",
|
|
573
|
-
subject: null
|
|
574
|
-
}
|
|
575
|
-
]
|
|
576
|
-
},
|
|
577
|
-
marketplace: {
|
|
578
|
-
main: [{ action: "admin::marketplace.read", subject: null }],
|
|
579
|
-
read: [{ action: "admin::marketplace.read", subject: null }]
|
|
580
|
-
},
|
|
581
|
-
settings: {
|
|
582
|
-
roles: {
|
|
583
|
-
main: [
|
|
584
|
-
{ action: "admin::roles.create", subject: null },
|
|
585
|
-
{ action: "admin::roles.update", subject: null },
|
|
586
|
-
{ action: "admin::roles.read", subject: null },
|
|
587
|
-
{ action: "admin::roles.delete", subject: null }
|
|
588
|
-
],
|
|
589
|
-
create: [{ action: "admin::roles.create", subject: null }],
|
|
590
|
-
delete: [{ action: "admin::roles.delete", subject: null }],
|
|
591
|
-
read: [{ action: "admin::roles.read", subject: null }],
|
|
592
|
-
update: [{ action: "admin::roles.update", subject: null }]
|
|
593
|
-
},
|
|
594
|
-
users: {
|
|
595
|
-
main: [
|
|
596
|
-
{ action: "admin::users.create", subject: null },
|
|
597
|
-
{ action: "admin::users.read", subject: null },
|
|
598
|
-
{ action: "admin::users.update", subject: null },
|
|
599
|
-
{ action: "admin::users.delete", subject: null }
|
|
600
|
-
],
|
|
601
|
-
create: [{ action: "admin::users.create", subject: null }],
|
|
602
|
-
delete: [{ action: "admin::users.delete", subject: null }],
|
|
603
|
-
read: [{ action: "admin::users.read", subject: null }],
|
|
604
|
-
update: [{ action: "admin::users.update", subject: null }]
|
|
605
|
-
},
|
|
606
|
-
webhooks: {
|
|
607
|
-
main: [
|
|
608
|
-
{ action: "admin::webhooks.create", subject: null },
|
|
609
|
-
{ action: "admin::webhooks.read", subject: null },
|
|
610
|
-
{ action: "admin::webhooks.update", subject: null },
|
|
611
|
-
{ action: "admin::webhooks.delete", subject: null }
|
|
612
|
-
],
|
|
613
|
-
create: [{ action: "admin::webhooks.create", subject: null }],
|
|
614
|
-
delete: [{ action: "admin::webhooks.delete", subject: null }],
|
|
615
|
-
read: [
|
|
616
|
-
{ action: "admin::webhooks.read", subject: null },
|
|
617
|
-
// NOTE: We need to check with the API
|
|
618
|
-
{ action: "admin::webhooks.update", subject: null },
|
|
619
|
-
{ action: "admin::webhooks.delete", subject: null }
|
|
620
|
-
],
|
|
621
|
-
update: [{ action: "admin::webhooks.update", subject: null }]
|
|
622
|
-
},
|
|
623
|
-
"api-tokens": {
|
|
624
|
-
main: [{ action: "admin::api-tokens.access", subject: null }],
|
|
625
|
-
create: [{ action: "admin::api-tokens.create", subject: null }],
|
|
626
|
-
delete: [{ action: "admin::api-tokens.delete", subject: null }],
|
|
627
|
-
read: [{ action: "admin::api-tokens.read", subject: null }],
|
|
628
|
-
update: [{ action: "admin::api-tokens.update", subject: null }],
|
|
629
|
-
regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
|
|
630
|
-
},
|
|
631
|
-
"transfer-tokens": {
|
|
632
|
-
main: [{ action: "admin::transfer.tokens.access", subject: null }],
|
|
633
|
-
create: [{ action: "admin::transfer.tokens.create", subject: null }],
|
|
634
|
-
delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
|
|
635
|
-
read: [{ action: "admin::transfer.tokens.read", subject: null }],
|
|
636
|
-
update: [{ action: "admin::transfer.tokens.update", subject: null }],
|
|
637
|
-
regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
|
|
638
|
-
},
|
|
639
|
-
"project-settings": {
|
|
640
|
-
read: [{ action: "admin::project-settings.read", subject: null }],
|
|
641
|
-
update: [{ action: "admin::project-settings.update", subject: null }]
|
|
642
|
-
}
|
|
830
|
+
const ActionLayout = ({ startActions, endActions }) => {
|
|
831
|
+
if (!startActions && !endActions) {
|
|
832
|
+
return null;
|
|
643
833
|
}
|
|
834
|
+
return /* @__PURE__ */ jsxs(
|
|
835
|
+
Flex,
|
|
836
|
+
{
|
|
837
|
+
justifyContent: "space-between",
|
|
838
|
+
alignItems: "flex-start",
|
|
839
|
+
paddingBottom: 4,
|
|
840
|
+
paddingLeft: 10,
|
|
841
|
+
paddingRight: 10,
|
|
842
|
+
children: [
|
|
843
|
+
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
844
|
+
/* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
845
|
+
]
|
|
846
|
+
}
|
|
847
|
+
);
|
|
644
848
|
};
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
* @constant
|
|
649
|
-
* @type {string}
|
|
650
|
-
*/
|
|
651
|
-
INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
|
|
652
|
-
/**
|
|
653
|
-
* Hook that allows to mutate the CM's collection types links pre-set filters
|
|
654
|
-
* @constant
|
|
655
|
-
* @type {string}
|
|
656
|
-
*/
|
|
657
|
-
MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
|
|
658
|
-
/**
|
|
659
|
-
* Hook that allows to mutate the CM's edit view layout
|
|
660
|
-
* @constant
|
|
661
|
-
* @type {string}
|
|
662
|
-
*/
|
|
663
|
-
MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
|
|
664
|
-
/**
|
|
665
|
-
* Hook that allows to mutate the CM's single types links pre-set filters
|
|
666
|
-
* @constant
|
|
667
|
-
* @type {string}
|
|
668
|
-
*/
|
|
669
|
-
MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
|
|
849
|
+
|
|
850
|
+
const ContentLayout = ({ children }) => {
|
|
851
|
+
return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
670
852
|
};
|
|
671
|
-
const SETTINGS_LINKS_CE = () => ({
|
|
672
|
-
global: [
|
|
673
|
-
{
|
|
674
|
-
intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
|
|
675
|
-
to: "/settings/application-infos",
|
|
676
|
-
id: "000-application-infos"
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
|
|
680
|
-
to: "/settings/webhooks",
|
|
681
|
-
id: "webhooks"
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
|
|
685
|
-
to: "/settings/api-tokens?sort=name:ASC",
|
|
686
|
-
id: "api-tokens"
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
|
|
690
|
-
to: "/settings/transfer-tokens?sort=name:ASC",
|
|
691
|
-
id: "transfer-tokens"
|
|
692
|
-
},
|
|
693
|
-
// If the Enterprise/Cloud feature is not enabled and if the config doesn't disable it, we promote the Enterprise/Cloud feature by displaying them in the settings menu.
|
|
694
|
-
// Disable this by adding "promoteEE: false" to your `./config/admin.js` file
|
|
695
|
-
...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
|
|
696
|
-
{
|
|
697
|
-
intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
|
|
698
|
-
to: "/settings/purchase-single-sign-on",
|
|
699
|
-
id: "sso-purchase-page",
|
|
700
|
-
licenseOnly: true
|
|
701
|
-
}
|
|
702
|
-
] : []
|
|
703
|
-
],
|
|
704
|
-
admin: [
|
|
705
|
-
{
|
|
706
|
-
intlLabel: { id: "global.roles", defaultMessage: "Roles" },
|
|
707
|
-
to: "/settings/roles",
|
|
708
|
-
id: "roles"
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
intlLabel: { id: "global.users", defaultMessage: "Users" },
|
|
712
|
-
// Init the search params directly
|
|
713
|
-
to: "/settings/users?pageSize=10&page=1&sort=firstname",
|
|
714
|
-
id: "users"
|
|
715
|
-
},
|
|
716
|
-
...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
|
|
717
|
-
{
|
|
718
|
-
intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
|
|
719
|
-
to: "/settings/purchase-audit-logs",
|
|
720
|
-
id: "auditLogs-purchase-page",
|
|
721
|
-
licenseOnly: true
|
|
722
|
-
}
|
|
723
|
-
] : []
|
|
724
|
-
]
|
|
725
|
-
});
|
|
726
853
|
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
invariant(components.Input, "An Input component must be provided");
|
|
775
|
-
invariant(
|
|
776
|
-
ALLOWED_TYPES.includes(type),
|
|
777
|
-
`Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
|
|
778
|
-
);
|
|
779
|
-
const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
|
|
780
|
-
invariant(
|
|
781
|
-
isValidObjectKey.test(name),
|
|
782
|
-
`Custom field name: '${name}' is not a valid object key`
|
|
854
|
+
const GridColSize = {
|
|
855
|
+
S: 180,
|
|
856
|
+
M: 250
|
|
857
|
+
};
|
|
858
|
+
const StyledGrid = styled(Box)`
|
|
859
|
+
display: grid;
|
|
860
|
+
grid-template-columns: repeat(
|
|
861
|
+
auto-fit,
|
|
862
|
+
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
863
|
+
);
|
|
864
|
+
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
865
|
+
`;
|
|
866
|
+
const GridLayout = ({ size, children }) => {
|
|
867
|
+
return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
const BaseHeaderLayout = React.forwardRef(
|
|
871
|
+
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
872
|
+
const isSubtitleString = typeof subtitle === "string";
|
|
873
|
+
if (sticky) {
|
|
874
|
+
return /* @__PURE__ */ jsx(
|
|
875
|
+
Box,
|
|
876
|
+
{
|
|
877
|
+
paddingLeft: 6,
|
|
878
|
+
paddingRight: 6,
|
|
879
|
+
paddingTop: 3,
|
|
880
|
+
paddingBottom: 3,
|
|
881
|
+
position: "fixed",
|
|
882
|
+
top: 0,
|
|
883
|
+
right: 0,
|
|
884
|
+
background: "neutral0",
|
|
885
|
+
shadow: "tableShadow",
|
|
886
|
+
width: `${width}rem`,
|
|
887
|
+
zIndex: 1,
|
|
888
|
+
"data-strapi-header-sticky": true,
|
|
889
|
+
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
890
|
+
/* @__PURE__ */ jsxs(Flex, { children: [
|
|
891
|
+
navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
|
|
892
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
893
|
+
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
894
|
+
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
895
|
+
] }),
|
|
896
|
+
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
897
|
+
] }),
|
|
898
|
+
/* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
899
|
+
] })
|
|
900
|
+
}
|
|
783
901
|
);
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
902
|
+
}
|
|
903
|
+
return /* @__PURE__ */ jsxs(
|
|
904
|
+
Box,
|
|
905
|
+
{
|
|
906
|
+
ref,
|
|
907
|
+
paddingLeft: 10,
|
|
908
|
+
paddingRight: 10,
|
|
909
|
+
paddingBottom: 8,
|
|
910
|
+
paddingTop: navigationAction ? 6 : 8,
|
|
911
|
+
background: "neutral100",
|
|
912
|
+
"data-strapi-header": true,
|
|
913
|
+
children: [
|
|
914
|
+
navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
915
|
+
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
916
|
+
/* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
|
|
917
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
918
|
+
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
919
|
+
] }),
|
|
920
|
+
primaryAction
|
|
921
|
+
] }),
|
|
922
|
+
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
923
|
+
]
|
|
790
924
|
}
|
|
791
|
-
|
|
792
|
-
const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
|
|
793
|
-
invariant(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
|
|
794
|
-
this.customFields[uid] = customFields;
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
getAll = () => {
|
|
798
|
-
return this.customFields;
|
|
799
|
-
};
|
|
800
|
-
get = (uid) => {
|
|
801
|
-
return this.customFields[uid];
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
const optionsValidationReducer = (acc, option) => {
|
|
805
|
-
if ("items" in option) {
|
|
806
|
-
return option.items.reduce(optionsValidationReducer, acc);
|
|
807
|
-
}
|
|
808
|
-
if (!option.name) {
|
|
809
|
-
acc.push({
|
|
810
|
-
isValidOptionPath: false,
|
|
811
|
-
errorMessage: "The 'name' property is required on an options object"
|
|
812
|
-
});
|
|
813
|
-
} else {
|
|
814
|
-
acc.push({
|
|
815
|
-
isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
|
|
816
|
-
errorMessage: `'${option.name}' must be prefixed with 'options.'`
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
return acc;
|
|
820
|
-
};
|
|
821
|
-
|
|
822
|
-
class Plugin {
|
|
823
|
-
apis;
|
|
824
|
-
initializer;
|
|
825
|
-
injectionZones;
|
|
826
|
-
isReady;
|
|
827
|
-
name;
|
|
828
|
-
pluginId;
|
|
829
|
-
constructor(pluginConf) {
|
|
830
|
-
this.apis = pluginConf.apis || {};
|
|
831
|
-
this.initializer = pluginConf.initializer || null;
|
|
832
|
-
this.injectionZones = pluginConf.injectionZones || {};
|
|
833
|
-
this.isReady = pluginConf.isReady !== void 0 ? pluginConf.isReady : true;
|
|
834
|
-
this.name = pluginConf.name;
|
|
835
|
-
this.pluginId = pluginConf.id;
|
|
925
|
+
);
|
|
836
926
|
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
927
|
+
);
|
|
928
|
+
const HeaderLayout = (props) => {
|
|
929
|
+
const baseHeaderLayoutRef = React.useRef(null);
|
|
930
|
+
const [headerSize, setHeaderSize] = React.useState(null);
|
|
931
|
+
const [containerRef, isVisible] = useElementOnScreen({
|
|
932
|
+
root: null,
|
|
933
|
+
rootMargin: "0px",
|
|
934
|
+
threshold: 0
|
|
935
|
+
});
|
|
936
|
+
useResizeObserver(containerRef, () => {
|
|
937
|
+
if (containerRef.current) {
|
|
938
|
+
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
843
939
|
}
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
} catch (err) {
|
|
849
|
-
console.error("Cannot inject component", err);
|
|
940
|
+
});
|
|
941
|
+
React.useEffect(() => {
|
|
942
|
+
if (baseHeaderLayoutRef.current) {
|
|
943
|
+
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
850
944
|
}
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
admin_app: reducer$3
|
|
945
|
+
}, [baseHeaderLayoutRef]);
|
|
946
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
947
|
+
/* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
948
|
+
!isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
949
|
+
] });
|
|
857
950
|
};
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
injectReducer: (key, asyncReducer) => {
|
|
865
|
-
asyncReducers[key] = asyncReducer;
|
|
866
|
-
store.replaceReducer(
|
|
867
|
-
// @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
|
|
868
|
-
combineReducers({
|
|
869
|
-
...appReducers,
|
|
870
|
-
...asyncReducers
|
|
871
|
-
})
|
|
872
|
-
);
|
|
873
|
-
}
|
|
951
|
+
HeaderLayout.displayName = "HeaderLayout";
|
|
952
|
+
const useElementOnScreen = (options) => {
|
|
953
|
+
const containerRef = React.useRef(null);
|
|
954
|
+
const [isVisible, setIsVisible] = React.useState(true);
|
|
955
|
+
const callback = ([entry]) => {
|
|
956
|
+
setIsVisible(entry.isIntersecting);
|
|
874
957
|
};
|
|
958
|
+
React.useEffect(() => {
|
|
959
|
+
const containerEl = containerRef.current;
|
|
960
|
+
const observer = new IntersectionObserver(callback, options);
|
|
961
|
+
if (containerEl) {
|
|
962
|
+
observer.observe(containerRef.current);
|
|
963
|
+
}
|
|
964
|
+
return () => {
|
|
965
|
+
if (containerEl) {
|
|
966
|
+
observer.disconnect();
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
}, [containerRef, options]);
|
|
970
|
+
return [containerRef, isVisible];
|
|
875
971
|
};
|
|
876
|
-
const
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
],
|
|
894
|
-
enhancers: [injectReducerStoreEnhancer(coreReducers)]
|
|
895
|
-
});
|
|
896
|
-
return store;
|
|
972
|
+
const useResizeObserver = (sources, onResize) => {
|
|
973
|
+
const handleResize = useCallbackRef(onResize);
|
|
974
|
+
React.useLayoutEffect(() => {
|
|
975
|
+
const resizeObs = new ResizeObserver(handleResize);
|
|
976
|
+
if (Array.isArray(sources)) {
|
|
977
|
+
sources.forEach((source) => {
|
|
978
|
+
if (source.current) {
|
|
979
|
+
resizeObs.observe(source.current);
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
} else if (sources.current) {
|
|
983
|
+
resizeObs.observe(sources.current);
|
|
984
|
+
}
|
|
985
|
+
return () => {
|
|
986
|
+
resizeObs.disconnect();
|
|
987
|
+
};
|
|
988
|
+
}, [sources, handleResize]);
|
|
897
989
|
};
|
|
898
990
|
|
|
899
|
-
const
|
|
991
|
+
const GridContainer = styled(Box)`
|
|
992
|
+
display: grid;
|
|
993
|
+
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
994
|
+
`;
|
|
995
|
+
const OverflowingItem = styled(Box)`
|
|
996
|
+
overflow-x: hidden;
|
|
997
|
+
`;
|
|
998
|
+
const RootLayout = ({ sideNav, children }) => {
|
|
999
|
+
return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
1000
|
+
sideNav,
|
|
1001
|
+
/* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
1002
|
+
] });
|
|
1003
|
+
};
|
|
1004
|
+
const Layouts = {
|
|
1005
|
+
Root: RootLayout,
|
|
1006
|
+
Header: HeaderLayout,
|
|
1007
|
+
BaseHeader: BaseHeaderLayout,
|
|
1008
|
+
Grid: GridLayout,
|
|
1009
|
+
Action: ActionLayout,
|
|
1010
|
+
Content: ContentLayout
|
|
1011
|
+
};
|
|
900
1012
|
|
|
901
|
-
const
|
|
902
|
-
const
|
|
903
|
-
return {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
},
|
|
913
|
-
async runWaterfallAsync(args, store) {
|
|
914
|
-
let result = args;
|
|
915
|
-
for (const fn of _handlers) {
|
|
916
|
-
result = await fn(result, store);
|
|
1013
|
+
const NotFoundPage = () => {
|
|
1014
|
+
const { formatMessage } = useIntl();
|
|
1015
|
+
return /* @__PURE__ */ jsxs(Page.Main, { labelledBy: "title", children: [
|
|
1016
|
+
/* @__PURE__ */ jsx(
|
|
1017
|
+
Layouts.Header,
|
|
1018
|
+
{
|
|
1019
|
+
id: "title",
|
|
1020
|
+
title: formatMessage({
|
|
1021
|
+
id: "content-manager.pageNotFound",
|
|
1022
|
+
defaultMessage: "Page not found"
|
|
1023
|
+
})
|
|
917
1024
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1025
|
+
),
|
|
1026
|
+
/* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(
|
|
1027
|
+
EmptyStateLayout,
|
|
1028
|
+
{
|
|
1029
|
+
action: /* @__PURE__ */ jsx(LinkButton, { tag: Link$1, variant: "secondary", endIcon: /* @__PURE__ */ jsx(ArrowRight, {}), to: "/", children: formatMessage({
|
|
1030
|
+
id: "app.components.NotFoundPage.back",
|
|
1031
|
+
defaultMessage: "Back to homepage"
|
|
1032
|
+
}) }),
|
|
1033
|
+
content: formatMessage({
|
|
1034
|
+
id: "app.page.not.found",
|
|
1035
|
+
defaultMessage: "Oops! We can't seem to find the page you're looging for..."
|
|
1036
|
+
}),
|
|
1037
|
+
hasRadius: true,
|
|
1038
|
+
icon: /* @__PURE__ */ jsx(EmptyPictures, { width: "16rem" }),
|
|
1039
|
+
shadow: "tableShadow"
|
|
1040
|
+
}
|
|
1041
|
+
) })
|
|
1042
|
+
] });
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
const getEERoutes = () => [
|
|
1046
|
+
...window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) ? [
|
|
1047
|
+
{
|
|
1048
|
+
path: "audit-logs",
|
|
1049
|
+
lazy: async () => {
|
|
1050
|
+
const { ProtectedListPage } = await import('./ListPage-rAGFOcI3.mjs');
|
|
1051
|
+
return {
|
|
1052
|
+
Component: ProtectedListPage
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
] : [],
|
|
1057
|
+
...window.strapi.features.isEnabled(window.strapi.features.SSO) ? [
|
|
1058
|
+
{
|
|
1059
|
+
path: "single-sign-on",
|
|
1060
|
+
lazy: async () => {
|
|
1061
|
+
const { ProtectedSSO } = await import('./SingleSignOnPage-mmKAZ8mV.mjs');
|
|
1062
|
+
return {
|
|
1063
|
+
Component: ProtectedSSO
|
|
1064
|
+
};
|
|
927
1065
|
}
|
|
928
|
-
return result;
|
|
929
|
-
},
|
|
930
|
-
runParallel(...args) {
|
|
931
|
-
return Promise.all(
|
|
932
|
-
_handlers.map((fn) => {
|
|
933
|
-
return fn(...args);
|
|
934
|
-
})
|
|
935
|
-
);
|
|
936
1066
|
}
|
|
937
|
-
|
|
938
|
-
|
|
1067
|
+
] : []
|
|
1068
|
+
];
|
|
939
1069
|
|
|
940
1070
|
function getIn(obj, key, def, pathStartIndex = 0) {
|
|
941
1071
|
const path = toPath(key);
|
|
@@ -1015,11 +1145,11 @@ const [FormProvider, useForm] = createContext("Form", {
|
|
|
1015
1145
|
values: {}
|
|
1016
1146
|
});
|
|
1017
1147
|
const Form = React.forwardRef(
|
|
1018
|
-
({ disabled = false, method, onSubmit, ...props }, ref) => {
|
|
1148
|
+
({ disabled = false, method, onSubmit, initialErrors, ...props }, ref) => {
|
|
1019
1149
|
const formRef = React.useRef(null);
|
|
1020
1150
|
const initialValues = React.useRef(props.initialValues ?? {});
|
|
1021
1151
|
const [state, dispatch] = React.useReducer(reducer, {
|
|
1022
|
-
errors: {},
|
|
1152
|
+
errors: initialErrors ?? {},
|
|
1023
1153
|
isSubmitting: false,
|
|
1024
1154
|
values: props.initialValues ?? {}
|
|
1025
1155
|
});
|
|
@@ -1357,11 +1487,40 @@ const useField = (path) => {
|
|
|
1357
1487
|
(state) => getIn(state.values, path)
|
|
1358
1488
|
);
|
|
1359
1489
|
const handleChange = useForm("useField", (state) => state.onChange);
|
|
1360
|
-
const
|
|
1490
|
+
const formatNestedErrorMessages = (stateErrors) => {
|
|
1491
|
+
const nestedErrors = {};
|
|
1492
|
+
Object.entries(stateErrors).forEach(([key, value2]) => {
|
|
1493
|
+
let current = nestedErrors;
|
|
1494
|
+
const pathParts = key.split(".");
|
|
1495
|
+
pathParts.forEach((part, index) => {
|
|
1496
|
+
const isLastPart = index === pathParts.length - 1;
|
|
1497
|
+
if (isLastPart) {
|
|
1498
|
+
if (typeof value2 === "string") {
|
|
1499
|
+
current[part] = value2;
|
|
1500
|
+
} else if (isErrorMessageDescriptor(value2)) {
|
|
1501
|
+
current[part] = formatMessage(value2);
|
|
1502
|
+
} else {
|
|
1503
|
+
setIn(current, part, value2);
|
|
1504
|
+
}
|
|
1505
|
+
} else {
|
|
1506
|
+
if (!current[part]) {
|
|
1507
|
+
const isArray = !isNaN(Number(pathParts[index + 1]));
|
|
1508
|
+
current[part] = isArray ? [] : {};
|
|
1509
|
+
}
|
|
1510
|
+
current = current[part];
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1513
|
+
});
|
|
1514
|
+
return nestedErrors;
|
|
1515
|
+
};
|
|
1516
|
+
const error = useForm(
|
|
1517
|
+
"useField",
|
|
1518
|
+
(state) => getIn(formatNestedErrorMessages(state.errors), path)
|
|
1519
|
+
);
|
|
1361
1520
|
return {
|
|
1362
1521
|
initialValue,
|
|
1363
1522
|
/**
|
|
1364
|
-
* Errors can be a string, or a
|
|
1523
|
+
* Errors can be a string, or a MessageDescriptor, so we need to handle both cases.
|
|
1365
1524
|
* If it's anything else, we don't return it.
|
|
1366
1525
|
*/
|
|
1367
1526
|
error: isErrorMessageDescriptor(error) ? formatMessage(
|
|
@@ -1376,7 +1535,7 @@ const useField = (path) => {
|
|
|
1376
1535
|
};
|
|
1377
1536
|
};
|
|
1378
1537
|
const isErrorMessageDescriptor = (object) => {
|
|
1379
|
-
return typeof object === "object" && object !== null && "id" in object && "defaultMessage" in object;
|
|
1538
|
+
return typeof object === "object" && object !== null && !Array.isArray(object) && "id" in object && "defaultMessage" in object;
|
|
1380
1539
|
};
|
|
1381
1540
|
const Blocker = ({ onProceed = () => {
|
|
1382
1541
|
}, onCancel = () => {
|
|
@@ -1516,7 +1675,7 @@ const DateInput = forwardRef(
|
|
|
1516
1675
|
field.onChange(name, date);
|
|
1517
1676
|
},
|
|
1518
1677
|
onClear: () => field.onChange(name, void 0),
|
|
1519
|
-
value,
|
|
1678
|
+
value: value ? convertLocalDateToUTCDate(value) : void 0,
|
|
1520
1679
|
...props
|
|
1521
1680
|
}
|
|
1522
1681
|
),
|
|
@@ -1525,6 +1684,12 @@ const DateInput = forwardRef(
|
|
|
1525
1684
|
] });
|
|
1526
1685
|
}
|
|
1527
1686
|
);
|
|
1687
|
+
const convertLocalDateToUTCDate = (date) => {
|
|
1688
|
+
const utcDateString = date.toISOString();
|
|
1689
|
+
const timeZone = getLocalTimeZone();
|
|
1690
|
+
const zonedDateTime = parseAbsolute(utcDateString, timeZone);
|
|
1691
|
+
return toCalendarDate(zonedDateTime).toDate("UTC");
|
|
1692
|
+
};
|
|
1528
1693
|
const MemoizedDateInput = memo(DateInput);
|
|
1529
1694
|
|
|
1530
1695
|
const DateTimeInput = forwardRef(
|
|
@@ -1774,7 +1939,7 @@ const TimeInput = forwardRef(
|
|
|
1774
1939
|
ref: composedRefs,
|
|
1775
1940
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
1776
1941
|
onChange: (time) => {
|
|
1777
|
-
field.onChange(name, time);
|
|
1942
|
+
field.onChange(name, `${time}:00.000`);
|
|
1778
1943
|
},
|
|
1779
1944
|
onClear: () => field.onChange(name, void 0),
|
|
1780
1945
|
value: field.value ?? "",
|
|
@@ -2951,11 +3116,11 @@ const AuthPage = () => {
|
|
|
2951
3116
|
const { hasAdmin } = data ?? {};
|
|
2952
3117
|
const Login$1 = useEnterprise(
|
|
2953
3118
|
Login,
|
|
2954
|
-
async () => (await import('./Login-
|
|
3119
|
+
async () => (await import('./Login-eQL_RQXm.mjs')).LoginEE
|
|
2955
3120
|
);
|
|
2956
3121
|
const forms = useEnterprise(
|
|
2957
3122
|
FORMS,
|
|
2958
|
-
async () => (await import('./constants-
|
|
3123
|
+
async () => (await import('./constants-mR-6yeoL.mjs')).FORMS,
|
|
2959
3124
|
{
|
|
2960
3125
|
combine(ceForms, eeForms) {
|
|
2961
3126
|
return {
|
|
@@ -2965,255 +3130,40 @@ const AuthPage = () => {
|
|
|
2965
3130
|
},
|
|
2966
3131
|
defaultValue: FORMS
|
|
2967
3132
|
}
|
|
2968
|
-
);
|
|
2969
|
-
const { token } = useAuth("AuthPage", (auth) => auth);
|
|
2970
|
-
if (!authType || !forms) {
|
|
2971
|
-
return /* @__PURE__ */ jsx(Navigate, { to: "/" });
|
|
2972
|
-
}
|
|
2973
|
-
const Component = forms[authType];
|
|
2974
|
-
if (!Component || hasAdmin && authType === "register-admin" || token) {
|
|
2975
|
-
return /* @__PURE__ */ jsx(Navigate, { to: "/" });
|
|
2976
|
-
}
|
|
2977
|
-
if (!hasAdmin && authType !== "register-admin") {
|
|
2978
|
-
return /* @__PURE__ */ jsx(
|
|
2979
|
-
Navigate,
|
|
2980
|
-
{
|
|
2981
|
-
to: {
|
|
2982
|
-
pathname: "/auth/register-admin",
|
|
2983
|
-
// Forward the `?redirectTo` from /auth/login
|
|
2984
|
-
// /abc => /auth/login?redirectTo=%2Fabc => /auth/register-admin?redirectTo=%2Fabc
|
|
2985
|
-
search
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
);
|
|
2989
|
-
}
|
|
2990
|
-
if (Login$1 && authType === "login") {
|
|
2991
|
-
return /* @__PURE__ */ jsx(Login$1, {});
|
|
2992
|
-
} else if (authType === "login" && !Login$1) {
|
|
2993
|
-
return null;
|
|
2994
|
-
}
|
|
2995
|
-
return /* @__PURE__ */ jsx(Component, { hasAdmin });
|
|
2996
|
-
};
|
|
2997
|
-
|
|
2998
|
-
const ActionLayout = ({ startActions, endActions }) => {
|
|
2999
|
-
if (!startActions && !endActions) {
|
|
3000
|
-
return null;
|
|
3001
|
-
}
|
|
3002
|
-
return /* @__PURE__ */ jsxs(
|
|
3003
|
-
Flex,
|
|
3004
|
-
{
|
|
3005
|
-
justifyContent: "space-between",
|
|
3006
|
-
alignItems: "flex-start",
|
|
3007
|
-
paddingBottom: 4,
|
|
3008
|
-
paddingLeft: 10,
|
|
3009
|
-
paddingRight: 10,
|
|
3010
|
-
children: [
|
|
3011
|
-
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
3012
|
-
/* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
3013
|
-
]
|
|
3014
|
-
}
|
|
3015
|
-
);
|
|
3016
|
-
};
|
|
3017
|
-
|
|
3018
|
-
const ContentLayout = ({ children }) => {
|
|
3019
|
-
return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
3020
|
-
};
|
|
3021
|
-
|
|
3022
|
-
const GridColSize = {
|
|
3023
|
-
S: 180,
|
|
3024
|
-
M: 250
|
|
3025
|
-
};
|
|
3026
|
-
const StyledGrid = styled(Box)`
|
|
3027
|
-
display: grid;
|
|
3028
|
-
grid-template-columns: repeat(
|
|
3029
|
-
auto-fit,
|
|
3030
|
-
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
3031
|
-
);
|
|
3032
|
-
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
3033
|
-
`;
|
|
3034
|
-
const GridLayout = ({ size, children }) => {
|
|
3035
|
-
return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
|
|
3036
|
-
};
|
|
3037
|
-
|
|
3038
|
-
const BaseHeaderLayout = React.forwardRef(
|
|
3039
|
-
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
3040
|
-
const isSubtitleString = typeof subtitle === "string";
|
|
3041
|
-
if (sticky) {
|
|
3042
|
-
return /* @__PURE__ */ jsx(
|
|
3043
|
-
Box,
|
|
3044
|
-
{
|
|
3045
|
-
paddingLeft: 6,
|
|
3046
|
-
paddingRight: 6,
|
|
3047
|
-
paddingTop: 3,
|
|
3048
|
-
paddingBottom: 3,
|
|
3049
|
-
position: "fixed",
|
|
3050
|
-
top: 0,
|
|
3051
|
-
right: 0,
|
|
3052
|
-
background: "neutral0",
|
|
3053
|
-
shadow: "tableShadow",
|
|
3054
|
-
width: `${width}rem`,
|
|
3055
|
-
zIndex: 1,
|
|
3056
|
-
"data-strapi-header-sticky": true,
|
|
3057
|
-
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
3058
|
-
/* @__PURE__ */ jsxs(Flex, { children: [
|
|
3059
|
-
navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
|
|
3060
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
3061
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
3062
|
-
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
3063
|
-
] }),
|
|
3064
|
-
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
3065
|
-
] }),
|
|
3066
|
-
/* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
3067
|
-
] })
|
|
3068
|
-
}
|
|
3069
|
-
);
|
|
3070
|
-
}
|
|
3071
|
-
return /* @__PURE__ */ jsxs(
|
|
3072
|
-
Box,
|
|
3073
|
-
{
|
|
3074
|
-
ref,
|
|
3075
|
-
paddingLeft: 10,
|
|
3076
|
-
paddingRight: 10,
|
|
3077
|
-
paddingBottom: 8,
|
|
3078
|
-
paddingTop: navigationAction ? 6 : 8,
|
|
3079
|
-
background: "neutral100",
|
|
3080
|
-
"data-strapi-header": true,
|
|
3081
|
-
children: [
|
|
3082
|
-
navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
3083
|
-
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
3084
|
-
/* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
|
|
3085
|
-
/* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
3086
|
-
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
3087
|
-
] }),
|
|
3088
|
-
primaryAction
|
|
3089
|
-
] }),
|
|
3090
|
-
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
3091
|
-
]
|
|
3092
|
-
}
|
|
3093
|
-
);
|
|
3094
|
-
}
|
|
3095
|
-
);
|
|
3096
|
-
const HeaderLayout = (props) => {
|
|
3097
|
-
const baseHeaderLayoutRef = React.useRef(null);
|
|
3098
|
-
const [headerSize, setHeaderSize] = React.useState(null);
|
|
3099
|
-
const [containerRef, isVisible] = useElementOnScreen({
|
|
3100
|
-
root: null,
|
|
3101
|
-
rootMargin: "0px",
|
|
3102
|
-
threshold: 0
|
|
3103
|
-
});
|
|
3104
|
-
useResizeObserver(containerRef, () => {
|
|
3105
|
-
if (containerRef.current) {
|
|
3106
|
-
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
3107
|
-
}
|
|
3108
|
-
});
|
|
3109
|
-
React.useEffect(() => {
|
|
3110
|
-
if (baseHeaderLayoutRef.current) {
|
|
3111
|
-
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
3112
|
-
}
|
|
3113
|
-
}, [baseHeaderLayoutRef]);
|
|
3114
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3115
|
-
/* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
3116
|
-
!isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
3117
|
-
] });
|
|
3118
|
-
};
|
|
3119
|
-
HeaderLayout.displayName = "HeaderLayout";
|
|
3120
|
-
const useElementOnScreen = (options) => {
|
|
3121
|
-
const containerRef = React.useRef(null);
|
|
3122
|
-
const [isVisible, setIsVisible] = React.useState(true);
|
|
3123
|
-
const callback = ([entry]) => {
|
|
3124
|
-
setIsVisible(entry.isIntersecting);
|
|
3125
|
-
};
|
|
3126
|
-
React.useEffect(() => {
|
|
3127
|
-
const containerEl = containerRef.current;
|
|
3128
|
-
const observer = new IntersectionObserver(callback, options);
|
|
3129
|
-
if (containerEl) {
|
|
3130
|
-
observer.observe(containerRef.current);
|
|
3131
|
-
}
|
|
3132
|
-
return () => {
|
|
3133
|
-
if (containerEl) {
|
|
3134
|
-
observer.disconnect();
|
|
3135
|
-
}
|
|
3136
|
-
};
|
|
3137
|
-
}, [containerRef, options]);
|
|
3138
|
-
return [containerRef, isVisible];
|
|
3139
|
-
};
|
|
3140
|
-
const useResizeObserver = (sources, onResize) => {
|
|
3141
|
-
const handleResize = useCallbackRef(onResize);
|
|
3142
|
-
React.useLayoutEffect(() => {
|
|
3143
|
-
const resizeObs = new ResizeObserver(handleResize);
|
|
3144
|
-
if (Array.isArray(sources)) {
|
|
3145
|
-
sources.forEach((source) => {
|
|
3146
|
-
if (source.current) {
|
|
3147
|
-
resizeObs.observe(source.current);
|
|
3148
|
-
}
|
|
3149
|
-
});
|
|
3150
|
-
} else if (sources.current) {
|
|
3151
|
-
resizeObs.observe(sources.current);
|
|
3152
|
-
}
|
|
3153
|
-
return () => {
|
|
3154
|
-
resizeObs.disconnect();
|
|
3155
|
-
};
|
|
3156
|
-
}, [sources, handleResize]);
|
|
3157
|
-
};
|
|
3158
|
-
|
|
3159
|
-
const GridContainer = styled(Box)`
|
|
3160
|
-
display: grid;
|
|
3161
|
-
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
3162
|
-
`;
|
|
3163
|
-
const OverflowingItem = styled(Box)`
|
|
3164
|
-
overflow-x: hidden;
|
|
3165
|
-
`;
|
|
3166
|
-
const RootLayout = ({ sideNav, children }) => {
|
|
3167
|
-
return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
3168
|
-
sideNav,
|
|
3169
|
-
/* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
3170
|
-
] });
|
|
3171
|
-
};
|
|
3172
|
-
const Layouts = {
|
|
3173
|
-
Root: RootLayout,
|
|
3174
|
-
Header: HeaderLayout,
|
|
3175
|
-
BaseHeader: BaseHeaderLayout,
|
|
3176
|
-
Grid: GridLayout,
|
|
3177
|
-
Action: ActionLayout,
|
|
3178
|
-
Content: ContentLayout
|
|
3179
|
-
};
|
|
3180
|
-
|
|
3181
|
-
const NotFoundPage = () => {
|
|
3182
|
-
const { formatMessage } = useIntl();
|
|
3183
|
-
return /* @__PURE__ */ jsxs(Page.Main, { labelledBy: "title", children: [
|
|
3184
|
-
/* @__PURE__ */ jsx(
|
|
3185
|
-
Layouts.Header,
|
|
3186
|
-
{
|
|
3187
|
-
id: "title",
|
|
3188
|
-
title: formatMessage({
|
|
3189
|
-
id: "content-manager.pageNotFound",
|
|
3190
|
-
defaultMessage: "Page not found"
|
|
3191
|
-
})
|
|
3192
|
-
}
|
|
3193
|
-
),
|
|
3194
|
-
/* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(
|
|
3195
|
-
EmptyStateLayout,
|
|
3133
|
+
);
|
|
3134
|
+
const { token } = useAuth("AuthPage", (auth) => auth);
|
|
3135
|
+
if (!authType || !forms) {
|
|
3136
|
+
return /* @__PURE__ */ jsx(Navigate, { to: "/" });
|
|
3137
|
+
}
|
|
3138
|
+
const Component = forms[authType];
|
|
3139
|
+
if (!Component || hasAdmin && authType === "register-admin" || token) {
|
|
3140
|
+
return /* @__PURE__ */ jsx(Navigate, { to: "/" });
|
|
3141
|
+
}
|
|
3142
|
+
if (!hasAdmin && authType !== "register-admin") {
|
|
3143
|
+
return /* @__PURE__ */ jsx(
|
|
3144
|
+
Navigate,
|
|
3196
3145
|
{
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
defaultMessage: "Oops! We can't seem to find the page you're looging for..."
|
|
3204
|
-
}),
|
|
3205
|
-
hasRadius: true,
|
|
3206
|
-
icon: /* @__PURE__ */ jsx(EmptyPictures, { width: "16rem" }),
|
|
3207
|
-
shadow: "tableShadow"
|
|
3146
|
+
to: {
|
|
3147
|
+
pathname: "/auth/register-admin",
|
|
3148
|
+
// Forward the `?redirectTo` from /auth/login
|
|
3149
|
+
// /abc => /auth/login?redirectTo=%2Fabc => /auth/register-admin?redirectTo=%2Fabc
|
|
3150
|
+
search
|
|
3151
|
+
}
|
|
3208
3152
|
}
|
|
3209
|
-
)
|
|
3210
|
-
|
|
3153
|
+
);
|
|
3154
|
+
}
|
|
3155
|
+
if (Login$1 && authType === "login") {
|
|
3156
|
+
return /* @__PURE__ */ jsx(Login$1, {});
|
|
3157
|
+
} else if (authType === "login" && !Login$1) {
|
|
3158
|
+
return null;
|
|
3159
|
+
}
|
|
3160
|
+
return /* @__PURE__ */ jsx(Component, { hasAdmin });
|
|
3211
3161
|
};
|
|
3212
3162
|
|
|
3213
3163
|
const ROUTES_CE = [
|
|
3214
3164
|
{
|
|
3215
3165
|
lazy: async () => {
|
|
3216
|
-
const { ProtectedListPage } = await import('./ListPage-
|
|
3166
|
+
const { ProtectedListPage } = await import('./ListPage-N0O1Hqdf.mjs');
|
|
3217
3167
|
return {
|
|
3218
3168
|
Component: ProtectedListPage
|
|
3219
3169
|
};
|
|
@@ -3222,7 +3172,7 @@ const ROUTES_CE = [
|
|
|
3222
3172
|
},
|
|
3223
3173
|
{
|
|
3224
3174
|
lazy: async () => {
|
|
3225
|
-
const { ProtectedCreatePage } = await import('./CreatePage-
|
|
3175
|
+
const { ProtectedCreatePage } = await import('./CreatePage-Jtbg4Axr.mjs');
|
|
3226
3176
|
return {
|
|
3227
3177
|
Component: ProtectedCreatePage
|
|
3228
3178
|
};
|
|
@@ -3231,7 +3181,7 @@ const ROUTES_CE = [
|
|
|
3231
3181
|
},
|
|
3232
3182
|
{
|
|
3233
3183
|
lazy: async () => {
|
|
3234
|
-
const { ProtectedCreatePage } = await import('./CreatePage-
|
|
3184
|
+
const { ProtectedCreatePage } = await import('./CreatePage-Jtbg4Axr.mjs');
|
|
3235
3185
|
return {
|
|
3236
3186
|
Component: ProtectedCreatePage
|
|
3237
3187
|
};
|
|
@@ -3240,7 +3190,7 @@ const ROUTES_CE = [
|
|
|
3240
3190
|
},
|
|
3241
3191
|
{
|
|
3242
3192
|
lazy: async () => {
|
|
3243
|
-
const { ProtectedEditPage } = await import('./EditPage-
|
|
3193
|
+
const { ProtectedEditPage } = await import('./EditPage-qz3ag7b-.mjs');
|
|
3244
3194
|
return {
|
|
3245
3195
|
Component: ProtectedEditPage
|
|
3246
3196
|
};
|
|
@@ -3249,7 +3199,7 @@ const ROUTES_CE = [
|
|
|
3249
3199
|
},
|
|
3250
3200
|
{
|
|
3251
3201
|
lazy: async () => {
|
|
3252
|
-
const { ProtectedListPage } = await import('./ListPage-
|
|
3202
|
+
const { ProtectedListPage } = await import('./ListPage-7oDmaO8D.mjs');
|
|
3253
3203
|
return {
|
|
3254
3204
|
Component: ProtectedListPage
|
|
3255
3205
|
};
|
|
@@ -3258,7 +3208,7 @@ const ROUTES_CE = [
|
|
|
3258
3208
|
},
|
|
3259
3209
|
{
|
|
3260
3210
|
lazy: async () => {
|
|
3261
|
-
const { ProtectedEditPage } = await import('./EditPage-
|
|
3211
|
+
const { ProtectedEditPage } = await import('./EditPage-lvtguw64.mjs');
|
|
3262
3212
|
return {
|
|
3263
3213
|
Component: ProtectedEditPage
|
|
3264
3214
|
};
|
|
@@ -3267,7 +3217,7 @@ const ROUTES_CE = [
|
|
|
3267
3217
|
},
|
|
3268
3218
|
{
|
|
3269
3219
|
lazy: async () => {
|
|
3270
|
-
const { ProtectedCreatePage } = await import('./CreatePage-
|
|
3220
|
+
const { ProtectedCreatePage } = await import('./CreatePage-qO5Fsd73.mjs');
|
|
3271
3221
|
return {
|
|
3272
3222
|
Component: ProtectedCreatePage
|
|
3273
3223
|
};
|
|
@@ -3276,7 +3226,7 @@ const ROUTES_CE = [
|
|
|
3276
3226
|
},
|
|
3277
3227
|
{
|
|
3278
3228
|
lazy: async () => {
|
|
3279
|
-
const { ProtectedEditPage } = await import('./EditPage-
|
|
3229
|
+
const { ProtectedEditPage } = await import('./EditPage-UjhP-c39.mjs').then(n => n.b);
|
|
3280
3230
|
return {
|
|
3281
3231
|
Component: ProtectedEditPage
|
|
3282
3232
|
};
|
|
@@ -3285,7 +3235,7 @@ const ROUTES_CE = [
|
|
|
3285
3235
|
},
|
|
3286
3236
|
{
|
|
3287
3237
|
lazy: async () => {
|
|
3288
|
-
const { ProtectedListPage } = await import('./ListPage-
|
|
3238
|
+
const { ProtectedListPage } = await import('./ListPage-L2QuM7UE.mjs');
|
|
3289
3239
|
return {
|
|
3290
3240
|
Component: ProtectedListPage
|
|
3291
3241
|
};
|
|
@@ -3294,7 +3244,7 @@ const ROUTES_CE = [
|
|
|
3294
3244
|
},
|
|
3295
3245
|
{
|
|
3296
3246
|
lazy: async () => {
|
|
3297
|
-
const { ProtectedListView } = await import('./ListView-
|
|
3247
|
+
const { ProtectedListView } = await import('./ListView-vcKS-Zmc.mjs');
|
|
3298
3248
|
return {
|
|
3299
3249
|
Component: ProtectedListView
|
|
3300
3250
|
};
|
|
@@ -3303,68 +3253,482 @@ const ROUTES_CE = [
|
|
|
3303
3253
|
},
|
|
3304
3254
|
{
|
|
3305
3255
|
lazy: async () => {
|
|
3306
|
-
const { ProtectedCreateView } = await import('./CreateView-
|
|
3256
|
+
const { ProtectedCreateView } = await import('./CreateView-6X8zrDa4.mjs');
|
|
3257
|
+
return {
|
|
3258
|
+
Component: ProtectedCreateView
|
|
3259
|
+
};
|
|
3260
|
+
},
|
|
3261
|
+
path: "api-tokens/create"
|
|
3262
|
+
},
|
|
3263
|
+
{
|
|
3264
|
+
lazy: async () => {
|
|
3265
|
+
const { ProtectedEditView } = await import('./EditViewPage-UidswFpY.mjs');
|
|
3266
|
+
return {
|
|
3267
|
+
Component: ProtectedEditView
|
|
3268
|
+
};
|
|
3269
|
+
},
|
|
3270
|
+
path: "api-tokens/:id"
|
|
3271
|
+
},
|
|
3272
|
+
{
|
|
3273
|
+
lazy: async () => {
|
|
3274
|
+
const { ProtectedCreateView } = await import('./CreateView-I_AcEctc.mjs');
|
|
3307
3275
|
return {
|
|
3308
3276
|
Component: ProtectedCreateView
|
|
3309
3277
|
};
|
|
3310
3278
|
},
|
|
3311
|
-
path: "
|
|
3312
|
-
},
|
|
3313
|
-
{
|
|
3314
|
-
lazy: async () => {
|
|
3315
|
-
const {
|
|
3316
|
-
return {
|
|
3317
|
-
Component:
|
|
3318
|
-
};
|
|
3279
|
+
path: "transfer-tokens/create"
|
|
3280
|
+
},
|
|
3281
|
+
{
|
|
3282
|
+
lazy: async () => {
|
|
3283
|
+
const { ProtectedListView } = await import('./ListView-0PnKwTDf.mjs');
|
|
3284
|
+
return {
|
|
3285
|
+
Component: ProtectedListView
|
|
3286
|
+
};
|
|
3287
|
+
},
|
|
3288
|
+
path: "transfer-tokens"
|
|
3289
|
+
},
|
|
3290
|
+
{
|
|
3291
|
+
lazy: async () => {
|
|
3292
|
+
const { ProtectedEditView } = await import('./EditView-qzOuPJuV.mjs');
|
|
3293
|
+
return {
|
|
3294
|
+
Component: ProtectedEditView
|
|
3295
|
+
};
|
|
3296
|
+
},
|
|
3297
|
+
path: "transfer-tokens/:id"
|
|
3298
|
+
},
|
|
3299
|
+
{
|
|
3300
|
+
lazy: async () => {
|
|
3301
|
+
const { PurchaseAuditLogs } = await import('./PurchaseAuditLogs-nEBPLzVm.mjs');
|
|
3302
|
+
return {
|
|
3303
|
+
Component: PurchaseAuditLogs
|
|
3304
|
+
};
|
|
3305
|
+
},
|
|
3306
|
+
path: "purchase-audit-logs"
|
|
3307
|
+
},
|
|
3308
|
+
{
|
|
3309
|
+
lazy: async () => {
|
|
3310
|
+
const { PurchaseSingleSignOn } = await import('./PurchaseSingleSignOn-O1zGlyVf.mjs');
|
|
3311
|
+
return {
|
|
3312
|
+
Component: PurchaseSingleSignOn
|
|
3313
|
+
};
|
|
3314
|
+
},
|
|
3315
|
+
path: "purchase-single-sign-on"
|
|
3316
|
+
}
|
|
3317
|
+
];
|
|
3318
|
+
|
|
3319
|
+
const getImmutableRoutes = () => [
|
|
3320
|
+
{
|
|
3321
|
+
path: "usecase",
|
|
3322
|
+
lazy: async () => {
|
|
3323
|
+
const { PrivateUseCasePage } = await import('./UseCasePage-gVGjn6p2.mjs');
|
|
3324
|
+
return {
|
|
3325
|
+
Component: PrivateUseCasePage
|
|
3326
|
+
};
|
|
3327
|
+
}
|
|
3328
|
+
},
|
|
3329
|
+
// this needs to go before auth/:authType because otherwise it won't match the route
|
|
3330
|
+
...getEERoutes$1(),
|
|
3331
|
+
{
|
|
3332
|
+
path: "auth/:authType",
|
|
3333
|
+
element: /* @__PURE__ */ jsx(AuthPage, {})
|
|
3334
|
+
}
|
|
3335
|
+
];
|
|
3336
|
+
const getInitialRoutes = () => [
|
|
3337
|
+
{
|
|
3338
|
+
index: true,
|
|
3339
|
+
lazy: async () => {
|
|
3340
|
+
const { HomePage } = await import('./HomePage-l0hSTO83.mjs');
|
|
3341
|
+
return {
|
|
3342
|
+
Component: HomePage
|
|
3343
|
+
};
|
|
3344
|
+
}
|
|
3345
|
+
},
|
|
3346
|
+
{
|
|
3347
|
+
path: "me",
|
|
3348
|
+
lazy: async () => {
|
|
3349
|
+
const { ProfilePage } = await import('./ProfilePage-XBXtSTmT.mjs');
|
|
3350
|
+
return {
|
|
3351
|
+
Component: ProfilePage
|
|
3352
|
+
};
|
|
3353
|
+
}
|
|
3354
|
+
},
|
|
3355
|
+
{
|
|
3356
|
+
path: "list-plugins",
|
|
3357
|
+
lazy: async () => {
|
|
3358
|
+
const { ProtectedInstalledPluginsPage } = await import('./InstalledPluginsPage-mjDk7bIy.mjs');
|
|
3359
|
+
return {
|
|
3360
|
+
Component: ProtectedInstalledPluginsPage
|
|
3361
|
+
};
|
|
3362
|
+
}
|
|
3363
|
+
},
|
|
3364
|
+
{
|
|
3365
|
+
path: "marketplace",
|
|
3366
|
+
lazy: async () => {
|
|
3367
|
+
const { ProtectedMarketplacePage } = await import('./MarketplacePage-d1n38TCm.mjs');
|
|
3368
|
+
return {
|
|
3369
|
+
Component: ProtectedMarketplacePage
|
|
3370
|
+
};
|
|
3371
|
+
}
|
|
3372
|
+
},
|
|
3373
|
+
{
|
|
3374
|
+
path: "settings/*",
|
|
3375
|
+
lazy: async () => {
|
|
3376
|
+
const { Layout } = await import('./Layout-JfZEpoAi.mjs');
|
|
3377
|
+
return {
|
|
3378
|
+
Component: Layout
|
|
3379
|
+
};
|
|
3380
|
+
},
|
|
3381
|
+
children: [
|
|
3382
|
+
{
|
|
3383
|
+
path: "application-infos",
|
|
3384
|
+
lazy: async () => {
|
|
3385
|
+
const { ApplicationInfoPage } = await import('./ApplicationInfoPage-uasiyWB5.mjs');
|
|
3386
|
+
return {
|
|
3387
|
+
Component: ApplicationInfoPage
|
|
3388
|
+
};
|
|
3389
|
+
}
|
|
3390
|
+
},
|
|
3391
|
+
// ...Object.values(this.settings).flatMap(({ links }) =>
|
|
3392
|
+
// links.map(({ to, Component }) => ({
|
|
3393
|
+
// path: `${to}/*`,
|
|
3394
|
+
// element: (
|
|
3395
|
+
// <React.Suspense fallback={<Page.Loading />}>
|
|
3396
|
+
// <Component />
|
|
3397
|
+
// </React.Suspense>
|
|
3398
|
+
// ),
|
|
3399
|
+
// }))
|
|
3400
|
+
// ),
|
|
3401
|
+
...[...getEERoutes(), ...ROUTES_CE].filter(
|
|
3402
|
+
(route, index, refArray) => refArray.findIndex((obj) => obj.path === route.path) === index
|
|
3403
|
+
)
|
|
3404
|
+
]
|
|
3405
|
+
}
|
|
3406
|
+
];
|
|
3407
|
+
|
|
3408
|
+
class Router {
|
|
3409
|
+
_routes = [];
|
|
3410
|
+
router = null;
|
|
3411
|
+
_menu = [];
|
|
3412
|
+
_settings = {
|
|
3413
|
+
global: {
|
|
3414
|
+
id: "global",
|
|
3415
|
+
intlLabel: {
|
|
3416
|
+
id: "Settings.global",
|
|
3417
|
+
defaultMessage: "Global Settings"
|
|
3418
|
+
},
|
|
3419
|
+
links: []
|
|
3420
|
+
}
|
|
3421
|
+
};
|
|
3422
|
+
constructor(initialRoutes) {
|
|
3423
|
+
this._routes = initialRoutes;
|
|
3424
|
+
}
|
|
3425
|
+
get routes() {
|
|
3426
|
+
return this._routes;
|
|
3427
|
+
}
|
|
3428
|
+
get menu() {
|
|
3429
|
+
return this._menu;
|
|
3430
|
+
}
|
|
3431
|
+
get settings() {
|
|
3432
|
+
return this._settings;
|
|
3433
|
+
}
|
|
3434
|
+
/**
|
|
3435
|
+
* @internal This method is used internally by Strapi to create the router.
|
|
3436
|
+
* It should not be used by plugins, doing so will likely break the application.
|
|
3437
|
+
*/
|
|
3438
|
+
createRouter(strapi, { memory, ...opts } = {}) {
|
|
3439
|
+
const routes = [
|
|
3440
|
+
{
|
|
3441
|
+
path: "/*",
|
|
3442
|
+
errorElement: /* @__PURE__ */ jsx(Provider$1, { store: strapi.store, children: /* @__PURE__ */ jsx(LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsx(ErrorElement, {}) }) }) }),
|
|
3443
|
+
element: /* @__PURE__ */ jsx(App, { strapi, store: strapi.store }),
|
|
3444
|
+
children: [
|
|
3445
|
+
...getImmutableRoutes(),
|
|
3446
|
+
{
|
|
3447
|
+
path: "/*",
|
|
3448
|
+
lazy: async () => {
|
|
3449
|
+
const { PrivateAdminLayout } = await import('./AuthenticatedLayout-WgDErBPS.mjs');
|
|
3450
|
+
return {
|
|
3451
|
+
Component: PrivateAdminLayout
|
|
3452
|
+
};
|
|
3453
|
+
},
|
|
3454
|
+
children: [
|
|
3455
|
+
...this.routes,
|
|
3456
|
+
{
|
|
3457
|
+
path: "*",
|
|
3458
|
+
element: /* @__PURE__ */ jsx(NotFoundPage, {})
|
|
3459
|
+
}
|
|
3460
|
+
]
|
|
3461
|
+
}
|
|
3462
|
+
]
|
|
3463
|
+
}
|
|
3464
|
+
];
|
|
3465
|
+
if (memory) {
|
|
3466
|
+
this.router = createMemoryRouter(routes, opts);
|
|
3467
|
+
} else {
|
|
3468
|
+
this.router = createBrowserRouter(routes, opts);
|
|
3469
|
+
}
|
|
3470
|
+
return this.router;
|
|
3471
|
+
}
|
|
3472
|
+
addMenuLink = (link) => {
|
|
3473
|
+
invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3474
|
+
invariant(
|
|
3475
|
+
typeof link.to === "string",
|
|
3476
|
+
`[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
|
|
3477
|
+
);
|
|
3478
|
+
invariant(
|
|
3479
|
+
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3480
|
+
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
|
|
3481
|
+
);
|
|
3482
|
+
invariant(
|
|
3483
|
+
!link.Component || link.Component && typeof link.Component === "function",
|
|
3484
|
+
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
|
|
3485
|
+
);
|
|
3486
|
+
if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3487
|
+
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3488
|
+
console.warn(
|
|
3489
|
+
`
|
|
3490
|
+
[${link.intlLabel.defaultMessage}]: [deprecated] addMenuLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
|
|
3491
|
+
`.trim()
|
|
3492
|
+
);
|
|
3493
|
+
}
|
|
3494
|
+
if (link.to.startsWith("/")) {
|
|
3495
|
+
console.warn(
|
|
3496
|
+
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your menu link is an absolute path, it should be relative to the root of the application. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3497
|
+
);
|
|
3498
|
+
link.to = link.to.slice(1);
|
|
3499
|
+
}
|
|
3500
|
+
const { Component, ...restLink } = link;
|
|
3501
|
+
if (Component) {
|
|
3502
|
+
this._routes.push({
|
|
3503
|
+
path: `${link.to}/*`,
|
|
3504
|
+
lazy: async () => {
|
|
3505
|
+
const mod = await Component();
|
|
3506
|
+
if ("default" in mod) {
|
|
3507
|
+
return { Component: mod.default };
|
|
3508
|
+
} else {
|
|
3509
|
+
return { Component: mod };
|
|
3510
|
+
}
|
|
3511
|
+
}
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3514
|
+
this.menu.push(restLink);
|
|
3515
|
+
};
|
|
3516
|
+
addSettingsLink(section, link) {
|
|
3517
|
+
if (typeof section === "object" && "links" in section) {
|
|
3518
|
+
invariant(section.id, "section.id should be defined");
|
|
3519
|
+
invariant(
|
|
3520
|
+
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3521
|
+
"section.intlLabel should be defined"
|
|
3522
|
+
);
|
|
3523
|
+
invariant(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3524
|
+
invariant(Array.isArray(section.links), "TypeError expected links to be an array");
|
|
3525
|
+
this.settings[section.id] = { ...section, links: [] };
|
|
3526
|
+
section.links.forEach((link2) => {
|
|
3527
|
+
this.createSettingsLink(section.id, link2);
|
|
3528
|
+
});
|
|
3529
|
+
} else if (typeof section === "object" && link) {
|
|
3530
|
+
invariant(section.id, "section.id should be defined");
|
|
3531
|
+
invariant(
|
|
3532
|
+
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3533
|
+
"section.intlLabel should be defined"
|
|
3534
|
+
);
|
|
3535
|
+
invariant(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3536
|
+
this.settings[section.id] = { ...section, links: [] };
|
|
3537
|
+
if (Array.isArray(link)) {
|
|
3538
|
+
link.forEach((l) => this.createSettingsLink(section.id, l));
|
|
3539
|
+
} else {
|
|
3540
|
+
this.createSettingsLink(section.id, link);
|
|
3541
|
+
}
|
|
3542
|
+
} else if (typeof section === "string" && link) {
|
|
3543
|
+
if (Array.isArray(link)) {
|
|
3544
|
+
link.forEach((l) => this.createSettingsLink(section, l));
|
|
3545
|
+
} else {
|
|
3546
|
+
this.createSettingsLink(section, link);
|
|
3547
|
+
}
|
|
3548
|
+
} else {
|
|
3549
|
+
throw new Error(
|
|
3550
|
+
"Invalid arguments provided to addSettingsLink, at minimum a sectionId and link are required."
|
|
3551
|
+
);
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
createSettingsLink = (sectionId, link) => {
|
|
3555
|
+
invariant(this._settings[sectionId], "The section does not exist");
|
|
3556
|
+
invariant(link.id, `[${link.intlLabel.defaultMessage}]: link.id should be defined`);
|
|
3557
|
+
invariant(
|
|
3558
|
+
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3559
|
+
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
|
|
3560
|
+
);
|
|
3561
|
+
invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3562
|
+
invariant(
|
|
3563
|
+
!link.Component || link.Component && typeof link.Component === "function",
|
|
3564
|
+
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
|
|
3565
|
+
);
|
|
3566
|
+
if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3567
|
+
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3568
|
+
console.warn(
|
|
3569
|
+
`
|
|
3570
|
+
[${link.intlLabel.defaultMessage}]: [deprecated] addSettingsLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
|
|
3571
|
+
`.trim()
|
|
3572
|
+
);
|
|
3573
|
+
}
|
|
3574
|
+
if (link.to.startsWith("/")) {
|
|
3575
|
+
console.warn(
|
|
3576
|
+
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link is an absolute path. It should be relative to \`/settings\`. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3577
|
+
);
|
|
3578
|
+
link.to = link.to.slice(1);
|
|
3579
|
+
}
|
|
3580
|
+
if (link.to.split("/")[0] === "settings") {
|
|
3581
|
+
console.warn(
|
|
3582
|
+
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link has \`settings\` as the first part of it's path. It should be relative to \`settings\` and therefore, not include it. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3583
|
+
);
|
|
3584
|
+
link.to = link.to.split("/").slice(1).join("/");
|
|
3585
|
+
}
|
|
3586
|
+
const { Component, ...restLink } = link;
|
|
3587
|
+
const settingsIndex = this._routes.findIndex((route) => route.path === "settings/*");
|
|
3588
|
+
if (!settingsIndex) {
|
|
3589
|
+
console.warn(
|
|
3590
|
+
"A third party plugin has removed the settings section, the settings link cannot be added."
|
|
3591
|
+
);
|
|
3592
|
+
return;
|
|
3593
|
+
} else if (!this._routes[settingsIndex].children) {
|
|
3594
|
+
this._routes[settingsIndex].children = [];
|
|
3595
|
+
}
|
|
3596
|
+
if (Component) {
|
|
3597
|
+
this._routes[settingsIndex].children.push({
|
|
3598
|
+
path: `${link.to}/*`,
|
|
3599
|
+
lazy: async () => {
|
|
3600
|
+
const mod = await Component();
|
|
3601
|
+
if ("default" in mod) {
|
|
3602
|
+
return { Component: mod.default };
|
|
3603
|
+
} else {
|
|
3604
|
+
return { Component: mod };
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
});
|
|
3608
|
+
}
|
|
3609
|
+
this._settings[sectionId].links.push(restLink);
|
|
3610
|
+
};
|
|
3611
|
+
/**
|
|
3612
|
+
* @alpha
|
|
3613
|
+
* @description Adds a route or an array of routes to the router.
|
|
3614
|
+
* Otherwise, pass a function that receives the current routes and
|
|
3615
|
+
* returns the new routes in a reducer like fashion.
|
|
3616
|
+
*/
|
|
3617
|
+
addRoute(route) {
|
|
3618
|
+
if (Array.isArray(route)) {
|
|
3619
|
+
this._routes = [...this._routes, ...route];
|
|
3620
|
+
} else if (typeof route === "object" && route !== null) {
|
|
3621
|
+
this._routes.push(route);
|
|
3622
|
+
} else if (typeof route === "function") {
|
|
3623
|
+
this._routes = route(this._routes);
|
|
3624
|
+
} else {
|
|
3625
|
+
throw new Error(
|
|
3626
|
+
`Expected the \`route\` passed to \`addRoute\` to be an array or a function, but received ${getPrintableType(
|
|
3627
|
+
route
|
|
3628
|
+
)}`
|
|
3629
|
+
);
|
|
3630
|
+
}
|
|
3631
|
+
}
|
|
3632
|
+
}
|
|
3633
|
+
const getPrintableType = (value) => {
|
|
3634
|
+
const nativeType = typeof value;
|
|
3635
|
+
if (nativeType === "object") {
|
|
3636
|
+
if (value === null)
|
|
3637
|
+
return "null";
|
|
3638
|
+
if (Array.isArray(value))
|
|
3639
|
+
return "array";
|
|
3640
|
+
if (value instanceof Object && value.constructor.name !== "Object") {
|
|
3641
|
+
return value.constructor.name;
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
return nativeType;
|
|
3645
|
+
};
|
|
3646
|
+
|
|
3647
|
+
const staticReducers = {
|
|
3648
|
+
[adminApi.reducerPath]: adminApi.reducer,
|
|
3649
|
+
admin_app: reducer$3
|
|
3650
|
+
};
|
|
3651
|
+
const injectReducerStoreEnhancer = (appReducers) => (next) => (...args) => {
|
|
3652
|
+
const store = next(...args);
|
|
3653
|
+
const asyncReducers = {};
|
|
3654
|
+
return {
|
|
3655
|
+
...store,
|
|
3656
|
+
asyncReducers,
|
|
3657
|
+
injectReducer: (key, asyncReducer) => {
|
|
3658
|
+
asyncReducers[key] = asyncReducer;
|
|
3659
|
+
store.replaceReducer(
|
|
3660
|
+
// @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
|
|
3661
|
+
combineReducers({
|
|
3662
|
+
...appReducers,
|
|
3663
|
+
...asyncReducers
|
|
3664
|
+
})
|
|
3665
|
+
);
|
|
3666
|
+
}
|
|
3667
|
+
};
|
|
3668
|
+
};
|
|
3669
|
+
const configureStoreImpl = (preloadedState = {}, appMiddlewares = [], injectedReducers = {}) => {
|
|
3670
|
+
const coreReducers = { ...staticReducers, ...injectedReducers };
|
|
3671
|
+
const defaultMiddlewareOptions = {};
|
|
3672
|
+
if (process.env.NODE_ENV === "test") {
|
|
3673
|
+
defaultMiddlewareOptions.serializableCheck = false;
|
|
3674
|
+
defaultMiddlewareOptions.immutableCheck = false;
|
|
3675
|
+
}
|
|
3676
|
+
const store = configureStore({
|
|
3677
|
+
preloadedState: {
|
|
3678
|
+
admin_app: preloadedState.admin_app
|
|
3679
|
+
},
|
|
3680
|
+
reducer: coreReducers,
|
|
3681
|
+
devTools: process.env.NODE_ENV !== "production",
|
|
3682
|
+
middleware: (getDefaultMiddleware) => [
|
|
3683
|
+
...getDefaultMiddleware(defaultMiddlewareOptions),
|
|
3684
|
+
adminApi.middleware,
|
|
3685
|
+
...appMiddlewares.map((m) => m())
|
|
3686
|
+
],
|
|
3687
|
+
enhancers: [injectReducerStoreEnhancer(coreReducers)]
|
|
3688
|
+
});
|
|
3689
|
+
return store;
|
|
3690
|
+
};
|
|
3691
|
+
|
|
3692
|
+
const getBasename = () => (process.env.ADMIN_PATH ?? "").replace(window.location.origin, "");
|
|
3693
|
+
|
|
3694
|
+
const createHook = () => {
|
|
3695
|
+
const _handlers = [];
|
|
3696
|
+
return {
|
|
3697
|
+
register(fn) {
|
|
3698
|
+
_handlers.push(fn);
|
|
3319
3699
|
},
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
{
|
|
3323
|
-
lazy: async () => {
|
|
3324
|
-
const { ProtectedCreateView } = await import('./CreateView-aMz4KfSZ.mjs');
|
|
3325
|
-
return {
|
|
3326
|
-
Component: ProtectedCreateView
|
|
3327
|
-
};
|
|
3700
|
+
delete(handler) {
|
|
3701
|
+
_handlers.splice(_handlers.indexOf(handler), 1);
|
|
3328
3702
|
},
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
{
|
|
3332
|
-
lazy: async () => {
|
|
3333
|
-
const { ProtectedListView } = await import('./ListView-geMTlhDN.mjs');
|
|
3334
|
-
return {
|
|
3335
|
-
Component: ProtectedListView
|
|
3336
|
-
};
|
|
3703
|
+
runWaterfall(args, store) {
|
|
3704
|
+
return _handlers.reduce((acc, fn) => fn(acc, store), args);
|
|
3337
3705
|
},
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
return
|
|
3344
|
-
Component: ProtectedEditView
|
|
3345
|
-
};
|
|
3706
|
+
async runWaterfallAsync(args, store) {
|
|
3707
|
+
let result = args;
|
|
3708
|
+
for (const fn of _handlers) {
|
|
3709
|
+
result = await fn(result, store);
|
|
3710
|
+
}
|
|
3711
|
+
return result;
|
|
3346
3712
|
},
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
{
|
|
3350
|
-
lazy: async () => {
|
|
3351
|
-
const { PurchaseAuditLogs } = await import('./PurchaseAuditLogs-tpXbhCx-.mjs');
|
|
3352
|
-
return {
|
|
3353
|
-
Component: PurchaseAuditLogs
|
|
3354
|
-
};
|
|
3713
|
+
runSeries(...args) {
|
|
3714
|
+
return _handlers.map((fn) => fn(...args));
|
|
3355
3715
|
},
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
return
|
|
3362
|
-
Component: PurchaseSingleSignOn
|
|
3363
|
-
};
|
|
3716
|
+
async runSeriesAsync(...args) {
|
|
3717
|
+
const result = [];
|
|
3718
|
+
for (const fn of _handlers) {
|
|
3719
|
+
result.push(await fn(...args));
|
|
3720
|
+
}
|
|
3721
|
+
return result;
|
|
3364
3722
|
},
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3723
|
+
runParallel(...args) {
|
|
3724
|
+
return Promise.all(
|
|
3725
|
+
_handlers.map((fn) => {
|
|
3726
|
+
return fn(...args);
|
|
3727
|
+
})
|
|
3728
|
+
);
|
|
3729
|
+
}
|
|
3730
|
+
};
|
|
3731
|
+
};
|
|
3368
3732
|
|
|
3369
3733
|
const languageNativeNames = {
|
|
3370
3734
|
ar: "العربية",
|
|
@@ -3417,20 +3781,6 @@ class StrapiApp {
|
|
|
3417
3781
|
injectionZones: {}
|
|
3418
3782
|
};
|
|
3419
3783
|
translations = {};
|
|
3420
|
-
/**
|
|
3421
|
-
* MENU API
|
|
3422
|
-
*/
|
|
3423
|
-
menu = [];
|
|
3424
|
-
settings = {
|
|
3425
|
-
global: {
|
|
3426
|
-
id: "global",
|
|
3427
|
-
intlLabel: {
|
|
3428
|
-
id: "Settings.global",
|
|
3429
|
-
defaultMessage: "Global Settings"
|
|
3430
|
-
},
|
|
3431
|
-
links: []
|
|
3432
|
-
}
|
|
3433
|
-
};
|
|
3434
3784
|
configurations = {
|
|
3435
3785
|
authLogo: StrapiLogo,
|
|
3436
3786
|
head: { favicon: "" },
|
|
@@ -3445,12 +3795,14 @@ class StrapiApp {
|
|
|
3445
3795
|
* APIs
|
|
3446
3796
|
*/
|
|
3447
3797
|
rbac = new RBAC();
|
|
3798
|
+
router;
|
|
3448
3799
|
library = {
|
|
3449
3800
|
components: {},
|
|
3450
3801
|
fields: {}
|
|
3451
3802
|
};
|
|
3452
3803
|
middlewares = [];
|
|
3453
3804
|
reducers = {};
|
|
3805
|
+
store = null;
|
|
3454
3806
|
customFields = new CustomFields();
|
|
3455
3807
|
constructor({ config, appPlugins } = {}) {
|
|
3456
3808
|
this.appPlugins = appPlugins || {};
|
|
@@ -3459,6 +3811,7 @@ class StrapiApp {
|
|
|
3459
3811
|
this.createHook(MUTATE_COLLECTION_TYPES_LINKS);
|
|
3460
3812
|
this.createHook(MUTATE_SINGLE_TYPES_LINKS);
|
|
3461
3813
|
this.createHook(MUTATE_EDIT_VIEW_LAYOUT);
|
|
3814
|
+
this.router = new Router(getInitialRoutes());
|
|
3462
3815
|
}
|
|
3463
3816
|
addComponents = (components) => {
|
|
3464
3817
|
if (Array.isArray(components)) {
|
|
@@ -3486,46 +3839,6 @@ class StrapiApp {
|
|
|
3486
3839
|
this.library.fields[fields.type] = fields.Component;
|
|
3487
3840
|
}
|
|
3488
3841
|
};
|
|
3489
|
-
addMenuLink = (link) => {
|
|
3490
|
-
invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3491
|
-
invariant(
|
|
3492
|
-
typeof link.to === "string",
|
|
3493
|
-
`[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
|
|
3494
|
-
);
|
|
3495
|
-
invariant(
|
|
3496
|
-
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3497
|
-
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
|
|
3498
|
-
);
|
|
3499
|
-
invariant(
|
|
3500
|
-
link.Component && typeof link.Component === "function",
|
|
3501
|
-
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
|
|
3502
|
-
);
|
|
3503
|
-
if (link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3504
|
-
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3505
|
-
console.warn(
|
|
3506
|
-
`
|
|
3507
|
-
[${link.intlLabel.defaultMessage}]: [deprecated] addMenuLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
|
|
3508
|
-
`.trim()
|
|
3509
|
-
);
|
|
3510
|
-
}
|
|
3511
|
-
if (link.to.startsWith("/")) {
|
|
3512
|
-
console.warn(
|
|
3513
|
-
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your menu link is an absolute path, it should be relative to the root of the application. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3514
|
-
);
|
|
3515
|
-
link.to = link.to.slice(1);
|
|
3516
|
-
}
|
|
3517
|
-
this.menu.push({
|
|
3518
|
-
...link,
|
|
3519
|
-
Component: React.lazy(async () => {
|
|
3520
|
-
const mod = await link.Component();
|
|
3521
|
-
if ("default" in mod) {
|
|
3522
|
-
return mod;
|
|
3523
|
-
} else {
|
|
3524
|
-
return { default: mod };
|
|
3525
|
-
}
|
|
3526
|
-
})
|
|
3527
|
-
});
|
|
3528
|
-
};
|
|
3529
3842
|
addMiddlewares = (middlewares) => {
|
|
3530
3843
|
middlewares.forEach((middleware) => {
|
|
3531
3844
|
this.middlewares.push(middleware);
|
|
@@ -3543,56 +3856,22 @@ class StrapiApp {
|
|
|
3543
3856
|
this.reducers[name] = reducer;
|
|
3544
3857
|
});
|
|
3545
3858
|
};
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
|
|
3552
|
-
);
|
|
3553
|
-
invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3554
|
-
invariant(
|
|
3555
|
-
link.Component && typeof link.Component === "function",
|
|
3556
|
-
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
|
|
3557
|
-
);
|
|
3558
|
-
if (link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3559
|
-
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3560
|
-
console.warn(
|
|
3561
|
-
`
|
|
3562
|
-
[${link.intlLabel.defaultMessage}]: [deprecated] addSettingsLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
|
|
3563
|
-
`.trim()
|
|
3564
|
-
);
|
|
3565
|
-
}
|
|
3566
|
-
if (link.to.startsWith("/")) {
|
|
3567
|
-
console.warn(
|
|
3568
|
-
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link is an absolute path. It should be relative to \`/settings\`. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3569
|
-
);
|
|
3570
|
-
link.to = link.to.slice(1);
|
|
3571
|
-
}
|
|
3572
|
-
if (link.to.split("/")[0] === "settings") {
|
|
3573
|
-
console.warn(
|
|
3574
|
-
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link has \`settings\` as the first part of it's path. It should be relative to \`settings\` and therefore, not include it. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3575
|
-
);
|
|
3576
|
-
link.to = link.to.split("/").slice(1).join("/");
|
|
3577
|
-
}
|
|
3578
|
-
this.settings[sectionId].links.push({
|
|
3579
|
-
...link,
|
|
3580
|
-
Component: React.lazy(async () => {
|
|
3581
|
-
const mod = await link.Component();
|
|
3582
|
-
if ("default" in mod) {
|
|
3583
|
-
return mod;
|
|
3584
|
-
} else {
|
|
3585
|
-
return { default: mod };
|
|
3586
|
-
}
|
|
3587
|
-
})
|
|
3588
|
-
});
|
|
3589
|
-
};
|
|
3859
|
+
addMenuLink = (link) => this.router.addMenuLink(link);
|
|
3860
|
+
/**
|
|
3861
|
+
* @deprecated use `addSettingsLink` instead, it internally supports
|
|
3862
|
+
* adding multiple links at once.
|
|
3863
|
+
*/
|
|
3590
3864
|
addSettingsLinks = (sectionId, links) => {
|
|
3591
|
-
invariant(this.settings[sectionId], "The section does not exist");
|
|
3592
3865
|
invariant(Array.isArray(links), "TypeError expected links to be an array");
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3866
|
+
this.router.addSettingsLink(sectionId, links);
|
|
3867
|
+
};
|
|
3868
|
+
/**
|
|
3869
|
+
* @deprecated use `addSettingsLink` instead, you can pass a section object to
|
|
3870
|
+
* create the section and links at the same time.
|
|
3871
|
+
*/
|
|
3872
|
+
createSettingSection = (section, links) => this.router.addSettingsLink(section, links);
|
|
3873
|
+
addSettingsLink = (sectionId, link) => {
|
|
3874
|
+
this.router.addSettingsLink(sectionId, link);
|
|
3596
3875
|
};
|
|
3597
3876
|
async bootstrap(customBootstrap) {
|
|
3598
3877
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
@@ -3659,19 +3938,6 @@ class StrapiApp {
|
|
|
3659
3938
|
createHook = (name) => {
|
|
3660
3939
|
this.hooksDict[name] = createHook();
|
|
3661
3940
|
};
|
|
3662
|
-
createSettingSection = (section, links) => {
|
|
3663
|
-
invariant(section.id, "section.id should be defined");
|
|
3664
|
-
invariant(
|
|
3665
|
-
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3666
|
-
"section.intlLabel should be defined"
|
|
3667
|
-
);
|
|
3668
|
-
invariant(Array.isArray(links), "TypeError expected links to be an array");
|
|
3669
|
-
invariant(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3670
|
-
this.settings[section.id] = { ...section, links: [] };
|
|
3671
|
-
links.forEach((link) => {
|
|
3672
|
-
this.addSettingsLink(section.id, link);
|
|
3673
|
-
});
|
|
3674
|
-
};
|
|
3675
3941
|
getAdminInjectedComponents = (moduleName, containerName, blockName) => {
|
|
3676
3942
|
try {
|
|
3677
3943
|
return this.admin.injectionZones[moduleName][containerName][blockName] || [];
|
|
@@ -3681,10 +3947,13 @@ class StrapiApp {
|
|
|
3681
3947
|
}
|
|
3682
3948
|
};
|
|
3683
3949
|
getPlugin = (pluginId) => this.plugins[pluginId];
|
|
3684
|
-
async register() {
|
|
3950
|
+
async register(customRegister) {
|
|
3685
3951
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
3686
3952
|
this.appPlugins[plugin].register(this);
|
|
3687
3953
|
});
|
|
3954
|
+
if (isFunction(customRegister)) {
|
|
3955
|
+
customRegister(this);
|
|
3956
|
+
}
|
|
3688
3957
|
}
|
|
3689
3958
|
async loadAdminTrads() {
|
|
3690
3959
|
const adminLocales = await Promise.all(
|
|
@@ -3764,7 +4033,7 @@ class StrapiApp {
|
|
|
3764
4033
|
render() {
|
|
3765
4034
|
const localeNames = pick(languageNativeNames, this.configurations.locales || []);
|
|
3766
4035
|
const locale = localStorage.getItem(LANGUAGE_LOCAL_STORAGE_KEY) || "en";
|
|
3767
|
-
|
|
4036
|
+
this.store = configureStoreImpl(
|
|
3768
4037
|
{
|
|
3769
4038
|
admin_app: {
|
|
3770
4039
|
permissions: merge({}, ADMIN_PERMISSIONS_CE, ADMIN_PERMISSIONS_EE),
|
|
@@ -3781,120 +4050,9 @@ class StrapiApp {
|
|
|
3781
4050
|
this.middlewares,
|
|
3782
4051
|
this.reducers
|
|
3783
4052
|
);
|
|
3784
|
-
const
|
|
3785
|
-
|
|
3786
|
-
);
|
|
3787
|
-
const router = createBrowserRouter(
|
|
3788
|
-
[
|
|
3789
|
-
{
|
|
3790
|
-
path: "/*",
|
|
3791
|
-
errorElement: /* @__PURE__ */ jsx(Provider$1, { store, children: /* @__PURE__ */ jsx(LanguageProvider, { messages: this.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: this.configurations.themes, children: /* @__PURE__ */ jsx(ErrorElement, {}) }) }) }),
|
|
3792
|
-
element: /* @__PURE__ */ jsx(App, { strapi: this, store }),
|
|
3793
|
-
children: [
|
|
3794
|
-
{
|
|
3795
|
-
path: "usecase",
|
|
3796
|
-
lazy: async () => {
|
|
3797
|
-
const { PrivateUseCasePage } = await import('./UseCasePage-QsvlJAQD.mjs');
|
|
3798
|
-
return {
|
|
3799
|
-
Component: PrivateUseCasePage
|
|
3800
|
-
};
|
|
3801
|
-
}
|
|
3802
|
-
},
|
|
3803
|
-
// this needs to go before auth/:authType because otherwise it won't match the route
|
|
3804
|
-
...getEERoutes$1(),
|
|
3805
|
-
{
|
|
3806
|
-
path: "auth/:authType",
|
|
3807
|
-
element: /* @__PURE__ */ jsx(AuthPage, {})
|
|
3808
|
-
},
|
|
3809
|
-
{
|
|
3810
|
-
path: "/*",
|
|
3811
|
-
lazy: async () => {
|
|
3812
|
-
const { PrivateAdminLayout } = await import('./AuthenticatedLayout-lXbF2KKJ.mjs');
|
|
3813
|
-
return {
|
|
3814
|
-
Component: PrivateAdminLayout
|
|
3815
|
-
};
|
|
3816
|
-
},
|
|
3817
|
-
children: [
|
|
3818
|
-
{
|
|
3819
|
-
index: true,
|
|
3820
|
-
lazy: async () => {
|
|
3821
|
-
const { HomePage } = await import('./HomePage--Mskxb9Z.mjs');
|
|
3822
|
-
return {
|
|
3823
|
-
Component: HomePage
|
|
3824
|
-
};
|
|
3825
|
-
}
|
|
3826
|
-
},
|
|
3827
|
-
{
|
|
3828
|
-
path: "me",
|
|
3829
|
-
lazy: async () => {
|
|
3830
|
-
const { ProfilePage } = await import('./ProfilePage-Q5UpeDjs.mjs');
|
|
3831
|
-
return {
|
|
3832
|
-
Component: ProfilePage
|
|
3833
|
-
};
|
|
3834
|
-
}
|
|
3835
|
-
},
|
|
3836
|
-
{
|
|
3837
|
-
path: "list-plugins",
|
|
3838
|
-
lazy: async () => {
|
|
3839
|
-
const { ProtectedInstalledPluginsPage } = await import('./InstalledPluginsPage-EtnkMG0G.mjs');
|
|
3840
|
-
return {
|
|
3841
|
-
Component: ProtectedInstalledPluginsPage
|
|
3842
|
-
};
|
|
3843
|
-
}
|
|
3844
|
-
},
|
|
3845
|
-
{
|
|
3846
|
-
path: "marketplace",
|
|
3847
|
-
lazy: async () => {
|
|
3848
|
-
const { ProtectedMarketplacePage } = await import('./MarketplacePage-Pk9USes6.mjs');
|
|
3849
|
-
return {
|
|
3850
|
-
Component: ProtectedMarketplacePage
|
|
3851
|
-
};
|
|
3852
|
-
}
|
|
3853
|
-
},
|
|
3854
|
-
{
|
|
3855
|
-
path: "settings/*",
|
|
3856
|
-
lazy: async () => {
|
|
3857
|
-
const { Layout } = await import('./Layout-9EvJq4Gc.mjs');
|
|
3858
|
-
return {
|
|
3859
|
-
Component: Layout
|
|
3860
|
-
};
|
|
3861
|
-
},
|
|
3862
|
-
children: [
|
|
3863
|
-
{
|
|
3864
|
-
path: "application-infos",
|
|
3865
|
-
lazy: async () => {
|
|
3866
|
-
const { ApplicationInfoPage } = await import('./ApplicationInfoPage-bfXW7lrq.mjs');
|
|
3867
|
-
return {
|
|
3868
|
-
Component: ApplicationInfoPage
|
|
3869
|
-
};
|
|
3870
|
-
}
|
|
3871
|
-
},
|
|
3872
|
-
...Object.values(this.settings).flatMap(
|
|
3873
|
-
({ links }) => links.map(({ to, Component }) => ({
|
|
3874
|
-
path: `${to}/*`,
|
|
3875
|
-
element: /* @__PURE__ */ jsx(React.Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Component, {}) })
|
|
3876
|
-
}))
|
|
3877
|
-
),
|
|
3878
|
-
...settingsRoutes
|
|
3879
|
-
]
|
|
3880
|
-
},
|
|
3881
|
-
...this.menu.map(({ to, Component }) => ({
|
|
3882
|
-
path: `${to}/*`,
|
|
3883
|
-
element: /* @__PURE__ */ jsx(React.Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Component, {}) })
|
|
3884
|
-
})),
|
|
3885
|
-
{
|
|
3886
|
-
path: "*",
|
|
3887
|
-
element: /* @__PURE__ */ jsx(NotFoundPage, {})
|
|
3888
|
-
}
|
|
3889
|
-
]
|
|
3890
|
-
}
|
|
3891
|
-
]
|
|
3892
|
-
}
|
|
3893
|
-
],
|
|
3894
|
-
{
|
|
3895
|
-
basename: getBasename()
|
|
3896
|
-
}
|
|
3897
|
-
);
|
|
4053
|
+
const router = this.router.createRouter(this, {
|
|
4054
|
+
basename: getBasename()
|
|
4055
|
+
});
|
|
3898
4056
|
return /* @__PURE__ */ jsx(RouterProvider, { router });
|
|
3899
4057
|
}
|
|
3900
4058
|
}
|
|
@@ -3956,7 +4114,7 @@ const renderAdmin = async (mountNode, { plugins, customisations, features }) =>
|
|
|
3956
4114
|
config: customisations?.config,
|
|
3957
4115
|
appPlugins: plugins
|
|
3958
4116
|
});
|
|
3959
|
-
await app.register();
|
|
4117
|
+
await app.register(customisations?.register);
|
|
3960
4118
|
await app.bootstrap(customisations?.bootstrap);
|
|
3961
4119
|
await app.loadTrads(customisations?.config?.translations);
|
|
3962
4120
|
createRoot(mountNode).render(app.render());
|
|
@@ -4684,18 +4842,28 @@ const Root$1 = React.forwardRef(
|
|
|
4684
4842
|
onPageSizeChange(pageSize);
|
|
4685
4843
|
}
|
|
4686
4844
|
};
|
|
4687
|
-
return /* @__PURE__ */ jsx(
|
|
4688
|
-
|
|
4845
|
+
return /* @__PURE__ */ jsx(
|
|
4846
|
+
Flex,
|
|
4689
4847
|
{
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4848
|
+
ref: forwardedRef,
|
|
4849
|
+
paddingTop: 4,
|
|
4850
|
+
paddingBottom: 4,
|
|
4851
|
+
alignItems: "flex-end",
|
|
4852
|
+
justifyContent: "space-between",
|
|
4853
|
+
children: /* @__PURE__ */ jsx(
|
|
4854
|
+
PaginationProvider,
|
|
4855
|
+
{
|
|
4856
|
+
currentQuery: query,
|
|
4857
|
+
page: query.page,
|
|
4858
|
+
pageSize: query.pageSize,
|
|
4859
|
+
pageCount: pageCount.toString(),
|
|
4860
|
+
setPageSize,
|
|
4861
|
+
total,
|
|
4862
|
+
children
|
|
4863
|
+
}
|
|
4864
|
+
)
|
|
4697
4865
|
}
|
|
4698
|
-
)
|
|
4866
|
+
);
|
|
4699
4867
|
}
|
|
4700
4868
|
);
|
|
4701
4869
|
const PageSize = ({ options = ["10", "20", "50", "100"] }) => {
|
|
@@ -5303,4 +5471,4 @@ const {
|
|
|
5303
5471
|
const useAdminUsers = useGetUsersQuery;
|
|
5304
5472
|
|
|
5305
5473
|
export { isObject as A, BackButton as B, ConfirmDialog as C, useInjectReducer as D, useFocusInputField as E, Form as F, renderAdmin as G, DescriptionComponentRenderer as H, Blocker as I, getYupValidationErrors as J, useTable as K, LayoutContent as L, MemoizedInputRenderer as M, NpsSurvey as N, constants as O, Pagination as P, SearchInput as S, Table as T, UnauthenticatedLayout as U, Logo as a, Layouts as b, useGetRolesQuery as c, Login as d, errorsTrads as e, useGetRolePermissionLayoutQuery as f, useGetRolePermissionsQuery as g, useCreateRoleMutation as h, useUpdateRolePermissionsMutation as i, useUpdateUserMutation as j, useAdminUsers as k, useGuidedTour as l, getBasename as m, Column as n, useQueryParams as o, useFetchClient as p, useUpdateRoleMutation as q, SETTINGS_LINKS_CE as r, useCreateUserMutation as s, useDeleteManyUsersMutation as t, useField as u, Filters as v, useClipboard as w, useForm as x, MemoizedStringInput as y, StrapiLogo as z };
|
|
5306
|
-
//# sourceMappingURL=index-
|
|
5474
|
+
//# sourceMappingURL=index-wHs6nj5s.mjs.map
|