@strapi/admin 5.0.0-beta.10 → 5.0.0-beta.11
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-QuYJM0kA.js} +15 -15
- package/dist/admin/{ApplicationInfoPage-S_AoXyUe.js.map → ApplicationInfoPage-QuYJM0kA.js.map} +1 -1
- package/dist/admin/{ApplicationInfoPage-bfXW7lrq.mjs → ApplicationInfoPage-e-khXcZQ.mjs} +5 -5
- package/dist/admin/{ApplicationInfoPage-bfXW7lrq.mjs.map → ApplicationInfoPage-e-khXcZQ.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-040fsD08.js} +30 -29
- package/dist/admin/{AuthenticatedLayout-s7jnYVG9.js.map → AuthenticatedLayout-040fsD08.js.map} +1 -1
- package/dist/admin/{AuthenticatedLayout-lXbF2KKJ.mjs → AuthenticatedLayout-Ou5qhSr4.mjs} +13 -12
- package/dist/admin/{AuthenticatedLayout-lXbF2KKJ.mjs.map → AuthenticatedLayout-Ou5qhSr4.mjs.map} +1 -1
- package/dist/admin/{CreatePage-4gOQVUMq.mjs → CreatePage-P0Nz_ayl.mjs} +3 -3
- package/dist/admin/{CreatePage-4gOQVUMq.mjs.map → CreatePage-P0Nz_ayl.mjs.map} +1 -1
- package/dist/admin/{CreatePage-6pIItf4z.mjs → CreatePage-SkKjFqP6.mjs} +4 -4
- package/dist/admin/{CreatePage-6pIItf4z.mjs.map → CreatePage-SkKjFqP6.mjs.map} +1 -1
- package/dist/admin/{CreatePage-s23BIVXe.js → CreatePage-mQUbZZJv.js} +5 -5
- package/dist/admin/{CreatePage-s23BIVXe.js.map → CreatePage-mQUbZZJv.js.map} +1 -1
- package/dist/admin/{CreatePage-uWZ7dxp6.js → CreatePage-taYHLGep.js} +11 -11
- package/dist/admin/{CreatePage-uWZ7dxp6.js.map → CreatePage-taYHLGep.js.map} +1 -1
- package/dist/admin/{CreateView-3cLNRlgO.mjs → CreateView-ClT1OHUe.mjs} +3 -3
- package/dist/admin/{CreateView-3cLNRlgO.mjs.map → CreateView-ClT1OHUe.mjs.map} +1 -1
- package/dist/admin/{CreateView-aMz4KfSZ.mjs → CreateView-PuVH0YQf.mjs} +3 -3
- package/dist/admin/{CreateView-aMz4KfSZ.mjs.map → CreateView-PuVH0YQf.mjs.map} +1 -1
- package/dist/admin/CreateView-iUA3lEYs.js +17 -0
- package/dist/admin/{CreateView-JQYIo77z.js.map → CreateView-iUA3lEYs.js.map} +1 -1
- package/dist/admin/CreateView-oRYdhduP.js +17 -0
- package/dist/admin/{CreateView-DNHRcJsj.js.map → CreateView-oRYdhduP.js.map} +1 -1
- package/dist/admin/{EditPage-tmpterlY.mjs → EditPage-SVzJI-dH.mjs} +5 -5
- package/dist/admin/{EditPage-tmpterlY.mjs.map → EditPage-SVzJI-dH.mjs.map} +1 -1
- package/dist/admin/{EditPage-24cGvUbV.js → EditPage-_caeCOYK.js} +12 -12
- package/dist/admin/{EditPage-24cGvUbV.js.map → EditPage-_caeCOYK.js.map} +1 -1
- package/dist/admin/{EditPage-JPZ7c-8x.mjs → EditPage-arCsYBox.mjs} +5 -5
- package/dist/admin/{EditPage-JPZ7c-8x.mjs.map → EditPage-arCsYBox.mjs.map} +1 -1
- package/dist/admin/{EditPage-tUvaZzFe.mjs → EditPage-bDO4OJc8.mjs} +7 -7
- package/dist/admin/{EditPage-tUvaZzFe.mjs.map → EditPage-bDO4OJc8.mjs.map} +1 -1
- package/dist/admin/{EditPage-Wpz4YmVY.js → EditPage-q_7kn0JT.js} +16 -16
- package/dist/admin/{EditPage-Wpz4YmVY.js.map → EditPage-q_7kn0JT.js.map} +1 -1
- package/dist/admin/{EditPage-wGJLuMsP.js → EditPage-rxs9-apI.js} +11 -11
- package/dist/admin/{EditPage-wGJLuMsP.js.map → EditPage-rxs9-apI.js.map} +1 -1
- package/dist/admin/{EditView-HjYkw6Y_.mjs → EditView-nfJOf2A4.mjs} +4 -4
- package/dist/admin/{EditView-HjYkw6Y_.mjs.map → EditView-nfJOf2A4.mjs.map} +1 -1
- package/dist/admin/{EditView-ul5nHrFh.js → EditView-tAF5eQf_.js} +14 -14
- package/dist/admin/{EditView-ul5nHrFh.js.map → EditView-tAF5eQf_.js.map} +1 -1
- package/dist/admin/{EditViewPage-bnTbQJ_O.mjs → EditViewPage-KAIuwIw2.mjs} +4 -4
- package/dist/admin/{EditViewPage-bnTbQJ_O.mjs.map → EditViewPage-KAIuwIw2.mjs.map} +1 -1
- package/dist/admin/{EditViewPage-c3DI4uzU.js → EditViewPage-O3dTB0ur.js} +14 -14
- package/dist/admin/{EditViewPage-c3DI4uzU.js.map → EditViewPage-O3dTB0ur.js.map} +1 -1
- package/dist/admin/{EventsTable-7--SHloR.js → EventsTable-726AT6mO.js} +2 -2
- package/dist/admin/{EventsTable-7--SHloR.js.map → EventsTable-726AT6mO.js.map} +1 -1
- package/dist/admin/{EventsTable-XUKqJdnX.mjs → EventsTable-Bv-PH0PC.mjs} +2 -2
- package/dist/admin/{EventsTable-XUKqJdnX.mjs.map → EventsTable-Bv-PH0PC.mjs.map} +1 -1
- package/dist/admin/{HomePage-fBY17m1h.js → HomePage-3JDMO4LG.js} +3 -3
- package/dist/admin/{HomePage-fBY17m1h.js.map → HomePage-3JDMO4LG.js.map} +1 -1
- package/dist/admin/{HomePage-Xrg1dR_D.js → HomePage-QFIF1udT.js} +11 -11
- package/dist/admin/{HomePage-Xrg1dR_D.js.map → HomePage-QFIF1udT.js.map} +1 -1
- package/dist/admin/{HomePage--Mskxb9Z.mjs → HomePage-pgsuFIh7.mjs} +4 -4
- package/dist/admin/{HomePage--Mskxb9Z.mjs.map → HomePage-pgsuFIh7.mjs.map} +1 -1
- package/dist/admin/{HomePage-ppJpMP9G.mjs → HomePage-rPlX1rrg.mjs} +3 -3
- package/dist/admin/{HomePage-ppJpMP9G.mjs.map → HomePage-rPlX1rrg.mjs.map} +1 -1
- package/dist/admin/{InstalledPluginsPage-alfcy8jO.js → InstalledPluginsPage-XP8i3w5T.js} +10 -10
- package/dist/admin/{InstalledPluginsPage-alfcy8jO.js.map → InstalledPluginsPage-XP8i3w5T.js.map} +1 -1
- package/dist/admin/{InstalledPluginsPage-EtnkMG0G.mjs → InstalledPluginsPage-uHFuUx41.mjs} +4 -4
- package/dist/admin/{InstalledPluginsPage-EtnkMG0G.mjs.map → InstalledPluginsPage-uHFuUx41.mjs.map} +1 -1
- package/dist/admin/{Layout-9EvJq4Gc.mjs → Layout-6zLg6LxH.mjs} +5 -5
- package/dist/admin/Layout-6zLg6LxH.mjs.map +1 -0
- package/dist/admin/{Layout-RKjEsOtu.js → Layout-PemM8Wd3.js} +11 -11
- package/dist/admin/Layout-PemM8Wd3.js.map +1 -0
- package/dist/admin/{ListPage-gl3tUWS8.mjs → ListPage-2nnKxEVE.mjs} +3 -3
- package/dist/admin/{ListPage-gl3tUWS8.mjs.map → ListPage-2nnKxEVE.mjs.map} +1 -1
- package/dist/admin/{ListPage-D8Ih2axK.js → ListPage-43lsZ_Bp.js} +14 -14
- package/dist/admin/{ListPage-D8Ih2axK.js.map → ListPage-43lsZ_Bp.js.map} +1 -1
- package/dist/admin/{ListPage-TkJa9Qcz.js → ListPage-6iZqugjj.js} +12 -12
- package/dist/admin/{ListPage-TkJa9Qcz.js.map → ListPage-6iZqugjj.js.map} +1 -1
- package/dist/admin/{ListPage-Ur-kwyVv.mjs → ListPage-SY0bk22Q.mjs} +6 -6
- package/dist/admin/{ListPage-Ur-kwyVv.mjs.map → ListPage-SY0bk22Q.mjs.map} +1 -1
- package/dist/admin/{ListPage-MJlQ5gGq.js → ListPage-Tra1QVDy.js} +14 -14
- package/dist/admin/{ListPage-MJlQ5gGq.js.map → ListPage-Tra1QVDy.js.map} +1 -1
- package/dist/admin/{ListPage-21q8_YN7.mjs → ListPage-WvDXi585.mjs} +3 -3
- package/dist/admin/{ListPage-21q8_YN7.mjs.map → ListPage-WvDXi585.mjs.map} +1 -1
- package/dist/admin/{ListPage-Z0mmlysk.js → ListPage-c83R7AzC.js} +3 -3
- package/dist/admin/{ListPage-Z0mmlysk.js.map → ListPage-c83R7AzC.js.map} +1 -1
- package/dist/admin/{ListPage-xQbMtUpV.mjs → ListPage-jhOQGhI7.mjs} +5 -5
- package/dist/admin/{ListPage-xQbMtUpV.mjs.map → ListPage-jhOQGhI7.mjs.map} +1 -1
- package/dist/admin/{ListPage-nbTQdpBX.mjs → ListPage-liMIiZMU.mjs} +3 -3
- package/dist/admin/{ListPage-nbTQdpBX.mjs.map → ListPage-liMIiZMU.mjs.map} +1 -1
- package/dist/admin/{ListPage-CRyM6NXF.js → ListPage-lpSNR8MY.js} +17 -17
- package/dist/admin/{ListPage-CRyM6NXF.js.map → ListPage-lpSNR8MY.js.map} +1 -1
- package/dist/admin/{ListView-nRGxAwIh.js → ListView-QVoBfZkP.js} +13 -13
- package/dist/admin/{ListView-nRGxAwIh.js.map → ListView-QVoBfZkP.js.map} +1 -1
- package/dist/admin/{ListView-geMTlhDN.mjs → ListView-QlFkFf_V.mjs} +4 -4
- package/dist/admin/{ListView-geMTlhDN.mjs.map → ListView-QlFkFf_V.mjs.map} +1 -1
- package/dist/admin/{ListView-Drn22JZ1.mjs → ListView-mObmenTh.mjs} +4 -4
- package/dist/admin/{ListView-Drn22JZ1.mjs.map → ListView-mObmenTh.mjs.map} +1 -1
- package/dist/admin/{ListView-qAX3ZO28.js → ListView-wx2Wg7AQ.js} +13 -13
- package/dist/admin/{ListView-qAX3ZO28.js.map → ListView-wx2Wg7AQ.js.map} +1 -1
- package/dist/admin/{Login-Hn_q1QSn.js → Login-9bc4EDrd.js} +4 -4
- package/dist/admin/{Login-Hn_q1QSn.js.map → Login-9bc4EDrd.js.map} +1 -1
- package/dist/admin/{Login-ngKWBSD4.mjs → Login-qvyDXOZp.mjs} +3 -3
- package/dist/admin/{Login-ngKWBSD4.mjs.map → Login-qvyDXOZp.mjs.map} +1 -1
- package/dist/admin/{MagicLinkEE-JWmJRiBS.mjs → MagicLinkEE-gwhEOSq0.mjs} +3 -3
- package/dist/admin/{MagicLinkEE-JWmJRiBS.mjs.map → MagicLinkEE-gwhEOSq0.mjs.map} +1 -1
- package/dist/admin/{MagicLinkEE-B5NOEO47.js → MagicLinkEE-wa0KdGZM.js} +3 -3
- package/dist/admin/{MagicLinkEE-B5NOEO47.js.map → MagicLinkEE-wa0KdGZM.js.map} +1 -1
- package/dist/admin/{MarketplacePage-Pk9USes6.mjs → MarketplacePage-3Z3e-oDS.mjs} +3 -3
- package/dist/admin/{MarketplacePage-Pk9USes6.mjs.map → MarketplacePage-3Z3e-oDS.mjs.map} +1 -1
- package/dist/admin/{MarketplacePage-vQaaicxu.js → MarketplacePage-e9h-T9Yf.js} +17 -17
- package/dist/admin/{MarketplacePage-vQaaicxu.js.map → MarketplacePage-e9h-T9Yf.js.map} +1 -1
- package/dist/admin/{Permissions-GCSY8mIm.js → Permissions-CE17oEnM.js} +7 -7
- package/dist/admin/{Permissions-GCSY8mIm.js.map → Permissions-CE17oEnM.js.map} +1 -1
- package/dist/admin/{Permissions-2GKZ2IjP.mjs → Permissions-VlgWwFsK.mjs} +3 -3
- package/dist/admin/{Permissions-2GKZ2IjP.mjs.map → Permissions-VlgWwFsK.mjs.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-Q5UpeDjs.mjs → ProfilePage-oTScHwyK.mjs} +4 -4
- package/dist/admin/{ProfilePage-Q5UpeDjs.mjs.map → ProfilePage-oTScHwyK.mjs.map} +1 -1
- package/dist/admin/{ProfilePage-o028o7JD.js → ProfilePage-pllDh5dd.js} +18 -18
- package/dist/admin/{ProfilePage-o028o7JD.js.map → ProfilePage-pllDh5dd.js.map} +1 -1
- package/dist/admin/{PurchaseAuditLogs-tpXbhCx-.mjs → PurchaseAuditLogs-6_ie0YzN.mjs} +2 -2
- package/dist/admin/{PurchaseAuditLogs-tpXbhCx-.mjs.map → PurchaseAuditLogs-6_ie0YzN.mjs.map} +1 -1
- package/dist/admin/{PurchaseAuditLogs-Vur69JZB.js → PurchaseAuditLogs-I3m6LuoA.js} +2 -2
- package/dist/admin/{PurchaseAuditLogs-Vur69JZB.js.map → PurchaseAuditLogs-I3m6LuoA.js.map} +1 -1
- package/dist/admin/{PurchaseSingleSignOn-6VTPjJVO.mjs → PurchaseSingleSignOn--iKPscMp.mjs} +2 -2
- package/dist/admin/{PurchaseSingleSignOn-6VTPjJVO.mjs.map → PurchaseSingleSignOn--iKPscMp.mjs.map} +1 -1
- package/dist/admin/{PurchaseSingleSignOn-7NMcihzT.js → PurchaseSingleSignOn-HBKmhjTH.js} +2 -2
- package/dist/admin/{PurchaseSingleSignOn-7NMcihzT.js.map → PurchaseSingleSignOn-HBKmhjTH.js.map} +1 -1
- package/dist/admin/{SelectRoles-q8vaxqfL.js → SelectRoles-ZAZ-5C7_.js} +5 -5
- package/dist/admin/{SelectRoles-q8vaxqfL.js.map → SelectRoles-ZAZ-5C7_.js.map} +1 -1
- package/dist/admin/{SelectRoles-BtQp5Va-.mjs → SelectRoles-nihoDXHG.mjs} +4 -4
- package/dist/admin/{SelectRoles-BtQp5Va-.mjs.map → SelectRoles-nihoDXHG.mjs.map} +1 -1
- package/dist/admin/{SingleSignOnPage-X1OAuyhO.mjs → SingleSignOnPage-WY9MZfnN.mjs} +4 -4
- package/dist/admin/{SingleSignOnPage-X1OAuyhO.mjs.map → SingleSignOnPage-WY9MZfnN.mjs.map} +1 -1
- package/dist/admin/{SingleSignOnPage-_l9MyJvN.js → SingleSignOnPage-tOX6gKDJ.js} +15 -15
- package/dist/admin/{SingleSignOnPage-_l9MyJvN.js.map → SingleSignOnPage-tOX6gKDJ.js.map} +1 -1
- package/dist/admin/{Table-V5-qnRte.mjs → Table-S0UNrz__.mjs} +3 -3
- package/dist/admin/{Table-V5-qnRte.mjs.map → Table-S0UNrz__.mjs.map} +1 -1
- package/dist/admin/{Table-z6l5BFoH.js → Table-YODk-_Dd.js} +5 -5
- package/dist/admin/{Table-z6l5BFoH.js.map → Table-YODk-_Dd.js.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-0lJpg-Og.js} +7 -7
- package/dist/admin/{TokenTypeSelect-2iXEz7zs.js.map → TokenTypeSelect-0lJpg-Og.js.map} +1 -1
- package/dist/admin/{TokenTypeSelect-crPtoLFc.mjs → TokenTypeSelect-TLOZ5MAR.mjs} +3 -3
- package/dist/admin/{TokenTypeSelect-crPtoLFc.mjs.map → TokenTypeSelect-TLOZ5MAR.mjs.map} +1 -1
- package/dist/admin/{UseCasePage-QsvlJAQD.mjs → UseCasePage-ehZx7Rwd.mjs} +4 -4
- package/dist/admin/{UseCasePage-QsvlJAQD.mjs.map → UseCasePage-ehZx7Rwd.mjs.map} +1 -1
- package/dist/admin/{UseCasePage-26Y6U1DU.js → UseCasePage-uJRpPeQz.js} +6 -6
- package/dist/admin/{UseCasePage-26Y6U1DU.js.map → UseCasePage-uJRpPeQz.js.map} +1 -1
- package/dist/admin/{constants-ThodPHfR.mjs → constants-lyc5iHQ_.mjs} +3 -3
- package/dist/admin/{constants-ThodPHfR.mjs.map → constants-lyc5iHQ_.mjs.map} +1 -1
- package/dist/admin/{constants-Maq_tQvu.js → constants-qyti_7np.js} +4 -4
- package/dist/admin/{constants-Maq_tQvu.js.map → constants-qyti_7np.js.map} +1 -1
- package/dist/admin/{index-jwAq-BX-.mjs → index-7Wlj8eA7.mjs} +1292 -1153
- package/dist/admin/index-7Wlj8eA7.mjs.map +1 -0
- package/dist/admin/{index-Ncrnmg5a.js → index-PPLoirnr.js} +1502 -1363
- package/dist/admin/index-PPLoirnr.js.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/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-dbTJQETQ.mjs} +2 -2
- package/dist/admin/{useAdminRoles-gMNUnVWO.mjs.map → useAdminRoles-dbTJQETQ.mjs.map} +1 -1
- package/dist/admin/{useAdminRoles-zEk0tBhE.js → useAdminRoles-pDH2JAWH.js} +2 -2
- package/dist/admin/{useAdminRoles-zEk0tBhE.js.map → useAdminRoles-pDH2JAWH.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-208-EpBG.mjs} +2 -2
- package/dist/admin/{validation-F0JMLUkr.mjs.map → validation-208-EpBG.mjs.map} +1 -1
- package/dist/admin/{validation-cP2hBbZm.js → validation-YRSMzskg.js} +2 -2
- package/dist/admin/{validation-cP2hBbZm.js.map → validation-YRSMzskg.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,839 +139,968 @@ 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
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
width: "35%",
|
|
532
|
-
shadow: "tableShadow",
|
|
533
|
-
borderColor: "neutral150",
|
|
534
|
-
background: "neutral0",
|
|
535
|
-
hasRadius: true,
|
|
536
|
-
maxWidth: "512px",
|
|
537
|
-
children: [
|
|
538
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
|
539
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, { width: "32px", height: "32px", fill: "danger600" }),
|
|
540
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 4, fontWeight: "bold", textAlign: "center", children: formatMessage({
|
|
541
|
-
id: "app.error",
|
|
542
|
-
defaultMessage: "Something went wrong"
|
|
543
|
-
}) }),
|
|
544
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textAlign: "center", children: formatMessage(
|
|
545
|
-
{
|
|
546
|
-
id: "app.error.message",
|
|
547
|
-
defaultMessage: `It seems like there is a bug in your instance, but we've got you covered. Please notify your technical team so they can investigate the source of the problem and report the issue to us by opening a bug report on {link}.`
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
link: /* @__PURE__ */ jsxRuntime.jsx(
|
|
551
|
-
designSystem.Link,
|
|
552
|
-
{
|
|
553
|
-
isExternal: true,
|
|
554
|
-
endIcon: true,
|
|
555
|
-
href: "https://github.com/strapi/strapi/issues/new?assignees=&labels=&projects=&template=BUG_REPORT.md",
|
|
556
|
-
children: `Strapi's GitHub`
|
|
557
|
-
}
|
|
558
|
-
)
|
|
559
|
-
}
|
|
560
|
-
) })
|
|
561
|
-
] }),
|
|
562
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", width: "100%", children: [
|
|
563
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { onClose: () => {
|
|
564
|
-
}, width: "100%", closeLabel: "", variant: "danger", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorType, { children: error.message }) }),
|
|
565
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClick, variant: "tertiary", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Duplicate, {}), children: formatMessage({
|
|
566
|
-
id: "app.error.copy",
|
|
567
|
-
defaultMessage: "Copy to clipboard"
|
|
568
|
-
}) })
|
|
569
|
-
] })
|
|
570
|
-
]
|
|
571
|
-
}
|
|
572
|
-
) }) });
|
|
573
|
-
}
|
|
574
|
-
throw error;
|
|
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
|
+
);
|
|
575
626
|
};
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
display: none;
|
|
583
|
-
}
|
|
584
|
-
`;
|
|
585
|
-
const ErrorType = styledComponents.styled(designSystem.Typography)`
|
|
586
|
-
word-break: break-all;
|
|
587
|
-
color: ${({ theme }) => theme.colors.danger600};
|
|
588
|
-
`;
|
|
589
|
-
|
|
590
|
-
const ADMIN_PERMISSIONS_CE = {
|
|
591
|
-
contentManager: {
|
|
592
|
-
main: [],
|
|
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 }]
|
|
627
|
+
const initialState = {
|
|
628
|
+
currentStep: null,
|
|
629
|
+
guidedTourState: {
|
|
630
|
+
contentTypeBuilder: {
|
|
631
|
+
create: false,
|
|
632
|
+
success: false
|
|
657
633
|
},
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
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 }]
|
|
634
|
+
contentManager: {
|
|
635
|
+
create: false,
|
|
636
|
+
success: false
|
|
665
637
|
},
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
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 }]
|
|
638
|
+
apiTokens: {
|
|
639
|
+
create: false,
|
|
640
|
+
success: false
|
|
673
641
|
},
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
642
|
+
transferTokens: {
|
|
643
|
+
create: false,
|
|
644
|
+
success: false
|
|
677
645
|
}
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* Hook that allows to mutate the displayed headers of the list view table
|
|
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"
|
|
646
|
+
},
|
|
647
|
+
isGuidedTourVisible: false,
|
|
648
|
+
isSkipped: false
|
|
705
649
|
};
|
|
706
|
-
const
|
|
707
|
-
|
|
708
|
-
{
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
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
|
-
|
|
762
|
-
const ALLOWED_TYPES = [
|
|
763
|
-
"biginteger",
|
|
764
|
-
"boolean",
|
|
765
|
-
"date",
|
|
766
|
-
"datetime",
|
|
767
|
-
"decimal",
|
|
768
|
-
"email",
|
|
769
|
-
"enumeration",
|
|
770
|
-
"float",
|
|
771
|
-
"integer",
|
|
772
|
-
"json",
|
|
773
|
-
"password",
|
|
774
|
-
"richtext",
|
|
775
|
-
"string",
|
|
776
|
-
"text",
|
|
777
|
-
"time",
|
|
778
|
-
"uid"
|
|
779
|
-
];
|
|
780
|
-
const ALLOWED_ROOT_LEVEL_OPTIONS = [
|
|
781
|
-
"min",
|
|
782
|
-
"minLength",
|
|
783
|
-
"max",
|
|
784
|
-
"maxLength",
|
|
785
|
-
"required",
|
|
786
|
-
"regex",
|
|
787
|
-
"enum",
|
|
788
|
-
"unique",
|
|
789
|
-
"private",
|
|
790
|
-
"default"
|
|
791
|
-
];
|
|
792
|
-
class CustomFields {
|
|
793
|
-
customFields;
|
|
794
|
-
constructor() {
|
|
795
|
-
this.customFields = {};
|
|
796
|
-
}
|
|
797
|
-
register = (customFields) => {
|
|
798
|
-
if (Array.isArray(customFields)) {
|
|
799
|
-
customFields.forEach((customField) => {
|
|
800
|
-
this.register(customField);
|
|
801
|
-
});
|
|
802
|
-
} else {
|
|
803
|
-
const { name, pluginId, type, intlLabel, intlDescription, components, options } = customFields;
|
|
804
|
-
invariant__default.default(name, "A name must be provided");
|
|
805
|
-
invariant__default.default(type, "A type must be provided");
|
|
806
|
-
invariant__default.default(intlLabel, "An intlLabel must be provided");
|
|
807
|
-
invariant__default.default(intlDescription, "An intlDescription must be provided");
|
|
808
|
-
invariant__default.default(components, "A components object must be provided");
|
|
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`
|
|
818
|
-
);
|
|
819
|
-
const allFormOptions = [...options?.base || [], ...options?.advanced || []];
|
|
820
|
-
if (allFormOptions.length) {
|
|
821
|
-
const optionPathValidations = allFormOptions.reduce(optionsValidationReducer, []);
|
|
822
|
-
optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
|
|
823
|
-
invariant__default.default(isValidOptionPath, errorMessage);
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
|
|
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;
|
|
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;
|
|
830
671
|
}
|
|
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
672
|
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
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);
|
|
852
689
|
});
|
|
853
690
|
}
|
|
854
|
-
|
|
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
|
+
);
|
|
855
715
|
};
|
|
856
716
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
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;
|
|
717
|
+
const queryClient = new reactQuery.QueryClient({
|
|
718
|
+
defaultOptions: {
|
|
719
|
+
queries: {
|
|
720
|
+
refetchOnWindowFocus: false
|
|
721
|
+
}
|
|
871
722
|
}
|
|
872
|
-
|
|
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) => {
|
|
873
766
|
try {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
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;
|
|
878
782
|
}
|
|
783
|
+
}, []);
|
|
784
|
+
return { copy };
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
const ErrorElement = () => {
|
|
788
|
+
const error = reactRouterDom.useRouteError();
|
|
789
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
790
|
+
const { copy } = useClipboard();
|
|
791
|
+
if (error instanceof Error) {
|
|
792
|
+
console.error(error);
|
|
793
|
+
const handleClick = async () => {
|
|
794
|
+
await copy(`
|
|
795
|
+
\`\`\`
|
|
796
|
+
${error.stack}
|
|
797
|
+
\`\`\`
|
|
798
|
+
`);
|
|
799
|
+
};
|
|
800
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Main, { height: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { alignItems: "center", height: "100%", justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
801
|
+
designSystem.Flex,
|
|
802
|
+
{
|
|
803
|
+
gap: 7,
|
|
804
|
+
padding: 7,
|
|
805
|
+
direction: "column",
|
|
806
|
+
width: "35%",
|
|
807
|
+
shadow: "tableShadow",
|
|
808
|
+
borderColor: "neutral150",
|
|
809
|
+
background: "neutral0",
|
|
810
|
+
hasRadius: true,
|
|
811
|
+
maxWidth: "512px",
|
|
812
|
+
children: [
|
|
813
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
|
814
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, { width: "32px", height: "32px", fill: "danger600" }),
|
|
815
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 4, fontWeight: "bold", textAlign: "center", children: formatMessage({
|
|
816
|
+
id: "app.error",
|
|
817
|
+
defaultMessage: "Something went wrong"
|
|
818
|
+
}) }),
|
|
819
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textAlign: "center", children: formatMessage(
|
|
820
|
+
{
|
|
821
|
+
id: "app.error.message",
|
|
822
|
+
defaultMessage: `It seems like there is a bug in your instance, but we've got you covered. Please notify your technical team so they can investigate the source of the problem and report the issue to us by opening a bug report on {link}.`
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
link: /* @__PURE__ */ jsxRuntime.jsx(
|
|
826
|
+
designSystem.Link,
|
|
827
|
+
{
|
|
828
|
+
isExternal: true,
|
|
829
|
+
endIcon: true,
|
|
830
|
+
href: "https://github.com/strapi/strapi/issues/new?assignees=&labels=&projects=&template=BUG_REPORT.md",
|
|
831
|
+
children: `Strapi's GitHub`
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
}
|
|
835
|
+
) })
|
|
836
|
+
] }),
|
|
837
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", width: "100%", children: [
|
|
838
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { onClose: () => {
|
|
839
|
+
}, width: "100%", closeLabel: "", variant: "danger", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorType, { children: error.message }) }),
|
|
840
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClick, variant: "tertiary", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Duplicate, {}), children: formatMessage({
|
|
841
|
+
id: "app.error.copy",
|
|
842
|
+
defaultMessage: "Copy to clipboard"
|
|
843
|
+
}) })
|
|
844
|
+
] })
|
|
845
|
+
]
|
|
846
|
+
}
|
|
847
|
+
) }) });
|
|
879
848
|
}
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
849
|
+
throw error;
|
|
850
|
+
};
|
|
851
|
+
const StyledAlert = styledComponents.styled(designSystem.Alert)`
|
|
852
|
+
& > div:first-child {
|
|
853
|
+
display: none;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
& > button {
|
|
857
|
+
display: none;
|
|
858
|
+
}
|
|
859
|
+
`;
|
|
860
|
+
const ErrorType = styledComponents.styled(designSystem.Typography)`
|
|
861
|
+
word-break: break-all;
|
|
862
|
+
color: ${({ theme }) => theme.colors.danger600};
|
|
863
|
+
`;
|
|
864
|
+
|
|
865
|
+
const ActionLayout = ({ startActions, endActions }) => {
|
|
866
|
+
if (!startActions && !endActions) {
|
|
867
|
+
return null;
|
|
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
|
+
]
|
|
885
881
|
}
|
|
886
|
-
|
|
887
|
-
}
|
|
882
|
+
);
|
|
883
|
+
};
|
|
888
884
|
|
|
889
|
-
const
|
|
890
|
-
|
|
891
|
-
admin_app: rbac.reducer
|
|
885
|
+
const ContentLayout = ({ children }) => {
|
|
886
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
892
887
|
};
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
888
|
+
|
|
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
|
+
}
|
|
907
936
|
);
|
|
908
937
|
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
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
|
+
]
|
|
959
|
+
}
|
|
960
|
+
);
|
|
917
961
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
admin.adminApi.middleware,
|
|
927
|
-
...appMiddlewares.map((m) => m())
|
|
928
|
-
],
|
|
929
|
-
enhancers: [injectReducerStoreEnhancer(coreReducers)]
|
|
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
|
|
930
970
|
});
|
|
931
|
-
|
|
971
|
+
useResizeObserver(containerRef, () => {
|
|
972
|
+
if (containerRef.current) {
|
|
973
|
+
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
React__namespace.useEffect(() => {
|
|
977
|
+
if (baseHeaderLayoutRef.current) {
|
|
978
|
+
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
979
|
+
}
|
|
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
|
+
] });
|
|
985
|
+
};
|
|
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);
|
|
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];
|
|
1006
|
+
};
|
|
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-43lsZ_Bp.js'));
|
|
1086
|
+
return {
|
|
1087
|
+
Component: ProtectedListPage
|
|
1088
|
+
};
|
|
962
1089
|
}
|
|
963
|
-
return result;
|
|
964
|
-
},
|
|
965
|
-
runParallel(...args) {
|
|
966
|
-
return Promise.all(
|
|
967
|
-
_handlers.map((fn) => {
|
|
968
|
-
return fn(...args);
|
|
969
|
-
})
|
|
970
|
-
);
|
|
971
1090
|
}
|
|
972
|
-
|
|
973
|
-
|
|
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-tOX6gKDJ.js'));
|
|
1097
|
+
return {
|
|
1098
|
+
Component: ProtectedSSO
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
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: {},
|
|
@@ -1551,7 +1681,7 @@ const DateInput = React.forwardRef(
|
|
|
1551
1681
|
field.onChange(name, date);
|
|
1552
1682
|
},
|
|
1553
1683
|
onClear: () => field.onChange(name, void 0),
|
|
1554
|
-
value,
|
|
1684
|
+
value: value ? convertLocalDateToUTCDate(value) : void 0,
|
|
1555
1685
|
...props
|
|
1556
1686
|
}
|
|
1557
1687
|
),
|
|
@@ -1560,6 +1690,12 @@ const DateInput = React.forwardRef(
|
|
|
1560
1690
|
] });
|
|
1561
1691
|
}
|
|
1562
1692
|
);
|
|
1693
|
+
const convertLocalDateToUTCDate = (date$1) => {
|
|
1694
|
+
const utcDateString = date$1.toISOString();
|
|
1695
|
+
const timeZone = date.getLocalTimeZone();
|
|
1696
|
+
const zonedDateTime = date.parseAbsolute(utcDateString, timeZone);
|
|
1697
|
+
return date.toCalendarDate(zonedDateTime).toDate("UTC");
|
|
1698
|
+
};
|
|
1563
1699
|
const MemoizedDateInput = React.memo(DateInput);
|
|
1564
1700
|
|
|
1565
1701
|
const DateTimeInput = React.forwardRef(
|
|
@@ -1809,7 +1945,7 @@ const TimeInput = React.forwardRef(
|
|
|
1809
1945
|
ref: composedRefs,
|
|
1810
1946
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
1811
1947
|
onChange: (time) => {
|
|
1812
|
-
field.onChange(name, time);
|
|
1948
|
+
field.onChange(name, `${time}:00.000`);
|
|
1813
1949
|
},
|
|
1814
1950
|
onClear: () => field.onChange(name, void 0),
|
|
1815
1951
|
value: field.value ?? "",
|
|
@@ -1890,7 +2026,7 @@ const Img = styledComponents.styled.img`
|
|
|
1890
2026
|
const Logo = () => {
|
|
1891
2027
|
const {
|
|
1892
2028
|
logos: { auth }
|
|
1893
|
-
} =
|
|
2029
|
+
} = Theme.useConfiguration("UnauthenticatedLogo");
|
|
1894
2030
|
return /* @__PURE__ */ jsxRuntime.jsx(Img, { src: auth?.custom?.url || auth.default, "aria-hidden": true, alt: "" });
|
|
1895
2031
|
};
|
|
1896
2032
|
|
|
@@ -1902,8 +2038,8 @@ const Column = styledComponents.styled(designSystem.Flex)`
|
|
|
1902
2038
|
flex-direction: column;
|
|
1903
2039
|
`;
|
|
1904
2040
|
const LocaleToggle = () => {
|
|
1905
|
-
const localeNames =
|
|
1906
|
-
const dispatch =
|
|
2041
|
+
const localeNames = Theme.useTypedSelector((state) => state.admin_app.language.localeNames);
|
|
2042
|
+
const dispatch = Theme.useTypedDispatch();
|
|
1907
2043
|
const { formatMessage, locale } = reactIntl.useIntl();
|
|
1908
2044
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1909
2045
|
designSystem.SingleSelect,
|
|
@@ -1914,7 +2050,7 @@ const LocaleToggle = () => {
|
|
|
1914
2050
|
}),
|
|
1915
2051
|
value: locale,
|
|
1916
2052
|
onChange: (language) => {
|
|
1917
|
-
dispatch(
|
|
2053
|
+
dispatch(Theme.setLocale(language));
|
|
1918
2054
|
},
|
|
1919
2055
|
children: Object.entries(localeNames).map(([language, name]) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: language, children: name }, language))
|
|
1920
2056
|
}
|
|
@@ -2005,7 +2141,7 @@ const Login = ({ children }) => {
|
|
|
2005
2141
|
const { search: searchString } = reactRouterDom.useLocation();
|
|
2006
2142
|
const query = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
|
2007
2143
|
const navigate = reactRouterDom.useNavigate();
|
|
2008
|
-
const { login } =
|
|
2144
|
+
const { login } = Theme.useAuth("Login", (auth) => auth);
|
|
2009
2145
|
const handleLogin = async (body) => {
|
|
2010
2146
|
setApiError(void 0);
|
|
2011
2147
|
const res = await login(body);
|
|
@@ -2095,8 +2231,8 @@ const Login = ({ children }) => {
|
|
|
2095
2231
|
const ForgotPassword = () => {
|
|
2096
2232
|
const navigate = reactRouterDom.useNavigate();
|
|
2097
2233
|
const { formatMessage } = reactIntl.useIntl();
|
|
2098
|
-
const { _unstableFormatAPIError: formatAPIError } =
|
|
2099
|
-
const [forgotPassword, { error }] =
|
|
2234
|
+
const { _unstableFormatAPIError: formatAPIError } = Theme.useAPIErrorHandler();
|
|
2235
|
+
const [forgotPassword, { error }] = Theme.useForgotPasswordMutation();
|
|
2100
2236
|
return /* @__PURE__ */ jsxRuntime.jsx(UnauthenticatedLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { children: [
|
|
2101
2237
|
/* @__PURE__ */ jsxRuntime.jsxs(LayoutContent, { children: [
|
|
2102
2238
|
/* @__PURE__ */ jsxRuntime.jsxs(Column, { children: [
|
|
@@ -2296,9 +2432,9 @@ const NpsSurvey = () => {
|
|
|
2296
2432
|
const { formatMessage } = reactIntl.useIntl();
|
|
2297
2433
|
const { npsSurveySettings, setNpsSurveySettings } = useNpsSurveySettings();
|
|
2298
2434
|
const [isFeedbackResponse, setIsFeedbackResponse] = React__namespace.useState(false);
|
|
2299
|
-
const { toggleNotification } =
|
|
2300
|
-
const currentEnvironment =
|
|
2301
|
-
const strapiVersion =
|
|
2435
|
+
const { toggleNotification } = Theme.useNotification();
|
|
2436
|
+
const currentEnvironment = Theme.useAppInfo("NpsSurvey", (state) => state.currentEnvironment);
|
|
2437
|
+
const strapiVersion = Theme.useAppInfo("NpsSurvey", (state) => state.strapiVersion);
|
|
2302
2438
|
const [surveyIsShown, setSurveyIsShown] = React__namespace.useState(
|
|
2303
2439
|
checkIfShouldShowSurvey(npsSurveySettings)
|
|
2304
2440
|
);
|
|
@@ -2311,7 +2447,7 @@ const NpsSurvey = () => {
|
|
|
2311
2447
|
clearTimeout(displayTime);
|
|
2312
2448
|
};
|
|
2313
2449
|
}, []);
|
|
2314
|
-
const { user } =
|
|
2450
|
+
const { user } = Theme.useAuth("NpsSurvey", (auth) => auth);
|
|
2315
2451
|
if (!displaySurvey) {
|
|
2316
2452
|
return null;
|
|
2317
2453
|
}
|
|
@@ -2581,11 +2717,11 @@ const REGISTER_ADMIN_SCHEMA = yup__namespace.object().shape({
|
|
|
2581
2717
|
})
|
|
2582
2718
|
});
|
|
2583
2719
|
const Register = ({ hasAdmin }) => {
|
|
2584
|
-
const { toggleNotification } =
|
|
2720
|
+
const { toggleNotification } = Theme.useNotification();
|
|
2585
2721
|
const navigate = reactRouterDom.useNavigate();
|
|
2586
2722
|
const [submitCount, setSubmitCount] = React__namespace.useState(0);
|
|
2587
2723
|
const [apiError, setApiError] = React__namespace.useState();
|
|
2588
|
-
const { trackUsage } =
|
|
2724
|
+
const { trackUsage } = Theme.useTracking();
|
|
2589
2725
|
const { formatMessage } = reactIntl.useIntl();
|
|
2590
2726
|
const setSkipped = useGuidedTour("Register", (state) => state.setSkipped);
|
|
2591
2727
|
const { search: searchString } = reactRouterDom.useLocation();
|
|
@@ -2594,10 +2730,10 @@ const Register = ({ hasAdmin }) => {
|
|
|
2594
2730
|
const {
|
|
2595
2731
|
_unstableFormatAPIError: formatAPIError,
|
|
2596
2732
|
_unstableFormatValidationErrors: formatValidationErrors
|
|
2597
|
-
} =
|
|
2733
|
+
} = Theme.useAPIErrorHandler();
|
|
2598
2734
|
const { setNpsSurveySettings } = useNpsSurveySettings();
|
|
2599
2735
|
const registrationToken = query.get("registrationToken");
|
|
2600
|
-
const { data: userInfo, error } =
|
|
2736
|
+
const { data: userInfo, error } = Theme.useGetRegistrationInfoQuery(registrationToken, {
|
|
2601
2737
|
skip: !registrationToken
|
|
2602
2738
|
});
|
|
2603
2739
|
React__namespace.useEffect(() => {
|
|
@@ -2610,9 +2746,9 @@ const Register = ({ hasAdmin }) => {
|
|
|
2610
2746
|
navigate(`/auth/oops?info=${encodeURIComponent(message)}`);
|
|
2611
2747
|
}
|
|
2612
2748
|
}, [error, formatAPIError, navigate, toggleNotification]);
|
|
2613
|
-
const [registerAdmin] =
|
|
2614
|
-
const [registerUser] =
|
|
2615
|
-
const { setToken } =
|
|
2749
|
+
const [registerAdmin] = Theme.useRegisterAdminMutation();
|
|
2750
|
+
const [registerUser] = Theme.useRegisterUserMutation();
|
|
2751
|
+
const { setToken } = Theme.useAuth("Register", (auth) => auth);
|
|
2616
2752
|
const handleRegisterAdmin = async ({ news, ...body }, setFormErrors) => {
|
|
2617
2753
|
const res = await registerAdmin(body);
|
|
2618
2754
|
if ("data" in res) {
|
|
@@ -2890,9 +3026,9 @@ const ResetPassword = () => {
|
|
|
2890
3026
|
const navigate = reactRouterDom.useNavigate();
|
|
2891
3027
|
const { search: searchString } = reactRouterDom.useLocation();
|
|
2892
3028
|
const query = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
|
2893
|
-
const { _unstableFormatAPIError: formatAPIError } =
|
|
2894
|
-
const { setToken } =
|
|
2895
|
-
const [resetPassword, { error }] =
|
|
3029
|
+
const { _unstableFormatAPIError: formatAPIError } = Theme.useAPIErrorHandler();
|
|
3030
|
+
const { setToken } = Theme.useAuth("ResetPassword", (auth) => auth);
|
|
3031
|
+
const [resetPassword, { error }] = Theme.useResetPasswordMutation();
|
|
2896
3032
|
const handleSubmit = async (body) => {
|
|
2897
3033
|
const res = await resetPassword(body);
|
|
2898
3034
|
if ("data" in res) {
|
|
@@ -2986,11 +3122,11 @@ const AuthPage = () => {
|
|
|
2986
3122
|
const { hasAdmin } = data ?? {};
|
|
2987
3123
|
const Login$1 = useEnterprise.useEnterprise(
|
|
2988
3124
|
Login,
|
|
2989
|
-
async () => (await Promise.resolve().then(() => require('./Login-
|
|
3125
|
+
async () => (await Promise.resolve().then(() => require('./Login-9bc4EDrd.js'))).LoginEE
|
|
2990
3126
|
);
|
|
2991
3127
|
const forms = useEnterprise.useEnterprise(
|
|
2992
3128
|
FORMS,
|
|
2993
|
-
async () => (await Promise.resolve().then(() => require('./constants-
|
|
3129
|
+
async () => (await Promise.resolve().then(() => require('./constants-qyti_7np.js'))).FORMS,
|
|
2994
3130
|
{
|
|
2995
3131
|
combine(ceForms, eeForms) {
|
|
2996
3132
|
return {
|
|
@@ -2998,257 +3134,42 @@ const AuthPage = () => {
|
|
|
2998
3134
|
...eeForms
|
|
2999
3135
|
};
|
|
3000
3136
|
},
|
|
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,
|
|
3137
|
+
defaultValue: FORMS
|
|
3138
|
+
}
|
|
3139
|
+
);
|
|
3140
|
+
const { token } = Theme.useAuth("AuthPage", (auth) => auth);
|
|
3141
|
+
if (!authType || !forms) {
|
|
3142
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/" });
|
|
3143
|
+
}
|
|
3144
|
+
const Component = forms[authType];
|
|
3145
|
+
if (!Component || hasAdmin && authType === "register-admin" || token) {
|
|
3146
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/" });
|
|
3147
|
+
}
|
|
3148
|
+
if (!hasAdmin && authType !== "register-admin") {
|
|
3149
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3150
|
+
reactRouterDom.Navigate,
|
|
3231
3151
|
{
|
|
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"
|
|
3152
|
+
to: {
|
|
3153
|
+
pathname: "/auth/register-admin",
|
|
3154
|
+
// Forward the `?redirectTo` from /auth/login
|
|
3155
|
+
// /abc => /auth/login?redirectTo=%2Fabc => /auth/register-admin?redirectTo=%2Fabc
|
|
3156
|
+
search
|
|
3157
|
+
}
|
|
3243
3158
|
}
|
|
3244
|
-
)
|
|
3245
|
-
|
|
3159
|
+
);
|
|
3160
|
+
}
|
|
3161
|
+
if (Login$1 && authType === "login") {
|
|
3162
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Login$1, {});
|
|
3163
|
+
} else if (authType === "login" && !Login$1) {
|
|
3164
|
+
return null;
|
|
3165
|
+
}
|
|
3166
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Component, { hasAdmin });
|
|
3246
3167
|
};
|
|
3247
3168
|
|
|
3248
3169
|
const ROUTES_CE = [
|
|
3249
3170
|
{
|
|
3250
3171
|
lazy: async () => {
|
|
3251
|
-
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-
|
|
3172
|
+
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-Tra1QVDy.js'));
|
|
3252
3173
|
return {
|
|
3253
3174
|
Component: ProtectedListPage
|
|
3254
3175
|
};
|
|
@@ -3257,7 +3178,7 @@ const ROUTES_CE = [
|
|
|
3257
3178
|
},
|
|
3258
3179
|
{
|
|
3259
3180
|
lazy: async () => {
|
|
3260
|
-
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-
|
|
3181
|
+
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-taYHLGep.js'));
|
|
3261
3182
|
return {
|
|
3262
3183
|
Component: ProtectedCreatePage
|
|
3263
3184
|
};
|
|
@@ -3266,7 +3187,7 @@ const ROUTES_CE = [
|
|
|
3266
3187
|
},
|
|
3267
3188
|
{
|
|
3268
3189
|
lazy: async () => {
|
|
3269
|
-
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-
|
|
3190
|
+
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-taYHLGep.js'));
|
|
3270
3191
|
return {
|
|
3271
3192
|
Component: ProtectedCreatePage
|
|
3272
3193
|
};
|
|
@@ -3275,7 +3196,7 @@ const ROUTES_CE = [
|
|
|
3275
3196
|
},
|
|
3276
3197
|
{
|
|
3277
3198
|
lazy: async () => {
|
|
3278
|
-
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-
|
|
3199
|
+
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-_caeCOYK.js'));
|
|
3279
3200
|
return {
|
|
3280
3201
|
Component: ProtectedEditPage
|
|
3281
3202
|
};
|
|
@@ -3284,7 +3205,7 @@ const ROUTES_CE = [
|
|
|
3284
3205
|
},
|
|
3285
3206
|
{
|
|
3286
3207
|
lazy: async () => {
|
|
3287
|
-
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-
|
|
3208
|
+
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-lpSNR8MY.js'));
|
|
3288
3209
|
return {
|
|
3289
3210
|
Component: ProtectedListPage
|
|
3290
3211
|
};
|
|
@@ -3293,7 +3214,7 @@ const ROUTES_CE = [
|
|
|
3293
3214
|
},
|
|
3294
3215
|
{
|
|
3295
3216
|
lazy: async () => {
|
|
3296
|
-
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-
|
|
3217
|
+
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-q_7kn0JT.js'));
|
|
3297
3218
|
return {
|
|
3298
3219
|
Component: ProtectedEditPage
|
|
3299
3220
|
};
|
|
@@ -3302,7 +3223,7 @@ const ROUTES_CE = [
|
|
|
3302
3223
|
},
|
|
3303
3224
|
{
|
|
3304
3225
|
lazy: async () => {
|
|
3305
|
-
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-
|
|
3226
|
+
const { ProtectedCreatePage } = await Promise.resolve().then(() => require('./CreatePage-mQUbZZJv.js'));
|
|
3306
3227
|
return {
|
|
3307
3228
|
Component: ProtectedCreatePage
|
|
3308
3229
|
};
|
|
@@ -3311,7 +3232,7 @@ const ROUTES_CE = [
|
|
|
3311
3232
|
},
|
|
3312
3233
|
{
|
|
3313
3234
|
lazy: async () => {
|
|
3314
|
-
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-
|
|
3235
|
+
const { ProtectedEditPage } = await Promise.resolve().then(() => require('./EditPage-rxs9-apI.js')).then(n => n.EditPage$1);
|
|
3315
3236
|
return {
|
|
3316
3237
|
Component: ProtectedEditPage
|
|
3317
3238
|
};
|
|
@@ -3320,7 +3241,7 @@ const ROUTES_CE = [
|
|
|
3320
3241
|
},
|
|
3321
3242
|
{
|
|
3322
3243
|
lazy: async () => {
|
|
3323
|
-
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-
|
|
3244
|
+
const { ProtectedListPage } = await Promise.resolve().then(() => require('./ListPage-6iZqugjj.js'));
|
|
3324
3245
|
return {
|
|
3325
3246
|
Component: ProtectedListPage
|
|
3326
3247
|
};
|
|
@@ -3329,7 +3250,7 @@ const ROUTES_CE = [
|
|
|
3329
3250
|
},
|
|
3330
3251
|
{
|
|
3331
3252
|
lazy: async () => {
|
|
3332
|
-
const { ProtectedListView } = await Promise.resolve().then(() => require('./ListView-
|
|
3253
|
+
const { ProtectedListView } = await Promise.resolve().then(() => require('./ListView-wx2Wg7AQ.js'));
|
|
3333
3254
|
return {
|
|
3334
3255
|
Component: ProtectedListView
|
|
3335
3256
|
};
|
|
@@ -3338,68 +3259,482 @@ const ROUTES_CE = [
|
|
|
3338
3259
|
},
|
|
3339
3260
|
{
|
|
3340
3261
|
lazy: async () => {
|
|
3341
|
-
const { ProtectedCreateView } = await Promise.resolve().then(() => require('./CreateView-
|
|
3262
|
+
const { ProtectedCreateView } = await Promise.resolve().then(() => require('./CreateView-oRYdhduP.js'));
|
|
3263
|
+
return {
|
|
3264
|
+
Component: ProtectedCreateView
|
|
3265
|
+
};
|
|
3266
|
+
},
|
|
3267
|
+
path: "api-tokens/create"
|
|
3268
|
+
},
|
|
3269
|
+
{
|
|
3270
|
+
lazy: async () => {
|
|
3271
|
+
const { ProtectedEditView } = await Promise.resolve().then(() => require('./EditViewPage-O3dTB0ur.js'));
|
|
3272
|
+
return {
|
|
3273
|
+
Component: ProtectedEditView
|
|
3274
|
+
};
|
|
3275
|
+
},
|
|
3276
|
+
path: "api-tokens/:id"
|
|
3277
|
+
},
|
|
3278
|
+
{
|
|
3279
|
+
lazy: async () => {
|
|
3280
|
+
const { ProtectedCreateView } = await Promise.resolve().then(() => require('./CreateView-iUA3lEYs.js'));
|
|
3342
3281
|
return {
|
|
3343
3282
|
Component: ProtectedCreateView
|
|
3344
3283
|
};
|
|
3345
3284
|
},
|
|
3346
|
-
path: "
|
|
3347
|
-
},
|
|
3348
|
-
{
|
|
3349
|
-
lazy: async () => {
|
|
3350
|
-
const {
|
|
3351
|
-
return {
|
|
3352
|
-
Component:
|
|
3353
|
-
};
|
|
3285
|
+
path: "transfer-tokens/create"
|
|
3286
|
+
},
|
|
3287
|
+
{
|
|
3288
|
+
lazy: async () => {
|
|
3289
|
+
const { ProtectedListView } = await Promise.resolve().then(() => require('./ListView-QVoBfZkP.js'));
|
|
3290
|
+
return {
|
|
3291
|
+
Component: ProtectedListView
|
|
3292
|
+
};
|
|
3293
|
+
},
|
|
3294
|
+
path: "transfer-tokens"
|
|
3295
|
+
},
|
|
3296
|
+
{
|
|
3297
|
+
lazy: async () => {
|
|
3298
|
+
const { ProtectedEditView } = await Promise.resolve().then(() => require('./EditView-tAF5eQf_.js'));
|
|
3299
|
+
return {
|
|
3300
|
+
Component: ProtectedEditView
|
|
3301
|
+
};
|
|
3302
|
+
},
|
|
3303
|
+
path: "transfer-tokens/:id"
|
|
3304
|
+
},
|
|
3305
|
+
{
|
|
3306
|
+
lazy: async () => {
|
|
3307
|
+
const { PurchaseAuditLogs } = await Promise.resolve().then(() => require('./PurchaseAuditLogs-I3m6LuoA.js'));
|
|
3308
|
+
return {
|
|
3309
|
+
Component: PurchaseAuditLogs
|
|
3310
|
+
};
|
|
3311
|
+
},
|
|
3312
|
+
path: "purchase-audit-logs"
|
|
3313
|
+
},
|
|
3314
|
+
{
|
|
3315
|
+
lazy: async () => {
|
|
3316
|
+
const { PurchaseSingleSignOn } = await Promise.resolve().then(() => require('./PurchaseSingleSignOn-HBKmhjTH.js'));
|
|
3317
|
+
return {
|
|
3318
|
+
Component: PurchaseSingleSignOn
|
|
3319
|
+
};
|
|
3320
|
+
},
|
|
3321
|
+
path: "purchase-single-sign-on"
|
|
3322
|
+
}
|
|
3323
|
+
];
|
|
3324
|
+
|
|
3325
|
+
const getImmutableRoutes = () => [
|
|
3326
|
+
{
|
|
3327
|
+
path: "usecase",
|
|
3328
|
+
lazy: async () => {
|
|
3329
|
+
const { PrivateUseCasePage } = await Promise.resolve().then(() => require('./UseCasePage-uJRpPeQz.js'));
|
|
3330
|
+
return {
|
|
3331
|
+
Component: PrivateUseCasePage
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
},
|
|
3335
|
+
// this needs to go before auth/:authType because otherwise it won't match the route
|
|
3336
|
+
...getEERoutes$1(),
|
|
3337
|
+
{
|
|
3338
|
+
path: "auth/:authType",
|
|
3339
|
+
element: /* @__PURE__ */ jsxRuntime.jsx(AuthPage, {})
|
|
3340
|
+
}
|
|
3341
|
+
];
|
|
3342
|
+
const getInitialRoutes = () => [
|
|
3343
|
+
{
|
|
3344
|
+
index: true,
|
|
3345
|
+
lazy: async () => {
|
|
3346
|
+
const { HomePage } = await Promise.resolve().then(() => require('./HomePage-QFIF1udT.js'));
|
|
3347
|
+
return {
|
|
3348
|
+
Component: HomePage
|
|
3349
|
+
};
|
|
3350
|
+
}
|
|
3351
|
+
},
|
|
3352
|
+
{
|
|
3353
|
+
path: "me",
|
|
3354
|
+
lazy: async () => {
|
|
3355
|
+
const { ProfilePage } = await Promise.resolve().then(() => require('./ProfilePage-pllDh5dd.js'));
|
|
3356
|
+
return {
|
|
3357
|
+
Component: ProfilePage
|
|
3358
|
+
};
|
|
3359
|
+
}
|
|
3360
|
+
},
|
|
3361
|
+
{
|
|
3362
|
+
path: "list-plugins",
|
|
3363
|
+
lazy: async () => {
|
|
3364
|
+
const { ProtectedInstalledPluginsPage } = await Promise.resolve().then(() => require('./InstalledPluginsPage-XP8i3w5T.js'));
|
|
3365
|
+
return {
|
|
3366
|
+
Component: ProtectedInstalledPluginsPage
|
|
3367
|
+
};
|
|
3368
|
+
}
|
|
3369
|
+
},
|
|
3370
|
+
{
|
|
3371
|
+
path: "marketplace",
|
|
3372
|
+
lazy: async () => {
|
|
3373
|
+
const { ProtectedMarketplacePage } = await Promise.resolve().then(() => require('./MarketplacePage-e9h-T9Yf.js'));
|
|
3374
|
+
return {
|
|
3375
|
+
Component: ProtectedMarketplacePage
|
|
3376
|
+
};
|
|
3377
|
+
}
|
|
3378
|
+
},
|
|
3379
|
+
{
|
|
3380
|
+
path: "settings/*",
|
|
3381
|
+
lazy: async () => {
|
|
3382
|
+
const { Layout } = await Promise.resolve().then(() => require('./Layout-PemM8Wd3.js'));
|
|
3383
|
+
return {
|
|
3384
|
+
Component: Layout
|
|
3385
|
+
};
|
|
3386
|
+
},
|
|
3387
|
+
children: [
|
|
3388
|
+
{
|
|
3389
|
+
path: "application-infos",
|
|
3390
|
+
lazy: async () => {
|
|
3391
|
+
const { ApplicationInfoPage } = await Promise.resolve().then(() => require('./ApplicationInfoPage-QuYJM0kA.js'));
|
|
3392
|
+
return {
|
|
3393
|
+
Component: ApplicationInfoPage
|
|
3394
|
+
};
|
|
3395
|
+
}
|
|
3396
|
+
},
|
|
3397
|
+
// ...Object.values(this.settings).flatMap(({ links }) =>
|
|
3398
|
+
// links.map(({ to, Component }) => ({
|
|
3399
|
+
// path: `${to}/*`,
|
|
3400
|
+
// element: (
|
|
3401
|
+
// <React.Suspense fallback={<Page.Loading />}>
|
|
3402
|
+
// <Component />
|
|
3403
|
+
// </React.Suspense>
|
|
3404
|
+
// ),
|
|
3405
|
+
// }))
|
|
3406
|
+
// ),
|
|
3407
|
+
...[...getEERoutes(), ...ROUTES_CE].filter(
|
|
3408
|
+
(route, index, refArray) => refArray.findIndex((obj) => obj.path === route.path) === index
|
|
3409
|
+
)
|
|
3410
|
+
]
|
|
3411
|
+
}
|
|
3412
|
+
];
|
|
3413
|
+
|
|
3414
|
+
class Router {
|
|
3415
|
+
_routes = [];
|
|
3416
|
+
router = null;
|
|
3417
|
+
_menu = [];
|
|
3418
|
+
_settings = {
|
|
3419
|
+
global: {
|
|
3420
|
+
id: "global",
|
|
3421
|
+
intlLabel: {
|
|
3422
|
+
id: "Settings.global",
|
|
3423
|
+
defaultMessage: "Global Settings"
|
|
3424
|
+
},
|
|
3425
|
+
links: []
|
|
3426
|
+
}
|
|
3427
|
+
};
|
|
3428
|
+
constructor(initialRoutes) {
|
|
3429
|
+
this._routes = initialRoutes;
|
|
3430
|
+
}
|
|
3431
|
+
get routes() {
|
|
3432
|
+
return this._routes;
|
|
3433
|
+
}
|
|
3434
|
+
get menu() {
|
|
3435
|
+
return this._menu;
|
|
3436
|
+
}
|
|
3437
|
+
get settings() {
|
|
3438
|
+
return this._settings;
|
|
3439
|
+
}
|
|
3440
|
+
/**
|
|
3441
|
+
* @internal This method is used internally by Strapi to create the router.
|
|
3442
|
+
* It should not be used by plugins, doing so will likely break the application.
|
|
3443
|
+
*/
|
|
3444
|
+
createRouter(strapi, { memory, ...opts } = {}) {
|
|
3445
|
+
const routes = [
|
|
3446
|
+
{
|
|
3447
|
+
path: "/*",
|
|
3448
|
+
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, {}) }) }) }),
|
|
3449
|
+
element: /* @__PURE__ */ jsxRuntime.jsx(App, { strapi, store: strapi.store }),
|
|
3450
|
+
children: [
|
|
3451
|
+
...getImmutableRoutes(),
|
|
3452
|
+
{
|
|
3453
|
+
path: "/*",
|
|
3454
|
+
lazy: async () => {
|
|
3455
|
+
const { PrivateAdminLayout } = await Promise.resolve().then(() => require('./AuthenticatedLayout-040fsD08.js'));
|
|
3456
|
+
return {
|
|
3457
|
+
Component: PrivateAdminLayout
|
|
3458
|
+
};
|
|
3459
|
+
},
|
|
3460
|
+
children: [
|
|
3461
|
+
...this.routes,
|
|
3462
|
+
{
|
|
3463
|
+
path: "*",
|
|
3464
|
+
element: /* @__PURE__ */ jsxRuntime.jsx(NotFoundPage, {})
|
|
3465
|
+
}
|
|
3466
|
+
]
|
|
3467
|
+
}
|
|
3468
|
+
]
|
|
3469
|
+
}
|
|
3470
|
+
];
|
|
3471
|
+
if (memory) {
|
|
3472
|
+
this.router = reactRouterDom.createMemoryRouter(routes, opts);
|
|
3473
|
+
} else {
|
|
3474
|
+
this.router = reactRouterDom.createBrowserRouter(routes, opts);
|
|
3475
|
+
}
|
|
3476
|
+
return this.router;
|
|
3477
|
+
}
|
|
3478
|
+
addMenuLink = (link) => {
|
|
3479
|
+
invariant__default.default(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3480
|
+
invariant__default.default(
|
|
3481
|
+
typeof link.to === "string",
|
|
3482
|
+
`[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
|
|
3483
|
+
);
|
|
3484
|
+
invariant__default.default(
|
|
3485
|
+
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3486
|
+
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
|
|
3487
|
+
);
|
|
3488
|
+
invariant__default.default(
|
|
3489
|
+
!link.Component || link.Component && typeof link.Component === "function",
|
|
3490
|
+
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
|
|
3491
|
+
);
|
|
3492
|
+
if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3493
|
+
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3494
|
+
console.warn(
|
|
3495
|
+
`
|
|
3496
|
+
[${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.
|
|
3497
|
+
`.trim()
|
|
3498
|
+
);
|
|
3499
|
+
}
|
|
3500
|
+
if (link.to.startsWith("/")) {
|
|
3501
|
+
console.warn(
|
|
3502
|
+
`[${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.`
|
|
3503
|
+
);
|
|
3504
|
+
link.to = link.to.slice(1);
|
|
3505
|
+
}
|
|
3506
|
+
const { Component, ...restLink } = link;
|
|
3507
|
+
if (Component) {
|
|
3508
|
+
this._routes.push({
|
|
3509
|
+
path: `${link.to}/*`,
|
|
3510
|
+
lazy: async () => {
|
|
3511
|
+
const mod = await Component();
|
|
3512
|
+
if ("default" in mod) {
|
|
3513
|
+
return { Component: mod.default };
|
|
3514
|
+
} else {
|
|
3515
|
+
return { Component: mod };
|
|
3516
|
+
}
|
|
3517
|
+
}
|
|
3518
|
+
});
|
|
3519
|
+
}
|
|
3520
|
+
this.menu.push(restLink);
|
|
3521
|
+
};
|
|
3522
|
+
addSettingsLink(section, link) {
|
|
3523
|
+
if (typeof section === "object" && "links" in section) {
|
|
3524
|
+
invariant__default.default(section.id, "section.id should be defined");
|
|
3525
|
+
invariant__default.default(
|
|
3526
|
+
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3527
|
+
"section.intlLabel should be defined"
|
|
3528
|
+
);
|
|
3529
|
+
invariant__default.default(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3530
|
+
invariant__default.default(Array.isArray(section.links), "TypeError expected links to be an array");
|
|
3531
|
+
this.settings[section.id] = { ...section, links: [] };
|
|
3532
|
+
section.links.forEach((link2) => {
|
|
3533
|
+
this.createSettingsLink(section.id, link2);
|
|
3534
|
+
});
|
|
3535
|
+
} else if (typeof section === "object" && link) {
|
|
3536
|
+
invariant__default.default(section.id, "section.id should be defined");
|
|
3537
|
+
invariant__default.default(
|
|
3538
|
+
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3539
|
+
"section.intlLabel should be defined"
|
|
3540
|
+
);
|
|
3541
|
+
invariant__default.default(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3542
|
+
this.settings[section.id] = { ...section, links: [] };
|
|
3543
|
+
if (Array.isArray(link)) {
|
|
3544
|
+
link.forEach((l) => this.createSettingsLink(section.id, l));
|
|
3545
|
+
} else {
|
|
3546
|
+
this.createSettingsLink(section.id, link);
|
|
3547
|
+
}
|
|
3548
|
+
} else if (typeof section === "string" && link) {
|
|
3549
|
+
if (Array.isArray(link)) {
|
|
3550
|
+
link.forEach((l) => this.createSettingsLink(section, l));
|
|
3551
|
+
} else {
|
|
3552
|
+
this.createSettingsLink(section, link);
|
|
3553
|
+
}
|
|
3554
|
+
} else {
|
|
3555
|
+
throw new Error(
|
|
3556
|
+
"Invalid arguments provided to addSettingsLink, at minimum a sectionId and link are required."
|
|
3557
|
+
);
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
createSettingsLink = (sectionId, link) => {
|
|
3561
|
+
invariant__default.default(this._settings[sectionId], "The section does not exist");
|
|
3562
|
+
invariant__default.default(link.id, `[${link.intlLabel.defaultMessage}]: link.id should be defined`);
|
|
3563
|
+
invariant__default.default(
|
|
3564
|
+
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3565
|
+
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
|
|
3566
|
+
);
|
|
3567
|
+
invariant__default.default(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3568
|
+
invariant__default.default(
|
|
3569
|
+
!link.Component || link.Component && typeof link.Component === "function",
|
|
3570
|
+
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
|
|
3571
|
+
);
|
|
3572
|
+
if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3573
|
+
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3574
|
+
console.warn(
|
|
3575
|
+
`
|
|
3576
|
+
[${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.
|
|
3577
|
+
`.trim()
|
|
3578
|
+
);
|
|
3579
|
+
}
|
|
3580
|
+
if (link.to.startsWith("/")) {
|
|
3581
|
+
console.warn(
|
|
3582
|
+
`[${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.`
|
|
3583
|
+
);
|
|
3584
|
+
link.to = link.to.slice(1);
|
|
3585
|
+
}
|
|
3586
|
+
if (link.to.split("/")[0] === "settings") {
|
|
3587
|
+
console.warn(
|
|
3588
|
+
`[${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.`
|
|
3589
|
+
);
|
|
3590
|
+
link.to = link.to.split("/").slice(1).join("/");
|
|
3591
|
+
}
|
|
3592
|
+
const { Component, ...restLink } = link;
|
|
3593
|
+
const settingsIndex = this._routes.findIndex((route) => route.path === "settings/*");
|
|
3594
|
+
if (!settingsIndex) {
|
|
3595
|
+
console.warn(
|
|
3596
|
+
"A third party plugin has removed the settings section, the settings link cannot be added."
|
|
3597
|
+
);
|
|
3598
|
+
return;
|
|
3599
|
+
} else if (!this._routes[settingsIndex].children) {
|
|
3600
|
+
this._routes[settingsIndex].children = [];
|
|
3601
|
+
}
|
|
3602
|
+
if (Component) {
|
|
3603
|
+
this._routes[settingsIndex].children.push({
|
|
3604
|
+
path: `${link.to}/*`,
|
|
3605
|
+
lazy: async () => {
|
|
3606
|
+
const mod = await Component();
|
|
3607
|
+
if ("default" in mod) {
|
|
3608
|
+
return { Component: mod.default };
|
|
3609
|
+
} else {
|
|
3610
|
+
return { Component: mod };
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
});
|
|
3614
|
+
}
|
|
3615
|
+
this._settings[sectionId].links.push(restLink);
|
|
3616
|
+
};
|
|
3617
|
+
/**
|
|
3618
|
+
* @alpha
|
|
3619
|
+
* @description Adds a route or an array of routes to the router.
|
|
3620
|
+
* Otherwise, pass a function that receives the current routes and
|
|
3621
|
+
* returns the new routes in a reducer like fashion.
|
|
3622
|
+
*/
|
|
3623
|
+
addRoute(route) {
|
|
3624
|
+
if (Array.isArray(route)) {
|
|
3625
|
+
this._routes = [...this._routes, ...route];
|
|
3626
|
+
} else if (typeof route === "object" && route !== null) {
|
|
3627
|
+
this._routes.push(route);
|
|
3628
|
+
} else if (typeof route === "function") {
|
|
3629
|
+
this._routes = route(this._routes);
|
|
3630
|
+
} else {
|
|
3631
|
+
throw new Error(
|
|
3632
|
+
`Expected the \`route\` passed to \`addRoute\` to be an array or a function, but received ${getPrintableType(
|
|
3633
|
+
route
|
|
3634
|
+
)}`
|
|
3635
|
+
);
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
const getPrintableType = (value) => {
|
|
3640
|
+
const nativeType = typeof value;
|
|
3641
|
+
if (nativeType === "object") {
|
|
3642
|
+
if (value === null)
|
|
3643
|
+
return "null";
|
|
3644
|
+
if (Array.isArray(value))
|
|
3645
|
+
return "array";
|
|
3646
|
+
if (value instanceof Object && value.constructor.name !== "Object") {
|
|
3647
|
+
return value.constructor.name;
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
return nativeType;
|
|
3651
|
+
};
|
|
3652
|
+
|
|
3653
|
+
const staticReducers = {
|
|
3654
|
+
[admin.adminApi.reducerPath]: admin.adminApi.reducer,
|
|
3655
|
+
admin_app: Theme.reducer
|
|
3656
|
+
};
|
|
3657
|
+
const injectReducerStoreEnhancer = (appReducers) => (next) => (...args) => {
|
|
3658
|
+
const store = next(...args);
|
|
3659
|
+
const asyncReducers = {};
|
|
3660
|
+
return {
|
|
3661
|
+
...store,
|
|
3662
|
+
asyncReducers,
|
|
3663
|
+
injectReducer: (key, asyncReducer) => {
|
|
3664
|
+
asyncReducers[key] = asyncReducer;
|
|
3665
|
+
store.replaceReducer(
|
|
3666
|
+
// @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
|
|
3667
|
+
toolkit.combineReducers({
|
|
3668
|
+
...appReducers,
|
|
3669
|
+
...asyncReducers
|
|
3670
|
+
})
|
|
3671
|
+
);
|
|
3672
|
+
}
|
|
3673
|
+
};
|
|
3674
|
+
};
|
|
3675
|
+
const configureStoreImpl = (preloadedState = {}, appMiddlewares = [], injectedReducers = {}) => {
|
|
3676
|
+
const coreReducers = { ...staticReducers, ...injectedReducers };
|
|
3677
|
+
const defaultMiddlewareOptions = {};
|
|
3678
|
+
if (process.env.NODE_ENV === "test") {
|
|
3679
|
+
defaultMiddlewareOptions.serializableCheck = false;
|
|
3680
|
+
defaultMiddlewareOptions.immutableCheck = false;
|
|
3681
|
+
}
|
|
3682
|
+
const store = toolkit.configureStore({
|
|
3683
|
+
preloadedState: {
|
|
3684
|
+
admin_app: preloadedState.admin_app
|
|
3685
|
+
},
|
|
3686
|
+
reducer: coreReducers,
|
|
3687
|
+
devTools: process.env.NODE_ENV !== "production",
|
|
3688
|
+
middleware: (getDefaultMiddleware) => [
|
|
3689
|
+
...getDefaultMiddleware(defaultMiddlewareOptions),
|
|
3690
|
+
admin.adminApi.middleware,
|
|
3691
|
+
...appMiddlewares.map((m) => m())
|
|
3692
|
+
],
|
|
3693
|
+
enhancers: [injectReducerStoreEnhancer(coreReducers)]
|
|
3694
|
+
});
|
|
3695
|
+
return store;
|
|
3696
|
+
};
|
|
3697
|
+
|
|
3698
|
+
const getBasename = () => (process.env.ADMIN_PATH ?? "").replace(window.location.origin, "");
|
|
3699
|
+
|
|
3700
|
+
const createHook = () => {
|
|
3701
|
+
const _handlers = [];
|
|
3702
|
+
return {
|
|
3703
|
+
register(fn) {
|
|
3704
|
+
_handlers.push(fn);
|
|
3354
3705
|
},
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
{
|
|
3358
|
-
lazy: async () => {
|
|
3359
|
-
const { ProtectedCreateView } = await Promise.resolve().then(() => require('./CreateView-JQYIo77z.js'));
|
|
3360
|
-
return {
|
|
3361
|
-
Component: ProtectedCreateView
|
|
3362
|
-
};
|
|
3706
|
+
delete(handler) {
|
|
3707
|
+
_handlers.splice(_handlers.indexOf(handler), 1);
|
|
3363
3708
|
},
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
{
|
|
3367
|
-
lazy: async () => {
|
|
3368
|
-
const { ProtectedListView } = await Promise.resolve().then(() => require('./ListView-nRGxAwIh.js'));
|
|
3369
|
-
return {
|
|
3370
|
-
Component: ProtectedListView
|
|
3371
|
-
};
|
|
3709
|
+
runWaterfall(args, store) {
|
|
3710
|
+
return _handlers.reduce((acc, fn) => fn(acc, store), args);
|
|
3372
3711
|
},
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
return
|
|
3379
|
-
Component: ProtectedEditView
|
|
3380
|
-
};
|
|
3712
|
+
async runWaterfallAsync(args, store) {
|
|
3713
|
+
let result = args;
|
|
3714
|
+
for (const fn of _handlers) {
|
|
3715
|
+
result = await fn(result, store);
|
|
3716
|
+
}
|
|
3717
|
+
return result;
|
|
3381
3718
|
},
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
{
|
|
3385
|
-
lazy: async () => {
|
|
3386
|
-
const { PurchaseAuditLogs } = await Promise.resolve().then(() => require('./PurchaseAuditLogs-Vur69JZB.js'));
|
|
3387
|
-
return {
|
|
3388
|
-
Component: PurchaseAuditLogs
|
|
3389
|
-
};
|
|
3719
|
+
runSeries(...args) {
|
|
3720
|
+
return _handlers.map((fn) => fn(...args));
|
|
3390
3721
|
},
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
return
|
|
3397
|
-
Component: PurchaseSingleSignOn
|
|
3398
|
-
};
|
|
3722
|
+
async runSeriesAsync(...args) {
|
|
3723
|
+
const result = [];
|
|
3724
|
+
for (const fn of _handlers) {
|
|
3725
|
+
result.push(await fn(...args));
|
|
3726
|
+
}
|
|
3727
|
+
return result;
|
|
3399
3728
|
},
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3729
|
+
runParallel(...args) {
|
|
3730
|
+
return Promise.all(
|
|
3731
|
+
_handlers.map((fn) => {
|
|
3732
|
+
return fn(...args);
|
|
3733
|
+
})
|
|
3734
|
+
);
|
|
3735
|
+
}
|
|
3736
|
+
};
|
|
3737
|
+
};
|
|
3403
3738
|
|
|
3404
3739
|
const languageNativeNames = {
|
|
3405
3740
|
ar: "العربية",
|
|
@@ -3452,20 +3787,6 @@ class StrapiApp {
|
|
|
3452
3787
|
injectionZones: {}
|
|
3453
3788
|
};
|
|
3454
3789
|
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
3790
|
configurations = {
|
|
3470
3791
|
authLogo: StrapiLogo,
|
|
3471
3792
|
head: { favicon: "" },
|
|
@@ -3479,13 +3800,15 @@ class StrapiApp {
|
|
|
3479
3800
|
/**
|
|
3480
3801
|
* APIs
|
|
3481
3802
|
*/
|
|
3482
|
-
rbac = new
|
|
3803
|
+
rbac = new Theme.RBAC();
|
|
3804
|
+
router;
|
|
3483
3805
|
library = {
|
|
3484
3806
|
components: {},
|
|
3485
3807
|
fields: {}
|
|
3486
3808
|
};
|
|
3487
3809
|
middlewares = [];
|
|
3488
3810
|
reducers = {};
|
|
3811
|
+
store = null;
|
|
3489
3812
|
customFields = new CustomFields();
|
|
3490
3813
|
constructor({ config, appPlugins } = {}) {
|
|
3491
3814
|
this.appPlugins = appPlugins || {};
|
|
@@ -3494,6 +3817,7 @@ class StrapiApp {
|
|
|
3494
3817
|
this.createHook(MUTATE_COLLECTION_TYPES_LINKS);
|
|
3495
3818
|
this.createHook(MUTATE_SINGLE_TYPES_LINKS);
|
|
3496
3819
|
this.createHook(MUTATE_EDIT_VIEW_LAYOUT);
|
|
3820
|
+
this.router = new Router(getInitialRoutes());
|
|
3497
3821
|
}
|
|
3498
3822
|
addComponents = (components) => {
|
|
3499
3823
|
if (Array.isArray(components)) {
|
|
@@ -3521,46 +3845,6 @@ class StrapiApp {
|
|
|
3521
3845
|
this.library.fields[fields.type] = fields.Component;
|
|
3522
3846
|
}
|
|
3523
3847
|
};
|
|
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
3848
|
addMiddlewares = (middlewares) => {
|
|
3565
3849
|
middlewares.forEach((middleware) => {
|
|
3566
3850
|
this.middlewares.push(middleware);
|
|
@@ -3578,56 +3862,22 @@ class StrapiApp {
|
|
|
3578
3862
|
this.reducers[name] = reducer;
|
|
3579
3863
|
});
|
|
3580
3864
|
};
|
|
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
|
-
};
|
|
3865
|
+
addMenuLink = (link) => this.router.addMenuLink(link);
|
|
3866
|
+
/**
|
|
3867
|
+
* @deprecated use `addSettingsLink` instead, it internally supports
|
|
3868
|
+
* adding multiple links at once.
|
|
3869
|
+
*/
|
|
3625
3870
|
addSettingsLinks = (sectionId, links) => {
|
|
3626
|
-
invariant__default.default(this.settings[sectionId], "The section does not exist");
|
|
3627
3871
|
invariant__default.default(Array.isArray(links), "TypeError expected links to be an array");
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3872
|
+
this.router.addSettingsLink(sectionId, links);
|
|
3873
|
+
};
|
|
3874
|
+
/**
|
|
3875
|
+
* @deprecated use `addSettingsLink` instead, you can pass a section object to
|
|
3876
|
+
* create the section and links at the same time.
|
|
3877
|
+
*/
|
|
3878
|
+
createSettingSection = (section, links) => this.router.addSettingsLink(section, links);
|
|
3879
|
+
addSettingsLink = (sectionId, link) => {
|
|
3880
|
+
this.router.addSettingsLink(sectionId, link);
|
|
3631
3881
|
};
|
|
3632
3882
|
async bootstrap(customBootstrap) {
|
|
3633
3883
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
@@ -3694,19 +3944,6 @@ class StrapiApp {
|
|
|
3694
3944
|
createHook = (name) => {
|
|
3695
3945
|
this.hooksDict[name] = createHook();
|
|
3696
3946
|
};
|
|
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
3947
|
getAdminInjectedComponents = (moduleName, containerName, blockName) => {
|
|
3711
3948
|
try {
|
|
3712
3949
|
return this.admin.injectionZones[moduleName][containerName][blockName] || [];
|
|
@@ -3716,10 +3953,13 @@ class StrapiApp {
|
|
|
3716
3953
|
}
|
|
3717
3954
|
};
|
|
3718
3955
|
getPlugin = (pluginId) => this.plugins[pluginId];
|
|
3719
|
-
async register() {
|
|
3956
|
+
async register(customRegister) {
|
|
3720
3957
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
3721
3958
|
this.appPlugins[plugin].register(this);
|
|
3722
3959
|
});
|
|
3960
|
+
if (isFunction__default.default(customRegister)) {
|
|
3961
|
+
customRegister(this);
|
|
3962
|
+
}
|
|
3723
3963
|
}
|
|
3724
3964
|
async loadAdminTrads() {
|
|
3725
3965
|
const adminLocales = await Promise.all(
|
|
@@ -3798,14 +4038,14 @@ class StrapiApp {
|
|
|
3798
4038
|
runHookParallel = (name) => this.hooksDict[name].runParallel();
|
|
3799
4039
|
render() {
|
|
3800
4040
|
const localeNames = pick__default.default(languageNativeNames, this.configurations.locales || []);
|
|
3801
|
-
const locale = localStorage.getItem(
|
|
3802
|
-
|
|
4041
|
+
const locale = localStorage.getItem(Theme.LANGUAGE_LOCAL_STORAGE_KEY) || "en";
|
|
4042
|
+
this.store = configureStoreImpl(
|
|
3803
4043
|
{
|
|
3804
4044
|
admin_app: {
|
|
3805
4045
|
permissions: merge__default.default({}, ADMIN_PERMISSIONS_CE, ADMIN_PERMISSIONS_EE),
|
|
3806
4046
|
theme: {
|
|
3807
4047
|
availableThemes: [],
|
|
3808
|
-
currentTheme: localStorage.getItem(
|
|
4048
|
+
currentTheme: localStorage.getItem(Theme.THEME_LOCAL_STORAGE_KEY) || "system"
|
|
3809
4049
|
},
|
|
3810
4050
|
language: {
|
|
3811
4051
|
locale: localeNames[locale] ? locale : "en",
|
|
@@ -3816,120 +4056,9 @@ class StrapiApp {
|
|
|
3816
4056
|
this.middlewares,
|
|
3817
4057
|
this.reducers
|
|
3818
4058
|
);
|
|
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
|
-
);
|
|
4059
|
+
const router = this.router.createRouter(this, {
|
|
4060
|
+
basename: getBasename()
|
|
4061
|
+
});
|
|
3933
4062
|
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.RouterProvider, { router });
|
|
3934
4063
|
}
|
|
3935
4064
|
}
|
|
@@ -3991,7 +4120,7 @@ const renderAdmin = async (mountNode, { plugins, customisations, features }) =>
|
|
|
3991
4120
|
config: customisations?.config,
|
|
3992
4121
|
appPlugins: plugins
|
|
3993
4122
|
});
|
|
3994
|
-
await app.register();
|
|
4123
|
+
await app.register(customisations?.register);
|
|
3995
4124
|
await app.bootstrap(customisations?.bootstrap);
|
|
3996
4125
|
await app.loadTrads(customisations?.config?.translations);
|
|
3997
4126
|
client.createRoot(mountNode).render(app.render());
|
|
@@ -4380,7 +4509,7 @@ const useQueryParams = (initialParams) => {
|
|
|
4380
4509
|
return [{ query, rawQuery: search }, setQuery];
|
|
4381
4510
|
};
|
|
4382
4511
|
|
|
4383
|
-
const [FiltersProvider, useFilters] =
|
|
4512
|
+
const [FiltersProvider, useFilters] = Theme.createContext("Filters");
|
|
4384
4513
|
const Root$2 = ({
|
|
4385
4514
|
children,
|
|
4386
4515
|
disabled = false,
|
|
@@ -4704,7 +4833,7 @@ const Filters = {
|
|
|
4704
4833
|
Trigger
|
|
4705
4834
|
};
|
|
4706
4835
|
|
|
4707
|
-
const [PaginationProvider, usePagination] =
|
|
4836
|
+
const [PaginationProvider, usePagination] = Theme.createContext("Pagination");
|
|
4708
4837
|
const Root$1 = React__namespace.forwardRef(
|
|
4709
4838
|
({ children, defaultPageSize = 10, pageCount = 0, defaultPage = 1, onPageSizeChange, total = 0 }, forwardedRef) => {
|
|
4710
4839
|
const [{ query }, setQuery] = useQueryParams(
|
|
@@ -4719,18 +4848,28 @@ const Root$1 = React__namespace.forwardRef(
|
|
|
4719
4848
|
onPageSizeChange(pageSize);
|
|
4720
4849
|
}
|
|
4721
4850
|
};
|
|
4722
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4723
|
-
|
|
4851
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4852
|
+
designSystem.Flex,
|
|
4724
4853
|
{
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4854
|
+
ref: forwardedRef,
|
|
4855
|
+
paddingTop: 4,
|
|
4856
|
+
paddingBottom: 4,
|
|
4857
|
+
alignItems: "flex-end",
|
|
4858
|
+
justifyContent: "space-between",
|
|
4859
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4860
|
+
PaginationProvider,
|
|
4861
|
+
{
|
|
4862
|
+
currentQuery: query,
|
|
4863
|
+
page: query.page,
|
|
4864
|
+
pageSize: query.pageSize,
|
|
4865
|
+
pageCount: pageCount.toString(),
|
|
4866
|
+
setPageSize,
|
|
4867
|
+
total,
|
|
4868
|
+
children
|
|
4869
|
+
}
|
|
4870
|
+
)
|
|
4732
4871
|
}
|
|
4733
|
-
)
|
|
4872
|
+
);
|
|
4734
4873
|
}
|
|
4735
4874
|
);
|
|
4736
4875
|
const PageSize = ({ options = ["10", "20", "50", "100"] }) => {
|
|
@@ -4861,7 +5000,7 @@ const SearchInput = ({
|
|
|
4861
5000
|
const [value, setValue] = React__namespace.useState(query?._q || "");
|
|
4862
5001
|
const [isOpen, setIsOpen] = React__namespace.useState(!!value);
|
|
4863
5002
|
const { formatMessage } = reactIntl.useIntl();
|
|
4864
|
-
const { trackUsage } =
|
|
5003
|
+
const { trackUsage } = Theme.useTracking();
|
|
4865
5004
|
const handleToggle = () => setIsOpen((prev) => !prev);
|
|
4866
5005
|
React__namespace.useLayoutEffect(() => {
|
|
4867
5006
|
if (isOpen && inputRef.current) {
|
|
@@ -4911,7 +5050,7 @@ const SearchInput = ({
|
|
|
4911
5050
|
);
|
|
4912
5051
|
};
|
|
4913
5052
|
|
|
4914
|
-
const [TableProvider, useTable] =
|
|
5053
|
+
const [TableProvider, useTable] = Theme.createContext("Table");
|
|
4915
5054
|
const Root = ({
|
|
4916
5055
|
children,
|
|
4917
5056
|
defaultSelectedRows,
|
|
@@ -5141,7 +5280,7 @@ const Table = {
|
|
|
5141
5280
|
};
|
|
5142
5281
|
|
|
5143
5282
|
function useInjectReducer(namespace, reducer) {
|
|
5144
|
-
const store =
|
|
5283
|
+
const store = Theme.useTypedStore();
|
|
5145
5284
|
React.useEffect(() => {
|
|
5146
5285
|
store.injectReducer(namespace, reducer);
|
|
5147
5286
|
}, [store, namespace, reducer]);
|
|
@@ -5382,4 +5521,4 @@ exports.useTable = useTable;
|
|
|
5382
5521
|
exports.useUpdateRoleMutation = useUpdateRoleMutation;
|
|
5383
5522
|
exports.useUpdateRolePermissionsMutation = useUpdateRolePermissionsMutation;
|
|
5384
5523
|
exports.useUpdateUserMutation = useUpdateUserMutation;
|
|
5385
|
-
//# sourceMappingURL=index-
|
|
5524
|
+
//# sourceMappingURL=index-PPLoirnr.js.map
|