@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
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
const client = require('react-dom/client');
|
|
4
4
|
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
const React = require('react');
|
|
6
5
|
const designSystem = require('@strapi/design-system');
|
|
7
6
|
const invariant = require('invariant');
|
|
8
7
|
const isFunction = require('lodash/isFunction');
|
|
9
8
|
const merge = require('lodash/merge');
|
|
10
9
|
const pick = require('lodash/pick');
|
|
11
|
-
const reactRedux = require('react-redux');
|
|
12
10
|
const reactRouterDom = require('react-router-dom');
|
|
13
|
-
const
|
|
11
|
+
const Theme = require('./Theme-QO8ntQqL.js');
|
|
12
|
+
const reactRedux = require('react-redux');
|
|
13
|
+
const React = require('react');
|
|
14
14
|
const reactQuery = require('react-query');
|
|
15
15
|
const icons = require('@strapi/icons');
|
|
16
16
|
const immer = require('immer');
|
|
@@ -18,18 +18,19 @@ const reactIntl = require('react-intl');
|
|
|
18
18
|
const get = require('lodash/get');
|
|
19
19
|
const set = require('lodash/set');
|
|
20
20
|
const styledComponents = require('styled-components');
|
|
21
|
-
const
|
|
22
|
-
const admin = require('./admin-p0djr5G6.js');
|
|
21
|
+
const symbols = require('@strapi/icons/symbols');
|
|
23
22
|
const useEnterprise = require('./useEnterprise-DUs6BYlP.js');
|
|
23
|
+
const admin = require('./admin-p0djr5G6.js');
|
|
24
24
|
const camelCase = require('lodash/camelCase');
|
|
25
25
|
const yup = require('yup');
|
|
26
26
|
const fractionalIndexing = require('fractional-indexing');
|
|
27
27
|
const isEqual = require('lodash/isEqual');
|
|
28
28
|
const clone = require('lodash/clone');
|
|
29
29
|
const toPath = require('lodash/toPath');
|
|
30
|
+
const date = require('@internationalized/date');
|
|
30
31
|
const omit = require('lodash/omit');
|
|
31
32
|
const formik = require('formik');
|
|
32
|
-
const
|
|
33
|
+
const toolkit = require('@reduxjs/toolkit');
|
|
33
34
|
const throttle = require('lodash/throttle');
|
|
34
35
|
const qs = require('qs');
|
|
35
36
|
|
|
@@ -53,11 +54,11 @@ function _interopNamespace(e) {
|
|
|
53
54
|
return Object.freeze(n);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
const React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
57
57
|
const invariant__default = /*#__PURE__*/_interopDefault(invariant);
|
|
58
58
|
const isFunction__default = /*#__PURE__*/_interopDefault(isFunction);
|
|
59
59
|
const merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
60
60
|
const pick__default = /*#__PURE__*/_interopDefault(pick);
|
|
61
|
+
const React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
61
62
|
const get__default = /*#__PURE__*/_interopDefault(get);
|
|
62
63
|
const set__default = /*#__PURE__*/_interopDefault(set);
|
|
63
64
|
const camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
|
|
@@ -103,7 +104,7 @@ const getEERoutes$1 = () => window.strapi.isEE ? [
|
|
|
103
104
|
{
|
|
104
105
|
path: "auth/login/:authResponse",
|
|
105
106
|
lazy: async () => {
|
|
106
|
-
const { AuthResponse } = await Promise.resolve().then(() => require('./AuthResponse-
|
|
107
|
+
const { AuthResponse } = await Promise.resolve().then(() => require('./AuthResponse-PxLid1A-.js'));
|
|
107
108
|
return {
|
|
108
109
|
Component: AuthResponse
|
|
109
110
|
};
|
|
@@ -138,376 +139,650 @@ const constants = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
|
|
|
138
139
|
getEERoutes: getEERoutes$1
|
|
139
140
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
140
141
|
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
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";
|
|
143
|
+
|
|
144
|
+
const ADMIN_PERMISSIONS_CE = {
|
|
145
|
+
contentManager: {
|
|
146
|
+
main: [],
|
|
147
|
+
collectionTypesConfigurations: [
|
|
148
|
+
{
|
|
149
|
+
action: "plugin::content-manager.collection-types.configure-view",
|
|
150
|
+
subject: null
|
|
150
151
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
lazy: async () => {
|
|
157
|
-
const { ProtectedSSO } = await Promise.resolve().then(() => require('./SingleSignOnPage-_l9MyJvN.js'));
|
|
158
|
-
return {
|
|
159
|
-
Component: ProtectedSSO
|
|
160
|
-
};
|
|
152
|
+
],
|
|
153
|
+
componentsConfigurations: [
|
|
154
|
+
{
|
|
155
|
+
action: "plugin::content-manager.components.configure-layout",
|
|
156
|
+
subject: null
|
|
161
157
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
history: [],
|
|
168
|
-
currentLocationIndex: 0,
|
|
169
|
-
currentLocation: "",
|
|
170
|
-
canGoBack: false,
|
|
171
|
-
pushState: () => {
|
|
172
|
-
throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
|
|
173
|
-
},
|
|
174
|
-
goBack: () => {
|
|
175
|
-
throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
const HistoryProvider = ({ children }) => {
|
|
179
|
-
const location = reactRouterDom.useLocation();
|
|
180
|
-
const navigate = reactRouterDom.useNavigate();
|
|
181
|
-
const [state, dispatch] = React__namespace.useReducer(reducer$2, {
|
|
182
|
-
history: [],
|
|
183
|
-
currentLocationIndex: 0,
|
|
184
|
-
currentLocation: "",
|
|
185
|
-
canGoBack: false
|
|
186
|
-
});
|
|
187
|
-
const isGoingBack = React__namespace.useRef(false);
|
|
188
|
-
const pushState = React__namespace.useCallback((path) => {
|
|
189
|
-
dispatch({
|
|
190
|
-
type: "PUSH_STATE",
|
|
191
|
-
payload: typeof path === "string" ? { to: path, search: "" } : path
|
|
192
|
-
});
|
|
193
|
-
}, []);
|
|
194
|
-
const goBack = React__namespace.useCallback(() => {
|
|
195
|
-
navigate(-1);
|
|
196
|
-
dispatch({ type: "GO_BACK" });
|
|
197
|
-
isGoingBack.current = true;
|
|
198
|
-
}, [navigate]);
|
|
199
|
-
const prevIndex = React__namespace.useRef(state.currentLocationIndex);
|
|
200
|
-
React__namespace.useEffect(() => {
|
|
201
|
-
if (state.currentLocationIndex !== prevIndex.current) {
|
|
202
|
-
dispatch({
|
|
203
|
-
type: "SET_CAN_GO_BACK",
|
|
204
|
-
payload: state.currentLocationIndex > 1 && state.history.length > 1
|
|
205
|
-
});
|
|
206
|
-
prevIndex.current = state.currentLocationIndex;
|
|
207
|
-
}
|
|
208
|
-
}, [prevIndex, state.currentLocationIndex, state.history.length]);
|
|
209
|
-
React__namespace.useLayoutEffect(() => {
|
|
210
|
-
if (isGoingBack.current) {
|
|
211
|
-
isGoingBack.current = false;
|
|
212
|
-
} else {
|
|
213
|
-
dispatch({
|
|
214
|
-
type: "PUSH_STATE",
|
|
215
|
-
payload: { to: location.pathname, search: location.search }
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}, [dispatch, location.pathname, location.search]);
|
|
219
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Provider, { pushState, goBack, ...state, children });
|
|
220
|
-
};
|
|
221
|
-
const reducer$2 = (state, action) => immer.produce(state, (draft) => {
|
|
222
|
-
switch (action.type) {
|
|
223
|
-
case "PUSH_STATE": {
|
|
224
|
-
const path = `${action.payload.to}${action.payload.search}`;
|
|
225
|
-
if (state.currentLocationIndex === state.history.length) {
|
|
226
|
-
draft.history = [...state.history, path];
|
|
227
|
-
} else {
|
|
228
|
-
draft.history = [...state.history.slice(0, state.currentLocationIndex), path];
|
|
158
|
+
],
|
|
159
|
+
singleTypesConfigurations: [
|
|
160
|
+
{
|
|
161
|
+
action: "plugin::content-manager.single-types.configure-view",
|
|
162
|
+
subject: null
|
|
229
163
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
marketplace: {
|
|
167
|
+
main: [{ action: "admin::marketplace.read", subject: null }],
|
|
168
|
+
read: [{ action: "admin::marketplace.read", subject: null }]
|
|
169
|
+
},
|
|
170
|
+
settings: {
|
|
171
|
+
roles: {
|
|
172
|
+
main: [
|
|
173
|
+
{ action: "admin::roles.create", subject: null },
|
|
174
|
+
{ action: "admin::roles.update", subject: null },
|
|
175
|
+
{ action: "admin::roles.read", subject: null },
|
|
176
|
+
{ action: "admin::roles.delete", subject: null }
|
|
177
|
+
],
|
|
178
|
+
create: [{ action: "admin::roles.create", subject: null }],
|
|
179
|
+
delete: [{ action: "admin::roles.delete", subject: null }],
|
|
180
|
+
read: [{ action: "admin::roles.read", subject: null }],
|
|
181
|
+
update: [{ action: "admin::roles.update", subject: null }]
|
|
182
|
+
},
|
|
183
|
+
users: {
|
|
184
|
+
main: [
|
|
185
|
+
{ action: "admin::users.create", subject: null },
|
|
186
|
+
{ action: "admin::users.read", subject: null },
|
|
187
|
+
{ action: "admin::users.update", subject: null },
|
|
188
|
+
{ action: "admin::users.delete", subject: null }
|
|
189
|
+
],
|
|
190
|
+
create: [{ action: "admin::users.create", subject: null }],
|
|
191
|
+
delete: [{ action: "admin::users.delete", subject: null }],
|
|
192
|
+
read: [{ action: "admin::users.read", subject: null }],
|
|
193
|
+
update: [{ action: "admin::users.update", subject: null }]
|
|
194
|
+
},
|
|
195
|
+
webhooks: {
|
|
196
|
+
main: [
|
|
197
|
+
{ action: "admin::webhooks.create", subject: null },
|
|
198
|
+
{ action: "admin::webhooks.read", subject: null },
|
|
199
|
+
{ action: "admin::webhooks.update", subject: null },
|
|
200
|
+
{ action: "admin::webhooks.delete", subject: null }
|
|
201
|
+
],
|
|
202
|
+
create: [{ action: "admin::webhooks.create", subject: null }],
|
|
203
|
+
delete: [{ action: "admin::webhooks.delete", subject: null }],
|
|
204
|
+
read: [
|
|
205
|
+
{ action: "admin::webhooks.read", subject: null },
|
|
206
|
+
// NOTE: We need to check with the API
|
|
207
|
+
{ action: "admin::webhooks.update", subject: null },
|
|
208
|
+
{ action: "admin::webhooks.delete", subject: null }
|
|
209
|
+
],
|
|
210
|
+
update: [{ action: "admin::webhooks.update", subject: null }]
|
|
211
|
+
},
|
|
212
|
+
"api-tokens": {
|
|
213
|
+
main: [{ action: "admin::api-tokens.access", subject: null }],
|
|
214
|
+
create: [{ action: "admin::api-tokens.create", subject: null }],
|
|
215
|
+
delete: [{ action: "admin::api-tokens.delete", subject: null }],
|
|
216
|
+
read: [{ action: "admin::api-tokens.read", subject: null }],
|
|
217
|
+
update: [{ action: "admin::api-tokens.update", subject: null }],
|
|
218
|
+
regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
|
|
219
|
+
},
|
|
220
|
+
"transfer-tokens": {
|
|
221
|
+
main: [{ action: "admin::transfer.tokens.access", subject: null }],
|
|
222
|
+
create: [{ action: "admin::transfer.tokens.create", subject: null }],
|
|
223
|
+
delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
|
|
224
|
+
read: [{ action: "admin::transfer.tokens.read", subject: null }],
|
|
225
|
+
update: [{ action: "admin::transfer.tokens.update", subject: null }],
|
|
226
|
+
regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
|
|
227
|
+
},
|
|
228
|
+
"project-settings": {
|
|
229
|
+
read: [{ action: "admin::project-settings.read", subject: null }],
|
|
230
|
+
update: [{ action: "admin::project-settings.update", subject: null }]
|
|
243
231
|
}
|
|
244
232
|
}
|
|
245
|
-
}
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
233
|
+
};
|
|
234
|
+
const HOOKS = {
|
|
235
|
+
/**
|
|
236
|
+
* Hook that allows to mutate the displayed headers of the list view table
|
|
237
|
+
* @constant
|
|
238
|
+
* @type {string}
|
|
239
|
+
*/
|
|
240
|
+
INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
|
|
241
|
+
/**
|
|
242
|
+
* Hook that allows to mutate the CM's collection types links pre-set filters
|
|
243
|
+
* @constant
|
|
244
|
+
* @type {string}
|
|
245
|
+
*/
|
|
246
|
+
MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
|
|
247
|
+
/**
|
|
248
|
+
* Hook that allows to mutate the CM's edit view layout
|
|
249
|
+
* @constant
|
|
250
|
+
* @type {string}
|
|
251
|
+
*/
|
|
252
|
+
MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
|
|
253
|
+
/**
|
|
254
|
+
* Hook that allows to mutate the CM's single types links pre-set filters
|
|
255
|
+
* @constant
|
|
256
|
+
* @type {string}
|
|
257
|
+
*/
|
|
258
|
+
MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
|
|
259
|
+
};
|
|
260
|
+
const SETTINGS_LINKS_CE = () => ({
|
|
261
|
+
global: [
|
|
257
262
|
{
|
|
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
|
-
|
|
284
|
-
|
|
285
|
-
const previousSteps = sectionArray.slice(0, currentStepIndex);
|
|
286
|
-
const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
|
|
287
|
-
if (isStepAlreadyDone || isSkipped || !isStepToShow) {
|
|
288
|
-
return null;
|
|
263
|
+
intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
|
|
264
|
+
to: "/settings/application-infos",
|
|
265
|
+
id: "000-application-infos"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
|
|
269
|
+
to: "/settings/webhooks",
|
|
270
|
+
id: "webhooks"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
|
|
274
|
+
to: "/settings/api-tokens?sort=name:ASC",
|
|
275
|
+
id: "api-tokens"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
|
|
279
|
+
to: "/settings/transfer-tokens?sort=name:ASC",
|
|
280
|
+
id: "transfer-tokens"
|
|
281
|
+
},
|
|
282
|
+
// 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.
|
|
283
|
+
// Disable this by adding "promoteEE: false" to your `./config/admin.js` file
|
|
284
|
+
...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
|
|
285
|
+
{
|
|
286
|
+
intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
|
|
287
|
+
to: "/settings/purchase-single-sign-on",
|
|
288
|
+
id: "sso-purchase-page",
|
|
289
|
+
licenseOnly: true
|
|
289
290
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
291
|
+
] : []
|
|
292
|
+
],
|
|
293
|
+
admin: [
|
|
294
|
+
{
|
|
295
|
+
intlLabel: { id: "global.roles", defaultMessage: "Roles" },
|
|
296
|
+
to: "/settings/roles",
|
|
297
|
+
id: "roles"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
intlLabel: { id: "global.users", defaultMessage: "Users" },
|
|
301
|
+
// Init the search params directly
|
|
302
|
+
to: "/settings/users?pageSize=10&page=1&sort=firstname",
|
|
303
|
+
id: "users"
|
|
304
|
+
},
|
|
305
|
+
...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
|
|
306
|
+
{
|
|
307
|
+
intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
|
|
308
|
+
to: "/settings/purchase-audit-logs",
|
|
309
|
+
id: "auditLogs-purchase-page",
|
|
310
|
+
licenseOnly: true
|
|
311
|
+
}
|
|
312
|
+
] : []
|
|
313
|
+
]
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
const ALLOWED_TYPES = [
|
|
317
|
+
"biginteger",
|
|
318
|
+
"boolean",
|
|
319
|
+
"date",
|
|
320
|
+
"datetime",
|
|
321
|
+
"decimal",
|
|
322
|
+
"email",
|
|
323
|
+
"enumeration",
|
|
324
|
+
"float",
|
|
325
|
+
"integer",
|
|
326
|
+
"json",
|
|
327
|
+
"password",
|
|
328
|
+
"richtext",
|
|
329
|
+
"string",
|
|
330
|
+
"text",
|
|
331
|
+
"time",
|
|
332
|
+
"uid"
|
|
333
|
+
];
|
|
334
|
+
const ALLOWED_ROOT_LEVEL_OPTIONS = [
|
|
335
|
+
"min",
|
|
336
|
+
"minLength",
|
|
337
|
+
"max",
|
|
338
|
+
"maxLength",
|
|
339
|
+
"required",
|
|
340
|
+
"regex",
|
|
341
|
+
"enum",
|
|
342
|
+
"unique",
|
|
343
|
+
"private",
|
|
344
|
+
"default"
|
|
345
|
+
];
|
|
346
|
+
class CustomFields {
|
|
347
|
+
customFields;
|
|
348
|
+
constructor() {
|
|
349
|
+
this.customFields = {};
|
|
350
|
+
}
|
|
351
|
+
register = (customFields) => {
|
|
352
|
+
if (Array.isArray(customFields)) {
|
|
353
|
+
customFields.forEach((customField) => {
|
|
354
|
+
this.register(customField);
|
|
355
|
+
});
|
|
356
|
+
} else {
|
|
357
|
+
const { name, pluginId, type, intlLabel, intlDescription, components, options } = customFields;
|
|
358
|
+
invariant__default.default(name, "A name must be provided");
|
|
359
|
+
invariant__default.default(type, "A type must be provided");
|
|
360
|
+
invariant__default.default(intlLabel, "An intlLabel must be provided");
|
|
361
|
+
invariant__default.default(intlDescription, "An intlDescription must be provided");
|
|
362
|
+
invariant__default.default(components, "A components object must be provided");
|
|
363
|
+
invariant__default.default(components.Input, "An Input component must be provided");
|
|
364
|
+
invariant__default.default(
|
|
365
|
+
ALLOWED_TYPES.includes(type),
|
|
366
|
+
`Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
|
|
319
367
|
);
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
368
|
+
const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
|
|
369
|
+
invariant__default.default(
|
|
370
|
+
isValidObjectKey.test(name),
|
|
371
|
+
`Custom field name: '${name}' is not a valid object key`
|
|
372
|
+
);
|
|
373
|
+
const allFormOptions = [...options?.base || [], ...options?.advanced || []];
|
|
374
|
+
if (allFormOptions.length) {
|
|
375
|
+
const optionPathValidations = allFormOptions.reduce(optionsValidationReducer, []);
|
|
376
|
+
optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
|
|
377
|
+
invariant__default.default(isValidOptionPath, errorMessage);
|
|
378
|
+
});
|
|
324
379
|
}
|
|
380
|
+
const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
|
|
381
|
+
const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
|
|
382
|
+
invariant__default.default(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
|
|
383
|
+
this.customFields[uid] = customFields;
|
|
325
384
|
}
|
|
326
385
|
};
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
dispatch({
|
|
330
|
-
type: "SET_SKIPPED",
|
|
331
|
-
value
|
|
332
|
-
});
|
|
386
|
+
getAll = () => {
|
|
387
|
+
return this.customFields;
|
|
333
388
|
};
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
setSkipped,
|
|
342
|
-
setStepState,
|
|
343
|
-
startSection,
|
|
344
|
-
isGuidedTourVisible,
|
|
345
|
-
isSkipped,
|
|
346
|
-
children
|
|
347
|
-
}
|
|
348
|
-
);
|
|
349
|
-
};
|
|
350
|
-
const initialState = {
|
|
351
|
-
currentStep: null,
|
|
352
|
-
guidedTourState: {
|
|
353
|
-
contentTypeBuilder: {
|
|
354
|
-
create: false,
|
|
355
|
-
success: false
|
|
356
|
-
},
|
|
357
|
-
contentManager: {
|
|
358
|
-
create: false,
|
|
359
|
-
success: false
|
|
360
|
-
},
|
|
361
|
-
apiTokens: {
|
|
362
|
-
create: false,
|
|
363
|
-
success: false
|
|
364
|
-
},
|
|
365
|
-
transferTokens: {
|
|
366
|
-
create: false,
|
|
367
|
-
success: false
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
isGuidedTourVisible: false,
|
|
371
|
-
isSkipped: false
|
|
372
|
-
};
|
|
373
|
-
const reducer$1 = (state = initialState, action) => immer.produce(state, (draftState) => {
|
|
374
|
-
switch (action.type) {
|
|
375
|
-
case "SET_CURRENT_STEP": {
|
|
376
|
-
draftState.currentStep = action.step;
|
|
377
|
-
break;
|
|
378
|
-
}
|
|
379
|
-
case "SET_STEP_STATE": {
|
|
380
|
-
const [section, step] = action.currentStep.split(".");
|
|
381
|
-
draftState.guidedTourState[section][step] = action.value;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
case "SET_SKIPPED": {
|
|
385
|
-
draftState.isSkipped = action.value;
|
|
386
|
-
break;
|
|
387
|
-
}
|
|
388
|
-
case "SET_GUIDED_TOUR_VISIBILITY": {
|
|
389
|
-
draftState.isGuidedTourVisible = action.value;
|
|
390
|
-
break;
|
|
391
|
-
}
|
|
392
|
-
default: {
|
|
393
|
-
return draftState;
|
|
394
|
-
}
|
|
389
|
+
get = (uid) => {
|
|
390
|
+
return this.customFields[uid];
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
const optionsValidationReducer = (acc, option) => {
|
|
394
|
+
if ("items" in option) {
|
|
395
|
+
return option.items.reduce(optionsValidationReducer, acc);
|
|
395
396
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
const skippedLocaleStorage = JSON.parse(
|
|
406
|
-
window.localStorage.getItem(GUIDED_TOUR_SKIPPED) ?? "false"
|
|
407
|
-
);
|
|
408
|
-
if (Array.isArray(guidedTourLocaleStorage)) {
|
|
409
|
-
guidedTourLocaleStorage.forEach((step) => {
|
|
410
|
-
const [sectionName, stepName] = step.split(".");
|
|
411
|
-
set__default.default(copyInitialState, ["guidedTourState", sectionName, stepName], true);
|
|
397
|
+
if (!option.name) {
|
|
398
|
+
acc.push({
|
|
399
|
+
isValidOptionPath: false,
|
|
400
|
+
errorMessage: "The 'name' property is required on an options object"
|
|
401
|
+
});
|
|
402
|
+
} else {
|
|
403
|
+
acc.push({
|
|
404
|
+
isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
|
|
405
|
+
errorMessage: `'${option.name}' must be prefixed with 'options.'`
|
|
412
406
|
});
|
|
413
407
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
408
|
+
return acc;
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
class Plugin {
|
|
412
|
+
apis;
|
|
413
|
+
initializer;
|
|
414
|
+
injectionZones;
|
|
415
|
+
isReady;
|
|
416
|
+
name;
|
|
417
|
+
pluginId;
|
|
418
|
+
constructor(pluginConf) {
|
|
419
|
+
this.apis = pluginConf.apis || {};
|
|
420
|
+
this.initializer = pluginConf.initializer || null;
|
|
421
|
+
this.injectionZones = pluginConf.injectionZones || {};
|
|
422
|
+
this.isReady = pluginConf.isReady !== void 0 ? pluginConf.isReady : true;
|
|
423
|
+
this.name = pluginConf.name;
|
|
424
|
+
this.pluginId = pluginConf.id;
|
|
419
425
|
}
|
|
420
|
-
|
|
421
|
-
|
|
426
|
+
getInjectedComponents(containerName, blockName) {
|
|
427
|
+
try {
|
|
428
|
+
return this.injectionZones[containerName][blockName] || [];
|
|
429
|
+
} catch (err) {
|
|
430
|
+
console.error("Cannot get injected component", err);
|
|
431
|
+
return [];
|
|
432
|
+
}
|
|
422
433
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
434
|
+
injectComponent(containerName, blockName, component) {
|
|
435
|
+
try {
|
|
436
|
+
this.injectionZones[containerName][blockName].push(component);
|
|
437
|
+
} catch (err) {
|
|
438
|
+
console.error("Cannot inject component", err);
|
|
439
|
+
}
|
|
429
440
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const [Provider, useHistory] = Theme.createContext("History", {
|
|
444
|
+
history: [],
|
|
445
|
+
currentLocationIndex: 0,
|
|
446
|
+
currentLocation: "",
|
|
447
|
+
canGoBack: false,
|
|
448
|
+
pushState: () => {
|
|
449
|
+
throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
|
|
450
|
+
},
|
|
451
|
+
goBack: () => {
|
|
452
|
+
throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
|
|
433
453
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
);
|
|
454
|
+
});
|
|
455
|
+
const HistoryProvider = ({ children }) => {
|
|
456
|
+
const location = reactRouterDom.useLocation();
|
|
457
|
+
const navigate = reactRouterDom.useNavigate();
|
|
458
|
+
const [state, dispatch] = React__namespace.useReducer(reducer$2, {
|
|
459
|
+
history: [],
|
|
460
|
+
currentLocationIndex: 0,
|
|
461
|
+
currentLocation: "",
|
|
462
|
+
canGoBack: false
|
|
463
|
+
});
|
|
464
|
+
const isGoingBack = React__namespace.useRef(false);
|
|
465
|
+
const pushState = React__namespace.useCallback((path) => {
|
|
466
|
+
dispatch({
|
|
467
|
+
type: "PUSH_STATE",
|
|
468
|
+
payload: typeof path === "string" ? { to: path, search: "" } : path
|
|
469
|
+
});
|
|
470
|
+
}, []);
|
|
471
|
+
const goBack = React__namespace.useCallback(() => {
|
|
472
|
+
navigate(-1);
|
|
473
|
+
dispatch({ type: "GO_BACK" });
|
|
474
|
+
isGoingBack.current = true;
|
|
475
|
+
}, [navigate]);
|
|
476
|
+
const prevIndex = React__namespace.useRef(state.currentLocationIndex);
|
|
477
|
+
React__namespace.useEffect(() => {
|
|
478
|
+
if (state.currentLocationIndex !== prevIndex.current) {
|
|
479
|
+
dispatch({
|
|
480
|
+
type: "SET_CAN_GO_BACK",
|
|
481
|
+
payload: state.currentLocationIndex > 1 && state.history.length > 1
|
|
482
|
+
});
|
|
483
|
+
prevIndex.current = state.currentLocationIndex;
|
|
484
|
+
}
|
|
485
|
+
}, [prevIndex, state.currentLocationIndex, state.history.length]);
|
|
486
|
+
React__namespace.useLayoutEffect(() => {
|
|
487
|
+
if (isGoingBack.current) {
|
|
488
|
+
isGoingBack.current = false;
|
|
489
|
+
} else {
|
|
490
|
+
dispatch({
|
|
491
|
+
type: "PUSH_STATE",
|
|
492
|
+
payload: { to: location.pathname, search: location.search }
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
}, [dispatch, location.pathname, location.search]);
|
|
496
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Provider, { pushState, goBack, ...state, children });
|
|
438
497
|
};
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
498
|
+
const reducer$2 = (state, action) => immer.produce(state, (draft) => {
|
|
499
|
+
switch (action.type) {
|
|
500
|
+
case "PUSH_STATE": {
|
|
501
|
+
const path = `${action.payload.to}${action.payload.search}`;
|
|
502
|
+
if (state.currentLocationIndex === state.history.length) {
|
|
503
|
+
draft.history = [...state.history, path];
|
|
504
|
+
} else {
|
|
505
|
+
draft.history = [...state.history.slice(0, state.currentLocationIndex), path];
|
|
506
|
+
}
|
|
507
|
+
draft.currentLocation = path;
|
|
508
|
+
draft.currentLocationIndex += 1;
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
case "GO_BACK": {
|
|
512
|
+
const newIndex = state.currentLocationIndex - 1;
|
|
513
|
+
draft.currentLocation = state.history[newIndex - 1];
|
|
514
|
+
draft.currentLocationIndex = newIndex;
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
517
|
+
case "SET_CAN_GO_BACK": {
|
|
518
|
+
draft.canGoBack = action.payload;
|
|
519
|
+
break;
|
|
444
520
|
}
|
|
445
521
|
}
|
|
446
522
|
});
|
|
447
|
-
const
|
|
523
|
+
const BackButton = React__namespace.forwardRef(({ disabled }, ref) => {
|
|
524
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
525
|
+
const canGoBack = useHistory("BackButton", (state) => state.canGoBack);
|
|
526
|
+
const goBack = useHistory("BackButton", (state) => state.goBack);
|
|
527
|
+
const history = useHistory("BackButton", (state) => state.history);
|
|
528
|
+
const handleClick = (e) => {
|
|
529
|
+
e.preventDefault();
|
|
530
|
+
goBack();
|
|
531
|
+
};
|
|
448
532
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
449
|
-
|
|
533
|
+
designSystem.Link,
|
|
450
534
|
{
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
settings: strapi.settings,
|
|
463
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactRedux.Provider, { store, children: /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(rbac.AuthProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(HistoryProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(rbac.LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsxRuntime.jsx(rbac.Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsxRuntime.jsx(rbac.NotificationsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(rbac.TrackingProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(GuidedTourProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
464
|
-
rbac.ConfigurationProvider,
|
|
465
|
-
{
|
|
466
|
-
defaultAuthLogo: strapi.configurations.authLogo,
|
|
467
|
-
defaultMenuLogo: strapi.configurations.menuLogo,
|
|
468
|
-
showTutorials: strapi.configurations.tutorials,
|
|
469
|
-
showReleaseNotification: strapi.configurations.notifications.releases,
|
|
470
|
-
children
|
|
471
|
-
}
|
|
472
|
-
) }) }) }) }) }) }) }) }) })
|
|
535
|
+
ref,
|
|
536
|
+
tag: reactRouterDom.NavLink,
|
|
537
|
+
to: history.at(-1) ?? "",
|
|
538
|
+
onClick: handleClick,
|
|
539
|
+
disabled: disabled || !canGoBack,
|
|
540
|
+
"aria-disabled": disabled || !canGoBack,
|
|
541
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeft, {}),
|
|
542
|
+
children: formatMessage({
|
|
543
|
+
id: "global.back",
|
|
544
|
+
defaultMessage: "Back"
|
|
545
|
+
})
|
|
473
546
|
}
|
|
474
547
|
);
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
const App = ({ strapi, store }) => {
|
|
478
|
-
React.useEffect(() => {
|
|
479
|
-
const language = localStorage.getItem(rbac.LANGUAGE_LOCAL_STORAGE_KEY) || "en";
|
|
480
|
-
if (language) {
|
|
481
|
-
document.documentElement.lang = language;
|
|
482
|
-
}
|
|
483
|
-
}, []);
|
|
484
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Providers, { strapi, store, children: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(rbac.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {}) }) });
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
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";
|
|
548
|
+
});
|
|
488
549
|
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
550
|
+
const GUIDED_TOUR_COMPLETED_STEPS = "GUIDED_TOUR_COMPLETED_STEPS";
|
|
551
|
+
const GUIDED_TOUR_CURRENT_STEP = "GUIDED_TOUR_CURRENT_STEP";
|
|
552
|
+
const GUIDED_TOUR_SKIPPED = "GUIDED_TOUR_SKIPPED";
|
|
553
|
+
const [GuidedTourProviderImpl, useGuidedTour] = Theme.createContext("GuidedTour");
|
|
554
|
+
const GuidedTourProvider = ({ children }) => {
|
|
555
|
+
const [{ currentStep, guidedTourState, isGuidedTourVisible, isSkipped }, dispatch] = React__namespace.useReducer(reducer$1, initialState, initialiseState);
|
|
556
|
+
const setCurrentStep = (step) => {
|
|
557
|
+
if (step !== null) {
|
|
558
|
+
const isStepAlreadyDone = get__default.default(guidedTourState, step);
|
|
559
|
+
const [sectionName, stepName] = step.split(".");
|
|
560
|
+
const sectionArray = Object.entries(guidedTourState[sectionName]);
|
|
561
|
+
const currentStepIndex = sectionArray.findIndex(([key]) => key === stepName);
|
|
562
|
+
const previousSteps = sectionArray.slice(0, currentStepIndex);
|
|
563
|
+
const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
|
|
564
|
+
if (isStepAlreadyDone || isSkipped || !isStepToShow) {
|
|
565
|
+
return null;
|
|
498
566
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
567
|
+
}
|
|
568
|
+
window.localStorage.setItem(GUIDED_TOUR_CURRENT_STEP, JSON.stringify(null));
|
|
569
|
+
return dispatch({
|
|
570
|
+
type: "SET_CURRENT_STEP",
|
|
571
|
+
step
|
|
572
|
+
});
|
|
573
|
+
};
|
|
574
|
+
const setGuidedTourVisibility = (value) => {
|
|
575
|
+
dispatch({
|
|
576
|
+
type: "SET_GUIDED_TOUR_VISIBILITY",
|
|
577
|
+
value
|
|
578
|
+
});
|
|
579
|
+
};
|
|
580
|
+
const setStepState = (currentStep2, value) => {
|
|
581
|
+
addCompletedStep(currentStep2);
|
|
582
|
+
dispatch({
|
|
583
|
+
type: "SET_STEP_STATE",
|
|
584
|
+
currentStep: currentStep2,
|
|
585
|
+
value
|
|
586
|
+
});
|
|
587
|
+
};
|
|
588
|
+
const startSection = (sectionName) => {
|
|
589
|
+
const sectionSteps = guidedTourState[sectionName];
|
|
590
|
+
if (sectionSteps) {
|
|
591
|
+
const guidedTourArray = Object.entries(guidedTourState);
|
|
592
|
+
const currentSectionIndex = guidedTourArray.findIndex(([key]) => key === sectionName);
|
|
593
|
+
const previousSections = guidedTourArray.slice(0, currentSectionIndex);
|
|
594
|
+
const isSectionToShow = previousSections.every(
|
|
595
|
+
([, sectionValue]) => Object.values(sectionValue).every(Boolean)
|
|
596
|
+
);
|
|
597
|
+
const [firstStep] = Object.keys(sectionSteps);
|
|
598
|
+
const isFirstStepDone = sectionSteps[firstStep];
|
|
599
|
+
if (isSectionToShow && !currentStep && !isFirstStepDone) {
|
|
600
|
+
setCurrentStep(`${sectionName}.${firstStep}`);
|
|
505
601
|
}
|
|
506
|
-
return false;
|
|
507
602
|
}
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
603
|
+
};
|
|
604
|
+
const setSkipped = (value) => {
|
|
605
|
+
window.localStorage.setItem(GUIDED_TOUR_SKIPPED, JSON.stringify(value));
|
|
606
|
+
dispatch({
|
|
607
|
+
type: "SET_SKIPPED",
|
|
608
|
+
value
|
|
609
|
+
});
|
|
610
|
+
};
|
|
611
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
612
|
+
GuidedTourProviderImpl,
|
|
613
|
+
{
|
|
614
|
+
guidedTourState,
|
|
615
|
+
currentStep,
|
|
616
|
+
setCurrentStep,
|
|
617
|
+
setGuidedTourVisibility,
|
|
618
|
+
setSkipped,
|
|
619
|
+
setStepState,
|
|
620
|
+
startSection,
|
|
621
|
+
isGuidedTourVisible,
|
|
622
|
+
isSkipped,
|
|
623
|
+
children
|
|
624
|
+
}
|
|
625
|
+
);
|
|
626
|
+
};
|
|
627
|
+
const initialState = {
|
|
628
|
+
currentStep: null,
|
|
629
|
+
guidedTourState: {
|
|
630
|
+
contentTypeBuilder: {
|
|
631
|
+
create: false,
|
|
632
|
+
success: false
|
|
633
|
+
},
|
|
634
|
+
contentManager: {
|
|
635
|
+
create: false,
|
|
636
|
+
success: false
|
|
637
|
+
},
|
|
638
|
+
apiTokens: {
|
|
639
|
+
create: false,
|
|
640
|
+
success: false
|
|
641
|
+
},
|
|
642
|
+
transferTokens: {
|
|
643
|
+
create: false,
|
|
644
|
+
success: false
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
isGuidedTourVisible: false,
|
|
648
|
+
isSkipped: false
|
|
649
|
+
};
|
|
650
|
+
const reducer$1 = (state = initialState, action) => immer.produce(state, (draftState) => {
|
|
651
|
+
switch (action.type) {
|
|
652
|
+
case "SET_CURRENT_STEP": {
|
|
653
|
+
draftState.currentStep = action.step;
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
case "SET_STEP_STATE": {
|
|
657
|
+
const [section, step] = action.currentStep.split(".");
|
|
658
|
+
draftState.guidedTourState[section][step] = action.value;
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
case "SET_SKIPPED": {
|
|
662
|
+
draftState.isSkipped = action.value;
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
case "SET_GUIDED_TOUR_VISIBILITY": {
|
|
666
|
+
draftState.isGuidedTourVisible = action.value;
|
|
667
|
+
break;
|
|
668
|
+
}
|
|
669
|
+
default: {
|
|
670
|
+
return draftState;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
const initialiseState = (initialState2) => {
|
|
675
|
+
const copyInitialState = { ...initialState2 };
|
|
676
|
+
const guidedTourLocaleStorage = JSON.parse(
|
|
677
|
+
window.localStorage.getItem(GUIDED_TOUR_COMPLETED_STEPS) ?? "[]"
|
|
678
|
+
);
|
|
679
|
+
const currentStepLocaleStorage = JSON.parse(
|
|
680
|
+
window.localStorage.getItem(GUIDED_TOUR_CURRENT_STEP) ?? "null"
|
|
681
|
+
);
|
|
682
|
+
const skippedLocaleStorage = JSON.parse(
|
|
683
|
+
window.localStorage.getItem(GUIDED_TOUR_SKIPPED) ?? "false"
|
|
684
|
+
);
|
|
685
|
+
if (Array.isArray(guidedTourLocaleStorage)) {
|
|
686
|
+
guidedTourLocaleStorage.forEach((step) => {
|
|
687
|
+
const [sectionName, stepName] = step.split(".");
|
|
688
|
+
set__default.default(copyInitialState, ["guidedTourState", sectionName, stepName], true);
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
if (currentStepLocaleStorage) {
|
|
692
|
+
const [sectionName, stepName] = currentStepLocaleStorage.split(".");
|
|
693
|
+
set__default.default(copyInitialState, ["guidedTourState", sectionName, stepName], true);
|
|
694
|
+
addCompletedStep(currentStepLocaleStorage);
|
|
695
|
+
window.localStorage.setItem(GUIDED_TOUR_CURRENT_STEP, JSON.stringify(null));
|
|
696
|
+
}
|
|
697
|
+
if (skippedLocaleStorage !== null) {
|
|
698
|
+
set__default.default(copyInitialState, "isSkipped", skippedLocaleStorage);
|
|
699
|
+
}
|
|
700
|
+
return copyInitialState;
|
|
701
|
+
};
|
|
702
|
+
const addCompletedStep = (completedStep) => {
|
|
703
|
+
const currentSteps = JSON.parse(window.localStorage.getItem(GUIDED_TOUR_COMPLETED_STEPS) ?? "[]");
|
|
704
|
+
if (!Array.isArray(currentSteps)) {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
const isAlreadyStored = currentSteps.includes(completedStep);
|
|
708
|
+
if (isAlreadyStored) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
window.localStorage.setItem(
|
|
712
|
+
GUIDED_TOUR_COMPLETED_STEPS,
|
|
713
|
+
JSON.stringify([...currentSteps, completedStep])
|
|
714
|
+
);
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
const queryClient = new reactQuery.QueryClient({
|
|
718
|
+
defaultOptions: {
|
|
719
|
+
queries: {
|
|
720
|
+
refetchOnWindowFocus: false
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
const Providers = ({ children, strapi, store }) => {
|
|
725
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
726
|
+
Theme.StrapiAppProvider,
|
|
727
|
+
{
|
|
728
|
+
components: strapi.library.components,
|
|
729
|
+
customFields: strapi.customFields,
|
|
730
|
+
fields: strapi.library.fields,
|
|
731
|
+
menu: strapi.router.menu,
|
|
732
|
+
getAdminInjectedComponents: strapi.getAdminInjectedComponents,
|
|
733
|
+
getPlugin: strapi.getPlugin,
|
|
734
|
+
plugins: strapi.plugins,
|
|
735
|
+
rbac: strapi.rbac,
|
|
736
|
+
runHookParallel: strapi.runHookParallel,
|
|
737
|
+
runHookWaterfall: (name, initialValue) => strapi.runHookWaterfall(name, initialValue, store),
|
|
738
|
+
runHookSeries: strapi.runHookSeries,
|
|
739
|
+
settings: strapi.router.settings,
|
|
740
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactRedux.Provider, { store, children: /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(Theme.AuthProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(HistoryProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(Theme.LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsxRuntime.jsx(Theme.Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsxRuntime.jsx(Theme.NotificationsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(Theme.TrackingProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(GuidedTourProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
741
|
+
Theme.ConfigurationProvider,
|
|
742
|
+
{
|
|
743
|
+
defaultAuthLogo: strapi.configurations.authLogo,
|
|
744
|
+
defaultMenuLogo: strapi.configurations.menuLogo,
|
|
745
|
+
showTutorials: strapi.configurations.tutorials,
|
|
746
|
+
showReleaseNotification: strapi.configurations.notifications.releases,
|
|
747
|
+
children
|
|
748
|
+
}
|
|
749
|
+
) }) }) }) }) }) }) }) }) })
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
const App = ({ strapi, store }) => {
|
|
755
|
+
React.useEffect(() => {
|
|
756
|
+
const language = localStorage.getItem(Theme.LANGUAGE_LOCAL_STORAGE_KEY) || "en";
|
|
757
|
+
if (language) {
|
|
758
|
+
document.documentElement.lang = language;
|
|
759
|
+
}
|
|
760
|
+
}, []);
|
|
761
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Providers, { strapi, store, children: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(Theme.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {}) }) });
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
const useClipboard = () => {
|
|
765
|
+
const copy = React.useCallback(async (value) => {
|
|
766
|
+
try {
|
|
767
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
768
|
+
throw new Error(
|
|
769
|
+
`Cannot copy typeof ${typeof value} to clipboard, must be a string or number`
|
|
770
|
+
);
|
|
771
|
+
} else if (value === "") {
|
|
772
|
+
throw new Error(`Cannot copy empty string to clipboard.`);
|
|
773
|
+
}
|
|
774
|
+
const stringifiedValue = value.toString();
|
|
775
|
+
await navigator.clipboard.writeText(stringifiedValue);
|
|
776
|
+
return true;
|
|
777
|
+
} catch (error) {
|
|
778
|
+
if (process.env.NODE_ENV === "development") {
|
|
779
|
+
console.warn("Copy failed", error);
|
|
780
|
+
}
|
|
781
|
+
return false;
|
|
782
|
+
}
|
|
783
|
+
}, []);
|
|
784
|
+
return { copy };
|
|
785
|
+
};
|
|
511
786
|
|
|
512
787
|
const ErrorElement = () => {
|
|
513
788
|
const error = reactRouterDom.useRouteError();
|
|
@@ -587,390 +862,245 @@ const ErrorType = styledComponents.styled(designSystem.Typography)`
|
|
|
587
862
|
color: ${({ theme }) => theme.colors.danger600};
|
|
588
863
|
`;
|
|
589
864
|
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
collectionTypesConfigurations: [
|
|
594
|
-
{
|
|
595
|
-
action: "plugin::content-manager.collection-types.configure-view",
|
|
596
|
-
subject: null
|
|
597
|
-
}
|
|
598
|
-
],
|
|
599
|
-
componentsConfigurations: [
|
|
600
|
-
{
|
|
601
|
-
action: "plugin::content-manager.components.configure-layout",
|
|
602
|
-
subject: null
|
|
603
|
-
}
|
|
604
|
-
],
|
|
605
|
-
singleTypesConfigurations: [
|
|
606
|
-
{
|
|
607
|
-
action: "plugin::content-manager.single-types.configure-view",
|
|
608
|
-
subject: null
|
|
609
|
-
}
|
|
610
|
-
]
|
|
611
|
-
},
|
|
612
|
-
marketplace: {
|
|
613
|
-
main: [{ action: "admin::marketplace.read", subject: null }],
|
|
614
|
-
read: [{ action: "admin::marketplace.read", subject: null }]
|
|
615
|
-
},
|
|
616
|
-
settings: {
|
|
617
|
-
roles: {
|
|
618
|
-
main: [
|
|
619
|
-
{ action: "admin::roles.create", subject: null },
|
|
620
|
-
{ action: "admin::roles.update", subject: null },
|
|
621
|
-
{ action: "admin::roles.read", subject: null },
|
|
622
|
-
{ action: "admin::roles.delete", subject: null }
|
|
623
|
-
],
|
|
624
|
-
create: [{ action: "admin::roles.create", subject: null }],
|
|
625
|
-
delete: [{ action: "admin::roles.delete", subject: null }],
|
|
626
|
-
read: [{ action: "admin::roles.read", subject: null }],
|
|
627
|
-
update: [{ action: "admin::roles.update", subject: null }]
|
|
628
|
-
},
|
|
629
|
-
users: {
|
|
630
|
-
main: [
|
|
631
|
-
{ action: "admin::users.create", subject: null },
|
|
632
|
-
{ action: "admin::users.read", subject: null },
|
|
633
|
-
{ action: "admin::users.update", subject: null },
|
|
634
|
-
{ action: "admin::users.delete", subject: null }
|
|
635
|
-
],
|
|
636
|
-
create: [{ action: "admin::users.create", subject: null }],
|
|
637
|
-
delete: [{ action: "admin::users.delete", subject: null }],
|
|
638
|
-
read: [{ action: "admin::users.read", subject: null }],
|
|
639
|
-
update: [{ action: "admin::users.update", subject: null }]
|
|
640
|
-
},
|
|
641
|
-
webhooks: {
|
|
642
|
-
main: [
|
|
643
|
-
{ action: "admin::webhooks.create", subject: null },
|
|
644
|
-
{ action: "admin::webhooks.read", subject: null },
|
|
645
|
-
{ action: "admin::webhooks.update", subject: null },
|
|
646
|
-
{ action: "admin::webhooks.delete", subject: null }
|
|
647
|
-
],
|
|
648
|
-
create: [{ action: "admin::webhooks.create", subject: null }],
|
|
649
|
-
delete: [{ action: "admin::webhooks.delete", subject: null }],
|
|
650
|
-
read: [
|
|
651
|
-
{ action: "admin::webhooks.read", subject: null },
|
|
652
|
-
// NOTE: We need to check with the API
|
|
653
|
-
{ action: "admin::webhooks.update", subject: null },
|
|
654
|
-
{ action: "admin::webhooks.delete", subject: null }
|
|
655
|
-
],
|
|
656
|
-
update: [{ action: "admin::webhooks.update", subject: null }]
|
|
657
|
-
},
|
|
658
|
-
"api-tokens": {
|
|
659
|
-
main: [{ action: "admin::api-tokens.access", subject: null }],
|
|
660
|
-
create: [{ action: "admin::api-tokens.create", subject: null }],
|
|
661
|
-
delete: [{ action: "admin::api-tokens.delete", subject: null }],
|
|
662
|
-
read: [{ action: "admin::api-tokens.read", subject: null }],
|
|
663
|
-
update: [{ action: "admin::api-tokens.update", subject: null }],
|
|
664
|
-
regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
|
|
665
|
-
},
|
|
666
|
-
"transfer-tokens": {
|
|
667
|
-
main: [{ action: "admin::transfer.tokens.access", subject: null }],
|
|
668
|
-
create: [{ action: "admin::transfer.tokens.create", subject: null }],
|
|
669
|
-
delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
|
|
670
|
-
read: [{ action: "admin::transfer.tokens.read", subject: null }],
|
|
671
|
-
update: [{ action: "admin::transfer.tokens.update", subject: null }],
|
|
672
|
-
regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
|
|
673
|
-
},
|
|
674
|
-
"project-settings": {
|
|
675
|
-
read: [{ action: "admin::project-settings.read", subject: null }],
|
|
676
|
-
update: [{ action: "admin::project-settings.update", subject: null }]
|
|
677
|
-
}
|
|
865
|
+
const ActionLayout = ({ startActions, endActions }) => {
|
|
866
|
+
if (!startActions && !endActions) {
|
|
867
|
+
return null;
|
|
678
868
|
}
|
|
869
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
870
|
+
designSystem.Flex,
|
|
871
|
+
{
|
|
872
|
+
justifyContent: "space-between",
|
|
873
|
+
alignItems: "flex-start",
|
|
874
|
+
paddingBottom: 4,
|
|
875
|
+
paddingLeft: 10,
|
|
876
|
+
paddingRight: 10,
|
|
877
|
+
children: [
|
|
878
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
879
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
880
|
+
]
|
|
881
|
+
}
|
|
882
|
+
);
|
|
679
883
|
};
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
* @constant
|
|
684
|
-
* @type {string}
|
|
685
|
-
*/
|
|
686
|
-
INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
|
|
687
|
-
/**
|
|
688
|
-
* Hook that allows to mutate the CM's collection types links pre-set filters
|
|
689
|
-
* @constant
|
|
690
|
-
* @type {string}
|
|
691
|
-
*/
|
|
692
|
-
MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
|
|
693
|
-
/**
|
|
694
|
-
* Hook that allows to mutate the CM's edit view layout
|
|
695
|
-
* @constant
|
|
696
|
-
* @type {string}
|
|
697
|
-
*/
|
|
698
|
-
MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
|
|
699
|
-
/**
|
|
700
|
-
* Hook that allows to mutate the CM's single types links pre-set filters
|
|
701
|
-
* @constant
|
|
702
|
-
* @type {string}
|
|
703
|
-
*/
|
|
704
|
-
MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
|
|
884
|
+
|
|
885
|
+
const ContentLayout = ({ children }) => {
|
|
886
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
705
887
|
};
|
|
706
|
-
const SETTINGS_LINKS_CE = () => ({
|
|
707
|
-
global: [
|
|
708
|
-
{
|
|
709
|
-
intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
|
|
710
|
-
to: "/settings/application-infos",
|
|
711
|
-
id: "000-application-infos"
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
|
|
715
|
-
to: "/settings/webhooks",
|
|
716
|
-
id: "webhooks"
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
|
|
720
|
-
to: "/settings/api-tokens?sort=name:ASC",
|
|
721
|
-
id: "api-tokens"
|
|
722
|
-
},
|
|
723
|
-
{
|
|
724
|
-
intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
|
|
725
|
-
to: "/settings/transfer-tokens?sort=name:ASC",
|
|
726
|
-
id: "transfer-tokens"
|
|
727
|
-
},
|
|
728
|
-
// 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.
|
|
729
|
-
// Disable this by adding "promoteEE: false" to your `./config/admin.js` file
|
|
730
|
-
...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
|
|
731
|
-
{
|
|
732
|
-
intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
|
|
733
|
-
to: "/settings/purchase-single-sign-on",
|
|
734
|
-
id: "sso-purchase-page",
|
|
735
|
-
licenseOnly: true
|
|
736
|
-
}
|
|
737
|
-
] : []
|
|
738
|
-
],
|
|
739
|
-
admin: [
|
|
740
|
-
{
|
|
741
|
-
intlLabel: { id: "global.roles", defaultMessage: "Roles" },
|
|
742
|
-
to: "/settings/roles",
|
|
743
|
-
id: "roles"
|
|
744
|
-
},
|
|
745
|
-
{
|
|
746
|
-
intlLabel: { id: "global.users", defaultMessage: "Users" },
|
|
747
|
-
// Init the search params directly
|
|
748
|
-
to: "/settings/users?pageSize=10&page=1&sort=firstname",
|
|
749
|
-
id: "users"
|
|
750
|
-
},
|
|
751
|
-
...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
|
|
752
|
-
{
|
|
753
|
-
intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
|
|
754
|
-
to: "/settings/purchase-audit-logs",
|
|
755
|
-
id: "auditLogs-purchase-page",
|
|
756
|
-
licenseOnly: true
|
|
757
|
-
}
|
|
758
|
-
] : []
|
|
759
|
-
]
|
|
760
|
-
});
|
|
761
888
|
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
invariant__default.default(components.Input, "An Input component must be provided");
|
|
810
|
-
invariant__default.default(
|
|
811
|
-
ALLOWED_TYPES.includes(type),
|
|
812
|
-
`Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
|
|
813
|
-
);
|
|
814
|
-
const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
|
|
815
|
-
invariant__default.default(
|
|
816
|
-
isValidObjectKey.test(name),
|
|
817
|
-
`Custom field name: '${name}' is not a valid object key`
|
|
889
|
+
const GridColSize = {
|
|
890
|
+
S: 180,
|
|
891
|
+
M: 250
|
|
892
|
+
};
|
|
893
|
+
const StyledGrid = styledComponents.styled(designSystem.Box)`
|
|
894
|
+
display: grid;
|
|
895
|
+
grid-template-columns: repeat(
|
|
896
|
+
auto-fit,
|
|
897
|
+
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
898
|
+
);
|
|
899
|
+
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
900
|
+
`;
|
|
901
|
+
const GridLayout = ({ size, children }) => {
|
|
902
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledGrid, { $size: size, children });
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
const BaseHeaderLayout = React__namespace.forwardRef(
|
|
906
|
+
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
907
|
+
const isSubtitleString = typeof subtitle === "string";
|
|
908
|
+
if (sticky) {
|
|
909
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
910
|
+
designSystem.Box,
|
|
911
|
+
{
|
|
912
|
+
paddingLeft: 6,
|
|
913
|
+
paddingRight: 6,
|
|
914
|
+
paddingTop: 3,
|
|
915
|
+
paddingBottom: 3,
|
|
916
|
+
position: "fixed",
|
|
917
|
+
top: 0,
|
|
918
|
+
right: 0,
|
|
919
|
+
background: "neutral0",
|
|
920
|
+
shadow: "tableShadow",
|
|
921
|
+
width: `${width}rem`,
|
|
922
|
+
zIndex: 1,
|
|
923
|
+
"data-strapi-header-sticky": true,
|
|
924
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
925
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
|
926
|
+
navigationAction && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingRight: 3, children: navigationAction }),
|
|
927
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
928
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
929
|
+
isSubtitleString ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
930
|
+
] }),
|
|
931
|
+
secondaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
932
|
+
] }),
|
|
933
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: primaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
934
|
+
] })
|
|
935
|
+
}
|
|
818
936
|
);
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
937
|
+
}
|
|
938
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
939
|
+
designSystem.Box,
|
|
940
|
+
{
|
|
941
|
+
ref,
|
|
942
|
+
paddingLeft: 10,
|
|
943
|
+
paddingRight: 10,
|
|
944
|
+
paddingBottom: 8,
|
|
945
|
+
paddingTop: navigationAction ? 6 : 8,
|
|
946
|
+
background: "neutral100",
|
|
947
|
+
"data-strapi-header": true,
|
|
948
|
+
children: [
|
|
949
|
+
navigationAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
950
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
951
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { minWidth: 0, children: [
|
|
952
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
953
|
+
secondaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
954
|
+
] }),
|
|
955
|
+
primaryAction
|
|
956
|
+
] }),
|
|
957
|
+
isSubtitleString ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
958
|
+
]
|
|
825
959
|
}
|
|
826
|
-
|
|
827
|
-
const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
|
|
828
|
-
invariant__default.default(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
|
|
829
|
-
this.customFields[uid] = customFields;
|
|
830
|
-
}
|
|
831
|
-
};
|
|
832
|
-
getAll = () => {
|
|
833
|
-
return this.customFields;
|
|
834
|
-
};
|
|
835
|
-
get = (uid) => {
|
|
836
|
-
return this.customFields[uid];
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
const optionsValidationReducer = (acc, option) => {
|
|
840
|
-
if ("items" in option) {
|
|
841
|
-
return option.items.reduce(optionsValidationReducer, acc);
|
|
842
|
-
}
|
|
843
|
-
if (!option.name) {
|
|
844
|
-
acc.push({
|
|
845
|
-
isValidOptionPath: false,
|
|
846
|
-
errorMessage: "The 'name' property is required on an options object"
|
|
847
|
-
});
|
|
848
|
-
} else {
|
|
849
|
-
acc.push({
|
|
850
|
-
isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
|
|
851
|
-
errorMessage: `'${option.name}' must be prefixed with 'options.'`
|
|
852
|
-
});
|
|
853
|
-
}
|
|
854
|
-
return acc;
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
class Plugin {
|
|
858
|
-
apis;
|
|
859
|
-
initializer;
|
|
860
|
-
injectionZones;
|
|
861
|
-
isReady;
|
|
862
|
-
name;
|
|
863
|
-
pluginId;
|
|
864
|
-
constructor(pluginConf) {
|
|
865
|
-
this.apis = pluginConf.apis || {};
|
|
866
|
-
this.initializer = pluginConf.initializer || null;
|
|
867
|
-
this.injectionZones = pluginConf.injectionZones || {};
|
|
868
|
-
this.isReady = pluginConf.isReady !== void 0 ? pluginConf.isReady : true;
|
|
869
|
-
this.name = pluginConf.name;
|
|
870
|
-
this.pluginId = pluginConf.id;
|
|
960
|
+
);
|
|
871
961
|
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
962
|
+
);
|
|
963
|
+
const HeaderLayout = (props) => {
|
|
964
|
+
const baseHeaderLayoutRef = React__namespace.useRef(null);
|
|
965
|
+
const [headerSize, setHeaderSize] = React__namespace.useState(null);
|
|
966
|
+
const [containerRef, isVisible] = useElementOnScreen({
|
|
967
|
+
root: null,
|
|
968
|
+
rootMargin: "0px",
|
|
969
|
+
threshold: 0
|
|
970
|
+
});
|
|
971
|
+
useResizeObserver(containerRef, () => {
|
|
972
|
+
if (containerRef.current) {
|
|
973
|
+
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
878
974
|
}
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
} catch (err) {
|
|
884
|
-
console.error("Cannot inject component", err);
|
|
975
|
+
});
|
|
976
|
+
React__namespace.useEffect(() => {
|
|
977
|
+
if (baseHeaderLayoutRef.current) {
|
|
978
|
+
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
885
979
|
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
admin_app: rbac.reducer
|
|
980
|
+
}, [baseHeaderLayoutRef]);
|
|
981
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
982
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsxRuntime.jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
983
|
+
!isVisible && /* @__PURE__ */ jsxRuntime.jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
984
|
+
] });
|
|
892
985
|
};
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
injectReducer: (key, asyncReducer) => {
|
|
900
|
-
asyncReducers[key] = asyncReducer;
|
|
901
|
-
store.replaceReducer(
|
|
902
|
-
// @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
|
|
903
|
-
toolkit.combineReducers({
|
|
904
|
-
...appReducers,
|
|
905
|
-
...asyncReducers
|
|
906
|
-
})
|
|
907
|
-
);
|
|
908
|
-
}
|
|
986
|
+
HeaderLayout.displayName = "HeaderLayout";
|
|
987
|
+
const useElementOnScreen = (options) => {
|
|
988
|
+
const containerRef = React__namespace.useRef(null);
|
|
989
|
+
const [isVisible, setIsVisible] = React__namespace.useState(true);
|
|
990
|
+
const callback = ([entry]) => {
|
|
991
|
+
setIsVisible(entry.isIntersecting);
|
|
909
992
|
};
|
|
993
|
+
React__namespace.useEffect(() => {
|
|
994
|
+
const containerEl = containerRef.current;
|
|
995
|
+
const observer = new IntersectionObserver(callback, options);
|
|
996
|
+
if (containerEl) {
|
|
997
|
+
observer.observe(containerRef.current);
|
|
998
|
+
}
|
|
999
|
+
return () => {
|
|
1000
|
+
if (containerEl) {
|
|
1001
|
+
observer.disconnect();
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
}, [containerRef, options]);
|
|
1005
|
+
return [containerRef, isVisible];
|
|
910
1006
|
};
|
|
911
|
-
const
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
],
|
|
929
|
-
enhancers: [injectReducerStoreEnhancer(coreReducers)]
|
|
930
|
-
});
|
|
931
|
-
return store;
|
|
1007
|
+
const useResizeObserver = (sources, onResize) => {
|
|
1008
|
+
const handleResize = designSystem.useCallbackRef(onResize);
|
|
1009
|
+
React__namespace.useLayoutEffect(() => {
|
|
1010
|
+
const resizeObs = new ResizeObserver(handleResize);
|
|
1011
|
+
if (Array.isArray(sources)) {
|
|
1012
|
+
sources.forEach((source) => {
|
|
1013
|
+
if (source.current) {
|
|
1014
|
+
resizeObs.observe(source.current);
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
} else if (sources.current) {
|
|
1018
|
+
resizeObs.observe(sources.current);
|
|
1019
|
+
}
|
|
1020
|
+
return () => {
|
|
1021
|
+
resizeObs.disconnect();
|
|
1022
|
+
};
|
|
1023
|
+
}, [sources, handleResize]);
|
|
932
1024
|
};
|
|
933
1025
|
|
|
934
|
-
const
|
|
1026
|
+
const GridContainer = styledComponents.styled(designSystem.Box)`
|
|
1027
|
+
display: grid;
|
|
1028
|
+
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
1029
|
+
`;
|
|
1030
|
+
const OverflowingItem = styledComponents.styled(designSystem.Box)`
|
|
1031
|
+
overflow-x: hidden;
|
|
1032
|
+
`;
|
|
1033
|
+
const RootLayout = ({ sideNav, children }) => {
|
|
1034
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
1035
|
+
sideNav,
|
|
1036
|
+
/* @__PURE__ */ jsxRuntime.jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
1037
|
+
] });
|
|
1038
|
+
};
|
|
1039
|
+
const Layouts = {
|
|
1040
|
+
Root: RootLayout,
|
|
1041
|
+
Header: HeaderLayout,
|
|
1042
|
+
BaseHeader: BaseHeaderLayout,
|
|
1043
|
+
Grid: GridLayout,
|
|
1044
|
+
Action: ActionLayout,
|
|
1045
|
+
Content: ContentLayout
|
|
1046
|
+
};
|
|
935
1047
|
|
|
936
|
-
const
|
|
937
|
-
const
|
|
938
|
-
return {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
},
|
|
948
|
-
async runWaterfallAsync(args, store) {
|
|
949
|
-
let result = args;
|
|
950
|
-
for (const fn of _handlers) {
|
|
951
|
-
result = await fn(result, store);
|
|
1048
|
+
const NotFoundPage = () => {
|
|
1049
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
1050
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Theme.Page.Main, { labelledBy: "title", children: [
|
|
1051
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1052
|
+
Layouts.Header,
|
|
1053
|
+
{
|
|
1054
|
+
id: "title",
|
|
1055
|
+
title: formatMessage({
|
|
1056
|
+
id: "content-manager.pageNotFound",
|
|
1057
|
+
defaultMessage: "Page not found"
|
|
1058
|
+
})
|
|
952
1059
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1060
|
+
),
|
|
1061
|
+
/* @__PURE__ */ jsxRuntime.jsx(Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1062
|
+
designSystem.EmptyStateLayout,
|
|
1063
|
+
{
|
|
1064
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(designSystem.LinkButton, { tag: reactRouterDom.Link, variant: "secondary", endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowRight, {}), to: "/", children: formatMessage({
|
|
1065
|
+
id: "app.components.NotFoundPage.back",
|
|
1066
|
+
defaultMessage: "Back to homepage"
|
|
1067
|
+
}) }),
|
|
1068
|
+
content: formatMessage({
|
|
1069
|
+
id: "app.page.not.found",
|
|
1070
|
+
defaultMessage: "Oops! We can't seem to find the page you're looging for..."
|
|
1071
|
+
}),
|
|
1072
|
+
hasRadius: true,
|
|
1073
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyPictures, { width: "16rem" }),
|
|
1074
|
+
shadow: "tableShadow"
|
|
1075
|
+
}
|
|
1076
|
+
) })
|
|
1077
|
+
] });
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
const getEERoutes = () => [
|
|
1081
|
+
...window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) ? [
|
|
1082
|
+
{
|
|
1083
|
+
path: "audit-logs",
|
|
1084
|
+
lazy: async () => {
|
|
1085
|
+
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-0d14kKi_.js'));
|
|
1086
|
+
return {
|
|
1087
|
+
Component: ProtectedListPage
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
] : [],
|
|
1092
|
+
...window.strapi.features.isEnabled(window.strapi.features.SSO) ? [
|
|
1093
|
+
{
|
|
1094
|
+
path: "single-sign-on",
|
|
1095
|
+
lazy: async () => {
|
|
1096
|
+
const { ProtectedSSO } = await Promise.resolve().then(() => require('./SingleSignOnPage-QIOJcuMR.js'));
|
|
1097
|
+
return {
|
|
1098
|
+
Component: ProtectedSSO
|
|
1099
|
+
};
|
|
962
1100
|
}
|
|
963
|
-
return result;
|
|
964
|
-
},
|
|
965
|
-
runParallel(...args) {
|
|
966
|
-
return Promise.all(
|
|
967
|
-
_handlers.map((fn) => {
|
|
968
|
-
return fn(...args);
|
|
969
|
-
})
|
|
970
|
-
);
|
|
971
1101
|
}
|
|
972
|
-
|
|
973
|
-
|
|
1102
|
+
] : []
|
|
1103
|
+
];
|
|
974
1104
|
|
|
975
1105
|
function getIn(obj, key, def, pathStartIndex = 0) {
|
|
976
1106
|
const path = toPath__default.default(key);
|
|
@@ -1014,7 +1144,7 @@ function setIn(obj, path, value) {
|
|
|
1014
1144
|
}
|
|
1015
1145
|
|
|
1016
1146
|
const ERR_MSG = "The Form Component has not been initialised, ensure you are using this hook within a Form component";
|
|
1017
|
-
const [FormProvider, useForm] =
|
|
1147
|
+
const [FormProvider, useForm] = Theme.createContext("Form", {
|
|
1018
1148
|
disabled: false,
|
|
1019
1149
|
errors: {},
|
|
1020
1150
|
initialValues: {},
|
|
@@ -1050,11 +1180,11 @@ const [FormProvider, useForm] = rbac.createContext("Form", {
|
|
|
1050
1180
|
values: {}
|
|
1051
1181
|
});
|
|
1052
1182
|
const Form = React__namespace.forwardRef(
|
|
1053
|
-
({ disabled = false, method, onSubmit, ...props }, ref) => {
|
|
1183
|
+
({ disabled = false, method, onSubmit, initialErrors, ...props }, ref) => {
|
|
1054
1184
|
const formRef = React__namespace.useRef(null);
|
|
1055
1185
|
const initialValues = React__namespace.useRef(props.initialValues ?? {});
|
|
1056
1186
|
const [state, dispatch] = React__namespace.useReducer(reducer, {
|
|
1057
|
-
errors: {},
|
|
1187
|
+
errors: initialErrors ?? {},
|
|
1058
1188
|
isSubmitting: false,
|
|
1059
1189
|
values: props.initialValues ?? {}
|
|
1060
1190
|
});
|
|
@@ -1392,11 +1522,40 @@ const useField = (path) => {
|
|
|
1392
1522
|
(state) => getIn(state.values, path)
|
|
1393
1523
|
);
|
|
1394
1524
|
const handleChange = useForm("useField", (state) => state.onChange);
|
|
1395
|
-
const
|
|
1525
|
+
const formatNestedErrorMessages = (stateErrors) => {
|
|
1526
|
+
const nestedErrors = {};
|
|
1527
|
+
Object.entries(stateErrors).forEach(([key, value2]) => {
|
|
1528
|
+
let current = nestedErrors;
|
|
1529
|
+
const pathParts = key.split(".");
|
|
1530
|
+
pathParts.forEach((part, index) => {
|
|
1531
|
+
const isLastPart = index === pathParts.length - 1;
|
|
1532
|
+
if (isLastPart) {
|
|
1533
|
+
if (typeof value2 === "string") {
|
|
1534
|
+
current[part] = value2;
|
|
1535
|
+
} else if (isErrorMessageDescriptor(value2)) {
|
|
1536
|
+
current[part] = formatMessage(value2);
|
|
1537
|
+
} else {
|
|
1538
|
+
setIn(current, part, value2);
|
|
1539
|
+
}
|
|
1540
|
+
} else {
|
|
1541
|
+
if (!current[part]) {
|
|
1542
|
+
const isArray = !isNaN(Number(pathParts[index + 1]));
|
|
1543
|
+
current[part] = isArray ? [] : {};
|
|
1544
|
+
}
|
|
1545
|
+
current = current[part];
|
|
1546
|
+
}
|
|
1547
|
+
});
|
|
1548
|
+
});
|
|
1549
|
+
return nestedErrors;
|
|
1550
|
+
};
|
|
1551
|
+
const error = useForm(
|
|
1552
|
+
"useField",
|
|
1553
|
+
(state) => getIn(formatNestedErrorMessages(state.errors), path)
|
|
1554
|
+
);
|
|
1396
1555
|
return {
|
|
1397
1556
|
initialValue,
|
|
1398
1557
|
/**
|
|
1399
|
-
* Errors can be a string, or a
|
|
1558
|
+
* Errors can be a string, or a MessageDescriptor, so we need to handle both cases.
|
|
1400
1559
|
* If it's anything else, we don't return it.
|
|
1401
1560
|
*/
|
|
1402
1561
|
error: isErrorMessageDescriptor(error) ? formatMessage(
|
|
@@ -1411,7 +1570,7 @@ const useField = (path) => {
|
|
|
1411
1570
|
};
|
|
1412
1571
|
};
|
|
1413
1572
|
const isErrorMessageDescriptor = (object) => {
|
|
1414
|
-
return typeof object === "object" && object !== null && "id" in object && "defaultMessage" in object;
|
|
1573
|
+
return typeof object === "object" && object !== null && !Array.isArray(object) && "id" in object && "defaultMessage" in object;
|
|
1415
1574
|
};
|
|
1416
1575
|
const Blocker = ({ onProceed = () => {
|
|
1417
1576
|
}, onCancel = () => {
|
|
@@ -1551,7 +1710,7 @@ const DateInput = React.forwardRef(
|
|
|
1551
1710
|
field.onChange(name, date);
|
|
1552
1711
|
},
|
|
1553
1712
|
onClear: () => field.onChange(name, void 0),
|
|
1554
|
-
value,
|
|
1713
|
+
value: value ? convertLocalDateToUTCDate(value) : void 0,
|
|
1555
1714
|
...props
|
|
1556
1715
|
}
|
|
1557
1716
|
),
|
|
@@ -1560,6 +1719,12 @@ const DateInput = React.forwardRef(
|
|
|
1560
1719
|
] });
|
|
1561
1720
|
}
|
|
1562
1721
|
);
|
|
1722
|
+
const convertLocalDateToUTCDate = (date$1) => {
|
|
1723
|
+
const utcDateString = date$1.toISOString();
|
|
1724
|
+
const timeZone = date.getLocalTimeZone();
|
|
1725
|
+
const zonedDateTime = date.parseAbsolute(utcDateString, timeZone);
|
|
1726
|
+
return date.toCalendarDate(zonedDateTime).toDate("UTC");
|
|
1727
|
+
};
|
|
1563
1728
|
const MemoizedDateInput = React.memo(DateInput);
|
|
1564
1729
|
|
|
1565
1730
|
const DateTimeInput = React.forwardRef(
|
|
@@ -1809,7 +1974,7 @@ const TimeInput = React.forwardRef(
|
|
|
1809
1974
|
ref: composedRefs,
|
|
1810
1975
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
1811
1976
|
onChange: (time) => {
|
|
1812
|
-
field.onChange(name, time);
|
|
1977
|
+
field.onChange(name, `${time}:00.000`);
|
|
1813
1978
|
},
|
|
1814
1979
|
onClear: () => field.onChange(name, void 0),
|
|
1815
1980
|
value: field.value ?? "",
|
|
@@ -1890,7 +2055,7 @@ const Img = styledComponents.styled.img`
|
|
|
1890
2055
|
const Logo = () => {
|
|
1891
2056
|
const {
|
|
1892
2057
|
logos: { auth }
|
|
1893
|
-
} =
|
|
2058
|
+
} = Theme.useConfiguration("UnauthenticatedLogo");
|
|
1894
2059
|
return /* @__PURE__ */ jsxRuntime.jsx(Img, { src: auth?.custom?.url || auth.default, "aria-hidden": true, alt: "" });
|
|
1895
2060
|
};
|
|
1896
2061
|
|
|
@@ -1902,8 +2067,8 @@ const Column = styledComponents.styled(designSystem.Flex)`
|
|
|
1902
2067
|
flex-direction: column;
|
|
1903
2068
|
`;
|
|
1904
2069
|
const LocaleToggle = () => {
|
|
1905
|
-
const localeNames =
|
|
1906
|
-
const dispatch =
|
|
2070
|
+
const localeNames = Theme.useTypedSelector((state) => state.admin_app.language.localeNames);
|
|
2071
|
+
const dispatch = Theme.useTypedDispatch();
|
|
1907
2072
|
const { formatMessage, locale } = reactIntl.useIntl();
|
|
1908
2073
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1909
2074
|
designSystem.SingleSelect,
|
|
@@ -1914,7 +2079,7 @@ const LocaleToggle = () => {
|
|
|
1914
2079
|
}),
|
|
1915
2080
|
value: locale,
|
|
1916
2081
|
onChange: (language) => {
|
|
1917
|
-
dispatch(
|
|
2082
|
+
dispatch(Theme.setLocale(language));
|
|
1918
2083
|
},
|
|
1919
2084
|
children: Object.entries(localeNames).map(([language, name]) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: language, children: name }, language))
|
|
1920
2085
|
}
|
|
@@ -2005,7 +2170,7 @@ const Login = ({ children }) => {
|
|
|
2005
2170
|
const { search: searchString } = reactRouterDom.useLocation();
|
|
2006
2171
|
const query = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
|
2007
2172
|
const navigate = reactRouterDom.useNavigate();
|
|
2008
|
-
const { login } =
|
|
2173
|
+
const { login } = Theme.useAuth("Login", (auth) => auth);
|
|
2009
2174
|
const handleLogin = async (body) => {
|
|
2010
2175
|
setApiError(void 0);
|
|
2011
2176
|
const res = await login(body);
|
|
@@ -2095,8 +2260,8 @@ const Login = ({ children }) => {
|
|
|
2095
2260
|
const ForgotPassword = () => {
|
|
2096
2261
|
const navigate = reactRouterDom.useNavigate();
|
|
2097
2262
|
const { formatMessage } = reactIntl.useIntl();
|
|
2098
|
-
const { _unstableFormatAPIError: formatAPIError } =
|
|
2099
|
-
const [forgotPassword, { error }] =
|
|
2263
|
+
const { _unstableFormatAPIError: formatAPIError } = Theme.useAPIErrorHandler();
|
|
2264
|
+
const [forgotPassword, { error }] = Theme.useForgotPasswordMutation();
|
|
2100
2265
|
return /* @__PURE__ */ jsxRuntime.jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { children: [
|
|
2101
2266
|
/* @__PURE__ */ jsxRuntime.jsxs(LayoutContent, { children: [
|
|
2102
2267
|
/* @__PURE__ */ jsxRuntime.jsxs(Column, { children: [
|
|
@@ -2296,9 +2461,9 @@ const NpsSurvey = () => {
|
|
|
2296
2461
|
const { formatMessage } = reactIntl.useIntl();
|
|
2297
2462
|
const { npsSurveySettings, setNpsSurveySettings } = useNpsSurveySettings();
|
|
2298
2463
|
const [isFeedbackResponse, setIsFeedbackResponse] = React__namespace.useState(false);
|
|
2299
|
-
const { toggleNotification } =
|
|
2300
|
-
const currentEnvironment =
|
|
2301
|
-
const strapiVersion =
|
|
2464
|
+
const { toggleNotification } = Theme.useNotification();
|
|
2465
|
+
const currentEnvironment = Theme.useAppInfo("NpsSurvey", (state) => state.currentEnvironment);
|
|
2466
|
+
const strapiVersion = Theme.useAppInfo("NpsSurvey", (state) => state.strapiVersion);
|
|
2302
2467
|
const [surveyIsShown, setSurveyIsShown] = React__namespace.useState(
|
|
2303
2468
|
checkIfShouldShowSurvey(npsSurveySettings)
|
|
2304
2469
|
);
|
|
@@ -2311,7 +2476,7 @@ const NpsSurvey = () => {
|
|
|
2311
2476
|
clearTimeout(displayTime);
|
|
2312
2477
|
};
|
|
2313
2478
|
}, []);
|
|
2314
|
-
const { user } =
|
|
2479
|
+
const { user } = Theme.useAuth("NpsSurvey", (auth) => auth);
|
|
2315
2480
|
if (!displaySurvey) {
|
|
2316
2481
|
return null;
|
|
2317
2482
|
}
|
|
@@ -2581,11 +2746,11 @@ const REGISTER_ADMIN_SCHEMA = yup__namespace.object().shape({
|
|
|
2581
2746
|
})
|
|
2582
2747
|
});
|
|
2583
2748
|
const Register = ({ hasAdmin }) => {
|
|
2584
|
-
const { toggleNotification } =
|
|
2749
|
+
const { toggleNotification } = Theme.useNotification();
|
|
2585
2750
|
const navigate = reactRouterDom.useNavigate();
|
|
2586
2751
|
const [submitCount, setSubmitCount] = React__namespace.useState(0);
|
|
2587
2752
|
const [apiError, setApiError] = React__namespace.useState();
|
|
2588
|
-
const { trackUsage } =
|
|
2753
|
+
const { trackUsage } = Theme.useTracking();
|
|
2589
2754
|
const { formatMessage } = reactIntl.useIntl();
|
|
2590
2755
|
const setSkipped = useGuidedTour("Register", (state) => state.setSkipped);
|
|
2591
2756
|
const { search: searchString } = reactRouterDom.useLocation();
|
|
@@ -2594,10 +2759,10 @@ const Register = ({ hasAdmin }) => {
|
|
|
2594
2759
|
const {
|
|
2595
2760
|
_unstableFormatAPIError: formatAPIError,
|
|
2596
2761
|
_unstableFormatValidationErrors: formatValidationErrors
|
|
2597
|
-
} =
|
|
2762
|
+
} = Theme.useAPIErrorHandler();
|
|
2598
2763
|
const { setNpsSurveySettings } = useNpsSurveySettings();
|
|
2599
2764
|
const registrationToken = query.get("registrationToken");
|
|
2600
|
-
const { data: userInfo, error } =
|
|
2765
|
+
const { data: userInfo, error } = Theme.useGetRegistrationInfoQuery(registrationToken, {
|
|
2601
2766
|
skip: !registrationToken
|
|
2602
2767
|
});
|
|
2603
2768
|
React__namespace.useEffect(() => {
|
|
@@ -2610,9 +2775,9 @@ const Register = ({ hasAdmin }) => {
|
|
|
2610
2775
|
navigate(`/auth/oops?info=${encodeURIComponent(message)}`);
|
|
2611
2776
|
}
|
|
2612
2777
|
}, [error, formatAPIError, navigate, toggleNotification]);
|
|
2613
|
-
const [registerAdmin] =
|
|
2614
|
-
const [registerUser] =
|
|
2615
|
-
const { setToken } =
|
|
2778
|
+
const [registerAdmin] = Theme.useRegisterAdminMutation();
|
|
2779
|
+
const [registerUser] = Theme.useRegisterUserMutation();
|
|
2780
|
+
const { setToken } = Theme.useAuth("Register", (auth) => auth);
|
|
2616
2781
|
const handleRegisterAdmin = async ({ news, ...body }, setFormErrors) => {
|
|
2617
2782
|
const res = await registerAdmin(body);
|
|
2618
2783
|
if ("data" in res) {
|
|
@@ -2890,9 +3055,9 @@ const ResetPassword = () => {
|
|
|
2890
3055
|
const navigate = reactRouterDom.useNavigate();
|
|
2891
3056
|
const { search: searchString } = reactRouterDom.useLocation();
|
|
2892
3057
|
const query = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
|
2893
|
-
const { _unstableFormatAPIError: formatAPIError } =
|
|
2894
|
-
const { setToken } =
|
|
2895
|
-
const [resetPassword, { error }] =
|
|
3058
|
+
const { _unstableFormatAPIError: formatAPIError } = Theme.useAPIErrorHandler();
|
|
3059
|
+
const { setToken } = Theme.useAuth("ResetPassword", (auth) => auth);
|
|
3060
|
+
const [resetPassword, { error }] = Theme.useResetPasswordMutation();
|
|
2896
3061
|
const handleSubmit = async (body) => {
|
|
2897
3062
|
const res = await resetPassword(body);
|
|
2898
3063
|
if ("data" in res) {
|
|
@@ -2986,11 +3151,11 @@ const AuthPage = () => {
|
|
|
2986
3151
|
const { hasAdmin } = data ?? {};
|
|
2987
3152
|
const Login$1 = useEnterprise.useEnterprise(
|
|
2988
3153
|
Login,
|
|
2989
|
-
async () => (await Promise.resolve().then(() => require('./Login-
|
|
3154
|
+
async () => (await Promise.resolve().then(() => require('./Login-7l3x6yOV.js'))).LoginEE
|
|
2990
3155
|
);
|
|
2991
3156
|
const forms = useEnterprise.useEnterprise(
|
|
2992
3157
|
FORMS,
|
|
2993
|
-
async () => (await Promise.resolve().then(() => require('./constants-
|
|
3158
|
+
async () => (await Promise.resolve().then(() => require('./constants-9azy3JJD.js'))).FORMS,
|
|
2994
3159
|
{
|
|
2995
3160
|
combine(ceForms, eeForms) {
|
|
2996
3161
|
return {
|
|
@@ -2998,257 +3163,42 @@ const AuthPage = () => {
|
|
|
2998
3163
|
...eeForms
|
|
2999
3164
|
};
|
|
3000
3165
|
},
|
|
3001
|
-
defaultValue: FORMS
|
|
3002
|
-
}
|
|
3003
|
-
);
|
|
3004
|
-
const { token } =
|
|
3005
|
-
if (!authType || !forms) {
|
|
3006
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/" });
|
|
3007
|
-
}
|
|
3008
|
-
const Component = forms[authType];
|
|
3009
|
-
if (!Component || hasAdmin && authType === "register-admin" || token) {
|
|
3010
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/" });
|
|
3011
|
-
}
|
|
3012
|
-
if (!hasAdmin && authType !== "register-admin") {
|
|
3013
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3014
|
-
reactRouterDom.Navigate,
|
|
3015
|
-
{
|
|
3016
|
-
to: {
|
|
3017
|
-
pathname: "/auth/register-admin",
|
|
3018
|
-
// Forward the `?redirectTo` from /auth/login
|
|
3019
|
-
// /abc => /auth/login?redirectTo=%2Fabc => /auth/register-admin?redirectTo=%2Fabc
|
|
3020
|
-
search
|
|
3021
|
-
}
|
|
3022
|
-
}
|
|
3023
|
-
);
|
|
3024
|
-
}
|
|
3025
|
-
if (Login$1 && authType === "login") {
|
|
3026
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Login$1, {});
|
|
3027
|
-
} else if (authType === "login" && !Login$1) {
|
|
3028
|
-
return null;
|
|
3029
|
-
}
|
|
3030
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Component, { hasAdmin });
|
|
3031
|
-
};
|
|
3032
|
-
|
|
3033
|
-
const ActionLayout = ({ startActions, endActions }) => {
|
|
3034
|
-
if (!startActions && !endActions) {
|
|
3035
|
-
return null;
|
|
3036
|
-
}
|
|
3037
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3038
|
-
designSystem.Flex,
|
|
3039
|
-
{
|
|
3040
|
-
justifyContent: "space-between",
|
|
3041
|
-
alignItems: "flex-start",
|
|
3042
|
-
paddingBottom: 4,
|
|
3043
|
-
paddingLeft: 10,
|
|
3044
|
-
paddingRight: 10,
|
|
3045
|
-
children: [
|
|
3046
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
3047
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
3048
|
-
]
|
|
3049
|
-
}
|
|
3050
|
-
);
|
|
3051
|
-
};
|
|
3052
|
-
|
|
3053
|
-
const ContentLayout = ({ children }) => {
|
|
3054
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
3055
|
-
};
|
|
3056
|
-
|
|
3057
|
-
const GridColSize = {
|
|
3058
|
-
S: 180,
|
|
3059
|
-
M: 250
|
|
3060
|
-
};
|
|
3061
|
-
const StyledGrid = styledComponents.styled(designSystem.Box)`
|
|
3062
|
-
display: grid;
|
|
3063
|
-
grid-template-columns: repeat(
|
|
3064
|
-
auto-fit,
|
|
3065
|
-
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
3066
|
-
);
|
|
3067
|
-
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
3068
|
-
`;
|
|
3069
|
-
const GridLayout = ({ size, children }) => {
|
|
3070
|
-
return /* @__PURE__ */ jsxRuntime.jsx(StyledGrid, { $size: size, children });
|
|
3071
|
-
};
|
|
3072
|
-
|
|
3073
|
-
const BaseHeaderLayout = React__namespace.forwardRef(
|
|
3074
|
-
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
3075
|
-
const isSubtitleString = typeof subtitle === "string";
|
|
3076
|
-
if (sticky) {
|
|
3077
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3078
|
-
designSystem.Box,
|
|
3079
|
-
{
|
|
3080
|
-
paddingLeft: 6,
|
|
3081
|
-
paddingRight: 6,
|
|
3082
|
-
paddingTop: 3,
|
|
3083
|
-
paddingBottom: 3,
|
|
3084
|
-
position: "fixed",
|
|
3085
|
-
top: 0,
|
|
3086
|
-
right: 0,
|
|
3087
|
-
background: "neutral0",
|
|
3088
|
-
shadow: "tableShadow",
|
|
3089
|
-
width: `${width}rem`,
|
|
3090
|
-
zIndex: 1,
|
|
3091
|
-
"data-strapi-header-sticky": true,
|
|
3092
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
3093
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
|
3094
|
-
navigationAction && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingRight: 3, children: navigationAction }),
|
|
3095
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
3096
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
3097
|
-
isSubtitleString ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
3098
|
-
] }),
|
|
3099
|
-
secondaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
3100
|
-
] }),
|
|
3101
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: primaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
3102
|
-
] })
|
|
3103
|
-
}
|
|
3104
|
-
);
|
|
3105
|
-
}
|
|
3106
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3107
|
-
designSystem.Box,
|
|
3108
|
-
{
|
|
3109
|
-
ref,
|
|
3110
|
-
paddingLeft: 10,
|
|
3111
|
-
paddingRight: 10,
|
|
3112
|
-
paddingBottom: 8,
|
|
3113
|
-
paddingTop: navigationAction ? 6 : 8,
|
|
3114
|
-
background: "neutral100",
|
|
3115
|
-
"data-strapi-header": true,
|
|
3116
|
-
children: [
|
|
3117
|
-
navigationAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
3118
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
3119
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { minWidth: 0, children: [
|
|
3120
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
3121
|
-
secondaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
3122
|
-
] }),
|
|
3123
|
-
primaryAction
|
|
3124
|
-
] }),
|
|
3125
|
-
isSubtitleString ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
3126
|
-
]
|
|
3127
|
-
}
|
|
3128
|
-
);
|
|
3129
|
-
}
|
|
3130
|
-
);
|
|
3131
|
-
const HeaderLayout = (props) => {
|
|
3132
|
-
const baseHeaderLayoutRef = React__namespace.useRef(null);
|
|
3133
|
-
const [headerSize, setHeaderSize] = React__namespace.useState(null);
|
|
3134
|
-
const [containerRef, isVisible] = useElementOnScreen({
|
|
3135
|
-
root: null,
|
|
3136
|
-
rootMargin: "0px",
|
|
3137
|
-
threshold: 0
|
|
3138
|
-
});
|
|
3139
|
-
useResizeObserver(containerRef, () => {
|
|
3140
|
-
if (containerRef.current) {
|
|
3141
|
-
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
3142
|
-
}
|
|
3143
|
-
});
|
|
3144
|
-
React__namespace.useEffect(() => {
|
|
3145
|
-
if (baseHeaderLayoutRef.current) {
|
|
3146
|
-
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
3147
|
-
}
|
|
3148
|
-
}, [baseHeaderLayoutRef]);
|
|
3149
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3150
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsxRuntime.jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
3151
|
-
!isVisible && /* @__PURE__ */ jsxRuntime.jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
3152
|
-
] });
|
|
3153
|
-
};
|
|
3154
|
-
HeaderLayout.displayName = "HeaderLayout";
|
|
3155
|
-
const useElementOnScreen = (options) => {
|
|
3156
|
-
const containerRef = React__namespace.useRef(null);
|
|
3157
|
-
const [isVisible, setIsVisible] = React__namespace.useState(true);
|
|
3158
|
-
const callback = ([entry]) => {
|
|
3159
|
-
setIsVisible(entry.isIntersecting);
|
|
3160
|
-
};
|
|
3161
|
-
React__namespace.useEffect(() => {
|
|
3162
|
-
const containerEl = containerRef.current;
|
|
3163
|
-
const observer = new IntersectionObserver(callback, options);
|
|
3164
|
-
if (containerEl) {
|
|
3165
|
-
observer.observe(containerRef.current);
|
|
3166
|
-
}
|
|
3167
|
-
return () => {
|
|
3168
|
-
if (containerEl) {
|
|
3169
|
-
observer.disconnect();
|
|
3170
|
-
}
|
|
3171
|
-
};
|
|
3172
|
-
}, [containerRef, options]);
|
|
3173
|
-
return [containerRef, isVisible];
|
|
3174
|
-
};
|
|
3175
|
-
const useResizeObserver = (sources, onResize) => {
|
|
3176
|
-
const handleResize = designSystem.useCallbackRef(onResize);
|
|
3177
|
-
React__namespace.useLayoutEffect(() => {
|
|
3178
|
-
const resizeObs = new ResizeObserver(handleResize);
|
|
3179
|
-
if (Array.isArray(sources)) {
|
|
3180
|
-
sources.forEach((source) => {
|
|
3181
|
-
if (source.current) {
|
|
3182
|
-
resizeObs.observe(source.current);
|
|
3183
|
-
}
|
|
3184
|
-
});
|
|
3185
|
-
} else if (sources.current) {
|
|
3186
|
-
resizeObs.observe(sources.current);
|
|
3187
|
-
}
|
|
3188
|
-
return () => {
|
|
3189
|
-
resizeObs.disconnect();
|
|
3190
|
-
};
|
|
3191
|
-
}, [sources, handleResize]);
|
|
3192
|
-
};
|
|
3193
|
-
|
|
3194
|
-
const GridContainer = styledComponents.styled(designSystem.Box)`
|
|
3195
|
-
display: grid;
|
|
3196
|
-
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
3197
|
-
`;
|
|
3198
|
-
const OverflowingItem = styledComponents.styled(designSystem.Box)`
|
|
3199
|
-
overflow-x: hidden;
|
|
3200
|
-
`;
|
|
3201
|
-
const RootLayout = ({ sideNav, children }) => {
|
|
3202
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
3203
|
-
sideNav,
|
|
3204
|
-
/* @__PURE__ */ jsxRuntime.jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
3205
|
-
] });
|
|
3206
|
-
};
|
|
3207
|
-
const Layouts = {
|
|
3208
|
-
Root: RootLayout,
|
|
3209
|
-
Header: HeaderLayout,
|
|
3210
|
-
BaseHeader: BaseHeaderLayout,
|
|
3211
|
-
Grid: GridLayout,
|
|
3212
|
-
Action: ActionLayout,
|
|
3213
|
-
Content: ContentLayout
|
|
3214
|
-
};
|
|
3215
|
-
|
|
3216
|
-
const NotFoundPage = () => {
|
|
3217
|
-
const { formatMessage } = reactIntl.useIntl();
|
|
3218
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(rbac.Page.Main, { labelledBy: "title", children: [
|
|
3219
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3220
|
-
Layouts.Header,
|
|
3221
|
-
{
|
|
3222
|
-
id: "title",
|
|
3223
|
-
title: formatMessage({
|
|
3224
|
-
id: "content-manager.pageNotFound",
|
|
3225
|
-
defaultMessage: "Page not found"
|
|
3226
|
-
})
|
|
3227
|
-
}
|
|
3228
|
-
),
|
|
3229
|
-
/* @__PURE__ */ jsxRuntime.jsx(Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3230
|
-
designSystem.EmptyStateLayout,
|
|
3166
|
+
defaultValue: FORMS
|
|
3167
|
+
}
|
|
3168
|
+
);
|
|
3169
|
+
const { token } = Theme.useAuth("AuthPage", (auth) => auth);
|
|
3170
|
+
if (!authType || !forms) {
|
|
3171
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/" });
|
|
3172
|
+
}
|
|
3173
|
+
const Component = forms[authType];
|
|
3174
|
+
if (!Component || hasAdmin && authType === "register-admin" || token) {
|
|
3175
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/" });
|
|
3176
|
+
}
|
|
3177
|
+
if (!hasAdmin && authType !== "register-admin") {
|
|
3178
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3179
|
+
reactRouterDom.Navigate,
|
|
3231
3180
|
{
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
defaultMessage: "Oops! We can't seem to find the page you're looging for..."
|
|
3239
|
-
}),
|
|
3240
|
-
hasRadius: true,
|
|
3241
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyPictures, { width: "16rem" }),
|
|
3242
|
-
shadow: "tableShadow"
|
|
3181
|
+
to: {
|
|
3182
|
+
pathname: "/auth/register-admin",
|
|
3183
|
+
// Forward the `?redirectTo` from /auth/login
|
|
3184
|
+
// /abc => /auth/login?redirectTo=%2Fabc => /auth/register-admin?redirectTo=%2Fabc
|
|
3185
|
+
search
|
|
3186
|
+
}
|
|
3243
3187
|
}
|
|
3244
|
-
)
|
|
3245
|
-
|
|
3188
|
+
);
|
|
3189
|
+
}
|
|
3190
|
+
if (Login$1 && authType === "login") {
|
|
3191
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Login$1, {});
|
|
3192
|
+
} else if (authType === "login" && !Login$1) {
|
|
3193
|
+
return null;
|
|
3194
|
+
}
|
|
3195
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Component, { hasAdmin });
|
|
3246
3196
|
};
|
|
3247
3197
|
|
|
3248
3198
|
const ROUTES_CE = [
|
|
3249
3199
|
{
|
|
3250
3200
|
lazy: async () => {
|
|
3251
|
-
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-
|
|
3201
|
+
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-UY_3K2Wy.js'));
|
|
3252
3202
|
return {
|
|
3253
3203
|
Component: ProtectedListPage
|
|
3254
3204
|
};
|
|
@@ -3257,7 +3207,7 @@ const ROUTES_CE = [
|
|
|
3257
3207
|
},
|
|
3258
3208
|
{
|
|
3259
3209
|
lazy: async () => {
|
|
3260
|
-
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-
|
|
3210
|
+
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-QPlhxPWu.js'));
|
|
3261
3211
|
return {
|
|
3262
3212
|
Component: ProtectedCreatePage
|
|
3263
3213
|
};
|
|
@@ -3266,7 +3216,7 @@ const ROUTES_CE = [
|
|
|
3266
3216
|
},
|
|
3267
3217
|
{
|
|
3268
3218
|
lazy: async () => {
|
|
3269
|
-
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-
|
|
3219
|
+
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-QPlhxPWu.js'));
|
|
3270
3220
|
return {
|
|
3271
3221
|
Component: ProtectedCreatePage
|
|
3272
3222
|
};
|
|
@@ -3275,7 +3225,7 @@ const ROUTES_CE = [
|
|
|
3275
3225
|
},
|
|
3276
3226
|
{
|
|
3277
3227
|
lazy: async () => {
|
|
3278
|
-
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-
|
|
3228
|
+
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-H0_OHPE-.js'));
|
|
3279
3229
|
return {
|
|
3280
3230
|
Component: ProtectedEditPage
|
|
3281
3231
|
};
|
|
@@ -3284,7 +3234,7 @@ const ROUTES_CE = [
|
|
|
3284
3234
|
},
|
|
3285
3235
|
{
|
|
3286
3236
|
lazy: async () => {
|
|
3287
|
-
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-
|
|
3237
|
+
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-gxijeg53.js'));
|
|
3288
3238
|
return {
|
|
3289
3239
|
Component: ProtectedListPage
|
|
3290
3240
|
};
|
|
@@ -3293,7 +3243,7 @@ const ROUTES_CE = [
|
|
|
3293
3243
|
},
|
|
3294
3244
|
{
|
|
3295
3245
|
lazy: async () => {
|
|
3296
|
-
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-
|
|
3246
|
+
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-CJfjdfkV.js'));
|
|
3297
3247
|
return {
|
|
3298
3248
|
Component: ProtectedEditPage
|
|
3299
3249
|
};
|
|
@@ -3302,7 +3252,7 @@ const ROUTES_CE = [
|
|
|
3302
3252
|
},
|
|
3303
3253
|
{
|
|
3304
3254
|
lazy: async () => {
|
|
3305
|
-
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-
|
|
3255
|
+
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-c1UAG1Pz.js'));
|
|
3306
3256
|
return {
|
|
3307
3257
|
Component: ProtectedCreatePage
|
|
3308
3258
|
};
|
|
@@ -3311,7 +3261,7 @@ const ROUTES_CE = [
|
|
|
3311
3261
|
},
|
|
3312
3262
|
{
|
|
3313
3263
|
lazy: async () => {
|
|
3314
|
-
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-
|
|
3264
|
+
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-xdwfsmQu.js')).then(n => n.EditPage$1);
|
|
3315
3265
|
return {
|
|
3316
3266
|
Component: ProtectedEditPage
|
|
3317
3267
|
};
|
|
@@ -3320,7 +3270,7 @@ const ROUTES_CE = [
|
|
|
3320
3270
|
},
|
|
3321
3271
|
{
|
|
3322
3272
|
lazy: async () => {
|
|
3323
|
-
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-
|
|
3273
|
+
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-3yawwYZy.js'));
|
|
3324
3274
|
return {
|
|
3325
3275
|
Component: ProtectedListPage
|
|
3326
3276
|
};
|
|
@@ -3329,7 +3279,7 @@ const ROUTES_CE = [
|
|
|
3329
3279
|
},
|
|
3330
3280
|
{
|
|
3331
3281
|
lazy: async () => {
|
|
3332
|
-
const { ProtectedListView } = await Promise.resolve().then(() => require('./ListView-
|
|
3282
|
+
const { ProtectedListView } = await Promise.resolve().then(() => require('./ListView-GCE-p1AU.js'));
|
|
3333
3283
|
return {
|
|
3334
3284
|
Component: ProtectedListView
|
|
3335
3285
|
};
|
|
@@ -3338,68 +3288,482 @@ const ROUTES_CE = [
|
|
|
3338
3288
|
},
|
|
3339
3289
|
{
|
|
3340
3290
|
lazy: async () => {
|
|
3341
|
-
const { ProtectedCreateView } = await Promise.resolve().then(() => require('./CreateView-
|
|
3291
|
+
const { ProtectedCreateView } = await Promise.resolve().then(() => require('./CreateView-df0oOgwH.js'));
|
|
3292
|
+
return {
|
|
3293
|
+
Component: ProtectedCreateView
|
|
3294
|
+
};
|
|
3295
|
+
},
|
|
3296
|
+
path: "api-tokens/create"
|
|
3297
|
+
},
|
|
3298
|
+
{
|
|
3299
|
+
lazy: async () => {
|
|
3300
|
+
const { ProtectedEditView } = await Promise.resolve().then(() => require('./EditViewPage-I1YFzBeC.js'));
|
|
3301
|
+
return {
|
|
3302
|
+
Component: ProtectedEditView
|
|
3303
|
+
};
|
|
3304
|
+
},
|
|
3305
|
+
path: "api-tokens/:id"
|
|
3306
|
+
},
|
|
3307
|
+
{
|
|
3308
|
+
lazy: async () => {
|
|
3309
|
+
const { ProtectedCreateView } = await Promise.resolve().then(() => require('./CreateView-tz9mjAr8.js'));
|
|
3342
3310
|
return {
|
|
3343
3311
|
Component: ProtectedCreateView
|
|
3344
3312
|
};
|
|
3345
3313
|
},
|
|
3346
|
-
path: "
|
|
3347
|
-
},
|
|
3348
|
-
{
|
|
3349
|
-
lazy: async () => {
|
|
3350
|
-
const {
|
|
3351
|
-
return {
|
|
3352
|
-
Component:
|
|
3353
|
-
};
|
|
3314
|
+
path: "transfer-tokens/create"
|
|
3315
|
+
},
|
|
3316
|
+
{
|
|
3317
|
+
lazy: async () => {
|
|
3318
|
+
const { ProtectedListView } = await Promise.resolve().then(() => require('./ListView-OorXxSB4.js'));
|
|
3319
|
+
return {
|
|
3320
|
+
Component: ProtectedListView
|
|
3321
|
+
};
|
|
3322
|
+
},
|
|
3323
|
+
path: "transfer-tokens"
|
|
3324
|
+
},
|
|
3325
|
+
{
|
|
3326
|
+
lazy: async () => {
|
|
3327
|
+
const { ProtectedEditView } = await Promise.resolve().then(() => require('./EditView-j6KW3gjS.js'));
|
|
3328
|
+
return {
|
|
3329
|
+
Component: ProtectedEditView
|
|
3330
|
+
};
|
|
3331
|
+
},
|
|
3332
|
+
path: "transfer-tokens/:id"
|
|
3333
|
+
},
|
|
3334
|
+
{
|
|
3335
|
+
lazy: async () => {
|
|
3336
|
+
const { PurchaseAuditLogs } = await Promise.resolve().then(() => require('./PurchaseAuditLogs-jB1NOXg4.js'));
|
|
3337
|
+
return {
|
|
3338
|
+
Component: PurchaseAuditLogs
|
|
3339
|
+
};
|
|
3340
|
+
},
|
|
3341
|
+
path: "purchase-audit-logs"
|
|
3342
|
+
},
|
|
3343
|
+
{
|
|
3344
|
+
lazy: async () => {
|
|
3345
|
+
const { PurchaseSingleSignOn } = await Promise.resolve().then(() => require('./PurchaseSingleSignOn-u10-YAGx.js'));
|
|
3346
|
+
return {
|
|
3347
|
+
Component: PurchaseSingleSignOn
|
|
3348
|
+
};
|
|
3349
|
+
},
|
|
3350
|
+
path: "purchase-single-sign-on"
|
|
3351
|
+
}
|
|
3352
|
+
];
|
|
3353
|
+
|
|
3354
|
+
const getImmutableRoutes = () => [
|
|
3355
|
+
{
|
|
3356
|
+
path: "usecase",
|
|
3357
|
+
lazy: async () => {
|
|
3358
|
+
const { PrivateUseCasePage } = await Promise.resolve().then(() => require('./UseCasePage-JvS8byfE.js'));
|
|
3359
|
+
return {
|
|
3360
|
+
Component: PrivateUseCasePage
|
|
3361
|
+
};
|
|
3362
|
+
}
|
|
3363
|
+
},
|
|
3364
|
+
// this needs to go before auth/:authType because otherwise it won't match the route
|
|
3365
|
+
...getEERoutes$1(),
|
|
3366
|
+
{
|
|
3367
|
+
path: "auth/:authType",
|
|
3368
|
+
element: /* @__PURE__ */ jsxRuntime.jsx(AuthPage, {})
|
|
3369
|
+
}
|
|
3370
|
+
];
|
|
3371
|
+
const getInitialRoutes = () => [
|
|
3372
|
+
{
|
|
3373
|
+
index: true,
|
|
3374
|
+
lazy: async () => {
|
|
3375
|
+
const { HomePage } = await Promise.resolve().then(() => require('./HomePage-58hB6NEL.js'));
|
|
3376
|
+
return {
|
|
3377
|
+
Component: HomePage
|
|
3378
|
+
};
|
|
3379
|
+
}
|
|
3380
|
+
},
|
|
3381
|
+
{
|
|
3382
|
+
path: "me",
|
|
3383
|
+
lazy: async () => {
|
|
3384
|
+
const { ProfilePage } = await Promise.resolve().then(() => require('./ProfilePage-NTjed70Z.js'));
|
|
3385
|
+
return {
|
|
3386
|
+
Component: ProfilePage
|
|
3387
|
+
};
|
|
3388
|
+
}
|
|
3389
|
+
},
|
|
3390
|
+
{
|
|
3391
|
+
path: "list-plugins",
|
|
3392
|
+
lazy: async () => {
|
|
3393
|
+
const { ProtectedInstalledPluginsPage } = await Promise.resolve().then(() => require('./InstalledPluginsPage-ToVkNeOW.js'));
|
|
3394
|
+
return {
|
|
3395
|
+
Component: ProtectedInstalledPluginsPage
|
|
3396
|
+
};
|
|
3397
|
+
}
|
|
3398
|
+
},
|
|
3399
|
+
{
|
|
3400
|
+
path: "marketplace",
|
|
3401
|
+
lazy: async () => {
|
|
3402
|
+
const { ProtectedMarketplacePage } = await Promise.resolve().then(() => require('./MarketplacePage-fqRuZ5tH.js'));
|
|
3403
|
+
return {
|
|
3404
|
+
Component: ProtectedMarketplacePage
|
|
3405
|
+
};
|
|
3406
|
+
}
|
|
3407
|
+
},
|
|
3408
|
+
{
|
|
3409
|
+
path: "settings/*",
|
|
3410
|
+
lazy: async () => {
|
|
3411
|
+
const { Layout } = await Promise.resolve().then(() => require('./Layout-rLCApf8n.js'));
|
|
3412
|
+
return {
|
|
3413
|
+
Component: Layout
|
|
3414
|
+
};
|
|
3415
|
+
},
|
|
3416
|
+
children: [
|
|
3417
|
+
{
|
|
3418
|
+
path: "application-infos",
|
|
3419
|
+
lazy: async () => {
|
|
3420
|
+
const { ApplicationInfoPage } = await Promise.resolve().then(() => require('./ApplicationInfoPage-KQETt-ON.js'));
|
|
3421
|
+
return {
|
|
3422
|
+
Component: ApplicationInfoPage
|
|
3423
|
+
};
|
|
3424
|
+
}
|
|
3425
|
+
},
|
|
3426
|
+
// ...Object.values(this.settings).flatMap(({ links }) =>
|
|
3427
|
+
// links.map(({ to, Component }) => ({
|
|
3428
|
+
// path: `${to}/*`,
|
|
3429
|
+
// element: (
|
|
3430
|
+
// <React.Suspense fallback={<Page.Loading />}>
|
|
3431
|
+
// <Component />
|
|
3432
|
+
// </React.Suspense>
|
|
3433
|
+
// ),
|
|
3434
|
+
// }))
|
|
3435
|
+
// ),
|
|
3436
|
+
...[...getEERoutes(), ...ROUTES_CE].filter(
|
|
3437
|
+
(route, index, refArray) => refArray.findIndex((obj) => obj.path === route.path) === index
|
|
3438
|
+
)
|
|
3439
|
+
]
|
|
3440
|
+
}
|
|
3441
|
+
];
|
|
3442
|
+
|
|
3443
|
+
class Router {
|
|
3444
|
+
_routes = [];
|
|
3445
|
+
router = null;
|
|
3446
|
+
_menu = [];
|
|
3447
|
+
_settings = {
|
|
3448
|
+
global: {
|
|
3449
|
+
id: "global",
|
|
3450
|
+
intlLabel: {
|
|
3451
|
+
id: "Settings.global",
|
|
3452
|
+
defaultMessage: "Global Settings"
|
|
3453
|
+
},
|
|
3454
|
+
links: []
|
|
3455
|
+
}
|
|
3456
|
+
};
|
|
3457
|
+
constructor(initialRoutes) {
|
|
3458
|
+
this._routes = initialRoutes;
|
|
3459
|
+
}
|
|
3460
|
+
get routes() {
|
|
3461
|
+
return this._routes;
|
|
3462
|
+
}
|
|
3463
|
+
get menu() {
|
|
3464
|
+
return this._menu;
|
|
3465
|
+
}
|
|
3466
|
+
get settings() {
|
|
3467
|
+
return this._settings;
|
|
3468
|
+
}
|
|
3469
|
+
/**
|
|
3470
|
+
* @internal This method is used internally by Strapi to create the router.
|
|
3471
|
+
* It should not be used by plugins, doing so will likely break the application.
|
|
3472
|
+
*/
|
|
3473
|
+
createRouter(strapi, { memory, ...opts } = {}) {
|
|
3474
|
+
const routes = [
|
|
3475
|
+
{
|
|
3476
|
+
path: "/*",
|
|
3477
|
+
errorElement: /* @__PURE__ */ jsxRuntime.jsx(reactRedux.Provider, { store: strapi.store, children: /* @__PURE__ */ jsxRuntime.jsx(Theme.LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsxRuntime.jsx(Theme.Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorElement, {}) }) }) }),
|
|
3478
|
+
element: /* @__PURE__ */ jsxRuntime.jsx(App, { strapi, store: strapi.store }),
|
|
3479
|
+
children: [
|
|
3480
|
+
...getImmutableRoutes(),
|
|
3481
|
+
{
|
|
3482
|
+
path: "/*",
|
|
3483
|
+
lazy: async () => {
|
|
3484
|
+
const { PrivateAdminLayout } = await Promise.resolve().then(() => require('./AuthenticatedLayout-Vvio5wiC.js'));
|
|
3485
|
+
return {
|
|
3486
|
+
Component: PrivateAdminLayout
|
|
3487
|
+
};
|
|
3488
|
+
},
|
|
3489
|
+
children: [
|
|
3490
|
+
...this.routes,
|
|
3491
|
+
{
|
|
3492
|
+
path: "*",
|
|
3493
|
+
element: /* @__PURE__ */ jsxRuntime.jsx(NotFoundPage, {})
|
|
3494
|
+
}
|
|
3495
|
+
]
|
|
3496
|
+
}
|
|
3497
|
+
]
|
|
3498
|
+
}
|
|
3499
|
+
];
|
|
3500
|
+
if (memory) {
|
|
3501
|
+
this.router = reactRouterDom.createMemoryRouter(routes, opts);
|
|
3502
|
+
} else {
|
|
3503
|
+
this.router = reactRouterDom.createBrowserRouter(routes, opts);
|
|
3504
|
+
}
|
|
3505
|
+
return this.router;
|
|
3506
|
+
}
|
|
3507
|
+
addMenuLink = (link) => {
|
|
3508
|
+
invariant__default.default(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3509
|
+
invariant__default.default(
|
|
3510
|
+
typeof link.to === "string",
|
|
3511
|
+
`[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
|
|
3512
|
+
);
|
|
3513
|
+
invariant__default.default(
|
|
3514
|
+
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3515
|
+
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
|
|
3516
|
+
);
|
|
3517
|
+
invariant__default.default(
|
|
3518
|
+
!link.Component || link.Component && typeof link.Component === "function",
|
|
3519
|
+
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
|
|
3520
|
+
);
|
|
3521
|
+
if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3522
|
+
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3523
|
+
console.warn(
|
|
3524
|
+
`
|
|
3525
|
+
[${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.
|
|
3526
|
+
`.trim()
|
|
3527
|
+
);
|
|
3528
|
+
}
|
|
3529
|
+
if (link.to.startsWith("/")) {
|
|
3530
|
+
console.warn(
|
|
3531
|
+
`[${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.`
|
|
3532
|
+
);
|
|
3533
|
+
link.to = link.to.slice(1);
|
|
3534
|
+
}
|
|
3535
|
+
const { Component, ...restLink } = link;
|
|
3536
|
+
if (Component) {
|
|
3537
|
+
this._routes.push({
|
|
3538
|
+
path: `${link.to}/*`,
|
|
3539
|
+
lazy: async () => {
|
|
3540
|
+
const mod = await Component();
|
|
3541
|
+
if ("default" in mod) {
|
|
3542
|
+
return { Component: mod.default };
|
|
3543
|
+
} else {
|
|
3544
|
+
return { Component: mod };
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
});
|
|
3548
|
+
}
|
|
3549
|
+
this.menu.push(restLink);
|
|
3550
|
+
};
|
|
3551
|
+
addSettingsLink(section, link) {
|
|
3552
|
+
if (typeof section === "object" && "links" in section) {
|
|
3553
|
+
invariant__default.default(section.id, "section.id should be defined");
|
|
3554
|
+
invariant__default.default(
|
|
3555
|
+
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3556
|
+
"section.intlLabel should be defined"
|
|
3557
|
+
);
|
|
3558
|
+
invariant__default.default(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3559
|
+
invariant__default.default(Array.isArray(section.links), "TypeError expected links to be an array");
|
|
3560
|
+
this.settings[section.id] = { ...section, links: [] };
|
|
3561
|
+
section.links.forEach((link2) => {
|
|
3562
|
+
this.createSettingsLink(section.id, link2);
|
|
3563
|
+
});
|
|
3564
|
+
} else if (typeof section === "object" && link) {
|
|
3565
|
+
invariant__default.default(section.id, "section.id should be defined");
|
|
3566
|
+
invariant__default.default(
|
|
3567
|
+
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3568
|
+
"section.intlLabel should be defined"
|
|
3569
|
+
);
|
|
3570
|
+
invariant__default.default(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3571
|
+
this.settings[section.id] = { ...section, links: [] };
|
|
3572
|
+
if (Array.isArray(link)) {
|
|
3573
|
+
link.forEach((l) => this.createSettingsLink(section.id, l));
|
|
3574
|
+
} else {
|
|
3575
|
+
this.createSettingsLink(section.id, link);
|
|
3576
|
+
}
|
|
3577
|
+
} else if (typeof section === "string" && link) {
|
|
3578
|
+
if (Array.isArray(link)) {
|
|
3579
|
+
link.forEach((l) => this.createSettingsLink(section, l));
|
|
3580
|
+
} else {
|
|
3581
|
+
this.createSettingsLink(section, link);
|
|
3582
|
+
}
|
|
3583
|
+
} else {
|
|
3584
|
+
throw new Error(
|
|
3585
|
+
"Invalid arguments provided to addSettingsLink, at minimum a sectionId and link are required."
|
|
3586
|
+
);
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
createSettingsLink = (sectionId, link) => {
|
|
3590
|
+
invariant__default.default(this._settings[sectionId], "The section does not exist");
|
|
3591
|
+
invariant__default.default(link.id, `[${link.intlLabel.defaultMessage}]: link.id should be defined`);
|
|
3592
|
+
invariant__default.default(
|
|
3593
|
+
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3594
|
+
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
|
|
3595
|
+
);
|
|
3596
|
+
invariant__default.default(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3597
|
+
invariant__default.default(
|
|
3598
|
+
!link.Component || link.Component && typeof link.Component === "function",
|
|
3599
|
+
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
|
|
3600
|
+
);
|
|
3601
|
+
if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3602
|
+
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3603
|
+
console.warn(
|
|
3604
|
+
`
|
|
3605
|
+
[${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.
|
|
3606
|
+
`.trim()
|
|
3607
|
+
);
|
|
3608
|
+
}
|
|
3609
|
+
if (link.to.startsWith("/")) {
|
|
3610
|
+
console.warn(
|
|
3611
|
+
`[${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.`
|
|
3612
|
+
);
|
|
3613
|
+
link.to = link.to.slice(1);
|
|
3614
|
+
}
|
|
3615
|
+
if (link.to.split("/")[0] === "settings") {
|
|
3616
|
+
console.warn(
|
|
3617
|
+
`[${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.`
|
|
3618
|
+
);
|
|
3619
|
+
link.to = link.to.split("/").slice(1).join("/");
|
|
3620
|
+
}
|
|
3621
|
+
const { Component, ...restLink } = link;
|
|
3622
|
+
const settingsIndex = this._routes.findIndex((route) => route.path === "settings/*");
|
|
3623
|
+
if (!settingsIndex) {
|
|
3624
|
+
console.warn(
|
|
3625
|
+
"A third party plugin has removed the settings section, the settings link cannot be added."
|
|
3626
|
+
);
|
|
3627
|
+
return;
|
|
3628
|
+
} else if (!this._routes[settingsIndex].children) {
|
|
3629
|
+
this._routes[settingsIndex].children = [];
|
|
3630
|
+
}
|
|
3631
|
+
if (Component) {
|
|
3632
|
+
this._routes[settingsIndex].children.push({
|
|
3633
|
+
path: `${link.to}/*`,
|
|
3634
|
+
lazy: async () => {
|
|
3635
|
+
const mod = await Component();
|
|
3636
|
+
if ("default" in mod) {
|
|
3637
|
+
return { Component: mod.default };
|
|
3638
|
+
} else {
|
|
3639
|
+
return { Component: mod };
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
});
|
|
3643
|
+
}
|
|
3644
|
+
this._settings[sectionId].links.push(restLink);
|
|
3645
|
+
};
|
|
3646
|
+
/**
|
|
3647
|
+
* @alpha
|
|
3648
|
+
* @description Adds a route or an array of routes to the router.
|
|
3649
|
+
* Otherwise, pass a function that receives the current routes and
|
|
3650
|
+
* returns the new routes in a reducer like fashion.
|
|
3651
|
+
*/
|
|
3652
|
+
addRoute(route) {
|
|
3653
|
+
if (Array.isArray(route)) {
|
|
3654
|
+
this._routes = [...this._routes, ...route];
|
|
3655
|
+
} else if (typeof route === "object" && route !== null) {
|
|
3656
|
+
this._routes.push(route);
|
|
3657
|
+
} else if (typeof route === "function") {
|
|
3658
|
+
this._routes = route(this._routes);
|
|
3659
|
+
} else {
|
|
3660
|
+
throw new Error(
|
|
3661
|
+
`Expected the \`route\` passed to \`addRoute\` to be an array or a function, but received ${getPrintableType(
|
|
3662
|
+
route
|
|
3663
|
+
)}`
|
|
3664
|
+
);
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
const getPrintableType = (value) => {
|
|
3669
|
+
const nativeType = typeof value;
|
|
3670
|
+
if (nativeType === "object") {
|
|
3671
|
+
if (value === null)
|
|
3672
|
+
return "null";
|
|
3673
|
+
if (Array.isArray(value))
|
|
3674
|
+
return "array";
|
|
3675
|
+
if (value instanceof Object && value.constructor.name !== "Object") {
|
|
3676
|
+
return value.constructor.name;
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
return nativeType;
|
|
3680
|
+
};
|
|
3681
|
+
|
|
3682
|
+
const staticReducers = {
|
|
3683
|
+
[admin.adminApi.reducerPath]: admin.adminApi.reducer,
|
|
3684
|
+
admin_app: Theme.reducer
|
|
3685
|
+
};
|
|
3686
|
+
const injectReducerStoreEnhancer = (appReducers) => (next) => (...args) => {
|
|
3687
|
+
const store = next(...args);
|
|
3688
|
+
const asyncReducers = {};
|
|
3689
|
+
return {
|
|
3690
|
+
...store,
|
|
3691
|
+
asyncReducers,
|
|
3692
|
+
injectReducer: (key, asyncReducer) => {
|
|
3693
|
+
asyncReducers[key] = asyncReducer;
|
|
3694
|
+
store.replaceReducer(
|
|
3695
|
+
// @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
|
|
3696
|
+
toolkit.combineReducers({
|
|
3697
|
+
...appReducers,
|
|
3698
|
+
...asyncReducers
|
|
3699
|
+
})
|
|
3700
|
+
);
|
|
3701
|
+
}
|
|
3702
|
+
};
|
|
3703
|
+
};
|
|
3704
|
+
const configureStoreImpl = (preloadedState = {}, appMiddlewares = [], injectedReducers = {}) => {
|
|
3705
|
+
const coreReducers = { ...staticReducers, ...injectedReducers };
|
|
3706
|
+
const defaultMiddlewareOptions = {};
|
|
3707
|
+
if (process.env.NODE_ENV === "test") {
|
|
3708
|
+
defaultMiddlewareOptions.serializableCheck = false;
|
|
3709
|
+
defaultMiddlewareOptions.immutableCheck = false;
|
|
3710
|
+
}
|
|
3711
|
+
const store = toolkit.configureStore({
|
|
3712
|
+
preloadedState: {
|
|
3713
|
+
admin_app: preloadedState.admin_app
|
|
3714
|
+
},
|
|
3715
|
+
reducer: coreReducers,
|
|
3716
|
+
devTools: process.env.NODE_ENV !== "production",
|
|
3717
|
+
middleware: (getDefaultMiddleware) => [
|
|
3718
|
+
...getDefaultMiddleware(defaultMiddlewareOptions),
|
|
3719
|
+
admin.adminApi.middleware,
|
|
3720
|
+
...appMiddlewares.map((m) => m())
|
|
3721
|
+
],
|
|
3722
|
+
enhancers: [injectReducerStoreEnhancer(coreReducers)]
|
|
3723
|
+
});
|
|
3724
|
+
return store;
|
|
3725
|
+
};
|
|
3726
|
+
|
|
3727
|
+
const getBasename = () => (process.env.ADMIN_PATH ?? "").replace(window.location.origin, "");
|
|
3728
|
+
|
|
3729
|
+
const createHook = () => {
|
|
3730
|
+
const _handlers = [];
|
|
3731
|
+
return {
|
|
3732
|
+
register(fn) {
|
|
3733
|
+
_handlers.push(fn);
|
|
3354
3734
|
},
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
{
|
|
3358
|
-
lazy: async () => {
|
|
3359
|
-
const { ProtectedCreateView } = await Promise.resolve().then(() => require('./CreateView-JQYIo77z.js'));
|
|
3360
|
-
return {
|
|
3361
|
-
Component: ProtectedCreateView
|
|
3362
|
-
};
|
|
3735
|
+
delete(handler) {
|
|
3736
|
+
_handlers.splice(_handlers.indexOf(handler), 1);
|
|
3363
3737
|
},
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
{
|
|
3367
|
-
lazy: async () => {
|
|
3368
|
-
const { ProtectedListView } = await Promise.resolve().then(() => require('./ListView-nRGxAwIh.js'));
|
|
3369
|
-
return {
|
|
3370
|
-
Component: ProtectedListView
|
|
3371
|
-
};
|
|
3738
|
+
runWaterfall(args, store) {
|
|
3739
|
+
return _handlers.reduce((acc, fn) => fn(acc, store), args);
|
|
3372
3740
|
},
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
return
|
|
3379
|
-
Component: ProtectedEditView
|
|
3380
|
-
};
|
|
3741
|
+
async runWaterfallAsync(args, store) {
|
|
3742
|
+
let result = args;
|
|
3743
|
+
for (const fn of _handlers) {
|
|
3744
|
+
result = await fn(result, store);
|
|
3745
|
+
}
|
|
3746
|
+
return result;
|
|
3381
3747
|
},
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
{
|
|
3385
|
-
lazy: async () => {
|
|
3386
|
-
const { PurchaseAuditLogs } = await Promise.resolve().then(() => require('./PurchaseAuditLogs-Vur69JZB.js'));
|
|
3387
|
-
return {
|
|
3388
|
-
Component: PurchaseAuditLogs
|
|
3389
|
-
};
|
|
3748
|
+
runSeries(...args) {
|
|
3749
|
+
return _handlers.map((fn) => fn(...args));
|
|
3390
3750
|
},
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
return
|
|
3397
|
-
Component: PurchaseSingleSignOn
|
|
3398
|
-
};
|
|
3751
|
+
async runSeriesAsync(...args) {
|
|
3752
|
+
const result = [];
|
|
3753
|
+
for (const fn of _handlers) {
|
|
3754
|
+
result.push(await fn(...args));
|
|
3755
|
+
}
|
|
3756
|
+
return result;
|
|
3399
3757
|
},
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3758
|
+
runParallel(...args) {
|
|
3759
|
+
return Promise.all(
|
|
3760
|
+
_handlers.map((fn) => {
|
|
3761
|
+
return fn(...args);
|
|
3762
|
+
})
|
|
3763
|
+
);
|
|
3764
|
+
}
|
|
3765
|
+
};
|
|
3766
|
+
};
|
|
3403
3767
|
|
|
3404
3768
|
const languageNativeNames = {
|
|
3405
3769
|
ar: "العربية",
|
|
@@ -3452,20 +3816,6 @@ class StrapiApp {
|
|
|
3452
3816
|
injectionZones: {}
|
|
3453
3817
|
};
|
|
3454
3818
|
translations = {};
|
|
3455
|
-
/**
|
|
3456
|
-
* MENU API
|
|
3457
|
-
*/
|
|
3458
|
-
menu = [];
|
|
3459
|
-
settings = {
|
|
3460
|
-
global: {
|
|
3461
|
-
id: "global",
|
|
3462
|
-
intlLabel: {
|
|
3463
|
-
id: "Settings.global",
|
|
3464
|
-
defaultMessage: "Global Settings"
|
|
3465
|
-
},
|
|
3466
|
-
links: []
|
|
3467
|
-
}
|
|
3468
|
-
};
|
|
3469
3819
|
configurations = {
|
|
3470
3820
|
authLogo: StrapiLogo,
|
|
3471
3821
|
head: { favicon: "" },
|
|
@@ -3479,13 +3829,15 @@ class StrapiApp {
|
|
|
3479
3829
|
/**
|
|
3480
3830
|
* APIs
|
|
3481
3831
|
*/
|
|
3482
|
-
rbac = new
|
|
3832
|
+
rbac = new Theme.RBAC();
|
|
3833
|
+
router;
|
|
3483
3834
|
library = {
|
|
3484
3835
|
components: {},
|
|
3485
3836
|
fields: {}
|
|
3486
3837
|
};
|
|
3487
3838
|
middlewares = [];
|
|
3488
3839
|
reducers = {};
|
|
3840
|
+
store = null;
|
|
3489
3841
|
customFields = new CustomFields();
|
|
3490
3842
|
constructor({ config, appPlugins } = {}) {
|
|
3491
3843
|
this.appPlugins = appPlugins || {};
|
|
@@ -3494,6 +3846,7 @@ class StrapiApp {
|
|
|
3494
3846
|
this.createHook(MUTATE_COLLECTION_TYPES_LINKS);
|
|
3495
3847
|
this.createHook(MUTATE_SINGLE_TYPES_LINKS);
|
|
3496
3848
|
this.createHook(MUTATE_EDIT_VIEW_LAYOUT);
|
|
3849
|
+
this.router = new Router(getInitialRoutes());
|
|
3497
3850
|
}
|
|
3498
3851
|
addComponents = (components) => {
|
|
3499
3852
|
if (Array.isArray(components)) {
|
|
@@ -3521,46 +3874,6 @@ class StrapiApp {
|
|
|
3521
3874
|
this.library.fields[fields.type] = fields.Component;
|
|
3522
3875
|
}
|
|
3523
3876
|
};
|
|
3524
|
-
addMenuLink = (link) => {
|
|
3525
|
-
invariant__default.default(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3526
|
-
invariant__default.default(
|
|
3527
|
-
typeof link.to === "string",
|
|
3528
|
-
`[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
|
|
3529
|
-
);
|
|
3530
|
-
invariant__default.default(
|
|
3531
|
-
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3532
|
-
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
|
|
3533
|
-
);
|
|
3534
|
-
invariant__default.default(
|
|
3535
|
-
link.Component && typeof link.Component === "function",
|
|
3536
|
-
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
|
|
3537
|
-
);
|
|
3538
|
-
if (link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3539
|
-
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3540
|
-
console.warn(
|
|
3541
|
-
`
|
|
3542
|
-
[${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.
|
|
3543
|
-
`.trim()
|
|
3544
|
-
);
|
|
3545
|
-
}
|
|
3546
|
-
if (link.to.startsWith("/")) {
|
|
3547
|
-
console.warn(
|
|
3548
|
-
`[${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.`
|
|
3549
|
-
);
|
|
3550
|
-
link.to = link.to.slice(1);
|
|
3551
|
-
}
|
|
3552
|
-
this.menu.push({
|
|
3553
|
-
...link,
|
|
3554
|
-
Component: React__namespace.lazy(async () => {
|
|
3555
|
-
const mod = await link.Component();
|
|
3556
|
-
if ("default" in mod) {
|
|
3557
|
-
return mod;
|
|
3558
|
-
} else {
|
|
3559
|
-
return { default: mod };
|
|
3560
|
-
}
|
|
3561
|
-
})
|
|
3562
|
-
});
|
|
3563
|
-
};
|
|
3564
3877
|
addMiddlewares = (middlewares) => {
|
|
3565
3878
|
middlewares.forEach((middleware) => {
|
|
3566
3879
|
this.middlewares.push(middleware);
|
|
@@ -3578,56 +3891,22 @@ class StrapiApp {
|
|
|
3578
3891
|
this.reducers[name] = reducer;
|
|
3579
3892
|
});
|
|
3580
3893
|
};
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
|
|
3587
|
-
);
|
|
3588
|
-
invariant__default.default(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3589
|
-
invariant__default.default(
|
|
3590
|
-
link.Component && typeof link.Component === "function",
|
|
3591
|
-
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
|
|
3592
|
-
);
|
|
3593
|
-
if (link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3594
|
-
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3595
|
-
console.warn(
|
|
3596
|
-
`
|
|
3597
|
-
[${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.
|
|
3598
|
-
`.trim()
|
|
3599
|
-
);
|
|
3600
|
-
}
|
|
3601
|
-
if (link.to.startsWith("/")) {
|
|
3602
|
-
console.warn(
|
|
3603
|
-
`[${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.`
|
|
3604
|
-
);
|
|
3605
|
-
link.to = link.to.slice(1);
|
|
3606
|
-
}
|
|
3607
|
-
if (link.to.split("/")[0] === "settings") {
|
|
3608
|
-
console.warn(
|
|
3609
|
-
`[${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.`
|
|
3610
|
-
);
|
|
3611
|
-
link.to = link.to.split("/").slice(1).join("/");
|
|
3612
|
-
}
|
|
3613
|
-
this.settings[sectionId].links.push({
|
|
3614
|
-
...link,
|
|
3615
|
-
Component: React__namespace.lazy(async () => {
|
|
3616
|
-
const mod = await link.Component();
|
|
3617
|
-
if ("default" in mod) {
|
|
3618
|
-
return mod;
|
|
3619
|
-
} else {
|
|
3620
|
-
return { default: mod };
|
|
3621
|
-
}
|
|
3622
|
-
})
|
|
3623
|
-
});
|
|
3624
|
-
};
|
|
3894
|
+
addMenuLink = (link) => this.router.addMenuLink(link);
|
|
3895
|
+
/**
|
|
3896
|
+
* @deprecated use `addSettingsLink` instead, it internally supports
|
|
3897
|
+
* adding multiple links at once.
|
|
3898
|
+
*/
|
|
3625
3899
|
addSettingsLinks = (sectionId, links) => {
|
|
3626
|
-
invariant__default.default(this.settings[sectionId], "The section does not exist");
|
|
3627
3900
|
invariant__default.default(Array.isArray(links), "TypeError expected links to be an array");
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3901
|
+
this.router.addSettingsLink(sectionId, links);
|
|
3902
|
+
};
|
|
3903
|
+
/**
|
|
3904
|
+
* @deprecated use `addSettingsLink` instead, you can pass a section object to
|
|
3905
|
+
* create the section and links at the same time.
|
|
3906
|
+
*/
|
|
3907
|
+
createSettingSection = (section, links) => this.router.addSettingsLink(section, links);
|
|
3908
|
+
addSettingsLink = (sectionId, link) => {
|
|
3909
|
+
this.router.addSettingsLink(sectionId, link);
|
|
3631
3910
|
};
|
|
3632
3911
|
async bootstrap(customBootstrap) {
|
|
3633
3912
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
@@ -3694,19 +3973,6 @@ class StrapiApp {
|
|
|
3694
3973
|
createHook = (name) => {
|
|
3695
3974
|
this.hooksDict[name] = createHook();
|
|
3696
3975
|
};
|
|
3697
|
-
createSettingSection = (section, links) => {
|
|
3698
|
-
invariant__default.default(section.id, "section.id should be defined");
|
|
3699
|
-
invariant__default.default(
|
|
3700
|
-
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3701
|
-
"section.intlLabel should be defined"
|
|
3702
|
-
);
|
|
3703
|
-
invariant__default.default(Array.isArray(links), "TypeError expected links to be an array");
|
|
3704
|
-
invariant__default.default(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3705
|
-
this.settings[section.id] = { ...section, links: [] };
|
|
3706
|
-
links.forEach((link) => {
|
|
3707
|
-
this.addSettingsLink(section.id, link);
|
|
3708
|
-
});
|
|
3709
|
-
};
|
|
3710
3976
|
getAdminInjectedComponents = (moduleName, containerName, blockName) => {
|
|
3711
3977
|
try {
|
|
3712
3978
|
return this.admin.injectionZones[moduleName][containerName][blockName] || [];
|
|
@@ -3716,10 +3982,13 @@ class StrapiApp {
|
|
|
3716
3982
|
}
|
|
3717
3983
|
};
|
|
3718
3984
|
getPlugin = (pluginId) => this.plugins[pluginId];
|
|
3719
|
-
async register() {
|
|
3985
|
+
async register(customRegister) {
|
|
3720
3986
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
3721
3987
|
this.appPlugins[plugin].register(this);
|
|
3722
3988
|
});
|
|
3989
|
+
if (isFunction__default.default(customRegister)) {
|
|
3990
|
+
customRegister(this);
|
|
3991
|
+
}
|
|
3723
3992
|
}
|
|
3724
3993
|
async loadAdminTrads() {
|
|
3725
3994
|
const adminLocales = await Promise.all(
|
|
@@ -3798,14 +4067,14 @@ class StrapiApp {
|
|
|
3798
4067
|
runHookParallel = (name) => this.hooksDict[name].runParallel();
|
|
3799
4068
|
render() {
|
|
3800
4069
|
const localeNames = pick__default.default(languageNativeNames, this.configurations.locales || []);
|
|
3801
|
-
const locale = localStorage.getItem(
|
|
3802
|
-
|
|
4070
|
+
const locale = localStorage.getItem(Theme.LANGUAGE_LOCAL_STORAGE_KEY) || "en";
|
|
4071
|
+
this.store = configureStoreImpl(
|
|
3803
4072
|
{
|
|
3804
4073
|
admin_app: {
|
|
3805
4074
|
permissions: merge__default.default({}, ADMIN_PERMISSIONS_CE, ADMIN_PERMISSIONS_EE),
|
|
3806
4075
|
theme: {
|
|
3807
4076
|
availableThemes: [],
|
|
3808
|
-
currentTheme: localStorage.getItem(
|
|
4077
|
+
currentTheme: localStorage.getItem(Theme.THEME_LOCAL_STORAGE_KEY) || "system"
|
|
3809
4078
|
},
|
|
3810
4079
|
language: {
|
|
3811
4080
|
locale: localeNames[locale] ? locale : "en",
|
|
@@ -3816,120 +4085,9 @@ class StrapiApp {
|
|
|
3816
4085
|
this.middlewares,
|
|
3817
4086
|
this.reducers
|
|
3818
4087
|
);
|
|
3819
|
-
const
|
|
3820
|
-
|
|
3821
|
-
);
|
|
3822
|
-
const router = reactRouterDom.createBrowserRouter(
|
|
3823
|
-
[
|
|
3824
|
-
{
|
|
3825
|
-
path: "/*",
|
|
3826
|
-
errorElement: /* @__PURE__ */ jsxRuntime.jsx(reactRedux.Provider, { store, children: /* @__PURE__ */ jsxRuntime.jsx(rbac.LanguageProvider, { messages: this.configurations.translations, children: /* @__PURE__ */ jsxRuntime.jsx(rbac.Theme, { themes: this.configurations.themes, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorElement, {}) }) }) }),
|
|
3827
|
-
element: /* @__PURE__ */ jsxRuntime.jsx(App, { strapi: this, store }),
|
|
3828
|
-
children: [
|
|
3829
|
-
{
|
|
3830
|
-
path: "usecase",
|
|
3831
|
-
lazy: async () => {
|
|
3832
|
-
const { PrivateUseCasePage } = await Promise.resolve().then(() => require('./UseCasePage-26Y6U1DU.js'));
|
|
3833
|
-
return {
|
|
3834
|
-
Component: PrivateUseCasePage
|
|
3835
|
-
};
|
|
3836
|
-
}
|
|
3837
|
-
},
|
|
3838
|
-
// this needs to go before auth/:authType because otherwise it won't match the route
|
|
3839
|
-
...getEERoutes$1(),
|
|
3840
|
-
{
|
|
3841
|
-
path: "auth/:authType",
|
|
3842
|
-
element: /* @__PURE__ */ jsxRuntime.jsx(AuthPage, {})
|
|
3843
|
-
},
|
|
3844
|
-
{
|
|
3845
|
-
path: "/*",
|
|
3846
|
-
lazy: async () => {
|
|
3847
|
-
const { PrivateAdminLayout } = await Promise.resolve().then(() => require('./AuthenticatedLayout-s7jnYVG9.js'));
|
|
3848
|
-
return {
|
|
3849
|
-
Component: PrivateAdminLayout
|
|
3850
|
-
};
|
|
3851
|
-
},
|
|
3852
|
-
children: [
|
|
3853
|
-
{
|
|
3854
|
-
index: true,
|
|
3855
|
-
lazy: async () => {
|
|
3856
|
-
const { HomePage } = await Promise.resolve().then(() => require('./HomePage-Xrg1dR_D.js'));
|
|
3857
|
-
return {
|
|
3858
|
-
Component: HomePage
|
|
3859
|
-
};
|
|
3860
|
-
}
|
|
3861
|
-
},
|
|
3862
|
-
{
|
|
3863
|
-
path: "me",
|
|
3864
|
-
lazy: async () => {
|
|
3865
|
-
const { ProfilePage } = await Promise.resolve().then(() => require('./ProfilePage-o028o7JD.js'));
|
|
3866
|
-
return {
|
|
3867
|
-
Component: ProfilePage
|
|
3868
|
-
};
|
|
3869
|
-
}
|
|
3870
|
-
},
|
|
3871
|
-
{
|
|
3872
|
-
path: "list-plugins",
|
|
3873
|
-
lazy: async () => {
|
|
3874
|
-
const { ProtectedInstalledPluginsPage } = await Promise.resolve().then(() => require('./InstalledPluginsPage-alfcy8jO.js'));
|
|
3875
|
-
return {
|
|
3876
|
-
Component: ProtectedInstalledPluginsPage
|
|
3877
|
-
};
|
|
3878
|
-
}
|
|
3879
|
-
},
|
|
3880
|
-
{
|
|
3881
|
-
path: "marketplace",
|
|
3882
|
-
lazy: async () => {
|
|
3883
|
-
const { ProtectedMarketplacePage } = await Promise.resolve().then(() => require('./MarketplacePage-vQaaicxu.js'));
|
|
3884
|
-
return {
|
|
3885
|
-
Component: ProtectedMarketplacePage
|
|
3886
|
-
};
|
|
3887
|
-
}
|
|
3888
|
-
},
|
|
3889
|
-
{
|
|
3890
|
-
path: "settings/*",
|
|
3891
|
-
lazy: async () => {
|
|
3892
|
-
const { Layout } = await Promise.resolve().then(() => require('./Layout-RKjEsOtu.js'));
|
|
3893
|
-
return {
|
|
3894
|
-
Component: Layout
|
|
3895
|
-
};
|
|
3896
|
-
},
|
|
3897
|
-
children: [
|
|
3898
|
-
{
|
|
3899
|
-
path: "application-infos",
|
|
3900
|
-
lazy: async () => {
|
|
3901
|
-
const { ApplicationInfoPage } = await Promise.resolve().then(() => require('./ApplicationInfoPage-S_AoXyUe.js'));
|
|
3902
|
-
return {
|
|
3903
|
-
Component: ApplicationInfoPage
|
|
3904
|
-
};
|
|
3905
|
-
}
|
|
3906
|
-
},
|
|
3907
|
-
...Object.values(this.settings).flatMap(
|
|
3908
|
-
({ links }) => links.map(({ to, Component }) => ({
|
|
3909
|
-
path: `${to}/*`,
|
|
3910
|
-
element: /* @__PURE__ */ jsxRuntime.jsx(React__namespace.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(rbac.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(Component, {}) })
|
|
3911
|
-
}))
|
|
3912
|
-
),
|
|
3913
|
-
...settingsRoutes
|
|
3914
|
-
]
|
|
3915
|
-
},
|
|
3916
|
-
...this.menu.map(({ to, Component }) => ({
|
|
3917
|
-
path: `${to}/*`,
|
|
3918
|
-
element: /* @__PURE__ */ jsxRuntime.jsx(React__namespace.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(rbac.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(Component, {}) })
|
|
3919
|
-
})),
|
|
3920
|
-
{
|
|
3921
|
-
path: "*",
|
|
3922
|
-
element: /* @__PURE__ */ jsxRuntime.jsx(NotFoundPage, {})
|
|
3923
|
-
}
|
|
3924
|
-
]
|
|
3925
|
-
}
|
|
3926
|
-
]
|
|
3927
|
-
}
|
|
3928
|
-
],
|
|
3929
|
-
{
|
|
3930
|
-
basename: getBasename()
|
|
3931
|
-
}
|
|
3932
|
-
);
|
|
4088
|
+
const router = this.router.createRouter(this, {
|
|
4089
|
+
basename: getBasename()
|
|
4090
|
+
});
|
|
3933
4091
|
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.RouterProvider, { router });
|
|
3934
4092
|
}
|
|
3935
4093
|
}
|
|
@@ -3991,7 +4149,7 @@ const renderAdmin = async (mountNode, { plugins, customisations, features }) =>
|
|
|
3991
4149
|
config: customisations?.config,
|
|
3992
4150
|
appPlugins: plugins
|
|
3993
4151
|
});
|
|
3994
|
-
await app.register();
|
|
4152
|
+
await app.register(customisations?.register);
|
|
3995
4153
|
await app.bootstrap(customisations?.bootstrap);
|
|
3996
4154
|
await app.loadTrads(customisations?.config?.translations);
|
|
3997
4155
|
client.createRoot(mountNode).render(app.render());
|
|
@@ -4380,7 +4538,7 @@ const useQueryParams = (initialParams) => {
|
|
|
4380
4538
|
return [{ query, rawQuery: search }, setQuery];
|
|
4381
4539
|
};
|
|
4382
4540
|
|
|
4383
|
-
const [FiltersProvider, useFilters] =
|
|
4541
|
+
const [FiltersProvider, useFilters] = Theme.createContext("Filters");
|
|
4384
4542
|
const Root$2 = ({
|
|
4385
4543
|
children,
|
|
4386
4544
|
disabled = false,
|
|
@@ -4704,7 +4862,7 @@ const Filters = {
|
|
|
4704
4862
|
Trigger
|
|
4705
4863
|
};
|
|
4706
4864
|
|
|
4707
|
-
const [PaginationProvider, usePagination] =
|
|
4865
|
+
const [PaginationProvider, usePagination] = Theme.createContext("Pagination");
|
|
4708
4866
|
const Root$1 = React__namespace.forwardRef(
|
|
4709
4867
|
({ children, defaultPageSize = 10, pageCount = 0, defaultPage = 1, onPageSizeChange, total = 0 }, forwardedRef) => {
|
|
4710
4868
|
const [{ query }, setQuery] = useQueryParams(
|
|
@@ -4719,18 +4877,28 @@ const Root$1 = React__namespace.forwardRef(
|
|
|
4719
4877
|
onPageSizeChange(pageSize);
|
|
4720
4878
|
}
|
|
4721
4879
|
};
|
|
4722
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4723
|
-
|
|
4880
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4881
|
+
designSystem.Flex,
|
|
4724
4882
|
{
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4883
|
+
ref: forwardedRef,
|
|
4884
|
+
paddingTop: 4,
|
|
4885
|
+
paddingBottom: 4,
|
|
4886
|
+
alignItems: "flex-end",
|
|
4887
|
+
justifyContent: "space-between",
|
|
4888
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4889
|
+
PaginationProvider,
|
|
4890
|
+
{
|
|
4891
|
+
currentQuery: query,
|
|
4892
|
+
page: query.page,
|
|
4893
|
+
pageSize: query.pageSize,
|
|
4894
|
+
pageCount: pageCount.toString(),
|
|
4895
|
+
setPageSize,
|
|
4896
|
+
total,
|
|
4897
|
+
children
|
|
4898
|
+
}
|
|
4899
|
+
)
|
|
4732
4900
|
}
|
|
4733
|
-
)
|
|
4901
|
+
);
|
|
4734
4902
|
}
|
|
4735
4903
|
);
|
|
4736
4904
|
const PageSize = ({ options = ["10", "20", "50", "100"] }) => {
|
|
@@ -4861,7 +5029,7 @@ const SearchInput = ({
|
|
|
4861
5029
|
const [value, setValue] = React__namespace.useState(query?._q || "");
|
|
4862
5030
|
const [isOpen, setIsOpen] = React__namespace.useState(!!value);
|
|
4863
5031
|
const { formatMessage } = reactIntl.useIntl();
|
|
4864
|
-
const { trackUsage } =
|
|
5032
|
+
const { trackUsage } = Theme.useTracking();
|
|
4865
5033
|
const handleToggle = () => setIsOpen((prev) => !prev);
|
|
4866
5034
|
React__namespace.useLayoutEffect(() => {
|
|
4867
5035
|
if (isOpen && inputRef.current) {
|
|
@@ -4911,7 +5079,7 @@ const SearchInput = ({
|
|
|
4911
5079
|
);
|
|
4912
5080
|
};
|
|
4913
5081
|
|
|
4914
|
-
const [TableProvider, useTable] =
|
|
5082
|
+
const [TableProvider, useTable] = Theme.createContext("Table");
|
|
4915
5083
|
const Root = ({
|
|
4916
5084
|
children,
|
|
4917
5085
|
defaultSelectedRows,
|
|
@@ -5141,7 +5309,7 @@ const Table = {
|
|
|
5141
5309
|
};
|
|
5142
5310
|
|
|
5143
5311
|
function useInjectReducer(namespace, reducer) {
|
|
5144
|
-
const store =
|
|
5312
|
+
const store = Theme.useTypedStore();
|
|
5145
5313
|
React.useEffect(() => {
|
|
5146
5314
|
store.injectReducer(namespace, reducer);
|
|
5147
5315
|
}, [store, namespace, reducer]);
|
|
@@ -5382,4 +5550,4 @@ exports.useTable = useTable;
|
|
|
5382
5550
|
exports.useUpdateRoleMutation = useUpdateRoleMutation;
|
|
5383
5551
|
exports.useUpdateRolePermissionsMutation = useUpdateRolePermissionsMutation;
|
|
5384
5552
|
exports.useUpdateUserMutation = useUpdateUserMutation;
|
|
5385
|
-
//# sourceMappingURL=index-
|
|
5553
|
+
//# sourceMappingURL=index-HH_X-3kJ.js.map
|